@grafana/scenes 6.23.0 → 6.24.1--canary.1166.15878540264.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 +12 -0
- package/dist/esm/core/SceneObjectBase.js +14 -2
- package/dist/esm/core/SceneObjectBase.js.map +1 -1
- package/dist/esm/core/sceneGraph/sceneGraph.js +2 -0
- package/dist/esm/core/sceneGraph/sceneGraph.js.map +1 -1
- package/dist/esm/core/types.js.map +1 -1
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.js +1 -1
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
@@ -417,6 +417,7 @@ class SceneObjectBase {
|
|
417
417
|
/**
|
418
418
|
* Loop through state and call callback for each direct child scene object.
|
419
419
|
* Checks 1 level deep properties and arrays. So a scene object hidden in a nested plain object will not be detected.
|
420
|
+
* Return false to exit loop early.
|
420
421
|
*/
|
421
422
|
forEachChild(callback) {
|
422
423
|
forEachChild(this.state, callback);
|
@@ -464,14 +465,25 @@ function useSceneObjectState(model, options) {
|
|
464
465
|
function forEachChild(state, callback) {
|
465
466
|
for (const propValue of Object.values(state)) {
|
466
467
|
if (propValue instanceof SceneObjectBase) {
|
467
|
-
callback(propValue);
|
468
|
+
const result = callback(propValue);
|
469
|
+
if (result === false) {
|
470
|
+
break;
|
471
|
+
}
|
468
472
|
}
|
469
473
|
if (Array.isArray(propValue)) {
|
474
|
+
let exitEarly = false;
|
470
475
|
for (const child of propValue) {
|
471
476
|
if (child instanceof SceneObjectBase) {
|
472
|
-
callback(child);
|
477
|
+
const result = callback(child);
|
478
|
+
if (result === false) {
|
479
|
+
exitEarly = true;
|
480
|
+
break;
|
481
|
+
}
|
473
482
|
}
|
474
483
|
}
|
484
|
+
if (exitEarly) {
|
485
|
+
break;
|
486
|
+
}
|
475
487
|
}
|
476
488
|
}
|
477
489
|
}
|
@@ -5145,7 +5157,7 @@ const getStyles$c = (theme) => ({
|
|
5145
5157
|
color: theme.colors.text.primary,
|
5146
5158
|
boxShadow: theme.shadows.z2,
|
5147
5159
|
overflowY: "auto",
|
5148
|
-
zIndex: theme.zIndex.
|
5160
|
+
zIndex: theme.zIndex.portal
|
5149
5161
|
}),
|
5150
5162
|
inputStyle: css.css({
|
5151
5163
|
paddingBlock: 0,
|
@@ -7464,7 +7476,9 @@ function findObjectInternal(scene, check, alreadySearchedChild, shouldSearchUp)
|
|
7464
7476
|
let maybe = findObjectInternal(child, check);
|
7465
7477
|
if (maybe) {
|
7466
7478
|
found = maybe;
|
7479
|
+
return false;
|
7467
7480
|
}
|
7481
|
+
return;
|
7468
7482
|
});
|
7469
7483
|
if (found) {
|
7470
7484
|
return found;
|