@adaptabletools/adaptable-cjs 22.0.0-canary.7 → 22.0.0-canary.8
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/index.css +63 -71
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +6 -6
- package/src/AdaptableOptions/ContainerOptions.d.ts +55 -15
- package/src/AdaptableState/AdaptableState.d.ts +2 -0
- 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/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 +5 -2
- package/themes/dark.css +30 -29
- package/themes/light.css +4 -2
- package/tsconfig.cjs.tsbuildinfo +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseState } from './BaseState';
|
|
2
|
+
/**
|
|
3
|
+
* Adaptable State Section for the User Interface
|
|
4
|
+
*
|
|
5
|
+
* Controls the visibility and behaviour of AdapTable UI elements
|
|
6
|
+
*/
|
|
7
|
+
export interface UserInterfaceState extends BaseState {
|
|
8
|
+
/**
|
|
9
|
+
* Whether to hide all AdapTable UI elements (Dashboard, Tool Panel, Status Bar, Column and Context Menus etc.)
|
|
10
|
+
*
|
|
11
|
+
* @defaultValue false
|
|
12
|
+
*/
|
|
13
|
+
HideAdaptableUI?: boolean;
|
|
14
|
+
}
|
package/src/Api/GridApi.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { SelectedCellInfo } from '../AdaptableState/Selection/SelectedCellInfo';
|
|
|
2
2
|
import { SelectedRowInfo } from '../AdaptableState/Selection/SelectedRowInfo';
|
|
3
3
|
import { ColumnSort } from '../AdaptableState/Common/ColumnSort';
|
|
4
4
|
import { CellUpdateRequest, GridCell } from '../AdaptableState/Selection/GridCell';
|
|
5
|
-
import { DataUpdateConfig } from '../AdaptableState/Common/DataUpdateConfig';
|
|
5
|
+
import { DataRowConfig, DataUpdateConfig } from '../AdaptableState/Common/DataUpdateConfig';
|
|
6
6
|
import { CellDataChangedInfo } from '../AdaptableState/Common/CellDataChangedInfo';
|
|
7
7
|
import { CellHighlightInfo } from '../AdaptableState/Common/CellHighlightInfo';
|
|
8
8
|
import { RowHighlightInfo } from '../AdaptableState/Common/RowHighlightInfo';
|
|
@@ -71,15 +71,11 @@ export interface GridApi {
|
|
|
71
71
|
*/
|
|
72
72
|
deleteGridData(dataRows: any[], config?: DataUpdateConfig): Promise<IRowNode[]>;
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
75
|
-
* @param
|
|
76
|
-
* @param
|
|
74
|
+
* Adds, Updates or Deletes rows in AdapTable (and AG Grid) in single transaction
|
|
75
|
+
* @param dataRowConfig - Rows to add, update or remove
|
|
76
|
+
* @param dataUpdateConfig - batch option and callback function to run post transaction
|
|
77
77
|
*/
|
|
78
|
-
manageGridData(
|
|
79
|
-
add?: any[];
|
|
80
|
-
update?: any[];
|
|
81
|
-
delete?: any[];
|
|
82
|
-
}, config?: DataUpdateConfig): Promise<{
|
|
78
|
+
manageGridData(dataRowConfig: DataRowConfig, dataUpdateConfig?: DataUpdateConfig): Promise<{
|
|
83
79
|
addedRows: IRowNode[];
|
|
84
80
|
updatedRows: IRowNode[];
|
|
85
81
|
removedRows: IRowNode[];
|
|
@@ -11,6 +11,7 @@ const ObjectFactory_1 = tslib_1.__importDefault(require("../../Utilities/ObjectF
|
|
|
11
11
|
const AdaptableAlert_1 = require("../../AdaptableState/Common/AdaptableAlert");
|
|
12
12
|
const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
|
|
13
13
|
const AlertInternalApi_1 = require("../Internal/AlertInternalApi");
|
|
14
|
+
const resolveContainerElement_1 = require("../../Utilities/resolveContainerElement");
|
|
14
15
|
class AlertApiImpl extends ApiBase_1.ApiBase {
|
|
15
16
|
internalApi;
|
|
16
17
|
constructor(_adaptable) {
|
|
@@ -66,12 +67,7 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
|
|
|
66
67
|
}
|
|
67
68
|
// Show Alert in a Div (if one has been set)
|
|
68
69
|
if (alertProperties.ShowInDiv) {
|
|
69
|
-
|
|
70
|
-
let optionsDiv = this.getContainerOptions().alertContainer;
|
|
71
|
-
if (optionsDiv) {
|
|
72
|
-
alertDiv =
|
|
73
|
-
typeof optionsDiv === 'string' ? document.getElementById(optionsDiv) : optionsDiv;
|
|
74
|
-
}
|
|
70
|
+
const alertDiv = (0, resolveContainerElement_1.resolveContainerElement)(this.getContainerOptions().alertContainer, this.getAdaptableInternalApi().buildBaseContext());
|
|
75
71
|
if (alertDiv) {
|
|
76
72
|
let alertString = alertToShow.header + ': ' + alertToShow.message;
|
|
77
73
|
alertDiv.innerHTML = alertString;
|
|
@@ -4,7 +4,7 @@ import { SelectedCellInfo } from '../../AdaptableState/Selection/SelectedCellInf
|
|
|
4
4
|
import { SelectedRowInfo } from '../../AdaptableState/Selection/SelectedRowInfo';
|
|
5
5
|
import { CellUpdateRequest, GridCell } from '../../AdaptableState/Selection/GridCell';
|
|
6
6
|
import { ColumnSort } from '../../AdaptableState/Common/ColumnSort';
|
|
7
|
-
import { DataUpdateConfig } from '../../AdaptableState/Common/DataUpdateConfig';
|
|
7
|
+
import { DataRowConfig, DataUpdateConfig } from '../../AdaptableState/Common/DataUpdateConfig';
|
|
8
8
|
import { CellHighlightInfo } from '../../AdaptableState/Common/CellHighlightInfo';
|
|
9
9
|
import { RowHighlightInfo } from '../../AdaptableState/Common/RowHighlightInfo';
|
|
10
10
|
import { ColDef, ColGroupDef, Column, ColumnState, IRowNode, RowModelType } from 'ag-grid-enterprise';
|
|
@@ -35,11 +35,7 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
|
|
|
35
35
|
addGridData(dataRows: any[], dataUpdateConfig?: DataUpdateConfig): Promise<IRowNode[]>;
|
|
36
36
|
undoCellEdit(cellDataChangedInfo: CellDataChangedInfo): boolean;
|
|
37
37
|
deleteGridData(dataRows: any[], dataUpdateConfig?: DataUpdateConfig): Promise<IRowNode[]>;
|
|
38
|
-
manageGridData(
|
|
39
|
-
add?: any[];
|
|
40
|
-
update?: any[];
|
|
41
|
-
delete?: any[];
|
|
42
|
-
}, config?: DataUpdateConfig): Promise<{
|
|
38
|
+
manageGridData(dataRowConfig: DataRowConfig, dataUpdateConfig?: DataUpdateConfig): Promise<{
|
|
43
39
|
addedRows: IRowNode[];
|
|
44
40
|
updatedRows: IRowNode[];
|
|
45
41
|
removedRows: IRowNode[];
|
|
@@ -99,18 +99,18 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
99
99
|
}
|
|
100
100
|
return [];
|
|
101
101
|
}
|
|
102
|
-
async manageGridData(
|
|
103
|
-
const transactionResult = await this._adaptable.manageGridRows(
|
|
102
|
+
async manageGridData(dataRowConfig, dataUpdateConfig) {
|
|
103
|
+
const transactionResult = await this._adaptable.manageGridRows(dataRowConfig, dataUpdateConfig);
|
|
104
104
|
if (Array.isArray(transactionResult.removedRows) && transactionResult.removedRows.length) {
|
|
105
|
-
const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataRows.delete, transactionResult.removedRows, 'Delete');
|
|
105
|
+
const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataRowConfig.dataRows.delete, transactionResult.removedRows, 'Delete');
|
|
106
106
|
this.getAdaptableInternalApi().getDataService().CreateRowDataChangedEvent(rowDataChangedInfo);
|
|
107
107
|
}
|
|
108
108
|
if (Array.isArray(transactionResult.updatedRows) && transactionResult.updatedRows.length) {
|
|
109
|
-
const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataRows.update, transactionResult.updatedRows, 'Update');
|
|
109
|
+
const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataRowConfig.dataRows.update, transactionResult.updatedRows, 'Update');
|
|
110
110
|
this.getAdaptableInternalApi().getDataService().CreateRowDataChangedEvent(rowDataChangedInfo);
|
|
111
111
|
}
|
|
112
112
|
if (Array.isArray(transactionResult.addedRows) && transactionResult.addedRows.length) {
|
|
113
|
-
const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataRows.add, transactionResult.addedRows, 'Add');
|
|
113
|
+
const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataRowConfig.dataRows.add, transactionResult.addedRows, 'Add');
|
|
114
114
|
this.getAdaptableInternalApi().getDataService().CreateRowDataChangedEvent(rowDataChangedInfo);
|
|
115
115
|
}
|
|
116
116
|
return transactionResult;
|
|
@@ -611,9 +611,9 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
611
611
|
showTransposedView(transposeConfig = {}) {
|
|
612
612
|
const transposedColumnId = transposeConfig.transposedColumnId ?? this.getOptionsApi().getPrimaryKey();
|
|
613
613
|
const hideTransposedColumn = transposeConfig.hideTransposedColumn ?? true;
|
|
614
|
-
const visibleColumns = transposeConfig.visibleColumns ?? false;
|
|
615
|
-
const visibleRows = transposeConfig.visibleRows ?? false;
|
|
616
614
|
const autosize = transposeConfig.autosize ?? true;
|
|
615
|
+
const columnsToTranspose = transposeConfig.columnsToTranspose;
|
|
616
|
+
const rowsToTranspose = transposeConfig.rowsToTranspose;
|
|
617
617
|
this.getAdaptableInternalApi().showPopupWindow({
|
|
618
618
|
id: windowFactory_1.WINDOW_SHOW_TRANSPOSED_VIEW,
|
|
619
619
|
factoryId: windowFactory_1.WINDOW_SHOW_TRANSPOSED_VIEW,
|
|
@@ -622,9 +622,9 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
622
622
|
popupProps: {
|
|
623
623
|
transposedColumnId,
|
|
624
624
|
hideTransposedColumn,
|
|
625
|
-
visibleColumns,
|
|
626
|
-
visibleRows,
|
|
627
625
|
autosize,
|
|
626
|
+
columnsToTranspose,
|
|
627
|
+
rowsToTranspose,
|
|
628
628
|
},
|
|
629
629
|
});
|
|
630
630
|
}
|
|
@@ -24,6 +24,7 @@ export declare class LayoutApiImpl extends ApiBase implements LayoutApi {
|
|
|
24
24
|
getCurrentLayoutColumnSort(columnId: string): ColumnSort['SortOrder'] | null;
|
|
25
25
|
getCurrentLayoutName(): string;
|
|
26
26
|
getLayoutByName(layoutName: string): Layout | null;
|
|
27
|
+
setExtendedLayout(extendedLayout: ExtendedLayout): void;
|
|
27
28
|
createOrUpdateExtendedLayout(extendedLayoutInfo: ExtendedLayout): void;
|
|
28
29
|
getExtendedLayoutByName(layoutName: string): ExtendedLayout | undefined;
|
|
29
30
|
cloneExtendedLayout(extendedLayoutToClone: ExtendedLayout, layoutName: string): ExtendedLayout | false;
|
|
@@ -94,6 +94,9 @@ class LayoutApiImpl extends ApiBase_1.ApiBase {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
+
setExtendedLayout(extendedLayout) {
|
|
98
|
+
this.setLayout(extendedLayout.Layout.Name);
|
|
99
|
+
}
|
|
97
100
|
createOrUpdateExtendedLayout(extendedLayoutInfo) {
|
|
98
101
|
const config = {
|
|
99
102
|
includeLayoutNotExtendedObjects: true,
|
|
@@ -11,6 +11,7 @@ const react_1 = require("react");
|
|
|
11
11
|
const UIHelper_1 = tslib_1.__importDefault(require("../../View/UIHelper"));
|
|
12
12
|
const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
|
|
13
13
|
const SystemStatusInternalApi_1 = require("../Internal/SystemStatusInternalApi");
|
|
14
|
+
const resolveContainerElement_1 = require("../../Utilities/resolveContainerElement");
|
|
14
15
|
class SystemStatusApiImpl extends ApiBase_1.ApiBase {
|
|
15
16
|
systemStatusDiv;
|
|
16
17
|
internalApi;
|
|
@@ -52,11 +53,7 @@ class SystemStatusApiImpl extends ApiBase_1.ApiBase {
|
|
|
52
53
|
}
|
|
53
54
|
displayMessageInDiv(statusMessage, statusFurtherInformation, messageType) {
|
|
54
55
|
if (!this.systemStatusDiv) {
|
|
55
|
-
|
|
56
|
-
if (optionsDiv) {
|
|
57
|
-
this.systemStatusDiv =
|
|
58
|
-
typeof optionsDiv === 'string' ? document.getElementById(optionsDiv) : optionsDiv;
|
|
59
|
-
}
|
|
56
|
+
this.systemStatusDiv = (0, resolveContainerElement_1.resolveContainerElement)(this.getContainerOptions().systemStatusContainer, this.getAdaptableInternalApi().buildBaseContext());
|
|
60
57
|
}
|
|
61
58
|
if (this.systemStatusDiv) {
|
|
62
59
|
if (StringExtensions_1.default.IsNotNullOrEmpty(statusFurtherInformation)) {
|
|
@@ -6,6 +6,7 @@ import { UserInterfaceInternalApi } from '../Internal/UserInterfaceInternalApi';
|
|
|
6
6
|
import { UserInterfaceApi } from '../UserInterfaceApi';
|
|
7
7
|
import { ProgressIndicatorConfig } from '../../AdaptableState/Common/ProgressIndicatorConfig';
|
|
8
8
|
import { ApiBase } from './ApiBase';
|
|
9
|
+
import { UserInterfaceState } from '../../AdaptableState/UserInterfaceState';
|
|
9
10
|
export declare class UserInterfaceApiImpl extends ApiBase implements UserInterfaceApi {
|
|
10
11
|
internalApi: UserInterfaceInternalApi;
|
|
11
12
|
private showProgressIndicatorTimeout;
|
|
@@ -26,4 +27,8 @@ export declare class UserInterfaceApiImpl extends ApiBase implements UserInterfa
|
|
|
26
27
|
close: () => void;
|
|
27
28
|
};
|
|
28
29
|
closeCustomWindowPopup(windowId: string): void;
|
|
30
|
+
getUserInterfaceState(): UserInterfaceState;
|
|
31
|
+
isAdaptableUIVisible(): boolean;
|
|
32
|
+
hideAdaptableUI(): void;
|
|
33
|
+
showAdaptableUI(): void;
|
|
29
34
|
}
|
|
@@ -8,6 +8,7 @@ const WindowPopups_1 = require("../../View/Components/Popups/WindowPopups/Window
|
|
|
8
8
|
const UserInterfaceInternalApi_1 = require("../Internal/UserInterfaceInternalApi");
|
|
9
9
|
const ApiBase_1 = require("./ApiBase");
|
|
10
10
|
const PopupRedux_1 = require("../../Redux/ActionsReducers/PopupRedux");
|
|
11
|
+
const UserInterfaceRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/UserInterfaceRedux"));
|
|
11
12
|
class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
|
|
12
13
|
internalApi;
|
|
13
14
|
showProgressIndicatorTimeout = null;
|
|
@@ -132,5 +133,17 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
|
|
|
132
133
|
closeCustomWindowPopup(windowId) {
|
|
133
134
|
this.dispatchAction(PopupRedux.PopupHideWindow(windowId));
|
|
134
135
|
}
|
|
136
|
+
getUserInterfaceState() {
|
|
137
|
+
return this.getAdaptableState().UserInterface;
|
|
138
|
+
}
|
|
139
|
+
isAdaptableUIVisible() {
|
|
140
|
+
return !(this.getUserInterfaceState().HideAdaptableUI ?? false);
|
|
141
|
+
}
|
|
142
|
+
hideAdaptableUI() {
|
|
143
|
+
this.dispatchAction(UserInterfaceRedux.UserInterfaceSetHideAdaptableUI(true));
|
|
144
|
+
}
|
|
145
|
+
showAdaptableUI() {
|
|
146
|
+
this.dispatchAction(UserInterfaceRedux.UserInterfaceSetHideAdaptableUI(false));
|
|
147
|
+
}
|
|
135
148
|
}
|
|
136
149
|
exports.UserInterfaceApiImpl = UserInterfaceApiImpl;
|
package/src/Api/LayoutApi.d.ts
CHANGED
|
@@ -57,6 +57,12 @@ export interface LayoutApi {
|
|
|
57
57
|
*/
|
|
58
58
|
getLayoutByName(layoutName: string): Layout | null;
|
|
59
59
|
/**
|
|
60
|
+
* Sets (i.e. selects) the Extended Layout
|
|
61
|
+
* @param extendedLayout Extended Layout to set
|
|
62
|
+
*/
|
|
63
|
+
setExtendedLayout(extendedLayout: ExtendedLayout): void;
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
60
66
|
* Retrieves Layout with the given name
|
|
61
67
|
* @param layoutName Layout to retrieve
|
|
62
68
|
* @returns layout
|
|
@@ -3,6 +3,7 @@ import { AdaptableObject, AdaptableObjectTag } from '../AdaptableState/Common/Ad
|
|
|
3
3
|
import { AdaptableModule, CustomIcon } from '../types';
|
|
4
4
|
import { CustomWindowConfig } from '../AdaptableState/Common/CustomWindowConfig';
|
|
5
5
|
import { ProgressIndicatorConfig } from '../AdaptableState/Common/ProgressIndicatorConfig';
|
|
6
|
+
import { UserInterfaceState } from '../AdaptableState/UserInterfaceState';
|
|
6
7
|
/**
|
|
7
8
|
* Functions relating to User Interface section of Adaptable State
|
|
8
9
|
*/
|
|
@@ -78,4 +79,20 @@ export interface UserInterfaceApi {
|
|
|
78
79
|
* @param windowId window popup id
|
|
79
80
|
*/
|
|
80
81
|
closeCustomWindowPopup(windowId: string): void;
|
|
82
|
+
/**
|
|
83
|
+
* Retrieves the current User Interface State
|
|
84
|
+
*/
|
|
85
|
+
getUserInterfaceState(): UserInterfaceState;
|
|
86
|
+
/**
|
|
87
|
+
* Returns whether the AdapTable UI is currently visible
|
|
88
|
+
*/
|
|
89
|
+
isAdaptableUIVisible(): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Hides all AdapTable UI elements (Dashboard, Tool Panel, Status Bar, Column and Context Menus etc.)
|
|
92
|
+
*/
|
|
93
|
+
hideAdaptableUI(): void;
|
|
94
|
+
/**
|
|
95
|
+
* Shows all AdapTable UI elements (Dashboard, Tool Panel, Status Bar, Column and Context Menus etc.)
|
|
96
|
+
*/
|
|
97
|
+
showAdaptableUI(): void;
|
|
81
98
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as Redux from 'redux';
|
|
2
|
+
import { UserInterfaceState } from '../../AdaptableState/UserInterfaceState';
|
|
3
|
+
/**
|
|
4
|
+
* @ReduxAction Sets whether all AdapTable UI elements are hidden
|
|
5
|
+
*/
|
|
6
|
+
export declare const USER_INTERFACE_SET_HIDE_ADAPTABLE_UI = "USER_INTERFACE_SET_HIDE_ADAPTABLE_UI";
|
|
7
|
+
export interface UserInterfaceSetHideAdaptableUIAction extends Redux.Action {
|
|
8
|
+
hideAdaptableUI: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const UserInterfaceSetHideAdaptableUI: (hideAdaptableUI: boolean) => UserInterfaceSetHideAdaptableUIAction;
|
|
11
|
+
export declare const UserInterfaceReducer: Redux.Reducer<UserInterfaceState>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserInterfaceReducer = exports.UserInterfaceSetHideAdaptableUI = exports.USER_INTERFACE_SET_HIDE_ADAPTABLE_UI = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @ReduxAction Sets whether all AdapTable UI elements are hidden
|
|
6
|
+
*/
|
|
7
|
+
exports.USER_INTERFACE_SET_HIDE_ADAPTABLE_UI = 'USER_INTERFACE_SET_HIDE_ADAPTABLE_UI';
|
|
8
|
+
const UserInterfaceSetHideAdaptableUI = (hideAdaptableUI) => ({
|
|
9
|
+
type: exports.USER_INTERFACE_SET_HIDE_ADAPTABLE_UI,
|
|
10
|
+
hideAdaptableUI,
|
|
11
|
+
});
|
|
12
|
+
exports.UserInterfaceSetHideAdaptableUI = UserInterfaceSetHideAdaptableUI;
|
|
13
|
+
const initialState = {
|
|
14
|
+
HideAdaptableUI: false,
|
|
15
|
+
};
|
|
16
|
+
const UserInterfaceReducer = (state = initialState, action) => {
|
|
17
|
+
switch (action.type) {
|
|
18
|
+
case exports.USER_INTERFACE_SET_HIDE_ADAPTABLE_UI:
|
|
19
|
+
return Object.assign({}, state, {
|
|
20
|
+
HideAdaptableUI: action.hideAdaptableUI,
|
|
21
|
+
});
|
|
22
|
+
default:
|
|
23
|
+
return state;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.UserInterfaceReducer = UserInterfaceReducer;
|
|
@@ -42,6 +42,7 @@ const InternalRedux = tslib_1.__importStar(require("../ActionsReducers/InternalR
|
|
|
42
42
|
const TeamSharingRedux = tslib_1.__importStar(require("../ActionsReducers/TeamSharingRedux"));
|
|
43
43
|
const ThemeRedux = tslib_1.__importStar(require("../ActionsReducers/ThemeRedux"));
|
|
44
44
|
const ToolPanelRedux = tslib_1.__importStar(require("../ActionsReducers/ToolPanelRedux"));
|
|
45
|
+
const UserInterfaceRedux = tslib_1.__importStar(require("../ActionsReducers/UserInterfaceRedux"));
|
|
45
46
|
const devTools_1 = require("../../devTools");
|
|
46
47
|
const TeamSharingState_1 = require("../../AdaptableState/TeamSharingState");
|
|
47
48
|
const buildAdaptableStateFunctionConfig_1 = require("./buildAdaptableStateFunctionConfig");
|
|
@@ -127,6 +128,7 @@ class AdaptableStore {
|
|
|
127
128
|
TeamSharing: TeamSharingRedux.TeamSharingReducer,
|
|
128
129
|
Theme: ThemeRedux.ThemeReducer,
|
|
129
130
|
ToolPanel: ToolPanelRedux.ToolPanelReducer,
|
|
131
|
+
UserInterface: UserInterfaceRedux.UserInterfaceReducer,
|
|
130
132
|
};
|
|
131
133
|
// allow plugins to participate in the root reducer
|
|
132
134
|
adaptable.forPlugins((plugin) => {
|
|
@@ -999,6 +1001,31 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
999
1001
|
module.setUpScheduleJobs();
|
|
1000
1002
|
return returnAction;
|
|
1001
1003
|
}
|
|
1004
|
+
/*******************
|
|
1005
|
+
* USER INTERFACE ACTIONS
|
|
1006
|
+
*******************/
|
|
1007
|
+
case UserInterfaceRedux.USER_INTERFACE_SET_HIDE_ADAPTABLE_UI: {
|
|
1008
|
+
const returnAction = next(action);
|
|
1009
|
+
const { hideAdaptableUI } = action;
|
|
1010
|
+
// Hide or show Dashboard
|
|
1011
|
+
middlewareAPI.dispatch(DashboardRedux.DashboardSetIsHidden(hideAdaptableUI));
|
|
1012
|
+
// Hide or show Adaptable ToolPanel in the AG Grid sidebar
|
|
1013
|
+
if (hideAdaptableUI) {
|
|
1014
|
+
adaptable.hideAdaptableToolPanel();
|
|
1015
|
+
}
|
|
1016
|
+
else {
|
|
1017
|
+
adaptable.showAdaptableToolPanel();
|
|
1018
|
+
}
|
|
1019
|
+
// Hide or show Adaptable StatusBar panels
|
|
1020
|
+
if (hideAdaptableUI) {
|
|
1021
|
+
adaptable.hideAdaptableStatusBar();
|
|
1022
|
+
}
|
|
1023
|
+
else {
|
|
1024
|
+
adaptable.showAdaptableStatusBar();
|
|
1025
|
+
}
|
|
1026
|
+
// Column and Context Menus are handled in the AgGridMenuAdapter
|
|
1027
|
+
return returnAction;
|
|
1028
|
+
}
|
|
1002
1029
|
/*******************
|
|
1003
1030
|
* DASHBOARD ACTIONS
|
|
1004
1031
|
*******************/
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AdaptableContainerValue, ContainerContext, InitContainerContext } from '../AdaptableOptions/ContainerOptions';
|
|
2
|
+
/**
|
|
3
|
+
* The union type representing any container option value (static or function).
|
|
4
|
+
*/
|
|
5
|
+
type AnyContainerOption = AdaptableContainerValue | ((context: any) => AdaptableContainerValue);
|
|
6
|
+
/**
|
|
7
|
+
* Resolves a container option value to an `HTMLElement`.
|
|
8
|
+
*
|
|
9
|
+
* Resolution order:
|
|
10
|
+
* 1. If `container` is `null`/`undefined`, returns `null`.
|
|
11
|
+
* 2. If `container` is a function, it is called with the provided `context` and the result is resolved.
|
|
12
|
+
* 3. If the value is an `HTMLElement`, it is returned directly.
|
|
13
|
+
* 4. If the value is an `AdaptableCSSSelector` (`{ selector: string }`), `document.querySelectorAll` is used.
|
|
14
|
+
* If multiple elements match, the first is returned and a console warning is logged.
|
|
15
|
+
* 5. If the value is a `string`, it is treated as an element ID and `document.getElementById` is used.
|
|
16
|
+
*
|
|
17
|
+
* @param container - The container reference to resolve.
|
|
18
|
+
* @param context - Optional context passed to the function form of the container.
|
|
19
|
+
* @param doc - The document to query against (defaults to `globalThis.document`).
|
|
20
|
+
* @returns The resolved `HTMLElement`, or `null` if not found.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveContainerElement(container: AnyContainerOption | undefined | null, context?: ContainerContext | InitContainerContext, doc?: Document): HTMLElement | null;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveContainerElement = resolveContainerElement;
|
|
4
|
+
/**
|
|
5
|
+
* Resolves a container option value to an `HTMLElement`.
|
|
6
|
+
*
|
|
7
|
+
* Resolution order:
|
|
8
|
+
* 1. If `container` is `null`/`undefined`, returns `null`.
|
|
9
|
+
* 2. If `container` is a function, it is called with the provided `context` and the result is resolved.
|
|
10
|
+
* 3. If the value is an `HTMLElement`, it is returned directly.
|
|
11
|
+
* 4. If the value is an `AdaptableCSSSelector` (`{ selector: string }`), `document.querySelectorAll` is used.
|
|
12
|
+
* If multiple elements match, the first is returned and a console warning is logged.
|
|
13
|
+
* 5. If the value is a `string`, it is treated as an element ID and `document.getElementById` is used.
|
|
14
|
+
*
|
|
15
|
+
* @param container - The container reference to resolve.
|
|
16
|
+
* @param context - Optional context passed to the function form of the container.
|
|
17
|
+
* @param doc - The document to query against (defaults to `globalThis.document`).
|
|
18
|
+
* @returns The resolved `HTMLElement`, or `null` if not found.
|
|
19
|
+
*/
|
|
20
|
+
function resolveContainerElement(container, context, doc = globalThis.document) {
|
|
21
|
+
if (container == null) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
// Unwrap function form — pass context if the container is a function
|
|
25
|
+
const value = typeof container === 'function' ? container(context) : container;
|
|
26
|
+
// Guard against null/undefined returned by a callback (e.g. document.getElementById(...))
|
|
27
|
+
if (value == null) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
// Direct HTMLElement reference
|
|
31
|
+
if (value instanceof HTMLElement) {
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
34
|
+
// CSS Selector object
|
|
35
|
+
if (typeof value === 'object' && 'selector' in value) {
|
|
36
|
+
const matches = doc.querySelectorAll(value.selector);
|
|
37
|
+
if (matches.length > 1) {
|
|
38
|
+
console.warn(`[AdapTable] CSS selector "${value.selector}" matched ${matches.length} elements. Using the first match. Consider using a more specific selector.`);
|
|
39
|
+
}
|
|
40
|
+
return matches[0] ?? null;
|
|
41
|
+
}
|
|
42
|
+
// String element ID
|
|
43
|
+
if (typeof value === 'string') {
|
|
44
|
+
return doc.getElementById(value);
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
@@ -97,7 +97,7 @@ const ColumnFilterInput = (props) => {
|
|
|
97
97
|
return (React.createElement(AdaptableInput_1.default, { style: filterType === 'floating'
|
|
98
98
|
? {
|
|
99
99
|
width: '100%',
|
|
100
|
-
padding: 'var(--ab-space
|
|
100
|
+
padding: 'var(--ab-base-space)',
|
|
101
101
|
borderRadius: 0,
|
|
102
102
|
border: 'none',
|
|
103
103
|
}
|
|
@@ -13,6 +13,7 @@ const AdaptablePopupBody_1 = require("./AdaptablePopupBody");
|
|
|
13
13
|
const AdaptableContext_1 = require("../../../AdaptableContext");
|
|
14
14
|
const CustomSettingsPanelView_1 = require("./CustomSettingsPanelView");
|
|
15
15
|
const useMenuItems_1 = require("./useMenuItems");
|
|
16
|
+
const resolveContainerElement_1 = require("../../../../Utilities/resolveContainerElement");
|
|
16
17
|
const AdaptablePopupDialog_1 = require("./AdaptablePopupDialog");
|
|
17
18
|
const Flex_1 = require("../../../../components/Flex");
|
|
18
19
|
const AdaptablePopup = (props) => {
|
|
@@ -21,7 +22,7 @@ const AdaptablePopup = (props) => {
|
|
|
21
22
|
const settingsPanelTitle = adaptable.ModuleService.getModuleFriendlyName('SettingsPanel');
|
|
22
23
|
const menuItems = (0, useMenuItems_1.useMenuItems)();
|
|
23
24
|
const isWindowModal = settingsPanelOptions.popupType === 'window';
|
|
24
|
-
const modalContainer = adaptable.adaptableOptions?.containerOptions?.modalContainer;
|
|
25
|
+
const modalContainer = (0, resolveContainerElement_1.resolveContainerElement)(adaptable.adaptableOptions?.containerOptions?.modalContainer, props.api.internalApi.buildBaseContext());
|
|
25
26
|
let friendlyName = null;
|
|
26
27
|
/**
|
|
27
28
|
* This means that it is not rendered in the context of Settings Panel
|
|
@@ -7,7 +7,7 @@ const UIHelper_1 = require("../../../UIHelper");
|
|
|
7
7
|
const AdaptableViewFactory_1 = require("../../../AdaptableViewFactory");
|
|
8
8
|
const AdaptablePopupModuleView_1 = require("./AdaptablePopupModuleView");
|
|
9
9
|
const AdaptablePopupBody = (props) => {
|
|
10
|
-
const modalContainer = UIHelper_1.UIHelper.getModalContainer(props.api.optionsApi.getAdaptableOptions(), document);
|
|
10
|
+
const modalContainer = UIHelper_1.UIHelper.getModalContainer(props.api.optionsApi.getAdaptableOptions(), document, props.api.internalApi.buildBaseContext());
|
|
11
11
|
const moduleName = props.module.moduleInfo.ModuleName;
|
|
12
12
|
const accessLevel = props.api.entitlementApi.getEntitlementAccessLevelForModule(moduleName);
|
|
13
13
|
const moduleInfo = props.api.internalApi.getModuleService().getModuleInfoByModule(moduleName);
|
|
@@ -47,14 +47,7 @@ const PopupDialog = (props) => {
|
|
|
47
47
|
const AdaptablePopupDialog = (props) => {
|
|
48
48
|
const { isActionModule, style, friendlyName, baseClassName, className, children, onHide, isWindowModal, modalContainer, } = props;
|
|
49
49
|
if (modalContainer) {
|
|
50
|
-
|
|
51
|
-
if (typeof modalContainer === 'string') {
|
|
52
|
-
ref = globalThis.document.querySelector(modalContainer);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
ref = modalContainer;
|
|
56
|
-
}
|
|
57
|
-
return (0, react_dom_1.createPortal)(React.createElement(Dialog_1.default, { "data-name": props.dataName, modal: false, fixed: false, onDismiss: onHide, className: className }, children), ref);
|
|
50
|
+
return (0, react_dom_1.createPortal)(React.createElement(Dialog_1.default, { "data-name": props.dataName, modal: false, fixed: false, onDismiss: onHide, className: className }, children), modalContainer);
|
|
58
51
|
}
|
|
59
52
|
if (isWindowModal) {
|
|
60
53
|
const settingsPanelOptionsKey = isActionModule ? `action-${friendlyName}` : 'settings';
|
|
@@ -3,9 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.WindowPopups = exports.CUSTOM_WINDOW_FACTORY_ID = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const react_dom_1 = require("react-dom");
|
|
6
7
|
const react_redux_1 = require("react-redux");
|
|
7
8
|
const Dialog_1 = tslib_1.__importDefault(require("../../../../components/Dialog"));
|
|
8
9
|
const PopupRedux_1 = require("../../../../Redux/ActionsReducers/PopupRedux");
|
|
10
|
+
const resolveContainerElement_1 = require("../../../../Utilities/resolveContainerElement");
|
|
9
11
|
const AdaptableContext_1 = require("../../../AdaptableContext");
|
|
10
12
|
const ExternalRenderer_1 = require("../../ExternalRenderer");
|
|
11
13
|
const PanelWithImage_1 = require("../../Panels/PanelWithImage");
|
|
@@ -15,6 +17,32 @@ const NoopComponent = () => {
|
|
|
15
17
|
return React.createElement(React.Fragment, null);
|
|
16
18
|
};
|
|
17
19
|
exports.CUSTOM_WINDOW_FACTORY_ID = 'CUSTOM_WINDOW_FACTORY_ID';
|
|
20
|
+
/**
|
|
21
|
+
* Portals children into a target container element.
|
|
22
|
+
* Monitors the container with a MutationObserver — if the container is removed
|
|
23
|
+
* from the DOM, `onContainerRemoved` is called so callers can clean up React/Redux state.
|
|
24
|
+
*/
|
|
25
|
+
const ContainerPortal = ({ container, onContainerRemoved, children }) => {
|
|
26
|
+
React.useEffect(() => {
|
|
27
|
+
// If the container is already detached, clean up immediately
|
|
28
|
+
if (!document.contains(container)) {
|
|
29
|
+
onContainerRemoved();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const observer = new MutationObserver(() => {
|
|
33
|
+
if (!document.contains(container)) {
|
|
34
|
+
onContainerRemoved();
|
|
35
|
+
observer.disconnect();
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
// Observe the entire document body for subtree removals
|
|
39
|
+
observer.observe(document.body, { childList: true, subtree: true });
|
|
40
|
+
return () => {
|
|
41
|
+
observer.disconnect();
|
|
42
|
+
};
|
|
43
|
+
}, [container, onContainerRemoved]);
|
|
44
|
+
return (0, react_dom_1.createPortal)(children, container);
|
|
45
|
+
};
|
|
18
46
|
const WindowPopups = () => {
|
|
19
47
|
const [windowModalSettings, setWindowModalSettings] = React.useState({});
|
|
20
48
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
@@ -41,6 +69,13 @@ const WindowPopups = () => {
|
|
|
41
69
|
Component = Component ?? NoopComponent;
|
|
42
70
|
componentNode = (React.createElement(Component, { api: adaptable.api, onDismiss: handleDismiss, popupProps: restPopupProps }));
|
|
43
71
|
}
|
|
72
|
+
// Transposed View: portal into custom container if configured
|
|
73
|
+
if (windowItem.FactoryId === windowFactory_1.WINDOW_SHOW_TRANSPOSED_VIEW) {
|
|
74
|
+
const transposedContainer = (0, resolveContainerElement_1.resolveContainerElement)(adaptable.adaptableOptions?.containerOptions?.transposedViewContainer, adaptable.api.internalApi.buildBaseContext());
|
|
75
|
+
if (transposedContainer) {
|
|
76
|
+
return (React.createElement(ContainerPortal, { key: windowItem.Id, container: transposedContainer, onContainerRemoved: handleDismiss }, componentNode));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
44
79
|
return (React.createElement(Dialog_1.default, { "data-name": windowItem.Id, className: "ab-Window-Modal twa:h-full twa:p-0", key: windowItem.Id, windowModal: true, windowModalProps: {
|
|
45
80
|
...windowModalProps,
|
|
46
81
|
onChange: (settings) => {
|
|
@@ -79,7 +79,7 @@ const CustomToolbarCmp = (props) => {
|
|
|
79
79
|
const disabled = button.disabled && button.disabled(button, dashboardContext);
|
|
80
80
|
let buttonVariant = buttonStyle && buttonStyle.variant ? buttonStyle.variant : 'outlined';
|
|
81
81
|
let buttonTone = buttonStyle && buttonStyle.tone ? buttonStyle.tone : 'neutral';
|
|
82
|
-
return (React.createElement(AdaptableButton_1.AdaptableButtonComponent, { style: { marginLeft: index ? 'var(--ab-space
|
|
82
|
+
return (React.createElement(AdaptableButton_1.AdaptableButtonComponent, { style: { marginLeft: index ? 'var(--ab-base-space)' : 0 }, key: index, disabled: disabled, tooltip: buttonTooltip, icon: buttonIcon, variant: buttonVariant, tone: buttonTone, className: buttonStyle?.className || '', onClick: () => {
|
|
83
83
|
button.onClick ? button.onClick(button, dashboardContext) : null;
|
|
84
84
|
setTimeout(() => {
|
|
85
85
|
// mutate state to force a re-rendering
|
|
@@ -31,7 +31,7 @@ const DataChangeHistoryViewPanelControl = (props) => {
|
|
|
31
31
|
const enabled = changeHistoryMode === 'ACTIVE';
|
|
32
32
|
const disabled = changeHistoryMode === 'INACTIVE';
|
|
33
33
|
const suspended = changeHistoryMode === 'SUSPENDED';
|
|
34
|
-
const gap = props.gap ?? 'var(--ab-space
|
|
34
|
+
const gap = props.gap ?? 'var(--ab-base-space)';
|
|
35
35
|
const buttonsPaddingY = props.buttonsPaddingY ?? 2;
|
|
36
36
|
const buttonPanel = (React.createElement(Flex_1.Flex, { className: "ab-DataChangeHistoryPanel--button-panel", style: { gap: gap, paddingBlock: buttonsPaddingY } },
|
|
37
37
|
disabled && (React.createElement(ButtonPlay_1.ButtonPlay, { "aria-label": "Enable Data Change History", className: "ab-DataChangeHistoryPanel--button-activate", "data-name": 'data-change-history--button-activate', tooltip: '', onClick: () => onChangeHistoryEnable() })),
|