@adaptabletools/adaptable-cjs 18.0.0-canary.22 → 18.0.0-canary.24

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 (47) hide show
  1. package/base.css +2 -0
  2. package/base.css.map +1 -1
  3. package/index.css +4 -0
  4. package/index.css.map +1 -1
  5. package/package.json +1 -1
  6. package/src/AdaptableOptions/AdaptablePlugin.d.ts +2 -0
  7. package/src/AdaptableOptions/AdaptablePlugin.js +2 -0
  8. package/src/AdaptableOptions/CommentOptions.d.ts +3 -3
  9. package/src/AdaptableOptions/DataImportOptions.d.ts +2 -2
  10. package/src/AdaptableOptions/GroupingOptions.d.ts +0 -15
  11. package/src/AdaptableOptions/StateOptions.d.ts +1 -1
  12. package/src/Api/ColumnApi.d.ts +4 -0
  13. package/src/Api/CommentApi.d.ts +12 -13
  14. package/src/Api/GridApi.d.ts +4 -0
  15. package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
  16. package/src/Api/Implementation/ColumnApiImpl.js +7 -0
  17. package/src/Api/Implementation/CommentsApiImpl.d.ts +3 -3
  18. package/src/Api/Implementation/CommentsApiImpl.js +5 -5
  19. package/src/Api/Implementation/GridApiImpl.d.ts +1 -0
  20. package/src/Api/Implementation/GridApiImpl.js +3 -0
  21. package/src/Api/Implementation/LayoutApiImpl.d.ts +1 -0
  22. package/src/Api/Implementation/LayoutApiImpl.js +3 -0
  23. package/src/Api/LayoutApi.d.ts +4 -0
  24. package/src/PredefinedConfig/Common/Menu.d.ts +2 -2
  25. package/src/PredefinedConfig/Common/Menu.js +9 -2
  26. package/src/Redux/ActionsReducers/CommentsRedux.d.ts +0 -4
  27. package/src/Redux/ActionsReducers/CommentsRedux.js +1 -39
  28. package/src/Redux/Store/AdaptableStore.js +4 -4
  29. package/src/Strategy/ColumnFilterModule.js +2 -2
  30. package/src/Strategy/CommentModule.d.ts +0 -1
  31. package/src/Strategy/CommentModule.js +7 -7
  32. package/src/Strategy/DashboardModule.js +1 -1
  33. package/src/Strategy/ExportModule.js +1 -1
  34. package/src/Strategy/Fdc3Module.js +1 -1
  35. package/src/Strategy/FormatColumnModule.js +2 -2
  36. package/src/Strategy/StyledColumnModule.js +1 -1
  37. package/src/View/Comments/CommentsEditor.js +4 -6
  38. package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +9 -1
  39. package/src/View/Layout/Wizard/sections/FilterSection.js +1 -1
  40. package/src/View/Note/NotePopup.js +2 -2
  41. package/src/agGrid/AdaptableAgGrid.d.ts +1 -10
  42. package/src/agGrid/AdaptableAgGrid.js +11 -41
  43. package/src/env.js +2 -2
  44. package/src/metamodel/adaptable.metamodel.d.ts +0 -10
  45. package/src/metamodel/adaptable.metamodel.js +1 -1
  46. package/src/types.d.ts +1 -1
  47. package/tsconfig.cjs.tsbuildinfo +1 -1
@@ -19,10 +19,10 @@ const tableDOMProps = {
19
19
  },
20
20
  };
