@perses-dev/components 0.0.0-snapshot-panel-extra-content-3-17f9c42 → 0.0.0-snapshot-scatterplot-fix-imports-95e1b59
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 +3 -4
- package/dist/BarChart/BarChart.d.ts.map +1 -1
- package/dist/BarChart/BarChart.js +17 -11
- package/dist/BarChart/BarChart.js.map +1 -1
- package/dist/BarChart/index.js.map +1 -1
- package/dist/ColorPicker/ColorPicker.d.ts +1 -2
- package/dist/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/ColorPicker/ColorPicker.js +1 -1
- package/dist/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/ColorPicker/index.js.map +1 -1
- package/dist/ContentWithLegend/ContentWithLegend.d.ts +1 -2
- package/dist/ContentWithLegend/ContentWithLegend.d.ts.map +1 -1
- package/dist/ContentWithLegend/ContentWithLegend.js +2 -2
- 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 +3 -3
- package/dist/ContentWithLegend/model/content-with-legend-model.d.ts.map +1 -1
- package/dist/ContentWithLegend/model/content-with-legend-model.js +21 -21
- package/dist/ContentWithLegend/model/content-with-legend-model.js.map +1 -1
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts +1 -2
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts.map +1 -1
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js +8 -24
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +1 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts +1 -2
- package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js +1 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts +1 -2
- package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts.map +1 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.js +2 -2
- 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.d.ts +6 -6
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +5 -5
- package/dist/Dialog/Dialog.js.map +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts +1 -2
- package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.js +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/Dialog/index.js.map +1 -1
- package/dist/Drawer/Drawer.d.ts +1 -2
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +4 -3
- package/dist/Drawer/Drawer.js.map +1 -1
- package/dist/Drawer/index.js.map +1 -1
- package/dist/EChart/EChart.d.ts +7 -7
- package/dist/EChart/EChart.d.ts.map +1 -1
- package/dist/EChart/EChart.js +3 -3
- package/dist/EChart/EChart.js.map +1 -1
- package/dist/EChart/index.js.map +1 -1
- package/dist/ErrorAlert.d.ts +1 -2
- package/dist/ErrorAlert.d.ts.map +1 -1
- package/dist/ErrorAlert.js +1 -1
- package/dist/ErrorAlert.js.map +1 -1
- package/dist/ErrorBoundary.js.map +1 -1
- package/dist/FontSizeSelector/FontSizeSelector.d.ts +2 -3
- package/dist/FontSizeSelector/FontSizeSelector.d.ts.map +1 -1
- package/dist/FontSizeSelector/FontSizeSelector.js +2 -2
- package/dist/FontSizeSelector/FontSizeSelector.js.map +1 -1
- package/dist/FontSizeSelector/index.js.map +1 -1
- package/dist/FormatControls/FormatControls.d.ts +8 -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 +6 -7
- 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.d.ts +2 -2
- package/dist/InfoTooltip/InfoTooltip.d.ts.map +1 -1
- package/dist/InfoTooltip/InfoTooltip.js +4 -4
- package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
- package/dist/InfoTooltip/index.js.map +1 -1
- package/dist/JSONEditor.d.ts +4 -4
- package/dist/JSONEditor.d.ts.map +1 -1
- package/dist/JSONEditor.js +9 -8
- package/dist/JSONEditor.js.map +1 -1
- package/dist/Legend/CompactLegend.d.ts +1 -2
- package/dist/Legend/CompactLegend.d.ts.map +1 -1
- package/dist/Legend/CompactLegend.js +1 -1
- package/dist/Legend/CompactLegend.js.map +1 -1
- package/dist/Legend/Legend.d.ts +1 -2
- package/dist/Legend/Legend.d.ts.map +1 -1
- package/dist/Legend/Legend.js +4 -4
- 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.d.ts +1 -2
- package/dist/Legend/ListLegend.d.ts.map +1 -1
- package/dist/Legend/ListLegend.js +1 -1
- package/dist/Legend/ListLegend.js.map +1 -1
- package/dist/Legend/ListLegendItem.d.ts +2 -2
- package/dist/Legend/ListLegendItem.d.ts.map +1 -1
- package/dist/Legend/ListLegendItem.js +7 -11
- package/dist/Legend/ListLegendItem.js.map +1 -1
- package/dist/Legend/TableLegend.d.ts +1 -2
- package/dist/Legend/TableLegend.d.ts.map +1 -1
- package/dist/Legend/TableLegend.js +2 -2
- package/dist/Legend/TableLegend.js.map +1 -1
- package/dist/Legend/index.js.map +1 -1
- package/dist/Legend/legend-model.d.ts +2 -2
- package/dist/Legend/legend-model.d.ts.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 +22 -24
- package/dist/LineChart/LineChart.js.map +1 -1
- package/dist/LineChart/index.js.map +1 -1
- package/dist/ModeSelector/ModeSelector.d.ts +2 -3
- package/dist/ModeSelector/ModeSelector.d.ts.map +1 -1
- package/dist/ModeSelector/ModeSelector.js +2 -2
- package/dist/ModeSelector/ModeSelector.js.map +1 -1
- package/dist/ModeSelector/index.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts +2 -2
- package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts +2 -3
- package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts +2 -2
- package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts +2 -2
- package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
- package/dist/OptionsEditorLayout/index.js.map +1 -1
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.d.ts +1 -2
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.d.ts.map +1 -1
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js +23 -7
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
- package/dist/RefreshIntervalPicker/index.js.map +1 -1
- package/dist/SettingsAutocomplete/SettingsAutocomplete.d.ts +1 -1
- package/dist/SettingsAutocomplete/SettingsAutocomplete.d.ts.map +1 -1
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js +4 -4
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
- package/dist/SettingsAutocomplete/index.js.map +1 -1
- package/dist/SortSelector/SortSelector.d.ts +2 -3
- package/dist/SortSelector/SortSelector.d.ts.map +1 -1
- package/dist/SortSelector/SortSelector.js +2 -2
- package/dist/SortSelector/SortSelector.js.map +1 -1
- package/dist/SortSelector/index.js.map +1 -1
- package/dist/StatChart/StatChart.d.ts +3 -4
- package/dist/StatChart/StatChart.d.ts.map +1 -1
- package/dist/StatChart/StatChart.js +10 -10
- package/dist/StatChart/StatChart.js.map +1 -1
- package/dist/StatChart/calculateFontSize.js +8 -8
- package/dist/StatChart/calculateFontSize.js.map +1 -1
- package/dist/StatChart/index.js.map +1 -1
- package/dist/Table/InnerTable.d.ts +2 -2
- package/dist/Table/InnerTable.d.ts.map +1 -1
- package/dist/Table/InnerTable.js +2 -2
- package/dist/Table/InnerTable.js.map +1 -1
- package/dist/Table/Table.d.ts +1 -2
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +3 -3
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/TableBody.d.ts +2 -2
- package/dist/Table/TableBody.d.ts.map +1 -1
- package/dist/Table/TableBody.js.map +1 -1
- package/dist/Table/TableCell.d.ts +1 -1
- package/dist/Table/TableCell.d.ts.map +1 -1
- package/dist/Table/TableCell.js +4 -4
- package/dist/Table/TableCell.js.map +1 -1
- package/dist/Table/TableCheckbox.d.ts +1 -2
- package/dist/Table/TableCheckbox.d.ts.map +1 -1
- package/dist/Table/TableCheckbox.js +1 -1
- package/dist/Table/TableCheckbox.js.map +1 -1
- package/dist/Table/TableHead.d.ts +2 -2
- package/dist/Table/TableHead.d.ts.map +1 -1
- package/dist/Table/TableHead.js.map +1 -1
- package/dist/Table/TableHeaderCell.d.ts +1 -2
- package/dist/Table/TableHeaderCell.d.ts.map +1 -1
- package/dist/Table/TableHeaderCell.js +1 -1
- package/dist/Table/TableHeaderCell.js.map +1 -1
- package/dist/Table/TableRow.d.ts +1 -1
- package/dist/Table/TableRow.d.ts.map +1 -1
- package/dist/Table/TableRow.js.map +1 -1
- package/dist/Table/VirtualizedTable.d.ts +2 -2
- package/dist/Table/VirtualizedTable.d.ts.map +1 -1
- package/dist/Table/VirtualizedTable.js +8 -8
- package/dist/Table/VirtualizedTable.js.map +1 -1
- package/dist/Table/VirtualizedTableContainer.d.ts +2 -2
- package/dist/Table/VirtualizedTableContainer.d.ts.map +1 -1
- package/dist/Table/VirtualizedTableContainer.js.map +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.d.ts +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.d.ts.map +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.js +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js +21 -21
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
- package/dist/Table/index.js.map +1 -1
- package/dist/Table/model/table-model.d.ts +6 -6
- package/dist/Table/model/table-model.d.ts.map +1 -1
- package/dist/Table/model/table-model.js +11 -11
- package/dist/Table/model/table-model.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts +1 -2
- package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts.map +1 -1
- package/dist/ThresholdsEditor/ThresholdColorPicker.js +4 -4
- package/dist/ThresholdsEditor/ThresholdColorPicker.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdInput.d.ts +1 -1
- package/dist/ThresholdsEditor/ThresholdInput.d.ts.map +1 -1
- package/dist/ThresholdsEditor/ThresholdInput.js +2 -2
- package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.d.ts +1 -2
- package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.js +23 -21
- 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 +110 -67
- 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 +11 -10
- package/dist/TimeSeriesTooltip/LineChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.d.ts +1 -2
- package/dist/TimeSeriesTooltip/SeriesInfo.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.js +3 -3
- package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts +1 -2
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.d.ts +1 -2
- package/dist/TimeSeriesTooltip/SeriesMarker.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.js +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 +6 -6
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.d.ts +1 -2
- package/dist/TimeSeriesTooltip/TooltipContent.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.js +2 -2
- package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.js +7 -7
- package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
- package/dist/TimeSeriesTooltip/index.js.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.d.ts +8 -8
- package/dist/TimeSeriesTooltip/nearby-series.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.js +44 -45
- package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts +13 -26
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.js +5 -11
- package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
- package/dist/TimeSeriesTooltip/utils.d.ts +1 -1
- package/dist/TimeSeriesTooltip/utils.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/utils.js +5 -4
- package/dist/TimeSeriesTooltip/utils.js.map +1 -1
- package/dist/ToolbarIconButton/ToolbarIconButton.d.ts +6 -0
- package/dist/ToolbarIconButton/ToolbarIconButton.d.ts.map +1 -0
- package/dist/ToolbarIconButton/ToolbarIconButton.js +32 -0
- package/dist/ToolbarIconButton/ToolbarIconButton.js.map +1 -0
- package/dist/ToolbarIconButton/index.d.ts +2 -0
- package/dist/ToolbarIconButton/index.d.ts.map +1 -0
- package/dist/ToolbarIconButton/index.js +15 -0
- package/dist/ToolbarIconButton/index.js.map +1 -0
- package/dist/YAxisLabel.d.ts +1 -2
- package/dist/YAxisLabel.d.ts.map +1 -1
- package/dist/YAxisLabel.js +1 -1
- package/dist/YAxisLabel.js.map +1 -1
- package/dist/cjs/BarChart/BarChart.js +25 -17
- package/dist/cjs/BarChart/index.js +10 -8
- package/dist/cjs/ColorPicker/ColorPicker.js +19 -15
- package/dist/cjs/ColorPicker/index.js +10 -8
- package/dist/cjs/ContentWithLegend/ContentWithLegend.js +13 -11
- package/dist/cjs/ContentWithLegend/index.js +10 -8
- package/dist/cjs/ContentWithLegend/model/content-with-legend-model.js +29 -25
- package/dist/cjs/DateTimeRangePicker/AbsoluteTimePicker.js +30 -44
- package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +13 -11
- package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +14 -12
- package/dist/cjs/DateTimeRangePicker/index.js +12 -10
- package/dist/cjs/DateTimeRangePicker/utils.js +9 -5
- package/dist/cjs/Dialog/Dialog.js +16 -14
- package/dist/cjs/Dialog/DiscardChangesConfirmationDialog.js +12 -10
- package/dist/cjs/Dialog/index.js +11 -9
- package/dist/cjs/Drawer/Drawer.js +8 -5
- package/dist/cjs/Drawer/index.js +10 -8
- package/dist/cjs/EChart/EChart.js +16 -12
- package/dist/cjs/EChart/index.js +10 -8
- package/dist/cjs/ErrorAlert.js +6 -4
- package/dist/cjs/ErrorBoundary.js +4 -2
- package/dist/cjs/FontSizeSelector/FontSizeSelector.js +10 -8
- 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 +16 -14
- package/dist/cjs/InfoTooltip/index.js +10 -8
- package/dist/cjs/JSONEditor.js +19 -16
- package/dist/cjs/Legend/CompactLegend.js +10 -8
- package/dist/cjs/Legend/Legend.js +16 -14
- package/dist/cjs/Legend/LegendColorBadge.js +8 -6
- package/dist/cjs/Legend/ListLegend.js +11 -9
- package/dist/cjs/Legend/ListLegendItem.js +20 -20
- package/dist/cjs/Legend/TableLegend.js +8 -6
- package/dist/cjs/Legend/index.js +11 -9
- package/dist/cjs/Legend/legend-model.js +3 -1
- package/dist/cjs/LineChart/LineChart.js +31 -31
- package/dist/cjs/LineChart/index.js +10 -8
- package/dist/cjs/ModeSelector/ModeSelector.js +10 -8
- package/dist/cjs/ModeSelector/index.js +10 -8
- package/dist/cjs/OptionsEditorLayout/OptionsEditorColumn.js +7 -5
- package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +17 -15
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGrid.js +6 -4
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +12 -10
- package/dist/cjs/OptionsEditorLayout/index.js +13 -11
- package/dist/cjs/RefreshIntervalPicker/RefreshIntervalPicker.js +28 -10
- package/dist/cjs/RefreshIntervalPicker/index.js +10 -8
- package/dist/cjs/SettingsAutocomplete/SettingsAutocomplete.js +13 -11
- package/dist/cjs/SettingsAutocomplete/index.js +10 -8
- package/dist/cjs/SortSelector/SortSelector.js +10 -8
- package/dist/cjs/SortSelector/index.js +10 -8
- package/dist/cjs/StatChart/StatChart.js +22 -20
- package/dist/cjs/StatChart/calculateFontSize.js +11 -9
- package/dist/cjs/StatChart/index.js +10 -8
- package/dist/cjs/Table/InnerTable.js +7 -5
- package/dist/cjs/Table/Table.js +18 -16
- package/dist/cjs/Table/TableBody.js +5 -3
- package/dist/cjs/Table/TableCell.js +12 -10
- package/dist/cjs/Table/TableCheckbox.js +6 -4
- package/dist/cjs/Table/TableHead.js +5 -3
- package/dist/cjs/Table/TableHeaderCell.js +9 -7
- package/dist/cjs/Table/TableRow.js +5 -3
- package/dist/cjs/Table/VirtualizedTable.js +34 -32
- package/dist/cjs/Table/VirtualizedTableContainer.js +5 -3
- package/dist/cjs/Table/hooks/useTableKeyboardNav.js +4 -2
- package/dist/cjs/Table/hooks/useVirtualizedTableKeyboardNav.js +24 -22
- package/dist/cjs/Table/index.js +14 -10
- package/dist/cjs/Table/model/table-model.js +17 -13
- package/dist/cjs/ThresholdsEditor/ThresholdColorPicker.js +17 -15
- package/dist/cjs/ThresholdsEditor/ThresholdInput.js +15 -13
- package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +50 -44
- package/dist/cjs/ThresholdsEditor/index.js +10 -8
- package/dist/cjs/TimeChart/TimeChart.js +123 -78
- package/dist/cjs/TimeChart/index.js +10 -8
- package/dist/cjs/TimeSeriesTooltip/LineChartTooltip.js +31 -28
- package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +18 -16
- package/dist/cjs/TimeSeriesTooltip/SeriesLabelsStack.js +16 -14
- package/dist/cjs/TimeSeriesTooltip/SeriesMarker.js +6 -4
- package/dist/cjs/TimeSeriesTooltip/TimeChartTooltip.js +23 -21
- package/dist/cjs/TimeSeriesTooltip/TooltipContent.js +9 -7
- package/dist/cjs/TimeSeriesTooltip/TooltipHeader.js +35 -33
- package/dist/cjs/TimeSeriesTooltip/index.js +19 -17
- package/dist/cjs/TimeSeriesTooltip/nearby-series.js +70 -53
- package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +56 -28
- package/dist/cjs/TimeSeriesTooltip/utils.js +19 -14
- package/dist/cjs/ToolbarIconButton/ToolbarIconButton.js +40 -0
- package/dist/cjs/ToolbarIconButton/index.js +30 -0
- package/dist/cjs/YAxisLabel.js +7 -5
- package/dist/cjs/context/{ChartsThemeProvider.js → ChartsProvider.js} +41 -12
- package/dist/cjs/context/SnackbarProvider.js +7 -3
- package/dist/cjs/context/TimeZoneProvider.js +17 -9
- package/dist/cjs/context/index.js +32 -0
- package/dist/cjs/index.js +42 -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 +38 -19
- package/dist/cjs/theme/component-overrides/alert.js +7 -5
- package/dist/cjs/theme/component-overrides/paper.js +4 -2
- 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 +6 -4
- package/dist/cjs/theme/typography.js +3 -1
- package/dist/cjs/utils/axis.js +11 -7
- package/dist/cjs/utils/chart-actions.js +68 -12
- 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 +4 -2
- package/dist/cjs/utils/theme-gen.js +16 -18
- 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.d.ts +2 -2
- package/dist/context/SnackbarProvider.d.ts.map +1 -1
- package/dist/context/SnackbarProvider.js +1 -1
- package/dist/context/SnackbarProvider.js.map +1 -1
- package/dist/context/TimeZoneProvider.d.ts +1 -1
- package/dist/context/TimeZoneProvider.d.ts.map +1 -1
- package/dist/context/TimeZoneProvider.js +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 +3 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/model/graph.d.ts +8 -8
- package/dist/model/graph.d.ts.map +1 -1
- package/dist/model/graph.js.map +1 -1
- package/dist/model/index.js.map +1 -1
- package/dist/model/theme.d.ts +1 -1
- package/dist/model/theme.d.ts.map +1 -1
- package/dist/model/theme.js.map +1 -1
- package/dist/model/timeOption.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 +25 -16
- package/dist/test-utils/theme.js.map +1 -1
- package/dist/theme/component-overrides/alert.js +4 -4
- package/dist/theme/component-overrides/alert.js.map +1 -1
- package/dist/theme/component-overrides/paper.js +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/colors/types.d.ts +1 -1
- package/dist/theme/palette/colors/types.d.ts.map +1 -1
- package/dist/theme/palette/colors/types.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 +1 -1
- package/dist/theme/theme.js.map +1 -1
- package/dist/theme/types/ThemeExtension.d.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 +6 -2
- package/dist/utils/chart-actions.d.ts.map +1 -1
- package/dist/utils/chart-actions.js +51 -7
- 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 +1 -1
- package/dist/utils/mathjs.js.map +1 -1
- package/dist/utils/theme-gen.d.ts +3 -8
- package/dist/utils/theme-gen.d.ts.map +1 -1
- package/dist/utils/theme-gen.js +11 -15
- package/dist/utils/theme-gen.js.map +1 -1
- package/package.json +8 -7
- 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
|
@@ -14,15 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
function
|
|
17
|
+
_export_star(require("./palette-options"), 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,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "getPaletteOptions", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return getPaletteOptions;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const _text = require("./text");
|
|
22
24
|
const _background = require("./background");
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "primary", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return primary;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const _colors = require("./colors");
|
|
22
24
|
const primary = (mode)=>{
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "secondary", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return secondary;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const _colors = require("./colors");
|
|
22
24
|
const secondary = (mode)=>{
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "success", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return success;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const _colors = require("./colors");
|
|
22
24
|
const success = (mode)=>{
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "warning", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return warning;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const _colors = require("./colors");
|
|
22
24
|
const warning = (mode)=>{
|
package/dist/cjs/theme/theme.js
CHANGED
|
@@ -16,14 +16,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "getTheme", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return getTheme;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const _material = require("@mui/material");
|
|
22
24
|
const _alert = require("./component-overrides/alert");
|
|
23
25
|
const _paper = require("./component-overrides/paper");
|
|
24
|
-
const
|
|
26
|
+
const _paletteoptions = require("./palette/palette-options");
|
|
25
27
|
const _typography = require("./typography");
|
|
26
|
-
const getModalBackgroundStyle = ({ theme
|
|
28
|
+
const getModalBackgroundStyle = ({ theme })=>{
|
|
27
29
|
const backgroundStyle = theme.palette.mode === 'light' ? {} : {
|
|
28
30
|
backgroundImage: 'unset',
|
|
29
31
|
backgroundColor: theme.palette.designSystem.grey[800]
|
|
@@ -34,7 +36,7 @@ const getModalBackgroundStyle = ({ theme })=>{
|
|
|
34
36
|
};
|
|
35
37
|
function getTheme(mode) {
|
|
36
38
|
const theme = (0, _material.createTheme)({
|
|
37
|
-
palette: (0,
|
|
39
|
+
palette: (0, _paletteoptions.getPaletteOptions)(mode),
|
|
38
40
|
typography: _typography.typography,
|
|
39
41
|
mixins: {},
|
|
40
42
|
components
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "typography", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return typography;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
require("@fontsource/lato/300.css");
|
|
22
24
|
require("@fontsource/lato/400.css");
|
package/dist/cjs/utils/axis.js
CHANGED
|
@@ -21,19 +21,23 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
getDateRange: function() {
|
|
25
|
+
return getDateRange;
|
|
26
|
+
},
|
|
27
|
+
getFormattedAxis: function() {
|
|
28
|
+
return getFormattedAxis;
|
|
29
|
+
}
|
|
26
30
|
});
|
|
27
|
-
const _merge = /*#__PURE__*/
|
|
31
|
+
const _merge = /*#__PURE__*/ _interop_require_default(require("lodash/merge"));
|
|
28
32
|
const _core = require("@perses-dev/core");
|
|
29
|
-
function
|
|
33
|
+
function _interop_require_default(obj) {
|
|
30
34
|
return obj && obj.__esModule ? obj : {
|
|
31
35
|
default: obj
|
|
32
36
|
};
|
|
33
37
|
}
|
|
34
|
-
function
|
|
38
|
+
function getFormattedAxis(axis, unit) {
|
|
35
39
|
// TODO: support alternate yAxis that shows on right side
|
|
36
|
-
const
|
|
40
|
+
const AXIS_DEFAULT = {
|
|
37
41
|
type: 'value',
|
|
38
42
|
boundaryGap: [
|
|
39
43
|
0,
|
|
@@ -46,7 +50,7 @@ function getYAxes(yAxis, unit) {
|
|
|
46
50
|
}
|
|
47
51
|
};
|
|
48
52
|
return [
|
|
49
|
-
(0, _merge.default)(
|
|
53
|
+
(0, _merge.default)(AXIS_DEFAULT, axis)
|
|
50
54
|
];
|
|
51
55
|
}
|
|
52
56
|
function getDateRange(data) {
|
|
@@ -21,12 +21,32 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
batchDispatchNearbySeriesActions: function() {
|
|
25
|
+
return batchDispatchNearbySeriesActions;
|
|
26
|
+
},
|
|
27
|
+
checkCrosshairPinnedStatus: function() {
|
|
28
|
+
return checkCrosshairPinnedStatus;
|
|
29
|
+
},
|
|
30
|
+
clearHighlightedSeries: function() {
|
|
31
|
+
return clearHighlightedSeries;
|
|
32
|
+
},
|
|
33
|
+
enableDataZoom: function() {
|
|
34
|
+
return enableDataZoom;
|
|
35
|
+
},
|
|
36
|
+
getClosestTimestamp: function() {
|
|
37
|
+
return getClosestTimestamp;
|
|
38
|
+
},
|
|
39
|
+
getClosestTimestampInFullDataset: function() {
|
|
40
|
+
return getClosestTimestampInFullDataset;
|
|
41
|
+
},
|
|
42
|
+
getPointInGrid: function() {
|
|
43
|
+
return getPointInGrid;
|
|
44
|
+
},
|
|
45
|
+
restoreChart: function() {
|
|
46
|
+
return restoreChart;
|
|
47
|
+
}
|
|
29
48
|
});
|
|
49
|
+
const _model = require("../model");
|
|
30
50
|
function enableDataZoom(chart) {
|
|
31
51
|
const chartModel = chart['_model'];
|
|
32
52
|
if (chartModel === undefined) return;
|
|
@@ -47,14 +67,16 @@ function restoreChart(chart) {
|
|
|
47
67
|
type: 'restore'
|
|
48
68
|
});
|
|
49
69
|
}
|
|
50
|
-
function clearHighlightedSeries(chart
|
|
70
|
+
function clearHighlightedSeries(chart) {
|
|
51
71
|
if (chart.dispatchAction !== undefined) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
72
|
+
// Clear any selected data points
|
|
73
|
+
chart.dispatchAction({
|
|
74
|
+
type: 'unselect'
|
|
75
|
+
});
|
|
76
|
+
// Clear any highlighted series
|
|
77
|
+
chart.dispatchAction({
|
|
78
|
+
type: 'downplay'
|
|
79
|
+
});
|
|
58
80
|
}
|
|
59
81
|
}
|
|
60
82
|
function getPointInGrid(cursorCoordX, cursorCoordY, chart) {
|
|
@@ -115,3 +137,37 @@ function batchDispatchNearbySeriesActions(chart, nearbySeriesIndexes, emphasized
|
|
|
115
137
|
});
|
|
116
138
|
}
|
|
117
139
|
}
|
|
140
|
+
function checkCrosshairPinnedStatus(seriesMapping) {
|
|
141
|
+
var _seriesMapping_;
|
|
142
|
+
const isCrosshairPinned = ((_seriesMapping_ = seriesMapping[seriesMapping.length - 1]) === null || _seriesMapping_ === void 0 ? void 0 : _seriesMapping_.name) === _model.PINNED_CROSSHAIR_SERIES_NAME;
|
|
143
|
+
return isCrosshairPinned;
|
|
144
|
+
}
|
|
145
|
+
function getClosestTimestamp(timeSeriesValues, cursorX) {
|
|
146
|
+
if (timeSeriesValues === undefined || cursorX === undefined) {
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
let currentClosestTimestamp = null;
|
|
150
|
+
let currentClosestDistance = Infinity;
|
|
151
|
+
for (const [timestamp] of timeSeriesValues){
|
|
152
|
+
const distance = Math.abs(timestamp - cursorX);
|
|
153
|
+
if (distance < currentClosestDistance) {
|
|
154
|
+
currentClosestTimestamp = timestamp;
|
|
155
|
+
currentClosestDistance = distance;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return currentClosestTimestamp;
|
|
159
|
+
}
|
|
160
|
+
function getClosestTimestampInFullDataset(data, cursorX) {
|
|
161
|
+
if (cursorX === undefined) {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
const totalSeries = data.length;
|
|
165
|
+
let closestTimestamp = null;
|
|
166
|
+
for(let seriesIdx = 0; seriesIdx < totalSeries; seriesIdx++){
|
|
167
|
+
const currentDataset = totalSeries > 0 ? data[seriesIdx] : null;
|
|
168
|
+
if (currentDataset == null) break;
|
|
169
|
+
const currentValues = currentDataset.values;
|
|
170
|
+
closestTimestamp = getClosestTimestamp(currentValues, cursorX);
|
|
171
|
+
}
|
|
172
|
+
return closestTimestamp;
|
|
173
|
+
}
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "combineSx", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return combineSx;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
function combineSx(...sxProps) {
|
|
22
24
|
return sxProps.flatMap((sx)=>{
|
package/dist/cjs/utils/format.js
CHANGED
|
@@ -21,13 +21,21 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
dateFormatOptionsWithTimeZone: ()
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
dateFormatOptionsWithTimeZone: function() {
|
|
25
|
+
return dateFormatOptionsWithTimeZone;
|
|
26
|
+
},
|
|
27
|
+
formatWithTimeZone: function() {
|
|
28
|
+
return formatWithTimeZone;
|
|
29
|
+
},
|
|
30
|
+
getFormattedAxisLabel: function() {
|
|
31
|
+
return getFormattedAxisLabel;
|
|
32
|
+
},
|
|
33
|
+
getFormattedDate: function() {
|
|
34
|
+
return getFormattedDate;
|
|
35
|
+
}
|
|
28
36
|
});
|
|
29
|
-
const
|
|
30
|
-
const
|
|
37
|
+
const _datefnstz = require("date-fns-tz");
|
|
38
|
+
const _datefns = require("date-fns");
|
|
31
39
|
function dateFormatOptionsWithTimeZone(dateFormatOptions, timeZone) {
|
|
32
40
|
/*
|
|
33
41
|
* if timeZone is provided, and is not local|browser,
|
|
@@ -51,9 +59,9 @@ function formatWithTimeZone(date, formatString, timeZone) {
|
|
|
51
59
|
* otherwise, format without timeZone option, defaulting to browser timeZone setting
|
|
52
60
|
*/ const lowerTimeZone = timeZone === null || timeZone === void 0 ? void 0 : timeZone.toLowerCase();
|
|
53
61
|
if (!timeZone || lowerTimeZone === 'local' || lowerTimeZone === 'browser') {
|
|
54
|
-
return (0,
|
|
62
|
+
return (0, _datefns.format)(date, formatString);
|
|
55
63
|
} else {
|
|
56
|
-
return (0,
|
|
64
|
+
return (0, _datefnstz.formatInTimeZone)(date, lowerTimeZone === 'utc' ? 'UTC' : timeZone, formatString);
|
|
57
65
|
}
|
|
58
66
|
}
|
|
59
67
|
function getFormattedDate(value, rangeMs, timeZone) {
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -14,20 +14,22 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
function
|
|
17
|
+
_export_star(require("./axis"), exports);
|
|
18
|
+
_export_star(require("./chart-actions"), exports);
|
|
19
|
+
_export_star(require("./combine-sx"), exports);
|
|
20
|
+
_export_star(require("./component-ids"), exports);
|
|
21
|
+
_export_star(require("./format"), exports);
|
|
22
|
+
_export_star(require("./theme-gen"), exports);
|
|
23
|
+
function _export_star(from, to) {
|
|
24
24
|
Object.keys(from).forEach(function(k) {
|
|
25
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
26
|
+
Object.defineProperty(to, k, {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function() {
|
|
29
|
+
return from[k];
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
31
33
|
});
|
|
32
34
|
return from;
|
|
33
35
|
}
|
package/dist/cjs/utils/mathjs.js
CHANGED
|
@@ -16,10 +16,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "round", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return round;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const _mathjs = require("mathjs");
|
|
22
24
|
// This ensures we get a minimal mathjs bundle for just what we need (see https://mathjs.org/docs/custom_bundling.html)
|
|
23
|
-
const { round
|
|
25
|
+
const { round } = (0, _mathjs.create)({
|
|
24
26
|
roundDependencies: _mathjs.roundDependencies
|
|
25
27
|
});
|
|
@@ -16,22 +16,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "generateChartsTheme", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return generateChartsTheme;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const _merge = /*#__PURE__*/
|
|
22
|
-
function
|
|
23
|
+
const _merge = /*#__PURE__*/ _interop_require_default(require("lodash/merge"));
|
|
24
|
+
function _interop_require_default(obj) {
|
|
23
25
|
return obj && obj.__esModule ? obj : {
|
|
24
26
|
default: obj
|
|
25
27
|
};
|
|
26
28
|
}
|
|
27
29
|
const DEFAULT_TEXT_COLOR = '#222';
|
|
28
|
-
function generateChartsTheme(muiTheme,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var ref, ref1, ref2, ref3, ref4, ref5, ref6;
|
|
33
|
-
var ref7;
|
|
34
|
-
const primaryTextColor = (ref7 = (ref = muiTheme.palette.text) === null || ref === void 0 ? void 0 : ref.primary) !== null && ref7 !== void 0 ? ref7 : DEFAULT_TEXT_COLOR;
|
|
30
|
+
function generateChartsTheme(muiTheme, persesChartsThemeOverride) {
|
|
31
|
+
var _muiTheme_palette_text, _muiTheme_palette_action, _muiTheme_palette, _muiTheme_palette_action1, _muiTheme_palette1, _muiTheme_palette_designSystem, _muiTheme_palette_designSystem1;
|
|
32
|
+
var _muiTheme_palette_text_primary;
|
|
33
|
+
const primaryTextColor = (_muiTheme_palette_text_primary = (_muiTheme_palette_text = muiTheme.palette.text) === null || _muiTheme_palette_text === void 0 ? void 0 : _muiTheme_palette_text.primary) !== null && _muiTheme_palette_text_primary !== void 0 ? _muiTheme_palette_text_primary : DEFAULT_TEXT_COLOR;
|
|
35
34
|
const muiConvertedTheme = {
|
|
36
35
|
title: {
|
|
37
36
|
show: false
|
|
@@ -158,8 +157,8 @@ function generateChartsTheme(muiTheme, echartsTheme, /**
|
|
|
158
157
|
pageTextStyle: {
|
|
159
158
|
color: muiTheme.palette.grey[600]
|
|
160
159
|
},
|
|
161
|
-
pageIconColor: muiTheme === null || muiTheme === void 0 ? void 0 : (
|
|
162
|
-
pageIconInactiveColor: muiTheme === null || muiTheme === void 0 ? void 0 : (
|
|
160
|
+
pageIconColor: muiTheme === null || muiTheme === void 0 ? void 0 : (_muiTheme_palette = muiTheme.palette) === null || _muiTheme_palette === void 0 ? void 0 : (_muiTheme_palette_action = _muiTheme_palette.action) === null || _muiTheme_palette_action === void 0 ? void 0 : _muiTheme_palette_action.active,
|
|
161
|
+
pageIconInactiveColor: muiTheme === null || muiTheme === void 0 ? void 0 : (_muiTheme_palette1 = muiTheme.palette) === null || _muiTheme_palette1 === void 0 ? void 0 : (_muiTheme_palette_action1 = _muiTheme_palette1.action) === null || _muiTheme_palette_action1 === void 0 ? void 0 : _muiTheme_palette_action1.disabled
|
|
163
162
|
},
|
|
164
163
|
toolbox: {
|
|
165
164
|
show: true,
|
|
@@ -170,8 +169,8 @@ function generateChartsTheme(muiTheme, echartsTheme, /**
|
|
|
170
169
|
}
|
|
171
170
|
},
|
|
172
171
|
tooltip: {
|
|
173
|
-
backgroundColor: (
|
|
174
|
-
borderColor: (
|
|
172
|
+
backgroundColor: (_muiTheme_palette_designSystem = muiTheme.palette.designSystem) === null || _muiTheme_palette_designSystem === void 0 ? void 0 : _muiTheme_palette_designSystem.grey[800],
|
|
173
|
+
borderColor: (_muiTheme_palette_designSystem1 = muiTheme.palette.designSystem) === null || _muiTheme_palette_designSystem1 === void 0 ? void 0 : _muiTheme_palette_designSystem1.grey[800],
|
|
175
174
|
textStyle: {
|
|
176
175
|
color: '#fff',
|
|
177
176
|
fontSize: 11
|
|
@@ -235,9 +234,8 @@ function generateChartsTheme(muiTheme, echartsTheme, /**
|
|
|
235
234
|
splitNumber: 12
|
|
236
235
|
}
|
|
237
236
|
};
|
|
238
|
-
return {
|
|
239
|
-
|
|
240
|
-
echartsTheme: (0, _merge.default)(muiConvertedTheme, echartsTheme),
|
|
237
|
+
return (0, _merge.default)({
|
|
238
|
+
echartsTheme: muiConvertedTheme,
|
|
241
239
|
noDataOption: {
|
|
242
240
|
title: {
|
|
243
241
|
show: true,
|
|
@@ -274,5 +272,5 @@ function generateChartsTheme(muiTheme, echartsTheme, /**
|
|
|
274
272
|
muiTheme.palette.error.main
|
|
275
273
|
]
|
|
276
274
|
}
|
|
277
|
-
};
|
|
275
|
+
}, persesChartsThemeOverride);
|
|
278
276
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PersesChartsTheme } from '../model';
|
|
3
|
+
import { CursorCoordinates } from '../TimeSeriesTooltip';
|
|
4
|
+
export interface ChartsProviderProps {
|
|
5
|
+
chartsTheme: PersesChartsTheme;
|
|
6
|
+
enablePinning?: boolean;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface SharedChartsState {
|
|
10
|
+
chartsTheme: PersesChartsTheme;
|
|
11
|
+
enablePinning: boolean;
|
|
12
|
+
lastTooltipPinnedCoords: CursorCoordinates | null;
|
|
13
|
+
setLastTooltipPinnedCoords: (lastTooltipPinnedCoords: CursorCoordinates | null) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function ChartsProvider(props: ChartsProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const ChartsThemeContext: React.Context<SharedChartsState | undefined>;
|
|
17
|
+
export declare function useChartsContext(): SharedChartsState;
|
|
18
|
+
export declare function useChartsTheme(): PersesChartsTheme;
|
|
19
|
+
//# sourceMappingURL=ChartsProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartsProvider.d.ts","sourceRoot":"","sources":["../../src/context/ChartsProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,iBAAiB,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,iBAAiB,CAAC;IAC/B,aAAa,EAAE,OAAO,CAAC;IACvB,uBAAuB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClD,0BAA0B,EAAE,CAAC,uBAAuB,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;CACzF;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CAexD;AAED,eAAO,MAAM,kBAAkB,8CAA0D,CAAC;AAE1F,wBAAgB,gBAAgB,IAAI,iBAAiB,CAMpD;AAED,wBAAgB,cAAc,IAAI,iBAAiB,CAGlD"}
|
|
@@ -11,21 +11,39 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import React, { createContext, useContext } from 'react';
|
|
15
|
-
export function
|
|
16
|
-
const { children ,
|
|
14
|
+
import React, { createContext, useContext, useMemo, useState } from 'react';
|
|
15
|
+
export function ChartsProvider(props) {
|
|
16
|
+
const { children, chartsTheme, enablePinning = false } = props;
|
|
17
|
+
const [lastTooltipPinnedCoords, setLastTooltipPinnedCoords] = useState(null);
|
|
18
|
+
const ctx = useMemo(()=>{
|
|
19
|
+
return {
|
|
20
|
+
chartsTheme,
|
|
21
|
+
enablePinning,
|
|
22
|
+
lastTooltipPinnedCoords,
|
|
23
|
+
setLastTooltipPinnedCoords
|
|
24
|
+
};
|
|
25
|
+
}, [
|
|
26
|
+
chartsTheme,
|
|
27
|
+
enablePinning,
|
|
28
|
+
lastTooltipPinnedCoords,
|
|
29
|
+
setLastTooltipPinnedCoords
|
|
30
|
+
]);
|
|
17
31
|
return /*#__PURE__*/ _jsx(ChartsThemeContext.Provider, {
|
|
18
|
-
value:
|
|
32
|
+
value: ctx,
|
|
19
33
|
children: children
|
|
20
34
|
});
|
|
21
35
|
}
|
|
22
36
|
export const ChartsThemeContext = /*#__PURE__*/ createContext(undefined);
|
|
23
|
-
export function
|
|
37
|
+
export function useChartsContext() {
|
|
24
38
|
const ctx = useContext(ChartsThemeContext);
|
|
25
39
|
if (ctx === undefined) {
|
|
26
40
|
throw new Error('No ChartsThemeContext found. Did you forget a Provider?');
|
|
27
41
|
}
|
|
28
42
|
return ctx;
|
|
29
43
|
}
|
|
44
|
+
export function useChartsTheme() {
|
|
45
|
+
const ctx = useChartsContext();
|
|
46
|
+
return ctx.chartsTheme;
|
|
47
|
+
}
|
|
30
48
|
|
|
31
|
-
//# sourceMappingURL=
|
|
49
|
+
//# sourceMappingURL=ChartsProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/context/ChartsProvider.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React, { createContext, useContext, useMemo, useState } from 'react';\nimport { PersesChartsTheme } from '../model';\nimport { CursorCoordinates } from '../TimeSeriesTooltip';\n\nexport interface ChartsProviderProps {\n chartsTheme: PersesChartsTheme;\n enablePinning?: boolean;\n children?: React.ReactNode;\n}\n\nexport interface SharedChartsState {\n chartsTheme: PersesChartsTheme;\n enablePinning: boolean;\n lastTooltipPinnedCoords: CursorCoordinates | null;\n setLastTooltipPinnedCoords: (lastTooltipPinnedCoords: CursorCoordinates | null) => void;\n}\n\nexport function ChartsProvider(props: ChartsProviderProps) {\n const { children, chartsTheme, enablePinning = false } = props;\n\n const [lastTooltipPinnedCoords, setLastTooltipPinnedCoords] = useState<CursorCoordinates | null>(null);\n\n const ctx = useMemo(() => {\n return {\n chartsTheme,\n enablePinning,\n lastTooltipPinnedCoords,\n setLastTooltipPinnedCoords,\n };\n }, [chartsTheme, enablePinning, lastTooltipPinnedCoords, setLastTooltipPinnedCoords]);\n\n return <ChartsThemeContext.Provider value={ctx}>{children}</ChartsThemeContext.Provider>;\n}\n\nexport const ChartsThemeContext = createContext<SharedChartsState | undefined>(undefined);\n\nexport function useChartsContext(): SharedChartsState {\n const ctx = useContext(ChartsThemeContext);\n if (ctx === undefined) {\n throw new Error('No ChartsThemeContext found. Did you forget a Provider?');\n }\n return ctx;\n}\n\nexport function useChartsTheme(): PersesChartsTheme {\n const ctx = useChartsContext();\n return ctx.chartsTheme;\n}\n"],"names":["React","createContext","useContext","useMemo","useState","ChartsProvider","props","children","chartsTheme","enablePinning","lastTooltipPinnedCoords","setLastTooltipPinnedCoords","ctx","ChartsThemeContext","Provider","value","undefined","useChartsContext","Error","useChartsTheme"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,OAAOA,SAASC,aAAa,EAAEC,UAAU,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAQ;AAiB5E,OAAO,SAASC,eAAeC,KAA0B;IACvD,MAAM,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,gBAAgB,KAAK,EAAE,GAAGH;IAEzD,MAAM,CAACI,yBAAyBC,2BAA2B,GAAGP,SAAmC;IAEjG,MAAMQ,MAAMT,QAAQ;QAClB,OAAO;YACLK;YACAC;YACAC;YACAC;QACF;IACF,GAAG;QAACH;QAAaC;QAAeC;QAAyBC;KAA2B;IAEpF,qBAAO,KAACE,mBAAmBC,QAAQ;QAACC,OAAOH;kBAAML;;AACnD;AAEA,OAAO,MAAMM,mCAAqBZ,cAA6Ce,WAAW;AAE1F,OAAO,SAASC;IACd,MAAML,MAAMV,WAAWW;IACvB,IAAID,QAAQI,WAAW;QACrB,MAAM,IAAIE,MAAM;IAClB;IACA,OAAON;AACT;AAEA,OAAO,SAASO;IACd,MAAMP,MAAMK;IACZ,OAAOL,IAAIJ,WAAW;AACxB"}
|
|
@@ -10,8 +10,8 @@ export interface SnackbarContext extends NotistackContext {
|
|
|
10
10
|
*/
|
|
11
11
|
exceptionSnackbar: (error: unknown, options?: SnackbarOptions) => SnackbarKey;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
type EnqueueFunction = (message: SnackbarMessage, options?: SnackbarOptions) => SnackbarKey;
|
|
14
|
+
type SnackbarOptions = Omit<OptionsObject, 'variant'>;
|
|
15
15
|
/**
|
|
16
16
|
* Application-wide provider for showing snackbars/toasts.
|
|
17
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SnackbarProvider.d.ts","sourceRoot":"","sources":["../../src/context/SnackbarProvider.tsx"],"names":[],"mappings":"AAcA,OAAO,EACL,gBAAgB,IAAI,iBAAiB,EACrC,eAAe,IAAI,gBAAgB,EAEnC,eAAe,EACf,aAAa,EACb,WAAW,EACZ,MAAM,WAAW,CAAC;AAEnB,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD,aAAa,EAAE,eAAe,CAAC;IAC/B,YAAY,EAAE,eAAe,CAAC;IAC9B,eAAe,EAAE,eAAe,CAAC;IACjC,eAAe,EAAE,eAAe,CAAC;IAEjC;;;OAGG;IACH,iBAAiB,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,KAAK,WAAW,CAAC;CAC/E;AAED,
|
|
1
|
+
{"version":3,"file":"SnackbarProvider.d.ts","sourceRoot":"","sources":["../../src/context/SnackbarProvider.tsx"],"names":[],"mappings":"AAcA,OAAO,EACL,gBAAgB,IAAI,iBAAiB,EACrC,eAAe,IAAI,gBAAgB,EAEnC,eAAe,EACf,aAAa,EACb,WAAW,EACZ,MAAM,WAAW,CAAC;AAEnB,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD,aAAa,EAAE,eAAe,CAAC;IAC/B,YAAY,EAAE,eAAe,CAAC;IAC9B,eAAe,EAAE,eAAe,CAAC;IACjC,eAAe,EAAE,eAAe,CAAC;IAEjC;;;OAGG;IACH,iBAAiB,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,KAAK,WAAW,CAAC;CAC/E;AAED,KAAK,eAAe,GAAG,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,eAAe,KAAK,WAAW,CAAC;AAE5F,KAAK,eAAe,GAAG,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;AAEtD;;GAEG;AACH,OAAO,EAAE,iBAAiB,IAAI,gBAAgB,EAAE,CAAC;AAEjD;;GAEG;AACH,wBAAgB,WAAW,IAAI,eAAe,CA6B7C"}
|
|
@@ -18,7 +18,7 @@ import { SnackbarProvider as NotistackProvider, useSnackbar as useNotistack } fr
|
|
|
18
18
|
/**
|
|
19
19
|
* Gets the SnackbarContext with methods for displaying snackbars/toasts.
|
|
20
20
|
*/ export function useSnackbar() {
|
|
21
|
-
const { enqueueSnackbar
|
|
21
|
+
const { enqueueSnackbar, closeSnackbar } = useNotistack();
|
|
22
22
|
// Create variant-specific callbacks
|
|
23
23
|
const errorSnackbar = useEnqueueFunction(enqueueSnackbar, 'error');
|
|
24
24
|
const infoSnackbar = useEnqueueFunction(enqueueSnackbar, 'info');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/context/SnackbarProvider.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useCallback } from 'react';\nimport {\n SnackbarProvider as NotistackProvider,\n ProviderContext as NotistackContext,\n useSnackbar as useNotistack,\n SnackbarMessage,\n OptionsObject,\n SnackbarKey,\n} from 'notistack';\n\nexport interface SnackbarContext extends NotistackContext {\n errorSnackbar: EnqueueFunction;\n infoSnackbar: EnqueueFunction;\n warningSnackbar: EnqueueFunction;\n successSnackbar: EnqueueFunction;\n\n /**\n * Useful for catch blocks where the error will be of type `unknown`, tries\n * to show the `message` property if passed an instance of `Error`.\n */\n exceptionSnackbar: (error: unknown, options?: SnackbarOptions) => SnackbarKey;\n}\n\ntype EnqueueFunction = (message: SnackbarMessage, options?: SnackbarOptions) => SnackbarKey;\n\ntype SnackbarOptions = Omit<OptionsObject, 'variant'>;\n\n/**\n * Application-wide provider for showing snackbars/toasts.\n */\nexport { NotistackProvider as SnackbarProvider };\n\n/**\n * Gets the SnackbarContext with methods for displaying snackbars/toasts.\n */\nexport function useSnackbar(): SnackbarContext {\n const { enqueueSnackbar, closeSnackbar } = useNotistack();\n\n // Create variant-specific callbacks\n const errorSnackbar = useEnqueueFunction(enqueueSnackbar, 'error');\n const infoSnackbar = useEnqueueFunction(enqueueSnackbar, 'info');\n const warningSnackbar = useEnqueueFunction(enqueueSnackbar, 'warning');\n const successSnackbar = useEnqueueFunction(enqueueSnackbar, 'success');\n\n const exceptionSnackbar: SnackbarContext['exceptionSnackbar'] = useCallback(\n (error, options) => {\n // Try to use message prop, but fallback to a default message that\n // will just stringify the error provided\n const message = error instanceof Error ? error.message : `An unexpected error occurred: ${error}`;\n\n return errorSnackbar(message, options);\n },\n [errorSnackbar]\n );\n\n return {\n enqueueSnackbar,\n closeSnackbar,\n errorSnackbar,\n infoSnackbar,\n warningSnackbar,\n successSnackbar,\n exceptionSnackbar,\n };\n}\n\n// Helper to create a variant-specific enqueue function\nfunction useEnqueueFunction(\n enqueueSnackbar: NotistackContext['enqueueSnackbar'],\n variant: OptionsObject['variant']\n): EnqueueFunction {\n return useCallback(\n (message, options) => {\n const allOptions: OptionsObject = {\n ...options,\n variant,\n };\n return enqueueSnackbar(message, allOptions);\n },\n [enqueueSnackbar, variant]\n );\n}\n"],"names":["useCallback","SnackbarProvider","NotistackProvider","useSnackbar","useNotistack","enqueueSnackbar","closeSnackbar","errorSnackbar","useEnqueueFunction","infoSnackbar","warningSnackbar","successSnackbar","exceptionSnackbar","error","options","message","Error","variant","allOptions"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,WAAW,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../../src/context/SnackbarProvider.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useCallback } from 'react';\nimport {\n SnackbarProvider as NotistackProvider,\n ProviderContext as NotistackContext,\n useSnackbar as useNotistack,\n SnackbarMessage,\n OptionsObject,\n SnackbarKey,\n} from 'notistack';\n\nexport interface SnackbarContext extends NotistackContext {\n errorSnackbar: EnqueueFunction;\n infoSnackbar: EnqueueFunction;\n warningSnackbar: EnqueueFunction;\n successSnackbar: EnqueueFunction;\n\n /**\n * Useful for catch blocks where the error will be of type `unknown`, tries\n * to show the `message` property if passed an instance of `Error`.\n */\n exceptionSnackbar: (error: unknown, options?: SnackbarOptions) => SnackbarKey;\n}\n\ntype EnqueueFunction = (message: SnackbarMessage, options?: SnackbarOptions) => SnackbarKey;\n\ntype SnackbarOptions = Omit<OptionsObject, 'variant'>;\n\n/**\n * Application-wide provider for showing snackbars/toasts.\n */\nexport { NotistackProvider as SnackbarProvider };\n\n/**\n * Gets the SnackbarContext with methods for displaying snackbars/toasts.\n */\nexport function useSnackbar(): SnackbarContext {\n const { enqueueSnackbar, closeSnackbar } = useNotistack();\n\n // Create variant-specific callbacks\n const errorSnackbar = useEnqueueFunction(enqueueSnackbar, 'error');\n const infoSnackbar = useEnqueueFunction(enqueueSnackbar, 'info');\n const warningSnackbar = useEnqueueFunction(enqueueSnackbar, 'warning');\n const successSnackbar = useEnqueueFunction(enqueueSnackbar, 'success');\n\n const exceptionSnackbar: SnackbarContext['exceptionSnackbar'] = useCallback(\n (error, options) => {\n // Try to use message prop, but fallback to a default message that\n // will just stringify the error provided\n const message = error instanceof Error ? error.message : `An unexpected error occurred: ${error}`;\n\n return errorSnackbar(message, options);\n },\n [errorSnackbar]\n );\n\n return {\n enqueueSnackbar,\n closeSnackbar,\n errorSnackbar,\n infoSnackbar,\n warningSnackbar,\n successSnackbar,\n exceptionSnackbar,\n };\n}\n\n// Helper to create a variant-specific enqueue function\nfunction useEnqueueFunction(\n enqueueSnackbar: NotistackContext['enqueueSnackbar'],\n variant: OptionsObject['variant']\n): EnqueueFunction {\n return useCallback(\n (message, options) => {\n const allOptions: OptionsObject = {\n ...options,\n variant,\n };\n return enqueueSnackbar(message, allOptions);\n },\n [enqueueSnackbar, variant]\n );\n}\n"],"names":["useCallback","SnackbarProvider","NotistackProvider","useSnackbar","useNotistack","enqueueSnackbar","closeSnackbar","errorSnackbar","useEnqueueFunction","infoSnackbar","warningSnackbar","successSnackbar","exceptionSnackbar","error","options","message","Error","variant","allOptions"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,WAAW,QAAQ,QAAQ;AACpC,SACEC,oBAAoBC,iBAAiB,EAErCC,eAAeC,YAAY,QAItB,YAAY;AAmBnB;;CAEC,GACD,SAASF,qBAAqBD,gBAAgB,GAAG;AAEjD;;CAEC,GACD,OAAO,SAASE;IACd,MAAM,EAAEE,eAAe,EAAEC,aAAa,EAAE,GAAGF;IAE3C,oCAAoC;IACpC,MAAMG,gBAAgBC,mBAAmBH,iBAAiB;IAC1D,MAAMI,eAAeD,mBAAmBH,iBAAiB;IACzD,MAAMK,kBAAkBF,mBAAmBH,iBAAiB;IAC5D,MAAMM,kBAAkBH,mBAAmBH,iBAAiB;IAE5D,MAAMO,oBAA0DZ,YAC9D,CAACa,OAAOC;QACN,kEAAkE;QAClE,yCAAyC;QACzC,MAAMC,UAAUF,iBAAiBG,QAAQH,MAAME,OAAO,GAAG,CAAC,8BAA8B,EAAEF,MAAM,CAAC;QAEjG,OAAON,cAAcQ,SAASD;IAChC,GACA;QAACP;KAAc;IAGjB,OAAO;QACLF;QACAC;QACAC;QACAE;QACAC;QACAC;QACAC;IACF;AACF;AAEA,uDAAuD;AACvD,SAASJ,mBACPH,eAAoD,EACpDY,OAAiC;IAEjC,OAAOjB,YACL,CAACe,SAASD;QACR,MAAMI,aAA4B;YAChC,GAAGJ,OAAO;YACVG;QACF;QACA,OAAOZ,gBAAgBU,SAASG;IAClC,GACA;QAACb;QAAiBY;KAAQ;AAE9B"}
|
|
@@ -4,7 +4,7 @@ export interface TimeZoneProviderProps {
|
|
|
4
4
|
timeZone?: string;
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
}
|
|
7
|
-
export declare function TimeZoneProvider(props: TimeZoneProviderProps): JSX.Element;
|
|
7
|
+
export declare function TimeZoneProvider(props: TimeZoneProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export declare function useTimeZone(): {
|
|
9
9
|
timeZone: string;
|
|
10
10
|
formatWithUserTimeZone(date: Date, formatString: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeZoneProvider.d.ts","sourceRoot":"","sources":["../../src/context/TimeZoneProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAGzD,eAAO,MAAM,eAAe,mCAA+C,CAAC;AAE5E,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"TimeZoneProvider.d.ts","sourceRoot":"","sources":["../../src/context/TimeZoneProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAGzD,eAAO,MAAM,eAAe,mCAA+C,CAAC;AAE5E,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,2CAG5D;AAED,wBAAgB,WAAW;;iCAKM,IAAI,gBAAgB,MAAM;yDAGF,KAAK,qBAAqB;EAIlF"}
|
|
@@ -15,7 +15,7 @@ import React, { createContext, useContext } from 'react';
|
|
|
15
15
|
import { formatWithTimeZone, dateFormatOptionsWithTimeZone } from '../utils';
|
|
16
16
|
export const TimeZoneContext = /*#__PURE__*/ createContext(undefined);
|
|
17
17
|
export function TimeZoneProvider(props) {
|
|
18
|
-
const { children
|
|
18
|
+
const { children, timeZone } = props;
|
|
19
19
|
return /*#__PURE__*/ _jsx(TimeZoneContext.Provider, {
|
|
20
20
|
value: timeZone,
|
|
21
21
|
children: children
|