@adaptabletools/adaptable-cjs 23.0.0-canary.3 → 23.0.0-canary.5

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 (277) hide show
  1. package/index.css +116 -61
  2. package/package.json +9 -4
  3. package/src/AdaptableOptions/DefaultAdaptableOptions.js +0 -4
  4. package/src/AdaptableOptions/EditOptions.d.ts +2 -2
  5. package/src/AdaptableOptions/FilterOptions.d.ts +0 -7
  6. package/src/AdaptableState/Common/AdaptableForm.d.ts +18 -1
  7. package/src/AdaptableState/Common/AdaptableForm.js +34 -0
  8. package/src/AdaptableState/Common/AggregationColumns.d.ts +14 -6
  9. package/src/AdaptableState/Common/AggregationColumns.js +30 -3
  10. package/src/AdaptableState/Common/CellDataChangedInfo.d.ts +3 -2
  11. package/src/AdaptableState/Common/ColumnScope.d.ts +4 -0
  12. package/src/AdaptableState/Common/Enums.d.ts +5 -10
  13. package/src/AdaptableState/Common/Enums.js +5 -11
  14. package/src/AdaptableState/PlusMinusState.d.ts +3 -3
  15. package/src/AdaptableState/ShortcutState.d.ts +2 -6
  16. package/src/AdaptableState/StyledColumnState.d.ts +3 -5
  17. package/src/AdaptableState/ThemeState.d.ts +33 -28
  18. package/src/Api/EventApi.d.ts +14 -1
  19. package/src/Api/Events/ThemeChanged.d.ts +6 -0
  20. package/src/Api/Events/ThemeSelected.d.ts +11 -0
  21. package/src/Api/Events/ThemeSelected.js +2 -0
  22. package/src/Api/Implementation/EventApiImpl.js +4 -0
  23. package/src/Api/Implementation/LayoutApiImpl.d.ts +0 -2
  24. package/src/Api/Implementation/LayoutApiImpl.js +0 -14
  25. package/src/Api/Implementation/LayoutHelpers.d.ts +2 -0
  26. package/src/Api/Implementation/LayoutHelpers.js +31 -8
  27. package/src/Api/Implementation/ThemeApiImpl.d.ts +3 -2
  28. package/src/Api/Implementation/ThemeApiImpl.js +19 -15
  29. package/src/Api/Internal/EventInternalApi.d.ts +2 -0
  30. package/src/Api/Internal/EventInternalApi.js +8 -1
  31. package/src/Api/Internal/StyledColumnInternalApi.d.ts +4 -4
  32. package/src/Api/Internal/StyledColumnInternalApi.js +4 -4
  33. package/src/Api/Internal/ThemeInternalApi.d.ts +0 -1
  34. package/src/Api/Internal/ThemeInternalApi.js +0 -10
  35. package/src/Api/LayoutApi.d.ts +1 -8
  36. package/src/Api/ThemeApi.d.ts +6 -2
  37. package/src/Redux/ActionsReducers/ThemeRedux.d.ts +3 -3
  38. package/src/Strategy/CalculatedColumnModule.js +3 -1
  39. package/src/Strategy/FormatColumnModule.js +12 -5
  40. package/src/Strategy/LayoutModule.js +13 -8
  41. package/src/Strategy/StyledColumnModule.js +58 -30
  42. package/src/Utilities/Constants/ReduxConstants.d.ts +2 -2
  43. package/src/Utilities/Constants/ReduxConstants.js +1 -14
  44. package/src/Utilities/Helpers/FormatHelper.js +20 -1
  45. package/src/Utilities/Helpers/SparklineOptionsHelper.d.ts +7 -0
  46. package/src/Utilities/Helpers/SparklineOptionsHelper.js +68 -0
  47. package/src/Utilities/Helpers/StyledColumnGradientHelper.d.ts +23 -1
  48. package/src/Utilities/Helpers/StyledColumnGradientHelper.js +212 -1
  49. package/src/Utilities/Helpers/ThemeHelpers.d.ts +5 -0
  50. package/src/Utilities/Helpers/ThemeHelpers.js +43 -0
  51. package/src/Utilities/Helpers/percentBarPreviewHelper.d.ts +19 -0
  52. package/src/Utilities/Helpers/percentBarPreviewHelper.js +155 -0
  53. package/src/Utilities/ObjectFactory.d.ts +1 -3
  54. package/src/Utilities/ObjectFactory.js +0 -9
  55. package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +1 -0
  56. package/src/Utilities/Services/CalculatedColumnExpressionService.js +7 -0
  57. package/src/Utilities/Services/CalculatedColumnSyntheticChange.d.ts +4 -0
  58. package/src/Utilities/Services/CalculatedColumnSyntheticChange.js +120 -0
  59. package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +1 -0
  60. package/src/Utilities/Services/ThemeService.js +1 -1
  61. package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +17 -16
  62. package/src/View/Alert/Wizard/AlertButtonsEditor.js +113 -102
  63. package/src/View/Alert/Wizard/AlertMessageWizardSection.js +12 -13
  64. package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +54 -54
  65. package/src/View/Alert/Wizard/AlertRulesWizardSection.js +4 -3
  66. package/src/View/Alert/Wizard/AlertScheduledWizardSection.js +1 -1
  67. package/src/View/Alert/Wizard/AlertScopeWizardSection.js +29 -37
  68. package/src/View/Alert/Wizard/AlertTypeWizardSection.js +2 -3
  69. package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +9 -13
  70. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +28 -15
  71. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +7 -9
  72. package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +2 -2
  73. package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
  74. package/src/View/Charting/ChartingWizard/AgChargingWizard/AgChargingWizard.js +3 -10
  75. package/src/View/Charting/ChartingWizard/AgChargingWizard/PreviewChartSection.js +1 -1
  76. package/src/View/Charting/ChartingWizard/AgChargingWizard/SettingsSection.js +35 -52
  77. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/ExternalChartingWizard.js +4 -31
  78. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.d.ts +5 -0
  79. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.js +26 -0
  80. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.d.ts +1 -0
  81. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.js +9 -6
  82. package/src/View/Comments/CommentsEditor.js +1 -1
  83. package/src/View/Components/ColumnFilter/ColumnFilterWindow.js +1 -1
  84. package/src/View/Components/ModuleProfile.js +1 -1
  85. package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +0 -1
  86. package/src/View/Components/Popups/WindowPopups/windowFactory.js +1 -2
  87. package/src/View/Components/RangesComponent.d.ts +7 -2
  88. package/src/View/Components/RangesComponent.js +94 -22
  89. package/src/View/Components/Selectors/ColumnSelector.js +5 -0
  90. package/src/View/Components/StyleComponent.d.ts +1 -0
  91. package/src/View/Components/StyleComponent.js +1 -1
  92. package/src/View/Components/ValueSelector/index.js +70 -57
  93. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +8 -13
  94. package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +8 -8
  95. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
  96. package/src/View/DataImport/DataImportWizard/sections/ColumnsSection.js +11 -12
  97. package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadSection.js +5 -4
  98. package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.js +2 -1
  99. package/src/View/DataImport/DataImportWizard/sections/ValidationSection.js +4 -15
  100. package/src/View/Export/Wizard/ReportColumnsWizardSection.js +24 -27
  101. package/src/View/Export/Wizard/ReportNameWizardSection.js +8 -11
  102. package/src/View/Export/Wizard/ReportRowsWizardSection.js +19 -22
  103. package/src/View/Export/Wizard/ScheduledReportSettings.d.ts +2 -0
  104. package/src/View/Export/Wizard/ScheduledReportSettings.js +12 -12
  105. package/src/View/Export/Wizard/ScheduledReportWizard.js +2 -3
  106. package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +8 -6
  107. package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +22 -21
  108. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +20 -11
  109. package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +19 -3
  110. package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +4 -4
  111. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +7 -0
  112. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +120 -13
  113. package/src/View/FormatColumn/Wizard/FormatColumnPreview.d.ts +15 -0
  114. package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +78 -0
  115. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +4 -0
  116. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +34 -0
  117. package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +11 -6
  118. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +1 -1
  119. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +3 -1
  120. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +64 -13
  121. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +3 -1
  122. package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.d.ts +2 -0
  123. package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.js +19 -0
  124. package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.d.ts +10 -0
  125. package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.js +60 -0
  126. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +2 -3
  127. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +35 -70
  128. package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +14 -10
  129. package/src/View/Layout/LayoutViewPanel.js +23 -21
  130. package/src/View/Layout/TransposedPopup.js +2 -2
  131. package/src/View/Layout/Wizard/LayoutWizard.js +3 -3
  132. package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +2 -3
  133. package/src/View/Layout/Wizard/sections/AggregationsSection.js +116 -26
  134. package/src/View/Layout/Wizard/sections/ColumnsSection.js +79 -79
  135. package/src/View/Layout/Wizard/sections/FilterSection.js +31 -32
  136. package/src/View/Layout/Wizard/sections/GridFilterSection.js +10 -10
  137. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +1 -2
  138. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +101 -51
  139. package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +9 -8
  140. package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +4 -4
  141. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +36 -33
  142. package/src/View/Layout/Wizard/sections/RowSelectionSection.js +2 -2
  143. package/src/View/Layout/Wizard/sections/RowSummarySection.js +95 -73
  144. package/src/View/Layout/Wizard/sections/SettingsSection.js +3 -4
  145. package/src/View/Layout/Wizard/sections/SortSection.js +2 -2
  146. package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -1
  147. package/src/View/NamedQuery/Wizard/NamedQuerySettingsWizardSection.js +7 -12
  148. package/src/View/NamedQuery/Wizard/NamedQueryWizard.js +1 -3
  149. package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.d.ts +4 -0
  150. package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +45 -12
  151. package/src/View/PlusMinus/Wizard/PlusMinusScopeWizardSection.js +10 -17
  152. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.d.ts +2 -6
  153. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +5 -21
  154. package/src/View/PlusMinus/Wizard/PlusMinusWizard.js +15 -21
  155. package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +2 -2
  156. package/src/View/Shortcut/Wizard/ShortcutScopeWizardSection.js +10 -17
  157. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +16 -5
  158. package/src/View/Shortcut/Wizard/ShortcutWizard.js +2 -2
  159. package/src/View/Shortcut/shortcutOperations.d.ts +3 -0
  160. package/src/View/Shortcut/shortcutOperations.js +32 -1
  161. package/src/View/SpecialColumnSettingsWizardStep.js +7 -6
  162. package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +5 -0
  163. package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +26 -16
  164. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.d.ts +10 -2
  165. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +100 -15
  166. package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +14 -0
  167. package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +48 -25
  168. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +2 -3
  169. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +109 -33
  170. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +20 -12
  171. package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.d.ts +5 -0
  172. package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +124 -23
  173. package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.d.ts +1 -0
  174. package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +35 -11
  175. package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.d.ts +5 -0
  176. package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +88 -11
  177. package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.d.ts +5 -0
  178. package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +125 -35
  179. package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.d.ts +1 -0
  180. package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +55 -74
  181. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.d.ts +5 -0
  182. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.js +20 -0
  183. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +6 -12
  184. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarColumnComparisonPreview.js +5 -5
  185. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarRangesPreview.js +2 -1
  186. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.d.ts +5 -4
  187. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.js +11 -13
  188. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.d.ts +5 -0
  189. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.js +20 -0
  190. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.d.ts +3 -0
  191. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +32 -3
  192. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.d.ts +9 -0
  193. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +64 -0
  194. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.d.ts +10 -0
  195. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.js +35 -0
  196. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.d.ts +10 -0
  197. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.js +96 -0
  198. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.d.ts +8 -0
  199. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.js +57 -0
  200. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.d.ts +8 -0
  201. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +58 -0
  202. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.d.ts +18 -0
  203. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.js +66 -0
  204. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.d.ts +10 -0
  205. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +133 -0
  206. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardRangesSection.js +12 -5
  207. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.d.ts +1 -5
  208. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +53 -29
  209. package/src/View/SystemStatus/Utilities/getStatusItemStyle.js +1 -1
  210. package/src/View/Theme/ThemePopup.d.ts +2 -14
  211. package/src/View/Theme/ThemePopup.js +1 -36
  212. package/src/View/UIHelper.js +1 -1
  213. package/src/View/Wizard/OnePageAdaptableWizard.js +6 -20
  214. package/src/View/renderWithAdaptableContext.js +1 -2
  215. package/src/agGrid/AdaptableAgGrid.d.ts +1 -1
  216. package/src/agGrid/AdaptableAgGrid.js +36 -41
  217. package/src/agGrid/AgGridAdapter.d.ts +1 -1
  218. package/src/agGrid/AgGridAdapter.js +27 -17
  219. package/src/agGrid/AgGridColumnAdapter.js +10 -19
  220. package/src/agGrid/AgGridMenuAdapter.d.ts +0 -1
  221. package/src/agGrid/AgGridMenuAdapter.js +20 -37
  222. package/src/agGrid/buildValueAggregationMenuItem.d.ts +19 -0
  223. package/src/agGrid/buildValueAggregationMenuItem.js +114 -0
  224. package/src/agGrid/cellRenderers/IconRenderer.d.ts +6 -0
  225. package/src/agGrid/cellRenderers/IconRenderer.js +46 -17
  226. package/src/agGrid/createAgGridIcon.d.ts +10 -0
  227. package/src/agGrid/createAgGridIcon.js +19 -0
  228. package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +10 -5
  229. package/src/components/Combobox/VirtualizedList.js +5 -5
  230. package/src/components/Combobox/comboboxUtils.d.ts +4 -1
  231. package/src/components/Combobox/comboboxUtils.js +2 -0
  232. package/src/components/Combobox/index.d.ts +1 -0
  233. package/src/components/Combobox/index.js +36 -16
  234. package/src/components/DragAndDropContext/UnusedPanel.js +1 -1
  235. package/src/components/ExpressionEditor/BaseEditorInput.js +1 -1
  236. package/src/components/ExpressionEditor/ExpressionFunctionDocumentation.js +1 -1
  237. package/src/components/Input/NumberInput.js +1 -1
  238. package/src/components/Panel/index.js +1 -1
  239. package/src/components/SimpleButton/index.js +4 -4
  240. package/src/components/Toggle/Toggle.js +1 -1
  241. package/src/components/Toggle/ToggleGroup.js +1 -1
  242. package/src/components/Tree/TreeDropdown/index.js +1 -5
  243. package/src/env.js +2 -2
  244. package/src/layout-manager/src/LayoutManagerModel.d.ts +5 -1
  245. package/src/layout-manager/src/index.js +2 -9
  246. package/src/metamodel/adaptable.metamodel.d.ts +39 -46
  247. package/src/metamodel/adaptable.metamodel.js +1 -1
  248. package/src/types.d.ts +5 -5
  249. package/themes/dark.css +1 -68
  250. package/themes/light.css +1 -5
  251. package/tsconfig.cjs.tsbuildinfo +1 -1
  252. package/src/AdaptableState/Common/FilterActionOnDataChange.d.ts +0 -17
  253. package/src/AdaptableState/Common/FilterActionOnDataChange.js +0 -5
  254. package/src/Aggregation/ParameterizedAggregationRegistry.d.ts +0 -35
  255. package/src/Aggregation/ParameterizedAggregationRegistry.js +0 -74
  256. package/src/Aggregation/definitions/weightedAverageAggregationDefinition.d.ts +0 -3
  257. package/src/Aggregation/definitions/weightedAverageAggregationDefinition.js +0 -58
  258. package/src/Aggregation/parameterizedAggregationColumnMenu.d.ts +0 -8
  259. package/src/Aggregation/parameterizedAggregationColumnMenu.js +0 -143
  260. package/src/Aggregation/parameterizedAggregationHeader.d.ts +0 -13
  261. package/src/Aggregation/parameterizedAggregationHeader.js +0 -65
  262. package/src/Aggregation/parameterizedAggregationHelpers.d.ts +0 -23
  263. package/src/Aggregation/parameterizedAggregationHelpers.js +0 -121
  264. package/src/Aggregation/parameterizedAggregationWizardHelpers.d.ts +0 -9
  265. package/src/Aggregation/parameterizedAggregationWizardHelpers.js +0 -74
  266. package/src/Aggregation/validateParameterizedAggregations.d.ts +0 -4
  267. package/src/Aggregation/validateParameterizedAggregations.js +0 -25
  268. package/src/View/AdaptableComputedCSSVarsContext.d.ts +0 -12
  269. package/src/View/AdaptableComputedCSSVarsContext.js +0 -36
  270. package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.d.ts +0 -12
  271. package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.js +0 -48
  272. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.d.ts +0 -5
  273. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.js +0 -32
  274. package/src/View/Theme/VariantSelector.d.ts +0 -8
  275. package/src/View/Theme/VariantSelector.js +0 -25
  276. package/src/components/Select/CSSNumericVariableWatch.d.ts +0 -11
  277. package/src/components/Select/CSSNumericVariableWatch.js +0 -51
