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

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 (332) hide show
  1. package/icons/sort-asc.svg +1 -1
  2. package/index.css +755 -256
  3. package/package.json +1 -1
  4. package/src/AdaptableOptions/DataSetOptions.d.ts +26 -2
  5. package/src/AdaptableOptions/DefaultAdaptableOptions.js +0 -1
  6. package/src/AdaptableOptions/SettingsPanelOptions.d.ts +42 -10
  7. package/src/AdaptableState/Common/AdaptableFormat.d.ts +7 -0
  8. package/src/AdaptableState/Common/AdaptableMessageType.d.ts +1 -1
  9. package/src/AdaptableState/Common/Enums.d.ts +1 -1
  10. package/src/AdaptableState/Common/Enums.js +1 -1
  11. package/src/AdaptableState/StyledColumnState.d.ts +2 -2
  12. package/src/Api/Internal/AlertInternalApi.js +1 -1
  13. package/src/Api/Internal/DataSetInternalApi.d.ts +3 -0
  14. package/src/Api/Internal/DataSetInternalApi.js +73 -13
  15. package/src/Redux/Store/AdaptableStore.js +6 -4
  16. package/src/Strategy/CalculatedColumnModule.js +1 -0
  17. package/src/Strategy/ColumnFilterModule.js +1 -0
  18. package/src/Strategy/FlashingCellModule.js +6 -2
  19. package/src/Strategy/FormatColumnModule.js +2 -2
  20. package/src/Strategy/FreeTextColumnModule.js +38 -28
  21. package/src/Strategy/Interface/IModule.d.ts +3 -1
  22. package/src/Strategy/LayoutModule.js +15 -66
  23. package/src/Strategy/StyledColumnModule.js +12 -29
  24. package/src/Strategy/Utilities/CustomSort/getCustomSortColumnViewItems.d.ts +1 -0
  25. package/src/Strategy/Utilities/CustomSort/getCustomSortColumnViewItems.js +1 -0
  26. package/src/Strategy/Utilities/Export/getExportColumnsViewItems.d.ts +2 -0
  27. package/src/Strategy/Utilities/Export/getExportColumnsViewItems.js +14 -0
  28. package/src/Strategy/Utilities/Export/getExportRowsViewItems.d.ts +1 -0
  29. package/src/Strategy/Utilities/Export/getExportRowsViewItems.js +3 -0
  30. package/src/Strategy/Utilities/Layout/aggregationSummaryHelpers.d.ts +11 -0
  31. package/src/Strategy/Utilities/Layout/aggregationSummaryHelpers.js +105 -0
  32. package/src/Strategy/Utilities/Layout/columnsSummaryHelpers.d.ts +48 -0
  33. package/src/Strategy/Utilities/Layout/columnsSummaryHelpers.js +166 -0
  34. package/src/Strategy/Utilities/Layout/getLayoutSortViewItems.d.ts +1 -0
  35. package/src/Strategy/Utilities/Layout/getLayoutSortViewItems.js +1 -0
  36. package/src/Strategy/Utilities/Layout/rowGroupSummaryHelpers.d.ts +26 -0
  37. package/src/Strategy/Utilities/Layout/rowGroupSummaryHelpers.js +85 -0
  38. package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +3 -5
  39. package/src/Utilities/Defaults/DefaultSettingsPanel.js +46 -41
  40. package/src/Utilities/Helpers/FormatHelper.js +3 -0
  41. package/src/Utilities/Helpers/ScheduleHelper.js +2 -0
  42. package/src/Utilities/Helpers/StyleHelper.d.ts +18 -0
  43. package/src/Utilities/Helpers/StyleHelper.js +27 -0
  44. package/src/Utilities/Helpers/StyledColumnGradientHelper.js +7 -5
  45. package/src/Utilities/Helpers/resolveSettingsPanelNavigation.d.ts +3 -0
  46. package/src/Utilities/Helpers/resolveSettingsPanelNavigation.js +15 -0
  47. package/src/Utilities/getScopeViewItems.js +2 -0
  48. package/src/Utilities/wizardSelection.d.ts +10 -0
  49. package/src/Utilities/wizardSelection.js +15 -0
  50. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.js +2 -2
  51. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.js +2 -2
  52. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +3 -3
  53. package/src/View/Alert/AlertViewPanel.js +2 -2
  54. package/src/View/Alert/Utilities/getAlertButtonStyle.js +7 -4
  55. package/src/View/Alert/Wizard/AlertBehaviourWizardSection.d.ts +0 -1
  56. package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +0 -4
  57. package/src/View/Alert/Wizard/AlertButtonsEditor.js +2 -1
  58. package/src/View/Alert/Wizard/AlertMessageWizardSection.d.ts +1 -1
  59. package/src/View/Alert/Wizard/AlertMessageWizardSection.js +1 -2
  60. package/src/View/Alert/Wizard/AlertNotificationWizardSection.d.ts +1 -1
  61. package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +3 -4
  62. package/src/View/Alert/Wizard/AlertScheduledWizardSection.d.ts +1 -1
  63. package/src/View/Alert/Wizard/AlertScheduledWizardSection.js +1 -2
  64. package/src/View/Alert/Wizard/AlertTypeWizardSection.d.ts +1 -1
  65. package/src/View/Alert/Wizard/AlertTypeWizardSection.js +31 -7
  66. package/src/View/Alert/Wizard/AlertWizard.js +4 -4
  67. package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.d.ts +2 -1
  68. package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +4 -14
  69. package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
  70. package/src/View/BulkUpdate/BulkUpdateViewPanel.js +4 -6
  71. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.d.ts +1 -1
  72. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -2
  73. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -1
  74. package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +30 -4
  75. package/src/View/CellSummary/CellSummaryViewPanel.js +4 -4
  76. package/src/View/Charting/ShowChartButton.js +8 -8
  77. package/src/View/ColumnInfo/ColumnInfo.js +21 -1
  78. package/src/View/Components/AdaptableObjectCollection/index.js +2 -2
  79. package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +1 -1
  80. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +4 -4
  81. package/src/View/Components/AdaptableObjectRow/index.js +2 -2
  82. package/src/View/Components/Buttons/ButtonBase/index.js +2 -3
  83. package/src/View/Components/Buttons/ButtonNew.d.ts +2 -0
  84. package/src/View/Components/Buttons/ButtonNew.js +1 -1
  85. package/src/View/Components/Buttons/EntityListActionButtons.js +3 -3
  86. package/src/View/Components/Buttons/SuspendToggleButton/SuspendToggleButton.js +2 -2
  87. package/src/View/Components/ColumnFilter/ColumnFilter.js +2 -3
  88. package/src/View/Components/ColumnFilter/components/ColumnFilterMenu.js +2 -2
  89. package/src/View/Components/ColumnSelector/index.d.ts +12 -0
  90. package/src/View/Components/ColumnSelector/index.js +30 -6
  91. package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicatesEditor.js +2 -2
  92. package/src/View/Components/ModuleValueSelector/index.js +2 -1
  93. package/src/View/Components/NewScopeComponent.js +4 -9
  94. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +5 -4
  95. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +4 -4
  96. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +1 -1
  97. package/src/View/Components/Popups/AdaptablePopup/Navigation.d.ts +3 -2
  98. package/src/View/Components/Popups/AdaptablePopup/Navigation.js +38 -28
  99. package/src/View/Components/Popups/AdaptablePopup/PopupPanel.js +3 -3
  100. package/src/View/Components/Popups/AdaptablePopup/TopBar.js +2 -2
  101. package/src/View/Components/Popups/AdaptablePopup/settingsPanelNavigationTypes.d.ts +11 -0
  102. package/src/View/Components/Popups/AdaptablePopup/settingsPanelNavigationTypes.js +1 -0
  103. package/src/View/Components/Popups/AdaptablePopup/useMenuItems.d.ts +3 -1
  104. package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +25 -27
  105. package/src/View/Components/PredicateEditor/PredicateEditor.js +1 -1
  106. package/src/View/Components/RangesComponent.d.ts +2 -4
  107. package/src/View/Components/RangesComponent.js +95 -66
  108. package/src/View/Components/ReorderDraggable/index.js +2 -2
  109. package/src/View/Components/Selectors/BulkUpdateValueSelector.d.ts +0 -2
  110. package/src/View/Components/Selectors/BulkUpdateValueSelector.js +3 -3
  111. package/src/View/Components/StyleComponent.js +32 -65
  112. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +10 -7
  113. package/src/View/Components/ToolPanel/ToolPanelPopup.d.ts +3 -13
  114. package/src/View/Components/ToolPanel/ToolPanelPopup.js +5 -81
  115. package/src/View/Components/ToolPanel/ToolPanelPopupSections.d.ts +17 -0
  116. package/src/View/Components/ToolPanel/ToolPanelPopupSections.js +76 -0
  117. package/src/View/Components/ValueSelector/index.d.ts +29 -0
  118. package/src/View/Components/ValueSelector/index.js +113 -30
  119. package/src/View/Components/wizardColumnListStyles.d.ts +10 -0
  120. package/src/View/Components/wizardColumnListStyles.js +10 -0
  121. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.d.ts +2 -1
  122. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +5 -7
  123. package/src/View/CustomSort/Wizard/CustomSortWizard.js +2 -2
  124. package/src/View/Dashboard/DashboardPopup.d.ts +1 -11
  125. package/src/View/Dashboard/DashboardPopup.js +3 -67
  126. package/src/View/Dashboard/DashboardPopupSections.d.ts +20 -0
  127. package/src/View/Dashboard/DashboardPopupSections.js +68 -0
  128. package/src/View/Dashboard/PinnedToolbarsSelector.js +2 -2
  129. package/src/View/DataChangeHistory/DataChangeHistoryPopup.d.ts +1 -6
  130. package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +8 -20
  131. package/src/View/DataChangeHistory/DataChangeHistoryTable.d.ts +8 -0
  132. package/src/View/DataChangeHistory/DataChangeHistoryTable.js +94 -0
  133. package/src/View/DataChangeHistory/buildActionColumnButton.d.ts +5 -3
  134. package/src/View/DataChangeHistory/buildActionColumnButton.js +30 -39
  135. package/src/View/DataChangeHistory/dataChangeHistoryHelpers.d.ts +15 -0
  136. package/src/View/DataChangeHistory/dataChangeHistoryHelpers.js +37 -0
  137. package/src/View/DataImport/DataImportWizard/DataImportWizard.js +1 -1
  138. package/src/View/DataImport/DataImportWizard/sections/ColumnsSection.js +32 -19
  139. package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +1 -1
  140. package/src/View/DataSet/DataSetViewPanel.d.ts +2 -2
  141. package/src/View/Export/ExportDestinationPicker.js +3 -3
  142. package/src/View/Export/ExportViewPanel.js +2 -2
  143. package/src/View/Export/Wizard/ReportColumnsWizardSection.d.ts +2 -1
  144. package/src/View/Export/Wizard/ReportColumnsWizardSection.js +4 -9
  145. package/src/View/Export/Wizard/ReportRowsWizardSection.d.ts +2 -1
  146. package/src/View/Export/Wizard/ReportRowsWizardSection.js +3 -6
  147. package/src/View/FlashingCell/FlashingCellStyle.d.ts +4 -2
  148. package/src/View/FlashingCell/FlashingCellStyle.js +4 -2
  149. package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.d.ts +2 -1
  150. package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +7 -11
  151. package/src/View/FlashingCell/Wizard/FlashingCellScopeSummary.d.ts +9 -0
  152. package/src/View/FlashingCell/Wizard/FlashingCellScopeSummary.js +5 -0
  153. package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.d.ts +1 -1
  154. package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +1 -0
  155. package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.d.ts +0 -5
  156. package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +1 -5
  157. package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +2 -3
  158. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +1 -1
  159. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +99 -42
  160. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +0 -1
  161. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +0 -4
  162. package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +56 -15
  163. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +1 -1
  164. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +2 -3
  165. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +5 -8
  166. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +8 -13
  167. package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.js +3 -2
  168. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -2
  169. package/src/View/GridFilter/GridFilterPopupUI/index.js +3 -2
  170. package/src/View/GridFilter/GridFilterViewPanel.js +5 -5
  171. package/src/View/GridInfo/GridInfoPopup/AdaptableObjectsSummary.js +2 -2
  172. package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +2 -2
  173. package/src/View/Layout/LayoutViewPanel.js +1 -1
  174. package/src/View/Layout/Wizard/LayoutWizard.js +24 -28
  175. package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +13 -1
  176. package/src/View/Layout/Wizard/sections/AggregationsSection.js +73 -33
  177. package/src/View/Layout/Wizard/sections/ColumnsSection.d.ts +4 -1
  178. package/src/View/Layout/Wizard/sections/ColumnsSection.js +155 -276
  179. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +4 -1
  180. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +148 -145
  181. package/src/View/Layout/Wizard/sections/PivotColumnsSection.d.ts +5 -2
  182. package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +24 -12
  183. package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.d.ts +4 -1
  184. package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +23 -12
  185. package/src/View/Layout/Wizard/sections/RowGroupingSection.d.ts +5 -2
  186. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +19 -12
  187. package/src/View/Layout/Wizard/sections/RowSelectionSection.js +8 -4
  188. package/src/View/Layout/Wizard/sections/RowSummarySection.js +11 -11
  189. package/src/View/Layout/Wizard/sections/SortSection.d.ts +12 -2
  190. package/src/View/Layout/Wizard/sections/SortSection.js +41 -17
  191. package/src/View/Layout/Wizard/sections/columnLayoutCards.d.ts +20 -0
  192. package/src/View/Layout/Wizard/sections/columnLayoutCards.js +159 -0
  193. package/src/View/Layout/Wizard/sections/columnLayoutHelpers.d.ts +30 -0
  194. package/src/View/Layout/Wizard/sections/columnLayoutHelpers.js +201 -0
  195. package/src/View/Layout/Wizard/sections/layoutWizardAccordionHelpers.d.ts +8 -0
  196. package/src/View/Layout/Wizard/sections/layoutWizardAccordionHelpers.js +63 -0
  197. package/src/View/Layout/Wizard/sections/layoutWizardColumns.d.ts +11 -0
  198. package/src/View/Layout/Wizard/sections/layoutWizardColumns.js +52 -0
  199. package/src/View/License/LicenseWatermark.js +1 -1
  200. package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.d.ts +1 -1
  201. package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -2
  202. package/src/View/Note/NoteEditor.js +2 -2
  203. package/src/View/QuickSearch/QuickSearchPopup.js +2 -3
  204. package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +1 -1
  205. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +1 -1
  206. package/src/View/SmartEdit/SmartEditPopup.js +2 -2
  207. package/src/View/SmartEdit/SmartEditViewPanel.js +2 -2
  208. package/src/View/StateManagement/StateManagementPopup.js +1 -1
  209. package/src/View/StateManagement/components/ExportDropdown.d.ts +2 -2
  210. package/src/View/StateManagement/components/ExportDropdown.js +12 -12
  211. package/src/View/StatusBar/StatusBarPanel.js +2 -2
  212. package/src/View/StatusBar/StatusBarPopup.js +33 -5
  213. package/src/View/StatusBar/statusBarPanelHelpers.d.ts +2 -0
  214. package/src/View/StatusBar/statusBarPanelHelpers.js +7 -0
  215. package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +2 -0
  216. package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +14 -11
  217. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.d.ts +2 -2
  218. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +137 -119
  219. package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +8 -14
  220. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +2 -1
  221. package/src/View/StyledColumn/Wizard/StyledColumnTypeThumbnail.d.ts +5 -0
  222. package/src/View/StyledColumn/Wizard/StyledColumnTypeThumbnail.js +50 -0
  223. package/src/View/StyledColumn/Wizard/StyledColumnWizard.d.ts +2 -0
  224. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +26 -5
  225. package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +8 -17
  226. package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +2 -1
  227. package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +46 -28
  228. package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +98 -43
  229. package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +2 -1
  230. package/src/View/StyledColumn/Wizard/StyledColumnWizardScopeSection.d.ts +1 -1
  231. package/src/View/StyledColumn/Wizard/StyledColumnWizardScopeSection.js +32 -46
  232. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +11 -6
  233. package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +94 -7
  234. package/src/View/UIHelper.d.ts +0 -2
  235. package/src/View/UIHelper.js +8 -23
  236. package/src/View/Wizard/CollapsibleWizardCard.d.ts +68 -0
  237. package/src/View/Wizard/CollapsibleWizardCard.js +81 -0
  238. package/src/View/Wizard/OnePageWizards.js +6 -6
  239. package/src/View/Wizard/SummaryColorTag.d.ts +24 -0
  240. package/src/View/Wizard/SummaryColorTag.js +67 -0
  241. package/src/View/Wizard/WizardTypeSelection.d.ts +34 -0
  242. package/src/View/Wizard/WizardTypeSelection.js +31 -0
  243. package/src/View/Wizard/rowGroupSummaryTags.d.ts +18 -0
  244. package/src/View/Wizard/rowGroupSummaryTags.js +14 -0
  245. package/src/View/Wizard/scopeSummaryTags.d.ts +6 -0
  246. package/src/View/Wizard/scopeSummaryTags.js +33 -0
  247. package/src/agGrid/AgGridAdapter.js +0 -5
  248. package/src/agGrid/AgGridColumnAdapter.js +2 -2
  249. package/src/agGrid/cellRenderers/ActionColumnRenderer.js +4 -7
  250. package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +1 -1
  251. package/src/components/Card/index.js +5 -6
  252. package/src/components/CheckBox/index.js +2 -3
  253. package/src/components/CodeBlock/index.js +2 -2
  254. package/src/components/ColorPicker/ColorPicker.d.ts +1 -0
  255. package/src/components/ColorPicker/ColorPicker.js +8 -6
  256. package/src/components/ColorPicker/OptionalColorPicker.d.ts +12 -0
  257. package/src/components/ColorPicker/OptionalColorPicker.js +26 -0
  258. package/src/components/ColorPicker/index.d.ts +1 -0
  259. package/src/components/ColorPicker/index.js +1 -0
  260. package/src/components/Combobox/comboboxUtils.d.ts +1 -0
  261. package/src/components/Combobox/index.js +19 -18
  262. package/src/components/Dashboard/DashboardManager.js +2 -4
  263. package/src/components/Dialog/index.js +4 -4
  264. package/src/components/DragAndDropContext/DragAndDropContext.d.ts +5 -0
  265. package/src/components/DragAndDropContext/DragAndDropContext.js +3 -0
  266. package/src/components/DragAndDropContext/ModuleManager.d.ts +15 -3
  267. package/src/components/DragAndDropContext/ModuleManager.js +47 -8
  268. package/src/components/DragAndDropContext/TabList.d.ts +11 -4
  269. package/src/components/DragAndDropContext/TabList.js +52 -38
  270. package/src/components/DragAndDropContext/UnusedPanel.d.ts +4 -3
  271. package/src/components/DragAndDropContext/UnusedPanel.js +15 -11
  272. package/src/components/DragAndDropContext/dragScope.d.ts +6 -0
  273. package/src/components/DragAndDropContext/dragScope.js +26 -0
  274. package/src/components/DragAndDropContext/types.d.ts +7 -0
  275. package/src/components/DropdownButton/index.d.ts +33 -25
  276. package/src/components/DropdownButton/index.js +24 -158
  277. package/src/components/EmptyContent/index.js +2 -2
  278. package/src/components/ErrorBox/index.js +2 -2
  279. package/src/components/ExpressionEditor/BaseEditorInput.js +3 -3
  280. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +3 -3
  281. package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +6 -6
  282. package/src/components/FieldWrap/index.js +2 -2
  283. package/src/components/Flex.js +2 -2
  284. package/src/components/FormLayout/index.d.ts +1 -1
  285. package/src/components/HelpBlock/index.js +3 -3
  286. package/src/components/IconSelector/IconSelector.d.ts +8 -0
  287. package/src/components/IconSelector/IconSelector.js +11 -7
  288. package/src/components/IconSelector/index.d.ts +1 -0
  289. package/src/components/IconSelector/index.js +1 -0
  290. package/src/components/Modal/index.js +2 -2
  291. package/src/components/NewSelect/index.js +11 -1
  292. package/src/components/Panel/index.js +7 -7
  293. package/src/components/Radio/index.d.ts +1 -1
  294. package/src/components/Radio/index.js +8 -6
  295. package/src/components/SimpleButton/index.js +7 -7
  296. package/src/components/StylePreview.js +2 -2
  297. package/src/components/Tabs/index.js +4 -4
  298. package/src/components/Tag/Tag.d.ts +16 -0
  299. package/src/components/Tag/Tag.js +14 -4
  300. package/src/components/Tag/columnScopeTagHelpers.d.ts +8 -0
  301. package/src/components/Tag/columnScopeTagHelpers.js +6 -0
  302. package/src/components/Tag/index.d.ts +1 -1
  303. package/src/components/Tag/index.js +1 -1
  304. package/src/components/Textarea/index.js +2 -3
  305. package/src/components/Toggle/Toggle.d.ts +2 -0
  306. package/src/components/Toggle/Toggle.js +14 -7
  307. package/src/components/Toggle/ToggleGroup.js +2 -2
  308. package/src/components/ToggleButton/index.js +4 -4
  309. package/src/components/Tree/TreeDropdown/index.js +3 -4
  310. package/src/components/WarningBox/index.js +2 -2
  311. package/src/components/icons/sort-asc.js +1 -1
  312. package/src/components/ui/button.d.ts +2 -2
  313. package/src/components/ui/combobox.d.ts +3 -1
  314. package/src/components/ui/combobox.js +2 -2
  315. package/src/components/ui/input-group.d.ts +1 -1
  316. package/src/components/ui/select.js +3 -2
  317. package/src/components/ui/textarea.js +1 -1
  318. package/src/env.js +2 -2
  319. package/src/layout-manager/src/index.js +7 -3
  320. package/src/metamodel/adaptable.metamodel.js +1 -1
  321. package/src/types.d.ts +1 -1
  322. package/tsconfig.esm.tsbuildinfo +1 -1
  323. package/src/View/DataChangeHistory/DataChangeHistoryGrid.d.ts +0 -17
  324. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +0 -290
  325. package/src/components/DropdownButton/DropdownButtonItem.d.ts +0 -12
  326. package/src/components/DropdownButton/DropdownButtonItem.js +0 -1
  327. package/src/components/DropdownButton/renderItem.d.ts +0 -14
  328. package/src/components/DropdownButton/renderItem.js +0 -11
  329. package/src/components/DropdownButton/useExpanded.d.ts +0 -24
  330. package/src/components/DropdownButton/useExpanded.js +0 -56
  331. package/src/components/NewDropdownButton/index.d.ts +0 -27
  332. package/src/components/NewDropdownButton/index.js +0 -24
