@adaptabletools/adaptable 12.1.8-canary.0 → 12.2.0-canary.1

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 (93) hide show
  1. package/base.css +116 -22
  2. package/bundle.cjs.js +108 -108
  3. package/index.css +132 -23
  4. package/package.json +1 -1
  5. package/publishTimestamp.d.ts +1 -1
  6. package/publishTimestamp.js +1 -1
  7. package/src/AdaptableOptions/AdaptableQLOptions.d.ts +44 -10
  8. package/src/AdaptableOptions/FinancePluginOptions.d.ts +5 -11
  9. package/src/AdaptableOptions/GeneralOptions.d.ts +19 -1
  10. package/src/AdaptableOptions/StateOptions.d.ts +1 -1
  11. package/src/Api/Implementation/AlertApiImpl.js +1 -2
  12. package/src/Api/Implementation/CellSummaryApiImpl.d.ts +5 -0
  13. package/src/Api/Implementation/CellSummaryApiImpl.js +23 -1
  14. package/src/Api/Implementation/InternalApiImpl.d.ts +3 -1
  15. package/src/Api/Implementation/InternalApiImpl.js +34 -0
  16. package/src/Api/Implementation/LayoutApiImpl.js +2 -2
  17. package/src/Api/Implementation/QueryLanguageApiImpl.d.ts +1 -0
  18. package/src/Api/Implementation/QueryLanguageApiImpl.js +5 -0
  19. package/src/Api/InternalApi.d.ts +6 -1
  20. package/src/Api/QueryLanguageApi.d.ts +5 -0
  21. package/src/Strategy/BulkUpdateModule.d.ts +1 -1
  22. package/src/Strategy/CalculatedColumnModule.js +1 -1
  23. package/src/Strategy/QueryModule.js +1 -1
  24. package/src/Strategy/Utilities/Export/getExportRowsViewItems.js +0 -13
  25. package/src/Strategy/Utilities/getExpressionViewItems.d.ts +3 -4
  26. package/src/Strategy/Utilities/getExpressionViewItems.js +3 -3
  27. package/src/Strategy/Utilities/getRuleViewItems.js +1 -1
  28. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +2 -0
  29. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +1 -1
  30. package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +2 -0
  31. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -1
  32. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +14 -0
  33. package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +2 -0
  34. package/src/Utilities/Services/QueryLanguageService.d.ts +2 -1
  35. package/src/Utilities/Services/QueryLanguageService.js +45 -19
  36. package/src/Utilities/Services/ReportService.js +1 -2
  37. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.d.ts +1 -1
  38. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.js +10 -10
  39. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/Components/FormBox.d.ts +3 -0
  40. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/Components/FormBox.js +9 -0
  41. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +13 -15
  42. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.d.ts +1 -1
  43. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.js +2 -2
  44. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.d.ts +7 -0
  45. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.js +280 -0
  46. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/index.d.ts +1 -0
  47. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/index.js +5 -0
  48. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.d.ts +1 -1
  49. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.js +4 -4
  50. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +2 -8
  51. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.d.ts +1 -1
  52. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.js +3 -3
  53. package/src/View/AdaptableWizardView/Wizard.js +2 -2
  54. package/src/View/CalculatedColumn/CalculatedColumnSummary.d.ts +0 -1
  55. package/src/View/CalculatedColumn/CalculatedColumnSummary.js +1 -8
  56. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +6 -5
  57. package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
  58. package/src/View/Components/AdaptableObjectCollection/index.d.ts +3 -4
  59. package/src/View/Components/AdaptableObjectCollection/index.js +7 -8
  60. package/src/View/Components/AdaptableObjectRow/index.js +1 -4
  61. package/src/View/Components/EntityRulesEditor/index.js +3 -3
  62. package/src/View/Components/FilterForm/QuickFilterForm.js +9 -1
  63. package/src/View/Components/Popups/AdaptablePopup/PopupPanel.d.ts +1 -0
  64. package/src/View/Components/Popups/AdaptablePopup/PopupPanel.js +2 -1
  65. package/src/View/Components/ValueSelector/index.js +8 -19
  66. package/src/View/CustomSort/CustomSortSummary.js +1 -1
  67. package/src/View/Dashboard/DashboardPopup.js +11 -10
  68. package/src/View/Export/ExportViewPanel.js +2 -2
  69. package/src/View/Export/Wizard/ReportRowsWizardSection.js +4 -3
  70. package/src/View/Filter/FilterViewPanel.js +3 -2
  71. package/src/View/GridInfo/AdaptableObjectsSummary.js +5 -3
  72. package/src/View/GridInfo/AdaptableOptionsComponent.js +1 -1
  73. package/src/View/GridInfo/GridInfoPopup.js +6 -7
  74. package/src/View/Query/Wizard/NamedQueryExpressionWizardSection.js +3 -4
  75. package/src/View/StateManagement/StateManagementPopup.js +18 -19
  76. package/src/agGrid/Adaptable.d.ts +2 -0
  77. package/src/agGrid/Adaptable.js +78 -30
  78. package/src/agGrid/weightedAverage.d.ts +2 -0
  79. package/src/agGrid/weightedAverage.js +52 -1
  80. package/src/bundle-dependencies/bundles/react-toastify/index.js +1 -1
  81. package/src/components/DragAndDropContext/ModuleManager.js +3 -4
  82. package/src/components/DragAndDropContext/TabList.js +9 -30
  83. package/src/components/DragAndDropContext/UnusedPanel.js +1 -7
  84. package/src/components/DropdownButton/index.js +2 -2
  85. package/src/components/EmptyContent/index.js +2 -2
  86. package/src/components/ExpressionEditor/BaseEditorInput.js +1 -0
  87. package/src/components/ExpressionEditor/index.js +24 -14
  88. package/src/metamodel/adaptable.metamodel.d.ts +34 -10
  89. package/src/metamodel/adaptable.metamodel.js +1 -1
  90. package/src/parser/src/types.d.ts +14 -10
  91. package/src/types.d.ts +1 -1
  92. package/version.d.ts +1 -1
  93. package/version.js +1 -1