@@ -19,42 +19,34 @@ const AlertScopeWizardSection = (props) => {
19
19
  disableDataTypes = false;
20
20
  disableColumns = false;
21
21
  }
22
- return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "column", className: "twa:p-2 twa:h-full", children: (0, jsx_runtime_1.jsx)(NewScopeComponent_1.NewScopeComponent, { disableColumns: disableColumns, disableDataTypes: disableDataTypes, descriptions: {
23
- rowScope: 'Changes in any Column in the row will trigger an Alert',
24
- columnScope: 'Changes in selected Columns will trigger an Alert',
25
- dataTypeScope: 'Changes in any Column which is of the selected Data Type(s) will trigger an Alert',
26
- }, scope: data.Scope, updateScope: (Scope) => {
27
- const newData = { ...data, Scope };
28
- if (newData.Rule.Predicates) {
29
- const validPredicateIds = new Set(api.alertApi.internalApi.getAlertPredicateDefsForScope(Scope).map((def) => def.id));
30
- newData.Rule = {
31
- Predicates: newData.Rule.Predicates.filter((p) => validPredicateIds.has(p.PredicateId)).filter((predicate) => {
32
- // if there are more than 1 column, then we must eliminate the IN/NotIn predicates
33
- // TODO: this should NOT be required, but the ColumnValueSelector does NOT support creatable values right now
34
- if ((0, ColumnScope_1.isScopeColumnIds)(Scope) && Scope.ColumnIds.length > 1) {
35
- return predicate.PredicateId !== 'In' && predicate.PredicateId !== 'NotIn';
36
- }
37
- return true;
38
- }),
39
- };
40
- }
41
- if (newData.Rule.ObservableExpression !== undefined &&
42
- !api.columnScopeApi.scopeIsAll(Scope)) {
43
- // if it had observable expression and the scope is changed to partial
44
- // we need to reset to not be an observable expression, as observable is not supported
45
- // for partial scope
46
- delete newData.Rule.ObservableExpression;
47
- newData.Rule.BooleanExpression = '';
48
- }
49
- if (newData.Rule.AggregatedBooleanExpression !== undefined &&
50
- !api.columnScopeApi.scopeIsAll(Scope)) {
51
- // if it had aggregation expression and the scope is changed to partial
52
- // we need to reset to not be an aggregation expression, as aggregation is not supported
53
- // for partial scope
54
- delete newData.Rule.AggregatedBooleanExpression;
55
- newData.Rule.BooleanExpression = '';
56
- }
57
- props.onChange(newData);
58
- } }) }));
22
+ return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:h-full", children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", alignItems: "center", className: "twa:p-2 twa:gap-3 twa:border-b twa:mb-2 twa:border-b-foreground/20", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-5 twa:font-medium", children: "Columns" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:max-w-[520px]", children: "Specify which columns should trigger the Alert" })] }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:flex-1 twa:min-h-0 twa:overflow-auto twa:p-2", children: (0, jsx_runtime_1.jsx)(NewScopeComponent_1.NewScopeComponent, { disableColumns: disableColumns, disableDataTypes: disableDataTypes, descriptions: {
23
+ rowScope: 'Changes in any Column in the row will trigger an Alert',
24
+ columnScope: 'Changes in selected Columns will trigger an Alert',
25
+ dataTypeScope: 'Changes in any Column which is of the selected Data Type(s) will trigger an Alert',
26
+ }, scope: data.Scope, updateScope: (Scope) => {
27
+ const newData = { ...data, Scope };
28
+ if (newData.Rule.Predicates) {
29
+ const validPredicateIds = new Set(api.alertApi.internalApi.getAlertPredicateDefsForScope(Scope).map((def) => def.id));
30
+ newData.Rule = {
31
+ Predicates: newData.Rule.Predicates.filter((p) => validPredicateIds.has(p.PredicateId)).filter((predicate) => {
32
+ if ((0, ColumnScope_1.isScopeColumnIds)(Scope) && Scope.ColumnIds.length > 1) {
33
+ return predicate.PredicateId !== 'In' && predicate.PredicateId !== 'NotIn';
34
+ }
35
+ return true;
36
+ }),
37
+ };
38
+ }
39
+ if (newData.Rule.ObservableExpression !== undefined &&
40
+ !api.columnScopeApi.scopeIsAll(Scope)) {
41
+ delete newData.Rule.ObservableExpression;
42
+ newData.Rule.BooleanExpression = '';
43
+ }
44
+ if (newData.Rule.AggregatedBooleanExpression !== undefined &&
45
+ !api.columnScopeApi.scopeIsAll(Scope)) {
46
+ delete newData.Rule.AggregatedBooleanExpression;
47
+ newData.Rule.BooleanExpression = '';
48
+ }
49
+ props.onChange(newData);
50
+ } }) })] }));
59
51
  };
