@adaptabletools/adaptable 23.0.0-canary.4 → 23.0.0-canary.6

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 (250) hide show
  1. package/index.css +117 -62
  2. package/package.json +9 -4
  3. package/src/AdaptableOptions/EditOptions.d.ts +2 -2
  4. package/src/AdaptableState/Common/AggregationColumns.d.ts +14 -6
  5. package/src/AdaptableState/Common/AggregationColumns.js +27 -2
  6. package/src/AdaptableState/Common/ColumnScope.d.ts +4 -0
  7. package/src/AdaptableState/Common/Enums.d.ts +5 -5
  8. package/src/AdaptableState/Common/Enums.js +4 -4
  9. package/src/AdaptableState/PlusMinusState.d.ts +3 -3
  10. package/src/AdaptableState/ShortcutState.d.ts +2 -6
  11. package/src/AdaptableState/StyledColumnState.d.ts +3 -5
  12. package/src/AdaptableState/ThemeState.d.ts +33 -28
  13. package/src/Api/EventApi.d.ts +14 -1
  14. package/src/Api/Events/ThemeChanged.d.ts +6 -0
  15. package/src/Api/Events/ThemeSelected.d.ts +11 -0
  16. package/src/Api/Events/ThemeSelected.js +1 -0
  17. package/src/Api/Implementation/EventApiImpl.js +4 -0
  18. package/src/Api/Implementation/LayoutApiImpl.d.ts +0 -2
  19. package/src/Api/Implementation/LayoutApiImpl.js +0 -14
  20. package/src/Api/Implementation/LayoutHelpers.d.ts +2 -0
  21. package/src/Api/Implementation/LayoutHelpers.js +17 -7
  22. package/src/Api/Implementation/ThemeApiImpl.d.ts +3 -2
  23. package/src/Api/Implementation/ThemeApiImpl.js +19 -15
  24. package/src/Api/Internal/EventInternalApi.d.ts +2 -0
  25. package/src/Api/Internal/EventInternalApi.js +8 -1
  26. package/src/Api/Internal/StyledColumnInternalApi.d.ts +4 -4
  27. package/src/Api/Internal/StyledColumnInternalApi.js +4 -4
  28. package/src/Api/Internal/ThemeInternalApi.d.ts +0 -1
  29. package/src/Api/Internal/ThemeInternalApi.js +0 -10
  30. package/src/Api/LayoutApi.d.ts +1 -8
  31. package/src/Api/ThemeApi.d.ts +6 -2
  32. package/src/Redux/ActionsReducers/ThemeRedux.d.ts +3 -3
  33. package/src/Strategy/FormatColumnModule.js +14 -7
  34. package/src/Strategy/LayoutModule.js +13 -8
  35. package/src/Strategy/StyledColumnModule.js +64 -36
  36. package/src/Utilities/Constants/ReduxConstants.d.ts +2 -2
  37. package/src/Utilities/Constants/ReduxConstants.js +1 -14
  38. package/src/Utilities/Helpers/FormatHelper.js +20 -1
  39. package/src/Utilities/Helpers/SparklineOptionsHelper.d.ts +7 -0
  40. package/src/Utilities/Helpers/SparklineOptionsHelper.js +65 -0
  41. package/src/Utilities/Helpers/StyledColumnGradientHelper.d.ts +23 -1
  42. package/src/Utilities/Helpers/StyledColumnGradientHelper.js +204 -0
  43. package/src/Utilities/Helpers/ThemeHelpers.d.ts +5 -0
  44. package/src/Utilities/Helpers/ThemeHelpers.js +38 -0
  45. package/src/Utilities/Helpers/percentBarPreviewHelper.d.ts +19 -0
  46. package/src/Utilities/Helpers/percentBarPreviewHelper.js +143 -0
  47. package/src/Utilities/ObjectFactory.d.ts +1 -3
  48. package/src/Utilities/ObjectFactory.js +0 -8
  49. package/src/Utilities/Services/ThemeService.js +1 -1
  50. package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +17 -16
  51. package/src/View/Alert/Wizard/AlertButtonsEditor.js +114 -103
  52. package/src/View/Alert/Wizard/AlertMessageWizardSection.js +13 -14
  53. package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +55 -55
  54. package/src/View/Alert/Wizard/AlertRulesWizardSection.js +3 -2
  55. package/src/View/Alert/Wizard/AlertScheduledWizardSection.js +2 -2
  56. package/src/View/Alert/Wizard/AlertScopeWizardSection.js +31 -39
  57. package/src/View/Alert/Wizard/AlertTypeWizardSection.js +3 -4
  58. package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +9 -13
  59. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +30 -17
  60. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +7 -9
  61. package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +3 -3
  62. package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
  63. package/src/View/Charting/ChartingWizard/AgChargingWizard/AgChargingWizard.js +3 -10
  64. package/src/View/Charting/ChartingWizard/AgChargingWizard/PreviewChartSection.js +1 -1
  65. package/src/View/Charting/ChartingWizard/AgChargingWizard/SettingsSection.js +32 -41
  66. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/ExternalChartingWizard.js +4 -31
  67. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.d.ts +5 -0
  68. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.js +21 -0
  69. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.d.ts +1 -0
  70. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.js +10 -7
  71. package/src/View/Comments/CommentsEditor.js +1 -1
  72. package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +0 -1
  73. package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +3 -1
  74. package/src/View/Components/ModuleProfile.js +1 -1
  75. package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +0 -1
  76. package/src/View/Components/Popups/WindowPopups/windowFactory.js +0 -1
  77. package/src/View/Components/RangesComponent.d.ts +7 -2
  78. package/src/View/Components/RangesComponent.js +94 -22
  79. package/src/View/Components/StyleComponent.d.ts +1 -0
  80. package/src/View/Components/StyleComponent.js +1 -1
  81. package/src/View/Components/ValueSelector/index.js +70 -57
  82. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +8 -13
  83. package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +8 -8
  84. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
  85. package/src/View/DataImport/DataImportWizard/sections/ColumnsSection.js +11 -12
  86. package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadSection.js +6 -4
  87. package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.js +3 -2
  88. package/src/View/DataImport/DataImportWizard/sections/ValidationSection.js +5 -15
  89. package/src/View/Export/Wizard/ReportColumnsWizardSection.js +24 -26
  90. package/src/View/Export/Wizard/ReportNameWizardSection.js +10 -13
  91. package/src/View/Export/Wizard/ReportRowsWizardSection.js +20 -22
  92. package/src/View/Export/Wizard/ScheduledReportSettings.d.ts +2 -0
  93. package/src/View/Export/Wizard/ScheduledReportSettings.js +13 -13
  94. package/src/View/Export/Wizard/ScheduledReportWizard.js +4 -5
  95. package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +8 -6
  96. package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +21 -22
  97. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +20 -11
  98. package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +21 -5
  99. package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +4 -4
  100. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +7 -0
  101. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +117 -12
  102. package/src/View/FormatColumn/Wizard/FormatColumnPreview.d.ts +15 -0
  103. package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +66 -0
  104. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +4 -0
  105. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +30 -0
  106. package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +13 -8
  107. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +1 -1
  108. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +3 -1
  109. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +62 -13
  110. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +5 -3
  111. package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.d.ts +2 -0
  112. package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.js +15 -0
  113. package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.d.ts +10 -0
  114. package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.js +53 -0
  115. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +2 -3
  116. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +33 -68
  117. package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +15 -11
  118. package/src/View/Layout/TransposedPopup.js +2 -2
  119. package/src/View/Layout/Wizard/LayoutWizard.js +3 -3
  120. package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +2 -3
  121. package/src/View/Layout/Wizard/sections/AggregationsSection.js +115 -26
  122. package/src/View/Layout/Wizard/sections/ColumnsSection.js +79 -79
  123. package/src/View/Layout/Wizard/sections/FilterSection.js +31 -32
  124. package/src/View/Layout/Wizard/sections/GridFilterSection.js +11 -11
  125. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +1 -2
  126. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +101 -52
  127. package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +9 -8
  128. package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +4 -4
  129. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +36 -33
  130. package/src/View/Layout/Wizard/sections/RowSelectionSection.js +2 -2
  131. package/src/View/Layout/Wizard/sections/RowSummarySection.js +95 -73
  132. package/src/View/Layout/Wizard/sections/SettingsSection.js +4 -5
  133. package/src/View/Layout/Wizard/sections/SortSection.js +2 -2
  134. package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -1
  135. package/src/View/NamedQuery/Wizard/NamedQuerySettingsWizardSection.js +9 -14
  136. package/src/View/NamedQuery/Wizard/NamedQueryWizard.js +1 -3
  137. package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.d.ts +4 -0
  138. package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +43 -13
  139. package/src/View/PlusMinus/Wizard/PlusMinusScopeWizardSection.js +11 -18
  140. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.d.ts +2 -6
  141. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +6 -22
  142. package/src/View/PlusMinus/Wizard/PlusMinusWizard.js +15 -21
  143. package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +2 -2
  144. package/src/View/Shortcut/Wizard/ShortcutScopeWizardSection.js +11 -18
  145. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +17 -6
  146. package/src/View/Shortcut/Wizard/ShortcutWizard.js +3 -3
  147. package/src/View/Shortcut/shortcutOperations.d.ts +3 -0
  148. package/src/View/Shortcut/shortcutOperations.js +28 -0
  149. package/src/View/SpecialColumnSettingsWizardStep.js +9 -8
  150. package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +5 -0
  151. package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +24 -15
  152. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.d.ts +10 -2
  153. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +96 -16
  154. package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +14 -0
  155. package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +45 -24
  156. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +2 -3
  157. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +108 -33
  158. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +21 -13
  159. package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.d.ts +5 -0
  160. package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +121 -23
  161. package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.d.ts +1 -0
  162. package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +34 -11
  163. package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.d.ts +5 -0
  164. package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +86 -12
  165. package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.d.ts +5 -0
  166. package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +121 -34
  167. package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.d.ts +1 -0
  168. package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +55 -75
  169. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.d.ts +5 -0
  170. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.js +16 -0
  171. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +7 -13
  172. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarColumnComparisonPreview.js +5 -5
  173. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarRangesPreview.js +4 -3
  174. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.d.ts +5 -4
  175. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.js +12 -14
  176. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.d.ts +5 -0
  177. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.js +16 -0
  178. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.d.ts +3 -0
  179. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +31 -3
  180. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.d.ts +9 -0
  181. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +58 -0
  182. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.d.ts +10 -0
  183. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.js +30 -0
  184. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.d.ts +10 -0
  185. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.js +91 -0
  186. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.d.ts +8 -0
  187. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.js +52 -0
  188. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.d.ts +8 -0
  189. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +53 -0
  190. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.d.ts +18 -0
  191. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.js +58 -0
  192. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.d.ts +10 -0
  193. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +126 -0
  194. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardRangesSection.js +12 -5
  195. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.d.ts +1 -5
  196. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +52 -29
  197. package/src/View/SystemStatus/Utilities/getStatusItemStyle.js +1 -1
  198. package/src/View/Theme/ThemePopup.d.ts +2 -14
  199. package/src/View/Theme/ThemePopup.js +1 -36
  200. package/src/View/UIHelper.js +1 -1
  201. package/src/View/Wizard/OnePageAdaptableWizard.js +7 -21
  202. package/src/agGrid/AdaptableAgGrid.d.ts +1 -0
  203. package/src/agGrid/AdaptableAgGrid.js +36 -26
  204. package/src/agGrid/AgGridAdapter.d.ts +1 -1
  205. package/src/agGrid/AgGridAdapter.js +27 -17
  206. package/src/agGrid/AgGridColumnAdapter.js +9 -15
  207. package/src/agGrid/AgGridMenuAdapter.d.ts +0 -1
  208. package/src/agGrid/AgGridMenuAdapter.js +20 -37
  209. package/src/agGrid/buildValueAggregationMenuItem.d.ts +19 -0
  210. package/src/agGrid/buildValueAggregationMenuItem.js +111 -0
  211. package/src/agGrid/cellRenderers/IconRenderer.d.ts +6 -0
  212. package/src/agGrid/cellRenderers/IconRenderer.js +43 -15
  213. package/src/agGrid/createAgGridIcon.d.ts +10 -0
  214. package/src/agGrid/createAgGridIcon.js +16 -0
  215. package/src/components/DragAndDropContext/UnusedPanel.js +1 -1
  216. package/src/components/ExpressionEditor/BaseEditorInput.js +1 -1
  217. package/src/components/ExpressionEditor/ExpressionFunctionDocumentation.js +1 -1
  218. package/src/components/Input/NumberInput.js +1 -1
  219. package/src/components/Panel/index.js +1 -1
  220. package/src/components/SimpleButton/index.js +4 -4
  221. package/src/components/Toggle/Toggle.js +1 -1
  222. package/src/components/Toggle/ToggleGroup.js +1 -1
  223. package/src/env.js +2 -2
  224. package/src/layout-manager/src/index.js +2 -9
  225. package/src/metamodel/adaptable.metamodel.d.ts +39 -29
  226. package/src/metamodel/adaptable.metamodel.js +1 -1
  227. package/src/types.d.ts +5 -4
  228. package/themes/dark.css +1 -68
  229. package/themes/light.css +1 -5
  230. package/tsconfig.esm.tsbuildinfo +1 -1
  231. package/src/Aggregation/ParameterizedAggregationRegistry.d.ts +0 -35
  232. package/src/Aggregation/ParameterizedAggregationRegistry.js +0 -63
  233. package/src/Aggregation/definitions/weightedAverageAggregationDefinition.d.ts +0 -3
  234. package/src/Aggregation/definitions/weightedAverageAggregationDefinition.js +0 -55
  235. package/src/Aggregation/parameterizedAggregationColumnMenu.d.ts +0 -8
  236. package/src/Aggregation/parameterizedAggregationColumnMenu.js +0 -137
  237. package/src/Aggregation/parameterizedAggregationHeader.d.ts +0 -13
  238. package/src/Aggregation/parameterizedAggregationHeader.js +0 -60
  239. package/src/Aggregation/parameterizedAggregationHelpers.d.ts +0 -23
  240. package/src/Aggregation/parameterizedAggregationHelpers.js +0 -111
  241. package/src/Aggregation/parameterizedAggregationWizardHelpers.d.ts +0 -9
  242. package/src/Aggregation/parameterizedAggregationWizardHelpers.js +0 -66
  243. package/src/Aggregation/validateParameterizedAggregations.d.ts +0 -4
  244. package/src/Aggregation/validateParameterizedAggregations.js +0 -20
  245. package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.d.ts +0 -12
  246. package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.js +0 -43
  247. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.d.ts +0 -5
  248. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.js +0 -28
  249. package/src/View/Theme/VariantSelector.d.ts +0 -8
  250. package/src/View/Theme/VariantSelector.js +0 -20
