@xh/hoist 70.0.0-SNAPSHOT.1731083521069 → 70.0.0-SNAPSHOT.1731623470295
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/CHANGELOG.md +57 -0
- package/build/types/cmp/filter/FilterChooserModel.d.ts +17 -12
- package/build/types/cmp/grid/GridModel.d.ts +5 -9
- package/build/types/cmp/grid/Types.d.ts +7 -19
- package/build/types/cmp/grid/columns/Column.d.ts +0 -1
- package/build/types/cmp/grid/impl/InitPersist.d.ts +7 -0
- package/build/types/cmp/grouping/GroupingChooserModel.d.ts +6 -8
- package/build/types/cmp/tab/TabContainerModel.d.ts +10 -4
- package/build/types/cmp/zoneGrid/Types.d.ts +6 -6
- package/build/types/cmp/zoneGrid/ZoneGridModel.d.ts +0 -2
- package/build/types/cmp/zoneGrid/impl/InitPersist.d.ts +7 -0
- package/build/types/core/HoistBase.d.ts +1 -1
- package/build/types/core/persist/CustomProvider.d.ts +5 -6
- package/build/types/core/persist/DashViewProvider.d.ts +6 -6
- package/build/types/core/persist/LocalStorageProvider.d.ts +4 -5
- package/build/types/core/persist/PersistOptions.d.ts +5 -4
- package/build/types/core/persist/Persistable.d.ts +14 -0
- package/build/types/core/persist/PersistenceProvider.d.ts +47 -34
- package/build/types/core/persist/PrefProvider.d.ts +5 -5
- package/build/types/core/persist/index.d.ts +2 -0
- package/build/types/core/persist/viewmanager/Types.d.ts +46 -0
- package/build/types/core/persist/viewmanager/ViewManagerModel.d.ts +149 -0
- package/build/types/core/persist/viewmanager/ViewManagerProvider.d.ts +10 -0
- package/build/types/core/persist/viewmanager/impl/ManageDialogModel.d.ts +30 -0
- package/build/types/core/persist/viewmanager/impl/SaveDialogModel.d.ts +23 -0
- package/build/types/core/persist/viewmanager/index.d.ts +2 -0
- package/build/types/desktop/cmp/button/ColAutosizeButton.d.ts +1 -1
- package/build/types/desktop/cmp/dash/DashConfig.d.ts +3 -1
- package/build/types/desktop/cmp/dash/DashModel.d.ts +1 -2
- package/build/types/desktop/cmp/dash/DashViewSpec.d.ts +1 -1
- package/build/types/desktop/cmp/dash/canvas/DashCanvasModel.d.ts +10 -2
- package/build/types/desktop/cmp/dash/container/DashContainerModel.d.ts +26 -10
- package/build/types/desktop/cmp/dash/container/impl/DashContainerUtils.d.ts +4 -2
- package/build/types/desktop/cmp/panel/PanelModel.d.ts +8 -4
- package/build/types/desktop/cmp/viewmanager/ViewManager.d.ts +22 -0
- package/build/types/desktop/cmp/viewmanager/cmp/ManageDialog.d.ts +6 -0
- package/build/types/desktop/cmp/viewmanager/cmp/SaveDialog.d.ts +2 -0
- package/build/types/desktop/cmp/viewmanager/index.d.ts +3 -0
- package/build/types/kit/blueprint/Wrappers.d.ts +1 -1
- package/build/types/mobile/cmp/button/ColAutosizeButton.d.ts +1 -1
- package/build/types/promise/Promise.d.ts +6 -5
- package/build/types/svc/GridAutosizeService.d.ts +2 -5
- package/build/types/svc/JsonBlobService.d.ts +45 -24
- package/cmp/filter/FilterChooserModel.ts +142 -125
- package/cmp/grid/Grid.ts +2 -10
- package/cmp/grid/GridModel.ts +18 -31
- package/cmp/grid/Types.ts +7 -21
- package/cmp/grid/columns/Column.ts +0 -1
- package/cmp/grid/impl/InitPersist.ts +71 -0
- package/cmp/grouping/GroupingChooserModel.ts +48 -57
- package/cmp/tab/TabContainerModel.ts +22 -36
- package/cmp/zoneGrid/Types.ts +6 -6
- package/cmp/zoneGrid/ZoneGridModel.ts +2 -7
- package/cmp/zoneGrid/impl/InitPersist.ts +70 -0
- package/core/HoistBase.ts +14 -22
- package/core/HoistBaseDecorators.ts +26 -28
- package/core/persist/CustomProvider.ts +7 -10
- package/core/persist/DashViewProvider.ts +8 -10
- package/core/persist/LocalStorageProvider.ts +9 -12
- package/core/persist/PersistOptions.ts +6 -4
- package/core/persist/Persistable.ts +23 -0
- package/core/persist/PersistenceProvider.ts +159 -79
- package/core/persist/PrefProvider.ts +9 -12
- package/core/persist/index.ts +2 -0
- package/core/persist/viewmanager/Types.ts +51 -0
- package/core/persist/viewmanager/ViewManagerModel.ts +515 -0
- package/core/persist/viewmanager/ViewManagerProvider.ts +51 -0
- package/core/persist/viewmanager/impl/ManageDialogModel.ts +274 -0
- package/core/persist/viewmanager/impl/SaveDialogModel.ts +112 -0
- package/core/persist/viewmanager/index.ts +2 -0
- package/desktop/cmp/button/ColAutosizeButton.ts +1 -1
- package/desktop/cmp/dash/DashConfig.ts +3 -1
- package/desktop/cmp/dash/DashModel.ts +1 -2
- package/desktop/cmp/dash/DashViewSpec.ts +1 -1
- package/desktop/cmp/dash/canvas/DashCanvasModel.ts +31 -30
- package/desktop/cmp/dash/container/DashContainerModel.ts +68 -43
- package/desktop/cmp/dash/container/impl/DashContainerUtils.ts +13 -4
- package/desktop/cmp/leftrightchooser/LeftRightChooserFilter.ts +1 -1
- package/desktop/cmp/panel/PanelModel.ts +33 -53
- package/desktop/cmp/store/impl/StoreFilterField.ts +1 -1
- package/desktop/cmp/viewmanager/ViewManager.scss +58 -0
- package/desktop/cmp/viewmanager/ViewManager.ts +274 -0
- package/desktop/cmp/viewmanager/cmp/ManageDialog.ts +197 -0
- package/desktop/cmp/viewmanager/cmp/SaveDialog.ts +89 -0
- package/desktop/cmp/viewmanager/index.ts +3 -0
- package/mobile/cmp/button/ColAutosizeButton.ts +1 -1
- package/package.json +1 -1
- package/promise/Promise.ts +6 -7
- package/svc/GridAutosizeService.ts +73 -36
- package/svc/JsonBlobService.ts +64 -31
- package/tsconfig.tsbuildinfo +1 -1
- package/build/types/cmp/grid/impl/GridPersistenceModel.d.ts +0 -41
- package/build/types/cmp/zoneGrid/impl/ZoneGridPersistenceModel.d.ts +0 -39
- package/cmp/grid/impl/GridPersistenceModel.ts +0 -174
- package/cmp/zoneGrid/impl/ZoneGridPersistenceModel.ts +0 -149
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { GridSorterLike } from '@xh/hoist/cmp/grid';
|
|
2
|
-
import { HoistModel, PersistenceProvider, Some } from '@xh/hoist/core';
|
|
3
|
-
import { GridModel } from '../GridModel';
|
|
4
|
-
import { ColumnState, GridModelPersistOptions } from '../Types';
|
|
5
|
-
/**
|
|
6
|
-
* Model to manage persisting state from GridModel.
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export declare class GridPersistenceModel extends HoistModel {
|
|
10
|
-
xhImpl: boolean;
|
|
11
|
-
VERSION: number;
|
|
12
|
-
gridModel: GridModel;
|
|
13
|
-
state: {
|
|
14
|
-
columns?: Partial<ColumnState>[];
|
|
15
|
-
sortBy?: Some<GridSorterLike>;
|
|
16
|
-
groupBy?: Some<string>;
|
|
17
|
-
version?: number;
|
|
18
|
-
autosize?: any;
|
|
19
|
-
};
|
|
20
|
-
provider: PersistenceProvider;
|
|
21
|
-
constructor(gridModel: GridModel, { persistColumns, persistGrouping, persistSort, ...persistWith }: GridModelPersistOptions);
|
|
22
|
-
clear(): void;
|
|
23
|
-
columnReaction(): {
|
|
24
|
-
track: () => (import("@xh/hoist/cmp/grid").AutosizeState | ColumnState[])[];
|
|
25
|
-
run: ([columnState, autosizeState]: [any, any]) => void;
|
|
26
|
-
};
|
|
27
|
-
updateGridColumns(): void;
|
|
28
|
-
sortReaction(): {
|
|
29
|
-
track: () => import("@xh/hoist/cmp/grid").GridSorter[];
|
|
30
|
-
run: (sortBy: any) => void;
|
|
31
|
-
};
|
|
32
|
-
updateGridSort(): void;
|
|
33
|
-
groupReaction(): {
|
|
34
|
-
track: () => string[];
|
|
35
|
-
run: (groupBy: any) => void;
|
|
36
|
-
};
|
|
37
|
-
updateGridGroupBy(): void;
|
|
38
|
-
patchState(updates: any): void;
|
|
39
|
-
loadState(): any;
|
|
40
|
-
legacyState(): any;
|
|
41
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { GridSorterLike } from '@xh/hoist/cmp/grid';
|
|
2
|
-
import { HoistModel, PersistenceProvider, Some } from '@xh/hoist/core';
|
|
3
|
-
import { ZoneGridModel } from '../ZoneGridModel';
|
|
4
|
-
import { Zone, ZoneGridModelPersistOptions, ZoneMapping } from '../Types';
|
|
5
|
-
/**
|
|
6
|
-
* Model to manage persisting state from ZoneGridModel.
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export declare class ZoneGridPersistenceModel extends HoistModel {
|
|
10
|
-
xhImpl: boolean;
|
|
11
|
-
VERSION: number;
|
|
12
|
-
zoneGridModel: ZoneGridModel;
|
|
13
|
-
state: {
|
|
14
|
-
sortBy?: GridSorterLike;
|
|
15
|
-
groupBy?: Some<string>;
|
|
16
|
-
version?: number;
|
|
17
|
-
mappings?: Record<Zone, Some<string | ZoneMapping>>;
|
|
18
|
-
};
|
|
19
|
-
provider: PersistenceProvider;
|
|
20
|
-
constructor(zoneGridModel: ZoneGridModel, config: ZoneGridModelPersistOptions);
|
|
21
|
-
clear(): void;
|
|
22
|
-
mappingReaction(): {
|
|
23
|
-
track: () => Record<Zone, ZoneMapping[]>;
|
|
24
|
-
run: (mappings: any) => void;
|
|
25
|
-
};
|
|
26
|
-
updateGridMapping(): void;
|
|
27
|
-
sortReaction(): {
|
|
28
|
-
track: () => import("@xh/hoist/cmp/grid").GridSorter;
|
|
29
|
-
run: (sortBy: any) => void;
|
|
30
|
-
};
|
|
31
|
-
updateGridSort(): void;
|
|
32
|
-
groupReaction(): {
|
|
33
|
-
track: () => string[];
|
|
34
|
-
run: (groupBy: any) => void;
|
|
35
|
-
};
|
|
36
|
-
updateGridGroupBy(): void;
|
|
37
|
-
patchState(updates: any): void;
|
|
38
|
-
loadState(): any;
|
|
39
|
-
}
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This file belongs to Hoist, an application development toolkit
|
|
3
|
-
* developed by Extremely Heavy Industries (www.xh.io | info@xh.io)
|
|
4
|
-
*
|
|
5
|
-
* Copyright © 2024 Extremely Heavy Industries Inc.
|
|
6
|
-
*/
|
|
7
|
-
import {GridSorterLike} from '@xh/hoist/cmp/grid';
|
|
8
|
-
import {HoistModel, managed, PersistenceProvider, Some, XH} from '@xh/hoist/core';
|
|
9
|
-
import {action, makeObservable, observable} from '@xh/hoist/mobx';
|
|
10
|
-
import {isUndefined} from 'lodash';
|
|
11
|
-
import {GridModel} from '../GridModel';
|
|
12
|
-
import {ColumnState, GridModelPersistOptions} from '../Types';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Model to manage persisting state from GridModel.
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export class GridPersistenceModel extends HoistModel {
|
|
19
|
-
override xhImpl = true;
|
|
20
|
-
|
|
21
|
-
VERSION = 1; // Increment to abandon state.
|
|
22
|
-
|
|
23
|
-
gridModel: GridModel;
|
|
24
|
-
|
|
25
|
-
@observable.ref
|
|
26
|
-
state: {
|
|
27
|
-
columns?: Partial<ColumnState>[];
|
|
28
|
-
sortBy?: Some<GridSorterLike>;
|
|
29
|
-
groupBy?: Some<string>;
|
|
30
|
-
version?: number;
|
|
31
|
-
autosize?: any;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
@managed
|
|
35
|
-
provider: PersistenceProvider;
|
|
36
|
-
|
|
37
|
-
constructor(
|
|
38
|
-
gridModel: GridModel,
|
|
39
|
-
{
|
|
40
|
-
persistColumns = true,
|
|
41
|
-
persistGrouping = true,
|
|
42
|
-
persistSort = true,
|
|
43
|
-
...persistWith
|
|
44
|
-
}: GridModelPersistOptions
|
|
45
|
-
) {
|
|
46
|
-
super();
|
|
47
|
-
makeObservable(this);
|
|
48
|
-
this.gridModel = gridModel;
|
|
49
|
-
|
|
50
|
-
persistWith = {path: 'grid', ...persistWith};
|
|
51
|
-
|
|
52
|
-
// 1) Read state from and attach to provider -- fail gently
|
|
53
|
-
try {
|
|
54
|
-
this.provider = PersistenceProvider.create(persistWith);
|
|
55
|
-
this.state = this.loadState() ?? this.legacyState() ?? {version: this.VERSION};
|
|
56
|
-
this.addReaction({
|
|
57
|
-
track: () => this.state,
|
|
58
|
-
run: state => this.provider.write(state)
|
|
59
|
-
});
|
|
60
|
-
} catch (e) {
|
|
61
|
-
this.logError(e);
|
|
62
|
-
this.state = {version: this.VERSION};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// 2) Bind self to grid, and populate grid.
|
|
66
|
-
if (persistColumns) {
|
|
67
|
-
this.updateGridColumns();
|
|
68
|
-
this.addReaction(this.columnReaction());
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (persistGrouping) {
|
|
72
|
-
this.updateGridGroupBy();
|
|
73
|
-
this.addReaction(this.groupReaction());
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (persistSort) {
|
|
77
|
-
this.updateGridSort();
|
|
78
|
-
this.addReaction(this.sortReaction());
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
@action
|
|
83
|
-
clear() {
|
|
84
|
-
this.state = {version: this.VERSION};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
//--------------------------
|
|
88
|
-
// Columns
|
|
89
|
-
//--------------------------
|
|
90
|
-
columnReaction() {
|
|
91
|
-
const {gridModel} = this;
|
|
92
|
-
return {
|
|
93
|
-
track: () => [gridModel.columnState, gridModel.autosizeState],
|
|
94
|
-
run: ([columnState, autosizeState]) => {
|
|
95
|
-
this.patchState({
|
|
96
|
-
columns: gridModel.cleanColumnState(columnState),
|
|
97
|
-
autosize: autosizeState
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
updateGridColumns() {
|
|
104
|
-
const {columns, autosize} = this.state;
|
|
105
|
-
if (!isUndefined(columns)) this.gridModel.setColumnState(columns);
|
|
106
|
-
if (!isUndefined(autosize)) this.gridModel.setAutosizeState(autosize);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
//--------------------------
|
|
110
|
-
// Sort
|
|
111
|
-
//--------------------------
|
|
112
|
-
sortReaction() {
|
|
113
|
-
return {
|
|
114
|
-
track: () => this.gridModel.sortBy,
|
|
115
|
-
run: sortBy => {
|
|
116
|
-
this.patchState({sortBy: sortBy.map(it => it.toString())});
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
updateGridSort() {
|
|
122
|
-
const {sortBy} = this.state;
|
|
123
|
-
if (!isUndefined(sortBy)) this.gridModel.setSortBy(sortBy);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
//--------------------------
|
|
127
|
-
// Grouping
|
|
128
|
-
//--------------------------
|
|
129
|
-
groupReaction() {
|
|
130
|
-
return {
|
|
131
|
-
track: () => this.gridModel.groupBy,
|
|
132
|
-
run: groupBy => {
|
|
133
|
-
this.patchState({groupBy});
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
updateGridGroupBy() {
|
|
139
|
-
const {groupBy} = this.state;
|
|
140
|
-
if (!isUndefined(groupBy)) this.gridModel.setGroupBy(groupBy);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
//--------------------------
|
|
144
|
-
// Other Implementation
|
|
145
|
-
//--------------------------
|
|
146
|
-
@action
|
|
147
|
-
patchState(updates) {
|
|
148
|
-
this.state = {...this.state, ...updates};
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
loadState() {
|
|
152
|
-
const ret = this.provider.read();
|
|
153
|
-
return ret?.version === this.VERSION ? ret : null;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
legacyState() {
|
|
157
|
-
const {VERSION} = this,
|
|
158
|
-
provider = this.provider as any;
|
|
159
|
-
if (VERSION === 1) {
|
|
160
|
-
let legacyKey = provider.legacyStateKey ?? provider.key;
|
|
161
|
-
if (legacyKey) {
|
|
162
|
-
legacyKey = 'gridState.v1.' + legacyKey;
|
|
163
|
-
let data = XH.localStorageService.get(legacyKey);
|
|
164
|
-
if (data) {
|
|
165
|
-
data = {...data, version: VERSION};
|
|
166
|
-
provider.write(data);
|
|
167
|
-
XH.localStorageService.remove(legacyKey);
|
|
168
|
-
return data;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
return null;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This file belongs to Hoist, an application development toolkit
|
|
3
|
-
* developed by Extremely Heavy Industries (www.xh.io | info@xh.io)
|
|
4
|
-
*
|
|
5
|
-
* Copyright © 2024 Extremely Heavy Industries Inc.
|
|
6
|
-
*/
|
|
7
|
-
import {GridSorterLike} from '@xh/hoist/cmp/grid';
|
|
8
|
-
import {HoistModel, managed, PersistenceProvider, Some} from '@xh/hoist/core';
|
|
9
|
-
import {action, makeObservable, observable} from '@xh/hoist/mobx';
|
|
10
|
-
import {isUndefined} from 'lodash';
|
|
11
|
-
import {ZoneGridModel} from '../ZoneGridModel';
|
|
12
|
-
import {Zone, ZoneGridModelPersistOptions, ZoneMapping} from '../Types';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Model to manage persisting state from ZoneGridModel.
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export class ZoneGridPersistenceModel extends HoistModel {
|
|
19
|
-
override xhImpl = true;
|
|
20
|
-
|
|
21
|
-
VERSION = 1; // Increment to abandon state.
|
|
22
|
-
|
|
23
|
-
zoneGridModel: ZoneGridModel;
|
|
24
|
-
|
|
25
|
-
@observable.ref
|
|
26
|
-
state: {
|
|
27
|
-
sortBy?: GridSorterLike;
|
|
28
|
-
groupBy?: Some<string>;
|
|
29
|
-
version?: number;
|
|
30
|
-
mappings?: Record<Zone, Some<string | ZoneMapping>>;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
@managed
|
|
34
|
-
provider: PersistenceProvider;
|
|
35
|
-
|
|
36
|
-
constructor(zoneGridModel: ZoneGridModel, config: ZoneGridModelPersistOptions) {
|
|
37
|
-
super();
|
|
38
|
-
makeObservable(this);
|
|
39
|
-
|
|
40
|
-
this.zoneGridModel = zoneGridModel;
|
|
41
|
-
|
|
42
|
-
let {
|
|
43
|
-
persistMapping = true,
|
|
44
|
-
persistGrouping = true,
|
|
45
|
-
persistSort = true,
|
|
46
|
-
...persistWith
|
|
47
|
-
} = config;
|
|
48
|
-
|
|
49
|
-
persistWith = {path: 'zoneGrid', ...persistWith};
|
|
50
|
-
|
|
51
|
-
// 1) Read state from and attach to provider -- fail gently
|
|
52
|
-
try {
|
|
53
|
-
this.provider = PersistenceProvider.create(persistWith);
|
|
54
|
-
this.state = this.loadState() ?? {version: this.VERSION};
|
|
55
|
-
this.addReaction({
|
|
56
|
-
track: () => this.state,
|
|
57
|
-
run: state => this.provider.write(state)
|
|
58
|
-
});
|
|
59
|
-
} catch (e) {
|
|
60
|
-
this.logError(e);
|
|
61
|
-
this.state = {version: this.VERSION};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// 2) Bind self to grid, and populate grid.
|
|
65
|
-
if (persistMapping) {
|
|
66
|
-
this.updateGridMapping();
|
|
67
|
-
this.addReaction(this.mappingReaction());
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (persistGrouping) {
|
|
71
|
-
this.updateGridGroupBy();
|
|
72
|
-
this.addReaction(this.groupReaction());
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (persistSort) {
|
|
76
|
-
this.updateGridSort();
|
|
77
|
-
this.addReaction(this.sortReaction());
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
@action
|
|
82
|
-
clear() {
|
|
83
|
-
this.state = {version: this.VERSION};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
//--------------------------
|
|
87
|
-
// Columns
|
|
88
|
-
//--------------------------
|
|
89
|
-
mappingReaction() {
|
|
90
|
-
return {
|
|
91
|
-
track: () => this.zoneGridModel.mappings,
|
|
92
|
-
run: mappings => {
|
|
93
|
-
this.patchState({mappings});
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
updateGridMapping() {
|
|
99
|
-
const {mappings} = this.state;
|
|
100
|
-
if (!isUndefined(mappings)) this.zoneGridModel.setMappings(mappings);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
//--------------------------
|
|
104
|
-
// Sort
|
|
105
|
-
//--------------------------
|
|
106
|
-
sortReaction() {
|
|
107
|
-
return {
|
|
108
|
-
track: () => this.zoneGridModel.sortBy,
|
|
109
|
-
run: sortBy => {
|
|
110
|
-
this.patchState({sortBy: sortBy?.toString()});
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
updateGridSort() {
|
|
116
|
-
const {sortBy} = this.state;
|
|
117
|
-
if (!isUndefined(sortBy)) this.zoneGridModel.setSortBy(sortBy);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
//--------------------------
|
|
121
|
-
// Grouping
|
|
122
|
-
//--------------------------
|
|
123
|
-
groupReaction() {
|
|
124
|
-
return {
|
|
125
|
-
track: () => this.zoneGridModel.groupBy,
|
|
126
|
-
run: groupBy => {
|
|
127
|
-
this.patchState({groupBy});
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
updateGridGroupBy() {
|
|
133
|
-
const {groupBy} = this.state;
|
|
134
|
-
if (!isUndefined(groupBy)) this.zoneGridModel.setGroupBy(groupBy);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
//--------------------------
|
|
138
|
-
// Other Implementation
|
|
139
|
-
//--------------------------
|
|
140
|
-
@action
|
|
141
|
-
patchState(updates) {
|
|
142
|
-
this.state = {...this.state, ...updates};
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
loadState() {
|
|
146
|
-
const ret = this.provider.read();
|
|
147
|
-
return ret?.version === this.VERSION ? ret : null;
|
|
148
|
-
}
|
|
149
|
-
}
|