@perses-dev/plugin-system 0.39.0 → 0.40.1

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.
Files changed (253) hide show
  1. package/dist/cjs/components/CalculationSelector/CalculationSelector.js +6 -4
  2. package/dist/cjs/components/CalculationSelector/index.js +10 -8
  3. package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +381 -0
  4. package/dist/cjs/components/DatasourceEditorForm/index.js +30 -0
  5. package/dist/cjs/components/DatasourceSelect.js +119 -21
  6. package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +18 -16
  7. package/dist/cjs/components/LegendOptionsEditor/index.js +10 -8
  8. package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +23 -28
  9. package/dist/cjs/components/OptionsEditorRadios/index.js +10 -8
  10. package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +6 -4
  11. package/dist/cjs/components/OptionsEditorTabPanel/index.js +10 -8
  12. package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +10 -8
  13. package/dist/cjs/components/OptionsEditorTabs/index.js +10 -8
  14. package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +13 -11
  15. package/dist/cjs/components/PanelSpecEditor/index.js +10 -8
  16. package/dist/cjs/components/PluginEditor/PluginEditor.js +24 -31
  17. package/dist/cjs/components/PluginEditor/index.js +11 -9
  18. package/dist/cjs/components/PluginEditor/plugin-editor-api.js +5 -3
  19. package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +23 -12
  20. package/dist/cjs/components/PluginKindSelect/index.js +10 -8
  21. package/dist/cjs/components/PluginRegistry/PluginRegistry.js +11 -9
  22. package/dist/cjs/components/PluginRegistry/index.js +10 -8
  23. package/dist/cjs/components/PluginRegistry/plugin-indexes.js +6 -2
  24. package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +6 -4
  25. package/dist/cjs/components/PluginSpecEditor/index.js +10 -8
  26. package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +15 -13
  27. package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +21 -19
  28. package/dist/cjs/components/TimeSeriesQueryEditor/index.js +10 -8
  29. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +257 -166
  30. package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +32 -28
  31. package/dist/cjs/components/Variables/VariableEditorForm/index.js +11 -9
  32. package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +28 -32
  33. package/dist/cjs/components/Variables/index.js +11 -9
  34. package/dist/cjs/components/Variables/variable-model.js +17 -9
  35. package/dist/cjs/components/index.js +22 -19
  36. package/dist/cjs/constants/index.js +10 -8
  37. package/dist/cjs/constants/user-interface-text.js +3 -1
  38. package/dist/cjs/index.js +16 -13
  39. package/dist/cjs/model/index.js +17 -15
  40. package/dist/cjs/model/legend.js +32 -20
  41. package/dist/cjs/model/panels.js +2 -2
  42. package/dist/cjs/model/plugin-base.js +2 -2
  43. package/dist/cjs/model/plugin-loading.js +3 -1
  44. package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +19 -11
  45. package/dist/cjs/runtime/DataQueriesProvider/index.js +11 -9
  46. package/dist/cjs/runtime/DataQueriesProvider/model.js +12 -8
  47. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +19 -11
  48. package/dist/cjs/runtime/TimeRangeProvider/index.js +11 -9
  49. package/dist/cjs/runtime/TimeRangeProvider/query-params.js +36 -18
  50. package/dist/cjs/runtime/builtin-variables.js +81 -0
  51. package/dist/cjs/runtime/datasources.js +29 -11
  52. package/dist/cjs/runtime/index.js +16 -13
  53. package/dist/cjs/runtime/plugin-registry.js +41 -11
  54. package/dist/cjs/runtime/template-variables.js +42 -12
  55. package/dist/cjs/runtime/time-series-queries.js +39 -27
  56. package/dist/cjs/stories/shared-utils/decorators/WithDataQueries.js +7 -5
  57. package/dist/cjs/stories/shared-utils/decorators/WithPluginRegistry.js +16 -14
  58. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +42 -0
  59. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +19 -13
  60. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js +6 -4
  61. package/dist/cjs/stories/shared-utils/decorators/WithTimeRange.js +7 -5
  62. package/dist/cjs/stories/shared-utils/decorators/index.js +15 -12
  63. package/dist/cjs/stories/shared-utils/index.js +10 -8
  64. package/dist/cjs/test/index.js +11 -9
  65. package/dist/cjs/test/mock-data.js +3 -1
  66. package/dist/cjs/test/render.js +13 -11
  67. package/dist/cjs/test/test-plugins/bert/index.js +14 -10
  68. package/dist/cjs/test/test-plugins/ernie/index.js +13 -9
  69. package/dist/cjs/test/test-plugins/index.js +11 -9
  70. package/dist/cjs/test-utils/index.js +10 -8
  71. package/dist/cjs/test-utils/mock-plugin-registry.js +8 -4
  72. package/dist/cjs/utils/action.js +43 -0
  73. package/dist/cjs/utils/index.js +11 -8
  74. package/dist/cjs/utils/variables.js +26 -8
  75. package/dist/cjs/validation/datasource.js +30 -0
  76. package/dist/cjs/validation/index.js +32 -0
  77. package/dist/cjs/validation/resource.js +24 -0
  78. package/dist/cjs/validation/variable.js +29 -0
  79. package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
  80. package/dist/components/CalculationSelector/index.js.map +1 -1
  81. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +15 -0
  82. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -0
  83. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +334 -0
  84. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -0
  85. package/dist/components/DatasourceEditorForm/index.d.ts +2 -0
  86. package/dist/components/DatasourceEditorForm/index.d.ts.map +1 -0
  87. package/dist/components/DatasourceEditorForm/index.js +15 -0
  88. package/dist/components/DatasourceEditorForm/index.js.map +1 -0
  89. package/dist/components/DatasourceSelect.d.ts +5 -0
  90. package/dist/components/DatasourceSelect.d.ts.map +1 -1
  91. package/dist/components/DatasourceSelect.js +102 -19
  92. package/dist/components/DatasourceSelect.js.map +1 -1
  93. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +2 -2
  94. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
  95. package/dist/components/LegendOptionsEditor/index.js.map +1 -1
  96. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +2 -2
  97. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
  98. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +16 -23
  99. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
  100. package/dist/components/OptionsEditorRadios/index.js.map +1 -1
  101. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
  102. package/dist/components/OptionsEditorTabPanel/index.js.map +1 -1
  103. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
  104. package/dist/components/OptionsEditorTabs/index.js.map +1 -1
  105. package/dist/components/PanelSpecEditor/PanelSpecEditor.js +2 -2
  106. package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
  107. package/dist/components/PanelSpecEditor/index.js.map +1 -1
  108. package/dist/components/PluginEditor/PluginEditor.js +15 -24
  109. package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
  110. package/dist/components/PluginEditor/index.js.map +1 -1
  111. package/dist/components/PluginEditor/plugin-editor-api.d.ts +1 -1
  112. package/dist/components/PluginEditor/plugin-editor-api.js +2 -2
  113. package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
  114. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +3 -3
  115. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
  116. package/dist/components/PluginKindSelect/PluginKindSelect.js +21 -12
  117. package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
  118. package/dist/components/PluginKindSelect/index.js.map +1 -1
  119. package/dist/components/PluginRegistry/PluginRegistry.js +3 -3
  120. package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
  121. package/dist/components/PluginRegistry/index.js.map +1 -1
  122. package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
  123. package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
  124. package/dist/components/PluginSpecEditor/index.js.map +1 -1
  125. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +4 -4
  126. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +1 -1
  127. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +1 -1
  128. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +1 -1
  129. package/dist/components/TimeSeriesQueryEditor/index.js.map +1 -1
  130. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +10 -7
  131. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  132. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +201 -112
  133. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  134. package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
  135. package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
  136. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +5 -4
  137. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
  138. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +22 -30
  139. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
  140. package/dist/components/Variables/index.js.map +1 -1
  141. package/dist/components/Variables/variable-model.js +3 -3
  142. package/dist/components/Variables/variable-model.js.map +1 -1
  143. package/dist/components/index.d.ts +1 -0
  144. package/dist/components/index.d.ts.map +1 -1
  145. package/dist/components/index.js +1 -0
  146. package/dist/components/index.js.map +1 -1
  147. package/dist/constants/index.js.map +1 -1
  148. package/dist/constants/user-interface-text.js.map +1 -1
  149. package/dist/index.d.ts +1 -0
  150. package/dist/index.d.ts.map +1 -1
  151. package/dist/index.js +1 -0
  152. package/dist/index.js.map +1 -1
  153. package/dist/model/datasource.d.ts +2 -1
  154. package/dist/model/datasource.d.ts.map +1 -1
  155. package/dist/model/datasource.js.map +1 -1
  156. package/dist/model/index.js.map +1 -1
  157. package/dist/model/legend.d.ts +1 -1
  158. package/dist/model/legend.d.ts.map +1 -1
  159. package/dist/model/legend.js +14 -14
  160. package/dist/model/legend.js.map +1 -1
  161. package/dist/model/panels.js.map +1 -1
  162. package/dist/model/plugin-base.js.map +1 -1
  163. package/dist/model/plugin-loading.js.map +1 -1
  164. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +4 -4
  165. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
  166. package/dist/runtime/DataQueriesProvider/index.js.map +1 -1
  167. package/dist/runtime/DataQueriesProvider/model.d.ts +3 -2
  168. package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
  169. package/dist/runtime/DataQueriesProvider/model.js +4 -4
  170. package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
  171. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
  172. package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
  173. package/dist/runtime/TimeRangeProvider/query-params.js +1 -1
  174. package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
  175. package/dist/runtime/builtin-variables.d.ts +11 -0
  176. package/dist/runtime/builtin-variables.d.ts.map +1 -0
  177. package/dist/runtime/builtin-variables.js +59 -0
  178. package/dist/runtime/builtin-variables.js.map +1 -0
  179. package/dist/runtime/datasources.d.ts +14 -6
  180. package/dist/runtime/datasources.d.ts.map +1 -1
  181. package/dist/runtime/datasources.js +13 -6
  182. package/dist/runtime/datasources.js.map +1 -1
  183. package/dist/runtime/index.d.ts +1 -0
  184. package/dist/runtime/index.d.ts.map +1 -1
  185. package/dist/runtime/index.js +1 -0
  186. package/dist/runtime/index.js.map +1 -1
  187. package/dist/runtime/plugin-registry.d.ts +2 -0
  188. package/dist/runtime/plugin-registry.d.ts.map +1 -1
  189. package/dist/runtime/plugin-registry.js +19 -2
  190. package/dist/runtime/plugin-registry.js.map +1 -1
  191. package/dist/runtime/template-variables.d.ts +2 -1
  192. package/dist/runtime/template-variables.d.ts.map +1 -1
  193. package/dist/runtime/template-variables.js +27 -8
  194. package/dist/runtime/template-variables.js.map +1 -1
  195. package/dist/runtime/time-series-queries.d.ts +3 -3
  196. package/dist/runtime/time-series-queries.d.ts.map +1 -1
  197. package/dist/runtime/time-series-queries.js +14 -12
  198. package/dist/runtime/time-series-queries.js.map +1 -1
  199. package/dist/stories/shared-utils/decorators/WithDataQueries.js.map +1 -1
  200. package/dist/stories/shared-utils/decorators/WithPluginRegistry.js.map +1 -1
  201. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts +13 -0
  202. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts.map +1 -0
  203. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +39 -0
  204. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js.map +1 -0
  205. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts.map +1 -1
  206. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +11 -7
  207. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js.map +1 -1
  208. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js.map +1 -1
  209. package/dist/stories/shared-utils/decorators/WithTimeRange.js.map +1 -1
  210. package/dist/stories/shared-utils/decorators/index.d.ts +1 -0
  211. package/dist/stories/shared-utils/decorators/index.d.ts.map +1 -1
  212. package/dist/stories/shared-utils/decorators/index.js +1 -0
  213. package/dist/stories/shared-utils/decorators/index.js.map +1 -1
  214. package/dist/stories/shared-utils/index.js.map +1 -1
  215. package/dist/test/index.js.map +1 -1
  216. package/dist/test/mock-data.js.map +1 -1
  217. package/dist/test/render.js +2 -2
  218. package/dist/test/render.js.map +1 -1
  219. package/dist/test/setup-tests.js.map +1 -1
  220. package/dist/test/test-plugins/bert/index.js.map +1 -1
  221. package/dist/test/test-plugins/ernie/index.js.map +1 -1
  222. package/dist/test/test-plugins/index.js.map +1 -1
  223. package/dist/test-utils/index.js.map +1 -1
  224. package/dist/test-utils/mock-plugin-registry.js +2 -2
  225. package/dist/test-utils/mock-plugin-registry.js.map +1 -1
  226. package/dist/utils/action.d.ts +4 -0
  227. package/dist/utils/action.d.ts.map +1 -0
  228. package/dist/utils/action.js +27 -0
  229. package/dist/utils/action.js.map +1 -0
  230. package/dist/utils/index.d.ts +1 -0
  231. package/dist/utils/index.d.ts.map +1 -1
  232. package/dist/utils/index.js +1 -0
  233. package/dist/utils/index.js.map +1 -1
  234. package/dist/utils/variables.d.ts.map +1 -1
  235. package/dist/utils/variables.js +17 -5
  236. package/dist/utils/variables.js.map +1 -1
  237. package/dist/validation/datasource.d.ts +19 -0
  238. package/dist/validation/datasource.d.ts.map +1 -0
  239. package/dist/validation/datasource.js +22 -0
  240. package/dist/validation/datasource.js.map +1 -0
  241. package/dist/validation/index.d.ts +4 -0
  242. package/dist/validation/index.d.ts.map +1 -0
  243. package/dist/validation/index.js +17 -0
  244. package/dist/validation/index.js.map +1 -0
  245. package/dist/validation/resource.d.ts +3 -0
  246. package/dist/validation/resource.d.ts.map +1 -0
  247. package/dist/validation/resource.js +16 -0
  248. package/dist/validation/resource.js.map +1 -0
  249. package/dist/validation/variable.d.ts +19 -0
  250. package/dist/validation/variable.d.ts.map +1 -0
  251. package/dist/validation/variable.js +21 -0
  252. package/dist/validation/variable.js.map +1 -0
  253. package/package.json +8 -6