@@ -3,10 +3,10 @@ import * as React from 'react';
3
3
  import { CheckBox } from '../../../components/CheckBox';
4
4
  import FormLayout, { FormRow } from '../../../components/FormLayout';
5
5
  import Radio from '../../../components/Radio';
6
- import { Tabs } from '../../../components/Tabs';
7
6
  import AdaptableInput from '../../Components/AdaptableInput';
8
7
  import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
9
8
  import { Box } from '../../../components/Flex';
9
+ import { Card } from '../../../components/Card';
10
10
  import { SingleSelect } from '../../../components/NewSelect';
11
11
  import ObjectFactory from '../../../Utilities/ObjectFactory';
12
12
  import { buildCronExpression, buildRunAtIso, inferPresetFromCron, isScheduleValid as validateSchedule, parseOneOffDateFromRunAt, parseTimeFromSchedule, } from '../../../Utilities/Helpers/ScheduleHelper';
@@ -155,5 +155,5 @@ export const ScheduleBuilderWizard = (props) => {
155
155
  commit({ customCron: value, preset: 'custom' });
156
156
  };
157
157
  const timeValue = `${`${hour}`.padStart(2, '0')}:${`${minute}`.padStart(2, '0')}`;
158
- return (_jsx(Box, { "data-name": "schedule-setup", children: _jsxs(Tabs, { autoFocus: false, children: [_jsx(Tabs.Tab, { children: "Schedule" }), _jsx(Tabs.Content, { children: _jsxs(FormLayout, { children: [_jsxs(FormRow, { label: "Frequency", children: [_jsx(Radio, { "data-name": "frequency-recurring", className: "twa:mr-2", value: "recurring", checked: !isOneOff, onChange: (checked) => checked && handleFrequencyChange(false), children: "Recurring" }), _jsx(Radio, { "data-name": "frequency-one-off", checked: isOneOff, value: "oneoff", onChange: (checked) => checked && handleFrequencyChange(true), children: "One-off" })] }), isOneOff ? (_jsx(FormRow, { label: "Date", children: _jsx(AdaptableInput, { "data-name": "one-off-date", className: "twa:w-[300px]", type: "date", placeholder: "Date", onChange: handleOneOffDateChange, value: oneOffDate }) })) : (_jsxs(_Fragment, { children: [_jsx(FormRow, { label: "Pattern", children: _jsx(Box, { className: "twa:max-w-[300px]", children: _jsx(SingleSelect, { className: "twa:w-full", "data-name": "recurrence-preset", items: PRESET_OPTIONS, value: preset, placeholder: "Select pattern", onValueChange: handlePresetChange }) }) }), preset === 'selectedDays' && (_jsx(FormRow, { label: "Days", children: daysMap.map((day) => (_jsx(CheckBox, { "data-name": `day-${day.value}`, className: "twa:ml-2 twa:w-1/3", value: day.value, checked: selectedDays.includes(day.value), onChange: (checked) => handleDayChange(checked, day.value), children: day.label }, day.value))) })), preset === 'monthly' && (_jsx(FormRow, { label: "Day of month", children: _jsx(AdaptableInput, { "data-name": "day-of-month", className: "twa:w-[120px]", type: "number", min: 1, max: 31, value: dayOfMonth, onChange: handleDayOfMonthChange }) })), preset === 'custom' && (_jsx(FormRow, { label: "Cron expression", children: _jsx(AdaptableInput, { "data-name": "custom-cron", className: "twa:w-[300px]", placeholder: "minute hour day month weekday", value: customCron, onChange: handleCustomCronChange }) }))] })), _jsx(FormRow, { label: "Time", children: _jsx(AdaptableInput, { "data-name": "time", className: "twa:w-[300px]", value: timeValue, type: "time", onChange: handleTimeChange }) })] }) })] }) }));
158
+ return (_jsx(Box, { "data-name": "schedule-setup", children: _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Schedule" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Configure when this should run" })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { children: [_jsxs(FormRow, { label: "Frequency", children: [_jsx(Radio, { "data-name": "frequency-recurring", className: "twa:mr-2", value: "recurring", checked: !isOneOff, onChange: (checked) => checked && handleFrequencyChange(false), children: "Recurring" }), _jsx(Radio, { "data-name": "frequency-one-off", checked: isOneOff, value: "oneoff", onChange: (checked) => checked && handleFrequencyChange(true), children: "One-off" })] }), isOneOff ? (_jsx(FormRow, { label: "Date", children: _jsx(AdaptableInput, { "data-name": "one-off-date", className: "twa:w-[300px]", type: "date", placeholder: "Date", onChange: handleOneOffDateChange, value: oneOffDate }) })) : (_jsxs(_Fragment, { children: [_jsx(FormRow, { label: "Pattern", children: _jsx(Box, { className: "twa:max-w-[300px]", children: _jsx(SingleSelect, { className: "twa:w-full", "data-name": "recurrence-preset", items: PRESET_OPTIONS, value: preset, placeholder: "Select pattern", onValueChange: handlePresetChange }) }) }), preset === 'selectedDays' && (_jsx(FormRow, { label: "Days", children: daysMap.map((day) => (_jsx(CheckBox, { "data-name": `day-${day.value}`, className: "twa:ml-2 twa:w-1/3", value: day.value, checked: selectedDays.includes(day.value), onChange: (checked) => handleDayChange(checked, day.value), children: day.label }, day.value))) })), preset === 'monthly' && (_jsx(FormRow, { label: "Day of month", children: _jsx(AdaptableInput, { "data-name": "day-of-month", className: "twa:w-[120px]", type: "number", min: 1, max: 31, value: dayOfMonth, onChange: handleDayOfMonthChange }) })), preset === 'custom' && (_jsx(FormRow, { label: "Cron expression", children: _jsx(AdaptableInput, { "data-name": "custom-cron", className: "twa:w-[300px]", placeholder: "minute hour day month weekday", value: customCron, onChange: handleCustomCronChange }) }))] })), _jsx(FormRow, { label: "Time", children: _jsx(AdaptableInput, { "data-name": "time", className: "twa:w-[300px]", value: timeValue, type: "time", onChange: handleTimeChange }) })] }) })] }) }));
159
159
  };
