@perses-dev/dashboards 0.0.0-snapshot-time-range-height-80d08fc

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 (372) hide show
  1. package/LICENSE +201 -0
  2. package/dist/cjs/components/Dashboard/Dashboard.js +37 -0
  3. package/dist/cjs/components/Dashboard/index.js +28 -0
  4. package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +176 -0
  5. package/dist/cjs/components/DashboardToolbar/index.js +28 -0
  6. package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +92 -0
  7. package/dist/cjs/components/DeletePanelDialog/index.js +28 -0
  8. package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +88 -0
  9. package/dist/cjs/components/DeletePanelGroupDialog/index.js +28 -0
  10. package/dist/cjs/components/DownloadButton/DownloadButton.js +109 -0
  11. package/dist/cjs/components/DownloadButton/index.js +28 -0
  12. package/dist/cjs/components/GridLayout/GridContainer.js +219 -0
  13. package/dist/cjs/components/GridLayout/GridItemContent.js +41 -0
  14. package/dist/cjs/components/GridLayout/GridLayout.js +104 -0
  15. package/dist/cjs/components/GridLayout/GridTitle.js +100 -0
  16. package/dist/cjs/components/GridLayout/index.js +29 -0
  17. package/dist/cjs/components/Panel/Panel.js +123 -0
  18. package/dist/cjs/components/Panel/Panel.test.js +129 -0
  19. package/dist/cjs/components/Panel/PanelContent.js +44 -0
  20. package/dist/cjs/components/Panel/PanelHeader.js +120 -0
  21. package/dist/cjs/components/Panel/index.js +28 -0
  22. package/dist/cjs/components/PanelDrawer/PanelDrawer.js +98 -0
  23. package/dist/cjs/components/PanelDrawer/PanelDrawer.test.js +131 -0
  24. package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +202 -0
  25. package/dist/cjs/components/PanelDrawer/PanelPreview.js +47 -0
  26. package/dist/cjs/components/PanelDrawer/index.js +28 -0
  27. package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +101 -0
  28. package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.test.js +87 -0
  29. package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +92 -0
  30. package/dist/cjs/components/PanelGroupDialog/index.js +28 -0
  31. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +136 -0
  32. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.test.js +95 -0
  33. package/dist/cjs/components/TimeRangeControls/index.js +28 -0
  34. package/dist/cjs/components/UnsavedChangesConfirmationDialog/UnsavedChangesConfirmationDialog.js +67 -0
  35. package/dist/cjs/components/UnsavedChangesConfirmationDialog/index.js +28 -0
  36. package/dist/cjs/components/Variables/Variable.js +194 -0
  37. package/dist/cjs/components/Variables/VariableEditor.js +276 -0
  38. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +459 -0
  39. package/dist/cjs/components/Variables/VariableEditorForm/index.js +28 -0
  40. package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +89 -0
  41. package/dist/cjs/components/Variables/VariableList.js +150 -0
  42. package/dist/cjs/components/Variables/index.js +30 -0
  43. package/dist/cjs/components/Variables/variable-model.js +117 -0
  44. package/dist/cjs/components/Variables/variable-model.test.js +106 -0
  45. package/dist/cjs/components/index.js +39 -0
  46. package/dist/cjs/context/DashboardProvider/DashboardProvider.js +95 -0
  47. package/dist/cjs/context/DashboardProvider/common.js +28 -0
  48. package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +191 -0
  49. package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +70 -0
  50. package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +85 -0
  51. package/dist/cjs/context/DashboardProvider/index.js +29 -0
  52. package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +205 -0
  53. package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +85 -0
  54. package/dist/cjs/context/DashboardProvider/panel-group-slice.js +113 -0
  55. package/dist/cjs/context/DashboardProvider/panel-slice.js +25 -0
  56. package/dist/cjs/context/DatasourceStoreProvider.js +170 -0
  57. package/dist/cjs/context/TemplateVariableProvider/TemplateVariableProvider.js +228 -0
  58. package/dist/cjs/context/TemplateVariableProvider/index.js +28 -0
  59. package/dist/cjs/context/TemplateVariableProvider/query-params.js +81 -0
  60. package/dist/cjs/context/TemplateVariableProvider/query-params.test.js +82 -0
  61. package/dist/cjs/context/index.js +31 -0
  62. package/dist/cjs/context/useDashboard.js +94 -0
  63. package/dist/cjs/index.js +30 -0
  64. package/dist/cjs/test/dashboard-provider.js +51 -0
  65. package/dist/cjs/test/index.js +30 -0
  66. package/dist/cjs/test/plugin-registry.js +42 -0
  67. package/dist/cjs/test/render.js +62 -0
  68. package/dist/cjs/test/setup-tests.js +23 -0
  69. package/dist/cjs/test/testDashboard.js +293 -0
  70. package/dist/cjs/utils/functions.js +23 -0
  71. package/dist/cjs/views/ViewDashboard/DashboardApp.js +96 -0
  72. package/dist/cjs/views/ViewDashboard/ViewDashboard.js +68 -0
  73. package/dist/cjs/views/ViewDashboard/index.js +28 -0
  74. package/dist/cjs/views/ViewDashboard/tests/panelGroups.test.js +110 -0
  75. package/dist/cjs/views/index.js +28 -0
  76. package/dist/components/Dashboard/Dashboard.d.ts +8 -0
  77. package/dist/components/Dashboard/Dashboard.d.ts.map +1 -0
  78. package/dist/components/Dashboard/Dashboard.js +33 -0
  79. package/dist/components/Dashboard/Dashboard.js.map +1 -0
  80. package/dist/components/Dashboard/index.d.ts +2 -0
  81. package/dist/components/Dashboard/index.d.ts.map +1 -0
  82. package/dist/components/Dashboard/index.js +15 -0
  83. package/dist/components/Dashboard/index.js.map +1 -0
  84. package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +11 -0
  85. package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -0
  86. package/dist/components/DashboardToolbar/DashboardToolbar.js +165 -0
  87. package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -0
  88. package/dist/components/DashboardToolbar/index.d.ts +2 -0
  89. package/dist/components/DashboardToolbar/index.d.ts.map +1 -0
  90. package/dist/components/DashboardToolbar/index.js +15 -0
  91. package/dist/components/DashboardToolbar/index.js.map +1 -0
  92. package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts +3 -0
  93. package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts.map +1 -0
  94. package/dist/components/DeletePanelDialog/DeletePanelDialog.js +81 -0
  95. package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -0
  96. package/dist/components/DeletePanelDialog/index.d.ts +2 -0
  97. package/dist/components/DeletePanelDialog/index.d.ts.map +1 -0
  98. package/dist/components/DeletePanelDialog/index.js +15 -0
  99. package/dist/components/DeletePanelDialog/index.js.map +1 -0
  100. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts +3 -0
  101. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -0
  102. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +77 -0
  103. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -0
  104. package/dist/components/DeletePanelGroupDialog/index.d.ts +2 -0
  105. package/dist/components/DeletePanelGroupDialog/index.d.ts.map +1 -0
  106. package/dist/components/DeletePanelGroupDialog/index.js +15 -0
  107. package/dist/components/DeletePanelGroupDialog/index.js.map +1 -0
  108. package/dist/components/DownloadButton/DownloadButton.d.ts +3 -0
  109. package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -0
  110. package/dist/components/DownloadButton/DownloadButton.js +60 -0
  111. package/dist/components/DownloadButton/DownloadButton.js.map +1 -0
  112. package/dist/components/DownloadButton/index.d.ts +2 -0
  113. package/dist/components/DownloadButton/index.d.ts.map +1 -0
  114. package/dist/components/DownloadButton/index.js +15 -0
  115. package/dist/components/DownloadButton/index.js.map +1 -0
  116. package/dist/components/GridLayout/GridContainer.d.ts +6 -0
  117. package/dist/components/GridLayout/GridContainer.d.ts.map +1 -0
  118. package/dist/components/GridLayout/GridContainer.js +213 -0
  119. package/dist/components/GridLayout/GridContainer.js.map +1 -0
  120. package/dist/components/GridLayout/GridItemContent.d.ts +10 -0
  121. package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -0
  122. package/dist/components/GridLayout/GridItemContent.js +37 -0
  123. package/dist/components/GridLayout/GridItemContent.js.map +1 -0
  124. package/dist/components/GridLayout/GridLayout.d.ts +10 -0
  125. package/dist/components/GridLayout/GridLayout.d.ts.map +1 -0
  126. package/dist/components/GridLayout/GridLayout.js +100 -0
  127. package/dist/components/GridLayout/GridLayout.js.map +1 -0
  128. package/dist/components/GridLayout/GridTitle.d.ts +16 -0
  129. package/dist/components/GridLayout/GridTitle.d.ts.map +1 -0
  130. package/dist/components/GridLayout/GridTitle.js +92 -0
  131. package/dist/components/GridLayout/GridTitle.js.map +1 -0
  132. package/dist/components/GridLayout/index.d.ts +3 -0
  133. package/dist/components/GridLayout/index.d.ts.map +1 -0
  134. package/dist/components/GridLayout/index.js +16 -0
  135. package/dist/components/GridLayout/index.js.map +1 -0
  136. package/dist/components/Panel/Panel.d.ts +13 -0
  137. package/dist/components/Panel/Panel.d.ts.map +1 -0
  138. package/dist/components/Panel/Panel.js +114 -0
  139. package/dist/components/Panel/Panel.js.map +1 -0
  140. package/dist/components/Panel/Panel.test.d.ts +2 -0
  141. package/dist/components/Panel/Panel.test.d.ts.map +1 -0
  142. package/dist/components/Panel/Panel.test.js +122 -0
  143. package/dist/components/Panel/Panel.test.js.map +1 -0
  144. package/dist/components/Panel/PanelContent.d.ts +12 -0
  145. package/dist/components/Panel/PanelContent.d.ts.map +1 -0
  146. package/dist/components/Panel/PanelContent.js +41 -0
  147. package/dist/components/Panel/PanelContent.js.map +1 -0
  148. package/dist/components/Panel/PanelHeader.d.ts +16 -0
  149. package/dist/components/Panel/PanelHeader.d.ts.map +1 -0
  150. package/dist/components/Panel/PanelHeader.js +109 -0
  151. package/dist/components/Panel/PanelHeader.js.map +1 -0
  152. package/dist/components/Panel/index.d.ts +2 -0
  153. package/dist/components/Panel/index.d.ts.map +1 -0
  154. package/dist/components/Panel/index.js +15 -0
  155. package/dist/components/Panel/index.js.map +1 -0
  156. package/dist/components/PanelDrawer/PanelDrawer.d.ts +6 -0
  157. package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -0
  158. package/dist/components/PanelDrawer/PanelDrawer.js +94 -0
  159. package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -0
  160. package/dist/components/PanelDrawer/PanelDrawer.test.d.ts +2 -0
  161. package/dist/components/PanelDrawer/PanelDrawer.test.d.ts.map +1 -0
  162. package/dist/components/PanelDrawer/PanelDrawer.test.js +124 -0
  163. package/dist/components/PanelDrawer/PanelDrawer.test.js.map +1 -0
  164. package/dist/components/PanelDrawer/PanelEditorForm.d.ts +12 -0
  165. package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -0
  166. package/dist/components/PanelDrawer/PanelEditorForm.js +192 -0
  167. package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -0
  168. package/dist/components/PanelDrawer/PanelPreview.d.ts +4 -0
  169. package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -0
  170. package/dist/components/PanelDrawer/PanelPreview.js +41 -0
  171. package/dist/components/PanelDrawer/PanelPreview.js.map +1 -0
  172. package/dist/components/PanelDrawer/index.d.ts +2 -0
  173. package/dist/components/PanelDrawer/index.d.ts.map +1 -0
  174. package/dist/components/PanelDrawer/index.js +15 -0
  175. package/dist/components/PanelDrawer/index.js.map +1 -0
  176. package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts +6 -0
  177. package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -0
  178. package/dist/components/PanelGroupDialog/PanelGroupDialog.js +92 -0
  179. package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -0
  180. package/dist/components/PanelGroupDialog/PanelGroupDialog.test.d.ts +2 -0
  181. package/dist/components/PanelGroupDialog/PanelGroupDialog.test.d.ts.map +1 -0
  182. package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js +80 -0
  183. package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js.map +1 -0
  184. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts +12 -0
  185. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts.map +1 -0
  186. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js +82 -0
  187. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -0
  188. package/dist/components/PanelGroupDialog/index.d.ts +2 -0
  189. package/dist/components/PanelGroupDialog/index.d.ts.map +1 -0
  190. package/dist/components/PanelGroupDialog/index.js +15 -0
  191. package/dist/components/PanelGroupDialog/index.js.map +1 -0
  192. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +9 -0
  193. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -0
  194. package/dist/components/TimeRangeControls/TimeRangeControls.js +119 -0
  195. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -0
  196. package/dist/components/TimeRangeControls/TimeRangeControls.test.d.ts +2 -0
  197. package/dist/components/TimeRangeControls/TimeRangeControls.test.d.ts.map +1 -0
  198. package/dist/components/TimeRangeControls/TimeRangeControls.test.js +88 -0
  199. package/dist/components/TimeRangeControls/TimeRangeControls.test.js.map +1 -0
  200. package/dist/components/TimeRangeControls/index.d.ts +2 -0
  201. package/dist/components/TimeRangeControls/index.d.ts.map +1 -0
  202. package/dist/components/TimeRangeControls/index.js +15 -0
  203. package/dist/components/TimeRangeControls/index.js.map +1 -0
  204. package/dist/components/UnsavedChangesConfirmationDialog/UnsavedChangesConfirmationDialog.d.ts +8 -0
  205. package/dist/components/UnsavedChangesConfirmationDialog/UnsavedChangesConfirmationDialog.d.ts.map +1 -0
  206. package/dist/components/UnsavedChangesConfirmationDialog/UnsavedChangesConfirmationDialog.js +56 -0
  207. package/dist/components/UnsavedChangesConfirmationDialog/UnsavedChangesConfirmationDialog.js.map +1 -0
  208. package/dist/components/UnsavedChangesConfirmationDialog/index.d.ts +2 -0
  209. package/dist/components/UnsavedChangesConfirmationDialog/index.d.ts.map +1 -0
  210. package/dist/components/UnsavedChangesConfirmationDialog/index.js +15 -0
  211. package/dist/components/UnsavedChangesConfirmationDialog/index.js.map +1 -0
  212. package/dist/components/Variables/Variable.d.ts +8 -0
  213. package/dist/components/Variables/Variable.d.ts.map +1 -0
  214. package/dist/components/Variables/Variable.js +188 -0
  215. package/dist/components/Variables/Variable.js.map +1 -0
  216. package/dist/components/Variables/VariableEditor.d.ts +8 -0
  217. package/dist/components/Variables/VariableEditor.d.ts.map +1 -0
  218. package/dist/components/Variables/VariableEditor.js +265 -0
  219. package/dist/components/Variables/VariableEditor.js.map +1 -0
  220. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +8 -0
  221. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -0
  222. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +409 -0
  223. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -0
  224. package/dist/components/Variables/VariableEditorForm/index.d.ts +2 -0
  225. package/dist/components/Variables/VariableEditorForm/index.d.ts.map +1 -0
  226. package/dist/components/Variables/VariableEditorForm/index.js +15 -0
  227. package/dist/components/Variables/VariableEditorForm/index.js.map +1 -0
  228. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +22 -0
  229. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -0
  230. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +77 -0
  231. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -0
  232. package/dist/components/Variables/VariableList.d.ts +9 -0
  233. package/dist/components/Variables/VariableList.d.ts.map +1 -0
  234. package/dist/components/Variables/VariableList.js +100 -0
  235. package/dist/components/Variables/VariableList.js.map +1 -0
  236. package/dist/components/Variables/index.d.ts +4 -0
  237. package/dist/components/Variables/index.d.ts.map +1 -0
  238. package/dist/components/Variables/index.js +17 -0
  239. package/dist/components/Variables/index.js.map +1 -0
  240. package/dist/components/Variables/variable-model.d.ts +16 -0
  241. package/dist/components/Variables/variable-model.d.ts.map +1 -0
  242. package/dist/components/Variables/variable-model.js +105 -0
  243. package/dist/components/Variables/variable-model.js.map +1 -0
  244. package/dist/components/Variables/variable-model.test.d.ts +2 -0
  245. package/dist/components/Variables/variable-model.test.d.ts.map +1 -0
  246. package/dist/components/Variables/variable-model.test.js +104 -0
  247. package/dist/components/Variables/variable-model.test.js.map +1 -0
  248. package/dist/components/index.d.ts +13 -0
  249. package/dist/components/index.d.ts.map +1 -0
  250. package/dist/components/index.js +26 -0
  251. package/dist/components/index.js.map +1 -0
  252. package/dist/context/DashboardProvider/DashboardProvider.d.ts +28 -0
  253. package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -0
  254. package/dist/context/DashboardProvider/DashboardProvider.js +77 -0
  255. package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -0
  256. package/dist/context/DashboardProvider/common.d.ts +12 -0
  257. package/dist/context/DashboardProvider/common.d.ts.map +1 -0
  258. package/dist/context/DashboardProvider/common.js +24 -0
  259. package/dist/context/DashboardProvider/common.js.map +1 -0
  260. package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +74 -0
  261. package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -0
  262. package/dist/context/DashboardProvider/dashboard-provider-api.js +190 -0
  263. package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -0
  264. package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts +23 -0
  265. package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts.map +1 -0
  266. package/dist/context/DashboardProvider/delete-panel-group-slice.js +64 -0
  267. package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -0
  268. package/dist/context/DashboardProvider/delete-panel-slice.d.ts +36 -0
  269. package/dist/context/DashboardProvider/delete-panel-slice.d.ts.map +1 -0
  270. package/dist/context/DashboardProvider/delete-panel-slice.js +81 -0
  271. package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -0
  272. package/dist/context/DashboardProvider/index.d.ts +7 -0
  273. package/dist/context/DashboardProvider/index.d.ts.map +1 -0
  274. package/dist/context/DashboardProvider/index.js +16 -0
  275. package/dist/context/DashboardProvider/index.js.map +1 -0
  276. package/dist/context/DashboardProvider/panel-editor-slice.d.ts +56 -0
  277. package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -0
  278. package/dist/context/DashboardProvider/panel-editor-slice.js +201 -0
  279. package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -0
  280. package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts +33 -0
  281. package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts.map +1 -0
  282. package/dist/context/DashboardProvider/panel-group-editor-slice.js +79 -0
  283. package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -0
  284. package/dist/context/DashboardProvider/panel-group-slice.d.ts +59 -0
  285. package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -0
  286. package/dist/context/DashboardProvider/panel-group-slice.js +105 -0
  287. package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -0
  288. package/dist/context/DashboardProvider/panel-slice.d.ts +14 -0
  289. package/dist/context/DashboardProvider/panel-slice.d.ts.map +1 -0
  290. package/dist/context/DashboardProvider/panel-slice.js +21 -0
  291. package/dist/context/DashboardProvider/panel-slice.js.map +1 -0
  292. package/dist/context/DatasourceStoreProvider.d.ts +24 -0
  293. package/dist/context/DatasourceStoreProvider.d.ts.map +1 -0
  294. package/dist/context/DatasourceStoreProvider.js +166 -0
  295. package/dist/context/DatasourceStoreProvider.js.map +1 -0
  296. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +30 -0
  297. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +1 -0
  298. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +212 -0
  299. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +1 -0
  300. package/dist/context/TemplateVariableProvider/index.d.ts +2 -0
  301. package/dist/context/TemplateVariableProvider/index.d.ts.map +1 -0
  302. package/dist/context/TemplateVariableProvider/index.js +15 -0
  303. package/dist/context/TemplateVariableProvider/index.js.map +1 -0
  304. package/dist/context/TemplateVariableProvider/query-params.d.ts +12 -0
  305. package/dist/context/TemplateVariableProvider/query-params.d.ts.map +1 -0
  306. package/dist/context/TemplateVariableProvider/query-params.js +66 -0
  307. package/dist/context/TemplateVariableProvider/query-params.js.map +1 -0
  308. package/dist/context/TemplateVariableProvider/query-params.test.d.ts +2 -0
  309. package/dist/context/TemplateVariableProvider/query-params.test.d.ts.map +1 -0
  310. package/dist/context/TemplateVariableProvider/query-params.test.js +80 -0
  311. package/dist/context/TemplateVariableProvider/query-params.test.js.map +1 -0
  312. package/dist/context/index.d.ts +5 -0
  313. package/dist/context/index.d.ts.map +1 -0
  314. package/dist/context/index.js +18 -0
  315. package/dist/context/index.js.map +1 -0
  316. package/dist/context/useDashboard.d.ts +6 -0
  317. package/dist/context/useDashboard.d.ts.map +1 -0
  318. package/dist/context/useDashboard.js +88 -0
  319. package/dist/context/useDashboard.js.map +1 -0
  320. package/dist/index.d.ts +4 -0
  321. package/dist/index.d.ts.map +1 -0
  322. package/dist/index.js +17 -0
  323. package/dist/index.js.map +1 -0
  324. package/dist/test/dashboard-provider.d.ts +19 -0
  325. package/dist/test/dashboard-provider.d.ts.map +1 -0
  326. package/dist/test/dashboard-provider.js +40 -0
  327. package/dist/test/dashboard-provider.js.map +1 -0
  328. package/dist/test/index.d.ts +4 -0
  329. package/dist/test/index.d.ts.map +1 -0
  330. package/dist/test/index.js +17 -0
  331. package/dist/test/index.js.map +1 -0
  332. package/dist/test/plugin-registry.d.ts +3 -0
  333. package/dist/test/plugin-registry.d.ts.map +1 -0
  334. package/dist/test/plugin-registry.js +37 -0
  335. package/dist/test/plugin-registry.js.map +1 -0
  336. package/dist/test/render.d.ts +8 -0
  337. package/dist/test/render.d.ts.map +1 -0
  338. package/dist/test/render.js +58 -0
  339. package/dist/test/render.js.map +1 -0
  340. package/dist/test/setup-tests.d.ts +2 -0
  341. package/dist/test/setup-tests.d.ts.map +1 -0
  342. package/dist/test/setup-tests.js +22 -0
  343. package/dist/test/setup-tests.js.map +1 -0
  344. package/dist/test/testDashboard.d.ts +4 -0
  345. package/dist/test/testDashboard.d.ts.map +1 -0
  346. package/dist/test/testDashboard.js +287 -0
  347. package/dist/test/testDashboard.js.map +1 -0
  348. package/dist/utils/functions.d.ts +2 -0
  349. package/dist/utils/functions.d.ts.map +1 -0
  350. package/dist/utils/functions.js +17 -0
  351. package/dist/utils/functions.js.map +1 -0
  352. package/dist/views/ViewDashboard/DashboardApp.d.ts +10 -0
  353. package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -0
  354. package/dist/views/ViewDashboard/DashboardApp.js +90 -0
  355. package/dist/views/ViewDashboard/DashboardApp.js.map +1 -0
  356. package/dist/views/ViewDashboard/ViewDashboard.d.ts +16 -0
  357. package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -0
  358. package/dist/views/ViewDashboard/ViewDashboard.js +64 -0
  359. package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -0
  360. package/dist/views/ViewDashboard/index.d.ts +2 -0
  361. package/dist/views/ViewDashboard/index.d.ts.map +1 -0
  362. package/dist/views/ViewDashboard/index.js +15 -0
  363. package/dist/views/ViewDashboard/index.js.map +1 -0
  364. package/dist/views/ViewDashboard/tests/panelGroups.test.d.ts +2 -0
  365. package/dist/views/ViewDashboard/tests/panelGroups.test.d.ts.map +1 -0
  366. package/dist/views/ViewDashboard/tests/panelGroups.test.js +103 -0
  367. package/dist/views/ViewDashboard/tests/panelGroups.test.js.map +1 -0
  368. package/dist/views/index.d.ts +2 -0
  369. package/dist/views/index.d.ts.map +1 -0
  370. package/dist/views/index.js +15 -0
  371. package/dist/views/index.js.map +1 -0
  372. package/package.json +57 -0
