4.1.7 • Published 3 days ago

@dreamworld/dw-input v4.1.7

Weekly downloads
208
License
ISC
Repository
github
Last release
3 days ago

dw-input

A material input element made with lit-html. For more detail visit https://material.io/develop/web/components/input-controls/text-field/.

Installation

  npm install @dreamworld/dw-input

Usage

  @import '@dreamworld/dw-input/dw-input';

Demo

Features

  • It follows material design outlines input style and provides all features of it. know more
  • It auto select's text if autoSelect property is true
  • Provides a validator property to add custom validations
  • Set multiline to true to show input as text area
  • Set prefixSvgIcon and suffixSvgIcon to show prefix and suffix icon
  • Performs validation on blur. It also performs validation on User type if input is invalid.

Events

Triggers value-changed event on value change.

Methods

  • focus - Focuses the input

  • selectText - Selected input's text

  • validate - Call this to validate input. Returns false if value is invalid.

  • formattedValueGetter - Use to auto-format value on blur. It provides value in argument. It must be return a string.

  • focusedValueGetter - Use to set value on focus. It provides value in argument. It must be return a string.

Theme

Configure color of the icon using --dw-icon-color css variable.

Example css to change icon color

dw-input{
--dw-icon-color: green;
}

Custom input

Override dwInput class to create a custom input

class CustomInput extends DwInput {
  static get styles() {
  return [
    DwInput.styles,
    css`
      .mdc-text-field{
        border-radius: 8px;
      }`
    ];
  }
}
customElements.define('custom-input', CustomInput);

<custom-input></custom-input>

Examples

<dw-input label="Name" validator="<VALIDATION_FN>" placeholder="Enter name here" autoSelect required hint="Hint text"></dw-input>

<dw-input label="Number" disabled allowedPattern="[0-9]" value="12"></dw-input>

<dw-input label="Number" readOnly prefixSvgIcon='<SVG_PATH>'  suffixSvgIcon='<SVG_PATH>'></dw-input>

<dw-input noLabel multiline></dw-input>

<dw-input value="12" originalValue="12" highLightOnChanged></dw-input>
4.1.7

22 days ago

4.1.6

28 days ago

4.1.4

1 month ago

4.1.5

30 days ago

4.1.3

1 month ago

4.1.2

1 month ago

4.1.1

1 month ago

4.1.0

3 months ago

4.1.0-show-error.1

3 months ago

4.0.13

3 months ago

4.0.12

4 months ago

4.0.11

4 months ago

4.0.10

5 months ago

4.0.9

5 months ago

4.0.7

5 months ago

4.0.8

5 months ago

4.0.5

5 months ago

4.0.6

5 months ago

4.0.4

5 months ago

4.0.3

5 months ago

4.0.1

5 months ago

4.0.0

5 months ago

4.0.2

5 months ago

3.7.0

6 months ago

3.5.10

6 months ago

3.6.2

6 months ago

3.6.1

6 months ago

3.6.0

6 months ago

3.6.4

6 months ago

3.6.3

6 months ago

3.5.7

7 months ago

3.5.6

9 months ago

3.5.5

9 months ago

3.5.4

10 months ago

3.5.9

6 months ago

3.5.8

7 months ago

3.2.1

1 year ago

3.2.0

1 year ago

3.1.5

1 year ago

3.1.4

1 year ago

3.5.3

12 months ago

3.5.2

12 months ago

3.5.1

12 months ago

3.5.0

1 year ago

3.4.0

1 year ago

3.3.0

1 year ago

3.2.0-postfix.1

1 year ago

3.1.3

1 year ago

3.1.2

1 year ago

3.1.1

1 year ago

2.4.1

2 years ago

3.1.0

1 year ago

3.0.1

1 year ago

3.0.0

2 years ago

2.4.0

2 years ago

2.3.0

2 years ago

2.3.1

2 years ago

2.2.0

2 years ago

2.1.6

3 years ago

2.1.4

3 years ago

2.1.3

3 years ago

2.1.5

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

1.17.11

3 years ago

1.17.10

3 years ago

1.17.9

3 years ago

1.17.8

3 years ago

1.17.7

3 years ago

1.17.6

4 years ago

1.17.5

4 years ago

1.17.4

4 years ago

1.17.3

4 years ago

1.17.2

4 years ago

1.17.1

4 years ago

1.17.0

4 years ago

1.16.1

4 years ago

1.15.2

4 years ago

1.16.0

4 years ago

1.15.1

4 years ago

1.14.0

4 years ago

1.15.0

4 years ago

1.13.1

4 years ago

1.12.1

4 years ago

1.12.0

4 years ago

1.11.8

4 years ago

1.11.9

4 years ago

1.11.7

4 years ago

1.11.6

4 years ago

1.11.5

4 years ago

1.11.4

4 years ago

1.11.3

4 years ago

1.11.2

4 years ago

1.11.1

4 years ago

1.11.0

4 years ago

1.10.2

4 years ago

1.10.1

4 years ago

1.10.0

4 years ago

1.9.0

4 years ago

1.8.0

4 years ago

1.7.4

4 years ago

1.7.3

4 years ago

1.7.2

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.0

4 years ago

1.5.4

4 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.1.0-test.1

5 years ago

1.0.0

5 years ago