@perses-dev/plugin-system 0.43.0-rc2 → 0.44.0-rc0

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 (255) hide show
  1. package/dist/cjs/components/CalculationSelector/CalculationSelector.js +1 -1
  2. package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +8 -8
  3. package/dist/cjs/components/DatasourceSelect.js +11 -9
  4. package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +1 -1
  5. package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +3 -3
  6. package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
  7. package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +3 -3
  8. package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +49 -11
  9. package/dist/cjs/components/PluginEditor/PluginEditor.js +2 -3
  10. package/dist/cjs/components/PluginEditor/plugin-editor-api.js +3 -3
  11. package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +2 -2
  12. package/dist/cjs/components/PluginRegistry/PluginRegistry.js +1 -1
  13. package/dist/cjs/components/PluginRegistry/plugin-indexes.js +4 -4
  14. package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +3 -3
  15. package/dist/cjs/components/ProjectSelect.js +2 -2
  16. package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +3 -3
  17. package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +3 -3
  18. package/dist/cjs/components/TraceQueryEditor/TraceQueryEditor.js +143 -0
  19. package/dist/cjs/components/TraceQueryEditor/TraceQueryInput.js +96 -0
  20. package/dist/cjs/components/TraceQueryEditor/index.js +30 -0
  21. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +29 -23
  22. package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +10 -8
  23. package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +1 -1
  24. package/dist/cjs/components/Variables/variable-model.js +12 -13
  25. package/dist/cjs/context/ProjectStoreProvider.js +5 -5
  26. package/dist/cjs/model/legend.js +5 -5
  27. package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +6 -6
  28. package/dist/cjs/runtime/DataQueriesProvider/model.js +3 -3
  29. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +8 -6
  30. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js +3 -3
  31. package/dist/cjs/runtime/TimeRangeProvider/query-params.js +16 -16
  32. package/dist/cjs/runtime/builtin-variables.js +5 -5
  33. package/dist/cjs/runtime/datasources.js +7 -7
  34. package/dist/cjs/runtime/plugin-registry.js +12 -12
  35. package/dist/cjs/runtime/template-variables.js +15 -7
  36. package/dist/cjs/runtime/time-series-queries.js +14 -14
  37. package/dist/cjs/runtime/trace-queries.js +24 -7
  38. package/dist/cjs/stories/shared-utils/decorators/WithPluginRegistry.js +3 -1
  39. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +1 -1
  40. package/dist/cjs/test/test-plugins/bert/index.js +2 -2
  41. package/dist/cjs/test/test-plugins/ernie/index.js +2 -2
  42. package/dist/cjs/test/test-plugins/index.js +3 -1
  43. package/dist/cjs/test-utils/mock-plugin-registry.js +4 -4
  44. package/dist/cjs/utils/action.js +3 -3
  45. package/dist/cjs/utils/variables.js +4 -4
  46. package/dist/cjs/validation/role.js +3 -3
  47. package/dist/cjs/validation/secret.js +3 -3
  48. package/dist/components/CalculationSelector/CalculationSelector.d.ts +1 -2
  49. package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
  50. package/dist/components/CalculationSelector/CalculationSelector.js +1 -1
  51. package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
  52. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +1 -1
  53. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
  54. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +8 -8
  55. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
  56. package/dist/components/DatasourceSelect.d.ts +3 -4
  57. package/dist/components/DatasourceSelect.d.ts.map +1 -1
  58. package/dist/components/DatasourceSelect.js +8 -6
  59. package/dist/components/DatasourceSelect.js.map +1 -1
  60. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +1 -2
  61. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
  62. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +1 -1
  63. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
  64. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +3 -3
  65. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
  66. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +3 -3
  67. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
  68. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +1 -1
  69. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts.map +1 -1
  70. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
  71. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
  72. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +3 -3
  73. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
  74. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +3 -3
  75. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
  76. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +1 -2
  77. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
  78. package/dist/components/PanelSpecEditor/PanelSpecEditor.js +49 -11
  79. package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
  80. package/dist/components/PluginEditor/PluginEditor.d.ts +1 -2
  81. package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
  82. package/dist/components/PluginEditor/PluginEditor.js +2 -3
  83. package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
  84. package/dist/components/PluginEditor/plugin-editor-api.d.ts +3 -3
  85. package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
  86. package/dist/components/PluginEditor/plugin-editor-api.js +3 -3
  87. package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
  88. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +1 -1
  89. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
  90. package/dist/components/PluginKindSelect/PluginKindSelect.js +2 -2
  91. package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
  92. package/dist/components/PluginRegistry/PluginRegistry.d.ts +1 -1
  93. package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
  94. package/dist/components/PluginRegistry/PluginRegistry.js +1 -1
  95. package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
  96. package/dist/components/PluginRegistry/plugin-indexes.js +1 -1
  97. package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
  98. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +1 -2
  99. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
  100. package/dist/components/PluginSpecEditor/PluginSpecEditor.js +3 -3
  101. package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
  102. package/dist/components/ProjectSelect.d.ts +2 -3
  103. package/dist/components/ProjectSelect.d.ts.map +1 -1
  104. package/dist/components/ProjectSelect.js +2 -2
  105. package/dist/components/ProjectSelect.js.map +1 -1
  106. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts +1 -2
  107. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts.map +1 -1
  108. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +3 -3
  109. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +1 -1
  110. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts +1 -2
  111. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts.map +1 -1
  112. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +3 -3
  113. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +1 -1
  114. package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts +8 -0
  115. package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts.map +1 -0
  116. package/dist/components/TraceQueryEditor/TraceQueryEditor.js +130 -0
  117. package/dist/components/TraceQueryEditor/TraceQueryEditor.js.map +1 -0
  118. package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts +12 -0
  119. package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts.map +1 -0
  120. package/dist/components/TraceQueryEditor/TraceQueryInput.js +83 -0
  121. package/dist/components/TraceQueryEditor/TraceQueryInput.js.map +1 -0
  122. package/dist/components/TraceQueryEditor/index.d.ts +2 -0
  123. package/dist/components/TraceQueryEditor/index.d.ts.map +1 -0
  124. package/dist/components/TraceQueryEditor/index.js +15 -0
  125. package/dist/components/TraceQueryEditor/index.js.map +1 -0
  126. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +1 -1
  127. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  128. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +26 -22
  129. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  130. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +2 -3
  131. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
  132. package/dist/components/Variables/VariableEditorForm/VariablePreview.js +4 -4
  133. package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
  134. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +1 -1
  135. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
  136. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +1 -1
  137. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
  138. package/dist/components/Variables/variable-model.d.ts.map +1 -1
  139. package/dist/components/Variables/variable-model.js +6 -7
  140. package/dist/components/Variables/variable-model.js.map +1 -1
  141. package/dist/context/ProjectStoreProvider.d.ts +1 -1
  142. package/dist/context/ProjectStoreProvider.d.ts.map +1 -1
  143. package/dist/context/ProjectStoreProvider.js +2 -2
  144. package/dist/context/ProjectStoreProvider.js.map +1 -1
  145. package/dist/context/query-params.js.map +1 -1
  146. package/dist/model/datasource.js +3 -1
  147. package/dist/model/datasource.js.map +1 -1
  148. package/dist/model/legend.d.ts +2 -2
  149. package/dist/model/legend.d.ts.map +1 -1
  150. package/dist/model/legend.js.map +1 -1
  151. package/dist/model/panels.d.ts +3 -2
  152. package/dist/model/panels.d.ts.map +1 -1
  153. package/dist/model/panels.js.map +1 -1
  154. package/dist/model/plugin-loading.js.map +1 -1
  155. package/dist/model/plugins.d.ts +4 -4
  156. package/dist/model/plugins.d.ts.map +1 -1
  157. package/dist/model/plugins.js.map +1 -1
  158. package/dist/model/time-series-queries.d.ts +2 -2
  159. package/dist/model/time-series-queries.d.ts.map +1 -1
  160. package/dist/model/time-series-queries.js.map +1 -1
  161. package/dist/model/trace-queries.d.ts +3 -2
  162. package/dist/model/trace-queries.d.ts.map +1 -1
  163. package/dist/model/trace-queries.js.map +1 -1
  164. package/dist/model/variables.d.ts +2 -2
  165. package/dist/model/variables.d.ts.map +1 -1
  166. package/dist/model/variables.js +3 -1
  167. package/dist/model/variables.js.map +1 -1
  168. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +1 -1
  169. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
  170. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +2 -2
  171. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
  172. package/dist/runtime/DataQueriesProvider/model.d.ts +2 -2
  173. package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
  174. package/dist/runtime/DataQueriesProvider/model.js +3 -3
  175. package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
  176. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +1 -1
  177. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
  178. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +1 -1
  179. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
  180. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts +1 -1
  181. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts.map +1 -1
  182. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js +3 -3
  183. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js.map +1 -1
  184. package/dist/runtime/TimeRangeProvider/query-params.d.ts +1 -1
  185. package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
  186. package/dist/runtime/TimeRangeProvider/query-params.js +4 -4
  187. package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
  188. package/dist/runtime/builtin-variables.d.ts +1 -1
  189. package/dist/runtime/builtin-variables.d.ts.map +1 -1
  190. package/dist/runtime/builtin-variables.js +2 -2
  191. package/dist/runtime/builtin-variables.js.map +1 -1
  192. package/dist/runtime/datasources.js +1 -1
  193. package/dist/runtime/datasources.js.map +1 -1
  194. package/dist/runtime/plugin-registry.d.ts +2 -2
  195. package/dist/runtime/plugin-registry.d.ts.map +1 -1
  196. package/dist/runtime/plugin-registry.js +4 -4
  197. package/dist/runtime/plugin-registry.js.map +1 -1
  198. package/dist/runtime/template-variables.d.ts +4 -4
  199. package/dist/runtime/template-variables.d.ts.map +1 -1
  200. package/dist/runtime/template-variables.js +10 -2
  201. package/dist/runtime/template-variables.js.map +1 -1
  202. package/dist/runtime/time-series-queries.js +7 -7
  203. package/dist/runtime/time-series-queries.js.map +1 -1
  204. package/dist/runtime/trace-queries.d.ts +6 -2
  205. package/dist/runtime/trace-queries.d.ts.map +1 -1
  206. package/dist/runtime/trace-queries.js +21 -7
  207. package/dist/runtime/trace-queries.js.map +1 -1
  208. package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts +2 -3
  209. package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts.map +1 -1
  210. package/dist/stories/shared-utils/decorators/WithDataQueries.js.map +1 -1
  211. package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts +1 -2
  212. package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts.map +1 -1
  213. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts +2 -3
  214. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts.map +1 -1
  215. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js.map +1 -1
  216. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts +2 -3
  217. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts.map +1 -1
  218. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +1 -1
  219. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js.map +1 -1
  220. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts +2 -3
  221. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts.map +1 -1
  222. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js.map +1 -1
  223. package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts +2 -3
  224. package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts.map +1 -1
  225. package/dist/stories/shared-utils/decorators/WithTimeRange.js.map +1 -1
  226. package/dist/test/render.d.ts +1 -1
  227. package/dist/test/render.d.ts.map +1 -1
  228. package/dist/test/render.js.map +1 -1
  229. package/dist/test/setup-tests.js.map +1 -1
  230. package/dist/test/test-plugins/bert/index.js +2 -2
  231. package/dist/test/test-plugins/bert/index.js.map +1 -1
  232. package/dist/test/test-plugins/ernie/index.js +2 -2
  233. package/dist/test/test-plugins/ernie/index.js.map +1 -1
  234. package/dist/test-utils/mock-plugin-registry.d.ts +1 -1
  235. package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
  236. package/dist/test-utils/mock-plugin-registry.js +1 -1
  237. package/dist/test-utils/mock-plugin-registry.js.map +1 -1
  238. package/dist/utils/variables.js.map +1 -1
  239. package/dist/validation/datasource.d.ts +1 -1
  240. package/dist/validation/datasource.d.ts.map +1 -1
  241. package/dist/validation/datasource.js.map +1 -1
  242. package/dist/validation/resource.js.map +1 -1
  243. package/dist/validation/role.d.ts +43 -43
  244. package/dist/validation/role.d.ts.map +1 -1
  245. package/dist/validation/role.js.map +1 -1
  246. package/dist/validation/rolebinding.d.ts +10 -10
  247. package/dist/validation/rolebinding.d.ts.map +1 -1
  248. package/dist/validation/rolebinding.js.map +1 -1
  249. package/dist/validation/secret.d.ts +19 -19
  250. package/dist/validation/secret.d.ts.map +1 -1
  251. package/dist/validation/secret.js.map +1 -1
  252. package/dist/validation/variable.d.ts +1 -1
  253. package/dist/validation/variable.d.ts.map +1 -1
  254. package/dist/validation/variable.js.map +1 -1
  255. package/package.json +4 -4
