@adaptabletools/adaptable-cjs 20.0.0-canary.4 → 20.0.0-canary.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -1
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +1 -0
- package/src/AdaptableOptions/EditOptions.d.ts +13 -2
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +7 -0
- package/src/Api/Fdc3Api.d.ts +5 -3
- package/src/Api/Implementation/Fdc3ApiImpl.d.ts +3 -3
- package/src/Api/Implementation/Fdc3ApiImpl.js +4 -4
- package/src/Api/Implementation/LayoutHelpers.js +8 -27
- package/src/Api/Implementation/ThemeApiImpl.js +3 -1
- package/src/Api/Internal/RowFormInternalApi.js +1 -1
- package/src/Api/ThemeApi.d.ts +2 -0
- package/src/PredefinedConfig/AlertState.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +0 -16
- package/src/PredefinedConfig/FlashingCellState.d.ts +1 -1
- package/src/PredefinedConfig/LayoutState.d.ts +2 -2
- package/src/Utilities/Helpers/AdaptableHelper.d.ts +2 -0
- package/src/Utilities/Helpers/AdaptableHelper.js +12 -1
- package/src/Utilities/Services/Fdc3Service.d.ts +2 -2
- package/src/Utilities/Services/Fdc3Service.js +7 -2
- package/src/Utilities/Services/ThemeService.d.ts +1 -1
- package/src/Utilities/Services/ThemeService.js +5 -5
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +41 -0
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +4 -1
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +7 -2
- package/src/agGrid/AdaptableAgGrid.d.ts +2 -2
- package/src/agGrid/AdaptableAgGrid.js +14 -73
- package/src/agGrid/AgGridAdapter.d.ts +1 -1
- package/src/agGrid/AgGridAdapter.js +2 -6
- package/src/agGrid/AgGridColumnAdapter.js +0 -7
- package/src/agGrid/AgGridThemeAdapter.d.ts +19 -0
- package/src/agGrid/AgGridThemeAdapter.js +126 -0
- package/src/components/OverlayTrigger/useAgGridClassName.js +1 -1
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +16 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/migration/VersionUpgrade20.js +49 -5
- package/tsconfig.cjs.tsbuildinfo +1 -1
|
@@ -99,6 +99,7 @@ const src_1 = require("../layout-manager/src");
|
|
|
99
99
|
const isPivotLayoutModel_1 = require("../layout-manager/src/isPivotLayoutModel");
|
|
100
100
|
const AdaptableColumn_1 = require("../PredefinedConfig/Common/AdaptableColumn");
|
|
101
101
|
const agGridDataTypeDefinitions_1 = require("./agGridDataTypeDefinitions");
|
|
102
|
+
const AgGridThemeAdapter_1 = require("./AgGridThemeAdapter");
|
|
102
103
|
const LocalEventService_Prototype = ag_grid_enterprise_1.LocalEventService.prototype;
|
|
103
104
|
const LocalEventService_dispatchEvent = LocalEventService_Prototype.dispatchEvent;
|
|
104
105
|
LocalEventService_Prototype.dispatchEvent = function (event) {
|
|
@@ -173,6 +174,7 @@ class AdaptableAgGrid {
|
|
|
173
174
|
this.agGridMenuAdapter = new AgGridMenuAdapter_1.AgGridMenuAdapter(this);
|
|
174
175
|
this.agGridColumnAdapter = new AgGridColumnAdapter_1.AgGridColumnAdapter(this);
|
|
175
176
|
this.agGridExportAdapter = new AgGridExportAdapter_1.AgGridExportAdapter(this);
|
|
177
|
+
this.agGridThemeAdapter = new AgGridThemeAdapter_1.AgGridThemeAdapter(this);
|
|
176
178
|
this.DataService = new DataService_1.DataService(this);
|
|
177
179
|
}
|
|
178
180
|
static forEachAdaptable(fn) {
|
|
@@ -600,12 +602,12 @@ You need to define at least one Layout!`);
|
|
|
600
602
|
this.agGridAdapter.setAgGridId(agGridId);
|
|
601
603
|
return agGridId;
|
|
602
604
|
});
|
|
603
|
-
// FIXME AFL: handle both ThemingApi and legacy CSS
|
|
604
605
|
/**
|
|
605
606
|
* `theme`
|
|
606
607
|
*/
|
|
607
|
-
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'theme', (
|
|
608
|
-
|
|
608
|
+
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'theme', (original_theme) => {
|
|
609
|
+
this.agGridThemeAdapter.setAgGridThemeMode(original_theme === 'legacy' ? 'legacy' : 'themingApi');
|
|
610
|
+
return original_theme;
|
|
609
611
|
});
|
|
610
612
|
/**
|
|
611
613
|
* `getRowId`
|
|
@@ -722,7 +724,7 @@ You need to define at least one Layout!`);
|
|
|
722
724
|
if (this.isGroupRowNode(node)) {
|
|
723
725
|
return true;
|
|
724
726
|
}
|
|
725
|
-
// first assess if the Row
|
|
727
|
+
// first assess if the Row i s filterable - if not, then return true so it appears in Grid
|
|
726
728
|
const isRowFilterable = this.api.optionsApi.getFilterOptions().isRowFilterable;
|
|
727
729
|
if (typeof isRowFilterable === 'function') {
|
|
728
730
|
const rowFilterableContext = {
|
|
@@ -2580,40 +2582,6 @@ You need to define at least one Layout!`);
|
|
|
2580
2582
|
clearAgGridQuickSearch() {
|
|
2581
2583
|
this.setAgGridQuickSearch('');
|
|
2582
2584
|
}
|
|
2583
|
-
getAgGridCurrentThemeName() {
|
|
2584
|
-
const container = this.getAgGridContainerElement();
|
|
2585
|
-
if (container && container.classList) {
|
|
2586
|
-
// we detect the ag theme class
|
|
2587
|
-
const classList = container.classList;
|
|
2588
|
-
for (let i = 0, len = classList.length; i < len; i++) {
|
|
2589
|
-
const cls = classList[i];
|
|
2590
|
-
if (cls.indexOf('ag-theme-') === 0) {
|
|
2591
|
-
return cls;
|
|
2592
|
-
}
|
|
2593
|
-
}
|
|
2594
|
-
}
|
|
2595
|
-
return this.getAgGridLightThemeName();
|
|
2596
|
-
}
|
|
2597
|
-
getAgGridLightThemeName() {
|
|
2598
|
-
const container = this.getAgGridContainerElement();
|
|
2599
|
-
if (container && container.classList) {
|
|
2600
|
-
// we detect the ag theme class
|
|
2601
|
-
const classList = container.classList;
|
|
2602
|
-
for (let i = 0, len = classList.length; i < len; i++) {
|
|
2603
|
-
const cls = classList[i];
|
|
2604
|
-
if (cls.indexOf('ag-theme-') === 0) {
|
|
2605
|
-
// even if dark theme is included, we compute the light theme name out of it
|
|
2606
|
-
return cls.replace('-dark', '');
|
|
2607
|
-
}
|
|
2608
|
-
}
|
|
2609
|
-
}
|
|
2610
|
-
else {
|
|
2611
|
-
this.logger.warn('No AgGrid container found, defaulting to ag-theme-balham for the light theme');
|
|
2612
|
-
}
|
|
2613
|
-
this.logger.warn('No ag-theme- class found on the grid container, defaulting to ag-theme-balham');
|
|
2614
|
-
// fallback to the default light theme
|
|
2615
|
-
return 'ag-theme-balham';
|
|
2616
|
-
}
|
|
2617
2585
|
applyAdaptableTheme(theme) {
|
|
2618
2586
|
const container = this.getAgGridContainerElement();
|
|
2619
2587
|
if (container != null) {
|
|
@@ -2678,41 +2646,8 @@ You need to define at least one Layout!`);
|
|
|
2678
2646
|
else if (variantTheme) {
|
|
2679
2647
|
el.classList.add(`infinite-${variantTheme}`);
|
|
2680
2648
|
}
|
|
2681
|
-
// AG THEME
|
|
2682
|
-
|
|
2683
|
-
const getAgGridDarkThemeName = () => getAgGridLightThemeName() + '-dark';
|
|
2684
|
-
if (newTheme && (isSystemTheme || variantTheme)) {
|
|
2685
|
-
if ((variantTheme || themeName) === GeneralConstants_1.LIGHT_THEME) {
|
|
2686
|
-
newTheme.AgGridClassName = newTheme.AgGridClassName || getAgGridLightThemeName();
|
|
2687
|
-
}
|
|
2688
|
-
if ((variantTheme || themeName) === GeneralConstants_1.DARK_THEME) {
|
|
2689
|
-
newTheme.AgGridClassName = newTheme.AgGridClassName || getAgGridDarkThemeName();
|
|
2690
|
-
}
|
|
2691
|
-
}
|
|
2692
|
-
if (!newTheme.AgGridClassName) {
|
|
2693
|
-
// default AG Grid to its light theme
|
|
2694
|
-
newTheme.AgGridClassName = getAgGridLightThemeName();
|
|
2695
|
-
}
|
|
2696
|
-
if (container != null) {
|
|
2697
|
-
if (themesToRemove.length) {
|
|
2698
|
-
themesToRemove.forEach((theme) => {
|
|
2699
|
-
if (theme.AgGridClassName) {
|
|
2700
|
-
container.classList.remove(theme.AgGridClassName);
|
|
2701
|
-
}
|
|
2702
|
-
});
|
|
2703
|
-
}
|
|
2704
|
-
// also remove all AG Grid theme class names
|
|
2705
|
-
const agGridClassNamesToRemove = [];
|
|
2706
|
-
container.classList.forEach((x) => {
|
|
2707
|
-
if (x && x.indexOf('ag-theme-') === 0) {
|
|
2708
|
-
agGridClassNamesToRemove.push(x);
|
|
2709
|
-
}
|
|
2710
|
-
});
|
|
2711
|
-
agGridClassNamesToRemove.forEach((x) => container.classList.remove(x));
|
|
2712
|
-
if (newTheme && newTheme.AgGridClassName) {
|
|
2713
|
-
container.classList.add(newTheme.AgGridClassName);
|
|
2714
|
-
}
|
|
2715
|
-
}
|
|
2649
|
+
// Update AG THEME
|
|
2650
|
+
this.agGridThemeAdapter.applyAgGridThemeOnAdaptableThemeChange(newTheme, variantTheme, container, themesToRemove);
|
|
2716
2651
|
// MAC LIKE SCROLLBARS
|
|
2717
2652
|
if (this.adaptableOptions.userInterfaceOptions &&
|
|
2718
2653
|
this.adaptableOptions.userInterfaceOptions.useCustomMacLikeScrollbars &&
|
|
@@ -2906,6 +2841,8 @@ You need to define at least one Layout!`);
|
|
|
2906
2841
|
this.agGridColumnAdapter = null;
|
|
2907
2842
|
this.agGridExportAdapter?.destroy();
|
|
2908
2843
|
this.agGridExportAdapter = null;
|
|
2844
|
+
this.agGridThemeAdapter?.destroy();
|
|
2845
|
+
this.agGridThemeAdapter = null;
|
|
2909
2846
|
this.rowListeners = null;
|
|
2910
2847
|
this.emitter.destroy();
|
|
2911
2848
|
this.emitter = null;
|
|
@@ -3028,6 +2965,10 @@ You need to define at least one Layout!`);
|
|
|
3028
2965
|
};
|
|
3029
2966
|
this.agGridColumnAdapter.setupColumnHeader(colSetupInfo);
|
|
3030
2967
|
});
|
|
2968
|
+
// need to refresh the header,
|
|
2969
|
+
// as the Layout.ColumnHeaders state property is not implemented in the LayoutManager
|
|
2970
|
+
// and is specific to Adaptable, therefore we need to refresh it manually
|
|
2971
|
+
this.refreshHeader();
|
|
3031
2972
|
const layoutModel = (0, LayoutHelpers_1.layoutStateToLayoutModel)(layout);
|
|
3032
2973
|
this.layoutManager?.setLayout(layoutModel, {
|
|
3033
2974
|
skipApplyRowGroupsExpandedState: !shouldUpdateExpandState,
|
|
@@ -3,6 +3,7 @@ import { AdaptableAgGrid } from './AdaptableAgGrid';
|
|
|
3
3
|
import { AdaptableColumn, AdaptableColumnGroup } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
4
4
|
import { SelectedCellInfo } from '../PredefinedConfig/Selection/SelectedCellInfo';
|
|
5
5
|
import { SelectedRowInfo } from '../PredefinedConfig/Selection/SelectedRowInfo';
|
|
6
|
+
export type AgGridThemeMode = 'legacy' | 'themingApi';
|
|
6
7
|
export declare class AgGridAdapter {
|
|
7
8
|
private _adaptableInstance;
|
|
8
9
|
private DANGER_USE_GETTER_gridApi;
|
|
@@ -45,7 +46,6 @@ export declare class AgGridAdapter {
|
|
|
45
46
|
deriveSelectedCellInfoFromAgGrid(): SelectedCellInfo;
|
|
46
47
|
deriveSelectedRowInfoFromAgGrid(): SelectedRowInfo;
|
|
47
48
|
isPinnedRowNode(rowNode: IRowNode): boolean;
|
|
48
|
-
getFirstGroupedColumn(): string | undefined;
|
|
49
49
|
createAdaptableColumnFromAgGridColumn(agGridColumn: Column, colsToGroups: Record<string, AdaptableColumnGroup>): AdaptableColumn;
|
|
50
50
|
private deriveAdaptableColumnDataType;
|
|
51
51
|
private isColumnReadonly;
|
|
@@ -100,7 +100,7 @@ class AgGridAdapter {
|
|
|
100
100
|
// `context`
|
|
101
101
|
const passedContext = options.context;
|
|
102
102
|
if (passedContext) {
|
|
103
|
-
passedContext['__adaptable'] = self;
|
|
103
|
+
passedContext['__adaptable'] = self._adaptableInstance;
|
|
104
104
|
passedContext['adaptableApi'] = self.adaptableApi;
|
|
105
105
|
}
|
|
106
106
|
// we mutated the options array, so it's OK to use the 'arguments' object
|
|
@@ -371,10 +371,6 @@ class AgGridAdapter {
|
|
|
371
371
|
}
|
|
372
372
|
return false;
|
|
373
373
|
}
|
|
374
|
-
// TODO AFL MIG rename to getFirstGroupedColumnId()
|
|
375
|
-
getFirstGroupedColumn() {
|
|
376
|
-
return this.getAgGridApi?.()?.getRowGroupColumns()?.[0]?.getColId();
|
|
377
|
-
}
|
|
378
374
|
createAdaptableColumnFromAgGridColumn(agGridColumn, colsToGroups) {
|
|
379
375
|
const colId = agGridColumn.getColId();
|
|
380
376
|
const colDef = agGridColumn.getColDef();
|
|
@@ -529,7 +525,7 @@ class AgGridAdapter {
|
|
|
529
525
|
else if (Array.isArray(value)) {
|
|
530
526
|
const arrayDataType = agGridDataTypeDefinitions_1.ALL_ADAPTABLE_DATA_TYPES.find((arrayType) => {
|
|
531
527
|
const dataTypeDefinition = agGridDataTypeDefinitions_1.agGridDataTypeDefinitions[arrayType];
|
|
532
|
-
const dataTypeMatching = dataTypeDefinition
|
|
528
|
+
const dataTypeMatching = dataTypeDefinition?.dataTypeMatcher(value);
|
|
533
529
|
return dataTypeMatching;
|
|
534
530
|
});
|
|
535
531
|
if (arrayDataType) {
|
|
@@ -143,8 +143,6 @@ class AgGridColumnAdapter {
|
|
|
143
143
|
this.setupColumnQuickFilerText(colSetupInfo);
|
|
144
144
|
this.setupColumnAllowedAggFuncs(colSetupInfo);
|
|
145
145
|
this.setupColumnType(colSetupInfo);
|
|
146
|
-
// this is just to make sure that AG Grid does NOT infer the cellDataType
|
|
147
|
-
// https://github.com/AdaptableTools/adaptable/issues/2230 should render it obsolete
|
|
148
146
|
this.setupColumnCellDataType(colSetupInfo);
|
|
149
147
|
});
|
|
150
148
|
}
|
|
@@ -380,8 +378,6 @@ class AgGridColumnAdapter {
|
|
|
380
378
|
}
|
|
381
379
|
setupColumnCellDataType(columnSetupInfo) {
|
|
382
380
|
const { col } = columnSetupInfo;
|
|
383
|
-
// AG Grid introduced since v30.x an inferred cellDataType
|
|
384
|
-
// the problem is that it breaks the default value formatter and/or editor (especially for Date columns)
|
|
385
381
|
this.setColDefProperty(col, 'cellDataType', (original_cellDataType) => {
|
|
386
382
|
return original_cellDataType ?? true;
|
|
387
383
|
});
|
|
@@ -396,9 +392,6 @@ class AgGridColumnAdapter {
|
|
|
396
392
|
if (layoutCustomHeader) {
|
|
397
393
|
resultHeaderName = layoutCustomHeader;
|
|
398
394
|
}
|
|
399
|
-
// required here for the initial layout rendering
|
|
400
|
-
// Removed by JW, 3 october 2023; i don't think we need it and it overrides stuff unnecessarily
|
|
401
|
-
abColumn.friendlyName = resultHeaderName;
|
|
402
395
|
return resultHeaderName;
|
|
403
396
|
});
|
|
404
397
|
const newColumnHeader = col?.getColDef()?.headerName;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AdaptableAgGrid } from './AdaptableAgGrid';
|
|
2
|
+
import { AgGridThemeMode } from './AgGridAdapter';
|
|
3
|
+
import { AdaptableTheme } from '../PredefinedConfig/ThemeState';
|
|
4
|
+
export declare class AgGridThemeAdapter {
|
|
5
|
+
private _adaptableInstance;
|
|
6
|
+
private agGridThemeMode;
|
|
7
|
+
constructor(_adaptableInstance: AdaptableAgGrid);
|
|
8
|
+
destroy(): void;
|
|
9
|
+
get logger(): import("./AdaptableLogger").AdaptableLogger;
|
|
10
|
+
get api(): import("../types").AdaptableApi;
|
|
11
|
+
setAgGridThemeMode(themeMode: AgGridThemeMode): void;
|
|
12
|
+
getAgGridThemeMode(): AgGridThemeMode;
|
|
13
|
+
applyAgGridThemeOnAdaptableThemeChange(adaptableTheme: AdaptableTheme, variantTheme: string, agGridContainer: HTMLElement, themesToRemove: AdaptableTheme[]): void;
|
|
14
|
+
private getAgGridContainerElement;
|
|
15
|
+
private legacy_applyAgGridThemeOnAdaptableThemeChange;
|
|
16
|
+
getAgGridCurrentThemeClassNames(): string;
|
|
17
|
+
private getAgGridLightThemeName;
|
|
18
|
+
private legacy_getAgGridCurrentThemeClassNames;
|
|
19
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgGridThemeAdapter = void 0;
|
|
4
|
+
const GeneralConstants_1 = require("../Utilities/Constants/GeneralConstants");
|
|
5
|
+
class AgGridThemeAdapter {
|
|
6
|
+
constructor(_adaptableInstance) {
|
|
7
|
+
this._adaptableInstance = _adaptableInstance;
|
|
8
|
+
}
|
|
9
|
+
destroy() { }
|
|
10
|
+
get logger() {
|
|
11
|
+
return this._adaptableInstance.logger;
|
|
12
|
+
}
|
|
13
|
+
get api() {
|
|
14
|
+
return this._adaptableInstance.api;
|
|
15
|
+
}
|
|
16
|
+
setAgGridThemeMode(themeMode) {
|
|
17
|
+
this.agGridThemeMode = themeMode;
|
|
18
|
+
}
|
|
19
|
+
getAgGridThemeMode() {
|
|
20
|
+
return this.agGridThemeMode;
|
|
21
|
+
}
|
|
22
|
+
applyAgGridThemeOnAdaptableThemeChange(adaptableTheme, variantTheme, agGridContainer, themesToRemove) {
|
|
23
|
+
if (this.agGridThemeMode === 'legacy') {
|
|
24
|
+
this.legacy_applyAgGridThemeOnAdaptableThemeChange(adaptableTheme, variantTheme, agGridContainer, themesToRemove);
|
|
25
|
+
}
|
|
26
|
+
const themeName = adaptableTheme.Name;
|
|
27
|
+
const isSystemTheme = this.api.themeApi.internalApi.isSystemTheme(themeName);
|
|
28
|
+
if (adaptableTheme && (isSystemTheme || variantTheme)) {
|
|
29
|
+
if ((variantTheme || themeName) === GeneralConstants_1.LIGHT_THEME) {
|
|
30
|
+
document.body.dataset.agThemeMode = 'light';
|
|
31
|
+
}
|
|
32
|
+
if ((variantTheme || themeName) === GeneralConstants_1.DARK_THEME) {
|
|
33
|
+
document.body.dataset.agThemeMode = 'dark';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
getAgGridContainerElement() {
|
|
38
|
+
return this._adaptableInstance.getAgGridContainerElement();
|
|
39
|
+
}
|
|
40
|
+
legacy_applyAgGridThemeOnAdaptableThemeChange(adaptableTheme, variantTheme, agGridContainer, themesToRemove) {
|
|
41
|
+
const themeName = adaptableTheme.Name;
|
|
42
|
+
const isSystemTheme = this.api.themeApi.internalApi.isSystemTheme(themeName);
|
|
43
|
+
const getAgGridLightThemeName = () => this.getAgGridLightThemeName();
|
|
44
|
+
const getAgGridDarkThemeName = () => getAgGridLightThemeName() + '-dark';
|
|
45
|
+
if (adaptableTheme && (isSystemTheme || variantTheme)) {
|
|
46
|
+
if ((variantTheme || themeName) === GeneralConstants_1.LIGHT_THEME) {
|
|
47
|
+
adaptableTheme.AgGridClassName =
|
|
48
|
+
adaptableTheme.AgGridClassName || getAgGridLightThemeName();
|
|
49
|
+
}
|
|
50
|
+
if ((variantTheme || themeName) === GeneralConstants_1.DARK_THEME) {
|
|
51
|
+
adaptableTheme.AgGridClassName = adaptableTheme.AgGridClassName || getAgGridDarkThemeName();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (!adaptableTheme.AgGridClassName) {
|
|
55
|
+
// default AG Grid to its light theme
|
|
56
|
+
adaptableTheme.AgGridClassName = getAgGridLightThemeName();
|
|
57
|
+
}
|
|
58
|
+
if (agGridContainer != null) {
|
|
59
|
+
if (themesToRemove.length) {
|
|
60
|
+
themesToRemove.forEach((theme) => {
|
|
61
|
+
if (theme.AgGridClassName) {
|
|
62
|
+
agGridContainer.classList.remove(theme.AgGridClassName);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
// also remove all AG Grid theme class names
|
|
67
|
+
const agGridClassNamesToRemove = [];
|
|
68
|
+
agGridContainer.classList.forEach((x) => {
|
|
69
|
+
if (x && x.indexOf('ag-theme-') === 0) {
|
|
70
|
+
agGridClassNamesToRemove.push(x);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
agGridClassNamesToRemove.forEach((x) => agGridContainer.classList.remove(x));
|
|
74
|
+
if (adaptableTheme && adaptableTheme.AgGridClassName) {
|
|
75
|
+
agGridContainer.classList.add(adaptableTheme.AgGridClassName);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
getAgGridCurrentThemeClassNames() {
|
|
80
|
+
if (this.agGridThemeMode === 'legacy') {
|
|
81
|
+
this.legacy_getAgGridCurrentThemeClassNames();
|
|
82
|
+
}
|
|
83
|
+
const currentAgGridTheme = this._adaptableInstance.agGridAdapter.getGridOption('theme');
|
|
84
|
+
if (currentAgGridTheme === 'legacy') {
|
|
85
|
+
return this.legacy_getAgGridCurrentThemeClassNames();
|
|
86
|
+
}
|
|
87
|
+
// @ts-ignore no other way than to use internals
|
|
88
|
+
const currentAgGridTheme__cssClassCache = currentAgGridTheme?._cssClassCache;
|
|
89
|
+
return currentAgGridTheme__cssClassCache ?? '';
|
|
90
|
+
}
|
|
91
|
+
getAgGridLightThemeName() {
|
|
92
|
+
const container = this.getAgGridContainerElement();
|
|
93
|
+
if (container && container.classList) {
|
|
94
|
+
// we detect the ag theme class
|
|
95
|
+
const classList = container.classList;
|
|
96
|
+
for (let i = 0, len = classList.length; i < len; i++) {
|
|
97
|
+
const cls = classList[i];
|
|
98
|
+
if (cls.indexOf('ag-theme-') === 0) {
|
|
99
|
+
// even if dark theme is included, we compute the light theme name out of it
|
|
100
|
+
return cls.replace('-dark', '');
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
this.logger.warn('No AgGrid container found, defaulting to ag-theme-balham for the light theme');
|
|
106
|
+
}
|
|
107
|
+
this.logger.warn('No ag-theme- class found on the grid container, defaulting to ag-theme-balham');
|
|
108
|
+
// fallback to the default light theme
|
|
109
|
+
return 'ag-theme-balham';
|
|
110
|
+
}
|
|
111
|
+
legacy_getAgGridCurrentThemeClassNames() {
|
|
112
|
+
const container = this.getAgGridContainerElement();
|
|
113
|
+
if (container && container.classList) {
|
|
114
|
+
// we detect the ag theme class
|
|
115
|
+
const classList = container.classList;
|
|
116
|
+
for (let i = 0, len = classList.length; i < len; i++) {
|
|
117
|
+
const cls = classList[i];
|
|
118
|
+
if (cls.indexOf('ag-theme-') === 0) {
|
|
119
|
+
return cls;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return this.getAgGridLightThemeName();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
exports.AgGridThemeAdapter = AgGridThemeAdapter;
|
|
@@ -6,7 +6,7 @@ const useAgGridClassName = (deps = []) => {
|
|
|
6
6
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
7
7
|
return (0, react_1.useMemo)(() => {
|
|
8
8
|
if (adaptable) {
|
|
9
|
-
return adaptable.
|
|
9
|
+
return adaptable.agGridThemeAdapter.getAgGridCurrentThemeClassNames();
|
|
10
10
|
}
|
|
11
11
|
return '';
|
|
12
12
|
}, deps);
|
package/src/env.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = {
|
|
4
4
|
NEXT_PUBLIC_INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
|
|
5
|
-
PUBLISH_TIMESTAMP:
|
|
6
|
-
VERSION: "20.0.0-canary.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1741253368753 || Date.now(),
|
|
6
|
+
VERSION: "20.0.0-canary.6" || '--current-version--',
|
|
7
7
|
};
|
|
@@ -2289,6 +2289,22 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
2289
2289
|
ref?: undefined;
|
|
2290
2290
|
})[];
|
|
2291
2291
|
};
|
|
2292
|
+
CustomEditColumnValueInfo: {
|
|
2293
|
+
name: string;
|
|
2294
|
+
kind: string;
|
|
2295
|
+
desc: string;
|
|
2296
|
+
props: ({
|
|
2297
|
+
name: string;
|
|
2298
|
+
kind: string;
|
|
2299
|
+
desc: string;
|
|
2300
|
+
isOpt: boolean;
|
|
2301
|
+
} | {
|
|
2302
|
+
name: string;
|
|
2303
|
+
kind: string;
|
|
2304
|
+
desc: string;
|
|
2305
|
+
isOpt?: undefined;
|
|
2306
|
+
})[];
|
|
2307
|
+
};
|
|
2292
2308
|
CustomEditColumnValuesContext: {
|
|
2293
2309
|
name: string;
|
|
2294
2310
|
kind: string;
|