@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
@@ -13,6 +13,7 @@ const AdaptableIconSelector_1 = require("../../Components/AdaptableIconSelector"
13
13
  const Flex_1 = require("../../../components/Flex");
14
14
  const sentenceCase_1 = tslib_1.__importDefault(require("../../../Utilities/utils/sentenceCase"));
15
15
  const NewSelect_1 = require("../../../components/NewSelect");
16
+ const Card_1 = require("../../../components/Card");
16
17
  const TONE_OPTIONS = [
17
18
  {
18
19
  label: 'Tone: Use Alert Tone',
@@ -25,6 +26,14 @@ const TONE_OPTIONS = [
25
26
  };
26
27
  }),
27
28
  ];
29
+ const AlertButtonPreview = ({ button, messageType }) => {
30
+ const buttonStyle = button.ButtonStyle ?? {};
31
+ const variant = (buttonStyle.variant ?? 'raised');
32
+ const tone = (buttonStyle.tone ??
33
+ messageType.toLowerCase());
34
+ const icon = button.icon && 'name' in button.icon && button.icon.name ? button.icon : undefined;
35
+ return ((0, jsx_runtime_1.jsx)(SimpleButton_1.default, { variant: variant, tone: tone, icon: icon, className: "twa:cursor-default twa:pointer-events-none", tabIndex: -1, children: button.Label || 'Untitled' }));
36
+ };
28
37
  function renderTone(option) {
29
38
  return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(SimpleButton_1.default, { className: "twa:mr-2 twa:w-[10px] twa:h-[10px] twa:line-height-0 twa:rounded-[100%] twa:bg-current", tone: option.value, variant: "text" }), option.label] }));
30
39
  }
@@ -34,6 +43,7 @@ const AlertButtonsEditor = (props) => {
34
43
  props.onChange(newButtons);
35
44
  };
36
45
  const alertDefinition = adaptableAlert.alertDefinition;
46
+ const messageType = alertDefinition?.MessageType ?? 'Info';
37
47
  // const rowAddedAlert =
38
48
  // api.alertApi.internalApi.isAlertDefinitionForAddedRowChangeEvent(alertDefinition);
39
49
  const isRowRemovedAlert = api.alertApi.internalApi.isAlertDefinitionForRemovedRowChangeEvent(alertDefinition);
@@ -75,7 +85,7 @@ const AlertButtonsEditor = (props) => {
75
85
  buttonCommands.push(ch.name);
76
86
  });
77
87
  }
78
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", alignItems: "center", justifyContent: "space-between", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2 twa:mt-3 twa:mb-2", children: "Add Buttons to the Alert Notification, and set Actions to perform when the Button is clicked" }), (0, jsx_runtime_1.jsx)(SimpleButton_1.default, { icon: "plus", onClick: () => {
88
+ return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:mt-3", children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", alignItems: "center", justifyContent: "space-between", className: "twa:mb-3", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2 twa:max-w-[520px]", children: "Add buttons to the notification and set actions to perform when clicked" }), (0, jsx_runtime_1.jsx)(SimpleButton_1.default, { icon: "plus", onClick: () => {
79
89
  onChange([
80
90
  ...(AlertButtons || []),
81
91
  {
@@ -85,110 +95,111 @@ const AlertButtonsEditor = (props) => {
85
95
  },
86
96
  },
87
97
  ]);
88
- }, children: "Add" })] }), AlertButtons.map((button, index) => {
89
- let buttonStyle = button.ButtonStyle;
90
- let buttonLabel = button.Label;
91
- let btnCommands = [];
92
- if (button.Command && typeof button.Command === 'string') {
93
- btnCommands = [button.Command];
94
- }
95
- else if (button.Command && Array.isArray(button.Command)) {
96
- btnCommands = button.Command;
97
- }
98
- // filter out the adaptable standard commands
99
- const btnUserFunctions = btnCommands.filter((command) => !buttonCommands.includes(command));
100
- const setVariant = (variant) => {
101
- onChange(AlertButtons.map((btn, i) => {
102
- if (i === index) {
103
- const buttonStyle = { ...btn.ButtonStyle };
104
- buttonStyle.variant = variant;
105
- return {
106
- ...btn,
107
- ButtonStyle: buttonStyle,
108
- };
109
- }
110
- return btn;
111
- }));
112
- };
113
- const setTone = (tone) => {
114
- onChange(AlertButtons.map((btn, i) => {
115
- if (i === index) {
116
- const buttonStyle = { ...btn.ButtonStyle };
117
- if (tone == null) {
118
- delete buttonStyle.tone;
98
+ }, children: "Add" })] }), (0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-3", children: AlertButtons.map((button, index) => {
99
+ let buttonStyle = button.ButtonStyle;
100
+ let buttonLabel = button.Label;
101
+ let btnCommands = [];
102
+ if (button.Command && typeof button.Command === 'string') {
103
+ btnCommands = [button.Command];
104
+ }
105
+ else if (button.Command && Array.isArray(button.Command)) {
106
+ btnCommands = button.Command;
107
+ }
108
+ // filter out the adaptable standard commands
109
+ const btnUserFunctions = btnCommands.filter((command) => !buttonCommands.includes(command));
110
+ const setVariant = (variant) => {
111
+ onChange(AlertButtons.map((btn, i) => {
112
+ if (i === index) {
113
+ const buttonStyle = { ...btn.ButtonStyle };
114
+ buttonStyle.variant = variant;
115
+ return {
116
+ ...btn,
117
+ ButtonStyle: buttonStyle,
118
+ };
119
119
  }
120
- else {
121
- buttonStyle.tone = tone;
120
+ return btn;
121
+ }));
122
+ };
123
+ const setTone = (tone) => {
124
+ onChange(AlertButtons.map((btn, i) => {
125
+ if (i === index) {
126
+ const buttonStyle = { ...btn.ButtonStyle };
127
+ if (tone == null) {
128
+ delete buttonStyle.tone;
129
+ }
130
+ else {
131
+ buttonStyle.tone = tone;
132
+ }
133
+ return {
134
+ ...btn,
135
+ ButtonStyle: buttonStyle,
136
+ };
122
137
  }
123
- return {
124
- ...btn,
125
- ButtonStyle: buttonStyle,
126
- };
138
+ return btn;
139
+ }));
140
+ };
141
+ const handleCommandChange = (checked, commandName) => {
142
+ let commands = btnCommands;
143
+ if (!checked) {
144
+ // remove current Command
145
+ commands = commands.filter((a) => a !== commandName);
127
146
  }
128
- return btn;
129
- }));
130
- };
131
- const handleCommandChange = (checked, commandName) => {
132
- let commands = btnCommands;
133
- if (!checked) {
134
- // remove current Command
135
- commands = commands.filter((a) => a !== commandName);
136
- }
137
- else {
138
- commands = [...commands, commandName];
139
- }
140
- onChange(AlertButtons.map((btn, i) => {
141
- if (i === index) {
142
- return {
143
- ...btn,
144
- Command: commands.length ? commands : undefined,
145
- };
147
+ else {
148
+ commands = [...commands, commandName];
146
149
  }
147
- return btn;
148
- }));
149
- };
150
- let iconSelector = null;
151
- if (!button.icon || (button.icon && 'name' in button.icon)) {
152
- iconSelector = ((0, jsx_runtime_1.jsx)(AdaptableIconSelector_1.AdaptableIconSelector, { value: button.icon && 'name' in button.icon ? button?.icon?.name : '', onChange: (iconName) => {
153
- onChange(AlertButtons.map((btn) => {
154
- if (btn === button) {
155
- return {
156
- ...btn,
157
- icon: {
158
- name: iconName,
159
- },
160
- };
161
- }
162
- return btn;
163
- }));
164
- } }));
165
- }
166
- return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: `twa:ml-3 ${index ? 'twa:border-t twa:border-dashed twa:border-input-border' : ''}`, children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { className: "twa:mb-2 twa:pt-2", children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2 twa:whitespace-nowrap", children: "Button Text" }), children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", children: [(0, jsx_runtime_1.jsx)(Input_1.default, { value: buttonLabel, className: "twa:mr-2 twa:w-[80px]", onChange: (e) => {
167
- onChange(AlertButtons.map((btn, i) => {
168
- if (i === index) {
169
- return { ...btn, Label: e.target.value };
170
- }
171
- return btn;
172
- }));
173
- } }), (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { items: ['text', 'outlined', 'raised'].map((variant) => {
174
- return {
175
- label: StringExtensions_1.default.CapitaliseFirstLetter(variant),
176
- value: variant,
177
- };
178
- }), renderValue: (option) => `Variant: ${option.label}`, value: buttonStyle?.variant, onValueChange: (value) => {
179
- setVariant(value);
180
- } }), (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { className: "twa:ml-2", items: TONE_OPTIONS, onValueChange: (value) => {
181
- if (value === 'text') {
182
- setTone(null);
183
- return;
184
- }
185
- setTone(value);
186
- }, value: buttonStyle?.tone ?? 'text' }), (0, jsx_runtime_1.jsx)(SimpleButton_1.default, { icon: "close", tone: "error", disabled: AlertButtons.length <= 1, className: "twa:ml-1", variant: "text", tooltip: AlertButtons.length <= 1 ? 'Cannot remove last button' : 'Remove button', onClick: () => {
187
- onChange(AlertButtons.filter((btn) => btn !== button));
188
- } })] }) }), (0, jsx_runtime_1.jsxs)(FormLayout_1.FormRow, { label: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2", children: "Actions" }), children: [buttonCommands.map((commandName) => {
189
- return ((0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { className: "twa:mr-3", onChange: (checked) => handleCommandChange(checked, commandName), checked: button.Command === commandName ||
190
- (Array.isArray(button.Command) && button.Command.includes(commandName)), children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2", children: (0, sentenceCase_1.default)(commandName) }) }, commandName));
191
- }), btnUserFunctions.length ? ((0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { checked: true, disabled: true, children: (0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:text-2", children: ["User function", btnUserFunctions.length > 1 ? 's' : '', ":", ' ', btnUserFunctions.join(', ')] }) })) : null] }), iconSelector && ((0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2", children: "Icon" }), children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { children: iconSelector }) }))] }) }, index));
192
- })] }));
150
+ onChange(AlertButtons.map((btn, i) => {
151
+ if (i === index) {
152
+ return {
153
+ ...btn,
154
+ Command: commands.length ? commands : undefined,
155
+ };
156
+ }
157
+ return btn;
158
+ }));
159
+ };
160
+ let iconSelector = null;
161
+ if (!button.icon || (button.icon && 'name' in button.icon)) {
162
+ iconSelector = ((0, jsx_runtime_1.jsx)(AdaptableIconSelector_1.AdaptableIconSelector, { value: button.icon && 'name' in button.icon ? button?.icon?.name : '', onChange: (iconName) => {
163
+ onChange(AlertButtons.map((btn) => {
164
+ if (btn === button) {
165
+ return {
166
+ ...btn,
167
+ icon: {
168
+ name: iconName,
169
+ },
170
+ };
171
+ }
172
+ return btn;
173
+ }));
174
+ } }));
175
+ }
176
+ return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { className: "twa:justify-between twa:gap-3", children: [(0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:font-medium twa:shrink-0", children: ["Button ", index + 1] }), (0, jsx_runtime_1.jsx)(Flex_1.Flex, { justifyContent: "center", className: "twa:flex-1 twa:min-w-0", children: (0, jsx_runtime_1.jsx)(AlertButtonPreview, { button: button, messageType: messageType }) }), (0, jsx_runtime_1.jsx)(SimpleButton_1.default, { icon: "close", tone: "error", disabled: AlertButtons.length <= 1, variant: "text", tooltip: AlertButtons.length <= 1 ? 'Cannot remove last button' : 'Remove button', onClick: () => {
177
+ onChange(AlertButtons.filter((btn) => btn !== button));
178
+ } })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2", children: "Button Text" }), children: (0, jsx_runtime_1.jsx)(Input_1.default, { value: buttonLabel, className: "twa:max-w-[200px]", onChange: (e) => {
179
+ onChange(AlertButtons.map((btn, i) => {
180
+ if (i === index) {
181
+ return { ...btn, Label: e.target.value };
182
+ }
183
+ return btn;
184
+ }));
185
+ } }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2", children: "Style" }), children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", className: "twa:gap-2 twa:flex-wrap", children: [(0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { items: ['text', 'outlined', 'raised'].map((variant) => {
186
+ return {
187
+ label: StringExtensions_1.default.CapitaliseFirstLetter(variant),
188
+ value: variant,
189
+ };
190
+ }), renderValue: (option) => `Variant: ${option.label}`, value: buttonStyle?.variant, onValueChange: (value) => {
191
+ setVariant(value);
192
+ } }), (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { items: TONE_OPTIONS, onValueChange: (value) => {
193
+ if (value === 'text') {
194
+ setTone(null);
195
+ return;
196
+ }
197
+ setTone(value);
198
+ }, value: buttonStyle?.tone ?? 'text' })] }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2", children: "Actions" }), children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", className: "twa:gap-3 twa:flex-wrap", children: [buttonCommands.map((commandName) => {
199
+ return ((0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { onChange: (checked) => handleCommandChange(checked, commandName), checked: button.Command === commandName ||
200
+ (Array.isArray(button.Command) &&
201
+ button.Command.includes(commandName)), children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2", children: (0, sentenceCase_1.default)(commandName) }) }, commandName));
202
+ }), btnUserFunctions.length ? ((0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { checked: true, disabled: true, children: (0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:text-2", children: ["User function", btnUserFunctions.length > 1 ? 's' : '', ":", ' ', btnUserFunctions.join(', ')] }) })) : null] }) }), iconSelector && ((0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2", children: "Icon" }), children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { children: iconSelector }) }))] }) })] }, index));
203
+ }) })] }));
193
204
  };
194
205
  exports.AlertButtonsEditor = AlertButtonsEditor;
@@ -3,21 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AlertMessageWizardSection = exports.renderAlertMessageSummary = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
- const Tabs_1 = require("../../../components/Tabs");
7
6
  const Radio_1 = tslib_1.__importStar(require("../../../components/Radio"));
8
7
  const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
9
8
  const Tag_1 = require("../../../components/Tag");
10
- const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
11
9
  const getAlertType_1 = require("../Utilities/getAlertType");
12
10
  const ButtonInfo_1 = require("../../Components/Buttons/ButtonInfo");
13
11
  const DocumentationLinkConstants_1 = require("../../../Utilities/Constants/DocumentationLinkConstants");
14
12
  const Textarea_1 = tslib_1.__importDefault(require("../../../components/Textarea"));
15
13
  const HelpBlock_1 = tslib_1.__importDefault(require("../../../components/HelpBlock"));
16
14
  const Flex_1 = require("../../../components/Flex");
15
+ const Card_1 = require("../../../components/Card");
17
16
  const renderAlertMessageSummary = (alertType) => {
18
17
  const { data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
19
18
  if (alertType === getAlertType_1.AlertType.Scheduled) {
20
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(OnePageAdaptableWizard_1.SummaryText, { children: ["Message Type: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: data.MessageType })] }), (0, jsx_runtime_1.jsxs)(OnePageAdaptableWizard_1.SummaryText, { children: ["Header: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: data.MessageHeader || 'Not specified' })] }), (0, jsx_runtime_1.jsxs)(OnePageAdaptableWizard_1.SummaryText, { children: ["Message: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: data.MessageText || 'Not specified' })] })] }));
19
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(OnePageAdaptableWizard_1.SummaryText, { children: ["Message Type: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: data.MessageType })] }), (0, jsx_runtime_1.jsxs)(OnePageAdaptableWizard_1.SummaryText, { children: ["Header: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: data.MessageHeader || 'Not specified' })] }), (0, jsx_runtime_1.jsxs)(OnePageAdaptableWizard_1.SummaryText, { children: ["Body: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: data.MessageText || 'Not specified' })] })] }));
21
20
  }
22
21
  return ((0, jsx_runtime_1.jsxs)(OnePageAdaptableWizard_1.SummaryText, { children: ["Message Type: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: data.MessageType })] }));
23
22
  };
@@ -45,15 +44,15 @@ const AlertMessageWizardSection = (props) => {
45
44
  MessageHeader: value,
46
45
  });
47
46
  };
48
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { "data-name": "message-type", children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Tab, { children: "Message Type" }), (0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Content, { children: (0, jsx_runtime_1.jsxs)(Radio_1.RadioGroup, { value: messageType, name: "messageType", orientation: "horizontal", onRadioChange: (MessageType) => {
49
- props.onChange({
50
- ...data,
51
- MessageType,
52
- });
53
- }, children: [(0, jsx_runtime_1.jsx)(Radio_1.default, { className: "twa:ml-1", value: "Info", children: "Info" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { className: "twa:ml-4", value: "Success", children: "Success" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { className: "twa:ml-4", value: "Warning", children: "Warning" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { className: "twa:ml-4", value: "Error", children: "Error" })] }) })] }), (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { "data-name": "message-text", className: "twa:mt-2 twa:mb-3", autoFocus: false, children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Tab, { children: "Message Text" }), (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs.Content, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2 twa:mt-3 twa:mb-2", children: isScheduled
54
- ? 'Enter the header and message shown when this scheduled alert fires.'
55
- : 'Text to display as the Alert Message (leave blank to show automated Message based on Alert Type)' }), (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Header", children: (0, jsx_runtime_1.jsx)(Textarea_1.default, { className: "twa:min-w-[300px] twa:mt-2", rows: 3, placeholder: isScheduled ? 'Enter header (required)' : '(Use Default Header Message)', type: 'text', autoFocus: false, value: messageHeader,
56
- // placeholder="defaults to column name"
57
- onChange: (e) => onMessageHeaderChange(e) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Message", children: (0, jsx_runtime_1.jsx)(Textarea_1.default, { className: "twa:min-w-[300px] twa:mt-2", rows: 3, type: 'text', autoFocus: false, placeholder: isScheduled ? 'Enter message (required)' : undefined, value: messageText, onChange: (e) => onMessageTextChange(e) }) })] }), showDocumentationLinks && !isScheduled && ((0, jsx_runtime_1.jsxs)(HelpBlock_1.default, { "data-name": "alert-message-documentation", className: "twa:mt-3 twa:mb-2 twa:p-0 twa:text-3", children: [(0, jsx_runtime_1.jsx)(ButtonInfo_1.ButtonInfo, { className: "twa:mr-2", onClick: () => window.open(DocumentationLinkConstants_1.AlertMessageDocsLink, '_blank') }), "See how to create dynamic Alert Messages using placeholders"] }))] })] })] }));
47
+ return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { "data-name": "message-type", children: (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Message Type" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose how the Alert message is styled" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(Radio_1.RadioGroup, { value: messageType, name: "messageType", orientation: "horizontal", onRadioChange: (MessageType) => {
48
+ props.onChange({
49
+ ...data,
50
+ MessageType,
51
+ });
52
+ }, children: [(0, jsx_runtime_1.jsx)(Radio_1.default, { className: "twa:ml-1", value: "Info", children: "Info" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { className: "twa:ml-4", value: "Success", children: "Success" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { className: "twa:ml-4", value: "Warning", children: "Warning" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { className: "twa:ml-4", value: "Error", children: "Error" })] }) })] }) }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { "data-name": "message-header", children: (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Header" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: isScheduled
53
+ ? 'Enter the header shown when this scheduled alert fires'
54
+ : 'Optional header text (leave blank to use the default)' })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:p-1", children: (0, jsx_runtime_1.jsx)(Textarea_1.default, { className: "twa:min-w-[300px] twa:w-full twa:max-w-[500px]", rows: 3, placeholder: isScheduled ? 'Enter header (required)' : '(Use Default Header Message)', type: 'text', autoFocus: false, value: messageHeader, onChange: (e) => onMessageHeaderChange(e) }) })] }) }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { "data-name": "message-body", children: (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Body" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: isScheduled
55
+ ? 'Enter the message body shown when this scheduled alert fires'
56
+ : 'Alert message body (leave blank to show automated message based on Alert Type)' })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card.Body, { className: "twa:p-1", children: [(0, jsx_runtime_1.jsx)(Textarea_1.default, { className: "twa:min-w-[300px] twa:w-full twa:max-w-[500px]", rows: 3, type: 'text', autoFocus: false, placeholder: isScheduled ? 'Enter message (required)' : undefined, value: messageText, onChange: (e) => onMessageTextChange(e) }), showDocumentationLinks && !isScheduled && ((0, jsx_runtime_1.jsxs)(HelpBlock_1.default, { "data-name": "alert-message-documentation", className: "twa:mt-3 twa:p-0 twa:text-3", children: [(0, jsx_runtime_1.jsx)(ButtonInfo_1.ButtonInfo, { className: "twa:mr-2", onClick: () => window.open(DocumentationLinkConstants_1.AlertMessageDocsLink, '_blank') }), "See how to create dynamic Alert Messages using placeholders"] }))] })] }) })] }));
58
57
  };
