@grafana/scenes 6.10.0--canary.1095.14616202286.0 → 6.10.0--canary.1095.14619965070.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/core/SceneObjectBase.js +4 -15
- package/dist/esm/core/SceneObjectBase.js.map +1 -1
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.js +3 -0
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.js.map +1 -1
- package/dist/esm/variables/sets/SceneVariableSet.js +23 -23
- package/dist/esm/variables/sets/SceneVariableSet.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +30 -38
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -461,29 +461,18 @@ function useSceneObjectState(model, options) {
|
|
|
461
461
|
return model.state;
|
|
462
462
|
}
|
|
463
463
|
function forEachChild(state, callback) {
|
|
464
|
-
|
|
465
|
-
state.$behaviors.forEach((behavior) => {
|
|
466
|
-
if (behavior instanceof SceneObjectBase) {
|
|
467
|
-
callback(behavior);
|
|
468
|
-
}
|
|
469
|
-
});
|
|
470
|
-
}
|
|
471
|
-
Object.keys(state).forEach((key) => {
|
|
472
|
-
if (key === "$behaviors") {
|
|
473
|
-
return;
|
|
474
|
-
}
|
|
475
|
-
const propValue = state[key];
|
|
464
|
+
for (const propValue of Object.values(state)) {
|
|
476
465
|
if (propValue instanceof SceneObjectBase) {
|
|
477
466
|
callback(propValue);
|
|
478
467
|
}
|
|
479
468
|
if (Array.isArray(propValue)) {
|
|
480
|
-
|
|
469
|
+
for (const child of propValue) {
|
|
481
470
|
if (child instanceof SceneObjectBase) {
|
|
482
471
|
callback(child);
|
|
483
472
|
}
|
|
484
|
-
}
|
|
473
|
+
}
|
|
485
474
|
}
|
|
486
|
-
}
|
|
475
|
+
}
|
|
487
476
|
}
|
|
488
477
|
|
|
489
478
|
function cloneSceneObject(sceneObject, withState) {
|
|
@@ -4309,6 +4298,9 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
|
|
|
4309
4298
|
}, [model, isAlwaysWip]);
|
|
4310
4299
|
const handleMultiValueFilterCommit = React.useCallback(
|
|
4311
4300
|
(model2, filter2, filterMultiValues2, preventFocus) => {
|
|
4301
|
+
if (!filterMultiValues2.length && filter2.origin) {
|
|
4302
|
+
model2.updateToMatchAll(filter2);
|
|
4303
|
+
}
|
|
4312
4304
|
if (filterMultiValues2.length) {
|
|
4313
4305
|
const valueLabels = [];
|
|
4314
4306
|
const values = [];
|
|
@@ -9682,31 +9674,31 @@ class SceneVariableSet extends SceneObjectBase {
|
|
|
9682
9674
|
if (!this.parent) {
|
|
9683
9675
|
return;
|
|
9684
9676
|
}
|
|
9685
|
-
|
|
9686
|
-
|
|
9687
|
-
|
|
9688
|
-
|
|
9689
|
-
|
|
9690
|
-
|
|
9691
|
-
|
|
9692
|
-
|
|
9693
|
-
|
|
9694
|
-
|
|
9695
|
-
|
|
9696
|
-
|
|
9697
|
-
|
|
9698
|
-
|
|
9699
|
-
|
|
9700
|
-
|
|
9701
|
-
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
if (node.variableDependency) {
|
|
9705
|
-
node.variableDependency.variableUpdateCompleted(variableThatChanged, hasChanged);
|
|
9677
|
+
this._traverseSceneAndNotify(this.parent, variable, this._variablesThatHaveChanged.has(variable));
|
|
9678
|
+
this._variablesThatHaveChanged.delete(variable);
|
|
9679
|
+
}
|
|
9680
|
+
/**
|
|
9681
|
+
* Recursivly walk the full scene object graph and notify all objects with dependencies that include any of changed variables
|
|
9682
|
+
*/
|
|
9683
|
+
_traverseSceneAndNotify(sceneObject, variable, hasChanged) {
|
|
9684
|
+
if (this === sceneObject) {
|
|
9685
|
+
return;
|
|
9686
|
+
}
|
|
9687
|
+
if (!sceneObject.isActive) {
|
|
9688
|
+
return;
|
|
9689
|
+
}
|
|
9690
|
+
if (sceneObject.state.$variables && sceneObject.state.$variables !== this) {
|
|
9691
|
+
const localVar = sceneObject.state.$variables.getByName(variable.state.name);
|
|
9692
|
+
if (localVar == null ? void 0 : localVar.isAncestorLoading) {
|
|
9693
|
+
variable = localVar;
|
|
9694
|
+
} else if (localVar) {
|
|
9695
|
+
return;
|
|
9706
9696
|
}
|
|
9707
|
-
node.forEachChild((child) => nodeQueue.push(child));
|
|
9708
9697
|
}
|
|
9709
|
-
|
|
9698
|
+
if (sceneObject.variableDependency) {
|
|
9699
|
+
sceneObject.variableDependency.variableUpdateCompleted(variable, hasChanged);
|
|
9700
|
+
}
|
|
9701
|
+
sceneObject.forEachChild((child) => this._traverseSceneAndNotify(child, variable, hasChanged));
|
|
9710
9702
|
}
|
|
9711
9703
|
/**
|
|
9712
9704
|
* Return true if variable is waiting to update or currently updating.
|