@@ -21,14 +21,39 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- VariableStoreStateMap: ()=>VariableStoreStateMap,
25
- TemplateVariableContext: ()=>TemplateVariableContext,
26
- useTemplateVariableValues: ()=>useTemplateVariableValues,
27
- useReplaceVariablesInString: ()=>useReplaceVariablesInString
24
+ VariableStoreStateMap: function() {
25
+ return VariableStoreStateMap;
26
+ },
27
+ TemplateVariableContext: function() {
28
+ return TemplateVariableContext;
29
+ },
30
+ useTemplateVariableValues: function() {
31
+ return useTemplateVariableValues;
32
+ },
33
+ useVariableValues: function() {
34
+ return useVariableValues;
35
+ },
36
+ useReplaceVariablesInString: function() {
37
+ return useReplaceVariablesInString;
38
+ }
28
39
  });
29
40
  const _react = require("react");
30
41
  const _immer = require("immer");
31
42
  const _utils = require("../utils");
43
+ const _builtinvariables = require("./builtin-variables");
44
+ function _define_property(obj, key, value) {
45
+ if (key in obj) {
46
+ Object.defineProperty(obj, key, {
47
+ value: value,
48
+ enumerable: true,
49
+ configurable: true,
50
+ writable: true
51
+ });
52
+ } else {
53
+ obj[key] = value;
54
+ }
55
+ return obj;
56
+ }
32
57
  let _immerable = _immer.immerable;
