@perses-dev/components 0.39.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 +8 -8
- 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 +11 -11
- 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 +12 -12
- 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 +7 -7
- package/dist/StatChart/StatChart.js.map +1 -1
- package/dist/StatChart/calculateFontSize.js +4 -4
- 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 +1 -1
- 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.js +17 -17
- package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
- package/dist/ThresholdsEditor/index.js.map +1 -1
- package/dist/TimeChart/TimeChart.d.ts +2 -2
- package/dist/TimeChart/TimeChart.d.ts.map +1 -1
- package/dist/TimeChart/TimeChart.js +12 -12
- package/dist/TimeChart/TimeChart.js.map +1 -1
- package/dist/TimeChart/index.js.map +1 -1
- package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts +2 -2
- package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/LineChartTooltip.js +7 -7
- 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 +2 -2
- package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js +4 -4
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.js +6 -6
- 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 +29 -29
- package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
- 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 +17 -15
- 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 +24 -22
- 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 +9 -7
- 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 -42
- package/dist/cjs/ThresholdsEditor/index.js +10 -8
- package/dist/cjs/TimeChart/TimeChart.js +31 -29
- package/dist/cjs/TimeChart/index.js +10 -8
- package/dist/cjs/TimeSeriesTooltip/LineChartTooltip.js +28 -26
- 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 +22 -20
- package/dist/cjs/TimeSeriesTooltip/TooltipContent.js +7 -5
- package/dist/cjs/TimeSeriesTooltip/TooltipHeader.js +34 -32
- package/dist/cjs/TimeSeriesTooltip/index.js +19 -17
- package/dist/cjs/TimeSeriesTooltip/nearby-series.js +56 -38
- package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +51 -17
- package/dist/cjs/TimeSeriesTooltip/utils.js +17 -13
- package/dist/cjs/YAxisLabel.js +6 -4
- package/dist/cjs/context/ChartsProvider.js +16 -8
- package/dist/cjs/context/SnackbarProvider.js +6 -2
- package/dist/cjs/context/TimeZoneProvider.js +13 -7
- package/dist/cjs/context/index.js +12 -10
- package/dist/cjs/index.js +41 -39
- 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 +6 -2
- 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 +8 -4
- package/dist/cjs/utils/chart-actions.js +26 -10
- 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.js.map +1 -1
- package/dist/context/SnackbarProvider.js.map +1 -1
- package/dist/context/TimeZoneProvider.js.map +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- 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.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 +2 -2
- package/dist/utils/axis.d.ts.map +1 -1
- package/dist/utils/axis.js.map +1 -1
- package/dist/utils/chart-actions.js +2 -2
- 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
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "useVirtualizedTableKeyboardNav", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return useVirtualizedTableKeyboardNav;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const _useTableKeyboardNav = require("./useTableKeyboardNav");
|
|
22
24
|
function useVirtualizedTableKeyboardNav({ visibleRange , virtualTable , maxRows , maxColumns }) {
|
|
@@ -26,14 +28,14 @@ function useVirtualizedTableKeyboardNav({ visibleRange , virtualTable , maxRows
|
|
|
26
28
|
onActiveCellChange: (e, currentPosition, defaultNewPosition)=>{
|
|
27
29
|
const key = e.key;
|
|
28
30
|
const defaultValueChanged = defaultNewPosition && (currentPosition.column !== defaultNewPosition.column || currentPosition.row !== defaultNewPosition.row);
|
|
29
|
-
var
|
|
30
|
-
const nextRow = (
|
|
31
|
+
var _defaultNewPosition_row;
|
|
32
|
+
const nextRow = (_defaultNewPosition_row = defaultNewPosition === null || defaultNewPosition === void 0 ? void 0 : defaultNewPosition.row) !== null && _defaultNewPosition_row !== void 0 ? _defaultNewPosition_row : currentPosition.row;
|
|
31
33
|
if (key === 'ArrowDown' && defaultValueChanged) {
|
|
32
34
|
// Use default cell position. Shift the virtual table scroll position
|
|
33
35
|
// when needed to make the active cell visible.
|
|
34
36
|
if (nextRow - 1 < visibleRange.current.startIndex || nextRow - 1 > visibleRange.current.endIndex) {
|
|
35
|
-
var
|
|
36
|
-
(
|
|
37
|
+
var _virtualTable_current;
|
|
38
|
+
(_virtualTable_current = virtualTable.current) === null || _virtualTable_current === void 0 ? void 0 : _virtualTable_current.scrollToIndex({
|
|
37
39
|
index: nextRow - 1,
|
|
38
40
|
align: 'end'
|
|
39
41
|
});
|
|
@@ -42,8 +44,8 @@ function useVirtualizedTableKeyboardNav({ visibleRange , virtualTable , maxRows
|
|
|
42
44
|
// Use default cell position. Shift the virtual table scroll position
|
|
43
45
|
// when needed to make the active cell visible.
|
|
44
46
|
if (nextRow - 1 < visibleRange.current.startIndex || nextRow - 1 > visibleRange.current.endIndex) {
|
|
45
|
-
var
|
|
46
|
-
(
|
|
47
|
+
var _virtualTable_current1;
|
|
48
|
+
(_virtualTable_current1 = virtualTable.current) === null || _virtualTable_current1 === void 0 ? void 0 : _virtualTable_current1.scrollToIndex({
|
|
47
49
|
index: nextRow - 1,
|
|
48
50
|
align: 'start'
|
|
49
51
|
});
|
|
@@ -51,38 +53,38 @@ function useVirtualizedTableKeyboardNav({ visibleRange , virtualTable , maxRows
|
|
|
51
53
|
} else if (defaultValueChanged && (key === 'Home' || key === 'End')) {
|
|
52
54
|
var // Use default cell position. Shift the virtual table scroll position
|
|
53
55
|
// when needed to make the active cell visible.
|
|
54
|
-
|
|
55
|
-
(
|
|
56
|
+
_virtualTable_current2;
|
|
57
|
+
(_virtualTable_current2 = virtualTable.current) === null || _virtualTable_current2 === void 0 ? void 0 : _virtualTable_current2.scrollToIndex({
|
|
56
58
|
index: Math.max(nextRow - 1, 0),
|
|
57
59
|
align: 'start'
|
|
58
60
|
});
|
|
59
61
|
} else if (key === 'PageDown') {
|
|
60
|
-
var
|
|
62
|
+
var _virtualTable_current3;
|
|
61
63
|
// Full handling of logic for `PageDown` because there is no default.
|
|
62
64
|
e.preventDefault();
|
|
63
|
-
let
|
|
65
|
+
let nextRow = currentPosition.row;
|
|
64
66
|
// Add 1 to account for header
|
|
65
|
-
|
|
66
|
-
(
|
|
67
|
-
index:
|
|
67
|
+
nextRow = Math.min(maxRows - 1, visibleRange.current.endIndex + 1);
|
|
68
|
+
(_virtualTable_current3 = virtualTable.current) === null || _virtualTable_current3 === void 0 ? void 0 : _virtualTable_current3.scrollToIndex({
|
|
69
|
+
index: nextRow - 1,
|
|
68
70
|
align: 'start'
|
|
69
71
|
});
|
|
70
72
|
return {
|
|
71
|
-
row:
|
|
73
|
+
row: nextRow,
|
|
72
74
|
column: currentPosition.column
|
|
73
75
|
};
|
|
74
76
|
} else if (key === 'PageUp') {
|
|
75
|
-
var
|
|
77
|
+
var _virtualTable_current4;
|
|
76
78
|
// Full handling of logic for `PageUp` because there is no default.
|
|
77
|
-
let
|
|
79
|
+
let nextRow = currentPosition.row;
|
|
78
80
|
// Minus 1 to account for header
|
|
79
|
-
|
|
80
|
-
(
|
|
81
|
-
index:
|
|
81
|
+
nextRow = Math.max(0, visibleRange.current.startIndex - 1);
|
|
82
|
+
(_virtualTable_current4 = virtualTable.current) === null || _virtualTable_current4 === void 0 ? void 0 : _virtualTable_current4.scrollToIndex({
|
|
83
|
+
index: nextRow - 1,
|
|
82
84
|
align: 'end'
|
|
83
85
|
});
|
|
84
86
|
return {
|
|
85
|
-
row:
|
|
87
|
+
row: nextRow,
|
|
86
88
|
column: currentPosition.column
|
|
87
89
|
};
|
|
88
90
|
}
|
package/dist/cjs/Table/index.js
CHANGED
|
@@ -16,18 +16,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "getTableCellLayout", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return _tablemodel.getTableCellLayout;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
function
|
|
23
|
+
_export_star(require("./Table"), exports);
|
|
24
|
+
const _tablemodel = require("./model/table-model");
|
|
25
|
+
function _export_star(from, to) {
|
|
24
26
|
Object.keys(from).forEach(function(k) {
|
|
25
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
28
|
+
Object.defineProperty(to, k, {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function() {
|
|
31
|
+
return from[k];
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
31
35
|
});
|
|
32
36
|
return from;
|
|
33
37
|
}
|
|
@@ -21,8 +21,12 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
getTableCellLayout: ()
|
|
25
|
-
|
|
24
|
+
getTableCellLayout: function() {
|
|
25
|
+
return getTableCellLayout;
|
|
26
|
+
},
|
|
27
|
+
persesColumnsToTanstackColumns: function() {
|
|
28
|
+
return persesColumnsToTanstackColumns;
|
|
29
|
+
}
|
|
26
30
|
});
|
|
27
31
|
function calculateTableCellHeight(lineHeight, paddingY) {
|
|
28
32
|
// Doing a bunch of math to enforce height to avoid weirdness with mismatched
|
|
@@ -47,17 +51,17 @@ function getTableCellLayout(theme, density, { isLastColumn , isFirstColumn } =
|
|
|
47
51
|
};
|
|
48
52
|
}
|
|
49
53
|
// standard density
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const
|
|
54
|
+
const paddingY = theme.spacing(1);
|
|
55
|
+
const basePaddingX = theme.spacing(1.25);
|
|
56
|
+
const edgePaddingX = theme.spacing(2);
|
|
57
|
+
const paddingLeft = isFirstColumn ? edgePaddingX : basePaddingX;
|
|
58
|
+
const paddingRight = isLastColumn ? edgePaddingX : basePaddingX;
|
|
59
|
+
const lineHeight = theme.typography.body1.lineHeight;
|
|
56
60
|
return {
|
|
57
|
-
padding: `${
|
|
58
|
-
height: calculateTableCellHeight(
|
|
61
|
+
padding: `${paddingY} ${paddingRight} ${paddingY} ${paddingLeft}`,
|
|
62
|
+
height: calculateTableCellHeight(lineHeight, paddingY),
|
|
59
63
|
fontSize: theme.typography.body1.fontSize,
|
|
60
|
-
lineHeight:
|
|
64
|
+
lineHeight: lineHeight
|
|
61
65
|
};
|
|
62
66
|
}
|
|
63
67
|
function persesColumnsToTanstackColumns(columns) {
|
|
@@ -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,10 +77,10 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
75
77
|
}
|
|
76
78
|
const DEFAULT_STEP = 10;
|
|
77
79
|
function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercentMode }) {
|
|
78
|
-
const chartsTheme = (0,
|
|
79
|
-
const { thresholds: { defaultColor , palette }
|
|
80
|
-
var
|
|
81
|
-
const defaultThresholdColor = (
|
|
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;
|
|
82
84
|
const [steps, setSteps] = (0, _react.useState)(thresholds === null || thresholds === void 0 ? void 0 : thresholds.steps);
|
|
83
85
|
(0, _react.useEffect)(()=>{
|
|
84
86
|
setSteps(thresholds === null || thresholds === void 0 ? void 0 : thresholds.steps);
|
|
@@ -89,9 +91,9 @@ function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercent
|
|
|
89
91
|
const recentlyAddedInputRef = (0, _react.useRef)(null);
|
|
90
92
|
const focusRef = (0, _react.useRef)(false);
|
|
91
93
|
(0, _react.useEffect)(()=>{
|
|
92
|
-
var
|
|
94
|
+
var _recentlyAddedInputRef_current;
|
|
93
95
|
if (!recentlyAddedInputRef.current || !focusRef.current) return;
|
|
94
|
-
(
|
|
96
|
+
(_recentlyAddedInputRef_current = recentlyAddedInputRef.current) === null || _recentlyAddedInputRef_current === void 0 ? void 0 : _recentlyAddedInputRef_current.focus();
|
|
95
97
|
focusRef.current = false;
|
|
96
98
|
}, [
|
|
97
99
|
steps === null || steps === void 0 ? void 0 : steps.length
|
|
@@ -119,11 +121,11 @@ function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercent
|
|
|
119
121
|
const handleDefaultColorChange = (color)=>{
|
|
120
122
|
if (thresholds !== undefined) {
|
|
121
123
|
onChange((0, _immer.default)(thresholds, (draft)=>{
|
|
122
|
-
draft.
|
|
124
|
+
draft.defaultColor = color;
|
|
123
125
|
}));
|
|
124
126
|
} else {
|
|
125
127
|
onChange({
|
|
126
|
-
|
|
128
|
+
defaultColor: color
|
|
127
129
|
});
|
|
128
130
|
}
|
|
129
131
|
};
|
|
@@ -174,12 +176,12 @@ function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercent
|
|
|
174
176
|
const steps = draft.steps;
|
|
175
177
|
if (steps === null || steps === void 0 ? void 0 : steps.length) {
|
|
176
178
|
const lastStep = steps[steps.length - 1];
|
|
177
|
-
var
|
|
178
|
-
const color = (
|
|
179
|
-
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;
|
|
180
182
|
steps.push({
|
|
181
183
|
color,
|
|
182
|
-
value: ((
|
|
184
|
+
value: ((_lastStep_value = lastStep === null || lastStep === void 0 ? void 0 : lastStep.value) !== null && _lastStep_value !== void 0 ? _lastStep_value : 0) + DEFAULT_STEP
|
|
183
185
|
}); // set new threshold value to last step value + 10
|
|
184
186
|
} else if (steps) {
|
|
185
187
|
steps.push({
|
|
@@ -190,7 +192,7 @@ function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercent
|
|
|
190
192
|
}
|
|
191
193
|
};
|
|
192
194
|
const handleModeChange = (event, value)=>{
|
|
193
|
-
const mode = value === '
|
|
195
|
+
const mode = value === 'percent' ? 'percent' : undefined;
|
|
194
196
|
if (thresholds !== undefined) {
|
|
195
197
|
onChange((0, _immer.default)(thresholds, (draft)=>{
|
|
196
198
|
draft.mode = mode;
|
|
@@ -201,43 +203,43 @@ function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercent
|
|
|
201
203
|
});
|
|
202
204
|
}
|
|
203
205
|
};
|
|
204
|
-
var
|
|
205
|
-
return /*#__PURE__*/ (0,
|
|
206
|
+
var _thresholds_mode, _step_color, _ref;
|
|
207
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_OptionsEditorLayout.OptionsEditorGroup, {
|
|
206
208
|
title: "Thresholds",
|
|
207
|
-
icon: /*#__PURE__*/ (0,
|
|
209
|
+
icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_InfoTooltip.InfoTooltip, {
|
|
208
210
|
description: 'Add threshold',
|
|
209
|
-
children: /*#__PURE__*/ (0,
|
|
211
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
210
212
|
size: "small",
|
|
211
213
|
"aria-label": "add threshold",
|
|
212
214
|
onClick: addThresholdInput,
|
|
213
|
-
children: /*#__PURE__*/ (0,
|
|
215
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Plus.default, {})
|
|
214
216
|
})
|
|
215
217
|
}),
|
|
216
218
|
children: [
|
|
217
|
-
/*#__PURE__*/ (0,
|
|
219
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_OptionsEditorLayout.OptionsEditorControl, {
|
|
218
220
|
label: "Mode",
|
|
219
221
|
description: "Percentage means thresholds relative to min & max",
|
|
220
|
-
control: /*#__PURE__*/ (0,
|
|
222
|
+
control: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.ToggleButtonGroup, {
|
|
221
223
|
exclusive: true,
|
|
222
224
|
disabled: disablePercentMode,
|
|
223
|
-
value: (
|
|
225
|
+
value: (_thresholds_mode = thresholds === null || thresholds === void 0 ? void 0 : thresholds.mode) !== null && _thresholds_mode !== void 0 ? _thresholds_mode : 'absolute',
|
|
224
226
|
onChange: handleModeChange,
|
|
225
227
|
sx: {
|
|
226
228
|
height: '36px',
|
|
227
229
|
marginLeft: 'auto'
|
|
228
230
|
},
|
|
229
231
|
children: [
|
|
230
|
-
/*#__PURE__*/ (0,
|
|
232
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ToggleButton, {
|
|
231
233
|
"aria-label": "absolute",
|
|
232
|
-
value: "
|
|
234
|
+
value: "absolute",
|
|
233
235
|
sx: {
|
|
234
236
|
fontWeight: 500
|
|
235
237
|
},
|
|
236
238
|
children: "Absolute"
|
|
237
239
|
}),
|
|
238
|
-
/*#__PURE__*/ (0,
|
|
240
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ToggleButton, {
|
|
239
241
|
"aria-label": "percent",
|
|
240
|
-
value: "
|
|
242
|
+
value: "percent",
|
|
241
243
|
sx: {
|
|
242
244
|
fontWeight: 500
|
|
243
245
|
},
|
|
@@ -247,10 +249,10 @@ function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercent
|
|
|
247
249
|
})
|
|
248
250
|
}),
|
|
249
251
|
steps && steps.map((step, i)=>{
|
|
250
|
-
/*#__PURE__*/ return (0,
|
|
252
|
+
/*#__PURE__*/ return (0, _jsxruntime.jsx)(_ThresholdInput.ThresholdInput, {
|
|
251
253
|
inputRef: i === steps.length - 1 ? recentlyAddedInputRef : undefined,
|
|
252
254
|
label: `T${i + 1}`,
|
|
253
|
-
color: (
|
|
255
|
+
color: (_ref = (_step_color = step.color) !== null && _step_color !== void 0 ? _step_color : palette[i]) !== null && _ref !== void 0 ? _ref : defaultThresholdColor,
|
|
254
256
|
value: step.value,
|
|
255
257
|
mode: thresholds === null || thresholds === void 0 ? void 0 : thresholds.mode,
|
|
256
258
|
onColorChange: (color)=>handleThresholdColorChange(color, i),
|
|
@@ -263,18 +265,18 @@ function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercent
|
|
|
263
265
|
onBlur: handleThresholdBlur
|
|
264
266
|
}, i);
|
|
265
267
|
}).reverse(),
|
|
266
|
-
!hideDefault && /*#__PURE__*/ (0,
|
|
268
|
+
!hideDefault && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_system.Stack, {
|
|
267
269
|
flex: 1,
|
|
268
270
|
direction: "row",
|
|
269
271
|
alignItems: "center",
|
|
270
272
|
spacing: 1,
|
|
271
273
|
children: [
|
|
272
|
-
/*#__PURE__*/ (0,
|
|
274
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_ThresholdColorPicker.ThresholdColorPicker, {
|
|
273
275
|
label: "default",
|
|
274
276
|
color: defaultThresholdColor,
|
|
275
277
|
onColorChange: handleDefaultColorChange
|
|
276
278
|
}),
|
|
277
|
-
/*#__PURE__*/ (0,
|
|
279
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
278
280
|
children: "Default"
|
|
279
281
|
})
|
|
280
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
|
}
|