@@ -1,26 +1,69 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
- import { CheckBox } from '../../../../components/CheckBox';
4
- import DropdownButton from '../../../../components/DropdownButton';
5
- import FormLayout, { FormRow } from '../../../../components/FormLayout';
6
3
  import { Card } from '../../../../components/Card';
7
- import { Tag } from '../../../../components/Tag';
8
- import { getAggFuncName, WEIGHTED_AVERAGE_AGG_FN_NAME, } from '../../../../AdaptableState/Common/AggregationColumns';
4
+ import { ColumnTag, Tag } from '../../../../components/Tag';
5
+ import { getAggFuncName, isWeightedAverageAggFuncName, WEIGHTED_AVERAGE_AGG_FN_NAME, } from '../../../../AdaptableState/Common/AggregationColumns';
9
6
  import { useAdaptable } from '../../../AdaptableContext';
10
7
  import { ValueSelector } from '../../../Components/ValueSelector';
11
8
  import { useOnePageAdaptableWizardContext } from '../../../Wizard/OnePageAdaptableWizard';
9
+ import { CollapsibleWizardCard, CollapsibleWizardValueSummary, getWizardAccordionSectionClassName, renderCompactColumnTags, useWizardCardAccordion, } from '../../../Wizard/CollapsibleWizardCard';
10
+ import { TypeRadio } from '../../../Wizard/TypeRadio';
11
+ import { getLayoutWizardInitialExpandedCardId, isPivotAggregationsSectionConfigured, } from './layoutWizardAccordionHelpers';
12
12
  import { columnFilter } from './Utilities';
