@adaptabletools/adaptable-cjs 23.0.0-canary.7 → 23.0.0-canary.9
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/index.css +98 -17
- package/package.json +1 -1
- package/src/{Utilities → AdaptableState/Aggregations}/weightedAverage.js +2 -3
- package/src/AdaptableState/Common/Enums.d.ts +0 -12
- package/src/AdaptableState/Common/Enums.js +1 -16
- package/src/{Utilities → AdaptableState/Common}/MenuItem.d.ts +4 -4
- package/src/{Utilities → AdaptableState/Common}/MenuItem.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/BulletChartStyle.js +2 -0
- package/src/AdaptableState/StyledColumns/Common/BarStyleProperties.d.ts +84 -0
- package/src/AdaptableState/StyledColumns/Common/BarStyleProperties.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/AlertApiImpl.js +1 -1
- package/src/Api/Implementation/ChartingApiImpl.js +5 -5
- package/src/Api/Implementation/ColumnScopeApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ExportApiImpl.js +1 -1
- package/src/Api/Implementation/LayoutHelpers.js +2 -3
- package/src/Api/Implementation/QuickSearchApiImpl.js +4 -4
- package/src/Api/Implementation/ThemeApiImpl.js +2 -2
- package/src/Api/Internal/ActionColumnInternalApi.js +2 -2
- package/src/Api/Internal/AlertInternalApi.js +1 -1
- package/src/Api/Internal/ChartingInternalApi.js +2 -2
- package/src/Api/Internal/ColumnInternalApi.js +2 -2
- package/src/Api/Internal/EventInternalApi.js +3 -4
- package/src/Api/Internal/ExportInternalApi.js +2 -2
- package/src/Api/Internal/FormatColumnInternalApi.js +4 -4
- package/src/Api/Internal/GridInternalApi.js +1 -1
- package/src/Api/Internal/StyledColumnInternalApi.d.ts +3 -1
- package/src/Api/Internal/StyledColumnInternalApi.js +6 -6
- package/src/Redux/ActionsReducers/ExportRedux.js +1 -1
- package/src/Redux/ActionsReducers/InternalRedux.js +1 -1
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +2 -3
- package/src/Redux/Store/AdaptableReduxMerger.js +7 -9
- package/src/Redux/Store/AdaptableStore.js +5 -5
- package/src/Strategy/AdaptableModuleBase.d.ts +1 -1
- package/src/Strategy/AdaptableModuleBase.js +1 -1
- package/src/Strategy/AlertModule.d.ts +1 -1
- package/src/Strategy/AlertModule.js +2 -2
- package/src/Strategy/BulkUpdateModule.d.ts +1 -1
- package/src/Strategy/CalculatedColumnModule.d.ts +2 -2
- package/src/Strategy/CellSummaryModule.d.ts +2 -2
- package/src/Strategy/ChartingModule.d.ts +1 -1
- package/src/Strategy/ChartingModule.js +4 -4
- package/src/Strategy/ColumnInfoModule.d.ts +2 -2
- package/src/Strategy/CommentModule.d.ts +1 -1
- package/src/Strategy/CustomSortModule.d.ts +1 -1
- package/src/Strategy/ExportModule.js +2 -2
- package/src/Strategy/FlashingCellModule.d.ts +1 -1
- package/src/Strategy/FreeTextColumnModule.d.ts +1 -1
- package/src/Strategy/GridInfoModule.d.ts +2 -2
- package/src/Strategy/LayoutModule.js +2 -2
- package/src/Strategy/NoteModule.d.ts +1 -1
- package/src/Strategy/PlusMinusModule.d.ts +1 -1
- package/src/Strategy/PlusMinusModule.js +8 -8
- package/src/Strategy/SettingsPanelModule.d.ts +2 -2
- package/src/Strategy/SmartEditModule.d.ts +1 -1
- package/src/Strategy/SystemStatusModule.d.ts +2 -2
- package/src/Strategy/TeamSharingModule.js +4 -4
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +2 -3
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +2 -2
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +2 -3
- package/src/Utilities/Extensions/ArrayExtensions.d.ts +32 -0
- package/src/Utilities/Extensions/ArrayExtensions.js +54 -1
- package/src/Utilities/Extensions/NumberExtensions.d.ts +21 -0
- package/src/Utilities/Extensions/NumberExtensions.js +78 -0
- package/src/Utilities/Extensions/ObjectExtensions.d.ts +44 -0
- package/src/Utilities/Extensions/ObjectExtensions.js +277 -0
- package/src/Utilities/Extensions/StringExtensions.d.ts +26 -0
- package/src/Utilities/Extensions/StringExtensions.js +49 -3
- package/src/Utilities/Helpers/AdaptableHelper.js +7 -7
- package/src/Utilities/Helpers/{alertFormHelper.js → AlertHelper.js} +1 -1
- package/src/Utilities/Helpers/DateHelper.js +2 -2
- package/src/Utilities/Helpers/{FormatHelper.js → DisplayFormatHelper.js} +5 -5
- package/src/Utilities/Helpers/Helper.d.ts +0 -6
- package/src/Utilities/Helpers/Helper.js +0 -38
- package/src/Utilities/Helpers/{QuickSearchStyleHelper.js → QuickSearchHelper.js} +2 -3
- package/src/Utilities/Helpers/{ScheduleHelper.d.ts → Scheduling/ScheduleHelper.d.ts} +1 -1
- package/src/Utilities/Helpers/{ScheduleHelper.js → Scheduling/ScheduleHelper.js} +1 -1
- package/src/Utilities/Helpers/{ScheduleJobManager.d.ts → Scheduling/ScheduleJobManager.d.ts} +1 -1
- package/src/Utilities/Helpers/{ScheduleJobRunner.d.ts → Scheduling/ScheduleJobRunner.d.ts} +1 -1
- package/src/Utilities/Helpers/{ScheduledAlertHelper.d.ts → Scheduling/ScheduledAlertHelper.d.ts} +1 -1
- package/src/Utilities/Helpers/{ScheduledAlertHelper.js → Scheduling/ScheduledAlertHelper.js} +4 -4
- package/src/Utilities/Helpers/{ScheduledJobsMiddlewareHelper.d.ts → Scheduling/ScheduledJobsMiddlewareHelper.d.ts} +1 -1
- package/src/Utilities/Helpers/{ScheduledJobsMiddlewareHelper.js → Scheduling/ScheduledJobsMiddlewareHelper.js} +1 -1
- package/src/Utilities/Helpers/{ScheduledReportHelper.d.ts → Scheduling/ScheduledReportHelper.d.ts} +1 -1
- package/src/Utilities/Helpers/{ScheduledReportHelper.js → Scheduling/ScheduledReportHelper.js} +1 -1
- package/src/Utilities/Helpers/SettingsPanelHelper.d.ts +5 -0
- package/src/Utilities/{Defaults/DefaultSettingsPanel.js → Helpers/SettingsPanelHelper.js} +16 -1
- package/src/Utilities/Helpers/StyledColumns/BarStylesHelper.d.ts +63 -0
- package/src/Utilities/Helpers/StyledColumns/BarStylesHelper.js +334 -0
- package/src/Utilities/Helpers/{StyledColumnGradientHelper.d.ts → StyledColumns/GradientStyleHelper.d.ts} +4 -2
- package/src/Utilities/Helpers/{StyledColumnGradientHelper.js → StyledColumns/GradientStyleHelper.js} +9 -9
- package/src/Utilities/Helpers/{IconStylePresets.d.ts → StyledColumns/IconStyleHelper.d.ts} +6 -1
- package/src/Utilities/Helpers/{IconStylePresets.js → StyledColumns/IconStyleHelper.js} +16 -0
- package/src/Utilities/Helpers/{percentBarPreviewHelper.d.ts → StyledColumns/PercentBarStyleHelper.d.ts} +2 -1
- package/src/Utilities/Helpers/{percentBarPreviewHelper.js → StyledColumns/PercentBarStyleHelper.js} +11 -17
- package/src/Utilities/Helpers/{SparklineOptionsHelper.js → StyledColumns/SparklineStyleHelper.js} +1 -1
- package/src/Utilities/Helpers/StyledColumns/StyledColumnHelper.d.ts +52 -0
- package/src/Utilities/Helpers/StyledColumns/StyledColumnHelper.js +124 -0
- package/src/Utilities/Helpers/TimingHelper.d.ts +34 -0
- package/src/Utilities/{utils/debounce.js → Helpers/TimingHelper.js} +25 -9
- package/src/Utilities/ObjectFactory.js +1 -1
- package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +2 -0
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +118 -2
- package/src/Utilities/Services/LicenseService/index.js +1 -1
- package/src/Utilities/Services/RowSummaryService.d.ts +1 -1
- package/src/Utilities/Services/RowSummaryService.js +6 -6
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +2 -2
- package/src/View/Alert/Utilities/getAlertType.js +1 -1
- package/src/View/Alert/Utilities/getDefaultAlertDefinition.js +1 -1
- package/src/View/Alert/Utilities/mapAlertDefinition.js +1 -1
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +1 -1
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +159 -126
- package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +4 -4
- package/src/View/Alert/Wizard/AlertRulesWizardSection.js +1 -1
- package/src/View/Alert/Wizard/AlertScheduledWizardSection.js +1 -1
- package/src/View/Alert/Wizard/AlertScopeWizardSection.js +1 -1
- package/src/View/Alert/Wizard/AlertWizard.js +10 -2
- package/src/View/Alert/Wizard/isValidAlertRules.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/PreviewChartSection.js +2 -2
- package/src/View/Charting/ChartingWizard/AgChargingWizard/SettingsSection.js +2 -2
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.js +2 -2
- package/src/View/Comments/CommentsEditor.js +2 -2
- package/src/View/Comments/CommentsPopup.js +2 -2
- package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +3 -2
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +3 -2
- package/src/View/Components/AdaptableObjectList/objectListActionButtonStyles.d.ts +2 -0
- package/src/View/Components/AdaptableObjectList/objectListActionButtonStyles.js +6 -0
- package/src/View/Components/Buttons/EntityListActionButtons.js +1 -1
- package/src/View/Components/Buttons/SuspendToggleButton/SuspendToggleButton.d.ts +1 -0
- package/src/View/Components/Buttons/SuspendToggleButton/SuspendToggleButton.js +8 -8
- package/src/View/Components/ColumnFilter/ColumnFilter.js +14 -1
- package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +2 -2
- package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +2 -2
- package/src/View/Components/ColumnFilter/components/FloatingFilterInputList.js +2 -2
- package/src/View/Components/Forms/AdaptableFormControlTextClear.js +2 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +2 -2
- package/src/View/Components/Popups/AdaptablePopupAlert.js +2 -2
- package/src/View/Components/Popups/Utilities.js +5 -5
- package/src/View/Components/RangesComponent.d.ts +4 -3
- package/src/View/Components/RangesComponent.js +5 -9
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +3 -3
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +2 -3
- package/src/View/Dashboard/CustomDashboardButton.js +2 -3
- package/src/View/Dashboard/Dashboard.js +2 -2
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +2 -2
- package/src/View/DataChangeHistory/DataChangeHistoryTable.js +2 -2
- package/src/View/DataChangeHistory/DataChangeHistoryViewPanel.js +2 -2
- package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +2 -2
- package/src/View/Export/ExportSchedulesTab.js +3 -4
- package/src/View/Filter/FilterViewPanel.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +13 -13
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +4 -4
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +2 -2
- package/src/View/Layout/LayoutViewPanel.js +2 -2
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +128 -102
- package/src/View/Note/NoteEditor.js +2 -2
- package/src/View/Note/NotePopup.js +2 -2
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +7 -7
- package/src/View/QuickSearch/QuickSearchPopup.js +4 -4
- package/src/View/QuickSearch/useQuickSearchDebounced.js +2 -3
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +1 -1
- package/src/View/SpecialColumnSettingsWizardStep.js +2 -2
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +36 -30
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +1 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +79 -68
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +8 -8
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +42 -15
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +92 -52
- package/src/View/StyledColumn/Wizard/StyledColumnWizardScopeSection.js +14 -14
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarStyleCellTextLayoutEditor.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarStyleCellTextLayoutEditor.js +37 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarStyleCellTextPreview.d.ts +23 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BarStyleCellTextPreview.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 +3 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +7 -9
- 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/StyledColumnGradientPreview.js +4 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.js +24 -15
- 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/Components/StyledColumnSparklinePreview.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +20 -60
- package/src/View/UIHelper.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.js +2 -2
- package/src/View/Wizard/OnePageWizards.js +3 -1
- package/src/agGrid/AdaptableAgGrid.js +11 -11
- package/src/agGrid/AgGridColumnAdapter.js +30 -28
- package/src/agGrid/AgGridExportAdapter.js +3 -3
- package/src/agGrid/AgGridMenuAdapter.js +129 -4
- package/src/agGrid/cellRenderers/BadgeRenderer.js +9 -7
- package/src/agGrid/cellRenderers/BulletChartRenderer.js +47 -46
- package/src/agGrid/cellRenderers/IconRenderer.d.ts +2 -1
- package/src/agGrid/cellRenderers/IconRenderer.js +20 -19
- package/src/agGrid/cellRenderers/PercentBarRenderer.js +29 -101
- package/src/agGrid/cellRenderers/RangeBarRenderer.js +54 -52
- package/src/agGrid/cellRenderers/RatingRenderer.js +6 -6
- package/src/agGrid/editors/AdaptableDateEditor/index.js +3 -3
- package/src/components/ColorPicker/ColorPicker.js +2 -2
- package/src/components/Datepicker/index.js +2 -2
- package/src/components/FormLayout/index.js +2 -2
- package/src/components/OverlayTrigger/index.js +2 -2
- package/src/env.js +2 -2
- package/src/layout-manager/src/isLayoutEqual.js +4 -5
- package/src/metamodel/adaptable.metamodel.d.ts +118 -19
- 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 +12 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +0 -3
- package/src/Utilities/Helpers/iconStyledColumnColumnSupport.d.ts +0 -5
- package/src/Utilities/Helpers/iconStyledColumnColumnSupport.js +0 -18
- package/src/Utilities/Helpers/resolveSettingsPanelNavigation.d.ts +0 -3
- package/src/Utilities/Helpers/resolveSettingsPanelNavigation.js +0 -19
- package/src/Utilities/Helpers/styledColumnRowKindSupport.d.ts +0 -25
- package/src/Utilities/Helpers/styledColumnRowKindSupport.js +0 -70
- package/src/Utilities/Services/CalculatedColumnSyntheticChange.d.ts +0 -4
- package/src/Utilities/Services/CalculatedColumnSyntheticChange.js +0 -120
- package/src/Utilities/utils/chunk.d.ts +0 -6
- package/src/Utilities/utils/chunk.js +0 -20
- package/src/Utilities/utils/clamp.d.ts +0 -5
- package/src/Utilities/utils/clamp.js +0 -10
- package/src/Utilities/utils/cloneDeepWith.d.ts +0 -9
- package/src/Utilities/utils/cloneDeepWith.js +0 -70
- package/src/Utilities/utils/debounce.d.ts +0 -20
- package/src/Utilities/utils/flatten.d.ts +0 -5
- package/src/Utilities/utils/flatten.js +0 -10
- package/src/Utilities/utils/flattenDeep.d.ts +0 -5
- package/src/Utilities/utils/flattenDeep.js +0 -10
- package/src/Utilities/utils/get.d.ts +0 -6
- package/src/Utilities/utils/get.js +0 -38
- package/src/Utilities/utils/index.d.ts +0 -22
- package/src/Utilities/utils/index.js +0 -48
- package/src/Utilities/utils/isArray.d.ts +0 -6
- package/src/Utilities/utils/isArray.js +0 -8
- package/src/Utilities/utils/isEqual.d.ts +0 -5
- package/src/Utilities/utils/isEqual.js +0 -127
- package/src/Utilities/utils/isObject.d.ts +0 -6
- package/src/Utilities/utils/isObject.js +0 -12
- package/src/Utilities/utils/isPlainObject.d.ts +0 -6
- package/src/Utilities/utils/isPlainObject.js +0 -20
- package/src/Utilities/utils/kebabCase.d.ts +0 -5
- package/src/Utilities/utils/kebabCase.js +0 -12
- package/src/Utilities/utils/merge.d.ts +0 -11
- package/src/Utilities/utils/merge.js +0 -44
- package/src/Utilities/utils/mergeWith.d.ts +0 -7
- package/src/Utilities/utils/mergeWith.js +0 -50
- package/src/Utilities/utils/orderBy.d.ts +0 -8
- package/src/Utilities/utils/orderBy.js +0 -33
- package/src/Utilities/utils/parseInt.d.ts +0 -6
- package/src/Utilities/utils/parseInt.js +0 -12
- package/src/Utilities/utils/sentenceCase.d.ts +0 -6
- package/src/Utilities/utils/sentenceCase.js +0 -19
- package/src/Utilities/utils/startCase.d.ts +0 -5
- package/src/Utilities/utils/startCase.js +0 -15
- package/src/Utilities/utils/throttle.d.ts +0 -17
- package/src/Utilities/utils/throttle.js +0 -23
- package/src/Utilities/utils/toNumber.d.ts +0 -5
- package/src/Utilities/utils/toNumber.js +0 -42
- package/src/Utilities/utils/uniq.d.ts +0 -7
- package/src/Utilities/utils/uniq.js +0 -12
- package/src/Utilities/utils/uniqBy.d.ts +0 -8
- package/src/Utilities/utils/uniqBy.js +0 -25
- package/src/Utilities/utils/words.d.ts +0 -7
- package/src/Utilities/utils/words.js +0 -13
- package/src/agGrid/buildValueAggregationMenuItem.d.ts +0 -19
- package/src/agGrid/buildValueAggregationMenuItem.js +0 -114
- package/src/agGrid/cellRenderers/shouldRenderStyledColumnOnRow.d.ts +0 -30
- package/src/agGrid/cellRenderers/shouldRenderStyledColumnOnRow.js +0 -58
- package/src/agGrid/createAgGridIcon.d.ts +0 -10
- package/src/agGrid/createAgGridIcon.js +0 -19
- /package/src/{Utilities → AdaptableState/Aggregations}/only.d.ts +0 -0
- /package/src/{Utilities → AdaptableState/Aggregations}/only.js +0 -0
- /package/src/{Utilities → AdaptableState/Aggregations}/weightedAverage.d.ts +0 -0
- /package/src/Utilities/Helpers/{ActionColumnWidthHelper.d.ts → ActionColumnHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{ActionColumnWidthHelper.js → ActionColumnHelper.js} +0 -0
- /package/src/Utilities/Helpers/{alertFormHelper.d.ts → AlertHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{chartingHelper.d.ts → ChartHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{chartingHelper.js → ChartHelper.js} +0 -0
- /package/src/Utilities/Helpers/{FormatHelper.d.ts → DisplayFormatHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{plusMinusTriggerKeys.d.ts → PlusMinusHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{plusMinusTriggerKeys.js → PlusMinusHelper.js} +0 -0
- /package/src/Utilities/Helpers/{QuickSearchStyleHelper.d.ts → QuickSearchHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{ScheduleJobManager.js → Scheduling/ScheduleJobManager.js} +0 -0
- /package/src/Utilities/Helpers/{ScheduleJobRunner.js → Scheduling/ScheduleJobRunner.js} +0 -0
- /package/src/Utilities/Helpers/{SparklineOptionsHelper.d.ts → StyledColumns/SparklineStyleHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{ThemeHelpers.d.ts → ThemeHelper.d.ts} +0 -0
- /package/src/Utilities/Helpers/{ThemeHelpers.js → ThemeHelper.js} +0 -0
|
@@ -18,7 +18,7 @@ const IconSelector_1 = require("../../../components/IconSelector");
|
|
|
18
18
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
19
19
|
const AdaptableContext_1 = require("../../AdaptableContext");
|
|
20
20
|
const AdaptableIconComponent_1 = require("../../Components/AdaptableIconComponent");
|
|
21
|
-
const
|
|
21
|
+
const IconStyleHelper_1 = require("../../../Utilities/Helpers/StyledColumns/IconStyleHelper");
|
|
22
22
|
const IconRenderer_1 = require("../../../agGrid/cellRenderers/IconRenderer");
|
|
23
23
|
const Card_1 = require("../../../components/Card");
|
|
24
24
|
const SummaryColorTag_1 = require("../../Wizard/SummaryColorTag");
|
|
@@ -73,7 +73,7 @@ const getStyledColumnIconMappingsViewValues = (data) => {
|
|
|
73
73
|
const effectiveMappings = (0, IconRenderer_1.resolveEffectiveIconStyleMappings)(ic);
|
|
74
74
|
const items = [`Mappings: ${effectiveMappings.length}`];
|
|
75
75
|
if (ic.Preset) {
|
|
76
|
-
items.push(`Preset: ${
|
|
76
|
+
items.push(`Preset: ${IconStyleHelper_1.ICON_STYLE_PRESET_LABELS[ic.Preset]}`);
|
|
77
77
|
}
|
|
78
78
|
const customCount = ic.Mappings?.length ?? 0;
|
|
79
79
|
if (customCount > 0) {
|
|
@@ -82,8 +82,9 @@ const getStyledColumnIconMappingsViewValues = (data) => {
|
|
|
82
82
|
if (ic.MatchMode && ic.MatchMode !== 'Exact') {
|
|
83
83
|
items.push(`Match Mode: ${ic.MatchMode}`);
|
|
84
84
|
}
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
const fallbackMode = ic.FallbackProperties?.Mode;
|
|
86
|
+
if (fallbackMode && fallbackMode !== 'Hide') {
|
|
87
|
+
items.push(`Fallback: ${fallbackMode}`);
|
|
87
88
|
}
|
|
88
89
|
return items;
|
|
89
90
|
};
|
|
@@ -96,9 +97,10 @@ const buildStyledColumnIconStyleSummaryStrings = (ic, options) => {
|
|
|
96
97
|
if (ic.Gap != null) {
|
|
97
98
|
items.push(`Gap: ${ic.Gap}px`);
|
|
98
99
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
items.push(`Cell Text
|
|
100
|
+
const ctp = ic.CellTextProperties;
|
|
101
|
+
if (ctp?.CellText?.length) {
|
|
102
|
+
items.push(`Cell Text: ${formatIconCellTextSummary(ctp.CellText)}`);
|
|
103
|
+
items.push(`Cell Text Position: ${ctp.CellTextPosition ?? 'After'}`);
|
|
102
104
|
}
|
|
103
105
|
else if (options.includeEmptyCellText) {
|
|
104
106
|
items.push('Cell Text: None');
|
|
@@ -264,12 +266,35 @@ const StyledColumnWizardIconSection = (props) => {
|
|
|
264
266
|
// -----------------------------------------------------------------------
|
|
265
267
|
// CellText helpers
|
|
266
268
|
// -----------------------------------------------------------------------
|
|
269
|
+
const updateCellTextProperties = (patch) => {
|
|
270
|
+
const merged = {
|
|
271
|
+
...iconStyle.CellTextProperties,
|
|
272
|
+
...patch,
|
|
273
|
+
};
|
|
274
|
+
// Strip the wrapper when both inner properties are unset, so empty state
|
|
275
|
+
// serialises cleanly.
|
|
276
|
+
const isEmpty = !merged.CellText?.length && merged.CellTextPosition == undefined;
|
|
277
|
+
update({ CellTextProperties: isEmpty ? undefined : merged });
|
|
278
|
+
};
|
|
267
279
|
const toggleCellText = (token, checked) => {
|
|
268
|
-
const current = iconStyle.CellText ?? [];
|
|
280
|
+
const current = iconStyle.CellTextProperties?.CellText ?? [];
|
|
269
281
|
const next = checked
|
|
270
282
|
? Array.from(new Set([...current, token]))
|
|
271
283
|
: current.filter((t) => t !== token);
|
|
272
|
-
|
|
284
|
+
updateCellTextProperties({ CellText: next });
|
|
285
|
+
};
|
|
286
|
+
// -----------------------------------------------------------------------
|
|
287
|
+
// Fallback helpers
|
|
288
|
+
// -----------------------------------------------------------------------
|
|
289
|
+
const updateFallbackProperties = (patch) => {
|
|
290
|
+
const merged = {
|
|
291
|
+
...iconStyle.FallbackProperties,
|
|
292
|
+
...patch,
|
|
293
|
+
};
|
|
294
|
+
// Strip the wrapper when there's nothing to remember; the renderer
|
|
295
|
+
// already defaults to `Mode: 'Hide'` when `FallbackProperties` is unset.
|
|
296
|
+
const isEmpty = (merged.Mode == undefined || merged.Mode === 'Hide') && merged.Icon == undefined;
|
|
297
|
+
update({ FallbackProperties: isEmpty ? undefined : merged });
|
|
273
298
|
};
|
|
274
299
|
const toggleToolTipText = (token, checked) => {
|
|
275
300
|
const current = iconStyle.ToolTipText ?? [];
|
|
@@ -283,9 +308,9 @@ const StyledColumnWizardIconSection = (props) => {
|
|
|
283
308
|
// -----------------------------------------------------------------------
|
|
284
309
|
if (props.variant === 'mappings') {
|
|
285
310
|
const presetMappingsPreview = iconStyle.Preset
|
|
286
|
-
? (0,
|
|
311
|
+
? (0, IconStyleHelper_1.getIconStylePresetMappings)(iconStyle.Preset)
|
|
287
312
|
: [];
|
|
288
|
-
return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { children: [(0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:mb-3", 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.jsxs)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: ["Contains most commonly used values; add anything missing in", ' ', (0, jsx_runtime_1.jsx)("strong", { children: "Custom mappings" }), " below"] })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Select Preset:", children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:gap-2 twa:flex-wrap", children: [['Flags', 'Currencies', 'Trend', 'Status'].map((p) => ((0, jsx_runtime_1.jsx)(SimpleButton_1.default, { ...(0, wizardSelection_1.wizardSelectionSimpleButtonProps)(iconStyle.Preset === p), onClick: () => applyPreset(p), children:
|
|
313
|
+
return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { children: [(0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:mb-3", 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.jsxs)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: ["Contains most commonly used values; add anything missing in", ' ', (0, jsx_runtime_1.jsx)("strong", { children: "Custom mappings" }), " below"] })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Select Preset:", children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:gap-2 twa:flex-wrap", children: [['Flags', 'Currencies', 'Trend', 'Status'].map((p) => ((0, jsx_runtime_1.jsx)(SimpleButton_1.default, { ...(0, wizardSelection_1.wizardSelectionSimpleButtonProps)(iconStyle.Preset === p), onClick: () => applyPreset(p), children: IconStyleHelper_1.ICON_STYLE_PRESET_LABELS[p] }, p))), iconStyle.Preset && ((0, jsx_runtime_1.jsx)(SimpleButton_1.default, { variant: "text", icon: "undo", tooltip: "Stop using this preset (custom mappings are kept)", onClick: clearPreset, children: "Clear preset" }))] }) }), iconStyle.Preset && ((0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Active:", children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-1 twa:max-w-[640px]", children: [(0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70", children: [IconStyleHelper_1.ICON_STYLE_PRESET_DESCRIPTIONS[iconStyle.Preset], " \u2014", ' ', presetMappingsPreview.length, " mappings shipped with the preset."] }), renderMappingsPreview(presetMappingsPreview)] }) }))] }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:mb-3", 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 Mappings" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: iconStyle.Preset
|
|
289
314
|
? 'Add any mappings that are not present in the selected preset'
|
|
290
315
|
: 'Add custom mappings entries (icon, key and description)' })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card.Body, { children: [mappings.length === 0 ? ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-60 twa:max-w-[520px] twa:mb-2", children: iconStyle.Preset
|
|
291
316
|
? 'No custom mappings — the preset above is being used as-is'
|
|
@@ -298,14 +323,14 @@ const StyledColumnWizardIconSection = (props) => {
|
|
|
298
323
|
}), placeholder: "Tooltip label (optional)" }) }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:w-8 twa:shrink-0 twa:flex twa:justify-center", children: (0, jsx_runtime_1.jsx)(SimpleButton_1.default, { icon: "delete", variant: "text", tooltip: "Remove mapping", onClick: () => removeMapping(i) }) })] }, i)))] })), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:mt-2", children: (0, jsx_runtime_1.jsx)(ButtonNew_1.ButtonNew, { onClick: addMapping, children: "Add Mapping" }) })] })] }), (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: "Matching" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "How keys are compared to cell values, and what to render when no mapping matches" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Match Mode:", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[200px]", children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { className: "twa:w-full", value: iconStyle.MatchMode ?? 'Exact', onValueChange: (v) => update({ MatchMode: v }), items: [
|
|
299
324
|
{ value: 'Exact', label: 'Exact Match Required' },
|
|
300
325
|
{ value: 'CaseInsensitive', label: 'Case-insensitive (strings)' },
|
|
301
|
-
] }) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Fallback:", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[200px]", children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { className: "twa:w-full", value: iconStyle.
|
|
326
|
+
] }) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Fallback:", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[200px]", children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { className: "twa:w-full", value: iconStyle.FallbackProperties?.Mode ?? 'Hide', onValueChange: (v) => updateFallbackProperties({ Mode: v }), items: [
|
|
302
327
|
{ value: 'Hide', label: 'Show No Value' },
|
|
303
328
|
{ value: 'ShowText', label: 'Show Raw Value' },
|
|
304
329
|
{ value: 'Icon', label: 'Show Fallback Icon' },
|
|
305
|
-
] }) }) }), iconStyle.
|
|
330
|
+
] }) }) }), iconStyle.FallbackProperties?.Mode === 'Icon' && ((0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Fallback Icon:", children: (0, jsx_runtime_1.jsx)(IconPickerButton, { value: iconStyle.FallbackProperties?.Icon, onChange: (next) => updateFallbackProperties({ Icon: next }) }) }))] }) })] })] }));
|
|
306
331
|
}
|
|
307
332
|
// ----- Style variant (wizard step title: "Style") ------------------------
|
|
308
|
-
const cellText = iconStyle.CellText ?? [];
|
|
333
|
+
const cellText = iconStyle.CellTextProperties?.CellText ?? [];
|
|
309
334
|
const toolTipText = iconStyle.ToolTipText ?? [];
|
|
310
335
|
const cellTextDisabled = cellText.length === 0;
|
|
311
336
|
return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { children: [(0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:mb-3", children: [(0, jsx_runtime_1.jsx)(Card_1.Card.Title, { children: "Sizing" }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { sizes: [...STYLE_FORM_SIZES], children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Icon Size (px):", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[100px]", children: (0, jsx_runtime_1.jsx)(Input_1.default, { type: "number", min: 8, step: 1, value: iconStyle.Size ?? '', placeholder: "18", className: "twa:w-full", onChange: (event) => {
|
|
@@ -318,7 +343,9 @@ const StyledColumnWizardIconSection = (props) => {
|
|
|
318
343
|
update({
|
|
319
344
|
Size: Number.isFinite(parsed) && parsed >= 8 ? parsed : undefined,
|
|
320
345
|
});
|
|
321
|
-
} }) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Gap (px):", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[100px]", children: (0, jsx_runtime_1.jsx)(NumberInput_1.NumberInput, { value: iconStyle.Gap ?? '', placeholder: "4", min: 0, step: 1, onChange: (value) => update({ Gap: typeof value === 'number' ? value : undefined }) }) }) })] }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:mb-3", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Cell Text" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Optionally show the raw value or the matched description alongside the icon (e.g. flag plus label)." })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card.Body, { children: [(0, jsx_runtime_1.jsxs)(FormLayout_1.default, { sizes: [...STYLE_FORM_SIZES], children: [(0, jsx_runtime_1.jsxs)(FormLayout_1.FormRow, { label: "Cell Display:", children: [(0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { checked: cellText.includes('CellValue'), onChange: (checked) => toggleCellText('CellValue', checked), children: "Cell Value" }), ' ', (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { className: "twa:ml-3", checked: cellText.includes('IconDescription'), onChange: (checked) => toggleCellText('IconDescription', checked), children: "Description" })] }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Position:", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[160px]", children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { className: "twa:w-full", value: iconStyle.CellTextPosition ?? 'After', onValueChange: (v) =>
|
|
346
|
+
} }) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Gap (px):", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[100px]", children: (0, jsx_runtime_1.jsx)(NumberInput_1.NumberInput, { value: iconStyle.Gap ?? '', placeholder: "4", min: 0, step: 1, onChange: (value) => update({ Gap: typeof value === 'number' ? value : undefined }) }) }) })] }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:mb-3", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Cell Text" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Optionally show the raw value or the matched description alongside the icon (e.g. flag plus label)." })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card.Body, { children: [(0, jsx_runtime_1.jsxs)(FormLayout_1.default, { sizes: [...STYLE_FORM_SIZES], children: [(0, jsx_runtime_1.jsxs)(FormLayout_1.FormRow, { label: "Cell Display:", children: [(0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { checked: cellText.includes('CellValue'), onChange: (checked) => toggleCellText('CellValue', checked), children: "Cell Value" }), ' ', (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { className: "twa:ml-3", checked: cellText.includes('IconDescription'), onChange: (checked) => toggleCellText('IconDescription', checked), children: "Description" })] }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Position:", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[160px]", children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { className: "twa:w-full", value: iconStyle.CellTextProperties?.CellTextPosition ?? 'After', onValueChange: (v) => updateCellTextProperties({
|
|
347
|
+
CellTextPosition: v,
|
|
348
|
+
}), items: [
|
|
322
349
|
{ value: 'Before', label: 'Before' },
|
|
323
350
|
{ value: 'After', label: 'After' },
|
|
324
351
|
{ value: 'Above', label: 'Above' },
|
|
@@ -14,7 +14,6 @@ const RangesComponent_1 = require("../../Components/RangesComponent");
|
|
|
14
14
|
const ColumnSelector_1 = require("../../Components/Selectors/ColumnSelector");
|
|
15
15
|
const UIHelper_1 = require("../../UIHelper");
|
|
16
16
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
17
|
-
const ArrayExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Extensions/ArrayExtensions"));
|
|
18
17
|
const AdaptableInput_1 = tslib_1.__importDefault(require("../../Components/AdaptableInput"));
|
|
19
18
|
const Flex_1 = require("../../../components/Flex");
|
|
20
19
|
const NewSelect_1 = require("../../../components/NewSelect");
|
|
@@ -22,6 +21,8 @@ const RangeBarRangesSummaryPreview_1 = require("./StyledColumnWizardStyleSection
|
|
|
22
21
|
const StyledColumnRangeBarPreview_1 = require("./StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview");
|
|
23
22
|
const Card_1 = require("../../../components/Card");
|
|
24
23
|
const SummaryColorTag_1 = require("../../Wizard/SummaryColorTag");
|
|
24
|
+
const BarStylesHelper_1 = require("../../../Utilities/Helpers/StyledColumns/BarStylesHelper");
|
|
25
|
+
const BarStyleCellTextLayoutEditor_1 = require("./StyledColumnWizardStyleSection/Components/BarStyleCellTextLayoutEditor");
|
|
25
26
|
const RANGE_STYLE_FORM_SIZES = ['200px', '1fr'];
|
|
26
27
|
const BOUND_MODE_LABELS = {
|
|
27
28
|
Number: 'Fixed Number',
|
|
@@ -109,14 +110,10 @@ const RangeBarBoundInput = ({ api, value, optional, fallbackNumber, excludeColum
|
|
|
109
110
|
'twa:[&_.ab-Input]:w-full twa:[&_.ab-Input]:rounded-l-none!',
|
|
110
111
|
'twa:[&_[data-slot=input-group]]:w-full! twa:[&_[data-slot=input-group]]:rounded-l-none!',
|
|
111
112
|
].join(' ');
|
|
112
|
-
return ((0, jsx_runtime_1.jsxs)(InputGroup_1.InputGroup, { Component: Flex_1.Flex, className: "twa:items-stretch twa:max-w-[22rem]", children: [(0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { className: `twa:w-[150px] twa:max-w-none twa:shrink-0 twa:box-border${hasEditor ? '
|
|
113
|
+
return ((0, jsx_runtime_1.jsxs)(InputGroup_1.InputGroup, { Component: Flex_1.Flex, className: "twa:items-stretch twa:max-w-[22rem]", children: [(0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { className: `twa:w-[150px] twa:max-w-none twa:shrink-0 twa:box-border${hasEditor ? 'twa:rounded-r-none!' : ''}`, disabled: disabled, value: mode, items: items, onValueChange: (v) => handleModeChange(v) }), hasEditor && (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: editorWrapperClassName, children: editor })] }));
|
|
113
114
|
};
|
|
114
|
-
const formatRangeBarCellTextSummary = (cellText) => cellText
|
|
115
|
-
|
|
116
|
-
.join(' + ') ?? '';
|
|
117
|
-
const formatRangeBarToolTipSummary = (toolTipText) => toolTipText
|
|
118
|
-
?.map((t) => (t === 'CellValue' ? 'Cell Value' : 'Percent Value'))
|
|
119
|
-
.join(' + ') ?? '';
|
|
115
|
+
const formatRangeBarCellTextSummary = (cellText) => cellText?.map((t) => (t === 'CellValue' ? 'Cell Value' : 'Percent Value')).join(' + ') ?? '';
|
|
116
|
+
const formatRangeBarToolTipSummary = (toolTipText) => toolTipText?.map((t) => (t === 'CellValue' ? 'Cell Value' : 'Percent Value')).join(' + ') ?? '';
|
|
120
117
|
const getStyledColumnRangeBarRangeViewValues = (data) => {
|
|
121
118
|
const range = data.RangeBarStyle;
|
|
122
119
|
if (!range) {
|
|
@@ -126,8 +123,8 @@ const getStyledColumnRangeBarRangeViewValues = (data) => {
|
|
|
126
123
|
`Min: ${summarizeBound(range.Min)}`,
|
|
127
124
|
`Max: ${summarizeBound(range.Max)}`,
|
|
128
125
|
];
|
|
129
|
-
if (range.Reference != undefined) {
|
|
130
|
-
items.push(`Reference: ${summarizeBound(range.Reference)}`);
|
|
126
|
+
if (range.Reference?.Value != undefined) {
|
|
127
|
+
items.push(`Reference: ${summarizeBound(range.Reference.Value)}`);
|
|
131
128
|
}
|
|
132
129
|
const bandCount = range.CellRanges?.length ?? 0;
|
|
133
130
|
if (bandCount > 0) {
|
|
@@ -142,7 +139,8 @@ exports.getStyledColumnRangeBarRangeViewValues = getStyledColumnRangeBarRangeVie
|
|
|
142
139
|
const buildStyledColumnRangeBarDisplaySummaryStrings = (range, options) => {
|
|
143
140
|
const items = [];
|
|
144
141
|
const valueMarker = range.Marker;
|
|
145
|
-
const
|
|
142
|
+
const referenceProperties = range.Reference;
|
|
143
|
+
const referenceMarker = referenceProperties?.Marker;
|
|
146
144
|
items.push(`Value Marker Shape: ${valueMarker?.Shape ?? 'Diamond'}`);
|
|
147
145
|
if (valueMarker?.Color) {
|
|
148
146
|
items.push(`Value Marker Colour: ${valueMarker.Color}`);
|
|
@@ -150,7 +148,7 @@ const buildStyledColumnRangeBarDisplaySummaryStrings = (range, options) => {
|
|
|
150
148
|
if (valueMarker?.Size != null) {
|
|
151
149
|
items.push(`Value Marker Size: ${valueMarker.Size}px`);
|
|
152
150
|
}
|
|
153
|
-
if (
|
|
151
|
+
if (referenceProperties?.Value != undefined) {
|
|
154
152
|
items.push(`Reference Marker Shape: ${referenceMarker?.Shape ?? 'Line'}`);
|
|
155
153
|
if (referenceMarker?.Color) {
|
|
156
154
|
items.push(`Reference Marker Colour: ${referenceMarker.Color}`);
|
|
@@ -162,25 +160,31 @@ const buildStyledColumnRangeBarDisplaySummaryStrings = (range, options) => {
|
|
|
162
160
|
if (range.Orientation === 'Vertical') {
|
|
163
161
|
items.push('Orientation: Vertical');
|
|
164
162
|
}
|
|
165
|
-
const
|
|
163
|
+
const outOfRangeProperties = range.OutOfRange;
|
|
164
|
+
const outOfRangeMode = outOfRangeProperties?.Mode ?? 'Clamp';
|
|
166
165
|
if (outOfRangeMode !== 'Clamp') {
|
|
167
166
|
items.push(`Out of Range: ${outOfRangeMode}`);
|
|
168
167
|
}
|
|
169
|
-
if (
|
|
170
|
-
items.push(`Out of Range Colour: ${
|
|
168
|
+
if (outOfRangeProperties?.Color) {
|
|
169
|
+
items.push(`Out of Range Colour: ${outOfRangeProperties.Color}`);
|
|
171
170
|
}
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
const trackProperties = range.Track;
|
|
172
|
+
if (trackProperties?.Color) {
|
|
173
|
+
items.push(`Track Colour: ${trackProperties.Color}`);
|
|
174
174
|
}
|
|
175
|
-
if (
|
|
176
|
-
items.push(`Track Height: ${
|
|
175
|
+
if (trackProperties?.Height != null) {
|
|
176
|
+
items.push(`Track Height: ${trackProperties.Height}px`);
|
|
177
177
|
}
|
|
178
178
|
if (range.BackColor) {
|
|
179
179
|
items.push(`Back Colour: ${range.BackColor}`);
|
|
180
180
|
}
|
|
181
|
-
if (range.
|
|
182
|
-
|
|
183
|
-
items.push(`Cell Text
|
|
181
|
+
if ((0, BarStylesHelper_1.hasBarStyleCellTextConfigured)(range.CellTextProperties)) {
|
|
182
|
+
const tokens = (0, BarStylesHelper_1.getActiveBarStyleCellTextTokens)(range.CellTextProperties);
|
|
183
|
+
items.push(`Cell Text: ${formatRangeBarCellTextSummary(tokens)}`);
|
|
184
|
+
const layoutSummary = (0, BarStylesHelper_1.formatBarStyleCellTextLayoutSummary)((0, BarStylesHelper_1.resolveBarStyleCellTextLayout)(range.CellTextProperties));
|
|
185
|
+
if (layoutSummary) {
|
|
186
|
+
items.push(`Placement: ${layoutSummary}`);
|
|
187
|
+
}
|
|
184
188
|
}
|
|
185
189
|
else if (options.includeEmptyCellText) {
|
|
186
190
|
items.push('Cell Text: None');
|
|
@@ -332,22 +336,50 @@ const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
332
336
|
},
|
|
333
337
|
});
|
|
334
338
|
}, [data, range]);
|
|
335
|
-
const
|
|
339
|
+
const updateBackColor = (color) => {
|
|
336
340
|
if (color) {
|
|
337
|
-
update({
|
|
341
|
+
update({ BackColor: color });
|
|
338
342
|
return;
|
|
339
343
|
}
|
|
340
344
|
const next = { ...range };
|
|
341
|
-
delete next
|
|
345
|
+
delete next.BackColor;
|
|
342
346
|
props.onChange({ ...data, RangeBarStyle: next });
|
|
343
347
|
};
|
|
348
|
+
const updateTrackProperties = (patch) => {
|
|
349
|
+
const merged = {
|
|
350
|
+
...range.Track,
|
|
351
|
+
...patch,
|
|
352
|
+
};
|
|
353
|
+
const isEmpty = merged.Color == undefined && merged.Height == undefined;
|
|
354
|
+
update({ Track: isEmpty ? undefined : merged });
|
|
355
|
+
};
|
|
356
|
+
const updateOutOfRangeProperties = (patch) => {
|
|
357
|
+
const merged = {
|
|
358
|
+
...range.OutOfRange,
|
|
359
|
+
...patch,
|
|
360
|
+
};
|
|
361
|
+
// Default mode is `Clamp` with no override colour; drop the wrapper in
|
|
362
|
+
// that case so empty state serialises cleanly.
|
|
363
|
+
const isEmpty = (merged.Mode == undefined || merged.Mode === 'Clamp') && merged.Color == undefined;
|
|
364
|
+
update({ OutOfRange: isEmpty ? undefined : merged });
|
|
365
|
+
};
|
|
366
|
+
const updateReferenceProperties = (patch) => {
|
|
367
|
+
const merged = {
|
|
368
|
+
Value: range.Reference?.Value,
|
|
369
|
+
...range.Reference,
|
|
370
|
+
...patch,
|
|
371
|
+
};
|
|
372
|
+
update({ Reference: merged });
|
|
373
|
+
};
|
|
344
374
|
// -- Bound editors ---------------------------------------------------------
|
|
345
375
|
// Resolved values for the column-wide aggregate bound modes, shown read-only
|
|
346
376
|
// in the bound editor so the user sees the underlying number.
|
|
347
377
|
const resolvedBoundValues = {
|
|
348
378
|
'Col-Min': minMaxRangeValues?.min,
|
|
349
379
|
'Col-Max': minMaxRangeValues?.max,
|
|
350
|
-
'Col-Avg': column
|
|
380
|
+
'Col-Avg': column
|
|
381
|
+
? api.styledColumnApi.internalApi.getAvgValueForNumericColumn(column)
|
|
382
|
+
: undefined,
|
|
351
383
|
'Col-Median': column
|
|
352
384
|
? api.styledColumnApi.internalApi.getMedianValueForNumericColumn(column)
|
|
353
385
|
: undefined,
|
|
@@ -359,6 +391,16 @@ const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
359
391
|
*/
|
|
360
392
|
const renderBoundEditor = (opts) => {
|
|
361
393
|
const setBound = (next) => {
|
|
394
|
+
if (opts.field === 'Reference') {
|
|
395
|
+
if (next === undefined) {
|
|
396
|
+
const cleaned = { ...range };
|
|
397
|
+
delete cleaned.Reference;
|
|
398
|
+
props.onChange({ ...data, RangeBarStyle: cleaned });
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
updateReferenceProperties({ Value: next });
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
362
404
|
if (next === undefined) {
|
|
363
405
|
const cleaned = { ...range };
|
|
364
406
|
delete cleaned[opts.field];
|
|
@@ -367,7 +409,8 @@ const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
367
409
|
}
|
|
368
410
|
update({ [opts.field]: next });
|
|
369
411
|
};
|
|
370
|
-
|
|
412
|
+
const value = opts.field === 'Reference' ? range.Reference?.Value : range[opts.field];
|
|
413
|
+
return ((0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: `${opts.label}:`, children: (0, jsx_runtime_1.jsx)(RangeBarBoundInput, { api: api, value: value, optional: opts.optional, fallbackNumber: opts.fallbackNumber, excludeColumnId: data.ColumnId, resolved: resolvedBoundValues, disabled: disabled, onChange: setBound }) }));
|
|
371
414
|
};
|
|
372
415
|
// -- Marker editors --------------------------------------------------------
|
|
373
416
|
const updateValueMarker = (patch) => {
|
|
@@ -380,10 +423,10 @@ const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
380
423
|
});
|
|
381
424
|
};
|
|
382
425
|
const updateReferenceMarker = (patch) => {
|
|
383
|
-
|
|
384
|
-
|
|
426
|
+
updateReferenceProperties({
|
|
427
|
+
Marker: {
|
|
385
428
|
Shape: 'Line',
|
|
386
|
-
...range.
|
|
429
|
+
...range.Reference?.Marker,
|
|
387
430
|
...patch,
|
|
388
431
|
},
|
|
389
432
|
});
|
|
@@ -395,18 +438,20 @@ const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
395
438
|
Color: range.Marker?.Color ?? '',
|
|
396
439
|
Size: range.Marker?.Size ?? (range.Marker?.Shape === 'Line' ? 2 : 10),
|
|
397
440
|
};
|
|
441
|
+
const referenceMarkerCfg = range.Reference?.Marker;
|
|
398
442
|
const referenceMarker = {
|
|
399
|
-
Shape:
|
|
400
|
-
Color:
|
|
401
|
-
Size:
|
|
443
|
+
Shape: referenceMarkerCfg?.Shape ?? 'Line',
|
|
444
|
+
Color: referenceMarkerCfg?.Color ?? '',
|
|
445
|
+
Size: referenceMarkerCfg?.Size ?? (referenceMarkerCfg?.Shape === 'Line' ? 2 : 8),
|
|
402
446
|
};
|
|
403
447
|
// -- Cell text -------------------------------------------------------------
|
|
404
|
-
const toggleCellText = (token,
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
448
|
+
const toggleCellText = (token, show) => {
|
|
449
|
+
update((0, BarStylesHelper_1.toggleBarStyleCellTextToken)(range.CellTextProperties, token, show));
|
|
450
|
+
};
|
|
451
|
+
const onCellTextPlacementChange = (token, patch) => {
|
|
452
|
+
update({
|
|
453
|
+
CellTextProperties: (0, BarStylesHelper_1.patchBarStyleCellTextPlacement)(range.CellTextProperties, token, patch),
|
|
454
|
+
});
|
|
410
455
|
};
|
|
411
456
|
const toggleToolTipText = (token, checked) => {
|
|
412
457
|
const current = range.ToolTipText ?? [];
|
|
@@ -415,9 +460,6 @@ const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
415
460
|
: current.filter((t) => t !== token);
|
|
416
461
|
update({ ToolTipText: next });
|
|
417
462
|
};
|
|
418
|
-
const handleCellTextPositionChange = (pos) => {
|
|
419
|
-
update({ CellTextPosition: pos });
|
|
420
|
-
};
|
|
421
463
|
// -------------------------------------------------------------------------
|
|
422
464
|
// Render
|
|
423
465
|
// -------------------------------------------------------------------------
|
|
@@ -426,8 +468,8 @@ const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
426
468
|
? 'You need to select a column before styling.'
|
|
427
469
|
: `Column "${data.ColumnId}" was not found in the grid.` }) }));
|
|
428
470
|
}
|
|
429
|
-
const hasReference = range.Reference != undefined;
|
|
430
|
-
const outOfRangeMode = range.
|
|
471
|
+
const hasReference = range.Reference?.Value != undefined;
|
|
472
|
+
const outOfRangeMode = range.OutOfRange?.Mode ?? 'Clamp';
|
|
431
473
|
const isRangeVariant = props.variant === 'range';
|
|
432
474
|
return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { children: [isRangeVariant && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:mb-3", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Bounds" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Set each row's track scale. A bound can be a fixed number, another column's value (read per row), or a column-wide aggregate (min, max, average, median). Reference is an optional second marker." })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [renderBoundEditor({
|
|
433
475
|
label: 'Min',
|
|
@@ -449,16 +491,14 @@ const StyledColumnWizardRangeBarSection = (props) => {
|
|
|
449
491
|
: 'Optional second marker when a Reference bound is set on the Style step.' })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: hasReference ? ((0, jsx_runtime_1.jsxs)(FormLayout_1.default, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Shape:", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[160px]", children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { className: "twa:w-full", value: referenceMarker.Shape, onValueChange: (s) => updateReferenceMarker({ Shape: s }), items: MARKER_SHAPES.map((s) => ({ value: s.value, label: s.label })) }) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: `${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: (0, jsx_runtime_1.jsx)(ColorPicker_1.ColorPicker, { disabled: disabled, api: api, value: referenceMarker.Color || undefined, onChange: (c) => updateReferenceMarker({ Color: c }) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Size:", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[100px]", children: (0, jsx_runtime_1.jsx)(AdaptableInput_1.default, { type: "number", min: 1, value: referenceMarker.Size, onChange: (e) => updateReferenceMarker({ Size: Number(e.target.value) }) }) }) })] })) : ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-60 twa:max-w-[520px]", children: "Add a Reference value on the Style step (Bounds section) to enable this marker (e.g. previous close, target, midpoint)." })) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:mb-3", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Track" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "The line representing the [Min, Max] interval, plus optional cell background." })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Orientation:", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[160px]", children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { className: "twa:w-full", value: range.Orientation ?? 'Horizontal', onValueChange: (v) => update({ Orientation: v }), items: [
|
|
450
492
|
{ value: 'Horizontal', label: 'Horizontal' },
|
|
451
493
|
{ value: 'Vertical', label: 'Vertical' },
|
|
452
|
-
] }) }) }), range.Orientation === 'Vertical' && ((0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "", children: (0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:text-xs twa:text-neutral-500 twa:max-w-[520px]", children: ["Tip: vertical Range Bars need a tall row height to be readable (we recommend at least 60px). Set ", (0, jsx_runtime_1.jsx)("code", { children: "rowHeight" }), " on ", (0, jsx_runtime_1.jsx)("code", { children: " gridOptions " }), " or use ", (0, jsx_runtime_1.jsx)("code", { children: "getRowHeight" }), "."] }) })), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: `Track ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: (0, jsx_runtime_1.jsx)(ColorPicker_1.OptionalColorPicker, { disabled: disabled, api: api, value: range.
|
|
453
|
-
|
|
454
|
-
}), placeholder: "4" }) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: `Back ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: (0, jsx_runtime_1.jsx)(ColorPicker_1.OptionalColorPicker, { disabled: disabled, api: api, value: range.BackColor ?? undefined, defaultColor: (0, UIHelper_1.getGraySwatchColor)(), onChange: (c) =>
|
|
494
|
+
] }) }) }), range.Orientation === 'Vertical' && ((0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "", children: (0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:text-xs twa:text-neutral-500 twa:max-w-[520px]", children: ["Tip: vertical Range Bars need a tall row height to be readable (we recommend at least 60px). Set ", (0, jsx_runtime_1.jsx)("code", { children: "rowHeight" }), " on ", (0, jsx_runtime_1.jsx)("code", { children: " gridOptions " }), " or use ", (0, jsx_runtime_1.jsx)("code", { children: "getRowHeight" }), "."] }) })), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: `Track ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: (0, jsx_runtime_1.jsx)(ColorPicker_1.OptionalColorPicker, { disabled: disabled, api: api, value: range.Track?.Color, defaultColor: (0, UIHelper_1.getGraySwatchColor)(), onChange: (c) => updateTrackProperties({ Color: c }) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: range.Orientation === 'Vertical' ? 'Track Width (px):' : 'Track Height (px):', children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[100px]", children: (0, jsx_runtime_1.jsx)(AdaptableInput_1.default, { type: "number", min: 1, value: range.Track?.Height ?? '', onChange: (e) => updateTrackProperties({
|
|
495
|
+
Height: e.target.value === '' ? undefined : Number(e.target.value),
|
|
496
|
+
}), placeholder: "4" }) }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: `Back ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: (0, jsx_runtime_1.jsx)(ColorPicker_1.OptionalColorPicker, { disabled: disabled, api: api, value: range.BackColor ?? undefined, defaultColor: (0, UIHelper_1.getGraySwatchColor)(), onChange: (c) => updateBackColor(c) }) })] }) })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, className: "twa:mb-3", children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Out of Range" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "How to draw the value marker when the cell value falls outside [Min, Max]." })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Behaviour:", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:max-w-[160px]", children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { className: "twa:w-full", value: outOfRangeMode, onValueChange: (v) => updateOutOfRangeProperties({
|
|
497
|
+
Mode: v,
|
|
498
|
+
}), items: [
|
|
455
499
|
{ value: 'Clamp', label: 'Clamp to edge' },
|
|
456
500
|
{ value: 'Overflow', label: 'Show outside' },
|
|
457
501
|
{ value: 'Hide', label: 'Hide marker' },
|
|
458
|
-
] }) }) }), outOfRangeMode === 'Clamp' && ((0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: `Out-of-range ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: (0, jsx_runtime_1.jsx)(ColorPicker_1.OptionalColorPicker, { disabled: disabled, api: api, value: range.
|
|
459
|
-
{ value: 'Above', label: 'Above Bar' },
|
|
460
|
-
{ value: 'Below', label: 'Below Bar' },
|
|
461
|
-
{ value: 'Merged', label: 'Merged' },
|
|
462
|
-
] }) }) }), (0, jsx_runtime_1.jsxs)(FormLayout_1.FormRow, { label: "Tooltip Display:", children: [(0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { disabled: disabled, checked: range.ToolTipText?.includes('CellValue'), onChange: (checked) => toggleToolTipText('CellValue', checked), children: "Cell Value" }), ' ', (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { disabled: disabled, className: "twa:ml-3", checked: range.ToolTipText?.includes('PercentageValue'), onChange: (checked) => toggleToolTipText('PercentageValue', checked), children: "Percent Value" })] })] }) })] }), (0, jsx_runtime_1.jsx)(StyledColumnRangeBarPreview_1.StyledColumnRangeBarPreviewCard, { data: data })] }))] }));
|
|
502
|
+
] }) }) }), outOfRangeMode === 'Clamp' && ((0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: `Out-of-range ${api.internalApi.getCorrectEnglishVariant('Colour')}:`, children: (0, jsx_runtime_1.jsx)(ColorPicker_1.OptionalColorPicker, { disabled: disabled, api: api, value: range.OutOfRange?.Color, defaultColor: "crimson", onChange: (c) => updateOutOfRangeProperties({ Color: c }) }) }))] }) })] }), (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: "Text & Tooltip" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Optional cell-text overlay and AG Grid tooltip content." })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { sizes: [...RANGE_STYLE_FORM_SIZES], children: [(0, jsx_runtime_1.jsx)(BarStyleCellTextLayoutEditor_1.BarStyleCellTextLayoutEditor, { disabled: disabled, cellTextProperties: range.CellTextProperties, onToggle: toggleCellText, onPlacementChange: onCellTextPlacementChange }), (0, jsx_runtime_1.jsxs)(FormLayout_1.FormRow, { label: "Tooltip Display:", children: [(0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { disabled: disabled, checked: range.ToolTipText?.includes('CellValue'), onChange: (checked) => toggleToolTipText('CellValue', checked), children: "Cell Value" }), ' ', (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { disabled: disabled, className: "twa:ml-3", checked: range.ToolTipText?.includes('PercentageValue'), onChange: (checked) => toggleToolTipText('PercentageValue', checked), children: "Percent Value" })] })] }) })] }), (0, jsx_runtime_1.jsx)(StyledColumnRangeBarPreview_1.StyledColumnRangeBarPreviewCard, { data: data })] }))] }));
|
|
463
503
|
};
|
|
464
504
|
exports.StyledColumnWizardRangeBarSection = StyledColumnWizardRangeBarSection;
|
|
@@ -10,8 +10,8 @@ const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
|
10
10
|
const Flex_1 = require("../../../components/Flex");
|
|
11
11
|
const CheckBox_1 = require("../../../components/CheckBox");
|
|
12
12
|
const utils_1 = require("../../../lib/utils");
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const StyledColumnHelper_1 = require("../../../Utilities/Helpers/StyledColumns/StyledColumnHelper");
|
|
14
|
+
const IconStyleHelper_1 = require("../../../Utilities/Helpers/StyledColumns/IconStyleHelper");
|
|
15
15
|
const CollapsibleWizardCard_1 = require("../../Wizard/CollapsibleWizardCard");
|
|
16
16
|
// ---------------------------------------------------------------------------
|
|
17
17
|
// Row-kind helpers
|
|
@@ -37,23 +37,23 @@ const defaultRowKindIncluded = (styledColumn, kind) => {
|
|
|
37
37
|
if (styledColumn.BadgeStyle) {
|
|
38
38
|
return true;
|
|
39
39
|
}
|
|
40
|
-
if (!(0,
|
|
40
|
+
if (!(0, StyledColumnHelper_1.isStyledColumnRowKindSupported)(styledColumn, kind)) {
|
|
41
41
|
return false;
|
|
42
42
|
}
|
|
43
43
|
return kind !== 'Group';
|
|
44
44
|
};
|
|
45
45
|
const isRowKindIncluded = (styledColumn, kind) => {
|
|
46
|
-
if (!(0,
|
|
46
|
+
if (!(0, StyledColumnHelper_1.isStyledColumnRowKindSupported)(styledColumn, kind)) {
|
|
47
47
|
return false;
|
|
48
48
|
}
|
|
49
49
|
const scope = styledColumn.RowScope;
|
|
50
50
|
if (scope) {
|
|
51
|
-
return !scope[
|
|
51
|
+
return !scope[StyledColumnHelper_1.STYLED_COLUMN_ROW_KIND_EXCLUDE_KEY[kind]];
|
|
52
52
|
}
|
|
53
53
|
return defaultRowKindIncluded(styledColumn, kind);
|
|
54
54
|
};
|
|
55
55
|
const collectIncludedRowKinds = (styledColumn) => {
|
|
56
|
-
return
|
|
56
|
+
return StyledColumnHelper_1.STYLED_COLUMN_ROW_KINDS.filter((k) => isRowKindIncluded(styledColumn, k));
|
|
57
57
|
};
|
|
58
58
|
// ---------------------------------------------------------------------------
|
|
59
59
|
// Summary
|
|
@@ -86,7 +86,7 @@ const isValidStyledColumnScope = (data, api) => {
|
|
|
86
86
|
return 'Please select a column for the Styled Column.';
|
|
87
87
|
}
|
|
88
88
|
if (data.IconStyle &&
|
|
89
|
-
(0,
|
|
89
|
+
(0, IconStyleHelper_1.isUnsupportedColumnDataTypeForIconStyle)(api.columnApi.getColumnDataTypeForColumnId(data.ColumnId))) {
|
|
90
90
|
return 'Icon Style applies to scalar cell values only. Choose a numeric or plain text column, or use Badge Style for array columns.';
|
|
91
91
|
}
|
|
92
92
|
if (collectIncludedRowKinds(data).length === 0) {
|
|
@@ -95,15 +95,15 @@ const isValidStyledColumnScope = (data, api) => {
|
|
|
95
95
|
return true;
|
|
96
96
|
};
|
|
97
97
|
exports.isValidStyledColumnScope = isValidStyledColumnScope;
|
|
98
|
-
const StyledColumnRowScopePanel = ({ 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:
|
|
99
|
-
const supported = (0,
|
|
100
|
-
const disabledReason = (0,
|
|
98
|
+
const StyledColumnRowScopePanel = ({ 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: StyledColumnHelper_1.STYLED_COLUMN_ROW_KINDS.map((kind) => {
|
|
99
|
+
const supported = (0, StyledColumnHelper_1.isStyledColumnRowKindSupported)(data, kind);
|
|
100
|
+
const disabledReason = (0, StyledColumnHelper_1.getStyledColumnRowKindDisabledReason)(data, kind);
|
|
101
101
|
return ((0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { "data-name": `include-${kind.toLowerCase()}-rows-checkbox`, disabled: !supported, title: disabledReason, checked: isRowKindIncluded(data, kind), onChange: (checked) => onRowKindChange(kind, checked), children: ROW_KIND_LABELS[kind] }, kind));
|
|
102
102
|
}) }));
|
|
103
103
|
const StyledColumnWizardScopeSection = (props) => {
|
|
104
104
|
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
105
105
|
React.useEffect(() => {
|
|
106
|
-
const next = (0,
|
|
106
|
+
const next = (0, StyledColumnHelper_1.sanitizeStyledColumnRowScope)(data);
|
|
107
107
|
if (!next) {
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
@@ -131,7 +131,7 @@ const StyledColumnWizardScopeSection = (props) => {
|
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
133
|
const dt = api.columnApi.getColumnDataTypeForColumnId(data.ColumnId);
|
|
134
|
-
if ((0,
|
|
134
|
+
if ((0, IconStyleHelper_1.isUnsupportedColumnDataTypeForIconStyle)(dt)) {
|
|
135
135
|
props.onChange({
|
|
136
136
|
...data,
|
|
137
137
|
ColumnId: undefined,
|
|
@@ -201,7 +201,7 @@ const StyledColumnWizardScopeSection = (props) => {
|
|
|
201
201
|
props.onChange(newStyledColumn);
|
|
202
202
|
};
|
|
203
203
|
const handleRowKindChange = (kind, include) => {
|
|
204
|
-
if (!(0,
|
|
204
|
+
if (!(0, StyledColumnHelper_1.isStyledColumnRowKindSupported)(data, kind)) {
|
|
205
205
|
return;
|
|
206
206
|
}
|
|
207
207
|
const baseScope = data.RowScope ?? {
|
|
@@ -212,7 +212,7 @@ const StyledColumnWizardScopeSection = (props) => {
|
|
|
212
212
|
};
|
|
213
213
|
const nextScope = {
|
|
214
214
|
...baseScope,
|
|
215
|
-
[
|
|
215
|
+
[StyledColumnHelper_1.STYLED_COLUMN_ROW_KIND_EXCLUDE_KEY[kind]]: !include,
|
|
216
216
|
};
|
|
217
217
|
props.onChange({
|
|
218
218
|
...data,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { BarStyleCellTextPlacement, BarStyleCellTextProperties } from '../../../../../AdaptableState/StyledColumns/Common/BarStyleProperties';
|
|
3
|
+
import { CellTextOption } from '../../../../../AdaptableState/StyledColumns/Common/CellTextOptions';
|
|
4
|
+
export declare const BarStyleCellTextLayoutEditor: React.FunctionComponent<{
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
cellTextProperties?: BarStyleCellTextProperties;
|
|
7
|
+
onToggle: (token: CellTextOption, show: boolean) => void;
|
|
8
|
+
onPlacementChange: (token: CellTextOption, patch: Partial<BarStyleCellTextPlacement>) => void;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BarStyleCellTextLayoutEditor = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const BarStylesHelper_1 = require("../../../../../Utilities/Helpers/StyledColumns/BarStylesHelper");
|
|
6
|
+
const CheckBox_1 = require("../../../../../components/CheckBox");
|
|
7
|
+
const Flex_1 = require("../../../../../components/Flex");
|
|
8
|
+
const FormLayout_1 = require("../../../../../components/FormLayout");
|
|
9
|
+
const NewSelect_1 = require("../../../../../components/NewSelect");
|
|
10
|
+
const HORIZONTAL_CHOICES = [
|
|
11
|
+
{ value: 'Left', label: 'Left' },
|
|
12
|
+
{ value: 'Center', label: 'Center' },
|
|
13
|
+
{ value: 'Right', label: 'Right' },
|
|
14
|
+
];
|
|
15
|
+
const VERTICAL_CHOICES = [
|
|
16
|
+
{ value: 'Above', label: 'Above Bar' },
|
|
17
|
+
{ value: 'Below', label: 'Below Bar' },
|
|
18
|
+
{ value: 'Merged', label: 'Merged' },
|
|
19
|
+
];
|
|
20
|
+
const ROWS = [
|
|
21
|
+
{ token: 'CellValue', label: 'Cell Value:', key: 'CellValue' },
|
|
22
|
+
{ token: 'PercentageValue', label: 'Percent Value:', key: 'PercentValue' },
|
|
23
|
+
];
|
|
24
|
+
const BarStyleCellTextLayoutEditor = ({ disabled, cellTextProperties, onToggle, onPlacementChange }) => {
|
|
25
|
+
const layout = (0, BarStylesHelper_1.resolveBarStyleCellTextLayout)(cellTextProperties);
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: ROWS.map(({ token, label, key }) => {
|
|
27
|
+
const placement = layout[key];
|
|
28
|
+
const isShown = Boolean(placement);
|
|
29
|
+
const rowDisabled = disabled || !isShown;
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: label, children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:gap-3", children: [(0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { disabled: disabled, checked: isShown, onChange: (checked) => onToggle(token, checked) }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:w-[140px]", children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { className: "twa:w-full", disabled: rowDisabled, value: placement?.Horizontal ?? 'Left', onValueChange: (v) => onPlacementChange(token, {
|
|
31
|
+
Horizontal: v,
|
|
32
|
+
}), items: HORIZONTAL_CHOICES }) }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:w-[140px]", children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { className: "twa:w-full", disabled: rowDisabled, value: placement?.Vertical ?? 'Below', onValueChange: (v) => onPlacementChange(token, {
|
|
33
|
+
Vertical: v,
|
|
34
|
+
}), items: VERTICAL_CHOICES }) })] }) }, token));
|
|
35
|
+
}) }));
|
|
36
|
+
};
|
|
37
|
+
exports.BarStyleCellTextLayoutEditor = BarStyleCellTextLayoutEditor;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { BarStyleCellTextProperties } from '../../../../../AdaptableState/StyledColumns/Common/BarStyleProperties';
|
|
3
|
+
import { BarStyleCellTextLabels } from '../../../../../Utilities/Helpers/StyledColumns/BarStylesHelper';
|
|
4
|
+
/**
|
|
5
|
+
* Preview of the per-value cell-text layout. Renders three potential bands:
|
|
6
|
+
* - `Above` slots (above the bar)
|
|
7
|
+
* - `Merged` slots (overlay on top of the bar — uses `mergedOverlayClassName`)
|
|
8
|
+
* - `Below` slots (below the bar)
|
|
9
|
+
*
|
|
10
|
+
* Each band has three horizontal slots (Left/Center/Right) so the spacing is
|
|
11
|
+
* stable. When `vertical` is provided, only the band matching that value is
|
|
12
|
+
* rendered (used by the preview cards to position bands around the bar).
|
|
13
|
+
*/
|
|
14
|
+
export declare const BarStyleCellTextPreview: React.FunctionComponent<{
|
|
15
|
+
className?: string;
|
|
16
|
+
style?: React.CSSProperties;
|
|
17
|
+
cellTextProperties?: BarStyleCellTextProperties;
|
|
18
|
+
labels: BarStyleCellTextLabels;
|
|
19
|
+
mergedOverlayClassName?: string;
|
|
20
|
+
/** Render only the band matching this vertical position. */
|
|
21
|
+
vertical?: 'Above' | 'Below' | 'Merged';
|
|
22
|
+
}>;
|
|
23
|
+
export declare const shouldShowBarStyleCellTextOutsideBar: (cellTextProperties: BarStyleCellTextProperties | undefined, hasCellText: boolean) => boolean;
|