@adaptabletools/adaptable-cjs 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 +30 -3
  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 +2 -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 +19 -8
  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 +12 -5
  34. package/src/Strategy/LayoutModule.js +13 -8
  35. package/src/Strategy/StyledColumnModule.js +58 -30
  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 +68 -0
  41. package/src/Utilities/Helpers/StyledColumnGradientHelper.d.ts +23 -1
  42. package/src/Utilities/Helpers/StyledColumnGradientHelper.js +212 -1
  43. package/src/Utilities/Helpers/ThemeHelpers.d.ts +5 -0
  44. package/src/Utilities/Helpers/ThemeHelpers.js +43 -0
  45. package/src/Utilities/Helpers/percentBarPreviewHelper.d.ts +19 -0
  46. package/src/Utilities/Helpers/percentBarPreviewHelper.js +155 -0
  47. package/src/Utilities/ObjectFactory.d.ts +1 -3
  48. package/src/Utilities/ObjectFactory.js +0 -9
  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 +113 -102
  52. package/src/View/Alert/Wizard/AlertMessageWizardSection.js +12 -13
  53. package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +54 -54
  54. package/src/View/Alert/Wizard/AlertRulesWizardSection.js +4 -3
  55. package/src/View/Alert/Wizard/AlertScheduledWizardSection.js +1 -1
  56. package/src/View/Alert/Wizard/AlertScopeWizardSection.js +29 -37
  57. package/src/View/Alert/Wizard/AlertTypeWizardSection.js +2 -3
  58. package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +9 -13
  59. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +28 -15
  60. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +7 -9
  61. package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +2 -2
  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 +26 -0
  69. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.d.ts +1 -0
  70. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.js +9 -6
  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 +1 -2
  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 +5 -4
  87. package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.js +2 -1
  88. package/src/View/DataImport/DataImportWizard/sections/ValidationSection.js +4 -15
  89. package/src/View/Export/Wizard/ReportColumnsWizardSection.js +24 -27
  90. package/src/View/Export/Wizard/ReportNameWizardSection.js +8 -11
  91. package/src/View/Export/Wizard/ReportRowsWizardSection.js +19 -22
  92. package/src/View/Export/Wizard/ScheduledReportSettings.d.ts +2 -0
  93. package/src/View/Export/Wizard/ScheduledReportSettings.js +12 -12
  94. package/src/View/Export/Wizard/ScheduledReportWizard.js +2 -3
  95. package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +8 -6
  96. package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +19 -20
  97. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +20 -11
  98. package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +19 -3
  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 +120 -13
  102. package/src/View/FormatColumn/Wizard/FormatColumnPreview.d.ts +15 -0
  103. package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +78 -0
  104. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +4 -0
  105. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +34 -0
  106. package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +11 -6
  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 +64 -13
  110. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +3 -1
  111. package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.d.ts +2 -0
  112. package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.js +19 -0
  113. package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.d.ts +10 -0
  114. package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.js +60 -0
  115. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +2 -3
  116. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +35 -70
  117. package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +14 -10
  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 +116 -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 +10 -10
  125. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +1 -2
  126. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +101 -51
  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 +3 -4
  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 +7 -12
  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 +45 -12
  139. package/src/View/PlusMinus/Wizard/PlusMinusScopeWizardSection.js +10 -17
  140. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.d.ts +2 -6
  141. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +5 -21
  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 +10 -17
  145. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +16 -5
  146. package/src/View/Shortcut/Wizard/ShortcutWizard.js +2 -2
  147. package/src/View/Shortcut/shortcutOperations.d.ts +3 -0
  148. package/src/View/Shortcut/shortcutOperations.js +32 -1
  149. package/src/View/SpecialColumnSettingsWizardStep.js +7 -6
  150. package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +5 -0
  151. package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +26 -16
  152. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.d.ts +10 -2
  153. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +100 -15
  154. package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +14 -0
  155. package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +48 -25
  156. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +2 -3
  157. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +109 -33
  158. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +20 -12
  159. package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.d.ts +5 -0
  160. package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +124 -23
  161. package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.d.ts +1 -0
  162. package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +35 -11
  163. package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.d.ts +5 -0
  164. package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +88 -11
  165. package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.d.ts +5 -0
  166. package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +125 -35
  167. package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.d.ts +1 -0
  168. package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +55 -74
  169. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.d.ts +5 -0
  170. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.js +20 -0
  171. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +6 -12
  172. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarColumnComparisonPreview.js +5 -5
  173. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarRangesPreview.js +2 -1
  174. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.d.ts +5 -4
  175. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.js +11 -13
  176. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.d.ts +5 -0
  177. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.js +20 -0
  178. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.d.ts +3 -0
  179. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +32 -3
  180. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.d.ts +9 -0
  181. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +64 -0
  182. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.d.ts +10 -0
  183. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.js +35 -0
  184. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.d.ts +10 -0
  185. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.js +96 -0
  186. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.d.ts +8 -0
  187. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.js +57 -0
  188. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.d.ts +8 -0
  189. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +58 -0
  190. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.d.ts +18 -0
  191. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.js +66 -0
  192. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.d.ts +10 -0
  193. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +133 -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 +53 -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 +6 -20
  202. package/src/agGrid/AdaptableAgGrid.d.ts +1 -0
  203. package/src/agGrid/AdaptableAgGrid.js +34 -24
  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 +114 -0
  211. package/src/agGrid/cellRenderers/IconRenderer.d.ts +6 -0
  212. package/src/agGrid/cellRenderers/IconRenderer.js +46 -17
  213. package/src/agGrid/createAgGridIcon.d.ts +10 -0
  214. package/src/agGrid/createAgGridIcon.js +19 -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.cjs.tsbuildinfo +1 -1
  231. package/src/Aggregation/ParameterizedAggregationRegistry.d.ts +0 -35
  232. package/src/Aggregation/ParameterizedAggregationRegistry.js +0 -74
  233. package/src/Aggregation/definitions/weightedAverageAggregationDefinition.d.ts +0 -3
  234. package/src/Aggregation/definitions/weightedAverageAggregationDefinition.js +0 -58
  235. package/src/Aggregation/parameterizedAggregationColumnMenu.d.ts +0 -8
  236. package/src/Aggregation/parameterizedAggregationColumnMenu.js +0 -143
  237. package/src/Aggregation/parameterizedAggregationHeader.d.ts +0 -13
  238. package/src/Aggregation/parameterizedAggregationHeader.js +0 -65
  239. package/src/Aggregation/parameterizedAggregationHelpers.d.ts +0 -23
  240. package/src/Aggregation/parameterizedAggregationHelpers.js +0 -121
  241. package/src/Aggregation/parameterizedAggregationWizardHelpers.d.ts +0 -9
  242. package/src/Aggregation/parameterizedAggregationWizardHelpers.js +0 -74
  243. package/src/Aggregation/validateParameterizedAggregations.d.ts +0 -4
  244. package/src/Aggregation/validateParameterizedAggregations.js +0 -25
  245. package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.d.ts +0 -12
  246. package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.js +0 -48
  247. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.d.ts +0 -5
  248. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.js +0 -32
  249. package/src/View/Theme/VariantSelector.d.ts +0 -8
  250. package/src/View/Theme/VariantSelector.js +0 -25
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StyledColumnGradientPreviewCard = exports.StyledColumnGradientPreview = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const Flex_1 = require("../../../../../components/Flex");
6
+ const Card_1 = require("../../../../../components/Card");
7
+ const Tag_1 = require("../../../../../components/Tag");
8
+ const AdaptableContext_1 = require("../../../../AdaptableContext");
9
+ const StyledColumnGradientHelper_1 = require("../../../../../Utilities/Helpers/StyledColumnGradientHelper");
10
+ const formatPreviewValue = (value) => {
11
+ if (Number.isInteger(value)) {
12
+ return value.toLocaleString();
13
+ }
14
+ return value.toLocaleString(undefined, { maximumFractionDigits: 2 });
15
+ };
16
+ const StyledColumnGradientPreview = ({ data, api: apiProp }) => {
17
+ const adaptable = (0, AdaptableContext_1.useAdaptable)();
18
+ const api = apiProp ?? adaptable.api;
19
+ const gs = data.GradientStyle;
20
+ if (!gs) {
21
+ return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "No Gradient Style" });
22
+ }
23
+ if (!(0, StyledColumnGradientHelper_1.hasGradientRangesConfigured)(gs)) {
24
+ return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "Define ranges before previewing" });
25
+ }
26
+ const sampleValues = (0, StyledColumnGradientHelper_1.getGradientPreviewSampleValues)(data, api);
27
+ if (!sampleValues.length) {
28
+ return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "No preview available" });
29
+ }
30
+ const rowNode = api.gridApi?.getRowNodeForIndex(0) ?? null;
31
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { alignItems: "stretch", className: "twa:flex-wrap twa:gap-2", children: sampleValues.map((value) => ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "ab-GradientPreviewCell twa:px-2 twa:py-1 twa:min-w-[56px] twa:text-2 twa:text-center twa:rounded-standard twa:border twa:border-[color-mix(in_srgb,var(--ab-color-foreground)_15%,transparent)]", style: (0, StyledColumnGradientHelper_1.getGradientPreviewCellStyle)(value, data, api, rowNode), children: formatPreviewValue(value) }, value))) }));
32
+ };
33
+ exports.StyledColumnGradientPreview = StyledColumnGradientPreview;
34
+ const StyledColumnGradientPreviewCard = ({ data }) => ((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: "Preview" }) }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:p-1", children: (0, jsx_runtime_1.jsx)(exports.StyledColumnGradientPreview, { data: data }) })] }));
35
+ exports.StyledColumnGradientPreviewCard = StyledColumnGradientPreviewCard;
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { StyledColumn } from '../../../../../AdaptableState/StyledColumnState';
3
+ export declare const DEFAULT_ICON_STYLE_SIZE = 18;
4
+ export declare const DEFAULT_ICON_STYLE_GAP = 4;
5
+ export declare const StyledColumnIconPreview: React.FunctionComponent<React.PropsWithChildren<{
6
+ data: StyledColumn;
7
+ }>>;
8
+ export declare const StyledColumnIconPreviewCard: React.FunctionComponent<React.PropsWithChildren<{
9
+ data: StyledColumn;
10
+ }>>;
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StyledColumnIconPreviewCard = exports.StyledColumnIconPreview = exports.DEFAULT_ICON_STYLE_GAP = exports.DEFAULT_ICON_STYLE_SIZE = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const Icon_1 = require("../../../../../components/Icon");
6
+ const IconRenderer_1 = require("../../../../../agGrid/cellRenderers/IconRenderer");
7
+ const AdaptableIconComponent_1 = require("../../../../Components/AdaptableIconComponent");
8
+ const Flex_1 = require("../../../../../components/Flex");
9
+ const Card_1 = require("../../../../../components/Card");
10
+ const Tag_1 = require("../../../../../components/Tag");
11
+ const StyleHelper_1 = require("../../../../../Utilities/Helpers/StyleHelper");
12
+ exports.DEFAULT_ICON_STYLE_SIZE = 18;
13
+ exports.DEFAULT_ICON_STYLE_GAP = 4;
14
+ const PREVIEW_CELL_CLASS = 'ab-IconPreviewCell twa:inline-flex twa:items-center twa:min-w-[140px] twa:min-h-[32px] twa:px-2 twa:py-1 twa:rounded-standard twa:border twa:border-[color-mix(in_srgb,var(--ab-color-foreground)_15%,transparent)]';
15
+ const isInlineGlyph = (spec) => typeof spec === 'string';
16
+ const isAdaptableIconSpec = (spec) => !!spec &&
17
+ ((0, Icon_1.isAdaptableSystemIcon)(spec) ||
18
+ (0, Icon_1.isAdaptableCustomIcon)(spec) ||
19
+ (0, Icon_1.isAdaptableElementIcon)(spec));
20
+ function getIconCellChromeCss(cell) {
21
+ if (!cell || !(0, StyleHelper_1.hasCellBoxStyle)(cell)) {
22
+ return {};
23
+ }
24
+ return (0, StyleHelper_1.convertAdaptableStyleToCSS)(cell);
25
+ }
26
+ const renderIconSpecForPreview = (spec, size) => {
27
+ if (isInlineGlyph(spec)) {
28
+ return ((0, jsx_runtime_1.jsx)("span", { className: "ab-IconStyle__glyph", style: {
29
+ fontSize: size,
30
+ lineHeight: 1,
31
+ display: 'inline-flex',
32
+ alignItems: 'center',
33
+ justifyContent: 'center',
34
+ }, children: spec }));
35
+ }
36
+ if (isAdaptableIconSpec(spec)) {
37
+ return (0, jsx_runtime_1.jsx)(AdaptableIconComponent_1.AdaptableIconComponent, { icon: spec });
38
+ }
39
+ return null;
40
+ };
41
+ const buildPreviewText = (mapping, iconStyle) => {
42
+ const cellTextTokens = iconStyle.CellText ?? [];
43
+ const formatted = String(mapping.Key);
44
+ const textParts = [];
45
+ if (cellTextTokens.includes('CellValue') && formatted) {
46
+ textParts.push(formatted);
47
+ }
48
+ if (cellTextTokens.includes('IconDescription') && mapping.Description) {
49
+ textParts.push(mapping.Description);
50
+ }
51
+ return textParts.length > 0 ? textParts.join(' · ') : undefined;
52
+ };
53
+ const IconCellPreviewTree = ({ iconStyle, mapping }) => {
54
+ const size = iconStyle.Size ?? exports.DEFAULT_ICON_STYLE_SIZE;
55
+ const gap = iconStyle.Gap ?? exports.DEFAULT_ICON_STYLE_GAP;
56
+ const textPosition = iconStyle.CellTextPosition ?? 'After';
57
+ const text = buildPreviewText(mapping, iconStyle);
58
+ const fontStyle = iconStyle.Font ? (0, StyleHelper_1.convertAdaptableStyleToCSS)(iconStyle.Font) : undefined;
59
+ const iconNode = renderIconSpecForPreview(mapping.Icon, size);
60
+ const textNode = text ? ((0, jsx_runtime_1.jsx)("span", { className: "ab-IconStyle__text", style: { lineHeight: 1.2, ...fontStyle }, children: text })) : null;
61
+ if (!iconNode && !textNode) {
62
+ return null;
63
+ }
64
+ if (!textNode) {
65
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: iconNode });
66
+ }
67
+ if (!iconNode) {
68
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: textNode });
69
+ }
70
+ const isStacked = textPosition === 'Above' || textPosition === 'Below';
71
+ const children = textPosition === 'Before' || textPosition === 'Above'
72
+ ? [textNode, iconNode]
73
+ : [iconNode, textNode];
74
+ return ((0, jsx_runtime_1.jsx)("span", { className: "ab-IconStyle__wrapper", style: {
75
+ display: 'inline-flex',
76
+ flexDirection: isStacked ? 'column' : 'row',
77
+ alignItems: 'center',
78
+ gap,
79
+ lineHeight: 1,
80
+ }, children: children }));
81
+ };
82
+ const StyledColumnIconPreview = ({ data }) => {
83
+ const iconStyle = data.IconStyle;
84
+ if (!iconStyle) {
85
+ return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "No Icon Style" });
86
+ }
87
+ const effectiveMappings = (0, IconRenderer_1.resolveEffectiveIconStyleMappings)(iconStyle);
88
+ if (effectiveMappings.length === 0) {
89
+ return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "Define mappings to preview" });
90
+ }
91
+ const previewCellChrome = getIconCellChromeCss(iconStyle.Cell);
92
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: PREVIEW_CELL_CLASS, style: previewCellChrome, children: (0, jsx_runtime_1.jsx)(IconCellPreviewTree, { iconStyle: iconStyle, mapping: effectiveMappings[0] }) }));
93
+ };
94
+ exports.StyledColumnIconPreview = StyledColumnIconPreview;
95
+ const StyledColumnIconPreviewCard = ({ data }) => ((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: "Preview" }) }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:p-1", children: (0, jsx_runtime_1.jsx)(exports.StyledColumnIconPreview, { data: data }) })] }));
96
+ exports.StyledColumnIconPreviewCard = StyledColumnIconPreviewCard;
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { StyledColumn } from '../../../../../AdaptableState/StyledColumnState';
3
+ export declare const StyledColumnPercentBarPreview: React.FunctionComponent<React.PropsWithChildren<{
4
+ data: StyledColumn;
5
+ }>>;
6
+ export declare const StyledColumnPercentBarPreviewCard: React.FunctionComponent<React.PropsWithChildren<{
7
+ data: StyledColumn;
8
+ }>>;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StyledColumnPercentBarPreviewCard = exports.StyledColumnPercentBarPreview = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const StyleHelper_1 = require("../../../../../Utilities/Helpers/StyleHelper");
6
+ const percentBarPreviewHelper_1 = require("../../../../../Utilities/Helpers/percentBarPreviewHelper");
7
+ const Flex_1 = require("../../../../../components/Flex");
8
+ const Card_1 = require("../../../../../components/Card");
9
+ const Tag_1 = require("../../../../../components/Tag");
10
+ const PREVIEW_CELL_CLASS = 'ab-PercentBarPreviewCell twa:w-[72px] twa:min-h-[32px] twa:px-1 twa:py-1 twa:rounded-standard twa:border twa:border-[color-mix(in_srgb,var(--ab-color-foreground)_15%,transparent)]';
11
+ const PercentBarPreviewCell = ({ styledColumn, value, min, max }) => {
12
+ const pb = styledColumn.PercentBarStyle;
13
+ const { barLeftPercent, barWidthPercent, percentageValue, barColor } = (0, percentBarPreviewHelper_1.getPercentBarPreviewGeometry)(value, pb, min, max);
14
+ const trackColor = (0, percentBarPreviewHelper_1.getPercentBarPreviewTrackColor)(pb);
15
+ const fillColor = (0, percentBarPreviewHelper_1.getPercentBarPreviewResolvedBarColor)(barColor);
16
+ const cellText = (0, percentBarPreviewHelper_1.formatPercentBarPreviewCellText)(value, percentageValue, pb);
17
+ const hasCellText = Boolean(pb.CellText?.length && cellText);
18
+ const textPosition = pb.CellTextPosition ?? 'Below';
19
+ const fontStyle = pb.Font ? (0, StyleHelper_1.convertAdaptableStyleToCSS)(pb.Font) : undefined;
20
+ const textEl = hasCellText ? ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "ab-PercentBar__text twa:text-2 twa:leading-tight twa:truncate", style: fontStyle, children: cellText })) : null;
21
+ const barEl = ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "ab-PercentBar__bar twa:relative twa:flex-1 twa:min-h-[6px]", style: trackColor ? { background: (0, percentBarPreviewHelper_1.getPercentBarPreviewResolvedBarColor)(trackColor) } : undefined, children: [fillColor && ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "ab-PercentBar__barInside twa:absolute twa:top-0 twa:h-full", style: {
22
+ background: fillColor,
23
+ left: `${barLeftPercent.toFixed(2)}%`,
24
+ width: `${barWidthPercent.toFixed(2)}%`,
25
+ } })), hasCellText && textPosition === 'Merged' && ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "ab-PercentBar__text twa:absolute twa:inset-x-0 twa:top-1/2 twa:-translate-y-1/2 twa:px-1 twa:text-2 twa:truncate", style: fontStyle, children: cellText }))] }));
26
+ return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { className: `ab-PercentBar__wrapper ${PREVIEW_CELL_CLASS}`, flexDirection: "column", style: { justifyContent: 'center', height: hasCellText && textPosition !== 'Merged' ? '100%' : undefined }, children: [hasCellText && textPosition === 'Above' && textEl, barEl, hasCellText && textPosition === 'Below' && textEl] }));
27
+ };
28
+ const StyledColumnPercentBarPreview = ({ data }) => {
29
+ const pb = data.PercentBarStyle;
30
+ if (!pb) {
31
+ return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "No Percent Bar Style" });
32
+ }
33
+ if (!(0, percentBarPreviewHelper_1.hasPercentBarRangesConfigured)(pb)) {
34
+ return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "Define ranges before previewing" });
35
+ }
36
+ let min;
37
+ let max;
38
+ if (pb.ColumnComparison) {
39
+ const cmpMin = Number(pb.ColumnComparison.MinValue);
40
+ const cmpMax = Number(pb.ColumnComparison.MaxValue);
41
+ if (!Number.isNaN(cmpMin) && !Number.isNaN(cmpMax)) {
42
+ min = cmpMin;
43
+ max = cmpMax;
44
+ }
45
+ else {
46
+ ({ min, max } = (0, percentBarPreviewHelper_1.getPercentBarPreviewScale)(pb));
47
+ }
48
+ }
49
+ else {
50
+ ({ min, max } = (0, percentBarPreviewHelper_1.getPercentBarPreviewScale)(pb));
51
+ }
52
+ const sampleValues = (0, percentBarPreviewHelper_1.getPercentBarPreviewSampleValues)(pb);
53
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { alignItems: "stretch", className: "twa:flex-wrap twa:gap-2", children: sampleValues.map((value) => ((0, jsx_runtime_1.jsx)(PercentBarPreviewCell, { styledColumn: data, value: value, min: min, max: max }, value))) }));
54
+ };
55
+ exports.StyledColumnPercentBarPreview = StyledColumnPercentBarPreview;
56
+ const StyledColumnPercentBarPreviewCard = ({ data }) => ((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: "Preview" }) }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:p-1", children: (0, jsx_runtime_1.jsx)(exports.StyledColumnPercentBarPreview, { data: data }) })] }));
57
+ exports.StyledColumnPercentBarPreviewCard = StyledColumnPercentBarPreviewCard;
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { StyledColumn } from '../../../../../AdaptableState/StyledColumnState';
3
+ export declare const StyledColumnRangeBarPreview: React.FunctionComponent<React.PropsWithChildren<{
4
+ data: StyledColumn;
5
+ }>>;
6
+ export declare const StyledColumnRangeBarPreviewCard: React.FunctionComponent<React.PropsWithChildren<{
7
+ data: StyledColumn;
8
+ }>>;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StyledColumnRangeBarPreviewCard = exports.StyledColumnRangeBarPreview = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const Flex_1 = require("../../../../../components/Flex");
6
+ const Card_1 = require("../../../../../components/Card");
7
+ const Tag_1 = require("../../../../../components/Tag");
8
+ const StyledColumnChartListPreviews_1 = require("./StyledColumnChartListPreviews");
9
+ const PREVIEW_CELL_CLASS = 'ab-RangeBarPreviewCell twa:inline-flex twa:items-center twa:min-w-[180px] twa:min-h-[36px] twa:px-2 twa:py-1 twa:rounded-standard twa:border twa:border-[color-mix(in_srgb,var(--ab-color-foreground)_15%,transparent)]';
10
+ const getRangeBarPreviewSample = (range) => {
11
+ let min = 0;
12
+ let max = 100;
13
+ if (typeof range.Min === 'number' && typeof range.Max === 'number') {
14
+ min = range.Min;
15
+ max = range.Max;
16
+ }
17
+ const span = max - min || 1;
18
+ // Matches the value-marker position (~72%) in `StyledColumnRangeBarListPreview`.
19
+ const sampleValue = min + span * 0.72;
20
+ const valueFraction = (sampleValue - min) / span;
21
+ return {
22
+ sampleValue,
23
+ valueFraction: Math.max(0, Math.min(1, valueFraction)),
24
+ };
25
+ };
26
+ const formatRangeBarPreviewCellText = (sampleValue, valueFraction, range) => {
27
+ const parts = [];
28
+ if (range.CellText?.includes('CellValue')) {
29
+ parts.push(Number.isInteger(sampleValue) ? String(sampleValue) : sampleValue.toFixed(1));
30
+ }
31
+ if (range.CellText?.includes('PercentageValue')) {
32
+ parts.push(`${(valueFraction * 100).toFixed(0)}%`);
33
+ }
34
+ return parts.join(' ');
35
+ };
36
+ const RangeBarPreviewContent = ({ range }) => {
37
+ const { sampleValue, valueFraction } = getRangeBarPreviewSample(range);
38
+ const cellText = formatRangeBarPreviewCellText(sampleValue, valueFraction, range);
39
+ const hasCellText = Boolean(range.CellText?.length && cellText);
40
+ const textPosition = range.CellTextPosition ?? 'Below';
41
+ const isVertical = range.Orientation === 'Vertical';
42
+ const chartEl = (0, jsx_runtime_1.jsx)(StyledColumnChartListPreviews_1.StyledColumnRangeBarListPreview, { range: range });
43
+ const textEl = hasCellText ? ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "ab-RangeBar__text twa:text-2 twa:leading-tight twa:truncate twa:max-w-full", children: cellText })) : null;
44
+ if (hasCellText && textPosition === 'Merged') {
45
+ return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "ab-RangeBar__wrapper twa:relative twa:inline-flex", children: [chartEl, (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "ab-RangeBar__text twa:absolute twa:inset-x-0 twa:top-1/2 twa:-translate-y-1/2 twa:px-1 twa:text-2 twa:truncate twa:pointer-events-none", children: cellText })] }));
46
+ }
47
+ return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { className: "ab-RangeBar__wrapper", flexDirection: "column", alignItems: isVertical ? 'center' : 'stretch', style: { justifyContent: 'center', gap: hasCellText ? 2 : 0 }, children: [hasCellText && textPosition === 'Above' && textEl, chartEl, hasCellText && textPosition === 'Below' && textEl] }));
48
+ };
49
+ const StyledColumnRangeBarPreview = ({ data }) => {
50
+ const range = data.RangeBarStyle;
51
+ if (!range) {
52
+ return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "No Range Bar Style" });
53
+ }
54
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: PREVIEW_CELL_CLASS, children: (0, jsx_runtime_1.jsx)(RangeBarPreviewContent, { range: range }) }));
55
+ };
56
+ exports.StyledColumnRangeBarPreview = StyledColumnRangeBarPreview;
57
+ const StyledColumnRangeBarPreviewCard = ({ data }) => ((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: "Preview" }) }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:p-1", children: (0, jsx_runtime_1.jsx)(exports.StyledColumnRangeBarPreview, { data: data }) })] }));
58
+ exports.StyledColumnRangeBarPreviewCard = StyledColumnRangeBarPreviewCard;
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ import type { CellBoxStyle } from '../../../../../AdaptableState/Common/AdaptableStyle';
3
+ import { RatingIconShape, RatingStyle, StyledColumn } from '../../../../../AdaptableState/StyledColumnState';
4
+ export declare const DEFAULT_RATING_MAX = 5;
5
+ export declare const DEFAULT_RATING_SIZE = 14;
6
+ export declare const DEFAULT_RATING_GAP = 2;
7
+ export declare const DEFAULT_RATING_ICON: RatingIconShape;
8
+ export declare function getRatingCellChromeCss(cell: CellBoxStyle | undefined): React.CSSProperties;
9
+ export declare const RatingPreview: React.FC<{
10
+ rating: RatingStyle;
11
+ value?: number;
12
+ }>;
13
+ export declare const StyledColumnRatingPreview: React.FunctionComponent<React.PropsWithChildren<{
14
+ data: StyledColumn;
15
+ }>>;
16
+ export declare const StyledColumnRatingPreviewCard: React.FunctionComponent<React.PropsWithChildren<{
17
+ data: StyledColumn;
18
+ }>>;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StyledColumnRatingPreviewCard = exports.StyledColumnRatingPreview = exports.RatingPreview = exports.DEFAULT_RATING_ICON = exports.DEFAULT_RATING_GAP = exports.DEFAULT_RATING_SIZE = exports.DEFAULT_RATING_MAX = void 0;
4
+ exports.getRatingCellChromeCss = getRatingCellChromeCss;
5
+ const tslib_1 = require("tslib");
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const React = tslib_1.__importStar(require("react"));
8
+ const Flex_1 = require("../../../../../components/Flex");
9
+ const Card_1 = require("../../../../../components/Card");
10
+ const Tag_1 = require("../../../../../components/Tag");
11
+ const StyleHelper_1 = require("../../../../../Utilities/Helpers/StyleHelper");
12
+ exports.DEFAULT_RATING_MAX = 5;
13
+ exports.DEFAULT_RATING_SIZE = 14;
14
+ exports.DEFAULT_RATING_GAP = 2;
15
+ exports.DEFAULT_RATING_ICON = 'Star';
16
+ const DEFAULT_FILLED_COLOR = 'var(--ab-color-warn, #f5a623)';
17
+ const DEFAULT_EMPTY_COLOR = 'color-mix(in srgb, currentColor 22%, transparent)';
18
+ const PREVIEW_CELL_CLASS = 'ab-RatingPreviewCell twa:inline-flex twa:items-center twa:min-w-[140px] twa:min-h-[32px] twa:px-2 twa:py-1 twa:rounded-standard twa:border twa:border-[color-mix(in_srgb,var(--ab-color-foreground)_15%,transparent)]';
19
+ const ICON_PATHS = {
20
+ Star: 'M12 2 L14.9 8.6 L22 9.3 L16.7 14.1 L18.2 21 L12 17.4 L5.8 21 L7.3 14.1 L2 9.3 L9.1 8.6 Z',
21
+ Heart: 'M12 21 C 12 21 3 14.5 3 8.5 C 3 5.5 5.5 3 8.5 3 C 10.3 3 11.7 4 12 5.2 C 12.3 4 13.7 3 15.5 3 C 18.5 3 21 5.5 21 8.5 C 21 14.5 12 21 12 21 Z',
22
+ Circle: 'M12 4 a8 8 0 1 0 0.0001 0 Z',
23
+ Thumb: 'M2 11 h4 v10 h-4 z M7 11 l4 -8 c.5 -1 2 -1 2 0 l-1 5 h6 c1 0 2 1 1.7 2 l-2 8 c-.3 1 -1 1.6 -2 1.6 H7 z',
24
+ };
25
+ const clamp = (n, lo, hi) => Math.max(lo, Math.min(hi, n));
26
+ function getRatingCellChromeCss(cell) {
27
+ if (!cell || !(0, StyleHelper_1.hasCellBoxStyle)(cell)) {
28
+ return {};
29
+ }
30
+ return (0, StyleHelper_1.convertAdaptableStyleToCSS)(cell);
31
+ }
32
+ const RatingPreview = ({ rating, value, }) => {
33
+ const instanceId = React.useId();
34
+ const max = rating.Max ?? exports.DEFAULT_RATING_MAX;
35
+ const size = rating.Size ?? exports.DEFAULT_RATING_SIZE;
36
+ const gap = rating.Gap ?? exports.DEFAULT_RATING_GAP;
37
+ const icon = rating.Icon ?? exports.DEFAULT_RATING_ICON;
38
+ const filledColor = rating.FilledColor ?? DEFAULT_FILLED_COLOR;
39
+ const emptyColor = rating.EmptyColor ?? DEFAULT_EMPTY_COLOR;
40
+ const allowHalf = rating.AllowHalf ?? true;
41
+ const previewValue = value ?? Math.max(1, Math.min(max, max * 0.7));
42
+ const effective = allowHalf ? previewValue : Math.round(previewValue);
43
+ const d = ICON_PATHS[icon];
44
+ return ((0, jsx_runtime_1.jsxs)("span", { style: {
45
+ display: 'inline-flex',
46
+ alignItems: 'center',
47
+ gap: `${gap}px`,
48
+ lineHeight: 1,
49
+ }, "aria-hidden": "true", children: [Array.from({ length: max }).map((_, i) => {
50
+ const fill = clamp(effective - i, 0, 1);
51
+ const clipId = `ab-rating-preview-clip-${instanceId}-${i}`;
52
+ return ((0, jsx_runtime_1.jsxs)("svg", { width: size, height: size, viewBox: "0 0 24 24", children: [(0, jsx_runtime_1.jsx)("path", { d: d, fill: emptyColor }), fill > 0 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: clipId, children: (0, jsx_runtime_1.jsx)("rect", { x: 0, y: 0, width: 24 * fill, height: 24 }) }) }), (0, jsx_runtime_1.jsx)("path", { d: d, fill: filledColor, clipPath: `url(#${clipId})` })] }))] }, i));
53
+ }), rating.ShowValue && ((0, jsx_runtime_1.jsx)("span", { style: { marginLeft: 6, fontVariantNumeric: 'tabular-nums' }, children: previewValue }))] }));
54
+ };
55
+ exports.RatingPreview = RatingPreview;
56
+ const StyledColumnRatingPreview = ({ data }) => {
57
+ const rating = data.RatingStyle;
58
+ if (!rating) {
59
+ return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "No Rating Style" });
60
+ }
61
+ const previewCellChrome = getRatingCellChromeCss(rating.Cell);
62
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: PREVIEW_CELL_CLASS, style: previewCellChrome, children: (0, jsx_runtime_1.jsx)(exports.RatingPreview, { rating: rating }) }));
63
+ };
64
+ exports.StyledColumnRatingPreview = StyledColumnRatingPreview;
65
+ const StyledColumnRatingPreviewCard = ({ data }) => ((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: "Preview" }) }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:p-1", children: (0, jsx_runtime_1.jsx)(exports.StyledColumnRatingPreview, { data: data }) })] }));
66
+ exports.StyledColumnRatingPreviewCard = StyledColumnRatingPreviewCard;
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import type { CellBoxStyle } from '../../../../../AdaptableState/Common/AdaptableStyle';
3
+ import { StyledColumn } from '../../../../../AdaptableState/StyledColumnState';
4
+ export declare function getSparklineCellChromeCss(cell: CellBoxStyle | undefined): React.CSSProperties;
5
+ export declare const StyledColumnSparklinePreview: React.FunctionComponent<React.PropsWithChildren<{
6
+ data: StyledColumn;
7
+ }>>;
8
+ export declare const StyledColumnSparklinePreviewCard: React.FunctionComponent<React.PropsWithChildren<{
9
+ data: StyledColumn;
10
+ }>>;
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StyledColumnSparklinePreviewCard = exports.StyledColumnSparklinePreview = void 0;
4
+ exports.getSparklineCellChromeCss = getSparklineCellChromeCss;
5
+ const tslib_1 = require("tslib");
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const React = tslib_1.__importStar(require("react"));
8
+ const ag_charts_enterprise_1 = require("ag-charts-enterprise");
9
+ const AdaptableHelper_1 = require("../../../../../Utilities/Helpers/AdaptableHelper");
10
+ const SparklineOptionsHelper_1 = require("../../../../../Utilities/Helpers/SparklineOptionsHelper");
11
+ const StyleHelper_1 = require("../../../../../Utilities/Helpers/StyleHelper");
12
+ const Flex_1 = require("../../../../../components/Flex");
13
+ const Card_1 = require("../../../../../components/Card");
14
+ const Tag_1 = require("../../../../../components/Tag");
15
+ const AdaptableContext_1 = require("../../../../AdaptableContext");
16
+ const FALLBACK_NUMBER_ARRAY = [12, 18, 9, 22, 15, 28, 19, 24, 17, 21];
17
+ const PREVIEW_HEIGHT = 36;
18
+ const PREVIEW_CELL_CLASS = 'ab-SparklinePreviewCell twa:block twa:min-w-[200px] twa:min-h-[36px] twa:px-2 twa:py-1 twa:rounded-standard twa:border twa:border-[color-mix(in_srgb,var(--ab-color-foreground)_15%,transparent)]';
19
+ function getSparklineCellChromeCss(cell) {
20
+ if (!cell || !(0, StyleHelper_1.hasCellBoxStyle)(cell)) {
21
+ return {};
22
+ }
23
+ return (0, StyleHelper_1.convertAdaptableStyleToCSS)(cell);
24
+ }
25
+ const resolveSparklinePreviewData = (columnId, getColumnWithColumnId, getRowNodeForIndex) => {
26
+ if (!columnId) {
27
+ return FALLBACK_NUMBER_ARRAY;
28
+ }
29
+ const column = getColumnWithColumnId(columnId);
30
+ if (!column) {
31
+ return FALLBACK_NUMBER_ARRAY;
32
+ }
33
+ for (let row = 0; row < 20; row++) {
34
+ const rowNode = getRowNodeForIndex(row);
35
+ const cellData = rowNode?.data?.[column.field];
36
+ if (Array.isArray(cellData) && cellData.length > 0) {
37
+ return cellData;
38
+ }
39
+ }
40
+ return FALLBACK_NUMBER_ARRAY;
41
+ };
42
+ const buildSparklinePreviewOptions = (sparklineStyle, container, data, width, height) => {
43
+ const persisted = sparklineStyle.options ?? { type: 'line' };
44
+ const sanitized = AdaptableHelper_1.AdaptableHelper.removeAdaptableObjectPrimitives({
45
+ ...persisted,
46
+ });
47
+ const options = (0, SparklineOptionsHelper_1.resolveSparklineOptionsForRender)({
48
+ ...sanitized,
49
+ type: sanitized.type ?? 'line',
50
+ container,
51
+ width,
52
+ height,
53
+ data: data,
54
+ });
55
+ // Custom tooltip renderers expect AG Grid row context — use the default tooltip in preview.
56
+ if (options.tooltip?.renderer) {
57
+ const { renderer: _renderer, ...tooltipRest } = options.tooltip;
58
+ options.tooltip = tooltipRest;
59
+ }
60
+ return options;
61
+ };
62
+ /**
63
+ * AG Grid registers chart modules via `AgChartsEnterpriseModule.setup()` when
64
+ * sparklines are enabled. Standalone `AgCharts.createSparkline` needs the same
65
+ * setup — otherwise the settings-panel preview throws "No modules registered".
66
+ */
67
+ let agChartsPreviewModulesReady = false;
68
+ const ensureAgChartsEnterpriseModules = () => {
69
+ if (agChartsPreviewModulesReady) {
70
+ return;
71
+ }
72
+ ag_charts_enterprise_1.AgChartsEnterpriseModule.setup();
73
+ agChartsPreviewModulesReady = true;
74
+ };
75
+ const createSparkline = (options) => {
76
+ ensureAgChartsEnterpriseModules();
77
+ return ag_charts_enterprise_1.AgChartsEnterpriseModule.createSparkline(options);
78
+ };
79
+ const SparklinePreviewCanvas = ({ sparklineStyle, columnId }) => {
80
+ const adaptable = (0, AdaptableContext_1.useAdaptable)();
81
+ const containerRef = React.useRef(null);
82
+ const instanceRef = React.useRef(null);
83
+ const [previewError, setPreviewError] = React.useState(null);
84
+ const canDisplay = adaptable.api.styledColumnApi.canDisplaySparklines();
85
+ const optionsKey = JSON.stringify(sparklineStyle.options ?? {});
86
+ React.useEffect(() => {
87
+ return () => {
88
+ instanceRef.current?.destroy();
89
+ instanceRef.current = null;
90
+ };
91
+ }, []);
92
+ React.useEffect(() => {
93
+ const container = containerRef.current;
94
+ if (!container || !canDisplay) {
95
+ return;
96
+ }
97
+ const data = resolveSparklinePreviewData(columnId, (id) => adaptable.api.columnApi.getColumnWithColumnId(id), (index) => adaptable.api.gridApi.getRowNodeForIndex(index));
98
+ const width = Math.max(container.clientWidth, 200);
99
+ const options = buildSparklinePreviewOptions(sparklineStyle, container, data, width, PREVIEW_HEIGHT);
100
+ try {
101
+ if (!instanceRef.current) {
102
+ instanceRef.current = createSparkline(options);
103
+ }
104
+ else {
105
+ instanceRef.current.update(options);
106
+ }
107
+ setPreviewError(null);
108
+ }
109
+ catch (error) {
110
+ instanceRef.current?.destroy();
111
+ instanceRef.current = null;
112
+ setPreviewError(error instanceof Error ? error.message : 'Unable to render sparkline preview');
113
+ }
114
+ }, [sparklineStyle, columnId, canDisplay, adaptable.api, optionsKey]);
115
+ if (!canDisplay) {
116
+ return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "Sparklines module not registered" });
117
+ }
118
+ if (previewError) {
119
+ return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: previewError });
120
+ }
121
+ return ((0, jsx_runtime_1.jsx)("div", { ref: containerRef, className: "ab-SparklinePreviewCanvas", style: { width: '100%', height: PREVIEW_HEIGHT } }));
122
+ };
123
+ const StyledColumnSparklinePreview = ({ data }) => {
124
+ const sparklineStyle = data.SparklineStyle;
125
+ if (!sparklineStyle) {
126
+ return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "No Sparkline Style" });
127
+ }
128
+ const previewCellChrome = getSparklineCellChromeCss(sparklineStyle.Cell);
129
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: PREVIEW_CELL_CLASS, style: previewCellChrome, children: (0, jsx_runtime_1.jsx)(SparklinePreviewCanvas, { sparklineStyle: sparklineStyle, columnId: data.ColumnId }) }));
130
+ };
131
+ exports.StyledColumnSparklinePreview = StyledColumnSparklinePreview;
132
+ const StyledColumnSparklinePreviewCard = ({ 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: "Preview" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[500px]", children: "Sample sparkline using first non-empty cell in Column (or demo data when unavailable)" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:p-1", children: (0, jsx_runtime_1.jsx)(exports.StyledColumnSparklinePreview, { data: data }) })] }));
133
+ exports.StyledColumnSparklinePreviewCard = StyledColumnSparklinePreviewCard;
@@ -49,19 +49,24 @@ const renderStyledColumnRangesSummary = (data, api) => {
49
49
  exports.renderStyledColumnRangesSummary = renderStyledColumnRangesSummary;
50
50
  const StyledColumnWizardRangesSection = (props) => {
51
51
  const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
52
- const minMaxRangeValues = React.useMemo(() => {
52
+ const column = React.useMemo(() => {
53
53
  const columnId = data.ColumnId;
54
54
  if (!columnId) {
55
+ return undefined;
56
+ }
57
+ return api.columnApi.getColumnWithColumnId(columnId);
58
+ }, [data.ColumnId, api]);
59
+ const minMaxRangeValues = React.useMemo(() => {
60
+ if (!column) {
55
61
  return null;
56
62
  }
57
- const column = api.columnApi.getColumnWithColumnId(columnId);
58
63
  return {
59
64
  min: api.styledColumnApi.internalApi.getMinValueForNumericColumn(column),
60
65
  max: api.styledColumnApi.internalApi.getMaxValueForNumericColumn(column),
61
66
  };
62
- }, [data]);
67
+ }, [column, api]);
63
68
  const scope = { ColumnIds: [data.ColumnId] };
64
- const disabled = !data.ColumnId;
69
+ const disabled = !data.ColumnId || !column;
65
70
  // Gradient updates
66
71
  const onUpdateGradientStyleRanges = (ranges) => {
67
72
  const gradientStyle = {
@@ -154,6 +159,8 @@ const StyledColumnWizardRangesSection = (props) => {
154
159
  }
155
160
  props.onChange(newStyledColumn);
156
161
  }, [data]);
157
- return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { children: [data?.GradientStyle && ((0, jsx_runtime_1.jsx)(RangesComponent_1.RangesComponent, { disabled: disabled, minMaxRangeValues: minMaxRangeValues, api: api, scope: scope, showZeroCentredTab: true, showRangeDirection: true, zeroCentred: data.GradientStyle.ZeroCentred, onApplyZeroCentred: onApplyGradientZeroCentred, ranges: data.GradientStyle.CellRanges ?? [], rangeValueType: data.GradientStyle?.RangeValueType, onRangeValueTypeChange: handleRangeValueTypeChange, columnComparison: data?.GradientStyle?.ColumnComparison, updateRanges: onUpdateGradientStyleRanges, updateColumnComparison: onUpdateGradientStyleColumnComparison })), data?.PercentBarStyle && ((0, jsx_runtime_1.jsx)(RangesComponent_1.RangesComponent, { disabled: disabled, minMaxRangeValues: minMaxRangeValues, api: api, scope: scope, ranges: data.PercentBarStyle?.CellRanges, rangeValueType: data.PercentBarStyle?.RangeValueType, onRangeValueTypeChange: handleRangeValueTypeChange, columnComparison: data?.PercentBarStyle?.ColumnComparison, updateRanges: onUpdatePercentBarStyleRanges, updateColumnComparison: onUpdatePercentBarStyleColumnComparison })), !data.ColumnId && ((0, jsx_runtime_1.jsx)(ErrorBox_1.default, { className: "twa:mt-2", children: "You need to select a column before defining Ranges." }))] }));
162
+ return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { children: [data?.GradientStyle && ((0, jsx_runtime_1.jsx)(RangesComponent_1.RangesComponent, { disabled: disabled, minMaxRangeValues: minMaxRangeValues, api: api, scope: scope, showZeroCentredTab: true, showRangeDirection: true, zeroCentred: data.GradientStyle.ZeroCentred, onApplyZeroCentred: onApplyGradientZeroCentred, ranges: data.GradientStyle.CellRanges ?? [], rangeValueType: data.GradientStyle?.RangeValueType, onRangeValueTypeChange: handleRangeValueTypeChange, columnComparison: data?.GradientStyle?.ColumnComparison, updateRanges: onUpdateGradientStyleRanges, updateColumnComparison: onUpdateGradientStyleColumnComparison })), data?.PercentBarStyle && ((0, jsx_runtime_1.jsx)(RangesComponent_1.RangesComponent, { disabled: disabled, minMaxRangeValues: minMaxRangeValues, api: api, scope: scope, ranges: data.PercentBarStyle?.CellRanges, rangeValueType: data.PercentBarStyle?.RangeValueType, onRangeValueTypeChange: handleRangeValueTypeChange, columnComparison: data?.PercentBarStyle?.ColumnComparison, updateRanges: onUpdatePercentBarStyleRanges, updateColumnComparison: onUpdatePercentBarStyleColumnComparison })), (!data.ColumnId || !column) && ((0, jsx_runtime_1.jsx)(ErrorBox_1.default, { className: "twa:mt-2", children: !data.ColumnId
163
+ ? 'You need to select a column before defining Ranges.'
164
+ : `Column "${data.ColumnId}" was not found in the grid.` }))] }));
158
165
  };
159
166
  exports.StyledColumnWizardRangesSection = StyledColumnWizardRangesSection;
@@ -2,13 +2,9 @@ import * as React from 'react';
2
2
  import { StyledColumn } from '../../../../AdaptableState/StyledColumnState';
3
3
  import { AdaptableApi } from '../../../../types';
4
4
  export { renderStyledColumnRangesSummary, StyledColumnWizardRangesSection, } from './StyledColumnWizardRangesSection';
5
+ export declare const getStyledColumnPercentBarStyleViewValues: (data: StyledColumn) => string[];
5
6
  /**
6
7
  * Compact summary of the *non-range* style properties of a Percent Bar.
7
- * (Gradient uses `renderStyledColumnGradientStyleSummary`.)
8
- *
9
- * Used by:
10
- * - the wizard's "Style" step `renderSummary`
11
- * - the Styled Column module's `toView` (read-only summary popup)
12
8
  */
13
9
  export declare const renderStyledColumnStyleSummary: (data: StyledColumn, _api?: AdaptableApi) => React.JSX.Element;
14
10
  export declare const renderFormatColumnStyleWizardSummary: (data: StyledColumn) => React.JSX.Element;