@perses-dev/prometheus-plugin 0.56.0 → 0.57.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/__mf/js/Prometheus.3cac2d10.js +6 -0
  2. package/__mf/js/async/1233.0ab88b51.js +1 -0
  3. package/__mf/js/async/1324.ce01eced.js +1 -0
  4. package/__mf/js/async/1432.0c3e4ed0.js +1 -0
  5. package/__mf/js/async/1605.dc180cb8.js +110 -0
  6. package/__mf/js/async/1616.7587ce79.js +1 -0
  7. package/__mf/js/async/1728.46efbfb8.js +1 -0
  8. package/__mf/js/async/1969.372d36b8.js +1 -0
  9. package/__mf/js/async/2043.d0fbb886.js +2 -0
  10. package/__mf/js/async/2186.e58838a5.js +38 -0
  11. package/__mf/js/async/2506.1e336b3b.js +1 -0
  12. package/__mf/js/async/3184.6b4ad42e.js +1 -0
  13. package/__mf/js/async/3499.bef2e2e5.js +1 -0
  14. package/__mf/js/async/3652.fc1e5f95.js +7 -0
  15. package/__mf/js/async/392.7cda691a.js +2 -0
  16. package/__mf/js/async/3963.5fef6ffb.js +1 -0
  17. package/__mf/js/async/3996.69a9c1dc.js +1 -0
  18. package/__mf/js/async/{1964.1d168a86.js → 4121.828d661d.js} +2 -2
  19. package/__mf/js/async/425.1ec8867f.js +1 -0
  20. package/__mf/js/async/4626.173e602a.js +1 -0
  21. package/__mf/js/async/4657.e3d53a21.js +2 -0
  22. package/__mf/js/async/4987.c12b89cb.js +1 -0
  23. package/__mf/js/async/{8930.700a5439.js → 5002.e4f54e8e.js} +1 -1
  24. package/__mf/js/async/5071.e1c33fa7.js +1 -0
  25. package/__mf/js/async/529.2303b01b.js +1 -0
  26. package/__mf/js/async/54.f6f480ef.js +22 -0
  27. package/__mf/js/async/5440.8ced5513.js +2 -0
  28. package/__mf/js/async/{6377.c40920f2.js.LICENSE.txt → 5440.8ced5513.js.LICENSE.txt} +3 -3
  29. package/__mf/js/async/{5214.0fca84ed.js → 5587.4d72fc35.js} +1 -1
  30. package/__mf/js/async/5763.4ba478ff.js +1 -0
  31. package/__mf/js/async/5922.d1619ac1.js +1 -0
  32. package/__mf/js/async/6274.478a68f8.js +2 -0
  33. package/__mf/js/async/6283.181cb622.js +2 -0
  34. package/__mf/js/async/6969.b959b6f8.js +1 -0
  35. package/__mf/js/async/{4062.06f48b93.js → 7177.205c9aaf.js} +1 -1
  36. package/__mf/js/async/7192.d835931b.js +1 -0
  37. package/__mf/js/async/7894.9c5245d7.js +1 -0
  38. package/__mf/js/async/7968.6ac0ce96.js +1 -0
  39. package/__mf/js/async/7978.9532d5b8.js +1 -0
  40. package/__mf/js/async/8356.789e1dfb.js +1 -0
  41. package/__mf/js/async/8470.9b14a625.js +2 -0
  42. package/__mf/js/async/873.448eab23.js +1 -0
  43. package/__mf/js/async/8888.59eb50a2.js +1 -0
  44. package/__mf/js/async/9010.15208552.js +2 -0
  45. package/__mf/js/async/9020.662dc353.js +1 -0
  46. package/__mf/js/async/9184.43a8d927.js +1 -0
  47. package/__mf/js/async/9235.36c3cd8c.js +1 -0
  48. package/__mf/js/async/9351.715f25c3.js +1 -0
  49. package/__mf/js/async/941.53b13124.js +2 -0
  50. package/__mf/js/async/9518.38e38a33.js +1 -0
  51. package/__mf/js/async/9588.9081c7de.js +1 -0
  52. package/__mf/js/async/9605.a92ec9c1.js +1 -0
  53. package/__mf/js/async/9836.00da6086.js +1 -0
  54. package/__mf/js/async/__federation_expose_PrometheusDatasource.caac7bfc.js +1 -0
  55. package/__mf/js/async/__federation_expose_PrometheusExplorer.22434cd0.js +1 -0
  56. package/__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.087a9360.js +1 -0
  57. package/__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.f9135d9a.js +1 -0
  58. package/__mf/js/async/__federation_expose_PrometheusPromQLVariable.d3f9f4b7.js +1 -0
  59. package/__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.95a9abcc.js +1 -0
  60. package/__mf/js/main.8eeb4292.js +6 -0
  61. package/lib/bootstrap.js +2 -2
  62. package/lib/bootstrap.js.map +1 -1
  63. package/lib/cjs/bootstrap.js +1 -1
  64. package/lib/cjs/components/PromQLEditor.js +5 -8
  65. package/lib/cjs/components/TreeNode.js +1 -1
  66. package/lib/cjs/components/index.js +1 -1
  67. package/lib/cjs/components/promql/ast.js +11 -11
  68. package/lib/cjs/components/promql/format.js +4 -4
  69. package/lib/cjs/components/promql/functionSignatures.js +1 -1
  70. package/lib/cjs/components/promql/serialize.js +1 -1
  71. package/lib/cjs/components/promql/utils.js +6 -6
  72. package/lib/cjs/components/query.js +4 -4
  73. package/lib/cjs/env.d.js +1 -1
  74. package/lib/cjs/explore/PrometheusExplorer.js +11 -7
  75. package/lib/cjs/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js +5 -5
  76. package/lib/cjs/explore/PrometheusMetricsFinder/display/MetricChip.js +1 -1
  77. package/lib/cjs/explore/PrometheusMetricsFinder/display/list/MetricList.js +4 -4
  78. package/lib/cjs/explore/PrometheusMetricsFinder/filter/FilterInputs.js +5 -5
  79. package/lib/cjs/explore/PrometheusMetricsFinder/filter/FinderFilters.js +1 -1
  80. package/lib/cjs/explore/PrometheusMetricsFinder/index.js +1 -1
  81. package/lib/cjs/explore/PrometheusMetricsFinder/overview/MetricOverview.js +4 -4
  82. package/lib/cjs/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js +5 -5
  83. package/lib/cjs/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js +5 -5
  84. package/lib/cjs/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.js +1 -1
  85. package/lib/cjs/explore/PrometheusMetricsFinder/types.js +1 -1
  86. package/lib/cjs/explore/PrometheusMetricsFinder/utils.js +6 -6
  87. package/lib/cjs/explore/index.js +12 -0
  88. package/lib/cjs/getPluginModule.js +12 -0
  89. package/lib/cjs/index-federation.js +12 -12
  90. package/lib/cjs/index.js +12 -0
  91. package/lib/cjs/model/api-types.js +1 -1
  92. package/lib/cjs/model/index.js +1 -1
  93. package/lib/cjs/model/parse-sample-values.js +4 -4
  94. package/lib/cjs/model/prometheus-client.js +30 -20
  95. package/lib/cjs/model/prometheus-selectors.js +6 -6
  96. package/lib/cjs/model/time.js +5 -5
  97. package/lib/cjs/plugins/MatcherEditor.js +1 -1
  98. package/lib/cjs/plugins/PrometheusDatasourceEditor.js +176 -3
  99. package/lib/cjs/plugins/PrometheusLabelNamesVariable.js +12 -0
  100. package/lib/cjs/plugins/PrometheusLabelValuesVariable.js +12 -0
  101. package/lib/cjs/plugins/PrometheusPromQLVariable.js +12 -0
  102. package/lib/cjs/plugins/index.js +12 -0
  103. package/lib/cjs/plugins/prometheus-datasource.js +18 -10
  104. package/lib/cjs/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js +1 -1
  105. package/lib/cjs/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js +37 -2
  106. package/lib/cjs/plugins/prometheus-time-series-query/get-time-series-data.js +1 -1
  107. package/lib/cjs/plugins/prometheus-time-series-query/index.js +1 -1
  108. package/lib/cjs/plugins/prometheus-time-series-query/query-editor-model.js +5 -5
  109. package/lib/cjs/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js +1 -1
  110. package/lib/cjs/plugins/prometheus-time-series-query/time-series-query-model.js +1 -1
  111. package/lib/cjs/plugins/prometheus-variables.js +53 -34
  112. package/lib/cjs/plugins/test/setup-tests.js +1 -1
  113. package/lib/cjs/plugins/types.js +1 -1
  114. package/lib/cjs/plugins/variable.js +1 -1
  115. package/lib/cjs/setup-tests.js +1 -1
  116. package/lib/cjs/utils/index.js +1 -1
  117. package/lib/cjs/utils/utils.js +5 -5
  118. package/lib/components/PromQLEditor.d.ts +5 -1
  119. package/lib/components/PromQLEditor.d.ts.map +1 -1
  120. package/lib/components/PromQLEditor.js +6 -9
  121. package/lib/components/PromQLEditor.js.map +1 -1
  122. package/lib/components/TreeNode.js +2 -2
  123. package/lib/components/TreeNode.js.map +1 -1
  124. package/lib/components/index.js +1 -1
  125. package/lib/components/index.js.map +1 -1
  126. package/lib/components/promql/ast.js +1 -1
  127. package/lib/components/promql/ast.js.map +1 -1
  128. package/lib/components/promql/format.js +2 -2
  129. package/lib/components/promql/format.js.map +1 -1
  130. package/lib/components/promql/functionSignatures.js +1 -1
  131. package/lib/components/promql/functionSignatures.js.map +1 -1
  132. package/lib/components/promql/serialize.js +1 -1
  133. package/lib/components/promql/serialize.js.map +1 -1
  134. package/lib/components/promql/utils.js +1 -1
  135. package/lib/components/promql/utils.js.map +1 -1
  136. package/lib/components/query.js +1 -1
  137. package/lib/components/query.js.map +1 -1
  138. package/lib/env.d.js +1 -1
  139. package/lib/env.d.js.map +1 -1
  140. package/lib/explore/PrometheusExplorer.d.ts.map +1 -1
  141. package/lib/explore/PrometheusExplorer.js +11 -7
  142. package/lib/explore/PrometheusExplorer.js.map +1 -1
  143. package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js +2 -2
  144. package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js.map +1 -1
  145. package/lib/explore/PrometheusMetricsFinder/display/MetricChip.js +2 -2
  146. package/lib/explore/PrometheusMetricsFinder/display/MetricChip.js.map +1 -1
  147. package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.js +2 -2
  148. package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.js.map +1 -1
  149. package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.js +2 -2
  150. package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.js.map +1 -1
  151. package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.js +2 -2
  152. package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.js.map +1 -1
  153. package/lib/explore/PrometheusMetricsFinder/index.js +1 -1
  154. package/lib/explore/PrometheusMetricsFinder/index.js.map +1 -1
  155. package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.js +2 -2
  156. package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.js.map +1 -1
  157. package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js +1 -1
  158. package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js.map +1 -1
  159. package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js +1 -1
  160. package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js.map +1 -1
  161. package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.js +1 -1
  162. package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.js.map +1 -1
  163. package/lib/explore/PrometheusMetricsFinder/types.js +1 -1
  164. package/lib/explore/PrometheusMetricsFinder/types.js.map +1 -1
  165. package/lib/explore/PrometheusMetricsFinder/utils.js +1 -1
  166. package/lib/explore/PrometheusMetricsFinder/utils.js.map +1 -1
  167. package/lib/explore/index.d.ts.map +1 -1
  168. package/lib/explore/index.js +12 -0
  169. package/lib/explore/index.js.map +1 -1
  170. package/lib/getPluginModule.d.ts.map +1 -1
  171. package/lib/getPluginModule.js +12 -0
  172. package/lib/getPluginModule.js.map +1 -1
  173. package/lib/index-federation.js +1 -1
  174. package/lib/index-federation.js.map +1 -1
  175. package/lib/index.d.ts.map +1 -1
  176. package/lib/index.js +12 -0
  177. package/lib/index.js.map +1 -1
  178. package/lib/model/api-types.js +1 -1
  179. package/lib/model/api-types.js.map +1 -1
  180. package/lib/model/index.js +1 -1
  181. package/lib/model/index.js.map +1 -1
  182. package/lib/model/parse-sample-values.js +1 -1
  183. package/lib/model/parse-sample-values.js.map +1 -1
  184. package/lib/model/prometheus-client.d.ts +1 -0
  185. package/lib/model/prometheus-client.d.ts.map +1 -1
  186. package/lib/model/prometheus-client.js +20 -10
  187. package/lib/model/prometheus-client.js.map +1 -1
  188. package/lib/model/prometheus-selectors.js +1 -1
  189. package/lib/model/prometheus-selectors.js.map +1 -1
  190. package/lib/model/time.js +1 -1
  191. package/lib/model/time.js.map +1 -1
  192. package/lib/plugins/MatcherEditor.js +2 -2
  193. package/lib/plugins/MatcherEditor.js.map +1 -1
  194. package/lib/plugins/PrometheusDatasourceEditor.d.ts.map +1 -1
  195. package/lib/plugins/PrometheusDatasourceEditor.js +136 -4
  196. package/lib/plugins/PrometheusDatasourceEditor.js.map +1 -1
  197. package/lib/plugins/PrometheusLabelNamesVariable.d.ts.map +1 -1
  198. package/lib/plugins/PrometheusLabelNamesVariable.js +12 -0
  199. package/lib/plugins/PrometheusLabelNamesVariable.js.map +1 -1
  200. package/lib/plugins/PrometheusLabelValuesVariable.d.ts.map +1 -1
  201. package/lib/plugins/PrometheusLabelValuesVariable.js +12 -0
  202. package/lib/plugins/PrometheusLabelValuesVariable.js.map +1 -1
  203. package/lib/plugins/PrometheusPromQLVariable.d.ts.map +1 -1
  204. package/lib/plugins/PrometheusPromQLVariable.js +12 -0
  205. package/lib/plugins/PrometheusPromQLVariable.js.map +1 -1
  206. package/lib/plugins/index.d.ts.map +1 -1
  207. package/lib/plugins/index.js +12 -0
  208. package/lib/plugins/index.js.map +1 -1
  209. package/lib/plugins/prometheus-datasource.js +18 -10
  210. package/lib/plugins/prometheus-datasource.js.map +1 -1
  211. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js +1 -1
  212. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js.map +1 -1
  213. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.d.ts.map +1 -1
  214. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js +40 -5
  215. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js.map +1 -1
  216. package/lib/plugins/prometheus-time-series-query/get-time-series-data.d.ts.map +1 -1
  217. package/lib/plugins/prometheus-time-series-query/get-time-series-data.js +1 -1
  218. package/lib/plugins/prometheus-time-series-query/get-time-series-data.js.map +1 -1
  219. package/lib/plugins/prometheus-time-series-query/index.js +1 -1
  220. package/lib/plugins/prometheus-time-series-query/index.js.map +1 -1
  221. package/lib/plugins/prometheus-time-series-query/query-editor-model.js +1 -1
  222. package/lib/plugins/prometheus-time-series-query/query-editor-model.js.map +1 -1
  223. package/lib/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js +1 -1
  224. package/lib/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js.map +1 -1
  225. package/lib/plugins/prometheus-time-series-query/time-series-query-model.js +1 -1
  226. package/lib/plugins/prometheus-time-series-query/time-series-query-model.js.map +1 -1
  227. package/lib/plugins/prometheus-variables.d.ts.map +1 -1
  228. package/lib/plugins/prometheus-variables.js +48 -29
  229. package/lib/plugins/prometheus-variables.js.map +1 -1
  230. package/lib/plugins/test/setup-tests.js +1 -1
  231. package/lib/plugins/test/setup-tests.js.map +1 -1
  232. package/lib/plugins/types.d.ts +1 -0
  233. package/lib/plugins/types.d.ts.map +1 -1
  234. package/lib/plugins/types.js +1 -1
  235. package/lib/plugins/types.js.map +1 -1
  236. package/lib/plugins/variable.js +1 -1
  237. package/lib/plugins/variable.js.map +1 -1
  238. package/lib/setup-tests.js +1 -1
  239. package/lib/setup-tests.js.map +1 -1
  240. package/lib/utils/index.js +1 -1
  241. package/lib/utils/index.js.map +1 -1
  242. package/lib/utils/utils.js +1 -1
  243. package/lib/utils/utils.js.map +1 -1
  244. package/mf-manifest.json +270 -255
  245. package/mf-stats.json +276 -259
  246. package/package.json +7 -7
  247. package/__mf/js/Prometheus.4d0d5812.js +0 -5
  248. package/__mf/js/async/1339.194207db.js +0 -1
  249. package/__mf/js/async/1441.c735f7dd.js +0 -1
  250. package/__mf/js/async/1576.8eac7ce9.js +0 -1
  251. package/__mf/js/async/212.5fcca998.js +0 -1
  252. package/__mf/js/async/2292.57d8fd0d.js +0 -2
  253. package/__mf/js/async/3224.b63f87bf.js +0 -1
  254. package/__mf/js/async/3507.f1653337.js +0 -101
  255. package/__mf/js/async/3749.3ecd9372.js +0 -1
  256. package/__mf/js/async/3863.7192dfdf.js +0 -2
  257. package/__mf/js/async/3960.3eedafbd.js +0 -2
  258. package/__mf/js/async/3980.0b0d272c.js +0 -2
  259. package/__mf/js/async/4075.dab1b7b8.js +0 -1
  260. package/__mf/js/async/4238.c48b1950.js +0 -1
  261. package/__mf/js/async/4421.1fcb466e.js +0 -1
  262. package/__mf/js/async/4535.f24704ea.js +0 -1
  263. package/__mf/js/async/4557.f3eb9456.js +0 -2
  264. package/__mf/js/async/4576.f42daf99.js +0 -1
  265. package/__mf/js/async/4665.cad36935.js +0 -1
  266. package/__mf/js/async/4676.b7a22f90.js +0 -22
  267. package/__mf/js/async/5257.ce463cb7.js +0 -1
  268. package/__mf/js/async/5409.955ffd51.js +0 -1
  269. package/__mf/js/async/5614.cce8ba96.js +0 -1
  270. package/__mf/js/async/5724.794828e3.js +0 -1
  271. package/__mf/js/async/5774.a3fae698.js +0 -1
  272. package/__mf/js/async/5790.a9b31ca8.js +0 -1
  273. package/__mf/js/async/58.1c9a8daa.js +0 -2
  274. package/__mf/js/async/5981.eb502d27.js +0 -2
  275. package/__mf/js/async/6292.2afe0c6d.js +0 -1
  276. package/__mf/js/async/6341.20eccf91.js +0 -7
  277. package/__mf/js/async/6377.c40920f2.js +0 -2
  278. package/__mf/js/async/6770.7099bb3b.js +0 -1
  279. package/__mf/js/async/684.4495f632.js +0 -1
  280. package/__mf/js/async/694.8462a746.js +0 -1
  281. package/__mf/js/async/7272.6fa2f127.js +0 -1
  282. package/__mf/js/async/7376.2e948f2b.js +0 -1
  283. package/__mf/js/async/738.a1ffff79.js +0 -1
  284. package/__mf/js/async/7740.a8777825.js +0 -1
  285. package/__mf/js/async/8045.7f554a45.js +0 -10
  286. package/__mf/js/async/8164.bb3d3363.js +0 -1
  287. package/__mf/js/async/8216.e689c178.js +0 -1
  288. package/__mf/js/async/8488.cbbe542b.js +0 -1
  289. package/__mf/js/async/8587.40df6f5c.js +0 -1
  290. package/__mf/js/async/8706.89677575.js +0 -1
  291. package/__mf/js/async/9010.bdb2ef97.js +0 -1
  292. package/__mf/js/async/9173.915b80af.js +0 -2
  293. package/__mf/js/async/9550.642ce5ad.js +0 -38
  294. package/__mf/js/async/9817.70eae424.js +0 -1
  295. package/__mf/js/async/__federation_expose_PrometheusDatasource.45ee94e2.js +0 -1
  296. package/__mf/js/async/__federation_expose_PrometheusExplorer.b8e555e1.js +0 -1
  297. package/__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.00dfb1dd.js +0 -1
  298. package/__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.956ef2d0.js +0 -1
  299. package/__mf/js/async/__federation_expose_PrometheusPromQLVariable.59f2d170.js +0 -1
  300. package/__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.d7143352.js +0 -1
  301. package/__mf/js/main.afc2ee60.js +0 -5
  302. /package/__mf/css/async/{1339.d3010b86.css → 1233.d3010b86.css} +0 -0
  303. /package/__mf/css/async/{1576.d3010b86.css → 1324.d3010b86.css} +0 -0
  304. /package/__mf/css/async/{4576.d3010b86.css → 9518.d3010b86.css} +0 -0
  305. /package/__mf/js/async/{8045.7f554a45.js.LICENSE.txt → 1605.dc180cb8.js.LICENSE.txt} +0 -0
  306. /package/__mf/js/async/{2292.57d8fd0d.js.LICENSE.txt → 2043.d0fbb886.js.LICENSE.txt} +0 -0
  307. /package/__mf/js/async/{6341.20eccf91.js.LICENSE.txt → 3652.fc1e5f95.js.LICENSE.txt} +0 -0
  308. /package/__mf/js/async/{5981.eb502d27.js.LICENSE.txt → 392.7cda691a.js.LICENSE.txt} +0 -0
  309. /package/__mf/js/async/{1964.1d168a86.js.LICENSE.txt → 4121.828d661d.js.LICENSE.txt} +0 -0
  310. /package/__mf/js/async/{58.1c9a8daa.js.LICENSE.txt → 4657.e3d53a21.js.LICENSE.txt} +0 -0
  311. /package/__mf/js/async/{4676.b7a22f90.js.LICENSE.txt → 54.f6f480ef.js.LICENSE.txt} +0 -0
  312. /package/__mf/js/async/{3960.3eedafbd.js.LICENSE.txt → 6274.478a68f8.js.LICENSE.txt} +0 -0
  313. /package/__mf/js/async/{3980.0b0d272c.js.LICENSE.txt → 6283.181cb622.js.LICENSE.txt} +0 -0
  314. /package/__mf/js/async/{9173.915b80af.js.LICENSE.txt → 8470.9b14a625.js.LICENSE.txt} +0 -0
  315. /package/__mf/js/async/{4557.f3eb9456.js.LICENSE.txt → 9010.15208552.js.LICENSE.txt} +0 -0
  316. /package/__mf/js/async/{3863.7192dfdf.js.LICENSE.txt → 941.53b13124.js.LICENSE.txt} +0 -0
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -23,15 +23,127 @@ Object.defineProperty(exports, "PrometheusDatasourceEditor", {
23
23
  const _jsxruntime = require("react/jsx-runtime");
24
24
  const _pluginsystem = require("@perses-dev/plugin-system");
25
25
  const _material = require("@mui/material");
26
- const _react = /*#__PURE__*/ _interop_require_default(require("react"));
26
+ const _Plus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Plus"));
27
+ const _Minus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Minus"));
28
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
27
29
  const _types = require("./types");
28
30
  function _interop_require_default(obj) {
29
31
  return obj && obj.__esModule ? obj : {
30
32
  default: obj
31
33
  };
32
34
  }
35
+ function _getRequireWildcardCache(nodeInterop) {
36
+ if (typeof WeakMap !== "function") return null;
37
+ var cacheBabelInterop = new WeakMap();
38
+ var cacheNodeInterop = new WeakMap();
39
+ return (_getRequireWildcardCache = function(nodeInterop) {
40
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
41
+ })(nodeInterop);
42
+ }
43
+ function _interop_require_wildcard(obj, nodeInterop) {
44
+ if (!nodeInterop && obj && obj.__esModule) {
45
+ return obj;
46
+ }
47
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
48
+ return {
49
+ default: obj
50
+ };
51
+ }
52
+ var cache = _getRequireWildcardCache(nodeInterop);
53
+ if (cache && cache.has(obj)) {
54
+ return cache.get(obj);
55
+ }
56
+ var newObj = {
57
+ __proto__: null
58
+ };
59
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
60
+ for(var key in obj){
61
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
62
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
63
+ if (desc && (desc.get || desc.set)) {
64
+ Object.defineProperty(newObj, key, desc);
65
+ } else {
66
+ newObj[key] = obj[key];
67
+ }
68
+ }
69
+ }
70
+ newObj.default = obj;
71
+ if (cache) {
72
+ cache.set(obj, newObj);
73
+ }
74
+ return newObj;
75
+ }
33
76
  function PrometheusDatasourceEditor(props) {
34
77
  const { value, onChange, isReadonly } = props;
78
+ // Counter for generating unique IDs
79
+ const nextIdRef = (0, _react.useRef)(0);
80
+ // Use local state to maintain an array of entries during editing, instead of
81
+ // manipulating a map directly which causes weird UX.
82
+ const [entries, setEntries] = (0, _react.useState)(()=>{
83
+ const queryParams = value.queryParams ?? {};
84
+ return Object.entries(queryParams).map(([key, value])=>({
85
+ id: String(nextIdRef.current++),
86
+ key,
87
+ value
88
+ }));
89
+ });
90
+ // Check for duplicate keys
91
+ const keyMap = new Map();
92
+ const duplicateKeys = new Set();
93
+ entries.forEach(({ key })=>{
94
+ if (key !== '') {
95
+ const count = (keyMap.get(key) || 0) + 1;
96
+ keyMap.set(key, count);
97
+ if (count > 1) {
98
+ duplicateKeys.add(key);
99
+ }
100
+ }
101
+ });
102
+ const hasDuplicates = duplicateKeys.size > 0;
103
+ // Convert entries array to object and trigger onChange
104
+ const syncToParent = (newEntries)=>{
105
+ const newParams = {};
106
+ newEntries.forEach(({ key, value })=>{
107
+ if (key !== '') {
108
+ newParams[key] = value;
109
+ }
110
+ });
111
+ onChange({
112
+ ...value,
113
+ queryParams: Object.keys(newParams).length > 0 ? newParams : undefined
114
+ });
115
+ };
116
+ const handleQueryParamChange = (id, field, newValue)=>{
117
+ const newEntries = entries.map((entry)=>{
118
+ if (entry.id !== id) return entry;
119
+ return field === 'key' ? {
120
+ ...entry,
121
+ key: newValue
122
+ } : {
123
+ ...entry,
124
+ value: newValue
125
+ };
126
+ });
127
+ setEntries(newEntries);
128
+ syncToParent(newEntries);
129
+ };
130
+ const addQueryParam = ()=>{
131
+ const newEntries = [
132
+ ...entries,
133
+ {
134
+ id: String(nextIdRef.current++),
135
+ key: '',
136
+ value: ''
137
+ }
138
+ ];
139
+ setEntries(newEntries);
140
+ syncToParent(newEntries);
141
+ };
142
+ const removeQueryParam = (id)=>{
143
+ const newEntries = entries.filter((entry)=>entry.id !== id);
144
+ setEntries(newEntries);
145
+ syncToParent(newEntries);
146
+ };
35
147
  const initialSpecDirect = {
36
148
  directUrl: ''
37
149
  };
@@ -82,6 +194,7 @@ function PrometheusDatasourceEditor(props) {
82
194
  children: "General Settings"
83
195
  }),
