@grafana/scenes 6.51.0--canary.1316.20309633325.0 → 6.51.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/CHANGELOG.md +13 -0
- package/dist/esm/packages/scenes/src/locales/en-US/grafana-scenes.json.js +0 -4
- package/dist/esm/packages/scenes/src/locales/en-US/grafana-scenes.json.js.map +1 -1
- package/dist/esm/packages/scenes/src/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersAlwaysWipCombobox.js +2 -2
- package/dist/esm/packages/scenes/src/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersAlwaysWipCombobox.js.map +1 -1
- package/dist/esm/packages/scenes/src/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.js +1 -3
- package/dist/esm/packages/scenes/src/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.js.map +1 -1
- package/dist/esm/packages/scenes/src/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersComboboxRenderer.js +23 -115
- package/dist/esm/packages/scenes/src/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersComboboxRenderer.js.map +1 -1
- package/dist/esm/packages/scenes/src/variables/adhoc/AdHocFiltersCombobox/utils.js +0 -3
- package/dist/esm/packages/scenes/src/variables/adhoc/AdHocFiltersCombobox/utils.js.map +1 -1
- package/dist/esm/packages/scenes/src/variables/adhoc/AdHocFiltersVariable.js +0 -12
- package/dist/esm/packages/scenes/src/variables/adhoc/AdHocFiltersVariable.js.map +1 -1
- package/dist/esm/packages/scenes/src/variables/adhoc/controller/AdHocFiltersVariableController.js +0 -4
- package/dist/esm/packages/scenes/src/variables/adhoc/controller/AdHocFiltersVariableController.js.map +1 -1
- package/dist/esm/packages/scenes/src/variables/groupby/GroupByVariable.js +6 -30
- package/dist/esm/packages/scenes/src/variables/groupby/GroupByVariable.js.map +1 -1
- package/dist/esm/packages/scenes/src/variables/variants/query/toMetricFindValues.js +19 -31
- package/dist/esm/packages/scenes/src/variables/variants/query/toMetricFindValues.js.map +1 -1
- package/dist/{grafana-scenes-DrGXYYn6.js → grafana-scenes-C9F_2hih.js} +1 -5
- package/dist/{grafana-scenes-DrGXYYn6.js.map → grafana-scenes-C9F_2hih.js.map} +1 -1
- package/dist/index.d.ts +0 -23
- package/dist/index.js +51 -198
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -15,11 +15,11 @@ var ui = require('@grafana/ui');
|
|
|
15
15
|
var e2eSelectors = require('@grafana/e2e-selectors');
|
|
16
16
|
var css = require('@emotion/css');
|
|
17
17
|
var uFuzzy = require('@leeoniya/ufuzzy');
|
|
18
|
-
var reactUse = require('react-use');
|
|
19
18
|
var react$1 = require('@floating-ui/react');
|
|
20
19
|
var reactVirtual = require('@tanstack/react-virtual');
|
|
21
20
|
var react = require('@emotion/react');
|
|
22
21
|
require('react-dom');
|
|
22
|
+
var reactUse = require('react-use');
|
|
23
23
|
var operators = require('rxjs/operators');
|
|
24
24
|
var ReactGridLayout = require('react-grid-layout');
|
|
25
25
|
var BarChartPanelCfg_types_gen = require('@grafana/schema/dist/esm/raw/composable/barchart/panelcfg/x/BarChartPanelCfg_types.gen');
|
|
@@ -4614,9 +4614,6 @@ const generatePlaceholder = (filter, filterInputType, isMultiValueEdit, isAlways
|
|
|
4614
4614
|
}
|
|
4615
4615
|
return ((_a = filter.valueLabels) == null ? void 0 : _a[0]) || "";
|
|
4616
4616
|
}
|
|
4617
|
-
if (isAlwaysWip && filterInputType === "operator") {
|
|
4618
|
-
return "";
|
|
4619
|
-
}
|
|
4620
4617
|
return filter[filterInputType] && !isAlwaysWip ? `${filter[filterInputType]}` : inputPlaceholder || INPUT_PLACEHOLDER_DEFAULT;
|
|
4621
4618
|
};
|
|
4622
4619
|
const populateInputValueOnInputTypeSwitch = ({
|
|
@@ -4805,8 +4802,7 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({
|
|
|
4805
4802
|
isAlwaysWip,
|
|
4806
4803
|
handleChangeViewMode,
|
|
4807
4804
|
focusOnWipInputRef,
|
|
4808
|
-
populateInputOnEdit
|
|
4809
|
-
onInputClick
|
|
4805
|
+
populateInputOnEdit
|
|
4810
4806
|
}, parentRef) {
|
|
4811
4807
|
var _a, _b, _c;
|
|
4812
4808
|
const [open, setOpen] = React.useState(false);
|
|
@@ -5289,7 +5285,6 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({
|
|
|
5289
5285
|
className: css.cx(styles.inputStyle, { [styles.loadingInputPadding]: !optionsLoading }),
|
|
5290
5286
|
onClick: (event) => {
|
|
5291
5287
|
event.stopPropagation();
|
|
5292
|
-
onInputClick == null ? void 0 : onInputClick();
|
|
5293
5288
|
setOpen(true);
|
|
5294
5289
|
},
|
|
5295
5290
|
onFocus: () => {
|
|
@@ -5751,100 +5746,53 @@ const getStyles$d = (theme) => ({
|
|
|
5751
5746
|
...getNonApplicablePillStyles(theme)
|
|
5752
5747
|
});
|
|
5753
5748
|
|
|
5754
|
-
const AdHocFiltersAlwaysWipCombobox = React.forwardRef(function AdHocFiltersAlwaysWipCombobox2({ controller
|
|
5749
|
+
const AdHocFiltersAlwaysWipCombobox = React.forwardRef(function AdHocFiltersAlwaysWipCombobox2({ controller }, parentRef) {
|
|
5755
5750
|
const { wip } = controller.useState();
|
|
5756
5751
|
React.useLayoutEffect(() => {
|
|
5757
5752
|
if (!wip) {
|
|
5758
5753
|
controller.addWip();
|
|
5759
5754
|
}
|
|
5760
5755
|
}, [wip]);
|
|
5761
|
-
return /* @__PURE__ */ React__default.default.createElement(AdHocCombobox, { controller, filter: wip, isAlwaysWip: true, ref: parentRef
|
|
5756
|
+
return /* @__PURE__ */ React__default.default.createElement(AdHocCombobox, { controller, filter: wip, isAlwaysWip: true, ref: parentRef });
|
|
5762
5757
|
});
|
|
5763
5758
|
|
|
5764
|
-
const MAX_VISIBLE_FILTERS = 5;
|
|
5765
5759
|
const AdHocFiltersComboboxRenderer = React.memo(function AdHocFiltersComboboxRenderer2({ controller }) {
|
|
5766
|
-
|
|
5767
|
-
const { originFilters, filters, readOnly, collapsible, valueRecommendations } = controller.useState();
|
|
5760
|
+
const { originFilters, filters, readOnly, valueRecommendations } = controller.useState();
|
|
5768
5761
|
const styles = ui.useStyles2(getStyles$c);
|
|
5769
|
-
const theme = ui.useTheme2();
|
|
5770
|
-
const [collapsed, setCollapsed] = React.useState(true);
|
|
5771
|
-
const [wrapperRef, { height: wrapperHeight }] = reactUse.useMeasure();
|
|
5772
|
-
const clearAll = () => {
|
|
5773
|
-
var _a2;
|
|
5774
|
-
(_a2 = controller.clearAll) == null ? void 0 : _a2.call(controller);
|
|
5775
|
-
};
|
|
5776
5762
|
const focusOnWipInputRef = React.useRef();
|
|
5777
|
-
const singleLineThreshold = theme.spacing.gridSize * 5;
|
|
5778
|
-
const isMultiLine = collapsible && wrapperHeight > singleLineThreshold;
|
|
5779
|
-
const handleCollapseToggle = (event) => {
|
|
5780
|
-
event.stopPropagation();
|
|
5781
|
-
if (collapsible) {
|
|
5782
|
-
setCollapsed(true);
|
|
5783
|
-
}
|
|
5784
|
-
};
|
|
5785
|
-
const handleExpand = () => {
|
|
5786
|
-
var _a2, _b;
|
|
5787
|
-
if (!collapsible) {
|
|
5788
|
-
(_a2 = focusOnWipInputRef.current) == null ? void 0 : _a2.call(focusOnWipInputRef);
|
|
5789
|
-
return;
|
|
5790
|
-
}
|
|
5791
|
-
if (collapsed) {
|
|
5792
|
-
setCollapsed(false);
|
|
5793
|
-
} else {
|
|
5794
|
-
(_b = focusOnWipInputRef.current) == null ? void 0 : _b.call(focusOnWipInputRef);
|
|
5795
|
-
}
|
|
5796
|
-
};
|
|
5797
|
-
const visibleOriginFilters = (_a = originFilters == null ? void 0 : originFilters.filter((f) => f.origin)) != null ? _a : [];
|
|
5798
|
-
const visibleFilters = filters.filter((f) => !f.hidden);
|
|
5799
|
-
const allFilters = [...visibleOriginFilters, ...visibleFilters];
|
|
5800
|
-
const totalFiltersCount = allFilters.length;
|
|
5801
|
-
const shouldCollapse = collapsible && collapsed && totalFiltersCount > 0;
|
|
5802
|
-
const filtersToRender = shouldCollapse ? allFilters.slice(0, MAX_VISIBLE_FILTERS) : allFilters;
|
|
5803
|
-
React.useEffect(() => {
|
|
5804
|
-
if (collapsible && totalFiltersCount === 0 && collapsed) {
|
|
5805
|
-
setCollapsed(false);
|
|
5806
|
-
}
|
|
5807
|
-
}, [collapsible, totalFiltersCount, collapsed]);
|
|
5808
|
-
const showCollapseButton = collapsible && isMultiLine && !collapsed;
|
|
5809
5763
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
5810
5764
|
"div",
|
|
5811
5765
|
{
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
}),
|
|
5818
|
-
onClick: handleExpand
|
|
5766
|
+
className: css.cx(styles.comboboxWrapper, { [styles.comboboxFocusOutline]: !readOnly }),
|
|
5767
|
+
onClick: () => {
|
|
5768
|
+
var _a;
|
|
5769
|
+
(_a = focusOnWipInputRef.current) == null ? void 0 : _a.call(focusOnWipInputRef);
|
|
5770
|
+
}
|
|
5819
5771
|
},
|
|
5820
5772
|
/* @__PURE__ */ React__default.default.createElement(ui.Icon, { name: "filter", className: styles.filterIcon, size: "lg" }),
|
|
5821
5773
|
valueRecommendations && /* @__PURE__ */ React__default.default.createElement(valueRecommendations.Component, { model: valueRecommendations }),
|
|
5822
|
-
|
|
5774
|
+
originFilters == null ? void 0 : originFilters.map(
|
|
5775
|
+
(filter, index) => filter.origin ? /* @__PURE__ */ React__default.default.createElement(
|
|
5776
|
+
AdHocFilterPill,
|
|
5777
|
+
{
|
|
5778
|
+
key: `${index}-${filter.key}`,
|
|
5779
|
+
filter,
|
|
5780
|
+
controller,
|
|
5781
|
+
focusOnWipInputRef: focusOnWipInputRef.current
|
|
5782
|
+
}
|
|
5783
|
+
) : null
|
|
5784
|
+
),
|
|
5785
|
+
filters.filter((filter) => !filter.hidden).map((filter, index) => /* @__PURE__ */ React__default.default.createElement(
|
|
5823
5786
|
AdHocFilterPill,
|
|
5824
5787
|
{
|
|
5825
|
-
key: `${
|
|
5788
|
+
key: `${index}-${filter.key}`,
|
|
5826
5789
|
filter,
|
|
5827
5790
|
controller,
|
|
5828
5791
|
readOnly: readOnly || filter.readOnly,
|
|
5829
5792
|
focusOnWipInputRef: focusOnWipInputRef.current
|
|
5830
5793
|
}
|
|
5831
5794
|
)),
|
|
5832
|
-
!readOnly
|
|
5833
|
-
/* @__PURE__ */ React__default.default.createElement("div", { className: styles.rightControls }, showCollapseButton && /* @__PURE__ */ React__default.default.createElement(
|
|
5834
|
-
ui.Button,
|
|
5835
|
-
{
|
|
5836
|
-
className: styles.collapseButton,
|
|
5837
|
-
fill: "text",
|
|
5838
|
-
onClick: handleCollapseToggle,
|
|
5839
|
-
"aria-label": i18n.t(
|
|
5840
|
-
"grafana-scenes.variables.adhoc-filters-combobox-renderer.collapse-filters",
|
|
5841
|
-
"Collapse filters"
|
|
5842
|
-
),
|
|
5843
|
-
"aria-expanded": !collapsed
|
|
5844
|
-
},
|
|
5845
|
-
i18n.t("grafana-scenes.variables.adhoc-filters-combobox-renderer.collapse", "Collapse"),
|
|
5846
|
-
/* @__PURE__ */ React__default.default.createElement(ui.Icon, { name: "angle-up", size: "md" })
|
|
5847
|
-
), /* @__PURE__ */ React__default.default.createElement("div", { className: styles.clearAllButton }, /* @__PURE__ */ React__default.default.createElement(ui.Icon, { name: "times", size: "md", onClick: clearAll })), shouldCollapse && /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, totalFiltersCount > MAX_VISIBLE_FILTERS && /* @__PURE__ */ React__default.default.createElement("span", { className: styles.moreIndicator }, "(+", totalFiltersCount - MAX_VISIBLE_FILTERS, ")"), /* @__PURE__ */ React__default.default.createElement(ui.Icon, { name: "angle-down", className: styles.dropdownIndicator })))
|
|
5795
|
+
!readOnly ? /* @__PURE__ */ React__default.default.createElement(AdHocFiltersAlwaysWipCombobox, { controller, ref: focusOnWipInputRef }) : null
|
|
5848
5796
|
);
|
|
5849
5797
|
});
|
|
5850
5798
|
const getStyles$c = (theme) => ({
|
|
@@ -5860,8 +5808,7 @@ const getStyles$c = (theme) => ({
|
|
|
5860
5808
|
borderRadius: theme.shape.radius.default,
|
|
5861
5809
|
paddingInline: theme.spacing(1),
|
|
5862
5810
|
paddingBlock: theme.spacing(0.5),
|
|
5863
|
-
flexGrow: 1
|
|
5864
|
-
width: "100%"
|
|
5811
|
+
flexGrow: 1
|
|
5865
5812
|
}),
|
|
5866
5813
|
comboboxFocusOutline: css.css({
|
|
5867
5814
|
"&:focus-within": {
|
|
@@ -5877,48 +5824,6 @@ const getStyles$c = (theme) => ({
|
|
|
5877
5824
|
filterIcon: css.css({
|
|
5878
5825
|
color: theme.colors.text.secondary,
|
|
5879
5826
|
alignSelf: "center"
|
|
5880
|
-
}),
|
|
5881
|
-
collapsed: css.css({
|
|
5882
|
-
flexWrap: "nowrap",
|
|
5883
|
-
overflow: "hidden"
|
|
5884
|
-
}),
|
|
5885
|
-
clickableCollapsed: css.css({
|
|
5886
|
-
cursor: "pointer",
|
|
5887
|
-
"&:hover": {
|
|
5888
|
-
borderColor: theme.colors.border.medium
|
|
5889
|
-
}
|
|
5890
|
-
}),
|
|
5891
|
-
rightControls: css.css({
|
|
5892
|
-
display: "flex",
|
|
5893
|
-
alignItems: "center",
|
|
5894
|
-
marginLeft: "auto",
|
|
5895
|
-
flexShrink: 0
|
|
5896
|
-
}),
|
|
5897
|
-
moreIndicator: css.css({
|
|
5898
|
-
color: theme.colors.text.secondary,
|
|
5899
|
-
whiteSpace: "nowrap"
|
|
5900
|
-
}),
|
|
5901
|
-
dropdownIndicator: css.css({
|
|
5902
|
-
color: theme.colors.text.secondary,
|
|
5903
|
-
flexShrink: 0
|
|
5904
|
-
}),
|
|
5905
|
-
collapseButton: css.css({
|
|
5906
|
-
color: theme.colors.text.secondary,
|
|
5907
|
-
padding: 0,
|
|
5908
|
-
fontSize: theme.typography.bodySmall.fontSize,
|
|
5909
|
-
border: "none",
|
|
5910
|
-
"&:hover": {
|
|
5911
|
-
background: "transparent",
|
|
5912
|
-
color: theme.colors.text.primary
|
|
5913
|
-
}
|
|
5914
|
-
}),
|
|
5915
|
-
clearAllButton: css.css({
|
|
5916
|
-
fontSize: theme.typography.bodySmall.fontSize,
|
|
5917
|
-
cursor: "pointer",
|
|
5918
|
-
color: theme.colors.text.secondary,
|
|
5919
|
-
"&:hover": {
|
|
5920
|
-
color: theme.colors.text.primary
|
|
5921
|
-
}
|
|
5922
5827
|
})
|
|
5923
5828
|
});
|
|
5924
5829
|
|
|
@@ -6023,7 +5928,6 @@ class AdHocFiltersVariableController {
|
|
|
6023
5928
|
supportsMultiValueOperators: state.supportsMultiValueOperators,
|
|
6024
5929
|
onAddCustomValue: state.onAddCustomValue,
|
|
6025
5930
|
wip: state._wip,
|
|
6026
|
-
collapsible: state.collapsible,
|
|
6027
5931
|
valueRecommendations: this.model.getRecommendations(),
|
|
6028
5932
|
drilldownRecommendationsEnabled: state.drilldownRecommendationsEnabled
|
|
6029
5933
|
};
|
|
@@ -6061,9 +5965,6 @@ class AdHocFiltersVariableController {
|
|
|
6061
5965
|
restoreOriginalFilter(filter) {
|
|
6062
5966
|
this.model.restoreOriginalFilter(filter);
|
|
6063
5967
|
}
|
|
6064
|
-
clearAll() {
|
|
6065
|
-
this.model.clearAll();
|
|
6066
|
-
}
|
|
6067
5968
|
startProfile(name) {
|
|
6068
5969
|
const queryController = getQueryController(this.model);
|
|
6069
5970
|
queryController == null ? void 0 : queryController.startProfile(name);
|
|
@@ -6295,18 +6196,6 @@ class AdHocFiltersVariable extends SceneObjectBase {
|
|
|
6295
6196
|
this._updateFilter(filter, original);
|
|
6296
6197
|
}
|
|
6297
6198
|
}
|
|
6298
|
-
/**
|
|
6299
|
-
* Clear all user-added filters and restore origin filters to their original values.
|
|
6300
|
-
*/
|
|
6301
|
-
clearAll() {
|
|
6302
|
-
var _a;
|
|
6303
|
-
(_a = this.state.originFilters) == null ? void 0 : _a.forEach((filter) => {
|
|
6304
|
-
if (filter.restorable) {
|
|
6305
|
-
this.restoreOriginalFilter(filter);
|
|
6306
|
-
}
|
|
6307
|
-
});
|
|
6308
|
-
this.setState({ filters: [] });
|
|
6309
|
-
}
|
|
6310
6199
|
getValue(fieldPath) {
|
|
6311
6200
|
if (fieldPath === ORIGIN_FILTERS_KEY) {
|
|
6312
6201
|
const originFilters = this.state.originFilters;
|
|
@@ -7175,7 +7064,6 @@ class GroupByVariable extends MultiValueVariable {
|
|
|
7175
7064
|
}
|
|
7176
7065
|
GroupByVariable.Component = GroupByVariableRenderer;
|
|
7177
7066
|
function GroupByVariableRenderer({ model }) {
|
|
7178
|
-
var _a, _b;
|
|
7179
7067
|
const {
|
|
7180
7068
|
value,
|
|
7181
7069
|
text,
|
|
@@ -7196,10 +7084,10 @@ function GroupByVariableRenderer({ model }) {
|
|
|
7196
7084
|
const arrayValue = lodash.isArray(value) ? value : [value];
|
|
7197
7085
|
const arrayText = lodash.isArray(text) ? text : [text];
|
|
7198
7086
|
return arrayValue.map((value2, idx) => {
|
|
7199
|
-
var
|
|
7087
|
+
var _a;
|
|
7200
7088
|
return {
|
|
7201
7089
|
value: value2,
|
|
7202
|
-
label: String((
|
|
7090
|
+
label: String((_a = arrayText[idx]) != null ? _a : value2)
|
|
7203
7091
|
};
|
|
7204
7092
|
});
|
|
7205
7093
|
}, [value, text]);
|
|
@@ -7230,8 +7118,7 @@ function GroupByVariableRenderer({ model }) {
|
|
|
7230
7118
|
() => handleOptionGroups(optionSearcher(inputValue).map(toSelectableValue)),
|
|
7231
7119
|
[optionSearcher, inputValue]
|
|
7232
7120
|
);
|
|
7233
|
-
const
|
|
7234
|
-
const select = isMulti ? /* @__PURE__ */ React__default.default.createElement(ConditionalWrapper, { condition: (_a = model.state.wideInput) != null ? _a : false, wrapper: WideInputWrapper }, /* @__PURE__ */ React__default.default.createElement(
|
|
7121
|
+
const select = isMulti ? /* @__PURE__ */ React__default.default.createElement(
|
|
7235
7122
|
ui.MultiSelect,
|
|
7236
7123
|
{
|
|
7237
7124
|
"aria-label": i18n.t(
|
|
@@ -7301,7 +7188,7 @@ function GroupByVariableRenderer({ model }) {
|
|
|
7301
7188
|
setIsOptionsOpen(false);
|
|
7302
7189
|
}
|
|
7303
7190
|
}
|
|
7304
|
-
)
|
|
7191
|
+
) : /* @__PURE__ */ React__default.default.createElement(
|
|
7305
7192
|
ui.Select,
|
|
7306
7193
|
{
|
|
7307
7194
|
"aria-label": i18n.t(
|
|
@@ -7315,6 +7202,7 @@ function GroupByVariableRenderer({ model }) {
|
|
|
7315
7202
|
"Group by label"
|
|
7316
7203
|
),
|
|
7317
7204
|
width: "auto",
|
|
7205
|
+
className: css.cx(drilldownRecommendationsEnabled && styles.selectStylesInWrapper),
|
|
7318
7206
|
inputValue,
|
|
7319
7207
|
value: uncommittedValue && uncommittedValue.length > 0 ? uncommittedValue : null,
|
|
7320
7208
|
allowCustomValue,
|
|
@@ -7358,19 +7246,12 @@ function GroupByVariableRenderer({ model }) {
|
|
|
7358
7246
|
setIsOptionsOpen(false);
|
|
7359
7247
|
}
|
|
7360
7248
|
}
|
|
7361
|
-
)
|
|
7249
|
+
);
|
|
7362
7250
|
if (!recommendations) {
|
|
7363
7251
|
return select;
|
|
7364
7252
|
}
|
|
7365
7253
|
return /* @__PURE__ */ React__default.default.createElement("div", { className: styles.wrapper }, /* @__PURE__ */ React__default.default.createElement("div", { className: styles.recommendations }, /* @__PURE__ */ React__default.default.createElement(recommendations.Component, { model: recommendations })), select);
|
|
7366
7254
|
}
|
|
7367
|
-
const ConditionalWrapper = ({
|
|
7368
|
-
condition,
|
|
7369
|
-
wrapper,
|
|
7370
|
-
children
|
|
7371
|
-
}) => {
|
|
7372
|
-
return condition ? wrapper(children) : /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, children);
|
|
7373
|
-
};
|
|
7374
7255
|
const filterNoOp = () => true;
|
|
7375
7256
|
function WideMenu(props) {
|
|
7376
7257
|
return /* @__PURE__ */ React__default.default.createElement(components.Menu, { ...props }, /* @__PURE__ */ React__default.default.createElement("div", { style: { minWidth: "220px" } }, props.children));
|
|
@@ -7387,22 +7268,6 @@ function toSelectableValue(input) {
|
|
|
7387
7268
|
return result;
|
|
7388
7269
|
}
|
|
7389
7270
|
const getStyles$a = (theme) => ({
|
|
7390
|
-
selectWrapper: css.css({
|
|
7391
|
-
display: "flex",
|
|
7392
|
-
minWidth: 0,
|
|
7393
|
-
width: "100%"
|
|
7394
|
-
}),
|
|
7395
|
-
// Fix for noMultiValueWrap grid layout - prevent pills from stretching
|
|
7396
|
-
// when the select is full width. The grid layout uses gridAutoFlow: column
|
|
7397
|
-
// which stretches items by default.
|
|
7398
|
-
fullWidthMultiSelect: css.css({
|
|
7399
|
-
width: "100%",
|
|
7400
|
-
// Target the value container (has data-testid) which uses grid layout
|
|
7401
|
-
"& [data-testid]": {
|
|
7402
|
-
gridAutoColumns: "max-content",
|
|
7403
|
-
justifyItems: "start"
|
|
7404
|
-
}
|
|
7405
|
-
}),
|
|
7406
7271
|
wrapper: css.css({
|
|
7407
7272
|
display: "flex"
|
|
7408
7273
|
}),
|
|
@@ -10413,31 +10278,22 @@ function toMetricFindValues(valueProp, textProp) {
|
|
|
10413
10278
|
const value = fieldValue(indices.value);
|
|
10414
10279
|
const text = fieldValue(indices.text);
|
|
10415
10280
|
const expandable = fieldValue(indices.expandable);
|
|
10416
|
-
if (!indices.properties.length) {
|
|
10417
|
-
metrics.push({
|
|
10418
|
-
value: value || text,
|
|
10419
|
-
text: text || value,
|
|
10420
|
-
expandable
|
|
10421
|
-
});
|
|
10422
|
-
continue;
|
|
10423
|
-
}
|
|
10424
10281
|
const properties = {};
|
|
10425
10282
|
for (const p of indices.properties) {
|
|
10426
10283
|
properties[p.name] = fieldValue(p.index);
|
|
10427
10284
|
}
|
|
10428
|
-
|
|
10429
|
-
|
|
10430
|
-
|
|
10431
|
-
|
|
10432
|
-
|
|
10433
|
-
});
|
|
10285
|
+
const result = { value, text, properties };
|
|
10286
|
+
if (expandable !== void 0) {
|
|
10287
|
+
result.expandable = Boolean(expandable);
|
|
10288
|
+
}
|
|
10289
|
+
metrics.push(result);
|
|
10434
10290
|
}
|
|
10435
10291
|
}
|
|
10436
10292
|
return metrics;
|
|
10437
10293
|
})
|
|
10438
10294
|
);
|
|
10439
10295
|
}
|
|
10440
|
-
function findFieldsIndices(frames) {
|
|
10296
|
+
function findFieldsIndices(frames, valueProp, textProp) {
|
|
10441
10297
|
const indices = {
|
|
10442
10298
|
value: -1,
|
|
10443
10299
|
text: -1,
|
|
@@ -10449,17 +10305,11 @@ function findFieldsIndices(frames) {
|
|
|
10449
10305
|
const field = frame.fields[index];
|
|
10450
10306
|
const fieldName = data.getFieldDisplayName(field, frame, frames).toLowerCase();
|
|
10451
10307
|
if (field.type === data.FieldType.string) {
|
|
10452
|
-
if (fieldName === "value") {
|
|
10453
|
-
|
|
10454
|
-
indices.value = index;
|
|
10455
|
-
}
|
|
10456
|
-
continue;
|
|
10308
|
+
if (fieldName === "value" && indices.value === -1) {
|
|
10309
|
+
indices.value = index;
|
|
10457
10310
|
}
|
|
10458
|
-
if (fieldName === "text") {
|
|
10459
|
-
|
|
10460
|
-
indices.text = index;
|
|
10461
|
-
}
|
|
10462
|
-
continue;
|
|
10311
|
+
if (fieldName === "text" && indices.text === -1) {
|
|
10312
|
+
indices.text = index;
|
|
10463
10313
|
}
|
|
10464
10314
|
indices.properties.push({ name: fieldName, index });
|
|
10465
10315
|
continue;
|
|
@@ -10471,17 +10321,20 @@ function findFieldsIndices(frames) {
|
|
|
10471
10321
|
}
|
|
10472
10322
|
return indices;
|
|
10473
10323
|
}
|
|
10474
|
-
function validateIndices(indices
|
|
10324
|
+
function validateIndices(indices) {
|
|
10475
10325
|
const hasNoValueOrText = indices.value === -1 && indices.text === -1;
|
|
10476
|
-
if (
|
|
10326
|
+
if (!indices.properties.length) {
|
|
10477
10327
|
throw new Error("Couldn't find any field of type string in the results");
|
|
10478
10328
|
}
|
|
10479
|
-
if (hasNoValueOrText
|
|
10329
|
+
if (hasNoValueOrText) {
|
|
10480
10330
|
indices.value = indices.properties[0].index;
|
|
10481
|
-
indices.
|
|
10331
|
+
indices.text = indices.properties[0].index;
|
|
10332
|
+
}
|
|
10333
|
+
if (indices.value === -1 && indices.text !== -1) {
|
|
10334
|
+
indices.value = indices.text;
|
|
10482
10335
|
}
|
|
10483
|
-
if (
|
|
10484
|
-
|
|
10336
|
+
if (indices.text === -1 && indices.value !== -1) {
|
|
10337
|
+
indices.text = indices.value;
|
|
10485
10338
|
}
|
|
10486
10339
|
return indices;
|
|
10487
10340
|
}
|
|
@@ -16954,7 +16807,7 @@ function __variableDynamicImportRuntime0__(path) {
|
|
|
16954
16807
|
switch (path) {
|
|
16955
16808
|
case '../locales/cs-CZ/grafana-scenes.json': return Promise.resolve().then(function () { return require('./grafana-scenes-DPdlSPjz.js'); });
|
|
16956
16809
|
case '../locales/de-DE/grafana-scenes.json': return Promise.resolve().then(function () { return require('./grafana-scenes-BHIE4ld0.js'); });
|
|
16957
|
-
case '../locales/en-US/grafana-scenes.json': return Promise.resolve().then(function () { return require('./grafana-scenes-
|
|
16810
|
+
case '../locales/en-US/grafana-scenes.json': return Promise.resolve().then(function () { return require('./grafana-scenes-C9F_2hih.js'); });
|
|
16958
16811
|
case '../locales/es-ES/grafana-scenes.json': return Promise.resolve().then(function () { return require('./grafana-scenes-D4tq59Dc.js'); });
|
|
16959
16812
|
case '../locales/fr-FR/grafana-scenes.json': return Promise.resolve().then(function () { return require('./grafana-scenes-Ce77KCbO.js'); });
|
|
16960
16813
|
case '../locales/hu-HU/grafana-scenes.json': return Promise.resolve().then(function () { return require('./grafana-scenes-DMYCnFop.js'); });
|