@adaptabletools/adaptable-cjs 18.1.14 → 18.1.15-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.
- package/package.json +2 -2
- package/src/AdaptableInterfaces/IAdaptable.d.ts +3 -5
- package/src/AdaptableOptions/AlertOptions.d.ts +2 -1
- package/src/AdaptableOptions/ChartingOptions.d.ts +5 -1
- package/src/AdaptableOptions/ColumnFilterOptions.d.ts +5 -1
- package/src/AdaptableOptions/DashboardOptions.d.ts +5 -1
- package/src/AdaptableOptions/FlashingCellOptions.d.ts +5 -1
- package/src/AdaptableOptions/LayoutOptions.d.ts +5 -1
- package/src/AdaptableOptions/NotificationsOptions.d.ts +6 -2
- package/src/AdaptableOptions/SettingsPanelOptions.d.ts +5 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +1 -1
- package/src/Api/ChartingApi.d.ts +2 -2
- package/src/Api/ColumnApi.d.ts +6 -0
- package/src/Api/ConfigApi.d.ts +22 -2
- package/src/Api/Events/LiveDataChanged.d.ts +1 -1
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ChartingApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ChartingApiImpl.js +2 -2
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ColumnApiImpl.js +3 -0
- package/src/Api/Implementation/ConfigApiImpl.d.ts +4 -1
- package/src/Api/Implementation/ConfigApiImpl.js +16 -1
- package/src/Api/Implementation/EntitlementApiImpl.d.ts +4 -1
- package/src/Api/Implementation/EntitlementApiImpl.js +31 -6
- package/src/Api/Implementation/ExportApiImpl.js +5 -7
- package/src/Api/Implementation/GridApiImpl.js +1 -1
- package/src/Api/Implementation/TeamSharingApiImpl.js +2 -6
- package/src/Api/Internal/AdaptableInternalApi.d.ts +2 -6
- package/src/Api/Internal/AdaptableInternalApi.js +5 -11
- package/src/Api/Internal/EntitlementInternalApi.d.ts +4 -0
- package/src/Api/Internal/EntitlementInternalApi.js +15 -0
- package/src/Api/Internal/ExportInternalApi.d.ts +33 -8
- package/src/Api/Internal/ExportInternalApi.js +577 -5
- package/src/Api/Internal/NamedQueryInternalApi.d.ts +0 -1
- package/src/Api/Internal/NamedQueryInternalApi.js +0 -5
- package/src/PredefinedConfig/AdaptableState.d.ts +0 -5
- package/src/PredefinedConfig/Common/FilterActionOnDataChange.d.ts +2 -1
- package/src/PredefinedConfig/StyledColumnState.d.ts +1 -1
- package/src/Redux/ActionsReducers/GridRedux.d.ts +6 -6
- package/src/Redux/ActionsReducers/GridRedux.js +11 -11
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +3 -3
- package/src/Redux/ActionsReducers/LayoutRedux.js +10 -10
- package/src/Redux/ActionsReducers/NamedQueryRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/NamedQueryRedux.js +1 -1
- package/src/Redux/ActionsReducers/PluginsRedux.d.ts +2 -2
- package/src/Redux/ActionsReducers/PluginsRedux.js +3 -3
- package/src/Redux/Store/AdaptableReduxMerger.js +3 -3
- package/src/Redux/Store/AdaptableStore.js +2 -4
- package/src/Strategy/AdaptableModuleBase.js +1 -2
- package/src/Strategy/ColumnFilterModule.js +1 -2
- package/src/Strategy/ExportModule.js +17 -44
- package/src/Strategy/FlashingCellModule.js +2 -10
- package/src/Strategy/ScheduleModule.js +4 -6
- package/src/Strategy/SmartEditModule.js +1 -7
- package/src/Strategy/TeamSharingModule.js +2 -2
- package/src/Strategy/Utilities/Export/getExportColumnsViewItems.js +1 -1
- package/src/Strategy/Utilities/Export/getExportRowsViewItems.js +1 -3
- package/src/Utilities/Constants/FilterConstants.d.ts +10 -0
- package/src/Utilities/Constants/FilterConstants.js +11 -0
- package/src/Utilities/Constants/GeneralConstants.d.ts +41 -4
- package/src/Utilities/Constants/GeneralConstants.js +44 -5
- package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +0 -2
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -6
- package/src/Utilities/Extensions/ArrayExtensions.d.ts +14 -0
- package/src/Utilities/Extensions/ArrayExtensions.js +68 -1
- package/src/Utilities/Extensions/EnumExtensions.d.ts +0 -4
- package/src/Utilities/Extensions/EnumExtensions.js +3 -15
- package/src/Utilities/Helpers/AdaptableHelper.d.ts +4 -10
- package/src/Utilities/Helpers/AdaptableHelper.js +10 -64
- package/src/Utilities/Helpers/FormatHelper.d.ts +9 -0
- package/src/Utilities/Helpers/FormatHelper.js +26 -14
- package/src/Utilities/Helpers/Helper.d.ts +0 -10
- package/src/Utilities/Helpers/Helper.js +1 -76
- package/src/Utilities/Services/ChartingService.d.ts +2 -2
- package/src/Utilities/Services/ChartingService.js +5 -11
- package/src/Utilities/Services/ModuleService.js +35 -31
- package/src/Utilities/Services/RowEditService.js +1 -6
- package/src/Utilities/Services/RowSummaryService.js +2 -2
- package/src/Utilities/Services/ValidationService.js +2 -16
- package/src/View/Alert/AlertEmptyView.js +1 -2
- package/src/View/Charting/ChartingStatusBarPopover.js +1 -2
- package/src/View/Charting/useChartingElements.js +1 -1
- package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +2 -6
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +2 -4
- package/src/View/Components/FilterForm/QuickFilterForm.js +2 -12
- package/src/View/Components/ModuleValueSelector/index.js +2 -2
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +2 -5
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupBody.js +1 -3
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +2 -1
- package/src/View/Components/Popups/AdaptablePopupAlert.js +1 -7
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +6 -12
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +3 -23
- package/src/View/Components/ToolPanel/ToolPanelPopup.js +4 -5
- package/src/View/Components/ToolPanel/ToolPanelWrapper.js +1 -3
- package/src/View/Components/ValueSelector/index.js +2 -2
- package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +2 -2
- package/src/View/Dashboard/CustomDashboardButton.js +1 -6
- package/src/View/Dashboard/CustomToolbar.js +2 -9
- package/src/View/Dashboard/Dashboard.js +2 -4
- package/src/View/Dashboard/DashboardPopup.js +1 -3
- package/src/View/Dashboard/DashboardToolbarFactory.js +1 -2
- package/src/View/Dashboard/PinnedToolbarsSelector.js +1 -2
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -3
- package/src/View/Export/ExportViewPanel.js +2 -4
- package/src/View/Export/Wizard/ReportSummaryWizard.js +2 -6
- package/src/View/GridFilter/GridFilterExpressionEditor.js +2 -2
- package/src/View/GridFilter/useGridFilterExpressionEditor.js +2 -6
- package/src/View/Layout/LayoutViewPanel.js +1 -1
- package/src/View/Layout/PivotDetailsPopoup.js +1 -7
- package/src/View/Layout/SaveLayoutButton.js +1 -3
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +2 -2
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +2 -2
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +2 -2
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +2 -2
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +2 -2
- package/src/View/Layout/Wizard/sections/SortSection.js +2 -2
- package/src/View/NamedQuery/Wizard/NamedQueryWizard.js +3 -3
- package/src/View/SpecialColumnSettingsWizardStep.js +1 -1
- package/src/View/SystemStatus/SystemStatusPopup.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.js +2 -2
- package/src/agGrid/ActionColumnRenderer.js +8 -22
- package/src/agGrid/AdaptableAgGrid.d.ts +5 -7
- package/src/agGrid/AdaptableAgGrid.js +152 -144
- package/src/agGrid/AgGridAdapter.d.ts +0 -1
- package/src/agGrid/AgGridAdapter.js +7 -10
- package/src/agGrid/AgGridColumnAdapter.d.ts +3 -1
- package/src/agGrid/AgGridColumnAdapter.js +39 -13
- package/src/agGrid/BadgeRenderer.js +4 -22
- package/src/agGrid/FloatingFilterWrapper.js +21 -0
- package/src/agGrid/buildSortedColumnStateForLayout.d.ts +1 -1
- package/src/agGrid/buildSortedColumnStateForLayout.js +2 -2
- package/src/agGrid/defaultAdaptableOptions.js +35 -30
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +3 -15
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +84 -8
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +9 -9
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/src/Redux/ActionsReducers/QueryRedux.d.ts +0 -10
- package/src/Redux/ActionsReducers/QueryRedux.js +0 -25
- package/src/Utilities/Helpers/FormatContentHelper.d.ts +0 -22
- package/src/Utilities/Helpers/FormatContentHelper.js +0 -39
- package/src/Utilities/Services/EntitlementService.d.ts +0 -14
- package/src/Utilities/Services/EntitlementService.js +0 -67
- package/src/Utilities/Services/Interface/IEntitlementService.d.ts +0 -10
- package/src/Utilities/Services/Interface/IEntitlementService.js +0 -2
- package/src/Utilities/Services/Interface/IReportService.d.ts +0 -27
- package/src/Utilities/Services/Interface/IReportService.js +0 -2
- package/src/Utilities/Services/ReportService.d.ts +0 -41
- package/src/Utilities/Services/ReportService.js +0 -608
- package/src/Utilities/isAdaptableObject.d.ts +0 -2
- package/src/Utilities/isAdaptableObject.js +0 -8
- package/src/Utilities/reorder.d.ts +0 -1
- package/src/Utilities/reorder.js +0 -17
- package/src/Utilities/sortWithOrder.d.ts +0 -11
- package/src/Utilities/sortWithOrder.js +0 -54
|
@@ -21,10 +21,8 @@ const CellPopupService_1 = require("../Utilities/Services/CellPopupService");
|
|
|
21
21
|
const ChartingService_1 = require("../Utilities/Services/ChartingService");
|
|
22
22
|
const ThemeService_1 = require("../Utilities/Services/ThemeService");
|
|
23
23
|
const ValidationService_1 = require("../Utilities/Services/ValidationService");
|
|
24
|
-
const ReportService_1 = require("../Utilities/Services/ReportService");
|
|
25
24
|
const ModuleService_1 = require("../Utilities/Services/ModuleService");
|
|
26
25
|
const CalculatedColumnExpressionService_1 = require("../Utilities/Services/CalculatedColumnExpressionService");
|
|
27
|
-
const EntitlementService_1 = require("../Utilities/Services/EntitlementService");
|
|
28
26
|
const QueryLanguageService_1 = require("../Utilities/Services/QueryLanguageService");
|
|
29
27
|
const AlertService_1 = require("../Utilities/Services/AlertService");
|
|
30
28
|
const TeamSharingService_1 = require("../Utilities/Services/TeamSharingService");
|
|
@@ -89,7 +87,6 @@ const AggregationColumns_1 = require("../PredefinedConfig/Common/AggregationColu
|
|
|
89
87
|
const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
|
|
90
88
|
const RowEditService_1 = require("../Utilities/Services/RowEditService");
|
|
91
89
|
const weightedAverage_1 = require("./weightedAverage");
|
|
92
|
-
const sortWithOrder_1 = require("../Utilities/sortWithOrder");
|
|
93
90
|
const Enums_1 = require("../PredefinedConfig/Common/Enums");
|
|
94
91
|
const ObjectFactory_1 = tslib_1.__importStar(require("../Utilities/ObjectFactory"));
|
|
95
92
|
const EnvVars_1 = require("../EnvVars");
|
|
@@ -99,45 +96,49 @@ const AdaptableLoadingScreen_1 = require("../View/Components/Popups/AdaptableLoa
|
|
|
99
96
|
const react_1 = require("react");
|
|
100
97
|
const AdaptableHelper_1 = require("../Utilities/Helpers/AdaptableHelper");
|
|
101
98
|
const buildSortedColumnStateForLayout_1 = require("./buildSortedColumnStateForLayout");
|
|
102
|
-
const
|
|
103
|
-
const
|
|
99
|
+
const RowSummary_1 = require("../PredefinedConfig/Common/RowSummary");
|
|
100
|
+
const LocalEventService_Prototype = core_1.LocalEventService.prototype;
|
|
101
|
+
const LocalEventService_dispatchEvent = LocalEventService_Prototype.dispatchEvent;
|
|
104
102
|
const GridOptionsService_updateGridOptions = core_1.GridOptionsService.prototype.updateGridOptions;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
AdaptableLogger_1.AdaptableLogger.consoleErrorBase(`No GridAPI found in passed RowNode, this should never happen!`, rowNode);
|
|
119
|
-
}
|
|
120
|
-
return rowNodeApi;
|
|
121
|
-
};
|
|
122
|
-
// we don't know from which instance of aggrid this is coming,
|
|
123
|
-
// as this fn is shared by all instances
|
|
124
|
-
if (node) {
|
|
125
|
-
AdaptableAgGrid.forEachAdaptable((adaptable) => {
|
|
103
|
+
const EventService_Prototype = core_1.EventService.prototype;
|
|
104
|
+
const EventService_wireBeans = EventService_Prototype.wireBeans;
|
|
105
|
+
// AG GRID obfuscates its internals, this is (currently) the best way to get hold of its internal services
|
|
106
|
+
let DANGER_AG_GRID_BEANS;
|
|
107
|
+
EventService_Prototype.wireBeans = function (beans) {
|
|
108
|
+
EventService_wireBeans.apply(this, arguments);
|
|
109
|
+
DANGER_AG_GRID_BEANS = beans;
|
|
110
|
+
};
|
|
111
|
+
LocalEventService_Prototype.dispatchEvent = function (event) {
|
|
112
|
+
LocalEventService_dispatchEvent.apply(this, arguments);
|
|
113
|
+
if (event.type === 'cellChanged' || event.type === 'dataChanged') {
|
|
114
|
+
const eventRowNode = event.node;
|
|
115
|
+
const extractGridApiFromRowNode = (rowNode) => {
|
|
126
116
|
var _a;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
return;
|
|
117
|
+
const rowNodeApi = (_a = rowNode === null || rowNode === void 0 ? void 0 : rowNode.beans) === null || _a === void 0 ? void 0 : _a.gridApi;
|
|
118
|
+
if (!rowNodeApi) {
|
|
119
|
+
AdaptableLogger_1.AdaptableLogger.consoleErrorBase(`No GridAPI found in passed RowNode, this should never happen!`, rowNode);
|
|
131
120
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
121
|
+
return rowNodeApi;
|
|
122
|
+
};
|
|
123
|
+
// we don't know from which instance of aggrid this is coming,
|
|
124
|
+
// as this fn is shared by all instances
|
|
125
|
+
if (eventRowNode) {
|
|
126
|
+
AdaptableAgGrid.forEachAdaptable((adaptable) => {
|
|
127
|
+
var _a;
|
|
128
|
+
if (extractGridApiFromRowNode(eventRowNode) !== ((_a = adaptable.agGridAdapter) === null || _a === void 0 ? void 0 : _a.getAgGridApi(true))) {
|
|
129
|
+
// the event is coming from another aggrid instance
|
|
130
|
+
// so IGNORE IT
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
// we're on the correct instance, so do this
|
|
134
|
+
//@ts-ignore
|
|
135
|
+
const fn = adaptable.rowListeners ? adaptable.rowListeners[event.type] : null;
|
|
136
|
+
if (fn) {
|
|
137
|
+
fn(event);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
139
141
|
}
|
|
140
|
-
return result;
|
|
141
142
|
};
|
|
142
143
|
const adaptableInstances = {};
|
|
143
144
|
const publishTimestamp = Number(EnvVars_1.ADAPTABLE_PUBLISH_TIMESTAMP);
|
|
@@ -203,6 +204,9 @@ class AdaptableAgGrid {
|
|
|
203
204
|
static dismissInstance(adaptable) {
|
|
204
205
|
delete adaptableInstances[adaptable._id];
|
|
205
206
|
}
|
|
207
|
+
get isAgGridInitialising() {
|
|
208
|
+
return this.lifecycleState === 'initAgGrid';
|
|
209
|
+
}
|
|
206
210
|
get isReady() {
|
|
207
211
|
return this.lifecycleState === 'ready';
|
|
208
212
|
}
|
|
@@ -338,7 +342,7 @@ class AdaptableAgGrid {
|
|
|
338
342
|
}
|
|
339
343
|
this.forPlugins((plugin) => plugin.afterInitialStateLoaded(this));
|
|
340
344
|
// do this now so it sets module entitlements
|
|
341
|
-
this.
|
|
345
|
+
this.api.entitlementApi.internalApi.setModulesEntitlements();
|
|
342
346
|
/**
|
|
343
347
|
* At this point it's mandatory to have the ALL the Adaptable blocks initialized:
|
|
344
348
|
* Store, APIs, Services, Modules
|
|
@@ -353,6 +357,9 @@ class AdaptableAgGrid {
|
|
|
353
357
|
this.lifecycleState = 'initAgGrid';
|
|
354
358
|
this.agGridAdapter.initialGridOptions = gridOptions;
|
|
355
359
|
const perfInitAgGrid = this.logger.beginPerf(`initAgGrid()`);
|
|
360
|
+
// AG Grid evaluates early on the floatingFilter params, so we need to "suppres" the floating filter temporarily
|
|
361
|
+
// we will reset it once Adaptable is ready
|
|
362
|
+
this.agGridColumnAdapter.setupColumnFloatingFilterTemporarily(gridOptions);
|
|
356
363
|
const agGridApi = await this.initializeAgGrid(gridOptions, config.modules, config.renderAgGridFrameworkComponent);
|
|
357
364
|
if (agGridApi === false) {
|
|
358
365
|
this.logger.consoleError(`Adaptable failed to initialize AG Grid!`);
|
|
@@ -364,6 +371,7 @@ class AdaptableAgGrid {
|
|
|
364
371
|
// we need to intercept several AG Grid Api methods and trigger Adaptale state changes
|
|
365
372
|
this.monkeyPatchingGridOptionsUpdates(agGridApi);
|
|
366
373
|
this.agGridAdapter.setAgGridApi(agGridApi);
|
|
374
|
+
this.lifecycleState = 'agGridReady';
|
|
367
375
|
this.logger.info(`Registered AG Grid modules: `, this.agGridAdapter.getRegisteredModuleNames().sort());
|
|
368
376
|
/**
|
|
369
377
|
* At this point AG Grid is initialized!
|
|
@@ -431,8 +439,8 @@ class AdaptableAgGrid {
|
|
|
431
439
|
perfInitAdaptableAgGrid.end();
|
|
432
440
|
return Promise.resolve(this.api);
|
|
433
441
|
}
|
|
434
|
-
normalizeAdaptableState(state,
|
|
435
|
-
state = this.normaliseLayoutState(state,
|
|
442
|
+
normalizeAdaptableState(state, agGridOptions) {
|
|
443
|
+
state = this.normaliseLayoutState(state, agGridOptions);
|
|
436
444
|
state = this.normaliseToolPanelState(state);
|
|
437
445
|
return state;
|
|
438
446
|
}
|
|
@@ -602,12 +610,20 @@ class AdaptableAgGrid {
|
|
|
602
610
|
};
|
|
603
611
|
}
|
|
604
612
|
return (params) => {
|
|
605
|
-
var _a;
|
|
606
|
-
if (params.data[primaryKey]) {
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
613
|
+
var _a, _b, _c;
|
|
614
|
+
if ((_a = params.data) === null || _a === void 0 ? void 0 : _a[primaryKey]) {
|
|
615
|
+
const primaryKeyValue = params.data[primaryKey];
|
|
616
|
+
return typeof primaryKeyValue === 'number'
|
|
617
|
+
? `${primaryKeyValue}`
|
|
618
|
+
: params.data[primaryKey];
|
|
619
|
+
}
|
|
620
|
+
// might be a summary row
|
|
621
|
+
if ((_b = params.data) === null || _b === void 0 ? void 0 : _b[RowSummary_1.ROW_SUMMARY_ROW_ID]) {
|
|
622
|
+
return params.data[RowSummary_1.ROW_SUMMARY_ROW_ID];
|
|
623
|
+
}
|
|
624
|
+
// AFL 2024.08.17 - no idea why is this here and when it's used
|
|
625
|
+
// might be a group row
|
|
626
|
+
const parentKeys = (_c = params.parentKeys) !== null && _c !== void 0 ? _c : [];
|
|
611
627
|
const values = Object.values(params.data);
|
|
612
628
|
if (values.length) {
|
|
613
629
|
const id = [...parentKeys, values[0]].join('/');
|
|
@@ -808,7 +824,7 @@ class AdaptableAgGrid {
|
|
|
808
824
|
// lucky us, no sideBar is defined, so we don't have to do anything
|
|
809
825
|
return original_sideBar;
|
|
810
826
|
}
|
|
811
|
-
const isAdaptableToolPanelHidden = this.
|
|
827
|
+
const isAdaptableToolPanelHidden = this.api.entitlementApi.isModuleHiddenEntitlement('ToolPanel');
|
|
812
828
|
const adaptableToolPanelDef = {
|
|
813
829
|
id: GeneralConstants.ADAPTABLE_TOOLPANEL_ID,
|
|
814
830
|
toolPanel: GeneralConstants.ADAPTABLE_TOOLPANEL_COMPONENT,
|
|
@@ -1036,7 +1052,7 @@ class AdaptableAgGrid {
|
|
|
1036
1052
|
* Either initializes the AG Grid instance or delegates it to the framework wrappers (React/Anglar)
|
|
1037
1053
|
*/
|
|
1038
1054
|
async initializeAgGrid(gridOptions, modules, renderAgGridFrameworkComponent) {
|
|
1039
|
-
var _a
|
|
1055
|
+
var _a;
|
|
1040
1056
|
if (renderAgGridFrameworkComponent) {
|
|
1041
1057
|
const result = await renderAgGridFrameworkComponent(gridOptions);
|
|
1042
1058
|
if (result === false) {
|
|
@@ -1059,7 +1075,7 @@ class AdaptableAgGrid {
|
|
|
1059
1075
|
if (!this.getAgGridContainerElement()) {
|
|
1060
1076
|
// initialize the agGridContainerElement from the AgGrid instance
|
|
1061
1077
|
// @ts-ignore
|
|
1062
|
-
const gridRoot = (
|
|
1078
|
+
const gridRoot = (_a = this.DANGER_getPrivateAgGridBeans()) === null || _a === void 0 ? void 0 : _a.eGridDiv;
|
|
1063
1079
|
const gridContainer = gridRoot === null || gridRoot === void 0 ? void 0 : gridRoot.closest('[class*="ag-theme"]');
|
|
1064
1080
|
if (!gridContainer) {
|
|
1065
1081
|
this.logger.consoleError(`No AG Grid container could be derived from the Adaptable framework wrapper.
|
|
@@ -1106,14 +1122,10 @@ class AdaptableAgGrid {
|
|
|
1106
1122
|
}
|
|
1107
1123
|
return false;
|
|
1108
1124
|
};
|
|
1109
|
-
const isColGroupDef = (columnDefinition) => {
|
|
1110
|
-
// @ts-ignore
|
|
1111
|
-
return columnDefinition['children'] != null;
|
|
1112
|
-
};
|
|
1113
1125
|
const processedSpecialColDefIds = [];
|
|
1114
1126
|
const mapColDefs = (colDefs) => {
|
|
1115
1127
|
return colDefs.map((colDef) => {
|
|
1116
|
-
if (isColGroupDef(colDef)) {
|
|
1128
|
+
if (this.agGridColumnAdapter.isColGroupDef(colDef)) {
|
|
1117
1129
|
// if it's a group column, recursively map its children
|
|
1118
1130
|
colDef.children = mapColDefs(colDef.children);
|
|
1119
1131
|
return colDef;
|
|
@@ -1249,7 +1261,7 @@ class AdaptableAgGrid {
|
|
|
1249
1261
|
.map((colDef) => colDef.colId),
|
|
1250
1262
|
};
|
|
1251
1263
|
agGridState.columnOrder = {
|
|
1252
|
-
orderedColIds:
|
|
1264
|
+
orderedColIds: ArrayExtensions_1.default.sortArrayWithOrder(allAgGridColDefIds, currentLayout.Columns || [], {
|
|
1253
1265
|
sortUnorderedItems: false,
|
|
1254
1266
|
}),
|
|
1255
1267
|
};
|
|
@@ -1358,12 +1370,12 @@ class AdaptableAgGrid {
|
|
|
1358
1370
|
this.deriveAdaptableColumnStateFromAgGrid();
|
|
1359
1371
|
}, GeneralConstants_1.HALF_SECOND);
|
|
1360
1372
|
const columnEventsThatTriggersStateChange = [
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1373
|
+
'columnMoved',
|
|
1374
|
+
'gridColumnsChanged',
|
|
1375
|
+
'columnEverythingChanged',
|
|
1376
|
+
'displayedColumnsChanged',
|
|
1377
|
+
'columnVisible',
|
|
1378
|
+
'newColumnsLoaded',
|
|
1367
1379
|
];
|
|
1368
1380
|
this.agGridAdapter.getAgGridApi().addGlobalListener((this.listenerGlobalColumnEventsThatTriggerStateChange = (type) => {
|
|
1369
1381
|
if (columnEventsThatTriggersStateChange.indexOf(type) > -1) {
|
|
@@ -1374,7 +1386,7 @@ class AdaptableAgGrid {
|
|
|
1374
1386
|
* Use Case: User has started inline editing but its distabled in Action Row Options
|
|
1375
1387
|
* Action: Stop editing
|
|
1376
1388
|
*/
|
|
1377
|
-
this.agGridAdapter.getAgGridApi().addEventListener(
|
|
1389
|
+
this.agGridAdapter.getAgGridApi().addEventListener('cellEditingStarted', (this.listenerCellEditingStarted = () => {
|
|
1378
1390
|
var _a;
|
|
1379
1391
|
if ((_a = this.adaptableOptions.actionRowOptions) === null || _a === void 0 ? void 0 : _a.disableInlineEditing)
|
|
1380
1392
|
this.agGridAdapter.getAgGridApi().stopEditing();
|
|
@@ -1385,7 +1397,7 @@ class AdaptableAgGrid {
|
|
|
1385
1397
|
* Action2: Ensure that we have set column data types
|
|
1386
1398
|
* Note: Deals with scenario where the data is provided to AdapTable after grid has been setup
|
|
1387
1399
|
*/
|
|
1388
|
-
this.agGridAdapter.getAgGridApi().addEventListener(
|
|
1400
|
+
this.agGridAdapter.getAgGridApi().addEventListener('firstDataRendered', (this.listenerFirstDataRendered = () => {
|
|
1389
1401
|
if (this.initWithLazyData) {
|
|
1390
1402
|
this.updateColumnModelAndRefreshGrid({ skipColDefsRefresh: true });
|
|
1391
1403
|
this.api.calculatedColumnApi.refreshAggregatedCalculatedColumns();
|
|
@@ -1398,7 +1410,7 @@ class AdaptableAgGrid {
|
|
|
1398
1410
|
* Action 1: Autosize pivot columns when entering pivot mode (if autosize pivot in Layout is true)
|
|
1399
1411
|
* Action 2: Set pivot mode on / off in api as necessary
|
|
1400
1412
|
*/
|
|
1401
|
-
this.agGridAdapter.getAgGridApi().addEventListener(
|
|
1413
|
+
this.agGridAdapter.getAgGridApi().addEventListener('columnPivotModeChanged', (this.listenerPivotModeChanged = (params) => {
|
|
1402
1414
|
if (params.type == 'columnPivotModeChanged' &&
|
|
1403
1415
|
params.columnApi != null &&
|
|
1404
1416
|
params.columnApi.columnController != null &&
|
|
@@ -1416,7 +1428,7 @@ class AdaptableAgGrid {
|
|
|
1416
1428
|
* Use Case: A pivot column has changed
|
|
1417
1429
|
* Action: Autosize pivot columns (if autosize pivot in Layout is true)
|
|
1418
1430
|
*/
|
|
1419
|
-
this.agGridAdapter.getAgGridApi().addEventListener(
|
|
1431
|
+
this.agGridAdapter.getAgGridApi().addEventListener('columnPivotChanged', (this.listenerPivotChanged = (params) => {
|
|
1420
1432
|
if (params.type == 'columnPivotChanged' &&
|
|
1421
1433
|
params.columnApi != null &&
|
|
1422
1434
|
params.columnApi.columnController != null &&
|
|
@@ -1431,13 +1443,13 @@ class AdaptableAgGrid {
|
|
|
1431
1443
|
* Action: Save the Layout (on a debounce)
|
|
1432
1444
|
*/
|
|
1433
1445
|
const columnEventsThatTriggersAutoLayoutSave = [
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1446
|
+
'columnPinned',
|
|
1447
|
+
'columnPivotChanged',
|
|
1448
|
+
'columnPivotModeChanged',
|
|
1449
|
+
'displayedColumnsChanged',
|
|
1450
|
+
'sortChanged',
|
|
1451
|
+
'columnRowGroupChanged',
|
|
1452
|
+
'columnValueChanged',
|
|
1441
1453
|
];
|
|
1442
1454
|
// ADD filter event
|
|
1443
1455
|
this.agGridAdapter.getAgGridApi().addGlobalListener((this.listenerGlobalColumnEventsThatTriggerAutoLayoutSave = (type) => {
|
|
@@ -1456,8 +1468,8 @@ class AdaptableAgGrid {
|
|
|
1456
1468
|
this.updateLayoutFromGrid();
|
|
1457
1469
|
}, GeneralConstants_1.HALF_SECOND);
|
|
1458
1470
|
const rowGroupEventsThatTriggersAutoLayoutSave = [
|
|
1459
|
-
|
|
1460
|
-
|
|
1471
|
+
'rowGroupOpened',
|
|
1472
|
+
'expandOrCollapseAll',
|
|
1461
1473
|
];
|
|
1462
1474
|
this.agGridAdapter.getAgGridApi().addGlobalListener((this.listenerGlobalRowGroupEventsThatTriggerAutoLayoutSave = (type) => {
|
|
1463
1475
|
if (rowGroupEventsThatTriggersAutoLayoutSave.indexOf(type) > -1) {
|
|
@@ -1470,7 +1482,7 @@ class AdaptableAgGrid {
|
|
|
1470
1482
|
* Use Case: Column Row Grouping changes and 'restoreUngroupedColumns' is true
|
|
1471
1483
|
* Action: Make the column invisiblel
|
|
1472
1484
|
*/
|
|
1473
|
-
this.agGridAdapter.getAgGridApi().addEventListener(
|
|
1485
|
+
this.agGridAdapter.getAgGridApi().addEventListener('columnRowGroupChanged', (this.listenerColumnRowGroupChanged = (params) => {
|
|
1474
1486
|
var _a, _b;
|
|
1475
1487
|
if (this.api.internalApi.isGridInPivotMode()) {
|
|
1476
1488
|
return;
|
|
@@ -1484,7 +1496,7 @@ class AdaptableAgGrid {
|
|
|
1484
1496
|
* Action 1: Save the Layout (on a debounce)
|
|
1485
1497
|
* Action 2: Emit the internal ColumnResized event - used by Sparkline Column (in Charts)
|
|
1486
1498
|
*/
|
|
1487
|
-
this.agGridAdapter.getAgGridApi().addEventListener(
|
|
1499
|
+
this.agGridAdapter.getAgGridApi().addEventListener('columnResized', (this.listenerColumnResized = (params) => {
|
|
1488
1500
|
if (params.finished == true && params.type == 'columnResized' && params.column) {
|
|
1489
1501
|
this.debouncedSaveGridLayout(params.type);
|
|
1490
1502
|
}
|
|
@@ -1500,9 +1512,9 @@ class AdaptableAgGrid {
|
|
|
1500
1512
|
this.refreshSelectedRowsState();
|
|
1501
1513
|
}, GeneralConstants_1.HALF_SECOND);
|
|
1502
1514
|
const columnEventsThatTriggerSetRowSelection = [
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1515
|
+
'rowGroupOpened',
|
|
1516
|
+
'selectionChanged',
|
|
1517
|
+
'rowSelected',
|
|
1506
1518
|
];
|
|
1507
1519
|
this.agGridAdapter.getAgGridApi().addGlobalListener((this.listenerGlobalSetRowSelection = (type) => {
|
|
1508
1520
|
if (ArrayExtensions_1.default.ContainsItem(columnEventsThatTriggerSetRowSelection, type)) {
|
|
@@ -1519,7 +1531,7 @@ class AdaptableAgGrid {
|
|
|
1519
1531
|
}
|
|
1520
1532
|
this.refreshSelectedCellsState();
|
|
1521
1533
|
}, 250);
|
|
1522
|
-
this.agGridAdapter.getAgGridApi().addEventListener(
|
|
1534
|
+
this.agGridAdapter.getAgGridApi().addEventListener('rangeSelectionChanged', (this.listenerRangeSelectionChanged = (params) => {
|
|
1523
1535
|
if (params.finished == true) {
|
|
1524
1536
|
this.debouncedSetSelectedCells();
|
|
1525
1537
|
}
|
|
@@ -1529,18 +1541,18 @@ class AdaptableAgGrid {
|
|
|
1529
1541
|
* Action1: Update AdapTable Sort Info
|
|
1530
1542
|
* Action2: Set Selected Cells (on a debounce)
|
|
1531
1543
|
*/
|
|
1532
|
-
this.agGridAdapter.getAgGridApi().addEventListener(
|
|
1544
|
+
this.agGridAdapter.getAgGridApi().addEventListener('sortChanged', (this.listenerSortChanged = () => {
|
|
1533
1545
|
this.onSortChanged();
|
|
1534
1546
|
this.debouncedSetSelectedCells();
|
|
1535
1547
|
}));
|
|
1536
1548
|
const eventsThatTriggerChartingChanges = [
|
|
1537
|
-
|
|
1549
|
+
'chartCreated',
|
|
1538
1550
|
/** Chart Range selection has changed */
|
|
1539
|
-
|
|
1551
|
+
'chartRangeSelectionChanged',
|
|
1540
1552
|
/** Chart Options have changed */
|
|
1541
|
-
|
|
1553
|
+
'chartOptionsChanged',
|
|
1542
1554
|
/** Chart was destroyed */
|
|
1543
|
-
|
|
1555
|
+
'chartDestroyed',
|
|
1544
1556
|
];
|
|
1545
1557
|
const chartingModule = this.ModuleService.getModuleById('Charting');
|
|
1546
1558
|
if (chartingModule.isModuleAvailable()) {
|
|
@@ -1595,17 +1607,7 @@ class AdaptableAgGrid {
|
|
|
1595
1607
|
}
|
|
1596
1608
|
performAudit(action, oldState, newState) {
|
|
1597
1609
|
if (this.isReady) {
|
|
1598
|
-
const adaptableStateChangedInfo = {
|
|
1599
|
-
adaptableApi: this.api,
|
|
1600
|
-
actionName: action.type,
|
|
1601
|
-
clientTimestamp: new Date(),
|
|
1602
|
-
userName: this.adaptableOptions.userName,
|
|
1603
|
-
adaptableId: this.adaptableOptions.adaptableId,
|
|
1604
|
-
adaptableStateKey: this.adaptableOptions.adaptableStateKey,
|
|
1605
|
-
action: action,
|
|
1606
|
-
oldState: oldState,
|
|
1607
|
-
newState: newState,
|
|
1608
|
-
};
|
|
1610
|
+
const adaptableStateChangedInfo = Object.assign(Object.assign({ actionName: action.type, clientTimestamp: new Date() }, this.api.internalApi.buildBaseContext()), { adaptableStateKey: this.adaptableOptions.adaptableStateKey, action: action, oldState: oldState, newState: newState });
|
|
1609
1611
|
this.api.eventApi.emit('AdaptableStateChanged', adaptableStateChangedInfo);
|
|
1610
1612
|
}
|
|
1611
1613
|
}
|
|
@@ -1640,10 +1642,8 @@ class AdaptableAgGrid {
|
|
|
1640
1642
|
this.ChartingService = new ChartingService_1.ChartingService(this.api);
|
|
1641
1643
|
this.ThemeService = new ThemeService_1.ThemeService(this.api);
|
|
1642
1644
|
this.ValidationService = new ValidationService_1.ValidationService(this.api);
|
|
1643
|
-
this.ReportService = new ReportService_1.ReportService(this.api);
|
|
1644
1645
|
this.ModuleService = new ModuleService_1.ModuleService(this.api);
|
|
1645
1646
|
this.CalculatedColumnExpressionService = new CalculatedColumnExpressionService_1.CalculatedColumnExpressionService(this.api);
|
|
1646
|
-
this.EntitlementService = new EntitlementService_1.EntitlementService(this.api);
|
|
1647
1647
|
this.QueryLanguageService = new QueryLanguageService_1.QueryLanguageService(this.api);
|
|
1648
1648
|
this.AlertService = new AlertService_1.AlertService(this.api);
|
|
1649
1649
|
this.TeamSharingService = new TeamSharingService_1.TeamSharingService(this.api);
|
|
@@ -1717,20 +1717,27 @@ class AdaptableAgGrid {
|
|
|
1717
1717
|
});
|
|
1718
1718
|
}
|
|
1719
1719
|
validatePrimaryKey() {
|
|
1720
|
+
var _a;
|
|
1720
1721
|
if (this.hasAutogeneratedPrimaryKey) {
|
|
1721
1722
|
return;
|
|
1722
1723
|
}
|
|
1723
1724
|
const primaryKey = this.adaptableOptions.primaryKey;
|
|
1725
|
+
// first check if there is a primary key column
|
|
1724
1726
|
const primaryKeyColDef = this.agGridAdapter.getAgGridApi().getColumnDef(primaryKey);
|
|
1725
1727
|
if (!primaryKeyColDef) {
|
|
1726
|
-
|
|
1727
|
-
if
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
this.
|
|
1728
|
+
let errorMessage;
|
|
1729
|
+
// if no primary key column then lets check the first row to see if its a data item
|
|
1730
|
+
const primaryKeyDataItem = (_a = this.getFirstRowNode()) === null || _a === void 0 ? void 0 : _a.data[primaryKey];
|
|
1731
|
+
if (!primaryKeyDataItem) {
|
|
1732
|
+
errorMessage = `The Primary Key '${this.adaptableOptions.primaryKey}' does not exist. This will affect many functions in AdapTable.`;
|
|
1733
|
+
if (this.adaptableOptions.alertOptions.showMissingPrimaryKeyAlert) {
|
|
1734
|
+
// show an alert if that is the option
|
|
1735
|
+
this.api.alertApi.showAlertError('No Primary Key', errorMessage);
|
|
1736
|
+
}
|
|
1737
|
+
else {
|
|
1738
|
+
if (this.adaptableOptions.columnOptions.showMissingColumnsWarning) {
|
|
1739
|
+
this.logger.consoleError(errorMessage);
|
|
1740
|
+
}
|
|
1734
1741
|
}
|
|
1735
1742
|
}
|
|
1736
1743
|
}
|
|
@@ -1859,7 +1866,6 @@ class AdaptableAgGrid {
|
|
|
1859
1866
|
return this.getDisplayValueFromRawValue(rowNode, columnId, rawValue);
|
|
1860
1867
|
}
|
|
1861
1868
|
getDisplayValueFromRawValue(rowNode, columnId, rawValue) {
|
|
1862
|
-
var _a;
|
|
1863
1869
|
const isActionColumn = this.api.columnApi.isActionColumn(columnId);
|
|
1864
1870
|
if (isActionColumn) {
|
|
1865
1871
|
return this.getCleanValue(rawValue);
|
|
@@ -1875,8 +1881,7 @@ class AdaptableAgGrid {
|
|
|
1875
1881
|
colDef,
|
|
1876
1882
|
column,
|
|
1877
1883
|
api: this.agGridAdapter.getAgGridApi(),
|
|
1878
|
-
|
|
1879
|
-
context: this.agGridAdapter.getLiveGridOptions().context,
|
|
1884
|
+
context: this.agGridAdapter.getGridOption('context'),
|
|
1880
1885
|
};
|
|
1881
1886
|
const formattedValue = colDef.valueFormatter(params);
|
|
1882
1887
|
return formattedValue || '';
|
|
@@ -2301,7 +2306,7 @@ class AdaptableAgGrid {
|
|
|
2301
2306
|
};
|
|
2302
2307
|
}),
|
|
2303
2308
|
layout: Object.assign(Object.assign({}, layout), { Columns: visibleColumnList }),
|
|
2304
|
-
|
|
2309
|
+
groupDisplayType: this.agGridAdapter.getGridOption('groupDisplayType'),
|
|
2305
2310
|
});
|
|
2306
2311
|
}
|
|
2307
2312
|
getDistinctValuesForColumn(column, distinctValuesParams) {
|
|
@@ -2443,8 +2448,8 @@ class AdaptableAgGrid {
|
|
|
2443
2448
|
return this.agGridAdapter.getAgGridApi().getDisplayedRowAtIndex(index);
|
|
2444
2449
|
}
|
|
2445
2450
|
getAgGridStatusPanels() {
|
|
2446
|
-
var _a, _b
|
|
2447
|
-
return (
|
|
2451
|
+
var _a, _b;
|
|
2452
|
+
return (_b = (_a = this.agGridAdapter.getGridOption('statusBar')) === null || _a === void 0 ? void 0 : _a.statusPanels) !== null && _b !== void 0 ? _b : [];
|
|
2448
2453
|
}
|
|
2449
2454
|
setDataValue(value, column, primaryKeyValue, rowNode) {
|
|
2450
2455
|
// note: because we use RowNode.setDataValue() this will cause Validation to fire
|
|
@@ -2942,35 +2947,35 @@ class AdaptableAgGrid {
|
|
|
2942
2947
|
return this.agGridAdapter.getRegisteredModules();
|
|
2943
2948
|
}
|
|
2944
2949
|
destroy(config) {
|
|
2945
|
-
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
|
|
2950
|
+
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;
|
|
2946
2951
|
if (((_a = this.agGridAdapter) === null || _a === void 0 ? void 0 : _a.getAgGridApi()) && !this.agGridAdapter.getAgGridApi().isDestroyed()) {
|
|
2947
2952
|
this.agGridAdapter
|
|
2948
2953
|
.getAgGridApi()
|
|
2949
|
-
.removeEventListener(
|
|
2954
|
+
.removeEventListener('firstDataRendered', this.listenerFirstDataRendered);
|
|
2950
2955
|
this.agGridAdapter
|
|
2951
2956
|
.getAgGridApi()
|
|
2952
|
-
.removeEventListener(
|
|
2957
|
+
.removeEventListener('columnPivotModeChanged', this.listenerPivotModeChanged);
|
|
2953
2958
|
this.agGridAdapter
|
|
2954
2959
|
.getAgGridApi()
|
|
2955
|
-
.removeEventListener(
|
|
2960
|
+
.removeEventListener('columnPivotChanged', this.listenerPivotChanged);
|
|
2956
2961
|
this.agGridAdapter
|
|
2957
2962
|
.getAgGridApi()
|
|
2958
|
-
.removeEventListener(
|
|
2963
|
+
.removeEventListener('cellEditingStarted', this.listenerCellEditingStarted);
|
|
2959
2964
|
this.agGridAdapter
|
|
2960
2965
|
.getAgGridApi()
|
|
2961
|
-
.removeEventListener(
|
|
2966
|
+
.removeEventListener('columnRowGroupChanged', this.listenerColumnRowGroupChanged);
|
|
2962
2967
|
this.agGridAdapter
|
|
2963
2968
|
.getAgGridApi()
|
|
2964
|
-
.removeEventListener(
|
|
2969
|
+
.removeEventListener('rangeSelectionChanged', this.listenerRangeSelectionChanged);
|
|
2965
2970
|
this.agGridAdapter
|
|
2966
2971
|
.getAgGridApi()
|
|
2967
|
-
.removeEventListener(
|
|
2972
|
+
.removeEventListener('columnResized', this.listenerColumnResized);
|
|
2968
2973
|
this.agGridAdapter
|
|
2969
2974
|
.getAgGridApi()
|
|
2970
|
-
.removeEventListener(
|
|
2975
|
+
.removeEventListener('sortChanged', this.listenerSortChanged);
|
|
2971
2976
|
this.agGridAdapter
|
|
2972
2977
|
.getAgGridApi()
|
|
2973
|
-
.removeEventListener(
|
|
2978
|
+
.removeEventListener('modelUpdated', this.listenerModelUpdated);
|
|
2974
2979
|
this.agGridAdapter.getAgGridApi().removeGlobalListener(this.listenerGlobalSetRowSelection);
|
|
2975
2980
|
this.agGridAdapter
|
|
2976
2981
|
.getAgGridApi()
|
|
@@ -2996,7 +3001,7 @@ class AdaptableAgGrid {
|
|
|
2996
3001
|
this.listenerGlobalRowGroupEventsThatTriggerAutoLayoutSave = null;
|
|
2997
3002
|
this.throttleFilterOnEditDataChange = null;
|
|
2998
3003
|
this.throttleFilterOnTickingDataChange = null;
|
|
2999
|
-
const liveGridOptions = this.
|
|
3004
|
+
const liveGridOptions = this.DANGER_getPrivateAgGridBeans().gridOptions;
|
|
3000
3005
|
if (liveGridOptions) {
|
|
3001
3006
|
this.agGridOptionsService.revertGridOptionsPropertiesToUserValue(liveGridOptions, [
|
|
3002
3007
|
'aggFuncs',
|
|
@@ -3024,6 +3029,7 @@ class AdaptableAgGrid {
|
|
|
3024
3029
|
}
|
|
3025
3030
|
}
|
|
3026
3031
|
}
|
|
3032
|
+
DANGER_AG_GRID_BEANS = null;
|
|
3027
3033
|
if ((config === null || config === void 0 ? void 0 : config.destroyApi) === true) {
|
|
3028
3034
|
(_b = this.agGridAdapter.getAgGridApi()) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
3029
3035
|
}
|
|
@@ -3073,27 +3079,23 @@ class AdaptableAgGrid {
|
|
|
3073
3079
|
this.CalculatedColumnExpressionService = null;
|
|
3074
3080
|
(_o = (_m = this.DataService) === null || _m === void 0 ? void 0 : _m.destroy) === null || _o === void 0 ? void 0 : _o.call(_m);
|
|
3075
3081
|
this.DataService = null;
|
|
3076
|
-
(_q = (_p = this.
|
|
3077
|
-
this.EntitlementService = null;
|
|
3078
|
-
(_s = (_r = this.Fdc3Service) === null || _r === void 0 ? void 0 : _r.destroy) === null || _s === void 0 ? void 0 : _s.call(_r);
|
|
3082
|
+
(_q = (_p = this.Fdc3Service) === null || _p === void 0 ? void 0 : _p.destroy) === null || _q === void 0 ? void 0 : _q.call(_p);
|
|
3079
3083
|
this.Fdc3Service = null;
|
|
3080
|
-
(
|
|
3081
|
-
this.ReportService = null;
|
|
3082
|
-
(_w = (_v = this.ModuleService) === null || _v === void 0 ? void 0 : _v.destroy) === null || _w === void 0 ? void 0 : _w.call(_v);
|
|
3084
|
+
(_s = (_r = this.ModuleService) === null || _r === void 0 ? void 0 : _r.destroy) === null || _s === void 0 ? void 0 : _s.call(_r);
|
|
3083
3085
|
this.ModuleService = null;
|
|
3084
|
-
(
|
|
3086
|
+
(_u = (_t = this.ValidationService) === null || _t === void 0 ? void 0 : _t.destroy) === null || _u === void 0 ? void 0 : _u.call(_t);
|
|
3085
3087
|
this.ValidationService = null;
|
|
3086
|
-
(
|
|
3088
|
+
(_w = (_v = this.QueryLanguageService) === null || _v === void 0 ? void 0 : _v.destroy) === null || _w === void 0 ? void 0 : _w.call(_v);
|
|
3087
3089
|
this.QueryLanguageService = null;
|
|
3088
|
-
(
|
|
3090
|
+
(_y = (_x = this.AlertService) === null || _x === void 0 ? void 0 : _x.destroy) === null || _y === void 0 ? void 0 : _y.call(_x);
|
|
3089
3091
|
this.AlertService = null;
|
|
3090
|
-
(
|
|
3092
|
+
(_0 = (_z = this.TeamSharingService) === null || _z === void 0 ? void 0 : _z.destroy) === null || _0 === void 0 ? void 0 : _0.call(_z);
|
|
3091
3093
|
this.TeamSharingService = null;
|
|
3092
|
-
(
|
|
3094
|
+
(_2 = (_1 = this.RowEditService) === null || _1 === void 0 ? void 0 : _1.destroy) === null || _2 === void 0 ? void 0 : _2.call(_1);
|
|
3093
3095
|
this.RowEditService = null;
|
|
3094
|
-
(
|
|
3096
|
+
(_4 = (_3 = this.MetamodelService) === null || _3 === void 0 ? void 0 : _3.destroy) === null || _4 === void 0 ? void 0 : _4.call(_3);
|
|
3095
3097
|
this.MetamodelService = null;
|
|
3096
|
-
(
|
|
3098
|
+
(_6 = (_5 = this.LicenseService) === null || _5 === void 0 ? void 0 : _5.destroy) === null || _6 === void 0 ? void 0 : _6.call(_5);
|
|
3097
3099
|
this.LicenseService = null;
|
|
3098
3100
|
}
|
|
3099
3101
|
canExportToExcel() {
|
|
@@ -3146,13 +3148,13 @@ class AdaptableAgGrid {
|
|
|
3146
3148
|
}
|
|
3147
3149
|
exportVisualDataToExcel() {
|
|
3148
3150
|
try {
|
|
3149
|
-
const exportExcelStyles = this.
|
|
3151
|
+
const exportExcelStyles = this.api.exportApi.internalApi.buildExcelStylesForVisualReports();
|
|
3150
3152
|
// set DANGER_excelStyles without changing the array reference
|
|
3151
3153
|
this.DANGER_excelStyles.splice(0, this.DANGER_excelStyles.length, ...exportExcelStyles);
|
|
3152
3154
|
// this.agGridOptionsService.CAREFUL_patchGridOptionsProperty('excelStyles', exportExcelStyles);
|
|
3153
3155
|
this.agGridAdapter.getAgGridApi().exportDataAsExcel({
|
|
3154
3156
|
sheetName: 'Sheet 1',
|
|
3155
|
-
fileName: this.
|
|
3157
|
+
fileName: this.api.exportApi.internalApi.getReportFileName(this.adaptableOptions.adaptableId, 'Excel'),
|
|
3156
3158
|
// delegate the cell value processing to Adaptable
|
|
3157
3159
|
processCellCallback: ({ node, column, value }) => {
|
|
3158
3160
|
var _a;
|
|
@@ -3211,18 +3213,18 @@ class AdaptableAgGrid {
|
|
|
3211
3213
|
rawValue = dateRawValue;
|
|
3212
3214
|
}
|
|
3213
3215
|
}
|
|
3214
|
-
return this.
|
|
3216
|
+
return this.api.exportApi.internalApi.getCellExportValueFromRawValue(rowNode, rawValue, columnId);
|
|
3215
3217
|
}
|
|
3216
3218
|
processCellForExcelExport(rowNode, columnId) {
|
|
3217
3219
|
if (this.api.exportApi.internalApi.isVisualDataExportInProgress()) {
|
|
3218
3220
|
const cellKey = this.agGridColumnAdapter.getExcelClassNameForCell(columnId, this.getPrimaryKeyValueFromRowNode(rowNode));
|
|
3219
|
-
const isoFormattedDate = this.
|
|
3221
|
+
const isoFormattedDate = this.api.exportApi.internalApi.getExcelStyleWithFormattedDate(cellKey);
|
|
3220
3222
|
if (isoFormattedDate) {
|
|
3221
3223
|
// this is a Date cell which will be formatted by Excel
|
|
3222
3224
|
return isoFormattedDate;
|
|
3223
3225
|
}
|
|
3224
3226
|
}
|
|
3225
|
-
return this.
|
|
3227
|
+
return this.api.exportApi.internalApi.getCellExportValueFromRowNode(rowNode, columnId);
|
|
3226
3228
|
}
|
|
3227
3229
|
isQuickFilterAvailable() {
|
|
3228
3230
|
if (this.api.layoutApi.isCurrentLayoutPivot() &&
|
|
@@ -4013,8 +4015,11 @@ class AdaptableAgGrid {
|
|
|
4013
4015
|
}
|
|
4014
4016
|
// we need to intercept some of the GridOptions updates and refresh the Adaptable state
|
|
4015
4017
|
monkeyPatchingGridOptionsUpdates(agGridApi) {
|
|
4016
|
-
|
|
4017
|
-
const gridOptionsService =
|
|
4018
|
+
var _a;
|
|
4019
|
+
const gridOptionsService = (_a = this.DANGER_getPrivateAgGridBeans()) === null || _a === void 0 ? void 0 : _a.gos;
|
|
4020
|
+
if (!gridOptionsService) {
|
|
4021
|
+
this.logger.consoleError('Could not get hold of GridOptionsService! This is a critical error and will prevent Adaptable from working correctly.');
|
|
4022
|
+
}
|
|
4018
4023
|
const self = this;
|
|
4019
4024
|
gridOptionsService.updateGridOptions = function ({ options, force, source = 'api', }) {
|
|
4020
4025
|
// `columnDefs`
|
|
@@ -4044,5 +4049,8 @@ class AdaptableAgGrid {
|
|
|
4044
4049
|
GridOptionsService_updateGridOptions.apply(this, arguments);
|
|
4045
4050
|
};
|
|
4046
4051
|
}
|
|
4052
|
+
DANGER_getPrivateAgGridBeans() {
|
|
4053
|
+
return DANGER_AG_GRID_BEANS;
|
|
4054
|
+
}
|
|
4047
4055
|
}
|
|
4048
4056
|
exports.AdaptableAgGrid = AdaptableAgGrid;
|