@adaptabletools/adaptable 13.0.0-canary.2 → 13.0.0-canary.20

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 (263) hide show
  1. package/agGrid.d.ts +23 -1
  2. package/agGrid.js +23 -1
  3. package/base.css +1232 -733
  4. package/base.css.map +1 -0
  5. package/bundle.cjs.js +191 -174
  6. package/index.css +1250 -734
  7. package/index.css.map +1 -0
  8. package/package.json +5 -5
  9. package/publishTimestamp.d.ts +1 -1
  10. package/publishTimestamp.js +1 -1
  11. package/src/AdaptableInterfaces/IAdaptable.d.ts +7 -3
  12. package/src/AdaptableOptions/AdaptableOptions.d.ts +0 -2
  13. package/src/AdaptableOptions/AdaptableQLOptions.d.ts +136 -27
  14. package/src/AdaptableOptions/ExportOptions.d.ts +2 -2
  15. package/src/AdaptableOptions/FinsemblePluginOptions.d.ts +32 -0
  16. package/src/AdaptableOptions/FinsemblePluginOptions.js +2 -0
  17. package/src/AdaptableOptions/LayoutOptions.d.ts +2 -1
  18. package/src/Api/AdaptableApi.d.ts +2 -0
  19. package/src/Api/ColumnApi.d.ts +8 -2
  20. package/src/Api/ConditionalStyleApi.d.ts +20 -42
  21. package/src/Api/ConfigApi.d.ts +1 -2
  22. package/src/Api/ExportApi.d.ts +6 -6
  23. package/src/Api/FinsembleApi.d.ts +10 -0
  24. package/src/Api/FinsembleApi.js +2 -0
  25. package/src/Api/FormatColumnApi.d.ts +76 -59
  26. package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -0
  27. package/src/Api/Implementation/AdaptableApiImpl.js +2 -0
  28. package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -1
  29. package/src/Api/Implementation/ColumnApiImpl.js +18 -14
  30. package/src/Api/Implementation/ExportApiImpl.d.ts +4 -4
  31. package/src/Api/Implementation/ExportApiImpl.js +14 -14
  32. package/src/Api/Implementation/FormatColumnApiImpl.d.ts +36 -17
  33. package/src/Api/Implementation/FormatColumnApiImpl.js +101 -185
  34. package/src/Api/Implementation/PluginsApiImpl.d.ts +2 -0
  35. package/src/Api/Implementation/PluginsApiImpl.js +6 -0
  36. package/src/Api/Implementation/QueryLanguageApiImpl.d.ts +2 -3
  37. package/src/Api/Implementation/QueryLanguageApiImpl.js +9 -18
  38. package/src/Api/Implementation/ScopeApiImpl.d.ts +1 -1
  39. package/src/Api/Implementation/StyledColumnApiImpl.d.ts +25 -0
  40. package/src/Api/Implementation/StyledColumnApiImpl.js +193 -0
  41. package/src/Api/Implementation/SystemStatusApiImpl.js +1 -2
  42. package/src/Api/Implementation/ToolPanelApiImpl.d.ts +3 -1
  43. package/src/Api/Implementation/ToolPanelApiImpl.js +8 -0
  44. package/src/Api/PluginsApi.d.ts +5 -0
  45. package/src/Api/QueryLanguageApi.d.ts +3 -7
  46. package/src/Api/ScopeApi.d.ts +1 -1
  47. package/src/Api/StyledColumnApi.d.ts +106 -0
  48. package/src/Api/StyledColumnApi.js +2 -0
  49. package/src/Api/ToolPanelApi.d.ts +10 -1
  50. package/src/PredefinedConfig/AdaptableState.d.ts +2 -0
  51. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
  52. package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +1 -1
  53. package/src/PredefinedConfig/Common/AdaptablePredicate.js +37 -37
  54. package/src/PredefinedConfig/Common/Types.d.ts +3 -3
  55. package/src/PredefinedConfig/Common/Types.js +1 -0
  56. package/src/PredefinedConfig/ConditionalStyleState.d.ts +10 -19
  57. package/src/PredefinedConfig/FormatColumnState.d.ts +21 -92
  58. package/src/PredefinedConfig/PredefinedConfig.d.ts +6 -0
  59. package/src/PredefinedConfig/StyledColumnState.d.ts +119 -0
  60. package/src/PredefinedConfig/StyledColumnState.js +2 -0
  61. package/src/Redux/ActionsReducers/ConditionalStyleRedux.d.ts +0 -18
  62. package/src/Redux/ActionsReducers/ConditionalStyleRedux.js +0 -18
  63. package/src/Redux/ActionsReducers/FormatColumnRedux.d.ts +14 -0
  64. package/src/Redux/ActionsReducers/FormatColumnRedux.js +43 -1
  65. package/src/Redux/ActionsReducers/PluginsRedux.d.ts +4 -4
  66. package/src/Redux/ActionsReducers/PluginsRedux.js +5 -5
  67. package/src/Redux/ActionsReducers/StyledColumnRedux.d.ts +49 -0
  68. package/src/Redux/ActionsReducers/StyledColumnRedux.js +92 -0
  69. package/src/Redux/Store/AdaptableStore.js +9 -0
  70. package/src/Strategy/ConditionalStyleModule.d.ts +0 -2
  71. package/src/Strategy/ConditionalStyleModule.js +3 -27
  72. package/src/Strategy/DataChangeHistoryModule.d.ts +1 -0
  73. package/src/Strategy/DataChangeHistoryModule.js +12 -0
  74. package/src/Strategy/FormatColumnModule.d.ts +3 -10
  75. package/src/Strategy/FormatColumnModule.js +42 -183
  76. package/src/Strategy/Interface/IModule.d.ts +1 -0
  77. package/src/Strategy/StyledColumnModule.d.ts +24 -0
  78. package/src/Strategy/StyledColumnModule.js +165 -0
  79. package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.d.ts +1 -1
  80. package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +3 -4
  81. package/src/Strategy/Utilities/FormatColumn/getFormatColumnStyleViewItems.js +1 -16
  82. package/src/Strategy/Utilities/getScopeViewItems.js +1 -1
  83. package/src/Utilities/Constants/ModuleConstants.d.ts +3 -0
  84. package/src/Utilities/Constants/ModuleConstants.js +4 -1
  85. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +6 -12
  86. package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -0
  87. package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +3 -2
  88. package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +3 -1
  89. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +1 -0
  90. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +3 -1
  91. package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.d.ts +1 -0
  92. package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +3 -1
  93. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +2 -4
  94. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -1
  95. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -0
  96. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +3 -1
  97. package/src/Utilities/Extensions/TypeExtensions.d.ts +1 -0
  98. package/src/Utilities/Extensions/TypeExtensions.js +5 -0
  99. package/src/Utilities/ObjectFactory.d.ts +5 -2
  100. package/src/Utilities/ObjectFactory.js +14 -7
  101. package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +14 -4
  102. package/src/Utilities/Services/{LicenseService.d.ts → LicenseService/index.d.ts} +3 -3
  103. package/src/Utilities/Services/LicenseService/index.js +1 -0
  104. package/src/Utilities/Services/LicenseService/shouldLogThankYouMessage.d.ts +1 -0
  105. package/src/Utilities/Services/LicenseService/shouldLogThankYouMessage.js +15 -0
  106. package/src/Utilities/Services/ModuleService.js +2 -0
  107. package/src/Utilities/Services/QueryLanguageService.d.ts +3 -3
  108. package/src/Utilities/Services/QueryLanguageService.js +88 -39
  109. package/src/Utilities/Services/ReportService.js +6 -6
  110. package/src/Utilities/license/LicenseDetails.d.ts +1 -1
  111. package/src/Utilities/license/decode.d.ts +1 -0
  112. package/src/Utilities/license/decode.js +1 -1
  113. package/src/View/AdaptablePopover/index.js +1 -1
  114. package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +9 -9
  115. package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +6 -5
  116. package/src/View/Alert/Wizard/BaseAlertRulesWizardSection.js +3 -3
  117. package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +3 -3
  118. package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
  119. package/src/View/CalculatedColumn/CalculatedColumnSummary.d.ts +1 -1
  120. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +1 -1
  121. package/src/View/Components/AdaptableObjectRow/index.js +1 -6
  122. package/src/View/Components/Buttons/ButtonInfo.d.ts +1 -3
  123. package/src/View/Components/Buttons/ButtonInfo.js +3 -5
  124. package/src/View/Components/EntityRulesEditor/index.d.ts +2 -1
  125. package/src/View/Components/EntityRulesEditor/index.js +36 -35
  126. package/src/View/Components/FilterForm/FilterForm.js +11 -16
  127. package/src/View/Components/FilterForm/ListBoxFilterForm.js +2 -1
  128. package/src/View/Components/FilterForm/QuickFilterForm.js +7 -13
  129. package/src/View/Components/NewScopeComponent.js +3 -3
  130. package/src/View/Components/Panels/PanelWithButton.js +1 -5
  131. package/src/View/Components/Panels/PanelWithImage.js +1 -5
  132. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +2 -2
  133. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.d.ts +1 -0
  134. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +3 -16
  135. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +1 -0
  136. package/src/View/Components/Popups/AdaptablePopup/PopupPanel.js +1 -1
  137. package/src/View/Components/Popups/AdaptablePopupTeamSharing.js +5 -5
  138. package/src/View/Components/RangesComponent.d.ts +8 -1
  139. package/src/View/Components/RangesComponent.js +60 -24
  140. package/src/View/Components/ScopeComponent.js +6 -6
  141. package/src/View/Components/Selectors/ColumnSelector.d.ts +1 -0
  142. package/src/View/Components/Selectors/ColumnSelector.js +2 -1
  143. package/src/View/Components/Selectors/ColumnValueSelector.js +2 -2
  144. package/src/View/Components/StyleComponent.js +14 -19
  145. package/src/View/Components/ToolPanel/AdaptableToolPanel.d.ts +3 -9
  146. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +25 -10
  147. package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
  148. package/src/View/Components/ToolPanel/ToolPanelPopup.d.ts +1 -1
  149. package/src/View/ConditionalStyle/ConditionalStylePopupHeader.d.ts +2 -0
  150. package/src/View/ConditionalStyle/ConditionalStylePopupHeader.js +18 -0
  151. package/src/View/ConditionalStyle/Wizard/ConditionalStyleRuleWizardSection.js +3 -3
  152. package/src/View/ConditionalStyle/Wizard/ConditionalStyleSettingsWizardSettings.js +1 -1
  153. package/src/View/ConditionalStyle/Wizard/ConditionalStyleWizard.js +1 -11
  154. package/src/View/DataSet/DataSetSelector.js +1 -1
  155. package/src/View/DataSet/DataSetViewPanel.d.ts +1 -1
  156. package/src/View/Export/ExportViewPanel.d.ts +1 -1
  157. package/src/View/Export/ExportViewPanel.js +4 -4
  158. package/src/View/Export/ReportExportDropdown.js +1 -1
  159. package/src/View/Export/Wizard/ReportNameWizardSection.js +10 -11
  160. package/src/View/Filter/FilterSummary.d.ts +1 -1
  161. package/src/View/Filter/FilterViewPanel.d.ts +1 -1
  162. package/src/View/FlashingCell/FlashingCellStyle.js +3 -3
  163. package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +3 -3
  164. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +6 -6
  165. package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +4 -4
  166. package/src/View/FormatColumn/FormatColumnSummary.js +1 -1
  167. package/src/View/FormatColumn/MoveFormatColumn.d.ts +7 -0
  168. package/src/View/FormatColumn/MoveFormatColumn.js +27 -0
  169. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +28 -28
  170. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +8 -0
  171. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +28 -0
  172. package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +21 -3
  173. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +2 -28
  174. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +3 -3
  175. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +6 -300
  176. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +15 -9
  177. package/src/View/FormatColumn/Wizard/constants.d.ts +1 -0
  178. package/src/View/FormatColumn/Wizard/constants.js +4 -0
  179. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +7 -7
  180. package/src/View/Layout/LayoutRadioSelector.js +1 -1
  181. package/src/View/Layout/LayoutViewPanel.d.ts +1 -1
  182. package/src/View/Layout/Wizard/Components/ColumnLabels.js +1 -1
  183. package/src/View/Layout/Wizard/sections/AggregationsSection.js +1 -1
  184. package/src/View/Layout/Wizard/sections/ColumnsSection.js +7 -6
  185. package/src/View/Layout/Wizard/sections/SettingsSection.js +2 -2
  186. package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +1 -1
  187. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +3 -3
  188. package/src/View/Query/QueryViewPanel.d.ts +1 -1
  189. package/src/View/Query/Wizard/NamedQuerySettingsWizardSection.js +1 -1
  190. package/src/View/QuickSearch/QuickSearchPopup.js +2 -2
  191. package/src/View/QuickSearch/QuickSearchViewPanel.d.ts +1 -1
  192. package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +5 -5
  193. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsGlue42.js +1 -1
  194. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsIPushPull.js +5 -5
  195. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsOpenFin.js +1 -1
  196. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReminder.js +5 -5
  197. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.js +2 -2
  198. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +3 -3
  199. package/src/View/SmartEdit/SmartEditPopup.js +3 -3
  200. package/src/View/SpecialColumnSettingsWizardStep.js +10 -10
  201. package/src/View/StateManagement/StateManagementPopup.js +4 -4
  202. package/src/View/StyledColumn/Wizard/StyledColumnWizard.d.ts +7 -0
  203. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +77 -0
  204. package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.d.ts +9 -0
  205. package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.js +65 -0
  206. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection.d.ts +9 -0
  207. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection.js +234 -0
  208. package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.d.ts +7 -0
  209. package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +59 -0
  210. package/src/View/SystemStatus/SystemStatusEntityRow.js +4 -6
  211. package/src/View/SystemStatus/SystemStatusViewPanel.d.ts +1 -1
  212. package/src/View/TeamSharing/SharedEntityObjectView.js +1 -1
  213. package/src/View/TeamSharing/TeamSharingApplyButton.js +1 -1
  214. package/src/View/Theme/ThemePopup.js +1 -1
  215. package/src/View/Wizard/OnePageAdaptableWizard.d.ts +1 -1
  216. package/src/View/Wizard/OnePageAdaptableWizard.js +1 -2
  217. package/src/agGrid/ActionColumnRenderer.d.ts +3 -0
  218. package/src/agGrid/ActionColumnRenderer.js +96 -64
  219. package/src/agGrid/Adaptable.d.ts +13 -9
  220. package/src/agGrid/Adaptable.js +207 -221
  221. package/src/agGrid/CheckboxRenderer.js +1 -1
  222. package/src/agGrid/FilterWrapper.js +60 -16
  223. package/src/agGrid/FloatingFilterWrapper.d.ts +2 -2
  224. package/src/agGrid/FloatingFilterWrapper.js +71 -32
  225. package/src/agGrid/PercentBarRenderer.d.ts +6 -2
  226. package/src/agGrid/PercentBarRenderer.js +19 -17
  227. package/src/agGrid/agGridHelper.d.ts +6 -2
  228. package/src/agGrid/agGridHelper.js +16 -15
  229. package/src/agGrid/createAgStatusPanelComponent.d.ts +1 -1
  230. package/src/agGrid/createAgStatusPanelComponent.js +17 -0
  231. package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +5 -1
  232. package/src/agGrid/editors/AdaptableDateEditor/index.js +87 -20
  233. package/src/agGrid/editors/AdaptableNumberEditor/InternalAdaptableNumberEditor.js +1 -1
  234. package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +3 -3
  235. package/src/agGrid/editors/AdaptableNumberEditor/index.js +81 -30
  236. package/src/agGrid/weightedAverage.js +19 -11
  237. package/src/components/CheckBox/index.js +7 -2
  238. package/src/components/Datepicker/index.d.ts +1 -1
  239. package/src/components/ExpressionEditor/BaseEditorInput.d.ts +1 -1
  240. package/src/components/ExpressionEditor/BaseEditorInput.js +13 -32
  241. package/src/components/ExpressionEditor/EditorInput.js +1 -1
  242. package/src/components/ExpressionEditor/EditorInputWithWhereClause.js +1 -1
  243. package/src/components/ExpressionEditor/index.js +9 -17
  244. package/src/components/FormLayout/index.js +1 -1
  245. package/src/components/StylePreview.js +2 -1
  246. package/src/components/icons/brush.d.ts +3 -0
  247. package/src/components/icons/brush.js +7 -0
  248. package/src/components/icons/index.js +2 -0
  249. package/src/metamodel/adaptable.metamodel.d.ts +191 -95
  250. package/src/metamodel/adaptable.metamodel.js +1 -1
  251. package/src/parser/src/types.d.ts +6 -3
  252. package/src/renderReactRoot.d.ts +2 -0
  253. package/src/renderReactRoot.js +11 -9
  254. package/src/types.d.ts +8 -4
  255. package/themes/dark.css +8 -4
  256. package/themes/dark.css.map +1 -0
  257. package/themes/light.css +4 -1
  258. package/themes/light.css.map +1 -0
  259. package/version.d.ts +1 -1
  260. package/version.js +1 -1
  261. package/src/AdaptableComponents.d.ts +0 -1
  262. package/src/AdaptableComponents.js +0 -5
  263. package/src/Utilities/Services/LicenseService.js +0 -1
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { ICellEditorComp, ICellEditorParams } from '@ag-grid-community/core';
2
3
  /**
3
4
  * Adaptable number editor parameters extending the AG Grid {@link ICellEditorParams}.
@@ -14,6 +15,7 @@ interface AdaptableNumberCellEditorParams extends ICellEditorParams {
14
15
  */