33
58
  class VariableStoreStateMap {
34
59
  /**
@@ -59,7 +84,7 @@ class VariableStoreStateMap {
59
84
  * Delete variable state by key.
60
85
  * @param key
61
86
  */ delete(key) {
62
- var ref;
87
+ var _Object_keys;
63
88
  const result = this.has(key);
64
89
  const sourceName = this._sourceName(key.source);
65
90
  const sourceStates = this._state[sourceName];
@@ -68,7 +93,7 @@ class VariableStoreStateMap {
68
93
  delete sourceStates[key.name];
69
94
  }
70
95
  // Delete source state from state if empty
71
- if (((ref = Object.keys(sourceStates !== null && sourceStates !== void 0 ? sourceStates : {})) === null || ref === void 0 ? void 0 : ref.length) === 0) {
96
+ if (((_Object_keys = Object.keys(sourceStates !== null && sourceStates !== void 0 ? sourceStates : {})) === null || _Object_keys === void 0 ? void 0 : _Object_keys.length) === 0) {
72
97
  delete this._state[sourceName];
73
98
  }
74
99
  return result;
@@ -77,16 +102,16 @@ class VariableStoreStateMap {
77
102
  return source !== null && source !== void 0 ? source : this.DEFAULT_LOCAL_SOURCE_NAME;
78
103
  }
79
104
  _sourceStatesOrEmpty(source) {
80
- var ref;
81
- return (ref = this._state[this._sourceName(source)]) !== null && ref !== void 0 ? ref : {};
105
+ var _this__state_this__sourceName;
106
+ return (_this__state_this__sourceName = this._state[this._sourceName(source)]) !== null && _this__state_this__sourceName !== void 0 ? _this__state_this__sourceName : {};
82
107
  }
83
108
  constructor(){
84
109
  /**
85
110
  * "Immerable" is mandatory to be able to use this class in an immer context.
86
111
  * Ref: https://docs.pmnd.rs/zustand/integrations/immer-middleware#gotchas
87
- */ this[_immerable] = true;
88
- this.DEFAULT_LOCAL_SOURCE_NAME = '';
89
- this._state = {};
112
+ */ _define_property(this, _immerable, true);
113
+ _define_property(this, "DEFAULT_LOCAL_SOURCE_NAME", '');
114
+ _define_property(this, "_state", {});
90
115
  }
91
116
  }
92
117
  const TemplateVariableContext = (0, _react.createContext)(undefined);
@@ -117,9 +142,14 @@ function useTemplateVariableValues(names) {
117
142
  }
118
143
  return values;
119
144
  }
145
+ function useVariableValues(names) {
146
+ const templateVariableValues = useTemplateVariableValues(names);
147
+ const builtinVariableValues = (0, _builtinvariables.useBuiltinVariableValues)(names);
148
+ return Object.assign(templateVariableValues, builtinVariableValues);
149
+ }
120
150
  function useReplaceVariablesInString(str) {
121
151
  const variablesInString = str ? (0, _utils.parseTemplateVariables)(str) : [];
122
- const variableValues = useTemplateVariableValues(variablesInString);
152
+ const variableValues = useVariableValues(variablesInString);
123
153
  if (!str) return undefined;
124
154
  return (0, _utils.replaceTemplateVariables)(str, variableValues);
125
155
  }
@@ -21,17 +21,27 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- TIME_SERIES_QUERY_KEY: ()=>TIME_SERIES_QUERY_KEY,
25
- useTimeSeriesQuery: ()=>useTimeSeriesQuery,
26
- useTimeSeriesQueries: ()=>useTimeSeriesQueries,
27
- useActiveTimeSeriesQueries: ()=>useActiveTimeSeriesQueries,
28
- getActiveTimeSeriesQueries: ()=>getActiveTimeSeriesQueries
24
+ TIME_SERIES_QUERY_KEY: function() {
25
+ return TIME_SERIES_QUERY_KEY;
26
+ },
27
+ useTimeSeriesQuery: function() {
28
+ return useTimeSeriesQuery;
29
+ },
30
+ useTimeSeriesQueries: function() {
31
+ return useTimeSeriesQueries;
32
+ },
33
+ useActiveTimeSeriesQueries: function() {
34
+ return useActiveTimeSeriesQueries;
35
+ },
36
+ getActiveTimeSeriesQueries: function() {
37
+ return getActiveTimeSeriesQueries;
38
+ }
29
39
  });