@@ -1,25 +1,18 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
4
4
  import { NewScopeComponent } from '../../Components/NewScopeComponent';
5
+ import { Box, Flex } from '../../../components/Flex';
5
6
  export const ShortcutScopeWizardSection = (props) => {
6
7
  const { data, api } = useOnePageAdaptableWizardContext();
7
8
  const availableColumns = React.useMemo(() => api.columnApi.getNumericColumns(), []);
8
- return (_jsx(NewScopeComponent, { availableDataTypes: ['number'], scopeColumns: availableColumns, scope: data.Scope, descriptions: {
9
- rowScope: 'All Numeric Columns will have the Shortcut applied',
10
- columnScope: 'Selected Columns will have the Shortcut applied',
11
- }, updateScope: (Scope) => {
12
- let preparedScope = Scope;
13
- if (Scope && 'DataTypes' in Scope && Scope.DataTypes.length === 0) {
14
- // default to checked
15
- preparedScope = {
16
- ...Scope,
17
- DataTypes: ['number'],
18
- };
19
- }
20
- props.onChange({
21
- ...data,
22
- Scope: preparedScope,
23
- });
24
- } }));
9
+ return (_jsxs(Flex, { flexDirection: "column", className: "twa:h-full", children: [_jsxs(Flex, { flexDirection: "row", alignItems: "center", className: "twa:p-2 twa:gap-3 twa:border-b twa:mb-2 twa:border-b-foreground/20", children: [_jsx(Box, { className: "twa:text-5 twa:font-medium", children: "Target" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:max-w-[520px]", children: "Specify where the Shortcut should be applied (numeric columns only)" })] }), _jsx(Box, { className: "twa:flex-1 twa:min-h-0 twa:overflow-auto twa:p-2", children: _jsx(NewScopeComponent, { disableDataTypes: true, scopeColumns: availableColumns, scope: data.Scope, descriptions: {
10
+ rowScope: 'All Numeric Columns will have the Shortcut applied',
11
+ columnScope: 'Selected Columns will have the Shortcut applied',
12
+ }, updateScope: (Scope) => {
13
+ props.onChange({
14
+ ...data,
15
+ Scope: Scope,
16
+ });
17
+ } }) })] }));
25
18
  };
@@ -1,15 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import Input from '../../../components/Input';
4
- import { shortcutOperationList } from '../shortcutOperations';
5
- import FormLayout, { FormRow } from '../../../components/FormLayout';
4
+ import { calculateShortcutResult, getShortcutOperationSymbol, shortcutOperationList, SHORTCUT_PREVIEW_EXAMPLE_VALUE, } from '../shortcutOperations';
6
5
  import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
7
- import { Tabs } from '../../../components/Tabs';
8
6
  import { SummaryText } from '../../../View/Wizard/OnePageAdaptableWizard';
9
7
  import { Tag } from '../../../components/Tag';
10
- import HelpBlock from '../../../components/HelpBlock';
11
8
  import { Box, Flex } from '../../../components/Flex';
12
9
  import { SingleSelect } from '../../../components/NewSelect';
