@adaptabletools/adaptable 23.0.0-canary.5 → 23.0.0-canary.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/icons/sort-asc.svg +1 -1
- package/index.css +756 -257
- 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 +2 -2
- 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/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/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.js +7 -5
- 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 +2 -1
- 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 +3 -4
- 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 +4 -4
- 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 +1 -1
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +4 -4
- 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.js +2 -2
- package/src/View/Components/ColumnFilter/ColumnFilter.js +2 -3
- package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +0 -1
- package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +3 -1
- 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 +1 -1
- 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 +2 -4
- 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/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/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 +11 -11
- 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 +2 -0
- 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 +137 -119
- 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 +8 -17
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +46 -28
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +98 -43
- 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/StyledColumnWizardStyleSection.js +11 -6
- 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/AdaptableAgGrid.js +1 -1
- package/src/agGrid/AgGridAdapter.js +0 -5
- package/src/agGrid/AgGridColumnAdapter.js +2 -2
- package/src/agGrid/cellRenderers/ActionColumnRenderer.js +4 -7
- 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.js +1 -1
- package/src/types.d.ts +1 -1
- 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/DropdownButtonItem.js +0 -1
- 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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
2
3
|
import uniq from '../../../Utilities/utils/uniq';
|
|
3
4
|
import clamp from '../../../Utilities/utils/clamp';
|
|
4
5
|
import HelpBlock from '../../../components/HelpBlock';
|
|
@@ -22,6 +23,8 @@ import { FormatColumnPlaceholderDocsLink } from '../../../Utilities/Constants/Do
|
|
|
22
23
|
import { PIVOT_AGGREGATION_TOTAL_COLUMN_TYPE, PIVOT_ANY_TOTAL_COLUMN_TYPE, PIVOT_COLUMN_TOTAL_COLUMN_TYPE, PIVOT_GRAND_TOTAL_COLUMN_TYPE, } from '../../../AdaptableState/Common/AdaptableColumn';
|
|
23
24
|
import { Box, Flex } from '../../../components/Flex';
|
|
24
25
|
import { Card } from '../../../components/Card';
|
|
26
|
+
import { isObjectEmpty } from '../../../Utilities/Extensions/ObjectExtensions';
|
|
27
|
+
import { DataSource, InfiniteTableGrid, } from '../../../components/InfiniteTable';
|
|
25
28
|
const DateFormatPresets = [
|
|
26
29
|
'MM/dd/yyyy',
|
|
27
30
|
'dd-MM-yyyy',
|
|
@@ -61,6 +64,12 @@ const appendNumberFormatOptions = (items, options) => {
|
|
|
61
64
|
appendDisplayFormatItem(items, 'Integer Separator', options.IntegerSeparator);
|
|
62
65
|
appendDisplayFormatItem(items, 'Prefix', options.Prefix);
|
|
63
66
|
appendDisplayFormatItem(items, 'Suffix', options.Suffix);
|
|
67
|
+
if (options.ZeroDisplay !== undefined && options.ZeroDisplay !== '0') {
|
|
68
|
+
items.push({
|
|
69
|
+
label: 'Zero Display',
|
|
70
|
+
value: options.ZeroDisplay === '' ? 'Blank' : options.ZeroDisplay,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
64
73
|
appendDisplayFormatItem(items, 'Content', options.Content);
|
|
65
74
|
if (options.Multiplier != null && options.Multiplier !== 1) {
|
|
66
75
|
items.push({ label: 'Multiplier', value: String(options.Multiplier) });
|
|
@@ -101,7 +110,14 @@ export const getFormatColumnDisplayFormatSummaryItems = (data) => {
|
|
|
101
110
|
return [];
|
|
102
111
|
}
|
|
103
112
|
if (isAdaptableNumericFormatPreset(data.DisplayFormat)) {
|
|
104
|
-
return [{ label: '', value:
|
|
113
|
+
return [{ label: 'Preset', value: NUMERIC_PRESET_LABELS[data.DisplayFormat] }];
|
|
114
|
+
}
|
|
115
|
+
// Wizard materialises an empty { Formatter, Options: {} } shell while editing;
|
|
116
|
+
// treat it as unset (same as handleFinish in FormatColumnWizard).
|
|
117
|
+
if (data.DisplayFormat &&
|
|
118
|
+
typeof data.DisplayFormat === 'object' &&
|
|
119
|
+
isObjectEmpty(data.DisplayFormat.Options)) {
|
|
120
|
+
return [];
|
|
105
121
|
}
|
|
106
122
|
const resolved = resolveDisplayFormat(data.DisplayFormat);
|
|
107
123
|
if (!resolved) {
|
|
@@ -110,9 +126,6 @@ export const getFormatColumnDisplayFormatSummaryItems = (data) => {
|
|
|
110
126
|
const items = [];
|
|
111
127
|
if (resolved.Formatter === 'NumberFormatter') {
|
|
112
128
|
appendNumberFormatOptions(items, resolved.Options);
|
|
113
|
-
if (!items.length) {
|
|
114
|
-
items.push({ label: '', value: 'Number Format' });
|
|
115
|
-
}
|
|
116
129
|
return items;
|
|
117
130
|
}
|
|
118
131
|
if (resolved.Formatter === 'DateFormatter') {
|
|
@@ -124,29 +137,21 @@ export const getFormatColumnDisplayFormatSummaryItems = (data) => {
|
|
|
124
137
|
value: options.CustomDisplayFormats.join(', '),
|
|
125
138
|
});
|
|
126
139
|
}
|
|
127
|
-
if (!items.length) {
|
|
128
|
-
items.push({ label: '', value: 'Date Format' });
|
|
129
|
-
}
|
|
130
140
|
return items;
|
|
131
141
|
}
|
|
132
142
|
if (resolved.Formatter === 'StringFormatter') {
|
|
133
143
|
appendStringFormatOptions(items, resolved.Options);
|
|
134
|
-
if (!items.length) {
|
|
135
|
-
items.push({ label: '', value: 'String Format' });
|
|
136
|
-
}
|
|
137
144
|
return items;
|
|
138
145
|
}
|
|
139
146
|
return items;
|
|
140
147
|
};
|
|
141
148
|
export const hasFormatColumnDisplayFormat = (data) => getFormatColumnDisplayFormatSummaryItems(data).length > 0;
|
|
142
|
-
export const
|
|
149
|
+
export const getFormatColumnFormatSummaryTagValues = (data) => {
|
|
143
150
|
const items = getFormatColumnDisplayFormatSummaryItems(data);
|
|
144
151
|
if (!items.length) {
|
|
145
|
-
return
|
|
152
|
+
return [];
|
|
146
153
|
}
|
|
147
|
-
return items
|
|
148
|
-
.map(({ label, value }) => (label ? `${label}: ${value}` : value))
|
|
149
|
-
.join(', ');
|
|
154
|
+
return items.map(({ label, value }) => (label ? `${label}: ${value}` : value));
|
|
150
155
|
};
|
|
151
156
|
const renderCustomFormatter = (data, customFormatter, setFormatOption) => {
|
|
152
157
|
const resolved = resolveDisplayFormat(data.DisplayFormat);
|
|
@@ -162,14 +167,11 @@ const renderCustomFormatter = (data, customFormatter, setFormatOption) => {
|
|
|
162
167
|
} }) }, customFormatter.id));
|
|
163
168
|
};
|
|
164
169
|
export const renderFormatColumnFormatSummary = (data) => {
|
|
165
|
-
const
|
|
166
|
-
if (!
|
|
170
|
+
const tagValues = getFormatColumnFormatSummaryTagValues(data);
|
|
171
|
+
if (!tagValues.length) {
|
|
167
172
|
return _jsx(Tag, { children: "No Display Format" });
|
|
168
173
|
}
|
|
169
|
-
|
|
170
|
-
return _jsx(Tag, { children: items[0].value });
|
|
171
|
-
}
|
|
172
|
-
return (_jsx(Box, { className: "twa:flex twa:flex-col twa:gap-2", children: items.map(({ label, value }) => (_jsxs(Box, { children: [label, " ", _jsx(Tag, { children: value })] }, label))) }));
|
|
174
|
+
return (_jsx(Flex, { alignItems: "center", className: "twa:flex-wrap twa:gap-2", children: tagValues.map((tag) => (_jsx(Tag, { children: tag }, tag))) }));
|
|
173
175
|
};
|
|
174
176
|
export const getFormatDisplayTypeForScope = (scope, api) => {
|
|
175
177
|
if (scope == undefined) {
|
|
@@ -266,27 +268,61 @@ export const getFormatDisplayTypeForScope = (scope, api) => {
|
|
|
266
268
|
}
|
|
267
269
|
return undefined;
|
|
268
270
|
};
|
|
271
|
+
const NUMBER_FORMAT_INPUT_CLASS = 'twa:w-[72px] twa:min-w-[72px] twa:max-w-[72px]';
|
|
272
|
+
const NUMBER_FORMAT_LABEL_COLUMN = {
|
|
273
|
+
name: 'label',
|
|
274
|
+
className: 'ab-FormLayout_column--label twa:whitespace-nowrap',
|
|
275
|
+
};
|
|
276
|
+
const NUMBER_FORMAT_CHECKBOX_CHILDREN_COLUMN = {
|
|
277
|
+
name: 'children',
|
|
278
|
+
className: 'twa:pl-2',
|
|
279
|
+
};
|
|
280
|
+
const NUMBER_FORMAT_VALUE_CHILDREN_COLUMN = {
|
|
281
|
+
name: 'children',
|
|
282
|
+
className: 'twa:pl-2',
|
|
283
|
+
};
|
|
284
|
+
const NUMBER_FORMAT_DIGIT_FORM_SIZES = ['148px', '72px'];
|
|
285
|
+
const NUMBER_FORMAT_VALUE_FORM_SIZES = ['92px', '72px'];
|
|
286
|
+
const NUMBER_FORMAT_CHECKBOX_FORM_SIZES = ['72px', 'auto'];
|
|
287
|
+
const DATE_FORMAT_PRESET_ROW_HEIGHT = 32;
|
|
288
|
+
const DATE_FORMAT_PRESET_HEADER_HEIGHT = 40;
|
|
289
|
+
const DateFormatPresetsTable = ({ onApplyPattern }) => {
|
|
290
|
+
const rows = React.useMemo(() => DateFormatPresets.map((pattern) => ({
|
|
291
|
+
pattern,
|
|
292
|
+
formattedDate: FormatHelper.DateFormatter(new Date(), { Pattern: pattern }) ?? '',
|
|
293
|
+
})), []);
|
|
294
|
+
const columns = React.useMemo(() => ({
|
|
295
|
+
pattern: {
|
|
296
|
+
field: 'pattern',
|
|
297
|
+
header: 'Pattern',
|
|
298
|
+
defaultFlex: 1,
|
|
299
|
+
renderMenuIcon: false,
|
|
300
|
+
},
|
|
301
|
+
formattedDate: {
|
|
302
|
+
field: 'formattedDate',
|
|
303
|
+
header: 'Formatted Date',
|
|
304
|
+
defaultFlex: 1,
|
|
305
|
+
renderMenuIcon: false,
|
|
306
|
+
},
|
|
307
|
+
apply: {
|
|
308
|
+
field: 'pattern',
|
|
309
|
+
header: '',
|
|
310
|
+
defaultWidth: 80,
|
|
311
|
+
align: 'center',
|
|
312
|
+
renderMenuIcon: false,
|
|
313
|
+
render: ({ data }) => (_jsx(SimpleButton, { "data-name": "apply-format-pattern", "data-value": data.pattern, onClick: () => onApplyPattern(data.pattern), children: "Apply" })),
|
|
314
|
+
},
|
|
315
|
+
}), [onApplyPattern]);
|
|
316
|
+
const tableHeight = DATE_FORMAT_PRESET_HEADER_HEIGHT + rows.length * DATE_FORMAT_PRESET_ROW_HEIGHT;
|
|
317
|
+
return (_jsx(DataSource, { data: rows, primaryKey: "pattern", children: _jsx(InfiniteTableGrid, { sortable: false, domProps: { style: { height: tableHeight, width: '100%' } }, columns: columns }) }));
|
|
318
|
+
};
|
|
269
319
|
const renderDateFormat = (data, _onChange, setFormatOption, scopedCustomFormatters) => {
|
|
270
320
|
const resolved = resolveDisplayFormat(data.DisplayFormat);
|
|
271
321
|
if (resolved?.Formatter !== 'DateFormatter') {
|
|
272
322
|
return null;
|
|
273
323
|
}
|
|
274
|
-
return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: [_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Format" }),
|
|
275
|
-
FormatHelper.DateFormatter(new Date(), resolved.Options, true) })] }) }) })] }), scopedCustomFormatters.length > 0 && (_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Custom Formats" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Apply a developer-defined formatter to this Column" })] }), _jsx(Card.Body, { children: _jsx(FormLayout, { children: scopedCustomFormatters.map((formatter) => renderCustomFormatter(data, formatter, setFormatOption)) }) })] })), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Presets" }), _jsx(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" })] }),
|
|
276
|
-
{ Content: 'Pattern', Size: 1 },
|
|
277
|
-
{ Content: 'Formatted Date', Size: 1 },
|
|
278
|
-
{ Content: '', Size: 1 },
|
|
279
|
-
] }), DateFormatPresets.map((Pattern, index) => (_jsx(AdaptableObjectRow, { colItems: [
|
|
280
|
-
{ Content: Pattern, Size: 1 },
|
|
281
|
-
{
|
|
282
|
-
Content: FormatHelper.DateFormatter(new Date(), { Pattern }),
|
|
283
|
-
Size: 1,
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
Content: (_jsx(SimpleButton, { "data-name": "apply-format-pattern", "data-value": Pattern, onClick: () => setFormatOption('Pattern', Pattern), children: "Apply" })),
|
|
287
|
-
Size: 1,
|
|
288
|
-
},
|
|
289
|
-
] }, index)))] })] })] }));
|
|
324
|
+
return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: [_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Format" }), _jsx(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" })] }), _jsx(Card.Body, { children: _jsx(FormLayout, { children: _jsxs(FormRow, { label: "Pattern", children: [_jsx(Input, { "data-name": "pattern", value: resolved.Options.Pattern ?? '', onChange: (e) => setFormatOption('Pattern', e.currentTarget.value), className: "twa:mr-2" }), _jsx("span", { children: resolved.Options.Pattern &&
|
|
325
|
+
FormatHelper.DateFormatter(new Date(), resolved.Options, true) })] }) }) })] }), scopedCustomFormatters.length > 0 && (_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Custom Formats" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Apply a developer-defined formatter to this Column" })] }), _jsx(Card.Body, { children: _jsx(FormLayout, { children: scopedCustomFormatters.map((formatter) => renderCustomFormatter(data, formatter, setFormatOption)) }) })] })), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Presets" }), _jsx(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" })] }), _jsx(Card.Body, { className: "twa:px-0 twa:pt-0 twa:pb-1", children: _jsx(DateFormatPresetsTable, { onApplyPattern: (pattern) => setFormatOption('Pattern', pattern) }) })] })] }));
|
|
290
326
|
};
|
|
291
327
|
const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatters, api) => {
|
|
292
328
|
const resolved = resolveDisplayFormat(data.DisplayFormat);
|
|
@@ -300,7 +336,9 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
|
|
|
300
336
|
const setPreset = (preset) => {
|
|
301
337
|
onChange({ DisplayFormat: preset });
|
|
302
338
|
};
|
|
303
|
-
const activePreset = isAdaptableNumericFormatPreset(data.DisplayFormat)
|
|
339
|
+
const activePreset = isAdaptableNumericFormatPreset(data.DisplayFormat)
|
|
340
|
+
? data.DisplayFormat
|
|
341
|
+
: undefined;
|
|
304
342
|
const IS_PERCENT = activePreset === 'Percentage';
|
|
305
343
|
const IS_THOUSAND = activePreset === 'Thousand';
|
|
306
344
|
const IS_MILLION = activePreset === 'Million';
|
|
@@ -317,13 +355,27 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
|
|
|
317
355
|
const IS_FX_RATE = activePreset === 'FXRate';
|
|
318
356
|
const IS_SCIENTIFIC = activePreset === 'Scientific';
|
|
319
357
|
const showDocumentationLinks = api.internalApi.isDocumentationLinksDisplayed();
|
|
320
|
-
return (_jsxs(Flex, { flexDirection: "column", "data-name": 'format-column-display-format', className: "twa:gap-3 twa:p-3", children: [_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Presets" }), _jsx(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" })] }), _jsx(Card.Body, { children: _jsxs(Flex, { flexDirection: "row", className: "twa:m-2", children: [_jsxs(Flex, { flexDirection: "column", className: "twa:mr-6", children: [_jsx(Radio, { "data-name": "preset-dollar", className: "twa:my-1", checked: IS_DOLLAR, onChange: () => setPreset('Dollar'), children: "Dollar" }), _jsx(Radio, { "data-name": "preset-sterling", className: "twa:my-1", checked: IS_STERLING, onChange: () => setPreset('Sterling'), children: "Sterling" }), _jsx(Radio, { "data-name": "preset-euro", className: "twa:my-1", checked: IS_EURO, onChange: () => setPreset('Euro'), children: "Euro" }), _jsx(Radio, { "data-name": "preset-yen", className: "twa:my-1", checked: IS_YEN, onChange: () => setPreset('Yen'), children: "Yen" })] }), _jsxs(Flex, { flexDirection: "column", className: "twa:mr-6", children: [_jsx(Radio, { "data-name": "preset-thousand", className: "twa:my-1", checked: IS_THOUSAND, onChange: () => setPreset('Thousand'), children: "K (Thousand)" }), _jsx(Radio, { "data-name": "preset-million", className: "twa:my-1", checked: IS_MILLION, onChange: () => setPreset('Million'), children: "M (Million)" }), _jsx(Radio, { "data-name": "preset-billion", className: "twa:my-1", checked: IS_BILLION, onChange: () => setPreset('Billion'), children: "B (Billion)" }), _jsx(Radio, { "data-name": "preset-basis-points", className: "twa:my-1", checked: IS_BASIS_POINTS, onChange: () => setPreset('BasisPoints'), children: "bps (Basis Pts)" })] }), _jsxs(Flex, { flexDirection: "column", className: "twa:mr-6", children: [_jsx(Radio, { "data-name": "preset-integer", className: "twa:my-1", checked: IS_INTEGER, onChange: () => setPreset('Integer'), children: "Integer" }), _jsx(Radio, { "data-name": "preset-decimal", className: "twa:my-1", checked: IS_DECIMAL, onChange: () => setPreset('Decimal'), children: "Decimal" }), _jsx(Radio, { "data-name": "preset-percentage", className: "twa:my-1", checked: IS_PERCENT, onChange: () => setPreset('Percentage'), children: "Percentage" }), _jsx(Radio, { "data-name": "preset-scientific", className: "twa:my-1", checked: IS_SCIENTIFIC, onChange: () => setPreset('Scientific'), children: "Scientific" })] }), _jsxs(Flex, { flexDirection: "column", children: [_jsx(Radio, { "data-name": "preset-accounting", className: "twa:my-1", checked: IS_ACCOUNTING, onChange: () => setPreset('Accounting'), children: "Accounting" }), _jsx(Radio, { "data-name": "preset-fx-rate", className: "twa:my-1", checked: IS_FX_RATE, onChange: () => setPreset('FXRate'), children: "FX Rate" }), _jsx(Radio, { "data-name": "preset-bitcoin", className: "twa:my-1", checked: IS_BITCOIN, onChange: () => setPreset('Bitcoin'), children: "Bitcoin" })] })] }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Format" }), _jsx(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" })] }), _jsx(Card.Body, { children: _jsxs(
|
|
358
|
+
return (_jsxs(Flex, { flexDirection: "column", "data-name": 'format-column-display-format', className: "twa:gap-3 twa:p-3", children: [_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Presets" }), _jsx(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" })] }), _jsx(Card.Body, { children: _jsxs(Flex, { flexDirection: "row", className: "twa:m-2", children: [_jsxs(Flex, { flexDirection: "column", className: "twa:mr-6", children: [_jsx(Radio, { "data-name": "preset-dollar", className: "twa:my-1", checked: IS_DOLLAR, onChange: () => setPreset('Dollar'), children: "Dollar" }), _jsx(Radio, { "data-name": "preset-sterling", className: "twa:my-1", checked: IS_STERLING, onChange: () => setPreset('Sterling'), children: "Sterling" }), _jsx(Radio, { "data-name": "preset-euro", className: "twa:my-1", checked: IS_EURO, onChange: () => setPreset('Euro'), children: "Euro" }), _jsx(Radio, { "data-name": "preset-yen", className: "twa:my-1", checked: IS_YEN, onChange: () => setPreset('Yen'), children: "Yen" })] }), _jsxs(Flex, { flexDirection: "column", className: "twa:mr-6", children: [_jsx(Radio, { "data-name": "preset-thousand", className: "twa:my-1", checked: IS_THOUSAND, onChange: () => setPreset('Thousand'), children: "K (Thousand)" }), _jsx(Radio, { "data-name": "preset-million", className: "twa:my-1", checked: IS_MILLION, onChange: () => setPreset('Million'), children: "M (Million)" }), _jsx(Radio, { "data-name": "preset-billion", className: "twa:my-1", checked: IS_BILLION, onChange: () => setPreset('Billion'), children: "B (Billion)" }), _jsx(Radio, { "data-name": "preset-basis-points", className: "twa:my-1", checked: IS_BASIS_POINTS, onChange: () => setPreset('BasisPoints'), children: "bps (Basis Pts)" })] }), _jsxs(Flex, { flexDirection: "column", className: "twa:mr-6", children: [_jsx(Radio, { "data-name": "preset-integer", className: "twa:my-1", checked: IS_INTEGER, onChange: () => setPreset('Integer'), children: "Integer" }), _jsx(Radio, { "data-name": "preset-decimal", className: "twa:my-1", checked: IS_DECIMAL, onChange: () => setPreset('Decimal'), children: "Decimal" }), _jsx(Radio, { "data-name": "preset-percentage", className: "twa:my-1", checked: IS_PERCENT, onChange: () => setPreset('Percentage'), children: "Percentage" }), _jsx(Radio, { "data-name": "preset-scientific", className: "twa:my-1", checked: IS_SCIENTIFIC, onChange: () => setPreset('Scientific'), children: "Scientific" })] }), _jsxs(Flex, { flexDirection: "column", children: [_jsx(Radio, { "data-name": "preset-accounting", className: "twa:my-1", checked: IS_ACCOUNTING, onChange: () => setPreset('Accounting'), children: "Accounting" }), _jsx(Radio, { "data-name": "preset-fx-rate", className: "twa:my-1", checked: IS_FX_RATE, onChange: () => setPreset('FXRate'), children: "FX Rate" }), _jsx(Radio, { "data-name": "preset-bitcoin", className: "twa:my-1", checked: IS_BITCOIN, onChange: () => setPreset('Bitcoin'), children: "Bitcoin" })] })] }) })] }), _jsxs(Card, { shadow: false, className: "twa:pl-0", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Format" }), _jsx(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" })] }), _jsx(Card.Body, { className: "twa:px-0 twa:pt-0 twa:pb-1", children: _jsxs(Box, { className: "twa:flex twa:flex-row twa:items-start twa:-ml-0.5", children: [_jsxs(FormLayout, { sizes: NUMBER_FORMAT_DIGIT_FORM_SIZES, columns: [NUMBER_FORMAT_LABEL_COLUMN, { name: 'children' }], className: "twa:mr-6 twa:shrink-0", children: [_jsx(FormRow, { label: "Fraction Digits", children: _jsx(Input, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "fraction-digits", type: "number", min: "0", value: typeof resolved.Options.FractionDigits === 'number'
|
|
321
359
|
? resolved.Options.FractionDigits
|
|
322
360
|
: '', onChange: (e) => setFormatOption('FractionDigits', StringExtensions.IsNumeric(e.currentTarget.value)
|
|
323
361
|
? clamp(Number(e.currentTarget.value), 0, 20)
|
|
324
|
-
: undefined) }) }), _jsx(FormRow, { label: "Integer Digits", children: _jsx(Input, { "data-name": "integer-digits", type: "number", min: "0", value: resolved.Options.IntegerDigits, onChange: (e) => setFormatOption('IntegerDigits', StringExtensions.IsNumeric(e.currentTarget.value)
|
|
362
|
+
: undefined) }) }), _jsx(FormRow, { label: "Integer Digits", children: _jsx(Input, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "integer-digits", type: "number", min: "0", value: resolved.Options.IntegerDigits, onChange: (e) => setFormatOption('IntegerDigits', StringExtensions.IsNumeric(e.currentTarget.value)
|
|
325
363
|
? clamp(Number(e.currentTarget.value), 0, 20)
|
|
326
|
-
: undefined) }) }), _jsx(FormRow, { label: "Fraction Separator", children: _jsx(Input, { "data-name": "fraction-separator", value: resolved.Options.FractionSeparator ?? '', onChange: (e) => setFormatOption('FractionSeparator', e.currentTarget.value) }) }), _jsx(FormRow, { label: "Integer Separator", children: _jsx(Input, { "data-name": "integer-separator", value: resolved.Options.IntegerSeparator ?? '', onChange: (e) => setFormatOption('IntegerSeparator', e.currentTarget.value) }) })
|
|
364
|
+
: undefined) }) }), _jsx(FormRow, { label: "Fraction Separator", children: _jsx(Input, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "fraction-separator", value: resolved.Options.FractionSeparator ?? '', onChange: (e) => setFormatOption('FractionSeparator', e.currentTarget.value) }) }), _jsx(FormRow, { label: "Integer Separator", children: _jsx(Input, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "integer-separator", value: resolved.Options.IntegerSeparator ?? '', onChange: (e) => setFormatOption('IntegerSeparator', e.currentTarget.value) }) })] }), _jsxs(FormLayout, { sizes: NUMBER_FORMAT_VALUE_FORM_SIZES, columns: [NUMBER_FORMAT_LABEL_COLUMN, NUMBER_FORMAT_VALUE_CHILDREN_COLUMN], className: "twa:mr-5 twa:shrink-0", children: [_jsx(FormRow, { label: "Multiplier", children: _jsx(Input, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "multiplier", type: "number", value: resolved.Options.Multiplier, onChange: (e) => setFormatOption('Multiplier', Number(e.currentTarget.value)) }) }), _jsx(FormRow, { label: "Prefix", children: _jsx(Input, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "prefix", value: resolved.Options.Prefix ?? '', onChange: (e) => setFormatOption('Prefix', e.currentTarget.value) }) }), _jsx(FormRow, { label: "Suffix", children: _jsx(Input, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "suffix", value: resolved.Options.Suffix ?? '', onChange: (e) => setFormatOption('Suffix', e.currentTarget.value) }) }), _jsx(FormRow, { label: "Zero Display", children: _jsx(Input, { className: NUMBER_FORMAT_INPUT_CLASS, "data-name": "zero-display", value: resolved.Options.ZeroDisplay === undefined ||
|
|
365
|
+
resolved.Options.ZeroDisplay === '0'
|
|
366
|
+
? '0'
|
|
367
|
+
: resolved.Options.ZeroDisplay, onChange: (e) => {
|
|
368
|
+
const value = e.currentTarget.value;
|
|
369
|
+
if (value === '') {
|
|
370
|
+
setFormatOption('ZeroDisplay', '');
|
|
371
|
+
}
|
|
372
|
+
else if (value === '0') {
|
|
373
|
+
setFormatOption('ZeroDisplay', undefined);
|
|
374
|
+
}
|
|
375
|
+
else {
|
|
376
|
+
setFormatOption('ZeroDisplay', value);
|
|
377
|
+
}
|
|
378
|
+
} }) })] }), _jsxs(Flex, { className: "twa:gap-2 twa:shrink-0", children: [_jsxs(FormLayout, { sizes: NUMBER_FORMAT_CHECKBOX_FORM_SIZES, columns: [NUMBER_FORMAT_LABEL_COLUMN, NUMBER_FORMAT_CHECKBOX_CHILDREN_COLUMN], children: [_jsx(FormRow, { label: "Parentheses", children: _jsx(CheckBox, { "data-name": "parentheses-checkbox", checked: resolved.Options.Parentheses, onChange: (checked) => setFormatOption('Parentheses', checked) }) }), _jsx(FormRow, { label: "Empty", children: _jsx(CheckBox, { "data-name": "empty-checkbox", checked: resolved.Options.Empty, onChange: (checked) => setFormatOption('Empty', checked) }) }), _jsx(FormRow, { label: "Truncate", children: _jsx(CheckBox, { "data-name": "truncate-checkbox", checked: resolved.Options.Truncate, onChange: (checked) => setFormatOption('Truncate', checked) }) }), _jsx(FormRow, { label: "Round", children: _jsx(CheckBox, { "data-name": "round-checkbox", checked: resolved.Options.Round, onChange: (checked) => setFormatOption('Round', checked) }) })] }), _jsxs(FormLayout, { sizes: NUMBER_FORMAT_CHECKBOX_FORM_SIZES, columns: [NUMBER_FORMAT_LABEL_COLUMN, { name: 'children' }], children: [_jsx(FormRow, { label: "Ceiling", children: _jsx(CheckBox, { "data-name": "ceiling-checkbox", checked: resolved.Options.Ceiling, onChange: (checked) => setFormatOption('Ceiling', checked) }) }), _jsx(FormRow, { label: "Floor", children: _jsx(CheckBox, { "data-name": "floor-checkbox", checked: resolved.Options.Floor, onChange: (checked) => setFormatOption('Floor', checked) }) }), _jsx(FormRow, { label: "Absolute", children: _jsx(CheckBox, { "data-name": "abs-checkbox", checked: resolved.Options.Abs, onChange: (checked) => setFormatOption('Abs', checked) }) }), _jsx(FormRow, { label: "Scientific", children: _jsx(CheckBox, { "data-name": "scientific-checkbox", checked: resolved.Options.Notation === 'scientific', onChange: (checked) => setFormatOption('Notation', checked ? 'scientific' : undefined) }) })] })] })] }) })] }), scopedCustomFormatters.length > 0 && (_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Custom Formats" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Apply a developer-defined formatter to this Column" })] }), _jsx(Card.Body, { children: _jsx(Flex, { flexDirection: "row", children: _jsx(FormLayout, { children: scopedCustomFormatters.map((formatter) => renderCustomFormatter(data, formatter, setFormatOption)) }) }) })] })), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Dynamic Content" }), _jsxs(Flex, { alignItems: "center", className: "twa:gap-1 twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: [_jsx(Box, { children: "Provide dynamic content through the use of Placeholders" }), showDocumentationLinks && (_jsx(ButtonInfo, { variant: "text", tone: "accent", tooltip: "Learn more about using placeholders", onClick: () => window.open(FormatColumnPlaceholderDocsLink, '_blank') }))] })] }), _jsx(Card.Body, { children: _jsxs(FormLayout, { className: "twa:m-2", children: [_jsx(FormRow, { label: "", children: _jsx(Textarea, { 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) }) }), ' '] }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Examples" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Preview the formatter against sample values" })] }), _jsxs(Card.Body, { children: [_jsx(AdaptableObjectRow, { className: "twa:font-bold", colItems: [
|
|
327
379
|
{ Content: 'Raw Number', Size: 1 },
|
|
328
380
|
{ Content: 'Formatted Number', Size: 1 },
|
|
329
381
|
] }), _jsx(AdaptableObjectRow, { colItems: [
|
|
@@ -344,6 +396,12 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
|
|
|
344
396
|
Content: FormatHelper.NumberFormatter(0.123, resolved.Options),
|
|
345
397
|
Size: 1,
|
|
346
398
|
},
|
|
399
|
+
] }), _jsx(AdaptableObjectRow, { colItems: [
|
|
400
|
+
{ Content: '0', Size: 1 },
|
|
401
|
+
{
|
|
402
|
+
Content: FormatHelper.NumberFormatter(0, resolved.Options),
|
|
403
|
+
Size: 1,
|
|
404
|
+
},
|
|
347
405
|
] })] })] })] }));
|
|
348
406
|
};
|
|
349
407
|
const renderStringFormat = (data, _onChange, setFormatOption, scopedCustomFormatters, api) => {
|
|
@@ -368,7 +426,6 @@ const renderStringFormat = (data, _onChange, setFormatOption, scopedCustomFormat
|
|
|
368
426
|
export const FormatColumnFormatWizardSection = (props) => {
|
|
369
427
|
const { data } = useOnePageAdaptableWizardContext();
|
|
370
428
|
const adaptable = useAdaptable();
|
|
371
|
-
const formatColumnApi = adaptable.api.formatColumnApi;
|
|
372
429
|
const customDisplayFormatters = adaptable.api.optionsApi.getFormatColumnOptions().customDisplayFormatters ?? [];
|
|
373
430
|
const update = (updated) => {
|
|
374
431
|
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 {};
|
|
@@ -28,10 +28,6 @@ export const renderFormatColumnConditionSummary = (formatColumn, api) => {
|
|
|
28
28
|
const expressionText = api.internalApi.getAdaptableQueryExpressionText(rule);
|
|
29
29
|
return _jsx(Tag, { children: expressionText || 'No Condition' });
|
|
30
30
|
};
|
|
31
|
-
export const renderFormatColumnConditionWizardSummary = (formatColumn) => {
|
|
32
|
-
const { api } = useOnePageAdaptableWizardContext();
|
|
33
|
-
return renderFormatColumnConditionSummary(formatColumn, api);
|
|
34
|
-
};
|
|
35
31
|
export function FormatColumnRuleWizardSection(props) {
|
|
36
32
|
const { data, api, moduleInfo } = useOnePageAdaptableWizardContext();
|
|
37
33
|
if (data.Target && data.Target === 'columnHeader') {
|
|
@@ -5,15 +5,16 @@ import { useAdaptable } from '../../AdaptableContext';
|
|
|
5
5
|
import { getColumnTypeFriendlyName } from '../../../AdaptableState/Common/AdaptableColumn';
|
|
6
6
|
import { isScopeColumnIds } from '../../../AdaptableState/Common/ColumnScope';
|
|
7
7
|
import { Box, Flex } from '../../../components/Flex';
|
|
8
|
-
import FormLayout, { FormRow } from '../../../components/FormLayout';
|
|
9
8
|
import { CheckBox } from '../../../components/CheckBox';
|
|
10
|
-
import { Tag } from '../../../components/Tag';
|
|
9
|
+
import { ColumnTag, Tag } from '../../../components/Tag';
|
|
10
|
+
import { CollapsibleWizardCard, CollapsibleWizardValueSummary, getWizardAccordionSectionClassName, renderCompactColumnTags, useWizardCardAccordion, } from '../../Wizard/CollapsibleWizardCard';
|
|
11
|
+
import { cn } from '../../../lib/utils';
|
|
11
12
|
const FORMAT_COLUMN_ROW_KINDS = ['Data', 'Group', 'Summary', 'Total'];
|
|
12
13
|
const ROW_KIND_LABELS = {
|
|
13
|
-
Data: 'Data (leaf)
|
|
14
|
-
Group: 'Group
|
|
15
|
-
Summary: 'Summary
|
|
16
|
-
Total: 'Total
|
|
14
|
+
Data: 'Data (leaf) Rows',
|
|
15
|
+
Group: 'Group Rows',
|
|
16
|
+
Summary: 'Summary Rows',
|
|
17
|
+
Total: 'Total Rows',
|
|
17
18
|
};
|
|
18
19
|
const ROW_KIND_EXCLUDE_KEY = {
|
|
19
20
|
Data: 'ExcludeDataRows',
|
|
@@ -31,6 +32,18 @@ const isRowKindIncluded = (data, kind) => {
|
|
|
31
32
|
const collectIncludedRowKinds = (data) => {
|
|
32
33
|
return FORMAT_COLUMN_ROW_KINDS.filter((k) => isRowKindIncluded(data, k));
|
|
33
34
|
};
|
|
35
|
+
const isFormatColumnColumnsScopeConfigured = (scope, scopeApi) => {
|
|
36
|
+
if (scopeApi.scopeIsAll(scope)) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
if ('ColumnIds' in scope) {
|
|
40
|
+
return scope.ColumnIds.length > 0;
|
|
41
|
+
}
|
|
42
|
+
if ('DataTypes' in scope) {
|
|
43
|
+
return scope.DataTypes.length > 0;
|
|
44
|
+
}
|
|
45
|
+
return false;
|
|
46
|
+
};
|
|
34
47
|
const FormatColumnScopeSummaryContent = ({ data, }) => {
|
|
35
48
|
const adaptable = useAdaptable();
|
|
36
49
|
const scopeApi = adaptable.api.columnScopeApi;
|
|
@@ -39,23 +52,45 @@ const FormatColumnScopeSummaryContent = ({ data, }) => {
|
|
|
39
52
|
const showRows = data.Target === 'cell';
|
|
40
53
|
const includedKinds = collectIncludedRowKinds(data);
|
|
41
54
|
const allKinds = includedKinds.length === 4;
|
|
42
|
-
return (_jsxs(Box, { className: "twa:flex twa:flex-col twa:gap-3", children: [_jsx(Box, { children: scopeApi.scopeIsAll(scope) ? (_jsxs(_Fragment, { children: ["Columns ", _jsx(Tag, { children: "All" })] })) : 'ColumnIds' in scope ? (_jsxs(_Fragment, { children: ["Columns", ' ', columnsInScope.length ? (columnsInScope.map((column) => (_jsx(
|
|
55
|
+
return (_jsxs(Box, { className: "twa:flex twa:flex-col twa:gap-3", children: [_jsx(Box, { children: scopeApi.scopeIsAll(scope) ? (_jsxs(_Fragment, { children: ["Columns ", _jsx(Tag, { children: "All" })] })) : 'ColumnIds' in scope ? (_jsxs(_Fragment, { children: ["Columns", ' ', columnsInScope.length ? (columnsInScope.map((column) => (_jsx(ColumnTag, { className: "twa:mr-1", children: column.friendlyName }, column.columnId)))) : (_jsx(Tag, { children: "None" }))] })) : 'DataTypes' in scope ? (_jsxs(_Fragment, { children: ["Data Types", ' ', scope.DataTypes.length ? (scope.DataTypes.map((dataType) => (_jsx(Tag, { className: "twa:mr-1", children: getColumnTypeFriendlyName(dataType) }, dataType)))) : (_jsx(Tag, { children: "None" }))] })) : null }), showRows && (_jsxs(Box, { children: ["Rows", ' ', allKinds ? (_jsx(Tag, { children: "All" })) : includedKinds.length === 0 ? (_jsx(Tag, { children: "None" })) : (includedKinds.map((k) => (_jsx(Tag, { className: "twa:mr-1", children: k }, k))))] }))] }));
|
|
43
56
|
};
|
|
44
57
|
export const renderFormatColumnScopeSummary = (data) => {
|
|
45
58
|
return _jsx(FormatColumnScopeSummaryContent, { data: data });
|
|
46
59
|
};
|
|
60
|
+
const FormatColumnColumnsScopeSummary = ({ data, }) => {
|
|
61
|
+
const adaptable = useAdaptable();
|
|
62
|
+
const scopeApi = adaptable.api.columnScopeApi;
|
|
63
|
+
const scope = data.Scope;
|
|
64
|
+
const columnsInScope = scopeApi.getColumnsInScope(scope);
|
|
65
|
+
if (scopeApi.scopeIsAll(scope)) {
|
|
66
|
+
return _jsx(CollapsibleWizardValueSummary, { value: _jsx(Tag, { children: "All columns in the row" }) });
|
|
67
|
+
}
|
|
68
|
+
if ('ColumnIds' in scope) {
|
|
69
|
+
return (_jsx(CollapsibleWizardValueSummary, { value: columnsInScope.length ? (_jsx(Flex, { flexWrap: "wrap", className: "twa:gap-1", children: columnsInScope.map((column) => (_jsx(ColumnTag, { children: column.friendlyName }, column.columnId))) })) : (_jsx(Tag, { children: "None" })) }));
|
|
70
|
+
}
|
|
71
|
+
if ('DataTypes' in scope) {
|
|
72
|
+
return (_jsx(CollapsibleWizardValueSummary, { value: scope.DataTypes.length ? (_jsx(Flex, { flexWrap: "wrap", className: "twa:gap-1", children: scope.DataTypes.map((dataType) => (_jsx(Tag, { children: getColumnTypeFriendlyName(dataType) }, dataType))) })) : (_jsx(Tag, { children: "None" })) }));
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
};
|
|
76
|
+
const FormatColumnRowsScopeSummary = ({ data, }) => {
|
|
77
|
+
const includedKinds = collectIncludedRowKinds(data);
|
|
78
|
+
const allKinds = includedKinds.length === 4;
|
|
79
|
+
return (_jsx(CollapsibleWizardValueSummary, { value: allKinds ? (_jsx(Tag, { children: "All" })) : includedKinds.length === 0 ? (_jsx(Tag, { children: "None" })) : (_jsx(Flex, { flexWrap: "wrap", className: "twa:gap-1", children: includedKinds.map((kind) => (_jsx(Tag, { children: ROW_KIND_LABELS[kind] }, kind))) })) }));
|
|
80
|
+
};
|
|
81
|
+
const FormatColumnRowScopePanel = ({ data, onRowKindChange, }) => (_jsx(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) => (_jsx(CheckBox, { "data-name": `include-${kind.toLowerCase()}-rows-checkbox`, checked: isRowKindIncluded(data, kind), onChange: (checked) => onRowKindChange(kind, checked), children: ROW_KIND_LABELS[kind] }, kind))) }));
|
|
47
82
|
// ---------------------------------------------------------------------------
|
|
48
83
|
// Section
|
|
49
84
|
// ---------------------------------------------------------------------------
|
|
50
85
|
export const FormatColumnScopeWizardSection = (props) => {
|
|
51
86
|
const { data, api } = useOnePageAdaptableWizardContext();
|
|
87
|
+
const adaptable = useAdaptable();
|
|
88
|
+
const scopeApi = adaptable.api.columnScopeApi;
|
|
52
89
|
const handleScopeChange = (Scope) => {
|
|
53
90
|
const newData = { ...data, Scope };
|
|
54
91
|
const wholeRow = api.columnScopeApi.scopeIsAll(Scope);
|
|
55
92
|
if (newData.Rule?.Predicates?.length) {
|
|
56
93
|
if (wholeRow) {
|
|
57
|
-
// if scope is whole row, a predicate cannot be present, so we set the rule
|
|
58
|
-
// to be a boolean expression
|
|
59
94
|
delete newData.Rule.Predicates;
|
|
60
95
|
newData.Rule.BooleanExpression = '';
|
|
61
96
|
}
|
|
@@ -63,8 +98,6 @@ export const FormatColumnScopeWizardSection = (props) => {
|
|
|
63
98
|
const validPredicateIds = new Set(api.formatColumnApi.internalApi.getFormatColumnDefsForScope(Scope).map((def) => def.id));
|
|
64
99
|
newData.Rule = {
|
|
65
100
|
Predicates: newData.Rule.Predicates.filter((p) => validPredicateIds.has(p.PredicateId)).filter((predicate) => {
|
|
66
|
-
// if there are more than 1 column, then we must eliminate the IN/NotIn predicates
|
|
67
|
-
// TODO: this should NOT be required, but the ColumnValueSelector does NOT support creatable values right now
|
|
68
101
|
if (isScopeColumnIds(Scope) && Scope.ColumnIds.length > 1) {
|
|
69
102
|
return predicate.PredicateId !== 'In' && predicate.PredicateId !== 'NotIn';
|
|
70
103
|
}
|
|
@@ -85,8 +118,16 @@ export const FormatColumnScopeWizardSection = (props) => {
|
|
|
85
118
|
});
|
|
86
119
|
};
|
|
87
120
|
const showRowToggles = data.Target === 'cell';
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
121
|
+
const scope = data.Scope;
|
|
122
|
+
const columnsScopeConfigured = isFormatColumnColumnsScopeConfigured(scope, scopeApi);
|
|
123
|
+
const includedRowKinds = collectIncludedRowKinds(data);
|
|
124
|
+
const allRowKindsIncluded = includedRowKinds.length === 4;
|
|
125
|
+
const initialExpandedCardId = columnsScopeConfigured ? null : 'columns';
|
|
126
|
+
const { bindCard, hasExpandedCard, expandedFillsSpace } = useWizardCardAccordion(initialExpandedCardId, { fillExpandedCard: true });
|
|
127
|
+
const columnsCompactSummary = scopeApi.scopeIsAll(scope) ? (_jsx(Tag, { children: "All columns" })) : 'ColumnIds' in scope ? (renderCompactColumnTags(scope.ColumnIds, (columnId) => adaptable.api.columnApi.getFriendlyNameForColumnId(columnId), { emptyLabel: 'No columns' })) : 'DataTypes' in scope ? (_jsx(Flex, { alignItems: "center", className: "twa:gap-1 twa:min-w-0 twa:overflow-hidden", children: scope.DataTypes.length ? (scope.DataTypes.map((dataType) => (_jsx(Tag, { className: "twa:shrink-0", children: getColumnTypeFriendlyName(dataType) }, dataType)))) : (_jsx(Tag, { children: "None" })) })) : null;
|
|
128
|
+
const rowsCompactSummary = allRowKindsIncluded ? (_jsx(Tag, { children: "All" })) : includedRowKinds.length === 0 ? (_jsx(Tag, { children: "None" })) : (_jsx(Flex, { alignItems: "center", className: "twa:gap-1 twa:min-w-0 twa:overflow-hidden", children: includedRowKinds.map((kind) => (_jsx(Tag, { className: "twa:shrink-0", children: kind }, kind))) }));
|
|
129
|
+
return (_jsxs(Box, { className: cn(getWizardAccordionSectionClassName(hasExpandedCard, expandedFillsSpace), 'twa:p-2'), children: [_jsx(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: _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: _jsx(Box, { className: "twa:flex-1 twa:min-h-0 twa:overflow-auto twa:h-full", children: _jsx(NewScopeComponent, { descriptions: {
|
|
130
|
+
rowScope: 'Format all Columns in the Row',
|
|
131
|
+
columnScope: 'Select Columns to format',
|
|
132
|
+
}, scope: data.Scope, updateScope: handleScopeChange }) }) }), showRowToggles && (_jsx(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: _jsx(FormatColumnRowsScopeSummary, { data: data }), children: _jsx(FormatColumnRowScopePanel, { data: data, onRowKindChange: handleRowKindChange }) }))] }));
|
|
92
133
|
};
|
|
@@ -57,7 +57,7 @@ export const FormatColumnSettingsWizardSection = (props) => {
|
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
59
|
const behaviourSpellingVariant = api.internalApi.getCorrectEnglishVariant('Behaviour');
|
|
60
|
-
return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: [_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Name" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Provide a unique name for the Format Column" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(Input, { ref: nameInputRef, className: "twa:max-w-[300px] twa:w-full", "data-name": "format-column-name", onChange: onNameChange, value: data?.Name ?? '' }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Target" }), _jsx(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)" })] }), _jsx(Card.Body, { children: _jsxs(Flex, { flexDirection: "column", children: [_jsx(TypeRadio, { "data-name": "target-column-cell", text: 'Column Cells', description: "", checked: currentTarget === 'cell', onClick: () => handleTargetChange('cell') }), _jsx(TypeRadio, { "data-name": "target-column-header", text: 'Column Header', description: "", checked: currentTarget === 'columnHeader', onClick: () => handleTargetChange('columnHeader') })] }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsxs(Box, { className: "twa:font-medium", children: ["Column Group ", behaviourSpellingVariant] }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose when the Format Column is applied
|
|
60
|
+
return (_jsxs(Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: [_jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Name" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Provide a unique name for the Format Column" })] }), _jsx(Card.Body, { className: "twa:p-1", children: _jsx(Input, { ref: nameInputRef, className: "twa:max-w-[300px] twa:w-full", "data-name": "format-column-name", onChange: onNameChange, value: data?.Name ?? '' }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Target" }), _jsx(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)" })] }), _jsx(Card.Body, { children: _jsxs(Flex, { flexDirection: "column", children: [_jsx(TypeRadio, { "data-name": "target-column-cell", text: 'Column Cells', description: "", checked: currentTarget === 'cell', onClick: () => handleTargetChange('cell') }), _jsx(TypeRadio, { "data-name": "target-column-header", text: 'Column Header', description: "", checked: currentTarget === 'columnHeader', onClick: () => handleTargetChange('columnHeader') })] }) })] }), _jsxs(Card, { shadow: false, children: [_jsxs(Card.Title, { children: [_jsxs(Box, { className: "twa:font-medium", children: ["Column Group ", behaviourSpellingVariant] }), _jsx(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" })] }), _jsx(Card.Body, { children: _jsxs(RadioGroup, { value: data.ColumnGroupScope || 'Both', name: "columnGroupScope", orientation: "horizontal", onRadioChange: (columnGroupScope) => {
|
|
61
61
|
props.onChange({
|
|
62
62
|
...data,
|
|
63
63
|
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,10 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { StyleComponent } from '../../Components/StyleComponent';
|
|
3
3
|
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
4
4
|
import UIHelper from '../../UIHelper';
|
|
5
5
|
import StringExtensions from '../../../Utilities/Extensions/StringExtensions';
|
|
6
6
|
import { Box } from '../../../components/Flex';
|
|
7
7
|
import { Tag } from '../../../components/Tag';
|
|
8
|
+
import { isSummaryInTagLabel, renderSummaryLabelValueTagContent, summaryStringsToTagContents, } from '../../Wizard/SummaryColorTag';
|
|
8
9
|
import { getFormatColumnStylePreviewText } from './FormatColumnPreview';
|
|
9
10
|
export const isFormatColumnStyleValid = (data, api) => {
|
|
10
11
|
if (data.Style &&
|
|
@@ -60,13 +61,9 @@ export const hasFormatColumnStyle = (formatColumn) => {
|
|
|
60
61
|
return getFormatColumnStyleSummaryItems(formatColumn).length > 0;
|
|
61
62
|
};
|
|
62
63
|
export const getFormatColumnStyleViewValues = (formatColumn) => {
|
|
63
|
-
return getFormatColumnStyleSummaryItems(formatColumn).map(({ label, value }) => `${label}: ${value}`);
|
|
64
|
+
return summaryStringsToTagContents(getFormatColumnStyleSummaryItems(formatColumn).map(({ label, value }) => `${label}: ${value}`));
|
|
64
65
|
};
|
|
65
|
-
export const
|
|
66
|
-
const { api } = useOnePageAdaptableWizardContext();
|
|
67
|
-
return renderFormatColumnStyleSummary(data, api);
|
|
68
|
-
};
|
|
69
|
-
export const renderFormatColumnStyleSummary = (data, _api) => {
|
|
66
|
+
export const renderFormatColumnStyleSummary = (data) => {
|
|
70
67
|
const hasStyle = data.Style != null && UIHelper.IsNotEmptyStyle(data.Style);
|
|
71
68
|
if (!hasStyle) {
|
|
72
69
|
return _jsx(Tag, { children: "No Style" });
|
|
@@ -75,7 +72,7 @@ export const renderFormatColumnStyleSummary = (data, _api) => {
|
|
|
75
72
|
if (!items.length) {
|
|
76
73
|
return _jsx(Tag, { children: "No Style" });
|
|
77
74
|
}
|
|
78
|
-
return (_jsx(Box, { className: "twa:grid twa:grid-cols-2 twa:gap-2", children: items.map(({ label, value }) => (
|
|
75
|
+
return (_jsx(Box, { className: "twa:grid twa:grid-cols-2 twa:gap-2", children: items.map(({ label, value }) => (_jsx(Box, { children: isSummaryInTagLabel(label) ? (_jsx(Tag, { children: renderSummaryLabelValueTagContent(label, value) })) : (_jsxs(_Fragment, { children: [label, " ", _jsx(Tag, { children: value })] })) }, label))) }));
|
|
79
76
|
};
|
|
80
77
|
export function FormatColumnStyleWizardSection(props) {
|
|
81
78
|
const { data, api } = useOnePageAdaptableWizardContext();
|
|
@@ -4,7 +4,7 @@ import { useState } from 'react';
|
|
|
4
4
|
import { OnePageAdaptableWizard, OnePageWizardSummary } from '../../Wizard/OnePageAdaptableWizard';
|
|
5
5
|
import { cloneObject } from '../../../Utilities/Helpers/Helper';
|
|
6
6
|
import { FormatColumnScopeWizardSection, renderFormatColumnScopeSummary, } from './FormatColumnScopeWizardSection';
|
|
7
|
-
import { FormatColumnStyleWizardSection, isFormatColumnStyleValid,
|
|
7
|
+
import { FormatColumnStyleWizardSection, isFormatColumnStyleValid, renderFormatColumnStyleSummary, } from './FormatColumnStyleWizardSection';
|
|
8
8
|
import { FormatColumnFormatWizardSection, getFormatDisplayTypeForScope, renderFormatColumnFormatSummary, } from './FormatColumnFormatWizardSection';
|
|
9
9
|
import { useAdaptable } from '../../AdaptableContext';
|
|
10
10
|
import { FormatColumnSettingsWizardSection, renderFormatColumnSettingsSummary, } from './FormatColumnSettingsWizardSection';
|
|
@@ -15,11 +15,11 @@ import { useDispatch } from 'react-redux';
|
|
|
15
15
|
import * as FormatColumnRedux from '../../../Redux/ActionsReducers/FormatColumnRedux';
|
|
16
16
|
import { ObjectTagsWizardSection, renderObjectTagsSummary, } from '../../Wizard/ObjectTagsWizardSection';
|
|
17
17
|
import { isAdaptableRuleValid } from '../../Components/EntityRulesEditor/Utilities';
|
|
18
|
-
import { FormatColumnRuleWizardSection,
|
|
18
|
+
import { FormatColumnRuleWizardSection, renderFormatColumnConditionSummary, } from './FormatColumnRuleWizardSection';
|
|
19
19
|
import { DEFAULT_PREDICATE_ID_FOR_FORMAT_COLUMN } from './constants';
|
|
20
20
|
import { isObjectEmpty } from '../../../Utilities/Extensions/ObjectExtensions';
|
|
21
|
-
import { isAdaptableNumericFormatPreset
|
|
22
|
-
import { Box
|
|
21
|
+
import { isAdaptableNumericFormatPreset } from '../../../AdaptableState/Common/AdaptableFormatPresets';
|
|
22
|
+
import { Box } from '../../../components/Flex';
|
|
23
23
|
import { FormatColumnPreviewSummaryCard } from './FormatColumnPreview';
|
|
24
24
|
const adjustDisplayFormat = (fc, api) => {
|
|
25
25
|
const formatColumn = { ...fc };
|
|
@@ -101,10 +101,7 @@ export function FormatColumnWizard(props) {
|
|
|
101
101
|
// DisplayFormat object so we don't persist an empty shell. Preset
|
|
102
102
|
// strings are always meaningful and should never be removed here.
|
|
103
103
|
const df = formatColumn?.DisplayFormat;
|
|
104
|
-
if (df &&
|
|
105
|
-
!isAdaptableNumericFormatPreset(df) &&
|
|
106
|
-
df.Options &&
|
|
107
|
-
isObjectEmpty(df.Options)) {
|
|
104
|
+
if (df && !isAdaptableNumericFormatPreset(df) && df.Options && isObjectEmpty(df.Options)) {
|
|
108
105
|
delete formatColumn.DisplayFormat;
|
|
109
106
|
}
|
|
110
107
|
if (formatColumn.Style && isObjectEmpty(formatColumn.Style)) {
|
|
@@ -141,9 +138,7 @@ export function FormatColumnWizard(props) {
|
|
|
141
138
|
details: 'Select which Columns and Rows will be formatted',
|
|
142
139
|
isValid: isScopeValid,
|
|
143
140
|
renderSummary: renderFormatColumnScopeSummary,
|
|
144
|
-
render: () => {
|
|
145
|
-
return (_jsx(Flex, { flexDirection: "column", className: "twa:h-full", children: _jsx(FormatColumnScopeWizardSection, { onChange: setFormatColumn }) }));
|
|
146
|
-
},
|
|
141
|
+
render: () => _jsx(FormatColumnScopeWizardSection, { onChange: setFormatColumn }),
|
|
147
142
|
},
|
|
148
143
|
{
|
|
149
144
|
isValid: (abObject, api, context) => {
|
|
@@ -154,7 +149,7 @@ export function FormatColumnWizard(props) {
|
|
|
154
149
|
},
|
|
155
150
|
title: 'Condition',
|
|
156
151
|
details: 'Build a Rule when the Format Column should be applied',
|
|
157
|
-
renderSummary:
|
|
152
|
+
renderSummary: renderFormatColumnConditionSummary,
|
|
158
153
|
render: () => {
|
|
159
154
|
return (_jsx(FormatColumnRuleWizardSection, { onChange: setFormatColumn, defaultPredicateId: DEFAULT_PREDICATE_ID_FOR_FORMAT_COLUMN }));
|
|
160
155
|
},
|
|
@@ -163,7 +158,7 @@ export function FormatColumnWizard(props) {
|
|
|
163
158
|
title: 'Style',
|
|
164
159
|
details: 'Create a Style',
|
|
165
160
|
isValid: isFormatColumnStyleValid,
|
|
166
|
-
renderSummary:
|
|
161
|
+
renderSummary: renderFormatColumnStyleSummary,
|
|
167
162
|
render: () => {
|
|
168
163
|
return (_jsx(Box, { className: "twa:p-2", children: _jsx(FormatColumnStyleWizardSection, { onChange: setFormatColumn }) }));
|
|
169
164
|
},
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export const getFreeTextColumnSettingsTags = (settings) => {
|
|
2
|
-
const {
|
|
2
|
+
const { Width, Filterable, Resizable, Groupable, Sortable, Pivotable, Aggregatable, SuppressMenu, SuppressMovable, } = settings ?? {};
|
|
3
3
|
const colTypes = settings?.ColumnTypes ? settings.ColumnTypes.join(', ') : '';
|
|
4
4
|
return [
|
|
5
|
-
DataType ? `DataType: ${DataType}` : null,
|
|
6
5
|
Width ? `Width: ${Width}px` : null,
|
|
7
6
|
Pivotable ? 'Pivotable' : null,
|
|
8
7
|
Filterable ? 'Filterable' : null,
|
|
@@ -10,6 +9,8 @@ export const getFreeTextColumnSettingsTags = (settings) => {
|
|
|
10
9
|
Groupable ? 'Groupable' : null,
|
|
11
10
|
Sortable ? 'Sortable' : null,
|
|
12
11
|
Aggregatable ? 'Aggregatable' : null,
|
|
12
|
+
SuppressMenu ? 'Suppress Menu' : null,
|
|
13
|
+
SuppressMovable ? 'Suppress Movable' : null,
|
|
13
14
|
colTypes ? `Column Types: ${colTypes}` : null,
|
|
14
15
|
].filter(Boolean);
|
|
15
16
|
};
|