0.1.0 • Published 6 years ago

slung-web-component-input v0.1.0

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

slung-web-component-input

Install

npm instal slung-web-component-input 

Tag

<slung-input></slung-input>      

Dependencies

  • slung-web-framework
  • slung-web-helpers

    Attributes and properties

    NameTypeDefault valueReflectToAttributeObservercallSdk
    autocompleteString:heavy_check_mark:
    checkedBoolean:heavy_check_mark:
    disabledBoolean:heavy_check_mark:
    labelString:heavy_check_mark:
    typeStringtext:heavy_check_mark:formatType
    maxNumber:heavy_check_mark:
    maxlengthNumber:heavy_check_mark:
    minNumber:heavy_check_mark:
    minlengthNumber:heavy_check_mark:
    nameString:heavy_check_mark:
    patternString:heavy_check_mark:
    placeholderString:heavy_check_mark:
    readonlyBoolean:heavy_check_mark:
    requiredBoolean:heavy_check_mark:
    sizeNumber:heavy_check_mark:
    srcString:heavy_check_mark:
    stateString:heavy_check_mark:
    stepNumber:heavy_check_mark:
    validationmessageObject:heavy_check_mark:
    valueString:heavy_check_mark:formatValue

Description

NameDescription
autocompleteIndicates whether the control value can be automatically completed by the browser, is ignored if value of type attribute is hidden, password, checkbox, radio, file or button type (button, submit, reset, image). More information on input HTML.
checkedWhen the value of the type attribute is radio or checkbox, the presence of this Boolean attribute indicates that the control is selected by default; otherwise, this attribute is ignored. More information on input HTML.
disabledIndicates that form control is not available for interaction. More information on input HTML.
labelReceives the text that will be used as input label.
typeThe type of control to be displayed. The property receives all the options of a input HTML.
maxThe maximum value (numeric or date) for this item, which should not be less than its minimum value (min attribute).More information on input HTML.
maxlengthIf the value of the type attribute is text,email, search,password, tel orurl, this attribute specifies the maximum number of characters (in Unicode code points) that the user can insert. More information on input HTML.
minThe minimum value (number or date) for this item, which should not be greater than its maximum (max attribute). More information on input HTML.
minlengthIf the value of the type attribute is text,email, search,password, tel orurl, this attribute specifies the minimum number of characters (in Unicode code points) that the user can enter. More information on input HTML.
nameThe name of the control, which is sent along with the form data.
oninputA function that is called when populated the field, it triggers an input event that loads an object with field information.
patternA regular expression used to validate the value of the control. More information on input HTML.
placeholderA hint to the user of what he can enter in the control. More information on input HTML.
readonlyThis Boolean attribute indicates that the user can not modify the value of the control. More information on input HTML.
requiredThis attribute specifies that the user must fill in the field with a value before submitting the form. More information on input HTML.
sizeThe initial size of the control. More information on input HTML.
srcIf the value of the type attribute is image, this attribute specifies a URI for the location of an image to be displayed on the graphic button. More information on input HTML.
stateControls the state of input field, its values ​​may vary insuccess warning and error
stepWorks together with min and max attributes to limit increments in which numeric values ​​or dates can be changed. More information on input HTML.
validationmessageReceives an object with the validation message from the parent.
valueThe initial value of control. This attribute is optional except when the value of the type attribute is radio or checkbox. More information on input HTML.

Events

  • input

Description: Event triggered when field is populated, has the values and field type as properties.

Details:

NameDescription
valueValue of input field that will be passed to the parent.
typeType of input field that will be passed to the parent.

Examples

All component examples can be emulated using the npm start slung-web-component-input command.

Use

<slung-input label="Label" placeholder="Placeholder..."></slung-input>      

image

<slung-input label="Disabled" placeholder="Placeholder..." disabled></slung-input>      

image

<slung-input label="Success" placeholder="Placeholder..." state="success"></slung-input>      

image