@adaptabletools/adaptable-cjs 20.2.0-canary.1 → 20.2.1

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 (57) hide show
  1. package/base.css +7 -7
  2. package/base.css.map +1 -1
  3. package/index.css +7 -7
  4. package/index.css.map +1 -1
  5. package/package.json +1 -1
  6. package/src/AdaptableOptions/ExportOptions.d.ts +3 -3
  7. package/src/AdaptableOptions/QuickSearchOptions.d.ts +1 -1
  8. package/src/AdaptableOptions/StateOptions.d.ts +60 -15
  9. package/src/AdaptableState/FormatColumnState.d.ts +11 -6
  10. package/src/AdaptableState/LayoutState.d.ts +29 -8
  11. package/src/AdaptableState/QuickSearchState.d.ts +3 -3
  12. package/src/Api/Implementation/ColumnApiImpl.js +3 -2
  13. package/src/Api/Implementation/SettingsPanelApiImpl.d.ts +1 -0
  14. package/src/Api/Implementation/SettingsPanelApiImpl.js +8 -3
  15. package/src/Api/Implementation/StateApiImpl.d.ts +1 -0
  16. package/src/Api/Implementation/StateApiImpl.js +6 -5
  17. package/src/Api/Internal/ColumnInternalApi.d.ts +1 -0
  18. package/src/Api/Internal/ColumnInternalApi.js +5 -0
  19. package/src/Api/Internal/FormatColumnInternalApi.js +5 -5
  20. package/src/Api/SettingsPanelApi.d.ts +4 -0
  21. package/src/Api/StateApi.d.ts +9 -0
  22. package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +14 -18
  23. package/src/Redux/Store/AdaptableStore.d.ts +2 -0
  24. package/src/Redux/Store/AdaptableStore.js +12 -4
  25. package/src/Redux/Store/Interface/IAdaptableStore.d.ts +1 -0
  26. package/src/Redux/Store/Interface/IStorageEngine.d.ts +4 -4
  27. package/src/Redux/Store/buildAdaptableStateFunctionConfig.d.ts +3 -0
  28. package/src/Redux/Store/buildAdaptableStateFunctionConfig.js +13 -0
  29. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +1 -1
  30. package/src/Utilities/Helpers/StyleHelper.d.ts +1 -1
  31. package/src/Utilities/Helpers/StyleHelper.js +11 -0
  32. package/src/Utilities/Services/ChartingService.js +4 -4
  33. package/src/Utilities/Services/LicenseService/index.js +1 -1
  34. package/src/Utilities/license/decode.js +1 -1
  35. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -3
  36. package/src/View/Charting/useAgChartState.js +1 -1
  37. package/src/View/Components/EntityRulesEditor/index.js +3 -3
  38. package/src/View/Components/ExpressionWizard.js +1 -1
  39. package/src/View/Components/SharedProps/ModuleViewPopupProps.d.ts +1 -1
  40. package/src/View/Export/Wizard/ReportRowsWizardSection.js +1 -1
  41. package/src/View/GridFilter/GridFilterExpressionEditor.js +1 -1
  42. package/src/View/Layout/Wizard/sections/GridFilterSection.js +1 -1
  43. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +2 -2
  44. package/src/View/License/LicenseWatermark.js +1 -1
  45. package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -1
  46. package/src/View/QuickSearch/QuickSearchInput.js +3 -2
  47. package/src/agGrid/AdaptableAgGrid.d.ts +1 -0
  48. package/src/agGrid/AdaptableAgGrid.js +29 -5
  49. package/src/agGrid/AgGridColumnAdapter.d.ts +1 -0
  50. package/src/agGrid/AgGridColumnAdapter.js +29 -9
  51. package/src/agGrid/AgGridExportAdapter.js +22 -10
  52. package/src/components/WindowModal/useStacking.js +2 -1
  53. package/src/env.js +2 -2
  54. package/src/metamodel/adaptable.metamodel.d.ts +33 -16
  55. package/src/metamodel/adaptable.metamodel.js +1 -1
  56. package/src/types.d.ts +1 -1
  57. package/tsconfig.cjs.tsbuildinfo +1 -1
