@adaptabletools/adaptable 11.2.1 → 11.2.4-canary.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 (76) hide show
  1. package/base.css +24 -1
  2. package/bundle.cjs.js +94 -94
  3. package/index.css +28 -1
  4. package/package.json +1 -1
  5. package/publishTimestamp.d.ts +1 -1
  6. package/publishTimestamp.js +1 -1
  7. package/src/AdaptableInterfaces/IAdaptable.d.ts +3 -0
  8. package/src/AdaptableOptions/LayoutOptions.d.ts +36 -11
  9. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +0 -1
  10. package/src/Api/GridApi.d.ts +8 -1
  11. package/src/Api/Implementation/ColumnApiImpl.js +2 -1
  12. package/src/Api/Implementation/FreeTextColumnApiImpl.js +3 -3
  13. package/src/Api/Implementation/GridApiImpl.d.ts +3 -0
  14. package/src/Api/Implementation/GridApiImpl.js +3 -0
  15. package/src/Api/Implementation/InternalApiImpl.d.ts +2 -0
  16. package/src/Api/Implementation/InternalApiImpl.js +49 -28
  17. package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
  18. package/src/Api/Implementation/LayoutApiImpl.js +6 -0
  19. package/src/Api/Implementation/SystemStatusApiImpl.js +1 -1
  20. package/src/Api/Implementation/TeamSharingApiImpl.d.ts +2 -1
  21. package/src/Api/Implementation/TeamSharingApiImpl.js +11 -2
  22. package/src/Api/Implementation/ThemeApiImpl.js +1 -1
  23. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +2 -1
  24. package/src/Api/Implementation/UserInterfaceApiImpl.js +16 -4
  25. package/src/Api/InternalApi.d.ts +2 -0
  26. package/src/Api/LayoutApi.d.ts +6 -1
  27. package/src/Api/TeamSharingApi.d.ts +10 -1
  28. package/src/Api/UserInterfaceApi.d.ts +6 -1
  29. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +4 -0
  30. package/src/PredefinedConfig/Common/AdaptableObject.d.ts +5 -5
  31. package/src/Redux/ActionsReducers/TeamSharingRedux.d.ts +1 -1
  32. package/src/Redux/ActionsReducers/TeamSharingRedux.js +4 -4
  33. package/src/Strategy/DashboardModule.js +3 -0
  34. package/src/Strategy/FilterModule.d.ts +7 -0
  35. package/src/Strategy/FilterModule.js +11 -2
  36. package/src/Strategy/Interface/IModule.d.ts +5 -0
  37. package/src/Strategy/LayoutModule.js +4 -4
  38. package/src/Strategy/Utilities/getObjectTagsViewItems.js +1 -1
  39. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +4 -1
  40. package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +4 -3
  41. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +16 -36
  42. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +24 -14
  43. package/src/Utilities/Services/CalculatedColumnExpressionService.js +32 -9
  44. package/src/View/AdaptablePopover/index.d.ts +1 -0
  45. package/src/View/AdaptablePopover/index.js +2 -2
  46. package/src/View/AdaptableView.js +8 -2
  47. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -1
  48. package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.d.ts +13 -0
  49. package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +41 -0
  50. package/src/View/Components/EntityRulesEditor/index.js +2 -1
  51. package/src/View/Components/ExpressionWizard.js +2 -1
  52. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +1 -1
  53. package/src/View/Components/Popups/AdaptableToaster.js +1 -0
  54. package/src/View/Components/TagValueSelector/index.js +4 -3
  55. package/src/View/ConditionalStyle/Wizard/ConditionalStyleWizard.js +2 -2
  56. package/src/View/Export/ReportExportDropdown.js +1 -1
  57. package/src/View/Filter/ActiveFiltersPanel.d.ts +1 -13
  58. package/src/View/Filter/ActiveFiltersPanel.js +8 -31
  59. package/src/View/Filter/FilterStatusBarSubPanelPopover.js +1 -10
  60. package/src/View/Filter/FilterViewPanel.js +2 -2
  61. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +2 -2
  62. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +1 -1
  63. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -1
  64. package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +1 -1
  65. package/src/View/Schedule/Wizard/ScheduleWizard.js +4 -4
  66. package/src/agGrid/Adaptable.d.ts +3 -0
  67. package/src/agGrid/Adaptable.js +10 -2
  68. package/src/agGrid/agGridHelper.js +1 -0
  69. package/src/components/ExpressionEditor/BaseEditorInput.js +8 -1
  70. package/src/components/ExpressionEditor/index.js +54 -5
  71. package/src/metamodel/adaptable.metamodel.d.ts +32 -18
  72. package/src/metamodel/adaptable.metamodel.js +96 -25
  73. package/src/parser/src/types.d.ts +1 -1
  74. package/src/types.d.ts +3 -3
  75. package/version.d.ts +1 -1
  76. package/version.js +1 -1