15
16
  emptyValue: string;
16
17
  }
18
+ export declare const ReactAdaptableNumberEditor: React.ForwardRefExoticComponent<AdaptableNumberCellEditorParams & React.RefAttributes<unknown>>;
17
19
  /**
18
20
  * Used by default for all `abColDefNumber` columns.
19
21
  *
@@ -42,6 +44,7 @@ export declare class AdaptableNumberEditor implements ICellEditorComp {
42
44
  private params;
43
45
  private editor;
44
46
  private valueParser;
47
+ private unmountReactRoot?;
45
48
  init(params: AdaptableNumberCellEditorParams): void;
46
49
  getGui(): HTMLDivElement;
47
50
  getValue(): any;
@@ -50,8 +53,5 @@ export declare class AdaptableNumberEditor implements ICellEditorComp {
50
53
  afterGuiAttached(): void;
51
54
  destroy(): void;
52
55
  private onValueChange;
53
- private getStartValue;
54
- private shouldClearExistingValue;
55
- private isValidChar;
56
56
  }
57
57
  export {};
@@ -1,12 +1,82 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AdaptableNumberEditor = void 0;
3
+ exports.AdaptableNumberEditor = exports.ReactAdaptableNumberEditor = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
- const react_dom_1 = require("react-dom");
7
6
  const renderWithAdaptableContext_1 = require("../../../View/renderWithAdaptableContext");
8
7
  const InternalAdaptableNumberEditor_1 = require("./InternalAdaptableNumberEditor");
9
8
  const core_1 = require("@ag-grid-community/core");
9
+ const react_1 = require("react");
10
+ function shouldClearExistingValue(params) {
11
+ return params.eventKey === core_1.KeyCode.BACKSPACE || params.eventKey === core_1.KeyCode.DELETE;
12
+ }
13
+ function isValidChar(char) {
14
+ // allow only digits
15
+ return ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(char);
16
+ // we do NOT allow key shortcuts for starting non-digits (minus sign, decimal separators) as the input[number] handling is very buggy and we would open a can of worms
17
+ }
18
+ function getStartValue(params) {
19
+ if (shouldClearExistingValue(params)) {
20
+ return '';
21
+ }
22
+ if (params.charPress && isValidChar(params.charPress)) {
23
+ return params.charPress;
24
+ }
25
+ return params.value;
26
+ }
27
+ const defaultValueParser = ({ newValue, oldValue: _ }) => {
28
+ return newValue;
29
+ };
30
+ const style = {
31
+ position: 'absolute',
32
+ top: '0px',
33
+ left: '0px',
34
+ right: '0px',
35
+ bottom: '0px',
36
+ };
37
+ exports.ReactAdaptableNumberEditor = (0, react_1.forwardRef)((props, ref) => {
38
+ var _a, _b;
39
+ const [initialValue] = (0, react_1.useState)(() => getStartValue(props));
40
+ const valueRef = (0, react_1.useRef)(initialValue);
41
+ const columnId = props.column.getColId();
42
+ const adaptable = props.api.__adaptable;
43
+ const colValueParser = props.column.getColDef().valueParser;
44
+ const valueParser = typeof colValueParser === 'function' ? colValueParser : defaultValueParser;
45
+ function onValueChange(value) {
46
+ value = valueParser
47
+ ? valueParser(Object.assign(Object.assign({}, props), { oldValue: props.value, newValue: value }))
48
+ : value;
49
+ valueRef.current = value;
50
+ }
51
+ const editorRef = (0, react_1.useRef)(null);
52
+ (0, react_1.useImperativeHandle)(ref, () => {
53
+ return {
54
+ focusIn() {
55
+ var _a;
56
+ (_a = editorRef.current) === null || _a === void 0 ? void 0 : _a.focus();
57
+ },
58
+ // the final value to send to the grid, on completion of editing
59
+ getValue() {
60
+ return valueRef.current;
61
+ },
62
+ };
63
+ });
64
+ const editorElement = (React.createElement(InternalAdaptableNumberEditor_1.InternalAdaptableNumberEditor, { defaultValue: initialValue, showClearButton: (_a = props.showClearButton) !== null && _a !== void 0 ? _a : true, emptyValue: (_b = props.emptyValue) !== null && _b !== void 0 ? _b : '', onValueChange: onValueChange, ref: (editor) => {
65
+ editorRef.current = editor;
66
+ editor === null || editor === void 0 ? void 0 : editor.focus();
67
+ } }));
68
+ function onKeyDown(keyDownEvent) {
69
+ adaptable._emit('CellEditorKeyDown', {
70
+ keyDownEvent,
71
+ cellValue: valueRef.current,
72
+ columnId,
73
+ updateValueCallback: (updatedValue) => {
74
+ editorRef.current.setValue(updatedValue);
75
+ },
76
+ });
77
+ }
78
+ return (React.createElement("div", { style: style, onKeyDown: onKeyDown }, (0, renderWithAdaptableContext_1.renderWithAdaptableContext)(editorElement, adaptable)));
79
+ });
10
80
  /**
11
81
  * Used by default for all `abColDefNumber` columns.
12
82
  *
@@ -30,9 +100,7 @@ const core_1 = require("@ag-grid-community/core");
30
100
  */
