@adaptabletools/adaptable-plugin-master-detail-aggrid-cjs 18.0.0-canary.8 → 18.0.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.
- package/package.json +2 -2
- package/src/DetailCellRenderer.js +23 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-plugin-master-detail-aggrid-cjs",
|
|
3
|
-
"version": "18.0.0
|
|
3
|
+
"version": "18.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "http://www.adaptabletools.com/",
|
|
6
6
|
"author": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"typings": "src/index.d.ts",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"tslib": "^2.3.0",
|
|
14
|
-
"@adaptabletools/adaptable-cjs": "18.0.0
|
|
14
|
+
"@adaptabletools/adaptable-cjs": "18.0.0"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"ag-grid-enterprise": ">=31.1.0"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DetailCellRenderer = void 0;
|
|
4
|
-
const
|
|
4
|
+
const AdaptableAgGrid_1 = require("@adaptabletools/adaptable-cjs/src/agGrid/AdaptableAgGrid");
|
|
5
5
|
// @ts-ignore because we override the private setDetailGrid() method
|
|
6
6
|
// TODO: add interface to implement
|
|
7
7
|
class DetailCellRenderer {
|
|
@@ -32,7 +32,27 @@ class DetailCellRenderer {
|
|
|
32
32
|
: detailAdaptableOptions.predefinedConfig;
|
|
33
33
|
// AG Grid modules are already registered
|
|
34
34
|
const agGridModules = masterAdaptable.getAgGridRegisteredModules();
|
|
35
|
-
this.adaptableApi = await
|
|
35
|
+
this.adaptableApi = await AdaptableAgGrid_1.AdaptableAgGrid._initInternal({
|
|
36
|
+
adaptableOptions: Object.assign(Object.assign({ licenseKey: masterAdaptable.api.optionsApi.getLicenseKey(), adaptableId: `${masterAdaptable.adaptableOptions.adaptableId} Detail` }, detailAdaptableOptions), { predefinedConfig: Object.assign(Object.assign({}, predefinedConfig), { Dashboard: Object.assign({ IsCollapsed: true }, predefinedConfig.Dashboard) }), containerOptions: Object.assign(Object.assign({}, detailAdaptableOptions.containerOptions), { adaptableContainer: adaptableContainer, agGridContainer: this.eGui }) }),
|
|
37
|
+
modules: agGridModules,
|
|
38
|
+
gridOptions: detailGridOptions,
|
|
39
|
+
variant: 'vanilla',
|
|
40
|
+
isDetailGrid: true,
|
|
41
|
+
});
|
|
42
|
+
masterAdaptable.api.eventApi.on('ThemeChanged', () => {
|
|
43
|
+
const masterTheme = masterAdaptable.api.themeApi.getCurrentTheme();
|
|
44
|
+
const detailTheme = this.adaptableApi.themeApi.getCurrentTheme();
|
|
45
|
+
if (masterTheme !== detailTheme) {
|
|
46
|
+
this.adaptableApi.themeApi.loadTheme(masterTheme);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
this.adaptableApi.eventApi.on('ThemeChanged', () => {
|
|
50
|
+
const masterTheme = masterAdaptable.api.themeApi.getCurrentTheme();
|
|
51
|
+
const detailTheme = this.adaptableApi.themeApi.getCurrentTheme();
|
|
52
|
+
if (masterTheme !== detailTheme) {
|
|
53
|
+
masterAdaptable.api.themeApi.loadTheme(detailTheme);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
36
56
|
this.adaptableApi.internalApi.getAdaptableInstance().updateColumnModelAndRefreshGrid();
|
|
37
57
|
this.loadRowData();
|
|
38
58
|
if (onDetailInit) {
|
|
@@ -87,7 +107,7 @@ class DetailCellRenderer {
|
|
|
87
107
|
}
|
|
88
108
|
const successCallback = (rowData) => {
|
|
89
109
|
const mostRecentCall = this.loadRowDataVersion === versionThisCall;
|
|
90
|
-
if (mostRecentCall) {
|
|
110
|
+
if (mostRecentCall && !this.adaptableDestroyed && this.adaptableApi) {
|
|
91
111
|
this.adaptableApi.gridApi.addGridData(rowData);
|
|
92
112
|
}
|
|
93
113
|
};
|