@adaptabletools/adaptable 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 +19 -6
  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 +7 -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 +1 -0
  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 +120 -0
  39. package/src/agGrid/defaultAdaptableOptions.js +1 -2
  40. package/src/agGrid/sortColumnStateForVisibleColumns.d.ts +12 -0
  41. package/src/agGrid/sortColumnStateForVisibleColumns.js +46 -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.esm.tsbuildinfo +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
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
  }
@@ -4,6 +4,16 @@ import * as ModuleConstants from '../../Utilities/Constants/ModuleConstants';
4
4
  import ArrayExtensions from '../../Utilities/Extensions/ArrayExtensions';
5
5
  import { ColumnInternalApi } from '../Internal/ColumnInternalApi';
6
6
  import { createBaseContext } from '../../Utilities/ObjectFactory';
7
+ export function isAutoRowGroupColumn(columnId) {
8
+ // put this here as there might be other indicators we are not aware of
9
+ // perhaps with non auto groups ?
10
+ //https://www.ag-grid.com/javascript-grid-grouping/
11
+ return columnId === null || columnId === void 0 ? void 0 : columnId.startsWith(GeneralConstants.AG_GRID_GROUPED_COLUMN);
12
+ }
13
+ export function isAutoPivotColumn(columnId) {
14
+ // put this here as there might be other indicators we are not aware of?
15
+ return columnId === null || columnId === void 0 ? void 0 : columnId.startsWith(GeneralConstants.AG_GRID_PIVOT_COLUMN);
16
+ }
7
17
  export class ColumnApiImpl extends ApiBase {
8
18
  constructor(adaptable) {
9
19
  super(adaptable);
@@ -52,14 +62,10 @@ export class ColumnApiImpl extends ApiBase {
52
62
  this.adaptable.showColumn(columnId);
53
63
  }
54
64
  isAutoRowGroupColumn(columnId) {
55
- // put this here as there might be other indicators we are not aware of
56
- // perhaps with non auto groups ?
57
- //https://www.ag-grid.com/javascript-grid-grouping/
58
- return columnId === null || columnId === void 0 ? void 0 : columnId.startsWith(GeneralConstants.AG_GRID_GROUPED_COLUMN);
65
+ return isAutoRowGroupColumn(columnId);
59
66
  }
60
67
  isAutoPivotColumn(columnId) {
61
- // put this here as there might be other indicators we are not aware of?
62
- return columnId === null || columnId === void 0 ? void 0 : columnId.startsWith(GeneralConstants.AG_GRID_PIVOT_COLUMN);
68
+ return isAutoPivotColumn(columnId);
63
69
  }
64
70
  isCalculatedColumn(columnId) {
65
71
  return (this.adaptable.api.calculatedColumnApi
@@ -343,4 +349,11 @@ export class ColumnApiImpl extends ApiBase {
343
349
  return columnTypes;
344
350
  }
345
351
  }
352
+ getColumnsByColumnType(columnType) {
353
+ const abColumns = this.getColumns();
354
+ return abColumns.filter((c) => {
355
+ var _a;
356
+ return ((_a = c.columnTypes) !== null && _a !== void 0 ? _a : []).includes(columnType);
357
+ });
358
+ }
346
359
  }
@@ -133,6 +133,9 @@ export class ConfigApiImpl extends ApiBase {
133
133
  adaptable: this.adaptable,
134
134
  adaptableStateKey,
135
135
  predefinedConfig,
136
+ postLoadHook: (state) => {
137
+ return this.adaptable.normalizeAdaptableState(state, this.adaptable.agGridAdapter.getLiveGridOptions());
138
+ },
136
139
  });
137
140
  promise
138
141
  .then(() => {
@@ -526,11 +526,12 @@ export class GridApiImpl extends ApiBase {
526
526
  return this.getRowCount();
527
527
  }
528
528
  showTransposedView(transposeConfig = {}) {
529
- var _a, _b, _c, _d;
529
+ var _a, _b, _c, _d, _e;
530
530
  const transposedColumnId = (_a = transposeConfig.transposedColumnId) !== null && _a !== void 0 ? _a : this.getAdaptableApi().optionsApi.getPrimaryKey();
531
531
  const hideTransposedColumn = (_b = transposeConfig.hideTransposedColumn) !== null && _b !== void 0 ? _b : true;
532
532
  const visibleColumns = (_c = transposeConfig.visibleColumns) !== null && _c !== void 0 ? _c : false;
533
533
  const visibleRows = (_d = transposeConfig.visibleRows) !== null && _d !== void 0 ? _d : false;
534
+ const autosize = (_e = transposeConfig.autosize) !== null && _e !== void 0 ? _e : true;
534
535
  this.adaptable.api.internalApi.showPopupWindow({
535
536
  id: WINDOW_SHOW_TRANSPOSED_VIEW,
536
537
  factoryId: WINDOW_SHOW_TRANSPOSED_VIEW,
@@ -541,6 +542,7 @@ export class GridApiImpl extends ApiBase {
541
542
  hideTransposedColumn,
542
543
  visibleColumns,
543
544
  visibleRows,
545
+ autosize,
544
546
  },
545
547
  });
546
548
  }
@@ -43,7 +43,9 @@ export class ScopeApiImpl extends ApiBase {
43
43
  return 'Columns: All';
44
44
  }
45
45
  if ('ColumnTypes' in scope) {
46
- return ((scope.ColumnTypes.length > 0 ? 'ColumnTypes' : 'ColumnType') + ': ' + scope.ColumnTypes.join(', '));
46
+ return ((scope.ColumnTypes.length > 0 ? 'ColumnTypes' : 'ColumnType') +
47
+ ': ' +
48
+ scope.ColumnTypes.join(', '));
47
49
  }
48
50
  if ('DataTypes' in scope) {
49
51
  return ((scope.DataTypes.length > 0 ? 'DataTypes' : 'DataType') + ': ' + scope.DataTypes.join(', '));
@@ -160,6 +162,7 @@ export class ScopeApiImpl extends ApiBase {
160
162
  return undefined;
161
163
  }
162
164
  isColumnInNumericScope(column, scope) {
165
+ var _a, _b;
163
166
  // if column is not even numeric then return false
164
167
  if (column == null || column == undefined || column.dataType !== 'Number') {
165
168
  return false;
@@ -176,9 +179,14 @@ export class ScopeApiImpl extends ApiBase {
176
179
  if ('DataTypes' in scope && scope.DataTypes.includes('Number')) {
177
180
  return true;
178
181
  }
182
+ if ('ColumnTypes' in scope &&
183
+ ((_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); }))) {
184
+ return true;
185
+ }
179
186
  return false;
180
187
  }
181
188
  isColumnInStringsScope(column, scope) {
189
+ var _a, _b;
182
190
  // if column is not even string then return false
183
191
  if (column == null || column == undefined || column.dataType !== 'String') {
184
192
  return false;
@@ -195,9 +203,14 @@ export class ScopeApiImpl extends ApiBase {
195
203
  if ('DataTypes' in scope && scope.DataTypes.includes('String')) {
196
204
  return true;
197
205
  }
206
+ if ('ColumnTypes' in scope &&
207
+ ((_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); }))) {
208
+ return true;
209
+ }
198
210
  return false;
199
211
  }
200
212
  isColumnInDateScope(column, scope) {
213
+ var _a, _b;
201
214
  // if column is not even numeric then return false
202
215
  if (column == null || column == undefined || column.dataType !== 'Date') {
203
216
  return false;
@@ -214,6 +227,10 @@ export class ScopeApiImpl extends ApiBase {
214
227
  if ('DataTypes' in scope && scope.DataTypes.includes('Date')) {
215
228
  return true;
216
229
  }
230
+ if ('ColumnTypes' in scope &&
231
+ ((_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); }))) {
232
+ return true;
233
+ }
217
234
  return false;
218
235
  }
219
236
  isScopeInScope(a, b) {
@@ -240,6 +257,22 @@ export class ScopeApiImpl extends ApiBase {
240
257
  })) {
241
258
  return true;
242
259
  }
260
+ if ('ColumnTypes' in a &&
261
+ 'ColumnTypes' in b &&
262
+ a.ColumnTypes.every((columnType) => b.ColumnTypes.includes(columnType))) {
263
+ return true;
264
+ }
265
+ // check if each colum in a has column types in b
266
+ if ('ColumnIds' in a && 'ColumnTypes' in b) {
267
+ const inScope = a.ColumnIds.every((columnId) => {
268
+ const column = this.adaptable.api.columnApi.getColumnWithColumnId(columnId);
269
+ // check if at least one column-type is in scope
270
+ return column.columnTypes.some((columnColumnType) => b.ColumnTypes.includes(columnColumnType));
271
+ });
272
+ if (inScope) {
273
+ return true;
274
+ }
275
+ }
243
276
  return false;
244
277
  }
245
278
  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;
@@ -100,7 +100,7 @@ export class ActionRowInternalApi extends ApiBase {
100
100
  const eventInfo = type === 'rowCreated'
101
101
  ? {
102
102
  type: 'rowCreated',
103
- formData: context.formData,
103
+ formData: this.prepareCreateData(formFields, context),
104
104
  adaptableApi: context.adaptableApi,
105
105
  userName: this.getOptions().userName,
106
106
  adaptableId: this.getOptions().adaptableId,
@@ -120,6 +120,17 @@ export class ActionRowInternalApi extends ApiBase {
120
120
  };
121
121
  return [cancelButton, saveButton];
122
122
  }
123
+ // private getNullValueForColumn(column: AdaptableColumn) {}
124
+ prepareCreateData(formFields, context) {
125
+ // when creating we just omit values that are not set
126
+ const dataToSave = Object.assign({}, context.formData);
127
+ for (const formField of formFields) {
128
+ if (dataToSave[formField.name] === '') {
129
+ delete dataToSave[formField.name];
130
+ }
131
+ }
132
+ return dataToSave;
133
+ }
123
134
  prepareEditData(formFields, context) {
124
135
  const dataToSave = Object.assign({}, context.formData);
125
136
  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,5 +1,8 @@
1
1
  import { ApiBase } from '../Implementation/ApiBase';
2
- import { ADAPTABLE_ROW_ACTION_BUTTONS } from '../../Utilities/Constants/GeneralConstants';
2
+ import { ADAPTABLE_ROW_ACTION_BUTTONS, AG_GRID_GROUPED_COLUMN, } from '../../Utilities/Constants/GeneralConstants';
3
+ export function getAutoRowGroupColumnIdFor(columnId) {
4
+ return `${AG_GRID_GROUPED_COLUMN}-${columnId}`;
5
+ }
3
6
  export class ColumnInternalApi extends ApiBase {
4
7
  /**
5
8
  * Retrieves 'ColumnType' property for a given Column
@@ -21,6 +24,9 @@ export class ColumnInternalApi extends ApiBase {
21
24
  return c.friendlyName;
22
25
  });
23
26
  }
27
+ getAutoRowGroupColumnIdFor(columnId) {
28
+ return getAutoRowGroupColumnIdFor(columnId);
29
+ }
24
30
  /**
25
31
  * Retrieves AG Grid's field property for the column
26
32
  * @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
  }
@@ -39,6 +39,9 @@ export class LayoutModule extends AdaptableModuleBase {
39
39
  this.rowSummariesSubscribtions();
40
40
  }
41
41
  rowSummariesSubscribtions() {
42
+ if (this.api.isDestroyed()) {
43
+ return;
44
+ }
42
45
  // ROW SUMMARY
43
46
  this.evaluateRowSummary();
44
47
  this.api.eventApi.on('AdaptableStateReloaded', () => {
@@ -468,6 +471,9 @@ export class LayoutModule extends AdaptableModuleBase {
468
471
  */
469
472
  evaluateRowSummary(reason) {
470
473
  var _a;
474
+ if (this.api.isDestroyed()) {
475
+ return;
476
+ }
471
477
  const currentLayout = this.api.layoutApi.getCurrentLayout();
472
478
  const rowSummaries = (_a = this.api.layoutApi.getCurrentLayout().RowSummaries) !== null && _a !== void 0 ? _a : [];
473
479
  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;
@@ -34,6 +34,7 @@ export const ADAPTABLE_ROW_ACTION_BUTTONS = 'adaptableRowActionButtons';
34
34
  export const ADAPTABLE_ROW_ACTION_BUTTONS_FRIENDLY_NAME = '(ActionRowButtons)';
35
35
  export const ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME = '(FDC3ActionColumn)';
36
36
  export const DEFAULT_DATE_FORMAT_PATTERN = 'dd-MM-yyyy';
37
+ export const DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME = 'dd-MM-yyyy HH:mm:ss';
37
38
  export const BLANK_DISTINCT_COLUMN_VALUE = '[BLANKS]';
38
39
  export const DEFAULT_STRING_DISPLAY_VALUE = 'Hello World';
39
40
  export const DEFAULT_INTEGER_DISPLAY_VALUE = 12345;
@@ -3,10 +3,11 @@ import { useSelector } from 'react-redux';
3
3
  import { DataSource, InfiniteTable } from '../../components/InfiniteTable';
4
4
  import Panel from '../../components/Panel';
5
5
  import { Box, Flex } from 'rebass';
6
- import { formatDate } from '../../Utilities/ExpressionFunctions/dateUtils';
6
+ import dateFnsFormat from 'date-fns/format';
7
7
  import { useAdaptable } from '../AdaptableContext';
8
8
  import { PopupPanel } from '../Components/Popups/AdaptablePopup/PopupPanel';
9
9
  import { AdaptableButtonComponent } from '../Components/AdaptableButton';
10
+ import { DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME } from '../../Utilities/Constants/GeneralConstants';
10
11
  const tableDOMProps = {
11
12
  style: {
12
13
  minHeight: 160,
@@ -14,7 +15,9 @@ const tableDOMProps = {
14
15
  },
15
16
  };
16
17
  const CellComments = (props) => {
18
+ var _a;
17
19
  const adaptable = useAdaptable();
20
+ const dateFormat = (_a = adaptable.api.optionsApi.getCommentOptions().dateFormat) !== null && _a !== void 0 ? _a : DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME;
18
21
  const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Comment') === 'ReadOnly';
19
22
  const columnsMap = React.useMemo(() => {
20
23
  const columns = {
@@ -27,7 +30,7 @@ const CellComments = (props) => {
27
30
  field: 'Timestamp',
28
31
  maxWidth: 150,
29
32
  valueGetter: (params) => {
30
- return formatDate(params.data.Timestamp, 'MM.DD.YYYY HH:mm');
33
+ return dateFnsFormat(params.data.Timestamp, dateFormat);
31
34
  },
32
35
  },
33
36
  text: {
@@ -13,7 +13,7 @@ const ensurePortalElement = (className) => {
13
13
  }
14
14
  portalElement = document.createElement('div');
15
15
  portalElement.style.position = 'absolute';
16
- portalElement.style.zIndex = '999';
16
+ portalElement.style.zIndex = '4'; // under the context menu
17
17
  portalElement.style.top = '0px';
18
18
  portalElement.style.left = '0px';
19
19
  if (className) {
@@ -6,6 +6,7 @@ import { isSameDay } from 'date-fns';
6
6
  import OverlayTrigger from '../../../components/OverlayTrigger';
7
7
  import { Flex } from 'rebass';
8
8
  import { ListBoxFilterForm } from './ListBoxFilterForm';
9
+ import { Resizable } from 're-resizable';
9
10
  export const QuickFilterValues = (props) => {
10
11
  const { api } = props;
11
12
  const currentOverlayVisible = useRef(false);
@@ -135,33 +136,48 @@ export const QuickFilterValues = (props) => {
135
136
  }
136
137
  }, render: ({ targetWidth }) => {
137
138
  var _a;
138
- return (React.createElement(Flex, { onMouseEnter: () => {
139
- if (showEvent === 'click') {
140
- // For showEvent=mousenter this is not needed.
141
- // When mouseenter is triggered on the overlay, onShowFn is called, the overlay is no longer hidden.
142
- // But in this case because the trigger is click, another show is not triggered.
143
- // The hide event is added direcly on the element so it does not use the React event system.
144
- // But this event does, maybe beause it uses event delegation it is triggered to soon.
145
- requestAnimationFrame(() => {
146
- var _a;
147
- (_a = valuesDropdownRef.current) === null || _a === void 0 ? void 0 : _a.show();
148
- });
149
- }
150
- }, "data-name": "quick-filter-form", flexDirection: "column", style: {
139
+ return (React.createElement(Resizable, { style: {
151
140
  fontSize: 'var(--ab-font-size-2)',
152
141
  border: '1px solid var(--ab-color-primarydark)',
153
142
  background: 'var(--ab-color-defaultbackground)',
154
143
  zIndex: 1000,
155
- width: getPopoverWidth(targetWidth),
156
- } },
157
- React.createElement(Flex, { m: 2 },
158
- React.createElement(SimpleButton, { onClick: () => clearColumnFilter() }, "Clear Filter"),
159
- ((_a = api.optionsApi.getColumnFilterOptions()) === null || _a === void 0 ? void 0 : _a.autoApplyFilter) == false && (React.createElement(SimpleButton, { ml: 2, onClick: () => {
160
- if (transientColumnFilter) {
161
- props.updateColumnFilter(transientColumnFilter);
162
- }
163
- } }, "Apply Filter"))),
164
- React.createElement(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) })));
144
+ }, enable: {
145
+ top: false,
146
+ right: true,
147
+ bottom: false,
148
+ left: false,
149
+ topRight: false,
150
+ bottomRight: false,
151
+ bottomLeft: false,
152
+ topLeft: false,
153
+ }, minWidth: getPopoverWidth(targetWidth) },
154
+ React.createElement(Flex, { onMouseEnter: () => {
155
+ if (showEvent === 'click') {
156
+ // For showEvent=mousenter this is not needed.
157
+ // When mouseenter is triggered on the overlay, onShowFn is called, the overlay is no longer hidden.
158
+ // But in this case because the trigger is click, another show is not triggered.
159
+ // The hide event is added direcly on the element so it does not use the React event system.
160
+ // But this event does, maybe beause it uses event delegation it is triggered to soon.
161
+ requestAnimationFrame(() => {
162
+ var _a;
163
+ (_a = valuesDropdownRef.current) === null || _a === void 0 ? void 0 : _a.show();
164
+ });
165
+ }
166
+ }, "data-name": "quick-filter-form", flexDirection: "column", style: {
167
+ // fontSize: 'var(--ab-font-size-2)',
168
+ // border: '1px solid var(--ab-color-primarydark)',
169
+ // background: 'var(--ab-color-defaultbackground)',
170
+ // zIndex: 1000,
171
+ // width: getPopoverWidth(targetWidth),
172
+ } },
173
+ React.createElement(Flex, { m: 2 },
174
+ React.createElement(SimpleButton, { onClick: () => clearColumnFilter() }, "Clear Filter"),
175
+ ((_a = api.optionsApi.getColumnFilterOptions()) === null || _a === void 0 ? void 0 : _a.autoApplyFilter) == false && (React.createElement(SimpleButton, { ml: 2, onClick: () => {
176
+ if (transientColumnFilter) {
177
+ props.updateColumnFilter(transientColumnFilter);
178
+ }
179
+ } }, "Apply Filter"))),
180
+ React.createElement(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) }))));
165
181
  } },
166
182
  React.createElement(SimpleButton, { "data-name": 'Select Values', style: {
167
183
  flex: 1,
@@ -132,7 +132,7 @@ export const DataImportWizard = (props) => {
132
132
  return [...userDefinedHandlers, ...systemFileHandlers];
133
133
  }, []);
134
134
  const supportedFileFormats = React.useMemo(() => {
135
- return fileHandlers.map((h) => h.fileExtension).join(', ');
135
+ return [...new Set(fileHandlers.map((h) => h.fileExtension)).values()].join(', ');
136
136
  }, [fileHandlers]);
137
137
  const readFile = React.useCallback(async (file) => {
138
138
  var _a, _b;
@@ -143,6 +143,19 @@ export const getFormatDisplayTypeForScope = (scope, api) => {
143
143
  if ('DataTypes' in scope && scope.DataTypes.length == 1 && scope.DataTypes[0] == 'String') {
144
144
  return 'String';
145
145
  }
146
+ if ('ColumnTypes' in scope && scope.ColumnTypes.length) {
147
+ // need to check if all column with this column type has the same data type and return that particular one
148
+ const columns = scope.ColumnTypes.flatMap((columnType) => {
149
+ return api.columnApi.getColumnsByColumnType(columnType);
150
+ });
151
+ // check if all have the same type
152
+ if (columns.length &&
153
+ columns.every((column) => column.dataType === columns[0].dataType) &&
154
+ // supported data types
155
+ ['Number', 'Date', 'String'].includes(columns[0].dataType)) {
156
+ return columns[0].dataType;
157
+ }
158
+ }
146
159
  return undefined;
147
160
  };
148
161
  const renderDateFormat = (data, _onChange, setFormatOption, scopedCustomFormatters) => {
@@ -189,7 +202,7 @@ const renderDateFormat = (data, _onChange, setFormatOption, scopedCustomFormatte
189
202
  ] })))))));
190
203
  };
191
204
  const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatters, formatColumnApi) => {
192
- var _a, _b, _c;
205
+ var _a, _b, _c, _d, _e;
193
206
  if (data.DisplayFormat.Formatter !== 'NumberFormatter') {
194
207
  return null;
195
208
  }
@@ -248,13 +261,13 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
248
261
  React.createElement(Flex, { flexDirection: "row" },
249
262
  React.createElement(FormLayout, { mr: 3 },
250
263
  React.createElement(FormRow, { label: "Fraction Separator" },
251
- React.createElement(Input, { "data-name": "fraction-separator", value: data.DisplayFormat.Options.FractionSeparator, onChange: (e) => setFormatOption('FractionSeparator', e.currentTarget.value) })),
264
+ React.createElement(Input, { "data-name": "fraction-separator", value: (_a = data.DisplayFormat.Options.FractionSeparator) !== null && _a !== void 0 ? _a : '', onChange: (e) => setFormatOption('FractionSeparator', e.currentTarget.value) })),
252
265
  React.createElement(FormRow, { label: "Integer Separator" },
253
- React.createElement(Input, { "data-name": "integer-separator", value: data.DisplayFormat.Options.IntegerSeparator, onChange: (e) => setFormatOption('IntegerSeparator', e.currentTarget.value) })),
266
+ React.createElement(Input, { "data-name": "integer-separator", value: (_b = data.DisplayFormat.Options.IntegerSeparator) !== null && _b !== void 0 ? _b : '', onChange: (e) => setFormatOption('IntegerSeparator', e.currentTarget.value) })),
254
267
  React.createElement(FormRow, { label: "Prefix" },
255
- React.createElement(Input, { "data-name": "prefix", value: (_a = data.DisplayFormat.Options.Prefix) !== null && _a !== void 0 ? _a : '', onChange: (e) => setFormatOption('Prefix', e.currentTarget.value) })),
268
+ React.createElement(Input, { "data-name": "prefix", value: (_c = data.DisplayFormat.Options.Prefix) !== null && _c !== void 0 ? _c : '', onChange: (e) => setFormatOption('Prefix', e.currentTarget.value) })),
256
269
  React.createElement(FormRow, { label: "Suffix" },
257
- React.createElement(Input, { "data-name": "suffix", value: (_b = data.DisplayFormat.Options.Suffix) !== null && _b !== void 0 ? _b : '', onChange: (e) => setFormatOption('Suffix', e.currentTarget.value) })),
270
+ React.createElement(Input, { "data-name": "suffix", value: (_d = data.DisplayFormat.Options.Suffix) !== null && _d !== void 0 ? _d : '', onChange: (e) => setFormatOption('Suffix', e.currentTarget.value) })),
258
271
  React.createElement(FormRow, { label: "Truncate" },
259
272
  React.createElement(CheckBox, { "data-name": "truncate-checkbox", checked: data.DisplayFormat.Options.Truncate, onChange: (checked) => setFormatOption('Truncate', checked) })),
260
273
  React.createElement(FormRow, { label: "Ceiling" },
@@ -279,7 +292,7 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
279
292
  React.createElement(Input, { "data-name": "multiplier", type: "number", value: data.DisplayFormat.Options.Multiplier, onChange: (e) => setFormatOption('Multiplier', Number(e.currentTarget.value)) })),
280
293
  ' ',
281
294
  React.createElement(FormRow, { label: "Content" },
282
- React.createElement(Input, { "data-name": "content", value: (_c = data.DisplayFormat.Options.Content) !== null && _c !== void 0 ? _c : '', onChange: (e) => setFormatOption('Content', e.currentTarget.value) })),
295
+ React.createElement(Input, { "data-name": "content", value: (_e = data.DisplayFormat.Options.Content) !== null && _e !== void 0 ? _e : '', onChange: (e) => setFormatOption('Content', e.currentTarget.value) })),
283
296
  ' ',
284
297
  React.createElement(FormRow, { label: "Parentheses" },
285
298
  React.createElement(CheckBox, { "data-name": "parentheses-checkbox", checked: data.DisplayFormat.Options.Parentheses, onChange: (checked) => setFormatOption('Parentheses', checked) })),