@adaptabletools/adaptable-cjs 18.1.12 → 18.1.13

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-cjs",
3
- "version": "18.1.12",
3
+ "version": "18.1.13",
4
4
  "description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [
6
6
  "web-components",
@@ -1,6 +1,6 @@
1
1
  import { IRowNode } from '@ag-grid-community/core';
2
2
  import { BaseEventInfo } from './BaseEventInfo';
3
- export type GridDataChangeTrigger = 'Add' | 'Edit' | 'Delete' | 'Load';
3
+ export type GridDataChangeTrigger = 'Add' | 'Update' | 'Delete' | 'Load';
4
4
  /**
5
5
  * EventInfo returned by GridDataChanged event
6
6
  */ export interface GridDataChangedInfo<TData = any> extends BaseEventInfo {
@@ -13,7 +13,7 @@ export type GridDataChangeTrigger = 'Add' | 'Edit' | 'Delete' | 'Load';
13
13
  */
14
14
  dataRows: TData[];
15
15
  /**
16
- * Trigger for row change: Load, Add, Edit, or Delete
16
+ * Trigger for row change: Load, Add, Update, or Delete
17
17
  */
18
18
  rowTrigger: GridDataChangeTrigger;
19
19
  /**
@@ -57,13 +57,13 @@ class GridApiImpl extends ApiBase_1.ApiBase {
57
57
  }
58
58
  async updateGridData(dataRows, dataUpdateConfig) {
59
59
  const rowNodes = await this.adaptable.updateRows(dataRows, dataUpdateConfig);
60
- this.internalApi.fireGridDataChangedEvent(dataRows, rowNodes, 'Edit');
60
+ this.internalApi.fireGridDataChangedEvent(dataRows, rowNodes, 'Update');
61
61
  return rowNodes;
62
62
  }
63
63
  async addOrUpdateGridData(dataRows, dataUpdateConfig) {
64
64
  const { added, updated } = await this.adaptable.addOrUpdateRows(dataRows, dataUpdateConfig);
65
65
  if (ArrayExtensions_1.default.IsNotNullOrEmpty(updated)) {
66
- this.internalApi.fireGridDataChangedEvent(dataRows, updated, 'Edit');
66
+ this.internalApi.fireGridDataChangedEvent(dataRows, updated, 'Update');
67
67
  }
68
68
  if (ArrayExtensions_1.default.IsNotNullOrEmpty(added)) {
69
69
  this.internalApi.fireGridDataChangedEvent(dataRows, added, 'Add');
@@ -42,12 +42,16 @@ class LayoutApiImpl extends ApiBase_1.ApiBase {
42
42
  return this.getCurrentLayout().RowGroupedColumns;
43
43
  }
44
44
  setLayout(layoutName) {
45
- if (StringExtensions_1.default.IsNotNullOrEmpty(layoutName) &&
46
- layoutName !== this.getCurrentLayoutName()) {
47
- let layout = this.getAdaptableState().Layout.Layouts.find((l) => l.Name == layoutName);
48
- if (this.checkItemExists(layout, layoutName, 'Layout')) {
49
- this.dispatchAction(LayoutRedux.LayoutSelect(layoutName));
50
- }
45
+ var _a;
46
+ if (StringExtensions_1.default.IsNullOrEmpty(layoutName)) {
47
+ return;
48
+ }
49
+ if (((_a = this.getLayoutOptions()) === null || _a === void 0 ? void 0 : _a.autoSaveLayouts) && layoutName === this.getCurrentLayoutName()) {
50
+ return;
51
+ }
52
+ let layout = this.getLayoutByName(layoutName);
53
+ if (this.checkItemExists(layout, layoutName, 'Layout')) {
54
+ this.dispatchAction(LayoutRedux.LayoutSelect(layoutName));
51
55
  }
52
56
  }
53
57
  getCurrentLayout() {
@@ -43,7 +43,7 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
43
43
  this.handleCellDataChanged(cellDataChangedInfo);
44
44
  });
45
45
  this.api.eventApi.on('GridDataChanged', (gridDataChangedInfo) => {
46
- if (gridDataChangedInfo.rowTrigger === 'Edit') {
46
+ if (gridDataChangedInfo.rowTrigger === 'Update') {
47
47
  // changed row alerts should be handled by standard 'AnyChange' Predicate
48
48
  return;
49
49
  }
@@ -152,6 +152,10 @@ const QuickFilterValues = (props) => {
152
152
  display: 'flex',
153
153
  flexFlow: 'column',
154
154
  flexWrap: 'nowrap',
155
+ }, handleClasses: {
156
+ right: 'ab-QuickFilter-resize-handle ab-QuickFilter-resize-handle--right',
157
+ bottom: 'ab-QuickFilter-resize-handle ab-QuickFilter-resize-handle--bottom',
158
+ bottomRight: 'ab-QuickFilter-resize-handle ab-QuickFilter-resize-handle--bottom-right',
155
159
  }, enable: {
156
160
  top: false,
157
161
  right: true,
@@ -439,7 +439,7 @@ class AdaptableAgGrid {
439
439
  normaliseLayoutState(state, gridOptions) {
440
440
  var _a, _b, _c, _d, _e, _f;
441
441
  if (this.shouldCreateDefaultLayout(state, this.adaptableOptions)) {
442
- const defaultLayout = this.createDefaultLayout(state, gridOptions.columnDefs);
442
+ const defaultLayout = this.createDefaultLayout(state, gridOptions.columnDefs, gridOptions.autoGroupColumnDef);
443
443
  const layoutState = state.Layout || {};
444
444
  const availableLayouts = layoutState.Layouts || [];
445
445
  availableLayouts.push(defaultLayout);
@@ -3734,9 +3734,9 @@ class AdaptableAgGrid {
3734
3734
  }
3735
3735
  return !((_c = layoutState.Layouts) === null || _c === void 0 ? void 0 : _c.length);
3736
3736
  }
3737
- createDefaultLayout(state, gridOptionsColDefs) {
3738
- var _a, _b;
3739
- const allColumnDefs = this.agGridAdapter.getFlattenedColDefs(gridOptionsColDefs);
3737
+ createDefaultLayout(state, agGridColDefs, agGridAutoGroupColDef) {
3738
+ var _a, _b, _c;
3739
+ const allColumnDefs = this.agGridAdapter.getFlattenedColDefs(agGridColDefs);
3740
3740
  const defaultLayout = ObjectFactory_1.default.CreateEmptyLayout({
3741
3741
  Name: GeneralConstants_1.DEFAULT_LAYOUT,
3742
3742
  Columns: allColumnDefs.map((c) => c.colId),
@@ -3760,12 +3760,23 @@ class AdaptableAgGrid {
3760
3760
  return acc;
3761
3761
  }, []),
3762
3762
  });
3763
+ // handle optional 'gridOptions.autoGroupColumnDefs' parameter
3764
+ if (agGridAutoGroupColDef && ((_a = defaultLayout.RowGroupedColumns) === null || _a === void 0 ? void 0 : _a.length)) {
3765
+ defaultLayout.Columns = [GeneralConstants_1.AG_GRID_GROUPED_COLUMN, ...defaultLayout.Columns];
3766
+ }
3767
+ if (agGridAutoGroupColDef === null || agGridAutoGroupColDef === void 0 ? void 0 : agGridAutoGroupColDef.pinned) {
3768
+ defaultLayout.PinnedColumnsMap[GeneralConstants_1.AG_GRID_GROUPED_COLUMN] =
3769
+ agGridAutoGroupColDef.pinned === true ? 'left' : agGridAutoGroupColDef.pinned;
3770
+ }
3771
+ if (agGridAutoGroupColDef === null || agGridAutoGroupColDef === void 0 ? void 0 : agGridAutoGroupColDef.width) {
3772
+ defaultLayout.ColumnWidthMap[GeneralConstants_1.AG_GRID_GROUPED_COLUMN] = agGridAutoGroupColDef.width;
3773
+ }
3763
3774
  // ADD special columns
3764
- const calculatedColumns = ((_a = state.CalculatedColumn) === null || _a === void 0 ? void 0 : _a.CalculatedColumns) || [];
3775
+ const calculatedColumns = ((_b = state.CalculatedColumn) === null || _b === void 0 ? void 0 : _b.CalculatedColumns) || [];
3765
3776
  if (calculatedColumns.length) {
3766
3777
  defaultLayout.Columns.push(...calculatedColumns.map((c) => c.ColumnId));
3767
3778
  }
3768
- const freeTextColumns = ((_b = state.FreeTextColumn) === null || _b === void 0 ? void 0 : _b.FreeTextColumns) || [];
3779
+ const freeTextColumns = ((_c = state.FreeTextColumn) === null || _c === void 0 ? void 0 : _c.FreeTextColumns) || [];
3769
3780
  if (freeTextColumns.length) {
3770
3781
  defaultLayout.Columns.push(...freeTextColumns.map((c) => c.ColumnId));
3771
3782
  }
package/src/env.js CHANGED
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  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: 1721914565202 || Date.now(),
6
- VERSION: "18.1.12" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1722341727251 || Date.now(),
6
+ VERSION: "18.1.13" || '--current-version--',
7
7
  };
package/src/types.d.ts CHANGED
@@ -120,7 +120,7 @@ export type { FlashingCellDisplayedInfo } from './Api/Events/FlashingCellDisplay
120
120
  export type { SystemStatusMessageDisplayedInfo } from './Api/Events/SystemStatusMessageDisplayed';
121
121
  export type { CellChangedInfo } from './Api/Events/CellChanged';
122
122
  export type { TeamSharingEntityChangedInfo } from './Api/Events/TeamSharingEntityChanged';
123
- export type { GridDataChangedInfo } from './Api/Events/GridDataChanged';
123
+ export type { GridDataChangedInfo, GridDataChangeTrigger } from './Api/Events/GridDataChanged';
124
124
  export type { LayoutChangedInfo } from './Api/Events/LayoutChanged';
125
125
  export type { CalculatedColumnChangedInfo } from './Api/Events/CalculatedColumnChanged';
126
126
  export type { CustomToolbarConfiguredInfo } from './Api/Events/CustomToolbarConfigured';