@adaptabletools/adaptable 23.0.0-canary.6 → 23.0.0-canary.8
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.
- package/icons/sort-asc.svg +1 -1
- package/index.css +828 -263
- package/package.json +1 -1
- package/src/AdaptableOptions/DataSetOptions.d.ts +26 -2
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +0 -1
- package/src/AdaptableOptions/SettingsPanelOptions.d.ts +42 -10
- package/src/AdaptableState/Common/AdaptableFormat.d.ts +7 -0
- package/src/AdaptableState/Common/AdaptableMessageType.d.ts +1 -1
- package/src/AdaptableState/Common/Enums.d.ts +1 -1
- package/src/AdaptableState/Common/Enums.js +1 -1
- package/src/AdaptableState/StyledColumnState.d.ts +8 -850
- package/src/AdaptableState/StyledColumnState.js +1 -9
- package/src/AdaptableState/StyledColumns/BadgeStyle.d.ts +143 -0
- package/src/AdaptableState/StyledColumns/BadgeStyle.js +9 -0
- package/src/AdaptableState/StyledColumns/BulletChartStyle.d.ts +147 -0
- package/src/AdaptableState/StyledColumns/Common/BarChartCellText.d.ts +60 -0
- package/src/AdaptableState/StyledColumns/Common/BarChartCellText.js +6 -0
- package/src/AdaptableState/StyledColumns/Common/BarChartMarker.d.ts +24 -0
- package/src/AdaptableState/StyledColumns/Common/BarChartMarker.js +5 -0
- package/src/AdaptableState/StyledColumns/Common/CellTextOptions.d.ts +13 -0
- package/src/AdaptableState/StyledColumns/Common/CellTextOptions.js +6 -0
- package/src/AdaptableState/StyledColumns/Common/NumericStyledColumn.d.ts +79 -0
- package/src/AdaptableState/StyledColumns/Common/NumericStyledColumn.js +9 -0
- package/src/AdaptableState/StyledColumns/GradientStyle.d.ts +48 -0
- package/src/AdaptableState/StyledColumns/GradientStyle.js +1 -0
- package/src/AdaptableState/StyledColumns/IconStyle.d.ts +158 -0
- package/src/AdaptableState/StyledColumns/IconStyle.js +1 -0
- package/src/AdaptableState/StyledColumns/PercentBarStyle.d.ts +32 -0
- package/src/AdaptableState/StyledColumns/PercentBarStyle.js +1 -0
- package/src/AdaptableState/StyledColumns/RangeBarStyle.d.ts +155 -0
- package/src/AdaptableState/StyledColumns/RangeBarStyle.js +1 -0
- package/src/AdaptableState/StyledColumns/RatingStyle.d.ts +111 -0
- package/src/AdaptableState/StyledColumns/RatingStyle.js +1 -0
- package/src/AdaptableState/StyledColumns/SparklineStyle.d.ts +21 -0
- package/src/AdaptableState/StyledColumns/SparklineStyle.js +1 -0
- package/src/Api/ColumnScopeApi.d.ts +1 -1
- package/src/Api/Implementation/ColumnScopeApiImpl.d.ts +1 -1
- package/src/Api/Internal/AlertInternalApi.js +1 -1
- package/src/Api/Internal/DataSetInternalApi.d.ts +3 -0
- package/src/Api/Internal/DataSetInternalApi.js +73 -13
- package/src/Api/Internal/StyledColumnInternalApi.d.ts +3 -1
- package/src/Redux/Store/AdaptableStore.js +6 -4
- package/src/Strategy/CalculatedColumnModule.js +1 -0
- package/src/Strategy/ColumnFilterModule.js +1 -0
- package/src/Strategy/FlashingCellModule.js +6 -2
- package/src/Strategy/FormatColumnModule.js +2 -2
- package/src/Strategy/FreeTextColumnModule.js +38 -28
- package/src/Strategy/Interface/IModule.d.ts +3 -1
- package/src/Strategy/LayoutModule.js +15 -66
- package/src/Strategy/StyledColumnModule.js +12 -29
- package/src/Strategy/Utilities/CustomSort/getCustomSortColumnViewItems.d.ts +1 -0
- package/src/Strategy/Utilities/CustomSort/getCustomSortColumnViewItems.js +1 -0
- package/src/Strategy/Utilities/Export/getExportColumnsViewItems.d.ts +2 -0
- package/src/Strategy/Utilities/Export/getExportColumnsViewItems.js +14 -0
- package/src/Strategy/Utilities/Export/getExportRowsViewItems.d.ts +1 -0
- package/src/Strategy/Utilities/Export/getExportRowsViewItems.js +3 -0
- package/src/Strategy/Utilities/Layout/aggregationSummaryHelpers.d.ts +11 -0
- package/src/Strategy/Utilities/Layout/aggregationSummaryHelpers.js +105 -0
- package/src/Strategy/Utilities/Layout/columnsSummaryHelpers.d.ts +48 -0
- package/src/Strategy/Utilities/Layout/columnsSummaryHelpers.js +166 -0
- package/src/Strategy/Utilities/Layout/getLayoutSortViewItems.d.ts +1 -0
- package/src/Strategy/Utilities/Layout/getLayoutSortViewItems.js +1 -0
- package/src/Strategy/Utilities/Layout/rowGroupSummaryHelpers.d.ts +26 -0
- package/src/Strategy/Utilities/Layout/rowGroupSummaryHelpers.js +85 -0
- package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +3 -5
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +46 -41
- package/src/Utilities/Helpers/FormatHelper.js +3 -0
- package/src/Utilities/Helpers/IconStylePresets.d.ts +1 -1
- package/src/Utilities/Helpers/ScheduleHelper.js +2 -0
- package/src/Utilities/Helpers/StyleHelper.d.ts +18 -0
- package/src/Utilities/Helpers/StyleHelper.js +27 -0
- package/src/Utilities/Helpers/StyledColumnGradientHelper.d.ts +3 -1
- package/src/Utilities/Helpers/StyledColumnGradientHelper.js +7 -5
- package/src/Utilities/Helpers/barChartCellText.d.ts +63 -0
- package/src/Utilities/Helpers/barChartCellText.js +316 -0
- package/src/Utilities/Helpers/percentBarPreviewHelper.d.ts +2 -1
- package/src/Utilities/Helpers/percentBarPreviewHelper.js +3 -8
- package/src/Utilities/Helpers/resolveSettingsPanelNavigation.d.ts +3 -0
- package/src/Utilities/Helpers/resolveSettingsPanelNavigation.js +15 -0
- package/src/Utilities/getScopeViewItems.js +2 -0
- package/src/Utilities/wizardSelection.d.ts +10 -0
- package/src/Utilities/wizardSelection.js +15 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.js +2 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.js +2 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +3 -3
- package/src/View/Alert/AlertViewPanel.js +2 -2
- package/src/View/Alert/Utilities/getAlertButtonStyle.js +7 -4
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.d.ts +0 -1
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +0 -4
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +160 -126
- package/src/View/Alert/Wizard/AlertMessageWizardSection.d.ts +1 -1
- package/src/View/Alert/Wizard/AlertMessageWizardSection.js +1 -2
- package/src/View/Alert/Wizard/AlertNotificationWizardSection.d.ts +1 -1
- package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +4 -5
- package/src/View/Alert/Wizard/AlertScheduledWizardSection.d.ts +1 -1
- package/src/View/Alert/Wizard/AlertScheduledWizardSection.js +1 -2
- package/src/View/Alert/Wizard/AlertTypeWizardSection.d.ts +1 -1
- package/src/View/Alert/Wizard/AlertTypeWizardSection.js +31 -7
- package/src/View/Alert/Wizard/AlertWizard.js +13 -5
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.d.ts +2 -1
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +4 -14
- package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
- package/src/View/BulkUpdate/BulkUpdateViewPanel.js +4 -6
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.d.ts +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -2
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +30 -4
- package/src/View/CellSummary/CellSummaryViewPanel.js +4 -4
- package/src/View/Charting/ShowChartButton.js +8 -8
- package/src/View/ColumnInfo/ColumnInfo.js +21 -1
- package/src/View/Components/AdaptableObjectCollection/index.js +2 -2
- package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +3 -2
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +7 -6
- package/src/View/Components/AdaptableObjectList/objectListActionButtonStyles.d.ts +2 -0
- package/src/View/Components/AdaptableObjectList/objectListActionButtonStyles.js +2 -0
- package/src/View/Components/AdaptableObjectRow/index.js +2 -2
- package/src/View/Components/Buttons/ButtonBase/index.js +2 -3
- package/src/View/Components/Buttons/ButtonNew.d.ts +2 -0
- package/src/View/Components/Buttons/ButtonNew.js +1 -1
- package/src/View/Components/Buttons/EntityListActionButtons.js +3 -3
- package/src/View/Components/Buttons/SuspendToggleButton/SuspendToggleButton.d.ts +1 -0
- package/src/View/Components/Buttons/SuspendToggleButton/SuspendToggleButton.js +9 -9
- package/src/View/Components/ColumnFilter/ColumnFilter.js +16 -4
- package/src/View/Components/ColumnFilter/components/ColumnFilterMenu.js +2 -2
- package/src/View/Components/ColumnSelector/index.d.ts +12 -0
- package/src/View/Components/ColumnSelector/index.js +30 -6
- package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicatesEditor.js +2 -2
- package/src/View/Components/ModuleValueSelector/index.js +2 -1
- package/src/View/Components/NewScopeComponent.js +4 -9
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +5 -4
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +4 -4
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +2 -2
- package/src/View/Components/Popups/AdaptablePopup/Navigation.d.ts +3 -2
- package/src/View/Components/Popups/AdaptablePopup/Navigation.js +38 -28
- package/src/View/Components/Popups/AdaptablePopup/PopupPanel.js +3 -3
- package/src/View/Components/Popups/AdaptablePopup/TopBar.js +2 -2
- package/src/View/Components/Popups/AdaptablePopup/settingsPanelNavigationTypes.d.ts +11 -0
- package/src/View/Components/Popups/AdaptablePopup/settingsPanelNavigationTypes.js +1 -0
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.d.ts +3 -1
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +25 -27
- package/src/View/Components/PredicateEditor/PredicateEditor.js +1 -1
- package/src/View/Components/RangesComponent.d.ts +4 -5
- package/src/View/Components/RangesComponent.js +95 -66
- package/src/View/Components/ReorderDraggable/index.js +2 -2
- package/src/View/Components/Selectors/BulkUpdateValueSelector.d.ts +0 -2
- package/src/View/Components/Selectors/BulkUpdateValueSelector.js +3 -3
- package/src/View/Components/StyleComponent.js +32 -65
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +10 -7
- package/src/View/Components/ToolPanel/ToolPanelPopup.d.ts +3 -13
- package/src/View/Components/ToolPanel/ToolPanelPopup.js +5 -81
- package/src/View/Components/ToolPanel/ToolPanelPopupSections.d.ts +17 -0
- package/src/View/Components/ToolPanel/ToolPanelPopupSections.js +76 -0
- package/src/View/Components/ValueSelector/index.d.ts +29 -0
- package/src/View/Components/ValueSelector/index.js +113 -30
- package/src/View/Components/wizardColumnListStyles.d.ts +10 -0
- package/src/View/Components/wizardColumnListStyles.js +10 -0
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.d.ts +2 -1
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +5 -7
- package/src/View/CustomSort/Wizard/CustomSortWizard.js +2 -2
- package/src/View/Dashboard/DashboardPopup.d.ts +1 -11
- package/src/View/Dashboard/DashboardPopup.js +3 -67
- package/src/View/Dashboard/DashboardPopupSections.d.ts +20 -0
- package/src/View/Dashboard/DashboardPopupSections.js +68 -0
- package/src/View/Dashboard/PinnedToolbarsSelector.js +2 -2
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.d.ts +1 -6
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +8 -20
- package/src/View/DataChangeHistory/DataChangeHistoryTable.d.ts +8 -0
- package/src/View/DataChangeHistory/DataChangeHistoryTable.js +94 -0
- package/src/View/DataChangeHistory/buildActionColumnButton.d.ts +5 -3
- package/src/View/DataChangeHistory/buildActionColumnButton.js +30 -39
- package/src/View/DataChangeHistory/dataChangeHistoryHelpers.d.ts +15 -0
- package/src/View/DataChangeHistory/dataChangeHistoryHelpers.js +37 -0
- package/src/View/DataImport/DataImportWizard/DataImportWizard.js +1 -1
- package/src/View/DataImport/DataImportWizard/sections/ColumnsSection.js +32 -19
- package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +1 -1
- package/src/View/DataSet/DataSetViewPanel.d.ts +2 -2
- package/src/View/Export/ExportDestinationPicker.js +3 -3
- package/src/View/Export/ExportSchedulesTab.js +3 -4
- package/src/View/Export/ExportViewPanel.js +2 -2
- package/src/View/Export/Wizard/ReportColumnsWizardSection.d.ts +2 -1
- package/src/View/Export/Wizard/ReportColumnsWizardSection.js +4 -9
- package/src/View/Export/Wizard/ReportRowsWizardSection.d.ts +2 -1
- package/src/View/Export/Wizard/ReportRowsWizardSection.js +3 -6
- package/src/View/Filter/FilterViewPanel.js +1 -1
- package/src/View/FlashingCell/FlashingCellStyle.d.ts +4 -2
- package/src/View/FlashingCell/FlashingCellStyle.js +4 -2
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.d.ts +2 -1
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +7 -11
- package/src/View/FlashingCell/Wizard/FlashingCellScopeSummary.d.ts +9 -0
- package/src/View/FlashingCell/Wizard/FlashingCellScopeSummary.js +5 -0
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.d.ts +1 -1
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +1 -0
- package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.d.ts +0 -5
- package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +1 -5
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +2 -3
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +99 -42
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +0 -1
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +0 -4
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +56 -15
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +2 -3
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +5 -8
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +8 -13
- package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.js +3 -2
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -2
- package/src/View/GridFilter/GridFilterPopupUI/index.js +3 -2
- package/src/View/GridFilter/GridFilterViewPanel.js +5 -5
- package/src/View/GridInfo/GridInfoPopup/AdaptableObjectsSummary.js +2 -2
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +2 -2
- package/src/View/Layout/LayoutViewPanel.js +1 -1
- package/src/View/Layout/Wizard/LayoutWizard.js +24 -28
- package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +13 -1
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +73 -33
- package/src/View/Layout/Wizard/sections/ColumnsSection.d.ts +4 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +155 -276
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +4 -1
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +148 -145
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.d.ts +5 -2
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +24 -12
- package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.d.ts +4 -1
- package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +23 -12
- package/src/View/Layout/Wizard/sections/RowGroupingSection.d.ts +5 -2
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +19 -12
- package/src/View/Layout/Wizard/sections/RowSelectionSection.js +8 -4
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +132 -106
- package/src/View/Layout/Wizard/sections/SortSection.d.ts +12 -2
- package/src/View/Layout/Wizard/sections/SortSection.js +41 -17
- package/src/View/Layout/Wizard/sections/columnLayoutCards.d.ts +20 -0
- package/src/View/Layout/Wizard/sections/columnLayoutCards.js +159 -0
- package/src/View/Layout/Wizard/sections/columnLayoutHelpers.d.ts +30 -0
- package/src/View/Layout/Wizard/sections/columnLayoutHelpers.js +201 -0
- package/src/View/Layout/Wizard/sections/layoutWizardAccordionHelpers.d.ts +8 -0
- package/src/View/Layout/Wizard/sections/layoutWizardAccordionHelpers.js +63 -0
- package/src/View/Layout/Wizard/sections/layoutWizardColumns.d.ts +11 -0
- package/src/View/Layout/Wizard/sections/layoutWizardColumns.js +52 -0
- package/src/View/License/LicenseWatermark.js +1 -1
- package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.d.ts +1 -1
- package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -2
- package/src/View/Note/NoteEditor.js +2 -2
- package/src/View/QuickSearch/QuickSearchPopup.js +2 -3
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +1 -1
- package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +1 -1
- package/src/View/SmartEdit/SmartEditPopup.js +2 -2
- package/src/View/SmartEdit/SmartEditViewPanel.js +2 -2
- package/src/View/StateManagement/StateManagementPopup.js +1 -1
- package/src/View/StateManagement/components/ExportDropdown.d.ts +2 -2
- package/src/View/StateManagement/components/ExportDropdown.js +12 -12
- package/src/View/StatusBar/StatusBarPanel.js +2 -2
- package/src/View/StatusBar/StatusBarPopup.js +33 -5
- package/src/View/StatusBar/statusBarPanelHelpers.d.ts +2 -0
- package/src/View/StatusBar/statusBarPanelHelpers.js +7 -0
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +3 -1
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +14 -11
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.d.ts +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +143 -119
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +1 -3
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +8 -14
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnTypeThumbnail.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnTypeThumbnail.js +50 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.d.ts +2 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +26 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +76 -70
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +83 -38
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +173 -76
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardScopeSection.d.ts +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardScopeSection.js +32 -46
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarChartCellTextLayoutEditor.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarChartCellTextLayoutEditor.js +35 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarChartCellTextPreview.d.ts +23 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarChartCellTextPreview.js +57 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.d.ts +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.d.ts +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.d.ts +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +3 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.d.ts +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +13 -17
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnChartListPreviews.d.ts +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnChartListPreviews.js +5 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.js +14 -7
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +11 -17
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.d.ts +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +27 -58
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +94 -7
- package/src/View/UIHelper.d.ts +0 -2
- package/src/View/UIHelper.js +8 -23
- package/src/View/Wizard/CollapsibleWizardCard.d.ts +68 -0
- package/src/View/Wizard/CollapsibleWizardCard.js +81 -0
- package/src/View/Wizard/OnePageWizards.js +6 -6
- package/src/View/Wizard/SummaryColorTag.d.ts +24 -0
- package/src/View/Wizard/SummaryColorTag.js +67 -0
- package/src/View/Wizard/WizardTypeSelection.d.ts +34 -0
- package/src/View/Wizard/WizardTypeSelection.js +31 -0
- package/src/View/Wizard/rowGroupSummaryTags.d.ts +18 -0
- package/src/View/Wizard/rowGroupSummaryTags.js +14 -0
- package/src/View/Wizard/scopeSummaryTags.d.ts +6 -0
- package/src/View/Wizard/scopeSummaryTags.js +33 -0
- package/src/agGrid/AgGridAdapter.js +0 -5
- package/src/agGrid/AgGridColumnAdapter.js +4 -3
- package/src/agGrid/cellRenderers/ActionColumnRenderer.js +4 -7
- package/src/agGrid/cellRenderers/BadgeRenderer.js +7 -5
- package/src/agGrid/cellRenderers/BulletChartRenderer.js +43 -42
- package/src/agGrid/cellRenderers/IconRenderer.d.ts +2 -1
- package/src/agGrid/cellRenderers/IconRenderer.js +13 -11
- package/src/agGrid/cellRenderers/PercentBarRenderer.js +24 -96
- package/src/agGrid/cellRenderers/RangeBarRenderer.js +49 -46
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +1 -1
- package/src/components/Card/index.js +5 -6
- package/src/components/CheckBox/index.js +2 -3
- package/src/components/CodeBlock/index.js +2 -2
- package/src/components/ColorPicker/ColorPicker.d.ts +1 -0
- package/src/components/ColorPicker/ColorPicker.js +8 -6
- package/src/components/ColorPicker/OptionalColorPicker.d.ts +12 -0
- package/src/components/ColorPicker/OptionalColorPicker.js +26 -0
- package/src/components/ColorPicker/index.d.ts +1 -0
- package/src/components/ColorPicker/index.js +1 -0
- package/src/components/Combobox/comboboxUtils.d.ts +1 -0
- package/src/components/Combobox/index.js +19 -18
- package/src/components/Dashboard/DashboardManager.js +2 -4
- package/src/components/Dialog/index.js +4 -4
- package/src/components/DragAndDropContext/DragAndDropContext.d.ts +5 -0
- package/src/components/DragAndDropContext/DragAndDropContext.js +3 -0
- package/src/components/DragAndDropContext/ModuleManager.d.ts +15 -3
- package/src/components/DragAndDropContext/ModuleManager.js +47 -8
- package/src/components/DragAndDropContext/TabList.d.ts +11 -4
- package/src/components/DragAndDropContext/TabList.js +52 -38
- package/src/components/DragAndDropContext/UnusedPanel.d.ts +4 -3
- package/src/components/DragAndDropContext/UnusedPanel.js +15 -11
- package/src/components/DragAndDropContext/dragScope.d.ts +6 -0
- package/src/components/DragAndDropContext/dragScope.js +26 -0
- package/src/components/DragAndDropContext/types.d.ts +7 -0
- package/src/components/DropdownButton/index.d.ts +33 -25
- package/src/components/DropdownButton/index.js +24 -158
- package/src/components/EmptyContent/index.js +2 -2
- package/src/components/ErrorBox/index.js +2 -2
- package/src/components/ExpressionEditor/BaseEditorInput.js +3 -3
- package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +3 -3
- package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +6 -6
- package/src/components/FieldWrap/index.js +2 -2
- package/src/components/Flex.js +2 -2
- package/src/components/FormLayout/index.d.ts +1 -1
- package/src/components/HelpBlock/index.js +3 -3
- package/src/components/IconSelector/IconSelector.d.ts +8 -0
- package/src/components/IconSelector/IconSelector.js +11 -7
- package/src/components/IconSelector/index.d.ts +1 -0
- package/src/components/IconSelector/index.js +1 -0
- package/src/components/Modal/index.js +2 -2
- package/src/components/NewSelect/index.js +11 -1
- package/src/components/Panel/index.js +7 -7
- package/src/components/Radio/index.d.ts +1 -1
- package/src/components/Radio/index.js +8 -6
- package/src/components/SimpleButton/index.js +7 -7
- package/src/components/StylePreview.js +2 -2
- package/src/components/Tabs/index.js +4 -4
- package/src/components/Tag/Tag.d.ts +16 -0
- package/src/components/Tag/Tag.js +14 -4
- package/src/components/Tag/columnScopeTagHelpers.d.ts +8 -0
- package/src/components/Tag/columnScopeTagHelpers.js +6 -0
- package/src/components/Tag/index.d.ts +1 -1
- package/src/components/Tag/index.js +1 -1
- package/src/components/Textarea/index.js +2 -3
- package/src/components/Toggle/Toggle.d.ts +2 -0
- package/src/components/Toggle/Toggle.js +14 -7
- package/src/components/Toggle/ToggleGroup.js +2 -2
- package/src/components/ToggleButton/index.js +4 -4
- package/src/components/Tree/TreeDropdown/index.js +3 -4
- package/src/components/WarningBox/index.js +2 -2
- package/src/components/icons/sort-asc.js +1 -1
- package/src/components/ui/button.d.ts +2 -2
- package/src/components/ui/combobox.d.ts +3 -1
- package/src/components/ui/combobox.js +2 -2
- package/src/components/ui/input-group.d.ts +1 -1
- package/src/components/ui/select.js +3 -2
- package/src/components/ui/textarea.js +1 -1
- package/src/env.js +2 -2
- package/src/layout-manager/src/index.js +7 -3
- package/src/metamodel/adaptable.metamodel.d.ts +80 -14
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/migration/VersionUpgrade23.d.ts +27 -31
- package/src/migration/VersionUpgrade23.js +110 -29
- package/src/types.d.ts +13 -2
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.d.ts +0 -17
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +0 -290
- package/src/components/DropdownButton/DropdownButtonItem.d.ts +0 -12
- package/src/components/DropdownButton/renderItem.d.ts +0 -14
- package/src/components/DropdownButton/renderItem.js +0 -11
- package/src/components/DropdownButton/useExpanded.d.ts +0 -24
- package/src/components/DropdownButton/useExpanded.js +0 -56
- package/src/components/NewDropdownButton/index.d.ts +0 -27
- package/src/components/NewDropdownButton/index.js +0 -24
- /package/src/{components/DropdownButton/DropdownButtonItem.js → AdaptableState/StyledColumns/BulletChartStyle.js} +0 -0
|
@@ -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
|
-
|
|
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
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
57
|
-
|
|
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
|
-
|
|
75
|
-
|
|
110
|
+
PivotColumnId: pivotColId,
|
|
111
|
+
ShowTotal: true,
|
|
76
112
|
};
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
|
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
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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:
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
if (
|
|
163
|
-
|
|
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
|
-
|
|
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:
|
|
184
|
-
|
|
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
|
-
|
|
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
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
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
|
-
|
|
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:
|
|
16
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
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:
|
|
17
|
-
|
|
18
|
-
|
|
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 = (
|
|
29
|
-
props.onChange(normalizeLayout(
|
|
31
|
+
const onChange = (nextLayout) => {
|
|
32
|
+
props.onChange(normalizeLayout(nextLayout));
|
|
30
33
|
};
|
|
31
34
|
const handleColumnsChange = (columnIds) => {
|
|
32
|
-
|
|
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
|
-
|
|
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
|
|
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 {};
|