@@ -1326,12 +1326,12 @@ You need to define at least one Layout!`);
1326
1326
  this.autoSizeLayoutIfNeeded();
1327
1327
  }));
1328
1328
  /**
1329
- * Use Case: A format column that has ColumnGroupState needs to be re-evaluated
1329
+ * Use Case: A format column that has ColumnGroupScope needs to be re-evaluated
1330
1330
  * whenever a column group is expanded or collapsed
1331
1331
  */
1332
1332
  this.agGridAdapter.getAgGridApi().addEventListener('columnGroupOpened', (this.listenerColumnGroupOpened = () => {
1333
1333
  if (this.api.formatColumnApi.getActiveFormatColumns().some((fc) => {
1334
- return fc.ColumnGroupState != null;
1334
+ return fc.ColumnGroupScope != null;
1335
1335
  })) {
1336
1336
  this.updateColumnModelAndRefreshGrid();
1337
1337
  }
@@ -1406,11 +1406,25 @@ You need to define at least one Layout!`);
1406
1406
  ];
1407
1407
  const chartingModule = this.ModuleService.getModuleById('Charting');
1408
1408
  if (chartingModule.isModuleAvailable()) {
1409
- this.agGridAdapter.getAgGridApi().addGlobalListener((type, params) => {
1410
- if (ArrayExtensions_1.default.ContainsItem(eventsThatTriggerChartingChanges, type)) {
1409
+ // We need to break the loop of charting changes for 'chartOptionsChanged', which is triggered by the subsequent agGridApi.updateChart(...)
1410
+ // see #ag_grid_update_chart_loop
1411
+ let lastChartOptionsChangePayload = '';
1412
+ this.listenerGlobalChartingChanges = (type, params) => {
1413
+ if (eventsThatTriggerChartingChanges.includes(type)) {
1414
+ if (type === 'chartOptionsChanged') {
1415
+ // Exclude api and context
1416
+ const { api, context, ...sanitizedParams } = params || {};
1417
+ const eventPayload = JSON.stringify(sanitizedParams);
1418
+ if (eventPayload === lastChartOptionsChangePayload) {
1419
+ // this is a loop, so we ignore it
1420
+ return;
1421
+ }
1422
+ lastChartOptionsChangePayload = eventPayload;
1423
+ }
1411
1424
  this.ChartingService.onChartModelChange(this.getChartModels(), type, params);
1412
1425
  }
1413
- });
1426
+ };
1427
+ this.agGridAdapter.getAgGridApi().addGlobalListener(this.listenerGlobalChartingChanges);
1414
1428
  }
1415
1429
  /**
1416
1430
  * Row and Cell listeners created in 2020
@@ -2709,6 +2723,10 @@ You need to define at least one Layout!`);
2709
2723
  return chartRef;
2710
2724
  }
2711
2725
  updateChart(chart) {
2726
+ if (!chart.Model) {
2727
+ this.logger.consoleError(`Chart definition must have a Model property to be updated: ${chart.Name}`);
2728
+ return;
2729
+ }
2712
2730
  const upgradableProperties = {
2713
2731
  // Only Range charts are supported to be created at run time
2714
2732
  // the other two are pivot & cross-filter
@@ -2718,6 +2736,7 @@ You need to define at least one Layout!`);
2718
2736
  suppressChartRanges: Boolean(chart.Model.suppressChartRanges),
2719
2737
  aggFunc: chart.Model.aggFunc,
2720
2738
  };
2739
+ // see also #ag_grid_update_chart_loop
2721
2740
  this.agGridAdapter.getAgGridApi().updateChart(upgradableProperties);
2722
2741
  }
2723
2742
  getChartModels() {
@@ -2934,6 +2953,9 @@ You need to define at least one Layout!`);
2934
2953
  agGridApi.removeEventListener('columnGroupOpened', this.listenerColumnGroupOpened);
2935
2954
  agGridApi.removeEventListener('sortChanged', this.listenerSortChanged);
2936
2955
  agGridApi.removeGlobalListener(this.listenerGlobalSetRowSelection);
2956
+ if (this.listenerGlobalChartingChanges) {
2957
+ this.agGridAdapter.getAgGridApi().removeGlobalListener(this.listenerGlobalChartingChanges);
2958
+ }
2937
2959
  this.listenerFirstDataRendered = null;
2938
2960
  this.listenerPivotChanged = null;
2939
2961
  this.listenerColumnGroupOpened = null;
@@ -3011,7 +3033,9 @@ You need to define at least one Layout!`);
3011
3033
  }
3012
3034
  this.DANGER_USE_GETTER_adaptableContainerElement = null;
3013
3035
  this.DANGER_USE_GETTER_agGridContainerElement = null;
3036
+ this.debouncedSetSelectedCells?.cancel?.();
3014
3037
  this.debouncedSetSelectedCells = null;
3038
+ this.debouncedSetSelectedRows?.cancel?.();
3015
3039
  this.debouncedSetSelectedRows = null;
3016
3040
  this.adaptableStore?.destroy();
3017
3041
  this.adaptableStore = null;
@@ -36,6 +36,7 @@ export declare class AgGridColumnAdapter {
36
36
  private setupColumnValueSetter;
37
37
  private setupColumnComparator;
38
38
  private setupColumnGetFindText;
39
+ private getCellSearchText;
39
40
  private isCellSearchable;
40
41
  private isQuickSearchActive;
41
42
  private getEditableCellClass;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AgGridColumnAdapter = exports.getEditorForColumnDataType = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const kebabCase_1 = tslib_1.__importDefault(require("lodash/kebabCase"));
5
6
  const merge_1 = tslib_1.__importDefault(require("lodash/merge"));
6
7
  const FilterWrapper_1 = require("./FilterWrapper");
7
8
  const FloatingFilterWrapper_1 = require("./FloatingFilterWrapper");
@@ -215,15 +216,17 @@ class AgGridColumnAdapter {
215
216
  const quickSearchCurrentTextMatchStyle = this.getQuickSearchCurrentTextMatchStyle();
216
217
  const textMatchStyle = quickSearchTextMatchStyle
217
218
  ? Object.entries(quickSearchTextMatchStyle).reduce((acc, [key, value]) => {
219
+ // needed as AG-Grid vanilla turns all CSS props
220
+ // to kebab, while AG Grid React does not
218
221
  // @ts-ignore
219
- acc[`--ab-dynamic-${key}`] = value;
222
+ acc[`--ab-dynamic-${(0, kebabCase_1.default)(key)}`] = value;
220
223
  return acc;
221
224
  }, {})
222
225
  : undefined;
223
226
  const currentTextMatchStyle = quickSearchCurrentTextMatchStyle
224
227
  ? Object.entries(quickSearchCurrentTextMatchStyle).reduce((acc, [key, value]) => {
225
228
  // @ts-ignore
226
- acc[`--ab-dynamic-${key}`] = value;
229
+ acc[`--ab-dynamic-${(0, kebabCase_1.default)(key)}`] = value;
227
230
  return acc;
228
231
  }, {})
229
232
  : undefined;
@@ -690,18 +693,25 @@ class AgGridColumnAdapter {
690
693
  }
691
694
  const getCellSearchText = this.adaptableOptions.quickSearchOptions.getCellSearchText;
692
695
  if (getCellSearchText) {
693
- const quickSearchValue = this.adaptableApi.quickSearchApi.getQuickSearchValue();
694
- const quickSearchContext = {
695
- ...this.adaptableApi.internalApi.buildBaseContext(),
696
- gridCell,
697
- quickSearchValue,
698
- };
699
- return getCellSearchText(quickSearchContext);
696
+ return this.getCellSearchText(gridCell);
700
697
  }
701
698
  return userGetFindText?.(params) ?? gridCell.displayValue;
702
699
  };
703
700
  });
704
701
  }
702
+ getCellSearchText(gridCell) {
703
+ const getCellSearchText = this.adaptableOptions.quickSearchOptions.getCellSearchText;
704
+ if (getCellSearchText) {
705
+ const quickSearchValue = this.adaptableApi.quickSearchApi.getQuickSearchValue();
706
+ const quickSearchContext = {
707
+ ...this.adaptableApi.internalApi.buildBaseContext(),
708
+ gridCell,
709
+ quickSearchValue,
710
+ };
711
+ return getCellSearchText(quickSearchContext);
712
+ }
713
+ return gridCell.displayValue;
714
+ }
705
715
  isCellSearchable(gridCell) {
706
716
  const isCellSearchableFn = this.adaptableOptions.quickSearchOptions.isCellSearchable;
707
717
  if (!gridCell.column) {
@@ -737,6 +747,16 @@ class AgGridColumnAdapter {
737
747
  if (!column) {
738
748
  return false;
739
749
  }
750
+ const isServerSideRowModel = this.adaptableApi.gridApi.getAgGridRowModelType() === 'serverSide';
751
+ if (isServerSideRowModel) {
752
+ const isCaseSensitive = this.adaptableOptions.quickSearchOptions.isQuickSearchCaseSensitive;
753
+ const cellDisplayValue = String(this.getCellSearchText(gridCell));
754
+ const displayValue = isCaseSensitive
755
+ ? cellDisplayValue
756
+ : cellDisplayValue.toLocaleLowerCase();
757
+ const searchText = isCaseSensitive ? quickSearchValue : quickSearchValue.toLocaleLowerCase();
758
+ return displayValue.indexOf(searchText) !== -1;
759
+ }
740
760
  return (this.agGridApi.findGetNumMatches({
741
761
  column,
742
762
  node: gridCell.rowNode,
@@ -184,19 +184,19 @@ class AgGridExportAdapter {
184
184
  // recreating the standard AG Grid styling for row groups: 'Parent -> Child'
185
185
  // additionally the values are formatted
186
186
  let rowGroupNode = params.node;
187
- const isFooterRow = rowGroupNode.footer;
187
+ const agColumn = params.column;
188
188
  const rowGroupSummary = [
189
- this.processRowGroupForExcelExport(rowGroupNode, exportContext) ?? '',
189
+ this.processRowGroupForExcelExport(rowGroupNode, exportContext, agColumn) ?? '',
190
190
  ];
191
191
  while (rowGroupNode.parent) {
192
192
  rowGroupNode = rowGroupNode.parent;
193
- const formattedParentNode = this.processRowGroupForExcelExport(rowGroupNode, exportContext);
193
+ const formattedParentNode = this.processRowGroupForExcelExport(rowGroupNode, exportContext, agColumn);
194
194
  if (formattedParentNode) {
195
195
  rowGroupSummary.push(formattedParentNode);
196
196
  }
197
197
  }
198
198
  let summary = rowGroupSummary.reverse().join(' -> ');
199
- if (isFooterRow) {
199
+ if (agColumn?.getColId() === GeneralConstants_1.AG_GRID_GROUPED_COLUMN && rowGroupNode.footer) {
200
200
  summary = `Total: ${summary}`;
201
201
  }
202
202
  return summary;
@@ -411,17 +411,29 @@ class AgGridExportAdapter {
411
411
  }
412
412
  return this.getCellExportValueFromRawValue(rowNode, this.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, columnId), columnId, exportContext);
413
413
  }
414
- processRowGroupForExcelExport(rowNode, exportContext) {
414
+ processRowGroupForExcelExport(rowNode, exportContext, agColumn) {
415
415
  if (this.isTreeDataGrid()) {
416
416
  return rowNode.key;
417
417
  }
418
- const columnId = rowNode.field ??
419
- rowNode.rowGroupColumn?.getColId() ??
420
- rowNode.rowGroupColumn?.getColDef()?.field;
421
- if (!columnId || !rowNode.key) {
418
+ const getColIdAndRawValue = () => {
419
+ if (this.adaptableApi.columnApi.isAutoRowGroupColumn(agColumn?.getColId())) {
420
+ const columnId = rowNode.field ??
421
+ rowNode.rowGroupColumn?.getColId() ??
422
+ rowNode.rowGroupColumn?.getColDef()?.field;
423
+ let rawValue = rowNode.key;
424
+ return { columnId, rawValue };
425
+ }
426
+ if (this.adaptableApi.columnApi.isPivotResultColumn(agColumn.getColId())) {
427
+ const columnId = agColumn.getColId();
428
+ const rawValue = rowNode.aggData?.[columnId];
429
+ return { columnId, rawValue };
430
+ }
431
+ return {};
432
+ };
433
+ let { columnId, rawValue } = getColIdAndRawValue();
434
+ if (!columnId || rawValue == null) {
422
435
  return;
423
436
  }
424
- let rawValue = rowNode.key;
425
437
  const columnDataType = this.adaptableApi.columnApi.getColumnDataTypeForColumnId(columnId);
426
438
  if ((columnDataType === 'date' || columnDataType === 'dateString') &&
427
439
  typeof rawValue === 'string' &&
@@ -6,7 +6,8 @@ const React = tslib_1.__importStar(require("react"));
6
6
  const uuid_1 = require("../utils/uuid");
7
7
  const setZIndexMap = {};
8
8
  const zIndexMap = [];
9
- const BASE_Z_INDEX = 1000;
9
+ // starts with 3000, to be above the default zIndex of the Modal component
10
+ const BASE_Z_INDEX = 3000;
10
11
  /**
11
12
  * Used to facilitate the stacking between multiple opened windows.
12
13
  * When calling 'bringToFront' brings caller to top.
package/src/env.js CHANGED
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  NEXT_PUBLIC_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: 1749490708802 || Date.now(),
6
- VERSION: "20.2.0-canary.1" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1750416454142 || Date.now(),
6
+ VERSION: "20.2.1" || '--current-version--',
7
7
  };
@@ -934,11 +934,31 @@ export declare const ADAPTABLE_METAMODEL: {
934
934
  name: string;
935
935
  kind: string;
936
936
  desc: string;
937
- props: {
937
+ props: ({
938
938
  name: string;
939
939
  kind: string;
940
940
  desc: string;
941
- }[];
941
+ isOpt: boolean;
942
+ ref?: undefined;
943
+ } | {
944
+ name: string;
945
+ kind: string;
946
+ desc: string;
947
+ ref: string;
948
+ isOpt?: undefined;
949
+ } | {
950
+ name: string;
951
+ kind: string;
952
+ desc: string;
953
+ isOpt?: undefined;
954
+ ref?: undefined;
955
+ } | {
956
+ name: string;
957
+ kind: string;
958
+ desc: string;
959
+ isOpt: boolean;
960
+ ref: string;
961
+ })[];
942
962
  };
943
963
  AdaptableStatusBar: {
944
964
  name: string;
@@ -1667,6 +1687,11 @@ export declare const ADAPTABLE_METAMODEL: {
1667
1687
  kind: string;
1668
1688
  desc: string;
1669
1689
  };
1690
+ CellAlignment: {
1691
+ name: string;
1692
+ kind: string;
1693
+ desc: string;
1694
+ };
1670
1695
  CellColorRange: {
1671
1696
  name: string;
1672
1697
  kind: string;
@@ -1975,6 +2000,11 @@ export declare const ADAPTABLE_METAMODEL: {
1975
2000
  ref?: undefined;
1976
2001
  })[];
1977
2002
  };
2003
+ ColumnGroupScope: {
2004
+ name: string;
2005
+ kind: string;
2006
+ desc: string;
2007
+ };
1978
2008
  ColumnMenuContext: {
1979
2009
  name: string;
1980
2010
  kind: string;
@@ -3563,12 +3593,6 @@ export declare const ADAPTABLE_METAMODEL: {
3563
3593
  kind: string;
3564
3594
  desc: string;
3565
3595
  props: ({
3566
- name: string;
3567
- kind: string;
3568
- desc: string;
3569
- isOpt: boolean;
3570
- ref?: undefined;
3571
- } | {
3572
3596
  name: string;
3573
3597
  kind: string;
3574
3598
  desc: string;
@@ -5321,8 +5345,8 @@ export declare const ADAPTABLE_METAMODEL: {
5321
5345
  kind: string;
5322
5346
  desc: string;
5323
5347
  isOpt: boolean;
5348
+ ref: string;
5324
5349
  defVal?: undefined;
5325
- ref?: undefined;
5326
5350
  } | {
5327
5351
  name: string;
5328
5352
  kind: string;
@@ -5337,13 +5361,6 @@ export declare const ADAPTABLE_METAMODEL: {
5337
5361
  isOpt: boolean;
5338
5362
  defVal: string;
5339
5363
  ref: string;
5340
- } | {
5341
- name: string;
5342
- kind: string;
5343
- desc: string;
5344
- isOpt: boolean;
5345
- ref: string;
5346
- defVal?: undefined;
5347
5364
  })[];
5348
5365
  };
5349
5366
  StatusBarState: {