SiFilteredSearchComponent documentation¶
selector
si-filtered-search
Input 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 ¶ | (Criterion [] | 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. |
itemCountText ¶ | TranslatableString | '' | 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 <(Criterion [] | 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) |
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 |
items | TranslatableString | $localize`:@@SI_FILTERED_SEARCH.ITEMS:items` | Text or translate key for multi selection pills text. Deprecated: Use the new input itemCountText instead. |
noMatchingCriteriaText | TranslatableString | $localize`:@@SI_FILTERED_SEARCH.NO_MATCHING_CRITERIA:No matching criteria` | Deprecated: This property is unused and will be removed without a replacement. |
readonly | boolean | false | Do not allow changes. Search can still be triggered. Deprecated: Use disabled instead. |
selectedCriteriaIndex | number | Deprecated: Setting this property will make it harder for user to submit a search. Instead of using this property to preselect to most relevant option, sort the options by relevance. | |
showIcon | boolean | false | Deprecated: This property is unused and will be removed without a replacement. |
submitText | TranslatableString | $localize`:@@SI_FILTERED_SEARCH.SUBMIT:Apply search criteria` | Deprecated: This property is unused and will be removed without a replacement. To provide translation for the new search button, use the submitButtonLabel input. |
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 |
---|
Deprecated: Use one the more specific types instead: - CriterionValue for the output value of the FilteredSearch, containing the user input. - CriterionDefinition for the definition of criteria so the [criteria] input of the SiFilteredSearchComponent . |
---|
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 |
---|
A CriterionValue is the input/output value of the SiFilteredSearchComponent , containing the user input. | |||||
---|---|---|---|---|---|
|
|
Type for options |
---|
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. | |||||
---|---|---|---|---|---|
|
Function |
---|
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.