13
13
  import { ColumnGroupTag } from '../../../Components/ColumnGroupTag';
14
14
  import ArrayExtensions from '../../../../Utilities/Extensions/ArrayExtensions';
15
- import StringExtensions from '../../../../Utilities/Extensions/StringExtensions';
16
15
  import { Box, Flex } from '../../../../components/Flex';
17
16
  import { SingleSelect } from '../../../../components/NewSelect';
17
+ import Radio, { RadioGroup } from '../../../../components/Radio';
18
+ import { LAYOUT_WIZARD_COLUMN_LIST_HEADER_CLASS, LAYOUT_WIZARD_COLUMN_LIST_OPTION_CLASS, LAYOUT_WIZARD_COLUMN_LIST_SEARCH_CLASS, } from './layoutWizardColumns';
19
+ import { getPivotAggregationSummaryValues } from '../../../../Strategy/Utilities/Layout/aggregationSummaryHelpers';
20
+ import { renderSummaryStringTags } from '../../../Wizard/SummaryColorTag';
21
+ import { getAggFuncSummaryLabel, getGrandTotalRowKey, getGrandTotalRowLabel, GRAND_TOTAL_ROW_DESCRIPTIONS, GRAND_TOTAL_ROW_LABELS, GRAND_TOTAL_ROW_OPTIONS, } from './AggregationsSection';
22
+ const PIVOT_LAYOUT_TOTAL_LABELS = {
23
+ off: 'None',
24
+ before: 'Before',
25
+ after: 'After',
26
+ };
27
+ const PIVOT_LAYOUT_TOTAL_DESCRIPTIONS = {
28
+ off: 'Pivot totals are not displayed in the grid',
29
+ before: 'Pivot totals are displayed before the value columns',
30
+ after: 'Pivot totals are displayed after the value columns',
31
+ };
32
+ const PIVOT_LAYOUT_TOTAL_OPTIONS = ['off', 'before', 'after'];
33
+ function getPivotLayoutTotalKey(value) {
34
+ if (value == null || value === false) {
35
+ return 'off';
36
+ }
37
+ if (value === 'before') {
38
+ return 'before';
39
+ }
40
+ if (value === 'after') {
41
+ return 'after';
42
+ }
43
+ return 'off';
44
+ }
45
+ function getPivotLayoutTotalLabel(value) {
46
+ return PIVOT_LAYOUT_TOTAL_LABELS[getPivotLayoutTotalKey(value)];
47
+ }
48
+ function getAggregationTotalSelectValue(total) {
49
+ if (!total) {
50
+ return 'off';
51
+ }
52
+ if (total === true || total === 'before') {
53
+ return 'before';
54
+ }
55
+ if (total === 'after') {
56
+ return 'after';
57
+ }
58
+ if (Array.isArray(total)) {
59
+ return 'pivot-specific';
60
+ }
61
+ return 'off';
62
+ }
18
63
  const PivotColumnRow = (props) => {
19
64
  const adaptable = useAdaptable();
20
65
  const aggValue = (props.layout.PivotAggregationColumns || []).find((x) => x.ColumnId === props.column.columnId)?.AggFunc;
21
- // Weighted Average is not supported in Pivot Layouts, so only the standard
22
- // AG Grid aggregation functions are offered here.
23
- const aggFunctionNames = props.column.availableAggregationFunctions || [];
66
+ const aggFunctionNames = (props.column.availableAggregationFunctions || []).filter((fnName) => !isWeightedAverageAggFuncName(fnName));
24
67
  const currentAggFnName = props.aggregationColumnsMap[props.column.columnId];
25
68
  const updateAggFunc = (fnName) => {
26
69
  let aggCols = [...(props.layout.PivotAggregationColumns || [])];
@@ -45,52 +88,39 @@ const PivotColumnRow = (props) => {
45
88
  }
46
89
  props.onChangeAggFunction(aggCols);
47
90
  };
48
- const totalOptions = ['Off', 'Before', 'After', 'Pivot Specific'].map((totalVariant) => {
49
- return {
50
- label: totalVariant,
51
- onClick: () => {
52
- let aggCols = props.layout.PivotAggregationColumns;
53
- if (!aggCols) {
54
- return;
91
+ const currentAggCol = props.layout.PivotAggregationColumns?.find((aggCol) => aggCol.ColumnId === props.column.columnId);
92
+ const currentTotalSelectValue = getAggregationTotalSelectValue(currentAggCol?.Total);
93
+ const handleTotalSelectChange = (totalVariant) => {
94
+ let aggCols = props.layout.PivotAggregationColumns;
95
+ if (!aggCols) {
96
+ return;
97
+ }
98
+ aggCols = aggCols.map((aggCol) => {
99
+ if (aggCol.ColumnId === props.column.columnId) {
100
+ let updatedTotal = false;
101
+ if (totalVariant === 'before') {
102
+ updatedTotal = 'before';
103
+ }
104
+ else if (totalVariant === 'after') {
105
+ updatedTotal = 'after';
55
106
  }
56
- aggCols = aggCols.map((aggCol) => {
57
- if (aggCol.ColumnId === props.column.columnId) {
58
- let updatedTotalColumn = false;
59
- if (totalVariant === 'Before') {
60
- updatedTotalColumn = 'before';
61
- }
62
- if (totalVariant === 'After') {
63
- updatedTotalColumn = 'after';
64
- }
65
- if (totalVariant === 'Pivot Specific') {
66
- updatedTotalColumn = props.layout.PivotColumns.map((pivotColId) => {
67
- return {
68
- PivotColumnId: pivotColId,
69
- ShowTotal: true,
70
- };
71
- });
72
- }
107
+ else if (totalVariant === 'pivot-specific') {
108
+ updatedTotal = props.layout.PivotColumns.map((pivotColId) => {
73
109
  return {
74
- ...aggCol,
75
- Total: updatedTotalColumn,
110
+ PivotColumnId: pivotColId,
111
+ ShowTotal: true,
76
112
  };
77
- }
78
- return aggCol;
79
- });
80
- props.onChangeAggFunction(aggCols);
81
- },
82
- };
83
- });
84
- const currentAggCol = props.layout.PivotAggregationColumns?.find((aggCol) => aggCol.ColumnId === props.column.columnId);
85
- const currentTotal = currentAggCol?.Total
86
- ? currentAggCol.Total === true || currentAggCol.Total === 'before'
87
- ? 'Before'
88
- : currentAggCol.Total === 'after'
89
- ? 'After'
90
- : Array.isArray(currentAggCol.Total)
91
- ? 'Pivot Specific'
92
- : 'Off'
93
- : 'Off';
113
+ });
114
+ }
115
+ return {
116
+ ...aggCol,
117
+ Total: updatedTotal,
118
+ };
119
+ }
120
+ return aggCol;
121
+ });
122
+ props.onChangeAggFunction(aggCols);
123
+ };
94
124
  const hasPivotSpecificTotals = Array.isArray(currentAggCol?.Total);
95
125
  const pivotSpecificTotals = Array.isArray(currentAggCol?.Total)
96
126
  ? currentAggCol.Total
@@ -98,7 +128,7 @@ const PivotColumnRow = (props) => {
98
128
  PivotColumnId: pivotColId,
99
129
  ShowTotal: false,
100
130
  }));
