@adaptabletools/adaptable 11.2.3 → 11.3.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 (89) hide show
  1. package/bundle.cjs.js +106 -106
  2. package/package.json +1 -1
  3. package/publishTimestamp.d.ts +1 -1
  4. package/publishTimestamp.js +1 -1
  5. package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -0
  6. package/src/AdaptableOptions/AdaptableOptions.d.ts +7 -0
  7. package/src/AdaptableOptions/EditOptions.d.ts +92 -4
  8. package/src/AdaptableOptions/FinancePluginOptions.d.ts +33 -3
  9. package/src/AdaptableOptions/FormatColumnOptions.d.ts +10 -0
  10. package/src/AdaptableOptions/{SmartEdit.js → FormatColumnOptions.js} +0 -0
  11. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +17 -3
  12. package/src/Api/ColumnApi.d.ts +4 -1
  13. package/src/Api/EventApi.d.ts +4 -1
  14. package/src/Api/Events/RowFormSubmitted.d.ts +19 -0
  15. package/src/Api/Events/RowFormSubmitted.js +2 -0
  16. package/src/Api/FinanceApi.d.ts +3 -2
  17. package/src/Api/FormatColumnApi.d.ts +28 -1
  18. package/src/Api/GridApi.d.ts +14 -0
  19. package/src/Api/Implementation/ColumnApiImpl.js +4 -1
  20. package/src/Api/Implementation/FilterApiImpl.js +2 -7
  21. package/src/Api/Implementation/FormatColumnApiImpl.d.ts +6 -0
  22. package/src/Api/Implementation/FormatColumnApiImpl.js +34 -0
  23. package/src/Api/Implementation/GridApiImpl.d.ts +3 -0
  24. package/src/Api/Implementation/GridApiImpl.js +40 -0
  25. package/src/Api/Implementation/InternalApiImpl.d.ts +4 -0
  26. package/src/Api/Implementation/InternalApiImpl.js +37 -7
  27. package/src/Api/Implementation/SmartEditApiImpl.d.ts +2 -1
  28. package/src/Api/Implementation/SmartEditApiImpl.js +3 -0
  29. package/src/Api/Implementation/UserInterfaceApiImpl.js +3 -21
  30. package/src/Api/InternalApi.d.ts +4 -1
  31. package/src/Api/SmartEditApi.d.ts +6 -1
  32. package/src/PredefinedConfig/CalculatedColumnState.d.ts +5 -0
  33. package/src/PredefinedConfig/Common/AdaptableForm.d.ts +3 -2
  34. package/src/PredefinedConfig/Common/AdaptableFormat.d.ts +6 -3
  35. package/src/PredefinedConfig/Common/AdaptableObject.d.ts +2 -11
  36. package/src/PredefinedConfig/Common/AdaptablePredicate.js +17 -1
  37. package/src/PredefinedConfig/Common/BaseContext.d.ts +1 -1
  38. package/src/PredefinedConfig/Common/FDC3Context.d.ts +5 -1
  39. package/src/PredefinedConfig/SystemState.d.ts +1 -2
  40. package/src/Redux/ActionsReducers/SystemRedux.d.ts +1 -1
  41. package/src/Strategy/DashboardModule.js +3 -0
  42. package/src/Strategy/FormatColumnModule.js +1 -1
  43. package/src/Strategy/LayoutModule.js +4 -4
  44. package/src/Strategy/SmartEditModule.d.ts +1 -1
  45. package/src/Strategy/SmartEditModule.js +5 -6
  46. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +9 -0
  47. package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +2 -4
  48. package/src/Utilities/Helpers/AdaptableHelper.js +1 -0
  49. package/src/Utilities/Services/Interface/IRowEditService.d.ts +8 -0
  50. package/src/Utilities/Services/Interface/IRowEditService.js +2 -0
  51. package/src/Utilities/Services/RowEditService.d.ts +25 -0
  52. package/src/Utilities/Services/RowEditService.js +165 -0
  53. package/src/View/AdaptableView.js +8 -2
  54. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -1
  55. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +9 -2
  56. package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +1 -1
  57. package/src/View/Components/FilterForm/FilterForm.d.ts +4 -1
  58. package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +4 -1
  59. package/src/View/Components/FilterForm/ListBoxFilterForm.js +7 -7
  60. package/src/View/Components/FilterForm/QuickFilterForm.js +15 -2
  61. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +2 -0
  62. package/src/View/Components/Popups/AdaptableToaster.js +1 -0
  63. package/src/View/Components/Popups/FormPopups/FormPopups.js +2 -2
  64. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +3 -2
  65. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +51 -22
  66. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +1 -1
  67. package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +1 -1
  68. package/src/View/SmartEdit/SmartEditPopup.d.ts +1 -1
  69. package/src/View/SmartEdit/SmartEditPopup.js +1 -2
  70. package/src/View/SmartEdit/SmartEditViewPanel.d.ts +1 -1
  71. package/src/View/SmartEdit/SmartEditViewPanel.js +1 -2
  72. package/src/agGrid/ActionColumnRenderer.d.ts +6 -1
  73. package/src/agGrid/ActionColumnRenderer.js +6 -4
  74. package/src/agGrid/Adaptable.d.ts +3 -0
  75. package/src/agGrid/Adaptable.js +142 -39
  76. package/src/agGrid/rowEditIcons.d.ts +4 -0
  77. package/src/agGrid/rowEditIcons.js +9 -0
  78. package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +6 -16
  79. package/src/components/Datepicker/index.js +19 -18
  80. package/src/components/WindowModal/WindowModal.d.ts +2 -0
  81. package/src/components/WindowModal/WindowModal.js +1 -1
  82. package/src/metamodel/adaptable.metamodel.d.ts +89 -2
  83. package/src/metamodel/adaptable.metamodel.js +208 -11
  84. package/src/types.d.ts +6 -5
  85. package/version.d.ts +1 -1
  86. package/version.js +1 -1
  87. package/src/AdaptableOptions/SmartEdit.d.ts +0 -34
  88. package/src/View/Components/Forms/AdaptableForm.d.ts +0 -6
  89. package/src/View/Components/Forms/AdaptableForm.js +0 -21