31
101
  class AdaptableNumberEditor {
32
102
  constructor() {
33
- this.valueParser = ({ newValue, oldValue: _ }) => {
34
- return newValue;
35
- };
103
+ this.valueParser = defaultValueParser;
36
104
  this.onValueChange = (value) => {
37
105
  this.value = this.valueParser
38
106
  ? this.valueParser(Object.assign(Object.assign({}, this.params), { oldValue: this.params.value, newValue: value }))
@@ -40,7 +108,7 @@ class AdaptableNumberEditor {
40
108
  };
41
109
  }
42
110
  init(params) {
43
- this.value = this.getStartValue(params);
111
+ this.value = getStartValue(params);
44
112
  this.params = params;
45
113
  this.columnId = params.column.getColId();
46
114
  const { valueParser } = params.column.getColDef();
@@ -48,11 +116,10 @@ class AdaptableNumberEditor {
48
116
  this.valueParser = valueParser;
49
117
  }
50
118
  this.el = document.createElement('div');
51
- this.el.style.position = 'absolute';
52
- this.el.style.top = '0px';
53
- this.el.style.left = '0px';
54
- this.el.style.right = '0px';
55
- this.el.style.bottom = '0px';
119
+ Object.keys(style).forEach((key) => {
120
+ //@ts-ignore
121
+ this.el.style[key] = style[key];
122
+ });
56
123
  }
57
124
  /* Component Editor Lifecycle methods */
58
125
  // gets called once when grid ready to insert the element
@@ -77,7 +144,7 @@ class AdaptableNumberEditor {
77
144
  this.editor = editor;
78
145
  editor === null || editor === void 0 ? void 0 : editor.focus();
79
146
  } }));