30
- const _reactQuery = require("@tanstack/react-query");
31
- const _templateVariables = require("./template-variables");
32
- const _timeRangeProvider = require("./TimeRangeProvider");
40
+ const _reactquery = require("@tanstack/react-query");
41
+ const _templatevariables = require("./template-variables");
42
+ const _TimeRangeProvider = require("./TimeRangeProvider");
33
43
  const _datasources = require("./datasources");
34
- const _pluginRegistry = require("./plugin-registry");
44
+ const _pluginregistry = require("./plugin-registry");
35
45
  const TIME_SERIES_QUERY_KEY = 'TimeSeriesQuery';
36
46
  /**
37
47
  * Returns a serialized string of the current state of variable values.
@@ -63,8 +73,8 @@ function getQueryOptions({ plugin , definition , context }) {
63
73
  let waitToLoad = false;
64
74
  if (variableDependencies) {
65
75
  waitToLoad = variableDependencies.some((v)=>{
66
- var ref;
67
- return (ref = variableState[v]) === null || ref === void 0 ? void 0 : ref.loading;
76
+ var _variableState_v;
77
+ return (_variableState_v = variableState[v]) === null || _variableState_v === void 0 ? void 0 : _variableState_v.loading;
68
78
  });
69
79
  }
70
80
  const queryEnabled = plugin !== undefined && !waitToLoad;
@@ -73,16 +83,17 @@ function getQueryOptions({ plugin , definition , context }) {
73
83
  queryEnabled
74
84
  };
75
85
  }
76
- const useTimeSeriesQuery = (definition, options)=>{
77
- const { data: plugin } = (0, _pluginRegistry.usePlugin)(TIME_SERIES_QUERY_KEY, definition.spec.plugin.kind);
86
+ const useTimeSeriesQuery = (definition, options, queryOptions)=>{
87
+ const { data: plugin } = (0, _pluginregistry.usePlugin)(TIME_SERIES_QUERY_KEY, definition.spec.plugin.kind);
78
88
  const context = useTimeSeriesQueryContext();
79
89
  const { queryEnabled , queryKey } = getQueryOptions({
80
90
  plugin,
81
91
  definition,
82
92
  context
83
93
  });
84
- return (0, _reactQuery.useQuery)({
85
- enabled: queryEnabled,
94
+ var _queryOptions_enabled;
95
+ return (0, _reactquery.useQuery)({
96
+ enabled: ((_queryOptions_enabled = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.enabled) !== null && _queryOptions_enabled !== void 0 ? _queryOptions_enabled : true) || queryEnabled,
86
97
  queryKey: queryKey,
87
98
  refetchInterval: context.refreshIntervalInMs > 0 ? context.refreshIntervalInMs : false,
88
99
  queryFn: ()=>{
@@ -99,23 +110,24 @@ const useTimeSeriesQuery = (definition, options)=>{
99
110
  }
100
111
  });
101
112
  };
102
- function useTimeSeriesQueries(definitions, options) {
103
- const { getPlugin } = (0, _pluginRegistry.usePluginRegistry)();
113
+ function useTimeSeriesQueries(definitions, options, queryOptions) {
114
+ const { getPlugin } = (0, _pluginregistry.usePluginRegistry)();
104
115
  const context = useTimeSeriesQueryContext();
105
- const pluginLoaderResponse = (0, _pluginRegistry.usePlugins)(TIME_SERIES_QUERY_KEY, definitions.map((d)=>({
116
+ const pluginLoaderResponse = (0, _pluginregistry.usePlugins)(TIME_SERIES_QUERY_KEY, definitions.map((d)=>({
106
117
  kind: d.spec.plugin.kind
107
118
  })));
108
- return (0, _reactQuery.useQueries)({
119
+ return (0, _reactquery.useQueries)({
109
120
  queries: definitions.map((definition, idx)=>{
110
- var ref;
111
- const plugin = (ref = pluginLoaderResponse[idx]) === null || ref === void 0 ? void 0 : ref.data;
121
+ var _pluginLoaderResponse_idx;
122
+ const plugin = (_pluginLoaderResponse_idx = pluginLoaderResponse[idx]) === null || _pluginLoaderResponse_idx === void 0 ? void 0 : _pluginLoaderResponse_idx.data;
112
123
  const { queryEnabled , queryKey } = getQueryOptions({
113
124
  plugin,
114
125
  definition,
115
126
  context
116
127
  });
128
+ var _queryOptions_enabled;
117
129
  return {
118
- enabled: queryEnabled,
130
+ enabled: ((_queryOptions_enabled = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.enabled) !== null && _queryOptions_enabled !== void 0 ? _queryOptions_enabled : true) && queryEnabled,
119
131
  queryKey: queryKey,
120
132
  refetchInterval: context.refreshIntervalInMs > 0 ? context.refreshIntervalInMs : undefined,
121
133
  queryFn: async ()=>{
@@ -135,8 +147,8 @@ function useTimeSeriesQueries(definitions, options) {
135
147
  /**
136
148
  * Build the time series query context object from data available at runtime
137
149
  */ function useTimeSeriesQueryContext() {
138
- const { absoluteTimeRange , refreshKey , refreshIntervalInMs } = (0, _timeRangeProvider.useTimeRange)();
139
- const variableState = (0, _templateVariables.useTemplateVariableValues)();
150
+ const { absoluteTimeRange , refreshKey , refreshIntervalInMs } = (0, _TimeRangeProvider.useTimeRange)();
151
+ const variableState = (0, _templatevariables.useVariableValues)();
140
152
  const datasourceStore = (0, _datasources.useDatasourceStore)();
141
153
  return {
142
154
  timeRange: absoluteTimeRange,
@@ -147,7 +159,7 @@ function useTimeSeriesQueries(definitions, options) {
147
159
  };
148
160
  }
149
161
  function useActiveTimeSeriesQueries() {
150
- const queryClient = (0, _reactQuery.useQueryClient)();
162
+ const queryClient = (0, _reactquery.useQueryClient)();
151
163
  const queryCache = queryClient.getQueryCache();
152
164
  return getActiveTimeSeriesQueries(queryCache);
153
165
  }
@@ -156,8 +168,8 @@ function getActiveTimeSeriesQueries(cache) {
156
168
  for (const query of cache.findAll({
157
169
  type: 'active'
158
170
  })){
159
- var ref;
160
- const firstPart = (ref = query.queryKey) === null || ref === void 0 ? void 0 : ref[0];
171
+ var _query_queryKey;
172
+ const firstPart = (_query_queryKey = query.queryKey) === null || _query_queryKey === void 0 ? void 0 : _query_queryKey[0];
161
173
  if ((firstPart === null || firstPart === void 0 ? void 0 : firstPart.kind) && firstPart.kind.startsWith(TIME_SERIES_QUERY_KEY)) {
162
174
  queries.push(query);
163
175
  }
@@ -16,10 +16,12 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "WithDataQueries", {
18
18
  enumerable: true,
19
- get: ()=>WithDataQueries
19
+ get: function() {
20
+ return WithDataQueries;
21
+ }
20
22
  });
21
- const _jsxRuntime = require("react/jsx-runtime");
22
- const _pluginSystem = require("@perses-dev/plugin-system");
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _pluginsystem = require("@perses-dev/plugin-system");
23
25
  // Type guard because storybook types parameters as `any`
24
26
  function isWithDataQueriesParameter(parameter) {
25
27
  return !!parameter && typeof parameter === 'object' && 'props' in parameter;
@@ -32,8 +34,8 @@ const WithDataQueries = (Story, context)=>{
32
34
  }
33
35
  };
34
36
  const props = parameter === null || parameter === void 0 ? void 0 : parameter.props;
35
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pluginSystem.DataQueriesProvider, {
37
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DataQueriesProvider, {
36
38
  ...props,
37
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(Story, {})
39
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Story, {})
38
40
  });
39
41
  };
