@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
|
@@ -6,8 +6,133 @@ const Icon_1 = require("../components/Icon");
|
|
|
6
6
|
const icons_1 = require("../components/icons");
|
|
7
7
|
const ArrayExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/ArrayExtensions"));
|
|
8
8
|
const GeneralConstants_1 = require("../Utilities/Constants/GeneralConstants");
|
|
9
|
-
const
|
|
10
|
-
|
|
9
|
+
const AggregationColumns_1 = require("../AdaptableState/Common/AggregationColumns");
|
|
10
|
+
/**
|
|
11
|
+
* Creates an AG Grid icon element for the given icon name.
|
|
12
|
+
*
|
|
13
|
+
* Mimics AG Grid's internal icon creation, producing a
|
|
14
|
+
* `<span class="ag-icon ag-icon-{name}" role="presentation" unselectable="on">`
|
|
15
|
+
* so the icon picks up AG Grid's own icon font/theme styling.
|
|
16
|
+
*
|
|
17
|
+
* @see https://github.com/ag-grid/ag-grid/blob/5ca14e73188f6f52fd7d545d595c067bf1b72168/packages/ag-grid-community/src/utils/icon.ts#L139
|
|
18
|
+
*/
|
|
19
|
+
function createAgGridIcon(name) {
|
|
20
|
+
const element = document.createElement('span');
|
|
21
|
+
element.className = `ag-icon ag-icon-${name}`;
|
|
22
|
+
element.setAttribute('role', 'presentation');
|
|
23
|
+
element.setAttribute('unselectable', 'on');
|
|
24
|
+
return element;
|
|
25
|
+
}
|
|
26
|
+
const toFuncLabel = (funcName) => {
|
|
27
|
+
if (funcName === 'avg') {
|
|
28
|
+
return 'Average';
|
|
29
|
+
}
|
|
30
|
+
if (funcName === 'weightedAvg') {
|
|
31
|
+
return 'Weighted Average';
|
|
32
|
+
}
|
|
33
|
+
return funcName ? funcName.charAt(0).toUpperCase() + funcName.slice(1) : funcName;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Builds the replacement for AG Grid's built-in `valueAggSubMenu` column menu item.
|
|
37
|
+
*
|
|
38
|
+
* AG Grid does not allow customizing the built-in submenu, so we rebuild an
|
|
39
|
+
* equivalent one: the column's existing aggregation functions plus a
|
|
40
|
+
* `Weighted Average` item whose submenu lists the numeric columns that can be
|
|
41
|
+
* used as the weight parameter.
|
|
42
|
+
*
|
|
43
|
+
* Both standard and weighted selections persist through the current Layout
|
|
44
|
+
* (`updateCurrentLayout`), so the existing `weightedAvg` aggFunc can read the
|
|
45
|
+
* chosen `weightedColumnId` back from the Layout.
|
|
46
|
+
*
|
|
47
|
+
* Weighted Average is never used in Pivot Layouts, so this only deals with the
|
|
48
|
+
* Table Layout aggregations and the caller skips it entirely in Pivot mode.
|
|
49
|
+
*/
|
|
50
|
+
function buildValueAggregationMenuItem(adaptableApi, menuContext) {
|
|
51
|
+
const column = menuContext.adaptableColumn;
|
|
52
|
+
const columnId = column.columnId;
|
|
53
|
+
const currentLayout = adaptableApi.layoutApi.getCurrentLayout();
|
|
54
|
+
const aggregationColumns = currentLayout.TableAggregationColumns || [];
|
|
55
|
+
const currentAggFunc = aggregationColumns.find((agg) => agg.ColumnId === columnId)?.AggFunc;
|
|
56
|
+
let activeAggFuncName;
|
|
57
|
+
if (currentAggFunc != null) {
|
|
58
|
+
const aggFuncName = (0, AggregationColumns_1.getAggFuncName)(currentAggFunc);
|
|
59
|
+
activeAggFuncName = aggFuncName === true ? column.aggregationFunction : aggFuncName;
|
|
60
|
+
}
|
|
61
|
+
const activeWeightColumnId = (0, AggregationColumns_1.isWeightedAverageAggregation)(currentAggFunc)
|
|
62
|
+
? currentAggFunc.weightedColumnId
|
|
63
|
+
: undefined;
|
|
64
|
+
const applyAggregation = (aggFuncValue) => {
|
|
65
|
+
const upsert = (cols) => {
|
|
66
|
+
const list = cols ? [...cols] : [];
|
|
67
|
+
const index = list.findIndex((col) => col.ColumnId === columnId);
|
|
68
|
+
if (index >= 0) {
|
|
69
|
+
list[index] = { ...list[index], AggFunc: aggFuncValue };
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
list.push({ ColumnId: columnId, AggFunc: aggFuncValue });
|
|
73
|
+
}
|
|
74
|
+
return list;
|
|
75
|
+
};
|
|
76
|
+
adaptableApi.layoutApi.updateCurrentLayout((layout) => {
|
|
77
|
+
const tableLayout = layout;
|
|
78
|
+
return {
|
|
79
|
+
...tableLayout,
|
|
80
|
+
TableAggregationColumns: upsert(tableLayout.TableAggregationColumns),
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
const removeAggregation = () => {
|
|
85
|
+
adaptableApi.layoutApi.updateCurrentLayout((layout) => {
|
|
86
|
+
const tableLayout = layout;
|
|
87
|
+
return {
|
|
88
|
+
...tableLayout,
|
|
89
|
+
TableAggregationColumns: (tableLayout.TableAggregationColumns || []).filter((col) => col.ColumnId !== columnId),
|
|
90
|
+
};
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
// 'None' clears any aggregation for the column and is checked when none is set
|
|
94
|
+
const subMenu = [
|
|
95
|
+
{
|
|
96
|
+
name: 'None',
|
|
97
|
+
checked: activeAggFuncName == null,
|
|
98
|
+
action: () => removeAggregation(),
|
|
99
|
+
},
|
|
100
|
+
];
|
|
101
|
+
// getDisplayAggFuncNames already positions weightedAvg right after 'avg'
|
|
102
|
+
// (and only includes it when the column is eligible)
|
|
103
|
+
const aggFuncItems = (0, AggregationColumns_1.getDisplayAggFuncNames)(column).map((funcName) => {
|
|
104
|
+
// Weighted Average needs a weight column parameter, so instead of a plain
|
|
105
|
+
// action it gets a submenu listing the numeric columns usable as the weight.
|
|
106
|
+
if (funcName === AggregationColumns_1.WEIGHTED_AVERAGE_AGG_FN_NAME) {
|
|
107
|
+
const weightColumnItems = adaptableApi.columnApi
|
|
108
|
+
.getNumericColumns()
|
|
109
|
+
.filter((numericColumn) => numericColumn.columnId !== columnId)
|
|
110
|
+
.map((numericColumn) => ({
|
|
111
|
+
name: numericColumn.friendlyName ?? numericColumn.columnId,
|
|
112
|
+
checked: activeWeightColumnId === numericColumn.columnId,
|
|
113
|
+
action: () => applyAggregation({
|
|
114
|
+
type: 'weightedAverage',
|
|
115
|
+
weightedColumnId: numericColumn.columnId,
|
|
116
|
+
}),
|
|
117
|
+
}));
|
|
118
|
+
return {
|
|
119
|
+
name: 'Weighted Average',
|
|
120
|
+
checked: activeAggFuncName === AggregationColumns_1.WEIGHTED_AVERAGE_AGG_FN_NAME,
|
|
121
|
+
subMenu: weightColumnItems,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
name: toFuncLabel(funcName),
|
|
126
|
+
checked: activeAggFuncName === funcName,
|
|
127
|
+
action: () => applyAggregation(funcName),
|
|
128
|
+
};
|
|
129
|
+
});
|
|
130
|
+
subMenu.push(...aggFuncItems);
|
|
131
|
+
return {
|
|
132
|
+
name: 'Value Aggregation',
|
|
133
|
+
subMenu,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
11
136
|
class AgGridMenuAdapter {
|
|
12
137
|
_adaptableInstance;
|
|
13
138
|
constructor(_adaptableInstance) {
|
|
@@ -67,8 +192,8 @@ class AgGridMenuAdapter {
|
|
|
67
192
|
const isPivotLayout = this.adaptableApi.layoutApi.isCurrentLayoutPivot();
|
|
68
193
|
const mappedAgGridMenuItems = agGridMenuItems.map((itemName) => itemName === 'valueAggSubMenu' && !isPivotLayout
|
|
69
194
|
? {
|
|
70
|
-
...
|
|
71
|
-
icon:
|
|
195
|
+
...buildValueAggregationMenuItem(this.adaptableApi, menuContext),
|
|
196
|
+
icon: createAgGridIcon('aggregation'),
|
|
72
197
|
}
|
|
73
198
|
: itemName);
|
|
74
199
|
const defaultContextMenu = [
|
|
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const Badge_1 = require("../../View/Components/Badge");
|
|
6
6
|
const renderWithAdaptableContext_1 = require("../../View/renderWithAdaptableContext");
|
|
7
7
|
const React = tslib_1.__importStar(require("react"));
|
|
8
|
-
const
|
|
8
|
+
const StyledColumnHelper_1 = require("../../Utilities/Helpers/StyledColumns/StyledColumnHelper");
|
|
9
9
|
const OVERFLOW_CLASS = {
|
|
10
10
|
Truncate: 'ab-Badge__wrapper--truncate',
|
|
11
11
|
Wrap: 'ab-Badge__wrapper--wrap',
|
|
@@ -56,7 +56,7 @@ const getBadgeRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
56
56
|
this.eGui.style.setProperty('justify-content', rowJustify);
|
|
57
57
|
this.eGui.style.setProperty('width', '100%');
|
|
58
58
|
}
|
|
59
|
-
if (!(0,
|
|
59
|
+
if (!(0, StyledColumnHelper_1.shouldRenderStyledColumnOnRow)(styledColumn, params.node, adaptableApi)) {
|
|
60
60
|
const formattedValue = params.formatValue?.(params.value) ?? params.value ?? '';
|
|
61
61
|
this.eGui.innerHTML = formattedValue;
|
|
62
62
|
return;
|
|
@@ -87,7 +87,9 @@ const getBadgeRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
87
87
|
...adaptableApi.internalApi.buildBaseContext(),
|
|
88
88
|
};
|
|
89
89
|
const badge = api.styledColumnApi.internalApi.getApplicableBadge(badgeStyle, predicateDefHandlerContext);
|
|
90
|
-
const formattedValue = badge?.IconOnly
|
|
90
|
+
const formattedValue = badge?.IconProperties?.IconOnly
|
|
91
|
+
? ''
|
|
92
|
+
: params.formatValue?.(value) ?? value ?? '';
|
|
91
93
|
const isNullValue = formattedValue === '' || formattedValue === null || formattedValue === undefined;
|
|
92
94
|
if (!isNullValue) {
|
|
93
95
|
const config = { value: formattedValue };
|
|
@@ -117,7 +119,7 @@ const getBadgeRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
117
119
|
this.eGui.innerHTML = formattedValue;
|
|
118
120
|
return;
|
|
119
121
|
}
|
|
120
|
-
if (badge.IconOnly) {
|
|
122
|
+
if (badge.IconProperties?.IconOnly) {
|
|
121
123
|
formattedValue = '';
|
|
122
124
|
}
|
|
123
125
|
this.renderBadges([
|
|
@@ -141,11 +143,11 @@ const getBadgeRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
141
143
|
key: index,
|
|
142
144
|
pillStyle: badge.PillStyle,
|
|
143
145
|
children: value,
|
|
144
|
-
icon: badge.Icon,
|
|
145
|
-
iconPosition: badge.
|
|
146
|
+
icon: badge.IconProperties?.Icon,
|
|
147
|
+
iconPosition: badge.IconProperties?.Position ?? 'start',
|
|
146
148
|
shape: badge.Shape,
|
|
147
149
|
density: badgeStyle.Density ?? 'Normal',
|
|
148
|
-
iconGap: badge.
|
|
150
|
+
iconGap: badge.IconProperties?.Gap,
|
|
149
151
|
});
|
|
150
152
|
});
|
|
151
153
|
this.unmountReactRoot = api.internalApi
|
|
@@ -3,8 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getBulletChartRendererForColumn = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const Helper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/Helper"));
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const NumberExtensions_1 = require("../../Utilities/Extensions/NumberExtensions");
|
|
7
|
+
const BarStylesHelper_1 = require("../../Utilities/Helpers/StyledColumns/BarStylesHelper");
|
|
8
|
+
const StyledColumnHelper_1 = require("../../Utilities/Helpers/StyledColumns/StyledColumnHelper");
|
|
8
9
|
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
9
10
|
const DEFAULT_BAR_HEIGHT = 8;
|
|
10
11
|
const DEFAULT_BAND_HEIGHT = 14;
|
|
@@ -56,19 +57,18 @@ const normaliseMarker = (override, base) => {
|
|
|
56
57
|
};
|
|
57
58
|
};
|
|
58
59
|
const resolveTargets = (bulletStyle, styledColumn, abColumn, rowNode, api) => {
|
|
59
|
-
|
|
60
|
+
const targetSpec = bulletStyle.TargetProperties?.Target;
|
|
61
|
+
if (targetSpec == undefined) {
|
|
60
62
|
return [];
|
|
61
63
|
}
|
|
62
|
-
const targets = Array.isArray(
|
|
63
|
-
? bulletStyle.Target
|
|
64
|
-
: [bulletStyle.Target];
|
|
64
|
+
const targets = Array.isArray(targetSpec) ? targetSpec : [targetSpec];
|
|
65
65
|
const resolved = [];
|
|
66
66
|
for (const target of targets) {
|
|
67
67
|
const value = resolveTargetValue(target, styledColumn, abColumn, rowNode, api);
|
|
68
68
|
if (value == undefined || isNaN(value)) {
|
|
69
69
|
continue;
|
|
70
70
|
}
|
|
71
|
-
const marker = normaliseMarker(isTargetDefinition(target) ? target.Marker : undefined, bulletStyle.
|
|
71
|
+
const marker = normaliseMarker(isTargetDefinition(target) ? target.Marker : undefined, bulletStyle.TargetProperties?.Marker);
|
|
72
72
|
resolved.push({
|
|
73
73
|
value,
|
|
74
74
|
marker,
|
|
@@ -106,7 +106,7 @@ const toFraction = (value, min, max) => {
|
|
|
106
106
|
if (max === min) {
|
|
107
107
|
return 0;
|
|
108
108
|
}
|
|
109
|
-
return (0,
|
|
109
|
+
return (0, NumberExtensions_1.clamp)((value - min) / (max - min), 0, 1);
|
|
110
110
|
};
|
|
111
111
|
const getBulletChartRendererForColumn = (styledColumn, abColumn, api) => {
|
|
112
112
|
if (!styledColumn.BulletChartStyle) {
|
|
@@ -117,7 +117,7 @@ const getBulletChartRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
117
117
|
eGui;
|
|
118
118
|
init(params) {
|
|
119
119
|
// Defer to the shared row-scope helper.
|
|
120
|
-
if (!(0,
|
|
120
|
+
if (!(0, StyledColumnHelper_1.shouldRenderStyledColumnOnRow)(styledColumn, params.node, api)) {
|
|
121
121
|
if (params.value != undefined) {
|
|
122
122
|
this.eGui = document.createElement('div');
|
|
123
123
|
this.eGui.append(String(params.value));
|
|
@@ -156,10 +156,10 @@ const getBulletChartRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
156
156
|
// `BarThickness` is the bar's *short* axis (height in horizontal,
|
|
157
157
|
// width in vertical). `BandThickness` is the matching short-axis
|
|
158
158
|
// size of the surrounding bands.
|
|
159
|
-
const barThickness = bulletStyle.
|
|
159
|
+
const barThickness = bulletStyle.Bar?.Height ?? DEFAULT_BAR_HEIGHT;
|
|
160
160
|
const bandThickness = Math.max(barThickness + 6, DEFAULT_BAND_HEIGHT);
|
|
161
|
-
const
|
|
162
|
-
const
|
|
161
|
+
const cellTextProperties = bulletStyle.CellTextProperties;
|
|
162
|
+
const hasCellText = (0, BarStylesHelper_1.hasBarStyleCellTextConfigured)(cellTextProperties);
|
|
163
163
|
// Map a 0..1 value fraction onto the long-axis viewBox (0..100).
|
|
164
164
|
// In horizontal: 0 -> left, 1 -> right.
|
|
165
165
|
// In vertical: 0 -> bottom, 1 -> top (SVG y origin is at the top so
|
|
@@ -176,7 +176,7 @@ const getBulletChartRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
176
176
|
this.eGui.style.alignItems = isVertical ? 'center' : 'stretch';
|
|
177
177
|
this.eGui.style.justifyContent = 'center';
|
|
178
178
|
this.eGui.style.position = 'relative';
|
|
179
|
-
this.eGui.style.height =
|
|
179
|
+
this.eGui.style.height = '100%';
|
|
180
180
|
// SVG chart - we let `preserveAspectRatio="none"` stretch the long axis
|
|
181
181
|
// (viewBox 0..100) to fill the cell while the short axis stays fixed
|
|
182
182
|
// in pixels.
|
|
@@ -247,7 +247,7 @@ const getBulletChartRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
247
247
|
const barCrossOffset = (bandThickness - barThickness) / 2;
|
|
248
248
|
const bar = document.createElementNS(SVG_NS, 'rect');
|
|
249
249
|
setRectAxes(bar, Math.min(valueCoord, originCoord), Math.abs(valueCoord - originCoord), barCrossOffset, barThickness);
|
|
250
|
-
bar.setAttribute('fill', bulletStyle.
|
|
250
|
+
bar.setAttribute('fill', bulletStyle.Bar?.Color ?? DEFAULT_BAR_COLOR);
|
|
251
251
|
bar.setAttribute('class', 'ab-BulletChart__bar');
|
|
252
252
|
svg.appendChild(bar);
|
|
253
253
|
// Target markers
|
|
@@ -259,39 +259,40 @@ const getBulletChartRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
259
259
|
svg.appendChild(marker);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
|
|
262
|
+
// Wrap the SVG in a positioned container so a `Merged` text row can
|
|
263
|
+
// be absolute-positioned to the centre of the *bar* (matching Percent
|
|
264
|
+
// Bar's behaviour) instead of falling through to the wrapper centre,
|
|
265
|
+
// which would otherwise overlap an `Above` / `Below` band.
|
|
266
|
+
const svgContainer = document.createElement('div');
|
|
267
|
+
svgContainer.style.position = 'relative';
|
|
268
|
+
svgContainer.style.display = 'flex';
|
|
269
|
+
svgContainer.style.alignItems = 'center';
|
|
270
|
+
svgContainer.style.justifyContent = 'center';
|
|
271
|
+
// Horizontal: take the SVG's natural (bandThickness) height.
|
|
272
|
+
// Vertical: stretch to fill the wrapper so the SVG's `height: 100%`
|
|
273
|
+
// resolves against a real size.
|
|
274
|
+
if (isVertical) {
|
|
275
|
+
svgContainer.style.flex = '1 1 auto';
|
|
276
|
+
svgContainer.style.minHeight = '0';
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
svgContainer.style.flex = '0 0 auto';
|
|
280
|
+
}
|
|
281
|
+
svgContainer.appendChild(svg);
|
|
282
|
+
this.eGui.appendChild(svgContainer);
|
|
263
283
|
if (hasCellText) {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
const
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
case 'Above':
|
|
277
|
-
this.eGui.prepend(textEl);
|
|
278
|
-
break;
|
|
279
|
-
case 'Merged':
|
|
280
|
-
textEl.style.position = 'absolute';
|
|
281
|
-
textEl.style.top = '50%';
|
|
282
|
-
textEl.style.transform = 'translateY(-50%)';
|
|
283
|
-
textEl.style.left = '0';
|
|
284
|
-
textEl.style.right = '0';
|
|
285
|
-
textEl.style.paddingLeft = '5px';
|
|
286
|
-
textEl.style.paddingRight = '5px';
|
|
287
|
-
textEl.style.pointerEvents = 'none';
|
|
288
|
-
this.eGui.appendChild(textEl);
|
|
289
|
-
break;
|
|
290
|
-
case 'Below':
|
|
291
|
-
default:
|
|
292
|
-
this.eGui.appendChild(textEl);
|
|
293
|
-
break;
|
|
294
|
-
}
|
|
284
|
+
// See PercentBarRenderer: `params.formatValue` on a column without a
|
|
285
|
+
// `valueFormatter` returns the raw value (a number here), so coerce
|
|
286
|
+
// to string before it flows into the helpers.
|
|
287
|
+
const formattedCellValue = String(params.formatValue?.(cellValue) ?? cellValue);
|
|
288
|
+
const labels = (0, BarStylesHelper_1.buildBarStyleCellTextLabels)(cellTextProperties, formattedCellValue, `${(valueFraction * 100).toFixed(0)}%`);
|
|
289
|
+
(0, BarStylesHelper_1.mountBarStyleCellText)({
|
|
290
|
+
wrapperEl: this.eGui,
|
|
291
|
+
mergedOverlayEl: svgContainer,
|
|
292
|
+
textClassName: 'ab-BulletChart__text',
|
|
293
|
+
cellTextProperties,
|
|
294
|
+
labels,
|
|
295
|
+
});
|
|
295
296
|
}
|
|
296
297
|
}
|
|
297
298
|
getGui() {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StyledColumn } from '../../AdaptableState/StyledColumnState';
|
|
2
|
+
import { IconStyle, IconStyleMapping } from '../../AdaptableState/StyledColumns/IconStyle';
|
|
2
3
|
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
3
4
|
import { AdaptableColumn } from '../../AdaptableState/Common/AdaptableColumn';
|
|
4
5
|
/**
|
|
@@ -6,9 +6,8 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const Icon_1 = require("../../components/Icon");
|
|
7
7
|
const renderWithAdaptableContext_1 = require("../../View/renderWithAdaptableContext");
|
|
8
8
|
const Helper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/Helper"));
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const iconStyledColumnColumnSupport_1 = require("../../Utilities/Helpers/iconStyledColumnColumnSupport");
|
|
9
|
+
const IconStyleHelper_1 = require("../../Utilities/Helpers/StyledColumns/IconStyleHelper");
|
|
10
|
+
const StyledColumnHelper_1 = require("../../Utilities/Helpers/StyledColumns/StyledColumnHelper");
|
|
12
11
|
const AdaptableLogger_1 = require("../AdaptableLogger");
|
|
13
12
|
const DEFAULT_SIZE = 18;
|
|
14
13
|
const DEFAULT_GAP = 4;
|
|
@@ -20,7 +19,7 @@ const normaliseIconMappingKey = (key, matchMode) => {
|
|
|
20
19
|
};
|
|
21
20
|
const resolveIconStyleMappingParts = (iconStyle) => {
|
|
22
21
|
const presetMappings = iconStyle.Preset
|
|
23
|
-
? (0,
|
|
22
|
+
? (0, IconStyleHelper_1.getIconStylePresetMappings)(iconStyle.Preset)
|
|
24
23
|
: [];
|
|
25
24
|
const userMappings = iconStyle.Mappings ?? [];
|
|
26
25
|
if (presetMappings.length === 0 || userMappings.length === 0) {
|
|
@@ -54,7 +53,7 @@ const resolveEffectiveIconStyleMappings = (iconStyle) => {
|
|
|
54
53
|
if (presetMappings.length === 0)
|
|
55
54
|
return userMappings;
|
|
56
55
|
if (userMappings.length === 0) {
|
|
57
|
-
return iconStyle.Preset ? (0,
|
|
56
|
+
return iconStyle.Preset ? (0, IconStyleHelper_1.getIconStylePresetMappings)(iconStyle.Preset) : [];
|
|
58
57
|
}
|
|
59
58
|
return [...presetMappings, ...userMappings];
|
|
60
59
|
};
|
|
@@ -72,7 +71,7 @@ const resolveIconStyleMappingsForSummaryPreview = (iconStyle) => {
|
|
|
72
71
|
if (presetMappings.length > 0) {
|
|
73
72
|
return presetMappings;
|
|
74
73
|
}
|
|
75
|
-
return iconStyle.Preset ? (0,
|
|
74
|
+
return iconStyle.Preset ? (0, IconStyleHelper_1.getIconStylePresetMappings)(iconStyle.Preset) : [];
|
|
76
75
|
}
|
|
77
76
|
if (presetMappings.length === 0) {
|
|
78
77
|
return userMappings;
|
|
@@ -192,14 +191,16 @@ const getIconRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
192
191
|
if (!styledColumn.IconStyle) {
|
|
193
192
|
return;
|
|
194
193
|
}
|
|
195
|
-
if ((0,
|
|
194
|
+
if ((0, IconStyleHelper_1.isUnsupportedColumnDataTypeForIconStyle)(abColumn.dataType)) {
|
|
196
195
|
(0, AdaptableLogger_1.errorOnce)(`[AdapTable] Icon Styled Column (“${styledColumn.Name || styledColumn.ColumnId || 'unnamed'}” on column ${styledColumn.ColumnId}) is not supported when the column data type is ${abColumn.dataType}. Use Badge Style for array columns, or remove IconStyle from this column.`);
|
|
197
196
|
return undefined;
|
|
198
197
|
}
|
|
199
198
|
const iconStyle = styledColumn.IconStyle;
|
|
200
199
|
const size = iconStyle.Size ?? DEFAULT_SIZE;
|
|
201
200
|
const gap = iconStyle.Gap ?? DEFAULT_GAP;
|
|
202
|
-
const
|
|
201
|
+
const cellTextProperties = iconStyle.CellTextProperties;
|
|
202
|
+
const textPosition = cellTextProperties?.CellTextPosition ?? 'After';
|
|
203
|
+
const cellTextTokens = cellTextProperties?.CellText ?? [];
|
|
203
204
|
const matchMode = iconStyle.MatchMode ?? 'Exact';
|
|
204
205
|
// Resolve once at column-setup time. Cheap; recomputed when the column
|
|
205
206
|
// is reconfigured (which is when this factory is re-invoked anyway).
|
|
@@ -222,7 +223,7 @@ const getIconRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
222
223
|
// Defer to the shared row-scope helper so behaviour is uniform
|
|
223
224
|
// across every Styled Column type and `StyledColumn.RowScope` can
|
|
224
225
|
// override the default ("leaf rows only" for Icon).
|
|
225
|
-
if (!(0,
|
|
226
|
+
if (!(0, StyledColumnHelper_1.shouldRenderStyledColumnOnRow)(styledColumn, params.node, adaptableApi)) {
|
|
226
227
|
if (params.value != undefined) {
|
|
227
228
|
this.eGui.append(String(params.value));
|
|
228
229
|
}
|
|
@@ -236,16 +237,15 @@ const getIconRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
236
237
|
const formatted = params.formatValue?.(cellValue) ??
|
|
237
238
|
(cellValue != undefined ? String(cellValue) : '');
|
|
238
239
|
// `CellText` describes the *companion text alongside a matched icon*.
|
|
239
|
-
// `
|
|
240
|
-
// independent: when there is no match,
|
|
241
|
-
// — `CellText` does not get to override `
|
|
240
|
+
// `FallbackProperties.Mode` describes *what to do when no mapping matches*.
|
|
241
|
+
// They are independent: when there is no match, the fallback decides
|
|
242
|
+
// on its own — `CellText` does not get to override `Mode: 'Hide'`.
|
|
242
243
|
let iconSpec;
|
|
243
244
|
let text;
|
|
244
245
|
let descriptionForTooltip;
|
|
245
246
|
if (matched) {
|
|
246
247
|
iconSpec = matched.Icon;
|
|
247
248
|
descriptionForTooltip = matched.Description;
|
|
248
|
-
const cellTextTokens = iconStyle.CellText ?? [];
|
|
249
249
|
const textParts = [];
|
|
250
250
|
if (cellTextTokens.includes('CellValue') && formatted) {
|
|
251
251
|
textParts.push(formatted);
|
|
@@ -256,17 +256,18 @@ const getIconRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
256
256
|
text = textParts.length > 0 ? textParts.join(' · ') : undefined;
|
|
257
257
|
}
|
|
258
258
|
else if (!cellValueIsEmpty) {
|
|
259
|
-
// Unmatched, non-empty cell: defer entirely to
|
|
260
|
-
const
|
|
261
|
-
|
|
259
|
+
// Unmatched, non-empty cell: defer entirely to the fallback config.
|
|
260
|
+
const fallbackMode = iconStyle.FallbackProperties?.Mode ?? 'Hide';
|
|
261
|
+
const fallbackIcon = iconStyle.FallbackProperties?.Icon;
|
|
262
|
+
if (fallbackMode === 'ShowText') {
|
|
262
263
|
text = formatted || undefined;
|
|
263
264
|
}
|
|
264
|
-
else if (
|
|
265
|
-
iconSpec =
|
|
265
|
+
else if (fallbackMode === 'Icon' && fallbackIcon) {
|
|
266
|
+
iconSpec = fallbackIcon;
|
|
266
267
|
}
|
|
267
268
|
// 'Hide' (and the unsupported permutations) render nothing.
|
|
268
269
|
}
|
|
269
|
-
// else: empty cell → render nothing, regardless of
|
|
270
|
+
// else: empty cell → render nothing, regardless of fallback config.
|
|
270
271
|
// If we have nothing to draw, leave the cell empty (and skip mounting
|
|
271
272
|
// a React root for this row).
|
|
272
273
|
if (!iconSpec && !text) {
|