@adaptabletools/adaptable-cjs 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 +0 -10
- package/src/AdaptableState/StyledColumns/BadgeStyle.d.ts +143 -0
- package/src/AdaptableState/StyledColumns/BadgeStyle.js +12 -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 +7 -0
- package/src/AdaptableState/StyledColumns/Common/BarChartMarker.d.ts +24 -0
- package/src/AdaptableState/StyledColumns/Common/BarChartMarker.js +6 -0
- package/src/AdaptableState/StyledColumns/Common/CellTextOptions.d.ts +13 -0
- package/src/AdaptableState/StyledColumns/Common/CellTextOptions.js +7 -0
- package/src/AdaptableState/StyledColumns/Common/NumericStyledColumn.d.ts +79 -0
- package/src/AdaptableState/StyledColumns/Common/NumericStyledColumn.js +10 -0
- package/src/AdaptableState/StyledColumns/GradientStyle.d.ts +48 -0
- package/src/AdaptableState/StyledColumns/GradientStyle.js +2 -0
- package/src/AdaptableState/StyledColumns/IconStyle.d.ts +158 -0
- package/src/AdaptableState/StyledColumns/IconStyle.js +2 -0
- package/src/AdaptableState/StyledColumns/PercentBarStyle.d.ts +32 -0
- package/src/AdaptableState/StyledColumns/PercentBarStyle.js +2 -0
- package/src/AdaptableState/StyledColumns/RangeBarStyle.d.ts +155 -0
- package/src/AdaptableState/StyledColumns/RangeBarStyle.js +2 -0
- package/src/AdaptableState/StyledColumns/RatingStyle.d.ts +111 -0
- package/src/AdaptableState/StyledColumns/RatingStyle.js +2 -0
- package/src/AdaptableState/StyledColumns/SparklineStyle.d.ts +21 -0
- package/src/AdaptableState/StyledColumns/SparklineStyle.js +2 -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 +1 -1
- 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 +11 -28
- 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 +17 -1
- package/src/Strategy/Utilities/Export/getExportRowsViewItems.d.ts +1 -0
- package/src/Strategy/Utilities/Export/getExportRowsViewItems.js +5 -1
- package/src/Strategy/Utilities/Layout/aggregationSummaryHelpers.d.ts +11 -0
- package/src/Strategy/Utilities/Layout/aggregationSummaryHelpers.js +111 -0
- package/src/Strategy/Utilities/Layout/columnsSummaryHelpers.d.ts +48 -0
- package/src/Strategy/Utilities/Layout/columnsSummaryHelpers.js +177 -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 +97 -0
- package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +3 -5
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +48 -42
- 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 +30 -1
- package/src/Utilities/Helpers/StyledColumnGradientHelper.d.ts +3 -1
- package/src/Utilities/Helpers/StyledColumnGradientHelper.js +6 -4
- package/src/Utilities/Helpers/barChartCellText.d.ts +63 -0
- package/src/Utilities/Helpers/barChartCellText.js +333 -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 +19 -0
- package/src/Utilities/getScopeViewItems.js +2 -0
- package/src/Utilities/wizardSelection.d.ts +10 -0
- package/src/Utilities/wizardSelection.js +22 -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 +1 -6
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +159 -125
- 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 +30 -7
- package/src/View/Alert/Wizard/AlertWizard.js +12 -4
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.d.ts +2 -1
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +3 -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 +29 -3
- 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 -3
- 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 +6 -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 +15 -3
- 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 +3 -8
- 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 +3 -3
- 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 -4
- package/src/View/Components/Popups/AdaptablePopup/TopBar.js +2 -3
- package/src/View/Components/Popups/AdaptablePopup/settingsPanelNavigationTypes.d.ts +11 -0
- package/src/View/Components/Popups/AdaptablePopup/settingsPanelNavigationTypes.js +5 -0
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.d.ts +3 -1
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +27 -28
- 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 -3
- 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 +30 -63
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +9 -6
- package/src/View/Components/ToolPanel/ToolPanelPopup.d.ts +3 -13
- package/src/View/Components/ToolPanel/ToolPanelPopup.js +5 -80
- package/src/View/Components/ToolPanel/ToolPanelPopupSections.d.ts +17 -0
- package/src/View/Components/ToolPanel/ToolPanelPopupSections.js +81 -0
- package/src/View/Components/ValueSelector/index.d.ts +29 -0
- package/src/View/Components/ValueSelector/index.js +112 -29
- package/src/View/Components/wizardColumnListStyles.d.ts +10 -0
- package/src/View/Components/wizardColumnListStyles.js +13 -0
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.d.ts +2 -1
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +4 -6
- 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 +73 -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 +99 -0
- package/src/View/DataChangeHistory/buildActionColumnButton.d.ts +5 -3
- package/src/View/DataChangeHistory/buildActionColumnButton.js +33 -41
- package/src/View/DataChangeHistory/dataChangeHistoryHelpers.d.ts +15 -0
- package/src/View/DataChangeHistory/dataChangeHistoryHelpers.js +46 -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 +4 -5
- 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 +2 -7
- package/src/View/Export/Wizard/ReportRowsWizardSection.d.ts +2 -1
- package/src/View/Export/Wizard/ReportRowsWizardSection.js +2 -5
- package/src/View/Filter/FilterViewPanel.js +1 -1
- package/src/View/FlashingCell/FlashingCellStyle.d.ts +4 -2
- package/src/View/FlashingCell/FlashingCellStyle.js +5 -3
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.d.ts +2 -1
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +5 -9
- package/src/View/FlashingCell/Wizard/FlashingCellScopeSummary.d.ts +9 -0
- package/src/View/FlashingCell/Wizard/FlashingCellScopeSummary.js +10 -0
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.d.ts +1 -1
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +5 -1
- package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.d.ts +0 -5
- package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +3 -8
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +1 -2
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +101 -44
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +0 -1
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +1 -6
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +55 -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 -9
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +4 -9
- 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 -3
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +2 -2
- package/src/View/Layout/LayoutViewPanel.js +2 -2
- 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 +77 -33
- package/src/View/Layout/Wizard/sections/ColumnsSection.d.ts +4 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +154 -275
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +4 -1
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +146 -143
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.d.ts +5 -2
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +22 -10
- package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.d.ts +4 -1
- package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +21 -10
- package/src/View/Layout/Wizard/sections/RowGroupingSection.d.ts +5 -2
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +23 -12
- package/src/View/Layout/Wizard/sections/RowSelectionSection.js +7 -3
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +130 -104
- package/src/View/Layout/Wizard/sections/SortSection.d.ts +12 -2
- package/src/View/Layout/Wizard/sections/SortSection.js +43 -18
- package/src/View/Layout/Wizard/sections/columnLayoutCards.d.ts +20 -0
- package/src/View/Layout/Wizard/sections/columnLayoutCards.js +167 -0
- package/src/View/Layout/Wizard/sections/columnLayoutHelpers.d.ts +30 -0
- package/src/View/Layout/Wizard/sections/columnLayoutHelpers.js +216 -0
- package/src/View/Layout/Wizard/sections/layoutWizardAccordionHelpers.d.ts +8 -0
- package/src/View/Layout/Wizard/sections/layoutWizardAccordionHelpers.js +72 -0
- package/src/View/Layout/Wizard/sections/layoutWizardColumns.d.ts +11 -0
- package/src/View/Layout/Wizard/sections/layoutWizardColumns.js +57 -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 -13
- 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 +11 -0
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +3 -1
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +13 -10
- 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 +7 -13
- 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 +54 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.d.ts +2 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +28 -6
- 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 +172 -75
- 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 +31 -45
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarChartCellTextLayoutEditor.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarChartCellTextLayoutEditor.js +40 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarChartCellTextPreview.d.ts +23 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarChartCellTextPreview.js +62 -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 +13 -6
- 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 +26 -57
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +93 -6
- package/src/View/UIHelper.d.ts +0 -2
- package/src/View/UIHelper.js +8 -24
- package/src/View/Wizard/CollapsibleWizardCard.d.ts +68 -0
- package/src/View/Wizard/CollapsibleWizardCard.js +90 -0
- package/src/View/Wizard/OnePageWizards.js +6 -6
- package/src/View/Wizard/SummaryColorTag.d.ts +24 -0
- package/src/View/Wizard/SummaryColorTag.js +79 -0
- package/src/View/Wizard/WizardTypeSelection.d.ts +34 -0
- package/src/View/Wizard/WizardTypeSelection.js +40 -0
- package/src/View/Wizard/rowGroupSummaryTags.d.ts +18 -0
- package/src/View/Wizard/rowGroupSummaryTags.js +21 -0
- package/src/View/Wizard/scopeSummaryTags.d.ts +6 -0
- package/src/View/Wizard/scopeSummaryTags.js +38 -0
- package/src/agGrid/AgGridAdapter.js +0 -5
- package/src/agGrid/AgGridColumnAdapter.js +3 -2
- 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 -7
- package/src/components/CheckBox/index.js +2 -3
- package/src/components/CodeBlock/index.js +2 -3
- 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 +31 -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 +4 -1
- package/src/components/DragAndDropContext/ModuleManager.d.ts +15 -3
- package/src/components/DragAndDropContext/ModuleManager.js +43 -4
- 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 +13 -9
- package/src/components/DragAndDropContext/dragScope.d.ts +6 -0
- package/src/components/DragAndDropContext/dragScope.js +34 -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 -3
- package/src/components/ErrorBox/index.js +2 -3
- package/src/components/ExpressionEditor/BaseEditorInput.js +3 -3
- package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +3 -3
- package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +9 -9
- package/src/components/FieldWrap/index.js +2 -3
- package/src/components/Flex.js +2 -2
- package/src/components/FormLayout/index.d.ts +1 -1
- package/src/components/HelpBlock/index.js +3 -4
- package/src/components/IconSelector/IconSelector.d.ts +8 -0
- package/src/components/IconSelector/IconSelector.js +13 -8
- package/src/components/IconSelector/index.d.ts +1 -0
- package/src/components/IconSelector/index.js +3 -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 -3
- package/src/components/Tabs/index.js +4 -4
- package/src/components/Tag/Tag.d.ts +16 -0
- package/src/components/Tag/Tag.js +16 -5
- package/src/components/Tag/columnScopeTagHelpers.d.ts +8 -0
- package/src/components/Tag/columnScopeTagHelpers.js +12 -0
- package/src/components/Tag/index.d.ts +1 -1
- package/src/components/Tag/index.js +3 -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 -5
- package/src/components/Tree/TreeDropdown/index.js +3 -5
- package/src/components/WarningBox/index.js +2 -3
- 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.cjs.tsbuildinfo +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.d.ts +0 -17
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +0 -295
- 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 -14
- package/src/components/DropdownButton/useExpanded.d.ts +0 -24
- package/src/components/DropdownButton/useExpanded.js +0 -59
- package/src/components/NewDropdownButton/index.d.ts +0 -27
- package/src/components/NewDropdownButton/index.js +0 -28
- /package/src/{components/DropdownButton/DropdownButtonItem.js → AdaptableState/StyledColumns/BulletChartStyle.js} +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FormatColumnFormatWizardSection = exports.getFormatDisplayTypeForScope = exports.renderFormatColumnFormatSummary = exports.
|
|
3
|
+
exports.FormatColumnFormatWizardSection = exports.getFormatDisplayTypeForScope = exports.renderFormatColumnFormatSummary = exports.getFormatColumnFormatSummaryTagValues = exports.hasFormatColumnDisplayFormat = exports.getFormatColumnDisplayFormatSummaryItems = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
7
|
const uniq_1 = tslib_1.__importDefault(require("../../../Utilities/utils/uniq"));
|
|
7
8
|
const clamp_1 = tslib_1.__importDefault(require("../../../Utilities/utils/clamp"));
|
|
8
9
|
const HelpBlock_1 = tslib_1.__importDefault(require("../../../components/HelpBlock"));
|
|
@@ -26,6 +27,8 @@ const DocumentationLinkConstants_1 = require("../../../Utilities/Constants/Docum
|
|
|
26
27
|
const AdaptableColumn_1 = require("../../../AdaptableState/Common/AdaptableColumn");
|
|
27
28
|
const Flex_1 = require("../../../components/Flex");
|
|
28
29
|
const Card_1 = require("../../../components/Card");
|
|
30
|
+
const ObjectExtensions_1 = require("../../../Utilities/Extensions/ObjectExtensions");
|
|
31
|
+
const InfiniteTable_1 = require("../../../components/InfiniteTable");
|
|
29
32
|
const DateFormatPresets = [
|
|
30
33
|
'MM/dd/yyyy',
|
|
31
34
|
'dd-MM-yyyy',
|
|
@@ -65,6 +68,12 @@ const appendNumberFormatOptions = (items, options) => {
|
|
|
65
68
|
appendDisplayFormatItem(items, 'Integer Separator', options.IntegerSeparator);
|
|
66
69
|
appendDisplayFormatItem(items, 'Prefix', options.Prefix);
|
|
67
70
|
appendDisplayFormatItem(items, 'Suffix', options.Suffix);
|
|
71
|
+
if (options.ZeroDisplay !== undefined && options.ZeroDisplay !== '0') {
|
|
72
|
+
items.push({
|
|
73
|
+
label: 'Zero Display',
|
|
74
|
+
value: options.ZeroDisplay === '' ? 'Blank' : options.ZeroDisplay,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
68
77
|
appendDisplayFormatItem(items, 'Content', options.Content);
|
|
69
78
|
if (options.Multiplier != null && options.Multiplier !== 1) {
|
|
70
79
|
items.push({ label: 'Multiplier', value: String(options.Multiplier) });
|
|
@@ -105,7 +114,14 @@ const getFormatColumnDisplayFormatSummaryItems = (data) => {
|
|
|
105
114
|
return [];
|
|
106
115
|
}
|
|
107
116
|
if ((0, AdaptableFormatPresets_1.isAdaptableNumericFormatPreset)(data.DisplayFormat)) {
|
|
108
|
-
return [{ label: '', value:
|
|
117
|
+
return [{ label: 'Preset', value: NUMERIC_PRESET_LABELS[data.DisplayFormat] }];
|
|
118
|
+
}
|
|
119
|
+
// Wizard materialises an empty { Formatter, Options: {} } shell while editing;
|
|
120
|
+
// treat it as unset (same as handleFinish in FormatColumnWizard).
|
|
121
|
+
if (data.DisplayFormat &&
|
|
122
|
+
typeof data.DisplayFormat === 'object' &&
|
|
123
|
+
(0, ObjectExtensions_1.isObjectEmpty)(data.DisplayFormat.Options)) {
|
|
124
|
+
return [];
|
|
109
125
|
}
|
|
110
126
|
const resolved = (0, AdaptableFormatPresets_1.resolveDisplayFormat)(data.DisplayFormat);
|
|
111
127
|
if (!resolved) {
|
|
@@ -114,9 +130,6 @@ const getFormatColumnDisplayFormatSummaryItems = (data) => {
|
|
|
114
130
|
const items = [];
|
|
115
131
|
if (resolved.Formatter === 'NumberFormatter') {
|
|
116
132
|
appendNumberFormatOptions(items, resolved.Options);
|
|
117
|
-
if (!items.length) {
|
|
118
|
-
items.push({ label: '', value: 'Number Format' });
|
|
119
|
-
}
|
|
120
133
|
return items;
|
|
121
134
|
}
|
|
122
135
|
if (resolved.Formatter === 'DateFormatter') {
|
|
@@ -128,16 +141,10 @@ const getFormatColumnDisplayFormatSummaryItems = (data) => {
|
|
|
128
141
|
value: options.CustomDisplayFormats.join(', '),
|
|
129
142
|
});
|
|
130
143
|
}
|
|
131
|
-
if (!items.length) {
|
|
132
|
-
items.push({ label: '', value: 'Date Format' });
|
|
133
|
-
}
|
|
134
144
|
return items;
|
|
135
145
|
}
|
|
136
146
|
if (resolved.Formatter === 'StringFormatter') {
|
|
137
147
|
appendStringFormatOptions(items, resolved.Options);
|
|
138
|
-
if (!items.length) {
|
|
139
|
-
items.push({ label: '', value: 'String Format' });
|
|
140
|
-
}
|
|
141
148
|
return items;
|
|
142
149
|
}
|
|
143
150
|
return items;
|
|
@@ -145,16 +152,14 @@ const getFormatColumnDisplayFormatSummaryItems = (data) => {
|
|
|
145
152
|
exports.getFormatColumnDisplayFormatSummaryItems = getFormatColumnDisplayFormatSummaryItems;
|
|
146
153
|
const hasFormatColumnDisplayFormat = (data) => (0, exports.getFormatColumnDisplayFormatSummaryItems)(data).length > 0;
|
|
147
154
|
exports.hasFormatColumnDisplayFormat = hasFormatColumnDisplayFormat;
|
|
148
|
-
const
|
|
155
|
+
const getFormatColumnFormatSummaryTagValues = (data) => {
|
|
149
156
|
const items = (0, exports.getFormatColumnDisplayFormatSummaryItems)(data);
|
|
150
157
|
if (!items.length) {
|
|
151
|
-
return
|
|
158
|
+
return [];
|
|
152
159
|
}
|
|
153
|
-
return items
|
|
154
|
-
.map(({ label, value }) => (label ? `${label}: ${value}` : value))
|
|
155
|
-
.join(', ');
|
|
160
|
+
return items.map(({ label, value }) => (label ? `${label}: ${value}` : value));
|
|
156
161
|
};
|
|
157
|
-
exports.
|
|
162
|
+
exports.getFormatColumnFormatSummaryTagValues = getFormatColumnFormatSummaryTagValues;
|
|
158
163
|
const renderCustomFormatter = (data, customFormatter, setFormatOption) => {
|
|
159
164
|
const resolved = (0, AdaptableFormatPresets_1.resolveDisplayFormat)(data.DisplayFormat);
|
|
160
165
|
return ((0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: customFormatter.label ?? customFormatter.id, children: (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { "data-name": customFormatter.id, checked: resolved?.Options.CustomDisplayFormats?.some?.((item) => item === customFormatter.id), onChange: (checked) => {
|
|
@@ -169,14 +174,11 @@ const renderCustomFormatter = (data, customFormatter, setFormatOption) => {
|
|
|
169
174
|
} }) }, customFormatter.id));
|
|
170
175
|
};
|
|
171
176
|
const renderFormatColumnFormatSummary = (data) => {
|
|
172
|
-
const
|
|
173
|
-
if (!
|
|
177
|
+
const tagValues = (0, exports.getFormatColumnFormatSummaryTagValues)(data);
|
|
178
|
+
if (!tagValues.length) {
|
|
174
179
|
return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "No Display Format" });
|
|
175
180
|
}
|
|
176
|
-
|
|
177
|
-
return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: items[0].value });
|
|
178
|
-
}
|
|
179
|
-
return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:flex twa:flex-col twa:gap-2", children: items.map(({ label, value }) => ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { children: [label, " ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: value })] }, label))) }));
|
|
181
|
+
return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: tagValues.map((tag) => ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: tag }, tag))) }));
|
|
180
182
|
};
|
|
181
183
|
exports.renderFormatColumnFormatSummary = renderFormatColumnFormatSummary;
|
|
182
184
|
const getFormatDisplayTypeForScope = (scope, api) => {
|
|
@@ -275,27 +277,61 @@ const getFormatDisplayTypeForScope = (scope, api) => {
|
|
|
275
277
|
return undefined;
|
|
276
278
|
};
|
|
277
279
|
exports.getFormatDisplayTypeForScope = getFormatDisplayTypeForScope;
|
|
280
|
+
const NUMBER_FORMAT_INPUT_CLASS = 'twa:w-[72px] twa:min-w-[72px] twa:max-w-[72px]';
|
|
281
|
+
const NUMBER_FORMAT_LABEL_COLUMN = {
|
|
282
|
+
name: 'label',
|
|
283
|
+
className: 'ab-FormLayout_column--label twa:whitespace-nowrap',
|
|
284
|
+
};
|
|
285
|
+
const NUMBER_FORMAT_CHECKBOX_CHILDREN_COLUMN = {
|
|
286
|
+
name: 'children',
|
|
287
|
+
className: 'twa:pl-2',
|
|
288
|
+
};
|
|
289
|
+
const NUMBER_FORMAT_VALUE_CHILDREN_COLUMN = {
|
|
290
|
+
name: 'children',
|
|
291
|
+
className: 'twa:pl-2',
|
|
292
|
+
};
|
|
293
|
+
const NUMBER_FORMAT_DIGIT_FORM_SIZES = ['148px', '72px'];
|
|
294
|
+
const NUMBER_FORMAT_VALUE_FORM_SIZES = ['92px', '72px'];
|
|
295
|
+
const NUMBER_FORMAT_CHECKBOX_FORM_SIZES = ['72px', 'auto'];
|
|
296
|
+
const DATE_FORMAT_PRESET_ROW_HEIGHT = 32;
|
|
297
|
+
const DATE_FORMAT_PRESET_HEADER_HEIGHT = 40;
|
|
298
|
+
const DateFormatPresetsTable = ({ onApplyPattern }) => {
|
|
299
|
+
const rows = React.useMemo(() => DateFormatPresets.map((pattern) => ({
|
|
300
|
+
pattern,
|
|
301
|
+
formattedDate: FormatHelper_1.default.DateFormatter(new Date(), { Pattern: pattern }) ?? '',
|
|
302
|
+
})), []);
|
|
303
|
+
const columns = React.useMemo(() => ({
|
|
304
|
+
pattern: {
|
|
305
|
+
field: 'pattern',
|
|
306
|
+
header: 'Pattern',
|
|
307
|
+
defaultFlex: 1,
|
|
308
|
+
renderMenuIcon: false,
|
|
309
|
+
},
|
|
310
|
+
formattedDate: {
|
|
311
|
+
field: 'formattedDate',
|
|
312
|
+
header: 'Formatted Date',
|
|
313
|
+
defaultFlex: 1,
|
|
314
|
+
renderMenuIcon: false,
|
|
315
|
+
},
|
|
316
|
+
apply: {
|
|
317
|
+
field: 'pattern',
|
|
318
|
+
header: '',
|
|
319
|
+
defaultWidth: 80,
|
|
320
|
+
align: 'center',
|
|
321
|
+
renderMenuIcon: false,
|
|
322
|
+
render: ({ data }) => ((0, jsx_runtime_1.jsx)(SimpleButton_1.default, { "data-name": "apply-format-pattern", "data-value": data.pattern, onClick: () => onApplyPattern(data.pattern), children: "Apply" })),
|
|
323
|
+
},
|
|
324
|
+
}), [onApplyPattern]);
|
|
325
|
+
const tableHeight = DATE_FORMAT_PRESET_HEADER_HEIGHT + rows.length * DATE_FORMAT_PRESET_ROW_HEIGHT;
|
|
326
|
+
return ((0, jsx_runtime_1.jsx)(InfiniteTable_1.DataSource, { data: rows, primaryKey: "pattern", children: (0, jsx_runtime_1.jsx)(InfiniteTable_1.InfiniteTableGrid, { sortable: false, domProps: { style: { height: tableHeight, width: '100%' } }, columns: columns }) }));
|
|
327
|
+
};
|
|
278
328
|
const renderDateFormat = (data, _onChange, setFormatOption, scopedCustomFormatters) => {
|
|
279
329
|
const resolved = (0, AdaptableFormatPresets_1.resolveDisplayFormat)(data.DisplayFormat);
|
|
280
330
|
if (resolved?.Formatter !== 'DateFormatter') {
|
|
281
331
|
return null;
|
|
282
332
|
}
|
|
283
|
-
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Format" }), (0, jsx_runtime_1.
|
|
284
|
-
FormatHelper_1.default.DateFormatter(new Date(), resolved.Options, true) })] }) }) })] }), scopedCustomFormatters.length > 0 && ((0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Custom Formats" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Apply a developer-defined formatter to this Column" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsx)(FormLayout_1.default, { children: scopedCustomFormatters.map((formatter) => renderCustomFormatter(data, formatter, setFormatOption)) }) })] })), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Presets" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Apply a common date pattern as a starting point" })] }), (0, jsx_runtime_1.
|
|
285
|
-
{ Content: 'Pattern', Size: 1 },
|
|
286
|
-
{ Content: 'Formatted Date', Size: 1 },
|
|
287
|
-
{ Content: '', Size: 1 },
|
|
288
|
-
] }), DateFormatPresets.map((Pattern, index) => ((0, jsx_runtime_1.jsx)(AdaptableObjectRow_1.AdaptableObjectRow, { colItems: [
|
|
289
|
-
{ Content: Pattern, Size: 1 },
|
|
290
|
-
{
|
|
291
|
-
Content: FormatHelper_1.default.DateFormatter(new Date(), { Pattern }),
|
|
292
|
-
Size: 1,
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
Content: ((0, jsx_runtime_1.jsx)(SimpleButton_1.default, { "data-name": "apply-format-pattern", "data-value": Pattern, onClick: () => setFormatOption('Pattern', Pattern), children: "Apply" })),
|
|
296
|
-
Size: 1,
|
|
297
|
-
},
|
|
298
|
-
] }, index)))] })] })] }));
|
|
333
|
+
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Format" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Enter a Unicode date pattern (e.g. dd/MM/yyyy), or pick a preset below" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsx)(FormLayout_1.default, { children: (0, jsx_runtime_1.jsxs)(FormLayout_1.FormRow, { label: "Pattern", children: [(0, jsx_runtime_1.jsx)(Input_1.default, { "data-name": "pattern", value: resolved.Options.Pattern ?? '', onChange: (e) => setFormatOption('Pattern', e.currentTarget.value), className: "twa:mr-2" }), (0, jsx_runtime_1.jsx)("span", { children: resolved.Options.Pattern &&
|
|
334
|
+
FormatHelper_1.default.DateFormatter(new Date(), resolved.Options, true) })] }) }) })] }), scopedCustomFormatters.length > 0 && ((0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Custom Formats" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Apply a developer-defined formatter to this Column" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsx)(FormLayout_1.default, { children: scopedCustomFormatters.map((formatter) => renderCustomFormatter(data, formatter, setFormatOption)) }) })] })), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Presets" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Apply a common date pattern as a starting point" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:px-0 twa:pt-0 twa:pb-1", children: (0, jsx_runtime_1.jsx)(DateFormatPresetsTable, { onApplyPattern: (pattern) => setFormatOption('Pattern', pattern) }) })] })] }));
|
|
299
335
|
};
|
|
300
336
|
const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatters, api) => {
|
|
301
337
|
const resolved = (0, AdaptableFormatPresets_1.resolveDisplayFormat)(data.DisplayFormat);
|
|
@@ -309,7 +345,9 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
|
|
|
309
345
|
const setPreset = (preset) => {
|
|
310
346
|
onChange({ DisplayFormat: preset });
|
|
311
347
|
};
|
|
312
|
-
const activePreset = (0, AdaptableFormatPresets_1.isAdaptableNumericFormatPreset)(data.DisplayFormat)
|
|
348
|
+
const activePreset = (0, AdaptableFormatPresets_1.isAdaptableNumericFormatPreset)(data.DisplayFormat)
|
|
349
|
+
? data.DisplayFormat
|
|
350
|
+
: undefined;
|
|
313
351
|
const IS_PERCENT = activePreset === 'Percentage';
|
|
314
352
|
const IS_THOUSAND = activePreset === 'Thousand';
|
|
315
353
|
const IS_MILLION = activePreset === 'Million';
|
|
@@ -326,13 +364,27 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
|
|
|
326
364
|
const IS_FX_RATE = activePreset === 'FXRate';
|
|
327
365
|
const IS_SCIENTIFIC = activePreset === 'Scientific';
|
|
328
366
|
const showDocumentationLinks = api.internalApi.isDocumentationLinksDisplayed();
|
|
329
|
-
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", "data-name": 'format-column-display-format', className: "twa:gap-3 twa:p-3", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Presets" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Pick a common numeric preset as a starting point" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", className: "twa:m-2", children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:mr-6", children: [(0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-dollar", className: "twa:my-1", checked: IS_DOLLAR, onChange: () => setPreset('Dollar'), children: "Dollar" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-sterling", className: "twa:my-1", checked: IS_STERLING, onChange: () => setPreset('Sterling'), children: "Sterling" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-euro", className: "twa:my-1", checked: IS_EURO, onChange: () => setPreset('Euro'), children: "Euro" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-yen", className: "twa:my-1", checked: IS_YEN, onChange: () => setPreset('Yen'), children: "Yen" })] }), (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:mr-6", children: [(0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-thousand", className: "twa:my-1", checked: IS_THOUSAND, onChange: () => setPreset('Thousand'), children: "K (Thousand)" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-million", className: "twa:my-1", checked: IS_MILLION, onChange: () => setPreset('Million'), children: "M (Million)" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-billion", className: "twa:my-1", checked: IS_BILLION, onChange: () => setPreset('Billion'), children: "B (Billion)" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-basis-points", className: "twa:my-1", checked: IS_BASIS_POINTS, onChange: () => setPreset('BasisPoints'), children: "bps (Basis Pts)" })] }), (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:mr-6", children: [(0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-integer", className: "twa:my-1", checked: IS_INTEGER, onChange: () => setPreset('Integer'), children: "Integer" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-decimal", className: "twa:my-1", checked: IS_DECIMAL, onChange: () => setPreset('Decimal'), children: "Decimal" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-percentage", className: "twa:my-1", checked: IS_PERCENT, onChange: () => setPreset('Percentage'), children: "Percentage" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-scientific", className: "twa:my-1", checked: IS_SCIENTIFIC, onChange: () => setPreset('Scientific'), children: "Scientific" })] }), (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", children: [(0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-accounting", className: "twa:my-1", checked: IS_ACCOUNTING, onChange: () => setPreset('Accounting'), children: "Accounting" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-fx-rate", className: "twa:my-1", checked: IS_FX_RATE, onChange: () => setPreset('FXRate'), children: "FX Rate" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-bitcoin", className: "twa:my-1", checked: IS_BITCOIN, onChange: () => setPreset('Bitcoin'), children: "Bitcoin" })] })] }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Format" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Fine-tune digits, separators, prefix / suffix and rounding behaviour" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(Flex_1.
|
|
367
|
+
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", "data-name": 'format-column-display-format', className: "twa:gap-3 twa:p-3", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Presets" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Pick a common numeric preset as a starting point" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", className: "twa:m-2", children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:mr-6", children: [(0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-dollar", className: "twa:my-1", checked: IS_DOLLAR, onChange: () => setPreset('Dollar'), children: "Dollar" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-sterling", className: "twa:my-1", checked: IS_STERLING, onChange: () => setPreset('Sterling'), children: "Sterling" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-euro", className: "twa:my-1", checked: IS_EURO, onChange: () => setPreset('Euro'), children: "Euro" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-yen", className: "twa:my-1", checked: IS_YEN, onChange: () => setPreset('Yen'), children: "Yen" })] }), (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:mr-6", children: [(0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-thousand", className: "twa:my-1", checked: IS_THOUSAND, onChange: () => setPreset('Thousand'), children: "K (Thousand)" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-million", className: "twa:my-1", checked: IS_MILLION, onChange: () => setPreset('Million'), children: "M (Million)" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-billion", className: "twa:my-1", checked: IS_BILLION, onChange: () => setPreset('Billion'), children: "B (Billion)" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-basis-points", className: "twa:my-1", checked: IS_BASIS_POINTS, onChange: () => setPreset('BasisPoints'), children: "bps (Basis Pts)" })] }), (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:mr-6", children: [(0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-integer", className: "twa:my-1", checked: IS_INTEGER, onChange: () => setPreset('Integer'), children: "Integer" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-decimal", className: "twa:my-1", checked: IS_DECIMAL, onChange: () => setPreset('Decimal'), children: "Decimal" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-percentage", className: "twa:my-1", checked: IS_PERCENT, onChange: () => setPreset('Percentage'), children: "Percentage" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-scientific", className: "twa:my-1", checked: IS_SCIENTIFIC, onChange: () => setPreset('Scientific'), children: "Scientific" })] }), (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", children: [(0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-accounting", className: "twa:my-1", checked: IS_ACCOUNTING, onChange: () => setPreset('Accounting'), children: "Accounting" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-fx-rate", className: "twa:my-1", checked: IS_FX_RATE, onChange: () => setPreset('FXRate'), children: "FX Rate" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { "data-name": "preset-bitcoin", className: "twa:my-1", checked: IS_BITCOIN, onChange: () => setPreset('Bitcoin'), children: "Bitcoin" })] })] }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:pl-0", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Format" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Fine-tune digits, separators, prefix / suffix and rounding behaviour" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:px-0 twa:pt-0 twa:pb-1", children: (0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:flex twa:flex-row twa:items-start twa:-ml-0.5", children: [(0, jsx_runtime_1.jsxs)(FormLayout_1.default, { sizes: NUMBER_FORMAT_DIGIT_FORM_SIZES, columns: [NUMBER_FORMAT_LABEL_COLUMN, { name: 'children' }], className: "twa:mr-6 twa:shrink-0", children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Fraction Digits", children: (0, jsx_runtime_1.jsx)(Input_1.default, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "fraction-digits", type: "number", min: "0", value: typeof resolved.Options.FractionDigits === 'number'
|
|
330
368
|
? resolved.Options.FractionDigits
|
|
331
369
|
: '', onChange: (e) => setFormatOption('FractionDigits', StringExtensions_1.default.IsNumeric(e.currentTarget.value)
|
|
332
370
|
? (0, clamp_1.default)(Number(e.currentTarget.value), 0, 20)
|
|
333
|
-
: undefined) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Integer Digits", children: (0, jsx_runtime_1.jsx)(Input_1.default, { "data-name": "integer-digits", type: "number", min: "0", value: resolved.Options.IntegerDigits, onChange: (e) => setFormatOption('IntegerDigits', StringExtensions_1.default.IsNumeric(e.currentTarget.value)
|
|
371
|
+
: undefined) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Integer Digits", children: (0, jsx_runtime_1.jsx)(Input_1.default, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "integer-digits", type: "number", min: "0", value: resolved.Options.IntegerDigits, onChange: (e) => setFormatOption('IntegerDigits', StringExtensions_1.default.IsNumeric(e.currentTarget.value)
|
|
334
372
|
? (0, clamp_1.default)(Number(e.currentTarget.value), 0, 20)
|
|
335
|
-
: undefined) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Fraction Separator", children: (0, jsx_runtime_1.jsx)(Input_1.default, { "data-name": "fraction-separator", value: resolved.Options.FractionSeparator ?? '', onChange: (e) => setFormatOption('FractionSeparator', e.currentTarget.value) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Integer Separator", children: (0, jsx_runtime_1.jsx)(Input_1.default, { "data-name": "integer-separator", value: resolved.Options.IntegerSeparator ?? '', onChange: (e) => setFormatOption('IntegerSeparator', e.currentTarget.value) }) })
|
|
373
|
+
: undefined) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Fraction Separator", children: (0, jsx_runtime_1.jsx)(Input_1.default, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "fraction-separator", value: resolved.Options.FractionSeparator ?? '', onChange: (e) => setFormatOption('FractionSeparator', e.currentTarget.value) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Integer Separator", children: (0, jsx_runtime_1.jsx)(Input_1.default, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "integer-separator", value: resolved.Options.IntegerSeparator ?? '', onChange: (e) => setFormatOption('IntegerSeparator', e.currentTarget.value) }) })] }), (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { sizes: NUMBER_FORMAT_VALUE_FORM_SIZES, columns: [NUMBER_FORMAT_LABEL_COLUMN, NUMBER_FORMAT_VALUE_CHILDREN_COLUMN], className: "twa:mr-5 twa:shrink-0", children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Multiplier", children: (0, jsx_runtime_1.jsx)(Input_1.default, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "multiplier", type: "number", value: resolved.Options.Multiplier, onChange: (e) => setFormatOption('Multiplier', Number(e.currentTarget.value)) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Prefix", children: (0, jsx_runtime_1.jsx)(Input_1.default, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "prefix", value: resolved.Options.Prefix ?? '', onChange: (e) => setFormatOption('Prefix', e.currentTarget.value) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Suffix", children: (0, jsx_runtime_1.jsx)(Input_1.default, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "suffix", value: resolved.Options.Suffix ?? '', onChange: (e) => setFormatOption('Suffix', e.currentTarget.value) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Zero Display", children: (0, jsx_runtime_1.jsx)(Input_1.default, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "zero-display", value: resolved.Options.ZeroDisplay === undefined ||
|
|
374
|
+
resolved.Options.ZeroDisplay === '0'
|
|
375
|
+
? '0'
|
|
376
|
+
: resolved.Options.ZeroDisplay, onChange: (e) => {
|
|
377
|
+
const value = e.currentTarget.value;
|
|
378
|
+
if (value === '') {
|
|
379
|
+
setFormatOption('ZeroDisplay', '');
|
|
380
|
+
}
|
|
381
|
+
else if (value === '0') {
|
|
382
|
+
setFormatOption('ZeroDisplay', undefined);
|
|
383
|
+
}
|
|
384
|
+
else {
|
|
385
|
+
setFormatOption('ZeroDisplay', value);
|
|
386
|
+
}
|
|
387
|
+
} }) })] }), (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { className: "twa:gap-2 twa:shrink-0", children: [(0, jsx_runtime_1.jsxs)(FormLayout_1.default, { sizes: NUMBER_FORMAT_CHECKBOX_FORM_SIZES, columns: [NUMBER_FORMAT_LABEL_COLUMN, NUMBER_FORMAT_CHECKBOX_CHILDREN_COLUMN], children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Parentheses", children: (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { "data-name": "parentheses-checkbox", checked: resolved.Options.Parentheses, onChange: (checked) => setFormatOption('Parentheses', checked) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Empty", children: (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { "data-name": "empty-checkbox", checked: resolved.Options.Empty, onChange: (checked) => setFormatOption('Empty', checked) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Truncate", children: (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { "data-name": "truncate-checkbox", checked: resolved.Options.Truncate, onChange: (checked) => setFormatOption('Truncate', checked) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Round", children: (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { "data-name": "round-checkbox", checked: resolved.Options.Round, onChange: (checked) => setFormatOption('Round', checked) }) })] }), (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { sizes: NUMBER_FORMAT_CHECKBOX_FORM_SIZES, columns: [NUMBER_FORMAT_LABEL_COLUMN, { name: 'children' }], children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Ceiling", children: (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { "data-name": "ceiling-checkbox", checked: resolved.Options.Ceiling, onChange: (checked) => setFormatOption('Ceiling', checked) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Floor", children: (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { "data-name": "floor-checkbox", checked: resolved.Options.Floor, onChange: (checked) => setFormatOption('Floor', checked) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Absolute", children: (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { "data-name": "abs-checkbox", checked: resolved.Options.Abs, onChange: (checked) => setFormatOption('Abs', checked) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Scientific", children: (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { "data-name": "scientific-checkbox", checked: resolved.Options.Notation === 'scientific', onChange: (checked) => setFormatOption('Notation', checked ? 'scientific' : undefined) }) })] })] })] }) })] }), scopedCustomFormatters.length > 0 && ((0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Custom Formats" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Apply a developer-defined formatter to this Column" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "row", children: (0, jsx_runtime_1.jsx)(FormLayout_1.default, { children: scopedCustomFormatters.map((formatter) => renderCustomFormatter(data, formatter, setFormatOption)) }) }) })] })), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Dynamic Content" }), (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:gap-1 twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { children: "Provide dynamic content through the use of Placeholders" }), showDocumentationLinks && ((0, jsx_runtime_1.jsx)(ButtonInfo_1.ButtonInfo, { variant: "text", tone: "accent", tooltip: "Learn more about using placeholders", onClick: () => window.open(DocumentationLinkConstants_1.FormatColumnPlaceholderDocsLink, '_blank') }))] })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { className: "twa:m-2", children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "", children: (0, jsx_runtime_1.jsx)(Textarea_1.default, { className: "twa:min-w-[300px] twa:mt-2", rows: 3, placeholder: "", type: 'text', autoFocus: false, value: resolved.Options.Content?.toString() ?? '', onChange: (e) => setFormatOption('Content', e.currentTarget.value) }) }), ' '] }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Examples" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Preview the formatter against sample values" })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card.Body, { children: [(0, jsx_runtime_1.jsx)(AdaptableObjectRow_1.AdaptableObjectRow, { className: "twa:font-bold", colItems: [
|
|
336
388
|
{ Content: 'Raw Number', Size: 1 },
|
|
337
389
|
{ Content: 'Formatted Number', Size: 1 },
|
|
338
390
|
] }), (0, jsx_runtime_1.jsx)(AdaptableObjectRow_1.AdaptableObjectRow, { colItems: [
|
|
@@ -353,6 +405,12 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
|
|
|
353
405
|
Content: FormatHelper_1.default.NumberFormatter(0.123, resolved.Options),
|
|
354
406
|
Size: 1,
|
|
355
407
|
},
|
|
408
|
+
] }), (0, jsx_runtime_1.jsx)(AdaptableObjectRow_1.AdaptableObjectRow, { colItems: [
|
|
409
|
+
{ Content: '0', Size: 1 },
|
|
410
|
+
{
|
|
411
|
+
Content: FormatHelper_1.default.NumberFormatter(0, resolved.Options),
|
|
412
|
+
Size: 1,
|
|
413
|
+
},
|
|
356
414
|
] })] })] })] }));
|
|
357
415
|
};
|
|
358
416
|
const renderStringFormat = (data, _onChange, setFormatOption, scopedCustomFormatters, api) => {
|
|
@@ -377,7 +435,6 @@ const renderStringFormat = (data, _onChange, setFormatOption, scopedCustomFormat
|
|
|
377
435
|
const FormatColumnFormatWizardSection = (props) => {
|
|
378
436
|
const { data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
379
437
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
380
|
-
const formatColumnApi = adaptable.api.formatColumnApi;
|
|
381
438
|
const customDisplayFormatters = adaptable.api.optionsApi.getFormatColumnOptions().customDisplayFormatters ?? [];
|
|
382
439
|
const update = (updated) => {
|
|
383
440
|
props.onChange({ ...data, ...updated });
|
|
@@ -7,6 +7,5 @@ type FormatColumnRuleWizardSectionProps = {
|
|
|
7
7
|
};
|
|
8
8
|
export declare const hasFormatColumnCondition: (formatColumn: FormatColumn) => boolean;
|
|
9
9
|
export declare const renderFormatColumnConditionSummary: (formatColumn: FormatColumn, api: AdaptableApi) => React.JSX.Element;
|
|
10
|
-
export declare const renderFormatColumnConditionWizardSummary: (formatColumn: FormatColumn) => React.JSX.Element;
|
|
11
10
|
export declare function FormatColumnRuleWizardSection(props: FormatColumnRuleWizardSectionProps): React.JSX.Element;
|
|
12
11
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.renderFormatColumnConditionSummary = exports.hasFormatColumnCondition = void 0;
|
|
4
4
|
exports.FormatColumnRuleWizardSection = FormatColumnRuleWizardSection;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -35,11 +35,6 @@ const renderFormatColumnConditionSummary = (formatColumn, api) => {
|
|
|
35
35
|
return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: expressionText || 'No Condition' });
|
|
36
36
|
};
|
|
37
37
|
exports.renderFormatColumnConditionSummary = renderFormatColumnConditionSummary;
|
|
38
|
-
const renderFormatColumnConditionWizardSummary = (formatColumn) => {
|
|
39
|
-
const { api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
40
|
-
return (0, exports.renderFormatColumnConditionSummary)(formatColumn, api);
|
|
41
|
-
};
|
|
42
|
-
exports.renderFormatColumnConditionWizardSummary = renderFormatColumnConditionWizardSummary;
|
|
43
38
|
function FormatColumnRuleWizardSection(props) {
|
|
44
39
|
const { data, api, moduleInfo } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
45
40
|
if (data.Target && data.Target === 'columnHeader') {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FormatColumnScopeWizardSection = exports.renderFormatColumnScopeSummary = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
5
|
const NewScopeComponent_1 = require("../../Components/NewScopeComponent");
|
|
7
6
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
@@ -9,15 +8,16 @@ const AdaptableContext_1 = require("../../AdaptableContext");
|
|
|
9
8
|
const AdaptableColumn_1 = require("../../../AdaptableState/Common/AdaptableColumn");
|
|
10
9
|
const ColumnScope_1 = require("../../../AdaptableState/Common/ColumnScope");
|
|
11
10
|
const Flex_1 = require("../../../components/Flex");
|
|
12
|
-
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
13
11
|
const CheckBox_1 = require("../../../components/CheckBox");
|
|
14
12
|
const Tag_1 = require("../../../components/Tag");
|
|
13
|
+
const CollapsibleWizardCard_1 = require("../../Wizard/CollapsibleWizardCard");
|
|
14
|
+
const utils_1 = require("../../../lib/utils");
|
|
15
15
|
const FORMAT_COLUMN_ROW_KINDS = ['Data', 'Group', 'Summary', 'Total'];
|
|
16
16
|
const ROW_KIND_LABELS = {
|
|
17
|
-
Data: 'Data (leaf)
|
|
18
|
-
Group: 'Group
|
|
19
|
-
Summary: 'Summary
|
|
20
|
-
Total: 'Total
|
|
17
|
+
Data: 'Data (leaf) Rows',
|
|
18
|
+
Group: 'Group Rows',
|
|
19
|
+
Summary: 'Summary Rows',
|
|
20
|
+
Total: 'Total Rows',
|
|
21
21
|
};
|
|
22
22
|
const ROW_KIND_EXCLUDE_KEY = {
|
|
23
23
|
Data: 'ExcludeDataRows',
|
|
@@ -35,6 +35,18 @@ const isRowKindIncluded = (data, kind) => {
|
|
|
35
35
|
const collectIncludedRowKinds = (data) => {
|
|
36
36
|
return FORMAT_COLUMN_ROW_KINDS.filter((k) => isRowKindIncluded(data, k));
|
|
37
37
|
};
|
|
38
|
+
const isFormatColumnColumnsScopeConfigured = (scope, scopeApi) => {
|
|
39
|
+
if (scopeApi.scopeIsAll(scope)) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
if ('ColumnIds' in scope) {
|
|
43
|
+
return scope.ColumnIds.length > 0;
|
|
44
|
+
}
|
|
45
|
+
if ('DataTypes' in scope) {
|
|
46
|
+
return scope.DataTypes.length > 0;
|
|
47
|
+
}
|
|
48
|
+
return false;
|
|
49
|
+
};
|
|
38
50
|
const FormatColumnScopeSummaryContent = ({ data, }) => {
|
|
39
51
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
40
52
|
const scopeApi = adaptable.api.columnScopeApi;
|
|
@@ -43,24 +55,46 @@ const FormatColumnScopeSummaryContent = ({ data, }) => {
|
|
|
43
55
|
const showRows = data.Target === 'cell';
|
|
44
56
|
const includedKinds = collectIncludedRowKinds(data);
|
|
45
57
|
const allKinds = includedKinds.length === 4;
|
|
46
|
-
return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:flex twa:flex-col twa:gap-3", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { children: scopeApi.scopeIsAll(scope) ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Columns ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "All" })] })) : 'ColumnIds' in scope ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Columns", ' ', columnsInScope.length ? (columnsInScope.map((column) => ((0, jsx_runtime_1.jsx)(Tag_1.
|
|
58
|
+
return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:flex twa:flex-col twa:gap-3", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { children: scopeApi.scopeIsAll(scope) ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Columns ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "All" })] })) : 'ColumnIds' in scope ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Columns", ' ', columnsInScope.length ? (columnsInScope.map((column) => ((0, jsx_runtime_1.jsx)(Tag_1.ColumnTag, { className: "twa:mr-1", children: column.friendlyName }, column.columnId)))) : ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "None" }))] })) : 'DataTypes' in scope ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Data Types", ' ', scope.DataTypes.length ? (scope.DataTypes.map((dataType) => ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { className: "twa:mr-1", children: (0, AdaptableColumn_1.getColumnTypeFriendlyName)(dataType) }, dataType)))) : ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "None" }))] })) : null }), showRows && ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { children: ["Rows", ' ', allKinds ? ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "All" })) : includedKinds.length === 0 ? ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "None" })) : (includedKinds.map((k) => ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { className: "twa:mr-1", children: k }, k))))] }))] }));
|
|
47
59
|
};
|
|
48
60
|
const renderFormatColumnScopeSummary = (data) => {
|
|
49
61
|
return (0, jsx_runtime_1.jsx)(FormatColumnScopeSummaryContent, { data: data });
|
|
50
62
|
};
|
|
51
63
|
exports.renderFormatColumnScopeSummary = renderFormatColumnScopeSummary;
|
|
64
|
+
const FormatColumnColumnsScopeSummary = ({ data, }) => {
|
|
65
|
+
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
66
|
+
const scopeApi = adaptable.api.columnScopeApi;
|
|
67
|
+
const scope = data.Scope;
|
|
68
|
+
const columnsInScope = scopeApi.getColumnsInScope(scope);
|
|
69
|
+
if (scopeApi.scopeIsAll(scope)) {
|
|
70
|
+
return (0, jsx_runtime_1.jsx)(CollapsibleWizardCard_1.CollapsibleWizardValueSummary, { value: (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "All columns in the row" }) });
|
|
71
|
+
}
|
|
72
|
+
if ('ColumnIds' in scope) {
|
|
73
|
+
return ((0, jsx_runtime_1.jsx)(CollapsibleWizardCard_1.CollapsibleWizardValueSummary, { value: columnsInScope.length ? ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexWrap: "wrap", className: "twa:gap-1", children: columnsInScope.map((column) => ((0, jsx_runtime_1.jsx)(Tag_1.ColumnTag, { children: column.friendlyName }, column.columnId))) })) : ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "None" })) }));
|
|
74
|
+
}
|
|
75
|
+
if ('DataTypes' in scope) {
|
|
76
|
+
return ((0, jsx_runtime_1.jsx)(CollapsibleWizardCard_1.CollapsibleWizardValueSummary, { value: scope.DataTypes.length ? ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexWrap: "wrap", className: "twa:gap-1", children: scope.DataTypes.map((dataType) => ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: (0, AdaptableColumn_1.getColumnTypeFriendlyName)(dataType) }, dataType))) })) : ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "None" })) }));
|
|
77
|
+
}
|
|
78
|
+
return null;
|
|
79
|
+
};
|
|
80
|
+
const FormatColumnRowsScopeSummary = ({ data, }) => {
|
|
81
|
+
const includedKinds = collectIncludedRowKinds(data);
|
|
82
|
+
const allKinds = includedKinds.length === 4;
|
|
83
|
+
return ((0, jsx_runtime_1.jsx)(CollapsibleWizardCard_1.CollapsibleWizardValueSummary, { value: allKinds ? ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "All" })) : includedKinds.length === 0 ? ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "None" })) : ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexWrap: "wrap", className: "twa:gap-1", children: includedKinds.map((kind) => ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: ROW_KIND_LABELS[kind] }, kind))) })) }));
|
|
84
|
+
};
|
|
85
|
+
const FormatColumnRowScopePanel = ({ data, onRowKindChange, }) => ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "column", className: "twa:items-start twa:px-1 twa:py-1", style: { rowGap: 'calc(var(--ab-base-space) * 2)' }, children: FORMAT_COLUMN_ROW_KINDS.map((kind) => ((0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { "data-name": `include-${kind.toLowerCase()}-rows-checkbox`, checked: isRowKindIncluded(data, kind), onChange: (checked) => onRowKindChange(kind, checked), children: ROW_KIND_LABELS[kind] }, kind))) }));
|
|
52
86
|
// ---------------------------------------------------------------------------
|
|
53
87
|
// Section
|
|
54
88
|
// ---------------------------------------------------------------------------
|
|
55
89
|
const FormatColumnScopeWizardSection = (props) => {
|
|
56
90
|
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
91
|
+
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
92
|
+
const scopeApi = adaptable.api.columnScopeApi;
|
|
57
93
|
const handleScopeChange = (Scope) => {
|
|
58
94
|
const newData = { ...data, Scope };
|
|
59
95
|
const wholeRow = api.columnScopeApi.scopeIsAll(Scope);
|
|
60
96
|
if (newData.Rule?.Predicates?.length) {
|
|
61
97
|
if (wholeRow) {
|
|
62
|
-
// if scope is whole row, a predicate cannot be present, so we set the rule
|
|
63
|
-
// to be a boolean expression
|
|
64
98
|
delete newData.Rule.Predicates;
|
|
65
99
|
newData.Rule.BooleanExpression = '';
|
|
66
100
|
}
|
|
@@ -68,8 +102,6 @@ const FormatColumnScopeWizardSection = (props) => {
|
|
|
68
102
|
const validPredicateIds = new Set(api.formatColumnApi.internalApi.getFormatColumnDefsForScope(Scope).map((def) => def.id));
|
|
69
103
|
newData.Rule = {
|
|
70
104
|
Predicates: newData.Rule.Predicates.filter((p) => validPredicateIds.has(p.PredicateId)).filter((predicate) => {
|
|
71
|
-
// if there are more than 1 column, then we must eliminate the IN/NotIn predicates
|
|
72
|
-
// TODO: this should NOT be required, but the ColumnValueSelector does NOT support creatable values right now
|
|
73
105
|
if ((0, ColumnScope_1.isScopeColumnIds)(Scope) && Scope.ColumnIds.length > 1) {
|
|
74
106
|
return predicate.PredicateId !== 'In' && predicate.PredicateId !== 'NotIn';
|
|
75
107
|
}
|
|
@@ -90,9 +122,17 @@ const FormatColumnScopeWizardSection = (props) => {
|
|
|
90
122
|
});
|
|
91
123
|
};
|
|
92
124
|
const showRowToggles = data.Target === 'cell';
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
125
|
+
const scope = data.Scope;
|
|
126
|
+
const columnsScopeConfigured = isFormatColumnColumnsScopeConfigured(scope, scopeApi);
|
|
127
|
+
const includedRowKinds = collectIncludedRowKinds(data);
|
|
128
|
+
const allRowKindsIncluded = includedRowKinds.length === 4;
|
|
129
|
+
const initialExpandedCardId = columnsScopeConfigured ? null : 'columns';
|
|
130
|
+
const { bindCard, hasExpandedCard, expandedFillsSpace } = (0, CollapsibleWizardCard_1.useWizardCardAccordion)(initialExpandedCardId, { fillExpandedCard: true });
|
|
131
|
+
const columnsCompactSummary = scopeApi.scopeIsAll(scope) ? ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "All columns" })) : 'ColumnIds' in scope ? ((0, CollapsibleWizardCard_1.renderCompactColumnTags)(scope.ColumnIds, (columnId) => adaptable.api.columnApi.getFriendlyNameForColumnId(columnId), { emptyLabel: 'No columns' })) : 'DataTypes' in scope ? ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { alignItems: "center", className: "twa:gap-1 twa:min-w-0 twa:overflow-hidden", children: scope.DataTypes.length ? (scope.DataTypes.map((dataType) => ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { className: "twa:shrink-0", children: (0, AdaptableColumn_1.getColumnTypeFriendlyName)(dataType) }, dataType)))) : ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "None" })) })) : null;
|
|
132
|
+
const rowsCompactSummary = allRowKindsIncluded ? ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "All" })) : includedRowKinds.length === 0 ? ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "None" })) : ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { alignItems: "center", className: "twa:gap-1 twa:min-w-0 twa:overflow-hidden", children: includedRowKinds.map((kind) => ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { className: "twa:shrink-0", children: kind }, kind))) }));
|
|
133
|
+
return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: (0, utils_1.cn)((0, CollapsibleWizardCard_1.getWizardAccordionSectionClassName)(hasExpandedCard, expandedFillsSpace), 'twa:p-2'), children: [(0, jsx_runtime_1.jsx)(CollapsibleWizardCard_1.CollapsibleWizardCard, { ...bindCard('columns', { fillAvailable: true }), surface: "panel", "data-name": "format-column-scope-columns", title: "Columns", help: "Which Columns the Format Column will be applied to", collapsedHelp: "Columns the Format Column applies to", compactSummary: columnsCompactSummary, summary: (0, jsx_runtime_1.jsx)(FormatColumnColumnsScopeSummary, { data: data }), className: "twa:overflow-hidden twa:flex twa:flex-col", bodyClassName: "twa:min-h-[200px] twa:max-h-[420px] twa:overflow-hidden twa:flex twa:flex-col twa:!pt-0 twa:!pb-0 twa:px-1", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:flex-1 twa:min-h-0 twa:overflow-auto twa:h-full", children: (0, jsx_runtime_1.jsx)(NewScopeComponent_1.NewScopeComponent, { descriptions: {
|
|
134
|
+
rowScope: 'Format all Columns in the Row',
|
|
135
|
+
columnScope: 'Select Columns to format',
|
|
136
|
+
}, scope: data.Scope, updateScope: handleScopeChange }) }) }), showRowToggles && ((0, jsx_runtime_1.jsx)(CollapsibleWizardCard_1.CollapsibleWizardCard, { ...bindCard('rows'), surface: "panel", "data-name": "format-column-scope-rows", title: "Rows", help: "Which kinds of Rows the Format Column will be applied to", collapsedHelp: "Row kinds the Format Column applies to", compactSummary: rowsCompactSummary, summary: (0, jsx_runtime_1.jsx)(FormatColumnRowsScopeSummary, { data: data }), children: (0, jsx_runtime_1.jsx)(FormatColumnRowScopePanel, { data: data, onRowKindChange: handleRowKindChange }) }))] }));
|
|
97
137
|
};
|
|
98
138
|
exports.FormatColumnScopeWizardSection = FormatColumnScopeWizardSection;
|
|
@@ -62,7 +62,7 @@ const FormatColumnSettingsWizardSection = (props) => {
|
|
|
62
62
|
});
|
|
63
63
|
};
|
|
64
64
|
const behaviourSpellingVariant = api.internalApi.getCorrectEnglishVariant('Behaviour');
|
|
65
|
-
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Name" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Provide a unique name for the Format Column" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:p-1", children: (0, jsx_runtime_1.jsx)(Input_1.default, { ref: nameInputRef, className: "twa:max-w-[300px] twa:w-full", "data-name": "format-column-name", onChange: onNameChange, value: data?.Name ?? '' }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Target" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[700px]", children: "Choose whether Format Column applies to Column Cells or Column Header (latter doesn't support Conditions)" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", children: [(0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { "data-name": "target-column-cell", text: 'Column Cells', description: "", checked: currentTarget === 'cell', onClick: () => handleTargetChange('cell') }), (0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { "data-name": "target-column-header", text: 'Column Header', description: "", checked: currentTarget === 'columnHeader', onClick: () => handleTargetChange('columnHeader') })] }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:font-medium", children: ["Column Group ", behaviourSpellingVariant] }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose when the Format Column is applied
|
|
65
|
+
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Name" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Provide a unique name for the Format Column" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:p-1", children: (0, jsx_runtime_1.jsx)(Input_1.default, { ref: nameInputRef, className: "twa:max-w-[300px] twa:w-full", "data-name": "format-column-name", onChange: onNameChange, value: data?.Name ?? '' }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Target" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[700px]", children: "Choose whether Format Column applies to Column Cells or Column Header (latter doesn't support Conditions)" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", children: [(0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { "data-name": "target-column-cell", text: 'Column Cells', description: "", checked: currentTarget === 'cell', onClick: () => handleTargetChange('cell') }), (0, jsx_runtime_1.jsx)(TypeRadio_1.TypeRadio, { "data-name": "target-column-header", text: 'Column Header', description: "", checked: currentTarget === 'columnHeader', onClick: () => handleTargetChange('columnHeader') })] }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:font-medium", children: ["Column Group ", behaviourSpellingVariant] }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose when the Format Column is applied in a Column Group" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(Radio_1.RadioGroup, { value: data.ColumnGroupScope || 'Both', name: "columnGroupScope", orientation: "horizontal", onRadioChange: (columnGroupScope) => {
|
|
66
66
|
props.onChange({
|
|
67
67
|
...data,
|
|
68
68
|
ColumnGroupScope: columnGroupScope,
|
|
@@ -6,8 +6,7 @@ type FormatColumnStyleWizardSectionProps = {
|
|
|
6
6
|
onChange: (data: FormatColumn) => void;
|
|
7
7
|
};
|
|
8
8
|
export declare const hasFormatColumnStyle: (formatColumn: FormatColumn) => boolean;
|
|
9
|
-
export declare const getFormatColumnStyleViewValues: (formatColumn: FormatColumn) =>
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const renderFormatColumnStyleSummary: (data: FormatColumn, _api: AdaptableApi) => React.JSX.Element;
|
|
9
|
+
export declare const getFormatColumnStyleViewValues: (formatColumn: FormatColumn) => React.ReactNode[];
|
|
10
|
+
export declare const renderFormatColumnStyleSummary: (data: FormatColumn) => React.JSX.Element;
|
|
12
11
|
export declare function FormatColumnStyleWizardSection(props: FormatColumnStyleWizardSectionProps): React.JSX.Element;
|
|
13
12
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.renderFormatColumnStyleSummary = exports.
|
|
3
|
+
exports.renderFormatColumnStyleSummary = exports.getFormatColumnStyleViewValues = exports.hasFormatColumnStyle = exports.isFormatColumnStyleValid = void 0;
|
|
4
4
|
exports.FormatColumnStyleWizardSection = FormatColumnStyleWizardSection;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -10,6 +10,7 @@ const UIHelper_1 = tslib_1.__importDefault(require("../../UIHelper"));
|
|
|
10
10
|
const StringExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Extensions/StringExtensions"));
|
|
11
11
|
const Flex_1 = require("../../../components/Flex");
|
|
12
12
|
const Tag_1 = require("../../../components/Tag");
|
|
13
|
+
const SummaryColorTag_1 = require("../../Wizard/SummaryColorTag");
|
|
13
14
|
const FormatColumnPreview_1 = require("./FormatColumnPreview");
|
|
14
15
|
const isFormatColumnStyleValid = (data, api) => {
|
|
15
16
|
if (data.Style &&
|
|
@@ -67,15 +68,10 @@ const hasFormatColumnStyle = (formatColumn) => {
|
|
|
67
68
|
};
|
|
68
69
|
exports.hasFormatColumnStyle = hasFormatColumnStyle;
|
|
69
70
|
const getFormatColumnStyleViewValues = (formatColumn) => {
|
|
70
|
-
return getFormatColumnStyleSummaryItems(formatColumn).map(({ label, value }) => `${label}: ${value}`);
|
|
71
|
+
return (0, SummaryColorTag_1.summaryStringsToTagContents)(getFormatColumnStyleSummaryItems(formatColumn).map(({ label, value }) => `${label}: ${value}`));
|
|
71
72
|
};
|
|
72
73
|
exports.getFormatColumnStyleViewValues = getFormatColumnStyleViewValues;
|
|
73
|
-
const
|
|
74
|
-
const { api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
75
|
-
return (0, exports.renderFormatColumnStyleSummary)(data, api);
|
|
76
|
-
};
|
|
77
|
-
exports.renderFormatColumnStyleWizardSummary = renderFormatColumnStyleWizardSummary;
|
|
78
|
-
const renderFormatColumnStyleSummary = (data, _api) => {
|
|
74
|
+
const renderFormatColumnStyleSummary = (data) => {
|
|
79
75
|
const hasStyle = data.Style != null && UIHelper_1.default.IsNotEmptyStyle(data.Style);
|
|
80
76
|
if (!hasStyle) {
|
|
81
77
|
return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "No Style" });
|
|
@@ -84,7 +80,7 @@ const renderFormatColumnStyleSummary = (data, _api) => {
|
|
|
84
80
|
if (!items.length) {
|
|
85
81
|
return (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: "No Style" });
|
|
86
82
|
}
|
|
87
|
-
return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:grid twa:grid-cols-2 twa:gap-2", children: items.map(({ label, value }) => ((0, jsx_runtime_1.
|
|
83
|
+
return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:grid twa:grid-cols-2 twa:gap-2", children: items.map(({ label, value }) => ((0, jsx_runtime_1.jsx)(Flex_1.Box, { children: (0, SummaryColorTag_1.isSummaryInTagLabel)(label) ? ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: (0, SummaryColorTag_1.renderSummaryLabelValueTagContent)(label, value) })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [label, " ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: value })] })) }, label))) }));
|
|
88
84
|
};
|
|
89
85
|
exports.renderFormatColumnStyleSummary = renderFormatColumnStyleSummary;
|
|
90
86
|
function FormatColumnStyleWizardSection(props) {
|
|
@@ -105,10 +105,7 @@ function FormatColumnWizard(props) {
|
|
|
105
105
|
// DisplayFormat object so we don't persist an empty shell. Preset
|
|
106
106
|
// strings are always meaningful and should never be removed here.
|
|
107
107
|
const df = formatColumn?.DisplayFormat;
|
|
108
|
-
if (df &&
|
|
109
|
-
!(0, AdaptableFormatPresets_1.isAdaptableNumericFormatPreset)(df) &&
|
|
110
|
-
df.Options &&
|
|
111
|
-
(0, ObjectExtensions_1.isObjectEmpty)(df.Options)) {
|
|
108
|
+
if (df && !(0, AdaptableFormatPresets_1.isAdaptableNumericFormatPreset)(df) && df.Options && (0, ObjectExtensions_1.isObjectEmpty)(df.Options)) {
|
|
112
109
|
delete formatColumn.DisplayFormat;
|
|
113
110
|
}
|
|
114
111
|
if (formatColumn.Style && (0, ObjectExtensions_1.isObjectEmpty)(formatColumn.Style)) {
|
|
@@ -145,9 +142,7 @@ function FormatColumnWizard(props) {
|
|
|
145
142
|
details: 'Select which Columns and Rows will be formatted',
|
|
146
143
|
isValid: NewScopeComponent_1.isScopeValid,
|
|
147
144
|
renderSummary: FormatColumnScopeWizardSection_1.renderFormatColumnScopeSummary,
|
|
148
|
-
render: () => {
|
|
149
|
-
return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "column", className: "twa:h-full", children: (0, jsx_runtime_1.jsx)(FormatColumnScopeWizardSection_1.FormatColumnScopeWizardSection, { onChange: setFormatColumn }) }));
|
|
150
|
-
},
|
|
145
|
+
render: () => (0, jsx_runtime_1.jsx)(FormatColumnScopeWizardSection_1.FormatColumnScopeWizardSection, { onChange: setFormatColumn }),
|
|
151
146
|
},
|
|
152
147
|
{
|
|
153
148
|
isValid: (abObject, api, context) => {
|
|
@@ -158,7 +153,7 @@ function FormatColumnWizard(props) {
|
|
|
158
153
|
},
|
|
159
154
|
title: 'Condition',
|
|
160
155
|
details: 'Build a Rule when the Format Column should be applied',
|
|
161
|
-
renderSummary: FormatColumnRuleWizardSection_1.
|
|
156
|
+
renderSummary: FormatColumnRuleWizardSection_1.renderFormatColumnConditionSummary,
|
|
162
157
|
render: () => {
|
|
163
158
|
return ((0, jsx_runtime_1.jsx)(FormatColumnRuleWizardSection_1.FormatColumnRuleWizardSection, { onChange: setFormatColumn, defaultPredicateId: constants_1.DEFAULT_PREDICATE_ID_FOR_FORMAT_COLUMN }));
|
|
164
159
|
},
|
|
@@ -167,7 +162,7 @@ function FormatColumnWizard(props) {
|
|
|
167
162
|
title: 'Style',
|
|
168
163
|
details: 'Create a Style',
|
|
169
164
|
isValid: FormatColumnStyleWizardSection_1.isFormatColumnStyleValid,
|
|
170
|
-
renderSummary: FormatColumnStyleWizardSection_1.
|
|
165
|
+
renderSummary: FormatColumnStyleWizardSection_1.renderFormatColumnStyleSummary,
|
|
171
166
|
render: () => {
|
|
172
167
|
return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:p-2", children: (0, jsx_runtime_1.jsx)(FormatColumnStyleWizardSection_1.FormatColumnStyleWizardSection, { onChange: setFormatColumn }) }));
|
|
173
168
|
},
|