@adaptabletools/adaptable 10.0.2 → 10.0.3

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 (94) hide show
  1. package/base.css +68 -26
  2. package/index.css +80 -28
  3. package/package.json +1 -1
  4. package/publishTimestamp.d.ts +1 -1
  5. package/publishTimestamp.js +1 -1
  6. package/src/AdaptableInterfaces/IAdaptable.d.ts +12 -2
  7. package/src/AdaptableOptions/FilterOptions.d.ts +14 -7
  8. package/src/AdaptableOptions/LayoutOptions.d.ts +1 -1
  9. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +89 -4
  10. package/src/Api/AlertApi.d.ts +1 -1
  11. package/src/Api/ColumnApi.d.ts +33 -0
  12. package/src/Api/ConfigApi.d.ts +8 -0
  13. package/src/Api/GridApi.d.ts +34 -8
  14. package/src/Api/Implementation/AlertApiImpl.d.ts +1 -1
  15. package/src/Api/Implementation/AlertApiImpl.js +11 -4
  16. package/src/Api/Implementation/ColumnApiImpl.d.ts +7 -0
  17. package/src/Api/Implementation/ColumnApiImpl.js +37 -1
  18. package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
  19. package/src/Api/Implementation/ConfigApiImpl.js +28 -17
  20. package/src/Api/Implementation/FreeTextColumnApiImpl.js +2 -1
  21. package/src/Api/Implementation/GridApiImpl.d.ts +9 -0
  22. package/src/Api/Implementation/GridApiImpl.js +17 -1
  23. package/src/Api/Implementation/InternalApiImpl.d.ts +2 -0
  24. package/src/Api/Implementation/InternalApiImpl.js +16 -0
  25. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +11 -8
  26. package/src/Api/Implementation/UserInterfaceApiImpl.js +57 -80
  27. package/src/Api/InternalApi.d.ts +2 -0
  28. package/src/Api/UserInterfaceApi.d.ts +14 -5
  29. package/src/PredefinedConfig/AlertState.d.ts +5 -0
  30. package/src/PredefinedConfig/CalculatedColumnState.d.ts +4 -37
  31. package/src/PredefinedConfig/Common/AdaptablePredicate.js +16 -15
  32. package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +5 -1
  33. package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +49 -0
  34. package/src/{Utilities/Interface/ProgressIndicator.js → PredefinedConfig/Common/SpecialColumnSettings.js} +0 -0
  35. package/src/PredefinedConfig/FilterState.d.ts +1 -1
  36. package/src/PredefinedConfig/FreeTextColumnState.d.ts +10 -0
  37. package/src/PredefinedConfig/Selection/GridRow.d.ts +12 -4
  38. package/src/PredefinedConfig/SystemState.d.ts +4 -1
  39. package/src/Redux/Store/AdaptableStore.js +4 -0
  40. package/src/Strategy/AlertModule.js +1 -1
  41. package/src/Strategy/ExportModule.d.ts +0 -2
  42. package/src/Strategy/ExportModule.js +58 -61
  43. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -0
  44. package/src/Utilities/Helpers/DateHelper.d.ts +2 -2
  45. package/src/Utilities/Helpers/DateHelper.js +30 -20
  46. package/src/Utilities/ObjectFactory.d.ts +1 -1
  47. package/src/Utilities/ObjectFactory.js +13 -1
  48. package/src/Utilities/Services/MetamodelService.js +1 -0
  49. package/src/Utilities/Services/ReportService.js +1 -1
  50. package/src/Utilities/runIfNotResolvedIn.d.ts +8 -0
  51. package/src/Utilities/runIfNotResolvedIn.js +23 -0
  52. package/src/View/AdaptableView.js +1 -1
  53. package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +19 -5
  54. package/src/View/BulkUpdate/BulkUpdatePopup.d.ts +2 -0
  55. package/src/View/BulkUpdate/BulkUpdatePopup.js +4 -2
  56. package/src/View/BulkUpdate/BulkUpdateViewPanel.d.ts +2 -0
  57. package/src/View/BulkUpdate/BulkUpdateViewPanel.js +3 -1
  58. package/src/View/Components/FilterForm/FilterForm.d.ts +3 -51
  59. package/src/View/Components/FilterForm/FilterForm.js +44 -23
  60. package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +3 -0
  61. package/src/View/Components/FilterForm/ListBoxFilterForm.js +14 -5
  62. package/src/View/Components/FilterForm/QuickFilterForm.d.ts +3 -43
  63. package/src/View/Components/FilterForm/QuickFilterForm.js +64 -23
  64. package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +3 -0
  65. package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.js +8 -0
  66. package/src/View/Components/Popups/AdaptablePopup.d.ts +1 -1
  67. package/src/View/Components/Selectors/ColumnValueSelector.d.ts +10 -2
  68. package/src/View/Components/Selectors/ColumnValueSelector.js +45 -13
  69. package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +24 -6
  70. package/src/View/FreeTextColumn/FreeTextColumnPopup.js +3 -1
  71. package/src/View/FreeTextColumn/FreeTextColumnSummary.js +3 -1
  72. package/src/View/GridInfo/GridInfoPopup.js +4 -1
  73. package/src/View/UIHelper.d.ts +2 -0
  74. package/src/View/UIHelper.js +10 -1
  75. package/src/agGrid/ActionColumnRenderer.d.ts +2 -1
  76. package/src/agGrid/ActionColumnRenderer.js +20 -3
  77. package/src/agGrid/Adaptable.d.ts +20 -4
  78. package/src/agGrid/Adaptable.js +166 -50
  79. package/src/components/Dashboard/Dashboard.js +1 -1
  80. package/src/components/DropdownButton/index.js +1 -1
  81. package/src/components/Loader/Loader.d.ts +7 -0
  82. package/src/components/Loader/Loader.js +13 -0
  83. package/src/components/Loader/index.d.ts +2 -0
  84. package/src/components/Loader/index.js +7 -0
  85. package/src/components/ProgressIndicator/ProgressIndicator.d.ts +2 -0
  86. package/src/components/ProgressIndicator/ProgressIndicator.js +54 -0
  87. package/src/metamodel/adaptable.metamodel.d.ts +72 -2
  88. package/src/metamodel/adaptable.metamodel.js +304 -69
  89. package/src/types.d.ts +4 -3
  90. package/version.d.ts +1 -1
  91. package/version.js +1 -1
  92. package/src/Utilities/Interface/ProgressIndicator.d.ts +0 -4
  93. package/src/View/Export/ProgressIndicator.d.ts +0 -6
  94. package/src/View/Export/ProgressIndicator.js +0 -25