80
- (0, react_dom_1.render)((0, renderWithAdaptableContext_1.renderWithAdaptableContext)(editorElement, adaptable), this.el);
147
+ this.unmountReactRoot = adaptable.renderReactRoot((0, renderWithAdaptableContext_1.renderWithAdaptableContext)(editorElement, adaptable), this.el);
81
148
  this.getGui().addEventListener('keydown', (keyDownEvent) => {
82
149
  adaptable._emit('CellEditorKeyDown', {
83
150
  keyDownEvent,
@@ -90,24 +157,8 @@ class AdaptableNumberEditor {
90
157
  });
91
158
  }
92
159
  destroy() {
93
- (0, react_dom_1.unmountComponentAtNode)(this.el);
94
- }
95
- getStartValue(params) {
96
- if (this.shouldClearExistingValue(params)) {
97
- return '';
98
- }
99
- if (params.charPress && this.isValidChar(params.charPress)) {
100
- return params.charPress;
101
- }
102
- return params.value;
103
- }
104
- shouldClearExistingValue(params) {
105
- return params.eventKey === core_1.KeyCode.BACKSPACE || params.eventKey === core_1.KeyCode.DELETE;
106
- }
107
- isValidChar(char) {
108
- // allow only digits
109
- return ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(char);
110
- // we do NOT allow key shortcuts for starting non-digits (minus sign, decimal separators) as the input[number] handling is very buggy and we would open a can of worms
160
+ var _a;
161
+ (_a = this.unmountReactRoot) === null || _a === void 0 ? void 0 : _a.call(this);
111
162
  }
112
163
  }
113
164
  exports.AdaptableNumberEditor = AdaptableNumberEditor;
@@ -79,22 +79,30 @@ const cellSummaryWeightedAverage = ({ numericColumns, selectedCellInfo, adaptabl
79
79
  sumPrimaryValues += weightedGridCell.rawValue * gridCell.normalisedValue;
80
80
  }
81
81
  });