@@ -21,32 +21,32 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- encodeTimeRangeValue: function() {
25
- return encodeTimeRangeValue;
24
+ TimeRangeParam: function() {
25
+ return TimeRangeParam;
26
26
  },
27
27
  decodeTimeRangeValue: function() {
28
28
  return decodeTimeRangeValue;
29
29
  },
30
- TimeRangeParam: function() {
31
- return TimeRangeParam;
32
- },
33
- timeRangeQueryConfig: function() {
34
- return timeRangeQueryConfig;
30
+ encodeTimeRangeValue: function() {
31
+ return encodeTimeRangeValue;
35
32
  },
36
33
  refreshIntervalQueryConfig: function() {
37
34
  return refreshIntervalQueryConfig;
38
35
  },
39
- useInitialTimeRange: function() {
40
- return useInitialTimeRange;
41
- },
42
- useTimeRangeParams: function() {
43
- return useTimeRangeParams;
36
+ timeRangeQueryConfig: function() {
37
+ return timeRangeQueryConfig;
44
38
  },
45
39
  useInitialRefreshInterval: function() {
46
40
  return useInitialRefreshInterval;
47
41
  },
42
+ useInitialTimeRange: function() {
43
+ return useInitialTimeRange;
44
+ },
48
45
  useSetRefreshIntervalParams: function() {
49
46
  return useSetRefreshIntervalParams;
47
+ },
48
+ useTimeRangeParams: function() {
49
+ return useTimeRangeParams;
50
50
  }
51
51
  });
52
52
  const _react = require("react");
@@ -106,7 +106,7 @@ function useInitialTimeRange(dashboardDuration) {
106
106
  const [query] = (0, _usequeryparams.useQueryParams)(timeRangeQueryConfig, {
107
107
  updateType: 'replaceIn'
108
108
  });
109
- const { start , end } = query;
109
+ const { start, end } = query;
110
110
  return (0, _react.useMemo)(()=>{
111
111
  let initialTimeRange = {
112
112
  pastDuration: dashboardDuration
@@ -138,7 +138,7 @@ function useTimeRangeParams(initialTimeRange) {
138
138
  });
139
139
  // determine whether initial param had previously been populated to fix back btn
140
140
  const [paramsLoaded, setParamsLoaded] = (0, _react.useState)(false);
141
- const { start } = query;
141
+ const { start } = query;
142
142
  (0, _react.useEffect)(()=>{
143
143
  // when dashboard loaded with no params, default to dashboard duration
144
144
  if (!paramsLoaded && !start) {
@@ -177,7 +177,7 @@ function useInitialRefreshInterval(dashboardDuration) {
177
177
  const [query] = (0, _usequeryparams.useQueryParams)(refreshIntervalQueryConfig, {
178
178
  updateType: 'replaceIn'
179
179
  });
180
- const { refresh } = query;
180
+ const { refresh } = query;
181
181
  return (0, _react.useMemo)(()=>{
182
182
  let initialTimeRange = dashboardDuration;
183
183
  if (!refresh) {
@@ -199,7 +199,7 @@ function useSetRefreshIntervalParams(initialRefreshInterval) {
199
199
  });
200
200
  // determine whether initial param had previously been populated to fix back btn
201
201
  const [paramsLoaded, setParamsLoaded] = (0, _react.useState)(false);
202
- const { refresh } = query;
202
+ const { refresh } = query;
203
203
  (0, _react.useEffect)(()=>{
204
204
  // when dashboard loaded with no params, default to dashboard refresh interval
205
205
  if (!paramsLoaded && !refresh) {
@@ -27,11 +27,11 @@ _export(exports, {
27
27
  useBuiltinVariableContext: function() {
28
28
  return useBuiltinVariableContext;
29
29
  },
30
- useBuiltinVariableValues: function() {
31
- return useBuiltinVariableValues;
32
- },
33
30
  useBuiltinVariableDefinitions: function() {
34
31
  return useBuiltinVariableDefinitions;
32
+ },
33
+ useBuiltinVariableValues: function() {
34
+ return useBuiltinVariableValues;
35
35
  }
36
36
  });
37
37
  const _react = require("react");
@@ -44,7 +44,7 @@ function useBuiltinVariableContext() {
44
44
  return ctx;
45
45
  }
46
46
  function useBuiltinVariableValues(names) {
47
- const { variables } = useBuiltinVariableContext();
47
+ const { variables } = useBuiltinVariableContext();
48
48
  const states = (0, _react.useMemo)(()=>{
49
49
  const values = {};
50
50
  for (const variable of variables){
@@ -76,6 +76,6 @@ function useBuiltinVariableValues(names) {
76
76
  return values;
77
77
  }
78
78
  function useBuiltinVariableDefinitions() {
79
- const { variables } = useBuiltinVariableContext();
79
+ const { variables } = useBuiltinVariableContext();
80
80
  return variables;
81
81
  }
@@ -24,17 +24,17 @@ _export(exports, {
24
24
  DatasourceStoreContext: function() {
25
25
  return DatasourceStoreContext;
26
26
  },
27
+ useDatasource: function() {
28
+ return useDatasource;
29
+ },
30
+ useDatasourceClient: function() {
31
+ return useDatasourceClient;
32
+ },
27
33
  useDatasourceStore: function() {
28
34
  return useDatasourceStore;
29
35
  },
30
36
  useListDatasourceSelectItems: function() {
31
37
  return useListDatasourceSelectItems;
32
- },
33
- useDatasourceClient: function() {
34
- return useDatasourceClient;
35
- },
36
- useDatasource: function() {
37
- return useDatasource;
38
38
  }
39
39
  });
40
40
  const _reactquery = require("@tanstack/react-query");
@@ -48,7 +48,7 @@ function useDatasourceStore() {
48
48
  return ctx;
49
49
  }
50
50
  function useListDatasourceSelectItems(datasourcePluginKind, project) {
51
- const { listDatasourceSelectItems } = useDatasourceStore();
51
+ const { listDatasourceSelectItems } = useDatasourceStore();
52
52
  return (0, _reactquery.useQuery)([
53
53
  'listDatasourceSelectItems',
54
54
  datasourcePluginKind,
@@ -24,20 +24,20 @@ _export(exports, {
24
24
  PluginRegistryContext: function() {
25
25
  return PluginRegistryContext;
26
26
  },
27
- usePluginRegistry: function() {
28
- return usePluginRegistry;
27
+ useListPluginMetadata: function() {
28
+ return useListPluginMetadata;
29
29
  },
30
30
  usePlugin: function() {
31
31
  return usePlugin;
32
32
  },
33
- usePlugins: function() {
34
- return usePlugins;
35
- },
36
- useListPluginMetadata: function() {
37
- return useListPluginMetadata;
38
- },
39
33
  usePluginBuiltinVariableDefinitions: function() {
40
34
  return usePluginBuiltinVariableDefinitions;
35
+ },
36
+ usePluginRegistry: function() {
37
+ return usePluginRegistry;
38
+ },
39
+ usePlugins: function() {
40
+ return usePlugins;
41
41
  }
42
42
  });
43
43
  const _react = require("react");
@@ -57,7 +57,7 @@ function usePlugin(pluginType, kind, options) {
57
57
  ...options,
58
58
  enabled: ((_options_enabled = options === null || options === void 0 ? void 0 : options.enabled) !== null && _options_enabled !== void 0 ? _options_enabled : true) && kind !== ''
59
59
  };
60
- const { getPlugin } = usePluginRegistry();
60
+ const { getPlugin } = usePluginRegistry();
61
61
  return (0, _reactquery.useQuery)([
62
62
  'getPlugin',
63
63
  pluginType,
@@ -65,7 +65,7 @@ function usePlugin(pluginType, kind, options) {
65
65
  ], ()=>getPlugin(pluginType, kind), options);
66
66
  }
67
67
  function usePlugins(pluginType, plugins) {
68
- const { getPlugin } = usePluginRegistry();
68
+ const { getPlugin } = usePluginRegistry();
69
69
  return (0, _reactquery.useQueries)({
70
70
  queries: plugins.map((p)=>{
71
71
  return {
@@ -80,14 +80,14 @@ function usePlugins(pluginType, plugins) {
80
80
  });
81
81
  }
82
82
  function useListPluginMetadata(pluginType, options) {
83
- const { listPluginMetadata } = usePluginRegistry();
83
+ const { listPluginMetadata } = usePluginRegistry();
84
84
  return (0, _reactquery.useQuery)([
85
85
  'listPluginMetadata',
86
86
  pluginType
87
87
  ], ()=>listPluginMetadata(pluginType), options);
88
88
  }
89
89
  function usePluginBuiltinVariableDefinitions() {
90
- const { getPlugin , listPluginMetadata } = usePluginRegistry();
90
+ const { getPlugin, listPluginMetadata } = usePluginRegistry();
91
91
  return (0, _reactquery.useQuery)([
92
92
  'usePluginBuiltinVariableDefinitions'
93
93
  ], async ()=>{
@@ -21,20 +21,20 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
+ TemplateVariableContext: function() {
25
+ return TemplateVariableContext;
26
+ },
24
27
  VariableStoreStateMap: function() {
25
28
  return VariableStoreStateMap;
26
29
  },
27
- TemplateVariableContext: function() {
28
- return TemplateVariableContext;
30
+ useReplaceVariablesInString: function() {
31
+ return useReplaceVariablesInString;
29
32
  },
30
33
  useTemplateVariableValues: function() {
31
34
  return useTemplateVariableValues;
32
35
  },
33
36
  useVariableValues: function() {
34
37
  return useVariableValues;
35
- },
36
- useReplaceVariablesInString: function() {
37
- return useReplaceVariablesInString;
38
38
  }
39
39
  });
40
40
  const _react = require("react");
@@ -123,7 +123,7 @@ function useTemplateVariableContext() {
123
123
  return ctx;
124
124
  }
125
125
  function useTemplateVariableValues(names) {
126
- const { state } = useTemplateVariableContext();
126
+ const { state } = useTemplateVariableContext();
127
127
  const values = (0, _react.useMemo)(()=>{
128
128
  const values = {};
129
129
  names === null || names === void 0 ? void 0 : names.forEach((name)=>{
@@ -145,7 +145,15 @@ function useTemplateVariableValues(names) {
145
145
  function useVariableValues(names) {
146
146
  const templateVariableValues = useTemplateVariableValues(names);
147
147
  const builtinVariableValues = (0, _builtinvariables.useBuiltinVariableValues)(names);
148
- return Object.assign(templateVariableValues, builtinVariableValues);
148
+ return (0, _react.useMemo)(()=>{
149
+ return {
150
+ ...templateVariableValues,
151
+ ...builtinVariableValues
152
+ };
153
+ }, [
154
+ templateVariableValues,
155
+ builtinVariableValues
156
+ ]);
149
157
  }
150
158
  function useReplaceVariablesInString(str) {
151
159
  const variablesInString = str ? (0, _utils.parseTemplateVariables)(str) : [];
@@ -24,17 +24,17 @@ _export(exports, {
24
24
  TIME_SERIES_QUERY_KEY: function() {
25
25
  return TIME_SERIES_QUERY_KEY;
26
26
  },
27
- useTimeSeriesQuery: function() {
28
- return useTimeSeriesQuery;
29
- },
30
- useTimeSeriesQueries: function() {
31
- return useTimeSeriesQueries;
27
+ getActiveTimeSeriesQueries: function() {
28
+ return getActiveTimeSeriesQueries;
32
29
  },
33
30
  useActiveTimeSeriesQueries: function() {
34
31
  return useActiveTimeSeriesQueries;
35
32
  },
36
- getActiveTimeSeriesQueries: function() {
37
- return getActiveTimeSeriesQueries;
33
+ useTimeSeriesQueries: function() {
34
+ return useTimeSeriesQueries;
35
+ },
36
+ useTimeSeriesQuery: function() {
37
+ return useTimeSeriesQuery;
38
38
  }
39
39
  });
40
40
  const _reactquery = require("@tanstack/react-query");
@@ -54,8 +54,8 @@ function filterVariableStateMap(v, names) {
54
54
  }
55
55
  return Object.fromEntries(Object.entries(v).filter(([name])=>names.includes(name)));
56
56
  }
57
- function getQueryOptions({ plugin , definition , context }) {
58
- const { timeRange , datasourceStore , suggestedStepMs , variableState , refreshKey } = context;
57
+ function getQueryOptions({ plugin, definition, context }) {
58
+ const { timeRange, datasourceStore, suggestedStepMs, variableState, refreshKey } = context;
59
59
  const dependencies = (plugin === null || plugin === void 0 ? void 0 : plugin.dependsOn) ? plugin.dependsOn(definition.spec.plugin.spec, context) : {};
60
60
  const variableDependencies = dependencies === null || dependencies === void 0 ? void 0 : dependencies.variables;
61
61
  // Determine queryKey
@@ -84,9 +84,9 @@ function getQueryOptions({ plugin , definition , context }) {
84
84
  };
85
85
  }
86
86
  const useTimeSeriesQuery = (definition, options, queryOptions)=>{
87
- const { data: plugin } = (0, _pluginregistry.usePlugin)(TIME_SERIES_QUERY_KEY, definition.spec.plugin.kind);
87
+ const { data: plugin } = (0, _pluginregistry.usePlugin)(TIME_SERIES_QUERY_KEY, definition.spec.plugin.kind);
88
88
  const context = useTimeSeriesQueryContext();
89
- const { queryEnabled , queryKey } = getQueryOptions({
89
+ const { queryEnabled, queryKey } = getQueryOptions({
90
90
  plugin,
91
91
  definition,
92
92
  context
@@ -111,7 +111,7 @@ const useTimeSeriesQuery = (definition, options, queryOptions)=>{
111
111
  });
112
112
  };
113
113
  function useTimeSeriesQueries(definitions, options, queryOptions) {
114
- const { getPlugin } = (0, _pluginregistry.usePluginRegistry)();
114
+ const { getPlugin } = (0, _pluginregistry.usePluginRegistry)();
115
115
  const context = useTimeSeriesQueryContext();
116
116
  const pluginLoaderResponse = (0, _pluginregistry.usePlugins)(TIME_SERIES_QUERY_KEY, definitions.map((d)=>({
117
117
  kind: d.spec.plugin.kind
@@ -120,7 +120,7 @@ function useTimeSeriesQueries(definitions, options, queryOptions) {
120
120
  queries: definitions.map((definition, idx)=>{
121
121
  var _pluginLoaderResponse_idx;
122
122
  const plugin = (_pluginLoaderResponse_idx = pluginLoaderResponse[idx]) === null || _pluginLoaderResponse_idx === void 0 ? void 0 : _pluginLoaderResponse_idx.data;
123
- const { queryEnabled , queryKey } = getQueryOptions({
123
+ const { queryEnabled, queryKey } = getQueryOptions({
124
124
  plugin,
125
125
  definition,
126
126
  context
@@ -147,7 +147,7 @@ function useTimeSeriesQueries(definitions, options, queryOptions) {
147
147
  /**
148
148
  * Build the time series query context object from data available at runtime
149
149
  */ function useTimeSeriesQueryContext() {
150
- const { absoluteTimeRange , refreshKey , refreshIntervalInMs } = (0, _TimeRangeProvider.useTimeRange)();
150
+ const { absoluteTimeRange, refreshKey, refreshIntervalInMs } = (0, _TimeRangeProvider.useTimeRange)();
151
151
  const variableState = (0, _templatevariables.useVariableValues)();
152
152
  const datasourceStore = (0, _datasources.useDatasourceStore)();
153
153
  return {
@@ -24,33 +24,50 @@ _export(exports, {
24
24
  TRACE_QUERY_KEY: function() {
25
25
  return TRACE_QUERY_KEY;
26
26
  },
27
+ getUnixTimeRange: function() {
28
+ return getUnixTimeRange;
29
+ },
27
30
  useTraceQueries: function() {
28
31
  return useTraceQueries;
29
32
  }
30
33
  });
34
+ const _datefns = require("date-fns");
31
35
  const _reactquery = require("@tanstack/react-query");
32
36
  const _datasources = require("./datasources");
33
37
  const _pluginregistry = require("./plugin-registry");
38
+ const _TimeRangeProvider = require("./TimeRangeProvider");
34
39
  const TRACE_QUERY_KEY = 'TraceQuery';
40
+ function getUnixTimeRange(timeRange) {
41
+ const { start, end } = timeRange;
42
+ return {
43
+ start: Math.ceil((0, _datefns.getUnixTime)(start)),
44
+ end: Math.ceil((0, _datefns.getUnixTime)(end))
45
+ };
46
+ }
35
47
  function useTraceQueries(definitions) {
36
- const { getPlugin } = (0, _pluginregistry.usePluginRegistry)();
48
+ const { getPlugin } = (0, _pluginregistry.usePluginRegistry)();
37
49
  const datasourceStore = (0, _datasources.useDatasourceStore)();
38
- const ctx = {
39
- datasourceStore
50
+ const { absoluteTimeRange } = (0, _TimeRangeProvider.useTimeRange)();
51
+ const context = {
52
+ datasourceStore,
53
+ absoluteTimeRange
40
54
  };
55
+ // useQueries() handles data fetching from query plugins (e.g. traceQL queries, promQL queries)
56
+ // https://tanstack.com/query/v4/docs/react/reference/useQuery
41
57
  return (0, _reactquery.useQueries)({
42
58
  queries: definitions.map((definition)=>{
43
- var _definition_spec, _definition_spec_plugin;
59
+ var _definition_spec_plugin, _definition_spec;
44
60
  const queryKey = [
45
61
  definition,
46
- datasourceStore
47
- ];
62
+ datasourceStore,
63
+ absoluteTimeRange
64
+ ]; // `queryKey` watches and reruns `queryFn` if keys in the array change
48
65
  const traceQueryKind = definition === null || definition === void 0 ? void 0 : (_definition_spec = definition.spec) === null || _definition_spec === void 0 ? void 0 : (_definition_spec_plugin = _definition_spec.plugin) === null || _definition_spec_plugin === void 0 ? void 0 : _definition_spec_plugin.kind;
49
66
  return {
50
67
  queryKey: queryKey,
51
68
  queryFn: async ()=>{
52
69
  const plugin = await getPlugin(TRACE_QUERY_KEY, traceQueryKind);
53
- const data = await plugin.getTraceData(definition.spec.plugin.spec, ctx);
70
+ const data = await plugin.getTraceData(definition.spec.plugin.spec, context);
54
71
  return data;
55
72
  }
56
73
  };
@@ -50,7 +50,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
50
50
  if (cache && cache.has(obj)) {
51
51
  return cache.get(obj);
52
52
  }
53
- var newObj = {};
53
+ var newObj = {
54
+ __proto__: null
55
+ };
54
56
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
55
57
  for(var key in obj){
56
58
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -28,7 +28,7 @@ function isWithDatastoreStoreParameter(parameter) {
28
28
  return !!parameter && typeof parameter === 'object' && 'props' in parameter;
29
29
  }
30
30
  const WithPluginSystemDatasourceStore = (Story, context)=>{
31
- const { getPlugin } = (0, _pluginsystem.usePluginRegistry)();
31
+ const { getPlugin } = (0, _pluginsystem.usePluginRegistry)();
32
32
  const initParameter = context.parameters.withPluginSystemDatasourceStore;
33
33
  // This currently provides a very simplified default to enable use in some
34
34
  // basic stories. It likely will need expanding in the future.
@@ -29,7 +29,7 @@ _export(exports, {
29
29
  }
30
30
  });
31
31
  const _jsxruntime = require("react/jsx-runtime");
32
- function BertPanel1Editor({ value , onChange }) {
32
+ function BertPanel1Editor({ value, onChange }) {
33
33
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
34
34
  children: [
35
35
  /*#__PURE__*/ (0, _jsxruntime.jsx)("label", {
@@ -65,7 +65,7 @@ const BertPanel2 = {
65
65
  panelOptionsEditorComponents: [
66
66
  {
67
67
  label: 'Settings',
68
- content: function BertPanel2Editor({ value , onChange }) {
68
+ content: function BertPanel2Editor({ value, onChange }) {
69
69
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
70
70
  children: [
71
71
  /*#__PURE__*/ (0, _jsxruntime.jsx)("label", {
@@ -43,7 +43,7 @@ const ErnieVariable1 = {
43
43
  getVariableOptions: async ()=>({
44
44
  data
45
45
  }),
46
- OptionsEditorComponent: function ErnieVariableEditor({ value , onChange }) {
46
+ OptionsEditorComponent: function ErnieVariableEditor({ value, onChange }) {
47
47
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
48
48
  children: [
49
49
  /*#__PURE__*/ (0, _jsxruntime.jsx)("label", {
@@ -70,7 +70,7 @@ const ErnieVariable2 = {
70
70
  getVariableOptions: async ()=>({
71
71
  data
72
72
  }),
73
- OptionsEditorComponent: function ErnieVariableEditor({ value , onChange }) {
73
+ OptionsEditorComponent: function ErnieVariableEditor({ value, onChange }) {
74
74
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
75
75
  children: [
76
76
  /*#__PURE__*/ (0, _jsxruntime.jsx)("label", {
@@ -49,7 +49,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
49
49
  if (cache && cache.has(obj)) {
50
50
  return cache.get(obj);
51
51
  }
52
- var newObj = {};
52
+ var newObj = {
53
+ __proto__: null
54
+ };
53
55
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
54
56
  for(var key in obj){
55
57
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -21,11 +21,11 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- mockPluginRegistry: function() {
25
- return mockPluginRegistry;
26
- },
27
24
  getMockPluginName: function() {
28
25
  return getMockPluginName;
26
+ },
27
+ mockPluginRegistry: function() {
28
+ return mockPluginRegistry;
29
29
  }
30
30
  });
31
31
  function mockPluginRegistry(...mockPlugins) {
@@ -39,7 +39,7 @@ function mockPluginRegistry(...mockPlugins) {
39
39
  },
40
40
  spec: {
41
41
  // Add metadata for all mock plugins
42
- plugins: mockPlugins.map(({ pluginType , kind })=>({
42
+ plugins: mockPlugins.map(({ pluginType, kind })=>({
43
43
  pluginType,
44
44
  kind,
45
45
  display: {
@@ -21,11 +21,11 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- getTitleAction: function() {
25
- return getTitleAction;
26
- },
27
24
  getSubmitText: function() {
28
25
  return getSubmitText;
26
+ },
27
+ getTitleAction: function() {
28
+ return getTitleAction;
29
29
  }
30
30
  });
31
31
  function getTitleAction(action, isDraft) {
@@ -21,14 +21,14 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- replaceTemplateVariables: function() {
25
- return replaceTemplateVariables;
24
+ parseTemplateVariables: function() {
25
+ return parseTemplateVariables;
26
26
  },
27
27
  replaceTemplateVariable: function() {
28
28
  return replaceTemplateVariable;
29
29
  },
30
- parseTemplateVariables: function() {
31
- return parseTemplateVariables;
30
+ replaceTemplateVariables: function() {
31
+ return replaceTemplateVariables;
32
32
  }
33
33
  });
34
34
  function replaceTemplateVariables(text, variableState) {
@@ -21,12 +21,12 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- roleValidationSchema: function() {
25
- return roleValidationSchema;
26
- },
27
24
  globalRoleValidationSchema: function() {
28
25
  return globalRoleValidationSchema;
29
26
  },
27
+ roleValidationSchema: function() {
28
+ return roleValidationSchema;
29
+ },
30
30
  rolesEditorValidationSchema: function() {
31
31
  return rolesEditorValidationSchema;
32
32
  }
@@ -21,12 +21,12 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- secretValidationSchema: function() {
25
- return secretValidationSchema;
26
- },
27
24
  globalSecretValidationSchema: function() {
28
25
  return globalSecretValidationSchema;
29
26
  },
27
+ secretValidationSchema: function() {
28
+ return secretValidationSchema;
29
+ },
30
30
  secretsEditorValidationSchema: function() {
31
31
  return secretsEditorValidationSchema;
32
32
  }
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
1
  import { CalculationType } from '@perses-dev/core';
3
2
  export interface CalculationSelectorProps {
4
3
  value: CalculationType;
5
4
  onChange: (unit: CalculationType) => void;
6
5
  }
7
- export declare function CalculationSelector({ value, onChange }: CalculationSelectorProps): JSX.Element;
6
+ export declare function CalculationSelector({ value, onChange }: CalculationSelectorProps): import("react/jsx-runtime").JSX.Element;
8
7
  //# sourceMappingURL=CalculationSelector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CalculationSelector.d.ts","sourceRoot":"","sources":["../../../src/components/CalculationSelector/CalculationSelector.tsx"],"names":[],"mappings":";AAcA,OAAO,EAA0C,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAU3F,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;CAC3C;AAED,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,wBAAwB,eAuBhF"}
1
+ {"version":3,"file":"CalculationSelector.d.ts","sourceRoot":"","sources":["../../../src/components/CalculationSelector/CalculationSelector.tsx"],"names":[],"mappings":"AAcA,OAAO,EAA0C,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAU3F,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;CAC3C;AAED,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,wBAAwB,2CAuBhF"}
@@ -19,7 +19,7 @@ const CALC_OPTIONS = Object.entries(CALCULATIONS_CONFIG).map(([id, config])=>{
19
19
  ...config
20
20
  };
21
21
  });
22
- export function CalculationSelector({ value , onChange }) {
22
+ export function CalculationSelector({ value, onChange }) {
23
23
  const handleCalculationChange = (_, newValue)=>{
24
24
  onChange(newValue.id);
25
25
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/CalculationSelector/CalculationSelector.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { OptionsEditorControl, SettingsAutocomplete } from '@perses-dev/components';\nimport { CALCULATIONS_CONFIG, CalculationConfig, CalculationType } from '@perses-dev/core';\n\ntype AutocompleteCalculationOption = CalculationConfig & { id: CalculationType };\nconst CALC_OPTIONS: AutocompleteCalculationOption[] = Object.entries(CALCULATIONS_CONFIG).map(([id, config]) => {\n return {\n id: id as CalculationType,\n ...config,\n };\n});\n\nexport interface CalculationSelectorProps {\n value: CalculationType;\n onChange: (unit: CalculationType) => void;\n}\n\nexport function CalculationSelector({ value, onChange }: CalculationSelectorProps) {\n const handleCalculationChange = (_: unknown, newValue: AutocompleteCalculationOption) => {\n onChange(newValue.id);\n };\n\n const calcConfig = CALCULATIONS_CONFIG[value];\n\n return (\n <OptionsEditorControl\n label=\"Calculation\"\n control={\n <SettingsAutocomplete\n value={{\n ...calcConfig,\n id: value,\n }}\n options={CALC_OPTIONS}\n onChange={handleCalculationChange}\n disableClearable\n ></SettingsAutocomplete>\n }\n />\n );\n}\n"],"names":["OptionsEditorControl","SettingsAutocomplete","CALCULATIONS_CONFIG","CALC_OPTIONS","Object","entries","map","id","config","CalculationSelector","value","onChange","handleCalculationChange","_","newValue","calcConfig","label","control","options","disableClearable"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,oBAAoB,EAAEC,oBAAoB,QAAQ,yBAAyB;AACpF,SAASC,mBAAmB,QAA4C,mBAAmB;AAG3F,MAAMC,eAAgDC,OAAOC,QAAQH,qBAAqBI,IAAI,CAAC,CAACC,IAAIC,OAAO;IACzG,OAAO;QACLD,IAAIA;QACJ,GAAGC,MAAM;IACX;AACF;AAOA,OAAO,SAASC,oBAAoB,EAAEC,MAAK,EAAEC,SAAQ,EAA4B;IAC/E,MAAMC,0BAA0B,CAACC,GAAYC;QAC3CH,SAASG,SAASP;IACpB;IAEA,MAAMQ,aAAab,mBAAmB,CAACQ,MAAM;IAE7C,qBACE,KAACV;QACCgB,OAAM;QACNC,uBACE,KAAChB;YACCS,OAAO;gBACL,GAAGK,UAAU;gBACbR,IAAIG;YACN;YACAQ,SAASf;YACTQ,UAAUC;YACVO,gBAAgB;;;AAK1B"}
1
+ {"version":3,"sources":["../../../src/components/CalculationSelector/CalculationSelector.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { OptionsEditorControl, SettingsAutocomplete } from '@perses-dev/components';\nimport { CALCULATIONS_CONFIG, CalculationConfig, CalculationType } from '@perses-dev/core';\n\ntype AutocompleteCalculationOption = CalculationConfig & { id: CalculationType };\nconst CALC_OPTIONS: AutocompleteCalculationOption[] = Object.entries(CALCULATIONS_CONFIG).map(([id, config]) => {\n return {\n id: id as CalculationType,\n ...config,\n };\n});\n\nexport interface CalculationSelectorProps {\n value: CalculationType;\n onChange: (unit: CalculationType) => void;\n}\n\nexport function CalculationSelector({ value, onChange }: CalculationSelectorProps) {\n const handleCalculationChange = (_: unknown, newValue: AutocompleteCalculationOption) => {\n onChange(newValue.id);\n };\n\n const calcConfig = CALCULATIONS_CONFIG[value];\n\n return (\n <OptionsEditorControl\n label=\"Calculation\"\n control={\n <SettingsAutocomplete\n value={{\n ...calcConfig,\n id: value,\n }}\n options={CALC_OPTIONS}\n onChange={handleCalculationChange}\n disableClearable\n ></SettingsAutocomplete>\n }\n />\n );\n}\n"],"names":["OptionsEditorControl","SettingsAutocomplete","CALCULATIONS_CONFIG","CALC_OPTIONS","Object","entries","map","id","config","CalculationSelector","value","onChange","handleCalculationChange","_","newValue","calcConfig","label","control","options","disableClearable"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,oBAAoB,EAAEC,oBAAoB,QAAQ,yBAAyB;AACpF,SAASC,mBAAmB,QAA4C,mBAAmB;AAG3F,MAAMC,eAAgDC,OAAOC,OAAO,CAACH,qBAAqBI,GAAG,CAAC,CAAC,CAACC,IAAIC,OAAO;IACzG,OAAO;QACLD,IAAIA;QACJ,GAAGC,MAAM;IACX;AACF;AAOA,OAAO,SAASC,oBAAoB,EAAEC,KAAK,EAAEC,QAAQ,EAA4B;IAC/E,MAAMC,0BAA0B,CAACC,GAAYC;QAC3CH,SAASG,SAASP,EAAE;IACtB;IAEA,MAAMQ,aAAab,mBAAmB,CAACQ,MAAM;IAE7C,qBACE,KAACV;QACCgB,OAAM;QACNC,uBACE,KAAChB;YACCS,OAAO;gBACL,GAAGK,UAAU;gBACbR,IAAIG;YACN;YACAQ,SAASf;YACTQ,UAAUC;YACVO,gBAAgB;;;AAK1B"}
@@ -10,6 +10,6 @@ interface DatasourceEditorFormProps {
10
10
  onClose: DispatchWithoutAction;
11
11
  onDelete?: DispatchWithoutAction;
12
12
  }
13
- export declare function DatasourceEditorForm(props: DatasourceEditorFormProps): JSX.Element;
13
+ export declare function DatasourceEditorForm(props: DatasourceEditorFormProps): import("react/jsx-runtime").JSX.Element;
14
14
  export {};
15
15
  //# sourceMappingURL=DatasourceEditorForm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DatasourceEditorForm.d.ts","sourceRoot":"","sources":["../../../src/components/DatasourceEditorForm/DatasourceEditorForm.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,qBAAqB,EAAyB,MAAM,OAAO,CAAC;AA2BrE,UAAU,yBAAyB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,cAAc,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IACrD,OAAO,EAAE,qBAAqB,CAAC;IAC/B,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAClC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,eAwOpE"}
1
+ {"version":3,"file":"DatasourceEditorForm.d.ts","sourceRoot":"","sources":["../../../src/components/DatasourceEditorForm/DatasourceEditorForm.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,qBAAqB,EAAyB,MAAM,OAAO,CAAC;AA2BrE,UAAU,yBAAyB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,cAAc,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IACrD,OAAO,EAAE,qBAAqB,CAAC;IAC/B,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAClC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,2CAwOpE"}