@@ -0,0 +1,100 @@
1
+ // Copyright 2022 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.
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import React, { useState } from 'react';
15
+ import { Button, Stack, Box, AppBar, useScrollTrigger, IconButton } from '@mui/material';
16
+ import PencilIcon from 'mdi-material-ui/Pencil';
17
+ import PinOutline from 'mdi-material-ui/PinOutline';
18
+ import PinOffOutline from 'mdi-material-ui/PinOffOutline';
19
+ import { Drawer } from '@perses-dev/components';
20
+ import { useTemplateVariableDefinitions, useEditMode, useTemplateVariableActions } from '../../context';
21
+ import { TemplateVariable } from './Variable';
22
+ import { VariableEditor } from './VariableEditor';
23
+ export function TemplateVariableList(props) {
24
+ const [isEditing, setIsEditing] = useState(false);
25
+ const [isPin, setIsPin] = useState(props.initialVariableIsSticky);
26
+ const variableDefinitions = useTemplateVariableDefinitions();
27
+ const { isEditMode } = useEditMode();
28
+ const { setVariableDefinitions } = useTemplateVariableActions();
29
+ const scrollTrigger = useScrollTrigger({
30
+ disableHysteresis: true
31
+ });
32
+ const isSticky = scrollTrigger && props.initialVariableIsSticky && isPin;
33
+ const onClose = ()=>{
34
+ setIsEditing(false);
35
+ };
36
+ return /*#__PURE__*/ _jsxs(Box, {
37
+ children: [
38
+ /*#__PURE__*/ _jsx(Drawer, {
39
+ isOpen: isEditing,
40
+ onClose: onClose,
41
+ PaperProps: {
42
+ sx: {
43
+ width: '50%'
44
+ }
45
+ },
46
+ children: /*#__PURE__*/ _jsx(VariableEditor, {
47
+ variableDefinitions: variableDefinitions,
48
+ onCancel: onClose,
49
+ onChange: (v)=>{
50
+ setVariableDefinitions(v);
51
+ setIsEditing(false);
52
+ }
53
+ })
54
+ }),
55
+ isEditMode && /*#__PURE__*/ _jsx(Box, {
56
+ pb: 2,
57
+ children: /*#__PURE__*/ _jsx(Button, {
58
+ onClick: ()=>setIsEditing(true),
59
+ startIcon: /*#__PURE__*/ _jsx(PencilIcon, {}),
60
+ children: "Edit Variables"
61
+ })
62
+ }),
63
+ /*#__PURE__*/ _jsx(AppBar, {
64
+ color: 'inherit',
65
+ position: isSticky ? 'fixed' : 'static',
66
+ elevation: isSticky ? 4 : 0,
67
+ sx: {
68
+ ...props.sx
69
+ },
70
+ children: /*#__PURE__*/ _jsxs(Box, {
71
+ display: 'flex',
72
+ justifyContent: "space-between",
73
+ my: isSticky ? 2 : 0,
74
+ ml: isSticky ? 2 : 0,
75
+ children: [
76
+ /*#__PURE__*/ _jsx(Stack, {
77
+ direction: "row",
78
+ spacing: 1,
79
+ children: isEditMode && variableDefinitions.map((v)=>{
80
+ var ref;
81
+ /*#__PURE__*/ return _jsx(Box, {
82
+ display: ((ref = v.spec.display) === null || ref === void 0 ? void 0 : ref.hidden) ? 'none' : undefined,
83
+ children: /*#__PURE__*/ _jsx(TemplateVariable, {
84
+ name: v.spec.name
85
+ }, v.spec.name)
86
+ }, v.spec.name);
87
+ })
88
+ }),
89
+ props.initialVariableIsSticky && /*#__PURE__*/ _jsx(IconButton, {
90
+ onClick: ()=>setIsPin(!isPin),
91
+ children: isPin ? /*#__PURE__*/ _jsx(PinOutline, {}) : /*#__PURE__*/ _jsx(PinOffOutline, {})
92
+ })
93
+ ]
94
+ })
95
+ })
96
+ ]
97
+ });
98
+ }
99
+
100
+ //# sourceMappingURL=VariableList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Variables/VariableList.tsx"],"sourcesContent":["// Copyright 2022 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 React, { useState } from 'react';\nimport { Button, Stack, Box, AppBar, useScrollTrigger, IconButton, SxProps, Theme } from '@mui/material';\nimport PencilIcon from 'mdi-material-ui/Pencil';\nimport PinOutline from 'mdi-material-ui/PinOutline';\nimport PinOffOutline from 'mdi-material-ui/PinOffOutline';\nimport { Drawer } from '@perses-dev/components';\nimport { useTemplateVariableDefinitions, useEditMode, useTemplateVariableActions } from '../../context';\nimport { TemplateVariable } from './Variable';\nimport { VariableEditor } from './VariableEditor';\n\ninterface TemplateVariableListProps {\n initialVariableIsSticky?: boolean;\n sx?: SxProps<Theme>;\n}\n\nexport function TemplateVariableList(props: TemplateVariableListProps) {\n const [isEditing, setIsEditing] = useState(false);\n const [isPin, setIsPin] = useState(props.initialVariableIsSticky);\n const variableDefinitions = useTemplateVariableDefinitions();\n const { isEditMode } = useEditMode();\n const { setVariableDefinitions } = useTemplateVariableActions();\n const scrollTrigger = useScrollTrigger({ disableHysteresis: true });\n const isSticky = scrollTrigger && props.initialVariableIsSticky && isPin;\n\n const onClose = () => {\n setIsEditing(false);\n };\n\n return (\n <Box>\n <Drawer isOpen={isEditing} onClose={onClose} PaperProps={{ sx: { width: '50%' } }}>\n <VariableEditor\n variableDefinitions={variableDefinitions}\n onCancel={onClose}\n onChange={(v) => {\n setVariableDefinitions(v);\n setIsEditing(false);\n }}\n />\n </Drawer>\n {isEditMode && (\n <Box pb={2}>\n <Button onClick={() => setIsEditing(true)} startIcon={<PencilIcon />}>\n Edit Variables\n </Button>\n </Box>\n )}\n\n <AppBar\n color={'inherit'}\n position={isSticky ? 'fixed' : 'static'}\n elevation={isSticky ? 4 : 0}\n sx={{ ...props.sx }}\n >\n <Box display={'flex'} justifyContent=\"space-between\" my={isSticky ? 2 : 0} ml={isSticky ? 2 : 0}>\n <Stack direction=\"row\" spacing={1}>\n {isEditMode &&\n variableDefinitions.map((v) => (\n <Box key={v.spec.name} display={v.spec.display?.hidden ? 'none' : undefined}>\n <TemplateVariable key={v.spec.name} name={v.spec.name} />\n </Box>\n ))}\n </Stack>\n {props.initialVariableIsSticky && (\n <IconButton onClick={() => setIsPin(!isPin)}>{isPin ? <PinOutline /> : <PinOffOutline />}</IconButton>\n )}\n </Box>\n </AppBar>\n </Box>\n );\n}\n"],"names":["React","useState","Button","Stack","Box","AppBar","useScrollTrigger","IconButton","PencilIcon","PinOutline","PinOffOutline","Drawer","useTemplateVariableDefinitions","useEditMode","useTemplateVariableActions","TemplateVariable","VariableEditor","TemplateVariableList","props","isEditing","setIsEditing","isPin","setIsPin","initialVariableIsSticky","variableDefinitions","isEditMode","setVariableDefinitions","scrollTrigger","disableHysteresis","isSticky","onClose","isOpen","PaperProps","sx","width","onCancel","onChange","v","pb","onClick","startIcon","color","position","elevation","display","justifyContent","my","ml","direction","spacing","map","spec","hidden","undefined","name"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO,CAAC;AACxC,SAASC,MAAM,EAAEC,KAAK,EAAEC,GAAG,EAAEC,MAAM,EAAEC,gBAAgB,EAAEC,UAAU,QAAwB,eAAe,CAAC;AACzG,OAAOC,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAOC,UAAU,MAAM,4BAA4B,CAAC;AACpD,OAAOC,aAAa,MAAM,+BAA+B,CAAC;AAC1D,SAASC,MAAM,QAAQ,wBAAwB,CAAC;AAChD,SAASC,8BAA8B,EAAEC,WAAW,EAAEC,0BAA0B,QAAQ,e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K,CAAC;sCAAGA,KAAK,iBAAG,KAACZ,UAAU,KAAG,iBAAG,KAACC,aAAa,KAAG;0BAAc,AACvG;;kBACG;cACC;;MACL,CACN;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './Variable';
2
+ export * from './VariableList';
3
+ export * from './VariableEditorForm';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Variables/index.tsx"],"names":[],"mappings":"AAaA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,17 @@
1
+ // Copyright 2022 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.
13
+ export * from './Variable';
14
+ export * from './VariableList';
15
+ export * from './VariableEditorForm';
16
+
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Variables/index.tsx"],"sourcesContent":["// Copyright 2022 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 './Variable';\nexport * from './VariableList';\nexport * from './VariableEditorForm';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { ListVariableDefinition } from '@perses-dev/core';
2
+ import { VariableOption, VariableStateMap } from '@perses-dev/plugin-system';
3
+ export declare function filterVariableList(data: VariableOption[], capturedRegexp: RegExp): VariableOption[];
4
+ export declare function useListVariablePluginValues(definition: ListVariableDefinition): import("@tanstack/react-query").UseQueryResult<VariableOption[], unknown>;
5
+ /**
6
+ * Returns a serialized string of the current state of variable values.
7
+ */
8
+ export declare function getVariableValuesKey(v: VariableStateMap): string;
9
+ export declare const VARIABLE_TYPES: readonly [{
10
+ readonly label: "List";
11
+ readonly kind: "ListVariable";
12
+ }, {
13
+ readonly label: "Text";
14
+ readonly kind: "TextVariable";
15
+ }];
16
+ //# sourceMappingURL=variable-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variable-model.d.ts","sourceRoot":"","sources":["../../../src/components/Variables/variable-model.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAKL,cAAc,EACd,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAGnC,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,cAAc,EAAE,EAAE,cAAc,EAAE,MAAM,GAAG,cAAc,EAAE,CAqBnG;AAED,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,sBAAsB,6EAyC7E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,gBAAgB,UAIvD;AAED,eAAO,MAAM,cAAc;;;;;;EAGjB,CAAC"}
@@ -0,0 +1,105 @@
1
+ // Copyright 2022 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.
13
+ import { useDatasourceStore, usePlugin, useTemplateVariableValues, useTimeRange } from '@perses-dev/plugin-system';
14
+ import { useQuery } from '@tanstack/react-query';
15
+ export function filterVariableList(data, capturedRegexp) {
16
+ const result = [];
17
+ const filteredSet = new Set();
18
+ for (const variableValue of data){
19
+ const matches = variableValue.value.matchAll(capturedRegexp);
20
+ let concat = '';
21
+ for (const match of matches){
22
+ for(let i = 1; i < match.length; i++){
23
+ const m = match[i];
24
+ if (m !== undefined) {
25
+ concat = `${concat}${m}`;
26
+ }
27
+ }
28
+ }
29
+ if (concat !== '' && !filteredSet.has(concat)) {
30
+ // like that we are avoiding to have duplicating variable value
31
+ filteredSet.add(concat);
32
+ result.push({
33
+ label: variableValue.label,
34
+ value: concat
35
+ });
36
+ }
37
+ }
38
+ return result;
39
+ }
40
+ export function useListVariablePluginValues(definition) {
41
+ const { data: variablePlugin } = usePlugin('Variable', definition.spec.plugin.kind);
42
+ const datasourceStore = useDatasourceStore();
43
+ const allVariables = useTemplateVariableValues();
44
+ const { absoluteTimeRange: timeRange , refreshKey } = useTimeRange();
45
+ const variablePluginCtx = {
46
+ timeRange,
47
+ datasourceStore,
48
+ variables: allVariables
49
+ };
50
+ const spec = definition.spec.plugin.spec;
51
+ const capturingRegexp = definition.spec.capturing_regexp !== undefined ? new RegExp(definition.spec.capturing_regexp, 'g') : undefined;
52
+ let dependsOnVariables;
53
+ if (variablePlugin === null || variablePlugin === void 0 ? void 0 : variablePlugin.dependsOn) {
54
+ const dependencies = variablePlugin.dependsOn(spec, variablePluginCtx);
55
+ dependsOnVariables = dependencies.variables;
56
+ }
57
+ const variables = useTemplateVariableValues(dependsOnVariables);
58
+ let waitToLoad = false;
59
+ if (dependsOnVariables) {
60
+ waitToLoad = dependsOnVariables.some((v)=>{
61
+ var ref;
62
+ return (ref = variables[v]) === null || ref === void 0 ? void 0 : ref.loading;
63
+ });
64
+ }
65
+ const variablesValueKey = getVariableValuesKey(variables);
66
+ return useQuery([
67
+ name,
68
+ definition,
69
+ variablesValueKey,
70
+ timeRange,
71
+ refreshKey
72
+ ], async ()=>{
73
+ const resp = await (variablePlugin === null || variablePlugin === void 0 ? void 0 : variablePlugin.getVariableOptions(spec, {
74
+ datasourceStore,
75
+ variables,
76
+ timeRange
77
+ }));
78
+ if (resp === undefined) {
79
+ return [];
80
+ }
81
+ if (capturingRegexp === undefined) {
82
+ return resp.data;
83
+ }
84
+ return filterVariableList(resp.data, capturingRegexp);
85
+ }, {
86
+ enabled: !!variablePlugin || waitToLoad
87
+ });
88
+ }
89
+ /**
90
+ * Returns a serialized string of the current state of variable values.
91
+ */ export function getVariableValuesKey(v) {
92
+ return Object.values(v).map((v)=>JSON.stringify(v.value)).join(',');
93
+ }
94
+ export const VARIABLE_TYPES = [
95
+ {
96
+ label: 'List',
97
+ kind: 'ListVariable'
98
+ },
99
+ {
100
+ label: 'Text',
101
+ kind: 'TextVariable'
102
+ }
103
+ ];
104
+
105
+ //# sourceMappingURL=variable-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Variables/variable-model.ts"],"sourcesContent":["// Copyright 2022 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 { ListVariableDefinition } from '@perses-dev/core';\nimport {\n useDatasourceStore,\n usePlugin,\n useTemplateVariableValues,\n useTimeRange,\n VariableOption,\n VariableStateMap,\n} from '@perses-dev/plugin-system';\nimport { useQuery } from '@tanstack/react-query';\n\nexport function filterVariableList(data: VariableOption[], capturedRegexp: RegExp): VariableOption[] {\n const result: VariableOption[] = [];\n const filteredSet = new Set<string>();\n for (const variableValue of data) {\n const matches = variableValue.value.matchAll(capturedRegexp);\n let concat = '';\n for (const match of matches) {\n for (let i = 1; i < match.length; i++) {\n const m = match[i];\n if (m !== undefined) {\n concat = `${concat}${m}`;\n }\n }\n }\n if (concat !== '' && !filteredSet.has(concat)) {\n // like that we are avoiding to have duplicating variable value\n filteredSet.add(concat);\n result.push({ label: variableValue.label, value: concat });\n }\n }\n return result;\n}\n\nexport function useListVariablePluginValues(definition: ListVariableDefinition) {\n const { data: variablePlugin } = usePlugin('Variable', definition.spec.plugin.kind);\n const datasourceStore = useDatasourceStore();\n const allVariables = useTemplateVariableValues();\n const { absoluteTimeRange: timeRange, refreshKey } = useTimeRange();\n\n const variablePluginCtx = { timeRange, datasourceStore, variables: allVariables };\n\n const spec = definition.spec.plugin.spec;\n const capturingRegexp =\n definition.spec.capturing_regexp !== undefined ? new RegExp(definition.spec.capturing_regexp, 'g') : undefined;\n\n let dependsOnVariables: string[] | undefined;\n if (variablePlugin?.dependsOn) {\n const dependencies = variablePlugin.dependsOn(spec, variablePluginCtx);\n dependsOnVariables = dependencies.variables;\n }\n\n const variables = useTemplateVariableValues(dependsOnVariables);\n\n let waitToLoad = false;\n if (dependsOnVariables) {\n waitToLoad = dependsOnVariables.some((v) => variables[v]?.loading);\n }\n\n const variablesValueKey = getVariableValuesKey(variables);\n\n return useQuery(\n [name, definition, variablesValueKey, timeRange, refreshKey],\n async () => {\n const resp = await variablePlugin?.getVariableOptions(spec, { datasourceStore, variables, timeRange });\n if (resp === undefined) {\n return [];\n }\n if (capturingRegexp === undefined) {\n return resp.data;\n }\n return filterVariableList(resp.data, capturingRegexp);\n },\n { enabled: !!variablePlugin || waitToLoad }\n );\n}\n\n/**\n * Returns a serialized string of the current state of variable values.\n */\nexport function getVariableValuesKey(v: VariableStateMap) {\n return Object.values(v)\n .map((v) => JSON.stringify(v.value))\n .join(',');\n}\n\nexport const VARIABLE_TYPES = [\n { label: 'List', kind: 'ListVariable' },\n { label: 'Text', kind: 'TextVariable' },\n] as const;\n"],"names":["useDatasourceStore","usePlugin","useTemplateVariableValues","useTimeRange","useQuery","filterVariableList","data","capturedRegexp","result","filteredSet","Set","variableValue","matches","value","matchAll","concat","match","i","length","m","undefined","has","add","push","label","useListVariablePluginValues","definition","variablePlugin","spec","plugin","kind","datasourceStore","allVariables","absoluteTimeRange","timeRange","refreshKey","variablePluginCtx","variables","capturingRegexp","capturing_regexp","RegExp","dependsOnVariables","dependsOn","dependencies","waitToLoad","some","v","loading","variablesValueKey","getVariableValuesKey","name","resp","getVariableOptions","enabled","Object","values","map","JSON","stringify","join","VARIABLE_TYPES"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SACEA,kBAAkB,EAClBC,SAAS,EACTC,yBAAyB,EACzBC,YAAY,QAGP,2BAA2B,CAAC;AACnC,SAASC,QAAQ,QAAQ,uBAAuB,CAAC;AAEjD,OAAO,SAASC,kBAAkB,CAACC,IAAsB,EAAEC,cAAsB,EAAoB;IACnG,MAAMC,MAAM,GAAqB,EAAE,AAAC;IACpC,MAAMC,WAAW,GAAG,IAAIC,GAAG,EAAU,AAAC;IACtC,KAAK,MAAMC,aAAa,IAAIL,IAAI,CAAE;QAChC,MAAMM,OAAO,GAAGD,aAAa,CAACE,KAAK,CAACC,QAAQ,CAACP,cAAc,CAAC,AAAC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,CAAA,AAAC;QACvG,IAAIiB,IAAI,KAAK/B,SAAS,EAAE;YACtB,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,IAAIkB,eAAe,KAAKlB,SAAS,EAAE;YACjC,OAAO+B,IAAI,CAAC7C,IAAI,CAAC;QACnB,CAAC;QACD,OAAOD,kBAAkB,CAAC8C,IAAI,CAAC7C,IAAI,EAAEgC,eAAe,CAAC,CAAC;IACxD,CAAC,EACD;QAAEe,OAAO,EAAE,CAAC,CAAC1B,cAAc,IAAIiB,UAAU;KAAE,CAC5C,CAAC;AACJ,CAAC;AAED;;CAEC,GACD,OAAO,SAASK,oBAAoB,CAACH,CAAmB,EAAE;IACxD,OAAOQ,MAAM,CAACC,MAAM,CAACT,CAAC,CAAC,CACpBU,GAAG,CAAC,CAACV,CAAC,GAAKW,IAAI,CAACC,SAAS,CAACZ,CAAC,CAACjC,KAAK,CAAC,CAAC,CACnC8C,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED,OAAO,MAAMC,cAAc,GAAG;IAC5B;QAAEpC,KAAK,EAAE,MAAM;QAAEM,IAAI,EAAE,cAAc;KAAE;IACvC;QAAEN,KAAK,EAAE,MAAM;QAAEM,IAAI,EAAE,cAAc;KAAE;CACxC,AAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=variable-model.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variable-model.test.d.ts","sourceRoot":"","sources":["../../../src/components/Variables/variable-model.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,104 @@
1
+ // Copyright 2022 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.
13
+ import { filterVariableList } from './variable-model';
14
+ describe('filterVariableList', ()=>{
15
+ const testSuite = [
16
+ {
17
+ title: 'basic case',
18
+ capturing_regexp: /([^-]*)-host-([^-]*)/g,
19
+ originalValues: [
20
+ {
21
+ label: 'l1',
22
+ value: 'us1-host-ahdix'
23
+ },
24
+ {
25
+ label: 'l2',
26
+ value: 'us1-host-diua'
27
+ },
28
+ {
29
+ label: 'l3',
30
+ value: 'eu1-host-adf'
31
+ },
32
+ {
33
+ label: 'l4',
34
+ value: 'bar'
35
+ }
36
+ ],
37
+ result: [
38
+ {
39
+ label: 'l1',
40
+ value: 'us1ahdix'
41
+ },
42
+ {
43
+ label: 'l2',
44
+ value: 'us1diua'
45
+ },
46
+ {
47
+ label: 'l3',
48
+ value: 'eu1adf'
49
+ }
50
+ ]
51
+ },
52
+ {
53
+ title: 'duplicate captured value',
54
+ capturing_regexp: /prometheus-(.+):\d+/g,
55
+ originalValues: [
56
+ {
57
+ label: 'l1',
58
+ value: 'prometheus-app:9090'
59
+ },
60
+ {
61
+ label: 'l2',
62
+ value: 'prometheus-app:9091'
63
+ },
64
+ {
65
+ label: 'l3',
66
+ value: 'prometheus-platform:9091'
67
+ },
68
+ {
69
+ label: 'l4',
70
+ value: 'prometheus-database:9091'
71
+ },
72
+ {
73
+ label: 'l5',
74
+ value: 'prometheus-perses:9091'
75
+ }
76
+ ],
77
+ result: [
78
+ {
79
+ label: 'l1',
80
+ value: 'app'
81
+ },
82
+ {
83
+ label: 'l3',
84
+ value: 'platform'
85
+ },
86
+ {
87
+ label: 'l4',
88
+ value: 'database'
89
+ },
90
+ {
91
+ label: 'l5',
92
+ value: 'perses'
93
+ }
94
+ ]
95
+ }
96
+ ];
97
+ testSuite.forEach(({ title , capturing_regexp , originalValues , result })=>{
98
+ it(title, ()=>{
99
+ expect(filterVariableList(originalValues, capturing_regexp)).toEqual(result);
100
+ });
101
+ });
102
+ });
103
+
104
+ //# sourceMappingURL=variable-model.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Variables/variable-model.test.ts"],"sourcesContent":["// Copyright 2022 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 { VariableOption } from '@perses-dev/plugin-system';\nimport { filterVariableList } from './variable-model';\n\ndescribe('filterVariableList', () => {\n const testSuite = [\n {\n title: 'basic case',\n capturing_regexp: /([^-]*)-host-([^-]*)/g,\n originalValues: [\n { label: 'l1', value: 'us1-host-ahdix' },\n { label: 'l2', value: 'us1-host-diua' },\n { label: 'l3', value: 'eu1-host-adf' },\n { label: 'l4', value: 'bar' },\n ] as VariableOption[],\n result: [\n { label: 'l1', value: 'us1ahdix' },\n { label: 'l2', value: 'us1diua' },\n { label: 'l3', value: 'eu1adf' },\n ],\n },\n {\n title: 'duplicate captured value',\n capturing_regexp: /prometheus-(.+):\\d+/g,\n originalValues: [\n { label: 'l1', value: 'prometheus-app:9090' },\n { label: 'l2', value: 'prometheus-app:9091' },\n { label: 'l3', value: 'prometheus-platform:9091' },\n { label: 'l4', value: 'prometheus-database:9091' },\n { label: 'l5', value: 'prometheus-perses:9091' },\n ] as VariableOption[],\n result: [\n { label: 'l1', value: 'app' },\n { label: 'l3', value: 'platform' },\n { label: 'l4', value: 'database' },\n { label: 'l5', value: 'perses' },\n ],\n },\n ];\n testSuite.forEach(({ title, capturing_regexp, originalValues, result }) => {\n it(title, () => {\n expect(filterVariableList(originalValues, capturing_regexp)).toEqual(result);\n });\n });\n});\n"],"names":["filterVariableList","describe","testSuite","title","capturing_regexp","originalValues","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B;iBAAE;gBAClD;oBAAED,KAAK,EAAE,IAAI;oBAAEC,KAAK,EAAE,wBAAwB;iBAAE;aACjD;YACDC,MAAM,EAAE;gBACN;oBAAEF,KAAK,EAAE,IAAI;oBAAEC,KAAK,EAAE,KAAK;iBAAE;gBAC7B;oBAAED,KAAK,EAAE,IAAI;oBAAEC,KAAK,EAAE,UAAU;iBAAE;gBAClC;oBAAED,KAAK,EAAE,IAAI;oBAAEC,KAAK,EAAE,UAAU;iBAAE;gBAClC;oBAAED,KAAK,EAAE,IAAI;oBAAEC,KAAK,EAAE,QAAQ;iBAAE;aACjC;SACF;KACF,AAAC;IACFL,SAAS,CAACO,OAAO,CAAC,CAAC,EAAEN,KAAK,CAAA,EAAEC,gBAAgB,CAAA,EAAEC,cAAc,CAAA,EAAEG,MAAM,CAAA,EAAE,GAAK;QACzEE,EAAE,CAACP,KAAK,EAAE,IAAM;YACdQ,MAAM,CAACX,kBAAkB,CAACK,cAAc,EAAED,gBAAgB,CAAC,CAAC,CAACQ,OAAO,CAACJ,MAAM,CAAC,CAAC;QAC/E,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ export * from './Dashboard';
2
+ export * from './DashboardToolbar';
3
+ export * from './DeletePanelDialog';
4
+ export * from './DeletePanelGroupDialog';
5
+ export * from './DownloadButton';
6
+ export * from './GridLayout';
7
+ export * from './Panel';
8
+ export * from './PanelDrawer';
9
+ export * from './PanelGroupDialog';
10
+ export * from './TimeRangeControls';
11
+ export * from './UnsavedChangesConfirmationDialog';
12
+ export * from './Variables';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAaA,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,aAAa,CAAC"}
@@ -0,0 +1,26 @@
1
+ // Copyright 2022 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.
13
+ export * from './Dashboard';
14
+ export * from './DashboardToolbar';
15
+ export * from './DeletePanelDialog';
16
+ export * from './DeletePanelGroupDialog';
17
+ export * from './DownloadButton';
18
+ export * from './GridLayout';
19
+ export * from './Panel';
20
+ export * from './PanelDrawer';
21
+ export * from './PanelGroupDialog';
22
+ export * from './TimeRangeControls';
23
+ export * from './UnsavedChangesConfirmationDialog';
24
+ export * from './Variables';
25
+
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/index.ts"],"sourcesContent":["// Copyright 2022 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 './Dashboard';\nexport * from './DashboardToolbar';\nexport * from './DeletePanelDialog';\nexport * from './DeletePanelGroupDialog';\nexport * from './DownloadButton';\nexport * from './GridLayout';\nexport * from './Panel';\nexport * from './PanelDrawer';\nexport * from './PanelGroupDialog';\nexport * from './TimeRangeControls';\nexport * from './UnsavedChangesConfirmationDialog';\nexport * from './Variables';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,aAAa,CAAC"}
@@ -0,0 +1,28 @@
1
+ /// <reference types="react" />
2
+ import type { StoreApi } from 'zustand';
3
+ import { DashboardResource, ProjectMetadata, RelativeTimeRange } from '@perses-dev/core';
4
+ import { PanelGroupEditorSlice } from './panel-group-editor-slice';
5
+ import { PanelGroupSlice } from './panel-group-slice';
6
+ import { PanelEditorSlice } from './panel-editor-slice';
7
+ import { PanelSlice } from './panel-slice';
8
+ import { DeletePanelGroupSlice } from './delete-panel-group-slice';
9
+ import { DeletePanelSlice } from './delete-panel-slice';
10
+ export interface DashboardStoreState extends PanelGroupSlice, PanelSlice, PanelGroupEditorSlice, DeletePanelGroupSlice, PanelEditorSlice, DeletePanelSlice {
11
+ isEditMode: boolean;
12
+ setEditMode: (isEditMode: boolean) => void;
13
+ defaultTimeRange: RelativeTimeRange;
14
+ setDashboard: (dashboard: DashboardResource) => void;
15
+ metadata: ProjectMetadata;
16
+ }
17
+ export interface DashboardStoreProps {
18
+ dashboardResource: DashboardResource;
19
+ isEditMode?: boolean;
20
+ }
21
+ export interface DashboardProviderProps {
22
+ initialState: DashboardStoreProps;
23
+ children?: React.ReactNode;
24
+ }
25
+ export declare const DashboardContext: import("react").Context<StoreApi<DashboardStoreState> | undefined>;
26
+ export declare function useDashboardStore<T>(selector: (state: DashboardStoreState) => T): T;
27
+ export declare function DashboardProvider(props: DashboardProviderProps): JSX.Element;
28
+ //# sourceMappingURL=DashboardProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DashboardProvider.d.ts","sourceRoot":"","sources":["../../../src/context/DashboardProvider/DashboardProvider.tsx"],"names":[],"mappings":";AAcA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAKxC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAA+B,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,EAAsD,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC1G,OAAO,EAA0B,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAoB,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAA+B,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,EAA0B,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEhF,MAAM,WAAW,mBACf,SAAQ,eAAe,EACrB,UAAU,EACV,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,gBAAgB,EAAE,iBAAiB,CAAC;IACpC,YAAY,EAAE,CAAC,SAAS,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACrD,QAAQ,EAAE,eAAe,CAAC;CAC3B;AAED,MAAM,WAAW,mBAAmB;IAClC,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,mBAAmB,CAAC;IAClC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,gBAAgB,oEAAsE,CAAC;AAEpG,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,CAAC,KAM/E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,eAU9D"}
@@ -0,0 +1,77 @@
1
+ // Copyright 2022 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.
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { createStore, useStore } from 'zustand';
15
+ import { devtools } from 'zustand/middleware';
16
+ import { immer } from 'zustand/middleware/immer';
17
+ import shallow from 'zustand/shallow';
18
+ import { createContext, useCallback, useContext, useState } from 'react';
19
+ import { createPanelGroupEditorSlice } from './panel-group-editor-slice';
20
+ import { convertLayoutsToPanelGroups, createPanelGroupSlice } from './panel-group-slice';
21
+ import { createPanelEditorSlice } from './panel-editor-slice';
22
+ import { createPanelSlice } from './panel-slice';
23
+ import { createDeletePanelGroupSlice } from './delete-panel-group-slice';
24
+ import { createDeletePanelSlice } from './delete-panel-slice';
25
+ export const DashboardContext = /*#__PURE__*/ createContext(undefined);
26
+ export function useDashboardStore(selector) {
27
+ const store = useContext(DashboardContext);
28
+ if (store === undefined) {
29
+ throw new Error('No DashboardContext found. Did you forget a Provider?');
30
+ }
31
+ return useStore(store, selector, shallow);
32
+ }
33
+ export function DashboardProvider(props) {
34
+ const createDashboardStore = useCallback(initStore, [
35
+ props
36
+ ]);
37
+ const [store] = useState(createDashboardStore(props)); // prevent calling createDashboardStore every time it rerenders
38
+ return /*#__PURE__*/ _jsx(DashboardContext.Provider, {
39
+ value: store,
40
+ children: props.children
41
+ });
42
+ }
43
+ function initStore(props) {
44
+ const { initialState: { dashboardResource , isEditMode } , } = props;
45
+ const { spec: { layouts , panels , duration } , metadata , } = dashboardResource;
46
+ const store = createStore()(immer(devtools((...args)=>{
47
+ const [set] = args;
48
+ return {
49
+ ...createPanelGroupSlice(layouts)(...args),
50
+ ...createPanelSlice(panels)(...args),
51
+ ...createPanelGroupEditorSlice(...args),
52
+ ...createDeletePanelGroupSlice(...args),
53
+ ...createPanelEditorSlice()(...args),
54
+ ...createDeletePanelSlice()(...args),
55
+ metadata,
56
+ defaultTimeRange: {
57
+ pastDuration: duration
58
+ },
59
+ isEditMode: !!isEditMode,
60
+ setEditMode: (isEditMode)=>set({
61
+ isEditMode
62
+ }),
63
+ setDashboard: ({ metadata , spec: { panels , layouts } })=>{
64
+ set((state)=>{
65
+ state.metadata = metadata;
66
+ const { panelGroups , panelGroupOrder } = convertLayoutsToPanelGroups(layouts);
67
+ state.panels = panels;
68
+ state.panelGroups = panelGroups;
69
+ state.panelGroupOrder = panelGroupOrder;
70
+ });
71
+ }
72
+ };
73
+ })));
74
+ return store;
75
+ }
76
+
77
+ //# sourceMappingURL=DashboardProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/context/DashboardProvider/DashboardProvider.tsx"],"sourcesContent":["// Copyright 2022 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 { createStore, useStore } from 'zustand';\nimport type { StoreApi } from 'zustand';\nimport { devtools } from 'zustand/middleware';\nimport { immer } from 'zustand/middleware/immer';\nimport shallow from 'zustand/shallow';\nimport { createContext, useCallback, useContext, useState } from 'react';\nimport { DashboardResource, ProjectMetadata, RelativeTimeRange } from '@perses-dev/core';\nimport { createPanelGroupEditorSlice, PanelGroupEditorSlice } from './panel-group-editor-slice';\nimport { convertLayoutsToPanelGroups, createPanelGroupSlice, PanelGroupSlice } from './panel-group-slice';\nimport { createPanelEditorSlice, PanelEditorSlice } from './panel-editor-slice';\nimport { createPanelSlice, PanelSlice } from './panel-slice';\nimport { createDeletePanelGroupSlice, DeletePanelGroupSlice } from './delete-panel-group-slice';\nimport { createDeletePanelSlice, DeletePanelSlice } from './delete-panel-slice';\n\nexport interface DashboardStoreState\n extends PanelGroupSlice,\n PanelSlice,\n PanelGroupEditorSlice,\n DeletePanelGroupSlice,\n PanelEditorSlice,\n DeletePanelSlice {\n isEditMode: boolean;\n setEditMode: (isEditMode: boolean) => void;\n defaultTimeRange: RelativeTimeRange;\n setDashboard: (dashboard: DashboardResource) => void;\n metadata: ProjectMetadata;\n}\n\nexport interface DashboardStoreProps {\n dashboardResource: DashboardResource;\n isEditMode?: boolean;\n}\n\nexport interface DashboardProviderProps {\n initialState: DashboardStoreProps;\n children?: React.ReactNode;\n}\n\nexport const DashboardContext = createContext<StoreApi<DashboardStoreState> | undefined>(undefined);\n\nexport function useDashboardStore<T>(selector: (state: DashboardStoreState) => T) {\n const store = useContext(DashboardContext);\n if (store === undefined) {\n throw new Error('No DashboardContext found. Did you forget a Provider?');\n }\n return useStore(store, selector, shallow);\n}\n\nexport function DashboardProvider(props: DashboardProviderProps) {\n const createDashboardStore = useCallback(initStore, [props]);\n\n const [store] = useState(createDashboardStore(props)); // prevent calling createDashboardStore every time it rerenders\n\n return (\n <DashboardContext.Provider value={store as StoreApi<DashboardStoreState>}>\n {props.children}\n </DashboardContext.Provider>\n );\n}\n\nfunction initStore(props: DashboardProviderProps) {\n const {\n initialState: { dashboardResource, isEditMode },\n } = props;\n\n const {\n spec: { layouts, panels, duration },\n metadata,\n } = dashboardResource;\n const store = createStore<DashboardStoreState>()(\n immer(\n devtools((...args) => {\n const [set] = args;\n return {\n ...createPanelGroupSlice(layouts)(...args),\n ...createPanelSlice(panels)(...args),\n ...createPanelGroupEditorSlice(...args),\n ...createDeletePanelGroupSlice(...args),\n ...createPanelEditorSlice()(...args),\n ...createDeletePanelSlice()(...args),\n metadata,\n defaultTimeRange: { pastDuration: duration },\n isEditMode: !!isEditMode,\n setEditMode: (isEditMode: boolean) => set({ isEditMode }),\n setDashboard: ({ metadata, spec: { panels, layouts } }) => {\n set((state) => {\n state.metadata = metadata;\n const { panelGroups, panelGroupOrder } = convertLayoutsToPanelGroups(layouts);\n state.panels = panels;\n state.panelGroups = panelGroups;\n state.panelGroupOrder = panelGroupOrder;\n });\n },\n };\n })\n )\n );\n\n return store;\n}\n"],"names":["createStore","useStore","devtools","immer","shallow","createContext","useCallback","useContext","useState","createPanelGroupEditorSlice","convertLayoutsToPanelGroups","createPanelGroupSlice","createPanelEditorSlice","createPanelSlice","createDeletePanelGroupSlice","createDeletePanelSlice","DashboardContext","undefined","useDashboardStore","selector","store","Error","DashboardProvider","props","createDashboardStore","initStore","Provider","value","children","initialState","dashboardResource","isEditMode","spec","layouts","panels","duration","metadata","args","set","defaultTimeRange","pastDuration","setEditMode","setDashboard","state","panelGroups","panelGroupOrder"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,S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AAAC;oBAC9EU,KAAK,CAACT,MAAM,GAAGA,MAAM,CAAC;oBACtBS,KAAK,CAACC,WAAW,GAAGA,WAAW,CAAC;oBAChCD,KAAK,CAACE,eAAe,GAAGA,eAAe,CAAC;gBAC1C,CAAC,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC,CAAC,CACH,CACF,AAAC;IAEF,OAAOzB,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The middleware applied to the DashboardStore (can be used as generic argument in StateCreator).
3
+ */
4
+ export declare type Middleware = [['zustand/immer', never], ['zustand/devtools', never]];
5
+ declare global {
6
+ var dashboardStoreId: number;
7
+ }
8
+ /**
9
+ * Helper function to generate unique IDs for things in the dashboard store that don't have a "natural" ID.
10
+ */
11
+ export declare function generateId(): number;
12
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/context/DashboardProvider/common.ts"],"names":[],"mappings":"AAaA;;GAEG;AACH,oBAAY,UAAU,GAAG,CAAC,CAAC,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC,CAAC;AAEjF,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,gBAAgB,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,wBAAgB,UAAU,WAKzB"}