@grafana/scenes 4.13.1--canary.711.8884688944.0 → 4.14.0--canary.709.8892811931.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/variables/components/VariableValueSelect.js +86 -18
- package/dist/esm/variables/components/VariableValueSelect.js.map +1 -1
- package/dist/esm/variables/components/VariableValueSelectors.js +20 -7
- package/dist/esm/variables/components/VariableValueSelectors.js.map +1 -1
- package/dist/esm/variables/groupby/GroupByVariable.js +18 -4
- package/dist/esm/variables/groupby/GroupByVariable.js.map +1 -1
- package/dist/index.js +363 -269
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -39,19 +39,19 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
39
39
|
var ReactGridLayout__default = /*#__PURE__*/_interopDefaultLegacy(ReactGridLayout);
|
|
40
40
|
var AutoSizer__default = /*#__PURE__*/_interopDefaultLegacy(AutoSizer);
|
|
41
41
|
|
|
42
|
-
var __defProp$
|
|
43
|
-
var __getOwnPropSymbols$
|
|
44
|
-
var __hasOwnProp$
|
|
45
|
-
var __propIsEnum$
|
|
46
|
-
var __defNormalProp$
|
|
47
|
-
var __spreadValues$
|
|
42
|
+
var __defProp$L = Object.defineProperty;
|
|
43
|
+
var __getOwnPropSymbols$L = Object.getOwnPropertySymbols;
|
|
44
|
+
var __hasOwnProp$L = Object.prototype.hasOwnProperty;
|
|
45
|
+
var __propIsEnum$L = Object.prototype.propertyIsEnumerable;
|
|
46
|
+
var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
47
|
+
var __spreadValues$L = (a, b) => {
|
|
48
48
|
for (var prop in b || (b = {}))
|
|
49
|
-
if (__hasOwnProp$
|
|
50
|
-
__defNormalProp$
|
|
51
|
-
if (__getOwnPropSymbols$
|
|
52
|
-
for (var prop of __getOwnPropSymbols$
|
|
53
|
-
if (__propIsEnum$
|
|
54
|
-
__defNormalProp$
|
|
49
|
+
if (__hasOwnProp$L.call(b, prop))
|
|
50
|
+
__defNormalProp$L(a, prop, b[prop]);
|
|
51
|
+
if (__getOwnPropSymbols$L)
|
|
52
|
+
for (var prop of __getOwnPropSymbols$L(b)) {
|
|
53
|
+
if (__propIsEnum$L.call(b, prop))
|
|
54
|
+
__defNormalProp$L(a, prop, b[prop]);
|
|
55
55
|
}
|
|
56
56
|
return a;
|
|
57
57
|
};
|
|
@@ -60,7 +60,7 @@ function useAppQueryParams() {
|
|
|
60
60
|
return runtime.locationSearchToObject(location.search || "");
|
|
61
61
|
}
|
|
62
62
|
function getUrlWithAppState(path, preserveParams) {
|
|
63
|
-
const paramsCopy = __spreadValues$
|
|
63
|
+
const paramsCopy = __spreadValues$L({}, runtime.locationService.getSearchObject());
|
|
64
64
|
if (preserveParams) {
|
|
65
65
|
for (const key of Object.keys(paramsCopy)) {
|
|
66
66
|
if (!preserveParams.includes(key)) {
|
|
@@ -74,31 +74,31 @@ function renderSceneComponentWithRouteProps(sceneObject, routeProps) {
|
|
|
74
74
|
return React__default["default"].createElement(sceneObject.Component, { model: sceneObject, routeProps });
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
var __defProp$
|
|
78
|
-
var __defProps$
|
|
79
|
-
var __getOwnPropDescs$
|
|
80
|
-
var __getOwnPropSymbols$
|
|
81
|
-
var __hasOwnProp$
|
|
82
|
-
var __propIsEnum$
|
|
83
|
-
var __defNormalProp$
|
|
84
|
-
var __spreadValues$
|
|
77
|
+
var __defProp$K = Object.defineProperty;
|
|
78
|
+
var __defProps$t = Object.defineProperties;
|
|
79
|
+
var __getOwnPropDescs$t = Object.getOwnPropertyDescriptors;
|
|
80
|
+
var __getOwnPropSymbols$K = Object.getOwnPropertySymbols;
|
|
81
|
+
var __hasOwnProp$K = Object.prototype.hasOwnProperty;
|
|
82
|
+
var __propIsEnum$K = Object.prototype.propertyIsEnumerable;
|
|
83
|
+
var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
84
|
+
var __spreadValues$K = (a, b) => {
|
|
85
85
|
for (var prop in b || (b = {}))
|
|
86
|
-
if (__hasOwnProp$
|
|
87
|
-
__defNormalProp$
|
|
88
|
-
if (__getOwnPropSymbols$
|
|
89
|
-
for (var prop of __getOwnPropSymbols$
|
|
90
|
-
if (__propIsEnum$
|
|
91
|
-
__defNormalProp$
|
|
86
|
+
if (__hasOwnProp$K.call(b, prop))
|
|
87
|
+
__defNormalProp$K(a, prop, b[prop]);
|
|
88
|
+
if (__getOwnPropSymbols$K)
|
|
89
|
+
for (var prop of __getOwnPropSymbols$K(b)) {
|
|
90
|
+
if (__propIsEnum$K.call(b, prop))
|
|
91
|
+
__defNormalProp$K(a, prop, b[prop]);
|
|
92
92
|
}
|
|
93
93
|
return a;
|
|
94
94
|
};
|
|
95
|
-
var __spreadProps$
|
|
95
|
+
var __spreadProps$t = (a, b) => __defProps$t(a, __getOwnPropDescs$t(b));
|
|
96
96
|
const runtimePanelPlugins = /* @__PURE__ */ new Map();
|
|
97
97
|
function registerRuntimePanelPlugin({ pluginId, plugin }) {
|
|
98
98
|
if (runtimePanelPlugins.has(pluginId)) {
|
|
99
99
|
throw new Error(`A runtime panel plugin with id ${pluginId} has already been registered`);
|
|
100
100
|
}
|
|
101
|
-
plugin.meta = __spreadProps$
|
|
101
|
+
plugin.meta = __spreadProps$t(__spreadValues$K({}, plugin.meta), {
|
|
102
102
|
id: pluginId,
|
|
103
103
|
name: pluginId,
|
|
104
104
|
module: "runtime plugin",
|
|
@@ -126,39 +126,39 @@ function loadPanelPluginSync(pluginId) {
|
|
|
126
126
|
return (_a = getPanelPluginFromCache(pluginId)) != null ? _a : runtimePanelPlugins.get(pluginId);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
var __defProp$
|
|
130
|
-
var __defProps$
|
|
131
|
-
var __getOwnPropDescs$
|
|
132
|
-
var __getOwnPropSymbols$
|
|
133
|
-
var __hasOwnProp$
|
|
134
|
-
var __propIsEnum$
|
|
135
|
-
var __defNormalProp$
|
|
136
|
-
var __spreadValues$
|
|
129
|
+
var __defProp$J = Object.defineProperty;
|
|
130
|
+
var __defProps$s = Object.defineProperties;
|
|
131
|
+
var __getOwnPropDescs$s = Object.getOwnPropertyDescriptors;
|
|
132
|
+
var __getOwnPropSymbols$J = Object.getOwnPropertySymbols;
|
|
133
|
+
var __hasOwnProp$J = Object.prototype.hasOwnProperty;
|
|
134
|
+
var __propIsEnum$J = Object.prototype.propertyIsEnumerable;
|
|
135
|
+
var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
136
|
+
var __spreadValues$J = (a, b) => {
|
|
137
137
|
for (var prop in b || (b = {}))
|
|
138
|
-
if (__hasOwnProp$
|
|
139
|
-
__defNormalProp$
|
|
140
|
-
if (__getOwnPropSymbols$
|
|
141
|
-
for (var prop of __getOwnPropSymbols$
|
|
142
|
-
if (__propIsEnum$
|
|
143
|
-
__defNormalProp$
|
|
138
|
+
if (__hasOwnProp$J.call(b, prop))
|
|
139
|
+
__defNormalProp$J(a, prop, b[prop]);
|
|
140
|
+
if (__getOwnPropSymbols$J)
|
|
141
|
+
for (var prop of __getOwnPropSymbols$J(b)) {
|
|
142
|
+
if (__propIsEnum$J.call(b, prop))
|
|
143
|
+
__defNormalProp$J(a, prop, b[prop]);
|
|
144
144
|
}
|
|
145
145
|
return a;
|
|
146
146
|
};
|
|
147
|
-
var __spreadProps$
|
|
148
|
-
var __objRest$
|
|
147
|
+
var __spreadProps$s = (a, b) => __defProps$s(a, __getOwnPropDescs$s(b));
|
|
148
|
+
var __objRest$4 = (source, exclude) => {
|
|
149
149
|
var target = {};
|
|
150
150
|
for (var prop in source)
|
|
151
|
-
if (__hasOwnProp$
|
|
151
|
+
if (__hasOwnProp$J.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
152
152
|
target[prop] = source[prop];
|
|
153
|
-
if (source != null && __getOwnPropSymbols$
|
|
154
|
-
for (var prop of __getOwnPropSymbols$
|
|
155
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
153
|
+
if (source != null && __getOwnPropSymbols$J)
|
|
154
|
+
for (var prop of __getOwnPropSymbols$J(source)) {
|
|
155
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$J.call(source, prop))
|
|
156
156
|
target[prop] = source[prop];
|
|
157
157
|
}
|
|
158
158
|
return target;
|
|
159
159
|
};
|
|
160
160
|
function SceneComponentWrapperWithoutMemo(_a) {
|
|
161
|
-
var _b = _a, { model } = _b, otherProps = __objRest$
|
|
161
|
+
var _b = _a, { model } = _b, otherProps = __objRest$4(_b, ["model"]);
|
|
162
162
|
var _a2;
|
|
163
163
|
const Component = (_a2 = model.constructor["Component"]) != null ? _a2 : EmptyRenderer;
|
|
164
164
|
const [_, setValue] = React.useState(0);
|
|
@@ -170,7 +170,7 @@ function SceneComponentWrapperWithoutMemo(_a) {
|
|
|
170
170
|
if (!model.isActive) {
|
|
171
171
|
return null;
|
|
172
172
|
}
|
|
173
|
-
return /* @__PURE__ */ React__default["default"].createElement(Component, __spreadProps$
|
|
173
|
+
return /* @__PURE__ */ React__default["default"].createElement(Component, __spreadProps$s(__spreadValues$J({}, otherProps), {
|
|
174
174
|
model
|
|
175
175
|
}));
|
|
176
176
|
}
|
|
@@ -216,19 +216,19 @@ class SceneObjectRef {
|
|
|
216
216
|
}
|
|
217
217
|
_ref = new WeakMap();
|
|
218
218
|
|
|
219
|
-
var __defProp$
|
|
220
|
-
var __getOwnPropSymbols$
|
|
221
|
-
var __hasOwnProp$
|
|
222
|
-
var __propIsEnum$
|
|
223
|
-
var __defNormalProp$
|
|
224
|
-
var __spreadValues$
|
|
219
|
+
var __defProp$I = Object.defineProperty;
|
|
220
|
+
var __getOwnPropSymbols$I = Object.getOwnPropertySymbols;
|
|
221
|
+
var __hasOwnProp$I = Object.prototype.hasOwnProperty;
|
|
222
|
+
var __propIsEnum$I = Object.prototype.propertyIsEnumerable;
|
|
223
|
+
var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
224
|
+
var __spreadValues$I = (a, b) => {
|
|
225
225
|
for (var prop in b || (b = {}))
|
|
226
|
-
if (__hasOwnProp$
|
|
227
|
-
__defNormalProp$
|
|
228
|
-
if (__getOwnPropSymbols$
|
|
229
|
-
for (var prop of __getOwnPropSymbols$
|
|
230
|
-
if (__propIsEnum$
|
|
231
|
-
__defNormalProp$
|
|
226
|
+
if (__hasOwnProp$I.call(b, prop))
|
|
227
|
+
__defNormalProp$I(a, prop, b[prop]);
|
|
228
|
+
if (__getOwnPropSymbols$I)
|
|
229
|
+
for (var prop of __getOwnPropSymbols$I(b)) {
|
|
230
|
+
if (__propIsEnum$I.call(b, prop))
|
|
231
|
+
__defNormalProp$I(a, prop, b[prop]);
|
|
232
232
|
}
|
|
233
233
|
return a;
|
|
234
234
|
};
|
|
@@ -288,7 +288,7 @@ class SceneObjectBase {
|
|
|
288
288
|
}
|
|
289
289
|
setState(update) {
|
|
290
290
|
const prevState = this._state;
|
|
291
|
-
const newState = __spreadValues$
|
|
291
|
+
const newState = __spreadValues$I(__spreadValues$I({}, this._state), update);
|
|
292
292
|
this._state = Object.freeze(newState);
|
|
293
293
|
this._setParent(update);
|
|
294
294
|
this._handleActivationOfChangedStateProps(prevState, newState);
|
|
@@ -458,19 +458,19 @@ function forEachChild(state, callback) {
|
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
460
|
|
|
461
|
-
var __defProp$
|
|
462
|
-
var __getOwnPropSymbols$
|
|
463
|
-
var __hasOwnProp$
|
|
464
|
-
var __propIsEnum$
|
|
465
|
-
var __defNormalProp$
|
|
466
|
-
var __spreadValues$
|
|
461
|
+
var __defProp$H = Object.defineProperty;
|
|
462
|
+
var __getOwnPropSymbols$H = Object.getOwnPropertySymbols;
|
|
463
|
+
var __hasOwnProp$H = Object.prototype.hasOwnProperty;
|
|
464
|
+
var __propIsEnum$H = Object.prototype.propertyIsEnumerable;
|
|
465
|
+
var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
466
|
+
var __spreadValues$H = (a, b) => {
|
|
467
467
|
for (var prop in b || (b = {}))
|
|
468
|
-
if (__hasOwnProp$
|
|
469
|
-
__defNormalProp$
|
|
470
|
-
if (__getOwnPropSymbols$
|
|
471
|
-
for (var prop of __getOwnPropSymbols$
|
|
472
|
-
if (__propIsEnum$
|
|
473
|
-
__defNormalProp$
|
|
468
|
+
if (__hasOwnProp$H.call(b, prop))
|
|
469
|
+
__defNormalProp$H(a, prop, b[prop]);
|
|
470
|
+
if (__getOwnPropSymbols$H)
|
|
471
|
+
for (var prop of __getOwnPropSymbols$H(b)) {
|
|
472
|
+
if (__propIsEnum$H.call(b, prop))
|
|
473
|
+
__defNormalProp$H(a, prop, b[prop]);
|
|
474
474
|
}
|
|
475
475
|
return a;
|
|
476
476
|
};
|
|
@@ -479,7 +479,7 @@ function cloneSceneObject(sceneObject, withState) {
|
|
|
479
479
|
return new sceneObject.constructor(clonedState);
|
|
480
480
|
}
|
|
481
481
|
function cloneSceneObjectState(sceneState, withState) {
|
|
482
|
-
const clonedState = __spreadValues$
|
|
482
|
+
const clonedState = __spreadValues$H({}, sceneState);
|
|
483
483
|
for (const key in clonedState) {
|
|
484
484
|
const propValue = clonedState[key];
|
|
485
485
|
if (propValue instanceof SceneObjectBase) {
|
|
@@ -657,25 +657,25 @@ function isUrlValueEqual(currentUrlValue, newUrlValue) {
|
|
|
657
657
|
return lodash.isEqual(currentUrlValue, newUrlValue);
|
|
658
658
|
}
|
|
659
659
|
|
|
660
|
-
var __defProp$
|
|
661
|
-
var __getOwnPropSymbols$
|
|
662
|
-
var __hasOwnProp$
|
|
663
|
-
var __propIsEnum$
|
|
664
|
-
var __defNormalProp$
|
|
665
|
-
var __spreadValues$
|
|
660
|
+
var __defProp$G = Object.defineProperty;
|
|
661
|
+
var __getOwnPropSymbols$G = Object.getOwnPropertySymbols;
|
|
662
|
+
var __hasOwnProp$G = Object.prototype.hasOwnProperty;
|
|
663
|
+
var __propIsEnum$G = Object.prototype.propertyIsEnumerable;
|
|
664
|
+
var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
665
|
+
var __spreadValues$G = (a, b) => {
|
|
666
666
|
for (var prop in b || (b = {}))
|
|
667
|
-
if (__hasOwnProp$
|
|
668
|
-
__defNormalProp$
|
|
669
|
-
if (__getOwnPropSymbols$
|
|
670
|
-
for (var prop of __getOwnPropSymbols$
|
|
671
|
-
if (__propIsEnum$
|
|
672
|
-
__defNormalProp$
|
|
667
|
+
if (__hasOwnProp$G.call(b, prop))
|
|
668
|
+
__defNormalProp$G(a, prop, b[prop]);
|
|
669
|
+
if (__getOwnPropSymbols$G)
|
|
670
|
+
for (var prop of __getOwnPropSymbols$G(b)) {
|
|
671
|
+
if (__propIsEnum$G.call(b, prop))
|
|
672
|
+
__defNormalProp$G(a, prop, b[prop]);
|
|
673
673
|
}
|
|
674
674
|
return a;
|
|
675
675
|
};
|
|
676
676
|
class SceneDataNode extends SceneObjectBase {
|
|
677
677
|
constructor(state) {
|
|
678
|
-
super(__spreadValues$
|
|
678
|
+
super(__spreadValues$G({
|
|
679
679
|
data: emptyPanelData
|
|
680
680
|
}, state));
|
|
681
681
|
}
|
|
@@ -756,19 +756,19 @@ function evaluateTimeRange(from, to, timeZone, fiscalYearStartMonth, delay) {
|
|
|
756
756
|
};
|
|
757
757
|
}
|
|
758
758
|
|
|
759
|
-
var __defProp$
|
|
760
|
-
var __getOwnPropSymbols$
|
|
761
|
-
var __hasOwnProp$
|
|
762
|
-
var __propIsEnum$
|
|
763
|
-
var __defNormalProp$
|
|
764
|
-
var __spreadValues$
|
|
759
|
+
var __defProp$F = Object.defineProperty;
|
|
760
|
+
var __getOwnPropSymbols$F = Object.getOwnPropertySymbols;
|
|
761
|
+
var __hasOwnProp$F = Object.prototype.hasOwnProperty;
|
|
762
|
+
var __propIsEnum$F = Object.prototype.propertyIsEnumerable;
|
|
763
|
+
var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
764
|
+
var __spreadValues$F = (a, b) => {
|
|
765
765
|
for (var prop in b || (b = {}))
|
|
766
|
-
if (__hasOwnProp$
|
|
767
|
-
__defNormalProp$
|
|
768
|
-
if (__getOwnPropSymbols$
|
|
769
|
-
for (var prop of __getOwnPropSymbols$
|
|
770
|
-
if (__propIsEnum$
|
|
771
|
-
__defNormalProp$
|
|
766
|
+
if (__hasOwnProp$F.call(b, prop))
|
|
767
|
+
__defNormalProp$F(a, prop, b[prop]);
|
|
768
|
+
if (__getOwnPropSymbols$F)
|
|
769
|
+
for (var prop of __getOwnPropSymbols$F(b)) {
|
|
770
|
+
if (__propIsEnum$F.call(b, prop))
|
|
771
|
+
__defNormalProp$F(a, prop, b[prop]);
|
|
772
772
|
}
|
|
773
773
|
return a;
|
|
774
774
|
};
|
|
@@ -785,7 +785,7 @@ class SceneTimeRange extends SceneObjectBase {
|
|
|
785
785
|
state.fiscalYearStartMonth,
|
|
786
786
|
state.UNSAFE_nowDelay
|
|
787
787
|
);
|
|
788
|
-
super(__spreadValues$
|
|
788
|
+
super(__spreadValues$F({ from, to, timeZone, value }, state));
|
|
789
789
|
this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: ["from", "to", "timezone"] });
|
|
790
790
|
this.onTimeRangeChange = (timeRange) => {
|
|
791
791
|
const update = {};
|
|
@@ -1695,25 +1695,25 @@ function collectAllVariables(sceneObject, record = {}) {
|
|
|
1695
1695
|
return record;
|
|
1696
1696
|
}
|
|
1697
1697
|
|
|
1698
|
-
var __defProp$
|
|
1699
|
-
var __defProps$
|
|
1700
|
-
var __getOwnPropDescs$
|
|
1701
|
-
var __getOwnPropSymbols$
|
|
1702
|
-
var __hasOwnProp$
|
|
1703
|
-
var __propIsEnum$
|
|
1704
|
-
var __defNormalProp$
|
|
1705
|
-
var __spreadValues$
|
|
1698
|
+
var __defProp$E = Object.defineProperty;
|
|
1699
|
+
var __defProps$r = Object.defineProperties;
|
|
1700
|
+
var __getOwnPropDescs$r = Object.getOwnPropertyDescriptors;
|
|
1701
|
+
var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
|
|
1702
|
+
var __hasOwnProp$E = Object.prototype.hasOwnProperty;
|
|
1703
|
+
var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
|
|
1704
|
+
var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1705
|
+
var __spreadValues$E = (a, b) => {
|
|
1706
1706
|
for (var prop in b || (b = {}))
|
|
1707
|
-
if (__hasOwnProp$
|
|
1708
|
-
__defNormalProp$
|
|
1709
|
-
if (__getOwnPropSymbols$
|
|
1710
|
-
for (var prop of __getOwnPropSymbols$
|
|
1711
|
-
if (__propIsEnum$
|
|
1712
|
-
__defNormalProp$
|
|
1707
|
+
if (__hasOwnProp$E.call(b, prop))
|
|
1708
|
+
__defNormalProp$E(a, prop, b[prop]);
|
|
1709
|
+
if (__getOwnPropSymbols$E)
|
|
1710
|
+
for (var prop of __getOwnPropSymbols$E(b)) {
|
|
1711
|
+
if (__propIsEnum$E.call(b, prop))
|
|
1712
|
+
__defNormalProp$E(a, prop, b[prop]);
|
|
1713
1713
|
}
|
|
1714
1714
|
return a;
|
|
1715
1715
|
};
|
|
1716
|
-
var __spreadProps$
|
|
1716
|
+
var __spreadProps$r = (a, b) => __defProps$r(a, __getOwnPropDescs$r(b));
|
|
1717
1717
|
function getTemplateProxyForField(field, frame, frames) {
|
|
1718
1718
|
return new Proxy(
|
|
1719
1719
|
{},
|
|
@@ -1729,7 +1729,7 @@ function getTemplateProxyForField(field, frame, frames) {
|
|
|
1729
1729
|
if (!field.labels) {
|
|
1730
1730
|
return "";
|
|
1731
1731
|
}
|
|
1732
|
-
return __spreadProps$
|
|
1732
|
+
return __spreadProps$r(__spreadValues$E({}, field.labels), {
|
|
1733
1733
|
__values: Object.values(field.labels).sort().join(", "),
|
|
1734
1734
|
toString: () => {
|
|
1735
1735
|
return data.formatLabels(field.labels, "", true);
|
|
@@ -2191,19 +2191,19 @@ class VariableValueRecorder {
|
|
|
2191
2191
|
}
|
|
2192
2192
|
}
|
|
2193
2193
|
|
|
2194
|
-
var __defProp$
|
|
2195
|
-
var __getOwnPropSymbols$
|
|
2196
|
-
var __hasOwnProp$
|
|
2197
|
-
var __propIsEnum$
|
|
2198
|
-
var __defNormalProp$
|
|
2199
|
-
var __spreadValues$
|
|
2194
|
+
var __defProp$D = Object.defineProperty;
|
|
2195
|
+
var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
|
|
2196
|
+
var __hasOwnProp$D = Object.prototype.hasOwnProperty;
|
|
2197
|
+
var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
|
|
2198
|
+
var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2199
|
+
var __spreadValues$D = (a, b) => {
|
|
2200
2200
|
for (var prop in b || (b = {}))
|
|
2201
|
-
if (__hasOwnProp$
|
|
2202
|
-
__defNormalProp$
|
|
2203
|
-
if (__getOwnPropSymbols$
|
|
2204
|
-
for (var prop of __getOwnPropSymbols$
|
|
2205
|
-
if (__propIsEnum$
|
|
2206
|
-
__defNormalProp$
|
|
2201
|
+
if (__hasOwnProp$D.call(b, prop))
|
|
2202
|
+
__defNormalProp$D(a, prop, b[prop]);
|
|
2203
|
+
if (__getOwnPropSymbols$D)
|
|
2204
|
+
for (var prop of __getOwnPropSymbols$D(b)) {
|
|
2205
|
+
if (__propIsEnum$D.call(b, prop))
|
|
2206
|
+
__defNormalProp$D(a, prop, b[prop]);
|
|
2207
2207
|
}
|
|
2208
2208
|
return a;
|
|
2209
2209
|
};
|
|
@@ -2224,7 +2224,7 @@ const DEFAULT_COMPARE_OPTIONS = [
|
|
|
2224
2224
|
];
|
|
2225
2225
|
class SceneTimeRangeCompare extends SceneObjectBase {
|
|
2226
2226
|
constructor(state) {
|
|
2227
|
-
super(__spreadValues$
|
|
2227
|
+
super(__spreadValues$D({ compareOptions: DEFAULT_COMPARE_OPTIONS }, state));
|
|
2228
2228
|
this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: ["compareWith"] });
|
|
2229
2229
|
this._onActivate = () => {
|
|
2230
2230
|
const sceneTimeRange = sceneGraph.getTimeRange(this);
|
|
@@ -2314,7 +2314,7 @@ class SceneTimeRangeCompare extends SceneObjectBase {
|
|
|
2314
2314
|
SceneTimeRangeCompare.Component = SceneTimeRangeCompareRenderer;
|
|
2315
2315
|
function SceneTimeRangeCompareRenderer({ model }) {
|
|
2316
2316
|
var _a;
|
|
2317
|
-
const styles = ui.useStyles2(getStyles$
|
|
2317
|
+
const styles = ui.useStyles2(getStyles$9);
|
|
2318
2318
|
const { compareWith, compareOptions } = model.useState();
|
|
2319
2319
|
const [previousCompare, setPreviousCompare] = React__default["default"].useState(compareWith);
|
|
2320
2320
|
const previousValue = (_a = compareOptions.find(({ value: value2 }) => value2 === previousCompare)) != null ? _a : PREVIOUS_PERIOD_COMPARE_OPTION;
|
|
@@ -2354,7 +2354,7 @@ function SceneTimeRangeCompareRenderer({ model }) {
|
|
|
2354
2354
|
isOpen: false
|
|
2355
2355
|
}, previousValue.label));
|
|
2356
2356
|
}
|
|
2357
|
-
function getStyles$
|
|
2357
|
+
function getStyles$9(theme) {
|
|
2358
2358
|
return {
|
|
2359
2359
|
previewButton: css.css({
|
|
2360
2360
|
"&:disabled": {
|
|
@@ -2368,32 +2368,32 @@ function getStyles$a(theme) {
|
|
|
2368
2368
|
|
|
2369
2369
|
const getCompareSeriesRefId = (refId) => `${refId}-compare`;
|
|
2370
2370
|
|
|
2371
|
-
var __defProp$
|
|
2372
|
-
var __defProps$
|
|
2373
|
-
var __getOwnPropDescs$
|
|
2374
|
-
var __getOwnPropSymbols$
|
|
2375
|
-
var __hasOwnProp$
|
|
2376
|
-
var __propIsEnum$
|
|
2377
|
-
var __defNormalProp$
|
|
2378
|
-
var __spreadValues$
|
|
2371
|
+
var __defProp$C = Object.defineProperty;
|
|
2372
|
+
var __defProps$q = Object.defineProperties;
|
|
2373
|
+
var __getOwnPropDescs$q = Object.getOwnPropertyDescriptors;
|
|
2374
|
+
var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
|
|
2375
|
+
var __hasOwnProp$C = Object.prototype.hasOwnProperty;
|
|
2376
|
+
var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
|
|
2377
|
+
var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2378
|
+
var __spreadValues$C = (a, b) => {
|
|
2379
2379
|
for (var prop in b || (b = {}))
|
|
2380
|
-
if (__hasOwnProp$
|
|
2381
|
-
__defNormalProp$
|
|
2382
|
-
if (__getOwnPropSymbols$
|
|
2383
|
-
for (var prop of __getOwnPropSymbols$
|
|
2384
|
-
if (__propIsEnum$
|
|
2385
|
-
__defNormalProp$
|
|
2380
|
+
if (__hasOwnProp$C.call(b, prop))
|
|
2381
|
+
__defNormalProp$C(a, prop, b[prop]);
|
|
2382
|
+
if (__getOwnPropSymbols$C)
|
|
2383
|
+
for (var prop of __getOwnPropSymbols$C(b)) {
|
|
2384
|
+
if (__propIsEnum$C.call(b, prop))
|
|
2385
|
+
__defNormalProp$C(a, prop, b[prop]);
|
|
2386
2386
|
}
|
|
2387
2387
|
return a;
|
|
2388
2388
|
};
|
|
2389
|
-
var __spreadProps$
|
|
2389
|
+
var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
|
|
2390
2390
|
function timeShiftQueryResponseOperator(data$1) {
|
|
2391
2391
|
return data$1.pipe(
|
|
2392
2392
|
rxjs.map(([p, s]) => {
|
|
2393
2393
|
const diff = s.timeRange.from.diff(p.timeRange.from);
|
|
2394
2394
|
s.series.forEach((series) => {
|
|
2395
2395
|
series.refId = getCompareSeriesRefId(series.refId || "");
|
|
2396
|
-
series.meta = __spreadProps$
|
|
2396
|
+
series.meta = __spreadProps$q(__spreadValues$C({}, series.meta), {
|
|
2397
2397
|
timeCompare: {
|
|
2398
2398
|
diffMs: diff,
|
|
2399
2399
|
isTimeShiftQuery: true
|
|
@@ -2405,7 +2405,7 @@ function timeShiftQueryResponseOperator(data$1) {
|
|
|
2405
2405
|
return diff < 0 ? v - diff : v + diff;
|
|
2406
2406
|
});
|
|
2407
2407
|
}
|
|
2408
|
-
field.config = __spreadProps$
|
|
2408
|
+
field.config = __spreadProps$q(__spreadValues$C({}, field.config), {
|
|
2409
2409
|
color: {
|
|
2410
2410
|
mode: "fixed",
|
|
2411
2411
|
fixedColor: runtime.config.theme.palette.gray60
|
|
@@ -2414,32 +2414,32 @@ function timeShiftQueryResponseOperator(data$1) {
|
|
|
2414
2414
|
return field;
|
|
2415
2415
|
});
|
|
2416
2416
|
});
|
|
2417
|
-
return __spreadProps$
|
|
2417
|
+
return __spreadProps$q(__spreadValues$C({}, p), {
|
|
2418
2418
|
series: [...p.series, ...s.series]
|
|
2419
2419
|
});
|
|
2420
2420
|
})
|
|
2421
2421
|
);
|
|
2422
2422
|
}
|
|
2423
2423
|
|
|
2424
|
-
var __defProp$
|
|
2425
|
-
var __defProps$
|
|
2426
|
-
var __getOwnPropDescs$
|
|
2427
|
-
var __getOwnPropSymbols$
|
|
2428
|
-
var __hasOwnProp$
|
|
2429
|
-
var __propIsEnum$
|
|
2430
|
-
var __defNormalProp$
|
|
2431
|
-
var __spreadValues$
|
|
2424
|
+
var __defProp$B = Object.defineProperty;
|
|
2425
|
+
var __defProps$p = Object.defineProperties;
|
|
2426
|
+
var __getOwnPropDescs$p = Object.getOwnPropertyDescriptors;
|
|
2427
|
+
var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
|
|
2428
|
+
var __hasOwnProp$B = Object.prototype.hasOwnProperty;
|
|
2429
|
+
var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
|
|
2430
|
+
var __defNormalProp$B = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2431
|
+
var __spreadValues$B = (a, b) => {
|
|
2432
2432
|
for (var prop in b || (b = {}))
|
|
2433
|
-
if (__hasOwnProp$
|
|
2434
|
-
__defNormalProp$
|
|
2435
|
-
if (__getOwnPropSymbols$
|
|
2436
|
-
for (var prop of __getOwnPropSymbols$
|
|
2437
|
-
if (__propIsEnum$
|
|
2438
|
-
__defNormalProp$
|
|
2433
|
+
if (__hasOwnProp$B.call(b, prop))
|
|
2434
|
+
__defNormalProp$B(a, prop, b[prop]);
|
|
2435
|
+
if (__getOwnPropSymbols$B)
|
|
2436
|
+
for (var prop of __getOwnPropSymbols$B(b)) {
|
|
2437
|
+
if (__propIsEnum$B.call(b, prop))
|
|
2438
|
+
__defNormalProp$B(a, prop, b[prop]);
|
|
2439
2439
|
}
|
|
2440
2440
|
return a;
|
|
2441
2441
|
};
|
|
2442
|
-
var __spreadProps$
|
|
2442
|
+
var __spreadProps$p = (a, b) => __defProps$p(a, __getOwnPropDescs$p(b));
|
|
2443
2443
|
function filterAnnotations(data, filters) {
|
|
2444
2444
|
var _a;
|
|
2445
2445
|
if (!Array.isArray(data) || data.length === 0) {
|
|
@@ -2490,11 +2490,11 @@ function filterAnnotations(data, filters) {
|
|
|
2490
2490
|
continue;
|
|
2491
2491
|
}
|
|
2492
2492
|
}
|
|
2493
|
-
fields.push(__spreadProps$
|
|
2493
|
+
fields.push(__spreadProps$p(__spreadValues$B({}, field), {
|
|
2494
2494
|
values: buffer
|
|
2495
2495
|
}));
|
|
2496
2496
|
}
|
|
2497
|
-
processed.push(__spreadProps$
|
|
2497
|
+
processed.push(__spreadProps$p(__spreadValues$B({}, frame), {
|
|
2498
2498
|
fields,
|
|
2499
2499
|
length: frameLength
|
|
2500
2500
|
}));
|
|
@@ -2847,6 +2847,158 @@ class CustomAllValue {
|
|
|
2847
2847
|
}
|
|
2848
2848
|
}
|
|
2849
2849
|
|
|
2850
|
+
var __defProp$A = Object.defineProperty;
|
|
2851
|
+
var __defProps$o = Object.defineProperties;
|
|
2852
|
+
var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
|
|
2853
|
+
var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
|
|
2854
|
+
var __hasOwnProp$A = Object.prototype.hasOwnProperty;
|
|
2855
|
+
var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
|
|
2856
|
+
var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2857
|
+
var __spreadValues$A = (a, b) => {
|
|
2858
|
+
for (var prop in b || (b = {}))
|
|
2859
|
+
if (__hasOwnProp$A.call(b, prop))
|
|
2860
|
+
__defNormalProp$A(a, prop, b[prop]);
|
|
2861
|
+
if (__getOwnPropSymbols$A)
|
|
2862
|
+
for (var prop of __getOwnPropSymbols$A(b)) {
|
|
2863
|
+
if (__propIsEnum$A.call(b, prop))
|
|
2864
|
+
__defNormalProp$A(a, prop, b[prop]);
|
|
2865
|
+
}
|
|
2866
|
+
return a;
|
|
2867
|
+
};
|
|
2868
|
+
var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
|
|
2869
|
+
var __objRest$3 = (source, exclude) => {
|
|
2870
|
+
var target = {};
|
|
2871
|
+
for (var prop in source)
|
|
2872
|
+
if (__hasOwnProp$A.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2873
|
+
target[prop] = source[prop];
|
|
2874
|
+
if (source != null && __getOwnPropSymbols$A)
|
|
2875
|
+
for (var prop of __getOwnPropSymbols$A(source)) {
|
|
2876
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$A.call(source, prop))
|
|
2877
|
+
target[prop] = source[prop];
|
|
2878
|
+
}
|
|
2879
|
+
return target;
|
|
2880
|
+
};
|
|
2881
|
+
function VariableValueSelect({ model }) {
|
|
2882
|
+
const { value, key } = model.useState();
|
|
2883
|
+
const onInputChange = model.onSearchChange ? (value2, meta) => {
|
|
2884
|
+
if (meta.action === "input-change") {
|
|
2885
|
+
model.onSearchChange(value2);
|
|
2886
|
+
}
|
|
2887
|
+
} : void 0;
|
|
2888
|
+
return /* @__PURE__ */ React__default["default"].createElement(ui.Select, {
|
|
2889
|
+
id: key,
|
|
2890
|
+
placeholder: "Select value",
|
|
2891
|
+
width: "auto",
|
|
2892
|
+
value,
|
|
2893
|
+
allowCustomValue: true,
|
|
2894
|
+
virtualized: true,
|
|
2895
|
+
tabSelectsValue: false,
|
|
2896
|
+
onInputChange,
|
|
2897
|
+
options: model.getOptionsForSelect(),
|
|
2898
|
+
"data-testid": e2eSelectors.selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(`${value}`),
|
|
2899
|
+
onChange: (newValue) => {
|
|
2900
|
+
model.changeValueTo(newValue.value, newValue.label);
|
|
2901
|
+
}
|
|
2902
|
+
});
|
|
2903
|
+
}
|
|
2904
|
+
function VariableValueSelectMulti({ model }) {
|
|
2905
|
+
const { value, key, maxVisibleValues, noValueOnClear } = model.useState();
|
|
2906
|
+
const arrayValue = React.useMemo(() => lodash.isArray(value) ? value : [value], [value]);
|
|
2907
|
+
const options = model.getOptionsForSelect();
|
|
2908
|
+
const [uncommittedValue, setUncommittedValue] = React.useState(arrayValue);
|
|
2909
|
+
const [inputValue, setInputValue] = React.useState("");
|
|
2910
|
+
React.useEffect(() => {
|
|
2911
|
+
setUncommittedValue(arrayValue);
|
|
2912
|
+
}, [arrayValue]);
|
|
2913
|
+
const onInputChange = (value2, { action }) => {
|
|
2914
|
+
if (action === "input-change") {
|
|
2915
|
+
setInputValue(value2);
|
|
2916
|
+
if (model.onSearchChange) {
|
|
2917
|
+
model.onSearchChange(value2);
|
|
2918
|
+
}
|
|
2919
|
+
return value2;
|
|
2920
|
+
}
|
|
2921
|
+
if (action === "input-blur") {
|
|
2922
|
+
setInputValue("");
|
|
2923
|
+
return "";
|
|
2924
|
+
}
|
|
2925
|
+
return inputValue;
|
|
2926
|
+
};
|
|
2927
|
+
const placeholder = options.length > 0 ? "Select value" : "";
|
|
2928
|
+
return /* @__PURE__ */ React__default["default"].createElement(ui.MultiSelect, {
|
|
2929
|
+
id: key,
|
|
2930
|
+
placeholder,
|
|
2931
|
+
width: "auto",
|
|
2932
|
+
inputValue,
|
|
2933
|
+
value: uncommittedValue,
|
|
2934
|
+
noMultiValueWrap: true,
|
|
2935
|
+
maxVisibleValues: maxVisibleValues != null ? maxVisibleValues : 5,
|
|
2936
|
+
tabSelectsValue: false,
|
|
2937
|
+
virtualized: true,
|
|
2938
|
+
allowCustomValue: true,
|
|
2939
|
+
options: model.getOptionsForSelect(),
|
|
2940
|
+
closeMenuOnSelect: false,
|
|
2941
|
+
components: { Option: OptionWithCheckbox },
|
|
2942
|
+
isClearable: true,
|
|
2943
|
+
hideSelectedOptions: false,
|
|
2944
|
+
onInputChange,
|
|
2945
|
+
onBlur: () => {
|
|
2946
|
+
model.changeValueTo(uncommittedValue);
|
|
2947
|
+
},
|
|
2948
|
+
"data-testid": e2eSelectors.selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(`${uncommittedValue}`),
|
|
2949
|
+
onChange: (newValue, action) => {
|
|
2950
|
+
if (action.action === "clear" && noValueOnClear) {
|
|
2951
|
+
model.changeValueTo([]);
|
|
2952
|
+
}
|
|
2953
|
+
setUncommittedValue(newValue.map((x) => x.value));
|
|
2954
|
+
}
|
|
2955
|
+
});
|
|
2956
|
+
}
|
|
2957
|
+
const OptionWithCheckbox = ({
|
|
2958
|
+
children,
|
|
2959
|
+
data,
|
|
2960
|
+
innerProps,
|
|
2961
|
+
innerRef,
|
|
2962
|
+
isFocused,
|
|
2963
|
+
isSelected,
|
|
2964
|
+
renderOptionLabel
|
|
2965
|
+
}) => {
|
|
2966
|
+
const _a = innerProps, rest = __objRest$3(_a, ["onMouseMove", "onMouseOver"]);
|
|
2967
|
+
const theme = ui.useTheme2();
|
|
2968
|
+
const selectStyles = ui.getSelectStyles(theme);
|
|
2969
|
+
const optionStyles = ui.useStyles2(getOptionStyles);
|
|
2970
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$o(__spreadValues$A({
|
|
2971
|
+
ref: innerRef,
|
|
2972
|
+
className: css.cx(selectStyles.option, isFocused && selectStyles.optionFocused)
|
|
2973
|
+
}, rest), {
|
|
2974
|
+
"aria-label": "Select option",
|
|
2975
|
+
title: data.title
|
|
2976
|
+
}), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
2977
|
+
className: optionStyles.checkbox
|
|
2978
|
+
}, /* @__PURE__ */ React__default["default"].createElement(ui.Checkbox, {
|
|
2979
|
+
value: isSelected
|
|
2980
|
+
})), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
2981
|
+
className: selectStyles.optionBody
|
|
2982
|
+
}, /* @__PURE__ */ React__default["default"].createElement("span", null, children)));
|
|
2983
|
+
};
|
|
2984
|
+
OptionWithCheckbox.displayName = "SelectMenuOptions";
|
|
2985
|
+
const getOptionStyles = (theme) => ({
|
|
2986
|
+
checkbox: css.css({
|
|
2987
|
+
marginRight: theme.spacing(2)
|
|
2988
|
+
})
|
|
2989
|
+
});
|
|
2990
|
+
function renderSelectForVariable(model) {
|
|
2991
|
+
if (model.state.isMulti) {
|
|
2992
|
+
return /* @__PURE__ */ React__default["default"].createElement(VariableValueSelectMulti, {
|
|
2993
|
+
model
|
|
2994
|
+
});
|
|
2995
|
+
} else {
|
|
2996
|
+
return /* @__PURE__ */ React__default["default"].createElement(VariableValueSelect, {
|
|
2997
|
+
model
|
|
2998
|
+
});
|
|
2999
|
+
}
|
|
3000
|
+
}
|
|
3001
|
+
|
|
2850
3002
|
var __defProp$z = Object.defineProperty;
|
|
2851
3003
|
var __defProps$n = Object.defineProperties;
|
|
2852
3004
|
var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
|
|
@@ -2972,21 +3124,32 @@ function GroupByVariableRenderer({ model }) {
|
|
|
2972
3124
|
const arrayValue = React.useMemo(() => lodash.isArray(value) ? value : [value], [value]);
|
|
2973
3125
|
const [isFetchingOptions, setIsFetchingOptions] = React.useState(false);
|
|
2974
3126
|
const [isOptionsOpen, setIsOptionsOpen] = React.useState(false);
|
|
3127
|
+
const [inputValue, setInputValue] = React.useState("");
|
|
2975
3128
|
const [uncommittedValue, setUncommittedValue] = React.useState(arrayValue);
|
|
2976
3129
|
React.useEffect(() => {
|
|
2977
3130
|
setUncommittedValue(arrayValue);
|
|
2978
3131
|
}, [arrayValue]);
|
|
2979
|
-
const onInputChange =
|
|
2980
|
-
if (
|
|
2981
|
-
|
|
3132
|
+
const onInputChange = (value2, { action }) => {
|
|
3133
|
+
if (action === "input-change") {
|
|
3134
|
+
setInputValue(value2);
|
|
3135
|
+
if (model.onSearchChange) {
|
|
3136
|
+
model.onSearchChange(value2);
|
|
3137
|
+
}
|
|
3138
|
+
return value2;
|
|
2982
3139
|
}
|
|
2983
|
-
|
|
3140
|
+
if (action === "input-blur") {
|
|
3141
|
+
setInputValue("");
|
|
3142
|
+
return "";
|
|
3143
|
+
}
|
|
3144
|
+
return inputValue;
|
|
3145
|
+
};
|
|
2984
3146
|
const placeholder = "Select value";
|
|
2985
3147
|
return /* @__PURE__ */ React__default["default"].createElement(ui.MultiSelect, {
|
|
2986
3148
|
"data-testid": `GroupBySelect-${key}`,
|
|
2987
3149
|
id: key,
|
|
2988
3150
|
placeholder,
|
|
2989
3151
|
width: "auto",
|
|
3152
|
+
inputValue,
|
|
2990
3153
|
value: uncommittedValue,
|
|
2991
3154
|
noMultiValueWrap: true,
|
|
2992
3155
|
maxVisibleValues: maxVisibleValues != null ? maxVisibleValues : 5,
|
|
@@ -2997,7 +3160,9 @@ function GroupByVariableRenderer({ model }) {
|
|
|
2997
3160
|
closeMenuOnSelect: false,
|
|
2998
3161
|
isOpen: isOptionsOpen,
|
|
2999
3162
|
isClearable: true,
|
|
3163
|
+
hideSelectedOptions: false,
|
|
3000
3164
|
isLoading: isFetchingOptions,
|
|
3165
|
+
components: { Option: OptionWithCheckbox },
|
|
3001
3166
|
onInputChange,
|
|
3002
3167
|
onBlur: () => {
|
|
3003
3168
|
model.changeValueTo(uncommittedValue);
|
|
@@ -3035,7 +3200,7 @@ function LoadingIndicator(props) {
|
|
|
3035
3200
|
}
|
|
3036
3201
|
|
|
3037
3202
|
function ControlsLabel(props) {
|
|
3038
|
-
const styles = ui.useStyles2(getStyles$
|
|
3203
|
+
const styles = ui.useStyles2(getStyles$8);
|
|
3039
3204
|
const theme = ui.useTheme2();
|
|
3040
3205
|
const isVertical = props.layout === "vertical";
|
|
3041
3206
|
const loadingIndicator = Boolean(props.isLoading) ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -3098,7 +3263,7 @@ function ControlsLabel(props) {
|
|
|
3098
3263
|
}
|
|
3099
3264
|
return labelElement;
|
|
3100
3265
|
}
|
|
3101
|
-
const getStyles$
|
|
3266
|
+
const getStyles$8 = (theme) => ({
|
|
3102
3267
|
horizontalLabel: css.css({
|
|
3103
3268
|
background: theme.isDark ? theme.colors.background.primary : theme.colors.background.secondary,
|
|
3104
3269
|
display: `flex`,
|
|
@@ -3160,7 +3325,7 @@ function keyLabelToOption(key, label) {
|
|
|
3160
3325
|
}
|
|
3161
3326
|
function AdHocFilterRenderer({ filter, model }) {
|
|
3162
3327
|
var _a, _b;
|
|
3163
|
-
const styles = ui.useStyles2(getStyles$
|
|
3328
|
+
const styles = ui.useStyles2(getStyles$7);
|
|
3164
3329
|
const [state, setState] = React.useState({});
|
|
3165
3330
|
const keyValue = keyLabelToOption(filter.key, filter.keyLabel);
|
|
3166
3331
|
const valueValue = keyLabelToOption(filter.value, filter.valueLabel);
|
|
@@ -3253,7 +3418,7 @@ function AdHocFilterRenderer({ filter, model }) {
|
|
|
3253
3418
|
onClick: () => model._removeFilter(filter)
|
|
3254
3419
|
}));
|
|
3255
3420
|
}
|
|
3256
|
-
const getStyles$
|
|
3421
|
+
const getStyles$7 = (theme) => ({
|
|
3257
3422
|
field: css.css({
|
|
3258
3423
|
marginBottom: 0
|
|
3259
3424
|
}),
|
|
@@ -3547,7 +3712,7 @@ function renderExpression(builder, filters) {
|
|
|
3547
3712
|
}
|
|
3548
3713
|
function AdHocFiltersVariableRenderer({ model }) {
|
|
3549
3714
|
const { filters, readOnly, addFilterButtonText } = model.useState();
|
|
3550
|
-
const styles = ui.useStyles2(getStyles$
|
|
3715
|
+
const styles = ui.useStyles2(getStyles$6);
|
|
3551
3716
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
3552
3717
|
className: styles.wrapper
|
|
3553
3718
|
}, filters.map((filter, index) => /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, {
|
|
@@ -3561,7 +3726,7 @@ function AdHocFiltersVariableRenderer({ model }) {
|
|
|
3561
3726
|
addFilterButtonText
|
|
3562
3727
|
}));
|
|
3563
3728
|
}
|
|
3564
|
-
const getStyles$
|
|
3729
|
+
const getStyles$6 = (theme) => ({
|
|
3565
3730
|
wrapper: css.css({
|
|
3566
3731
|
display: "flex",
|
|
3567
3732
|
gap: theme.spacing(2),
|
|
@@ -6030,12 +6195,22 @@ function VariableValueSelectWrapper({ variable, layout, showAlways }) {
|
|
|
6030
6195
|
if (state.hide === data.VariableHide.hideVariable && !showAlways) {
|
|
6031
6196
|
return null;
|
|
6032
6197
|
}
|
|
6198
|
+
if (layout === "vertical") {
|
|
6199
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
6200
|
+
className: verticalContainer,
|
|
6201
|
+
"data-testid": e2eSelectors.selectors.pages.Dashboard.SubMenu.submenuItem
|
|
6202
|
+
}, /* @__PURE__ */ React__default["default"].createElement(VariableLabel, {
|
|
6203
|
+
variable,
|
|
6204
|
+
layout
|
|
6205
|
+
}), /* @__PURE__ */ React__default["default"].createElement(variable.Component, {
|
|
6206
|
+
model: variable
|
|
6207
|
+
}));
|
|
6208
|
+
}
|
|
6033
6209
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
6034
|
-
className:
|
|
6210
|
+
className: containerStyle,
|
|
6035
6211
|
"data-testid": e2eSelectors.selectors.pages.Dashboard.SubMenu.submenuItem
|
|
6036
6212
|
}, /* @__PURE__ */ React__default["default"].createElement(VariableLabel, {
|
|
6037
|
-
variable
|
|
6038
|
-
layout
|
|
6213
|
+
variable
|
|
6039
6214
|
}), /* @__PURE__ */ React__default["default"].createElement(variable.Component, {
|
|
6040
6215
|
model: variable
|
|
6041
6216
|
}));
|
|
@@ -6051,15 +6226,18 @@ function VariableLabel({ variable, layout }) {
|
|
|
6051
6226
|
return /* @__PURE__ */ React__default["default"].createElement(ControlsLabel, {
|
|
6052
6227
|
htmlFor: elementId,
|
|
6053
6228
|
isLoading: state.loading,
|
|
6054
|
-
onCancel:
|
|
6229
|
+
onCancel: () => {
|
|
6230
|
+
var _a2;
|
|
6231
|
+
return (_a2 = variable.onCancel) == null ? void 0 : _a2.call(variable);
|
|
6232
|
+
},
|
|
6055
6233
|
label: labelOrName,
|
|
6056
6234
|
error: state.error,
|
|
6057
6235
|
layout,
|
|
6058
6236
|
description: (_b = state.description) != null ? _b : void 0
|
|
6059
6237
|
});
|
|
6060
6238
|
}
|
|
6061
|
-
const containerStyle = css.css({ display: "flex"
|
|
6062
|
-
const verticalContainer = css.css({ flexDirection: "column" });
|
|
6239
|
+
const containerStyle = css.css({ display: "flex" });
|
|
6240
|
+
const verticalContainer = css.css({ display: "flex", flexDirection: "column" });
|
|
6063
6241
|
|
|
6064
6242
|
class VariableValueControl extends SceneObjectBase {
|
|
6065
6243
|
}
|
|
@@ -6348,90 +6526,6 @@ class ConstantVariable extends SceneObjectBase {
|
|
|
6348
6526
|
}
|
|
6349
6527
|
}
|
|
6350
6528
|
|
|
6351
|
-
function VariableValueSelect({ model }) {
|
|
6352
|
-
const { value, key } = model.useState();
|
|
6353
|
-
const styles = ui.useStyles2(getStyles$6);
|
|
6354
|
-
const onInputChange = model.onSearchChange ? (value2, meta) => {
|
|
6355
|
-
if (meta.action === "input-change") {
|
|
6356
|
-
model.onSearchChange(value2);
|
|
6357
|
-
}
|
|
6358
|
-
} : void 0;
|
|
6359
|
-
return /* @__PURE__ */ React__default["default"].createElement(ui.Select, {
|
|
6360
|
-
id: key,
|
|
6361
|
-
placeholder: "Select value",
|
|
6362
|
-
width: "auto",
|
|
6363
|
-
value,
|
|
6364
|
-
allowCustomValue: true,
|
|
6365
|
-
virtualized: true,
|
|
6366
|
-
tabSelectsValue: false,
|
|
6367
|
-
onInputChange,
|
|
6368
|
-
options: model.getOptionsForSelect(),
|
|
6369
|
-
"data-testid": e2eSelectors.selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(`${value}`),
|
|
6370
|
-
onChange: (newValue) => {
|
|
6371
|
-
model.changeValueTo(newValue.value, newValue.label);
|
|
6372
|
-
},
|
|
6373
|
-
className: styles.overflow
|
|
6374
|
-
});
|
|
6375
|
-
}
|
|
6376
|
-
function VariableValueSelectMulti({ model }) {
|
|
6377
|
-
const { value, key, maxVisibleValues, noValueOnClear } = model.useState();
|
|
6378
|
-
const arrayValue = React.useMemo(() => lodash.isArray(value) ? value : [value], [value]);
|
|
6379
|
-
const options = model.getOptionsForSelect();
|
|
6380
|
-
const [uncommittedValue, setUncommittedValue] = React.useState(arrayValue);
|
|
6381
|
-
React.useEffect(() => {
|
|
6382
|
-
setUncommittedValue(arrayValue);
|
|
6383
|
-
}, [arrayValue]);
|
|
6384
|
-
const onInputChange = model.onSearchChange ? (value2, meta) => {
|
|
6385
|
-
if (meta.action === "input-change") {
|
|
6386
|
-
model.onSearchChange(value2);
|
|
6387
|
-
}
|
|
6388
|
-
} : void 0;
|
|
6389
|
-
const placeholder = options.length > 0 ? "Select value" : "";
|
|
6390
|
-
const styles = ui.useStyles2(getStyles$6);
|
|
6391
|
-
return /* @__PURE__ */ React__default["default"].createElement(ui.MultiSelect, {
|
|
6392
|
-
id: key,
|
|
6393
|
-
placeholder,
|
|
6394
|
-
width: "auto",
|
|
6395
|
-
value: uncommittedValue,
|
|
6396
|
-
noMultiValueWrap: true,
|
|
6397
|
-
maxVisibleValues: maxVisibleValues != null ? maxVisibleValues : 5,
|
|
6398
|
-
tabSelectsValue: false,
|
|
6399
|
-
virtualized: true,
|
|
6400
|
-
allowCustomValue: true,
|
|
6401
|
-
options: model.getOptionsForSelect(),
|
|
6402
|
-
closeMenuOnSelect: false,
|
|
6403
|
-
isClearable: true,
|
|
6404
|
-
onInputChange,
|
|
6405
|
-
onBlur: () => {
|
|
6406
|
-
model.changeValueTo(uncommittedValue);
|
|
6407
|
-
},
|
|
6408
|
-
"data-testid": e2eSelectors.selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(`${uncommittedValue}`),
|
|
6409
|
-
onChange: (newValue, action) => {
|
|
6410
|
-
if (action.action === "clear" && noValueOnClear) {
|
|
6411
|
-
model.changeValueTo([]);
|
|
6412
|
-
}
|
|
6413
|
-
setUncommittedValue(newValue.map((x) => x.value));
|
|
6414
|
-
},
|
|
6415
|
-
className: styles.overflow
|
|
6416
|
-
});
|
|
6417
|
-
}
|
|
6418
|
-
function renderSelectForVariable(model) {
|
|
6419
|
-
if (model.state.isMulti) {
|
|
6420
|
-
return /* @__PURE__ */ React__default["default"].createElement(VariableValueSelectMulti, {
|
|
6421
|
-
model
|
|
6422
|
-
});
|
|
6423
|
-
} else {
|
|
6424
|
-
return /* @__PURE__ */ React__default["default"].createElement(VariableValueSelect, {
|
|
6425
|
-
model
|
|
6426
|
-
});
|
|
6427
|
-
}
|
|
6428
|
-
}
|
|
6429
|
-
const getStyles$6 = () => ({
|
|
6430
|
-
overflow: css.css({
|
|
6431
|
-
overflow: "hidden"
|
|
6432
|
-
})
|
|
6433
|
-
});
|
|
6434
|
-
|
|
6435
6529
|
var __defProp$i = Object.defineProperty;
|
|
6436
6530
|
var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
|
|
6437
6531
|
var __hasOwnProp$i = Object.prototype.hasOwnProperty;
|