@@ -16,13 +16,15 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "WithPluginRegistry", {
18
18
  enumerable: true,
19
- get: ()=>WithPluginRegistry
19
+ get: function() {
20
+ return WithPluginRegistry;
21
+ }
20
22
  });
21
- const _jsxRuntime = require("react/jsx-runtime");
22
- const _pluginSystem = require("@perses-dev/plugin-system");
23
- const _pluginJson = /*#__PURE__*/ _interopRequireDefault(require("@perses-dev/prometheus-plugin/plugin.json"));
24
- const _pluginJson1 = /*#__PURE__*/ _interopRequireDefault(require("@perses-dev/panels-plugin/plugin.json"));
25
- function _interopRequireDefault(obj) {
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _pluginsystem = require("@perses-dev/plugin-system");
25
+ const _pluginjson = /*#__PURE__*/ _interop_require_default(require("@perses-dev/prometheus-plugin/plugin.json"));
26
+ const _pluginjson1 = /*#__PURE__*/ _interop_require_default(require("@perses-dev/panels-plugin/plugin.json"));
27
+ function _interop_require_default(obj) {
26
28
  return obj && obj.__esModule ? obj : {
27
29
  default: obj
28
30
  };
@@ -35,7 +37,7 @@ function _getRequireWildcardCache(nodeInterop) {
35
37
  return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
36
38
  })(nodeInterop);
37
39
  }