10
+ import { Card } from '../../../components/Card';
13
11
  export const isSettingsValid = (data, api) => {
14
12
  if (!data.Name?.trim()) {
15
13
  return 'Name is required';
@@ -58,11 +56,24 @@ export const ShortcutSettingsWizard = (props) => {
58
56
  const optionActions = shortcutOperationList.map((operation) => ({
59
57
  value: operation,
60
58
  label: operation,
61
- // onClick: () => handleOperationChange(operation),
62
59
  }));
63
60
  const optionKeys = props.availableKeys.map((key) => ({
64
61
  value: key,
65
62
  label: key,
66
63
  }));
67
- return (_jsx(Box, { "data-name": "shortcut-column-settings", children: _jsxs(Tabs, { autoFocus: false, children: [_jsx(Tabs.Tab, { children: "Shortcut Settings" }), _jsx(Tabs.Content, { children: _jsxs(FormLayout, { children: [_jsx(FormRow, { label: "Name", children: _jsx(Input, { "data-name": "shortcut-name", className: "twa:flex-1 twa:w-60 twa:mr-3", onChange: handleNameChange, placeholder: "Enter Name", value: shortcut.Name ?? '' }) }), _jsx(FormRow, { label: "", children: _jsx(Box, { className: "twa:h-2" }) }), _jsx(FormRow, { label: "", children: _jsx(HelpBlock, { className: "twa:text-2 twa:mb-0", children: "Keyboard key that, when pressed, triggers the Shortcut" }) }), _jsx(FormRow, { label: "Key", children: _jsx(Flex, { flexDirection: "row", children: _jsx(SingleSelect, { "data-name": "shortcut-key", ariaLabel: "Select Key", placeholder: "Select Key", items: optionKeys, className: "twa:w-30", onValueChange: (key) => handleKeyChange(key), value: shortcut.ShortcutKey || 'Select Key' }) }) }), _jsx(FormRow, { label: "", children: _jsx(HelpBlock, { className: "twa:text-2 twa:mb-0", children: "Mathematical operation performed on Cell's current value (using the Shortcut's 'value') - used to calculate the Cell's new total" }) }), _jsx(FormRow, { label: "Operation", children: _jsx(Flex, { flexDirection: "row", children: _jsx(SingleSelect, { "data-name": "shortcut-operation", placeholder: "Select Operation", ariaLabel: "Select Operation", className: "twa:w-30", items: optionActions, onValueChange: (operation) => handleOperationChange(operation), value: shortcut.ShortcutOperation }) }) }), _jsx(FormRow, { label: "", children: _jsx(HelpBlock, { className: "twa:text-2 twa:mb-0", children: "Number that is used - together with the 'Operation' and the current cell value - to calculate the new total for the cell" }) }), _jsx(FormRow, { label: "Value", children: _jsx(Flex, { flexDirection: "row", children: _jsx(Input, { "data-name": "shortcut-value", className: "twa:flex-1 twa:w-30 twa:max-w-30 twa:mr-3", onChange: handleOperationValueChange, placeholder: "Enter Number", type: "number", value: shortcut.ShortcutValue ?? '' }) }) })] }) })] }) }));
64
+ const preview = React.useMemo(() => {
65
+ const { ShortcutOperation, ShortcutValue } = shortcut;
66
+ if (!ShortcutOperation || typeof ShortcutValue !== 'number') {
67
+ return null;
68
+ }
69
+ const result = calculateShortcutResult(SHORTCUT_PREVIEW_EXAMPLE_VALUE, ShortcutValue, ShortcutOperation);
70
+ if (result === null) {
71
+ return { error: 'Cannot divide by zero' };
72
+ }
73
+ return {
74
+ expression: `${SHORTCUT_PREVIEW_EXAMPLE_VALUE} ${getShortcutOperationSymbol(ShortcutOperation)} ${ShortcutValue}`,
75
+ result,
76
+ };
77
+ }, [shortcut.ShortcutOperation, shortcut.ShortcutValue]);
78
+ return (_jsx(Box, { "data-name": "shortcut-column-settings", children: _jsxs(Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: [_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Name" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Provide a unique name for the Shortcut" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(Input, { "data-name": "shortcut-name", className: "twa:max-w-[300px] twa:w-full", onChange: handleNameChange, placeholder: "Enter Name", value: shortcut.Name ?? '' }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Key" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Keyboard key that, when pressed, triggers the Shortcut" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(SingleSelect, { "data-name": "shortcut-key", ariaLabel: "Select Key", placeholder: "Select Key", items: optionKeys, className: "twa:max-w-[300px]", onValueChange: (key) => handleKeyChange(key), value: shortcut.ShortcutKey || undefined }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Operation" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Mathematical operation performed on the cell's current value" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(SingleSelect, { "data-name": "shortcut-operation", placeholder: "Select Operation", ariaLabel: "Select Operation", className: "twa:max-w-[300px]", items: optionActions, onValueChange: (operation) => handleOperationChange(operation), value: shortcut.ShortcutOperation }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Value" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Number used with the operation and current cell value to calculate the new total" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(Input, { "data-name": "shortcut-value", className: "twa:max-w-[300px] twa:w-full", onChange: handleOperationValueChange, placeholder: "Enter Number", type: "number", value: shortcut.ShortcutValue ?? '' }) })] }), preview ? (_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Example" }), _jsxs(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: ["If a cell contains ", SHORTCUT_PREVIEW_EXAMPLE_VALUE, ", pressing this Shortcut would change it to:"] })] }), _jsx(Card.Body, { children: 'error' in preview ? (_jsx(Box, { className: "twa:text-2 twa:text-error", children: preview.error })) : (_jsxs(Box, { className: "twa:text-3 twa:font-medium", children: [preview.expression, " \u2192 ", preview.result] })) })] })) : null] }) }));
68
79
  };
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import { OnePageAdaptableWizard, OnePageWizardSummary, } from '../../../View/Wizard/OnePageAdaptableWizard';
4
4
  import { cloneObject } from '../../../Utilities/Helpers/Helper';
@@ -50,7 +50,7 @@ export const ShortcutWizard = (props) => {
50
50
  {
51
51
  title: 'Settings',
52
52
  isValid: isSettingsValid,
53
- details: (_jsxs(_Fragment, { children: ["A Shortcut is a mathematical calculation (", _jsx("b", { children: "Operation" }), ") which is applied with the defined operand ", _jsx("b", { children: "Value" }), " on the edited cell content when the corresponding Shortcut ", _jsx("b", { children: "Key" }), " is pressed."] })),
53
+ details: (_jsx(_Fragment, { children: "Provide details of the Shortcut" })),
54
54
  renderSummary: () => _jsx(ShortcutSettingsSummary, {}),
55
55
  render: () => (_jsx(Box, { className: "twa:p-2", children: _jsx(ShortcutSettingsWizard, { availableKeys: props.availableKeys ?? availableKeys, onChange: setShortcut }) })),
56
56
  },
@@ -61,7 +61,7 @@ export const ShortcutWizard = (props) => {
61
61
  renderSummary: () => renderScopeSummary(shortcut.Scope, {
62
62
  scopeWholeRow: 'Shortcut is triggered for all numeric cells',
63
63
  scopeColumns: 'Shortcut is triggered for cells in selected columns',
64
- scopeDataTypes: 'Shortcut is triggered for all numeric cells',
64
+ scopeDataTypes: '',
65
65
  }),
66
66
  render: () => (_jsx(Box, { className: "twa:p-2", children: _jsx(ShortcutScopeWizardSection, { onChange: setShortcut }) })),
67
67
  },
@@ -1,2 +1,5 @@
1
1
  import { MathOperation } from '../../AdaptableState/Common/Enums';
2
2
  export declare const shortcutOperationList: Array<MathOperation>;
3
+ export declare const SHORTCUT_PREVIEW_EXAMPLE_VALUE = 100;
4
+ export declare function getShortcutOperationSymbol(operation: MathOperation): string;
5
+ export declare function calculateShortcutResult(cellValue: number, shortcutValue: number, operation: MathOperation): number | null;
@@ -1,7 +1,35 @@
1
1
  import { MathOperation } from '../../AdaptableState/Common/Enums';
2
+ import NumberExtensions from '../../Utilities/Extensions/NumberExtensions';
2
3
  export const shortcutOperationList = [
3
4
  MathOperation.Add,
4
5
  MathOperation.Subtract,
5
6
  MathOperation.Multiply,
6
7
  MathOperation.Divide,
7
8
  ];
9
+ export const SHORTCUT_PREVIEW_EXAMPLE_VALUE = 100;
10
+ const shortcutOperationSymbols = {
11
+ [MathOperation.Add]: '+',
12
+ [MathOperation.Subtract]: '−',
13
+ [MathOperation.Multiply]: '×',
14
+ [MathOperation.Divide]: '÷',
15
+ };
16
+ export function getShortcutOperationSymbol(operation) {
17
+ return shortcutOperationSymbols[operation];
18
+ }
19
+ export function calculateShortcutResult(cellValue, shortcutValue, operation) {
20
+ if (operation === MathOperation.Divide && shortcutValue === 0) {
21
+ return null;
22
+ }
23
+ switch (operation) {
24
+ case MathOperation.Add:
25
+ return NumberExtensions.avoidJavascriptPrecisionIssues(cellValue + shortcutValue);
26
+ case MathOperation.Subtract:
27
+ return NumberExtensions.avoidJavascriptPrecisionIssues(cellValue - shortcutValue);
28
+ case MathOperation.Multiply:
29
+ return NumberExtensions.avoidJavascriptPrecisionIssues(cellValue * shortcutValue);
30
+ case MathOperation.Divide:
31
+ return NumberExtensions.avoidJavascriptPrecisionIssues(cellValue / shortcutValue);
32
+ default:
33
+ return null;
34
+ }
35
+ }
@@ -1,12 +1,13 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import chunk from '../Utilities/utils/chunk';
3
3
  import { CheckBox } from '../components/CheckBox';
4
4
  import FormLayout, { FormRow } from '../components/FormLayout';
5
- import { Tabs } from '../components/Tabs';
6
5
  import { useAdaptable } from './AdaptableContext';
7
- import { Flex } from '../components/Flex';
6
+ import { Box, Flex } from '../components/Flex';
7
+ import { Card } from '../components/Card';
8
8
  export const SpecialColumnSettingsWizardStep = (props) => {
9
9
  const adaptable = useAdaptable();
10
+ const behaviourSpellingVariant = adaptable.api.internalApi.getCorrectEnglishVariant('behaviours');
10
11
  const possibleColumnTypes = adaptable.api.columnApi.getColumnTypes() ?? [];
11
12
  const { Filterable, Resizable, Groupable, Sortable, Pivotable, Aggregatable, SuppressMenu, SuppressMovable, } = props.settings ?? {};
12
13
  const handleColumnTypeChange = (columnType, checked) => {
@@ -30,9 +31,9 @@ export const SpecialColumnSettingsWizardStep = (props) => {
30
31
  ...values,
31
32
  });
32
33
  };
33
- return (_jsxs(_Fragment, { children: [_jsxs(Tabs, { className: "twa:mt-2", autoFocus: false, children: [_jsx(Tabs.Tab, { children: "Column Properties" }), _jsx(Tabs.Content, { children: _jsx(Flex, { flexDirection: "column", children: _jsxs(FormLayout, { className: "twa:w-full", columns: [
34
- { name: 'first', size: '30%' },
35
- { size: '30%', name: 'second' },
36
- { size: '30%', name: 'third' },
37
- ], children: [_jsxs(FormRow, { children: [_jsx(CheckBox, { "data-name": "filterable", checked: Filterable, onChange: (Filterable) => onSettingsChange({ Filterable }), disabled: !adaptable.api.optionsApi.getFilterOptions().enableFilterOnSpecialColumns, children: "Filterable" }), _jsx(CheckBox, { "data-name": "resizable", checked: Resizable, onChange: (Resizable) => onSettingsChange({ Resizable }), children: "Resizable" }), _jsx(CheckBox, { "data-name": "groupable", checked: Groupable, onChange: (Groupable) => onSettingsChange({ Groupable }), children: "Groupable" })] }), _jsxs(FormRow, { children: [_jsx(CheckBox, { "data-name": "sortable", checked: Sortable, onChange: (Sortable) => onSettingsChange({ Sortable }), children: "Sortable" }), _jsx(CheckBox, { "data-name": "pivotable", checked: Pivotable, onChange: (Pivotable) => onSettingsChange({ Pivotable }), children: "Pivotable" }), _jsx(CheckBox, { "data-name": "aggregatable", checked: Aggregatable, onChange: (Aggregatable) => onSettingsChange({ Aggregatable }), children: "Aggregatable" })] }), _jsxs(FormRow, { children: [_jsx(CheckBox, { "data-name": "suppres-smenu", checked: SuppressMenu, onChange: (SuppressMenu) => onSettingsChange({ SuppressMenu }), children: "Suppress Menu" }), _jsx(CheckBox, { "data-name": "suppres-movable", checked: SuppressMovable, onChange: (SuppressMovable) => onSettingsChange({ SuppressMovable }), children: "Suppress Movable" }), _jsx(CheckBox, { disabled: true, checked: props.isEditable, children: "Editable" })] })] }) }) })] }), Boolean(possibleColumnTypes?.length) && (_jsxs(Tabs, { className: "twa:mt-2", autoFocus: false, children: [_jsx(Tabs.Tab, { children: "Column Types" }), _jsx(Tabs.Content, { children: _jsx(FormLayout, { columns: [{ name: 'first', size: '30%' }, { name: 'second' }], children: chunk(possibleColumnTypes ?? [], 2)?.map(([first, second]) => (_jsxs(FormRow, { children: [first && (_jsx(CheckBox, { "data-name": first, onChange: (checked) => handleColumnTypeChange(first, checked), checked: props.settings?.ColumnTypes?.includes?.(first), children: first })), second && (_jsx(CheckBox, { "data-name": second, onChange: (checked) => handleColumnTypeChange(second, checked), checked: props.settings?.ColumnTypes?.includes?.(second), children: second }))] }, first))) }) })] }))] }));
34
+ return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-3", children: [_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Column Properties" }), _jsxs(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: ["Choose which grid ", behaviourSpellingVariant, " apply to this Column"] })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { className: "twa:w-full", columns: [
35
+ { name: 'first', size: '30%' },
36
+ { size: '30%', name: 'second' },
37
+ { size: '30%', name: 'third' },
38
+ ], children: [_jsxs(FormRow, { children: [_jsx(CheckBox, { "data-name": "filterable", checked: Filterable, onChange: (Filterable) => onSettingsChange({ Filterable }), disabled: !adaptable.api.optionsApi.getFilterOptions().enableFilterOnSpecialColumns, children: "Filterable" }), _jsx(CheckBox, { "data-name": "resizable", checked: Resizable, onChange: (Resizable) => onSettingsChange({ Resizable }), children: "Resizable" }), _jsx(CheckBox, { "data-name": "groupable", checked: Groupable, onChange: (Groupable) => onSettingsChange({ Groupable }), children: "Groupable" })] }), _jsxs(FormRow, { children: [_jsx(CheckBox, { "data-name": "sortable", checked: Sortable, onChange: (Sortable) => onSettingsChange({ Sortable }), children: "Sortable" }), _jsx(CheckBox, { "data-name": "pivotable", checked: Pivotable, onChange: (Pivotable) => onSettingsChange({ Pivotable }), children: "Pivotable" }), _jsx(CheckBox, { "data-name": "aggregatable", checked: Aggregatable, onChange: (Aggregatable) => onSettingsChange({ Aggregatable }), children: "Aggregatable" })] }), _jsxs(FormRow, { children: [_jsx(CheckBox, { "data-name": "suppres-smenu", checked: SuppressMenu, onChange: (SuppressMenu) => onSettingsChange({ SuppressMenu }), children: "Suppress Menu" }), _jsx(CheckBox, { "data-name": "suppres-movable", checked: SuppressMovable, onChange: (SuppressMovable) => onSettingsChange({ SuppressMovable }), children: "Suppress Movable" }), _jsx(CheckBox, { disabled: true, checked: props.isEditable, children: "Editable" })] })] }) })] }), Boolean(possibleColumnTypes?.length) && (_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Column Types" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Assign custom column types to this column" })] }), _jsx(Card.Body, { children: _jsx(FormLayout, { columns: [{ name: 'first', size: '30%' }, { name: 'second' }], children: chunk(possibleColumnTypes ?? [], 2)?.map(([first, second]) => (_jsxs(FormRow, { children: [first && (_jsx(CheckBox, { "data-name": first, onChange: (checked) => handleColumnTypeChange(first, checked), checked: props.settings?.ColumnTypes?.includes?.(first), children: first })), second && (_jsx(CheckBox, { "data-name": second, onChange: (checked) => handleColumnTypeChange(second, checked), checked: props.settings?.ColumnTypes?.includes?.(second), children: second }))] }, first))) }) })] }))] }));
38
39
  };