60
52
  exports.AlertScopeWizardSection = AlertScopeWizardSection;
@@ -3,15 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AlertTypeWizardSection = exports.renderAlertTypeSummary = exports.isSettingsValid = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
- const Tabs_1 = require("../../../components/Tabs");
7
6
  const getAlertType_1 = require("../Utilities/getAlertType");
8
7
  const TypeRadio_1 = require("../../Wizard/TypeRadio");
9
8
  const Tag_1 = require("../../../components/Tag");
10
9
  const Flex_1 = require("../../../components/Flex");
11
10
  const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
12
- const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
13
11
  const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
14
12
  const OnePageAdaptableWizard_2 = require("../../Wizard/OnePageAdaptableWizard");
13
+ const Card_1 = require("../../../components/Card");
15
14
  const isSettingsValid = (data, api) => {
16
15
  if (!data.Name?.trim()) {
17
16
  return 'Name is required';
@@ -38,6 +37,6 @@ const AlertTypeWizardSection = (props) => {
38
37
  Name: event.target.value,
39
38
  });
40
39
  };
41
- return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", children: [(0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Tab, { children: "Settings" }), (0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Content, { children: (0, jsx_runtime_1.jsx)(FormLayout_1.default, { children: (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Name", children: (0, jsx_runtime_1.jsx)(Input_1.default, { "data-name": "alert-name", className: "twa:flex-1 twa:max-w-[200px] twa:mr-3", onChange: handleNameChange, placeholder: "Enter Name", value: data.Name ?? '' }) }) }) })] }), (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { className: "twa:mt-2", children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Tab, { children: "Alert Type" }), (0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Content, { children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", children: [(0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { text: (0, getAlertType_1.getAlertTypeText)(getAlertType_1.AlertType.DataChange), description: "A change has been made to the Grid's underlying data", checked: props.alertType === getAlertType_1.AlertType.DataChange, onClick: () => props.onAlertTypeChange(getAlertType_1.AlertType.DataChange) }), (0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { text: (0, getAlertType_1.getAlertTypeText)(getAlertType_1.AlertType.RowChange), description: "A Row was added or removed from the data source", checked: props.alertType === getAlertType_1.AlertType.RowChange, onClick: () => props.onAlertTypeChange(getAlertType_1.AlertType.RowChange) }), (0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { text: (0, getAlertType_1.getAlertTypeText)(getAlertType_1.AlertType.Aggregation), description: "A change has been made to aggregated data (i.e. from multiple Rows)", onClick: () => props.onAlertTypeChange(getAlertType_1.AlertType.Aggregation), checked: props.alertType === getAlertType_1.AlertType.Aggregation }), (0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { text: (0, getAlertType_1.getAlertTypeText)(getAlertType_1.AlertType.Observable), description: "A specified change (or lack of change) over time has been observed in the Grid", onClick: () => props.onAlertTypeChange(getAlertType_1.AlertType.Observable), checked: props.alertType === getAlertType_1.AlertType.Observable }), (0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { text: (0, getAlertType_1.getAlertTypeText)(getAlertType_1.AlertType.Validation), description: "A change has broken a data validation rule", checked: props.alertType === getAlertType_1.AlertType.Validation, onClick: () => props.onAlertTypeChange(getAlertType_1.AlertType.Validation) }), (0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { text: (0, getAlertType_1.getAlertTypeText)(getAlertType_1.AlertType.Scheduled), description: "A reminder fires at a date and time you choose", checked: props.alertType === getAlertType_1.AlertType.Scheduled, onClick: () => props.onAlertTypeChange(getAlertType_1.AlertType.Scheduled) })] }) })] })] }));
40
+ return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Name" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Provide a unique name for the Alert" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:p-1", children: (0, jsx_runtime_1.jsx)(Input_1.default, { "data-name": "alert-name", className: "twa:max-w-[300px] twa:w-full", onChange: handleNameChange, placeholder: "Enter Name", value: data.Name ?? '' }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Alert Type" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose when the Alert should fire" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", children: [(0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { text: (0, getAlertType_1.getAlertTypeText)(getAlertType_1.AlertType.DataChange), description: "A change has been made to the Grid's underlying data", checked: props.alertType === getAlertType_1.AlertType.DataChange, onClick: () => props.onAlertTypeChange(getAlertType_1.AlertType.DataChange) }), (0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { text: (0, getAlertType_1.getAlertTypeText)(getAlertType_1.AlertType.RowChange), description: "A Row was added or removed from the data source", checked: props.alertType === getAlertType_1.AlertType.RowChange, onClick: () => props.onAlertTypeChange(getAlertType_1.AlertType.RowChange) }), (0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { text: (0, getAlertType_1.getAlertTypeText)(getAlertType_1.AlertType.Aggregation), description: "A change has been made to aggregated data (i.e. from multiple Rows)", onClick: () => props.onAlertTypeChange(getAlertType_1.AlertType.Aggregation), checked: props.alertType === getAlertType_1.AlertType.Aggregation }), (0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { text: (0, getAlertType_1.getAlertTypeText)(getAlertType_1.AlertType.Observable), description: "A specified change (or lack of change) over time has been observed in the Grid", onClick: () => props.onAlertTypeChange(getAlertType_1.AlertType.Observable), checked: props.alertType === getAlertType_1.AlertType.Observable }), (0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { text: (0, getAlertType_1.getAlertTypeText)(getAlertType_1.AlertType.Validation), description: "A change has broken a data validation rule", checked: props.alertType === getAlertType_1.AlertType.Validation, onClick: () => props.onAlertTypeChange(getAlertType_1.AlertType.Validation) }), (0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { text: (0, getAlertType_1.getAlertTypeText)(getAlertType_1.AlertType.Scheduled), description: "A reminder fires at a date and time you choose", checked: props.alertType === getAlertType_1.AlertType.Scheduled, onClick: () => props.onAlertTypeChange(getAlertType_1.AlertType.Scheduled) })] }) })] })] }));
42
41
  };
43
42
  exports.AlertTypeWizardSection = AlertTypeWizardSection;
@@ -5,13 +5,11 @@ const tslib_1 = require("tslib");
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const react_1 = require("react");
7
7
  const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
8
- const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
9
8
  const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
10
9
  const CheckBox_1 = require("../../../components/CheckBox");
11
- const ErrorBox_1 = tslib_1.__importDefault(require("../../../components/ErrorBox"));
12
- const Tabs_1 = require("../../../components/Tabs");
13
10
  const Tag_1 = require("../../../components/Tag");
14
11
  const Flex_1 = require("../../../components/Flex");
12
+ const Card_1 = require("../../../components/Card");
15
13
  const renderCalculatedColumnDefinitionSummary = (data) => {
16
14
  return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:text-2 twa:grid twa:items-center twa:grid-cols-[auto_1fr] twa:gap-2", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { children: "Column Identifier:" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { children: (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: data.ColumnId }) }), data.FriendlyName ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { children: "Column Name:" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { children: (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: data.FriendlyName ?? data.ColumnId }) })] })) : null] }));
17
15
  };
@@ -27,7 +25,7 @@ const isValidCalculatedColumnDefinition = (data, api) => {
27
25
  };
28
26
  exports.isValidCalculatedColumnDefinition = isValidCalculatedColumnDefinition;
29
27
  const CalculatedColumnDefinitionWizardSection = (props) => {
30
- const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
28
+ const { data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
31
29
  const handleColumnIdChange = (event) => {
32
30
  let e = event.target;
33
31
  props.onChange({
@@ -43,8 +41,6 @@ const CalculatedColumnDefinitionWizardSection = (props) => {
43
41
  });
44
42
  };
45
43
  const inEdit = props.isEdit;
46
- const validCheck = (0, exports.isValidCalculatedColumnDefinition)(data, api);
47
- const ErrorMessage = validCheck === true ? null : validCheck;
48
44
  const [ColumnNameFocused, setColumnNameFocused] = (0, react_1.useState)(false);
49
45
  const ColumnName = data.FriendlyName;
50
46
  const ColumnId = data.ColumnId;
@@ -58,12 +54,12 @@ const CalculatedColumnDefinitionWizardSection = (props) => {
58
54
  },
59
55
  });
60
56
  };
