@adaptabletools/adaptable-cjs 20.1.4 → 20.1.6

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.
Files changed (36) hide show
  1. package/base.css +1 -0
  2. package/base.css.map +1 -1
  3. package/index.css +1 -0
  4. package/index.css.map +1 -1
  5. package/package.json +1 -1
  6. package/src/AdaptableInterfaces/IAdaptable.d.ts +3 -1
  7. package/src/AdaptableState/Common/AdaptableFilterState.d.ts +1 -1
  8. package/src/AdaptableState/Common/AdaptableSortState.d.ts +8 -3
  9. package/src/Api/CustomSortApi.d.ts +19 -9
  10. package/src/Api/GridApi.d.ts +3 -3
  11. package/src/Api/Implementation/CustomSortApiImpl.d.ts +3 -0
  12. package/src/Api/Implementation/CustomSortApiImpl.js +36 -0
  13. package/src/Api/Implementation/LayoutApiImpl.js +1 -1
  14. package/src/Api/Implementation/LayoutHelpers.d.ts +3 -3
  15. package/src/Api/Implementation/LayoutHelpers.js +126 -79
  16. package/src/Api/Implementation/StateApiImpl.d.ts +1 -2
  17. package/src/Api/Implementation/StateApiImpl.js +2 -4
  18. package/src/Api/Internal/EventInternalApi.d.ts +1 -1
  19. package/src/Api/Internal/EventInternalApi.js +11 -9
  20. package/src/Redux/ActionsReducers/LayoutRedux.js +24 -1
  21. package/src/Redux/Store/AdaptableStore.js +7 -4
  22. package/src/View/Components/FilterForm/ListBoxFilterForm.js +1 -1
  23. package/src/agGrid/AdaptableAgGrid.d.ts +7 -10
  24. package/src/agGrid/AdaptableAgGrid.js +80 -108
  25. package/src/components/ExpressionEditor/BaseEditorInput.js +2 -0
  26. package/src/components/Select/Select.d.ts +1 -0
  27. package/src/components/Select/Select.js +41 -15
  28. package/src/env.js +2 -2
  29. package/src/layout-manager/src/LayoutManagerModel.d.ts +29 -2
  30. package/src/layout-manager/src/index.d.ts +3 -0
  31. package/src/layout-manager/src/index.js +101 -30
  32. package/src/layout-manager/src/isLayoutEqual.js +11 -2
  33. package/src/layout-manager/src/normalizeLayoutModel.js +6 -0
  34. package/src/layout-manager/src/simplifyLayoutModel.js +3 -3
  35. package/src/metamodel/adaptable.metamodel.js +1 -1
  36. 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, defaults) => {
18
+ const layoutModelToLayoutState = (layoutModel) => {
19
19
  if ((0, isPivotLayoutModel_1.isPivotLayoutModel)(layoutModel)) {
20
- return (0, exports.pivotLayoutModelToPivotLayout)(layoutModel, defaults);
20
+ return (0, exports.pivotLayoutModelToPivotLayout)(layoutModel);
21
21
  }
22
- return (0, exports.tableLayoutModelToTableLayout)(layoutModel, defaults);
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, tableLayout);
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, pivotLayout);
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.ColumnFilters = tableLayout.ColumnFilters;
129
+ result.Ignore_ColumnFilters = tableLayout.ColumnFilters;
179
130
  }
180
131
  if (tableLayout.GridFilter) {
181
- result.GridFilter = tableLayout.GridFilter;
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.ColumnFilters = pivotLayout.ColumnFilters;
197
+ result.Ignore_ColumnFilters = pivotLayout.ColumnFilters;
223
198
  }