84
196
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
197
+ size: "small",
85
198
  fullWidth: true,
86
199
  label: "Scrape Interval",
87
200
  value: value.scrapeInterval || '',
@@ -95,7 +208,8 @@ function PrometheusDatasourceEditor(props) {
95
208
  onChange: (e)=>onChange({
96
209
  ...value,
97
210
  scrapeInterval: e.target.value
98
- })
211
+ }),
212
+ helperText: "Set it to match the typical scrape interval used in your Prometheus instance."
99
213
  }),
100
214
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.HTTPSettingsEditor, {
101
215
  value: value,
@@ -103,6 +217,65 @@ function PrometheusDatasourceEditor(props) {
103
217
  isReadonly: isReadonly,
104
218
  initialSpecDirect: initialSpecDirect,
105
219
  initialSpecProxy: initialSpecProxy
220
+ }),
221
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
222
+ variant: "h5",
223
+ mt: 2,
224
+ mb: 1,
225
+ children: "Query Parameters"
226
+ }),
227
+ entries.length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
228
+ children: entries.map((entry)=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
229
+ display: "flex",
230
+ alignItems: "center",
231
+ gap: 2,
232
+ mb: 1,
233
+ children: [
234
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
235
+ size: "small",
236
+ label: "Key",
237
+ value: entry.key,
238
+ placeholder: "Parameter name",
239
+ disabled: isReadonly,
240
+ onChange: (e)=>handleQueryParamChange(entry.id, 'key', e.target.value),
241
+ error: duplicateKeys.has(entry.key),
242
+ sx: {
243
+ minWidth: 150
244
+ }
245
+ }),
246
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
247
+ size: "small",
248
+ label: "Value",
249
+ value: entry.value,
250
+ placeholder: "Parameter value",
251
+ disabled: isReadonly,
252
+ onChange: (e)=>handleQueryParamChange(entry.id, 'value', e.target.value),
253
+ sx: {
254
+ minWidth: 150,
255
+ flexGrow: 1
256
+ }
257
+ }),
258
+ !isReadonly && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
259
+ onClick: ()=>removeQueryParam(entry.id),
260
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Minus.default, {})
261
+ })
262
+ ]
263
+ }, entry.id))
264
+ }),
265
+ hasDuplicates && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
266
+ variant: "body2",
267
+ color: "error",
268
+ mb: 1,
269
+ children: "Duplicate parameter keys detected. Each key must be unique."
270
+ }),
271
+ entries.length === 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
272
+ variant: "body2",
273
+ color: "textSecondary",
274
+ children: "No query parameters configured. Use query parameters to pass additional options to Prometheus (e.g., dedup=false for Thanos)."
275
+ }),
276
+ !isReadonly && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
277
+ onClick: addQueryParam,
278
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Plus.default, {})
106
279
  })