59
58
  exports.AlertMessageWizardSection = AlertMessageWizardSection;
@@ -4,7 +4,6 @@ exports.AlertNotificationWizardSection = exports.AlertPreview = exports.renderAl
4
4
  const tslib_1 = require("tslib");
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const React = tslib_1.__importStar(require("react"));
7
- const Tabs_1 = require("../../../components/Tabs");
8
7
  const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
9
8
  const CheckBox_1 = require("../../../components/CheckBox");
10
9
  const AdaptablePopupAlert_1 = require("../../Components/Popups/AdaptablePopupAlert");
@@ -14,6 +13,7 @@ const ScheduledAlertHelper_1 = require("../../../Utilities/Helpers/ScheduledAler
14
13
  const alertFormHelper_1 = require("../../../Utilities/Helpers/alertFormHelper");
15
14
  const Flex_1 = require("../../../components/Flex");
16
15
  const clsx_1 = tslib_1.__importDefault(require("clsx"));
16
+ const Card_1 = require("../../../components/Card");
17
17
  const renderAlertNotificationSummary = () => {
18
18
  const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
19
19
  if (!data.AlertProperties?.DisplayNotification) {
@@ -88,58 +88,58 @@ const AlertNotificationWizardSection = (props) => {
88
88
  },
89
89
  });
90
90
  };