@@ -12,11 +12,12 @@ exports.TagValueSelector = (props) => {
12
12
  return (_a = api.internalApi.getAvailableTags()) !== null && _a !== void 0 ? _a : [];
13
13
  };
14
14
  const { availableTags = getDefaultTags(), selectedTags = [], onChange, singleSelect } = props;
15
- return (React.createElement(ValueSelector_1.ValueSelector, { options: availableTags, value: selectedTags.map((tag) => tag.value), singleSelect: singleSelect, allowReorder: false, onChange: (selectedTagsIds, selectedTagsMap) => {
15
+ return (React.createElement(ValueSelector_1.ValueSelector, { options: availableTags, value: selectedTags.map((tag) => api.internalApi.getLabelForTag(tag)), singleSelect: singleSelect, allowReorder: false, onChange: (selectedTagsIds, selectedTagsMap) => {
16
16
  onChange(selectedTagsIds.map((id) => selectedTagsMap.get(id)));
17
- }, selectionBoxPosition: 'top', toIdentifier: (tag) => tag.value, toLabel: (tag) => tag.label, noSelectionLabel: singleSelect ? 'Select a tag' : 'You have not selected any tags.', xSelectedLabel: singleSelect ? () => 'Selected tag:' : () => 'Selected tags:' }));
17
+ }, selectionBoxPosition: 'top', toIdentifier: (tag) => api.internalApi.getLabelForTag(tag), toLabel: (tag) => api.internalApi.getLabelForTag(tag), noSelectionLabel: singleSelect ? 'Select a tag' : 'You have not selected any tags.', xSelectedLabel: singleSelect ? () => 'Selected tag:' : () => 'Selected tags:' }));
18
18
  };
19
19
  exports.TagValueOptionsTags = (props) => {
20
20
  const { tags = [] } = props;
21
- return (React.createElement(ValueSelector_1.ValueOptionsTags, { options: tags, value: tags.map((tag) => tag.value), toIdentifier: (tag) => tag.value, toLabel: (tag) => tag.label, allowWrap: true, readOnly: true }));
21
+ const { api } = AdaptableContext_1.useAdaptable();
22
+ return (React.createElement(ValueSelector_1.ValueOptionsTags, { options: tags, value: tags.map((tag) => api.internalApi.getValueForTag(tag)), toIdentifier: (tag) => api.internalApi.getValueForTag(tag), toLabel: (tag) => api.internalApi.getLabelForTag(tag), allowWrap: true, readOnly: true }));
22
23
  };
