@adaptabletools/adaptable-cjs 20.2.0 → 20.2.2

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 (66) 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/QuickSearchOptions.d.ts +1 -1
  7. package/src/AdaptableOptions/StateOptions.d.ts +60 -15
  8. package/src/AdaptableState/Common/AdaptableColumn.d.ts +4 -0
  9. package/src/AdaptableState/FormatColumnState.d.ts +11 -6
  10. package/src/AdaptableState/LayoutState.d.ts +16 -2
  11. package/src/AdaptableState/QuickSearchState.d.ts +5 -5
  12. package/src/Api/Implementation/ColumnApiImpl.js +4 -2
  13. package/src/Api/Implementation/LayoutHelpers.d.ts +3 -0
  14. package/src/Api/Implementation/LayoutHelpers.js +80 -41
  15. package/src/Api/Implementation/QuickSearchApiImpl.d.ts +2 -2
  16. package/src/Api/Implementation/QuickSearchApiImpl.js +4 -4
  17. package/src/Api/Implementation/StateApiImpl.d.ts +1 -0
  18. package/src/Api/Implementation/StateApiImpl.js +6 -5
  19. package/src/Api/Internal/ColumnInternalApi.d.ts +1 -0
  20. package/src/Api/Internal/ColumnInternalApi.js +5 -0
  21. package/src/Api/Internal/FormatColumnInternalApi.d.ts +1 -1
  22. package/src/Api/Internal/FormatColumnInternalApi.js +8 -8
  23. package/src/Api/QuickSearchApi.d.ts +2 -2
  24. package/src/Api/StateApi.d.ts +9 -0
  25. package/src/Redux/ActionsReducers/QuickSearchRedux.d.ts +4 -4
  26. package/src/Redux/ActionsReducers/QuickSearchRedux.js +9 -9
  27. package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +14 -18
  28. package/src/Redux/Store/AdaptableStore.d.ts +2 -0
  29. package/src/Redux/Store/AdaptableStore.js +13 -5
  30. package/src/Redux/Store/Interface/IAdaptableStore.d.ts +1 -0
  31. package/src/Redux/Store/Interface/IStorageEngine.d.ts +4 -4
  32. package/src/Redux/Store/buildAdaptableStateFunctionConfig.d.ts +3 -0
  33. package/src/Redux/Store/buildAdaptableStateFunctionConfig.js +13 -0
  34. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +1 -1
  35. package/src/Utilities/Helpers/StyleHelper.d.ts +1 -1
  36. package/src/Utilities/Helpers/StyleHelper.js +11 -0
  37. package/src/Utilities/Services/LicenseService/index.js +1 -1
  38. package/src/Utilities/license/decode.js +1 -1
  39. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -3
  40. package/src/View/Components/EntityRulesEditor/index.js +3 -3
  41. package/src/View/Components/ExpressionWizard.js +1 -1
  42. package/src/View/Components/StyleComponent.d.ts +1 -0
  43. package/src/View/Components/StyleComponent.js +2 -1
  44. package/src/View/Export/Wizard/ReportRowsWizardSection.js +1 -1
  45. package/src/View/GridFilter/GridFilterExpressionEditor.js +1 -1
  46. package/src/View/Layout/Wizard/sections/ColumnsSection.js +27 -8
  47. package/src/View/Layout/Wizard/sections/GridFilterSection.js +1 -1
  48. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +4 -4
  49. package/src/View/License/LicenseWatermark.js +1 -1
  50. package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -1
  51. package/src/View/QuickSearch/QuickSearchInput.js +3 -2
  52. package/src/View/QuickSearch/QuickSearchPopup.d.ts +1 -1
  53. package/src/View/QuickSearch/QuickSearchPopup.js +7 -4
  54. package/src/agGrid/AdaptableAgGrid.js +21 -10
  55. package/src/agGrid/AgGridAdapter.js +6 -1
  56. package/src/agGrid/AgGridColumnAdapter.d.ts +1 -0
  57. package/src/agGrid/AgGridColumnAdapter.js +39 -17
  58. package/src/agGrid/AgGridExportAdapter.js +22 -10
  59. package/src/env.js +2 -2
  60. package/src/layout-manager/src/LayoutManagerModel.d.ts +17 -4
  61. package/src/layout-manager/src/index.d.ts +1 -1
  62. package/src/layout-manager/src/index.js +61 -18
  63. package/src/metamodel/adaptable.metamodel.d.ts +43 -16
  64. package/src/metamodel/adaptable.metamodel.js +1 -1
  65. package/src/types.d.ts +2 -2
  66. package/tsconfig.cjs.tsbuildinfo +1 -1
@@ -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' &&
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: 1749810340250 || Date.now(),
6
- VERSION: "20.2.0" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1750863018496 || Date.now(),
6
+ VERSION: "20.2.2" || '--current-version--',
7
7
  };
@@ -1,3 +1,4 @@
1
+ import { XOR } from '../../Utilities/Extensions/TypeExtensions';
1
2
  /**
2
3
  * Defines how a Column is sorted
3
4
  */
