@adaptabletools/adaptable 20.2.6 → 20.2.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 (34) hide show
  1. package/base.css +7 -10
  2. package/base.css.map +1 -1
  3. package/index.css +7 -9
  4. package/index.css.map +1 -1
  5. package/package.json +1 -1
  6. package/src/AdaptableState/LayoutState.d.ts +4 -4
  7. package/src/Api/GridApi.d.ts +2 -2
  8. package/src/Api/GridFilterApi.d.ts +10 -1
  9. package/src/Api/Implementation/ColumnApiImpl.js +6 -1
  10. package/src/Api/Implementation/GridApiImpl.d.ts +1 -1
  11. package/src/Api/Implementation/GridFilterApiImpl.d.ts +3 -1
  12. package/src/Api/Implementation/GridFilterApiImpl.js +10 -0
  13. package/src/Api/Implementation/LayoutApiImpl.js +13 -8
  14. package/src/Api/Implementation/LayoutHelpers.js +4 -6
  15. package/src/Api/Implementation/StateApiImpl.d.ts +1 -0
  16. package/src/Api/Implementation/StateApiImpl.js +7 -4
  17. package/src/Api/StateApi.d.ts +7 -0
  18. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +0 -1
  19. package/src/Redux/ActionsReducers/LayoutRedux.js +0 -22
  20. package/src/Redux/Store/AdaptableStore.js +1 -3
  21. package/src/Strategy/LayoutModule.js +1 -1
  22. package/src/View/Components/ReorderDraggable/index.js +2 -1
  23. package/src/View/Layout/Wizard/sections/ColumnsSection.js +6 -2
  24. package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +1 -1
  25. package/src/View/StateManagement/components/ExportDropdown.js +1 -1
  26. package/src/agGrid/AdaptableAgGrid.js +5 -1
  27. package/src/agGrid/AgGridAdapter.js +2 -2
  28. package/src/env.js +2 -2
  29. package/src/layout-manager/src/LayoutManagerModel.d.ts +4 -4
  30. package/src/layout-manager/src/index.js +2 -2
  31. package/src/layout-manager/src/isLayoutEqual.js +0 -1
  32. package/src/metamodel/adaptable.metamodel.d.ts +2 -2
  33. package/src/metamodel/adaptable.metamodel.js +1 -1
  34. package/tsconfig.esm.tsbuildinfo +1 -1