61
- return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { "data-name": 'calculated-column-definition', children: [(0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { autoFocus: false, children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Tab, { children: "Column Details" }), (0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Content, { children: (0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "row", children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Column Name", children: (0, jsx_runtime_1.jsx)(Input_1.default, { "data-name": "column-id", value: data.ColumnId || '', style: { width: '100%', maxWidth: 500 }, autoFocus: !inEdit, disabled: inEdit, type: "text", placeholder: "Enter a Column Name", onChange: handleColumnIdChange }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Column Header", children: (0, jsx_runtime_1.jsx)(Input_1.default, { "data-name": "column-name", autoFocus: inEdit, onFocus: () => {
62
- setColumnNameFocused(true);
63
- }, onBlur: () => {
64
- setColumnNameFocused(false);
65
- }, value: ColumnNameFocused ? ColumnName || '' : ColumnName || ColumnId || '', style: { width: '100%', maxWidth: 500 }, type: "text", placeholder: "Enter a Column Header (optional)", onChange: handleColumnNameChange }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Column Header Tooltip", children: (0, jsx_runtime_1.jsx)(Input_1.default, { "data-name": "header-tooltip", type: "text", style: { width: '100%', maxWidth: 500 }, value: HeaderToolTip, onChange: (e) => handleSpecialColumnSettingsChange({
66
- HeaderToolTip: e.target.value,
67
- }) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "", children: (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { "data-name": "column-show-tooltip", onChange: (checked) => handleSpecialColumnSettingsChange({ ShowToolTip: checked }), checked: ShowToolTip, children: "Show Expression as Cell Tooltip" }) })] }) }) })] }), ErrorMessage ? (0, jsx_runtime_1.jsx)(ErrorBox_1.default, { className: "twa:mt-2", children: ErrorMessage }) : null] }));
57
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { "data-name": 'calculated-column-definition', children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Column Name" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Unique identifier for the Calculated Column" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:p-1", children: (0, jsx_runtime_1.jsx)(Input_1.default, { "data-name": "column-id", value: data.ColumnId || '', className: "twa:max-w-[500px] twa:w-full", autoFocus: !inEdit, disabled: inEdit, type: "text", placeholder: "Enter a Column Name", onChange: handleColumnIdChange }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Column Header" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Display name shown in the Column Header (Name used if not provided)" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:p-1", children: (0, jsx_runtime_1.jsx)(Input_1.default, { "data-name": "column-name", autoFocus: inEdit, onFocus: () => {
58
+ setColumnNameFocused(true);
59
+ }, onBlur: () => {
60
+ setColumnNameFocused(false);
61
+ }, value: ColumnNameFocused ? ColumnName || '' : ColumnName || ColumnId || '', className: "twa:max-w-[500px] twa:w-full", type: "text", placeholder: "Enter a Column Header (optional)", onChange: handleColumnNameChange }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Column Header Tooltip" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Optional text shown when hovering over the Column Header" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:p-1", children: (0, jsx_runtime_1.jsx)(Input_1.default, { "data-name": "header-tooltip", type: "text", className: "twa:max-w-[500px] twa:w-full", value: HeaderToolTip, onChange: (e) => handleSpecialColumnSettingsChange({
62
+ HeaderToolTip: e.target.value,
63
+ }) }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Cell Tooltip" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Show the Expression as a tooltip when hovering over each cell" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { "data-name": "column-show-tooltip", onChange: (checked) => handleSpecialColumnSettingsChange({ ShowToolTip: checked }), checked: ShowToolTip, children: "Show Expression as Cell Tooltip" }) })] })] }) }));
68
64
  };
69
65
  exports.CalculatedColumnDefinitionWizardSection = CalculatedColumnDefinitionWizardSection;
@@ -5,10 +5,24 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
7
7
  const ExpressionEditor_1 = require("../../../components/ExpressionEditor");
8
- const Tabs_1 = require("../../../components/Tabs");
9
8
  const CodeBlock_1 = require("../../../components/CodeBlock");
10
9
  const StringExtensions_1 = require("../../../Utilities/Extensions/StringExtensions");
11
10
  const Flex_1 = require("../../../components/Flex");
11
+ const Card_1 = require("../../../components/Card");
12
+ const getExpressionTypeDescription = (expressionType) => {
13
+ switch (expressionType) {
14
+ case 'ScalarExpression':
15
+ return 'Define an expression using values from other cells in each row';
16
+ case 'AggregatedScalarExpression':
17
+ return 'Define an expression using aggregated values from other rows';
18
+ case 'CumulativeAggregatedExpression':
19
+ return 'Define a cumulative expression using values from other rows';
20
+ case 'QuantileAggregatedExpression':
21
+ return 'Define a quantile expression using values from other rows';
22
+ default:
23
+ return '';
24
+ }
25
+ };
12
26
  const renderCalculatedColumnExpressionSummary = (data) => {
13
27
  const { api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
14
28
  return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:text-2", children: ["Column scalar expression:", ' ', (0, jsx_runtime_1.jsx)(CodeBlock_1.CodeBlock, { children: api.internalApi.getAdaptableQueryExpressionText(data.Query) })] }));
@@ -39,8 +53,6 @@ const CalculatedColumnExpressionWizardSection = (props) => {
39
53
  CalculatedColumnSettings: {
40
54
  ...data.CalculatedColumnSettings,
41
55
  DataType: dataType,
42
- // Pivotable,
43
- // Aggregatable,
44
56
  },
45
57
  });
46
58
  };
@@ -55,17 +67,18 @@ const CalculatedColumnExpressionWizardSection = (props) => {
55
67
  }
56
68
  };
57
69
  const columns = api.columnApi.internalApi.getQueryableColumnsForUIEditor();
58
- return ((0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { autoFocus: false, height: "100%", children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Tab, { children: (0, StringExtensions_1.Humanize)(props.expressionType) }), (0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Content, { children: (() => {
59
- switch (props.expressionType) {
60
- case 'ScalarExpression':
61
- return ((0, jsx_runtime_1.jsx)(ExpressionEditor_1.ExpressionEditor, { type: 'scalar', module: moduleInfo.ModuleName, className: "twa:pl-0", value: data.Query.ScalarExpression, onChange: (ScalarExpression) => setCalculatedColumnExpression({ ScalarExpression }), initialData: initialData, columns: columns, fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), isFullExpression: true, api: api }));
62
- case 'AggregatedScalarExpression':
63
- case 'CumulativeAggregatedExpression':
64
- case 'QuantileAggregatedExpression':
65
- return ((0, jsx_runtime_1.jsx)(ExpressionEditor_1.ExpressionEditor, { type: getEditorType(props.expressionType), module: moduleInfo.ModuleName, className: "twa:pl-0", value: data.Query.AggregatedScalarExpression, onChange: (AggregatedScalarExpression) => setCalculatedColumnExpression({ AggregatedScalarExpression }), initialData: initialData, columns: columns, namedQueries: api.namedQueryApi.getNamedQueries(), isFullExpression: true, api: api }));
66
- default:
67
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
68
- }
69
- })() })] }));
70
+ const expressionEditor = (() => {
71
+ switch (props.expressionType) {
72
+ case 'ScalarExpression':
73
+ return ((0, jsx_runtime_1.jsx)(ExpressionEditor_1.ExpressionEditor, { type: 'scalar', module: moduleInfo.ModuleName, className: "twa:pl-0", value: data.Query.ScalarExpression, onChange: (ScalarExpression) => setCalculatedColumnExpression({ ScalarExpression }), initialData: initialData, columns: columns, fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), isFullExpression: true, api: api }));
74
+ case 'AggregatedScalarExpression':
75
+ case 'CumulativeAggregatedExpression':
76
+ case 'QuantileAggregatedExpression':
77
+ return ((0, jsx_runtime_1.jsx)(ExpressionEditor_1.ExpressionEditor, { type: getEditorType(props.expressionType), module: moduleInfo.ModuleName, className: "twa:pl-0", value: data.Query.AggregatedScalarExpression, onChange: (AggregatedScalarExpression) => setCalculatedColumnExpression({ AggregatedScalarExpression }), initialData: initialData, columns: columns, namedQueries: api.namedQueryApi.getNamedQueries(), isFullExpression: true, api: api }));
78
+ default:
79
+ return null;
80
+ }
81
+ })();
82
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "column", className: "twa:h-full twa:gap-3 twa:p-3", children: (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:flex-1 twa:min-h-0", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: (0, StringExtensions_1.Humanize)(props.expressionType) }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: getExpressionTypeDescription(props.expressionType) })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:flex-1 twa:min-h-0", children: expressionEditor })] }) }));
70
83
  };