@@ -416,7 +416,7 @@ class Adaptable {
416
416
  this.isInitialised = true;
417
417
  });
418
418
  if (this.abContainerElement == null) {
419
- this.abContainerElement = this.getadaptableContainerElement();
419
+ this.abContainerElement = this.getAdaptableContainerElement();
420
420
  }
421
421
  if (this.abContainerElement != null) {
422
422
  this.abContainerElement.innerHTML = '';
@@ -484,17 +484,19 @@ class Adaptable {
484
484
  });
485
485
  }
486
486
  performAudit(action, oldState, newState) {
487
- const adaptableStateChangedInfo = {
488
- actionName: action.type,
489
- clientTimestamp: new Date(),
490
- userName: this.adaptableOptions.userName,
491
- adaptableId: this.adaptableOptions.adaptableId,
492
- adaptableStateKey: this.adaptableOptions.adaptableStateKey,
493
- action: action,
494
- oldState: oldState,
495
- newState: newState,
496
- };
497
- this.api.eventApi.emit('AdaptableStateChanged', adaptableStateChangedInfo);
487
+ if (this.isInitialised) {
488
+ const adaptableStateChangedInfo = {
489
+ actionName: action.type,
490
+ clientTimestamp: new Date(),
491
+ userName: this.adaptableOptions.userName,
492
+ adaptableId: this.adaptableOptions.adaptableId,
493
+ adaptableStateKey: this.adaptableOptions.adaptableStateKey,
494
+ action: action,
495
+ oldState: oldState,
496
+ newState: newState,
497
+ };
498
+ this.api.eventApi.emit('AdaptableStateChanged', adaptableStateChangedInfo);
499
+ }
498
500
  }
