0.0.27 • Published 5 years ago

adesso-input v0.0.27

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

adesso-input

A Web Component for input field.

installation:

npm install adesso-input --save

To use this web component, you need to install "validator.js" aswell. If you dont already have it

npm install validator --save

usage:

first import script to your page

  import "adesso-input";

then in your markup

  <adesso-input
      required
      type="text"
      label="label"
      minlength="5">
      <i slot="rightIcon" className="fas fa-dragon"/>
  </div>

npm.io

Attributes:

AttributeDescriptiontypedefaultrequired
alphaalpha character validationBooleanfalseno
animatedlabel is static if this attiribute does not existBooleanfalseno
error-messagemessage to show when error occursStringfalseno
invalidset this as input exptected to be invalidBooleanfalseno
labellabel above input fieldStringnoneno
langlanguage codeStringen-USno
maxlengthmaximum number of character enabledStringnoneno
minlengthminimum number of character for validationStringnoneno
patternpatter to mask user input "A" for alpha chars "1" for numbersStringnoneno
placeholderplaceholderStringnoneno
regexregex to validate againstStringnoneno
requiredvalidation for emptyBooleannoneno
typeinput typeStringnoneyes
valueinput value for controlled input. event fired on input change is "textChanged"Stringnoneno

Events:

EventDescriptionrequired
errorEventfires with an error key when validation fails you can access key with "event.detail.key"no
textChangedfires with value of input when text changed you can access value with "event.detail.value"no

npm.io

Contributing:

Feel free to make your "Pull Request" 🏆

Future:

  • Notify parent component about "errorKey". Possible solition would be firing a custom event
  • Add input mask for custom pattern.
  • Add more options for pattern and validation.
  • Add testing.
0.0.27

5 years ago

0.0.26

5 years ago

0.0.25

5 years ago

0.0.24

5 years ago

0.0.23

5 years ago

0.0.22

5 years ago

0.0.21

5 years ago

0.0.20

5 years ago

0.0.19

5 years ago

0.0.18

5 years ago

0.0.17

5 years ago

0.0.16

5 years ago

0.0.15

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.3

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago