@kuzntsv/uikit 1.0.76 → 1.0.80
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.
|
@@ -41,7 +41,7 @@ import { MatPaginator, MatPaginatorModule } from "@angular/material/paginator";
|
|
|
41
41
|
import * as i2 from "@angular/material/sort";
|
|
42
42
|
import { MatSort, MatSortModule } from "@angular/material/sort";
|
|
43
43
|
import * as i1 from "@angular/material/table";
|
|
44
|
-
import { MatTableDataSource, MatTableModule } from "@angular/material/table";
|
|
44
|
+
import { MatTable, MatTableDataSource, MatTableModule } from "@angular/material/table";
|
|
45
45
|
var LoginFormComponent = class LoginFormComponent {
|
|
46
46
|
pending = input(false, ...ngDevMode ? [{ debugName: "pending" }] : /* istanbul ignore next */ []);
|
|
47
47
|
errorMessage = input("", ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
|
|
@@ -2734,6 +2734,20 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2734
2734
|
}]
|
|
2735
2735
|
}
|
|
2736
2736
|
});
|
|
2737
|
+
function cleanFilterParams(filters) {
|
|
2738
|
+
const cleanParams = {};
|
|
2739
|
+
Object.keys(filters).forEach((key) => {
|
|
2740
|
+
const value = filters[key];
|
|
2741
|
+
if (isEmptyFilterValue(value)) return;
|
|
2742
|
+
cleanParams[key] = value;
|
|
2743
|
+
});
|
|
2744
|
+
return cleanParams;
|
|
2745
|
+
}
|
|
2746
|
+
function isEmptyFilterValue(value) {
|
|
2747
|
+
if (value === null || value === void 0 || value === "" || value === "-1" || value === 0) return true;
|
|
2748
|
+
if (Array.isArray(value) && value.length === 0) return true;
|
|
2749
|
+
return false;
|
|
2750
|
+
}
|
|
2737
2751
|
var BaseSignalPageClass = class BaseSignalPageClass {
|
|
2738
2752
|
dialog = inject(MatDialog);
|
|
2739
2753
|
injector = inject(Injector);
|
|
@@ -2879,13 +2893,12 @@ var BaseSignalPageClass = class BaseSignalPageClass {
|
|
|
2879
2893
|
this.subscription.unsubscribe();
|
|
2880
2894
|
}
|
|
2881
2895
|
setFilter(key, value) {
|
|
2882
|
-
const storageKey = `${this.
|
|
2896
|
+
const storageKey = `${this.storagePrefix}${String(key)}`;
|
|
2883
2897
|
this.tableState.update((prev) => ({
|
|
2884
2898
|
...prev,
|
|
2885
2899
|
pageIndex: 0
|
|
2886
2900
|
}));
|
|
2887
|
-
|
|
2888
|
-
if (Array.isArray(value) && value.length === 0) isValueEmpty = true;
|
|
2901
|
+
const isValueEmpty = isEmptyFilterValue(value);
|
|
2889
2902
|
if (isValueEmpty) this.localStorageService.removeData(storageKey);
|
|
2890
2903
|
else this.localStorageService.saveData(storageKey, JSON.stringify(value));
|
|
2891
2904
|
this.filters.update((prev) => {
|
|
@@ -2900,6 +2913,27 @@ var BaseSignalPageClass = class BaseSignalPageClass {
|
|
|
2900
2913
|
};
|
|
2901
2914
|
});
|
|
2902
2915
|
}
|
|
2916
|
+
setFilters(fields) {
|
|
2917
|
+
this.tableState.update((prev) => ({
|
|
2918
|
+
...prev,
|
|
2919
|
+
pageIndex: 0
|
|
2920
|
+
}));
|
|
2921
|
+
this.filters.update((prev) => {
|
|
2922
|
+
const next = { ...prev };
|
|
2923
|
+
Object.keys(fields).forEach((key) => {
|
|
2924
|
+
const value = fields[key];
|
|
2925
|
+
const storageKey = `${this.constructor.name}_Filter_${String(key)}`;
|
|
2926
|
+
if (isEmptyFilterValue(value)) {
|
|
2927
|
+
this.localStorageService.removeData(storageKey);
|
|
2928
|
+
delete next[key];
|
|
2929
|
+
} else {
|
|
2930
|
+
this.localStorageService.saveData(storageKey, JSON.stringify(value));
|
|
2931
|
+
next[key] = value;
|
|
2932
|
+
}
|
|
2933
|
+
});
|
|
2934
|
+
return next;
|
|
2935
|
+
});
|
|
2936
|
+
}
|
|
2903
2937
|
onPageChange(pageState) {
|
|
2904
2938
|
this.localStorageService.saveData(this.constructor.name + "PageIndex", pageState.pageIndex.toString());
|
|
2905
2939
|
this.localStorageService.saveData(this.constructor.name + "PageSize", pageState.pageSize.toString());
|
|
@@ -3116,16 +3150,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3116
3150
|
decorators: [{ type: Directive }],
|
|
3117
3151
|
ctorParameters: () => []
|
|
3118
3152
|
});
|
|
3119
|
-
function cleanFilterParams(filters) {
|
|
3120
|
-
const cleanParams = {};
|
|
3121
|
-
Object.keys(filters).forEach((key) => {
|
|
3122
|
-
const value = filters[key];
|
|
3123
|
-
if (value === null || value === void 0 || value === "" || value === 0) return;
|
|
3124
|
-
if (Array.isArray(value) && value.length === 0) return;
|
|
3125
|
-
cleanParams[key] = value;
|
|
3126
|
-
});
|
|
3127
|
-
return cleanParams;
|
|
3128
|
-
}
|
|
3129
3153
|
var BaseSignalServiceClass = class BaseSignalServiceClass {
|
|
3130
3154
|
schemaDTO;
|
|
3131
3155
|
countRoute = "count";
|
|
@@ -4407,6 +4431,8 @@ var TableComponent = class TableComponent {
|
|
|
4407
4431
|
sortStateChange = output();
|
|
4408
4432
|
selectionChange = output();
|
|
4409
4433
|
rowDoubleClicked = output();
|
|
4434
|
+
cdr = inject(ChangeDetectorRef);
|
|
4435
|
+
matTable = viewChild(MatTable, ...ngDevMode ? [{ debugName: "matTable" }] : /* istanbul ignore next */ []);
|
|
4410
4436
|
sort = viewChild(MatSort, ...ngDevMode ? [{ debugName: "sort" }] : /* istanbul ignore next */ []);
|
|
4411
4437
|
paginator = viewChild(MatPaginator, ...ngDevMode ? [{ debugName: "paginator" }] : /* istanbul ignore next */ []);
|
|
4412
4438
|
contextMenu = viewChild(MatMenuTrigger, ...ngDevMode ? [{ debugName: "contextMenu" }] : /* istanbul ignore next */ []);
|
|
@@ -4437,6 +4463,9 @@ var TableComponent = class TableComponent {
|
|
|
4437
4463
|
constructor() {
|
|
4438
4464
|
effect(() => {
|
|
4439
4465
|
this.dataSource.data = [...this.data()];
|
|
4466
|
+
const tableRef = this.matTable();
|
|
4467
|
+
if (tableRef) tableRef.renderRows();
|
|
4468
|
+
this.cdr.markForCheck();
|
|
4440
4469
|
if (this.selection) {
|
|
4441
4470
|
const selected = this.selection.selected;
|
|
4442
4471
|
this.selection.clear();
|
|
@@ -4587,6 +4616,13 @@ var TableComponent = class TableComponent {
|
|
|
4587
4616
|
rowDoubleClicked: "rowDoubleClicked"
|
|
4588
4617
|
},
|
|
4589
4618
|
viewQueries: [
|
|
4619
|
+
{
|
|
4620
|
+
propertyName: "matTable",
|
|
4621
|
+
first: true,
|
|
4622
|
+
predicate: MatTable,
|
|
4623
|
+
descendants: true,
|
|
4624
|
+
isSignal: true
|
|
4625
|
+
},
|
|
4590
4626
|
{
|
|
4591
4627
|
propertyName: "sort",
|
|
4592
4628
|
first: true,
|
|
@@ -5012,6 +5048,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5012
5048
|
type: i0.Output,
|
|
5013
5049
|
args: ["rowDoubleClicked"]
|
|
5014
5050
|
}],
|
|
5051
|
+
matTable: [{
|
|
5052
|
+
type: i0.ViewChild,
|
|
5053
|
+
args: [i0.forwardRef(() => MatTable), { isSignal: true }]
|
|
5054
|
+
}],
|
|
5015
5055
|
sort: [{
|
|
5016
5056
|
type: i0.ViewChild,
|
|
5017
5057
|
args: [i0.forwardRef(() => MatSort), { isSignal: true }]
|