slick-table 1.1.69 → 1.1.71
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/dist/index.cjs.js +81 -81
- package/dist/index.es.js +3222 -3193
- package/dist/types/features/header-context-menu/ui/HeaderContextMenu.d.ts.map +1 -1
- package/dist/types/shared/lib/localStrore/model/classes/ColumnFilters.d.ts +7 -0
- package/dist/types/shared/lib/localStrore/model/classes/ColumnFilters.d.ts.map +1 -0
- package/dist/types/shared/lib/localStrore/model/classes/index.d.ts +1 -0
- package/dist/types/shared/lib/localStrore/model/classes/index.d.ts.map +1 -1
- package/dist/types/shared/lib/localStrore/model/enums/EStorageKey.d.ts +1 -0
- package/dist/types/shared/lib/localStrore/model/enums/EStorageKey.d.ts.map +1 -1
- package/dist/types/shared/lib/localStrore/model/localStore.d.ts +2 -1
- package/dist/types/shared/lib/localStrore/model/localStore.d.ts.map +1 -1
- package/dist/types/shared/lib/slickgrid/model/SlickTable/filters/decorators/ColumnFilter/DecoratorColumnFilter.d.ts +4 -0
- package/dist/types/shared/lib/slickgrid/model/SlickTable/filters/decorators/ColumnFilter/DecoratorColumnFilter.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/features/header-context-menu/ui/HeaderContextMenu.tsx +8 -1
- package/src/shared/lib/localStrore/model/classes/ColumnFilters.ts +21 -0
- package/src/shared/lib/localStrore/model/classes/index.ts +1 -0
- package/src/shared/lib/localStrore/model/enums/EStorageKey.ts +1 -0
- package/src/shared/lib/localStrore/model/localStore.ts +2 -1
- package/src/shared/lib/slickgrid/model/SlickTable/filters/decorators/ColumnFilter/DecoratorColumnFilter.ts +21 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderContextMenu.d.ts","sourceRoot":"","sources":["../../../../../src/features/header-context-menu/ui/HeaderContextMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"HeaderContextMenu.d.ts","sourceRoot":"","sources":["../../../../../src/features/header-context-menu/ui/HeaderContextMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAiC,MAAM,OAAO,CAAC;AAgB1D,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,KAAK,CA2CvC,CAAC;AAEF,UAAU,KAAK;IACd,OAAO,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IFilterArguments } from '../../../../model/types';
|
|
2
|
+
export declare class ColumnFilters {
|
|
3
|
+
get(tableId: string): IFilterArguments["columnFilters"];
|
|
4
|
+
reset(tableId: string): void;
|
|
5
|
+
set(tableId: string, filter: IFilterArguments["columnFilters"]): void;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=ColumnFilters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColumnFilters.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/lib/localStrore/model/classes/ColumnFilters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAKtD,qBAAa,aAAa;IACzB,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAAC,eAAe,CAAC;IAIvD,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK5B,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,CAAC,eAAe,CAAC,GAAG,IAAI;CAKrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/lib/localStrore/model/classes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/lib/localStrore/model/classes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EStorageKey.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/lib/localStrore/model/enums/EStorageKey.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACtB,eAAe,sBAAsB;IACrC,UAAU,gBAAgB;IAC1B,OAAO,YAAY;CACnB"}
|
|
1
|
+
{"version":3,"file":"EStorageKey.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/lib/localStrore/model/enums/EStorageKey.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACtB,aAAa,mBAAmB;IAChC,eAAe,sBAAsB;IACrC,UAAU,gBAAgB;IAC1B,OAAO,YAAY;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localStore.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/lib/localStrore/model/localStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"localStore.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/lib/localStrore/model/localStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAElE,cAAM,UAAU;IACf,aAAa,gBAAuB;IACpC,aAAa,gBAAuB;IACpC,OAAO,UAAiB;CACxB;AAED,eAAO,MAAM,UAAU,YAAmB,CAAC"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { SlickGrid } from 'slickgrid';
|
|
1
2
|
import { EColumnFilter, EColumnFiltersGroup } from '../../../../../../../model/enums';
|
|
2
3
|
import { IColumnFilterValue } from '../../../../../../../model/types';
|
|
3
4
|
import { DecoratorFilter } from '../DecoratorFilter';
|
|
4
5
|
export declare class DecoratorColumnFilter extends DecoratorFilter {
|
|
6
|
+
register(grid: SlickGrid, tableId: string): void;
|
|
5
7
|
filterFn(item: Record<string, any>, args: IArgs): boolean;
|
|
6
8
|
reset(): void;
|
|
9
|
+
set args(args: import('../../../../../../../model/types').IFilterArguments);
|
|
10
|
+
get args(): import('../../../../../../../model/types').IFilterArguments;
|
|
7
11
|
}
|
|
8
12
|
interface IArgs {
|
|
9
13
|
columnFilters?: Record<string, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecoratorColumnFilter.d.ts","sourceRoot":"","sources":["../../../../../../../../../../src/shared/lib/slickgrid/model/SlickTable/filters/decorators/ColumnFilter/DecoratorColumnFilter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AASrD,qBAAa,qBAAsB,SAAQ,eAAe;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK;IAuB/C,KAAK;
|
|
1
|
+
{"version":3,"file":"DecoratorColumnFilter.d.ts","sourceRoot":"","sources":["../../../../../../../../../../src/shared/lib/slickgrid/model/SlickTable/filters/decorators/ColumnFilter/DecoratorColumnFilter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AASrD,qBAAa,qBAAsB,SAAQ,eAAe;IAClD,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAQhD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK;IAuB/C,KAAK;IAOZ,IAAI,IAAI,CAAC,IAAI,+CAAA,EAGZ;IACD,IAAI,IAAI,kDAEP;CACD;AAED,UAAU,KAAK;IACd,aAAa,CAAC,EAAE,MAAM,CACrB,MAAM,EACN;QACC,QAAQ,EAAE,aAAa,CAAC;QACxB,KAAK,EAAE,mBAAmB,CAAC;QAC3B,KAAK,EAAE,kBAAkB,CAAC;KAC1B,CACD,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, Fragment, useState } from "react";
|
|
1
|
+
import { FC, Fragment, useEffect, useState } from "react";
|
|
2
2
|
|
|
3
3
|
import { localStore } from "shared/lib/localStrore";
|
|
4
4
|
import { eventHeaderContextMenu } from "shared/lib/slickgrid";
|
|
@@ -22,6 +22,13 @@ export const HeaderContextMenu: FC<Props> = ({ tableId }) => {
|
|
|
22
22
|
|
|
23
23
|
useSubscribeToEvent(setIsOpened, tableId);
|
|
24
24
|
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!isOpened) return;
|
|
27
|
+
const table = eventHeaderContextMenu.table;
|
|
28
|
+
if (!table?.columnPicker) return;
|
|
29
|
+
setHidden([...table.columnPicker.hiddenColumnIds]);
|
|
30
|
+
}, [isOpened]);
|
|
31
|
+
|
|
25
32
|
if (!isOpened) return null;
|
|
26
33
|
const table = eventHeaderContextMenu.table;
|
|
27
34
|
if (!table?.columnPicker) return null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IFilterArguments } from "shared/model/types";
|
|
2
|
+
|
|
3
|
+
import { getFromStorage, updateStorage } from "../../lib";
|
|
4
|
+
import { EStorageKey } from "../enums";
|
|
5
|
+
|
|
6
|
+
export class ColumnFilters {
|
|
7
|
+
get(tableId: string): IFilterArguments["columnFilters"] {
|
|
8
|
+
const columnFilters = getFromStorage(EStorageKey.columnFilters);
|
|
9
|
+
return columnFilters[tableId];
|
|
10
|
+
}
|
|
11
|
+
reset(tableId: string): void {
|
|
12
|
+
const columnFilters = getFromStorage(EStorageKey.columnFilters);
|
|
13
|
+
columnFilters[tableId] = undefined;
|
|
14
|
+
updateStorage(EStorageKey.columnFilters, columnFilters);
|
|
15
|
+
}
|
|
16
|
+
set(tableId: string, filter: IFilterArguments["columnFilters"]): void {
|
|
17
|
+
const columnFilters = getFromStorage(EStorageKey.columnFilters);
|
|
18
|
+
columnFilters[tableId] = filter;
|
|
19
|
+
updateStorage(EStorageKey.columnFilters, columnFilters);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { SlickGrid } from "slickgrid";
|
|
2
|
+
|
|
3
|
+
import { localStore } from "shared/lib/localStrore";
|
|
1
4
|
import { EColumnFilter, EColumnFiltersGroup } from "shared/model/enums";
|
|
2
5
|
import { IColumnFilterValue } from "shared/model/types";
|
|
3
6
|
|
|
@@ -12,6 +15,14 @@ const formatterNotNeeded: EColumnFiltersGroup[] = [
|
|
|
12
15
|
];
|
|
13
16
|
|
|
14
17
|
export class DecoratorColumnFilter extends DecoratorFilter {
|
|
18
|
+
public register(grid: SlickGrid, tableId: string): void {
|
|
19
|
+
this.tableId = tableId;
|
|
20
|
+
this.args = {
|
|
21
|
+
...this.args,
|
|
22
|
+
columnFilters: localStore.columnFilters.get(tableId),
|
|
23
|
+
};
|
|
24
|
+
super.register(grid, tableId);
|
|
25
|
+
}
|
|
15
26
|
public filterFn(item: Record<string, any>, args: IArgs) {
|
|
16
27
|
if (!args.columnFilters) return true;
|
|
17
28
|
const grid = this.grid;
|
|
@@ -37,8 +48,17 @@ export class DecoratorColumnFilter extends DecoratorFilter {
|
|
|
37
48
|
}
|
|
38
49
|
public reset() {
|
|
39
50
|
this.filter.reset();
|
|
40
|
-
if (this.tableId)
|
|
51
|
+
if (this.tableId) {
|
|
52
|
+
localStore.columnFilters.reset(this.tableId);
|
|
41
53
|
headerButtons.highlightAllColumns(this.args, this.tableId);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
set args(args) {
|
|
57
|
+
localStore.columnFilters.set(this.tableId, args.columnFilters);
|
|
58
|
+
this.filter.args = args;
|
|
59
|
+
}
|
|
60
|
+
get args() {
|
|
61
|
+
return this.filter.args;
|
|
42
62
|
}
|
|
43
63
|
}
|
|
44
64
|
|