SiTypeaheadDirective documentation¶
import { SiTypeaheadDirective } from '@siemens/element-ng/typeahead'; Input Properties¶
| Name | Type | Default | Description |
|---|---|---|---|
| siTypeahead required ¶ | Typeahead | Set the options of the typeahead. Has to be either an Array or an Observable of an Array of options (string or object) | |
| typeaheadAutocompleteListLabel ¶ | TranslatableString | $localize`:@@SI_TYPEAHEAD.AUTOCOMPLETE_LIST_LABEL:Suggestions` | Screen reader only label for the autocomplete list. |
| typeaheadAutoSelectIndex ¶ | number | 0 | Defines the index of the item which should automatically be selected. |
| typeaheadClearValueOnSelect ¶ | boolean | false | Defines whether the host value should be cleared when a value is selected. |
| typeaheadCloseOnEsc ¶ | boolean | true | Defines whether the typeahead can be closed using escape. |
| typeaheadCreateOption ¶ | TranslatableString | undefined | This option will be shown at the end of the typeahead. Use it to allow users to create new options on the fly. Use the | |
| typeaheadFullWidth ¶ | boolean | false | If set, the typeahead will at minium have the width of the connected input field. |
| typeaheadItemTemplate ¶ | TemplateRef<TypeaheadOptionItemContext> | undefined | Defines an optional template to use as the typeahead match item instead of the one built in. Gets the TypeaheadOptionItemContext passed to it. | |
| typeaheadMatchAllTokens ¶ | "no" | "once" | "separately" | "independently" | 'separately' | Defines whether and how to require to match with all the tokens if typeaheadTokenize is enabled. • • • • |
| typeaheadMinLength ¶ | number | 1 | Defines the number of characters the value of the host needs to be before a typeahead is displayed. Use |
| typeaheadMultiSelect ¶ | boolean | false | Defines whether multiselection of typeahead is possible with checkboxes. |
| typeaheadOptionField ¶ | string | 'name' | Defines the name of the field/property the option string is in when the typeahead options are objects. |
| typeaheadOptionsInScrollableView ¶ | number | 10 | If typeaheadScrollable is |
| typeaheadOptionsLimit ¶ | number | 20 | Defines the maximum number of items added into the DOM. Default is 20 and 0 means unlimited. |
| typeaheadProcess ¶ | boolean | true | Turns on/off the processing (searching and sorting) of the typeahead options. Is used when searching and sorting is done externally. |
| typeaheadScrollable ¶ | boolean | false | Makes the typeahead scrollable and sets its height. Uses typeaheadOptionsInScrollableView and typeaheadScrollableAdditionalHeight. |
| typeaheadScrollableAdditionalHeight ¶ | number | 13 | If typeaheadScrollable is |
| typeaheadScrollStrategy ¶ | ScrollStrategy | defaultConnectedOverlayScrollStrategy() | CDK scroll strategy used for the typeahead overlay. |
| typeaheadSkipSortingMatches ¶ | boolean | false | Skip the sorting of matches. If the value is |
| typeaheadTokenize ¶ | boolean | true | Defines whether to tokenize the search or match the whole search. |
| typeaheadWaitMs ¶ | number | 0 | Defines the number of milliseconds to wait before displaying a typeahead after the host was focused or a value inputted. |
Output Properties¶
| Name | Type | Description |
|---|---|---|
| typeaheadOnCreateOption ¶ | string | Emits when the create option is selected. It will emit the current search query. |
| typeaheadOnFullMatch ¶ | TypeaheadMatch | Emits an Event when a typeahead full match exists. A full match occurs when the entered text is equal to one of the typeahead options. The event is a TypeaheadMatch |
| typeaheadOnInput ¶ | string | Emits an Event when the input field is changed. |
| typeaheadOnSelect ¶ | TypeaheadMatch | Emits an Event when a typeahead match is selected. The event is a TypeaheadMatch |
| typeaheadOpenChange ¶ | boolean | Emits whenever the typeahead overlay is opened or closed. |
Attributes and Methods¶
| Name | Type | Description |
|---|---|---|
| (readonly)typeaheadOpen ¶ | boolean | Indicates whether the typeahead is shown. |
Types Documentation¶
Represents a translatable string. This can either be a translation key, e.g. import type { TranslatableString } from '@siemens/element-translate-ng/translate-types';ACTIONS.EDIT that will be automatically translated when displayed on the UI or a pre-translated string, e.g. Edit. Equivalent to a normal string in usage and functionality.
Either a TypeaheadObservable (observable of a TypeaheadArray) or a TypeaheadArray.import type { Typeahead } from '@siemens/element-ng/typeahead';
A typeahead match, which is a processed typeahead option. itemSelected ? : result : import type { TypeaheadMatch } from '@siemens/element-ng/typeahead';
boolean ¶ MatchSegment[] ¶
An array of TypeaheadOption.import type { TypeaheadArray } from '@siemens/element-ng/typeahead';
An observable of a TypeaheadArray (array of TypeaheadOption).import type { TypeaheadObservable } from '@siemens/element-ng/typeahead';
Defines a source of options for the SiTypeaheadDirective. Use it for server-side pre-filtering. This function will be called, whenever the search value is updated by the user. A loading indicator is shown when this function was called until the Observable completes.import type { TypeaheadOptionSource } from '@siemens/element-ng/typeahead';
A singular item to be used in the typeahead. Can be either a string or an object.import type { TypeaheadOption } from '@siemens/element-ng/typeahead';
A segment of a TypeaheadMatch, which is a matching or non-matching segment of a typeahead option.import type { MatchSegment } from '@siemens/element-ng/typeahead';
Except where otherwise noted, content on this site is licensed under MIT License.