@adaptabletools/adaptable 18.1.14 → 19.0.0-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/LayoutApiImpl.d.ts +2 -0
- package/src/Api/Implementation/LayoutApiImpl.js +61 -0
- 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 +11 -0
- package/src/Api/Internal/ExportInternalApi.d.ts +33 -8
- package/src/Api/Internal/ExportInternalApi.js +576 -5
- package/src/Api/Internal/NamedQueryInternalApi.d.ts +0 -1
- package/src/Api/Internal/NamedQueryInternalApi.js +0 -4
- package/src/Api/LayoutApi.d.ts +7 -0
- package/src/PredefinedConfig/AdaptableState.d.ts +0 -5
- package/src/PredefinedConfig/Common/ExtendedLayoutInfo.d.ts +12 -0
- 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 +8 -8
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +3 -3
- package/src/Redux/ActionsReducers/LayoutRedux.js +9 -9
- 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 +2 -2
- 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 +8 -0
- package/src/Utilities/Constants/GeneralConstants.d.ts +41 -4
- package/src/Utilities/Constants/GeneralConstants.js +42 -3
- package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +0 -2
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +0 -5
- package/src/Utilities/Extensions/ArrayExtensions.d.ts +14 -0
- package/src/Utilities/Extensions/ArrayExtensions.js +65 -0
- package/src/Utilities/Extensions/EnumExtensions.d.ts +0 -4
- package/src/Utilities/Extensions/EnumExtensions.js +2 -12
- package/src/Utilities/Helpers/AdaptableHelper.d.ts +4 -10
- package/src/Utilities/Helpers/AdaptableHelper.js +7 -59
- 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 +0 -70
- 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 +6 -7
- package/src/agGrid/AdaptableAgGrid.js +165 -146
- package/src/agGrid/AgGridAdapter.d.ts +0 -1
- package/src/agGrid/AgGridAdapter.js +8 -11
- package/src/agGrid/AgGridColumnAdapter.d.ts +3 -1
- package/src/agGrid/AgGridColumnAdapter.js +40 -14
- 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 +89 -8
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +10 -9
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/Redux/ActionsReducers/QueryRedux.d.ts +0 -10
- package/src/Redux/ActionsReducers/QueryRedux.js +0 -20
- package/src/Utilities/Helpers/FormatContentHelper.d.ts +0 -22
- package/src/Utilities/Helpers/FormatContentHelper.js +0 -34
- package/src/Utilities/Services/EntitlementService.d.ts +0 -14
- package/src/Utilities/Services/EntitlementService.js +0 -63
- package/src/Utilities/Services/Interface/IEntitlementService.d.ts +0 -10
- package/src/Utilities/Services/Interface/IReportService.d.ts +0 -27
- package/src/Utilities/Services/Interface/IReportService.js +0 -1
- package/src/Utilities/Services/ReportService.d.ts +0 -41
- package/src/Utilities/Services/ReportService.js +0 -603
- package/src/Utilities/isAdaptableObject.d.ts +0 -2
- package/src/Utilities/isAdaptableObject.js +0 -4
- package/src/Utilities/reorder.d.ts +0 -1
- package/src/Utilities/reorder.js +0 -13
- package/src/Utilities/sortWithOrder.d.ts +0 -11
- package/src/Utilities/sortWithOrder.js +0 -50
- /package/src/{Utilities/Services/Interface/IEntitlementService.js → PredefinedConfig/Common/ExtendedLayoutInfo.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import throttle from 'lodash/throttle';
|
|
2
2
|
import debounce from 'lodash/debounce';
|
|
3
|
-
import { createGrid,
|
|
3
|
+
import { createGrid, EventService, GridOptionsService, LocalEventService, ModuleNames, } from '@ag-grid-community/core';
|
|
4
4
|
import { AdaptableLogger } from './AdaptableLogger';
|
|
5
5
|
import { PrimaryKeyDocsLink } from '../Utilities/Constants/DocumentationLinkConstants';
|
|
6
6
|
import StringExtensions from '../Utilities/Extensions/StringExtensions';
|
|
@@ -17,10 +17,8 @@ import { CellPopupService } from '../Utilities/Services/CellPopupService';
|
|
|
17
17
|
import { ChartingService } from '../Utilities/Services/ChartingService';
|
|
18
18
|
import { ThemeService } from '../Utilities/Services/ThemeService';
|
|
19
19
|
import { ValidationService } from '../Utilities/Services/ValidationService';
|
|
20
|
-
import { ReportService } from '../Utilities/Services/ReportService';
|
|
21
20
|
import { ModuleService } from '../Utilities/Services/ModuleService';
|
|
22
21
|
import { CalculatedColumnExpressionService } from '../Utilities/Services/CalculatedColumnExpressionService';
|
|
23
|
-
import { EntitlementService } from '../Utilities/Services/EntitlementService';
|
|
24
22
|
import { QueryLanguageService } from '../Utilities/Services/QueryLanguageService';
|
|
25
23
|
import { AlertService } from '../Utilities/Services/AlertService';
|
|
26
24
|
import { TeamSharingService } from '../Utilities/Services/TeamSharingService';
|
|
@@ -85,7 +83,6 @@ import { isWeightedAverageAggregation, WEIGHTED_AVERAGE_AGG_FN_NAME, } from '../
|
|
|
85
83
|
import lodashIsEqual from 'lodash/isEqual';
|
|
86
84
|
import { RowEditService } from '../Utilities/Services/RowEditService';
|
|
87
85
|
import { weightedAverage } from './weightedAverage';
|
|
88
|
-
import { sortWithOrderArray } from '../Utilities/sortWithOrder';
|
|
89
86
|
import { FilterOnDataChangeOptions } from '../PredefinedConfig/Common/Enums';
|
|
90
87
|
import ObjectFactory, { createBaseContext } from '../Utilities/ObjectFactory';
|
|
91
88
|
import { ADAPTABLE_PUBLISH_TIMESTAMP } from '../EnvVars';
|
|
@@ -95,45 +92,54 @@ import { AdaptableLoadingScreen } from '../View/Components/Popups/AdaptableLoadi
|
|
|
95
92
|
import { createElement } from 'react';
|
|
96
93
|
import { removeUuidAndSource } from '../Utilities/Helpers/AdaptableHelper';
|
|
97
94
|
import { buildSortedColumnStateForLayout } from './buildSortedColumnStateForLayout';
|
|
98
|
-
|
|
99
|
-
const
|
|
95
|
+
import { ROW_SUMMARY_ROW_ID } from '../PredefinedConfig/Common/RowSummary';
|
|
96
|
+
const LocalEventService_Prototype = LocalEventService.prototype;
|
|
97
|
+
const LocalEventService_dispatchEvent = LocalEventService_Prototype.dispatchEvent;
|
|
100
98
|
const GridOptionsService_updateGridOptions = GridOptionsService.prototype.updateGridOptions;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
// as this fn is shared by all instances
|
|
120
|
-
if (node) {
|
|
121
|
-
AdaptableAgGrid.forEachAdaptable((adaptable) => {
|
|
99
|
+
const EventService_Prototype = EventService.prototype;
|
|
100
|
+
const EventService_wireBeans = EventService_Prototype.wireBeans;
|
|
101
|
+
// AG GRID obfuscates its internals, this is (currently) the best way to get hold of its internal services
|
|
102
|
+
const DANGER_AG_GRID_BEANS_MAP = {};
|
|
103
|
+
EventService_Prototype.wireBeans = function (beans) {
|
|
104
|
+
var _a;
|
|
105
|
+
EventService_wireBeans.apply(this, arguments);
|
|
106
|
+
const gridId = (_a = beans === null || beans === void 0 ? void 0 : beans.context) === null || _a === void 0 ? void 0 : _a.getGridId();
|
|
107
|
+
if (!gridId) {
|
|
108
|
+
console.error('CRITICAL: No gridId found in beans, this should never happen!');
|
|
109
|
+
}
|
|
110
|
+
DANGER_AG_GRID_BEANS_MAP[gridId] = beans;
|
|
111
|
+
};
|
|
112
|
+
LocalEventService_Prototype.dispatchEvent = function (event) {
|
|
113
|
+
LocalEventService_dispatchEvent.apply(this, arguments);
|
|
114
|
+
if (event.type === 'cellChanged' || event.type === 'dataChanged') {
|
|
115
|
+
const eventRowNode = event.node;
|
|
116
|
+
const extractGridApiFromRowNode = (rowNode) => {
|
|
122
117
|
var _a;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
return;
|
|
118
|
+
const rowNodeApi = (_a = rowNode === null || rowNode === void 0 ? void 0 : rowNode.beans) === null || _a === void 0 ? void 0 : _a.gridApi;
|
|
119
|
+
if (!rowNodeApi) {
|
|
120
|
+
AdaptableLogger.consoleErrorBase(`No GridAPI found in passed RowNode, this should never happen!`, rowNode);
|
|
127
121
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
122
|
+
return rowNodeApi;
|
|
123
|
+
};
|
|
124
|
+
// we don't know from which instance of aggrid this is coming,
|
|
125
|
+
// as this fn is shared by all instances
|
|
126
|
+
if (eventRowNode) {
|
|
127
|
+
AdaptableAgGrid.forEachAdaptable((adaptable) => {
|
|
128
|
+
var _a;
|
|
129
|
+
if (extractGridApiFromRowNode(eventRowNode) !== ((_a = adaptable.agGridAdapter) === null || _a === void 0 ? void 0 : _a.getAgGridApi(true))) {
|
|
130
|
+
// the event is coming from another aggrid instance
|
|
131
|
+
// so IGNORE IT
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
// we're on the correct instance, so do this
|
|
135
|
+
//@ts-ignore
|
|
136
|
+
const fn = adaptable.rowListeners ? adaptable.rowListeners[event.type] : null;
|
|
137
|
+
if (fn) {
|
|
138
|
+
fn(event);
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
}
|
|
135
142
|
}
|
|
136
|
-
return result;
|
|
137
143
|
};
|
|
138
144
|
const adaptableInstances = {};
|
|
139
145
|
const publishTimestamp = Number(ADAPTABLE_PUBLISH_TIMESTAMP);
|
|
@@ -199,6 +205,9 @@ export class AdaptableAgGrid {
|
|
|
199
205
|
static dismissInstance(adaptable) {
|
|
200
206
|
delete adaptableInstances[adaptable._id];
|
|
201
207
|
}
|
|
208
|
+
get isAgGridInitialising() {
|
|
209
|
+
return this.lifecycleState === 'initAgGrid';
|
|
210
|
+
}
|
|
202
211
|
get isReady() {
|
|
203
212
|
return this.lifecycleState === 'ready';
|
|
204
213
|
}
|
|
@@ -334,7 +343,7 @@ export class AdaptableAgGrid {
|
|
|
334
343
|
}
|
|
335
344
|
this.forPlugins((plugin) => plugin.afterInitialStateLoaded(this));
|
|
336
345
|
// do this now so it sets module entitlements
|
|
337
|
-
this.
|
|
346
|
+
this.api.entitlementApi.internalApi.setModulesEntitlements();
|
|
338
347
|
/**
|
|
339
348
|
* At this point it's mandatory to have the ALL the Adaptable blocks initialized:
|
|
340
349
|
* Store, APIs, Services, Modules
|
|
@@ -349,6 +358,9 @@ export class AdaptableAgGrid {
|
|
|
349
358
|
this.lifecycleState = 'initAgGrid';
|
|
350
359
|
this.agGridAdapter.initialGridOptions = gridOptions;
|
|
351
360
|
const perfInitAgGrid = this.logger.beginPerf(`initAgGrid()`);
|
|
361
|
+
// AG Grid evaluates early on the floatingFilter params, so we need to "suppres" the floating filter temporarily
|
|
362
|
+
// we will reset it once Adaptable is ready
|
|
363
|
+
this.agGridColumnAdapter.setupColumnFloatingFilterTemporarily(gridOptions);
|
|
352
364
|
const agGridApi = await this.initializeAgGrid(gridOptions, config.modules, config.renderAgGridFrameworkComponent);
|
|
353
365
|
if (agGridApi === false) {
|
|
354
366
|
this.logger.consoleError(`Adaptable failed to initialize AG Grid!`);
|
|
@@ -360,6 +372,7 @@ export class AdaptableAgGrid {
|
|
|
360
372
|
// we need to intercept several AG Grid Api methods and trigger Adaptale state changes
|
|
361
373
|
this.monkeyPatchingGridOptionsUpdates(agGridApi);
|
|
362
374
|
this.agGridAdapter.setAgGridApi(agGridApi);
|
|
375
|
+
this.lifecycleState = 'agGridReady';
|
|
363
376
|
this.logger.info(`Registered AG Grid modules: `, this.agGridAdapter.getRegisteredModuleNames().sort());
|
|
364
377
|
/**
|
|
365
378
|
* At this point AG Grid is initialized!
|
|
@@ -427,8 +440,8 @@ export class AdaptableAgGrid {
|
|
|
427
440
|
perfInitAdaptableAgGrid.end();
|
|
428
441
|
return Promise.resolve(this.api);
|
|
429
442
|
}
|
|
430
|
-
normalizeAdaptableState(state,
|
|
431
|
-
state = this.normaliseLayoutState(state,
|
|
443
|
+
normalizeAdaptableState(state, agGridOptions) {
|
|
444
|
+
state = this.normaliseLayoutState(state, agGridOptions);
|
|
432
445
|
state = this.normaliseToolPanelState(state);
|
|
433
446
|
return state;
|
|
434
447
|
}
|
|
@@ -571,7 +584,9 @@ export class AdaptableAgGrid {
|
|
|
571
584
|
* `gridId`
|
|
572
585
|
*/
|
|
573
586
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'gridId', (original_gridId) => {
|
|
574
|
-
|
|
587
|
+
const agGridId = original_gridId || this.adaptableOptions.adaptableId;
|
|
588
|
+
this._agGridId = agGridId;
|
|
589
|
+
return agGridId;
|
|
575
590
|
});
|
|
576
591
|
/**
|
|
577
592
|
* `getRowId`
|
|
@@ -598,12 +613,20 @@ export class AdaptableAgGrid {
|
|
|
598
613
|
};
|
|
599
614
|
}
|
|
600
615
|
return (params) => {
|
|
601
|
-
var _a;
|
|
602
|
-
if (params.data[primaryKey]) {
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
616
|
+
var _a, _b, _c;
|
|
617
|
+
if ((_a = params.data) === null || _a === void 0 ? void 0 : _a[primaryKey]) {
|
|
618
|
+
const primaryKeyValue = params.data[primaryKey];
|
|
619
|
+
return typeof primaryKeyValue === 'number'
|
|
620
|
+
? `${primaryKeyValue}`
|
|
621
|
+
: params.data[primaryKey];
|
|
622
|
+
}
|
|
623
|
+
// might be a summary row
|
|
624
|
+
if ((_b = params.data) === null || _b === void 0 ? void 0 : _b[ROW_SUMMARY_ROW_ID]) {
|
|
625
|
+
return params.data[ROW_SUMMARY_ROW_ID];
|
|
626
|
+
}
|
|
627
|
+
// AFL 2024.08.17 - no idea why is this here and when it's used
|
|
628
|
+
// might be a group row
|
|
629
|
+
const parentKeys = (_c = params.parentKeys) !== null && _c !== void 0 ? _c : [];
|
|
607
630
|
const values = Object.values(params.data);
|
|
608
631
|
if (values.length) {
|
|
609
632
|
const id = [...parentKeys, values[0]].join('/');
|
|
@@ -804,7 +827,7 @@ export class AdaptableAgGrid {
|
|
|
804
827
|
// lucky us, no sideBar is defined, so we don't have to do anything
|
|
805
828
|
return original_sideBar;
|
|
806
829
|
}
|
|
807
|
-
const isAdaptableToolPanelHidden = this.
|
|
830
|
+
const isAdaptableToolPanelHidden = this.api.entitlementApi.isModuleHiddenEntitlement('ToolPanel');
|
|
808
831
|
const adaptableToolPanelDef = {
|
|
809
832
|
id: GeneralConstants.ADAPTABLE_TOOLPANEL_ID,
|
|
810
833
|
toolPanel: GeneralConstants.ADAPTABLE_TOOLPANEL_COMPONENT,
|
|
@@ -1032,7 +1055,7 @@ export class AdaptableAgGrid {
|
|
|
1032
1055
|
* Either initializes the AG Grid instance or delegates it to the framework wrappers (React/Anglar)
|
|
1033
1056
|
*/
|
|
1034
1057
|
async initializeAgGrid(gridOptions, modules, renderAgGridFrameworkComponent) {
|
|
1035
|
-
var _a
|
|
1058
|
+
var _a;
|
|
1036
1059
|
if (renderAgGridFrameworkComponent) {
|
|
1037
1060
|
const result = await renderAgGridFrameworkComponent(gridOptions);
|
|
1038
1061
|
if (result === false) {
|
|
@@ -1055,7 +1078,7 @@ export class AdaptableAgGrid {
|
|
|
1055
1078
|
if (!this.getAgGridContainerElement()) {
|
|
1056
1079
|
// initialize the agGridContainerElement from the AgGrid instance
|
|
1057
1080
|
// @ts-ignore
|
|
1058
|
-
const gridRoot = (
|
|
1081
|
+
const gridRoot = (_a = this.DANGER_getPrivateAgGridBeans()) === null || _a === void 0 ? void 0 : _a.eGridDiv;
|
|
1059
1082
|
const gridContainer = gridRoot === null || gridRoot === void 0 ? void 0 : gridRoot.closest('[class*="ag-theme"]');
|
|
1060
1083
|
if (!gridContainer) {
|
|
1061
1084
|
this.logger.consoleError(`No AG Grid container could be derived from the Adaptable framework wrapper.
|
|
@@ -1102,14 +1125,10 @@ export class AdaptableAgGrid {
|
|
|
1102
1125
|
}
|
|
1103
1126
|
return false;
|
|
1104
1127
|
};
|
|
1105
|
-
const isColGroupDef = (columnDefinition) => {
|
|
1106
|
-
// @ts-ignore
|
|
1107
|
-
return columnDefinition['children'] != null;
|
|
1108
|
-
};
|
|
1109
1128
|
const processedSpecialColDefIds = [];
|
|
1110
1129
|
const mapColDefs = (colDefs) => {
|
|
1111
1130
|
return colDefs.map((colDef) => {
|
|
1112
|
-
if (isColGroupDef(colDef)) {
|
|
1131
|
+
if (this.agGridColumnAdapter.isColGroupDef(colDef)) {
|
|
1113
1132
|
// if it's a group column, recursively map its children
|
|
1114
1133
|
colDef.children = mapColDefs(colDef.children);
|
|
1115
1134
|
return colDef;
|
|
@@ -1245,7 +1264,7 @@ export class AdaptableAgGrid {
|
|
|
1245
1264
|
.map((colDef) => colDef.colId),
|
|
1246
1265
|
};
|
|
1247
1266
|
agGridState.columnOrder = {
|
|
1248
|
-
orderedColIds:
|
|
1267
|
+
orderedColIds: ArrayExtensions.sortArrayWithOrder(allAgGridColDefIds, currentLayout.Columns || [], {
|
|
1249
1268
|
sortUnorderedItems: false,
|
|
1250
1269
|
}),
|
|
1251
1270
|
};
|
|
@@ -1354,12 +1373,12 @@ export class AdaptableAgGrid {
|
|
|
1354
1373
|
this.deriveAdaptableColumnStateFromAgGrid();
|
|
1355
1374
|
}, HALF_SECOND);
|
|
1356
1375
|
const columnEventsThatTriggersStateChange = [
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1376
|
+
'columnMoved',
|
|
1377
|
+
'gridColumnsChanged',
|
|
1378
|
+
'columnEverythingChanged',
|
|
1379
|
+
'displayedColumnsChanged',
|
|
1380
|
+
'columnVisible',
|
|
1381
|
+
'newColumnsLoaded',
|
|
1363
1382
|
];
|
|
1364
1383
|
this.agGridAdapter.getAgGridApi().addGlobalListener((this.listenerGlobalColumnEventsThatTriggerStateChange = (type) => {
|
|
1365
1384
|
if (columnEventsThatTriggersStateChange.indexOf(type) > -1) {
|
|
@@ -1370,7 +1389,7 @@ export class AdaptableAgGrid {
|
|
|
1370
1389
|
* Use Case: User has started inline editing but its distabled in Action Row Options
|
|
1371
1390
|
* Action: Stop editing
|
|
1372
1391
|
*/
|
|
1373
|
-
this.agGridAdapter.getAgGridApi().addEventListener(
|
|
1392
|
+
this.agGridAdapter.getAgGridApi().addEventListener('cellEditingStarted', (this.listenerCellEditingStarted = () => {
|
|
1374
1393
|
var _a;
|
|
1375
1394
|
if ((_a = this.adaptableOptions.actionRowOptions) === null || _a === void 0 ? void 0 : _a.disableInlineEditing)
|
|
1376
1395
|
this.agGridAdapter.getAgGridApi().stopEditing();
|
|
@@ -1381,7 +1400,7 @@ export class AdaptableAgGrid {
|
|
|
1381
1400
|
* Action2: Ensure that we have set column data types
|
|
1382
1401
|
* Note: Deals with scenario where the data is provided to AdapTable after grid has been setup
|
|
1383
1402
|
*/
|
|
1384
|
-
this.agGridAdapter.getAgGridApi().addEventListener(
|
|
1403
|
+
this.agGridAdapter.getAgGridApi().addEventListener('firstDataRendered', (this.listenerFirstDataRendered = () => {
|
|
1385
1404
|
if (this.initWithLazyData) {
|
|
1386
1405
|
this.updateColumnModelAndRefreshGrid({ skipColDefsRefresh: true });
|
|
1387
1406
|
this.api.calculatedColumnApi.refreshAggregatedCalculatedColumns();
|
|
@@ -1394,7 +1413,7 @@ export class AdaptableAgGrid {
|
|
|
1394
1413
|
* Action 1: Autosize pivot columns when entering pivot mode (if autosize pivot in Layout is true)
|
|
1395
1414
|
* Action 2: Set pivot mode on / off in api as necessary
|
|
1396
1415
|
*/
|
|
1397
|
-
this.agGridAdapter.getAgGridApi().addEventListener(
|
|
1416
|
+
this.agGridAdapter.getAgGridApi().addEventListener('columnPivotModeChanged', (this.listenerPivotModeChanged = (params) => {
|
|
1398
1417
|
if (params.type == 'columnPivotModeChanged' &&
|
|
1399
1418
|
params.columnApi != null &&
|
|
1400
1419
|
params.columnApi.columnController != null &&
|
|
@@ -1412,7 +1431,7 @@ export class AdaptableAgGrid {
|
|
|
1412
1431
|
* Use Case: A pivot column has changed
|
|
1413
1432
|
* Action: Autosize pivot columns (if autosize pivot in Layout is true)
|
|
1414
1433
|
*/
|
|
1415
|
-
this.agGridAdapter.getAgGridApi().addEventListener(
|
|
1434
|
+
this.agGridAdapter.getAgGridApi().addEventListener('columnPivotChanged', (this.listenerPivotChanged = (params) => {
|
|
1416
1435
|
if (params.type == 'columnPivotChanged' &&
|
|
1417
1436
|
params.columnApi != null &&
|
|
1418
1437
|
params.columnApi.columnController != null &&
|
|
@@ -1427,13 +1446,13 @@ export class AdaptableAgGrid {
|
|
|
1427
1446
|
* Action: Save the Layout (on a debounce)
|
|
1428
1447
|
*/
|
|
1429
1448
|
const columnEventsThatTriggersAutoLayoutSave = [
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1449
|
+
'columnPinned',
|
|
1450
|
+
'columnPivotChanged',
|
|
1451
|
+
'columnPivotModeChanged',
|
|
1452
|
+
'displayedColumnsChanged',
|
|
1453
|
+
'sortChanged',
|
|
1454
|
+
'columnRowGroupChanged',
|
|
1455
|
+
'columnValueChanged',
|
|
1437
1456
|
];
|
|
1438
1457
|
// ADD filter event
|
|
1439
1458
|
this.agGridAdapter.getAgGridApi().addGlobalListener((this.listenerGlobalColumnEventsThatTriggerAutoLayoutSave = (type) => {
|
|
@@ -1452,8 +1471,8 @@ export class AdaptableAgGrid {
|
|
|
1452
1471
|
this.updateLayoutFromGrid();
|
|
1453
1472
|
}, HALF_SECOND);
|
|
1454
1473
|
const rowGroupEventsThatTriggersAutoLayoutSave = [
|
|
1455
|
-
|
|
1456
|
-
|
|
1474
|
+
'rowGroupOpened',
|
|
1475
|
+
'expandOrCollapseAll',
|
|
1457
1476
|
];
|
|
1458
1477
|
this.agGridAdapter.getAgGridApi().addGlobalListener((this.listenerGlobalRowGroupEventsThatTriggerAutoLayoutSave = (type) => {
|
|
1459
1478
|
if (rowGroupEventsThatTriggersAutoLayoutSave.indexOf(type) > -1) {
|
|
@@ -1466,7 +1485,7 @@ export class AdaptableAgGrid {
|
|
|
1466
1485
|
* Use Case: Column Row Grouping changes and 'restoreUngroupedColumns' is true
|
|
1467
1486
|
* Action: Make the column invisiblel
|
|
1468
1487
|
*/
|
|
1469
|
-
this.agGridAdapter.getAgGridApi().addEventListener(
|
|
1488
|
+
this.agGridAdapter.getAgGridApi().addEventListener('columnRowGroupChanged', (this.listenerColumnRowGroupChanged = (params) => {
|
|
1470
1489
|
var _a, _b;
|
|
1471
1490
|
if (this.api.internalApi.isGridInPivotMode()) {
|
|
1472
1491
|
return;
|
|
@@ -1480,7 +1499,7 @@ export class AdaptableAgGrid {
|
|
|
1480
1499
|
* Action 1: Save the Layout (on a debounce)
|
|
1481
1500
|
* Action 2: Emit the internal ColumnResized event - used by Sparkline Column (in Charts)
|
|
1482
1501
|
*/
|
|
1483
|
-
this.agGridAdapter.getAgGridApi().addEventListener(
|
|
1502
|
+
this.agGridAdapter.getAgGridApi().addEventListener('columnResized', (this.listenerColumnResized = (params) => {
|
|
1484
1503
|
if (params.finished == true && params.type == 'columnResized' && params.column) {
|
|
1485
1504
|
this.debouncedSaveGridLayout(params.type);
|
|
1486
1505
|
}
|
|
@@ -1496,9 +1515,9 @@ export class AdaptableAgGrid {
|
|
|
1496
1515
|
this.refreshSelectedRowsState();
|
|
1497
1516
|
}, HALF_SECOND);
|
|
1498
1517
|
const columnEventsThatTriggerSetRowSelection = [
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1518
|
+
'rowGroupOpened',
|
|
1519
|
+
'selectionChanged',
|
|
1520
|
+
'rowSelected',
|
|
1502
1521
|
];
|
|
1503
1522
|
this.agGridAdapter.getAgGridApi().addGlobalListener((this.listenerGlobalSetRowSelection = (type) => {
|
|
1504
1523
|
if (ArrayExtensions.ContainsItem(columnEventsThatTriggerSetRowSelection, type)) {
|
|
@@ -1515,7 +1534,7 @@ export class AdaptableAgGrid {
|
|
|
1515
1534
|
}
|
|
1516
1535
|
this.refreshSelectedCellsState();
|
|
1517
1536
|
}, 250);
|
|
1518
|
-
this.agGridAdapter.getAgGridApi().addEventListener(
|
|
1537
|
+
this.agGridAdapter.getAgGridApi().addEventListener('rangeSelectionChanged', (this.listenerRangeSelectionChanged = (params) => {
|
|
1519
1538
|
if (params.finished == true) {
|
|
1520
1539
|
this.debouncedSetSelectedCells();
|
|
1521
1540
|
}
|
|
@@ -1525,18 +1544,18 @@ export class AdaptableAgGrid {
|
|
|
1525
1544
|
* Action1: Update AdapTable Sort Info
|
|
1526
1545
|
* Action2: Set Selected Cells (on a debounce)
|
|
1527
1546
|
*/
|
|
1528
|
-
this.agGridAdapter.getAgGridApi().addEventListener(
|
|
1547
|
+
this.agGridAdapter.getAgGridApi().addEventListener('sortChanged', (this.listenerSortChanged = () => {
|
|
1529
1548
|
this.onSortChanged();
|
|
1530
1549
|
this.debouncedSetSelectedCells();
|
|
1531
1550
|
}));
|
|
1532
1551
|
const eventsThatTriggerChartingChanges = [
|
|
1533
|
-
|
|
1552
|
+
'chartCreated',
|
|
1534
1553
|
/** Chart Range selection has changed */
|
|
1535
|
-
|
|
1554
|
+
'chartRangeSelectionChanged',
|
|
1536
1555
|
/** Chart Options have changed */
|
|
1537
|
-
|
|
1556
|
+
'chartOptionsChanged',
|
|
1538
1557
|
/** Chart was destroyed */
|
|
1539
|
-
|
|
1558
|
+
'chartDestroyed',
|
|
1540
1559
|
];
|
|
1541
1560
|
const chartingModule = this.ModuleService.getModuleById('Charting');
|
|
1542
1561
|
if (chartingModule.isModuleAvailable()) {
|
|
@@ -1591,17 +1610,7 @@ export class AdaptableAgGrid {
|
|
|
1591
1610
|
}
|
|
1592
1611
|
performAudit(action, oldState, newState) {
|
|
1593
1612
|
if (this.isReady) {
|
|
1594
|
-
const adaptableStateChangedInfo = {
|
|
1595
|
-
adaptableApi: this.api,
|
|
1596
|
-
actionName: action.type,
|
|
1597
|
-
clientTimestamp: new Date(),
|
|
1598
|
-
userName: this.adaptableOptions.userName,
|
|
1599
|
-
adaptableId: this.adaptableOptions.adaptableId,
|
|
1600
|
-
adaptableStateKey: this.adaptableOptions.adaptableStateKey,
|
|
1601
|
-
action: action,
|
|
1602
|
-
oldState: oldState,
|
|
1603
|
-
newState: newState,
|
|
1604
|
-
};
|
|
1613
|
+
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 });
|
|
1605
1614
|
this.api.eventApi.emit('AdaptableStateChanged', adaptableStateChangedInfo);
|
|
1606
1615
|
}
|
|
1607
1616
|
}
|
|
@@ -1636,10 +1645,8 @@ export class AdaptableAgGrid {
|
|
|
1636
1645
|
this.ChartingService = new ChartingService(this.api);
|
|
1637
1646
|
this.ThemeService = new ThemeService(this.api);
|
|
1638
1647
|
this.ValidationService = new ValidationService(this.api);
|
|
1639
|
-
this.ReportService = new ReportService(this.api);
|
|
1640
1648
|
this.ModuleService = new ModuleService(this.api);
|
|
1641
1649
|
this.CalculatedColumnExpressionService = new CalculatedColumnExpressionService(this.api);
|
|
1642
|
-
this.EntitlementService = new EntitlementService(this.api);
|
|
1643
1650
|
this.QueryLanguageService = new QueryLanguageService(this.api);
|
|
1644
1651
|
this.AlertService = new AlertService(this.api);
|
|
1645
1652
|
this.TeamSharingService = new TeamSharingService(this.api);
|
|
@@ -1713,20 +1720,27 @@ export class AdaptableAgGrid {
|
|
|
1713
1720
|
});
|
|
1714
1721
|
}
|
|
1715
1722
|
validatePrimaryKey() {
|
|
1723
|
+
var _a;
|
|
1716
1724
|
if (this.hasAutogeneratedPrimaryKey) {
|
|
1717
1725
|
return;
|
|
1718
1726
|
}
|
|
1719
1727
|
const primaryKey = this.adaptableOptions.primaryKey;
|
|
1728
|
+
// first check if there is a primary key column
|
|
1720
1729
|
const primaryKeyColDef = this.agGridAdapter.getAgGridApi().getColumnDef(primaryKey);
|
|
1721
1730
|
if (!primaryKeyColDef) {
|
|
1722
|
-
|
|
1723
|
-
if
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
this.
|
|
1731
|
+
let errorMessage;
|
|
1732
|
+
// if no primary key column then lets check the first row to see if its a data item
|
|
1733
|
+
const primaryKeyDataItem = (_a = this.getFirstRowNode()) === null || _a === void 0 ? void 0 : _a.data[primaryKey];
|
|
1734
|
+
if (!primaryKeyDataItem) {
|
|
1735
|
+
errorMessage = `The Primary Key '${this.adaptableOptions.primaryKey}' does not exist. This will affect many functions in AdapTable.`;
|
|
1736
|
+
if (this.adaptableOptions.alertOptions.showMissingPrimaryKeyAlert) {
|
|
1737
|
+
// show an alert if that is the option
|
|
1738
|
+
this.api.alertApi.showAlertError('No Primary Key', errorMessage);
|
|
1739
|
+
}
|
|
1740
|
+
else {
|
|
1741
|
+
if (this.adaptableOptions.columnOptions.showMissingColumnsWarning) {
|
|
1742
|
+
this.logger.consoleError(errorMessage);
|
|
1743
|
+
}
|
|
1730
1744
|
}
|
|
1731
1745
|
}
|
|
1732
1746
|
}
|
|
@@ -1855,7 +1869,6 @@ export class AdaptableAgGrid {
|
|
|
1855
1869
|
return this.getDisplayValueFromRawValue(rowNode, columnId, rawValue);
|
|
1856
1870
|
}
|
|
1857
1871
|
getDisplayValueFromRawValue(rowNode, columnId, rawValue) {
|
|
1858
|
-
var _a;
|
|
1859
1872
|
const isActionColumn = this.api.columnApi.isActionColumn(columnId);
|
|
1860
1873
|
if (isActionColumn) {
|
|
1861
1874
|
return this.getCleanValue(rawValue);
|
|
@@ -1871,8 +1884,7 @@ export class AdaptableAgGrid {
|
|
|
1871
1884
|
colDef,
|
|
1872
1885
|
column,
|
|
1873
1886
|
api: this.agGridAdapter.getAgGridApi(),
|
|
1874
|
-
|
|
1875
|
-
context: this.agGridAdapter.getLiveGridOptions().context,
|
|
1887
|
+
context: this.agGridAdapter.getGridOption('context'),
|
|
1876
1888
|
};
|
|
1877
1889
|
const formattedValue = colDef.valueFormatter(params);
|
|
1878
1890
|
return formattedValue || '';
|
|
@@ -2297,7 +2309,7 @@ export class AdaptableAgGrid {
|
|
|
2297
2309
|
};
|
|
2298
2310
|
}),
|
|
2299
2311
|
layout: Object.assign(Object.assign({}, layout), { Columns: visibleColumnList }),
|
|
2300
|
-
|
|
2312
|
+
groupDisplayType: this.agGridAdapter.getGridOption('groupDisplayType'),
|
|
2301
2313
|
});
|
|
2302
2314
|
}
|
|
2303
2315
|
getDistinctValuesForColumn(column, distinctValuesParams) {
|
|
@@ -2439,8 +2451,8 @@ export class AdaptableAgGrid {
|
|
|
2439
2451
|
return this.agGridAdapter.getAgGridApi().getDisplayedRowAtIndex(index);
|
|
2440
2452
|
}
|
|
2441
2453
|
getAgGridStatusPanels() {
|
|
2442
|
-
var _a, _b
|
|
2443
|
-
return (
|
|
2454
|
+
var _a, _b;
|
|
2455
|
+
return (_b = (_a = this.agGridAdapter.getGridOption('statusBar')) === null || _a === void 0 ? void 0 : _a.statusPanels) !== null && _b !== void 0 ? _b : [];
|
|
2444
2456
|
}
|
|
2445
2457
|
setDataValue(value, column, primaryKeyValue, rowNode) {
|
|
2446
2458
|
// note: because we use RowNode.setDataValue() this will cause Validation to fire
|
|
@@ -2938,35 +2950,35 @@ export class AdaptableAgGrid {
|
|
|
2938
2950
|
return this.agGridAdapter.getRegisteredModules();
|
|
2939
2951
|
}
|
|
2940
2952
|
destroy(config) {
|
|
2941
|
-
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
|
|
2953
|
+
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;
|
|
2942
2954
|
if (((_a = this.agGridAdapter) === null || _a === void 0 ? void 0 : _a.getAgGridApi()) && !this.agGridAdapter.getAgGridApi().isDestroyed()) {
|
|
2943
2955
|
this.agGridAdapter
|
|
2944
2956
|
.getAgGridApi()
|
|
2945
|
-
.removeEventListener(
|
|
2957
|
+
.removeEventListener('firstDataRendered', this.listenerFirstDataRendered);
|
|
2946
2958
|
this.agGridAdapter
|
|
2947
2959
|
.getAgGridApi()
|
|
2948
|
-
.removeEventListener(
|
|
2960
|
+
.removeEventListener('columnPivotModeChanged', this.listenerPivotModeChanged);
|
|
2949
2961
|
this.agGridAdapter
|
|
2950
2962
|
.getAgGridApi()
|
|
2951
|
-
.removeEventListener(
|
|
2963
|
+
.removeEventListener('columnPivotChanged', this.listenerPivotChanged);
|
|
2952
2964
|
this.agGridAdapter
|
|
2953
2965
|
.getAgGridApi()
|
|
2954
|
-
.removeEventListener(
|
|
2966
|
+
.removeEventListener('cellEditingStarted', this.listenerCellEditingStarted);
|
|
2955
2967
|
this.agGridAdapter
|
|
2956
2968
|
.getAgGridApi()
|
|
2957
|
-
.removeEventListener(
|
|
2969
|
+
.removeEventListener('columnRowGroupChanged', this.listenerColumnRowGroupChanged);
|
|
2958
2970
|
this.agGridAdapter
|
|
2959
2971
|
.getAgGridApi()
|
|
2960
|
-
.removeEventListener(
|
|
2972
|
+
.removeEventListener('rangeSelectionChanged', this.listenerRangeSelectionChanged);
|
|
2961
2973
|
this.agGridAdapter
|
|
2962
2974
|
.getAgGridApi()
|
|
2963
|
-
.removeEventListener(
|
|
2975
|
+
.removeEventListener('columnResized', this.listenerColumnResized);
|
|
2964
2976
|
this.agGridAdapter
|
|
2965
2977
|
.getAgGridApi()
|
|
2966
|
-
.removeEventListener(
|
|
2978
|
+
.removeEventListener('sortChanged', this.listenerSortChanged);
|
|
2967
2979
|
this.agGridAdapter
|
|
2968
2980
|
.getAgGridApi()
|
|
2969
|
-
.removeEventListener(
|
|
2981
|
+
.removeEventListener('modelUpdated', this.listenerModelUpdated);
|
|
2970
2982
|
this.agGridAdapter.getAgGridApi().removeGlobalListener(this.listenerGlobalSetRowSelection);
|
|
2971
2983
|
this.agGridAdapter
|
|
2972
2984
|
.getAgGridApi()
|
|
@@ -2992,7 +3004,7 @@ export class AdaptableAgGrid {
|
|
|
2992
3004
|
this.listenerGlobalRowGroupEventsThatTriggerAutoLayoutSave = null;
|
|
2993
3005
|
this.throttleFilterOnEditDataChange = null;
|
|
2994
3006
|
this.throttleFilterOnTickingDataChange = null;
|
|
2995
|
-
const liveGridOptions = this.
|
|
3007
|
+
const liveGridOptions = this.DANGER_getPrivateAgGridBeans().gridOptions;
|
|
2996
3008
|
if (liveGridOptions) {
|
|
2997
3009
|
this.agGridOptionsService.revertGridOptionsPropertiesToUserValue(liveGridOptions, [
|
|
2998
3010
|
'aggFuncs',
|
|
@@ -3020,6 +3032,7 @@ export class AdaptableAgGrid {
|
|
|
3020
3032
|
}
|
|
3021
3033
|
}
|
|
3022
3034
|
}
|
|
3035
|
+
DANGER_AG_GRID_BEANS_MAP[this._agGridId] = null;
|
|
3023
3036
|
if ((config === null || config === void 0 ? void 0 : config.destroyApi) === true) {
|
|
3024
3037
|
(_b = this.agGridAdapter.getAgGridApi()) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
3025
3038
|
}
|
|
@@ -3069,27 +3082,23 @@ export class AdaptableAgGrid {
|
|
|
3069
3082
|
this.CalculatedColumnExpressionService = null;
|
|
3070
3083
|
(_o = (_m = this.DataService) === null || _m === void 0 ? void 0 : _m.destroy) === null || _o === void 0 ? void 0 : _o.call(_m);
|
|
3071
3084
|
this.DataService = null;
|
|
3072
|
-
(_q = (_p = this.
|
|
3073
|
-
this.EntitlementService = null;
|
|
3074
|
-
(_s = (_r = this.Fdc3Service) === null || _r === void 0 ? void 0 : _r.destroy) === null || _s === void 0 ? void 0 : _s.call(_r);
|
|
3085
|
+
(_q = (_p = this.Fdc3Service) === null || _p === void 0 ? void 0 : _p.destroy) === null || _q === void 0 ? void 0 : _q.call(_p);
|
|
3075
3086
|
this.Fdc3Service = null;
|
|
3076
|
-
(
|
|
3077
|
-
this.ReportService = null;
|
|
3078
|
-
(_w = (_v = this.ModuleService) === null || _v === void 0 ? void 0 : _v.destroy) === null || _w === void 0 ? void 0 : _w.call(_v);
|
|
3087
|
+
(_s = (_r = this.ModuleService) === null || _r === void 0 ? void 0 : _r.destroy) === null || _s === void 0 ? void 0 : _s.call(_r);
|
|
3079
3088
|
this.ModuleService = null;
|
|
3080
|
-
(
|
|
3089
|
+
(_u = (_t = this.ValidationService) === null || _t === void 0 ? void 0 : _t.destroy) === null || _u === void 0 ? void 0 : _u.call(_t);
|
|
3081
3090
|
this.ValidationService = null;
|
|
3082
|
-
(
|
|
3091
|
+
(_w = (_v = this.QueryLanguageService) === null || _v === void 0 ? void 0 : _v.destroy) === null || _w === void 0 ? void 0 : _w.call(_v);
|
|
3083
3092
|
this.QueryLanguageService = null;
|
|
3084
|
-
(
|
|
3093
|
+
(_y = (_x = this.AlertService) === null || _x === void 0 ? void 0 : _x.destroy) === null || _y === void 0 ? void 0 : _y.call(_x);
|
|
3085
3094
|
this.AlertService = null;
|
|
3086
|
-
(
|
|
3095
|
+
(_0 = (_z = this.TeamSharingService) === null || _z === void 0 ? void 0 : _z.destroy) === null || _0 === void 0 ? void 0 : _0.call(_z);
|
|
3087
3096
|
this.TeamSharingService = null;
|
|
3088
|
-
(
|
|
3097
|
+
(_2 = (_1 = this.RowEditService) === null || _1 === void 0 ? void 0 : _1.destroy) === null || _2 === void 0 ? void 0 : _2.call(_1);
|
|
3089
3098
|
this.RowEditService = null;
|
|
3090
|
-
(
|
|
3099
|
+
(_4 = (_3 = this.MetamodelService) === null || _3 === void 0 ? void 0 : _3.destroy) === null || _4 === void 0 ? void 0 : _4.call(_3);
|
|
3091
3100
|
this.MetamodelService = null;
|
|
3092
|
-
(
|
|
3101
|
+
(_6 = (_5 = this.LicenseService) === null || _5 === void 0 ? void 0 : _5.destroy) === null || _6 === void 0 ? void 0 : _6.call(_5);
|
|
3093
3102
|
this.LicenseService = null;
|
|
3094
3103
|
}
|
|
3095
3104
|
canExportToExcel() {
|
|
@@ -3142,13 +3151,13 @@ export class AdaptableAgGrid {
|
|
|
3142
3151
|
}
|
|
3143
3152
|
exportVisualDataToExcel() {
|
|
3144
3153
|
try {
|
|
3145
|
-
const exportExcelStyles = this.
|
|
3154
|
+
const exportExcelStyles = this.api.exportApi.internalApi.buildExcelStylesForVisualReports();
|
|
3146
3155
|
// set DANGER_excelStyles without changing the array reference
|
|
3147
3156
|
this.DANGER_excelStyles.splice(0, this.DANGER_excelStyles.length, ...exportExcelStyles);
|
|
3148
3157
|
// this.agGridOptionsService.CAREFUL_patchGridOptionsProperty('excelStyles', exportExcelStyles);
|
|
3149
3158
|
this.agGridAdapter.getAgGridApi().exportDataAsExcel({
|
|
3150
3159
|
sheetName: 'Sheet 1',
|
|
3151
|
-
fileName: this.
|
|
3160
|
+
fileName: this.api.exportApi.internalApi.getReportFileName(this.adaptableOptions.adaptableId, 'Excel'),
|
|
3152
3161
|
// delegate the cell value processing to Adaptable
|
|
3153
3162
|
processCellCallback: ({ node, column, value }) => {
|
|
3154
3163
|
var _a;
|
|
@@ -3207,18 +3216,18 @@ export class AdaptableAgGrid {
|
|
|
3207
3216
|
rawValue = dateRawValue;
|
|
3208
3217
|
}
|
|
3209
3218
|
}
|
|
3210
|
-
return this.
|
|
3219
|
+
return this.api.exportApi.internalApi.getCellExportValueFromRawValue(rowNode, rawValue, columnId);
|
|
3211
3220
|
}
|
|
3212
3221
|
processCellForExcelExport(rowNode, columnId) {
|
|
3213
3222
|
if (this.api.exportApi.internalApi.isVisualDataExportInProgress()) {
|
|
3214
3223
|
const cellKey = this.agGridColumnAdapter.getExcelClassNameForCell(columnId, this.getPrimaryKeyValueFromRowNode(rowNode));
|
|
3215
|
-
const isoFormattedDate = this.
|
|
3224
|
+
const isoFormattedDate = this.api.exportApi.internalApi.getExcelStyleWithFormattedDate(cellKey);
|
|
3216
3225
|
if (isoFormattedDate) {
|
|
3217
3226
|
// this is a Date cell which will be formatted by Excel
|
|
3218
3227
|
return isoFormattedDate;
|
|
3219
3228
|
}
|
|
3220
3229
|
}
|
|
3221
|
-
return this.
|
|
3230
|
+
return this.api.exportApi.internalApi.getCellExportValueFromRowNode(rowNode, columnId);
|
|
3222
3231
|
}
|
|
3223
3232
|
isQuickFilterAvailable() {
|
|
3224
3233
|
if (this.api.layoutApi.isCurrentLayoutPivot() &&
|
|
@@ -4009,8 +4018,11 @@ export class AdaptableAgGrid {
|
|
|
4009
4018
|
}
|
|
4010
4019
|
// we need to intercept some of the GridOptions updates and refresh the Adaptable state
|
|
4011
4020
|
monkeyPatchingGridOptionsUpdates(agGridApi) {
|
|
4012
|
-
|
|
4013
|
-
const gridOptionsService =
|
|
4021
|
+
var _a;
|
|
4022
|
+
const gridOptionsService = (_a = this.DANGER_getPrivateAgGridBeans()) === null || _a === void 0 ? void 0 : _a.gos;
|
|
4023
|
+
if (!gridOptionsService) {
|
|
4024
|
+
this.logger.consoleError('Could not get hold of GridOptionsService! This is a critical error and will prevent Adaptable from working correctly.');
|
|
4025
|
+
}
|
|
4014
4026
|
const self = this;
|
|
4015
4027
|
gridOptionsService.updateGridOptions = function ({ options, force, source = 'api', }) {
|
|
4016
4028
|
// `columnDefs`
|
|
@@ -4040,4 +4052,11 @@ export class AdaptableAgGrid {
|
|
|
4040
4052
|
GridOptionsService_updateGridOptions.apply(this, arguments);
|
|
4041
4053
|
};
|
|
4042
4054
|
}
|
|
4055
|
+
DANGER_getPrivateAgGridBeans() {
|
|
4056
|
+
const beans = DANGER_AG_GRID_BEANS_MAP[this._agGridId];
|
|
4057
|
+
if (!beans) {
|
|
4058
|
+
this.logger.consoleError('Could not get hold of AgGridBeans! This is a critical error and will prevent Adaptable from working correctly.');
|
|
4059
|
+
}
|
|
4060
|
+
return beans;
|
|
4061
|
+
}
|
|
4043
4062
|
}
|