SiFilteredSearchComponent documentation¶
selector
si-filtered-searchInput Properties¶
| Name | Type | Default | Description |
|---|---|---|---|
| clearButtonLabel ¶ | TranslatableString | $localize`:@@SI_FILTERED_SEARCH.CLEAR:Clear` | Clear button aria label. Needed for a11y |
| colorVariant ¶ | BackgroundColorVariant | 'base-1' | Color variant to determine component background |
| criteria ¶ | CriterionDefinition[] | [] | Predefine criteria options. |
| disabled ¶ | boolean | false | Disable any interactivity. |
| disableFreeTextSearch ¶ | boolean | false | Disables the free text search to only use the criterion for filtering. |
| disableSelectionByColonAndSemicolon ¶ | boolean | false | By default, the Filtered Search will treat : as a special character to submit the current input in the freetext and immediately create a criterion. Use this input to disable this behavior. |
| doSearchOnInputChange ¶ | boolean | false | If this is set to true , the search triggers for each input (implicit search). By default, the search is triggered when the user submits by pressing the search button or by pressing enter. |
| exclusiveCriteria ¶ | boolean | false | Opt-in to search for each criterion only once. |
| freeTextCriterion ¶ | CriterionDefinition | Criterion definition for free-text pills. When set, free-text values will be added as a pill with this criterion. If not set, free-text pills are disabled. Enabling this will only emit valueChange events when the free-text pill is created. When the text input is blurred and there is text inside, a free-text pill will be created. | |
| itemCountText ¶ | TranslatableString | $localize`:@@SI_FILTERED_SEARCH.ITEM_COUNT:{{itemCount}} items` | Items count text appended to the count in case of multi-selection of values. Translation key, {{itemCount}} in the translation will be replaced with the actual value. |
| lazyCriterionProvider ¶ | (typed: string, searchCriteria: SearchCriteria) => Observable<CriterionDefinition[]> | In addition to lazy loaded value, you can also lazy load the criteria itself | |
| lazyLoadingDebounceTime ¶ | number | 500 | Custom debounce time for lazy loading of criteria data. |
| lazyValueProvider ¶ | (criterionName: string, typed: (string | string[])) => Observable<OptionType[]> | In many cases, your application defines the criteria, but the values need to be loaded from a server. In this case you can provide a function that returns the possible criterion options as an Observable. | |
| maxCriteria ¶ | number | undefined | Limit the number of possible criteria. The default is undefined so that any number of criteria can be used. For example, setting the value to 1 let you only select one criterion that you need to remove before being able to set another one. |
| maxCriteriaOptions ¶ | number | 20 | Defines the maximum options within one criterion. The default is 20 and 0 means unlimited. |
| onlySelectValue ¶ | boolean | false | Limit criterion options to the predefined ones and prevent typing. [onlySelectValue] enforces [strictValue] and [strictCriterion] to true automatically. |
| optionsInScrollableView ¶ | number | 10 | Defines the number of criteria, criteria values and operators visible at once. |
| placeholder ¶ | string | '' | The placeholder for input field. |
| searchCriteria ¶ | SearchCriteria | { criteria: [], value: '' } | The current selected search criteria and entered search text. |
| searchDebounceTime ¶ | number | 0 | Custom debounce time (in mills) to delay the search emission. (Default is 0 as in most cases a users manually triggers a search. Recommended to increase a bit when using doSearchOnInputChange=true) |
| searchForFreeTextLabel ¶ | TranslatableString | $localize`:@@SI_FILTERED_SEARCH.SEARCH_FOR_FREE_TEXT:Search for "{{query}}"` | The value to be shown for creating free-text pills. Use the {{query}} placeholder to show the user input in the label. |
| searchLabel ¶ | TranslatableString | $localize`:@@SI_FILTERED_SEARCH.SEARCH:Search` | Search input aria label, Needed by a11y |
| strictCriterion ¶ | boolean | false | Limit criteria to the predefined ones. |
| strictValue ¶ | boolean | false | Limit criterion options to the predefined ones. [strictValue] enforces [strictCriterion] to true automatically. |
| submitButtonLabel ¶ | TranslatableString | $localize`:@@SI_FILTERED_SEARCH.SUBMIT_BUTTON:Submit search` | The accessible label of the search button. |
| typeaheadOptionsLimit ¶ | number | 20 | Limit on the number of criteria/criteria value to be displayed by the typeahead |
Output Properties¶
| Name | Type | Description |
|---|---|---|
| doSearch ¶ | SearchCriteria | Output callback event that provides an object describing the selected criteria and additional filter text. |
| interceptDisplayedCriteria ¶ | DisplayedCriteriaEventArgs | The interceptor is called when the list of criteria is shown as soon as the user starts typing in the input field. The interceptor's DisplayedCriteriaEventArgs.allow method can be used to filter the list of displayed criteria. Note: The interceptor is called as long as the searchCriteria does not exceed maxCriteria . Further, the interceptor is not called when using the lazyCriterionProvider . Example: <si-filtered-search [criteria]="[{ name: 'foo', label: 'Foo' }, { name: 'bar', label: 'Bar' }]" (interceptDisplayedCriteria)="$event.allow( $event.searchCriteria.criteria.some(s => s.name === 'foo') ? $event.criteria.filter(c => c !== 'foo') : $event.criteria )"> </si-filtered-search> |
| searchCriteriaChange ¶ | SearchCriteria | The current selected search criteria and entered search text. |
Attributes and Methods¶
| Name | Type | Default | Description |
|---|---|---|---|
| deleteAllCriteria(...) ¶ | (event: MouseEvent) => void | Deletes all currently selected criteria and effectively resets the filtered search. Parameters
|
Types Documentation¶
| Represents a translatable string. This can either be a translation key, e.g. 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. |
|---|
| Use this type with filter components colorVariant to render component variants based on background of container |
|---|
| A CriterionDefinition is the definition of criteria in the SiFilteredSearchComponent . It defines the type and based this further attributes like multiselect and available options. | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
| On search, the filtered search component emits a SearchCriteria object. It consists of all user selected criteria and the free text input value. | |||
|---|---|---|---|
|
| Event allows to intercept and change the displayed criteria before shown in typeahead. | |||||||
|---|---|---|---|---|---|---|---|
| |||||||
|
Translatable import imported from @siemens/element-translate-ng |
|---|
|
| Type for options |
|---|
| A CriterionValue is the input/output value of the SiFilteredSearchComponent , containing the user input. | |||||
|---|---|---|---|---|---|
|
| Wrapper around an actual translation framework which is meant to be used internally by Element. Applications must not use this service. Use injectSiTranslateService to get an instance of the translation service. | |||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
|
|
| It allows to specify a different value between the one which is rendered and the one which is used for the search. | |||||
|---|---|---|---|---|---|
|
Variable |
|---|
| A singular item to be used in the typeahead. Can be either a string or an object. |
|---|
Except where otherwise noted, content on this site is licensed under MIT License.