@grafana/ui
Version:
Grafana Components Library
30 lines (25 loc) • 1.34 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var jsxRuntime = require('react/jsx-runtime');
var i18n = require('@grafana/i18n');
var InlineField = require('../Forms/InlineField.cjs');
var Switch = require('../Switch/Switch.cjs');
var ColorPickerPopover = require('./ColorPickerPopover.cjs');
;
const SeriesColorPickerPopover = (props) => {
const { yaxis, onToggleAxis, color, ...colorPickerProps } = props;
const yAxisLabel = i18n.t("grafana-ui.series-color-picker-popover.y-axis-usage", "Use right y-axis");
const customPickers = onToggleAxis ? {
yaxis: {
name: "Y-Axis",
tabComponent() {
return /* @__PURE__ */ jsxRuntime.jsx(InlineField.InlineField, { labelWidth: 20, label: yAxisLabel, children: /* @__PURE__ */ jsxRuntime.jsx(Switch.InlineSwitch, { value: yaxis === 2, label: yAxisLabel, onChange: onToggleAxis }) });
}
}
} : void 0;
return /* @__PURE__ */ jsxRuntime.jsx(ColorPickerPopover.ColorPickerPopover, { ...colorPickerProps, color: color || "#000000", customPickers });
};
const SeriesColorPickerPopoverWithTheme = SeriesColorPickerPopover;
exports.SeriesColorPickerPopover = SeriesColorPickerPopover;
exports.SeriesColorPickerPopoverWithTheme = SeriesColorPickerPopoverWithTheme;
//# sourceMappingURL=SeriesColorPickerPopover.cjs.map