@adaptabletools/adaptable 19.1.1 → 19.1.2-canary.0

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 (32) hide show
  1. package/package.json +1 -1
  2. package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -5
  3. package/src/AdaptableOptions/AlertOptions.d.ts +3 -0
  4. package/src/AdaptableOptions/ColumnMenuOptions.d.ts +1 -1
  5. package/src/AdaptableOptions/CommentOptions.d.ts +2 -2
  6. package/src/AdaptableOptions/NoteOptions.d.ts +2 -2
  7. package/src/Api/AdaptableApi.d.ts +21 -11
  8. package/src/Api/Events/GridDataChanged.d.ts +3 -0
  9. package/src/Api/GridApi.d.ts +6 -2
  10. package/src/Api/Implementation/AdaptableApiImpl.d.ts +3 -6
  11. package/src/Api/Implementation/AdaptableApiImpl.js +1 -1
  12. package/src/Api/Implementation/GridApiImpl.js +3 -1
  13. package/src/Api/Internal/CommentsInternalApi.d.ts +1 -0
  14. package/src/Api/Internal/CommentsInternalApi.js +4 -0
  15. package/src/Api/Internal/NoteInternalApi.d.ts +1 -0
  16. package/src/Api/Internal/NoteInternalApi.js +4 -0
  17. package/src/PredefinedConfig/Common/ExtendedLayoutInfo.d.ts +15 -0
  18. package/src/PredefinedConfig/Common/FilterActionOnDataChange.d.ts +3 -0
  19. package/src/View/Comments/CommentsEditor.js +2 -2
  20. package/src/View/Comments/CommentsPopup.js +1 -4
  21. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
  22. package/src/View/Layout/TransposedPopup.js +2 -2
  23. package/src/View/Note/NotePopup.js +1 -4
  24. package/src/agGrid/AdaptableAgGrid.d.ts +2 -5
  25. package/src/agGrid/AdaptableAgGrid.js +47 -26
  26. package/src/agGrid/AgGridAdapter.js +3 -3
  27. package/src/agGrid/defaultAdaptableOptions.js +100 -96
  28. package/src/env.js +2 -2
  29. package/src/metamodel/adaptable.metamodel.d.ts +32 -0
  30. package/src/metamodel/adaptable.metamodel.js +1 -1
  31. package/src/types.d.ts +1 -1
  32. package/tsconfig.esm.tsbuildinfo +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "19.1.1",
3
+ "version": "19.1.2-canary.0",
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
  /// <reference types="react" />
2
2
  import { ChartModel, ChartRef, Column, GridApi, GridOptions, IRowNode, Module, RowModelType, StatusPanelDef } from '@ag-grid-community/core';
3
- import { AdaptableApi } from '../Api/AdaptableApi';
3
+ import { AdaptableApi, DestroyConfig } from '../Api/AdaptableApi';
4
4
  import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
5
5
  import { ColumnSort } from '../PredefinedConfig/Common/ColumnSort';
6
6
  import { DataUpdateConfig } from '../PredefinedConfig/Common/DataUpdateConfig';
