@adaptabletools/adaptable-cjs 22.0.0-canary.7 → 22.0.0-canary.9
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/agGrid.d.ts +9 -9
- package/agGrid.js +1 -0
- package/index.css +63 -71
- package/index.css.map +1 -1
- package/index.d.ts +66 -0
- package/index.js +85 -0
- package/package.json +3 -3
- package/src/AdaptableInterfaces/IAdaptable.d.ts +6 -6
- package/src/AdaptableOptions/ColumnOptions.d.ts +2 -2
- package/src/AdaptableOptions/ContainerOptions.d.ts +55 -15
- package/src/AdaptableState/AdaptableState.d.ts +2 -0
- package/src/AdaptableState/Common/AdaptableColumn.d.ts +10 -10
- package/src/AdaptableState/Common/AdaptableColumnContext.d.ts +9 -0
- package/src/AdaptableState/Common/AdaptableRowContext.d.ts +11 -0
- package/src/AdaptableState/Common/AdaptableRowContext.js +2 -0
- package/src/AdaptableState/Common/DataUpdateConfig.d.ts +7 -0
- package/src/AdaptableState/Common/TransposeConfig.d.ts +11 -9
- package/src/AdaptableState/InitialState.d.ts +9 -0
- package/src/AdaptableState/LayoutState.d.ts +1 -2
- package/src/AdaptableState/UserInterfaceState.d.ts +14 -0
- package/src/AdaptableState/UserInterfaceState.js +2 -0
- package/src/Api/GridApi.d.ts +5 -9
- package/src/Api/Implementation/AlertApiImpl.js +2 -6
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -1
- package/src/Api/Implementation/GridApiImpl.d.ts +2 -6
- package/src/Api/Implementation/GridApiImpl.js +9 -9
- package/src/Api/Implementation/LayoutApiImpl.d.ts +1 -0
- package/src/Api/Implementation/LayoutApiImpl.js +3 -0
- package/src/Api/Implementation/SystemStatusApiImpl.js +2 -5
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +5 -0
- package/src/Api/Implementation/UserInterfaceApiImpl.js +13 -0
- package/src/Api/LayoutApi.d.ts +6 -0
- package/src/Api/UserInterfaceApi.d.ts +17 -0
- package/src/Redux/ActionsReducers/UserInterfaceRedux.d.ts +11 -0
- package/src/Redux/ActionsReducers/UserInterfaceRedux.js +26 -0
- package/src/Redux/Store/AdaptableStore.js +27 -0
- package/src/Utilities/resolveContainerElement.d.ts +23 -0
- package/src/Utilities/resolveContainerElement.js +47 -0
- package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +2 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupBody.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +1 -8
- package/src/View/Components/Popups/WindowPopups/WindowPopups.js +35 -0
- package/src/View/Components/WizardSummaryPage.js +1 -1
- package/src/View/Dashboard/CustomToolbar.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryViewPanel.js +1 -1
- package/src/View/Layout/TransposedPopup.js +144 -138
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReminder.js +1 -1
- package/src/View/UIHelper.d.ts +2 -1
- package/src/View/UIHelper.js +8 -14
- package/src/agGrid/Adaptable.js +11 -11
- package/src/agGrid/AdaptableAgGrid.d.ts +12 -8
- package/src/agGrid/AdaptableAgGrid.js +112 -31
- package/src/agGrid/AgGridFloatingFilterAdapter.js +1 -1
- package/src/agGrid/AgGridMenuAdapter.js +9 -1
- package/src/components/CheckBox/index.js +1 -1
- package/src/components/Dropdown/Arrows.js +1 -1
- package/src/components/ExpressionEditor/DataTableEditor.js +3 -3
- package/src/components/FormLayout/index.js +1 -1
- package/src/components/Select/Select.js +1 -1
- package/src/components/Tree/TreeDropdown/index.js +1 -1
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +62 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +6 -3
- package/themes/dark.css +30 -29
- package/themes/light.css +4 -2
- package/tsconfig.cjs.tsbuildinfo +1 -1
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -9,6 +9,7 @@ const AdaptableAgGrid_1 = require("./AdaptableAgGrid");
|
|
|
9
9
|
const DefaultAdaptableOptions_1 = require("../AdaptableOptions/DefaultAdaptableOptions");
|
|
10
10
|
const renderReactRoot_1 = require("../renderReactRoot");
|
|
11
11
|
const AdaptableWizardView_1 = tslib_1.__importDefault(require("../View/AdaptableWizardView"));
|
|
12
|
+
const resolveContainerElement_1 = require("../Utilities/resolveContainerElement");
|
|
12
13
|
class Adaptable {
|
|
13
14
|
/**
|
|
14
15
|
* Initializer for Adaptable
|
|
@@ -44,19 +45,18 @@ class AdaptableNoCodeWizard {
|
|
|
44
45
|
this.render();
|
|
45
46
|
}
|
|
46
47
|
render(container) {
|
|
47
|
-
let id = (0, DefaultAdaptableOptions_1.getDefaultAdaptableOptions)().containerOptions.adaptableContainer || 'adaptable';
|
|
48
48
|
if (!container) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
const initContext = {
|
|
50
|
+
adaptableId: this.adaptableOptions?.adaptableId ?? '',
|
|
51
|
+
adaptableStateKey: this.adaptableOptions?.adaptableStateKey ?? '',
|
|
52
|
+
adaptableContext: this.adaptableOptions?.adaptableContext,
|
|
53
|
+
};
|
|
54
|
+
container = (0, resolveContainerElement_1.resolveContainerElement)(this.adaptableOptions.containerOptions?.adaptableContainer, initContext);
|
|
55
|
+
}
|
|
56
|
+
if (!container) {
|
|
57
|
+
const defaultId = (0, DefaultAdaptableOptions_1.getDefaultAdaptableOptions)().containerOptions.adaptableContainer || 'adaptable';
|
|
58
|
+
container = document.getElementById(defaultId);
|
|
58
59
|
}
|
|
59
|
-
container = container || document.getElementById(id);
|
|
60
60
|
if (!container) {
|
|
61
61
|
throw new Error('Cannot find container in which to render Adaptable No Code Wizard');
|
|
62
62
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AdaptableOptions } from '../AdaptableOptions/AdaptableOptions';
|
|
2
|
-
import { ChartRef, Column, GridApi, GridOptions, IRowNode, Module, RowModelType } from 'ag-grid-enterprise';
|
|
2
|
+
import { ChartRef, Column, GridApi, GridOptions, IRowNode, Module, RowModelType, StatusPanelDef } from 'ag-grid-enterprise';
|
|
3
3
|
import { AdaptableLogger } from './AdaptableLogger';
|
|
4
4
|
import { AdaptableApi, DestroyConfig } from '../Api/AdaptableApi';
|
|
5
5
|
import { AdaptableVariant, IAdaptable, NormalizeAdaptableStateOptions } from '../AdaptableInterfaces/IAdaptable';
|
|
@@ -20,7 +20,7 @@ import { Fdc3Service } from '../Utilities/Services/Fdc3Service';
|
|
|
20
20
|
import { AnnotationsService } from '../Utilities/Services/AnnotationsService';
|
|
21
21
|
import { IModuleCollection } from '../Strategy/Interface/IModule';
|
|
22
22
|
import { AgGridMenuAdapter } from './AgGridMenuAdapter';
|
|
23
|
-
import { AdaptableColumn, AdaptableTheme, ChartDefinition, ColumnSort, DataUpdateConfig, GridCell, InFilterValueResult, Layout, SelectedCellInfo, SelectedRowInfo } from '../types';
|
|
23
|
+
import { AdaptableColumn, AdaptableTheme, ChartDefinition, ColumnSort, DataRowConfig, DataUpdateConfig, GridCell, InFilterValueResult, Layout, SelectedCellInfo, SelectedRowInfo } from '../types';
|
|
24
24
|
import { RenderReactRootFn } from '../renderReactRoot';
|
|
25
25
|
import { AgGridOptionsService } from './AgGridOptionsService';
|
|
26
26
|
import { AgGridColumnAdapter } from './AgGridColumnAdapter';
|
|
@@ -119,6 +119,8 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
119
119
|
* Temporary, these are MIGRATION technical debts, and should be removed as soon as possible
|
|
120
120
|
*/
|
|
121
121
|
private adaptableStatusPanelKeys;
|
|
122
|
+
private adaptableStatusPanelDefs;
|
|
123
|
+
hasAdaptableStatusBar: boolean;
|
|
122
124
|
_PRIVATE_adaptableJSXElement: React.JSX.Element;
|
|
123
125
|
private _prevLayout;
|
|
124
126
|
private __prevLayoutForRefresh;
|
|
@@ -163,6 +165,11 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
163
165
|
private refreshInitialSortIfNeeded;
|
|
164
166
|
showQuickFilter(): void;
|
|
165
167
|
hideQuickFilter(): void;
|
|
168
|
+
showAdaptableToolPanel(): void;
|
|
169
|
+
hideAdaptableToolPanel(): void;
|
|
170
|
+
private buildAdaptableToolPanelDef;
|
|
171
|
+
showAdaptableStatusBar(): void;
|
|
172
|
+
hideAdaptableStatusBar(): void;
|
|
166
173
|
private normalizeAdaptableOptions;
|
|
167
174
|
private setInitialGridOptions;
|
|
168
175
|
/**
|
|
@@ -170,6 +177,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
170
177
|
*/
|
|
171
178
|
private initializeAgGrid;
|
|
172
179
|
useRowNodeLookUp(): boolean;
|
|
180
|
+
private buildInitContainerContext;
|
|
173
181
|
getAgGridContainerElement(): HTMLElement | null;
|
|
174
182
|
getAdaptableContainerElement(): HTMLElement;
|
|
175
183
|
refreshSelectedCellsState(): SelectedCellInfo | undefined;
|
|
@@ -257,11 +265,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
257
265
|
added: IRowNode[];
|
|
258
266
|
updated: IRowNode[];
|
|
259
267
|
}>;
|
|
260
|
-
manageGridRows(
|
|
261
|
-
add?: any[];
|
|
262
|
-
update?: any[];
|
|
263
|
-
delete?: any[];
|
|
264
|
-
}, config?: DataUpdateConfig): Promise<{
|
|
268
|
+
manageGridRows(dataRowConfig: DataRowConfig, dataUpdateConfig?: DataUpdateConfig): Promise<{
|
|
265
269
|
addedRows: IRowNode[];
|
|
266
270
|
updatedRows: IRowNode[];
|
|
267
271
|
removedRows: IRowNode[];
|
|
@@ -292,7 +296,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
292
296
|
getGridCellsForColumn(columnId: string, onlyVisibleRows?: boolean): GridCell[] | undefined;
|
|
293
297
|
getRowNodesForPrimaryKeys(primaryKeyValues: any[]): any[];
|
|
294
298
|
getRowNodeByIndex(index: number): IRowNode;
|
|
295
|
-
getAgGridStatusPanels():
|
|
299
|
+
getAgGridStatusPanels(): StatusPanelDef[];
|
|
296
300
|
setDataValue(value: any, column: AdaptableColumn, primaryKeyValue: any, rowNode?: IRowNode): void;
|
|
297
301
|
forAllRowNodesDo(func: (rowNode: IRowNode, rowIndex: number) => void, config?: {
|
|
298
302
|
includeGroupRows?: boolean;
|
|
@@ -10,6 +10,7 @@ const DocumentationLinkConstants_1 = require("../Utilities/Constants/Documentati
|
|
|
10
10
|
const StringExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/StringExtensions"));
|
|
11
11
|
const Emitter_1 = tslib_1.__importDefault(require("../Utilities/Emitter"));
|
|
12
12
|
const DefaultAdaptableOptions_1 = require("../AdaptableOptions/DefaultAdaptableOptions");
|
|
13
|
+
const resolveContainerElement_1 = require("../Utilities/resolveContainerElement");
|
|
13
14
|
const AgGridAdapter_1 = require("./AgGridAdapter");
|
|
14
15
|
const GeneralConstants = tslib_1.__importStar(require("../Utilities/Constants/GeneralConstants"));
|
|
15
16
|
const GeneralConstants_1 = require("../Utilities/Constants/GeneralConstants");
|
|
@@ -225,6 +226,8 @@ class AdaptableAgGrid {
|
|
|
225
226
|
* Temporary, these are MIGRATION technical debts, and should be removed as soon as possible
|
|
226
227
|
*/
|
|
227
228
|
adaptableStatusPanelKeys = [];
|
|
229
|
+
adaptableStatusPanelDefs = [];
|
|
230
|
+
hasAdaptableStatusBar;
|
|
228
231
|
// see #no_additional_react_root
|
|
229
232
|
_PRIVATE_adaptableJSXElement;
|
|
230
233
|
_prevLayout;
|
|
@@ -759,6 +762,82 @@ class AdaptableAgGrid {
|
|
|
759
762
|
hideQuickFilter() {
|
|
760
763
|
this.agGridAdapter.getAgGridApi().setGridOption('floatingFiltersHeight', 0);
|
|
761
764
|
}
|
|
765
|
+
showAdaptableToolPanel() {
|
|
766
|
+
if (!this.hasAdaptableToolPanel) {
|
|
767
|
+
// don't re-add the ToolPanel if it's hidden by entitlement
|
|
768
|
+
if (this.api.entitlementApi.isModuleHiddenEntitlement('ToolPanel')) {
|
|
769
|
+
return;
|
|
770
|
+
}
|
|
771
|
+
const currentSideBar = this.agGridAdapter.getGridOption('sideBar');
|
|
772
|
+
if (currentSideBar?.toolPanels) {
|
|
773
|
+
const updatedSideBar = {
|
|
774
|
+
...currentSideBar,
|
|
775
|
+
toolPanels: [...currentSideBar.toolPanels, this.buildAdaptableToolPanelDef()],
|
|
776
|
+
};
|
|
777
|
+
this.agGridAdapter.setGridOption('sideBar', updatedSideBar);
|
|
778
|
+
this.hasAdaptableToolPanel = true;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
hideAdaptableToolPanel() {
|
|
783
|
+
if (this.hasAdaptableToolPanel) {
|
|
784
|
+
// close the tool panel if it's currently open
|
|
785
|
+
this.api.toolPanelApi.closeAdapTableToolPanel();
|
|
786
|
+
const currentSideBar = this.agGridAdapter.getGridOption('sideBar');
|
|
787
|
+
if (currentSideBar?.toolPanels) {
|
|
788
|
+
const updatedSideBar = {
|
|
789
|
+
...currentSideBar,
|
|
790
|
+
toolPanels: currentSideBar.toolPanels.filter((toolPanelDef) => {
|
|
791
|
+
if (typeof toolPanelDef === 'string') {
|
|
792
|
+
return toolPanelDef !== GeneralConstants.ADAPTABLE_TOOLPANEL_ID;
|
|
793
|
+
}
|
|
794
|
+
return toolPanelDef.id !== GeneralConstants.ADAPTABLE_TOOLPANEL_ID;
|
|
795
|
+
}),
|
|
796
|
+
};
|
|
797
|
+
this.agGridAdapter.setGridOption('sideBar', updatedSideBar);
|
|
798
|
+
}
|
|
799
|
+
this.hasAdaptableToolPanel = false;
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
buildAdaptableToolPanelDef() {
|
|
803
|
+
return {
|
|
804
|
+
id: GeneralConstants.ADAPTABLE_TOOLPANEL_ID,
|
|
805
|
+
toolPanel: GeneralConstants.ADAPTABLE_TOOLPANEL_COMPONENT,
|
|
806
|
+
labelDefault: GeneralConstants.ADAPTABLE,
|
|
807
|
+
labelKey: 'adaptable',
|
|
808
|
+
iconKey: 'menu',
|
|
809
|
+
width: UIHelper_1.default.getAdaptableToolPanelWidth(),
|
|
810
|
+
minWidth: UIHelper_1.default.getAdaptableToolPanelWidth(),
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
showAdaptableStatusBar() {
|
|
814
|
+
if (!this.hasAdaptableStatusBar && this.adaptableStatusPanelDefs.length > 0) {
|
|
815
|
+
const currentStatusBar = this.agGridAdapter.getGridOption('statusBar');
|
|
816
|
+
if (currentStatusBar) {
|
|
817
|
+
// filter out any Adaptable panels that may already exist to avoid duplicates
|
|
818
|
+
const existingNonAdaptablePanels = (currentStatusBar.statusPanels ?? []).filter((panel) => !this.adaptableStatusPanelKeys.includes(panel.key));
|
|
819
|
+
const updatedStatusBar = {
|
|
820
|
+
...currentStatusBar,
|
|
821
|
+
statusPanels: [...existingNonAdaptablePanels, ...this.adaptableStatusPanelDefs],
|
|
822
|
+
};
|
|
823
|
+
this.agGridAdapter.setGridOption('statusBar', updatedStatusBar);
|
|
824
|
+
this.hasAdaptableStatusBar = true;
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
hideAdaptableStatusBar() {
|
|
829
|
+
if (this.hasAdaptableStatusBar) {
|
|
830
|
+
const currentStatusBar = this.agGridAdapter.getGridOption('statusBar');
|
|
831
|
+
if (currentStatusBar?.statusPanels) {
|
|
832
|
+
const updatedStatusBar = {
|
|
833
|
+
...currentStatusBar,
|
|
834
|
+
statusPanels: currentStatusBar.statusPanels.filter((panel) => !this.adaptableStatusPanelKeys.includes(panel.key)),
|
|
835
|
+
};
|
|
836
|
+
this.agGridAdapter.setGridOption('statusBar', updatedStatusBar);
|
|
837
|
+
}
|
|
838
|
+
this.hasAdaptableStatusBar = false;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
762
841
|
normalizeAdaptableOptions(adaptableOptions) {
|
|
763
842
|
if (this.hasAutogeneratedPrimaryKey) {
|
|
764
843
|
this.logger.warn(`Autogenerated primary key is enabled (adaptableOptions.autogeneratedPrimaryKey = true). This should be a last resort as it limits some Adaptable features. See: ${DocumentationLinkConstants_1.PrimaryKeyDocsLink}`);
|
|
@@ -1161,16 +1240,7 @@ class AdaptableAgGrid {
|
|
|
1161
1240
|
return original_sideBar;
|
|
1162
1241
|
}
|
|
1163
1242
|
const isAdaptableToolPanelHidden = this.api.entitlementApi.isModuleHiddenEntitlement('ToolPanel');
|
|
1164
|
-
const adaptableToolPanelDef =
|
|
1165
|
-
id: GeneralConstants.ADAPTABLE_TOOLPANEL_ID,
|
|
1166
|
-
toolPanel: GeneralConstants.ADAPTABLE_TOOLPANEL_COMPONENT,
|
|
1167
|
-
labelDefault: GeneralConstants.ADAPTABLE,
|
|
1168
|
-
labelKey: 'adaptable',
|
|
1169
|
-
iconKey: 'menu',
|
|
1170
|
-
width: UIHelper_1.default.getAdaptableToolPanelWidth(),
|
|
1171
|
-
minWidth: UIHelper_1.default.getAdaptableToolPanelWidth(),
|
|
1172
|
-
// maxWidth = undefined,
|
|
1173
|
-
};
|
|
1243
|
+
const adaptableToolPanelDef = this.buildAdaptableToolPanelDef();
|
|
1174
1244
|
const mapToolPanelDefs = (toolPanelDefs = []) => {
|
|
1175
1245
|
// if it's an alias for the adaptable tool panel, map it to a ToolPanelDef, otherwise return it as it is
|
|
1176
1246
|
return toolPanelDefs.map((toolPanelDef) => toolPanelDef === GeneralConstants.ADAPTABLE_TOOLPANEL_ID
|
|
@@ -1245,19 +1315,29 @@ class AdaptableAgGrid {
|
|
|
1245
1315
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'statusBar', (original_statusBar) => {
|
|
1246
1316
|
const statusPanels = (original_statusBar?.statusPanels ?? [])?.map((statusPanel) => {
|
|
1247
1317
|
if (statusPanel.statusPanel === StatusBarState_1.ADAPTABLE_STATUS_PANEL) {
|
|
1318
|
+
if (!statusPanel.key) {
|
|
1319
|
+
this.logger.consoleWarn('AdaptableStatusPanel is missing a "key" property. This panel will not be managed by HideAdaptableUI. Please provide a unique key.');
|
|
1320
|
+
return statusPanel;
|
|
1321
|
+
}
|
|
1248
1322
|
this.adaptableStatusPanelKeys.push(statusPanel.key);
|
|
1249
1323
|
const context = {
|
|
1250
1324
|
Key: statusPanel.key,
|
|
1251
1325
|
};
|
|
1252
|
-
|
|
1326
|
+
const adaptablePanelDef = {
|
|
1253
1327
|
...statusPanel,
|
|
1254
1328
|
statusPanel: (0, createAgStatusPanelComponent_1.createAgStatusPanelComponent)(AdaptableStatusBar_1.AdaptableStatusBar, this, context),
|
|
1255
1329
|
};
|
|
1330
|
+
this.adaptableStatusPanelDefs.push(adaptablePanelDef);
|
|
1331
|
+
return adaptablePanelDef;
|
|
1256
1332
|
}
|
|
1257
1333
|
return statusPanel;
|
|
1258
1334
|
});
|
|
1259
1335
|
return { ...original_statusBar, statusPanels };
|
|
1260
1336
|
});
|
|
1337
|
+
this.hasAdaptableStatusBar = this.adaptableStatusPanelKeys.length > 0;
|
|
1338
|
+
}
|
|
1339
|
+
else {
|
|
1340
|
+
this.hasAdaptableStatusBar = false;
|
|
1261
1341
|
}
|
|
1262
1342
|
/**
|
|
1263
1343
|
* `getRowStyle`
|
|
@@ -1445,21 +1525,22 @@ class AdaptableAgGrid {
|
|
|
1445
1525
|
useRowNodeLookUp() {
|
|
1446
1526
|
return this.agGridAdapter.getAgGridApi().getGridOption('getRowId') != undefined;
|
|
1447
1527
|
}
|
|
1528
|
+
buildInitContainerContext() {
|
|
1529
|
+
return {
|
|
1530
|
+
adaptableId: this.adaptableOptions?.adaptableId ?? '',
|
|
1531
|
+
adaptableStateKey: this.adaptableOptions?.adaptableStateKey ?? '',
|
|
1532
|
+
adaptableContext: this.adaptableOptions?.adaptableContext,
|
|
1533
|
+
};
|
|
1534
|
+
}
|
|
1448
1535
|
getAgGridContainerElement() {
|
|
1449
1536
|
if (!this.DANGER_USE_GETTER_agGridContainerElement) {
|
|
1450
|
-
this.DANGER_USE_GETTER_agGridContainerElement =
|
|
1451
|
-
typeof this.adaptableOptions?.containerOptions?.agGridContainer === 'string'
|
|
1452
|
-
? document.getElementById(this.adaptableOptions?.containerOptions?.agGridContainer)
|
|
1453
|
-
: this.adaptableOptions?.containerOptions?.agGridContainer;
|
|
1537
|
+
this.DANGER_USE_GETTER_agGridContainerElement = (0, resolveContainerElement_1.resolveContainerElement)(this.adaptableOptions?.containerOptions?.agGridContainer, this.buildInitContainerContext());
|
|
1454
1538
|
}
|
|
1455
1539
|
return this.DANGER_USE_GETTER_agGridContainerElement;
|
|
1456
1540
|
}
|
|
1457
1541
|
getAdaptableContainerElement() {
|
|
1458
1542
|
if (!this.DANGER_USE_GETTER_adaptableContainerElement) {
|
|
1459
|
-
this.DANGER_USE_GETTER_adaptableContainerElement =
|
|
1460
|
-
typeof this.adaptableOptions?.containerOptions?.adaptableContainer === 'string'
|
|
1461
|
-
? document.getElementById(this.adaptableOptions?.containerOptions?.adaptableContainer)
|
|
1462
|
-
: this.adaptableOptions?.containerOptions?.adaptableContainer;
|
|
1543
|
+
this.DANGER_USE_GETTER_adaptableContainerElement = (0, resolveContainerElement_1.resolveContainerElement)(this.adaptableOptions?.containerOptions?.adaptableContainer, this.buildInitContainerContext());
|
|
1463
1544
|
}
|
|
1464
1545
|
return this.DANGER_USE_GETTER_adaptableContainerElement;
|
|
1465
1546
|
}
|
|
@@ -2458,31 +2539,31 @@ class AdaptableAgGrid {
|
|
|
2458
2539
|
});
|
|
2459
2540
|
}
|
|
2460
2541
|
}
|
|
2461
|
-
async manageGridRows(
|
|
2542
|
+
async manageGridRows(dataRowConfig, dataUpdateConfig = {}) {
|
|
2462
2543
|
const result = {
|
|
2463
2544
|
addedRows: [],
|
|
2464
2545
|
updatedRows: [],
|
|
2465
2546
|
removedRows: [],
|
|
2466
2547
|
};
|
|
2467
|
-
if (!dataRows) {
|
|
2548
|
+
if (!dataRowConfig || !dataRowConfig.dataRows) {
|
|
2468
2549
|
return result;
|
|
2469
2550
|
}
|
|
2470
|
-
const addDataRows = dataRows.add;
|
|
2471
|
-
const updateDataRows = dataRows.update;
|
|
2472
|
-
const removeDataRows = dataRows.delete;
|
|
2551
|
+
const addDataRows = dataRowConfig.dataRows.add;
|
|
2552
|
+
const updateDataRows = dataRowConfig.dataRows.update;
|
|
2553
|
+
const removeDataRows = dataRowConfig.dataRows.delete;
|
|
2473
2554
|
if (this.hasAutogeneratedPrimaryKey) {
|
|
2474
2555
|
this.addSyntheticPrimaryKeyIfMissing(addDataRows);
|
|
2475
2556
|
}
|
|
2476
|
-
if (
|
|
2557
|
+
if (dataUpdateConfig.runAsync) {
|
|
2477
2558
|
return new Promise((resolve) => {
|
|
2478
2559
|
this.applyAgGridTransactionAsync({
|
|
2479
2560
|
update: updateDataRows,
|
|
2480
2561
|
add: addDataRows,
|
|
2481
2562
|
remove: removeDataRows,
|
|
2482
|
-
addIndex:
|
|
2563
|
+
addIndex: dataUpdateConfig.addIndex,
|
|
2483
2564
|
}, (transaction) => {
|
|
2484
|
-
if (typeof
|
|
2485
|
-
|
|
2565
|
+
if (typeof dataUpdateConfig.callback === 'function') {
|
|
2566
|
+
dataUpdateConfig.callback(transaction);
|
|
2486
2567
|
}
|
|
2487
2568
|
if (transaction?.add) {
|
|
2488
2569
|
this.updateRowGroupsAndColumnGroupsExpandedState();
|
|
@@ -2493,7 +2574,7 @@ class AdaptableAgGrid {
|
|
|
2493
2574
|
removedRows: transaction?.remove,
|
|
2494
2575
|
});
|
|
2495
2576
|
});
|
|
2496
|
-
if (
|
|
2577
|
+
if (dataUpdateConfig.flushAsync) {
|
|
2497
2578
|
this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
|
|
2498
2579
|
}
|
|
2499
2580
|
});
|
|
@@ -2503,12 +2584,12 @@ class AdaptableAgGrid {
|
|
|
2503
2584
|
update: updateDataRows,
|
|
2504
2585
|
add: addDataRows,
|
|
2505
2586
|
remove: removeDataRows,
|
|
2506
|
-
addIndex:
|
|
2587
|
+
addIndex: dataUpdateConfig.addIndex,
|
|
2507
2588
|
});
|
|
2508
2589
|
if (transaction?.add) {
|
|
2509
2590
|
this.updateRowGroupsAndColumnGroupsExpandedState();
|
|
2510
2591
|
}
|
|
2511
|
-
if (
|
|
2592
|
+
if (dataUpdateConfig.flushAsync) {
|
|
2512
2593
|
this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
|
|
2513
2594
|
}
|
|
2514
2595
|
return Promise.resolve({
|
|
@@ -58,7 +58,7 @@ const AgGridFloatingFilterAdapterFactory = (adaptable) => {
|
|
|
58
58
|
// Find and update header cell
|
|
59
59
|
const headerCell = findParentWithClass(filterContainer, 'ag-header-cell', stopClasses);
|
|
60
60
|
if (headerCell?.classList.contains('ag-floating-filter')) {
|
|
61
|
-
headerCell.style.padding = 'var(--ab-space
|
|
61
|
+
headerCell.style.padding = 'var(--ab-base-space)';
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
return class AgGridFloatingFilterAdapter {
|
|
@@ -21,12 +21,16 @@ class AgGridMenuAdapter {
|
|
|
21
21
|
this._adaptableInstance = null;
|
|
22
22
|
}
|
|
23
23
|
buildColumnMenu(params, originalGetMainMenuItems) {
|
|
24
|
-
const columnMenuOptions = this.adaptableOptions.columnMenuOptions;
|
|
25
24
|
const agGridMenuItems = (params.defaultItems ? [...params.defaultItems] : []);
|
|
26
25
|
if (!params.column) {
|
|
27
26
|
// return only AG Grid context if the Adaptable column is not found (should not happen)
|
|
28
27
|
return agGridMenuItems;
|
|
29
28
|
}
|
|
29
|
+
// If Adaptable UI is hidden, return only AG Grid default items
|
|
30
|
+
if (!this.adaptableApi.userInterfaceApi.isAdaptableUIVisible()) {
|
|
31
|
+
return agGridMenuItems;
|
|
32
|
+
}
|
|
33
|
+
const columnMenuOptions = this.adaptableOptions.columnMenuOptions;
|
|
30
34
|
const adaptableColumn = this.adaptableApi.columnApi.getColumnWithColumnId(params.column?.getColId());
|
|
31
35
|
const menuContext = this.createColumnMenuContextObject(adaptableColumn, params.column);
|
|
32
36
|
/**
|
|
@@ -64,6 +68,10 @@ class AgGridMenuAdapter {
|
|
|
64
68
|
if (!params.column) {
|
|
65
69
|
return [];
|
|
66
70
|
}
|
|
71
|
+
// If Adaptable UI is hidden, return only AG Grid default items
|
|
72
|
+
if (!this.adaptableApi.userInterfaceApi.isAdaptableUIVisible()) {
|
|
73
|
+
return (params.defaultItems ? [...params.defaultItems] : []);
|
|
74
|
+
}
|
|
67
75
|
// we do this in order to refresh the internal state of selected cells (technically query the AG Grid cellRanges)
|
|
68
76
|
// (right-click selected the current cell, but this was not reflected in the internal state of the selected cells)
|
|
69
77
|
this._adaptableInstance.refreshSelectedCellsState();
|
|
@@ -9,7 +9,7 @@ const clsx_1 = tslib_1.__importDefault(require("clsx"));
|
|
|
9
9
|
const Square = (props) => {
|
|
10
10
|
return React.createElement("div", { className: `ab-CheckBox__square ab-CheckBox__square--${props.type}` });
|
|
11
11
|
};
|
|
12
|
-
const CheckBox = ({ children, checked, onChange, value, name, disabled, readOnly, variant = 'default', gapDistance = 'var(--ab-space
|
|
12
|
+
const CheckBox = ({ children, checked, onChange, value, name, disabled, readOnly, variant = 'default', gapDistance = 'var(--ab-base-space)', childrenPosition = 'end', as = 'label', ...props }) => {
|
|
13
13
|
const [stateChecked, setStateChecked] = (0, react_1.useState)(false);
|
|
14
14
|
const computedChecked = checked !== undefined ? checked : stateChecked;
|
|
15
15
|
const onInputChange = (event) => {
|
|
@@ -11,7 +11,7 @@ const Arrows = () => {
|
|
|
11
11
|
// background: 'var(--ab-color-defaultbackground)',
|
|
12
12
|
fill: 'var(--ab-cmp-dropdown__fill)',
|
|
13
13
|
top: '50%',
|
|
14
|
-
right: 'var(--ab-space
|
|
14
|
+
right: 'var(--ab-base-space)',
|
|
15
15
|
transform: 'translate3d(0px, -50%, 0px)',
|
|
16
16
|
cursor: 'pointer',
|
|
17
17
|
} },
|
|
@@ -39,11 +39,11 @@ const DataTableEditor = ({ fields, dataFormatter, data: initialData, type = 'col
|
|
|
39
39
|
hasFriendlyNames && (React.createElement(CheckBox_1.CheckBox, { checked: showColumnIds, onChange: (checked) => setShowValues(checked), style: {
|
|
40
40
|
float: 'right',
|
|
41
41
|
margin: 0,
|
|
42
|
-
paddingTop: 'var(--ab-space
|
|
43
|
-
paddingBottom: 'var(--ab-space
|
|
42
|
+
paddingTop: 'var(--ab-base-space)',
|
|
43
|
+
paddingBottom: 'var(--ab-base-space)',
|
|
44
44
|
} }, labels?.showIds ?? 'Show Column IDs')),
|
|
45
45
|
React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { value: searchInputValue, OnTextChange: setSearchInputValue, placeholder: labels?.filterPlaceholder ?? 'Filter columns...', style: { flex: 1, marginBottom: 3 } })),
|
|
46
|
-
React.createElement(FormLayout_1.default, { className: "ab-ExpressionEditor__columns", gridColumnGap: "var(--ab-space
|
|
46
|
+
React.createElement(FormLayout_1.default, { className: "ab-ExpressionEditor__columns", gridColumnGap: "var(--ab-base-space)", gridRowGap: "var(--ab-base-space)", sizes: ['auto', '1fr'], style: { alignItems: 'stretch', overflow: 'auto' } }, fields
|
|
47
47
|
.filter((field) => {
|
|
48
48
|
if (!searchInputValue) {
|
|
49
49
|
return true;
|
|
@@ -18,7 +18,7 @@ const defaultColumns = {
|
|
|
18
18
|
};
|
|
19
19
|
const PLACEHOLDER = React.createElement("div", null);
|
|
20
20
|
const FormLayout = (props) => {
|
|
21
|
-
let { placeholder = PLACEHOLDER, columns = ['label', 'children'], defaultComponent = Flex_1.Box, sizes = ['auto', '1fr'], gridColumnGap = 'var(--ab-space
|
|
21
|
+
let { placeholder = PLACEHOLDER, columns = ['label', 'children'], defaultComponent = Flex_1.Box, sizes = ['auto', '1fr'], gridColumnGap = 'calc(var(--ab-base-space) * 2)', gridRowGap = 'calc(var(--ab-base-space) * 2)', style, childrenToColumns = true, ...boxProps } = props;
|
|
22
22
|
columns = columns.map((c) => {
|
|
23
23
|
if (typeof c === 'string' || typeof c === 'number') {
|
|
24
24
|
c = {
|
|
@@ -703,7 +703,7 @@ const Select = function (props) {
|
|
|
703
703
|
valueContainer: (baseStyle) => {
|
|
704
704
|
return {
|
|
705
705
|
...baseStyle,
|
|
706
|
-
padding: props.size === 'small' ? `0 var(--ab-space
|
|
706
|
+
padding: props.size === 'small' ? `0 var(--ab-base-space)` : baseStyle.padding,
|
|
707
707
|
...props.styles?.valueContainer,
|
|
708
708
|
};
|
|
709
709
|
},
|
|
@@ -226,7 +226,7 @@ function TreeDropdown(props) {
|
|
|
226
226
|
};
|
|
227
227
|
if (!hasChildren) {
|
|
228
228
|
// @ts-ignore - don't leave any space for the > expand icon, as there are no children
|
|
229
|
-
treeListStyle['--infinite-group-row-column-nesting'] = 'var(--ab-space
|
|
229
|
+
treeListStyle['--infinite-group-row-column-nesting'] = 'calc(var(--ab-base-space) * 2)';
|
|
230
230
|
}
|
|
231
231
|
const treeList = (React.createElement(TreeList_1.TreeList, { primaryKey: props.primaryKey ?? 'id', treeFilterFunction: filterFunction, columnHeaderHeight: 30, onReady: ({ api }) => {
|
|
232
232
|
setTreeListApi(api);
|
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: "22.0.0-canary.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1770908616549 || Date.now(),
|
|
6
|
+
VERSION: "22.0.0-canary.9" || '--current-version--',
|
|
7
7
|
};
|
|
@@ -314,6 +314,16 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
314
314
|
isOpt: boolean;
|
|
315
315
|
}[];
|
|
316
316
|
};
|
|
317
|
+
AdaptableColumnsContext: {
|
|
318
|
+
name: string;
|
|
319
|
+
kind: string;
|
|
320
|
+
desc: string;
|
|
321
|
+
props: {
|
|
322
|
+
name: string;
|
|
323
|
+
kind: string;
|
|
324
|
+
desc: string;
|
|
325
|
+
}[];
|
|
326
|
+
};
|
|
317
327
|
AdaptableColumnSummary: {
|
|
318
328
|
name: string;
|
|
319
329
|
kind: string;
|
|
@@ -364,6 +374,11 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
364
374
|
ref: string;
|
|
365
375
|
}[];
|
|
366
376
|
};
|
|
377
|
+
AdaptableContainerValue: {
|
|
378
|
+
name: string;
|
|
379
|
+
kind: string;
|
|
380
|
+
desc: string;
|
|
381
|
+
};
|
|
367
382
|
AdaptableContextMenuItem: {
|
|
368
383
|
name: string;
|
|
369
384
|
kind: string;
|
|
@@ -384,6 +399,16 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
384
399
|
desc: string;
|
|
385
400
|
}[];
|
|
386
401
|
};
|
|
402
|
+
AdaptableCSSSelector: {
|
|
403
|
+
name: string;
|
|
404
|
+
kind: string;
|
|
405
|
+
desc: string;
|
|
406
|
+
props: {
|
|
407
|
+
name: string;
|
|
408
|
+
kind: string;
|
|
409
|
+
desc: string;
|
|
410
|
+
}[];
|
|
411
|
+
};
|
|
387
412
|
AdaptableCustomIcon: {
|
|
388
413
|
name: string;
|
|
389
414
|
kind: string;
|
|
@@ -889,6 +914,16 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
889
914
|
desc: string;
|
|
890
915
|
}[];
|
|
891
916
|
};
|
|
917
|
+
AdaptableRowContext: {
|
|
918
|
+
name: string;
|
|
919
|
+
kind: string;
|
|
920
|
+
desc: string;
|
|
921
|
+
props: {
|
|
922
|
+
name: string;
|
|
923
|
+
kind: string;
|
|
924
|
+
desc: string;
|
|
925
|
+
}[];
|
|
926
|
+
};
|
|
892
927
|
AdaptableSaveStateFunction: {
|
|
893
928
|
name: string;
|
|
894
929
|
kind: string;
|
|
@@ -2244,6 +2279,11 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
2244
2279
|
ref: string;
|
|
2245
2280
|
})[];
|
|
2246
2281
|
};
|
|
2282
|
+
ContainerContext: {
|
|
2283
|
+
name: string;
|
|
2284
|
+
kind: string;
|
|
2285
|
+
desc: string;
|
|
2286
|
+
};
|
|
2247
2287
|
ContainerOptions: {
|
|
2248
2288
|
name: string;
|
|
2249
2289
|
kind: string;
|
|
@@ -4148,6 +4188,16 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
4148
4188
|
isOpt?: undefined;
|
|
4149
4189
|
})[];
|
|
4150
4190
|
};
|
|
4191
|
+
InitContainerContext: {
|
|
4192
|
+
name: string;
|
|
4193
|
+
kind: string;
|
|
4194
|
+
desc: string;
|
|
4195
|
+
props: {
|
|
4196
|
+
name: string;
|
|
4197
|
+
kind: string;
|
|
4198
|
+
desc: string;
|
|
4199
|
+
}[];
|
|
4200
|
+
};
|
|
4151
4201
|
InitialState: {
|
|
4152
4202
|
name: string;
|
|
4153
4203
|
kind: string;
|
|
@@ -6310,6 +6360,18 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
6310
6360
|
noCode?: undefined;
|
|
6311
6361
|
})[];
|
|
6312
6362
|
};
|
|
6363
|
+
UserInterfaceState: {
|
|
6364
|
+
name: string;
|
|
6365
|
+
kind: string;
|
|
6366
|
+
desc: string;
|
|
6367
|
+
props: {
|
|
6368
|
+
name: string;
|
|
6369
|
+
kind: string;
|
|
6370
|
+
desc: string;
|
|
6371
|
+
isOpt: boolean;
|
|
6372
|
+
defVal: string;
|
|
6373
|
+
}[];
|
|
6374
|
+
};
|
|
6313
6375
|
UserMenuItem: {
|
|
6314
6376
|
name: string;
|
|
6315
6377
|
kind: string;
|