@adaptabletools/adaptable-cjs 20.1.5 → 20.1.7
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/base.css +1 -0
- package/base.css.map +1 -1
- package/index.css +1 -0
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +3 -1
- package/src/Api/GridApi.d.ts +3 -3
- package/src/Api/Implementation/LayoutApiImpl.js +1 -1
- package/src/Api/Implementation/LayoutHelpers.d.ts +3 -3
- package/src/Api/Implementation/LayoutHelpers.js +126 -79
- package/src/Api/Internal/EventInternalApi.d.ts +1 -1
- package/src/Api/Internal/EventInternalApi.js +3 -3
- package/src/Redux/ActionsReducers/LayoutRedux.js +24 -1
- package/src/Redux/Store/AdaptableStore.js +7 -4
- package/src/agGrid/AdaptableAgGrid.d.ts +7 -10
- package/src/agGrid/AdaptableAgGrid.js +79 -107
- package/src/components/ExpressionEditor/BaseEditorInput.js +2 -0
- package/src/components/Select/Select.js +10 -3
- package/src/env.js +2 -2
- package/src/layout-manager/src/LayoutManagerModel.d.ts +29 -2
- package/src/layout-manager/src/index.d.ts +3 -0
- package/src/layout-manager/src/index.js +106 -34
- package/src/layout-manager/src/isLayoutEqual.js +11 -2
- package/src/layout-manager/src/normalizeLayoutModel.js +6 -0
- package/src/layout-manager/src/simplifyLayoutModel.js +3 -3
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
|
@@ -15,11 +15,11 @@ const layoutStateToLayoutModel = (layout) => {
|
|
|
15
15
|
return (0, exports.tableLayoutToTableLayoutModel)(layout);
|
|
16
16
|
};
|
|
17
17
|
exports.layoutStateToLayoutModel = layoutStateToLayoutModel;
|
|
18
|
-
const layoutModelToLayoutState = (layoutModel
|
|
18
|
+
const layoutModelToLayoutState = (layoutModel) => {
|
|
19
19
|
if ((0, isPivotLayoutModel_1.isPivotLayoutModel)(layoutModel)) {
|
|
20
|
-
return (0, exports.pivotLayoutModelToPivotLayout)(layoutModel
|
|
20
|
+
return (0, exports.pivotLayoutModelToPivotLayout)(layoutModel);
|
|
21
21
|
}
|
|
22
|
-
return (0, exports.tableLayoutModelToTableLayout)(layoutModel
|
|
22
|
+
return (0, exports.tableLayoutModelToTableLayout)(layoutModel);
|
|
23
23
|
};
|
|
24
24
|
exports.layoutModelToLayoutState = layoutModelToLayoutState;
|
|
25
25
|
function cleanupAdaptableObjectPrimitives(layout) {
|
|
@@ -53,56 +53,16 @@ const normalizeLayout = (layout, options) => {
|
|
|
53
53
|
};
|
|
54
54
|
exports.normalizeLayout = normalizeLayout;
|
|
55
55
|
const normalizeTableLayout = (tableLayout, options) => {
|
|
56
|
-
const Source = tableLayout.Source;
|
|
57
|
-
const Uuid = tableLayout.Uuid;
|
|
58
|
-
const AdaptableVersion = tableLayout.AdaptableVersion;
|
|
59
|
-
const ColumnFilters = tableLayout.ColumnFilters;
|
|
60
|
-
const GridFilter = tableLayout.GridFilter;
|
|
61
56
|
let model = (0, exports.tableLayoutToTableLayoutModel)(tableLayout);
|
|
62
57
|
model = (0, normalizeLayoutModel_1.normalizeTableLayoutModel)(model, options);
|
|
63
|
-
tableLayout = (0, exports.tableLayoutModelToTableLayout)(model
|
|
64
|
-
if (Source) {
|
|
65
|
-
tableLayout.Source = Source;
|
|
66
|
-
}
|
|
67
|
-
if (Uuid) {
|
|
68
|
-
tableLayout.Uuid = Uuid;
|
|
69
|
-
}
|
|
70
|
-
if (AdaptableVersion) {
|
|
71
|
-
tableLayout.AdaptableVersion = AdaptableVersion;
|
|
72
|
-
}
|
|
73
|
-
if (ColumnFilters) {
|
|
74
|
-
tableLayout.ColumnFilters = ColumnFilters;
|
|
75
|
-
}
|
|
76
|
-
if (GridFilter) {
|
|
77
|
-
tableLayout.GridFilter = GridFilter;
|
|
78
|
-
}
|
|
58
|
+
tableLayout = (0, exports.tableLayoutModelToTableLayout)(model);
|
|
79
59
|
return tableLayout;
|
|
80
60
|
};
|
|
81
61
|
exports.normalizeTableLayout = normalizeTableLayout;
|
|
82
62
|
const normalizePivotLayout = (pivotLayout) => {
|
|
83
|
-
const Source = pivotLayout.Source;
|
|
84
|
-
const Uuid = pivotLayout.Uuid;
|
|
85
|
-
const AdaptableVersion = pivotLayout.AdaptableVersion;
|
|
86
|
-
const ColumnFilters = pivotLayout.ColumnFilters;
|
|
87
|
-
const GridFilter = pivotLayout.GridFilter;
|
|
88
63
|
let model = (0, exports.pivotLayoutToPivotLayoutModel)(pivotLayout);
|
|
89
64
|
model = (0, normalizeLayoutModel_1.normalizePivotLayoutModel)(model);
|
|
90
|
-
pivotLayout = (0, exports.pivotLayoutModelToPivotLayout)(model
|
|
91
|
-
if (Source) {
|
|
92
|
-
pivotLayout.Source = Source;
|
|
93
|
-
}
|
|
94
|
-
if (Uuid) {
|
|
95
|
-
pivotLayout.Uuid = Uuid;
|
|
96
|
-
}
|
|
97
|
-
if (AdaptableVersion) {
|
|
98
|
-
pivotLayout.AdaptableVersion = AdaptableVersion;
|
|
99
|
-
}
|
|
100
|
-
if (ColumnFilters) {
|
|
101
|
-
pivotLayout.ColumnFilters = ColumnFilters;
|
|
102
|
-
}
|
|
103
|
-
if (GridFilter) {
|
|
104
|
-
pivotLayout.GridFilter = GridFilter;
|
|
105
|
-
}
|
|
65
|
+
pivotLayout = (0, exports.pivotLayoutModelToPivotLayout)(model);
|
|
106
66
|
return pivotLayout;
|
|
107
67
|
};
|
|
108
68
|
exports.normalizePivotLayout = normalizePivotLayout;
|
|
@@ -133,15 +93,6 @@ exports.checkForDuplicateColumns = checkForDuplicateColumns;
|
|
|
133
93
|
const tableLayoutToTableLayoutModel = (tableLayout) => {
|
|
134
94
|
tableLayout = structuredClone(tableLayout);
|
|
135
95
|
cleanupAdaptableObjectPrimitives(tableLayout);
|
|
136
|
-
if (tableLayout.RowGroupValues) {
|
|
137
|
-
// @ts-ignore
|
|
138
|
-
delete tableLayout.RowGroupValues.Source;
|
|
139
|
-
// @ts-ignore
|
|
140
|
-
delete tableLayout.RowGroupValues.Uuid;
|
|
141
|
-
// @ts-ignore
|
|
142
|
-
delete tableLayout.RowGroupValues.AdaptableVersion;
|
|
143
|
-
}
|
|
144
|
-
delete tableLayout.ColumnHeaders;
|
|
145
96
|
const TableAggregationColumns = (tableLayout.TableAggregationColumns || []).map(({ ColumnId, AggFunc }) => {
|
|
146
97
|
return {
|
|
147
98
|
ColumnId,
|
|
@@ -149,12 +100,12 @@ const tableLayoutToTableLayoutModel = (tableLayout) => {
|
|
|
149
100
|
};
|
|
150
101
|
});
|
|
151
102
|
const result = (0, simplifyLayoutModel_1.simplifyTableLayoutModel)({
|
|
103
|
+
Ignore_Name: tableLayout.Name,
|
|
152
104
|
SuppressAggFuncInHeader: tableLayout.SuppressAggFuncInHeader,
|
|
153
105
|
TableColumns: tableLayout.TableColumns,
|
|
154
106
|
ColumnWidths: tableLayout.ColumnWidths,
|
|
155
107
|
ColumnVisibility: tableLayout.ColumnVisibility,
|
|
156
108
|
ColumnSorts: tableLayout.ColumnSorts,
|
|
157
|
-
// ColumnHeaders: tableLayout.ColumnHeaders,
|
|
158
109
|
RowGroupedColumns: tableLayout.RowGroupedColumns,
|
|
159
110
|
ColumnPinning: tableLayout.ColumnPinning,
|
|
160
111
|
RowGroupValues: tableLayout.RowGroupValues
|
|
@@ -175,10 +126,34 @@ const tableLayoutToTableLayoutModel = (tableLayout) => {
|
|
|
175
126
|
result.RowGroupDisplayType = tableLayout.RowGroupDisplayType;
|
|
176
127
|
}
|
|
177
128
|
if (tableLayout.ColumnFilters) {
|
|
178
|
-
result.
|
|
129
|
+
result.Ignore_ColumnFilters = tableLayout.ColumnFilters;
|
|
179
130
|
}
|
|
180
131
|
if (tableLayout.GridFilter) {
|
|
181
|
-
result.
|
|
132
|
+
result.Ignore_GridFilter = tableLayout.GridFilter;
|
|
133
|
+
}
|
|
134
|
+
if (tableLayout.ColumnHeaders) {
|
|
135
|
+
result.Ignore_ColumnHeaders = tableLayout.ColumnHeaders;
|
|
136
|
+
}
|
|
137
|
+
if (tableLayout.AutoSizeColumns != null) {
|
|
138
|
+
result.Ignore_AutoSizeColumns = tableLayout.AutoSizeColumns;
|
|
139
|
+
}
|
|
140
|
+
if (tableLayout.IsReadOnly != null) {
|
|
141
|
+
result.Ignore_IsReadOnly = tableLayout.IsReadOnly;
|
|
142
|
+
}
|
|
143
|
+
if (tableLayout.Tags) {
|
|
144
|
+
result.Ignore_Tags = tableLayout.Tags;
|
|
145
|
+
}
|
|
146
|
+
if (tableLayout.Source) {
|
|
147
|
+
result.Ignore_Source = tableLayout.Source;
|
|
148
|
+
}
|
|
149
|
+
if (tableLayout.AdaptableVersion) {
|
|
150
|
+
result.Ignore_AdaptableVersion = tableLayout.AdaptableVersion;
|
|
151
|
+
}
|
|
152
|
+
if (tableLayout.Uuid) {
|
|
153
|
+
result.Ignore_Uuid = tableLayout.Uuid;
|
|
154
|
+
}
|
|
155
|
+
if (tableLayout.RowSummaries != null) {
|
|
156
|
+
result.Ignore_RowSummaries = tableLayout.RowSummaries;
|
|
182
157
|
}
|
|
183
158
|
return result;
|
|
184
159
|
};
|
|
@@ -186,8 +161,8 @@ exports.tableLayoutToTableLayoutModel = tableLayoutToTableLayoutModel;
|
|
|
186
161
|
const pivotLayoutToPivotLayoutModel = (pivotLayout) => {
|
|
187
162
|
pivotLayout = structuredClone(pivotLayout);
|
|
188
163
|
cleanupAdaptableObjectPrimitives(pivotLayout);
|
|
189
|
-
delete pivotLayout.ColumnHeaders;
|
|
190
164
|
const result = (0, simplifyLayoutModel_1.simplifyPivotLayoutModel)({
|
|
165
|
+
Ignore_Name: pivotLayout.Name,
|
|
191
166
|
SuppressAggFuncInHeader: pivotLayout.SuppressAggFuncInHeader,
|
|
192
167
|
ColumnWidths: pivotLayout.ColumnWidths,
|
|
193
168
|
ColumnVisibility: pivotLayout.ColumnVisibility,
|
|
@@ -219,10 +194,31 @@ const pivotLayoutToPivotLayoutModel = (pivotLayout) => {
|
|
|
219
194
|
: undefined,
|
|
220
195
|
});
|
|
221
196
|
if (pivotLayout.ColumnFilters) {
|
|
222
|
-
result.
|
|
197
|
+
result.Ignore_ColumnFilters = pivotLayout.ColumnFilters;
|
|
223
198
|
}
|
|
224
199
|
if (pivotLayout.GridFilter) {
|
|
225
|
-
result.
|
|
200
|
+
result.Ignore_GridFilter = pivotLayout.GridFilter;
|
|
201
|
+
}
|
|
202
|
+
if (pivotLayout.ColumnHeaders) {
|
|
203
|
+
result.Ignore_ColumnHeaders = pivotLayout.ColumnHeaders;
|
|
204
|
+
}
|
|
205
|
+
if (pivotLayout.IsReadOnly != null) {
|
|
206
|
+
result.Ignore_IsReadOnly = pivotLayout.IsReadOnly;
|
|
207
|
+
}
|
|
208
|
+
if (pivotLayout.Tags) {
|
|
209
|
+
result.Ignore_Tags = pivotLayout.Tags;
|
|
210
|
+
}
|
|
211
|
+
if (pivotLayout.AutoSizeColumns != null) {
|
|
212
|
+
result.Ignore_AutoSizeColumns = pivotLayout.AutoSizeColumns;
|
|
213
|
+
}
|
|
214
|
+
if (pivotLayout.Source) {
|
|
215
|
+
result.Ignore_Source = pivotLayout.Source;
|
|
216
|
+
}
|
|
217
|
+
if (pivotLayout.AdaptableVersion) {
|
|
218
|
+
result.Ignore_AdaptableVersion = pivotLayout.AdaptableVersion;
|
|
219
|
+
}
|
|
220
|
+
if (pivotLayout.Uuid) {
|
|
221
|
+
result.Ignore_Uuid = pivotLayout.Uuid;
|
|
226
222
|
}
|
|
227
223
|
return result;
|
|
228
224
|
};
|
|
@@ -233,14 +229,47 @@ function toAggFunc(aggFunc) {
|
|
|
233
229
|
}
|
|
234
230
|
return { aggFunc };
|
|
235
231
|
}
|
|
236
|
-
const tableLayoutModelToTableLayout = (layoutModel
|
|
232
|
+
const tableLayoutModelToTableLayout = (layoutModel) => {
|
|
237
233
|
const tableLayout = {
|
|
238
|
-
|
|
234
|
+
Name: layoutModel.Ignore_Name,
|
|
239
235
|
TableColumns: layoutModel.TableColumns,
|
|
240
236
|
ColumnWidths: layoutModel.ColumnWidths,
|
|
241
237
|
ColumnVisibility: layoutModel.ColumnVisibility,
|
|
242
238
|
ColumnSorts: layoutModel.ColumnSorts,
|
|
243
239
|
};
|
|
240
|
+
if (layoutModel.SuppressAggFuncInHeader) {
|
|
241
|
+
tableLayout.SuppressAggFuncInHeader = layoutModel.SuppressAggFuncInHeader;
|
|
242
|
+
}
|
|
243
|
+
if (layoutModel.Ignore_GridFilter) {
|
|
244
|
+
tableLayout.GridFilter = layoutModel.Ignore_GridFilter;
|
|
245
|
+
}
|
|
246
|
+
if (layoutModel.Ignore_ColumnFilters) {
|
|
247
|
+
tableLayout.ColumnFilters = layoutModel.Ignore_ColumnFilters;
|
|
248
|
+
}
|
|
249
|
+
if (layoutModel.Ignore_ColumnHeaders) {
|
|
250
|
+
tableLayout.ColumnHeaders = layoutModel.Ignore_ColumnHeaders;
|
|
251
|
+
}
|
|
252
|
+
if (layoutModel.Ignore_AutoSizeColumns != null) {
|
|
253
|
+
tableLayout.AutoSizeColumns = layoutModel.Ignore_AutoSizeColumns;
|
|
254
|
+
}
|
|
255
|
+
if (layoutModel.Ignore_RowSummaries) {
|
|
256
|
+
tableLayout.RowSummaries = layoutModel.Ignore_RowSummaries;
|
|
257
|
+
}
|
|
258
|
+
if (layoutModel.Ignore_IsReadOnly != null) {
|
|
259
|
+
tableLayout.IsReadOnly = layoutModel.Ignore_IsReadOnly;
|
|
260
|
+
}
|
|
261
|
+
if (layoutModel.Ignore_Tags) {
|
|
262
|
+
tableLayout.Tags = layoutModel.Ignore_Tags;
|
|
263
|
+
}
|
|
264
|
+
if (layoutModel.Ignore_Source) {
|
|
265
|
+
tableLayout.Source = layoutModel.Ignore_Source;
|
|
266
|
+
}
|
|
267
|
+
if (layoutModel.Ignore_AdaptableVersion) {
|
|
268
|
+
tableLayout.AdaptableVersion = layoutModel.Ignore_AdaptableVersion;
|
|
269
|
+
}
|
|
270
|
+
if (layoutModel.Ignore_Uuid) {
|
|
271
|
+
tableLayout.Uuid = layoutModel.Ignore_Uuid;
|
|
272
|
+
}
|
|
244
273
|
if (layoutModel.RowGroupDisplayType) {
|
|
245
274
|
tableLayout.RowGroupDisplayType = layoutModel.RowGroupDisplayType;
|
|
246
275
|
}
|
|
@@ -287,12 +316,6 @@ const tableLayoutModelToTableLayout = (layoutModel, defaults) => {
|
|
|
287
316
|
else {
|
|
288
317
|
delete tableLayout.GrandTotalRow;
|
|
289
318
|
}
|
|
290
|
-
if (layoutModel.ColumnFilters) {
|
|
291
|
-
tableLayout.ColumnFilters = layoutModel.ColumnFilters;
|
|
292
|
-
}
|
|
293
|
-
if (layoutModel.GridFilter) {
|
|
294
|
-
tableLayout.GridFilter = layoutModel.GridFilter;
|
|
295
|
-
}
|
|
296
319
|
cleanupAdaptableObjectPrimitives(tableLayout);
|
|
297
320
|
return tableLayout;
|
|
298
321
|
};
|
|
@@ -307,9 +330,9 @@ function toAggregationColumnValue(columnAggregationModel) {
|
|
|
307
330
|
}
|
|
308
331
|
: columnAggregationModel.aggFunc;
|
|
309
332
|
}
|
|
310
|
-
const pivotLayoutModelToPivotLayout = (layoutModel
|
|
333
|
+
const pivotLayoutModelToPivotLayout = (layoutModel) => {
|
|
311
334
|
const pivotLayout = {
|
|
312
|
-
|
|
335
|
+
Name: layoutModel.Ignore_Name,
|
|
313
336
|
PivotColumns: layoutModel.PivotColumns,
|
|
314
337
|
TableColumns: layoutModel.TableColumns,
|
|
315
338
|
ColumnWidths: layoutModel.ColumnWidths,
|
|
@@ -318,6 +341,36 @@ const pivotLayoutModelToPivotLayout = (layoutModel, defaults) => {
|
|
|
318
341
|
ColumnPinning: layoutModel.ColumnPinning,
|
|
319
342
|
PivotExpandLevel: layoutModel.PivotExpandLevel,
|
|
320
343
|
};
|
|
344
|
+
if (layoutModel.SuppressAggFuncInHeader) {
|
|
345
|
+
pivotLayout.SuppressAggFuncInHeader = layoutModel.SuppressAggFuncInHeader;
|
|
346
|
+
}
|
|
347
|
+
if (layoutModel.Ignore_GridFilter) {
|
|
348
|
+
pivotLayout.GridFilter = layoutModel.Ignore_GridFilter;
|
|
349
|
+
}
|
|
350
|
+
if (layoutModel.Ignore_ColumnFilters) {
|
|
351
|
+
pivotLayout.ColumnFilters = layoutModel.Ignore_ColumnFilters;
|
|
352
|
+
}
|
|
353
|
+
if (layoutModel.Ignore_ColumnHeaders) {
|
|
354
|
+
pivotLayout.ColumnHeaders = layoutModel.Ignore_ColumnHeaders;
|
|
355
|
+
}
|
|
356
|
+
if (layoutModel.Ignore_AutoSizeColumns != null) {
|
|
357
|
+
pivotLayout.AutoSizeColumns = layoutModel.Ignore_AutoSizeColumns;
|
|
358
|
+
}
|
|
359
|
+
if (layoutModel.Ignore_IsReadOnly != null) {
|
|
360
|
+
pivotLayout.IsReadOnly = layoutModel.Ignore_IsReadOnly;
|
|
361
|
+
}
|
|
362
|
+
if (layoutModel.Ignore_Tags) {
|
|
363
|
+
pivotLayout.Tags = layoutModel.Ignore_Tags;
|
|
364
|
+
}
|
|
365
|
+
if (layoutModel.Ignore_Source) {
|
|
366
|
+
pivotLayout.Source = layoutModel.Ignore_Source;
|
|
367
|
+
}
|
|
368
|
+
if (layoutModel.Ignore_AdaptableVersion) {
|
|
369
|
+
pivotLayout.AdaptableVersion = layoutModel.Ignore_AdaptableVersion;
|
|
370
|
+
}
|
|
371
|
+
if (layoutModel.Ignore_Uuid) {
|
|
372
|
+
pivotLayout.Uuid = layoutModel.Ignore_Uuid;
|
|
373
|
+
}
|
|
321
374
|
if (layoutModel.PivotGroupedColumns) {
|
|
322
375
|
pivotLayout.PivotGroupedColumns = layoutModel.PivotGroupedColumns;
|
|
323
376
|
}
|
|
@@ -338,19 +391,19 @@ const pivotLayoutModelToPivotLayout = (layoutModel, defaults) => {
|
|
|
338
391
|
else {
|
|
339
392
|
delete pivotLayout.RowGroupValues;
|
|
340
393
|
}
|
|
341
|
-
if (layoutModel.GrandTotalRow) {
|
|
394
|
+
if (layoutModel.GrandTotalRow != null) {
|
|
342
395
|
pivotLayout.GrandTotalRow = layoutModel.GrandTotalRow;
|
|
343
396
|
}
|
|
344
397
|
else {
|
|
345
398
|
delete pivotLayout.GrandTotalRow;
|
|
346
399
|
}
|
|
347
|
-
if (layoutModel.PivotGrandTotal) {
|
|
400
|
+
if (layoutModel.PivotGrandTotal != null) {
|
|
348
401
|
pivotLayout.PivotGrandTotal = layoutModel.PivotGrandTotal;
|
|
349
402
|
}
|
|
350
403
|
else {
|
|
351
404
|
delete pivotLayout.PivotGrandTotal;
|
|
352
405
|
}
|
|
353
|
-
if (layoutModel.PivotColumnTotal) {
|
|
406
|
+
if (layoutModel.PivotColumnTotal != null) {
|
|
354
407
|
pivotLayout.PivotColumnTotal = layoutModel.PivotColumnTotal;
|
|
355
408
|
}
|
|
356
409
|
else {
|
|
@@ -366,12 +419,6 @@ const pivotLayoutModelToPivotLayout = (layoutModel, defaults) => {
|
|
|
366
419
|
else {
|
|
367
420
|
delete pivotLayout.PivotAggregationColumns;
|
|
368
421
|
}
|
|
369
|
-
if (layoutModel.ColumnFilters) {
|
|
370
|
-
pivotLayout.ColumnFilters = layoutModel.ColumnFilters;
|
|
371
|
-
}
|
|
372
|
-
if (layoutModel.GridFilter) {
|
|
373
|
-
pivotLayout.GridFilter = layoutModel.GridFilter;
|
|
374
|
-
}
|
|
375
422
|
return pivotLayout;
|
|
376
423
|
};
|
|
377
424
|
exports.pivotLayoutModelToPivotLayout = pivotLayoutModelToPivotLayout;
|
|
@@ -11,7 +11,7 @@ export declare class EventInternalApi extends ApiBase {
|
|
|
11
11
|
fireDashboardChangedEvent(trigger: string, oldDashboardState: DashboardState, newDashboardState: DashboardState): void;
|
|
12
12
|
fireAlertFiredEvent(alertToFire: AdaptableAlert): void;
|
|
13
13
|
fireThemeChangedEvent(theme: AdaptableTheme, trigger: 'ThemeSelected' | 'ThemeEdited'): void;
|
|
14
|
-
fireLayoutChangedEvent(trigger: string,
|
|
14
|
+
fireLayoutChangedEvent(trigger: string, oldState: LayoutState, newState: LayoutState): void;
|
|
15
15
|
fireScheduleTriggeredEvent(schedule: BaseSchedule): void;
|
|
16
16
|
fireDataSetSelectedEvent(dataSet: DataSet): void;
|
|
17
17
|
fireSystemStatusMessageDisplayedEvent(systemStatusMessageInfo: SystemStatusMessageInfo): void;
|
|
@@ -88,13 +88,13 @@ class EventInternalApi extends ApiBase_1.ApiBase {
|
|
|
88
88
|
};
|
|
89
89
|
this.getEventApi().emit('ThemeChanged', themeChangedInfo);
|
|
90
90
|
}
|
|
91
|
-
fireLayoutChangedEvent(trigger,
|
|
92
|
-
if ((0, isEqual_1.default)(
|
|
91
|
+
fireLayoutChangedEvent(trigger, oldState, newState) {
|
|
92
|
+
if ((0, isEqual_1.default)(oldState, newState)) {
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
95
|
const layoutChangedInfo = {
|
|
96
96
|
actionName: trigger,
|
|
97
|
-
oldLayoutState:
|
|
97
|
+
oldLayoutState: oldState,
|
|
98
98
|
newLayoutState: newState,
|
|
99
99
|
...this.getAdaptableInternalApi().buildBaseContext(),
|
|
100
100
|
};
|
|
@@ -234,9 +234,32 @@ const LayoutReducer = (state = initialState, action) => {
|
|
|
234
234
|
}
|
|
235
235
|
case exports.LAYOUT_SAVE: {
|
|
236
236
|
const actionLayout = action.layout;
|
|
237
|
+
let found = false;
|
|
238
|
+
let Layouts = state.Layouts.map((abObject) => {
|
|
239
|
+
if (found) {
|
|
240
|
+
// if already found, keep things as they were
|
|
241
|
+
return abObject;
|
|
242
|
+
}
|
|
243
|
+
found = abObject.Uuid === actionLayout.Uuid;
|
|
244
|
+
return found ? actionLayout : abObject;
|
|
245
|
+
});
|
|
246
|
+
if (!found) {
|
|
247
|
+
// let's try to find by name
|
|
248
|
+
Layouts = state.Layouts.map((abObject) => {
|
|
249
|
+
if (found) {
|
|
250
|
+
// if already found, keep things as they were
|
|
251
|
+
return abObject;
|
|
252
|
+
}
|
|
253
|
+
found = abObject.Name === actionLayout.Name;
|
|
254
|
+
return found ? actionLayout : abObject;
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
if (!found) {
|
|
258
|
+
Layouts = [...state.Layouts, actionLayout];
|
|
259
|
+
}
|
|
237
260
|
return {
|
|
238
261
|
...state,
|
|
239
|
-
Layouts
|
|
262
|
+
Layouts,
|
|
240
263
|
};
|
|
241
264
|
}
|
|
242
265
|
case exports.LAYOUT_DELETE: {
|
|
@@ -909,7 +909,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
909
909
|
returnAction.type == LayoutRedux.LAYOUT_COLUMN_SET_CAPTION) {
|
|
910
910
|
// tell AdapTable the Layout has been selected
|
|
911
911
|
if (newLayout) {
|
|
912
|
-
adaptable.
|
|
912
|
+
adaptable.updateLayoutInManagerAfterStoreHasChanged(newLayout);
|
|
913
913
|
}
|
|
914
914
|
}
|
|
915
915
|
// when changing current layout via the api, the layout should update
|
|
@@ -920,7 +920,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
920
920
|
// objects may have changed, but have the same contents
|
|
921
921
|
// this prevents pivot layout from infinite set-layout
|
|
922
922
|
!adaptable.api.layoutApi.internalApi.areLayoutsEqual(previousLayout, savingLayout)) {
|
|
923
|
-
adaptable.
|
|
923
|
+
adaptable.updateLayoutInManagerAfterStoreHasChanged(savingLayout);
|
|
924
924
|
}
|
|
925
925
|
}
|
|
926
926
|
return returnAction;
|
|
@@ -944,8 +944,11 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
944
944
|
const shouldTriggerColumnFiltering = adaptable.api.filterApi.columnFilterApi.internalApi.shouldNewColumnFilterTriggerColumnFiltering(action);
|
|
945
945
|
const oldLayoutState = middlewareAPI.getState().Layout;
|
|
946
946
|
returnAction = next(action);
|
|
947
|
-
|
|
948
|
-
|
|
947
|
+
// we need to update the current layout model
|
|
948
|
+
// in the layout manager, so that onLayoutChange
|
|
949
|
+
// it will come back with the correct fields
|
|
950
|
+
adaptable.silentUpdateCurrentLayoutModel();
|
|
951
|
+
if (shouldTriggerColumnFiltering) {
|
|
949
952
|
setTimeout(() => {
|
|
950
953
|
adaptable.applyFiltering();
|
|
951
954
|
}, 50);
|
|
@@ -29,6 +29,7 @@ import { RowFormService } from '../Utilities/Services/RowFormService';
|
|
|
29
29
|
import { GridCellWithCount } from '../AdaptableState/Selection/GridCell';
|
|
30
30
|
import { FlashingCellService } from '../Utilities/Services/FlashingCellService';
|
|
31
31
|
import { AgGridExportAdapter } from './AgGridExportAdapter';
|
|
32
|
+
import { PivotLayoutModel, TableLayoutModel } from '../layout-manager/src/LayoutManagerModel';
|
|
32
33
|
import { AgGridThemeAdapter } from './AgGridThemeAdapter';
|
|
33
34
|
export type AdaptableLifecycleState = 'initial' | 'preprocessOptions' | 'initAdaptableState' | 'setupAgGrid' | 'initAgGrid' | 'agGridReady' | 'available' | 'ready' | 'preDestroyed';
|
|
34
35
|
type RenderAgGridFrameworkComponentResult = false | GridApi;
|
|
@@ -99,19 +100,12 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
99
100
|
private agGridListenerKeydown;
|
|
100
101
|
private agGridListenerMouseEnter;
|
|
101
102
|
private agGridListenerMouseLeave;
|
|
102
|
-
private listenerGlobalColumnEventsThatTriggerStateChange;
|
|
103
|
-
private listenerGlobalColumnEventsThatTriggerAutoLayoutSave;
|
|
104
|
-
private listenerGlobalRowGroupEventsThatTriggerAutoLayoutSave;
|
|
105
103
|
private listenerGlobalSetRowSelection;
|
|
106
104
|
private listenerCellEditingStarted;
|
|
107
105
|
private listenerFirstDataRendered;
|
|
108
106
|
private listenerPivotChanged;
|
|
109
|
-
private listenerColumnRowGroupChanged;
|
|
110
|
-
private listenerColumnResized;
|
|
111
107
|
private listenerCellSelectionChanged;
|
|
112
108
|
private listenerSortChanged;
|
|
113
|
-
private listenerModelUpdated;
|
|
114
|
-
private filteredOutPrimaryKeys;
|
|
115
109
|
private layoutManager;
|
|
116
110
|
private columnMinMaxValuesCache;
|
|
117
111
|
renderReactRoot: RenderReactRootFn;
|
|
@@ -123,7 +117,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
123
117
|
private adaptableStatusPanelKeys;
|
|
124
118
|
_PRIVATE_adaptableJSXElement: React.JSX.Element;
|
|
125
119
|
private _prevLayout;
|
|
126
|
-
private
|
|
120
|
+
private __prevLayoutForRefresh;
|
|
127
121
|
constructor(config?: {
|
|
128
122
|
getAgGridColumnApiModuleReference?: () => Module;
|
|
129
123
|
});
|
|
@@ -148,6 +142,8 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
148
142
|
normalizeAdaptableState(state: AdaptableState, agGridOptions: NormalizeAdaptableStateOptions): AdaptableState;
|
|
149
143
|
private normaliseLayoutState;
|
|
150
144
|
private normaliseToolPanelState;
|
|
145
|
+
private getCurrentLayoutModel;
|
|
146
|
+
silentUpdateCurrentLayoutModel(layoutModel?: TableLayoutModel | PivotLayoutModel): void;
|
|
151
147
|
applyFiltering(): void;
|
|
152
148
|
showQuickFilter(): void;
|
|
153
149
|
hideQuickFilter(): void;
|
|
@@ -186,6 +182,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
186
182
|
private deriveAdaptableColumnStateFromAgGrid;
|
|
187
183
|
private checkShouldClearExistingFiltersOrSearches;
|
|
188
184
|
getGridCellFromRowNode(rowNode: IRowNode, columnId: string): GridCell | undefined;
|
|
185
|
+
isRowNodeAvailableAfterFiltering(rowNode: IRowNode): boolean;
|
|
189
186
|
/**
|
|
190
187
|
* Use (lazy evaluated) getters to avoid unnecessary calculations and memoization to avoid recalculating the same values
|
|
191
188
|
*/
|
|
@@ -260,7 +257,6 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
260
257
|
}): Promise<GridCell[]>;
|
|
261
258
|
getDistinctGridCellsForColumn(column: AdaptableColumn): GridCellWithCount[];
|
|
262
259
|
private getGridCellsForCustomColumnValues;
|
|
263
|
-
private isPrimaryKeyVisible;
|
|
264
260
|
private addDistinctColumnValue;
|
|
265
261
|
private getUniqueGridCells;
|
|
266
262
|
getGridCellsForColumn(columnId: string, onlyVisibleRows?: boolean): GridCell[] | undefined;
|
|
@@ -322,7 +318,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
322
318
|
isQuickFilterAvailable(): boolean;
|
|
323
319
|
private hasFloatingFilterOnAtLeastOneColumn;
|
|
324
320
|
getChartRef(chartId: string): ChartRef;
|
|
325
|
-
|
|
321
|
+
updateLayoutInManagerAfterStoreHasChanged(layout?: Layout): void;
|
|
326
322
|
private getActiveAdaptableAggFuncForCol;
|
|
327
323
|
private onRowDataChanged;
|
|
328
324
|
private onCellDataChanged;
|
|
@@ -344,6 +340,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
344
340
|
private isRowGroupDifferentInLayout;
|
|
345
341
|
private hasPivotTotalsInLayout;
|
|
346
342
|
private onLayoutChange;
|
|
343
|
+
private refreshAdaptableAfterLayoutChange;
|
|
347
344
|
private validateColumnDefTypes;
|
|
348
345
|
}
|
|
349
346
|
export {};
|