@perses-dev/plugin-system 0.55.0-beta.2 → 0.55.0-beta.6

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 (563) 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 +3 -2
  20. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
  21. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +10 -9
  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 +8 -0
  32. package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts.map +1 -0
  33. package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js +45 -0
  34. package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js.map +1 -0
  35. package/dist/components/DatasourceTestConnectionButton/index.d.ts +2 -0
  36. package/dist/components/DatasourceTestConnectionButton/index.d.ts.map +1 -0
  37. package/dist/{cjs/model/alerts-queries.js → components/DatasourceTestConnectionButton/index.js} +3 -4
  38. package/dist/components/DatasourceTestConnectionButton/index.js.map +1 -0
  39. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +3 -2
  40. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -1
  41. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +54 -29
  42. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -1
  43. package/dist/components/HTTPSettingsEditor/index.js +1 -1
  44. package/dist/components/HTTPSettingsEditor/index.js.map +1 -1
  45. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.d.ts +1 -1
  46. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.d.ts.map +1 -1
  47. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +24 -24
  48. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js.map +1 -1
  49. package/dist/components/ItemSelectionActionsOptionsEditor/index.js +1 -1
  50. package/dist/components/ItemSelectionActionsOptionsEditor/index.js.map +1 -1
  51. package/dist/components/LayoutEditor/LayoutEditor.d.ts +16 -0
  52. package/dist/components/LayoutEditor/LayoutEditor.d.ts.map +1 -0
  53. package/dist/components/LayoutEditor/LayoutEditor.js +115 -0
  54. package/dist/components/LayoutEditor/LayoutEditor.js.map +1 -0
  55. package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts +7 -0
  56. package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts.map +1 -0
  57. package/dist/components/LayoutEditor/RepeatLayoutPreview.js +92 -0
  58. package/dist/components/LayoutEditor/RepeatLayoutPreview.js.map +1 -0
  59. package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts +18 -0
  60. package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts.map +1 -0
  61. package/dist/components/LayoutEditor/RepeatVariableEditor.js +168 -0
  62. package/dist/components/LayoutEditor/RepeatVariableEditor.js.map +1 -0
  63. package/dist/components/LayoutEditor/index.d.ts +4 -0
  64. package/dist/components/LayoutEditor/index.d.ts.map +1 -0
  65. package/dist/{cjs/model/explore.js → components/LayoutEditor/index.js} +5 -4
  66. package/dist/components/LayoutEditor/index.js.map +1 -0
  67. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +2 -2
  68. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
  69. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +5 -5
  70. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
  71. package/dist/components/LegendOptionsEditor/index.js +1 -1
  72. package/dist/components/LegendOptionsEditor/index.js.map +1 -1
  73. package/dist/components/LinksEditor/LinksEditor.d.ts +3 -3
  74. package/dist/components/LinksEditor/LinksEditor.d.ts.map +1 -1
  75. package/dist/components/LinksEditor/LinksEditor.js +6 -6
  76. package/dist/components/LinksEditor/LinksEditor.js.map +1 -1
  77. package/dist/components/LinksEditor/index.js +1 -1
  78. package/dist/components/LinksEditor/index.js.map +1 -1
  79. package/dist/components/MetricLabelInput/MetricLabelInput.d.ts +1 -1
  80. package/dist/components/MetricLabelInput/MetricLabelInput.d.ts.map +1 -1
  81. package/dist/components/MetricLabelInput/MetricLabelInput.js +2 -2
  82. package/dist/components/MetricLabelInput/MetricLabelInput.js.map +1 -1
  83. package/dist/components/MetricLabelInput/index.js +1 -1
  84. package/dist/components/MetricLabelInput/index.js.map +1 -1
  85. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +3 -4
  86. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -1
  87. package/dist/components/MultiQueryEditor/MultiQueryEditor.js +12 -9
  88. package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -1
  89. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +3 -4
  90. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -1
  91. package/dist/components/MultiQueryEditor/QueryEditorContainer.js +14 -14
  92. package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -1
  93. package/dist/components/MultiQueryEditor/index.js +2 -2
  94. package/dist/components/MultiQueryEditor/index.js.map +1 -1
  95. package/dist/components/MultiQueryEditor/utils.d.ts +1 -1
  96. package/dist/components/MultiQueryEditor/utils.d.ts.map +1 -1
  97. package/dist/components/MultiQueryEditor/utils.js.map +1 -1
  98. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +1 -1
  99. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
  100. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +4 -4
  101. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
  102. package/dist/components/OptionsEditorRadios/index.js +1 -1
  103. package/dist/components/OptionsEditorRadios/index.js.map +1 -1
  104. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +1 -1
  105. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts.map +1 -1
  106. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
  107. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
  108. package/dist/components/OptionsEditorTabPanel/index.js +1 -1
  109. package/dist/components/OptionsEditorTabPanel/index.js.map +1 -1
  110. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +1 -1
  111. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
  112. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +4 -4
  113. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
  114. package/dist/components/OptionsEditorTabs/index.js +1 -1
  115. package/dist/components/OptionsEditorTabs/index.js.map +1 -1
  116. package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.d.ts +2 -2
  117. package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.d.ts.map +1 -1
  118. package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.js +9 -9
  119. package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.js.map +1 -1
  120. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +7 -5
  121. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
  122. package/dist/components/PanelSpecEditor/PanelSpecEditor.js +19 -10
  123. package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
  124. package/dist/components/PanelSpecEditor/index.js +1 -1
  125. package/dist/components/PanelSpecEditor/index.js.map +1 -1
  126. package/dist/components/PluginEditor/PluginEditor.d.ts +2 -2
  127. package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
  128. package/dist/components/PluginEditor/PluginEditor.js +10 -9
  129. package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
  130. package/dist/components/PluginEditor/index.js +2 -2
  131. package/dist/components/PluginEditor/index.js.map +1 -1
  132. package/dist/components/PluginEditor/plugin-editor-api.d.ts +4 -3
  133. package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
  134. package/dist/components/PluginEditor/plugin-editor-api.js +4 -4
  135. package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
  136. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +3 -4
  137. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
  138. package/dist/components/PluginKindSelect/PluginKindSelect.js +4 -4
  139. package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
  140. package/dist/components/PluginKindSelect/index.js +1 -1
  141. package/dist/components/PluginKindSelect/index.js.map +1 -1
  142. package/dist/components/PluginRegistry/PluginRegistry.d.ts +2 -2
  143. package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
  144. package/dist/components/PluginRegistry/PluginRegistry.js +5 -5
  145. package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
  146. package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts +2 -2
  147. package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts.map +1 -1
  148. package/dist/components/PluginRegistry/getPluginSearchHelper.js +2 -2
  149. package/dist/components/PluginRegistry/getPluginSearchHelper.js.map +1 -1
  150. package/dist/components/PluginRegistry/index.js +1 -1
  151. package/dist/components/PluginRegistry/index.js.map +1 -1
  152. package/dist/components/PluginRegistry/plugin-indexes.d.ts +2 -1
  153. package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
  154. package/dist/components/PluginRegistry/plugin-indexes.js +3 -3
  155. package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
  156. package/dist/components/PluginSpecEditor/DatasourceSpecEditor.d.ts +10 -0
  157. package/dist/components/PluginSpecEditor/DatasourceSpecEditor.d.ts.map +1 -0
  158. package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js +62 -0
  159. package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js.map +1 -0
  160. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +5 -4
  161. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
  162. package/dist/components/PluginSpecEditor/PluginSpecEditor.js +19 -5
  163. package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
  164. package/dist/components/PluginSpecEditor/index.js +1 -1
  165. package/dist/components/PluginSpecEditor/index.js.map +1 -1
  166. package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.d.ts +1 -1
  167. package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.d.ts.map +1 -1
  168. package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js +3 -3
  169. package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js.map +1 -1
  170. package/dist/components/SelectionOptionsEditor/index.js +1 -1
  171. package/dist/components/SelectionOptionsEditor/index.js.map +1 -1
  172. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +2 -2
  173. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
  174. package/dist/components/TimeRangeControls/TimeRangeControls.js +13 -14
  175. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
  176. package/dist/components/TimeRangeControls/index.js +1 -1
  177. package/dist/components/TimeRangeControls/index.js.map +1 -1
  178. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +3 -3
  179. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  180. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +11 -11
  181. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  182. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +2 -2
  183. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
  184. package/dist/components/Variables/VariableEditorForm/VariablePreview.js +7 -7
  185. package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
  186. package/dist/components/Variables/VariableEditorForm/index.js +3 -3
  187. package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
  188. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +2 -2
  189. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
  190. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
  191. package/dist/components/Variables/index.js +2 -2
  192. package/dist/components/Variables/index.js.map +1 -1
  193. package/dist/components/Variables/variable-model.d.ts +4 -4
  194. package/dist/components/Variables/variable-model.d.ts.map +1 -1
  195. package/dist/components/Variables/variable-model.js +3 -3
  196. package/dist/components/Variables/variable-model.js.map +1 -1
  197. package/dist/components/index.d.ts +2 -0
  198. package/dist/components/index.d.ts.map +1 -1
  199. package/dist/components/index.js +21 -19
  200. package/dist/components/index.js.map +1 -1
  201. package/dist/constants/index.d.ts +1 -0
  202. package/dist/constants/index.d.ts.map +1 -1
  203. package/dist/constants/index.js +2 -1
  204. package/dist/constants/index.js.map +1 -1
  205. package/dist/constants/repeat.d.ts +3 -0
  206. package/dist/constants/repeat.d.ts.map +1 -0
  207. package/dist/{cjs/model/datasource.js → constants/repeat.js} +4 -4
  208. package/dist/constants/repeat.js.map +1 -0
  209. package/dist/context/ValidationProvider.d.ts +5 -5
  210. package/dist/context/ValidationProvider.d.ts.map +1 -1
  211. package/dist/context/ValidationProvider.js +5 -5
  212. package/dist/context/ValidationProvider.js.map +1 -1
  213. package/dist/context/index.js +1 -1
  214. package/dist/context/index.js.map +1 -1
  215. package/dist/index.js +9 -9
  216. package/dist/index.js.map +1 -1
  217. package/dist/model/alerts-queries.d.ts +4 -4
  218. package/dist/model/alerts-queries.d.ts.map +1 -1
  219. package/dist/model/alerts-queries.js.map +1 -1
  220. package/dist/model/annotations.d.ts +3 -3
  221. package/dist/model/annotations.d.ts.map +1 -1
  222. package/dist/model/annotations.js.map +1 -1
  223. package/dist/model/calculations.d.ts +1 -1
  224. package/dist/model/calculations.d.ts.map +1 -1
  225. package/dist/model/calculations.js.map +1 -1
  226. package/dist/model/datasource.d.ts +10 -3
  227. package/dist/model/datasource.d.ts.map +1 -1
  228. package/dist/model/datasource.js +1 -1
  229. package/dist/model/datasource.js.map +1 -1
  230. package/dist/model/explore.d.ts +2 -3
  231. package/dist/model/explore.d.ts.map +1 -1
  232. package/dist/model/explore.js.map +1 -1
  233. package/dist/model/index.d.ts +1 -0
  234. package/dist/model/index.d.ts.map +1 -1
  235. package/dist/model/index.js +17 -16
  236. package/dist/model/index.js.map +1 -1
  237. package/dist/model/json-queries.d.ts +29 -0
  238. package/dist/model/json-queries.d.ts.map +1 -0
  239. package/dist/{cjs/model/annotations.js → model/json-queries.js} +5 -4
  240. package/dist/model/json-queries.js.map +1 -0
  241. package/dist/model/legend.d.ts +2 -2
  242. package/dist/model/legend.d.ts.map +1 -1
  243. package/dist/model/legend.js +2 -2
  244. package/dist/model/legend.js.map +1 -1
  245. package/dist/model/log-queries.d.ts +3 -3
  246. package/dist/model/log-queries.d.ts.map +1 -1
  247. package/dist/model/log-queries.js.map +1 -1
  248. package/dist/model/panels.d.ts +13 -4
  249. package/dist/model/panels.d.ts.map +1 -1
  250. package/dist/model/panels.js.map +1 -1
  251. package/dist/model/plugin-base.d.ts +3 -3
  252. package/dist/model/plugin-base.d.ts.map +1 -1
  253. package/dist/model/plugin-base.js.map +1 -1
  254. package/dist/model/plugin-loading.d.ts +1 -1
  255. package/dist/model/plugin-loading.d.ts.map +1 -1
  256. package/dist/model/plugin-loading.js +1 -1
  257. package/dist/model/plugin-loading.js.map +1 -1
  258. package/dist/model/plugins.d.ts +15 -13
  259. package/dist/model/plugins.d.ts.map +1 -1
  260. package/dist/model/plugins.js.map +1 -1
  261. package/dist/model/profile-queries.d.ts +4 -4
  262. package/dist/model/profile-queries.d.ts.map +1 -1
  263. package/dist/model/profile-queries.js.map +1 -1
  264. package/dist/model/silences-queries.d.ts +4 -4
  265. package/dist/model/silences-queries.d.ts.map +1 -1
  266. package/dist/model/silences-queries.js.map +1 -1
  267. package/dist/model/time-series-queries.d.ts +4 -4
  268. package/dist/model/time-series-queries.d.ts.map +1 -1
  269. package/dist/model/time-series-queries.js.map +1 -1
  270. package/dist/model/trace-queries.d.ts +4 -4
  271. package/dist/model/trace-queries.d.ts.map +1 -1
  272. package/dist/model/trace-queries.js.map +1 -1
  273. package/dist/model/variables.d.ts +7 -3
  274. package/dist/model/variables.d.ts.map +1 -1
  275. package/dist/model/variables.js +1 -3
  276. package/dist/model/variables.js.map +1 -1
  277. package/dist/remote/PluginLoaderComponent.d.ts +1 -2
  278. package/dist/remote/PluginLoaderComponent.d.ts.map +1 -1
  279. package/dist/remote/PluginLoaderComponent.js +2 -2
  280. package/dist/remote/PluginLoaderComponent.js.map +1 -1
  281. package/dist/remote/PluginRuntime.d.ts +2 -2
  282. package/dist/remote/PluginRuntime.d.ts.map +1 -1
  283. package/dist/remote/PluginRuntime.js +18 -26
  284. package/dist/remote/PluginRuntime.js.map +1 -1
  285. package/dist/remote/index.js +2 -2
  286. package/dist/remote/index.js.map +1 -1
  287. package/dist/remote/remotePluginLoader.d.ts +2 -2
  288. package/dist/remote/remotePluginLoader.d.ts.map +1 -1
  289. package/dist/remote/remotePluginLoader.js +3 -3
  290. package/dist/remote/remotePluginLoader.js.map +1 -1
  291. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +3 -3
  292. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
  293. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +20 -12
  294. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
  295. package/dist/runtime/DataQueriesProvider/index.js +2 -2
  296. package/dist/runtime/DataQueriesProvider/index.js.map +1 -1
  297. package/dist/runtime/DataQueriesProvider/model.d.ts +3 -3
  298. package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
  299. package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
  300. package/dist/runtime/RouterProvider.d.ts +2 -1
  301. package/dist/runtime/RouterProvider.d.ts.map +1 -1
  302. package/dist/runtime/RouterProvider.js +3 -3
  303. package/dist/runtime/RouterProvider.js.map +1 -1
  304. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +3 -2
  305. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
  306. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +22 -8
  307. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
  308. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.d.ts +3 -2
  309. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.d.ts.map +1 -1
  310. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js +5 -5
  311. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js.map +1 -1
  312. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +9 -2
  313. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -1
  314. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +16 -3
  315. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -1
  316. package/dist/runtime/TimeRangeProvider/index.js +4 -4
  317. package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
  318. package/dist/runtime/TimeRangeProvider/query-params.d.ts +3 -3
  319. package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
  320. package/dist/runtime/TimeRangeProvider/query-params.js +4 -4
  321. package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
  322. package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts +1 -1
  323. package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts.map +1 -1
  324. package/dist/runtime/TimeRangeProvider/refresh-interval.js +2 -2
  325. package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -1
  326. package/dist/runtime/UsageMetricsProvider.d.ts +3 -3
  327. package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -1
  328. package/dist/runtime/UsageMetricsProvider.js +3 -3
  329. package/dist/runtime/UsageMetricsProvider.js.map +1 -1
  330. package/dist/runtime/alerts-queries.d.ts +2 -2
  331. package/dist/runtime/alerts-queries.d.ts.map +1 -1
  332. package/dist/runtime/alerts-queries.js +5 -5
  333. package/dist/runtime/alerts-queries.js.map +1 -1
  334. package/dist/runtime/annotations.d.ts +2 -2
  335. package/dist/runtime/annotations.d.ts.map +1 -1
  336. package/dist/runtime/annotations.js +6 -6
  337. package/dist/runtime/annotations.js.map +1 -1
  338. package/dist/runtime/builtin-variables.d.ts +2 -3
  339. package/dist/runtime/builtin-variables.d.ts.map +1 -1
  340. package/dist/runtime/builtin-variables.js +1 -1
  341. package/dist/runtime/builtin-variables.js.map +1 -1
  342. package/dist/runtime/datasources.d.ts +2 -3
  343. package/dist/runtime/datasources.d.ts.map +1 -1
  344. package/dist/runtime/datasources.js +2 -2
  345. package/dist/runtime/datasources.js.map +1 -1
  346. package/dist/runtime/index.d.ts +1 -0
  347. package/dist/runtime/index.d.ts.map +1 -1
  348. package/dist/runtime/index.js +16 -15
  349. package/dist/runtime/index.js.map +1 -1
  350. package/dist/runtime/item-actions.d.ts +3 -3
  351. package/dist/runtime/item-actions.d.ts.map +1 -1
  352. package/dist/runtime/item-actions.js +2 -2
  353. package/dist/runtime/item-actions.js.map +1 -1
  354. package/dist/runtime/json-queries.d.ts +11 -0
  355. package/dist/runtime/json-queries.d.ts.map +1 -0
  356. package/dist/runtime/json-queries.js +58 -0
  357. package/dist/runtime/json-queries.js.map +1 -0
  358. package/dist/runtime/log-queries.d.ts +3 -3
  359. package/dist/runtime/log-queries.d.ts.map +1 -1
  360. package/dist/runtime/log-queries.js +5 -5
  361. package/dist/runtime/log-queries.js.map +1 -1
  362. package/dist/runtime/plugin-registry.d.ts +3 -4
  363. package/dist/runtime/plugin-registry.d.ts.map +1 -1
  364. package/dist/runtime/plugin-registry.js +2 -2
  365. package/dist/runtime/plugin-registry.js.map +1 -1
  366. package/dist/runtime/profile-queries.d.ts +2 -2
  367. package/dist/runtime/profile-queries.d.ts.map +1 -1
  368. package/dist/runtime/profile-queries.js +4 -4
  369. package/dist/runtime/profile-queries.js.map +1 -1
  370. package/dist/runtime/silences-queries.d.ts +2 -2
  371. package/dist/runtime/silences-queries.d.ts.map +1 -1
  372. package/dist/runtime/silences-queries.js +5 -5
  373. package/dist/runtime/silences-queries.js.map +1 -1
  374. package/dist/runtime/time-series-queries.d.ts +3 -3
  375. package/dist/runtime/time-series-queries.d.ts.map +1 -1
  376. package/dist/runtime/time-series-queries.js +6 -6
  377. package/dist/runtime/time-series-queries.js.map +1 -1
  378. package/dist/runtime/trace-queries.d.ts +2 -2
  379. package/dist/runtime/trace-queries.d.ts.map +1 -1
  380. package/dist/runtime/trace-queries.js +6 -6
  381. package/dist/runtime/trace-queries.js.map +1 -1
  382. package/dist/runtime/utils.d.ts +1 -1
  383. package/dist/runtime/utils.d.ts.map +1 -1
  384. package/dist/runtime/utils.js.map +1 -1
  385. package/dist/runtime/variables.d.ts +1 -2
  386. package/dist/runtime/variables.d.ts.map +1 -1
  387. package/dist/runtime/variables.js +4 -4
  388. package/dist/runtime/variables.js.map +1 -1
  389. package/dist/schema/index.js +1 -1
  390. package/dist/schema/index.js.map +1 -1
  391. package/dist/schema/panel.d.ts +2 -2
  392. package/dist/schema/panel.d.ts.map +1 -1
  393. package/dist/schema/panel.js +18 -4
  394. package/dist/schema/panel.js.map +1 -1
  395. package/dist/test/index.js +2 -2
  396. package/dist/test/index.js.map +1 -1
  397. package/dist/test/mock-data.d.ts +2 -1
  398. package/dist/test/mock-data.d.ts.map +1 -1
  399. package/dist/test/mock-data.js +6 -0
  400. package/dist/test/mock-data.js.map +1 -1
  401. package/dist/test/render-hook.d.ts +2 -2
  402. package/dist/test/render-hook.d.ts.map +1 -1
  403. package/dist/test/render-hook.js +2 -2
  404. package/dist/test/render-hook.js.map +1 -1
  405. package/dist/test/render.d.ts +3 -3
  406. package/dist/test/render.d.ts.map +1 -1
  407. package/dist/test/render.js +3 -3
  408. package/dist/test/render.js.map +1 -1
  409. package/dist/test/setup-tests.d.ts +1 -1
  410. package/dist/test/setup-tests.d.ts.map +1 -1
  411. package/dist/test/setup-tests.js +3 -2
  412. package/dist/test/setup-tests.js.map +1 -1
  413. package/dist/test/test-plugins/bert/index.d.ts +3 -3
  414. package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
  415. package/dist/test/test-plugins/bert/index.js.map +1 -1
  416. package/dist/test/test-plugins/ernie/index.d.ts +7 -1
  417. package/dist/test/test-plugins/ernie/index.d.ts.map +1 -1
  418. package/dist/test/test-plugins/ernie/index.js +58 -1
  419. package/dist/test/test-plugins/ernie/index.js.map +1 -1
  420. package/dist/test/test-plugins/index.d.ts +1 -1
  421. package/dist/test/test-plugins/index.d.ts.map +1 -1
  422. package/dist/test/test-plugins/index.js +5 -5
  423. package/dist/test/test-plugins/index.js.map +1 -1
  424. package/dist/test/utils.d.ts +2 -2
  425. package/dist/test/utils.d.ts.map +1 -1
  426. package/dist/test/utils.js +5 -5
  427. package/dist/test/utils.js.map +1 -1
  428. package/dist/test-utils/index.js +1 -1
  429. package/dist/test-utils/index.js.map +1 -1
  430. package/dist/test-utils/mock-plugin-registry.d.ts +2 -2
  431. package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
  432. package/dist/test-utils/mock-plugin-registry.js +1 -1
  433. package/dist/test-utils/mock-plugin-registry.js.map +1 -1
  434. package/dist/utils/csv-export.d.ts.map +1 -1
  435. package/dist/utils/csv-export.js +1 -1
  436. package/dist/utils/csv-export.js.map +1 -1
  437. package/dist/utils/event.js +1 -1
  438. package/dist/utils/index.js +3 -3
  439. package/dist/utils/index.js.map +1 -1
  440. package/dist/utils/variables.js +1 -1
  441. package/package.json +11 -11
  442. package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js +0 -283
  443. package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationPreview.js +0 -197
  444. package/dist/cjs/components/Annotations/AnnotationEditorForm/index.js +0 -30
  445. package/dist/cjs/components/Annotations/constants.js +0 -23
  446. package/dist/cjs/components/Annotations/index.js +0 -31
  447. package/dist/cjs/components/CalculationSelector/CalculationSelector.js +0 -49
  448. package/dist/cjs/components/CalculationSelector/index.js +0 -30
  449. package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +0 -270
  450. package/dist/cjs/components/DatasourceEditorForm/index.js +0 -30
  451. package/dist/cjs/components/DatasourceSelect/DatasourceSelect.js +0 -266
  452. package/dist/cjs/components/DatasourceSelect/index.js +0 -30
  453. package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +0 -568
  454. package/dist/cjs/components/HTTPSettingsEditor/index.js +0 -30
  455. package/dist/cjs/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +0 -1175
  456. package/dist/cjs/components/ItemSelectionActionsOptionsEditor/index.js +0 -30
  457. package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +0 -211
  458. package/dist/cjs/components/LegendOptionsEditor/index.js +0 -30
  459. package/dist/cjs/components/LinksEditor/LinksEditor.js +0 -162
  460. package/dist/cjs/components/LinksEditor/index.js +0 -30
  461. package/dist/cjs/components/MetricLabelInput/MetricLabelInput.js +0 -41
  462. package/dist/cjs/components/MetricLabelInput/index.js +0 -30
  463. package/dist/cjs/components/MultiQueryEditor/MultiQueryEditor.js +0 -159
  464. package/dist/cjs/components/MultiQueryEditor/QueryEditorContainer.js +0 -250
  465. package/dist/cjs/components/MultiQueryEditor/index.js +0 -31
  466. package/dist/cjs/components/MultiQueryEditor/utils.js +0 -36
  467. package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +0 -69
  468. package/dist/cjs/components/OptionsEditorRadios/index.js +0 -30
  469. package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +0 -39
  470. package/dist/cjs/components/OptionsEditorTabPanel/index.js +0 -30
  471. package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +0 -61
  472. package/dist/cjs/components/OptionsEditorTabs/index.js +0 -30
  473. package/dist/cjs/components/PanelSpecEditor/PanelAnnotationsEditor.js +0 -246
  474. package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +0 -135
  475. package/dist/cjs/components/PanelSpecEditor/index.js +0 -30
  476. package/dist/cjs/components/PluginEditor/PluginEditor.js +0 -98
  477. package/dist/cjs/components/PluginEditor/index.js +0 -31
  478. package/dist/cjs/components/PluginEditor/plugin-editor-api.js +0 -136
  479. package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +0 -109
  480. package/dist/cjs/components/PluginKindSelect/index.js +0 -30
  481. package/dist/cjs/components/PluginRegistry/PluginRegistry.js +0 -86
  482. package/dist/cjs/components/PluginRegistry/getPluginSearchHelper.js +0 -92
  483. package/dist/cjs/components/PluginRegistry/index.js +0 -30
  484. package/dist/cjs/components/PluginRegistry/plugin-indexes.js +0 -88
  485. package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +0 -55
  486. package/dist/cjs/components/PluginSpecEditor/index.js +0 -30
  487. package/dist/cjs/components/SelectionOptionsEditor/SelectionOptionsEditor.js +0 -43
  488. package/dist/cjs/components/SelectionOptionsEditor/index.js +0 -30
  489. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -236
  490. package/dist/cjs/components/TimeRangeControls/index.js +0 -30
  491. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +0 -613
  492. package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +0 -193
  493. package/dist/cjs/components/Variables/VariableEditorForm/index.js +0 -32
  494. package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +0 -143
  495. package/dist/cjs/components/Variables/index.js +0 -31
  496. package/dist/cjs/components/Variables/variable-model.js +0 -211
  497. package/dist/cjs/components/index.js +0 -48
  498. package/dist/cjs/constants/index.js +0 -30
  499. package/dist/cjs/constants/user-interface-text.js +0 -32
  500. package/dist/cjs/context/ValidationProvider.js +0 -77
  501. package/dist/cjs/context/index.js +0 -30
  502. package/dist/cjs/index.js +0 -38
  503. package/dist/cjs/model/calculations.js +0 -178
  504. package/dist/cjs/model/index.js +0 -45
  505. package/dist/cjs/model/legend.js +0 -111
  506. package/dist/cjs/model/log-queries.js +0 -16
  507. package/dist/cjs/model/log-volume-utils.js +0 -124
  508. package/dist/cjs/model/panels.js +0 -16
  509. package/dist/cjs/model/plugin-base.js +0 -16
  510. package/dist/cjs/model/plugin-loading.js +0 -56
  511. package/dist/cjs/model/plugins.js +0 -26
  512. package/dist/cjs/model/profile-queries.js +0 -16
  513. package/dist/cjs/model/silences-queries.js +0 -16
  514. package/dist/cjs/model/time-series-queries.js +0 -26
  515. package/dist/cjs/model/trace-queries.js +0 -16
  516. package/dist/cjs/model/variables.js +0 -16
  517. package/dist/cjs/remote/PersesPlugin.types.js +0 -16
  518. package/dist/cjs/remote/PluginLoaderComponent.js +0 -87
  519. package/dist/cjs/remote/PluginRuntime.js +0 -331
  520. package/dist/cjs/remote/index.js +0 -31
  521. package/dist/cjs/remote/remotePluginLoader.js +0 -101
  522. package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +0 -154
  523. package/dist/cjs/runtime/DataQueriesProvider/index.js +0 -31
  524. package/dist/cjs/runtime/DataQueriesProvider/model.js +0 -34
  525. package/dist/cjs/runtime/RouterProvider.js +0 -114
  526. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +0 -201
  527. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviders.js +0 -66
  528. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +0 -113
  529. package/dist/cjs/runtime/TimeRangeProvider/index.js +0 -33
  530. package/dist/cjs/runtime/TimeRangeProvider/query-params.js +0 -250
  531. package/dist/cjs/runtime/TimeRangeProvider/refresh-interval.js +0 -30
  532. package/dist/cjs/runtime/UsageMetricsProvider.js +0 -102
  533. package/dist/cjs/runtime/alerts-queries.js +0 -101
  534. package/dist/cjs/runtime/annotations.js +0 -148
  535. package/dist/cjs/runtime/builtin-variables.js +0 -81
  536. package/dist/cjs/runtime/datasources.js +0 -80
  537. package/dist/cjs/runtime/index.js +0 -44
  538. package/dist/cjs/runtime/item-actions.js +0 -302
  539. package/dist/cjs/runtime/log-queries.js +0 -76
  540. package/dist/cjs/runtime/plugin-registry.js +0 -135
  541. package/dist/cjs/runtime/profile-queries.js +0 -73
  542. package/dist/cjs/runtime/silences-queries.js +0 -101
  543. package/dist/cjs/runtime/time-series-queries.js +0 -165
  544. package/dist/cjs/runtime/trace-queries.js +0 -106
  545. package/dist/cjs/runtime/utils.js +0 -39
  546. package/dist/cjs/runtime/variables.js +0 -160
  547. package/dist/cjs/schema/index.js +0 -30
  548. package/dist/cjs/schema/panel.js +0 -42
  549. package/dist/cjs/test/index.js +0 -31
  550. package/dist/cjs/test/mock-data.js +0 -357
  551. package/dist/cjs/test/render-hook.js +0 -31
  552. package/dist/cjs/test/render.js +0 -31
  553. package/dist/cjs/test/setup-tests.js +0 -20
  554. package/dist/cjs/test/test-plugins/bert/index.js +0 -99
  555. package/dist/cjs/test/test-plugins/ernie/index.js +0 -92
  556. package/dist/cjs/test/test-plugins/index.js +0 -81
  557. package/dist/cjs/test/utils.js +0 -58
  558. package/dist/cjs/test-utils/index.js +0 -30
  559. package/dist/cjs/test-utils/mock-plugin-registry.js +0 -81
  560. package/dist/cjs/utils/csv-export.js +0 -248
  561. package/dist/cjs/utils/event.js +0 -30
  562. package/dist/cjs/utils/index.js +0 -32
  563. package/dist/cjs/utils/variables.js +0 -44
