@adaptabletools/adaptable 10.0.3 → 10.0.4-canary.3
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/LICENSE.md +1 -1
- package/README.md +1 -1
- package/base.css +16 -6
- package/bundle.cjs.js +350 -0
- package/index.css +20 -6
- package/package.json +1 -5
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/AdaptableNoCodeWizard.d.ts +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +14 -12
- package/src/AdaptableOptions/AdaptableOptions.d.ts +3 -3
- package/src/AdaptableOptions/ContainerOptions.d.ts +4 -5
- package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +1 -1
- package/src/AdaptableOptions/DateInputOptions.d.ts +5 -1
- package/src/AdaptableOptions/EditOptions.d.ts +2 -3
- package/src/AdaptableOptions/FilterOptions.d.ts +8 -8
- package/src/AdaptableOptions/GeneralOptions.d.ts +3 -2
- package/src/AdaptableOptions/MenuOptions.d.ts +11 -11
- package/src/AdaptableOptions/NotificationsOptions.d.ts +11 -1
- package/src/AdaptableOptions/ToolPanelOptions.d.ts +2 -2
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +29 -12
- package/src/Api/AdaptableApi.d.ts +12 -12
- package/src/Api/CalculatedColumnApi.d.ts +15 -0
- package/src/Api/ColumnApi.d.ts +16 -5
- package/src/Api/EventApi.d.ts +1 -1
- package/src/Api/Events/AdaptableReady.d.ts +5 -8
- package/src/Api/Events/AdaptableStateChanged.d.ts +2 -1
- package/src/Api/Events/AlertFired.d.ts +2 -1
- package/src/Api/Events/BaseEventInfo.d.ts +10 -0
- package/src/Api/Events/BaseEventInfo.js +2 -0
- package/src/Api/Events/CellChanged.d.ts +2 -1
- package/src/Api/Events/ChexboxColumnClicked.d.ts +2 -1
- package/src/Api/Events/CustomToolbarConfigured.d.ts +2 -1
- package/src/Api/Events/DashboardChanged.d.ts +2 -1
- package/src/Api/Events/FlashingAlertFired.d.ts +2 -1
- package/src/Api/Events/GridDataChanged.d.ts +2 -1
- package/src/Api/Events/LayoutChanged.d.ts +2 -1
- package/src/Api/Events/LiveDataChanged.d.ts +2 -1
- package/src/Api/Events/SearchChanged.d.ts +2 -1
- package/src/Api/Events/SelectionChanged.d.ts +2 -1
- package/src/Api/Events/SystemStatusMessageDisplayed.d.ts +2 -1
- package/src/Api/Events/TeamSharingEntityChanged.d.ts +2 -1
- package/src/Api/Events/ThemeChanged.d.ts +2 -1
- package/src/Api/GridApi.d.ts +10 -10
- package/src/Api/Implementation/AlertApiImpl.js +17 -17
- package/src/Api/Implementation/CalculatedColumnApiImpl.d.ts +3 -0
- package/src/Api/Implementation/CalculatedColumnApiImpl.js +23 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +5 -3
- package/src/Api/Implementation/ColumnApiImpl.js +43 -44
- package/src/Api/Implementation/ConfigApiImpl.js +0 -24
- package/src/Api/Implementation/DashboardApiImpl.js +2 -1
- package/src/Api/Implementation/ExportApiImpl.js +4 -4
- package/src/Api/Implementation/FormatColumnApiImpl.js +2 -1
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +7 -2
- package/src/Api/Implementation/GridApiImpl.d.ts +2 -2
- package/src/Api/Implementation/GridApiImpl.js +14 -13
- package/src/Api/Implementation/InternalApiImpl.d.ts +2 -2
- package/src/Api/Implementation/InternalApiImpl.js +5 -5
- package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
- package/src/Api/Implementation/LayoutApiImpl.js +19 -3
- package/src/Api/Implementation/PluginsApiImpl.d.ts +2 -2
- package/src/Api/Implementation/PluginsApiImpl.js +1 -1
- package/src/Api/Implementation/ScheduleApiImpl.js +6 -6
- package/src/Api/Implementation/ScopeApiImpl.js +11 -11
- package/src/Api/Implementation/SystemStatusApiImpl.js +1 -0
- package/src/Api/Implementation/TeamSharingApiImpl.js +1 -0
- package/src/Api/Implementation/ThemeApiImpl.js +1 -0
- package/src/Api/Implementation/ToolPanelApiImpl.js +1 -1
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +5 -4
- package/src/Api/Implementation/UserInterfaceApiImpl.js +18 -13
- package/src/Api/InternalApi.d.ts +2 -2
- package/src/Api/LayoutApi.d.ts +7 -0
- package/src/Api/PluginsApi.d.ts +1 -7
- package/src/Api/TeamSharingApi.d.ts +1 -1
- package/src/Api/ThemeApi.d.ts +2 -2
- package/src/Api/UserInterfaceApi.d.ts +6 -5
- package/src/PredefinedConfig/AdaptableState.d.ts +2 -10
- package/src/PredefinedConfig/AlertState.d.ts +2 -3
- package/src/PredefinedConfig/ApplicationState.d.ts +1 -1
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableButton.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +36 -36
- package/src/PredefinedConfig/Common/AdaptableColumn.js +5 -5
- package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +4 -4
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +3 -3
- package/src/PredefinedConfig/Common/AdaptableStyle.d.ts +7 -7
- package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +4 -3
- package/src/PredefinedConfig/Common/Menu.d.ts +40 -17
- package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +1 -1
- package/src/PredefinedConfig/Common/Types.d.ts +5 -5
- package/src/PredefinedConfig/Common/Types.js +9 -7
- package/src/PredefinedConfig/ConditionalStyleState.d.ts +1 -1
- package/src/PredefinedConfig/CustomSortState.d.ts +1 -1
- package/src/PredefinedConfig/DataSourceState.d.ts +1 -1
- package/src/PredefinedConfig/ExportState.d.ts +3 -3
- package/src/PredefinedConfig/FilterState.d.ts +2 -2
- package/src/PredefinedConfig/FormatColumnState.d.ts +1 -1
- package/src/PredefinedConfig/FreeTextColumnState.d.ts +1 -1
- package/src/PredefinedConfig/LayoutState.d.ts +1 -1
- package/src/PredefinedConfig/PredefinedConfig.d.ts +0 -40
- package/src/PredefinedConfig/QuickSearchState.d.ts +3 -3
- package/src/PredefinedConfig/ScheduleState.d.ts +1 -1
- package/src/PredefinedConfig/Selection/GridCell.d.ts +2 -1
- package/src/PredefinedConfig/ThemeState.d.ts +5 -1
- package/src/Redux/ActionsReducers/DashboardRedux.js +2 -1
- package/src/Redux/ActionsReducers/GridRedux.d.ts +3 -2
- package/src/Redux/ActionsReducers/GridRedux.js +2 -2
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +12 -2
- package/src/Redux/ActionsReducers/LayoutRedux.js +24 -1
- package/src/Redux/ActionsReducers/SystemRedux.js +1 -1
- package/src/Redux/DeadRedux.d.ts +4 -8
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +6 -1
- package/src/Redux/Store/AdaptableStore.d.ts +3 -3
- package/src/Redux/Store/AdaptableStore.js +21 -16
- package/src/Strategy/AdaptableModuleBase.d.ts +2 -2
- package/src/Strategy/AdaptableModuleBase.js +8 -8
- package/src/Strategy/AlertModule.d.ts +2 -2
- package/src/Strategy/AlertModule.js +13 -105
- package/src/Strategy/BulkUpdateModule.d.ts +2 -2
- package/src/Strategy/BulkUpdateModule.js +7 -7
- package/src/Strategy/CalculatedColumnModule.js +1 -1
- package/src/Strategy/CellSummaryModule.d.ts +2 -2
- package/src/Strategy/CellSummaryModule.js +3 -3
- package/src/Strategy/ConditionalStyleModule.js +3 -3
- package/src/Strategy/CustomSortModule.js +2 -2
- package/src/Strategy/DashboardModule.d.ts +2 -2
- package/src/Strategy/DataChangeHistoryModule.js +2 -2
- package/src/Strategy/ExportModule.d.ts +2 -2
- package/src/Strategy/ExportModule.js +1 -1
- package/src/Strategy/FilterModule.d.ts +2 -2
- package/src/Strategy/FilterModule.js +4 -4
- package/src/Strategy/FormatColumnModule.js +6 -6
- package/src/Strategy/FreeTextColumnModule.js +1 -1
- package/src/Strategy/GridInfoModule.d.ts +2 -2
- package/src/Strategy/Interface/IModule.d.ts +2 -2
- package/src/Strategy/LayoutModule.d.ts +2 -2
- package/src/Strategy/LayoutModule.js +22 -9
- package/src/Strategy/PlusMinusModule.js +8 -9
- package/src/Strategy/SmartEditModule.d.ts +2 -2
- package/src/Strategy/SmartEditModule.js +8 -9
- package/src/Strategy/SystemStatusModule.d.ts +2 -2
- package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
- package/src/Utilities/Constants/GeneralConstants.js +2 -1
- package/src/Utilities/Constants/ModuleConstants.d.ts +6 -6
- package/src/Utilities/Constants/ModuleConstants.js +7 -7
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +8 -7
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +2 -2
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -2
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +1 -1
- package/src/Utilities/Helpers/PreviewHelper.js +2 -2
- package/src/Utilities/Interface/Preview.d.ts +2 -1
- package/src/Utilities/ObjectFactory.js +1 -1
- package/src/Utilities/Services/DataService.js +5 -5
- package/src/Utilities/Services/LicenseService.js +16 -2
- package/src/Utilities/Services/MetamodelService.js +0 -1
- package/src/Utilities/Services/ReportService.js +12 -11
- package/src/Utilities/Services/ValidationService.js +4 -5
- package/src/View/AdaptableViewFactory.d.ts +2 -1
- package/src/View/AdaptableViewFactory.js +2 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationForm.js +7 -7
- package/src/View/Alert/AlertPopup.js +1 -1
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +1 -1
- package/src/View/BulkUpdate/BulkUpdatePopup.js +3 -3
- package/src/View/CalculatedColumn/CalculatedColumnPopup.js +1 -1
- package/src/View/CalculatedColumn/CalculatedColumnSummary.js +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -1
- package/src/View/CellSummary/CellSummaryViewPanel.js +2 -2
- package/src/View/Components/ColumnSelector/index.js +2 -2
- package/src/View/Components/FilterForm/FilterForm.js +18 -20
- package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +1 -1
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +7 -7
- package/src/View/Components/FilterForm/QuickFilterForm.js +15 -17
- package/src/View/Components/NewScopeComponent.js +1 -1
- package/src/View/Components/Panels/FilterFormPanel.d.ts +1 -1
- package/src/View/Components/Panels/PanelWithImage.d.ts +423 -1
- package/src/View/Components/Popups/AdaptablePopupAlert.js +23 -10
- package/src/View/Components/PreviewResultsPanel.js +1 -1
- package/src/View/Components/RangesComponent.js +2 -2
- package/src/View/Components/Selectors/ColumnSelector.js +5 -5
- package/src/View/Components/Selectors/ColumnValueSelector.js +4 -4
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +10 -11
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/Components/ToolPanel/ToolPanelPopup.js +2 -3
- package/src/View/ConditionalStyle/ConditionalStylePopup.js +1 -1
- package/src/View/ConditionalStyle/ConditionalStyleSummary.js +1 -1
- package/src/View/CustomSort/CustomSortEntityRow.d.ts +3 -1
- package/src/View/CustomSort/CustomSortEntityRow.js +3 -3
- package/src/View/CustomSort/CustomSortPopup.js +2 -2
- package/src/View/CustomSort/CustomSortSummary.js +3 -3
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +4 -4
- package/src/View/Dashboard/CustomToolbarWrapper.js +2 -1
- package/src/View/Dashboard/Dashboard.js +2 -3
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.d.ts +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +11 -10
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +6 -6
- package/src/View/Export/ExportCustomDestinationDialog.js +1 -1
- package/src/View/Export/ExportViewPanel.js +6 -6
- package/src/View/Filter/FilterSummary.js +2 -2
- package/src/View/FormatColumn/FormatColumnPopup.js +1 -1
- package/src/View/FormatColumn/FormatColumnSummary.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
- package/src/View/FreeTextColumn/FreeTextColumnPopup.js +1 -1
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +2 -2
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -1
- package/src/View/GridInfo/ColumnInfoComponent.js +16 -16
- package/src/View/GridInfo/GridOptionsComponent.js +1 -1
- package/src/View/Layout/LayoutViewPanel.js +2 -2
- package/src/View/Layout/Wizard/LayoutEditor/ColumnList.js +6 -6
- package/src/View/Layout/Wizard/LayoutEditor/ColumnSortList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/PivotList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/RowGroupsList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/getItemStyle.js +2 -2
- package/src/View/Layout/Wizard/LayoutEditor/index.js +41 -41
- package/src/View/PlusMinus/PlusMinusPopup.js +1 -1
- package/src/View/PlusMinus/PlusMinusSummary.js +1 -1
- package/src/View/Query/QueryViewPanel.js +3 -3
- package/src/View/QuickSearch/useQuickSearchDebounced.js +2 -3
- package/src/View/Schedule/SchedulePopup.js +3 -3
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsWizard.js +1 -1
- package/src/View/SmartEdit/SmartEditPopup.js +1 -1
- package/src/View/StateManagement/StateManagementPopup.d.ts +2 -12
- package/src/View/StateManagement/StateManagementPopup.js +21 -114
- package/src/View/StateManagement/StateManagementViewPanel.d.ts +5 -0
- package/src/View/StateManagement/StateManagementViewPanel.js +22 -0
- package/src/View/StateManagement/components/ClearButton.d.ts +6 -0
- package/src/View/StateManagement/components/ClearButton.js +9 -0
- package/src/View/StateManagement/components/ExportDropdown.d.ts +8 -0
- package/src/View/StateManagement/components/ExportDropdown.js +43 -0
- package/src/View/StateManagement/components/LoadButton.d.ts +7 -0
- package/src/View/StateManagement/components/LoadButton.js +38 -0
- package/src/View/StateManagement/handleExportState.d.ts +1 -0
- package/src/View/StateManagement/handleExportState.js +22 -0
- package/src/View/Theme/ThemeViewPanel.js +1 -1
- package/src/agGrid/ActionColumnRenderer.js +1 -1
- package/src/agGrid/Adaptable.d.ts +9 -8
- package/src/agGrid/Adaptable.js +174 -132
- package/src/agGrid/agGridHelper.d.ts +4 -4
- package/src/agGrid/agGridHelper.js +46 -46
- package/src/agGrid/agGridMenuHelper.d.ts +15 -13
- package/src/agGrid/agGridMenuHelper.js +55 -47
- package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.d.ts +1 -1
- package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.js +11 -6
- package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +3 -2
- package/src/agGrid/editors/AdaptableDateEditor/index.js +16 -6
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +1 -0
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +7 -2
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +3 -3
- package/src/components/Datepicker/DatepickerContext.d.ts +2 -2
- package/src/components/Datepicker/index.js +9 -5
- package/src/components/ExpressionEditor/index.js +7 -7
- package/src/components/Modal/index.d.ts +1 -1
- package/src/components/OverlayTrigger/index.js +3 -3
- package/src/components/OverlayTrigger/useAgGridClassName.d.ts +2 -0
- package/src/components/OverlayTrigger/{useVendorClassName.js → useAgGridClassName.js} +3 -3
- package/src/components/ProgressIndicator/ProgressIndicator.js +1 -1
- package/src/components/icons/index.js +2 -0
- package/src/components/icons/upload.d.ts +3 -0
- package/src/components/icons/upload.js +8 -0
- package/src/metamodel/adaptable.metamodel.d.ts +104 -50
- package/src/metamodel/adaptable.metamodel.js +358 -300
- package/src/types.d.ts +2 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/PredefinedConfig/DeprecatedState.d.ts +0 -82
- package/src/PredefinedConfig/DeprecatedState.js +0 -5
- package/src/components/OverlayTrigger/useVendorClassName.d.ts +0 -2
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -124,6 +124,7 @@ class Adaptable {
|
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
126
|
this._adaptableReady = false;
|
|
127
|
+
this.isDestroyed = false;
|
|
127
128
|
this.agGridModules = [];
|
|
128
129
|
this.isPluginLoaded = (pluginId) => {
|
|
129
130
|
const plugins = this.adaptableOptions.plugins || [];
|
|
@@ -137,7 +138,7 @@ class Adaptable {
|
|
|
137
138
|
};
|
|
138
139
|
this.isAgGridReady = () => {
|
|
139
140
|
var _a, _b;
|
|
140
|
-
const waitTimeout = (_b = (_a = this.adaptableOptions.containerOptions) === null || _a === void 0 ? void 0 : _a.
|
|
141
|
+
const waitTimeout = (_b = (_a = this.adaptableOptions.containerOptions) === null || _a === void 0 ? void 0 : _a.agGridContainerWaitTimeout) !== null && _b !== void 0 ? _b : 60000;
|
|
141
142
|
return waitForCondition_1.waitForCondition(() => !!this.gridOptions.api, waitTimeout);
|
|
142
143
|
};
|
|
143
144
|
// debounced methods
|
|
@@ -339,7 +340,8 @@ class Adaptable {
|
|
|
339
340
|
// TODO: if a custom 'aggFunc' property is defined (see setupColumnAggFunc()), it won't be evaluated
|
|
340
341
|
if (!this.getDefaultGroupOrderComparator(this.gridOptions) &&
|
|
341
342
|
this.adaptableOptions.generalOptions.autoOrderGroupedColumns) {
|
|
342
|
-
this.gridOptions.defaultGroupOrderComparator =
|
|
343
|
+
this.gridOptions.defaultGroupOrderComparator =
|
|
344
|
+
this.agGridHelper.runAdaptableGroupComparerFunction();
|
|
343
345
|
}
|
|
344
346
|
// we prefer the grid to be NOT instantiated so that we can do it
|
|
345
347
|
// perhaps in future we will force instantiation only?
|
|
@@ -357,7 +359,7 @@ class Adaptable {
|
|
|
357
359
|
this.TeamSharingService = new TeamSharingService_1.TeamSharingService(this);
|
|
358
360
|
this.MetamodelService = new MetamodelService_1.MetamodelService(this);
|
|
359
361
|
this.forPlugins((plugin) => plugin.afterInitServices(this));
|
|
360
|
-
// Set up Modules - we set up all the Modules suitable for
|
|
362
|
+
// Set up Modules - we set up all the Modules suitable for AG Grid
|
|
361
363
|
// But users can make some hidden or readonly in their entitlements
|
|
362
364
|
this.modules = this.agGridHelper.setUpModules();
|
|
363
365
|
this.forPlugins((plugin) => plugin.afterInitModules(this, this.modules));
|
|
@@ -404,6 +406,9 @@ class Adaptable {
|
|
|
404
406
|
}
|
|
405
407
|
// Load the store
|
|
406
408
|
this.adaptableStore.Load.then(() => {
|
|
409
|
+
if (this.isDestroyed) {
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
407
412
|
this.initInternalGridLogic();
|
|
408
413
|
AdaptableHelper_1.default.checkValidPrimaryKey(this);
|
|
409
414
|
}, (e) => {
|
|
@@ -478,7 +483,7 @@ class Adaptable {
|
|
|
478
483
|
this.forPlugins((plugin) => plugin.onAdaptableReady(this, this.adaptableOptions));
|
|
479
484
|
this.api.eventApi.emit('AdaptableReady', {
|
|
480
485
|
adaptableApi: this.api,
|
|
481
|
-
|
|
486
|
+
gridOptions: this.adaptableOptions.vendorGrid,
|
|
482
487
|
});
|
|
483
488
|
}
|
|
484
489
|
});
|
|
@@ -486,6 +491,7 @@ class Adaptable {
|
|
|
486
491
|
performAudit(action, oldState, newState) {
|
|
487
492
|
if (this.isInitialised) {
|
|
488
493
|
const adaptableStateChangedInfo = {
|
|
494
|
+
adaptableApi: this.api,
|
|
489
495
|
actionName: action.type,
|
|
490
496
|
clientTimestamp: new Date(),
|
|
491
497
|
userName: this.adaptableOptions.userName,
|
|
@@ -553,12 +559,12 @@ class Adaptable {
|
|
|
553
559
|
}
|
|
554
560
|
}
|
|
555
561
|
}
|
|
556
|
-
const
|
|
557
|
-
let
|
|
558
|
-
if (!
|
|
559
|
-
|
|
560
|
-
if (!
|
|
561
|
-
LoggingHelper_1.ConsoleLogError('You must provide an element id in `containerOptions.
|
|
562
|
+
const checkAgGridContainer = () => {
|
|
563
|
+
let agGridContainer = this.getAgGridContainerElement();
|
|
564
|
+
if (!agGridContainer) {
|
|
565
|
+
agGridContainer = this.initAgGridContainerFromInitializedAgGrid();
|
|
566
|
+
if (!agGridContainer) {
|
|
567
|
+
LoggingHelper_1.ConsoleLogError('You must provide an element id in `containerOptions.agGridContainer`');
|
|
562
568
|
return false;
|
|
563
569
|
}
|
|
564
570
|
}
|
|
@@ -566,14 +572,14 @@ class Adaptable {
|
|
|
566
572
|
};
|
|
567
573
|
const isGridInstantiated = this.gridOptions.api && typeof this.gridOptions.api.getValue === 'function';
|
|
568
574
|
if (isGridInstantiated) {
|
|
569
|
-
if (!
|
|
575
|
+
if (!checkAgGridContainer()) {
|
|
570
576
|
return Promise.resolve(false);
|
|
571
577
|
}
|
|
572
578
|
return Promise.resolve(true);
|
|
573
579
|
}
|
|
574
580
|
if (this.runtimeConfig.waitForAgGrid) {
|
|
575
581
|
return this.isAgGridReady().then(() => {
|
|
576
|
-
this.
|
|
582
|
+
this.initAgGridContainerFromInitializedAgGrid();
|
|
577
583
|
return Promise.resolve(true);
|
|
578
584
|
}, () => {
|
|
579
585
|
LoggingHelper_1.ConsoleLogError(`Could not find any agGrid instance rendered. Could not find reference to ag-grid api. Make sure you pass the same gridOptions object reference both to Adaptable and AgGrid`);
|
|
@@ -581,7 +587,7 @@ class Adaptable {
|
|
|
581
587
|
});
|
|
582
588
|
}
|
|
583
589
|
else {
|
|
584
|
-
if (!
|
|
590
|
+
if (!checkAgGridContainer()) {
|
|
585
591
|
return Promise.resolve(false);
|
|
586
592
|
}
|
|
587
593
|
}
|
|
@@ -589,11 +595,11 @@ class Adaptable {
|
|
|
589
595
|
let grid;
|
|
590
596
|
const modules = (this.adaptableOptions.vendorGrid || {}).modules || [];
|
|
591
597
|
this.agGridModules = [...this.agGridModules, ...modules];
|
|
592
|
-
const
|
|
598
|
+
const agGridContainer = this.getAgGridContainerElement();
|
|
593
599
|
if (this.gridOptions.modules) {
|
|
594
600
|
delete this.gridOptions.modules;
|
|
595
601
|
}
|
|
596
|
-
grid = new all_modules_1.Grid(
|
|
602
|
+
grid = new all_modules_1.Grid(agGridContainer, this.gridOptions, { modules });
|
|
597
603
|
// add our adaptable object to the grid options api object
|
|
598
604
|
// this is VERY useful for when we need to access Adaptable inside of agGrid only functions
|
|
599
605
|
if (this.gridOptions.api) {
|
|
@@ -601,8 +607,8 @@ class Adaptable {
|
|
|
601
607
|
}
|
|
602
608
|
return Promise.resolve(grid != null);
|
|
603
609
|
}
|
|
604
|
-
|
|
605
|
-
if (this.
|
|
610
|
+
initAgGridContainerFromInitializedAgGrid() {
|
|
611
|
+
if (this.getAgGridContainerElement()) {
|
|
606
612
|
return;
|
|
607
613
|
}
|
|
608
614
|
const layoutElements = this.gridOptions.api
|
|
@@ -614,21 +620,21 @@ class Adaptable {
|
|
|
614
620
|
// aggrid 25.3.0 doesn't have layoutElements anymore, so we try to retrieve this element
|
|
615
621
|
layoutElements.push(this.gridOptions.api.gridBodyCon.eGridBody);
|
|
616
622
|
}
|
|
617
|
-
let
|
|
623
|
+
let agGridContainer;
|
|
618
624
|
for (let i = 0, len = layoutElements.length; i < len; i++) {
|
|
619
625
|
const element = layoutElements[i];
|
|
620
626
|
if (element && element.matches('.ag-root-wrapper, .ag-root')) {
|
|
621
627
|
const gridContainer = element.closest('[class*="ag-theme"]');
|
|
622
628
|
if (gridContainer) {
|
|
623
|
-
|
|
629
|
+
agGridContainer = gridContainer;
|
|
624
630
|
break;
|
|
625
631
|
}
|
|
626
632
|
}
|
|
627
633
|
}
|
|
628
|
-
if (!
|
|
629
|
-
LoggingHelper_1.ConsoleLogError(`Could not find the
|
|
634
|
+
if (!agGridContainer) {
|
|
635
|
+
LoggingHelper_1.ConsoleLogError(`Could not find the AG Grid Container. This will probably break some AdapTable functionality.`);
|
|
630
636
|
}
|
|
631
|
-
return (this.adaptableOptions.containerOptions.
|
|
637
|
+
return (this.adaptableOptions.containerOptions.agGridContainer = agGridContainer);
|
|
632
638
|
}
|
|
633
639
|
filterOnEditDataChange() {
|
|
634
640
|
if (this.adaptableOptions.filterOptions.filterActionOnUserDataChange.applyFilter ==
|
|
@@ -722,7 +728,7 @@ class Adaptable {
|
|
|
722
728
|
// }
|
|
723
729
|
// }
|
|
724
730
|
const allColumns = [];
|
|
725
|
-
const
|
|
731
|
+
const agGridCols = this.gridOptions.columnApi.getAllColumns();
|
|
726
732
|
const columnGroupChildren = this.gridOptions.columnApi.getAllDisplayedColumnGroups();
|
|
727
733
|
const groupsCount = {};
|
|
728
734
|
const colsToGroups = columnGroupChildren.reduce((acc, columnGroup) => {
|
|
@@ -736,31 +742,31 @@ class Adaptable {
|
|
|
736
742
|
const columnsInGroup = columnGroup.getLeafColumns();
|
|
737
743
|
columnsInGroup.forEach((col) => {
|
|
738
744
|
const group = {
|
|
739
|
-
|
|
740
|
-
FriendlyName,
|
|
741
|
-
|
|
742
|
-
|
|
745
|
+
columnGroupId: ColumnGroupId,
|
|
746
|
+
friendlyName: FriendlyName,
|
|
747
|
+
allowGroupSplit: AllowGroupSplit,
|
|
748
|
+
groupCount: 0,
|
|
743
749
|
};
|
|
744
|
-
groupsCount[group.
|
|
745
|
-
groupsCount[group.
|
|
750
|
+
groupsCount[group.columnGroupId] = groupsCount[group.columnGroupId] || 0;
|
|
751
|
+
groupsCount[group.columnGroupId] += columnsInGroup.length;
|
|
746
752
|
acc[col.getColId()] = group;
|
|
747
753
|
});
|
|
748
754
|
return acc;
|
|
749
755
|
}, {});
|
|
750
756
|
Object.keys(colsToGroups).forEach((colId) => {
|
|
751
|
-
colsToGroups[colId].
|
|
757
|
+
colsToGroups[colId].groupCount = groupsCount[colsToGroups[colId].columnGroupId];
|
|
752
758
|
});
|
|
753
759
|
// TODO sort the visible columns by layout order
|
|
754
|
-
|
|
755
|
-
const colId =
|
|
760
|
+
agGridCols.forEach((agGridColumn) => {
|
|
761
|
+
const colId = agGridColumn.getColId();
|
|
756
762
|
if (!this.api.columnApi.isRowGroupColumn(colId)) {
|
|
757
|
-
allColumns.push(this.createAdaptableColumn(
|
|
763
|
+
allColumns.push(this.createAdaptableColumn(agGridColumn, colsToGroups));
|
|
758
764
|
}
|
|
759
765
|
});
|
|
760
766
|
this.api.internalApi.setColumns(allColumns);
|
|
761
767
|
}
|
|
762
|
-
createAdaptableColumn(
|
|
763
|
-
const abColumn = this.agGridHelper.
|
|
768
|
+
createAdaptableColumn(agGridColumn, colsToGroups) {
|
|
769
|
+
const abColumn = this.agGridHelper.createAdaptableColumnFromAgGridColumn(agGridColumn, colsToGroups);
|
|
764
770
|
return abColumn;
|
|
765
771
|
}
|
|
766
772
|
safeSetColDefs(colDefs) {
|
|
@@ -840,7 +846,8 @@ class Adaptable {
|
|
|
840
846
|
var _a;
|
|
841
847
|
return ((_a = aa.alertDefinition.AlertProperties) === null || _a === void 0 ? void 0 : _a.HighlightCell) &&
|
|
842
848
|
aa.dataChangedInfo &&
|
|
843
|
-
aa.dataChangedInfo.
|
|
849
|
+
aa.dataChangedInfo.column &&
|
|
850
|
+
aa.dataChangedInfo.column.columnId === col.columnId &&
|
|
844
851
|
aa.dataChangedInfo.rowNode === params.node;
|
|
845
852
|
});
|
|
846
853
|
const alert = activeAlerts[0];
|
|
@@ -868,7 +875,7 @@ class Adaptable {
|
|
|
868
875
|
}
|
|
869
876
|
getFlashingAlertCellStyle(col, params) {
|
|
870
877
|
const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(params.node);
|
|
871
|
-
return this.getFlashingAlertStyleFor(primaryKeyValue, col.
|
|
878
|
+
return this.getFlashingAlertStyleFor(primaryKeyValue, col.columnId);
|
|
872
879
|
}
|
|
873
880
|
getCellHighlightStyle(col, params) {
|
|
874
881
|
var _a;
|
|
@@ -876,7 +883,7 @@ class Adaptable {
|
|
|
876
883
|
const cellHightlight = this.api.internalApi
|
|
877
884
|
.getSystemState()
|
|
878
885
|
.HighlightedCells.find((cellHighlightInfo) => {
|
|
879
|
-
return (col.
|
|
886
|
+
return (col.columnId === cellHighlightInfo.columnId &&
|
|
880
887
|
cellHighlightInfo.primaryKeyValue === primaryKeyValue);
|
|
881
888
|
});
|
|
882
889
|
if (cellHightlight) {
|
|
@@ -905,7 +912,7 @@ class Adaptable {
|
|
|
905
912
|
if (!editableCellStyle) {
|
|
906
913
|
return undefined;
|
|
907
914
|
}
|
|
908
|
-
const gridCell = this.getGridCellFromRowNode(params.node, abColumn.
|
|
915
|
+
const gridCell = this.getGridCellFromRowNode(params.node, abColumn.columnId);
|
|
909
916
|
if (gridCell) {
|
|
910
917
|
if (this.api.gridApi.areCellsEditable([gridCell])) {
|
|
911
918
|
return this.convertAdaptableStyleToCSS(editableCellStyle);
|
|
@@ -918,7 +925,7 @@ class Adaptable {
|
|
|
918
925
|
if (!editableCellStyle) {
|
|
919
926
|
return undefined;
|
|
920
927
|
}
|
|
921
|
-
const gridCell = this.getGridCellFromRowNode(params.node, abColumn.
|
|
928
|
+
const gridCell = this.getGridCellFromRowNode(params.node, abColumn.columnId);
|
|
922
929
|
if (gridCell) {
|
|
923
930
|
if (!this.api.gridApi.areCellsEditable([gridCell])) {
|
|
924
931
|
return this.convertAdaptableStyleToCSS(editableCellStyle);
|
|
@@ -958,7 +965,7 @@ class Adaptable {
|
|
|
958
965
|
return null;
|
|
959
966
|
}
|
|
960
967
|
const isCellEditable = this.api.gridApi.areCellsEditable([
|
|
961
|
-
this.getGridCellFromRowNode(params.node, abColumn.
|
|
968
|
+
this.getGridCellFromRowNode(params.node, abColumn.columnId),
|
|
962
969
|
]);
|
|
963
970
|
return isCellEditable ? editableCellStyle.ClassName : null;
|
|
964
971
|
}
|
|
@@ -968,12 +975,12 @@ class Adaptable {
|
|
|
968
975
|
return null;
|
|
969
976
|
}
|
|
970
977
|
const isCellReadonly = !this.api.gridApi.areCellsEditable([
|
|
971
|
-
this.getGridCellFromRowNode(params.node, abColumn.
|
|
978
|
+
this.getGridCellFromRowNode(params.node, abColumn.columnId),
|
|
972
979
|
]);
|
|
973
980
|
return isCellReadonly ? readonlyCellStyle.ClassName : null;
|
|
974
981
|
}
|
|
975
982
|
isQuickSearchActive(abColumn, params) {
|
|
976
|
-
if (abColumn.
|
|
983
|
+
if (abColumn.isExcludedFromQuickSearch) {
|
|
977
984
|
return false;
|
|
978
985
|
}
|
|
979
986
|
if (!params.node || params.node.group) {
|
|
@@ -983,7 +990,7 @@ class Adaptable {
|
|
|
983
990
|
if (StringExtensions_1.StringExtensions.IsNullOrEmpty(quickSearchValue)) {
|
|
984
991
|
return false;
|
|
985
992
|
}
|
|
986
|
-
const columnFilter = ObjectFactory_1.default.CreateColumnFilter(abColumn.
|
|
993
|
+
const columnFilter = ObjectFactory_1.default.CreateColumnFilter(abColumn.columnId, 'Contains', [quickSearchValue]);
|
|
987
994
|
return this.api.filterApi.evaluateColumnFilter(columnFilter, params.node);
|
|
988
995
|
}
|
|
989
996
|
getPrimaryKeyValueFromRowNode(rowNode) {
|
|
@@ -1347,7 +1354,7 @@ class Adaptable {
|
|
|
1347
1354
|
const colId = column.getColId();
|
|
1348
1355
|
const selectedColumn = this.api.columnApi.getColumnFromId(colId);
|
|
1349
1356
|
if (selectedColumn &&
|
|
1350
|
-
columns.find((c) => c.
|
|
1357
|
+
columns.find((c) => c.columnId == selectedColumn.columnId) == null) {
|
|
1351
1358
|
columns.push(selectedColumn);
|
|
1352
1359
|
}
|
|
1353
1360
|
for (let rowIndex = y1; rowIndex <= y2; rowIndex++) {
|
|
@@ -1408,20 +1415,20 @@ class Adaptable {
|
|
|
1408
1415
|
setValue(dataChangedInfo) {
|
|
1409
1416
|
// note: because we use rownode set data value this will cause Validation to fire
|
|
1410
1417
|
let newValue;
|
|
1411
|
-
let dataType =
|
|
1418
|
+
let dataType = dataChangedInfo.column.dataType;
|
|
1412
1419
|
newValue =
|
|
1413
1420
|
dataType == Enums_1.DataType.Number ? Number(dataChangedInfo.newValue) : dataChangedInfo.newValue;
|
|
1414
1421
|
if (dataType == undefined) {
|
|
1415
1422
|
return; // no point continuing as probably a wrong column
|
|
1416
1423
|
}
|
|
1417
1424
|
if (dataChangedInfo.rowNode) {
|
|
1418
|
-
dataChangedInfo.rowNode.setDataValue(dataChangedInfo.columnId, newValue);
|
|
1425
|
+
dataChangedInfo.rowNode.setDataValue(dataChangedInfo.column.columnId, newValue);
|
|
1419
1426
|
}
|
|
1420
1427
|
else {
|
|
1421
1428
|
if (this.useRowNodeLookUp) {
|
|
1422
1429
|
const rowNode = this.gridOptions.api.getRowNode(dataChangedInfo.primaryKeyValue);
|
|
1423
1430
|
if (rowNode != null) {
|
|
1424
|
-
rowNode.setDataValue(dataChangedInfo.columnId, newValue);
|
|
1431
|
+
rowNode.setDataValue(dataChangedInfo.column.columnId, newValue);
|
|
1425
1432
|
dataChangedInfo.rowNode = rowNode;
|
|
1426
1433
|
}
|
|
1427
1434
|
}
|
|
@@ -1431,7 +1438,7 @@ class Adaptable {
|
|
|
1431
1438
|
this.gridOptions.api.getModel().forEachNode((rowNode) => {
|
|
1432
1439
|
if (!isUpdated) {
|
|
1433
1440
|
if (dataChangedInfo.primaryKeyValue == this.getPrimaryKeyValueFromRowNode(rowNode)) {
|
|
1434
|
-
rowNode.setDataValue(dataChangedInfo.columnId, newValue);
|
|
1441
|
+
rowNode.setDataValue(dataChangedInfo.column.columnId, newValue);
|
|
1435
1442
|
dataChangedInfo.rowNode = rowNode;
|
|
1436
1443
|
isUpdated = true;
|
|
1437
1444
|
}
|
|
@@ -1454,7 +1461,8 @@ class Adaptable {
|
|
|
1454
1461
|
rawValue: pv,
|
|
1455
1462
|
displayValue: pv,
|
|
1456
1463
|
normalisedValue: pv,
|
|
1457
|
-
columnId: column.
|
|
1464
|
+
columnId: column.columnId,
|
|
1465
|
+
column: column,
|
|
1458
1466
|
rowNode: undefined,
|
|
1459
1467
|
};
|
|
1460
1468
|
});
|
|
@@ -1462,7 +1470,7 @@ class Adaptable {
|
|
|
1462
1470
|
else {
|
|
1463
1471
|
if (visibleRowsOnly) {
|
|
1464
1472
|
this.gridOptions.api.forEachNodeAfterFilter((rowNode) => {
|
|
1465
|
-
const gridCell = this.addDistinctColumnValue(rowNode, column.
|
|
1473
|
+
const gridCell = this.addDistinctColumnValue(rowNode, column.columnId);
|
|
1466
1474
|
if (gridCell && gridCell.rawValue != undefined && gridCell.rowNode !== skipRowNode) {
|
|
1467
1475
|
returnValues.push(gridCell);
|
|
1468
1476
|
}
|
|
@@ -1470,7 +1478,7 @@ class Adaptable {
|
|
|
1470
1478
|
}
|
|
1471
1479
|
else {
|
|
1472
1480
|
this.gridOptions.api.forEachNode((rowNode) => {
|
|
1473
|
-
const gridCell = this.addDistinctColumnValue(rowNode, column.
|
|
1481
|
+
const gridCell = this.addDistinctColumnValue(rowNode, column.columnId);
|
|
1474
1482
|
if (gridCell && gridCell.rawValue != undefined && gridCell.rowNode !== skipRowNode) {
|
|
1475
1483
|
returnValues.push(gridCell);
|
|
1476
1484
|
}
|
|
@@ -1483,18 +1491,23 @@ class Adaptable {
|
|
|
1483
1491
|
async getDistinctFilterValuesForColumn(column, visibleRowsOnly, filter, skipRowNode) {
|
|
1484
1492
|
var _a;
|
|
1485
1493
|
const permittedValues = (_a = this.api.userInterfaceApi.getFilterPermittedValuesForColumn(column)) !== null && _a !== void 0 ? _a : {
|
|
1486
|
-
|
|
1494
|
+
suppressFilterSearchBar: false,
|
|
1487
1495
|
values: () => undefined,
|
|
1488
1496
|
};
|
|
1489
1497
|
let preparedPermittedValues = undefined;
|
|
1490
1498
|
try {
|
|
1491
|
-
|
|
1499
|
+
const filterPermittedValuesParams = {
|
|
1500
|
+
adaptableApi: this.api,
|
|
1501
|
+
column: column,
|
|
1502
|
+
filter: filter,
|
|
1503
|
+
};
|
|
1504
|
+
preparedPermittedValues = await (permittedValues === null || permittedValues === void 0 ? void 0 : permittedValues.values(filterPermittedValuesParams));
|
|
1492
1505
|
}
|
|
1493
1506
|
catch (error) {
|
|
1494
1507
|
LoggingHelper_1.ConsoleLogError(`Failed to load filter permitted values`, column, filter, error);
|
|
1495
1508
|
}
|
|
1496
1509
|
return {
|
|
1497
|
-
suppressClientSideFilter: permittedValues.
|
|
1510
|
+
suppressClientSideFilter: permittedValues.suppressFilterSearchBar,
|
|
1498
1511
|
gridCells: this.getDistinctValuesForColumn(column, visibleRowsOnly, skipRowNode, preparedPermittedValues),
|
|
1499
1512
|
};
|
|
1500
1513
|
}
|
|
@@ -1502,7 +1515,11 @@ class Adaptable {
|
|
|
1502
1515
|
const permittedValues = await this.api.userInterfaceApi.getCustomSortPermittedValuesForColumn(column);
|
|
1503
1516
|
let preparedPermittedValues = undefined;
|
|
1504
1517
|
try {
|
|
1505
|
-
|
|
1518
|
+
const permittedValuesParams = {
|
|
1519
|
+
adaptableApi: this.api,
|
|
1520
|
+
column: column,
|
|
1521
|
+
};
|
|
1522
|
+
preparedPermittedValues = await (permittedValues === null || permittedValues === void 0 ? void 0 : permittedValues.values(permittedValuesParams));
|
|
1506
1523
|
}
|
|
1507
1524
|
catch (error) {
|
|
1508
1525
|
LoggingHelper_1.ConsoleLogError(`Failed to load custom sort permitted values`, column, error);
|
|
@@ -1513,7 +1530,12 @@ class Adaptable {
|
|
|
1513
1530
|
const permittedValues = await this.api.userInterfaceApi.getBulkUpdatePermittedValuesForColumn(column);
|
|
1514
1531
|
let preparedPermittedValues = undefined;
|
|
1515
1532
|
try {
|
|
1516
|
-
|
|
1533
|
+
const bulkUpdatePermittedValuesParams = {
|
|
1534
|
+
adaptableApi: this.api,
|
|
1535
|
+
column: column,
|
|
1536
|
+
gridCells: selectedGridCells,
|
|
1537
|
+
};
|
|
1538
|
+
preparedPermittedValues = await (permittedValues === null || permittedValues === void 0 ? void 0 : permittedValues.values(bulkUpdatePermittedValuesParams));
|
|
1517
1539
|
}
|
|
1518
1540
|
catch (error) {
|
|
1519
1541
|
LoggingHelper_1.ConsoleLogError(`Failed to load bulk permitted values`, error, column, selectedGridCells);
|
|
@@ -1533,7 +1555,7 @@ class Adaptable {
|
|
|
1533
1555
|
rawValue: pv,
|
|
1534
1556
|
displayValue: pv,
|
|
1535
1557
|
normalisedValue: pv,
|
|
1536
|
-
|
|
1558
|
+
column: abColumn,
|
|
1537
1559
|
rowNode: undefined,
|
|
1538
1560
|
});
|
|
1539
1561
|
});
|
|
@@ -1582,7 +1604,7 @@ class Adaptable {
|
|
|
1582
1604
|
}
|
|
1583
1605
|
shouldUseRawValueForColumn(column) {
|
|
1584
1606
|
// we need to return false if the column has a cell rendeerer i think...
|
|
1585
|
-
const colDef = this.gridOptions.api.getColumnDef(column.
|
|
1607
|
+
const colDef = this.gridOptions.api.getColumnDef(column.columnId);
|
|
1586
1608
|
if (colDef && colDef.cellRenderer != null) {
|
|
1587
1609
|
return true;
|
|
1588
1610
|
}
|
|
@@ -1627,7 +1649,7 @@ class Adaptable {
|
|
|
1627
1649
|
rawValue: rawValue,
|
|
1628
1650
|
displayValue: displayValue,
|
|
1629
1651
|
normalisedValue: normalisedvalue,
|
|
1630
|
-
|
|
1652
|
+
column: abColumn,
|
|
1631
1653
|
primaryKeyValue: pkValue,
|
|
1632
1654
|
rowNode: rowNode,
|
|
1633
1655
|
};
|
|
@@ -1858,10 +1880,8 @@ class Adaptable {
|
|
|
1858
1880
|
];
|
|
1859
1881
|
}
|
|
1860
1882
|
getColDefsForFreeTextColumns() {
|
|
1861
|
-
const specialColumnsAreFilterable = this.api.internalApi.getAdaptableOptions().filterOptions
|
|
1862
|
-
|
|
1863
|
-
const defaultFreeTextColumnSettings = ObjectFactory_1.CreateEmptyFreeTextColumn(specialColumnsAreFilterable)
|
|
1864
|
-
.FreeTextColumnSettings;
|
|
1883
|
+
const specialColumnsAreFilterable = this.api.internalApi.getAdaptableOptions().filterOptions.enableFilterOnSpecialColumns;
|
|
1884
|
+
const defaultFreeTextColumnSettings = ObjectFactory_1.CreateEmptyFreeTextColumn(specialColumnsAreFilterable).FreeTextColumnSettings;
|
|
1865
1885
|
return this.api.freeTextColumnApi.getAllFreeTextColumn().map((freeTextColumn) => {
|
|
1866
1886
|
const freeTextColumnSettings = Object.assign(Object.assign({}, defaultFreeTextColumnSettings), freeTextColumn.FreeTextColumnSettings);
|
|
1867
1887
|
const dataTypeEditor = freeTextColumn.DataType === 'Number'
|
|
@@ -1967,13 +1987,13 @@ class Adaptable {
|
|
|
1967
1987
|
.enableFilterOnSpecialColumns
|
|
1968
1988
|
? this.adaptableOptions.filterOptions.enableFilterOnSpecialColumns
|
|
1969
1989
|
: true;
|
|
1970
|
-
const defaultCalculatedColumnSettings = ObjectFactory_1.CreateEmptyCalculatedColumn(specialColumnsAreFilterable)
|
|
1971
|
-
.CalculatedColumnSettings;
|
|
1990
|
+
const defaultCalculatedColumnSettings = ObjectFactory_1.CreateEmptyCalculatedColumn(specialColumnsAreFilterable).CalculatedColumnSettings;
|
|
1972
1991
|
return this.api.calculatedColumnApi.getAllCalculatedColumn().map((calculatedColumn) => {
|
|
1973
1992
|
var _a;
|
|
1974
1993
|
const calculatedColumnSettings = Object.assign(Object.assign({}, defaultCalculatedColumnSettings), calculatedColumn.CalculatedColumnSettings);
|
|
1975
1994
|
if (!calculatedColumnSettings.DataType) {
|
|
1976
|
-
calculatedColumnSettings.DataType =
|
|
1995
|
+
calculatedColumnSettings.DataType =
|
|
1996
|
+
this.CalculatedColumnExpressionService.GetCalculatedColumnDataType((_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression);
|
|
1977
1997
|
}
|
|
1978
1998
|
const newColDef = {
|
|
1979
1999
|
headerName: calculatedColumn.FriendlyName
|
|
@@ -2089,6 +2109,7 @@ class Adaptable {
|
|
|
2089
2109
|
(_j = this.TeamSharingService) === null || _j === void 0 ? void 0 : _j.destroy();
|
|
2090
2110
|
(_k = this.MetamodelService) === null || _k === void 0 ? void 0 : _k.destroy();
|
|
2091
2111
|
(_l = this.LicenseService) === null || _l === void 0 ? void 0 : _l.destroy();
|
|
2112
|
+
this.isDestroyed = true;
|
|
2092
2113
|
}
|
|
2093
2114
|
// really really need to do this properly but as a temp fix lets create a default style for when no data
|
|
2094
2115
|
getDefaultIPPStyle() {
|
|
@@ -2103,7 +2124,7 @@ class Adaptable {
|
|
|
2103
2124
|
height: 65,
|
|
2104
2125
|
Columns: this.api.columnApi.getColumns().map((col) => {
|
|
2105
2126
|
return {
|
|
2106
|
-
columnFriendlyName: col.
|
|
2127
|
+
columnFriendlyName: col.friendlyName,
|
|
2107
2128
|
width: 200,
|
|
2108
2129
|
textAlign: 'start',
|
|
2109
2130
|
};
|
|
@@ -2120,7 +2141,7 @@ class Adaptable {
|
|
|
2120
2141
|
height: 30,
|
|
2121
2142
|
Columns: this.api.columnApi.getColumns().map((col) => {
|
|
2122
2143
|
return {
|
|
2123
|
-
columnFriendlyName: col.
|
|
2144
|
+
columnFriendlyName: col.friendlyName,
|
|
2124
2145
|
width: 200,
|
|
2125
2146
|
textAlign: 'start',
|
|
2126
2147
|
};
|
|
@@ -2157,12 +2178,12 @@ class Adaptable {
|
|
|
2157
2178
|
}
|
|
2158
2179
|
return this.abContainerElement;
|
|
2159
2180
|
}
|
|
2160
|
-
|
|
2181
|
+
getAgGridContainerElement() {
|
|
2161
2182
|
if (!this.gridContainerElement) {
|
|
2162
2183
|
this.gridContainerElement =
|
|
2163
|
-
typeof this.adaptableOptions.containerOptions.
|
|
2164
|
-
? document.getElementById(this.adaptableOptions.containerOptions.
|
|
2165
|
-
: this.adaptableOptions.containerOptions.
|
|
2184
|
+
typeof this.adaptableOptions.containerOptions.agGridContainer === 'string'
|
|
2185
|
+
? document.getElementById(this.adaptableOptions.containerOptions.agGridContainer)
|
|
2186
|
+
: this.adaptableOptions.containerOptions.agGridContainer;
|
|
2166
2187
|
}
|
|
2167
2188
|
return this.gridContainerElement;
|
|
2168
2189
|
}
|
|
@@ -2180,7 +2201,7 @@ class Adaptable {
|
|
|
2180
2201
|
}
|
|
2181
2202
|
return;
|
|
2182
2203
|
}
|
|
2183
|
-
const gridContainerElement = this.
|
|
2204
|
+
const gridContainerElement = this.getAgGridContainerElement();
|
|
2184
2205
|
if (gridContainerElement) {
|
|
2185
2206
|
gridContainerElement.addEventListener('keydown', (event) => this._emit('KeyDown', event));
|
|
2186
2207
|
}
|
|
@@ -2230,7 +2251,7 @@ class Adaptable {
|
|
|
2230
2251
|
const cellEditableFn = this.adaptableOptions.editOptions.isCellEditable;
|
|
2231
2252
|
if (cellEditableFn) {
|
|
2232
2253
|
let gridCell = this.getGridCellFromRowNode(params.node, params.column.getColId());
|
|
2233
|
-
let isEditable = cellEditableFn(gridCell
|
|
2254
|
+
let isEditable = cellEditableFn(gridCell);
|
|
2234
2255
|
if (!isEditable) {
|
|
2235
2256
|
this.gridOptions.api.stopEditing();
|
|
2236
2257
|
}
|
|
@@ -2348,8 +2369,7 @@ class Adaptable {
|
|
|
2348
2369
|
this.onSortChanged();
|
|
2349
2370
|
this.debouncedSetSelectedCells();
|
|
2350
2371
|
});
|
|
2351
|
-
const showGroupingTotalsAsHeader = this.adaptableOptions.generalOptions
|
|
2352
|
-
.showGroupingTotalsAsHeader;
|
|
2372
|
+
const showGroupingTotalsAsHeader = this.adaptableOptions.generalOptions.showGroupingTotalsAsHeader;
|
|
2353
2373
|
/**
|
|
2354
2374
|
* Use Case: Model has updated
|
|
2355
2375
|
* Action: If user has set to see grouping totals as header create a pinned row (bit of a hack)
|
|
@@ -2653,7 +2673,9 @@ class Adaptable {
|
|
|
2653
2673
|
const hasConditionalStylesWithClassNames = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(conditionalStyles);
|
|
2654
2674
|
const quickSearchStyleClassName = this.api.quickSearchApi.getQuickSearchStyle().ClassName;
|
|
2655
2675
|
const hasQuickSearchStyleClassName = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(quickSearchStyleClassName);
|
|
2676
|
+
const classNameMap = {};
|
|
2656
2677
|
const cellClass = (params) => {
|
|
2678
|
+
var _a;
|
|
2657
2679
|
const isQuickSearchActive = hasQuickSearchStyleClassName && this.isQuickSearchActive(abColumn, params);
|
|
2658
2680
|
const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(params.node);
|
|
2659
2681
|
const editableClassName = this.getEditableCellClass(abColumn, params);
|
|
@@ -2671,6 +2693,24 @@ class Adaptable {
|
|
|
2671
2693
|
]
|
|
2672
2694
|
.filter((x) => !!x)
|
|
2673
2695
|
.join(' ');
|
|
2696
|
+
const primaryKey = this.getPrimaryKeyValueFromRowNode(params.node);
|
|
2697
|
+
const key = `${primaryKey}:${params.colDef.colId}`;
|
|
2698
|
+
if (classNameMap[key] &&
|
|
2699
|
+
classNameMap[key] !== returnValue &&
|
|
2700
|
+
// only hard-reset when removing class-names
|
|
2701
|
+
// ag-grid does not remove class-names, it accumulates them
|
|
2702
|
+
// https://www.ag-grid.com/javascript-data-grid/cell-styles/#refresh-of-styles
|
|
2703
|
+
returnValue.length < ((_a = classNameMap[key]) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
2704
|
+
setTimeout(() => {
|
|
2705
|
+
/**
|
|
2706
|
+
* This is called inside a getter function, inside ag-grid.
|
|
2707
|
+
* To allow ag-grid run it's logic, the redraw is done inside an timeout
|
|
2708
|
+
* to make sure it is not done in an inappropriate time.
|
|
2709
|
+
*/
|
|
2710
|
+
params.api.redrawRows({ rowNodes: [params.node] });
|
|
2711
|
+
}, 0);
|
|
2712
|
+
}
|
|
2713
|
+
classNameMap[key] = returnValue;
|
|
2674
2714
|
return StringExtensions_1.StringExtensions.IsNotNullOrEmpty(returnValue) ? returnValue : undefined;
|
|
2675
2715
|
};
|
|
2676
2716
|
return cellClass;
|
|
@@ -2692,8 +2732,9 @@ class Adaptable {
|
|
|
2692
2732
|
this.setColDefProperty(col, 'cellEditorParams', (params) => {
|
|
2693
2733
|
if (editLookUpItem) {
|
|
2694
2734
|
return (params) => {
|
|
2735
|
+
const gridCell = this.getGridCellFromRowNode(params === null || params === void 0 ? void 0 : params.node, colId);
|
|
2695
2736
|
return {
|
|
2696
|
-
values: this.api.userInterfaceApi.getEditLookUpValuesForEditLookUpItem(editLookUpItem,
|
|
2737
|
+
values: this.api.userInterfaceApi.getEditLookUpValuesForEditLookUpItem(editLookUpItem, gridCell),
|
|
2697
2738
|
};
|
|
2698
2739
|
};
|
|
2699
2740
|
}
|
|
@@ -2707,7 +2748,7 @@ class Adaptable {
|
|
|
2707
2748
|
return this.agGridHelper.createNumericStyleRendererFunc(formatColumn);
|
|
2708
2749
|
}
|
|
2709
2750
|
if (formatColumn.ColumnStyle.CheckBoxStyle) {
|
|
2710
|
-
return this.agGridHelper.createCheckboxRendererComp(abColumn.
|
|
2751
|
+
return this.agGridHelper.createCheckboxRendererComp(abColumn.columnId, abColumn.readOnly);
|
|
2711
2752
|
}
|
|
2712
2753
|
}
|
|
2713
2754
|
const sparkline = this.api.sparklineColumnApi.getSparklineByColumn(colId);
|
|
@@ -2770,19 +2811,18 @@ class Adaptable {
|
|
|
2770
2811
|
// set the default to the AG Grid provided values
|
|
2771
2812
|
// from https://github.com/ag-grid/ag-grid/blob/v26.1.0/community-modules/core/src/ts/columns/columnModel.ts#L2515
|
|
2772
2813
|
let resultHeaderName = userHeaderName !== null && userHeaderName !== void 0 ? userHeaderName : StringExtensions_1.StringExtensions.CamelCaseToHumanText(col.getColDef().field);
|
|
2773
|
-
const layoutCustomHeader = (_a = this.api.layoutApi.getCurrentLayout()
|
|
2774
|
-
.ColumnHeadersMap) === null || _a === void 0 ? void 0 : _a[col.getColId()];
|
|
2814
|
+
const layoutCustomHeader = (_a = this.api.layoutApi.getCurrentLayout().ColumnHeadersMap) === null || _a === void 0 ? void 0 : _a[col.getColId()];
|
|
2775
2815
|
if (layoutCustomHeader) {
|
|
2776
2816
|
resultHeaderName = layoutCustomHeader;
|
|
2777
2817
|
}
|
|
2778
2818
|
// check if the deprecated formatColumn header is used
|
|
2779
|
-
const formatColumn = this.api.formatColumnApi.getFormatColumnForColumnId(abColumn.
|
|
2819
|
+
const formatColumn = this.api.formatColumnApi.getFormatColumnForColumnId(abColumn.columnId);
|
|
2780
2820
|
if (!layoutCustomHeader && (formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.HeaderName) && !formatColumn.IsSuspended) {
|
|
2781
2821
|
// fallback to the formatColumn property if no Layout custom header is provided
|
|
2782
2822
|
resultHeaderName = formatColumn.HeaderName;
|
|
2783
2823
|
}
|
|
2784
2824
|
// required here for the initial layout rendering
|
|
2785
|
-
abColumn.
|
|
2825
|
+
abColumn.friendlyName = resultHeaderName;
|
|
2786
2826
|
return resultHeaderName;
|
|
2787
2827
|
});
|
|
2788
2828
|
const newColumnHeader = (_b = col === null || col === void 0 ? void 0 : col.getColDef()) === null || _b === void 0 ? void 0 : _b.headerName;
|
|
@@ -2878,7 +2918,7 @@ class Adaptable {
|
|
|
2878
2918
|
var _a;
|
|
2879
2919
|
if (cellEditableFn) {
|
|
2880
2920
|
let gridCell = this.getGridCellFromRowNode(params.node, params.column.getColId());
|
|
2881
|
-
let isEditable = cellEditableFn(gridCell
|
|
2921
|
+
let isEditable = cellEditableFn(gridCell);
|
|
2882
2922
|
if (!isEditable) {
|
|
2883
2923
|
return false;
|
|
2884
2924
|
}
|
|
@@ -2901,7 +2941,7 @@ class Adaptable {
|
|
|
2901
2941
|
const dataChangedInfo = this.api.internalApi.buildDataChangedInfo({
|
|
2902
2942
|
oldValue: params.oldValue,
|
|
2903
2943
|
newValue: params.newValue,
|
|
2904
|
-
|
|
2944
|
+
column: this.api.columnApi.getColumnFromId(params.column.getColId()),
|
|
2905
2945
|
primaryKeyValue: this.getPrimaryKeyValueFromRowNode(params.node),
|
|
2906
2946
|
rowNode: params.node,
|
|
2907
2947
|
trigger: 'edit',
|
|
@@ -2996,7 +3036,7 @@ class Adaptable {
|
|
|
2996
3036
|
const dataChangedInfo = this.api.internalApi.buildDataChangedInfo({
|
|
2997
3037
|
oldValue: oldValue,
|
|
2998
3038
|
newValue: newValue,
|
|
2999
|
-
|
|
3039
|
+
column: this.api.columnApi.getColumnFromId(key),
|
|
3000
3040
|
primaryKeyValue: primaryKeyValue,
|
|
3001
3041
|
rowNode: rowNode,
|
|
3002
3042
|
trigger: 'tick',
|
|
@@ -3018,13 +3058,14 @@ class Adaptable {
|
|
|
3018
3058
|
if (!primaryKeyValue) {
|
|
3019
3059
|
return;
|
|
3020
3060
|
}
|
|
3021
|
-
|
|
3061
|
+
const abColumn = this.api.columnApi.getColumnFromId(colId);
|
|
3062
|
+
if (!abColumn) {
|
|
3022
3063
|
return;
|
|
3023
3064
|
}
|
|
3024
3065
|
const dataChangedInfo = this.api.internalApi.buildDataChangedInfo({
|
|
3025
3066
|
oldValue: oldValue,
|
|
3026
3067
|
newValue: newValue,
|
|
3027
|
-
|
|
3068
|
+
column: abColumn,
|
|
3028
3069
|
primaryKeyValue: primaryKeyValue,
|
|
3029
3070
|
rowNode: rowNode,
|
|
3030
3071
|
trigger: 'edit',
|
|
@@ -3049,7 +3090,7 @@ class Adaptable {
|
|
|
3049
3090
|
}
|
|
3050
3091
|
dataChangedInfos.forEach((dataChangedInfo) => {
|
|
3051
3092
|
if (dataChangedInfo.trigger === 'undo') {
|
|
3052
|
-
LoggingHelper_1.LogAdaptableInfo(`Undo data change: PK(${dataChangedInfo.primaryKeyValue}) Col(${dataChangedInfo.
|
|
3093
|
+
LoggingHelper_1.LogAdaptableInfo(`Undo data change: PK(${dataChangedInfo.primaryKeyValue}) Col(${dataChangedInfo.column}) RevertedValue(${dataChangedInfo.oldValue}) OriginalValue(${dataChangedInfo.newValue})`);
|
|
3053
3094
|
}
|
|
3054
3095
|
if (dataChangedInfo.trigger === 'edit' || dataChangedInfo.trigger === 'undo') {
|
|
3055
3096
|
this.checkChangedCellCurrentlySelected(dataChangedInfo);
|
|
@@ -3088,7 +3129,7 @@ class Adaptable {
|
|
|
3088
3129
|
stylesWithExpression.forEach((conditionalStyle) => {
|
|
3089
3130
|
if (!dataChangedScope.wholeRow) {
|
|
3090
3131
|
const columnIds = this.api.queryLanguageApi.getColumnsFromExpression(conditionalStyle.Rule.BooleanExpression);
|
|
3091
|
-
if (columnIds.includes(dataChangedInfo.columnId)) {
|
|
3132
|
+
if (columnIds.includes(dataChangedInfo.column.columnId)) {
|
|
3092
3133
|
if (this.api.scopeApi.scopeIsAll(conditionalStyle.Scope)) {
|
|
3093
3134
|
dataChangedScope.wholeRow = true;
|
|
3094
3135
|
return;
|
|
@@ -3096,7 +3137,7 @@ class Adaptable {
|
|
|
3096
3137
|
else {
|
|
3097
3138
|
this.api.scopeApi
|
|
3098
3139
|
.getColumnsForScope(conditionalStyle.Scope)
|
|
3099
|
-
.map((c) => c.
|
|
3140
|
+
.map((c) => c.columnId)
|
|
3100
3141
|
.forEach((colId) => {
|
|
3101
3142
|
dataChangedScope.columnIds.add(colId);
|
|
3102
3143
|
});
|
|
@@ -3114,10 +3155,10 @@ class Adaptable {
|
|
|
3114
3155
|
let affectedColumnIds = this.api.formatColumnApi.getColumnIdsFromColumnComparison(columnComparision);
|
|
3115
3156
|
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(affectedColumnIds)) {
|
|
3116
3157
|
dataChangedInfos.forEach((dataChangedInfo) => {
|
|
3117
|
-
if (affectedColumnIds.includes(dataChangedInfo.columnId)) {
|
|
3158
|
+
if (affectedColumnIds.includes(dataChangedInfo.column.columnId)) {
|
|
3118
3159
|
this.api.scopeApi
|
|
3119
3160
|
.getColumnsForScope(fc.Scope)
|
|
3120
|
-
.map((c) => c.
|
|
3161
|
+
.map((c) => c.columnId)
|
|
3121
3162
|
.forEach((colId) => {
|
|
3122
3163
|
dataChangedScope.columnIds.add(colId);
|
|
3123
3164
|
});
|
|
@@ -3131,7 +3172,7 @@ class Adaptable {
|
|
|
3131
3172
|
let selectedCellInfo = this.api.gridApi.getSelectedCellInfo();
|
|
3132
3173
|
if (selectedCellInfo && ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(selectedCellInfo.gridCells)) {
|
|
3133
3174
|
let matchingCell = selectedCellInfo.gridCells.find((gc) => gc.primaryKeyValue == dataChangedInfo.primaryKeyValue &&
|
|
3134
|
-
gc.
|
|
3175
|
+
gc.column == dataChangedInfo.column);
|
|
3135
3176
|
if (matchingCell) {
|
|
3136
3177
|
this.setSelectedCells();
|
|
3137
3178
|
}
|
|
@@ -3212,11 +3253,10 @@ class Adaptable {
|
|
|
3212
3253
|
this.gridOptions.api.onGroupExpandedOrCollapsed();
|
|
3213
3254
|
}
|
|
3214
3255
|
}
|
|
3215
|
-
|
|
3216
|
-
|
|
3256
|
+
getAgGridColumnForAdaptableColumn(abColumn) {
|
|
3257
|
+
return this.gridOptions.columnApi
|
|
3217
3258
|
.getAllColumns()
|
|
3218
|
-
.find((c) => c.getColId() === abColumn.
|
|
3219
|
-
return agGridColumn.getColDef().field || '';
|
|
3259
|
+
.find((c) => c.getColId() === abColumn.columnId);
|
|
3220
3260
|
}
|
|
3221
3261
|
setRowGroupColumns(columnIds) {
|
|
3222
3262
|
this.gridOptions.columnApi.setRowGroupColumns(columnIds);
|
|
@@ -3280,15 +3320,15 @@ class Adaptable {
|
|
|
3280
3320
|
this.gridOptions.api.clearRangeSelection();
|
|
3281
3321
|
}
|
|
3282
3322
|
hideColumn(columnId) {
|
|
3283
|
-
let
|
|
3284
|
-
if (
|
|
3323
|
+
let agGridColumn = this.gridOptions.columnApi.getColumn(columnId);
|
|
3324
|
+
if (agGridColumn) {
|
|
3285
3325
|
this.gridOptions.columnApi.setColumnVisible(columnId, false);
|
|
3286
3326
|
this.updateColumnsIntoStore();
|
|
3287
3327
|
}
|
|
3288
3328
|
}
|
|
3289
3329
|
showColumn(columnId) {
|
|
3290
|
-
let
|
|
3291
|
-
if (
|
|
3330
|
+
let agGridColumn = this.gridOptions.columnApi.getColumn(columnId);
|
|
3331
|
+
if (agGridColumn) {
|
|
3292
3332
|
this.gridOptions.columnApi.setColumnVisible(columnId, true);
|
|
3293
3333
|
this.updateColumnsIntoStore();
|
|
3294
3334
|
}
|
|
@@ -3415,7 +3455,7 @@ class Adaptable {
|
|
|
3415
3455
|
checkColumnsDataTypeSet() {
|
|
3416
3456
|
// check that we have no unknown columns - if we do then ok
|
|
3417
3457
|
const firstCol = this.api.columnApi.getColumns()[0];
|
|
3418
|
-
if (firstCol && firstCol.
|
|
3458
|
+
if (firstCol && firstCol.dataType == Enums_1.DataType.Unknown) {
|
|
3419
3459
|
this.updateColumnsIntoStore();
|
|
3420
3460
|
}
|
|
3421
3461
|
}
|
|
@@ -3503,7 +3543,7 @@ class Adaptable {
|
|
|
3503
3543
|
hideQuickFilter() {
|
|
3504
3544
|
this.gridOptions.api.setFloatingFiltersHeight(0);
|
|
3505
3545
|
}
|
|
3506
|
-
|
|
3546
|
+
getAgGridColumnType(columnId) {
|
|
3507
3547
|
var _a;
|
|
3508
3548
|
const { type } = (_a = this.gridOptions.api.getColumnDef(columnId)) !== null && _a !== void 0 ? _a : {};
|
|
3509
3549
|
return type || '';
|
|
@@ -3520,8 +3560,8 @@ class Adaptable {
|
|
|
3520
3560
|
: this.runAdaptableComparerFunction(customSort.ColumnId, customSort.SortedValues);
|
|
3521
3561
|
return comparerFunction;
|
|
3522
3562
|
}
|
|
3523
|
-
|
|
3524
|
-
const container = this.
|
|
3563
|
+
getAgGridLightThemeName() {
|
|
3564
|
+
const container = this.getAgGridContainerElement();
|
|
3525
3565
|
if (container && container.classList) {
|
|
3526
3566
|
// we detect the ag theme class
|
|
3527
3567
|
const classList = container.classList;
|
|
@@ -3533,10 +3573,10 @@ class Adaptable {
|
|
|
3533
3573
|
}
|
|
3534
3574
|
}
|
|
3535
3575
|
}
|
|
3536
|
-
return this.agGridHelper.
|
|
3576
|
+
return this.agGridHelper.getAgGridLightThemeName();
|
|
3537
3577
|
}
|
|
3538
|
-
|
|
3539
|
-
const container = this.
|
|
3578
|
+
getAgGridCurrentThemeName() {
|
|
3579
|
+
const container = this.getAgGridContainerElement();
|
|
3540
3580
|
if (container && container.classList) {
|
|
3541
3581
|
// we detect the ag theme class
|
|
3542
3582
|
const classList = container.classList;
|
|
@@ -3547,7 +3587,7 @@ class Adaptable {
|
|
|
3547
3587
|
}
|
|
3548
3588
|
}
|
|
3549
3589
|
}
|
|
3550
|
-
return this.
|
|
3590
|
+
return this.getAgGridLightThemeName();
|
|
3551
3591
|
}
|
|
3552
3592
|
applyAdaptableTheme(theme) {
|
|
3553
3593
|
const themeName = typeof theme === 'string' ? theme : theme.Name;
|
|
@@ -3603,39 +3643,39 @@ class Adaptable {
|
|
|
3603
3643
|
});
|
|
3604
3644
|
const systemThemes = this.api.themeApi.getAllSystemTheme();
|
|
3605
3645
|
const isSystemTheme = !!systemThemes.filter((t) => t.Name === themeName)[0];
|
|
3606
|
-
const container = this.
|
|
3607
|
-
const
|
|
3608
|
-
const
|
|
3646
|
+
const container = this.getAgGridContainerElement();
|
|
3647
|
+
const getAgGridLightThemeName = () => this.getAgGridLightThemeName();
|
|
3648
|
+
const getAgGridDarkThemeName = () => getAgGridLightThemeName() + '-dark';
|
|
3609
3649
|
if (newTheme && isSystemTheme) {
|
|
3610
3650
|
if (themeName === GeneralConstants_1.LIGHT_THEME) {
|
|
3611
|
-
newTheme.
|
|
3651
|
+
newTheme.AgGridClassName = newTheme.AgGridClassName || getAgGridLightThemeName();
|
|
3612
3652
|
}
|
|
3613
3653
|
if (themeName === GeneralConstants_1.DARK_THEME) {
|
|
3614
|
-
newTheme.
|
|
3654
|
+
newTheme.AgGridClassName = newTheme.AgGridClassName || getAgGridDarkThemeName();
|
|
3615
3655
|
}
|
|
3616
3656
|
}
|
|
3617
|
-
if (!newTheme.
|
|
3618
|
-
// default
|
|
3619
|
-
newTheme.
|
|
3657
|
+
if (!newTheme.AgGridClassName) {
|
|
3658
|
+
// default AG Grid to its light theme
|
|
3659
|
+
newTheme.AgGridClassName = getAgGridLightThemeName();
|
|
3620
3660
|
}
|
|
3621
3661
|
if (container != null) {
|
|
3622
3662
|
if (themesToRemove.length) {
|
|
3623
3663
|
themesToRemove.forEach((theme) => {
|
|
3624
|
-
if (theme.
|
|
3625
|
-
container.classList.remove(theme.
|
|
3664
|
+
if (theme.AgGridClassName) {
|
|
3665
|
+
container.classList.remove(theme.AgGridClassName);
|
|
3626
3666
|
}
|
|
3627
3667
|
});
|
|
3628
3668
|
}
|
|
3629
|
-
// also remove all
|
|
3630
|
-
const
|
|
3669
|
+
// also remove all AG Grid theme class names
|
|
3670
|
+
const agGridClassNamesToRemove = [];
|
|
3631
3671
|
container.classList.forEach((x) => {
|
|
3632
3672
|
if (x && x.indexOf('ag-theme-') === 0) {
|
|
3633
|
-
|
|
3673
|
+
agGridClassNamesToRemove.push(x);
|
|
3634
3674
|
}
|
|
3635
3675
|
});
|
|
3636
|
-
|
|
3637
|
-
if (newTheme && newTheme.
|
|
3638
|
-
container.classList.add(newTheme.
|
|
3676
|
+
agGridClassNamesToRemove.forEach((x) => container.classList.remove(x));
|
|
3677
|
+
if (newTheme && newTheme.AgGridClassName) {
|
|
3678
|
+
container.classList.add(newTheme.AgGridClassName);
|
|
3639
3679
|
}
|
|
3640
3680
|
container.classList.add('ab-Grid');
|
|
3641
3681
|
if (this.adaptableOptions.filterOptions.indicateFilteredColumns) {
|
|
@@ -3723,21 +3763,23 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
3723
3763
|
}
|
|
3724
3764
|
exportToExcel(reportData, fileName) {
|
|
3725
3765
|
const columnDefs = reportData.columns.map((column) => ({
|
|
3726
|
-
field: column.
|
|
3727
|
-
headerName: column.
|
|
3766
|
+
field: column.columnId,
|
|
3767
|
+
headerName: column.friendlyName,
|
|
3728
3768
|
}));
|
|
3729
3769
|
const NESTED_COL_SEPARATOR = '.';
|
|
3730
|
-
const nestedColumns = reportData.columns.filter((column) => column.
|
|
3770
|
+
const nestedColumns = reportData.columns.filter((column) => column.columnId.includes(NESTED_COL_SEPARATOR));
|
|
3731
3771
|
if (nestedColumns.length) {
|
|
3732
3772
|
// the rowData of nested fields (containing dots) was flattened during the report data extraction and we need to un-flatten it back
|
|
3733
3773
|
// ex.
|
|
3734
3774
|
// current state: { field: 'outerKey.innerKey', value: 2}
|
|
3735
3775
|
// original (desired) state: { field: 'outerKey.innerKey', value: {outerKey: {innerKey: 2}}}
|
|
3736
3776
|
reportData.rows.forEach((rowDataEntry) => nestedColumns.forEach((nestedColumn) => {
|
|
3737
|
-
const cellExportValue = rowDataEntry[nestedColumn.
|
|
3777
|
+
const cellExportValue = rowDataEntry[nestedColumn.columnId];
|
|
3738
3778
|
let intermediaryValue = rowDataEntry;
|
|
3739
3779
|
// augment the rowDataEntry with the new object
|
|
3740
|
-
nestedColumn.
|
|
3780
|
+
nestedColumn.columnId
|
|
3781
|
+
.split(NESTED_COL_SEPARATOR)
|
|
3782
|
+
.forEach((nestedKey, index, nestedCols) => {
|
|
3741
3783
|
// we reached the leaf node, so we set the cell value and break
|
|
3742
3784
|
if (index === nestedCols.length - 1) {
|
|
3743
3785
|
intermediaryValue[nestedKey] = cellExportValue;
|
|
@@ -3749,7 +3791,7 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
3749
3791
|
intermediaryValue = intermediaryValue[nestedKey];
|
|
3750
3792
|
});
|
|
3751
3793
|
// delete the obsolete flattened property
|
|
3752
|
-
delete rowDataEntry[nestedColumn.
|
|
3794
|
+
delete rowDataEntry[nestedColumn.columnId];
|
|
3753
3795
|
}));
|
|
3754
3796
|
}
|
|
3755
3797
|
const gridOptions = {
|