@adaptabletools/adaptable-cjs 18.0.0-canary.20 → 18.0.0-canary.22

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 (45) hide show
  1. package/package.json +1 -1
  2. package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -1
  3. package/src/AdaptableOptions/AdaptableOptions.d.ts +0 -6
  4. package/src/AdaptableOptions/CommentOptions.d.ts +7 -1
  5. package/src/AdaptableOptions/GroupingOptions.d.ts +0 -4
  6. package/src/AdaptableOptions/NoteOptions.d.ts +8 -2
  7. package/src/AdaptableOptions/StateOptions.d.ts +6 -0
  8. package/src/Api/ColumnApi.d.ts +5 -0
  9. package/src/Api/CommentApi.d.ts +2 -2
  10. package/src/Api/Implementation/ColumnApiImpl.d.ts +3 -0
  11. package/src/Api/Implementation/ColumnApiImpl.js +22 -7
  12. package/src/Api/Implementation/ConfigApiImpl.js +3 -0
  13. package/src/Api/Implementation/GridApiImpl.js +3 -1
  14. package/src/Api/Implementation/ScopeApiImpl.js +34 -1
  15. package/src/Api/Internal/ActionRowInternalApi.d.ts +1 -0
  16. package/src/Api/Internal/ActionRowInternalApi.js +12 -1
  17. package/src/Api/Internal/ColumnInternalApi.d.ts +2 -0
  18. package/src/Api/Internal/ColumnInternalApi.js +8 -1
  19. package/src/PredefinedConfig/Common/TransposeConfig.d.ts +5 -0
  20. package/src/Strategy/LayoutModule.js +6 -0
  21. package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
  22. package/src/Utilities/Constants/GeneralConstants.js +3 -2
  23. package/src/View/Comments/CommentsPopup.js +5 -2
  24. package/src/View/Components/CellPopup/index.js +1 -1
  25. package/src/View/Components/FilterForm/QuickFilterValues.js +39 -23
  26. package/src/View/DataImport/DataImportWizard/DataImportWizard.js +1 -1
  27. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +19 -6
  28. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +0 -5
  29. package/src/View/Layout/TransposedPopup.js +2 -2
  30. package/src/View/Note/NotePopup.js +5 -2
  31. package/src/agGrid/AdaptableAgGrid.d.ts +2 -0
  32. package/src/agGrid/AdaptableAgGrid.js +29 -66
  33. package/src/agGrid/AgGridAdapter.d.ts +1 -0
  34. package/src/agGrid/AgGridAdapter.js +4 -0
  35. package/src/agGrid/AgGridColumnAdapter.d.ts +0 -2
  36. package/src/agGrid/AgGridColumnAdapter.js +0 -43
  37. package/src/agGrid/buildSortedColumnStateForLayout.d.ts +7 -0
  38. package/src/agGrid/buildSortedColumnStateForLayout.js +124 -0
  39. package/src/agGrid/defaultAdaptableOptions.js +1 -2
  40. package/src/agGrid/sortColumnStateForVisibleColumns.d.ts +12 -0
  41. package/src/agGrid/sortColumnStateForVisibleColumns.js +50 -0
  42. package/src/env.js +2 -2
  43. package/src/metamodel/adaptable.metamodel.d.ts +29 -23
  44. package/src/metamodel/adaptable.metamodel.js +1 -1
  45. package/tsconfig.cjs.tsbuildinfo +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable-cjs",
3
- "version": "18.0.0-canary.20",
3
+ "version": "18.0.0-canary.22",
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",
@@ -10,7 +10,7 @@ import { SelectedCellInfo } from '../PredefinedConfig/Selection/SelectedCellInfo
10
10
  import { AdaptableTheme } from '../PredefinedConfig/ThemeState';
11
11
  import { IAdaptableStore } from '../Redux/Store/Interface/IAdaptableStore';
12
12
  import { IModuleCollection } from '../Strategy/Interface/IModule';
13
- import { AdaptableMenuItem, AdaptableOptions, AdaptablePlugin, ChartDefinition, SelectedRowInfo } from '../types';
13
+ import { AdaptableMenuItem, AdaptableOptions, AdaptablePlugin, AdaptableState, ChartDefinition, SelectedRowInfo } from '../types';
14
14
  import { ICalculatedColumnExpressionService } from '../Utilities/Services/Interface/ICalculatedColumnExpressionService';
15
15
  import { IDataService } from '../Utilities/Services/Interface/IDataService';
16
16
  import { CellPopupService } from '../Utilities/Services/CellPopupService';
@@ -265,4 +265,5 @@ export interface IAdaptable {
265
265
  canExportToExcel(): boolean;
266
266
  exportToExcel(reportData: ReportData, fileName: string): void;
267
267
  exportVisualDataToExcel(): void;
268
+ normalizeAdaptableState(state: AdaptableState, gridOptions: GridOptions): AdaptableState;
268
269
  }