224
199
  if (pivotLayout.GridFilter) {
225
- result.GridFilter = pivotLayout.GridFilter;
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, defaults) => {
232
+ const tableLayoutModelToTableLayout = (layoutModel) => {
237
233
  const tableLayout = {
238
- ...defaults,
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, defaults) => {
333
+ const pivotLayoutModelToPivotLayout = (layoutModel) => {
311
334
  const pivotLayout = {
312
- ...defaults,
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;
@@ -17,7 +17,7 @@ import { FreeTextColumnState } from '../../AdaptableState/FreeTextColumnState';
17
17
  import { ToolPanelState } from '../../AdaptableState/ToolPanelState';
18
18
  import { StateApi } from '../StateApi';
19
19
  import { AdaptableModule, AdaptableStateKey } from '../../AdaptableState/Common/Types';
20
- import { AdaptableOptions, AdaptableFilterState, AdaptableSortState, FlashingCellState, InitialState, NamedQueryState, ScheduleState, StatusBarState, StyledColumnState } from '../../types';
20
+ import { AdaptableFilterState, AdaptableSortState, FlashingCellState, InitialState, NamedQueryState, ScheduleState, StatusBarState, StyledColumnState } from '../../types';
21
21
  import { PredefinedConfig } from '../../AdaptableState/InitialState';
22
22
  import { ChartingState } from '../../AdaptableState/ChartingState';
23
23
  import { NoteState } from '../../AdaptableState/NoteState';
@@ -35,7 +35,6 @@ export declare class StateApiImpl extends ApiBase implements StateApi {
35
35
  loadUserState(state: InitialState): void;
36
36
  getAdaptableFilterState(): AdaptableFilterState;
37
37
  getAdaptableSortState(): AdaptableSortState;
38
- getAdaptableOptions(): Readonly<AdaptableOptions>;
39
38
  setAdaptableStateKey(adaptableStateKey: string, config?: {
40
39
  initialState?: InitialState;
41
40
  flushCurrentState?: boolean;
@@ -113,13 +113,11 @@ class StateApiImpl extends ApiBase_1.ApiBase {
113
113
  getAdaptableSortState() {
114
114
  const adaptableSortState = {
115
115
  columnSorts: this.getGridApi().getColumnSorts(),
116
- customSorts: this.getCustomSortApi().getActiveCustomSorts(),
116
+ customSorts: this.getCustomSortApi().getLiveCustomSorts(),
117
+ customSortComparers: this.getCustomSortApi().getLiveCustomSortComparers(),
117
118
  };
118
119
  return adaptableSortState;
119
120
  }
120
- getAdaptableOptions() {
121
- return undefined;
122
- }
123
121
  setAdaptableStateKey(adaptableStateKey, config) {
124
122
  return new Promise((resolve, reject) => {
125
123
  this.getAdaptableInternalApi().executeWithProgressIndicator(config?.progressIndicatorLabel ?? `Initialising...`, () => {
@@ -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, oldSate: LayoutState, newState: LayoutState): void;
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;
@@ -7,12 +7,14 @@ const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
7
7
  class EventInternalApi extends ApiBase_1.ApiBase {
8
8
  fireGridSortedEvent() {
9
9
  if (this.isAdapTableReady()) {
10
- const adaptableSortState = this.getStateApi().getAdaptableSortState();
11
- const gridSortedInfo = {
12
- adaptableSortState,
13
- ...this.getAdaptableInternalApi().buildBaseContext(),
14
- };
15
- this.getEventApi().emit('GridSorted', gridSortedInfo);
10
+ setTimeout(() => {
11
+ const adaptableSortState = this.getStateApi().getAdaptableSortState();
12
+ const gridSortedInfo = {
13
+ adaptableSortState,
14
+ ...this.getAdaptableInternalApi().buildBaseContext(),
15
+ };
16
+ this.getEventApi().emit('GridSorted', gridSortedInfo);
17
+ }, 50);
16
18
  }
17
19
  }
18
20
  fireCellChangedEvent(cellDataChangedInfo) {
@@ -86,13 +88,13 @@ class EventInternalApi extends ApiBase_1.ApiBase {
86
88
  };
87
89
  this.getEventApi().emit('ThemeChanged', themeChangedInfo);
88
90
  }
89
- fireLayoutChangedEvent(trigger, oldSate, newState) {
90
- if ((0, isEqual_1.default)(oldSate, newState)) {
91
+ fireLayoutChangedEvent(trigger, oldState, newState) {
92
+ if ((0, isEqual_1.default)(oldState, newState)) {
91
93
  return;
92
94
  }
93
95
  const layoutChangedInfo = {
94
96
  actionName: trigger,
95
- oldLayoutState: oldSate,
97
+ oldLayoutState: oldState,
96
98
  newLayoutState: newState,
97
99
  ...this.getAdaptableInternalApi().buildBaseContext(),
98
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: state.Layouts.map((abObject) => abObject.Uuid === actionLayout.Uuid ? actionLayout : abObject),
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.setLayout(newLayout);
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.setLayout(savingLayout);
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
- if (shouldTriggerColumnFiltering &&
948
- action.type !== LayoutRedux.LAYOUT_COLUMN_FILTER_EDIT) {
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);
@@ -33,7 +33,7 @@ const ColumnValuesSelect = (props) => {
33
33
  minWidth: `var(--ab-cmp-select-column-menu-${column.columnId}__min-width, var(--ab-cmp-select-column-menu__min-width, 160px))`,
34
34
  };
35
35
  }, [column.columnId]);
36
- const component = (React.createElement(Select_1.Select, { isMulti: true, showHeaderSelectionCheckbox: true, searchable: true, closeMenuOnSelect: false, menuStyle: menuStyle, ...props.selectProps, options: options, value: value, isLoading: props.isLoading, onChange: props.onChange }));
36
+ const component = (React.createElement(Select_1.Select, { key: "select", isMulti: true, resizable: true, showHeaderSelectionCheckbox: true, searchable: true, closeMenuOnSelect: false, menuStyle: menuStyle, ...props.selectProps, options: options, value: value, isLoading: props.isLoading, onChange: props.onChange }));
37
37
  return (React.createElement("div", { className: (0, join_1.default)(baseClassName, props.isLoading && `${baseClassName}--loading`, !value.length && `${baseClassName}--empty`), onKeyDownCapture: (e) => {
38
38
  const event = e.nativeEvent || e;
39
39
  event.stopPropagation = () => {
@@ -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 __prevLayoutForOnChange;
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
- setLayout(layout?: Layout): void;
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 {};