@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,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import DropdownButton from '../../../components/DropdownButton';
|
|
3
2
|
import ErrorBox from '../../../components/ErrorBox';
|
|
4
3
|
import FormLayout, { FormRow } from '../../../components/FormLayout';
|
|
5
|
-
import HelpBlock from '../../../components/HelpBlock';
|
|
6
4
|
import SimpleButton from '../../../components/SimpleButton';
|
|
5
|
+
import { ButtonNew } from '../../Components/Buttons/ButtonNew';
|
|
7
6
|
import { Tag } from '../../../components/Tag';
|
|
7
|
+
import { renderSummaryLabelValueTags, renderSummaryStringTags, } from '../../Wizard/SummaryColorTag';
|
|
8
8
|
import ObjectFactory from '../../../Utilities/ObjectFactory';
|
|
9
9
|
import { AdaptableIconSelector } from '../../Components/AdaptableIconSelector';
|
|
10
10
|
import { PredicateEditor } from '../../Components/PredicateEditor/PredicateEditor';
|
|
@@ -22,6 +22,9 @@ import { getCellBoxStyleSummaryItems, getCellFontStyleSummaryItems, StyledColumn
|
|
|
22
22
|
import { Card } from '../../../components/Card';
|
|
23
23
|
import { useAdaptable } from '../../AdaptableContext';
|
|
24
24
|
import { StyledColumnBadgePreviewCard } from './StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview';
|
|
25
|
+
import { CollapsibleWizardCard, CollapsibleWizardValueSummary, getWizardAccordionSectionClassName, useWizardCardAccordion, } from '../../Wizard/CollapsibleWizardCard';
|
|
26
|
+
import { SingleSelect } from '../../../components/NewSelect';
|
|
27
|
+
import { cn } from '../../../lib/utils';
|
|
25
28
|
const BADGE_STYLE_FORM_SIZES = ['200px', '1fr'];
|
|
26
29
|
const SHAPE_CHOICES = [
|
|
27
30
|
{ value: 'Pill', label: 'Pill' },
|
|
@@ -38,97 +41,106 @@ const OVERFLOW_CHOICES = [
|
|
|
38
41
|
{ value: 'Wrap', label: 'Wrap', hint: 'Wrap onto subsequent lines' },
|
|
39
42
|
{ value: 'Scroll', label: 'Scroll', hint: 'Single line; cell scrolls horizontally' },
|
|
40
43
|
];
|
|
41
|
-
const
|
|
44
|
+
const badgeCardId = (index) => `badge-${index}`;
|
|
45
|
+
const getBadgePreviewValue = (dataType) => dataType === 'number' || dataType === 'numberArray'
|
|
46
|
+
? `${DEFAULT_INTEGER_DISPLAY_VALUE}`
|
|
47
|
+
: DEFAULT_STRING_DISPLAY_VALUE;
|
|
48
|
+
const getBadgeDefinitionSummaryItems = (badge, api) => {
|
|
49
|
+
const items = [];
|
|
50
|
+
let rule = 'Always';
|
|
51
|
+
if (badge.Predicate) {
|
|
52
|
+
rule = api.predicateApi.predicateToString(badge.Predicate);
|
|
53
|
+
}
|
|
54
|
+
else if (badge.Expression) {
|
|
55
|
+
rule = badge.Expression.BooleanExpression;
|
|
56
|
+
}
|
|
57
|
+
items.push({ label: 'Rule', value: rule });
|
|
58
|
+
items.push({ label: 'Shape', value: badge.Shape ?? 'Rounded' });
|
|
59
|
+
items.push(...getBadgePillStyleSummaryItems(badge.PillStyle));
|
|
60
|
+
const iconProps = badge.IconProperties;
|
|
61
|
+
if (iconProps?.Icon) {
|
|
62
|
+
items.push({
|
|
63
|
+
label: 'Icon',
|
|
64
|
+
value: 'name' in iconProps.Icon ? iconProps.Icon.name : 'Custom',
|
|
65
|
+
icon: iconProps.Icon,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
if (iconProps?.IconOnly) {
|
|
69
|
+
items.push({ label: 'Icon Only', value: 'Yes' });
|
|
70
|
+
}
|
|
71
|
+
if (iconProps?.Icon && iconProps.Position) {
|
|
72
|
+
items.push({ label: 'Icon Position', value: iconProps.Position });
|
|
73
|
+
}
|
|
74
|
+
if (typeof iconProps?.Gap === 'number') {
|
|
75
|
+
items.push({ label: 'Icon Gap', value: `${iconProps.Gap}px` });
|
|
76
|
+
}
|
|
77
|
+
return items;
|
|
78
|
+
};
|
|
79
|
+
const BadgePreview = ({ badge, density, previewValue }) => (_jsx(Badge, { pillStyle: badge.PillStyle, icon: badge.IconProperties?.Icon, iconPosition: badge.IconProperties?.Position, shape: badge.Shape, density: density, iconGap: badge.IconProperties?.Gap, children: badge.IconProperties?.IconOnly ? '' : previewValue }));
|
|
80
|
+
const BadgeCardSummary = ({ badge, api }) => (_jsx(CollapsibleWizardValueSummary, { value: renderSummaryLabelValueTags(getBadgeDefinitionSummaryItems(badge, api)) }));
|
|
81
|
+
const BadgeEditorForm = (props) => {
|
|
42
82
|
const { api } = useOnePageAdaptableWizardContext();
|
|
43
|
-
const { badge, columnId, onChange
|
|
83
|
+
const { badge, columnId, onChange } = props;
|
|
44
84
|
const predicateDefs = api.styledColumnApi.internalApi.getBadgePredicateDefsForColumn(columnId);
|
|
45
|
-
const dataType = api.columnApi.getColumnDataTypeForColumnId(columnId);
|
|
46
|
-
const previewValue = dataType === 'number' || dataType == 'numberArray'
|
|
47
|
-
? DEFAULT_INTEGER_DISPLAY_VALUE
|
|
48
|
-
: DEFAULT_STRING_DISPLAY_VALUE;
|
|
49
85
|
const currentShape = badge.Shape ?? 'Rounded';
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
86
|
+
const iconProps = badge.IconProperties;
|
|
87
|
+
const hasIcon = Boolean(iconProps?.Icon);
|
|
88
|
+
const updateIconProperties = (patch) => {
|
|
89
|
+
const next = {
|
|
90
|
+
...(iconProps ?? { Icon: undefined }),
|
|
91
|
+
...patch,
|
|
92
|
+
};
|
|
93
|
+
if (!next.Icon) {
|
|
94
|
+
const cleaned = { ...badge };
|
|
95
|
+
delete cleaned.IconProperties;
|
|
96
|
+
onChange(cleaned);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
onChange({ ...badge, IconProperties: next });
|
|
100
|
+
};
|
|
101
|
+
return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-2", children: [_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Shape" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Define shape of the corners for this badge" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(RadioGroup, { orientation: "horizontal", name: `ab-badge-shape-${columnId}`, value: currentShape, onRadioChange: (value) => onChange({ ...badge, Shape: value }), className: "twa:gap-3", children: SHAPE_CHOICES.map((choice) => (_jsx(Radio, { value: choice.value, children: choice.label }, choice.value))) }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Style" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Colours and font styling for the badge pill" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(BadgePillStyleEditor, { embedded: true, api: api, value: badge.PillStyle, onChange: (next) => {
|
|
102
|
+
if (next) {
|
|
103
|
+
onChange({ ...badge, PillStyle: next });
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
const cleaned = { ...badge };
|
|
107
|
+
delete cleaned.PillStyle;
|
|
108
|
+
onChange(cleaned);
|
|
109
|
+
}
|
|
110
|
+
} }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Rule" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Optional rule for when this badge is displayed \u2014 leave empty for Badge to always show" })] }), _jsx(Card.Body, { className: "twa:p-1", children: columnId ? (_jsx(PredicateEditor, { columnId: columnId, predicate: badge.Predicate, predicateDefs: predicateDefs, placeholder: "No Predicate Selected", onChange: (predicate) => {
|
|
111
|
+
onChange({
|
|
112
|
+
...badge,
|
|
113
|
+
Predicate: predicate,
|
|
114
|
+
});
|
|
115
|
+
}, onClear: () => onChange({
|
|
116
|
+
...badge,
|
|
117
|
+
Predicate: undefined,
|
|
118
|
+
}) })) : (_jsx(ErrorBox, { children: "Select a column first" })) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Icon" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Optional icon inside the badge \u2014 position and spacing apply once an icon is selected" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsxs(FormLayout, { children: [_jsx(FormRow, { label: "Icon", children: !iconProps?.Icon || 'name' in iconProps.Icon ? (_jsx(AdaptableIconSelector, { value: iconProps?.Icon && 'name' in iconProps.Icon ? iconProps.Icon.name : undefined, onChange: (iconName) => {
|
|
119
|
+
if (iconName) {
|
|
120
|
+
updateIconProperties({
|
|
121
|
+
Icon: { name: iconName },
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
const cleaned = { ...badge };
|
|
126
|
+
delete cleaned.IconProperties;
|
|
127
|
+
onChange(cleaned);
|
|
128
|
+
}
|
|
129
|
+
} })) : (_jsx(AdaptableIconComponent, { icon: iconProps.Icon })) }), _jsx(FormRow, { label: "Icon Position", children: _jsx(Box, { className: "twa:max-w-[160px]", children: _jsx(SingleSelect, { disabled: !hasIcon, className: "twa:w-full", value: iconProps?.Position ?? 'Start', onValueChange: (v) => updateIconProperties({ Position: v }), items: [
|
|
130
|
+
{ value: 'Start', label: 'Start' },
|
|
131
|
+
{ value: 'End', label: 'End' },
|
|
132
|
+
] }) }) }), _jsx(FormRow, { label: "Show Icon Only", children: _jsx(CheckBox, { disabled: !hasIcon, checked: iconProps?.IconOnly, onClick: () => updateIconProperties({ IconOnly: !iconProps?.IconOnly }) }) }), _jsx(FormRow, { label: "Icon Gap", children: _jsxs(Flex, { alignItems: "center", className: "twa:gap-2", children: [_jsx(NumberInput, { disabled: !hasIcon || iconProps?.IconOnly, value: iconProps?.Gap ?? '', placeholder: "auto", step: 1, min: 0, style: { width: 70 }, onChange: (value) => {
|
|
133
|
+
updateIconProperties({
|
|
134
|
+
Gap: typeof value === 'number' && value >= 0 ? value : undefined,
|
|
135
|
+
});
|
|
136
|
+
} }), _jsx(Box, { className: "twa:text-xs twa:opacity-70", children: "px between icon and text \u2014 leave blank to follow Density" })] }) })] }) })] })] }));
|
|
97
137
|
};
|
|
98
138
|
export const getStyledColumnBadgeDefinitionViewValueGroups = (styledColumn, api) => {
|
|
99
139
|
const badgeStyle = styledColumn.BadgeStyle;
|
|
100
140
|
if (!badgeStyle?.Badges?.length) {
|
|
101
141
|
return [];
|
|
102
142
|
}
|
|
103
|
-
return badgeStyle.Badges.map((badge,
|
|
104
|
-
const items = [];
|
|
105
|
-
let rule = 'Always';
|
|
106
|
-
if (badge.Predicate) {
|
|
107
|
-
rule = api.predicateApi.predicateToString(badge.Predicate);
|
|
108
|
-
}
|
|
109
|
-
else if (badge.Expression) {
|
|
110
|
-
rule = badge.Expression.BooleanExpression;
|
|
111
|
-
}
|
|
112
|
-
items.push(`Badge ${index + 1}: ${rule}`);
|
|
113
|
-
items.push(`Shape: ${badge.Shape ?? 'Rounded'}`);
|
|
114
|
-
getBadgePillStyleSummaryItems(badge.PillStyle).forEach(({ label, value }) => {
|
|
115
|
-
items.push(`${label}: ${value}`);
|
|
116
|
-
});
|
|
117
|
-
if (badge.Icon) {
|
|
118
|
-
const iconName = 'name' in badge.Icon ? badge.Icon.name : 'Custom';
|
|
119
|
-
items.push(`Icon: ${iconName}`);
|
|
120
|
-
}
|
|
121
|
-
if (badge.IconOnly) {
|
|
122
|
-
items.push('Icon Only: Yes');
|
|
123
|
-
}
|
|
124
|
-
if (badge.Icon && badge.IconPosition) {
|
|
125
|
-
items.push(`Icon Position: ${badge.IconPosition}`);
|
|
126
|
-
}
|
|
127
|
-
if (typeof badge.IconGap === 'number') {
|
|
128
|
-
items.push(`Icon Gap: ${badge.IconGap}px`);
|
|
129
|
-
}
|
|
130
|
-
return items;
|
|
131
|
-
});
|
|
143
|
+
return badgeStyle.Badges.map((badge) => getBadgeDefinitionSummaryItems(badge, api).map(({ label, value }) => `${label}: ${value}`));
|
|
132
144
|
};
|
|
133
145
|
export const getStyledColumnBadgeDefinitionViewValues = (styledColumn, api) => {
|
|
134
146
|
return getStyledColumnBadgeDefinitionViewValueGroups(styledColumn, api).flat();
|
|
@@ -161,40 +173,66 @@ export const getStyledColumnBadgeStyleViewValues = (styledColumn, api) => {
|
|
|
161
173
|
return items;
|
|
162
174
|
};
|
|
163
175
|
export const renderBadgeDefinitionSummaryTags = (styledColumn, api) => {
|
|
164
|
-
const
|
|
165
|
-
if (!
|
|
176
|
+
const badges = styledColumn.BadgeStyle?.Badges;
|
|
177
|
+
if (!badges?.length) {
|
|
166
178
|
return _jsx(Tag, { children: "No Badges Defined" });
|
|
167
179
|
}
|
|
168
|
-
return (_jsx(Flex, { flexDirection: "column", className: "twa:gap-2", children:
|
|
180
|
+
return (_jsx(Flex, { flexDirection: "column", className: "twa:gap-2", children: badges.map((badge, index) => (_jsxs(Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: [_jsxs(Tag, { className: "twa:shrink-0", children: ["Badge ", index + 1] }), renderSummaryLabelValueTags(getBadgeDefinitionSummaryItems(badge, api))] }, index))) }));
|
|
169
181
|
};
|
|
170
182
|
export const StyledColumnBadgeDefinitionsView = ({ data }) => {
|
|
171
183
|
const { api } = useAdaptable();
|
|
172
184
|
return renderBadgeDefinitionSummaryTags(data, api);
|
|
173
185
|
};
|
|
174
186
|
export const renderBadgeSummary = (styledColumn, api) => {
|
|
175
|
-
if (!api) {
|
|
176
|
-
const { api: adaptableApi } = useOnePageAdaptableWizardContext();
|
|
177
|
-
api = adaptableApi;
|
|
178
|
-
}
|
|
179
187
|
return renderBadgeDefinitionSummaryTags(styledColumn, api);
|
|
180
188
|
};
|
|
181
189
|
export const StyledColumnBadgeSection = (props) => {
|
|
182
|
-
const { data } = useOnePageAdaptableWizardContext();
|
|
190
|
+
const { data, api } = useOnePageAdaptableWizardContext();
|
|
183
191
|
const badgeStyle = data?.BadgeStyle ?? {};
|
|
184
192
|
const badges = badgeStyle.Badges ?? [];
|
|
185
193
|
const currentDensity = badgeStyle.Density ?? 'Normal';
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
const dataType = data.ColumnId
|
|
195
|
+
? api.columnApi.getColumnDataTypeForColumnId(data.ColumnId)
|
|
196
|
+
: 'text';
|
|
197
|
+
const previewValue = getBadgePreviewValue(dataType);
|
|
198
|
+
const { bindCard, hasExpandedCard, expandedFillsSpace, expandedId, setExpandedId } = useWizardCardAccordion(null);
|
|
199
|
+
const handleAddBadge = () => {
|
|
200
|
+
const newIndex = badges.length;
|
|
201
|
+
props.onChange({
|
|
202
|
+
...data,
|
|
203
|
+
BadgeStyle: {
|
|
204
|
+
...badgeStyle,
|
|
205
|
+
Badges: [...badges, ObjectFactory.CreateDefaultStyledColumnBadge()],
|
|
206
|
+
},
|
|
207
|
+
});
|
|
208
|
+
setExpandedId(badgeCardId(newIndex));
|
|
209
|
+
};
|
|
210
|
+
const handleDeleteBadge = (index) => {
|
|
211
|
+
const cardId = badgeCardId(index);
|
|
212
|
+
const newBadges = [...badges];
|
|
213
|
+
newBadges.splice(index, 1);
|
|
214
|
+
props.onChange({
|
|
215
|
+
...data,
|
|
216
|
+
BadgeStyle: {
|
|
217
|
+
...badgeStyle,
|
|
218
|
+
Badges: newBadges,
|
|
219
|
+
},
|
|
220
|
+
});
|
|
221
|
+
if (expandedId === cardId) {
|
|
222
|
+
setExpandedId(null);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (expandedId?.startsWith('badge-')) {
|
|
226
|
+
const expandedIndex = Number(expandedId.replace('badge-', ''));
|
|
227
|
+
if (!Number.isNaN(expandedIndex) && expandedIndex > index) {
|
|
228
|
+
setExpandedId(badgeCardId(expandedIndex - 1));
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
return (_jsxs(Box, { className: cn(getWizardAccordionSectionClassName(hasExpandedCard, expandedFillsSpace), 'twa:p-2'), children: [_jsx(Flex, { className: "twa:justify-end twa:mb-2 twa:shrink-0", children: _jsx(ButtonNew, { onClick: handleAddBadge, children: "Add Badge" }) }), _jsx(Flex, { flexDirection: "column", className: "twa:gap-3 twa:min-h-0", children: badges.map((badge, index) => {
|
|
233
|
+
const handleEditBadge = (nextBadge) => {
|
|
196
234
|
const newBadges = [...badges];
|
|
197
|
-
newBadges[index] =
|
|
235
|
+
newBadges[index] = nextBadge;
|
|
198
236
|
props.onChange({
|
|
199
237
|
...data,
|
|
200
238
|
BadgeStyle: {
|
|
@@ -203,17 +241,7 @@ export const StyledColumnBadgeSection = (props) => {
|
|
|
203
241
|
},
|
|
204
242
|
});
|
|
205
243
|
};
|
|
206
|
-
return (_jsx(
|
|
207
|
-
const newBadges = [...badges];
|
|
208
|
-
newBadges.splice(index, 1);
|
|
209
|
-
props.onChange({
|
|
210
|
-
...data,
|
|
211
|
-
BadgeStyle: {
|
|
212
|
-
...badgeStyle,
|
|
213
|
-
Badges: newBadges,
|
|
214
|
-
},
|
|
215
|
-
});
|
|
216
|
-
} }, index));
|
|
244
|
+
return (_jsx(CollapsibleWizardCard, { ...bindCard(badgeCardId(index)), surface: "panel", "data-name": `styled-column-badge-${index}`, title: `Badge ${index + 1}`, collapsedHelp: false, headerVisual: _jsx(BadgePreview, { badge: badge, density: currentDensity, previewValue: previewValue }), headerActions: _jsx(SimpleButton, { icon: "delete", variant: "text", tooltip: "Delete badge", onClick: () => handleDeleteBadge(index) }), summary: _jsx(BadgeCardSummary, { badge: badge, api: api }), bodyClassName: "twa:!pt-0 twa:overflow-y-auto", children: _jsx(BadgeEditorForm, { badge: badge, columnId: data.ColumnId, onChange: handleEditBadge }) }, badgeCardId(index)));
|
|
217
245
|
}) })] }));
|
|
218
246
|
};
|
|
219
247
|
export const StyledColumnBadgeStyleSection = (props) => {
|
|
@@ -260,13 +288,9 @@ export const StyledColumnBadgeStyleSection = (props) => {
|
|
|
260
288
|
} }) })] })] }), _jsx(StyledColumnBadgePreviewCard, { data: data })] }));
|
|
261
289
|
};
|
|
262
290
|
export const renderBadgeStyleSummary = (styledColumn, api) => {
|
|
263
|
-
if (!api) {
|
|
264
|
-
const { api: adaptableApi } = useOnePageAdaptableWizardContext();
|
|
265
|
-
api = adaptableApi;
|
|
266
|
-
}
|
|
267
291
|
const items = getStyledColumnBadgeStyleViewValues(styledColumn, api);
|
|
268
292
|
if (!items.length) {
|
|
269
293
|
return _jsx(Tag, { children: "No Style Defined" });
|
|
270
294
|
}
|
|
271
|
-
return (
|
|
295
|
+
return renderSummaryStringTags(items);
|
|
272
296
|
};
|
|
@@ -13,9 +13,7 @@ export interface StyledColumnFontStyleEditorProps {
|
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
/**
|
|
15
15
|
* When true, the Alignment row is omitted entirely. Used by Styled Columns
|
|
16
|
-
* that own horizontal alignment elsewhere (e.g.
|
|
17
|
-
* Center / Right" controls drive `CellTextAlignment`, so showing a second
|
|
18
|
-
* Alignment row inside the font editor is confusing).
|
|
16
|
+
* that own horizontal alignment elsewhere (e.g. Badge row layout).
|
|
19
17
|
*/
|
|
20
18
|
hideAlignment?: boolean;
|
|
21
19
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import { ColorPicker } from '../../../components/ColorPicker';
|
|
3
|
+
import { OptionalColorPicker } from '../../../components/ColorPicker';
|
|
5
4
|
import FormLayout, { FormRow } from '../../../components/FormLayout';
|
|
6
5
|
import { Box, Flex } from '../../../components/Flex';
|
|
7
6
|
import { NumberInput } from '../../../components/Input/NumberInput';
|
|
8
7
|
import { SingleSelect } from '../../../components/NewSelect';
|
|
9
|
-
import {
|
|
8
|
+
import { renderSummaryLabelValueTags } from '../../Wizard/SummaryColorTag';
|
|
10
9
|
import { Toggle, ToggleGroup } from '../../../components/Toggle';
|
|
11
10
|
const FORM_SIZES = ['200px', '1fr'];
|
|
12
11
|
const FONT_SIZE_ITEMS = [
|
|
@@ -46,18 +45,13 @@ export const StyledColumnFontStyleEditor = (props) => {
|
|
|
46
45
|
props.onChange(next);
|
|
47
46
|
}
|
|
48
47
|
};
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
update({ ForeColor: font.ForeColor ?? '#000000' });
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
update({ ForeColor: undefined });
|
|
55
|
-
}
|
|
48
|
+
const onForeColorChange = (color) => {
|
|
49
|
+
update({ ForeColor: color });
|
|
56
50
|
};
|
|
57
51
|
const onAlignmentChange = (alignment) => {
|
|
58
52
|
update({ Alignment: alignment });
|
|
59
53
|
};
|
|
60
|
-
return (_jsx(Box, { children: _jsxs(FormLayout, { className: "twa:ml-2", sizes: [...FORM_SIZES], children: [_jsx(FormRow, { label: "Text Colour:", children:
|
|
54
|
+
return (_jsx(Box, { children: _jsxs(FormLayout, { className: "twa:ml-2", sizes: [...FORM_SIZES], children: [_jsx(FormRow, { label: "Text Colour:", children: _jsx(OptionalColorPicker, { className: "twa:ml-2", disabled: disabled, api: props.api, value: font.ForeColor, defaultColor: "#000000", onChange: onForeColorChange }) }), _jsx(FormRow, { label: "Font:", children: _jsx(Box, { className: disabledClass, children: _jsxs(Flex, { alignItems: "center", className: "twa:ml-2 twa:gap-2 twa:flex-wrap", children: [_jsxs(Flex, { alignItems: "center", className: "twa:gap-2", children: [_jsx(Toggle, { standalone: true, pressed: font.FontStyle === 'Italic', onPressedChange: (pressed) => update({ FontStyle: pressed ? 'Italic' : undefined }), icon: "italic" }), _jsx(Toggle, { standalone: true, pressed: font.FontWeight === 'Bold', onPressedChange: (pressed) => update({ FontWeight: pressed ? 'Bold' : undefined }), icon: "bold" })] }), _jsxs(ToggleGroup, { children: [_jsx(Toggle, { pressed: font.TextDecoration === 'Underline', onPressedChange: (pressed) => update({ TextDecoration: pressed ? 'Underline' : undefined }), icon: "underline" }), _jsx(Toggle, { pressed: font.TextDecoration === 'LineThrough', onPressedChange: (pressed) => update({ TextDecoration: pressed ? 'LineThrough' : undefined }), icon: "strikethrough" }), _jsx(Toggle, { pressed: font.TextDecoration === 'Overline', onPressedChange: (pressed) => update({ TextDecoration: pressed ? 'Overline' : undefined }), icon: "overline" })] }), _jsx(Box, { className: "twa:w-32", children: _jsx(SingleSelect, { placeholder: "Default size", items: FONT_SIZE_ITEMS, value: font.FontSize ?? '', onValueChange: (value) => update({
|
|
61
55
|
FontSize: (value || undefined),
|
|
62
56
|
}) }) })] }) }) }), !hideAlignment && (_jsx(FormRow, { label: "Alignment:", children: _jsx(Box, { className: disabledClass, children: _jsx(Flex, { alignItems: "center", className: "twa:ml-2 twa:gap-2", children: _jsxs(ToggleGroup, { children: [_jsx(Toggle, { icon: "align-left", pressed: font.Alignment === 'Left', onPressedChange: (pressed) => onAlignmentChange(pressed ? 'Left' : undefined) }), _jsx(Toggle, { icon: "align-center", pressed: font.Alignment === 'Center', onPressedChange: (pressed) => onAlignmentChange(pressed ? 'Center' : undefined) }), _jsx(Toggle, { icon: "align-right", pressed: font.Alignment === 'Right', onPressedChange: (pressed) => onAlignmentChange(pressed ? 'Right' : undefined) })] }) }) }) }))] }) }));
|
|
63
57
|
};
|
|
@@ -88,7 +82,7 @@ export const StyledColumnCellStyleEditor = (props) => {
|
|
|
88
82
|
props.onChange(next);
|
|
89
83
|
}
|
|
90
84
|
};
|
|
91
|
-
return (_jsx(Box, { children: _jsxs(FormLayout, { className: "twa:ml-2", sizes: [...FORM_SIZES], children: [_jsx(FormRow, { label: "Background:", children:
|
|
85
|
+
return (_jsx(Box, { children: _jsxs(FormLayout, { className: "twa:ml-2", sizes: [...FORM_SIZES], children: [_jsx(FormRow, { label: "Background:", children: _jsx(OptionalColorPicker, { className: "twa:ml-2", disabled: disabled, api: props.api, value: cell.BackColor, defaultColor: "#ffffff", onChange: (c) => update({ BackColor: c }) }) }), _jsx(FormRow, { label: "Border colour:", children: _jsx(OptionalColorPicker, { className: "twa:ml-2", disabled: disabled, api: props.api, value: cell.BorderColor, defaultColor: "#000000", onChange: (c) => update({ BorderColor: c }) }) }), _jsx(FormRow, { label: "Border radius:", children: _jsxs(Flex, { alignItems: "center", className: "twa:ml-2 twa:gap-2", children: [_jsx(NumberInput, { disabled: disabled, className: "twa:w-20", value: cell.BorderRadius, min: 0, max: 64, step: 1, onChange: (v) => update({ BorderRadius: v === undefined || isNaN(Number(v)) ? undefined : v }) }), _jsx(Box, { className: "twa:text-xs twa:opacity-70", children: "px" })] }) })] }) }));
|
|
92
86
|
};
|
|
93
87
|
/**
|
|
94
88
|
* Descriptive font properties for summary panels (`Label: value` strings).
|
|
@@ -126,7 +120,7 @@ export const renderFontStyleSummaryTags = (font) => {
|
|
|
126
120
|
if (!items.length) {
|
|
127
121
|
return null;
|
|
128
122
|
}
|
|
129
|
-
return (
|
|
123
|
+
return renderSummaryLabelValueTags(items);
|
|
130
124
|
};
|
|
131
125
|
/**
|
|
132
126
|
* Descriptive cell box properties for summary panels (`Label: value` strings).
|
|
@@ -155,5 +149,5 @@ export const renderCellStyleSummaryTags = (cell) => {
|
|
|
155
149
|
if (!items.length) {
|
|
156
150
|
return null;
|
|
157
151
|
}
|
|
158
|
-
return (
|
|
152
|
+
return renderSummaryLabelValueTags(items);
|
|
159
153
|
};
|
|
@@ -4,6 +4,7 @@ import { SingleSelect } from '../../../components/NewSelect';
|
|
|
4
4
|
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
5
5
|
import FormLayout, { FormRow } from '../../../components/FormLayout';
|
|
6
6
|
import { Tag } from '../../../components/Tag';
|
|
7
|
+
import { renderSummaryStringTags } from '../../Wizard/SummaryColorTag';
|
|
7
8
|
import AdaptableInput from '../../Components/AdaptableInput';
|
|
8
9
|
import { ColorPicker } from '../../../components/ColorPicker';
|
|
9
10
|
import { CheckBox } from '../../../components/CheckBox';
|
|
@@ -95,7 +96,7 @@ export const renderSparklineSummary = (data) => {
|
|
|
95
96
|
const items = buildStyledColumnSparklineStyleSummaryStrings(sparkline, {
|
|
96
97
|
includeEmptyFeatures: true,
|
|
97
98
|
});
|
|
98
|
-
return (
|
|
99
|
+
return renderSummaryStringTags(items);
|
|
99
100
|
};
|
|
100
101
|
/**
|
|
101
102
|
* Validation for the Sparkline Settings wizard step.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type StyledColumnTypeThumbnailKey = 'gradient' | 'percent' | 'sparkline' | 'badge' | 'bullet' | 'rating' | 'rangeBar' | 'icon';
|
|
3
|
+
export declare const StyledColumnTypeThumbnail: React.FunctionComponent<{
|
|
4
|
+
type: StyledColumnTypeThumbnailKey;
|
|
5
|
+
}>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from '../../../components/Flex';
|
|
3
|
+
import { Badge } from '../../Components/Badge';
|
|
4
|
+
import { RatingPreview } from './StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview';
|
|
5
|
+
import { WIZARD_TYPE_SELECTION_PREVIEW_FRAME_CLASS } from '../../Wizard/WizardTypeSelection';
|
|
6
|
+
const THUMBNAIL_FRAME_CLASS = WIZARD_TYPE_SELECTION_PREVIEW_FRAME_CLASS;
|
|
7
|
+
const THUMBNAIL_SVG_CLASS = 'twa:block twa:h-[22px] twa:w-full';
|
|
8
|
+
const DEFAULT_BAR = 'var(--ab-color-accent, #07c)';
|
|
9
|
+
const DEFAULT_TRACK = 'color-mix(in srgb, var(--ab-color-foreground) 30%, transparent)';
|
|
10
|
+
const DEFAULT_MARKER = 'var(--ab-color-foreground, #333)';
|
|
11
|
+
const flagEmoji = (countryCodeAlpha2) => {
|
|
12
|
+
const cc = countryCodeAlpha2.toUpperCase();
|
|
13
|
+
if (cc.length !== 2) {
|
|
14
|
+
return cc;
|
|
15
|
+
}
|
|
16
|
+
const regionalIndicatorBase = 0x1f1a5;
|
|
17
|
+
return String.fromCodePoint(regionalIndicatorBase + cc.charCodeAt(0), regionalIndicatorBase + cc.charCodeAt(1));
|
|
18
|
+
};
|
|
19
|
+
const BadgeThumbnail = () => (_jsx(Box, { className: `${THUMBNAIL_FRAME_CLASS} twa:justify-start`, children: _jsxs("div", { className: "ab-Badge__wrapper ab-Badge__wrapper--truncate", style: { gap: 4 }, children: [_jsx(Badge, { pillStyle: { BackColor: '#e8f5e9', ForeColor: '#2e7d32' }, shape: "Pill", density: "Compact", children: "Buy" }), _jsx(Badge, { pillStyle: { BackColor: '#ffebee', ForeColor: '#c62828' }, shape: "Pill", density: "Compact", children: "Sell" })] }) }));
|
|
20
|
+
const IconThumbnail = () => (_jsx(Box, { className: THUMBNAIL_FRAME_CLASS, style: { gap: 10 }, children: ['US', 'GB', 'FR'].map((code) => (_jsx("span", { className: "ab-IconStyle__glyph", style: {
|
|
21
|
+
fontSize: 18,
|
|
22
|
+
lineHeight: 1,
|
|
23
|
+
display: 'inline-flex',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
justifyContent: 'center',
|
|
26
|
+
}, children: flagEmoji(code) }, code))) }));
|
|
27
|
+
const RatingThumbnail = () => (_jsx(Box, { className: THUMBNAIL_FRAME_CLASS, children: _jsx(RatingPreview, { rating: { Max: 5, AllowHalf: true }, value: 3.5 }) }));
|
|
28
|
+
const GradientThumbnail = () => (_jsx(Box, { className: `${THUMBNAIL_FRAME_CLASS} twa:gap-1 twa:px-1`, children: [
|
|
29
|
+
{ label: '42', background: '#63be7b' },
|
|
30
|
+
{ label: '68', background: '#ffeb84' },
|
|
31
|
+
{ label: '91', background: '#f8696b' },
|
|
32
|
+
].map((cell) => (_jsx(Box, { className: "twa:flex-1 twa:rounded-sm twa:px-1 twa:py-0.5 twa:text-center twa:text-2 twa:leading-tight", style: { background: cell.background, color: '#1a1a1a' }, children: cell.label }, cell.label))) }));
|
|
33
|
+
const PercentBarThumbnail = () => (_jsx(Box, { className: THUMBNAIL_FRAME_CLASS, children: _jsx(Box, { className: "twa:relative twa:h-[6px] twa:w-full twa:rounded-sm", style: { background: DEFAULT_TRACK }, children: _jsx(Box, { className: "twa:absolute twa:top-0 twa:h-full twa:rounded-sm", style: { left: '8%', width: '62%', background: DEFAULT_BAR } }) }) }));
|
|
34
|
+
const BulletThumbnail = () => (_jsx(Box, { className: THUMBNAIL_FRAME_CLASS, children: _jsxs("svg", { className: THUMBNAIL_SVG_CLASS, viewBox: "0 0 100 22", preserveAspectRatio: "none", "aria-hidden": true, children: [_jsx("rect", { x: "0", y: "2", width: "33", height: "18", fill: "#f8696b", opacity: "0.45" }), _jsx("rect", { x: "33", y: "2", width: "34", height: "18", fill: "#ffeb84", opacity: "0.45" }), _jsx("rect", { x: "67", y: "2", width: "33", height: "18", fill: "#63be7b", opacity: "0.45" }), _jsx("rect", { x: "4", y: "7", width: "52", height: "8", rx: "1", fill: DEFAULT_BAR }), _jsx("line", { x1: "78", y1: "3", x2: "78", y2: "19", stroke: DEFAULT_MARKER, strokeWidth: "2.5", vectorEffect: "non-scaling-stroke" })] }) }));
|
|
35
|
+
const RangeBarThumbnail = () => (_jsx(Box, { className: THUMBNAIL_FRAME_CLASS, children: _jsxs("svg", { className: THUMBNAIL_SVG_CLASS, viewBox: "0 0 100 22", preserveAspectRatio: "none", "aria-hidden": true, children: [_jsx("rect", { x: "0", y: "0", width: "100", height: "22", fill: "transparent" }), _jsx("rect", { x: "2", y: "8", width: "96", height: "6", rx: "1", fill: DEFAULT_TRACK }), _jsx("line", { x1: "38", y1: "4", x2: "38", y2: "18", stroke: DEFAULT_MARKER, strokeWidth: "2", vectorEffect: "non-scaling-stroke" }), _jsx("polygon", { points: "72,4 82,11 72,18", fill: DEFAULT_BAR })] }) }));
|
|
36
|
+
const SparklineThumbnail = () => (_jsx(Box, { className: THUMBNAIL_FRAME_CLASS, children: _jsxs("svg", { className: THUMBNAIL_SVG_CLASS, viewBox: "0 0 100 22", preserveAspectRatio: "none", "aria-hidden": true, children: [_jsx("polyline", { points: "0,16 12,12 24,14 36,8 48,10 60,4 72,7 84,3 100,6", fill: "none", stroke: DEFAULT_BAR, strokeWidth: "1.75", vectorEffect: "non-scaling-stroke" }), _jsx("polygon", { points: "0,22 0,16 12,12 24,14 36,8 48,10 60,4 72,7 84,3 100,6 100,22", fill: DEFAULT_BAR, opacity: "0.15" })] }) }));
|
|
37
|
+
const THUMBNAIL_BY_TYPE = {
|
|
38
|
+
badge: BadgeThumbnail,
|
|
39
|
+
icon: IconThumbnail,
|
|
40
|
+
rating: RatingThumbnail,
|
|
41
|
+
gradient: GradientThumbnail,
|
|
42
|
+
percent: PercentBarThumbnail,
|
|
43
|
+
bullet: BulletThumbnail,
|
|
44
|
+
rangeBar: RangeBarThumbnail,
|
|
45
|
+
sparkline: SparklineThumbnail,
|
|
46
|
+
};
|
|
47
|
+
export const StyledColumnTypeThumbnail = ({ type }) => {
|
|
48
|
+
const Thumbnail = THUMBNAIL_BY_TYPE[type];
|
|
49
|
+
return (_jsx(Box, { "aria-hidden": true, className: "twa:w-full", children: _jsx(Thumbnail, {}) }));
|
|
50
|
+
};
|
|
@@ -4,4 +4,6 @@ import { StyledColumn } from '../../../AdaptableState/StyledColumnState';
|
|
|
4
4
|
export interface StyledColumnWizardProps extends AdaptableOnePageWizardProps<StyledColumn> {
|
|
5
5
|
isNew: boolean;
|
|
6
6
|
}
|
|
7
|
+
/** First wizard step to open when editing an existing Styled Column (column menu, settings list, etc.). */
|
|
8
|
+
export declare const getStyledColumnEditDefaultSectionName: (styledColumn: StyledColumn) => string;
|
|
7
9
|
export declare const StyledColumnWizard: (props: StyledColumnWizardProps) => React.JSX.Element;
|
|
@@ -53,10 +53,33 @@ const computeDefaultStyledColumnName = (sc) => {
|
|
|
53
53
|
}
|
|
54
54
|
return `${typeKey}-${sc.ColumnId || 'column'}`;
|
|
55
55
|
};
|
|
56
|
+
/** First wizard step to open when editing an existing Styled Column (column menu, settings list, etc.). */
|
|
57
|
+
export const getStyledColumnEditDefaultSectionName = (styledColumn) => {
|
|
58
|
+
if (styledColumn.BadgeStyle) {
|
|
59
|
+
return 'Badges';
|
|
60
|
+
}
|
|
61
|
+
if (styledColumn.GradientStyle || styledColumn.PercentBarStyle) {
|
|
62
|
+
return 'Ranges';
|
|
63
|
+
}
|
|
64
|
+
if (styledColumn.BulletChartStyle) {
|
|
65
|
+
return 'Ranges';
|
|
66
|
+
}
|
|
67
|
+
if (styledColumn.RangeBarStyle) {
|
|
68
|
+
return 'Style';
|
|
69
|
+
}
|
|
70
|
+
if (styledColumn.IconStyle) {
|
|
71
|
+
return 'Mappings';
|
|
72
|
+
}
|
|
73
|
+
return 'Style';
|
|
74
|
+
};
|
|
56
75
|
export const StyledColumnWizard = (props) => {
|
|
57
76
|
const data = props.data ?? props.popupParams?.value;
|
|
58
77
|
const popupDefaultCurrentSectionName = props?.popupParams?.config?.defaultCurrentSectionName ?? undefined;
|
|
59
|
-
const
|
|
78
|
+
const hasExistingData = Boolean(data);
|
|
79
|
+
const isEdit = hasExistingData && props.popupParams?.action !== 'New';
|
|
80
|
+
const defaultCurrentSectionName = props.defaultCurrentSectionName ??
|
|
81
|
+
popupDefaultCurrentSectionName ??
|
|
82
|
+
(isEdit ? getStyledColumnEditDefaultSectionName(data) : undefined);
|
|
60
83
|
const allStyledColumns = useSelector((state) => state.StyledColumn?.StyledColumns ?? []);
|
|
61
84
|
const [styledColumn, setStyledColumn] = useState(() => {
|
|
62
85
|
if (data) {
|
|
@@ -111,7 +134,7 @@ export const StyledColumnWizard = (props) => {
|
|
|
111
134
|
}
|
|
112
135
|
else if (styledColumn.GradientStyle || styledColumn.PercentBarStyle) {
|
|
113
136
|
specificSteps.push({
|
|
114
|
-
details: '
|
|
137
|
+
details: 'Select type of Cell Range and configure contents',
|
|
115
138
|
renderSummary: renderStyledColumnRangesSummary,
|
|
116
139
|
render: () => (_jsx(Box, { className: "twa:p-2", children: _jsx(StyledColumnWizardRangesSection, { onChange: setStyledColumn }) })),
|
|
117
140
|
title: 'Ranges',
|
|
@@ -269,9 +292,7 @@ export const StyledColumnWizard = (props) => {
|
|
|
269
292
|
isValid: isValidStyledColumnScope,
|
|
270
293
|
renderSummary: renderStyledColumnScopeSummary,
|
|
271
294
|
details: 'Select the Column and Rows where Style should render',
|
|
272
|
-
render: () => {
|
|
273
|
-
return (_jsx(Box, { className: "twa:p-2 twa:h-full", children: _jsx(StyledColumnWizardScopeSection, { isNew: props.isNew, onChange: setStyledColumn }) }));
|
|
274
|
-
},
|
|
295
|
+
render: () => (_jsx(StyledColumnWizardScopeSection, { isNew: props.isNew, onChange: setStyledColumn })),
|
|
275
296
|
title: 'Scope',
|
|
276
297
|
},
|
|
277
298
|
...specificSteps,
|