@@ -262,10 +262,7 @@ export interface IAdaptable {
262
262
  getAgGridColumnForColumnId(columnId: string): Column;
263
263
  getMinMaxCachedValueForColumn(column: AdaptableColumn, minMax: 'min' | 'max'): number | undefined;
264
264
  getAgGridRegisteredModules(): Module[];
265
- destroy(config?: {
266
- unmount: boolean;
267
- destroyApi?: boolean;
268
- }): void;
265
+ destroy(config?: DestroyConfig): void;
269
266
  setLayout(layout?: Layout): void;
270
267
  canExportToExcel(): boolean;
271
268
  exportToExcel(reportData: ReportData, fileName: string): void;
@@ -68,6 +68,9 @@ export interface AlertOptions<TData = any> {
68
68
  */
69
69
  showMissingPrimaryKeyAlert?: boolean;
70
70
  }
71
+ /**
72
+ * Cell Change that will trigger an Alert: can be 'rawValue' or 'formattedValue'
73
+ */
71
74
  export type DataChangeDetectionPolicy = 'rawValue' | 'formattedValue';
72
75
  /**
73
76
  * Handles a Form Button Action
@@ -91,4 +91,4 @@ export interface UserColumnMenuItem {
91
91
  /**
92
92
  * Defines AG Grid Column Menu Items
93
93
  */
94
- export type AgGridColumnMenuItemType = 'pinSubMenu' | 'valueAggSubMenu' | 'autoSizeThis' | 'autoSizeAll' | 'rowGroup' | 'rowUnGroup' | 'resetColumns' | 'expandAll' | 'contractAll' | 'separator';
94
+ export type AgGridColumnMenuItemType = 'sortAscending' | 'sortDescending' | 'sortUnSort' | 'columnFilter' | 'columnChooser' | 'pinSubMenu' | 'valueAggSubMenu' | 'autoSizeThis' | 'autoSizeAll' | 'rowGroup' | 'rowUnGroup' | 'resetColumns' | 'expandAll' | 'contractAll' | 'separator';
@@ -17,11 +17,11 @@ export interface CommentOptions<TData = any> {
17
17
  */
18
18
  persistCommentThreads?(commentThreads: CommentThread[]): Promise<void>;
19
19
  /**
20
- * Format string for dates in Comments Popup
20
+ * Format string for Dates in Comments Popup
21
21
  *
22
22
  * @defaultValue 'dd-MM-yyyy HH:mm:ss'
23
23
  */
24
- dateFormat?: string;
24
+ dateFormat?: string | (() => string);
25
25
  /**
26
26
  * Show the Close Button in the Comments Popup
27
27
  * @defaultValue true
@@ -8,11 +8,11 @@ export interface NoteOptions<TData = any> {
8
8
  */
9
9
  isCellNotable?: (context: NotableCellContext) => boolean;
10
10
  /**
11
- * Format string for formatting in the Notes Popup
11
+ * Format string for Dates in Notes Popup
12
12
  *
13
13
  * @defaultValue 'dd-MM-yyyy HH:mm:ss'
14
14
  */
15
- dateFormat?: string;
15
+ dateFormat?: string | (() => string);
16
16
  /**
17
17
  * Show the Close Button in the Notes Popup
18
18
  *
@@ -258,23 +258,33 @@ export interface AdaptableApi {
258
258
  */
259
259
  gridFilterApi: GridFilterApi;
260
260
  /**
261
- * Cleanup method - should be called only when using the vanilla javascript component, as framework components cleanup is performed when the component is destroyed/unmounted.
262
- * This destroys the Adaptable instance.
261
+ * Cleanup method - call only for vanilla JavaScript components, as framework components handle cleanup on destroy/unmount. By default, it unmounts the Adaptable component and destroys the AG Grid instance.
262
+ * @param config - optional configuration object
263
263
  */
264
- destroy: (config?: {
265
- unmount: boolean;
266
- destroyApi?: boolean;
267
- }) => void;
264
+ destroy: (config?: DestroyConfig) => void;
268
265
  /**
269
266
  * Whether the Adaptable instance has been destroyed
270
267
  */
271
268
  isDestroyed: () => boolean;
269
+ }
270
+ /**
271
+ * Adaptable Destroy Configuration
272
+ */
273
+ export interface DestroyConfig {
274
+ /**
275
+ * Unmount the Adaptable component (Dashboard)
276
+ *
277
+ * @defaultValue true
278
+ */
279
+ unmount: boolean;
280
+ /**
281
+ * @deprecated use `destroyAgGrid` instead
282
+ */
283
+ destroyApi?: boolean;
272
284
  /**
273
- * Cleanup method that only cleans up this api instance (clears event listeners and sets every property to null), but does not destroy the Adaptable instance.
285
+ * Destroy the AgGrid instance
274
286
  *
287
+ * @defaultValue true
275
288
  */
276
- internalDestroySelf: (config?: {
277
- unmount: boolean;
278
- destroyApi?: boolean;
279
- }) => void;
289
+ destroyAgGrid: boolean;
280
290
  }
@@ -1,5 +1,8 @@
1
1
  import { IRowNode } from '@ag-grid-community/core';
2
2
  import { BaseEventInfo } from './BaseEventInfo';
3
+ /**
4
+ * What row action triggered the Grid change: 'Add', 'Update', 'Delete' or 'Load'
5
+ */
3
6
  export type GridDataChangeTrigger = 'Add' | 'Update' | 'Delete' | 'Load';
4
7
  /**
5
8
  * EventInfo returned by GridDataChanged event
@@ -457,6 +457,10 @@ export interface GridApi {
457
457
  * @param columnIds ColumnIds which contain cells to refresh
458
458
  */
459
459
  refreshCells(rowNodes: IRowNode[], columnIds: string[], suppressFlash?: boolean): void;
460
+ /**
461
+ * Refreshes all Cells in the Grid
462
+ * @param forceUpdate forces AG Grid change detection
463
+ */
460
464
  refreshAllCells(forceUpdate?: boolean): void;
461
465
  /**
462
466
  * Refreshes a single Grid Cell
@@ -469,7 +473,7 @@ export interface GridApi {
469
473
  */
470
474
  refreshGridCells(gridCells: GridCell[]): void;
471
475
  /**
472
- * Forces a re-render of the row with the given primary key value
476
+ * Forces a re-render of Row with given Primary Key value
473
477
  * @param primaryKey row primary key
474
478
  */
475
479
  refreshRowByPrimaryKey(primaryKey: any): void;
@@ -504,7 +508,7 @@ export interface GridApi {
504
508
  */
505
509
  getVisibleColumnCount(): number;
506
510
  /**
507
- * Destroys current AdapTable instance
511
+ * @deprecated use `AdaptableApi.destroy()` instead
508
512
  */
509
513
  destroy(): void;
510
514
  /**
@@ -1,6 +1,6 @@
1
1
  import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
2
2
  import { AdaptableInternalApi } from '../Internal/AdaptableInternalApi';
3
- import { AdaptableApi, ColumnMenuApi, ContextMenuApi, DataImportApi, NamedQueryApi, OptionsApi, SettingsPanelApi } from '../../types';
3
+ import { AdaptableApi, ColumnMenuApi, ContextMenuApi, DataImportApi, DestroyConfig, NamedQueryApi, OptionsApi, SettingsPanelApi } from '../../types';
4
4
  import { AlertApi } from '../AlertApi';
5
5
  import { BulkUpdateApi } from '../BulkUpdateApi';
6
6
  import { CalendarApi } from '../CalendarApi';
@@ -104,11 +104,8 @@ export declare class AdaptableApiImpl implements AdaptableApi {
104
104
  /**
105
105
  * This is only meant to be called by the Adaptable instance.
106
106
  */
107
- internalDestroySelf(): void;
108
- destroy(config?: {
109
- unmount: boolean;
110
- destroyApi?: boolean;
111
- }): void;
107
+ _internalDestroySelf(): void;
108
+ destroy(config?: DestroyConfig): void;
112
109
  isDestroyed(): boolean;
113
110
  logConsoleMessage(message: string, ...optionalParams: any[]): void;
114
111
  logInfo(message: string, ...optionalParams: any[]): void;
@@ -113,7 +113,7 @@ export class AdaptableApiImpl {
113
113
  /**
114
114
  * This is only meant to be called by the Adaptable instance.
115
115
  */
116
- internalDestroySelf() {
116
+ _internalDestroySelf() {
117
117
  if (this.destroyed) {
118
118
  return;
119
119
  }
@@ -6,6 +6,7 @@ import { GridInternalApi } from '../Internal/GridInternalApi';
6
6
  import ArrayExtensions from '../../Utilities/Extensions/ArrayExtensions';
7
7
  import { WINDOW_SHOW_TRANSPOSED_VIEW } from '../../View/Components/Popups/WindowPopups/windowFactory';
8
8
  import { ROW_SUMMARY_ROW_ID } from '../../PredefinedConfig/Common/RowSummary';
9
+ import { logDeprecationExternal } from '../../Utilities/logDeprecation';
9
10
  export class GridApiImpl extends ApiBase {
10
11
  constructor(_adaptable) {
11
12
  super(_adaptable);
@@ -550,7 +551,8 @@ export class GridApiImpl extends ApiBase {
550
551
  this._adaptable.deselectAll();
551
552
  }
552
553
  destroy() {
553
- this._adaptable.destroy();
554
+ logDeprecationExternal(this._adaptable.logger, 'GridApi', 'destroy', 'AdaptableApi', 'destroy');
555
+ this.getAdaptableApi().destroy();
554
556
  }
555
557
  getGridContainerElement() {
556
558
  return this._adaptable.getAgGridContainerElement();
@@ -1,4 +1,5 @@
1
1
  import { ApiBase } from '../Implementation/ApiBase';
2
2
  export declare class CommentsInternalApi extends ApiBase {
3
3
  areCommentsSupported(): boolean;
4
+ getCommentsDateFormat(): string;
4
5
  }
@@ -7,4 +7,8 @@ export class CommentsInternalApi extends ApiBase {
7
7
  }
8
8
  return true;
9
9
  }
10
+ getCommentsDateFormat() {
11
+ const dateFormat = this.getCommentOptions().dateFormat;
12
+ return typeof dateFormat === 'function' ? dateFormat() : dateFormat;
13
+ }
10
14
  }
@@ -1,4 +1,5 @@
1
1
  import { ApiBase } from '../Implementation/ApiBase';
2
2
  export declare class NoteInternalApi extends ApiBase {
3
3
  areNotesSupported(): boolean;
4
+ getNotesDateFormat(): string;
4
5
  }
@@ -7,4 +7,8 @@ export class NoteInternalApi extends ApiBase {
7
7
  }
8
8
  return true;
9
9
  }
10
+ getNotesDateFormat() {
11
+ const dateFormat = this.getNoteOptions().dateFormat;
12
+ return typeof dateFormat === 'function' ? dateFormat() : dateFormat;
13
+ }
10
14
  }
@@ -3,10 +3,25 @@ import { AdaptableModule, AdaptableObject, Layout } from '../../types';
3
3
  * Defines an Extended Layout - provides a Layout and all objects that refer to it
4
4
  */
5
5
  export interface ExtendedLayoutInfo {
6
+ /**
7
+ * Layout being extended
8
+ */
6
9
  Layout: Layout;
10
+ /**
11
+ * Object to be included in the Layout
12
+ */
7
13
  Extensions: LayoutExtension[];
8
14
  }
15
+ /**
16
+ * Defines an object being extended in a Layout
17
+ */
9
18
  export interface LayoutExtension {
19
+ /**
20
+ * Module to which Extended Object belongs
21
+ */
10
22
  Module: AdaptableModule;
23
+ /**
24
+ * Object being Extended
25
+ */
11
26
  Object: AdaptableObject;
12
27
  }
@@ -11,4 +11,7 @@ export interface FilterActionOnDataChange {
11
11
  */
12
12
  throttleDelay?: number;
13
13
  }
14
+ /**
15
+ * When to apply a Filter: 'Always', 'Never' or 'Throttle'
16
+ */
14
17
  export type ApplyFilterAction = 'Always' | 'Never' | 'Throttle';
@@ -6,9 +6,9 @@ import Panel from '../../components/Panel';
6
6
  import SimpleButton from '../../components/SimpleButton';
7
7
  import * as CommentsRedux from '../../Redux/ActionsReducers/CommentsRedux';
8
8
  import { SystemCommentsAndNotesSelector } from '../../Redux/ActionsReducers/SystemRedux';
9
- import { formatDate } from '../../Utilities/ExpressionFunctions/dateUtils';
10
9
  import { useAdaptable } from '../AdaptableContext';
11
10
  import AdaptableInput from '../Components/AdaptableInput';
11
+ import dateFnsFormat from 'date-fns/format';
12
12
  // Edit Mode
13
13
  // [author] [edit, delete]
14
14
  // [text-editor] * this is different
@@ -78,7 +78,7 @@ export const CommentsEditor = (props) => {
78
78
  React.createElement(Flex, { mb: 2, alignItems: "center" },
79
79
  React.createElement(Box, null,
80
80
  React.createElement(Box, { "data-name": "comment-username", fontSize: 3, fontWeight: "bold" }, (_d = comment === null || comment === void 0 ? void 0 : comment.Author) === null || _d === void 0 ? void 0 : _d.UserName),
81
- comment.Timestamp && (React.createElement(Box, { "data-name": "comment-timestamp", fontSize: 2 }, formatDate(comment.Timestamp, 'MM.DD.YYYY HH:mm')))),
81
+ comment.Timestamp && (React.createElement(Box, { "data-name": "comment-timestamp", fontSize: 2 }, dateFnsFormat(comment.Timestamp, adaptable.api.commentApi.internalApi.getCommentsDateFormat())))),
82
82
  React.createElement(Box, { flex: 1 }),
83
83
  React.createElement(SimpleButton, { variant: "text", icon: "edit", disabled: !isOwnComment || isReadOnlyModule, onClick: () => setActiveEditingComment(comment.Uuid) }),
84
84
  React.createElement(SimpleButton, { variant: "text", icon: "delete", disabled: !isOwnComment || isReadOnlyModule, onClick: () => {
@@ -7,7 +7,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';
11
10
  const tableDOMProps = {
12
11
  style: {
13
12
  minHeight: 160,
@@ -15,9 +14,7 @@ const tableDOMProps = {
15
14
  },
16
15
  };
17
16
  const CellComments = (props) => {
18
- var _a;
19
17
  const adaptable = useAdaptable();
20
- const dateFormat = (_a = adaptable.api.optionsApi.getCommentOptions().dateFormat) !== null && _a !== void 0 ? _a : DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME;
21
18
  const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Comment') === 'ReadOnly';
22
19
  const columnsMap = React.useMemo(() => {
23
20
  const columns = {
@@ -30,7 +27,7 @@ const CellComments = (props) => {
30
27
  field: 'Timestamp',
31
28
  maxWidth: 150,
32
29
  valueGetter: (params) => {
33
- return dateFnsFormat(params.data.Timestamp, dateFormat);
30
+ return dateFnsFormat(params.data.Timestamp, adaptable.api.commentApi.internalApi.getCommentsDateFormat());
34
31
  },
35
32
  },
36
33
  text: {
@@ -31,7 +31,7 @@ export const DataChangeHistoryGrid = (props) => {
31
31
  return () => {
32
32
  requestAnimationFrame(() => {
33
33
  var _a;
34
- (_a = adaptableApiRef.current) === null || _a === void 0 ? void 0 : _a.internalApi.getAdaptableInstance().destroy({ unmount: true, destroyApi: true });
34
+ (_a = adaptableApiRef.current) === null || _a === void 0 ? void 0 : _a.internalApi.getAdaptableInstance().destroy({ unmount: true, destroyAgGrid: true });
35
35
  });
36
36
  };
37
37
  }, []);
@@ -21,7 +21,7 @@ export const TransposedPopup = (props) => {
21
21
  const [syntheticTransposedByColumnId, doSetSyntheticTransposedByColumnId] = React.useState(transposedColumnId);
22
22
  const setSyntheticTransposedByColumnId = (syntheticTransposedByColumnId) => {
23
23
  var _a;
24
- (_a = transposedAdaptableApiRef.current) === null || _a === void 0 ? void 0 : _a.destroy({ unmount: true, destroyApi: true });
24
+ (_a = transposedAdaptableApiRef.current) === null || _a === void 0 ? void 0 : _a.destroy({ unmount: true, destroyAgGrid: true });
25
25
  doSetSyntheticTransposedByColumnId(syntheticTransposedByColumnId);
26
26
  };
27
27
  const transposedAdaptableApiRef = React.useRef(null);
@@ -181,7 +181,7 @@ export const TransposedPopup = (props) => {
181
181
  return () => {
182
182
  requestAnimationFrame(() => {
183
183
  var _a;
184
- (_a = transposedAdaptableApiRef.current) === null || _a === void 0 ? void 0 : _a.destroy({ unmount: true, destroyApi: true });
184
+ (_a = transposedAdaptableApiRef.current) === null || _a === void 0 ? void 0 : _a.destroy({ unmount: true, destroyAgGrid: true });
185
185
  });
186
186
  };
187
187
  }, []);
@@ -6,7 +6,6 @@ import dateFnsFormat from 'date-fns/format';
6
6
  import { useAdaptable } from '../AdaptableContext';
7
7
  import { AdaptableButtonComponent } from '../Components/AdaptableButton';
8
8
  import { PopupPanel } from '../Components/Popups/AdaptablePopup/PopupPanel';
9
- import { DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME } from '../../Utilities/Constants/GeneralConstants';
10
9
  import StringExtensions from '../../Utilities/Extensions/StringExtensions';
11
10
  const tableDOMProps = {
12
11
  style: {
@@ -16,12 +15,10 @@ const tableDOMProps = {
16
15
  },
17
16
  };
18
17
  export const NotePopup = (props) => {
19
- var _a, _b, _c, _d;
20
18
  const adaptable = useAdaptable();
21
19
  const primaryKeyHeader = adaptable.api.columnApi.getPrimaryKeyColumn()
22
20
  ? adaptable.api.columnApi.getFriendlyNameForColumnId(adaptable.api.columnApi.getPrimaryKeyColumn().columnId)
23
21
  : StringExtensions.Humanize(adaptable.adaptableOptions.primaryKey);
24
- const dateFormat = (_d = (_c = (_b = (_a = adaptable.api.optionsApi) === null || _a === void 0 ? void 0 : _a.getNoteOptions) === null || _b === void 0 ? void 0 : _b.call(_a)) === null || _c === void 0 ? void 0 : _c.dateFormat) !== null && _d !== void 0 ? _d : DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME;
25
22
  const allNotes = useSelector((state) => GetAllNotesSelector(state.Note));
26
23
  const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Note') === 'ReadOnly';
27
24
  const columnsMap = React.useMemo(() => {
@@ -46,7 +43,7 @@ export const NotePopup = (props) => {
46
43
  timestamp: {
47
44
  field: 'Timestamp',
48
45
  valueGetter: (params) => {
49
- return dateFnsFormat(params.data.Timestamp, dateFormat);
46
+ return dateFnsFormat(params.data.Timestamp, adaptable.api.noteApi.internalApi.getNotesDateFormat());
50
47
  },
51
48
  },
52
49
  delete: {
@@ -2,7 +2,7 @@
2
2
  import { AdaptableOptions } from '../AdaptableOptions/AdaptableOptions';
3
3
  import { ChartRef, Column, GridApi, GridOptions, IRowNode, Module, RowModelType } from '@ag-grid-community/core';
4
4
  import { AdaptableLogger } from './AdaptableLogger';
5
- import { AdaptableApi } from '../Api/AdaptableApi';
5
+ import { AdaptableApi, DestroyConfig } from '../Api/AdaptableApi';
6
6
  import { AdaptableVariant, DistinctColumnValuesParams, IAdaptable, NormalizeAdaptableStateOptions } from '../AdaptableInterfaces/IAdaptable';
7
7
  import { EmitterCallback } from '../Utilities/Emitter';
8
8
  import { AdaptablePlugin } from '../AdaptableOptions/AdaptablePlugin';
@@ -308,10 +308,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
308
308
  getAgGridColumnForColumnId(columnId: string): Column;
309
309
  getMinMaxCachedValueForColumn(column: AdaptableColumn, minMax: 'min' | 'max'): number;
310
310
  getAgGridRegisteredModules(): Module[];
311
- destroy(config?: {
312
- unmount: boolean;
313
- destroyApi?: boolean;
314
- }): void;
311
+ destroy(config?: DestroyConfig): void;
315
312
  canExportToExcel(): boolean;
316
313
  exportToExcel(reportData: ReportData, fileName: string): void;
317
314
  exportVisualDataToExcel(): void;
@@ -2974,7 +2974,25 @@ export class AdaptableAgGrid {
2974
2974
  return this.agGridAdapter.getRegisteredModules();
2975
2975
  }
2976
2976
  destroy(config) {
2977
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
2977
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12;
2978
+ if (!config) {
2979
+ config = {
2980
+ unmount: true,
2981
+ destroyAgGrid: true,
2982
+ };
2983
+ }
2984
+ else {
2985
+ // should not happen unless someone ignored the TypeScript warnings
2986
+ if (config.unmount == undefined) {
2987
+ config.unmount = true;
2988
+ }
2989
+ if (config.destroyAgGrid == undefined) {
2990
+ config.destroyAgGrid = true;
2991
+ }
2992
+ }
2993
+ if ((config === null || config === void 0 ? void 0 : config.destroyApi) === true) {
2994
+ this.logger.warn(`Use of 'destroyApi' is deprecated. Use 'destroyAgGrid' instead.`);
2995
+ }
2978
2996
  if (((_a = this.agGridAdapter) === null || _a === void 0 ? void 0 : _a.getAgGridApi()) && !this.agGridAdapter.getAgGridApi().isDestroyed()) {
2979
2997
  this.agGridAdapter
2980
2998
  .getAgGridApi()
@@ -3057,7 +3075,7 @@ export class AdaptableAgGrid {
3057
3075
  }
3058
3076
  }
3059
3077
  DANGER_AG_GRID_BEANS_MAP[this._agGridId] = null;
3060
- if ((config === null || config === void 0 ? void 0 : config.destroyApi) === true) {
3078
+ if ((config === null || config === void 0 ? void 0 : config.destroyApi) === true || (config === null || config === void 0 ? void 0 : config.destroyAgGrid) === true) {
3061
3079
  (_b = this.agGridAdapter.getAgGridApi()) === null || _b === void 0 ? void 0 : _b.destroy();
3062
3080
  }
3063
3081
  this.previousAgGridLayoutState = '';
@@ -3070,7 +3088,7 @@ export class AdaptableAgGrid {
3070
3088
  this.agGridListenerMouseEnter = null;
3071
3089
  this.agGridListenerMouseLeave = null;
3072
3090
  }
3073
- this.api.internalDestroySelf();
3091
+ this.api._internalDestroySelf();
3074
3092
  (_c = this.agGridOptionsService) === null || _c === void 0 ? void 0 : _c.destroy();
3075
3093
  this.agGridOptionsService = null;
3076
3094
  (_d = this.agGridAdapter) === null || _d === void 0 ? void 0 : _d.destroy();
@@ -3086,46 +3104,49 @@ export class AdaptableAgGrid {
3086
3104
  this.columnMinMaxValuesCache = null;
3087
3105
  this.lifecycleState = 'preDestroyed';
3088
3106
  AdaptableAgGrid.dismissInstance(this);
3089
- (_g = this.unmountLoadingScreen) === null || _g === void 0 ? void 0 : _g.call(this);
3090
- this.unmountLoadingScreen = null;
3091
- if (config && !config.unmount) {
3092
- return;
3093
- }
3094
- const abContainerElement = this.getAdaptableContainerElement();
3095
- if (abContainerElement != null) {
3096
- (_h = this.unmountReactRoot) === null || _h === void 0 ? void 0 : _h.call(this);
3097
- }
3098
- this.unmountReactRoot = null;
3099
3107
  this.DANGER_USE_GETTER_adaptableContainerElement = null;
3100
3108
  this.DANGER_USE_GETTER_agGridContainerElement = null;
3101
- (_j = this.adaptableStore) === null || _j === void 0 ? void 0 : _j.destroy();
3109
+ (_g = this.adaptableStore) === null || _g === void 0 ? void 0 : _g.destroy();
3102
3110
  this.adaptableStore = null;
3103
3111
  this.adaptableOptions = null;
3104
3112
  this.adaptableStatusPanelKeys = null;
3105
- (_l = (_k = this.CalculatedColumnExpressionService) === null || _k === void 0 ? void 0 : _k.destroy) === null || _l === void 0 ? void 0 : _l.call(_k);
3113
+ (_j = (_h = this.CalculatedColumnExpressionService) === null || _h === void 0 ? void 0 : _h.destroy) === null || _j === void 0 ? void 0 : _j.call(_h);
3106
3114
  this.CalculatedColumnExpressionService = null;
3107
- (_o = (_m = this.DataService) === null || _m === void 0 ? void 0 : _m.destroy) === null || _o === void 0 ? void 0 : _o.call(_m);
3115
+ (_l = (_k = this.DataService) === null || _k === void 0 ? void 0 : _k.destroy) === null || _l === void 0 ? void 0 : _l.call(_k);
3108
3116
  this.DataService = null;
3109
- (_q = (_p = this.Fdc3Service) === null || _p === void 0 ? void 0 : _p.destroy) === null || _q === void 0 ? void 0 : _q.call(_p);
3117
+ (_o = (_m = this.Fdc3Service) === null || _m === void 0 ? void 0 : _m.destroy) === null || _o === void 0 ? void 0 : _o.call(_m);
3110
3118
  this.Fdc3Service = null;
3111
- (_s = (_r = this.ModuleService) === null || _r === void 0 ? void 0 : _r.destroy) === null || _s === void 0 ? void 0 : _s.call(_r);
3119
+ (_q = (_p = this.ModuleService) === null || _p === void 0 ? void 0 : _p.destroy) === null || _q === void 0 ? void 0 : _q.call(_p);
3112
3120
  this.ModuleService = null;
3113
- (_u = (_t = this.ValidationService) === null || _t === void 0 ? void 0 : _t.destroy) === null || _u === void 0 ? void 0 : _u.call(_t);
3121
+ (_s = (_r = this.ValidationService) === null || _r === void 0 ? void 0 : _r.destroy) === null || _s === void 0 ? void 0 : _s.call(_r);
3114
3122
  this.ValidationService = null;
3115
- (_w = (_v = this.QueryLanguageService) === null || _v === void 0 ? void 0 : _v.destroy) === null || _w === void 0 ? void 0 : _w.call(_v);
3123
+ (_u = (_t = this.QueryLanguageService) === null || _t === void 0 ? void 0 : _t.destroy) === null || _u === void 0 ? void 0 : _u.call(_t);
3116
3124
  this.QueryLanguageService = null;
3117
- (_y = (_x = this.AlertService) === null || _x === void 0 ? void 0 : _x.destroy) === null || _y === void 0 ? void 0 : _y.call(_x);
3125
+ (_w = (_v = this.AlertService) === null || _v === void 0 ? void 0 : _v.destroy) === null || _w === void 0 ? void 0 : _w.call(_v);
3118
3126
  this.AlertService = null;
3119
- (_0 = (_z = this.TeamSharingService) === null || _z === void 0 ? void 0 : _z.destroy) === null || _0 === void 0 ? void 0 : _0.call(_z);
3127
+ (_y = (_x = this.TeamSharingService) === null || _x === void 0 ? void 0 : _x.destroy) === null || _y === void 0 ? void 0 : _y.call(_x);
3120
3128
  this.TeamSharingService = null;
3121
- (_2 = (_1 = this.RowEditService) === null || _1 === void 0 ? void 0 : _1.destroy) === null || _2 === void 0 ? void 0 : _2.call(_1);
3129
+ (_0 = (_z = this.RowEditService) === null || _z === void 0 ? void 0 : _z.destroy) === null || _0 === void 0 ? void 0 : _0.call(_z);
3122
3130
  this.RowEditService = null;
3123
- (_4 = (_3 = this.MetamodelService) === null || _3 === void 0 ? void 0 : _3.destroy) === null || _4 === void 0 ? void 0 : _4.call(_3);
3131
+ (_2 = (_1 = this.MetamodelService) === null || _1 === void 0 ? void 0 : _1.destroy) === null || _2 === void 0 ? void 0 : _2.call(_1);
3124
3132
  this.MetamodelService = null;
3125
- (_6 = (_5 = this.LicenseService) === null || _5 === void 0 ? void 0 : _5.destroy) === null || _6 === void 0 ? void 0 : _6.call(_5);
3133
+ (_4 = (_3 = this.LicenseService) === null || _3 === void 0 ? void 0 : _3.destroy) === null || _4 === void 0 ? void 0 : _4.call(_3);
3126
3134
  this.LicenseService = null;
3127
- (_8 = (_7 = this.FlashingCellService) === null || _7 === void 0 ? void 0 : _7.destroy) === null || _8 === void 0 ? void 0 : _8.call(_7);
3135
+ (_6 = (_5 = this.FlashingCellService) === null || _5 === void 0 ? void 0 : _5.destroy) === null || _6 === void 0 ? void 0 : _6.call(_5);
3128
3136
  this.FlashingCellService = null;
3137
+ (_8 = (_7 = this.ThemeService) === null || _7 === void 0 ? void 0 : _7.destroy) === null || _8 === void 0 ? void 0 : _8.call(_7);
3138
+ this.ThemeService = null;
3139
+ (_10 = (_9 = this.ChartingService) === null || _9 === void 0 ? void 0 : _9.destroy) === null || _10 === void 0 ? void 0 : _10.call(_9);
3140
+ this.ChartingService = null;
3141
+ (_11 = this.unmountLoadingScreen) === null || _11 === void 0 ? void 0 : _11.call(this);
3142
+ this.unmountLoadingScreen = null;
3143
+ if (config === null || config === void 0 ? void 0 : config.unmount) {
3144
+ const abContainerElement = this.getAdaptableContainerElement();
3145
+ if (abContainerElement != null) {
3146
+ (_12 = this.unmountReactRoot) === null || _12 === void 0 ? void 0 : _12.call(this);
3147
+ }
3148
+ this.unmountReactRoot = null;
3149
+ }
3129
3150
  }
3130
3151
  canExportToExcel() {
3131
3152
  return this.agGridAdapter.isModulePresent(ModuleNames.ExcelExportModule);
@@ -327,14 +327,14 @@ export class AgGridAdapter {
327
327
  let row = this.getAgGridApi().getDisplayedRowAtIndex(0);
328
328
  if (row == null) {
329
329
  // possible that there will be no data.
330
- this.adaptableInstance.logger.warn(`No data in grid so returning type "Unknown" for Column: "${column.getColId()}"`);
330
+ this.adaptableInstance.logger.consoleError(`No data in grid, returning type "Unknown" for Column: "${column.getColId()}". This will impact several Adaptable features, such as Filters and ColumnFormats.`);
331
331
  return 'Unknown';
332
332
  }
333
333
  // if it's a group we need the content of the group
334
334
  if (row.group) {
335
335
  const childNodes = row.childrenAfterGroup;
336
336
  if (ArrayExtensions.IsNullOrEmpty(childNodes)) {
337
- this.adaptableInstance.logger.warn(`No data in grid so returning type "Unknown" for Column: "${column.getColId()}"`);
337
+ this.adaptableInstance.logger.consoleError(`No data in grid, returning type "Unknown" for Column: "${column.getColId()}". This will impact several Adaptable features, such as Filters and ColumnFormats.`);
338
338
  return 'Unknown';
339
339
  }
340
340
  row = childNodes[0];
@@ -364,7 +364,7 @@ export class AgGridAdapter {
364
364
  break;
365
365
  }
366
366
  }
367
- this.adaptableInstance.logger.warn(`No defined type for column '${column.getColId()}'. Defaulting to type of first value: ${dataType}`);
367
+ this.adaptableInstance.logger.consoleWarn(`No defined type for column '${column.getColId()}'. Defaulting to type of first row value: ${dataType}`);
368
368
  return dataType;
369
369
  }
370
370
  getAbColDefValue(colType) {