91
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { "data-name": "display-options", className: "twa:mt-2 twa:mb-3", autoFocus: false, children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Tab, { children: "Notification Options" }), (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs.Content, { children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", alignItems: "flex-start", className: isScheduled ? 'twa:gap-4' : undefined, children: [(0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { className: isScheduled ? 'twa:my-0' : undefined, checked: data.AlertProperties?.DisplayNotification, onChange: (DisplayNotification) => {
92
- if (isScheduled && scheduledData) {
93
- updateScheduledProperties({ DisplayNotification });
94
- return;
95
- }
96
- const ruleData = data;
97
- const newAlertDefinition = {
98
- ...ruleData,
99
- AlertProperties: {
100
- ...ruleData.AlertProperties,
101
- DisplayNotification,
102
- },
103
- };
104
- if (!DisplayNotification && typeof newAlertDefinition.AlertForm === 'object') {
105
- delete newAlertDefinition.AlertForm.Buttons;
106
- }
107
- if (DisplayNotification) {
108
- newAlertDefinition.AlertForm =
109
- newAlertDefinition.AlertForm ??
110
- api.alertApi.internalApi.getDefaultAlertNotificationForm();
111
- }
112
- if (DisplayNotification &&
113
- typeof newAlertDefinition.AlertForm === 'object' &&
114
- (!newAlertDefinition.AlertForm?.Buttons ||
115
- newAlertDefinition.AlertForm?.Buttons?.length === 0)) {
116
- newAlertDefinition.AlertForm.Buttons = [
117
- api.alertApi.internalApi.getDefaultButton(),
118
- ];
119
- }
120
- props.onChange(newAlertDefinition);
121
- }, children: isScheduled
122
- ? 'Display a Notification when the Schedule is triggered'
123
- : 'Display a Notification when Alert is triggered (with action buttons)' }), isScheduled && scheduledData && data.AlertProperties?.DisplayNotification ? ((0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { className: "twa:my-0", checked: includeSuspendButton, onChange: (IncludeSuspendButton) => {
124
- updateScheduledProperties({ IncludeSuspendButton });
125
- }, children: "Include Suspend button on notification" })) : null] }), data.AlertProperties?.DisplayNotification && !isScheduled
126
- ? (() => {
127
- const ruleData = data;
128
- const alertForm = ruleData.AlertForm;
129
- if (typeof alertForm === 'string') {
130
- return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2", children: "Alert buttons cannot be customized because form is dynamically driven" }));
131
- }
132
- return ((0, jsx_runtime_1.jsx)(AlertButtonsEditor_1.AlertButtonsEditor, { alertType: props.alertType, AlertButtons: alertForm?.Buttons, api: api, adaptableAlert: adaptableAlert, onChange: (buttons) => {
133
- props.onChange({
134
- ...ruleData,
135
- AlertForm: {
136
- ...(alertForm ?? { fields: [] }),
137
- Buttons: buttons,
138
- },
139
- });
140
- } }));
141
- })()
142
- : null] })] }), data.AlertProperties?.DisplayNotification ? ((0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { "data-name": "alert-preview", autoFocus: false, children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Tab, { children: "Alert Preview" }), (0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Content, { children: !isScheduled &&
143
- typeof data.AlertForm === 'string' ? ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2", children: "Preview not available because form is dynamically driven" })) : ((0, jsx_runtime_1.jsx)(exports.AlertPreview, { alertDefinition: data, api: api })) })] })) : null] }));
91
+ return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { "data-name": "display-options", children: (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Notification Options" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose whether to display a notification when the Alert fires" })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card.Body, { children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", alignItems: "flex-start", className: isScheduled ? 'twa:gap-4' : undefined, children: [(0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { className: isScheduled ? 'twa:my-0' : undefined, checked: data.AlertProperties?.DisplayNotification, onChange: (DisplayNotification) => {
92
+ if (isScheduled && scheduledData) {
93
+ updateScheduledProperties({ DisplayNotification });
94
+ return;
95
+ }
96
+ const ruleData = data;
97
+ const newAlertDefinition = {
98
+ ...ruleData,
99
+ AlertProperties: {
100
+ ...ruleData.AlertProperties,
101
+ DisplayNotification,
102
+ },
103
+ };
104
+ if (!DisplayNotification && typeof newAlertDefinition.AlertForm === 'object') {
105
+ delete newAlertDefinition.AlertForm.Buttons;
106
+ }
107
+ if (DisplayNotification) {
108
+ newAlertDefinition.AlertForm =
109
+ newAlertDefinition.AlertForm ??
110
+ api.alertApi.internalApi.getDefaultAlertNotificationForm();
111
+ }
112
+ if (DisplayNotification &&
113
+ typeof newAlertDefinition.AlertForm === 'object' &&
114
+ (!newAlertDefinition.AlertForm?.Buttons ||
115
+ newAlertDefinition.AlertForm?.Buttons?.length === 0)) {
116
+ newAlertDefinition.AlertForm.Buttons = [
117
+ api.alertApi.internalApi.getDefaultButton(),
118
+ ];
119
+ }
120
+ props.onChange(newAlertDefinition);
121
+ }, children: isScheduled
122
+ ? 'Display a Notification when the Schedule is triggered'
123
+ : 'Display a Notification when Alert is triggered (with action buttons)' }), isScheduled && scheduledData && data.AlertProperties?.DisplayNotification ? ((0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { className: "twa:my-0", checked: includeSuspendButton, onChange: (IncludeSuspendButton) => {
124
+ updateScheduledProperties({ IncludeSuspendButton });
125
+ }, children: "Include Suspend button on notification" })) : null] }), data.AlertProperties?.DisplayNotification && !isScheduled
126
+ ? (() => {
127
+ const ruleData = data;
128
+ const alertForm = ruleData.AlertForm;
129
+ if (typeof alertForm === 'string') {
130
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2 twa:mt-3", children: "Alert buttons cannot be customized because form is dynamically driven" }));
131
+ }
132
+ return ((0, jsx_runtime_1.jsx)(AlertButtonsEditor_1.AlertButtonsEditor, { alertType: props.alertType, AlertButtons: alertForm?.Buttons, api: api, adaptableAlert: adaptableAlert, onChange: (buttons) => {
133
+ props.onChange({
134
+ ...ruleData,
135
+ AlertForm: {
136
+ ...(alertForm ?? { fields: [] }),
137
+ Buttons: buttons,
138
+ },
139
+ });
140
+ } }));
141
+ })()
142
+ : null] })] }) }), data.AlertProperties?.DisplayNotification ? ((0, jsx_runtime_1.jsx)(Flex_1.Box, { "data-name": "alert-preview", children: (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Alert Preview" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Preview how the notification will appear when triggered" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: !isScheduled &&
143
+ typeof data.AlertForm === 'string' ? ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2", children: "Preview not available because form is dynamically driven" })) : ((0, jsx_runtime_1.jsx)(exports.AlertPreview, { alertDefinition: data, api: api })) })] }) })) : null] }));
144
144
  };
145
145
  exports.AlertNotificationWizardSection = AlertNotificationWizardSection;
@@ -8,10 +8,11 @@ const EntityRulesEditor_1 = require("../../Components/EntityRulesEditor");
8
8
  const Tag_1 = require("../../../components/Tag");
9
9
  const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
10
10
  const getAvailablePredicates_1 = require("../Utilities/getAvailablePredicates");
11
- const Tabs_1 = require("../../../components/Tabs");
12
11
  const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
13
- const GeneralConstants_1 = require("./../../../Utilities/Constants/GeneralConstants");
12
+ const Card_1 = require("../../../components/Card");
14
13
  const Flex_1 = require("../../../components/Flex");
14
+ const GeneralConstants_1 = require("./../../../Utilities/Constants/GeneralConstants");
15
+ const Flex_2 = require("../../../components/Flex");
15
16
  const getRuleStepDescription = (alertType) => {
16
17
  switch (alertType) {
17
18
  case 'DataChange':
@@ -56,7 +57,7 @@ const RowChangeEditor = (props) => {
56
57
  },
57
58
  });
58
59
  };
59
- return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:p-2", children: (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Tab, { children: "Row Change" }), (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs.Content, { children: [(0, jsx_runtime_1.jsx)(Radio_1.default, { onClick: () => handleRowAddedChange(), checked: expression?.includes(GeneralConstants_1.OBSERVABLE_EXPRESSION_ROW_ADDED), children: "Row Added" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { onClick: () => handleRowRemovedChange(), checked: expression?.includes(GeneralConstants_1.OBSERVABLE_EXPRESSION_ROW_REMOVED), children: "Row Removed" })] })] }) }));
60
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_2.Box, { className: "twa:font-medium", children: "Row Change" }), (0, jsx_runtime_1.jsx)(Flex_2.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose which type of Row Change will trigger the Alert" })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card.Body, { children: [(0, jsx_runtime_1.jsx)(Radio_1.default, { onClick: () => handleRowAddedChange(), checked: expression?.includes(GeneralConstants_1.OBSERVABLE_EXPRESSION_ROW_ADDED), children: "Row Added" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { onClick: () => handleRowRemovedChange(), checked: expression?.includes(GeneralConstants_1.OBSERVABLE_EXPRESSION_ROW_REMOVED), children: "Row Removed" })] })] }) }));
60
61
  };
61
62
  const AlertRulesWizardSection = (props) => {
62
63
  const { data: alertData, api, moduleInfo } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
@@ -33,6 +33,6 @@ const AlertScheduledWizardSection = (props) => {
33
33
  Schedule: scheduleData.Schedule,
34
34
  });
35
35
  };