@@ -65,12 +65,6 @@ export interface AdaptableOptions<TData = any> {
65
65
  * Commercial license key. If the license is not provided or is expired, various visual information notes will be displayed and some functionality may be limited.
66
66
  */
67
67
  licenseKey?: string;
68
- /**
69
- * Automatically migrate the state from the previous version of Adaptable to the current version.
70
- *
71
- * @defaultValue true
72
- */
73
- autoMigrateState?: boolean;
74
68
  /**
75
69
  * User State set at design-time and shipped with AdapTable for first use; can be `PredefinedConfig` object or url to file containing config
76
70
  *
@@ -12,10 +12,16 @@ export interface CommentOptions<TData = any> {
12
12
  */
13
13
  loadCommentThreads?(commentLoadContext: CommentLoadContext): Promise<CommentThread[]>;
14
14
  /**
15
- * Called when Comments change and need to be saved
15
+ * Saves changed Comments
16
16
  * @param commentThreads
17
17
  */
18
18
  persistCommentThreads?(commentThreads: CommentThread[]): void;
19
+ /**
20
+ * Format string for formatting in the Comments Popup
21
+ *
22
+ * @defaultValue 'dd-MM-yyyy HH:mm:ss'
23
+ */
24
+ dateFormat?: string;
19
25
  }
20
26
  /**
21
27
  * Context used when determining if a cell can show Comments
@@ -4,10 +4,6 @@ import { KeyCreatorParams } from '@ag-grid-community/core';
4
4
  * Options for managing Row and Column Groups in AdapTable
5
5
  */
6
6
  export interface GroupingOptions<TData = any> {
7
- /**
8
- * Value to use for 'Balanced Groups' (string columns only)
9
- */
10
- balancedGroupsKey?: string | ((context: BalancedGroupsKeyContext<TData>) => string);
11
7
  /**
12
8
  * Places ungrouped columns at pre-grouping indexed position
13
9
  * @defaultValue false
@@ -7,13 +7,19 @@ export interface NoteOptions<TData = any> {
7
7
  * Whether a cell can contain Notes
8
8
  */
9
9
  isCellNotable?: (context: NotableCellContext) => boolean;
10
+ /**
11
+ * Format string for formatting in the Notes Popup
12
+ *
13
+ * @defaultValue 'dd-MM-yyyy HH:mm:ss'
14
+ */
15
+ dateFormat?: string;
10
16
  }
11
17
  /**
12
18
  * Context used when determining if a Note can be added to a Cell
13
19
  */
14
20
  export interface NotableCellContext extends BaseContext {
15
21
  /**
16
- * Grid Cell in AdapTable which has been clicked
17
- */
22
+ * Grid Cell in AdapTable which has been clicked
23
+ */
18
24
  gridCell: GridCell;
19
25
  }
@@ -33,6 +33,12 @@ export interface StateOptions {
33
33
  * @defaultValue 400
34
34
  */
35
35
  debounceStateDelay?: number;
36
+ /**
37
+ * Automatically migrate the state from the previous version of Adaptable to the current version.
38
+ *
39
+ * @defaultValue true
40
+ */
41
+ autoMigrateState?: boolean;
36
42
  }
37
43
  /**
38
44
  * State Function Config object passed into all State Options functions (except 'applyState')
@@ -266,4 +266,9 @@ export interface ColumnApi {
266
266
  * Returns available columns types defined under columnOptions.columnTypes
267
267
  */
268
268
  getColumnTypes(): string[];
269
+ /**
270
+ * Returns all columns of a given columnType
271
+ * @param columnType the columnType to filter by
272
+ */
273
+ getColumnsByColumnType(columnType: string): AdaptableColumn[];
269
274
  }