@@ -64,15 +65,27 @@ export interface BaseLayoutModel {
64
65
  */
65
66
  RowGroupValues?: {
66
67
  RowGroupDisplay: 'always-expanded';
67
- } | {
68
+ } | ({
68
69
  RowGroupDisplay: 'expanded';
70
+ } & XOR<{
69
71
  Values: any[][];
70
- } | {
72
+ }, {
73
+ GroupKeys: {
74
+ RowGroupedColumns: string[];
75
+ Values?: any[][];
76
+ }[];
77
+ }>) | {
71
78
  RowGroupDisplay: 'always-collapsed';
72
- } | {
79
+ } | ({
73
80
  RowGroupDisplay: 'collapsed';
81
+ } & XOR<{
74
82
  Values: any[][];
75
- };
83
+ }, {
84
+ GroupKeys: {
85
+ RowGroupedColumns: string[];
86
+ Values?: any[][];
87
+ }[];
88
+ }>);
76
89
  /**
77
90
  * Behaviour for Expanding / Collapsing Column Groups
78
91
  */
@@ -62,7 +62,7 @@ export declare class LayoutManager<DATA_TYPE = any> extends LMEmitter {
62
62
  private applyLayout;
63
63
  private applyTableLayout;
64
64
  private getRowGroupNodePathsAs;
65
- applyRowGroupValues(RowGroupValues: TableLayoutModel['RowGroupValues']): void;
65
+ applyRowGroupValues(RowGroupValues: TableLayoutModel['RowGroupValues'], rowGroupedColumns: string[]): void;
66
66
  private computeColumnStateForPivotLayout;
67
67
  private computePivotAggregations;
68
68
  private computeColumnStateForTableLayout;
@@ -235,7 +235,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
235
235
  // but we want to suspend the listener
236
236
  // as it would re-trigger another change
237
237
  const unsupress = this.suspendAgGridListener();
238
- this.applyRowGroupValues(layout.RowGroupValues);
238
+ this.applyRowGroupValues(layout.RowGroupValues, layout.RowGroupedColumns);
239
239
  unsupress();
240
240
  }
241
241
  if ((!prevLayout?.RowGroupedColumns || !prevLayout?.RowGroupedColumns.length) &&
@@ -247,7 +247,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
247
247
  // but we want to suspend the listener
248
248
  // as it would re-trigger another change
249
249
  const unsupress = this.suspendAgGridListener();
250
- this.applyRowGroupValues(layout.RowGroupValues);
250
+ this.applyRowGroupValues(layout.RowGroupValues, layout.RowGroupedColumns);
251
251
  unsupress();
252
252
  }
253
253
  if (!shouldSkipTriggerChange) {
@@ -334,9 +334,8 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
334
334
  return this.gridApi.getGridOption('treeData');
335
335
  }
336
336
  getUndecidedLayoutModelFromGrid(columnState) {
337
- let TableColumns = columnState
338
- .map((c) => c.colId)
339
- .filter((colId) => colId !== 'ag-Grid-SelectionColumn');
337
+ let TableColumns = columnState.map((c) => c.colId);
338
+ // .filter((colId) => colId !== 'ag-Grid-SelectionColumn');
340
339
  let ColumnWidths = {};
341
340
  let ColumnSorts = [];
342
341
  let RowGroupedColumns = [];
@@ -499,10 +498,26 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
499
498
  : this.getRowGroupNodePathsAs({
500
499
  expanded: true,
501
500
  });
502
- RowGroupValues = {
503
- RowGroupDisplay: 'collapsed',
504
- Values: ExpandedValues,
505
- };
501
+ if (Array.isArray(currentRowGroupValues.GroupKeys)) {
502
+ RowGroupValues = {
503
+ RowGroupDisplay: 'collapsed',
504
+ GroupKeys: currentRowGroupValues.GroupKeys.map((item) => {
505
+ if ((item.RowGroupedColumns || []).join(',') === (RowGroupedColumns || []).join(',')) {
506
+ return {
507
+ RowGroupedColumns: item.RowGroupedColumns,
508
+ Values: ExpandedValues,
509
+ };
510
+ }
511
+ return item;
512
+ }),
513
+ };
514
+ }
515
+ else {
516
+ RowGroupValues = {
517
+ RowGroupDisplay: 'collapsed',
518
+ Values: ExpandedValues,
519
+ };
520
+ }
506
521
  }
507
522
  else if (currentRowGroupValues.RowGroupDisplay === 'expanded') {
508
523
  const CollapsedValues = isGroupingNew
@@ -510,10 +525,26 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
510
525
  : this.getRowGroupNodePathsAs({
511
526
  expanded: false,
512
527
  });
513
- RowGroupValues = {
514
- RowGroupDisplay: 'expanded',
515
- Values: CollapsedValues,
516
- };
528
+ if (Array.isArray(currentRowGroupValues.GroupKeys)) {
529
+ RowGroupValues = {
530
+ RowGroupDisplay: 'expanded',
531
+ GroupKeys: currentRowGroupValues.GroupKeys.map((item) => {
532
+ if ((item.RowGroupedColumns || []).join(',') === (RowGroupedColumns || []).join(',')) {
533
+ return {
534
+ RowGroupedColumns: item.RowGroupedColumns,
535
+ Values: CollapsedValues,
536
+ };
537
+ }
538
+ return item;
539
+ }),
540
+ };
541
+ }
542
+ else {
543
+ RowGroupValues = {
544
+ RowGroupDisplay: 'expanded',
545
+ Values: CollapsedValues,
546
+ };
547
+ }
517
548
  }
