@grafana/scenes 5.9.2--canary.830.10452071184.0 → 5.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/esm/querying/SceneQueryRunner.js +2 -2
  3. package/dist/esm/querying/SceneQueryRunner.js.map +1 -1
  4. package/dist/esm/querying/layers/annotations/AnnotationsDataLayer.js +2 -2
  5. package/dist/esm/querying/layers/annotations/AnnotationsDataLayer.js.map +1 -1
  6. package/dist/esm/querying/layers/annotations/standardAnnotationQuery.js +2 -2
  7. package/dist/esm/querying/layers/annotations/standardAnnotationQuery.js.map +1 -1
  8. package/dist/esm/utils/wrapInSafeSerializableSceneObject.js +30 -0
  9. package/dist/esm/utils/wrapInSafeSerializableSceneObject.js.map +1 -0
  10. package/dist/esm/variables/adhoc/AdHocFiltersVariable.js +6 -14
  11. package/dist/esm/variables/adhoc/AdHocFiltersVariable.js.map +1 -1
  12. package/dist/esm/variables/groupby/GroupByVariable.js +2 -2
  13. package/dist/esm/variables/groupby/GroupByVariable.js.map +1 -1
  14. package/dist/esm/variables/variants/query/QueryVariable.js +3 -3
  15. package/dist/esm/variables/variants/query/QueryVariable.js.map +1 -1
  16. package/dist/index.d.ts +1 -3
  17. package/dist/index.js +234 -803
  18. package/dist/index.js.map +1 -1
  19. package/package.json +2 -4
  20. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.js +0 -387
  21. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.js.map +0 -1
  22. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersComboboxEditSwitch.js +0 -113
  23. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersComboboxEditSwitch.js.map +0 -1
  24. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersComboboxRenderer.js +0 -63
  25. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersComboboxRenderer.js.map +0 -1
  26. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/DropdownItem.js +0 -53
  27. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/DropdownItem.js.map +0 -1
@@ -1,63 +0,0 @@
1
- import { css } from '@emotion/css';
2
- import { useStyles2, Icon } from '@grafana/ui';
3
- import React, { memo, useRef } from 'react';
4
- import { AdHocCombobox } from './AdHocFiltersCombobox.js';
5
- import { AdHocFiltersComboboxEditSwitch } from './AdHocFiltersComboboxEditSwitch.js';
6
-
7
- const AdHocFiltersComboboxRenderer = memo(function AdHocFiltersComboboxRenderer2({
8
- model
9
- }) {
10
- const { filters } = model.useState();
11
- const styles = useStyles2(getStyles);
12
- const focusOnInputRef = useRef();
13
- return /* @__PURE__ */ React.createElement("div", {
14
- className: styles.comboboxWrapper,
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
- })), /* @__PURE__ */ React.createElement(AdHocCombobox, {
28
- model,
29
- isAlwaysWip: true,
30
- ref: focusOnInputRef
31
- }));
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
- "&:focus-within": {
48
- outline: "2px dotted transparent",
49
- outlineOffset: "2px",
50
- boxShadow: `0 0 0 2px ${theme.colors.background.canvas}, 0 0 0px 4px ${theme.colors.primary.main}`,
51
- transitionTimingFunction: `cubic-bezier(0.19, 1, 0.22, 1)`,
52
- transitionDuration: "0.2s",
53
- transitionProperty: "outline, outline-offset, box-shadow"
54
- }
55
- }),
56
- filterIcon: css({
57
- color: theme.colors.text.secondary,
58
- alignSelf: "center"
59
- })
60
- });
61
-
62
- export { AdHocFiltersComboboxRenderer };
63
- //# 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 { AdHocCombobox } from './AdHocFiltersCombobox';\nimport { AdHocFiltersVariable } from '../AdHocFiltersVariable';\nimport { AdHocFiltersComboboxEditSwitch } from './AdHocFiltersComboboxEditSwitch';\n\nexport const AdHocFiltersComboboxRenderer = memo(function AdHocFiltersComboboxRenderer({\n model,\n}: {\n model: AdHocFiltersVariable;\n}) {\n const { filters } = model.useState();\n const styles = useStyles2(getStyles);\n const focusOnInputRef = useRef<() => void>();\n\n return (\n <div\n className={styles.comboboxWrapper}\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} />\n ))}\n\n <AdHocCombobox model={model} isAlwaysWip ref={focusOnInputRef} />\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 '&: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,EAAY,GAAA,KAAA,CAAM,QAAS,EAAA,CAAA;AACnC,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,MAAO,CAAA,eAAA;AAAA,IAClB,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,aAAA,CAAA,IAAA,EAAA;AAAA,IAAK,IAAK,EAAA,QAAA;AAAA,IAAS,WAAW,MAAO,CAAA,UAAA;AAAA,IAAY,IAAK,EAAA,IAAA;AAAA,GAAK,GAE3D,OAAQ,CAAA,GAAA,CAAI,CAAC,MAAA,EAAQ,0BACnB,KAAA,CAAA,aAAA,CAAA,8BAAA,EAAA;AAAA,IAA+B,GAAK,EAAA,KAAA;AAAA,IA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AC1B,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;;;;"}