@perses-dev/components 0.52.0-beta.1 → 0.52.0-beta.2
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/Legend/ListLegend.d.ts.map +1 -1
- package/dist/src/AlignSelector/AlignSelector.js.map +1 -0
- package/dist/{TransformsEditor → src/AlignSelector}/index.js.map +1 -1
- package/dist/src/ColorPicker/ColorPicker.js.map +1 -0
- package/dist/src/ColorPicker/OptionsColorPicker.js.map +1 -0
- package/dist/src/ColorPicker/index.js.map +1 -0
- package/dist/src/ContentWithLegend/ContentWithLegend.js.map +1 -0
- package/dist/{SettingsAutocomplete → src/ContentWithLegend}/index.js.map +1 -1
- package/dist/src/ContentWithLegend/model/content-with-legend-model.js.map +1 -0
- package/dist/src/DensitySelector/DensitySelector.js.map +1 -0
- package/dist/{ValueMappingEditor → src/DensitySelector}/index.js.map +1 -1
- package/dist/src/Dialog/Dialog.js.map +1 -0
- package/dist/src/Dialog/DiscardChangesConfirmationDialog.js.map +1 -0
- package/dist/{test-utils → src/Dialog}/index.js.map +1 -1
- package/dist/src/DragAndDrop/DragAndDropList.js.map +1 -0
- package/dist/src/DragAndDrop/DragButton.js.map +1 -0
- package/dist/src/DragAndDrop/DropIndicator.js.map +1 -0
- package/dist/src/DragAndDrop/index.js.map +1 -0
- package/dist/src/DragAndDrop/model.js.map +1 -0
- package/dist/src/Drawer/Drawer.js.map +1 -0
- package/dist/src/Drawer/index.js.map +1 -0
- package/dist/src/EChart/EChart.js.map +1 -0
- package/dist/src/EChart/index.js.map +1 -0
- package/dist/src/ErrorAlert.js.map +1 -0
- package/dist/{context/index.js.map → src/ErrorBoundary.js.map} +1 -1
- package/dist/src/FontSizeSelector/FontSizeSelector.js.map +1 -0
- package/dist/{OptionsEditorLayout → src/FontSizeSelector}/index.js.map +1 -1
- package/dist/src/FormEditor/FormActions.js.map +1 -0
- package/dist/{AlignSelector → src/FormEditor}/index.js.map +1 -1
- package/dist/src/FormatControls/FormatControls.js.map +1 -0
- package/dist/{ContentWithLegend → src/FormatControls}/index.js.map +1 -1
- package/dist/src/InfoTooltip/InfoTooltip.js.map +1 -0
- package/dist/{FormatControls → src/InfoTooltip}/index.js.map +1 -1
- package/dist/src/JSONEditor.js.map +1 -0
- package/dist/src/Legend/CompactLegend.js.map +1 -0
- package/dist/src/Legend/Legend.js.map +1 -0
- package/dist/src/Legend/LegendColorBadge.js.map +1 -0
- package/dist/src/Legend/ListLegend.js.map +1 -0
- package/dist/src/Legend/ListLegendItem.js.map +1 -0
- package/dist/src/Legend/TableLegend.js.map +1 -0
- package/dist/src/Legend/index.js.map +1 -0
- package/dist/src/Legend/legend-model.js.map +1 -0
- package/dist/src/LinksEditor/LinksEditor.js.map +1 -0
- package/dist/src/LinksEditor/index.js.map +1 -0
- package/dist/src/ModeSelector/ModeSelector.js.map +1 -0
- package/dist/src/ModeSelector/index.js.map +1 -0
- package/dist/src/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -0
- package/dist/src/OptionsEditorLayout/OptionsEditorControl.js.map +1 -0
- package/dist/src/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -0
- package/dist/src/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -0
- package/dist/src/OptionsEditorLayout/index.js.map +1 -0
- package/dist/src/Overlay/Overlay.js.map +1 -0
- package/dist/{FormEditor → src/Overlay}/index.js.map +1 -1
- package/dist/src/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -0
- package/dist/src/RefreshIntervalPicker/index.js.map +1 -0
- package/dist/src/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -0
- package/dist/src/SettingsAutocomplete/index.js.map +1 -0
- package/dist/src/SortSelector/SortSelector.js.map +1 -0
- package/dist/src/SortSelector/SortSelectorButtons.js.map +1 -0
- package/dist/{DensitySelector → src/SortSelector}/index.js.map +1 -1
- package/dist/src/Table/InnerTable.js.map +1 -0
- package/dist/src/Table/Table.js.map +1 -0
- package/dist/src/Table/TableBody.js.map +1 -0
- package/dist/src/Table/TableCell.js.map +1 -0
- package/dist/src/Table/TableCheckbox.js.map +1 -0
- package/dist/src/Table/TableFoot.js.map +1 -0
- package/dist/src/Table/TableHead.js.map +1 -0
- package/dist/src/Table/TableHeaderCell.js.map +1 -0
- package/dist/src/Table/TableRow.js.map +1 -0
- package/dist/src/Table/VirtualizedTable.js.map +1 -0
- package/dist/src/Table/VirtualizedTableContainer.js.map +1 -0
- package/dist/src/Table/hooks/useTableKeyboardNav.js.map +1 -0
- package/dist/src/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -0
- package/dist/{controls → src/Table}/index.js.map +1 -1
- package/dist/src/Table/model/table-model.js.map +1 -0
- package/dist/src/ThresholdsEditor/ThresholdInput.js.map +1 -0
- package/dist/src/ThresholdsEditor/ThresholdsEditor.js.map +1 -0
- package/dist/src/ThresholdsEditor/index.js.map +1 -0
- package/dist/src/TimeRangeSelector/DateTimeRangePicker.js.map +1 -0
- package/dist/src/TimeRangeSelector/TimeRangeSelector.js.map +1 -0
- package/dist/src/TimeRangeSelector/index.js.map +1 -0
- package/dist/src/TimeRangeSelector/utils.js.map +1 -0
- package/dist/src/TimeSeriesTooltip/SeriesInfo.js.map +1 -0
- package/dist/src/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -0
- package/dist/src/TimeSeriesTooltip/SeriesMarker.js.map +1 -0
- package/dist/src/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -0
- package/dist/src/TimeSeriesTooltip/TooltipContent.js.map +1 -0
- package/dist/src/TimeSeriesTooltip/TooltipHeader.js.map +1 -0
- package/dist/src/TimeSeriesTooltip/index.js.map +1 -0
- package/dist/src/TimeSeriesTooltip/nearby-series.js.map +1 -0
- package/dist/src/TimeSeriesTooltip/tooltip-model.js.map +1 -0
- package/dist/src/TimeSeriesTooltip/utils.js.map +1 -0
- package/dist/src/ToolbarIconButton/ToolbarIconButton.js.map +1 -0
- package/dist/src/ToolbarIconButton/index.js.map +1 -0
- package/dist/src/TransformsEditor/TransformEditor.js.map +1 -0
- package/dist/src/TransformsEditor/TransformEditorContainer.js.map +1 -0
- package/dist/src/TransformsEditor/TransformsEditor.js.map +1 -0
- package/dist/src/TransformsEditor/index.js.map +1 -0
- package/dist/src/ValueMappingEditor/ValueMappingEditor.js.map +1 -0
- package/dist/src/ValueMappingEditor/ValueMappingsEditor.js.map +1 -0
- package/dist/{RefreshIntervalPicker → src/ValueMappingEditor}/index.js.map +1 -1
- package/dist/src/YAxisLabel.js.map +1 -0
- package/dist/src/context/ChartsProvider.js.map +1 -0
- package/dist/src/context/SnackbarProvider.js.map +1 -0
- package/dist/src/context/TimeZoneProvider.js.map +1 -0
- package/dist/{test/setup-tests.js.map → src/context/index.js.map} +1 -1
- package/dist/src/controls/TextField.js.map +1 -0
- package/dist/{LinksEditor → src/controls}/index.js.map +1 -1
- package/dist/src/index.js.map +1 -0
- package/dist/src/model/graph.js.map +1 -0
- package/dist/src/model/index.js.map +1 -0
- package/dist/src/model/theme.js.map +1 -0
- package/dist/src/model/timeOption.js.map +1 -0
- package/dist/{Dialog → src/test}/index.js.map +1 -1
- package/dist/src/test/render.js.map +1 -0
- package/dist/src/test/setup-tests.js.map +1 -0
- package/dist/src/test-utils/index.js.map +1 -0
- package/dist/src/test-utils/theme.js.map +1 -0
- package/dist/src/theme/component-overrides/alert.js.map +1 -0
- package/dist/src/theme/component-overrides/paper.js.map +1 -0
- package/dist/src/theme/index.js.map +1 -0
- package/dist/src/theme/palette/background.js.map +1 -0
- package/dist/src/theme/palette/colors/blue.js.map +1 -0
- package/dist/src/theme/palette/colors/common.js.map +1 -0
- package/dist/src/theme/palette/colors/green.js.map +1 -0
- package/dist/src/theme/palette/colors/grey.js.map +1 -0
- package/dist/src/theme/palette/colors/index.js.map +1 -0
- package/dist/src/theme/palette/colors/orange.js.map +1 -0
- package/dist/src/theme/palette/colors/purple.js.map +1 -0
- package/dist/src/theme/palette/colors/red.js.map +1 -0
- package/dist/src/theme/palette/colors/types.js.map +1 -0
- package/dist/src/theme/palette/error.js.map +1 -0
- package/dist/src/theme/palette/grey.js.map +1 -0
- package/dist/src/theme/palette/index.js.map +1 -0
- package/dist/src/theme/palette/palette-options.js.map +1 -0
- package/dist/src/theme/palette/primary.js.map +1 -0
- package/dist/src/theme/palette/secondary.js.map +1 -0
- package/dist/src/theme/palette/success.js.map +1 -0
- package/dist/src/theme/palette/text.js.map +1 -0
- package/dist/src/theme/palette/warning.js.map +1 -0
- package/dist/src/theme/theme.js.map +1 -0
- package/dist/src/theme/types/ThemeExtension.d.js.map +1 -0
- package/dist/src/theme/typography.js.map +1 -0
- package/dist/src/utils/axis.js.map +1 -0
- package/dist/src/utils/chart-actions.js.map +1 -0
- package/dist/src/utils/combine-sx.js.map +1 -0
- package/dist/src/utils/component-ids.js.map +1 -0
- package/dist/src/utils/format.js.map +1 -0
- package/dist/src/utils/index.js.map +1 -0
- package/dist/src/utils/mathjs.js.map +1 -0
- package/dist/src/utils/theme-gen.js.map +1 -0
- package/package.json +2 -2
- package/dist/AlignSelector/AlignSelector.js.map +0 -1
- package/dist/ColorPicker/ColorPicker.js.map +0 -1
- package/dist/ColorPicker/OptionsColorPicker.js.map +0 -1
- package/dist/ColorPicker/index.js.map +0 -1
- package/dist/ContentWithLegend/ContentWithLegend.js.map +0 -1
- package/dist/ContentWithLegend/model/content-with-legend-model.js.map +0 -1
- package/dist/DensitySelector/DensitySelector.js.map +0 -1
- package/dist/Dialog/Dialog.js.map +0 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +0 -1
- package/dist/DragAndDrop/DragAndDropList.js.map +0 -1
- package/dist/DragAndDrop/DragButton.js.map +0 -1
- package/dist/DragAndDrop/DropIndicator.js.map +0 -1
- package/dist/DragAndDrop/index.js.map +0 -1
- package/dist/DragAndDrop/model.js.map +0 -1
- package/dist/Drawer/Drawer.js.map +0 -1
- package/dist/Drawer/index.js.map +0 -1
- package/dist/EChart/EChart.js.map +0 -1
- package/dist/EChart/index.js.map +0 -1
- package/dist/ErrorAlert.js.map +0 -1
- package/dist/ErrorBoundary.js.map +0 -1
- package/dist/FontSizeSelector/FontSizeSelector.js.map +0 -1
- package/dist/FontSizeSelector/index.js.map +0 -1
- package/dist/FormEditor/FormActions.js.map +0 -1
- package/dist/FormatControls/FormatControls.js.map +0 -1
- package/dist/InfoTooltip/InfoTooltip.js.map +0 -1
- package/dist/InfoTooltip/index.js.map +0 -1
- package/dist/JSONEditor.js.map +0 -1
- package/dist/Legend/CompactLegend.js.map +0 -1
- package/dist/Legend/Legend.js.map +0 -1
- package/dist/Legend/LegendColorBadge.js.map +0 -1
- package/dist/Legend/ListLegend.js.map +0 -1
- package/dist/Legend/ListLegendItem.js.map +0 -1
- package/dist/Legend/TableLegend.js.map +0 -1
- package/dist/Legend/index.js.map +0 -1
- package/dist/Legend/legend-model.js.map +0 -1
- package/dist/LinksEditor/LinksEditor.js.map +0 -1
- package/dist/ModeSelector/ModeSelector.js.map +0 -1
- package/dist/ModeSelector/index.js.map +0 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +0 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +0 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +0 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +0 -1
- package/dist/Overlay/Overlay.js.map +0 -1
- package/dist/Overlay/index.js.map +0 -1
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +0 -1
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +0 -1
- package/dist/SortSelector/SortSelector.js.map +0 -1
- package/dist/SortSelector/SortSelectorButtons.js.map +0 -1
- package/dist/SortSelector/index.js.map +0 -1
- package/dist/Table/InnerTable.js.map +0 -1
- package/dist/Table/Table.js.map +0 -1
- package/dist/Table/TableBody.js.map +0 -1
- package/dist/Table/TableCell.js.map +0 -1
- package/dist/Table/TableCheckbox.js.map +0 -1
- package/dist/Table/TableFoot.js.map +0 -1
- package/dist/Table/TableHead.js.map +0 -1
- package/dist/Table/TableHeaderCell.js.map +0 -1
- package/dist/Table/TableRow.js.map +0 -1
- package/dist/Table/VirtualizedTable.js.map +0 -1
- package/dist/Table/VirtualizedTableContainer.js.map +0 -1
- package/dist/Table/hooks/useTableKeyboardNav.js.map +0 -1
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +0 -1
- package/dist/Table/index.js.map +0 -1
- package/dist/Table/model/table-model.js.map +0 -1
- package/dist/ThresholdsEditor/ThresholdInput.js.map +0 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.js.map +0 -1
- package/dist/ThresholdsEditor/index.js.map +0 -1
- package/dist/TimeRangeSelector/DateTimeRangePicker.js.map +0 -1
- package/dist/TimeRangeSelector/TimeRangeSelector.js.map +0 -1
- package/dist/TimeRangeSelector/index.js.map +0 -1
- package/dist/TimeRangeSelector/utils.js.map +0 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.js.map +0 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +0 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.js.map +0 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +0 -1
- package/dist/TimeSeriesTooltip/TooltipContent.js.map +0 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.js.map +0 -1
- package/dist/TimeSeriesTooltip/index.js.map +0 -1
- package/dist/TimeSeriesTooltip/nearby-series.js.map +0 -1
- package/dist/TimeSeriesTooltip/tooltip-model.js.map +0 -1
- package/dist/TimeSeriesTooltip/utils.js.map +0 -1
- package/dist/ToolbarIconButton/ToolbarIconButton.js.map +0 -1
- package/dist/ToolbarIconButton/index.js.map +0 -1
- package/dist/TransformsEditor/TransformEditor.js.map +0 -1
- package/dist/TransformsEditor/TransformEditorContainer.js.map +0 -1
- package/dist/TransformsEditor/TransformsEditor.js.map +0 -1
- package/dist/ValueMappingEditor/ValueMappingEditor.js.map +0 -1
- package/dist/ValueMappingEditor/ValueMappingsEditor.js.map +0 -1
- package/dist/YAxisLabel.js.map +0 -1
- package/dist/context/ChartsProvider.js.map +0 -1
- package/dist/context/SnackbarProvider.js.map +0 -1
- package/dist/context/TimeZoneProvider.js.map +0 -1
- package/dist/controls/TextField.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/model/graph.js.map +0 -1
- package/dist/model/index.js.map +0 -1
- package/dist/model/theme.js.map +0 -1
- package/dist/model/timeOption.js.map +0 -1
- package/dist/test/index.js.map +0 -1
- package/dist/test/render.js.map +0 -1
- package/dist/test-utils/theme.js.map +0 -1
- package/dist/theme/component-overrides/alert.js.map +0 -1
- package/dist/theme/component-overrides/paper.js.map +0 -1
- package/dist/theme/index.js.map +0 -1
- package/dist/theme/palette/background.js.map +0 -1
- package/dist/theme/palette/colors/blue.js.map +0 -1
- package/dist/theme/palette/colors/common.js.map +0 -1
- package/dist/theme/palette/colors/green.js.map +0 -1
- package/dist/theme/palette/colors/grey.js.map +0 -1
- package/dist/theme/palette/colors/index.js.map +0 -1
- package/dist/theme/palette/colors/orange.js.map +0 -1
- package/dist/theme/palette/colors/purple.js.map +0 -1
- package/dist/theme/palette/colors/red.js.map +0 -1
- package/dist/theme/palette/colors/types.js.map +0 -1
- package/dist/theme/palette/error.js.map +0 -1
- package/dist/theme/palette/grey.js.map +0 -1
- package/dist/theme/palette/index.js.map +0 -1
- package/dist/theme/palette/palette-options.js.map +0 -1
- package/dist/theme/palette/primary.js.map +0 -1
- package/dist/theme/palette/secondary.js.map +0 -1
- package/dist/theme/palette/success.js.map +0 -1
- package/dist/theme/palette/text.js.map +0 -1
- package/dist/theme/palette/warning.js.map +0 -1
- package/dist/theme/theme.js.map +0 -1
- package/dist/theme/types/ThemeExtension.d.js.map +0 -1
- package/dist/theme/typography.js.map +0 -1
- package/dist/utils/axis.js.map +0 -1
- package/dist/utils/chart-actions.js.map +0 -1
- package/dist/utils/combine-sx.js.map +0 -1
- package/dist/utils/component-ids.js.map +0 -1
- package/dist/utils/format.js.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/mathjs.js.map +0 -1
- package/dist/utils/theme-gen.js.map +0 -1
- /package/dist/cjs/{AlignSelector → src/AlignSelector}/AlignSelector.js +0 -0
- /package/dist/cjs/{AlignSelector → src/AlignSelector}/index.js +0 -0
- /package/dist/cjs/{ColorPicker → src/ColorPicker}/ColorPicker.js +0 -0
- /package/dist/cjs/{ColorPicker → src/ColorPicker}/OptionsColorPicker.js +0 -0
- /package/dist/cjs/{ColorPicker → src/ColorPicker}/index.js +0 -0
- /package/dist/cjs/{ContentWithLegend → src/ContentWithLegend}/ContentWithLegend.js +0 -0
- /package/dist/cjs/{ContentWithLegend → src/ContentWithLegend}/index.js +0 -0
- /package/dist/cjs/{ContentWithLegend → src/ContentWithLegend}/model/content-with-legend-model.js +0 -0
- /package/dist/cjs/{DensitySelector → src/DensitySelector}/DensitySelector.js +0 -0
- /package/dist/cjs/{DensitySelector → src/DensitySelector}/index.js +0 -0
- /package/dist/cjs/{Dialog → src/Dialog}/Dialog.js +0 -0
- /package/dist/cjs/{Dialog → src/Dialog}/DiscardChangesConfirmationDialog.js +0 -0
- /package/dist/cjs/{Dialog → src/Dialog}/index.js +0 -0
- /package/dist/cjs/{DragAndDrop → src/DragAndDrop}/DragAndDropList.js +0 -0
- /package/dist/cjs/{DragAndDrop → src/DragAndDrop}/DragButton.js +0 -0
- /package/dist/cjs/{DragAndDrop → src/DragAndDrop}/DropIndicator.js +0 -0
- /package/dist/cjs/{DragAndDrop → src/DragAndDrop}/index.js +0 -0
- /package/dist/cjs/{DragAndDrop → src/DragAndDrop}/model.js +0 -0
- /package/dist/cjs/{Drawer → src/Drawer}/Drawer.js +0 -0
- /package/dist/cjs/{Drawer → src/Drawer}/index.js +0 -0
- /package/dist/cjs/{EChart → src/EChart}/EChart.js +0 -0
- /package/dist/cjs/{EChart → src/EChart}/index.js +0 -0
- /package/dist/cjs/{ErrorAlert.js → src/ErrorAlert.js} +0 -0
- /package/dist/cjs/{ErrorBoundary.js → src/ErrorBoundary.js} +0 -0
- /package/dist/cjs/{FontSizeSelector → src/FontSizeSelector}/FontSizeSelector.js +0 -0
- /package/dist/cjs/{FontSizeSelector → src/FontSizeSelector}/index.js +0 -0
- /package/dist/cjs/{FormEditor → src/FormEditor}/FormActions.js +0 -0
- /package/dist/cjs/{FormEditor → src/FormEditor}/index.js +0 -0
- /package/dist/cjs/{FormatControls → src/FormatControls}/FormatControls.js +0 -0
- /package/dist/cjs/{FormatControls → src/FormatControls}/index.js +0 -0
- /package/dist/cjs/{InfoTooltip → src/InfoTooltip}/InfoTooltip.js +0 -0
- /package/dist/cjs/{InfoTooltip → src/InfoTooltip}/index.js +0 -0
- /package/dist/cjs/{JSONEditor.js → src/JSONEditor.js} +0 -0
- /package/dist/cjs/{Legend → src/Legend}/CompactLegend.js +0 -0
- /package/dist/cjs/{Legend → src/Legend}/Legend.js +0 -0
- /package/dist/cjs/{Legend → src/Legend}/LegendColorBadge.js +0 -0
- /package/dist/cjs/{Legend → src/Legend}/ListLegend.js +0 -0
- /package/dist/cjs/{Legend → src/Legend}/ListLegendItem.js +0 -0
- /package/dist/cjs/{Legend → src/Legend}/TableLegend.js +0 -0
- /package/dist/cjs/{Legend → src/Legend}/index.js +0 -0
- /package/dist/cjs/{Legend → src/Legend}/legend-model.js +0 -0
- /package/dist/cjs/{LinksEditor → src/LinksEditor}/LinksEditor.js +0 -0
- /package/dist/cjs/{LinksEditor → src/LinksEditor}/index.js +0 -0
- /package/dist/cjs/{ModeSelector → src/ModeSelector}/ModeSelector.js +0 -0
- /package/dist/cjs/{ModeSelector → src/ModeSelector}/index.js +0 -0
- /package/dist/cjs/{OptionsEditorLayout → src/OptionsEditorLayout}/OptionsEditorColumn.js +0 -0
- /package/dist/cjs/{OptionsEditorLayout → src/OptionsEditorLayout}/OptionsEditorControl.js +0 -0
- /package/dist/cjs/{OptionsEditorLayout → src/OptionsEditorLayout}/OptionsEditorGrid.js +0 -0
- /package/dist/cjs/{OptionsEditorLayout → src/OptionsEditorLayout}/OptionsEditorGroup.js +0 -0
- /package/dist/cjs/{OptionsEditorLayout → src/OptionsEditorLayout}/index.js +0 -0
- /package/dist/cjs/{Overlay → src/Overlay}/Overlay.js +0 -0
- /package/dist/cjs/{Overlay → src/Overlay}/index.js +0 -0
- /package/dist/cjs/{RefreshIntervalPicker → src/RefreshIntervalPicker}/RefreshIntervalPicker.js +0 -0
- /package/dist/cjs/{RefreshIntervalPicker → src/RefreshIntervalPicker}/index.js +0 -0
- /package/dist/cjs/{SettingsAutocomplete → src/SettingsAutocomplete}/SettingsAutocomplete.js +0 -0
- /package/dist/cjs/{SettingsAutocomplete → src/SettingsAutocomplete}/index.js +0 -0
- /package/dist/cjs/{SortSelector → src/SortSelector}/SortSelector.js +0 -0
- /package/dist/cjs/{SortSelector → src/SortSelector}/SortSelectorButtons.js +0 -0
- /package/dist/cjs/{SortSelector → src/SortSelector}/index.js +0 -0
- /package/dist/cjs/{Table → src/Table}/InnerTable.js +0 -0
- /package/dist/cjs/{Table → src/Table}/Table.js +0 -0
- /package/dist/cjs/{Table → src/Table}/TableBody.js +0 -0
- /package/dist/cjs/{Table → src/Table}/TableCell.js +0 -0
- /package/dist/cjs/{Table → src/Table}/TableCheckbox.js +0 -0
- /package/dist/cjs/{Table → src/Table}/TableFoot.js +0 -0
- /package/dist/cjs/{Table → src/Table}/TableHead.js +0 -0
- /package/dist/cjs/{Table → src/Table}/TableHeaderCell.js +0 -0
- /package/dist/cjs/{Table → src/Table}/TableRow.js +0 -0
- /package/dist/cjs/{Table → src/Table}/VirtualizedTable.js +0 -0
- /package/dist/cjs/{Table → src/Table}/VirtualizedTableContainer.js +0 -0
- /package/dist/cjs/{Table → src/Table}/hooks/useTableKeyboardNav.js +0 -0
- /package/dist/cjs/{Table → src/Table}/hooks/useVirtualizedTableKeyboardNav.js +0 -0
- /package/dist/cjs/{Table → src/Table}/index.js +0 -0
- /package/dist/cjs/{Table → src/Table}/model/table-model.js +0 -0
- /package/dist/cjs/{ThresholdsEditor → src/ThresholdsEditor}/ThresholdInput.js +0 -0
- /package/dist/cjs/{ThresholdsEditor → src/ThresholdsEditor}/ThresholdsEditor.js +0 -0
- /package/dist/cjs/{ThresholdsEditor → src/ThresholdsEditor}/index.js +0 -0
- /package/dist/cjs/{TimeRangeSelector → src/TimeRangeSelector}/DateTimeRangePicker.js +0 -0
- /package/dist/cjs/{TimeRangeSelector → src/TimeRangeSelector}/TimeRangeSelector.js +0 -0
- /package/dist/cjs/{TimeRangeSelector → src/TimeRangeSelector}/index.js +0 -0
- /package/dist/cjs/{TimeRangeSelector → src/TimeRangeSelector}/utils.js +0 -0
- /package/dist/cjs/{TimeSeriesTooltip → src/TimeSeriesTooltip}/SeriesInfo.js +0 -0
- /package/dist/cjs/{TimeSeriesTooltip → src/TimeSeriesTooltip}/SeriesLabelsStack.js +0 -0
- /package/dist/cjs/{TimeSeriesTooltip → src/TimeSeriesTooltip}/SeriesMarker.js +0 -0
- /package/dist/cjs/{TimeSeriesTooltip → src/TimeSeriesTooltip}/TimeChartTooltip.js +0 -0
- /package/dist/cjs/{TimeSeriesTooltip → src/TimeSeriesTooltip}/TooltipContent.js +0 -0
- /package/dist/cjs/{TimeSeriesTooltip → src/TimeSeriesTooltip}/TooltipHeader.js +0 -0
- /package/dist/cjs/{TimeSeriesTooltip → src/TimeSeriesTooltip}/index.js +0 -0
- /package/dist/cjs/{TimeSeriesTooltip → src/TimeSeriesTooltip}/nearby-series.js +0 -0
- /package/dist/cjs/{TimeSeriesTooltip → src/TimeSeriesTooltip}/tooltip-model.js +0 -0
- /package/dist/cjs/{TimeSeriesTooltip → src/TimeSeriesTooltip}/utils.js +0 -0
- /package/dist/cjs/{ToolbarIconButton → src/ToolbarIconButton}/ToolbarIconButton.js +0 -0
- /package/dist/cjs/{ToolbarIconButton → src/ToolbarIconButton}/index.js +0 -0
- /package/dist/cjs/{TransformsEditor → src/TransformsEditor}/TransformEditor.js +0 -0
- /package/dist/cjs/{TransformsEditor → src/TransformsEditor}/TransformEditorContainer.js +0 -0
- /package/dist/cjs/{TransformsEditor → src/TransformsEditor}/TransformsEditor.js +0 -0
- /package/dist/cjs/{TransformsEditor → src/TransformsEditor}/index.js +0 -0
- /package/dist/cjs/{ValueMappingEditor → src/ValueMappingEditor}/ValueMappingEditor.js +0 -0
- /package/dist/cjs/{ValueMappingEditor → src/ValueMappingEditor}/ValueMappingsEditor.js +0 -0
- /package/dist/cjs/{ValueMappingEditor → src/ValueMappingEditor}/index.js +0 -0
- /package/dist/cjs/{YAxisLabel.js → src/YAxisLabel.js} +0 -0
- /package/dist/cjs/{context → src/context}/ChartsProvider.js +0 -0
- /package/dist/cjs/{context → src/context}/SnackbarProvider.js +0 -0
- /package/dist/cjs/{context → src/context}/TimeZoneProvider.js +0 -0
- /package/dist/cjs/{context → src/context}/index.js +0 -0
- /package/dist/cjs/{controls → src/controls}/TextField.js +0 -0
- /package/dist/cjs/{controls → src/controls}/index.js +0 -0
- /package/dist/cjs/{index.js → src/index.js} +0 -0
- /package/dist/cjs/{model → src/model}/graph.js +0 -0
- /package/dist/cjs/{model → src/model}/index.js +0 -0
- /package/dist/cjs/{model → src/model}/theme.js +0 -0
- /package/dist/cjs/{model → src/model}/timeOption.js +0 -0
- /package/dist/cjs/{test → src/test}/index.js +0 -0
- /package/dist/cjs/{test → src/test}/render.js +0 -0
- /package/dist/cjs/{test → src/test}/setup-tests.js +0 -0
- /package/dist/cjs/{test-utils → src/test-utils}/index.js +0 -0
- /package/dist/cjs/{test-utils → src/test-utils}/theme.js +0 -0
- /package/dist/cjs/{theme → src/theme}/component-overrides/alert.js +0 -0
- /package/dist/cjs/{theme → src/theme}/component-overrides/paper.js +0 -0
- /package/dist/cjs/{theme → src/theme}/index.js +0 -0
- /package/dist/cjs/{theme → src/theme}/palette/background.js +0 -0
- /package/dist/cjs/{theme → src/theme}/palette/colors/blue.js +0 -0
- /package/dist/cjs/{theme → src/theme}/palette/colors/common.js +0 -0
- /package/dist/cjs/{theme → src/theme}/palette/colors/green.js +0 -0
- /package/dist/cjs/{theme → src/theme}/palette/colors/grey.js +0 -0
- /package/dist/cjs/{theme → src/theme}/palette/colors/index.js +0 -0
- /package/dist/cjs/{theme → src/theme}/palette/colors/orange.js +0 -0
- /package/dist/cjs/{theme → src/theme}/palette/colors/purple.js +0 -0
- /package/dist/cjs/{theme → src/theme}/palette/colors/red.js +0 -0
- /package/dist/cjs/{theme → src/theme}/palette/colors/types.js +0 -0
- /package/dist/cjs/{theme → src/theme}/palette/error.js +0 -0
- /package/dist/cjs/{theme → src/theme}/palette/grey.js +0 -0
- /package/dist/cjs/{theme → src/theme}/palette/index.js +0 -0
- /package/dist/cjs/{theme → src/theme}/palette/palette-options.js +0 -0
- /package/dist/cjs/{theme → src/theme}/palette/primary.js +0 -0
- /package/dist/cjs/{theme → src/theme}/palette/secondary.js +0 -0
- /package/dist/cjs/{theme → src/theme}/palette/success.js +0 -0
- /package/dist/cjs/{theme → src/theme}/palette/text.js +0 -0
- /package/dist/cjs/{theme → src/theme}/palette/warning.js +0 -0
- /package/dist/cjs/{theme → src/theme}/theme.js +0 -0
- /package/dist/cjs/{theme → src/theme}/types/ThemeExtension.d.js +0 -0
- /package/dist/cjs/{theme → src/theme}/typography.js +0 -0
- /package/dist/cjs/{utils → src/utils}/axis.js +0 -0
- /package/dist/cjs/{utils → src/utils}/chart-actions.js +0 -0
- /package/dist/cjs/{utils → src/utils}/combine-sx.js +0 -0
- /package/dist/cjs/{utils → src/utils}/component-ids.js +0 -0
- /package/dist/cjs/{utils → src/utils}/format.js +0 -0
- /package/dist/cjs/{utils → src/utils}/index.js +0 -0
- /package/dist/cjs/{utils → src/utils}/mathjs.js +0 -0
- /package/dist/cjs/{utils → src/utils}/theme-gen.js +0 -0
- /package/dist/{AlignSelector → src/AlignSelector}/AlignSelector.js +0 -0
- /package/dist/{AlignSelector → src/AlignSelector}/index.js +0 -0
- /package/dist/{ColorPicker → src/ColorPicker}/ColorPicker.js +0 -0
- /package/dist/{ColorPicker → src/ColorPicker}/OptionsColorPicker.js +0 -0
- /package/dist/{ColorPicker → src/ColorPicker}/index.js +0 -0
- /package/dist/{ContentWithLegend → src/ContentWithLegend}/ContentWithLegend.js +0 -0
- /package/dist/{ContentWithLegend → src/ContentWithLegend}/index.js +0 -0
- /package/dist/{ContentWithLegend → src/ContentWithLegend}/model/content-with-legend-model.js +0 -0
- /package/dist/{DensitySelector → src/DensitySelector}/DensitySelector.js +0 -0
- /package/dist/{DensitySelector → src/DensitySelector}/index.js +0 -0
- /package/dist/{Dialog → src/Dialog}/Dialog.js +0 -0
- /package/dist/{Dialog → src/Dialog}/DiscardChangesConfirmationDialog.js +0 -0
- /package/dist/{Dialog → src/Dialog}/index.js +0 -0
- /package/dist/{DragAndDrop → src/DragAndDrop}/DragAndDropList.js +0 -0
- /package/dist/{DragAndDrop → src/DragAndDrop}/DragButton.js +0 -0
- /package/dist/{DragAndDrop → src/DragAndDrop}/DropIndicator.js +0 -0
- /package/dist/{DragAndDrop → src/DragAndDrop}/index.js +0 -0
- /package/dist/{DragAndDrop → src/DragAndDrop}/model.js +0 -0
- /package/dist/{Drawer → src/Drawer}/Drawer.js +0 -0
- /package/dist/{Drawer → src/Drawer}/index.js +0 -0
- /package/dist/{EChart → src/EChart}/EChart.js +0 -0
- /package/dist/{EChart → src/EChart}/index.js +0 -0
- /package/dist/{ErrorAlert.js → src/ErrorAlert.js} +0 -0
- /package/dist/{ErrorBoundary.js → src/ErrorBoundary.js} +0 -0
- /package/dist/{FontSizeSelector → src/FontSizeSelector}/FontSizeSelector.js +0 -0
- /package/dist/{FontSizeSelector → src/FontSizeSelector}/index.js +0 -0
- /package/dist/{FormEditor → src/FormEditor}/FormActions.js +0 -0
- /package/dist/{FormEditor → src/FormEditor}/index.js +0 -0
- /package/dist/{FormatControls → src/FormatControls}/FormatControls.js +0 -0
- /package/dist/{FormatControls → src/FormatControls}/index.js +0 -0
- /package/dist/{InfoTooltip → src/InfoTooltip}/InfoTooltip.js +0 -0
- /package/dist/{InfoTooltip → src/InfoTooltip}/index.js +0 -0
- /package/dist/{JSONEditor.js → src/JSONEditor.js} +0 -0
- /package/dist/{Legend → src/Legend}/CompactLegend.js +0 -0
- /package/dist/{Legend → src/Legend}/Legend.js +0 -0
- /package/dist/{Legend → src/Legend}/LegendColorBadge.js +0 -0
- /package/dist/{Legend → src/Legend}/ListLegend.js +0 -0
- /package/dist/{Legend → src/Legend}/ListLegendItem.js +0 -0
- /package/dist/{Legend → src/Legend}/TableLegend.js +0 -0
- /package/dist/{Legend → src/Legend}/index.js +0 -0
- /package/dist/{Legend → src/Legend}/legend-model.js +0 -0
- /package/dist/{LinksEditor → src/LinksEditor}/LinksEditor.js +0 -0
- /package/dist/{LinksEditor → src/LinksEditor}/index.js +0 -0
- /package/dist/{ModeSelector → src/ModeSelector}/ModeSelector.js +0 -0
- /package/dist/{ModeSelector → src/ModeSelector}/index.js +0 -0
- /package/dist/{OptionsEditorLayout → src/OptionsEditorLayout}/OptionsEditorColumn.js +0 -0
- /package/dist/{OptionsEditorLayout → src/OptionsEditorLayout}/OptionsEditorControl.js +0 -0
- /package/dist/{OptionsEditorLayout → src/OptionsEditorLayout}/OptionsEditorGrid.js +0 -0
- /package/dist/{OptionsEditorLayout → src/OptionsEditorLayout}/OptionsEditorGroup.js +0 -0
- /package/dist/{OptionsEditorLayout → src/OptionsEditorLayout}/index.js +0 -0
- /package/dist/{Overlay → src/Overlay}/Overlay.js +0 -0
- /package/dist/{Overlay → src/Overlay}/index.js +0 -0
- /package/dist/{RefreshIntervalPicker → src/RefreshIntervalPicker}/RefreshIntervalPicker.js +0 -0
- /package/dist/{RefreshIntervalPicker → src/RefreshIntervalPicker}/index.js +0 -0
- /package/dist/{SettingsAutocomplete → src/SettingsAutocomplete}/SettingsAutocomplete.js +0 -0
- /package/dist/{SettingsAutocomplete → src/SettingsAutocomplete}/index.js +0 -0
- /package/dist/{SortSelector → src/SortSelector}/SortSelector.js +0 -0
- /package/dist/{SortSelector → src/SortSelector}/SortSelectorButtons.js +0 -0
- /package/dist/{SortSelector → src/SortSelector}/index.js +0 -0
- /package/dist/{Table → src/Table}/InnerTable.js +0 -0
- /package/dist/{Table → src/Table}/Table.js +0 -0
- /package/dist/{Table → src/Table}/TableBody.js +0 -0
- /package/dist/{Table → src/Table}/TableCell.js +0 -0
- /package/dist/{Table → src/Table}/TableCheckbox.js +0 -0
- /package/dist/{Table → src/Table}/TableFoot.js +0 -0
- /package/dist/{Table → src/Table}/TableHead.js +0 -0
- /package/dist/{Table → src/Table}/TableHeaderCell.js +0 -0
- /package/dist/{Table → src/Table}/TableRow.js +0 -0
- /package/dist/{Table → src/Table}/VirtualizedTable.js +0 -0
- /package/dist/{Table → src/Table}/VirtualizedTableContainer.js +0 -0
- /package/dist/{Table → src/Table}/hooks/useTableKeyboardNav.js +0 -0
- /package/dist/{Table → src/Table}/hooks/useVirtualizedTableKeyboardNav.js +0 -0
- /package/dist/{Table → src/Table}/index.js +0 -0
- /package/dist/{Table → src/Table}/model/table-model.js +0 -0
- /package/dist/{ThresholdsEditor → src/ThresholdsEditor}/ThresholdInput.js +0 -0
- /package/dist/{ThresholdsEditor → src/ThresholdsEditor}/ThresholdsEditor.js +0 -0
- /package/dist/{ThresholdsEditor → src/ThresholdsEditor}/index.js +0 -0
- /package/dist/{TimeRangeSelector → src/TimeRangeSelector}/DateTimeRangePicker.js +0 -0
- /package/dist/{TimeRangeSelector → src/TimeRangeSelector}/TimeRangeSelector.js +0 -0
- /package/dist/{TimeRangeSelector → src/TimeRangeSelector}/index.js +0 -0
- /package/dist/{TimeRangeSelector → src/TimeRangeSelector}/utils.js +0 -0
- /package/dist/{TimeSeriesTooltip → src/TimeSeriesTooltip}/SeriesInfo.js +0 -0
- /package/dist/{TimeSeriesTooltip → src/TimeSeriesTooltip}/SeriesLabelsStack.js +0 -0
- /package/dist/{TimeSeriesTooltip → src/TimeSeriesTooltip}/SeriesMarker.js +0 -0
- /package/dist/{TimeSeriesTooltip → src/TimeSeriesTooltip}/TimeChartTooltip.js +0 -0
- /package/dist/{TimeSeriesTooltip → src/TimeSeriesTooltip}/TooltipContent.js +0 -0
- /package/dist/{TimeSeriesTooltip → src/TimeSeriesTooltip}/TooltipHeader.js +0 -0
- /package/dist/{TimeSeriesTooltip → src/TimeSeriesTooltip}/index.js +0 -0
- /package/dist/{TimeSeriesTooltip → src/TimeSeriesTooltip}/nearby-series.js +0 -0
- /package/dist/{TimeSeriesTooltip → src/TimeSeriesTooltip}/tooltip-model.js +0 -0
- /package/dist/{TimeSeriesTooltip → src/TimeSeriesTooltip}/utils.js +0 -0
- /package/dist/{ToolbarIconButton → src/ToolbarIconButton}/ToolbarIconButton.js +0 -0
- /package/dist/{ToolbarIconButton → src/ToolbarIconButton}/index.js +0 -0
- /package/dist/{TransformsEditor → src/TransformsEditor}/TransformEditor.js +0 -0
- /package/dist/{TransformsEditor → src/TransformsEditor}/TransformEditorContainer.js +0 -0
- /package/dist/{TransformsEditor → src/TransformsEditor}/TransformsEditor.js +0 -0
- /package/dist/{TransformsEditor → src/TransformsEditor}/index.js +0 -0
- /package/dist/{ValueMappingEditor → src/ValueMappingEditor}/ValueMappingEditor.js +0 -0
- /package/dist/{ValueMappingEditor → src/ValueMappingEditor}/ValueMappingsEditor.js +0 -0
- /package/dist/{ValueMappingEditor → src/ValueMappingEditor}/index.js +0 -0
- /package/dist/{YAxisLabel.js → src/YAxisLabel.js} +0 -0
- /package/dist/{context → src/context}/ChartsProvider.js +0 -0
- /package/dist/{context → src/context}/SnackbarProvider.js +0 -0
- /package/dist/{context → src/context}/TimeZoneProvider.js +0 -0
- /package/dist/{context → src/context}/index.js +0 -0
- /package/dist/{controls → src/controls}/TextField.js +0 -0
- /package/dist/{controls → src/controls}/index.js +0 -0
- /package/dist/{index.js → src/index.js} +0 -0
- /package/dist/{model → src/model}/graph.js +0 -0
- /package/dist/{model → src/model}/index.js +0 -0
- /package/dist/{model → src/model}/theme.js +0 -0
- /package/dist/{model → src/model}/timeOption.js +0 -0
- /package/dist/{test → src/test}/index.js +0 -0
- /package/dist/{test → src/test}/render.js +0 -0
- /package/dist/{test → src/test}/setup-tests.js +0 -0
- /package/dist/{test-utils → src/test-utils}/index.js +0 -0
- /package/dist/{test-utils → src/test-utils}/theme.js +0 -0
- /package/dist/{theme → src/theme}/component-overrides/alert.js +0 -0
- /package/dist/{theme → src/theme}/component-overrides/paper.js +0 -0
- /package/dist/{theme → src/theme}/index.js +0 -0
- /package/dist/{theme → src/theme}/palette/background.js +0 -0
- /package/dist/{theme → src/theme}/palette/colors/blue.js +0 -0
- /package/dist/{theme → src/theme}/palette/colors/common.js +0 -0
- /package/dist/{theme → src/theme}/palette/colors/green.js +0 -0
- /package/dist/{theme → src/theme}/palette/colors/grey.js +0 -0
- /package/dist/{theme → src/theme}/palette/colors/index.js +0 -0
- /package/dist/{theme → src/theme}/palette/colors/orange.js +0 -0
- /package/dist/{theme → src/theme}/palette/colors/purple.js +0 -0
- /package/dist/{theme → src/theme}/palette/colors/red.js +0 -0
- /package/dist/{theme → src/theme}/palette/colors/types.js +0 -0
- /package/dist/{theme → src/theme}/palette/error.js +0 -0
- /package/dist/{theme → src/theme}/palette/grey.js +0 -0
- /package/dist/{theme → src/theme}/palette/index.js +0 -0
- /package/dist/{theme → src/theme}/palette/palette-options.js +0 -0
- /package/dist/{theme → src/theme}/palette/primary.js +0 -0
- /package/dist/{theme → src/theme}/palette/secondary.js +0 -0
- /package/dist/{theme → src/theme}/palette/success.js +0 -0
- /package/dist/{theme → src/theme}/palette/text.js +0 -0
- /package/dist/{theme → src/theme}/palette/warning.js +0 -0
- /package/dist/{theme → src/theme}/theme.js +0 -0
- /package/dist/{theme → src/theme}/types/ThemeExtension.d.js +0 -0
- /package/dist/{theme → src/theme}/typography.js +0 -0
- /package/dist/{utils → src/utils}/axis.js +0 -0
- /package/dist/{utils → src/utils}/chart-actions.js +0 -0
- /package/dist/{utils → src/utils}/combine-sx.js +0 -0
- /package/dist/{utils → src/utils}/component-ids.js +0 -0
- /package/dist/{utils → src/utils}/format.js +0 -0
- /package/dist/{utils → src/utils}/index.js +0 -0
- /package/dist/{utils → src/utils}/mathjs.js +0 -0
- /package/dist/{utils → src/utils}/theme-gen.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/EChart/EChart.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 { CSSProperties, memo, useEffect, useLayoutEffect, useRef } from 'react';\nimport { ECharts, EChartsCoreOption, init, connect, use } from 'echarts/core';\nimport { Box, SxProps, Theme } from '@mui/material';\nimport isEqual from 'lodash/isEqual';\nimport debounce from 'lodash/debounce';\n\nimport {\n BarChart as EChartsBarChart,\n LineChart as EChartsLineChart,\n GaugeChart as EChartsGaugeChart,\n PieChart as EChartsPieChart,\n ScatterChart as EChartsScatterChart,\n CustomChart as EChartsCustomChart,\n HeatmapChart as EChartsHeatmapChart,\n} from 'echarts/charts';\nimport {\n DatasetComponent,\n DataZoomComponent,\n LegendComponent,\n GridComponent,\n TitleComponent,\n TooltipComponent,\n VisualMapComponent,\n ToolboxComponent,\n MarkPointComponent,\n MarkAreaComponent,\n MarkLineComponent,\n} from 'echarts/components';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { EChartsTheme } from '../model';\n\n// Loading the ECharts extensions should happen in the respective plugins.\n// This is a workaround for https://github.com/perses/plugins/issues/83.\nuse([\n DatasetComponent,\n DataZoomComponent,\n LegendComponent,\n EChartsBarChart,\n EChartsLineChart,\n EChartsGaugeChart,\n EChartsPieChart,\n EChartsScatterChart,\n EChartsCustomChart,\n EChartsHeatmapChart,\n GridComponent,\n TitleComponent,\n ToolboxComponent,\n TooltipComponent,\n CanvasRenderer,\n VisualMapComponent,\n MarkAreaComponent,\n MarkLineComponent,\n MarkPointComponent,\n]);\n\n// see docs for info about each property: https://echarts.apache.org/en/api.html#events\nexport interface MouseEventsParameters<T> {\n componentType: string;\n seriesType: string;\n seriesIndex: number;\n seriesName: string;\n name: string;\n dataIndex: number;\n data: Record<string, unknown> & T;\n dataType: string;\n value: number | number[];\n color: string;\n info: Record<string, unknown>;\n}\n\ntype OnEventFunction<T> = (\n params: MouseEventsParameters<T>,\n // This is potentially undefined for testing purposes\n instance?: ECharts\n) => void;\n\nconst mouseEvents = [\n 'click',\n 'dblclick',\n 'mousedown',\n 'mousemove',\n 'mouseup',\n 'mouseover',\n 'mouseout',\n 'globalout',\n 'contextmenu',\n] as const;\n\nexport type MouseEventName = (typeof mouseEvents)[number];\n\n// batch event types\nexport interface DataZoomPayloadBatchItem {\n dataZoomId: string;\n // start and end not returned unless dataZoom is based on percentProp,\n // which is for cases when a dataZoom component controls multiple axes\n start?: number;\n end?: number;\n // startValue and endValue return data index for 'category' axes,\n // for axis types 'value' and 'time', actual values are returned\n startValue?: number;\n endValue?: number;\n}\n\nexport interface HighlightPayloadBatchItem {\n dataIndex: number;\n dataIndexInside: number;\n seriesIndex: number;\n // highlight action can effect multiple connected charts\n escapeConnect?: boolean;\n // whether blur state was triggered\n notBlur?: boolean;\n}\n\nexport interface BatchEventsParameters {\n type: BatchEventName;\n batch: DataZoomPayloadBatchItem[] & HighlightPayloadBatchItem[];\n}\n\ntype OnBatchEventFunction = (params: BatchEventsParameters) => void;\n\nconst batchEvents = ['datazoom', 'downplay', 'highlight'] as const;\n\nexport type BatchEventName = (typeof batchEvents)[number];\n\ntype ChartEventName = 'finished';\n\ntype EventName = MouseEventName | ChartEventName | BatchEventName;\n\nexport type OnEventsType<T> = {\n [mouseEventName in MouseEventName]?: OnEventFunction<T>;\n} & {\n [batchEventName in BatchEventName]?: OnBatchEventFunction;\n} & {\n [eventName in ChartEventName]?: () => void;\n};\n\nexport interface EChartsProps<T> {\n option: EChartsCoreOption;\n theme?: string | EChartsTheme;\n renderer?: 'canvas' | 'svg';\n sx?: SxProps<Theme>;\n style?: CSSProperties;\n onEvents?: OnEventsType<T>;\n _instance?: React.MutableRefObject<ECharts | undefined>;\n syncGroup?: string;\n onChartInitialized?: (instance: ECharts) => void;\n}\n\nexport const EChart = memo(function EChart<T>({\n option,\n theme,\n renderer,\n sx,\n style,\n onEvents,\n _instance,\n syncGroup,\n onChartInitialized,\n}: EChartsProps<T>) {\n const initialOption = useRef<EChartsCoreOption>(option);\n const prevOption = useRef<EChartsCoreOption>(option);\n const containerRef = useRef<HTMLDivElement | null>(null);\n const chartElement = useRef<ECharts | null>(null);\n\n // Initialize chart, dispose on unmount\n useLayoutEffect(() => {\n if (containerRef.current === null || chartElement.current !== null) return;\n chartElement.current = init(containerRef.current, theme, { renderer: renderer ?? 'canvas' });\n if (chartElement.current === undefined) return;\n chartElement.current.setOption(initialOption.current, true);\n onChartInitialized?.(chartElement.current);\n if (_instance !== undefined) {\n _instance.current = chartElement.current;\n }\n return (): void => {\n if (chartElement.current === null) return;\n chartElement.current.dispose();\n chartElement.current = null;\n };\n }, [_instance, onChartInitialized, theme, renderer]);\n\n // When syncGroup is explicitly set, charts within same group share interactions such as crosshair\n useEffect(() => {\n if (!chartElement.current || !syncGroup) return;\n chartElement.current.group = syncGroup;\n connect([chartElement.current]); // more info: https://echarts.apache.org/en/api.html#echarts.connect\n }, [syncGroup, chartElement]);\n\n // Update chart data when option changes\n useEffect(() => {\n if (prevOption.current === undefined || isEqual(prevOption.current, option)) return;\n if (!chartElement.current) return;\n chartElement.current.setOption(option, true);\n prevOption.current = option;\n }, [option]);\n\n // Resize chart, cleanup listener on unmount\n useLayoutEffect(() => {\n const updateSize = debounce(() => {\n if (!chartElement.current) return;\n chartElement.current.resize();\n }, 200);\n window.addEventListener('resize', updateSize);\n updateSize();\n return (): void => {\n window.removeEventListener('resize', updateSize);\n };\n }, []);\n\n // Bind and unbind chart events passed as prop\n useEffect(() => {\n const chart = chartElement.current;\n if (!chart || onEvents === undefined) return;\n bindEvents(chart, onEvents);\n return (): void => {\n if (chart === undefined) return;\n if (chart.isDisposed() === true) return;\n for (const event in onEvents) {\n chart.off(event);\n }\n };\n }, [onEvents]);\n\n // TODO: re-evaluate how this is triggered. It's technically working right\n // now because the sx prop is an object that gets re-created, but that also\n // means it runs unnecessarily some of the time and theoretically might\n // not run in some other cases. Maybe it should use a resize observer?\n useEffect(() => {\n // TODO: fix this debouncing. This likely isn't working as intended because\n // the debounced function is re-created every time this useEffect is called.\n const updateSize = debounce(\n () => {\n if (!chartElement.current) return;\n chartElement.current.resize();\n },\n 200,\n {\n leading: true,\n }\n );\n updateSize();\n }, [sx, style]);\n\n return <Box ref={containerRef} sx={sx} style={style}></Box>;\n});\n\n// Validate event config and bind custom events\nfunction bindEvents<T>(instance: ECharts, events?: OnEventsType<T>): void {\n if (events === undefined) return;\n\n function bindEvent(eventName: EventName, OnEventFunction: unknown): void {\n if (typeof OnEventFunction === 'function') {\n if (isMouseEvent(eventName)) {\n instance.on(eventName, (params) => OnEventFunction(params, instance));\n } else if (isBatchEvent(eventName)) {\n instance.on(eventName, (params) => OnEventFunction(params));\n } else {\n instance.on(eventName, () => OnEventFunction(null, instance));\n }\n }\n }\n\n for (const eventName in events) {\n if (Object.prototype.hasOwnProperty.call(events, eventName)) {\n const customEvent = events[eventName as EventName] ?? null;\n if (customEvent) {\n bindEvent(eventName as EventName, customEvent);\n }\n }\n }\n}\n\nfunction isMouseEvent(eventName: EventName): eventName is MouseEventName {\n return (mouseEvents as readonly string[]).includes(eventName);\n}\n\nfunction isBatchEvent(eventName: EventName): eventName is BatchEventName {\n return (batchEvents as readonly string[]).includes(eventName);\n}\n"],"names":["memo","useEffect","useLayoutEffect","useRef","init","connect","use","Box","isEqual","debounce","BarChart","EChartsBarChart","LineChart","EChartsLineChart","GaugeChart","EChartsGaugeChart","PieChart","EChartsPieChart","ScatterChart","EChartsScatterChart","CustomChart","EChartsCustomChart","HeatmapChart","EChartsHeatmapChart","DatasetComponent","DataZoomComponent","LegendComponent","GridComponent","TitleComponent","TooltipComponent","VisualMapComponent","ToolboxComponent","MarkPointComponent","MarkAreaComponent","MarkLineComponent","CanvasRenderer","mouseEvents","batchEvents","EChart","option","theme","renderer","sx","style","onEvents","_instance","syncGroup","onChartInitialized","initialOption","prevOption","containerRef","chartElement","current","undefined","setOption","dispose","group","updateSize","resize","window","addEventListener","removeEventListener","chart","bindEvents","isDisposed","event","off","leading","ref","instance","events","bindEvent","eventName","OnEventFunction","isMouseEvent","on","params","isBatchEvent","Object","prototype","hasOwnProperty","call","customEvent","includes"],"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,SAAwBA,IAAI,EAAEC,SAAS,EAAEC,eAAe,EAAEC,MAAM,QAAQ,QAAQ;AAChF,SAAqCC,IAAI,EAAEC,OAAO,EAAEC,GAAG,QAAQ,eAAe;AAC9E,SAASC,GAAG,QAAwB,gBAAgB;AACpD,OAAOC,aAAa,iBAAiB;AACrC,OAAOC,cAAc,kBAAkB;AAEvC,SACEC,YAAYC,eAAe,EAC3BC,aAAaC,gBAAgB,EAC7BC,cAAcC,iBAAiB,EAC/BC,YAAYC,eAAe,EAC3BC,gBAAgBC,mBAAmB,EACnCC,eAAeC,kBAAkB,EACjCC,gBAAgBC,mBAAmB,QAC9B,iBAAiB;AACxB,SACEC,gBAAgB,EAChBC,iBAAiB,EACjBC,eAAe,EACfC,aAAa,EACbC,cAAc,EACdC,gBAAgB,EAChBC,kBAAkB,EAClBC,gBAAgB,EAChBC,kBAAkB,EAClBC,iBAAiB,EACjBC,iBAAiB,QACZ,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O,KAACpC;QAAI6D,KAAKlB;QAAcR,IAAIA;QAAIC,OAAOA;;AAChD,GAAG;AAEH,+CAA+C;AAC/C,SAASoB,WAAcM,QAAiB,EAAEC,MAAwB;IAChE,IAAIA,WAAWjB,WAAW;IAE1B,SAASkB,UAAUC,SAAoB,EAAEC,eAAwB;QAC/D,IAAI,OAAOA,oBAAoB,YAAY;YACzC,IAAIC,aAAaF,YAAY;gBAC3BH,SAASM,EAAE,CAACH,WAAW,CAACI,SAAWH,gBAAgBG,QAAQP;YAC7D,OAAO,IAAIQ,aAAaL,YAAY;gBAClCH,SAASM,EAAE,CAACH,WAAW,CAACI,SAAWH,gBAAgBG;YACrD,OAAO;gBACLP,SAASM,EAAE,CAACH,WAAW,IAAMC,gBAAgB,MAAMJ;YACrD;QACF;IACF;IAEA,IAAK,MAAMG,aAAaF,OAAQ;QAC9B,IAAIQ,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACX,QAAQE,YAAY;YAC3D,MAAMU,cAAcZ,MAAM,CAACE,UAAuB,IAAI;YACtD,IAAIU,aAAa;gBACfX,UAAUC,WAAwBU;YACpC;QACF;IACF;AACF;AAEA,SAASR,aAAaF,SAAoB;IACxC,OAAO,AAACpC,YAAkC+C,QAAQ,CAACX;AACrD;AAEA,SAASK,aAAaL,SAAoB;IACxC,OAAO,AAACnC,YAAkC8C,QAAQ,CAACX;AACrD"}
|
package/dist/EChart/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/EChart/index.ts"],"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\nexport * from './EChart';\n"],"names":[],"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,cAAc,WAAW"}
|
package/dist/ErrorAlert.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ErrorAlert.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 { Alert } from '@mui/material';\nimport { ReactElement } from 'react';\n\nexport interface ErrorAlertProps {\n error: Error;\n}\n\n/**\n * Shows an MUI Alert with the `Error.message` as its contents.\n */\nexport function ErrorAlert(props: ErrorAlertProps): ReactElement {\n const { error } = props;\n return <Alert severity=\"error\">{error.message}</Alert>;\n}\n"],"names":["Alert","ErrorAlert","props","error","severity","message"],"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,KAAK,QAAQ,gBAAgB;AAOtC;;CAEC,GACD,OAAO,SAASC,WAAWC,KAAsB;IAC/C,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,qBAAO,KAACF;QAAMI,UAAS;kBAASD,MAAME,OAAO;;AAC/C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ErrorBoundary.ts"],"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\n// Just use react-error-boundary as-is for now\nexport { ErrorBoundary } from 'react-error-boundary';\nexport type { ErrorBoundaryProps } from 'react-error-boundary';\n"],"names":["ErrorBoundary"],"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,8CAA8C;AAC9C,SAASA,aAAa,QAAQ,uBAAuB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/FontSizeSelector/FontSizeSelector.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 { ReactElement } from 'react';\nimport { OptionsEditorControl } from '../OptionsEditorLayout';\nimport { SettingsAutocomplete } from '../SettingsAutocomplete';\n\nconst FONT_SIZE_OPTIONS = [\n { id: 'default', label: 'Default', value: undefined },\n { id: '12', label: '12', value: 12 },\n { id: '14', label: '14', value: 14 },\n { id: '16', label: '16', value: 16 },\n { id: '20', label: '20', value: 20 },\n { id: '24', label: '24', value: 24 },\n { id: '28', label: '28', value: 28 },\n { id: '32', label: '32', value: 32 },\n { id: '36', label: '36', value: 36 },\n { id: '40', label: '40', value: 40 },\n { id: '48', label: '48', value: 48 },\n { id: '56', label: '56', value: 56 },\n { id: '64', label: '64', value: 64 },\n { id: '72', label: '72', value: 72 },\n { id: '96', label: '96', value: 96 },\n { id: '128', label: '128', value: 128 },\n { id: '160', label: '160', value: 160 },\n { id: '192', label: '192', value: 192 },\n];\n\nexport type FontSizeOption = number | undefined;\n\nexport interface FontSizeSelectorProps {\n value: FontSizeOption;\n onChange: (fontSize: FontSizeOption) => void;\n}\n\nexport function FontSizeSelector({ value, onChange }: FontSizeSelectorProps): ReactElement {\n const handleFontSizeChange = (_: unknown, { value }: { value: FontSizeOption }): void => {\n onChange(value);\n };\n\n return (\n <OptionsEditorControl\n label=\"Font Size\"\n control={\n <SettingsAutocomplete\n value={FONT_SIZE_OPTIONS.find((o) => o.value === value)}\n options={FONT_SIZE_OPTIONS}\n getOptionLabel={(o) => o.label}\n onChange={handleFontSizeChange}\n disableClearable\n />\n }\n />\n );\n}\n"],"names":["OptionsEditorControl","SettingsAutocomplete","FONT_SIZE_OPTIONS","id","label","value","undefined","FontSizeSelector","onChange","handleFontSizeChange","_","control","find","o","options","getOptionLabel","disableClearable"],"mappings":"AAAA,oCAAoC;AACpC,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,wEAAwE;AACxE,qEAAqE;AACrE,6EAA6E;AAC7E,sEAAsE;AACtE,iCAAiC;;AAGjC,SAASA,oBAAoB,QAAQ,yBAAyB;AAC9D,SAASC,oBAAoB,QAAQ,0BAA0B;AAE/D,MAAMC,oBAAoB;IACxB;QAAEC,IAAI;QAAWC,OAAO;QAAWC,OAAOC;IAAU;IACpD;QAAEH,IAAI;QAAMC,OAAO;QAAMC,OAAO;IAAG;IACn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SizeSelector/index.ts"],"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\nexport * from './FontSizeSelector';\n"],"names":[],"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,cAAc,qBAAqB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/FormEditor/FormActions.tsx"],"sourcesContent":["// Copyright 2024 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 { Button, Divider, Stack, StackProps } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { Action } from '@perses-dev/core';\n\nexport interface FormActionsProps extends StackProps {\n action: Action;\n submitText?: string;\n cancelText?: string;\n isReadonly?: boolean;\n isValid?: boolean;\n onActionChange?: (action: Action) => void;\n onSubmit?: () => void;\n onDelete?: () => void;\n onCancel?: () => void;\n}\n\nexport function FormActions({\n action,\n submitText = 'Save',\n cancelText = 'Cancel',\n isReadonly,\n isValid,\n onActionChange,\n onSubmit,\n onDelete,\n onCancel,\n ...props\n}: FormActionsProps): ReactElement {\n return (\n <Stack direction=\"row\" gap={1} sx={{ marginLeft: 'auto' }} {...props}>\n {action === 'read' ? (\n <>\n {onActionChange && (\n <Button disabled={isReadonly} variant=\"contained\" onClick={() => onActionChange('update')}>\n Edit\n </Button>\n )}\n {onDelete && (\n <Button color=\"error\" disabled={isReadonly} variant=\"outlined\" onClick={onDelete}>\n Delete\n </Button>\n )}\n {onCancel && (onSubmit || onDelete) && (\n <Divider\n orientation=\"vertical\"\n flexItem\n sx={{\n borderColor: (theme) => theme.palette.grey['500'],\n '&.MuiDivider-root': {\n marginLeft: 2,\n marginRight: 1,\n },\n }}\n />\n )}\n {onCancel && (\n <Button color=\"secondary\" variant=\"outlined\" onClick={onCancel}>\n {cancelText}\n </Button>\n )}\n </>\n ) : (\n <>\n {onSubmit && (\n <Button variant=\"contained\" disabled={!isValid} onClick={onSubmit}>\n {submitText}\n </Button>\n )}\n {onCancel && (\n <Button color=\"secondary\" variant=\"outlined\" onClick={onCancel}>\n {cancelText}\n </Button>\n )}\n </>\n )}\n </Stack>\n );\n}\n"],"names":["Button","Divider","Stack","FormActions","action","submitText","cancelText","isReadonly","isValid","onActionChange","onSubmit","onDelete","onCancel","props","direction","gap","sx","marginLeft","disabled","variant","onClick","color","orientation","flexItem","borderColor","theme","palette","grey","marginRight"],"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,MAAM,EAAEC,OAAO,EAAEC,KAAK,QAAoB,gBAAgB;AAgBnE,OAAO,SAASC,YAAY,EAC1BC,MAAM,EACNC,aAAa,MAAM,EACnBC,aAAa,QAAQ,EACrBC,UAAU,EACVC,OAAO,EACPC,cAAc,EACdC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACR,GAAGC,OACc;IACjB,qBACE,KAACX;QAAMY,WAAU;QAAMC,KAAK;QAAGC,IAAI;YAAEC,YAAY;QAAO;QAAI,GAAGJ,KAAK;kBACjET,WAAW,uBACV;;gBACGK,gCACC,KAACT;oBAAOkB,UAAUX;oBAAYY,SAAQ;oBAAYC,SAAS,IAAMX,eAAe;8BAAW;;gBAI5FE,0BACC,KAACX;oBAAOqB,OAAM;oBAAQH,UAAUX;oBAAYY,SAAQ;oBAAWC,SAAST;8BAAU;;gBAInFC,YAAaF,CAAAA,YAAYC,QAAO,mBAC/B,KAACV;oBACCqB,aAAY;oBACZC,QAAQ;oBACRP,IAAI;wBACFQ,aAAa,CAACC,QAAUA,MAAMC,OAAO,CAACC,IAAI,CAAC,MAAM;wBACjD,qBAAqB;4BACnBV,YAAY;4BACZW,aAAa;wBACf;oBACF;;gBAGHhB,0BACC,KAACZ;oBAAOqB,OAAM;oBAAYF,SAAQ;oBAAWC,SAASR;8BACnDN;;;2BAKP;;gBACGI,0BACC,KAACV;oBAAOmB,SAAQ;oBAAYD,UAAU,CAACV;oBAASY,SAASV;8BACtDL;;gBAGJO,0BACC,KAACZ;oBAAOqB,OAAM;oBAAYF,SAAQ;oBAAWC,SAASR;8BACnDN;;;;;AAOf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/FormatControls/FormatControls.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.\nimport { Switch, SwitchProps } from '@mui/material';\nimport {\n FormatOptions,\n UNIT_CONFIG,\n UnitConfig,\n isUnitWithDecimalPlaces,\n isUnitWithShortValues,\n shouldShortenValues,\n} from '@perses-dev/core';\nimport { ReactElement } from 'react';\nimport { OptionsEditorControl } from '../OptionsEditorLayout';\nimport { SettingsAutocomplete } from '../SettingsAutocomplete';\n\nexport interface FormatControlsProps {\n value: FormatOptions;\n onChange: (unit: FormatOptions) => void;\n disabled?: boolean;\n}\n\ntype AutocompleteUnitOption = UnitConfig & {\n id: NonNullable<FormatOptions['unit']>;\n};\n\nconst KIND_OPTIONS: readonly AutocompleteUnitOption[] = Object.entries(UNIT_CONFIG)\n .map<AutocompleteUnitOption>(([id, config]) => {\n return {\n ...config,\n id: id as AutocompleteUnitOption['id'],\n group: config.group || 'Decimal',\n };\n })\n .filter((config) => !config.disableSelectorOption);\n\nconst DECIMAL_PLACES_OPTIONS: Array<{ id: string; label: string; decimalPlaces?: number }> = [\n { id: 'default', label: 'Default', decimalPlaces: undefined },\n { id: '0', label: '0', decimalPlaces: 0 },\n { id: '1', label: '1', decimalPlaces: 1 },\n { id: '2', label: '2', decimalPlaces: 2 },\n { id: '3', label: '3', decimalPlaces: 3 },\n { id: '4', label: '4', decimalPlaces: 4 },\n];\n\nfunction getOptionByDecimalPlaces(\n decimalPlaces?: number\n): { id: string; label: string; decimalPlaces?: number } | undefined {\n return DECIMAL_PLACES_OPTIONS.find((o) => o.decimalPlaces === decimalPlaces);\n}\n\nexport function FormatControls({ value, onChange, disabled = false }: FormatControlsProps): ReactElement {\n const hasDecimalPlaces = isUnitWithDecimalPlaces(value);\n const hasShortValues = isUnitWithShortValues(value);\n\n const handleKindChange = (_: unknown, newValue: AutocompleteUnitOption | null): void => {\n onChange({ unit: newValue?.id || 'decimal' } as FormatOptions); // Fallback to 'decimal' if no unit is selected\n };\n\n const handleDecimalPlacesChange = ({\n decimalPlaces,\n }: {\n id: string;\n label: string;\n decimalPlaces?: number;\n }): void => {\n if (hasDecimalPlaces) {\n onChange({\n ...value,\n decimalPlaces: decimalPlaces,\n });\n }\n };\n\n const handleShortValuesChange: SwitchProps['onChange'] = (_: unknown, checked: boolean) => {\n if (hasShortValues) {\n onChange({\n ...value,\n shortValues: checked,\n });\n }\n };\n\n const unitConfig = UNIT_CONFIG[value?.unit || 'decimal'];\n\n return (\n <>\n <OptionsEditorControl\n label=\"Short values\"\n control={\n <Switch\n checked={hasShortValues ? shouldShortenValues(value.shortValues) : false}\n onChange={handleShortValuesChange}\n disabled={!hasShortValues}\n />\n }\n />\n <OptionsEditorControl\n label=\"Unit\"\n control={\n <SettingsAutocomplete<AutocompleteUnitOption, false, true>\n value={{ id: value?.unit || 'decimal', ...unitConfig }}\n options={KIND_OPTIONS}\n groupBy={(option) => option.group ?? 'Decimal'}\n onChange={handleKindChange}\n disableClearable\n disabled={disabled}\n />\n }\n />\n <OptionsEditorControl\n label=\"Decimals\"\n control={\n <SettingsAutocomplete\n value={getOptionByDecimalPlaces(value.decimalPlaces)}\n options={DECIMAL_PLACES_OPTIONS}\n getOptionLabel={(o) => o.label}\n onChange={(_, value) => handleDecimalPlacesChange(value)}\n disabled={!hasDecimalPlaces}\n disableClearable\n />\n }\n />\n </>\n );\n}\n"],"names":["Switch","UNIT_CONFIG","isUnitWithDecimalPlaces","isUnitWithShortValues","shouldShortenValues","OptionsEditorControl","SettingsAutocomplete","KIND_OPTIONS","Object","entries","map","id","config","group","filter","disableSelectorOption","DECIMAL_PLACES_OPTIONS","label","decimalPlaces","undefined","getOptionByDecimalPlaces","find","o","FormatControls","value","onChange","disabled","hasDecimalPlaces","hasShortValues","handleKindChange","_","newValue","unit","handleDecimalPlacesChange","handleShortValuesChange","checked","shortValues","unitConfig","control","options","groupBy","option","disableClearable","getOptionLabel"],"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;;AACjC,SAASA,MAAM,QAAqB,gBAAgB;AACpD,SAEEC,WAAW,E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AAIP,gBAAgB;YAClBH,SAAS;gBACP,GAAGD,KAAK;gBACRY,aAAaD;YACf;QACF;IACF;IAEA,MAAME,aAAapC,WAAW,CAACuB,OAAOQ,QAAQ,UAAU;IAExD,qBACE;;0BACE,KAAC3B;gBACCY,OAAM;gBACNqB,uBACE,KAACtC;oBACCmC,SAASP,iBAAiBxB,oBAAoBoB,MAAMY,WAAW,IAAI;oBACnEX,UAAUS;oBACVR,UAAU,CAACE;;;0BAIjB,KAACvB;gBACCY,OAAM;gBACNqB,uBACE,KAAChC;oBACCkB,OAAO;wBAAEb,IAAIa,OAAOQ,QAAQ;wBAAW,GAAGK,UAAU;oBAAC;oBACrDE,SAAShC;oBACTiC,SAAS,CAACC,SAAWA,OAAO5B,KAAK,IAAI;oBACrCY,UAAUI;oBACVa,gBAAgB;oBAChBhB,UAAUA;;;0BAIhB,KAACrB;gBACCY,OAAM;gBACNqB,uBACE,KAAChC;oBACCkB,OAAOJ,yBAAyBI,MAAMN,aAAa;oBACnDqB,SAASvB;oBACT2B,gBAAgB,CAACrB,IAAMA,EAAEL,KAAK;oBAC9BQ,UAAU,CAACK,GAAGN,QAAUS,0BAA0BT;oBAClDE,UAAU,CAACC;oBACXe,gBAAgB;;;;;AAM5B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/InfoTooltip/InfoTooltip.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 { ReactElement, ReactNode } from 'react';\nimport {\n styled,\n TooltipProps as MuiTooltipProps,\n Tooltip as MuiTooltip,\n tooltipClasses,\n Typography,\n} from '@mui/material';\n\nexport type TooltipPlacement = 'top' | 'left' | 'right' | 'bottom';\n\ninterface InfoTooltipProps {\n description: string;\n children: ReactNode;\n id?: string;\n title?: string;\n placement?: TooltipPlacement;\n enterDelay?: number; // default is 500ms\n enterNextDelay?: number; // default is 500ms\n}\n\nexport const InfoTooltip = ({\n id,\n title,\n description,\n placement,\n children,\n enterDelay,\n enterNextDelay,\n}: InfoTooltipProps): ReactElement => {\n // Wrap children in a span to cover the following use cases:\n // - Disabled buttons. MUI console.errors on putting these inside a tooltip.\n // - Non-element tooltip children (e.g. text). The tooltip needs something that\n // can have a ref as a child.\n // We wrap in a `span` and not a `div` to minimize the impact on page layout\n // and styles.\n const wrappedChildren = <span>{children}</span>;\n\n return (\n <StyledTooltip\n arrow\n id={id}\n placement={placement ?? 'top'}\n title={<TooltipContent title={title} description={description} />}\n enterDelay={enterDelay ?? 500}\n enterNextDelay={enterNextDelay ?? 500}\n >\n {wrappedChildren}\n </StyledTooltip>\n );\n};\n\nconst TooltipContent = ({ title, description }: Pick<InfoTooltipProps, 'title' | 'description'>): ReactElement => {\n return (\n <>\n {title && (\n <Typography\n variant=\"body2\"\n sx={(theme) => ({\n color: theme.palette.text.primary,\n fontWeight: theme.typography.fontWeightMedium,\n })}\n >\n {title}\n </Typography>\n )}\n <Typography\n variant=\"caption\"\n sx={(theme) => ({\n color: theme.palette.text.primary,\n whiteSpace: 'pre-line',\n })}\n >\n {description}\n </Typography>\n </>\n );\n};\n\nconst StyledTooltip = styled(({ className, ...props }: MuiTooltipProps) => (\n <MuiTooltip {...props} classes={{ popper: className }} />\n))(({ theme }) => ({\n [`& .${tooltipClasses.tooltip}`]: {\n backgroundColor: theme.palette.background.tooltip,\n color: theme.palette.text.primary,\n maxWidth: '300px',\n padding: theme.spacing(1),\n boxShadow: theme.shadows[1],\n },\n [`& .${tooltipClasses.arrow}`]: {\n color: theme.palette.background.tooltip,\n },\n}));\n"],"names":["styled","Tooltip","MuiTooltip","tooltipClasses","Typography","InfoTooltip","id","title","description","placement","children","enterDelay","enterNextDelay","wrappedChildren","span","StyledTooltip","arrow","TooltipContent","variant","sx","theme","color","palette","text","primary","fontWeight","typography","fontWeightMedium","whiteSpace","className","props","classes","popper","tooltip","backgroundColor","background","maxWidth","padding","spacing","boxShadow","shadows"],"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;;AAGjC,SACEA,MAAM,EAENC,WAAWC,UAAU,EACrBC,cAAc,EACdC,UAAU,QACL,gBAAgB;AAcvB,OAAO,MAAMC,cAAc,CAAC,EAC1BC,EAAE,EACFC,KAAK,EACLC,WAAW,EACXC,SAAS,EACTC,QAAQ,EACRC,UAAU,EACVC,cAAc,EACG;IACjB,4DAA4D;IAC5D,6EAA6E;IAC7E,gFAAgF;IAChF,+BAA+B;IAC/B,4EAA4E;IAC5E,cAAc;IACd,MAAMC,gCAAkB,KAACC;kBAAMJ;;IAE/B,qBACE,KAACK;QACCC,KAAK;QACLV,IAAIA;QACJG,WAAWA,aAAa;QACxBF,qBAAO,KAACU;YAAeV,OAAOA;YAAOC,aAAaA;;QAClDG,YAAYA,cAAc;QAC1BC,gBAAgBA,kBAAkB;kBAEjCC;;AAGP,EAAE;AAEF,MAAMI,iBAAiB,CAAC,EAAEV,KAAK,EAAEC,WAAW,EAAmD;IAC7F,qBACE;;YACGD,uBACC,KAACH;gBACCc,SAAQ;gBACRC,IAAI,CAACC,QAAW,CAAA;wBACdC,OAAOD,MAAME,OAAO,CAACC,IAAI,CAACC,OAAO;wBACjCC,YAAYL,MAAMM,UAAU,CAACC,gBAAgB;oBAC/C,CAAA;0BAECpB;;0BAGL,KAACH;gBACCc,SAAQ;gBACRC,IAAI,CAACC,QAAW,CAAA;wBACdC,OAAOD,MAAME,OAAO,CAACC,IAAI,CAACC,OAAO;wBACjCI,YAAY;oBACd,CAAA;0BAECpB;;;;AAIT;AAEA,MAAMO,gBAAgBf,OAAO,CAAC,EAAE6B,SAAS,EAAE,GAAGC,OAAwB,iBACpE,KAAC5B;QAAY,GAAG4B,KAAK;QAAEC,SAAS;YAAEC,QAAQH;QAAU;QACnD,CAAC,EAAET,KAAK,EAAE,GAAM,CAAA;QACjB,CAAC,CAAC,GAAG,EAAEjB,eAAe8B,OAAO,EAAE,CAAC,EAAE;YAChCC,iBAAiBd,MAAME,OAAO,CAACa,UAAU,CAACF,OAAO;YACjDZ,OAAOD,MAAME,OAAO,CAACC,IAAI,CAACC,OAAO;YACjCY,UAAU;YACVC,SAASjB,MAAMkB,OAAO,CAAC;YACvBC,WAAWnB,MAAMoB,OAAO,CAAC,EAAE;QAC7B;QACA,CAAC,CAAC,GAAG,EAAErC,eAAea,KAAK,EAAE,CAAC,EAAE;YAC9BK,OAAOD,MAAME,OAAO,CAACa,UAAU,CAACF,OAAO;QACzC;IACF,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/InfoTooltip/index.ts"],"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\nexport * from './InfoTooltip';\n"],"names":[],"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,cAAc,gBAAgB"}
|
package/dist/JSONEditor.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/JSONEditor.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 { ReactElement, useState } from 'react';\nimport CodeMirror from '@uiw/react-codemirror';\nimport { json, jsonParseLinter } from '@codemirror/lang-json';\nimport { linter, lintGutter } from '@codemirror/lint';\nimport { useTheme } from '@mui/material';\nimport { ReactCodeMirrorProps } from '@uiw/react-codemirror/src';\n\ntype JSONEditorProps<T> = Omit<ReactCodeMirrorProps, 'onBlur' | 'theme' | 'extensions' | 'onChange' | 'value'> & {\n value: T;\n placeholder?: string;\n onChange?: (next: string) => void;\n};\n\nexport function JSONEditor<T>(props: JSONEditorProps<T>): ReactElement {\n const theme = useTheme();\n const isDarkMode = theme.palette.mode === 'dark';\n\n const [value, setValue] = useState(() => JSON.stringify(props.value, null, 2));\n const [lastProcessedValue, setLastProcessedValue] = useState<string>(value);\n\n return (\n <CodeMirror\n {...props}\n style={{ border: `1px solid ${theme.palette.divider}` }}\n theme={isDarkMode ? 'dark' : 'light'}\n extensions={[json(), linter(jsonParseLinter()), lintGutter()]}\n value={value}\n onChange={(newValue) => {\n setValue(newValue);\n // Trigger the provided onChange callback in real-time\n if (props.onChange) {\n props.onChange(newValue);\n }\n }}\n onBlur={() => {\n // Don't trigger the provided onChange if the last processed value is equal to the current value.\n // This prevents e.g CTRL+F to trigger value refresh downstream, which would cause the embedded\n // find & replace interface to close immediately.\n if (lastProcessedValue !== value && props.onChange !== undefined) {\n props.onChange(value);\n setLastProcessedValue(value);\n }\n }}\n placeholder={props.placeholder}\n />\n );\n}\n"],"names":["useState","CodeMirror","json","jsonParseLinter","linter","lintGutter","useTheme","JSONEditor","props","theme","isDarkMode","palette","mode","value","setValue","JSON","stringify","lastProcessedValue","setLastProcessedValue","style","border","divider","extensions","onChange","newValue","onBlur","undefined","placeholder"],"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,SAAuBA,QAAQ,QAAQ,QAAQ;AAC/C,OAAOC,gBAAgB,wBAAwB;AAC/C,SAASC,IAAI,EAAEC,eAAe,QAAQ,wBAAwB;AAC9D,SAASC,MAAM,EAAEC,UAAU,QAAQ,mBAAmB;AACtD,SAASC,QAAQ,QAAQ,gBAAgB;AASzC,OAAO,SAASC,WAAcC,KAAyB;IACrD,MAAMC,QAAQH;IACd,MAAMI,aAAaD,MAAME,OAAO,CAACC,IAAI,KAAK;IAE1C,MAAM,CAACC,OAAOC,SAAS,GAAGd,SAAS,IAAMe,KAAKC,SAAS,CAACR,MAAMK,KAAK,EAAE,MAAM;IAC3E,MAAM,CAACI,oBAAoBC,sBAAsB,GAAGlB,SAAiBa;IAErE,qBACE,KAACZ;QACE,GAAGO,KAAK;QACTW,OAAO;YAAEC,QAAQ,CAAC,UAAU,EAAEX,MAAME,OAAO,CAACU,OAAO,EAAE;QAAC;QACtDZ,OAAOC,aAAa,SAAS;QAC7BY,YAAY;YAACpB;YAAQE,OAAOD;YAAoBE;SAAa;QAC7DQ,OAAOA;QACPU,UAAU,CAACC;YACTV,SAASU;YACT,sDAAsD;YACtD,IAAIhB,MAAMe,QAAQ,EAAE;gBAClBf,MAAMe,QAAQ,CAACC;YACjB;QACF;QACAC,QAAQ;YACN,iGAAiG;YACjG,+FAA+F;YAC/F,iDAAiD;YACjD,IAAIR,uBAAuBJ,SAASL,MAAMe,QAAQ,KAAKG,WAAW;gBAChElB,MAAMe,QAAQ,CAACV;gBACfK,sBAAsBL;YACxB;QACF;QACAc,aAAanB,MAAMmB,WAAW;;AAGpC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Legend/CompactLegend.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 { Box } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { ListLegendItem, ListLegendItemProps } from './ListLegendItem';\nimport { LegendItem, SelectedLegendItemState, isLegendItemVisuallySelected } from './legend-model';\n\nexport interface CompactLegendProps {\n height: number;\n items: LegendItem[];\n selectedItems: SelectedLegendItemState;\n onLegendItemClick: ListLegendItemProps['onClick'];\n onItemMouseOver: ListLegendItemProps['onMouseOver'];\n onItemMouseOut: ListLegendItemProps['onMouseOut'];\n}\n\n/**\n * CompactLegend is default and used when legend items need to show side by side\n * which corresponds to when legend.position is `bottom` with a relatively small\n * number of items. The `ListLegend` is used for cases with large numbers of items\n * because it is virtualized.\n */\nexport function CompactLegend({\n height,\n items,\n selectedItems,\n onLegendItemClick,\n onItemMouseOver,\n onItemMouseOut,\n}: CompactLegendProps): ReactElement {\n return (\n <Box component=\"ul\" sx={{ width: '100%', height, padding: [0, 1, 0, 0], overflowY: 'scroll', margin: 0 }}>\n {items.map((item, index) => (\n <ListLegendItem\n key={item.id}\n item={item}\n index={index}\n isVisuallySelected={isLegendItemVisuallySelected(item, selectedItems)}\n onMouseOver={onItemMouseOver}\n onMouseOut={onItemMouseOut}\n onClick={onLegendItemClick}\n sx={{\n width: 'auto',\n float: 'left',\n paddingRight: 1.5,\n }}\n />\n ))}\n </Box>\n );\n}\n"],"names":["Box","ListLegendItem","isLegendItemVisuallySelected","CompactLegend","height","items","selectedItems","onLegendItemClick","onItemMouseOver","onItemMouseOut","component","sx","width","padding","overflowY","margin","map","item","index","isVisuallySelected","onMouseOver","onMouseOut","onClick","float","paddingRight","id"],"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,GAAG,QAAQ,gBAAgB;AAEpC,SAASC,cAAc,QAA6B,mBAAmB;AACvE,SAA8CC,4BAA4B,QAAQ,iBAAiB;AAWnG;;;;;CAKC,GACD,OAAO,SAASC,cAAc,EAC5BC,MAAM,EACNC,KAAK,EACLC,aAAa,EACbC,iBAAiB,EACjBC,eAAe,EACfC,cAAc,EACK;IACnB,qBACE,KAACT;QAAIU,WAAU;QAAKC,IAAI;YAAEC,OAAO;YAAQR;YAAQS,SAAS;gBAAC;gBAAG;gBAAG;gBAAG;aAAE;YAAEC,WAAW;YAAUC,QAAQ;QAAE;kBACpGV,MAAMW,GAAG,CAAC,CAACC,MAAMC,sBAChB,KAACjB;gBAECgB,MAAMA;gBACNC,OAAOA;gBACPC,oBAAoBjB,6BAA6Be,MAAMX;gBACvDc,aAAaZ;gBACba,YAAYZ;gBACZa,SAASf;gBACTI,IAAI;oBACFC,OAAO;oBACPW,OAAO;oBACPC,cAAc;gBAChB;eAXKP,KAAKQ,EAAE;;AAgBtB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Legend/Legend.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 { Box } from '@mui/material';\nimport { produce } from 'immer';\nimport { ReactElement, ReactNode } from 'react';\nimport { getLegendMode } from '@perses-dev/core';\nimport { ListLegend } from './ListLegend';\nimport { CompactLegend } from './CompactLegend';\nimport { TableLegend, TableLegendProps } from './TableLegend';\nimport { LegendItem, LegendComponentOptions, SelectedLegendItemState } from './legend-model';\nimport { ListLegendItemProps } from './ListLegendItem';\n\nexport interface LegendProps {\n width: number;\n height: number;\n data: LegendItem[];\n options: LegendComponentOptions;\n\n /**\n * State of selected items in the legend.\n *\n * Selected legend item state is a controlled value that should be managed using a\n * combination of this prop and `onSelectedChange`.\n */\n selectedItems: SelectedLegendItemState;\n\n /**\n * Callback fired when the selected items in the legend changes.\n */\n onSelectedItemsChange: (newSelected: SelectedLegendItemState) => void;\n\n /**\n * Callback fired when the mouse is moved over a legend item.\n */\n onItemMouseOver?: ListLegendItemProps['onMouseOver'];\n\n /**\n * Callback fired when the mouse is moved out of a legend item.\n */\n onItemMouseOut?: ListLegendItemProps['onMouseOut'];\n\n /**\n * Props specific to legend with `mode` set to `table`.\n */\n tableProps?: Pick<TableLegendProps, 'columns' | 'onSortingChange' | 'sorting'>;\n}\n\n// When the number of items to display is above this number, it is likely to\n// cause performance issues in the browser. The legend will be displayed in a\n// format (list) that allows for virtualization to minimize the performance impact.\n// Set this number based on testing, but it may need to be tuned a bit on the\n// future as people test this out on different machines.\nconst NEED_VIRTUALIZATION_LIMIT = 500;\n\nexport function Legend({\n width,\n height,\n options,\n data,\n selectedItems,\n onSelectedItemsChange,\n onItemMouseOver,\n onItemMouseOut,\n tableProps,\n}: LegendProps): ReactElement {\n const onLegendItemClick = (e: React.MouseEvent<HTMLElement, MouseEvent>, seriesId: string): void => {\n const isModifiedClick = e.metaKey || e.shiftKey;\n\n const newSelected = produce(selectedItems, (draft) => {\n if (draft === 'ALL') {\n return {\n [seriesId]: true,\n };\n }\n\n const isSelected = !!draft[seriesId];\n\n // Clicks with modifier key can select multiple items.\n if (isModifiedClick) {\n if (isSelected) {\n // Modified click on already selected item. Remove that item.\n delete draft[seriesId];\n } else {\n // Modified click on not-selected item. Add it.\n draft[seriesId] = true;\n }\n return draft;\n }\n\n if (isSelected) {\n // Clicked item was already selected. Unselect it and return to\n // ALL state.\n return 'ALL' as const;\n }\n\n // Select clicked item.\n return { [seriesId]: true };\n });\n onSelectedItemsChange(newSelected);\n };\n\n const mode = getLegendMode(options.mode);\n\n // The bottom legend is displayed as a list when the number of items is too\n // large and requires virtualization. Otherwise, it is rendered more compactly.\n // We do not need this check for the right-side legend because it is always\n // a virtualized list.\n const needsVirtualization = data.length >= NEED_VIRTUALIZATION_LIMIT;\n\n const commonLegendProps = {\n height,\n items: data,\n selectedItems,\n onLegendItemClick,\n onItemMouseOver,\n onItemMouseOut,\n };\n\n let legendContent: ReactNode;\n if (mode === 'table') {\n legendContent = (\n <TableLegend {...commonLegendProps} onSelectedItemsChange={onSelectedItemsChange} width={width} {...tableProps} />\n );\n } else if (options.position === 'right' || needsVirtualization) {\n legendContent = <ListLegend {...commonLegendProps} width={width} onLegendItemClick={onLegendItemClick} />;\n } else {\n legendContent = <CompactLegend {...commonLegendProps} onLegendItemClick={onLegendItemClick} />;\n }\n\n if (options.position === 'right') {\n return (\n <Box\n style={{\n width: width,\n height: height,\n }}\n sx={{\n position: 'absolute',\n top: 0,\n right: 0,\n backgroundColor: (theme) => `${theme.palette.background.default}`,\n }}\n >\n {legendContent}\n </Box>\n );\n }\n\n // Position bottom\n return (\n <Box\n style={{\n width: width,\n height: height,\n }}\n sx={{\n position: 'absolute',\n bottom: 0,\n backgroundColor: (theme) => `${theme.palette.background.default}`,\n }}\n >\n {legendContent}\n </Box>\n );\n}\n"],"names":["Box","produce","getLegendMode","ListLegend","CompactLegend","TableLegend","NEED_VIRTUALIZATION_LIMIT","Legend","width","height","options","data","selectedItems","onSelectedItemsChange","onItemMouseOver","onItemMouseOut","tableProps","onLegendItemClick","e","seriesId","isModifiedClick","metaKey","shiftKey","newSelected","draft","isSelected","mode","needsVirtualization","length","commonLegendProps","items","legendContent","position","style","sx","top","right","backgroundColor","theme","palette","background","default","bottom"],"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,GAAG,QAAQ,gBAAgB;AACpC,SAASC,OAAO,QAAQ,QAAQ;AAEhC,SAASC,aAAa,QAAQ,mBAAmB;AACjD,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,WAAW,QAA0B,gBAAgB;AAuC9D,4EAA4E;AAC5E,6EAA6E;AAC7E,mFAAmF;AACnF,6EAA6E;AAC7E,wDAAwD;AACxD,MAAMC,4BAA4B;AAElC,OAAO,SAASC,OAAO,EACrBC,KAAK,EACLC,MAAM,EACNC,OAAO,EACPC,IAAI,EACJC,aAAa,EACbC,qBAAqB,EACrBC,eAAe,EACfC,cAAc,EACdC,UAAU,EACE;IACZ,MAAMC,oBAAoB,CAACC,GAA8CC;QACvE,MAAMC,kBAAkBF,EAAEG,OAAO,IAAIH,EAAEI,QAAQ;QAE/C,MAAMC,cAActB,QAAQW,eAAe,CAACY;YAC1C,IAAIA,UAAU,OAAO;gBACnB,OAAO;oBACL,CAACL,SAAS,EAAE;gBACd;YACF;YAEA,MAAMM,aAAa,CAAC,CAACD,KAAK,CAACL,SAAS;YAEpC,sDAAsD;YACtD,IAAIC,iBAAiB;gBACnB,IAAIK,YAAY;oBACd,6DAA6D;oBAC7D,OAAOD,K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iBAAiB,CAACC,QAAU,GAAGA,MAAMC,OAAO,CAACC,UAAU,CAACC,OAAO,EAAE;QACnE;kBAECV;;AAGP"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Legend/LegendColorBadge.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 { memo, ReactElement } from 'react';\nimport { Box, BoxProps } from '@mui/material';\nimport { combineSx } from '../utils';\n\nexport interface LegendColorBadgeProps extends BoxProps<'div'> {\n color: string;\n}\n\nexport const LegendColorBadge = memo(function LegendColorBadge({\n color,\n sx,\n ...others\n}: LegendColorBadgeProps): ReactElement {\n return (\n <Box\n {...others}\n sx={combineSx(\n {\n height: 4,\n width: 16,\n margin: (theme) => theme.spacing(0.5),\n },\n sx\n )}\n style={{ backgroundColor: color }}\n />\n );\n});\n"],"names":["memo","Box","combineSx","LegendColorBadge","color","sx","others","height","width","margin","theme","spacing","style","backgroundColor"],"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,IAAI,QAAsB,QAAQ;AAC3C,SAASC,GAAG,QAAkB,gBAAgB;AAC9C,SAASC,SAAS,QAAQ,WAAW;AAMrC,OAAO,MAAMC,iCAAmBH,KAAK,SAASG,iBAAiB,EAC7DC,KAAK,EACLC,EAAE,EACF,GAAGC,QACmB;IACtB,qBACE,KAACL;QACE,GAAGK,MAAM;QACVD,IAAIH,UACF;YACEK,QAAQ;YACRC,OAAO;YACPC,QAAQ,CAACC,QAAUA,MAAMC,OAAO,CAAC;QACnC,GACAN;QAEFO,OAAO;YAAEC,iBAAiBT;QAAM;;AAGtC,GAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Legend/ListLegend.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 { Virtuoso } from 'react-virtuoso';\nimport { ReactElement } from 'react';\nimport { ListLegendItem, ListLegendItemProps } from './ListLegendItem';\nimport { LegendItem, SelectedLegendItemState, isLegendItemVisuallySelected } from './legend-model';\n\nexport interface ListLegendProps {\n items: LegendItem[];\n height: number;\n width: number;\n selectedItems: SelectedLegendItemState;\n onLegendItemClick: ListLegendItemProps['onClick'];\n onItemMouseOver: ListLegendItemProps['onMouseOver'];\n onItemMouseOut: ListLegendItemProps['onMouseOut'];\n}\n\n/**\n * ListLegend is used when legend.position is 'right' since legend items are\n * stacked. It is also used for `bottom` positioned legends when there are a\n * large number of items because it is virtualized and easier to visually scan\n * large numbers of items when there is a single item per row.\n */\nexport function ListLegend({\n items,\n height,\n width,\n selectedItems,\n onLegendItemClick,\n onItemMouseOver,\n onItemMouseOut,\n}: ListLegendProps): ReactElement {\n // show full labels on hover when there are many total series\n const truncateLabels = items.length > 5;\n\n return (\n <Virtuoso\n style={{ height, width }}\n data={items}\n itemContent={(index, item) => {\n return (\n <ListLegendItem\n key={item.id}\n item={item}\n index={index}\n truncateLabel={truncateLabels}\n isVisuallySelected={isLegendItemVisuallySelected(item, selectedItems)}\n onClick={onLegendItemClick}\n onMouseOver={onItemMouseOver}\n onMouseOut={onItemMouseOut}\n sx={{\n width: '100%',\n wordBreak: 'break-word',\n overflow: 'hidden',\n }}\n />\n );\n }}\n role=\"list\"\n />\n );\n}\n"],"names":["Virtuoso","ListLegendItem","isLegendItemVisuallySelected","ListLegend","items","height","width","selectedItems","onLegendItemClick","onItemMouseOver","onItemMouseOut","truncateLabels","length","style","data","itemContent","index","item","truncateLabel","isVisuallySelected","onClick","onMouseOver","onMouseOut","sx","wordBreak","overflow","id","role"],"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,QAAQ,QAAQ,iBAAiB;AAE1C,SAASC,cAAc,QAA6B,mBAAmB;AACvE,SAA8CC,4BAA4B,QAAQ,iBAAiB;AAYnG;;;;;CAKC,GACD,OAAO,SAASC,WAAW,EACzBC,KAAK,EACLC,MAAM,EACNC,KAAK,EACLC,aAAa,EACbC,iBAAiB,EACjBC,eAAe,EACfC,cAAc,EACE;IAChB,6DAA6D;IAC7D,MAAMC,iBAAiBP,MAAMQ,MAAM,GAAG;IAEtC,qBACE,KAACZ;QACCa,OAAO;YAAER;YAAQC;QAAM;QACvBQ,MAAMV;QACNW,aAAa,CAACC,OAAOC;YACnB,qBACE,KAAChB;gBAECgB,MAAMA;gBACND,OAAOA;gBACPE,eAAeP;gBACfQ,oBAAoBjB,6BAA6Be,MAAMV;gBACvDa,SAASZ;gBACTa,aAAaZ;gBACba,YAAYZ;gBACZa,IAAI;oBACFjB,OAAO;oBACPkB,WAAW;oBACXC,UAAU;gBACZ;eAZKR,KAAKS,EAAE;QAelB;QACAC,MAAK;;AAGX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Legend/ListLegendItem.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 { forwardRef, memo, MouseEvent, MouseEventHandler, ReactElement, useState } from 'react';\nimport { Box, ListItemText, ListItemProps, ListItemButton } from '@mui/material';\nimport { combineSx } from '../utils';\nimport { LegendColorBadge } from './LegendColorBadge';\nimport { LegendItem } from './legend-model';\n\nexport type LegendItemEventOpts = {\n /**\n * Unique identifier for the legend item.\n */\n id: string;\n\n /**\n * Index of the row in the original data.\n */\n index: number;\n};\n\nexport interface ListLegendItemProps extends Omit<ListItemProps<'div'>, 'onClick' | 'onMouseOver' | 'onMouseOut'> {\n item: LegendItem;\n\n index: number;\n\n /**\n * When true, the item is rendered differently to visually communicate it is\n * selected.\n */\n isVisuallySelected?: boolean;\n\n onClick: (e: MouseEvent<HTMLElement>, seriesId: string) => void;\n\n onMouseOver?: (e: MouseEvent, opts: LegendItemEventOpts) => void;\n onMouseOut?: (e: MouseEvent, opts: LegendItemEventOpts) => void;\n\n /**\n * When `true`, will keep labels to a single line with overflow ellipsized. The\n * full content will be shown on hover.\n *\n * When `false` or unset, will show the full label.\n */\n truncateLabel?: boolean;\n}\n\nconst ListLegendItemBase = forwardRef<HTMLDivElement, ListLegendItemProps>(function ListLegendItem(\n { item, sx, truncateLabel, onClick, isVisuallySelected, onMouseOver, onMouseOut, index, ...others },\n ref\n): ReactElement {\n const [noWrap, setNoWrap] = useState(truncateLabel);\n\n function handleTextMouseOver(): void {\n if (truncateLabel) {\n setNoWrap(false);\n }\n }\n\n function handleTextMouseOut(): void {\n if (truncateLabel) {\n setNoWrap(true);\n }\n }\n\n const handleClick: MouseEventHandler<HTMLDivElement> = (e) => {\n onClick(e, item.id);\n item.onClick?.(e);\n };\n\n return (\n <ListItemButton\n {...others}\n role=\"listitem\"\n sx={combineSx(\n {\n padding: 0,\n cursor: 'pointer',\n },\n sx\n )}\n dense={true}\n onClick={handleClick}\n onMouseOver={(e: MouseEvent) => onMouseOver?.(e, { id: item.id, index })}\n onMouseOut={(e: MouseEvent) => onMouseOut?.(e, { id: item.id, index })}\n selected={isVisuallySelected}\n ref={ref}\n >\n <Box sx={{ display: 'flex', alignItems: 'center' }}>\n <LegendColorBadge color={item.color} />\n </Box>\n <ListItemText\n primary={item.label}\n primaryTypographyProps={{ noWrap: noWrap }}\n onMouseOver={handleTextMouseOver}\n onMouseOut={handleTextMouseOut}\n ></ListItemText>\n </ListItemButton>\n );\n});\n\nexport const ListLegendItem = memo(ListLegendItemBase);\n"],"names":["forwardRef","memo","useState","Box","ListItemText","ListItemButton","combineSx","LegendColorBadge","ListLegendItemBase","ListLegendItem","item","sx","truncateLabel","onClick","isVisuallySelected","onMouseOver","onMouseOut","index","others","ref","noWrap","setNoWrap","handleTextMouseOver","handleTextMouseOut","handleClick","e","id","role","padding","cursor","dense","selected","display","alignItems","color","primary","label","primaryTypographyProps"],"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,UAAU,EAAEC,IAAI,EAA+CC,QAAQ,QAAQ,QAAQ;AAChG,SAASC,GAAG,EAAEC,YAAY,EAAiBC,cAAc,QAAQ,gBAAgB;AACjF,SAASC,SAAS,QAAQ,WAAW;AACrC,SAASC,gBAAgB,QAAQ,qBAAqB;AAwCtD,MAAMC,mCAAqBR,WAAgD,SAASS,eAClF,EAAEC,IAAI,EAAEC,EAAE,EAAEC,aAAa,EAAEC,OAAO,EAAEC,kBAAkB,EAAEC,WAAW,EAAEC,UAAU,EAAEC,KAAK,EAAE,GAAGC,QAAQ,EACnGC,GAAG;IAEH,MAAM,CAACC,QAAQC,UAAU,GAAGnB,SAASU;IAErC,SAASU;QACP,IAAIV,eAAe;YACjBS,UAAU;QACZ;IACF;IAEA,SAASE;QACP,IAAIX,eAAe;YACjBS,UAAU;QACZ;IACF;IAEA,MAAMG,cAAiD,CAACC;QACtDZ,QAAQY,GAAGf,KAAKgB,EAAE;QAClBhB,KAAKG,OAAO,GAAGY;IACjB;IAEA,qBACE,MAACpB;QACE,GAAGa,MAAM;QACVS,MAAK;QACLhB,IAAIL,UACF;YACEsB,SAAS;YACTC,QAAQ;QACV,GACAlB;QAEFmB,OAAO;QACPjB,SAASW;QACTT,aAAa,CAACU,IAAkBV,cAAcU,GAAG;gBAAEC,IAAIhB,KAAKgB,EAAE;gBAAET;YAAM;QACtED,YAAY,CAACS,IAAkBT,aAAaS,GAAG;gBAAEC,IAAIhB,KAAKgB,EAAE;gBAAET;YAAM;QACpEc,UAAUjB;QACVK,KAAKA;;0BAEL,KAAChB;gBAAIQ,IAAI;oBAAEqB,SAAS;oBAAQC,YAAY;gBAAS;0BAC/C,cAAA,KAAC1B;oBAAiB2B,OAAOxB,KAAKwB,KAAK;;;0BAErC,KAAC9B;gBACC+B,SAASzB,KAAK0B,KAAK;gBACnBC,wBAAwB;oBAAEjB,QAAQA;gBAAO;gBACzCL,aAAaO;gBACbN,YAAYO;;;;AAIpB;AAEA,OAAO,MAAMd,+BAAiBR,KAAKO,oBAAoB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Legend/TableLegend.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 { ReactElement, useMemo } from 'react';\nimport { Table, TableProps, TableColumnConfig } from '../Table';\nimport { LegendItem } from './legend-model';\n\nexport interface TableLegendProps extends Pick<TableProps<LegendItem>, 'sorting' | 'onSortingChange'> {\n items: LegendItem[];\n height: number;\n width: number;\n selectedItems: TableProps<LegendItem>['rowSelection'] | 'ALL';\n onSelectedItemsChange: TableProps<LegendItem>['onRowSelectionChange'];\n onItemMouseOver?: TableProps<LegendItem>['onRowMouseOver'];\n onItemMouseOut?: TableProps<LegendItem>['onRowMouseOut'];\n columns?: TableProps<LegendItem>['columns'];\n}\n\nconst COLUMNS: Array<TableColumnConfig<LegendItem>> = [\n {\n accessorKey: 'label',\n header: 'Name',\n enableSorting: true,\n\n // Starting with `title` attr instead of a tooltip because it is easier to\n // implement. We should try adding a tooltip in the future, but we'll need\n // to be very careful about performance when doing so with large tables.\n cell: ({ getValue }) => <span title={getValue()}>{getValue()}</span>,\n },\n];\n\nconst getRowId: NonNullable<TableProps<LegendItem>['getRowId']> = (data) => {\n return data.id;\n};\n\nconst getCheckboxColor: TableProps<LegendItem>['getCheckboxColor'] = (data) => {\n return data.color;\n};\n\nexport function TableLegend({\n items,\n selectedItems: initRowSelection,\n onSelectedItemsChange,\n onItemMouseOver,\n onItemMouseOut,\n height,\n width,\n columns: additionalColumns = [],\n sorting,\n onSortingChange,\n}: TableLegendProps): ReactElement {\n const rowSelection = useMemo(() => {\n return typeof initRowSelection !== 'string'\n ? initRowSelection\n : // Turn \"ALL\" state into a table component friendly map of all of the selected\n // items for checkboxes.\n // TODO: clean this up if we switch to also using checkboxes in list legend.\n items.reduce(\n (allRowSelection, item, index) => {\n allRowSelection[getRowId(item, index)] = true;\n return allRowSelection;\n },\n {} as Record<string, boolean>\n );\n }, [initRowSelection, items]);\n\n const columns = useMemo(() => {\n return [...COLUMNS, ...additionalColumns];\n }, [additionalColumns]);\n\n return (\n <Table\n height={height}\n width={width}\n rowSelection={rowSelection}\n onRowSelectionChange={onSelectedItemsChange}\n onRowMouseOver={onItemMouseOver}\n onRowMouseOut={onItemMouseOut}\n sorting={sorting}\n onSortingChange={onSortingChange}\n data={items}\n columns={columns}\n density=\"compact\"\n defaultColumnWidth=\"auto\"\n getRowId={getRowId}\n getCheckboxColor={getCheckboxColor}\n checkboxSelection\n rowSelectionVariant=\"legend\"\n />\n );\n}\n"],"names":["useMemo","Table","COLUMNS","accessorKey","header","enableSorting","cell","getValue","span","title","getRowId","data","id","getCheckboxColor","color","TableLegend","items","selectedItems","initRowSelection","onSelectedItemsChange","onItemMouseOver","onItemMouseOut","height","width","columns","additionalColumns","sorting","onSortingChange","rowSelection","reduce","allRowSelection","item","index","onRowSelectionChange","onRowMouseOver","onRowMouseOut","density","defaultColumnWidth","checkboxSelection","rowSelectionVariant"],"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,SAAuBA,OAAO,QAAQ,QAAQ;AAC9C,SAASC,KAAK,QAAuC,WAAW;AAchE,MAAMC,UAAgD;IACpD;QACEC,aAAa;QACbC,QAAQ;QACRC,eAAe;QAEf,0EAA0E;QAC1E,0EAA0E;QAC1E,wEAAwE;QACxEC,MAAM,CAAC,EAAEC,QAAQ,EAAE,iBAAK,KAACC;gBAAKC,OAAOF;0BAAaA;;IACpD;CACD;AAED,MAAMG,WAA4D,CAACC;IACjE,OAAOA,KAAKC,EAAE;AAChB;AAEA,MAAMC,mBAA+D,CAACF;IACpE,OAAOA,KAAKG,KAAK;AACnB;AAEA,OAAO,SAASC,YAAY,EAC1BC,KAAK,EACLC,eAAeC,gBAAgB,EAC/BC,qBAAqB,EACrBC,eAAe,EACfC,cAAc,EACdC,MAAM,EACNC,KAAK,EACLC,SAASC,oBAAoB,EAAE,EAC/BC,OAAO,EACPC,eAAe,EACE;IACjB,MAAMC,eAAe5B,QAAQ;QAC3B,OAAO,OAAOkB,qBAAqB,WAC/BA,mBAEA,wBAAwB;QACxB,4EAA4E;QAC5EF,MAAMa,MAAM,CACV,CAACC,iBAAiBC,MAAMC;YACtBF,eAAe,CAACpB,SAASqB,MAAMC,OAAO,GAAG;YACzC,OAAOF;QACT,GACA,CAAC;IAET,GAAG;QAACZ;QAAkBF;KAAM;IAE5B,MAAMQ,UAAUxB,QAAQ;QACtB,OAAO;eAAIE;eAAYuB;SAAkB;IAC3C,GAAG;QAACA;KAAkB;IAEtB,qBACE,KAACxB;QACCqB,QAAQA;QACRC,OAAOA;QACPK,cAAcA;QACdK,sBAAsBd;QACtBe,gBAAgBd;QAChBe,eAAed;QACfK,SAASA;QACTC,iBAAiBA;QACjBhB,MAAMK;QACNQ,SAASA;QACTY,SAAQ;QACRC,oBAAmB;QACnB3B,UAAUA;QACVG,kBAAkBA;QAClByB,iBAAiB;QACjBC,qBAAoB;;AAG1B"}
|
package/dist/Legend/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Legend/index.ts"],"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\nexport * from './Legend';\nexport * from './legend-model';\n"],"names":[],"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,cAAc,WAAW;AACzB,cAAc,iBAAiB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Legend/legend-model.ts"],"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 { MouseEventHandler } from 'react';\nimport { LegendOptionsBase } from '@perses-dev/core';\n\n// This file contains legend-related model code specific to the legend component.\n// See the `core` package for common/shared legend model code and the\n// `plugin-system` package for legend model code specific to panel plugin specs.\n\n// Note: explicitly defining different options for the legend component and\n// legend spec that extend from some common options, so we can allow the\n// component and the spec to diverge in some upcoming work.\nexport type LegendComponentOptions = LegendOptionsBase;\n\nexport interface LegendItem {\n id: string;\n label: string;\n color: string;\n\n /**\n * Additional data for the legend item. Useful for laying out additional\n * columns when using a table legend.\n */\n data?: Record<string, unknown>;\n\n onClick?: MouseEventHandler<HTMLElement>;\n}\n\n/**\n * State of selected items in the legend.\n * - When \"ALL\", all legend items are selected, but not visually highlighted.\n * - Otherwise, it is a Record that associates legend item ids with a boolean\n * value. When the associated entry for a legend item is `true`, that item\n * will be treated as selected and visually highlighted.\n */\nexport type SelectedLegendItemState = Record<LegendItem['id'], boolean> | 'ALL';\n\nexport function isLegendItemVisuallySelected(item: LegendItem, selectedItems: SelectedLegendItemState): boolean {\n // In the \"ALL\" case, technically all legend items are selected, but we do\n // not render them differently.\n return selectedItems !== 'ALL' && !!selectedItems[item.id];\n}\n"],"names":["isLegendItemVisuallySelected","item","selectedItems","id"],"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;AAqCjC,OAAO,SAASA,6BAA6BC,IAAgB,EAAEC,aAAsC;IACnG,0EAA0E;IAC1E,+BAA+B;IAC/B,OAAOA,kBAAkB,SAAS,CAAC,CAACA,aAAa,CAACD,KAAKE,EAAE,CAAC;AAC5D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/LinksEditor/LinksEditor.tsx"],"sourcesContent":["// Copyright 2024 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 { Fragment, HTMLAttributes, ReactElement } from 'react';\nimport { Checkbox, Divider, FormControlLabel, IconButton, Stack, TextField, Typography } from '@mui/material';\nimport { Controller, useFieldArray, Control } from 'react-hook-form';\nimport PlusIcon from 'mdi-material-ui/Plus';\nimport MinusIcon from 'mdi-material-ui/Minus';\nimport { PanelEditorValues } from '@perses-dev/core';\n\nexport interface LinksEditorProps extends HTMLAttributes<HTMLDivElement> {\n control: Control<PanelEditorValues>;\n}\n\nexport function LinksEditor({ control, ...props }: LinksEditorProps): ReactElement {\n const { fields, append, remove } = useFieldArray({\n control: control,\n name: 'panelDefinition.spec.links',\n });\n\n return (\n <Stack {...props} gap={3}>\n {fields && fields.length > 0 ? (\n fields.map((field, index) => (\n <Fragment key={field.id}>\n <Stack direction=\"row\" gap={1} alignItems=\"center\">\n <LinkControl control={control} index={index} />\n <IconButton style={{ width: 'fit-content', height: 'fit-content' }} onClick={() => remove(index)}>\n <MinusIcon />\n </IconButton>\n </Stack>\n <Divider />\n </Fragment>\n ))\n ) : (\n <Typography variant=\"subtitle1\" mb={2} fontStyle=\"italic\">\n No links defined\n </Typography>\n )}\n <IconButton style={{ width: 'fit-content', height: 'fit-content' }} onClick={() => append({ url: '' })}>\n <PlusIcon />\n </IconButton>\n </Stack>\n );\n}\n\nfunction LinkControl({ control, index }: { control: Control<PanelEditorValues>; index: number }): ReactElement {\n return (\n <Stack gap={2} flexGrow={1}>\n <Stack direction=\"row\" gap={2}>\n <Controller\n control={control}\n name={`panelDefinition.spec.links.${index}.url`}\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n required\n fullWidth\n label=\"URL\"\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n onChange={(event) => {\n field.onChange(event);\n }}\n />\n )}\n />\n <Controller\n control={control}\n name={`panelDefinition.spec.links.${index}.name`}\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n fullWidth\n label=\"Name\"\n defaultValue=\"\"\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n onChange={(event) => {\n field.onChange(event);\n }}\n />\n )}\n />\n <Controller\n control={control}\n name={`panelDefinition.spec.links.${index}.tooltip`}\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n fullWidth\n label=\"Tooltip\"\n defaultValue=\"\"\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n onChange={(event) => {\n field.onChange(event);\n }}\n />\n )}\n />\n </Stack>\n <Stack gap={2} direction=\"row\" alignItems=\"center\">\n <Controller\n control={control}\n name={`panelDefinition.spec.links.${index}.renderVariables`}\n render={({ field }) => (\n <FormControlLabel\n label=\"Render Variables\"\n control={<Checkbox {...field} checked={field.value} onChange={(e) => field.onChange(e.target.checked)} />}\n />\n )}\n />\n <Controller\n control={control}\n name={`panelDefinition.spec.links.${index}.targetBlank`}\n render={({ field }) => (\n <FormControlLabel\n label=\"Open in new tab\"\n control={<Checkbox {...field} checked={field.value} onChange={(e) => field.onChange(e.target.checked)} />}\n />\n )}\n />\n </Stack>\n </Stack>\n );\n}\n"],"names":["Fragment","Checkbox","Divider","FormControlLabel","IconButton","Stack","TextField","Typography","Controller","useFieldArray","PlusIcon","MinusIcon","LinksEditor","control","props","fields","append","remove","name","gap","length","map","field","index","direction","alignItems","LinkControl","style","width","height","onClick","id","variant","mb","fontStyle","url","flexGrow","render","fieldState","required","fullWidth","label","error","helperText","message","onChange","event","defaultValue","checked","value","e","target"],"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,QAAQ,QAAsC,QAAQ;AAC/D,SAASC,QAAQ,EAAEC,OAAO,EAAEC,gBAAgB,EAAEC,UAAU,EAAEC,KAAK,EAAEC,SAAS,EAAEC,UAAU,QAAQ,gBAAgB;AAC9G,SAASC,UAAU,EAAEC,aAAa,QAAiB,kBAAkB;AACrE,OAAOC,cAAc,uBAAuB;AAC5C,OAAOC,eAAe,wBAAwB;AAO9C,OAAO,SAASC,YAAY,EAAEC,OAAO,EAAE,GAAGC,OAAyB;IACjE,MAAM,EAAEC,MAAM,EAAEC,MAAM,EAAEC,MAAM,EAAE,GAAGR,cAAc;QAC/CI,SAASA;QACTK,MAAM;IACR;IAEA,qBACE,MAACb;QAAO,GAAGS,KAAK;QAAEK,KAAK;;YACpBJ,UAAUA,OAAOK,MAAM,GAAG,IACzBL,OAAOM,GAAG,CAAC,CAACC,OAAOC,sBACjB,MAACvB;;sCACC,MAACK;4BAAMmB,WAAU;4BAAML,KAAK;4BAAGM,YAAW;;8CACxC,KAACC;oCAAYb,SAASA;oCAASU,OAAOA;;8CACtC,KAACnB;oCAAWuB,OAAO;wCAAEC,OAAO;wC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AA2B,EAAEK,MAAM,QAAQ,CAAC;wBACnDc,QAAQ,CAAC,EAAEf,KAAK,EAAEgB,UAAU,EAAE,iBAC5B,KAAChC;gCACE,GAAGgB,KAAK;gCACTkB,SAAS;gCACTC,OAAM;gCACNM,cAAa;gCACbL,OAAO,CAAC,CAACJ,WAAWI,KAAK;gCACzBC,YAAYL,WAAWI,KAAK,EAAEE;gCAC9BC,UAAU,CAACC;oCACTxB,MAAMuB,QAAQ,CAACC;gCACjB;;;;;0BAKR,MAACzC;gBAAMc,KAAK;gBAAGK,WAAU;gBAAMC,YAAW;;kCACxC,KAACjB;wBACCK,SAASA;wBACTK,MAAM,CAAC,2BAA2B,EAAEK,MAAM,gBAAgB,CAAC;wBAC3Dc,QAAQ,CAAC,EAAEf,KAAK,EAAE,iBAChB,KAACnB;gCACCsC,OAAM;gCACN5B,uBAAS,KAACZ;oCAAU,GAAGqB,KAAK;oCAAE0B,SAAS1B,MAAM2B,KAAK;oCAAEJ,UAAU,CAACK,IAAM5B,MAAMuB,QAAQ,CAACK,EAAEC,MAAM,CAACH,OAAO;;;;kCAI1G,KAACxC;wBACCK,SAASA;wBACTK,MAAM,CAAC,2BAA2B,EAAEK,MAAM,YAAY,CAAC;wBACvDc,QAAQ,CAAC,EAAEf,KAAK,EAAE,iBAChB,KAACnB;gCACCsC,OAAM;gCACN5B,uBAAS,KAACZ;oCAAU,GAAGqB,KAAK;oCAAE0B,SAAS1B,MAAM2B,KAAK;oCAAEJ,UAAU,CAACK,IAAM5B,MAAMuB,QAAQ,CAACK,EAAEC,MAAM,CAACH,OAAO;;;;;;;;AAOlH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ModeSelector/ModeSelector.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 { ReactElement } from 'react';\nimport { OptionsEditorControl } from '../OptionsEditorLayout';\nimport { SettingsAutocomplete } from '../SettingsAutocomplete';\n\nconst MODE_OPTIONS: Array<{ id: ModeOption; label: string }> = [\n { id: 'value', label: 'Value' },\n { id: 'percentage', label: 'Percentage' },\n];\n\nexport type ModeOption = 'value' | 'percentage';\n\nexport interface ModeSelectorProps {\n disablePercentageMode: boolean;\n onChange: (mode: ModeOption) => void;\n value?: ModeOption;\n}\n\nexport function ModeSelector({ disablePercentageMode, onChange, value = 'value' }: ModeSelectorProps): ReactElement {\n const handleModeChange = (_: unknown, { id }: { id: ModeOption }): void => {\n onChange(id);\n };\n\n return (\n <OptionsEditorControl\n label=\"Mode\"\n control={\n <SettingsAutocomplete\n value={MODE_OPTIONS.find((o) => o.id === value)}\n options={MODE_OPTIONS}\n getOptionLabel={(o) => o.label}\n getOptionDisabled={(o) => o.id === 'percentage' && disablePercentageMode}\n onChange={handleModeChange}\n disableClearable\n />\n }\n />\n );\n}\n"],"names":["OptionsEditorControl","SettingsAutocomplete","MODE_OPTIONS","id","label","ModeSelector","disablePercentageMode","onChange","value","handleModeChange","_","control","find","o","options","getOptionLabel","getOptionDisabled","disableClearable"],"mappings":"AAAA,oCAAoC;AACpC,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,wEAAwE;AACxE,qEAAqE;AACrE,6EAA6E;AAC7E,sEAAsE;AACtE,iCAAiC;;AAGjC,SAASA,oBAAoB,QAAQ,yBAAyB;AAC9D,SAASC,oBAAoB,QAAQ,0BAA0B;AAE/D,MAAMC,eAAyD;IAC7D;QAAEC,IAAI;QAASC,OAAO;IAAQ;IAC9B;QAAED,IAAI;QAAcC,OAAO;IAAa;CACzC;AAUD,OAAO,SAASC,aAAa,EAAEC,qBAAqB,EAAEC,QAAQ,EAAEC,QAAQ,OAAO,EAAqB;IAClG,MAAMC,mBAAmB,CAACC,GAAY,EAAEP,EAAE,EAAsB;QAC9DI,SAASJ;IACX;IAEA,qBACE,KAACH;QACCI,OAAM;QACNO,uBACE,KAACV;YACCO,OAAON,aAAaU,IAAI,CAAC,CAACC,IAAMA,EAAEV,EAAE,KAAKK;YACzCM,SAASZ;YACTa,gBAAgB,CAACF,IAAMA,EAAET,KAAK;YAC9BY,mBAAmB,CAACH,IAAMA,EAAEV,EAAE,KAAK,gBAAgBG;YACnDC,UAAUE;YACVQ,gBAAgB;;;AAK1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ModeSelector/index.ts"],"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\nexport * from './ModeSelector';\n"],"names":[],"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,cAAc,iBAAiB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorColumn.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 { Grid, Stack } from '@mui/material';\nimport { ReactElement } from 'react';\n\nexport type OptionsEditorColumnProps = {\n /**\n * Components to render in the column. These will usually be\n * `OptionsEditorGroup` components.\n */\n children: React.ReactNode;\n};\n\n/**\n * Lay out content in a column within panel options.\n */\nexport const OptionsEditorColumn = ({ children }: OptionsEditorColumnProps): ReactElement => {\n return (\n <Grid item xs={4}>\n <Stack spacing={3}>{children}</Stack>\n </Grid>\n );\n};\n"],"names":["Grid","Stack","OptionsEditorColumn","children","item","xs","spacing"],"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,IAAI,EAAEC,KAAK,QAAQ,gBAAgB;AAW5C;;CAEC,GACD,OAAO,MAAMC,sBAAsB,CAAC,EAAEC,QAAQ,EAA4B;IACxE,qBACE,KAACH;QAAKI,IAAI;QAACC,IAAI;kBACb,cAAA,KAACJ;YAAMK,SAAS;sBAAIH;;;AAG1B,EAAE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorControl.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 { FormControl, FormLabel, FormControlLabelProps, Stack, Box, IconButton } from '@mui/material';\nimport React, { ReactElement } from 'react';\nimport InformationOutlineIcon from 'mdi-material-ui/InformationOutline';\nimport { useId } from '../utils';\nimport { InfoTooltip } from '../InfoTooltip';\n\nexport type OptionsEditorControlProps = Pick<FormControlLabelProps, 'label' | 'control'> & {\n description?: string;\n};\n\nexport const OptionsEditorControl = ({ label, control, description }: OptionsEditorControlProps): ReactElement => {\n // Make sure we have a unique ID we can use for associating labels and\n // controls for a11y.\n const generatedControlId = useId('EditorSectionControl');\n const controlId = `${generatedControlId}-control`;\n\n const controlProps = {\n id: controlId,\n };\n\n return (\n <FormControl>\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\">\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"center\">\n <FormLabel htmlFor={controlId}>{label}</FormLabel>\n {description && (\n <InfoTooltip description={description} enterDelay={100}>\n <IconButton\n size=\"small\"\n sx={(theme) => ({ borderRadius: theme.shape.borderRadius, padding: '4x', margin: '0 2px' })}\n >\n <InformationOutlineIcon\n aria-describedby=\"info-tooltip\"\n aria-hidden={false}\n fontSize=\"inherit\"\n sx={{ color: (theme) => theme.palette.grey[700] }}\n />\n </IconButton>\n </InfoTooltip>\n )}\n </Stack>\n <Box sx={{ width: '180px', textAlign: 'right' }}> {React.cloneElement(control, controlProps)}</Box>\n </Stack>\n </FormControl>\n );\n};\n"],"names":["FormControl","FormLabel","Stack","Box","IconButton","React","InformationOutlineIcon","useId","InfoTooltip","OptionsEditorControl","label","control","description","generatedControlId","controlId","controlProps","id","direction","alignItems","justifyContent","htmlFor","enterDelay","size","sx","theme","borderRadius","shape","padding","margin","aria-describedby","aria-hidden","fontSize","color","palette","grey","width","textAlign","cloneElement"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oE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/OptionsEditorGrid.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 { Grid } from '@mui/material';\nimport { ReactElement } from 'react';\n\nexport type OptionsEditorGridProps = {\n /**\n * 1-3 `OptionsEditorColumn` components to render content in columns.\n */\n children: React.ReactNode;\n};\n\n/**\n * Top level grid container used to lay out content for editing in panel\n * options.\n */\nexport const OptionsEditorGrid = ({ children }: OptionsEditorGridProps): ReactElement => {\n return (\n <Grid container spacing={8}>\n {children}\n </Grid>\n );\n};\n"],"names":["Grid","OptionsEditorGrid","children","container","spacing"],"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,IAAI,QAAQ,gBAAgB;AAUrC;;;CAGC,GACD,OAAO,MAAMC,oBAAoB,CAAC,EAAEC,QAAQ,EAA0B;IACpE,qBACE,KAACF;QAAKG,SAAS;QAACC,SAAS;kBACtBF;;AAGP,EAAE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorGroup.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 { Box, Typography, Stack } from '@mui/material';\nimport React, { ReactElement } from 'react';\n\nexport type OptionsEditorGroupProps = {\n /**\n * Text that communicates the purpose of the grouping.\n */\n title: string;\n children: React.ReactNode;\n icon?: React.ReactNode;\n};\n\n/**\n * Group similar content within panel options.\n */\nexport const OptionsEditorGroup = ({ title, children, icon }: OptionsEditorGroupProps): ReactElement => {\n return (\n <Box>\n <Box display=\"flex\" borderBottom={1} borderColor=\"grey.300\" marginBottom={(theme) => theme.spacing(1)}>\n <Typography variant=\"overline\" component=\"h4\">\n {title}\n </Typography>\n {icon && <Box sx={{ marginLeft: 'auto' }}>{icon}</Box>}\n </Box>\n <Stack spacing={1}>{children}</Stack>\n </Box>\n );\n};\n"],"names":["Box","Typography","Stack","React","OptionsEditorGroup","title","children","icon","display","borderBottom","borderColor","marginBottom","theme","spacing","variant","component","sx","marginLeft"],"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,GAAG,EAAEC,UAAU,EAAEC,KAAK,QAAQ,gBAAgB;AACvD,OAAOC,WAA6B,QAAQ;AAW5C;;CAEC,GACD,OAAO,MAAMC,qBAAqB,CAAC,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,IAAI,EAA2B;IACnF,qBACE,MAACP;;0BACC,MAACA;gBAAIQ,SAAQ;gBAAOC,cAAc;gBAAGC,aAAY;gBAAWC,cAAc,CAACC,QAAUA,MAAMC,OAAO,CAAC;;kCACjG,KAACZ;wBAAWa,SAAQ;wBAAWC,WAAU;kCACtCV;;oBAEFE,sBAAQ,KAACP;wBAAIgB,IAAI;4BAAEC,YAAY;wBAAO;kCAAIV;;;;0BAE7C,KAACL;gBAAMW,SAAS;0BAAIP;;;;AAG1B,EAAE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Overlay/Overlay.tsx"],"sourcesContent":["// Copyright 2024 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 { Skeleton, SkeletonOwnProps, Stack, Typography } from '@mui/material';\nimport { ReactElement } from 'react';\n\ninterface TextOverlayProps {\n message: string;\n}\n\nexport function TextOverlay(props: TextOverlayProps): ReactElement {\n const { message } = props;\n\n return (\n <Stack sx={{ height: '100%', alignItems: 'center', justifyContent: 'center' }}>\n <Typography>{message}</Typography>\n </Stack>\n );\n}\n\ninterface NoDataOverlayProps {\n resource: string;\n}\n\nexport function NoDataOverlay(props: NoDataOverlayProps): ReactElement {\n const { resource } = props;\n\n return <TextOverlay message={`No ${resource}`} />;\n}\n\ninterface LoadingOverlayProps {\n variant?: SkeletonOwnProps['variant'];\n}\n\nexport function LoadingOverlay(props: LoadingOverlayProps): ReactElement {\n const { variant = 'rounded' } = props;\n\n return (\n <Stack sx={{ height: '100%', alignItems: 'center', justifyContent: 'center', px: 1 }}>\n <Skeleton variant={variant} width=\"100%\" height=\"30%\" aria-label=\"Loading...\" />\n </Stack>\n );\n}\n"],"names":["Skeleton","Stack","Typography","TextOverlay","props","message","sx","height","alignItems","justifyContent","NoDataOverlay","resource","LoadingOverlay","variant","px","width","aria-label"],"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,QAAQ,EAAoBC,KAAK,EAAEC,UAAU,QAAQ,gBAAgB;AAO9E,OAAO,SAASC,YAAYC,KAAuB;IACjD,MAAM,EAAEC,OAAO,EAAE,GAAGD;IAEpB,qBACE,KAACH;QAAMK,IAAI;YAAEC,QAAQ;YAAQC,YAAY;YAAUC,gBAAgB;QAAS;kBAC1E,cAAA,KAACP;sBAAYG;;;AAGnB;AAMA,OAAO,SAASK,cAAcN,KAAyB;IACrD,MAAM,EAAEO,QAAQ,EAAE,GAAGP;IAErB,qBAAO,KAACD;QAAYE,SAAS,CAAC,GAAG,EAAEM,UAAU;;AAC/C;AAMA,OAAO,SAASC,eAAeR,KAA0B;IACvD,MAAM,EAAES,UAAU,SAAS,EAAE,GAAGT;IAEhC,qBACE,KAACH;QAAMK,IAAI;YAAEC,QAAQ;YAAQC,YAAY;YAAUC,gBAAgB;YAAUK,IAAI;QAAE;kBACjF,cAAA,KAACd;YAASa,SAASA;YAASE,OAAM;YAAOR,QAAO;YAAMS,cAAW;;;AAGvE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Overlay/index.ts"],"sourcesContent":["// Copyright 2024 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\nexport * from './Overlay';\n"],"names":[],"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,cAAc,YAAY"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/RefreshIntervalPicker/RefreshIntervalPicker.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 { Box, FormControl, MenuItem, Select } from '@mui/material';\nimport { DurationString } from '@perses-dev/core';\nimport { ReactElement, useMemo } from 'react';\nimport { TimeOption } from '../model';\n\ninterface RefreshIntervalPickerProps {\n timeOptions: TimeOption[];\n value?: DurationString;\n onChange: (value: DurationString) => void;\n height?: string;\n}\n\nexport function RefreshIntervalPicker(props: RefreshIntervalPickerProps): ReactElement {\n const { value, onChange, timeOptions, height } = props;\n const formattedValue = value;\n\n // If the dashboard refresh interval is not provided in timeOptions, it will create a specific option for the select\n const customInterval = useMemo(() => {\n if (value && !timeOptions.some((option) => option.value.pastDuration === value)) {\n return <MenuItem value={value}>{value}</MenuItem>;\n }\n }, [timeOptions, value]);\n\n return (\n <FormControl>\n <Box>\n <Select\n id=\"refreshInterval\"\n value={formattedValue}\n onChange={(event) => {\n const duration = event.target.value as DurationString;\n onChange(duration);\n }}\n inputProps={{\n 'aria-label': `Select refresh interval. Currently set to ${formattedValue}`,\n }}\n sx={{\n '.MuiSelect-select': height ? { lineHeight: height, paddingY: 0 } : {},\n }}\n >\n {timeOptions.map((item, idx) => (\n <MenuItem key={idx} value={item.value.pastDuration}>\n {item.display}\n </MenuItem>\n ))}\n {customInterval}\n </Select>\n </Box>\n </FormControl>\n );\n}\n"],"names":["Box","FormControl","MenuItem","Select","useMemo","RefreshIntervalPicker","props","value","onChange","timeOptions","height","formattedValue","customInterval","some","option","pastDuration","id","event","duration","target","inputProps","sx","lineHeight","paddingY","map","item","idx","display"],"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,GAAG,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,gBAAgB;AAEnE,SAAuBC,OAAO,QAAQ,QAAQ;AAU9C,OAAO,SAASC,sBAAsBC,KAAiC;IACrE,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,MAAM,EAAE,GAAGJ;IACjD,MAAMK,iBAAiBJ;IAEvB,oHAAoH;IACpH,MAAMK,iBAAiBR,QAAQ;QAC7B,IAAIG,SAAS,CAACE,YAAYI,IAAI,CAAC,CAACC,SAAWA,OAAOP,KAAK,CAACQ,YAAY,KAAKR,QAAQ;YAC/E,qBAAO,KAACL;gBAASK,OAAOA;0BAAQA;;QAClC;IACF,GAAG;QAACE;QAAaF;KAAM;IAEvB,qBACE,KAACN;kBACC,cAAA,KAACD;sBACC,cAAA,MAACG;gBACCa,IAAG;gBACHT,OAAOI;gBACPH,UAAU,CAACS;oBACT,MAAMC,WAAWD,MAAME,MAAM,CAACZ,KAAK;oBACnCC,SAASU;gBACX;gBACAE,YAAY;oBACV,cAAc,CAAC,0CAA0C,EAAET,gBAAgB;gBAC7E;gBACAU,IAAI;oBACF,qBAAqBX,SAAS;wBAAEY,YAAYZ;wBAAQa,UAAU;oBAAE,IAAI,CAAC;gBACvE;;oBAECd,YAAYe,GAAG,CAAC,CAACC,MAAMC,oBACtB,KAACxB;4BAAmBK,OAAOkB,KAAKlB,KAAK,CAACQ,YAAY;sCAC/CU,KAAKE,OAAO;2BADAD;oBAIhBd;;;;;AAKX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/SettingsAutocomplete/SettingsAutocomplete.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 {\n Autocomplete,\n AutocompleteProps,\n TextField,\n Typography,\n UseAutocompleteProps,\n createFilterOptions,\n} from '@mui/material';\nimport { ReactElement, ReactNode } from 'react';\n\n/**\n * Interface to extend from for `options` when using `SettingsAutocomplete`.\n */\nexport interface SettingsAutocompleteOption {\n /**\n * Unique identifier for the option.\n */\n id: string;\n\n /**\n * Optional value that is presented to the user for each option. If not set,\n * the `id` will be used instead.\n */\n label?: string;\n\n /**\n * Optional description that will be rendered below the `label` to provide the\n * user with additional information about the option.\n */\n description?: ReactNode;\n\n /**\n * When `true`, the option will be disabled.\n */\n disabled?: boolean;\n}\n\nexport interface SettingsAutocompleteProps<\n OptionType extends SettingsAutocompleteOption,\n Multiple extends boolean | undefined,\n DisableClearable extends boolean | undefined,\n // Note that the last `false` in the generic arguments sets the `freeSolo` option to `false`.\n // This component is intended to be used with a discrete list of options, so `freeSolo` never\n // needs to be `true`.\n> extends Omit<AutocompleteProps<OptionType, Multiple, DisableClearable, false>, 'renderInput'> {\n // Modifying this to optional, so we can define a sensible default below that\n // is used in many of the simple cases.\n renderInput?: AutocompleteProps<OptionType, Multiple, DisableClearable, false>['renderInput'];\n}\n\n/**\n * Opinionated autocomplete component useful for providing users with a dropdown\n * for settings that require selecting one or more options from a list.\n *\n * **Note: This component is currently experimental and is likely to have significant breaking changes in the near future. Use with caution outside of the core Perses codebase.**\n */\nexport function SettingsAutocomplete<\n OptionType extends SettingsAutocompleteOption,\n Multiple extends boolean | undefined = false,\n DisableClearable extends boolean | undefined = false,\n>({\n options,\n renderInput = (params): ReactElement => <TextField {...params} />,\n ...otherProps\n}: SettingsAutocompleteProps<OptionType, Multiple, DisableClearable>): ReactElement {\n const getOptionLabel: UseAutocompleteProps<OptionType, undefined, boolean, undefined>['getOptionLabel'] = (\n option\n ) => {\n return option.label ?? option.id;\n };\n\n // Note: this component currently is not virtualized because it is specific\n // to being used for settings, which generally have a pretty small list of\n // options. If this changes to include values with many options, virtualization\n // should be added using react-virtuoso.\n return (\n <Autocomplete\n isOptionEqualToValue={(option, value) => option.id === value.id}\n getOptionDisabled={(option) => !!option.disabled}\n getOptionLabel={getOptionLabel}\n options={options}\n renderInput={renderInput}\n renderOption={({ key, ...props }, option) => {\n return (\n <li key={key} {...props}>\n <div>\n <Typography variant=\"body1\" component=\"div\">\n {getOptionLabel(option)}\n </Typography>\n {option.description && (\n <Typography variant=\"body2\" component=\"div\" sx={{ color: (theme) => theme.palette.text.secondary }}>\n {option.description}\n </Typography>\n )}\n </div>\n </li>\n );\n }}\n filterOptions={createFilterOptions({\n // Include the label and the description in search.\n stringify: (option) => `${getOptionLabel(option)} ${option.description || ''}`,\n })}\n {...otherProps}\n />\n );\n}\n"],"names":["Autocomplete","TextField","Typography","createFilterOptions","SettingsAutocomplete","options","renderInput","params","otherProps","getOptionLabel","option","label","id","isOptionEqualToValue","value","getOptionDisabled","disabled","renderOption","key","props","li","div","variant","component","description","sx","color","theme","palette","text","secondary","filterOptions","stringify"],"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,SACEA,YAAY,EAEZC,SAAS,EACTC,UAAU,EAEVC,mBAAmB,QACd,gBAAgB;AA2CvB;;;;;CAKC,GACD,OAAO,SAASC,qBAId,EACAC,OAAO,EACPC,cAAc,CAACC,uBAAyB,KAACN;QAAW,GAAGM,MAAM;MAAI,EACjE,GAAGC,YAC+D;IAClE,MAAMC,iBAAoG,CACxGC;QAEA,OAAOA,OAAOC,KAAK,IAAID,OAAOE,EAAE;IAClC;IAEA,2EAA2E;IAC3E,0EAA0E;IAC1E,+EAA+E;IAC/E,wCAAwC;IACxC,qBACE,KAACZ;QACCa,sBAAsB,CAACH,QAAQI,QAAUJ,OAAOE,EAAE,KAAKE,MAAMF,EAAE;QAC/DG,mBAAmB,CAACL,SAAW,CAAC,CAACA,OAAOM,QAAQ;QAChDP,gBAAgBA;QAChBJ,SAASA;QACTC,aAAaA;QACbW,cAAc,CAAC,EAAEC,GAAG,EAAE,GAAGC,OAAO,EAAET;YAChC,qBACE,KAACU;gBAAc,GAAGD,KAAK;0BACrB,cAAA,MAACE;;sCACC,KAACnB;4BAAWoB,SAAQ;4BAAQC,WAAU;sCACnCd,eAAeC;;wBAEjBA,OAAOc,WAAW,kBACjB,KAACtB;4BAAWoB,SAAQ;4BAAQC,WAAU;4BAAME,IAAI;gCAAEC,OAAO,CAACC,QAAUA,MAAMC,OAAO,CAACC,IAAI,CAACC,SAAS;4BAAC;sCAC9FpB,OAAOc,WAAW;;;;eAPlBN;QAab;QACAa,eAAe5B,oBAAoB;YACjC,mDAAmD;YACnD6B,WAAW,CAACtB,SAAW,GAAGD,eAAeC,QAAQ,CAAC,EAAEA,OAAOc,WAAW,IAAI,IAAI;QAChF;QACC,GAAGhB,UAAU;;AAGpB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/SortSelector/SortSelector.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 { ReactElement } from 'react';\nimport { OptionsEditorControl } from '../OptionsEditorLayout';\nimport { SettingsAutocomplete } from '../SettingsAutocomplete';\n\nconst SORT_OPTIONS: Array<{ id: SortOption; label: string }> = [\n { id: 'asc', label: 'Ascending' },\n { id: 'desc', label: 'Descending' },\n];\n\nexport type SortOption = 'asc' | 'desc';\n\nexport interface SortSelectorProps {\n onChange: (sort: SortOption) => void;\n value?: SortOption;\n}\n\nexport function SortSelector({ onChange, value = 'desc' }: SortSelectorProps): ReactElement {\n const handleSortChange = (_: unknown, { id }: { id: SortOption }): void => {\n onChange(id);\n };\n\n return (\n <OptionsEditorControl\n label=\"Sort\"\n control={\n <SettingsAutocomplete\n value={SORT_OPTIONS.find((o) => o.id === value)}\n options={SORT_OPTIONS}\n getOptionLabel={(o) => o.label}\n onChange={handleSortChange}\n disableClearable\n />\n }\n />\n );\n}\n"],"names":["OptionsEditorControl","SettingsAutocomplete","SORT_OPTIONS","id","label","SortSelector","onChange","value","handleSortChange","_","control","find","o","options","getOptionLabel","disableClearable"],"mappings":"AAAA,oCAAoC;AACpC,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,wEAAwE;AACxE,qEAAqE;AACrE,6EAA6E;AAC7E,sEAAsE;AACtE,iCAAiC;;AAGjC,SAASA,oBAAoB,QAAQ,yBAAyB;AAC9D,SAASC,oBAAoB,QAAQ,0BAA0B;AAE/D,MAAMC,eAAyD;IAC7D;QAAEC,IAAI;QAAOC,OAAO;IAAY;IAChC;QAAED,IAAI;QAAQC,OAAO;IAAa;CACnC;AASD,OAAO,SAASC,aAAa,EAAEC,QAAQ,EAAEC,QAAQ,MAAM,EAAqB;IAC1E,MAAMC,mBAAmB,CAACC,GAAY,EAAEN,EAAE,EAAsB;QAC9DG,SAASH;IACX;IAEA,qBACE,KAACH;QACCI,OAAM;QACNM,uBACE,KAACT;YACCM,OAAOL,aAAaS,IAAI,CAAC,CAACC,IAAMA,EAAET,EAAE,KAAKI;YACzCM,SAASX;YACTY,gBAAgB,CAACF,IAAMA,EAAER,KAAK;YAC9BE,UAAUE;YACVO,gBAAgB;;;AAK1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/SortSelector/SortSelectorButtons.tsx"],"sourcesContent":["// Copyright 2024 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 { Button, ButtonGroup, ButtonGroupProps } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { SortOption } from './SortSelector';\n\nexport interface SortSelectorButtonsProps extends Omit<ButtonGroupProps, 'onChange'> {\n value?: SortOption;\n onChange: (sort?: SortOption) => void;\n}\n\nexport function SortSelectorButtons({ onChange, value, ...props }: SortSelectorButtonsProps): ReactElement {\n const handleSortChange = (sort?: SortOption): void => {\n onChange(sort);\n };\n\n return (\n <ButtonGroup aria-label=\"Sort\" {...props}>\n <Button onClick={() => handleSortChange(undefined)} variant={value === undefined ? 'contained' : 'outlined'}>\n None\n </Button>\n <Button onClick={() => handleSortChange('asc')} variant={value === 'asc' ? 'contained' : 'outlined'}>\n Asc\n </Button>\n <Button onClick={() => handleSortChange('desc')} variant={value === 'desc' ? 'contained' : 'outlined'}>\n Desc\n </Button>\n </ButtonGroup>\n );\n}\n"],"names":["Button","ButtonGroup","SortSelectorButtons","onChange","value","props","handleSortChange","sort","aria-label","onClick","undefined","variant"],"mappings":"AAAA,oCAAoC;AACpC,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,wEAAwE;AACxE,qEAAqE;AACrE,6EAA6E;AAC7E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,MAAM,EAAEC,WAAW,QAA0B,gBAAgB;AAStE,OAAO,SAASC,oBAAoB,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGC,OAAiC;IACzF,MAAMC,mBAAmB,CAACC;QACxBJ,SAASI;IACX;IAEA,qBACE,MAACN;QAAYO,cAAW;QAAQ,GAAGH,KAAK;;0BACtC,KAACL;gBAAOS,SAAS,IAAMH,iBAAiBI;gBAAYC,SAASP,UAAUM,YAAY,cAAc;0BAAY;;0BAG7G,KAACV;gBAAOS,SAAS,IAAMH,iBAAiB;gBAAQK,SAASP,UAAU,QAAQ,cAAc;0BAAY;;0BAGrG,KAACJ;gBAAOS,SAAS,IAAMH,iBAAiB;gBAASK,SAASP,UAAU,SAAS,cAAc;0BAAY;;;;AAK7G"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/SortSelector/index.ts"],"sourcesContent":["// Copyright 2024 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\nexport * from './SortSelector';\nexport * from './SortSelectorButtons';\n"],"names":[],"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,cAAc,iBAAiB;AAC/B,cAAc,wBAAwB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Table/InnerTable.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 { Table as MuiTable, styled, TableProps as MuiTableProps } from '@mui/material';\nimport { forwardRef } from 'react';\nimport { TableDensity } from './model/table-model';\n\nconst StyledMuiTable = styled(MuiTable)(({ theme }) => ({\n // This value is needed to have a consistent table layout when scrolling.\n tableLayout: 'fixed',\n borderCollapse: 'separate',\n backgroundColor: theme.palette.background.default,\n}));\n\ntype InnerTableProps = Omit<MuiTableProps, 'size'> & {\n density: TableDensity;\n};\n\nconst TABLE_DENSITY_CONFIG: Record<TableDensity, MuiTableProps['size']> = {\n compact: 'small',\n standard: 'medium',\n comfortable: 'medium',\n};\n\nexport const InnerTable = forwardRef<HTMLTableElement, InnerTableProps>(function InnerTable(\n { density, ...otherProps },\n ref\n) {\n return (\n <StyledMuiTable\n {...otherProps}\n tabIndex={-1}\n size={TABLE_DENSITY_CONFIG[density]}\n ref={ref}\n sx={{\n width: '100%',\n }}\n />\n );\n});\n"],"names":["Table","MuiTable","styled","forwardRef","StyledMuiTable","theme","tableLayout","borderCollapse","backgroundColor","palette","background","default","TABLE_DENSITY_CONFIG","compact","standard","comfortable","InnerTable","density","otherProps","ref","tabIndex","size","sx","width"],"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,SAASC,QAAQ,EAAEC,MAAM,QAAqC,gBAAgB;AACvF,SAASC,UAAU,QAAQ,QAAQ;AAGnC,MAAMC,iBAAiBF,OAAOD,UAAU,CAAC,EAAEI,KAAK,EAAE,GAAM,CAAA;QACtD,yEAAyE;QACzEC,aAAa;QACbC,gBAAgB;QAChBC,iBAAiBH,MAAMI,OAAO,CAACC,UAAU,CAACC,OAAO;IACnD,CAAA;AAMA,MAAMC,uBAAoE;IACxEC,SAAS;IACTC,UAAU;IACVC,aAAa;AACf;AAEA,OAAO,MAAMC,2BAAab,WAA8C,SAASa,WAC/E,EAAEC,OAAO,EAAE,GAAGC,YAAY,EAC1BC,GAAG;IAEH,qBACE,KAACf;QACE,GAAGc,UAAU;QACdE,UAAU,CAAC;QACXC,MAAMT,oBAAoB,CAACK,QAAQ;QACnCE,KAAKA;QACLG,IAAI;YACFC,OAAO;QACT;;AAGN,GAAG"}
|
package/dist/Table/Table.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Table/Table.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 {\n useReactTable,\n getCoreRowModel,\n ColumnDef,\n RowSelectionState,\n OnChangeFn,\n Row,\n Table as TanstackTable,\n SortingState,\n getSortedRowModel,\n getPaginationRowModel,\n} from '@tanstack/react-table';\nimport { useTheme } from '@mui/material';\nimport { ReactElement, useCallback, useMemo } from 'react';\nimport { VirtualizedTable } from './VirtualizedTable';\nimport { TableCheckbox } from './TableCheckbox';\nimport { TableProps, persesColumnsToTanstackColumns, DEFAULT_COLUMN_WIDTH } from './model/table-model';\n\nconst DEFAULT_GET_ROW_ID = (data: unknown, index: number): string => {\n return `${index}`;\n};\n\n// Setting these defaults one enables them to be consistent across renders instead\n// of being recreated every time, which can be important for perf because react\n// does not do deep equality checking for objects and arrays.\nconst DEFAULT_ROW_SELECTION: NonNullable<TableProps<unknown>['rowSelection']> = {};\nconst DEFAULT_SORTING: NonNullable<TableProps<unknown>['sorting']> = [];\n\n/**\n * Component used to render tabular data in Perses use cases. This component is\n * **not** intended to be a general use data table for use cases unrelated to Perses.\n *\n * **Note: This component is currently experimental and is likely to have significant breaking changes in the near future. Use with caution outside of the core Perses codebase.**\n */\nexport function Table<TableData>({\n data,\n columns,\n cellConfigs,\n density = 'standard',\n defaultColumnWidth = DEFAULT_COLUMN_WIDTH,\n defaultColumnHeight = 'auto',\n checkboxSelection,\n onRowSelectionChange,\n onSortingChange,\n getCheckboxColor,\n getRowId = DEFAULT_GET_ROW_ID,\n rowSelection = DEFAULT_ROW_SELECTION,\n sorting = DEFAULT_SORTING,\n pagination,\n onPaginationChange,\n rowSelectionVariant = 'standard',\n ...otherProps\n}: TableProps<TableData>): ReactElement {\n const theme = useTheme();\n\n const handleRowSelectionChange: OnChangeFn<RowSelectionState> = (rowSelectionUpdater) => {\n const newRowSelection =\n typeof rowSelectionUpdater === 'function' ? rowSelectionUpdater(rowSelection) : rowSelectionUpdater;\n onRowSelectionChange?.(newRowSelection);\n };\n\n const handleRowSelectionEvent = useCallback(\n (table: TanstackTable<TableData>, row: Row<TableData>, isModified: boolean) => {\n if (rowSelectionVariant === 'standard' || isModified) {\n row.toggleSelected();\n } else {\n // Legend variant (when action not modified with shift/meta key).\n // Note that this behavior needs to be kept in sync with behavior in\n // the Legend component for list-based legends.\n if (row.getIsSelected() && !table.getIsAllRowsSelected()) {\n // Row was already selected. Revert to select all.\n table.toggleAllRowsSelected();\n } else {\n // Focus the selected row.\n onRowSelectionChange?.({\n [row.id]: true,\n });\n }\n }\n },\n [onRowSelectionChange, rowSelectionVariant]\n );\n\n const handleCheckboxChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>, table: TanstackTable<TableData>, row: Row<TableData>) => {\n const nativePointerEvent =\n e.nativeEvent && (e.nativeEvent instanceof MouseEvent || e.nativeEvent instanceof KeyboardEvent)\n ? (e.nativeEvent as PointerEvent)\n : undefined;\n const isModifed = !!nativePointerEvent?.metaKey || !!nativePointerEvent?.shiftKey;\n handleRowSelectionEvent(table, row, isModifed);\n },\n [handleRowSelectionEvent]\n );\n\n const handleSortingChange: OnChangeFn<SortingState> = (sortingUpdater) => {\n const newSorting = typeof sortingUpdater === 'function' ? sortingUpdater(sorting) : sortingUpdater;\n onSortingChange?.(newSorting);\n };\n\n const checkboxColumn: ColumnDef<TableData> = useMemo(() => {\n return {\n id: 'checkboxRowSelect',\n size: 28,\n header: ({ table }): ReactElement => {\n return (\n <TableCheckbox\n checked={table.getIsAllRowsSelected()}\n indeterminate={table.getIsSomeRowsSelected()}\n onChange={table.getToggleAllRowsSelectedHandler()}\n color={theme.palette.text.primary}\n density={density}\n />\n );\n },\n cell: ({ row, table }): ReactElement => {\n return (\n <TableCheckbox\n checked={row.getIsSelected()}\n indeterminate={row.getIsSomeSelected()}\n onChange={(e) => {\n handleCheckboxChange(e, table, row);\n }}\n color={getCheckboxColor?.(row.original)}\n density={density}\n />\n );\n },\n enableSorting: false,\n };\n }, [theme.palette.text.primary, density, getCheckboxColor, handleCheckboxChange]);\n\n const tableColumns: Array<ColumnDef<TableData>> = useMemo(() => {\n const initTableColumns = persesColumnsToTanstackColumns(columns);\n\n if (checkboxSelection) {\n initTableColumns.unshift(checkboxColumn);\n }\n\n return initTableColumns;\n }, [checkboxColumn, checkboxSelection, columns]);\n\n const table = useReactTable({\n data,\n columns: tableColumns,\n getRowId,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n getPaginationRowModel: pagination ? getPaginationRowModel() : undefined,\n // without this setting, the getPaginationRowModel setting persists and it is not possible to switch from paginated to unpaginated\n // can be removed once https://github.com/TanStack/table/pull/5974 is merged\n manualPagination: !pagination,\n enableRowSelection: !!checkboxSelection,\n onRowSelectionChange: handleRowSelectionChange,\n onSortingChange: handleSortingChange,\n // For now, defaulting to sort by descending first. We can expose the ability\n // to customize it if/when we have use cases for it.\n sortDescFirst: true,\n state: {\n rowSelection,\n sorting,\n ...(pagination ? { pagination } : {}),\n },\n });\n\n const handleRowClick = useCallback(\n (e: React.MouseEvent<HTMLDivElement, MouseEvent>, rowId: string) => {\n const row = table.getRow(rowId);\n const isModifiedClick = e.metaKey || e.shiftKey;\n handleRowSelectionEvent(table, row, isModifiedClick);\n },\n [handleRowSelectionEvent, table]\n );\n\n return (\n <VirtualizedTable\n {...otherProps}\n density={density}\n defaultColumnWidth={defaultColumnWidth}\n defaultColumnHeight={defaultColumnHeight}\n onRowClick={handleRowClick}\n rows={table.getRowModel().rows}\n columns={table.getAllFlatColumns()}\n headers={table.getHeaderGroups()}\n cellConfigs={cellConfigs}\n pagination={pagination}\n onPaginationChange={onPaginationChange}\n rowCount={table.getRowCount()}\n />\n );\n}\n"],"names":["useReactTable","getCoreRowModel","getSortedRowModel","getPaginationRowModel","useTheme","useCallback","useMemo","VirtualizedTable","TableCheckbox","persesColumnsToTanstackColumns","DEFAULT_COLUMN_WIDTH","DEFAULT_GET_ROW_ID","data","index","DEFAULT_ROW_SELECTION","DEFAULT_SORTING","Table","columns","cellConfigs","density","defaultColumnWidth","defaultColumnHeight","checkboxSelection","onRowSelectionChange","onSortingChange","getCheckboxColor","getRowId","rowSelection","sorting","pagination","onPaginationChange","rowSelectionVariant","otherProps","theme","handleRowSelectionChange","rowSelectionUpdater","newRowSelection","handleRowSelectionEvent","table","row","isModified","toggleSelected","getIsSelected","getIsAllRowsSelected","toggleAllRowsSelected","id","handleCheckboxChange","e","nativePointerEvent","nativeEvent","MouseEvent","KeyboardEvent","undefined","isModifed","metaKey","shiftKey","handleSortingChange","sortingUpdater","newSorting","checkboxColumn","size","header","checked","indeterminate","getIsSomeRowsSelected","onChange","getToggleAllRowsSelectedHandler","color","palette","text","primary","cell","getIsSomeSelected","original","enableSorting","tableColumns","initTableColumns","unshift","manualPagination","enableRowSelection","sortDescFirst","state","handleRowClick","rowId","getRow","isModifiedClick","onRowClick","rows","getRowModel","getAllFlatColumns","headers","getHeaderGroups","rowCount","getRowCount"],"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,SACEA,aAAa,EACbC,eAAe,EAOfC,iBAAiB,EACjBC,qBAAqB,QAChB,wBAAwB;AAC/B,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAAuBC,WAAW,EAAEC,OAAO,QAAQ,QAAQ;AAC3D,SAASC,gBAAgB,QAAQ,qBAAqB;AACtD,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAAqBC,8BAA8B,EAAEC,oBAAoB,QAAQ,sBAAsB;AAEvG,MAAMC,qBAAqB,CAACC,MAAeC;IACzC,OAAO,GAAGA,OAAO;AACnB;AAEA,kFAAkF;AAClF,+EAA+E;AAC/E,6DAA6D;AAC7D,MAAMC,wBAA0E,CAAC;AACjF,MAAMC,kBAA+D,EAAE;AAEvE;;;;;CAKC,GACD,OAAO,SAASC,MAAiB,EAC/BJ,IAAI,EACJK,OAAO,EACPC,WAAW,EACXC,UAAU,UAAU,EACpBC,qBAAqBV,oBAAoB,EACzCW,sBAAsB,MAAM,EAC5BC,iBAAiB,EACjBC,oBAAoB,EACpBC,eAAe,EACfC,gBAAgB,EAChBC,WAAWf,kBAAkB,EAC7BgB,eAAeb,qBAAqB,EACpCc,UAAUb,eAAe,EACzBc,UA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ACtC,GACA;QAAChD;QAAyBC;KAAM;IAGlC,qBACE,KAAC/B;QACE,GAAGyB,UAAU;QACdb,SAASA;QACTC,oBAAoBA;QACpBC,qBAAqBA;QACrBiE,YAAYJ;QACZK,MAAMjD,MAAMkD,WAAW,GAAGD,IAAI;QAC9BtE,SAASqB,MAAMmD,iBAAiB;QAChCC,SAASpD,MAAMqD,eAAe;QAC9BzE,aAAaA;QACbW,YAAYA;QACZC,oBAAoBA;QACpB8D,UAAUtD,MAAMuD,WAAW;;AAGjC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Table/TableBody.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 { TableBody as MuiTableBody, TableBodyProps as MuiTableBodyProps } from '@mui/material';\nimport { forwardRef } from 'react';\n\ntype TableBodyProps = MuiTableBodyProps;\n\nexport const TableBody = forwardRef<HTMLTableSectionElement, TableBodyProps>(function TableBody(props, ref) {\n return <MuiTableBody {...props} ref={ref} />;\n});\n"],"names":["TableBody","MuiTableBody","forwardRef","props","ref"],"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,aAAaC,YAAY,QAA6C,gBAAgB;AAC/F,SAASC,UAAU,QAAQ,QAAQ;AAInC,OAAO,MAAMF,0BAAYE,WAAoD,SAASF,UAAUG,KAAK,EAAEC,GAAG;IACxG,qBAAO,KAACH;QAAc,GAAGE,KAAK;QAAEC,KAAKA;;AACvC,GAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Table/TableCell.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 { TableCell as MuiTableCell, styled, TableCellProps as MuiTableCellProps, Box, useTheme } from '@mui/material';\nimport { ReactElement, useEffect, useRef } from 'react';\nimport { TableCellAlignment, TableDensity, getTableCellLayout } from './model/table-model';\n\nconst StyledMuiTableCell = styled(MuiTableCell)(({ theme }) => ({\n padding: 0,\n backgroundColor: 'inherit',\n\n '&.MuiTableCell-head': {\n // Important to avoid scrolling behind the header showing through.\n backgroundColor: theme.palette.background.default,\n },\n '&:focus-visible': {\n outline: `solid 1px ${theme.palette.primary.main}`,\n // Move inward a little to avoid getting cut off when focusing on items\n // at the edge of the table.\n outlineOffset: '-1px',\n borderRadius: 0,\n },\n}));\n\nexport interface TableCellProps extends Omit<MuiTableCellProps, 'tabIndex' | 'align'> {\n density: TableDensity;\n defaultColumnHeight?: 'auto' | number;\n\n // These values are used to adjust the spacing for the first/last columns.\n isLastColumn: boolean;\n isFirstColumn: boolean;\n\n align?: TableCellAlignment;\n\n /**\n * Additional information to be displayed when hovering over the cell. This\n * may be the full cell value (e.g. to enable the user to see the full value\n * if it is ellipsized to fit into the space) or some other descriptive text\n * that is useful for the user.\n *\n * The hover behavior is currently managed with the `title` attribute, but this\n * may be changed to a tooltip in the future.\n */\n description?: string;\n\n /**\n * How the cell should behave related to focus.\n * - `trigger-focus`: the cell should be auto-focused when it renders.\n * - `focus-next`: the cell should have tabindex=\"0\", so that it will be\n * focused the next time someone tabs with a keyboard.\n * - `none`: the cell should have tabindex=\"-1\", so it is not focused by\n * keyboard interactions at this time.\n */\n focusState?: 'trigger-focus' | 'focus-next' | 'none';\n onFocusTrigger?: (e: React.MouseEvent<HTMLTableCellElement> | React.KeyboardEvent<HTMLTableCellElement>) => void;\n color?: string;\n backgroundColor?: string;\n}\n\nexport function TableCell({\n children,\n density,\n variant,\n width,\n defaultColumnHeight,\n focusState = 'none',\n onFocusTrigger,\n isFirstColumn,\n isLastColumn,\n description,\n align,\n color,\n backgroundColor,\n ...otherProps\n}: TableCellProps): ReactElement {\n const theme = useTheme();\n\n const elRef = useRef<HTMLTableCellElement>();\n\n const isHeader = variant === 'head';\n\n useEffect(() => {\n if (focusState === 'trigger-focus' && elRef.current) {\n elRef.current.focus();\n }\n }, [focusState]);\n\n const handleFocus: React.FocusEventHandler<HTMLTableCellElement> = (e) => {\n // From https://zellwk.com/blog/keyboard-focusable-elements/\n const nestedFocusTarget = e.currentTarget?.querySelector<HTMLElement>(\n 'a[href], button, input, textarea, select, details,[role=\"button\"]'\n );\n if (nestedFocusTarget) {\n // If the cell has a focusable child, focus it instead. Mostly used for\n // checkbox cells, but could have other uses.\n nestedFocusTarget.focus();\n }\n };\n\n const handleInteractionFocusTrigger: TableCellProps['onFocusTrigger'] = (e) => {\n // We use `onClick` and `onKeyUp` events instead of `onFocus` because of\n // some ordering issues with when the browser calls events and how this\n // plays with the triggering of focus with keyboard interactions.\n // These report that a focus event happened, so we can adjust the current\n // tabindex and focuses to the right cell.\n onFocusTrigger?.(e);\n };\n\n return (\n <StyledMuiTableCell\n {...otherProps}\n // Modify the tab index based on the currently focused cell. It's important\n // to avoid having tabindex 0 on everything because it essentially traps\n // a keyboard user in the table until they hit \"tab\" for every single\n // cell.\n tabIndex={focusState !== 'none' ? 0 : -1}\n onFocus={handleFocus}\n onClick={handleInteractionFocusTrigger}\n onKeyUp={handleInteractionFocusTrigger}\n style={{ width: width }}\n sx={{\n position: 'relative',\n borderBottom: isHeader ? `solid 1px ${theme.palette.grey[100]}` : `solid 1px ${theme.palette.grey[50]}`,\n '&:hover #original-cell': {\n position: 'absolute',\n top: 0,\n left: 0,\n zIndex: 10,\n width: 'fit-content',\n minWidth: '100%',\n whiteSpace: 'nowrap',\n overflow: 'visible',\n backgroundColor: `${backgroundColor ?? theme.palette.background.default} !important`,\n outline: `solid 1px ${theme.palette.info.main}`,\n outlineOffset: '-1px',\n },\n }}\n ref={elRef}\n >\n <Box\n id=\"original-cell\"\n sx={{\n ...getTableCellLayout(theme, density, { isHeader, isLastColumn, isFirstColumn, defaultColumnHeight }),\n position: 'relative',\n\n // Text truncation. Currently enforced on all cells. We may control\n // this with a prop on column config in the future.\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n\n // Need to inherit from the MUI cell because this manages some ordering\n // that the `TableSortLabel` uses to determine the location of the icon\n // in headers.\n flexDirection: 'inherit',\n }}\n style={{\n backgroundColor: backgroundColor ?? 'inherit',\n color: color ?? 'inherit',\n }}\n title={description}\n aria-label={description}\n textAlign={align}\n >\n {children}\n </Box>\n </StyledMuiTableCell>\n );\n}\n"],"names":["TableCell","MuiTableCell","styled","Box","useTheme","useEffect","useRef","getTableCellLayout","StyledMuiTableCell","theme","padding","backgroundColor","palette","background","default","outline","primary","main","outlineOffset","borderRadius","children","density","variant","width","defaultColumnHeight","focusState","onFocusTrigger","isFirstColumn","isLastColumn","description","align","color","otherProps","elRef","isHeader","current","focus","handleFocus","e","nestedFocusTarget","currentTarget","querySelector","handleInteractionFocusTrigger","tabIndex","onFocus","onClick","onKeyUp","style","sx","position","borderBottom","grey","top","left","zIndex","minWidth","whiteSpace","overflow","info","ref","id","textOverflow","flexDirection","title","aria-label","textAlign"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;A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;AAIT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Table/TableCheckbox.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 { Checkbox, CheckboxProps, alpha } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { TableDensity } from './model/table-model';\n\nexport interface TableCheckboxProps extends Pick<CheckboxProps, 'checked' | 'indeterminate' | 'onChange'> {\n color?: string;\n density: TableDensity;\n}\n\nexport function TableCheckbox({ color, density, ...otherProps }: TableCheckboxProps): ReactElement {\n const isCompact = density === 'compact';\n\n return (\n <Checkbox\n size={isCompact ? 'small' : 'medium'}\n {...otherProps}\n // Disable ripple and set background color below because of some issues\n // with re-rendering with the keyboard interactions that causes the ripple\n // animation to stutter.\n focusRipple={false}\n // Tab index is handled by the overall keyboard interactions for the table\n // to avoid trapping a keyboard user in a table by requiring them to tab\n // through every single checkbox.\n tabIndex={-1}\n sx={{\n color: color,\n\n padding: (theme) => theme.spacing(isCompact ? 0.25 : 0.5),\n\n // Centering.\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n\n '&.Mui-checked': {\n color: color,\n },\n\n '&.Mui-focusVisible': {\n background: color ? alpha(color, 0.5) : undefined,\n },\n\n '& .MuiSvgIcon-root': { fontSize: isCompact ? 16 : 18 },\n }}\n />\n );\n}\n"],"names":["Checkbox","alpha","TableCheckbox","color","density","otherProps","isCompact","size","focusRipple","tabIndex","sx","padding","theme","spacing","position","top","left","transform","background","undefined","fontSize"],"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,QAAQ,EAAiBC,KAAK,QAAQ,gBAAgB;AAS/D,OAAO,SAASC,cAAc,EAAEC,KAAK,EAAEC,OAAO,EAAE,GAAGC,YAAgC;IACjF,MAAMC,YAAYF,YAAY;IAE9B,qBACE,KAACJ;QACCO,MAAMD,YAAY,UAAU;QAC3B,GAAGD,UAAU;QACd,uEAAuE;QACvE,0EAA0E;QAC1E,wBAAwB;QACxBG,aAAa;QACb,0EAA0E;QAC1E,wEAAwE;QACxE,iCAAiC;QACjCC,UAAU,CAAC;QACXC,IAAI;YACFP,OAAOA;YAEPQ,SAAS,CAACC,QAAUA,MAAMC,OAAO,CAACP,YAAY,OAAO;YAErD,aAAa;YACbQ,UAAU;YACVC,KAAK;YACLC,MAAM;YACNC,WAAW;YAEX,iBAAiB;gBACfd,OAAOA;YACT;YAEA,sBAAsB;gBACpBe,YAAYf,QAAQF,MAAME,OAAO,OAAOgB;YAC1C;YAEA,sBAAsB;gBAAEC,UAAUd,YAAY,KAAK;YAAG;QACxD;;AAGN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Table/TableFoot.tsx"],"sourcesContent":["// Copyright 2025 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 { TableFooter as MuiTableFooter, TableFooterProps as MuiTableFooterProps } from '@mui/material';\nimport { forwardRef } from 'react';\n\nexport const TableFoot = forwardRef<HTMLTableSectionElement, MuiTableFooterProps>(function TableFoot(props, ref) {\n return <MuiTableFooter {...props} ref={ref} />;\n});\n"],"names":["TableFooter","MuiTableFooter","forwardRef","TableFoot","props","ref"],"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,eAAeC,cAAc,QAAiD,gBAAgB;AACvG,SAASC,UAAU,QAAQ,QAAQ;AAEnC,OAAO,MAAMC,0BAAYD,WAAyD,SAASC,UAAUC,KAAK,EAAEC,GAAG;IAC7G,qBAAO,KAACJ;QAAgB,GAAGG,KAAK;QAAEC,KAAKA;;AACzC,GAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Table/TableHead.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 { TableHead as MuiTableHead, TableHeadProps as MuiTableHeadProps } from '@mui/material';\nimport { forwardRef } from 'react';\n\ntype TableHeadProps = MuiTableHeadProps;\n\nexport const TableHead = forwardRef<HTMLTableSectionElement, TableHeadProps>(function TableHead(props, ref) {\n return <MuiTableHead {...props} ref={ref} />;\n});\n"],"names":["TableHead","MuiTableHead","forwardRef","props","ref"],"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,aAAaC,YAAY,QAA6C,gBAAgB;AAC/F,SAASC,UAAU,QAAQ,QAAQ;AAInC,OAAO,MAAMF,0BAAYE,WAAoD,SAASF,UAAUG,KAAK,EAAEC,GAAG;IACxG,qBAAO,KAACH;QAAc,GAAGE,KAAK;QAAEC,KAAKA;;AACvC,GAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Table/TableHeaderCell.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 { TableSortLabel, Typography, tableSortLabelClasses } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { TableCell, TableCellProps } from './TableCell';\nimport { SortDirection } from './model/table-model';\n\nexport interface TableHeaderCellProps extends TableCellProps {\n /**\n * Handler called when a sort event is triggered.\n * When specified, the header will include sorting interactions and indicators.\n */\n onSort?: ((event: unknown) => void) | undefined;\n\n /**\n * The current direction the header is sorted.\n */\n sortDirection?: SortDirection;\n\n /**\n * The next direction the header will be sorted when another sort action\n * is triggered via click/keyboard. This impacts some UI interactions (e.g.\n * the direction of the sort arrow on hover f the column is currently\n * unsorted.)\n */\n nextSortDirection?: SortDirection;\n}\n\nexport function TableHeaderCell({\n onSort,\n sortDirection,\n nextSortDirection,\n children,\n ...cellProps\n}: TableHeaderCellProps): ReactElement {\n const showSortLabel = !!onSort;\n\n const headerText = (\n <Typography noWrap variant=\"inherit\" component=\"div\" color=\"inherit\">\n {children}\n </Typography>\n );\n\n const isActive = !!sortDirection;\n const direction = isActive ? sortDirection : nextSortDirection;\n\n return (\n <TableCell {...cellProps}>\n {showSortLabel ? (\n <TableSortLabel\n onClick={onSort}\n direction={direction}\n active={isActive}\n sx={{\n // Overrides a default vertical alignment in the CSS that changes\n // the header vertical rhythm in a way that's inconsistent with\n // non-sorting headers.\n verticalAlign: 'unset',\n\n // Makes it possible to ellipsize the text if it's too long.\n maxWidth: '100%',\n\n // Make the arrow visible when focused using the keyboard to assist\n // with a11y.\n '&:focus-visible': {\n [`& .${tableSortLabelClasses.icon}`]: {\n opacity: isActive ? 1 : 0.5,\n },\n },\n }}\n >\n {headerText}\n </TableSortLabel>\n ) : (\n headerText\n )}\n </TableCell>\n );\n}\n"],"names":["TableSortLabel","Typography","tableSortLabelClasses","TableCell","TableHeaderCell","onSort","sortDirection","nextSortDirection","children","cellProps","showSortLabel","headerText","noWrap","variant","component","color","isActive","direction","onClick","active","sx","verticalAlign","maxWidth","icon","opacity"],"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,cAAc,EAAEC,UAAU,EAAEC,qBAAqB,QAAQ,gBAAgB;AAElF,SAASC,SAAS,QAAwB,cAAc;AAwBxD,OAAO,SAASC,gBAAgB,EAC9BC,MAAM,EACNC,aAAa,EACbC,iBAAiB,EACjBC,QAAQ,EACR,GAAGC,WACkB;IACrB,MAAMC,gBAAgB,CAAC,CAACL;IAExB,MAAMM,2BACJ,KAACV;QAAWW,MAAM;QAACC,SAAQ;QAAUC,WAAU;QAAMC,OAAM;kBACxDP;;IAIL,MAAMQ,WAAW,CAAC,CAACV;IACnB,MAAMW,YAAYD,WAAWV,gBAAgBC;IAE7C,qBACE,KAACJ;QAAW,GAAGM,SAAS;kBACrBC,8BACC,KAACV;YACCkB,SAASb;YACTY,WAAWA;YACXE,QAAQH;YACRI,IAAI;gBACF,iEAAiE;gBACjE,+DAA+D;gBAC/D,uBAAuB;gBACvBC,eAAe;gBAEf,4DAA4D;gBAC5DC,UAAU;gBAEV,mEAAmE;gBACnE,aAAa;gBACb,mBAAmB;oBACjB,CAAC,CAAC,GAAG,EAAEpB,sBAAsBqB,IAAI,EAAE,CAAC,EAAE;wBACpCC,SAASR,WAAW,IAAI;oBAC1B;gBACF;YACF;sBAECL;aAGHA;;AAIR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Table/TableRow.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 { TableRow as MuiTableRow, TableRowProps as MuiTableRowProps, alpha } from '@mui/material';\nimport { forwardRef } from 'react';\nimport { TableDensity } from './model/table-model';\n\ninterface TableRowProps extends MuiTableRowProps<'div'> {\n density: TableDensity;\n}\n\nexport const TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(function TableRow(props, ref) {\n return (\n <MuiTableRow\n {...props}\n ref={ref}\n sx={{\n backgroundColor: (theme) => theme.palette.background.default,\n '&:hover': {\n backgroundColor: (theme) => alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity),\n },\n }}\n />\n );\n});\n"],"names":["TableRow","MuiTableRow","alpha","forwardRef","props","ref","sx","backgroundColor","theme","palette","background","default","primary","main","action","hoverOpacity"],"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,YAAYC,WAAW,EAAqCC,KAAK,QAAQ,gBAAgB;AAClG,SAASC,UAAU,QAAQ,QAAQ;AAOnC,OAAO,MAAMH,yBAAWG,WAA+C,SAASH,SAASI,KAAK,EAAEC,GAAG;IACjG,qBACE,KAACJ;QACE,GAAGG,KAAK;QACTC,KAAKA;QACLC,IAAI;YACFC,iBAAiB,CAACC,QAAUA,MAAMC,OAAO,CAACC,UAAU,CAACC,OAAO;YAC5D,WAAW;gBACTJ,iBAAiB,CAACC,QAAUN,MAAMM,MAAMC,OAAO,CAACG,OAAO,CAACC,IAAI,EAAEL,MAAMC,OAAO,CAACK,MAAM,CAACC,YAAY;YACjG;QACF;;AAGN,GAAG"}
|