@@ -171,7 +171,6 @@ export interface LayoutReadyAction extends Redux.Action {
171
171
  export declare const LayoutAdd: (layout: Layout) => LayoutAddAction;
172
172
  export declare const LayoutDelete: (layout: Layout) => LayoutDeleteAction;
173
173
  export declare const LayoutSave: (layout: Layout) => LayoutSaveAction;
174
- export declare const LayoutSetColumnCaption: (layoutName: string, columnId: string, caption: string) => LayoutSetColumnCaptionAction;
175
174
  export declare const LayoutAddColumn: (layoutName: string, columnId: string) => LayoutAddColumnAction;
176
175
  export declare const LayoutRemoveColumn: (layoutName: string, columnId: string) => LayoutRemoveColumnAction;
177
176
  export declare const LayoutSelect: (layoutName: string) => LayoutSelectAction;
@@ -148,12 +148,6 @@ export const LayoutSave = (layout) => ({
148
148
  type: LAYOUT_SAVE,
149
149
  layout: normalizeLayout(layout),
150
150
  });
151
- export const LayoutSetColumnCaption = (layoutName, columnId, caption) => ({
152
- type: LAYOUT_COLUMN_SET_CAPTION,
153
- layoutName,
154
- columnId,
155
- caption,
156
- });
157
151
  export const LayoutAddColumn = (layoutName, columnId) => ({
158
152
  type: LAYOUT_COLUMN_ADD,
159
153
  layoutName,
@@ -243,22 +237,6 @@ export const LayoutReducer = (state = initialState, action) => {
243
237
  Layouts: newLayouts,
244
238
  };
245
239
  }
246
- case LAYOUT_COLUMN_SET_CAPTION: {
247
- const setColumnCaptionAction = action;
248
- const currentLayoutName = setColumnCaptionAction.layoutName;
249
- let currentLayout = state.Layouts.find((l) => l.Name === currentLayoutName);
250
- if (currentLayout) {
251
- if (!currentLayout.ColumnHeaders) {
252
- currentLayout.ColumnHeaders = {};
253
- }
254
- currentLayout.ColumnHeaders[setColumnCaptionAction.columnId] =
255
- setColumnCaptionAction.caption;
256
- return Object.assign({}, state, {
257
- Layouts: state.Layouts.map((abObject) => abObject.Uuid === currentLayout.Uuid ? currentLayout : abObject),
258
- });
259
- }
260
- return state;
261
- }
262
240
  case LAYOUT_COLUMN_ADD: {
263
241
  const addColumnAction = action;
264
242
  const layoutname = addColumnAction.layoutName;
@@ -881,7 +881,6 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
881
881
  case LayoutRedux.LAYOUT_EDIT:
882
882
  case LayoutRedux.LAYOUT_SAVE:
883
883
  case LayoutRedux.LAYOUT_DELETE:
884
- case LayoutRedux.LAYOUT_COLUMN_SET_CAPTION:
885
884
  case LayoutRedux.LAYOUT_SELECT: {
886
885
  const oldLayoutState = middlewareAPI.getState().Layout;
887
886
  // this must be called before 'next(action)'
@@ -907,8 +906,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
907
906
  adaptable.applyFiltering();
908
907
  }
909
908
  if (returnAction.type == LayoutRedux.LAYOUT_SELECT ||
910
- returnAction.type == LayoutRedux.LAYOUT_DELETE ||
911
- returnAction.type == LayoutRedux.LAYOUT_COLUMN_SET_CAPTION) {
909
+ returnAction.type == LayoutRedux.LAYOUT_DELETE) {
912
910
  // tell AdapTable the Layout has been selected
913
911
  if (newLayout) {
914
912
  adaptable.updateLayoutInManagerAfterStoreHasChanged(newLayout);
@@ -42,7 +42,7 @@ export class LayoutModule extends AdaptableModuleBase {
42
42
  }
43
43
  getExplicitlyReferencedColumnIds(layout) {
44
44
  const columnIds = [];
45
- if (layout.TableColumns) {
45
+ if (!isPivotLayout(layout) && layout.TableColumns) {
46
46
  const visibility = layout.ColumnVisibility || {};
47
47
  columnIds.push(...layout.TableColumns.filter((colId) => {
48
48
  return visibility[colId] !== false;
@@ -13,7 +13,8 @@ export function ReorderDraggable(props) {
13
13
  return (React.createElement(Flex, { className: `${baseClassName}__option`, alignItems: "center", mt: index ? 1 : 0, key: identifier ?? index, backgroundColor: 'primary', padding: 2, "data-index": index, "data-id": identifier, "data-name": "option", ...flexProps },
14
14
  React.createElement(Flex, { flex: 1, flexDirection: "row", alignItems: "center" },
15
15
  reorderable ? (React.createElement(Box, { mr: 3, ...dragHandleProps },
16
- React.createElement(Icon, { name: "drag", style: { cursor: 'grab' } }))) : null,
16
+ React.createElement(Icon, { name: "drag", style: { cursor: 'grab' } }))) : (React.createElement(Box, { mr: 3 },
17
+ React.createElement(Icon, { name: "drag", style: { cursor: 'not-allowed', opacity: 0.3 } }))),
17
18
  props.renderOption(option, index))));
18
19
  };
19
20
  const reorderable = isOptionDraggable ? isOptionDraggable(option) : true;
@@ -23,6 +23,7 @@ import { AdaptableFormControlTextClear } from '../../../Components/Forms/Adaptab
23
23
  import { sortColumnIdsByOrder } from '../../../../layout-manager/src/sortColumnIdsByOrder';
24
24
  import HelpBlock from '../../../../components/HelpBlock';
25
25
  import { AG_GRID_SELECTION_COLUMN } from '../../../../Utilities/Constants/GeneralConstants';
26
+ import { isPivotLayout } from '../../../../Utilities/isPivotLayout';
26
27
  const PropertyOrderText = (props) => (React.createElement(Text, { fontWeight: 600, fontSize: 2 }, props.children));
27
28
  const columnTypes = {
28
29
  default: {
@@ -156,7 +157,8 @@ const ColumnRow = (props) => {
156
157
  const { column } = props;
157
158
  // width
158
159
  const columnWidth = props.layout.ColumnWidths?.[column.columnId];
159
- const visible = (props.layout.TableColumns.includes(column.columnId) &&
160
+ const visible = (!isPivotLayout(props.layout) &&
161
+ props.layout.TableColumns.includes(column.columnId) &&
160
162
  props.layout.ColumnVisibility?.[column.columnId] !== false) ||
161
163
  isRowGroupColumn;
162
164
  return (React.createElement(Box, { "data-name": props.column.columnId, className: "ab-Layout-Wizard__ColumnRow" },
@@ -376,7 +378,9 @@ export const ColumnsSection = (props) => {
376
378
  React.createElement(Box, null,
377
379
  React.createElement(NaturallySizedIcon, { name: "info" })),
378
380
  React.createElement(Text, { ml: 1 }, "Expand each Column to set Width, Pinnning and a custom Header")),
379
- React.createElement(ReorderDraggable, { toIdentifier: (option) => `${option.columnId}`, order: currentOrder, renderOption: (option) => {
381
+ React.createElement(ReorderDraggable, { toIdentifier: (option) => `${option.columnId}`, isOptionDraggable: (option) => {
382
+ return option.moveable;
383
+ }, order: currentOrder, renderOption: (option) => {
380
384
  return (React.createElement(ColumnRow, { onColumnNameChange: handleColumnNameChange, onColumnWidthChange: handleColumnWidthChange, onColumnVisibilityChange: handleColumnVisibilityChange, onPinChange: handlePinChange, layout: layout, column: option }));
381
385
  }, onChange: handleColumnsChange }),
382
386
  renderSelectionSection({
@@ -22,7 +22,7 @@ export const PivotRowGroupingSection = (props) => {
22
22
  const { data: layout } = useOnePageAdaptableWizardContext();
23
23
  const allGroupableColumns = adaptable.api.columnApi.getGroupableColumns();
24
24
  const sortedGroupableColumns = React.useMemo(() => {
25
- return ArrayExtensions.sortArrayWithOrder(allGroupableColumns.map((col) => col.columnId), layout.RowGroupedColumns ?? [], { sortUnorderedItems: false }).map((colId) => adaptable.api.columnApi.getColumnWithColumnId(colId));
25
+ return ArrayExtensions.sortArrayWithOrder(allGroupableColumns.map((col) => col.columnId), layout.PivotGroupedColumns ?? [], { sortUnorderedItems: false }).map((colId) => adaptable.api.columnApi.getColumnWithColumnId(colId));
26
26
  }, [layout, allGroupableColumns]);
27
27
  const onChange = (layout) => {
28
28
  props.onChange(normalizeLayout(layout));
@@ -5,7 +5,7 @@ export const ExportDropdown = (props) => {
5
5
  const handleChange = (destination) => {
6
6
  switch (props.type) {
7
7
  case 'adaptableState':
8
- const adaptableState = props.api.stateApi.getPersistedState();
8
+ const adaptableState = props.api.stateApi.getPersistentState();
9
9
  handleExportState(destination, 'adaptableState', adaptableState);
10
10
  break;
11
11
  case 'initialState':
@@ -3127,6 +3127,7 @@ You need to define at least one Layout!`);
3127
3127
  }
3128
3128
  }
3129
3129
  }
3130
+ const prevLayout = this._prevLayout;
3130
3131
  this._prevLayout = layout;
3131
3132
  const perfSetLayout = this.logger.beginPerf(`setLayout(${layout.Name})`);
3132
3133
  const isPivot = isPivotLayout(layout);
@@ -3149,7 +3150,10 @@ You need to define at least one Layout!`);
3149
3150
  // need to refresh the header,
3150
3151
  // as the Layout.ColumnHeaders state property is not implemented in the LayoutManager
3151
3152
  // and is specific to Adaptable, therefore we need to refresh it manually
3152
- this.refreshHeader();
3153
+ if (!prevLayout ||
3154
+ JSON.stringify(prevLayout.ColumnHeaders) !== JSON.stringify(layout.ColumnHeaders)) {
3155
+ this.refreshHeader();
3156
+ }
3153
3157
  const layoutModel = layoutStateToLayoutModel(layout);
3154
3158
  this.layoutManager?.setLayout(layoutModel, {
3155
3159
  skipApplyRowGroupsExpandedState: !shouldUpdateExpandState,
@@ -621,8 +621,8 @@ export class AgGridAdapter {
621
621
  return false;
622
622
  }
623
623
  isColumnSortable(colDef) {
624
- if (colDef && colDef.sortable != null) {
625
- return colDef.sortable;
624
+ if (colDef) {
625
+ return colDef.sortable ?? true;
626
626
  }
627
627
  return false;
628
628
  }
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: 1751633635859 || Date.now(),
4
- VERSION: "20.2.6" || '--current-version--',
3
+ PUBLISH_TIMESTAMP: 1752148694307 || Date.now(),
4
+ VERSION: "20.2.8" || '--current-version--',
5
5
  };
@@ -40,10 +40,6 @@ export interface BaseLayoutModel {
40
40
  * Same as RowSummaries, but for Pivot Layout
41
41
  */
42
42
  Ignore_RowSummaries?: any;
43
- /**
44
- * Same as above, but
45
- */
46
- Ignore_Name?: string;
47
43
  /**
48
44
  * Same as above, but for Column Headers
49
45
  */
@@ -51,6 +47,10 @@ export interface BaseLayoutModel {
51
47
  Ignore_Source?: string;
52
48
  Ignore_AdaptableVersion?: string;
53
49
  Ignore_Uuid?: string;
50
+ /**
51
+ * The Layout Name
52
+ */
53
+ Name?: string;
54
54
  ColumnVisibility?: {
55
55
  [columnId: string]: false;
56
56
  };
@@ -276,7 +276,7 @@ export class LayoutManager extends LMEmitter {
276
276
  }
277
277
  delete layout.TableColumns;
278
278
  const pivotLayout = {
279
- Ignore_Name: layout.Ignore_Name,
279
+ Name: layout.Name,
280
280
  Ignore_GridFilter: layout.Ignore_GridFilter,
281
281
  Ignore_ColumnFilters: layout.Ignore_ColumnFilters,
282
282
  Ignore_ColumnHeaders: layout.Ignore_ColumnHeaders,
@@ -595,7 +595,7 @@ export class LayoutManager extends LMEmitter {
595
595
  }
596
596
  }
597
597
  const layout = simplifyTableLayoutModel({
598
- Ignore_Name: this.currentLayout?.Ignore_Name || 'Default',
598
+ Name: this.currentLayout?.Name || 'Default',
599
599
  Ignore_GridFilter: this.currentLayout?.Ignore_GridFilter,
600
600
  Ignore_ColumnFilters: this.currentLayout?.Ignore_ColumnFilters,
601
601
  Ignore_ColumnHeaders: this.currentLayout?.Ignore_ColumnHeaders,
@@ -49,7 +49,6 @@ export function isTableLayoutEqual(l1, l2) {
49
49
  function clearIgnoredProperties(layout) {
50
50
  delete layout.Ignore_GridFilter;
51
51
  delete layout.Ignore_ColumnFilters;
52
- delete layout.Ignore_Name;
53
52
  delete layout.Ignore_ColumnHeaders;
54
53
  delete layout.Ignore_AutoSizeColumns;
55
54
  delete layout.Ignore_RowSummaries;
@@ -5644,13 +5644,13 @@ export declare const ADAPTABLE_METAMODEL: {
5644
5644
  kind: string;
5645
5645
  desc: string;
5646
5646
  isOpt: boolean;
5647
- ref?: undefined;
5647
+ ref: string;
5648
5648
  } | {
5649
5649
  name: string;
5650
5650
  kind: string;
5651
5651
  desc: string;
5652
5652
  isOpt: boolean;
5653
- ref: string;
5653
+ ref?: undefined;
5654
5654
  } | {
5655
5655
  name: string;
5656
5656
  kind: string;