38
- function _interopRequireWildcard(obj, nodeInterop) {
40
+ function _interop_require_wildcard(obj, nodeInterop) {
39
41
  if (!nodeInterop && obj && obj.__esModule) {
40
42
  return obj;
41
43
  }
@@ -66,30 +68,30 @@ function _interopRequireWildcard(obj, nodeInterop) {
66
68
  }
67
69
  return newObj;
68
70
  }
69
- const bundledPluginLoader = (0, _pluginSystem.dynamicImportPluginLoader)([
71
+ const bundledPluginLoader = (0, _pluginsystem.dynamicImportPluginLoader)([
70
72
  {
71
- resource: _pluginJson.default,
73
+ resource: _pluginjson.default,
72
74
  // This throws an error in CI (but not locally for some reason), likely because
73
75
  // this package isn't a dependency for dashboards. We probably do not want to
74
76
  // make it one solely for type-checking in storybook.
75
77
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
76
78
  // @ts-ignore
77
- importPlugin: ()=>Promise.resolve().then(()=>/*#__PURE__*/ _interopRequireWildcard(require("@perses-dev/prometheus-plugin")))
79
+ importPlugin: ()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("@perses-dev/prometheus-plugin")))
78
80
  },
79
81
  {
80
- resource: _pluginJson1.default,
82
+ resource: _pluginjson1.default,
81
83
  // Same comment as above.
82
84
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
83
85
  // @ts-ignore
84
- importPlugin: ()=>Promise.resolve().then(()=>/*#__PURE__*/ _interopRequireWildcard(require("@perses-dev/panels-plugin")))
86
+ importPlugin: ()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("@perses-dev/panels-plugin")))
85
87
  }
86
88
  ]);
