@perses-dev/plugin-system 0.55.0-beta.3 → 0.55.0-beta.7

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 (555) hide show
  1. package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.d.ts +3 -3
  2. package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.d.ts.map +1 -1
  3. package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js +11 -11
  4. package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js.map +1 -1
  5. package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.d.ts +3 -3
  6. package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.d.ts.map +1 -1
  7. package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.js +6 -6
  8. package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.js.map +1 -1
  9. package/dist/components/Annotations/AnnotationEditorForm/index.js +1 -1
  10. package/dist/components/Annotations/AnnotationEditorForm/index.js.map +1 -1
  11. package/dist/components/Annotations/index.js +2 -2
  12. package/dist/components/Annotations/index.js.map +1 -1
  13. package/dist/components/CalculationSelector/CalculationSelector.d.ts +2 -2
  14. package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
  15. package/dist/components/CalculationSelector/CalculationSelector.js +2 -2
  16. package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
  17. package/dist/components/CalculationSelector/index.js +1 -1
  18. package/dist/components/CalculationSelector/index.js.map +1 -1
  19. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +2 -2
  20. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
  21. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +7 -7
  22. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
  23. package/dist/components/DatasourceEditorForm/index.js +1 -1
  24. package/dist/components/DatasourceEditorForm/index.js.map +1 -1
  25. package/dist/components/DatasourceSelect/DatasourceSelect.d.ts +4 -4
  26. package/dist/components/DatasourceSelect/DatasourceSelect.d.ts.map +1 -1
  27. package/dist/components/DatasourceSelect/DatasourceSelect.js +7 -7
  28. package/dist/components/DatasourceSelect/DatasourceSelect.js.map +1 -1
  29. package/dist/components/DatasourceSelect/index.js +1 -1
  30. package/dist/components/DatasourceSelect/index.js.map +1 -1
  31. package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts +2 -2
  32. package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts.map +1 -1
  33. package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js +4 -4
  34. package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js.map +1 -1
  35. package/dist/components/DatasourceTestConnectionButton/index.js +1 -1
  36. package/dist/components/DatasourceTestConnectionButton/index.js.map +1 -1
  37. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +2 -2
  38. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -1
  39. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +9 -9
  40. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -1
  41. package/dist/components/HTTPSettingsEditor/index.js +1 -1
  42. package/dist/components/HTTPSettingsEditor/index.js.map +1 -1
  43. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.d.ts +1 -1
  44. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.d.ts.map +1 -1
  45. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +28 -28
  46. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js.map +1 -1
  47. package/dist/components/ItemSelectionActionsOptionsEditor/index.js +1 -1
  48. package/dist/components/ItemSelectionActionsOptionsEditor/index.js.map +1 -1
  49. package/dist/components/LayoutEditor/LayoutEditor.d.ts +4 -4
  50. package/dist/components/LayoutEditor/LayoutEditor.d.ts.map +1 -1
  51. package/dist/components/LayoutEditor/LayoutEditor.js +7 -7
  52. package/dist/components/LayoutEditor/LayoutEditor.js.map +1 -1
  53. package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts +1 -1
  54. package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts.map +1 -1
  55. package/dist/components/LayoutEditor/RepeatLayoutPreview.js +4 -4
  56. package/dist/components/LayoutEditor/RepeatLayoutPreview.js.map +1 -1
  57. package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts +4 -4
  58. package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts.map +1 -1
  59. package/dist/components/LayoutEditor/RepeatVariableEditor.js +3 -3
  60. package/dist/components/LayoutEditor/RepeatVariableEditor.js.map +1 -1
  61. package/dist/components/LayoutEditor/index.js +3 -3
  62. package/dist/components/LayoutEditor/index.js.map +1 -1
  63. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +2 -2
  64. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
  65. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +5 -5
  66. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
  67. package/dist/components/LegendOptionsEditor/index.js +1 -1
  68. package/dist/components/LegendOptionsEditor/index.js.map +1 -1
  69. package/dist/components/LinksEditor/LinksEditor.d.ts +3 -3
  70. package/dist/components/LinksEditor/LinksEditor.d.ts.map +1 -1
  71. package/dist/components/LinksEditor/LinksEditor.js +6 -6
  72. package/dist/components/LinksEditor/LinksEditor.js.map +1 -1
  73. package/dist/components/LinksEditor/index.js +1 -1
  74. package/dist/components/LinksEditor/index.js.map +1 -1
  75. package/dist/components/MetricLabelInput/MetricLabelInput.d.ts +1 -1
  76. package/dist/components/MetricLabelInput/MetricLabelInput.d.ts.map +1 -1
  77. package/dist/components/MetricLabelInput/MetricLabelInput.js +2 -2
  78. package/dist/components/MetricLabelInput/MetricLabelInput.js.map +1 -1
  79. package/dist/components/MetricLabelInput/index.js +1 -1
  80. package/dist/components/MetricLabelInput/index.js.map +1 -1
  81. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +3 -3
  82. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -1
  83. package/dist/components/MultiQueryEditor/MultiQueryEditor.js +6 -6
  84. package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -1
  85. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +3 -3
  86. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -1
  87. package/dist/components/MultiQueryEditor/QueryEditorContainer.js +14 -14
  88. package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -1
  89. package/dist/components/MultiQueryEditor/index.js +2 -2
  90. package/dist/components/MultiQueryEditor/index.js.map +1 -1
  91. package/dist/components/MultiQueryEditor/utils.d.ts +1 -1
  92. package/dist/components/MultiQueryEditor/utils.d.ts.map +1 -1
  93. package/dist/components/MultiQueryEditor/utils.js.map +1 -1
  94. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +1 -1
  95. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
  96. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +4 -4
  97. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
  98. package/dist/components/OptionsEditorRadios/index.js +1 -1
  99. package/dist/components/OptionsEditorRadios/index.js.map +1 -1
  100. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +1 -1
  101. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts.map +1 -1
  102. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
  103. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
  104. package/dist/components/OptionsEditorTabPanel/index.js +1 -1
  105. package/dist/components/OptionsEditorTabPanel/index.js.map +1 -1
  106. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +1 -1
  107. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
  108. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +4 -4
  109. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
  110. package/dist/components/OptionsEditorTabs/index.js +1 -1
  111. package/dist/components/OptionsEditorTabs/index.js.map +1 -1
  112. package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.d.ts +2 -2
  113. package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.d.ts.map +1 -1
  114. package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.js +9 -9
  115. package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.js.map +1 -1
  116. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +5 -5
  117. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
  118. package/dist/components/PanelSpecEditor/PanelSpecEditor.js +9 -9
  119. package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
  120. package/dist/components/PanelSpecEditor/index.js +1 -1
  121. package/dist/components/PanelSpecEditor/index.js.map +1 -1
  122. package/dist/components/PluginEditor/PluginEditor.d.ts +2 -2
  123. package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
  124. package/dist/components/PluginEditor/PluginEditor.js +7 -7
  125. package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
  126. package/dist/components/PluginEditor/index.js +2 -2
  127. package/dist/components/PluginEditor/index.js.map +1 -1
  128. package/dist/components/PluginEditor/plugin-editor-api.d.ts +3 -3
  129. package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
  130. package/dist/components/PluginEditor/plugin-editor-api.js +4 -4
  131. package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
  132. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +3 -3
  133. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
  134. package/dist/components/PluginKindSelect/PluginKindSelect.js +6 -6
  135. package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
  136. package/dist/components/PluginKindSelect/index.js +1 -1
  137. package/dist/components/PluginKindSelect/index.js.map +1 -1
  138. package/dist/components/PluginRegistry/PluginRegistry.d.ts +2 -2
  139. package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
  140. package/dist/components/PluginRegistry/PluginRegistry.js +5 -5
  141. package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
  142. package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts +2 -2
  143. package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts.map +1 -1
  144. package/dist/components/PluginRegistry/getPluginSearchHelper.js +2 -2
  145. package/dist/components/PluginRegistry/getPluginSearchHelper.js.map +1 -1
  146. package/dist/components/PluginRegistry/index.js +1 -1
  147. package/dist/components/PluginRegistry/index.js.map +1 -1
  148. package/dist/components/PluginRegistry/plugin-indexes.d.ts +2 -1
  149. package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
  150. package/dist/components/PluginRegistry/plugin-indexes.js +3 -3
  151. package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
  152. package/dist/components/PluginSpecEditor/DatasourceSpecEditor.d.ts +3 -3
  153. package/dist/components/PluginSpecEditor/DatasourceSpecEditor.d.ts.map +1 -1
  154. package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js +3 -3
  155. package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js.map +1 -1
  156. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +4 -4
  157. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
  158. package/dist/components/PluginSpecEditor/PluginSpecEditor.js +4 -4
  159. package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
  160. package/dist/components/PluginSpecEditor/index.js +1 -1
  161. package/dist/components/PluginSpecEditor/index.js.map +1 -1
  162. package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.d.ts +1 -1
  163. package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.d.ts.map +1 -1
  164. package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js +3 -3
  165. package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js.map +1 -1
  166. package/dist/components/SelectionOptionsEditor/index.js +1 -1
  167. package/dist/components/SelectionOptionsEditor/index.js.map +1 -1
  168. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +4 -4
  169. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
  170. package/dist/components/TimeRangeControls/TimeRangeControls.js +15 -51
  171. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
  172. package/dist/components/TimeRangeControls/index.js +1 -1
  173. package/dist/components/TimeRangeControls/index.js.map +1 -1
  174. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +3 -3
  175. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  176. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +11 -11
  177. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  178. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +2 -2
  179. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
  180. package/dist/components/Variables/VariableEditorForm/VariablePreview.js +8 -7
  181. package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
  182. package/dist/components/Variables/VariableEditorForm/index.js +3 -3
  183. package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
  184. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +2 -2
  185. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
  186. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +6 -6
  187. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
  188. package/dist/components/Variables/index.js +2 -2
  189. package/dist/components/Variables/index.js.map +1 -1
  190. package/dist/components/Variables/variable-model.d.ts +4 -4
  191. package/dist/components/Variables/variable-model.d.ts.map +1 -1
  192. package/dist/components/Variables/variable-model.js +3 -3
  193. package/dist/components/Variables/variable-model.js.map +1 -1
  194. package/dist/components/index.js +21 -21
  195. package/dist/components/index.js.map +1 -1
  196. package/dist/constants/index.js +2 -2
  197. package/dist/constants/index.js.map +1 -1
  198. package/dist/context/ValidationProvider.d.ts +5 -5
  199. package/dist/context/ValidationProvider.d.ts.map +1 -1
  200. package/dist/context/ValidationProvider.js +5 -5
  201. package/dist/context/ValidationProvider.js.map +1 -1
  202. package/dist/context/index.js +1 -1
  203. package/dist/context/index.js.map +1 -1
  204. package/dist/index.js +9 -9
  205. package/dist/index.js.map +1 -1
  206. package/dist/model/alerts-queries.d.ts +4 -4
  207. package/dist/model/alerts-queries.d.ts.map +1 -1
  208. package/dist/model/alerts-queries.js.map +1 -1
  209. package/dist/model/annotations.d.ts +3 -3
  210. package/dist/model/annotations.d.ts.map +1 -1
  211. package/dist/model/annotations.js.map +1 -1
  212. package/dist/model/calculations.d.ts +1 -1
  213. package/dist/model/calculations.d.ts.map +1 -1
  214. package/dist/model/calculations.js.map +1 -1
  215. package/dist/model/datasource.d.ts +2 -2
  216. package/dist/model/datasource.d.ts.map +1 -1
  217. package/dist/model/datasource.js.map +1 -1
  218. package/dist/model/explore.d.ts +2 -2
  219. package/dist/model/explore.d.ts.map +1 -1
  220. package/dist/model/explore.js.map +1 -1
  221. package/dist/model/index.js +17 -17
  222. package/dist/model/index.js.map +1 -1
  223. package/dist/model/json-queries.d.ts +3 -3
  224. package/dist/model/json-queries.d.ts.map +1 -1
  225. package/dist/model/json-queries.js.map +1 -1
  226. package/dist/model/legend.d.ts +2 -2
  227. package/dist/model/legend.d.ts.map +1 -1
  228. package/dist/model/legend.js +2 -2
  229. package/dist/model/legend.js.map +1 -1
  230. package/dist/model/log-queries.d.ts +3 -3
  231. package/dist/model/log-queries.d.ts.map +1 -1
  232. package/dist/model/log-queries.js.map +1 -1
  233. package/dist/model/panels.d.ts +4 -4
  234. package/dist/model/panels.d.ts.map +1 -1
  235. package/dist/model/panels.js.map +1 -1
  236. package/dist/model/plugin-base.d.ts +1 -1
  237. package/dist/model/plugin-base.d.ts.map +1 -1
  238. package/dist/model/plugin-base.js.map +1 -1
  239. package/dist/model/plugin-loading.d.ts +1 -1
  240. package/dist/model/plugin-loading.d.ts.map +1 -1
  241. package/dist/model/plugin-loading.js +1 -1
  242. package/dist/model/plugin-loading.js.map +1 -1
  243. package/dist/model/plugins.d.ts +14 -14
  244. package/dist/model/plugins.d.ts.map +1 -1
  245. package/dist/model/plugins.js.map +1 -1
  246. package/dist/model/profile-queries.d.ts +4 -4
  247. package/dist/model/profile-queries.d.ts.map +1 -1
  248. package/dist/model/profile-queries.js.map +1 -1
  249. package/dist/model/silences-queries.d.ts +4 -4
  250. package/dist/model/silences-queries.d.ts.map +1 -1
  251. package/dist/model/silences-queries.js.map +1 -1
  252. package/dist/model/time-series-queries.d.ts +4 -4
  253. package/dist/model/time-series-queries.d.ts.map +1 -1
  254. package/dist/model/time-series-queries.js.map +1 -1
  255. package/dist/model/trace-queries.d.ts +4 -4
  256. package/dist/model/trace-queries.d.ts.map +1 -1
  257. package/dist/model/trace-queries.js.map +1 -1
  258. package/dist/model/variables.d.ts +3 -3
  259. package/dist/model/variables.d.ts.map +1 -1
  260. package/dist/model/variables.js.map +1 -1
  261. package/dist/remote/PluginLoaderComponent.d.ts +1 -1
  262. package/dist/remote/PluginLoaderComponent.d.ts.map +1 -1
  263. package/dist/remote/PluginLoaderComponent.js +2 -2
  264. package/dist/remote/PluginLoaderComponent.js.map +1 -1
  265. package/dist/remote/PluginRuntime.d.ts +11 -2
  266. package/dist/remote/PluginRuntime.d.ts.map +1 -1
  267. package/dist/remote/PluginRuntime.js +65 -54
  268. package/dist/remote/PluginRuntime.js.map +1 -1
  269. package/dist/remote/index.d.ts +1 -0
  270. package/dist/remote/index.d.ts.map +1 -1
  271. package/dist/remote/index.js +3 -2
  272. package/dist/remote/index.js.map +1 -1
  273. package/dist/remote/remotePluginLoader.d.ts +2 -2
  274. package/dist/remote/remotePluginLoader.d.ts.map +1 -1
  275. package/dist/remote/remotePluginLoader.js +3 -3
  276. package/dist/remote/remotePluginLoader.js.map +1 -1
  277. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +3 -3
  278. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
  279. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +10 -10
  280. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
  281. package/dist/runtime/DataQueriesProvider/index.js +2 -2
  282. package/dist/runtime/DataQueriesProvider/index.js.map +1 -1
  283. package/dist/runtime/DataQueriesProvider/model.d.ts +3 -3
  284. package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
  285. package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
  286. package/dist/runtime/RouterProvider.d.ts +2 -1
  287. package/dist/runtime/RouterProvider.d.ts.map +1 -1
  288. package/dist/runtime/RouterProvider.js +3 -3
  289. package/dist/runtime/RouterProvider.js.map +1 -1
  290. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +3 -2
  291. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
  292. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +6 -6
  293. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
  294. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.d.ts +3 -2
  295. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.d.ts.map +1 -1
  296. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js +4 -4
  297. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js.map +1 -1
  298. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +6 -2
  299. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -1
  300. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +52 -4
  301. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -1
  302. package/dist/runtime/TimeRangeProvider/index.js +4 -4
  303. package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
  304. package/dist/runtime/TimeRangeProvider/query-params.d.ts +3 -3
  305. package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
  306. package/dist/runtime/TimeRangeProvider/query-params.js +4 -4
  307. package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
  308. package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts +1 -1
  309. package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts.map +1 -1
  310. package/dist/runtime/TimeRangeProvider/refresh-interval.js +2 -2
  311. package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -1
  312. package/dist/runtime/UsageMetricsProvider.d.ts +3 -3
  313. package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -1
  314. package/dist/runtime/UsageMetricsProvider.js +3 -3
  315. package/dist/runtime/UsageMetricsProvider.js.map +1 -1
  316. package/dist/runtime/alerts-queries.d.ts +2 -2
  317. package/dist/runtime/alerts-queries.d.ts.map +1 -1
  318. package/dist/runtime/alerts-queries.js +5 -5
  319. package/dist/runtime/alerts-queries.js.map +1 -1
  320. package/dist/runtime/annotations.d.ts +2 -2
  321. package/dist/runtime/annotations.d.ts.map +1 -1
  322. package/dist/runtime/annotations.js +6 -6
  323. package/dist/runtime/annotations.js.map +1 -1
  324. package/dist/runtime/builtin-variables.d.ts +2 -2
  325. package/dist/runtime/builtin-variables.d.ts.map +1 -1
  326. package/dist/runtime/builtin-variables.js +1 -1
  327. package/dist/runtime/builtin-variables.js.map +1 -1
  328. package/dist/runtime/datasources.d.ts +2 -2
  329. package/dist/runtime/datasources.d.ts.map +1 -1
  330. package/dist/runtime/datasources.js +2 -2
  331. package/dist/runtime/datasources.js.map +1 -1
  332. package/dist/runtime/index.js +16 -16
  333. package/dist/runtime/index.js.map +1 -1
  334. package/dist/runtime/item-actions.d.ts +3 -3
  335. package/dist/runtime/item-actions.d.ts.map +1 -1
  336. package/dist/runtime/item-actions.js +1 -1
  337. package/dist/runtime/item-actions.js.map +1 -1
  338. package/dist/runtime/json-queries.d.ts +2 -2
  339. package/dist/runtime/json-queries.d.ts.map +1 -1
  340. package/dist/runtime/json-queries.js +4 -4
  341. package/dist/runtime/json-queries.js.map +1 -1
  342. package/dist/runtime/log-queries.d.ts +3 -3
  343. package/dist/runtime/log-queries.d.ts.map +1 -1
  344. package/dist/runtime/log-queries.js +5 -5
  345. package/dist/runtime/log-queries.js.map +1 -1
  346. package/dist/runtime/plugin-registry.d.ts +3 -3
  347. package/dist/runtime/plugin-registry.d.ts.map +1 -1
  348. package/dist/runtime/plugin-registry.js +2 -2
  349. package/dist/runtime/plugin-registry.js.map +1 -1
  350. package/dist/runtime/profile-queries.d.ts +2 -2
  351. package/dist/runtime/profile-queries.d.ts.map +1 -1
  352. package/dist/runtime/profile-queries.js +4 -4
  353. package/dist/runtime/profile-queries.js.map +1 -1
  354. package/dist/runtime/silences-queries.d.ts +2 -2
  355. package/dist/runtime/silences-queries.d.ts.map +1 -1
  356. package/dist/runtime/silences-queries.js +5 -5
  357. package/dist/runtime/silences-queries.js.map +1 -1
  358. package/dist/runtime/time-series-queries.d.ts +3 -3
  359. package/dist/runtime/time-series-queries.d.ts.map +1 -1
  360. package/dist/runtime/time-series-queries.js +6 -6
  361. package/dist/runtime/time-series-queries.js.map +1 -1
  362. package/dist/runtime/trace-queries.d.ts +2 -2
  363. package/dist/runtime/trace-queries.d.ts.map +1 -1
  364. package/dist/runtime/trace-queries.js +6 -6
  365. package/dist/runtime/trace-queries.js.map +1 -1
  366. package/dist/runtime/utils.d.ts +1 -1
  367. package/dist/runtime/utils.d.ts.map +1 -1
  368. package/dist/runtime/utils.js.map +1 -1
  369. package/dist/runtime/variables.d.ts +1 -1
  370. package/dist/runtime/variables.d.ts.map +1 -1
  371. package/dist/runtime/variables.js +4 -4
  372. package/dist/runtime/variables.js.map +1 -1
  373. package/dist/schema/index.js +1 -1
  374. package/dist/schema/index.js.map +1 -1
  375. package/dist/schema/panel.d.ts +2 -2
  376. package/dist/schema/panel.d.ts.map +1 -1
  377. package/dist/schema/panel.js +2 -2
  378. package/dist/schema/panel.js.map +1 -1
  379. package/dist/test/index.js +2 -2
  380. package/dist/test/index.js.map +1 -1
  381. package/dist/test/mock-data.d.ts +1 -1
  382. package/dist/test/mock-data.d.ts.map +1 -1
  383. package/dist/test/mock-data.js.map +1 -1
  384. package/dist/test/render-hook.d.ts +2 -2
  385. package/dist/test/render-hook.d.ts.map +1 -1
  386. package/dist/test/render-hook.js +2 -2
  387. package/dist/test/render-hook.js.map +1 -1
  388. package/dist/test/render.d.ts +3 -3
  389. package/dist/test/render.d.ts.map +1 -1
  390. package/dist/test/render.js +3 -3
  391. package/dist/test/render.js.map +1 -1
  392. package/dist/test/setup-tests.js +1 -1
  393. package/dist/test/test-plugins/bert/index.d.ts +3 -3
  394. package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
  395. package/dist/test/test-plugins/bert/index.js.map +1 -1
  396. package/dist/test/test-plugins/ernie/index.d.ts +1 -1
  397. package/dist/test/test-plugins/ernie/index.d.ts.map +1 -1
  398. package/dist/test/test-plugins/ernie/index.js.map +1 -1
  399. package/dist/test/test-plugins/index.d.ts +1 -1
  400. package/dist/test/test-plugins/index.d.ts.map +1 -1
  401. package/dist/test/test-plugins/index.js +5 -5
  402. package/dist/test/test-plugins/index.js.map +1 -1
  403. package/dist/test/utils.d.ts +2 -2
  404. package/dist/test/utils.d.ts.map +1 -1
  405. package/dist/test/utils.js +4 -4
  406. package/dist/test/utils.js.map +1 -1
  407. package/dist/test-utils/index.js +1 -1
  408. package/dist/test-utils/index.js.map +1 -1
  409. package/dist/test-utils/mock-plugin-registry.d.ts +2 -2
  410. package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
  411. package/dist/test-utils/mock-plugin-registry.js +1 -1
  412. package/dist/test-utils/mock-plugin-registry.js.map +1 -1
  413. package/dist/utils/csv-export.js +1 -1
  414. package/dist/utils/csv-export.js.map +1 -1
  415. package/dist/utils/event.js +1 -1
  416. package/dist/utils/index.js +3 -3
  417. package/dist/utils/index.js.map +1 -1
  418. package/dist/utils/variables.js +1 -1
  419. package/package.json +9 -9
  420. package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js +0 -283
  421. package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationPreview.js +0 -197
  422. package/dist/cjs/components/Annotations/AnnotationEditorForm/index.js +0 -30
  423. package/dist/cjs/components/Annotations/constants.js +0 -23
  424. package/dist/cjs/components/Annotations/index.js +0 -31
  425. package/dist/cjs/components/CalculationSelector/CalculationSelector.js +0 -49
  426. package/dist/cjs/components/CalculationSelector/index.js +0 -30
  427. package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +0 -271
  428. package/dist/cjs/components/DatasourceEditorForm/index.js +0 -30
  429. package/dist/cjs/components/DatasourceSelect/DatasourceSelect.js +0 -266
  430. package/dist/cjs/components/DatasourceSelect/index.js +0 -30
  431. package/dist/cjs/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js +0 -53
  432. package/dist/cjs/components/DatasourceTestConnectionButton/index.js +0 -30
  433. package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +0 -593
  434. package/dist/cjs/components/HTTPSettingsEditor/index.js +0 -30
  435. package/dist/cjs/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +0 -1175
  436. package/dist/cjs/components/ItemSelectionActionsOptionsEditor/index.js +0 -30
  437. package/dist/cjs/components/LayoutEditor/LayoutEditor.js +0 -123
  438. package/dist/cjs/components/LayoutEditor/RepeatLayoutPreview.js +0 -105
  439. package/dist/cjs/components/LayoutEditor/RepeatVariableEditor.js +0 -176
  440. package/dist/cjs/components/LayoutEditor/index.js +0 -32
  441. package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +0 -211
  442. package/dist/cjs/components/LegendOptionsEditor/index.js +0 -30
  443. package/dist/cjs/components/LinksEditor/LinksEditor.js +0 -162
  444. package/dist/cjs/components/LinksEditor/index.js +0 -30
  445. package/dist/cjs/components/MetricLabelInput/MetricLabelInput.js +0 -41
  446. package/dist/cjs/components/MetricLabelInput/index.js +0 -30
  447. package/dist/cjs/components/MultiQueryEditor/MultiQueryEditor.js +0 -162
  448. package/dist/cjs/components/MultiQueryEditor/QueryEditorContainer.js +0 -250
  449. package/dist/cjs/components/MultiQueryEditor/index.js +0 -31
  450. package/dist/cjs/components/MultiQueryEditor/utils.js +0 -36
  451. package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +0 -69
  452. package/dist/cjs/components/OptionsEditorRadios/index.js +0 -30
  453. package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +0 -39
  454. package/dist/cjs/components/OptionsEditorTabPanel/index.js +0 -30
  455. package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +0 -61
  456. package/dist/cjs/components/OptionsEditorTabs/index.js +0 -30
  457. package/dist/cjs/components/PanelSpecEditor/PanelAnnotationsEditor.js +0 -246
  458. package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +0 -144
  459. package/dist/cjs/components/PanelSpecEditor/index.js +0 -30
  460. package/dist/cjs/components/PluginEditor/PluginEditor.js +0 -99
  461. package/dist/cjs/components/PluginEditor/index.js +0 -31
  462. package/dist/cjs/components/PluginEditor/plugin-editor-api.js +0 -136
  463. package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +0 -109
  464. package/dist/cjs/components/PluginKindSelect/index.js +0 -30
  465. package/dist/cjs/components/PluginRegistry/PluginRegistry.js +0 -86
  466. package/dist/cjs/components/PluginRegistry/getPluginSearchHelper.js +0 -92
  467. package/dist/cjs/components/PluginRegistry/index.js +0 -30
  468. package/dist/cjs/components/PluginRegistry/plugin-indexes.js +0 -88
  469. package/dist/cjs/components/PluginSpecEditor/DatasourceSpecEditor.js +0 -70
  470. package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +0 -69
  471. package/dist/cjs/components/PluginSpecEditor/index.js +0 -30
  472. package/dist/cjs/components/SelectionOptionsEditor/SelectionOptionsEditor.js +0 -43
  473. package/dist/cjs/components/SelectionOptionsEditor/index.js +0 -30
  474. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -235
  475. package/dist/cjs/components/TimeRangeControls/index.js +0 -30
  476. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +0 -613
  477. package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +0 -193
  478. package/dist/cjs/components/Variables/VariableEditorForm/index.js +0 -32
  479. package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +0 -143
  480. package/dist/cjs/components/Variables/index.js +0 -31
  481. package/dist/cjs/components/Variables/variable-model.js +0 -211
  482. package/dist/cjs/components/index.js +0 -50
  483. package/dist/cjs/constants/index.js +0 -31
  484. package/dist/cjs/constants/repeat.js +0 -32
  485. package/dist/cjs/constants/user-interface-text.js +0 -32
  486. package/dist/cjs/context/ValidationProvider.js +0 -77
  487. package/dist/cjs/context/index.js +0 -30
  488. package/dist/cjs/index.js +0 -38
  489. package/dist/cjs/model/alerts-queries.js +0 -16
  490. package/dist/cjs/model/annotations.js +0 -16
  491. package/dist/cjs/model/calculations.js +0 -178
  492. package/dist/cjs/model/datasource.js +0 -16
  493. package/dist/cjs/model/explore.js +0 -16
  494. package/dist/cjs/model/index.js +0 -46
  495. package/dist/cjs/model/json-queries.js +0 -16
  496. package/dist/cjs/model/legend.js +0 -111
  497. package/dist/cjs/model/log-queries.js +0 -16
  498. package/dist/cjs/model/log-volume-utils.js +0 -124
  499. package/dist/cjs/model/panels.js +0 -16
  500. package/dist/cjs/model/plugin-base.js +0 -16
  501. package/dist/cjs/model/plugin-loading.js +0 -56
  502. package/dist/cjs/model/plugins.js +0 -26
  503. package/dist/cjs/model/profile-queries.js +0 -16
  504. package/dist/cjs/model/silences-queries.js +0 -16
  505. package/dist/cjs/model/time-series-queries.js +0 -26
  506. package/dist/cjs/model/trace-queries.js +0 -16
  507. package/dist/cjs/model/variables.js +0 -16
  508. package/dist/cjs/remote/PersesPlugin.types.js +0 -16
  509. package/dist/cjs/remote/PluginLoaderComponent.js +0 -87
  510. package/dist/cjs/remote/PluginRuntime.js +0 -323
  511. package/dist/cjs/remote/index.js +0 -31
  512. package/dist/cjs/remote/remotePluginLoader.js +0 -101
  513. package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +0 -162
  514. package/dist/cjs/runtime/DataQueriesProvider/index.js +0 -31
  515. package/dist/cjs/runtime/DataQueriesProvider/model.js +0 -34
  516. package/dist/cjs/runtime/RouterProvider.js +0 -114
  517. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +0 -215
  518. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviders.js +0 -66
  519. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +0 -126
  520. package/dist/cjs/runtime/TimeRangeProvider/index.js +0 -33
  521. package/dist/cjs/runtime/TimeRangeProvider/query-params.js +0 -250
  522. package/dist/cjs/runtime/TimeRangeProvider/refresh-interval.js +0 -30
  523. package/dist/cjs/runtime/UsageMetricsProvider.js +0 -102
  524. package/dist/cjs/runtime/alerts-queries.js +0 -101
  525. package/dist/cjs/runtime/annotations.js +0 -148
  526. package/dist/cjs/runtime/builtin-variables.js +0 -81
  527. package/dist/cjs/runtime/datasources.js +0 -80
  528. package/dist/cjs/runtime/index.js +0 -45
  529. package/dist/cjs/runtime/item-actions.js +0 -302
  530. package/dist/cjs/runtime/json-queries.js +0 -70
  531. package/dist/cjs/runtime/log-queries.js +0 -76
  532. package/dist/cjs/runtime/plugin-registry.js +0 -135
  533. package/dist/cjs/runtime/profile-queries.js +0 -73
  534. package/dist/cjs/runtime/silences-queries.js +0 -101
  535. package/dist/cjs/runtime/time-series-queries.js +0 -165
  536. package/dist/cjs/runtime/trace-queries.js +0 -106
  537. package/dist/cjs/runtime/utils.js +0 -39
  538. package/dist/cjs/runtime/variables.js +0 -160
  539. package/dist/cjs/schema/index.js +0 -30
  540. package/dist/cjs/schema/panel.js +0 -56
  541. package/dist/cjs/test/index.js +0 -31
  542. package/dist/cjs/test/mock-data.js +0 -366
  543. package/dist/cjs/test/render-hook.js +0 -31
  544. package/dist/cjs/test/render.js +0 -31
  545. package/dist/cjs/test/setup-tests.js +0 -26
  546. package/dist/cjs/test/test-plugins/bert/index.js +0 -99
  547. package/dist/cjs/test/test-plugins/ernie/index.js +0 -149
  548. package/dist/cjs/test/test-plugins/index.js +0 -81
  549. package/dist/cjs/test/utils.js +0 -58
  550. package/dist/cjs/test-utils/index.js +0 -30
  551. package/dist/cjs/test-utils/mock-plugin-registry.js +0 -81
  552. package/dist/cjs/utils/csv-export.js +0 -248
  553. package/dist/cjs/utils/event.js +0 -30
  554. package/dist/cjs/utils/index.js +0 -32
  555. package/dist/cjs/utils/variables.js +0 -44