@@ -8,9 +8,9 @@ export interface CommentApi {
8
8
  * Add a Comment to a Comment Thread
9
9
  *
10
10
  * @param comment comment
11
- * @param address where the comment should be added
11
+ * @param cellAddress cell where comment is added
12
12
  */
13
- addComment(commentText: string, address: CellAddress): void;
13
+ addComment(commentText: string, cellAddress: CellAddress): void;
14
14
  /**
15
15
  * Edit a Comment
16
16
  *
@@ -3,6 +3,8 @@ import { AdaptableColumn, AdaptableColumnDataType } from '../../PredefinedConfig
3
3
  import { ColumnApi } from '../ColumnApi';
4
4
  import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
5
5
  import { ColumnInternalApi } from '../Internal/ColumnInternalApi';
6
+ export declare function isAutoRowGroupColumn(columnId: string): boolean;
7
+ export declare function isAutoPivotColumn(columnId: string): boolean;
6
8
  export declare class ColumnApiImpl extends ApiBase implements ColumnApi {
7
9
  internalApi: ColumnInternalApi;
8
10
  constructor(adaptable: IAdaptable);
@@ -64,4 +66,5 @@ export declare class ColumnApiImpl extends ApiBase implements ColumnApi {
64
66
  isSpecialColumn(columnId: string): boolean;
65
67
  openColumnInfoSettingsPanel(): void;
66
68
  getColumnTypes(): string[];
69
+ getColumnsByColumnType(columnType: string): AdaptableColumn[];
67
70
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ColumnApiImpl = void 0;
3
+ exports.ColumnApiImpl = exports.isAutoPivotColumn = exports.isAutoRowGroupColumn = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ApiBase_1 = require("./ApiBase");
6
6
  const GeneralConstants = tslib_1.__importStar(require("../../Utilities/Constants/GeneralConstants"));
@@ -8,6 +8,18 @@ const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/
8
8
  const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
9
9
  const ColumnInternalApi_1 = require("../Internal/ColumnInternalApi");
10
10
  const ObjectFactory_1 = require("../../Utilities/ObjectFactory");
11
+ function isAutoRowGroupColumn(columnId) {
12
+ // put this here as there might be other indicators we are not aware of
13
+ // perhaps with non auto groups ?
14
+ //https://www.ag-grid.com/javascript-grid-grouping/
15
+ return columnId === null || columnId === void 0 ? void 0 : columnId.startsWith(GeneralConstants.AG_GRID_GROUPED_COLUMN);
16
+ }
17
+ exports.isAutoRowGroupColumn = isAutoRowGroupColumn;
18
+ function isAutoPivotColumn(columnId) {
19
+ // put this here as there might be other indicators we are not aware of?
20
+ return columnId === null || columnId === void 0 ? void 0 : columnId.startsWith(GeneralConstants.AG_GRID_PIVOT_COLUMN);
21
+ }
22
+ exports.isAutoPivotColumn = isAutoPivotColumn;
11
23
  class ColumnApiImpl extends ApiBase_1.ApiBase {
12
24
  constructor(adaptable) {
13
25
  super(adaptable);
@@ -56,14 +68,10 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
56
68
  this.adaptable.showColumn(columnId);
57
69
  }
58
70
  isAutoRowGroupColumn(columnId) {
59
- // put this here as there might be other indicators we are not aware of
60
- // perhaps with non auto groups ?
61
- //https://www.ag-grid.com/javascript-grid-grouping/
62
- return columnId === null || columnId === void 0 ? void 0 : columnId.startsWith(GeneralConstants.AG_GRID_GROUPED_COLUMN);
71
+ return isAutoRowGroupColumn(columnId);
63
72
  }
64
73
  isAutoPivotColumn(columnId) {
65
- // put this here as there might be other indicators we are not aware of?
66
- return columnId === null || columnId === void 0 ? void 0 : columnId.startsWith(GeneralConstants.AG_GRID_PIVOT_COLUMN);
74
+ return isAutoPivotColumn(columnId);
67
75
  }
68
76
  isCalculatedColumn(columnId) {
69
77
  return (this.adaptable.api.calculatedColumnApi
@@ -347,5 +355,12 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
347
355
  return columnTypes;
348
356
  }
349
357
  }
358
+ getColumnsByColumnType(columnType) {
359
+ const abColumns = this.getColumns();
360
+ return abColumns.filter((c) => {
361
+ var _a;
362
+ return ((_a = c.columnTypes) !== null && _a !== void 0 ? _a : []).includes(columnType);
363
+ });
364
+ }
350
365
  }
351
366
  exports.ColumnApiImpl = ColumnApiImpl;
@@ -137,6 +137,9 @@ class ConfigApiImpl extends ApiBase_1.ApiBase {
137
137
  adaptable: this.adaptable,
138
138
  adaptableStateKey,
139
139
  predefinedConfig,
140
+ postLoadHook: (state) => {
141
+ return this.adaptable.normalizeAdaptableState(state, this.adaptable.agGridAdapter.getLiveGridOptions());
142
+ },
140
143
  });
141
144
  promise
142
145
  .then(() => {
@@ -530,11 +530,12 @@ class GridApiImpl extends ApiBase_1.ApiBase {
530
530
  return this.getRowCount();
531
531
  }
532
532
  showTransposedView(transposeConfig = {}) {
533
- var _a, _b, _c, _d;
533
+ var _a, _b, _c, _d, _e;
534
534
  const transposedColumnId = (_a = transposeConfig.transposedColumnId) !== null && _a !== void 0 ? _a : this.getAdaptableApi().optionsApi.getPrimaryKey();
535
535
  const hideTransposedColumn = (_b = transposeConfig.hideTransposedColumn) !== null && _b !== void 0 ? _b : true;
536
536
  const visibleColumns = (_c = transposeConfig.visibleColumns) !== null && _c !== void 0 ? _c : false;
537
537
  const visibleRows = (_d = transposeConfig.visibleRows) !== null && _d !== void 0 ? _d : false;
538
+ const autosize = (_e = transposeConfig.autosize) !== null && _e !== void 0 ? _e : true;
538
539
  this.adaptable.api.internalApi.showPopupWindow({
539
540
  id: windowFactory_1.WINDOW_SHOW_TRANSPOSED_VIEW,
540
541
  factoryId: windowFactory_1.WINDOW_SHOW_TRANSPOSED_VIEW,
@@ -545,6 +546,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
545
546
  hideTransposedColumn,
546
547
  visibleColumns,
547
548
  visibleRows,
549
+ autosize,
548
550
  },
549
551
  });
550
552
  }
@@ -47,7 +47,9 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
47
47
  return 'Columns: All';
48
48
  }
49
49
  if ('ColumnTypes' in scope) {
50
- return ((scope.ColumnTypes.length > 0 ? 'ColumnTypes' : 'ColumnType') + ': ' + scope.ColumnTypes.join(', '));
50
+ return ((scope.ColumnTypes.length > 0 ? 'ColumnTypes' : 'ColumnType') +
51
+ ': ' +
52
+ scope.ColumnTypes.join(', '));
51
53
  }
52
54
  if ('DataTypes' in scope) {
53
55
  return ((scope.DataTypes.length > 0 ? 'DataTypes' : 'DataType') + ': ' + scope.DataTypes.join(', '));
@@ -164,6 +166,7 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
164
166
  return undefined;
165
167
  }
166
168
  isColumnInNumericScope(column, scope) {
169
+ var _a, _b;
167
170
  // if column is not even numeric then return false
168
171
  if (column == null || column == undefined || column.dataType !== 'Number') {
169
172
  return false;
@@ -180,9 +183,14 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
180
183
  if ('DataTypes' in scope && scope.DataTypes.includes('Number')) {
181
184
  return true;
182
185
  }
186
+ if ('ColumnTypes' in scope &&
187
+ ((_b = (_a = scope.ColumnTypes) === null || _a === void 0 ? void 0 : _a.some) === null || _b === void 0 ? void 0 : _b.call(_a, (scopeColumnType) => { var _a, _b; return (_b = (_a = column.columnTypes) === null || _a === void 0 ? void 0 : _a.includes) === null || _b === void 0 ? void 0 : _b.call(_a, scopeColumnType); }))) {
188
+ return true;
189
+ }
183
190
  return false;
184
191
  }
185
192
  isColumnInStringsScope(column, scope) {
193
+ var _a, _b;
186
194
  // if column is not even string then return false
187
195
  if (column == null || column == undefined || column.dataType !== 'String') {
188
196
  return false;
@@ -199,9 +207,14 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
199
207
  if ('DataTypes' in scope && scope.DataTypes.includes('String')) {
200
208
  return true;
201
209
  }
210
+ if ('ColumnTypes' in scope &&
211
+ ((_b = (_a = scope.ColumnTypes) === null || _a === void 0 ? void 0 : _a.some) === null || _b === void 0 ? void 0 : _b.call(_a, (scopeColumnType) => { var _a, _b; return (_b = (_a = column.columnTypes) === null || _a === void 0 ? void 0 : _a.includes) === null || _b === void 0 ? void 0 : _b.call(_a, scopeColumnType); }))) {
212
+ return true;
213
+ }
202
214
  return false;
203
215
  }
204
216
  isColumnInDateScope(column, scope) {
217
+ var _a, _b;
205
218
  // if column is not even numeric then return false
206
219
  if (column == null || column == undefined || column.dataType !== 'Date') {
207
220
  return false;
@@ -218,6 +231,10 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
218
231
  if ('DataTypes' in scope && scope.DataTypes.includes('Date')) {
219
232
  return true;
220
233
  }
234
+ if ('ColumnTypes' in scope &&
235
+ ((_b = (_a = scope.ColumnTypes) === null || _a === void 0 ? void 0 : _a.some) === null || _b === void 0 ? void 0 : _b.call(_a, (scopeColumnType) => { var _a, _b; return (_b = (_a = column.columnTypes) === null || _a === void 0 ? void 0 : _a.includes) === null || _b === void 0 ? void 0 : _b.call(_a, scopeColumnType); }))) {
236
+ return true;
237
+ }
221
238
  return false;
222
239
  }
223
240
  isScopeInScope(a, b) {
@@ -244,6 +261,22 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
244
261
  })) {
245
262
  return true;
246
263
  }
264
+ if ('ColumnTypes' in a &&
265
+ 'ColumnTypes' in b &&
266
+ a.ColumnTypes.every((columnType) => b.ColumnTypes.includes(columnType))) {
267
+ return true;
268
+ }
269
+ // check if each colum in a has column types in b
270
+ if ('ColumnIds' in a && 'ColumnTypes' in b) {
271
+ const inScope = a.ColumnIds.every((columnId) => {
272
+ const column = this.adaptable.api.columnApi.getColumnWithColumnId(columnId);
273
+ // check if at least one column-type is in scope
274
+ return column.columnTypes.some((columnColumnType) => b.ColumnTypes.includes(columnColumnType));
275
+ });
276
+ if (inScope) {
277
+ return true;
278
+ }
279
+ }
247
280
  return false;
248
281
  }
249
282
  createCellColorRangesForScope(scope) {
@@ -16,6 +16,7 @@ export declare class ActionRowInternalApi extends ApiBase {
16
16
  private buildActionRowFields;
17
17
  private showColumnInActionRowForm;
18
18
  private buidActionRowButtons;
19
+ private prepareCreateData;
19
20
  private prepareEditData;
20
21
  private isColumnEditable;
21
22
  private buildFormField;
@@ -104,7 +104,7 @@ class ActionRowInternalApi extends ApiBase_1.ApiBase {
104
104
  const eventInfo = type === 'rowCreated'
105
105
  ? {
106
106
  type: 'rowCreated',
107
- formData: context.formData,
107
+ formData: this.prepareCreateData(formFields, context),
108
108
  adaptableApi: context.adaptableApi,
109
109
  userName: this.getOptions().userName,
110
110
  adaptableId: this.getOptions().adaptableId,
@@ -124,6 +124,17 @@ class ActionRowInternalApi extends ApiBase_1.ApiBase {
124
124
  };
125
125
  return [cancelButton, saveButton];
126
126
  }
127
+ // private getNullValueForColumn(column: AdaptableColumn) {}
128
+ prepareCreateData(formFields, context) {
129
+ // when creating we just omit values that are not set
130
+ const dataToSave = Object.assign({}, context.formData);
131
+ for (const formField of formFields) {
132
+ if (dataToSave[formField.name] === '') {
133
+ delete dataToSave[formField.name];
134
+ }
135
+ }
136
+ return dataToSave;
137
+ }
127
138
  prepareEditData(formFields, context) {
128
139
  const dataToSave = Object.assign({}, context.formData);
129
140
  for (const formField of formFields) {
@@ -2,6 +2,7 @@ import { ApiBase } from '../Implementation/ApiBase';
2
2
  import { Column, IRowNode } from '@ag-grid-community/core';
3
3
  import { CustomSort } from '../../PredefinedConfig/CustomSortState';
4
4
  import { ColumnValuesComparer } from '../../AdaptableOptions/CustomSortOptions';
5
+ export declare function getAutoRowGroupColumnIdFor(columnId: string): string;
5
6
  export declare class ColumnInternalApi extends ApiBase {
6
7
  /**
7
8
  * Retrieves 'ColumnType' property for a given Column
@@ -15,6 +16,7 @@ export declare class ColumnInternalApi extends ApiBase {
15
16
  * Retrieves a list providing the Friendly Name / Caption for all columns
16
17
  */
17
18
  getAllColumnFriendlyNames(): string[];
19
+ getAutoRowGroupColumnIdFor(columnId: string): string;
18
20
  /**
19
21
  * Retrieves AG Grid's field property for the column
20
22
  * @param columnId columnId to look up
@@ -1,8 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ColumnInternalApi = void 0;
3
+ exports.ColumnInternalApi = exports.getAutoRowGroupColumnIdFor = void 0;
4
4
  const ApiBase_1 = require("../Implementation/ApiBase");
5
5
  const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
6
+ function getAutoRowGroupColumnIdFor(columnId) {
7
+ return `${GeneralConstants_1.AG_GRID_GROUPED_COLUMN}-${columnId}`;
8
+ }
9
+ exports.getAutoRowGroupColumnIdFor = getAutoRowGroupColumnIdFor;
6
10
  class ColumnInternalApi extends ApiBase_1.ApiBase {
7
11
  /**
8
12
  * Retrieves 'ColumnType' property for a given Column
@@ -24,6 +28,9 @@ class ColumnInternalApi extends ApiBase_1.ApiBase {
24
28
  return c.friendlyName;
25
29
  });
26
30
  }
31
+ getAutoRowGroupColumnIdFor(columnId) {
32
+ return getAutoRowGroupColumnIdFor(columnId);
33
+ }
27
34
  /**
28
35
  * Retrieves AG Grid's field property for the column
29
36
  * @param columnId columnId to look up
@@ -22,4 +22,9 @@ export interface TransposeConfig {
22
22
  * @defaultValue false
23
23
  */
24
24
  visibleRows?: boolean;
25
+ /**
26
+ * Autosize columns in transposed view
27
+ * @defaultValue true
28
+ */
29
+ autosize?: boolean;
25
30
  }
