@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,14 +16,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "ColorPicker", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return ColorPicker;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _material = require("@mui/material");
|
|
23
|
-
const _react = /*#__PURE__*/
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
function
|
|
25
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
26
|
+
const _reactcolorful = require("react-colorful");
|
|
27
|
+
const _Circle = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Circle"));
|
|
28
|
+
function _interop_require_default(obj) {
|
|
27
29
|
return obj && obj.__esModule ? obj : {
|
|
28
30
|
default: obj
|
|
29
31
|
};
|
|
@@ -36,7 +38,7 @@ function _getRequireWildcardCache(nodeInterop) {
|
|
|
36
38
|
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
37
39
|
})(nodeInterop);
|
|
38
40
|
}
|
|
39
|
-
function
|
|
41
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
40
42
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
41
43
|
return obj;
|
|
42
44
|
}
|
|
@@ -83,29 +85,29 @@ const ColorPicker = ({ color , onChange , palette })=>{
|
|
|
83
85
|
onChange && onChange(e.target.value);
|
|
84
86
|
}
|
|
85
87
|
};
|
|
86
|
-
return /*#__PURE__*/ (0,
|
|
88
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
87
89
|
spacing: 1,
|
|
88
90
|
children: [
|
|
89
|
-
/*#__PURE__*/ (0,
|
|
91
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reactcolorful.HexColorPicker, {
|
|
90
92
|
color: color,
|
|
91
93
|
onChange: handleColorChange
|
|
92
94
|
}),
|
|
93
|
-
/*#__PURE__*/ (0,
|
|
95
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
94
96
|
direction: "row",
|
|
95
97
|
flexWrap: "wrap",
|
|
96
98
|
justifyContent: "space-evenly",
|
|
97
99
|
width: '200px',
|
|
98
|
-
children: palette && palette.map((color, i)=>/*#__PURE__*/ (0,
|
|
100
|
+
children: palette && palette.map((color, i)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
99
101
|
size: "small",
|
|
100
102
|
"aria-label": `change color to ${color}`,
|
|
101
103
|
sx: {
|
|
102
104
|
color
|
|
103
105
|
},
|
|
104
106
|
onClick: ()=>handleColorChange(color),
|
|
105
|
-
children: /*#__PURE__*/ (0,
|
|
107
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Circle.default, {})
|
|
106
108
|
}, i))
|
|
107
109
|
}),
|
|
108
|
-
/*#__PURE__*/ (0,
|
|
110
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
109
111
|
inputProps: {
|
|
110
112
|
'aria-label': 'enter hex color'
|
|
111
113
|
},
|
|
@@ -14,15 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
function
|
|
17
|
+
_export_star(require("./ColorPicker"), 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
|
}
|
|
@@ -16,22 +16,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "ContentWithLegend", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return ContentWithLegend;
|
|
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
26
|
const _core = require("@perses-dev/core");
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
function
|
|
27
|
+
const _Legend = require("../Legend");
|
|
28
|
+
const _contentwithlegendmodel = require("./model/content-with-legend-model");
|
|
29
|
+
function _interop_require_default(obj) {
|
|
28
30
|
return obj && obj.__esModule ? obj : {
|
|
29
31
|
default: obj
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
34
|
function ContentWithLegend({ children , legendProps , width , height , spacing =0 , legendSize , minChildrenWidth =100 , minChildrenHeight =100 }) {
|
|
33
35
|
const theme = (0, _material.useTheme)();
|
|
34
|
-
const { content , legend , margin } = (0,
|
|
36
|
+
const { content , legend , margin } = (0, _contentwithlegendmodel.getContentWithLegendLayout)({
|
|
35
37
|
width,
|
|
36
38
|
height,
|
|
37
39
|
legendProps,
|
|
@@ -41,7 +43,7 @@ function ContentWithLegend({ children , legendProps , width , height , spacing =
|
|
|
41
43
|
theme,
|
|
42
44
|
legendSize: (0, _core.getLegendSize)(legendSize)
|
|
43
45
|
});
|
|
44
|
-
return /*#__PURE__*/ (0,
|
|
46
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
45
47
|
sx: {
|
|
46
48
|
width,
|
|
47
49
|
height,
|
|
@@ -49,7 +51,7 @@ function ContentWithLegend({ children , legendProps , width , height , spacing =
|
|
|
49
51
|
overflow: 'hidden'
|
|
50
52
|
},
|
|
51
53
|
children: [
|
|
52
|
-
/*#__PURE__*/ (0,
|
|
54
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
53
55
|
sx: {
|
|
54
56
|
width: content.width,
|
|
55
57
|
height: content.height,
|
|
@@ -62,7 +64,7 @@ function ContentWithLegend({ children , legendProps , width , height , spacing =
|
|
|
62
64
|
height: content.height
|
|
63
65
|
}) : children
|
|
64
66
|
}),
|
|
65
|
-
legendProps && legend.show && /*#__PURE__*/ (0,
|
|
67
|
+
legendProps && legend.show && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Legend.Legend, {
|
|
66
68
|
...legendProps,
|
|
67
69
|
height: legend.height,
|
|
68
70
|
width: legend.width
|
|
@@ -14,15 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
function
|
|
17
|
+
_export_star(require("./ContentWithLegend"), 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
|
}
|
|
@@ -21,23 +21,27 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
TABLE_LEGEND_SIZE: ()
|
|
25
|
-
|
|
24
|
+
TABLE_LEGEND_SIZE: function() {
|
|
25
|
+
return TABLE_LEGEND_SIZE;
|
|
26
|
+
},
|
|
27
|
+
getContentWithLegendLayout: function() {
|
|
28
|
+
return getContentWithLegendLayout;
|
|
29
|
+
}
|
|
26
30
|
});
|
|
27
31
|
const _core = require("@perses-dev/core");
|
|
28
|
-
const
|
|
32
|
+
const _Table = require("../../Table");
|
|
29
33
|
const TABLE_LEGEND_SIZE = {
|
|
30
|
-
|
|
34
|
+
medium: {
|
|
31
35
|
// 5 rows plus header. Value to be multiplied by row height in pixels.
|
|
32
|
-
|
|
36
|
+
bottom: 6,
|
|
33
37
|
// Pixel value
|
|
34
|
-
|
|
38
|
+
right: 250
|
|
35
39
|
},
|
|
36
|
-
|
|
40
|
+
small: {
|
|
37
41
|
// 3 rows plus header. Value to be multiplied by row height in pixels.
|
|
38
|
-
|
|
42
|
+
bottom: 4,
|
|
39
43
|
// Pixel value
|
|
40
|
-
|
|
44
|
+
right: 150
|
|
41
45
|
}
|
|
42
46
|
};
|
|
43
47
|
const PANEL_HEIGHT_LG_BREAKPOINT = 300;
|
|
@@ -68,36 +72,36 @@ function getContentWithLegendLayout({ width , height , legendProps , legendSize
|
|
|
68
72
|
const mode = (0, _core.getLegendMode)(legendOptions.mode);
|
|
69
73
|
let legendWidth;
|
|
70
74
|
let legendHeight;
|
|
71
|
-
if (mode === '
|
|
75
|
+
if (mode === 'list') {
|
|
72
76
|
// TODO: normalize list to share similar height options as the table
|
|
73
77
|
// when we add more size options.
|
|
74
|
-
legendWidth = position === '
|
|
78
|
+
legendWidth = position === 'right' ? 200 : width;
|
|
75
79
|
// TODO: account for number of legend items returned when adjusting legend spacing
|
|
76
80
|
legendHeight = LEGEND_HEIGHT_SM;
|
|
77
|
-
if (position === '
|
|
81
|
+
if (position === 'right') {
|
|
78
82
|
legendHeight = height;
|
|
79
83
|
} else if (height >= PANEL_HEIGHT_LG_BREAKPOINT) {
|
|
80
84
|
legendHeight = LEGEND_HEIGHT_LG;
|
|
81
85
|
}
|
|
82
86
|
} else {
|
|
83
|
-
var
|
|
87
|
+
var _legendProps_tableProps;
|
|
84
88
|
// Table mode
|
|
85
|
-
const tableLayout = (0,
|
|
86
|
-
const tableColumns = (legendProps === null || legendProps === void 0 ? void 0 : (
|
|
89
|
+
const tableLayout = (0, _Table.getTableCellLayout)(theme, 'compact');
|
|
90
|
+
const tableColumns = (legendProps === null || legendProps === void 0 ? void 0 : (_legendProps_tableProps = legendProps.tableProps) === null || _legendProps_tableProps === void 0 ? void 0 : _legendProps_tableProps.columns) || [];
|
|
87
91
|
const columnsWidth = tableColumns.reduce((total, col)=>{
|
|
88
92
|
if (typeof col.width === 'number') {
|
|
89
93
|
total += col.width;
|
|
90
94
|
}
|
|
91
95
|
return total;
|
|
92
96
|
}, 0);
|
|
93
|
-
legendWidth = position === '
|
|
97
|
+
legendWidth = position === 'right' ? TABLE_LEGEND_SIZE[legendSize]['right'] + columnsWidth : width;
|
|
94
98
|
// Use the smaller of the size-based row count or the number of legend items + 1 for the header.
|
|
95
|
-
const rowsToShow = Math.min(TABLE_LEGEND_SIZE[legendSize]['
|
|
96
|
-
legendHeight = position === '
|
|
99
|
+
const rowsToShow = Math.min(TABLE_LEGEND_SIZE[legendSize]['bottom'], legendProps.data.length + 1);
|
|
100
|
+
legendHeight = position === 'bottom' ? rowsToShow * tableLayout.height : height;
|
|
97
101
|
}
|
|
98
|
-
const contentWidth = position === '
|
|
99
|
-
const contentHeight = position === '
|
|
100
|
-
if (position === '
|
|
102
|
+
const contentWidth = position === 'right' ? width - legendWidth - spacing : width;
|
|
103
|
+
const contentHeight = position === 'bottom' ? height - legendHeight - spacing : height;
|
|
104
|
+
if (position === 'right' && contentWidth < minChildrenWidth || position === 'bottom' && contentHeight < minChildrenHeight) {
|
|
101
105
|
// Legend does not fit. Just show the content.
|
|
102
106
|
return noLegendLayout;
|
|
103
107
|
}
|
|
@@ -112,8 +116,8 @@ function getContentWithLegendLayout({ width , height , legendProps , legendSize
|
|
|
112
116
|
height: contentHeight
|
|
113
117
|
},
|
|
114
118
|
margin: {
|
|
115
|
-
right: position === '
|
|
116
|
-
bottom: position === '
|
|
119
|
+
right: position === 'right' ? spacing : 0,
|
|
120
|
+
bottom: position === 'bottom' ? spacing : 0
|
|
117
121
|
}
|
|
118
122
|
};
|
|
119
123
|
}
|
|
@@ -16,18 +16,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "AbsoluteTimePicker", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return AbsoluteTimePicker;
|
|
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
|
-
const
|
|
26
|
+
const _xdatepickers = require("@mui/x-date-pickers");
|
|
27
|
+
const _AdapterDateFns = require("@mui/x-date-pickers/AdapterDateFns");
|
|
28
|
+
const _TimeZoneProvider = require("../context/TimeZoneProvider");
|
|
27
29
|
const _utils = require("./utils");
|
|
28
30
|
const DATE_TIME_FORMAT = 'yyyy-MM-dd HH:mm:ss';
|
|
29
31
|
const AbsoluteTimePicker = ({ initialTimeRange , onChange , onCancel })=>{
|
|
30
|
-
const { formatWithUserTimeZone } = (0,
|
|
32
|
+
const { formatWithUserTimeZone } = (0, _TimeZoneProvider.useTimeZone)();
|
|
31
33
|
// Time range values as dates that can be used as a time range.
|
|
32
34
|
const [timeRange, setTimeRange] = (0, _react.useState)(initialTimeRange);
|
|
33
35
|
// Time range values as strings used to populate the text inputs. May not
|
|
@@ -82,34 +84,29 @@ const AbsoluteTimePicker = ({ initialTimeRange , onChange , onCancel })=>{
|
|
|
82
84
|
onChange(newDates);
|
|
83
85
|
}
|
|
84
86
|
};
|
|
85
|
-
return /*#__PURE__*/ (0,
|
|
86
|
-
dateAdapter:
|
|
87
|
-
children: /*#__PURE__*/ (0,
|
|
87
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_xdatepickers.LocalizationProvider, {
|
|
88
|
+
dateAdapter: _AdapterDateFns.AdapterDateFns,
|
|
89
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
88
90
|
spacing: 2,
|
|
89
91
|
sx: (theme)=>({
|
|
90
92
|
padding: theme.spacing(1, 0, 2)
|
|
91
93
|
}),
|
|
92
94
|
children: [
|
|
93
|
-
showStartCalendar && /*#__PURE__*/ (0,
|
|
95
|
+
showStartCalendar && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
94
96
|
sx: (theme)=>({
|
|
95
97
|
// TODO: create separate reusable calendar component
|
|
96
|
-
'.
|
|
98
|
+
'.MuiPickersLayout-contentWrapper': {
|
|
97
99
|
backgroundColor: theme.palette.background.default
|
|
98
|
-
},
|
|
99
|
-
// reposition AM and PM buttons
|
|
100
|
-
'.MuiIconButton-sizeMedium': {
|
|
101
|
-
top: 80,
|
|
102
|
-
bottom: 'auto',
|
|
103
|
-
margin: theme.spacing(0, 3)
|
|
104
100
|
}
|
|
105
101
|
}),
|
|
106
102
|
children: [
|
|
107
|
-
/*#__PURE__*/ (0,
|
|
103
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
108
104
|
variant: "h3",
|
|
109
105
|
padding: 1,
|
|
106
|
+
paddingLeft: 2,
|
|
110
107
|
children: "Select Start Time"
|
|
111
108
|
}),
|
|
112
|
-
/*#__PURE__*/ (0,
|
|
109
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_xdatepickers.StaticDateTimePicker, {
|
|
113
110
|
displayStaticWrapperAs: "desktop",
|
|
114
111
|
openTo: "day",
|
|
115
112
|
disableHighlightToday: true,
|
|
@@ -120,32 +117,24 @@ const AbsoluteTimePicker = ({ initialTimeRange , onChange , onCancel })=>{
|
|
|
120
117
|
},
|
|
121
118
|
onAccept: ()=>{
|
|
122
119
|
setShowStartCalendar(false);
|
|
123
|
-
}
|
|
124
|
-
renderInput: (params)=>/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.TextField, {
|
|
125
|
-
...params
|
|
126
|
-
})
|
|
120
|
+
}
|
|
127
121
|
})
|
|
128
122
|
]
|
|
129
123
|
}),
|
|
130
|
-
!showStartCalendar && /*#__PURE__*/ (0,
|
|
124
|
+
!showStartCalendar && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
131
125
|
sx: (theme)=>({
|
|
132
|
-
'.
|
|
126
|
+
'.MuiPickersLayout-contentWrapper': {
|
|
133
127
|
backgroundColor: theme.palette.background.default
|
|
134
|
-
},
|
|
135
|
-
// reposition AM and PM buttons
|
|
136
|
-
'.MuiIconButton-sizeMedium': {
|
|
137
|
-
top: 80,
|
|
138
|
-
bottom: 'auto',
|
|
139
|
-
margin: theme.spacing(0, 3)
|
|
140
128
|
}
|
|
141
129
|
}),
|
|
142
130
|
children: [
|
|
143
|
-
/*#__PURE__*/ (0,
|
|
131
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
144
132
|
variant: "h3",
|
|
145
133
|
padding: 1,
|
|
134
|
+
paddingLeft: 2,
|
|
146
135
|
children: "Select End Time"
|
|
147
136
|
}),
|
|
148
|
-
/*#__PURE__*/ (0,
|
|
137
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_xdatepickers.StaticDateTimePicker, {
|
|
149
138
|
displayStaticWrapperAs: "desktop",
|
|
150
139
|
openTo: "day",
|
|
151
140
|
disableHighlightToday: true,
|
|
@@ -159,21 +148,18 @@ const AbsoluteTimePicker = ({ initialTimeRange , onChange , onCancel })=>{
|
|
|
159
148
|
if (newValue === null) return;
|
|
160
149
|
setShowStartCalendar(true);
|
|
161
150
|
onChangeEndTime(newValue);
|
|
162
|
-
}
|
|
163
|
-
renderInput: (params)=>/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.TextField, {
|
|
164
|
-
...params
|
|
165
|
-
})
|
|
151
|
+
}
|
|
166
152
|
})
|
|
167
153
|
]
|
|
168
154
|
}),
|
|
169
|
-
/*#__PURE__*/ (0,
|
|
155
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
170
156
|
direction: "row",
|
|
171
157
|
alignItems: "center",
|
|
172
158
|
gap: 1,
|
|
173
159
|
pl: 1,
|
|
174
160
|
pr: 1,
|
|
175
161
|
children: [
|
|
176
|
-
/*#__PURE__*/ (0,
|
|
162
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
177
163
|
onChange: (event)=>{
|
|
178
164
|
// TODO: add helperText, fix validation after we decide on form state solution
|
|
179
165
|
onChangeStartTime(event.target.value);
|
|
@@ -185,7 +171,7 @@ const AbsoluteTimePicker = ({ initialTimeRange , onChange , onCancel })=>{
|
|
|
185
171
|
// tel used to match MUI DateTimePicker, may change in future: https://github.com/mui/material-ui/issues/27590
|
|
186
172
|
type: "tel"
|
|
187
173
|
}),
|
|
188
|
-
/*#__PURE__*/ (0,
|
|
174
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
189
175
|
onChange: (event)=>{
|
|
190
176
|
onChangeEndTime(event.target.value);
|
|
191
177
|
},
|
|
@@ -197,20 +183,20 @@ const AbsoluteTimePicker = ({ initialTimeRange , onChange , onCancel })=>{
|
|
|
197
183
|
})
|
|
198
184
|
]
|
|
199
185
|
}),
|
|
200
|
-
/*#__PURE__*/ (0,
|
|
186
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
201
187
|
direction: "row",
|
|
202
188
|
sx: {
|
|
203
189
|
padding: (theme)=>theme.spacing(0, 1)
|
|
204
190
|
},
|
|
205
191
|
gap: 1,
|
|
206
192
|
children: [
|
|
207
|
-
/*#__PURE__*/ (0,
|
|
193
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
208
194
|
variant: "contained",
|
|
209
195
|
onClick: ()=>onApply(),
|
|
210
196
|
fullWidth: true,
|
|
211
197
|
children: "Apply"
|
|
212
198
|
}),
|
|
213
|
-
/*#__PURE__*/ (0,
|
|
199
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
214
200
|
variant: "outlined",
|
|
215
201
|
onClick: ()=>onCancel(),
|
|
216
202
|
fullWidth: true,
|
|
@@ -16,14 +16,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "DateTimeRangePicker", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return DateTimeRangePicker;
|
|
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
26
|
const _core = require("@perses-dev/core");
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
+
const _AbsoluteTimePicker = require("./AbsoluteTimePicker");
|
|
28
|
+
const _TimeRangeSelector = require("./TimeRangeSelector");
|
|
27
29
|
function DateTimeRangePicker(props) {
|
|
28
30
|
const { value , onChange , timeOptions , height } = props;
|
|
29
31
|
const [showCustomDateSelector, setShowCustomDateSelector] = (0, _react.useState)(false);
|
|
@@ -33,12 +35,12 @@ function DateTimeRangePicker(props) {
|
|
|
33
35
|
}, [
|
|
34
36
|
value
|
|
35
37
|
]);
|
|
36
|
-
return /*#__PURE__*/ (0,
|
|
38
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
37
39
|
direction: "row",
|
|
38
40
|
spacing: 1,
|
|
39
41
|
height: height,
|
|
40
42
|
children: [
|
|
41
|
-
/*#__PURE__*/ (0,
|
|
43
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Popover, {
|
|
42
44
|
anchorEl: anchorEl.current,
|
|
43
45
|
anchorOrigin: {
|
|
44
46
|
vertical: 'bottom',
|
|
@@ -49,7 +51,7 @@ function DateTimeRangePicker(props) {
|
|
|
49
51
|
sx: (theme)=>({
|
|
50
52
|
padding: theme.spacing(2)
|
|
51
53
|
}),
|
|
52
|
-
children: /*#__PURE__*/ (0,
|
|
54
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_AbsoluteTimePicker.AbsoluteTimePicker, {
|
|
53
55
|
initialTimeRange: convertedTimeRange,
|
|
54
56
|
onChange: (value)=>{
|
|
55
57
|
onChange(value);
|
|
@@ -58,11 +60,11 @@ function DateTimeRangePicker(props) {
|
|
|
58
60
|
onCancel: ()=>setShowCustomDateSelector(false)
|
|
59
61
|
})
|
|
60
62
|
}),
|
|
61
|
-
/*#__PURE__*/ (0,
|
|
63
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControl, {
|
|
62
64
|
fullWidth: true,
|
|
63
|
-
children: /*#__PURE__*/ (0,
|
|
65
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
64
66
|
ref: anchorEl,
|
|
65
|
-
children: /*#__PURE__*/ (0,
|
|
67
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeRangeSelector.TimeRangeSelector, {
|
|
66
68
|
timeOptions: timeOptions,
|
|
67
69
|
value: value,
|
|
68
70
|
height: height,
|
|
@@ -16,15 +16,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "TimeRangeSelector", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return TimeRangeSelector;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _material = require("@mui/material");
|
|
23
|
-
const
|
|
25
|
+
const _Calendar = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Calendar"));
|
|
24
26
|
const _core = require("@perses-dev/core");
|
|
25
|
-
const
|
|
27
|
+
const _TimeZoneProvider = require("../context/TimeZoneProvider");
|
|
26
28
|
const _utils = require("./utils");
|
|
27
|
-
function
|
|
29
|
+
function _interop_require_default(obj) {
|
|
28
30
|
return obj && obj.__esModule ? obj : {
|
|
29
31
|
default: obj
|
|
30
32
|
};
|
|
@@ -32,12 +34,12 @@ function _interopRequireDefault(obj) {
|
|
|
32
34
|
const DATE_TIME_FORMAT = 'yyyy-MM-dd HH:mm:ss';
|
|
33
35
|
function TimeRangeSelector(props) {
|
|
34
36
|
const { value , timeOptions , onSelectChange , onCustomClick , height } = props;
|
|
35
|
-
const { timeZone } = (0,
|
|
37
|
+
const { timeZone } = (0, _TimeZoneProvider.useTimeZone)();
|
|
36
38
|
const formattedValue = !(0, _core.isRelativeTimeRange)(value) ? (0, _utils.formatAbsoluteRange)(value, DATE_TIME_FORMAT, timeZone) : value.pastDuration;
|
|
37
|
-
return /*#__PURE__*/ (0,
|
|
39
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Select, {
|
|
38
40
|
value: formattedValue,
|
|
39
41
|
onChange: onSelectChange,
|
|
40
|
-
IconComponent:
|
|
42
|
+
IconComponent: _Calendar.default,
|
|
41
43
|
inputProps: {
|
|
42
44
|
'aria-label': `Select time range. Currently set to ${formattedValue}`
|
|
43
45
|
},
|
|
@@ -57,16 +59,16 @@ function TimeRangeSelector(props) {
|
|
|
57
59
|
} : {}
|
|
58
60
|
},
|
|
59
61
|
children: [
|
|
60
|
-
timeOptions.map((item, idx)=>/*#__PURE__*/ (0,
|
|
62
|
+
timeOptions.map((item, idx)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
61
63
|
value: item.value.pastDuration,
|
|
62
64
|
children: item.display
|
|
63
65
|
}, idx)),
|
|
64
|
-
(0, _core.isRelativeTimeRange)(value) ? /*#__PURE__*/ (0,
|
|
66
|
+
(0, _core.isRelativeTimeRange)(value) ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
65
67
|
onClick: ()=>{
|
|
66
68
|
onCustomClick();
|
|
67
69
|
},
|
|
68
70
|
children: "Custom time range"
|
|
69
|
-
}) : /*#__PURE__*/ (0,
|
|
71
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
70
72
|
value: formattedValue,
|
|
71
73
|
onClick: ()=>{
|
|
72
74
|
onCustomClick();
|
|
@@ -14,17 +14,19 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function
|
|
17
|
+
_export_star(require("./DateTimeRangePicker"), exports);
|
|
18
|
+
_export_star(require("./TimeRangeSelector"), exports);
|
|
19
|
+
_export_star(require("./AbsoluteTimePicker"), exports);
|
|
20
|
+
function _export_star(from, to) {
|
|
21
21
|
Object.keys(from).forEach(function(k) {
|
|
22
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
23
|
+
Object.defineProperty(to, k, {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function() {
|
|
26
|
+
return from[k];
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
28
30
|
});
|
|
29
31
|
return from;
|
|
30
32
|
}
|
|
@@ -21,18 +21,22 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
validateDateRange: ()
|
|
25
|
-
|
|
24
|
+
validateDateRange: function() {
|
|
25
|
+
return validateDateRange;
|
|
26
|
+
},
|
|
27
|
+
formatAbsoluteRange: function() {
|
|
28
|
+
return formatAbsoluteRange;
|
|
29
|
+
}
|
|
26
30
|
});
|
|
27
|
-
const
|
|
31
|
+
const _datefns = require("date-fns");
|
|
28
32
|
const _utils = require("../utils");
|
|
29
33
|
function validateDateRange(startDate, endDate) {
|
|
30
34
|
// TODO: display error as helperText
|
|
31
|
-
if (!(0,
|
|
35
|
+
if (!(0, _datefns.isValid)(startDate) || !(0, _datefns.isValid)(endDate)) {
|
|
32
36
|
console.error('Invalid Date');
|
|
33
37
|
return false;
|
|
34
38
|
}
|
|
35
|
-
if (!(0,
|
|
39
|
+
if (!(0, _datefns.isBefore)(startDate, endDate)) {
|
|
36
40
|
console.error('End Time is before Start Time');
|
|
37
41
|
return false;
|
|
38
42
|
}
|