107
280
  ]
108
281
  });
@@ -1,3 +1,15 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the \"License\");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an \"AS IS\" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
1
13
  "use strict";
2
14
  Object.defineProperty(exports, "__esModule", {
3
15
  value: true
@@ -1,3 +1,15 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the \"License\");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an \"AS IS\" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
1
13
  "use strict";
2
14
  Object.defineProperty(exports, "__esModule", {
3
15
  value: true
@@ -1,3 +1,15 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the \"License\");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an \"AS IS\" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
1
13
  "use strict";
2
14
  Object.defineProperty(exports, "__esModule", {
3
15
  value: true
@@ -1,3 +1,15 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the \"License\");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an \"AS IS\" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
1
13
  "use strict";
2
14
  Object.defineProperty(exports, "__esModule", {
3
15
  value: true
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -25,7 +25,7 @@ const _PrometheusDatasourceEditor = require("./PrometheusDatasourceEditor");
25
25
  /**
26
26
  * Creates a PrometheusClient for a specific datasource spec.
27
27
  */ const createClient = (spec, options)=>{
28
- const { directUrl, proxy } = spec;
28
+ const { directUrl, proxy, queryParams } = spec;
29
29
  const { proxyUrl } = options;
30
30
  // Use the direct URL if specified, but fallback to the proxyUrl by default if not specified
31
31
  const datasourceUrl = directUrl ?? proxyUrl;
@@ -40,42 +40,50 @@ const _PrometheusDatasourceEditor = require("./PrometheusDatasourceEditor");
40
40
  },
41
41
  healthCheck: (0, _model.healthCheck)({
42
42
  datasourceUrl,
43
- headers: specHeaders
43
+ headers: specHeaders,
44
+ queryParams
44
45
  }),
45
46
  instantQuery: (params, headers, abortSignal)=>(0, _model.instantQuery)(params, {
46
47
  datasourceUrl,
47
48
  headers: headers ?? specHeaders,
48
- abortSignal
49
+ abortSignal,
50
+ queryParams
49
51
  }),
50
52
  rangeQuery: (params, headers, abortSignal)=>(0, _model.rangeQuery)(params, {
51
53
  datasourceUrl,
52
54
  headers: headers ?? specHeaders,
53
- abortSignal
55
+ abortSignal,
56
+ queryParams
54
57
  }),
55
58
  labelNames: (params, headers, abortSignal)=>(0, _model.labelNames)(params, {
56
59
  datasourceUrl,
57
60
  headers: headers ?? specHeaders,
58
- abortSignal
61
+ abortSignal,
62
+ queryParams
59
63
  }),
60
64
  labelValues: (params, headers, abortSignal)=>(0, _model.labelValues)(params, {
61
65
  datasourceUrl,
62
66
  headers: headers ?? specHeaders,
63
- abortSignal
67
+ abortSignal,
68
+ queryParams
64
69
  }),
65
70
  metricMetadata: (params, headers, abortSignal)=>(0, _model.metricMetadata)(params, {
66
71
  datasourceUrl,
67
72
  headers: headers ?? specHeaders,
68
- abortSignal
73
+ abortSignal,
74
+ queryParams
69
75
  }),
70
76
  series: (params, headers, abortSignal)=>(0, _model.series)(params, {
71
77
  datasourceUrl,
72
78
  headers: headers ?? specHeaders,
73
- abortSignal
79
+ abortSignal,
80
+ queryParams
74
81
  }),
75
82
  parseQuery: (params, headers, abortSignal)=>(0, _model.parseQuery)(params, {
76
83
  datasourceUrl,
77
84
  headers: headers ?? specHeaders,
78
- abortSignal
85
+ abortSignal,
86
+ queryParams
79
87
  })
80
88
  };
81
89
  };
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -25,6 +25,8 @@ const _immer = require("immer");
25
25
  const _pluginsystem = require("@perses-dev/plugin-system");
26
26
  const _components = require("@perses-dev/components");
27
27
  const _material = require("@mui/material");
28
+ const _react = require("react");
29
+ const _dashboards = require("@perses-dev/dashboards");
28
30
  const _model = require("../../model");
29
31
  const _types = require("../types");
30
32
  const _components1 = require("../../components");
@@ -55,6 +57,38 @@ function PrometheusTimeSeriesQueryEditor(props) {
55
57
  }
56
58
  throw new Error('Got unexpected non-Prometheus datasource selector');
57
59
  };
60
+ const variableState = (0, _pluginsystem.useAllVariableValues)();
61
+ const { absoluteTimeRange } = (0, _pluginsystem.useTimeRange)();
62
+ const panelEditorContext = (0, _react.useContext)(_dashboards.PanelEditorContext);
63
+ const suggestedStepMs = (0, _pluginsystem.useSuggestedStepMs)(panelEditorContext?.preview.previewPanelWidth);
64
+ const minStepMs = (0, _react.useMemo)(()=>{
65
+ /* Try catch is necessary, because when the minStep value is being typed, it will be valid when the duration unit is added. Example: 2m = 2 + m */ try {
66
+ const durationsSeconds = (0, _model.getDurationStringSeconds)((0, _pluginsystem.replaceVariables)(minStepPlaceholder, variableState));
67
+ return durationsSeconds !== undefined ? durationsSeconds * 1000 : undefined;
68
+ } catch {
69
+ return undefined;
70
+ }
71
+ }, [
72
+ variableState,
73
+ minStepPlaceholder
74
+ ]);
75
+ const intervalMs = (0, _react.useMemo)(()=>{
76
+ const minStepSeconds = (minStepMs ?? 0) / 1000;
77
+ return (0, _model.getRangeStep)((0, _model.getPrometheusTimeRange)(absoluteTimeRange), minStepSeconds, undefined, suggestedStepMs) * 1000;
78
+ }, [
79
+ absoluteTimeRange,
80
+ minStepMs,
81
+ suggestedStepMs
82
+ ]);
83
+ const treeViewMetadata = (0, _react.useMemo)(()=>{
84
+ return minStepMs && intervalMs ? {
85
+ minStepMs,
86
+ intervalMs
87
+ } : undefined;
88
+ }, [
89
+ minStepMs,
90
+ intervalMs
91
+ ]);
58
92
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
59
93
  spacing: 2,
60
94
  children: [
@@ -81,7 +115,8 @@ function PrometheusTimeSeriesQueryEditor(props) {
81
115
  datasource: selectedDatasource,
82
116
  onChange: handleQueryChange,
83
117
  onBlur: handleQueryBlur,
84
- isReadOnly: isReadonly
118
+ isReadOnly: isReadonly,
119
+ treeViewMetadata: treeViewMetadata
85
120
  }),
86
121
  /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
87
122
  direction: "row",
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -17,17 +17,17 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- useFormatState: function() {
24
+ get useFormatState () {
25
25
  return useFormatState;
26
26
  },
27
- useMinStepState: function() {
27
+ get useMinStepState () {
28
28
  return useMinStepState;
29
29
  },
30
- useQueryState: function() {
30
+ get useQueryState () {
31
31
  return useQueryState;
32
32
  }
33
33
  });
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -17,26 +17,26 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- PrometheusLabelNamesVariableEditor: function() {
24
+ get PrometheusLabelNamesVariableEditor () {
25
25
  return PrometheusLabelNamesVariableEditor;
26
26
  },
27
- PrometheusLabelValuesVariableEditor: function() {
27
+ get PrometheusLabelValuesVariableEditor () {
28
28
  return PrometheusLabelValuesVariableEditor;
29
29
  },
30
- PrometheusPromQLVariableEditor: function() {
30
+ get PrometheusPromQLVariableEditor () {
31
31
  return PrometheusPromQLVariableEditor;
32
32
  },
33
- capturingMatrix: function() {
33
+ get capturingMatrix () {
34
34
  return capturingMatrix;
35
35
  },
36
- capturingVector: function() {
36
+ get capturingVector () {
37
37
  return capturingVector;
38
38
  },
39
- stringArrayToVariableOptions: function() {
39
+ get stringArrayToVariableOptions () {
40
40
  return stringArrayToVariableOptions;
41
41
  }
42
42
  });
@@ -51,8 +51,6 @@ const _MatcherEditor = require("./MatcherEditor");
51
51
  function PrometheusLabelValuesVariableEditor(props) {
52
52
  const { onChange, value, value: { datasource } } = props;
53
53
  const selectedDatasource = datasource ?? _model.DEFAULT_PROM;
54
- const [labelValue, setLabelValue] = (0, _react.useState)(props.value.labelName);
55
- const [matchersValues, setMatchersValues] = (0, _react.useState)(props.value.matchers ?? []);
56
54
  const handleDatasourceChange = (0, _react.useCallback)((next)=>{
57
55
  if ((0, _pluginsystem.isVariableDatasource)(next) || (0, _model.isPrometheusDatasourceSelector)(next)) {
58
56
  onChange((0, _immer.produce)(value, (draft)=>{
@@ -67,11 +65,21 @@ function PrometheusLabelValuesVariableEditor(props) {
67
65
  value
68
66
  ]);
69
67
  const handleLabelChange = (0, _react.useCallback)((e)=>{
70
- setLabelValue(e.target.value);
71
- }, []);
72
- const handleMatchEditorsChange = (0, _react.useCallback)((e)=>{
73
- setMatchersValues(e);
74
- }, []);
68
+ onChange((0, _immer.produce)(value, (draft)=>{
69
+ draft.labelName = e.target.value;
70
+ }));
71
+ }, [
72
+ onChange,
73
+ value
74
+ ]);
75
+ const handleMatchEditorsChange = (0, _react.useCallback)((matchers)=>{
76
+ onChange((0, _immer.produce)(value, (draft)=>{
77
+ draft.matchers = matchers;
78
+ }));
79
+ }, [
80
+ onChange,
81
+ value
82
+ ]);
75
83
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
76
84
  spacing: 2,
77
85
  children: [
@@ -89,14 +97,16 @@ function PrometheusLabelValuesVariableEditor(props) {
89
97
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
90
98
  label: "Label Name",
91
99
  required: true,
92
- value: labelValue,
100
+ value: props.value.labelName,
93
101
  onChange: handleLabelChange,
94
- InputProps: {
95
- readOnly: props.isReadonly
102
+ slotProps: {
103
+ input: {
104
+ readOnly: props.isReadonly
105
+ }
96
106
  }
97
107
  }),
98
108
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_MatcherEditor.MatcherEditor, {
99
- matchers: matchersValues,
109
+ matchers: props.value.matchers ?? [],
100
110
  onChange: handleMatchEditorsChange,
101
111
  isReadonly: props.isReadonly
102
112
  })
@@ -106,7 +116,6 @@ function PrometheusLabelValuesVariableEditor(props) {
106
116
  function PrometheusLabelNamesVariableEditor(props) {
107
117
  const { onChange, value, value: { datasource } } = props;
108
118
  const selectedDatasource = datasource ?? _model.DEFAULT_PROM;
109
- const [matchersValues, setMatchersValues] = (0, _react.useState)(props.value.matchers ?? []);
110
119
  const handleDatasourceChange = (0, _react.useCallback)((next)=>{
111
120
  if ((0, _pluginsystem.isVariableDatasource)(next) || (0, _model.isPrometheusDatasourceSelector)(next)) {
112
121
  onChange((0, _immer.produce)(value, (draft)=>{
@@ -120,9 +129,14 @@ function PrometheusLabelNamesVariableEditor(props) {
120
129
  onChange,
121
130
  value
122
131
  ]);
123
- const handleMatchEditorChange = (0, _react.useCallback)((e)=>{
124
- setMatchersValues(e);
125
- }, []);
132
+ const handleMatchEditorChange = (0, _react.useCallback)((matchers)=>{
133
+ onChange((0, _immer.produce)(value, (draft)=>{
134
+ draft.matchers = matchers;
135
+ }));
136
+ }, [
137
+ onChange,
138
+ value
139
+ ]);
126
140
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
127
141
  spacing: 2,
128
142
  children: [
@@ -138,7 +152,7 @@ function PrometheusLabelNamesVariableEditor(props) {
138
152
  })
139
153
  }),
140
154
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_MatcherEditor.MatcherEditor, {
141
- matchers: matchersValues,
155
+ matchers: props.value.matchers ?? [],
142
156
  isReadonly: props.isReadonly,
143
157
  onChange: handleMatchEditorChange
144
158
  })
@@ -151,7 +165,6 @@ function PrometheusPromQLVariableEditor(props) {
151
165
  const selectedDatasource = (0, _pluginsystem.useDatasourceSelectValueToSelector)(datasourceSelectValue, _model.PROM_DATASOURCE_KIND);
152
166
  const { data: client } = (0, _pluginsystem.useDatasourceClient)(selectedDatasource);
153
167
  const promURL = client?.options.datasourceUrl;
154
- const [labelValue, setLabelValue] = (0, _react.useState)(props.value.labelName);
155
168
  const handleDatasourceChange = (0, _react.useCallback)((next)=>{
156
169
  if ((0, _pluginsystem.isVariableDatasource)(next) || (0, _model.isPrometheusDatasourceSelector)(next)) {
157
170
  onChange((0, _immer.produce)(value, (draft)=>{
@@ -166,17 +179,21 @@ function PrometheusPromQLVariableEditor(props) {
166
179
  onChange
167
180
  ]);
168
181
  const handleOnBlurPromQlChange = (0, _react.useCallback)((e)=>{
169
- onChange({
170
- ...value,
171
- expr: e.target.textContent ?? ''
172
- });
182
+ onChange((0, _immer.produce)(value, (draft)=>{
183
+ draft.expr = e.target.textContent ?? '';
184
+ }));
173
185
  }, [
174
186
  onChange,
175
187
  value
176
188
  ]);
177
189
  const handleLabelNameChange = (0, _react.useCallback)((e)=>{
178
- setLabelValue(e.target.value);
179
- }, []);
190
+ onChange((0, _immer.produce)(value, (draft)=>{
191
+ draft.labelName = e.target.value;
192
+ }));
193
+ }, [
194
+ onChange,
195
+ value
196
+ ]);
180
197
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
181
198
  spacing: 2,
182
199
  children: [
@@ -206,9 +223,11 @@ function PrometheusPromQLVariableEditor(props) {
206
223
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
207
224
  label: "Label Name",
208
225
  required: true,
209
- value: labelValue,
210
- InputProps: {
211
- readOnly: props.isReadonly
226
+ value: props.value.labelName,
227
+ slotProps: {
228
+ input: {
229
+ readOnly: props.isReadonly
230
+ }
212
231
  },
213
232
  onChange: handleLabelNameChange
214
233
  })