@grafana/scenes 6.50.0--canary.1312.20228210142.0 → 6.50.0--canary.1315.20233534152.0
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/esm/packages/scenes/src/index.js +1 -1
- package/dist/esm/packages/scenes/src/index.js.map +1 -1
- package/dist/esm/packages/scenes/src/locales/en-US/grafana-scenes.json.js +0 -7
- package/dist/esm/packages/scenes/src/locales/en-US/grafana-scenes.json.js.map +1 -1
- package/dist/esm/packages/scenes/src/variables/DrilldownDependenciesManager.js.map +1 -1
- package/dist/esm/packages/scenes/src/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersComboboxRenderer.js +1 -21
- package/dist/esm/packages/scenes/src/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersComboboxRenderer.js.map +1 -1
- package/dist/esm/packages/scenes/src/variables/adhoc/AdHocFiltersVariable.js +6 -95
- package/dist/esm/packages/scenes/src/variables/adhoc/AdHocFiltersVariable.js.map +1 -1
- package/dist/esm/packages/scenes/src/variables/adhoc/controller/AdHocFiltersVariableController.js +1 -7
- package/dist/esm/packages/scenes/src/variables/adhoc/controller/AdHocFiltersVariableController.js.map +1 -1
- package/dist/esm/packages/scenes/src/variables/groupby/GroupByVariable.js +8 -163
- package/dist/esm/packages/scenes/src/variables/groupby/GroupByVariable.js.map +1 -1
- package/dist/esm/packages/scenes/src/variables/types.js.map +1 -1
- package/dist/{grafana-scenes-C9F_2hih.js → grafana-scenes-D5iZGLtK.js} +1 -8
- package/dist/{grafana-scenes-C9F_2hih.js.map → grafana-scenes-D5iZGLtK.js.map} +1 -1
- package/dist/index.d.ts +9 -60
- package/dist/index.js +4539 -4896
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/esm/packages/scenes/src/variables/components/DrilldownRecommendations.js +0 -102
- package/dist/esm/packages/scenes/src/variables/components/DrilldownRecommendations.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/scenes",
|
|
3
|
-
"version": "6.50.0--canary.
|
|
3
|
+
"version": "6.50.0--canary.1315.20233534152.0",
|
|
4
4
|
"description": "Grafana framework for building dynamic dashboards",
|
|
5
5
|
"author": "Grafana Labs",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -125,5 +125,5 @@
|
|
|
125
125
|
"prettier --write"
|
|
126
126
|
]
|
|
127
127
|
},
|
|
128
|
-
"gitHead": "
|
|
128
|
+
"gitHead": "5db8265ade53840e21f05d6e25df1e81de6c489c"
|
|
129
129
|
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { useStyles2, ClickOutsideWrapper, Stack, Text, IconButton, Popover } from '@grafana/ui';
|
|
2
|
-
import React, { useState, useRef } from 'react';
|
|
3
|
-
import { css, cx } from '@emotion/css';
|
|
4
|
-
import { Trans, t } from '@grafana/i18n';
|
|
5
|
-
|
|
6
|
-
function DrilldownRecommendations({ recentDrilldowns, recommendedDrilldowns }) {
|
|
7
|
-
const styles = useStyles2(getStyles);
|
|
8
|
-
const [isPopoverVisible, setPopoverVisible] = useState(false);
|
|
9
|
-
const ref = useRef(null);
|
|
10
|
-
const openPopover = () => {
|
|
11
|
-
setPopoverVisible(true);
|
|
12
|
-
};
|
|
13
|
-
const onClickAction = (action) => {
|
|
14
|
-
action();
|
|
15
|
-
setPopoverVisible(false);
|
|
16
|
-
};
|
|
17
|
-
const content = /* @__PURE__ */ React.createElement(ClickOutsideWrapper, { onClick: () => setPopoverVisible(false), useCapture: true }, /* @__PURE__ */ React.createElement("div", { className: styles.menuContainer, onClick: (ev) => ev.stopPropagation() }, /* @__PURE__ */ React.createElement(Stack, { direction: "column" }, /* @__PURE__ */ React.createElement(Text, { weight: "bold", variant: "bodySmall", color: "secondary" }, /* @__PURE__ */ React.createElement(Trans, { i18nKey: "grafana-scenes.components.drilldown-recommendations.recent" }, "Recent")), recentDrilldowns && recentDrilldowns.length > 0 ? recentDrilldowns.map((drilldown) => /* @__PURE__ */ React.createElement(
|
|
18
|
-
"div",
|
|
19
|
-
{
|
|
20
|
-
key: drilldown.label,
|
|
21
|
-
className: cx(styles.combinedFilterPill),
|
|
22
|
-
onClick: () => onClickAction(drilldown.onClick)
|
|
23
|
-
},
|
|
24
|
-
drilldown.label
|
|
25
|
-
)) : /* @__PURE__ */ React.createElement("div", { className: styles.emptyMessage }, /* @__PURE__ */ React.createElement(Trans, { i18nKey: "grafana-scenes.components.drilldown-recommendations.recent-empty" }, "No recent values")), /* @__PURE__ */ React.createElement(Text, { weight: "bold", variant: "bodySmall", color: "secondary" }, /* @__PURE__ */ React.createElement(Trans, { i18nKey: "grafana-scenes.components.drilldown-recommendations.recommended" }, "Recommended")), recommendedDrilldowns && recommendedDrilldowns.length > 0 ? recommendedDrilldowns.map((drilldown) => /* @__PURE__ */ React.createElement(
|
|
26
|
-
"div",
|
|
27
|
-
{
|
|
28
|
-
key: drilldown.label,
|
|
29
|
-
className: cx(styles.combinedFilterPill),
|
|
30
|
-
onClick: () => onClickAction(drilldown.onClick)
|
|
31
|
-
},
|
|
32
|
-
drilldown.label
|
|
33
|
-
)) : /* @__PURE__ */ React.createElement("div", { className: styles.emptyMessage }, /* @__PURE__ */ React.createElement(Trans, { i18nKey: "grafana-scenes.components.drilldown-recommendations.recommended-empty" }, "No recommended values")))));
|
|
34
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
35
|
-
IconButton,
|
|
36
|
-
{
|
|
37
|
-
name: "plus",
|
|
38
|
-
tooltip: t("grafana-scenes.components.drilldown-recommendations.tooltip", "Show recommendations"),
|
|
39
|
-
ref,
|
|
40
|
-
className: cx(isPopoverVisible && styles.iconActive),
|
|
41
|
-
onClick: (ev) => {
|
|
42
|
-
openPopover();
|
|
43
|
-
ev.stopPropagation();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
), isPopoverVisible && ref.current && /* @__PURE__ */ React.createElement(
|
|
47
|
-
Popover,
|
|
48
|
-
{
|
|
49
|
-
content,
|
|
50
|
-
onKeyDown: (event) => {
|
|
51
|
-
if (event.key === " ") {
|
|
52
|
-
event.stopPropagation();
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
placement: "bottom-start",
|
|
56
|
-
referenceElement: ref.current,
|
|
57
|
-
show: true
|
|
58
|
-
}
|
|
59
|
-
));
|
|
60
|
-
}
|
|
61
|
-
const getStyles = (theme) => ({
|
|
62
|
-
menuContainer: css({
|
|
63
|
-
display: "flex",
|
|
64
|
-
flexDirection: "column",
|
|
65
|
-
background: theme.colors.background.elevated,
|
|
66
|
-
border: `1px solid ${theme.colors.border.weak}`,
|
|
67
|
-
borderRadius: theme.shape.radius.default,
|
|
68
|
-
boxShadow: theme.shadows.z3,
|
|
69
|
-
padding: theme.spacing(2)
|
|
70
|
-
}),
|
|
71
|
-
combinedFilterPill: css({
|
|
72
|
-
alignItems: "center",
|
|
73
|
-
background: theme.colors.action.selected,
|
|
74
|
-
borderRadius: theme.shape.radius.default,
|
|
75
|
-
border: `1px solid ${theme.colors.border.weak}`,
|
|
76
|
-
padding: theme.spacing(0.2, 1),
|
|
77
|
-
color: theme.colors.text.primary,
|
|
78
|
-
overflow: "hidden",
|
|
79
|
-
whiteSpace: "nowrap",
|
|
80
|
-
minHeight: theme.spacing(2.75),
|
|
81
|
-
...theme.typography.bodySmall,
|
|
82
|
-
fontWeight: theme.typography.fontWeightBold,
|
|
83
|
-
cursor: "pointer",
|
|
84
|
-
"&:hover": {
|
|
85
|
-
background: theme.colors.action.hover
|
|
86
|
-
}
|
|
87
|
-
}),
|
|
88
|
-
iconActive: css({
|
|
89
|
-
"&:before": {
|
|
90
|
-
backgroundColor: theme.colors.action.hover,
|
|
91
|
-
opacity: 1
|
|
92
|
-
}
|
|
93
|
-
}),
|
|
94
|
-
emptyMessage: css({
|
|
95
|
-
padding: theme.spacing(2),
|
|
96
|
-
textAlign: "center",
|
|
97
|
-
color: theme.colors.text.secondary
|
|
98
|
-
})
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
export { DrilldownRecommendations };
|
|
102
|
-
//# sourceMappingURL=DrilldownRecommendations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DrilldownRecommendations.js","sources":["../../../../../../../src/variables/components/DrilldownRecommendations.tsx"],"sourcesContent":["import { ClickOutsideWrapper, IconButton, Popover, Stack, Text, useStyles2 } from '@grafana/ui';\nimport React, { useRef, useState } from 'react';\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { css, cx } from '@emotion/css';\nimport { Trans, t } from '@grafana/i18n';\n\nexport interface DrilldownPill {\n label: string;\n onClick: () => void;\n}\n\ninterface Props {\n recentDrilldowns?: DrilldownPill[];\n recommendedDrilldowns?: DrilldownPill[];\n}\n\nexport function DrilldownRecommendations({ recentDrilldowns, recommendedDrilldowns }: Props) {\n const styles = useStyles2(getStyles);\n\n const [isPopoverVisible, setPopoverVisible] = useState<boolean>(false);\n const ref = useRef<HTMLButtonElement>(null);\n\n const openPopover = () => {\n setPopoverVisible(true);\n };\n\n const onClickAction = (action: () => void) => {\n action();\n setPopoverVisible(false);\n };\n\n const content = (\n <ClickOutsideWrapper onClick={() => setPopoverVisible(false)} useCapture={true}>\n <div className={styles.menuContainer} onClick={(ev) => ev.stopPropagation()}>\n <Stack direction=\"column\">\n <Text weight=\"bold\" variant=\"bodySmall\" color=\"secondary\">\n <Trans i18nKey=\"grafana-scenes.components.drilldown-recommendations.recent\">Recent</Trans>\n </Text>\n {recentDrilldowns && recentDrilldowns.length > 0 ? (\n recentDrilldowns.map((drilldown) => (\n <div\n key={drilldown.label}\n className={cx(styles.combinedFilterPill)}\n onClick={() => onClickAction(drilldown.onClick)}\n >\n {drilldown.label}\n </div>\n ))\n ) : (\n <div className={styles.emptyMessage}>\n <Trans i18nKey=\"grafana-scenes.components.drilldown-recommendations.recent-empty\">No recent values</Trans>\n </div>\n )}\n <Text weight=\"bold\" variant=\"bodySmall\" color=\"secondary\">\n <Trans i18nKey=\"grafana-scenes.components.drilldown-recommendations.recommended\">Recommended</Trans>\n </Text>\n {recommendedDrilldowns && recommendedDrilldowns.length > 0 ? (\n recommendedDrilldowns.map((drilldown) => (\n <div\n key={drilldown.label}\n className={cx(styles.combinedFilterPill)}\n onClick={() => onClickAction(drilldown.onClick)}\n >\n {drilldown.label}\n </div>\n ))\n ) : (\n <div className={styles.emptyMessage}>\n <Trans i18nKey=\"grafana-scenes.components.drilldown-recommendations.recommended-empty\">\n No recommended values\n </Trans>\n </div>\n )}\n </Stack>\n </div>\n </ClickOutsideWrapper>\n );\n\n return (\n <>\n <IconButton\n name=\"plus\"\n tooltip={t('grafana-scenes.components.drilldown-recommendations.tooltip', 'Show recommendations')}\n ref={ref}\n className={cx(isPopoverVisible && styles.iconActive)}\n onClick={(ev) => {\n openPopover();\n ev.stopPropagation();\n }}\n />\n\n {isPopoverVisible && ref.current && (\n <Popover\n content={content}\n onKeyDown={(event) => {\n if (event.key === ' ') {\n event.stopPropagation();\n }\n }}\n placement=\"bottom-start\"\n referenceElement={ref.current}\n show\n />\n )}\n </>\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n menuContainer: css({\n display: 'flex',\n flexDirection: 'column',\n background: theme.colors.background.elevated,\n border: `1px solid ${theme.colors.border.weak}`,\n borderRadius: theme.shape.radius.default,\n boxShadow: theme.shadows.z3,\n padding: theme.spacing(2),\n }),\n combinedFilterPill: css({\n alignItems: 'center',\n background: theme.colors.action.selected,\n borderRadius: theme.shape.radius.default,\n border: `1px solid ${theme.colors.border.weak}`,\n padding: theme.spacing(0.2, 1),\n color: theme.colors.text.primary,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n minHeight: theme.spacing(2.75),\n ...theme.typography.bodySmall,\n fontWeight: theme.typography.fontWeightBold,\n cursor: 'pointer',\n\n '&:hover': {\n background: theme.colors.action.hover,\n },\n }),\n iconActive: css({\n '&:before': {\n backgroundColor: theme.colors.action.hover,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