@grafana/scenes 5.10.1--canary.830.10456603604.0 → 5.10.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,65 +0,0 @@
1
- import { css } from '@emotion/css';
2
- import { useStyles2, Icon } from '@grafana/ui';
3
- import React, { memo, useRef } from 'react';
4
- import { AdHocFiltersComboboxEditSwitch } from './AdHocFiltersComboboxEditSwitch.js';
5
- import { AdHocFiltersAlwaysWipCombobox } from './AdHocFiltersAlwaysWipCombobox.js';
6
-
7
- const AdHocFiltersComboboxRenderer = memo(function AdHocFiltersComboboxRenderer2({
8
- model
9
- }) {
10
- const { filters, readOnly } = model.useState();
11
- const styles = useStyles2(getStyles);
12
- const focusOnInputRef = useRef();
13
- return /* @__PURE__ */ React.createElement("div", {
14
- className: `${styles.comboboxWrapper} ${!readOnly ? styles.comboboxFocusOutline : ""}`,
15
- onClick: () => {
16
- var _a;
17
- (_a = focusOnInputRef.current) == null ? void 0 : _a.call(focusOnInputRef);
18
- }
19
- }, /* @__PURE__ */ React.createElement(Icon, {
20
- name: "filter",
21
- className: styles.filterIcon,
22
- size: "lg"
23
- }), filters.map((filter, index) => /* @__PURE__ */ React.createElement(AdHocFiltersComboboxEditSwitch, {
24
- key: index,
25
- filter,
26
- model,
27
- readOnly
28
- })), !readOnly ? /* @__PURE__ */ React.createElement(AdHocFiltersAlwaysWipCombobox, {
29
- model,
30
- ref: focusOnInputRef
31
- }) : null);
32
- });
33
- const getStyles = (theme) => ({
34
- comboboxWrapper: css({
35
- display: "flex",
36
- flexWrap: "wrap",
37
- alignItems: "center",
38
- columnGap: theme.spacing(1),
39
- rowGap: theme.spacing(0.5),
40
- minHeight: theme.spacing(4),
41
- backgroundColor: theme.components.input.background,
42
- border: `1px solid ${theme.colors.border.strong}`,
43
- borderRadius: theme.shape.radius.default,
44
- paddingInline: theme.spacing(1),
45
- paddingBlock: theme.spacing(0.5),
46
- flexGrow: 1
47
- }),
48
- comboboxFocusOutline: css({
49
- "&:focus-within": {
50
- outline: "2px dotted transparent",
51
- outlineOffset: "2px",
52
- boxShadow: `0 0 0 2px ${theme.colors.background.canvas}, 0 0 0px 4px ${theme.colors.primary.main}`,
53
- transitionTimingFunction: `cubic-bezier(0.19, 1, 0.22, 1)`,
54
- transitionDuration: "0.2s",
55
- transitionProperty: "outline, outline-offset, box-shadow"
56
- }
57
- }),
58
- filterIcon: css({
59
- color: theme.colors.text.secondary,
60
- alignSelf: "center"
61
- })
62
- });
63
-
64
- export { AdHocFiltersComboboxRenderer };
65
- //# sourceMappingURL=AdHocFiltersComboboxRenderer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AdHocFiltersComboboxRenderer.js","sources":["../../../../../src/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersComboboxRenderer.tsx"],"sourcesContent":["import { css } from '@emotion/css';\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { Icon, useStyles2 } from '@grafana/ui';\nimport React, { memo, useRef } from 'react';\nimport { AdHocFiltersVariable } from '../AdHocFiltersVariable';\nimport { AdHocFiltersComboboxEditSwitch } from './AdHocFiltersComboboxEditSwitch';\nimport { AdHocFiltersAlwaysWipCombobox } from './AdHocFiltersAlwaysWipCombobox';\n\nexport const AdHocFiltersComboboxRenderer = memo(function AdHocFiltersComboboxRenderer({\n model,\n}: {\n model: AdHocFiltersVariable;\n}) {\n const { filters, readOnly } = model.useState();\n const styles = useStyles2(getStyles);\n const focusOnInputRef = useRef<() => void>();\n\n return (\n <div\n className={`${styles.comboboxWrapper} ${!readOnly ? styles.comboboxFocusOutline : ''}`}\n onClick={() => {\n focusOnInputRef.current?.();\n }}\n >\n <Icon name=\"filter\" className={styles.filterIcon} size=\"lg\" />\n\n {filters.map((filter, index) => (\n <AdHocFiltersComboboxEditSwitch key={index} filter={filter} model={model} readOnly={readOnly} />\n ))}\n\n {!readOnly ? <AdHocFiltersAlwaysWipCombobox model={model} ref={focusOnInputRef} /> : null}\n </div>\n );\n});\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n comboboxWrapper: css({\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n columnGap: theme.spacing(1),\n rowGap: theme.spacing(0.5),\n minHeight: theme.spacing(4),\n backgroundColor: theme.components.input.background,\n border: `1px solid ${theme.colors.border.strong}`,\n borderRadius: theme.shape.radius.default,\n paddingInline: theme.spacing(1),\n paddingBlock: theme.spacing(0.5),\n flexGrow: 1,\n }),\n comboboxFocusOutline: css({\n '&:focus-within': {\n outline: '2px dotted transparent',\n outlineOffset: '2px',\n boxShadow: `0 0 0 2px ${theme.colors.background.canvas}, 0 0 0px 4px ${theme.colors.primary.main}`,\n transitionTimingFunction: `cubic-bezier(0.19, 1, 0.22, 1)`,\n transitionDuration: '0.2s',\n transitionProperty: 'outline, outline-offset, box-shadow',\n },\n }),\n filterIcon: css({\n color: theme.colors.text.secondary,\n alignSelf: 'center',\n }),\n});\n"],"names":["AdHocFiltersComboboxRenderer"],"mappings":";;;;;;AAQa,MAAA,4BAAA,GAA+B,IAAK,CAAA,SAASA,6BAA6B,CAAA;AAAA,EACrF,KAAA;AACF,CAEG,EAAA;AACD,EAAA,MAAM,EAAE,OAAA,EAAS,QAAS,EAAA,GAAI,MAAM,QAAS,EAAA,CAAA;AAC7C,EAAM,MAAA,MAAA,GAAS,WAAW,SAAS,CAAA,CAAA;AACnC,EAAA,MAAM,kBAAkB,MAAmB,EAAA,CAAA;AAE3C,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAA,IACC,WAAW,CAAG,EAAA,MAAA,CAAO,mBAAmB,CAAC,QAAA,GAAW,OAAO,oBAAuB,GAAA,EAAA,CAAA,CAAA;AAAA,IAClF,SAAS,MAAM;AApBrB,MAAA,IAAA,EAAA,CAAA;AAqBQ,MAAA,CAAA,EAAA,GAAA,eAAA,CAAgB,OAAhB,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,eAAA,CAAA,CAAA;AAAA,KACF;AAAA,GAAA,kBAEC,KAAA,CAAA,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AU,EAAA,CAAA;AAAA,GACX,CAAA;AAAA,EACD,sBAAsB,GAAI,CAAA;AAAA,IACxB,gBAAkB,EAAA;AAAA,MAChB,OAAS,EAAA,wBAAA;AAAA,MACT,aAAe,EAAA,KAAA;AAAA,MACf,SAAA,EAAW,aAAa,KAAM,CAAA,MAAA,CAAO,WAAW,MAAuB,CAAA,cAAA,EAAA,KAAA,CAAM,OAAO,OAAQ,CAAA,IAAA,CAAA,CAAA;AAAA,MAC5F,wBAA0B,EAAA,CAAA,8BAAA,CAAA;AAAA,MAC1B,kBAAoB,EAAA,MAAA;AAAA,MACpB,kBAAoB,EAAA,qCAAA;AAAA,KACtB;AAAA,GACD,CAAA;AAAA,EACD,YAAY,GAAI,CAAA;AAAA,IACd,KAAA,EAAO,KAAM,CAAA,MAAA,CAAO,IAAK,CAAA,SAAA;AAAA,IACzB,SAAW,EAAA,QAAA;AAAA,GACZ,CAAA;AACH,CAAA,CAAA;;;;"}
@@ -1,53 +0,0 @@
1
- import { cx } from '@emotion/css';
2
- import { useTheme2, getSelectStyles } from '@grafana/ui';
3
- import React, { forwardRef, useId } from 'react';
4
-
5
- var __defProp = Object.defineProperty;
6
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
- var __spreadValues = (a, b) => {
11
- for (var prop in b || (b = {}))
12
- if (__hasOwnProp.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- if (__getOwnPropSymbols)
15
- for (var prop of __getOwnPropSymbols(b)) {
16
- if (__propIsEnum.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- }
19
- return a;
20
- };
21
- var __objRest = (source, exclude) => {
22
- var target = {};
23
- for (var prop in source)
24
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
25
- target[prop] = source[prop];
26
- if (source != null && __getOwnPropSymbols)
27
- for (var prop of __getOwnPropSymbols(source)) {
28
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
29
- target[prop] = source[prop];
30
- }
31
- return target;
32
- };
33
- const DropdownItem = forwardRef(
34
- function DropdownItem2(_a, ref) {
35
- var _b = _a, { children, active } = _b, rest = __objRest(_b, ["children", "active"]);
36
- const theme = useTheme2();
37
- const selectStyles = getSelectStyles(theme);
38
- const id = useId();
39
- return /* @__PURE__ */ React.createElement("div", __spreadValues({
40
- ref,
41
- role: "option",
42
- id,
43
- "aria-selected": active,
44
- className: cx(selectStyles.option, active && selectStyles.optionFocused)
45
- }, rest), /* @__PURE__ */ React.createElement("div", {
46
- className: selectStyles.optionBody,
47
- "data-testid": `data-testid ad hoc filter option value ${children}`
48
- }, /* @__PURE__ */ React.createElement("span", null, children)));
49
- }
50
- );
51
-
52
- export { DropdownItem };
53
- //# sourceMappingURL=DropdownItem.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DropdownItem.js","sources":["../../../../../src/variables/adhoc/AdHocFiltersCombobox/DropdownItem.tsx"],"sourcesContent":["import { cx } from '@emotion/css';\nimport { useTheme2, getSelectStyles } from '@grafana/ui';\nimport React, { forwardRef, useId } from 'react';\n\ninterface DropdownItemProps {\n children: React.ReactNode;\n active: boolean;\n}\n\nexport const DropdownItem = forwardRef<HTMLDivElement, DropdownItemProps & React.HTMLProps<HTMLDivElement>>(\n function DropdownItem({ children, active, ...rest }, ref) {\n const theme = useTheme2();\n const selectStyles = getSelectStyles(theme);\n const id = useId();\n return (\n <div\n ref={ref}\n role=\"option\"\n id={id}\n aria-selected={active}\n className={cx(selectStyles.option, active && selectStyles.optionFocused)}\n {...rest}\n >\n <div className={selectStyles.optionBody} data-testid={`data-testid ad hoc filter option value ${children}`}>\n <span>{children}</span>\n </div>\n </div>\n );\n }\n);\n"],"names":["DropdownItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASO,MAAM,YAAe,GAAA,UAAA;AAAA,EAC1B,SAASA,aAAa,CAAA,EAAA,EAA+B,GAAK,EAAA;AAApC,IAAA,IAAA,EAAA,GAAA,EAAA,EAAE,YAAU,MAVpC,EAAA,GAUwB,IAAuB,IAAvB,GAAA,SAAA,CAAA,EAAA,EAAuB,CAArB,UAAU,EAAA,QAAA,CAAA,CAAA,CAAA;AAChC,IAAA,MAAM,QAAQ,SAAU,EAAA,CAAA;AACxB,IAAM,MAAA,YAAA,GAAe,gBAAgB,KAAK,CAAA,CAAA;AAC1C,IAAA,MAAM,KAAK,KAAM,EAAA,CAAA;AACjB,IAAA,uBACG,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,cAAA,CAAA;AAAA,MACC,GAAA;AAAA,MACA,IAAK,EAAA,QAAA;AAAA,MACL,EAAA;AAAA,MACA,eAAe,EAAA,MAAA;AAAA,MACf,WAAW,EAAG,CAAA,YAAA,CAAa,MAAQ,EAAA,MAAA,IAAU,aAAa,aAAa,CAAA;AAAA,KAAA,EACnE,uBAEH,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAA,MAAI,WAAW,YAAa,CAAA,UAAA;AAAA,MAAY,eAAa,CAA0C,uCAAA,EAAA,QAAA,CAAA,CAAA;AAAA,KAAA,kBAC7F,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,IAAA,EAAM,QAAS,CAClB,CACF,CAAA,CAAA;AAAA,GAEJ;AACF;;;;"}