@perses-dev/plugin-system 0.0.0-snapshot-scatterplot-fix-imports-95e1b59 → 0.0.0-snapshot-histogram-types-78c5104

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 (401) hide show
  1. package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +82 -162
  2. package/dist/cjs/components/DatasourceSelect.js +8 -13
  3. package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +534 -0
  4. package/dist/cjs/components/{TimeSeriesQueryEditor → HTTPSettingsEditor}/index.js +2 -2
  5. package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +8 -7
  6. package/dist/cjs/components/MetricLabelInput/MetricLabelInput.js +41 -0
  7. package/dist/cjs/components/{TraceQueryEditor → MetricLabelInput}/index.js +2 -2
  8. package/dist/cjs/components/{TimeSeriesQueryEditor/TimeSeriesQueryEditor.js → MultiQueryEditor/MultiQueryEditor.js} +30 -23
  9. package/dist/cjs/components/{TimeSeriesQueryEditor/TimeSeriesQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +25 -13
  10. package/dist/cjs/{stories/shared-utils → components/MultiQueryEditor}/index.js +2 -2
  11. package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +51 -59
  12. package/dist/cjs/components/PluginEditor/PluginEditor.js +16 -13
  13. package/dist/cjs/components/PluginEditor/plugin-editor-api.js +43 -32
  14. package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +55 -7
  15. package/dist/cjs/components/PluginRegistry/PluginRegistry.js +8 -9
  16. package/dist/cjs/components/PluginRegistry/plugin-indexes.js +17 -14
  17. package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +1 -1
  18. package/dist/cjs/components/ProjectSelect.js +5 -5
  19. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +10 -71
  20. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +391 -442
  21. package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +7 -7
  22. package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +6 -11
  23. package/dist/cjs/components/Variables/variable-model.js +26 -27
  24. package/dist/cjs/components/index.js +3 -1
  25. package/dist/cjs/context/ProjectStoreProvider.js +7 -4
  26. package/dist/cjs/context/ValidationProvider.js +69 -0
  27. package/dist/cjs/context/index.js +1 -0
  28. package/dist/cjs/index.js +1 -1
  29. package/dist/{components/TimeSeriesQueryEditor/index.js → cjs/model/explore.js} +4 -3
  30. package/dist/cjs/remote/PersesPlugin.types.js +16 -0
  31. package/dist/cjs/remote/PluginLoaderComponent.js +75 -0
  32. package/dist/cjs/remote/PluginRuntime.js +273 -0
  33. package/dist/cjs/{validation → remote}/index.js +2 -5
  34. package/dist/cjs/remote/remotePluginLoader.js +61 -0
  35. package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +18 -9
  36. package/dist/cjs/runtime/DataQueriesProvider/model.js +10 -9
  37. package/dist/cjs/{stories/shared-utils/decorators/WithPluginRegistry.js → runtime/QueryCountProvider.js} +22 -39
  38. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +17 -4
  39. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +100 -0
  40. package/dist/cjs/runtime/TimeRangeProvider/index.js +2 -1
  41. package/dist/cjs/runtime/TimeRangeProvider/query-params.js +4 -7
  42. package/dist/cjs/runtime/UsageMetricsProvider.js +99 -0
  43. package/dist/cjs/runtime/builtin-variables.js +2 -2
  44. package/dist/cjs/runtime/datasources.js +23 -14
  45. package/dist/cjs/runtime/index.js +4 -2
  46. package/dist/cjs/runtime/plugin-registry.js +49 -28
  47. package/dist/cjs/runtime/time-series-queries.js +23 -28
  48. package/dist/cjs/runtime/trace-queries.js +1 -2
  49. package/dist/cjs/runtime/{template-variables.js → variables.js} +29 -47
  50. package/dist/cjs/test/mock-data.js +25 -4
  51. package/dist/cjs/test/render.js +2 -11
  52. package/dist/cjs/test/test-plugins/bert/index.js +20 -19
  53. package/dist/cjs/test-utils/mock-plugin-registry.js +10 -10
  54. package/dist/cjs/utils/variables.js +24 -24
  55. package/dist/components/CalculationSelector/CalculationSelector.d.ts +2 -1
  56. package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
  57. package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
  58. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +6 -5
  59. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
  60. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +85 -165
  61. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
  62. package/dist/components/DatasourceSelect.d.ts +5 -4
  63. package/dist/components/DatasourceSelect.d.ts.map +1 -1
  64. package/dist/components/DatasourceSelect.js +8 -13
  65. package/dist/components/DatasourceSelect.js.map +1 -1
  66. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +11 -0
  67. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -0
  68. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +480 -0
  69. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -0
  70. package/dist/components/HTTPSettingsEditor/index.d.ts +2 -0
  71. package/dist/components/HTTPSettingsEditor/index.d.ts.map +1 -0
  72. package/dist/components/HTTPSettingsEditor/index.js +15 -0
  73. package/dist/components/HTTPSettingsEditor/index.js.map +1 -0
  74. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +3 -1
  75. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
  76. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +10 -9
  77. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
  78. package/dist/components/MetricLabelInput/MetricLabelInput.d.ts +7 -0
  79. package/dist/components/MetricLabelInput/MetricLabelInput.d.ts.map +1 -0
  80. package/dist/components/MetricLabelInput/MetricLabelInput.js +33 -0
  81. package/dist/components/MetricLabelInput/MetricLabelInput.js.map +1 -0
  82. package/dist/components/MetricLabelInput/index.d.ts +2 -0
  83. package/dist/components/MetricLabelInput/index.d.ts.map +1 -0
  84. package/dist/components/MetricLabelInput/index.js +15 -0
  85. package/dist/components/MetricLabelInput/index.js.map +1 -0
  86. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +17 -0
  87. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -0
  88. package/dist/components/{TimeSeriesQueryEditor/TimeSeriesQueryEditor.js → MultiQueryEditor/MultiQueryEditor.js} +37 -23
  89. package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -0
  90. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +29 -0
  91. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -0
  92. package/dist/components/{TraceQueryEditor/TraceQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +35 -12
  93. package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -0
  94. package/dist/components/MultiQueryEditor/index.d.ts +2 -0
  95. package/dist/components/MultiQueryEditor/index.d.ts.map +1 -0
  96. package/dist/components/MultiQueryEditor/index.js +15 -0
  97. package/dist/components/{TraceQueryEditor → MultiQueryEditor}/index.js.map +1 -1
  98. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +2 -2
  99. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
  100. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
  101. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +2 -2
  102. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts.map +1 -1
  103. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
  104. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +3 -3
  105. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
  106. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
  107. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +5 -2
  108. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
  109. package/dist/components/PanelSpecEditor/PanelSpecEditor.js +53 -61
  110. package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
  111. package/dist/components/PluginEditor/PluginEditor.d.ts +2 -1
  112. package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
  113. package/dist/components/PluginEditor/PluginEditor.js +16 -13
  114. package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
  115. package/dist/components/PluginEditor/plugin-editor-api.d.ts +15 -8
  116. package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
  117. package/dist/components/PluginEditor/plugin-editor-api.js +43 -32
  118. package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
  119. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +10 -4
  120. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
  121. package/dist/components/PluginKindSelect/PluginKindSelect.js +61 -10
  122. package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
  123. package/dist/components/PluginRegistry/PluginRegistry.d.ts +2 -2
  124. package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
  125. package/dist/components/PluginRegistry/PluginRegistry.js +8 -9
  126. package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
  127. package/dist/components/PluginRegistry/plugin-indexes.d.ts +4 -4
  128. package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
  129. package/dist/components/PluginRegistry/plugin-indexes.js +17 -14
  130. package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
  131. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +5 -4
  132. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
  133. package/dist/components/PluginSpecEditor/PluginSpecEditor.js +1 -1
  134. package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
  135. package/dist/components/ProjectSelect.d.ts +2 -1
  136. package/dist/components/ProjectSelect.d.ts.map +1 -1
  137. package/dist/components/ProjectSelect.js +5 -5
  138. package/dist/components/ProjectSelect.js.map +1 -1
  139. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +3 -2
  140. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
  141. package/dist/components/TimeRangeControls/TimeRangeControls.js +12 -70
  142. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
  143. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +4 -3
  144. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  145. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +395 -446
  146. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  147. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +3 -2
  148. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
  149. package/dist/components/Variables/VariableEditorForm/VariablePreview.js +7 -7
  150. package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
  151. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +2 -2
  152. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
  153. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +6 -11
  154. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
  155. package/dist/components/Variables/variable-model.d.ts +2 -1
  156. package/dist/components/Variables/variable-model.d.ts.map +1 -1
  157. package/dist/components/Variables/variable-model.js +27 -28
  158. package/dist/components/Variables/variable-model.js.map +1 -1
  159. package/dist/components/index.d.ts +3 -1
  160. package/dist/components/index.d.ts.map +1 -1
  161. package/dist/components/index.js +3 -1
  162. package/dist/components/index.js.map +1 -1
  163. package/dist/context/ProjectStoreProvider.d.ts +4 -4
  164. package/dist/context/ProjectStoreProvider.d.ts.map +1 -1
  165. package/dist/context/ProjectStoreProvider.js +7 -4
  166. package/dist/context/ProjectStoreProvider.js.map +1 -1
  167. package/dist/context/ValidationProvider.d.ts +19 -0
  168. package/dist/context/ValidationProvider.d.ts.map +1 -0
  169. package/dist/context/ValidationProvider.js +52 -0
  170. package/dist/context/ValidationProvider.js.map +1 -0
  171. package/dist/context/index.d.ts +1 -0
  172. package/dist/context/index.d.ts.map +1 -1
  173. package/dist/context/index.js +1 -0
  174. package/dist/context/index.js.map +1 -1
  175. package/dist/context/query-params.d.ts.map +1 -1
  176. package/dist/context/query-params.js.map +1 -1
  177. package/dist/index.d.ts +1 -1
  178. package/dist/index.d.ts.map +1 -1
  179. package/dist/index.js +1 -1
  180. package/dist/index.js.map +1 -1
  181. package/dist/model/explore.d.ts +13 -0
  182. package/dist/model/explore.d.ts.map +1 -0
  183. package/dist/{validation/index.js → model/explore.js} +4 -6
  184. package/dist/model/explore.js.map +1 -0
  185. package/dist/model/legend.d.ts.map +1 -1
  186. package/dist/model/legend.js.map +1 -1
  187. package/dist/model/panels.d.ts +27 -5
  188. package/dist/model/panels.d.ts.map +1 -1
  189. package/dist/model/panels.js.map +1 -1
  190. package/dist/model/plugin-loading.js.map +1 -1
  191. package/dist/model/plugins.d.ts +31 -17
  192. package/dist/model/plugins.d.ts.map +1 -1
  193. package/dist/model/plugins.js.map +1 -1
  194. package/dist/model/time-series-queries.d.ts +2 -1
  195. package/dist/model/time-series-queries.d.ts.map +1 -1
  196. package/dist/model/time-series-queries.js.map +1 -1
  197. package/dist/remote/PersesPlugin.types.d.ts +7 -0
  198. package/dist/remote/PersesPlugin.types.d.ts.map +1 -0
  199. package/dist/{stories/shared-utils/index.js → remote/PersesPlugin.types.js} +3 -3
  200. package/dist/remote/PersesPlugin.types.js.map +1 -0
  201. package/dist/remote/PluginLoaderComponent.d.ts +10 -0
  202. package/dist/remote/PluginLoaderComponent.d.ts.map +1 -0
  203. package/dist/remote/PluginLoaderComponent.js +67 -0
  204. package/dist/remote/PluginLoaderComponent.js.map +1 -0
  205. package/dist/remote/PluginRuntime.d.ts +10 -0
  206. package/dist/remote/PluginRuntime.d.ts.map +1 -0
  207. package/dist/remote/PluginRuntime.js +211 -0
  208. package/dist/remote/PluginRuntime.js.map +1 -0
  209. package/dist/remote/index.d.ts +3 -0
  210. package/dist/remote/index.d.ts.map +1 -0
  211. package/dist/{components/TraceQueryEditor → remote}/index.js +2 -1
  212. package/dist/remote/index.js.map +1 -0
  213. package/dist/remote/remotePluginLoader.d.ts +3 -0
  214. package/dist/remote/remotePluginLoader.d.ts.map +1 -0
  215. package/dist/remote/remotePluginLoader.js +53 -0
  216. package/dist/remote/remotePluginLoader.js.map +1 -0
  217. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +2 -2
  218. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
  219. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +18 -9
  220. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
  221. package/dist/runtime/DataQueriesProvider/model.d.ts +5 -6
  222. package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
  223. package/dist/runtime/DataQueriesProvider/model.js +10 -9
  224. package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
  225. package/dist/runtime/QueryCountProvider.d.ts +9 -0
  226. package/dist/runtime/QueryCountProvider.d.ts.map +1 -0
  227. package/dist/{validation/duration.js → runtime/QueryCountProvider.js} +13 -4
  228. package/dist/runtime/QueryCountProvider.js.map +1 -0
  229. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +2 -2
  230. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
  231. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +17 -4
  232. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
  233. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts +2 -2
  234. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts.map +1 -1
  235. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js.map +1 -1
  236. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +32 -0
  237. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -0
  238. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +82 -0
  239. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -0
  240. package/dist/runtime/TimeRangeProvider/index.d.ts +1 -0
  241. package/dist/runtime/TimeRangeProvider/index.d.ts.map +1 -1
  242. package/dist/runtime/TimeRangeProvider/index.js +2 -1
  243. package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
  244. package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
  245. package/dist/runtime/TimeRangeProvider/query-params.js +4 -7
  246. package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
  247. package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts.map +1 -1
  248. package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -1
  249. package/dist/runtime/UsageMetricsProvider.d.ts +25 -0
  250. package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -0
  251. package/dist/runtime/UsageMetricsProvider.js +77 -0
  252. package/dist/runtime/UsageMetricsProvider.js.map +1 -0
  253. package/dist/runtime/builtin-variables.d.ts +1 -1
  254. package/dist/runtime/builtin-variables.d.ts.map +1 -1
  255. package/dist/runtime/builtin-variables.js +2 -2
  256. package/dist/runtime/builtin-variables.js.map +1 -1
  257. package/dist/runtime/datasources.d.ts +5 -4
  258. package/dist/runtime/datasources.d.ts.map +1 -1
  259. package/dist/runtime/datasources.js +23 -14
  260. package/dist/runtime/datasources.js.map +1 -1
  261. package/dist/runtime/index.d.ts +3 -1
  262. package/dist/runtime/index.d.ts.map +1 -1
  263. package/dist/runtime/index.js +4 -2
  264. package/dist/runtime/index.js.map +1 -1
  265. package/dist/runtime/plugin-registry.d.ts +10 -10
  266. package/dist/runtime/plugin-registry.d.ts.map +1 -1
  267. package/dist/runtime/plugin-registry.js +49 -28
  268. package/dist/runtime/plugin-registry.js.map +1 -1
  269. package/dist/runtime/time-series-queries.d.ts +5 -4
  270. package/dist/runtime/time-series-queries.d.ts.map +1 -1
  271. package/dist/runtime/time-series-queries.js +23 -28
  272. package/dist/runtime/time-series-queries.js.map +1 -1
  273. package/dist/runtime/trace-queries.d.ts +4 -3
  274. package/dist/runtime/trace-queries.d.ts.map +1 -1
  275. package/dist/runtime/trace-queries.js +2 -3
  276. package/dist/runtime/trace-queries.js.map +1 -1
  277. package/dist/runtime/{template-variables.d.ts → variables.d.ts} +4 -4
  278. package/dist/runtime/variables.d.ts.map +1 -0
  279. package/dist/runtime/{template-variables.js → variables.js} +28 -45
  280. package/dist/runtime/variables.js.map +1 -0
  281. package/dist/test/mock-data.d.ts.map +1 -1
  282. package/dist/test/mock-data.js +25 -4
  283. package/dist/test/mock-data.js.map +1 -1
  284. package/dist/test/render.d.ts +3 -3
  285. package/dist/test/render.d.ts.map +1 -1
  286. package/dist/test/render.js +2 -11
  287. package/dist/test/render.js.map +1 -1
  288. package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
  289. package/dist/test/test-plugins/bert/index.js +20 -19
  290. package/dist/test/test-plugins/bert/index.js.map +1 -1
  291. package/dist/test-utils/mock-plugin-registry.d.ts +5 -3
  292. package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
  293. package/dist/test-utils/mock-plugin-registry.js +10 -10
  294. package/dist/test-utils/mock-plugin-registry.js.map +1 -1
  295. package/dist/utils/variables.d.ts +4 -4
  296. package/dist/utils/variables.d.ts.map +1 -1
  297. package/dist/utils/variables.js +19 -19
  298. package/dist/utils/variables.js.map +1 -1
  299. package/package.json +10 -11
  300. package/dist/cjs/components/TraceQueryEditor/TraceQueryEditor.js +0 -143
  301. package/dist/cjs/components/TraceQueryEditor/TraceQueryInput.js +0 -96
  302. package/dist/cjs/stories/shared-utils/decorators/WithDataQueries.js +0 -41
  303. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +0 -42
  304. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +0 -101
  305. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js +0 -42
  306. package/dist/cjs/stories/shared-utils/decorators/WithTimeRange.js +0 -41
  307. package/dist/cjs/stories/shared-utils/decorators/index.js +0 -35
  308. package/dist/cjs/validation/datasource.js +0 -30
  309. package/dist/cjs/validation/duration.js +0 -25
  310. package/dist/cjs/validation/resource.js +0 -24
  311. package/dist/cjs/validation/role.js +0 -86
  312. package/dist/cjs/validation/rolebinding.js +0 -55
  313. package/dist/cjs/validation/secret.js +0 -176
  314. package/dist/cjs/validation/user.js +0 -46
  315. package/dist/cjs/validation/variable.js +0 -48
  316. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts +0 -7
  317. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts.map +0 -1
  318. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +0 -1
  319. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts +0 -12
  320. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts.map +0 -1
  321. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +0 -83
  322. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +0 -1
  323. package/dist/components/TimeSeriesQueryEditor/index.d.ts +0 -2
  324. package/dist/components/TimeSeriesQueryEditor/index.d.ts.map +0 -1
  325. package/dist/components/TimeSeriesQueryEditor/index.js.map +0 -1
  326. package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts +0 -8
  327. package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts.map +0 -1
  328. package/dist/components/TraceQueryEditor/TraceQueryEditor.js +0 -130
  329. package/dist/components/TraceQueryEditor/TraceQueryEditor.js.map +0 -1
  330. package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts +0 -12
  331. package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts.map +0 -1
  332. package/dist/components/TraceQueryEditor/TraceQueryInput.js.map +0 -1
  333. package/dist/components/TraceQueryEditor/index.d.ts +0 -2
  334. package/dist/components/TraceQueryEditor/index.d.ts.map +0 -1
  335. package/dist/runtime/template-variables.d.ts.map +0 -1
  336. package/dist/runtime/template-variables.js.map +0 -1
  337. package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts +0 -12
  338. package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts.map +0 -1
  339. package/dist/stories/shared-utils/decorators/WithDataQueries.js +0 -33
  340. package/dist/stories/shared-utils/decorators/WithDataQueries.js.map +0 -1
  341. package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts +0 -3
  342. package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts.map +0 -1
  343. package/dist/stories/shared-utils/decorators/WithPluginRegistry.js +0 -46
  344. package/dist/stories/shared-utils/decorators/WithPluginRegistry.js.map +0 -1
  345. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts +0 -12
  346. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts.map +0 -1
  347. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +0 -39
  348. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js.map +0 -1
  349. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts +0 -12
  350. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts.map +0 -1
  351. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +0 -95
  352. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js.map +0 -1
  353. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts +0 -12
  354. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts.map +0 -1
  355. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js +0 -39
  356. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js.map +0 -1
  357. package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts +0 -12
  358. package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts.map +0 -1
  359. package/dist/stories/shared-utils/decorators/WithTimeRange.js +0 -33
  360. package/dist/stories/shared-utils/decorators/WithTimeRange.js.map +0 -1
  361. package/dist/stories/shared-utils/decorators/index.d.ts +0 -7
  362. package/dist/stories/shared-utils/decorators/index.d.ts.map +0 -1
  363. package/dist/stories/shared-utils/decorators/index.js +0 -20
  364. package/dist/stories/shared-utils/decorators/index.js.map +0 -1
  365. package/dist/stories/shared-utils/index.d.ts +0 -2
  366. package/dist/stories/shared-utils/index.d.ts.map +0 -1
  367. package/dist/stories/shared-utils/index.js.map +0 -1
  368. package/dist/validation/datasource.d.ts +0 -19
  369. package/dist/validation/datasource.d.ts.map +0 -1
  370. package/dist/validation/datasource.js +0 -22
  371. package/dist/validation/datasource.js.map +0 -1
  372. package/dist/validation/duration.d.ts +0 -3
  373. package/dist/validation/duration.d.ts.map +0 -1
  374. package/dist/validation/duration.js.map +0 -1
  375. package/dist/validation/index.d.ts +0 -6
  376. package/dist/validation/index.d.ts.map +0 -1
  377. package/dist/validation/index.js.map +0 -1
  378. package/dist/validation/resource.d.ts +0 -3
  379. package/dist/validation/resource.d.ts.map +0 -1
  380. package/dist/validation/resource.js +0 -16
  381. package/dist/validation/resource.js.map +0 -1
  382. package/dist/validation/role.d.ts +0 -228
  383. package/dist/validation/role.d.ts.map +0 -1
  384. package/dist/validation/role.js +0 -67
  385. package/dist/validation/role.js.map +0 -1
  386. package/dist/validation/rolebinding.d.ts +0 -137
  387. package/dist/validation/rolebinding.d.ts.map +0 -1
  388. package/dist/validation/rolebinding.js +0 -47
  389. package/dist/validation/rolebinding.js.map +0 -1
  390. package/dist/validation/secret.d.ts +0 -964
  391. package/dist/validation/secret.d.ts.map +0 -1
  392. package/dist/validation/secret.js +0 -157
  393. package/dist/validation/secret.js.map +0 -1
  394. package/dist/validation/user.d.ts +0 -93
  395. package/dist/validation/user.d.ts.map +0 -1
  396. package/dist/validation/user.js +0 -38
  397. package/dist/validation/user.js.map +0 -1
  398. package/dist/validation/variable.d.ts +0 -96
  399. package/dist/validation/variable.d.ts.map +0 -1
  400. package/dist/validation/variable.js +0 -40
  401. package/dist/validation/variable.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"TimeRangeControls.d.ts","sourceRoot":"","sources":["../../../src/components/TimeRangeControls/TimeRangeControls.tsx"],"names":[],"mappings":"AAeA,OAAO,EAIL,UAAU,EAEX,MAAM,wBAAwB,CAAC;AAMhC,eAAO,MAAM,0BAA0B,EAAE,UAAU,EAUlD,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,UAAU,EAOxD,CAAC;AAIF,UAAU,sBAAsB;IAE9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;CAC5B;AAED,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,qBAA4B,EAC5B,iBAAwB,EACxB,mBAA0B,EAC1B,WAAwC,GACzC,EAAE,sBAAsB,2CAiDxB"}
1
+ {"version":3,"file":"TimeRangeControls.d.ts","sourceRoot":"","sources":["../../../src/components/TimeRangeControls/TimeRangeControls.tsx"],"names":[],"mappings":"AAeA,OAAO,EAGL,UAAU,EAIX,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,YAAY,EAAe,MAAM,OAAO,CAAC;AAIlD,eAAO,MAAM,gCAAgC,EAAE,UAAU,EAOxD,CAAC;AAIF,UAAU,sBAAsB;IAE9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;CAC5B;AAED,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,qBAA4B,EAC5B,iBAAwB,EACxB,mBAA0B,EAC1B,mBAAmB,EACnB,WAAW,GACZ,EAAE,sBAAsB,GAAG,YAAY,CAuDvC"}
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright 2024 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -13,66 +13,10 @@
13
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  import RefreshIcon from 'mdi-material-ui/Refresh';
15
15
  import { Stack } from '@mui/material';
16
- import { DateTimeRangePicker, RefreshIntervalPicker, InfoTooltip, ToolbarIconButton } from '@perses-dev/components';
16
+ import { RefreshIntervalPicker, InfoTooltip, ToolbarIconButton, TimeRangeSelector, buildRelativeTimeOption } from '@perses-dev/components';
17
17
  import { useCallback } from 'react';
18
18
  import { TOOLTIP_TEXT } from '../../constants';
19
- import { useTimeRange } from '../../runtime';
20
- export const DEFAULT_TIME_RANGE_OPTIONS = [
21
- {
22
- value: {
23
- pastDuration: '5m'
24
- },
25
- display: 'Last 5 minutes'
26
- },
27
- {
28
- value: {
29
- pastDuration: '15m'
30
- },
31
- display: 'Last 15 minutes'
32
- },
33
- {
34
- value: {
35
- pastDuration: '30m'
36
- },
37
- display: 'Last 30 minutes'
38
- },
39
- {
40
- value: {
41
- pastDuration: '1h'
42
- },
43
- display: 'Last 1 hour'
44
- },
45
- {
46
- value: {
47
- pastDuration: '6h'
48
- },
49
- display: 'Last 6 hours'
50
- },
51
- {
52
- value: {
53
- pastDuration: '12h'
54
- },
55
- display: 'Last 12 hours'
56
- },
57
- {
58
- value: {
59
- pastDuration: '24h'
60
- },
61
- display: 'Last 1 day'
62
- },
63
- {
64
- value: {
65
- pastDuration: '7d'
66
- },
67
- display: 'Last 7 days'
68
- },
69
- {
70
- value: {
71
- pastDuration: '14d'
72
- },
73
- display: 'Last 14 days'
74
- }
75
- ];
19
+ import { useTimeRange, useShowCustomTimeRangeSetting, useTimeRangeOptionsSetting } from '../../runtime';
76
20
  export const DEFAULT_REFRESH_INTERVAL_OPTIONS = [
77
21
  {
78
22
  value: {
@@ -112,18 +56,15 @@ export const DEFAULT_REFRESH_INTERVAL_OPTIONS = [
112
56
  }
113
57
  ];
114
58
  const DEFAULT_HEIGHT = '34px';
115
- export function TimeRangeControls({ heightPx, showTimeRangeSelector = true, showRefreshButton = true, showRefreshInterval = true, timePresets = DEFAULT_TIME_RANGE_OPTIONS }) {
59
+ export function TimeRangeControls({ heightPx, showTimeRangeSelector = true, showRefreshButton = true, showRefreshInterval = true, showCustomTimeRange, timePresets }) {
116
60
  const { timeRange, setTimeRange, refresh, refreshInterval, setRefreshInterval } = useTimeRange();
61
+ const showCustomTimeRangeValue = useShowCustomTimeRangeSetting(showCustomTimeRange);
62
+ const timePresetsValue = useTimeRangeOptionsSetting(timePresets);
117
63
  // Convert height to a string, then use the string for styling
118
64
  const height = heightPx === undefined ? DEFAULT_HEIGHT : `${heightPx}px`;
119
65
  // add time preset if one does not match duration given in time range
120
- if ('pastDuration' in timeRange && !timePresets.some((option)=>option.value.pastDuration === timeRange['pastDuration'])) {
121
- timePresets.push({
122
- value: {
123
- pastDuration: timeRange['pastDuration']
124
- },
125
- display: `Last ${timeRange['pastDuration']}`
126
- });
66
+ if ('pastDuration' in timeRange && !timePresetsValue.some((option)=>option.value.pastDuration === timeRange['pastDuration'])) {
67
+ timePresetsValue.push(buildRelativeTimeOption(timeRange['pastDuration']));
127
68
  }
128
69
  // set the new refresh interval both in the dashboard context & as query param
129
70
  const handleRefreshIntervalChange = useCallback((duration)=>{
@@ -135,11 +76,12 @@ export function TimeRangeControls({ heightPx, showTimeRangeSelector = true, show
135
76
  direction: "row",
136
77
  spacing: 1,
137
78
  children: [
138
- showTimeRangeSelector && /*#__PURE__*/ _jsx(DateTimeRangePicker, {
139
- timeOptions: timePresets,
79
+ showTimeRangeSelector && /*#__PURE__*/ _jsx(TimeRangeSelector, {
80
+ timeOptions: timePresetsValue,
140
81
  value: timeRange,
141
82
  onChange: setTimeRange,
142
- height: height
83
+ height: height,
84
+ showCustomTimeRange: showCustomTimeRangeValue
143
85
  }),
144
86
  showRefreshButton && /*#__PURE__*/ _jsx(InfoTooltip, {
145
87
  description: TOOLTIP_TEXT.refresh,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/TimeRangeControls/TimeRangeControls.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 RefreshIcon from 'mdi-material-ui/Refresh';\nimport { Stack } from '@mui/material';\nimport {\n DateTimeRangePicker,\n RefreshIntervalPicker,\n InfoTooltip,\n TimeOption,\n ToolbarIconButton,\n} from '@perses-dev/components';\nimport { DurationString } from '@perses-dev/core';\nimport { useCallback } from 'react';\nimport { TOOLTIP_TEXT } from '../../constants';\nimport { useTimeRange } from '../../runtime';\n\nexport const DEFAULT_TIME_RANGE_OPTIONS: TimeOption[] = [\n { value: { pastDuration: '5m' }, display: 'Last 5 minutes' },\n { value: { pastDuration: '15m' }, display: 'Last 15 minutes' },\n { value: { pastDuration: '30m' }, display: 'Last 30 minutes' },\n { value: { pastDuration: '1h' }, display: 'Last 1 hour' },\n { value: { pastDuration: '6h' }, display: 'Last 6 hours' },\n { value: { pastDuration: '12h' }, display: 'Last 12 hours' },\n { value: { pastDuration: '24h' }, display: 'Last 1 day' },\n { value: { pastDuration: '7d' }, display: 'Last 7 days' },\n { value: { pastDuration: '14d' }, display: 'Last 14 days' },\n];\n\nexport const DEFAULT_REFRESH_INTERVAL_OPTIONS: TimeOption[] = [\n { value: { pastDuration: '0s' }, display: 'Off' },\n { value: { pastDuration: '5s' }, display: '5s' },\n { value: { pastDuration: '10s' }, display: '10s' },\n { value: { pastDuration: '15s' }, display: '15s' },\n { value: { pastDuration: '30s' }, display: '30s' },\n { value: { pastDuration: '60s' }, display: '1m' },\n];\n\nconst DEFAULT_HEIGHT = '34px';\n\ninterface TimeRangeControlsProps {\n // The controls look best at heights >= 28 pixels\n heightPx?: number;\n showTimeRangeSelector?: boolean;\n showRefreshButton?: boolean;\n showRefreshInterval?: boolean;\n timePresets?: TimeOption[];\n}\n\nexport function TimeRangeControls({\n heightPx,\n showTimeRangeSelector = true,\n showRefreshButton = true,\n showRefreshInterval = true,\n timePresets = DEFAULT_TIME_RANGE_OPTIONS,\n}: TimeRangeControlsProps) {\n const { timeRange, setTimeRange, refresh, refreshInterval, setRefreshInterval } = useTimeRange();\n\n // Convert height to a string, then use the string for styling\n const height = heightPx === undefined ? DEFAULT_HEIGHT : `${heightPx}px`;\n\n // add time preset if one does not match duration given in time range\n if (\n 'pastDuration' in timeRange &&\n !timePresets.some((option) => option.value.pastDuration === timeRange['pastDuration'])\n ) {\n timePresets.push({\n value: { pastDuration: timeRange['pastDuration'] },\n display: `Last ${timeRange['pastDuration']}`,\n });\n }\n\n // set the new refresh interval both in the dashboard context & as query param\n const handleRefreshIntervalChange = useCallback(\n (duration: DurationString) => {\n setRefreshInterval(duration);\n },\n [setRefreshInterval]\n );\n\n return (\n <Stack direction=\"row\" spacing={1}>\n {showTimeRangeSelector && (\n <DateTimeRangePicker timeOptions={timePresets} value={timeRange} onChange={setTimeRange} height={height} />\n )}\n {showRefreshButton && (\n <InfoTooltip description={TOOLTIP_TEXT.refresh}>\n <ToolbarIconButton aria-label={TOOLTIP_TEXT.refresh} onClick={refresh} sx={{ height }}>\n <RefreshIcon />\n </ToolbarIconButton>\n </InfoTooltip>\n )}\n {showRefreshInterval && (\n <InfoTooltip description={TOOLTIP_TEXT.refreshInterval}>\n <RefreshIntervalPicker\n timeOptions={DEFAULT_REFRESH_INTERVAL_OPTIONS}\n value={refreshInterval}\n onChange={handleRefreshIntervalChange}\n height={height}\n />\n </InfoTooltip>\n )}\n </Stack>\n );\n}\n"],"names":["RefreshIcon","Stack","DateTimeRangePicker","RefreshIntervalPicker","InfoTooltip","ToolbarIconButton","useCallback","TOOLTIP_TEXT","useTimeRange","DEFAULT_TIME_RANGE_OPTIONS","value","pastDuration","display","DEFAULT_REFRESH_INTERVAL_OPTIONS","DEFAULT_HEIGHT","TimeRangeControls","heightPx","showTimeRangeSelector","showRefreshButton","showRefreshInterval","timePresets","timeRange","setTimeRange","refresh","refreshInterval","setRefreshInterval","height","undefined","some","option","push","handleRefreshIntervalChange","duration","direction","spacing","timeOptions","onChange","description","aria-label","onClick","sx"],"mappings":"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"}
1
+ {"version":3,"sources":["../../../src/components/TimeRangeControls/TimeRangeControls.tsx"],"sourcesContent":["// Copyright 2024 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 RefreshIcon from 'mdi-material-ui/Refresh';\nimport { Stack } from '@mui/material';\nimport {\n RefreshIntervalPicker,\n InfoTooltip,\n TimeOption,\n ToolbarIconButton,\n TimeRangeSelector,\n buildRelativeTimeOption,\n} from '@perses-dev/components';\nimport { DurationString } from '@perses-dev/core';\nimport { ReactElement, useCallback } from 'react';\nimport { TOOLTIP_TEXT } from '../../constants';\nimport { useTimeRange, useShowCustomTimeRangeSetting, useTimeRangeOptionsSetting } from '../../runtime';\n\nexport const DEFAULT_REFRESH_INTERVAL_OPTIONS: TimeOption[] = [\n { value: { pastDuration: '0s' }, display: 'Off' },\n { value: { pastDuration: '5s' }, display: '5s' },\n { value: { pastDuration: '10s' }, display: '10s' },\n { value: { pastDuration: '15s' }, display: '15s' },\n { value: { pastDuration: '30s' }, display: '30s' },\n { value: { pastDuration: '60s' }, display: '1m' },\n];\n\nconst DEFAULT_HEIGHT = '34px';\n\ninterface TimeRangeControlsProps {\n // The controls look best at heights >= 28 pixels\n heightPx?: number;\n showTimeRangeSelector?: boolean;\n showRefreshButton?: boolean;\n showRefreshInterval?: boolean;\n showCustomTimeRange?: boolean;\n timePresets?: TimeOption[];\n}\n\nexport function TimeRangeControls({\n heightPx,\n showTimeRangeSelector = true,\n showRefreshButton = true,\n showRefreshInterval = true,\n showCustomTimeRange,\n timePresets,\n}: TimeRangeControlsProps): ReactElement {\n const { timeRange, setTimeRange, refresh, refreshInterval, setRefreshInterval } = useTimeRange();\n\n const showCustomTimeRangeValue = useShowCustomTimeRangeSetting(showCustomTimeRange);\n const timePresetsValue = useTimeRangeOptionsSetting(timePresets);\n\n // Convert height to a string, then use the string for styling\n const height = heightPx === undefined ? DEFAULT_HEIGHT : `${heightPx}px`;\n\n // add time preset if one does not match duration given in time range\n if (\n 'pastDuration' in timeRange &&\n !timePresetsValue.some((option) => option.value.pastDuration === timeRange['pastDuration'])\n ) {\n timePresetsValue.push(buildRelativeTimeOption(timeRange['pastDuration']));\n }\n\n // set the new refresh interval both in the dashboard context & as query param\n const handleRefreshIntervalChange = useCallback(\n (duration: DurationString) => {\n setRefreshInterval(duration);\n },\n [setRefreshInterval]\n );\n\n return (\n <Stack direction=\"row\" spacing={1}>\n {showTimeRangeSelector && (\n <TimeRangeSelector\n timeOptions={timePresetsValue}\n value={timeRange}\n onChange={setTimeRange}\n height={height}\n showCustomTimeRange={showCustomTimeRangeValue}\n />\n )}\n {showRefreshButton && (\n <InfoTooltip description={TOOLTIP_TEXT.refresh}>\n <ToolbarIconButton aria-label={TOOLTIP_TEXT.refresh} onClick={refresh} sx={{ height }}>\n <RefreshIcon />\n </ToolbarIconButton>\n </InfoTooltip>\n )}\n {showRefreshInterval && (\n <InfoTooltip description={TOOLTIP_TEXT.refreshInterval}>\n <RefreshIntervalPicker\n timeOptions={DEFAULT_REFRESH_INTERVAL_OPTIONS}\n value={refreshInterval}\n onChange={handleRefreshIntervalChange}\n height={height}\n />\n </InfoTooltip>\n )}\n </Stack>\n );\n}\n"],"names":["RefreshIcon","Stack","RefreshIntervalPicker","InfoTooltip","ToolbarIconButton","TimeRangeSelector","buildRelativeTimeOption","useCallback","TOOLTIP_TEXT","useTimeRange","useShowCustomTimeRangeSetting","useTimeRangeOptionsSetting","DEFAULT_REFRESH_INTERVAL_OPTIONS","value","pastDuration","display","DEFAULT_HEIGHT","TimeRangeControls","heightPx","showTimeRangeSelector","showRefreshButton","showRefreshInterval","showCustomTimeRange","timePresets","timeRange","setTimeRange","refresh","refreshInterval","setRefreshInterval","showCustomTimeRangeValue","timePresetsValue","height","undefined","some","option","push","handleRefreshIntervalChange","duration","direction","spacing","timeOptions","onChange","description","aria-label","onClick","sx"],"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,OAAOA,iBAAiB,0BAA0B;AAClD,SAASC,KAAK,QAAQ,gBAAgB;AACtC,SACEC,qBAAqB,EACrBC,WAAW,EAEXC,iBAAiB,EACjBC,iBAAiB,EACjBC,uBAAuB,QAClB,yBAAyB;AAEhC,SAAuBC,WAAW,QAAQ,QAAQ;AAClD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,YAAY,EAAEC,6BAA6B,EAAEC,0BAA0B,QAAQ,gBAAgB;AAExG,OAAO,MAAMC,mCAAiD;IAC5D;QAAEC,OAAO;YAAEC,cAAc;QAAK;QAAGC,SAAS;IAAM;IAChD;QAAEF,OAAO;YAAEC,cAAc;QAAK;QAAGC,SAAS;IAAK;IAC/C;QAAEF,OAAO;YAAEC,cAAc;QAAM;QAAGC,SAAS;IAAM;IACjD;QAAEF,OAAO;YAAEC,cAAc;QAAM;QAAGC,SAAS;IAAM;IACjD;QAAEF,OAAO;YAAEC,cAAc;QAAM;QAAGC,SAAS;IAAM;IACjD;QAAEF,OAAO;YAAEC,cAAc;QAAM;QAAGC,SAAS;IAAK;CACjD,CAAC;AAEF,MAAMC,iBAAiB;AAYvB,OAAO,SAASC,kBAAkB,EAChCC,QAAQ,EACRC,wBAAwB,IAAI,EAC5BC,oBAAoB,IAAI,EACxBC,sBAAsB,IAAI,EAC1BC,mBAAmB,EACnBC,WAAW,EACY;IACvB,MAAM,EAAEC,SAAS,EAAEC,YAAY,EAAEC,OAAO,EAAEC,eAAe,EAAEC,kBAAkB,EAAE,GAAGnB;IAElF,MAAMoB,2BAA2BnB,8BAA8BY;IAC/D,MAAMQ,mBAAmBnB,2BAA2BY;IAEpD,8DAA8D;IAC9D,MAAMQ,SAASb,aAAac,YAAYhB,iBAAiB,GAAGE,SAAS,EAAE,CAAC;IAExE,qEAAqE;IACrE,IACE,kBAAkBM,aAClB,CAACM,iBAAiBG,IAAI,CAAC,CAACC,SAAWA,OAAOrB,KAAK,CAACC,YAAY,KAAKU,SAAS,CAAC,eAAe,GAC1F;QACAM,iBAAiBK,IAAI,CAAC7B,wBAAwBkB,SAAS,CAAC,eAAe;IACzE;IAEA,8EAA8E;IAC9E,MAAMY,8BAA8B7B,YAClC,CAAC8B;QACCT,mBAAmBS;IACrB,GACA;QAACT;KAAmB;IAGtB,qBACE,MAAC3B;QAAMqC,WAAU;QAAMC,SAAS;;YAC7BpB,uCACC,KAACd;gBACCmC,aAAaV;gBACbjB,OAAOW;gBACPiB,UAAUhB;gBACVM,QAAQA;gBACRT,qBAAqBO;;YAGxBT,mCACC,KAACjB;gBAAYuC,aAAalC,aAAakB,OAAO;0BAC5C,cAAA,KAACtB;oBAAkBuC,cAAYnC,aAAakB,OAAO;oBAAEkB,SAASlB;oBAASmB,IAAI;wBAAEd;oBAAO;8BAClF,cAAA,KAAC/B;;;YAINqB,qCACC,KAAClB;gBAAYuC,aAAalC,aAAamB,eAAe;0BACpD,cAAA,KAACzB;oBACCsC,aAAa5B;oBACbC,OAAOc;oBACPc,UAAUL;oBACVL,QAAQA;;;;;AAMpB"}
@@ -1,14 +1,15 @@
1
- import { DispatchWithoutAction } from 'react';
1
+ import { DispatchWithoutAction, ReactElement } from 'react';
2
2
  import { VariableDefinition, Action } from '@perses-dev/core';
3
3
  interface VariableEditorFormProps {
4
4
  initialVariableDefinition: VariableDefinition;
5
- initialAction: Action;
5
+ action: Action;
6
6
  isDraft: boolean;
7
7
  isReadonly?: boolean;
8
+ onActionChange?: (action: Action) => void;
8
9
  onSave: (def: VariableDefinition) => void;
9
10
  onClose: () => void;
10
11
  onDelete?: DispatchWithoutAction;
11
12
  }
12
- export declare function VariableEditorForm(props: VariableEditorFormProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function VariableEditorForm({ initialVariableDefinition, action, isDraft, isReadonly, onActionChange, onSave, onClose, onDelete, }: VariableEditorFormProps): ReactElement;
13
14
  export {};
14
15
  //# sourceMappingURL=VariableEditorForm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VariableEditorForm.d.ts","sourceRoot":"","sources":["../../../../src/components/Variables/VariableEditorForm/VariableEditorForm.tsx"],"names":[],"mappings":"AAaA,OAAc,EAAE,qBAAqB,EAAkC,MAAM,OAAO,CAAC;AAcrF,OAAO,EAAE,kBAAkB,EAA0B,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAgBtF,UAAU,uBAAuB;IAC/B,yBAAyB,EAAE,kBAAkB,CAAC;IAC9C,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAClC;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CAqfhE"}
1
+ {"version":3,"file":"VariableEditorForm.d.ts","sourceRoot":"","sources":["../../../../src/components/Variables/VariableEditorForm/VariableEditorForm.tsx"],"names":[],"mappings":"AAaA,OAAc,EAAE,qBAAqB,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AAa7E,OAAO,EAAE,kBAAkB,EAA0B,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAsTtF,UAAU,uBAAuB;IAC/B,yBAAyB,EAAE,kBAAkB,CAAC;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,MAAM,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAClC;AAED,wBAAgB,kBAAkB,CAAC,EACjC,yBAAyB,EACzB,MAAM,EACN,OAAO,EACP,UAAU,EACV,cAAc,EACd,MAAM,EACN,OAAO,EACP,QAAQ,GACT,EAAE,uBAAuB,GAAG,YAAY,CAoMxC"}