@@ -42,6 +42,7 @@ function ValueSelector(props) {
42
42
  var _a;
43
43
  const { options, value, filter, onChange, allowReorder, singleSelect, toLabel, toListLabel, toIdentifier, noSelectionLabel, clearSelectionLabel, showSelectedOnlyLabel, showFilterInput, xSelectedLabel, selectionBoxPosition = 'bottom', onShowSelectedOnlyChange, isOptionDisabled, disabled, } = props;
44
44
  const [searchInputValue, setSearchInputValue] = React.useState('');
45
+ const baseClassName = 'ab-ValueSelector';
45
46
  const preparedToLabel = toListLabel !== null && toListLabel !== void 0 ? toListLabel : toLabel;
46
47
  const [selectedOnly, doSetSelectedOnly] = react_1.useState(false);
47
48
  const setSelectedOnly = react_1.useCallback((selectedOnly) => {
@@ -65,7 +66,7 @@ function ValueSelector(props) {
65
66
  const label = !allowReorder ? preparedToLabel(option) : null;
66
67
  const reorderable = typeof allowReorder === 'function' ? allowReorder(option) : allowReorder;
67
68
  const renderNode = (props, dragHandleProps) => {
68
- return (React.createElement(rebass_1.Flex, Object.assign({ alignItems: "center", mt: index ? 1 : 0, key: identifier, backgroundColor: 'primary', padding: 2, "data-index": index, "data-id": identifier, "data-name": "option" }, props, { style: Object.assign({ borderRadius: 'var(--ab__border-radius)' }, props === null || props === void 0 ? void 0 : props.style) }),
69
+ return (React.createElement(rebass_1.Flex, Object.assign({ className: `${baseClassName}__option`, alignItems: "center", mt: index ? 1 : 0, key: identifier, backgroundColor: 'primary', padding: 2, "data-index": index, "data-id": identifier, "data-name": "option" }, props),
69
70
  React.createElement(rebass_1.Flex, { flex: 1, flexDirection: "row", alignItems: "center" },
70
71
  reorderable ? (React.createElement(rebass_1.Box, Object.assign({ mr: 3 }, dragHandleProps),
71
72
  React.createElement(icons_1.Icon, { name: "drag", style: { cursor: 'grab' } }))) : null,
@@ -94,7 +95,7 @@ function ValueSelector(props) {
94
95
  }));
95
96
  };
96
97
  const renderSelectionSection = () => {
97
- const selectionBox = (React.createElement(rebass_1.Box, { fontSize: 2, style: { whiteSpace: 'nowrap', flex: 'none' } }, !value.length ? (React.createElement(React.Fragment, null, noSelectionLabel !== null && noSelectionLabel !== void 0 ? noSelectionLabel : 'No selected options',
98
+ const selectionBox = (React.createElement(rebass_1.Box, { fontSize: 2 }, !value.length ? (React.createElement(React.Fragment, null, noSelectionLabel !== null && noSelectionLabel !== void 0 ? noSelectionLabel : 'No selected options',
98
99
  !singleSelect ? (React.createElement(SimpleButton_1.default, { px: 1, disabled: disabled, variant: "text", style: { textDecoration: 'underline', display: 'inline-block' }, onClick: () => {
99
100
  options.forEach((option) => {
100
101
  selectedMap.set(toIdentifier(option), option);
@@ -108,15 +109,13 @@ function ValueSelector(props) {
108
109
  xSelectedLabel
109
110
  ? xSelectedLabel(value.length)
110
111
  : `Your selected ${value.length} ${value.length > 1 ? 'options' : 'option'}.`))));
111
- return (React.createElement(rebass_1.Box, { mt: selectionBoxPosition === 'bottom' ? 3 : 0, mb: selectionBoxPosition === 'top' ? 3 : 0 },
112
+ return (React.createElement(rebass_1.Box, { className: `${baseClassName}__header`, mt: selectionBoxPosition === 'bottom' ? 3 : 0, mb: selectionBoxPosition === 'top' ? 3 : 0 },
112
113
  selectionBox,
113
114
  React.createElement(ValueOptionsTags, { options: options, value: value, selectedMap: selectedMap, toLabel: toLabel, toIdentifier: toIdentifier, onClearOption: notifyChange, readOnly: disabled })));
114
115
  };
115
116
  const showOnlySelectedCheckbox = (React.createElement(CheckBox_1.CheckBox, { disabled: !value.length, checked: selectedOnly, onChange: setSelectedOnly }, showSelectedOnlyLabel !== null && showSelectedOnlyLabel !== void 0 ? showSelectedOnlyLabel : 'Show Selected Only'));
116
117
  const showSelectedOnlyPosition = (_a = props.showSelectedOnlyPosition) !== null && _a !== void 0 ? _a : 'floating';
117
- return (React.createElement(rebass_1.Flex, { flexDirection: "column", flex: 1, className: "ab-ValueSelector", style: {
118
- overflow: 'hidden',
119
- } },
118
+ return (React.createElement(rebass_1.Flex, { className: baseClassName, flexDirection: "column", flex: 1 },
120
119
  React.createElement(rebass_1.Flex, { mb: 1 },
121
120
  showFilterInput && filter ? (React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { value: searchInputValue, OnTextChange: setSearchInputValue, placeholder: "Type to search", style: { flex: 1, border: 0, margin: 3 } })) : (React.createElement(rebass_1.Box, { flex: 1 })),
122
121
  showSelectedOnlyPosition === 'top' && React.createElement(rebass_1.Box, { ml: 20 }, showOnlySelectedCheckbox)),
@@ -144,19 +143,9 @@ function ValueSelector(props) {
144
143
  });
145
144
  notifyChange();
146
145
  } },
147
- React.createElement(rebass_1.Flex, { flexDirection: "column", flex: 1, style: { overflow: 'auto' } },
148
- showSelectedOnlyPosition === 'floating' && (React.createElement(rebass_1.Box, { style: {
149
- position: 'sticky',
150
- top: 0,
151
- zIndex: 10000,
152
- } },
153
- React.createElement(rebass_1.Box, { mr: 1, mt: 1, px: 2, "data-name": "show-selected-only", style: {
154
- position: 'absolute',
155
- top: 0,
156
- right: 0,
157
- borderRadius: 'var(--ab__border-radius)',
158
- overflow: 'hidden',
159
- }, fontSize: 2, backgroundColor: "defaultbackground" }, showOnlySelectedCheckbox))),
146
+ React.createElement(rebass_1.Flex, { className: `${baseClassName}__body`, flexDirection: "column", flex: 1, style: { overflow: 'auto' } },
147
+ showSelectedOnlyPosition === 'floating' && (React.createElement(rebass_1.Box, { className: `${baseClassName}__show-selected-only-checkbox` },
148
+ React.createElement(rebass_1.Box, { className: `${baseClassName}__show-selected-only-checkbox__text`, "data-name": "show-selected-only", backgroundColor: "defaultbackground" }, showOnlySelectedCheckbox))),
160
149
  React.createElement(react_beautiful_dnd_1.Droppable, { droppableId: "droppable" }, (droppableProvided) => {
161
150
  return (React.createElement("div", Object.assign({ ref: droppableProvided.innerRef }, droppableProvided.droppableProps),
162
151
  options
@@ -53,7 +53,7 @@ class CustomSortSummaryComponent extends React.Component {
53
53
  else {
54
54
  customSortRow = (React.createElement(ModuleDetail_1.ModuleDetail, { key: this.props.moduleInfo.FriendlyName, item1: React.createElement(ModuleProfile_1.ModuleProfile, { moduleInfo: this.props.moduleInfo }), item2: this.getCustomSortedValues(customSort), configEnity: customSort, moduleInfo: this.props.moduleInfo, onEdit: () => this.onEdit(customSort), showEdit: customSort != undefined, onShare: (config) => this.props.onShare(customSort, config), showShare: this.props.teamSharingActivated, onDelete: CustomSortRedux.CustomSortDelete(customSort), showBold: true, accessLevel: this.props.accessLevel }));
55
55
  }
56
- return (React.createElement("div", null,
56
+ return (React.createElement(React.Fragment, null,
57
57
  customSortRow,
58
58
  this.state.editedAdaptableObject && (React.createElement(CustomSortWizard_1.CustomSortWizard, { isNew: this.state.wizardStatus === EditableConfigEntityState_1.WizardStatus.New, moduleInfo: this.props.moduleInfo, data: this.state.editedAdaptableObject, configEntities: this.props.CustomSorts, onCloseWizard: () => this.onCloseWizard(), onFinishWizard: this.onFinishWizard }))));
59
59
  }
@@ -72,18 +72,19 @@ class DashboardPopupComponent extends React.Component {
72
72
  };
73
73
  return (React.createElement(PopupPanel_1.PopupPanel, { headerText: this.props.moduleInfo.FriendlyName, glyphicon: this.props.moduleInfo.Glyph, infoLink: this.props.moduleInfo.HelpPage, infoLinkDisabled: !this.props.api.internalApi.isDocumentationLinksDisplayed() },
74
74
  React.createElement(rebass_1.Flex, { flex: 1, height: "100%", flexDirection: "column" },
75
- areDashboardSettingsVisible && (React.createElement(Panel_1.default, { header: 'Dashboard Views', style: { height: 'auto', overflow: 'visible' }, variant: "default", borderRadius: "none", marginLeft: 2, marginRight: 2 },
76
- React.createElement(rebass_1.Flex, null,
77
- React.createElement(CheckBox_1.CheckBox, { mr: 3, className: `${baseClassName}__Checkbox__collapsed-check`, checked: this.props.IsCollapsed, onChange: (checked) => this.props.onSetDashboardCollapsed(checked) }, "Collapse"),
78
- ' ',
79
- this.props.api.internalApi.getAdaptableOptions().dashboardOptions.canFloat && (React.createElement(CheckBox_1.CheckBox, { mr: 3, className: `${baseClassName}__Checkbox__collapsed-check`, checked: this.props.IsFloating, onChange: (checked) => this.props.onSetDashboardFloating(checked) }, "Float")),
80
- ' ',
81
- React.createElement(CheckBox_1.CheckBox, { className: `${baseClassName}__Checkbox__hidden-check`, checked: this.props.IsHidden, onChange: (checked) => this.props.onSetDashboardHidden(checked) }, "Hidden")))),
82
- React.createElement(Panel_1.default, { header: 'Dashboard Contents', style: { borderBottom: '1px solid var(--ab-color-primary)' }, variant: "default", borderRadius: "none", marginTop: 4, marginLeft: 2, marginRight: 2 },
83
- React.createElement(rebass_1.Flex, { flexDirection: "row", padding: 2, "data-name": "dashboard-configuration-select" },
75
+ areDashboardSettingsVisible && (React.createElement(Panel_1.default, { header: 'Dashboard Views', style: { height: 'auto', overflow: 'visible' }, variant: "default", borderRadius: "none" },
76
+ React.createElement(CheckBox_1.CheckBox, { mr: 3, "data-name": "collapse", className: `${baseClassName}__settings-option`, checked: this.props.IsCollapsed, onChange: (checked) => this.props.onSetDashboardCollapsed(checked) }, "Collapse"),
77
+ ' ',
78
+ this.props.api.internalApi.getAdaptableOptions().dashboardOptions.canFloat && (React.createElement(CheckBox_1.CheckBox, { mr: 3, "data-name": "floating", className: `${baseClassName}__settings-option`, checked: this.props.IsFloating, onChange: (checked) => this.props.onSetDashboardFloating(checked) }, "Float")),
79
+ ' ',
80
+ React.createElement(CheckBox_1.CheckBox, { "data-name": "hidden", className: `${baseClassName}__settings-option`, checked: this.props.IsHidden, onChange: (checked) => this.props.onSetDashboardHidden(checked) }, "Hidden"))),
81
+ React.createElement(Panel_1.default, { header: 'Dashboard Contents', style: { borderBottom: '1px solid var(--ab-color-primary)' }, variant: "default", borderRadius: "none", marginTop: 4 },
82
+ React.createElement(rebass_1.Flex, { className: `${baseClassName}__contents-selector`, flexDirection: "row", padding: 2 },
84
83
  React.createElement(Radio_1.default, { marginLeft: 3, value: DashboardConfigView.Toolbars, checked: this.state.DashboardConfigView == DashboardConfigView.Toolbars, onChange: (_, e) => this.onDashboardConfigViewChanged(e) }, "Toolbars"),
85
84
  React.createElement(Radio_1.default, { marginLeft: 3, value: DashboardConfigView.Buttons, checked: this.state.DashboardConfigView == DashboardConfigView.Buttons, onChange: (_, e) => this.onDashboardConfigViewChanged(e) }, "Buttons")),
86
- React.createElement(rebass_1.Box, { className: `${baseClassName}__Module-Selector`, style: { minHeight: 0, flex: '1 1 0' }, padding: 2 },
85
+ React.createElement(rebass_1.Box, { className: `${baseClassName}__Module-Selector`, "data-name": this.state.DashboardConfigView === DashboardConfigView.Toolbars
86
+ ? 'toolbars'
87
+ : 'buttons', style: { minHeight: 0, flex: '1 1 0' }, padding: 2 },
87
88
  this.state.DashboardConfigView == DashboardConfigView.Toolbars && (React.createElement(DashboardManager_1.default, { disabled: isDashboardDisabled, availableToolbars: [...systemToolbars, ...customToolbars], tabs: tabs, onTabsChange: this.props.onDashboardSetTabs, api: this.props.api })),
88
89
  this.state.DashboardConfigView == DashboardConfigView.Buttons && (React.createElement(ModuleValueSelector_1.ModuleValueSelector, { disabled: isDashboardDisabled, options: allModuleButtons, value: selectedModuleButtons, noSelectionLabel: 'No selected Module Button', isOptionDisabled: isModuleCheckboxDisabled, xSelectedLabel: () => `Visible Module Buttons:`, onChange: (selectedValues) => this.props.onDashboardSetModuleButtons(selectedValues) })))))));
89
90
  }
@@ -78,9 +78,9 @@ class ExportViewPanelComponent extends React.Component {
78
78
  const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
79
79
  return (React.createElement(rebass_1.Flex, { style: { gap: 5 }, flexDirection: "row", className: `ab-${elementType}__Export__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
80
80
  React.createElement(rebass_1.Flex, { flex: 1 },
81
- React.createElement(DropdownButton_1.default, { disabled: allReportNames.length == 0, style: { width: '100%', fontSize: 'small' }, items: reportItems, columns: ['label'], className: `ab-${elementType}__Export__select`, onClear: () => this.onSelectedReportChanged(null), showClearButton: !!currentReport, variant: "outlined", marginRight: 2 }, currentReportId)),
81
+ React.createElement(DropdownButton_1.default, { disabled: allReportNames.length == 0, width: "100%", fontSize: "small", items: reportItems, columns: ['label'], className: `ab-${elementType}__Export__select`, onClear: () => this.onSelectedReportChanged(null), showClearButton: !!currentReport, variant: "outlined", marginRight: 2 }, currentReportId)),
82
82
  React.createElement(rebass_1.Flex, { flex: 1 },
83
- React.createElement(DropdownButton_1.default, { disabled: currentReportId === constants_1.SELECT_REPORT_STRING, style: { width: '100%', fontSize: 'small' }, items: destinationItems, columns: ['label'], className: `ab-${elementType}__Export__export`, onClear: () => this.onSelectedDestinationChanged(null), showClearButton: !!currentDestination, variant: "outlined", marginRight: 2 }, currentDestinationId)),
83
+ React.createElement(DropdownButton_1.default, { disabled: currentReportId === constants_1.SELECT_REPORT_STRING, width: "100%", fontSize: "small", items: destinationItems, columns: ['label'], className: `ab-${elementType}__Export__export`, onClear: () => this.onSelectedDestinationChanged(null), showClearButton: !!currentDestination, variant: "outlined", marginRight: 2 }, currentDestinationId)),
84
84
  React.createElement(rebass_1.Flex, { className: join_1.default(accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__Export__controls`), style: { width: '100%' } },
85
85
  React.createElement(ButtonExport_1.ButtonExport, { onClick: () => onApplyExport(), tooltip: "Export Report", className: `ab-${elementType}__Export__export`, disabled: currentReport == null || currentDestination == null }),
86
86
  React.createElement(ButtonEdit_1.ButtonEdit, { onClick: () => this.props.onEditReport(this.props.moduleInfo.Popup), tooltip: "Edit Report", className: `ab-${elementType}__Export__edit`, disabled: currentReport == null || this.props.api.exportApi.isCustomReport(currentReport), accessLevel: accessLevel }),
@@ -19,7 +19,7 @@ const isValidReportRowsQuery = (report) => {
19
19
  };
20
20
  exports.isValidReportRowsQuery = isValidReportRowsQuery;
21
21
  const renderReportRowsSummary = (report) => {
22
- var _a;
22
+ const { api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
23
23
  return (React.createElement(rebass_1.Box, { fontSize: 2 },
24
24
  report.ReportRowScope === 'AllRows' ? (React.createElement(React.Fragment, null,
25
25
  "Include ",
@@ -30,8 +30,9 @@ const renderReportRowsSummary = (report) => {
30
30
  React.createElement("b", null, "only visible Rows"),
31
31
  " in the Report")) : null,
32
32
  report.ReportRowScope === 'ExpressionRows' ? (React.createElement(React.Fragment, null,
33
- "Include Rows matching the query: ",
34
- React.createElement(Tag_1.Tag, null, (_a = report.Query) === null || _a === void 0 ? void 0 : _a.BooleanExpression))) : null));
33
+ "Include Rows matching the query:",
34
+ ' ',
35
+ React.createElement(Tag_1.Tag, null, api.internalApi.getAdaptableQueryExpressionText(report.Query)))) : null));
35
36
  };
36
37
  exports.renderReportRowsSummary = renderReportRowsSummary;
37
38
  const ReportRowsWizardSection = (props) => {
@@ -13,6 +13,7 @@ const CheckBox_1 = require("../../components/CheckBox");
13
13
  const react_redux_1 = require("react-redux");
14
14
  const LayoutRedux_1 = require("../../Redux/ActionsReducers/LayoutRedux");
15
15
  const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
16
+ const join_1 = tslib_1.__importDefault(require("../../components/utils/join"));
16
17
  class FilterViewPanelComponent extends React.Component {
17
18
  constructor(props) {
18
19
  super(props);
@@ -35,8 +36,8 @@ class FilterViewPanelComponent extends React.Component {
35
36
  return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: `ab-${elementType}__Filter__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
36
37
  React.createElement(rebass_1.Flex, null,
37
38
  ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(this.props.ColumnFilters) && (React.createElement(AdaptablePopover_1.AdaptablePopover, { popupPadding: 0, className: `ab-${elementType}__Filter__info`, headerText: "", bodyText: [React.createElement(ActiveFiltersPanel_1.ActiveFiltersPanel, null)], useButton: true, showEvent: 'focus', hideEvent: "blur", popoverMinWidth: 400 })),
38
- showClearButton && (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')),
39
- showSuspendFilterButton && (React.createElement(SimpleButton_1.default, { disabled: !isAtLeastOneFilter, onClick: handleSuspendUnsuspendAll, tone: isAtLeastOneFilterActive ? 'neutral' : 'success', variant: "text", icon: isAtLeastOneFilterActive ? 'pause' : 'play', accessLevel: this.props.accessLevel }))),
39
+ showClearButton && (React.createElement(ButtonClear_1.ButtonClear, { className: `ab-${elementType}__Filter__clear`, marginLeft: 1, marginBottom: 0, marginRight: 1, onClick: () => this.onClearFilters(), tooltip: "Clear Filters", disabled: this.props.ColumnFilters.length == 0, showText: this.props.viewType === 'ToolPanel' }, this.props.viewType === 'ToolPanel' && 'Clear')),
40
+ showSuspendFilterButton && (React.createElement(SimpleButton_1.default, { className: join_1.default(`ab-${elementType}__Filter__suspend-button`, isAtLeastOneFilterActive && `ab-${elementType}__Filter__suspend-all`, !isAtLeastOneFilterActive && `ab-${elementType}__Filter__un-suspend-all`), disabled: !isAtLeastOneFilter, onClick: handleSuspendUnsuspendAll, tone: isAtLeastOneFilterActive ? 'neutral' : 'success', variant: "text", icon: isAtLeastOneFilterActive ? 'pause' : 'play', accessLevel: this.props.accessLevel }))),
40
41
  React.createElement(rebass_1.Flex, { alignItems: "center" }, this.props.api.filterApi.isQuickFilterAvailable() && (React.createElement(CheckBox_1.CheckBox, { className: `ab-${elementType}__Filter__active-check`, disabled: this.props.accessLevel === 'ReadOnly' ||
41
42
  this.props.api.internalApi.isGridInPivotMode(), marginTop: 0, marginBottom: 0, fontSize: 2, padding: 1, checked: this.props.IsQuickFilterVisible, onChange: (checked) => {
42
43
  checked ? this.props.onShowQuickFilterBar() : this.props.onHideQuickFilterBar();
@@ -4,13 +4,15 @@ exports.AdaptableObjectsSummary = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const react_redux_1 = require("react-redux");
7
+ const rebass_1 = require("rebass");
7
8
  const AdaptableContext_1 = require("../AdaptableContext");
8
9
  const AdaptableObjectList_1 = require("../Components/AdaptableObjectList");
9
10
  const AdaptableObjectsSummary = () => {
10
11
  const state = react_redux_1.useSelector((state) => state);
11
12
  const adaptable = AdaptableContext_1.useAdaptable();
12
13
  const modules = adaptable.ModuleService.getModuleCollection();
13
- return (React.createElement(React.Fragment, null, [...modules].map(([moduleName, module]) => {
14
+ const baseClassName = 'ab-AdaptableObjectsSummary';
15
+ return (React.createElement(rebass_1.Box, { className: baseClassName }, [...modules].map(([moduleName, module]) => {
14
16
  var _a;
15
17
  if (!module.isModuleAvailable()) {
16
18
  return null;
@@ -19,8 +21,8 @@ const AdaptableObjectsSummary = () => {
19
21
  if (!(items === null || items === void 0 ? void 0 : items.length)) {
20
22
  return null;
21
23
  }
22
- return (React.createElement("div", { key: module.moduleInfo.ModuleName },
23
- React.createElement("b", null, module.moduleInfo.FriendlyName),
24
+ return (React.createElement(rebass_1.Box, { "data-name": module.moduleInfo.ModuleName, className: `${baseClassName}__module-list`, key: module.moduleInfo.ModuleName },
25
+ React.createElement("b", { className: `${baseClassName}__header` }, module.moduleInfo.FriendlyName),
24
26
  (items === null || items === void 0 ? void 0 : items.length) && React.createElement(AdaptableObjectList_1.AdaptableObjectList, { items: items, module: module })));
25
27
  })));
26
28
  };
@@ -91,7 +91,7 @@ const OptionContainerComponent = (props) => {
91
91
  onViewModeChange(viewMode === 'expanded' ? 'collapsed' : 'expanded');
92
92
  };
93
93
  const panelButton = viewMode === 'expanded' ? (React.createElement(ButtonMinimise_1.ButtonMinimise, { onClick: () => requestViewModeChange(), tooltip: `Hide ${label}` })) : (React.createElement(ButtonMaximise_1.ButtonMaximise, { onClick: () => requestViewModeChange(), tooltip: `Show ${label}` }));
94
- return (React.createElement(PanelWithButton_1.PanelWithButton, { className: `options-container-${name}`, variant: "default", headerText: label, headerProps: {
94
+ return (React.createElement(PanelWithButton_1.PanelWithButton, { className: `ab-OptionsContainer options-container-${name}`, variant: "default", headerText: label, headerProps: {
95
95
  fontSize: 3,
96
96
  style: {
97
97
  fontWeight: viewMode === 'expanded' ? 800 : 400,
@@ -102,17 +102,16 @@ const GridInfoPopup = (props) => {
102
102
  return React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { key: index, colItems: x });
103
103
  });
104
104
  const showRadioButtons = [showGridSummary, showAdaptableOptions, showColumnInfo, showAdaptableObjects].filter((item) => item).length > 1;
105
- return (React.createElement(PopupPanel_1.PopupPanel, { headerText: 'Grid Info', glyphicon: 'info' },
106
- React.createElement(rebass_1.Flex, { marginBottom: 2, padding: 3 }, showRadioButtons && (React.createElement(React.Fragment, null,
107
- showGridSummary && (React.createElement(Radio_1.default, { "data-name": "radioButton-GridSummary", marginRight: 3, value: "GridSummary", checked: state.ActiveTab == 'GridSummary', onChange: (_, e) => onShowGridSummaryChanged('GridSummary') }, "Summary")),
105
+ const baseClassName = 'ab-GridInfo';
106
+ return (React.createElement(PopupPanel_1.PopupPanel, { className: baseClassName, headerText: 'Grid Info', glyphicon: 'info' },
107
+ React.createElement(rebass_1.Flex, { className: `${baseClassName}__header`, marginBottom: 2, padding: 3 }, showRadioButtons && (React.createElement(React.Fragment, null,
108
+ showGridSummary && (React.createElement(Radio_1.default, { className: `${baseClassName}__option-radio`, "data-name": "radioButton-GridSummary", marginRight: 3, value: "GridSummary", checked: state.ActiveTab == 'GridSummary', onChange: (_, e) => onShowGridSummaryChanged('GridSummary') }, "Summary")),
108
109
  showAdaptableOptions && (React.createElement(Radio_1.default, { "data-name": "radioButton-AdaptableOptions", marginRight: 3, value: "AdaptableOptions", checked: state.ActiveTab == 'AdaptableOptions', onChange: (_, e) => onShowGridSummaryChanged('AdaptableOptions') }, "Options")),
109
110
  showColumnInfo && (React.createElement(Radio_1.default, { "data-name": "radioButton-Column", marginRight: 3, value: "Column", checked: state.ActiveTab == 'ColumnInfo', onChange: (_, e) => onShowGridSummaryChanged('ColumnInfo') }, "Columns")),
110
111
  showAdaptableObjects && (React.createElement(Radio_1.default, { "data-name": "radioButton-Column", value: "Column", checked: state.ActiveTab == 'AdaptableObjectsSummary', onChange: (_, e) => onShowGridSummaryChanged('AdaptableObjectsSummary') }, "Objects"))))),
111
- state.ActiveTab == 'GridSummary' && (React.createElement(rebass_1.Box, { margin: 2 },
112
- React.createElement(AdaptableObjectCollection_1.AdaptableObjectCollection, { colItems: propValueColItems, items: gridSummaries }))),
112
+ state.ActiveTab == 'GridSummary' && (React.createElement(AdaptableObjectCollection_1.AdaptableObjectCollection, { margin: 2, colItems: propValueColItems, items: gridSummaries })),
113
113
  state.ActiveTab == 'AdaptableOptions' && React.createElement(AdaptableOptionsComponent_1.AdaptableOptionsComponent, { api: props.api }),
114
- state.ActiveTab == 'ColumnInfo' && (React.createElement("div", null,
115
- React.createElement(ColumnInfoComponent_1.ColumnInfoComponent, { api: props.api, teamSharingActivated: props.teamSharingActivated, column: state.CurrentColumn }))),
114
+ state.ActiveTab == 'ColumnInfo' && (React.createElement(ColumnInfoComponent_1.ColumnInfoComponent, { api: props.api, teamSharingActivated: props.teamSharingActivated, column: state.CurrentColumn })),
116
115
  state.ActiveTab === 'AdaptableObjectsSummary' && React.createElement(AdaptableObjectsSummary_1.AdaptableObjectsSummary, null)));
117
116
  };
118
117
  exports.GridInfoPopup = GridInfoPopup;
@@ -6,7 +6,6 @@ const React = tslib_1.__importStar(require("react"));
6
6
  const react_1 = require("react");
7
7
  const rebass_1 = require("rebass");
8
8
  const ExpressionEditor_1 = require("../../../components/ExpressionEditor");
9
- const AdaptableContext_1 = require("../../AdaptableContext");
10
9
  const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
11
10
  const ModuleConstants_1 = require("../../../Utilities/Constants/ModuleConstants");
12
11
  const Tag_1 = require("../../../components/Tag");
@@ -22,14 +21,14 @@ const isValidNamedQueryExpression = (data, api) => {
22
21
  };
23
22
  exports.isValidNamedQueryExpression = isValidNamedQueryExpression;
24
23
  const renderNamedQueryExpressionSummary = (data) => {
24
+ const { api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
25
25
  return (React.createElement(rebass_1.Text, { fontSize: 2 },
26
26
  "Expression: ",
27
- React.createElement(Tag_1.Tag, null, data.BooleanExpression)));
27
+ React.createElement(Tag_1.Tag, null, api.internalApi.getAdaptableQueryExpressionText(data))));
28
28
  };
29
29
  exports.renderNamedQueryExpressionSummary = renderNamedQueryExpressionSummary;
30
30
  const NamedQueryExpressionWizardSection = (props) => {
31
- const { api } = AdaptableContext_1.useAdaptable();
32
- const { data, moduleInfo } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
31
+ const { data, moduleInfo, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
33
32
  const initialData = react_1.useMemo(() => api.internalApi.getQueryPreviewData(), []);
34
33
  return (React.createElement(ExpressionEditor_1.ExpressionEditor, { allowSaveNamedQuery: false, type: 'boolean', module: moduleInfo.ModuleName, value: data.BooleanExpression, onChange: (BooleanExpression) => {
35
34
  props.onChange(Object.assign(Object.assign({}, data), { BooleanExpression }));
@@ -4,30 +4,29 @@ exports.StateManagementPopup = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const PopupPanel_1 = require("../Components/Popups/AdaptablePopup/PopupPanel");
7
- const rebass_1 = require("rebass");
8
7
  const HelpBlock_1 = tslib_1.__importDefault(require("../../components/HelpBlock"));
9
8
  const LoadButton_1 = require("./components/LoadButton");
10
9
  const ClearButton_1 = require("./components/ClearButton");
11
10
  const ExportDropdown_1 = require("./components/ExportDropdown");
12
11
  const Panel_1 = tslib_1.__importDefault(require("../../components/Panel"));
13
12
  const StateManagementPopup = (props) => {
14
- return (React.createElement(PopupPanel_1.PopupPanel, { headerText: props.moduleInfo.FriendlyName, glyphicon: props.moduleInfo.Glyph, infoLink: props.moduleInfo.HelpPage, infoLinkDisabled: !props.api.internalApi.isDocumentationLinksDisplayed() },
15
- React.createElement(rebass_1.Box, null,
16
- React.createElement(Panel_1.default, { header: 'User State', style: { height: 'auto' }, variant: "default", borderRadius: "none", marginTop: 3, marginRight: 2 },
17
- React.createElement(HelpBlock_1.default, { marginBottom: 2 }, 'Clear all current user state that has been persisted.'),
18
- React.createElement(HelpBlock_1.default, null, 'This will cause this window to close and any state you have previously created will be lost and the initial Predefined Config will then be reapplied.'),
19
- React.createElement(ClearButton_1.ClearButton, { tone: "error", variant: "raised", marginTop: 2, accessLevel: props.accessLevel, onClick: () => props.api.configApi.reloadPredefinedConfig() }, "Clear User State")),
20
- React.createElement(Panel_1.default, { header: 'Load Predefined Config', style: { height: 'auto' }, variant: "default", borderRadius: "none", marginTop: 3, marginRight: 2 },
21
- React.createElement(HelpBlock_1.default, { marginTop: 2 }, 'Load Predefined Config (from a .json file). This will cause this window to close.'),
22
- ' ',
23
- React.createElement(LoadButton_1.LoadButton, { tone: "info", variant: "raised", marginTop: 2, accessLevel: props.accessLevel, onLoad: (json) => props.api.configApi.reloadPredefinedConfig(json) }, "Load Predefined Config")),
24
- React.createElement(Panel_1.default, { header: 'Export Adaptable State', style: { height: 'auto' }, variant: "default", borderRadius: "none", marginTop: 3, marginRight: 2 },
25
- React.createElement(HelpBlock_1.default, { marginTop: 2, marginBottom: 2 }, 'Exports the currently persisted Adaptable state.'),
26
- ' ',
27
- React.createElement(ExportDropdown_1.ExportDropdown, { api: props.api, type: "adaptableState", marginRight: 3, style: { flex: 1, maxWidth: 'none' }, columns: ['label'] }, "Select Export Destination")),
28
- React.createElement(Panel_1.default, { header: 'Export Initial Predefined Config', style: { height: 'auto' }, variant: "default", borderRadius: "none", marginTop: 3, marginRight: 2 },
29
- React.createElement(HelpBlock_1.default, { marginTop: 2, marginBottom: 2 }, 'Exports the Predefined Config which was provided at design time.'),
30
- ' ',
31
- React.createElement(ExportDropdown_1.ExportDropdown, { api: props.api, type: "predefinedConfig", marginRight: 3, style: { flex: 1, maxWidth: 'none' }, columns: ['label'] }, "Select Export Destination")))));
13
+ const baseClassName = 'ab-ManageState';
14
+ return (React.createElement(PopupPanel_1.PopupPanel, { className: baseClassName, headerText: props.moduleInfo.FriendlyName, glyphicon: props.moduleInfo.Glyph, infoLink: props.moduleInfo.HelpPage, infoLinkDisabled: !props.api.internalApi.isDocumentationLinksDisplayed() },
15
+ React.createElement(Panel_1.default, { className: `${baseClassName}__panel`, "data-name": "user-state", header: 'User State', style: { height: 'auto' }, variant: "default", borderRadius: "none", marginRight: 2, mb: 2 },
16
+ React.createElement(HelpBlock_1.default, { marginBottom: 2 }, 'Clear all current user state that has been persisted.'),
17
+ React.createElement(HelpBlock_1.default, null, 'This will cause this window to close and any state you have previously created will be lost and the initial Predefined Config will then be reapplied.'),
18
+ React.createElement(ClearButton_1.ClearButton, { tone: "error", variant: "raised", marginTop: 2, accessLevel: props.accessLevel, onClick: () => props.api.configApi.reloadPredefinedConfig() }, "Clear User State")),
19
+ React.createElement(Panel_1.default, { className: `${baseClassName}__panel`, "data-name": "predefined-config", header: 'Load Predefined Config', style: { height: 'auto' }, variant: "default", borderRadius: "none", marginTop: 3, marginRight: 2, mb: 2 },
20
+ React.createElement(HelpBlock_1.default, { marginTop: 2 }, 'Load Predefined Config (from a .json file). This will cause this window to close.'),
21
+ ' ',
22
+ React.createElement(LoadButton_1.LoadButton, { tone: "info", variant: "raised", marginTop: 2, accessLevel: props.accessLevel, onLoad: (json) => props.api.configApi.reloadPredefinedConfig(json) }, "Load Predefined Config")),
23
+ React.createElement(Panel_1.default, { className: `${baseClassName}__panel`, "data-name": "adaptable-state", header: 'Export Adaptable State', style: { height: 'auto' }, variant: "default", borderRadius: "none", marginTop: 3, marginRight: 2, mb: 2 },
24
+ React.createElement(HelpBlock_1.default, { marginTop: 2, marginBottom: 2 }, 'Exports the currently persisted Adaptable state.'),
25
+ ' ',
26
+ React.createElement(ExportDropdown_1.ExportDropdown, { api: props.api, type: "adaptableState", marginRight: 3, style: { flex: 1, maxWidth: 'none' }, columns: ['label'] }, "Select Export Destination")),
27
+ React.createElement(Panel_1.default, { className: `${baseClassName}__panel`, "data-name": "initial-predefined-config", header: 'Export Initial Predefined Config', style: { height: 'auto' }, variant: "default", borderRadius: "none", marginTop: 3, marginRight: 2, mb: 2 },
28
+ React.createElement(HelpBlock_1.default, { marginTop: 2, marginBottom: 2 }, 'Exports the Predefined Config which was provided at design time.'),
29
+ ' ',
30
+ React.createElement(ExportDropdown_1.ExportDropdown, { api: props.api, type: "predefinedConfig", marginRight: 3, style: { flex: 1, maxWidth: 'none' }, columns: ['label'] }, "Select Export Destination"))));
32
31
  };
33
32
  exports.StateManagementPopup = StateManagementPopup;
@@ -265,6 +265,8 @@ export declare class Adaptable implements IAdaptable {
265
265
  setupColumnTooltipValueGetter({ col, colId, abColumn }: ColumnSetupInfo): void;
266
266
  setupColumnQuickFilerText({ col, abColumn }: ColumnSetupInfo): void;
267
267
  setupAllowedAggFuncs({ col, abColumn }: ColumnSetupInfo): void;
268
+ triggerSetupColumnKeyCreator(colId: string): void;
269
+ setupColumnKeyCreator(columnSetupInfo: ColumnSetupInfo): void;
268
270
  setupColumnHeader({ col, abColumn }: ColumnSetupInfo): boolean;
269
271
  setupColumnFilter({ col, colDef }: ColumnSetupInfo): void;
270
272
  setupColumnFloatingFilter({ col, colDef }: ColumnSetupInfo): void;
@@ -367,7 +367,7 @@ class Adaptable {
367
367
  this.isInitialised = false;
368
368
  this.useRowNodeLookUp = false; // we will set later in instantiate if possible to be true
369
369
  this.forPlugins((plugin) => plugin.afterInitOptions(this, this.adaptableOptions));
370
- this.registerAdaptableAggFuncs(adaptableOptions);
370
+ this.registerAdaptableAggFuncs();
371
371
  // get the api ready
372
372
  this.api = new AdaptableApiImpl_1.AdaptableApiImpl(this);
373
373
  this.forPlugins((plugin) => plugin.afterInitApi(this, this.api));
@@ -1233,7 +1233,7 @@ class Adaptable {
1233
1233
  }
1234
1234
  persistLayout(layout) {
1235
1235
  if (this.api.layoutApi.shouldAutoSaveLayout(layout)) {
1236
- this.api.layoutApi.saveLayout(layout);
1236
+ this.api.layoutApi.createOrUpdateLayout(layout);
1237
1237
  }
1238
1238
  else {
1239
1239
  this.api.internalApi.updateCurrentDraftLayout(layout);
@@ -1266,7 +1266,10 @@ class Adaptable {
1266
1266
  const sortModelMap = ((_a = layout.ColumnSorts) !== null && _a !== void 0 ? _a : []).reduce((acc, customSort) => {
1267
1267
  const colId = customSort.ColumnId;
1268
1268
  if (!layoutColumnsMap[colId]) {
1269
- return acc;
1269
+ // pivot layouts may have no pivot columns, only aggregation columns
1270
+ if (layout.AggregationColumns[colId] == undefined) {
1271
+ return acc;
1272
+ }
1270
1273
  }
1271
1274
  acc[colId] = {
1272
1275
  colId,
@@ -1305,9 +1308,11 @@ class Adaptable {
1305
1308
  }
1306
1309
  newColState.rowGroupIndex =
1307
1310
  groupedColumnsIndexesMap[colId] != null ? groupedColumnsIndexesMap[colId] : null;
1308
- // if (newColState.rowGroupIndex == null) {
1311
+ const previousRowGroup = newColState.rowGroup;
1309
1312
  newColState.rowGroup = newColState.rowGroupIndex != null;
1310
- // }
1313
+ if (!previousRowGroup && newColState.rowGroup) {
1314
+ this.triggerSetupColumnKeyCreator(colId);
1315
+ }
1311
1316
  const normalizePinned = (pinnedValue) => {
1312
1317
  if (typeof pinnedValue === 'string') {
1313
1318
  return pinnedValue;
@@ -1464,7 +1469,6 @@ class Adaptable {
1464
1469
  plugin.afterSetLayout(this, layout);
1465
1470
  }
1466
1471
  });
1467
- // this.api.layoutApi.fireLayoutUpdatedEvent(layout, 'UpdatedLayout');
1468
1472
  }
1469
1473
  /*
1470
1474
  * This is the opposite of setLayout
@@ -1537,7 +1541,6 @@ class Adaptable {
1537
1541
  if (this.api.layoutApi.areExpandedRowGroupsSavedInLayouts()) {
1538
1542
  layout.ExpandedRowGroupValues = this.getExpandRowGroupsKeys();
1539
1543
  }
1540
- // this.api.layoutApi.fireLayoutUpdatedEvent(layout, 'UpdatedLayout');
1541
1544
  this.persistLayout(layout);
1542
1545
  }
1543
1546
  // This method returns selected cells ONLY (if selection mode is cells or multiple cells).
@@ -2408,7 +2411,6 @@ class Adaptable {
2408
2411
  }
2409
2412
  getColDefsForCalculatedColumns() {
2410
2413
  const defaultCalculatedColumnSettings = ObjectFactory_1.CreateEmptyCalculatedColumn().CalculatedColumnSettings;
2411
- const isExternalEvaluation = !this.api.internalApi.runModuleInAdaptableQL('CalculatedColumn');
2412
2414
  return this.api.calculatedColumnApi.getAllCalculatedColumn().map((calculatedColumn) => {
2413
2415
  const calculatedColumnSettings = Object.assign(Object.assign({}, defaultCalculatedColumnSettings), calculatedColumn.CalculatedColumnSettings);
2414
2416
  if (!calculatedColumnSettings.DataType) {
@@ -2422,6 +2424,7 @@ class Adaptable {
2422
2424
  if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(calculatedColumnSettings.ColumnTypes)) {
2423
2425
  columnTypes.push(...calculatedColumnSettings.ColumnTypes);
2424
2426
  }
2427
+ const isExternalEvaluation = !this.api.internalApi.evaluateExpressionInAdaptableQL('CalculatedColumn', this.api.queryLanguageApi.getAdaptableQueryExpression(calculatedColumn.Query));
2425
2428
  const newColDef = {
2426
2429
  headerName: calculatedColumn.FriendlyName
2427
2430
  ? calculatedColumn.FriendlyName
@@ -2451,7 +2454,7 @@ class Adaptable {
2451
2454
  if (calculatedColumnSettings.ShowToolTip != null &&
2452
2455
  calculatedColumnSettings.ShowToolTip == true) {
2453
2456
  newColDef.tooltipValueGetter = () => {
2454
- return this.api.queryLanguageApi.getAdaptableQueryExpression(calculatedColumn.Query);
2457
+ return this.api.internalApi.getAdaptableQueryExpressionText(calculatedColumn.Query);
2455
2458
  };
2456
2459
  }
2457
2460
  if (calculatedColumnSettings.HeaderToolTip) {
@@ -2548,6 +2551,7 @@ class Adaptable {
2548
2551
  'doesExternalFilterPass',
2549
2552
  'statusBar',
2550
2553
  'sideBar',
2554
+ 'aggFuncs',
2551
2555
  ]);
2552
2556
  if (this.gridOptions.components) {
2553
2557
  this.gridOptions.components.AdaptableToolPanel = null;
@@ -2921,26 +2925,28 @@ class Adaptable {
2921
2925
  (originalIsExternalFilterPresent ? originalIsExternalFilterPresent(params) : false));
2922
2926
  };
2923
2927
  });
2924
- const evaluateQueryOnClient = this.api.internalApi.runModuleInAdaptableQL('Query');
2925
- const evaluateFilterOnClient = this.api.internalApi.runModuleInAdaptableQL('Filter');
2926
2928
  this.setGridOptionsProperty('doesExternalFilterPass', (originalDoesExternalFilterPass) => {
2927
2929
  return (node) => {
2928
2930
  if (this.isDestroyed) {
2929
2931
  return true;
2930
2932
  }
2931
2933
  // first we assess Query (if its running locally)
2932
- if (evaluateQueryOnClient && !this.isGroupRowNode(node)) {
2934
+ if (!this.isGroupRowNode(node)) {
2933
2935
  const currentQuery = this.api.queryApi.getCurrentQuery();
2934
2936
  if (currentQuery) {
2935
- const isCurrentQueryValid = this.api.queryLanguageApi.isValidBooleanExpression(currentQuery, ModuleConstants_1.QueryModuleId, `Invalid CurrentQuery '${currentQuery}'`);
2936
- if (!isCurrentQueryValid ||
2937
- !this.api.internalApi
2938
- .getQueryLanguageService()
2939
- .evaluateBooleanExpression(currentQuery, ModuleConstants_1.QueryModuleId, node)) {
2940
- return false;
2937
+ const evaluateQueryOnClient = this.api.internalApi.evaluateExpressionInAdaptableQL('Query', currentQuery);
2938
+ if (evaluateQueryOnClient) {
2939
+ const isCurrentQueryValid = this.api.queryLanguageApi.isValidBooleanExpression(currentQuery, ModuleConstants_1.QueryModuleId, `Invalid CurrentQuery '${currentQuery}'`);
2940
+ if (!isCurrentQueryValid ||
2941
+ !this.api.internalApi
2942
+ .getQueryLanguageService()
2943
+ .evaluateBooleanExpression(currentQuery, ModuleConstants_1.QueryModuleId, node)) {
2944
+ return false;
2945
+ }
2941
2946
  }
2942
2947
  }
2943
2948
  }
2949
+ const evaluateFilterOnClient = this.api.internalApi.evaluateExpressionInAdaptableQL('Filter');
2944
2950
  try {
2945
2951
  // we then assess filters (if running locally)
2946
2952
  if (evaluateFilterOnClient) {
@@ -3059,6 +3065,7 @@ class Adaptable {
3059
3065
  this.setupColumnHeader(colSetupInfo);
3060
3066
  this.setupColumnQuickFilerText(colSetupInfo);
3061
3067
  this.setupAllowedAggFuncs(colSetupInfo);
3068
+ this.setupColumnKeyCreator(colSetupInfo);
3062
3069
  });
3063
3070
  this.setupRowStyling();
3064
3071
  // setupAggregationColumnHeaders() is executed on every setLayout()
@@ -3319,6 +3326,44 @@ class Adaptable {
3319
3326
  return abColumn.availableAggregationFunctions;
3320
3327
  });
3321
3328
  }
3329
+ triggerSetupColumnKeyCreator(colId) {
3330
+ const col = this.gridOptions.columnApi.getColumn(colId);
3331
+ const colDef = col.getColDef();
3332
+ const abColumn = this.api.columnApi.getColumnFromId(colId);
3333
+ const colSetupInfo = {
3334
+ col,
3335
+ colDef,
3336
+ colId,
3337
+ abColumn,
3338
+ };
3339
+ this.setupColumnKeyCreator(colSetupInfo);
3340
+ }
3341
+ setupColumnKeyCreator(columnSetupInfo) {
3342
+ const { col, abColumn } = columnSetupInfo;
3343
+ const adaptableOptions = this.adaptableOptions;
3344
+ const adaptableApi = this.api;
3345
+ this.setColDefProperty(col, 'keyCreator', (userPropertyValue) => {
3346
+ return (params) => {
3347
+ var _a;
3348
+ if (typeof userPropertyValue === 'function') {
3349
+ return userPropertyValue(params);
3350
+ }
3351
+ const value = params.value;
3352
+ const unbalancedGroupsKey = (_a = adaptableOptions.generalOptions) === null || _a === void 0 ? void 0 : _a.unbalancedGroupsKey;
3353
+ if (!unbalancedGroupsKey) {
3354
+ return value;
3355
+ }
3356
+ let groupUnbalancedGroupsUnderKeyValue = typeof unbalancedGroupsKey === 'function'
3357
+ ? unbalancedGroupsKey({
3358
+ adaptableApi: adaptableApi,
3359
+ adaptableColumn: abColumn,
3360
+ params,
3361
+ })
3362
+ : unbalancedGroupsKey;
3363
+ return value === null || value === undefined ? groupUnbalancedGroupsUnderKeyValue : value;
3364
+ };
3365
+ });
3366
+ }
3322
3367
  setupColumnHeader({ col, abColumn }) {
3323
3368
  var _a, _b;
3324
3369
  const previousColumnHeader = (_a = col === null || col === void 0 ? void 0 : col.getColDef()) === null || _a === void 0 ? void 0 : _a.headerName;
@@ -4663,19 +4708,22 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
4663
4708
  }
4664
4709
  return null;
4665
4710
  }
4666
- registerAdaptableAggFuncs(adaptableOptions) {
4667
- adaptableOptions.gridOptions.aggFuncs = this.adaptableOptions.gridOptions.aggFuncs || {};
4668
- adaptableOptions.gridOptions.aggFuncs[AggregationColumns_1.WEIGHTED_AVERAGE_AGG_FN_NAME] = (params) => {
4669
- const columnId = params.column.getColId();
4670
- const adaptableAggFunc = this.getActiveAdaptableAggFuncForCol(columnId);
4671
- if (!adaptableAggFunc) {
4711
+ registerAdaptableAggFuncs() {
4712
+ this.setGridOptionsProperty('aggFuncs', (originalAggFuncs) => {
4713
+ const aggregationFunctions = originalAggFuncs || {};
4714
+ aggregationFunctions[AggregationColumns_1.WEIGHTED_AVERAGE_AGG_FN_NAME] = (params) => {
4715
+ const columnId = params.column.getColId();
4716
+ const adaptableAggFunc = this.getActiveAdaptableAggFuncForCol(columnId);
4717
+ if (!adaptableAggFunc) {
4718
+ return undefined;
4719
+ }
4720
+ if (adaptableAggFunc.type === 'weightedAverage') {
4721
+ return weightedAverage_1.weightedAverage(params, params.colDef.colId, adaptableAggFunc.weightedColumnId);
4722
+ }
4672
4723
  return undefined;
4673
- }
4674
- if (adaptableAggFunc.type === 'weightedAverage') {
4675
- return weightedAverage_1.weightedAverage(params, params.colDef.colId, adaptableAggFunc.weightedColumnId);
4676
- }
4677
- return undefined;
4678
- };
4724
+ };
4725
+ return aggregationFunctions;
4726
+ });
4679
4727
  }
4680
4728
  /**
4681
4729
  * When reading the state from the grid, we have to make sure 'avg' is not overriden with the 'avg' string.
@@ -1,6 +1,8 @@
1
1
  import { IAggFuncParams } from '@ag-grid-community/all-modules';
2
+ import { CellSummaryOperationContext } from '../types';
2
3
  export declare const weightedAverage: (params: IAggFuncParams, columnId: string, weightColumnId: string) => {
3
4
  [x: string]: number | (() => number | "");
4
5
  toString: () => number | "";
5
6
  valueOf: () => number;
6
7
  };
8
+ export declare const cellSummaryWeightedAverage: ({ numericColumns, selectedCellInfo, adaptableApi, }: CellSummaryOperationContext) => any;