101
- const handleTotalChange = (pivotColId, value) => {
131
+ const handlePivotSpecificTotalChange = (pivotColId, value) => {
102
132
  const updatedAggCols = (props.layout.PivotAggregationColumns || []).map((aggCol) => {
103
133
  if (aggCol.ColumnId === props.column.columnId) {
104
134
  const updatedTotals = pivotSpecificTotals.map((total) => {
@@ -113,35 +143,38 @@ const PivotColumnRow = (props) => {
113
143
  });
114
144
  props.onChangeAggFunction(updatedAggCols);
115
145
  };
116
- const pivotTotalOptions = ['Off', 'Before', 'After'].map((option) => ({
117
- label: option,
118
- value: option === 'Off' ? false : option.toLowerCase(),
119
- }));
120
- return (_jsx(Box, { "data-name": props.column.columnId, className: "ab-Layout-Wizard__ColumnRow", children: _jsxs(Flex, { alignItems: "flex-start", children: [_jsxs(Flex, { className: "twa:flex-[0_0_auto]", alignItems: "center", children: [_jsx(Flex, { className: "twa:min-w-[80px]", children: props.column.friendlyName }), _jsx(ColumnGroupTag, { column: props.column }), aggValue && (_jsx(SingleSelect, { className: "twa:min-w-[140px] twa:ml-2", value: currentAggFnName, items: aggFunctionNames.map((fnName) => ({
121
- label: fnName,
122
- value: fnName,
123
- })), onValueChange: updateAggFunc })), aggValue && (_jsxs(Flex, { className: "twa:bg-primary twa:ml-3", alignItems: "center", children: [_jsx(Box, { children: "Total" }), ' ', _jsx(DropdownButton, { columns: ['label'], items: totalOptions, className: "twa:ml-2", children: currentTotal })] }))] }), hasPivotSpecificTotals && (_jsx(Flex, { className: "twa:ml-2 twa:pl-2 twa:flex-[1_1_auto] twa:min-w-[200px]", flexWrap: "wrap", alignItems: "center", style: {
124
- borderLeft: '1px solid var(--ab-color-primary-foreground)',
125
- rowGap: '8px',
126
- columnGap: '12px',
127
- }, children: props.layout.PivotColumns.map((pivotColId) => {
128
- const pivotTotalSetting = pivotSpecificTotals.find((t) => t.PivotColumnId === pivotColId);
129
- const currentValue = pivotTotalSetting == undefined
130
- ? 'Off'
131
- : pivotTotalSetting.ShowTotal === false
132
- ? 'Off'
133
- : pivotTotalSetting.ShowTotal === 'before' ||
134
- pivotTotalSetting.ShowTotal === true ||
135
- pivotTotalSetting.ShowTotal == undefined
136
- ? 'Before'
137
- : pivotTotalSetting.ShowTotal === 'after'
138
- ? 'After'
139
- : 'Off';
140
- return (_jsxs(Flex, { alignItems: "center", children: [_jsxs(Box, { className: "twa:mr-1", children: [adaptable.api.columnApi.getFriendlyNameForColumnId(pivotColId), ":"] }), _jsx(DropdownButton, { columns: ['label'], items: pivotTotalOptions.map((opt) => ({
141
- label: opt.label,
142
- onClick: () => handleTotalChange(pivotColId, opt.value),
143
- })), children: currentValue })] }, pivotColId));
144
- }) }))] }) }));
146
+ const getPivotSpecificTotalSelectValue = (showTotal) => {
147
+ if (showTotal === false || showTotal == undefined) {
148
+ return 'off';
149
+ }
150
+ if (showTotal === 'before' || showTotal === true) {
151
+ return 'before';
152
+ }
153
+ if (showTotal === 'after') {
154
+ return 'after';
155
+ }
156
+ return 'off';
157
+ };
158
+ return (_jsxs(Flex, { alignItems: "flex-start", flexDirection: "column", className: "twa:min-w-0 twa:gap-y-1 twa:gap-x-1.5", children: [_jsxs(Flex, { alignItems: "center", flexWrap: "wrap", className: "twa:min-w-0 twa:gap-x-1.5 twa:gap-y-0.5", children: [_jsx(Box, { className: "twa:truncate", children: props.column.friendlyName }), _jsx(ColumnGroupTag, { column: props.column }), aggValue && (_jsx(SingleSelect, { size: "small", stopMouseDownPropagation: true, className: "twa:min-w-[6.5rem] twa:shrink-0", value: currentAggFnName, items: aggFunctionNames.map((fnName) => ({
159
+ label: fnName,
160
+ value: fnName,
161
+ })), onValueChange: updateAggFunc })), aggValue && (_jsxs(Flex, { alignItems: "center", className: "twa:gap-1 twa:shrink-0", children: [_jsx(Box, { className: "twa:text-3", children: "Total" }), _jsx(SingleSelect, { size: "small", stopMouseDownPropagation: true, className: "twa:min-w-[6.5rem]", value: currentTotalSelectValue, items: [
162
+ { label: 'Off', value: 'off' },
163
+ { label: 'Before', value: 'before' },
164
+ { label: 'After', value: 'after' },
165
+ { label: 'Pivot Specific', value: 'pivot-specific' },
166
+ ], onValueChange: handleTotalSelectChange })] }))] }), hasPivotSpecificTotals && (_jsx(Flex, { flexWrap: "wrap", alignItems: "center", className: "twa:gap-x-2 twa:gap-y-1 twa:pl-2", style: { borderLeft: '1px solid var(--ab-color-primary-foreground)' }, children: props.layout.PivotColumns.map((pivotColId) => {
167
+ const pivotTotalSetting = pivotSpecificTotals.find((t) => t.PivotColumnId === pivotColId);
168
+ const pivotTotalValue = getPivotSpecificTotalSelectValue(pivotTotalSetting?.ShowTotal);
169
+ return (_jsxs(Flex, { alignItems: "center", className: "twa:gap-1 twa:shrink-0", children: [_jsxs(Box, { className: "twa:text-3 twa:truncate", children: [adaptable.api.columnApi.getFriendlyNameForColumnId(pivotColId), ":"] }), _jsx(SingleSelect, { size: "small", stopMouseDownPropagation: true, className: "twa:min-w-[5.5rem]", value: pivotTotalValue, items: [
170
+ { label: 'Off', value: 'off' },
171
+ { label: 'Before', value: 'before' },
172
+ { label: 'After', value: 'after' },
173
+ ], onValueChange: (value) => {
174
+ const mappedValue = value === 'off' ? false : value;
175
+ handlePivotSpecificTotalChange(pivotColId, mappedValue);
176
+ } })] }, pivotColId));
177
+ }) }))] }));
145
178
  };
146
179
  export const isPivotAggregationsSectionValid = (data) => {
147
180
  const weightedAvg = data.PivotAggregationColumns
@@ -154,18 +187,15 @@ export const isPivotAggregationsSectionValid = (data) => {
154
187
  }
155
188
  return true;
156
189
  };
157
- export const PivotAggregationsSectionSummary = () => {
190
+ export const PivotAggregationsSectionSummary = (props) => {
158
191
  const adaptable = useAdaptable();
159
- const { data: layout } = useOnePageAdaptableWizardContext();
160
- const pivotAggregationColumns = layout.PivotAggregationColumns || [];
161
- let content = null;
162
- if (pivotAggregationColumns.length) {
163
- content = (_jsx(FormLayout, { children: pivotAggregationColumns.map(({ ColumnId: colId, AggFunc: aggFunc }) => (_jsx(FormRow, { label: adaptable.api.columnApi.getFriendlyNameForColumnId(colId), children: _jsx(Tag, { children: typeof aggFunc === 'object' ? aggFunc.type : aggFunc }) }, colId))) }));
192
+ const { data: contextLayout } = useOnePageAdaptableWizardContext();
193
+ const layout = props.layout ?? contextLayout;
194
+ const values = getPivotAggregationSummaryValues(layout, adaptable.api);
195
+ if (!values.length) {
196
+ return _jsx(Tag, { children: "No Aggregations" });
164
197
  }
165
- else {
166
- content = _jsx(Tag, { children: "No Pivot Column Aggregations" });
167
- }
168
- return _jsx(Box, { children: content });
198
+ return renderSummaryStringTags(values);
169
199
  };
170
200
  export const PivotAggregationsSection = (props) => {
171
201
  const adaptable = useAdaptable();
@@ -178,11 +208,11 @@ export const PivotAggregationsSection = (props) => {
178
208
  const handleColumnsSelectionChange = React.useCallback((columnIds) => {
179
209
  const currentAggColumns = layout.PivotAggregationColumns ?? [];
180
210
  const PivotAggregationColumns = columnIds.map((colId) => {
211
+ const existing = currentAggColumns.find((x) => x.ColumnId === colId);
181
212
  return {
182
213
  ColumnId: colId,
183
- AggFunc: currentAggColumns.find((x) => x.ColumnId === colId)?.AggFunc ??
184
- adaptable.api.columnApi.getDefaultAggFunc(colId),
185
- TotalColumn: currentAggColumns.find((x) => x.ColumnId === colId)?.Total,
214
+ AggFunc: existing?.AggFunc ?? adaptable.api.columnApi.getDefaultAggFunc(colId),
215
+ Total: existing?.Total,
186
216
  };
187
217
  });
188
218
  props.onChange({
@@ -191,14 +221,14 @@ export const PivotAggregationsSection = (props) => {
191
221
  });
192
222
  }, [layout]);
193
223
  const handleAggregationChange = React.useCallback((pivotAggregationColumns) => {
194
- if (pivotAggregationColumns.some((aggCol) => aggCol.Total !== false || aggCol.Total !== null)) {
195
- // if any Aggregation Column has a Total Column, we need to disable the Pivot Group Total Column
196
- delete layout['PivotColumnTotal'];
197
- }
198
- props.onChange({
224
+ const updatedLayout = {
199
225
  ...layout,
200
226
  PivotAggregationColumns: pivotAggregationColumns,
201
- });
227
+ };
228
+ if (pivotAggregationColumns.some((aggCol) => aggCol.Total !== false && aggCol.Total != null)) {
229
+ delete updatedLayout.PivotColumnTotal;
230
+ }
231
+ props.onChange(updatedLayout);
202
232
  }, [layout]);
203
233
  const aggregationColumnsMap = React.useMemo(() => {
204
234
  const allColumnsMap = allColumns.reduce((acc, col) => {
@@ -228,7 +258,6 @@ export const PivotAggregationsSection = (props) => {
228
258
  });
229
259
  };
230
260
  const checkIfPivotColumnTotalEnabled = () => {
231
- // check that all AggregationColumns have identical AggFuncs
232
261
  const aggregationColumns = layout.PivotAggregationColumns;
233
262
  if (!aggregationColumns || aggregationColumns.length === 0) {
234
263
  return true;
@@ -237,7 +266,6 @@ export const PivotAggregationsSection = (props) => {
237
266
  if (layout.PivotAggregationColumns?.some((aggCol) => getAggFuncName(aggCol.AggFunc) !== firstAggFuncName)) {
238
267
  return 'All columns must use the same aggregation function.';
239
268
  }
240
- // check that no Aggregation Total Column is enabled
241
269
  const hasAggregationTotalColumn = aggregationColumns.some((aggCol) => aggCol.Total !== false && aggCol.Total != null);
242
270
  if (hasAggregationTotalColumn) {
243
271
  return 'This option is not available when an Aggregation Total Column is present.';
@@ -245,46 +273,21 @@ export const PivotAggregationsSection = (props) => {
245
273
  return true;
246
274
  };
247
275
  const isPivotColumnTotalEnabled = checkIfPivotColumnTotalEnabled();
248
- return (_jsxs(Box, { className: "twa:h-full twa:min-h-0 twa:p-2 twa:gap-2 twa:overflow-hidden twa:grid twa:grid-cols-2", children: [_jsxs(Card, { shadow: false, className: "twa:h-full twa:overflow-hidden twa:flex twa:flex-col", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Aggregation Columns" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Select a column and an aggregation function" })] }), _jsx(Card.Body, { className: "twa:flex-1 twa:min-h-0 twa:overflow-hidden twa:p-1", children: _jsx(ValueSelector, { style: { minHeight: 0 }, showFilterInput: true, filter: columnFilter, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => option.friendlyName ?? option.columnId, toListLabel: (column) => (_jsx(PivotColumnRow, { onChangeAggFunction: handleAggregationChange, layout: layout, column: column, aggregationColumnsMap: aggregationColumnsMap })), options: sortedAggregableColumns, value: (layout.PivotAggregationColumns || []).map((col) => col.ColumnId), allowReorder: true, onChange: handleColumnsSelectionChange }) })] }), _jsxs(Box, { className: "twa:h-full twa:min-h-0 twa:overflow-y-auto twa:flex twa:flex-col twa:gap-2", children: [_jsxs(Card, { shadow: false, children: [_jsx(Card.Title, { children: _jsx(Box, { className: "twa:font-medium", children: "Omit Aggregation from Header" }) }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(CheckBox, { checked: layout.SuppressAggFuncInHeader, onChange: handleSuppressAggFuncInHeader, children: "Do not show aggregation function names in column headers" }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Grand Total Row" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Set position of the grand total row in the grid" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(SingleSelect, { className: "twa:w-[180px]", items: [
249
- {
250
- label: 'Off',
251
- value: null,
252
- },
253
- ].concat(['top', 'bottom', 'pinnedTop', 'pinnedBottom'].map((position) => {
254
- return {
255
- label: StringExtensions.CamelCaseToHumanText(position),
256
- value: position,
257
- };
258
- })), placeholder: "Off", value: layout.GrandTotalRow, onValueChange: (value) => {
259
- props.onChange({
260
- ...layout,
261
- GrandTotalRow: value,
262
- });
263
- } }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Pivot Grand Total" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Set position of pivot grand total columns" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(SingleSelect, { className: "twa:w-[180px]", items: [
264
- { label: 'Off', value: null },
265
- ...['before', 'after'].map((position) => {
266
- return {
267
- label: StringExtensions.CapitaliseFirstLetter(position),
268
- value: position,
269
- };
270
- }),
271
- ], placeholder: "Off", value: layout.PivotGrandTotal, onValueChange: (value) => {
272
- props.onChange({
273
- ...layout,
274
- PivotGrandTotal: value,
275
- });
276
- } }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Pivot Column Total" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Set position of pivot column totals" })] }), _jsx(Card.Body, { className: "twa:p-1", children: isPivotColumnTotalEnabled === true ? (_jsx(SingleSelect, { className: "twa:w-[180px]", items: [
277
- { label: 'Off', value: null },
278
- ...['before', 'after'].map((position) => {
279
- return {
280
- label: StringExtensions.CapitaliseFirstLetter(position),
281
- value: position,
282
- };
283
- }),
284
- ], placeholder: "Off", value: layout.PivotColumnTotal, onValueChange: (value) => {
285
- props.onChange({
286
- ...layout,
287
- PivotColumnTotal: value,
288
- });
289
- } })) : (_jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:italic", children: isPivotColumnTotalEnabled })) })] })] })] }));
276
+ const aggregationEntries = layout.PivotAggregationColumns || [];
277
+ const initialExpandedCardId = getLayoutWizardInitialExpandedCardId(props.layoutWizardMode, 'aggregation-columns', isPivotAggregationsSectionConfigured(layout));
278
+ const { bindCard, hasExpandedCard, expandedFillsSpace } = useWizardCardAccordion(initialExpandedCardId);
279
+ const handlePivotLayoutTotalChange = (field, key) => {
280
+ props.onChange({
281
+ ...layout,
282
+ [field]: key === 'off' ? null : key,
283
+ });
284
+ };
285
+ return (_jsxs(Box, { className: getWizardAccordionSectionClassName(hasExpandedCard, expandedFillsSpace), children: [_jsx(CollapsibleWizardCard, { ...bindCard('aggregation-columns', { fillAvailable: true }), surface: "panel", "data-name": "aggregation-columns", title: "Aggregation Columns", help: "Select a column and an aggregation function", collapsedHelp: "", compactSummary: renderCompactColumnTags(aggregationEntries.map(({ ColumnId }) => ColumnId), (columnId) => adaptable.api.columnApi.getFriendlyNameForColumnId(columnId), { emptyLabel: 'No columns' }), summary: aggregationEntries.length ? (_jsx(Flex, { flexWrap: "wrap", className: "twa:gap-1", children: aggregationEntries.map(({ ColumnId, AggFunc }) => (_jsxs(ColumnTag, { children: [adaptable.api.columnApi.getFriendlyNameForColumnId(ColumnId), " (", getAggFuncSummaryLabel(ColumnId, AggFunc, aggregationColumnsMap), ")"] }, ColumnId))) })) : (_jsx(Tag, { children: "No columns" })), children: _jsx(Card, { shadow: false, className: "twa:h-full twa:overflow-hidden twa:flex twa:flex-col", children: _jsx(Card.Body, { className: "", children: _jsx(Box, { className: "twa:flex twa:flex-col twa:min-h-0", "data-name": "aggregation-columns-container", children: _jsx(ValueSelector, { style: { minHeight: 0 }, compact: true, showFilterInput: true, filter: columnFilter, filterPlaceholder: "Search Columns...", compactHeaderClassName: LAYOUT_WIZARD_COLUMN_LIST_HEADER_CLASS, compactFilterClassName: LAYOUT_WIZARD_COLUMN_LIST_SEARCH_CLASS, optionLayout: "label-beside-checkbox", toggleSelectionOnRowClick: true, optionClassName: LAYOUT_WIZARD_COLUMN_LIST_OPTION_CLASS, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => option.friendlyName ?? option.columnId, toListLabel: (column) => (_jsx(PivotColumnRow, { onChangeAggFunction: handleAggregationChange, layout: layout, column: column, aggregationColumnsMap: aggregationColumnsMap })), options: sortedAggregableColumns, value: aggregationEntries.map((agg) => agg.ColumnId), allowReorder: () => true, onChange: handleColumnsSelectionChange }) }) }) }) }), _jsx(CollapsibleWizardCard, { ...bindCard('suppress-header'), surface: "panel", "data-name": "omit-aggregation-from-header", title: "Aggregation Column Header", help: "Set behaviour for aggregation function names", collapsedHelp: "Behaviour for aggregation function names", compactSummary: _jsx(Tag, { children: layout.SuppressAggFuncInHeader ? 'Hide Function Name' : 'Show Function Name' }), summary: _jsx(CollapsibleWizardValueSummary, { value: _jsx(Tag, { children: layout.SuppressAggFuncInHeader ? 'Hide Function Name' : 'Show Function Name' }) }), children: _jsxs(RadioGroup, { orientation: "vertical", value: layout.SuppressAggFuncInHeader ?? false, onRadioChange: handleSuppressAggFuncInHeader, children: [_jsx(Radio, { value: false, children: "Show Aggregation function names" }), _jsx(Radio, { value: true, children: "Hide Aggregation function names" })] }) }), _jsx(CollapsibleWizardCard, { ...bindCard('grand-total'), surface: "panel", "data-name": "grand-total-row", title: "Grand Total Row", help: "Set position of the Grand Total Row in the grid", collapsedHelp: "Position of the Grand Total Row in the grid", compactSummary: _jsx(Tag, { children: getGrandTotalRowLabel(layout) }), summary: _jsx(CollapsibleWizardValueSummary, { value: _jsx(Tag, { children: getGrandTotalRowLabel(layout) }) }), children: _jsx(RadioGroup, { orientation: "vertical", value: getGrandTotalRowKey(layout), onRadioChange: (key) => {
286
+ props.onChange({
287
+ ...layout,
288
+ GrandTotalRow: key === 'off' ? null : key,
289
+ });
290
+ }, children: GRAND_TOTAL_ROW_OPTIONS.map((key) => (_jsx(TypeRadio, { value: key, text: GRAND_TOTAL_ROW_LABELS[key], description: GRAND_TOTAL_ROW_DESCRIPTIONS[key] }, key))) }) }), _jsx(CollapsibleWizardCard, { ...bindCard('pivot-grand-total'), surface: "panel", "data-name": "pivot-grand-total", title: "Pivot Grand Total", help: "Set position of pivot grand total columns", compactSummary: _jsx(Tag, { children: getPivotLayoutTotalLabel(layout.PivotGrandTotal) }), summary: _jsx(CollapsibleWizardValueSummary, { value: _jsx(Tag, { children: getPivotLayoutTotalLabel(layout.PivotGrandTotal) }) }), children: _jsx(RadioGroup, { orientation: "vertical", value: getPivotLayoutTotalKey(layout.PivotGrandTotal), onRadioChange: (key) => handlePivotLayoutTotalChange('PivotGrandTotal', key), children: PIVOT_LAYOUT_TOTAL_OPTIONS.map((key) => (_jsx(TypeRadio, { value: key, text: PIVOT_LAYOUT_TOTAL_LABELS[key], description: PIVOT_LAYOUT_TOTAL_DESCRIPTIONS[key] }, key))) }) }), _jsx(CollapsibleWizardCard, { ...bindCard('pivot-column-total'), surface: "panel", "data-name": "pivot-column-total", title: "Pivot Column Total", help: "Set position of pivot column totals within each pivot column group", compactSummary: _jsx(Tag, { children: isPivotColumnTotalEnabled === true
291
+ ? getPivotLayoutTotalLabel(layout.PivotColumnTotal)
292
+ : 'Not available' }), summary: isPivotColumnTotalEnabled === true ? (_jsx(CollapsibleWizardValueSummary, { value: _jsx(Tag, { children: getPivotLayoutTotalLabel(layout.PivotColumnTotal) }) })) : (_jsx(Tag, { children: isPivotColumnTotalEnabled })), children: isPivotColumnTotalEnabled === true ? (_jsx(RadioGroup, { orientation: "vertical", value: getPivotLayoutTotalKey(layout.PivotColumnTotal), onRadioChange: (key) => handlePivotLayoutTotalChange('PivotColumnTotal', key), children: PIVOT_LAYOUT_TOTAL_OPTIONS.map((key) => (_jsx(TypeRadio, { value: key, text: PIVOT_LAYOUT_TOTAL_LABELS[key], description: PIVOT_LAYOUT_TOTAL_DESCRIPTIONS[key] }, key))) })) : (_jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:italic", children: isPivotColumnTotalEnabled })) })] }));
290
293
  };
@@ -1,8 +1,11 @@
1
1
  import * as React from 'react';
2
- import { PivotLayout } from '../../../../types';
3
- export declare const PivotColumnsSectionSummary: React.FunctionComponent;
2
+ import { Layout, PivotLayout } from '../../../../types';
3
+ export declare const PivotColumnsSectionSummary: React.FunctionComponent<{
4
+ layout?: Layout;
5
+ }>;
4
6
  interface PivotColumnsSectionProps {
5
7
  onChange: (data: PivotLayout) => void;
8
+ layoutWizardMode?: 'create' | 'edit';
6
9
  }
7
10
  export declare const PivotColumnsSection: React.FunctionComponent<PivotColumnsSectionProps>;
8
11
  export {};
@@ -1,19 +1,27 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
- import { Tag } from '../../../../components/Tag';
3
+ import { ColumnTag, Tag } from '../../../../components/Tag';
4
4
  import { useAdaptable } from '../../../AdaptableContext';
5
5
  import { ValueSelector } from '../../../Components/ValueSelector';
6
6
  import { useOnePageAdaptableWizardContext } from '../../../Wizard/OnePageAdaptableWizard';
7
+ import { getLayoutWizardInitialExpandedCardId, isPivotColumnsSectionConfigured, } from './layoutWizardAccordionHelpers';
7
8
  import { columnFilter } from './Utilities';
9
+ import { ColumnGroupTag } from '../../../Components/ColumnGroupTag';
8
10
  import ArrayExtensions from '../../../../Utilities/Extensions/ArrayExtensions';
9
- import { Box } from '../../../../components/Flex';
11
+ import { Box, Flex } from '../../../../components/Flex';
10
12
  import { CheckBox } from '../../../../components/CheckBox';
11
- import HelpBlock from '../../../../components/HelpBlock';
12
13
  import { Card } from '../../../../components/Card';
13
- export const PivotColumnsSectionSummary = () => {
14
+ import { CollapsibleWizardCard, CollapsibleWizardValueSummary, getWizardAccordionSectionClassName, renderCompactColumnTags, useWizardCardAccordion, } from '../../../Wizard/CollapsibleWizardCard';
15
+ import { LAYOUT_WIZARD_COLUMN_LIST_HEADER_CLASS, LAYOUT_WIZARD_COLUMN_LIST_OPTION_CLASS, LAYOUT_WIZARD_COLUMN_LIST_SEARCH_CLASS, } from './layoutWizardColumns';
16
+ import { ColumnSortingWizardCard } from './SortSection';
17
+ import { getTableColumnsSortingSummaryValues } from '../../../../Strategy/Utilities/Layout/columnsSummaryHelpers';
18
+ import { renderSummaryStringTags } from '../../../Wizard/SummaryColorTag';
19
+ export const PivotColumnsSectionSummary = (props) => {
14
20
  const adaptable = useAdaptable();
15
- const { data: layout } = useOnePageAdaptableWizardContext();
16
- return (_jsx(Box, { className: "twa:p-2 twa:rounded-standard twa:bg-background", children: layout.PivotColumns?.length ? (layout.PivotColumns.map((columnId) => (_jsx(Tag, { className: "twa:mr-1", children: adaptable.api.columnApi.getFriendlyNameForColumnId(columnId) }, columnId)))) : (_jsx(Tag, { children: "No Pivot Columns Defined" })) }));
21
+ const { data: contextLayout } = useOnePageAdaptableWizardContext();
22
+ const layout = props.layout ?? contextLayout;
23
+ const sortValues = getTableColumnsSortingSummaryValues(layout, adaptable.api);
24
+ return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-3", children: [_jsxs(Box, { children: [_jsx(Box, { className: "twa:text-xs twa:font-medium twa:mb-1", children: "Pivot Columns" }), _jsx(Flex, { flexDirection: "row", flexWrap: "wrap", className: "twa:gap-1", children: layout.PivotColumns?.length ? (layout.PivotColumns.map((columnId) => (_jsx(ColumnTag, { children: adaptable.api.columnApi.getFriendlyNameForColumnId(columnId) }, columnId)))) : (_jsx(Tag, { children: "No Pivot Columns Defined" })) })] }), sortValues.length ? (_jsxs(Box, { children: [_jsx(Box, { className: "twa:text-xs twa:font-medium twa:mb-1", children: "Sorting" }), renderSummaryStringTags(sortValues)] })) : null] }));
17
25
  };
18
26
  export const PivotColumnsSection = (props) => {
19
27
  const adaptable = useAdaptable();
@@ -28,10 +36,14 @@ export const PivotColumnsSection = (props) => {
28
36
  PivotColumns: columnIds,
29
37
  });
30
38
  };
31
- return (_jsxs(Box, { className: "twa:h-full twa:min-h-0 twa:p-2 twa:gap-2 twa:overflow-hidden twa:grid twa:grid-cols-2", children: [_jsxs(Card, { shadow: false, className: "twa:h-full twa:overflow-hidden twa:flex twa:flex-col", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Pivot Columns" }), _jsxs(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: ["Select and order the columns used as pivot columns", ' '] })] }), _jsx(Card.Body, { className: "twa:flex-1 twa:min-h-0 twa:overflow-hidden twa:p-1", children: _jsx(ValueSelector, { style: { minHeight: 0 }, showFilterInput: true, filter: columnFilter, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => option.friendlyName ?? option.columnId, options: sortedPivotColumns, value: layout.PivotColumns ?? [], allowReorder: true, onChange: handleColumnsChange }) })] }), _jsx(Box, { className: "twa:h-full twa:min-h-0 twa:overflow-y-auto twa:flex twa:flex-col twa:gap-2", children: _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Pivot Result Columns" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Configure layout persistence behaviour" })] }), _jsxs(Card.Body, { className: "twa:p-1", children: [_jsx(CheckBox, { checked: !!layout.PivotResultColumnsOrder, onChange: (checked) => {
32
- props.onChange({
33
- ...layout,
34
- PivotResultColumnsOrder: checked,
35
- });
36
- }, children: "Persist order of pivot result columns" }), _jsx(HelpBlock, { className: "twa:mt-2", children: "Result columns are created dynamically for each value in the pivot column" })] })] }) })] }));
39
+ const persistPivotResultOrder = !!layout.PivotResultColumnsOrder;
40
+ const layoutSupportedFeatures = adaptable.api.layoutApi.internalApi.getLayoutSupportedFeatures();
41
+ const initialExpandedCardId = getLayoutWizardInitialExpandedCardId(props.layoutWizardMode, 'pivot-columns', isPivotColumnsSectionConfigured(layout));
42
+ const { bindCard, hasExpandedCard, expandedFillsSpace } = useWizardCardAccordion(initialExpandedCardId);
43
+ return (_jsxs(Box, { className: getWizardAccordionSectionClassName(hasExpandedCard, expandedFillsSpace), children: [_jsx(CollapsibleWizardCard, { ...bindCard('pivot-columns', { fillAvailable: true }), surface: "panel", "data-name": "pivot-columns", title: "Pivot Columns", help: "Select and order the columns used as pivot columns", collapsedHelp: "", compactSummary: renderCompactColumnTags(layout.PivotColumns ?? [], (columnId) => adaptable.api.columnApi.getFriendlyNameForColumnId(columnId), { emptyLabel: 'No columns' }), summary: layout.PivotColumns?.length ? (_jsx(Flex, { flexWrap: "wrap", className: "twa:gap-1", children: layout.PivotColumns.map((columnId) => (_jsx(ColumnTag, { children: adaptable.api.columnApi.getFriendlyNameForColumnId(columnId) }, columnId))) })) : (_jsx(Tag, { children: "No columns" })), className: "twa:overflow-hidden twa:flex twa:flex-col", bodyClassName: "twa:min-h-[200px] twa:max-h-[420px] twa:overflow-hidden twa:flex twa:flex-col ", children: _jsx(Card, { shadow: false, className: "twa:h-full", children: _jsx(Card.Body, { children: _jsx(Box, { className: "twa:flex twa:flex-col twa:gap-1.5 twa:h-full twa:overflow-hidden twa:flex-1 twa:min-h-0", "data-name": "pivot-columns-container", children: _jsx(ValueSelector, { compact: true, showFilterInput: true, filter: columnFilter, filterPlaceholder: "Search Columns...", compactHeaderClassName: LAYOUT_WIZARD_COLUMN_LIST_HEADER_CLASS, compactFilterClassName: LAYOUT_WIZARD_COLUMN_LIST_SEARCH_CLASS, hideShowSelectedOnly: true, optionLayout: "label-beside-checkbox", toggleSelectionOnRowClick: true, optionClassName: LAYOUT_WIZARD_COLUMN_LIST_OPTION_CLASS, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => option.friendlyName ?? option.columnId, toListLabel: (option) => (_jsxs(Flex, { alignItems: "center", className: "twa:min-w-0", children: [_jsx(Box, { className: "twa:truncate", children: option.friendlyName ?? option.columnId }), _jsx(ColumnGroupTag, { column: option })] })), options: sortedPivotColumns, value: layout.PivotColumns ?? [], allowReorder: true, onChange: handleColumnsChange }) }) }) }) }), _jsx(CollapsibleWizardCard, { ...bindCard('pivot-result-columns'), surface: "panel", "data-name": "pivot-result-columns", title: "Pivot Result Columns", help: "Configure how dynamically created pivot result columns are stored in the Layout", collapsedHelp: "How dynamically created pivot result columns are stored in the Layout", compactSummary: _jsx(Tag, { children: persistPivotResultOrder ? 'Persist order' : 'Do not persist order' }), summary: _jsx(CollapsibleWizardValueSummary, { value: _jsx(Tag, { children: persistPivotResultOrder ? 'Persist order' : 'Do not persist order' }) }), children: _jsx(CheckBox, { checked: persistPivotResultOrder, onChange: (checked) => {
44
+ props.onChange({
45
+ ...layout,
46
+ PivotResultColumnsOrder: checked,
47
+ });
48
+ }, children: "Persist order of pivot result columns" }) }), layoutSupportedFeatures.ColumnSorts ? (_jsx(ColumnSortingWizardCard, { layout: layout, onChange: props.onChange, bindCard: bindCard, title: "Column Sorting", cardId: "column-sorting", "data-name": "pivot-column-sorting" })) : null] }));
37
49
  };
@@ -1,8 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import { PivotLayout } from '../../../../../types';
3
- export declare const PivotRowGroupingSectionSummary: React.FunctionComponent;
3
+ export declare const PivotRowGroupingSectionSummary: React.FunctionComponent<{
4
+ layout?: PivotLayout;
5
+ }>;
4
6
  interface PivotRowGroupingSectionProps {
5
7
  onChange: (data: PivotLayout) => void;
8
+ layoutWizardMode?: 'create' | 'edit';
6
9
  }
7
10
  export declare const PivotRowGroupingSection: React.FunctionComponent<PivotRowGroupingSectionProps>;
8
11
  export {};
@@ -1,22 +1,25 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
+ import { getLayoutWizardInitialExpandedCardId, isPivotRowGroupingSectionConfigured, } from './layoutWizardAccordionHelpers';
3
4
  import { columnFilter } from './Utilities';
4
5
  import { ColumnGroupTag } from '../../../Components/ColumnGroupTag';
5
- import { Tag } from '../../../../components/Tag';
6
+ import { ColumnTag, Tag } from '../../../../components/Tag';
6
7
  import { useAdaptable } from '../../../AdaptableContext';
7
8
  import { ValueSelector } from '../../../Components/ValueSelector';
8
9
  import { useOnePageAdaptableWizardContext } from '../../../Wizard/OnePageAdaptableWizard';
9
10
  import ArrayExtensions from '../../../../Utilities/Extensions/ArrayExtensions';
10
11
  import { normalizeLayout } from '../../../../Api/Implementation/LayoutHelpers';
11
- import { RowGroupBehaviorSection } from './RowGroupingSection';
12
+ import { RowGroupBehaviorSection, getRowGroupBehaviorLabel, } from './RowGroupingSection';
13
+ import { PivotRowGroupSummaryTags } from '../../../Wizard/rowGroupSummaryTags';
12
14
  import { Box, Flex } from '../../../../components/Flex';
13
15
  import { Card } from '../../../../components/Card';
14
- export const PivotRowGroupingSectionSummary = () => {
16
+ import { CollapsibleWizardCard, CollapsibleWizardValueSummary, getWizardAccordionSectionClassName, renderCompactColumnTags, useWizardCardAccordion, } from '../../../Wizard/CollapsibleWizardCard';
17
+ import { LAYOUT_WIZARD_COLUMN_LIST_HEADER_CLASS, LAYOUT_WIZARD_COLUMN_LIST_OPTION_CLASS, LAYOUT_WIZARD_COLUMN_LIST_SEARCH_CLASS, } from './layoutWizardColumns';
18
+ export const PivotRowGroupingSectionSummary = (props) => {
15
19
  const adaptable = useAdaptable();
16
- const { data: layout } = useOnePageAdaptableWizardContext();
17
- return (_jsx(Box, { children: layout.PivotGroupedColumns?.length ? (layout.PivotGroupedColumns.map((columnId) => {
18
- return (_jsx(Box, { className: "twa:mb-2", children: _jsx(Tag, { children: adaptable.api.columnApi.getFriendlyNameForColumnId(columnId) }) }, columnId));
19
- })) : (_jsx(Tag, { children: "No Pivot Row Grouping" })) }));
20
+ const { data: contextLayout } = useOnePageAdaptableWizardContext();
21
+ const layout = props.layout ?? contextLayout;
22
+ return _jsx(PivotRowGroupSummaryTags, { layout: layout, api: adaptable.api });
20
23
  };
21
24
  export const PivotRowGroupingSection = (props) => {
22
25
  const adaptable = useAdaptable();
@@ -25,15 +28,23 @@ export const PivotRowGroupingSection = (props) => {
25
28
  const sortedGroupableColumns = React.useMemo(() => {
26
29
  return ArrayExtensions.sortArrayWithOrder(allGroupableColumns.map((col) => col.columnId), layout.PivotGroupedColumns ?? [], { sortUnorderedItems: false }).map((colId) => adaptable.api.columnApi.getColumnWithColumnId(colId));
27
30
  }, [layout, allGroupableColumns]);
28
- const onChange = (layout) => {
29
- props.onChange(normalizeLayout(layout));
31
+ const onChange = (nextLayout) => {
32
+ props.onChange(normalizeLayout(nextLayout));
30
33
  };
31
34
  const handleColumnsChange = (columnIds) => {
32
- onChange({
35
+ const newLayout = {
33
36
  ...layout,
34
37
  PivotGroupedColumns: columnIds,
35
- });
38
+ };
39
+ if (!newLayout.RowGroupValues) {
40
+ newLayout.RowGroupValues = {
41
+ RowGroupDefaultBehavior: 'always-collapsed',
42
+ };
43
+ }
44
+ onChange(newLayout);
36
45
  };
37
46
  const rowGroupsText = 'Grouped Rows ' + adaptable.api.internalApi.getCorrectEnglishVariant('Behaviour');
38
- return (_jsxs(Box, { className: "twa:h-full twa:min-h-0 twa:p-2 twa:gap-2 twa:overflow-hidden twa:grid twa:grid-cols-2", children: [_jsxs(Card, { shadow: false, className: "twa:h-full twa:overflow-hidden twa:flex twa:flex-col", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Row Grouped Columns" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Select and order Columns used in grouping" })] }), _jsx(Card.Body, { className: "twa:flex-1 twa:min-h-0 twa:overflow-hidden twa:p-1", children: _jsx(ValueSelector, { style: { minHeight: 0 }, showFilterInput: true, filter: columnFilter, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => option.friendlyName ?? option.columnId, toListLabel: (option) => (_jsxs(Flex, { alignItems: "center", children: [option.friendlyName ?? option.columnId, _jsx(ColumnGroupTag, { column: option })] })), options: sortedGroupableColumns, value: layout.PivotGroupedColumns ?? [], allowReorder: true, onChange: handleColumnsChange }) })] }), _jsx(Box, { className: "twa:h-full twa:min-h-0 twa:overflow-y-auto twa:flex twa:flex-col twa:gap-2", children: _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: rowGroupsText }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Set what happens when Layout opens" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(RowGroupBehaviorSection, { layout: layout, onChange: onChange }) })] }) })] }));
47
+ const initialExpandedCardId = getLayoutWizardInitialExpandedCardId(props.layoutWizardMode, 'columns', isPivotRowGroupingSectionConfigured(layout));
48
+ const { bindCard, hasExpandedCard, expandedFillsSpace } = useWizardCardAccordion(initialExpandedCardId);
49
+ return (_jsxs(Box, { className: getWizardAccordionSectionClassName(hasExpandedCard, expandedFillsSpace), children: [_jsx(CollapsibleWizardCard, { ...bindCard('columns', { fillAvailable: true }), surface: "panel", "data-name": "pivot-row-grouped-columns", title: "Row Grouped Columns", help: "Select and order Columns used in Row Grouping", collapsedHelp: "", compactSummary: renderCompactColumnTags(layout.PivotGroupedColumns ?? [], (columnId) => adaptable.api.columnApi.getFriendlyNameForColumnId(columnId), { emptyLabel: 'No columns' }), summary: layout.PivotGroupedColumns?.length ? (_jsx(Flex, { flexWrap: "wrap", className: "twa:gap-1", children: layout.PivotGroupedColumns.map((columnId) => (_jsx(ColumnTag, { children: adaptable.api.columnApi.getFriendlyNameForColumnId(columnId) }, columnId))) })) : (_jsx(Tag, { children: "No columns" })), className: "twa:overflow-hidden twa:flex twa:flex-col", bodyClassName: "twa:min-h-[200px] twa:max-h-[420px] twa:overflow-hidden twa:flex twa:flex-col twa:!pt-0 twa:!pb-0 twa:px-1", children: _jsx(Card, { shadow: false, className: "twa:h-full twa:overflow-hidden twa:flex twa:flex-col", children: _jsx(Card.Body, { className: "twa:flex-1 twa:min-h-0 twa:overflow-hidden twa:px-1 twa:pt-0 twa:pb-0", children: _jsx(Box, { className: "twa:flex twa:flex-col twa:gap-1.5 twa:h-full twa:overflow-hidden twa:flex-1 twa:min-h-0", "data-name": "pivot-row-grouped-columns-container", children: _jsx(ValueSelector, { compact: true, showFilterInput: true, filter: columnFilter, filterPlaceholder: "Search Columns...", compactHeaderClassName: LAYOUT_WIZARD_COLUMN_LIST_HEADER_CLASS, compactFilterClassName: LAYOUT_WIZARD_COLUMN_LIST_SEARCH_CLASS, hideShowSelectedOnly: true, optionLayout: "label-beside-checkbox", toggleSelectionOnRowClick: true, optionClassName: LAYOUT_WIZARD_COLUMN_LIST_OPTION_CLASS, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => option.friendlyName ?? option.columnId, toListLabel: (option) => (_jsxs(Flex, { alignItems: "center", className: "twa:min-w-0", children: [_jsx(Box, { className: "twa:truncate", children: option.friendlyName ?? option.columnId }), _jsx(ColumnGroupTag, { column: option })] })), options: sortedGroupableColumns, value: layout.PivotGroupedColumns ?? [], allowReorder: true, onChange: handleColumnsChange }) }) }) }) }), _jsx(CollapsibleWizardCard, { ...bindCard('behavior'), surface: "panel", "data-name": "pivot-row-group-behavior", title: rowGroupsText, help: "Set Grouped Rows expanded / collapsed behaviour when Layout opens", collapsedHelp: "Grouped Rows expanded / collapsed behaviour when Layout opens", compactSummary: _jsx(Tag, { children: getRowGroupBehaviorLabel(layout) }), summary: _jsx(CollapsibleWizardValueSummary, { value: _jsx(Tag, { children: getRowGroupBehaviorLabel(layout) }) }), children: _jsx(RowGroupBehaviorSection, { layout: layout, onChange: onChange }) })] }));
39
50
  };
@@ -1,12 +1,15 @@
1
1
  import * as React from 'react';
2
2
  import { Layout } from '../../../../../types';
3
- export declare const RowGroupingSectionSummary: React.FunctionComponent;
3
+ export { getRowGroupBehaviorDescription, getRowGroupBehaviorLabel, getRowGroupDisplayTypeDescription, getRowGroupDisplayTypeLabel, } from '../../../../Strategy/Utilities/Layout/rowGroupSummaryHelpers';
4
+ export declare const RowGroupingSectionSummary: React.FunctionComponent<{
5
+ layout?: Layout;
6
+ }>;
4
7
  interface RowGroupingSectionProps {
5
8
  onChange: (data: Layout) => void;
9
+ layoutWizardMode?: 'create' | 'edit';
6
10
  }
7
11
  export declare const RowGroupBehaviorSection: (props: {
8
12
  layout: Layout;
9
13
  onChange: (data: Layout) => void;
10
14
  }) => React.JSX.Element;
11
15
  export declare const RowGroupingSection: React.FunctionComponent<RowGroupingSectionProps>;
12
- export {};