87
89
  const WithPluginRegistry = (Story)=>{
88
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pluginSystem.PluginRegistry, {
90
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.PluginRegistry, {
89
91
  pluginLoader: bundledPluginLoader,
90
92
  defaultPluginKinds: {
91
93
  TimeSeriesQuery: 'PrometheusTimeSeriesQuery'
92
94
  },
93
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(Story, {})
95
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Story, {})
94
96
  });
95
97
  };
@@ -0,0 +1,42 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "WithPluginSystemBuiltinVariables", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return WithPluginSystemBuiltinVariables;
21
+ }
22
+ });
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _runtime = require("../../../runtime");
25
+ // Type guard because storybook types parameters as `any`
26
+ function isWithBuiltinVariableParameter(parameter) {
27
+ return !!parameter && Array.isArray(parameter);
28
+ }
29
+ const WithPluginSystemBuiltinVariables = (Story, context)=>{
30
+ const initParameter = context.parameters.withPluginSystemBuiltinVariables;
31
+ const defaultValue = {
32
+ variables: []
33
+ };
34
+ const parameter = isWithBuiltinVariableParameter(initParameter) ? initParameter : {
35
+ props: defaultValue
36
+ };
37
+ const props = parameter === null || parameter === void 0 ? void 0 : parameter.props;
38
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_runtime.BuiltinVariableContext.Provider, {
39
+ value: props,
40
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Story, {})
41
+ });
42
+ };
@@ -16,23 +16,25 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "WithPluginSystemDatasourceStore", {
18
18
  enumerable: true,
19
- get: ()=>WithPluginSystemDatasourceStore
19
+ get: function() {
20
+ return WithPluginSystemDatasourceStore;
21
+ }
20
22
  });
21
- const _jsxRuntime = require("react/jsx-runtime");
22
- const _pluginSystem = require("@perses-dev/plugin-system");
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _pluginsystem = require("@perses-dev/plugin-system");
23
25
  const prometheusDemoUrl = 'https://prometheus.demo.do.prometheus.io';
24
26
  // Type guard because storybook types parameters as `any`
25
27
  function isWithDatastoreStoreParameter(parameter) {
26
28
  return !!parameter && typeof parameter === 'object' && 'props' in parameter;
27
29
  }