518
549
  }
519
550
  }
@@ -900,7 +931,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
900
931
  this.gridApi.applyColumnState(this.computeColumnStateForTableLayout(layout));
901
932
  // but also let's not forget to apply the row group values
902
933
  if (hasGroupedColumns && layout.RowGroupValues && !options?.skipApplyRowGroupsExpandedState) {
903
- this.applyRowGroupValues(layout.RowGroupValues);
934
+ this.applyRowGroupValues(layout.RowGroupValues, layout.RowGroupedColumns);
904
935
  }
905
936
  this.applyColumnGroupCollapseExpandState(layout);
906
937
  });
@@ -924,7 +955,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
924
955
  });
925
956
  return result;
926
957
  }
927
- applyRowGroupValues(RowGroupValues) {
958
+ applyRowGroupValues(RowGroupValues, rowGroupedColumns) {
928
959
  if (!RowGroupValues) {
929
960
  return;
930
961
  }
@@ -937,9 +968,21 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
937
968
  return;
938
969
  }
939
970
  const defaultExpanded = RowGroupValues.RowGroupDisplay === 'expanded';
940
- if (RowGroupValues.Values) {
971
+ let currentRowGroupedValues = RowGroupValues.Values;
972
+ if (RowGroupValues.GroupKeys) {
973
+ const matchingRowGroupColumnValues = RowGroupValues.GroupKeys.find((item) => {
974
+ return (item.RowGroupedColumns || []).join(',') === (rowGroupedColumns || []).join(',');
975
+ });
976
+ if (matchingRowGroupColumnValues) {
977
+ currentRowGroupedValues = matchingRowGroupColumnValues.Values;
978
+ }
979
+ else {
980
+ currentRowGroupedValues = [];
981
+ }
982
+ }
983
+ if (currentRowGroupedValues) {
941
984
  const deepMap = new infinite_react_1.DeepMap();
942
- RowGroupValues.Values.forEach((rowGroupValue) => {
985
+ currentRowGroupedValues.forEach((rowGroupValue) => {
943
986
  deepMap.set(rowGroupValue, true);
944
987
  });
945
988
  this.gridApi.forEachNode((node) => {
@@ -1231,7 +1274,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
1231
1274
  const hasGroupedColumns = layout.PivotGroupedColumns && layout.PivotGroupedColumns.length;
1232
1275
  // but also let's not forget to apply the row group values
1233
1276
  if (hasGroupedColumns && layout.RowGroupValues && !options?.skipApplyRowGroupsExpandedState) {
1234
- this.applyRowGroupValues(layout.RowGroupValues);
1277
+ this.applyRowGroupValues(layout.RowGroupValues, layout.PivotGroupedColumns);
1235
1278
  }
1236
1279
  }
1237
1280
  applyPivotTotals(layout) {
@@ -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,21 @@ 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
+ };
2008
+ ColumnGroupValues: {
2009
+ name: string;
2010
+ kind: string;
2011
+ desc: string;
2012
+ };
2013
+ ColumnGroupValuesWithExceptionKeys: {
2014
+ name: string;
2015
+ kind: string;
2016
+ desc: string;
2017
+ };
1978
2018
  ColumnMenuContext: {
1979
2019
  name: string;
1980
2020
  kind: string;
@@ -3563,12 +3603,6 @@ export declare const ADAPTABLE_METAMODEL: {
3563
3603
  kind: string;
3564
3604
  desc: string;
3565
3605
  props: ({
3566
- name: string;
3567
- kind: string;
3568
- desc: string;
3569
- isOpt: boolean;
3570
- ref?: undefined;
3571
- } | {
3572
3606
  name: string;
3573
3607
  kind: string;
3574
3608
  desc: string;
@@ -5321,8 +5355,8 @@ export declare const ADAPTABLE_METAMODEL: {
5321
5355
  kind: string;
5322
5356
  desc: string;
5323
5357
  isOpt: boolean;
5358
+ ref: string;
5324
5359
  defVal?: undefined;
5325
- ref?: undefined;
5326
5360
  } | {
5327
5361
  name: string;
5328
5362
  kind: string;
@@ -5337,13 +5371,6 @@ export declare const ADAPTABLE_METAMODEL: {
5337
5371
  isOpt: boolean;
5338
5372
  defVal: string;
5339
5373
  ref: string;
5340
- } | {
5341
- name: string;
5342
- kind: string;
5343
- desc: string;
5344
- isOpt: boolean;
5345
- ref: string;
5346
- defVal?: undefined;
5347
5374
  })[];
5348
5375
  };
5349
5376
  StatusBarState: {