@grafana/scenes 5.14.4--canary.900.10848367235.0 → 5.14.4
Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
# v5.14.4 (Fri Sep 13 2024)
|
2
|
+
|
3
|
+
#### 🐛 Bug Fix
|
4
|
+
|
5
|
+
- MultiValueVariabe: Change when value changed event is published [#896](https://github.com/grafana/scenes/pull/896) ([@mdvictor](https://github.com/mdvictor))
|
6
|
+
- Demo: Demonstrate event traversal through scene graph [#848](https://github.com/grafana/scenes/pull/848) ([@darrenjaneczek](https://github.com/darrenjaneczek))
|
7
|
+
|
8
|
+
#### Authors: 2
|
9
|
+
|
10
|
+
- Darren Janeczek ([@darrenjaneczek](https://github.com/darrenjaneczek))
|
11
|
+
- Victor Marin ([@mdvictor](https://github.com/mdvictor))
|
12
|
+
|
13
|
+
---
|
14
|
+
|
1
15
|
# v5.14.3 (Wed Sep 11 2024)
|
2
16
|
|
3
17
|
#### 🐛 Bug Fix
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LocalValueVariable.js","sources":["../../../../src/variables/variants/LocalValueVariable.ts"],"sourcesContent":["import { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { SceneVariable, SceneVariableState, VariableValue } from '../types';\n\nexport interface LocalValueVariableState extends SceneVariableState {\n value: VariableValue;\n text: VariableValue;\n\n // Indicate whether or not this variable is sourced from a multi-value variable.\n // Introduces for a backwards compatibility with the old variable system, to properly support interpolation in SQL data sources.\n isMulti?: boolean;\n includeAll?: boolean;\n}\n\n/**\n * This is a special type of variable that is used for repeating panels and layouts to create a local scoped value for a variable\n * that exists in a ancestor SceneVariableSet.\n */\nexport class LocalValueVariable\n extends SceneObjectBase<LocalValueVariableState>\n implements SceneVariable<LocalValueVariableState>\n{\n public constructor(initialState: Partial<LocalValueVariableState>) {\n super({\n type: 'system',\n value: '',\n text: '',\n name: '',\n ...initialState,\n skipUrlSync: true,\n });\n }\n\n public getValue(): VariableValue {\n return this.state.value;\n }\n\n public getValueText(): string {\n return this.state.text.toString();\n }\n\n /**\n * Checks the ancestor of our parent SceneVariableSet for loading state of a variable with the same name\n * This function is unit tested from SceneVariableSet tests.\n */\n public isAncestorLoading(): boolean {\n // Parent (SceneVariableSet) -> Parent (The object that has our parent set) -> Parent (scope we need to access our sets ancestor)\n const ancestorScope = this.parent?.parent?.parent;\n if (!ancestorScope) {\n throw new Error('LocalValueVariable requires a parent SceneVariableSet that has an ancestor SceneVariableSet');\n }\n\n const set = sceneGraph.getVariables(ancestorScope);\n const parentVar = sceneGraph.lookupVariable(this.state.name, ancestorScope);\n if (set && parentVar) {\n return set.isVariableLoadingOrWaitingToUpdate(parentVar);\n }\n\n return false;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAkBO,MAAM,2BACH,eAEV,CAAA;AAAA,EACS,YAAY,
|
1
|
+
{"version":3,"file":"LocalValueVariable.js","sources":["../../../../src/variables/variants/LocalValueVariable.ts"],"sourcesContent":["import { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { SceneVariable, SceneVariableState, VariableValue } from '../types';\n\nexport interface LocalValueVariableState extends SceneVariableState {\n value: VariableValue;\n text: VariableValue;\n\n // Indicate whether or not this variable is sourced from a multi-value variable.\n // Introduces for a backwards compatibility with the old variable system, to properly support interpolation in SQL data sources.\n isMulti?: boolean;\n includeAll?: boolean;\n}\n\n/**\n * This is a special type of variable that is used for repeating panels and layouts to create a local scoped value for a variable\n * that exists in a ancestor SceneVariableSet.\n */\nexport class LocalValueVariable\n extends SceneObjectBase<LocalValueVariableState>\n implements SceneVariable<LocalValueVariableState>\n{\n public constructor(initialState: Omit<Partial<LocalValueVariableState>, 'isMulti' | 'includeAll'>) {\n super({\n type: 'system',\n value: '',\n text: '',\n name: '',\n isMulti: true,\n includeAll: true,\n ...initialState,\n skipUrlSync: true,\n });\n }\n\n public getValue(): VariableValue {\n return this.state.value;\n }\n\n public getValueText(): string {\n return this.state.text.toString();\n }\n\n /**\n * Checks the ancestor of our parent SceneVariableSet for loading state of a variable with the same name\n * This function is unit tested from SceneVariableSet tests.\n */\n public isAncestorLoading(): boolean {\n // Parent (SceneVariableSet) -> Parent (The object that has our parent set) -> Parent (scope we need to access our sets ancestor)\n const ancestorScope = this.parent?.parent?.parent;\n if (!ancestorScope) {\n throw new Error('LocalValueVariable requires a parent SceneVariableSet that has an ancestor SceneVariableSet');\n }\n\n const set = sceneGraph.getVariables(ancestorScope);\n const parentVar = sceneGraph.lookupVariable(this.state.name, ancestorScope);\n if (set && parentVar) {\n return set.isVariableLoadingOrWaitingToUpdate(parentVar);\n }\n\n return false;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAkBO,MAAM,2BACH,eAEV,CAAA;AAAA,EACS,YAAY,YAAgF,EAAA;AACjG,IAAM,KAAA,CAAA,aAAA,CAAA,cAAA,CAAA;AAAA,MACJ,IAAM,EAAA,QAAA;AAAA,MACN,KAAO,EAAA,EAAA;AAAA,MACP,IAAM,EAAA,EAAA;AAAA,MACN,IAAM,EAAA,EAAA;AAAA,MACN,OAAS,EAAA,IAAA;AAAA,MACT,UAAY,EAAA,IAAA;AAAA,KAAA,EACT,YAPC,CAAA,EAAA;AAAA,MAQJ,WAAa,EAAA,IAAA;AAAA,KACd,CAAA,CAAA,CAAA;AAAA,GACH;AAAA,EAEO,QAA0B,GAAA;AAC/B,IAAA,OAAO,KAAK,KAAM,CAAA,KAAA,CAAA;AAAA,GACpB;AAAA,EAEO,YAAuB,GAAA;AAC5B,IAAO,OAAA,IAAA,CAAK,KAAM,CAAA,IAAA,CAAK,QAAS,EAAA,CAAA;AAAA,GAClC;AAAA,EAMO,iBAA6B,GAAA;AA/CtC,IAAA,IAAA,EAAA,EAAA,EAAA,CAAA;AAiDI,IAAA,MAAM,aAAgB,GAAA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,IAAA,CAAK,MAAL,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAa,WAAb,IAAqB,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,MAAA,CAAA;AAC3C,IAAA,IAAI,CAAC,aAAe,EAAA;AAClB,MAAM,MAAA,IAAI,MAAM,6FAA6F,CAAA,CAAA;AAAA,KAC/G;AAEA,IAAM,MAAA,GAAA,GAAM,UAAW,CAAA,YAAA,CAAa,aAAa,CAAA,CAAA;AACjD,IAAA,MAAM,YAAY,UAAW,CAAA,cAAA,CAAe,IAAK,CAAA,KAAA,CAAM,MAAM,aAAa,CAAA,CAAA;AAC1E,IAAA,IAAI,OAAO,SAAW,EAAA;AACpB,MAAO,OAAA,GAAA,CAAI,mCAAmC,SAAS,CAAA,CAAA;AAAA,KACzD;AAEA,IAAO,OAAA,KAAA,CAAA;AAAA,GACT;AACF;;;;"}
|
package/dist/index.d.ts
CHANGED
@@ -1655,7 +1655,7 @@ interface LocalValueVariableState extends SceneVariableState {
|
|
1655
1655
|
* that exists in a ancestor SceneVariableSet.
|
1656
1656
|
*/
|
1657
1657
|
declare class LocalValueVariable extends SceneObjectBase<LocalValueVariableState> implements SceneVariable<LocalValueVariableState> {
|
1658
|
-
constructor(initialState: Partial<LocalValueVariableState>);
|
1658
|
+
constructor(initialState: Omit<Partial<LocalValueVariableState>, 'isMulti' | 'includeAll'>);
|
1659
1659
|
getValue(): VariableValue;
|
1660
1660
|
getValueText(): string;
|
1661
1661
|
/**
|
package/dist/index.js
CHANGED