@@ -10,6 +10,6 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export * from './SelectionOptionsEditor';
13
+ export * from "./SelectionOptionsEditor.js";
14
14
 
15
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/SelectionOptionsEditor/index.ts"],"sourcesContent":["// Copyright 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\nexport * from './SelectionOptionsEditor';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,2BAA2B"}
1
+ {"version":3,"sources":["../../../src/components/SelectionOptionsEditor/index.ts"],"sourcesContent":["// Copyright 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\nexport * from './SelectionOptionsEditor';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,8BAA2B"}
@@ -1,6 +1,5 @@
1
- import { TimeOption, TimeZoneOption } from '@perses-dev/components';
2
- import { ReactElement } from 'react';
3
- export declare const DEFAULT_REFRESH_INTERVAL_OPTIONS: TimeOption[];
1
+ import type { TimeOption, TimeZoneOption } from '@perses-dev/components';
2
+ import type { ReactElement } from 'react';
4
3
  interface TimeRangeControlsProps {
5
4
  heightPx?: number;
6
5
  showTimeRangeSelector?: boolean;
@@ -9,9 +8,10 @@ interface TimeRangeControlsProps {
9
8
  showCustomTimeRange?: boolean;
10
9
  showZoomButtons?: boolean;
11
10
  timePresets?: TimeOption[];
11
+ refreshIntervalOptions?: TimeOption[];
12
12
  timeZone: string;
13
13
  onTimeZoneChange: (timeZone: TimeZoneOption) => void;
14
14
  }
15
- export declare function TimeRangeControls({ heightPx, showTimeRangeSelector, showRefreshButton, showRefreshInterval, showCustomTimeRange, showZoomButtons, timePresets, timeZone, onTimeZoneChange, }: TimeRangeControlsProps): ReactElement;
15
+ export declare function TimeRangeControls({ heightPx, showTimeRangeSelector, showRefreshButton, showRefreshInterval, showCustomTimeRange, showZoomButtons, timePresets, timeZone, refreshIntervalOptions, onTimeZoneChange, }: TimeRangeControlsProps): ReactElement;
16
16
  export {};
17
17
  //# sourceMappingURL=TimeRangeControls.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TimeRangeControls.d.ts","sourceRoot":"","sources":["../../../src/components/TimeRangeControls/TimeRangeControls.tsx"],"names":[],"mappings":"AAcA,OAAO,EAGL,UAAU,EAGV,cAAc,EAGf,MAAM,wBAAwB,CAAC;AAQhC,OAAO,EAAE,YAAY,EAAe,MAAM,OAAO,CAAC;AAUlD,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,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC;CACtD;AAED,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,qBAA4B,EAC5B,iBAAwB,EACxB,mBAA0B,EAC1B,mBAAmB,EACnB,eAAsB,EACtB,WAAW,EACX,QAAQ,EACR,gBAAgB,GACjB,EAAE,sBAAsB,GAAG,YAAY,CAoKvC"}
1
+ {"version":3,"file":"TimeRangeControls.d.ts","sourceRoot":"","sources":["../../../src/components/TimeRangeControls/TimeRangeControls.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAiBzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAe1C,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,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,sBAAsB,CAAC,EAAE,UAAU,EAAE,CAAC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC;CACtD;AAED,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,qBAA4B,EAC5B,iBAAwB,EACxB,mBAA0B,EAC1B,mBAAmB,EACnB,eAAsB,EACtB,WAAW,EACX,QAAQ,EACR,sBAAsB,EACtB,gBAAgB,GACjB,EAAE,sBAAsB,GAAG,YAAY,CAqKvC"}
@@ -11,63 +11,27 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { Stack } from '@mui/material';
15
- import { RefreshIntervalPicker, InfoTooltip, ToolbarIconButton, TimeRangeSelector, getTimeZoneOptions, buildRelativeTimeOption } from '@perses-dev/components';
16
- import { parseDurationString } from '@perses-dev/spec';
17
- import { milliseconds } from 'date-fns';
14
+ import { Stack } from "@mui/material";
15
+ import { RefreshIntervalPicker, InfoTooltip, ToolbarIconButton, TimeRangeSelector, getTimeZoneOptions, buildRelativeTimeOption } from "@perses-dev/components";
16
+ import { parseDurationString } from "@perses-dev/spec";
17
+ import { milliseconds } from "date-fns";
18
18
  // eslint-disable-next-line import/no-duplicates
19
- import ZoomOut from 'mdi-material-ui/MinusCircleOutline';
19
+ import ZoomOut from "mdi-material-ui/MinusCircleOutline";
20
20
  // eslint-disable-next-line import/no-duplicates
21
- import ZoomIn from 'mdi-material-ui/PlusCircleOutline';
22
- import RefreshIcon from 'mdi-material-ui/Refresh';
23
- import { useCallback } from 'react';
24
- import { TOOLTIP_TEXT } from '../../constants';
25
- import { useTimeRange, useShowCustomTimeRangeSetting, useTimeRangeOptionsSetting, useShowZoomRangeSetting, useDisableAutoRefreshSetting } from '../../runtime';
26
- export const DEFAULT_REFRESH_INTERVAL_OPTIONS = [
27
- {
28
- value: {
29
- pastDuration: '0s'
30
- },
31
- display: 'Off'
32
- },
33
- {
34
- value: {
35
- pastDuration: '5s'
36
- },
37
- display: '5s'
38
- },
39
- {
40
- value: {
41
- pastDuration: '10s'
42
- },
43
- display: '10s'
44
- },
45
- {
46
- value: {
47
- pastDuration: '15s'
48
- },
49
- display: '15s'
50
- },
51
- {
52
- value: {
53
- pastDuration: '30s'
54
- },
55
- display: '30s'
56
- },
57
- {
58
- value: {
59
- pastDuration: '60s'
60
- },
61
- display: '1m'
62
- }
63
- ];
21
+ import ZoomIn from "mdi-material-ui/PlusCircleOutline";
22
+ import RefreshIcon from "mdi-material-ui/Refresh";
23
+ import { useCallback } from "react";
24
+ import { TOOLTIP_TEXT } from "../../constants/user-interface-text.js";
25
+ import { useTimeRange } from "../../runtime/TimeRangeProvider/TimeRangeProvider.js";
26
+ import { useShowCustomTimeRangeSetting, useTimeRangeOptionsSetting, useShowZoomRangeSetting, useDisableAutoRefreshSetting, useAutoRefreshIntervalsOptions } from "../../runtime/TimeRangeProvider/TimeRangeSettingsProvider.js";
64
27
  const DEFAULT_HEIGHT = '34px';
65
- export function TimeRangeControls({ heightPx, showTimeRangeSelector = true, showRefreshButton = true, showRefreshInterval = true, showCustomTimeRange, showZoomButtons = true, timePresets, timeZone, onTimeZoneChange }) {
28
+ export function TimeRangeControls({ heightPx, showTimeRangeSelector = true, showRefreshButton = true, showRefreshInterval = true, showCustomTimeRange, showZoomButtons = true, timePresets, timeZone, refreshIntervalOptions, onTimeZoneChange }) {
66
29
  const { timeRange, setTimeRange, refresh, refreshInterval, setRefreshInterval } = useTimeRange();
67
30
  const showCustomTimeRangeValue = useShowCustomTimeRangeSetting(showCustomTimeRange);
68
31
  const showZoomInOutButtons = useShowZoomRangeSetting(showZoomButtons);
69
32
  const isAutoRefreshDisabled = useDisableAutoRefreshSetting();
70
33
  const timePresetsValue = useTimeRangeOptionsSetting(timePresets);
34
+ const autoRefreshIntervalOptions = useAutoRefreshIntervalsOptions(refreshIntervalOptions);
71
35
  // Convert height to a string, then use the string for styling
72
36
  const height = heightPx === undefined ? DEFAULT_HEIGHT : `${heightPx}px`;
73
37
  // add time preset if one does not match duration given in time range, keeping the list ordered by duration
@@ -199,12 +163,12 @@ export function TimeRangeControls({ heightPx, showTimeRangeSelector = true, show
199
163
  showRefreshInterval && !isAutoRefreshDisabled && /*#__PURE__*/ _jsx(InfoTooltip, {
200
164
  description: TOOLTIP_TEXT.refreshInterval,
201
165
  children: /*#__PURE__*/ _jsx(RefreshIntervalPicker, {
202
- timeOptions: DEFAULT_REFRESH_INTERVAL_OPTIONS,
166
+ timeOptions: autoRefreshIntervalOptions,
203
167
  value: /* TODO: There is a bug here which should be fixed in a proper way. (This is only a quick remedy)
204
168
  display: 1m has the pastDuration of 60s. Initially (if the persisted value is 1m) when the page is loaded, instead of 60s, 1m is passed down.
205
169
  This only happens for 1m, because for other items the display and the pastDuration are the same. Example 30s-30s
206
170
  HERE The value MUST always be pastDuration, otherwise the component would not work as expected.
207
- */ DEFAULT_REFRESH_INTERVAL_OPTIONS.some((i)=>i.value.pastDuration === refreshInterval) ? refreshInterval : DEFAULT_REFRESH_INTERVAL_OPTIONS.find((i)=>i.display === refreshInterval)?.value.pastDuration,
171
+ */ autoRefreshIntervalOptions.some((i)=>i.value.pastDuration === refreshInterval) ? refreshInterval : autoRefreshIntervalOptions.find((i)=>i.display === refreshInterval)?.value.pastDuration,
208
172
  onChange: handleRefreshIntervalChange,
209
173
  height: height
210
174
  })
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/TimeRangeControls/TimeRangeControls.tsx"],"sourcesContent":["// Copyright 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 { Stack } from '@mui/material';\nimport {\n RefreshIntervalPicker,\n InfoTooltip,\n TimeOption,\n ToolbarIconButton,\n TimeRangeSelector,\n TimeZoneOption,\n getTimeZoneOptions,\n buildRelativeTimeOption,\n} from '@perses-dev/components';\nimport { AbsoluteTimeRange, DurationString, parseDurationString, RelativeTimeRange } from '@perses-dev/spec';\nimport { milliseconds } from 'date-fns';\n// eslint-disable-next-line import/no-duplicates\nimport ZoomOut from 'mdi-material-ui/MinusCircleOutline';\n// eslint-disable-next-line import/no-duplicates\nimport ZoomIn from 'mdi-material-ui/PlusCircleOutline';\nimport RefreshIcon from 'mdi-material-ui/Refresh';\nimport { ReactElement, useCallback } from 'react';\n\nimport { TOOLTIP_TEXT } from '../../constants';\nimport {\n useTimeRange,\n useShowCustomTimeRangeSetting,\n useTimeRangeOptionsSetting,\n useShowZoomRangeSetting,\n useDisableAutoRefreshSetting,\n} from '../../runtime';\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 showZoomButtons?: boolean;\n timePresets?: TimeOption[];\n timeZone: string;\n onTimeZoneChange: (timeZone: TimeZoneOption) => void;\n}\n\nexport function TimeRangeControls({\n heightPx,\n showTimeRangeSelector = true,\n showRefreshButton = true,\n showRefreshInterval = true,\n showCustomTimeRange,\n showZoomButtons = true,\n timePresets,\n timeZone,\n onTimeZoneChange,\n}: TimeRangeControlsProps): ReactElement {\n const { timeRange, setTimeRange, refresh, refreshInterval, setRefreshInterval } = useTimeRange();\n\n const showCustomTimeRangeValue = useShowCustomTimeRangeSetting(showCustomTimeRange);\n const showZoomInOutButtons = useShowZoomRangeSetting(showZoomButtons);\n const isAutoRefreshDisabled = useDisableAutoRefreshSetting();\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, keeping the list ordered by duration\n if (\n 'pastDuration' in timeRange &&\n !timePresetsValue.some((option) => option.value.pastDuration === timeRange['pastDuration'])\n ) {\n const durationMs = milliseconds(parseDurationString(timeRange['pastDuration']));\n const insertionIndex = timePresetsValue.findIndex(\n (option) => milliseconds(parseDurationString(option.value.pastDuration)) > durationMs,\n );\n timePresetsValue.splice(\n insertionIndex === -1 ? timePresetsValue.length : insertionIndex,\n 0,\n buildRelativeTimeOption(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 const fromDurationToMillis = (strDuration: string): number => {\n const duration = parseDurationString(strDuration);\n const millis =\n ((duration.seconds ?? 0) +\n (duration.minutes ?? 0) * 60 +\n (duration.hours ?? 0) * 3600 +\n (duration.days ?? 0) * 86400 +\n (duration.weeks ?? 0) * 7 * 86400 +\n (duration.months ?? 0) * 30.436875 * 86400 + // avg month duration is ok for zoom purposes\n (duration.years ?? 0) * 365.2425 * 86400) * // avg year duration is ok for zoom purposes\n 1000; // to milliseconds\n return millis;\n };\n\n // Function to double current time range, adding 50% before current start and 50% after current end\n const doubleTimeRange = (): AbsoluteTimeRange => {\n let newStart, newEnd, extendEndsBy;\n const now = new Date();\n if (Object.hasOwn(timeRange, 'start')) {\n // current range is absolute\n const absVal = timeRange as AbsoluteTimeRange;\n extendEndsBy = (absVal.end.getTime() - absVal.start.getTime()) / 2; // half it to add 50% before current start and after current end\n newStart = new Date(absVal.start.getTime() - extendEndsBy);\n newEnd = new Date(absVal.end.getTime() + extendEndsBy);\n } else {\n // current range is relative\n const relVal = timeRange as RelativeTimeRange;\n extendEndsBy = fromDurationToMillis(relVal.pastDuration) / 2;\n newEnd = typeof relVal.end === 'undefined' ? now : new Date(relVal.end.getTime() + extendEndsBy);\n newStart = new Date(newEnd.getTime() - extendEndsBy * 4);\n }\n if (newEnd.getTime() > now.getTime()) {\n // if the new computed end is in the future\n newEnd = now;\n newStart.setTime(now.getTime() - extendEndsBy * 4);\n }\n if (newStart.getTime() < 1) {\n newStart.setTime(1);\n }\n return { start: newStart, end: newEnd };\n };\n\n // Function to half current time range, cutting 25% before current start and 25% after current end\n const halfTimeRange = (): AbsoluteTimeRange => {\n let newStart, newEnd;\n if (Object.hasOwn(timeRange, 'start')) {\n const absVal = timeRange as AbsoluteTimeRange;\n const shrinkEndsBy = (absVal.end.getTime() - absVal.start.getTime()) / 4;\n newStart = new Date(absVal.start.getTime() + shrinkEndsBy);\n newEnd = new Date(absVal.end.getTime() - shrinkEndsBy);\n } else {\n const relVal = timeRange as RelativeTimeRange;\n const shrinkEndsBy = fromDurationToMillis(relVal.pastDuration) / 4; // 25% of it to cut after current start and before current end\n const endIsAbsolute = typeof relVal.end !== 'undefined';\n newEnd = endIsAbsolute ? new Date(relVal.end!.getTime() - shrinkEndsBy) : new Date();\n newStart = new Date(newEnd.getTime() - shrinkEndsBy * 2);\n }\n if (newStart.getTime() >= newEnd.getTime() - 1000) {\n newStart.setTime(newEnd.getTime() - 1000);\n }\n return { start: newStart, end: newEnd };\n };\n\n const setHalfTimeRange = (): void => setTimeRange(halfTimeRange());\n const setDoubleTimeRange = (): void => setTimeRange(doubleTimeRange());\n\n const handleTimeZoneChange = useCallback(\n (tz: TimeZoneOption) => {\n onTimeZoneChange(tz);\n },\n [onTimeZoneChange],\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 timeZone={timeZone}\n timeZoneOptions={getTimeZoneOptions()}\n onTimeZoneChange={handleTimeZoneChange}\n />\n )}\n {showZoomInOutButtons && (\n <InfoTooltip description={TOOLTIP_TEXT.zoomOut}>\n <ToolbarIconButton aria-label={TOOLTIP_TEXT.zoomOut} onClick={setDoubleTimeRange} sx={{ height }}>\n <ZoomOut />\n </ToolbarIconButton>\n </InfoTooltip>\n )}\n {showZoomInOutButtons && (\n <InfoTooltip description={TOOLTIP_TEXT.zoomIn}>\n <ToolbarIconButton aria-label={TOOLTIP_TEXT.zoomIn} onClick={setHalfTimeRange} sx={{ height }}>\n <ZoomIn />\n </ToolbarIconButton>\n </InfoTooltip>\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 && !isAutoRefreshDisabled && (\n <InfoTooltip description={TOOLTIP_TEXT.refreshInterval}>\n <RefreshIntervalPicker\n timeOptions={DEFAULT_REFRESH_INTERVAL_OPTIONS}\n value={\n /* TODO: There is a bug here which should be fixed in a proper way. (This is only a quick remedy)\n display: 1m has the pastDuration of 60s. Initially (if the persisted value is 1m) when the page is loaded, instead of 60s, 1m is passed down. \n This only happens for 1m, because for other items the display and the pastDuration are the same. Example 30s-30s\n HERE The value MUST always be pastDuration, otherwise the component would not work as expected. \n */\n DEFAULT_REFRESH_INTERVAL_OPTIONS.some((i) => i.value.pastDuration === refreshInterval)\n ? refreshInterval\n : DEFAULT_REFRESH_INTERVAL_OPTIONS.find((i) => i.display === refreshInterval)?.value.pastDuration\n }\n onChange={handleRefreshIntervalChange}\n height={height}\n />\n </InfoTooltip>\n )}\n </Stack>\n );\n}\n"],"names":["Stack","RefreshIntervalPicker","InfoTooltip","ToolbarIconButton","TimeRangeSelector","getTimeZoneOptions","buildRelativeTimeOption","parseDurationString","milliseconds","ZoomOut","ZoomIn","RefreshIcon","useCallback","TOOLTIP_TEXT","useTimeRange","useShowCustomTimeRangeSetting","useTimeRangeOptionsSetting","useShowZoomRangeSetting","useDisableAutoRefreshSetting","DEFAULT_REFRESH_INTERVAL_OPTIONS","value","pastDuration","display","DEFAULT_HEIGHT","TimeRangeControls","heightPx","showTimeRangeSelector","showRefreshButton","showRefreshInterval","showCustomTimeRange","showZoomButtons","timePresets","timeZone","onTimeZoneChange","timeRange","setTimeRange","refresh","refreshInterval","setRefreshInterval","showCustomTimeRangeValue","showZoomInOutButtons","isAutoRefreshDisabled","timePresetsValue","height","undefined","some","option","durationMs","insertionIndex","findIndex","splice","length","handleRefreshIntervalChange","duration","fromDurationToMillis","strDuration","millis","seconds","minutes","hours","days","weeks","months","years","doubleTimeRange","newStart","newEnd","extendEndsBy","now","Date","Object","hasOwn","absVal","end","getTime","start","relVal","setTime","halfTimeRange","shrinkEndsBy","endIsAbsolute","setHalfTimeRange","setDoubleTimeRange","handleTimeZoneChange","tz","direction","spacing","timeOptions","onChange","timeZoneOptions","description","zoomOut","aria-label","onClick","sx","zoomIn","i","find"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,KAAK,QAAQ,gBAAgB;AACtC,SACEC,qBAAqB,EACrBC,WAAW,EAEXC,iBAAiB,EACjBC,iBAAiB,EAEjBC,kBAAkB,EAClBC,uBAAuB,QAClB,yBAAyB;AAChC,SAA4CC,mBAAmB,QAA2B,mBAAmB;AAC7G,SAASC,YAAY,QAAQ,WAAW;AACxC,gDAAgD;AAChD,OAAOC,aAAa,qCAAqC;AACzD,gDAAgD;AAChD,OAAOC,YAAY,oCAAoC;AACvD,OAAOC,iBAAiB,0BAA0B;AAClD,SAAuBC,WAAW,QAAQ,QAAQ;AAElD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SACEC,YAAY,EACZC,6BAA6B,EAC7BC,0BAA0B,EAC1BC,uBAAuB,EACvBC,4BAA4B,QACvB,gBAAgB;AACvB,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,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,kBAAkBkD;;YAGrB3C,sCACC,KAACtC;gBAAYwF,aAAa7E,aAAa8E,OAAO;0BAC5C,cAAA,KAACxF;oBAAkByF,cAAY/E,aAAa8E,OAAO;oBAAEE,SAASX;oBAAoBY,IAAI;wBAAEnD;oBAAO;8BAC7F,cAAA,KAAClC;;;YAIN+B,sCACC,KAACtC;gBAAYwF,aAAa7E,aAAakF,MAAM;0BAC3C,cAAA,KAAC5F;oBAAkByF,cAAY/E,aAAakF,MAAM;oBAAEF,SAASZ;oBAAkBa,IAAI;wBAAEnD;oBAAO;8BAC1F,cAAA,KAACjC;;;YAINiB,mCACC,KAACzB;gBAAYwF,aAAa7E,aAAauB,OAAO;0BAC5C,cAAA,KAACjC;oBAAkByF,cAAY/E,aAAauB,OAAO;oBAAEyD,SAASzD;oBAAS0D,IAAI;wBAAEnD;oBAAO;8BAClF,cAAA,KAAChC;;;YAINiB,uBAAuB,CAACa,uCACvB,KAACvC;gBAAYwF,aAAa7E,aAAawB,eAAe;0BACpD,cAAA,KAACpC;oBACCsF,aAAapE;oBACbC,OACE;;;;cAIA,GACAD,iCAAiC0B,IAAI,CAAC,CAACmD,IAAMA,EAAE5E,KAAK,CAACC,YAAY,KAAKgB,mBAClEA,kBACAlB,iCAAiC8E,IAAI,CAAC,CAACD,IAAMA,EAAE1E,OAAO,KAAKe,kBAAkBjB,MAAMC;oBAEzFmE,UAAUpC;oBACVT,QAAQA;;;;;AAMpB"}
1
+ {"version":3,"sources":["../../../src/components/TimeRangeControls/TimeRangeControls.tsx"],"sourcesContent":["// Copyright 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 { Stack } from '@mui/material';\nimport type { TimeOption, TimeZoneOption } from '@perses-dev/components';\nimport {\n RefreshIntervalPicker,\n InfoTooltip,\n ToolbarIconButton,\n TimeRangeSelector,\n getTimeZoneOptions,\n buildRelativeTimeOption,\n} from '@perses-dev/components';\nimport type { AbsoluteTimeRange, DurationString, RelativeTimeRange } from '@perses-dev/spec';\nimport { parseDurationString } from '@perses-dev/spec';\nimport { milliseconds } from 'date-fns';\n// eslint-disable-next-line import/no-duplicates\nimport ZoomOut from 'mdi-material-ui/MinusCircleOutline';\n// eslint-disable-next-line import/no-duplicates\nimport ZoomIn from 'mdi-material-ui/PlusCircleOutline';\nimport RefreshIcon from 'mdi-material-ui/Refresh';\nimport type { ReactElement } from 'react';\nimport { useCallback } from 'react';\n\nimport { TOOLTIP_TEXT } from '../../constants/user-interface-text';\nimport { useTimeRange } from '../../runtime/TimeRangeProvider/TimeRangeProvider';\nimport {\n useShowCustomTimeRangeSetting,\n useTimeRangeOptionsSetting,\n useShowZoomRangeSetting,\n useDisableAutoRefreshSetting,\n useAutoRefreshIntervalsOptions,\n} from '../../runtime/TimeRangeProvider/TimeRangeSettingsProvider';\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 showZoomButtons?: boolean;\n timePresets?: TimeOption[];\n refreshIntervalOptions?: TimeOption[];\n timeZone: string;\n onTimeZoneChange: (timeZone: TimeZoneOption) => void;\n}\n\nexport function TimeRangeControls({\n heightPx,\n showTimeRangeSelector = true,\n showRefreshButton = true,\n showRefreshInterval = true,\n showCustomTimeRange,\n showZoomButtons = true,\n timePresets,\n timeZone,\n refreshIntervalOptions,\n onTimeZoneChange,\n}: TimeRangeControlsProps): ReactElement {\n const { timeRange, setTimeRange, refresh, refreshInterval, setRefreshInterval } = useTimeRange();\n\n const showCustomTimeRangeValue = useShowCustomTimeRangeSetting(showCustomTimeRange);\n const showZoomInOutButtons = useShowZoomRangeSetting(showZoomButtons);\n const isAutoRefreshDisabled = useDisableAutoRefreshSetting();\n const timePresetsValue = useTimeRangeOptionsSetting(timePresets);\n const autoRefreshIntervalOptions = useAutoRefreshIntervalsOptions(refreshIntervalOptions);\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, keeping the list ordered by duration\n if (\n 'pastDuration' in timeRange &&\n !timePresetsValue.some((option) => option.value.pastDuration === timeRange['pastDuration'])\n ) {\n const durationMs = milliseconds(parseDurationString(timeRange['pastDuration']));\n const insertionIndex = timePresetsValue.findIndex(\n (option) => milliseconds(parseDurationString(option.value.pastDuration)) > durationMs,\n );\n timePresetsValue.splice(\n insertionIndex === -1 ? timePresetsValue.length : insertionIndex,\n 0,\n buildRelativeTimeOption(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 const fromDurationToMillis = (strDuration: string): number => {\n const duration = parseDurationString(strDuration);\n const millis =\n ((duration.seconds ?? 0) +\n (duration.minutes ?? 0) * 60 +\n (duration.hours ?? 0) * 3600 +\n (duration.days ?? 0) * 86400 +\n (duration.weeks ?? 0) * 7 * 86400 +\n (duration.months ?? 0) * 30.436875 * 86400 + // avg month duration is ok for zoom purposes\n (duration.years ?? 0) * 365.2425 * 86400) * // avg year duration is ok for zoom purposes\n 1000; // to milliseconds\n return millis;\n };\n\n // Function to double current time range, adding 50% before current start and 50% after current end\n const doubleTimeRange = (): AbsoluteTimeRange => {\n let newStart, newEnd, extendEndsBy;\n const now = new Date();\n if (Object.hasOwn(timeRange, 'start')) {\n // current range is absolute\n const absVal = timeRange as AbsoluteTimeRange;\n extendEndsBy = (absVal.end.getTime() - absVal.start.getTime()) / 2; // half it to add 50% before current start and after current end\n newStart = new Date(absVal.start.getTime() - extendEndsBy);\n newEnd = new Date(absVal.end.getTime() + extendEndsBy);\n } else {\n // current range is relative\n const relVal = timeRange as RelativeTimeRange;\n extendEndsBy = fromDurationToMillis(relVal.pastDuration) / 2;\n newEnd = typeof relVal.end === 'undefined' ? now : new Date(relVal.end.getTime() + extendEndsBy);\n newStart = new Date(newEnd.getTime() - extendEndsBy * 4);\n }\n if (newEnd.getTime() > now.getTime()) {\n // if the new computed end is in the future\n newEnd = now;\n newStart.setTime(now.getTime() - extendEndsBy * 4);\n }\n if (newStart.getTime() < 1) {\n newStart.setTime(1);\n }\n return { start: newStart, end: newEnd };\n };\n\n // Function to half current time range, cutting 25% before current start and 25% after current end\n const halfTimeRange = (): AbsoluteTimeRange => {\n let newStart, newEnd;\n if (Object.hasOwn(timeRange, 'start')) {\n const absVal = timeRange as AbsoluteTimeRange;\n const shrinkEndsBy = (absVal.end.getTime() - absVal.start.getTime()) / 4;\n newStart = new Date(absVal.start.getTime() + shrinkEndsBy);\n newEnd = new Date(absVal.end.getTime() - shrinkEndsBy);\n } else {\n const relVal = timeRange as RelativeTimeRange;\n const shrinkEndsBy = fromDurationToMillis(relVal.pastDuration) / 4; // 25% of it to cut after current start and before current end\n const endIsAbsolute = typeof relVal.end !== 'undefined';\n newEnd = endIsAbsolute ? new Date(relVal.end!.getTime() - shrinkEndsBy) : new Date();\n newStart = new Date(newEnd.getTime() - shrinkEndsBy * 2);\n }\n if (newStart.getTime() >= newEnd.getTime() - 1000) {\n newStart.setTime(newEnd.getTime() - 1000);\n }\n return { start: newStart, end: newEnd };\n };\n\n const setHalfTimeRange = (): void => setTimeRange(halfTimeRange());\n const setDoubleTimeRange = (): void => setTimeRange(doubleTimeRange());\n\n const handleTimeZoneChange = useCallback(\n (tz: TimeZoneOption) => {\n onTimeZoneChange(tz);\n },\n [onTimeZoneChange],\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 timeZone={timeZone}\n timeZoneOptions={getTimeZoneOptions()}\n onTimeZoneChange={handleTimeZoneChange}\n />\n )}\n {showZoomInOutButtons && (\n <InfoTooltip description={TOOLTIP_TEXT.zoomOut}>\n <ToolbarIconButton aria-label={TOOLTIP_TEXT.zoomOut} onClick={setDoubleTimeRange} sx={{ height }}>\n <ZoomOut />\n </ToolbarIconButton>\n </InfoTooltip>\n )}\n {showZoomInOutButtons && (\n <InfoTooltip description={TOOLTIP_TEXT.zoomIn}>\n <ToolbarIconButton aria-label={TOOLTIP_TEXT.zoomIn} onClick={setHalfTimeRange} sx={{ height }}>\n <ZoomIn />\n </ToolbarIconButton>\n </InfoTooltip>\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 && !isAutoRefreshDisabled && (\n <InfoTooltip description={TOOLTIP_TEXT.refreshInterval}>\n <RefreshIntervalPicker\n timeOptions={autoRefreshIntervalOptions}\n value={\n /* TODO: There is a bug here which should be fixed in a proper way. (This is only a quick remedy)\n display: 1m has the pastDuration of 60s. Initially (if the persisted value is 1m) when the page is loaded, instead of 60s, 1m is passed down. \n This only happens for 1m, because for other items the display and the pastDuration are the same. Example 30s-30s\n HERE The value MUST always be pastDuration, otherwise the component would not work as expected. \n */\n autoRefreshIntervalOptions.some((i) => i.value.pastDuration === refreshInterval)\n ? refreshInterval\n : autoRefreshIntervalOptions.find((i) => i.display === refreshInterval)?.value.pastDuration\n }\n onChange={handleRefreshIntervalChange}\n height={height}\n />\n </InfoTooltip>\n )}\n </Stack>\n );\n}\n"],"names":["Stack","RefreshIntervalPicker","InfoTooltip","ToolbarIconButton","TimeRangeSelector","getTimeZoneOptions","buildRelativeTimeOption","parseDurationString","milliseconds","ZoomOut","ZoomIn","RefreshIcon","useCallback","TOOLTIP_TEXT","useTimeRange","useShowCustomTimeRangeSetting","useTimeRangeOptionsSetting","useShowZoomRangeSetting","useDisableAutoRefreshSetting","useAutoRefreshIntervalsOptions","DEFAULT_HEIGHT","TimeRangeControls","heightPx","showTimeRangeSelector","showRefreshButton","showRefreshInterval","showCustomTimeRange","showZoomButtons","timePresets","timeZone","refreshIntervalOptions","onTimeZoneChange","timeRange","setTimeRange","refresh","refreshInterval","setRefreshInterval","showCustomTimeRangeValue","showZoomInOutButtons","isAutoRefreshDisabled","timePresetsValue","autoRefreshIntervalOptions","height","undefined","some","option","value","pastDuration","durationMs","insertionIndex","findIndex","splice","length","handleRefreshIntervalChange","duration","fromDurationToMillis","strDuration","millis","seconds","minutes","hours","days","weeks","months","years","doubleTimeRange","newStart","newEnd","extendEndsBy","now","Date","Object","hasOwn","absVal","end","getTime","start","relVal","setTime","halfTimeRange","shrinkEndsBy","endIsAbsolute","setHalfTimeRange","setDoubleTimeRange","handleTimeZoneChange","tz","direction","spacing","timeOptions","onChange","timeZoneOptions","description","zoomOut","aria-label","onClick","sx","zoomIn","i","find","display"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,KAAK,QAAQ,gBAAgB;AAEtC,SACEC,qBAAqB,EACrBC,WAAW,EACXC,iBAAiB,EACjBC,iBAAiB,EACjBC,kBAAkB,EAClBC,uBAAuB,QAClB,yBAAyB;AAEhC,SAASC,mBAAmB,QAAQ,mBAAmB;AACvD,SAASC,YAAY,QAAQ,WAAW;AACxC,gDAAgD;AAChD,OAAOC,aAAa,qCAAqC;AACzD,gDAAgD;AAChD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F ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export * from './TimeRangeControls';
13
+ export * from "./TimeRangeControls.js";
14
14
 
15
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/TimeRangeControls/index.ts"],"sourcesContent":["// Copyright 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\nexport * from './TimeRangeControls';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,sBAAsB"}
1
+ {"version":3,"sources":["../../../src/components/TimeRangeControls/index.ts"],"sourcesContent":["// Copyright 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\nexport * from './TimeRangeControls';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,yBAAsB"}
@@ -1,6 +1,6 @@
1
- import { Action } from '@perses-dev/client';
2
- import { VariableDefinition } from '@perses-dev/spec';
3
- import { DispatchWithoutAction, ReactElement } from 'react';
1
+ import type { Action } from '@perses-dev/client';
2
+ import type { VariableDefinition } from '@perses-dev/spec';
3
+ import type { DispatchWithoutAction, ReactElement } from 'react';
4
4
  interface VariableEditorFormProps {
5
5
  initialVariableDefinition: VariableDefinition;
6
6
  action: Action;
@@ -1 +1 @@
1
- {"version":3,"file":"VariableEditorForm.d.ts","sourceRoot":"","sources":["../../../../src/components/Variables/VariableEditorForm/VariableEditorForm.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAS5C,OAAO,EAAE,kBAAkB,EAA0B,MAAM,kBAAkB,CAAC;AAE9E,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAyB,MAAM,OAAO,CAAC;AA+VnF,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"}
1
+ {"version":3,"file":"VariableEditorForm.d.ts","sourceRoot":"","sources":["../../../../src/components/Variables/VariableEditorForm/VariableEditorForm.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AASjD,OAAO,KAAK,EAAE,kBAAkB,EAA0B,MAAM,kBAAkB,CAAC;AAEnF,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAkWjE,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"}
@@ -11,17 +11,17 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { zodResolver } from '@hookform/resolvers/zod';
15
- import { Box, Typography, Switch, TextField, Grid, FormControlLabel, MenuItem, Stack, Divider } from '@mui/material';
16
- import { DiscardChangesConfirmationDialog, ErrorAlert, ErrorBoundary, FormActions, getSubmitText, getTitleAction } from '@perses-dev/components';
17
- import { useQueryClient } from '@tanstack/react-query';
18
- import { useCallback, useState } from 'react';
19
- import { Controller, FormProvider, useForm, useFormContext, useWatch } from 'react-hook-form';
20
- import { useValidationSchemas } from '../../../context';
21
- import { PluginEditor } from '../../PluginEditor';
22
- import { VARIABLE_TYPES } from '../variable-model';
23
- import { SORT_METHODS } from './variable-editor-form-model';
24
- import { VariableListPreview, VariablePreview } from './VariablePreview';
14
+ import { zodResolver } from "@hookform/resolvers/zod";
15
+ import { Box, Typography, Switch, TextField, Grid, FormControlLabel, MenuItem, Stack, Divider } from "@mui/material";
16
+ import { DiscardChangesConfirmationDialog, ErrorAlert, ErrorBoundary, FormActions, getSubmitText, getTitleAction } from "@perses-dev/components";
17
+ import { useQueryClient } from "@tanstack/react-query";
18
+ import { useCallback, useState } from "react";
19
+ import { Controller, FormProvider, useForm, useFormContext, useWatch } from "react-hook-form";
20
+ import { useValidationSchemas } from "../../../context/index.js";
21
+ import { PluginEditor } from "../../PluginEditor/index.js";
22
+ import { VARIABLE_TYPES } from "../variable-model.js";
23
+ import { SORT_METHODS } from "./variable-editor-form-model.js";
24
+ import { VariableListPreview, VariablePreview } from "./VariablePreview.js";
25
25
  function FallbackPreview() {
26
26
  return /*#__PURE__*/ _jsx("div", {
27
27
  children: "Error previewing values"
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Variables/VariableEditorForm/VariableEditorForm.tsx"],"sourcesContent":["// Copyright 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 { zodResolver } from '@hookform/resolvers/zod';\nimport { Box, Typography, Switch, TextField, Grid, FormControlLabel, MenuItem, Stack, Divider } from '@mui/material';\nimport { Action } from '@perses-dev/client';\nimport {\n DiscardChangesConfirmationDialog,\n ErrorAlert,\n ErrorBoundary,\n FormActions,\n getSubmitText,\n getTitleAction,\n} from '@perses-dev/components';\nimport { VariableDefinition, ListVariableDefinition } from '@perses-dev/spec';\nimport { useQueryClient } from '@tanstack/react-query';\nimport { DispatchWithoutAction, ReactElement, useCallback, useState } from 'react';\nimport { Control, Controller, FormProvider, SubmitHandler, useForm, useFormContext, useWatch } from 'react-hook-form';\n\nimport { useValidationSchemas } from '../../../context';\nimport { PluginEditor } from '../../PluginEditor';\nimport { VARIABLE_TYPES } from '../variable-model';\nimport { SORT_METHODS, SortMethodName } from './variable-editor-form-model';\nimport { VariableListPreview, VariablePreview } from './VariablePreview';\n\nfunction FallbackPreview(): ReactElement {\n return <div>Error previewing values</div>;\n}\n\ninterface KindVariableEditorFormProps {\n action: Action;\n control: Control<VariableDefinition>;\n}\n\nfunction TextVariableEditorForm({ action, control }: KindVariableEditorFormProps): ReactElement {\n return (\n <>\n <Typography py={1} variant=\"subtitle1\">\n Text Options\n </Typography>\n <Stack spacing={2}>\n <Controller\n control={control}\n name=\"spec.value\"\n render={({ field, fieldState }) => (\n <>\n <Box>\n <VariablePreview values={[field.value]} />\n </Box>\n <TextField\n {...field}\n label=\"Value\"\n InputLabelProps={{ shrink: action === 'read' ? true : undefined }}\n InputProps={{\n readOnly: action === 'read',\n }}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n value={field.value ?? ''}\n onChange={(event) => {\n field.onChange(event);\n }}\n />\n </>\n )}\n />\n <Controller\n control={control}\n name=\"spec.constant\"\n render={({ field }) => (\n <FormControlLabel\n label=\"Constant\"\n control={\n <Switch\n {...field}\n checked={!!field.value}\n readOnly={action === 'read'}\n value={field.value ?? false}\n onChange={(event) => {\n if (action === 'read') return; // ReadOnly prop is not blocking user interaction...\n field.onChange(event);\n }}\n />\n }\n />\n )}\n />\n </Stack>\n </>\n );\n}\n\nfunction ListVariableEditorForm({ action, control }: KindVariableEditorFormProps): ReactElement {\n const form = useFormContext<VariableDefinition>();\n const queryClient = useQueryClient();\n\n const values = form.getValues() as ListVariableDefinition;\n /* We use `previewDefinition` to explicitly update the spec\n * that will be used for preview when running query. The reason why we do this is to avoid\n * having to re-fetch the values when the user is still editing the spec.\n * Using structuredClone to not have reference issues with nested objects.\n */\n const [previewDefinition, setPreviewDefinition] = useState(structuredClone(values));\n\n const handleRunQuery = useCallback(async () => {\n if (JSON.stringify(previewDefinition) === JSON.stringify(values)) {\n await queryClient.invalidateQueries({ queryKey: ['variable', previewDefinition] });\n } else {\n setPreviewDefinition(structuredClone(values));\n }\n }, [previewDefinition, queryClient, values]);\n\n const plugin = useWatch<VariableDefinition, 'spec.plugin'>({ control, name: 'spec.plugin' });\n const kind = plugin?.kind;\n const pluginSpec = plugin?.spec;\n\n const _allowAllValue = useWatch<VariableDefinition, 'spec.allowAllValue'>({\n control: control,\n name: 'spec.allowAllValue',\n });\n\n const _customAllValue = useWatch<VariableDefinition, 'spec.customAllValue'>({\n control: control,\n name: 'spec.customAllValue',\n });\n\n const sortMethod = useWatch<VariableDefinition, 'spec.sort'>({\n control: control,\n name: 'spec.sort',\n }) as SortMethodName;\n\n // When variable kind is selected we need to provide default values\n // TODO: check if react-hook-form has a better way to do this\n if (values.spec.allowAllValue === undefined) {\n form.setValue('spec.allowAllValue', false);\n }\n\n if (values.spec.allowMultiple === undefined) {\n form.setValue('spec.allowMultiple', false);\n }\n\n if (!values.spec.plugin) {\n form.setValue('spec.plugin', { kind: 'StaticListVariable', spec: {} });\n }\n\n if (!values.spec.sort) {\n form.setValue('spec.sort', 'none');\n }\n\n return (\n <>\n <Typography py={1} variant=\"subtitle1\">\n List Options\n </Typography>\n <Stack spacing={2} mb={2}>\n <Box>\n <ErrorBoundary FallbackComponent={FallbackPreview} resetKeys={[previewDefinition]}>\n <VariableListPreview sortMethod={sortMethod} definition={previewDefinition} />\n </ErrorBoundary>\n </Box>\n <Stack>\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <Controller\n control={control}\n name=\"spec.plugin\"\n render={({ field }) => {\n return (\n <PluginEditor\n withRunQueryButton\n width=\"100%\"\n pluginTypes={['Variable']}\n pluginKindLabel=\"Source\"\n value={{\n selection: {\n type: 'Variable',\n kind: kind ?? 'StaticListVariable',\n },\n spec: pluginSpec ?? {},\n }}\n isReadonly={action === 'read'}\n onChange={(v) => {\n field.onChange({ kind: v.selection.kind, spec: v.spec });\n }}\n onRunQuery={handleRunQuery}\n />\n );\n }}\n />\n </ErrorBoundary>\n </Stack>\n\n <Stack>\n <Controller\n control={control}\n name=\"spec.capturingRegexp\"\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n label=\"Capturing Regexp Filter\"\n InputLabelProps={{ shrink: action === 'read' ? true : undefined }}\n InputProps={{\n readOnly: action === 'read',\n }}\n error={!!fieldState.error}\n value={field.value ?? ''}\n onChange={(event) => {\n if (event.target.value === '') {\n field.onChange(undefined);\n } else {\n field.onChange(event);\n }\n }}\n helperText={\n fieldState.error?.message\n ? fieldState.error.message\n : 'Optional, if you want to filter on captured result.'\n }\n />\n )}\n />\n </Stack>\n\n <Stack>\n <Controller\n control={control}\n name=\"spec.sort\"\n render={({ field, fieldState }) => (\n <TextField\n select\n {...field}\n fullWidth\n label=\"Sort\"\n InputLabelProps={{ shrink: action === 'read' ? true : undefined }}\n InputProps={{\n readOnly: action === 'read',\n }}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n value={field.value ?? 'none'}\n onChange={(event) => {\n field.onChange(event);\n }}\n >\n {Object.keys(SORT_METHODS).map((key) => {\n if (!SORT_METHODS[key as SortMethodName]) return null;\n const { label } = SORT_METHODS[key as SortMethodName];\n return (\n <MenuItem key={key} value={key}>\n {label}\n </MenuItem>\n );\n })}\n </TextField>\n )}\n />\n </Stack>\n </Stack>\n\n <Divider />\n\n <Typography py={1} variant=\"subtitle1\">\n Dropdown Options\n </Typography>\n <Stack spacing=\"2\">\n <Stack>\n <Controller\n control={control}\n name=\"spec.allowMultiple\"\n render={({ field }) => (\n <FormControlLabel\n label=\"Allow Multiple Values\"\n control={\n <Switch\n {...field}\n checked={!!field.value}\n readOnly={action === 'read'}\n value={field.value ?? false}\n onChange={(event) => {\n if (action === 'read') return; // ReadOnly prop is not blocking user interaction...\n field.onChange(event);\n }}\n />\n }\n />\n )}\n />\n <Typography variant=\"caption\">Enables multiple values to be selected at the same time</Typography>\n </Stack>\n <Stack>\n <Controller\n control={control}\n name=\"spec.allowAllValue\"\n render={({ field }) => (\n <FormControlLabel\n label=\"Allow All option\"\n control={\n <Switch\n {...field}\n checked={!!field.value}\n readOnly={action === 'read'}\n value={field.value ?? false}\n onChange={(event) => {\n if (action === 'read') return; // ReadOnly prop is not blocking user interaction...\n field.onChange(event);\n }}\n />\n }\n />\n )}\n />\n <Typography mb={1} variant=\"caption\">\n Enables an option to include all variable values\n </Typography>\n {_allowAllValue && (\n <Stack spacing={1}>\n <FormControlLabel\n label=\"Use Custom All Value\"\n control={\n <Switch\n checked={_customAllValue !== undefined}\n readOnly={action === 'read'}\n onChange={(event) => {\n if (action === 'read') return;\n const isEnabled = event.target.checked;\n if (isEnabled) {\n form.setValue('spec.customAllValue', '');\n } else {\n form.setValue('spec.customAllValue', undefined);\n }\n }}\n />\n }\n />\n <Typography variant=\"caption\" sx={{ mt: -0.5 }}>\n Enable to set a custom value when &quot;All&quot; is selected\n </Typography>\n {_customAllValue !== undefined && (\n <Controller\n control={control}\n name=\"spec.customAllValue\"\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n fullWidth\n label=\"Custom All Value\"\n InputLabelProps={{ shrink: action === 'read' ? true : undefined }}\n InputProps={{\n readOnly: action === 'read',\n }}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n value={field.value ?? ''}\n onChange={(event) => {\n field.onChange(event.target.value || '');\n }}\n />\n )}\n />\n )}\n </Stack>\n )}\n </Stack>\n </Stack>\n </>\n );\n}\n\ninterface VariableEditorFormProps {\n initialVariableDefinition: VariableDefinition;\n action: Action;\n isDraft: boolean;\n isReadonly?: boolean;\n onActionChange?: (action: Action) => void;\n onSave: (def: VariableDefinition) => void;\n onClose: () => void;\n onDelete?: DispatchWithoutAction;\n}\n\nexport function VariableEditorForm({\n initialVariableDefinition,\n action,\n isDraft,\n isReadonly,\n onActionChange,\n onSave,\n onClose,\n onDelete,\n}: VariableEditorFormProps): ReactElement {\n const [isDiscardDialogOpened, setDiscardDialogOpened] = useState<boolean>(false);\n const titleAction = getTitleAction(action, isDraft);\n const submitText = getSubmitText(action, isDraft);\n\n const { variableEditorSchema } = useValidationSchemas();\n const form = useForm<VariableDefinition>({\n resolver: zodResolver(variableEditorSchema),\n mode: 'onBlur',\n defaultValues: initialVariableDefinition,\n });\n\n const kind = useWatch({ control: form.control, name: 'kind' });\n\n function clearFormData(data: VariableDefinition): VariableDefinition {\n const result = { ...data };\n if (\n result.spec.display?.name === undefined &&\n result.spec.display?.description === undefined &&\n result.spec.display?.hidden === undefined\n ) {\n delete result.spec.display;\n }\n return result;\n }\n\n const processForm: SubmitHandler<VariableDefinition> = (data: VariableDefinition) => {\n // reset display attributes to undefined when empty, because we don't want to save empty strings\n onSave(clearFormData(data));\n };\n\n // When user click on cancel, several possibilities:\n // - create action: ask for discard approval\n // - update action: ask for discard approval if changed\n // - read action: don´t ask for discard approval\n function handleCancel(): void {\n if (JSON.stringify(initialVariableDefinition) !== JSON.stringify(clearFormData(form.getValues()))) {\n setDiscardDialogOpened(true);\n } else {\n onClose();\n }\n }\n\n return (\n <FormProvider {...form}>\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n padding: (theme) => theme.spacing(1, 2),\n borderBottom: (theme) => `1px solid ${theme.palette.divider}`,\n }}\n >\n <Typography variant=\"h2\">{titleAction} Variable</Typography>\n <FormActions\n action={action}\n submitText={submitText}\n isReadonly={isReadonly}\n isValid={form.formState.isValid}\n onActionChange={onActionChange}\n onSubmit={form.handleSubmit(processForm)}\n onDelete={onDelete}\n onCancel={handleCancel}\n />\n </Box>\n <Box padding={2} sx={{ overflowY: 'scroll' }}>\n <Grid container spacing={2} mb={2}>\n <Grid item xs={8}>\n <Controller\n control={form.control}\n name=\"spec.name\"\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n required\n fullWidth\n label=\"Name\"\n InputLabelProps={{ shrink: action === 'read' ? true : undefined }}\n InputProps={{\n disabled: action === 'update' && !isDraft,\n readOnly: action === 'read',\n }}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n value={field.value ?? ''}\n onChange={(event) => {\n field.onChange(event);\n }}\n />\n )}\n />\n </Grid>\n <Grid item xs={4}>\n <Controller\n control={form.control}\n name=\"spec.display.name\"\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n fullWidth\n label=\"Display Label\"\n InputLabelProps={{ shrink: action === 'read' ? true : undefined }}\n InputProps={{\n readOnly: action === 'read',\n }}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n value={field.value ?? ''}\n onChange={(event) => {\n field.onChange(event);\n }}\n />\n )}\n />\n </Grid>\n <Grid item xs={8}>\n <Controller\n control={form.control}\n name=\"spec.display.description\"\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n fullWidth\n label=\"Description\"\n InputLabelProps={{ shrink: action === 'read' ? true : undefined }}\n InputProps={{\n readOnly: action === 'read',\n }}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n value={field.value ?? ''}\n onChange={(event) => {\n field.onChange(event);\n }}\n />\n )}\n />\n </Grid>\n <Grid item xs={4}>\n <Controller\n control={form.control}\n name=\"kind\"\n render={({ field, fieldState }) => (\n <TextField\n select\n {...field}\n fullWidth\n label=\"Type\"\n InputLabelProps={{ shrink: action === 'read' ? true : undefined }}\n InputProps={{\n readOnly: action === 'read',\n }}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n value={field.value ?? 'TextVariable'}\n onChange={(event) => {\n field.onChange(event);\n }}\n >\n {VARIABLE_TYPES.map((v) => (\n <MenuItem key={v.kind} value={v.kind}>\n {v.label}\n </MenuItem>\n ))}\n </TextField>\n )}\n />\n </Grid>\n </Grid>\n\n <Divider />\n\n {kind === 'TextVariable' && (\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <TextVariableEditorForm action={action} control={form.control} />\n </ErrorBoundary>\n )}\n {kind === 'ListVariable' && (\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <ListVariableEditorForm action={action} control={form.control} />\n </ErrorBoundary>\n )}\n </Box>\n <DiscardChangesConfirmationDialog\n description=\"Are you sure you want to discard these changes? Changes cannot be recovered.\"\n isOpen={isDiscardDialogOpened}\n onCancel={() => {\n setDiscardDialogOpened(false);\n }}\n onDiscardChanges={() => {\n setDiscardDialogOpened(false);\n onClose();\n }}\n />\n </FormProvider>\n );\n}\n"],"names":["zodResolver","Box","Typography","Switch","TextField","Grid","FormControlLabel","MenuItem","Stack","Divider","DiscardChangesConfirmationDialog","ErrorAlert","ErrorBoundary","FormActions","getSubmitText","getTitleAction","useQueryClient","useCallback","useState","Controller","FormProvider","useForm","useFormContext","useWatch","useValidationSchemas","PluginEditor","VARIABLE_TYPES","SORT_METHODS","VariableListPreview","VariablePreview","FallbackPreview","div","TextVariableEditorForm","action","control","py","variant","spacing","name","render","field","fieldState","values","value","label","InputLabelProps","shrink","undefined","InputProps","readOnly","error","helperText","message","onChange","event","checked","ListVariableEditorForm","form","queryClient","getValues","previewDefinition","setPreviewDefinition","structuredClone","handleRunQuery","JSON","stringify","invalidateQueries","queryKey","plugin","kind","pluginSpec","spec","_allowAllValue","_customAllValue","sortMethod","allowAllValue","setValue","allowMultiple","sort","mb","FallbackComponent","resetKeys","definition","withRunQueryButton","width","pluginTypes","pluginKindLabel","selection","type","isReadonly","v","onRunQuery","target","select","fullWidth","Object","keys","map","key","isEnabled","sx","mt","VariableEditorForm","initialVariableDefinition","isDraft","onActionChange","onSave","onClose","onDelete","isDiscardDialogOpened","setDiscardDialogOpened","titleAction","submitText","variableEditorSchema","resolver","mode","defaultValues","clearFormData","data","result","display","description","hidden","processForm","handleCancel","alignItems","padding","theme","borderBottom","palette","divider","isValid","formState","onSubmit","handleSubmit","onCancel","overflowY","container","item","xs","required","disabled","isOpen","onDiscardChanges"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAA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BAAmBrE;kCAChC,cAAA,KAAC6C;4BAAuBvB,QAAQA;4BAAQC,SAASuB,KAAKvB,OAAO;;;;;0BAInE,KAACxB;gBACC+G,aAAY;gBACZqB,QAAQjC;gBACR0B,UAAU;oBACRzB,uBAAuB;gBACzB;gBACAiC,kBAAkB;oBAChBjC,uBAAuB;oBACvBH;gBACF;;;;AAIR"}
1
+ {"version":3,"sources":["../../../../src/components/Variables/VariableEditorForm/VariableEditorForm.tsx"],"sourcesContent":["// Copyright 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 { zodResolver } from '@hookform/resolvers/zod';\nimport { Box, Typography, Switch, TextField, Grid, FormControlLabel, MenuItem, Stack, Divider } from '@mui/material';\nimport type { Action } from '@perses-dev/client';\nimport {\n DiscardChangesConfirmationDialog,\n ErrorAlert,\n ErrorBoundary,\n FormActions,\n getSubmitText,\n getTitleAction,\n} from '@perses-dev/components';\nimport type { VariableDefinition, ListVariableDefinition } from '@perses-dev/spec';\nimport { useQueryClient } from '@tanstack/react-query';\nimport type { DispatchWithoutAction, ReactElement } from 'react';\nimport { useCallback, useState } from 'react';\nimport type { Control, SubmitHandler } from 'react-hook-form';\nimport { Controller, FormProvider, useForm, useFormContext, useWatch } from 'react-hook-form';\n\nimport { useValidationSchemas } from '../../../context';\nimport { PluginEditor } from '../../PluginEditor';\nimport { VARIABLE_TYPES } from '../variable-model';\nimport type { SortMethodName } from './variable-editor-form-model';\nimport { SORT_METHODS } from './variable-editor-form-model';\nimport { VariableListPreview, VariablePreview } from './VariablePreview';\n\nfunction FallbackPreview(): ReactElement {\n return <div>Error previewing values</div>;\n}\n\ninterface KindVariableEditorFormProps {\n action: Action;\n control: Control<VariableDefinition>;\n}\n\nfunction TextVariableEditorForm({ action, control }: KindVariableEditorFormProps): ReactElement {\n return (\n <>\n <Typography py={1} variant=\"subtitle1\">\n Text Options\n </Typography>\n <Stack spacing={2}>\n <Controller\n control={control}\n name=\"spec.value\"\n render={({ field, fieldState }) => (\n <>\n <Box>\n <VariablePreview values={[field.value]} />\n </Box>\n <TextField\n {...field}\n label=\"Value\"\n InputLabelProps={{ shrink: action === 'read' ? true : undefined }}\n InputProps={{\n readOnly: action === 'read',\n }}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n value={field.value ?? ''}\n onChange={(event) => {\n field.onChange(event);\n }}\n />\n </>\n )}\n />\n <Controller\n control={control}\n name=\"spec.constant\"\n render={({ field }) => (\n <FormControlLabel\n label=\"Constant\"\n control={\n <Switch\n {...field}\n checked={!!field.value}\n readOnly={action === 'read'}\n value={field.value ?? false}\n onChange={(event) => {\n if (action === 'read') return; // ReadOnly prop is not blocking user interaction...\n field.onChange(event);\n }}\n />\n }\n />\n )}\n />\n </Stack>\n </>\n );\n}\n\nfunction ListVariableEditorForm({ action, control }: KindVariableEditorFormProps): ReactElement {\n const form = useFormContext<VariableDefinition>();\n const queryClient = useQueryClient();\n\n const values = form.getValues() as ListVariableDefinition;\n /* We use `previewDefinition` to explicitly update the spec\n * that will be used for preview when running query. The reason why we do this is to avoid\n * having to re-fetch the values when the user is still editing the spec.\n * Using structuredClone to not have reference issues with nested objects.\n */\n const [previewDefinition, setPreviewDefinition] = useState(structuredClone(values));\n\n const handleRunQuery = useCallback(async () => {\n if (JSON.stringify(previewDefinition) === JSON.stringify(values)) {\n await queryClient.invalidateQueries({ queryKey: ['variable', previewDefinition] });\n } else {\n setPreviewDefinition(structuredClone(values));\n }\n }, [previewDefinition, queryClient, values]);\n\n const plugin = useWatch<VariableDefinition, 'spec.plugin'>({ control, name: 'spec.plugin' });\n const kind = plugin?.kind;\n const pluginSpec = plugin?.spec;\n\n const _allowAllValue = useWatch<VariableDefinition, 'spec.allowAllValue'>({\n control: control,\n name: 'spec.allowAllValue',\n });\n\n const _customAllValue = useWatch<VariableDefinition, 'spec.customAllValue'>({\n control: control,\n name: 'spec.customAllValue',\n });\n\n const sortMethod = useWatch<VariableDefinition, 'spec.sort'>({\n control: control,\n name: 'spec.sort',\n }) as SortMethodName;\n\n // When variable kind is selected we need to provide default values\n // TODO: check if react-hook-form has a better way to do this\n if (values.spec.allowAllValue === undefined) {\n form.setValue('spec.allowAllValue', false);\n }\n\n if (values.spec.allowMultiple === undefined) {\n form.setValue('spec.allowMultiple', false);\n }\n\n if (!values.spec.plugin) {\n form.setValue('spec.plugin', { kind: 'StaticListVariable', spec: {} });\n }\n\n if (!values.spec.sort) {\n form.setValue('spec.sort', 'none');\n }\n\n return (\n <>\n <Typography py={1} variant=\"subtitle1\">\n List Options\n </Typography>\n <Stack spacing={2} mb={2}>\n <Box>\n <ErrorBoundary FallbackComponent={FallbackPreview} resetKeys={[previewDefinition]}>\n <VariableListPreview sortMethod={sortMethod} definition={previewDefinition} />\n </ErrorBoundary>\n </Box>\n <Stack>\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <Controller\n control={control}\n name=\"spec.plugin\"\n render={({ field }) => {\n return (\n <PluginEditor\n withRunQueryButton\n width=\"100%\"\n pluginTypes={['Variable']}\n pluginKindLabel=\"Source\"\n value={{\n selection: {\n type: 'Variable',\n kind: kind ?? 'StaticListVariable',\n },\n spec: pluginSpec ?? {},\n }}\n isReadonly={action === 'read'}\n onChange={(v) => {\n field.onChange({ kind: v.selection.kind, spec: v.spec });\n }}\n onRunQuery={handleRunQuery}\n />\n );\n }}\n />\n </ErrorBoundary>\n </Stack>\n\n <Stack>\n <Controller\n control={control}\n name=\"spec.capturingRegexp\"\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n label=\"Capturing Regexp Filter\"\n InputLabelProps={{ shrink: action === 'read' ? true : undefined }}\n InputProps={{\n readOnly: action === 'read',\n }}\n error={!!fieldState.error}\n value={field.value ?? ''}\n onChange={(event) => {\n if (event.target.value === '') {\n field.onChange(undefined);\n } else {\n field.onChange(event);\n }\n }}\n helperText={\n fieldState.error?.message\n ? fieldState.error.message\n : 'Optional, if you want to filter on captured result.'\n }\n />\n )}\n />\n </Stack>\n\n <Stack>\n <Controller\n control={control}\n name=\"spec.sort\"\n render={({ field, fieldState }) => (\n <TextField\n select\n {...field}\n fullWidth\n label=\"Sort\"\n InputLabelProps={{ shrink: action === 'read' ? true : undefined }}\n InputProps={{\n readOnly: action === 'read',\n }}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n value={field.value ?? 'none'}\n onChange={(event) => {\n field.onChange(event);\n }}\n >\n {Object.keys(SORT_METHODS).map((key) => {\n if (!SORT_METHODS[key as SortMethodName]) return null;\n const { label } = SORT_METHODS[key as SortMethodName];\n return (\n <MenuItem key={key} value={key}>\n {label}\n </MenuItem>\n );\n })}\n </TextField>\n )}\n />\n </Stack>\n </Stack>\n\n <Divider />\n\n <Typography py={1} variant=\"subtitle1\">\n Dropdown Options\n </Typography>\n <Stack spacing=\"2\">\n <Stack>\n <Controller\n control={control}\n name=\"spec.allowMultiple\"\n render={({ field }) => (\n <FormControlLabel\n label=\"Allow Multiple Values\"\n control={\n <Switch\n {...field}\n checked={!!field.value}\n readOnly={action === 'read'}\n value={field.value ?? false}\n onChange={(event) => {\n if (action === 'read') return; // ReadOnly prop is not blocking user interaction...\n field.onChange(event);\n }}\n />\n }\n />\n )}\n />\n <Typography variant=\"caption\">Enables multiple values to be selected at the same time</Typography>\n </Stack>\n <Stack>\n <Controller\n control={control}\n name=\"spec.allowAllValue\"\n render={({ field }) => (\n <FormControlLabel\n label=\"Allow All option\"\n control={\n <Switch\n {...field}\n checked={!!field.value}\n readOnly={action === 'read'}\n value={field.value ?? false}\n onChange={(event) => {\n if (action === 'read') return; // ReadOnly prop is not blocking user interaction...\n field.onChange(event);\n }}\n />\n }\n />\n )}\n />\n <Typography mb={1} variant=\"caption\">\n Enables an option to include all variable values\n </Typography>\n {_allowAllValue && (\n <Stack spacing={1}>\n <FormControlLabel\n label=\"Use Custom All Value\"\n control={\n <Switch\n checked={_customAllValue !== undefined}\n readOnly={action === 'read'}\n onChange={(event) => {\n if (action === 'read') return;\n const isEnabled = event.target.checked;\n if (isEnabled) {\n form.setValue('spec.customAllValue', '');\n } else {\n form.setValue('spec.customAllValue', undefined);\n }\n }}\n />\n }\n />\n <Typography variant=\"caption\" sx={{ mt: -0.5 }}>\n Enable to set a custom value when &quot;All&quot; is selected\n </Typography>\n {_customAllValue !== undefined && (\n <Controller\n control={control}\n name=\"spec.customAllValue\"\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n fullWidth\n label=\"Custom All Value\"\n InputLabelProps={{ shrink: action === 'read' ? true : undefined }}\n InputProps={{\n readOnly: action === 'read',\n }}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n value={field.value ?? ''}\n onChange={(event) => {\n field.onChange(event.target.value || '');\n }}\n />\n )}\n />\n )}\n </Stack>\n )}\n </Stack>\n </Stack>\n </>\n );\n}\n\ninterface VariableEditorFormProps {\n initialVariableDefinition: VariableDefinition;\n action: Action;\n isDraft: boolean;\n isReadonly?: boolean;\n onActionChange?: (action: Action) => void;\n onSave: (def: VariableDefinition) => void;\n onClose: () => void;\n onDelete?: DispatchWithoutAction;\n}\n\nexport function VariableEditorForm({\n initialVariableDefinition,\n action,\n isDraft,\n isReadonly,\n onActionChange,\n onSave,\n onClose,\n onDelete,\n}: VariableEditorFormProps): ReactElement {\n const [isDiscardDialogOpened, setDiscardDialogOpened] = useState<boolean>(false);\n const titleAction = getTitleAction(action, isDraft);\n const submitText = getSubmitText(action, isDraft);\n\n const { variableEditorSchema } = useValidationSchemas();\n const form = useForm<VariableDefinition>({\n resolver: zodResolver(variableEditorSchema),\n mode: 'onBlur',\n defaultValues: initialVariableDefinition,\n });\n\n const kind = useWatch({ control: form.control, name: 'kind' });\n\n function clearFormData(data: VariableDefinition): VariableDefinition {\n const result = { ...data };\n if (\n result.spec.display?.name === undefined &&\n result.spec.display?.description === undefined &&\n result.spec.display?.hidden === undefined\n ) {\n delete result.spec.display;\n }\n return result;\n }\n\n const processForm: SubmitHandler<VariableDefinition> = (data: VariableDefinition) => {\n // reset display attributes to undefined when empty, because we don't want to save empty strings\n onSave(clearFormData(data));\n };\n\n // When user click on cancel, several possibilities:\n // - create action: ask for discard approval\n // - update action: ask for discard approval if changed\n // - read action: don´t ask for discard approval\n function handleCancel(): void {\n if (JSON.stringify(initialVariableDefinition) !== JSON.stringify(clearFormData(form.getValues()))) {\n setDiscardDialogOpened(true);\n } else {\n onClose();\n }\n }\n\n return (\n <FormProvider {...form}>\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n padding: (theme) => theme.spacing(1, 2),\n borderBottom: (theme) => `1px solid ${theme.palette.divider}`,\n }}\n >\n <Typography variant=\"h2\">{titleAction} Variable</Typography>\n <FormActions\n action={action}\n submitText={submitText}\n isReadonly={isReadonly}\n isValid={form.formState.isValid}\n onActionChange={onActionChange}\n onSubmit={form.handleSubmit(processForm)}\n onDelete={onDelete}\n onCancel={handleCancel}\n />\n </Box>\n <Box padding={2} sx={{ overflowY: 'scroll' }}>\n <Grid container spacing={2} mb={2}>\n <Grid item xs={8}>\n <Controller\n control={form.control}\n name=\"spec.name\"\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n required\n fullWidth\n label=\"Name\"\n InputLabelProps={{ shrink: action === 'read' ? true : undefined }}\n InputProps={{\n disabled: action === 'update' && !isDraft,\n readOnly: action === 'read',\n }}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n value={field.value ?? ''}\n onChange={(event) => {\n field.onChange(event);\n }}\n />\n )}\n />\n </Grid>\n <Grid item xs={4}>\n <Controller\n control={form.control}\n name=\"spec.display.name\"\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n fullWidth\n label=\"Display Label\"\n InputLabelProps={{ shrink: action === 'read' ? true : undefined }}\n InputProps={{\n readOnly: action === 'read',\n }}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n value={field.value ?? ''}\n onChange={(event) => {\n field.onChange(event);\n }}\n />\n )}\n />\n </Grid>\n <Grid item xs={8}>\n <Controller\n control={form.control}\n name=\"spec.display.description\"\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n fullWidth\n label=\"Description\"\n InputLabelProps={{ shrink: action === 'read' ? true : undefined }}\n InputProps={{\n readOnly: action === 'read',\n }}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n value={field.value ?? ''}\n onChange={(event) => {\n field.onChange(event);\n }}\n />\n )}\n />\n </Grid>\n <Grid item xs={4}>\n <Controller\n control={form.control}\n name=\"kind\"\n render={({ field, fieldState }) => (\n <TextField\n select\n {...field}\n fullWidth\n label=\"Type\"\n InputLabelProps={{ shrink: action === 'read' ? true : undefined }}\n InputProps={{\n readOnly: action === 'read',\n }}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n value={field.value ?? 'TextVariable'}\n onChange={(event) => {\n field.onChange(event);\n }}\n >\n {VARIABLE_TYPES.map((v) => (\n <MenuItem key={v.kind} value={v.kind}>\n {v.label}\n </MenuItem>\n ))}\n </TextField>\n )}\n />\n </Grid>\n </Grid>\n\n <Divider />\n\n {kind === 'TextVariable' && (\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <TextVariableEditorForm action={action} control={form.control} />\n </ErrorBoundary>\n )}\n {kind === 'ListVariable' && (\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <ListVariableEditorForm action={action} control={form.control} />\n </ErrorBoundary>\n )}\n </Box>\n <DiscardChangesConfirmationDialog\n description=\"Are you sure you want to discard these changes? Changes cannot be recovered.\"\n isOpen={isDiscardDialogOpened}\n onCancel={() => {\n setDiscardDialogOpened(false);\n }}\n onDiscardChanges={() => {\n setDiscardDialogOpened(false);\n onClose();\n }}\n />\n </FormProvider>\n );\n}\n"],"names":["zodResolver","Box","Typography","Switch","TextField","Grid","FormControlLabel","MenuItem","Stack","Divider","DiscardChangesConfirmationDialog","ErrorAlert","ErrorBoundary","FormActions","getSubmitText","getTitleAction","useQueryClient","useCallback","useState","Controller","FormProvider","useForm","useFormContext","useWatch","useValidationSchemas","PluginEditor","VARIABLE_TYPES","SORT_METHODS","VariableListPreview","VariablePreview","FallbackPreview","div","TextVariableEditorForm","action","control","py","variant","spacing","name","render","field","fieldState","values","value","label","InputLabelProps","shrink","undefined","InputProps","readOnly","error","helperText","message","onChange","event","checked","ListVariableEditorForm","form","queryClient","getValues","previewDefinition","setPreviewDefinition","structuredClone","handleRunQuery","JSON","stringify","invalidateQueries","queryKey","plugin","kind","pluginSpec","spec","_allowAllValue","_customAllValue","sortMethod","allowAllValue","setValue","allowMultiple","sort","mb","FallbackComponent","resetKeys","definition","withRunQueryButton","width","pluginTypes","pluginKindLabel","selection","type","isReadonly","v","onRunQuery","target","select","fullWidth","Object","keys","map","key","isEnabled","sx","mt","VariableEditorForm","initialVariableDefinition","isDraft","onActionChange","onSave","onClose","onDelete","isDiscardDialogOpened","setDiscardDialogOpened","titleAction","submitText","variableEditorSchema","resolver","mode","defaultValues","clearFormData","data","result","display","description","hidden","processForm","handleCancel","alignItems","padding","theme","borderBottom","palette","divider","isValid","formState","onSubmit","handleSubmit","onCancel","overflowY","container","item","xs","required","disabled","isOpen","onDiscardChanges"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,WAAW,QAAQ,0BAA0B;AACtD,SAASC,GAAG,EAAEC,UAAU,EAAEC,MAAM,EAAEC,SAAS,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,OAAO,QAAQ,gBAAgB;AAErH,SACEC,gCAAgC,EAChCC,UAAU,EACVC,aA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I;4CACtBU,UAAU,CAACC;gDACTd,MAAMa,QAAQ,CAACC;4CACjB;;;;0CAKR,KAACjD;gCAAKqI,IAAI;gCAACC,IAAI;0CACb,cAAA,KAACxH;oCACCe,SAASuB,KAAKvB,OAAO;oCACrBI,MAAK;oCACLC,QAAQ,CAAC,EAAEC,KAAK,EAAEC,UAAU,EAAE,iBAC5B,KAACrC;4CACCyF,MAAM;4CACL,GAAGrD,KAAK;4CACTsD,SAAS;4CACTlD,OAAM;4CACNC,iBAAiB;gDAAEC,QAAQb,WAAW,SAAS,OAAOc;4CAAU;4CAChEC,YAAY;gDACVC,UAAUhB,WAAW;4CACvB;4CACAiB,OAAO,CAAC,CAACT,WAAWS,KAAK;4CACzBC,YAAYV,WAAWS,KAAK,EAAEE;4CAC9BT,OAAOH,MAAMG,KAAK,IAAI;4CACtBU,UAAU,CAACC;gDACTd,MAAMa,QAAQ,CAACC;4CACjB;sDAEC5B,eAAeuE,GAAG,CAAC,CAACP,kBACnB,KAACnF;oDAAsBoC,OAAO+C,EAAErB,IAAI;8DACjCqB,EAAE9C,KAAK;mDADK8C,EAAErB,IAAI;;;;;;kCAUjC,KAAC5D;oBAEA4D,SAAS,gCACR,KAACzD;wBAAcoE,mBAAmBrE;kCAChC,cAAA,KAACqB;4BAAuBC,QAAQA;4BAAQC,SAASuB,KAAKvB,OAAO;;;oBAGhEmC,SAAS,gCACR,KAACzD;wBAAcoE,mBAAmBrE;kCAChC,cAAA,KAAC6C;4BAAuBvB,QAAQA;4BAAQC,SAASuB,KAAKvB,OAAO;;;;;0BAInE,KAACxB;gBACC+G,aAAY;gBACZqB,QAAQjC;gBACR0B,UAAU;oBACRzB,uBAAuB;gBACzB;gBACAiC,kBAAkB;oBAChBjC,uBAAuB;oBACvBH;gBACF;;;;AAIR"}
@@ -1,5 +1,5 @@
1
- import { ListVariableDefinition } from '@perses-dev/spec';
2
- import { ReactElement } from 'react';
1
+ import type { ListVariableDefinition } from '@perses-dev/spec';
2
+ import type { ReactElement } from 'react';
3
3
  import { SORT_METHODS } from './variable-editor-form-model';
4
4
  interface VariablePreviewProps {
5
5
  values?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"VariablePreview.d.ts","sourceRoot":"","sources":["../../../../src/components/Variables/VariableEditorForm/VariablePreview.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAc,EAAE,YAAY,EAAqB,MAAM,OAAO,CAAC;AAI/D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAI5D,UAAU,oBAAoB;IAC5B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,CA4DzE;AAED,UAAU,wBAAwB;IAChC,UAAU,EAAE,sBAAsB,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,OAAO,YAAY,CAAC;CACxC;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,YAAY,CAmBjF"}
1
+ {"version":3,"file":"VariablePreview.d.ts","sourceRoot":"","sources":["../../../../src/components/Variables/VariableEditorForm/VariablePreview.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAI5D,UAAU,oBAAoB;IAC5B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,CA4DzE;AAED,UAAU,wBAAwB;IAChC,UAAU,EAAE,sBAAsB,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,OAAO,YAAY,CAAC;CACxC;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,YAAY,CAoBjF"}
@@ -11,13 +11,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { Alert, Box, Card, Chip, CircularProgress, IconButton, Stack, Typography } from '@mui/material';
15
- import { InfoTooltip, useSnackbar } from '@perses-dev/components';
16
- import Clipboard from 'mdi-material-ui/ClipboardOutline';
17
- import React, { useMemo, useState } from 'react';
18
- import { TOOLTIP_TEXT } from '../../../constants';
19
- import { useListVariablePluginValues } from '../variable-model';
20
- import { SORT_METHODS } from './variable-editor-form-model';
14
+ import { Alert, Box, Card, Chip, CircularProgress, IconButton, Stack, Typography } from "@mui/material";
15
+ import { InfoTooltip, useSnackbar } from "@perses-dev/components";
16
+ import Clipboard from "mdi-material-ui/ClipboardOutline";
17
+ import React, { useMemo, useState } from "react";
18
+ import { TOOLTIP_TEXT } from "../../../constants/index.js";
19
+ import { useListVariablePluginValues } from "../variable-model.js";
20
+ import { SORT_METHODS } from "./variable-editor-form-model.js";
21
21
  const DEFAULT_MAX_PREVIEW_VALUES = 50;
22
22
  export function VariablePreview(props) {
23
23
  const { values, isLoading, error } = props;
@@ -115,6 +115,7 @@ export function VariableListPreview(props) {
115
115
  const { definition, sortMethod } = props;
116
116
  const { data, isFetching, error } = useListVariablePluginValues(definition);
117
117
  const errorMessage = error?.message;
118
+ // oxlint-disable-next-line unicorn/no-array-sort Calling sort of object, not the built-in array sort function
118
119
  const result = !sortMethod || sortMethod === 'none' || !data ? data : SORT_METHODS[sortMethod].sort(data);
119
120
  const variablePreview = useMemo(()=>/*#__PURE__*/ _jsx(VariablePreview, {
120
121
  values: result?.map((val)=>val.label || val.value),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Variables/VariableEditorForm/VariablePreview.tsx"],"sourcesContent":["// Copyright 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 { Alert, Box, Card, Chip, CircularProgress, IconButton, Stack, Typography } from '@mui/material';\nimport { InfoTooltip, useSnackbar } from '@perses-dev/components';\nimport { ListVariableDefinition } from '@perses-dev/spec';\nimport Clipboard from 'mdi-material-ui/ClipboardOutline';\nimport React, { ReactElement, useMemo, useState } from 'react';\n\nimport { TOOLTIP_TEXT } from '../../../constants';\nimport { useListVariablePluginValues } from '../variable-model';\nimport { SORT_METHODS } from './variable-editor-form-model';\n\nconst DEFAULT_MAX_PREVIEW_VALUES = 50;\n\ninterface VariablePreviewProps {\n values?: string[];\n isLoading?: boolean;\n error?: string;\n}\n\nexport function VariablePreview(props: VariablePreviewProps): ReactElement {\n const { values, isLoading, error } = props;\n const [maxValues, setMaxValues] = useState<number | undefined>(DEFAULT_MAX_PREVIEW_VALUES);\n const { infoSnackbar } = useSnackbar();\n const showAll = (): void => {\n setMaxValues(undefined);\n };\n let notShown = 0;\n\n if (values && values?.length > 0 && maxValues) {\n notShown = values.length - maxValues;\n }\n\n const variablePreviewState = useMemo((): ReactElement | null => {\n if (isLoading) {\n return (\n <Stack width=\"100%\" sx={{ alignItems: 'center', justifyContent: 'center' }}>\n <CircularProgress />\n </Stack>\n );\n } else if (error) {\n return <Alert severity=\"error\">{error}</Alert>;\n } else if (!values?.length) {\n return <Alert severity=\"info\">No results</Alert>;\n }\n return null;\n }, [error, isLoading, values]);\n\n return (\n <Box>\n <Stack direction=\"row\" spacing={1} alignItems=\"center\" mb={1}>\n <Typography variant=\"h4\">Preview Values</Typography>\n <InfoTooltip description={TOOLTIP_TEXT.copyVariableValues}>\n <IconButton\n onClick={async () => {\n if (values?.length) {\n await navigator.clipboard.writeText(values.map((value) => value).join(', '));\n infoSnackbar('Preview values copied to clipboard!');\n }\n }}\n size=\"small\"\n >\n <Clipboard />\n </IconButton>\n </InfoTooltip>\n </Stack>\n <Card variant=\"outlined\">\n <Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 1, m: 2 }}>\n {variablePreviewState}\n {values\n ?.slice(0, maxValues)\n .filter((val) => val)\n .map((val, index) => (\n <Chip size=\"small\" key={index} label={val} />\n ))}\n {notShown > 0 && <Chip onClick={showAll} variant=\"outlined\" size=\"small\" label={`+${notShown} more`} />}\n </Box>\n </Card>\n </Box>\n );\n}\n\ninterface VariableListPreviewProps {\n definition: ListVariableDefinition;\n sortMethod?: keyof typeof SORT_METHODS;\n}\n\nexport function VariableListPreview(props: VariableListPreviewProps): ReactElement {\n const { definition, sortMethod } = props;\n const { data, isFetching, error } = useListVariablePluginValues(definition);\n const errorMessage = (error as Error)?.message;\n\n const result = !sortMethod || sortMethod === 'none' || !data ? data : SORT_METHODS[sortMethod].sort(data);\n\n const variablePreview = useMemo(\n () => (\n <VariablePreview\n values={result?.map((val) => val.label || val.value)}\n isLoading={isFetching}\n error={errorMessage}\n />\n ),\n [errorMessage, isFetching, result],\n );\n\n return variablePreview;\n}\n"],"names":["Alert","Box","Card","Chip","CircularProgress","IconButton","Stack","Typography","InfoTooltip","useSnackbar","Clipboard","React","useMemo","useState","TOOLTIP_TEXT","useListVariablePluginValues","SORT_METHODS","DEFAULT_MAX_PREVIEW_VALUES","VariablePreview","props","values","isLoading","error","maxValues","setMaxValues","infoSnackbar","showAll","undefined","notShown","length","variablePreviewState","width","sx","alignItems","justifyContent","severity","direction","spacing","mb","variant","description","copyVariableValues","onClick","navigator","clipboard","writeText","map","value","join","size","display","flexWrap","gap","m","slice","filter","val","index","label","VariableListPreview","definition","sortMethod","data","isFetching","errorMessage","message","result","sort","variablePreview"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,KAAK,EAAEC,GAAG,EAAEC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,UAAU,EAAEC,KAAK,EAAEC,UAAU,QAAQ,gBAAgB;AACxG,SAASC,WAAW,EAAEC,WAAW,QAAQ,yBAAyB;AAElE,OAAOC,eAAe,mCAAmC;AACzD,OAAOC,SAAuBC,OAAO,EAAEC,QAAQ,QAAQ,QAAQ;AAE/D,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,2BAA2B,QAAQ,oBAAoB;AAChE,SAASC,YAAY,QAAQ,+BAA+B;AAE5D,MAAMC,6BAA6B;AAQnC,OAAO,SAASC,gBAAgBC,KAA2B;IACzD,MAAM,EAAEC,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGH;IACrC,MAAM,CAACI,WAAWC,aAAa,GAAGX,SAA6BI;IAC/D,MAAM,EAAEQ,YAAY,EAAE,GAAGhB;IACzB,MAAMiB,UAAU;QACdF,aAAaG;IACf;IACA,IAAIC,WAAW;IAEf,IAAIR,UAAUA,QAAQS,SAAS,KAAKN,WAAW;QAC7CK,WAAWR,OAAOS,MAAM,GAAGN;IAC7B;IAEA,MAAMO,uBAAuBlB,QAAQ;QACnC,IAAIS,WAAW;YACb,qBACE,KAACf;gBAAMyB,OAAM;gBAAOC,IAAI;oBAAEC,YAAY;oBAAUC,gBAAgB;gBAAS;0BACvE,cAAA,KAAC9B;;QAGP,OAAO,IAAIkB,OAAO;YAChB,qBAAO,KAACtB;gBAAMmC,UAAS;0BAASb;;QAClC,OAAO,IAAI,CA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Y,CAAC6C,WAAW,CAACM,IAAI,CAACL;IAEpG,MAAMM,kBAAkBxD,QACtB,kBACE,KAACM;YACCE,QAAQ8C,QAAQpB,IAAI,CAACU,MAAQA,IAAIE,KAAK,IAAIF,IAAIT,KAAK;YACnD1B,WAAW0C;YACXzC,OAAO0C;YAGX;QAACA;QAAcD;QAAYG;KAAO;IAGpC,OAAOE;AACT"}
1
+ {"version":3,"sources":["../../../../src/components/Variables/VariableEditorForm/VariablePreview.tsx"],"sourcesContent":["// Copyright 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 { Alert, Box, Card, Chip, CircularProgress, IconButton, Stack, Typography } from '@mui/material';\nimport { InfoTooltip, useSnackbar } from '@perses-dev/components';\nimport type { ListVariableDefinition } from '@perses-dev/spec';\nimport Clipboard from 'mdi-material-ui/ClipboardOutline';\nimport type { ReactElement } from 'react';\nimport React, { useMemo, useState } from 'react';\n\nimport { TOOLTIP_TEXT } from '../../../constants';\nimport { useListVariablePluginValues } from '../variable-model';\nimport { SORT_METHODS } from './variable-editor-form-model';\n\nconst DEFAULT_MAX_PREVIEW_VALUES = 50;\n\ninterface VariablePreviewProps {\n values?: string[];\n isLoading?: boolean;\n error?: string;\n}\n\nexport function VariablePreview(props: VariablePreviewProps): ReactElement {\n const { values, isLoading, error } = props;\n const [maxValues, setMaxValues] = useState<number | undefined>(DEFAULT_MAX_PREVIEW_VALUES);\n const { infoSnackbar } = useSnackbar();\n const showAll = (): void => {\n setMaxValues(undefined);\n };\n let notShown = 0;\n\n if (values && values?.length > 0 && maxValues) {\n notShown = values.length - maxValues;\n }\n\n const variablePreviewState = useMemo((): ReactElement | null => {\n if (isLoading) {\n return (\n <Stack width=\"100%\" sx={{ alignItems: 'center', justifyContent: 'center' }}>\n <CircularProgress />\n </Stack>\n );\n } else if (error) {\n return <Alert severity=\"error\">{error}</Alert>;\n } else if (!values?.length) {\n return <Alert severity=\"info\">No results</Alert>;\n }\n return null;\n }, [error, isLoading, values]);\n\n return (\n <Box>\n <Stack direction=\"row\" spacing={1} alignItems=\"center\" mb={1}>\n <Typography variant=\"h4\">Preview Values</Typography>\n <InfoTooltip description={TOOLTIP_TEXT.copyVariableValues}>\n <IconButton\n onClick={async () => {\n if (values?.length) {\n await navigator.clipboard.writeText(values.map((value) => value).join(', '));\n infoSnackbar('Preview values copied to clipboard!');\n }\n }}\n size=\"small\"\n >\n <Clipboard />\n </IconButton>\n </InfoTooltip>\n </Stack>\n <Card variant=\"outlined\">\n <Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 1, m: 2 }}>\n {variablePreviewState}\n {values\n ?.slice(0, maxValues)\n .filter((val) => val)\n .map((val, index) => (\n <Chip size=\"small\" key={index} label={val} />\n ))}\n {notShown > 0 && <Chip onClick={showAll} variant=\"outlined\" size=\"small\" label={`+${notShown} more`} />}\n </Box>\n </Card>\n </Box>\n );\n}\n\ninterface VariableListPreviewProps {\n definition: ListVariableDefinition;\n sortMethod?: keyof typeof SORT_METHODS;\n}\n\nexport function VariableListPreview(props: VariableListPreviewProps): ReactElement {\n const { definition, sortMethod } = props;\n const { data, isFetching, error } = useListVariablePluginValues(definition);\n const errorMessage = (error as Error)?.message;\n\n // oxlint-disable-next-line unicorn/no-array-sort Calling sort of object, not the built-in array sort function\n const result = !sortMethod || sortMethod === 'none' || !data ? data : SORT_METHODS[sortMethod].sort(data);\n\n const variablePreview = useMemo(\n () => (\n <VariablePreview\n values={result?.map((val) => val.label || val.value)}\n isLoading={isFetching}\n error={errorMessage}\n />\n ),\n [errorMessage, isFetching, result],\n );\n\n return variablePreview;\n}\n"],"names":["Alert","Box","Card","Chip","CircularProgress","IconButton","Stack","Typography","InfoTooltip","useSnackbar","Clipboard","React","useMemo","useState","TOOLTIP_TEXT","useListVariablePluginValues","SORT_METHODS","DEFAULT_MAX_PREVIEW_VALUES","VariablePreview","props","values","isLoading","error","maxValues","setMaxValues","infoSnackbar","showAll","undefined","notShown","length","variablePreviewState","width","sx","alignItems","justifyContent","severity","direction","spacing","mb","variant","description","copyVariableValues","onClick","navigator","clipboard","writeText","map","value","join","size","display","flexWrap","gap","m","slice","filter","val","index","label","VariableListPreview","definition","sortMethod","data","isFetching","errorMessage","message","result","sort","variablePreview"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,KAAK,EAAEC,GAAG,EAAEC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,UAAU,EAAEC,KAAK,EAAEC,UAAU,QAAQ,gBAAgB;AACxG,SAASC,WAAW,EAAEC,WAAW,QAAQ,yBAAyB;AAElE,OAAOC,eAAe,mCAAmC;AAEzD,OAAOC,SAASC,OAAO,EAAEC,QAAQ,QAAQ,QAAQ;AAEjD,SAASC,YAAY,QAAQ,8BAAqB;AAClD,SAASC,2BAA2B,QAAQ,uBAAoB;AAChE,SAASC,YAAY,QAAQ,kCAA+B;AAE5D,MAAMC,6BAA6B;AAQnC,OAAO,SAASC,gBAAgBC,KAA2B;IACzD,MAAM,EAAEC,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGH;IACrC,MAAM,CAACI,WAAWC,aAAa,GAAGX,SAA6BI;IAC/D,MAAM,EAAEQ,YAAY,EAAE,GAAGhB;IACzB,MAAMiB,UAAU;QACdF,aAAaG;IACf;IACA,IAAIC,WAAW;IAEf,IAAIR,UAAUA,QAAQS,SAAS,KAAKN,WAAW;QAC7CK,WAAW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AK7G;AAOA,OAAO,SAAS+B,oBAAoBxC,KAA+B;IACjE,MAAM,EAAEyC,UAAU,EAAEC,UAAU,EAAE,GAAG1C;IACnC,MAAM,EAAE2C,IAAI,EAAEC,UAAU,EAAEzC,KAAK,EAAE,GAAGP,4BAA4B6C;IAChE,MAAMI,eAAgB1C,OAAiB2C;IAEvC,8GAA8G;IAC9G,MAAMC,SAAS,CAACL,cAAcA,eAAe,UAAU,CAACC,OAAOA,OAAO9C,YAAY,CAAC6C,WAAW,CAACM,IAAI,CAACL;IAEpG,MAAMM,kBAAkBxD,QACtB,kBACE,KAACM;YACCE,QAAQ8C,QAAQpB,IAAI,CAACU,MAAQA,IAAIE,KAAK,IAAIF,IAAIT,KAAK;YACnD1B,WAAW0C;YACXzC,OAAO0C;YAGX;QAACA;QAAcD;QAAYG;KAAO;IAGpC,OAAOE;AACT"}
@@ -10,8 +10,8 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export * from './VariableEditorForm';
14
- export * from './VariablePreview';
15
- export * from './variable-editor-form-model';
13
+ export * from "./VariableEditorForm.js";
14
+ export * from "./VariablePreview.js";
15
+ export * from "./variable-editor-form-model.js";
16
16
 
17
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Variables/VariableEditorForm/index.ts"],"sourcesContent":["// Copyright 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\nexport * from './VariableEditorForm';\nexport * from './VariablePreview';\nexport * from './variable-editor-form-model';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,uBAAuB;AACrC,cAAc,oBAAoB;AAClC,cAAc,+BAA+B"}
1
+ {"version":3,"sources":["../../../../src/components/Variables/VariableEditorForm/index.ts"],"sourcesContent":["// Copyright 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\nexport * from './VariableEditorForm';\nexport * from './VariablePreview';\nexport * from './variable-editor-form-model';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,0BAAuB;AACrC,cAAc,uBAAoB;AAClC,cAAc,kCAA+B"}
@@ -1,5 +1,5 @@
1
- import { ListVariableSpec, TextVariableSpec, VariableDefinition } from '@perses-dev/spec';
2
- import { VariableOption } from '../../../model';
1
+ import type { ListVariableSpec, TextVariableSpec, VariableDefinition } from '@perses-dev/spec';
2
+ import type { VariableOption } from '../../../model';
3
3
  export type SortMethodName = 'none' | 'alphabetical-asc' | 'alphabetical-desc' | 'numerical-asc' | 'numerical-desc' | 'alphabetical-ci-asc' | 'alphabetical-ci-desc';
4
4
  export declare const SORT_METHODS: Record<SortMethodName, {
5
5
  label: string;