21
21
  const NotePopup = (props) => {
22
- var _a;
22
+ var _a, _b, _c, _d;
23
23
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
24
24
  const primaryKeyHeader = adaptable.api.columnApi.getFriendlyNameForColumnId(adaptable.api.columnApi.getPrimaryKeyColumn().columnId);
25
- const dateFormat = (_a = adaptable.api.optionsApi.getNoteOptions().dateFormat) !== null && _a !== void 0 ? _a : GeneralConstants_1.DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME;
25
+ const dateFormat = (_d = (_c = (_b = (_a = adaptable.api.optionsApi) === null || _a === void 0 ? void 0 : _a.getNoteOptions) === null || _b === void 0 ? void 0 : _b.call(_a)) === null || _c === void 0 ? void 0 : _c.dateFormat) !== null && _d !== void 0 ? _d : GeneralConstants_1.DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME;
26
26
  const allNotes = (0, react_redux_1.useSelector)((state) => (0, NoteRedux_1.GetAllNotesSelector)(state.Note));
27
27
  const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Note') === 'ReadOnly';
28
28
  const columnsMap = React.useMemo(() => {
@@ -58,7 +58,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
58
58
  * once layouts are properly handled with the new aggrid methods & events
59
59
  * we can remove this hack
60
60
  */
61
- private previousAgGridColumnState;
61
+ private previousAgGridLayoutState;
62
62
  _rawAdaptableOptions: AdaptableOptions;
63
63
  adaptableOptions: AdaptableOptions;
64
64
  _isDetailGrid: boolean;
@@ -310,15 +310,6 @@ export declare class AdaptableAgGrid implements IAdaptable {
310
310
  getChartRef(chartId: string): ChartRef;
311
311
  setLayout(layout?: Layout): void;
312
312
  private getActiveAdaptableAggFuncForCol;
313
- /**
314
- * Setting layout works by modifing the column state.
315
- * The column state is based on the current existing columns.
316
- * At this point the column groups do not exist, and the widths from layout are not applied.
317
- *
318
- * After the col sate is applied and the column groups are created we need
319
- * to apply the state again to update the widths of the group columns.
320
- */
321
- private applyGroupColumnWidth;
322
313
  private onRowDataChanged;
323
314
  private onCellDataChanged;
324
315
  private isUndoChange;
@@ -148,7 +148,7 @@ class AdaptableAgGrid {
148
148
  * once layouts are properly handled with the new aggrid methods & events
149
149
  * we can remove this hack
150
150
  */
151
- this.previousAgGridColumnState = '';
151
+ this.previousAgGridLayoutState = '';
152
152
  this.columnMinMaxValuesCache = {};
153
153
  this.renderReactRoot = (node, container) => (0, renderReactRoot_1.renderReactRoot)(node, container);
154
154
  /**
@@ -301,6 +301,7 @@ class AdaptableAgGrid {
301
301
  this.forPlugins((plugin) => plugin.afterInitModules(this, this.adaptableModules));
302
302
  const perfLoadStore = this.logger.beginPerf(`loadStore()`);
303
303
  this.adaptableStore = this.initAdaptableStore();
304
+ this.forPlugins((plugin) => plugin.afterInitStore(this));
304
305
  await this.adaptableStore.loadStore({
305
306
  adaptable: this,
306
307
  adaptableStateKey: this.adaptableOptions.adaptableStateKey,
@@ -327,8 +328,7 @@ class AdaptableAgGrid {
327
328
  return Promise.reject('Adaptable was destroyed while loading the store.');
328
329
  // FIXME AFL MIG: is this enough?! talk with the team
329
330
  }
330
- this.forPlugins((plugin) => plugin.afterInitServices(this));
331
- this.forPlugins((plugin) => plugin.afterInitModules(this, this.adaptableModules));
331
+ this.forPlugins((plugin) => plugin.afterInitialStateLoaded(this));
332
332
  // do this now so it sets module entitlements
333
333
  this.EntitlementService.setModulesEntitlements();
334
334
  /**
@@ -2929,7 +2929,7 @@ class AdaptableAgGrid {
2929
2929
  else {
2930
2930
  (_b = this.agGridAdapter.getAgGridApi()) === null || _b === void 0 ? void 0 : _b.destroy();
2931
2931
  }
2932
- this.previousAgGridColumnState = '';
2932
+ this.previousAgGridLayoutState = '';
2933
2933
  const gridContainerElement = this.getAgGridContainerElement();
2934
2934
  if (gridContainerElement) {
2935
2935
  gridContainerElement.removeEventListener('keydown', this.agGridListenerKeydown);
@@ -3319,14 +3319,13 @@ class AdaptableAgGrid {
3319
3319
  // as otherwise column order is not preserved properly when
3320
3320
  // going from pivoted to unpivoted layout
3321
3321
  if (shouldUpdatePivoted) {
3322
- this.agGridAdapter.getAgGridApi().setPivotMode(pivoted);
3322
+ this.agGridAdapter.setGridOption('pivotMode', pivoted);
3323
3323
  }
3324
3324
  const perfApplyColumnState = this.logger.beginPerf('applyColumnState (layout.isChanged)');
3325
3325
  this.agGridAdapter.getAgGridApi().applyColumnState({
3326
3326
  state: newColumnsState,
3327
3327
  applyOrder: true,
3328
3328
  });
3329
- this.applyGroupColumnWidth(layout);
3330
3329
  perfApplyColumnState.end();
3331
3330
  this.api.gridApi.setColumnSorts(layout.ColumnSorts);
3332
3331
  this.agGridAdapter.getAgGridApi().setPivotColumns(layout.PivotColumns || []);
@@ -3383,38 +3382,6 @@ class AdaptableAgGrid {
3383
3382
  }
3384
3383
  return null;
3385
3384
  }
3386
- /**
3387
- * Setting layout works by modifing the column state.
3388
- * The column state is based on the current existing columns.
3389
- * At this point the column groups do not exist, and the widths from layout are not applied.
3390
- *
3391
- * After the col sate is applied and the column groups are created we need
3392
- * to apply the state again to update the widths of the group columns.
3393
- */
3394
- applyGroupColumnWidth(layout) {
3395
- if (!layout.RowGroupedColumns || !layout.RowGroupedColumns.length) {
3396
- return;
3397
- }
3398
- const groupColumnWithDifferentWidths = this.agGridAdapter
3399
- .getAgGridApi()
3400
- .getColumnState()
3401
- .reduce((acc, col) => {
3402
- var _a;
3403
- if (this.api.columnApi.isAutoRowGroupColumn(col.colId)) {
3404
- const widthInLayout = (_a = layout.ColumnWidthMap) === null || _a === void 0 ? void 0 : _a[col.colId];
3405
- if (widthInLayout && widthInLayout !== col.width) {
3406
- acc.push(Object.assign(Object.assign({}, col), { width: widthInLayout }));
3407
- }
3408
- }
3409
- return acc;
3410
- }, []);
3411
- if (groupColumnWithDifferentWidths.length === 0) {
3412
- return;
3413
- }
3414
- this.agGridAdapter.getAgGridApi().applyColumnState({
3415
- state: groupColumnWithDifferentWidths,
3416
- });
3417
- }
3418
3385
  onRowDataChanged({ rowNode, oldData, newData, }) {
3419
3386
  if (oldData == null || oldData == undefined) {
3420
3387
  return;
@@ -3711,15 +3678,18 @@ class AdaptableAgGrid {
3711
3678
  var _a, _b;
3712
3679
  const agGridApi = this.agGridAdapter.getAgGridApi();
3713
3680
  const columnState = agGridApi.getColumnState();
3681
+ const expandedState = agGridApi.getState().rowGroupExpansion || { expandedRowGroupIds: [] };
3682
+ const currentLayoutState = { columnState, expandedState };
3714
3683
  try {
3715
- const stringifiedState = JSON.stringify(columnState);
3716
- if (stringifiedState === this.previousAgGridColumnState) {
3684
+ // TODO
3685
+ const stringifiedLayoutState = JSON.stringify(currentLayoutState);
3686
+ if (stringifiedLayoutState === this.previousAgGridLayoutState) {
3717
3687
  // same grid column state as a previous,
3718
3688
  // so no need to update, as the layout has already been updated
3719
3689
  // for this grid column state
3720
3690
  return;
3721
3691
  }
3722
- this.previousAgGridColumnState = stringifiedState;
3692
+ this.previousAgGridLayoutState = stringifiedLayoutState;
3723
3693
  }
3724
3694
  catch (ex) {
3725
3695
  this.logger.consoleError('Error stringifying column state', ex);
package/src/env.js CHANGED
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
5
- PUBLISH_TIMESTAMP: 1712232556015 || Date.now(),
6
- VERSION: "18.0.0-canary.22" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1712325848500 || Date.now(),
6
+ VERSION: "18.0.0-canary.24" || '--current-version--',
7
7
  };
@@ -1358,16 +1358,6 @@ export declare const ADAPTABLE_METAMODEL: {
1358
1358
  kind: string;
1359
1359
  desc: string;
1360
1360
  };
1361
- BalancedGroupsKeyContext: {
1362
- name: string;
1363
- kind: string;
1364
- desc: string;
1365
- props: {
1366
- name: string;
1367
- kind: string;
1368
- desc: string;
1369
- }[];
1370
- };
1371
1361
  BaseContext: {
1372
1362
  name: string;
1373
1363
  kind: string;