@adaptabletools/adaptable-cjs 22.0.6 → 22.0.8

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/index.css +19 -1
  2. package/index.css.map +1 -1
  3. package/package.json +1 -1
  4. package/src/AdaptableOptions/FilterOptions.d.ts +1 -0
  5. package/src/AdaptableState/Common/ColumnScope.d.ts +4 -0
  6. package/src/AdaptableState/Common/ColumnScope.js +17 -0
  7. package/src/Api/Implementation/ColumnFilterApiImpl.js +1 -0
  8. package/src/Api/Implementation/StateApiImpl.d.ts +1 -1
  9. package/src/Api/Implementation/StateApiImpl.js +12 -15
  10. package/src/Api/StateApi.d.ts +1 -1
  11. package/src/Redux/Store/AdaptableReduxMerger.js +4 -1
  12. package/src/Redux/Store/AdaptableStore.d.ts +2 -1
  13. package/src/Redux/Store/AdaptableStore.js +14 -9
  14. package/src/Redux/Store/Interface/IAdaptableStore.d.ts +1 -1
  15. package/src/View/Alert/Wizard/AlertScopeWizardSection.js +10 -3
  16. package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +8 -8
  17. package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +1 -1
  18. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +4 -2
  19. package/src/View/Components/ColumnFilter/components/FloatingFilterValues.js +1 -0
  20. package/src/View/Components/ColumnGroupTag/index.d.ts +5 -0
  21. package/src/View/Components/ColumnGroupTag/index.js +14 -0
  22. package/src/View/Components/ColumnSelector/index.js +4 -1
  23. package/src/View/Components/FilterForm/ListBoxFilterForm.js +8 -1
  24. package/src/View/Components/NewScopeComponent.js +19 -37
  25. package/src/View/Components/ReorderDraggable/index.d.ts +1 -0
  26. package/src/View/Components/ReorderDraggable/index.js +2 -1
  27. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +7 -1
  28. package/src/View/CustomSort/Wizard/CustomSortWizard.js +1 -1
  29. package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +10 -3
  30. package/src/View/FormatColumn/Wizard/FormatColumnColumnScopeWizardSection.js +14 -7
  31. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +1 -3
  32. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +1 -1
  33. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +7 -7
  34. package/src/View/Layout/Wizard/LayoutWizard.js +2 -2
  35. package/src/View/Layout/Wizard/sections/AggregationsSection.js +2 -0
  36. package/src/View/Layout/Wizard/sections/ColumnsSection.js +149 -140
  37. package/src/View/Layout/Wizard/sections/FilterSection.js +8 -1
  38. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +2 -0
  39. package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +4 -1
  40. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +4 -1
  41. package/src/View/Layout/Wizard/sections/RowSummarySection.js +8 -3
  42. package/src/View/Layout/Wizard/sections/SortSection.js +3 -1
  43. package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.js +7 -1
  44. package/src/View/Wizard/OnePageAdaptableWizard.d.ts +0 -1
  45. package/src/View/Wizard/OnePageAdaptableWizard.js +1 -1
  46. package/src/View/Wizard/OnePageWizards.d.ts +1 -0
  47. package/src/View/Wizard/OnePageWizards.js +11 -4
  48. package/src/agGrid/AdaptableAgGrid.js +19 -28
  49. package/src/agGrid/AgGridAdapter.d.ts +1 -0
  50. package/src/agGrid/AgGridAdapter.js +4 -0
  51. package/src/agGrid/AgGridColumnAdapter.js +3 -3
  52. package/src/agGrid/AgGridExportAdapter.js +1 -3
  53. package/src/components/Tree/TreeDropdown/index.d.ts +9 -0
  54. package/src/components/Tree/TreeDropdown/index.js +21 -1
  55. package/src/env.js +2 -2
  56. package/src/layout-manager/src/index.js +6 -0
  57. package/tsconfig.cjs.tsbuildinfo +1 -1
@@ -2158,38 +2158,16 @@ class AdaptableAgGrid {
2158
2158
  }
2159
2159
  const colDef = this.agGridAdapter.getAgGridApi().getColumnDef(columnId);
