@grafana/scenes 0.24.2 → 0.25.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 +17 -0
- package/dist/esm/components/layout/grid/SceneGridItem.js +30 -0
- package/dist/esm/components/layout/grid/SceneGridItem.js.map +1 -0
- package/dist/esm/components/layout/grid/SceneGridLayout.js +4 -26
- package/dist/esm/components/layout/grid/SceneGridLayout.js.map +1 -1
- package/dist/esm/components/layout/grid/SceneGridLayoutRenderer.js +10 -5
- package/dist/esm/components/layout/grid/SceneGridLayoutRenderer.js.map +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/querying/SceneQueryRunner.js +9 -9
- package/dist/esm/querying/SceneQueryRunner.js.map +1 -1
- package/dist/esm/variables/components/VariableValueSelect.js +51 -3
- package/dist/esm/variables/components/VariableValueSelect.js.map +1 -1
- package/dist/esm/variables/sets/SceneVariableSet.js +7 -0
- package/dist/esm/variables/sets/SceneVariableSet.js.map +1 -1
- package/dist/esm/variables/variants/MultiValueVariable.js +5 -0
- package/dist/esm/variables/variants/MultiValueVariable.js.map +1 -1
- package/dist/esm/variables/variants/TestVariable.js +9 -2
- package/dist/esm/variables/variants/TestVariable.js.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.js +344 -274
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -39,17 +39,17 @@ var ReactGridLayout__default = /*#__PURE__*/_interopDefaultLegacy(ReactGridLayou
|
|
|
39
39
|
var AutoSizer__default = /*#__PURE__*/_interopDefaultLegacy(AutoSizer);
|
|
40
40
|
|
|
41
41
|
var __defProp$s = Object.defineProperty;
|
|
42
|
-
var __getOwnPropSymbols$
|
|
43
|
-
var __hasOwnProp$
|
|
44
|
-
var __propIsEnum$
|
|
42
|
+
var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
|
|
43
|
+
var __hasOwnProp$v = Object.prototype.hasOwnProperty;
|
|
44
|
+
var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
|
|
45
45
|
var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
46
46
|
var __spreadValues$s = (a, b) => {
|
|
47
47
|
for (var prop in b || (b = {}))
|
|
48
|
-
if (__hasOwnProp$
|
|
48
|
+
if (__hasOwnProp$v.call(b, prop))
|
|
49
49
|
__defNormalProp$s(a, prop, b[prop]);
|
|
50
|
-
if (__getOwnPropSymbols$
|
|
51
|
-
for (var prop of __getOwnPropSymbols$
|
|
52
|
-
if (__propIsEnum$
|
|
50
|
+
if (__getOwnPropSymbols$v)
|
|
51
|
+
for (var prop of __getOwnPropSymbols$v(b)) {
|
|
52
|
+
if (__propIsEnum$v.call(b, prop))
|
|
53
53
|
__defNormalProp$s(a, prop, b[prop]);
|
|
54
54
|
}
|
|
55
55
|
return a;
|
|
@@ -76,17 +76,17 @@ function renderSceneComponentWithRouteProps(sceneObject, routeProps) {
|
|
|
76
76
|
var __defProp$r = Object.defineProperty;
|
|
77
77
|
var __defProps$f = Object.defineProperties;
|
|
78
78
|
var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
|
|
79
|
-
var __getOwnPropSymbols$
|
|
80
|
-
var __hasOwnProp$
|
|
81
|
-
var __propIsEnum$
|
|
79
|
+
var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
|
|
80
|
+
var __hasOwnProp$u = Object.prototype.hasOwnProperty;
|
|
81
|
+
var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
|
|
82
82
|
var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
83
83
|
var __spreadValues$r = (a, b) => {
|
|
84
84
|
for (var prop in b || (b = {}))
|
|
85
|
-
if (__hasOwnProp$
|
|
85
|
+
if (__hasOwnProp$u.call(b, prop))
|
|
86
86
|
__defNormalProp$r(a, prop, b[prop]);
|
|
87
|
-
if (__getOwnPropSymbols$
|
|
88
|
-
for (var prop of __getOwnPropSymbols$
|
|
89
|
-
if (__propIsEnum$
|
|
87
|
+
if (__getOwnPropSymbols$u)
|
|
88
|
+
for (var prop of __getOwnPropSymbols$u(b)) {
|
|
89
|
+
if (__propIsEnum$u.call(b, prop))
|
|
90
90
|
__defNormalProp$r(a, prop, b[prop]);
|
|
91
91
|
}
|
|
92
92
|
return a;
|
|
@@ -199,36 +199,36 @@ function lookupVariable(name, sceneObject) {
|
|
|
199
199
|
var __defProp$q = Object.defineProperty;
|
|
200
200
|
var __defProps$e = Object.defineProperties;
|
|
201
201
|
var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
|
|
202
|
-
var __getOwnPropSymbols$
|
|
203
|
-
var __hasOwnProp$
|
|
204
|
-
var __propIsEnum$
|
|
202
|
+
var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
|
|
203
|
+
var __hasOwnProp$t = Object.prototype.hasOwnProperty;
|
|
204
|
+
var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
|
|
205
205
|
var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
206
206
|
var __spreadValues$q = (a, b) => {
|
|
207
207
|
for (var prop in b || (b = {}))
|
|
208
|
-
if (__hasOwnProp$
|
|
208
|
+
if (__hasOwnProp$t.call(b, prop))
|
|
209
209
|
__defNormalProp$q(a, prop, b[prop]);
|
|
210
|
-
if (__getOwnPropSymbols$
|
|
211
|
-
for (var prop of __getOwnPropSymbols$
|
|
212
|
-
if (__propIsEnum$
|
|
210
|
+
if (__getOwnPropSymbols$t)
|
|
211
|
+
for (var prop of __getOwnPropSymbols$t(b)) {
|
|
212
|
+
if (__propIsEnum$t.call(b, prop))
|
|
213
213
|
__defNormalProp$q(a, prop, b[prop]);
|
|
214
214
|
}
|
|
215
215
|
return a;
|
|
216
216
|
};
|
|
217
217
|
var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
|
|
218
|
-
var __objRest$
|
|
218
|
+
var __objRest$4 = (source, exclude) => {
|
|
219
219
|
var target = {};
|
|
220
220
|
for (var prop in source)
|
|
221
|
-
if (__hasOwnProp$
|
|
221
|
+
if (__hasOwnProp$t.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
222
222
|
target[prop] = source[prop];
|
|
223
|
-
if (source != null && __getOwnPropSymbols$
|
|
224
|
-
for (var prop of __getOwnPropSymbols$
|
|
225
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
223
|
+
if (source != null && __getOwnPropSymbols$t)
|
|
224
|
+
for (var prop of __getOwnPropSymbols$t(source)) {
|
|
225
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$t.call(source, prop))
|
|
226
226
|
target[prop] = source[prop];
|
|
227
227
|
}
|
|
228
228
|
return target;
|
|
229
229
|
};
|
|
230
230
|
function SceneComponentWrapperWithoutMemo(_a) {
|
|
231
|
-
var _b = _a, { model } = _b, otherProps = __objRest$
|
|
231
|
+
var _b = _a, { model } = _b, otherProps = __objRest$4(_b, ["model"]);
|
|
232
232
|
var _a2;
|
|
233
233
|
const Component = (_a2 = model.constructor["Component"]) != null ? _a2 : EmptyRenderer;
|
|
234
234
|
const [activated, setActivated] = React__default["default"].useState(false);
|
|
@@ -249,17 +249,17 @@ function EmptyRenderer(_) {
|
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
var __defProp$p = Object.defineProperty;
|
|
252
|
-
var __getOwnPropSymbols$
|
|
253
|
-
var __hasOwnProp$
|
|
254
|
-
var __propIsEnum$
|
|
252
|
+
var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
|
|
253
|
+
var __hasOwnProp$s = Object.prototype.hasOwnProperty;
|
|
254
|
+
var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
|
|
255
255
|
var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
256
256
|
var __spreadValues$p = (a, b) => {
|
|
257
257
|
for (var prop in b || (b = {}))
|
|
258
|
-
if (__hasOwnProp$
|
|
258
|
+
if (__hasOwnProp$s.call(b, prop))
|
|
259
259
|
__defNormalProp$p(a, prop, b[prop]);
|
|
260
|
-
if (__getOwnPropSymbols$
|
|
261
|
-
for (var prop of __getOwnPropSymbols$
|
|
262
|
-
if (__propIsEnum$
|
|
260
|
+
if (__getOwnPropSymbols$s)
|
|
261
|
+
for (var prop of __getOwnPropSymbols$s(b)) {
|
|
262
|
+
if (__propIsEnum$s.call(b, prop))
|
|
263
263
|
__defNormalProp$p(a, prop, b[prop]);
|
|
264
264
|
}
|
|
265
265
|
return a;
|
|
@@ -297,17 +297,17 @@ function getClosest(sceneObject, extract) {
|
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
var __defProp$o = Object.defineProperty;
|
|
300
|
-
var __getOwnPropSymbols$
|
|
301
|
-
var __hasOwnProp$
|
|
302
|
-
var __propIsEnum$
|
|
300
|
+
var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
|
|
301
|
+
var __hasOwnProp$r = Object.prototype.hasOwnProperty;
|
|
302
|
+
var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
|
|
303
303
|
var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
304
304
|
var __spreadValues$o = (a, b) => {
|
|
305
305
|
for (var prop in b || (b = {}))
|
|
306
|
-
if (__hasOwnProp$
|
|
306
|
+
if (__hasOwnProp$r.call(b, prop))
|
|
307
307
|
__defNormalProp$o(a, prop, b[prop]);
|
|
308
|
-
if (__getOwnPropSymbols$
|
|
309
|
-
for (var prop of __getOwnPropSymbols$
|
|
310
|
-
if (__propIsEnum$
|
|
308
|
+
if (__getOwnPropSymbols$r)
|
|
309
|
+
for (var prop of __getOwnPropSymbols$r(b)) {
|
|
310
|
+
if (__propIsEnum$r.call(b, prop))
|
|
311
311
|
__defNormalProp$o(a, prop, b[prop]);
|
|
312
312
|
}
|
|
313
313
|
return a;
|
|
@@ -489,17 +489,17 @@ function useSceneObjectState(model) {
|
|
|
489
489
|
}
|
|
490
490
|
|
|
491
491
|
var __defProp$n = Object.defineProperty;
|
|
492
|
-
var __getOwnPropSymbols$
|
|
493
|
-
var __hasOwnProp$
|
|
494
|
-
var __propIsEnum$
|
|
492
|
+
var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
|
|
493
|
+
var __hasOwnProp$q = Object.prototype.hasOwnProperty;
|
|
494
|
+
var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
|
|
495
495
|
var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
496
496
|
var __spreadValues$n = (a, b) => {
|
|
497
497
|
for (var prop in b || (b = {}))
|
|
498
|
-
if (__hasOwnProp$
|
|
498
|
+
if (__hasOwnProp$q.call(b, prop))
|
|
499
499
|
__defNormalProp$n(a, prop, b[prop]);
|
|
500
|
-
if (__getOwnPropSymbols$
|
|
501
|
-
for (var prop of __getOwnPropSymbols$
|
|
502
|
-
if (__propIsEnum$
|
|
500
|
+
if (__getOwnPropSymbols$q)
|
|
501
|
+
for (var prop of __getOwnPropSymbols$q(b)) {
|
|
502
|
+
if (__propIsEnum$q.call(b, prop))
|
|
503
503
|
__defNormalProp$n(a, prop, b[prop]);
|
|
504
504
|
}
|
|
505
505
|
return a;
|
|
@@ -534,17 +534,17 @@ class SceneObjectUrlSyncConfig {
|
|
|
534
534
|
}
|
|
535
535
|
|
|
536
536
|
var __defProp$m = Object.defineProperty;
|
|
537
|
-
var __getOwnPropSymbols$
|
|
538
|
-
var __hasOwnProp$
|
|
539
|
-
var __propIsEnum$
|
|
537
|
+
var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
|
|
538
|
+
var __hasOwnProp$p = Object.prototype.hasOwnProperty;
|
|
539
|
+
var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
|
|
540
540
|
var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
541
541
|
var __spreadValues$m = (a, b) => {
|
|
542
542
|
for (var prop in b || (b = {}))
|
|
543
|
-
if (__hasOwnProp$
|
|
543
|
+
if (__hasOwnProp$p.call(b, prop))
|
|
544
544
|
__defNormalProp$m(a, prop, b[prop]);
|
|
545
|
-
if (__getOwnPropSymbols$
|
|
546
|
-
for (var prop of __getOwnPropSymbols$
|
|
547
|
-
if (__propIsEnum$
|
|
545
|
+
if (__getOwnPropSymbols$p)
|
|
546
|
+
for (var prop of __getOwnPropSymbols$p(b)) {
|
|
547
|
+
if (__propIsEnum$p.call(b, prop))
|
|
548
548
|
__defNormalProp$m(a, prop, b[prop]);
|
|
549
549
|
}
|
|
550
550
|
return a;
|
|
@@ -1141,17 +1141,17 @@ function collectAllVariables(sceneObject, record = {}) {
|
|
|
1141
1141
|
var __defProp$l = Object.defineProperty;
|
|
1142
1142
|
var __defProps$d = Object.defineProperties;
|
|
1143
1143
|
var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
|
|
1144
|
-
var __getOwnPropSymbols$
|
|
1145
|
-
var __hasOwnProp$
|
|
1146
|
-
var __propIsEnum$
|
|
1144
|
+
var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
|
|
1145
|
+
var __hasOwnProp$o = Object.prototype.hasOwnProperty;
|
|
1146
|
+
var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
|
|
1147
1147
|
var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1148
1148
|
var __spreadValues$l = (a, b) => {
|
|
1149
1149
|
for (var prop in b || (b = {}))
|
|
1150
|
-
if (__hasOwnProp$
|
|
1150
|
+
if (__hasOwnProp$o.call(b, prop))
|
|
1151
1151
|
__defNormalProp$l(a, prop, b[prop]);
|
|
1152
|
-
if (__getOwnPropSymbols$
|
|
1153
|
-
for (var prop of __getOwnPropSymbols$
|
|
1154
|
-
if (__propIsEnum$
|
|
1152
|
+
if (__getOwnPropSymbols$o)
|
|
1153
|
+
for (var prop of __getOwnPropSymbols$o(b)) {
|
|
1154
|
+
if (__propIsEnum$o.call(b, prop))
|
|
1155
1155
|
__defNormalProp$l(a, prop, b[prop]);
|
|
1156
1156
|
}
|
|
1157
1157
|
return a;
|
|
@@ -1646,17 +1646,17 @@ class ActWhenVariableChanged extends SceneObjectBase {
|
|
|
1646
1646
|
var __defProp$k = Object.defineProperty;
|
|
1647
1647
|
var __defProps$c = Object.defineProperties;
|
|
1648
1648
|
var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
|
|
1649
|
-
var __getOwnPropSymbols$
|
|
1650
|
-
var __hasOwnProp$
|
|
1651
|
-
var __propIsEnum$
|
|
1649
|
+
var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
|
|
1650
|
+
var __hasOwnProp$n = Object.prototype.hasOwnProperty;
|
|
1651
|
+
var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
|
|
1652
1652
|
var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1653
1653
|
var __spreadValues$k = (a, b) => {
|
|
1654
1654
|
for (var prop in b || (b = {}))
|
|
1655
|
-
if (__hasOwnProp$
|
|
1655
|
+
if (__hasOwnProp$n.call(b, prop))
|
|
1656
1656
|
__defNormalProp$k(a, prop, b[prop]);
|
|
1657
|
-
if (__getOwnPropSymbols$
|
|
1658
|
-
for (var prop of __getOwnPropSymbols$
|
|
1659
|
-
if (__propIsEnum$
|
|
1657
|
+
if (__getOwnPropSymbols$n)
|
|
1658
|
+
for (var prop of __getOwnPropSymbols$n(b)) {
|
|
1659
|
+
if (__propIsEnum$n.call(b, prop))
|
|
1660
1660
|
__defNormalProp$k(a, prop, b[prop]);
|
|
1661
1661
|
}
|
|
1662
1662
|
return a;
|
|
@@ -1721,17 +1721,17 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
1721
1721
|
var __defProp$j = Object.defineProperty;
|
|
1722
1722
|
var __defProps$b = Object.defineProperties;
|
|
1723
1723
|
var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
|
|
1724
|
-
var __getOwnPropSymbols$
|
|
1725
|
-
var __hasOwnProp$
|
|
1726
|
-
var __propIsEnum$
|
|
1724
|
+
var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
|
|
1725
|
+
var __hasOwnProp$m = Object.prototype.hasOwnProperty;
|
|
1726
|
+
var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
|
|
1727
1727
|
var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1728
1728
|
var __spreadValues$j = (a, b) => {
|
|
1729
1729
|
for (var prop in b || (b = {}))
|
|
1730
|
-
if (__hasOwnProp$
|
|
1730
|
+
if (__hasOwnProp$m.call(b, prop))
|
|
1731
1731
|
__defNormalProp$j(a, prop, b[prop]);
|
|
1732
|
-
if (__getOwnPropSymbols$
|
|
1733
|
-
for (var prop of __getOwnPropSymbols$
|
|
1734
|
-
if (__propIsEnum$
|
|
1732
|
+
if (__getOwnPropSymbols$m)
|
|
1733
|
+
for (var prop of __getOwnPropSymbols$m(b)) {
|
|
1734
|
+
if (__propIsEnum$m.call(b, prop))
|
|
1735
1735
|
__defNormalProp$j(a, prop, b[prop]);
|
|
1736
1736
|
}
|
|
1737
1737
|
return a;
|
|
@@ -1867,17 +1867,17 @@ class VariableValueRecorder {
|
|
|
1867
1867
|
var __defProp$i = Object.defineProperty;
|
|
1868
1868
|
var __defProps$a = Object.defineProperties;
|
|
1869
1869
|
var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
|
|
1870
|
-
var __getOwnPropSymbols$
|
|
1871
|
-
var __hasOwnProp$
|
|
1872
|
-
var __propIsEnum$
|
|
1870
|
+
var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
|
|
1871
|
+
var __hasOwnProp$l = Object.prototype.hasOwnProperty;
|
|
1872
|
+
var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
|
|
1873
1873
|
var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1874
1874
|
var __spreadValues$i = (a, b) => {
|
|
1875
1875
|
for (var prop in b || (b = {}))
|
|
1876
|
-
if (__hasOwnProp$
|
|
1876
|
+
if (__hasOwnProp$l.call(b, prop))
|
|
1877
1877
|
__defNormalProp$i(a, prop, b[prop]);
|
|
1878
|
-
if (__getOwnPropSymbols$
|
|
1879
|
-
for (var prop of __getOwnPropSymbols$
|
|
1880
|
-
if (__propIsEnum$
|
|
1878
|
+
if (__getOwnPropSymbols$l)
|
|
1879
|
+
for (var prop of __getOwnPropSymbols$l(b)) {
|
|
1880
|
+
if (__propIsEnum$l.call(b, prop))
|
|
1881
1881
|
__defNormalProp$i(a, prop, b[prop]);
|
|
1882
1882
|
}
|
|
1883
1883
|
return a;
|
|
@@ -1891,17 +1891,17 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
|
1891
1891
|
constructor(initialState) {
|
|
1892
1892
|
super(initialState);
|
|
1893
1893
|
this._variableValueRecorder = new VariableValueRecorder();
|
|
1894
|
-
this._hasFetchedData = false;
|
|
1895
1894
|
this._variableDependency = new VariableDependencyConfig(this, {
|
|
1896
1895
|
statePaths: ["queries", "datasource"],
|
|
1897
1896
|
onVariableUpdatesCompleted: (variables, dependencyChanged) => this.onVariableUpdatesCompleted(variables, dependencyChanged)
|
|
1898
1897
|
});
|
|
1899
1898
|
this.onDataReceived = (data$1) => {
|
|
1900
1899
|
const preProcessedData = data.preProcessPanelData(data$1, this.state.data);
|
|
1901
|
-
|
|
1902
|
-
|
|
1900
|
+
let hasFetchedData = this.state._hasFetchedData;
|
|
1901
|
+
if (!hasFetchedData && preProcessedData.state !== schema.LoadingState.Loading) {
|
|
1902
|
+
hasFetchedData = true;
|
|
1903
1903
|
}
|
|
1904
|
-
this.setState({ data: preProcessedData });
|
|
1904
|
+
this.setState({ data: preProcessedData, _hasFetchedData: hasFetchedData });
|
|
1905
1905
|
};
|
|
1906
1906
|
this.addActivationHandler(() => this._onActivate());
|
|
1907
1907
|
}
|
|
@@ -1918,7 +1918,7 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
|
1918
1918
|
return () => this._onDeactivate();
|
|
1919
1919
|
}
|
|
1920
1920
|
onVariableUpdatesCompleted(_variablesThatHaveChanged, dependencyChanged) {
|
|
1921
|
-
if (this.state.
|
|
1921
|
+
if (this.state._isWaitingForVariables && this.shouldRunQueriesOnActivate()) {
|
|
1922
1922
|
this.runQueries();
|
|
1923
1923
|
return;
|
|
1924
1924
|
}
|
|
@@ -1977,7 +1977,7 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
|
1977
1977
|
}
|
|
1978
1978
|
}
|
|
1979
1979
|
isDataReadyToDisplay() {
|
|
1980
|
-
return this._hasFetchedData;
|
|
1980
|
+
return Boolean(this.state._hasFetchedData);
|
|
1981
1981
|
}
|
|
1982
1982
|
runQueries() {
|
|
1983
1983
|
const timeRange = sceneGraph.getTimeRange(this);
|
|
@@ -2002,11 +2002,11 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
|
2002
2002
|
(_a = this._querySub) == null ? void 0 : _a.unsubscribe();
|
|
2003
2003
|
if (sceneGraph.hasVariableDependencyInLoadingState(this)) {
|
|
2004
2004
|
writeSceneLog("SceneQueryRunner", "Variable dependency is in loading state, skipping query execution");
|
|
2005
|
-
this.setState({
|
|
2005
|
+
this.setState({ _isWaitingForVariables: true });
|
|
2006
2006
|
return;
|
|
2007
2007
|
}
|
|
2008
|
-
if (this.state.
|
|
2009
|
-
this.setState({
|
|
2008
|
+
if (this.state._isWaitingForVariables) {
|
|
2009
|
+
this.setState({ _isWaitingForVariables: false });
|
|
2010
2010
|
}
|
|
2011
2011
|
const { minInterval, queries } = this.state;
|
|
2012
2012
|
const sceneObjectScopedVar = {
|
|
@@ -2072,17 +2072,17 @@ function findFirstDatasource(targets) {
|
|
|
2072
2072
|
var __defProp$h = Object.defineProperty;
|
|
2073
2073
|
var __defProps$9 = Object.defineProperties;
|
|
2074
2074
|
var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
|
|
2075
|
-
var __getOwnPropSymbols$
|
|
2076
|
-
var __hasOwnProp$
|
|
2077
|
-
var __propIsEnum$
|
|
2075
|
+
var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
|
|
2076
|
+
var __hasOwnProp$k = Object.prototype.hasOwnProperty;
|
|
2077
|
+
var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
|
|
2078
2078
|
var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2079
2079
|
var __spreadValues$h = (a, b) => {
|
|
2080
2080
|
for (var prop in b || (b = {}))
|
|
2081
|
-
if (__hasOwnProp$
|
|
2081
|
+
if (__hasOwnProp$k.call(b, prop))
|
|
2082
2082
|
__defNormalProp$h(a, prop, b[prop]);
|
|
2083
|
-
if (__getOwnPropSymbols$
|
|
2084
|
-
for (var prop of __getOwnPropSymbols$
|
|
2085
|
-
if (__propIsEnum$
|
|
2083
|
+
if (__getOwnPropSymbols$k)
|
|
2084
|
+
for (var prop of __getOwnPropSymbols$k(b)) {
|
|
2085
|
+
if (__propIsEnum$k.call(b, prop))
|
|
2086
2086
|
__defNormalProp$h(a, prop, b[prop]);
|
|
2087
2087
|
}
|
|
2088
2088
|
return a;
|
|
@@ -2364,6 +2364,13 @@ class SceneVariableSet extends SceneObjectBase {
|
|
|
2364
2364
|
writeVariableTraceLog(variable, "updateAndValidate completed");
|
|
2365
2365
|
this._updateNextBatch();
|
|
2366
2366
|
}
|
|
2367
|
+
cancel(variable) {
|
|
2368
|
+
var _a;
|
|
2369
|
+
const update = this._updating.get(variable);
|
|
2370
|
+
(_a = update == null ? void 0 : update.subscription) == null ? void 0 : _a.unsubscribe();
|
|
2371
|
+
this._updating.delete(variable);
|
|
2372
|
+
this._variablesToUpdate.delete(variable);
|
|
2373
|
+
}
|
|
2367
2374
|
_handleVariableError(variable, err) {
|
|
2368
2375
|
var _a;
|
|
2369
2376
|
const update = this._updating.get(variable);
|
|
@@ -2436,17 +2443,17 @@ function writeVariableTraceLog(variable, message, err) {
|
|
|
2436
2443
|
var __defProp$g = Object.defineProperty;
|
|
2437
2444
|
var __defProps$8 = Object.defineProperties;
|
|
2438
2445
|
var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
|
|
2439
|
-
var __getOwnPropSymbols$
|
|
2440
|
-
var __hasOwnProp$
|
|
2441
|
-
var __propIsEnum$
|
|
2446
|
+
var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
|
|
2447
|
+
var __hasOwnProp$j = Object.prototype.hasOwnProperty;
|
|
2448
|
+
var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
|
|
2442
2449
|
var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2443
2450
|
var __spreadValues$g = (a, b) => {
|
|
2444
2451
|
for (var prop in b || (b = {}))
|
|
2445
|
-
if (__hasOwnProp$
|
|
2452
|
+
if (__hasOwnProp$j.call(b, prop))
|
|
2446
2453
|
__defNormalProp$g(a, prop, b[prop]);
|
|
2447
|
-
if (__getOwnPropSymbols$
|
|
2448
|
-
for (var prop of __getOwnPropSymbols$
|
|
2449
|
-
if (__propIsEnum$
|
|
2454
|
+
if (__getOwnPropSymbols$j)
|
|
2455
|
+
for (var prop of __getOwnPropSymbols$j(b)) {
|
|
2456
|
+
if (__propIsEnum$j.call(b, prop))
|
|
2450
2457
|
__defNormalProp$g(a, prop, b[prop]);
|
|
2451
2458
|
}
|
|
2452
2459
|
return a;
|
|
@@ -2467,6 +2474,43 @@ class ConstantVariable extends SceneObjectBase {
|
|
|
2467
2474
|
}
|
|
2468
2475
|
}
|
|
2469
2476
|
|
|
2477
|
+
var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
|
|
2478
|
+
var __hasOwnProp$i = Object.prototype.hasOwnProperty;
|
|
2479
|
+
var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
|
|
2480
|
+
var __objRest$3 = (source, exclude) => {
|
|
2481
|
+
var target = {};
|
|
2482
|
+
for (var prop in source)
|
|
2483
|
+
if (__hasOwnProp$i.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2484
|
+
target[prop] = source[prop];
|
|
2485
|
+
if (source != null && __getOwnPropSymbols$i)
|
|
2486
|
+
for (var prop of __getOwnPropSymbols$i(source)) {
|
|
2487
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$i.call(source, prop))
|
|
2488
|
+
target[prop] = source[prop];
|
|
2489
|
+
}
|
|
2490
|
+
return target;
|
|
2491
|
+
};
|
|
2492
|
+
const LoadingIndicator = (_a) => {
|
|
2493
|
+
var _b = _a, props = __objRest$3(_b, ["innerProps"]);
|
|
2494
|
+
const { onCancel } = props.selectProps;
|
|
2495
|
+
const onMouseDown = React.useCallback(
|
|
2496
|
+
(event) => {
|
|
2497
|
+
event.preventDefault();
|
|
2498
|
+
event.stopPropagation();
|
|
2499
|
+
onCancel();
|
|
2500
|
+
},
|
|
2501
|
+
[onCancel]
|
|
2502
|
+
);
|
|
2503
|
+
return /* @__PURE__ */ React__default["default"].createElement(ui.Tooltip, {
|
|
2504
|
+
content: "Cancel query"
|
|
2505
|
+
}, /* @__PURE__ */ React__default["default"].createElement(ui.Icon, {
|
|
2506
|
+
className: "spin-clockwise",
|
|
2507
|
+
name: "sync",
|
|
2508
|
+
size: "xs",
|
|
2509
|
+
"aria-label": e2eSelectors.selectors.components.LoadingIndicator.icon,
|
|
2510
|
+
role: "button",
|
|
2511
|
+
onMouseDown
|
|
2512
|
+
}));
|
|
2513
|
+
};
|
|
2470
2514
|
function VariableValueSelect({ model }) {
|
|
2471
2515
|
const { value, key, loading } = model.useState();
|
|
2472
2516
|
return /* @__PURE__ */ React__default["default"].createElement(ui.Select, {
|
|
@@ -2480,7 +2524,12 @@ function VariableValueSelect({ model }) {
|
|
|
2480
2524
|
options: model.getOptionsForSelect(),
|
|
2481
2525
|
onChange: (newValue) => {
|
|
2482
2526
|
model.changeValueTo(newValue.value, newValue.label);
|
|
2483
|
-
}
|
|
2527
|
+
},
|
|
2528
|
+
onCancel: () => {
|
|
2529
|
+
var _a;
|
|
2530
|
+
(_a = model.cancel) == null ? void 0 : _a.call(model);
|
|
2531
|
+
},
|
|
2532
|
+
components: { LoadingIndicator }
|
|
2484
2533
|
});
|
|
2485
2534
|
}
|
|
2486
2535
|
function VariableValueSelectMulti({ model }) {
|
|
@@ -2499,6 +2548,11 @@ function VariableValueSelectMulti({ model }) {
|
|
|
2499
2548
|
isClearable: true,
|
|
2500
2549
|
onOpenMenu: () => {
|
|
2501
2550
|
},
|
|
2551
|
+
onCancel: () => {
|
|
2552
|
+
var _a;
|
|
2553
|
+
(_a = model.cancel) == null ? void 0 : _a.call(model);
|
|
2554
|
+
},
|
|
2555
|
+
components: { LoadingIndicator },
|
|
2502
2556
|
onChange: (newValue) => {
|
|
2503
2557
|
model.changeValueTo(
|
|
2504
2558
|
newValue.map((v) => v.value),
|
|
@@ -2532,6 +2586,11 @@ class MultiValueVariable extends SceneObjectBase {
|
|
|
2532
2586
|
})
|
|
2533
2587
|
);
|
|
2534
2588
|
}
|
|
2589
|
+
cancel() {
|
|
2590
|
+
this.setStateHelper({ loading: false });
|
|
2591
|
+
const sceneVarSet = this.parent;
|
|
2592
|
+
sceneVarSet == null ? void 0 : sceneVarSet.cancel(this);
|
|
2593
|
+
}
|
|
2535
2594
|
updateValueGivenNewOptions(options) {
|
|
2536
2595
|
const stateUpdate = {
|
|
2537
2596
|
options,
|
|
@@ -3341,16 +3400,21 @@ class TestVariable extends MultiValueVariable {
|
|
|
3341
3400
|
});
|
|
3342
3401
|
let timeout;
|
|
3343
3402
|
if (delayMs) {
|
|
3344
|
-
timeout = setTimeout(() => this.signalUpdateCompleted(), delayMs);
|
|
3403
|
+
timeout = window.setTimeout(() => this.signalUpdateCompleted(), delayMs);
|
|
3345
3404
|
}
|
|
3346
3405
|
this.isGettingValues = true;
|
|
3347
3406
|
return () => {
|
|
3348
3407
|
sub.unsubscribe();
|
|
3349
|
-
clearTimeout(timeout);
|
|
3408
|
+
window.clearTimeout(timeout);
|
|
3409
|
+
this.setState({ loading: false });
|
|
3350
3410
|
this.isGettingValues = false;
|
|
3351
3411
|
};
|
|
3352
3412
|
});
|
|
3353
3413
|
}
|
|
3414
|
+
cancel() {
|
|
3415
|
+
const sceneVarSet = getClosest(this, (s) => s instanceof SceneVariableSet ? s : void 0);
|
|
3416
|
+
sceneVarSet == null ? void 0 : sceneVarSet.cancel(this);
|
|
3417
|
+
}
|
|
3354
3418
|
issueQuery() {
|
|
3355
3419
|
const interpolatedQuery = sceneGraph.interpolate(this, this.state.query);
|
|
3356
3420
|
const options = queryMetricTree(interpolatedQuery).map((x) => ({ label: x.name, value: x.name }));
|
|
@@ -4741,7 +4805,22 @@ const GRID_CELL_HEIGHT = 30;
|
|
|
4741
4805
|
const GRID_CELL_VMARGIN = 8;
|
|
4742
4806
|
const GRID_COLUMN_COUNT = 24;
|
|
4743
4807
|
|
|
4808
|
+
function SceneDragHandle({ className, dragClass }) {
|
|
4809
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4810
|
+
className: `${className} ${dragClass}`,
|
|
4811
|
+
style: {
|
|
4812
|
+
width: "20px",
|
|
4813
|
+
height: "20px",
|
|
4814
|
+
cursor: "move"
|
|
4815
|
+
}
|
|
4816
|
+
}, /* @__PURE__ */ React__default["default"].createElement(ui.Icon, {
|
|
4817
|
+
name: "draggabledots"
|
|
4818
|
+
}));
|
|
4819
|
+
}
|
|
4820
|
+
|
|
4744
4821
|
var __defProp$5 = Object.defineProperty;
|
|
4822
|
+
var __defProps$2 = Object.defineProperties;
|
|
4823
|
+
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
|
4745
4824
|
var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
|
|
4746
4825
|
var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
|
|
4747
4826
|
var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
|
|
@@ -4757,14 +4836,153 @@ var __spreadValues$5 = (a, b) => {
|
|
|
4757
4836
|
}
|
|
4758
4837
|
return a;
|
|
4759
4838
|
};
|
|
4839
|
+
var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
4840
|
+
class SceneGridRow extends SceneObjectBase {
|
|
4841
|
+
constructor(state) {
|
|
4842
|
+
super(__spreadProps$2(__spreadValues$5({
|
|
4843
|
+
children: state.children || [],
|
|
4844
|
+
isCollapsible: state.isCollapsible || true,
|
|
4845
|
+
title: state.title || "",
|
|
4846
|
+
isDraggable: state.isDraggable || true,
|
|
4847
|
+
isResizable: state.isResizable || false
|
|
4848
|
+
}, state), {
|
|
4849
|
+
x: 0,
|
|
4850
|
+
height: 1,
|
|
4851
|
+
width: GRID_COLUMN_COUNT
|
|
4852
|
+
}));
|
|
4853
|
+
this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: ["rowc"] });
|
|
4854
|
+
this.onCollapseToggle = () => {
|
|
4855
|
+
if (!this.state.isCollapsible) {
|
|
4856
|
+
return;
|
|
4857
|
+
}
|
|
4858
|
+
this.getGridLayout().toggleRow(this);
|
|
4859
|
+
};
|
|
4860
|
+
}
|
|
4861
|
+
getGridLayout() {
|
|
4862
|
+
const layout = this.parent;
|
|
4863
|
+
if (!layout || !(layout instanceof SceneGridLayout)) {
|
|
4864
|
+
throw new Error("SceneGridRow must be a child of SceneGridLayout");
|
|
4865
|
+
}
|
|
4866
|
+
return layout;
|
|
4867
|
+
}
|
|
4868
|
+
getUrlState() {
|
|
4869
|
+
return { rowc: this.state.isCollapsed ? "1" : "0" };
|
|
4870
|
+
}
|
|
4871
|
+
updateFromUrl(values) {
|
|
4872
|
+
if (values.rowc == null) {
|
|
4873
|
+
return;
|
|
4874
|
+
}
|
|
4875
|
+
if (values.rowc !== this.getUrlState().rowc) {
|
|
4876
|
+
this.onCollapseToggle();
|
|
4877
|
+
}
|
|
4878
|
+
}
|
|
4879
|
+
}
|
|
4880
|
+
SceneGridRow.Component = SceneGridRowRenderer;
|
|
4881
|
+
function SceneGridRowRenderer({ model }) {
|
|
4882
|
+
const styles = ui.useStyles2(getSceneGridRowStyles);
|
|
4883
|
+
const { isCollapsible, isCollapsed, title, isDraggable } = model.useState();
|
|
4884
|
+
const dragHandle = /* @__PURE__ */ React__default["default"].createElement(SceneDragHandle, {
|
|
4885
|
+
dragClass: model.getGridLayout().getDragClass()
|
|
4886
|
+
});
|
|
4887
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4888
|
+
className: styles.row
|
|
4889
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4890
|
+
className: css.cx(styles.rowHeader, isCollapsed && styles.rowHeaderCollapsed)
|
|
4891
|
+
}, /* @__PURE__ */ React__default["default"].createElement("button", {
|
|
4892
|
+
onClick: model.onCollapseToggle,
|
|
4893
|
+
className: styles.rowTitleButton
|
|
4894
|
+
}, isCollapsible && /* @__PURE__ */ React__default["default"].createElement(ui.Icon, {
|
|
4895
|
+
name: isCollapsed ? "angle-right" : "angle-down"
|
|
4896
|
+
}), /* @__PURE__ */ React__default["default"].createElement("span", {
|
|
4897
|
+
className: styles.rowTitle
|
|
4898
|
+
}, title)), isDraggable && isCollapsed && /* @__PURE__ */ React__default["default"].createElement("div", null, dragHandle)));
|
|
4899
|
+
}
|
|
4900
|
+
const getSceneGridRowStyles = (theme) => {
|
|
4901
|
+
return {
|
|
4902
|
+
row: css.css({
|
|
4903
|
+
width: "100%",
|
|
4904
|
+
height: "100%",
|
|
4905
|
+
position: "relative",
|
|
4906
|
+
zIndex: 0,
|
|
4907
|
+
display: "flex",
|
|
4908
|
+
flexDirection: "column"
|
|
4909
|
+
}),
|
|
4910
|
+
rowHeader: css.css({
|
|
4911
|
+
width: "100%",
|
|
4912
|
+
height: "30px",
|
|
4913
|
+
display: "flex",
|
|
4914
|
+
justifyContent: "space-between",
|
|
4915
|
+
marginBottom: "8px",
|
|
4916
|
+
border: `1px solid transparent`
|
|
4917
|
+
}),
|
|
4918
|
+
rowTitleButton: css.css({
|
|
4919
|
+
display: "flex",
|
|
4920
|
+
alignItems: "center",
|
|
4921
|
+
cursor: "pointer",
|
|
4922
|
+
background: "transparent",
|
|
4923
|
+
border: "none",
|
|
4924
|
+
gap: theme.spacing(1)
|
|
4925
|
+
}),
|
|
4926
|
+
rowHeaderCollapsed: css.css({
|
|
4927
|
+
marginBottom: "0px",
|
|
4928
|
+
background: theme.colors.background.primary,
|
|
4929
|
+
border: `1px solid ${theme.colors.border.weak}`,
|
|
4930
|
+
borderRadius: theme.shape.borderRadius(1)
|
|
4931
|
+
}),
|
|
4932
|
+
rowTitle: css.css({
|
|
4933
|
+
fontSize: theme.typography.h5.fontSize,
|
|
4934
|
+
fontWeight: theme.typography.fontWeightMedium
|
|
4935
|
+
})
|
|
4936
|
+
};
|
|
4937
|
+
};
|
|
4938
|
+
|
|
4939
|
+
class SceneGridItem extends SceneObjectBase {
|
|
4940
|
+
}
|
|
4941
|
+
SceneGridItem.Component = SceneGridItemRenderer;
|
|
4942
|
+
function SceneGridItemRenderer({ model }) {
|
|
4943
|
+
const { body } = model.useState();
|
|
4944
|
+
const parent = model.parent;
|
|
4945
|
+
if (parent && !isSceneGridLayout(parent) && !isSceneGridRow(parent)) {
|
|
4946
|
+
throw new Error("SceneGridItem must be a child of SceneGridLayout or SceneGridRow");
|
|
4947
|
+
}
|
|
4948
|
+
if (!body) {
|
|
4949
|
+
return null;
|
|
4950
|
+
}
|
|
4951
|
+
return /* @__PURE__ */ React__default["default"].createElement(body.Component, {
|
|
4952
|
+
model: body
|
|
4953
|
+
});
|
|
4954
|
+
}
|
|
4955
|
+
function isSceneGridRow(child) {
|
|
4956
|
+
return child instanceof SceneGridRow;
|
|
4957
|
+
}
|
|
4958
|
+
function isSceneGridLayout(child) {
|
|
4959
|
+
return child instanceof SceneGridLayout;
|
|
4960
|
+
}
|
|
4961
|
+
|
|
4962
|
+
var __defProp$4 = Object.defineProperty;
|
|
4963
|
+
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
4964
|
+
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
4965
|
+
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
4966
|
+
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4967
|
+
var __spreadValues$4 = (a, b) => {
|
|
4968
|
+
for (var prop in b || (b = {}))
|
|
4969
|
+
if (__hasOwnProp$4.call(b, prop))
|
|
4970
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
4971
|
+
if (__getOwnPropSymbols$4)
|
|
4972
|
+
for (var prop of __getOwnPropSymbols$4(b)) {
|
|
4973
|
+
if (__propIsEnum$4.call(b, prop))
|
|
4974
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
4975
|
+
}
|
|
4976
|
+
return a;
|
|
4977
|
+
};
|
|
4760
4978
|
var __objRest = (source, exclude) => {
|
|
4761
4979
|
var target = {};
|
|
4762
4980
|
for (var prop in source)
|
|
4763
|
-
if (__hasOwnProp$
|
|
4981
|
+
if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
4764
4982
|
target[prop] = source[prop];
|
|
4765
|
-
if (source != null && __getOwnPropSymbols$
|
|
4766
|
-
for (var prop of __getOwnPropSymbols$
|
|
4767
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
4983
|
+
if (source != null && __getOwnPropSymbols$4)
|
|
4984
|
+
for (var prop of __getOwnPropSymbols$4(source)) {
|
|
4985
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
|
|
4768
4986
|
target[prop] = source[prop];
|
|
4769
4987
|
}
|
|
4770
4988
|
return target;
|
|
@@ -4804,7 +5022,7 @@ const LazyLoader = React__default["default"].forwardRef(
|
|
|
4804
5022
|
}
|
|
4805
5023
|
};
|
|
4806
5024
|
});
|
|
4807
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadValues$
|
|
5025
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadValues$4({
|
|
4808
5026
|
id,
|
|
4809
5027
|
ref: innerRef
|
|
4810
5028
|
}, rest), loaded && (typeof children === "function" ? children({ isInView }) : children));
|
|
@@ -4823,7 +5041,7 @@ LazyLoader.observer = new IntersectionObserver(
|
|
|
4823
5041
|
);
|
|
4824
5042
|
|
|
4825
5043
|
function SceneGridLayoutRenderer({ model }) {
|
|
4826
|
-
const { children, isLazy, isDraggable } = model.useState();
|
|
5044
|
+
const { children, isLazy, isDraggable, isResizable } = model.useState();
|
|
4827
5045
|
validateChildrenSize(children);
|
|
4828
5046
|
return /* @__PURE__ */ React__default["default"].createElement(AutoSizer__default["default"], {
|
|
4829
5047
|
disableHeight: true
|
|
@@ -4837,7 +5055,7 @@ function SceneGridLayoutRenderer({ model }) {
|
|
|
4837
5055
|
}, /* @__PURE__ */ React__default["default"].createElement(ReactGridLayout__default["default"], {
|
|
4838
5056
|
width,
|
|
4839
5057
|
isDraggable: isDraggable && width > 768,
|
|
4840
|
-
isResizable: false,
|
|
5058
|
+
isResizable: isResizable != null ? isResizable : false,
|
|
4841
5059
|
containerPadding: [0, 0],
|
|
4842
5060
|
useCSSTransforms: false,
|
|
4843
5061
|
margin: [GRID_CELL_VMARGIN, GRID_CELL_VMARGIN],
|
|
@@ -4850,15 +5068,20 @@ function SceneGridLayoutRenderer({ model }) {
|
|
|
4850
5068
|
onResizeStop: model.onResizeStop,
|
|
4851
5069
|
onLayoutChange: model.onLayoutChange,
|
|
4852
5070
|
isBounded: false
|
|
4853
|
-
}, layout.map((gridItem) => {
|
|
5071
|
+
}, layout.map((gridItem, index) => {
|
|
4854
5072
|
const sceneChild = model.getSceneLayoutChild(gridItem.i);
|
|
5073
|
+
const style = { zIndex: layout.length - index };
|
|
4855
5074
|
return isLazy ? /* @__PURE__ */ React__default["default"].createElement(LazyLoader, {
|
|
4856
|
-
key: sceneChild.state.key
|
|
5075
|
+
key: sceneChild.state.key,
|
|
5076
|
+
style,
|
|
5077
|
+
"data-panelid": sceneChild.state.key
|
|
4857
5078
|
}, /* @__PURE__ */ React__default["default"].createElement(sceneChild.Component, {
|
|
4858
5079
|
model: sceneChild,
|
|
4859
5080
|
key: sceneChild.state.key
|
|
4860
5081
|
})) : /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4861
|
-
key: sceneChild.state.key
|
|
5082
|
+
key: sceneChild.state.key,
|
|
5083
|
+
style,
|
|
5084
|
+
"data-panelid": sceneChild.state.key
|
|
4862
5085
|
}, /* @__PURE__ */ React__default["default"].createElement(sceneChild.Component, {
|
|
4863
5086
|
model: sceneChild,
|
|
4864
5087
|
key: sceneChild.state.key
|
|
@@ -4874,137 +5097,6 @@ function validateChildrenSize(children) {
|
|
|
4874
5097
|
}
|
|
4875
5098
|
}
|
|
4876
5099
|
|
|
4877
|
-
function SceneDragHandle({ className, dragClass }) {
|
|
4878
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4879
|
-
className: `${className} ${dragClass}`,
|
|
4880
|
-
style: {
|
|
4881
|
-
width: "20px",
|
|
4882
|
-
height: "20px",
|
|
4883
|
-
cursor: "move"
|
|
4884
|
-
}
|
|
4885
|
-
}, /* @__PURE__ */ React__default["default"].createElement(ui.Icon, {
|
|
4886
|
-
name: "draggabledots"
|
|
4887
|
-
}));
|
|
4888
|
-
}
|
|
4889
|
-
|
|
4890
|
-
var __defProp$4 = Object.defineProperty;
|
|
4891
|
-
var __defProps$2 = Object.defineProperties;
|
|
4892
|
-
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
|
4893
|
-
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
4894
|
-
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
4895
|
-
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
4896
|
-
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4897
|
-
var __spreadValues$4 = (a, b) => {
|
|
4898
|
-
for (var prop in b || (b = {}))
|
|
4899
|
-
if (__hasOwnProp$4.call(b, prop))
|
|
4900
|
-
__defNormalProp$4(a, prop, b[prop]);
|
|
4901
|
-
if (__getOwnPropSymbols$4)
|
|
4902
|
-
for (var prop of __getOwnPropSymbols$4(b)) {
|
|
4903
|
-
if (__propIsEnum$4.call(b, prop))
|
|
4904
|
-
__defNormalProp$4(a, prop, b[prop]);
|
|
4905
|
-
}
|
|
4906
|
-
return a;
|
|
4907
|
-
};
|
|
4908
|
-
var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
4909
|
-
class SceneGridRow extends SceneObjectBase {
|
|
4910
|
-
constructor(state) {
|
|
4911
|
-
super(__spreadProps$2(__spreadValues$4({
|
|
4912
|
-
children: state.children || [],
|
|
4913
|
-
isCollapsible: state.isCollapsible || true,
|
|
4914
|
-
title: state.title || "",
|
|
4915
|
-
isDraggable: state.isDraggable || true,
|
|
4916
|
-
isResizable: state.isResizable || false
|
|
4917
|
-
}, state), {
|
|
4918
|
-
x: 0,
|
|
4919
|
-
height: 1,
|
|
4920
|
-
width: GRID_COLUMN_COUNT
|
|
4921
|
-
}));
|
|
4922
|
-
this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: ["rowc"] });
|
|
4923
|
-
this.onCollapseToggle = () => {
|
|
4924
|
-
if (!this.state.isCollapsible) {
|
|
4925
|
-
return;
|
|
4926
|
-
}
|
|
4927
|
-
this.getGridLayout().toggleRow(this);
|
|
4928
|
-
};
|
|
4929
|
-
}
|
|
4930
|
-
getGridLayout() {
|
|
4931
|
-
const layout = this.parent;
|
|
4932
|
-
if (!layout || !(layout instanceof SceneGridLayout)) {
|
|
4933
|
-
throw new Error("SceneGridRow must be a child of SceneGridLayout");
|
|
4934
|
-
}
|
|
4935
|
-
return layout;
|
|
4936
|
-
}
|
|
4937
|
-
getUrlState() {
|
|
4938
|
-
return { rowc: this.state.isCollapsed ? "1" : "0" };
|
|
4939
|
-
}
|
|
4940
|
-
updateFromUrl(values) {
|
|
4941
|
-
if (values.rowc == null) {
|
|
4942
|
-
return;
|
|
4943
|
-
}
|
|
4944
|
-
if (values.rowc !== this.getUrlState().rowc) {
|
|
4945
|
-
this.onCollapseToggle();
|
|
4946
|
-
}
|
|
4947
|
-
}
|
|
4948
|
-
}
|
|
4949
|
-
SceneGridRow.Component = SceneGridRowRenderer;
|
|
4950
|
-
function SceneGridRowRenderer({ model }) {
|
|
4951
|
-
const styles = ui.useStyles2(getSceneGridRowStyles);
|
|
4952
|
-
const { isCollapsible, isCollapsed, title, isDraggable } = model.useState();
|
|
4953
|
-
const dragHandle = /* @__PURE__ */ React__default["default"].createElement(SceneDragHandle, {
|
|
4954
|
-
dragClass: model.getGridLayout().getDragClass()
|
|
4955
|
-
});
|
|
4956
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4957
|
-
className: styles.row
|
|
4958
|
-
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4959
|
-
className: css.cx(styles.rowHeader, isCollapsed && styles.rowHeaderCollapsed)
|
|
4960
|
-
}, /* @__PURE__ */ React__default["default"].createElement("button", {
|
|
4961
|
-
onClick: model.onCollapseToggle,
|
|
4962
|
-
className: styles.rowTitleButton
|
|
4963
|
-
}, isCollapsible && /* @__PURE__ */ React__default["default"].createElement(ui.Icon, {
|
|
4964
|
-
name: isCollapsed ? "angle-right" : "angle-down"
|
|
4965
|
-
}), /* @__PURE__ */ React__default["default"].createElement("span", {
|
|
4966
|
-
className: styles.rowTitle
|
|
4967
|
-
}, title)), isDraggable && isCollapsed && /* @__PURE__ */ React__default["default"].createElement("div", null, dragHandle)));
|
|
4968
|
-
}
|
|
4969
|
-
const getSceneGridRowStyles = (theme) => {
|
|
4970
|
-
return {
|
|
4971
|
-
row: css.css({
|
|
4972
|
-
width: "100%",
|
|
4973
|
-
height: "100%",
|
|
4974
|
-
position: "relative",
|
|
4975
|
-
zIndex: 0,
|
|
4976
|
-
display: "flex",
|
|
4977
|
-
flexDirection: "column"
|
|
4978
|
-
}),
|
|
4979
|
-
rowHeader: css.css({
|
|
4980
|
-
width: "100%",
|
|
4981
|
-
height: "30px",
|
|
4982
|
-
display: "flex",
|
|
4983
|
-
justifyContent: "space-between",
|
|
4984
|
-
marginBottom: "8px",
|
|
4985
|
-
border: `1px solid transparent`
|
|
4986
|
-
}),
|
|
4987
|
-
rowTitleButton: css.css({
|
|
4988
|
-
display: "flex",
|
|
4989
|
-
alignItems: "center",
|
|
4990
|
-
cursor: "pointer",
|
|
4991
|
-
background: "transparent",
|
|
4992
|
-
border: "none",
|
|
4993
|
-
gap: theme.spacing(1)
|
|
4994
|
-
}),
|
|
4995
|
-
rowHeaderCollapsed: css.css({
|
|
4996
|
-
marginBottom: "0px",
|
|
4997
|
-
background: theme.colors.background.primary,
|
|
4998
|
-
border: `1px solid ${theme.colors.border.weak}`,
|
|
4999
|
-
borderRadius: theme.shape.borderRadius(1)
|
|
5000
|
-
}),
|
|
5001
|
-
rowTitle: css.css({
|
|
5002
|
-
fontSize: theme.typography.h5.fontSize,
|
|
5003
|
-
fontWeight: theme.typography.fontWeightMedium
|
|
5004
|
-
})
|
|
5005
|
-
};
|
|
5006
|
-
};
|
|
5007
|
-
|
|
5008
5100
|
var __defProp$3 = Object.defineProperty;
|
|
5009
5101
|
var __defProps$1 = Object.defineProperties;
|
|
5010
5102
|
var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
|
|
@@ -5197,8 +5289,8 @@ const _SceneGridLayout = class extends SceneObjectBase {
|
|
|
5197
5289
|
let y = (_b = size.y) != null ? _b : 0;
|
|
5198
5290
|
const w = Number.isInteger(Number(size.width)) ? Number(size.width) : DEFAULT_PANEL_SPAN;
|
|
5199
5291
|
const h = Number.isInteger(Number(size.height)) ? Number(size.height) : DEFAULT_PANEL_SPAN;
|
|
5200
|
-
let isDraggable =
|
|
5201
|
-
let isResizable =
|
|
5292
|
+
let isDraggable = child.state.isDraggable;
|
|
5293
|
+
let isResizable = child.state.isResizable;
|
|
5202
5294
|
if (child instanceof SceneGridRow) {
|
|
5203
5295
|
isDraggable = child.state.isCollapsed ? true : false;
|
|
5204
5296
|
isResizable = false;
|
|
@@ -5226,22 +5318,6 @@ const _SceneGridLayout = class extends SceneObjectBase {
|
|
|
5226
5318
|
};
|
|
5227
5319
|
let SceneGridLayout = _SceneGridLayout;
|
|
5228
5320
|
SceneGridLayout.Component = SceneGridLayoutRenderer;
|
|
5229
|
-
class SceneGridItem extends SceneObjectBase {
|
|
5230
|
-
}
|
|
5231
|
-
SceneGridItem.Component = SceneGridItemRenderer;
|
|
5232
|
-
function SceneGridItemRenderer({ model }) {
|
|
5233
|
-
const { body } = model.useState();
|
|
5234
|
-
const parent = model.parent;
|
|
5235
|
-
if (parent && !isSceneGridLayout(parent) && !isSceneGridRow(parent)) {
|
|
5236
|
-
throw new Error("SceneGridItem must be a child of SceneGridLayout or SceneGridRow");
|
|
5237
|
-
}
|
|
5238
|
-
if (!body) {
|
|
5239
|
-
return null;
|
|
5240
|
-
}
|
|
5241
|
-
return /* @__PURE__ */ React__default["default"].createElement(body.Component, {
|
|
5242
|
-
model: body
|
|
5243
|
-
});
|
|
5244
|
-
}
|
|
5245
5321
|
function isItemSizeEqual(a, b) {
|
|
5246
5322
|
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
5247
5323
|
}
|
|
@@ -5253,12 +5329,6 @@ function sortChildrenByPosition(children) {
|
|
|
5253
5329
|
function sortGridLayout(layout) {
|
|
5254
5330
|
return [...layout].sort((a, b) => a.y - b.y || a.x - b.x);
|
|
5255
5331
|
}
|
|
5256
|
-
function isSceneGridRow(child) {
|
|
5257
|
-
return child instanceof SceneGridRow;
|
|
5258
|
-
}
|
|
5259
|
-
function isSceneGridLayout(child) {
|
|
5260
|
-
return child instanceof SceneGridLayout;
|
|
5261
|
-
}
|
|
5262
5332
|
|
|
5263
5333
|
var __defProp$2 = Object.defineProperty;
|
|
5264
5334
|
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|