71
84
  exports.CalculatedColumnExpressionWizardSection = CalculatedColumnExpressionWizardSection;
@@ -6,15 +6,13 @@ const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const React = tslib_1.__importStar(require("react"));
7
7
  const react_1 = require("react");
8
8
  const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
9
- const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
10
9
  const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
11
- const ErrorBox_1 = tslib_1.__importDefault(require("../../../components/ErrorBox"));
12
- const Tabs_1 = require("../../../components/Tabs");
13
10
  const SpecialColumnSettingsWizardStep_1 = require("../../SpecialColumnSettingsWizardStep");
14
11
  const getCalculatedColumnSettingsTags_1 = require("../Utilities/getCalculatedColumnSettingsTags");
15
12
  const Flex_1 = require("../../../components/Flex");
16
13
  const Tag_1 = require("../../../components/Tag/Tag");
17
14
  const NewSelect_1 = require("../../../components/NewSelect");
15
+ const Card_1 = require("../../../components/Card");
18
16
  const renderCalculatedColumnSettingsSummary = (data) => {
19
17
  const options = (0, getCalculatedColumnSettingsTags_1.getCalculatedColumnSettingsTags)(data.CalculatedColumnSettings);
20
18
  return (0, jsx_runtime_1.jsx)(Tag_1.TagList, { tags: options });
@@ -22,7 +20,7 @@ const renderCalculatedColumnSettingsSummary = (data) => {
22
20
  exports.renderCalculatedColumnSettingsSummary = renderCalculatedColumnSettingsSummary;
23
21
  const isValidCalculatedColumnSettings = (data) => {
24
22
  if (!data.CalculatedColumnSettings?.DataType) {
25
- return 'A data type is required. It could not be inferred from the expression.';
23
+ return 'Please select a data type (could not be inferred from the expression)';
26
24
  }
27
25
  return true;
28
26
  };
@@ -70,10 +68,10 @@ const CalculatedColumnSettingsWizardSection = (props) => {
70
68
  { value: 'boolean', label: 'Boolean' },
71
69
  { value: 'numberArray', label: 'NumberArray' },
72
70
  ];
73
- return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { "data-name": 'calculated-column-settings', children: [(0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { autoFocus: false, children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Tab, { children: "Column Settings" }), (0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Content, { children: (0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "row", children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Data Type", children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { "data-name": "column-type", placeholder: "Select Data Type", items: options, value: dataType, onValueChange: (value) => handleDataTypeChange(value) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Width", children: (0, jsx_runtime_1.jsx)(Input_1.default, { "data-name": "column-width", type: "number", width: 300, value: Width || '', onChange: (e) => handleSpecialColumnSettingsChange({
74
- Width: Number(e.target.value),
75
- }) }) })] }) }) })] }), ErrorMessage ? (0, jsx_runtime_1.jsx)(ErrorBox_1.default, { className: "twa:mt-2", children: ErrorMessage }) : null, (0, jsx_runtime_1.jsx)(SpecialColumnSettingsWizardStep_1.SpecialColumnSettingsWizardStep, { isEditable: false,
76
- // @ts-ignore CalculatedColumn has a broader DataType
77
- settings: data.CalculatedColumnSettings, onChange: handleSpecialColumnSettingsChange })] }));
71
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { "data-name": 'calculated-column-settings', children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Data Type" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose the data type for the Calculated Column values" })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card.Body, { className: "twa:p-1 twa:gap-1", children: [(0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { "data-name": "column-type", placeholder: "Select Data Type", items: options, value: dataType, onValueChange: (value) => handleDataTypeChange(value), className: "twa:max-w-[300px]" }), ErrorMessage ? ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2 twa:text-error", children: ErrorMessage })) : null] })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Width" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Optional Column Width in pixels" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:p-1", children: (0, jsx_runtime_1.jsx)(Input_1.default, { "data-name": "column-width", type: "number", className: "twa:max-w-[300px]", value: Width || '', onChange: (e) => handleSpecialColumnSettingsChange({
72
+ Width: Number(e.target.value),
73
+ }) }) })] }), (0, jsx_runtime_1.jsx)(SpecialColumnSettingsWizardStep_1.SpecialColumnSettingsWizardStep, { isEditable: false,
74
+ // @ts-ignore CalculatedColumn has a broader DataType
75
+ settings: data.CalculatedColumnSettings, onChange: handleSpecialColumnSettingsChange })] }) }));
78
76
  };
79
77
  exports.CalculatedColumnSettingsWizardSection = CalculatedColumnSettingsWizardSection;
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CalculatedColumnTypeWizardSection = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const Tabs_1 = require("../../../components/Tabs");
6
5
  const TypeRadio_1 = require("../../Wizard/TypeRadio");
7
6
  const Flex_1 = require("../../../components/Flex");
7
+ const Card_1 = require("../../../components/Card");
8
8
  const CalculatedColumnTypeWizardSection = (props) => {
9
- return ((0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Tab, { children: "Calculated Column Type" }), (0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Content, { children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", children: [(0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { text: 'Standard', description: "The calculated value is derived from other cells in the row", checked: props.type === 'ScalarExpression', onClick: () => props.onTypeChange('ScalarExpression') }), (0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { text: 'Aggregated', description: "The calculated value is derived from other rows", checked: props.type === 'AggregatedScalarExpression', onClick: () => props.onTypeChange('AggregatedScalarExpression') }), (0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { text: 'Cumulative', description: "The calculated value is derived cumulatively from other rows", checked: props.type === 'CumulativeAggregatedExpression', onClick: () => props.onTypeChange('CumulativeAggregatedExpression') }), (0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { text: 'Quantile', description: "The calculated value is derived from other rows using quantile aggregations", checked: props.type === 'QuantileAggregatedExpression', onClick: () => props.onTypeChange('QuantileAggregatedExpression') })] }) })] }));
9
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsx)(Card_1.Card.Title, { children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Calculated Column Type" }) }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", children: [(0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { text: 'Standard', description: "The calculated value is derived from other cells in the row", checked: props.type === 'ScalarExpression', onClick: () => props.onTypeChange('ScalarExpression') }), (0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { text: 'Aggregated', description: "The calculated value is derived from other rows", checked: props.type === 'AggregatedScalarExpression', onClick: () => props.onTypeChange('AggregatedScalarExpression') }), (0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { text: 'Cumulative', description: "The calculated value is derived cumulatively from other rows", checked: props.type === 'CumulativeAggregatedExpression', onClick: () => props.onTypeChange('CumulativeAggregatedExpression') }), (0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { text: 'Quantile', description: "The calculated value is derived from other rows using quantile aggregations", checked: props.type === 'QuantileAggregatedExpression', onClick: () => props.onTypeChange('QuantileAggregatedExpression') })] }) })] }) }));
10
10
  };
11
11
  exports.CalculatedColumnTypeWizardSection = CalculatedColumnTypeWizardSection;
