@grafana/ui
Version:
Grafana Components Library
1 lines • 2.41 kB
Source Map (JSON)
{"version":3,"file":"SeriesColorPickerPopover.cjs","sources":["../../../../src/components/ColorPicker/SeriesColorPickerPopover.tsx"],"sourcesContent":["import { t } from '@grafana/i18n';\n\nimport { InlineField } from '../Forms/InlineField';\nimport { InlineSwitch } from '../Switch/Switch';\nimport { type PopoverContentProps } from '../Tooltip/types';\n\nimport { ColorPickerPopover, type ColorPickerProps } from './ColorPickerPopover';\n\nexport interface SeriesColorPickerPopoverProps extends ColorPickerProps, PopoverContentProps {\n yaxis?: number;\n onToggleAxis?: () => void;\n}\n\n/**\n * https://developers.grafana.com/ui/latest/index.html?path=/docs/pickers-seriescolorpicker--docs\n */\nexport const SeriesColorPickerPopover = (props: SeriesColorPickerPopoverProps) => {\n const { yaxis, onToggleAxis, color, ...colorPickerProps } = props;\n const yAxisLabel = t('grafana-ui.series-color-picker-popover.y-axis-usage', 'Use right y-axis');\n const customPickers = onToggleAxis\n ? {\n yaxis: {\n name: 'Y-Axis',\n tabComponent() {\n return (\n <InlineField labelWidth={20} label={yAxisLabel}>\n <InlineSwitch value={yaxis === 2} label={yAxisLabel} onChange={onToggleAxis} />\n </InlineField>\n );\n },\n },\n }\n : undefined;\n return <ColorPickerPopover {...colorPickerProps} color={color || '#000000'} customPickers={customPickers} />;\n};\n\n/**\n * @alias\n * @deprecated Use `SeriesColorPickerPopover` instead. This export will be removed in a future major release.\n */\nexport const SeriesColorPickerPopoverWithTheme = SeriesColorPickerPopover;\n"],"names":["t","jsx","InlineField","InlineSwitch","ColorPickerPopover"],"mappings":";;;;;;;;;;;AAgBO,MAAM,wBAAA,GAA2B,CAAC,KAAA,KAAyC;AAChF,EAAA,MAAM,EAAE,KAAA,EAAO,YAAA,EAAc,KAAA,EAAO,GAAG,kBAAiB,GAAI,KAAA;AAC5D,EAAA,MAAM,UAAA,GAAaA,MAAA,CAAE,qDAAA,EAAuD,kBAAkB,CAAA;AAC9F,EAAA,MAAM,gBAAgB,YAAA,GAClB;AAAA,IACE,KAAA,EAAO;AAAA,MACL,IAAA,EAAM,QAAA;AAAA,MACN,YAAA,GAAe;AACb,QAAA,uBACEC,cAAA,CAACC,uBAAA,EAAA,EAAY,UAAA,EAAY,EAAA,EAAI,OAAO,UAAA,EAClC,QAAA,kBAAAD,cAAA,CAACE,mBAAA,EAAA,EAAa,KAAA,EAAO,UAAU,CAAA,EAAG,KAAA,EAAO,UAAA,EAAY,QAAA,EAAU,cAAc,CAAA,EAC/E,CAAA;AAAA,MAEJ;AAAA;AACF,GACF,GACA,KAAA,CAAA;AACJ,EAAA,sCAAQC,qCAAA,EAAA,EAAoB,GAAG,kBAAkB,KAAA,EAAO,KAAA,IAAS,WAAW,aAAA,EAA8B,CAAA;AAC5G;AAMO,MAAM,iCAAA,GAAoC;;;;;"}