@adaptabletools/adaptable 16.0.0-canary.0 → 16.0.0-canary.1
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/bundle.cjs.js +12 -12
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +6 -1
- package/src/AdaptableOptions/AdaptableOptions.d.ts +0 -5
- package/src/Api/Implementation/CellSummaryApiImpl.js +2 -0
- package/src/PredefinedConfig/Common/CellSummary.d.ts +1 -0
- package/src/PredefinedConfig/Common/Enums.d.ts +2 -1
- package/src/PredefinedConfig/Common/Enums.js +1 -0
- package/src/Strategy/CellSummaryModule.js +1 -0
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -1
- package/src/Utilities/ObjectFactory.js +1 -0
- package/src/Utilities/Services/MetamodelService.js +4 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +5 -5
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.js +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.js +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.js +9 -9
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.js +4 -4
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +3 -3
- package/src/View/AdaptableWizardView/Wizard.js +2 -2
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +6 -2
- package/src/View/Export/ExportViewPanel.d.ts +1 -1
- package/src/agGrid/Adaptable.d.ts +7 -7
- package/src/agGrid/Adaptable.js +37 -35
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "16.0.0-canary.
|
|
3
|
+
"version": "16.0.0-canary.1",
|
|
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",
|
package/publishTimestamp.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: 1689771442961;
|
|
2
2
|
export default _default;
|
package/publishTimestamp.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartModel, ChartRef, Column, GridOptions, IRowNode, ModuleNames, RowModelType, StatusPanelDef } from '@ag-grid-community/core';
|
|
1
|
+
import { ChartModel, ChartRef, Column, GridOptions, IRowNode, Module, ModuleNames, RowModelType, StatusPanelDef } from '@ag-grid-community/core';
|
|
2
2
|
import { AdaptableApi } from '../Api/AdaptableApi';
|
|
3
3
|
import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
4
4
|
import { ColumnSort } from '../PredefinedConfig/Common/ColumnSort';
|
|
@@ -28,6 +28,10 @@ import { ColumnValuesComparer } from '../AdaptableOptions/CustomSortOptions';
|
|
|
28
28
|
import { IRowEditService } from '../Utilities/Services/Interface/IRowEditService';
|
|
29
29
|
import { RenderReactRootFn } from '../renderReactRoot';
|
|
30
30
|
import { AdaptableLogger } from '../agGrid/AdaptableLogger';
|
|
31
|
+
export interface AgGridConfig {
|
|
32
|
+
gridOptions: GridOptions;
|
|
33
|
+
modules: Module[];
|
|
34
|
+
}
|
|
31
35
|
export declare type AdaptableVariant = 'vanilla' | 'react' | 'angular';
|
|
32
36
|
/**
|
|
33
37
|
* The only interface for Adaptable
|
|
@@ -281,4 +285,5 @@ export interface IAdaptable {
|
|
|
281
285
|
getAgGridColumnForColumnId(columnId: string): Column;
|
|
282
286
|
isAgGridModulePresent(moduleName: ModuleNames): boolean;
|
|
283
287
|
getMinMaxCachedValueForColumn(column: AdaptableColumn, minMax: 'min' | 'max'): number | undefined;
|
|
288
|
+
getAgGridRegisteredModules(): Module[];
|
|
284
289
|
}
|
|
@@ -16,7 +16,6 @@ import { ToolPanelOptions } from './ToolPanelOptions';
|
|
|
16
16
|
import { FilterOptions } from './FilterOptions';
|
|
17
17
|
import { DataChangeHistoryOptions } from './DataChangeHistoryOptions';
|
|
18
18
|
import { SettingsPanelOptions } from './SettingsPanelOptions';
|
|
19
|
-
import { GridOptions } from '@ag-grid-community/core';
|
|
20
19
|
import { FlashingCellOptions } from './FlashingCellOptions';
|
|
21
20
|
import { AlertOptions } from './AlertOptions';
|
|
22
21
|
import { AdaptableQLOptions } from './AdaptableQLOptions';
|
|
@@ -55,10 +54,6 @@ export interface AdaptableOptions<TData = any> {
|
|
|
55
54
|
* @gridInfoItem
|
|
56
55
|
*/
|
|
57
56
|
autogeneratePrimaryKey?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* The AG Grid object which AdapTable interacts with. Note: if using AdapTable React or AdapTable Angular, no need to populate this property as AdapTable wires it up differently
|
|
60
|
-
*/
|
|
61
|
-
gridOptions?: GridOptions<TData>;
|
|
62
57
|
/**
|
|
63
58
|
* 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.
|
|
64
59
|
*/
|
|
@@ -50,6 +50,8 @@ class CellSummaryApiImpl extends ApiBase_1.ApiBase {
|
|
|
50
50
|
return cellSummary.Distinct;
|
|
51
51
|
case Enums_1.SummaryOperation.Count:
|
|
52
52
|
return cellSummary.Count;
|
|
53
|
+
case Enums_1.SummaryOperation.Only:
|
|
54
|
+
return cellSummary.Only;
|
|
53
55
|
default:
|
|
54
56
|
return cellSummary[operation];
|
|
55
57
|
}
|
|
@@ -77,6 +77,7 @@ var SummaryOperation;
|
|
|
77
77
|
SummaryOperation["Max"] = "Max";
|
|
78
78
|
SummaryOperation["Min"] = "Min";
|
|
79
79
|
SummaryOperation["Count"] = "Count";
|
|
80
|
+
SummaryOperation["Only"] = "Only";
|
|
80
81
|
})(SummaryOperation = exports.SummaryOperation || (exports.SummaryOperation = {}));
|
|
81
82
|
var FilterOnDataChangeOptions;
|
|
82
83
|
(function (FilterOnDataChangeOptions) {
|
|
@@ -92,6 +92,7 @@ class CellSummaryModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
92
92
|
Max: hasNumericColumns ? Helper_1.Helper.RoundNumberTo4dp(Math.max(...numericValues)) : undefined,
|
|
93
93
|
Min: hasNumericColumns ? Helper_1.Helper.RoundNumberTo4dp(Math.min(...numericValues)) : undefined,
|
|
94
94
|
Count: allValues.length,
|
|
95
|
+
Only: distinctCount == 1 ? JSON.stringify(allValues[0]) : ''
|
|
95
96
|
};
|
|
96
97
|
numericValues = [...newNumericValues];
|
|
97
98
|
const operationDefinitions = this.api.cellSummaryApi.getCellSummaryOperationDefinitions();
|
|
@@ -12,7 +12,7 @@ const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/
|
|
|
12
12
|
exports.DefaultAdaptableOptions = {
|
|
13
13
|
adaptableId: GeneralConstants.ADAPTABLE_ID,
|
|
14
14
|
adaptableStateKey: undefined,
|
|
15
|
-
|
|
15
|
+
_gridOptions: null,
|
|
16
16
|
primaryKey: '',
|
|
17
17
|
autogeneratePrimaryKey: false,
|
|
18
18
|
userName: GeneralConstants.USER_NAME,
|
|
@@ -49,6 +49,10 @@ class MetamodelService {
|
|
|
49
49
|
validateOptionsObject(validationErrors, optionsObjectName, optionsObject, optionsObjectMetamodel, optionsObjectDefaultValues) {
|
|
50
50
|
Object.entries(optionsObject).forEach(([optionKey, optionValue]) => {
|
|
51
51
|
var _a;
|
|
52
|
+
if (optionKey === 'gridOptions') {
|
|
53
|
+
// gridOptions is aspecial case as it's NOT a public property, but we set and use it internally
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
52
56
|
const optionMetamodel = (_a = optionsObjectMetamodel === null || optionsObjectMetamodel === void 0 ? void 0 : optionsObjectMetamodel.props) === null || _a === void 0 ? void 0 : _a.find((metamodelProperty) => metamodelProperty.name === optionKey);
|
|
53
57
|
if (!optionMetamodel) {
|
|
54
58
|
validationErrors.push(`${optionsObjectName}.${optionKey} (value=${optionValue}) :: unknown/unsupported property, will be ignored`);
|
|
@@ -23,11 +23,11 @@ const ConfigurationWizard = (props) => {
|
|
|
23
23
|
toolPanels: ['columns', 'filters', 'adaptable'],
|
|
24
24
|
},
|
|
25
25
|
};
|
|
26
|
-
const preparedAdaptableOptions = Object.assign(Object.assign({}, props.adaptableOptions), { gridOptions: Object.assign(Object.assign({}, gridOptionDefaults), (_a = props === null || props === void 0 ? void 0 : props.adaptableOptions) === null || _a === void 0 ? void 0 : _a.
|
|
26
|
+
const preparedAdaptableOptions = Object.assign(Object.assign({}, props.adaptableOptions), { gridOptions: Object.assign(Object.assign({}, gridOptionDefaults), (_a = props === null || props === void 0 ? void 0 : props.adaptableOptions) === null || _a === void 0 ? void 0 : _a._gridOptions) });
|
|
27
27
|
return AdaptableHelper_1.default.assignAdaptableOptions(preparedAdaptableOptions);
|
|
28
28
|
});
|
|
29
29
|
const [selectedColumns, setSelectedColumns] = (0, react_1.useState)(() => {
|
|
30
|
-
return props.adaptableOptions.
|
|
30
|
+
return props.adaptableOptions._gridOptions.columnDefs.reduce((acc, col) => {
|
|
31
31
|
acc[col.field] = true;
|
|
32
32
|
return acc;
|
|
33
33
|
}, {});
|
|
@@ -35,9 +35,9 @@ const ConfigurationWizard = (props) => {
|
|
|
35
35
|
const columnsHandle = React.useRef();
|
|
36
36
|
const handleFinish = () => {
|
|
37
37
|
const newAdaptableOptions = Object.assign({}, adaptableOptions);
|
|
38
|
-
newAdaptableOptions.
|
|
38
|
+
newAdaptableOptions._gridOptions = Object.assign({}, adaptableOptions._gridOptions);
|
|
39
39
|
if (columnsHandle.current) {
|
|
40
|
-
newAdaptableOptions.
|
|
40
|
+
newAdaptableOptions._gridOptions.columnDefs = columnsHandle
|
|
41
41
|
.current.getColumns()
|
|
42
42
|
.map((column) => {
|
|
43
43
|
const newColumn = Object.assign(Object.assign({}, column), { headerName: column.caption || StringExtensions_1.default.Humanize(column.field) });
|
|
@@ -53,7 +53,7 @@ const ConfigurationWizard = (props) => {
|
|
|
53
53
|
setIsValid(newIsValid);
|
|
54
54
|
}, []);
|
|
55
55
|
const handleColumnsChange = React.useCallback((columns) => {
|
|
56
|
-
setAdaptableOptions((adaptableOptions) => (Object.assign(Object.assign({}, adaptableOptions), {
|
|
56
|
+
setAdaptableOptions((adaptableOptions) => (Object.assign(Object.assign({}, adaptableOptions), { _gridOptions: Object.assign(Object.assign({}, adaptableOptions._gridOptions), { columnDefs: columns }) })));
|
|
57
57
|
}, []);
|
|
58
58
|
const handleColumnSelectionChange = React.useCallback((col, flag) => {
|
|
59
59
|
setSelectedColumns((selectedColumns) => {
|
package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.js
CHANGED
|
@@ -13,6 +13,6 @@ const ConfigurationWizardColumnsStep = (props) => {
|
|
|
13
13
|
}
|
|
14
14
|
return (React.createElement(ColumnsList_1.default, { theme: theme, handle: props.columnsHandle, onValidityChange: (valid) => {
|
|
15
15
|
props.setPrimaryKeyIsNotSelected(valid);
|
|
16
|
-
}, selectedColumns: props.selectedColumns, onChange: props.onColumnChange, onSelectionChange: props.onSelectionChange, columns: (_c = (_b = props.adaptableOptions) === null || _b === void 0 ? void 0 : _b.
|
|
16
|
+
}, selectedColumns: props.selectedColumns, onChange: props.onColumnChange, onSelectionChange: props.onSelectionChange, columns: (_c = (_b = props.adaptableOptions) === null || _b === void 0 ? void 0 : _b._gridOptions) === null || _c === void 0 ? void 0 : _c.columnDefs }));
|
|
17
17
|
};
|
|
18
18
|
exports.ConfigurationWizardColumnsStep = ConfigurationWizardColumnsStep;
|
package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.js
CHANGED
|
@@ -217,7 +217,7 @@ const FinanceFormSectionTitle = (props) => (React.createElement(rebass_1.Box, Ob
|
|
|
217
217
|
React.createElement(HelpBlock_1.default, null, props.children)));
|
|
218
218
|
const FinanceForm = (props) => {
|
|
219
219
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
220
|
-
const columnOptions = (_d = (_c = (_b = (_a = props.adaptableOptions) === null || _a === void 0 ? void 0 : _a.
|
|
220
|
+
const columnOptions = (_d = (_c = (_b = (_a = props.adaptableOptions) === null || _a === void 0 ? void 0 : _a._gridOptions) === null || _b === void 0 ? void 0 : _b.columnDefs) === null || _c === void 0 ? void 0 : _c.map) === null || _d === void 0 ? void 0 : _d.call(_c, (item) => {
|
|
221
221
|
var _a;
|
|
222
222
|
return ({
|
|
223
223
|
label: StringExtensions_1.default.Humanize((_a = item.headerName) !== null && _a !== void 0 ? _a : item.field),
|
|
@@ -10,22 +10,22 @@ const rebass_1 = require("rebass");
|
|
|
10
10
|
const GridOptionsForm = (props) => {
|
|
11
11
|
var _a;
|
|
12
12
|
let abOptions = props.adaptableOptions;
|
|
13
|
-
const gridOptions = Object.assign(Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.
|
|
13
|
+
const gridOptions = Object.assign(Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions._gridOptions), abOptions._gridOptions);
|
|
14
14
|
return (React.createElement(rebass_1.Box, { p: 2 },
|
|
15
15
|
React.createElement(HelpBlock_1.default, null, "Grid Options"),
|
|
16
16
|
React.createElement(FormLayout_1.default, { margin: 2, columns: [{ name: 'children' }, { name: 'label', style: { textAlign: 'start' } }] },
|
|
17
17
|
React.createElement(FormLayout_1.FormRow, { label: "Enable Range Selection" },
|
|
18
18
|
React.createElement(CheckBox_1.CheckBox, { checked: gridOptions.enableRangeSelection, onChange: (enableRangeSelection) => {
|
|
19
19
|
abOptions = Object.assign({}, abOptions);
|
|
20
|
-
abOptions.
|
|
21
|
-
abOptions.
|
|
20
|
+
abOptions._gridOptions = Object.assign({}, abOptions._gridOptions);
|
|
21
|
+
abOptions._gridOptions.enableRangeSelection = enableRangeSelection;
|
|
22
22
|
props.onChangeadAptableOptions(abOptions);
|
|
23
23
|
} })),
|
|
24
24
|
React.createElement(FormLayout_1.FormRow, { label: "Show Quick Filter" },
|
|
25
25
|
React.createElement(CheckBox_1.CheckBox, { checked: (_a = gridOptions.defaultColDef) === null || _a === void 0 ? void 0 : _a.floatingFilter, onChange: (floatingFilter) => {
|
|
26
26
|
abOptions = Object.assign({}, abOptions);
|
|
27
|
-
abOptions.
|
|
28
|
-
abOptions.
|
|
27
|
+
abOptions._gridOptions = Object.assign({}, abOptions._gridOptions);
|
|
28
|
+
abOptions._gridOptions.defaultColDef = {
|
|
29
29
|
floatingFilter,
|
|
30
30
|
};
|
|
31
31
|
props.onChangeadAptableOptions(abOptions);
|
|
@@ -33,15 +33,15 @@ const GridOptionsForm = (props) => {
|
|
|
33
33
|
React.createElement(FormLayout_1.FormRow, { label: "Suppress Column Virtualisation" },
|
|
34
34
|
React.createElement(CheckBox_1.CheckBox, { checked: gridOptions.suppressColumnVirtualisation, onChange: (suppressColumnVirtualisation) => {
|
|
35
35
|
abOptions = Object.assign({}, abOptions);
|
|
36
|
-
abOptions.
|
|
37
|
-
abOptions.
|
|
36
|
+
abOptions._gridOptions = Object.assign({}, abOptions._gridOptions);
|
|
37
|
+
abOptions._gridOptions.suppressColumnVirtualisation = suppressColumnVirtualisation;
|
|
38
38
|
props.onChangeadAptableOptions(abOptions);
|
|
39
39
|
} })),
|
|
40
40
|
React.createElement(FormLayout_1.FormRow, { label: "Show Column Menu Button" },
|
|
41
41
|
React.createElement(CheckBox_1.CheckBox, { checked: gridOptions.suppressMenuHide, onChange: (suppressMenuHide) => {
|
|
42
42
|
abOptions = Object.assign({}, abOptions);
|
|
43
|
-
abOptions.
|
|
44
|
-
abOptions.
|
|
43
|
+
abOptions._gridOptions = Object.assign({}, abOptions._gridOptions);
|
|
44
|
+
abOptions._gridOptions.suppressMenuHide = suppressMenuHide;
|
|
45
45
|
props.onChangeadAptableOptions(abOptions);
|
|
46
46
|
} })))));
|
|
47
47
|
};
|
package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.js
CHANGED
|
@@ -39,8 +39,8 @@ const isSidebarChecked = (sideBar, panelName) => {
|
|
|
39
39
|
const UIOptionsSidebarForm = (props) => {
|
|
40
40
|
var _a;
|
|
41
41
|
const { abOptions, onChange } = props;
|
|
42
|
-
const {
|
|
43
|
-
const sideBar = prepareSidebarDef(
|
|
42
|
+
const { _gridOptions } = props.abOptions;
|
|
43
|
+
const sideBar = prepareSidebarDef(_gridOptions.sideBar);
|
|
44
44
|
const renderSidebarCheckbox = (sidebarName) => {
|
|
45
45
|
return (React.createElement(CheckBox_1.CheckBox, { mr: 3, key: sidebarName, checked: isSidebarChecked(sideBar, sidebarName), onChange: (check) => handleToolpanelsChange(sidebarName, check) }, StringExtensions_1.default.Humanize(sidebarName)));
|
|
46
46
|
};
|
|
@@ -60,12 +60,12 @@ const UIOptionsSidebarForm = (props) => {
|
|
|
60
60
|
if (newPanels.length === 0) {
|
|
61
61
|
hiddenByDefault = true;
|
|
62
62
|
}
|
|
63
|
-
const newAbOptions = Object.assign(Object.assign({}, abOptions), {
|
|
63
|
+
const newAbOptions = Object.assign(Object.assign({}, abOptions), { _gridOptions: Object.assign(Object.assign({}, abOptions._gridOptions), { sideBar: Object.assign(Object.assign({}, sideBar), { toolPanels: newPanels, hiddenByDefault }) }) });
|
|
64
64
|
props.onChange(newAbOptions);
|
|
65
65
|
};
|
|
66
66
|
let sidebarPosition = (_a = sideBar === null || sideBar === void 0 ? void 0 : sideBar.position) !== null && _a !== void 0 ? _a : 'right';
|
|
67
67
|
const handleSidebarPositionChange = (position) => {
|
|
68
|
-
const newAbOptions = Object.assign(Object.assign({}, abOptions), { gridOptions: Object.assign(Object.assign({}, abOptions.
|
|
68
|
+
const newAbOptions = Object.assign(Object.assign({}, abOptions), { gridOptions: Object.assign(Object.assign({}, abOptions._gridOptions), { sideBar: Object.assign(Object.assign({}, sideBar), { position }) }) });
|
|
69
69
|
props.onChange(newAbOptions);
|
|
70
70
|
};
|
|
71
71
|
return (React.createElement(rebass_1.Box, null,
|
|
@@ -13,7 +13,7 @@ const DropdownButton_1 = tslib_1.__importDefault(require("../../../../components
|
|
|
13
13
|
const FormBox_1 = require("../Components/FormBox");
|
|
14
14
|
const UIOptionsStatusbarForm = (props) => {
|
|
15
15
|
var _a, _b, _c, _d;
|
|
16
|
-
const allPanels = (_c = (_b = (_a = props.abOptions.
|
|
16
|
+
const allPanels = (_c = (_b = (_a = props.abOptions._gridOptions) === null || _a === void 0 ? void 0 : _a.statusBar) === null || _b === void 0 ? void 0 : _b.statusPanels) !== null && _c !== void 0 ? _c : [];
|
|
17
17
|
const panelIdtoPanel = (panelsIds, align) => panelsIds.map((panelId) => {
|
|
18
18
|
const previousItem = allPanels.find((panel) => panel.key === panelId || panel.statusPanel === panelId);
|
|
19
19
|
if (previousItem) {
|
|
@@ -35,7 +35,7 @@ const UIOptionsStatusbarForm = (props) => {
|
|
|
35
35
|
const centerPanels = panelIdtoPanel(tabs[1].Items, 'center');
|
|
36
36
|
const rightPanels = panelIdtoPanel(tabs[2].Items, 'right');
|
|
37
37
|
const newStatusbarPanels = [...leftPanels, ...centerPanels, ...rightPanels];
|
|
38
|
-
props.onChange(Object.assign(Object.assign({}, props.abOptions), {
|
|
38
|
+
props.onChange(Object.assign(Object.assign({}, props.abOptions), { _gridOptions: Object.assign(Object.assign({}, props.abOptions._gridOptions), { statusBar: Object.assign(Object.assign({}, props.abOptions._gridOptions.statusBar), { statusPanels: newStatusbarPanels }) }) }));
|
|
39
39
|
};
|
|
40
40
|
const disabled = false;
|
|
41
41
|
const panelToTabItemId = (panel) => { var _a; return (_a = panel.key) !== null && _a !== void 0 ? _a : panel.statusPanel; };
|
|
@@ -78,7 +78,7 @@ const UIOptionsStatusbarForm = (props) => {
|
|
|
78
78
|
const newStatusbarPanels = [...allPanels, newAdaptablePanel];
|
|
79
79
|
setAdaptablePanelTitle('');
|
|
80
80
|
setAdaptablePanelAlign('left');
|
|
81
|
-
props.onChange(Object.assign(Object.assign({}, props.abOptions), {
|
|
81
|
+
props.onChange(Object.assign(Object.assign({}, props.abOptions), { _gridOptions: Object.assign(Object.assign({}, props.abOptions._gridOptions), { statusBar: Object.assign(Object.assign({}, props.abOptions._gridOptions.statusBar), { statusPanels: newStatusbarPanels }) }) }));
|
|
82
82
|
};
|
|
83
83
|
return (React.createElement(rebass_1.Box, null,
|
|
84
84
|
React.createElement(HelpBlock_1.default, null, "Status Bar"),
|
|
@@ -52,10 +52,10 @@ const Wizard = (props) => {
|
|
|
52
52
|
payload: `Invalid adaptable configuration - ${err}`,
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
const gridOptions = (0, helper_1.prepareGridOptions)(dataSourceInfo, (_a = props.adaptableOptions) === null || _a === void 0 ? void 0 : _a.
|
|
55
|
+
const gridOptions = (0, helper_1.prepareGridOptions)(dataSourceInfo, (_a = props.adaptableOptions) === null || _a === void 0 ? void 0 : _a._gridOptions);
|
|
56
56
|
const adaptableOptions = Object.assign({}, props.adaptableOptions);
|
|
57
57
|
adaptableOptions.adaptableId = adaptableOptions.adaptableId || (file ? file.name : '');
|
|
58
|
-
adaptableOptions.
|
|
58
|
+
adaptableOptions._gridOptions = gridOptions;
|
|
59
59
|
if (dataSourceInfo.primaryKey) {
|
|
60
60
|
adaptableOptions.primaryKey = dataSourceInfo.primaryKey;
|
|
61
61
|
}
|
|
@@ -23,9 +23,13 @@ const DataChangeHistoryGrid = (props) => {
|
|
|
23
23
|
const initializeAdaptableGrid = async () => {
|
|
24
24
|
const gridOptions = buildGridOptions(mainAdaptableInstance, changeHistoryLog);
|
|
25
25
|
const adaptableOptions = buildAdaptableOptions(mainAdaptableInstance, gridOptions, adaptableContainerId, agGridContainerId, undoChangeEnabled, onUndoChange);
|
|
26
|
+
const agGridOptions = {
|
|
27
|
+
gridOptions,
|
|
28
|
+
modules: mainAdaptableInstance.getAgGridRegisteredModules(),
|
|
29
|
+
};
|
|
26
30
|
// to avoid direct dependency to Adaptable.ts and thus creating a circular dependency;
|
|
27
31
|
const adaptableInitFn = Object.getPrototypeOf(mainAdaptableInstance).constructor.init;
|
|
28
|
-
const dataChangeHistoryAdaptableApi = await adaptableInitFn(adaptableOptions);
|
|
32
|
+
const dataChangeHistoryAdaptableApi = await adaptableInitFn(adaptableOptions, agGridOptions);
|
|
29
33
|
setAdaptableApi(dataChangeHistoryAdaptableApi);
|
|
30
34
|
};
|
|
31
35
|
initializeAdaptableGrid();
|
|
@@ -97,7 +101,7 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
|
|
|
97
101
|
};
|
|
98
102
|
}
|
|
99
103
|
const options = {
|
|
100
|
-
|
|
104
|
+
_gridOptions: gridOptions,
|
|
101
105
|
primaryKey: 'primaryKey',
|
|
102
106
|
licenseKey: mainAdaptableOptions.licenseKey,
|
|
103
107
|
userName: `${mainAdaptableOptions.userName}`,
|
|
@@ -25,5 +25,5 @@ declare class ExportViewPanelComponent extends React.Component<ExportViewPanelCo
|
|
|
25
25
|
private isCustomDestination;
|
|
26
26
|
private onNewReportSchedule;
|
|
27
27
|
}
|
|
28
|
-
export declare let ExportViewPanelControl: import("react-redux").ConnectedComponent<typeof ExportViewPanelComponent, import("react-redux").Omit<React.ClassAttributes<ExportViewPanelComponent> & ExportViewPanelComponentProps, "api" | "accessLevel" | "moduleInfo" | "
|
|
28
|
+
export declare let ExportViewPanelControl: import("react-redux").ConnectedComponent<typeof ExportViewPanelComponent, import("react-redux").Omit<React.ClassAttributes<ExportViewPanelComponent> & ExportViewPanelComponentProps, "api" | "accessLevel" | "moduleInfo" | "Columns" | "CurrentReport" | "CurrentDestination" | "viewType" | "onApplyExport" | "onSelectReport" | "onSelectDestination" | "onNewReport" | "onEditReport" | "onNewReportSchedule" | "UserReports">>;
|
|
29
29
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChartRef, ColDef, ColGroupDef, Column, ColumnRowGroupChangedEvent, ExcelStyle, GridOptions, IRowNode, Module, ModuleNames } from '@ag-grid-community/core';
|
|
2
2
|
import { AdaptableNoCodeWizardOptions, IAdaptableNoCodeWizard } from '../AdaptableInterfaces/AdaptableNoCodeWizard';
|
|
3
|
-
import { AdaptableVariant, IAdaptable } from '../AdaptableInterfaces/IAdaptable';
|
|
3
|
+
import { AdaptableVariant, AgGridConfig, IAdaptable } from '../AdaptableInterfaces/IAdaptable';
|
|
4
4
|
import { AdaptableOptions } from '../AdaptableOptions/AdaptableOptions';
|
|
5
5
|
import { AdaptablePlugin } from '../AdaptableOptions/AdaptablePlugin';
|
|
6
6
|
import { AdaptableApi } from '../Api/AdaptableApi';
|
|
@@ -39,6 +39,7 @@ import { IRowEditService } from '../Utilities/Services/Interface/IRowEditService
|
|
|
39
39
|
import { RenderReactRootFn } from '../renderReactRoot';
|
|
40
40
|
import { AdaptableLogger } from './AdaptableLogger';
|
|
41
41
|
declare type RuntimeConfig = {
|
|
42
|
+
gridOptions: GridOptions;
|
|
42
43
|
waitForAgGrid?: boolean;
|
|
43
44
|
supressReact18RenderWarning?: boolean;
|
|
44
45
|
renderReactRoot?: RenderReactRootFn;
|
|
@@ -118,21 +119,19 @@ export declare class Adaptable implements IAdaptable {
|
|
|
118
119
|
* @param runtimeConfig the list of all the provided AG Grid modules (which will be passed to the underlying AG Grid instance)
|
|
119
120
|
* @returns a Promise containing the AdaptableAPI object in order to enable run-time access to Adaptable's properties and functions
|
|
120
121
|
*/
|
|
121
|
-
static init(adaptableOptions: AdaptableOptions,
|
|
122
|
-
agGridModules: Module[];
|
|
123
|
-
}): Promise<AdaptableApi>;
|
|
122
|
+
static init(adaptableOptions: AdaptableOptions, agGridConfig: AgGridConfig): Promise<AdaptableApi>;
|
|
124
123
|
/**
|
|
125
124
|
* Lazy static constructor for Adaptable
|
|
126
125
|
* Receives an AdaptableOptions object
|
|
127
126
|
* Returns a Promise containing the AdaptableAPI object in order to enable run-time access to Adaptable's properties and functions
|
|
128
127
|
* @param adaptableOptions an instance of AdaptableOptions
|
|
129
128
|
*/
|
|
130
|
-
static initInternal(adaptableOptions: AdaptableOptions, runtimeConfig
|
|
129
|
+
static initInternal(adaptableOptions: AdaptableOptions, runtimeConfig: RuntimeConfig): Promise<AdaptableApi>;
|
|
131
130
|
private static collectInstance;
|
|
132
131
|
static forEachAdaptable(fn: (adaptable: Adaptable) => void): void;
|
|
133
132
|
private static dismissInstance;
|
|
134
133
|
constructor();
|
|
135
|
-
init(adaptableOptions: AdaptableOptions, runtimeConfig
|
|
134
|
+
init(adaptableOptions: AdaptableOptions, runtimeConfig: RuntimeConfig, _staticInit?: boolean): Promise<AdaptableApi>;
|
|
136
135
|
forPlugins(callback: (plugin: AdaptablePlugin) => any): void;
|
|
137
136
|
getPlugin(pluginId: string): AdaptablePlugin;
|
|
138
137
|
getPluginProperty(pluginId: string, propertyName: string, ...args: any): any;
|
|
@@ -328,7 +327,8 @@ export declare class Adaptable implements IAdaptable {
|
|
|
328
327
|
private applyCurrentTheme;
|
|
329
328
|
private applyFinalRendering;
|
|
330
329
|
isAgGridModulePresent(moduleName: ModuleNames): boolean;
|
|
331
|
-
|
|
330
|
+
getAgGridRegisteredModules(): Module[];
|
|
331
|
+
private getAgGridRegisteredModuleNames;
|
|
332
332
|
private onRowDataChanged;
|
|
333
333
|
private onCellDataChanged;
|
|
334
334
|
private isUndoChange;
|
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -282,14 +282,15 @@ class Adaptable {
|
|
|
282
282
|
* @param runtimeConfig the list of all the provided AG Grid modules (which will be passed to the underlying AG Grid instance)
|
|
283
283
|
* @returns a Promise containing the AdaptableAPI object in order to enable run-time access to Adaptable's properties and functions
|
|
284
284
|
*/
|
|
285
|
-
static init(adaptableOptions,
|
|
285
|
+
static init(adaptableOptions, agGridConfig) {
|
|
286
286
|
var _a;
|
|
287
|
-
if (!((_a =
|
|
287
|
+
if (!((_a = agGridConfig === null || agGridConfig === void 0 ? void 0 : agGridConfig.modules) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
288
288
|
AdaptableLogger_1.AdaptableLogger.consoleErrorBase(`No AG Grid modules were provided, thus limiting AdapTables features significantly!\n\nRead further info here:${DocumentationLinkConstants_1.AgGridModulesDocsLink}`);
|
|
289
289
|
}
|
|
290
290
|
return Adaptable.initInternal(adaptableOptions, {
|
|
291
|
+
gridOptions: agGridConfig.gridOptions,
|
|
291
292
|
supressReact18RenderWarning: true,
|
|
292
|
-
agGridModules:
|
|
293
|
+
agGridModules: agGridConfig.modules,
|
|
293
294
|
});
|
|
294
295
|
}
|
|
295
296
|
/**
|
|
@@ -354,29 +355,27 @@ class Adaptable {
|
|
|
354
355
|
async init(adaptableOptions, runtimeConfig, _staticInit) {
|
|
355
356
|
this.logger = new AdaptableLogger_1.AdaptableLogger(adaptableOptions.adaptableId || String(Date.now()));
|
|
356
357
|
const perfAdaptableInit = this.logger.beginPerf(`Adaptable init()`);
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
// releaseReactWarnings();
|
|
374
|
-
};
|
|
358
|
+
this.supressReact18RenderWarning = !!runtimeConfig.supressReact18RenderWarning;
|
|
359
|
+
if (runtimeConfig.renderReactRoot) {
|
|
360
|
+
this.renderReactRoot = (el, container) => {
|
|
361
|
+
const unmount = runtimeConfig.renderReactRoot(el, container);
|
|
362
|
+
return () => {
|
|
363
|
+
// we used to capture here because of FloatingFilters/Filters - see FloatingFilterWrapper and FilterWrapper
|
|
364
|
+
// as we didn't have a native React implementation for our React wrapper
|
|
365
|
+
// but we might need to do this again in the future for some other components that are not native React
|
|
366
|
+
// captureReactWarnings();
|
|
367
|
+
if (typeof unmount === 'function') {
|
|
368
|
+
// rAF is required, otherwise the unmount would be performed during the rendering phase and React doesn't like that
|
|
369
|
+
requestAnimationFrame(() => {
|
|
370
|
+
unmount();
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
// releaseReactWarnings();
|
|
375
374
|
};
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
if (runtimeConfig.variant) {
|
|
378
|
+
this.variant = runtimeConfig.variant;
|
|
380
379
|
}
|
|
381
380
|
if (!_staticInit) {
|
|
382
381
|
this.logger.warn(`
|
|
@@ -387,8 +386,11 @@ class Adaptable {
|
|
|
387
386
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!`);
|
|
388
387
|
}
|
|
389
388
|
this.emitter = new Emitter_1.default();
|
|
389
|
+
this.runtimeConfig = runtimeConfig;
|
|
390
|
+
this.gridOptions = this.runtimeConfig.gridOptions;
|
|
390
391
|
// we create AdaptableOptions by merging the values provided by the user with the defaults (where no value has been set)
|
|
391
392
|
this.adaptableOptions = AdaptableHelper_1.default.assignAdaptableOptions(adaptableOptions);
|
|
393
|
+
this.adaptableOptions._gridOptions = this.gridOptions;
|
|
392
394
|
if (this.hasAutogeneratedPrimaryKey()) {
|
|
393
395
|
this.logger
|
|
394
396
|
.warn(`Autogenerated primary key (adaptableOptions.autogeneratedPrimaryKey = TRUE) should be used only as a last resort,
|
|
@@ -398,8 +400,6 @@ class Adaptable {
|
|
|
398
400
|
this.adaptableOptions.primaryKey = GeneralConstants_1.AUTOGENERATED_PK_COLUMN;
|
|
399
401
|
}
|
|
400
402
|
Adaptable.collectInstance(this);
|
|
401
|
-
this.runtimeConfig = runtimeConfig || {};
|
|
402
|
-
this.gridOptions = this.adaptableOptions.gridOptions;
|
|
403
403
|
if (this.gridOptions.allowContextMenuWithControlKey === undefined) {
|
|
404
404
|
this.gridOptions.allowContextMenuWithControlKey = true;
|
|
405
405
|
}
|
|
@@ -444,6 +444,8 @@ class Adaptable {
|
|
|
444
444
|
// @ts-ignore
|
|
445
445
|
this.RowEditService = new RowEditService_1.RowEditService(this.api);
|
|
446
446
|
this.MetamodelService = new MetamodelService_1.MetamodelService(() => this.api.optionsApi.getAdaptableOptions());
|
|
447
|
+
// validate the provided AdaptableOptions
|
|
448
|
+
this.MetamodelService.validateAdaptableOptionsValues();
|
|
447
449
|
this.forPlugins((plugin) => plugin.afterInitServices(this));
|
|
448
450
|
// Set up Modules - we set up all the Modules suitable for AG Grid
|
|
449
451
|
// But users can make some hidden or readonly in their entitlements
|
|
@@ -463,15 +465,13 @@ class Adaptable {
|
|
|
463
465
|
this.gridOptions.columnTypes.abColDefDate.cellEditor =
|
|
464
466
|
this.variant === 'react' ? AdaptableDateEditor_1.ReactAdaptableDateEditor : AdaptableDateEditor_1.AdaptableDateEditor;
|
|
465
467
|
}
|
|
466
|
-
// validate the provided AdaptableOptions
|
|
467
|
-
this.MetamodelService.validateAdaptableOptionsValues();
|
|
468
468
|
return this.initializeAgGrid().then((initialized) => {
|
|
469
469
|
if (!initialized) {
|
|
470
470
|
// we have no grid, we can't do anything
|
|
471
471
|
this.logger.error('Unable to set up AG Grid');
|
|
472
472
|
return this.api;
|
|
473
473
|
}
|
|
474
|
-
this.logger.info(`Registered AG Grid modules: `, this.
|
|
474
|
+
this.logger.info(`Registered AG Grid modules: `, this.getAgGridRegisteredModuleNames().sort());
|
|
475
475
|
let self = this;
|
|
476
476
|
// add our adaptable object to the grid options api object
|
|
477
477
|
// this is VERY useful for when we need to access Adaptable inside of agGrid only functions
|
|
@@ -584,7 +584,7 @@ class Adaptable {
|
|
|
584
584
|
this.logger.info('emit AdaptableReady');
|
|
585
585
|
this.api.eventApi.emit('AdaptableReady', {
|
|
586
586
|
adaptableApi: this.api,
|
|
587
|
-
gridOptions: this.
|
|
587
|
+
gridOptions: this.gridOptions,
|
|
588
588
|
});
|
|
589
589
|
// }, 0);
|
|
590
590
|
perfInitState.end();
|
|
@@ -3781,6 +3781,9 @@ class Adaptable {
|
|
|
3781
3781
|
return !!allGridModulesMap[moduleName];
|
|
3782
3782
|
}
|
|
3783
3783
|
getAgGridRegisteredModules() {
|
|
3784
|
+
return core_1.ModuleRegistry.__getRegisteredModules(this.gridOptions.gridId);
|
|
3785
|
+
}
|
|
3786
|
+
getAgGridRegisteredModuleNames() {
|
|
3784
3787
|
return core_1.ModuleRegistry.__getRegisteredModules(this.gridOptions.gridId).map((module) => module.moduleName);
|
|
3785
3788
|
}
|
|
3786
3789
|
onRowDataChanged({ rowNode, oldData, newData, }) {
|
|
@@ -5133,13 +5136,12 @@ class AdaptableNoCodeWizard {
|
|
|
5133
5136
|
constructor(adaptableOptions, extraOptions = {}) {
|
|
5134
5137
|
var _a;
|
|
5135
5138
|
const defaultInit = async ({ gridOptions, adaptableOptions, agGridModules, }) => {
|
|
5136
|
-
adaptableOptions
|
|
5137
|
-
return await Adaptable.init(adaptableOptions, { agGridModules: agGridModules });
|
|
5139
|
+
return await Adaptable.init(adaptableOptions, { gridOptions, modules: agGridModules });
|
|
5138
5140
|
};
|
|
5139
5141
|
this.adaptableOptions = adaptableOptions;
|
|
5140
5142
|
this.init = extraOptions.onInit || defaultInit;
|
|
5141
5143
|
this.extraOptions = extraOptions;
|
|
5142
|
-
this.agGridModules = core_1.ModuleRegistry.__getRegisteredModules((_a = this.adaptableOptions.
|
|
5144
|
+
this.agGridModules = core_1.ModuleRegistry.__getRegisteredModules((_a = this.adaptableOptions._gridOptions) === null || _a === void 0 ? void 0 : _a.gridId);
|
|
5143
5145
|
this.render();
|
|
5144
5146
|
}
|
|
5145
5147
|
render(container) {
|
|
@@ -5168,7 +5170,7 @@ class AdaptableNoCodeWizard {
|
|
|
5168
5170
|
unmount();
|
|
5169
5171
|
this.init({
|
|
5170
5172
|
adaptableOptions,
|
|
5171
|
-
gridOptions: adaptableOptions.
|
|
5173
|
+
gridOptions: adaptableOptions._gridOptions,
|
|
5172
5174
|
agGridModules: [...this.agGridModules],
|
|
5173
5175
|
});
|
|
5174
5176
|
} })), container, true);
|