@@ -59,7 +59,7 @@ class CellSummaryViewPanelComponent extends React.Component {
59
59
  'twa:flex-1 twa:flex-wrap': !isToolbar,
60
60
  }), children: [(0, jsx_runtime_1.jsx)(Flex_1.Flex, { className: "twa:flex-1", children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { ariaLabel: "Cell Summary Operation Selector", className: `ab-${elementType}__CellSummary__select twa:w-full`, disabled: shouldDisable, items: [...operationMenuItems, ...operationDefinitions], onValueChange: (x) => this.props.onCellSummaryOperationChange(x), value: this.props.CellSummaryOperation }) }), (0, jsx_runtime_1.jsx)(Flex_1.Flex, { className: "twa:items-center twa:gap-1", children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Flex, { className: (0, clsx_1.default)(`ab-${elementType}__CellSummary__value twa:min-w-[50px]`, {
61
61
  'twa:rounded-standard twa:text-color-text-on-info twa:bg-color-info twa:text-2': !isToolbar,
62
- 'twa:flex-1 twa:text-color-text-on-primary twa:justify-center': isToolbar,
62
+ 'twa:flex-1 twa:text-primary-foreground twa:justify-center': isToolbar,
63
63
  }), children: operationValue }), (0, jsx_runtime_1.jsx)(AdaptablePopover_1.AdaptablePopover, { popoverMaxWidth: 360, className: "ab-ToolPanel__CellSummary__info", bodyText: [cellSummaryPopover], useButton: true, showEvent: 'focus', hideEvent: "blur", tooltipText: 'Show Cell Summaries', disabled: !this.props.CellSummary?.Count })] }) })] }));
64
64
  }
65
65
  checkSelectedCells() {
@@ -6,7 +6,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const React = tslib_1.__importStar(require("react"));
7
7
  const AdaptableContext_1 = require("../../../AdaptableContext");
8
8
  const OnePageAdaptableWizard_1 = require("../../../Wizard/OnePageAdaptableWizard");
9
- const PreviewChartSection_1 = require("./PreviewChartSection");
10
9
  const SettingsSection_1 = require("./SettingsSection");
11
10
  const ObjectTagsWizardSection_1 = require("../../../Wizard/ObjectTagsWizardSection");
12
11
  const Flex_1 = require("../../../../components/Flex");
@@ -21,10 +20,10 @@ const AgChargingWizard = (props) => {
21
20
  }, [chartDefinition]);
22
21
  return ((0, jsx_runtime_1.jsx)(OnePageAdaptableWizard_1.OnePageAdaptableWizard, { defaultCurrentSectionName: props.defaultCurrentSectionName, moduleInfo: props.moduleInfo, data: chartDefinition, onHide: props.onCloseWizard, onFinish: handleFinish, sections: [
23
22
  {
24
- title: 'Settings',
25
- details: 'Chart Settings',
23
+ title: 'Chart',
24
+ details: 'Configure chart properties and preview the result',
26
25
  isValid: SettingsSection_1.isSettingsValid,
27
- render: () => ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:p-2", children: (0, jsx_runtime_1.jsx)(SettingsSection_1.SettingsSection, { chartDefinition: chartDefinition, onChange: setChartDefinition }) })),
26
+ render: () => ((0, jsx_runtime_1.jsx)(SettingsSection_1.SettingsSection, { chartDefinition: chartDefinition, onChange: setChartDefinition })),
28
27
  },
29
28
  {
30
29
  details: 'Select Chart Tags',
@@ -33,12 +32,6 @@ const AgChargingWizard = (props) => {
33
32
  render: () => ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:p-2", children: (0, jsx_runtime_1.jsx)(ObjectTagsWizardSection_1.ObjectTagsWizardSection, { onChange: setChartDefinition }) })),
34
33
  renderSummary: ObjectTagsWizardSection_1.renderObjectTagsSummary,
35
34
  },
36
- '-',
37
- {
38
- title: 'Preview Chart',
39
- details: 'Chart Preview',
40
- render: () => ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:p-2", children: (0, jsx_runtime_1.jsx)(PreviewChartSection_1.PreviewChartSection, { chartDefinition: chartDefinition, onChange: setChartDefinition }) })),
41
- },
42
35
  ] }));
43
36
  };
44
37
  exports.AgChargingWizard = AgChargingWizard;
@@ -33,6 +33,6 @@ const PreviewChartSection = (props) => {
33
33
  });
34
34
  }
35
35
  }, [currentChartModels]);
36
- return (0, jsx_runtime_1.jsx)("div", { ref: divRef });
36
+ return (0, jsx_runtime_1.jsx)("div", { ref: divRef, className: "twa:min-h-[280px] twa:h-full twa:w-full" });
37
37
  };
38
38
  exports.PreviewChartSection = PreviewChartSection;
@@ -3,65 +3,48 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SettingsSection = exports.isSettingsValid = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
- const React = tslib_1.__importStar(require("react"));
7
6
  const CheckBox_1 = require("../../../../components/CheckBox");
8
- const DropdownButton_1 = tslib_1.__importDefault(require("../../../../components/DropdownButton"));
9
- const FormLayout_1 = tslib_1.__importStar(require("../../../../components/FormLayout"));
7
+ const NewSelect_1 = require("../../../../components/NewSelect");
10
8
  const chartingHelper_1 = require("../../../../Utilities/Helpers/chartingHelper");
11
- const AdaptableInput_1 = tslib_1.__importDefault(require("../../../Components/AdaptableInput"));
9
+ const Flex_1 = require("../../../../components/Flex");
10
+ const Card_1 = require("../../../../components/Card");
11
+ const Input_1 = tslib_1.__importDefault(require("../../../../components/Input"));
12
+ const PreviewChartSection_1 = require("./PreviewChartSection");
12
13
  const isSettingsValid = (chartDefinition, api) => {
13
14
  return (0, chartingHelper_1.validateChartName)(api, chartDefinition.Name, chartDefinition.Uuid);
14
15
  };
15
16
  exports.isSettingsValid = isSettingsValid;
