Filters metadata

This commit is contained in:
Adina Țeudan 2022-07-10 01:06:50 +03:00
parent 17fc935e08
commit f2f7283c9c
4 changed files with 11 additions and 7 deletions

View File

@ -1,7 +1,6 @@
@use 'common-mixins' as mixins;
.oval,
.square {
.oval {
font-weight: 600;
display: flex;
justify-content: center;

View File

@ -10,5 +10,5 @@ export interface IFilter {
readonly required?: boolean;
readonly disabled?: boolean;
readonly helpModeKey?: string;
readonly color?: string;
readonly metadata?: Record<string, any>;
}

View File

@ -4,12 +4,15 @@ import { IListable } from '../../listing';
export class Filter implements IFilter, IListable {
readonly id: string;
readonly label: string;
checked: boolean;
readonly required: boolean;
readonly topLevelFilter: boolean;
matches?: number;
readonly icon?: string;
readonly checker?: (obj?: unknown) => boolean;
readonly skipTranslation?: boolean;
readonly metadata?: Record<string, any>;
checked: boolean;
matches?: number;
constructor(filter: IFilter) {
this.id = filter.id;
@ -20,6 +23,8 @@ export class Filter implements IFilter, IListable {
this.topLevelFilter = !!filter.topLevelFilter;
this.checker = filter.checker;
this.required = !!filter.required;
this.skipTranslation = !!filter.skipTranslation;
this.metadata = filter.metadata;
}
get searchKey(): string {

View File

@ -9,7 +9,7 @@ export class NestedFilter extends Filter implements INestedFilter, IListable {
helpModeKey?: string;
readonly children: Filter[];
readonly skipTranslation?: boolean;
readonly color?: string;
readonly metadata?: Record<string, any>;
constructor(nestedFilter: INestedFilter) {
super(nestedFilter);
@ -19,6 +19,6 @@ export class NestedFilter extends Filter implements INestedFilter, IListable {
this.helpModeKey = nestedFilter.helpModeKey;
this.children = nestedFilter.children ?? [];
this.skipTranslation = nestedFilter.skipTranslation;
this.color = nestedFilter.color;
this.metadata = nestedFilter.metadata;
}
}