82
- if (isValid) {
83
- const formatColumn = adaptableApi.formatColumnApi.getFormatColumnForColumnId(columnId);
84
- if (formatColumn && formatColumn.DisplayFormat) {
85
- const options = formatColumn.DisplayFormat
86
- .Options;
87
- if (options) {
88
- return FormatHelper_1.default.NumberFormatter(sumPrimaryValues / sumWeightedValue, options);
89
- }
82
+ if (!isValid) {
83
+ return '';
84
+ }
85
+ const abColumn = adaptableApi.columnApi.getColumnFromId(columnId);
86
+ if (!abColumn) {
87
+ return '';
88
+ }
89
+ const activeFormatColumnsWithDisplayFormat = adaptableApi.formatColumnApi.getFormatColumnsWithDisplayFormatForColumn(abColumn);
90
+ if (activeFormatColumnsWithDisplayFormat.length === 1 &&
91
+ activeFormatColumnsWithDisplayFormat[0].DisplayFormat.Formatter === 'NumberFormatter') {
92
+ // there only one FormatColumn on this column, so we will use it to format the aggregated value
93
+ const [singleActiveFormatColumnsWithDisplayFormat] = activeFormatColumnsWithDisplayFormat;
94
+ const options = singleActiveFormatColumnsWithDisplayFormat
95
+ .DisplayFormat.Options;
96
+ if (options) {
97
+ return FormatHelper_1.default.NumberFormatter(sumPrimaryValues / sumWeightedValue, options);
90
98
  }
99
+ }
100
+ else {
101
+ // there are multiple (possibly conflicting) FormatColumns for this column, we cannot know which to use
91
102
  return FormatHelper_1.default.NumberFormatter(sumPrimaryValues / sumWeightedValue, {
92
103
  FractionDigits: 2,
93
104
  });
94
105
  }
95
- else {
96
- return '';
97
- }
98
106
  }
99
107
  };
100
108
  exports.cellSummaryWeightedAverage = cellSummaryWeightedAverage;
@@ -31,7 +31,12 @@ const CheckBox = (_a) => {
31
31
  ? 'unchecked'
32
32
  : 'indeterminate';
33
33
  const gap = React.createElement("div", { style: { marginLeft: gapDistance, display: 'inline-block' } });
34
- children = children ? React.createElement("div", { style: { display: 'inline-block' } }, children) : null;
34
+ children = children ? (React.createElement("div", { style: {
35
+ display: 'inline-block',
36
+ whiteSpace: 'nowrap',
37
+ overflow: 'hidden',
38
+ textOverflow: 'ellipsis',
39
+ } }, children)) : null;
35
40
  const before = childrenPosition === 'start' ? children : null;
36
41
  const beforeGap = childrenPosition === 'start' && children ? gap : null;
37
42
  const after = childrenPosition === 'end' ? children : null;
@@ -46,7 +51,7 @@ const CheckBox = (_a) => {
46
51
  opacity: 0,
47
52
  cursor: 'pointer',
48
53
  }, onChange: onInputChange }));