@@ -0,0 +1,168 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ // Copyright The Perses Authors
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ import { Grid2 as Grid, ListSubheader, MenuItem, TextField, Typography } from "@mui/material";
15
+ import { useCallback } from "react";
16
+ import { DEFAULT_MAX_PER_ROW, DEFAULT_REPEAT_ALIGNMENT } from "../../constants/index.js";
17
+ export function RepeatVariableEditor({ value: current, onChange, errors, variableDefinitionGroups, isVertical, onRepeatVariableSet }) {
18
+ const handleVariableChange = useCallback((selected)=>{
19
+ if (!selected) {
20
+ onChange(undefined);
21
+ } else {
22
+ onChange(current ? {
23
+ ...current,
24
+ value: selected
25
+ } : {
26
+ value: selected,
27
+ alignment: DEFAULT_REPEAT_ALIGNMENT
28
+ });
29
+ if (!current) {
30
+ onRepeatVariableSet();
31
+ }
32
+ }
33
+ }, [
34
+ current,
35
+ onChange,
36
+ onRepeatVariableSet
37
+ ]);
38
+ const handleAlignmentChange = useCallback((selected)=>{
39
+ if (!current) return;
40
+ onChange(selected === 'vertical' ? {
41
+ ...current,
42
+ alignment: selected,
43
+ maxPer: undefined
44
+ } : {
45
+ ...current,
46
+ alignment: selected
47
+ });
48
+ }, [
49
+ current,
50
+ onChange
51
+ ]);
52
+ const handleMaxPerChange = useCallback((value)=>{
53
+ if (!current) return;
54
+ onChange({
55
+ ...current,
56
+ maxPer: value === '' ? undefined : Number(value)
57
+ });
58
+ }, [
59
+ current,
60
+ onChange
61
+ ]);
62
+ return /*#__PURE__*/ _jsxs(_Fragment, {
63
+ children: [
64
+ /*#__PURE__*/ _jsx(Grid, {
65
+ size: 4,
66
+ children: /*#__PURE__*/ _jsxs(TextField, {
67
+ select: true,
68
+ fullWidth: true,
69
+ label: "Repeat Variable",
70
+ value: current?.value ?? '',
71
+ error: !!errors.value,
72
+ helperText: errors.value?.message,
73
+ onChange: (event)=>handleVariableChange(event.target.value),
74
+ slotProps: {
75
+ select: {
76
+ MenuProps: {
77
+ PaperProps: {
78
+ sx: {
79
+ maxHeight: 240
80
+ }
81
+ }
82
+ }
83
+ }
84
+ },
85
+ children: [
86
+ /*#__PURE__*/ _jsx(MenuItem, {
87
+ value: "",
88
+ children: /*#__PURE__*/ _jsx(Typography, {
89
+ sx: {
90
+ fontStyle: 'italic'
91
+ },
92
+ children: "None"
93
+ })
94
+ }),
95
+ variableDefinitionGroups.flatMap(({ source, definitions })=>{
96
+ const listDefs = definitions.filter((def)=>def.kind === 'ListVariable' && def.spec.allowMultiple);
97
+ if (listDefs.length === 0) return [];
98
+ return [
99
+ source && /*#__PURE__*/ _jsx(ListSubheader, {
100
+ children: source
101
+ }, `group-${source}`),
102
+ ...listDefs.map((def)=>/*#__PURE__*/ _jsx(MenuItem, {
103
+ value: def.spec.name,
104
+ children: def.spec.display?.name ?? def.spec.name
105
+ }, `${source ?? 'dashboard'}-${def.spec.name}`))
106
+ ];
107
+ })
108
+ ]
109
+ })
110
+ }),
111
+ /*#__PURE__*/ _jsx(Grid, {
112
+ size: 4,
113
+ children: /*#__PURE__*/ _jsxs(TextField, {
114
+ select: true,
115
+ fullWidth: true,
116
+ label: "Alignment",
117
+ value: current?.alignment ?? DEFAULT_REPEAT_ALIGNMENT,
118
+ disabled: !current,
119
+ error: !!errors.alignment,
120
+ helperText: errors.alignment?.message,
121
+ onChange: (event)=>handleAlignmentChange(event.target.value),
122
+ children: [
123
+ /*#__PURE__*/ _jsx(MenuItem, {
124
+ value: "horizontal",
125
+ children: "Horizontal"
126
+ }),
127
+ /*#__PURE__*/ _jsx(MenuItem, {
128
+ value: "vertical",
129
+ children: "Vertical"
130
+ })
131
+ ]
132
+ })
133
+ }),
134
+ /*#__PURE__*/ _jsx(Grid, {
135
+ size: 4,
136
+ children: /*#__PURE__*/ _jsx(TextField, {
137
+ select: true,
138
+ fullWidth: true,
139
+ label: "Max Per Row",
140
+ value: current?.maxPer ?? DEFAULT_MAX_PER_ROW,
141
+ disabled: !current || isVertical,
142
+ error: !!errors.maxPer,
143
+ helperText: errors.maxPer?.message,
144
+ onChange: (event)=>handleMaxPerChange(event.target.value),
145
+ slotProps: {
146
+ select: {
147
+ MenuProps: {
148
+ PaperProps: {
149
+ sx: {
150
+ maxHeight: 240
151
+ }
152
+ }
153
+ }
154
+ }
155
+ },
156
+ children: Array.from({
157
+ length: 12
158
+ }, (_, i)=>i + 1).map((n)=>/*#__PURE__*/ _jsx(MenuItem, {
159
+ value: n,
160
+ children: n
161
+ }, n))
162
+ })
163
+ })
164
+ ]
165
+ });
166
+ }
167
+
168
+ //# sourceMappingURL=RepeatVariableEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/LayoutEditor/RepeatVariableEditor.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 { Grid2 as Grid, ListSubheader, MenuItem, TextField, Typography } from '@mui/material';\nimport type { ReactElement } from 'react';\nimport { useCallback } from 'react';\nimport type { ControllerRenderProps, FieldErrors } from 'react-hook-form';\n\nimport { DEFAULT_MAX_PER_ROW, DEFAULT_REPEAT_ALIGNMENT } from '../../constants';\nimport type { PanelEditorValues } from '../../model';\nimport type { VariableDefinitionGroup } from './LayoutEditor';\n\ntype RepeatVariableValue = ControllerRenderProps<PanelEditorValues, 'layoutDefinition.repeatVariable'>['value'];\ntype RepeatVariableOnChange = ControllerRenderProps<PanelEditorValues, 'layoutDefinition.repeatVariable'>['onChange'];\ntype RepeatVariableErrors = FieldErrors<\n NonNullable<NonNullable<PanelEditorValues['layoutDefinition']>['repeatVariable']>\n>;\n\nexport interface RepeatVariableEditorProps {\n value: RepeatVariableValue;\n onChange: RepeatVariableOnChange;\n errors: RepeatVariableErrors;\n variableDefinitionGroups: VariableDefinitionGroup[];\n isVertical: boolean;\n onRepeatVariableSet: () => void;\n}\n\nexport function RepeatVariableEditor({\n value: current,\n onChange,\n errors,\n variableDefinitionGroups,\n isVertical,\n onRepeatVariableSet,\n}: RepeatVariableEditorProps): ReactElement {\n const handleVariableChange = useCallback(\n (selected: string): void => {\n if (!selected) {\n onChange(undefined);\n } else {\n onChange(current ? { ...current, value: selected } : { value: selected, alignment: DEFAULT_REPEAT_ALIGNMENT });\n if (!current) {\n onRepeatVariableSet();\n }\n }\n },\n [current, onChange, onRepeatVariableSet],\n );\n\n const handleAlignmentChange = useCallback(\n (selected: string): void => {\n if (!current) return;\n onChange(\n selected === 'vertical'\n ? { ...current, alignment: selected, maxPer: undefined }\n : { ...current, alignment: selected },\n );\n },\n [current, onChange],\n );\n\n const handleMaxPerChange = useCallback(\n (value: string): void => {\n if (!current) return;\n onChange({ ...current, maxPer: value === '' ? undefined : Number(value) });\n },\n [current, onChange],\n );\n\n return (\n <>\n <Grid size={4}>\n <TextField\n select\n fullWidth\n label=\"Repeat Variable\"\n value={current?.value ?? ''}\n error={!!errors.value}\n helperText={errors.value?.message}\n onChange={(event) => handleVariableChange(event.target.value)}\n slotProps={{ select: { MenuProps: { PaperProps: { sx: { maxHeight: 240 } } } } }}\n >\n <MenuItem value=\"\">\n <Typography sx={{ fontStyle: 'italic' }}>None</Typography>\n </MenuItem>\n {variableDefinitionGroups.flatMap(({ source, definitions }) => {\n const listDefs = definitions.filter((def) => def.kind === 'ListVariable' && def.spec.allowMultiple);\n if (listDefs.length === 0) return [];\n return [\n source && <ListSubheader key={`group-${source}`}>{source}</ListSubheader>,\n ...listDefs.map((def) => (\n <MenuItem key={`${source ?? 'dashboard'}-${def.spec.name}`} value={def.spec.name}>\n {def.spec.display?.name ?? def.spec.name}\n </MenuItem>\n )),\n ];\n })}\n </TextField>\n </Grid>\n\n <Grid size={4}>\n <TextField\n select\n fullWidth\n label=\"Alignment\"\n value={current?.alignment ?? DEFAULT_REPEAT_ALIGNMENT}\n disabled={!current}\n error={!!errors.alignment}\n helperText={errors.alignment?.message}\n onChange={(event) => handleAlignmentChange(event.target.value)}\n >\n <MenuItem value=\"horizontal\">Horizontal</MenuItem>\n <MenuItem value=\"vertical\">Vertical</MenuItem>\n </TextField>\n </Grid>\n\n <Grid size={4}>\n <TextField\n select\n fullWidth\n label=\"Max Per Row\"\n value={current?.maxPer ?? DEFAULT_MAX_PER_ROW}\n disabled={!current || isVertical}\n error={!!errors.maxPer}\n helperText={errors.maxPer?.message}\n onChange={(event) => handleMaxPerChange(event.target.value)}\n slotProps={{ select: { MenuProps: { PaperProps: { sx: { maxHeight: 240 } } } } }}\n >\n {Array.from({ length: 12 }, (_, i) => i + 1).map((n) => (\n <MenuItem key={n} value={n}>\n {n}\n </MenuItem>\n ))}\n </TextField>\n </Grid>\n </>\n );\n}\n"],"names":["Grid2","Grid","ListSubheader","MenuItem","TextField","Typography","useCallback","DEFAULT_MAX_PER_ROW","DEFAULT_REPEAT_ALIGNMENT","RepeatVariableEditor","value","current","onChange","errors","variableDefinitionGroups","isVertical","onRepeatVariableSet","handleVariableChange","selected","undefined","alignment","handleAlignmentChange","maxPer","handleMaxPerChange","Number","size","select","fullWidth","label","error","helperText","message","event","target","slotProps","MenuProps","PaperProps","sx","maxHeight","fontStyle","flatMap","source","definitions","listDefs","filter","def","kind","spec","allowMultiple","length","map","name","display","disabled","Array","from","_","i","n"],"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,SAASC,IAAI,EAAEC,aAAa,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,UAAU,QAAQ,gBAAgB;AAE9F,SAASC,WAAW,QAAQ,QAAQ;AAGpC,SAASC,mBAAmB,EAAEC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BnB,UAAU,CAACoB,QAAUT,mBAAmBS,MAAMC,MAAM,CAACvB,KAAK;oBAC1DwB,WAAW;wBAAER,QAAQ;4BAAES,WAAW;gCAAEC,YAAY;oCAAEC,IAAI;wCAAEC,WAAW;oCAAI;gCAAE;4BAAE;wBAAE;oBAAE;8BAE9EgB,MAAMC,IAAI,CAAC;wBAAEN,QAAQ;oBAAG,GAAG,CAACO,GAAGC,IAAMA,IAAI,GAAGP,GAAG,CAAC,CAACQ,kBAChD,KAACvD;4BAAiBO,OAAOgD;sCACtBA;2BADYA;;;;;AAQ3B"}
@@ -0,0 +1,4 @@
1
+ export * from './LayoutEditor';
2
+ export * from './RepeatLayoutPreview';
3
+ export * from './RepeatVariableEditor';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/LayoutEditor/index.ts"],"names":[],"mappings":"AAaA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
@@ -10,7 +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
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
13
+ export * from "./LayoutEditor.js";
14
+ export * from "./RepeatLayoutPreview.js";
15
+ export * from "./RepeatVariableEditor.js";
16
+
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/LayoutEditor/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 './LayoutEditor';\nexport * from './RepeatLayoutPreview';\nexport * from './RepeatVariableEditor';\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,oBAAiB;AAC/B,cAAc,2BAAwB;AACtC,cAAc,4BAAyB"}
@@ -1,5 +1,5 @@
1
- import { ReactElement } from 'react';
2
- import { LegendSpecOptions } from '../../model';
1
+ import type { ReactElement } from 'react';
2
+ import type { LegendSpecOptions } from '../../model';
3
3
  export interface LegendOptionsEditorProps {
4
4
  value?: LegendSpecOptions;
5
5
  onChange: (legend?: LegendSpecOptions) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"LegendOptionsEditor.d.ts","sourceRoot":"","sources":["../../../src/components/LegendOptionsEditor/LegendOptionsEditor.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAC9C,OAAO,EAGL,iBAAiB,EAQlB,MAAM,aAAa,CAAC;AAsBrB,MAAM,WAAW,wBAAwB;IACvC,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC/C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,aAAa,GAAG,YAAY,CAAC;CAC5C;AAED,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,QAAQ,EACR,gBAAuB,EACvB,WAA2B,GAC5B,EAAE,wBAAwB,GAAG,YAAY,CAgLzC"}
1
+ {"version":3,"file":"LegendOptionsEditor.d.ts","sourceRoot":"","sources":["../../../src/components/LegendOptionsEditor/LegendOptionsEditor.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,iBAAiB,EAA2D,MAAM,aAAa,CAAC;AA8B9G,MAAM,WAAW,wBAAwB;IACvC,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC/C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,aAAa,GAAG,YAAY,CAAC;CAC5C;AAED,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,QAAQ,EACR,gBAAuB,EACvB,WAA2B,GAC5B,EAAE,wBAAwB,GAAG,YAAY,CAgLzC"}
@@ -1,4 +1,3 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
1
  // Copyright The Perses Authors
3
2
  // Licensed under the Apache License, Version 2.0 (the "License");
4
3
  // you may not use this file except in compliance with the License.
@@ -11,10 +10,11 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
11
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
11
  // See the License for the specific language governing permissions and
13
12
  // limitations under the License.
14
- import { Switch, ToggleButtonGroup, ToggleButton } from '@mui/material';
15
- import { ErrorAlert, OptionsEditorControl, OptionsEditorGroup, SettingsAutocomplete, DEFAULT_LEGEND, getLegendSize, getLegendMode, getLegendPosition } from '@perses-dev/components';
16
- import { useMemo } from 'react';
17
- import { LEGEND_MODE_CONFIG, LEGEND_POSITIONS_CONFIG, validateLegendSpec, LEGEND_VALUE_CONFIG, LEGEND_SIZE_CONFIG, comparisonLegends } from '../../model';
13
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
14
+ import { Switch, ToggleButtonGroup, ToggleButton } from "@mui/material";
15
+ import { ErrorAlert, OptionsEditorControl, OptionsEditorGroup, SettingsAutocomplete, DEFAULT_LEGEND, getLegendSize, getLegendMode, getLegendPosition } from "@perses-dev/components";
16
+ import { useMemo } from "react";
17
+ import { LEGEND_MODE_CONFIG, LEGEND_POSITIONS_CONFIG, validateLegendSpec, LEGEND_VALUE_CONFIG, LEGEND_SIZE_CONFIG, comparisonLegends } from "../../model/index.js";
18
18
  const POSITION_OPTIONS = Object.entries(LEGEND_POSITIONS_CONFIG).map(([id, config])=>{
19
19
  return {
20
20
  id: id,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/LegendOptionsEditor/LegendOptionsEditor.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 { Switch, SwitchProps, ToggleButtonGroup, ToggleButton } from '@mui/material';\nimport {\n ErrorAlert,\n OptionsEditorControl,\n OptionsEditorGroup,\n SettingsAutocomplete,\n DEFAULT_LEGEND,\n getLegendSize,\n getLegendMode,\n getLegendPosition,\n} from '@perses-dev/components';\nimport { ReactElement, useMemo } from 'react';\nimport {\n LEGEND_MODE_CONFIG,\n LEGEND_POSITIONS_CONFIG,\n LegendSpecOptions,\n LegendSingleSelectConfig,\n validateLegendSpec,\n LEGEND_VALUE_CONFIG,\n LegendValue,\n LEGEND_SIZE_CONFIG,\n comparisonLegends,\n ComparisonValues,\n} from '../../model';\n\ntype LegendPositionOption = LegendSingleSelectConfig & { id: LegendSpecOptions['position'] };\n\nconst POSITION_OPTIONS: LegendPositionOption[] = Object.entries(LEGEND_POSITIONS_CONFIG).map(([id, config]) => {\n return {\n id: id as LegendSpecOptions['position'],\n ...config,\n };\n});\n\ntype LegendSizeOption = LegendSingleSelectConfig & { id: Required<LegendSpecOptions>['size'] };\n\nconst SIZE_OPTIONS: LegendSizeOption[] = Object.entries(LEGEND_SIZE_CONFIG).map(([id, config]) => {\n return {\n id: id as Required<LegendSpecOptions>['size'],\n ...config,\n };\n});\n\ntype LegendValueOption = LegendSingleSelectConfig & { id: LegendValue | ComparisonValues };\n\nexport interface LegendOptionsEditorProps {\n value?: LegendSpecOptions;\n onChange: (legend?: LegendSpecOptions) => void;\n showValuesEditor?: boolean;\n calculation?: 'aggregation' | 'comparison';\n}\n\nexport function LegendOptionsEditor({\n value,\n onChange,\n showValuesEditor = true,\n calculation = 'aggregation',\n}: LegendOptionsEditorProps): ReactElement {\n const handleLegendShowChange: SwitchProps['onChange'] = (_: unknown, checked: boolean) => {\n // legend is hidden when legend obj is undefined\n const legendValue = checked === true ? { position: DEFAULT_LEGEND.position } : undefined;\n onChange(legendValue);\n };\n\n const handleLegendPositionChange = (_: unknown, newValue: LegendPositionOption): void => {\n onChange({\n ...value,\n position: newValue.id,\n });\n };\n\n const handleLegendSizeChange = (_: unknown, newValue: LegendSizeOption): void => {\n onChange({\n ...value,\n position: currentPosition,\n size: newValue.id,\n });\n };\n\n const handleLegendValueChange = (_: unknown, newValue: LegendValueOption[]): void => {\n onChange({\n ...value,\n position: currentPosition,\n values: newValue.map((value) => {\n return value.id;\n }),\n });\n };\n\n const isValidLegend = validateLegendSpec(value);\n const currentPosition = getLegendPosition(value?.position);\n const legendPositionConfig = LEGEND_POSITIONS_CONFIG[currentPosition];\n\n const currentMode = getLegendMode(value?.mode);\n\n const currentSize = getLegendSize(value?.size);\n const legendSizeConfig = LEGEND_SIZE_CONFIG[currentSize];\n\n const legendValuesConfig = useMemo(() => {\n const currentValues = value?.values;\n if (!currentValues?.length) return [];\n\n if (calculation === 'aggregation') {\n return currentValues.reduce((result, item) => {\n const config = LEGEND_VALUE_CONFIG[item as LegendValue];\n if (config) {\n result.push({ ...config, id: item });\n }\n return result;\n }, [] as LegendValueOption[]);\n }\n\n return currentValues.map((id) => {\n const { label, description } = comparisonLegends[id as ComparisonValues];\n return {\n id,\n label,\n description,\n };\n });\n }, [calculation, value?.values]);\n\n const valueOptions = useMemo(() => {\n if (calculation === 'aggregation') {\n return Object.entries(LEGEND_VALUE_CONFIG || {}).map(([id, config]) => {\n return {\n id: id as LegendValue,\n ...config,\n };\n });\n }\n\n return Object.entries(comparisonLegends).map(([id, config]) => ({\n id: id as ComparisonValues,\n ...config,\n }));\n }, [calculation]);\n\n return (\n <OptionsEditorGroup title=\"Legend\">\n {!isValidLegend && <ErrorAlert error={{ name: 'invalid-legend', message: 'Invalid legend spec' }} />}\n <OptionsEditorControl label=\"Show\" control={<Switch checked={!!value} onChange={handleLegendShowChange} />} />\n {value && (\n <>\n <OptionsEditorControl\n label=\"Position\"\n control={\n <SettingsAutocomplete\n value={{\n ...legendPositionConfig,\n id: currentPosition,\n }}\n options={POSITION_OPTIONS}\n onChange={handleLegendPositionChange}\n disableClearable\n />\n }\n />\n <OptionsEditorControl\n label=\"Mode\"\n control={\n <ToggleButtonGroup\n color=\"primary\"\n exclusive\n value={currentMode}\n aria-label=\"Mode\"\n onChange={(__, newValue) => {\n onChange({\n ...value,\n position: currentPosition,\n mode: newValue,\n });\n }}\n >\n {Object.entries(LEGEND_MODE_CONFIG).map(([modeId, config]) => (\n <ToggleButton\n key={modeId}\n value={modeId}\n selected={currentMode === modeId}\n aria-label={`display ${modeId} mode`}\n >\n {config.label}\n </ToggleButton>\n ))}\n </ToggleButtonGroup>\n }\n />\n {currentMode === 'table' && (\n <>\n <OptionsEditorControl\n label=\"Size\"\n control={\n <SettingsAutocomplete\n value={{\n ...legendSizeConfig,\n id: currentSize,\n }}\n options={SIZE_OPTIONS}\n onChange={handleLegendSizeChange}\n // TODO: enable sizes for list mode when we normalize the layout of\n // lists to more closely match tables.\n disableClearable\n />\n }\n />\n {showValuesEditor && (\n <OptionsEditorControl\n label=\"Values\"\n control={\n // For some reason, the inferred option type doesn't always seem to work\n // quite right when `multiple` is true. Explicitly setting the generics\n // to work around this.\n <SettingsAutocomplete<LegendValueOption, true, true>\n multiple={true}\n disableCloseOnSelect\n disableClearable\n value={legendValuesConfig}\n options={valueOptions}\n onChange={handleLegendValueChange}\n limitTags={1}\n ChipProps={{\n size: 'small',\n }}\n />\n }\n />\n )}\n </>\n )}\n </>\n )}\n </OptionsEditorGroup>\n );\n}\n"],"names":["Switch","ToggleButtonGroup","ToggleButton","ErrorAlert","OptionsEditorControl","OptionsEditorGroup","SettingsAutocomplete","DEFAULT_LEGEND","getLegendSize","getLegendMode","getLegendPosition","useMemo","LEGEND_MODE_CONFIG","LEGEND_POSITIONS_CONFIG","validateLegendSpec","LEGEND_VALUE_CONFIG","LEGEND_SIZE_CONFIG","comparisonLegends","POSITION_OPTIONS","Object","entries","map","id","config","SIZE_OPTIONS","LegendOptionsEditor","value","onChange","showValuesEditor","calculation","handleLegendShowChange","_","checked","legendValue","position","undefined","handleLegendPositionChange","newValue","handleLegendSizeChange","currentPosition","size","handleLegendValueChange","values","isValidLegend","legendPositionConfig","currentMode","mode","currentSize","legendSizeConfig","legendValuesConfig","currentValues","length","reduce","result","item","push","label","description","valueOptions","title","error","name","message","control","options","disableClearable","color","exclusive","aria-label","__","modeId","selected","multiple","disableCloseOnSelect","limitTags","ChipProps"],"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,MAAM,EAAeC,iBAAiB,EAAEC,YAAY,QAAQ,gBAAgB;AACrF,SACEC,UAAU,EACVC,oBAAoB,EACpBC,kBAAkB,EAClBC,oBAAoB,EACpBC,cAAc,EACdC,aAAa,EACbC,aAAa,EACbC,iBAAiB,QACZ,yBAAyB;AAChC,SAAuBC,OAA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AOC,UAAUG;;;YAC/EJ,uBACC;;kCACE,KAACtB;wBACCoD,OAAM;wBACNO,uBACE,KAACzD;4BACCoB,OAAO;gCACL,GAAGkB,oBAAoB;gCACvBtB,IAAIiB;4BACN;4BACAyB,SAAS9C;4BACTS,UAAUS;4BACV6B,gBAAgB;;;kCAItB,KAAC7D;wBACCoD,OAAM;wBACNO,uBACE,KAAC9D;4BACCiE,OAAM;4BACNC,SAAS;4BACTzC,OAAOmB;4BACPuB,cAAW;4BACXzC,UAAU,CAAC0C,IAAIhC;gCACbV,SAAS;oCACP,GAAGD,KAAK;oCACRQ,UAAUK;oCACVO,MAAMT;gCACR;4BACF;sCAEClB,OAAOC,OAAO,CAACR,oBAAoBS,GAAG,CAAC,CAAC,CAACiD,QAAQ/C,OAAO,iBACvD,KAACrB;oCAECwB,OAAO4C;oCACPC,UAAU1B,gBAAgByB;oCAC1BF,cAAY,CAAC,QAAQ,EAAEE,OAAO,KAAK,CAAC;8CAEnC/C,OAAOiC,KAAK;mCALRc;;;oBAWdzB,gBAAgB,yBACf;;0CACE,KAACzC;gCACCoD,OAAM;gCACNO,uBACE,KAACzD;oCACCoB,OAAO;wCACL,GAAGsB,gBAAgB;wCACnB1B,IAAIyB;oCACN;oCACAiB,SAASxC;oCACTG,UAAUW;oCACV,mEAAmE;oCACnE,sCAAsC;oCACtC2B,gBAAgB;;;4BAIrBrC,kCACC,KAACxB;gCACCoD,OAAM;gCACNO,SACE,wEAAwE;gCACxE,uEAAuE;gCACvE,uBAAuB;8CACvB,KAACzD;oCACCkE,UAAU;oCACVC,oBAAoB;oCACpBR,gBAAgB;oCAChBvC,OAAOuB;oCACPe,SAASN;oCACT/B,UAAUc;oCACViC,WAAW;oCACXC,WAAW;wCACTnC,MAAM;oCACR;;;;;;;;;AAWtB"}
1
+ {"version":3,"sources":["../../../src/components/LegendOptionsEditor/LegendOptionsEditor.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 type { SwitchProps } from '@mui/material';\nimport { Switch, ToggleButtonGroup, ToggleButton } from '@mui/material';\nimport {\n ErrorAlert,\n OptionsEditorControl,\n OptionsEditorGroup,\n SettingsAutocomplete,\n DEFAULT_LEGEND,\n getLegendSize,\n getLegendMode,\n getLegendPosition,\n} from '@perses-dev/components';\nimport type { ReactElement } from 'react';\nimport { useMemo } from 'react';\n\nimport type { LegendSpecOptions, LegendSingleSelectConfig, LegendValue, ComparisonValues } from '../../model';\nimport {\n LEGEND_MODE_CONFIG,\n LEGEND_POSITIONS_CONFIG,\n validateLegendSpec,\n LEGEND_VALUE_CONFIG,\n LEGEND_SIZE_CONFIG,\n comparisonLegends,\n} from '../../model';\n\ntype LegendPositionOption = LegendSingleSelectConfig & { id: LegendSpecOptions['position'] };\n\nconst POSITION_OPTIONS: LegendPositionOption[] = Object.entries(LEGEND_POSITIONS_CONFIG).map(([id, config]) => {\n return {\n id: id as LegendSpecOptions['position'],\n ...config,\n };\n});\n\ntype LegendSizeOption = LegendSingleSelectConfig & { id: Required<LegendSpecOptions>['size'] };\n\nconst SIZE_OPTIONS: LegendSizeOption[] = Object.entries(LEGEND_SIZE_CONFIG).map(([id, config]) => {\n return {\n id: id as Required<LegendSpecOptions>['size'],\n ...config,\n };\n});\n\ntype LegendValueOption = LegendSingleSelectConfig & { id: LegendValue | ComparisonValues };\n\nexport interface LegendOptionsEditorProps {\n value?: LegendSpecOptions;\n onChange: (legend?: LegendSpecOptions) => void;\n showValuesEditor?: boolean;\n calculation?: 'aggregation' | 'comparison';\n}\n\nexport function LegendOptionsEditor({\n value,\n onChange,\n showValuesEditor = true,\n calculation = 'aggregation',\n}: LegendOptionsEditorProps): ReactElement {\n const handleLegendShowChange: SwitchProps['onChange'] = (_: unknown, checked: boolean) => {\n // legend is hidden when legend obj is undefined\n const legendValue = checked === true ? { position: DEFAULT_LEGEND.position } : undefined;\n onChange(legendValue);\n };\n\n const handleLegendPositionChange = (_: unknown, newValue: LegendPositionOption): void => {\n onChange({\n ...value,\n position: newValue.id,\n });\n };\n\n const handleLegendSizeChange = (_: unknown, newValue: LegendSizeOption): void => {\n onChange({\n ...value,\n position: currentPosition,\n size: newValue.id,\n });\n };\n\n const handleLegendValueChange = (_: unknown, newValue: LegendValueOption[]): void => {\n onChange({\n ...value,\n position: currentPosition,\n values: newValue.map((value) => {\n return value.id;\n }),\n });\n };\n\n const isValidLegend = validateLegendSpec(value);\n const currentPosition = getLegendPosition(value?.position);\n const legendPositionConfig = LEGEND_POSITIONS_CONFIG[currentPosition];\n\n const currentMode = getLegendMode(value?.mode);\n\n const currentSize = getLegendSize(value?.size);\n const legendSizeConfig = LEGEND_SIZE_CONFIG[currentSize];\n\n const legendValuesConfig = useMemo(() => {\n const currentValues = value?.values;\n if (!currentValues?.length) return [];\n\n if (calculation === 'aggregation') {\n return currentValues.reduce((result, item) => {\n const config = LEGEND_VALUE_CONFIG[item as LegendValue];\n if (config) {\n result.push({ ...config, id: item });\n }\n return result;\n }, [] as LegendValueOption[]);\n }\n\n return currentValues.map((id) => {\n const { label, description } = comparisonLegends[id as ComparisonValues];\n return {\n id,\n label,\n description,\n };\n });\n }, [calculation, value?.values]);\n\n const valueOptions = useMemo(() => {\n if (calculation === 'aggregation') {\n return Object.entries(LEGEND_VALUE_CONFIG || {}).map(([id, config]) => {\n return {\n id: id as LegendValue,\n ...config,\n };\n });\n }\n\n return Object.entries(comparisonLegends).map(([id, config]) => ({\n id: id as ComparisonValues,\n ...config,\n }));\n }, [calculation]);\n\n return (\n <OptionsEditorGroup title=\"Legend\">\n {!isValidLegend && <ErrorAlert error={{ name: 'invalid-legend', message: 'Invalid legend spec' }} />}\n <OptionsEditorControl label=\"Show\" control={<Switch checked={!!value} onChange={handleLegendShowChange} />} />\n {value && (\n <>\n <OptionsEditorControl\n label=\"Position\"\n control={\n <SettingsAutocomplete\n value={{\n ...legendPositionConfig,\n id: currentPosition,\n }}\n options={POSITION_OPTIONS}\n onChange={handleLegendPositionChange}\n disableClearable\n />\n }\n />\n <OptionsEditorControl\n label=\"Mode\"\n control={\n <ToggleButtonGroup\n color=\"primary\"\n exclusive\n value={currentMode}\n aria-label=\"Mode\"\n onChange={(__, newValue) => {\n onChange({\n ...value,\n position: currentPosition,\n mode: newValue,\n });\n }}\n >\n {Object.entries(LEGEND_MODE_CONFIG).map(([modeId, config]) => (\n <ToggleButton\n key={modeId}\n value={modeId}\n selected={currentMode === modeId}\n aria-label={`display ${modeId} mode`}\n >\n {config.label}\n </ToggleButton>\n ))}\n </ToggleButtonGroup>\n }\n />\n {currentMode === 'table' && (\n <>\n <OptionsEditorControl\n label=\"Size\"\n control={\n <SettingsAutocomplete\n value={{\n ...legendSizeConfig,\n id: currentSize,\n }}\n options={SIZE_OPTIONS}\n onChange={handleLegendSizeChange}\n // TODO: enable sizes for list mode when we normalize the layout of\n // lists to more closely match tables.\n disableClearable\n />\n }\n />\n {showValuesEditor && (\n <OptionsEditorControl\n label=\"Values\"\n control={\n // For some reason, the inferred option type doesn't always seem to work\n // quite right when `multiple` is true. Explicitly setting the generics\n // to work around this.\n <SettingsAutocomplete<LegendValueOption, true, true>\n multiple={true}\n disableCloseOnSelect\n disableClearable\n value={legendValuesConfig}\n options={valueOptions}\n onChange={handleLegendValueChange}\n limitTags={1}\n ChipProps={{\n size: 'small',\n }}\n />\n }\n />\n )}\n </>\n )}\n </>\n )}\n </OptionsEditorGroup>\n );\n}\n"],"names":["Switch","ToggleButtonGroup","ToggleButton","ErrorAlert","OptionsEditorControl","OptionsEditorGroup","SettingsAutocomplete","DEFAULT_LEGEND","getLegendSize","getLegendMode","getLegendPosition","useMemo","LEGEND_MODE_CONFIG","LEGEND_POSITIONS_CONFIG","validateLegendSpec","LEGEND_VALUE_CONFIG","LEGEND_SIZE_CONFIG","comparisonLegends","POSITION_OPTIONS","Object","entries","map","id","config","SIZE_OPTIONS","LegendOptionsEditor","value","onChange","showValuesEditor","calculation","handleLegendShowChange","_","checked","legendValue","position","undefined","handleLegendPositionChange","newValue","handleLegendSizeChange","currentPosition","size","handleLegendValueChange","values","isValidLegend","legendPositionConfig","currentMode","mode","currentSize","legendSizeConfig","legendValuesConfig","currentValues","length","reduce","result","item","push","label","description","valueOptions","title","error","name","message","control","options","disableClearable","color","exclusive","aria-label","__","modeId","selected","multiple","disableCloseOnSelect","limitTags","ChipProps"],"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;;AAGjC,SAASA,MAAM,EAAEC,iBAAiB,EAAEC,YAAY,QAAQ,gBAAgB;AACxE,SACEC,UAAU,EACVC,oBAAoB,EACpBC,kBAAkB,EAClBC,oBAAoB,EACpBC,cAAc,EACdC,aAAa,EACbC,aAAa,EACbC,iBAAiB,QACZ,yBAAyB;AAEhC,SAASC,OAAO,QAAQ,QAAQ;AAGhC,SACEC,kBAAkB,EAClBC,uBAAuB,EACvBC,kBAAkB,EAClBC,mBAAmB,EACnBC,kBAAkB,EAClBC,iBAAiB,QACZ,uBAAc;AAIrB,MAAMC,mBAA2CC,OAAOC,OAAO,CAACP,yBAAyBQ,GAAG,CAAC,CAAC,CAACC,IAAIC,OAAO;IACxG,OAAO;QACLD,IAAIA;QACJ,GAAGC,MAAM;IACX;AACF;AAIA,MAAMC,eAAmCL,OAAOC,OAAO,CAACJ,oBAAoBK,GAAG,CAAC,CAAC,CAACC,IAAIC,OAAO;IAC3F,OAAO;QACLD,IAAIA;QACJ,GAAGC,MAAM;IACX;A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AOC,OAAO,CAACR,oBAAoBS,GAAG,CAAC,CAAC,CAACiD,QAAQ/C,OAAO,iBACvD,KAACrB;oCAECwB,OAAO4C;oCACPC,UAAU1B,gBAAgByB;oCAC1BF,cAAY,CAAC,QAAQ,EAAEE,OAAO,KAAK,CAAC;8CAEnC/C,OAAOiC,KAAK;mCALRc;;;oBAWdzB,gBAAgB,yBACf;;0CACE,KAACzC;gCACCoD,OAAM;gCACNO,uBACE,KAACzD;oCACCoB,OAAO;wCACL,GAAGsB,gBAAgB;wCACnB1B,IAAIyB;oCACN;oCACAiB,SAASxC;oCACTG,UAAUW;oCACV,mEAAmE;oCACnE,sCAAsC;oCACtC2B,gBAAgB;;;4BAIrBrC,kCACC,KAACxB;gCACCoD,OAAM;gCACNO,SACE,wEAAwE;gCACxE,uEAAuE;gCACvE,uBAAuB;8CACvB,KAACzD;oCACCkE,UAAU;oCACVC,oBAAoB;oCACpBR,gBAAgB;oCAChBvC,OAAOuB;oCACPe,SAASN;oCACT/B,UAAUc;oCACViC,WAAW;oCACXC,WAAW;wCACTnC,MAAM;oCACR;;;;;;;;;AAWtB"}
@@ -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 './LegendOptionsEditor';
13
+ export * from "./LegendOptionsEditor.js";
14
14
 
15
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/LegendOptionsEditor/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 './LegendOptionsEditor';\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,wBAAwB"}
1
+ {"version":3,"sources":["../../../src/components/LegendOptionsEditor/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 './LegendOptionsEditor';\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,2BAAwB"}
@@ -1,6 +1,6 @@
1
- import { HTMLAttributes, ReactElement } from 'react';
2
- import { Control } from 'react-hook-form';
3
- import { PanelEditorValues } from '../../model';
1
+ import type { HTMLAttributes, ReactElement } from 'react';
2
+ import type { Control } from 'react-hook-form';
3
+ import type { PanelEditorValues } from '../../model';
4
4
  export interface LinksEditorProps extends HTMLAttributes<HTMLDivElement> {
5
5
  control: Control<PanelEditorValues>;
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"LinksEditor.d.ts","sourceRoot":"","sources":["../../../src/components/LinksEditor/LinksEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAY,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAA6B,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAIrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACtE,OAAO,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACrC;AAED,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,GAAG,YAAY,CAiCjF"}
1
+ {"version":3,"file":"LinksEditor.d.ts","sourceRoot":"","sources":["../../../src/components/LinksEditor/LinksEditor.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACtE,OAAO,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACrC;AAED,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,GAAG,YAAY,CAiCjF"}
@@ -11,12 +11,12 @@ 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 { Fragment } from 'react';
15
- import { Divider, IconButton, Stack, Typography } from '@mui/material';
16
- import { Controller, useFieldArray } from 'react-hook-form';
17
- import PlusIcon from 'mdi-material-ui/Plus';
18
- import MinusIcon from 'mdi-material-ui/Minus';
19
- import { LinkEditorForm } from '@perses-dev/components';
14
+ import { Divider, IconButton, Stack, Typography } from "@mui/material";
15
+ import { LinkEditorForm } from "@perses-dev/components";
16
+ import MinusIcon from "mdi-material-ui/Minus";
17
+ import PlusIcon from "mdi-material-ui/Plus";
18
+ import { Fragment } from "react";
19
+ import { Controller, useFieldArray } from "react-hook-form";
20
20
  export function LinksEditor({ control, ...props }) {
21
21
  const { fields, append, remove } = useFieldArray({
22
22
  control: control,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/LinksEditor/LinksEditor.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 { Fragment, HTMLAttributes, ReactElement } from 'react';\nimport { Divider, IconButton, Stack, Typography } from '@mui/material';\nimport { Controller, useFieldArray, Control } from 'react-hook-form';\nimport PlusIcon from 'mdi-material-ui/Plus';\nimport MinusIcon from 'mdi-material-ui/Minus';\nimport { LinkEditorForm } from '@perses-dev/components';\nimport { PanelEditorValues } from '../../model';\n\nexport interface LinksEditorProps extends HTMLAttributes<HTMLDivElement> {\n control: Control<PanelEditorValues>;\n}\n\nexport function LinksEditor({ control, ...props }: LinksEditorProps): ReactElement {\n const { fields, append, remove } = useFieldArray({\n control: control,\n name: 'panelDefinition.spec.links',\n });\n\n return (\n <Stack {...props} gap={3}>\n {fields && fields.length > 0 ? (\n fields.map((field, index) => (\n <Fragment key={field.id}>\n <Stack direction=\"row\" gap={1} alignItems=\"center\">\n <LinkControl control={control} index={index} />\n <IconButton style={{ width: 'fit-content', height: 'fit-content' }} onClick={() => remove(index)}>\n <MinusIcon />\n </IconButton>\n </Stack>\n <Divider />\n </Fragment>\n ))\n ) : (\n <Typography variant=\"subtitle1\" mb={2} fontStyle=\"italic\">\n No links defined\n </Typography>\n )}\n <IconButton\n style={{ width: 'fit-content', height: 'fit-content' }}\n onClick={() => append({ url: '', name: '', tooltip: '', renderVariables: false, targetBlank: false })}\n >\n <PlusIcon />\n </IconButton>\n </Stack>\n );\n}\n\nfunction LinkControl({ control, index }: { control: Control<PanelEditorValues>; index: number }): ReactElement {\n const defaultLink = { url: '', name: '', tooltip: '', renderVariables: false, targetBlank: false };\n return (\n <Controller\n control={control}\n name={`panelDefinition.spec.links.${index}`}\n render={({ field, field: { value: link }, fieldState }) => {\n const safeLink = link ?? defaultLink;\n return (\n <LinkEditorForm\n mode=\"inline\"\n url={{\n value: safeLink.url,\n label: 'URL',\n error: { hasError: !!fieldState.error, helperText: fieldState.error?.message },\n onChange: (url) => {\n field.onChange({ ...link, url });\n },\n }}\n newTabOpen={{\n value: !!safeLink.targetBlank,\n onChange: (targetBlank) => {\n field.onChange({ ...link, targetBlank });\n },\n label: 'Open in new tab',\n }}\n name={{\n value: safeLink.name ?? '',\n label: 'Name',\n onChange: (name) => {\n field.onChange({ ...link, name });\n },\n }}\n renderVariables={{\n value: !!safeLink.renderVariables,\n label: 'Render variables',\n onChange: (renderVariables) => {\n field.onChange({ ...link, renderVariables });\n },\n }}\n tooltip={{\n value: safeLink.tooltip ?? '',\n label: 'Tooltip',\n onChange: (tooltip) => {\n field.onChange({ ...link, tooltip });\n },\n }}\n />\n );\n }}\n />\n );\n}\n"],"names":["Fragment","Divider","IconButton","Stack","Typography","Controller","useFieldArray","PlusIcon","MinusIcon","LinkEditorForm","LinksEditor","control","props","fields","append","remove","name","gap","length","map","field","index","direction","alignItems","LinkControl","style","width","height","onClick","id","variant","mb","fontStyle","url","tooltip","renderVariables","targetBlank","defaultLink","render","value","link","fieldState","safeLink","mode","label","error","hasError","helperText","message","onChange","newTabOpen"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E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/LinksEditor.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 { Divider, IconButton, Stack, Typography } from '@mui/material';\nimport { LinkEditorForm } from '@perses-dev/components';\nimport MinusIcon from 'mdi-material-ui/Minus';\nimport PlusIcon from 'mdi-material-ui/Plus';\nimport type { HTMLAttributes, ReactElement } from 'react';\nimport { Fragment } from 'react';\nimport type { Control } from 'react-hook-form';\nimport { Controller, useFieldArray } from 'react-hook-form';\n\nimport type { PanelEditorValues } from '../../model';\n\nexport interface LinksEditorProps extends HTMLAttributes<HTMLDivElement> {\n control: Control<PanelEditorValues>;\n}\n\nexport function LinksEditor({ control, ...props }: LinksEditorProps): ReactElement {\n const { fields, append, remove } = useFieldArray({\n control: control,\n name: 'panelDefinition.spec.links',\n });\n\n return (\n <Stack {...props} gap={3}>\n {fields && fields.length > 0 ? (\n fields.map((field, index) => (\n <Fragment key={field.id}>\n <Stack direction=\"row\" gap={1} alignItems=\"center\">\n <LinkControl control={control} index={index} />\n <IconButton style={{ width: 'fit-content', height: 'fit-content' }} onClick={() => remove(index)}>\n <MinusIcon />\n </IconButton>\n </Stack>\n <Divider />\n </Fragment>\n ))\n ) : (\n <Typography variant=\"subtitle1\" mb={2} fontStyle=\"italic\">\n No links defined\n </Typography>\n )}\n <IconButton\n style={{ width: 'fit-content', height: 'fit-content' }}\n onClick={() => append({ url: '', name: '', tooltip: '', renderVariables: false, targetBlank: false })}\n >\n <PlusIcon />\n </IconButton>\n </Stack>\n );\n}\n\nfunction LinkControl({ control, index }: { control: Control<PanelEditorValues>; index: number }): ReactElement {\n const defaultLink = { url: '', name: '', tooltip: '', renderVariables: false, targetBlank: false };\n return (\n <Controller\n control={control}\n name={`panelDefinition.spec.links.${index}`}\n render={({ field, field: { value: link }, fieldState }) => {\n const safeLink = link ?? defaultLink;\n return (\n <LinkEditorForm\n mode=\"inline\"\n url={{\n value: safeLink.url,\n label: 'URL',\n error: { hasError: !!fieldState.error, helperText: fieldState.error?.message },\n onChange: (url) => {\n field.onChange({ ...link, url });\n },\n }}\n newTabOpen={{\n value: !!safeLink.targetBlank,\n onChange: (targetBlank) => {\n field.onChange({ ...link, targetBlank });\n },\n label: 'Open in new tab',\n }}\n name={{\n value: safeLink.name ?? '',\n label: 'Name',\n onChange: (name) => {\n field.onChange({ ...link, name });\n },\n }}\n renderVariables={{\n value: !!safeLink.renderVariables,\n label: 'Render variables',\n onChange: (renderVariables) => {\n field.onChange({ ...link, renderVariables });\n },\n }}\n tooltip={{\n value: safeLink.tooltip ?? '',\n label: 'Tooltip',\n onChange: (tooltip) => {\n field.onChange({ ...link, tooltip });\n },\n }}\n />\n );\n }}\n />\n );\n}\n"],"names":["Divider","IconButton","Stack","Typography","LinkEditorForm","MinusIcon","PlusIcon","Fragment","Controller","useFieldArray","LinksEditor","control","props","fields","append","remove","name","gap","length","map","field","index","direction","alignItems","LinkControl","style","width","height","onClick","id","variant","mb","fontStyle","url","tooltip","renderVariables","targetBlank","defaultLink","render","value","link","fieldState","safeLink","mode","label","error","hasError","helperText","message","onChange","newTabOpen"],"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,OAAO,EAAEC,UAAU,EAAEC,KAAK,EAAEC,UAAU,QAAQ,gBAAgB;AACvE,SAASC,cAAc,QAAQ,yBAAyB;AACxD,OAAOC,eAAe,wBAAwB;AAC9C,OAAOC,c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IAAI,EAAE,EAAEC,UAAU,EAAE;YACpD,MAAMC,WAAWF,QAAQH;YACzB,qBACE,KAACjC;gBACCuC,MAAK;gBACLV,KAAK;oBACHM,OAAOG,SAAST,GAAG;oBACnBW,OAAO;oBACPC,OAAO;wBAAEC,UAAU,CAAC,CAACL,WAAWI,KAAK;wBAAEE,YAAYN,WAAWI,KAAK,EAAEG;oBAAQ;oBAC7EC,UAAU,CAAChB;wBACTb,MAAM6B,QAAQ,CAAC;4BAAE,GAAGT,IAAI;4BAAEP;wBAAI;oBAChC;gBACF;gBACAiB,YAAY;oBACVX,OAAO,CAAC,CAACG,SAASN,WAAW;oBAC7Ba,UAAU,CAACb;wBACThB,MAAM6B,QAAQ,CAAC;4BAAE,GAAGT,IAAI;4BAAEJ;wBAAY;oBACxC;oBACAQ,OAAO;gBACT;gBACA5B,MAAM;oBACJuB,OAAOG,SAAS1B,IAAI,IAAI;oBACxB4B,OAAO;oBACPK,UAAU,CAACjC;wBACTI,MAAM6B,QAAQ,CAAC;4BAAE,GAAGT,IAAI;4BAAExB;wBAAK;oBACjC;gBACF;gBACAmB,iBAAiB;oBACfI,OAAO,CAAC,CAACG,SAASP,eAAe;oBACjCS,OAAO;oBACPK,UAAU,CAACd;wBACTf,MAAM6B,QAAQ,CAAC;4BAAE,GAAGT,IAAI;4BAAEL;wBAAgB;oBAC5C;gBACF;gBACAD,SAAS;oBACPK,OAAOG,SAASR,OAAO,IAAI;oBAC3BU,OAAO;oBACPK,UAAU,CAACf;wBACTd,MAAM6B,QAAQ,CAAC;4BAAE,GAAGT,IAAI;4BAAEN;wBAAQ;oBACpC;gBACF;;QAGN;;AAGN"}
@@ -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 './LinksEditor';
13
+ export * from "./LinksEditor.js";
14
14
 
15
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/LinksEditor/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 './LinksEditor';\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,gBAAgB"}
1
+ {"version":3,"sources":["../../../src/components/LinksEditor/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 './LinksEditor';\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,mBAAgB"}
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import type { FC } from 'react';
2
2
  export interface MetricLabelInputProps {
3
3
  value?: string;
4
4
  onChange: (metricLabel?: string) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"MetricLabelInput.d.ts","sourceRoot":"","sources":["../../../src/components/MetricLabelInput/MetricLabelInput.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAatD,CAAC"}
1
+ {"version":3,"file":"MetricLabelInput.d.ts","sourceRoot":"","sources":["../../../src/components/MetricLabelInput/MetricLabelInput.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAatD,CAAC"}
@@ -11,8 +11,8 @@ import { jsx as _jsx } 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 { TextField } from '@mui/material';
15
- import { OptionsEditorControl } from '@perses-dev/components';
14
+ import { TextField } from "@mui/material";
15
+ import { OptionsEditorControl } from "@perses-dev/components";
16
16
  export const MetricLabelInput = ({ value, onChange })=>{
17
17
  const handleChange = (event)=>{
18
18
  const newValue = event.target.value;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MetricLabelInput/MetricLabelInput.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 { TextField } from '@mui/material';\nimport { OptionsEditorControl } from '@perses-dev/components';\nimport { FC } from 'react';\n\nexport interface MetricLabelInputProps {\n value?: string;\n onChange: (metricLabel?: string) => void;\n}\n\nexport const MetricLabelInput: FC<MetricLabelInputProps> = ({ value, onChange }) => {\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n const newValue = event.target.value;\n onChange(newValue || undefined);\n };\n\n return (\n <OptionsEditorControl\n label=\"Metric label\"\n description=\"Specify label to display\"\n control={<TextField fullWidth name=\"Metric label\" value={value || ''} onChange={handleChange} />}\n />\n );\n};\n"],"names":["TextField","OptionsEditorControl","MetricLabelInput","value","onChange","handleChange","event","newValue","target","undefined","label","description","control","fullWidth","name"],"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,SAAS,QAAQ,gBAAgB;AAC1C,SAASC,oBAAoB,QAAQ,yBAAyB;AAQ9D,OAAO,MAAMC,mBAA8C,CAAC,EAAEC,KAAK,EAAEC,QAAQ,EAAE;IAC7E,MAAMC,eAAe,CAACC;QACpB,MAAMC,WAAWD,MAAME,MAAM,CAACL,KAAK;QACnCC,SAASG,YAAYE;IACvB;IAEA,qBACE,KAACR;QACCS,OAAM;QACNC,aAAY;QACZC,uBAAS,KAACZ;YAAUa,SAAS;YAACC,MAAK;YAAeX,OAAOA,SAAS;YAAIC,UAAUC;;;AAGtF,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/MetricLabelInput/MetricLabelInput.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 { TextField } from '@mui/material';\nimport { OptionsEditorControl } from '@perses-dev/components';\nimport type { FC } from 'react';\n\nexport interface MetricLabelInputProps {\n value?: string;\n onChange: (metricLabel?: string) => void;\n}\n\nexport const MetricLabelInput: FC<MetricLabelInputProps> = ({ value, onChange }) => {\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n const newValue = event.target.value;\n onChange(newValue || undefined);\n };\n\n return (\n <OptionsEditorControl\n label=\"Metric label\"\n description=\"Specify label to display\"\n control={<TextField fullWidth name=\"Metric label\" value={value || ''} onChange={handleChange} />}\n />\n );\n};\n"],"names":["TextField","OptionsEditorControl","MetricLabelInput","value","onChange","handleChange","event","newValue","target","undefined","label","description","control","fullWidth","name"],"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,SAAS,QAAQ,gBAAgB;AAC1C,SAASC,oBAAoB,QAAQ,yBAAyB;AAQ9D,OAAO,MAAMC,mBAA8C,CAAC,EAAEC,KAAK,EAAEC,QAAQ,EAAE;IAC7E,MAAMC,eAAe,CAACC;QACpB,MAAMC,WAAWD,MAAME,MAAM,CAACL,KAAK;QACnCC,SAASG,YAAYE;IACvB;IAEA,qBACE,KAACR;QACCS,OAAM;QACNC,aAAY;QACZC,uBAAS,KAACZ;YAAUa,SAAS;YAACC,MAAK;YAAeX,OAAOA,SAAS;YAAIC,UAAUC;;;AAGtF,EAAE"}
@@ -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 './MetricLabelInput';
13
+ export * from "./MetricLabelInput.js";
14
14
 
15
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MetricLabelInput/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 './MetricLabelInput';\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,qBAAqB"}
1
+ {"version":3,"sources":["../../../src/components/MetricLabelInput/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 './MetricLabelInput';\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,wBAAqB"}
@@ -1,7 +1,6 @@
1
- /// <reference types="react" />
2
- import { QueryDefinition, QueryPluginType } from '@perses-dev/spec';
3
- import { QueryData } from '../../runtime';
4
- import { PluginEditorRef } from '../PluginEditor';
1
+ import type { QueryDefinition, QueryPluginType } from '@perses-dev/spec';
2
+ import type { QueryData } from '../../runtime';
3
+ import type { PluginEditorRef } from '../PluginEditor';
5
4
  export interface MultiQueryEditorProps {
6
5
  queryTypes: QueryPluginType[];
7
6
  filteredQueryPlugins?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"MultiQueryEditor.d.ts","sourceRoot":"","sources":["../../../src/components/MultiQueryEditor/MultiQueryEditor.tsx"],"names":[],"mappings":";AAiBA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAuD,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,YAAY,CAAC,EAAE,SAAS,EAAE,CAAC;IAC3B,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;IAC/C,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;CAC7D;AA4CD;;;;;;;GAOG;AAEH,eAAO,MAAM,gBAAgB,mHA0F3B,CAAC"}
1
+ {"version":3,"file":"MultiQueryEditor.d.ts","sourceRoot":"","sources":["../../../src/components/MultiQueryEditor/MultiQueryEditor.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAMzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGvD,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,YAAY,CAAC,EAAE,SAAS,EAAE,CAAC;IAC3B,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;IAC/C,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;CAC7D;AA4CD;;;;;;;GAOG;AAEH,eAAO,MAAM,gBAAgB,mHAyF3B,CAAC"}
@@ -11,12 +11,12 @@ 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 { forwardRef, useState } from 'react';
15
- import { produce } from 'immer';
16
- import { Button, Stack } from '@mui/material';
17
- import AddIcon from 'mdi-material-ui/Plus';
18
- import { useListPluginMetadata, usePlugin, usePluginRegistry } from '../../runtime';
19
- import { QueryEditorContainer } from './QueryEditorContainer';
14
+ import { Button, Stack } from "@mui/material";
15
+ import { produce } from "immer";
16
+ import AddIcon from "mdi-material-ui/Plus";
17
+ import { forwardRef, useState } from "react";
18
+ import { useListPluginMetadata, usePlugin, usePluginRegistry } from "../../runtime/index.js";
19
+ import { QueryEditorContainer } from "./QueryEditorContainer.js";
20
20
  function useDefaultQueryDefinition(queryTypes, filteredQueryPlugins) {
21
21
  // Build the default query plugin
22
22
  // This will be used only if the queries are empty, to open a starting query
@@ -115,9 +115,12 @@ function useDefaultQueryDefinition(queryTypes, filteredQueryPlugins) {
115
115
  });
116
116
  };
117
117
  // show one query input if queries is empty
118
- const queryDefinitions = queries.length ? queries : !isLoading ? [
119
- defaultInitialQueryDefinition
120
- ] : [];
118
+ let queryDefinitions = queries;
119
+ if (queries.length === 0 && !isLoading) {
120
+ queryDefinitions = [
121
+ defaultInitialQueryDefinition
122
+ ];
123
+ }
121
124
  return /*#__PURE__*/ _jsxs(_Fragment, {
122
125
  children: [
123
126
  /*#__PURE__*/ _jsx(Stack, {