@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,88 @@
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
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "DeletePanelGroupDialog", {
18
+ enumerable: true,
19
+ get: ()=>DeletePanelGroupDialog
20
+ });
21
+ const _jsxRuntime = require("react/jsx-runtime");
22
+ const _material = require("@mui/material");
23
+ const _close = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/Close"));
24
+ const _context = require("../../context");
25
+ function _interopRequireDefault(obj) {
26
+ return obj && obj.__esModule ? obj : {
27
+ default: obj
28
+ };
29
+ }
30
+ const DeletePanelGroupDialog = ()=>{
31
+ const { deletePanelGroupDialog , closeDeletePanelGroupDialog , deletePanelGroup } = (0, _context.useDeletePanelGroupDialog)();
32
+ const panelGroupId = deletePanelGroupDialog === null || deletePanelGroupDialog === void 0 ? void 0 : deletePanelGroupDialog.panelGroupId;
33
+ const handleDelete = (e)=>{
34
+ e.preventDefault();
35
+ if (panelGroupId == undefined) {
36
+ throw new Error('group index is undefined');
37
+ }
38
+ deletePanelGroup(panelGroupId);
39
+ closeDeletePanelGroupDialog();
40
+ };
41
+ var ref;
42
+ return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Dialog, {
43
+ open: deletePanelGroupDialog !== undefined,
44
+ children: [
45
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.DialogTitle, {
46
+ children: "Delete Panel Group"
47
+ }),
48
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
49
+ "aria-label": "Close",
50
+ onClick: ()=>closeDeletePanelGroupDialog(),
51
+ sx: (theme)=>({
52
+ position: 'absolute',
53
+ top: theme.spacing(0.5),
54
+ right: theme.spacing(0.5)
55
+ }),
56
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_close.default, {})
57
+ }),
58
+ /*#__PURE__*/ (0, _jsxRuntime.jsxs)("form", {
59
+ onSubmit: handleDelete,
60
+ children: [
61
+ /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.DialogContent, {
62
+ sx: {
63
+ width: '500px'
64
+ },
65
+ children: [
66
+ "Are you sure you want to delete ",
67
+ (ref = deletePanelGroupDialog === null || deletePanelGroupDialog === void 0 ? void 0 : deletePanelGroupDialog.panelGroupName) !== null && ref !== void 0 ? ref : 'panel group',
68
+ "? This will delete all the panels within the group."
69
+ ]
70
+ }),
71
+ /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.DialogActions, {
72
+ children: [
73
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
74
+ variant: "contained",
75
+ type: "submit",
76
+ children: "Delete"
77
+ }),
78
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
79
+ onClick: ()=>closeDeletePanelGroupDialog(),
80
+ children: "Cancel"
81
+ })
82
+ ]
83
+ })
84
+ ]
85
+ })
86
+ ]
87
+ });
88
+ };
@@ -0,0 +1,28 @@
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
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ _exportStar(require("./DeletePanelGroupDialog"), exports);
18
+ function _exportStar(from, to) {
19
+ Object.keys(from).forEach(function(k) {
20
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
21
+ enumerable: true,
22
+ get: function() {
23
+ return from[k];
24
+ }
25
+ });
26
+ });
27
+ return from;
28
+ }
@@ -0,0 +1,109 @@
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
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "DownloadButton", {
18
+ enumerable: true,
19
+ get: ()=>DownloadButton
20
+ });
21
+ const _jsxRuntime = require("react/jsx-runtime");
22
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
23
+ const _downloadOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/DownloadOutline"));
24
+ const _material = require("@mui/material");
25
+ const _context = require("../../context");
26
+ function _interopRequireDefault(obj) {
27
+ return obj && obj.__esModule ? obj : {
28
+ default: obj
29
+ };
30
+ }
31
+ function _getRequireWildcardCache(nodeInterop) {
32
+ if (typeof WeakMap !== "function") return null;
33
+ var cacheBabelInterop = new WeakMap();
34
+ var cacheNodeInterop = new WeakMap();
35
+ return (_getRequireWildcardCache = function(nodeInterop) {
36
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
37
+ })(nodeInterop);
38
+ }
39
+ function _interopRequireWildcard(obj, nodeInterop) {
40
+ if (!nodeInterop && obj && obj.__esModule) {
41
+ return obj;
42
+ }
43
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
44
+ return {
45
+ default: obj
46
+ };
47
+ }
48
+ var cache = _getRequireWildcardCache(nodeInterop);
49
+ if (cache && cache.has(obj)) {
50
+ return cache.get(obj);
51
+ }
52
+ var newObj = {};
53
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
54
+ for(var key in obj){
55
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
56
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
57
+ if (desc && (desc.get || desc.set)) {
58
+ Object.defineProperty(newObj, key, desc);
59
+ } else {
60
+ newObj[key] = obj[key];
61
+ }
62
+ }
63
+ }
64
+ newObj.default = obj;
65
+ if (cache) {
66
+ cache.set(obj, newObj);
67
+ }
68
+ return newObj;
69
+ }
70
+ function DownloadButton() {
71
+ const { dashboard } = (0, _context.useDashboard)();
72
+ const hiddenLinkRef = (0, _react.useRef)(null);
73
+ const onDownloadButtonClick = ()=>{
74
+ if (!hiddenLinkRef || !hiddenLinkRef.current) return;
75
+ // Create blob URL
76
+ const hiddenLinkUrl = URL.createObjectURL(new Blob([
77
+ JSON.stringify(dashboard)
78
+ ], {
79
+ type: 'application/json'
80
+ }));
81
+ // Simulate click
82
+ hiddenLinkRef.current.href = hiddenLinkUrl;
83
+ hiddenLinkRef.current.click();
84
+ // Remove blob URL (for memory management)
85
+ URL.revokeObjectURL(hiddenLinkUrl);
86
+ };
87
+ return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
88
+ children: [
89
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(DownloadIconButton, {
90
+ title: "Download JSON",
91
+ onClick: onDownloadButtonClick,
92
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_downloadOutline.default, {})
93
+ }),
94
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)("a", {
95
+ ref: hiddenLinkRef,
96
+ style: {
97
+ display: 'none'
98
+ },
99
+ download: `${dashboard.metadata.name}.json`
100
+ })
101
+ ]
102
+ });
103
+ }
104
+ const DownloadIconButton = (0, _material.styled)(_material.IconButton)(({ theme })=>({
105
+ border: `1px solid ${theme.palette.grey[300]}`,
106
+ borderRadius: theme.shape.borderRadius,
107
+ padding: '4px',
108
+ color: theme.palette.grey[900]
109
+ }));
@@ -0,0 +1,28 @@
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
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ _exportStar(require("./DownloadButton"), exports);
18
+ function _exportStar(from, to) {
19
+ Object.keys(from).forEach(function(k) {
20
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
21
+ enumerable: true,
22
+ get: function() {
23
+ return from[k];
24
+ }
25
+ });
26
+ });
27
+ return from;
28
+ }
@@ -0,0 +1,219 @@
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
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "GridContainer", {
18
+ enumerable: true,
19
+ get: ()=>GridContainer
20
+ });
21
+ const _jsxRuntime = require("react/jsx-runtime");
22
+ const _react = require("react");
23
+ const _material = require("@mui/material");
24
+ function GridContainer(props) {
25
+ const [isFirstRender, setIsFirstRender] = (0, _react.useState)(true);
26
+ (0, _react.useEffect)(()=>{
27
+ if (isFirstRender) {
28
+ setIsFirstRender(false);
29
+ }
30
+ }, [
31
+ isFirstRender
32
+ ]);
33
+ return /*#__PURE__*/ (0, _jsxRuntime.jsx)(ReactGridLayoutContainer, {
34
+ sx: {
35
+ // This adds spcing between grids (rows) in the overall dashboard
36
+ '& + &': {
37
+ marginTop: (theme)=>theme.spacing(1)
38
+ },
39
+ // This disables the animation of grid items when a grid is first rendered
40
+ // (see https://github.com/react-grid-layout/react-grid-layout/issues/103)
41
+ '& .react-grid-item.cssTransforms': {
42
+ transitionProperty: isFirstRender ? 'none' : 'transform'
43
+ }
44
+ },
45
+ children: props.children
46
+ });
47
+ }
48
+ /**
49
+ * These are the classes needed by react-grid-layout from their CSS stylesheet.
50
+ */ const ReactGridLayoutContainer = (0, _material.styled)('section')(({ theme })=>({
51
+ '& .react-grid-layout': {
52
+ position: 'relative',
53
+ transition: 'height 200ms ease'
54
+ },
55
+ '& .react-grid-item': {
56
+ transition: 'all 200ms ease',
57
+ transitionProperty: 'left, top'
58
+ },
59
+ '& .react-grid-item img': {
60
+ pointerEvents: 'none',
61
+ userSelect: 'none'
62
+ },
63
+ '& .react-grid-item.cssTransforms': {
64
+ transitionProperty: 'transform'
65
+ },
66
+ '& .react-grid-item.resizing': {
67
+ zIndex: 1,
68
+ willChange: 'width, height'
69
+ },
70
+ '& .react-grid-item.react-draggable-dragging': {
71
+ transition: 'none',
72
+ zIndex: 3,
73
+ willChange: 'transform'
74
+ },
75
+ '& .react-grid-item.dropping': {
76
+ visibility: 'hidden'
77
+ },
78
+ '& .react-grid-item.react-grid-placeholder': {
79
+ background: theme.palette.primary.main,
80
+ opacity: 0.2,
81
+ transitionDuration: '100ms',
82
+ zIndex: 2,
83
+ userSelect: 'none',
84
+ WebkitUserSelect: 'none',
85
+ MozUserSelect: 'none',
86
+ msUserSelect: 'none',
87
+ OUserSelect: 'none'
88
+ },
89
+ '& .react-grid-item > .react-resizable-handle': {
90
+ position: 'absolute',
91
+ width: '20px',
92
+ height: '20px'
93
+ },
94
+ '& .react-grid-item > .react-resizable-handle::after': {
95
+ content: '""',
96
+ position: 'absolute',
97
+ right: '3px',
98
+ bottom: '3px',
99
+ width: '5px',
100
+ height: '5px',
101
+ borderRight: `2px solid ${theme.palette.text.secondary}`,
102
+ borderBottom: `2px solid ${theme.palette.text.secondary}`
103
+ },
104
+ '& .react-resizable-hide > .react-resizable-handle': {
105
+ display: 'none'
106
+ },
107
+ '& .react-grid-item > .react-resizable-handle.react-resizable-handle-sw': {
108
+ bottom: '0',
109
+ left: '0',
110
+ cursor: 'sw-resize',
111
+ transform: 'rotate(90deg)'
112
+ },
113
+ '& .react-grid-item > .react-resizable-handle.react-resizable-handle-se': {
114
+ bottom: '0',
115
+ right: '0',
116
+ cursor: 'se-resize'
117
+ },
118
+ '& .react-grid-item > .react-resizable-handle.react-resizable-handle-nw': {
119
+ top: '0',
120
+ left: '0',
121
+ cursor: 'nw-resize',
122
+ transform: 'rotate(180deg)'
123
+ },
124
+ '& .react-grid-item > .react-resizable-handle.react-resizable-handle-ne': {
125
+ top: '0',
126
+ right: '0',
127
+ cursor: 'ne-resize',
128
+ transform: 'rotate(270deg)'
129
+ },
130
+ '& .react-grid-item > .react-resizable-handle.react-resizable-handle-w, &.react-grid-item > .react-resizable-handle.react-resizable-handle-e': {
131
+ top: '50%',
132
+ marginTop: '-10px',
133
+ cursor: 'ew-resize'
134
+ },
135
+ '& .react-grid-item > .react-resizable-handle.react-resizable-handle-w': {
136
+ left: '0',
137
+ transform: 'rotate(135deg)'
138
+ },
139
+ '& .react-grid-item > .react-resizable-handle.react-resizable-handle-e': {
140
+ right: '0',
141
+ transform: 'rotate(315deg)'
142
+ },
143
+ '& .react-grid-item > .react-resizable-handle.react-resizable-handle-n, &.react-grid-item > .react-resizable-handle.react-resizable-handle-s': {
144
+ left: '50%',
145
+ marginLeft: '-10px',
146
+ cursor: 'ns-resize'
147
+ },
148
+ '& .react-grid-item > .react-resizable-handle.react-resizable-handle-n': {
149
+ top: '0',
150
+ transform: 'rotate(225deg)'
151
+ },
152
+ '& .react-grid-item > .react-resizable-handle.react-resizable-handle-s': {
153
+ bottom: '0',
154
+ transform: 'rotate(45deg)'
155
+ },
156
+ '& .react-resizable': {
157
+ position: 'relative'
158
+ },
159
+ '& .react-resizable-handle': {
160
+ position: 'absolute',
161
+ width: '20px',
162
+ height: '20px',
163
+ backgroundRepeat: 'no-repeat',
164
+ backgroundOrigin: 'content-box',
165
+ boxSizing: 'border-box',
166
+ backgroundImage: `url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+')`,
167
+ backgroundPosition: 'bottom right',
168
+ padding: '0 3px 3px 0'
169
+ },
170
+ '& .react-resizable-handle-sw': {
171
+ bottom: '0',
172
+ left: '0',
173
+ cursor: 'sw-resize',
174
+ transform: 'rotate(90deg)'
175
+ },
176
+ '& .react-resizable-handle-se': {
177
+ bottom: '0',
178
+ right: '0',
179
+ cursor: 'se-resize'
180
+ },
181
+ '& .react-resizable-handle-nw': {
182
+ top: '0',
183
+ left: '0',
184
+ cursor: 'nw-resize',
185
+ transform: 'rotate(180deg)'
186
+ },
187
+ '& .react-resizable-handle-ne': {
188
+ top: '0',
189
+ right: '0',
190
+ cursor: 'ne-resize',
191
+ transform: 'rotate(270deg)'
192
+ },
193
+ '& .react-resizable-handle-w, .react-resizable-handle-e': {
194
+ top: '50%',
195
+ marginTop: '-10px',
196
+ cursor: 'ew-resize'
197
+ },
198
+ '& .react-resizable-handle-w': {
199
+ left: '0',
200
+ transform: 'rotate(135deg)'
201
+ },
202
+ '& .react-resizable-handle-e': {
203
+ right: '0',
204
+ transform: 'rotate(315deg)'
205
+ },
206
+ '& .react-resizable-handle-n, .react-resizable-handle-s': {
207
+ left: '50%',
208
+ marginLeft: '-10px',
209
+ cursor: 'ns-resize'
210
+ },
211
+ '& .react-resizable-handle-n': {
212
+ top: '0',
213
+ transform: 'rotate(225deg)'
214
+ },
215
+ '& .react-resizable-handle-s': {
216
+ bottom: '0',
217
+ transform: 'rotate(45deg)'
218
+ }
219
+ }));
@@ -0,0 +1,41 @@
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
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "GridItemContent", {
18
+ enumerable: true,
19
+ get: ()=>GridItemContent
20
+ });
21
+ const _jsxRuntime = require("react/jsx-runtime");
22
+ const _context = require("../../context");
23
+ const _panel = require("../Panel/Panel");
24
+ function GridItemContent(props) {
25
+ const { panelGroupItemId } = props;
26
+ const panelDefinition = (0, _context.usePanel)(panelGroupItemId);
27
+ const { isEditMode } = (0, _context.useEditMode)();
28
+ const { openEditPanel , openDeletePanelDialog } = (0, _context.usePanelActions)(panelGroupItemId);
29
+ // Provide actions to the panel when in edit mode
30
+ let editHandlers = undefined;
31
+ if (isEditMode) {
32
+ editHandlers = {
33
+ onEditPanelClick: openEditPanel,
34
+ onDeletePanelClick: openDeletePanelDialog
35
+ };
36
+ }
37
+ return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_panel.Panel, {
38
+ definition: panelDefinition,
39
+ editHandlers: editHandlers
40
+ });
41
+ }
@@ -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
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "GridLayout", {
18
+ enumerable: true,
19
+ get: ()=>GridLayout
20
+ });
21
+ const _jsxRuntime = require("react/jsx-runtime");
22
+ const _react = require("react");
23
+ const _reactGridLayout = require("react-grid-layout");
24
+ const _material = require("@mui/material");
25
+ const _components = require("@perses-dev/components");
26
+ const _context = require("../../context");
27
+ const _gridTitle = require("./GridTitle");
28
+ const _gridItemContent = require("./GridItemContent");
29
+ const _gridContainer = require("./GridContainer");
30
+ const ResponsiveGridLayout = (0, _reactGridLayout.WidthProvider)(_reactGridLayout.Responsive);
31
+ const SMALL_LAYOUT_BREAKPOINT = 'sm';
32
+ function GridLayout(props) {
33
+ const { panelGroupId /*...others */ } = props;
34
+ const theme = (0, _material.useTheme)();
35
+ const groupDefinition = (0, _context.usePanelGroup)(panelGroupId);
36
+ const { updatePanelGroupLayouts } = (0, _context.usePanelGroupActions)(panelGroupId);
37
+ var ref;
38
+ const [isOpen, setIsOpen] = (0, _react.useState)((ref = !groupDefinition.isCollapsed) !== null && ref !== void 0 ? ref : true);
39
+ const { isEditMode } = (0, _context.useEditMode)();
40
+ const handleLayoutChange = (currentLayout, allLayouts)=>{
41
+ // Using the value from `allLayouts` instead of `currentLayout` because of
42
+ // a bug in react-layout-grid where `currentLayout` does not adjust properly
43
+ // when going to a smaller breakpoint and then back to a larger breakpoint.
44
+ // https://github.com/react-grid-layout/react-grid-layout/issues/1663
45
+ const smallLayout = allLayouts[SMALL_LAYOUT_BREAKPOINT];
46
+ if (smallLayout) {
47
+ updatePanelGroupLayouts(smallLayout);
48
+ }
49
+ };
50
+ return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_gridContainer.GridContainer, {
51
+ children: [
52
+ groupDefinition.title !== undefined && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_gridTitle.GridTitle, {
53
+ panelGroupId: panelGroupId,
54
+ title: groupDefinition.title,
55
+ collapse: groupDefinition.isCollapsed === undefined ? undefined : {
56
+ isOpen,
57
+ onToggleOpen: ()=>setIsOpen((current)=>!current)
58
+ }
59
+ }),
60
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Collapse, {
61
+ in: isOpen,
62
+ unmountOnExit: true,
63
+ appear: false,
64
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(ResponsiveGridLayout, {
65
+ className: "layout",
66
+ breakpoints: {
67
+ sm: theme.breakpoints.values.sm,
68
+ xxs: 0
69
+ },
70
+ cols: {
71
+ sm: 24,
72
+ xxs: 2
73
+ },
74
+ rowHeight: 30,
75
+ draggableHandle: '.drag-handle',
76
+ resizeHandles: [
77
+ 'se'
78
+ ],
79
+ isDraggable: isEditMode,
80
+ isResizable: isEditMode,
81
+ containerPadding: [
82
+ 0,
83
+ 10
84
+ ],
85
+ layouts: {
86
+ [SMALL_LAYOUT_BREAKPOINT]: groupDefinition.itemLayouts
87
+ },
88
+ onLayoutChange: handleLayoutChange,
89
+ children: groupDefinition.itemLayouts.map(({ i })=>/*#__PURE__*/ (0, _jsxRuntime.jsx)("div", {
90
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.ErrorBoundary, {
91
+ FallbackComponent: _components.ErrorAlert,
92
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_gridItemContent.GridItemContent, {
93
+ panelGroupItemId: {
94
+ panelGroupId,
95
+ panelGroupItemLayoutId: i
96
+ }
97
+ })
98
+ })
99
+ }, i))
100
+ })
101
+ })
102
+ ]
103
+ });
104
+ }