@@ -22,5 +22,10 @@ export interface BadgePillStyleEditorProps {
22
22
  * - **No** `FontSize` — pills inherit cell font sizing.
23
23
  */
24
24
  export declare const BadgePillStyleEditor: React.FunctionComponent<BadgePillStyleEditorProps>;
25
+ /** Descriptive pill properties for summary panels (`Label: value` strings). */
26
+ export declare const getBadgePillStyleSummaryItems: (pill: BadgePillStyle | undefined) => {
27
+ label: string;
28
+ value: string;
29
+ }[];
25
30
  /** Compact summary tags for a {@link BadgePillStyle}; used by wizard summaries. */
26
31
  export declare const renderBadgePillStyleSummaryTags: (pill: BadgePillStyle | undefined) => React.JSX.Element | null;
@@ -37,28 +37,37 @@ export const BadgePillStyleEditor = (props) => {
37
37
  const disabledClass = disabled ? 'twa:opacity-50 twa:pointer-events-none' : '';
38
38
  return (_jsx(Box, { className: "twa:mt-2 twa:rounded-standard twa:border twa:border-border twa:overflow-hidden twa:shadow-sm", children: _jsx(Box, { className: "twa:p-3", children: _jsxs(FormLayout, { columns: [LABEL_COLUMN, CHILD_COLUMN], sizes: ['7.5rem', '1fr'], gridColumnGap: "0.75rem", children: [_jsx(FormRow, { label: "Background", children: _jsxs(Flex, { alignItems: "center", className: "twa:gap-2", children: [_jsx(CheckBox, { disabled: disabled, checked: !!pill.BackColor, onChange: (checked) => update({ BackColor: checked ? pill.BackColor ?? '#cccccc' : undefined }), children: "Set" }), _jsx(ColorPicker, { disabled: disabled || !pill.BackColor, api: props.api, value: pill.BackColor || '#cccccc', onChange: (c) => update({ BackColor: c }) })] }) }), _jsx(FormRow, { label: "Text", children: _jsxs(Flex, { alignItems: "center", className: "twa:gap-2", children: [_jsx(CheckBox, { disabled: disabled, checked: !!pill.ForeColor, onChange: (checked) => update({ ForeColor: checked ? pill.ForeColor ?? '#000000' : undefined }), children: "Set" }), _jsx(ColorPicker, { disabled: disabled || !pill.ForeColor, api: props.api, value: pill.ForeColor || '#000000', onChange: (c) => update({ ForeColor: c }) })] }) }), _jsx(FormRow, { label: "Border", children: _jsxs(Flex, { alignItems: "center", className: "twa:gap-2", children: [_jsx(CheckBox, { disabled: disabled, checked: !!pill.BorderColor, onChange: (checked) => update({ BorderColor: checked ? pill.BorderColor ?? '#000000' : undefined }), children: "Set" }), _jsx(ColorPicker, { disabled: disabled || !pill.BorderColor, api: props.api, value: pill.BorderColor || '#000000', onChange: (c) => update({ BorderColor: c }) })] }) }), _jsx(FormRow, { label: "Font", children: _jsx(Box, { className: disabledClass, children: _jsxs(Flex, { alignItems: "center", className: "twa:gap-2 twa:flex-wrap", children: [_jsxs(ToggleGroup, { children: [_jsx(Toggle, { pressed: pill.FontStyle === 'Italic', onPressedChange: (pressed) => update({ FontStyle: pressed ? 'Italic' : undefined }), icon: "italic" }), _jsx(Toggle, { pressed: pill.FontWeight === 'Bold', onPressedChange: (pressed) => update({ FontWeight: pressed ? 'Bold' : undefined }), icon: "bold" })] }), _jsxs(ToggleGroup, { children: [_jsx(Toggle, { pressed: pill.TextDecoration === 'Underline', onPressedChange: (pressed) => update({ TextDecoration: pressed ? 'Underline' : undefined }), icon: "underline" }), _jsx(Toggle, { pressed: pill.TextDecoration === 'LineThrough', onPressedChange: (pressed) => update({ TextDecoration: pressed ? 'LineThrough' : undefined }), icon: "strikethrough" }), _jsx(Toggle, { pressed: pill.TextDecoration === 'Overline', onPressedChange: (pressed) => update({ TextDecoration: pressed ? 'Overline' : undefined }), icon: "overline" })] })] }) }) })] }) }) }));
39
39
  };
40
- /** Compact summary tags for a {@link BadgePillStyle}; used by wizard summaries. */
41
- export const renderBadgePillStyleSummaryTags = (pill) => {
42
- if (!pill)
43
- return null;
44
- const tags = [];
40
+ /** Descriptive pill properties for summary panels (`Label: value` strings). */
41
+ export const getBadgePillStyleSummaryItems = (pill) => {
42
+ if (!pill) {
43
+ return [];
44
+ }
45
+ const items = [];
45
46
  if (pill.BackColor) {
46
- tags.push(_jsxs(Tag, { children: ["Bg ", pill.BackColor] }, "bg"));
47
+ items.push({ label: 'Pill Back Colour', value: pill.BackColor });
47
48
  }
48
49
  if (pill.ForeColor) {
49
- tags.push(_jsxs(Tag, { children: ["Text ", pill.ForeColor] }, "fg"));
50
+ items.push({ label: 'Pill Fore Colour', value: pill.ForeColor });
50
51
  }
51
52
  if (pill.BorderColor) {
52
- tags.push(_jsxs(Tag, { children: ["Border ", pill.BorderColor] }, "bc"));
53
+ items.push({ label: 'Pill Border Colour', value: pill.BorderColor });
54
+ }
55
+ if (pill.FontWeight === 'Bold') {
56
+ items.push({ label: 'Pill Font Weight', value: 'Bold' });
57
+ }
58
+ if (pill.FontStyle === 'Italic') {
59
+ items.push({ label: 'Pill Font Style', value: 'Italic' });
53
60
  }
54
- if (pill.FontWeight === 'Bold')
55
- tags.push(_jsx(Tag, { children: "Bold" }, "b"));
56
- if (pill.FontStyle === 'Italic')
57
- tags.push(_jsx(Tag, { children: "Italic" }, "i"));
58
61
  if (pill.TextDecoration && pill.TextDecoration !== 'None') {
59
- tags.push(_jsx(Tag, { children: pill.TextDecoration }, "td"));
62
+ items.push({ label: 'Pill Text Decoration', value: pill.TextDecoration });
60
63
  }
61
- if (tags.length === 0)
64
+ return items;
65
+ };
66
+ /** Compact summary tags for a {@link BadgePillStyle}; used by wizard summaries. */
67
+ export const renderBadgePillStyleSummaryTags = (pill) => {
68
+ const items = getBadgePillStyleSummaryItems(pill);
69
+ if (!items.length) {
62
70
  return null;
63
- return (_jsx(Flex, { alignItems: "center", className: "twa:gap-1 twa:flex-wrap", children: tags }));
71
+ }
72
+ return (_jsx(Flex, { alignItems: "center", className: "twa:gap-1 twa:flex-wrap", children: items.map(({ label, value }) => (_jsx(Tag, { children: `${label}: ${value}` }, label))) }));
64
73
  };
@@ -1,6 +1,14 @@
1
1
  import * as React from 'react';
2
2
  import { StyledColumn } from '../../../types';
3
- export declare const renderBadgeSummary: (styledColumn: StyledColumn) => React.JSX.Element;
3
+ import { AdaptableApi } from '../../../Api/AdaptableApi';
4
+ export declare const getStyledColumnBadgeDefinitionViewValueGroups: (styledColumn: StyledColumn, api: AdaptableApi) => string[][];
5
+ export declare const getStyledColumnBadgeDefinitionViewValues: (styledColumn: StyledColumn, api: AdaptableApi) => string[];
6
+ export declare const getStyledColumnBadgeStyleViewValues: (styledColumn: StyledColumn, api?: AdaptableApi) => string[];
7
+ export declare const renderBadgeDefinitionSummaryTags: (styledColumn: StyledColumn, api: AdaptableApi) => React.JSX.Element;
8
+ export declare const StyledColumnBadgeDefinitionsView: React.FunctionComponent<React.PropsWithChildren<{
9
+ data: StyledColumn;
10
+ }>>;
11
+ export declare const renderBadgeSummary: (styledColumn: StyledColumn, api?: AdaptableApi) => React.JSX.Element;
4
12
  export interface StyledColumnBadgeSectionProps {
5
13
  onChange: (data: StyledColumn) => void;
6
14
  }
@@ -9,4 +17,4 @@ export interface StyledColumnBadgeStyleSectionProps {
9
17
  onChange: (data: StyledColumn) => void;
10
18
  }
11
19
  export declare const StyledColumnBadgeStyleSection: React.FunctionComponent<StyledColumnBadgeStyleSectionProps>;
12
- export declare const renderBadgeStyleSummary: (styledColumn: StyledColumn) => React.JSX.Element;
20
+ export declare const renderBadgeStyleSummary: (styledColumn: StyledColumn, api?: AdaptableApi) => React.JSX.Element;
@@ -9,7 +9,6 @@ import ObjectFactory from '../../../Utilities/ObjectFactory';
9
9
  import { AdaptableIconSelector } from '../../Components/AdaptableIconSelector';
10
10
  import { PredicateEditor } from '../../Components/PredicateEditor/PredicateEditor';
11
11
  import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
12
- import { StyledColumnBadgePreview } from './StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview';
13
12
  import { Badge } from '../../Components/Badge';
14
13
  import { AdaptableIconComponent } from '../../Components/AdaptableIconComponent';
15
14
  import { DEFAULT_INTEGER_DISPLAY_VALUE, DEFAULT_STRING_DISPLAY_VALUE, } from '../../../Utilities/Constants/GeneralConstants';
@@ -18,9 +17,11 @@ import { Flex, Box } from '../../../components/Flex';
18
17
  import Radio, { RadioGroup } from '../../../components/Radio';
19
18
  import { NumberInput } from '../../../components/Input/NumberInput';
20
19
  import { Toggle, ToggleGroup } from '../../../components/Toggle';
21
- import { BadgePillStyleEditor } from './BadgePillStyleEditor';
22
- import { renderCellStyleSummaryTags, StyledColumnCellStyleEditor, } from './StyledColumnSliceStyleEditors';
20
+ import { BadgePillStyleEditor, getBadgePillStyleSummaryItems } from './BadgePillStyleEditor';
21
+ import { getCellBoxStyleSummaryItems, getCellFontStyleSummaryItems, StyledColumnCellStyleEditor, } from './StyledColumnSliceStyleEditors';
23
22
  import { Card } from '../../../components/Card';
23
+ import { useAdaptable } from '../../AdaptableContext';
24
+ import { StyledColumnBadgePreviewCard } from './StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview';
24
25
  const BADGE_STYLE_FORM_SIZES = ['200px', '1fr'];
25
26
  const SHAPE_CHOICES = [
26
27
  { value: 'Pill', label: 'Pill' },
@@ -94,8 +95,88 @@ const BadgeEditor = (props) => {
94
95
  });
95
96
  } }), _jsx(Box, { className: "twa:text-xs twa:opacity-70", children: "px between icon and text \u2014 leave blank to follow Density" })] }) }))] }) })] }));
