diff --git a/packages/docs/components/Input.md b/packages/docs/components/Input.md index 8a0241314..759f7712d 100644 --- a/packages/docs/components/Input.md +++ b/packages/docs/components/Input.md @@ -37,36 +37,36 @@ title: Input ### Props -| Prop name | Description | Type | Values | Default | -| ------------------ | ---------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | -| autocomplete | Native options to use in HTML5 validation | string | - |
From config:
input: {
  autocomplete: "off"
}
| -| autosize | Automatically adjust height in textarea | boolean | - | false | -| clearIcon | Icon name to be added on the clear button | string | - |
From config:
input: {
  clearIcon: "close-circle"
}
| -| clearable | Add a button/icon to clear the inputed text | boolean | - |
From config:
input: {
  clearable: false
}
| -| counter | Show character counter when maxlength prop is passed | boolean | - |
From config:
input: {
  counter: false
}
| -| debounce | Number of milliseconds to delay before to emit input event | number | - |
From config:
autocomplete: {
  debounce: 400
}
| -| disabled | Same as native disabled | boolean | - | false | -| expanded | Makes input full width when inside a grouped or addon field | boolean | - | false | -| icon | Icon to be shown | string | - |
From config:
input: {
  icon: undefined
}
| -| iconClickable | Makes the icon clickable | boolean | - | false | -| iconPack | Icon pack to use | string | `mdi`, `fa`, `fas and any other custom icon pack` |
From config:
input: {
  iconPack: undefined
}
| -| iconRight | Icon to be added on the right side | string | - |
From config:
input: {
  iconRight: undefined
}
| -| iconRightClickable | Make the icon right clickable | boolean | - | false | -| iconRightVariant | Variant of right icon | string | - | | -| id | Same as native id. Also set the `for` label for o-field wrapper. | string | - | Default function (see source code) | -| maxlength | Same as native maxlength, plus character counter | string \| number | - | | -| v-model | The input value state | string \| number | - | | -| number | | boolean | - | false | -| override | Override existing theme classes completely | boolean | - | | -| passwordReveal | Adds the reveal password functionality | boolean | - | false | -| placeholder | Input placeholder | string | - | | -| rounded | Makes the element rounded | boolean | - | false | -| size | Size of the control | string | `small`, `medium`, `large` |
From config:
input: {
  size: undefined
}
| -| statusIcon | Show status icon using field and variant prop | boolean | - |
From config:
{
  statusIcon: true
}
| -| type | Input type, like native | string | `Any native input type`, `and textarea` | "text" | -| useHtml5Validation | Enable html 5 native validation | boolean | - |
From config:
{
  useHtml5Validation: true
}
| -| validationMessage | The message which is shown when a validation error occurs | string | - | | -| variant | Color of the control | string | `primary`, `info`, `success`, `warning`, `danger`, `and any other custom color` |
From config:
input: {
  variant: undefined
}
| +| Prop name | Description | Type | Values | Default | +| ------------------ | -------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | +| autocomplete | Native options to use in HTML5 validation | string | - |
From config:
input: {
  autocomplete: "off"
}
| +| autosize | Automatically adjust height in textarea | boolean | - | false | +| clearIcon | Icon name to be added on the clear button | string | - |
From config:
input: {
  clearIcon: "close-circle"
}
| +| clearable | Add a button/icon to clear the inputed text | boolean | - |
From config:
input: {
  clearable: false
}
| +| counter | Show character counter when maxlength prop is passed | boolean | - |
From config:
input: {
  counter: false
}
| +| debounce | Number of milliseconds to delay before to emit input event | number | - |
From config:
autocomplete: {
  debounce: 400
}
| +| disabled | Same as native disabled | boolean | - | false | +| expanded | Makes input full width when inside a grouped or addon field | boolean | - | false | +| icon | Icon to be shown | string | - |
From config:
input: {
  icon: undefined
}
| +| iconClickable | Makes the icon clickable | boolean | - | false | +| iconPack | Icon pack to use | string | `mdi`, `fa`, `fas and any other custom icon pack` |
From config:
input: {
  iconPack: undefined
}
| +| iconRight | Icon to be added on the right side | string | - |
From config:
input: {
  iconRight: undefined
}
| +| iconRightClickable | Make the icon right clickable | boolean | - | false | +| iconRightVariant | Variant of right icon | string | - | | +| id | Same as native id. Also set the for label for o-field wrapper. | string | - | uuid() | +| maxlength | Same as native maxlength, plus character counter | string \| number | - | | +| v-model | The input value state | string \| number | - | | +| number | Convert the ´modelValue`into type`number` | boolean | - | | +| override | Override existing theme classes completely | boolean | - | | +| passwordReveal | Adds the reveal password functionality | boolean | - | false | +| placeholder | Input placeholder | string | - | | +| rounded | Makes the element rounded | boolean | - | false | +| size | Size of the control | string | `small`, `medium`, `large` |
From config:
input: {
  size: undefined
}
| +| statusIcon | Show status icon using field and variant prop | boolean | - |
From config:
{
  statusIcon: true
}
| +| type | Input type, like native | string | `Any native input type`, `and textarea` | "text" | +| useHtml5Validation | Enable html 5 native validation | boolean | - |
From config:
{
  useHtml5Validation: true
}
| +| validationMessage | The message which is shown when a validation error occurs | string | - | | +| variant | Color of the control | string | `primary`, `info`, `success`, `warning`, `danger`, `and any other custom color` |
From config:
input: {
  variant: undefined
}
| ### Events diff --git a/packages/oruga/src/components/autocomplete/Autocomplete.vue b/packages/oruga/src/components/autocomplete/Autocomplete.vue index 9691b7429..5edf28796 100644 --- a/packages/oruga/src/components/autocomplete/Autocomplete.vue +++ b/packages/oruga/src/components/autocomplete/Autocomplete.vue @@ -691,7 +691,7 @@ function handleBlur(event: Event): void { } /** emit input change event */ -function onInput(value: string | number): void { +function onInput(value: string): void { if (props.keepFirst && !selectedOption.value) hoverFirstOption(); emits("input", String(value)); checkHtml5Validity(); diff --git a/packages/oruga/src/components/input/Input.vue b/packages/oruga/src/components/input/Input.vue index 0644665da..9ade84ccc 100644 --- a/packages/oruga/src/components/input/Input.vue +++ b/packages/oruga/src/components/input/Input.vue @@ -1,10 +1,4 @@ -