SiFilteredSearchComponent documentation¶
import { SiFilteredSearchComponent } from '@siemens/element-ng/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 ¶ | 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 |
| doSearchOnInputChange ¶ | boolean | false | If this is set to |
| exclusiveCriteria ¶ | boolean | false | Opt-in to search for each criterion only once. |
| freeTextCriterion ¶ | CriterionDefinition | undefined | 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}} selected` | Items count text appended to the count in case of multi-selection of values. Translation key, |
| lazyCriterionProvider ¶ | ((typed: string, searchCriteria?: SearchCriteria) => Observable<CriterionDefinition[]>) | undefined | 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[]>) | undefined | 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 | 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. |
| optionsInScrollableView ¶ | number | 10 | Defines the number of criteria, criteria values and operators visible at once. |
| placeholder ¶ | string | '' | The placeholder for input field. |
| scrollStrategy ¶ | () => ScrollStrategy | defaultConnectedOverlayScrollStrategyFactory() | Factory for CDK scroll strategies used by filtered-search overlays. |
| 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 |
| 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. |
| submitButtonLabel ¶ | TranslatableString | $localize`:@@SI_FILTERED_SEARCH.SUBMIT_BUTTON:Apply search criteria` | 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: |
| searchCriteriaChange ¶ | SearchCriteria | The current selected search criteria and entered search text. |
| searchCriteriaClear ¶ | void | Emits after the clear button resets the criteria and free text. |
| searchCriteriaSubmit ¶ | SearchCriteria | Emits the current search criteria whenever a search is submitted. |
Attributes and Methods¶
| Name | Type | Description |
|---|---|---|
| deleteAllCriteria() ¶ | (event?: MouseEvent) => void | Deletes all currently selected criteria and effectively resets the filtered search. Parameters
|
Types Documentation¶
Use this type with filter components import type { BackgroundColorVariant } from '@siemens/element-ng/common';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. Optional configuration object for the datepicker. datepickerConfig ? : An optional label, which is used in the user interface. label ? : Defines whether multi selection of the options is possible in a typeahead. Setting it to multiSelect ? : The mandatory name of a criterion. Limit criterion options to the predefined ones and prevent typing. onlySelectValue ? : This provides possible operators that the user can select for this criterion. The options provide possible values that the user can select for this criterion. options ? : Limit criterion options to the predefined ones. strictValue ? : This provides the value type of the input field.import type { CriterionDefinition } from '@siemens/element-ng/filtered-search';
Omit<DatepickerInputConfig, "enableDateRange" | "enableTwoMonthDateRange"> ¶ TranslatableString ¶ true enables the checkbox besides the option values. When multiSelect is true, the value input field will be readonly, allowing user to select the values only from the typeahead.boolean ¶ onlySelectValue enforces strictValue to true automatically.boolean ¶ OptionType[] ¶ boolean ¶
Type for optionsimport type { OptionType } from '@siemens/element-ng/filtered-search';
On search, the filtered search component emits a SearchCriteria object. It consists of all user selected criteria and the free text input value.import type { SearchCriteria } from '@siemens/element-ng/filtered-search';
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.
A CriterionValue is the input/output value of the SiFilteredSearchComponent, containing the user input. If the criterion was defined as date or date-time this field will contain the value das js Date. The mandatory name of a criterion. This property holds the selected or entered operator of the criterion. The value property holds the selected or entered value/values of the criterion. The value can also be passed as an array of strings. When import type { CriterionValue } from '@siemens/element-ng/filtered-search';
multiSelect is enabled, the items in the value array will be shown as selected values in value input and the typeahead.
import type { ValidationType } from '@siemens/element-ng/filtered-search';
Similar to dateFormat ? : A custom date/time format according the Angular date pipe (see https://angular.dev/api/common/DatePipe). Only numeric date formats are supported. The format is used to render the time of a date-time criterion. If not specified, dateTimeFormat ? : Defines the time is disabled when visible. Will also be updated on user change. Default is disabledTime ? : Text or translation key for the disabledTimeText ? : Options to turn on date range selection. enableDateRange ? : Text or translation key for the enabledTimeText ? : Consider time with minDate and maxDate enableTimeValidation ? : Option to use two months view for date range picking. enableTwoMonthDateRange ? : endTimeLabel ? : hideLabels ? : Configuration for hiding week numbers. Default is hideWeekNumbers ? : hoursAriaLabel ? : hoursLabel ? : hoursPlaceholder ? : Hides disable time switch in the timepicker part and includes mandatory the time in the picker. mandatoryTime ? : Maximal (latest) selectable date. maxDate ? : meridians ? : meridiansAriaLabel ? : meridiansLabel ? : millisecondsAriaLabel ? : millisecondsLabel ? : millisecondsPlaceholder ? : Minimal (earliest) selectable date. minDate ? : minutesAriaLabel ? : minutesLabel ? : minutesPlaceholder ? : Only month and year are selectable. onlyMonthSelection ? : secondsAriaLabel ? : secondsLabel ? : secondsPlaceholder ? : Defines the timepicker milliseconds visibility . Default is showMilliseconds ? : Defines the timepicker minutes visibility. Default is showMinutes ? : Defines the timepicker seconds visibility . Default is showSeconds ? : Defines the timepicker visibility. Default is showTime ? : startTimeLabel ? : Text or translation key for today button title. Default is todayText ? : Defines the starting day of the week. Default is weekStartDay ? : import type { DatepickerInputConfig } from '@siemens/element-ng/datepicker';
dateTimeFormat, but used when only a date is displayed (e.g. when showTime === false or disabledTime === true). Only numeric date formats are supported.string ¶ mediumTime is used if the showSeconds flag is true, otherwise shortTime as default. For the date-only case, 'shortDate' is used.string ¶ false.boolean Inherited from DatepickerConfig ¶ disabled disable time. Default is Ignore time.TranslatableString Inherited from DatepickerConfig ¶ boolean Inherited from DatepickerConfig ¶ enabled disable time. Default is Consider time.TranslatableString Inherited from DatepickerConfig ¶ boolean Inherited from DatepickerConfig ¶ boolean Inherited from DatepickerConfig ¶ string Inherited from DatepickerConfig ¶ boolean Inherited from DatepickerConfig ¶ false.boolean Inherited from DatepickerConfig ¶ string Inherited from DatepickerConfig ¶ string Inherited from DatepickerConfig ¶ string Inherited from DatepickerConfig ¶ boolean Inherited from DatepickerConfig ¶ Date Inherited from DatepickerConfig ¶ string[] Inherited from DatepickerConfig ¶ string Inherited from DatepickerConfig ¶ string Inherited from DatepickerConfig ¶ string Inherited from DatepickerConfig ¶ string Inherited from DatepickerConfig ¶ string Inherited from DatepickerConfig ¶ Date Inherited from DatepickerConfig ¶ string Inherited from DatepickerConfig ¶ string Inherited from DatepickerConfig ¶ string Inherited from DatepickerConfig ¶ boolean Inherited from DatepickerConfig ¶ string Inherited from DatepickerConfig ¶ string Inherited from DatepickerConfig ¶ string Inherited from DatepickerConfig ¶ false.boolean Inherited from DatepickerConfig ¶ true.boolean Inherited from DatepickerConfig ¶ false.boolean Inherited from DatepickerConfig ¶ false.boolean Inherited from DatepickerConfig ¶ string Inherited from DatepickerConfig ¶ Today.TranslatableString Inherited from DatepickerConfig ¶ monday.WeekStart Inherited from DatepickerConfig ¶
It allows to specify a different value between the one which is rendered and the one which is used for the search.import type { OptionCriterion } from '@siemens/element-ng/filtered-search';
import type { WeekStart } from '@siemens/element-ng/datepicker';
Defines the time is disabled when visible. Will also be updated on user change. Default is disabledTime ? : Text or translation key for the Options to turn on date range selection. enableDateRange ? : Text or translation key for the Consider time with minDate and maxDate Option to use two months view for date range picking. endTimeLabel ? : hideLabels ? : Configuration for hiding week numbers. Default is hideWeekNumbers ? : hoursAriaLabel ? : hoursLabel ? : hoursPlaceholder ? : Hides disable time switch in the timepicker part and includes mandatory the time in the picker. mandatoryTime ? : Maximal (latest) selectable date. meridiansLabel ? : millisecondsLabel ? : Minimal (earliest) selectable date. minutesAriaLabel ? : minutesLabel ? : Only month and year are selectable. secondsAriaLabel ? : secondsLabel ? : Defines the timepicker milliseconds visibility . Default is showMilliseconds ? : Defines the timepicker minutes visibility. Default is showMinutes ? : Defines the timepicker seconds visibility . Default is showSeconds ? : Defines the timepicker visibility. Default is startTimeLabel ? : Text or translation key for today button title. Default is Defines the starting day of the week. Default is weekStartDay ? : import type { DatepickerConfig } from '@siemens/element-ng/datepicker';
false.boolean ¶ disabled disable time. Default is Ignore time.boolean ¶ enabled disable time. Default is Consider time.string ¶ boolean ¶ false.boolean ¶ string ¶ string ¶ string ¶ boolean ¶ string ¶ string ¶ string ¶ string ¶ string ¶ string ¶ false.boolean ¶ true.boolean ¶ false.boolean ¶ false.string ¶ Today.monday.WeekStart ¶
Except where otherwise noted, content on this site is licensed under MIT License.