499
501
  initializeAgGrid() {
500
502
  var _a;
@@ -950,6 +952,26 @@ class Adaptable {
950
952
  .join(' ');
951
953
  return classNames;
952
954
  }
955
+ getEditableCellClass(abColumn, params) {
956
+ const editableCellStyle = this.api.userInterfaceApi.getEditableCellStyle();
957
+ if (!(editableCellStyle === null || editableCellStyle === void 0 ? void 0 : editableCellStyle.ClassName)) {
958
+ return null;
959
+ }
960
+ const isCellEditable = this.api.gridApi.areCellsEditable([
961
+ this.getGridCellFromRowNode(params.node, abColumn.ColumnId),
962
+ ]);
963
+ return isCellEditable ? editableCellStyle.ClassName : null;
964
+ }
965
+ getReadonlyCellClass(abColumn, params) {
966
+ const readonlyCellStyle = this.api.userInterfaceApi.getReadOnlyCellStyle();
967
+ if (!(readonlyCellStyle === null || readonlyCellStyle === void 0 ? void 0 : readonlyCellStyle.ClassName)) {
968
+ return null;
969
+ }
970
+ const isCellReadonly = !this.api.gridApi.areCellsEditable([
971
+ this.getGridCellFromRowNode(params.node, abColumn.ColumnId),
972
+ ]);
973
+ return isCellReadonly ? readonlyCellStyle.ClassName : null;
974
+ }
953
975
  isQuickSearchActive(abColumn, params) {
954
976
  if (abColumn.IsExcludedFromQuickSearch) {
955
977
  return false;
@@ -1365,7 +1387,9 @@ class Adaptable {
1365
1387
  isMaster: !!(node.master != null && node.master == true),
1366
1388
  isExpanded: !!(node.expanded != null && node.expanded == true),
1367
1389
  isGroup: !!(node.group != null && node.group == true),
1368
- level: node.level,
1390
+ isSelected: true,
1391
+ isDisplayed: node.displayed == true,
1392
+ rowGroupLevel: node.level,
1369
1393
  };
1370
1394
  const gridRow = {
1371
1395
  primaryKeyValue: this.getPrimaryKeyValueFromRowNode(node),
@@ -1419,11 +1443,11 @@ class Adaptable {
1419
1443
  cancelEdit() {
1420
1444
  this.gridOptions.api.stopEditing(true);
1421
1445
  }
1422
- getDistinctValuesForColumn(column, visibleRowsOnly, skipRowNode) {
1446
+ getDistinctValuesForColumn(column, visibleRowsOnly, skipRowNode, permittedValues) {
1423
1447
  let returnValues = [];
1424
1448
  // this function does NOT look up for server values but actually it should...
1425
1449
  // that is currently commented out in the column api function (previously in filter form)
1426
- const permittedValues = this.api.userInterfaceApi.getPermittedValuesForColumn(column);
1450
+ permittedValues = permittedValues !== null && permittedValues !== void 0 ? permittedValues : this.api.userInterfaceApi.getPermittedValuesForColumn(column);
1427
1451
  if (ArrayExtensions_1.ArrayExtensions.IsNotNull(permittedValues)) {
1428
1452
  returnValues = permittedValues.map((pv) => {
1429
1453
  return {
@@ -1456,6 +1480,46 @@ class Adaptable {
1456
1480
  const uniqueVals = uniqBy_1.default(returnValues, 'displayValue');
1457
1481
  return uniqueVals.slice(0, this.adaptableOptions.filterOptions.maxFilterValuesToDisplay);
1458
1482
  }
1483
+ async getDistinctFilterValuesForColumn(column, visibleRowsOnly, filter, skipRowNode) {
1484
+ var _a;
1485
+ const permittedValues = (_a = this.api.userInterfaceApi.getFilterPermittedValuesForColumn(column)) !== null && _a !== void 0 ? _a : {
1486
+ suppressClientSideFiltering: false,
1487
+ values: () => undefined,
1488
+ };
1489
+ let preparedPermittedValues = undefined;
1490
+ try {
1491
+ preparedPermittedValues = await (permittedValues === null || permittedValues === void 0 ? void 0 : permittedValues.values(column, filter));
1492
+ }
1493
+ catch (error) {
1494
+ LoggingHelper_1.ConsoleLogError(`Failed to load filter permitted values`, column, filter, error);
1495
+ }
1496
+ return {
1497
+ suppressClientSideFilter: permittedValues.suppressClientSideFiltering,
1498
+ gridCells: this.getDistinctValuesForColumn(column, visibleRowsOnly, skipRowNode, preparedPermittedValues),
1499
+ };
1500
+ }
1501
+ async getDistinctCustomSortValuesForColumn(column, visibleRowsOnly, skipRowNode) {
1502
+ const permittedValues = await this.api.userInterfaceApi.getCustomSortPermittedValuesForColumn(column);
1503
+ let preparedPermittedValues = undefined;
1504
+ try {
1505
+ preparedPermittedValues = await (permittedValues === null || permittedValues === void 0 ? void 0 : permittedValues.values(column));
1506
+ }
1507
+ catch (error) {
1508
+ LoggingHelper_1.ConsoleLogError(`Failed to load custom sort permitted values`, column, error);
1509
+ }
1510
+ return this.getDistinctValuesForColumn(column, visibleRowsOnly, skipRowNode, preparedPermittedValues);
1511
+ }
1512
+ async getDistinctBulkUpdateValuesForColumn(column, visibleRowsOnly, selectedGridCells, skipRowNode) {
1513
+ const permittedValues = await this.api.userInterfaceApi.getBulkUpdatePermittedValuesForColumn(column);
1514
+ let preparedPermittedValues = undefined;
1515
+ try {
1516
+ preparedPermittedValues = await (permittedValues === null || permittedValues === void 0 ? void 0 : permittedValues.values(column, selectedGridCells));
1517
+ }
1518
+ catch (error) {
1519
+ LoggingHelper_1.ConsoleLogError(`Failed to load bulk permitted values`, error, column, selectedGridCells);
1520
+ }
1521
+ return this.getDistinctValuesForColumn(column, visibleRowsOnly, skipRowNode, preparedPermittedValues);
1522
+ }
1459
1523
  getColumnValueDisplayValuePairList(columnId, visibleRowsOnly, onlyIncludeIds) {
1460
1524
  const returnArray = [];
1461
1525
  let permittedMap = new Map();
@@ -1794,9 +1858,12 @@ class Adaptable {
1794
1858
  ];
1795
1859
  }
1796
1860
  getColDefsForFreeTextColumns() {
1797
- let filterable = this.api.internalApi.getAdaptableOptions().filterOptions
1861
+ const specialColumnsAreFilterable = this.api.internalApi.getAdaptableOptions().filterOptions
1798
1862
  .enableFilterOnSpecialColumns;
1863
+ const defaultFreeTextColumnSettings = ObjectFactory_1.CreateEmptyFreeTextColumn(specialColumnsAreFilterable)
1864
+ .FreeTextColumnSettings;
1799
1865
  return this.api.freeTextColumnApi.getAllFreeTextColumn().map((freeTextColumn) => {
1866
+ const freeTextColumnSettings = Object.assign(Object.assign({}, defaultFreeTextColumnSettings), freeTextColumn.FreeTextColumnSettings);
1800
1867
  const dataTypeEditor = freeTextColumn.DataType === 'Number'
1801
1868
  ? AdaptableNumberEditor_1.AdaptableNumberEditor
1802
1869
  : freeTextColumn.DataType === 'Date'
@@ -1808,10 +1875,16 @@ class Adaptable {
1808
1875
  colId: freeTextColumn.ColumnId,
1809
1876
  editable: true,
1810
1877
  hide: true,
1811
- filter: filterable,
1812
- sortable: true,
1813
- resizable: true,
1814
- enableRowGroup: true,
1878
+ width: freeTextColumnSettings.Width,
1879
+ enableValue: freeTextColumnSettings.Aggregatable,
1880
+ filter: freeTextColumnSettings.Filterable,
1881
+ floatingFilter: freeTextColumnSettings.Filterable,
1882
+ resizable: freeTextColumnSettings.Resizable,
1883
+ enableRowGroup: freeTextColumnSettings.Groupable,
1884
+ sortable: freeTextColumnSettings.Sortable,
1885
+ enablePivot: freeTextColumnSettings.Pivotable,
1886
+ suppressMenu: freeTextColumnSettings.SuppressMenu,
1887
+ suppressMovable: freeTextColumnSettings.SuppressMovable,
1815
1888
  cellEditor: dataTypeEditor !== null && dataTypeEditor !== void 0 ? dataTypeEditor : (freeTextColumn.TextEditor && freeTextColumn.TextEditor == 'Large'
1816
1889
  ? 'agLargeTextCellEditor'
1817
1890
  : 'agTextCellEditor'),
@@ -1846,15 +1919,24 @@ class Adaptable {
1846
1919
  }
1847
1920
  }
1848
1921
  getColDefsForActionColumns() {
1922
+ const defaultActionColumnSettings = {
1923
+ resizable: true,
1924
+ suppressMenu: false,
1925
+ suppressMovable: false,
1926
+ };
1849
1927
  return this.api.userInterfaceApi.getAllActionColumn().map((actionColumn) => {
1928
+ const actionColumnSettings = Object.assign(Object.assign({}, defaultActionColumnSettings), actionColumn.actionColumnSettings);
1850
1929
  const newColDef = {
1851
1930
  headerName: actionColumn.friendlyName ? actionColumn.friendlyName : actionColumn.columnId,
1852
1931
  colId: actionColumn.columnId,
1853
- editable: false,
1854
1932
  hide: false,
1933
+ editable: false,
1934
+ width: actionColumnSettings.width,
1935
+ resizable: actionColumnSettings.resizable,
1936
+ suppressMenu: actionColumnSettings.suppressMenu,
1937
+ suppressMovable: actionColumnSettings.suppressMovable,
1855
1938
  filter: false,
1856
1939
  sortable: false,
1857
- resizable: true,
1858
1940
  enableRowGroup: false,
1859
1941
  cellRenderer: ActionColumnRenderer_1.ActionColumnRenderer,
1860
1942
  type: [GeneralConstants_1.AB_SPECIAL_COLUMN, 'abColDefObject'],
@@ -1881,16 +1963,17 @@ class Adaptable {
1881
1963
  this.setLayout();
1882
1964
  }
1883
1965
  getColDefsForCalculatedColumns() {
1966
+ const specialColumnsAreFilterable = this.adaptableOptions.filterOptions
1967
+ .enableFilterOnSpecialColumns
1968
+ ? this.adaptableOptions.filterOptions.enableFilterOnSpecialColumns
1969
+ : true;
1970
+ const defaultCalculatedColumnSettings = ObjectFactory_1.CreateEmptyCalculatedColumn(specialColumnsAreFilterable)
1971
+ .CalculatedColumnSettings;
1884
1972
  return this.api.calculatedColumnApi.getAllCalculatedColumn().map((calculatedColumn) => {
1885
1973
  var _a;
1886
- if (!calculatedColumn.CalculatedColumnSettings) {
1887
- let filterable = this.adaptableOptions.filterOptions.enableFilterOnSpecialColumns
1888
- ? this.adaptableOptions.filterOptions.enableFilterOnSpecialColumns
1889
- : true;
1890
- calculatedColumn.CalculatedColumnSettings = ObjectFactory_1.CreateEmptyCalculatedColumn(filterable).CalculatedColumnSettings;
1891
- }
1892
- if (!calculatedColumn.CalculatedColumnSettings.DataType) {
1893
- calculatedColumn.CalculatedColumnSettings.DataType = this.CalculatedColumnExpressionService.GetCalculatedColumnDataType((_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression);
1974
+ const calculatedColumnSettings = Object.assign(Object.assign({}, defaultCalculatedColumnSettings), calculatedColumn.CalculatedColumnSettings);
1975
+ if (!calculatedColumnSettings.DataType) {
1976
+ calculatedColumnSettings.DataType = this.CalculatedColumnExpressionService.GetCalculatedColumnDataType((_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression);
1894
1977
  }
1895
1978
  const newColDef = {
1896
1979
  headerName: calculatedColumn.FriendlyName
@@ -1899,25 +1982,27 @@ class Adaptable {
1899
1982
  colId: calculatedColumn.ColumnId,
1900
1983
  hide: true,
1901
1984
  editable: false,
1902
- width: calculatedColumn.CalculatedColumnSettings.Width,
1903
- enableValue: calculatedColumn.CalculatedColumnSettings.Aggregatable,
1904
- filter: calculatedColumn.CalculatedColumnSettings.Filterable,
1905
- floatingFilter: calculatedColumn.CalculatedColumnSettings.Filterable,
1906
- resizable: calculatedColumn.CalculatedColumnSettings.Resizable,
1907
- enableRowGroup: calculatedColumn.CalculatedColumnSettings.Groupable,
1908
- sortable: calculatedColumn.CalculatedColumnSettings.Sortable,
1909
- enablePivot: calculatedColumn.CalculatedColumnSettings.Pivotable,
1985
+ width: calculatedColumnSettings.Width,
1986
+ enableValue: calculatedColumnSettings.Aggregatable,
1987
+ filter: calculatedColumnSettings.Filterable,
1988
+ floatingFilter: calculatedColumnSettings.Filterable,
1989
+ resizable: calculatedColumnSettings.Resizable,
1990
+ enableRowGroup: calculatedColumnSettings.Groupable,
1991
+ sortable: calculatedColumnSettings.Sortable,
1992
+ enablePivot: calculatedColumnSettings.Pivotable,
1993
+ suppressMenu: calculatedColumnSettings.SuppressMenu,
1994
+ suppressMovable: calculatedColumnSettings.SuppressMovable,
1910
1995
  type: [
1911
1996
  GeneralConstants_1.AB_SPECIAL_COLUMN,
1912
- this.agGridHelper.getAgGridDataType(calculatedColumn.CalculatedColumnSettings.DataType),
1997
+ this.agGridHelper.getAgGridDataType(calculatedColumnSettings.DataType),
1913
1998
  ],
1914
1999
  valueGetter: (params) => {
1915
2000
  var _a;
1916
2001
  return this.CalculatedColumnExpressionService.ComputeExpressionValue((_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression, params.node);
1917
2002
  },
1918
2003
  };
1919
- if (calculatedColumn.CalculatedColumnSettings.ShowToolTip != null &&
1920
- calculatedColumn.CalculatedColumnSettings.ShowToolTip == true) {
2004
+ if (calculatedColumnSettings.ShowToolTip != null &&
2005
+ calculatedColumnSettings.ShowToolTip == true) {
1921
2006
  newColDef.tooltipValueGetter = () => {
1922
2007
  var _a;
1923
2008
  return (_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression;
@@ -1986,7 +2071,7 @@ class Adaptable {
1986
2071
  this.emitter = null;
1987
2072
  this._adaptableReady = false;
1988
2073
  Adaptable.dismissInstance(this);
1989
- const abContainerElement = this.getadaptableContainerElement();
2074
+ const abContainerElement = this.getAdaptableContainerElement();
1990
2075
  if (config && !config.unmount) {
1991
2076
  return;
1992
2077
  }
@@ -2048,7 +2133,7 @@ class Adaptable {
2048
2133
  getCurrentIPPStyle() {
2049
2134
  return this.agGridHelper.getCurrentIPPStyle();
2050
2135
  }
2051
- getadaptableContainerElement() {
2136
+ getAdaptableContainerElement() {
2052
2137
  if (!this.abContainerElement) {
2053
2138
  let containerOptionsContainer = this.adaptableOptions.containerOptions.adaptableContainer;
2054
2139
  this.abContainerElement =
@@ -2084,7 +2169,7 @@ class Adaptable {
2084
2169
  initInternalGridLogic() {
2085
2170
  LoggingHelper_1.LogAdaptableInfo(`Initializing InternalGridLogic...`);
2086
2171
  if (this.abContainerElement == null) {
2087
- this.abContainerElement = this.getadaptableContainerElement();
2172
+ this.abContainerElement = this.getAdaptableContainerElement();
2088
2173
  }
2089
2174
  if (this.abContainerElement == null) {
2090
2175
  if (typeof this.adaptableOptions.containerOptions.adaptableContainer === 'string') {
@@ -2571,6 +2656,8 @@ class Adaptable {
2571
2656
  const cellClass = (params) => {
2572
2657
  const isQuickSearchActive = hasQuickSearchStyleClassName && this.isQuickSearchActive(abColumn, params);
2573
2658
  const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(params.node);
2659
+ const editableClassName = this.getEditableCellClass(abColumn, params);
2660
+ const readonlyClassName = this.getReadonlyCellClass(abColumn, params);
2574
2661
  let returnValue = [
2575
2662
  this.getExcelClassNameForCell(colId, primaryKeyValue),
2576
2663
  typeof userCellClass === 'function' ? userCellClass(params) : userCellClass,
@@ -2579,6 +2666,8 @@ class Adaptable {
2579
2666
  ? this.getConditionalStyleCellClass(conditionalStyles, abColumn, params)
2580
2667
  : null,
2581
2668
  isQuickSearchActive ? quickSearchStyleClassName : null,
2669
+ editableClassName,
2670
+ readonlyClassName,
2582
2671
  ]
2583
2672
  .filter((x) => !!x)
2584
2673
  .join(' ');
@@ -2591,7 +2680,8 @@ class Adaptable {
2591
2680
  return `--excel-cell-${colId}-${primaryKeyValue}`;
2592
2681
  }
2593
2682
  setupColumnCellEditor({ colId, col }) {
2594
- const editLookUpItem = this.api.userInterfaceApi.getEditLookUpItemForColumn(colId);
2683
+ const adaptableColumn = this.api.columnApi.getColumnFromId(colId);
2684
+ const editLookUpItem = this.api.userInterfaceApi.getEditLookUpItemForColumn(adaptableColumn);
2595
2685
  this.setColDefProperty(col, 'cellEditor', () => {
2596
2686
  if (editLookUpItem) {
2597
2687
  return this.isModulePresent('rich-select')
@@ -2599,10 +2689,12 @@ class Adaptable {
2599
2689
  : 'agSelectCellEditor';
2600
2690
  }
2601
2691
  });
2602
- this.setColDefProperty(col, 'cellEditorParams', () => {
2692
+ this.setColDefProperty(col, 'cellEditorParams', (params) => {
2603
2693
  if (editLookUpItem) {
2604
- return {
2605
- values: this.api.userInterfaceApi.getEditLookUpValuesForEditLookUpItem(editLookUpItem, colId),
2694
+ return (params) => {
2695
+ return {
2696
+ values: this.api.userInterfaceApi.getEditLookUpValuesForEditLookUpItem(editLookUpItem, colId, params === null || params === void 0 ? void 0 : params.data),
2697
+ };
2606
2698
  };
2607
2699
  }
2608
2700
  });
@@ -3250,6 +3342,26 @@ class Adaptable {
3250
3342
  }
3251
3343
  this.gridOptions.api.setRowData(dataSource);
3252
3344
  }
3345
+ getGridData() {
3346
+ var _a;
3347
+ const data = [];
3348
+ (_a = this.gridOptions) === null || _a === void 0 ? void 0 : _a.api.forEachNode((rowNode) => {
3349
+ if (!this.isGroupRowNode(rowNode)) {
3350
+ data.push(rowNode.data);
3351
+ }
3352
+ });
3353
+ return data;
3354
+ }
3355
+ getFilteredData() {
3356
+ var _a;
3357
+ const data = [];
3358
+ (_a = this.gridOptions) === null || _a === void 0 ? void 0 : _a.api.forEachNodeAfterFilter((rowNode) => {
3359
+ if (!this.isGroupRowNode(rowNode)) {
3360
+ data.push(rowNode.data);
3361
+ }
3362
+ });
3363
+ return data;
3364
+ }
3253
3365
  loadDataSource(dataSource) {
3254
3366
  if (this.hasAutogeneratedPrimaryKey()) {
3255
3367
  this.addSyntheticPrimaryKey(dataSource);
@@ -3273,11 +3385,15 @@ class Adaptable {
3273
3385
  this.addSyntheticPrimaryKey(dataRows);
3274
3386
  }
3275
3387
  dataUpdateConfig = dataUpdateConfig || {};
3388
+ const newData = { add: dataRows };
3389
+ if (dataUpdateConfig.addIndex !== undefined) {
3390
+ newData.addIndex = dataUpdateConfig.addIndex;
3391
+ }
3276
3392
  if (dataUpdateConfig.runAsync) {
3277
- this.gridOptions.api.applyTransactionAsync({ add: dataRows }, dataUpdateConfig.callback);
3393
+ this.gridOptions.api.applyTransactionAsync(newData, dataUpdateConfig.callback);
3278
3394
  }
3279
3395
  else {
3280
- this.gridOptions.api.applyTransaction({ add: dataRows });
3396
+ this.gridOptions.api.applyTransaction(newData);
3281
3397
  }
3282
3398
  }
3283
3399
  deleteRows(dataRows, dataUpdateConfig) {
@@ -44,7 +44,7 @@ function Dashboard(props) {
44
44
  return null;
45
45
  }
46
46
  const activeTabTitle = (_c = (_b = (_a = children === null || children === void 0 ? void 0 : children[activeTabIndex]) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : 'Select Toolbar';
47
- return (React.createElement(DropdownButton_1.default, { ml: 1, items: React.Children.map(children, (child, index) => ({
47
+ return (React.createElement(DropdownButton_1.default, { ml: 1, columns: ['label'], items: React.Children.map(children, (child, index) => ({
48
48
  value: String(index),
49
49
  label: child.props.title,
50
50
  onClick: () => setActiveTabIndex(index),
@@ -17,7 +17,7 @@ const defaultListItemStyle = {
17
17
  padding: 'var(--ab-cmp-dropdownbutton-list-item__padding)',
18
18
  };
19
19
  const DropdownButton = React.forwardRef((props, ref) => {
20
- let { columns, overlayProps, listOffset = 10, collapseOnItemClick = true, focusOnClear = true, idProperty = 'id', isItemDisabled, items, children, listMinWidth = 100, listStyle, listItemStyle, listItemClassName, constrainTo, showClearButton = false, onClear, clearButtonProps } = props, domProps = tslib_1.__rest(props, ["columns", "overlayProps", "listOffset", "collapseOnItemClick", "focusOnClear", "idProperty", "isItemDisabled", "items", "children", "listMinWidth", "listStyle", "listItemStyle", "listItemClassName", "constrainTo", "showClearButton", "onClear", "clearButtonProps"]);
20
+ let { columns, overlayProps, listOffset = 10, collapseOnItemClick = true, focusOnClear = true, idProperty = 'id', isItemDisabled, items, children, listMinWidth = 100, listStyle, listItemStyle, listItemClassName, constrainTo, showClearButton = false, onClear, clearButtonProps, onExpand, onCollapse } = props, domProps = tslib_1.__rest(props, ["columns", "overlayProps", "listOffset", "collapseOnItemClick", "focusOnClear", "idProperty", "isItemDisabled", "items", "children", "listMinWidth", "listStyle", "listItemStyle", "listItemClassName", "constrainTo", "showClearButton", "onClear", "clearButtonProps", "onExpand", "onCollapse"]);
21
21
  isItemDisabled = isItemDisabled || ((item) => item.disabled);
22
22
  if (!columns) {
23
23
  columns = ['icon', 'label'];
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ export declare const LoaderSpinner: React.FunctionComponent<{
3
+ style?: React.CSSProperties;
4
+ }>;
5
+ export declare const Loader: React.FunctionComponent<{
6
+ style?: React.CSSProperties;
7
+ }>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Loader = exports.LoaderSpinner = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ exports.LoaderSpinner = (props) => {
7
+ return React.createElement("div", { style: props.style, className: "ab-Loader__Spinner" });
8
+ };
9
+ exports.Loader = (props) => {
10
+ return (React.createElement("div", { style: props.style, className: "ab-Loader" },
11
+ React.createElement(exports.LoaderSpinner, null),
12
+ React.createElement("span", { className: "ab-Loader__text" }, props.children)));
13
+ };
@@ -0,0 +1,2 @@
1
+ export { Loader } from './Loader';
2
+ export { LoaderSpinner } from './Loader';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoaderSpinner = exports.Loader = void 0;
4
+ var Loader_1 = require("./Loader");
5
+ Object.defineProperty(exports, "Loader", { enumerable: true, get: function () { return Loader_1.Loader; } });
6
+ var Loader_2 = require("./Loader");
7
+ Object.defineProperty(exports, "LoaderSpinner", { enumerable: true, get: function () { return Loader_2.LoaderSpinner; } });
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const ProgressIndicator: React.FunctionComponent;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProgressIndicator = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const react_redux_1 = require("react-redux");
7
+ const react_1 = require("react");
8
+ const Loader_1 = require("../Loader");
9
+ const AdaptableContext_1 = require("../../View/AdaptableContext");
10
+ exports.ProgressIndicator = () => {
11
+ const { active, label } = react_redux_1.useSelector((state) => state.System.ProgressIndicator);
12
+ const [visible, setVisible] = react_1.useState(false);
13
+ const [progressIndicatorCoordinates, setProgressIndicatorCoordinates] = react_1.useState({
14
+ top: 0,
15
+ left: 0,
16
+ height: 0,
17
+ width: 0,
18
+ });
19
+ const adaptable = AdaptableContext_1.useAdaptable();
20
+ const adaptableContainerRef = react_1.useRef(adaptable.getAdaptableContainerElement());
21
+ const gridContainerRef = react_1.useRef(adaptable.getGridContainerElement());
22
+ const disableAdaptableGrid = (elemRef, disabled) => {
23
+ const DISABLING_CSS_CLASS = 'ab-wait-for-progress-indicator';
24
+ if (!elemRef.current) {
25
+ return;
26
+ }
27
+ if (disabled) {
28
+ elemRef.current.classList.add(DISABLING_CSS_CLASS);
29
+ }
30
+ else {
31
+ elemRef.current.classList.remove(DISABLING_CSS_CLASS);
32
+ }
33
+ };
34
+ const updateGridContainerCoordinates = () => {
35
+ if (!gridContainerRef.current) {
36
+ return;
37
+ }
38
+ const { top, left, height, width } = gridContainerRef.current.getBoundingClientRect();
39
+ setProgressIndicatorCoordinates({ top, left, height, width });
40
+ };
41
+ react_1.useEffect(() => {
42
+ disableAdaptableGrid(adaptableContainerRef, active);
43
+ disableAdaptableGrid(gridContainerRef, active);
44
+ updateGridContainerCoordinates();
45
+ // without RAF the progress indicator would be rendered instantly, without the 'transition-delay' defined via CSS
46
+ requestAnimationFrame(() => {
47
+ setVisible(active);
48
+ });
49
+ }, [active]);
50
+ return (React.createElement(React.Fragment, null, active && (React.createElement("div", { className: `ab-progress-indicator-wrapper ${visible ? 'ab-progress-indicator-wrapper--visible' : ''}`, style: progressIndicatorCoordinates },
51
+ React.createElement("div", { className: "ab-progress-indicator-body" },
52
+ React.createElement(Loader_1.LoaderSpinner, null),
53
+ React.createElement("span", { style: { marginLeft: 'var(--ab-space-2)' } }, label))))));
54
+ };
@@ -14,12 +14,21 @@ export declare const ADAPTABLE_METAMODEL: {
14
14
  description: string;
15
15
  uiLabel: string;
16
16
  isOptional?: undefined;
17
+ reference?: undefined;
17
18
  } | {
18
19
  name: string;
19
20
  kind: string;
20
21
  description: string;
21
22
  uiLabel: string;
22
23
  isOptional: boolean;
24
+ reference: string;
25
+ } | {
26
+ name: string;
27
+ kind: string;
28
+ description: string;
29
+ uiLabel: string;
30
+ isOptional: boolean;
31
+ reference?: undefined;
23
32
  })[];
24
33
  };
25
34
  ActionColumnButtonContext: {
@@ -40,6 +49,26 @@ export declare const ADAPTABLE_METAMODEL: {
40
49
  reference?: undefined;
41
50
  })[];
42
51
  };
52
+ ActionColumnSettings: {
53
+ name: string;
54
+ kind: string;
55
+ description: string;
56
+ properties: ({
57
+ name: string;
58
+ kind: string;
59
+ description: string;
60
+ uiLabel: string;
61
+ isOptional: boolean;
62
+ defaultValue: string;
63
+ } | {
64
+ name: string;
65
+ kind: string;
66
+ description: string;
67
+ uiLabel: string;
68
+ isOptional: boolean;
69
+ defaultValue?: undefined;
70
+ })[];
71
+ };
43
72
  ActionHandler: {
44
73
  name: string;
45
74
  kind: string;
@@ -804,14 +833,14 @@ export declare const ADAPTABLE_METAMODEL: {
804
833
  description: string;
805
834
  uiLabel: string;
806
835
  isOptional: boolean;
807
- defaultValue: string;
836
+ defaultValue?: undefined;
808
837
  } | {
809
838
  name: string;
810
839
  kind: string;
811
840
  description: string;
812
841
  uiLabel: string;
813
842
  isOptional: boolean;
814
- defaultValue?: undefined;
843
+ defaultValue: string;
815
844
  })[];
816
845
  };
817
846
  CalculatedColumnState: {
@@ -905,6 +934,11 @@ export declare const ADAPTABLE_METAMODEL: {
905
934
  kind: string;
906
935
  description: string;
907
936
  };
937
+ CellValuesList: {
938
+ name: string;
939
+ kind: string;
940
+ description: string;
941
+ };
908
942
  ChartApi: {
909
943
  name: string;
910
944
  kind: string;
@@ -1927,6 +1961,7 @@ export declare const ADAPTABLE_METAMODEL: {
1927
1961
  uiLabel: string;
1928
1962
  isOptional?: undefined;
1929
1963
  defaultValue?: undefined;
1964
+ reference?: undefined;
1930
1965
  } | {
1931
1966
  name: string;
1932
1967
  kind: string;
@@ -1934,12 +1969,22 @@ export declare const ADAPTABLE_METAMODEL: {
1934
1969
  uiLabel: string;
1935
1970
  isOptional: boolean;
1936
1971
  defaultValue: string;
1972
+ reference?: undefined;
1973
+ } | {
1974
+ name: string;
1975
+ kind: string;
1976
+ description: string;
1977
+ uiLabel: string;
1978
+ isOptional: boolean;
1979
+ defaultValue?: undefined;
1980
+ reference?: undefined;
1937
1981
  } | {
1938
1982
  name: string;
1939
1983
  kind: string;
1940
1984
  description: string;
1941
1985
  uiLabel: string;
1942
1986
  isOptional: boolean;
1987
+ reference: string;
1943
1988
  defaultValue?: undefined;
1944
1989
  })[];
1945
1990
  };
@@ -1954,6 +1999,11 @@ export declare const ADAPTABLE_METAMODEL: {
1954
1999
  uiLabel: string;
1955
2000
  }[];
1956
2001
  };
2002
+ FreeTextColumnSettings: {
2003
+ name: string;
2004
+ kind: string;
2005
+ description: string;
2006
+ };
1957
2007
  FreeTextColumnState: {
1958
2008
  name: string;
1959
2009
  kind: string;
@@ -3025,6 +3075,26 @@ export declare const ADAPTABLE_METAMODEL: {
3025
3075
  isOptional: boolean;
3026
3076
  }[];
3027
3077
  };
3078
+ SpecialColumnSettings: {
3079
+ name: string;
3080
+ kind: string;
3081
+ description: string;
3082
+ properties: ({
3083
+ name: string;
3084
+ kind: string;
3085
+ description: string;
3086
+ uiLabel: string;
3087
+ isOptional: boolean;
3088
+ defaultValue: string;
3089
+ } | {
3090
+ name: string;
3091
+ kind: string;
3092
+ description: string;
3093
+ uiLabel: string;
3094
+ isOptional: boolean;
3095
+ defaultValue?: undefined;
3096
+ })[];
3097
+ };
3028
3098
  StateOptions: {
3029
3099
  name: string;
3030
3100
  kind: string;