@@ -27,7 +27,6 @@ class SmartEditPopupComponent extends React.Component {
27
27
  this.props.onSmartEditCheckSelectedCells();
28
28
  }
29
29
  render() {
30
- var _a, _b, _c;
31
30
  let col;
32
31
  if (this.props.PreviewInfo) {
33
32
  col = this.props.PreviewInfo.column;
@@ -43,7 +42,7 @@ class SmartEditPopupComponent extends React.Component {
43
42
  },
44
43
  };
45
44
  });
46
- const customOperations = (_c = (_b = (_a = this.props.api.internalApi.getAdaptableOptions()) === null || _a === void 0 ? void 0 : _a.editOptions) === null || _b === void 0 ? void 0 : _b.smartEdit) === null || _c === void 0 ? void 0 : _c.customOperations;
45
+ const customOperations = this.props.api.smartEditApi.getSmartEditCustomOperations();
47
46
  if (customOperations === null || customOperations === void 0 ? void 0 : customOperations.length) {
48
47
  operationMenuItems.push(...customOperations.map((operation) => {
49
48
  return {
@@ -3,7 +3,7 @@ import * as SystemRedux from '../../Redux/ActionsReducers/SystemRedux';
3
3
  import * as SmartEditRedux from '../../Redux/ActionsReducers/SmartEditRedux';
4
4
  import { PreviewInfo } from '../../Utilities/Interface/Preview';
5
5
  import * as React from 'react';
6
- import { SmartEditOperation } from '../../AdaptableOptions/SmartEdit';
6
+ import { SmartEditOperation } from '../../AdaptableOptions/EditOptions';
7
7
  export interface SmartEditViewPanelComponentProps extends ViewPanelProps {
8
8
  SmartEditValue: number | undefined;
9
9
  SmartEditOperation: SmartEditOperation | undefined;
@@ -39,7 +39,6 @@ class SmartEditViewPanelComponent extends React.Component {
39
39
  (_a = this.cleanupEvent) === null || _a === void 0 ? void 0 : _a.call(this);
40
40
  }
41
41
  render() {
42
- var _a, _b, _c;
43
42
  let statusColour = this.getStatusColour();
44
43
  let selectedColumn = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.state.SelectedColumnId)
45
44
  ? this.props.api.columnApi.getColumnFromId(this.state.SelectedColumnId)
@@ -51,7 +50,7 @@ class SmartEditViewPanelComponent extends React.Component {
51
50
  label: mathOperation,
52
51
  };
53
52
  });
54
- const customOperations = (_c = (_b = (_a = this.props.api.internalApi.getAdaptableOptions()) === null || _a === void 0 ? void 0 : _a.editOptions) === null || _b === void 0 ? void 0 : _b.smartEdit) === null || _c === void 0 ? void 0 : _c.customOperations;
53
+ const customOperations = this.props.api.smartEditApi.getSmartEditCustomOperations();
55
54
  if (customOperations === null || customOperations === void 0 ? void 0 : customOperations.length) {
56
55
  operationMenuItems.push(...customOperations.map((operation) => {
57
56
  return {
@@ -1,10 +1,15 @@
1
1
  import { ICellRendererComp, ICellRendererParams } from '@ag-grid-community/all-modules';
2
+ import { ActionColumn } from '../AdaptableOptions/UserInterfaceOptions';
3
+ interface ActionColumnCellRendererParams extends ICellRendererParams {
4
+ actionColumn?: ActionColumn;
5
+ }
2
6
  export declare class ActionColumnRenderer implements ICellRendererComp {
3
7
  private eGui;
4
8
  private eventListener;
5
- init(params: ICellRendererParams): void;
9
+ init(params: ActionColumnCellRendererParams): void;
6
10
  render(): void;
7
11
  getGui(): HTMLElement;
8
12
  refresh(params: ICellRendererParams): boolean;
9
13
  destroy(): void;
10
14
  }
15
+ export {};
@@ -11,8 +11,10 @@ class ActionColumnRenderer {
11
11
  init(params) {
12
12
  var _a;
13
13
  const adaptable = params.api.__adaptable;
14
- const actionCol = (_a = adaptable.api.userInterfaceApi
15
- .getAllActionColumn()) === null || _a === void 0 ? void 0 : _a.find((ac) => ac.columnId == params.colDef.colId);
14
+ const actionCol = params.actionColumn
15
+ ? params.actionColumn
16
+ : (_a = adaptable.api.userInterfaceApi
17
+ .getAllActionColumn()) === null || _a === void 0 ? void 0 : _a.find((ac) => ac.columnId == params.colDef.colId);
16
18
  if (actionCol && actionCol.actionColumnButton) {
17
19
  let actionButtons = Array.isArray(actionCol.actionColumnButton)
18
20
  ? actionCol.actionColumnButton
@@ -38,7 +40,7 @@ class ActionColumnRenderer {
38
40
  adaptableApi: adaptable.api,
39
41
  };
40
42
  const renderActionButtons = (buttons, adaptableApi, context) => {
41
- return (React.createElement(React.Fragment, null, buttons.map((button) => {
43
+ return (React.createElement(React.Fragment, null, buttons.map((button, index) => {
42
44
  var _a, _b;
43
45
  if (button.hidden && button.hidden(button, context)) {
44
46
  return;
@@ -63,7 +65,7 @@ class ActionColumnRenderer {
63
65
  }, 16);
64
66
  };
65
67
  const disabled = button.disabled && button.disabled(button, context);
66
- return (React.createElement(SimpleButton_1.default, { key: button.Uuid, variant: (_a = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.variant) !== null && _a !== void 0 ? _a : 'text', disabled: disabled, tooltip: buttonTooltip, tone: (_b = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.tone) !== null && _b !== void 0 ? _b : 'none', onClick: handleClick, className: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className, accessLevel: 'Full' },
68
+ return (React.createElement(SimpleButton_1.default, { key: button.Uuid, "data-name": `action-button-${index + 1}`, variant: (_a = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.variant) !== null && _a !== void 0 ? _a : 'text', disabled: disabled, tooltip: buttonTooltip, tone: (_b = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.tone) !== null && _b !== void 0 ? _b : 'none', onClick: handleClick, className: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className, accessLevel: 'Full' },
67
69
  button.icon ? React.createElement("img", Object.assign({}, iconProps)) : null,
68
70
  buttonLabel));
69
71
  })));
@@ -36,6 +36,7 @@ import { ColumnSetupInfo } from './ColumnSetupInfo';
36
36
  import { CustomSort } from '../PredefinedConfig/CustomSortState';
37
37
  import { ColumnValuesComparer } from '../AdaptableOptions/GeneralOptions';
38
38
  import { IMetamodelService } from '../Utilities/Services/Interface/IMetamodelService';
39
+ import { IRowEditService } from '../Utilities/Services/Interface/IRowEditService';
39
40
  declare type RuntimeConfig = {
40
41
  waitForAgGrid?: boolean;
41
42
  modules?: Module[];
@@ -55,6 +56,7 @@ export declare class Adaptable implements IAdaptable {
55
56
  AlertService: IAlertService;
56
57
  TeamSharingService: ITeamSharingService;
57
58
  MetamodelService: IMetamodelService;
59
+ RowEditService: IRowEditService;
58
60
  private LicenseService;
59
61
  embedColumnMenu: boolean;
60
62
  gridOptions: GridOptions;
@@ -243,6 +245,7 @@ export declare class Adaptable implements IAdaptable {
243
245
  }[];
244
246
  setupColumnValueGetter({ col }: ColumnSetupInfo): void;
245
247
  setupColumnAggFunc({ col }: ColumnSetupInfo): void;
248
+ private getColDefsForRowEditColumns;
246
249
  getColDefsForActionColumns(): ColDef[];
247
250
  updateColDefsForSpecialColumns(): void;
248
251
  private cleanupFloatingFilters_WORKAROUND;
@@ -26,7 +26,7 @@ const AdaptableHelper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/
26
26
  const FormatHelper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/FormatHelper"));
27
27
  const Helper_1 = require("../Utilities/Helpers/Helper");
28
28
  const LoggingHelper_1 = require("../Utilities/Helpers/LoggingHelper");
29
- const ObjectFactory_1 = tslib_1.__importStar(require("../Utilities/ObjectFactory"));
29
+ const ObjectFactory_1 = require("../Utilities/ObjectFactory");
30
30
  // services
31
31
  const CalculatedColumnExpressionService_1 = require("../Utilities/Services/CalculatedColumnExpressionService");
32
32
  const DataService_1 = require("../Utilities/Services/DataService");
@@ -61,6 +61,8 @@ const DateHelper_1 = require("../Utilities/Helpers/DateHelper");
61
61
  const StatusBarState_1 = require("../PredefinedConfig/StatusBarState");
62
62
  const createAgStatusPanelComponent_1 = require("./createAgStatusPanelComponent");
63
63
  const AdaptableStatusBar_1 = require("../View/StatusBar/AdaptableStatusBar");
64
+ const RowEditService_1 = require("../Utilities/Services/RowEditService");
65
+ const rowEditIcons_1 = require("./rowEditIcons");
64
66
  const tinycolor = require('tinycolor2');
65
67
  all_modules_1.ModuleRegistry.registerModules(all_modules_1.AllCommunityModules);
66
68
  const GROUP_PATH_SEPARATOR = '/';
@@ -391,6 +393,7 @@ class Adaptable {
391
393
  this.QueryLanguageService = new QueryLanguageService_1.QueryLanguageService(this.api);
392
394
  this.AlertService = new AlertService_1.AlertService(this.api);
393
395
  this.TeamSharingService = new TeamSharingService_1.TeamSharingService(this.api);
396
+ this.RowEditService = new RowEditService_1.RowEditService(this.api);
394
397
  this.MetamodelService = new MetamodelService_1.MetamodelService(this.api);
395
398
  this.forPlugins((plugin) => plugin.afterInitServices(this));
396
399
  // Set up Modules - we set up all the Modules suitable for AG Grid
@@ -1106,6 +1109,7 @@ class Adaptable {
1106
1109
  return isCellReadonly ? readonlyCellStyle.ClassName : null;
1107
1110
  }
1108
1111
  isQuickSearchActive(abColumn, params) {
1112
+ var _a;
1109
1113
  if (abColumn.isExcludedFromQuickSearch) {
1110
1114
  return false;
1111
1115
  }
@@ -1116,8 +1120,11 @@ class Adaptable {
1116
1120
  if (StringExtensions_1.StringExtensions.IsNullOrEmpty(quickSearchValue)) {
1117
1121
  return false;
1118
1122
  }
1119
- const columnFilter = ObjectFactory_1.default.CreateColumnFilter(abColumn.columnId, 'Contains', [quickSearchValue]);
1120
- return this.api.filterApi.evaluateColumnFilter(columnFilter, params.node);
1123
+ const displayValue = (_a = this.api.gridApi.getDisplayValueFromRowNode(params.node, abColumn.columnId)) !== null && _a !== void 0 ? _a : '';
1124
+ const ignoreCase = !this.api.internalApi.isTextComparisonCaseSensitive();
1125
+ const v = ignoreCase ? String(displayValue).toLocaleLowerCase() : String(displayValue);
1126
+ const i = ignoreCase ? String(quickSearchValue).toLocaleLowerCase() : String(quickSearchValue);
1127
+ return v.indexOf(i) !== -1;
1121
1128
  }
1122
1129
  getPrimaryKeyValueFromRowNode(rowNode) {
1123
1130
  var _a;
@@ -1201,6 +1208,12 @@ class Adaptable {
1201
1208
  layout = this.api.layoutApi.getCurrentLayout();
1202
1209
  }
1203
1210
  layout.Columns = layout.Columns || [];
1211
+ const rowEditActionColumn = this.getColDefsForRowEditColumns()[0];
1212
+ if (rowEditActionColumn) {
1213
+ layout.Columns.push(rowEditActionColumn.colId);
1214
+ layout.PinnedColumnsMap = layout.PinnedColumnsMap || {};
1215
+ layout.PinnedColumnsMap[rowEditActionColumn.colId] = rowEditActionColumn.pinned;
1216
+ }
1204
1217
  const layoutColumnsMap = layout.Columns.reduce((acc, colId) => {
1205
1218
  acc[colId] = true;
1206
1219
  return acc;
@@ -1240,7 +1253,7 @@ class Adaptable {
1240
1253
  let newColState = this.getSortedColumnStateForVisibleColumns(columnsToShow, columnsState);
1241
1254
  newColState = newColState
1242
1255
  .map((colState) => {
1243
- var _a, _b, _c, _d;
1256
+ var _a, _b, _c, _d, _e;
1244
1257
  const { colId } = colState;
1245
1258
  const oldColState = columnsStateMap[colId];
1246
1259
  const hide = this.api.columnApi.isAutoPivotColumn(colId)
@@ -1279,10 +1292,16 @@ class Adaptable {
1279
1292
  newColState.aggFunc =
1280
1293
  aggregationFunctionsColumnsMap[colId] === true
1281
1294
  ? // if we have true, it means - take the default aggFunc from colDef
1282
- (_d = (_c =
1295
+ (_e = (_d = (_c =
1283
1296
  // NOTE: colState gives us the current aggFunc, which can be null,
1284
1297
  // while the colDef gives us the initially configured aggFunc for that column
1285
- colState.aggFunc) !== null && _c !== void 0 ? _c : colDef === null || colDef === void 0 ? void 0 : colDef.aggFunc) !== null && _d !== void 0 ? _d : 'sum' : aggregationFunctionsColumnsMap[colId];
1298
+ colState.aggFunc) !== null && _c !== void 0 ? _c : colDef === null || colDef === void 0 ? void 0 : colDef.aggFunc) !== null && _d !== void 0 ? _d :
1299
+ // @ts-ignore available only wth ag-Grid v27.3.x
1300
+ colDef === null ||
1301
+ // @ts-ignore available only wth ag-Grid v27.3.x
1302
+ colDef === void 0 ? void 0 :
1303
+ // @ts-ignore available only wth ag-Grid v27.3.x
1304
+ colDef.defaultAggFunc) !== null && _e !== void 0 ? _e : 'sum' : aggregationFunctionsColumnsMap[colId];
1286
1305
  }
1287
1306
  if (sortModelMap[colId]) {
1288
1307
  newColState.sort = sortModelMap[colId].sort;
@@ -1807,7 +1826,7 @@ class Adaptable {
1807
1826
  const pkValue = this.getPrimaryKeyValueFromRowNode(rowNode);
1808
1827
  const rawValue = this.getRawValueFromRowNode(rowNode, columnId);
1809
1828
  const displayValue = this.getDisplayValueFromRawValue(columnId, rawValue);
1810
- const normalisedvalue = this.getNormalisedValueFromRowValue(rawValue, displayValue, abColumn);
1829
+ const normalisedvalue = this.getNormalisedValueFromRowValue(rawValue, abColumn);
1811
1830
  return {
1812
1831
  rawValue: rawValue,
1813
1832
  displayValue: displayValue,
@@ -1872,35 +1891,28 @@ class Adaptable {
1872
1891
  };
1873
1892
  return formatterFn(params);
1874
1893
  }
1875
- getNormalisedValueFromRowValue(rawValue, displayValue, column) {
1876
- // not sure if the current implementation is correct:
1877
- // the returned "normalised value" is actually the displayed value in almost all cases?!
1878
- // ex. how to read the following: if 'rawValue' is NOT a number, return normalised version of rawValue, but if rawValue IS a number, return displayedValue of it (which will almost certainly will NOT be a number)
1879
- // if (dataType === 'Number') {
1880
- // return typeof rawValue !== 'number' ? Number(rawValue) : returnValue;
1881
- // }
1882
- // anyway, it seems to work so far (as of v11.1.3), so I'm leaving it for now :)
1894
+ getNormalisedValueFromRowValue(rawValue, column) {
1883
1895
  if (!column) {
1884
1896
  return rawValue;
1885
1897
  }
1886
- const returnValue = this.isCustomRenderedColumn(column) ? rawValue : displayValue;
1887
- if (returnValue === undefined || returnValue === null) {
1898
+ // prevents from null
1899
+ if (rawValue === undefined || rawValue === null) {
1888
1900
  return rawValue;
1889
1901
  }
1890
1902
  const dataType = column.dataType;
1891
1903
  if (dataType === 'String') {
1892
- return typeof rawValue !== 'string' ? String(rawValue) : returnValue;
1904
+ return typeof rawValue !== 'string' ? String(rawValue) : rawValue;
1893
1905
  }
1894
1906
  if (dataType === 'Number') {
1895
- return typeof rawValue !== 'number' ? Number(rawValue) : returnValue;
1907
+ return typeof rawValue !== 'number' ? Number(rawValue) : rawValue;
1896
1908
  }
1897
1909
  if (dataType === 'Boolean') {
1898
- return typeof rawValue !== 'boolean' ? Boolean(rawValue) : returnValue;
1910
+ return typeof rawValue !== 'boolean' ? Boolean(rawValue) : rawValue;
1899
1911
  }
1900
1912
  if (dataType === 'Date') {
1901
1913
  return rawValue instanceof Date ? rawValue : DateHelper_1.parseDateValue(rawValue);
1902
1914
  }
1903
- return returnValue;
1915
+ return rawValue;
1904
1916
  }
1905
1917
  getRawValueFromRowNode(rowNode, columnId) {
1906
1918
  if (rowNode == null) {
@@ -2070,6 +2082,7 @@ class Adaptable {
2070
2082
  ...this.getColDefsForCalculatedColumns(),
2071
2083
  ...this.getColDefsForActionColumns(),
2072
2084
  ...this.getColDefsForFreeTextColumns(),
2085
+ ...this.getColDefsForRowEditColumns(),
2073
2086
  ];
2074
2087
  }
2075
2088
  getColDefsForFreeTextColumns() {
@@ -2137,6 +2150,87 @@ class Adaptable {
2137
2150
  });
2138
2151
  }
2139
2152
  }
2153
+ getColDefsForRowEditColumns() {
2154
+ var _a;
2155
+ if (!((_a = this.adaptableOptions.userInterfaceOptions.rowActionButtons) === null || _a === void 0 ? void 0 : _a.length)) {
2156
+ return [];
2157
+ }
2158
+ const editButtons = this.adaptableOptions.userInterfaceOptions.rowActionButtons
2159
+ .map((buttonName) => {
2160
+ if (buttonName === 'edit') {
2161
+ // we need this dirty hack until ActionColumn support for custom icons is improved
2162
+ const label = rowEditIcons_1.rowEditIcon;
2163
+ return {
2164
+ label,
2165
+ tooltip: 'Edit',
2166
+ onClick: (button, context) => {
2167
+ this.api.gridApi.openEditRowForm(context.primaryKeyValue);
2168
+ },
2169
+ };
2170
+ }
2171
+ if (buttonName === 'clone') {
2172
+ // we need this dirty hack until ActionColumn support for custom icons is improved
2173
+ const label = rowEditIcons_1.rowCloneIcon;
2174
+ return {
2175
+ label,
2176
+ tooltip: 'Clone',
2177
+ onClick: (button, context) => {
2178
+ this.api.gridApi.openCloneRowForm(context.primaryKeyValue);
2179
+ },
2180
+ };
2181
+ }
2182
+ if (buttonName === 'delete') {
2183
+ // we need this dirty hack until ActionColumn support for custom icons is improved
2184
+ const label = rowEditIcons_1.rowDeleteIcon;
2185
+ return {
2186
+ label,
2187
+ tooltip: 'Delete',
2188
+ onClick: (button, context) => {
2189
+ var _a, _b;
2190
+ const eventInfo = {
2191
+ type: 'rowDeleted',
2192
+ rowNode: context.rowNode,
2193
+ adaptableApi: context.adaptableApi,
2194
+ };
2195
+ this.api.eventApi.emit('RowFormSubmitted', eventInfo);
2196
+ (_b = (_a = this.adaptableOptions.editOptions.rowFormOptions).onFormSubmit) === null || _b === void 0 ? void 0 : _b.call(_a, eventInfo);
2197
+ },
2198
+ };
2199
+ }
2200
+ })
2201
+ .filter(Boolean);
2202
+ if (!editButtons.length) {
2203
+ return [];
2204
+ }
2205
+ const rowEditActionColumn = {
2206
+ columnId: 'adaptableRowEditButtons',
2207
+ actionColumnButton: editButtons,
2208
+ };
2209
+ return [
2210
+ {
2211
+ headerName: '',
2212
+ colId: 'adaptableRowEditButtons',
2213
+ hide: false,
2214
+ editable: false,
2215
+ width: editButtons.length * 42,
2216
+ resizable: false,
2217
+ suppressMenu: true,
2218
+ suppressMovable: true,
2219
+ filter: false,
2220
+ sortable: false,
2221
+ enableRowGroup: false,
2222
+ pinned: this.adaptableOptions.userInterfaceOptions.rowActionButtonsPosition === 'pinnedRight'
2223
+ ? 'right'
2224
+ : 'left',
2225
+ cellRenderer: ActionColumnRenderer_1.ActionColumnRenderer,
2226
+ cellRendererParams: {
2227
+ actionColumn: rowEditActionColumn,
2228
+ },
2229
+ cellClass: 'adaptableRowEditButtons',
2230
+ type: [GeneralConstants_1.AB_SPECIAL_COLUMN, 'abColDefObject'],
2231
+ },
2232
+ ];
2233
+ }
2140
2234
  getColDefsForActionColumns() {
2141
2235
  const defaultActionColumnSettings = {
2142
2236
  resizable: true,
@@ -2289,6 +2383,10 @@ class Adaptable {
2289
2383
  suppressMovable: calculatedColumnSettings.SuppressMovable,
2290
2384
  type: columnTypes,
2291
2385
  valueGetter: (params) => {
2386
+ var _a, _b;
2387
+ if ((_a = calculatedColumn.CalculatedColumnSettings) === null || _a === void 0 ? void 0 : _a.ExternallyEvaluatedExpression) {
2388
+ return (_b = params.data) === null || _b === void 0 ? void 0 : _b[calculatedColumn.ColumnId];
2389
+ }
2292
2390
  return this.CalculatedColumnExpressionService.evaluateCalculatedColumnQuery(calculatedColumn, params.node);
2293
2391
  },
2294
2392
  };
@@ -2350,7 +2448,7 @@ class Adaptable {
2350
2448
  return this.gridOptions.api.getDisplayedRowAtIndex(firstDisplayedRowIndex);
2351
2449
  }
2352
2450
  destroy(config) {
2353
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
2451
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
2354
2452
  if (this.gridOptions && this.gridOptions.api) {
2355
2453
  this.gridOptions.api.removeEventListener(all_modules_1.Events.EVENT_FIRST_DATA_RENDERED, this.listenerFirstDataRendered);
2356
2454
  this.gridOptions.api.removeEventListener(all_modules_1.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, this.listenerPivotModeChanged);
@@ -2410,27 +2508,29 @@ class Adaptable {
2410
2508
  this.adaptableStore = null;
2411
2509
  this.gridOptions = null;
2412
2510
  this.adaptableOptions = null;
2413
- (_b = this.CalculatedColumnExpressionService) === null || _b === void 0 ? void 0 : _b.destroy();
2511
+ (_c = (_b = this.CalculatedColumnExpressionService) === null || _b === void 0 ? void 0 : _b.destroy) === null || _c === void 0 ? void 0 : _c.call(_b);
2414
2512
  this.CalculatedColumnExpressionService = null;
2415
- (_c = this.DataService) === null || _c === void 0 ? void 0 : _c.destroy();
2513
+ (_e = (_d = this.DataService) === null || _d === void 0 ? void 0 : _d.destroy) === null || _e === void 0 ? void 0 : _e.call(_d);
2416
2514
  this.DataService = null;
2417
- (_d = this.EntitlementService) === null || _d === void 0 ? void 0 : _d.destroy();
2515
+ (_g = (_f = this.EntitlementService) === null || _f === void 0 ? void 0 : _f.destroy) === null || _g === void 0 ? void 0 : _g.call(_f);
2418
2516
  this.EntitlementService = null;
2419
- (_e = this.ReportService) === null || _e === void 0 ? void 0 : _e.destroy();
2517
+ (_j = (_h = this.ReportService) === null || _h === void 0 ? void 0 : _h.destroy) === null || _j === void 0 ? void 0 : _j.call(_h);
2420
2518
  this.ReportService = null;
2421
- (_f = this.ModuleService) === null || _f === void 0 ? void 0 : _f.destroy();
2519
+ (_l = (_k = this.ModuleService) === null || _k === void 0 ? void 0 : _k.destroy) === null || _l === void 0 ? void 0 : _l.call(_k);
2422
2520
  this.ModuleService = null;
2423
- (_g = this.ValidationService) === null || _g === void 0 ? void 0 : _g.destroy();
2521
+ (_o = (_m = this.ValidationService) === null || _m === void 0 ? void 0 : _m.destroy) === null || _o === void 0 ? void 0 : _o.call(_m);
2424
2522
  this.ValidationService = null;
2425
- (_h = this.QueryLanguageService) === null || _h === void 0 ? void 0 : _h.destroy();
2523
+ (_q = (_p = this.QueryLanguageService) === null || _p === void 0 ? void 0 : _p.destroy) === null || _q === void 0 ? void 0 : _q.call(_p);
2426
2524
  this.QueryLanguageService = null;
2427
- (_j = this.AlertService) === null || _j === void 0 ? void 0 : _j.destroy();
2525
+ (_s = (_r = this.AlertService) === null || _r === void 0 ? void 0 : _r.destroy) === null || _s === void 0 ? void 0 : _s.call(_r);
2428
2526
  this.AlertService = null;
2429
- (_k = this.TeamSharingService) === null || _k === void 0 ? void 0 : _k.destroy();
2527
+ (_u = (_t = this.TeamSharingService) === null || _t === void 0 ? void 0 : _t.destroy) === null || _u === void 0 ? void 0 : _u.call(_t);
2430
2528
  this.TeamSharingService = null;
2431
- (_l = this.MetamodelService) === null || _l === void 0 ? void 0 : _l.destroy();
2529
+ (_w = (_v = this.RowEditService) === null || _v === void 0 ? void 0 : _v.destroy) === null || _w === void 0 ? void 0 : _w.call(_v);
2530
+ this.RowEditService = null;
2531
+ (_y = (_x = this.MetamodelService) === null || _x === void 0 ? void 0 : _x.destroy) === null || _y === void 0 ? void 0 : _y.call(_x);
2432
2532
  this.MetamodelService = null;
2433
- (_m = this.LicenseService) === null || _m === void 0 ? void 0 : _m.destroy();
2533
+ (_0 = (_z = this.LicenseService) === null || _z === void 0 ? void 0 : _z.destroy) === null || _0 === void 0 ? void 0 : _0.call(_z);
2434
2534
  this.LicenseService = null;
2435
2535
  this.isDestroyed = true;
2436
2536
  }
@@ -2946,7 +3046,7 @@ class Adaptable {
2946
3046
  fontSize: null,
2947
3047
  borderColor: null,
2948
3048
  };
2949
- const formatColumn = this.api.formatColumnApi.getFormatColumnForColumn(abColumn);
3049
+ const formatColumn = this.api.formatColumnApi.getActiveFormatColumnForColumn(abColumn);
2950
3050
  const conditionalStyles = this.api.conditionalStyleApi.getConditionalStylesForColumn(abColumn);
2951
3051
  const quickSearchStyle = this.getQuickSearchCellStyle();
2952
3052
  const hasQuickSearchStyle = quickSearchStyle != undefined;
@@ -3013,7 +3113,7 @@ class Adaptable {
3013
3113
  const hasRichSelectCellEditor = this.isModulePresent('rich-select');
3014
3114
  this.setColDefProperty(col, 'cellEditor', () => {
3015
3115
  var _a;
3016
- const formatColumn = this.api.formatColumnApi.getFormatColumnForColumn(adaptableColumn);
3116
+ const formatColumn = this.api.formatColumnApi.getActiveFormatColumnForColumn(adaptableColumn);
3017
3117
  if (formatColumn && !(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.IsSuspended) && ((_a = formatColumn.ColumnStyle) === null || _a === void 0 ? void 0 : _a.CheckBoxStyle)) {
3018
3118
  return CheckboxRenderer_1.CheckboxEditor;
3019
3119
  }
@@ -3041,7 +3141,7 @@ class Adaptable {
3041
3141
  }
3042
3142
  setupColumnCellRenderer({ col, colId, abColumn }) {
3043
3143
  this.setColDefProperty(col, 'cellRenderer', () => {
3044
- const formatColumn = this.api.formatColumnApi.getFormatColumnForColumn(abColumn);
3144
+ const formatColumn = this.api.formatColumnApi.getActiveFormatColumnForColumn(abColumn);
3045
3145
  if (formatColumn && !(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.IsSuspended) && formatColumn.ColumnStyle) {
3046
3146
  if (formatColumn.ColumnStyle.PercentBarStyle) {
3047
3147
  return this.agGridHelper.createPercentBarRendererComp(formatColumn);
@@ -3168,21 +3268,24 @@ class Adaptable {
3168
3268
  // change the Number format - if the scope allows it
3169
3269
  if (this.api.scopeApi.isColumnInNumericScope(abColumn, formatColumn.Scope)) {
3170
3270
  const options = formatColumn.DisplayFormat.Options;
3171
- valueFormatter = (params) => FormatHelper_1.default.NumberFormatter(params.value, options);
3271
+ valueFormatter = (params) => {
3272
+ let value = params.value;
3273
+ return this.api.formatColumnApi.getNumberFormattedValue(value, options);
3274
+ };
3172
3275
  }
3173
3276
  }
3174
3277
  if (formatColumn.DisplayFormat.Formatter === 'DateFormatter') {
3175
3278
  // change the Date format - if the scope allows it
3176
3279
  if (this.api.scopeApi.isColumnInDateScope(abColumn, formatColumn.Scope)) {
3177
3280
  const options = formatColumn.DisplayFormat.Options;
3178
- valueFormatter = (params) => FormatHelper_1.default.DateFormatter(params.value, options);
3281
+ valueFormatter = (params) => this.api.formatColumnApi.getDateFormattedValue(params.value, options);
3179
3282
  }
3180
3283
  }
3181
3284
  if (formatColumn.DisplayFormat.Formatter === 'StringFormatter') {
3182
3285
  // change the Date format - if the scope allows it
3183
3286
  if (this.api.scopeApi.isColumnInStringsScope(abColumn, formatColumn.Scope)) {
3184
3287
  const options = formatColumn.DisplayFormat.Options;
3185
- valueFormatter = (params) => FormatHelper_1.default.StringFormatter(params.value, options);
3288
+ valueFormatter = (params) => this.api.formatColumnApi.getStringFormattedValue(params.value, options);
3186
3289
  }
3187
3290
  }
3188
3291
  return valueFormatter;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const rowEditIcon: JSX.Element;
3
+ export declare const rowCloneIcon: JSX.Element;
4
+ export declare const rowDeleteIcon: JSX.Element;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rowDeleteIcon = exports.rowCloneIcon = exports.rowEditIcon = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const icons_1 = require("../components/icons");
6
+ const React = tslib_1.__importStar(require("react"));
7
+ exports.rowEditIcon = React.createElement(icons_1.Icon, { name: "edit" });
8
+ exports.rowCloneIcon = React.createElement(icons_1.Icon, { name: "clone" });
9
+ exports.rowDeleteIcon = React.createElement(icons_1.Icon, { name: "delete" });
@@ -63,17 +63,7 @@ function AdaptableFormComponent({ formDef, data, onChange, onButtonClick, displa
63
63
  label: item.label,
64
64
  onClick: () => setFieldValue(field.name, item.value),
65
65
  }));
66
- return (
67
- /*
68
- <Dropdown
69
- options={field.Options || []}
70
- value={value}
71
- onChange={(value) => {
72
- setFieldValue(field.Name, value);
73
- }}
74
- ></Dropdown>
75
- */
76
- React.createElement(DropdownButton_1.default, { style: {
66
+ return (React.createElement(DropdownButton_1.default, { style: {
77
67
  width: '100%',
78
68
  whiteSpace: 'nowrap',
79
69
  overflow: 'hidden',
@@ -85,7 +75,7 @@ function AdaptableFormComponent({ formDef, data, onChange, onButtonClick, displa
85
75
  setFieldValue(field.name, event.target.checked);
86
76
  } }));
87
77
  case 'textOutput':
88
- return React.createElement(rebass_1.Box, { style: { textAlign: 'center' } }, value);
78
+ return (React.createElement(rebass_1.Box, { paddingLeft: 2, style: { textAlign: 'left' } }, value));
89
79
  default:
90
80
  return React.createElement("div", null,
91
81
  "Unknown field type: ",
@@ -95,9 +85,9 @@ function AdaptableFormComponent({ formDef, data, onChange, onButtonClick, displa
95
85
  // by default we have 2 columns: label & input
96
86
  const columns = (_b = (_a = formDef.config) === null || _a === void 0 ? void 0 : _a.columns) !== null && _b !== void 0 ? _b : [1, 2];
97
87
  return (React.createElement(React.Fragment, null,
98
- displayTitle && formDef.title && (React.createElement(rebass_1.Box, { fontSize: 5, mb: 2, style: { fontWeight: 'bold' } }, formDef.title)),
99
- formDef.description && React.createElement(rebass_1.Box, { mb: 3 }, formDef.description),
100
- React.createElement(FormLayout_1.default, { columns: columns }, (_c = formDef.fields) === null || _c === void 0 ? void 0 : _c.map((field, index) => {
88
+ displayTitle && formDef.title && (React.createElement(rebass_1.Box, { "data-name": "form-title", fontSize: 5, mb: 2, style: { fontWeight: 'bold' } }, formDef.title)),
89
+ formDef.description && (React.createElement(rebass_1.Box, { "data-name": "form-description", mb: 3 }, formDef.description)),
90
+ React.createElement(FormLayout_1.default, { "data-name": "form-content", columns: columns, style: { overflow: 'auto' }, paddingRight: 1 }, (_c = formDef.fields) === null || _c === void 0 ? void 0 : _c.map((field, index) => {
101
91
  if (Array.isArray(field)) {
102
92
  const rowFields = {};
103
93
  field.map((fieldItem, index) => {
@@ -113,7 +103,7 @@ function AdaptableFormComponent({ formDef, data, onChange, onButtonClick, displa
113
103
  renderField(field)));
114
104
  }
115
105
  })),
116
- formDef.buttons ? (React.createElement(rebass_1.Flex, { marginTop: 3, flexDirection: "row", alignItems: "center", justifyContent: "center" },
106
+ formDef.buttons ? (React.createElement(rebass_1.Flex, { "data-name": "form-buttons", marginTop: 3, flexDirection: "row", alignItems: "center", justifyContent: "center" },
117
107
  React.createElement(AdaptableFormComponentButtons, { focusFirstButton: focusFirstButton, onClick: onButtonClick, disabledButtons: disabledButtons, defaultTone: "success", formDef: formDef, api: api, context: context }))) : null));
118
108
  }
119
109
  exports.AdaptableFormComponent = AdaptableFormComponent;
@@ -86,22 +86,23 @@ exports.Datepicker = React.forwardRef((props, ref) => {
86
86
  clearValue();
87
87
  }, accessLevel: 'Full' })) : null;
88
88
  const calendarButton = (React.createElement(SimpleButton_1.default, { disabled: disabled, variant: "text", icon: "calendar", tooltip: "Date", iconSize: 20, px: 0, py: 0, onClick: () => setVisible(true) }));
89
- return (React.createElement(OverlayTrigger_1.default, { visible: visible, alignHorizontal: 'left', render: () => (React.createElement(DatepickerOverlay, { onHide: () => setVisible(false), onKeyDown: (e) => {
90
- if (e.key === 'Escape' || e.key === 'Enter') {
91
- setVisible(false, e.key);
92
- }
93
- } },
94
- React.createElement(react_day_picker_1.DayPicker, Object.assign({ fixedWeeks: true }, dayPickerProps, { showWeekNumber: showWeekNumber, showOutsideDays: showOutsideDays, mode: "single", month: isNaN(+month) ? new Date() : month, onMonthChange: setMonth, components: { Caption: Caption_1.Caption, CaptionLabel: CaptionLabel_1.CaptionLabel }, onSelect: updateValue, footer: React.createElement(rebass_1.Flex, { justifyContent: "space-between", mt: 2, flexWrap: 'wrap' }, footerButtons) })))) },
95
- React.createElement(FieldWrap_1.default, Object.assign({}, boxProps, { style: {
96
- borderRadius: style === null || style === void 0 ? void 0 : style.borderRadius,
97
- width: style === null || style === void 0 ? void 0 : style.width,
98
- maxWidth: style === null || style === void 0 ? void 0 : style.maxWidth,
99
- }, onFocus: () => {
100
- if (!visible) {
101
- setVisible(true);
102
- }
103
- } }),
104
- React.createElement(Input_1.default, { value: inputValue, placehoder: placeholder !== null && placeholder !== void 0 ? placeholder : dateProps.format, style: style, disabled: disabled, readOnly: true, ref: ref }),
105
- !!inputValue ? clearButton : null,
106
- calendarButton)));
89
+ return (React.createElement(rebass_1.Flex, null,
90
+ React.createElement(OverlayTrigger_1.default, { visible: visible, alignHorizontal: 'left', render: () => (React.createElement(DatepickerOverlay, { onHide: () => setVisible(false), onKeyDown: (e) => {
91
+ if (e.key === 'Escape' || e.key === 'Enter') {
92
+ setVisible(false, e.key);
93
+ }
94
+ } },
95
+ React.createElement(react_day_picker_1.DayPicker, Object.assign({ fixedWeeks: true }, dayPickerProps, { showWeekNumber: showWeekNumber, showOutsideDays: showOutsideDays, mode: "single", month: isNaN(+month) ? new Date() : month, onMonthChange: setMonth, components: { Caption: Caption_1.Caption, CaptionLabel: CaptionLabel_1.CaptionLabel }, onSelect: updateValue, footer: React.createElement(rebass_1.Flex, { justifyContent: "space-between", mt: 2, flexWrap: 'wrap' }, footerButtons) })))) },
96
+ React.createElement(FieldWrap_1.default, Object.assign({}, boxProps, { style: {
97
+ borderRadius: style === null || style === void 0 ? void 0 : style.borderRadius,
98
+ width: style === null || style === void 0 ? void 0 : style.width,
99
+ maxWidth: style === null || style === void 0 ? void 0 : style.maxWidth,
100
+ }, onFocus: () => {
101
+ if (!visible) {
102
+ setVisible(true);
103
+ }
104
+ } }),
105
+ React.createElement(Input_1.default, { value: inputValue, placehoder: placeholder !== null && placeholder !== void 0 ? placeholder : dateProps.format, style: style, disabled: disabled, readOnly: true, ref: ref }),
106
+ !!inputValue ? clearButton : null,
107
+ calendarButton))));
107
108
  });
@@ -10,6 +10,8 @@ export declare type WindowModalPosition = {
10
10
  export interface WindowModalProps {
11
11
  handleSelector: string;
12
12
  size: WindowModalSize;
13
+ minWidth?: number;
14
+ minHeight?: number;
13
15
  position?: WindowModalPosition;
14
16
  onChange: (settings: {
15
17
  size: {
@@ -100,7 +100,7 @@ exports.WindowModal = (props) => {
100
100
  return react_dom_1.createPortal(React.createElement("div", { style: style,
101
101
  //@ts-ignore
102
102
  ref: targetRef, onMouseDown: stacking.bringInFront },
103
- React.createElement(re_resizable_1.Resizable, { onResizeStop: handleResizeStop, onResize: handleResize, bounds: "window", defaultSize: {
103
+ React.createElement(re_resizable_1.Resizable, { minWidth: props.minWidth, minHeight: props.minHeight, onResizeStop: handleResizeStop, onResize: handleResize, bounds: "window", defaultSize: {
104
104
  width: props.size.width,
105
105
  height: props.size.height,
106
106
  } }, props.children)), portalElement);