17
+ const AGG_FUNCS = ['sum', 'min', 'max', 'count', 'avg', 'first', 'last'];
16
18
  const SettingsSection = (props) => {
17
- const handleNameChange = React.useCallback((event) => {
18
- props.onChange({
19
- ...props.chartDefinition,
20
- Name: event.target.value,
21
- Model: props.chartDefinition.Model,
22
- });
23
- }, [props.chartDefinition]);
24
- const handleUnLinkChange = React.useCallback(() => {
25
- props.onChange({
26
- ...props.chartDefinition,
27
- Model: {
28
- ...props.chartDefinition.Model,
29
- unlinkChart: !props.chartDefinition.Model.unlinkChart,
30
- },
31
- });
32
- }, [props.chartDefinition]);
33
- const handleSuppressChartRanges = React.useCallback(() => {
34
- props.onChange({
35
- ...props.chartDefinition,
36
- Model: {
37
- ...props.chartDefinition.Model,
38
- suppressChartRanges: !props.chartDefinition.Model.suppressChartRanges,
39
- },
40
- });
41
- }, [props.chartDefinition]);
42
- const aggFuncs = ['sum', 'min', 'max', 'count', 'avg', 'first', 'last'];
43
- const aggFuncsOptions = aggFuncs.map((aggFunc) => ({
44
- label: aggFunc,
45
- onClick: () => {
46
- props.onChange({
47
- ...props.chartDefinition,
48
- Model: {
49
- ...props.chartDefinition.Model,
50
- aggFunc,
51
- },
52
- });
53
- },
19
+ const { chartDefinition, onChange } = props;
20
+ const aggFunc = chartDefinition.Model.aggFunc;
21
+ const showAggFunc = chartDefinition.Model.modelType === 'range' && typeof aggFunc !== 'function';
22
+ const aggFuncsOptions = AGG_FUNCS.map((option) => ({
23
+ label: option,
24
+ value: option,
54
25
  }));
55
- const aggFunc = props.chartDefinition.Model.aggFunc;
56
- const handleAggFuncClear = React.useCallback(() => {
57
- props.onChange({
58
- ...props.chartDefinition,
59
- Model: {
60
- ...props.chartDefinition.Model,
61
- aggFunc: '',
62
- },
63
- });
64
- }, [props.chartDefinition]);
65
- return ((0, jsx_runtime_1.jsxs)(FormLayout_1.default, { children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Name", children: (0, jsx_runtime_1.jsx)(AdaptableInput_1.default, { onChange: handleNameChange, value: props.chartDefinition.Name }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Unlink Chart", children: (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { onClick: handleUnLinkChange, checked: props.chartDefinition.Model.unlinkChart }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Suppress Chart Ranges", children: (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { onClick: handleSuppressChartRanges, checked: props.chartDefinition.Model.suppressChartRanges }) }), props.chartDefinition.Model.modelType === 'range' && typeof aggFunc !== 'function' && ((0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Agg Func", children: (0, jsx_runtime_1.jsx)(DropdownButton_1.default, { columns: ['label'], items: aggFuncsOptions, onClear: handleAggFuncClear, children: aggFunc ? aggFunc : 'Select ' }) }))] }));
26
+ return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3 twa:h-full twa:min-h-0", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Name" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Provide a unique name for the chart" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:p-1", children: (0, jsx_runtime_1.jsx)(Input_1.default, { "data-name": "chart-name", className: "twa:max-w-[300px] twa:w-full", onChange: (event) => onChange({
27
+ ...chartDefinition,
28
+ Name: event.target.value,
29
+ Model: chartDefinition.Model,
30
+ }), value: chartDefinition.Name ?? '', placeholder: "Enter chart name" }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Unlink Chart" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "When enabled, the chart is not linked to the grid data range" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { "data-name": "unlink-chart", checked: chartDefinition.Model.unlinkChart, onChange: (checked) => onChange({
31
+ ...chartDefinition,
32
+ Model: {
33
+ ...chartDefinition.Model,
34
+ unlinkChart: checked,
35
+ },
36
+ }), children: "Unlink from data" }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Suppress Chart Ranges" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Hide chart range highlights on the grid while the chart is open" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { "data-name": "suppress-chart-ranges", checked: chartDefinition.Model.suppressChartRanges, onChange: (checked) => onChange({
37
+ ...chartDefinition,
38
+ Model: {
39
+ ...chartDefinition.Model,
40
+ suppressChartRanges: checked,
41
+ },
42
+ }), children: "Suppress chart ranges" }) })] }), showAggFunc ? ((0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Aggregation" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Aggregation function used for range charts" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:p-1", children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { "data-name": "chart-agg-func", placeholder: "Select", className: "twa:max-w-[300px]", items: aggFuncsOptions, value: aggFunc || undefined, onValueChange: (value) => onChange({
43
+ ...chartDefinition,
44
+ Model: {
45
+ ...chartDefinition.Model,
46
+ aggFunc: value,
47
+ },
48
+ }) }) })] })) : null, (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:flex-1 twa:min-h-0", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Preview" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Live preview of the chart \u2014 changes here are reflected in the chart model" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:flex-1 twa:min-h-[280px]", children: (0, jsx_runtime_1.jsx)(PreviewChartSection_1.PreviewChartSection, { chartDefinition: chartDefinition, onChange: onChange }) })] })] }));
66
49
  };
67
50
  exports.SettingsSection = SettingsSection;
@@ -7,25 +7,6 @@ const React = tslib_1.__importStar(require("react"));
7
7
  const AdaptableContext_1 = require("../../../AdaptableContext");
8
8
  const OnePageAdaptableWizard_1 = require("../../../Wizard/OnePageAdaptableWizard");
9
9
  const SettingsSection_1 = require("./SettingsSection");
10
- const Flex_1 = require("../../../../components/Flex");
11
- const PreviewChartSection = ({ chartDefinition }) => {
12
- const adaptable = (0, AdaptableContext_1.useAdaptable)();
13
- const divRef = React.useRef(null);
14
- React.useEffect(() => {
15
- if (!divRef.current) {
16
- return;
17
- }
18
- const container = {
19
- name: 'Preview Chart',
20
- element: divRef.current,
21
- };
22
- const transientChartDefinition = adaptable.api.chartingApi.internalApi.onPreviewExternalChart(chartDefinition, container);
23
- return () => {
24
- adaptable.api.chartingApi.internalApi.onHideExternalChart(transientChartDefinition);
25
- };
26
- }, [divRef]);
27
- return (0, jsx_runtime_1.jsx)("div", { ref: divRef });
28
- };
29
10
  const ExternalChartingWizard = (props) => {
30
11
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
31
12
  const onPreviewChart = adaptable.api.optionsApi.getChartingOptions().externalChartingOptions?.onPreviewChart;
@@ -38,19 +19,11 @@ const ExternalChartingWizard = (props) => {
38
19
  };
39
20
  return ((0, jsx_runtime_1.jsx)(OnePageAdaptableWizard_1.OnePageAdaptableWizard, { defaultCurrentSectionName: props.defaultCurrentSectionName, moduleInfo: props.moduleInfo, data: chartDefinition, onHide: props.onCloseWizard, onFinish: handleFinish, sections: [
40
21
  {
41
- title: 'Settings',
42
- details: 'Chart Settings',
22
+ title: 'Chart',
23
+ details: 'Configure chart properties and preview the result',
43
24
  isValid: SettingsSection_1.isSettingsValid,
44
- render: () => ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:p-2", children: (0, jsx_runtime_1.jsx)(SettingsSection_1.SettingsSection, { chartDefinition: chartDefinition, onChange: setChartDefinition }) })),
25
+ render: () => ((0, jsx_runtime_1.jsx)(SettingsSection_1.SettingsSection, { chartDefinition: chartDefinition, onChange: setChartDefinition, showPreview: Boolean(onPreviewChart) })),
45
26
  },
46
- onPreviewChart
47
- ? {
48
- title: 'Preview Chart',
49
- render: () => {
50
- return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:p-2", children: (0, jsx_runtime_1.jsx)(PreviewChartSection, { chartDefinition: chartDefinition }) }));
51
- },
52
- }
53
- : null,
54
- ].filter(Boolean) }));
27
+ ] }));
55
28
  };
56
29
  exports.ExternalChartingWizard = ExternalChartingWizard;
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import { ExternalChartDefinition } from '../../../../AdaptableState/ChartingState';
3
+ export declare const PreviewChartSection: React.FunctionComponent<{
4
+ chartDefinition: ExternalChartDefinition;
5
+ }>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PreviewChartSection = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const React = tslib_1.__importStar(require("react"));
7
+ const AdaptableContext_1 = require("../../../AdaptableContext");
8
+ const PreviewChartSection = (props) => {
9
+ const adaptable = (0, AdaptableContext_1.useAdaptable)();
10
+ const divRef = React.useRef(null);
11
+ React.useEffect(() => {
12
+ if (!divRef.current) {
13
+ return;
14
+ }
15
+ const container = {
16
+ name: 'Preview Chart',
17
+ element: divRef.current,
18
+ };
19
+ const transientChartDefinition = adaptable.api.chartingApi.internalApi.onPreviewExternalChart(props.chartDefinition, container);
20
+ return () => {
21
+ adaptable.api.chartingApi.internalApi.onHideExternalChart(transientChartDefinition);
22
+ };
23
+ }, [divRef]);
24
+ return (0, jsx_runtime_1.jsx)("div", { ref: divRef, className: "twa:min-h-[280px] twa:h-full twa:w-full" });
25
+ };
26
+ exports.PreviewChartSection = PreviewChartSection;
@@ -5,5 +5,6 @@ export declare const isSettingsValid: (chartDefinition: ExternalChartDefinition,
5
5
  export interface SettingsSectionProps {
6
6
  chartDefinition: ExternalChartDefinition;
7
7
  onChange: (chartDefinition: ExternalChartDefinition) => void;
8
+ showPreview?: boolean;
8
9
  }
9
10
  export declare const SettingsSection: React.FunctionComponent<SettingsSectionProps>;