@adaptabletools/adaptable-cjs 19.1.1 → 19.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -5
- package/src/AdaptableOptions/AlertOptions.d.ts +3 -0
- package/src/AdaptableOptions/ColumnMenuOptions.d.ts +1 -1
- package/src/AdaptableOptions/CommentOptions.d.ts +2 -2
- package/src/AdaptableOptions/NoteOptions.d.ts +2 -2
- package/src/Api/AdaptableApi.d.ts +21 -11
- package/src/Api/Events/GridDataChanged.d.ts +3 -0
- package/src/Api/GridApi.d.ts +6 -2
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +3 -6
- package/src/Api/Implementation/AdaptableApiImpl.js +1 -1
- package/src/Api/Implementation/GridApiImpl.js +3 -1
- package/src/Api/Internal/CommentsInternalApi.d.ts +1 -0
- package/src/Api/Internal/CommentsInternalApi.js +4 -0
- package/src/Api/Internal/NoteInternalApi.d.ts +1 -0
- package/src/Api/Internal/NoteInternalApi.js +4 -0
- package/src/PredefinedConfig/Common/ExtendedLayoutInfo.d.ts +15 -0
- package/src/PredefinedConfig/Common/FilterActionOnDataChange.d.ts +3 -0
- package/src/View/Comments/CommentsEditor.js +2 -2
- package/src/View/Comments/CommentsPopup.js +1 -4
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
- package/src/View/Layout/TransposedPopup.js +2 -2
- package/src/View/Note/NotePopup.js +1 -4
- package/src/agGrid/AdaptableAgGrid.d.ts +2 -5
- package/src/agGrid/AdaptableAgGrid.js +47 -26
- package/src/agGrid/AgGridAdapter.js +3 -3
- package/src/agGrid/defaultAdaptableOptions.js +100 -96
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +32 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-cjs",
|
|
3
|
-
"version": "19.1.
|
|
3
|
+
"version": "19.1.2",
|
|
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
|
|
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
|
|
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 -
|
|
262
|
-
*
|
|
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
|
-
*
|
|
285
|
+
* Destroy the AgGrid instance
|
|
274
286
|
*
|
|
287
|
+
* @defaultValue true
|
|
275
288
|
*/
|
|
276
|
-
|
|
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
|
package/src/Api/GridApi.d.ts
CHANGED
|
@@ -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
|
|
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
|
-
*
|
|
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
|
-
|
|
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;
|
|
@@ -10,6 +10,7 @@ const GridInternalApi_1 = require("../Internal/GridInternalApi");
|
|
|
10
10
|
const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
|
|
11
11
|
const windowFactory_1 = require("../../View/Components/Popups/WindowPopups/windowFactory");
|
|
12
12
|
const RowSummary_1 = require("../../PredefinedConfig/Common/RowSummary");
|
|
13
|
+
const logDeprecation_1 = require("../../Utilities/logDeprecation");
|
|
13
14
|
class GridApiImpl extends ApiBase_1.ApiBase {
|
|
14
15
|
constructor(_adaptable) {
|
|
15
16
|
super(_adaptable);
|
|
@@ -554,7 +555,8 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
554
555
|
this._adaptable.deselectAll();
|
|
555
556
|
}
|
|
556
557
|
destroy() {
|
|
557
|
-
this._adaptable.destroy
|
|
558
|
+
(0, logDeprecation_1.logDeprecationExternal)(this._adaptable.logger, 'GridApi', 'destroy', 'AdaptableApi', 'destroy');
|
|
559
|
+
this.getAdaptableApi().destroy();
|
|
558
560
|
}
|
|
559
561
|
getGridContainerElement() {
|
|
560
562
|
return this._adaptable.getAgGridContainerElement();
|
|
@@ -10,5 +10,9 @@ class CommentsInternalApi extends ApiBase_1.ApiBase {
|
|
|
10
10
|
}
|
|
11
11
|
return true;
|
|
12
12
|
}
|
|
13
|
+
getCommentsDateFormat() {
|
|
14
|
+
const dateFormat = this.getCommentOptions().dateFormat;
|
|
15
|
+
return typeof dateFormat === 'function' ? dateFormat() : dateFormat;
|
|
16
|
+
}
|
|
13
17
|
}
|
|
14
18
|
exports.CommentsInternalApi = CommentsInternalApi;
|
|
@@ -10,5 +10,9 @@ class NoteInternalApi extends ApiBase_1.ApiBase {
|
|
|
10
10
|
}
|
|
11
11
|
return true;
|
|
12
12
|
}
|
|
13
|
+
getNotesDateFormat() {
|
|
14
|
+
const dateFormat = this.getNoteOptions().dateFormat;
|
|
15
|
+
return typeof dateFormat === 'function' ? dateFormat() : dateFormat;
|
|
16
|
+
}
|
|
13
17
|
}
|
|
14
18
|
exports.NoteInternalApi = NoteInternalApi;
|
|
@@ -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
|
}
|
|
@@ -10,9 +10,9 @@ const Panel_1 = tslib_1.__importDefault(require("../../components/Panel"));
|
|
|
10
10
|
const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
|
|
11
11
|
const CommentsRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/CommentsRedux"));
|
|
12
12
|
const SystemRedux_1 = require("../../Redux/ActionsReducers/SystemRedux");
|
|
13
|
-
const dateUtils_1 = require("../../Utilities/ExpressionFunctions/dateUtils");
|
|
14
13
|
const AdaptableContext_1 = require("../AdaptableContext");
|
|
15
14
|
const AdaptableInput_1 = tslib_1.__importDefault(require("../Components/AdaptableInput"));
|
|
15
|
+
const format_1 = tslib_1.__importDefault(require("date-fns/format"));
|
|
16
16
|
// Edit Mode
|
|
17
17
|
// [author] [edit, delete]
|
|
18
18
|
// [text-editor] * this is different
|
|
@@ -82,7 +82,7 @@ const CommentsEditor = (props) => {
|
|
|
82
82
|
React.createElement(rebass_1.Flex, { mb: 2, alignItems: "center" },
|
|
83
83
|
React.createElement(rebass_1.Box, null,
|
|
84
84
|
React.createElement(rebass_1.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),
|
|
85
|
-
comment.Timestamp && (React.createElement(rebass_1.Box, { "data-name": "comment-timestamp", fontSize: 2 }, (0,
|
|
85
|
+
comment.Timestamp && (React.createElement(rebass_1.Box, { "data-name": "comment-timestamp", fontSize: 2 }, (0, format_1.default)(comment.Timestamp, adaptable.api.commentApi.internalApi.getCommentsDateFormat())))),
|
|
86
86
|
React.createElement(rebass_1.Box, { flex: 1 }),
|
|
87
87
|
React.createElement(SimpleButton_1.default, { variant: "text", icon: "edit", disabled: !isOwnComment || isReadOnlyModule, onClick: () => setActiveEditingComment(comment.Uuid) }),
|
|
88
88
|
React.createElement(SimpleButton_1.default, { variant: "text", icon: "delete", disabled: !isOwnComment || isReadOnlyModule, onClick: () => {
|
|
@@ -11,7 +11,6 @@ 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");
|
|
15
14
|
const tableDOMProps = {
|
|
16
15
|
style: {
|
|
17
16
|
minHeight: 160,
|
|
@@ -19,9 +18,7 @@ const tableDOMProps = {
|
|
|
19
18
|
},
|
|
20
19
|
};
|
|
21
20
|
const CellComments = (props) => {
|
|
22
|
-
var _a;
|
|
23
21
|
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;
|
|
25
22
|
const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Comment') === 'ReadOnly';
|
|
26
23
|
const columnsMap = React.useMemo(() => {
|
|
27
24
|
const columns = {
|
|
@@ -34,7 +31,7 @@ const CellComments = (props) => {
|
|
|
34
31
|
field: 'Timestamp',
|
|
35
32
|
maxWidth: 150,
|
|
36
33
|
valueGetter: (params) => {
|
|
37
|
-
return (0, format_1.default)(params.data.Timestamp,
|
|
34
|
+
return (0, format_1.default)(params.data.Timestamp, adaptable.api.commentApi.internalApi.getCommentsDateFormat());
|
|
38
35
|
},
|
|
39
36
|
},
|
|
40
37
|
text: {
|
|
@@ -35,7 +35,7 @@ const DataChangeHistoryGrid = (props) => {
|
|
|
35
35
|
return () => {
|
|
36
36
|
requestAnimationFrame(() => {
|
|
37
37
|
var _a;
|
|
38
|
-
(_a = adaptableApiRef.current) === null || _a === void 0 ? void 0 : _a.internalApi.getAdaptableInstance().destroy({ unmount: true,
|
|
38
|
+
(_a = adaptableApiRef.current) === null || _a === void 0 ? void 0 : _a.internalApi.getAdaptableInstance().destroy({ unmount: true, destroyAgGrid: true });
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
41
|
}, []);
|
|
@@ -25,7 +25,7 @@ const TransposedPopup = (props) => {
|
|
|
25
25
|
const [syntheticTransposedByColumnId, doSetSyntheticTransposedByColumnId] = React.useState(transposedColumnId);
|
|
26
26
|
const setSyntheticTransposedByColumnId = (syntheticTransposedByColumnId) => {
|
|
27
27
|
var _a;
|
|
28
|
-
(_a = transposedAdaptableApiRef.current) === null || _a === void 0 ? void 0 : _a.destroy({ unmount: true,
|
|
28
|
+
(_a = transposedAdaptableApiRef.current) === null || _a === void 0 ? void 0 : _a.destroy({ unmount: true, destroyAgGrid: true });
|
|
29
29
|
doSetSyntheticTransposedByColumnId(syntheticTransposedByColumnId);
|
|
30
30
|
};
|
|
31
31
|
const transposedAdaptableApiRef = React.useRef(null);
|
|
@@ -185,7 +185,7 @@ const TransposedPopup = (props) => {
|
|
|
185
185
|
return () => {
|
|
186
186
|
requestAnimationFrame(() => {
|
|
187
187
|
var _a;
|
|
188
|
-
(_a = transposedAdaptableApiRef.current) === null || _a === void 0 ? void 0 : _a.destroy({ unmount: true,
|
|
188
|
+
(_a = transposedAdaptableApiRef.current) === null || _a === void 0 ? void 0 : _a.destroy({ unmount: true, destroyAgGrid: true });
|
|
189
189
|
});
|
|
190
190
|
};
|
|
191
191
|
}, []);
|
|
@@ -10,7 +10,6 @@ const format_1 = tslib_1.__importDefault(require("date-fns/format"));
|
|
|
10
10
|
const AdaptableContext_1 = require("../AdaptableContext");
|
|
11
11
|
const AdaptableButton_1 = require("../Components/AdaptableButton");
|
|
12
12
|
const PopupPanel_1 = require("../Components/Popups/AdaptablePopup/PopupPanel");
|
|
13
|
-
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
14
13
|
const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
|
|
15
14
|
const tableDOMProps = {
|
|
16
15
|
style: {
|
|
@@ -20,12 +19,10 @@ const tableDOMProps = {
|
|
|
20
19
|
},
|
|
21
20
|
};
|
|
22
21
|
const NotePopup = (props) => {
|
|
23
|
-
var _a, _b, _c, _d;
|
|
24
22
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
25
23
|
const primaryKeyHeader = adaptable.api.columnApi.getPrimaryKeyColumn()
|
|
26
24
|
? adaptable.api.columnApi.getFriendlyNameForColumnId(adaptable.api.columnApi.getPrimaryKeyColumn().columnId)
|
|
27
25
|
: StringExtensions_1.default.Humanize(adaptable.adaptableOptions.primaryKey);
|
|
28
|
-
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 : GeneralConstants_1.DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME;
|
|
29
26
|
const allNotes = (0, react_redux_1.useSelector)((state) => (0, NoteRedux_1.GetAllNotesSelector)(state.Note));
|
|
30
27
|
const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Note') === 'ReadOnly';
|
|
31
28
|
const columnsMap = React.useMemo(() => {
|
|
@@ -50,7 +47,7 @@ const NotePopup = (props) => {
|
|
|
50
47
|
timestamp: {
|
|
51
48
|
field: 'Timestamp',
|
|
52
49
|
valueGetter: (params) => {
|
|
53
|
-
return (0, format_1.default)(params.data.Timestamp,
|
|
50
|
+
return (0, format_1.default)(params.data.Timestamp, adaptable.api.noteApi.internalApi.getNotesDateFormat());
|
|
54
51
|
},
|
|
55
52
|
},
|
|
56
53
|
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;
|
|
@@ -2978,7 +2978,25 @@ class AdaptableAgGrid {
|
|
|
2978
2978
|
return this.agGridAdapter.getRegisteredModules();
|
|
2979
2979
|
}
|
|
2980
2980
|
destroy(config) {
|
|
2981
|
-
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;
|
|
2981
|
+
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;
|
|
2982
|
+
if (!config) {
|
|
2983
|
+
config = {
|
|
2984
|
+
unmount: true,
|
|
2985
|
+
destroyAgGrid: true,
|
|
2986
|
+
};
|
|
2987
|
+
}
|
|
2988
|
+
else {
|
|
2989
|
+
// should not happen unless someone ignored the TypeScript warnings
|
|
2990
|
+
if (config.unmount == undefined) {
|
|
2991
|
+
config.unmount = true;
|
|
2992
|
+
}
|
|
2993
|
+
if (config.destroyAgGrid == undefined) {
|
|
2994
|
+
config.destroyAgGrid = true;
|
|
2995
|
+
}
|
|
2996
|
+
}
|
|
2997
|
+
if ((config === null || config === void 0 ? void 0 : config.destroyApi) === true) {
|
|
2998
|
+
this.logger.warn(`Use of 'destroyApi' is deprecated. Use 'destroyAgGrid' instead.`);
|
|
2999
|
+
}
|
|
2982
3000
|
if (((_a = this.agGridAdapter) === null || _a === void 0 ? void 0 : _a.getAgGridApi()) && !this.agGridAdapter.getAgGridApi().isDestroyed()) {
|
|
2983
3001
|
this.agGridAdapter
|
|
2984
3002
|
.getAgGridApi()
|
|
@@ -3061,7 +3079,7 @@ class AdaptableAgGrid {
|
|
|
3061
3079
|
}
|
|
3062
3080
|
}
|
|
3063
3081
|
DANGER_AG_GRID_BEANS_MAP[this._agGridId] = null;
|
|
3064
|
-
if ((config === null || config === void 0 ? void 0 : config.destroyApi) === true) {
|
|
3082
|
+
if ((config === null || config === void 0 ? void 0 : config.destroyApi) === true || (config === null || config === void 0 ? void 0 : config.destroyAgGrid) === true) {
|
|
3065
3083
|
(_b = this.agGridAdapter.getAgGridApi()) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
3066
3084
|
}
|
|
3067
3085
|
this.previousAgGridLayoutState = '';
|
|
@@ -3074,7 +3092,7 @@ class AdaptableAgGrid {
|
|
|
3074
3092
|
this.agGridListenerMouseEnter = null;
|
|
3075
3093
|
this.agGridListenerMouseLeave = null;
|
|
3076
3094
|
}
|
|
3077
|
-
this.api.
|
|
3095
|
+
this.api._internalDestroySelf();
|
|
3078
3096
|
(_c = this.agGridOptionsService) === null || _c === void 0 ? void 0 : _c.destroy();
|
|
3079
3097
|
this.agGridOptionsService = null;
|
|
3080
3098
|
(_d = this.agGridAdapter) === null || _d === void 0 ? void 0 : _d.destroy();
|
|
@@ -3090,46 +3108,49 @@ class AdaptableAgGrid {
|
|
|
3090
3108
|
this.columnMinMaxValuesCache = null;
|
|
3091
3109
|
this.lifecycleState = 'preDestroyed';
|
|
3092
3110
|
AdaptableAgGrid.dismissInstance(this);
|
|
3093
|
-
(_g = this.unmountLoadingScreen) === null || _g === void 0 ? void 0 : _g.call(this);
|
|
3094
|
-
this.unmountLoadingScreen = null;
|
|
3095
|
-
if (config && !config.unmount) {
|
|
3096
|
-
return;
|
|
3097
|
-
}
|
|
3098
|
-
const abContainerElement = this.getAdaptableContainerElement();
|
|
3099
|
-
if (abContainerElement != null) {
|
|
3100
|
-
(_h = this.unmountReactRoot) === null || _h === void 0 ? void 0 : _h.call(this);
|
|
3101
|
-
}
|
|
3102
|
-
this.unmountReactRoot = null;
|
|
3103
3111
|
this.DANGER_USE_GETTER_adaptableContainerElement = null;
|
|
3104
3112
|
this.DANGER_USE_GETTER_agGridContainerElement = null;
|
|
3105
|
-
(
|
|
3113
|
+
(_g = this.adaptableStore) === null || _g === void 0 ? void 0 : _g.destroy();
|
|
3106
3114
|
this.adaptableStore = null;
|
|
3107
3115
|
this.adaptableOptions = null;
|
|
3108
3116
|
this.adaptableStatusPanelKeys = null;
|
|
3109
|
-
(
|
|
3117
|
+
(_j = (_h = this.CalculatedColumnExpressionService) === null || _h === void 0 ? void 0 : _h.destroy) === null || _j === void 0 ? void 0 : _j.call(_h);
|
|
3110
3118
|
this.CalculatedColumnExpressionService = null;
|
|
3111
|
-
(
|
|
3119
|
+
(_l = (_k = this.DataService) === null || _k === void 0 ? void 0 : _k.destroy) === null || _l === void 0 ? void 0 : _l.call(_k);
|
|
3112
3120
|
this.DataService = null;
|
|
3113
|
-
(
|
|
3121
|
+
(_o = (_m = this.Fdc3Service) === null || _m === void 0 ? void 0 : _m.destroy) === null || _o === void 0 ? void 0 : _o.call(_m);
|
|
3114
3122
|
this.Fdc3Service = null;
|
|
3115
|
-
(
|
|
3123
|
+
(_q = (_p = this.ModuleService) === null || _p === void 0 ? void 0 : _p.destroy) === null || _q === void 0 ? void 0 : _q.call(_p);
|
|
3116
3124
|
this.ModuleService = null;
|
|
3117
|
-
(
|
|
3125
|
+
(_s = (_r = this.ValidationService) === null || _r === void 0 ? void 0 : _r.destroy) === null || _s === void 0 ? void 0 : _s.call(_r);
|
|
3118
3126
|
this.ValidationService = null;
|
|
3119
|
-
(
|
|
3127
|
+
(_u = (_t = this.QueryLanguageService) === null || _t === void 0 ? void 0 : _t.destroy) === null || _u === void 0 ? void 0 : _u.call(_t);
|
|
3120
3128
|
this.QueryLanguageService = null;
|
|
3121
|
-
(
|
|
3129
|
+
(_w = (_v = this.AlertService) === null || _v === void 0 ? void 0 : _v.destroy) === null || _w === void 0 ? void 0 : _w.call(_v);
|
|
3122
3130
|
this.AlertService = null;
|
|
3123
|
-
(
|
|
3131
|
+
(_y = (_x = this.TeamSharingService) === null || _x === void 0 ? void 0 : _x.destroy) === null || _y === void 0 ? void 0 : _y.call(_x);
|
|
3124
3132
|
this.TeamSharingService = null;
|
|
3125
|
-
(
|
|
3133
|
+
(_0 = (_z = this.RowEditService) === null || _z === void 0 ? void 0 : _z.destroy) === null || _0 === void 0 ? void 0 : _0.call(_z);
|
|
3126
3134
|
this.RowEditService = null;
|
|
3127
|
-
(
|
|
3135
|
+
(_2 = (_1 = this.MetamodelService) === null || _1 === void 0 ? void 0 : _1.destroy) === null || _2 === void 0 ? void 0 : _2.call(_1);
|
|
3128
3136
|
this.MetamodelService = null;
|
|
3129
|
-
(
|
|
3137
|
+
(_4 = (_3 = this.LicenseService) === null || _3 === void 0 ? void 0 : _3.destroy) === null || _4 === void 0 ? void 0 : _4.call(_3);
|
|
3130
3138
|
this.LicenseService = null;
|
|
3131
|
-
(
|
|
3139
|
+
(_6 = (_5 = this.FlashingCellService) === null || _5 === void 0 ? void 0 : _5.destroy) === null || _6 === void 0 ? void 0 : _6.call(_5);
|
|
3132
3140
|
this.FlashingCellService = null;
|
|
3141
|
+
(_8 = (_7 = this.ThemeService) === null || _7 === void 0 ? void 0 : _7.destroy) === null || _8 === void 0 ? void 0 : _8.call(_7);
|
|
3142
|
+
this.ThemeService = null;
|
|
3143
|
+
(_10 = (_9 = this.ChartingService) === null || _9 === void 0 ? void 0 : _9.destroy) === null || _10 === void 0 ? void 0 : _10.call(_9);
|
|
3144
|
+
this.ChartingService = null;
|
|
3145
|
+
(_11 = this.unmountLoadingScreen) === null || _11 === void 0 ? void 0 : _11.call(this);
|
|
3146
|
+
this.unmountLoadingScreen = null;
|
|
3147
|
+
if (config === null || config === void 0 ? void 0 : config.unmount) {
|
|
3148
|
+
const abContainerElement = this.getAdaptableContainerElement();
|
|
3149
|
+
if (abContainerElement != null) {
|
|
3150
|
+
(_12 = this.unmountReactRoot) === null || _12 === void 0 ? void 0 : _12.call(this);
|
|
3151
|
+
}
|
|
3152
|
+
this.unmountReactRoot = null;
|
|
3153
|
+
}
|
|
3133
3154
|
}
|
|
3134
3155
|
canExportToExcel() {
|
|
3135
3156
|
return this.agGridAdapter.isModulePresent(core_1.ModuleNames.ExcelExportModule);
|
|
@@ -331,14 +331,14 @@ class AgGridAdapter {
|
|
|
331
331
|
let row = this.getAgGridApi().getDisplayedRowAtIndex(0);
|
|
332
332
|
if (row == null) {
|
|
333
333
|
// possible that there will be no data.
|
|
334
|
-
this.adaptableInstance.logger.
|
|
334
|
+
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.`);
|
|
335
335
|
return 'Unknown';
|
|
336
336
|
}
|
|
337
337
|
// if it's a group we need the content of the group
|
|
338
338
|
if (row.group) {
|
|
339
339
|
const childNodes = row.childrenAfterGroup;
|
|
340
340
|
if (ArrayExtensions_1.default.IsNullOrEmpty(childNodes)) {
|
|
341
|
-
this.adaptableInstance.logger.
|
|
341
|
+
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.`);
|
|
342
342
|
return 'Unknown';
|
|
343
343
|
}
|
|
344
344
|
row = childNodes[0];
|
|
@@ -368,7 +368,7 @@ class AgGridAdapter {
|
|
|
368
368
|
break;
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
-
this.adaptableInstance.logger.
|
|
371
|
+
this.adaptableInstance.logger.consoleWarn(`No defined type for column '${column.getColId()}'. Defaulting to type of first row value: ${dataType}`);
|
|
372
372
|
return dataType;
|
|
373
373
|
}
|
|
374
374
|
getAbColDefValue(colType) {
|