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