@adaptabletools/adaptable 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 +76 -40
  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 +7 -7
  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 +9 -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 +22 -11
  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.esm.tsbuildinfo +1 -1
@@ -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' &&
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: 1749810312509 || Date.now(),
4
- VERSION: "20.2.0" || '--current-version--',
3
+ PUBLISH_TIMESTAMP: 1750862989331 || Date.now(),
4
+ VERSION: "20.2.2" || '--current-version--',
5
5
  };
@@ -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;
@@ -232,7 +232,7 @@ export class LayoutManager extends LMEmitter {
232
232
  // but we want to suspend the listener
233
233
  // as it would re-trigger another change
234
234
  const unsupress = this.suspendAgGridListener();
235
- this.applyRowGroupValues(layout.RowGroupValues);
235
+ this.applyRowGroupValues(layout.RowGroupValues, layout.RowGroupedColumns);
236
236
  unsupress();
237
237
  }
238
238
  if ((!prevLayout?.RowGroupedColumns || !prevLayout?.RowGroupedColumns.length) &&
@@ -244,7 +244,7 @@ export class LayoutManager extends LMEmitter {
244
244
  // but we want to suspend the listener
245
245
  // as it would re-trigger another change
246
246
  const unsupress = this.suspendAgGridListener();
247
- this.applyRowGroupValues(layout.RowGroupValues);
247
+ this.applyRowGroupValues(layout.RowGroupValues, layout.RowGroupedColumns);
248
248
  unsupress();
249
249
  }
250
250
  if (!shouldSkipTriggerChange) {
@@ -331,9 +331,8 @@ export class LayoutManager extends LMEmitter {
331
331
  return this.gridApi.getGridOption('treeData');
332
332
  }
333
333
  getUndecidedLayoutModelFromGrid(columnState) {
334
- let TableColumns = columnState
335
- .map((c) => c.colId)
336
- .filter((colId) => colId !== 'ag-Grid-SelectionColumn');
334
+ let TableColumns = columnState.map((c) => c.colId);
335
+ // .filter((colId) => colId !== 'ag-Grid-SelectionColumn');
337
336
  let ColumnWidths = {};
338
337
  let ColumnSorts = [];
339
338
  let RowGroupedColumns = [];
@@ -496,10 +495,26 @@ export class LayoutManager extends LMEmitter {
496
495
  : this.getRowGroupNodePathsAs({
497
496
  expanded: true,
498
497
  });
499
- RowGroupValues = {
500
- RowGroupDisplay: 'collapsed',
501
- Values: ExpandedValues,
502
- };
498
+ if (Array.isArray(currentRowGroupValues.GroupKeys)) {
499
+ RowGroupValues = {
500
+ RowGroupDisplay: 'collapsed',
501
+ GroupKeys: currentRowGroupValues.GroupKeys.map((item) => {
502
+ if ((item.RowGroupedColumns || []).join(',') === (RowGroupedColumns || []).join(',')) {
503
+ return {
504
+ RowGroupedColumns: item.RowGroupedColumns,
505
+ Values: ExpandedValues,
506
+ };
507
+ }
508
+ return item;
509
+ }),
510
+ };
511
+ }
512
+ else {
513
+ RowGroupValues = {
514
+ RowGroupDisplay: 'collapsed',
515
+ Values: ExpandedValues,
516
+ };
517
+ }
503
518
  }
504
519
  else if (currentRowGroupValues.RowGroupDisplay === 'expanded') {
505
520
  const CollapsedValues = isGroupingNew
@@ -507,10 +522,26 @@ export class LayoutManager extends LMEmitter {
507
522
  : this.getRowGroupNodePathsAs({
508
523
  expanded: false,
509
524
  });
510
- RowGroupValues = {
511
- RowGroupDisplay: 'expanded',
512
- Values: CollapsedValues,
513
- };
525
+ if (Array.isArray(currentRowGroupValues.GroupKeys)) {
526
+ RowGroupValues = {
527
+ RowGroupDisplay: 'expanded',
528
+ GroupKeys: currentRowGroupValues.GroupKeys.map((item) => {
529
+ if ((item.RowGroupedColumns || []).join(',') === (RowGroupedColumns || []).join(',')) {
530
+ return {
531
+ RowGroupedColumns: item.RowGroupedColumns,
532
+ Values: CollapsedValues,
533
+ };
534
+ }
535
+ return item;
536
+ }),
537
+ };
538
+ }
539
+ else {
540
+ RowGroupValues = {
541
+ RowGroupDisplay: 'expanded',
542
+ Values: CollapsedValues,
543
+ };
544
+ }
514
545
  }
515
546
  }
516
547
  }
@@ -897,7 +928,7 @@ export class LayoutManager extends LMEmitter {
897
928
  this.gridApi.applyColumnState(this.computeColumnStateForTableLayout(layout));
898
929
  // but also let's not forget to apply the row group values
899
930
  if (hasGroupedColumns && layout.RowGroupValues && !options?.skipApplyRowGroupsExpandedState) {
900
- this.applyRowGroupValues(layout.RowGroupValues);
931
+ this.applyRowGroupValues(layout.RowGroupValues, layout.RowGroupedColumns);
901
932
  }
902
933
  this.applyColumnGroupCollapseExpandState(layout);
903
934
  });
@@ -921,7 +952,7 @@ export class LayoutManager extends LMEmitter {
921
952
  });
922
953
  return result;
923
954
  }
924
- applyRowGroupValues(RowGroupValues) {
955
+ applyRowGroupValues(RowGroupValues, rowGroupedColumns) {
925
956
  if (!RowGroupValues) {
926
957
  return;
927
958
  }
@@ -934,9 +965,21 @@ export class LayoutManager extends LMEmitter {
934
965
  return;
935
966
  }
936
967
  const defaultExpanded = RowGroupValues.RowGroupDisplay === 'expanded';
937
- if (RowGroupValues.Values) {
968
+ let currentRowGroupedValues = RowGroupValues.Values;
969
+ if (RowGroupValues.GroupKeys) {
970
+ const matchingRowGroupColumnValues = RowGroupValues.GroupKeys.find((item) => {
971
+ return (item.RowGroupedColumns || []).join(',') === (rowGroupedColumns || []).join(',');
972
+ });
973
+ if (matchingRowGroupColumnValues) {
974
+ currentRowGroupedValues = matchingRowGroupColumnValues.Values;
975
+ }
976
+ else {
977
+ currentRowGroupedValues = [];
978
+ }
979
+ }
980
+ if (currentRowGroupedValues) {
938
981
  const deepMap = new DeepMap();
939
- RowGroupValues.Values.forEach((rowGroupValue) => {
982
+ currentRowGroupedValues.forEach((rowGroupValue) => {
940
983
  deepMap.set(rowGroupValue, true);
941
984
  });
942
985
  this.gridApi.forEachNode((node) => {
@@ -1228,7 +1271,7 @@ export class LayoutManager extends LMEmitter {
1228
1271
  const hasGroupedColumns = layout.PivotGroupedColumns && layout.PivotGroupedColumns.length;
1229
1272
  // but also let's not forget to apply the row group values
1230
1273
  if (hasGroupedColumns && layout.RowGroupValues && !options?.skipApplyRowGroupsExpandedState) {
1231
- this.applyRowGroupValues(layout.RowGroupValues);
1274
+ this.applyRowGroupValues(layout.RowGroupValues, layout.PivotGroupedColumns);
1232
1275
  }
1233
1276
  }
1234
1277
  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: {