@adaptabletools/adaptable-cjs 23.0.0-canary.3 → 23.0.0-canary.5
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 +116 -61
- package/package.json +9 -4
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +0 -4
- package/src/AdaptableOptions/EditOptions.d.ts +2 -2
- package/src/AdaptableOptions/FilterOptions.d.ts +0 -7
- package/src/AdaptableState/Common/AdaptableForm.d.ts +18 -1
- package/src/AdaptableState/Common/AdaptableForm.js +34 -0
- package/src/AdaptableState/Common/AggregationColumns.d.ts +14 -6
- package/src/AdaptableState/Common/AggregationColumns.js +30 -3
- package/src/AdaptableState/Common/CellDataChangedInfo.d.ts +3 -2
- package/src/AdaptableState/Common/ColumnScope.d.ts +4 -0
- package/src/AdaptableState/Common/Enums.d.ts +5 -10
- package/src/AdaptableState/Common/Enums.js +5 -11
- package/src/AdaptableState/PlusMinusState.d.ts +3 -3
- package/src/AdaptableState/ShortcutState.d.ts +2 -6
- package/src/AdaptableState/StyledColumnState.d.ts +3 -5
- package/src/AdaptableState/ThemeState.d.ts +33 -28
- package/src/Api/EventApi.d.ts +14 -1
- package/src/Api/Events/ThemeChanged.d.ts +6 -0
- package/src/Api/Events/ThemeSelected.d.ts +11 -0
- package/src/Api/Events/ThemeSelected.js +2 -0
- package/src/Api/Implementation/EventApiImpl.js +4 -0
- package/src/Api/Implementation/LayoutApiImpl.d.ts +0 -2
- package/src/Api/Implementation/LayoutApiImpl.js +0 -14
- package/src/Api/Implementation/LayoutHelpers.d.ts +2 -0
- package/src/Api/Implementation/LayoutHelpers.js +31 -8
- package/src/Api/Implementation/ThemeApiImpl.d.ts +3 -2
- package/src/Api/Implementation/ThemeApiImpl.js +19 -15
- package/src/Api/Internal/EventInternalApi.d.ts +2 -0
- package/src/Api/Internal/EventInternalApi.js +8 -1
- package/src/Api/Internal/StyledColumnInternalApi.d.ts +4 -4
- package/src/Api/Internal/StyledColumnInternalApi.js +4 -4
- package/src/Api/Internal/ThemeInternalApi.d.ts +0 -1
- package/src/Api/Internal/ThemeInternalApi.js +0 -10
- package/src/Api/LayoutApi.d.ts +1 -8
- package/src/Api/ThemeApi.d.ts +6 -2
- package/src/Redux/ActionsReducers/ThemeRedux.d.ts +3 -3
- package/src/Strategy/CalculatedColumnModule.js +3 -1
- package/src/Strategy/FormatColumnModule.js +12 -5
- package/src/Strategy/LayoutModule.js +13 -8
- package/src/Strategy/StyledColumnModule.js +58 -30
- package/src/Utilities/Constants/ReduxConstants.d.ts +2 -2
- package/src/Utilities/Constants/ReduxConstants.js +1 -14
- package/src/Utilities/Helpers/FormatHelper.js +20 -1
- package/src/Utilities/Helpers/SparklineOptionsHelper.d.ts +7 -0
- package/src/Utilities/Helpers/SparklineOptionsHelper.js +68 -0
- package/src/Utilities/Helpers/StyledColumnGradientHelper.d.ts +23 -1
- package/src/Utilities/Helpers/StyledColumnGradientHelper.js +212 -1
- package/src/Utilities/Helpers/ThemeHelpers.d.ts +5 -0
- package/src/Utilities/Helpers/ThemeHelpers.js +43 -0
- package/src/Utilities/Helpers/percentBarPreviewHelper.d.ts +19 -0
- package/src/Utilities/Helpers/percentBarPreviewHelper.js +155 -0
- package/src/Utilities/ObjectFactory.d.ts +1 -3
- package/src/Utilities/ObjectFactory.js +0 -9
- package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +1 -0
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +7 -0
- package/src/Utilities/Services/CalculatedColumnSyntheticChange.d.ts +4 -0
- package/src/Utilities/Services/CalculatedColumnSyntheticChange.js +120 -0
- package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +1 -0
- package/src/Utilities/Services/ThemeService.js +1 -1
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +17 -16
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +113 -102
- package/src/View/Alert/Wizard/AlertMessageWizardSection.js +12 -13
- package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +54 -54
- package/src/View/Alert/Wizard/AlertRulesWizardSection.js +4 -3
- package/src/View/Alert/Wizard/AlertScheduledWizardSection.js +1 -1
- package/src/View/Alert/Wizard/AlertScopeWizardSection.js +29 -37
- package/src/View/Alert/Wizard/AlertTypeWizardSection.js +2 -3
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +9 -13
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +28 -15
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +7 -9
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +2 -2
- package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/AgChargingWizard.js +3 -10
- package/src/View/Charting/ChartingWizard/AgChargingWizard/PreviewChartSection.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/SettingsSection.js +35 -52
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/ExternalChartingWizard.js +4 -31
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.d.ts +5 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.js +26 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.d.ts +1 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.js +9 -6
- package/src/View/Comments/CommentsEditor.js +1 -1
- package/src/View/Components/ColumnFilter/ColumnFilterWindow.js +1 -1
- package/src/View/Components/ModuleProfile.js +1 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +0 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +1 -2
- package/src/View/Components/RangesComponent.d.ts +7 -2
- package/src/View/Components/RangesComponent.js +94 -22
- package/src/View/Components/Selectors/ColumnSelector.js +5 -0
- package/src/View/Components/StyleComponent.d.ts +1 -0
- package/src/View/Components/StyleComponent.js +1 -1
- package/src/View/Components/ValueSelector/index.js +70 -57
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +8 -13
- package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +8 -8
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
- package/src/View/DataImport/DataImportWizard/sections/ColumnsSection.js +11 -12
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadSection.js +5 -4
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.js +2 -1
- package/src/View/DataImport/DataImportWizard/sections/ValidationSection.js +4 -15
- package/src/View/Export/Wizard/ReportColumnsWizardSection.js +24 -27
- package/src/View/Export/Wizard/ReportNameWizardSection.js +8 -11
- package/src/View/Export/Wizard/ReportRowsWizardSection.js +19 -22
- package/src/View/Export/Wizard/ScheduledReportSettings.d.ts +2 -0
- package/src/View/Export/Wizard/ScheduledReportSettings.js +12 -12
- package/src/View/Export/Wizard/ScheduledReportWizard.js +2 -3
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +8 -6
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +22 -21
- package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +20 -11
- package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +19 -3
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +4 -4
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +7 -0
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +120 -13
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.d.ts +15 -0
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +78 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +4 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +34 -0
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +11 -6
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +3 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +64 -13
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +3 -1
- package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.d.ts +2 -0
- package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.js +19 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.d.ts +10 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.js +60 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +2 -3
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +35 -70
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +14 -10
- package/src/View/Layout/LayoutViewPanel.js +23 -21
- package/src/View/Layout/TransposedPopup.js +2 -2
- package/src/View/Layout/Wizard/LayoutWizard.js +3 -3
- package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +2 -3
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +116 -26
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +79 -79
- package/src/View/Layout/Wizard/sections/FilterSection.js +31 -32
- package/src/View/Layout/Wizard/sections/GridFilterSection.js +10 -10
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +1 -2
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +101 -51
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +9 -8
- package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +4 -4
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +36 -33
- package/src/View/Layout/Wizard/sections/RowSelectionSection.js +2 -2
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +95 -73
- package/src/View/Layout/Wizard/sections/SettingsSection.js +3 -4
- package/src/View/Layout/Wizard/sections/SortSection.js +2 -2
- package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -1
- package/src/View/NamedQuery/Wizard/NamedQuerySettingsWizardSection.js +7 -12
- package/src/View/NamedQuery/Wizard/NamedQueryWizard.js +1 -3
- package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.d.ts +4 -0
- package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +45 -12
- package/src/View/PlusMinus/Wizard/PlusMinusScopeWizardSection.js +10 -17
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.d.ts +2 -6
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +5 -21
- package/src/View/PlusMinus/Wizard/PlusMinusWizard.js +15 -21
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +2 -2
- package/src/View/Shortcut/Wizard/ShortcutScopeWizardSection.js +10 -17
- package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +16 -5
- package/src/View/Shortcut/Wizard/ShortcutWizard.js +2 -2
- package/src/View/Shortcut/shortcutOperations.d.ts +3 -0
- package/src/View/Shortcut/shortcutOperations.js +32 -1
- package/src/View/SpecialColumnSettingsWizardStep.js +7 -6
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +26 -16
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.d.ts +10 -2
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +100 -15
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +14 -0
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +48 -25
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +2 -3
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +109 -33
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +20 -12
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +124 -23
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.d.ts +1 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +35 -11
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +88 -11
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +125 -35
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.d.ts +1 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +55 -74
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.js +20 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +6 -12
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarColumnComparisonPreview.js +5 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarRangesPreview.js +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.d.ts +5 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.js +11 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.js +20 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.d.ts +3 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +32 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +64 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.js +35 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.js +96 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.d.ts +8 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.js +57 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.d.ts +8 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +58 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.d.ts +18 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.js +66 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +133 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardRangesSection.js +12 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.d.ts +1 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +53 -29
- package/src/View/SystemStatus/Utilities/getStatusItemStyle.js +1 -1
- package/src/View/Theme/ThemePopup.d.ts +2 -14
- package/src/View/Theme/ThemePopup.js +1 -36
- package/src/View/UIHelper.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.js +6 -20
- package/src/View/renderWithAdaptableContext.js +1 -2
- package/src/agGrid/AdaptableAgGrid.d.ts +1 -1
- package/src/agGrid/AdaptableAgGrid.js +36 -41
- package/src/agGrid/AgGridAdapter.d.ts +1 -1
- package/src/agGrid/AgGridAdapter.js +27 -17
- package/src/agGrid/AgGridColumnAdapter.js +10 -19
- package/src/agGrid/AgGridMenuAdapter.d.ts +0 -1
- package/src/agGrid/AgGridMenuAdapter.js +20 -37
- package/src/agGrid/buildValueAggregationMenuItem.d.ts +19 -0
- package/src/agGrid/buildValueAggregationMenuItem.js +114 -0
- package/src/agGrid/cellRenderers/IconRenderer.d.ts +6 -0
- package/src/agGrid/cellRenderers/IconRenderer.js +46 -17
- package/src/agGrid/createAgGridIcon.d.ts +10 -0
- package/src/agGrid/createAgGridIcon.js +19 -0
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +10 -5
- package/src/components/Combobox/VirtualizedList.js +5 -5
- package/src/components/Combobox/comboboxUtils.d.ts +4 -1
- package/src/components/Combobox/comboboxUtils.js +2 -0
- package/src/components/Combobox/index.d.ts +1 -0
- package/src/components/Combobox/index.js +36 -16
- package/src/components/DragAndDropContext/UnusedPanel.js +1 -1
- package/src/components/ExpressionEditor/BaseEditorInput.js +1 -1
- package/src/components/ExpressionEditor/ExpressionFunctionDocumentation.js +1 -1
- package/src/components/Input/NumberInput.js +1 -1
- package/src/components/Panel/index.js +1 -1
- package/src/components/SimpleButton/index.js +4 -4
- package/src/components/Toggle/Toggle.js +1 -1
- package/src/components/Toggle/ToggleGroup.js +1 -1
- package/src/components/Tree/TreeDropdown/index.js +1 -5
- package/src/env.js +2 -2
- package/src/layout-manager/src/LayoutManagerModel.d.ts +5 -1
- package/src/layout-manager/src/index.js +2 -9
- package/src/metamodel/adaptable.metamodel.d.ts +39 -46
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +5 -5
- package/themes/dark.css +1 -68
- package/themes/light.css +1 -5
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/src/AdaptableState/Common/FilterActionOnDataChange.d.ts +0 -17
- package/src/AdaptableState/Common/FilterActionOnDataChange.js +0 -5
- package/src/Aggregation/ParameterizedAggregationRegistry.d.ts +0 -35
- package/src/Aggregation/ParameterizedAggregationRegistry.js +0 -74
- package/src/Aggregation/definitions/weightedAverageAggregationDefinition.d.ts +0 -3
- package/src/Aggregation/definitions/weightedAverageAggregationDefinition.js +0 -58
- package/src/Aggregation/parameterizedAggregationColumnMenu.d.ts +0 -8
- package/src/Aggregation/parameterizedAggregationColumnMenu.js +0 -143
- package/src/Aggregation/parameterizedAggregationHeader.d.ts +0 -13
- package/src/Aggregation/parameterizedAggregationHeader.js +0 -65
- package/src/Aggregation/parameterizedAggregationHelpers.d.ts +0 -23
- package/src/Aggregation/parameterizedAggregationHelpers.js +0 -121
- package/src/Aggregation/parameterizedAggregationWizardHelpers.d.ts +0 -9
- package/src/Aggregation/parameterizedAggregationWizardHelpers.js +0 -74
- package/src/Aggregation/validateParameterizedAggregations.d.ts +0 -4
- package/src/Aggregation/validateParameterizedAggregations.js +0 -25
- package/src/View/AdaptableComputedCSSVarsContext.d.ts +0 -12
- package/src/View/AdaptableComputedCSSVarsContext.js +0 -36
- package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.d.ts +0 -12
- package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.js +0 -48
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.d.ts +0 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.js +0 -32
- package/src/View/Theme/VariantSelector.d.ts +0 -8
- package/src/View/Theme/VariantSelector.js +0 -25
- package/src/components/Select/CSSNumericVariableWatch.d.ts +0 -11
- package/src/components/Select/CSSNumericVariableWatch.js +0 -51
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAdaptableAggFuncNamesForColumn = getAdaptableAggFuncNamesForColumn;
|
|
4
|
-
exports.buildAggregationColumnsMap = buildAggregationColumnsMap;
|
|
5
|
-
exports.resolveAggFuncValueFromWizardSelection = resolveAggFuncValueFromWizardSelection;
|
|
6
|
-
exports.upsertColumnAggregationEntry = upsertColumnAggregationEntry;
|
|
7
|
-
exports.getParameterizedArgColumnLabel = getParameterizedArgColumnLabel;
|
|
8
|
-
exports.formatParameterizedArgSelectionLabel = formatParameterizedArgSelectionLabel;
|
|
9
|
-
const AggregationColumns_1 = require("../AdaptableState/Common/AggregationColumns");
|
|
10
|
-
const ParameterizedAggregationRegistry_1 = require("./ParameterizedAggregationRegistry");
|
|
11
|
-
function getAdaptableAggFuncNamesForColumn(column) {
|
|
12
|
-
return (0, ParameterizedAggregationRegistry_1.getParameterizedAggregationDefinitions)()
|
|
13
|
-
.filter((definition) => definition.isAvailableForColumn(column))
|
|
14
|
-
.map((definition) => definition.agGridAggFuncName);
|
|
15
|
-
}
|
|
16
|
-
function buildAggregationColumnsMap(entries, allColumnsMap) {
|
|
17
|
-
return (entries || []).reduce((acc, { ColumnId: colId, AggFunc }) => {
|
|
18
|
-
if (typeof AggFunc === 'boolean') {
|
|
19
|
-
const defaultFn = allColumnsMap[colId]?.aggregationFunction;
|
|
20
|
-
acc[colId] = typeof defaultFn === 'string' ? defaultFn : '';
|
|
21
|
-
}
|
|
22
|
-
else if ((0, ParameterizedAggregationRegistry_1.isParameterizedAggregation)(AggFunc)) {
|
|
23
|
-
const fnName = (0, AggregationColumns_1.getAggFuncName)(AggFunc);
|
|
24
|
-
acc[colId] = typeof fnName === 'string' ? fnName : '';
|
|
25
|
-
}
|
|
26
|
-
else if (typeof AggFunc === 'string') {
|
|
27
|
-
acc[colId] = AggFunc;
|
|
28
|
-
}
|
|
29
|
-
return acc;
|
|
30
|
-
}, {});
|
|
31
|
-
}
|
|
32
|
-
function resolveAggFuncValueFromWizardSelection(fnName) {
|
|
33
|
-
const definition = (0, ParameterizedAggregationRegistry_1.getParameterizedAggregationDefinitionByAgGridName)(fnName);
|
|
34
|
-
if (definition) {
|
|
35
|
-
return definition.createInitialDefinition();
|
|
36
|
-
}
|
|
37
|
-
return fnName;
|
|
38
|
-
}
|
|
39
|
-
function upsertColumnAggregationEntry(entries, columnId, aggFunc) {
|
|
40
|
-
let aggCols = [...(entries || [])];
|
|
41
|
-
let found = false;
|
|
42
|
-
aggCols = aggCols.map((entry) => {
|
|
43
|
-
if (entry.ColumnId === columnId) {
|
|
44
|
-
found = true;
|
|
45
|
-
return { ColumnId: columnId, AggFunc: aggFunc };
|
|
46
|
-
}
|
|
47
|
-
return entry;
|
|
48
|
-
});
|
|
49
|
-
if (!found) {
|
|
50
|
-
aggCols.push({ ColumnId: columnId, AggFunc: aggFunc });
|
|
51
|
-
}
|
|
52
|
-
return aggCols;
|
|
53
|
-
}
|
|
54
|
-
function getParameterizedArgColumnLabel(aggFuncName) {
|
|
55
|
-
return (0, ParameterizedAggregationRegistry_1.getParameterizedAggregationDefinitionByAgGridName)(aggFuncName)?.argColumnLabel ?? 'Argument';
|
|
56
|
-
}
|
|
57
|
-
function formatParameterizedArgSelectionLabel(api, valueColumnId, aggValue) {
|
|
58
|
-
if (!(0, ParameterizedAggregationRegistry_1.isParameterizedAggregation)(aggValue)) {
|
|
59
|
-
return 'Select';
|
|
60
|
-
}
|
|
61
|
-
const definition = (0, ParameterizedAggregationRegistry_1.getParameterizedAggregationDefinition)(aggValue.type);
|
|
62
|
-
if (!definition) {
|
|
63
|
-
return 'Select';
|
|
64
|
-
}
|
|
65
|
-
if (definition.isComplete(aggValue) && definition.formatSummaryLabel) {
|
|
66
|
-
const shortLabel = definition.formatSummaryLabel(api, valueColumnId, aggValue);
|
|
67
|
-
const argPart = shortLabel.match(/\(([^)]+)\)/)?.[1];
|
|
68
|
-
if (argPart?.includes('-')) {
|
|
69
|
-
return argPart.split('-').slice(1).join('-');
|
|
70
|
-
}
|
|
71
|
-
return argPart ?? 'Select';
|
|
72
|
-
}
|
|
73
|
-
return `Select ${definition.argColumnLabel ?? 'value'}`;
|
|
74
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Layout, PivotLayout, TableLayout } from '../AdaptableState/LayoutState';
|
|
2
|
-
export declare function validateParameterizedAggregationsInLayout(layout: Layout): true | string;
|
|
3
|
-
export declare function validateTableLayoutAggregations(layout: TableLayout): true | string;
|
|
4
|
-
export declare function validatePivotLayoutAggregations(layout: PivotLayout): true | string;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateParameterizedAggregationsInLayout = validateParameterizedAggregationsInLayout;
|
|
4
|
-
exports.validateTableLayoutAggregations = validateTableLayoutAggregations;
|
|
5
|
-
exports.validatePivotLayoutAggregations = validatePivotLayoutAggregations;
|
|
6
|
-
const ParameterizedAggregationRegistry_1 = require("./ParameterizedAggregationRegistry");
|
|
7
|
-
const parameterizedAggregationHelpers_1 = require("./parameterizedAggregationHelpers");
|
|
8
|
-
function validateParameterizedAggregationsInLayout(layout) {
|
|
9
|
-
const entries = (0, parameterizedAggregationHelpers_1.getAggregationColumnsFromLayout)(layout) || [];
|
|
10
|
-
for (const { AggFunc } of entries) {
|
|
11
|
-
if ((0, ParameterizedAggregationRegistry_1.isParameterizedAggregation)(AggFunc)) {
|
|
12
|
-
const definition = (0, ParameterizedAggregationRegistry_1.getParameterizedAggregationDefinition)(AggFunc.type);
|
|
13
|
-
if (definition && !definition.isComplete(AggFunc)) {
|
|
14
|
-
return `${definition.label} requires all arguments to be selected.`;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
function validateTableLayoutAggregations(layout) {
|
|
21
|
-
return validateParameterizedAggregationsInLayout(layout);
|
|
22
|
-
}
|
|
23
|
-
function validatePivotLayoutAggregations(layout) {
|
|
24
|
-
return validateParameterizedAggregationsInLayout(layout);
|
|
25
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
declare const computedCSSVarNames: readonly ["--ab-cmp-select-menu__max-width", "--ab-cmp-select-menu__min-width", "--ab-cmp-select-menu__max-height"];
|
|
3
|
-
type AdaptableComputedCSSVars = {
|
|
4
|
-
[key in (typeof computedCSSVarNames)[number]]: string | number;
|
|
5
|
-
};
|
|
6
|
-
export declare const AdaptableComputedCSSVarsContext: React.Context<AdaptableComputedCSSVars>;
|
|
7
|
-
export declare const WithAdaptableComputedCSSVars: ({ children }: {
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
}) => React.JSX.Element;
|
|
10
|
-
export declare const useAdaptableComputedCSSVars: () => AdaptableComputedCSSVars;
|
|
11
|
-
export declare const useAdaptableComputedCSSVar: (varName: (typeof computedCSSVarNames)[number]) => string | number;
|
|
12
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useAdaptableComputedCSSVar = exports.useAdaptableComputedCSSVars = exports.WithAdaptableComputedCSSVars = exports.AdaptableComputedCSSVarsContext = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const React = tslib_1.__importStar(require("react"));
|
|
7
|
-
const CSSNumericVariableWatch_1 = require("../components/Select/CSSNumericVariableWatch");
|
|
8
|
-
const debounce_1 = tslib_1.__importDefault(require("../Utilities/utils/debounce"));
|
|
9
|
-
const react_1 = require("react");
|
|
10
|
-
const computedCSSVarNames = [
|
|
11
|
-
'--ab-cmp-select-menu__max-width',
|
|
12
|
-
'--ab-cmp-select-menu__min-width',
|
|
13
|
-
'--ab-cmp-select-menu__max-height',
|
|
14
|
-
];
|
|
15
|
-
const defaultValues = Object.fromEntries(computedCSSVarNames.map((varName) => [varName, 0]));
|
|
16
|
-
exports.AdaptableComputedCSSVarsContext = React.createContext(defaultValues);
|
|
17
|
-
const WithAdaptableComputedCSSVars = ({ children }) => {
|
|
18
|
-
const [computedCSSVars, doSetComputedCSSVars] = React.useState(defaultValues);
|
|
19
|
-
const setComputedCSSVars = (0, react_1.useMemo)(() => {
|
|
20
|
-
return (0, debounce_1.default)(doSetComputedCSSVars, 300, { leading: false, trailing: true });
|
|
21
|
-
}, [doSetComputedCSSVars]);
|
|
22
|
-
return ((0, jsx_runtime_1.jsxs)(exports.AdaptableComputedCSSVarsContext.Provider, { value: computedCSSVars, children: [children, computedCSSVarNames.map((varName) => ((0, jsx_runtime_1.jsx)(CSSNumericVariableWatch_1.CSSNumericVariableWatch, { varName: varName, onChange: (value) => {
|
|
23
|
-
setComputedCSSVars((prev) => ({ ...prev, [varName]: value }));
|
|
24
|
-
} }, varName)))] }));
|
|
25
|
-
};
|
|
26
|
-
exports.WithAdaptableComputedCSSVars = WithAdaptableComputedCSSVars;
|
|
27
|
-
const useAdaptableComputedCSSVars = () => {
|
|
28
|
-
const context = React.useContext(exports.AdaptableComputedCSSVarsContext);
|
|
29
|
-
return context;
|
|
30
|
-
};
|
|
31
|
-
exports.useAdaptableComputedCSSVars = useAdaptableComputedCSSVars;
|
|
32
|
-
const useAdaptableComputedCSSVar = (varName) => {
|
|
33
|
-
const context = React.useContext(exports.AdaptableComputedCSSVarsContext);
|
|
34
|
-
return context?.[varName];
|
|
35
|
-
};
|
|
36
|
-
exports.useAdaptableComputedCSSVar = useAdaptableComputedCSSVar;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { AdaptableColumn } from '../../../../AdaptableState/Common/AdaptableColumn';
|
|
3
|
-
import { AggregationColumnValue, TableAggregationColumns } from '../../../../AdaptableState/Common/AggregationColumns';
|
|
4
|
-
export declare const ParameterizedAggFuncPicker: React.FunctionComponent<{
|
|
5
|
-
column: AdaptableColumn;
|
|
6
|
-
aggValue?: AggregationColumnValue;
|
|
7
|
-
aggregationColumnsMap: Record<string, string>;
|
|
8
|
-
numberColumns: AdaptableColumn[];
|
|
9
|
-
aggregationEntries: TableAggregationColumns;
|
|
10
|
-
onChangeEntries: (entries: TableAggregationColumns) => void;
|
|
11
|
-
availableAggregationFunctions?: string[];
|
|
12
|
-
}>;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ParameterizedAggFuncPicker = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const DropdownButton_1 = tslib_1.__importDefault(require("../../../../components/DropdownButton"));
|
|
7
|
-
const ParameterizedAggregationRegistry_1 = require("../../../../Aggregation/ParameterizedAggregationRegistry");
|
|
8
|
-
const parameterizedAggregationWizardHelpers_1 = require("../../../../Aggregation/parameterizedAggregationWizardHelpers");
|
|
9
|
-
const AdaptableContext_1 = require("../../../AdaptableContext");
|
|
10
|
-
const Flex_1 = require("../../../../components/Flex");
|
|
11
|
-
const ParameterizedAggFuncPicker = (props) => {
|
|
12
|
-
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
13
|
-
const adaptableAggFunctions = (0, parameterizedAggregationWizardHelpers_1.getAdaptableAggFuncNamesForColumn)(props.column);
|
|
14
|
-
const availableAggregationFunctions = props.availableAggregationFunctions ?? props.column.availableAggregationFunctions ?? [];
|
|
15
|
-
const aggOptions = [
|
|
16
|
-
...new Set([...availableAggregationFunctions, ...adaptableAggFunctions]),
|
|
17
|
-
].map((fnName) => ({
|
|
18
|
-
label: fnName,
|
|
19
|
-
onClick: () => {
|
|
20
|
-
const aggFuncValue = (0, parameterizedAggregationWizardHelpers_1.resolveAggFuncValueFromWizardSelection)(fnName);
|
|
21
|
-
props.onChangeEntries((0, parameterizedAggregationWizardHelpers_1.upsertColumnAggregationEntry)(props.aggregationEntries, props.column.columnId, aggFuncValue));
|
|
22
|
-
},
|
|
23
|
-
}));
|
|
24
|
-
const currentAggFnName = props.aggregationColumnsMap[props.column.columnId];
|
|
25
|
-
const parameterizedDefinition = currentAggFnName
|
|
26
|
-
? (0, ParameterizedAggregationRegistry_1.getParameterizedAggregationDefinitionByAgGridName)(currentAggFnName)
|
|
27
|
-
: undefined;
|
|
28
|
-
const numericColumnsOptions = props.numberColumns
|
|
29
|
-
.filter((col) => col.columnId !== props.column.columnId)
|
|
30
|
-
.map((col) => {
|
|
31
|
-
return {
|
|
32
|
-
label: col.friendlyName,
|
|
33
|
-
onClick: () => {
|
|
34
|
-
const definition = parameterizedDefinition;
|
|
35
|
-
if (!definition?.createDefinition) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
props.onChangeEntries((0, parameterizedAggregationWizardHelpers_1.upsertColumnAggregationEntry)(props.aggregationEntries, props.column.columnId, definition.createDefinition(col.columnId)));
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
const argSelectionLabel = (0, parameterizedAggregationWizardHelpers_1.formatParameterizedArgSelectionLabel)(adaptable.api, props.column.columnId, props.aggValue);
|
|
43
|
-
if (!props.aggValue) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(DropdownButton_1.default, { columns: ['label'], items: aggOptions, className: "twa:ml-2", children: currentAggFnName }), parameterizedDefinition && ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { className: "twa:bg-primary twa:ml-3", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { children: (0, parameterizedAggregationWizardHelpers_1.getParameterizedArgColumnLabel)(currentAggFnName) }), ' ', (0, jsx_runtime_1.jsx)(DropdownButton_1.default, { columns: ['label'], items: numericColumnsOptions, className: "twa:ml-2", children: argSelectionLabel })] }))] }));
|
|
47
|
-
};
|
|
48
|
-
exports.ParameterizedAggFuncPicker = ParameterizedAggFuncPicker;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StyledColumnBadgeSettings = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const Tag_1 = require("../../../../../components/Tag");
|
|
6
|
-
const AdaptableContext_1 = require("../../../../AdaptableContext");
|
|
7
|
-
const Flex_1 = require("../../../../../components/Flex");
|
|
8
|
-
const StyledColumnBadgeSettings = ({ data }) => {
|
|
9
|
-
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
10
|
-
const badgeStyle = data.BadgeStyle;
|
|
11
|
-
if (!badgeStyle || !badgeStyle.Badges || badgeStyle.Badges.length === 0) {
|
|
12
|
-
return (0, jsx_runtime_1.jsx)("div", { children: "No Badges Defined" });
|
|
13
|
-
}
|
|
14
|
-
const density = badgeStyle.Density ?? 'Normal';
|
|
15
|
-
const spacing = typeof badgeStyle.Spacing === 'number' ? badgeStyle.Spacing : null;
|
|
16
|
-
const overflowMode = badgeStyle.OverflowMode ?? 'Truncate';
|
|
17
|
-
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { className: "twa:my-1 twa:flex-wrap twa:gap-2", children: [(0, jsx_runtime_1.jsxs)(Tag_1.Tag, { children: ["Density: ", density] }), spacing != null && (0, jsx_runtime_1.jsxs)(Tag_1.Tag, { children: ["Spacing: ", spacing, "px"] }), (0, jsx_runtime_1.jsxs)(Tag_1.Tag, { children: ["Overflow: ", overflowMode] })] }), badgeStyle.Badges.map((badge, index) => {
|
|
18
|
-
let ruleString = 'No Rule';
|
|
19
|
-
if (badge.Predicate) {
|
|
20
|
-
ruleString = adaptable.api.predicateApi.predicateToString(badge.Predicate);
|
|
21
|
-
}
|
|
22
|
-
if (badge.Expression) {
|
|
23
|
-
ruleString = badge.Expression.BooleanExpression;
|
|
24
|
-
}
|
|
25
|
-
const iconOnly = badge.Icon && badge.IconOnly;
|
|
26
|
-
const hasIconPosition = badge.Icon && badge.IconPosition;
|
|
27
|
-
const iconPosition = hasIconPosition ? 'Icon Position: ' + badge.IconPosition : '';
|
|
28
|
-
const shape = badge.Shape;
|
|
29
|
-
return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:my-2", children: [(0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: ruleString }), shape && (0, jsx_runtime_1.jsx)(Tag_1.Tag, { className: "twa:ml-2", children: `Shape: ${shape}` }), iconOnly && (0, jsx_runtime_1.jsx)(Tag_1.Tag, { className: "twa:ml-2", children: 'Icon Only' }), hasIconPosition && (0, jsx_runtime_1.jsx)(Tag_1.Tag, { className: "twa:ml-2", children: iconPosition }), typeof badge.IconGap === 'number' && ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { className: "twa:ml-2", children: `Icon Gap: ${badge.IconGap}px` }))] }, index));
|
|
30
|
-
})] }));
|
|
31
|
-
};
|
|
32
|
-
exports.StyledColumnBadgeSettings = StyledColumnBadgeSettings;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { AdaptableTheme } from '../../types';
|
|
3
|
-
export interface VariantSelectorProps {
|
|
4
|
-
theme: AdaptableTheme;
|
|
5
|
-
onChange: (variant: AdaptableTheme['Variant'] | null) => void;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const VariantSelector: React.FunctionComponent<VariantSelectorProps>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VariantSelector = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const DropdownButton_1 = tslib_1.__importDefault(require("../../components/DropdownButton"));
|
|
7
|
-
const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
|
|
8
|
-
const AdaptableContext_1 = require("../AdaptableContext");
|
|
9
|
-
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
10
|
-
const VariantSelector = (props) => {
|
|
11
|
-
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
12
|
-
const systemTemes = adaptable.api.themeApi
|
|
13
|
-
.getSystemThemes()
|
|
14
|
-
.filter((theme) => theme.Name !== GeneralConstants_1.OS_THEME);
|
|
15
|
-
const options = systemTemes.map((theme) => ({
|
|
16
|
-
label: theme.Description,
|
|
17
|
-
value: theme.Name,
|
|
18
|
-
onClick: () => props.onChange(theme.Name),
|
|
19
|
-
}));
|
|
20
|
-
const label = props.theme.Variant
|
|
21
|
-
? options.find((theme) => theme.value === props.theme.Variant)?.label
|
|
22
|
-
: 'Select a theme';
|
|
23
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(DropdownButton_1.default, { className: "twa:mr-2", columns: ['label'], items: options, disabled: props.disabled, children: label }), (0, jsx_runtime_1.jsx)(SimpleButton_1.default, { onClick: () => props.onChange(null), disabled: !props.theme.Variant || props.disabled, hidden: props.disabled, icon: "delete" })] }));
|
|
24
|
-
};
|
|
25
|
-
exports.VariantSelector = VariantSelector;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
type CSSVariableWatcherProps = {
|
|
3
|
-
varName: string;
|
|
4
|
-
onChange: (value: number) => void;
|
|
5
|
-
allowInts?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare const useCSSVariableWatch: (params: CSSVariableWatcherProps & {
|
|
8
|
-
ref: React.MutableRefObject<HTMLElement | null>;
|
|
9
|
-
}) => void;
|
|
10
|
-
export declare const CSSNumericVariableWatch: (props: CSSVariableWatcherProps) => React.JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CSSNumericVariableWatch = exports.useCSSVariableWatch = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const React = tslib_1.__importStar(require("react"));
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const ResizeObserver_1 = require("../ResizeObserver");
|
|
9
|
-
const WRAPPER_STYLE = {
|
|
10
|
-
position: 'absolute',
|
|
11
|
-
pointerEvents: 'none',
|
|
12
|
-
width: 0,
|
|
13
|
-
height: 0,
|
|
14
|
-
lineHeight: 0,
|
|
15
|
-
fontSize: 0,
|
|
16
|
-
overflow: 'hidden',
|
|
17
|
-
};
|
|
18
|
-
const useCSSVariableWatch = (params) => {
|
|
19
|
-
const lastValueRef = (0, react_1.useRef)(0);
|
|
20
|
-
const onResize = React.useCallback(({ height }) => {
|
|
21
|
-
if (height != null && height !== lastValueRef.current) {
|
|
22
|
-
lastValueRef.current = height;
|
|
23
|
-
params.onChange(height);
|
|
24
|
-
}
|
|
25
|
-
}, [params.onChange]);
|
|
26
|
-
(0, ResizeObserver_1.useResizeObserver)(params.ref, onResize, { earlyAttach: true });
|
|
27
|
-
React.useLayoutEffect(() => {
|
|
28
|
-
const value = params.ref.current.getBoundingClientRect().height;
|
|
29
|
-
if (value != null) {
|
|
30
|
-
lastValueRef.current = value;
|
|
31
|
-
return params.onChange(value);
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
console.warn(`Specified variable ${params.varName} not found or does not have a numeric value.`);
|
|
35
|
-
}
|
|
36
|
-
}, []);
|
|
37
|
-
};
|
|
38
|
-
exports.useCSSVariableWatch = useCSSVariableWatch;
|
|
39
|
-
const CSSNumericVariableWatch = (props) => {
|
|
40
|
-
const domRef = (0, react_1.useRef)(null);
|
|
41
|
-
(0, exports.useCSSVariableWatch)({
|
|
42
|
-
...props,
|
|
43
|
-
ref: domRef,
|
|
44
|
-
});
|
|
45
|
-
const height = props.varName.startsWith('var(') ? props.varName : `var(${props.varName})`;
|
|
46
|
-
const { allowInts = false } = props;
|
|
47
|
-
return ((0, jsx_runtime_1.jsx)("div", { "data-name": "css-variable-watcher", "data-var": props.varName, style: WRAPPER_STYLE, children: (0, jsx_runtime_1.jsx)("div", { ref: domRef, style: {
|
|
48
|
-
height: allowInts ? `calc(1px * ${height})` : height, // we do multiplication in order to support integer (without px) values as well
|
|
49
|
-
} }) }));
|
|
50
|
-
};
|
|
51
|
-
exports.CSSNumericVariableWatch = CSSNumericVariableWatch;
|