@updevs/components 1.0.0-alpha.95 → 1.0.0-alpha.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/table/abstractions/base-column.model.mjs +1 -1
- package/esm2022/table/abstractions/filters-operands.service.mjs +1 -1
- package/esm2022/table/components/filter-row/filter-row.component.mjs +47 -27
- package/esm2022/table/components/search-section/search-section.component.mjs +17 -29
- package/esm2022/table/models/filter-field.config.mjs +2 -0
- package/esm2022/table/models/operands-lists/select-filter-operands-list.model.mjs +12 -0
- package/esm2022/table/models/table-config.model.mjs +11 -1
- package/esm2022/table/models/table.config.mjs +1 -1
- package/esm2022/table/services/current-search-request.service.mjs +254 -0
- package/esm2022/table/services/default-filters-operands.service.mjs +21 -17
- package/esm2022/table/services/stores/filters-operands.store.mjs +1 -1
- package/esm2022/table/table.component.mjs +25 -34
- package/esm2022/table/tools/filters.tools.mjs +32 -16
- package/fesm2022/updevs-components-table.mjs +399 -113
- package/fesm2022/updevs-components-table.mjs.map +1 -1
- package/package.json +25 -25
- package/table/abstractions/base-column.model.d.ts +2 -4
- package/table/abstractions/filters-operands.service.d.ts +2 -2
- package/table/components/filter-row/filter-row.component.d.ts +8 -5
- package/table/components/search-section/search-section.component.d.ts +4 -8
- package/table/models/filter-field.config.d.ts +11 -0
- package/table/models/operands-lists/select-filter-operands-list.model.d.ts +6 -0
- package/table/models/table-config.model.d.ts +11 -0
- package/table/models/table.config.d.ts +11 -0
- package/table/services/current-search-request.service.d.ts +164 -0
- package/table/services/default-filters-operands.service.d.ts +2 -2
- package/table/services/stores/filters-operands.store.d.ts +2 -2
- package/table/table.component.d.ts +4 -9
- package/table/tools/filters.tools.d.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@updevs/components",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.97",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^18.0.1 || ^19.0.0",
|
|
6
6
|
"@angular/core": "^18.0.1 || ^19.0.0",
|
|
@@ -40,24 +40,12 @@
|
|
|
40
40
|
"esm": "./esm2022/button/updevs-components-button.mjs",
|
|
41
41
|
"default": "./fesm2022/updevs-components-button.mjs"
|
|
42
42
|
},
|
|
43
|
-
"./calendar": {
|
|
44
|
-
"types": "./calendar/index.d.ts",
|
|
45
|
-
"esm2022": "./esm2022/calendar/updevs-components-calendar.mjs",
|
|
46
|
-
"esm": "./esm2022/calendar/updevs-components-calendar.mjs",
|
|
47
|
-
"default": "./fesm2022/updevs-components-calendar.mjs"
|
|
48
|
-
},
|
|
49
43
|
"./drag-and-drop": {
|
|
50
44
|
"types": "./drag-and-drop/index.d.ts",
|
|
51
45
|
"esm2022": "./esm2022/drag-and-drop/updevs-components-drag-and-drop.mjs",
|
|
52
46
|
"esm": "./esm2022/drag-and-drop/updevs-components-drag-and-drop.mjs",
|
|
53
47
|
"default": "./fesm2022/updevs-components-drag-and-drop.mjs"
|
|
54
48
|
},
|
|
55
|
-
"./card": {
|
|
56
|
-
"types": "./card/index.d.ts",
|
|
57
|
-
"esm2022": "./esm2022/card/updevs-components-card.mjs",
|
|
58
|
-
"esm": "./esm2022/card/updevs-components-card.mjs",
|
|
59
|
-
"default": "./fesm2022/updevs-components-card.mjs"
|
|
60
|
-
},
|
|
61
49
|
"./dropdown": {
|
|
62
50
|
"types": "./dropdown/index.d.ts",
|
|
63
51
|
"esm2022": "./esm2022/dropdown/updevs-components-dropdown.mjs",
|
|
@@ -70,12 +58,30 @@
|
|
|
70
58
|
"esm": "./esm2022/form/updevs-components-form.mjs",
|
|
71
59
|
"default": "./fesm2022/updevs-components-form.mjs"
|
|
72
60
|
},
|
|
61
|
+
"./calendar": {
|
|
62
|
+
"types": "./calendar/index.d.ts",
|
|
63
|
+
"esm2022": "./esm2022/calendar/updevs-components-calendar.mjs",
|
|
64
|
+
"esm": "./esm2022/calendar/updevs-components-calendar.mjs",
|
|
65
|
+
"default": "./fesm2022/updevs-components-calendar.mjs"
|
|
66
|
+
},
|
|
67
|
+
"./card": {
|
|
68
|
+
"types": "./card/index.d.ts",
|
|
69
|
+
"esm2022": "./esm2022/card/updevs-components-card.mjs",
|
|
70
|
+
"esm": "./esm2022/card/updevs-components-card.mjs",
|
|
71
|
+
"default": "./fesm2022/updevs-components-card.mjs"
|
|
72
|
+
},
|
|
73
73
|
"./layout": {
|
|
74
74
|
"types": "./layout/index.d.ts",
|
|
75
75
|
"esm2022": "./esm2022/layout/updevs-components-layout.mjs",
|
|
76
76
|
"esm": "./esm2022/layout/updevs-components-layout.mjs",
|
|
77
77
|
"default": "./fesm2022/updevs-components-layout.mjs"
|
|
78
78
|
},
|
|
79
|
+
"./link": {
|
|
80
|
+
"types": "./link/index.d.ts",
|
|
81
|
+
"esm2022": "./esm2022/link/updevs-components-link.mjs",
|
|
82
|
+
"esm": "./esm2022/link/updevs-components-link.mjs",
|
|
83
|
+
"default": "./fesm2022/updevs-components-link.mjs"
|
|
84
|
+
},
|
|
79
85
|
"./list": {
|
|
80
86
|
"types": "./list/index.d.ts",
|
|
81
87
|
"esm2022": "./esm2022/list/updevs-components-list.mjs",
|
|
@@ -88,12 +94,6 @@
|
|
|
88
94
|
"esm": "./esm2022/modal/updevs-components-modal.mjs",
|
|
89
95
|
"default": "./fesm2022/updevs-components-modal.mjs"
|
|
90
96
|
},
|
|
91
|
-
"./link": {
|
|
92
|
-
"types": "./link/index.d.ts",
|
|
93
|
-
"esm2022": "./esm2022/link/updevs-components-link.mjs",
|
|
94
|
-
"esm": "./esm2022/link/updevs-components-link.mjs",
|
|
95
|
-
"default": "./fesm2022/updevs-components-link.mjs"
|
|
96
|
-
},
|
|
97
97
|
"./paginator": {
|
|
98
98
|
"types": "./paginator/index.d.ts",
|
|
99
99
|
"esm2022": "./esm2022/paginator/updevs-components-paginator.mjs",
|
|
@@ -136,12 +136,6 @@
|
|
|
136
136
|
"esm": "./esm2022/form-controls/date-picker/updevs-components-form-controls-date-picker.mjs",
|
|
137
137
|
"default": "./fesm2022/updevs-components-form-controls-date-picker.mjs"
|
|
138
138
|
},
|
|
139
|
-
"./form-controls/file-upload": {
|
|
140
|
-
"types": "./form-controls/file-upload/index.d.ts",
|
|
141
|
-
"esm2022": "./esm2022/form-controls/file-upload/updevs-components-form-controls-file-upload.mjs",
|
|
142
|
-
"esm": "./esm2022/form-controls/file-upload/updevs-components-form-controls-file-upload.mjs",
|
|
143
|
-
"default": "./fesm2022/updevs-components-form-controls-file-upload.mjs"
|
|
144
|
-
},
|
|
145
139
|
"./form-controls/input": {
|
|
146
140
|
"types": "./form-controls/input/index.d.ts",
|
|
147
141
|
"esm2022": "./esm2022/form-controls/input/updevs-components-form-controls-input.mjs",
|
|
@@ -154,6 +148,12 @@
|
|
|
154
148
|
"esm": "./esm2022/form-controls/radio/updevs-components-form-controls-radio.mjs",
|
|
155
149
|
"default": "./fesm2022/updevs-components-form-controls-radio.mjs"
|
|
156
150
|
},
|
|
151
|
+
"./form-controls/file-upload": {
|
|
152
|
+
"types": "./form-controls/file-upload/index.d.ts",
|
|
153
|
+
"esm2022": "./esm2022/form-controls/file-upload/updevs-components-form-controls-file-upload.mjs",
|
|
154
|
+
"esm": "./esm2022/form-controls/file-upload/updevs-components-form-controls-file-upload.mjs",
|
|
155
|
+
"default": "./fesm2022/updevs-components-form-controls-file-upload.mjs"
|
|
156
|
+
},
|
|
157
157
|
"./form-controls/select": {
|
|
158
158
|
"types": "./form-controls/select/index.d.ts",
|
|
159
159
|
"esm2022": "./esm2022/form-controls/select/updevs-components-form-controls-select.mjs",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TextModel } from '@updevs/sdk';
|
|
2
|
-
import { DataTypeEnum } from '@updevs/sdk/stores';
|
|
2
|
+
import { DataTypeEnum, FilterTypeEnum } from '@updevs/sdk/stores';
|
|
3
3
|
import { WidthModel } from '@updevs/sdk/layout';
|
|
4
4
|
import { OptionalType, TextAlignmentType, TextDecorationType, OverflowStrategyType, FontWeightType } from '@updevs/sdk/types';
|
|
5
5
|
import { ColumnTypeEnum } from '../models/enums/column-type.enum';
|
|
@@ -10,9 +10,6 @@ export declare class BaseColumnModel {
|
|
|
10
10
|
allowSort: boolean;
|
|
11
11
|
isItalic: boolean;
|
|
12
12
|
type: ColumnTypeEnum;
|
|
13
|
-
/**
|
|
14
|
-
* Width.
|
|
15
|
-
*/
|
|
16
13
|
width?: WidthModel;
|
|
17
14
|
alignment: TextAlignmentType;
|
|
18
15
|
decoration?: TextDecorationType;
|
|
@@ -23,6 +20,7 @@ export declare class BaseColumnModel {
|
|
|
23
20
|
isHidden: boolean;
|
|
24
21
|
prefix?: TextModel;
|
|
25
22
|
suffix?: TextModel;
|
|
23
|
+
filterType?: FilterTypeEnum;
|
|
26
24
|
get dataType(): DataTypeEnum;
|
|
27
25
|
get widthClass(): string;
|
|
28
26
|
get widthSize(): number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FilterTypeEnum } from '@updevs/sdk/stores';
|
|
2
2
|
import { NonNullableDictionaryType } from '@updevs/sdk/types';
|
|
3
3
|
import { FilterOperandConfig } from '../models/filter-operand.config';
|
|
4
4
|
export declare abstract class FiltersOperandsService {
|
|
5
5
|
abstract get isLoaded(): boolean;
|
|
6
|
-
abstract getOperands(type:
|
|
6
|
+
abstract getOperands(type: FilterTypeEnum): FilterOperandConfig[];
|
|
7
7
|
abstract getAllOperands(): NonNullableDictionaryType<FilterOperandConfig[]>;
|
|
8
8
|
}
|
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
import { OnInit, EventEmitter } from '@angular/core';
|
|
2
|
-
import { BaseSearchStore,
|
|
2
|
+
import { BaseSearchStore, FilterTypeEnum } from '@updevs/sdk/stores';
|
|
3
3
|
import { OptionalType } from '@updevs/sdk/types';
|
|
4
4
|
import { SelectItem } from '@updevs/components/form-controls/select';
|
|
5
5
|
import { BaseComponent } from '@updevs/sdk/layout';
|
|
6
6
|
import { FilterItemModel } from '../../models/filter-item.model';
|
|
7
7
|
import { BaseColumnModel } from '../../abstractions/base-column.model';
|
|
8
8
|
import { FilterOperandConfig } from '../../models/filter-operand.config';
|
|
9
|
+
import { FilterFieldConfig } from '../../models/filter-field.config';
|
|
9
10
|
import * as i0 from "@angular/core";
|
|
10
11
|
export declare class FilterRowComponent extends BaseComponent implements OnInit {
|
|
11
12
|
wrapperClasses: string;
|
|
12
13
|
readonly removed: EventEmitter<void>;
|
|
13
|
-
|
|
14
|
-
activeFilters: import("@angular/core").ModelSignal<FilterItemModel[]>;
|
|
14
|
+
FilterTypeEnum: typeof FilterTypeEnum;
|
|
15
15
|
rowIndex: import("@angular/core").InputSignal<number>;
|
|
16
16
|
columns: import("@angular/core").InputSignal<BaseColumnModel[]>;
|
|
17
17
|
isDisabled: import("@angular/core").InputSignal<boolean>;
|
|
18
18
|
store: import("@angular/core").InputSignal<BaseSearchStore<any> | undefined>;
|
|
19
|
+
filterFields: import("@angular/core").InputSignal<FilterFieldConfig[] | undefined>;
|
|
19
20
|
currentFilter: import("@angular/core").InputSignal<FilterItemModel | undefined>;
|
|
20
21
|
currentField: import("@angular/core").WritableSignal<OptionalType<SelectItem>>;
|
|
21
22
|
currentOperand: import("@angular/core").WritableSignal<OptionalType<FilterOperandConfig>>;
|
|
22
23
|
fieldsOptions: import("@angular/core").WritableSignal<SelectItem[]>;
|
|
23
24
|
comparisonOperatorOptions: import("@angular/core").WritableSignal<SelectItem[]>;
|
|
25
|
+
fieldAllowedValues: import("@angular/core").WritableSignal<SelectItem[]>;
|
|
24
26
|
isValueSectionEnabled: import("@angular/core").WritableSignal<boolean>;
|
|
25
|
-
get fieldType():
|
|
27
|
+
get fieldType(): FilterTypeEnum;
|
|
26
28
|
get selectedField(): OptionalType<SelectItem>;
|
|
27
29
|
get selectedOperand(): OptionalType<SelectItem>;
|
|
28
30
|
get selectedValue(): OptionalType<any>;
|
|
@@ -30,11 +32,12 @@ export declare class FilterRowComponent extends BaseComponent implements OnInit
|
|
|
30
32
|
private readonly configService;
|
|
31
33
|
private readonly filtersOperandsService;
|
|
32
34
|
private readonly textService;
|
|
35
|
+
private readonly currentSearchRequestService;
|
|
33
36
|
ngOnInit(): void;
|
|
34
37
|
onSelectField(item?: SelectItem): void;
|
|
35
38
|
onSelectOperand(item?: SelectItem): void;
|
|
36
39
|
updateValue(value?: any): void;
|
|
37
40
|
removeFilterItem(): void;
|
|
38
41
|
static ɵfac: i0.ɵɵFactoryDeclaration<FilterRowComponent, never>;
|
|
39
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FilterRowComponent, "upd-filter-row", never, { "
|
|
42
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FilterRowComponent, "upd-filter-row", never, { "rowIndex": { "alias": "rowIndex"; "required": true; "isSignal": true; }; "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "isDisabled": { "alias": "isDisabled"; "required": true; "isSignal": true; }; "store": { "alias": "store"; "required": false; "isSignal": true; }; "filterFields": { "alias": "filterFields"; "required": false; "isSignal": true; }; "currentFilter": { "alias": "currentFilter"; "required": false; "isSignal": true; }; }, { "removed": "removed"; }, never, never, false, never>;
|
|
40
43
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { TemplateRef, OnInit } from '@angular/core';
|
|
2
|
-
import { SearchRequestModel } from '@updevs/sdk/stores';
|
|
3
2
|
import { BaseComponent } from '@updevs/sdk/layout';
|
|
4
3
|
import { OptionalType, BgColorStyleType } from '@updevs/sdk/types';
|
|
5
4
|
import { BadgeConfig } from '@updevs/components/badge';
|
|
@@ -7,25 +6,22 @@ import { Subject } from 'rxjs';
|
|
|
7
6
|
import { FilterItemModel } from '../../models/filter-item.model';
|
|
8
7
|
import { TableConfigModel } from '../../models/table-config.model';
|
|
9
8
|
import { BaseColumnModel } from '../../abstractions/base-column.model';
|
|
9
|
+
import { CurrentSearchRequestService } from '../../services/current-search-request.service';
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
11
|
export declare class SearchSectionComponent<T> extends BaseComponent implements OnInit {
|
|
12
12
|
wrapperClass: string;
|
|
13
|
-
readonly searchRequest: import("@angular/core").ModelSignal<SearchRequestModel>;
|
|
14
|
-
readonly hasChanges: import("@angular/core").ModelSignal<boolean>;
|
|
15
13
|
readonly columns: import("@angular/core").InputSignal<BaseColumnModel[]>;
|
|
16
|
-
readonly isSearching: import("@angular/core").InputSignal<boolean>;
|
|
17
|
-
readonly searchRequestSubject: import("@angular/core").InputSignal<Subject<SearchRequestModel>>;
|
|
18
14
|
readonly config: import("@angular/core").InputSignal<TableConfigModel<T>>;
|
|
19
15
|
readonly actionsTpl: import("@angular/core").InputSignal<TemplateRef<any> | undefined>;
|
|
20
|
-
readonly activeFilters: import("@angular/core").
|
|
16
|
+
readonly activeFilters: import("@angular/core").Signal<FilterItemModel[]>;
|
|
21
17
|
readonly isFilterSectionOpen: import("@angular/core").WritableSignal<boolean>;
|
|
22
18
|
readonly canApplyFilters: import("@angular/core").Signal<boolean>;
|
|
23
|
-
readonly visibleFiltersCount: import("@angular/core").Signal<number>;
|
|
24
19
|
readonly canPerformActions: import("@angular/core").Signal<boolean>;
|
|
25
20
|
readonly badgeConfig: import("@angular/core").Signal<OptionalType<BadgeConfig>>;
|
|
26
21
|
readonly filterSectionBtnColor: import("@angular/core").Signal<BgColorStyleType | undefined>;
|
|
27
22
|
readonly searchSubject: Subject<string>;
|
|
28
23
|
private readonly filtersOperandsService;
|
|
24
|
+
readonly currentSearchRequestService: CurrentSearchRequestService;
|
|
29
25
|
constructor();
|
|
30
26
|
ngOnInit(): void;
|
|
31
27
|
search(): void;
|
|
@@ -33,5 +29,5 @@ export declare class SearchSectionComponent<T> extends BaseComponent implements
|
|
|
33
29
|
onRowRemoved(): void;
|
|
34
30
|
addEmptyFilterRow(): void;
|
|
35
31
|
static ɵfac: i0.ɵɵFactoryDeclaration<SearchSectionComponent<any>, never>;
|
|
36
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SearchSectionComponent<any>, "upd-search-section", never, { "
|
|
32
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SearchSectionComponent<any>, "upd-search-section", never, { "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "config": { "alias": "config"; "required": true; "isSignal": true; }; "actionsTpl": { "alias": "actionsTpl"; "required": false; "isSignal": true; }; }, {}, never, never, false, never>;
|
|
37
33
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TextModel } from '@updevs/sdk';
|
|
2
|
+
import { FilterTypeEnum } from '@updevs/sdk/stores';
|
|
3
|
+
import { KeyValueModel } from '@updevs/sdk/core';
|
|
4
|
+
import { FilterOperandConfig } from './filter-operand.config';
|
|
5
|
+
export interface FilterFieldConfig {
|
|
6
|
+
name: string;
|
|
7
|
+
label: TextModel;
|
|
8
|
+
type: FilterTypeEnum;
|
|
9
|
+
allowedValues?: KeyValueModel[];
|
|
10
|
+
customOperands?: FilterOperandConfig[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DictionaryType } from '@updevs/sdk/types';
|
|
2
|
+
import { FilterOperandConfig } from '../filter-operand.config';
|
|
3
|
+
export declare class SelectFilterOperandsListModel {
|
|
4
|
+
static options: DictionaryType<FilterOperandConfig>;
|
|
5
|
+
static get optionsAsList(): FilterOperandConfig[];
|
|
6
|
+
}
|
|
@@ -4,6 +4,7 @@ import { BaseSearchStore } from '@updevs/sdk/stores';
|
|
|
4
4
|
import { GetByIdType } from '@updevs/sdk/types';
|
|
5
5
|
import { TableConfig } from './table.config';
|
|
6
6
|
import { BaseColumnModel } from '../abstractions/base-column.model';
|
|
7
|
+
import { FilterFieldConfig } from './filter-field.config';
|
|
7
8
|
export declare class TableConfigModel<T> implements TableConfig<T> {
|
|
8
9
|
name: string;
|
|
9
10
|
store?: BaseSearchStore<T>;
|
|
@@ -28,6 +29,16 @@ export declare class TableConfigModel<T> implements TableConfig<T> {
|
|
|
28
29
|
* Actions added to the header of the table as regular buttons.
|
|
29
30
|
*/
|
|
30
31
|
customHeaderActions: ButtonModel[];
|
|
32
|
+
/**
|
|
33
|
+
* Define custom filterable fields.
|
|
34
|
+
* If not provided and useColumnsAsFilters is true, filters will be auto-generated from columns.
|
|
35
|
+
*/
|
|
36
|
+
filterFields: FilterFieldConfig[];
|
|
37
|
+
/**
|
|
38
|
+
* Whether to use columns as filters.
|
|
39
|
+
* If false, filterFields must be provided.
|
|
40
|
+
*/
|
|
41
|
+
useColumnsAsFilters: boolean;
|
|
31
42
|
constructor(init?: TableConfig<T>);
|
|
32
43
|
getIdFunction: GetByIdType<T>;
|
|
33
44
|
}
|
|
@@ -3,6 +3,7 @@ import { ButtonModel } from '@updevs/sdk/layout';
|
|
|
3
3
|
import { BaseSearchStore } from '@updevs/sdk/stores';
|
|
4
4
|
import { GetByIdType } from '@updevs/sdk/types';
|
|
5
5
|
import { BaseColumnModel } from '../abstractions/base-column.model';
|
|
6
|
+
import { FilterFieldConfig } from './filter-field.config';
|
|
6
7
|
export interface TableConfig<T> {
|
|
7
8
|
name: string;
|
|
8
9
|
store?: BaseSearchStore<T>;
|
|
@@ -28,4 +29,14 @@ export interface TableConfig<T> {
|
|
|
28
29
|
* Actions added to the header of the table as regular buttons.
|
|
29
30
|
*/
|
|
30
31
|
customHeaderActions?: ButtonModel[];
|
|
32
|
+
/**
|
|
33
|
+
* Define custom filterable fields.
|
|
34
|
+
* If not provided and useColumnsAsFilters is true, filters will be auto-generated from columns.
|
|
35
|
+
*/
|
|
36
|
+
filterFields?: FilterFieldConfig[];
|
|
37
|
+
/**
|
|
38
|
+
* Whether to use columns as filters.
|
|
39
|
+
* If false, filterFields must be provided.
|
|
40
|
+
*/
|
|
41
|
+
useColumnsAsFilters?: boolean;
|
|
31
42
|
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { BaseFilter, SearchRequestModel } from '@updevs/sdk/stores';
|
|
2
|
+
import { Subject } from 'rxjs';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Service to manage the current search request state across table components.
|
|
6
|
+
* Uses Angular signals for reactive state management, eliminating the need for prop drilling.
|
|
7
|
+
* Should be provided at the table component level so each table instance has its own state.
|
|
8
|
+
*/
|
|
9
|
+
export declare class CurrentSearchRequestService {
|
|
10
|
+
private readonly _searchRequest;
|
|
11
|
+
private readonly _isSearching;
|
|
12
|
+
private readonly _hasChanges;
|
|
13
|
+
/**
|
|
14
|
+
* Read-only signal for the current search request
|
|
15
|
+
*/
|
|
16
|
+
readonly searchRequest: import("@angular/core").Signal<SearchRequestModel>;
|
|
17
|
+
/**
|
|
18
|
+
* Read-only signal for the searching state
|
|
19
|
+
*/
|
|
20
|
+
readonly isSearching: import("@angular/core").Signal<boolean>;
|
|
21
|
+
/**
|
|
22
|
+
* Read-only signal indicating if the search request has changed from default
|
|
23
|
+
*/
|
|
24
|
+
readonly hasChanges: import("@angular/core").Signal<boolean>;
|
|
25
|
+
/**
|
|
26
|
+
* Subject to trigger search operations
|
|
27
|
+
*/
|
|
28
|
+
readonly searchRequestSubject: Subject<SearchRequestModel>;
|
|
29
|
+
/**
|
|
30
|
+
* Count of active filters (non-hidden)
|
|
31
|
+
*/
|
|
32
|
+
readonly activeFilterCount: import("@angular/core").Signal<number>;
|
|
33
|
+
/**
|
|
34
|
+
* Whether there are any active filters
|
|
35
|
+
*/
|
|
36
|
+
readonly hasFilters: import("@angular/core").Signal<boolean>;
|
|
37
|
+
/**
|
|
38
|
+
* Count of visible (non-hidden) filters
|
|
39
|
+
*/
|
|
40
|
+
readonly visibleFilterCount: import("@angular/core").Signal<number>;
|
|
41
|
+
/**
|
|
42
|
+
* Whether there's a search description/text query
|
|
43
|
+
*/
|
|
44
|
+
readonly hasDescription: import("@angular/core").Signal<boolean>;
|
|
45
|
+
/**
|
|
46
|
+
* Whether there are any sortings applied
|
|
47
|
+
*/
|
|
48
|
+
readonly hasSorting: import("@angular/core").Signal<boolean>;
|
|
49
|
+
/**
|
|
50
|
+
* The current sorting (first one if multiple exist)
|
|
51
|
+
*/
|
|
52
|
+
readonly currentSorting: import("@angular/core").Signal<import("@updevs/sdk/stores").ColumnSort | undefined>;
|
|
53
|
+
/**
|
|
54
|
+
* Whether any search criteria is active (filters, description, or sorting)
|
|
55
|
+
*/
|
|
56
|
+
readonly hasAnySearchCriteria: import("@angular/core").Signal<boolean>;
|
|
57
|
+
/**
|
|
58
|
+
* Current page number (1-indexed for display)
|
|
59
|
+
*/
|
|
60
|
+
readonly currentPageNumber: import("@angular/core").Signal<number>;
|
|
61
|
+
/**
|
|
62
|
+
* Whether pagination is configured
|
|
63
|
+
*/
|
|
64
|
+
readonly hasPagination: import("@angular/core").Signal<boolean>;
|
|
65
|
+
/**
|
|
66
|
+
* Updates the entire search request
|
|
67
|
+
* @param request The new search request
|
|
68
|
+
*/
|
|
69
|
+
updateSearchRequest(request: SearchRequestModel): void;
|
|
70
|
+
/**
|
|
71
|
+
* Partially updates the search request
|
|
72
|
+
* @param partial Partial search request properties to update
|
|
73
|
+
*/
|
|
74
|
+
patchSearchRequest(partial: Partial<SearchRequestModel>): void;
|
|
75
|
+
/**
|
|
76
|
+
* Sets the searching state
|
|
77
|
+
* @param isSearching Whether a search is in progress
|
|
78
|
+
*/
|
|
79
|
+
setSearching(isSearching: boolean): void;
|
|
80
|
+
/**
|
|
81
|
+
* Resets the search request to default state
|
|
82
|
+
*/
|
|
83
|
+
reset(): void;
|
|
84
|
+
/**
|
|
85
|
+
* Triggers a search operation by emitting on the searchRequestSubject
|
|
86
|
+
*/
|
|
87
|
+
triggerSearch(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Manually sets the hasChanges flag
|
|
90
|
+
* Useful for changes that aren't part of the search request but should enable Save View
|
|
91
|
+
* (e.g., column visibility changes)
|
|
92
|
+
* @param hasChanges Whether there are changes
|
|
93
|
+
*/
|
|
94
|
+
setHasChanges(hasChanges: boolean): void;
|
|
95
|
+
/**
|
|
96
|
+
* Adds a filter to the search request
|
|
97
|
+
* @param filter The filter to add
|
|
98
|
+
*/
|
|
99
|
+
addFilter(filter: BaseFilter): void;
|
|
100
|
+
/**
|
|
101
|
+
* Removes a filter by name
|
|
102
|
+
* @param filterName The name of the filter column to remove
|
|
103
|
+
*/
|
|
104
|
+
removeFilter(filterName: string): void;
|
|
105
|
+
/**
|
|
106
|
+
* Removes a filter by index
|
|
107
|
+
* @param index The index of the filter to remove
|
|
108
|
+
*/
|
|
109
|
+
removeFilterByIndex(index: number): void;
|
|
110
|
+
/**
|
|
111
|
+
* Updates a specific filter by column name
|
|
112
|
+
* @param columnName The column name of the filter to update
|
|
113
|
+
* @param newData Partial filter properties to update
|
|
114
|
+
*/
|
|
115
|
+
updateFilter(columnName: string, newData: Partial<BaseFilter>): void;
|
|
116
|
+
/**
|
|
117
|
+
* Updates a filter by its index position
|
|
118
|
+
* @param index The index of the filter to update
|
|
119
|
+
* @param newData Partial filter properties to update
|
|
120
|
+
*/
|
|
121
|
+
updateFilterByIndex(index: number, newData: Partial<BaseFilter>): void;
|
|
122
|
+
/**
|
|
123
|
+
* Clears all filters
|
|
124
|
+
*/
|
|
125
|
+
clearFilters(): void;
|
|
126
|
+
/**
|
|
127
|
+
* Sets the sorting (replaces existing sortings)
|
|
128
|
+
* @param column The column name to sort by
|
|
129
|
+
* @param direction The sort direction
|
|
130
|
+
*/
|
|
131
|
+
setSorting(column: string, direction: any): void;
|
|
132
|
+
/**
|
|
133
|
+
* Clears all sorting
|
|
134
|
+
*/
|
|
135
|
+
clearSorting(): void;
|
|
136
|
+
/**
|
|
137
|
+
* Sets the search description/text query
|
|
138
|
+
* @param description The search text
|
|
139
|
+
*/
|
|
140
|
+
setDescription(description: string): void;
|
|
141
|
+
/**
|
|
142
|
+
* Clears the search description
|
|
143
|
+
*/
|
|
144
|
+
clearDescription(): void;
|
|
145
|
+
/**
|
|
146
|
+
* Clears ALL search criteria (filters, description, sorting)
|
|
147
|
+
* Note: Does not reset pagination - use reset() for that
|
|
148
|
+
*/
|
|
149
|
+
clearAll(): void;
|
|
150
|
+
/**
|
|
151
|
+
* Clears all search criteria except pagination
|
|
152
|
+
* Useful when you want to reset search but maintain current page
|
|
153
|
+
*/
|
|
154
|
+
clearAllExceptPagination(): void;
|
|
155
|
+
/**
|
|
156
|
+
* Deep comparison of two search requests
|
|
157
|
+
* @param a First search request
|
|
158
|
+
* @param b Second search request
|
|
159
|
+
* @returns true if they are equal, false otherwise
|
|
160
|
+
*/
|
|
161
|
+
private areSearchRequestsEqual;
|
|
162
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CurrentSearchRequestService, never>;
|
|
163
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CurrentSearchRequestService>;
|
|
164
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FilterTypeEnum } from '@updevs/sdk/stores';
|
|
2
2
|
import { NonNullableDictionaryType } from '@updevs/sdk/types';
|
|
3
3
|
import { FiltersOperandsService } from '../abstractions/filters-operands.service';
|
|
4
4
|
import { FilterOperandConfig } from '../models/filter-operand.config';
|
|
@@ -10,7 +10,7 @@ export declare class DefaultFiltersOperandsService extends FiltersOperandsServic
|
|
|
10
10
|
private readonly filterOperandsStore;
|
|
11
11
|
private readonly cachedData;
|
|
12
12
|
constructor();
|
|
13
|
-
getOperands(type:
|
|
13
|
+
getOperands(type: FilterTypeEnum): FilterOperandConfig[];
|
|
14
14
|
getAllOperands(): NonNullableDictionaryType<FilterOperandConfig[]>;
|
|
15
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<DefaultFiltersOperandsService, never>;
|
|
16
16
|
static ɵprov: i0.ɵɵInjectableDeclaration<DefaultFiltersOperandsService>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { BaseStore,
|
|
1
|
+
import { BaseStore, FilterTypeEnum } from '@updevs/sdk/stores';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { UpdTableConfigService } from '../upd-table-config.service';
|
|
4
4
|
import { FilterOperandConfig } from '../../models/filter-operand.config';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class FiltersOperandsStore extends BaseStore {
|
|
7
7
|
constructor(configService: UpdTableConfigService);
|
|
8
|
-
load(fieldType:
|
|
8
|
+
load(fieldType: FilterTypeEnum): Observable<FilterOperandConfig[]>;
|
|
9
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<FiltersOperandsStore, never>;
|
|
10
10
|
static ɵprov: i0.ɵɵInjectableDeclaration<FiltersOperandsStore>;
|
|
11
11
|
}
|
|
@@ -4,19 +4,17 @@ import { TextService } from '@updevs/sdk';
|
|
|
4
4
|
import { SelectionModel } from '@updevs/sdk/core';
|
|
5
5
|
import { OptionalType } from '@updevs/sdk/types';
|
|
6
6
|
import { BaseComponent, ButtonModel } from '@updevs/sdk/layout';
|
|
7
|
-
import {
|
|
7
|
+
import { ColumnSort } from '@updevs/sdk/stores';
|
|
8
8
|
import { DropdownItem } from '@updevs/components/dropdown';
|
|
9
|
-
import { Subject } from 'rxjs';
|
|
10
9
|
import { TableConfig } from './models/table.config';
|
|
11
10
|
import { TableConfigModel } from './models/table-config.model';
|
|
12
11
|
import { BaseColumnModel } from './abstractions/base-column.model';
|
|
13
|
-
import { FilterItemModel } from './models/filter-item.model';
|
|
14
12
|
import { SavedViewModel } from './models/saved-view.model';
|
|
13
|
+
import { CurrentSearchRequestService } from './services/current-search-request.service';
|
|
15
14
|
import * as i0 from "@angular/core";
|
|
16
15
|
export declare class TableComponent<T> extends BaseComponent implements OnInit {
|
|
17
16
|
savedViewsRef: Signal<ElementRef<any> | undefined>;
|
|
18
17
|
config: import("@angular/core").ModelSignal<TableConfig<T>>;
|
|
19
|
-
isSearching: import("@angular/core").WritableSignal<boolean>;
|
|
20
18
|
selectedItems: Signal<T[]>;
|
|
21
19
|
activeSavedView: import("@angular/core").WritableSignal<OptionalType<SavedViewModel>>;
|
|
22
20
|
isMainCheckboxChecked: boolean;
|
|
@@ -26,11 +24,8 @@ export declare class TableComponent<T> extends BaseComponent implements OnInit {
|
|
|
26
24
|
get hasWidth(): boolean;
|
|
27
25
|
get pendingWidthColClass(): string;
|
|
28
26
|
get isWidthInPixels(): boolean;
|
|
29
|
-
readonly searchRequest: import("@angular/core").ModelSignal<SearchRequestModel>;
|
|
30
|
-
readonly activeFilters: import("@angular/core").ModelSignal<FilterItemModel[]>;
|
|
31
27
|
readonly currentPage: import("@angular/core").ModelSignal<number>;
|
|
32
28
|
readonly pageSize: import("@angular/core").ModelSignal<number>;
|
|
33
|
-
readonly hasSearchChanged: import("@angular/core").WritableSignal<boolean>;
|
|
34
29
|
readonly totalRecords: import("@angular/core").WritableSignal<number>;
|
|
35
30
|
readonly configModel: Signal<TableConfigModel<T>>;
|
|
36
31
|
readonly data: Signal<T[]>;
|
|
@@ -38,8 +33,8 @@ export declare class TableComponent<T> extends BaseComponent implements OnInit {
|
|
|
38
33
|
readonly currentSorting: import("@angular/core").WritableSignal<OptionalType<ColumnSort>>;
|
|
39
34
|
readonly hiddenColumns: Signal<number>;
|
|
40
35
|
readonly columns: import("@angular/core").WritableSignal<BaseColumnModel[]>;
|
|
41
|
-
readonly searchRequestSubject: Subject<SearchRequestModel>;
|
|
42
36
|
readonly textService: TextService;
|
|
37
|
+
readonly currentSearchRequestService: CurrentSearchRequestService;
|
|
43
38
|
readonly savedViewsOptions: Signal<DropdownItem[]>;
|
|
44
39
|
private get isRemote();
|
|
45
40
|
private get store();
|
|
@@ -77,5 +72,5 @@ export declare class TableComponent<T> extends BaseComponent implements OnInit {
|
|
|
77
72
|
private getActionButtons;
|
|
78
73
|
private getSavedViewOption;
|
|
79
74
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent<any>, never>;
|
|
80
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent<any>, "upd-table", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "
|
|
75
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent<any>, "upd-table", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "currentPage": { "alias": "currentPage"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; }, { "config": "configChange"; "currentPage": "currentPageChange"; "pageSize": "pageSizeChange"; }, never, never, false, never>;
|
|
81
76
|
}
|
|
@@ -3,7 +3,8 @@ import { NonNullableDictionaryType } from '@updevs/sdk/types';
|
|
|
3
3
|
import { FilterItemModel } from '../models/filter-item.model';
|
|
4
4
|
import { BaseColumnModel } from '../abstractions/base-column.model';
|
|
5
5
|
import { FilterOperandConfig } from '../models/filter-operand.config';
|
|
6
|
+
import { FilterFieldConfig } from '../models/filter-field.config';
|
|
6
7
|
export declare class FilterTools {
|
|
7
8
|
static convertToFilterItem(filters: BaseFilter[], operands: NonNullableDictionaryType<FilterOperandConfig[]>): FilterItemModel[];
|
|
8
|
-
static convertToRequestFilter(filters: FilterItemModel[], columns
|
|
9
|
+
static convertToRequestFilter(filters: FilterItemModel[], filtersConfigs?: FilterFieldConfig[], columns?: BaseColumnModel[]): BaseFilter[];
|
|
9
10
|
}
|