File

src/lib/shared/interfaces/filter-attribute.interface.ts

Description

IFilterAttribute is used to filter the data based on the selected attributes. Important Information:

  1. The identifier must already be used in selectedAttributes (SelectedAttributesInput[]).
Example :
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') } };

Index

Properties

Properties

identifier
identifier: string
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: TFilterAttributeOperators
Type : TFilterAttributeOperators
Optional

Operator for the filter.

value
value: ISelectionFilterValue | ISelectionFilterValue[] | ICharRangeFilterValue | INumberRangeFilterValue | IDateRangeFilterValue | string
Type : ISelectionFilterValue | ISelectionFilterValue[] | ICharRangeFilterValue | INumberRangeFilterValue | IDateRangeFilterValue | string
Optional

The values are defined for the filter modes (IAttributeItemInput) as:

  • single-select: SelectionFilterValue
  • multi-select: SelectionFilterValue[]
  • char-range: CharRangeFilterValue
  • number-range: NumberRangeFilterValue
  • date-range: DateRangeFilterValue
  • text-field: string

results matching ""

    No results matching ""