@adaptabletools/adaptable 12.1.7 → 12.1.8-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 (185) hide show
  1. package/base.css +11 -49
  2. package/bundle.cjs.js +105 -105
  3. package/index.css +13 -60
  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 +1 -0
  8. package/src/AdaptableOptions/FilterOptions.d.ts +12 -0
  9. package/src/AdaptableOptions/FinancePluginOptions.d.ts +22 -1
  10. package/src/AdaptableOptions/StateOptions.d.ts +25 -12
  11. package/src/Api/ColumnApi.d.ts +5 -0
  12. package/src/Api/ExportApi.d.ts +5 -0
  13. package/src/Api/FilterApi.d.ts +23 -0
  14. package/src/Api/GridApi.d.ts +1 -0
  15. package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
  16. package/src/Api/Implementation/ColumnApiImpl.js +5 -0
  17. package/src/Api/Implementation/ExportApiImpl.d.ts +3 -1
  18. package/src/Api/Implementation/ExportApiImpl.js +19 -3
  19. package/src/Api/Implementation/FilterApiImpl.d.ts +5 -0
  20. package/src/Api/Implementation/FilterApiImpl.js +25 -2
  21. package/src/Api/Implementation/GridApiImpl.d.ts +1 -0
  22. package/src/Api/Implementation/InternalApiImpl.d.ts +0 -1
  23. package/src/Api/Implementation/InternalApiImpl.js +0 -3
  24. package/src/Api/Implementation/PredicateApiImpl.js +4 -0
  25. package/src/Api/Implementation/QueryLanguageApiImpl.js +9 -1
  26. package/src/Api/InternalApi.d.ts +0 -1
  27. package/src/PredefinedConfig/CalculatedColumnState.d.ts +2 -2
  28. package/src/PredefinedConfig/Common/AdaptablePredicate.js +16 -4
  29. package/src/PredefinedConfig/Common/AdaptableQuery.js +1 -1
  30. package/src/PredefinedConfig/Common/AggregationColumns.d.ts +6 -0
  31. package/src/PredefinedConfig/Common/AggregationColumns.js +4 -0
  32. package/src/PredefinedConfig/Common/ColumnFilter.d.ts +2 -2
  33. package/src/PredefinedConfig/Common/Enums.d.ts +0 -15
  34. package/src/PredefinedConfig/Common/Enums.js +1 -18
  35. package/src/PredefinedConfig/ExportState.d.ts +12 -4
  36. package/src/PredefinedConfig/LayoutState.d.ts +2 -1
  37. package/src/PredefinedConfig/PopupState.d.ts +1 -2
  38. package/src/Redux/ActionsReducers/AlertRedux.d.ts +1 -1
  39. package/src/Redux/ActionsReducers/AlertRedux.js +1 -1
  40. package/src/Redux/ActionsReducers/ConditionalStyleRedux.d.ts +1 -1
  41. package/src/Redux/ActionsReducers/ConditionalStyleRedux.js +1 -1
  42. package/src/Redux/ActionsReducers/CustomSortRedux.d.ts +1 -1
  43. package/src/Redux/ActionsReducers/CustomSortRedux.js +1 -1
  44. package/src/Redux/ActionsReducers/FlashingCellRedux.d.ts +1 -1
  45. package/src/Redux/ActionsReducers/FlashingCellRedux.js +1 -1
  46. package/src/Redux/ActionsReducers/FormatColumnRedux.d.ts +1 -1
  47. package/src/Redux/ActionsReducers/FormatColumnRedux.js +1 -1
  48. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +28 -0
  49. package/src/Redux/ActionsReducers/LayoutRedux.js +80 -2
  50. package/src/Redux/ActionsReducers/PlusMinusRedux.d.ts +1 -1
  51. package/src/Redux/ActionsReducers/PlusMinusRedux.js +1 -1
  52. package/src/Redux/ActionsReducers/PopupRedux.d.ts +0 -2
  53. package/src/Redux/ActionsReducers/PopupRedux.js +1 -28
  54. package/src/Redux/ActionsReducers/ScheduleRedux.d.ts +5 -5
  55. package/src/Redux/ActionsReducers/ScheduleRedux.js +5 -5
  56. package/src/Redux/ActionsReducers/ShortcutRedux.d.ts +1 -1
  57. package/src/Redux/ActionsReducers/ShortcutRedux.js +1 -1
  58. package/src/Redux/Store/AdaptableStore.js +15 -6
  59. package/src/Strategy/AlertModule.d.ts +1 -0
  60. package/src/Strategy/AlertModule.js +20 -0
  61. package/src/Strategy/CalculatedColumnModule.js +2 -2
  62. package/src/Strategy/ExportModule.d.ts +0 -1
  63. package/src/Strategy/ExportModule.js +0 -16
  64. package/src/Strategy/FilterModule.js +6 -0
  65. package/src/Strategy/Interface/IModule.d.ts +4 -0
  66. package/src/Strategy/LayoutModule.js +20 -20
  67. package/src/Strategy/Utilities/FormatColumn/getFormatColumnStyleViewItems.js +16 -1
  68. package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.js +15 -11
  69. package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +1 -0
  70. package/src/Utilities/Constants/DocumentationLinkConstants.js +2 -1
  71. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +2 -0
  72. package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +12 -2
  73. package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +30 -66
  74. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +22 -6
  75. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +423 -220
  76. package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.d.ts +7 -1
  77. package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +23 -7
  78. package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.d.ts +0 -1
  79. package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +6 -54
  80. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +17 -5
  81. package/src/Utilities/Interface/MessagePopups.d.ts +0 -4
  82. package/src/Utilities/ObjectFactory.d.ts +4 -2
  83. package/src/Utilities/ObjectFactory.js +16 -3
  84. package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +25 -0
  85. package/src/Utilities/Services/AggregatedScalarLiveValue.js +103 -0
  86. package/src/Utilities/Services/AlertService.d.ts +0 -1
  87. package/src/Utilities/Services/AlertService.js +5 -17
  88. package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +4 -4
  89. package/src/Utilities/Services/CalculatedColumnExpressionService.js +29 -154
  90. package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +2 -2
  91. package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +6 -3
  92. package/src/Utilities/Services/QueryLanguageService.d.ts +6 -3
  93. package/src/Utilities/Services/QueryLanguageService.js +23 -6
  94. package/src/Utilities/Services/ReportService.js +47 -46
  95. package/src/View/AdaptableView.js +1 -2
  96. package/src/View/CalculatedColumn/Utilities/getCalculatedColumnSettingsTags.d.ts +2 -0
  97. package/src/View/CalculatedColumn/Utilities/{getCalculatedColumnSettingTags.js → getCalculatedColumnSettingsTags.js} +3 -3
  98. package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.d.ts +10 -0
  99. package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +80 -0
  100. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +20 -11
  101. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.d.ts +1 -2
  102. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +9 -52
  103. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +17 -6
  104. package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +42 -6
  105. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +1 -1
  106. package/src/View/Components/EntityRulesEditor/index.js +26 -5
  107. package/src/View/Components/FilterForm/FilterForm.js +8 -4
  108. package/src/View/Components/FilterForm/ListBoxFilterForm.js +1 -0
  109. package/src/View/Components/FilterForm/QuickFilterForm.js +10 -6
  110. package/src/View/Components/PermittedValuesSelector/PermitedValuesSelector.d.ts +9 -0
  111. package/src/View/Components/PermittedValuesSelector/PermitedValuesSelector.js +28 -0
  112. package/src/View/Components/PermittedValuesSelector/index.d.ts +1 -0
  113. package/src/View/Components/PermittedValuesSelector/index.js +5 -0
  114. package/src/View/Components/Popups/AdaptablePopup/Navigation.js +2 -2
  115. package/src/View/Components/Popups/AdaptableToaster.js +2 -7
  116. package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +0 -1
  117. package/src/View/Components/Popups/WindowPopups/windowFactory.js +1 -4
  118. package/src/View/Export/ExportViewPanel.d.ts +1 -2
  119. package/src/View/Export/ExportViewPanel.js +2 -6
  120. package/src/View/Export/Wizard/ReportColumnTypeWizard.d.ts +1 -2
  121. package/src/View/Export/Wizard/ReportColumnTypeWizard.js +11 -12
  122. package/src/View/Export/Wizard/ReportRowTypeWizard.d.ts +1 -2
  123. package/src/View/Export/Wizard/ReportRowTypeWizard.js +12 -13
  124. package/src/View/Export/Wizard/ReportSettingsWizard.js +1 -2
  125. package/src/View/Filter/FilterViewPanel.js +20 -4
  126. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
  127. package/src/View/Layout/Wizard/{LayoutEditor → Components}/ColumnLabels.d.ts +0 -0
  128. package/src/View/Layout/Wizard/{LayoutEditor → Components}/ColumnLabels.js +0 -0
  129. package/src/View/Layout/Wizard/LayoutWizard.js +1 -0
  130. package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +1 -0
  131. package/src/View/Layout/Wizard/sections/AggregationsSection.js +69 -8
  132. package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -1
  133. package/src/View/Query/QueryViewPanel.js +1 -1
  134. package/src/agGrid/Adaptable.d.ts +10 -3
  135. package/src/agGrid/Adaptable.js +211 -142
  136. package/src/agGrid/agGridHelper.d.ts +1 -0
  137. package/src/agGrid/agGridHelper.js +5 -3
  138. package/src/agGrid/agGridMenuHelper.d.ts +1 -0
  139. package/src/agGrid/agGridMenuHelper.js +4 -2
  140. package/src/agGrid/weightedAverage.d.ts +6 -0
  141. package/src/agGrid/weightedAverage.js +66 -0
  142. package/src/components/ExpressionEditor/BaseEditorInput.d.ts +1 -0
  143. package/src/components/ExpressionEditor/BaseEditorInput.js +2 -3
  144. package/src/components/ExpressionEditor/EditorInput.d.ts +1 -1
  145. package/src/components/ExpressionEditor/EditorInput.js +24 -4
  146. package/src/components/ExpressionEditor/{EditorInputReactive.d.ts → EditorInputWithWhereClause.d.ts} +3 -3
  147. package/src/components/ExpressionEditor/{EditorInputReactive.js → EditorInputWithWhereClause.js} +6 -5
  148. package/src/components/ExpressionEditor/editorButtonsAggregatedBoolean.d.ts +2 -0
  149. package/src/components/ExpressionEditor/{editorButtonsReactive.js → editorButtonsAggregatedBoolean.js} +22 -37
  150. package/src/components/ExpressionEditor/editorButtonsAggregatedScalar.js +5 -10
  151. package/src/components/ExpressionEditor/editorButtonsCumulativeAggregatedScalar.d.ts +2 -0
  152. package/src/components/ExpressionEditor/editorButtonsCumulativeAggregatedScalar.js +50 -0
  153. package/src/components/ExpressionEditor/editorButtonsObservable.d.ts +2 -0
  154. package/src/components/ExpressionEditor/editorButtonsObservable.js +40 -0
  155. package/src/components/ExpressionEditor/index.d.ts +1 -1
  156. package/src/components/ExpressionEditor/index.js +26 -5
  157. package/src/metamodel/adaptable.metamodel.d.ts +55 -1
  158. package/src/metamodel/adaptable.metamodel.js +1 -1
  159. package/src/types.d.ts +3 -3
  160. package/version.d.ts +1 -1
  161. package/version.js +1 -1
  162. package/src/View/CalculatedColumn/Utilities/getCalculatedColumnSettingTags.d.ts +0 -2
  163. package/src/View/Layout/LayoutEditorStandalonePopup.d.ts +0 -3
  164. package/src/View/Layout/LayoutEditorStandalonePopup.js +0 -78
  165. package/src/View/Layout/Wizard/LayoutEditor/ColumnList.d.ts +0 -27
  166. package/src/View/Layout/Wizard/LayoutEditor/ColumnList.js +0 -86
  167. package/src/View/Layout/Wizard/LayoutEditor/ColumnSortList.d.ts +0 -16
  168. package/src/View/Layout/Wizard/LayoutEditor/ColumnSortList.js +0 -89
  169. package/src/View/Layout/Wizard/LayoutEditor/PivotList.d.ts +0 -15
  170. package/src/View/Layout/Wizard/LayoutEditor/PivotList.js +0 -70
  171. package/src/View/Layout/Wizard/LayoutEditor/RowGroupsList.d.ts +0 -15
  172. package/src/View/Layout/Wizard/LayoutEditor/RowGroupsList.js +0 -70
  173. package/src/View/Layout/Wizard/LayoutEditor/droppableIds.d.ts +0 -7
  174. package/src/View/Layout/Wizard/LayoutEditor/droppableIds.js +0 -11
  175. package/src/View/Layout/Wizard/LayoutEditor/getItemStyle.d.ts +0 -6
  176. package/src/View/Layout/Wizard/LayoutEditor/getItemStyle.js +0 -26
  177. package/src/View/Layout/Wizard/LayoutEditor/index.d.ts +0 -9
  178. package/src/View/Layout/Wizard/LayoutEditor/index.js +0 -367
  179. package/src/View/Layout/Wizard/LayoutEditor/reducer.d.ts +0 -28
  180. package/src/View/Layout/Wizard/LayoutEditor/reducer.js +0 -46
  181. package/src/View/Layout/Wizard/LayoutEditor/utils.d.ts +0 -10
  182. package/src/View/Layout/Wizard/LayoutEditor/utils.js +0 -14
  183. package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +0 -30
  184. package/src/View/Layout/Wizard/LayoutEditorWizard.js +0 -132
  185. package/src/components/ExpressionEditor/editorButtonsReactive.d.ts +0 -2