96
97
  };
97
- export const renderBadgeSummary = (styledColumn) => {
98
- return _jsx(StyledColumnBadgePreview, { data: styledColumn });
98
+ export const getStyledColumnBadgeDefinitionViewValueGroups = (styledColumn, api) => {
99
+ const badgeStyle = styledColumn.BadgeStyle;
100
+ if (!badgeStyle?.Badges?.length) {
101
+ return [];
102
+ }
103
+ return badgeStyle.Badges.map((badge, index) => {
104
+ const items = [];
105
+ let rule = 'Always';
106
+ if (badge.Predicate) {
107
+ rule = api.predicateApi.predicateToString(badge.Predicate);
108
+ }
109
+ else if (badge.Expression) {
110
+ rule = badge.Expression.BooleanExpression;
111
+ }
112
+ items.push(`Badge ${index + 1}: ${rule}`);
113
+ items.push(`Shape: ${badge.Shape ?? 'Rounded'}`);
114
+ getBadgePillStyleSummaryItems(badge.PillStyle).forEach(({ label, value }) => {
115
+ items.push(`${label}: ${value}`);
116
+ });
117
+ if (badge.Icon) {
118
+ const iconName = 'name' in badge.Icon ? badge.Icon.name : 'Custom';
119
+ items.push(`Icon: ${iconName}`);
120
+ }
121
+ if (badge.IconOnly) {
122
+ items.push('Icon Only: Yes');
123
+ }
124
+ if (badge.Icon && badge.IconPosition) {
125
+ items.push(`Icon Position: ${badge.IconPosition}`);
126
+ }
127
+ if (typeof badge.IconGap === 'number') {
128
+ items.push(`Icon Gap: ${badge.IconGap}px`);
129
+ }
130
+ return items;
131
+ });
132
+ };
133
+ export const getStyledColumnBadgeDefinitionViewValues = (styledColumn, api) => {
134
+ return getStyledColumnBadgeDefinitionViewValueGroups(styledColumn, api).flat();
135
+ };
136
+ const isBadgeArrayColumn = (styledColumn, api) => {
137
+ if (!api || !styledColumn.ColumnId) {
138
+ return false;
139
+ }
140
+ const dataType = api.columnApi.getColumnDataTypeForColumnId(styledColumn.ColumnId);
141
+ return dataType === 'numberArray' || dataType === 'textArray';
142
+ };
143
+ export const getStyledColumnBadgeStyleViewValues = (styledColumn, api) => {
144
+ const badgeStyle = styledColumn.BadgeStyle;
145
+ if (!badgeStyle) {
146
+ return [];
147
+ }
148
+ const items = [`Density: ${badgeStyle.Density ?? 'Normal'}`];
149
+ if (isBadgeArrayColumn(styledColumn, api)) {
150
+ if (typeof badgeStyle.Spacing === 'number') {
151
+ items.push(`Spacing: ${badgeStyle.Spacing}px`);
152
+ }
153
+ items.push(`Overflow: ${badgeStyle.OverflowMode ?? 'Truncate'}`);
154
+ }
155
+ getCellFontStyleSummaryItems(badgeStyle.Font).forEach(({ label, value }) => {
156
+ items.push(`${label}: ${value}`);
157
+ });
158
+ getCellBoxStyleSummaryItems(badgeStyle.Cell).forEach(({ label, value }) => {
159
+ items.push(`${label}: ${value}`);
160
+ });
161
+ return items;
162
+ };
163
+ export const renderBadgeDefinitionSummaryTags = (styledColumn, api) => {
164
+ const groups = getStyledColumnBadgeDefinitionViewValueGroups(styledColumn, api);
165
+ if (!groups.length) {
166
+ return _jsx(Tag, { children: "No Badges Defined" });
167
+ }
168
+ return (_jsx(Flex, { flexDirection: "column", className: "twa:gap-2", children: groups.map((items, index) => (_jsx(Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: items.map((item, itemIndex) => (_jsx(Tag, { children: item }, `${index}-${itemIndex}`))) }, index))) }));
169
+ };
170
+ export const StyledColumnBadgeDefinitionsView = ({ data }) => {
171
+ const { api } = useAdaptable();
172
+ return renderBadgeDefinitionSummaryTags(data, api);
173
+ };
174
+ export const renderBadgeSummary = (styledColumn, api) => {
175
+ if (!api) {
176
+ const { api: adaptableApi } = useOnePageAdaptableWizardContext();
177
+ api = adaptableApi;
178
+ }
179
+ return renderBadgeDefinitionSummaryTags(styledColumn, api);
99
180
  };
