@adaptabletools/adaptable 18.1.12-canary.0 → 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",
3
- "version": "18.1.12-canary.0",
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",
@@ -41,7 +41,7 @@ export interface AgGridConfig {
41
41
  */
42
42
  gridOptions: GridOptions;
43
43
  /**
44
- * AG Grid Modules
44
+ * AG Grid Modules to use; provide empty array if using CJS
45
45
  */
46
46
  modules: Module[];
47
47
  }
@@ -94,11 +94,6 @@ export interface AdaptableOptions<TData = any> {
94
94
  * Options for managing Action Rows
95
95
  */
96
96
  actionRowOptions?: ActionRowOptions<TData>;
97
- /**
98
- * Options for managing AdapTableQL Expressions
99
- * @noCodeContainer
100
- */
101
- expressionOptions?: ExpressionOptions<TData>;
102
97
  /**
103
98
  * Options for managing Alerts in AdapTable
104
99
  *
@@ -125,17 +120,33 @@ export interface AdaptableOptions<TData = any> {
125
120
  */
126
121
  columnOptions?: ColumnOptions;
127
122
  /**
128
- * Options for setting the 'Div' elements in which AdapTable, AG Grid, popups are placed
123
+ * Options for managing Column Filters in AdapTable
124
+ *
125
+ * @gridInfoContainer
126
+ * @noCodeContainer
127
+ *
129
128
  */
130
- containerOptions?: ContainerOptions;
129
+ columnFilterOptions?: ColumnFilterOptions<TData>;
131
130
  /**
132
- * Options for managing personal Notes
131
+ * Options for managing AdapTable Column Menu
132
+ *
133
+ * @gridInfoContainer
133
134
  */
134
- noteOptions?: NoteOptions;
135
+ columnMenuOptions?: ColumnMenuOptions<TData>;
135
136
  /**
136
137
  * Options for managing collaborative Comments
137
138
  */
138
139
  commentOptions?: CommentOptions<TData>;
140
+ /**
141
+ * Options for setting the 'Div' elements in which AdapTable, AG Grid, popups are placed
142
+ */
143
+ containerOptions?: ContainerOptions;
144
+ /**
145
+ * Options for managing AdapTable Context Menu
146
+ *
147
+ * @gridInfoContainer
148
+ */
149
+ contextMenuOptions?: ContextMenuOptions<TData>;
139
150
  /**
140
151
  * Options for using Custom Sort
141
152
  */
@@ -154,6 +165,10 @@ export interface AdaptableOptions<TData = any> {
154
165
  * @noCodeContainer
155
166
  */
156
167
  dataChangeHistoryOptions?: DataChangeHistoryOptions<TData>;
168
+ /**
169
+ * Options for managing the Data Import function
170
+ */
171
+ dataImportOptions?: DataImportOptions;
157
172
  /**
158
173
  * Options to manage Data Sets
159
174
  */
@@ -176,18 +191,25 @@ export interface AdaptableOptions<TData = any> {
176
191
  * @gridInfoContainer
177
192
  */
178
193
  exportOptions?: ExportOptions;
194
+ /**
195
+ * Options for managing AdapTableQL Expressions
196
+ * @noCodeContainer
197
+ */
198
+ expressionOptions?: ExpressionOptions<TData>;
179
199
  /**
180
200
  * Options for managing FDC3 in AdapTable
181
201
  */
182
202
  fdc3Options?: Fdc3Options;
183
203
  /**
184
- * Options for managing Column Filters in AdapTable
204
+ * Options for managing Flashing Cells - primarily default values
185
205
  *
186
206
  * @gridInfoContainer
187
- * @noCodeContainer
188
- *
189
207
  */
190
- columnFilterOptions?: ColumnFilterOptions<TData>;
208
+ flashingCellOptions?: FlashingCellOptions;
209
+ /**
210
+ * Options for providing Custom Display Formats
211
+ */
212
+ formatColumnOptions?: FormatColumnOptions;
191
213
  /**
192
214
  * Options for managing the Grid Filter in AdapTable
193
215
  *
@@ -196,16 +218,6 @@ export interface AdaptableOptions<TData = any> {
196
218
  *
197
219
  */
198
220
  gridFilterOptions?: GridFilterOptions<TData>;
199
- /**
200
- * Options for managing Flashing Cells - primarily default values
201
- *
202
- * @gridInfoContainer
203
- */
204
- flashingCellOptions?: FlashingCellOptions;
205
- /**
206
- * Options for providing Custom Display Formats
207
- */
208
- formatColumnOptions?: FormatColumnOptions;
209
221
  /**
210
222
  * Options related to Row Grouping
211
223
  *
@@ -221,17 +233,9 @@ export interface AdaptableOptions<TData = any> {
221
233
  */
222
234
  layoutOptions?: LayoutOptions;
223
235
  /**
224
- * Options for managing AdapTable Column Menu
225
- *
226
- * @gridInfoContainer
227
- */
228
- columnMenuOptions?: ColumnMenuOptions<TData>;
229
- /**
230
- * Options for managing AdapTable Context Menu
231
- *
232
- * @gridInfoContainer
236
+ * Options for managing personal Notes
233
237
  */
234
- contextMenuOptions?: ContextMenuOptions<TData>;
238
+ noteOptions?: NoteOptions;
235
239
  /**
236
240
  * Options for managing Notifications in AdapTable
237
241
  *
@@ -280,10 +284,6 @@ export interface AdaptableOptions<TData = any> {
280
284
  * @gridInfoContainer
281
285
  */
282
286
  userInterfaceOptions?: UserInterfaceOptions<TData>;
283
- /**
284
- * Options for managing the Data Import function
285
- */
286
- dataImportOptions?: DataImportOptions;
287
287
  /**
288
288
  * Used for managing the AdapTable Plugins
289
289
  */
@@ -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
  /**
@@ -53,13 +53,13 @@ export class GridApiImpl extends ApiBase {
53
53
  }
54
54
  async updateGridData(dataRows, dataUpdateConfig) {
55
55
  const rowNodes = await this.adaptable.updateRows(dataRows, dataUpdateConfig);
56
- this.internalApi.fireGridDataChangedEvent(dataRows, rowNodes, 'Edit');
56
+ this.internalApi.fireGridDataChangedEvent(dataRows, rowNodes, 'Update');
57
57
  return rowNodes;
58
58
  }
59
59
  async addOrUpdateGridData(dataRows, dataUpdateConfig) {
60
60
  const { added, updated } = await this.adaptable.addOrUpdateRows(dataRows, dataUpdateConfig);
61
61
  if (ArrayExtensions.IsNotNullOrEmpty(updated)) {
62
- this.internalApi.fireGridDataChangedEvent(dataRows, updated, 'Edit');
62
+ this.internalApi.fireGridDataChangedEvent(dataRows, updated, 'Update');
63
63
  }
64
64
  if (ArrayExtensions.IsNotNullOrEmpty(added)) {
65
65
  this.internalApi.fireGridDataChangedEvent(dataRows, added, 'Add');
@@ -38,12 +38,16 @@ export class LayoutApiImpl extends ApiBase {
38
38
  return this.getCurrentLayout().RowGroupedColumns;
39
39
  }
40
40
  setLayout(layoutName) {
41
- if (StringExtensions.IsNotNullOrEmpty(layoutName) &&
42
- layoutName !== this.getCurrentLayoutName()) {
43
- let layout = this.getAdaptableState().Layout.Layouts.find((l) => l.Name == layoutName);
44
- if (this.checkItemExists(layout, layoutName, 'Layout')) {
45
- this.dispatchAction(LayoutRedux.LayoutSelect(layoutName));
46
- }
41
+ var _a;
42
+ if (StringExtensions.IsNullOrEmpty(layoutName)) {
43
+ return;
44
+ }
45
+ if (((_a = this.getLayoutOptions()) === null || _a === void 0 ? void 0 : _a.autoSaveLayouts) && layoutName === this.getCurrentLayoutName()) {
46
+ return;
47
+ }
48
+ let layout = this.getLayoutByName(layoutName);
49
+ if (this.checkItemExists(layout, layoutName, 'Layout')) {
50
+ this.dispatchAction(LayoutRedux.LayoutSelect(layoutName));
47
51
  }
48
52
  }
49
53
  getCurrentLayout() {
@@ -43,10 +43,6 @@ export interface PredefinedConfig {
43
43
  * Supplies a collection of *Custom Sort* objects to allow some columns to be sorted in non-standard (e.g. non alphabetical) ways
44
44
  */
45
45
  CustomSort?: CustomSortState;
46
- /**
47
- * Collection of personal Notes that are edited at Cell level
48
- */
49
- Note?: NoteState;
50
46
  /**
51
47
  * Large series of properties to give users full control over the look and feel of the *Dashboard* - the section above the grid with toolbars and buttons
52
48
  */
@@ -71,14 +67,18 @@ export interface PredefinedConfig {
71
67
  * Supplies a collection of *Layout* objects to name and manage groups of column visibility, order and sorts.
72
68
  */
73
69
  Layout?: LayoutState;
74
- /**
75
- * Supplies a collection of *PlusMinus* rule objects to stipulate what happens when the user clicks '+' or '-' in a numeric cell
76
- */
77
- PlusMinus?: PlusMinusState;
78
70
  /**
79
71
  * Named Queries available for use across multiple AdapTable Modules; and `CurrentQuery` - an Expression to run at start-up
80
72
  */
81
73
  NamedQuery?: NamedQueryState;
74
+ /**
75
+ * Collection of personal Notes that are edited at Cell level
76
+ */
77
+ Note?: NoteState;
78
+ /**
79
+ * Supplies a collection of *PlusMinus* rule objects to stipulate what happens when the user clicks '+' or '-' in a numeric cell
80
+ */
81
+ PlusMinus?: PlusMinusState;
82
82
  /**
83
83
  * Configues how Quick Search will run i.e. how and whether to highlight matching cells and to filter out non-matching rows
84
84
  */
@@ -39,7 +39,7 @@ export class AlertModule extends AdaptableModuleBase {
39
39
  this.handleCellDataChanged(cellDataChangedInfo);
40
40
  });
41
41
  this.api.eventApi.on('GridDataChanged', (gridDataChangedInfo) => {
42
- if (gridDataChangedInfo.rowTrigger === 'Edit') {
42
+ if (gridDataChangedInfo.rowTrigger === 'Update') {
43
43
  // changed row alerts should be handled by standard 'AnyChange' Predicate
44
44
  return;
45
45
  }
@@ -148,6 +148,10 @@ export const QuickFilterValues = (props) => {
148
148
  display: 'flex',
149
149
  flexFlow: 'column',
150
150
  flexWrap: 'nowrap',
151
+ }, handleClasses: {
152
+ right: 'ab-QuickFilter-resize-handle ab-QuickFilter-resize-handle--right',
153
+ bottom: 'ab-QuickFilter-resize-handle ab-QuickFilter-resize-handle--bottom',
154
+ bottomRight: 'ab-QuickFilter-resize-handle ab-QuickFilter-resize-handle--bottom-right',
151
155
  }, enable: {
152
156
  top: false,
153
157
  right: true,
@@ -8,7 +8,7 @@ import Emitter from '../Utilities/Emitter';
8
8
  import { applyDefaultAdaptableOptions } from './defaultAdaptableOptions';
9
9
  import { AgGridAdapter } from './AgGridAdapter';
10
10
  import * as GeneralConstants from '../Utilities/Constants/GeneralConstants';
11
- import { AB_FDC3_COLUMN, AB_SPECIAL_COLUMN, ADAPTABLE_ROW_ACTION_BUTTONS, AUTOGENERATED_PK_COLUMN, DARK_THEME, DEFAULT_LAYOUT, GROUP_PATH_SEPARATOR, HALF_SECOND, LIGHT_THEME, } from '../Utilities/Constants/GeneralConstants';
11
+ import { AB_FDC3_COLUMN, AB_SPECIAL_COLUMN, ADAPTABLE_ROW_ACTION_BUTTONS, AG_GRID_GROUPED_COLUMN, AUTOGENERATED_PK_COLUMN, DARK_THEME, DEFAULT_LAYOUT, GROUP_PATH_SEPARATOR, HALF_SECOND, LIGHT_THEME, } from '../Utilities/Constants/GeneralConstants';
12
12
  import { DataService } from '../Utilities/Services/DataService';
13
13
  import { AdaptableStore } from '../Redux/Store/AdaptableStore';
14
14
  import { AdaptableApiImpl } from '../Api/Implementation/AdaptableApiImpl';
@@ -435,7 +435,7 @@ export class AdaptableAgGrid {
435
435
  normaliseLayoutState(state, gridOptions) {
436
436
  var _a, _b, _c, _d, _e, _f;
437
437
  if (this.shouldCreateDefaultLayout(state, this.adaptableOptions)) {
438
- const defaultLayout = this.createDefaultLayout(state, gridOptions.columnDefs);
438
+ const defaultLayout = this.createDefaultLayout(state, gridOptions.columnDefs, gridOptions.autoGroupColumnDef);
439
439
  const layoutState = state.Layout || {};
440
440
  const availableLayouts = layoutState.Layouts || [];
441
441
  availableLayouts.push(defaultLayout);
@@ -3730,9 +3730,9 @@ export class AdaptableAgGrid {
3730
3730
  }
3731
3731
  return !((_c = layoutState.Layouts) === null || _c === void 0 ? void 0 : _c.length);
3732
3732
  }
3733
- createDefaultLayout(state, gridOptionsColDefs) {
3734
- var _a, _b;
3735
- const allColumnDefs = this.agGridAdapter.getFlattenedColDefs(gridOptionsColDefs);
3733
+ createDefaultLayout(state, agGridColDefs, agGridAutoGroupColDef) {
3734
+ var _a, _b, _c;
3735
+ const allColumnDefs = this.agGridAdapter.getFlattenedColDefs(agGridColDefs);
3736
3736
  const defaultLayout = ObjectFactory.CreateEmptyLayout({
3737
3737
  Name: DEFAULT_LAYOUT,
3738
3738
  Columns: allColumnDefs.map((c) => c.colId),
@@ -3756,12 +3756,23 @@ export class AdaptableAgGrid {
3756
3756
  return acc;
3757
3757
  }, []),
3758
3758
  });
3759
+ // handle optional 'gridOptions.autoGroupColumnDefs' parameter
3760
+ if (agGridAutoGroupColDef && ((_a = defaultLayout.RowGroupedColumns) === null || _a === void 0 ? void 0 : _a.length)) {
3761
+ defaultLayout.Columns = [AG_GRID_GROUPED_COLUMN, ...defaultLayout.Columns];
3762
+ }
3763
+ if (agGridAutoGroupColDef === null || agGridAutoGroupColDef === void 0 ? void 0 : agGridAutoGroupColDef.pinned) {
3764
+ defaultLayout.PinnedColumnsMap[AG_GRID_GROUPED_COLUMN] =
3765
+ agGridAutoGroupColDef.pinned === true ? 'left' : agGridAutoGroupColDef.pinned;
3766
+ }
3767
+ if (agGridAutoGroupColDef === null || agGridAutoGroupColDef === void 0 ? void 0 : agGridAutoGroupColDef.width) {
3768
+ defaultLayout.ColumnWidthMap[AG_GRID_GROUPED_COLUMN] = agGridAutoGroupColDef.width;
3769
+ }
3759
3770
  // ADD special columns
3760
- const calculatedColumns = ((_a = state.CalculatedColumn) === null || _a === void 0 ? void 0 : _a.CalculatedColumns) || [];
3771
+ const calculatedColumns = ((_b = state.CalculatedColumn) === null || _b === void 0 ? void 0 : _b.CalculatedColumns) || [];
3761
3772
  if (calculatedColumns.length) {
3762
3773
  defaultLayout.Columns.push(...calculatedColumns.map((c) => c.ColumnId));
3763
3774
  }
3764
- const freeTextColumns = ((_b = state.FreeTextColumn) === null || _b === void 0 ? void 0 : _b.FreeTextColumns) || [];
3775
+ const freeTextColumns = ((_c = state.FreeTextColumn) === null || _c === void 0 ? void 0 : _c.FreeTextColumns) || [];
3765
3776
  if (freeTextColumns.length) {
3766
3777
  defaultLayout.Columns.push(...freeTextColumns.map((c) => c.ColumnId));
3767
3778
  }
@@ -3778,13 +3789,11 @@ export class AdaptableAgGrid {
3778
3789
  const expandedState = agGridApi.getState().rowGroupExpansion || { expandedRowGroupIds: [] };
3779
3790
  const currentLayoutState = { columnState, expandedState };
3780
3791
  try {
3781
- // TODO
3782
3792
  const stringifiedLayoutState = JSON.stringify(currentLayoutState);
3783
3793
  if (stringifiedLayoutState === this.previousAgGridLayoutState) {
3784
3794
  // same grid column state as a previous,
3785
3795
  // so no need to update, as the layout has already been updated
3786
3796
  // for this grid column state
3787
- // console.log('same state as before');
3788
3797
  return;
3789
3798
  }
3790
3799
  this.previousAgGridLayoutState = stringifiedLayoutState;
@@ -4005,6 +4014,16 @@ export class AdaptableAgGrid {
4005
4014
  const passedColumnDefs = options.columnDefs;
4006
4015
  if (passedColumnDefs) {
4007
4016
  const colDefsWithSpecialColumns = self.getColumnDefinitionsInclSpecialColumns(passedColumnDefs);
4017
+ const allDisplayedColIds = self.agGridAdapter
4018
+ .getAgGridApi()
4019
+ .getAllDisplayedColumns()
4020
+ .map((col) => col.getColId());
4021
+ // mark as hidden the colDefs of special columns which are not visible
4022
+ self.agGridAdapter.patchColDefs(colDefsWithSpecialColumns, (colDef) => {
4023
+ if (self.api.columnApi.isSpecialColumn(colDef.colId)) {
4024
+ colDef.hide = !allDisplayedColIds.includes(colDef.colId);
4025
+ }
4026
+ });
4008
4027
  options['columnDefs'] = colDefsWithSpecialColumns;
4009
4028
  self.logger.info(`Added SpecialColumns on GridOptions.columnDefs update (source=${source})`);
4010
4029
  }
@@ -60,6 +60,7 @@ export declare class AgGridAdapter {
60
60
  * Mutates the colDefs to ensure that each column has a colId
61
61
  */
62
62
  assignColumnIdsToColDefs(colDefs?: (ColDef | ColGroupDef)[]): void;
63
+ patchColDefs(colDefs: (ColDef | ColGroupDef)[], patchFn: (colDef: ColDef) => void): void;
63
64
  getDefaultColumnDefinition(): GridOptions['defaultColDef'];
64
65
  _agGridApi_getValue(colKey: string | Column, rowNode: IRowNode, gridApi?: GridApi): any;
65
66
  }
@@ -570,16 +570,25 @@ export class AgGridAdapter {
570
570
  if (colDef.field && !colDef.colId) {
571
571
  colDef.colId = colDef.field;
572
572
  }
573
- if (colDef.children) {
574
- colDef.children.forEach((colDef) => assignColId(colDef));
573
+ if (!colDef.colId) {
574
+ this.logger.warn('A column is missing the colId - please check ', colDef, 'Either pass a "field" property or a "colId" property.');
575
575
  }
576
- else {
577
- if (!colDef.colId) {
578
- this.logger.warn('A column is missing the colId - please check ', colDef, 'Either pass a "field" property or a "colId" property.');
579
- }
576
+ };
577
+ this.patchColDefs(colDefs, assignColId);
578
+ }
579
+ patchColDefs(colDefs = [], patchFn) {
580
+ const applyPatch = (colDef) => {
581
+ if (!colDef) {
582
+ return;
583
+ }
584
+ if (!colDef.children) {
585
+ patchFn(colDef);
586
+ }
587
+ if (colDef.children) {
588
+ colDef.children.forEach((childColDef) => applyPatch(childColDef));
580
589
  }
581
590
  };
582
- colDefs.forEach((colDef) => assignColId(colDef));
591
+ colDefs.forEach((colDef) => applyPatch(colDef));
583
592
  }
584
593
  getDefaultColumnDefinition() {
585
594
  var _a, _b;
package/src/env.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export default {
2
2
  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: 1721711329974 || Date.now(),
4
- VERSION: "18.1.12-canary.0" || '--current-version--',
3
+ PUBLISH_TIMESTAMP: 1722341695319 || Date.now(),
4
+ VERSION: "18.1.13" || '--current-version--',
5
5
  };