@grafana/scenes 5.14.4--canary.896.10848324548.0 → 5.14.4--canary.900.10848367235.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,9 +26,7 @@ class LocalValueVariable extends SceneObjectBase {
26
26
  type: "system",
27
27
  value: "",
28
28
  text: "",
29
- name: "",
30
- isMulti: true,
31
- includeAll: true
29
+ name: ""
32
30
  }, initialState), {
33
31
  skipUrlSync: true
34
32
  }));
@@ -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: 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;;;;"}
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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pB,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: Omit<Partial<LocalValueVariableState>, 'isMulti' | 'includeAll'>);
1658
+ constructor(initialState: Partial<LocalValueVariableState>);
1659
1659
  getValue(): VariableValue;
1660
1660
  getValueText(): string;
1661
1661
  /**
package/dist/index.js CHANGED
@@ -9192,9 +9192,7 @@ class LocalValueVariable extends SceneObjectBase {
9192
9192
  type: "system",
9193
9193
  value: "",
9194
9194
  text: "",
9195
- name: "",
9196
- isMulti: true,
9197
- includeAll: true
9195
+ name: ""
9198
9196
  }, initialState), {
9199
9197
  skipUrlSync: true
9200
9198
  }));