100
181
  export const StyledColumnBadgeSection = (props) => {
101
182
  const { data } = useOnePageAdaptableWizardContext();
@@ -176,17 +257,16 @@ export const StyledColumnBadgeStyleSection = (props) => {
176
257
  delete cleaned.Cell;
177
258
  props.onChange({ ...data, BadgeStyle: cleaned });
178
259
  }
179
- } }) })] })] })] }));
260
+ } }) })] })] }), _jsx(StyledColumnBadgePreviewCard, { data: data })] }));
180
261
  };
181
- export const renderBadgeStyleSummary = (styledColumn) => {
182
- const badgeStyle = styledColumn?.BadgeStyle;
183
- if (!badgeStyle) {
184
- return _jsx(Tag, { children: "\u2014" });
262
+ export const renderBadgeStyleSummary = (styledColumn, api) => {
263
+ if (!api) {
264
+ const { api: adaptableApi } = useOnePageAdaptableWizardContext();
265
+ api = adaptableApi;
266
+ }
267
+ const items = getStyledColumnBadgeStyleViewValues(styledColumn, api);
268
+ if (!items.length) {
269
+ return _jsx(Tag, { children: "No Style Defined" });
185
270
  }
186
- const density = badgeStyle.Density ?? 'Normal';
187
- const spacing = typeof badgeStyle.Spacing === 'number' ? badgeStyle.Spacing : null;
188
- const overflow = badgeStyle.OverflowMode ?? 'Truncate';
189
- const alignment = badgeStyle.Font?.Alignment;
190
- const cellTags = renderCellStyleSummaryTags(badgeStyle.Cell);
191
- return (_jsxs(Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: [_jsxs(Box, { children: ["Density: ", _jsx(Tag, { children: density })] }), spacing != null && (_jsxs(Box, { children: ["Spacing: ", _jsxs(Tag, { children: [spacing, "px"] })] })), _jsxs(Box, { children: ["Overflow: ", _jsx(Tag, { children: overflow })] }), alignment && (_jsxs(Box, { children: ["Align: ", _jsx(Tag, { children: alignment })] })), cellTags && _jsxs(Box, { children: ["Cell: ", cellTags] })] }));
271
+ return (_jsx(Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: items.map((item) => (_jsx(Tag, { children: item }, item))) }));
192
272
  };
@@ -39,10 +39,24 @@ export interface StyledColumnCellStyleEditorProps {
39
39
  * key is unset) which the host wizard merges back into its `*Style` patch.
