1.0.4 • Published 4 months ago
@atmgrupomaggioli/iris-autocomplete v1.0.4
iris-autocomplete
Properties
Property | Attribute | Description | Type | Default |
---|---|---|---|---|
disabled | disabled | Permite deshabilitar el componente | boolean | false |
displayKey | display-key | Clave del objeto de sugerencia que se usará como texto visible en la lista | string | 'text' |
fetchSuggestions (required) | fetch-suggestions | Función para obtener los resultados del autocomplete desde el servidor | (query: string) => object[] \| Promise<object[]> | undefined |
inputType | input-type | Tipo del input | "email" \| "nifcif" \| "number" \| "password" \| "tel" \| "text" \| "url" | 'text' |
label (required) | label | Label del input | string | undefined |
minChars | min-chars | Cantidad mínima de caracteres necesarios para activar la búsqueda | number | 3 |
name | name | Nombre del input | string | undefined |
placeholder | placeholder | Texto de placeholder cuando el input está vacío | string | undefined |
required | required | Indica si el campo es requerido | boolean | false |
rules | rules | Reglas de validación adicionales | Rule[] | undefined |
showButton | show-button | Permite mostrar un botón de búsqueda avanzada | boolean | false |
tooltip | tooltip | Texto del tooltip | string \| string[] | undefined |
width | width | Ancho del input | string | '100%' |
Events
Event | Description | Type |
---|---|---|
advancedSearch | Evento emitido al hacer clic en el botón de búsqueda avanzada. | CustomEvent<any> |
valueSelected | Evento emitido al seleccionar una sugerencia. | CustomEvent<object> |
Methods
clear() => Promise<void>
Limpia completamente el estado del componente
Returns
Type: Promise<void>
getSelectedSuggestion() => Promise<object>
Obtiene la sugerencia seleccionada
Returns
Type: Promise<object>
Sugerencia seleccionada
getValue() => Promise<string>
Obtiene el valor del input
Returns
Type: Promise<string>
Valor del input
setValue() => Promise<void>
Establece el valor del campo de entrada con la sugerencia seleccionada
Returns
Type: Promise<void>
validate() => Promise<boolean>
Comprueba si el campo tiene una selección válida
Returns
Type: Promise<boolean>
true = Válido / false / No válido.
Built with StencilJS