28
30
  const WithPluginSystemDatasourceStore = (Story, context)=>{
29
- const { getPlugin } = (0, _pluginSystem.usePluginRegistry)();
31
+ const { getPlugin } = (0, _pluginsystem.usePluginRegistry)();
30
32
  const initParameter = context.parameters.withPluginSystemDatasourceStore;
31
33
  // This currently provides a very simplified default to enable use in some
32
34
  // basic stories. It likely will need expanding in the future.
33
35
  // In general, `plugin-system` would probably benefit from a provider wrapper
34
36
  // for `DatasourceStoreContext` that is more generic than the one available
35
- // in in the `dashboard` package for non-dashboard use cases.
37
+ // in the `dashboard` package for non-dashboard use cases.
36
38
  const defaultValue = {
37
39
  getDatasource: (selector)=>{
38
40
  if (selector.kind === 'PrometheusDatasource') {
@@ -50,7 +52,7 @@ const WithPluginSystemDatasourceStore = (Story, context)=>{
50
52
  if (selector.kind === 'PrometheusDatasource') {
51
53
  const plugin = await getPlugin('Datasource', 'PrometheusDatasource');
52
54
  const client = plugin.createClient({
53
- direct_url: prometheusDemoUrl
55
+ directUrl: prometheusDemoUrl
54
56
  }, {
55
57
  proxyUrl: prometheusDemoUrl
56
58
  });
@@ -58,14 +60,18 @@ const WithPluginSystemDatasourceStore = (Story, context)=>{
58
60
  }
59
61
  throw new Error(`WithDatasourceStore is not configured to support kind: ${selector.kind}`);
60
62
  },
61
- listDatasourceMetadata: async (datasourcePluginKind)=>{
63
+ listDatasourceSelectItems: async (datasourcePluginKind)=>{
62
64
  if (datasourcePluginKind === 'PrometheusDatasource') {
63
65
  return Promise.resolve([
64
66
  {
65
- name: 'PrometheusDatasource',
66
- selector: {
67
- kind: 'PrometheusDatasource'
68
- }
67
+ items: [
68
+ {
69
+ name: 'PrometheusDatasource',
70
+ selector: {
71
+ kind: 'PrometheusDatasource'
72
+ }
73
+ }
74
+ ]
69
75
  }
70
76
  ]);
71
77
  }
@@ -76,8 +82,8 @@ const WithPluginSystemDatasourceStore = (Story, context)=>{
76
82
  props: defaultValue
77
83
  };
78
84
  const props = parameter === null || parameter === void 0 ? void 0 : parameter.props;
79
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pluginSystem.DatasourceStoreContext.Provider, {
85
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DatasourceStoreContext.Provider, {
80
86
  value: props,
81
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(Story, {})
87
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Story, {})
82
88
  });
83
89
  };
@@ -16,9 +16,11 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "WithPluginSystemTemplateVariables", {
18
18
  enumerable: true,
19
- get: ()=>WithPluginSystemTemplateVariables
19
+ get: function() {
20
+ return WithPluginSystemTemplateVariables;
21
+ }
20
22
  });
21
- const _jsxRuntime = require("react/jsx-runtime");
23
+ const _jsxruntime = require("react/jsx-runtime");
22
24
  const _runtime = require("../../../runtime");
23
25
  // Type guard because storybook types parameters as `any`
24
26
  function isWithTemplateVariableParameter(parameter) {
@@ -33,8 +35,8 @@ const WithPluginSystemTemplateVariables = (Story, context)=>{
33
35
  props: defaultValue
34
36
  };
35
37
  const props = parameter === null || parameter === void 0 ? void 0 : parameter.props;
36
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_runtime.TemplateVariableContext.Provider, {
38
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_runtime.TemplateVariableContext.Provider, {
37
39
  value: props,
38
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(Story, {})
40
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Story, {})
39
41
  });
40
42
  };
@@ -16,10 +16,12 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "WithTimeRange", {
18
18
  enumerable: true,
19
- get: ()=>WithTimeRange
19
+ get: function() {
20
+ return WithTimeRange;
21
+ }
20
22
  });
21
- const _jsxRuntime = require("react/jsx-runtime");
22
- const _pluginSystem = require("@perses-dev/plugin-system");
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _pluginsystem = require("@perses-dev/plugin-system");
23
25
  // Type guard because storybook types parameters as `any`
24
26
  function isWithTimeRangeParameter(parameter) {
25
27
  return !!parameter && typeof parameter === 'object' && 'props' in parameter;
@@ -28,12 +30,12 @@ const WithTimeRange = (Story, context)=>{
28
30
  const initParameter = context.parameters.withTimeRange;
29
31
  const parameter = isWithTimeRangeParameter(initParameter) ? initParameter : undefined;
30
32
  const props = parameter === null || parameter === void 0 ? void 0 : parameter.props;
31
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pluginSystem.TimeRangeProvider, {
33
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.TimeRangeProvider, {
32
34
  initialRefreshInterval: "0s",
33
35
  initialTimeRange: {
34
36
  pastDuration: '1h'
35
37
  },
36
38
  ...props,
37
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(Story, {})
39
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Story, {})
38
40
  });
39
41
  };
@@ -14,19 +14,22 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _exportStar(require("./WithDataQueries"), exports);
18
- _exportStar(require("./WithPluginRegistry"), exports);
19
- _exportStar(require("./WithPluginSystemDatasourceStore"), exports);
20
- _exportStar(require("./WithPluginSystemTemplateVariables"), exports);
21
- _exportStar(require("./WithTimeRange"), exports);
22
- function _exportStar(from, to) {
17
+ _export_star(require("./WithDataQueries"), exports);
18
+ _export_star(require("./WithPluginRegistry"), exports);
19
+ _export_star(require("./WithPluginSystemBuiltinVariables"), exports);
20
+ _export_star(require("./WithPluginSystemDatasourceStore"), exports);
21
+ _export_star(require("./WithPluginSystemTemplateVariables"), exports);
22
+ _export_star(require("./WithTimeRange"), exports);
23
+ function _export_star(from, to) {
23
24
  Object.keys(from).forEach(function(k) {
24
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
25
- enumerable: true,
26
- get: function() {
27
- return from[k];
28
- }
29
- });
25
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
26
+ Object.defineProperty(to, k, {
27
+ enumerable: true,
28
+ get: function() {
29
+ return from[k];
30
+ }
31
+ });
32
+ }
30
33
  });
31
34
  return from;
32
35
  }
@@ -14,15 +14,17 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _exportStar(require("./decorators"), exports);
18
- function _exportStar(from, to) {
17
+ _export_star(require("./decorators"), exports);
18
+ function _export_star(from, to) {
19
19
  Object.keys(from).forEach(function(k) {
20
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
21
- enumerable: true,
22
- get: function() {
23
- return from[k];
24
- }
25
- });
20
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
21
+ Object.defineProperty(to, k, {
22
+ enumerable: true,
23
+ get: function() {
24
+ return from[k];
25
+ }
26
+ });
27
+ }
26
28
  });
27
29
  return from;
28
30
  }
@@ -14,16 +14,18 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _exportStar(require("./render"), exports);
18
- _exportStar(require("./mock-data"), exports);
19
- function _exportStar(from, to) {
17
+ _export_star(require("./render"), exports);
18
+ _export_star(require("./mock-data"), exports);
19
+ function _export_star(from, to) {
20
20
  Object.keys(from).forEach(function(k) {
21
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
22
- enumerable: true,
23
- get: function() {
24
- return from[k];
25
- }
26
- });
21
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
22
+ Object.defineProperty(to, k, {
23
+ enumerable: true,
24
+ get: function() {
25
+ return from[k];
26
+ }
27
+ });
28
+ }
27
29
  });
28
30
  return from;
29
31
  }
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "MOCK_TIME_SERIES_DATA", {
18
18
  enumerable: true,
19
- get: ()=>MOCK_TIME_SERIES_DATA
19
+ get: function() {
20
+ return MOCK_TIME_SERIES_DATA;
21
+ }
20
22
  });
21
23
  const MOCK_TIME_SERIES_DATA = {
22
24
  timeRange: {