@adaptabletools/adaptable 11.0.7 → 11.1.0

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 (132) hide show
  1. package/base.css +19 -11
  2. package/bundle.cjs.js +100 -100
  3. package/index.css +23 -11
  4. package/package.json +2 -2
  5. package/publishTimestamp.d.ts +1 -1
  6. package/publishTimestamp.js +1 -1
  7. package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -0
  8. package/src/AdaptableOptions/LayoutOptions.d.ts +5 -1
  9. package/src/Api/AlertApi.d.ts +3 -2
  10. package/src/Api/BulkUpdateApi.d.ts +6 -1
  11. package/src/Api/CalculatedColumnApi.d.ts +1 -1
  12. package/src/Api/CellSummaryApi.d.ts +1 -1
  13. package/src/Api/ConditionalStyleApi.d.ts +1 -1
  14. package/src/Api/ConfigApi.d.ts +1 -1
  15. package/src/Api/CustomSortApi.d.ts +1 -1
  16. package/src/Api/DashboardApi.d.ts +1 -1
  17. package/src/Api/DataSourceApi.d.ts +1 -1
  18. package/src/Api/EventApi.d.ts +1 -1
  19. package/src/Api/Events/GridDataChanged.d.ts +5 -1
  20. package/src/Api/ExportApi.d.ts +7 -2
  21. package/src/Api/FormatColumnApi.d.ts +1 -1
  22. package/src/Api/FreeTextColumnApi.d.ts +1 -1
  23. package/src/Api/GridApi.d.ts +24 -3
  24. package/src/Api/Implementation/AlertApiImpl.d.ts +4 -1
  25. package/src/Api/Implementation/AlertApiImpl.js +79 -52
  26. package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +1 -0
  27. package/src/Api/Implementation/BulkUpdateApiImpl.js +4 -0
  28. package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
  29. package/src/Api/Implementation/ConfigApiImpl.js +7 -2
  30. package/src/Api/Implementation/ExportApiImpl.d.ts +2 -1
  31. package/src/Api/Implementation/ExportApiImpl.js +14 -1
  32. package/src/Api/Implementation/GridApiImpl.d.ts +9 -1
  33. package/src/Api/Implementation/GridApiImpl.js +24 -3
  34. package/src/Api/Implementation/InternalApiImpl.d.ts +9 -2
  35. package/src/Api/Implementation/InternalApiImpl.js +37 -1
  36. package/src/Api/Implementation/LayoutApiImpl.d.ts +6 -0
  37. package/src/Api/Implementation/LayoutApiImpl.js +48 -0
  38. package/src/Api/Implementation/ScheduleApiImpl.js +1 -0
  39. package/src/Api/Implementation/SettingsPanelApiImpl.js +7 -1
  40. package/src/Api/InternalApi.d.ts +9 -2
  41. package/src/Api/LayoutApi.d.ts +38 -1
  42. package/src/Api/PlusMinusApi.d.ts +1 -1
  43. package/src/Api/QueryApi.d.ts +1 -1
  44. package/src/Api/QuickSearchApi.d.ts +1 -1
  45. package/src/Api/ScheduleApi.d.ts +1 -1
  46. package/src/Api/ShortcutApi.d.ts +1 -1
  47. package/src/Api/SmartEditApi.d.ts +1 -1
  48. package/src/Api/TeamSharingApi.d.ts +1 -1
  49. package/src/Api/ThemeApi.d.ts +1 -1
  50. package/src/PredefinedConfig/AlertState.d.ts +7 -3
  51. package/src/PredefinedConfig/Common/AdaptableAlert.d.ts +35 -6
  52. package/src/PredefinedConfig/Common/AdaptableAlert.js +7 -0
  53. package/src/PredefinedConfig/Common/AdaptablePredicate.js +20 -0
  54. package/src/PredefinedConfig/Common/CellHighlightInfo.d.ts +1 -1
  55. package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +1 -1
  56. package/src/PredefinedConfig/Common/Entitlement.d.ts +2 -2
  57. package/src/PredefinedConfig/Common/Menu.d.ts +3 -0
  58. package/src/PredefinedConfig/Common/RowsHighlightInfo.d.ts +15 -0
  59. package/src/PredefinedConfig/Common/RowsHighlightInfo.js +2 -0
  60. package/src/PredefinedConfig/ConfigState.d.ts +4 -1
  61. package/src/PredefinedConfig/LayoutState.d.ts +1 -1
  62. package/src/PredefinedConfig/PopupState.d.ts +2 -1
  63. package/src/Redux/ActionsReducers/FlashingCellRedux.js +4 -8
  64. package/src/Redux/ActionsReducers/PopupRedux.d.ts +18 -0
  65. package/src/Redux/ActionsReducers/PopupRedux.js +36 -1
  66. package/src/Redux/ActionsReducers/SystemRedux.d.ts +11 -0
  67. package/src/Redux/ActionsReducers/SystemRedux.js +32 -1
  68. package/src/Redux/Store/AdaptableReduxMerger.d.ts +1 -0
  69. package/src/Redux/Store/AdaptableReduxMerger.js +40 -4
  70. package/src/Redux/Store/AdaptableStore.js +69 -27
  71. package/src/Strategy/AlertModule.d.ts +5 -3
  72. package/src/Strategy/AlertModule.js +60 -16
  73. package/src/Strategy/BulkUpdateModule.js +5 -0
  74. package/src/Strategy/ExportModule.js +1 -0
  75. package/src/Strategy/SmartEditModule.js +6 -0
  76. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -0
  77. package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +1 -1
  78. package/src/Utilities/Defaults/DefaultSettingsPanel.js +6 -2
  79. package/src/Utilities/Interface/MessagePopups.d.ts +13 -0
  80. package/src/Utilities/ObjectFactory.d.ts +8 -6
  81. package/src/Utilities/ObjectFactory.js +26 -12
  82. package/src/Utilities/Services/LicenseService.js +1 -1
  83. package/src/Utilities/Services/ModuleService.js +1 -1
  84. package/src/Utilities/Services/ValidationService.js +1 -0
  85. package/src/View/AdaptableView.js +2 -0
  86. package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +16 -9
  87. package/src/View/Alert/Wizard/AlertButtonsEditor.js +13 -3
  88. package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +2 -0
  89. package/src/View/Alert/Wizard/AlertWizard.js +83 -1
  90. package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
  91. package/src/View/Components/FilterForm/FilterForm.js +2 -2
  92. package/src/View/Components/Panels/PanelFooter.d.ts +10 -0
  93. package/src/View/Components/Panels/PanelFooter.js +14 -0
  94. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +12 -7
  95. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +1 -1
  96. package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +3 -1
  97. package/src/View/Components/Popups/{AdaptablePopup/Utilities.d.ts → Utilities.d.ts} +4 -0
  98. package/src/View/Components/Popups/{AdaptablePopup/Utilities.js → Utilities.js} +5 -2
  99. package/src/View/Components/Popups/WindowPopups/WindowPopups.d.ts +6 -0
  100. package/src/View/Components/Popups/WindowPopups/WindowPopups.js +32 -0
  101. package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +4 -0
  102. package/src/View/Components/Popups/WindowPopups/windowFactory.js +8 -0
  103. package/src/View/Layout/LayoutEditorStandalonePopup.d.ts +3 -0
  104. package/src/View/Layout/LayoutEditorStandalonePopup.js +76 -0
  105. package/src/View/Layout/LayoutPopup.js +3 -24
  106. package/src/View/Layout/LayoutViewPanel.d.ts +1 -4
  107. package/src/View/Layout/LayoutViewPanel.js +5 -18
  108. package/src/View/Layout/Wizard/LayoutEditor/ColumnLabels.d.ts +9 -0
  109. package/src/View/Layout/Wizard/LayoutEditor/ColumnLabels.js +55 -0
  110. package/src/View/Layout/Wizard/LayoutEditor/index.js +3 -68
  111. package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +1 -0
  112. package/src/View/Layout/Wizard/LayoutEditorWizard.js +35 -7
  113. package/src/View/SystemStatus/SystemStatusEntityRow.js +1 -2
  114. package/src/agGrid/Adaptable.d.ts +4 -2
  115. package/src/agGrid/Adaptable.js +65 -69
  116. package/src/agGrid/PercentBarRenderer.js +2 -1
  117. package/src/agGrid/agGridHelper.d.ts +1 -1
  118. package/src/agGrid/agGridHelper.js +23 -8
  119. package/src/agGrid/editors/AdaptableDateEditor/index.js +1 -1
  120. package/src/agGrid/editors/AdaptableNumberEditor/index.js +1 -1
  121. package/src/components/Dialog/index.js +1 -1
  122. package/src/components/Modal/index.js +1 -1
  123. package/src/components/WindowModal/WindowModal.d.ts +10 -8
  124. package/src/components/WindowModal/WindowModal.js +4 -2
  125. package/src/components/WindowModal/useStacking.d.ts +9 -0
  126. package/src/components/WindowModal/useStacking.js +45 -0
  127. package/src/env.js +3 -3
  128. package/src/metamodel/adaptable.metamodel.d.ts +51 -11
  129. package/src/metamodel/adaptable.metamodel.js +183 -40
  130. package/src/types.d.ts +3 -2
  131. package/version.d.ts +1 -1
  132. package/version.js +1 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bindAdaptableAgGrid = exports.AdaptableNoCodeWizard = exports.Adaptable = void 0;
