@adaptabletools/adaptable 10.0.4-canary.1 → 10.0.4-canary.2
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 +8 -0
- package/src/AdaptableOptions/ToolPanelOptions.d.ts +2 -2
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +3 -3
- package/src/Api/AdaptableApi.d.ts +12 -12
- package/src/Api/ColumnApi.d.ts +10 -5
- package/src/Api/EventApi.d.ts +1 -1
- package/src/Api/Events/AdaptableReady.d.ts +3 -2
- package/src/Api/GridApi.d.ts +10 -10
- package/src/Api/Implementation/ColumnApiImpl.d.ts +4 -3
- package/src/Api/Implementation/ColumnApiImpl.js +11 -9
- package/src/Api/Implementation/ConfigApiImpl.js +0 -24
- package/src/Api/Implementation/GridApiImpl.d.ts +2 -2
- package/src/Api/Implementation/GridApiImpl.js +3 -4
- package/src/Api/Implementation/InternalApiImpl.d.ts +1 -1
- package/src/Api/Implementation/InternalApiImpl.js +2 -2
- package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
- package/src/Api/Implementation/LayoutApiImpl.js +15 -0
- 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/ToolPanelApiImpl.js +1 -1
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +3 -3
- package/src/Api/Implementation/UserInterfaceApiImpl.js +4 -4
- package/src/Api/InternalApi.d.ts +1 -1
- 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 +3 -3
- package/src/PredefinedConfig/AdaptableState.d.ts +2 -10
- package/src/PredefinedConfig/AlertState.d.ts +1 -1
- package/src/PredefinedConfig/ApplicationState.d.ts +1 -1
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +3 -3
- package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +4 -4
- package/src/PredefinedConfig/Common/AdaptableStyle.d.ts +7 -7
- package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +1 -1
- 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/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/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 +18 -13
- package/src/Strategy/AdaptableModuleBase.d.ts +2 -2
- package/src/Strategy/AlertModule.d.ts +2 -2
- package/src/Strategy/AlertModule.js +1 -94
- package/src/Strategy/BulkUpdateModule.d.ts +2 -2
- package/src/Strategy/BulkUpdateModule.js +4 -4
- package/src/Strategy/CellSummaryModule.d.ts +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/FilterModule.d.ts +2 -2
- package/src/Strategy/FormatColumnModule.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 +21 -8
- package/src/Strategy/SmartEditModule.d.ts +2 -2
- package/src/Strategy/SmartEditModule.js +3 -4
- 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/Helpers/PreviewHelper.js +2 -2
- package/src/Utilities/Interface/Preview.d.ts +2 -1
- package/src/Utilities/Services/LicenseService.js +16 -2
- package/src/Utilities/Services/ValidationService.js +1 -1
- 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/CellSummary/CellSummaryViewPanel.js +2 -2
- package/src/View/Components/FilterForm/FilterForm.js +5 -7
- 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 +3 -5
- 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 +22 -9
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +3 -4
- package/src/View/Components/ToolPanel/ToolPanelPopup.js +2 -3
- package/src/View/CustomSort/CustomSortEntityRow.d.ts +3 -1
- package/src/View/CustomSort/CustomSortEntityRow.js +3 -3
- package/src/View/CustomSort/CustomSortPopup.js +1 -1
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +1 -1
- package/src/View/Dashboard/Dashboard.js +3 -3
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.d.ts +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +6 -5
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +6 -6
- package/src/View/Export/ExportViewPanel.js +6 -6
- package/src/View/GridInfo/GridOptionsComponent.js +1 -1
- package/src/View/Layout/LayoutViewPanel.js +2 -2
- package/src/View/Query/QueryViewPanel.js +1 -1
- 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/Adaptable.d.ts +9 -8
- package/src/agGrid/Adaptable.js +99 -78
- package/src/agGrid/agGridHelper.d.ts +4 -4
- package/src/agGrid/agGridHelper.js +15 -16
- package/src/agGrid/agGridMenuHelper.d.ts +15 -13
- package/src/agGrid/agGridMenuHelper.js +53 -45
- 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/Datepicker/DatepickerContext.d.ts +2 -2
- package/src/components/Datepicker/index.js +9 -5
- 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 +52 -37
- package/src/metamodel/adaptable.metamodel.js +261 -265
- package/src/types.d.ts +1 -1
- 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
|
@@ -35,7 +35,7 @@ class ThemeViewPanelComponent extends React.Component {
|
|
|
35
35
|
textOverflow: 'ellipsis',
|
|
36
36
|
fontSize: 'small',
|
|
37
37
|
}
|
|
38
|
-
: { minWidth:
|
|
38
|
+
: { minWidth: '100%', fontSize: 'small' };
|
|
39
39
|
return (React.createElement("div", { className: join_1.default(this.props.accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__Theme__wrap`) },
|
|
40
40
|
React.createElement(DropdownButton_1.default, { className: `ab-${elementType}__Theme__select`, style: dropDownStyle, items: themes, columns: ['label'], accessLevel: this.props.accessLevel }, currentThemeDescription)));
|
|
41
41
|
}
|
|
@@ -79,6 +79,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
79
79
|
_emit: (eventName: string, data?: any) => Promise<any>;
|
|
80
80
|
_emitSync: (eventName: string, data?: any) => any;
|
|
81
81
|
private _adaptableReady;
|
|
82
|
+
isDestroyed: boolean;
|
|
82
83
|
private agGridModules;
|
|
83
84
|
static init(adaptableOptions: AdaptableOptions): Promise<AdaptableApi>;
|
|
84
85
|
/**
|
|
@@ -102,7 +103,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
102
103
|
private performAudit;
|
|
103
104
|
private initializeAgGrid;
|
|
104
105
|
private isAgGridReady;
|
|
105
|
-
private
|
|
106
|
+
private initAgGridContainerFromInitializedAgGrid;
|
|
106
107
|
debouncedSetColumnIntoStore: import("lodash").DebouncedFunc<() => void>;
|
|
107
108
|
debouncedSaveGridLayout: import("lodash").DebouncedFunc<() => void>;
|
|
108
109
|
debouncedSetSelectedCells: import("lodash").DebouncedFunc<() => void>;
|
|
@@ -171,7 +172,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
171
172
|
forAllRowNodesDo(func: (rowNode: RowNode) => void): void;
|
|
172
173
|
forAllVisibleRowNodesDo(func: (rowNode: RowNode, rowIndex: number) => void): void;
|
|
173
174
|
getVisibleRowNodes(): RowNode[];
|
|
174
|
-
selectNodes(rowNodes:
|
|
175
|
+
selectNodes(rowNodes: RowNode[], clearSelection: boolean): void;
|
|
175
176
|
deSelectNodes(rowNodes: RowNode[], clearSelection: boolean): void;
|
|
176
177
|
selectNode(rowNode: RowNode, clearSelection: boolean): void;
|
|
177
178
|
deSelectNode(rowNode: RowNode, clearSelection: boolean): void;
|
|
@@ -180,7 +181,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
180
181
|
redrawBody(): void;
|
|
181
182
|
redrawHeader(): void;
|
|
182
183
|
redrawRow(rowNode: RowNode): void;
|
|
183
|
-
refreshCells(rowNodes:
|
|
184
|
+
refreshCells(rowNodes: RowNode[], columns: (string | Column)[], forceUpdate: boolean): void;
|
|
184
185
|
jumpToRow(rowNode: RowNode): void;
|
|
185
186
|
jumpToColumn(columnId: string): void;
|
|
186
187
|
jumpToCell(columnId: string, rowNode: RowNode): void;
|
|
@@ -230,7 +231,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
230
231
|
getDefaultIPPStyle(): IPPStyle;
|
|
231
232
|
getCurrentIPPStyle(): IPPStyle;
|
|
232
233
|
getAdaptableContainerElement(): HTMLElement | null;
|
|
233
|
-
|
|
234
|
+
getAgGridContainerElement(): HTMLElement | null;
|
|
234
235
|
private initInternalGridLogic;
|
|
235
236
|
buildStandaloneColumnHeader(adaptableColumn: AdaptableColumn): AdaptableMenuItem[];
|
|
236
237
|
prepareGrid(): void;
|
|
@@ -272,7 +273,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
272
273
|
expandAllRowGroups(): void;
|
|
273
274
|
closeAllRowGroups(): void;
|
|
274
275
|
expandRowGroupsForValues(columnValues: any[]): void;
|
|
275
|
-
|
|
276
|
+
getAgGridColumnForAdaptableColumn(abColumn: AdaptableColumn): Column;
|
|
276
277
|
setRowGroupColumns(columnIds: string[]): void;
|
|
277
278
|
clearRowGroupColumns(): void;
|
|
278
279
|
getExpandRowGroupsKeys(): any[];
|
|
@@ -309,10 +310,10 @@ export declare class Adaptable implements IAdaptable {
|
|
|
309
310
|
private hasFloatingFilterOnAtLeastOneColumn;
|
|
310
311
|
showQuickFilter(): void;
|
|
311
312
|
hideQuickFilter(): void;
|
|
312
|
-
|
|
313
|
+
getAgGridColumnType(columnId: string): string | string[];
|
|
313
314
|
getActiveColumnComparator(columnId: string, customSort?: CustomSort, customSortComparer?: ColumnValuesComparer): ((valueA: any, valueB: any, nodeA?: RowNode, nodeB?: RowNode, isInverted?: boolean) => number) | undefined;
|
|
314
|
-
|
|
315
|
-
|
|
315
|
+
getAgGridLightThemeName(): string;
|
|
316
|
+
getAgGridCurrentThemeName(): string;
|
|
316
317
|
applyAdaptableTheme(theme: AdaptableTheme | string): void;
|
|
317
318
|
private setupRowStyling;
|
|
318
319
|
private setupColumnHeaderAggregations;
|
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
|
});
|
|
@@ -554,12 +559,12 @@ class Adaptable {
|
|
|
554
559
|
}
|
|
555
560
|
}
|
|
556
561
|
}
|
|
557
|
-
const
|
|
558
|
-
let
|
|
559
|
-
if (!
|
|
560
|
-
|
|
561
|
-
if (!
|
|
562
|
-
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`');
|
|
563
568
|
return false;
|
|
564
569
|
}
|
|
565
570
|
}
|
|
@@ -567,14 +572,14 @@ class Adaptable {
|
|
|
567
572
|
};
|
|
568
573
|
const isGridInstantiated = this.gridOptions.api && typeof this.gridOptions.api.getValue === 'function';
|
|
569
574
|
if (isGridInstantiated) {
|
|
570
|
-
if (!
|
|
575
|
+
if (!checkAgGridContainer()) {
|
|
571
576
|
return Promise.resolve(false);
|
|
572
577
|
}
|
|
573
578
|
return Promise.resolve(true);
|
|
574
579
|
}
|
|
575
580
|
if (this.runtimeConfig.waitForAgGrid) {
|
|
576
581
|
return this.isAgGridReady().then(() => {
|
|
577
|
-
this.
|
|
582
|
+
this.initAgGridContainerFromInitializedAgGrid();
|
|
578
583
|
return Promise.resolve(true);
|
|
579
584
|
}, () => {
|
|
580
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`);
|
|
@@ -582,7 +587,7 @@ class Adaptable {
|
|
|
582
587
|
});
|
|
583
588
|
}
|
|
584
589
|
else {
|
|
585
|
-
if (!
|
|
590
|
+
if (!checkAgGridContainer()) {
|
|
586
591
|
return Promise.resolve(false);
|
|
587
592
|
}
|
|
588
593
|
}
|
|
@@ -590,11 +595,11 @@ class Adaptable {
|
|
|
590
595
|
let grid;
|
|
591
596
|
const modules = (this.adaptableOptions.vendorGrid || {}).modules || [];
|
|
592
597
|
this.agGridModules = [...this.agGridModules, ...modules];
|
|
593
|
-
const
|
|
598
|
+
const agGridContainer = this.getAgGridContainerElement();
|
|
594
599
|
if (this.gridOptions.modules) {
|
|
595
600
|
delete this.gridOptions.modules;
|
|
596
601
|
}
|
|
597
|
-
grid = new all_modules_1.Grid(
|
|
602
|
+
grid = new all_modules_1.Grid(agGridContainer, this.gridOptions, { modules });
|
|
598
603
|
// add our adaptable object to the grid options api object
|
|
599
604
|
// this is VERY useful for when we need to access Adaptable inside of agGrid only functions
|
|
600
605
|
if (this.gridOptions.api) {
|
|
@@ -602,8 +607,8 @@ class Adaptable {
|
|
|
602
607
|
}
|
|
603
608
|
return Promise.resolve(grid != null);
|
|
604
609
|
}
|
|
605
|
-
|
|
606
|
-
if (this.
|
|
610
|
+
initAgGridContainerFromInitializedAgGrid() {
|
|
611
|
+
if (this.getAgGridContainerElement()) {
|
|
607
612
|
return;
|
|
608
613
|
}
|
|
609
614
|
const layoutElements = this.gridOptions.api
|
|
@@ -615,21 +620,21 @@ class Adaptable {
|
|
|
615
620
|
// aggrid 25.3.0 doesn't have layoutElements anymore, so we try to retrieve this element
|
|
616
621
|
layoutElements.push(this.gridOptions.api.gridBodyCon.eGridBody);
|
|
617
622
|
}
|
|
618
|
-
let
|
|
623
|
+
let agGridContainer;
|
|
619
624
|
for (let i = 0, len = layoutElements.length; i < len; i++) {
|
|
620
625
|
const element = layoutElements[i];
|
|
621
626
|
if (element && element.matches('.ag-root-wrapper, .ag-root')) {
|
|
622
627
|
const gridContainer = element.closest('[class*="ag-theme"]');
|
|
623
628
|
if (gridContainer) {
|
|
624
|
-
|
|
629
|
+
agGridContainer = gridContainer;
|
|
625
630
|
break;
|
|
626
631
|
}
|
|
627
632
|
}
|
|
628
633
|
}
|
|
629
|
-
if (!
|
|
630
|
-
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.`);
|
|
631
636
|
}
|
|
632
|
-
return (this.adaptableOptions.containerOptions.
|
|
637
|
+
return (this.adaptableOptions.containerOptions.agGridContainer = agGridContainer);
|
|
633
638
|
}
|
|
634
639
|
filterOnEditDataChange() {
|
|
635
640
|
if (this.adaptableOptions.filterOptions.filterActionOnUserDataChange.applyFilter ==
|
|
@@ -723,7 +728,7 @@ class Adaptable {
|
|
|
723
728
|
// }
|
|
724
729
|
// }
|
|
725
730
|
const allColumns = [];
|
|
726
|
-
const
|
|
731
|
+
const agGridCols = this.gridOptions.columnApi.getAllColumns();
|
|
727
732
|
const columnGroupChildren = this.gridOptions.columnApi.getAllDisplayedColumnGroups();
|
|
728
733
|
const groupsCount = {};
|
|
729
734
|
const colsToGroups = columnGroupChildren.reduce((acc, columnGroup) => {
|
|
@@ -752,16 +757,16 @@ class Adaptable {
|
|
|
752
757
|
colsToGroups[colId].groupCount = groupsCount[colsToGroups[colId].columnGroupId];
|
|
753
758
|
});
|
|
754
759
|
// TODO sort the visible columns by layout order
|
|
755
|
-
|
|
756
|
-
const colId =
|
|
760
|
+
agGridCols.forEach((agGridColumn) => {
|
|
761
|
+
const colId = agGridColumn.getColId();
|
|
757
762
|
if (!this.api.columnApi.isRowGroupColumn(colId)) {
|
|
758
|
-
allColumns.push(this.createAdaptableColumn(
|
|
763
|
+
allColumns.push(this.createAdaptableColumn(agGridColumn, colsToGroups));
|
|
759
764
|
}
|
|
760
765
|
});
|
|
761
766
|
this.api.internalApi.setColumns(allColumns);
|
|
762
767
|
}
|
|
763
|
-
createAdaptableColumn(
|
|
764
|
-
const abColumn = this.agGridHelper.
|
|
768
|
+
createAdaptableColumn(agGridColumn, colsToGroups) {
|
|
769
|
+
const abColumn = this.agGridHelper.createAdaptableColumnFromAgGridColumn(agGridColumn, colsToGroups);
|
|
765
770
|
return abColumn;
|
|
766
771
|
}
|
|
767
772
|
safeSetColDefs(colDefs) {
|
|
@@ -1486,7 +1491,7 @@ class Adaptable {
|
|
|
1486
1491
|
async getDistinctFilterValuesForColumn(column, visibleRowsOnly, filter, skipRowNode) {
|
|
1487
1492
|
var _a;
|
|
1488
1493
|
const permittedValues = (_a = this.api.userInterfaceApi.getFilterPermittedValuesForColumn(column)) !== null && _a !== void 0 ? _a : {
|
|
1489
|
-
|
|
1494
|
+
suppressFilterSearchBar: false,
|
|
1490
1495
|
values: () => undefined,
|
|
1491
1496
|
};
|
|
1492
1497
|
let preparedPermittedValues = undefined;
|
|
@@ -1502,7 +1507,7 @@ class Adaptable {
|
|
|
1502
1507
|
LoggingHelper_1.ConsoleLogError(`Failed to load filter permitted values`, column, filter, error);
|
|
1503
1508
|
}
|
|
1504
1509
|
return {
|
|
1505
|
-
suppressClientSideFilter: permittedValues.
|
|
1510
|
+
suppressClientSideFilter: permittedValues.suppressFilterSearchBar,
|
|
1506
1511
|
gridCells: this.getDistinctValuesForColumn(column, visibleRowsOnly, skipRowNode, preparedPermittedValues),
|
|
1507
1512
|
};
|
|
1508
1513
|
}
|
|
@@ -1875,10 +1880,8 @@ class Adaptable {
|
|
|
1875
1880
|
];
|
|
1876
1881
|
}
|
|
1877
1882
|
getColDefsForFreeTextColumns() {
|
|
1878
|
-
const specialColumnsAreFilterable = this.api.internalApi.getAdaptableOptions().filterOptions
|
|
1879
|
-
|
|
1880
|
-
const defaultFreeTextColumnSettings = ObjectFactory_1.CreateEmptyFreeTextColumn(specialColumnsAreFilterable)
|
|
1881
|
-
.FreeTextColumnSettings;
|
|
1883
|
+
const specialColumnsAreFilterable = this.api.internalApi.getAdaptableOptions().filterOptions.enableFilterOnSpecialColumns;
|
|
1884
|
+
const defaultFreeTextColumnSettings = ObjectFactory_1.CreateEmptyFreeTextColumn(specialColumnsAreFilterable).FreeTextColumnSettings;
|
|
1882
1885
|
return this.api.freeTextColumnApi.getAllFreeTextColumn().map((freeTextColumn) => {
|
|
1883
1886
|
const freeTextColumnSettings = Object.assign(Object.assign({}, defaultFreeTextColumnSettings), freeTextColumn.FreeTextColumnSettings);
|
|
1884
1887
|
const dataTypeEditor = freeTextColumn.DataType === 'Number'
|
|
@@ -1984,13 +1987,13 @@ class Adaptable {
|
|
|
1984
1987
|
.enableFilterOnSpecialColumns
|
|
1985
1988
|
? this.adaptableOptions.filterOptions.enableFilterOnSpecialColumns
|
|
1986
1989
|
: true;
|
|
1987
|
-
const defaultCalculatedColumnSettings = ObjectFactory_1.CreateEmptyCalculatedColumn(specialColumnsAreFilterable)
|
|
1988
|
-
.CalculatedColumnSettings;
|
|
1990
|
+
const defaultCalculatedColumnSettings = ObjectFactory_1.CreateEmptyCalculatedColumn(specialColumnsAreFilterable).CalculatedColumnSettings;
|
|
1989
1991
|
return this.api.calculatedColumnApi.getAllCalculatedColumn().map((calculatedColumn) => {
|
|
1990
1992
|
var _a;
|
|
1991
1993
|
const calculatedColumnSettings = Object.assign(Object.assign({}, defaultCalculatedColumnSettings), calculatedColumn.CalculatedColumnSettings);
|
|
1992
1994
|
if (!calculatedColumnSettings.DataType) {
|
|
1993
|
-
calculatedColumnSettings.DataType =
|
|
1995
|
+
calculatedColumnSettings.DataType =
|
|
1996
|
+
this.CalculatedColumnExpressionService.GetCalculatedColumnDataType((_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression);
|
|
1994
1997
|
}
|
|
1995
1998
|
const newColDef = {
|
|
1996
1999
|
headerName: calculatedColumn.FriendlyName
|
|
@@ -2106,6 +2109,7 @@ class Adaptable {
|
|
|
2106
2109
|
(_j = this.TeamSharingService) === null || _j === void 0 ? void 0 : _j.destroy();
|
|
2107
2110
|
(_k = this.MetamodelService) === null || _k === void 0 ? void 0 : _k.destroy();
|
|
2108
2111
|
(_l = this.LicenseService) === null || _l === void 0 ? void 0 : _l.destroy();
|
|
2112
|
+
this.isDestroyed = true;
|
|
2109
2113
|
}
|
|
2110
2114
|
// really really need to do this properly but as a temp fix lets create a default style for when no data
|
|
2111
2115
|
getDefaultIPPStyle() {
|
|
@@ -2174,12 +2178,12 @@ class Adaptable {
|
|
|
2174
2178
|
}
|
|
2175
2179
|
return this.abContainerElement;
|
|
2176
2180
|
}
|
|
2177
|
-
|
|
2181
|
+
getAgGridContainerElement() {
|
|
2178
2182
|
if (!this.gridContainerElement) {
|
|
2179
2183
|
this.gridContainerElement =
|
|
2180
|
-
typeof this.adaptableOptions.containerOptions.
|
|
2181
|
-
? document.getElementById(this.adaptableOptions.containerOptions.
|
|
2182
|
-
: this.adaptableOptions.containerOptions.
|
|
2184
|
+
typeof this.adaptableOptions.containerOptions.agGridContainer === 'string'
|
|
2185
|
+
? document.getElementById(this.adaptableOptions.containerOptions.agGridContainer)
|
|
2186
|
+
: this.adaptableOptions.containerOptions.agGridContainer;
|
|
2183
2187
|
}
|
|
2184
2188
|
return this.gridContainerElement;
|
|
2185
2189
|
}
|
|
@@ -2197,7 +2201,7 @@ class Adaptable {
|
|
|
2197
2201
|
}
|
|
2198
2202
|
return;
|
|
2199
2203
|
}
|
|
2200
|
-
const gridContainerElement = this.
|
|
2204
|
+
const gridContainerElement = this.getAgGridContainerElement();
|
|
2201
2205
|
if (gridContainerElement) {
|
|
2202
2206
|
gridContainerElement.addEventListener('keydown', (event) => this._emit('KeyDown', event));
|
|
2203
2207
|
}
|
|
@@ -2247,7 +2251,7 @@ class Adaptable {
|
|
|
2247
2251
|
const cellEditableFn = this.adaptableOptions.editOptions.isCellEditable;
|
|
2248
2252
|
if (cellEditableFn) {
|
|
2249
2253
|
let gridCell = this.getGridCellFromRowNode(params.node, params.column.getColId());
|
|
2250
|
-
let isEditable = cellEditableFn(gridCell
|
|
2254
|
+
let isEditable = cellEditableFn(gridCell);
|
|
2251
2255
|
if (!isEditable) {
|
|
2252
2256
|
this.gridOptions.api.stopEditing();
|
|
2253
2257
|
}
|
|
@@ -2365,8 +2369,7 @@ class Adaptable {
|
|
|
2365
2369
|
this.onSortChanged();
|
|
2366
2370
|
this.debouncedSetSelectedCells();
|
|
2367
2371
|
});
|
|
2368
|
-
const showGroupingTotalsAsHeader = this.adaptableOptions.generalOptions
|
|
2369
|
-
.showGroupingTotalsAsHeader;
|
|
2372
|
+
const showGroupingTotalsAsHeader = this.adaptableOptions.generalOptions.showGroupingTotalsAsHeader;
|
|
2370
2373
|
/**
|
|
2371
2374
|
* Use Case: Model has updated
|
|
2372
2375
|
* Action: If user has set to see grouping totals as header create a pinned row (bit of a hack)
|
|
@@ -2670,7 +2673,9 @@ class Adaptable {
|
|
|
2670
2673
|
const hasConditionalStylesWithClassNames = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(conditionalStyles);
|
|
2671
2674
|
const quickSearchStyleClassName = this.api.quickSearchApi.getQuickSearchStyle().ClassName;
|
|
2672
2675
|
const hasQuickSearchStyleClassName = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(quickSearchStyleClassName);
|
|
2676
|
+
const classNameMap = {};
|
|
2673
2677
|
const cellClass = (params) => {
|
|
2678
|
+
var _a;
|
|
2674
2679
|
const isQuickSearchActive = hasQuickSearchStyleClassName && this.isQuickSearchActive(abColumn, params);
|
|
2675
2680
|
const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(params.node);
|
|
2676
2681
|
const editableClassName = this.getEditableCellClass(abColumn, params);
|
|
@@ -2688,6 +2693,24 @@ class Adaptable {
|
|
|
2688
2693
|
]
|
|
2689
2694
|
.filter((x) => !!x)
|
|
2690
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;
|
|
2691
2714
|
return StringExtensions_1.StringExtensions.IsNotNullOrEmpty(returnValue) ? returnValue : undefined;
|
|
2692
2715
|
};
|
|
2693
2716
|
return cellClass;
|
|
@@ -2788,8 +2811,7 @@ class Adaptable {
|
|
|
2788
2811
|
// set the default to the AG Grid provided values
|
|
2789
2812
|
// from https://github.com/ag-grid/ag-grid/blob/v26.1.0/community-modules/core/src/ts/columns/columnModel.ts#L2515
|
|
2790
2813
|
let resultHeaderName = userHeaderName !== null && userHeaderName !== void 0 ? userHeaderName : StringExtensions_1.StringExtensions.CamelCaseToHumanText(col.getColDef().field);
|
|
2791
|
-
const layoutCustomHeader = (_a = this.api.layoutApi.getCurrentLayout()
|
|
2792
|
-
.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()];
|
|
2793
2815
|
if (layoutCustomHeader) {
|
|
2794
2816
|
resultHeaderName = layoutCustomHeader;
|
|
2795
2817
|
}
|
|
@@ -2896,7 +2918,7 @@ class Adaptable {
|
|
|
2896
2918
|
var _a;
|
|
2897
2919
|
if (cellEditableFn) {
|
|
2898
2920
|
let gridCell = this.getGridCellFromRowNode(params.node, params.column.getColId());
|
|
2899
|
-
let isEditable = cellEditableFn(gridCell
|
|
2921
|
+
let isEditable = cellEditableFn(gridCell);
|
|
2900
2922
|
if (!isEditable) {
|
|
2901
2923
|
return false;
|
|
2902
2924
|
}
|
|
@@ -3231,11 +3253,10 @@ class Adaptable {
|
|
|
3231
3253
|
this.gridOptions.api.onGroupExpandedOrCollapsed();
|
|
3232
3254
|
}
|
|
3233
3255
|
}
|
|
3234
|
-
|
|
3235
|
-
|
|
3256
|
+
getAgGridColumnForAdaptableColumn(abColumn) {
|
|
3257
|
+
return this.gridOptions.columnApi
|
|
3236
3258
|
.getAllColumns()
|
|
3237
3259
|
.find((c) => c.getColId() === abColumn.columnId);
|
|
3238
|
-
return agGridColumn.getColDef().field || '';
|
|
3239
3260
|
}
|
|
3240
3261
|
setRowGroupColumns(columnIds) {
|
|
3241
3262
|
this.gridOptions.columnApi.setRowGroupColumns(columnIds);
|
|
@@ -3299,15 +3320,15 @@ class Adaptable {
|
|
|
3299
3320
|
this.gridOptions.api.clearRangeSelection();
|
|
3300
3321
|
}
|
|
3301
3322
|
hideColumn(columnId) {
|
|
3302
|
-
let
|
|
3303
|
-
if (
|
|
3323
|
+
let agGridColumn = this.gridOptions.columnApi.getColumn(columnId);
|
|
3324
|
+
if (agGridColumn) {
|
|
3304
3325
|
this.gridOptions.columnApi.setColumnVisible(columnId, false);
|
|
3305
3326
|
this.updateColumnsIntoStore();
|
|
3306
3327
|
}
|
|
3307
3328
|
}
|
|
3308
3329
|
showColumn(columnId) {
|
|
3309
|
-
let
|
|
3310
|
-
if (
|
|
3330
|
+
let agGridColumn = this.gridOptions.columnApi.getColumn(columnId);
|
|
3331
|
+
if (agGridColumn) {
|
|
3311
3332
|
this.gridOptions.columnApi.setColumnVisible(columnId, true);
|
|
3312
3333
|
this.updateColumnsIntoStore();
|
|
3313
3334
|
}
|
|
@@ -3522,7 +3543,7 @@ class Adaptable {
|
|
|
3522
3543
|
hideQuickFilter() {
|
|
3523
3544
|
this.gridOptions.api.setFloatingFiltersHeight(0);
|
|
3524
3545
|
}
|
|
3525
|
-
|
|
3546
|
+
getAgGridColumnType(columnId) {
|
|
3526
3547
|
var _a;
|
|
3527
3548
|
const { type } = (_a = this.gridOptions.api.getColumnDef(columnId)) !== null && _a !== void 0 ? _a : {};
|
|
3528
3549
|
return type || '';
|
|
@@ -3539,8 +3560,8 @@ class Adaptable {
|
|
|
3539
3560
|
: this.runAdaptableComparerFunction(customSort.ColumnId, customSort.SortedValues);
|
|
3540
3561
|
return comparerFunction;
|
|
3541
3562
|
}
|
|
3542
|
-
|
|
3543
|
-
const container = this.
|
|
3563
|
+
getAgGridLightThemeName() {
|
|
3564
|
+
const container = this.getAgGridContainerElement();
|
|
3544
3565
|
if (container && container.classList) {
|
|
3545
3566
|
// we detect the ag theme class
|
|
3546
3567
|
const classList = container.classList;
|
|
@@ -3552,10 +3573,10 @@ class Adaptable {
|
|
|
3552
3573
|
}
|
|
3553
3574
|
}
|
|
3554
3575
|
}
|
|
3555
|
-
return this.agGridHelper.
|
|
3576
|
+
return this.agGridHelper.getAgGridLightThemeName();
|
|
3556
3577
|
}
|
|
3557
|
-
|
|
3558
|
-
const container = this.
|
|
3578
|
+
getAgGridCurrentThemeName() {
|
|
3579
|
+
const container = this.getAgGridContainerElement();
|
|
3559
3580
|
if (container && container.classList) {
|
|
3560
3581
|
// we detect the ag theme class
|
|
3561
3582
|
const classList = container.classList;
|
|
@@ -3566,7 +3587,7 @@ class Adaptable {
|
|
|
3566
3587
|
}
|
|
3567
3588
|
}
|
|
3568
3589
|
}
|
|
3569
|
-
return this.
|
|
3590
|
+
return this.getAgGridLightThemeName();
|
|
3570
3591
|
}
|
|
3571
3592
|
applyAdaptableTheme(theme) {
|
|
3572
3593
|
const themeName = typeof theme === 'string' ? theme : theme.Name;
|
|
@@ -3622,39 +3643,39 @@ class Adaptable {
|
|
|
3622
3643
|
});
|
|
3623
3644
|
const systemThemes = this.api.themeApi.getAllSystemTheme();
|
|
3624
3645
|
const isSystemTheme = !!systemThemes.filter((t) => t.Name === themeName)[0];
|
|
3625
|
-
const container = this.
|
|
3626
|
-
const
|
|
3627
|
-
const
|
|
3646
|
+
const container = this.getAgGridContainerElement();
|
|
3647
|
+
const getAgGridLightThemeName = () => this.getAgGridLightThemeName();
|
|
3648
|
+
const getAgGridDarkThemeName = () => getAgGridLightThemeName() + '-dark';
|
|
3628
3649
|
if (newTheme && isSystemTheme) {
|
|
3629
3650
|
if (themeName === GeneralConstants_1.LIGHT_THEME) {
|
|
3630
|
-
newTheme.
|
|
3651
|
+
newTheme.AgGridClassName = newTheme.AgGridClassName || getAgGridLightThemeName();
|
|
3631
3652
|
}
|
|
3632
3653
|
if (themeName === GeneralConstants_1.DARK_THEME) {
|
|
3633
|
-
newTheme.
|
|
3654
|
+
newTheme.AgGridClassName = newTheme.AgGridClassName || getAgGridDarkThemeName();
|
|
3634
3655
|
}
|
|
3635
3656
|
}
|
|
3636
|
-
if (!newTheme.
|
|
3637
|
-
// default
|
|
3638
|
-
newTheme.
|
|
3657
|
+
if (!newTheme.AgGridClassName) {
|
|
3658
|
+
// default AG Grid to its light theme
|
|
3659
|
+
newTheme.AgGridClassName = getAgGridLightThemeName();
|
|
3639
3660
|
}
|
|
3640
3661
|
if (container != null) {
|
|
3641
3662
|
if (themesToRemove.length) {
|
|
3642
3663
|
themesToRemove.forEach((theme) => {
|
|
3643
|
-
if (theme.
|
|
3644
|
-
container.classList.remove(theme.
|
|
3664
|
+
if (theme.AgGridClassName) {
|
|
3665
|
+
container.classList.remove(theme.AgGridClassName);
|
|
3645
3666
|
}
|
|
3646
3667
|
});
|
|
3647
3668
|
}
|
|
3648
|
-
// also remove all
|
|
3649
|
-
const
|
|
3669
|
+
// also remove all AG Grid theme class names
|
|
3670
|
+
const agGridClassNamesToRemove = [];
|
|
3650
3671
|
container.classList.forEach((x) => {
|
|
3651
3672
|
if (x && x.indexOf('ag-theme-') === 0) {
|
|
3652
|
-
|
|
3673
|
+
agGridClassNamesToRemove.push(x);
|
|
3653
3674
|
}
|
|
3654
3675
|
});
|
|
3655
|
-
|
|
3656
|
-
if (newTheme && newTheme.
|
|
3657
|
-
container.classList.add(newTheme.
|
|
3676
|
+
agGridClassNamesToRemove.forEach((x) => container.classList.remove(x));
|
|
3677
|
+
if (newTheme && newTheme.AgGridClassName) {
|
|
3678
|
+
container.classList.add(newTheme.AgGridClassName);
|
|
3658
3679
|
}
|
|
3659
3680
|
container.classList.add('ab-Grid');
|
|
3660
3681
|
if (this.adaptableOptions.filterOptions.indicateFilteredColumns) {
|
|
@@ -16,10 +16,10 @@ import { FormatColumn } from '../PredefinedConfig/FormatColumnState';
|
|
|
16
16
|
export declare class agGridHelper {
|
|
17
17
|
private adaptable;
|
|
18
18
|
private gridOptions;
|
|
19
|
-
private
|
|
19
|
+
private initialAgGridColDefs;
|
|
20
20
|
constructor(adaptable: IAdaptable, gridOptions: GridOptions);
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
getAgGridLightThemeName(): string;
|
|
22
|
+
getAgGridDarkThemeName(): string;
|
|
23
23
|
setUpModules(): Map<AdaptableModule, IModule>;
|
|
24
24
|
TrySetUpNodeIds(): boolean;
|
|
25
25
|
createSparklineCellRendererComp(sparkline: SparklineColumn): ICellRendererFunc | undefined;
|
|
@@ -27,7 +27,7 @@ export declare class agGridHelper {
|
|
|
27
27
|
createNumericStyleRendererFunc(formatColumn: FormatColumn): ICellRendererFunc;
|
|
28
28
|
getCleanValue(value: string): string | undefined;
|
|
29
29
|
getRenderedValue(colDef: ColDef, valueToRender: any): any;
|
|
30
|
-
|
|
30
|
+
createAdaptableColumnFromAgGridColumn(agGridColumn: Column, colsToGroups: Record<string, AdaptableColumnGroup>): AdaptableColumn;
|
|
31
31
|
createAdaptableSideBarDefs(showFilterPanel: boolean, showColumnsPanel: boolean): SideBarDef;
|
|
32
32
|
createAdaptableToolPanel(): ToolPanelDef;
|
|
33
33
|
orderToolPanels(toolPanelDefs: (ToolPanelDef | string)[]): void;
|
|
@@ -49,17 +49,17 @@ class agGridHelper {
|
|
|
49
49
|
constructor(adaptable, gridOptions) {
|
|
50
50
|
this.adaptable = adaptable;
|
|
51
51
|
this.gridOptions = gridOptions;
|
|
52
|
-
this.
|
|
52
|
+
this.initialAgGridColDefs = {};
|
|
53
53
|
this.adaptable = adaptable;
|
|
54
54
|
this.gridOptions = gridOptions;
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
getAgGridLightThemeName() {
|
|
57
57
|
// we try not to call these two methods, as we try to detect the default grid
|
|
58
58
|
// theme from the grid container element - users should set their aggrid theme in html, on the container element
|
|
59
59
|
// so we read it from there. if we don't find it there, we'll call this method, as a last resort.
|
|
60
60
|
return 'ag-theme-balham';
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
getAgGridDarkThemeName() {
|
|
63
63
|
return 'ag-theme-balham-dark';
|
|
64
64
|
}
|
|
65
65
|
setUpModules() {
|
|
@@ -74,6 +74,7 @@ class agGridHelper {
|
|
|
74
74
|
modules.set(ModuleConstants.CellSummaryModuleId, new CellSummaryModule_1.CellSummaryModule(api));
|
|
75
75
|
modules.set(ModuleConstants.ConditionalStyleModuleId, new ConditionalStyleModule_1.ConditionalStyleModule(api));
|
|
76
76
|
modules.set(ModuleConstants.CustomSortModuleId, new CustomSortModule_1.CustomSortModule(api));
|
|
77
|
+
modules.set(ModuleConstants.DataChangeHistoryModuleId, new DataChangeHistoryModule_1.DataChangeHistoryModule(api));
|
|
77
78
|
modules.set(ModuleConstants.DataSourceModuleId, new DataSourceModule_1.DataSourceModule(api));
|
|
78
79
|
modules.set(ModuleConstants.ExportModuleId, new ExportModule_1.ExportModule(api));
|
|
79
80
|
modules.set(ModuleConstants.FilterModuleId, new FilterModule_1.FilterModule(api));
|
|
@@ -92,7 +93,6 @@ class agGridHelper {
|
|
|
92
93
|
modules.set(ModuleConstants.SystemStatusModuleId, new SystemStatusModule_1.SystemStatusModule(api));
|
|
93
94
|
modules.set(ModuleConstants.ThemeModuleId, new ThemeModule_1.ThemeModule(api));
|
|
94
95
|
modules.set(ModuleConstants.GridInfoModuleId, new GridInfoModule_1.GridInfoModule(api));
|
|
95
|
-
modules.set(ModuleConstants.DataChangeHistoryModuleId, new DataChangeHistoryModule_1.DataChangeHistoryModule(api));
|
|
96
96
|
return modules;
|
|
97
97
|
}
|
|
98
98
|
TrySetUpNodeIds() {
|
|
@@ -203,12 +203,12 @@ class agGridHelper {
|
|
|
203
203
|
}
|
|
204
204
|
return render({ value: valueToRender }) || '';
|
|
205
205
|
}
|
|
206
|
-
|
|
207
|
-
const colId =
|
|
208
|
-
const colDef =
|
|
209
|
-
const FriendlyName = this.gridOptions.columnApi.getDisplayNameForColumn(
|
|
210
|
-
if (!this.
|
|
211
|
-
this.
|
|
206
|
+
createAdaptableColumnFromAgGridColumn(agGridColumn, colsToGroups) {
|
|
207
|
+
const colId = agGridColumn.getColId();
|
|
208
|
+
const colDef = agGridColumn.getColDef();
|
|
209
|
+
const FriendlyName = this.gridOptions.columnApi.getDisplayNameForColumn(agGridColumn, 'header');
|
|
210
|
+
if (!this.initialAgGridColDefs[colId]) {
|
|
211
|
+
this.initialAgGridColDefs[colId] = Object.assign({}, agGridColumn.getUserProvidedColDef());
|
|
212
212
|
}
|
|
213
213
|
const ColumnId = colId;
|
|
214
214
|
const pkColumn = this.adaptable.adaptableOptions.primaryKey;
|
|
@@ -218,8 +218,8 @@ class agGridHelper {
|
|
|
218
218
|
columnId: ColumnId,
|
|
219
219
|
friendlyName: FriendlyName,
|
|
220
220
|
isPrimaryKey: ColumnId === pkColumn,
|
|
221
|
-
dataType: this.getColumnDataType(
|
|
222
|
-
visible:
|
|
221
|
+
dataType: this.getColumnDataType(agGridColumn, false),
|
|
222
|
+
visible: agGridColumn.isVisible(),
|
|
223
223
|
readOnly: this.isColumnReadonly(colDef),
|
|
224
224
|
columnGroup: ColumnGroup,
|
|
225
225
|
sortable: this.isColumnSortable(colDef),
|
|
@@ -245,8 +245,7 @@ class agGridHelper {
|
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
// lets set this here one as the function cannot change the result so dont need to run it each time
|
|
248
|
-
let excludeColumnFromQuickSearch = this.adaptable.adaptableOptions.searchOptions
|
|
249
|
-
.excludeColumnFromQuickSearch;
|
|
248
|
+
let excludeColumnFromQuickSearch = this.adaptable.adaptableOptions.searchOptions.excludeColumnFromQuickSearch;
|
|
250
249
|
if (excludeColumnFromQuickSearch) {
|
|
251
250
|
if (excludeColumnFromQuickSearch(abColumn)) {
|
|
252
251
|
abColumn.isExcludedFromQuickSearch = true;
|
|
@@ -286,10 +285,10 @@ class agGridHelper {
|
|
|
286
285
|
}
|
|
287
286
|
createAdaptableToolPanel() {
|
|
288
287
|
return {
|
|
289
|
-
id: '
|
|
288
|
+
id: 'adaptable',
|
|
290
289
|
toolPanel: 'AdaptableToolPanel',
|
|
291
290
|
labelDefault: this.adaptable.adaptableOptions.toolPanelOptions.adaptableToolPanelTitle,
|
|
292
|
-
labelKey: '
|
|
291
|
+
labelKey: 'adaptable',
|
|
293
292
|
iconKey: this.adaptable.adaptableOptions.toolPanelOptions.iconKey,
|
|
294
293
|
width: this.adaptable.adaptableOptions.toolPanelOptions.width,
|
|
295
294
|
minWidth: this.adaptable.adaptableOptions.toolPanelOptions.minWidth,
|