40
40
  */
41
41
  export declare const StyledColumnCellStyleEditor: React.FunctionComponent<StyledColumnCellStyleEditorProps>;
42
+ /**
43
+ * Descriptive font properties for summary panels (`Label: value` strings).
44
+ */
45
+ export declare const getCellFontStyleSummaryItems: (font: CellFontStyle | undefined) => {
46
+ label: string;
47
+ value: string;
48
+ }[];
42
49
  /**
43
50
  * Compact summary tags for the Font slice; used by wizard summary panels.
44
51
  */
45
52
  export declare const renderFontStyleSummaryTags: (font: CellFontStyle | undefined) => React.JSX.Element | null;
53
+ /**
54
+ * Descriptive cell box properties for summary panels (`Label: value` strings).
55
+ */
56
+ export declare const getCellBoxStyleSummaryItems: (cell: CellBoxStyle | undefined) => {
57
+ label: string;
58
+ value: string;
59
+ }[];
46
60
  /**
47
61
  * Compact summary tags for the Cell slice; used by wizard summary panels.
48
62
  */
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from 'react';
2
3
  import { CheckBox } from '../../../components/CheckBox';
3
4
  import { ColorPicker } from '../../../components/ColorPicker';
4
5
  import FormLayout, { FormRow } from '../../../components/FormLayout';
@@ -69,9 +70,11 @@ export const StyledColumnFontStyleEditor = (props) => {
69
70
  */
70
71
  export const StyledColumnCellStyleEditor = (props) => {
71
72
  const cell = props.value ?? {};
73
+ const cellRef = React.useRef(cell);
74
+ cellRef.current = cell;
72
75
  const { disabled } = props;
73
76
  const update = (patch) => {
74
- const next = { ...cell, ...patch };
77
+ const next = { ...cellRef.current, ...patch };
75
78
  Object.keys(next).forEach((k) => {
76
79
  const v = next[k];
77
80
  if (v === undefined || v === null || v === '') {
@@ -88,51 +91,69 @@ export const StyledColumnCellStyleEditor = (props) => {
88
91
  return (_jsx(Box, { children: _jsxs(FormLayout, { className: "twa:ml-2", sizes: [...FORM_SIZES], children: [_jsx(FormRow, { label: "Background:", children: _jsxs(Flex, { alignItems: "center", className: "twa:ml-2 twa:gap-2", children: [_jsx(CheckBox, { disabled: disabled, checked: !!cell.BackColor, onChange: (checked) => update({ BackColor: checked ? cell.BackColor ?? '#ffffff' : undefined }), children: "Set" }), _jsx(ColorPicker, { disabled: disabled || !cell.BackColor, api: props.api, value: cell.BackColor || '#ffffff', onChange: (c) => update({ BackColor: c }) })] }) }), _jsx(FormRow, { label: "Border colour:", children: _jsxs(Flex, { alignItems: "center", className: "twa:ml-2 twa:gap-2", children: [_jsx(CheckBox, { disabled: disabled, checked: !!cell.BorderColor, onChange: (checked) => update({ BorderColor: checked ? cell.BorderColor ?? '#000000' : undefined }), children: "Set" }), _jsx(ColorPicker, { disabled: disabled || !cell.BorderColor, api: props.api, value: cell.BorderColor || '#000000', onChange: (c) => update({ BorderColor: c }) })] }) }), _jsx(FormRow, { label: "Border radius:", children: _jsxs(Flex, { alignItems: "center", className: "twa:ml-2 twa:gap-2", children: [_jsx(NumberInput, { disabled: disabled, className: "twa:w-20", value: cell.BorderRadius, min: 0, max: 64, step: 1, onChange: (v) => update({ BorderRadius: v === undefined || isNaN(Number(v)) ? undefined : v }) }), _jsx(Box, { className: "twa:text-xs twa:opacity-70", children: "px" })] }) })] }) }));
89
92
  };
90
93
  /**
91
- * Compact summary tags for the Font slice; used by wizard summary panels.
94
+ * Descriptive font properties for summary panels (`Label: value` strings).
92
95
  */
93
- export const renderFontStyleSummaryTags = (font) => {
94
- if (!font)
95
- return null;
96
- const tags = [];
96
+ export const getCellFontStyleSummaryItems = (font) => {
97
+ if (!font) {
98
+ return [];
99
+ }
100
+ const items = [];
97
101
  if (font.ForeColor) {
98
- tags.push(_jsxs(Tag, { children: ["Text ", font.ForeColor] }, "fg"));
102
+ items.push({ label: 'Fore Colour', value: font.ForeColor });
99
103
  }
100
104
  if (font.FontWeight === 'Bold') {
101
- tags.push(_jsx(Tag, { children: "Bold" }, "b"));
105
+ items.push({ label: 'Font Weight', value: 'Bold' });
102
106
  }
103
107
  if (font.FontStyle === 'Italic') {
104
- tags.push(_jsx(Tag, { children: "Italic" }, "i"));
108
+ items.push({ label: 'Font Style', value: 'Italic' });
105
109
  }
106
110
  if (font.TextDecoration && font.TextDecoration !== 'None') {
107
- tags.push(_jsx(Tag, { children: font.TextDecoration }, "td"));
111
+ items.push({ label: 'Text Decoration', value: font.TextDecoration });
108
112
  }
109
113
  if (font.FontSize) {
110
- tags.push(_jsx(Tag, { children: font.FontSize }, "fs"));
114
+ items.push({ label: 'Font Size', value: font.FontSize });
111
115
  }
112
116
  if (font.Alignment && font.Alignment !== 'Default') {
113
- tags.push(_jsxs(Tag, { children: ["Align ", font.Alignment] }, "al"));
117
+ items.push({ label: 'Alignment', value: font.Alignment });
114
118
  }
115
- if (tags.length === 0)
116
- return null;
117
- return (_jsx(Flex, { alignItems: "center", className: "twa:gap-1 twa:flex-wrap", children: tags }));
119
+ return items;
118
120
  };
119
121
  /**
120
- * Compact summary tags for the Cell slice; used by wizard summary panels.
122
+ * Compact summary tags for the Font slice; used by wizard summary panels.
121
123
  */
122
- export const renderCellStyleSummaryTags = (cell) => {
123
- if (!cell)
124
+ export const renderFontStyleSummaryTags = (font) => {
125
+ const items = getCellFontStyleSummaryItems(font);
126
+ if (!items.length) {
124
127
  return null;
125
- const tags = [];
128
+ }
129
+ return (_jsx(Flex, { alignItems: "center", className: "twa:gap-1 twa:flex-wrap", children: items.map(({ label, value }) => (_jsx(Tag, { children: `${label}: ${value}` }, label))) }));
130
+ };
131
+ /**
132
+ * Descriptive cell box properties for summary panels (`Label: value` strings).
133
+ */
134
+ export const getCellBoxStyleSummaryItems = (cell) => {
135
+ if (!cell) {
136
+ return [];
137
+ }
138
+ const items = [];
126
139
  if (cell.BackColor) {
127
- tags.push(_jsxs(Tag, { children: ["Bg ", cell.BackColor] }, "bg"));
140
+ items.push({ label: 'Back Colour', value: cell.BackColor });
128
141
  }
129
142
  if (cell.BorderColor) {
130
- tags.push(_jsxs(Tag, { children: ["Border ", cell.BorderColor] }, "bc"));
143
+ items.push({ label: 'Border Colour', value: cell.BorderColor });
131
144
  }
132
145
  if (cell.BorderRadius != null) {
133
- tags.push(_jsxs(Tag, { children: ["Radius ", cell.BorderRadius, "px"] }, "br"));
146
+ items.push({ label: 'Border Radius', value: `${cell.BorderRadius}px` });
134
147
  }
135
- if (tags.length === 0)
148
+ return items;
149
+ };
150
+ /**
151
+ * Compact summary tags for the Cell slice; used by wizard summary panels.
152
+ */
153
+ export const renderCellStyleSummaryTags = (cell) => {
154
+ const items = getCellBoxStyleSummaryItems(cell);
155
+ if (!items.length) {
136
156
  return null;
137
- return (_jsx(Flex, { alignItems: "center", className: "twa:gap-1 twa:flex-wrap", children: tags }));
157
+ }
158
+ return (_jsx(Flex, { alignItems: "center", className: "twa:gap-1 twa:flex-wrap", children: items.map(({ label, value }) => (_jsx(Tag, { children: `${label}: ${value}` }, label))) }));
138
159
  };