src/lib/shared/interfaces/filter-attribute.interface.ts
IFilterAttribute is used to filter the data based on the selected attributes. Important Information:
import { IFilterAttribute } from '@talenra/inbox';
const filterAttributeMultiSelect: IFilterAttribute = { identifier: 'animal.mammal', value: [{ key: 'landAnimalMonkey', label: 'Monkey' }, { key: 'waterAnimalWhale', label: 'Whale' }] };
const filterAttributeSingleSelect: IFilterAttribute = { identifier: 'animal.mammal', value: { key: 'waterAnimalWhale', label: 'Whale' } };
const filterAttributeCharRange: IFilterAttribute = { identifier: 'animal.mammal', value: { start: 'AR', end: 'JAB' } };
const filterAttributeNumberRange: IFilterAttribute = { identifier: 'animal.weight.kg', value: { start: 50, end: 1600 } };
const filterAttributeDateRange: IFilterAttribute = { identifier: 'animal.birthDate', value: { start: new Date('01.14.2023'), end: new Date('01.14.2024') } };
Properties |
|
| identifier |
identifier:
|
Type : string
|
|
As the filter types are already defined in IAttributeItemInput, only the identifier and values for the filter are necessary to set. |
| operator |
operator:
|
Type : TFilterAttributeOperators
|
| Optional |
|
Operator for the filter. |
| value |
value:
|
Type : ISelectionFilterValue | ISelectionFilterValue[] | ICharRangeFilterValue | INumberRangeFilterValue | IDateRangeFilterValue | string
|
| Optional |
|
The values are defined for the filter modes (IAttributeItemInput) as:
|