@adaptabletools/adaptable 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.
Files changed (83) hide show
  1. package/base.css +3 -13
  2. package/base.css.map +1 -1
  3. package/index.css +3 -13
  4. package/index.css.map +1 -1
  5. package/package.json +1 -1
  6. package/src/AdaptableOptions/AdaptableFrameworkComponent.d.ts +3 -0
  7. package/src/AdaptableOptions/MenuOptions.d.ts +3 -3
  8. package/src/Api/GridApi.d.ts +4 -1
  9. package/src/Api/Implementation/ColumnApiImpl.js +6 -6
  10. package/src/Api/Implementation/ConfigApiImpl.js +0 -1
  11. package/src/Api/Implementation/ExpressionApiImpl.js +12 -12
  12. package/src/Api/Implementation/GridApiImpl.d.ts +1 -1
  13. package/src/Api/Implementation/GridApiImpl.js +8 -3
  14. package/src/Api/Implementation/ScopeApiImpl.js +4 -4
  15. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +14 -5
  16. package/src/Api/Implementation/UserInterfaceApiImpl.js +26 -4
  17. package/src/Api/Internal/AdaptableInternalApi.d.ts +0 -1
  18. package/src/Api/Internal/AdaptableInternalApi.js +2 -6
  19. package/src/Api/Internal/ColumnFilterInternalApi.js +2 -2
  20. package/src/Api/Internal/DashboardInternalApi.js +2 -2
  21. package/src/Api/Internal/FormatColumnInternalApi.js +11 -5
  22. package/src/Api/Internal/GridFilterInternalApi.d.ts +2 -2
  23. package/src/Api/Internal/GridFilterInternalApi.js +2 -2
  24. package/src/Api/Internal/LayoutInternalApi.js +1 -1
  25. package/src/Api/UserInterfaceApi.d.ts +15 -2
  26. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
  27. package/src/PredefinedConfig/Common/Fdc3Intent.d.ts +2 -2
  28. package/src/PredefinedConfig/Common/Menu.d.ts +4 -4
  29. package/src/PredefinedConfig/Common/Menu.js +30 -17
  30. package/src/PredefinedConfig/Common/TransposeConfig.d.ts +3 -3
  31. package/src/PredefinedConfig/FormatColumnState.d.ts +4 -0
  32. package/src/PredefinedConfig/PopupState.d.ts +1 -2
  33. package/src/PredefinedConfig/StyledColumnState.d.ts +5 -0
  34. package/src/PredefinedConfig/SystemState.d.ts +4 -2
  35. package/src/Redux/ActionsReducers/PopupRedux.d.ts +5 -13
  36. package/src/Redux/ActionsReducers/PopupRedux.js +0 -19
  37. package/src/Redux/ActionsReducers/SystemRedux.d.ts +9 -3
  38. package/src/Redux/ActionsReducers/SystemRedux.js +8 -5
  39. package/src/Strategy/ColumnFilterModule.js +1 -1
  40. package/src/Strategy/ColumnInfoModule.js +2 -2
  41. package/src/Strategy/ExportModule.d.ts +0 -1
  42. package/src/Strategy/ExportModule.js +39 -28
  43. package/src/Strategy/GridInfoModule.js +1 -1
  44. package/src/Strategy/LayoutModule.d.ts +1 -8
  45. package/src/Strategy/LayoutModule.js +11 -121
  46. package/src/Strategy/StyledColumnModule.js +14 -10
  47. package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +1 -0
  48. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +4 -2
  49. package/src/Utilities/Interface/MessagePopups.d.ts +0 -3
  50. package/src/Utilities/Services/RowSummaryService.d.ts +22 -0
  51. package/src/Utilities/Services/RowSummaryService.js +141 -0
  52. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.d.ts +1 -1
  53. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +11 -2
  54. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +1 -1
  55. package/src/View/StyledColumn/Wizard/StyledColumnWizardSettingsSection.js +14 -10
  56. package/src/agGrid/AdaptableAgGrid.js +2 -1
  57. package/src/agGrid/AgGridColumnAdapter.js +19 -13
  58. package/src/agGrid/AgGridMenuAdapter.d.ts +6 -0
  59. package/src/agGrid/AgGridMenuAdapter.js +240 -106
  60. package/src/agGrid/BadgeRenderer.js +7 -1
  61. package/src/agGrid/PercentBarRenderer.js +3 -1
  62. package/src/components/CheckBox/index.js +1 -1
  63. package/src/components/ProgressIndicator/ProgressIndicator.js +15 -6
  64. package/src/components/icons/copy.d.ts +3 -0
  65. package/src/components/icons/copy.js +4 -0
  66. package/src/components/icons/filter-off.d.ts +3 -0
  67. package/src/components/icons/filter-off.js +4 -0
  68. package/src/components/icons/grid-info.d.ts +3 -0
  69. package/src/components/icons/grid-info.js +4 -0
  70. package/src/components/icons/index.js +12 -0
  71. package/src/components/icons/select-all.d.ts +3 -0
  72. package/src/components/icons/select-all.js +4 -0
  73. package/src/components/icons/select-fwd.d.ts +3 -0
  74. package/src/components/icons/select-fwd.js +4 -0
  75. package/src/components/icons/select-off.d.ts +3 -0
  76. package/src/components/icons/select-off.js +4 -0
  77. package/src/env.js +2 -2
  78. package/src/metamodel/adaptable.metamodel.js +1 -1
  79. package/src/parser/src/parser.js +1218 -55
  80. package/src/parser/src/predicate/mapQlPredicateToExpression.js +1 -3
  81. package/src/parser/src/types.js +1 -2
  82. package/src/types.d.ts +1 -1
  83. package/tsconfig.esm.tsbuildinfo +1 -1