36
- return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:p-3", children: (0, jsx_runtime_1.jsx)(ScheduleScheduleWizard_1.ScheduleBuilderWizard, { onChange: handleScheduleChange }) }));
36
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: (0, jsx_runtime_1.jsx)(ScheduleScheduleWizard_1.ScheduleBuilderWizard, { onChange: handleScheduleChange }) }));
37
37
  };
38
38
  exports.AlertScheduledWizardSection = AlertScheduledWizardSection;
@@ -19,42 +19,34 @@ const AlertScopeWizardSection = (props) => {
19
19
  disableDataTypes = false;
20
20
  disableColumns = false;
21
21
  }
22
- return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "column", className: "twa:p-2 twa:h-full", children: (0, jsx_runtime_1.jsx)(NewScopeComponent_1.NewScopeComponent, { disableColumns: disableColumns, disableDataTypes: disableDataTypes, descriptions: {
23
- rowScope: 'Changes in any Column in the row will trigger an Alert',
24
- columnScope: 'Changes in selected Columns will trigger an Alert',
25
- dataTypeScope: 'Changes in any Column which is of the selected Data Type(s) will trigger an Alert',
26
- }, scope: data.Scope, updateScope: (Scope) => {
27
- const newData = { ...data, Scope };
28
- if (newData.Rule.Predicates) {
29
- const validPredicateIds = new Set(api.alertApi.internalApi.getAlertPredicateDefsForScope(Scope).map((def) => def.id));
30
- newData.Rule = {
31
- Predicates: newData.Rule.Predicates.filter((p) => validPredicateIds.has(p.PredicateId)).filter((predicate) => {
32
- // if there are more than 1 column, then we must eliminate the IN/NotIn predicates
33
- // TODO: this should NOT be required, but the ColumnValueSelector does NOT support creatable values right now
34
- if ((0, ColumnScope_1.isScopeColumnIds)(Scope) && Scope.ColumnIds.length > 1) {
35
- return predicate.PredicateId !== 'In' && predicate.PredicateId !== 'NotIn';
36
- }
37
- return true;
38
- }),
39
- };
40
- }
41
- if (newData.Rule.ObservableExpression !== undefined &&
42
- !api.columnScopeApi.scopeIsAll(Scope)) {
43
- // if it had observable expression and the scope is changed to partial
44
- // we need to reset to not be an observable expression, as observable is not supported
45
- // for partial scope
46
- delete newData.Rule.ObservableExpression;
47
- newData.Rule.BooleanExpression = '';
48
- }
49
- if (newData.Rule.AggregatedBooleanExpression !== undefined &&
50
- !api.columnScopeApi.scopeIsAll(Scope)) {
51
- // if it had aggregation expression and the scope is changed to partial
52
- // we need to reset to not be an aggregation expression, as aggregation is not supported
53
- // for partial scope
54
- delete newData.Rule.AggregatedBooleanExpression;
55
- newData.Rule.BooleanExpression = '';
56
- }
57
- props.onChange(newData);
58
- } }) }));
22
+ return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:h-full", children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", alignItems: "center", className: "twa:p-2 twa:gap-3 twa:border-b twa:mb-2 twa:border-b-foreground/20", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-5 twa:font-medium", children: "Columns" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:max-w-[520px]", children: "Specify which columns should trigger the Alert" })] }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:flex-1 twa:min-h-0 twa:overflow-auto twa:p-2", children: (0, jsx_runtime_1.jsx)(NewScopeComponent_1.NewScopeComponent, { disableColumns: disableColumns, disableDataTypes: disableDataTypes, descriptions: {
23
+ rowScope: 'Changes in any Column in the row will trigger an Alert',
24
+ columnScope: 'Changes in selected Columns will trigger an Alert',
25
+ dataTypeScope: 'Changes in any Column which is of the selected Data Type(s) will trigger an Alert',
26
+ }, scope: data.Scope, updateScope: (Scope) => {
27
+ const newData = { ...data, Scope };
28
+ if (newData.Rule.Predicates) {
29
+ const validPredicateIds = new Set(api.alertApi.internalApi.getAlertPredicateDefsForScope(Scope).map((def) => def.id));
30
+ newData.Rule = {
31
+ Predicates: newData.Rule.Predicates.filter((p) => validPredicateIds.has(p.PredicateId)).filter((predicate) => {
32
+ if ((0, ColumnScope_1.isScopeColumnIds)(Scope) && Scope.ColumnIds.length > 1) {
33
+ return predicate.PredicateId !== 'In' && predicate.PredicateId !== 'NotIn';
34
+ }
35
+ return true;
36
+ }),
37
+ };
38
+ }
39
+ if (newData.Rule.ObservableExpression !== undefined &&
40
+ !api.columnScopeApi.scopeIsAll(Scope)) {
41
+ delete newData.Rule.ObservableExpression;
42
+ newData.Rule.BooleanExpression = '';
43
+ }
44
+ if (newData.Rule.AggregatedBooleanExpression !== undefined &&
45
+ !api.columnScopeApi.scopeIsAll(Scope)) {
46
+ delete newData.Rule.AggregatedBooleanExpression;
47
+ newData.Rule.BooleanExpression = '';
48
+ }
49
+ props.onChange(newData);
50
+ } }) })] }));
59
51
  };
60
52
  exports.AlertScopeWizardSection = AlertScopeWizardSection;