@adaptabletools/adaptable 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 +10 -0
- 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 +15 -74
- package/src/agGrid/AgGridAdapter.d.ts +1 -1
- package/src/agGrid/AgGridAdapter.js +3 -7
- package/src/agGrid/AgGridColumnAdapter.js +0 -7
- package/src/agGrid/AgGridThemeAdapter.d.ts +19 -0
- package/src/agGrid/AgGridThemeAdapter.js +122 -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.esm.tsbuildinfo +1 -1
|
@@ -8,7 +8,7 @@ import Emitter from '../Utilities/Emitter';
|
|
|
8
8
|
import { applyDefaultAdaptableOptions } from '../AdaptableOptions/DefaultAdaptableOptions';
|
|
9
9
|
import { AgGridAdapter } from './AgGridAdapter';
|
|
10
10
|
import * as GeneralConstants from '../Utilities/Constants/GeneralConstants';
|
|
11
|
-
import { AUTOGENERATED_PK_COLUMN,
|
|
11
|
+
import { AUTOGENERATED_PK_COLUMN, ERROR_LAYOUT, GROUP_PATH_SEPARATOR, HALF_SECOND, QUARTER_SECOND, } from '../Utilities/Constants/GeneralConstants';
|
|
12
12
|
import { DataService } from '../Utilities/Services/DataService';
|
|
13
13
|
import { AdaptableStore } from '../Redux/Store/AdaptableStore';
|
|
14
14
|
import { AdaptableApiImpl } from '../Api/Implementation/AdaptableApiImpl';
|
|
@@ -95,6 +95,7 @@ import { LayoutManager } from '../layout-manager/src';
|
|
|
95
95
|
import { isPivotLayoutModel } from '../layout-manager/src/isPivotLayoutModel';
|
|
96
96
|
import { ACTION_COLUMN_TYPE, CALCULATED_COLUMN_TYPE, FDC3_COLUMN_TYPE, FREE_TEXT_COLUMN_TYPE, } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
97
97
|
import { agGridDataTypeDefinitions } from './agGridDataTypeDefinitions';
|
|
98
|
+
import { AgGridThemeAdapter } from './AgGridThemeAdapter';
|
|
98
99
|
const LocalEventService_Prototype = LocalEventService.prototype;
|
|
99
100
|
const LocalEventService_dispatchEvent = LocalEventService_Prototype.dispatchEvent;
|
|
100
101
|
LocalEventService_Prototype.dispatchEvent = function (event) {
|
|
@@ -169,6 +170,7 @@ export class AdaptableAgGrid {
|
|
|
169
170
|
this.agGridMenuAdapter = new AgGridMenuAdapter(this);
|
|
170
171
|
this.agGridColumnAdapter = new AgGridColumnAdapter(this);
|
|
171
172
|
this.agGridExportAdapter = new AgGridExportAdapter(this);
|
|
173
|
+
this.agGridThemeAdapter = new AgGridThemeAdapter(this);
|
|
172
174
|
this.DataService = new DataService(this);
|
|
173
175
|
}
|
|
174
176
|
static forEachAdaptable(fn) {
|
|
@@ -596,12 +598,12 @@ You need to define at least one Layout!`);
|
|
|
596
598
|
this.agGridAdapter.setAgGridId(agGridId);
|
|
597
599
|
return agGridId;
|
|
598
600
|
});
|
|
599
|
-
// FIXME AFL: handle both ThemingApi and legacy CSS
|
|
600
601
|
/**
|
|
601
602
|
* `theme`
|
|
602
603
|
*/
|
|
603
|
-
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'theme', (
|
|
604
|
-
|
|
604
|
+
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'theme', (original_theme) => {
|
|
605
|
+
this.agGridThemeAdapter.setAgGridThemeMode(original_theme === 'legacy' ? 'legacy' : 'themingApi');
|
|
606
|
+
return original_theme;
|
|
605
607
|
});
|
|
606
608
|
/**
|
|
607
609
|
* `getRowId`
|
|
@@ -718,7 +720,7 @@ You need to define at least one Layout!`);
|
|
|
718
720
|
if (this.isGroupRowNode(node)) {
|
|
719
721
|
return true;
|
|
720
722
|
}
|
|
721
|
-
// first assess if the Row
|
|
723
|
+
// first assess if the Row i s filterable - if not, then return true so it appears in Grid
|
|
722
724
|
const isRowFilterable = this.api.optionsApi.getFilterOptions().isRowFilterable;
|
|
723
725
|
if (typeof isRowFilterable === 'function') {
|
|
724
726
|
const rowFilterableContext = {
|
|
@@ -2576,40 +2578,6 @@ You need to define at least one Layout!`);
|
|
|
2576
2578
|
clearAgGridQuickSearch() {
|
|
2577
2579
|
this.setAgGridQuickSearch('');
|
|
2578
2580
|
}
|
|
2579
|
-
getAgGridCurrentThemeName() {
|
|
2580
|
-
const container = this.getAgGridContainerElement();
|
|
2581
|
-
if (container && container.classList) {
|
|
2582
|
-
// we detect the ag theme class
|
|
2583
|
-
const classList = container.classList;
|
|
2584
|
-
for (let i = 0, len = classList.length; i < len; i++) {
|
|
2585
|
-
const cls = classList[i];
|
|
2586
|
-
if (cls.indexOf('ag-theme-') === 0) {
|
|
2587
|
-
return cls;
|
|
2588
|
-
}
|
|
2589
|
-
}
|
|
2590
|
-
}
|
|
2591
|
-
return this.getAgGridLightThemeName();
|
|
2592
|
-
}
|
|
2593
|
-
getAgGridLightThemeName() {
|
|
2594
|
-
const container = this.getAgGridContainerElement();
|
|
2595
|
-
if (container && container.classList) {
|
|
2596
|
-
// we detect the ag theme class
|
|
2597
|
-
const classList = container.classList;
|
|
2598
|
-
for (let i = 0, len = classList.length; i < len; i++) {
|
|
2599
|
-
const cls = classList[i];
|
|
2600
|
-
if (cls.indexOf('ag-theme-') === 0) {
|
|
2601
|
-
// even if dark theme is included, we compute the light theme name out of it
|
|
2602
|
-
return cls.replace('-dark', '');
|
|
2603
|
-
}
|
|
2604
|
-
}
|
|
2605
|
-
}
|
|
2606
|
-
else {
|
|
2607
|
-
this.logger.warn('No AgGrid container found, defaulting to ag-theme-balham for the light theme');
|
|
2608
|
-
}
|
|
2609
|
-
this.logger.warn('No ag-theme- class found on the grid container, defaulting to ag-theme-balham');
|
|
2610
|
-
// fallback to the default light theme
|
|
2611
|
-
return 'ag-theme-balham';
|
|
2612
|
-
}
|
|
2613
2581
|
applyAdaptableTheme(theme) {
|
|
2614
2582
|
const container = this.getAgGridContainerElement();
|
|
2615
2583
|
if (container != null) {
|
|
@@ -2674,41 +2642,8 @@ You need to define at least one Layout!`);
|
|
|
2674
2642
|
else if (variantTheme) {
|
|
2675
2643
|
el.classList.add(`infinite-${variantTheme}`);
|
|
2676
2644
|
}
|
|
2677
|
-
// AG THEME
|
|
2678
|
-
|
|
2679
|
-
const getAgGridDarkThemeName = () => getAgGridLightThemeName() + '-dark';
|
|
2680
|
-
if (newTheme && (isSystemTheme || variantTheme)) {
|
|
2681
|
-
if ((variantTheme || themeName) === LIGHT_THEME) {
|
|
2682
|
-
newTheme.AgGridClassName = newTheme.AgGridClassName || getAgGridLightThemeName();
|
|
2683
|
-
}
|
|
2684
|
-
if ((variantTheme || themeName) === DARK_THEME) {
|
|
2685
|
-
newTheme.AgGridClassName = newTheme.AgGridClassName || getAgGridDarkThemeName();
|
|
2686
|
-
}
|
|
2687
|
-
}
|
|
2688
|
-
if (!newTheme.AgGridClassName) {
|
|
2689
|
-
// default AG Grid to its light theme
|
|
2690
|
-
newTheme.AgGridClassName = getAgGridLightThemeName();
|
|
2691
|
-
}
|
|
2692
|
-
if (container != null) {
|
|
2693
|
-
if (themesToRemove.length) {
|
|
2694
|
-
themesToRemove.forEach((theme) => {
|
|
2695
|
-
if (theme.AgGridClassName) {
|
|
2696
|
-
container.classList.remove(theme.AgGridClassName);
|
|
2697
|
-
}
|
|
2698
|
-
});
|
|
2699
|
-
}
|
|
2700
|
-
// also remove all AG Grid theme class names
|
|
2701
|
-
const agGridClassNamesToRemove = [];
|
|
2702
|
-
container.classList.forEach((x) => {
|
|
2703
|
-
if (x && x.indexOf('ag-theme-') === 0) {
|
|
2704
|
-
agGridClassNamesToRemove.push(x);
|
|
2705
|
-
}
|
|
2706
|
-
});
|
|
2707
|
-
agGridClassNamesToRemove.forEach((x) => container.classList.remove(x));
|
|
2708
|
-
if (newTheme && newTheme.AgGridClassName) {
|
|
2709
|
-
container.classList.add(newTheme.AgGridClassName);
|
|
2710
|
-
}
|
|
2711
|
-
}
|
|
2645
|
+
// Update AG THEME
|
|
2646
|
+
this.agGridThemeAdapter.applyAgGridThemeOnAdaptableThemeChange(newTheme, variantTheme, container, themesToRemove);
|
|
2712
2647
|
// MAC LIKE SCROLLBARS
|
|
2713
2648
|
if (this.adaptableOptions.userInterfaceOptions &&
|
|
2714
2649
|
this.adaptableOptions.userInterfaceOptions.useCustomMacLikeScrollbars &&
|
|
@@ -2902,6 +2837,8 @@ You need to define at least one Layout!`);
|
|
|
2902
2837
|
this.agGridColumnAdapter = null;
|
|
2903
2838
|
this.agGridExportAdapter?.destroy();
|
|
2904
2839
|
this.agGridExportAdapter = null;
|
|
2840
|
+
this.agGridThemeAdapter?.destroy();
|
|
2841
|
+
this.agGridThemeAdapter = null;
|
|
2905
2842
|
this.rowListeners = null;
|
|
2906
2843
|
this.emitter.destroy();
|
|
2907
2844
|
this.emitter = null;
|
|
@@ -3024,6 +2961,10 @@ You need to define at least one Layout!`);
|
|
|
3024
2961
|
};
|
|
3025
2962
|
this.agGridColumnAdapter.setupColumnHeader(colSetupInfo);
|
|
3026
2963
|
});
|
|
2964
|
+
// need to refresh the header,
|
|
2965
|
+
// as the Layout.ColumnHeaders state property is not implemented in the LayoutManager
|
|
2966
|
+
// and is specific to Adaptable, therefore we need to refresh it manually
|
|
2967
|
+
this.refreshHeader();
|
|
3027
2968
|
const layoutModel = layoutStateToLayoutModel(layout);
|
|
3028
2969
|
this.layoutManager?.setLayout(layoutModel, {
|
|
3029
2970
|
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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ColumnApiModule, } from 'ag-grid-enterprise';
|
|
2
2
|
import { ACTION_COLUMN_TYPE, CALCULATED_COLUMN_TYPE, FDC3_COLUMN_TYPE, FREE_TEXT_COLUMN_TYPE, } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
3
|
-
import { ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME } from '../Utilities/Constants/GeneralConstants';
|
|
3
|
+
import { ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME, } from '../Utilities/Constants/GeneralConstants';
|
|
4
4
|
import { createUuid } from '../PredefinedConfig/Uuid';
|
|
5
5
|
import ArrayExtensions from '../Utilities/Extensions/ArrayExtensions';
|
|
6
6
|
import * as ModuleConstants from '../Utilities/Constants/ModuleConstants';
|
|
@@ -96,7 +96,7 @@ export class AgGridAdapter {
|
|
|
96
96
|
// `context`
|
|
97
97
|
const passedContext = options.context;
|
|
98
98
|
if (passedContext) {
|
|
99
|
-
passedContext['__adaptable'] = self;
|
|
99
|
+
passedContext['__adaptable'] = self._adaptableInstance;
|
|
100
100
|
passedContext['adaptableApi'] = self.adaptableApi;
|
|
101
101
|
}
|
|
102
102
|
// we mutated the options array, so it's OK to use the 'arguments' object
|
|
@@ -367,10 +367,6 @@ export class AgGridAdapter {
|
|
|
367
367
|
}
|
|
368
368
|
return false;
|
|
369
369
|
}
|
|
370
|
-
// TODO AFL MIG rename to getFirstGroupedColumnId()
|
|
371
|
-
getFirstGroupedColumn() {
|
|
372
|
-
return this.getAgGridApi?.()?.getRowGroupColumns()?.[0]?.getColId();
|
|
373
|
-
}
|
|
374
370
|
createAdaptableColumnFromAgGridColumn(agGridColumn, colsToGroups) {
|
|
375
371
|
const colId = agGridColumn.getColId();
|
|
376
372
|
const colDef = agGridColumn.getColDef();
|
|
@@ -525,7 +521,7 @@ export class AgGridAdapter {
|
|
|
525
521
|
else if (Array.isArray(value)) {
|
|
526
522
|
const arrayDataType = ALL_ADAPTABLE_DATA_TYPES.find((arrayType) => {
|
|
527
523
|
const dataTypeDefinition = agGridDataTypeDefinitions[arrayType];
|
|
528
|
-
const dataTypeMatching = dataTypeDefinition
|
|
524
|
+
const dataTypeMatching = dataTypeDefinition?.dataTypeMatcher(value);
|
|
529
525
|
return dataTypeMatching;
|
|
530
526
|
});
|
|
531
527
|
if (arrayDataType) {
|
|
@@ -138,8 +138,6 @@ export class AgGridColumnAdapter {
|
|
|
138
138
|
this.setupColumnQuickFilerText(colSetupInfo);
|
|
139
139
|
this.setupColumnAllowedAggFuncs(colSetupInfo);
|
|
140
140
|
this.setupColumnType(colSetupInfo);
|
|
141
|
-
// this is just to make sure that AG Grid does NOT infer the cellDataType
|
|
142
|
-
// https://github.com/AdaptableTools/adaptable/issues/2230 should render it obsolete
|
|
143
141
|
this.setupColumnCellDataType(colSetupInfo);
|
|
144
142
|
});
|
|
145
143
|
}
|
|
@@ -375,8 +373,6 @@ export class AgGridColumnAdapter {
|
|
|
375
373
|
}
|
|
376
374
|
setupColumnCellDataType(columnSetupInfo) {
|
|
377
375
|
const { col } = columnSetupInfo;
|
|
378
|
-
// AG Grid introduced since v30.x an inferred cellDataType
|
|
379
|
-
// the problem is that it breaks the default value formatter and/or editor (especially for Date columns)
|
|
380
376
|
this.setColDefProperty(col, 'cellDataType', (original_cellDataType) => {
|
|
381
377
|
return original_cellDataType ?? true;
|
|
382
378
|
});
|
|
@@ -391,9 +387,6 @@ export class AgGridColumnAdapter {
|
|
|
391
387
|
if (layoutCustomHeader) {
|
|
392
388
|
resultHeaderName = layoutCustomHeader;
|
|
393
389
|
}
|
|
394
|
-
// required here for the initial layout rendering
|
|
395
|
-
// Removed by JW, 3 october 2023; i don't think we need it and it overrides stuff unnecessarily
|
|
396
|
-
abColumn.friendlyName = resultHeaderName;
|
|
397
390
|
return resultHeaderName;
|
|
398
391
|
});
|
|
399
392
|
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,122 @@
|
|
|
1
|
+
import { DARK_THEME, LIGHT_THEME } from '../Utilities/Constants/GeneralConstants';
|
|
2
|
+
export class AgGridThemeAdapter {
|
|
3
|
+
constructor(_adaptableInstance) {
|
|
4
|
+
this._adaptableInstance = _adaptableInstance;
|
|
5
|
+
}
|
|
6
|
+
destroy() { }
|
|
7
|
+
get logger() {
|
|
8
|
+
return this._adaptableInstance.logger;
|
|
9
|
+
}
|
|
10
|
+
get api() {
|
|
11
|
+
return this._adaptableInstance.api;
|
|
12
|
+
}
|
|
13
|
+
setAgGridThemeMode(themeMode) {
|
|
14
|
+
this.agGridThemeMode = themeMode;
|
|
15
|
+
}
|
|
16
|
+
getAgGridThemeMode() {
|
|
17
|
+
return this.agGridThemeMode;
|
|
18
|
+
}
|
|
19
|
+
applyAgGridThemeOnAdaptableThemeChange(adaptableTheme, variantTheme, agGridContainer, themesToRemove) {
|
|
20
|
+
if (this.agGridThemeMode === 'legacy') {
|
|
21
|
+
this.legacy_applyAgGridThemeOnAdaptableThemeChange(adaptableTheme, variantTheme, agGridContainer, themesToRemove);
|
|
22
|
+
}
|
|
23
|
+
const themeName = adaptableTheme.Name;
|
|
24
|
+
const isSystemTheme = this.api.themeApi.internalApi.isSystemTheme(themeName);
|
|
25
|
+
if (adaptableTheme && (isSystemTheme || variantTheme)) {
|
|
26
|
+
if ((variantTheme || themeName) === LIGHT_THEME) {
|
|
27
|
+
document.body.dataset.agThemeMode = 'light';
|
|
28
|
+
}
|
|
29
|
+
if ((variantTheme || themeName) === DARK_THEME) {
|
|
30
|
+
document.body.dataset.agThemeMode = 'dark';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
getAgGridContainerElement() {
|
|
35
|
+
return this._adaptableInstance.getAgGridContainerElement();
|
|
36
|
+
}
|
|
37
|
+
legacy_applyAgGridThemeOnAdaptableThemeChange(adaptableTheme, variantTheme, agGridContainer, themesToRemove) {
|
|
38
|
+
const themeName = adaptableTheme.Name;
|
|
39
|
+
const isSystemTheme = this.api.themeApi.internalApi.isSystemTheme(themeName);
|
|
40
|
+
const getAgGridLightThemeName = () => this.getAgGridLightThemeName();
|
|
41
|
+
const getAgGridDarkThemeName = () => getAgGridLightThemeName() + '-dark';
|
|
42
|
+
if (adaptableTheme && (isSystemTheme || variantTheme)) {
|
|
43
|
+
if ((variantTheme || themeName) === LIGHT_THEME) {
|
|
44
|
+
adaptableTheme.AgGridClassName =
|
|
45
|
+
adaptableTheme.AgGridClassName || getAgGridLightThemeName();
|
|
46
|
+
}
|
|
47
|
+
if ((variantTheme || themeName) === DARK_THEME) {
|
|
48
|
+
adaptableTheme.AgGridClassName = adaptableTheme.AgGridClassName || getAgGridDarkThemeName();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (!adaptableTheme.AgGridClassName) {
|
|
52
|
+
// default AG Grid to its light theme
|
|
53
|
+
adaptableTheme.AgGridClassName = getAgGridLightThemeName();
|
|
54
|
+
}
|
|
55
|
+
if (agGridContainer != null) {
|
|
56
|
+
if (themesToRemove.length) {
|
|
57
|
+
themesToRemove.forEach((theme) => {
|
|
58
|
+
if (theme.AgGridClassName) {
|
|
59
|
+
agGridContainer.classList.remove(theme.AgGridClassName);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
// also remove all AG Grid theme class names
|
|
64
|
+
const agGridClassNamesToRemove = [];
|
|
65
|
+
agGridContainer.classList.forEach((x) => {
|
|
66
|
+
if (x && x.indexOf('ag-theme-') === 0) {
|
|
67
|
+
agGridClassNamesToRemove.push(x);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
agGridClassNamesToRemove.forEach((x) => agGridContainer.classList.remove(x));
|
|
71
|
+
if (adaptableTheme && adaptableTheme.AgGridClassName) {
|
|
72
|
+
agGridContainer.classList.add(adaptableTheme.AgGridClassName);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
getAgGridCurrentThemeClassNames() {
|
|
77
|
+
if (this.agGridThemeMode === 'legacy') {
|
|
78
|
+
this.legacy_getAgGridCurrentThemeClassNames();
|
|
79
|
+
}
|
|
80
|
+
const currentAgGridTheme = this._adaptableInstance.agGridAdapter.getGridOption('theme');
|
|
81
|
+
if (currentAgGridTheme === 'legacy') {
|
|
82
|
+
return this.legacy_getAgGridCurrentThemeClassNames();
|
|
83
|
+
}
|
|
84
|
+
// @ts-ignore no other way than to use internals
|
|
85
|
+
const currentAgGridTheme__cssClassCache = currentAgGridTheme?._cssClassCache;
|
|
86
|
+
return currentAgGridTheme__cssClassCache ?? '';
|
|
87
|
+
}
|
|
88
|
+
getAgGridLightThemeName() {
|
|
89
|
+
const container = this.getAgGridContainerElement();
|
|
90
|
+
if (container && container.classList) {
|
|
91
|
+
// we detect the ag theme class
|
|
92
|
+
const classList = container.classList;
|
|
93
|
+
for (let i = 0, len = classList.length; i < len; i++) {
|
|
94
|
+
const cls = classList[i];
|
|
95
|
+
if (cls.indexOf('ag-theme-') === 0) {
|
|
96
|
+
// even if dark theme is included, we compute the light theme name out of it
|
|
97
|
+
return cls.replace('-dark', '');
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
this.logger.warn('No AgGrid container found, defaulting to ag-theme-balham for the light theme');
|
|
103
|
+
}
|
|
104
|
+
this.logger.warn('No ag-theme- class found on the grid container, defaulting to ag-theme-balham');
|
|
105
|
+
// fallback to the default light theme
|
|
106
|
+
return 'ag-theme-balham';
|
|
107
|
+
}
|
|
108
|
+
legacy_getAgGridCurrentThemeClassNames() {
|
|
109
|
+
const container = this.getAgGridContainerElement();
|
|
110
|
+
if (container && container.classList) {
|
|
111
|
+
// we detect the ag theme class
|
|
112
|
+
const classList = container.classList;
|
|
113
|
+
for (let i = 0, len = classList.length; i < len; i++) {
|
|
114
|
+
const cls = classList[i];
|
|
115
|
+
if (cls.indexOf('ag-theme-') === 0) {
|
|
116
|
+
return cls;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return this.getAgGridLightThemeName();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -4,7 +4,7 @@ const useAgGridClassName = (deps = []) => {
|
|
|
4
4
|
const adaptable = useAdaptable();
|
|
5
5
|
return useMemo(() => {
|
|
6
6
|
if (adaptable) {
|
|
7
|
-
return adaptable.
|
|
7
|
+
return adaptable.agGridThemeAdapter.getAgGridCurrentThemeClassNames();
|
|
8
8
|
}
|
|
9
9
|
return '';
|
|
10
10
|
}, deps);
|
package/src/env.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
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" || '',
|
|
3
|
-
PUBLISH_TIMESTAMP:
|
|
4
|
-
VERSION: "20.0.0-canary.
|
|
3
|
+
PUBLISH_TIMESTAMP: 1741253338614 || Date.now(),
|
|
4
|
+
VERSION: "20.0.0-canary.6" || '--current-version--',
|
|
5
5
|
};
|
|
@@ -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;
|