3
+ exports.AdaptableNoCodeWizard = exports.Adaptable = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const all_modules_1 = require("@ag-grid-community/all-modules");
6
6
  const debounce_1 = tslib_1.__importDefault(require("lodash/debounce"));
@@ -316,13 +316,6 @@ class Adaptable {
316
316
  this.runtimeConfig = runtimeConfig || {};
317
317
  this.agGridModules = this.runtimeConfig.modules || [];
318
318
  this.gridOptions = this.adaptableOptions.gridOptions;
319
- if (this.hasAutogeneratedPrimaryKey() && !this.gridOptions.getRowNodeId) {
320
- this.gridOptions.getRowNodeId = (rowData) => {
321
- var _a;
322
- rowData[GeneralConstants_1.AUTOGENERATED_PK_COLUMN] = (_a = rowData[GeneralConstants_1.AUTOGENERATED_PK_COLUMN]) !== null && _a !== void 0 ? _a : Uuid_1.createUuid();
323
- return rowData[GeneralConstants_1.AUTOGENERATED_PK_COLUMN];
324
- };
325
- }
326
319
  if (this.gridOptions.allowContextMenuWithControlKey === undefined) {
327
320
  this.gridOptions.allowContextMenuWithControlKey = true;
328
321
  }
@@ -517,7 +510,7 @@ class Adaptable {
517
510
  LoggingHelper_1.LogAdaptableInfo(`Initializing AgGrid...`);
518
511
  // set up whether we use the getRowNode method or loop when finding a rowNode (former is preferable)
519
512
  // can only do that here as the gridOptions not yet set up
520
- this.useRowNodeLookUp = this.agGridHelper.TrySetUpNodeIds();
513
+ this.useRowNodeLookUp = this.agGridHelper.TrySetUpNodeIds(this.hasAutogeneratedPrimaryKey());
521
514
  if (Array.isArray(this.gridOptions.columnDefs)) {
522
515
  this.gridOptions.columnDefs.forEach(assignColId);
523
516
  }
@@ -850,32 +843,10 @@ class Adaptable {
850
843
  return style;
851
844
  }
852
845
  getActiveAlertWithHighlightCell(col, params) {
853
- const activeAlerts = this.api.internalApi
854
- .getAdaptableAlerts()
855
- .filter((alert) => {
856
- var _a;
857
- return ((_a = alert.alertDefinition.AlertProperties) === null || _a === void 0 ? void 0 : _a.HighlightCell) &&
858
- alert.dataChangedInfo &&
859
- alert.dataChangedInfo.column &&
860
- alert.dataChangedInfo.column.columnId === col.columnId &&
861
- alert.dataChangedInfo.rowNode === params.node;
862
- });
863
- if (!activeAlerts.length) {
864
- return null;
865
- }
866
- return activeAlerts === null || activeAlerts === void 0 ? void 0 : activeAlerts[0];
846
+ return this.api.internalApi.getAdaptableAlertWithHighlightCell(col.columnId, params.node);
867
847
  }
868
848
  getActiveAlertWithHighlightRow(params) {
869
- var _a;
870
- return (_a = this.api.internalApi
871
- .getAdaptableAlerts()
872
- .filter((alert) => {
873
- var _a;
874
- return ((_a = alert.alertDefinition.AlertProperties) === null || _a === void 0 ? void 0 : _a.HighlightRow) &&
875
- alert.dataChangedInfo &&
876
- alert.dataChangedInfo.column &&
877
- alert.dataChangedInfo.rowNode === params.node;
878
- })) === null || _a === void 0 ? void 0 : _a[0];
849
+ return this.api.internalApi.getAdaptableAlertWithHighlightRow(params.node);
879
850
  }
880
851
  getAlertCellStyle(col, params) {
881
852
  const alert = this.getActiveAlertWithHighlightCell(col, params);
@@ -1062,12 +1033,15 @@ class Adaptable {
1062
1033
  }
1063
1034
  getPrimaryKeyValueFromRowNode(rowNode) {
1064
1035
  var _a;
1036
+ if (!rowNode) {
1037
+ return null;
1038
+ }
1065
1039
  let gridApi = this.getGridOptionsApi();
1066
1040
  let result;
1067
1041
  if (gridApi && !this.hasAutogeneratedPrimaryKey()) {
1068
1042
  result = gridApi.getValue(this.adaptableOptions.primaryKey, rowNode);
1069
1043
  }
1070
- if ((result === null || result == undefined) && rowNode && rowNode.data) {
1044
+ if ((result === null || result == undefined) && rowNode.data) {
1071
1045
  result = (_a = rowNode.data[this.adaptableOptions.primaryKey]) !== null && _a !== void 0 ? _a : null;
1072
1046
  }
1073
1047
  return result;
@@ -1282,10 +1256,13 @@ class Adaptable {
1282
1256
  shouldUpdateHeaders = this.setupColumnHeader(colSetupInfo) || shouldUpdateHeaders;
1283
1257
  });
1284
1258
  isChanged = isChanged || shouldUpdateHeaders;
1285
- if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(layout.ExpandedRowGroupValues) &&
1286
- this.adaptableOptions.layoutOptions.includeExpandedRowGroups) {
1259
+ if (this.api.layoutApi.areExpandedRowGroupsSavedInLayouts() &&
1260
+ ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(layout.ExpandedRowGroupValues)) {
1287
1261
  this.expandRowGroupsForValues(layout.ExpandedRowGroupValues);
1288
1262
  }
1263
+ if (this.adaptableOptions.layoutOptions.displayRowGroups === 'expanded') {
1264
+ this.expandAllRowGroups();
1265
+ }
1289
1266
  if (isChanged) {
1290
1267
  // it's important we set pivot mode
1291
1268
  // before we set column state
@@ -1404,7 +1381,7 @@ class Adaptable {
1404
1381
  }
1405
1382
  layout.EnablePivot = this.gridOptions.columnApi.isPivotMode();
1406
1383
  layout.PivotColumns = pivotColumns;
1407
- if (this.adaptableOptions.layoutOptions.includeExpandedRowGroups) {
1384
+ if (this.api.layoutApi.areExpandedRowGroupsSavedInLayouts()) {
1408
1385
  layout.ExpandedRowGroupValues = this.getExpandRowGroupsKeys();
1409
1386
  }
1410
1387
  // this.api.layoutApi.fireLayoutUpdatedEvent(layout, 'UpdatedLayout');
@@ -1895,6 +1872,9 @@ class Adaptable {
1895
1872
  });
1896
1873
  return rowNodes;
1897
1874
  }
1875
+ getRowsInViewport() {
1876
+ return this.gridOptions.api.getRenderedNodes();
1877
+ }
1898
1878
  selectNodes(rowNodes, clearSelection) {
1899
1879
  if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(rowNodes)) {
1900
1880
  rowNodes.forEach((node) => this.selectNode(node, clearSelection));
@@ -1945,19 +1925,17 @@ class Adaptable {
1945
1925
  this.gridOptions.api.refreshHeader();
1946
1926
  }
1947
1927
  redrawRow(rowNode) {
1948
- // in order to get a fresh reference to rowNode
1949
- // rowNode = this.getRowNodeForPrimaryKey(this.getPrimaryKeyValueFromRowNode(rowNode));
1950
- // if (!rowNode) {
1951
- // return;
1952
- // }
1928
+ this.redrawRows([rowNode]);
1929
+ }
1930
+ redrawRows(rowNodes) {
1953
1931
  const redrawRowsParams = {
1954
- rowNodes: [rowNode],
1932
+ rowNodes,
1955
1933
  };
1956
1934
  try {
1957
1935
  this.gridOptions.api.redrawRows(redrawRowsParams);
1958
1936
  }
1959
1937
  catch (ex) {
1960
- LoggingHelper_1.ConsoleLogError('ag-grid redrawRows was unable to find some row nodes. Tried to redraw row node: ', rowNode, ex);
1938
+ LoggingHelper_1.ConsoleLogError('ag-grid redrawRows was unable to find some row nodes. Tried to redraw row nodes: ', rowNodes, ex);
1961
1939
  }
1962
1940
  }
1963
1941
  refreshCells(rowNodes, columns, forceUpdate, suppressFlash = false) {
@@ -2589,26 +2567,22 @@ class Adaptable {
2589
2567
  this.gridOptions.isExternalFilterPresent = () => {
2590
2568
  const columnFilters = this.api.filterApi.getAllColumnFilter();
2591
2569
  const isFilterActive = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(columnFilters);
2592
- if (isFilterActive) {
2593
- // used in particular at init time to show the filter icon correctly
2594
- for (const colFilter of columnFilters) {
2595
- const agGridCol = this.gridOptions.columnApi.getColumn(colFilter.ColumnId);
2596
- if (agGridCol && !agGridCol.isFilterActive()) {
2597
- agGridCol.setFilterActive(true);
2598
- }
2599
- }
2600
- }
2601
- else {
2602
- (this.gridOptions.columnApi.getAllColumns() || []).forEach((col) => {
2603
- if (col.isFilterActive()) {
2604
- col.setFilterActive(false);
2605
- }
2606
- });
2607
- }
2608
2570
  const isQueryActive = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.api.queryApi.getCurrentQuery());
2609
- // it means that originaldoesExternalFilterPass will be called so we reinit that collection
2571
+ /**
2572
+ * Changing the column filterState sync breaks the rendering of the custom filter component.
2573
+ * I think that changing the column definition while ag-grid determines if a column is filtered
2574
+ * breaks the logic of the custom component.
2575
+ *
2576
+ * Result:
2577
+ * - custom filters in sate
2578
+ * - refresh page, the ag-grid filter is rendered instead of adaptable custom-filter-component.
2579
+ */
2580
+ requestAnimationFrame(() => {
2581
+ this.updateColumnFilterActiveState();
2582
+ });
2610
2583
  return (isFilterActive ||
2611
2584
  isQueryActive ||
2585
+ // it means that originaldoesExternalFilterPass will be called so we reinit that collection
2612
2586
  (originalisExternalFilterPresent ? originalisExternalFilterPresent() : false));
2613
2587
  };
2614
2588
  const originaldoesExternalFilterPass = this.gridOptions.doesExternalFilterPass;
@@ -2660,6 +2634,26 @@ class Adaptable {
2660
2634
  };
2661
2635
  this.prepareGrid();
2662
2636
  }
2637
+ updateColumnFilterActiveState() {
2638
+ const columnFilters = this.api.filterApi.getAllColumnFilter();
2639
+ const isFilterActive = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(columnFilters);
2640
+ if (isFilterActive) {
2641
+ // used in particular at init time to show the filter icon correctly
2642
+ for (const colFilter of columnFilters) {
2643
+ const agGridCol = this.gridOptions.columnApi.getColumn(colFilter.ColumnId);
2644
+ if (agGridCol && !agGridCol.isFilterActive()) {
2645
+ agGridCol.setFilterActive(true);
2646
+ }
2647
+ }
2648
+ }
2649
+ else {
2650
+ (this.gridOptions.columnApi.getAllColumns() || []).forEach((col) => {
2651
+ if (col.isFilterActive()) {
2652
+ col.setFilterActive(false);
2653
+ }
2654
+ });
2655
+ }
2656
+ }
2663
2657
  buildStandaloneColumnHeader(adaptableColumn) {
2664
2658
  return this.agGridMenuHelper.buildStandaloneColumnHeader(adaptableColumn);
2665
2659
  }
@@ -2869,6 +2863,7 @@ class Adaptable {
2869
2863
  setupColumnCellEditor({ colId, col }) {
2870
2864
  const adaptableColumn = this.api.columnApi.getColumnFromId(colId);
2871
2865
  const editLookUpItem = this.api.userInterfaceApi.getEditLookUpItemForColumn(adaptableColumn);
2866
+ const hasRichSelectCellEditor = this.isModulePresent('rich-select');
2872
2867
  this.setColDefProperty(col, 'cellEditor', () => {
2873
2868
  var _a;
2874
2869
  const formatColumn = this.api.formatColumnApi.getFormatColumnForColumn(adaptableColumn);
@@ -2876,9 +2871,14 @@ class Adaptable {
2876
2871
  return CheckboxRenderer_1.CheckboxEditor;
2877
2872
  }
2878
2873
  if (editLookUpItem) {
2879
- return this.isModulePresent('rich-select')
2880
- ? 'agRichSelectCellEditor'
2881
- : 'agSelectCellEditor';
2874
+ return hasRichSelectCellEditor ? 'agRichSelectCellEditor' : 'agSelectCellEditor';
2875
+ }
2876
+ });
2877
+ this.setColDefProperty(col, 'cellEditorPopup', () => {
2878
+ // as specified in https://www.ag-grid.com/react-data-grid/provided-cell-editors/#rich-select-cell-editor
2879
+ // agRichSelectCellEditor should always set cellEditorPopup=true. Otherwise the editor will be clipped to the cell contents
2880
+ if (editLookUpItem && hasRichSelectCellEditor) {
2881
+ return true;
2882
2882
  }
2883
2883
  });
2884
2884
  this.setColDefProperty(col, 'cellEditorParams', (params) => {
@@ -3429,7 +3429,7 @@ class Adaptable {
3429
3429
  }
3430
3430
  getExpandRowGroupsKeys() {
3431
3431
  let returnValues = [];
3432
- if (this.adaptableOptions.layoutOptions.includeExpandedRowGroups) {
3432
+ if (this.api.layoutApi.areExpandedRowGroupsSavedInLayouts()) {
3433
3433
  this.gridOptions.api.forEachNode((node) => {
3434
3434
  if (node.group && node.expanded) {
3435
3435
  let current = node;
@@ -4307,7 +4307,3 @@ class AdaptableNoCodeWizard {
4307
4307
  }
4308
4308
  }
4309
4309
  exports.AdaptableNoCodeWizard = AdaptableNoCodeWizard;
4310
- exports.bindAdaptableAgGrid = (gridReadyEvent, gridOptions) => {
4311
- gridOptions.api = gridReadyEvent.api;
4312
- gridOptions.columnApi = gridReadyEvent.columnApi;
4313
- };
@@ -77,7 +77,8 @@ exports.getPercentBarRendererForColumn = (formatColumn, api) => {
77
77
  return this.eGui;
78
78
  }
79
79
  refresh(params) {
80
- return true;
80
+ // by returning FALSE we force a re-render every time the cell value changes
81
+ return false;
81
82
  }
82
83
  };
83
84
  };
@@ -20,7 +20,7 @@ export declare class agGridHelper {
20
20
  getAgGridLightThemeName(): string;
21
21
  getAgGridDarkThemeName(): string;
22
22
  setUpModules(): Map<AdaptableModule, IModule>;
23
- TrySetUpNodeIds(): boolean;
23
+ TrySetUpNodeIds(hasAutogeneratedPrimaryKey: boolean): boolean;
24
24
  createCheckboxRendererComp(columnId: string, isColumnReadOnly: boolean): ICellRendererFunc | undefined;
25
25
  createPercentBarRendererComp(formatColumn: FormatColumn): ICellRendererFunc;
26
26
  getCleanValue(value: string): string | undefined;
@@ -39,6 +39,7 @@ const FlashingCellModule_1 = require("../Strategy/FlashingCellModule");
39
39
  const SettingsPanelModule_1 = require("../Strategy/SettingsPanelModule");
40
40
  const ChartingModule_1 = require("../Strategy/ChartingModule");
41
41
  const PercentBarRenderer_1 = require("./PercentBarRenderer");
42
+ const Helper_1 = require("../Utilities/Helpers/Helper");
42
43
  const tinycolor = require('tinycolor2');
43
44
  /**
44
45
  * Adaptable AG Grid implementation is getting really big and unwieldy
@@ -99,21 +100,35 @@ class agGridHelper {
99
100
  modules.set(ModuleConstants.ChartingModuleId, new ChartingModule_1.ChartingModule(api));
100
101
  return modules;
101
102
  }
102
- TrySetUpNodeIds() {
103
+ TrySetUpNodeIds(hasAutogeneratedPrimaryKey) {
103
104
  if (StringExtensions_1.StringExtensions.IsNullOrEmpty(this.adaptable.adaptableOptions.primaryKey)) {
104
105
  // if no valid pk then always false
105
106
  return false;
106
107
  }
107
- // need some way of checking if running on client on server: if on server then we return false
108
- if (this.gridOptions.getRowNodeId != null) {
108
+ if (Helper_1.Helper.objectExists(this.gridOptions.getRowNodeId) ||
109
+ Helper_1.Helper.objectExists(this.gridOptions.getRowId)) {
110
+ // if the user provided a getRowNodeId/getRowId then we don't need to do anything
111
+ // Note: starting with 27.1.0 'getRowNodeId' method is deprecated and will be removed in future versions
109
112
  return true;
110
113
  }
111
- // also we can check if they have done it
112
114
  const primaryKey = this.adaptable.adaptableOptions.primaryKey;
113
- // otherwise lets set the Id so that it returns the primaryKey
114
- this.gridOptions.getRowNodeId = function (data) {
115
- return data[primaryKey];
116
- };
115
+ if (hasAutogeneratedPrimaryKey) {
116
+ this.gridOptions.getRowId = (params) => {
117
+ // if the PK value is autogenerated, we need to make sure that the rowData has a valid PK value
118
+ // this should be taken care of in the Adaptable.[loadDataSource/setDataSource/updateRows]() methods, but the users will always make silly decisions
119
+ // so just to be safe we'll check here and add a PK value is missing
120
+ // thus adding a side-effect in a getter, but what can we do against it?! :)
121
+ if (Helper_1.Helper.objectNotExists(params.data[primaryKey])) {
122
+ params.data[primaryKey] = Uuid_1.createUuid();
123
+ }
124
+ return params.data[primaryKey];
125
+ };
126
+ }
127
+ else {
128
+ this.gridOptions.getRowId = (params) => {
129
+ return params.data[primaryKey];
130
+ };
131
+ }
117
132
  return true;
118
133
  }
119
134
  createCheckboxRendererComp(columnId, isColumnReadOnly) {
@@ -117,7 +117,7 @@ class AdaptableDateEditor {
117
117
  react_dom_1.unmountComponentAtNode(this.el);
118
118
  }
119
119
  shouldClearExistingValue(params) {
120
- return params.key === all_modules_1.KeyCode.BACKSPACE || params.key === all_modules_1.KeyCode.DELETE;
120
+ return params.eventKey === all_modules_1.KeyCode.BACKSPACE || params.eventKey === all_modules_1.KeyCode.DELETE;
121
121
  }
122
122
  }
123
123
  exports.AdaptableDateEditor = AdaptableDateEditor;
@@ -93,7 +93,7 @@ class AdaptableNumberEditor {
93
93
  react_dom_1.unmountComponentAtNode(this.el);
94
94
  }
95
95
  shouldClearExistingValue(params) {
96
- return params.key === all_modules_1.KeyCode.BACKSPACE || params.key === all_modules_1.KeyCode.DELETE;
96
+ return params.eventKey === all_modules_1.KeyCode.BACKSPACE || params.eventKey === all_modules_1.KeyCode.DELETE;
97
97
  }
98
98
  }
99
99
  exports.AdaptableNumberEditor = AdaptableNumberEditor;
@@ -105,7 +105,7 @@ exports.Dialog = React.forwardRef((props, ref) => {
105
105
  e.nativeEvent.preventDialogDismiss = true;
106
106
  }
107
107
  };
108
- const box = (React.createElement(rebass_1.Box, Object.assign({ tabIndex: 0 }, boxProps, { onClick: (e) => {
108
+ const box = (React.createElement(rebass_1.Box, Object.assign({}, boxProps, { onClick: (e) => {
109
109
  setPreventDismissFlag(e);
110
110
  if (boxProps && boxProps.onClick) {
111
111
  boxProps.onClick(e);
@@ -32,7 +32,7 @@ exports.Modal = (props) => {
32
32
  const counter = react_1.useMemo(() => globalCounter++, [isOpen]);
33
33
  const openTimestamp = counter;
34
34
  const backdropZIndexOffset = props.backdropZIndexOffset || 1;
35
- const zIndex = (props.baseZIndex || 1000) + counter;
35
+ const zIndex = (props.baseZIndex || 2000) + counter;
36
36
  return react_dom_1.createPortal(isOpen ? (React.createElement(React.Fragment, null,
37
37
  React.createElement(Backdrop_1.default, { timestamp: openTimestamp, uuid: uuid, zIndex: zIndex - backdropZIndexOffset, onBringToFront: onBringToFront }),
38
38
  React.createElement(react_remove_scroll_1.RemoveScroll, null,
@@ -1,14 +1,16 @@
1
1
  import * as React from 'react';
2
+ export declare type WindowModalSize = {
3
+ width: number;
4
+ height: number;
5
+ };
6
+ export declare type WindowModalPosition = {
7
+ x: number;
8
+ y: number;
9
+ };
2
10
  export interface WindowModalProps {
3
11
  handleSelector: string;
4
- size: {
5
- width: number;
6
- height: number;
7
- };
8
- position?: {
9
- x: number;
10
- y: number;
11
- };
12
+ size: WindowModalSize;
13
+ position?: WindowModalPosition;
12
14
  onChange: (settings: {
13
15
  size: {
14
16
  width: number;
@@ -7,6 +7,7 @@ const re_resizable_1 = require("re-resizable");
7
7
  const useDraggable_1 = tslib_1.__importDefault(require("../utils/useDraggable"));
8
8
  const UIHelper_1 = require("../../View/UIHelper");
9
9
  const react_dom_1 = require("react-dom");
10
+ const useStacking_1 = require("./useStacking");
10
11
  let portalElement;
11
12
  const ensurePortalElement = () => {
12
13
  if (!UIHelper_1.isBrowserDocumentAvailable()) {
@@ -43,6 +44,7 @@ exports.WindowModal = (props) => {
43
44
  ensurePortalElement();
44
45
  const positionDeltaRef = React.useRef(null);
45
46
  const positionRef = React.useRef(props.position);
47
+ const stacking = useStacking_1.useStacking();
46
48
  /**
47
49
  * This is needed because the function called in onDrop is saved when
48
50
  * it gets attached to the DOM element event handler.
@@ -50,7 +52,7 @@ exports.WindowModal = (props) => {
50
52
  */
51
53
  positionRef.current = props.position;
52
54
  const style = {
53
- zIndex: 1000,
55
+ zIndex: stacking.zIndex,
54
56
  position: 'absolute',
55
57
  left: props.position.x,
56
58
  top: props.position.y,
@@ -97,7 +99,7 @@ exports.WindowModal = (props) => {
97
99
  }, []);
98
100
  return react_dom_1.createPortal(React.createElement("div", { style: style,
99
101
  //@ts-ignore
100
- ref: targetRef },
102
+ ref: targetRef, onMouseDown: stacking.bringInFront },
101
103
  React.createElement(re_resizable_1.Resizable, { onResizeStop: handleResizeStop, onResize: handleResize, bounds: "window", defaultSize: {
102
104
  width: props.size.width,
103
105
  height: props.size.height,
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Used to facilitate the stacking between multiple opened windows.
3
+ * When calling 'bringToFront' brings caller to top.
4
+ * This is done by changing the zIndex of all registered window-modals.
5
+ */
6
+ export declare const useStacking: () => {
7
+ zIndex: number;
8
+ bringInFront: () => void;
9
+ };
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useStacking = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const uuid_1 = tslib_1.__importDefault(require("uuid"));
7
+ const setZIndexMap = {};
8
+ const zIndexMap = [];
9
+ const BASE_Z_INDEX = 1000;
10
+ /**
11
+ * Used to facilitate the stacking between multiple opened windows.
12
+ * When calling 'bringToFront' brings caller to top.
13
+ * This is done by changing the zIndex of all registered window-modals.
14
+ */
15
+ exports.useStacking = () => {
16
+ const modalZIndexId = React.useMemo(() => uuid_1.default(), []);
17
+ const [zIndex, setZIndex] = React.useState(BASE_Z_INDEX);
18
+ React.useEffect(() => {
19
+ setZIndexMap[modalZIndexId] = setZIndex;
20
+ return () => {
21
+ // clean-up
22
+ delete setZIndexMap[modalZIndexId];
23
+ const indexInMap = zIndexMap.indexOf(modalZIndexId);
24
+ zIndexMap.splice(indexInMap, 1);
25
+ };
26
+ }, [modalZIndexId]);
27
+ const bringInFront = React.useCallback(() => {
28
+ if (zIndexMap.includes(modalZIndexId)) {
29
+ const indexInMap = zIndexMap.indexOf(modalZIndexId);
30
+ zIndexMap.splice(indexInMap, 1);
31
+ zIndexMap.push(modalZIndexId);
32
+ }
33
+ else {
34
+ zIndexMap.push(modalZIndexId);
35
+ }
36
+ zIndexMap.forEach((id, index) => {
37
+ var _a;
38
+ (_a = setZIndexMap === null || setZIndexMap === void 0 ? void 0 : setZIndexMap[id]) === null || _a === void 0 ? void 0 : _a.call(setZIndexMap, BASE_Z_INDEX + index * 10);
39
+ });
40
+ }, []);
41
+ return {
42
+ zIndex,
43
+ bringInFront,
44
+ };
45
+ };
package/src/env.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
- IPUSHPULL_API_KEY: "CbBaMaoqHVifScrYwKssGnGyNkv5xHOhQVGm3cYP",
5
- IPUSHPULL_API_SECRET: "xYzE51kuHyyt9kQCvMe0tz0H2sDSjyEQcF5SOBlPQmcL9em0NqcCzyqLYj5fhpuZxQ8BiVcYl6zoOHeI6GYZj1TkUiiLVFoW3HUxiCdEUjlPS8Vl2YHUMEPD5qkLYnGj",
6
- INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862",
4
+ IPUSHPULL_API_KEY: 'CbBaMaoqHVifScrYwKssGnGyNkv5xHOhQVGm3cYP',
5
+ IPUSHPULL_API_SECRET: 'xYzE51kuHyyt9kQCvMe0tz0H2sDSjyEQcF5SOBlPQmcL9em0NqcCzyqLYj5fhpuZxQ8BiVcYl6zoOHeI6GYZj1TkUiiLVFoW3HUxiCdEUjlPS8Vl2YHUMEPD5qkLYnGj',
6
+ INFINITE_TABLE_LICENSE_KEY: 'StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862',
7
7
  };
@@ -78,27 +78,23 @@ export declare const ADAPTABLE_METAMODEL: {
78
78
  name: string;
79
79
  kind: string;
80
80
  description: string;
81
+ };
82
+ AdaptableAlertBase: {
83
+ name: string;
84
+ kind: string;
85
+ description: string;
81
86
  properties: ({
82
87
  name: string;
83
88
  kind: string;
84
89
  description: string;
85
90
  uiLabel: string;
86
91
  reference: string;
87
- isOptional?: undefined;
88
- } | {
89
- name: string;
90
- kind: string;
91
- description: string;
92
- uiLabel: string;
93
- isOptional: boolean;
94
- reference: string;
95
92
  } | {
96
93
  name: string;
97
94
  kind: string;
98
95
  description: string;
99
96
  uiLabel: string;
100
97
  reference?: undefined;
101
- isOptional?: undefined;
102
98
  })[];
103
99
  };
104
100
  AdaptableAlertQuery: {
@@ -149,6 +145,18 @@ export declare const ADAPTABLE_METAMODEL: {
149
145
  kind: string;
150
146
  description: string;
151
147
  };
148
+ AdaptableCellChangedAlert: {
149
+ name: string;
150
+ kind: string;
151
+ description: string;
152
+ properties: {
153
+ name: string;
154
+ kind: string;
155
+ description: string;
156
+ uiLabel: string;
157
+ reference: string;
158
+ }[];
159
+ };
152
160
  AdaptableColumn: {
153
161
  name: string;
154
162
  kind: string;
@@ -514,6 +522,18 @@ export declare const ADAPTABLE_METAMODEL: {
514
522
  reference: string;
515
523
  }[];
516
524
  };
525
+ AdaptableRowChangedAlert: {
526
+ name: string;
527
+ kind: string;
528
+ description: string;
529
+ properties: {
530
+ name: string;
531
+ kind: string;
532
+ description: string;
533
+ uiLabel: string;
534
+ reference: string;
535
+ }[];
536
+ };
517
537
  AdaptableScope: {
518
538
  name: string;
519
539
  kind: string;
@@ -832,6 +852,18 @@ export declare const ADAPTABLE_METAMODEL: {
832
852
  isOptional: boolean;
833
853
  }[];
834
854
  };
855
+ BaseMenuContext: {
856
+ name: string;
857
+ kind: string;
858
+ description: string;
859
+ properties: {
860
+ name: string;
861
+ kind: string;
862
+ description: string;
863
+ uiLabel: string;
864
+ reference: string;
865
+ }[];
866
+ };
835
867
  BulkUpdateApi: {
836
868
  name: string;
837
869
  kind: string;
@@ -2643,7 +2675,7 @@ export declare const ADAPTABLE_METAMODEL: {
2643
2675
  name: string;
2644
2676
  kind: string;
2645
2677
  description: string;
2646
- properties: {
2678
+ properties: ({
2647
2679
  name: string;
2648
2680
  kind: string;
2649
2681
  description: string;
@@ -2651,7 +2683,15 @@ export declare const ADAPTABLE_METAMODEL: {
2651
2683
  isOptional: boolean;
2652
2684
  gridInfo: string;
2653
2685
  defaultValue: string;
2654
- }[];
2686
+ } | {
2687
+ name: string;
2688
+ kind: string;
2689
+ description: string;
2690
+ uiLabel: string;
2691
+ isOptional: boolean;
2692
+ gridInfo?: undefined;
2693
+ defaultValue?: undefined;
2694
+ })[];
2655
2695
  };
2656
2696
  LayoutState: {
2657
2697
  name: string;