@adaptabletools/adaptable 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 +9 -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.esm.tsbuildinfo +1 -1
@@ -1322,12 +1322,12 @@ You need to define at least one Layout!`);
1322
1322
  this.autoSizeLayoutIfNeeded();
1323
1323
  }));
1324
1324
  /**
1325
- * Use Case: A format column that has ColumnGroupState needs to be re-evaluated
1325
+ * Use Case: A format column that has ColumnGroupScope needs to be re-evaluated
1326
1326
  * whenever a column group is expanded or collapsed
1327
1327
  */
1328
1328
  this.agGridAdapter.getAgGridApi().addEventListener('columnGroupOpened', (this.listenerColumnGroupOpened = () => {
1329
1329
  if (this.api.formatColumnApi.getActiveFormatColumns().some((fc) => {
1330
- return fc.ColumnGroupState != null;
1330
+ return fc.ColumnGroupScope != null;
1331
1331
  })) {
1332
1332
  this.updateColumnModelAndRefreshGrid();
1333
1333
  }
@@ -1402,11 +1402,25 @@ You need to define at least one Layout!`);
1402
1402
  ];
1403
1403
  const chartingModule = this.ModuleService.getModuleById('Charting');
1404
1404
  if (chartingModule.isModuleAvailable()) {
1405
- this.agGridAdapter.getAgGridApi().addGlobalListener((type, params) => {
1406
- if (ArrayExtensions.ContainsItem(eventsThatTriggerChartingChanges, type)) {
1405
+ // We need to break the loop of charting changes for 'chartOptionsChanged', which is triggered by the subsequent agGridApi.updateChart(...)
1406
+ // see #ag_grid_update_chart_loop
1407
+ let lastChartOptionsChangePayload = '';
1408
+ this.listenerGlobalChartingChanges = (type, params) => {
1409
+ if (eventsThatTriggerChartingChanges.includes(type)) {
1410
+ if (type === 'chartOptionsChanged') {
1411
+ // Exclude api and context
1412
+ const { api, context, ...sanitizedParams } = params || {};
1413
+ const eventPayload = JSON.stringify(sanitizedParams);
1414
+ if (eventPayload === lastChartOptionsChangePayload) {
1415
+ // this is a loop, so we ignore it
1416
+ return;
1417
+ }
1418
+ lastChartOptionsChangePayload = eventPayload;
1419
+ }
1407
1420
  this.ChartingService.onChartModelChange(this.getChartModels(), type, params);
1408
1421
  }
1409
- });
1422
+ };
1423
+ this.agGridAdapter.getAgGridApi().addGlobalListener(this.listenerGlobalChartingChanges);
1410
1424
  }
1411
1425
  /**
1412
1426
  * Row and Cell listeners created in 2020
@@ -2705,6 +2719,10 @@ You need to define at least one Layout!`);
2705
2719
  return chartRef;
2706
2720
  }
2707
2721
  updateChart(chart) {
2722
+ if (!chart.Model) {
2723
+ this.logger.consoleError(`Chart definition must have a Model property to be updated: ${chart.Name}`);
2724
+ return;
2725
+ }
2708
2726
  const upgradableProperties = {
2709
2727
  // Only Range charts are supported to be created at run time
2710
2728
  // the other two are pivot & cross-filter
@@ -2714,6 +2732,7 @@ You need to define at least one Layout!`);
2714
2732
  suppressChartRanges: Boolean(chart.Model.suppressChartRanges),
2715
2733
  aggFunc: chart.Model.aggFunc,
2716
2734
  };
2735
+ // see also #ag_grid_update_chart_loop
2717
2736
  this.agGridAdapter.getAgGridApi().updateChart(upgradableProperties);
2718
2737
  }
2719
2738
  getChartModels() {
@@ -2930,6 +2949,9 @@ You need to define at least one Layout!`);
2930
2949
  agGridApi.removeEventListener('columnGroupOpened', this.listenerColumnGroupOpened);
2931
2950
  agGridApi.removeEventListener('sortChanged', this.listenerSortChanged);
2932
2951
  agGridApi.removeGlobalListener(this.listenerGlobalSetRowSelection);
2952
+ if (this.listenerGlobalChartingChanges) {
2953
+ this.agGridAdapter.getAgGridApi().removeGlobalListener(this.listenerGlobalChartingChanges);
2954
+ }
2933
2955
  this.listenerFirstDataRendered = null;
2934
2956
  this.listenerPivotChanged = null;
2935
2957
  this.listenerColumnGroupOpened = null;
@@ -3007,7 +3029,9 @@ You need to define at least one Layout!`);
3007
3029
  }
3008
3030
  this.DANGER_USE_GETTER_adaptableContainerElement = null;
3009
3031
  this.DANGER_USE_GETTER_agGridContainerElement = null;
3032
+ this.debouncedSetSelectedCells?.cancel?.();
3010
3033
  this.debouncedSetSelectedCells = null;
3034
+ this.debouncedSetSelectedRows?.cancel?.();
3011
3035
  this.debouncedSetSelectedRows = null;
3012
3036
  this.adaptableStore?.destroy();
3013
3037
  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;
@@ -1,3 +1,4 @@
1
+ import kebabCase from 'lodash/kebabCase';
1
2
  import merge from 'lodash/merge';
2
3
  import { FilterWrapperFactory } from './FilterWrapper';
3
4
  import { FloatingFilterWrapperFactory } from './FloatingFilterWrapper';
@@ -210,15 +211,17 @@ export class AgGridColumnAdapter {
210
211
  const quickSearchCurrentTextMatchStyle = this.getQuickSearchCurrentTextMatchStyle();
211
212
  const textMatchStyle = quickSearchTextMatchStyle
212
213
  ? Object.entries(quickSearchTextMatchStyle).reduce((acc, [key, value]) => {
214
+ // needed as AG-Grid vanilla turns all CSS props
215
+ // to kebab, while AG Grid React does not
213
216
  // @ts-ignore
214
- acc[`--ab-dynamic-${key}`] = value;
217
+ acc[`--ab-dynamic-${kebabCase(key)}`] = value;
215
218
  return acc;
216
219
  }, {})
217
220
  : undefined;
218
221
  const currentTextMatchStyle = quickSearchCurrentTextMatchStyle
219
222
  ? Object.entries(quickSearchCurrentTextMatchStyle).reduce((acc, [key, value]) => {
220
223
  // @ts-ignore
221
- acc[`--ab-dynamic-${key}`] = value;
224
+ acc[`--ab-dynamic-${kebabCase(key)}`] = value;
222
225
  return acc;
223
226
  }, {})
224
227
  : undefined;
@@ -685,18 +688,25 @@ export class AgGridColumnAdapter {
685
688
  }
686
689
  const getCellSearchText = this.adaptableOptions.quickSearchOptions.getCellSearchText;
687
690
  if (getCellSearchText) {
688
- const quickSearchValue = this.adaptableApi.quickSearchApi.getQuickSearchValue();
689
- const quickSearchContext = {
690
- ...this.adaptableApi.internalApi.buildBaseContext(),
691
- gridCell,
692
- quickSearchValue,
693
- };
694
- return getCellSearchText(quickSearchContext);
691
+ return this.getCellSearchText(gridCell);
695
692
  }
696
693
  return userGetFindText?.(params) ?? gridCell.displayValue;
697
694
  };
698
695
  });
699
696
  }
697
+ getCellSearchText(gridCell) {
698
+ const getCellSearchText = this.adaptableOptions.quickSearchOptions.getCellSearchText;
699
+ if (getCellSearchText) {
700
+ const quickSearchValue = this.adaptableApi.quickSearchApi.getQuickSearchValue();
701
+ const quickSearchContext = {
702
+ ...this.adaptableApi.internalApi.buildBaseContext(),
703
+ gridCell,
704
+ quickSearchValue,
705
+ };
706
+ return getCellSearchText(quickSearchContext);
707
+ }
708
+ return gridCell.displayValue;
709
+ }
700
710
  isCellSearchable(gridCell) {
701
711
  const isCellSearchableFn = this.adaptableOptions.quickSearchOptions.isCellSearchable;
702
712
  if (!gridCell.column) {
@@ -732,6 +742,16 @@ export class AgGridColumnAdapter {
732
742
  if (!column) {
733
743
  return false;
734
744
  }
745
+ const isServerSideRowModel = this.adaptableApi.gridApi.getAgGridRowModelType() === 'serverSide';
746
+ if (isServerSideRowModel) {
747
+ const isCaseSensitive = this.adaptableOptions.quickSearchOptions.isQuickSearchCaseSensitive;
748
+ const cellDisplayValue = String(this.getCellSearchText(gridCell));
749
+ const displayValue = isCaseSensitive
750
+ ? cellDisplayValue
751
+ : cellDisplayValue.toLocaleLowerCase();
752
+ const searchText = isCaseSensitive ? quickSearchValue : quickSearchValue.toLocaleLowerCase();
753
+ return displayValue.indexOf(searchText) !== -1;
754
+ }
735
755
  return (this.agGridApi.findGetNumMatches({
736
756
  column,
737
757
  node: gridCell.rowNode,
@@ -180,19 +180,19 @@ export class AgGridExportAdapter {
180
180
  // recreating the standard AG Grid styling for row groups: 'Parent -> Child'
181
181
  // additionally the values are formatted
182
182
  let rowGroupNode = params.node;
183
- const isFooterRow = rowGroupNode.footer;
183
+ const agColumn = params.column;
184
184
  const rowGroupSummary = [
185
- this.processRowGroupForExcelExport(rowGroupNode, exportContext) ?? '',
185
+ this.processRowGroupForExcelExport(rowGroupNode, exportContext, agColumn) ?? '',
186
186
  ];
187
187
  while (rowGroupNode.parent) {
188
188
  rowGroupNode = rowGroupNode.parent;
189
- const formattedParentNode = this.processRowGroupForExcelExport(rowGroupNode, exportContext);
189
+ const formattedParentNode = this.processRowGroupForExcelExport(rowGroupNode, exportContext, agColumn);
190
190
  if (formattedParentNode) {
191
191
  rowGroupSummary.push(formattedParentNode);
192
192
  }
193
193
  }
194
194
  let summary = rowGroupSummary.reverse().join(' -> ');
195
- if (isFooterRow) {
195
+ if (agColumn?.getColId() === AG_GRID_GROUPED_COLUMN && rowGroupNode.footer) {
196
196
  summary = `Total: ${summary}`;
197
197
  }
198
198
  return summary;
@@ -407,17 +407,29 @@ export class AgGridExportAdapter {
407
407
  }
408
408
  return this.getCellExportValueFromRawValue(rowNode, this.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, columnId), columnId, exportContext);
409
409
  }
410
- processRowGroupForExcelExport(rowNode, exportContext) {
410
+ processRowGroupForExcelExport(rowNode, exportContext, agColumn) {
411
411
  if (this.isTreeDataGrid()) {
412
412
  return rowNode.key;
413
413
  }
414
- const columnId = rowNode.field ??
415
- rowNode.rowGroupColumn?.getColId() ??
416
- rowNode.rowGroupColumn?.getColDef()?.field;
417
- if (!columnId || !rowNode.key) {
414
+ const getColIdAndRawValue = () => {
415
+ if (this.adaptableApi.columnApi.isAutoRowGroupColumn(agColumn?.getColId())) {
416
+ const columnId = rowNode.field ??
417
+ rowNode.rowGroupColumn?.getColId() ??
418
+ rowNode.rowGroupColumn?.getColDef()?.field;
419
+ let rawValue = rowNode.key;
420
+ return { columnId, rawValue };
421
+ }
422
+ if (this.adaptableApi.columnApi.isPivotResultColumn(agColumn.getColId())) {
423
+ const columnId = agColumn.getColId();
424
+ const rawValue = rowNode.aggData?.[columnId];
425
+ return { columnId, rawValue };
426
+ }
427
+ return {};
428
+ };
429
+ let { columnId, rawValue } = getColIdAndRawValue();
430
+ if (!columnId || rawValue == null) {
418
431
  return;
419
432
  }
420
- let rawValue = rowNode.key;
421
433
  const columnDataType = this.adaptableApi.columnApi.getColumnDataTypeForColumnId(columnId);
422
434
  if ((columnDataType === 'date' || columnDataType === 'dateString') &&
423
435
  typeof rawValue === 'string' &&
@@ -2,7 +2,8 @@ import * as React from 'react';
2
2
  import { createUuid } from '../utils/uuid';
3
3
  const setZIndexMap = {};
4
4
  const zIndexMap = [];
5
- const BASE_Z_INDEX = 1000;
5
+ // starts with 3000, to be above the default zIndex of the Modal component
6
+ const BASE_Z_INDEX = 3000;
6
7
  /**
7
8
  * Used to facilitate the stacking between multiple opened windows.
8
9
  * When calling 'bringToFront' brings caller to top.
package/src/env.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export default {
2
2
  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" || '',
3
- PUBLISH_TIMESTAMP: 1749490679822 || Date.now(),
4
- VERSION: "20.2.0-canary.1" || '--current-version--',
3
+ PUBLISH_TIMESTAMP: 1750416425464 || Date.now(),
4
+ VERSION: "20.2.1" || '--current-version--',
5
5
  };
@@ -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: {