@adaptabletools/adaptable-cjs 18.0.0-canary.27 → 18.0.0-canary.29
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/base.css +3 -13
- package/base.css.map +1 -1
- package/index.css +3 -13
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/src/AdaptableOptions/AdaptableFrameworkComponent.d.ts +3 -0
- package/src/AdaptableOptions/MenuOptions.d.ts +3 -3
- package/src/Api/GridApi.d.ts +4 -1
- package/src/Api/Implementation/ColumnApiImpl.js +6 -6
- package/src/Api/Implementation/ConfigApiImpl.js +0 -1
- package/src/Api/Implementation/ExpressionApiImpl.js +12 -12
- package/src/Api/Implementation/GridApiImpl.d.ts +1 -1
- package/src/Api/Implementation/GridApiImpl.js +8 -3
- package/src/Api/Implementation/ScopeApiImpl.js +4 -4
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +14 -5
- package/src/Api/Implementation/UserInterfaceApiImpl.js +26 -4
- package/src/Api/Internal/AdaptableInternalApi.d.ts +0 -1
- package/src/Api/Internal/AdaptableInternalApi.js +2 -6
- package/src/Api/Internal/ColumnFilterInternalApi.js +2 -2
- package/src/Api/Internal/DashboardInternalApi.js +2 -2
- package/src/Api/Internal/FormatColumnInternalApi.js +11 -5
- package/src/Api/Internal/GridFilterInternalApi.d.ts +2 -2
- package/src/Api/Internal/GridFilterInternalApi.js +2 -2
- package/src/Api/Internal/LayoutInternalApi.js +1 -1
- package/src/Api/UserInterfaceApi.d.ts +15 -2
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/Fdc3Intent.d.ts +2 -2
- package/src/PredefinedConfig/Common/Menu.d.ts +4 -4
- package/src/PredefinedConfig/Common/Menu.js +30 -17
- package/src/PredefinedConfig/Common/TransposeConfig.d.ts +3 -3
- package/src/PredefinedConfig/FormatColumnState.d.ts +4 -0
- package/src/PredefinedConfig/PopupState.d.ts +1 -2
- package/src/PredefinedConfig/StyledColumnState.d.ts +5 -0
- package/src/PredefinedConfig/SystemState.d.ts +4 -2
- package/src/Redux/ActionsReducers/PopupRedux.d.ts +5 -13
- package/src/Redux/ActionsReducers/PopupRedux.js +1 -22
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +9 -3
- package/src/Redux/ActionsReducers/SystemRedux.js +8 -5
- package/src/Strategy/ColumnFilterModule.js +1 -1
- package/src/Strategy/ColumnInfoModule.js +2 -2
- package/src/Strategy/ExportModule.d.ts +0 -1
- package/src/Strategy/ExportModule.js +37 -26
- package/src/Strategy/GridInfoModule.js +1 -1
- package/src/Strategy/LayoutModule.d.ts +1 -8
- package/src/Strategy/LayoutModule.js +11 -121
- package/src/Strategy/StyledColumnModule.js +14 -10
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +1 -0
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +4 -2
- package/src/Utilities/Interface/MessagePopups.d.ts +0 -3
- package/src/Utilities/Services/RowSummaryService.d.ts +22 -0
- package/src/Utilities/Services/RowSummaryService.js +146 -0
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.d.ts +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +11 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardSettingsSection.js +14 -10
- package/src/agGrid/AdaptableAgGrid.js +2 -1
- package/src/agGrid/AgGridColumnAdapter.js +19 -13
- package/src/agGrid/AgGridMenuAdapter.d.ts +6 -0
- package/src/agGrid/AgGridMenuAdapter.js +240 -106
- package/src/agGrid/BadgeRenderer.js +7 -1
- package/src/agGrid/PercentBarRenderer.js +3 -1
- package/src/components/ProgressIndicator/ProgressIndicator.js +15 -6
- package/src/components/icons/copy.d.ts +3 -0
- package/src/components/icons/copy.js +7 -0
- package/src/components/icons/filter-off.d.ts +3 -0
- package/src/components/icons/filter-off.js +7 -0
- package/src/components/icons/grid-info.d.ts +3 -0
- package/src/components/icons/grid-info.js +7 -0
- package/src/components/icons/index.js +12 -0
- package/src/components/icons/select-all.d.ts +3 -0
- package/src/components/icons/select-all.js +7 -0
- package/src/components/icons/select-fwd.d.ts +3 -0
- package/src/components/icons/select-fwd.js +7 -0
- package/src/components/icons/select-off.d.ts +3 -0
- package/src/components/icons/select-off.js +7 -0
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/parser.js +1218 -55
- package/src/parser/src/predicate/mapQlPredicateToExpression.js +1 -3
- package/src/parser/src/types.js +1 -2
- package/src/types.d.ts +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
|
@@ -9,7 +9,6 @@ const FloatingFilterWrapper_1 = require("./FloatingFilterWrapper");
|
|
|
9
9
|
const StyleHelper_1 = require("../Utilities/Helpers/StyleHelper");
|
|
10
10
|
const StringExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/StringExtensions"));
|
|
11
11
|
const ObjectFactory_1 = require("../Utilities/ObjectFactory");
|
|
12
|
-
const clamp_1 = tslib_1.__importDefault(require("lodash/clamp"));
|
|
13
12
|
const tinycolor2_1 = tslib_1.__importDefault(require("tinycolor2"));
|
|
14
13
|
const UIHelper_1 = tslib_1.__importDefault(require("../View/UIHelper"));
|
|
15
14
|
const PercentBarRenderer_1 = require("./PercentBarRenderer");
|
|
@@ -669,6 +668,7 @@ class AgGridColumnAdapter {
|
|
|
669
668
|
return Object.assign(Object.assign({}, this.getFormatColumnCellStyle(gridCell.column, activeFormatColumnsWithStyle, params)), styledColumnStyle);
|
|
670
669
|
}
|
|
671
670
|
getStyledColumnStyle(styledColumn, abColumn, params) {
|
|
671
|
+
var _a, _b;
|
|
672
672
|
let style = {};
|
|
673
673
|
const gradientStyle = styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.GradientStyle;
|
|
674
674
|
if (params.value === undefined) {
|
|
@@ -676,18 +676,24 @@ class AgGridColumnAdapter {
|
|
|
676
676
|
}
|
|
677
677
|
let colValue = params.value;
|
|
678
678
|
if (this.adaptableApi.gridApi.isGroupRowNode(params.node)) {
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
679
|
+
// We no longer support Grouped Rows
|
|
680
|
+
return style;
|
|
681
|
+
// if (styledColumn.IncludeGroupedRows) {
|
|
682
|
+
// const minColumnValue =
|
|
683
|
+
// this.adaptableApi.styledColumnApi.internalApi.getMinValueForNumericColumn(abColumn);
|
|
684
|
+
// const maxColumnValue =
|
|
685
|
+
// this.adaptableApi.styledColumnApi.internalApi.getMaxValueForNumericColumn(abColumn);
|
|
686
|
+
// /**
|
|
687
|
+
// * Color should always be in bounds, it should not overflow.
|
|
688
|
+
// * If the value is out of range, it shoul set the maximum/minimum color.
|
|
689
|
+
// */
|
|
690
|
+
// colValue = clamp(params.value, minColumnValue, maxColumnValue);
|
|
691
|
+
// } else {
|
|
692
|
+
// return style;
|
|
693
|
+
// }
|
|
694
|
+
}
|
|
695
|
+
if (((_b = (_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b[RowSummary_1.ROW_SUMMARY_ROW_ID]) && !styledColumn.IncludeRowSummaries) {
|
|
696
|
+
return style;
|
|
691
697
|
}
|
|
692
698
|
if (gradientStyle) {
|
|
693
699
|
const min = this.adaptableApi.styledColumnApi.internalApi.getNumericStyleMinValue(styledColumn, abColumn, params.node, colValue);
|
|
@@ -10,6 +10,7 @@ export declare class AgGridMenuAdapter {
|
|
|
10
10
|
destroy(): void;
|
|
11
11
|
buildColumnMenu(params: GetMainMenuItemsParams, originalGetMainMenuItems: GetMainMenuItems): (string | MenuItemDef)[];
|
|
12
12
|
buildContextMenu(params: GetContextMenuItemsParams, originalGetContextMenuItems: GetContextMenuItems): (string | MenuItemDef)[];
|
|
13
|
+
private removeConsecutiveSeparators;
|
|
13
14
|
private createColumnMenuContextObject;
|
|
14
15
|
private createAdaptableContextMenuItems;
|
|
15
16
|
private createContextMenuContextObject;
|
|
@@ -17,6 +18,10 @@ export declare class AgGridMenuAdapter {
|
|
|
17
18
|
private mapCustomMenuItemToAgGridMenuDefinition;
|
|
18
19
|
private mapUserMenuItemToAgGridMenuDefinition;
|
|
19
20
|
private buildContextMenuDefaultStructure;
|
|
21
|
+
/**
|
|
22
|
+
* Hide menu group with no subitems or elevate single subitem to parent level
|
|
23
|
+
*/
|
|
24
|
+
private normalizeMenuGroup;
|
|
20
25
|
/**
|
|
21
26
|
* Default strategy for menu items: return as is if there is only one item, otherwise group them under a parent item
|
|
22
27
|
*/
|
|
@@ -25,6 +30,7 @@ export declare class AgGridMenuAdapter {
|
|
|
25
30
|
private getLayoutContextMenuStructure;
|
|
26
31
|
private buildMenuGroupParent;
|
|
27
32
|
private buildColumnMenuDefaultStructure;
|
|
33
|
+
private getColumnFilterColumnMenuStructure;
|
|
28
34
|
private getLayoutColumnMenuStructure;
|
|
29
35
|
private getStyledColumnColumnMenuStructure;
|
|
30
36
|
private mapAdaptableMenuItemToSystemMenuItems;
|
|
@@ -51,7 +51,7 @@ class AgGridMenuAdapter {
|
|
|
51
51
|
'separator',
|
|
52
52
|
...defaultColumnMenuStructure.map((adaptableItem) => this.mapAdaptableMenuItemToAgGridMenuDefinition(adaptableItem)),
|
|
53
53
|
];
|
|
54
|
-
return defaultContextMenu;
|
|
54
|
+
return this.removeConsecutiveSeparators(defaultContextMenu);
|
|
55
55
|
}
|
|
56
56
|
buildContextMenu(params, originalGetContextMenuItems) {
|
|
57
57
|
var _a;
|
|
@@ -61,8 +61,7 @@ class AgGridMenuAdapter {
|
|
|
61
61
|
const menuOptions = this.adaptableOptions.menuOptions;
|
|
62
62
|
const agGridMenuItems = (params.defaultItems ? [...params.defaultItems] : []);
|
|
63
63
|
if (!params.column) {
|
|
64
|
-
|
|
65
|
-
return agGridMenuItems;
|
|
64
|
+
return [];
|
|
66
65
|
}
|
|
67
66
|
const adaptableColumn = this.adaptableApi.columnApi.getColumnWithColumnId((_a = params.column) === null || _a === void 0 ? void 0 : _a.getColId());
|
|
68
67
|
const menuContext = this.createContextMenuContextObject(params, adaptableColumn);
|
|
@@ -84,12 +83,37 @@ class AgGridMenuAdapter {
|
|
|
84
83
|
.filter(Boolean);
|
|
85
84
|
}
|
|
86
85
|
// 2. if not, return the default context menu
|
|
86
|
+
const agGridCopyItems = agGridMenuItems.filter((item) => ['copy', 'copyWithHeaders', 'copyWithGroupHeaders', 'cut', 'paste'].includes(item));
|
|
87
|
+
const otherAgGridItems = agGridMenuItems.filter((item) => !agGridCopyItems.includes(item) &&
|
|
88
|
+
// we provide Adaptable exports in the context menu
|
|
89
|
+
!['export', 'csvExport', 'excelExport'].includes(item));
|
|
87
90
|
const defaultContextMenu = [
|
|
88
|
-
|
|
91
|
+
this.mapCustomMenuItemToAgGridMenuDefinition({
|
|
92
|
+
menuType: 'Group',
|
|
93
|
+
label: 'Copy & Paste',
|
|
94
|
+
icon: {
|
|
95
|
+
name: 'copy',
|
|
96
|
+
},
|
|
97
|
+
subMenuItems: agGridCopyItems.map((item) => ({
|
|
98
|
+
menuType: 'AgGrid',
|
|
99
|
+
name: item,
|
|
100
|
+
})),
|
|
101
|
+
}, menuContext),
|
|
102
|
+
...otherAgGridItems,
|
|
89
103
|
'separator',
|
|
90
104
|
...defaultContextMenuStructure.map((adaptableItem) => this.mapAdaptableMenuItemToAgGridMenuDefinition(adaptableItem)),
|
|
91
105
|
];
|
|
92
|
-
return defaultContextMenu;
|
|
106
|
+
return this.removeConsecutiveSeparators(defaultContextMenu);
|
|
107
|
+
}
|
|
108
|
+
// due to entitlements or other reasons, some menu items might be hidden, leading to consecutive separators
|
|
109
|
+
removeConsecutiveSeparators(menuItems, separator = 'separator') {
|
|
110
|
+
return menuItems.reduce((acc, item, index, array) => {
|
|
111
|
+
if (item === separator && array[index + 1] === separator) {
|
|
112
|
+
return acc;
|
|
113
|
+
}
|
|
114
|
+
acc.push(item);
|
|
115
|
+
return acc;
|
|
116
|
+
}, []);
|
|
93
117
|
}
|
|
94
118
|
createColumnMenuContextObject(adaptableColumn, agGridColumn) {
|
|
95
119
|
return Object.assign(Object.assign({}, this.adaptableInstance.api.internalApi.buildBaseContext()), { adaptableColumn: adaptableColumn, agGridColumn: agGridColumn, isRowGroupColumn: this.adaptableInstance.api.columnApi.isAutoRowGroupColumn(agGridColumn.getColId()) });
|
|
@@ -137,6 +161,9 @@ class AgGridMenuAdapter {
|
|
|
137
161
|
}
|
|
138
162
|
mapAdaptableMenuItemToAgGridMenuDefinition(adaptableMenuItem) {
|
|
139
163
|
var _a;
|
|
164
|
+
if (adaptableMenuItem === '-') {
|
|
165
|
+
return 'separator';
|
|
166
|
+
}
|
|
140
167
|
return {
|
|
141
168
|
name: adaptableMenuItem.label,
|
|
142
169
|
action: adaptableMenuItem.onClick
|
|
@@ -222,7 +249,7 @@ class AgGridMenuAdapter {
|
|
|
222
249
|
// GridInfo
|
|
223
250
|
const gridInfoMenuItems = this.getModuleSpecificStructure('GridInfo', availableMenuItems);
|
|
224
251
|
// Layout
|
|
225
|
-
const
|
|
252
|
+
const [gridActionItems, otherLayoutItems] = this.getLayoutContextMenuStructure(availableMenuItems);
|
|
226
253
|
// Note
|
|
227
254
|
const noteMenuItems = this.getModuleSpecificStructure('Note', availableMenuItems);
|
|
228
255
|
// SettingsPanel
|
|
@@ -231,26 +258,80 @@ class AgGridMenuAdapter {
|
|
|
231
258
|
const smartEditMenuItems = this.getModuleSpecificStructure('SmartEdit', availableMenuItems);
|
|
232
259
|
// SystemStatus
|
|
233
260
|
const systemStatusMenuItems = this.getModuleSpecificStructure('SystemStatus', availableMenuItems);
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
261
|
+
/**
|
|
262
|
+
* Custom structures
|
|
263
|
+
*/
|
|
264
|
+
const gridMenuItem = {
|
|
265
|
+
name: 'grid-group',
|
|
266
|
+
label: 'Grid',
|
|
267
|
+
// TODO
|
|
268
|
+
module: 'ColumnInfo',
|
|
269
|
+
isVisible: true,
|
|
270
|
+
icon: {
|
|
271
|
+
name: 'grid',
|
|
272
|
+
},
|
|
273
|
+
subItems: [
|
|
274
|
+
...gridActionItems,
|
|
275
|
+
...otherLayoutItems,
|
|
276
|
+
...cellSummaryMenuItems,
|
|
277
|
+
...dataImportMenuItems,
|
|
278
|
+
...systemStatusMenuItems,
|
|
279
|
+
...gridInfoMenuItems,
|
|
280
|
+
],
|
|
281
|
+
};
|
|
282
|
+
const editMenuItem = {
|
|
283
|
+
name: 'edit-group',
|
|
284
|
+
label: 'Edit',
|
|
285
|
+
// TODO
|
|
286
|
+
module: 'ColumnInfo',
|
|
287
|
+
isVisible: true,
|
|
288
|
+
icon: {
|
|
289
|
+
name: 'edit-table',
|
|
290
|
+
},
|
|
291
|
+
subItems: [...bulkUpdateMenuItems, ...smartEditMenuItems],
|
|
292
|
+
};
|
|
293
|
+
const columnMenuItem = {
|
|
294
|
+
name: 'column-group',
|
|
295
|
+
label: 'Column',
|
|
296
|
+
// TODO
|
|
297
|
+
module: 'ColumnInfo',
|
|
298
|
+
isVisible: true,
|
|
299
|
+
icon: {
|
|
300
|
+
name: 'columns',
|
|
301
|
+
},
|
|
302
|
+
subItems: [...calculatedColumnMenuItems, ...columnInfoMenuItems],
|
|
303
|
+
};
|
|
304
|
+
return this.removeConsecutiveSeparators([
|
|
244
305
|
...exportMenuItems,
|
|
245
|
-
|
|
246
|
-
...flashingCellMenuItems,
|
|
247
|
-
...gridInfoMenuItems,
|
|
248
|
-
...layoutMenuItems,
|
|
306
|
+
'-',
|
|
249
307
|
...noteMenuItems,
|
|
308
|
+
...commentMenuItems,
|
|
309
|
+
...columnFilterMenuItems,
|
|
310
|
+
...flashingCellMenuItems,
|
|
311
|
+
...alertMenuItems,
|
|
312
|
+
...fdc3MenuItems,
|
|
313
|
+
'-',
|
|
250
314
|
...settingsPanelMenuItems,
|
|
251
|
-
...
|
|
252
|
-
|
|
253
|
-
|
|
315
|
+
...dashboardMenuItems,
|
|
316
|
+
'-',
|
|
317
|
+
...this.normalizeMenuGroup(editMenuItem),
|
|
318
|
+
'-',
|
|
319
|
+
...this.normalizeMenuGroup(gridMenuItem),
|
|
320
|
+
...this.normalizeMenuGroup(columnMenuItem),
|
|
321
|
+
], '-');
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Hide menu group with no subitems or elevate single subitem to parent level
|
|
325
|
+
*/
|
|
326
|
+
normalizeMenuGroup(menuItem) {
|
|
327
|
+
var _a, _b;
|
|
328
|
+
if (!((_a = menuItem.subItems) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
329
|
+
return [];
|
|
330
|
+
}
|
|
331
|
+
if (((_b = menuItem.subItems) === null || _b === void 0 ? void 0 : _b.length) === 1) {
|
|
332
|
+
return [menuItem.subItems[0]];
|
|
333
|
+
}
|
|
334
|
+
return [menuItem];
|
|
254
335
|
}
|
|
255
336
|
/**
|
|
256
337
|
* Default strategy for menu items: return as is if there is only one item, otherwise group them under a parent item
|
|
@@ -270,40 +351,46 @@ class AgGridMenuAdapter {
|
|
|
270
351
|
if (!exportMenuItems.length) {
|
|
271
352
|
return [];
|
|
272
353
|
}
|
|
273
|
-
const
|
|
274
|
-
const
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
this.buildMenuGroupParent('Export', cellSelectionItems, {
|
|
280
|
-
label: 'Export Selected Cells',
|
|
354
|
+
const visualReportItems = exportMenuItems.filter((item) => item.name.startsWith('export-visual-data-excel'));
|
|
355
|
+
const visualDataExportItems = visualReportItems.length
|
|
356
|
+
? [
|
|
357
|
+
this.buildMenuGroupParent('Export', exportMenuItems.filter((item) => item.name.startsWith('export-visual-data-excel')), {
|
|
358
|
+
label: 'Visual Data',
|
|
359
|
+
icon: false,
|
|
281
360
|
}),
|
|
282
|
-
]
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
361
|
+
]
|
|
362
|
+
: [];
|
|
363
|
+
const allDataExportItems = this.normalizeMenuGroup(this.buildMenuGroupParent('Export', exportMenuItems.filter((item) => item.name.startsWith('export-all-data')), {
|
|
364
|
+
label: 'All Data',
|
|
365
|
+
icon: false,
|
|
366
|
+
}));
|
|
367
|
+
const currentDataExportItems = this.normalizeMenuGroup(this.buildMenuGroupParent('Export', exportMenuItems.filter((item) => item.name.startsWith('export-current-data')), {
|
|
368
|
+
label: 'Current Data',
|
|
369
|
+
icon: false,
|
|
370
|
+
}));
|
|
371
|
+
const selectedCellsExportItems = this.normalizeMenuGroup(this.buildMenuGroupParent('Export', exportMenuItems.filter((item) => item.name.startsWith('export-selected-cells')), {
|
|
372
|
+
label: 'Selected Cells',
|
|
373
|
+
icon: false,
|
|
374
|
+
}));
|
|
375
|
+
const selectedRowsExportItems = this.normalizeMenuGroup(this.buildMenuGroupParent('Export', exportMenuItems.filter((item) => item.name.startsWith('export-selected-rows')), {
|
|
376
|
+
label: 'Selected Rows',
|
|
377
|
+
icon: false,
|
|
378
|
+
}));
|
|
379
|
+
return this.normalizeMenuGroup(this.buildMenuGroupParent('Export', [
|
|
380
|
+
...visualDataExportItems,
|
|
381
|
+
...allDataExportItems,
|
|
382
|
+
...currentDataExportItems,
|
|
383
|
+
...selectedCellsExportItems,
|
|
384
|
+
...selectedRowsExportItems,
|
|
385
|
+
], {
|
|
386
|
+
label: 'Export',
|
|
387
|
+
icon: 'export',
|
|
388
|
+
}));
|
|
302
389
|
}
|
|
303
390
|
getLayoutContextMenuStructure(menuItems) {
|
|
304
391
|
const layoutMenuItems = menuItems.filter((menuItem) => menuItem.module === 'Layout');
|
|
305
392
|
if (!layoutMenuItems.length) {
|
|
306
|
-
return [];
|
|
393
|
+
return [[], []];
|
|
307
394
|
}
|
|
308
395
|
const gridActionsItemNames = [
|
|
309
396
|
'layout-clear-selection',
|
|
@@ -312,25 +399,20 @@ class AgGridMenuAdapter {
|
|
|
312
399
|
];
|
|
313
400
|
const gridActionsItems = layoutMenuItems.filter((item) => gridActionsItemNames.includes(item.name));
|
|
314
401
|
const otherLayoutItems = layoutMenuItems.filter((item) => !gridActionsItemNames.includes(item.name));
|
|
315
|
-
return [
|
|
316
|
-
this.buildMenuGroupParent('Layout', gridActionsItems, {
|
|
317
|
-
label: 'Grid',
|
|
318
|
-
icon: 'align-justify',
|
|
319
|
-
}),
|
|
320
|
-
...otherLayoutItems,
|
|
321
|
-
];
|
|
402
|
+
return [gridActionsItems, otherLayoutItems];
|
|
322
403
|
}
|
|
323
404
|
buildMenuGroupParent(module, menuItems, config) {
|
|
324
405
|
var _a, _b;
|
|
325
406
|
const moduleInfo = this.adaptableInstance.ModuleService.getModuleInfoByModule(module);
|
|
407
|
+
const icon = config && config.icon === false
|
|
408
|
+
? undefined
|
|
409
|
+
: { name: (_a = config === null || config === void 0 ? void 0 : config.icon) !== null && _a !== void 0 ? _a : moduleInfo.Glyph };
|
|
326
410
|
return {
|
|
327
|
-
name: 'menu-group
|
|
328
|
-
label: (
|
|
411
|
+
name: 'menu-group',
|
|
412
|
+
label: (_b = config === null || config === void 0 ? void 0 : config.label) !== null && _b !== void 0 ? _b : moduleInfo.FriendlyName,
|
|
329
413
|
isVisible: true,
|
|
330
414
|
module: moduleInfo.ModuleName,
|
|
331
|
-
icon
|
|
332
|
-
name: (_b = config === null || config === void 0 ? void 0 : config.icon) !== null && _b !== void 0 ? _b : moduleInfo.Glyph,
|
|
333
|
-
},
|
|
415
|
+
icon,
|
|
334
416
|
subItems: menuItems,
|
|
335
417
|
};
|
|
336
418
|
}
|
|
@@ -340,7 +422,7 @@ class AgGridMenuAdapter {
|
|
|
340
422
|
// CellSummary
|
|
341
423
|
const cellSummaryMenuItems = this.getModuleSpecificStructure('CellSummary', availableMenuItems);
|
|
342
424
|
// ColumnFilter
|
|
343
|
-
const
|
|
425
|
+
const [columnFilterGroup, filterVisibilityItems] = this.getColumnFilterColumnMenuStructure(availableMenuItems);
|
|
344
426
|
// ColumnInfo
|
|
345
427
|
const columnInfoMenuItems = this.getModuleSpecificStructure('ColumnInfo', availableMenuItems);
|
|
346
428
|
// CustomSort
|
|
@@ -358,7 +440,7 @@ class AgGridMenuAdapter {
|
|
|
358
440
|
// GridInfo
|
|
359
441
|
const gridInfoMenuItems = this.getModuleSpecificStructure('GridInfo', availableMenuItems);
|
|
360
442
|
// Layout
|
|
361
|
-
const
|
|
443
|
+
const [gridSelectItems, columnSelectItems, columnActionGroup, otherLayoutItems] = this.getLayoutColumnMenuStructure(availableMenuItems);
|
|
362
444
|
// PlusMinus
|
|
363
445
|
const plusMinusMenuItems = this.getModuleSpecificStructure('PlusMinus', availableMenuItems);
|
|
364
446
|
// SettingsPanel
|
|
@@ -367,62 +449,114 @@ class AgGridMenuAdapter {
|
|
|
367
449
|
const styledColumnMenuItems = this.getStyledColumnColumnMenuStructure(availableMenuItems);
|
|
368
450
|
// SystemStatus
|
|
369
451
|
const systemStatusMenuItems = this.getModuleSpecificStructure('SystemStatus', availableMenuItems);
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
452
|
+
/**
|
|
453
|
+
* Custom structures
|
|
454
|
+
*/
|
|
455
|
+
const gridMenuItem = {
|
|
456
|
+
name: 'grid-group',
|
|
457
|
+
label: 'Grid',
|
|
458
|
+
// TODO
|
|
459
|
+
module: 'ColumnInfo',
|
|
460
|
+
isVisible: true,
|
|
461
|
+
icon: {
|
|
462
|
+
name: 'grid',
|
|
463
|
+
},
|
|
464
|
+
subItems: [
|
|
465
|
+
...otherLayoutItems,
|
|
466
|
+
...filterVisibilityItems,
|
|
467
|
+
...gridSelectItems,
|
|
468
|
+
...cellSummaryMenuItems,
|
|
469
|
+
...dataImportMenuItems,
|
|
470
|
+
...systemStatusMenuItems,
|
|
471
|
+
...gridInfoMenuItems,
|
|
472
|
+
],
|
|
473
|
+
};
|
|
474
|
+
const columnMenuItem = {
|
|
475
|
+
name: 'column-group',
|
|
476
|
+
label: 'Column',
|
|
477
|
+
// TODO
|
|
478
|
+
module: 'ColumnInfo',
|
|
479
|
+
isVisible: true,
|
|
480
|
+
icon: {
|
|
481
|
+
name: 'columns',
|
|
482
|
+
},
|
|
483
|
+
subItems: [
|
|
484
|
+
...columnActionGroup,
|
|
485
|
+
...calculatedColumnMenuItems,
|
|
486
|
+
...freeTextColumnMenuItems,
|
|
487
|
+
...customSortMenuItems,
|
|
488
|
+
...plusMinusMenuItems,
|
|
489
|
+
...columnSelectItems,
|
|
490
|
+
...columnInfoMenuItems,
|
|
491
|
+
],
|
|
492
|
+
};
|
|
493
|
+
const createStyleMenuItem = {
|
|
494
|
+
name: 'styling-group',
|
|
495
|
+
label: 'Styling',
|
|
496
|
+
// TODO
|
|
497
|
+
module: 'ColumnInfo',
|
|
498
|
+
isVisible: true,
|
|
499
|
+
icon: {
|
|
500
|
+
name: 'brush',
|
|
501
|
+
},
|
|
502
|
+
subItems: [...formatColumnMenuItems, ...styledColumnMenuItems, ...flashingCellMenuItems],
|
|
503
|
+
};
|
|
504
|
+
return this.removeConsecutiveSeparators([
|
|
384
505
|
...settingsPanelMenuItems,
|
|
385
|
-
...
|
|
386
|
-
...
|
|
387
|
-
|
|
506
|
+
...dashboardMenuItems,
|
|
507
|
+
...columnFilterGroup,
|
|
508
|
+
...this.normalizeMenuGroup(createStyleMenuItem),
|
|
509
|
+
...this.normalizeMenuGroup(gridMenuItem),
|
|
510
|
+
...this.normalizeMenuGroup(columnMenuItem),
|
|
511
|
+
], '-');
|
|
512
|
+
}
|
|
513
|
+
getColumnFilterColumnMenuStructure(menuItems) {
|
|
514
|
+
const columnFilterMenuItems = menuItems.filter((menuItem) => menuItem.module === 'ColumnFilter');
|
|
515
|
+
const filterVisibilityItems = columnFilterMenuItems.filter((item) => ['column-filter-bar-hide', 'column-filter-bar-show'].includes(item.name));
|
|
516
|
+
const filterActionItems = columnFilterMenuItems.filter((item) => ['column-filter-clear', 'column-filter-suspend', 'column-filter-unsuspend'].includes(item.name));
|
|
517
|
+
const columnFilterGroup = filterActionItems.length
|
|
518
|
+
? [
|
|
519
|
+
{
|
|
520
|
+
name: 'column-filter-group',
|
|
521
|
+
label: 'Filter',
|
|
522
|
+
module: 'ColumnFilter',
|
|
523
|
+
isVisible: true,
|
|
524
|
+
icon: {
|
|
525
|
+
name: 'filter',
|
|
526
|
+
},
|
|
527
|
+
subItems: filterActionItems,
|
|
528
|
+
},
|
|
529
|
+
]
|
|
530
|
+
: [];
|
|
531
|
+
return [columnFilterGroup, filterVisibilityItems];
|
|
388
532
|
}
|
|
389
533
|
getLayoutColumnMenuStructure(menuItems) {
|
|
390
534
|
const layoutMenuItems = menuItems.filter((menuItem) => menuItem.module === 'Layout');
|
|
391
535
|
if (!layoutMenuItems.length) {
|
|
392
|
-
return [];
|
|
536
|
+
return [[], [], [], []];
|
|
393
537
|
}
|
|
394
|
-
const
|
|
538
|
+
const columnSelectItemNames = [
|
|
395
539
|
'layout-column-select-preserve',
|
|
396
540
|
'layout-column-select-reset',
|
|
397
541
|
'layout-column-select',
|
|
398
|
-
'layout-select-all',
|
|
399
|
-
];
|
|
400
|
-
const selectActionsItems = layoutMenuItems.filter((item) => selectActionsItemNames.includes(item.name));
|
|
401
|
-
const otherLayoutItems = layoutMenuItems.filter((item) => !selectActionsItemNames.includes(item.name));
|
|
402
|
-
return [
|
|
403
|
-
...otherLayoutItems,
|
|
404
|
-
this.buildMenuGroupParent('Layout', selectActionsItems, {
|
|
405
|
-
label: 'Select',
|
|
406
|
-
icon: 'tab-unselected',
|
|
407
|
-
}),
|
|
408
542
|
];
|
|
543
|
+
const columnSelectItems = layoutMenuItems.filter((item) => columnSelectItemNames.includes(item.name));
|
|
544
|
+
const gridSelectItems = layoutMenuItems.filter((item) => item.name === 'layout-grid-select');
|
|
545
|
+
const columnActionGroup = layoutMenuItems.filter((item) => ['layout-column-caption-change', 'layout-column-hide'].includes(item.name));
|
|
546
|
+
const otherLayoutItems = layoutMenuItems.filter((item) => !columnSelectItemNames.includes(item.name) &&
|
|
547
|
+
!['layout-column-caption-change', 'layout-column-hide'].includes(item.name) &&
|
|
548
|
+
item.name !== 'layout-grid-select');
|
|
549
|
+
return [gridSelectItems, columnSelectItems, columnActionGroup, otherLayoutItems];
|
|
409
550
|
}
|
|
410
551
|
getStyledColumnColumnMenuStructure(menuItems) {
|
|
411
552
|
const styledColumnMenuItems = menuItems.filter((menuItem) => menuItem.module === 'StyledColumn');
|
|
412
|
-
|
|
413
|
-
return [];
|
|
414
|
-
}
|
|
415
|
-
if (styledColumnMenuItems.length === 1) {
|
|
416
|
-
return styledColumnMenuItems;
|
|
417
|
-
}
|
|
418
|
-
return [
|
|
419
|
-
this.buildMenuGroupParent('StyledColumn', styledColumnMenuItems, {
|
|
420
|
-
label: 'Create Styled Column',
|
|
421
|
-
}),
|
|
422
|
-
];
|
|
553
|
+
return styledColumnMenuItems;
|
|
423
554
|
}
|
|
424
555
|
mapAdaptableMenuItemToSystemMenuItems(adaptableMenuItems) {
|
|
425
556
|
return (adaptableMenuItems !== null && adaptableMenuItems !== void 0 ? adaptableMenuItems : []).map((menuItem) => {
|
|
557
|
+
if (menuItem === '-') {
|
|
558
|
+
return menuItem;
|
|
559
|
+
}
|
|
426
560
|
let subItems = menuItem.subItems;
|
|
427
561
|
if (subItems && subItems.length > 0) {
|
|
428
562
|
subItems = subItems.map((subItem) => this.mapAdaptableMenuItemToSystemMenuItems(subItem.subItems));
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const Badge_1 = require("../View/Components/Badge");
|
|
6
6
|
const renderWithAdaptableContext_1 = require("../View/renderWithAdaptableContext");
|
|
7
7
|
const React = tslib_1.__importStar(require("react"));
|
|
8
|
+
const RowSummary_1 = require("../PredefinedConfig/Common/RowSummary");
|
|
8
9
|
const getBadgeRendererForColumn = (styledColumn, abColumn, api) => {
|
|
9
10
|
if (!styledColumn.BadgeStyle) {
|
|
10
11
|
return;
|
|
@@ -15,7 +16,7 @@ const getBadgeRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
15
16
|
return adaptable;
|
|
16
17
|
}
|
|
17
18
|
init(params) {
|
|
18
|
-
var _a, _b, _c;
|
|
19
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
19
20
|
const adaptable = this.getAdaptableInstance(params);
|
|
20
21
|
const adapatableApi = adaptable.api;
|
|
21
22
|
this.eGui = document.createElement('div');
|
|
@@ -27,6 +28,11 @@ const getBadgeRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
27
28
|
this.eGui.innerHTML = formattedValue;
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
31
|
+
if (((_d = params === null || params === void 0 ? void 0 : params.data) === null || _d === void 0 ? void 0 : _d[RowSummary_1.ROW_SUMMARY_ROW_ID]) && !styledColumn.IncludeRowSummaries) {
|
|
32
|
+
const formattedValue = (_g = (_f = (_e = params.formatValue) === null || _e === void 0 ? void 0 : _e.call(params, params.value)) !== null && _f !== void 0 ? _f : params.value) !== null && _g !== void 0 ? _g : '';
|
|
33
|
+
this.eGui.innerHTML = formattedValue;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
30
36
|
if (['NumberArray', 'StringArray'].includes(abColumn.dataType)) {
|
|
31
37
|
this.renderArrayValues(params, adapatableApi);
|
|
32
38
|
}
|
|
@@ -17,7 +17,9 @@ const getPercentBarRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
17
17
|
if (Helper_1.default.objectNotExists(value)) {
|
|
18
18
|
value = 0;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
// No longer support showing Percent Bar in Grouped Rows
|
|
21
|
+
if (api.gridApi.isGroupRowNode(params.node)) {
|
|
22
|
+
// if (!styledColumn.IncludeGroupedRows && api.gridApi.isGroupRowNode(params.node)) {
|
|
21
23
|
if (params.value) {
|
|
22
24
|
this.eGui = document.createElement('div');
|
|
23
25
|
this.eGui.append(params.value);
|
|
@@ -7,8 +7,12 @@ const react_redux_1 = require("react-redux");
|
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const Loader_1 = require("../Loader");
|
|
9
9
|
const AdaptableContext_1 = require("../../View/AdaptableContext");
|
|
10
|
+
const ExternalRenderer_1 = require("../../View/Components/ExternalRenderer");
|
|
11
|
+
const Dialog_1 = tslib_1.__importDefault(require("../Dialog"));
|
|
12
|
+
const rebass_1 = require("rebass");
|
|
10
13
|
const ProgressIndicator = () => {
|
|
11
|
-
const
|
|
14
|
+
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
15
|
+
const { active, text, render, frameworkComponent } = (0, react_redux_1.useSelector)((state) => state.System.ProgressIndicator);
|
|
12
16
|
const [visible, setVisible] = (0, react_1.useState)(false);
|
|
13
17
|
const [progressIndicatorCoordinates, setProgressIndicatorCoordinates] = (0, react_1.useState)({
|
|
14
18
|
top: 0,
|
|
@@ -16,7 +20,6 @@ const ProgressIndicator = () => {
|
|
|
16
20
|
height: 0,
|
|
17
21
|
width: 0,
|
|
18
22
|
});
|
|
19
|
-
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
20
23
|
const disableAdaptableGrid = (containerElement, disabled) => {
|
|
21
24
|
const DISABLING_CSS_CLASS = 'ab-wait-for-progress-indicator';
|
|
22
25
|
if (!containerElement) {
|
|
@@ -39,15 +42,21 @@ const ProgressIndicator = () => {
|
|
|
39
42
|
(0, react_1.useEffect)(() => {
|
|
40
43
|
disableAdaptableGrid(adaptable.getAdaptableContainerElement(), active);
|
|
41
44
|
disableAdaptableGrid(adaptable.getAgGridContainerElement(), active);
|
|
42
|
-
updateGridContainerCoordinates(adaptable.
|
|
45
|
+
updateGridContainerCoordinates(adaptable.getAgGridContainerElement());
|
|
43
46
|
// without rAF the progress indicator would be rendered instantly, without the 'transition-delay' defined via CSS
|
|
44
47
|
requestAnimationFrame(() => {
|
|
45
48
|
setVisible(active);
|
|
46
49
|
});
|
|
47
50
|
}, [active]);
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
let customEl = null;
|
|
52
|
+
if (render || frameworkComponent) {
|
|
53
|
+
customEl = React.createElement(ExternalRenderer_1.ExternalRenderer, { render: render, frameworkComponent: frameworkComponent });
|
|
54
|
+
}
|
|
55
|
+
return (React.createElement(React.Fragment, null, active && (React.createElement(Dialog_1.default, { modal: true, isOpen: true, showCloseButton: false, className: `ab-ProgressIndicator ${visible ? 'ab-ProgressIndicator--visible' : ''}` },
|
|
56
|
+
React.createElement(rebass_1.Flex, { alignItems: "center", flexDirection: "column", p: 3, className: "ab-ProgressIndicator-body" },
|
|
50
57
|
React.createElement(Loader_1.LoaderSpinner, null),
|
|
51
|
-
React.createElement(
|
|
58
|
+
React.createElement(rebass_1.Box, { mt: 3 },
|
|
59
|
+
text && React.createElement(rebass_1.Box, null, text),
|
|
60
|
+
customEl))))));
|
|
52
61
|
};
|
|
53
62
|
exports.ProgressIndicator = ProgressIndicator;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const React = tslib_1.__importStar(require("react"));
|
|
5
|
+
const DefaultIcon_1 = tslib_1.__importDefault(require("./DefaultIcon"));
|
|
6
|
+
exports.default = (props) => (React.createElement(DefaultIcon_1.default, Object.assign({}, props, { viewBox: "0 -960 960 960" }),
|
|
7
|
+
React.createElement("path", { d: "M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z" })));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const React = tslib_1.__importStar(require("react"));
|
|
5
|
+
const DefaultIcon_1 = tslib_1.__importDefault(require("./DefaultIcon"));
|
|
6
|
+
exports.default = (props) => (React.createElement(DefaultIcon_1.default, Object.assign({}, props, { viewBox: "0 -960 960 960" }),
|
|
7
|
+
React.createElement("path", { d: "m592-481-57-57 143-182H353l-80-80h487q25 0 36 22t-4 42L592-481ZM791-56 560-287v87q0 17-11.5 28.5T520-160h-80q-17 0-28.5-11.5T400-200v-247L56-791l56-57 736 736-57 56ZM535-538Z" })));
|