@@ -19,7 +19,7 @@ const DocumentationLinkConstants_1 = require("../../Utilities/Constants/Document
19
19
  const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
20
20
  const icons_1 = require("../icons");
21
21
  function BaseEditorInput(props) {
22
- const { expressionFunctions, testData, style } = props;
22
+ const { expressionFunctions, testData, style, type } = props;
23
23
  const { ref: textAreaRefCallback, selectionStart, selectionEnd } = useSelectionRange_1.useSelectionRange();
24
24
  const cursor = selectionStart === selectionEnd ? selectionStart : null;
25
25
  let result;
@@ -87,7 +87,6 @@ function BaseEditorInput(props) {
87
87
  props.onSelectedFunctionChange(selectedFunctionName ? expressionFunctions[selectedFunctionName] : null);
88
88
  }
89
89
  }, [selectedFunctionName]);
90
- const [functionsDropdownExpanded, setFunctionsDropdownExpanded] = react_1.useState(false);
91
90
  const functionsDropdown = (React.createElement(OverlayTrigger_1.default, { render: () => (React.createElement(rebass_1.Flex, { flexDirection: "column", p: 2, style: {
92
91
  fontSize: 'var(--ab-font-size-2)',
93
92
  border: '1px solid var(--ab-color-primarydark)',
@@ -124,7 +123,7 @@ function BaseEditorInput(props) {
124
123
  background: 'var(--ab-color-action-add)',
125
124
  marginRight: 5,
126
125
  }, tooltip: 'Learn how to use the Expression Editor', onClick: () => window.open(DocumentationLinkConstants_1.ExpressionEditorDocsLink, '_blank') })))),
127
- React.createElement(Textarea_1.default, { ref: textAreaRefCallback, value: props.value || '', placeholder: props.placeholder || 'Create Query', disabled: props.disabled || false, className: "ab-ExpressionEditor__textarea", autoFocus: true, spellCheck: "false", onChange: (event) => {
126
+ React.createElement(Textarea_1.default, { "data-name": `expression-input-${type}`, ref: textAreaRefCallback, value: props.value || '', placeholder: props.placeholder || 'Create Query', disabled: props.disabled || false, className: "ab-ExpressionEditor__textarea", autoFocus: true, spellCheck: "false", onChange: (event) => {
128
127
  props.onChange(event.target.value);
129
128
  }, style: Object.assign({ width: '100%', minHeight: 100, fontFamily: 'monospace', resize: 'vertical', fontSize: '1rem', padding: 'var(--ab-space-2)' }, style) }),
130
129
  props.isFullExpression !== true && (React.createElement(HelpBlock_1.default, { mt: 2, mb: 2, p: 2, style: { fontSize: 'var(--ab-font-size-3)' } },
@@ -2,7 +2,7 @@
2
2
  import { AdaptableApi } from '../../Api/AdaptableApi';
3
3
  import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
4
4
  interface EditorInputProps {
5
- type: 'boolean' | 'scalar' | 'aggregatedScalar';
5
+ type: 'boolean' | 'scalar' | 'aggregatedScalar' | 'cumulativeAggregatedScalar';
6
6
  module: AdaptableModule;
7
7
  value: string;
8
8
  onChange: (value: string) => void;
@@ -7,15 +7,35 @@ const editorButtonsSearch_1 = require("./editorButtonsSearch");
7
7
  const EditorContext_1 = require("./EditorContext");
8
8
  const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
9
9
  const editorButtonsAggregatedScalar_1 = require("./editorButtonsAggregatedScalar");
10
+ const react_1 = require("react");
11
+ const aggregatedScalarExpressionFunctions_1 = require("../../Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions");
12
+ const editorButtonsCumulativeAggregatedScalar_1 = require("./editorButtonsCumulativeAggregatedScalar");
10
13
  function EditorInput(props) {
11
14
  const moduleExpressionFunctions = props.api.internalApi
12
15
  .getQueryLanguageService()
13
16
  .getModuleExpressionFunctions(props.module);
14
- const expressionFunctions = props.type === 'aggregatedScalar'
15
- ? moduleExpressionFunctions.aggregatedScalarFunctions
16
- : Object.assign(Object.assign({}, moduleExpressionFunctions.booleanFunctions), moduleExpressionFunctions.scalarFunctions);
17
+ const getFilteredAggregatedExpressionFunctions = (availableAggregatedExpressionFunctions, type) => {
18
+ const sourceExpressionFunctions = type === 'aggregatedScalar'
19
+ ? aggregatedScalarExpressionFunctions_1.aggregatedExpressionFunctions
20
+ : aggregatedScalarExpressionFunctions_1.cumulativeAggregatedExpressionFunctions;
21
+ return Object.keys(availableAggregatedExpressionFunctions)
22
+ .filter((key) => sourceExpressionFunctions.includes(key))
23
+ .reduce((obj, key) => {
24
+ obj[key] = availableAggregatedExpressionFunctions[key];
25
+ return obj;
26
+ }, {});
27
+ };
28
+ const expressionFunctions = react_1.useMemo(() => {
29
+ return props.type === 'aggregatedScalar' || props.type === 'cumulativeAggregatedScalar'
30
+ ? getFilteredAggregatedExpressionFunctions(moduleExpressionFunctions.aggregatedScalarFunctions, props.type)
31
+ : Object.assign(Object.assign({}, moduleExpressionFunctions.booleanFunctions), moduleExpressionFunctions.scalarFunctions);
32
+ }, [props.type]);
17
33
  const { setSelectedFunction } = EditorContext_1.useExpressionEditor();
18
34
  const queryName = `${StringExtensions_1.default.CapitaliseFirstLetter(props.type)}Query`;
19
- return (React.createElement(BaseEditorInput_1.BaseEditorInput, { value: props.value, placeholder: `Create ${queryName}`, onChange: props.onChange, onSelectedFunctionChange: setSelectedFunction, expressionFunctions: expressionFunctions, editorButtons: props.type === 'aggregatedScalar' ? editorButtonsAggregatedScalar_1.editorButtonsAggregatedScalar : editorButtonsSearch_1.editorButtonsSearch, testData: props.testData, isFullExpression: props.isFullExpression, hideResultPreview: props.type === 'aggregatedScalar', api: props.api }));
35
+ return (React.createElement(BaseEditorInput_1.BaseEditorInput, { type: 'main', value: props.value, placeholder: `Create ${queryName}`, onChange: props.onChange, onSelectedFunctionChange: setSelectedFunction, expressionFunctions: expressionFunctions, editorButtons: props.type === 'aggregatedScalar'
36
+ ? editorButtonsAggregatedScalar_1.editorButtonsAggregatedScalar
37
+ : props.type === 'cumulativeAggregatedScalar'
38
+ ? editorButtonsCumulativeAggregatedScalar_1.editorButtonsCumulativeAggregatedScalar
39
+ : editorButtonsSearch_1.editorButtonsSearch, testData: props.testData, isFullExpression: props.isFullExpression, hideResultPreview: props.type === 'aggregatedScalar' || props.type === 'cumulativeAggregatedScalar', api: props.api }));
20
40
  }
21
41
  exports.default = EditorInput;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { AdaptableApi } from '../../Api/AdaptableApi';
3
3
  import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
4
- interface EditorInputReactiveProps {
4
+ interface EditorInputWithWhereClauseProps {
5
5
  type: 'observable' | 'aggregatedBoolean';
6
6
  module: AdaptableModule;
7
7
  value: string;
@@ -10,5 +10,5 @@ interface EditorInputReactiveProps {
10
10
  isFullExpression?: boolean;
11
11
  api: AdaptableApi;
12
12
  }
13
- declare function EditorInputReactive(props: EditorInputReactiveProps): JSX.Element;
14
- export default EditorInputReactive;
13
+ declare function EditorInputWithWhereClause(props: EditorInputWithWhereClauseProps): JSX.Element;
14
+ export default EditorInputWithWhereClause;
@@ -8,10 +8,11 @@ const rebass_1 = require("rebass");
8
8
  const editorButtonsSearch_1 = require("./editorButtonsSearch");
9
9
  const useProperty_1 = tslib_1.__importDefault(require("../utils/useProperty"));
10
10
  const StringExtensions_1 = require("../../Utilities/Extensions/StringExtensions");
11
- const editorButtonsReactive_1 = require("./editorButtonsReactive");
11
+ const editorButtonsObservable_1 = require("./editorButtonsObservable");
12
12
  const CheckBox_1 = require("../CheckBox");
13
13
  const EditorContext_1 = require("./EditorContext");
14
- function EditorInputReactive(props) {
14
+ const editorButtonsAggregatedBoolean_1 = require("./editorButtonsAggregatedBoolean");
15
+ function EditorInputWithWhereClause(props) {
15
16
  const moduleExpressionFunctions = props.api.internalApi
16
17
  .getQueryLanguageService()
17
18
  .getModuleExpressionFunctions(props.module);
@@ -45,7 +46,7 @@ function EditorInputReactive(props) {
45
46
  const [showWhereClause, setShowWhereClause] = react_1.useState(StringExtensions_1.IsNotNullOrEmptyOrWhiteSpace(whereClauseValue));
46
47
  const queryName = `${StringExtensions_1.CapitaliseFirstLetter(props.type)}Query`;
47
48
  return (React.createElement(rebass_1.Flex, { flexDirection: "column", alignItems: "start" },
48
- React.createElement(BaseEditorInput_1.BaseEditorInput, { value: reactiveValue || '', placeholder: `Create ${queryName}`, onChange: updateReactiveValue, onSelectedFunctionChange: setSelectedFunction, expressionFunctions: reactiveExpressionFns, editorButtons: editorButtonsReactive_1.editorButtonsReactive, testData: props.testData, isFullExpression: true, hideResultPreview: true, api: props.api, style: { height: '75px' } }),
49
+ React.createElement(BaseEditorInput_1.BaseEditorInput, { type: 'main', value: reactiveValue || '', placeholder: `Create ${queryName}`, onChange: updateReactiveValue, onSelectedFunctionChange: setSelectedFunction, expressionFunctions: reactiveExpressionFns, editorButtons: props.type === 'observable' ? editorButtonsObservable_1.editorButtonsObservable : editorButtonsAggregatedBoolean_1.editorButtonsAggregatedBoolean, testData: props.testData, isFullExpression: true, hideResultPreview: true, api: props.api, style: { height: '75px' } }),
49
50
  React.createElement(CheckBox_1.CheckBox, { disabled: StringExtensions_1.IsNullOrEmptyOrWhiteSpace(reactiveValue), checked: showWhereClause, style: { alignItems: 'center' }, onChange: (checked) => {
50
51
  setShowWhereClause(checked);
51
52
  if (!checked) {
@@ -53,6 +54,6 @@ function EditorInputReactive(props) {
53
54
  updateWhereClauseValue(null);
54
55
  }
55
56
  }, pl: 3 }, "WHERE"),
56
- showWhereClause && (React.createElement(BaseEditorInput_1.BaseEditorInput, { disabled: StringExtensions_1.IsNullOrEmptyOrWhiteSpace(reactiveValue), value: whereClauseValue || '', placeholder: `Create BooleanQuery which narrows down the scope of the ${queryName}`, onChange: updateWhereClauseValue, onSelectedFunctionChange: setSelectedFunction, expressionFunctions: whereClauseExpressionsFns, editorButtons: editorButtonsSearch_1.editorButtonsSearch, testData: props.testData, isFullExpression: true, hideResultPreview: true, api: props.api, style: { height: '75px' } }))));
57
+ showWhereClause && (React.createElement(BaseEditorInput_1.BaseEditorInput, { type: 'secondary', disabled: StringExtensions_1.IsNullOrEmptyOrWhiteSpace(reactiveValue), value: whereClauseValue || '', placeholder: `Create BooleanQuery which narrows down the scope of the ${queryName}`, onChange: updateWhereClauseValue, onSelectedFunctionChange: setSelectedFunction, expressionFunctions: whereClauseExpressionsFns, editorButtons: editorButtonsSearch_1.editorButtonsSearch, testData: props.testData, isFullExpression: true, hideResultPreview: true, api: props.api, style: { height: '75px' } }))));
57
58
  }
58
- exports.default = EditorInputReactive;
59
+ exports.default = EditorInputWithWhereClause;
@@ -0,0 +1,2 @@
1
+ import { OperatorEditorButton } from './BaseEditorInput';
2
+ export declare const editorButtonsAggregatedBoolean: OperatorEditorButton[];
@@ -1,12 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.editorButtonsReactive = void 0;
4
- exports.editorButtonsReactive = [
3
+ exports.editorButtonsAggregatedBoolean = void 0;
4
+ exports.editorButtonsAggregatedBoolean = [
5
5
  {
6
6
  functionName: 'SUM',
7
7
  data: 'SUM()',
8
8
  text: 'Sum',
9
9
  },
10
+ {
11
+ functionName: 'MIN',
12
+ data: 'MIN()',
13
+ text: 'Min',
14
+ },
15
+ {
16
+ functionName: 'MAX',
17
+ data: 'MAX()',
18
+ text: 'Max',
19
+ },
20
+ {
21
+ functionName: 'AVG',
22
+ data: 'AVG()',
23
+ text: 'Average',
24
+ },
25
+ {
26
+ functionName: 'GROUP_BY',
27
+ data: 'GROUP_BY()',
28
+ text: 'GroupBy',
29
+ },
10
30
  {
11
31
  functionName: 'EQ',
12
32
  data: '=',
@@ -37,39 +57,4 @@ exports.editorButtonsReactive = [
37
57
  data: '>=',
38
58
  icon: 'greater-than-or-equal',
39
59
  },
40
- {
41
- functionName: 'ROW_CHANGE',
42
- data: 'ROW_CHANGE()',
43
- text: 'RowChange',
44
- },
45
- {
46
- functionName: 'GRID_CHANGE',
47
- data: 'GRID_CHANGE()',
48
- text: 'GridChange',
49
- },
50
- {
51
- functionName: 'COUNT',
52
- data: 'COUNT()',
53
- text: 'Count',
54
- },
55
- {
56
- functionName: 'NONE',
57
- data: 'NONE()',
58
- text: 'None',
59
- },
60
- {
61
- functionName: 'MIN',
62
- data: 'MIN()',
63
- text: 'Min',
64
- },
65
- {
66
- functionName: 'MAX',
67
- data: 'MAX()',
68
- text: 'Max',
69
- },
70
- {
71
- functionName: 'TIMEFRAME',
72
- data: 'TIMEFRAME()',
73
- text: 'Timeframe',
74
- },
75
60
  ];
@@ -32,19 +32,14 @@ exports.editorButtonsAggregatedScalar = [
32
32
  data: 'QUANT()',
33
33
  text: 'Quantile',
34
34
  },
35
+ {
36
+ functionName: 'WEIGHT',
37
+ data: 'WEIGHT()',
38
+ text: 'Weight',
39
+ },
35
40
  {
36
41
  functionName: 'GROUP_BY',
37
42
  data: 'GROUP_BY()',
38
43
  text: 'GroupBy',
39
44
  },
40
- {
41
- functionName: 'CUMUL',
42
- data: 'CUMUL()',
43
- text: 'Cumulate',
44
- },
45
- {
46
- functionName: 'OVER',
47
- data: 'OVER()',
48
- text: 'Over',
49
- },
50
45
  ];
@@ -0,0 +1,2 @@
1
+ import { OperatorEditorButton } from './BaseEditorInput';
2
+ export declare const editorButtonsCumulativeAggregatedScalar: OperatorEditorButton[];
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.editorButtonsCumulativeAggregatedScalar = void 0;
4
+ exports.editorButtonsCumulativeAggregatedScalar = [
5
+ {
6
+ functionName: 'CUMUL',
7
+ data: 'CUMUL()',
8
+ text: 'Cumulate',
9
+ },
10
+ {
11
+ functionName: 'SUM',
12
+ data: 'SUM()',
13
+ text: 'Sum',
14
+ },
15
+ {
16
+ functionName: 'PERCENTAGE',
17
+ data: 'PERCENTAGE()',
18
+ text: 'Percentage',
19
+ },
20
+ {
21
+ functionName: 'AVG',
22
+ data: 'AVG()',
23
+ text: 'Average',
24
+ },
25
+ {
26
+ functionName: 'MIN',
27
+ data: 'MIN()',
28
+ text: 'Min',
29
+ },
30
+ {
31
+ functionName: 'MAX',
32
+ data: 'MAX()',
33
+ text: 'Max',
34
+ },
35
+ {
36
+ functionName: 'OVER',
37
+ data: 'OVER()',
38
+ text: 'Over',
39
+ },
40
+ {
41
+ functionName: 'WEIGHT',
42
+ data: 'WEIGHT()',
43
+ text: 'Weight',
44
+ },
45
+ {
46
+ functionName: 'GROUP_BY',
47
+ data: 'GROUP_BY()',
48
+ text: 'GroupBy',
49
+ },
50
+ ];
@@ -0,0 +1,2 @@
1
+ import { OperatorEditorButton } from './BaseEditorInput';
2
+ export declare const editorButtonsObservable: OperatorEditorButton[];
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.editorButtonsObservable = void 0;
4
+ exports.editorButtonsObservable = [
5
+ {
6
+ functionName: 'ROW_CHANGE',
7
+ data: 'ROW_CHANGE()',
8
+ text: 'RowChange',
9
+ },
10
+ {
11
+ functionName: 'GRID_CHANGE',
12
+ data: 'GRID_CHANGE()',
13
+ text: 'GridChange',
14
+ },
15
+ {
16
+ functionName: 'COUNT',
17
+ data: 'COUNT()',
18
+ text: 'Count',
19
+ },
20
+ {
21
+ functionName: 'NONE',
22
+ data: 'NONE()',
23
+ text: 'None',
24
+ },
25
+ {
26
+ functionName: 'MIN',
27
+ data: 'MIN()',
28
+ text: 'Min',
29
+ },
30
+ {
31
+ functionName: 'MAX',
32
+ data: 'MAX()',
33
+ text: 'Max',
34
+ },
35
+ {
36
+ functionName: 'TIMEFRAME',
37
+ data: 'TIMEFRAME()',
38
+ text: 'Timeframe',
39
+ },
40
+ ];
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { AdaptableApi, AdaptableColumn, AdaptableModule } from '../../types';
3
3
  import { NamedQuery } from '../../PredefinedConfig/QueryState';
4
- declare type ExpressionEditorType = 'boolean' | 'scalar' | 'observable' | 'aggregatedBoolean' | 'aggregatedScalar';
4
+ declare type ExpressionEditorType = 'boolean' | 'scalar' | 'observable' | 'aggregatedBoolean' | 'aggregatedScalar' | 'cumulativeAggregatedScalar';
5
5
  interface ExpressionEditorProps {
6
6
  value: string;
7
7
  onChange: (value: string) => void;
@@ -13,7 +13,7 @@ const EditorButton_1 = tslib_1.__importDefault(require("./EditorButton"));
13
13
  const AdaptableInput_1 = tslib_1.__importDefault(require("../../View/Components/AdaptableInput"));
14
14
  const Radio_1 = tslib_1.__importDefault(require("../Radio"));
15
15
  const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
16
- const EditorInputReactive_1 = tslib_1.__importDefault(require("./EditorInputReactive"));
16
+ const EditorInputWithWhereClause_1 = tslib_1.__importDefault(require("./EditorInputWithWhereClause"));
17
17
  const EditorInput_1 = tslib_1.__importDefault(require("./EditorInput"));
18
18
  const EditorContext_1 = require("./EditorContext");
19
19
  const ExpressionFunctionDocumentation_1 = require("./ExpressionFunctionDocumentation");
@@ -24,6 +24,7 @@ const CodeBlock_1 = require("../CodeBlock");
24
24
  const NamedQueryContext_1 = require("./NamedQueryContext");
25
25
  const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
26
26
  const DateHelper_1 = require("../../Utilities/Helpers/DateHelper");
27
+ const AdaptableFormControlTextClear_1 = require("../../View/Components/Forms/AdaptableFormControlTextClear");
27
28
  function ExpressionEditor(props) {
28
29
  var _a;
29
30
  const { type, module } = props;
@@ -35,11 +36,11 @@ function ExpressionEditor(props) {
35
36
  const { namedQuery, setNamedQuery } = NamedQueryContext_1.useNamedQueryContext();
36
37
  const textAreaRef = react_1.useRef(null);
37
38
  const allowSaveNamedQuery = (_a = props.allowSaveNamedQuery) !== null && _a !== void 0 ? _a : type === 'boolean';
38
- const editorInput = type === 'observable' || type === 'aggregatedBoolean' ? (React.createElement(EditorInputReactive_1.default, { type: type, module: module, value: props.value, onChange: (value) => {
39
+ const editorInput = type === 'observable' || type === 'aggregatedBoolean' ? (React.createElement(EditorInputWithWhereClause_1.default, { type: type, module: module, value: props.value, onChange: (value) => {
39
40
  setExpressionText(value);
40
41
  props.onChange(value);
41
42
  }, testData: data, api: props.api })) : (
42
- // 'boolean','scalar' or 'aggregatedScalar'
43
+ // 'boolean','scalar' or 'aggregatedScalar'/'cumulativeAggregatedScalar'
43
44
  React.createElement(EditorInput_1.default, { type: type, module: module, value: props.value, onChange: (value) => {
44
45
  setExpressionText(value);
45
46
  props.onChange(value);
@@ -99,6 +100,7 @@ function ExpressionEditor(props) {
99
100
  ? new Date(colValue).toISOString().substr(0, 10)
100
101
  : '';
101
102
  };
103
+ const [searchInputValue, setSearchInputValue] = React.useState('');
102
104
  const dataTableEditor = (React.createElement(React.Fragment, null,
103
105
  React.createElement(rebass_1.Flex, { flexDirection: "column", alignItems: "start", style: { marginTop: 2 } },
104
106
  React.createElement(CheckBox_1.CheckBox, { checked: showColumnIds, onChange: (checked) => setShowColumnIds(checked), style: {
@@ -106,8 +108,17 @@ function ExpressionEditor(props) {
106
108
  margin: 0,
107
109
  paddingTop: 'var(--ab-space-1)',
108
110
  paddingBottom: 'var(--ab-space-1)',
109
- } }, 'Show Column IDs')),
110
- React.createElement(FormLayout_1.default, { className: "ab-ExpressionEditor__columns", gridColumnGap: "var(--ab-space-1)", gridRowGap: "var(--ab-space-1)", sizes: ['auto', '100px'], style: { alignItems: 'stretch' } }, queryableColumns.map((column) => (React.createElement(FormLayout_1.FormRow, { key: column.columnId, label: React.createElement(EditorButton_1.default, { width: "100%", height: "100%", style: {
111
+ } }, 'Show Column IDs'),
112
+ React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { value: searchInputValue, OnTextChange: setSearchInputValue, placeholder: "Filter columns...", style: { flex: 1, marginBottom: 3 } })),
113
+ React.createElement(FormLayout_1.default, { className: "ab-ExpressionEditor__columns", gridColumnGap: "var(--ab-space-1)", gridRowGap: "var(--ab-space-1)", sizes: ['auto', '100px'], style: { alignItems: 'stretch' } }, queryableColumns
114
+ .filter((column) => {
115
+ if (!searchInputValue) {
116
+ return true;
117
+ }
118
+ return (column.columnId.includes(searchInputValue) ||
119
+ column.friendlyName.includes(searchInputValue));
120
+ })
121
+ .map((column) => (React.createElement(FormLayout_1.FormRow, { key: column.columnId, label: React.createElement(EditorButton_1.default, { width: "100%", height: "100%", style: {
111
122
  background: 'var(--ab-color-primary)',
112
123
  cursor: 'grab',
113
124
  marginRight: 'var(--ab-space-1)',
@@ -219,6 +230,15 @@ const renderQueryHints = (type) => {
219
230
  examples.push({
220
231
  code: 'AVG([stargazers_count], GROUP_BY([language]))',
221
232
  description: 'Average popularity (number of stars) of all the Github repositories, grouped by programming language',
233
+ }, {
234
+ code: 'MAX([PnL]), GROUP_BY([currency], [country])',
235
+ description: "The maximum 'PnL' value, grouped by currency and country",
236
+ });
237
+ }
238
+ if (type === 'cumulativeAggregatedScalar') {
239
+ examples.push({
240
+ code: 'CUMUL(AVG([stargazers_count], GROUP_BY([language])), OVER([TradeDate]))',
241
+ description: "The cumulative average popularity (number of stars) of all the Github repositories, grouped by programming language in the order given by the 'TradeDate' column",
222
242
  }, {
223
243
  code: 'CUMUL( SUM([PnL]), OVER([TradeDate]))',
224
244
  description: "The cumulative sum of all 'PnL' columns in the order given by the 'TradeDate' column",
@@ -247,4 +267,5 @@ const queryDocumentationLinks = {
247
267
  observable: DocumentationLinkConstants_1.ObservableQueryDocsLink,
248
268
  aggregatedBoolean: DocumentationLinkConstants_1.AggregatedBooleanQueryDocsLink,
249
269
  aggregatedScalar: DocumentationLinkConstants_1.AggregatedScalarQueryDocsLink,
270
+ cumulativeAggregatedScalar: DocumentationLinkConstants_1.CumulativeAggregatedScalarQueryDocsLink,
250
271
  };
@@ -245,6 +245,11 @@ export declare const ADAPTABLE_METAMODEL: {
245
245
  reference: string;
246
246
  }[];
247
247
  };
248
+ AdaptableClearStateFunction: {
249
+ name: string;
250
+ kind: string;
251
+ description: string;
252
+ };
248
253
  AdaptableColumn: {
249
254
  name: string;
250
255
  kind: string;
@@ -733,6 +738,11 @@ export declare const ADAPTABLE_METAMODEL: {
733
738
  reference: string;
734
739
  }[];
735
740
  };
741
+ AdaptableSaveStateFunction: {
742
+ name: string;
743
+ kind: string;
744
+ description: string;
745
+ };
736
746
  AdaptableScope: {
737
747
  name: string;
738
748
  kind: string;
@@ -783,6 +793,24 @@ export declare const ADAPTABLE_METAMODEL: {
783
793
  reference: string;
784
794
  })[];
785
795
  };
796
+ AdaptableStateFunctionConfig: {
797
+ name: string;
798
+ kind: string;
799
+ description: string;
800
+ properties: ({
801
+ name: string;
802
+ kind: string;
803
+ description: string;
804
+ uiLabel: string;
805
+ isOptional?: undefined;
806
+ } | {
807
+ name: string;
808
+ kind: string;
809
+ description: string;
810
+ uiLabel: string;
811
+ isOptional: boolean;
812
+ })[];
813
+ };
786
814
  AdaptableStatusBar: {
787
815
  name: string;
788
816
  kind: string;
@@ -1205,6 +1233,13 @@ export declare const ADAPTABLE_METAMODEL: {
1205
1233
  uiLabel: string;
1206
1234
  isOptional: boolean;
1207
1235
  reference?: undefined;
1236
+ } | {
1237
+ name: string;
1238
+ kind: string;
1239
+ description: string;
1240
+ uiLabel: string;
1241
+ reference: string;
1242
+ isOptional?: undefined;
1208
1243
  })[];
1209
1244
  };
1210
1245
  CalculatedColumnApi: {
@@ -1227,7 +1262,7 @@ export declare const ADAPTABLE_METAMODEL: {
1227
1262
  kind: string;
1228
1263
  description: string;
1229
1264
  uiLabel: string;
1230
- isOptional: boolean;
1265
+ isOptional?: undefined;
1231
1266
  defaultValue?: undefined;
1232
1267
  } | {
1233
1268
  name: string;
@@ -3475,12 +3510,21 @@ export declare const ADAPTABLE_METAMODEL: {
3475
3510
  description: string;
3476
3511
  uiLabel: string;
3477
3512
  isOptional: boolean;
3513
+ reference: string;
3514
+ } | {
3515
+ name: string;
3516
+ kind: string;
3517
+ description: string;
3518
+ uiLabel: string;
3519
+ isOptional: boolean;
3520
+ reference?: undefined;
3478
3521
  } | {
3479
3522
  name: string;
3480
3523
  kind: string;
3481
3524
  description: string;
3482
3525
  uiLabel: string;
3483
3526
  isOptional?: undefined;
3527
+ reference?: undefined;
3484
3528
  })[];
3485
3529
  };
3486
3530
  LayoutApi: {
@@ -4186,6 +4230,11 @@ export declare const ADAPTABLE_METAMODEL: {
4186
4230
  isOptional?: undefined;
4187
4231
  })[];
4188
4232
  };
4233
+ ReportColumnScope: {
4234
+ name: string;
4235
+ kind: string;
4236
+ description: string;
4237
+ };
4189
4238
  ReportContext: {
4190
4239
  name: string;
4191
4240
  kind: string;
@@ -4209,6 +4258,11 @@ export declare const ADAPTABLE_METAMODEL: {
4209
4258
  uiLabel: string;
4210
4259
  }[];
4211
4260
  };
4261
+ ReportRowScope: {
4262
+ name: string;
4263
+ kind: string;
4264
+ description: string;
4265
+ };
4212
4266
  ReportSchedule: {
4213
4267
  name: string;
4214
4268
  kind: string;