@perses-dev/components 0.0.0-snapshot-embed-import-errors-8906900 → 0.0.0-snapshot-test-internal-dep-dd238ac
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/README.md +2 -3
- package/dist/ColorPicker/ColorPicker.d.ts +12 -0
- package/dist/ColorPicker/ColorPicker.d.ts.map +1 -0
- package/dist/ColorPicker/ColorPicker.js +78 -0
- package/dist/ColorPicker/ColorPicker.js.map +1 -0
- package/dist/ColorPicker/index.d.ts +2 -0
- package/dist/ColorPicker/index.d.ts.map +1 -0
- package/dist/{Tooltip → ColorPicker}/index.js +2 -3
- package/dist/ColorPicker/index.js.map +1 -0
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts +2 -1
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts.map +1 -1
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js +88 -51
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +1 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js +3 -2
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts.map +1 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.js +4 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.js.map +1 -1
- package/dist/DateTimeRangePicker/index.js +1 -1
- package/dist/DateTimeRangePicker/index.js.map +1 -1
- package/dist/DateTimeRangePicker/utils.js +1 -1
- package/dist/DateTimeRangePicker/utils.js.map +1 -1
- package/dist/Dialog/Dialog.d.ts +24 -0
- package/dist/Dialog/Dialog.d.ts.map +1 -0
- package/dist/Dialog/Dialog.js +74 -0
- package/dist/Dialog/Dialog.js.map +1 -0
- package/dist/Dialog/index.d.ts +2 -0
- package/dist/Dialog/index.d.ts.map +1 -0
- package/dist/Dialog/index.js +15 -0
- package/dist/{Tooltip → Dialog}/index.js.map +1 -1
- package/dist/Drawer/Drawer.js +1 -1
- package/dist/Drawer/Drawer.js.map +1 -1
- package/dist/Drawer/index.js +1 -1
- package/dist/Drawer/index.js.map +1 -1
- package/dist/{EChart.d.ts → EChart/EChart.d.ts} +3 -3
- package/dist/EChart/EChart.d.ts.map +1 -0
- package/dist/{EChart.js → EChart/EChart.js} +2 -3
- package/dist/EChart/EChart.js.map +1 -0
- package/dist/EChart/index.d.ts +2 -0
- package/dist/EChart/index.d.ts.map +1 -0
- package/dist/EChart/index.js +15 -0
- package/dist/EChart/index.js.map +1 -0
- package/dist/ErrorAlert.js +1 -1
- package/dist/ErrorAlert.js.map +1 -1
- package/dist/ErrorBoundary.js +1 -1
- package/dist/ErrorBoundary.js.map +1 -1
- package/dist/GaugeChart/GaugeChart.d.ts +1 -2
- package/dist/GaugeChart/GaugeChart.d.ts.map +1 -1
- package/dist/GaugeChart/GaugeChart.js +3 -2
- package/dist/GaugeChart/GaugeChart.js.map +1 -1
- package/dist/GaugeChart/index.js +1 -1
- package/dist/GaugeChart/index.js.map +1 -1
- package/dist/InfoTooltip/InfoTooltip.d.ts +1 -6
- package/dist/InfoTooltip/InfoTooltip.d.ts.map +1 -1
- package/dist/InfoTooltip/InfoTooltip.js +2 -9
- package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
- package/dist/InfoTooltip/index.js +1 -1
- package/dist/InfoTooltip/index.js.map +1 -1
- package/dist/JSONEditor.js +1 -1
- package/dist/JSONEditor.js.map +1 -1
- package/dist/Legend/CompactLegend.js +1 -1
- package/dist/Legend/CompactLegend.js.map +1 -1
- package/dist/Legend/Legend.d.ts.map +1 -1
- package/dist/Legend/Legend.js +13 -5
- package/dist/Legend/Legend.js.map +1 -1
- package/dist/Legend/LegendColorBadge.js +1 -1
- package/dist/Legend/LegendColorBadge.js.map +1 -1
- package/dist/Legend/ListLegend.js +1 -1
- package/dist/Legend/ListLegend.js.map +1 -1
- package/dist/Legend/ListLegendItem.js +1 -1
- package/dist/Legend/ListLegendItem.js.map +1 -1
- package/dist/Legend/index.js +1 -1
- package/dist/Legend/index.js.map +1 -1
- package/dist/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
- package/dist/LegendOptionsEditor/LegendOptionsEditor.js +13 -18
- package/dist/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
- package/dist/LegendOptionsEditor/index.js +1 -1
- package/dist/LegendOptionsEditor/index.js.map +1 -1
- package/dist/LineChart/LineChart.d.ts +4 -2
- package/dist/LineChart/LineChart.d.ts.map +1 -1
- package/dist/LineChart/LineChart.js +4 -4
- package/dist/LineChart/LineChart.js.map +1 -1
- package/dist/LineChart/index.js +1 -1
- package/dist/LineChart/index.js.map +1 -1
- package/dist/LineChart/utils.js +2 -2
- package/dist/LineChart/utils.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.js +2 -2
- package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts +3 -2
- package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js +18 -6
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
- package/dist/OptionsEditorLayout/index.js +1 -1
- package/dist/OptionsEditorLayout/index.js.map +1 -1
- package/dist/StatChart/StatChart.d.ts +1 -3
- package/dist/StatChart/StatChart.d.ts.map +1 -1
- package/dist/StatChart/StatChart.js +23 -16
- package/dist/StatChart/StatChart.js.map +1 -1
- package/dist/StatChart/index.js +1 -1
- package/dist/StatChart/index.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts +4 -0
- package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts.map +1 -0
- package/dist/ThresholdsEditor/ThresholdColorPicker.js +76 -0
- package/dist/ThresholdsEditor/ThresholdColorPicker.js.map +1 -0
- package/dist/ThresholdsEditor/ThresholdInput.d.ts +13 -0
- package/dist/ThresholdsEditor/ThresholdInput.d.ts.map +1 -0
- package/dist/ThresholdsEditor/ThresholdInput.js +61 -0
- package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -0
- package/dist/ThresholdsEditor/ThresholdsEditor.d.ts +10 -0
- package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -0
- package/dist/ThresholdsEditor/ThresholdsEditor.js +215 -0
- package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -0
- package/dist/ThresholdsEditor/index.d.ts +2 -0
- package/dist/ThresholdsEditor/index.d.ts.map +1 -0
- package/dist/ThresholdsEditor/index.js +15 -0
- package/dist/ThresholdsEditor/index.js.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/SeriesInfo.d.ts +1 -2
- package/dist/TimeSeriesTooltip/SeriesInfo.d.ts.map +1 -0
- package/dist/TimeSeriesTooltip/SeriesInfo.js +89 -0
- package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -0
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts +9 -0
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts.map +1 -0
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js +99 -0
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/SeriesMarker.d.ts +2 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.d.ts.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/SeriesMarker.js +7 -7
- package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -0
- package/dist/{Tooltip/Tooltip.d.ts → TimeSeriesTooltip/TimeSeriesTooltip.d.ts} +4 -4
- package/dist/TimeSeriesTooltip/TimeSeriesTooltip.d.ts.map +1 -0
- package/dist/{Tooltip/Tooltip.js → TimeSeriesTooltip/TimeSeriesTooltip.js} +3 -4
- package/dist/TimeSeriesTooltip/TimeSeriesTooltip.js.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/TooltipContent.d.ts +1 -2
- package/dist/TimeSeriesTooltip/TooltipContent.d.ts.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/TooltipContent.js +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -0
- package/dist/TimeSeriesTooltip/focused-series.d.ts.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/focused-series.js +6 -6
- package/dist/TimeSeriesTooltip/focused-series.js.map +1 -0
- package/dist/TimeSeriesTooltip/index.d.ts +9 -0
- package/dist/TimeSeriesTooltip/index.d.ts.map +1 -0
- package/dist/TimeSeriesTooltip/index.js +22 -0
- package/dist/TimeSeriesTooltip/index.js.map +1 -0
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/tooltip-model.js +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -0
- package/dist/TimeSeriesTooltip/utils.d.ts.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/utils.js +1 -1
- package/dist/TimeSeriesTooltip/utils.js.map +1 -0
- package/dist/UnitSelector/UnitSelector.js +1 -1
- package/dist/UnitSelector/UnitSelector.js.map +1 -1
- package/dist/UnitSelector/index.js +1 -1
- package/dist/UnitSelector/index.js.map +1 -1
- package/dist/YAxisLabel.js +1 -1
- package/dist/YAxisLabel.js.map +1 -1
- package/dist/cjs/ColorPicker/ColorPicker.js +128 -0
- package/dist/cjs/{Tooltip → ColorPicker}/index.js +2 -3
- package/dist/cjs/DateTimeRangePicker/AbsoluteTimePicker.js +87 -50
- package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +3 -2
- package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +4 -1
- package/dist/cjs/DateTimeRangePicker/index.js +1 -1
- package/dist/cjs/DateTimeRangePicker/utils.js +1 -1
- package/dist/cjs/Dialog/Dialog.js +85 -0
- package/dist/cjs/Dialog/index.js +28 -0
- package/dist/cjs/Drawer/Drawer.js +1 -1
- package/dist/cjs/Drawer/index.js +1 -1
- package/dist/cjs/{EChart.js → EChart/EChart.js} +5 -11
- package/dist/cjs/EChart/index.js +28 -0
- package/dist/cjs/ErrorAlert.js +1 -1
- package/dist/cjs/ErrorBoundary.js +1 -1
- package/dist/cjs/GaugeChart/GaugeChart.js +3 -2
- package/dist/cjs/GaugeChart/index.js +1 -1
- package/dist/cjs/InfoTooltip/InfoTooltip.js +5 -18
- package/dist/cjs/InfoTooltip/index.js +1 -1
- package/dist/cjs/JSONEditor.js +1 -1
- package/dist/cjs/Legend/CompactLegend.js +1 -1
- package/dist/cjs/Legend/Legend.js +13 -5
- package/dist/cjs/Legend/LegendColorBadge.js +1 -1
- package/dist/cjs/Legend/ListLegend.js +1 -1
- package/dist/cjs/Legend/ListLegendItem.js +1 -1
- package/dist/cjs/Legend/index.js +1 -1
- package/dist/cjs/LegendOptionsEditor/LegendOptionsEditor.js +13 -18
- package/dist/cjs/LegendOptionsEditor/index.js +1 -1
- package/dist/cjs/LineChart/LineChart.js +43 -4
- package/dist/cjs/LineChart/index.js +1 -1
- package/dist/cjs/LineChart/utils.js +3 -8
- package/dist/cjs/OptionsEditorLayout/OptionsEditorColumn.js +1 -1
- package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +2 -2
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGrid.js +1 -1
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +23 -6
- package/dist/cjs/OptionsEditorLayout/index.js +1 -1
- package/dist/cjs/StatChart/StatChart.js +24 -60
- package/dist/cjs/StatChart/index.js +1 -1
- package/dist/cjs/ThresholdsEditor/ThresholdColorPicker.js +87 -0
- package/dist/cjs/ThresholdsEditor/ThresholdInput.js +72 -0
- package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +265 -0
- package/dist/cjs/ThresholdsEditor/index.js +28 -0
- package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +95 -0
- package/dist/cjs/TimeSeriesTooltip/SeriesLabelsStack.js +105 -0
- package/dist/cjs/{Tooltip → TimeSeriesTooltip}/SeriesMarker.js +7 -7
- package/dist/cjs/{Tooltip/Tooltip.js → TimeSeriesTooltip/TimeSeriesTooltip.js} +4 -4
- package/dist/cjs/{Tooltip → TimeSeriesTooltip}/TooltipContent.js +1 -1
- package/dist/cjs/{Tooltip → TimeSeriesTooltip}/focused-series.js +6 -6
- package/dist/cjs/TimeSeriesTooltip/index.js +35 -0
- package/dist/cjs/{Tooltip → TimeSeriesTooltip}/tooltip-model.js +1 -1
- package/dist/cjs/{Tooltip → TimeSeriesTooltip}/utils.js +1 -1
- package/dist/cjs/UnitSelector/UnitSelector.js +1 -1
- package/dist/cjs/UnitSelector/index.js +1 -1
- package/dist/cjs/YAxisLabel.js +1 -1
- package/dist/cjs/context/ChartsThemeProvider.js +1 -1
- package/dist/cjs/context/TimeZoneProvider.js +1 -1
- package/dist/cjs/index.js +5 -1
- package/dist/cjs/model/graph.js +4 -15
- package/dist/cjs/model/index.js +2 -1
- package/dist/cjs/model/legend.js +67 -0
- package/dist/cjs/model/theme.js +1 -1
- package/dist/cjs/model/units/bytes.js +1 -1
- package/dist/cjs/model/units/constants.js +1 -1
- package/dist/cjs/model/units/decimal.js +5 -2
- package/dist/cjs/model/units/index.js +1 -1
- package/dist/cjs/model/units/percent.js +1 -1
- package/dist/cjs/model/units/time.js +1 -1
- package/dist/cjs/model/units/types.js +1 -1
- package/dist/cjs/model/units/units.js +1 -1
- package/dist/cjs/test/index.js +1 -1
- package/dist/cjs/test/render.js +1 -1
- package/dist/cjs/test/setup-tests.js +1 -1
- package/dist/cjs/test-utils/index.js +1 -1
- package/dist/cjs/test-utils/theme.js +14 -1
- package/dist/cjs/theme/index.js +1 -1
- package/dist/cjs/theme/palette/background.js +1 -1
- package/dist/cjs/theme/palette/colors/blue.js +1 -1
- package/dist/cjs/theme/palette/colors/common.js +1 -1
- package/dist/cjs/theme/palette/colors/green.js +1 -1
- package/dist/cjs/theme/palette/colors/grey.js +1 -1
- package/dist/cjs/theme/palette/colors/index.js +1 -1
- package/dist/cjs/theme/palette/colors/orange.js +1 -1
- package/dist/cjs/theme/palette/colors/purple.js +1 -1
- package/dist/cjs/theme/palette/colors/red.js +1 -1
- package/dist/cjs/theme/palette/colors/types.js +1 -1
- package/dist/cjs/theme/palette/error.js +1 -1
- package/dist/cjs/theme/palette/grey.js +1 -1
- package/dist/cjs/theme/palette/index.js +1 -1
- package/dist/cjs/theme/palette/palette-options.js +1 -1
- package/dist/cjs/theme/palette/primary.js +1 -1
- package/dist/cjs/theme/palette/secondary.js +1 -1
- package/dist/cjs/theme/palette/success.js +1 -1
- package/dist/cjs/theme/palette/text.js +1 -1
- package/dist/cjs/theme/palette/warning.js +1 -1
- package/dist/cjs/theme/theme.js +17 -1
- package/dist/cjs/theme/types/ThemeExtension.d.js +1 -1
- package/dist/cjs/theme/typography.js +5 -1
- package/dist/cjs/utils/combine-sx.js +1 -1
- package/dist/cjs/utils/component-ids.js +1 -1
- package/dist/cjs/utils/format.js +1 -1
- package/dist/cjs/utils/index.js +1 -1
- package/dist/cjs/utils/mathjs.js +1 -1
- package/dist/cjs/utils/theme-gen.js +16 -8
- package/dist/context/ChartsThemeProvider.js +1 -1
- package/dist/context/ChartsThemeProvider.js.map +1 -1
- package/dist/context/TimeZoneProvider.js +1 -1
- package/dist/context/TimeZoneProvider.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/model/graph.d.ts +3 -18
- package/dist/model/graph.d.ts.map +1 -1
- package/dist/model/graph.js +1 -5
- package/dist/model/graph.js.map +1 -1
- package/dist/model/index.d.ts +1 -0
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +2 -1
- package/dist/model/index.js.map +1 -1
- package/dist/model/legend.d.ts +22 -0
- package/dist/model/legend.d.ts.map +1 -0
- package/dist/model/legend.js +51 -0
- package/dist/model/legend.js.map +1 -0
- package/dist/model/theme.d.ts +16 -0
- package/dist/model/theme.d.ts.map +1 -1
- package/dist/model/theme.js +1 -1
- package/dist/model/theme.js.map +1 -1
- package/dist/model/units/bytes.d.ts +1 -1
- package/dist/model/units/bytes.d.ts.map +1 -1
- package/dist/model/units/bytes.js +1 -1
- package/dist/model/units/bytes.js.map +1 -1
- package/dist/model/units/constants.js +1 -1
- package/dist/model/units/constants.js.map +1 -1
- package/dist/model/units/decimal.d.ts +1 -1
- package/dist/model/units/decimal.d.ts.map +1 -1
- package/dist/model/units/decimal.js +5 -2
- package/dist/model/units/decimal.js.map +1 -1
- package/dist/model/units/index.js +1 -1
- package/dist/model/units/index.js.map +1 -1
- package/dist/model/units/percent.d.ts +1 -1
- package/dist/model/units/percent.d.ts.map +1 -1
- package/dist/model/units/percent.js +1 -1
- package/dist/model/units/percent.js.map +1 -1
- package/dist/model/units/time.d.ts +1 -1
- package/dist/model/units/time.d.ts.map +1 -1
- package/dist/model/units/time.js +1 -1
- package/dist/model/units/time.js.map +1 -1
- package/dist/model/units/types.d.ts +1 -1
- package/dist/model/units/types.d.ts.map +1 -1
- package/dist/model/units/types.js +1 -1
- package/dist/model/units/types.js.map +1 -1
- package/dist/model/units/units.js +1 -1
- package/dist/model/units/units.js.map +1 -1
- package/dist/test/index.js +1 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test/render.js +1 -1
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/theme.d.ts.map +1 -1
- package/dist/test-utils/theme.js +14 -1
- package/dist/test-utils/theme.js.map +1 -1
- package/dist/theme/index.js +1 -1
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/palette/background.js +1 -1
- package/dist/theme/palette/background.js.map +1 -1
- package/dist/theme/palette/colors/blue.js +1 -1
- package/dist/theme/palette/colors/blue.js.map +1 -1
- package/dist/theme/palette/colors/common.js +1 -1
- package/dist/theme/palette/colors/common.js.map +1 -1
- package/dist/theme/palette/colors/green.js +1 -1
- package/dist/theme/palette/colors/green.js.map +1 -1
- package/dist/theme/palette/colors/grey.js +1 -1
- package/dist/theme/palette/colors/grey.js.map +1 -1
- package/dist/theme/palette/colors/index.js +1 -1
- package/dist/theme/palette/colors/index.js.map +1 -1
- package/dist/theme/palette/colors/orange.js +1 -1
- package/dist/theme/palette/colors/orange.js.map +1 -1
- package/dist/theme/palette/colors/purple.js +1 -1
- package/dist/theme/palette/colors/purple.js.map +1 -1
- package/dist/theme/palette/colors/red.js +1 -1
- package/dist/theme/palette/colors/red.js.map +1 -1
- package/dist/theme/palette/colors/types.js +1 -1
- package/dist/theme/palette/colors/types.js.map +1 -1
- package/dist/theme/palette/error.js +1 -1
- package/dist/theme/palette/error.js.map +1 -1
- package/dist/theme/palette/grey.js +1 -1
- package/dist/theme/palette/grey.js.map +1 -1
- package/dist/theme/palette/index.js +1 -1
- package/dist/theme/palette/index.js.map +1 -1
- package/dist/theme/palette/palette-options.js +1 -1
- package/dist/theme/palette/palette-options.js.map +1 -1
- package/dist/theme/palette/primary.js +1 -1
- package/dist/theme/palette/primary.js.map +1 -1
- package/dist/theme/palette/secondary.js +1 -1
- package/dist/theme/palette/secondary.js.map +1 -1
- package/dist/theme/palette/success.js +1 -1
- package/dist/theme/palette/success.js.map +1 -1
- package/dist/theme/palette/text.js +1 -1
- package/dist/theme/palette/text.js.map +1 -1
- package/dist/theme/palette/warning.js +1 -1
- package/dist/theme/palette/warning.js.map +1 -1
- package/dist/theme/theme.d.ts.map +1 -1
- package/dist/theme/theme.js +18 -2
- package/dist/theme/theme.js.map +1 -1
- package/dist/theme/types/ThemeExtension.d.js +1 -1
- package/dist/theme/types/ThemeExtension.d.js.map +1 -1
- package/dist/theme/typography.d.ts +4 -0
- package/dist/theme/typography.d.ts.map +1 -1
- package/dist/theme/typography.js +5 -1
- package/dist/theme/typography.js.map +1 -1
- package/dist/utils/combine-sx.js +1 -1
- package/dist/utils/combine-sx.js.map +1 -1
- package/dist/utils/component-ids.js +1 -1
- package/dist/utils/component-ids.js.map +1 -1
- package/dist/utils/format.js +1 -1
- package/dist/utils/format.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/mathjs.js +1 -1
- package/dist/utils/mathjs.js.map +1 -1
- package/dist/utils/theme-gen.d.ts.map +1 -1
- package/dist/utils/theme-gen.js +15 -2
- package/dist/utils/theme-gen.js.map +1 -1
- package/package.json +10 -4
- package/dist/EChart.d.ts.map +0 -1
- package/dist/EChart.js.map +0 -1
- package/dist/InfoTooltip/InfoTooltip.test.d.ts +0 -2
- package/dist/InfoTooltip/InfoTooltip.test.d.ts.map +0 -1
- package/dist/InfoTooltip/InfoTooltip.test.js +0 -36
- package/dist/InfoTooltip/InfoTooltip.test.js.map +0 -1
- package/dist/LegendOptionsEditor/LegendOptionsEditor.test.d.ts +0 -2
- package/dist/LegendOptionsEditor/LegendOptionsEditor.test.d.ts.map +0 -1
- package/dist/LegendOptionsEditor/LegendOptionsEditor.test.js +0 -41
- package/dist/LegendOptionsEditor/LegendOptionsEditor.test.js.map +0 -1
- package/dist/StatChart/StatChart.test.d.ts +0 -2
- package/dist/StatChart/StatChart.test.d.ts.map +0 -1
- package/dist/StatChart/StatChart.test.js +0 -94
- package/dist/StatChart/StatChart.test.js.map +0 -1
- package/dist/Tooltip/SeriesInfo.d.ts.map +0 -1
- package/dist/Tooltip/SeriesInfo.js +0 -143
- package/dist/Tooltip/SeriesInfo.js.map +0 -1
- package/dist/Tooltip/SeriesMarker.d.ts.map +0 -1
- package/dist/Tooltip/SeriesMarker.js.map +0 -1
- package/dist/Tooltip/Tooltip.d.ts.map +0 -1
- package/dist/Tooltip/Tooltip.js.map +0 -1
- package/dist/Tooltip/TooltipContent.d.ts.map +0 -1
- package/dist/Tooltip/TooltipContent.js.map +0 -1
- package/dist/Tooltip/focused-series.d.ts.map +0 -1
- package/dist/Tooltip/focused-series.js.map +0 -1
- package/dist/Tooltip/focused-series.test.d.ts +0 -2
- package/dist/Tooltip/focused-series.test.d.ts.map +0 -1
- package/dist/Tooltip/focused-series.test.js +0 -93
- package/dist/Tooltip/focused-series.test.js.map +0 -1
- package/dist/Tooltip/index.d.ts +0 -3
- package/dist/Tooltip/index.d.ts.map +0 -1
- package/dist/Tooltip/tooltip-model.d.ts.map +0 -1
- package/dist/Tooltip/tooltip-model.js.map +0 -1
- package/dist/Tooltip/utils.d.ts.map +0 -1
- package/dist/Tooltip/utils.js.map +0 -1
- package/dist/UnitSelector/UnitSelector.test.d.ts +0 -2
- package/dist/UnitSelector/UnitSelector.test.d.ts.map +0 -1
- package/dist/UnitSelector/UnitSelector.test.js +0 -204
- package/dist/UnitSelector/UnitSelector.test.js.map +0 -1
- package/dist/cjs/InfoTooltip/InfoTooltip.test.js +0 -43
- package/dist/cjs/LegendOptionsEditor/LegendOptionsEditor.test.js +0 -48
- package/dist/cjs/StatChart/StatChart.test.js +0 -96
- package/dist/cjs/Tooltip/SeriesInfo.js +0 -149
- package/dist/cjs/Tooltip/focused-series.test.js +0 -95
- package/dist/cjs/UnitSelector/UnitSelector.test.js +0 -211
- package/dist/cjs/model/units/units.test.js +0 -153
- package/dist/cjs/utils/format.test.js +0 -47
- package/dist/cjs/utils/theme-gen.test.js +0 -197
- package/dist/model/units/units.test.d.ts +0 -2
- package/dist/model/units/units.test.d.ts.map +0 -1
- package/dist/model/units/units.test.js +0 -151
- package/dist/model/units/units.test.js.map +0 -1
- package/dist/utils/format.test.d.ts +0 -2
- package/dist/utils/format.test.d.ts.map +0 -1
- package/dist/utils/format.test.js +0 -45
- package/dist/utils/format.test.js.map +0 -1
- package/dist/utils/theme-gen.test.d.ts +0 -2
- package/dist/utils/theme-gen.test.d.ts.map +0 -1
- package/dist/utils/theme-gen.test.js +0 -195
- package/dist/utils/theme-gen.test.js.map +0 -1
- /package/dist/{Tooltip → TimeSeriesTooltip}/focused-series.d.ts +0 -0
- /package/dist/{Tooltip → TimeSeriesTooltip}/tooltip-model.d.ts +0 -0
- /package/dist/{Tooltip → TimeSeriesTooltip}/utils.d.ts +0 -0
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
// Copyright 2022 The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
const _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
const _react = require("@testing-library/react");
|
|
19
|
-
const _userEvent = /*#__PURE__*/ _interopRequireDefault(require("@testing-library/user-event"));
|
|
20
|
-
const _unitSelector = require("./UnitSelector");
|
|
21
|
-
function _interopRequireDefault(obj) {
|
|
22
|
-
return obj && obj.__esModule ? obj : {
|
|
23
|
-
default: obj
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
describe('UnitSelector', ()=>{
|
|
27
|
-
const renderUnitSelector = (value, onChange = jest.fn())=>{
|
|
28
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxRuntime.jsx)("div", {
|
|
29
|
-
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_unitSelector.UnitSelector, {
|
|
30
|
-
value: value,
|
|
31
|
-
onChange: onChange
|
|
32
|
-
})
|
|
33
|
-
}));
|
|
34
|
-
};
|
|
35
|
-
const getUnitSelector = ()=>{
|
|
36
|
-
return _react.screen.getByRole('combobox', {
|
|
37
|
-
name: 'Units'
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
const getDecimalSelector = ()=>{
|
|
41
|
-
return _react.screen.getByRole('combobox', {
|
|
42
|
-
name: 'Decimal'
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
const getAbbreviateSwitch = ()=>{
|
|
46
|
-
return _react.screen.getByRole('checkbox', {
|
|
47
|
-
name: 'Abbreviate'
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
it('can change the unit kind by clicking', ()=>{
|
|
51
|
-
const onChange = jest.fn();
|
|
52
|
-
renderUnitSelector({
|
|
53
|
-
kind: 'Minutes'
|
|
54
|
-
}, onChange);
|
|
55
|
-
const unitSelector = getUnitSelector();
|
|
56
|
-
_userEvent.default.click(unitSelector);
|
|
57
|
-
const decimalOption = _react.screen.getByRole('option', {
|
|
58
|
-
name: 'Decimal'
|
|
59
|
-
});
|
|
60
|
-
_userEvent.default.click(decimalOption);
|
|
61
|
-
expect(onChange).toHaveBeenCalledWith({
|
|
62
|
-
kind: 'Decimal'
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
it('can change the unit kind using a keyboard', ()=>{
|
|
66
|
-
const onChange = jest.fn();
|
|
67
|
-
renderUnitSelector({
|
|
68
|
-
kind: 'Bytes'
|
|
69
|
-
}, onChange);
|
|
70
|
-
const unitSelector = getUnitSelector();
|
|
71
|
-
_userEvent.default.tab();
|
|
72
|
-
_userEvent.default.tab();
|
|
73
|
-
expect(unitSelector).toHaveFocus();
|
|
74
|
-
_userEvent.default.clear(unitSelector);
|
|
75
|
-
_userEvent.default.keyboard('years');
|
|
76
|
-
_react.screen.getByRole('option', {
|
|
77
|
-
name: 'Years'
|
|
78
|
-
});
|
|
79
|
-
_userEvent.default.keyboard('{arrowup}{enter}');
|
|
80
|
-
expect(onChange).toHaveBeenCalledWith({
|
|
81
|
-
kind: 'Years'
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
it('can change the decimal places by clicking', ()=>{
|
|
85
|
-
const onChange = jest.fn();
|
|
86
|
-
renderUnitSelector({
|
|
87
|
-
kind: 'Decimal',
|
|
88
|
-
decimal_places: 0,
|
|
89
|
-
abbreviate: true
|
|
90
|
-
}, onChange);
|
|
91
|
-
_userEvent.default.click(getDecimalSelector());
|
|
92
|
-
const decimalOption = _react.screen.getByRole('option', {
|
|
93
|
-
name: '1'
|
|
94
|
-
});
|
|
95
|
-
_userEvent.default.click(decimalOption);
|
|
96
|
-
expect(onChange).toHaveBeenCalledWith({
|
|
97
|
-
kind: 'Decimal',
|
|
98
|
-
decimal_places: 1,
|
|
99
|
-
abbreviate: true
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
it('can change the decimal places using a keyboard', ()=>{
|
|
103
|
-
const onChange = jest.fn();
|
|
104
|
-
renderUnitSelector({
|
|
105
|
-
kind: 'Percent'
|
|
106
|
-
}, onChange);
|
|
107
|
-
const decimalSelector = getDecimalSelector();
|
|
108
|
-
_userEvent.default.tab();
|
|
109
|
-
_userEvent.default.tab();
|
|
110
|
-
expect(decimalSelector).toHaveFocus();
|
|
111
|
-
_userEvent.default.clear(decimalSelector);
|
|
112
|
-
_userEvent.default.keyboard('3');
|
|
113
|
-
_react.screen.getByRole('option', {
|
|
114
|
-
name: '3'
|
|
115
|
-
});
|
|
116
|
-
_userEvent.default.keyboard('{arrowup}{enter}');
|
|
117
|
-
expect(onChange).toHaveBeenCalledWith({
|
|
118
|
-
kind: 'Percent',
|
|
119
|
-
decimal_places: 3
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
it('can change abbreviate by clicking', ()=>{
|
|
123
|
-
const onChange = jest.fn();
|
|
124
|
-
renderUnitSelector({
|
|
125
|
-
kind: 'Decimal',
|
|
126
|
-
decimal_places: 3,
|
|
127
|
-
abbreviate: true
|
|
128
|
-
}, onChange);
|
|
129
|
-
_userEvent.default.click(getAbbreviateSwitch());
|
|
130
|
-
expect(onChange).toHaveBeenCalledWith({
|
|
131
|
-
kind: 'Decimal',
|
|
132
|
-
decimal_places: 3,
|
|
133
|
-
abbreviate: false
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
it('can change abbreviate using a keyboard', ()=>{
|
|
137
|
-
const onChange = jest.fn();
|
|
138
|
-
renderUnitSelector({
|
|
139
|
-
kind: 'Decimal',
|
|
140
|
-
decimal_places: 0
|
|
141
|
-
}, onChange);
|
|
142
|
-
_userEvent.default.tab();
|
|
143
|
-
_userEvent.default.keyboard('{space}');
|
|
144
|
-
expect(onChange).toHaveBeenCalledWith({
|
|
145
|
-
kind: 'Decimal',
|
|
146
|
-
decimal_places: 0,
|
|
147
|
-
abbreviate: true
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
describe('with a time unit selected', ()=>{
|
|
151
|
-
it('does not allow the user to set abbreviate', ()=>{
|
|
152
|
-
renderUnitSelector({
|
|
153
|
-
kind: 'Minutes'
|
|
154
|
-
});
|
|
155
|
-
expect(getAbbreviateSwitch()).toBeDisabled();
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
describe('with a percent unit selected', ()=>{
|
|
159
|
-
it('allows the user to modify the decimal places', ()=>{
|
|
160
|
-
renderUnitSelector({
|
|
161
|
-
kind: 'Percent'
|
|
162
|
-
});
|
|
163
|
-
expect(getDecimalSelector()).toBeEnabled();
|
|
164
|
-
});
|
|
165
|
-
it('does not allow the user to set abbreviate', ()=>{
|
|
166
|
-
renderUnitSelector({
|
|
167
|
-
kind: 'PercentDecimal'
|
|
168
|
-
});
|
|
169
|
-
expect(getAbbreviateSwitch()).toBeDisabled();
|
|
170
|
-
});
|
|
171
|
-
});
|
|
172
|
-
describe('with a decimal unit selected', ()=>{
|
|
173
|
-
it('allows the user to modify the decimal places', ()=>{
|
|
174
|
-
renderUnitSelector({
|
|
175
|
-
kind: 'Decimal'
|
|
176
|
-
});
|
|
177
|
-
expect(getDecimalSelector()).toBeEnabled();
|
|
178
|
-
});
|
|
179
|
-
it('allows the user to set abbreviate', ()=>{
|
|
180
|
-
renderUnitSelector({
|
|
181
|
-
kind: 'Decimal'
|
|
182
|
-
});
|
|
183
|
-
expect(getAbbreviateSwitch()).toBeEnabled();
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
describe('with a bytes unit selected', ()=>{
|
|
187
|
-
it('allows the user to modify the decimal places', ()=>{
|
|
188
|
-
renderUnitSelector({
|
|
189
|
-
kind: 'Bytes'
|
|
190
|
-
});
|
|
191
|
-
expect(getDecimalSelector()).toBeEnabled();
|
|
192
|
-
});
|
|
193
|
-
it('allows the user to set abbreviate', ()=>{
|
|
194
|
-
renderUnitSelector({
|
|
195
|
-
kind: 'Bytes'
|
|
196
|
-
});
|
|
197
|
-
expect(getAbbreviateSwitch()).toBeEnabled();
|
|
198
|
-
});
|
|
199
|
-
});
|
|
200
|
-
it('should not show an option for disabled units', ()=>{
|
|
201
|
-
const onChange = jest.fn();
|
|
202
|
-
renderUnitSelector({
|
|
203
|
-
kind: 'Decimal'
|
|
204
|
-
}, onChange);
|
|
205
|
-
_userEvent.default.click(getUnitSelector());
|
|
206
|
-
const percentShorthandOption = _react.screen.queryByRole('option', {
|
|
207
|
-
name: '%'
|
|
208
|
-
});
|
|
209
|
-
expect(percentShorthandOption).not.toBeInTheDocument();
|
|
210
|
-
});
|
|
211
|
-
});
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
// Copyright 2022 The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
const _units = require("./units");
|
|
18
|
-
describe('formatValue()', ()=>{
|
|
19
|
-
const tests = [
|
|
20
|
-
{
|
|
21
|
-
value: 100000,
|
|
22
|
-
unit: {
|
|
23
|
-
kind: 'Decimal'
|
|
24
|
-
},
|
|
25
|
-
expected: '100,000.00'
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
value: 155900,
|
|
29
|
-
unit: {
|
|
30
|
-
kind: 'Decimal',
|
|
31
|
-
decimal_places: 4
|
|
32
|
-
},
|
|
33
|
-
expected: '155,900.0000'
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
value: 10,
|
|
37
|
-
unit: {
|
|
38
|
-
kind: 'Percent'
|
|
39
|
-
},
|
|
40
|
-
expected: '10.00%'
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
value: 50,
|
|
44
|
-
unit: {
|
|
45
|
-
kind: 'Percent',
|
|
46
|
-
decimal_places: 0
|
|
47
|
-
},
|
|
48
|
-
expected: '50%'
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
value: 0.1,
|
|
52
|
-
unit: {
|
|
53
|
-
kind: 'PercentDecimal'
|
|
54
|
-
},
|
|
55
|
-
expected: '10.00%'
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
value: 100,
|
|
59
|
-
unit: {
|
|
60
|
-
kind: 'Bytes',
|
|
61
|
-
decimal_places: 0,
|
|
62
|
-
abbreviate: false
|
|
63
|
-
},
|
|
64
|
-
expected: '100 bytes'
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
value: 100,
|
|
68
|
-
unit: {
|
|
69
|
-
kind: 'Bytes',
|
|
70
|
-
decimal_places: -1,
|
|
71
|
-
abbreviate: false
|
|
72
|
-
},
|
|
73
|
-
expected: '100 bytes'
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
value: 225000,
|
|
77
|
-
unit: {
|
|
78
|
-
kind: 'Bytes',
|
|
79
|
-
decimal_places: 0,
|
|
80
|
-
abbreviate: true
|
|
81
|
-
},
|
|
82
|
-
expected: '220 KB'
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
value: 505200,
|
|
86
|
-
unit: {
|
|
87
|
-
kind: 'Bytes'
|
|
88
|
-
},
|
|
89
|
-
expected: '505,200.00 bytes'
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
value: 8000,
|
|
93
|
-
unit: {
|
|
94
|
-
kind: 'Milliseconds'
|
|
95
|
-
},
|
|
96
|
-
expected: '8,000.00 milliseconds'
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
value: 200900,
|
|
100
|
-
unit: {
|
|
101
|
-
kind: 'Seconds'
|
|
102
|
-
},
|
|
103
|
-
expected: '200,900.00 seconds'
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
value: 300,
|
|
107
|
-
unit: {
|
|
108
|
-
kind: 'Minutes'
|
|
109
|
-
},
|
|
110
|
-
expected: '300.00 minutes'
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
value: 300,
|
|
114
|
-
unit: {
|
|
115
|
-
kind: 'Hours'
|
|
116
|
-
},
|
|
117
|
-
expected: '300.00 hours'
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
value: 300,
|
|
121
|
-
unit: {
|
|
122
|
-
kind: 'Days'
|
|
123
|
-
},
|
|
124
|
-
expected: '300.00 days'
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
value: 300,
|
|
128
|
-
unit: {
|
|
129
|
-
kind: 'Weeks'
|
|
130
|
-
},
|
|
131
|
-
expected: '300.00 weeks'
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
value: 300,
|
|
135
|
-
unit: {
|
|
136
|
-
kind: 'Months'
|
|
137
|
-
},
|
|
138
|
-
expected: '300.00 months'
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
value: 300,
|
|
142
|
-
unit: {
|
|
143
|
-
kind: 'Years'
|
|
144
|
-
},
|
|
145
|
-
expected: '300.00 years'
|
|
146
|
-
}
|
|
147
|
-
];
|
|
148
|
-
tests.forEach(({ value , unit , expected })=>{
|
|
149
|
-
it(`formats ${value} as ${JSON.stringify(unit)}`, ()=>{
|
|
150
|
-
expect((0, _units.formatValue)(value, unit)).toEqual(expected);
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
});
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// Copyright 2022 The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
const _format = require("./format");
|
|
18
|
-
const DATE = new Date(168523200000);
|
|
19
|
-
const DATE_FORMAT_OPTIONS = {
|
|
20
|
-
hour: 'numeric',
|
|
21
|
-
minute: 'numeric',
|
|
22
|
-
hourCycle: 'h23'
|
|
23
|
-
};
|
|
24
|
-
describe('formatWithTimeZone', ()=>{
|
|
25
|
-
it('should format in Los Angeles timezone', ()=>{
|
|
26
|
-
expect((0, _format.formatWithTimeZone)(DATE, 'yyyy-MM-dd HH:mm:ss', 'America/Los_Angeles')).toBe('1975-05-05 05:00:00');
|
|
27
|
-
});
|
|
28
|
-
it('should format in UTC timezone', ()=>{
|
|
29
|
-
expect((0, _format.formatWithTimeZone)(DATE, 'yyyy-MM-dd HH:mm:ss', 'UTC')).toBe('1975-05-05 12:00:00');
|
|
30
|
-
expect((0, _format.formatWithTimeZone)(DATE, 'yyyy-MM-dd HH:mm:ss', 'utc')).toBe('1975-05-05 12:00:00');
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
describe('dateFormatOptionsWithTimeZone', ()=>{
|
|
34
|
-
it('should format in Los Angeles timezone', ()=>{
|
|
35
|
-
const dateFormatOptions = (0, _format.dateFormatOptionsWithTimeZone)(DATE_FORMAT_OPTIONS, 'America/Los_Angeles');
|
|
36
|
-
expect(new Intl.DateTimeFormat(undefined, dateFormatOptions).format(DATE)).toBe('05:00');
|
|
37
|
-
});
|
|
38
|
-
it('should format in UTC timezone', ()=>{
|
|
39
|
-
const dateFormatOptions = (0, _format.dateFormatOptionsWithTimeZone)(DATE_FORMAT_OPTIONS, 'utc');
|
|
40
|
-
expect(new Intl.DateTimeFormat(undefined, dateFormatOptions).format(DATE)).toBe('12:00');
|
|
41
|
-
});
|
|
42
|
-
it('should use browser local timezone', ()=>{
|
|
43
|
-
expect((0, _format.dateFormatOptionsWithTimeZone)(DATE_FORMAT_OPTIONS, 'browser').timeZone).toBeUndefined();
|
|
44
|
-
expect((0, _format.dateFormatOptionsWithTimeZone)(DATE_FORMAT_OPTIONS, 'local').timeZone).toBeUndefined();
|
|
45
|
-
expect((0, _format.dateFormatOptionsWithTimeZone)(DATE_FORMAT_OPTIONS).timeZone).toBeUndefined();
|
|
46
|
-
});
|
|
47
|
-
});
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
// Copyright 2022 The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
const _material = require("@mui/material");
|
|
18
|
-
const _themeGen = require("./theme-gen");
|
|
19
|
-
describe('generateChartsTheme', ()=>{
|
|
20
|
-
const muiTheme = (0, _material.createTheme)({});
|
|
21
|
-
const echartsThemeOverrides = {
|
|
22
|
-
legend: {
|
|
23
|
-
textStyle: {
|
|
24
|
-
color: 'yellow'
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
line: {
|
|
28
|
-
showSymbol: true,
|
|
29
|
-
smooth: true
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
const chartsTheme = (0, _themeGen.generateChartsTheme)(muiTheme, echartsThemeOverrides);
|
|
33
|
-
it('should return perses specific charts theme from converted MUI theme', ()=>{
|
|
34
|
-
expect(chartsTheme).toMatchInlineSnapshot(`
|
|
35
|
-
Object {
|
|
36
|
-
"echartsTheme": Object {
|
|
37
|
-
"bar": Object {
|
|
38
|
-
"barMaxWidth": 150,
|
|
39
|
-
"itemStyle": Object {
|
|
40
|
-
"borderColor": "#e0e0e0",
|
|
41
|
-
"borderWidth": 0,
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
"categoryAxis": Object {
|
|
45
|
-
"axisLabel": Object {
|
|
46
|
-
"color": "rgba(0, 0, 0, 0.87)",
|
|
47
|
-
"margin": 15,
|
|
48
|
-
"show": true,
|
|
49
|
-
},
|
|
50
|
-
"axisLine": Object {
|
|
51
|
-
"lineStyle": Object {
|
|
52
|
-
"color": "#757575",
|
|
53
|
-
},
|
|
54
|
-
"show": true,
|
|
55
|
-
},
|
|
56
|
-
"axisTick": Object {
|
|
57
|
-
"length": 6,
|
|
58
|
-
"lineStyle": Object {
|
|
59
|
-
"color": "#757575",
|
|
60
|
-
},
|
|
61
|
-
"show": false,
|
|
62
|
-
},
|
|
63
|
-
"show": true,
|
|
64
|
-
"splitArea": Object {
|
|
65
|
-
"areaStyle": Object {
|
|
66
|
-
"color": Array [
|
|
67
|
-
"#e0e0e0",
|
|
68
|
-
],
|
|
69
|
-
},
|
|
70
|
-
"show": false,
|
|
71
|
-
},
|
|
72
|
-
"splitLine": Object {
|
|
73
|
-
"lineStyle": Object {
|
|
74
|
-
"color": "#e0e0e0",
|
|
75
|
-
"opacity": 0.6,
|
|
76
|
-
"width": 0.5,
|
|
77
|
-
},
|
|
78
|
-
"show": true,
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
"color": Array [
|
|
82
|
-
"#8dd3c7",
|
|
83
|
-
"#bebada",
|
|
84
|
-
"#fb8072",
|
|
85
|
-
"#80b1d3",
|
|
86
|
-
"#fdb462",
|
|
87
|
-
],
|
|
88
|
-
"gauge": Object {
|
|
89
|
-
"detail": Object {
|
|
90
|
-
"fontSize": 18,
|
|
91
|
-
"fontWeight": 600,
|
|
92
|
-
"valueAnimation": false,
|
|
93
|
-
},
|
|
94
|
-
"splitLine": Object {
|
|
95
|
-
"distance": 0,
|
|
96
|
-
"length": 4,
|
|
97
|
-
"lineStyle": Object {
|
|
98
|
-
"width": 1,
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
"splitNumber": 12,
|
|
102
|
-
},
|
|
103
|
-
"grid": Object {
|
|
104
|
-
"bottom": 0,
|
|
105
|
-
"containLabel": true,
|
|
106
|
-
"left": 20,
|
|
107
|
-
"right": 20,
|
|
108
|
-
"top": 5,
|
|
109
|
-
},
|
|
110
|
-
"legend": Object {
|
|
111
|
-
"orient": "horizontal",
|
|
112
|
-
"pageIconColor": "rgba(0, 0, 0, 0.54)",
|
|
113
|
-
"pageIconInactiveColor": "rgba(0, 0, 0, 0.26)",
|
|
114
|
-
"pageTextStyle": Object {
|
|
115
|
-
"color": "#757575",
|
|
116
|
-
},
|
|
117
|
-
"textStyle": Object {
|
|
118
|
-
"color": "yellow",
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
"line": Object {
|
|
122
|
-
"emphasis": Object {
|
|
123
|
-
"lineStyle": Object {
|
|
124
|
-
"width": 1.5,
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
"lineStyle": Object {
|
|
128
|
-
"width": 1,
|
|
129
|
-
},
|
|
130
|
-
"showSymbol": true,
|
|
131
|
-
"smooth": true,
|
|
132
|
-
"symbol": "circle",
|
|
133
|
-
"symbolSize": 4,
|
|
134
|
-
},
|
|
135
|
-
"textStyle": Object {
|
|
136
|
-
"color": "rgba(0, 0, 0, 0.87)",
|
|
137
|
-
"fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
|
|
138
|
-
"fontSize": 12,
|
|
139
|
-
},
|
|
140
|
-
"title": Object {
|
|
141
|
-
"show": false,
|
|
142
|
-
},
|
|
143
|
-
"toolbox": Object {
|
|
144
|
-
"iconStyle": Object {
|
|
145
|
-
"borderColor": "rgba(0, 0, 0, 0.87)",
|
|
146
|
-
},
|
|
147
|
-
"right": 10,
|
|
148
|
-
"show": true,
|
|
149
|
-
"top": 10,
|
|
150
|
-
},
|
|
151
|
-
"tooltip": Object {},
|
|
152
|
-
"valueAxis": Object {
|
|
153
|
-
"axisLabel": Object {
|
|
154
|
-
"color": "rgba(0, 0, 0, 0.87)",
|
|
155
|
-
"margin": 12,
|
|
156
|
-
},
|
|
157
|
-
"axisLine": Object {
|
|
158
|
-
"show": false,
|
|
159
|
-
},
|
|
160
|
-
"show": true,
|
|
161
|
-
"splitLine": Object {
|
|
162
|
-
"lineStyle": Object {
|
|
163
|
-
"color": "#e0e0e0",
|
|
164
|
-
"opacity": 0.6,
|
|
165
|
-
"width": 0.5,
|
|
166
|
-
},
|
|
167
|
-
"show": true,
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
"noDataOption": Object {
|
|
172
|
-
"title": Object {
|
|
173
|
-
"left": "center",
|
|
174
|
-
"show": true,
|
|
175
|
-
"text": "No data",
|
|
176
|
-
"textStyle": Object {
|
|
177
|
-
"color": "rgba(0, 0, 0, 0.87)",
|
|
178
|
-
"fontSize": 16,
|
|
179
|
-
"fontWeight": 400,
|
|
180
|
-
},
|
|
181
|
-
"top": "center",
|
|
182
|
-
},
|
|
183
|
-
"xAxis": Object {
|
|
184
|
-
"show": false,
|
|
185
|
-
},
|
|
186
|
-
"yAxis": Object {
|
|
187
|
-
"show": false,
|
|
188
|
-
},
|
|
189
|
-
},
|
|
190
|
-
"sparkline": Object {
|
|
191
|
-
"color": "#1976d2",
|
|
192
|
-
"width": 2,
|
|
193
|
-
},
|
|
194
|
-
}
|
|
195
|
-
`);
|
|
196
|
-
});
|
|
197
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"units.test.d.ts","sourceRoot":"","sources":["../../../src/model/units/units.test.ts"],"names":[],"mappings":""}
|