@adaptabletools/adaptable 13.0.4-canary.2 → 13.0.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "13.0.4-canary.2",
3
+ "version": "13.0.4",
4
4
  "description": "Powerful data-agnostic HTML5 datagrid add-on that sits on top of an underlying grid component and provides all the rich functionality that advanced users expect from their DataGrids and Data Tables",
5
5
  "keywords": [
6
6
  "web-components",
@@ -1,2 +1,2 @@
1
- declare const _default: 1666358035861;
1
+ declare const _default: 1666692312615;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1666358035861;
3
+ exports.default = 1666692312615;
@@ -16,25 +16,21 @@ export interface ActionOptions {
16
16
  actionRowButtons?: ActionRowButtonType[];
17
17
  /**
18
18
  * Optional custom configuration that, when specified, merges with the built-in action row button and overrides the default configuration
19
- *
20
19
  * @defaultValue undefined
21
20
  */
22
21
  actionRowButtonCustomConfiguration?: (context: ActionRowButtonCustomConfigurationContext) => Partial<AdaptableButton<ActionColumnContext>>;
23
22
  /**
24
23
  * Position of supplied Action Buttons
25
- *
26
24
  * @defaultValue 'pinnedLeft'
27
25
  */
28
26
  actionRowButtonsPosition?: 'pinnedLeft' | 'pinnedRight';
29
27
  /**
30
28
  * If set to true, the Action Row Buttons will be handled by AdapTable and the grid data model will be automatically updated with the created/edited/deleted rows
31
- *
32
- * @defaultValue false
29
+ * @defaultValue true
33
30
  */
34
31
  autoHandleActionRowButtons?: boolean;
35
32
  /**
36
33
  * Function which is called when auto-handling the 'create' Action Row Button. The returned row value should have a valid(unique) primary key value.
37
- *
38
34
  * @defaultValue undefined
39
35
  */
40
36
  setPrimaryKeyValue?: (context: SetPrimaryKeyValueContext) => any;
@@ -96,7 +96,7 @@ exports.DefaultAdaptableOptions = {
96
96
  actionRowButtons: undefined,
97
97
  actionRowButtonCustomConfiguration: undefined,
98
98
  actionRowButtonsPosition: 'pinnedLeft',
99
- autoHandleActionRowButtons: false,
99
+ autoHandleActionRowButtons: true,
100
100
  setPrimaryKeyValue: undefined,
101
101
  actionRowFormOptions: {
102
102
  formTitle: undefined,
@@ -14,27 +14,30 @@ exports.DEFAULT_NAVIGATION_ITEMS = [
14
14
  'Dashboard',
15
15
  'ToolPanel',
16
16
  'StatusBar',
17
- 'StateManagement',
18
17
  '-',
19
- 'Alert',
18
+ 'Layout',
19
+ 'Export',
20
20
  'CalculatedColumn',
21
+ 'FreeTextColumn',
21
22
  'CustomSort',
22
- 'DataSet',
23
- 'Export',
24
- 'Filter',
25
- 'FlashingCell',
23
+ 'Alert',
24
+ 'SystemStatus',
25
+ '-',
26
+ 'StyledColumn',
26
27
  'FormatColumn',
27
- 'FreeTextColumn',
28
- 'Layout',
29
- 'PlusMinus',
30
- 'Query',
28
+ 'FlashingCell',
29
+ 'Theme',
30
+ '-',
31
31
  'QuickSearch',
32
- 'Schedule',
33
- 'Shortcut',
34
- 'StyledColumn',
32
+ 'Query',
33
+ 'Filter',
34
+ 'DataSet',
35
35
  '-',
36
- 'SystemStatus',
36
+ 'PlusMinus',
37
+ 'Shortcut',
37
38
  'DataChangeHistory',
39
+ '-',
40
+ 'Schedule',
41
+ 'StateManagement',
38
42
  'TeamSharing',
39
- 'Theme',
40
43
  ];
@@ -1329,8 +1329,8 @@ class Adaptable {
1329
1329
  [];
1330
1330
  let isChanged = false;
1331
1331
  const colsToAutoSize = {};
1332
- let newColState = this.getSortedColumnStateForVisibleColumns(columnsToShow, columnsState);
1333
- newColState = newColState
1332
+ let newColumnsState = this.getSortedColumnStateForVisibleColumns(columnsToShow, columnsState);
1333
+ newColumnsState = newColumnsState
1334
1334
  .map((colState) => {
1335
1335
  var _a, _b, _c, _d, _e;
1336
1336
  const { colId } = colState;
@@ -1342,7 +1342,8 @@ class Adaptable {
1342
1342
  if (layout.ColumnWidthMap && layout.ColumnWidthMap[colId] != null) {
1343
1343
  newColState.width = layout.ColumnWidthMap[colId];
1344
1344
  }
1345
- else {
1345
+ else if (!hide) {
1346
+ // autosize only the columns which are part of the selected layout
1346
1347
  colsToAutoSize[colId] = true;
1347
1348
  }
1348
1349
  newColState.rowGroupIndex =
@@ -1406,7 +1407,7 @@ class Adaptable {
1406
1407
  // order changed
1407
1408
  const toString = (c) => `${c.colId}-${c.rowGroupIndex}-${c.pivotIndex}-${c.aggFunc}-${c.pinned}-${c.width}-${c.hide}`;
1408
1409
  const oldColStateString = columnsState.map(toString).join(',');
1409
- const newColStateString = newColState.map(toString).join(',');
1410
+ const newColStateString = newColumnsState.map(toString).join(',');
1410
1411
  isChanged = newColStateString != oldColStateString;
1411
1412
  }
1412
1413
  const pivoted = !!layout.EnablePivot;
@@ -1459,7 +1460,7 @@ class Adaptable {
1459
1460
  this.gridOptions.columnApi.setPivotMode(pivoted);
1460
1461
  }
1461
1462
  this.gridOptions.columnApi.applyColumnState({
1462
- state: newColState,
1463
+ state: newColumnsState,
1463
1464
  applyOrder: true,
1464
1465
  });
1465
1466
  this.api.gridApi.setColumnSorts(layout.ColumnSorts);
@@ -1497,9 +1498,8 @@ class Adaptable {
1497
1498
  (_a = this.gridOptions.columnApi) === null || _a === void 0 ? void 0 : _a.autoSizeAllColumns();
1498
1499
  }, 200);
1499
1500
  }, 100);
1500
- return;
1501
1501
  }
1502
- if (((_f = (_e = this.adaptableOptions) === null || _e === void 0 ? void 0 : _e.layoutOptions) === null || _f === void 0 ? void 0 : _f.autoSizeColumnsInLayout) &&
1502
+ else if (((_f = (_e = this.adaptableOptions) === null || _e === void 0 ? void 0 : _e.layoutOptions) === null || _f === void 0 ? void 0 : _f.autoSizeColumnsInLayout) &&
1503
1503
  colsToAutoSizeArray.length) {
1504
1504
  (_g = this.gridOptions.columnApi) === null || _g === void 0 ? void 0 : _g.autoSizeColumns(colsToAutoSizeArray);
1505
1505
  }