2160
2160
  if (colDef) {
2161
- if (typeof colDef.valueFormatter == 'function') {
2162
- const column = this.agGridAdapter.getAgGridApi().getColumn(columnId);
2163
- const params = {
2164
- value: rawValue,
2165
- node: rowNode,
2166
- data: rowNode.data,
2167
- colDef,
2168
- column,
2169
- api: this.agGridAdapter.getAgGridApi(),
2170
- context: this.agGridAdapter.getGridOption('context'),
2171
- };
2172
- const formattedValue = colDef.valueFormatter(params);
2173
- return formattedValue || '';
2174
- }
2161
+ const formattedValue = this.agGridAdapter._agGridApi_getFormattedValue(columnId, rowNode);
2162
+ return formattedValue || '';
2175
2163
  }
2176
- else if (this.api.columnApi.isPivotResultColumn(columnId)) {
2164
+ if (this.api.columnApi.isPivotResultColumn(columnId)) {
2177
2165
  const pivotResultColumn = this.agGridAdapter
2178
2166
  .getAgGridApi()
2179
2167
  .getPivotResultColumns()
2180
2168
  .find((col) => col.getColId() === columnId);
2181
- const pivotResultColDef = pivotResultColumn?.getColDef();
2182
- if (pivotResultColDef && typeof pivotResultColDef.valueFormatter === 'function') {
2183
- const params = {
2184
- value: rawValue,
2185
- node: rowNode,
2186
- data: rowNode.data,
2187
- colDef: pivotResultColDef,
2188
- column: pivotResultColumn,
2189
- api: this.agGridAdapter.getAgGridApi(),
2190
- context: this.agGridAdapter.getGridOption('context'),
2191
- };
2192
- const formattedValue = pivotResultColDef.valueFormatter(params);
2169
+ if (pivotResultColumn) {
2170
+ const formattedValue = this.agGridAdapter._agGridApi_getFormattedValue(pivotResultColumn, rowNode);
2193
2171
  return formattedValue || '';
2194
2172
  }
2195
2173
  }
@@ -2735,9 +2713,11 @@ class AdaptableAgGrid {
2735
2713
  };
2736
2714
  // No distinct values so lets return unique grid cells
2737
2715
  const mapFn = (gridCell, level) => {
2716
+ const itemId = `${gridCell.rowNode?.id}-${gridCell.column?.columnId}`;
2738
2717
  if (level || Array.isArray(gridCell.children)) {
2739
2718
  const cell = gridCell;
2740
2719
  const inFilterValue = {
2720
+ id: itemId,
2741
2721
  value: gridCell.rawValue,
2742
2722
  label: gridCell.displayValue,
2743
2723
  level: level ?? 0,
@@ -2758,6 +2738,7 @@ class AdaptableAgGrid {
2758
2738
  return inFilterValue;
2759
2739
  }
2760
2740
  return {
2741
+ id: itemId,
2761
2742
  value: gridCell.rawValue,
2762
2743
  label: gridCell.displayValue,
2763
2744
  };
@@ -2777,7 +2758,9 @@ class AdaptableAgGrid {
2777
2758
  const result = gridApiInternal
2778
2759
  .sortDistinctValues(getCurrentGridCells(), column)
2779
2760
  .map((gridCell) => {
2761
+ const itemId = `${gridCell.rowNode?.id}-${gridCell.column?.columnId}`;
2780
2762
  return {
2763
+ id: itemId,
2781
2764
  label: gridCell.displayValue,
2782
2765
  value: gridCell.rawValue,
2783
2766
  isSelected: gridCell.rowNode.displayed,
@@ -2803,7 +2786,9 @@ class AdaptableAgGrid {
2803
2786
  },
2804
2787
  get defaultValues() {
2805
2788
  const result = getCurrentGridCells().map((gridCell) => {
2789
+ const itemId = `${gridCell.rowNode?.id}-${gridCell.column?.columnId}`;
2806
2790
  return {
2791
+ id: itemId,
2807
2792
  label: gridCell.displayValue,
2808
2793
  value: gridCell.rawValue,
2809
2794
  isSelected: gridCell.rowNode.displayed,
@@ -2831,7 +2816,9 @@ class AdaptableAgGrid {
2831
2816
  const rowNodes = gridApiInternal.getSortedRowNodesWithCurrentLayoutSortOrder();
2832
2817
  const currentGridCells = self.getDistinctGridCellsForColumn(column, rowNodes);
2833
2818
  const result = currentGridCells.map((gridCell) => {
2819
+ const itemId = `${gridCell.rowNode?.id}-${gridCell.column?.columnId}`;
2834
2820
  return {
2821
+ id: itemId,
2835
2822
  label: gridCell.displayValue,
2836
2823
  value: gridCell.rawValue,
2837
2824
  isSelected: gridCell.rowNode.displayed,
@@ -3734,7 +3721,11 @@ class AdaptableAgGrid {
3734
3721
  }
3735
3722
  const distinctRawValues = this.api.gridApi.internalApi
3736
3723
  .getUnsortedDistinctRawValuesForColumn(columnId)
3737
- .map((item) => item.rawValue);
3724
+ .map((item) => item.rawValue)
3725
+ .filter((v) => typeof v === 'number' && !isNaN(v));
3726
+ if (distinctRawValues.length === 0) {
3727
+ return undefined;
3728
+ }
3738
3729
  value = minMax === 'min' ? Math.min(...distinctRawValues) : Math.max(...distinctRawValues);
3739
3730
  this.columnMinMaxValuesCache[columnId] = {
3740
3731
  ...this.columnMinMaxValuesCache[columnId],
@@ -81,4 +81,5 @@ export declare class AgGridAdapter {
81
81
  traverseColDefs(colDefs: (ColDef | ColGroupDef)[], modifyFn: (colDef: ColDef) => ColDef | null): (ColDef | ColGroupDef)[];
82
82
  getDefaultColumnDefinition(): GridOptions['defaultColDef'];
83
83
  _agGridApi_getValue(colKey: string | Column, rowNode: IRowNode, gridApi?: GridApi): any;
84
+ _agGridApi_getFormattedValue(colKey: string | Column, rowNode: IRowNode, gridApi?: GridApi): any;
84
85
  }
@@ -839,5 +839,9 @@ class AgGridAdapter {
839
839
  gridApi = gridApi || this.getAgGridApi();
840
840
  return gridApi.getCellValue({ colKey, rowNode });
841
841
  }
842
+ _agGridApi_getFormattedValue(colKey, rowNode, gridApi) {
843
+ gridApi = gridApi || this.getAgGridApi();
844
+ return gridApi.getCellValue({ colKey, rowNode, useFormatter: true });
845
+ }
842
846
  }
843
847
  exports.AgGridAdapter = AgGridAdapter;
@@ -1199,8 +1199,8 @@ class AgGridColumnAdapter {
1199
1199
  getStyledColumnStyle(styledColumn, abColumn, params) {
1200
1200
  let style = {};
1201
1201
  const gradientStyle = styledColumn?.GradientStyle;
1202
- if (params.value === undefined) {
1203
- return;
1202
+ if (params.value == undefined || params.value === '') {
1203
+ return style;
1204
1204
  }
1205
1205
  let colValue = params.value;
1206
1206
  if (this.adaptableApi.gridApi.isGroupRowNode(params.node)) {
@@ -1316,7 +1316,7 @@ class AgGridColumnAdapter {
1316
1316
  const columnHighlight = this.adaptableApi.internalApi
1317
1317
  .getInternalState()
1318
1318
  .ColumnHighlightInfo.find((columnHighlightInfo) => {
1319
- return (gridCell.column.columnId === columnHighlightInfo.columnId);
1319
+ return gridCell.column.columnId === columnHighlightInfo.columnId;
1320
1320
  });
1321
1321
  if (columnHighlight) {
1322
1322
  return (0, StyleHelper_1.convertAdaptableStyleToCSS)(columnHighlight.highlightStyle);
@@ -434,9 +434,7 @@ class AgGridExportAdapter {
434
434
  }
435
435
  const getColIdAndRawValue = () => {
436
436
  if (this.adaptableApi.columnApi.isAutoRowGroupColumn(agColumn?.getColId())) {
437
- const columnId = rowNode.rowGroupColumn?.getColId() ??
438
- rowNode.rowGroupColumn?.getColDef()?.field ??
439
- rowNode.field;
437
+ const columnId = agColumn.getColId();
440
438
  let rawValue = rowNode.key;
441
439
  return { columnId, rawValue };
442
440
  }
@@ -24,4 +24,13 @@ export type TreeDropdownProps<T extends TreeListItem<any>> = {
24
24
  clearable?: boolean;
25
25
  };
26
26
  export declare function toDisplayValueDefault(value: any[][] | string[]): string;
27
+ /**
28
+ * Formats the closed TreeDropdown input using each option's `label` for the stored `value` path
29
+ * segments (same shape as {@link toDisplayValueDefault}, but resolves raw values to labels).
30
+ */
31
+ export declare function toDisplayValueFromOptionTree<T extends {
32
+ value: any;
33
+ label: string;
34
+ children?: T[];
35
+ }>(paths: any[][] | string[], options: T[]): string;
27
36
  export declare function TreeDropdown<T extends TreeListItem<any>>(props: TreeDropdownProps<T>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.toDisplayValueDefault = toDisplayValueDefault;
4
+ exports.toDisplayValueFromOptionTree = toDisplayValueFromOptionTree;
4
5
  exports.TreeDropdown = TreeDropdown;
5
6
  const tslib_1 = require("tslib");
6
7
  const React = tslib_1.__importStar(require("react"));
@@ -28,6 +29,25 @@ function toDisplayValueDefault(value) {
28
29
  }
29
30
  return value.map((v) => (Array.isArray(v) ? v.join('-') : v)).join(', ');
30
31
  }
32
+ /**
33
+ * Formats the closed TreeDropdown input using each option's `label` for the stored `value` path
34
+ * segments (same shape as {@link toDisplayValueDefault}, but resolves raw values to labels).
35
+ */
36
+ function toDisplayValueFromOptionTree(paths, options) {
37
+ const valueToLabel = new Map();
38
+ const walk = (node) => {
39
+ valueToLabel.set(node.value, node.label);
40
+ if (Array.isArray(node.children)) {
41
+ node.children.forEach(walk);
42
+ }
43
+ };
44
+ options.forEach(walk);
45
+ return paths
46
+ .map((path) => Array.isArray(path)
47
+ ? path.map((segment) => valueToLabel.get(segment) ?? String(segment)).join('-')
48
+ : valueToLabel.get(path) ?? String(path))
49
+ .join(', ');
50
+ }
31
51
  const getLabelColumn = (field, { includeExpandCollapseButton }) => {
32
52
  return {
33
53
  field,
@@ -254,7 +274,7 @@ function TreeDropdown(props) {
254
274
  } }, children));
255
275
  } },
256
276
  React.createElement(FieldWrap_1.default, { style: props.fieldStyle, className: "twa:w-full" },
257
- React.createElement(Input_1.default, { type: "text", readOnly: true, "data-name": "Select Values", "aria-expanded": visible, placeholder: props.placeholder ?? 'Select a value', className: `twa:w-full ${props.clearable ? 'twa:pr-0' : ''}`, value: props.toDisplayValue ? props.toDisplayValue(value) : toDisplayValueDefault(value), onFocus: () => {
277
+ React.createElement(Input_1.default, { type: "text", readOnly: true, "data-name": "Select Values", "aria-expanded": visible, placeholder: props.placeholder ?? 'Select...', className: `twa:w-full ${props.clearable ? 'twa:pr-0' : ''}`, value: props.toDisplayValue ? props.toDisplayValue(value) : toDisplayValueDefault(value), onFocus: () => {
258
278
  if (!visible) {
259
279
  setVisible(true);
260
280
  }
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: 1774360471339 || Date.now(),
6
- VERSION: "22.0.6" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1775221059632 || Date.now(),
6
+ VERSION: "22.0.8" || '--current-version--',
7
7
  };
@@ -1033,6 +1033,12 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
1033
1033
  const shouldSkipTriggerChange = options?.skipTriggerChange === true;
1034
1034
  const shouldSkipEqualityCheck = options?.force === true;
1035
1035
  if (!shouldSkipEqualityCheck && (0, isLayoutEqual_1.isLayoutEqual)(this.currentLayout, layout)) {
1036
+ // isLayoutEqual strips Ignore_* properties (ColumnHeaders, Filters, etc.)
1037
+ // so even when grid-derived properties match, we must sync currentLayout
1038
+ // to preserve any Ignore_* changes — otherwise getLayoutModelFromGrid
1039
+ // will copy stale values from this.currentLayout
1040
+ // this.currentLayout = layout;
1041
+ this.silentSetCurrentLayout(layout);
1036
1042
  return false;
1037
1043
  }
1038
1044
  const prevCurrent = this.currentLayout;