@@ -20,8 +20,8 @@ const ConditionalStyleRedux = tslib_1.__importStar(require("../../../Redux/Actio
20
20
  const ConditionalStyleSettingsWizardSettings_1 = require("./ConditionalStyleSettingsWizardSettings");
21
21
  const ObjectTagsWizardSection_1 = require("../../Wizard/ObjectTagsWizardSection");
22
22
  exports.ConditionalStyleWizard = (props) => {
23
- var _a;
24
- const data = (_a = props.data) !== null && _a !== void 0 ? _a : props.popupParams.value;
23
+ var _a, _b;
24
+ const data = (_a = props.data) !== null && _a !== void 0 ? _a : (_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.value;
25
25
  const [conditionalStyle, setConditionalStyle] = react_1.useState(() => {
26
26
  var _a, _b, _c;
27
27
  const DEFAULT_RULE = {
@@ -32,6 +32,6 @@ exports.ReportExportDropdown = (props) => {
32
32
  if ((report === null || report === void 0 ? void 0 : report.Name) === GeneralConstants_1.VISUAL_DATA_REPORT) {
33
33
  destinationItems.forEach((item) => (item.disabled = item.label === Enums_1.ExportDestination.Excel ? false : true));
34
34
  }
35
- return (React.createElement(DropdownButton_1.default, { tooltip: "Export Report", variant: "text", items: destinationItems },
35
+ return (React.createElement(DropdownButton_1.default, { columns: ['label'], tooltip: "Export Report", variant: "text", items: destinationItems },
36
36
  React.createElement(icons_1.Icon, { name: "export" })));
37
37
  };
@@ -1,14 +1,2 @@
1
1
  import * as React from 'react';
2
- import { AdaptableApi } from '../../Api/AdaptableApi';
3
- import { ColumnFilter } from '../../PredefinedConfig/FilterState';
4
- import { AccessLevel } from '../../PredefinedConfig/Common/Entitlement';
5
- export interface ActiveFiltersPanelProps extends React.ClassAttributes<ActiveFiltersPanel> {
6
- columnFilters: ColumnFilter[];
7
- api: AdaptableApi;
8
- accessLevel: AccessLevel;
9
- onClear: (columnFilter: ColumnFilter) => void;
10
- }
11
- export declare class ActiveFiltersPanel extends React.Component<ActiveFiltersPanelProps, {}> {
12
- render(): any;
13
- private createRow;
14
- }
2
+ export declare const ActiveFiltersPanel: React.FunctionComponent;
@@ -3,35 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActiveFiltersPanel = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
- const ButtonClear_1 = require("../Components/Buttons/ButtonClear");
7
- const Helper_1 = require("../../Utilities/Helpers/Helper");
8
- const AdaptableObjectRow_1 = require("../Components/AdaptableObjectRow");
9
- const PanelWithRow_1 = require("../Components/Panels/PanelWithRow");
10
- const rebass_1 = require("rebass");
11
- const stopPropagation = (e) => {
12
- e.stopPropagation();
6
+ const AdaptableContext_1 = require("../AdaptableContext");
7
+ const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
8
+ const AdaptableObjectCompactList_1 = require("../Components/AdaptableObjectList/AdaptableObjectCompactList");
9
+ exports.ActiveFiltersPanel = () => {
10
+ const adaptable = AdaptableContext_1.useAdaptable();
11
+ const filterModule = adaptable.ModuleService.getModuleById(ModuleConstants.FilterModuleId);
12
+ const columnFilters = adaptable.api.filterApi.getAllColumnFilter();
13
+ return React.createElement(AdaptableObjectCompactList_1.AdaptableObjectCompactList, { abObjects: columnFilters, module: filterModule });
13
14
  };
14
- class ActiveFiltersPanel extends React.Component {
15
- render() {
16
- let colItems = [
17
- { Content: 'Column Filter', Size: 9 },
18
- { Content: '', Size: 3 },
19
- ];
20
- let rowElements = [];
21
- this.props.columnFilters.forEach((columnFilter) => {
22
- rowElements.push(this.createRow(colItems, columnFilter));
23
- });
24
- return (React.createElement("div", null,
25
- React.createElement(PanelWithRow_1.PanelWithRow, { colItems: colItems }),
26
- React.createElement("div", null, rowElements)));
27
- }
28
- createRow(colItems, columnFilter) {
29
- let rowColItems = Helper_1.Helper.cloneObject(colItems);
30
- rowColItems[0].Content = this.props.api.filterApi.columnFilterToString(columnFilter);
31
- rowColItems[1].Content = (React.createElement(rebass_1.Flex, { justifyContent: "center", margin: 0, padding: 0, onClick: stopPropagation },
32
- React.createElement(ButtonClear_1.ButtonClear, { onClick: () => this.props.onClear(columnFilter), tooltip: "Clear Filter", disabled: columnFilter == null, accessLevel: this.props.accessLevel })));
33
- let rowElement = React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { key: columnFilter.ColumnId, colItems: rowColItems });
34
- return rowElement;
35
- }
36
- }
37
- exports.ActiveFiltersPanel = ActiveFiltersPanel;
@@ -3,16 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FilterStatusBarSubPanelPopover = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
- const react_redux_1 = require("react-redux");
7
- const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
8
- const AdaptableContext_1 = require("../AdaptableContext");
9
6
  const ActiveFiltersPanel_1 = require("./ActiveFiltersPanel");
10
7
  exports.FilterStatusBarSubPanelPopover = () => {
11
- const adaptable = AdaptableContext_1.useAdaptable();
12
- const columnFilters = react_redux_1.useSelector((state) => state.Filter.ColumnFilters);
13
- const accessLevel = adaptable.api.internalApi
14
- .getEntitlementService()
15
- .getEntitlementAccessLevelForModule(ModuleConstants.FilterModuleId);
16
- const handleClear = React.useCallback((columnFilter) => adaptable.api.filterApi.clearColumnFilterByColumn(columnFilter.ColumnId), []);
17
- return (React.createElement(ActiveFiltersPanel_1.ActiveFiltersPanel, { columnFilters: columnFilters, api: adaptable.api, accessLevel: accessLevel, onClear: handleClear }));
8
+ return React.createElement(ActiveFiltersPanel_1.ActiveFiltersPanel, null);
18
9
  };
@@ -16,11 +16,11 @@ class FilterViewPanelComponent extends React.Component {
16
16
  super(props);
17
17
  }
18
18
  render() {
19
- const activeFiltersPanel = (React.createElement(ActiveFiltersPanel_1.ActiveFiltersPanel, { columnFilters: this.props.ColumnFilters, api: this.props.api, accessLevel: this.props.accessLevel, onClear: (columnFilter) => this.onClearColumnFilter(columnFilter) }));
19
+ const activeFiltersPanel = React.createElement(ActiveFiltersPanel_1.ActiveFiltersPanel, null);
20
20
  const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
21
21
  return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: `ab-${elementType}__Filter__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
22
22
  React.createElement(rebass_1.Flex, null, ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(this.props.ColumnFilters) && (React.createElement(React.Fragment, null,
23
- React.createElement(AdaptablePopover_1.AdaptablePopover, { className: `ab-${elementType}__Filter__info`, headerText: "", bodyText: [activeFiltersPanel],
23
+ React.createElement(AdaptablePopover_1.AdaptablePopover, { popupPadding: 0, className: `ab-${elementType}__Filter__info`, headerText: "", bodyText: [activeFiltersPanel],
24
24
  // tooltipText={'Show Filter Details'}
25
25
  useButton: true, showEvent: 'focus', hideEvent: "blur", popoverMinWidth: 400 }),
26
26
  React.createElement(ButtonClear_1.ButtonClear, { marginLeft: 1, marginBottom: 0, marginRight: 1, className: `ab-${elementType}__Filter__clear`, onClick: () => this.onClearFilters(), tooltip: "Clear Filters", disabled: this.props.ColumnFilters.length == 0, showText: this.props.viewType === 'ToolPanel' }, this.props.viewType === 'ToolPanel' && 'Clear')))),
@@ -72,9 +72,9 @@ const adjustFormatColumn = (formatColumn, api) => {
72
72
  return formatColumn;
73
73
  };
74
74
  function FormatColumnWizard(props) {
75
- var _a;
75
+ var _a, _b;
76
76
  const { api } = AdaptableContext_1.useAdaptable();
77
- const data = (_a = props.data) !== null && _a !== void 0 ? _a : props.popupParams.value;
77
+ const data = (_a = props.data) !== null && _a !== void 0 ? _a : (_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.value;
78
78
  const [formatColumn, doSetFormatColumn] = react_1.useState(() => {
79
79
  var _a, _b, _c, _d;
80
80
  let formatColumn = data ? Helper_1.cloneObject(data) : ObjectFactory_1.default.CreateEmptyFormatColumn();
@@ -2,7 +2,7 @@
2
2
  import { FreeTextColumn } from '../../../PredefinedConfig/FreeTextColumnState';
3
3
  import { AdaptableApi } from '../../../Api/AdaptableApi';
4
4
  export declare const renderFreeTextColumnSummary: (data: FreeTextColumn) => JSX.Element;
5
- export declare const isValidFreeTextColumn: (data: FreeTextColumn, api: AdaptableApi) => true | "Column id cannot be empty" | "No data type specified for column" | "A Column already exists with that id";
5
+ export declare const isValidFreeTextColumn: (data: FreeTextColumn, api: AdaptableApi) => true | "Column Id cannot be empty" | "No data type specified for column" | "A Column already exists with that id";
6
6
  export declare type FreeTextColumnSettingsWizardSectionProps = {
7
7
  onChange: (data: FreeTextColumn) => void;
8
8
  isEdit: boolean;
@@ -46,7 +46,7 @@ exports.renderFreeTextColumnSummary = (data) => {
46
46
  exports.isValidFreeTextColumn = (data, api) => {
47
47
  const columns = api.columnApi.getColumns();
48
48
  if (!data.ColumnId) {
49
- return 'Column id cannot be empty';
49
+ return 'Column Id cannot be empty';
50
50
  }
51
51
  const columnsWithSameIdCount = columns.filter((c) => c.columnId === data.ColumnId).length;
52
52
  const hasAlreadyExistingId = data.Uuid ? columnsWithSameIdCount > 1 : columnsWithSameIdCount > 0;
@@ -43,7 +43,7 @@ export declare class LayoutEditorWizard extends React.Component<LayoutEditorWiza
43
43
  Uuid?: string;
44
44
  Source?: "Config" | "User";
45
45
  IsReadOnly?: boolean;
46
- Tags?: import("../../../PredefinedConfig/Common/AdaptableObject").AdaptableObjectTag[];
46
+ Tags?: import("../../../types").AdaptableObjectTag[];
47
47
  };
48
48
  canNext(): boolean;
49
49
  canBack(): boolean;
@@ -14,10 +14,10 @@ const react_redux_1 = require("react-redux");
14
14
  const ScheduleRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/ScheduleRedux"));
15
15
  const ObjectTagsWizardSection_1 = require("../../Wizard/ObjectTagsWizardSection");
16
16
  exports.ScheduleWizard = (props) => {
17
- var _a, _b, _c;
18
- const data = (_a = props.data) !== null && _a !== void 0 ? _a : props.popupParams.value;
19
- const isNew = ((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.action) ? props.popupParams.action === 'New' : !props.data;
20
- const scheduleType = data ? data.ScheduleType : (_c = props === null || props === void 0 ? void 0 : props.abObjectType) === null || _c === void 0 ? void 0 : _c.name;
17
+ var _a, _b, _c, _d;
18
+ const data = (_a = props.data) !== null && _a !== void 0 ? _a : (_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.value;
19
+ const isNew = ((_c = props.popupParams) === null || _c === void 0 ? void 0 : _c.action) ? props.popupParams.action === 'New' : !props.data;
20
+ const scheduleType = data ? data.ScheduleType : (_d = props === null || props === void 0 ? void 0 : props.abObjectType) === null || _d === void 0 ? void 0 : _d.name;
21
21
  const [schedule, setSchedule] = React.useState(() => {
22
22
  if (data) {
23
23
  return data;
@@ -195,6 +195,9 @@ export declare class Adaptable implements IAdaptable {
195
195
  forAllRowNodesDo(func: (rowNode: RowNode) => void): void;
196
196
  forAllVisibleRowNodesDo(func: (rowNode: RowNode, rowIndex: number) => void): void;
197
197
  getVisibleRowNodes(): RowNode[];
198
+ getAllRowNodes(config?: {
199
+ includeGroupRows?: boolean;
200
+ }): RowNode[];
198
201
  getRowsInViewport(): RowNode[];
199
202
  selectNodes(rowNodes: RowNode[], clearSelection: boolean): void;
200
203
  deSelectNodes(rowNodes: RowNode[], clearSelection: boolean): void;
@@ -114,7 +114,6 @@ RowNodeProto.dispatchLocalEvent = function (event) {
114
114
  //@ts-ignore
115
115
  const fn = adaptable.rowListeners ? adaptable.rowListeners[event.type] : null;
116
116
  if (fn) {
117
- console.log('fire event', event);
118
117
  fn(event);
119
118
  }
120
119
  });
@@ -1951,7 +1950,7 @@ class Adaptable {
1951
1950
  return rowNodes;
1952
1951
  }
1953
1952
  forAllRowNodesDo(func) {
1954
- this.gridOptions.api.getModel().forEachNode((rowNode) => {
1953
+ this.gridOptions.api.forEachNode((rowNode) => {
1955
1954
  func(rowNode);
1956
1955
  });
1957
1956
  }
@@ -1967,6 +1966,15 @@ class Adaptable {
1967
1966
  });
1968
1967
  return rowNodes;
1969
1968
  }
1969
+ getAllRowNodes(config) {
1970
+ let rowNodes = [];
1971
+ this.gridOptions.api.forEachNode((rowNode, rowIndex) => {
1972
+ if (!this.isGroupRowNode(rowNode) || (config === null || config === void 0 ? void 0 : config.includeGroupRows)) {
1973
+ rowNodes.push(rowNode);
1974
+ }
1975
+ });
1976
+ return rowNodes;
1977
+ }
1970
1978
  getRowsInViewport() {
1971
1979
  return this.gridOptions.api.getRenderedNodes();
1972
1980
  }
@@ -165,6 +165,7 @@ class agGridHelper {
165
165
  const abColumn = {
166
166
  Uuid: Uuid_1.createUuid(),
167
167
  columnId: ColumnId,
168
+ field: colDef.field,
168
169
  friendlyName: FriendlyName,
169
170
  isPrimaryKey: ColumnId === pkColumn,
170
171
  dataType: this.getColumnDataType(agGridColumn, false),
@@ -38,12 +38,19 @@ function BaseEditorInput(props) {
38
38
  React.createElement("i", null, " (click for more details)")),
39
39
  React.createElement(rebass_1.Text, { marginLeft: 3, style: { fontStyle: 'italic' } }, parserExceptionDetails)));
40
40
  };
41
+ const testRowNode = react_1.useMemo(() => {
42
+ const firstRowNode = props.api.gridApi.getFirstRowNode();
43
+ // clone the class instance to still keep the prototype methods
44
+ return Object.assign(Object.create(Object.getPrototypeOf(firstRowNode)), firstRowNode);
45
+ }, []);
41
46
  try {
42
47
  // explicitly parsing & evaluating the expression because we need full control of the resulted AST
43
48
  const expr = parser.parse(props.value || '');
44
49
  try {
50
+ testRowNode.data = testData;
45
51
  result = expr.evaluate({
46
- node: { data: testData },
52
+ // we need a fully-fledged rowNode as Adaptable accesses internal methods of it
53
+ node: testRowNode,
47
54
  api: props.api,
48
55
  functions: expressionFunctions,
49
56
  });
@@ -48,6 +48,57 @@ function ExpressionEditor(props) {
48
48
  const queryableColumns = type === 'scalar' || type === 'boolean'
49
49
  ? props.columns
50
50
  : props.columns.filter((c) => !props.api.columnApi.isCalculatedColumn(c.columnId));
51
+ // borrowed from https://github.com/ag-grid/ag-grid/blob/v27.2.1/community-modules/core/src/ts/utils/object.ts#L205
52
+ const getColValue = (column) => {
53
+ var _a, _b;
54
+ const columnValueKey = (_a = column.field) !== null && _a !== void 0 ? _a : column.columnId;
55
+ const isColumnValueContainsDots = (_b = column.field) === null || _b === void 0 ? void 0 : _b.includes('.');
56
+ // if no '.', then it's not a deep value
57
+ if (!isColumnValueContainsDots) {
58
+ return data[columnValueKey];
59
+ }
60
+ // otherwise it is a deep value, so need to dig for it
61
+ const fields = columnValueKey.split('.');
62
+ let currentObject = data;
63
+ for (let i = 0; i < fields.length; i++) {
64
+ if (currentObject == null) {
65
+ return undefined;
66
+ }
67
+ currentObject = currentObject[fields[i]];
68
+ }
69
+ return currentObject;
70
+ };
71
+ // borrowed from https://github.com/ag-grid/ag-grid/blob/v27.2.1/community-modules/core/src/ts/valueService/valueService.ts#L217
72
+ const updateColValue = (rowData, column, newValue) => {
73
+ var _a, _b;
74
+ const columnValueKey = (_a = column.field) !== null && _a !== void 0 ? _a : column.columnId;
75
+ const isColumnValueContainsDots = (_b = column.field) === null || _b === void 0 ? void 0 : _b.includes('.');
76
+ // if no '.', then it's not a deep value
77
+ if (!isColumnValueContainsDots) {
78
+ rowData[columnValueKey] = newValue;
79
+ }
80
+ else {
81
+ // otherwise it is a deep value, so need to dig for it
82
+ const fieldPieces = columnValueKey.split('.');
83
+ let currentObject = rowData;
84
+ while (fieldPieces.length > 0 && currentObject) {
85
+ const fieldPiece = fieldPieces.shift();
86
+ if (fieldPieces.length === 0) {
87
+ currentObject[fieldPiece] = newValue;
88
+ }
89
+ else {
90
+ currentObject = currentObject[fieldPiece];
91
+ }
92
+ }
93
+ }
94
+ return Object.assign({}, rowData);
95
+ };
96
+ const getColDateValue = (column) => {
97
+ const colValue = getColValue(column);
98
+ return colValue && DateHelper_1.isValueValidDate(colValue)
99
+ ? new Date(colValue).toISOString().substr(0, 10)
100
+ : '';
101
+ };
51
102
  const dataTableEditor = (React.createElement(React.Fragment, null,
52
103
  React.createElement(rebass_1.Flex, { flexDirection: "column", alignItems: "start", style: { marginTop: 2 } },
53
104
  React.createElement(CheckBox_1.CheckBox, { checked: showColumnIds, onChange: (checked) => setShowColumnIds(checked), style: {
@@ -61,11 +112,9 @@ function ExpressionEditor(props) {
61
112
  cursor: 'grab',
62
113
  marginRight: 'var(--ab-space-1)',
63
114
  }, data: `[${column.columnId}]`, "data-name": "column", icon: "drag" },
64
- React.createElement(rebass_1.Flex, { flexDirection: "column", alignItems: "start" }, showColumnIds ? `[${column.columnId}]` : column.friendlyName)) }, column.dataType === 'Number' ? (React.createElement(Input_1.default, { type: "number", "data-name": "column-input", value: data[column.columnId], onChange: (e) => setData(Object.assign(Object.assign({}, data), { [column.columnId]: Number(e.target.value) })), width: "100%", disabled: column.readOnly })) : column.dataType === 'String' ? (React.createElement(Input_1.default, { type: "text", "data-name": "column-input", value: data[column.columnId], onChange: (e) => setData(Object.assign(Object.assign({}, data), { [column.columnId]: e.target.value })), width: "100%", disabled: column.readOnly })) : column.dataType === 'Date' ? (React.createElement(AdaptableInput_1.default, { type: "date", "data-name": "column-input", value: data[column.columnId] && DateHelper_1.isValueValidDate(data[column.columnId])
65
- ? new Date(data[column.columnId]).toISOString().substr(0, 10)
66
- : '', onChange: (e) => {
67
- setData(Object.assign(Object.assign({}, data), { [column.columnId]: new Date(e.target.value) }));
68
- }, style: { width: '100%' }, disabled: column.readOnly })) : column.dataType === 'Boolean' ? (React.createElement(CheckBox_1.CheckBox, { "data-name": "column-input", checked: data[column.columnId], onChange: (checked) => setData(Object.assign(Object.assign({}, data), { [column.columnId]: checked })), disabled: column.readOnly })) : null))))));
115
+ React.createElement(rebass_1.Flex, { flexDirection: "column", alignItems: "start" }, showColumnIds ? `[${column.columnId}]` : column.friendlyName)) }, column.dataType === 'Number' ? (React.createElement(Input_1.default, { type: "number", "data-name": "column-input", value: getColValue(column), onChange: (e) => setData(updateColValue(data, column, Number(e.target.value))), width: "100%", disabled: column.readOnly })) : column.dataType === 'String' ? (React.createElement(Input_1.default, { type: "text", "data-name": "column-input", value: getColValue(column), onChange: (e) => setData(updateColValue(data, column, e.target.value)), width: "100%", disabled: column.readOnly })) : column.dataType === 'Date' ? (React.createElement(AdaptableInput_1.default, { type: "date", "data-name": "column-input", value: getColDateValue(column), onChange: (e) => {
116
+ setData(updateColValue(data, column, new Date(e.target.value)));
117
+ }, style: { width: '100%' }, disabled: column.readOnly })) : column.dataType === 'Boolean' ? (React.createElement(CheckBox_1.CheckBox, { "data-name": "column-input", checked: getColValue(column), onChange: (checked) => setData(updateColValue(data, column, checked)), disabled: column.readOnly })) : null))))));
69
118
  const namedQueries = (React.createElement("div", null, props.namedQueries.map((namedQuery) => (React.createElement(rebass_1.Flex, { key: namedQuery.Uuid, flexDirection: "column", alignItems: "start", style: {
70
119
  padding: 3,
71
120
  marginTop: 'var(--ab-space-2)',
@@ -385,6 +385,11 @@ export declare const ADAPTABLE_METAMODEL: {
385
385
  reference: string;
386
386
  })[];
387
387
  };
388
+ AdaptableObjectTag: {
389
+ name: string;
390
+ kind: string;
391
+ description: string;
392
+ };
388
393
  AdaptableOptions: {
389
394
  name: string;
390
395
  kind: string;
@@ -897,6 +902,17 @@ export declare const ADAPTABLE_METAMODEL: {
897
902
  isOptional: boolean;
898
903
  }[];
899
904
  };
905
+ AutoGenerateTagsForLayoutsContext: {
906
+ name: string;
907
+ kind: string;
908
+ description: string;
909
+ properties: {
910
+ name: string;
911
+ kind: string;
912
+ description: string;
913
+ uiLabel: string;
914
+ }[];
915
+ };
900
916
  BaseContext: {
901
917
  name: string;
902
918
  kind: string;
@@ -2037,8 +2053,8 @@ export declare const ADAPTABLE_METAMODEL: {
2037
2053
  kind: string;
2038
2054
  description: string;
2039
2055
  uiLabel: string;
2040
- isOptional: boolean;
2041
2056
  reference: string;
2057
+ isOptional?: undefined;
2042
2058
  } | {
2043
2059
  name: string;
2044
2060
  kind: string;
@@ -2051,15 +2067,15 @@ export declare const ADAPTABLE_METAMODEL: {
2051
2067
  kind: string;
2052
2068
  description: string;
2053
2069
  uiLabel: string;
2054
- reference: string;
2070
+ reference?: undefined;
2055
2071
  isOptional?: undefined;
2056
2072
  } | {
2057
2073
  name: string;
2058
2074
  kind: string;
2059
2075
  description: string;
2060
2076
  uiLabel: string;
2061
- isOptional?: undefined;
2062
- reference?: undefined;
2077
+ isOptional: boolean;
2078
+ reference: string;
2063
2079
  })[];
2064
2080
  };
2065
2081
  ExpressionFunction: {
@@ -2845,11 +2861,6 @@ export declare const ADAPTABLE_METAMODEL: {
2845
2861
  kind: string;
2846
2862
  description: string;
2847
2863
  };
2848
- IsObjectAvailableInLayoutContext: {
2849
- name: string;
2850
- kind: string;
2851
- description: string;
2852
- };
2853
2864
  Layout: {
2854
2865
  name: string;
2855
2866
  kind: string;
@@ -2884,6 +2895,18 @@ export declare const ADAPTABLE_METAMODEL: {
2884
2895
  kind: string;
2885
2896
  description: string;
2886
2897
  };
2898
+ LayoutAvailableContext: {
2899
+ name: string;
2900
+ kind: string;
2901
+ description: string;
2902
+ properties: {
2903
+ name: string;
2904
+ kind: string;
2905
+ description: string;
2906
+ uiLabel: string;
2907
+ reference: string;
2908
+ }[];
2909
+ };
2887
2910
  LayoutChangedInfo: {
2888
2911
  name: string;
2889
2912
  kind: string;
@@ -2907,15 +2930,6 @@ export declare const ADAPTABLE_METAMODEL: {
2907
2930
  kind: string;
2908
2931
  description: string;
2909
2932
  properties: ({
2910
- name: string;
2911
- kind: string;
2912
- description: string;
2913
- uiLabel: string;
2914
- isOptional: boolean;
2915
- gridInfo?: undefined;
2916
- defaultValue?: undefined;
2917
- reference?: undefined;
2918
- } | {
2919
2933
  name: string;
2920
2934
  kind: string;
2921
2935
  description: string;