AutocompleteInput

This component allows you to create a extended input that provide suggestions while the user types.

Example

AutocompleteInput

<autocomplete-input
  :is-required="isRequired"
  :allow-add="false"
  :expanded="expanded"
  :option-name="optionName"
  :option-id="optionId"
  :label-inside="labelInside"
  :label-on-border="labelOnBorder"
  :horizontal="horizontal"
  :open-on-focus="openOnFocus"
  :debounce="debounce"
  :data-url="dataUrl"
  :locale="locale"
  :filter-param="filterParam"
  @input="select"
/>

export default {
  name: "App",
  data() {
    return {
      form: {
        servicesDefinition: {
          type: AutocompleteInput,
          default: '',
          'field-wrapper': { class: 'is-12' },
          'field-input': {
            label: this.$tc('incomingStreamLabel'),
            placeholder: this.$t('placeholder', {
              key: this.$tc('incomingStreamLabel').toLowerCase()
            }),
            optionId: 'email',
            optionName: 'fullName',
            dataUrl: `/User?Filters=isDeleted==false`,
            allowAdd: false,
            openOnFocus: true
          },
          events: {
            input: (val) => {},
          },
        },
      },
    };
  },
};

Props

NameDescriptionTypeRequiredDefault
localeLocale string {en, es ...} for display language on componentStringfalse"en"
isRequired-Booleanfalsetrue
items-Arrayfalse
dataUrlUrl servicesStringfalseundefined
optionNameProperty of the object (if data is array of objects) to use as display text, and to keep track of selected optionStringfalseundefined
optionIdOption idStringfalseundefined
searchParam-Stringfalse"SearchText"
openOnFocusOpen dropdown list on focusBooleanfalsetrue
allowAdd-Booleanfalsefalse
keepFirstThe first option will always be pre-selected (easier to just hit enter or tab)Booleanfalsefalse
checkInfiniteScroll-Booleanfalsefalse
isLoading-Booleanfalsefalse
value-falsenull
horizontal-Booleanfalsetrue
labelInside-Booleanfalsefalse
labelOnBorder-Booleanfalsefalse
validationMode-Stringfalse"aggressive"
hideValidation-Booleanfalsefalse
customRule-Stringfalseundefined
showClearIcon-Booleanfalsefalse
addNewItem-Functionfalse() => {}
debounceDetermines the list debounce (a time between the input event and a function execution).Numberfalse500
idFilter-Booleanfalsefalse

Events

Event NameDescriptionParameters
input--