49
- return (React.createElement(rebass_1.Box, Object.assign({ my: 2 }, props, { className: (0, join_1.default)('ab-CheckBox', `ab-CheckBox--${type}`, `ab-CheckBox--variant-${variant}`, disabled ? 'ab-CheckBox--disabled' : '', readOnly ? 'ab-CheckBox--readonly' : '', props.className), style: Object.assign({ display: 'inline-flex', flexFlow: 'row', alignItems: 'center', cursor: 'pointer', position: 'relative' }, props.style), as: as }),
54
+ return (React.createElement(rebass_1.Box, Object.assign({ my: 2 }, props, { className: (0, join_1.default)('ab-CheckBox', `ab-CheckBox--${type}`, `ab-CheckBox--variant-${variant}`, disabled ? 'ab-CheckBox--disabled' : '', readOnly ? 'ab-CheckBox--readonly' : '', props.className), style: props.style, as: as }),
50
55
  before,
51
56
  beforeGap,
52
57
  input,
@@ -15,4 +15,4 @@ export declare type DatepickerProps = Omit<BoxProps, 'value' | 'onChange' | 'def
15
15
  showWeekNumber?: boolean;
16
16
  showOutsideDays?: boolean;
17
17
  };
18
- export declare const Datepicker: React.ForwardRefExoticComponent<Pick<DatepickerProps, "max" | "required" | "type" | "data" | "default" | "high" | "low" | "key" | "id" | "media" | "height" | "width" | "start" | "open" | "name" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "color" | "content" | "display" | "flex" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lineHeight" | "margin" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflow" | "overflowX" | "overflowY" | "padding" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "textAlign" | "translate" | "verticalAlign" | "value" | "hidden" | "cite" | "dir" | "form" | "label" | "p" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "acceptCharset" | "action" | "method" | "noValidate" | "target" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "children" | "contentEditable" | "inputMode" | "nonce" | "tabIndex" | "async" | "disabled" | "multiple" | "size" | "manifest" | "m" | "wrap" | "accept" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "marginHeight" | "marginWidth" | "maxLength" | "mediaGroup" | "min" | "minLength" | "muted" | "optimum" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "useMap" | "wmode" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "bg" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "css" | "variant" | "tx" | "sx" | "showClearButton" | "onHide" | "showOutsideDays" | "showWeekNumber" | "datepickerButtons" | "dateProps"> & React.RefAttributes<HTMLInputElement>>;
18
+ export declare const Datepicker: React.ForwardRefExoticComponent<Pick<DatepickerProps, "max" | "required" | "type" | "data" | "default" | "high" | "low" | "key" | "id" | "media" | "height" | "width" | "start" | "open" | "name" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "color" | "content" | "display" | "flex" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lineHeight" | "margin" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflow" | "overflowX" | "overflowY" | "padding" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "textAlign" | "translate" | "verticalAlign" | "value" | "hidden" | "cite" | "dir" | "form" | "label" | "p" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "acceptCharset" | "action" | "method" | "noValidate" | "target" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "children" | "contentEditable" | "inputMode" | "nonce" | "tabIndex" | "async" | "disabled" | "multiple" | "size" | "manifest" | "m" | "wrap" | "accept" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "marginHeight" | "marginWidth" | "maxLength" | "mediaGroup" | "min" | "minLength" | "muted" | "optimum" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "useMap" | "wmode" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "bg" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "css" | "variant" | "tx" | "sx" | "showOutsideDays" | "showWeekNumber" | "onHide" | "showClearButton" | "datepickerButtons" | "dateProps"> & React.RefAttributes<HTMLInputElement>>;
@@ -7,7 +7,7 @@ interface BaseEditorInputProps {
7
7
  onChange: (value: string) => void;
8
8
  disabled?: boolean;
9
9
  onSelectedFunctionChange: (expressionFunction: ExpressionFunction | null) => void;
10
- expressionFunctions: ExpressionFunctionMap;
10
+ expressionFunctions: ExpressionFunctionMap<string>;
11
11
  editorButtons: OperatorEditorButton[];
12
12
  testData: any;
13
13
  placeholder?: string;
@@ -19,6 +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
  const AdaptableContext_1 = require("../../View/AdaptableContext");
22
+ const join_1 = tslib_1.__importDefault(require("../utils/join"));
22
23
  const VarEditorButton = () => {
23
24
  var _a, _b;
24
25
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
@@ -39,6 +40,7 @@ function BaseEditorInput(props) {
39
40
  let evaluationError;
40
41
  let expressionError;
41
42
  let selectedFunctionName;
43
+ const baseClassName = 'ab-ExpressionEditorInput';
42
44
  const buildParserExceptionMessage = (e) => {
43
45
  const parserExceptionSummary = 'Invalid expression is not parsable';
44
46
  if (!e.message) {
@@ -101,55 +103,34 @@ function BaseEditorInput(props) {
101
103
  props.onSelectedFunctionChange(selectedFunctionName ? expressionFunctions[selectedFunctionName] : null);
102
104
  }
103
105
  }, [selectedFunctionName]);
104
- const functionsDropdown = (React.createElement(OverlayTrigger_1.default, { render: () => (React.createElement(rebass_1.Flex, { "data-name": "expression-dropdown-list", flexDirection: "column", p: 2, style: {
105
- fontSize: 'var(--ab-font-size-2)',
106
- border: '1px solid var(--ab-color-primarydark)',
107
- borderRadius: 'var(--ab__border-radius)',
108
- background: 'var(--ab-color-primarylight)',
109
- zIndex: 1000,
110
- maxHeight: 300,
111
- overflow: 'auto',
112
- } }, Object.keys(expressionFunctions)
106
+ const functionsDropdown = (React.createElement(OverlayTrigger_1.default, { render: () => (React.createElement(rebass_1.Flex, { className: `${baseClassName}__dropdown-functions-list`, "data-name": "expression-dropdown-fuctions-list", flexDirection: "column", p: 2 }, Object.keys(expressionFunctions)
113
107
  .filter((functionName) => !expressionFunctions[functionName].isHiddenFromMenu)
114
108
  .map((functionName) => functionName === 'VAR' ? (React.createElement(VarEditorButton, { key: functionName })) : (React.createElement(EditorButton_1.default, { data: `${functionName}()`, key: functionName, mr: 1 }, functionName))))), showEvent: "focus", hideEvent: "blur" },
115
109
  React.createElement(SimpleButton_1.default, { "data-name": "expression-dropdown", icon: "arrow-down", iconPosition: 'end', mr: 1 },
116
- React.createElement(rebass_1.Flex, { marginRight: 1, style: { fontSize: 'var(--ab-font-size-2)' } },
117
- React.createElement(icons_1.Icon, { name: 'equation', style: { marginTop: 0 } })))));
110
+ React.createElement(rebass_1.Flex, { marginRight: 1, fontSize: 2 },
111
+ React.createElement(icons_1.Icon, { name: "equation" })))));
118
112
  const operatorButtons = props.editorButtons
119
113
  .filter((editorButtonDef) => !!expressionFunctions[editorButtonDef.functionName])
120
114
  .map((editorButtonDef) => (React.createElement(EditorButton_1.default, { key: `${editorButtonDef.functionName}-operator`, data: editorButtonDef.data, icon: editorButtonDef.icon }, !editorButtonDef.icon && (editorButtonDef.text || editorButtonDef.functionName))));
121
115
  const showDocumentationLink = props.api.internalApi.isDocumentationLinksDisplayed();
122
116
  return (React.createElement(React.Fragment, null,
123
- React.createElement(rebass_1.Flex, { "data-name": "expression-toolbar", py: 2, mb: 2, flexWrap: "wrap", style: {
124
- background: 'var(--ab-color-primarylight)',
125
- borderRadius: 'var(--ab__border-radius)',
126
- '--ab-overlay-horizontal-align': 'left',
127
- width: '100%',
128
- marginTop: 5,
129
- } },
117
+ React.createElement(rebass_1.Flex, { className: baseClassName, "data-name": "expression-toolbar", py: 2, mb: 2, mt: 2, flexWrap: "wrap" },
130
118
  React.createElement(rebass_1.Flex, { style: { flex: 1, marginLeft: 5 }, flexWrap: "wrap" },
131
119
  functionsDropdown,
132
120
  operatorButtons),
133
121
  showDocumentationLink && (React.createElement(rebass_1.Flex, { alignItems: "flex-start" },
134
- React.createElement(ButtonInfo_1.ButtonInfo, { style: {
135
- color: 'var(--ab-color-text-on-add)',
136
- fill: 'var(--ab-color-text-on-add)',
137
- background: 'var(--ab-color-action-add)',
138
- marginRight: 5,
139
- }, tooltip: 'Learn how to use the Expression Editor', onClick: () => window.open(DocumentationLinkConstants_1.ExpressionEditorDocsLink, '_blank') })))),
140
- 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) => {
122
+ React.createElement(ButtonInfo_1.ButtonInfo, { mr: 2, tooltip: 'Learn how to use the Expression Editor', onClick: () => window.open(DocumentationLinkConstants_1.ExpressionEditorDocsLink, '_blank') })))),
123
+ 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: (0, join_1.default)('ab-ExpressionEditor__textarea', // left for backwards compatibility
124
+ `${baseClassName}__textarea`), autoFocus: true, spellCheck: "false", onChange: (event) => {
141
125
  props.onChange(event.target.value);
142
- }, style: Object.assign({ width: '100%', minHeight: 100, fontFamily: 'monospace', resize: 'vertical', fontSize: '1rem', padding: 'var(--ab-space-2)' }, style) }),
143
- props.isFullExpression !== true && (React.createElement(HelpBlock_1.default, { mt: 2, mb: 2, p: 2, style: { fontSize: 'var(--ab-font-size-3)' } },
126
+ }, style: style }),
127
+ props.isFullExpression !== true && (React.createElement(HelpBlock_1.default, { mt: 2, mb: 2, p: 2, fontSize: 3 },
144
128
  "This Query must resolve to a ",
145
129
  React.createElement("b", null, "boolean "),
146
130
  "(i.e. true / false) value")),
147
- expressionError && (React.createElement(ErrorBox_1.default, { style: { whiteSpace: 'pre-wrap' }, mt: 2 }, expressionError)),
131
+ expressionError && (React.createElement(ErrorBox_1.default, { width: "100%", style: { whiteSpace: 'pre-wrap' }, mt: 2 }, expressionError)),
148
132
  evaluationError && (React.createElement(ErrorBox_1.default, { style: { whiteSpace: 'pre-wrap' }, mt: 2 }, `${evaluationError.expressionFnName} ${evaluationError.message}`)),
149
- !props.hideResultPreview && result !== undefined && (React.createElement(rebass_1.Box, { "data-name": "expression-editor-feedback", mt: 2, p: 2, style: {
150
- background: 'var(--ab-color-primarylight)',
151
- borderRadius: 'var(--ab__border-radius)',
152
- } },
133
+ !props.hideResultPreview && result !== undefined && (React.createElement(rebass_1.Box, { className: `${baseClassName}__editor-feedback`, "data-name": "expression-editor-feedback", mt: 2, p: 2 },
153
134
  React.createElement("pre", { style: { whiteSpace: 'pre-wrap', margin: 0 } },
154
135
  "Result (using Test Data): ",
155
136
  React.createElement("b", null, JSON.stringify(result)))))));
@@ -13,7 +13,7 @@ const editorButtonsCumulativeAggregatedScalar_1 = require("./editorButtonsCumula
13
13
  function EditorInput(props) {
14
14
  const moduleExpressionFunctions = props.api.internalApi
15
15
  .getQueryLanguageService()
16
- .getModuleExpressionFunctions(props.module);
16
+ .getModuleExpressionFunctionsMap(props.module);
17
17
  const getFilteredAggregatedExpressionFunctions = (availableAggregatedExpressionFunctions, type) => {
18
18
  const sourceExpressionFunctions = type === 'aggregatedScalar'
19
19
  ? aggregatedScalarExpressionFunctions_1.aggregatedExpressionFunctions
@@ -15,7 +15,7 @@ const editorButtonsAggregatedBoolean_1 = require("./editorButtonsAggregatedBoole
15
15
  function EditorInputWithWhereClause(props) {
16
16
  const moduleExpressionFunctions = props.api.internalApi
17
17
  .getQueryLanguageService()
18
- .getModuleExpressionFunctions(props.module);
18
+ .getModuleExpressionFunctionsMap(props.module);
19
19
  const reactiveExpressionFns = props.type === 'observable'
20
20
  ? moduleExpressionFunctions.observableFunctions
21
21
  : moduleExpressionFunctions.aggregatedBooleanFunctions;
@@ -31,6 +31,7 @@ function ExpressionEditor(props) {
31
31
  const [data, setData] = (0, react_1.useState)(props.initialData);
32
32
  const [showColumnIds, setShowColumnIds] = (0, react_1.useState)(false);
33
33
  const [showNamedQueries, setShowNamedQueries] = (0, react_1.useState)(false);
34
+ const baseClassName = `ab-ExpressionEditor`;
34
35
  const [selectedFunction, setSelectedFunction] = (0, react_1.useState)(null);
35
36
  const [expressionText, setExpressionText] = (0, react_1.useState)('');
36
37
  const { namedQuery, setNamedQuery } = (0, NamedQueryContext_1.useNamedQueryContext)();
@@ -102,7 +103,7 @@ function ExpressionEditor(props) {
102
103
  };
103
104
  const [searchInputValue, setSearchInputValue] = React.useState('');
104
105
  const dataTableEditor = (React.createElement(React.Fragment, null,
105
- React.createElement(rebass_1.Flex, { flexDirection: "column", alignItems: "start", style: { marginTop: 2 } },
106
+ React.createElement(rebass_1.Flex, { className: `${baseClassName}__columns-list`, flexDirection: "column", alignItems: "start", style: { marginTop: 2 } },
106
107
  React.createElement(CheckBox_1.CheckBox, { checked: showColumnIds, onChange: (checked) => setShowColumnIds(checked), style: {
107
108
  float: 'right',
108
109
  margin: 0,
@@ -157,28 +158,24 @@ function ExpressionEditor(props) {
157
158
  setSelectedFunction,
158
159
  textAreaRef,
159
160
  } },
160
- React.createElement("div", { "data-name": "expression-editor", style: Object.assign({ flex: 1, overflow: 'auto', display: 'flex', paddingLeft: 'var(--ab-space-2)' }, props.style) },
161
+ React.createElement(rebass_1.Flex, { className: baseClassName, flex: 1, "data-name": "expression-editor-wrapper", pl: 2, style: props.style },
161
162
  React.createElement(rebass_1.Flex, { flex: 1, style: { minHeight: 0 }, flexDirection: "column", onFocus: (event) => {
162
163
  if (event.target.tagName === 'TEXTAREA') {
163
164
  textAreaRef.current = event.target;
164
165
  }
165
166
  } },
166
- React.createElement(rebass_1.Flex, { flex: 1, flexDirection: "row", "data-name": "expression-editor", style: { fontSize: 'var(--ab-font-size-2)', minHeight: 0, flex: 1 } },
167
+ React.createElement(rebass_1.Flex, { flex: 1, flexDirection: "row", "data-name": "expression-editor", fontSize: 2, style: { minHeight: 0 } },
167
168
  React.createElement(rebass_1.Flex, { flex: 1, paddingRight: 2, style: { overflow: 'auto' }, "data-name": "expression-builder", flexDirection: "column" },
168
169
  editorInput,
169
170
  StringExtensions_1.default.IsNotNullOrEmpty(expressionText === null || expressionText === void 0 ? void 0 : expressionText.trim()) && (React.createElement(ExpressionFunctionDocumentation_1.ExpressionFunctionDocumentation, { expressionFunction: selectedFunction })),
170
171
  /* displayed for advanced queries (observable&Aggregation) to give the users a starting point */
171
172
  StringExtensions_1.default.IsNullOrEmpty(expressionText === null || expressionText === void 0 ? void 0 : expressionText.trim()) && renderQueryHints(type),
172
- showDocumentationLinks && (React.createElement(HelpBlock_1.default, { "data-name": "query-documentation", mt: 2, mb: 2, style: { fontSize: 'var(--ab-font-size-3)' } },
173
- React.createElement(ButtonInfo_1.ButtonInfo, { mr: 2, style: {
174
- color: 'var(--ab-color-text-on-add)',
175
- fill: 'var(--ab-color-text-on-add)',
176
- background: 'var(--ab-color-action-add)',
177
- }, onClick: () => window.open(queryDocumentationLink, '_blank') }),
173
+ showDocumentationLinks && (React.createElement(HelpBlock_1.default, { "data-name": "query-documentation", mt: 2, mb: 2, fontSize: 3 },
174
+ React.createElement(ButtonInfo_1.ButtonInfo, { mr: 2, onClick: () => window.open(queryDocumentationLink, '_blank') }),
178
175
  "See ",
179
176
  StringExtensions_1.default.CapitaliseFirstLetter(type),
180
177
  " Query documentation for more details and examples")),
181
- React.createElement("div", { style: { flex: 1 } }),
178
+ React.createElement(rebass_1.Box, { flex: 1 }),
182
179
  allowSaveNamedQuery &&
183
180
  props.api.internalApi
184
181
  .getModuleService()
@@ -202,13 +199,8 @@ function ExpressionEditor(props) {
202
199
  BooleanExpression: expressionText,
203
200
  });
204
201
  } })) : null))),
205
- React.createElement(rebass_1.Box, { "data-name": "expression-column-picker", pb: 2, paddingLeft: 2, style: {
206
- overflow: 'auto',
207
- minWidth: 220,
208
- height: '100%',
209
- paddingRight: 'var(--ab-space-2)',
210
- } },
211
- ArrayExtensions_1.default.IsNotNullOrEmpty(props.namedQueries) && (React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "start", style: { padding: 3, marginTop: 5 }, backgroundColor: "primarylight" },
202
+ React.createElement(rebass_1.Box, { className: `${baseClassName}__column-picker`, "data-name": "expression-column-picker", pb: 2, paddingLeft: 2, pr: 2 },
203
+ ArrayExtensions_1.default.IsNotNullOrEmpty(props.namedQueries) && (React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "start", p: 1, mt: 2, backgroundColor: "primarylight" },
212
204
  React.createElement(Radio_1.default, { checked: !showNamedQueries, onChange: (checked) => setShowNamedQueries(!checked), style: { marginRight: 10 } }, "Columns"),
213
205
  React.createElement(Radio_1.default, { checked: showNamedQueries, onChange: (checked) => setShowNamedQueries(checked), style: { marginLeft: 10, whiteSpace: 'nowrap' } }, "Named Queries"))),
214
206
  showNamedQueries ? React.createElement("div", null, namedQueries) : React.createElement("div", null, dataTableEditor)))))));
@@ -73,7 +73,7 @@ const FormRow = (props) => {
73
73
  }
74
74
  if (props.as != null || column.component != null) {
75
75
  const Cmp = column.component;
76
- value = (React.createElement(Cmp, { style: Object.assign(Object.assign({}, column.style), { gridColumn: columnIndex + 1, gridRow: rowIndex + 1 }), className: column.className }, value));
76
+ value = (React.createElement(Cmp, { "data-name": props.dataName, style: Object.assign(Object.assign({}, column.style), { gridColumn: columnIndex + 1, gridRow: rowIndex + 1 }), className: column.className }, value));
77
77
  }
78
78
  return typeof value === 'string' ? value : React.cloneElement(value, { key: columnName });
79
79
  });
@@ -5,8 +5,9 @@ const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const rebass_1 = require("rebass");
7
7
  const StyleHelper_1 = require("../Utilities/Helpers/StyleHelper");
8
+ const join_1 = tslib_1.__importDefault(require("./utils/join"));
8
9
  const StylePreview = (props) => {
9
10
  var _a, _b, _c;
10
- return (React.createElement(rebass_1.Box, Object.assign({}, props, { padding: (_a = props.padding) !== null && _a !== void 0 ? _a : 2, mt: (_b = props.mt) !== null && _b !== void 0 ? _b : 2, style: Object.assign(Object.assign({}, (0, StyleHelper_1.toStyle)(props.styleObject)), props.style) }), (_c = props.children) !== null && _c !== void 0 ? _c : 'Preview result'));
11
+ return (React.createElement(rebass_1.Box, Object.assign({}, props, { className: (0, join_1.default)('ab-StylePreview', props.className), padding: (_a = props.padding) !== null && _a !== void 0 ? _a : 2, mt: (_b = props.mt) !== null && _b !== void 0 ? _b : 2, style: Object.assign(Object.assign({}, (0, StyleHelper_1.toStyle)(props.styleObject)), props.style) }), (_c = props.children) !== null && _c !== void 0 ? _c : 'Preview result'));
11
12
  };
12
13
  exports.StylePreview = StylePreview;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: (props: any) => JSX.Element;
3
+ export default _default;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const React = tslib_1.__importStar(require("react"));
5
+ const DefaultIcon_1 = tslib_1.__importDefault(require("./DefaultIcon"));
6
+ exports.default = (props) => (React.createElement(DefaultIcon_1.default, Object.assign({}, props),
7
+ React.createElement("path", { d: "M6 21q-1.125 0-2.225-.55T2 19q.65 0 1.325-.512Q4 17.975 4 17q0-1.25.875-2.125T7 14q1.25 0 2.125.875T10 17q0 1.65-1.175 2.825Q7.65 21 6 21Zm0-2q.825 0 1.412-.587Q8 17.825 8 17q0-.425-.287-.712Q7.425 16 7 16t-.713.288Q6 16.575 6 17q0 .575-.137 1.05-.138.475-.363.9.125.05.25.05H6Zm5.75-4L9 12.25l8.95-8.95q.275-.275.688-.288.412-.012.712.288l1.35 1.35q.3.3.3.7 0 .4-.3.7ZM7 17Z" })));
@@ -132,6 +132,7 @@ const track_changes_1 = tslib_1.__importDefault(require("./track-changes"));
132
132
  const menu_1 = tslib_1.__importDefault(require("./menu"));
133
133
  const statusbar_1 = tslib_1.__importDefault(require("./statusbar"));
134
134
  const add_row_1 = tslib_1.__importDefault(require("./add-row"));
135
+ const brush_1 = tslib_1.__importDefault(require("./brush"));
135
136
  const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
136
137
  const quote_1 = tslib_1.__importDefault(require("./quote"));
137
138
  const news_1 = tslib_1.__importDefault(require("./news"));
@@ -154,6 +155,7 @@ const allIcons = {
154
155
  call: call_1.default,
155
156
  instrument: instrument_1.default,
156
157
  news: news_1.default,
158
+ brush: brush_1.default,
157
159
  'data-set': data_set_1.default,
158
160
  export: export_1.default,
159
161
  campaign: campaign_1.default,