@perses-dev/components 0.38.0 → 0.40.0
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/dist/BarChart/BarChart.d.ts +2 -2
- package/dist/BarChart/BarChart.d.ts.map +1 -1
- package/dist/BarChart/BarChart.js +16 -10
- package/dist/BarChart/BarChart.js.map +1 -1
- package/dist/BarChart/index.js.map +1 -1
- package/dist/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/ColorPicker/index.js.map +1 -1
- package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -1
- package/dist/ContentWithLegend/index.js.map +1 -1
- package/dist/ContentWithLegend/model/content-with-legend-model.d.ts +1 -1
- package/dist/ContentWithLegend/model/content-with-legend-model.js +19 -19
- package/dist/ContentWithLegend/model/content-with-legend-model.js.map +1 -1
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts.map +1 -1
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js +6 -22
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +1 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.js.map +1 -1
- package/dist/DateTimeRangePicker/index.js.map +1 -1
- package/dist/DateTimeRangePicker/utils.js.map +1 -1
- package/dist/Dialog/Dialog.js.map +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/Dialog/index.js.map +1 -1
- package/dist/Drawer/Drawer.js.map +1 -1
- package/dist/Drawer/index.js.map +1 -1
- package/dist/EChart/EChart.js +2 -2
- package/dist/EChart/EChart.js.map +1 -1
- package/dist/EChart/index.js.map +1 -1
- package/dist/ErrorAlert.js.map +1 -1
- package/dist/ErrorBoundary.js.map +1 -1
- package/dist/FontSizeSelector/FontSizeSelector.js.map +1 -1
- package/dist/FontSizeSelector/index.js.map +1 -1
- package/dist/FormatControls/FormatControls.d.ts +9 -0
- package/dist/FormatControls/FormatControls.d.ts.map +1 -0
- package/dist/{UnitSelector/UnitSelector.js → FormatControls/FormatControls.js} +26 -26
- package/dist/FormatControls/FormatControls.js.map +1 -0
- package/dist/FormatControls/index.d.ts +2 -0
- package/dist/FormatControls/index.d.ts.map +1 -0
- package/dist/{UnitSelector → FormatControls}/index.js +1 -1
- package/dist/FormatControls/index.js.map +1 -0
- package/dist/GaugeChart/GaugeChart.d.ts +3 -3
- package/dist/GaugeChart/GaugeChart.d.ts.map +1 -1
- package/dist/GaugeChart/GaugeChart.js +12 -12
- package/dist/GaugeChart/GaugeChart.js.map +1 -1
- package/dist/GaugeChart/index.js.map +1 -1
- package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
- package/dist/InfoTooltip/index.js.map +1 -1
- package/dist/JSONEditor.js.map +1 -1
- package/dist/Legend/CompactLegend.js.map +1 -1
- package/dist/Legend/Legend.js +3 -3
- package/dist/Legend/Legend.js.map +1 -1
- package/dist/Legend/LegendColorBadge.js.map +1 -1
- package/dist/Legend/ListLegend.js.map +1 -1
- package/dist/Legend/ListLegendItem.js +2 -2
- package/dist/Legend/ListLegendItem.js.map +1 -1
- package/dist/Legend/TableLegend.js.map +1 -1
- package/dist/Legend/index.js.map +1 -1
- package/dist/Legend/legend-model.js.map +1 -1
- package/dist/LineChart/LineChart.d.ts +2 -2
- package/dist/LineChart/LineChart.d.ts.map +1 -1
- package/dist/LineChart/LineChart.js +17 -18
- package/dist/LineChart/LineChart.js.map +1 -1
- package/dist/LineChart/index.js.map +1 -1
- package/dist/ModeSelector/ModeSelector.js.map +1 -1
- package/dist/ModeSelector/index.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
- package/dist/OptionsEditorLayout/index.js.map +1 -1
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
- package/dist/RefreshIntervalPicker/index.js.map +1 -1
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js +2 -2
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
- package/dist/SettingsAutocomplete/index.js.map +1 -1
- package/dist/SortSelector/SortSelector.js.map +1 -1
- package/dist/SortSelector/index.js.map +1 -1
- package/dist/StatChart/StatChart.d.ts +2 -2
- package/dist/StatChart/StatChart.d.ts.map +1 -1
- package/dist/StatChart/StatChart.js +8 -8
- package/dist/StatChart/StatChart.js.map +1 -1
- package/dist/StatChart/calculateFontSize.js +7 -7
- package/dist/StatChart/calculateFontSize.js.map +1 -1
- package/dist/StatChart/index.js.map +1 -1
- package/dist/Table/InnerTable.js.map +1 -1
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/TableBody.js.map +1 -1
- package/dist/Table/TableCell.js +2 -2
- package/dist/Table/TableCell.js.map +1 -1
- package/dist/Table/TableCheckbox.js.map +1 -1
- package/dist/Table/TableHead.js.map +1 -1
- package/dist/Table/TableHeaderCell.js.map +1 -1
- package/dist/Table/TableRow.js.map +1 -1
- package/dist/Table/VirtualizedTable.js +6 -6
- package/dist/Table/VirtualizedTable.js.map +1 -1
- package/dist/Table/VirtualizedTableContainer.js.map +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js +20 -20
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
- package/dist/Table/index.js.map +1 -1
- package/dist/Table/model/table-model.js +9 -9
- package/dist/Table/model/table-model.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdColorPicker.js +2 -2
- package/dist/ThresholdsEditor/ThresholdColorPicker.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdInput.js +1 -1
- package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.js +19 -18
- package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
- package/dist/ThresholdsEditor/index.js.map +1 -1
- package/dist/TimeChart/TimeChart.d.ts +3 -3
- package/dist/TimeChart/TimeChart.d.ts.map +1 -1
- package/dist/TimeChart/TimeChart.js +108 -61
- package/dist/TimeChart/TimeChart.js.map +1 -1
- package/dist/TimeChart/index.js.map +1 -1
- package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts +3 -2
- package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/LineChartTooltip.js +9 -8
- package/dist/TimeSeriesTooltip/LineChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.js +2 -2
- package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts +3 -2
- package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js +6 -5
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.d.ts +1 -0
- package/dist/TimeSeriesTooltip/TooltipHeader.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.js +11 -11
- package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
- package/dist/TimeSeriesTooltip/index.js.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.d.ts +7 -7
- package/dist/TimeSeriesTooltip/nearby-series.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.js +35 -39
- package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts +4 -0
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.js +6 -0
- package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
- package/dist/TimeSeriesTooltip/utils.js +3 -3
- package/dist/TimeSeriesTooltip/utils.js.map +1 -1
- package/dist/YAxisLabel.js.map +1 -1
- package/dist/cjs/BarChart/BarChart.js +24 -16
- package/dist/cjs/BarChart/index.js +10 -8
- package/dist/cjs/ColorPicker/ColorPicker.js +15 -13
- package/dist/cjs/ColorPicker/index.js +10 -8
- package/dist/cjs/ContentWithLegend/ContentWithLegend.js +12 -10
- package/dist/cjs/ContentWithLegend/index.js +10 -8
- package/dist/cjs/ContentWithLegend/model/content-with-legend-model.js +27 -23
- package/dist/cjs/DateTimeRangePicker/AbsoluteTimePicker.js +29 -43
- package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +12 -10
- package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +13 -11
- package/dist/cjs/DateTimeRangePicker/index.js +12 -10
- package/dist/cjs/DateTimeRangePicker/utils.js +9 -5
- package/dist/cjs/Dialog/Dialog.js +15 -13
- package/dist/cjs/Dialog/DiscardChangesConfirmationDialog.js +11 -9
- package/dist/cjs/Dialog/index.js +11 -9
- package/dist/cjs/Drawer/Drawer.js +5 -3
- package/dist/cjs/Drawer/index.js +10 -8
- package/dist/cjs/EChart/EChart.js +12 -10
- package/dist/cjs/EChart/index.js +10 -8
- package/dist/cjs/ErrorAlert.js +5 -3
- package/dist/cjs/ErrorBoundary.js +4 -2
- package/dist/cjs/FontSizeSelector/FontSizeSelector.js +8 -6
- package/dist/cjs/FontSizeSelector/index.js +10 -8
- package/dist/cjs/{UnitSelector/UnitSelector.js → FormatControls/FormatControls.js} +38 -36
- package/dist/cjs/{UnitSelector → FormatControls}/index.js +10 -8
- package/dist/cjs/GaugeChart/GaugeChart.js +22 -18
- package/dist/cjs/GaugeChart/index.js +10 -8
- package/dist/cjs/InfoTooltip/InfoTooltip.js +13 -11
- package/dist/cjs/InfoTooltip/index.js +10 -8
- package/dist/cjs/JSONEditor.js +10 -8
- package/dist/cjs/Legend/CompactLegend.js +9 -7
- package/dist/cjs/Legend/Legend.js +15 -13
- package/dist/cjs/Legend/LegendColorBadge.js +7 -5
- package/dist/cjs/Legend/ListLegend.js +10 -8
- package/dist/cjs/Legend/ListLegendItem.js +12 -10
- package/dist/cjs/Legend/TableLegend.js +7 -5
- package/dist/cjs/Legend/index.js +11 -9
- package/dist/cjs/Legend/legend-model.js +3 -1
- package/dist/cjs/LineChart/LineChart.js +26 -25
- package/dist/cjs/LineChart/index.js +10 -8
- package/dist/cjs/ModeSelector/ModeSelector.js +8 -6
- package/dist/cjs/ModeSelector/index.js +10 -8
- package/dist/cjs/OptionsEditorLayout/OptionsEditorColumn.js +6 -4
- package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +16 -14
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGrid.js +5 -3
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +11 -9
- package/dist/cjs/OptionsEditorLayout/index.js +13 -11
- package/dist/cjs/RefreshIntervalPicker/RefreshIntervalPicker.js +8 -6
- package/dist/cjs/RefreshIntervalPicker/index.js +10 -8
- package/dist/cjs/SettingsAutocomplete/SettingsAutocomplete.js +12 -10
- package/dist/cjs/SettingsAutocomplete/index.js +10 -8
- package/dist/cjs/SortSelector/SortSelector.js +8 -6
- package/dist/cjs/SortSelector/index.js +10 -8
- package/dist/cjs/StatChart/StatChart.js +20 -18
- package/dist/cjs/StatChart/calculateFontSize.js +10 -8
- package/dist/cjs/StatChart/index.js +10 -8
- package/dist/cjs/Table/InnerTable.js +5 -3
- package/dist/cjs/Table/Table.js +15 -13
- package/dist/cjs/Table/TableBody.js +5 -3
- package/dist/cjs/Table/TableCell.js +10 -8
- package/dist/cjs/Table/TableCheckbox.js +5 -3
- package/dist/cjs/Table/TableHead.js +5 -3
- package/dist/cjs/Table/TableHeaderCell.js +8 -6
- package/dist/cjs/Table/TableRow.js +5 -3
- package/dist/cjs/Table/VirtualizedTable.js +32 -30
- package/dist/cjs/Table/VirtualizedTableContainer.js +5 -3
- package/dist/cjs/Table/hooks/useTableKeyboardNav.js +3 -1
- package/dist/cjs/Table/hooks/useVirtualizedTableKeyboardNav.js +23 -21
- package/dist/cjs/Table/index.js +14 -10
- package/dist/cjs/Table/model/table-model.js +15 -11
- package/dist/cjs/ThresholdsEditor/ThresholdColorPicker.js +15 -13
- package/dist/cjs/ThresholdsEditor/ThresholdInput.js +14 -12
- package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +44 -41
- package/dist/cjs/ThresholdsEditor/index.js +10 -8
- package/dist/cjs/TimeChart/TimeChart.js +121 -72
- package/dist/cjs/TimeChart/index.js +10 -8
- package/dist/cjs/TimeSeriesTooltip/LineChartTooltip.js +30 -27
- package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +17 -15
- package/dist/cjs/TimeSeriesTooltip/SeriesLabelsStack.js +15 -13
- package/dist/cjs/TimeSeriesTooltip/SeriesMarker.js +5 -3
- package/dist/cjs/TimeSeriesTooltip/TimeChartTooltip.js +24 -21
- package/dist/cjs/TimeSeriesTooltip/TooltipContent.js +7 -5
- package/dist/cjs/TimeSeriesTooltip/TooltipHeader.js +36 -34
- package/dist/cjs/TimeSeriesTooltip/index.js +19 -17
- package/dist/cjs/TimeSeriesTooltip/nearby-series.js +61 -47
- package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +57 -14
- package/dist/cjs/TimeSeriesTooltip/utils.js +17 -13
- package/dist/cjs/YAxisLabel.js +6 -4
- package/dist/cjs/context/{ChartsThemeProvider.js → ChartsProvider.js} +38 -11
- package/dist/cjs/context/SnackbarProvider.js +6 -2
- package/dist/cjs/context/TimeZoneProvider.js +13 -7
- package/dist/cjs/context/index.js +32 -0
- package/dist/cjs/index.js +41 -41
- package/dist/cjs/model/graph.js +9 -3
- package/dist/cjs/model/index.js +12 -10
- package/dist/cjs/test/index.js +10 -8
- package/dist/cjs/test/render.js +7 -5
- package/dist/cjs/test-utils/index.js +10 -8
- package/dist/cjs/test-utils/theme.js +36 -19
- package/dist/cjs/theme/component-overrides/alert.js +3 -1
- package/dist/cjs/theme/component-overrides/paper.js +3 -1
- package/dist/cjs/theme/index.js +10 -8
- package/dist/cjs/theme/palette/background.js +6 -2
- package/dist/cjs/theme/palette/colors/blue.js +3 -1
- package/dist/cjs/theme/palette/colors/common.js +6 -2
- package/dist/cjs/theme/palette/colors/green.js +3 -1
- package/dist/cjs/theme/palette/colors/grey.js +3 -1
- package/dist/cjs/theme/palette/colors/index.js +17 -15
- package/dist/cjs/theme/palette/colors/orange.js +3 -1
- package/dist/cjs/theme/palette/colors/purple.js +3 -1
- package/dist/cjs/theme/palette/colors/red.js +3 -1
- package/dist/cjs/theme/palette/error.js +3 -1
- package/dist/cjs/theme/palette/grey.js +3 -1
- package/dist/cjs/theme/palette/index.js +10 -8
- package/dist/cjs/theme/palette/palette-options.js +3 -1
- package/dist/cjs/theme/palette/primary.js +3 -1
- package/dist/cjs/theme/palette/secondary.js +3 -1
- package/dist/cjs/theme/palette/success.js +3 -1
- package/dist/cjs/theme/palette/text.js +3 -1
- package/dist/cjs/theme/palette/warning.js +3 -1
- package/dist/cjs/theme/theme.js +5 -3
- package/dist/cjs/theme/typography.js +3 -1
- package/dist/cjs/utils/axis.js +11 -7
- package/dist/cjs/utils/chart-actions.js +59 -5
- package/dist/cjs/utils/combine-sx.js +3 -1
- package/dist/cjs/utils/component-ids.js +3 -1
- package/dist/cjs/utils/format.js +16 -8
- package/dist/cjs/utils/index.js +15 -13
- package/dist/cjs/utils/mathjs.js +3 -1
- package/dist/cjs/utils/theme-gen.js +12 -10
- package/dist/context/ChartsProvider.d.ts +19 -0
- package/dist/context/ChartsProvider.d.ts.map +1 -0
- package/dist/context/{ChartsThemeProvider.js → ChartsProvider.js} +24 -6
- package/dist/context/ChartsProvider.js.map +1 -0
- package/dist/context/SnackbarProvider.js.map +1 -1
- package/dist/context/TimeZoneProvider.js.map +1 -1
- package/dist/context/index.d.ts +4 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +17 -0
- package/dist/context/index.js.map +1 -0
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/model/graph.js.map +1 -1
- package/dist/model/index.js.map +1 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/theme.d.ts +2 -0
- package/dist/test-utils/theme.d.ts.map +1 -1
- package/dist/test-utils/theme.js +23 -16
- package/dist/test-utils/theme.js.map +1 -1
- package/dist/theme/component-overrides/alert.js.map +1 -1
- package/dist/theme/component-overrides/paper.js.map +1 -1
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/palette/background.d.ts.map +1 -1
- package/dist/theme/palette/background.js +3 -1
- package/dist/theme/palette/background.js.map +1 -1
- package/dist/theme/palette/colors/blue.js.map +1 -1
- package/dist/theme/palette/colors/common.js.map +1 -1
- package/dist/theme/palette/colors/green.js.map +1 -1
- package/dist/theme/palette/colors/grey.js.map +1 -1
- package/dist/theme/palette/colors/index.js.map +1 -1
- package/dist/theme/palette/colors/orange.js.map +1 -1
- package/dist/theme/palette/colors/purple.js.map +1 -1
- package/dist/theme/palette/colors/red.js.map +1 -1
- package/dist/theme/palette/error.js.map +1 -1
- package/dist/theme/palette/grey.js.map +1 -1
- package/dist/theme/palette/index.js.map +1 -1
- package/dist/theme/palette/palette-options.js.map +1 -1
- package/dist/theme/palette/primary.js.map +1 -1
- package/dist/theme/palette/secondary.js.map +1 -1
- package/dist/theme/palette/success.js.map +1 -1
- package/dist/theme/palette/text.js.map +1 -1
- package/dist/theme/palette/warning.js.map +1 -1
- package/dist/theme/theme.js.map +1 -1
- package/dist/theme/typography.js.map +1 -1
- package/dist/utils/axis.d.ts +4 -4
- package/dist/utils/axis.d.ts.map +1 -1
- package/dist/utils/axis.js +4 -4
- package/dist/utils/axis.js.map +1 -1
- package/dist/utils/chart-actions.d.ts +5 -1
- package/dist/utils/chart-actions.d.ts.map +1 -1
- package/dist/utils/chart-actions.js +42 -0
- package/dist/utils/chart-actions.js.map +1 -1
- package/dist/utils/combine-sx.js.map +1 -1
- package/dist/utils/component-ids.js.map +1 -1
- package/dist/utils/format.js.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/mathjs.js.map +1 -1
- package/dist/utils/theme-gen.js +7 -7
- package/dist/utils/theme-gen.js.map +1 -1
- package/package.json +7 -6
- package/dist/UnitSelector/UnitSelector.d.ts +0 -9
- package/dist/UnitSelector/UnitSelector.d.ts.map +0 -1
- package/dist/UnitSelector/UnitSelector.js.map +0 -1
- package/dist/UnitSelector/index.d.ts +0 -2
- package/dist/UnitSelector/index.d.ts.map +0 -1
- package/dist/UnitSelector/index.js.map +0 -1
- package/dist/context/ChartsThemeProvider.d.ts +0 -10
- package/dist/context/ChartsThemeProvider.d.ts.map +0 -1
- package/dist/context/ChartsThemeProvider.js.map +0 -1
|
@@ -16,15 +16,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "ThresholdColorPicker", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return ThresholdColorPicker;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
22
|
-
const _react = /*#__PURE__*/
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
23
25
|
const _material = require("@mui/material");
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
function
|
|
26
|
+
const _Circle = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Circle"));
|
|
27
|
+
const _ChartsProvider = require("../context/ChartsProvider");
|
|
28
|
+
const _ColorPicker = require("../ColorPicker");
|
|
29
|
+
function _interop_require_default(obj) {
|
|
28
30
|
return obj && obj.__esModule ? obj : {
|
|
29
31
|
default: obj
|
|
30
32
|
};
|
|
@@ -38,18 +40,18 @@ function ThresholdColorPicker({ color , onColorChange , label }) {
|
|
|
38
40
|
const closeColorPicker = ()=>{
|
|
39
41
|
setAnchorEl(null);
|
|
40
42
|
};
|
|
41
|
-
const { thresholds: { defaultColor , palette }
|
|
42
|
-
return /*#__PURE__*/ (0,
|
|
43
|
+
const { thresholds: { defaultColor , palette } } = (0, _ChartsProvider.useChartsTheme)();
|
|
44
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
43
45
|
children: [
|
|
44
|
-
/*#__PURE__*/ (0,
|
|
46
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(ColorIconButton, {
|
|
45
47
|
size: "small",
|
|
46
48
|
"aria-label": `change threshold ${label} color`,
|
|
47
49
|
isSelected: isOpen,
|
|
48
50
|
iconColor: color,
|
|
49
51
|
onClick: openColorPicker,
|
|
50
|
-
children: /*#__PURE__*/ (0,
|
|
52
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Circle.default, {})
|
|
51
53
|
}),
|
|
52
|
-
/*#__PURE__*/ (0,
|
|
54
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Popover, {
|
|
53
55
|
"data-testid": "threshold color picker",
|
|
54
56
|
open: isOpen,
|
|
55
57
|
anchorEl: anchorEl,
|
|
@@ -67,7 +69,7 @@ function ThresholdColorPicker({ color , onColorChange , label }) {
|
|
|
67
69
|
vertical: 'top',
|
|
68
70
|
horizontal: 'right'
|
|
69
71
|
},
|
|
70
|
-
children: /*#__PURE__*/ (0,
|
|
72
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ColorPicker.ColorPicker, {
|
|
71
73
|
color: color,
|
|
72
74
|
onChange: onColorChange,
|
|
73
75
|
palette: [
|
|
@@ -16,37 +16,39 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "ThresholdInput", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return ThresholdInput;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _react = require("react");
|
|
23
25
|
const _material = require("@mui/material");
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
function
|
|
26
|
+
const _DeleteOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/DeleteOutline"));
|
|
27
|
+
const _ThresholdColorPicker = require("./ThresholdColorPicker");
|
|
28
|
+
function _interop_require_default(obj) {
|
|
27
29
|
return obj && obj.__esModule ? obj : {
|
|
28
30
|
default: obj
|
|
29
31
|
};
|
|
30
32
|
}
|
|
31
33
|
function ThresholdInput({ inputRef , label , color , value , mode , onChange , onColorChange , onBlur , onDelete }) {
|
|
32
34
|
const [key, setKey] = (0, _react.useState)(0); // use key to cause input to lose focus when pressing enter
|
|
33
|
-
return /*#__PURE__*/ (0,
|
|
35
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
34
36
|
flex: 1,
|
|
35
37
|
direction: "row",
|
|
36
38
|
alignItems: "center",
|
|
37
39
|
justifyContent: "space-between",
|
|
38
40
|
spacing: 1,
|
|
39
41
|
children: [
|
|
40
|
-
/*#__PURE__*/ (0,
|
|
42
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_ThresholdColorPicker.ThresholdColorPicker, {
|
|
41
43
|
label: label,
|
|
42
44
|
color: color,
|
|
43
45
|
onColorChange: onColorChange
|
|
44
46
|
}),
|
|
45
|
-
/*#__PURE__*/ (0,
|
|
47
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormLabel, {
|
|
46
48
|
htmlFor: label,
|
|
47
49
|
children: label
|
|
48
50
|
}),
|
|
49
|
-
/*#__PURE__*/ (0,
|
|
51
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
50
52
|
id: label,
|
|
51
53
|
inputRef: inputRef,
|
|
52
54
|
type: "number",
|
|
@@ -61,17 +63,17 @@ function ThresholdInput({ inputRef , label , color , value , mode , onChange , o
|
|
|
61
63
|
}
|
|
62
64
|
},
|
|
63
65
|
InputProps: {
|
|
64
|
-
endAdornment: mode === '
|
|
66
|
+
endAdornment: mode === 'percent' ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
65
67
|
paddingX: 1,
|
|
66
68
|
children: "%"
|
|
67
69
|
}) : undefined
|
|
68
70
|
}
|
|
69
71
|
}, key),
|
|
70
|
-
/*#__PURE__*/ (0,
|
|
72
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
71
73
|
"aria-label": `delete threshold ${label}`,
|
|
72
74
|
size: "small",
|
|
73
75
|
onClick: onDelete,
|
|
74
|
-
children: /*#__PURE__*/ (0,
|
|
76
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DeleteOutline.default, {})
|
|
75
77
|
})
|
|
76
78
|
]
|
|
77
79
|
});
|
|
@@ -16,20 +16,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "ThresholdsEditor", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return ThresholdsEditor;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
22
|
-
const _react = /*#__PURE__*/
|
|
23
|
-
const _immer = /*#__PURE__*/
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
25
|
+
const _immer = /*#__PURE__*/ _interop_require_default(require("immer"));
|
|
24
26
|
const _material = require("@mui/material");
|
|
25
|
-
const
|
|
27
|
+
const _Plus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Plus"));
|
|
26
28
|
const _system = require("@mui/system");
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
function
|
|
29
|
+
const _ChartsProvider = require("../context/ChartsProvider");
|
|
30
|
+
const _OptionsEditorLayout = require("../OptionsEditorLayout");
|
|
31
|
+
const _InfoTooltip = require("../InfoTooltip");
|
|
32
|
+
const _ThresholdColorPicker = require("./ThresholdColorPicker");
|
|
33
|
+
const _ThresholdInput = require("./ThresholdInput");
|
|
34
|
+
function _interop_require_default(obj) {
|
|
33
35
|
return obj && obj.__esModule ? obj : {
|
|
34
36
|
default: obj
|
|
35
37
|
};
|
|
@@ -42,7 +44,7 @@ function _getRequireWildcardCache(nodeInterop) {
|
|
|
42
44
|
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
43
45
|
})(nodeInterop);
|
|
44
46
|
}
|
|
45
|
-
function
|
|
47
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
46
48
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
47
49
|
return obj;
|
|
48
50
|
}
|
|
@@ -75,9 +77,10 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
75
77
|
}
|
|
76
78
|
const DEFAULT_STEP = 10;
|
|
77
79
|
function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercentMode }) {
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
const chartsTheme = (0, _ChartsProvider.useChartsTheme)();
|
|
81
|
+
const { thresholds: { defaultColor , palette } } = chartsTheme;
|
|
82
|
+
var _thresholds_defaultColor;
|
|
83
|
+
const defaultThresholdColor = (_thresholds_defaultColor = thresholds === null || thresholds === void 0 ? void 0 : thresholds.defaultColor) !== null && _thresholds_defaultColor !== void 0 ? _thresholds_defaultColor : defaultColor;
|
|
81
84
|
const [steps, setSteps] = (0, _react.useState)(thresholds === null || thresholds === void 0 ? void 0 : thresholds.steps);
|
|
82
85
|
(0, _react.useEffect)(()=>{
|
|
83
86
|
setSteps(thresholds === null || thresholds === void 0 ? void 0 : thresholds.steps);
|
|
@@ -88,9 +91,9 @@ function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercent
|
|
|
88
91
|
const recentlyAddedInputRef = (0, _react.useRef)(null);
|
|
89
92
|
const focusRef = (0, _react.useRef)(false);
|
|
90
93
|
(0, _react.useEffect)(()=>{
|
|
91
|
-
var
|
|
94
|
+
var _recentlyAddedInputRef_current;
|
|
92
95
|
if (!recentlyAddedInputRef.current || !focusRef.current) return;
|
|
93
|
-
(
|
|
96
|
+
(_recentlyAddedInputRef_current = recentlyAddedInputRef.current) === null || _recentlyAddedInputRef_current === void 0 ? void 0 : _recentlyAddedInputRef_current.focus();
|
|
94
97
|
focusRef.current = false;
|
|
95
98
|
}, [
|
|
96
99
|
steps === null || steps === void 0 ? void 0 : steps.length
|
|
@@ -118,11 +121,11 @@ function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercent
|
|
|
118
121
|
const handleDefaultColorChange = (color)=>{
|
|
119
122
|
if (thresholds !== undefined) {
|
|
120
123
|
onChange((0, _immer.default)(thresholds, (draft)=>{
|
|
121
|
-
draft.
|
|
124
|
+
draft.defaultColor = color;
|
|
122
125
|
}));
|
|
123
126
|
} else {
|
|
124
127
|
onChange({
|
|
125
|
-
|
|
128
|
+
defaultColor: color
|
|
126
129
|
});
|
|
127
130
|
}
|
|
128
131
|
};
|
|
@@ -173,12 +176,12 @@ function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercent
|
|
|
173
176
|
const steps = draft.steps;
|
|
174
177
|
if (steps === null || steps === void 0 ? void 0 : steps.length) {
|
|
175
178
|
const lastStep = steps[steps.length - 1];
|
|
176
|
-
var
|
|
177
|
-
const color = (
|
|
178
|
-
var
|
|
179
|
+
var _palette_steps_length;
|
|
180
|
+
const color = (_palette_steps_length = palette[steps.length]) !== null && _palette_steps_length !== void 0 ? _palette_steps_length : getRandomColor(); // we will assign color from the palette first, then generate random color
|
|
181
|
+
var _lastStep_value;
|
|
179
182
|
steps.push({
|
|
180
183
|
color,
|
|
181
|
-
value: ((
|
|
184
|
+
value: ((_lastStep_value = lastStep === null || lastStep === void 0 ? void 0 : lastStep.value) !== null && _lastStep_value !== void 0 ? _lastStep_value : 0) + DEFAULT_STEP
|
|
182
185
|
}); // set new threshold value to last step value + 10
|
|
183
186
|
} else if (steps) {
|
|
184
187
|
steps.push({
|
|
@@ -189,7 +192,7 @@ function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercent
|
|
|
189
192
|
}
|
|
190
193
|
};
|
|
191
194
|
const handleModeChange = (event, value)=>{
|
|
192
|
-
const mode = value === '
|
|
195
|
+
const mode = value === 'percent' ? 'percent' : undefined;
|
|
193
196
|
if (thresholds !== undefined) {
|
|
194
197
|
onChange((0, _immer.default)(thresholds, (draft)=>{
|
|
195
198
|
draft.mode = mode;
|
|
@@ -200,43 +203,43 @@ function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercent
|
|
|
200
203
|
});
|
|
201
204
|
}
|
|
202
205
|
};
|
|
203
|
-
var
|
|
204
|
-
return /*#__PURE__*/ (0,
|
|
206
|
+
var _thresholds_mode, _step_color, _ref;
|
|
207
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_OptionsEditorLayout.OptionsEditorGroup, {
|
|
205
208
|
title: "Thresholds",
|
|
206
|
-
icon: /*#__PURE__*/ (0,
|
|
209
|
+
icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_InfoTooltip.InfoTooltip, {
|
|
207
210
|
description: 'Add threshold',
|
|
208
|
-
children: /*#__PURE__*/ (0,
|
|
211
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
209
212
|
size: "small",
|
|
210
213
|
"aria-label": "add threshold",
|
|
211
214
|
onClick: addThresholdInput,
|
|
212
|
-
children: /*#__PURE__*/ (0,
|
|
215
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Plus.default, {})
|
|
213
216
|
})
|
|
214
217
|
}),
|
|
215
218
|
children: [
|
|
216
|
-
/*#__PURE__*/ (0,
|
|
219
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_OptionsEditorLayout.OptionsEditorControl, {
|
|
217
220
|
label: "Mode",
|
|
218
221
|
description: "Percentage means thresholds relative to min & max",
|
|
219
|
-
control: /*#__PURE__*/ (0,
|
|
222
|
+
control: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.ToggleButtonGroup, {
|
|
220
223
|
exclusive: true,
|
|
221
224
|
disabled: disablePercentMode,
|
|
222
|
-
value: (
|
|
225
|
+
value: (_thresholds_mode = thresholds === null || thresholds === void 0 ? void 0 : thresholds.mode) !== null && _thresholds_mode !== void 0 ? _thresholds_mode : 'absolute',
|
|
223
226
|
onChange: handleModeChange,
|
|
224
227
|
sx: {
|
|
225
228
|
height: '36px',
|
|
226
229
|
marginLeft: 'auto'
|
|
227
230
|
},
|
|
228
231
|
children: [
|
|
229
|
-
/*#__PURE__*/ (0,
|
|
232
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ToggleButton, {
|
|
230
233
|
"aria-label": "absolute",
|
|
231
|
-
value: "
|
|
234
|
+
value: "absolute",
|
|
232
235
|
sx: {
|
|
233
236
|
fontWeight: 500
|
|
234
237
|
},
|
|
235
238
|
children: "Absolute"
|
|
236
239
|
}),
|
|
237
|
-
/*#__PURE__*/ (0,
|
|
240
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ToggleButton, {
|
|
238
241
|
"aria-label": "percent",
|
|
239
|
-
value: "
|
|
242
|
+
value: "percent",
|
|
240
243
|
sx: {
|
|
241
244
|
fontWeight: 500
|
|
242
245
|
},
|
|
@@ -246,10 +249,10 @@ function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercent
|
|
|
246
249
|
})
|
|
247
250
|
}),
|
|
248
251
|
steps && steps.map((step, i)=>{
|
|
249
|
-
/*#__PURE__*/ return (0,
|
|
252
|
+
/*#__PURE__*/ return (0, _jsxruntime.jsx)(_ThresholdInput.ThresholdInput, {
|
|
250
253
|
inputRef: i === steps.length - 1 ? recentlyAddedInputRef : undefined,
|
|
251
254
|
label: `T${i + 1}`,
|
|
252
|
-
color: (
|
|
255
|
+
color: (_ref = (_step_color = step.color) !== null && _step_color !== void 0 ? _step_color : palette[i]) !== null && _ref !== void 0 ? _ref : defaultThresholdColor,
|
|
253
256
|
value: step.value,
|
|
254
257
|
mode: thresholds === null || thresholds === void 0 ? void 0 : thresholds.mode,
|
|
255
258
|
onColorChange: (color)=>handleThresholdColorChange(color, i),
|
|
@@ -262,18 +265,18 @@ function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercent
|
|
|
262
265
|
onBlur: handleThresholdBlur
|
|
263
266
|
}, i);
|
|
264
267
|
}).reverse(),
|
|
265
|
-
!hideDefault && /*#__PURE__*/ (0,
|
|
268
|
+
!hideDefault && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_system.Stack, {
|
|
266
269
|
flex: 1,
|
|
267
270
|
direction: "row",
|
|
268
271
|
alignItems: "center",
|
|
269
272
|
spacing: 1,
|
|
270
273
|
children: [
|
|
271
|
-
/*#__PURE__*/ (0,
|
|
274
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_ThresholdColorPicker.ThresholdColorPicker, {
|
|
272
275
|
label: "default",
|
|
273
276
|
color: defaultThresholdColor,
|
|
274
277
|
onColorChange: handleDefaultColorChange
|
|
275
278
|
}),
|
|
276
|
-
/*#__PURE__*/ (0,
|
|
279
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
277
280
|
children: "Default"
|
|
278
281
|
})
|
|
279
282
|
]
|
|
@@ -14,15 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
function
|
|
17
|
+
_export_star(require("./ThresholdsEditor"), exports);
|
|
18
|
+
function _export_star(from, to) {
|
|
19
19
|
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
+
Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
26
28
|
});
|
|
27
29
|
return from;
|
|
28
30
|
}
|