@@ -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;
@@ -47,7 +47,7 @@ export class AgGridMenuAdapter {
47
47
  'separator',
48
48
  ...defaultColumnMenuStructure.map((adaptableItem) => this.mapAdaptableMenuItemToAgGridMenuDefinition(adaptableItem)),
49
49
  ];
50
- return defaultContextMenu;
50
+ return this.removeConsecutiveSeparators(defaultContextMenu);
51
51
  }
52
52
  buildContextMenu(params, originalGetContextMenuItems) {
53
53
  var _a;
@@ -57,8 +57,7 @@ export class AgGridMenuAdapter {
57
57
  const menuOptions = this.adaptableOptions.menuOptions;
58
58
  const agGridMenuItems = (params.defaultItems ? [...params.defaultItems] : []);
59
59
  if (!params.column) {
60
- // return only AG Grid context if the Adaptable column is not found (should not happen)
61
- return agGridMenuItems;
60
+ return [];
62
61
  }
63
62
  const adaptableColumn = this.adaptableApi.columnApi.getColumnWithColumnId((_a = params.column) === null || _a === void 0 ? void 0 : _a.getColId());
64
63
  const menuContext = this.createContextMenuContextObject(params, adaptableColumn);
@@ -80,12 +79,37 @@ export class AgGridMenuAdapter {
80
79
  .filter(Boolean);
81
80
  }
82
81
  // 2. if not, return the default context menu
82
+ const agGridCopyItems = agGridMenuItems.filter((item) => ['copy', 'copyWithHeaders', 'copyWithGroupHeaders', 'cut', 'paste'].includes(item));
83
+ const otherAgGridItems = agGridMenuItems.filter((item) => !agGridCopyItems.includes(item) &&
84
+ // we provide Adaptable exports in the context menu
85
+ !['export', 'csvExport', 'excelExport'].includes(item));
83
86
  const defaultContextMenu = [
84
- ...agGridMenuItems,
87
+ this.mapCustomMenuItemToAgGridMenuDefinition({
88
+ menuType: 'Group',
89
+ label: 'Copy & Paste',
90
+ icon: {
91
+ name: 'copy',
92
+ },
93
+ subMenuItems: agGridCopyItems.map((item) => ({
94
+ menuType: 'AgGrid',
95
+ name: item,
96
+ })),
97
+ }, menuContext),
98
+ ...otherAgGridItems,
85
99
  'separator',
86
100
  ...defaultContextMenuStructure.map((adaptableItem) => this.mapAdaptableMenuItemToAgGridMenuDefinition(adaptableItem)),
87
101
  ];
88
- return defaultContextMenu;
102
+ return this.removeConsecutiveSeparators(defaultContextMenu);
103
+ }
104
+ // due to entitlements or other reasons, some menu items might be hidden, leading to consecutive separators
105
+ removeConsecutiveSeparators(menuItems, separator = 'separator') {
106
+ return menuItems.reduce((acc, item, index, array) => {
107
+ if (item === separator && array[index + 1] === separator) {
108
+ return acc;
109
+ }
110
+ acc.push(item);
111
+ return acc;
112
+ }, []);
89
113
  }
90
114
  createColumnMenuContextObject(adaptableColumn, agGridColumn) {
91
115
  return Object.assign(Object.assign({}, this.adaptableInstance.api.internalApi.buildBaseContext()), { adaptableColumn: adaptableColumn, agGridColumn: agGridColumn, isRowGroupColumn: this.adaptableInstance.api.columnApi.isAutoRowGroupColumn(agGridColumn.getColId()) });
@@ -133,6 +157,9 @@ export class AgGridMenuAdapter {
133
157
  }
134
158
  mapAdaptableMenuItemToAgGridMenuDefinition(adaptableMenuItem) {
135
159
  var _a;
160
+ if (adaptableMenuItem === '-') {
161
+ return 'separator';
162
+ }
136
163
  return {
137
164
  name: adaptableMenuItem.label,
138
165
  action: adaptableMenuItem.onClick
@@ -218,7 +245,7 @@ export class AgGridMenuAdapter {
218
245
  // GridInfo
219
246
  const gridInfoMenuItems = this.getModuleSpecificStructure('GridInfo', availableMenuItems);
220
247
  // Layout
221
- const layoutMenuItems = this.getLayoutContextMenuStructure(availableMenuItems);
248
+ const [gridActionItems, otherLayoutItems] = this.getLayoutContextMenuStructure(availableMenuItems);
222
249
  // Note
223
250
  const noteMenuItems = this.getModuleSpecificStructure('Note', availableMenuItems);
224
251
  // SettingsPanel
@@ -227,26 +254,80 @@ export class AgGridMenuAdapter {
227
254
  const smartEditMenuItems = this.getModuleSpecificStructure('SmartEdit', availableMenuItems);
228
255
  // SystemStatus
229
256
  const systemStatusMenuItems = this.getModuleSpecificStructure('SystemStatus', availableMenuItems);
230
- return [
231
- ...alertMenuItems,
232
- ...bulkUpdateMenuItems,
233
- ...calculatedColumnMenuItems,
234
- ...cellSummaryMenuItems,
235
- ...columnFilterMenuItems,
236
- ...columnInfoMenuItems,
237
- ...commentMenuItems,
238
- ...dashboardMenuItems,
239
- ...dataImportMenuItems,
257
+ /**
258
+ * Custom structures
259
+ */
260
+ const gridMenuItem = {
261
+ name: 'grid-group',
262
+ label: 'Grid',
263
+ // TODO
264
+ module: 'ColumnInfo',
265
+ isVisible: true,
266
+ icon: {
267
+ name: 'grid',
268
+ },
269
+ subItems: [
270
+ ...gridActionItems,
271
+ ...otherLayoutItems,
272
+ ...cellSummaryMenuItems,
273
+ ...dataImportMenuItems,
274
+ ...systemStatusMenuItems,
275
+ ...gridInfoMenuItems,
276
+ ],
277
+ };
278
+ const editMenuItem = {
279
+ name: 'edit-group',
280
+ label: 'Edit',
281
+ // TODO
282
+ module: 'ColumnInfo',
283
+ isVisible: true,
284
+ icon: {
285
+ name: 'edit-table',
286
+ },
287
+ subItems: [...bulkUpdateMenuItems, ...smartEditMenuItems],
288
+ };
289
+ const columnMenuItem = {
290
+ name: 'column-group',
291
+ label: 'Column',
292
+ // TODO
293
+ module: 'ColumnInfo',
294
+ isVisible: true,
295
+ icon: {
296
+ name: 'columns',
297
+ },
298
+ subItems: [...calculatedColumnMenuItems, ...columnInfoMenuItems],
299
+ };
300
+ return this.removeConsecutiveSeparators([
240
301
  ...exportMenuItems,
241
- ...fdc3MenuItems,
242
- ...flashingCellMenuItems,
243
- ...gridInfoMenuItems,
244
- ...layoutMenuItems,
302
+ '-',
245
303
  ...noteMenuItems,
304
+ ...commentMenuItems,
305
+ ...columnFilterMenuItems,
306
+ ...flashingCellMenuItems,
307
+ ...alertMenuItems,
308
+ ...fdc3MenuItems,
309
+ '-',
246
310
  ...settingsPanelMenuItems,
247
- ...smartEditMenuItems,
248
- ...systemStatusMenuItems,
249
- ];
311
+ ...dashboardMenuItems,
312
+ '-',
313
+ ...this.normalizeMenuGroup(editMenuItem),
314
+ '-',
315
+ ...this.normalizeMenuGroup(gridMenuItem),
316
+ ...this.normalizeMenuGroup(columnMenuItem),
317
+ ], '-');
318
+ }
319
+ /**
320
+ * Hide menu group with no subitems or elevate single subitem to parent level
321
+ */
322
+ normalizeMenuGroup(menuItem) {
323
+ var _a, _b;
324
+ if (!((_a = menuItem.subItems) === null || _a === void 0 ? void 0 : _a.length)) {
325
+ return [];
326
+ }
327
+ if (((_b = menuItem.subItems) === null || _b === void 0 ? void 0 : _b.length) === 1) {
328
+ return [menuItem.subItems[0]];
329
+ }
330
+ return [menuItem];
250
331
  }
251
332
  /**
252
333
  * Default strategy for menu items: return as is if there is only one item, otherwise group them under a parent item
@@ -266,40 +347,46 @@ export class AgGridMenuAdapter {
266
347
  if (!exportMenuItems.length) {
267
348
  return [];
268
349
  }
269
- const cellSelectionItems = exportMenuItems.filter((item) => item.name.startsWith('export-cells'));
270
- const canExportCells = cellSelectionItems.length;
271
- const rowSelectionItems = exportMenuItems.filter((item) => item.name.startsWith('export-rows'));
272
- const canExportRows = rowSelectionItems.length;
273
- if (canExportCells && !canExportRows) {
274
- return [
275
- this.buildMenuGroupParent('Export', cellSelectionItems, {
276
- label: 'Export Selected Cells',
350
+ const visualReportItems = exportMenuItems.filter((item) => item.name.startsWith('export-visual-data-excel'));
351
+ const visualDataExportItems = visualReportItems.length
352
+ ? [
353
+ this.buildMenuGroupParent('Export', exportMenuItems.filter((item) => item.name.startsWith('export-visual-data-excel')), {
354
+ label: 'Visual Data',
355
+ icon: false,
277
356
  }),
278
- ];
279
- }
280
- if (!canExportCells && canExportRows) {
281
- return [
282
- this.buildMenuGroupParent('Export', rowSelectionItems, {
283
- label: 'Export Selected Rows',
284
- }),
285
- ];
286
- }
287
- if (canExportCells && canExportRows) {
288
- const cellsSubMenu = this.buildMenuGroupParent('Export', cellSelectionItems, {
289
- label: 'Cells',
290
- });
291
- const rowsSubMenu = this.buildMenuGroupParent('Export', rowSelectionItems, { label: 'Rows' });
292
- return [
293
- this.buildMenuGroupParent('Export', [cellsSubMenu, rowsSubMenu], {
294
- label: 'Export Selected',
295
- }),
296
- ];
297
- }
357
+ ]
358
+ : [];
359
+ const allDataExportItems = this.normalizeMenuGroup(this.buildMenuGroupParent('Export', exportMenuItems.filter((item) => item.name.startsWith('export-all-data')), {
360
+ label: 'All Data',
361
+ icon: false,
362
+ }));
363
+ const currentDataExportItems = this.normalizeMenuGroup(this.buildMenuGroupParent('Export', exportMenuItems.filter((item) => item.name.startsWith('export-current-data')), {
364
+ label: 'Current Data',
365
+ icon: false,
366
+ }));
367
+ const selectedCellsExportItems = this.normalizeMenuGroup(this.buildMenuGroupParent('Export', exportMenuItems.filter((item) => item.name.startsWith('export-selected-cells')), {
368
+ label: 'Selected Cells',
369
+ icon: false,
370
+ }));
371
+ const selectedRowsExportItems = this.normalizeMenuGroup(this.buildMenuGroupParent('Export', exportMenuItems.filter((item) => item.name.startsWith('export-selected-rows')), {
372
+ label: 'Selected Rows',
373
+ icon: false,
374
+ }));
375
+ return this.normalizeMenuGroup(this.buildMenuGroupParent('Export', [
376
+ ...visualDataExportItems,
377
+ ...allDataExportItems,
378
+ ...currentDataExportItems,
379
+ ...selectedCellsExportItems,
380
+ ...selectedRowsExportItems,
381
+ ], {
382
+ label: 'Export',
383
+ icon: 'export',
384
+ }));
298
385
  }
299
386
  getLayoutContextMenuStructure(menuItems) {
300
387
  const layoutMenuItems = menuItems.filter((menuItem) => menuItem.module === 'Layout');
301
388
  if (!layoutMenuItems.length) {
302
- return [];
389
+ return [[], []];
303
390
  }
304
391
  const gridActionsItemNames = [
305
392
  'layout-clear-selection',
@@ -308,25 +395,20 @@ export class AgGridMenuAdapter {
308
395
  ];
309
396
  const gridActionsItems = layoutMenuItems.filter((item) => gridActionsItemNames.includes(item.name));
310
397
  const otherLayoutItems = layoutMenuItems.filter((item) => !gridActionsItemNames.includes(item.name));
311
- return [
312
- this.buildMenuGroupParent('Layout', gridActionsItems, {
313
- label: 'Grid',
314
- icon: 'align-justify',
315
- }),
316
- ...otherLayoutItems,
317
- ];
398
+ return [gridActionsItems, otherLayoutItems];
318
399
  }
319
400
  buildMenuGroupParent(module, menuItems, config) {
320
401
  var _a, _b;
321
402
  const moduleInfo = this.adaptableInstance.ModuleService.getModuleInfoByModule(module);
403
+ const icon = config && config.icon === false
404
+ ? undefined
405
+ : { name: (_a = config === null || config === void 0 ? void 0 : config.icon) !== null && _a !== void 0 ? _a : moduleInfo.Glyph };
322
406
  return {
323
- name: 'menu-group-parent',
324
- label: (_a = config === null || config === void 0 ? void 0 : config.label) !== null && _a !== void 0 ? _a : moduleInfo.FriendlyName,
407
+ name: 'menu-group',
408
+ label: (_b = config === null || config === void 0 ? void 0 : config.label) !== null && _b !== void 0 ? _b : moduleInfo.FriendlyName,
325
409
  isVisible: true,
326
410
  module: moduleInfo.ModuleName,
327
- icon: {
328
- name: (_b = config === null || config === void 0 ? void 0 : config.icon) !== null && _b !== void 0 ? _b : moduleInfo.Glyph,
329
- },
411
+ icon,
330
412
  subItems: menuItems,
331
413
  };
332
414
  }
@@ -336,7 +418,7 @@ export class AgGridMenuAdapter {
336
418
  // CellSummary
337
419
  const cellSummaryMenuItems = this.getModuleSpecificStructure('CellSummary', availableMenuItems);
338
420
  // ColumnFilter
339
- const columnFilterMenuItems = this.getModuleSpecificStructure('ColumnFilter', availableMenuItems);
421
+ const [columnFilterGroup, filterVisibilityItems] = this.getColumnFilterColumnMenuStructure(availableMenuItems);
340
422
  // ColumnInfo
341
423
  const columnInfoMenuItems = this.getModuleSpecificStructure('ColumnInfo', availableMenuItems);
342
424
  // CustomSort
@@ -354,7 +436,7 @@ export class AgGridMenuAdapter {
354
436
  // GridInfo
355
437
  const gridInfoMenuItems = this.getModuleSpecificStructure('GridInfo', availableMenuItems);
356
438
  // Layout
357
- const layoutMenuItems = this.getLayoutColumnMenuStructure(availableMenuItems);
439
+ const [gridSelectItems, columnSelectItems, columnActionGroup, otherLayoutItems] = this.getLayoutColumnMenuStructure(availableMenuItems);
358
440
  // PlusMinus
359
441
  const plusMinusMenuItems = this.getModuleSpecificStructure('PlusMinus', availableMenuItems);
360
442
  // SettingsPanel
@@ -363,62 +445,114 @@ export class AgGridMenuAdapter {
363
445
  const styledColumnMenuItems = this.getStyledColumnColumnMenuStructure(availableMenuItems);
364
446
  // SystemStatus
365
447
  const systemStatusMenuItems = this.getModuleSpecificStructure('SystemStatus', availableMenuItems);
366
- return [
367
- ...calculatedColumnMenuItems,
368
- ...cellSummaryMenuItems,
369
- ...columnFilterMenuItems,
370
- ...columnInfoMenuItems,
371
- ...customSortMenuItems,
372
- ...dashboardMenuItems,
373
- ...dataImportMenuItems,
374
- ...flashingCellMenuItems,
375
- ...formatColumnMenuItems,
376
- ...freeTextColumnMenuItems,
377
- ...gridInfoMenuItems,
378
- ...layoutMenuItems,
379
- ...plusMinusMenuItems,
448
+ /**
449
+ * Custom structures
450
+ */
451
+ const gridMenuItem = {
452
+ name: 'grid-group',
453
+ label: 'Grid',
454
+ // TODO
455
+ module: 'ColumnInfo',
456
+ isVisible: true,
457
+ icon: {
458
+ name: 'grid',
459
+ },
460
+ subItems: [
461
+ ...otherLayoutItems,
462
+ ...filterVisibilityItems,
463
+ ...gridSelectItems,
464
+ ...cellSummaryMenuItems,
465
+ ...dataImportMenuItems,
466
+ ...systemStatusMenuItems,
467
+ ...gridInfoMenuItems,
468
+ ],
469
+ };
470
+ const columnMenuItem = {
471
+ name: 'column-group',
472
+ label: 'Column',
473
+ // TODO
474
+ module: 'ColumnInfo',
475
+ isVisible: true,
476
+ icon: {
477
+ name: 'columns',
478
+ },
479
+ subItems: [
480
+ ...columnActionGroup,
481
+ ...calculatedColumnMenuItems,
482
+ ...freeTextColumnMenuItems,
483
+ ...customSortMenuItems,
484
+ ...plusMinusMenuItems,
485
+ ...columnSelectItems,
486
+ ...columnInfoMenuItems,
487
+ ],
488
+ };
489
+ const createStyleMenuItem = {
490
+ name: 'styling-group',
491
+ label: 'Styling',
492
+ // TODO
493
+ module: 'ColumnInfo',
494
+ isVisible: true,
495
+ icon: {
496
+ name: 'brush',
497
+ },
498
+ subItems: [...formatColumnMenuItems, ...styledColumnMenuItems, ...flashingCellMenuItems],
499
+ };
500
+ return this.removeConsecutiveSeparators([
380
501
  ...settingsPanelMenuItems,
381
- ...styledColumnMenuItems,
382
- ...systemStatusMenuItems,
383
- ];
502
+ ...dashboardMenuItems,
503
+ ...columnFilterGroup,
504
+ ...this.normalizeMenuGroup(createStyleMenuItem),
505
+ ...this.normalizeMenuGroup(gridMenuItem),
506
+ ...this.normalizeMenuGroup(columnMenuItem),
507
+ ], '-');
508
+ }
509
+ getColumnFilterColumnMenuStructure(menuItems) {
510
+ const columnFilterMenuItems = menuItems.filter((menuItem) => menuItem.module === 'ColumnFilter');
511
+ const filterVisibilityItems = columnFilterMenuItems.filter((item) => ['column-filter-bar-hide', 'column-filter-bar-show'].includes(item.name));
512
+ const filterActionItems = columnFilterMenuItems.filter((item) => ['column-filter-clear', 'column-filter-suspend', 'column-filter-unsuspend'].includes(item.name));
513
+ const columnFilterGroup = filterActionItems.length
514
+ ? [
515
+ {
516
+ name: 'column-filter-group',
517
+ label: 'Filter',
518
+ module: 'ColumnFilter',
519
+ isVisible: true,
520
+ icon: {
521
+ name: 'filter',
522
+ },
523
+ subItems: filterActionItems,
524
+ },
525
+ ]
526
+ : [];
527
+ return [columnFilterGroup, filterVisibilityItems];
384
528
  }
385
529
  getLayoutColumnMenuStructure(menuItems) {
386
530
  const layoutMenuItems = menuItems.filter((menuItem) => menuItem.module === 'Layout');
387
531
  if (!layoutMenuItems.length) {
388
- return [];
532
+ return [[], [], [], []];
389
533
  }
390
- const selectActionsItemNames = [
534
+ const columnSelectItemNames = [
391
535
  'layout-column-select-preserve',
392
536
  'layout-column-select-reset',
393
537
  'layout-column-select',
394
- 'layout-select-all',
395
- ];
396
- const selectActionsItems = layoutMenuItems.filter((item) => selectActionsItemNames.includes(item.name));
397
- const otherLayoutItems = layoutMenuItems.filter((item) => !selectActionsItemNames.includes(item.name));
398
- return [
399
- ...otherLayoutItems,
400
- this.buildMenuGroupParent('Layout', selectActionsItems, {
401
- label: 'Select',
402
- icon: 'tab-unselected',
403
- }),
404
538
  ];
539
+ const columnSelectItems = layoutMenuItems.filter((item) => columnSelectItemNames.includes(item.name));
540
+ const gridSelectItems = layoutMenuItems.filter((item) => item.name === 'layout-grid-select');
541
+ const columnActionGroup = layoutMenuItems.filter((item) => ['layout-column-caption-change', 'layout-column-hide'].includes(item.name));
542
+ const otherLayoutItems = layoutMenuItems.filter((item) => !columnSelectItemNames.includes(item.name) &&
543
+ !['layout-column-caption-change', 'layout-column-hide'].includes(item.name) &&
544
+ item.name !== 'layout-grid-select');
545
+ return [gridSelectItems, columnSelectItems, columnActionGroup, otherLayoutItems];
405
546
  }
406
547
  getStyledColumnColumnMenuStructure(menuItems) {
407
548
  const styledColumnMenuItems = menuItems.filter((menuItem) => menuItem.module === 'StyledColumn');
408
- if (!styledColumnMenuItems.length) {
409
- return [];
410
- }
411
- if (styledColumnMenuItems.length === 1) {
412
- return styledColumnMenuItems;
413
- }
414
- return [
415
- this.buildMenuGroupParent('StyledColumn', styledColumnMenuItems, {
416
- label: 'Create Styled Column',
417
- }),
418
- ];
549
+ return styledColumnMenuItems;
419
550
  }
420
551
  mapAdaptableMenuItemToSystemMenuItems(adaptableMenuItems) {
421
552
  return (adaptableMenuItems !== null && adaptableMenuItems !== void 0 ? adaptableMenuItems : []).map((menuItem) => {
553
+ if (menuItem === '-') {
554
+ return menuItem;
555
+ }
422
556
  let subItems = menuItem.subItems;
423
557
  if (subItems && subItems.length > 0) {
424
558
  subItems = subItems.map((subItem) => this.mapAdaptableMenuItemToSystemMenuItems(subItem.subItems));
@@ -1,6 +1,7 @@
1
1
  import { Badge } from '../View/Components/Badge';
2
2
  import { renderWithAdaptableContext } from '../View/renderWithAdaptableContext';
3
3
  import * as React from 'react';
4
+ import { ROW_SUMMARY_ROW_ID } from '../PredefinedConfig/Common/RowSummary';
4
5
  export const getBadgeRendererForColumn = (styledColumn, abColumn, api) => {
5
6
  if (!styledColumn.BadgeStyle) {
6
7
  return;
@@ -11,7 +12,7 @@ export const getBadgeRendererForColumn = (styledColumn, abColumn, api) => {
11
12
  return adaptable;
12
13
  }
13
14
  init(params) {
14
- var _a, _b, _c;
15
+ var _a, _b, _c, _d, _e, _f, _g;
15
16
  const adaptable = this.getAdaptableInstance(params);
16
17
  const adapatableApi = adaptable.api;
17
18
  this.eGui = document.createElement('div');
@@ -23,6 +24,11 @@ export const getBadgeRendererForColumn = (styledColumn, abColumn, api) => {
23
24
  this.eGui.innerHTML = formattedValue;
24
25
  return;
25
26
  }
27
+ if (((_d = params === null || params === void 0 ? void 0 : params.data) === null || _d === void 0 ? void 0 : _d[ROW_SUMMARY_ROW_ID]) && !styledColumn.IncludeRowSummaries) {
28
+ 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 : '';
29
+ this.eGui.innerHTML = formattedValue;
30
+ return;
31
+ }
26
32
  if (['NumberArray', 'StringArray'].includes(abColumn.dataType)) {
27
33
  this.renderArrayValues(params, adapatableApi);
28
34
  }
@@ -13,7 +13,9 @@ export const getPercentBarRendererForColumn = (styledColumn, abColumn, api) => {
13
13
  if (Helper.objectNotExists(value)) {
14
14
  value = 0;
15
15
  }
16
- if (!styledColumn.IncludeGroupedRows && api.gridApi.isGroupRowNode(params.node)) {
16
+ // No longer support showing Percent Bar in Grouped Rows
17
+ if (api.gridApi.isGroupRowNode(params.node)) {
18
+ // if (!styledColumn.IncludeGroupedRows && api.gridApi.isGroupRowNode(params.node)) {
17
19
  if (params.value) {
18
20
  this.eGui = document.createElement('div');
19
21
  this.eGui.append(params.value);
@@ -1,6 +1,6 @@
1
1
  import { __rest } from "tslib";
2
2
  import * as React from 'react';
3
- import { useState, useRef } from 'react';
3
+ import { useRef, useState } from 'react';
4
4
  import { Box, Flex } from 'rebass';
5
5
  import join from '../utils/join';
6
6
  const Square = (props) => {
@@ -3,8 +3,12 @@ import { useSelector } from 'react-redux';
3
3
  import { useEffect, useState } from 'react';
4
4
  import { LoaderSpinner } from '../Loader';
5
5
  import { useAdaptable } from '../../View/AdaptableContext';
6
+ import { ExternalRenderer } from '../../View/Components/ExternalRenderer';
7
+ import Dialog from '../Dialog';
8
+ import { Box, Flex } from 'rebass';
6
9
  export const ProgressIndicator = () => {
7
- const { active, label } = useSelector((state) => state.System.ProgressIndicator);
10
+ const adaptable = useAdaptable();
11
+ const { active, text, render, frameworkComponent } = useSelector((state) => state.System.ProgressIndicator);
8
12
  const [visible, setVisible] = useState(false);
9
13
  const [progressIndicatorCoordinates, setProgressIndicatorCoordinates] = useState({
10
14
  top: 0,
@@ -12,7 +16,6 @@ export const ProgressIndicator = () => {
12
16
  height: 0,
13
17
  width: 0,
14
18
  });
15
- const adaptable = useAdaptable();
16
19
  const disableAdaptableGrid = (containerElement, disabled) => {
17
20
  const DISABLING_CSS_CLASS = 'ab-wait-for-progress-indicator';
18
21
  if (!containerElement) {
@@ -35,14 +38,20 @@ export const ProgressIndicator = () => {
35
38
  useEffect(() => {
36
39
  disableAdaptableGrid(adaptable.getAdaptableContainerElement(), active);
37
40
  disableAdaptableGrid(adaptable.getAgGridContainerElement(), active);
38
- updateGridContainerCoordinates(adaptable.getAdaptableContainerElement());
41
+ updateGridContainerCoordinates(adaptable.getAgGridContainerElement());
39
42
  // without rAF the progress indicator would be rendered instantly, without the 'transition-delay' defined via CSS
40
43
  requestAnimationFrame(() => {
41
44
  setVisible(active);
42
45
  });
43
46
  }, [active]);
44
- return (React.createElement(React.Fragment, null, active && (React.createElement("div", { className: `ab-progress-indicator-wrapper ${visible ? 'ab-progress-indicator-wrapper--visible' : ''}`, style: progressIndicatorCoordinates },
45
- React.createElement("div", { className: "ab-progress-indicator-body" },
47
+ let customEl = null;
48
+ if (render || frameworkComponent) {
49
+ customEl = React.createElement(ExternalRenderer, { render: render, frameworkComponent: frameworkComponent });
50
+ }
51
+ return (React.createElement(React.Fragment, null, active && (React.createElement(Dialog, { modal: true, isOpen: true, showCloseButton: false, className: `ab-ProgressIndicator ${visible ? 'ab-ProgressIndicator--visible' : ''}` },
52
+ React.createElement(Flex, { alignItems: "center", flexDirection: "column", p: 3, className: "ab-ProgressIndicator-body" },
46
53
  React.createElement(LoaderSpinner, null),
47
- React.createElement("span", { style: { marginLeft: 'var(--ab-space-2)' } }, label))))));
54
+ React.createElement(Box, { mt: 3 },
55
+ text && React.createElement(Box, null, text),
56
+ customEl))))));
48
57
  };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: (props: any) => JSX.Element;
3
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import DefaultIcon from './DefaultIcon';
3
+ export default (props) => (React.createElement(DefaultIcon, Object.assign({}, props, { viewBox: "0 -960 960 960" }),
4
+ 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,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: (props: any) => JSX.Element;
3
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import DefaultIcon from './DefaultIcon';
3
+ export default (props) => (React.createElement(DefaultIcon, Object.assign({}, props, { viewBox: "0 -960 960 960" }),
4
+ 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" })));
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: (props: any) => JSX.Element;
3
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import DefaultIcon from './DefaultIcon';
3
+ export default (props) => (React.createElement(DefaultIcon, Object.assign({}, props, { viewBox: "0 -960 960 960" }),
4
+ React.createElement("path", { d: "M143-192v-72h432v72H143Zm480.774-240Q544-432 488-488.226t-56-136Q432-704 488.226-760t136-56Q704-816 760-759.774t56 136Q816-544 759.774-488t-136 56ZM143-492v-72h224q5 20 12 37.5t17 34.5H143Zm0 150v-72h322q24.227 18.242 51.613 30.621Q544-371 575-365v23H143Zm457-186h48v-96h-48v96Zm24-144q9.6 0 16.8-7.2 7.2-7.2 7.2-16.8 0-9.6-7.2-16.8-7.2-7.2-16.8-7.2-9.6 0-16.8 7.2-7.2 7.2-7.2 16.8 0 9.6 7.2 16.8 7.2 7.2 16.8 7.2Z" })));