gov-form-autocomplete
Properties
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
disabled | disabled | Makes the input component disabled. This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies. | boolean | false |
identifier | identifier | Custom input identifier. | string | undefined |
invalid | invalid | Indicates the entered value does not conform to the format expected by the application. | boolean | undefined |
maxOptions | max-options | Maximum number of items shown from a static options list (0 = unlimited). Applies only when no async search callback is set. | number | 10 |
maxlength | maxlength | Maximum length (number of characters) of value | number | undefined |
messageEmpty | message-empty | Custom message for when there is a blank sheet | string | 'Nebyly nalezeny žádné výsledky' |
minlength | minlength | Minimum length (number of characters) of value | number | 3 |
name | name | Name of the input. | string | undefined |
nameKey | name-key | Main key name in the object | string | 'name' |
options | options | Options of autocomplete | GovFormAutocompleteItem[] | string | undefined |
placeholder | placeholder | Text that appears in the form control when it has no value set | string | undefined |
readonly | readonly | The value is not editable | boolean | undefined |
required | required | Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them. When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors. | boolean | false |
size | size | Input’s size. | "l" | "m" | "s" | "xl" | "xs" | 'm' |
success | success | Indicates the entered value of child form element does conform to the format expected by the application. | boolean | undefined |
throttleTime | throttle-time | Input throttle in milliseconds | number | 200 |
value | value | Value of input | string | '' |
Events
| Event | Description | Type |
|---|---|---|
gov-blur | Emitted when the input loses focus. | CustomEvent<FormAutocompleteEvent> |
gov-focus | Emitted when the input has focus. | CustomEvent<FormAutocompleteEvent> |
gov-input | Emitted when the input change value. | CustomEvent<FormAutocompleteEvent> |
gov-select | Emitted when the input change value. | CustomEvent<FormAutocompleteEvent> |
Methods
clearValue() => Promise<void>
Clears whisperer value
Returns
Type: Promise<void>
setBlur() => Promise<void>
Blur main input element
Returns
Type: Promise<void>
setFocus(options?: FocusOptions) => Promise<void>
Focus main input element
Parameters
| Name | Type | Description |
|---|---|---|
options | FocusOptions |
Returns
Type: Promise<void>
setOptions(options: GovFormAutocompleteItem[]) => Promise<void>
Set options for list
Parameters
| Name | Type | Description |
|---|---|---|
options | GovFormAutocompleteItem[] |
Returns
Type: Promise<void>
setProcessing(status: boolean) => Promise<void>
Clears whisperer value
Parameters
| Name | Type | Description |
|---|---|---|
status | boolean |
Returns
Type: Promise<void>
setSearchCallback(callback: (value: string) => Promise<any>) => Promise<void>
Set a custom asynchronous function for the whisperer
Parameters
| Name | Type | Description |
|---|---|---|
callback | (value: string) => Promise<any> |
Returns
Type: Promise<void>
setTemplateResolver(callback: (item: GovFormAutocompleteItem) => string) => Promise<void>
Setting a custom whisper result template
Parameters
| Name | Type | Description |
|---|---|---|
callback | (item: GovFormAutocompleteItem) => string |
Returns
Type: Promise<void>
Dependencies
Used by
Depends on
Graph
Built with StencilJS