@@ -43,6 +43,9 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
43
43
  this.rowSummariesSubscribtions();
44
44
  }
45
45
  rowSummariesSubscribtions() {
46
+ if (this.api.isDestroyed()) {
47
+ return;
48
+ }
46
49
  // ROW SUMMARY
47
50
  this.evaluateRowSummary();
48
51
  this.api.eventApi.on('AdaptableStateReloaded', () => {
@@ -472,6 +475,9 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
472
475
  */
473
476
  evaluateRowSummary(reason) {
474
477
  var _a;
478
+ if (this.api.isDestroyed()) {
479
+ return;
480
+ }
475
481
  const currentLayout = this.api.layoutApi.getCurrentLayout();
476
482
  const rowSummaries = (_a = this.api.layoutApi.getCurrentLayout().RowSummaries) !== null && _a !== void 0 ? _a : [];
477
483
  const rowSummariesResults = rowSummaries.map(({ ColumnsMap, Position }) => {
@@ -35,6 +35,7 @@ export declare const ADAPTABLE_ROW_ACTION_BUTTONS = "adaptableRowActionButtons";
35
35
  export declare const ADAPTABLE_ROW_ACTION_BUTTONS_FRIENDLY_NAME = "(ActionRowButtons)";
36
36
  export declare const ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME = "(FDC3ActionColumn)";
37
37
  export declare const DEFAULT_DATE_FORMAT_PATTERN = "dd-MM-yyyy";
38
+ export declare const DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME = "dd-MM-yyyy HH:mm:ss";
38
39
  export declare const BLANK_DISTINCT_COLUMN_VALUE = "[BLANKS]";
39
40
  export declare const DEFAULT_STRING_DISPLAY_VALUE = "Hello World";
40
41
  export declare const DEFAULT_INTEGER_DISPLAY_VALUE = 12345;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ALERT_DEFAULT_SHOW_POPUP = exports.ALERT_DEFAULT_MESSAGE_TYPE = exports.PLUS_MINUS_DEFAULT_NUDGE_VALUE = exports.SERVER_VALIDATION_MESSAGE_TYPE = exports.SERVER_VALIDATION_HEADER = exports.DEFAULT_LIVE_REPORT_THROTTLE_TIME = exports.THEME_DEFAULT_CURRENT_THEME = exports.SYSTEM_DEFAULT_SYSTEM_STATUS_TYPE = exports.CELL_SUMMARY_DEFAULT_OPERATION = exports.QUICK_SEARCH_DEBOUNCE_TIME = exports.QUICK_SEARCH_DEFAULT_FORE_COLOR = exports.QUICK_SEARCH_DEFAULT_BACK_COLOR = exports.SYSTEM_STATUS_DEFAULT_MAX_MESSAGES_IN_STORE = exports.DEFAULT_DOUBLE_DISPLAY_VALUE = exports.DEFAULT_INTEGER_DISPLAY_VALUE = exports.DEFAULT_STRING_DISPLAY_VALUE = exports.BLANK_DISTINCT_COLUMN_VALUE = exports.DEFAULT_DATE_FORMAT_PATTERN = exports.ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME = exports.ADAPTABLE_ROW_ACTION_BUTTONS_FRIENDLY_NAME = exports.ADAPTABLE_ROW_ACTION_BUTTONS = exports.AG_GRID_CHART_WINDOW = exports.AG_GRID_PIVOT_COLUMN = exports.AG_GRID_GROUPED_COLUMN = exports.GROUP_PATH_SEPARATOR = exports.HALF_SECOND = exports.AB_FDC3_COLUMN = exports.AB_ROW_ACTIONS_COLUMN = exports.AB_SPECIAL_COLUMN = exports.EMPTY_ARRAY = exports.EMPTY_STRING = exports.FILTER_THROTTLE = exports.FILTER_NEVER = exports.FILTER_ALWAYS = exports.ALL_COLUMN_VALUES = exports.READ_ONLY_STYLE = exports.MENU_PREFIX = exports.AGGRID_TOOLPANEL_COLUMNS = exports.AGGRID_TOOLPANEL_FILTERS = exports.ADAPTABLE_TOOLPANEL_COMPONENT = exports.ADAPTABLE_TOOLPANEL_ID = exports.ADAPTABLE = exports.ADAPTABLE_ID = exports.USER_NAME = exports.OS_THEME = exports.DARK_THEME = exports.LIGHT_THEME = exports.DEFAULT_LAYOUT = exports.MISSING_COLUMN = exports.AUTOGENERATED_PK_COLUMN = void 0;
4
- exports.THEME_STYLE = exports.SELECTED_ROWS_REPORT = exports.SELECTED_CELLS_REPORT = exports.CURRENT_DATA_REPORT = exports.ALL_DATA_REPORT = exports.VISUAL_DATA_REPORT = exports.SYSTEM_THEMES = exports.SMART_EDIT_MATH_OPERATION_STATE_PROPERTY = exports.SMART_EDIT_VALUE_STATE_PROPERTY = exports.QUICK_SEARCH_STYLE_STATE_PROPERTY = exports.QUICK_SEARCH_TEXT_STATE_PROPERTY = exports.CURRENT_THEME_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DURATION_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DOWN_COLOR_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_UP_COLOR_STATE_PROPERTY = exports.CURRENT_REPORT_STATE_PROPERTY = exports.CURRENT_LAYOUT_STATE_PROPERTY = exports.SUMMARY_OPERATION_STATE_PROPERTY = void 0;
3
+ exports.ALERT_DEFAULT_MESSAGE_TYPE = exports.PLUS_MINUS_DEFAULT_NUDGE_VALUE = exports.SERVER_VALIDATION_MESSAGE_TYPE = exports.SERVER_VALIDATION_HEADER = exports.DEFAULT_LIVE_REPORT_THROTTLE_TIME = exports.THEME_DEFAULT_CURRENT_THEME = exports.SYSTEM_DEFAULT_SYSTEM_STATUS_TYPE = exports.CELL_SUMMARY_DEFAULT_OPERATION = exports.QUICK_SEARCH_DEBOUNCE_TIME = exports.QUICK_SEARCH_DEFAULT_FORE_COLOR = exports.QUICK_SEARCH_DEFAULT_BACK_COLOR = exports.SYSTEM_STATUS_DEFAULT_MAX_MESSAGES_IN_STORE = exports.DEFAULT_DOUBLE_DISPLAY_VALUE = exports.DEFAULT_INTEGER_DISPLAY_VALUE = exports.DEFAULT_STRING_DISPLAY_VALUE = exports.BLANK_DISTINCT_COLUMN_VALUE = exports.DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME = exports.DEFAULT_DATE_FORMAT_PATTERN = exports.ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME = exports.ADAPTABLE_ROW_ACTION_BUTTONS_FRIENDLY_NAME = exports.ADAPTABLE_ROW_ACTION_BUTTONS = exports.AG_GRID_CHART_WINDOW = exports.AG_GRID_PIVOT_COLUMN = exports.AG_GRID_GROUPED_COLUMN = exports.GROUP_PATH_SEPARATOR = exports.HALF_SECOND = exports.AB_FDC3_COLUMN = exports.AB_ROW_ACTIONS_COLUMN = exports.AB_SPECIAL_COLUMN = exports.EMPTY_ARRAY = exports.EMPTY_STRING = exports.FILTER_THROTTLE = exports.FILTER_NEVER = exports.FILTER_ALWAYS = exports.ALL_COLUMN_VALUES = exports.READ_ONLY_STYLE = exports.MENU_PREFIX = exports.AGGRID_TOOLPANEL_COLUMNS = exports.AGGRID_TOOLPANEL_FILTERS = exports.ADAPTABLE_TOOLPANEL_COMPONENT = exports.ADAPTABLE_TOOLPANEL_ID = exports.ADAPTABLE = exports.ADAPTABLE_ID = exports.USER_NAME = exports.OS_THEME = exports.DARK_THEME = exports.LIGHT_THEME = exports.DEFAULT_LAYOUT = exports.MISSING_COLUMN = exports.AUTOGENERATED_PK_COLUMN = void 0;
4
+ exports.THEME_STYLE = exports.SELECTED_ROWS_REPORT = exports.SELECTED_CELLS_REPORT = exports.CURRENT_DATA_REPORT = exports.ALL_DATA_REPORT = exports.VISUAL_DATA_REPORT = exports.SYSTEM_THEMES = exports.SMART_EDIT_MATH_OPERATION_STATE_PROPERTY = exports.SMART_EDIT_VALUE_STATE_PROPERTY = exports.QUICK_SEARCH_STYLE_STATE_PROPERTY = exports.QUICK_SEARCH_TEXT_STATE_PROPERTY = exports.CURRENT_THEME_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DURATION_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DOWN_COLOR_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_UP_COLOR_STATE_PROPERTY = exports.CURRENT_REPORT_STATE_PROPERTY = exports.CURRENT_LAYOUT_STATE_PROPERTY = exports.SUMMARY_OPERATION_STATE_PROPERTY = exports.ALERT_DEFAULT_SHOW_POPUP = void 0;
5
5
  const Enums_1 = require("../../PredefinedConfig/Common/Enums");
6
6
  const UIHelper_1 = require("../../View/UIHelper");
7
7
  exports.AUTOGENERATED_PK_COLUMN = '__ADAPTABLE_PK__';
@@ -38,6 +38,7 @@ exports.ADAPTABLE_ROW_ACTION_BUTTONS = 'adaptableRowActionButtons';
38
38
  exports.ADAPTABLE_ROW_ACTION_BUTTONS_FRIENDLY_NAME = '(ActionRowButtons)';
39
39
  exports.ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME = '(FDC3ActionColumn)';
40
40
  exports.DEFAULT_DATE_FORMAT_PATTERN = 'dd-MM-yyyy';
41
+ exports.DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME = 'dd-MM-yyyy HH:mm:ss';
41
42
  exports.BLANK_DISTINCT_COLUMN_VALUE = '[BLANKS]';
42
43
  exports.DEFAULT_STRING_DISPLAY_VALUE = 'Hello World';
43
44
  exports.DEFAULT_INTEGER_DISPLAY_VALUE = 12345;
@@ -7,10 +7,11 @@ const react_redux_1 = require("react-redux");
7
7
  const InfiniteTable_1 = require("../../components/InfiniteTable");
8
8
  const Panel_1 = tslib_1.__importDefault(require("../../components/Panel"));
9
9
  const rebass_1 = require("rebass");
10
- const dateUtils_1 = require("../../Utilities/ExpressionFunctions/dateUtils");
10
+ const format_1 = tslib_1.__importDefault(require("date-fns/format"));
11
11
  const AdaptableContext_1 = require("../AdaptableContext");
12
12
  const PopupPanel_1 = require("../Components/Popups/AdaptablePopup/PopupPanel");
13
13
  const AdaptableButton_1 = require("../Components/AdaptableButton");
14
+ const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
14
15
  const tableDOMProps = {
15
16
  style: {
16
17
  minHeight: 160,
@@ -18,7 +19,9 @@ const tableDOMProps = {
18
19
  },
19
20
  };
20
21
  const CellComments = (props) => {
22
+ var _a;
21
23
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
24
+ const dateFormat = (_a = adaptable.api.optionsApi.getCommentOptions().dateFormat) !== null && _a !== void 0 ? _a : GeneralConstants_1.DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME;
22
25
  const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Comment') === 'ReadOnly';
23
26
  const columnsMap = React.useMemo(() => {
24
27
  const columns = {
@@ -31,7 +34,7 @@ const CellComments = (props) => {
31
34
  field: 'Timestamp',
32
35
  maxWidth: 150,
33
36
  valueGetter: (params) => {
34
- return (0, dateUtils_1.formatDate)(params.data.Timestamp, 'MM.DD.YYYY HH:mm');
37
+ return (0, format_1.default)(params.data.Timestamp, dateFormat);
35
38
  },
36
39
  },
37
40
  text: {
@@ -17,7 +17,7 @@ const ensurePortalElement = (className) => {
17
17
  }
18
18
  portalElement = document.createElement('div');
19
19
  portalElement.style.position = 'absolute';
20
- portalElement.style.zIndex = '999';
20
+ portalElement.style.zIndex = '4'; // under the context menu
21
21
  portalElement.style.top = '0px';
22
22
  portalElement.style.left = '0px';
23
23
  if (className) {
@@ -10,6 +10,7 @@ const date_fns_1 = require("date-fns");
10
10
  const OverlayTrigger_1 = tslib_1.__importDefault(require("../../../components/OverlayTrigger"));
11
11
  const rebass_1 = require("rebass");
12
12
  const ListBoxFilterForm_1 = require("./ListBoxFilterForm");
13
+ const re_resizable_1 = require("re-resizable");
13
14
  const QuickFilterValues = (props) => {
14
15
  const { api } = props;
15
16
  const currentOverlayVisible = (0, react_1.useRef)(false);
@@ -139,33 +140,48 @@ const QuickFilterValues = (props) => {
139
140
  }
140
141
  }, render: ({ targetWidth }) => {
141
142
  var _a;
142
- return (React.createElement(rebass_1.Flex, { onMouseEnter: () => {
143
- if (showEvent === 'click') {
144
- // For showEvent=mousenter this is not needed.
145
- // When mouseenter is triggered on the overlay, onShowFn is called, the overlay is no longer hidden.
146
- // But in this case because the trigger is click, another show is not triggered.
147
- // The hide event is added direcly on the element so it does not use the React event system.
148
- // But this event does, maybe beause it uses event delegation it is triggered to soon.
149
- requestAnimationFrame(() => {
150
- var _a;
151
- (_a = valuesDropdownRef.current) === null || _a === void 0 ? void 0 : _a.show();
152
- });
153
- }
154
- }, "data-name": "quick-filter-form", flexDirection: "column", style: {
143
+ return (React.createElement(re_resizable_1.Resizable, { style: {
155
144
  fontSize: 'var(--ab-font-size-2)',
156
145
  border: '1px solid var(--ab-color-primarydark)',
157
146
  background: 'var(--ab-color-defaultbackground)',
158
147
  zIndex: 1000,
159
- width: getPopoverWidth(targetWidth),
160
- } },
161
- React.createElement(rebass_1.Flex, { m: 2 },
162
- React.createElement(SimpleButton_1.default, { onClick: () => clearColumnFilter() }, "Clear Filter"),
163
- ((_a = api.optionsApi.getColumnFilterOptions()) === null || _a === void 0 ? void 0 : _a.autoApplyFilter) == false && (React.createElement(SimpleButton_1.default, { ml: 2, onClick: () => {
164
- if (transientColumnFilter) {
165
- props.updateColumnFilter(transientColumnFilter);
166
- }
167
- } }, "Apply Filter"))),
168
- React.createElement(ListBoxFilterForm_1.ListBoxFilterForm, { disabled: props.isFilterDisabled, suppressClientSideFilter: quickFilterValues.suppressClientSideFilter, isLoading: isDistinctColumnValuesLoading, onFilterChange: handleFilterChange, currentColumn: props.currentColumn, columns: [], columnDistinctValues: quickFilterValues.values, dataType: props.currentColumn.dataType, uiSelectedColumnValues: props.columnFilter.Predicate.Inputs.filter((input) => input !== ''), useAgGridStyle: true, onColumnValueSelectedChange: (list) => onColumnValueSelectedChange(list) })));
148
+ }, enable: {
149
+ top: false,
150
+ right: true,
151
+ bottom: false,
152
+ left: false,
153
+ topRight: false,
154
+ bottomRight: false,
155
+ bottomLeft: false,
156
+ topLeft: false,
157
+ }, minWidth: getPopoverWidth(targetWidth) },
158
+ React.createElement(rebass_1.Flex, { onMouseEnter: () => {
159
+ if (showEvent === 'click') {
160
+ // For showEvent=mousenter this is not needed.
161
+ // When mouseenter is triggered on the overlay, onShowFn is called, the overlay is no longer hidden.
162
+ // But in this case because the trigger is click, another show is not triggered.
163
+ // The hide event is added direcly on the element so it does not use the React event system.
164
+ // But this event does, maybe beause it uses event delegation it is triggered to soon.
165
+ requestAnimationFrame(() => {
166
+ var _a;
167
+ (_a = valuesDropdownRef.current) === null || _a === void 0 ? void 0 : _a.show();
168
+ });
169
+ }
170
+ }, "data-name": "quick-filter-form", flexDirection: "column", style: {
171
+ // fontSize: 'var(--ab-font-size-2)',
172
+ // border: '1px solid var(--ab-color-primarydark)',
173
+ // background: 'var(--ab-color-defaultbackground)',
174
+ // zIndex: 1000,
175
+ // width: getPopoverWidth(targetWidth),
176
+ } },
177
+ React.createElement(rebass_1.Flex, { m: 2 },
178
+ React.createElement(SimpleButton_1.default, { onClick: () => clearColumnFilter() }, "Clear Filter"),
179
+ ((_a = api.optionsApi.getColumnFilterOptions()) === null || _a === void 0 ? void 0 : _a.autoApplyFilter) == false && (React.createElement(SimpleButton_1.default, { ml: 2, onClick: () => {
180
+ if (transientColumnFilter) {
181
+ props.updateColumnFilter(transientColumnFilter);
182
+ }
183
+ } }, "Apply Filter"))),
184
+ React.createElement(ListBoxFilterForm_1.ListBoxFilterForm, { disabled: props.isFilterDisabled, suppressClientSideFilter: quickFilterValues.suppressClientSideFilter, isLoading: isDistinctColumnValuesLoading, onFilterChange: handleFilterChange, currentColumn: props.currentColumn, columns: [], columnDistinctValues: quickFilterValues.values, dataType: props.currentColumn.dataType, uiSelectedColumnValues: props.columnFilter.Predicate.Inputs.filter((input) => input !== ''), useAgGridStyle: true, onColumnValueSelectedChange: (list) => onColumnValueSelectedChange(list) }))));
169
185
  } },
170
186
  React.createElement(SimpleButton_1.default, { "data-name": 'Select Values', style: {
171
187
  flex: 1,
@@ -136,7 +136,7 @@ const DataImportWizard = (props) => {
136
136
  return [...userDefinedHandlers, ...systemFileHandlers_1.systemFileHandlers];
137
137
  }, []);
138
138
  const supportedFileFormats = React.useMemo(() => {
139
- return fileHandlers.map((h) => h.fileExtension).join(', ');
139
+ return [...new Set(fileHandlers.map((h) => h.fileExtension)).values()].join(', ');
140
140
  }, [fileHandlers]);
141
141
  const readFile = React.useCallback(async (file) => {
142
142
  var _a, _b;