@perses-dev/dashboards 0.38.0 → 0.40.0

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 (303) hide show
  1. package/dist/cjs/components/AddGroupButton/AddGroupButton.js +9 -7
  2. package/dist/cjs/components/AddGroupButton/index.js +10 -8
  3. package/dist/cjs/components/AddPanelButton/AddPanelButton.js +9 -7
  4. package/dist/cjs/components/AddPanelButton/index.js +10 -8
  5. package/dist/cjs/components/Dashboard/Dashboard.js +14 -11
  6. package/dist/cjs/components/Dashboard/index.js +10 -8
  7. package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +18 -16
  8. package/dist/cjs/components/DashboardStickyToolbar/index.js +10 -8
  9. package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +43 -41
  10. package/dist/cjs/components/DashboardToolbar/index.js +10 -8
  11. package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +12 -10
  12. package/dist/cjs/components/DeletePanelDialog/index.js +10 -8
  13. package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +17 -15
  14. package/dist/cjs/components/DeletePanelGroupDialog/index.js +10 -8
  15. package/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +5 -3
  16. package/dist/cjs/components/DiscardChangesConfirmationDialog/index.js +10 -8
  17. package/dist/cjs/components/DownloadButton/DownloadButton.js +12 -10
  18. package/dist/cjs/components/DownloadButton/index.js +10 -8
  19. package/dist/cjs/components/EditButton/EditButton.js +8 -6
  20. package/dist/cjs/components/EditButton/index.js +10 -8
  21. package/dist/cjs/components/EditJsonButton/EditJsonButton.js +10 -8
  22. package/dist/cjs/components/EditJsonButton/index.js +10 -8
  23. package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +29 -23
  24. package/dist/cjs/components/EditJsonDialog/index.js +10 -8
  25. package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +18 -16
  26. package/dist/cjs/components/EmptyDashboard/index.js +10 -8
  27. package/dist/cjs/components/GridLayout/GridContainer.js +5 -3
  28. package/dist/cjs/components/GridLayout/GridItemContent.js +33 -12
  29. package/dist/cjs/components/GridLayout/GridLayout.js +19 -16
  30. package/dist/cjs/components/GridLayout/GridTitle.js +35 -33
  31. package/dist/cjs/components/GridLayout/index.js +13 -11
  32. package/dist/cjs/components/Panel/Panel.js +21 -21
  33. package/dist/cjs/components/Panel/PanelContent.js +8 -6
  34. package/dist/cjs/components/Panel/PanelHeader.js +39 -33
  35. package/dist/cjs/components/Panel/index.js +10 -8
  36. package/dist/cjs/components/PanelDrawer/PanelDrawer.js +25 -77
  37. package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +269 -141
  38. package/dist/cjs/components/PanelDrawer/PanelPreview.js +11 -9
  39. package/dist/cjs/components/PanelDrawer/index.js +10 -8
  40. package/dist/cjs/components/PanelDrawer/usePanelEditor.js +3 -1
  41. package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +18 -16
  42. package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +15 -11
  43. package/dist/cjs/components/PanelGroupDialog/index.js +10 -8
  44. package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +46 -44
  45. package/dist/cjs/components/QuerySummaryTable/index.js +10 -8
  46. package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +23 -21
  47. package/dist/cjs/components/SaveChangesConfirmationDialog/index.js +10 -8
  48. package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +11 -9
  49. package/dist/cjs/components/SaveDashboardButton/index.js +10 -8
  50. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +40 -16
  51. package/dist/cjs/components/TimeRangeControls/index.js +10 -8
  52. package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +5 -3
  53. package/dist/cjs/components/ToolbarIconButton/index.js +10 -8
  54. package/dist/cjs/components/Variables/BuiltinVariableAccordions.js +140 -0
  55. package/dist/cjs/components/Variables/EditVariablesButton.js +18 -11
  56. package/dist/cjs/components/Variables/TemplateVariable.js +127 -76
  57. package/dist/cjs/components/Variables/VariableEditor.js +356 -117
  58. package/dist/cjs/components/Variables/VariableList.js +45 -21
  59. package/dist/cjs/components/Variables/index.js +14 -11
  60. package/dist/cjs/components/index.js +31 -29
  61. package/dist/cjs/constants/grid-layout-config.js +6 -2
  62. package/dist/cjs/constants/index.js +11 -9
  63. package/dist/cjs/constants/user-interface-text.js +6 -2
  64. package/dist/cjs/context/DashboardProvider/DashboardProvider.js +40 -34
  65. package/dist/cjs/context/DashboardProvider/common.js +6 -2
  66. package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +70 -38
  67. package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +3 -1
  68. package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +5 -3
  69. package/dist/cjs/context/DashboardProvider/discard-changes-dialog-slice.js +3 -1
  70. package/dist/cjs/context/DashboardProvider/duplicate-panel-slice.js +3 -1
  71. package/dist/cjs/context/DashboardProvider/edit-json-dialog-slice.js +3 -1
  72. package/dist/cjs/context/DashboardProvider/index.js +12 -10
  73. package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +13 -11
  74. package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +8 -6
  75. package/dist/cjs/context/DashboardProvider/panel-group-slice.js +15 -7
  76. package/dist/cjs/context/DashboardProvider/panel-slice.js +3 -1
  77. package/dist/cjs/context/DashboardProvider/save-changes-dialog-slice.js +3 -1
  78. package/dist/cjs/context/DatasourceStoreProvider.js +114 -45
  79. package/dist/cjs/context/TemplateVariableProvider/TemplateVariableProvider.js +189 -51
  80. package/dist/cjs/context/TemplateVariableProvider/hydrationUtils.js +65 -13
  81. package/dist/cjs/context/TemplateVariableProvider/index.js +10 -8
  82. package/dist/cjs/context/TemplateVariableProvider/query-params.js +17 -7
  83. package/dist/cjs/context/TemplateVariableProvider/utils.js +49 -9
  84. package/dist/cjs/context/index.js +13 -11
  85. package/dist/cjs/context/useDashboard.js +8 -6
  86. package/dist/cjs/index.js +12 -10
  87. package/dist/cjs/stories/decorators/WithDashboard.js +6 -4
  88. package/dist/cjs/stories/decorators/WithDatasourceStore.js +6 -4
  89. package/dist/cjs/stories/decorators/WithTemplateVariables.js +6 -4
  90. package/dist/cjs/stories/decorators/constants.js +5 -3
  91. package/dist/cjs/stories/decorators/index.js +13 -11
  92. package/dist/cjs/test/dashboard-provider.js +8 -4
  93. package/dist/cjs/test/datasource-provider.js +16 -12
  94. package/dist/cjs/test/index.js +13 -11
  95. package/dist/cjs/test/plugin-registry.js +6 -4
  96. package/dist/cjs/test/render.js +27 -20
  97. package/dist/cjs/test/setup-tests.js +2 -2
  98. package/dist/cjs/test/testDashboard.js +13 -11
  99. package/dist/cjs/utils/index.js +11 -9
  100. package/dist/cjs/utils/panelUtils.js +9 -3
  101. package/dist/cjs/utils/time.js +5 -3
  102. package/dist/cjs/validation/index.js +30 -0
  103. package/dist/cjs/validation/panel.js +29 -0
  104. package/dist/cjs/views/ViewDashboard/DashboardApp.js +24 -15
  105. package/dist/cjs/views/ViewDashboard/ViewDashboard.js +64 -19
  106. package/dist/cjs/views/ViewDashboard/index.js +10 -8
  107. package/dist/cjs/views/index.js +10 -8
  108. package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -1
  109. package/dist/components/AddGroupButton/index.js.map +1 -1
  110. package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -1
  111. package/dist/components/AddPanelButton/index.js.map +1 -1
  112. package/dist/components/Dashboard/Dashboard.d.ts +3 -1
  113. package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
  114. package/dist/components/Dashboard/Dashboard.js +3 -2
  115. package/dist/components/Dashboard/Dashboard.js.map +1 -1
  116. package/dist/components/Dashboard/index.js.map +1 -1
  117. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -1
  118. package/dist/components/DashboardStickyToolbar/index.js.map +1 -1
  119. package/dist/components/DashboardToolbar/DashboardToolbar.js +1 -1
  120. package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
  121. package/dist/components/DashboardToolbar/index.js.map +1 -1
  122. package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -1
  123. package/dist/components/DeletePanelDialog/index.js.map +1 -1
  124. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +2 -2
  125. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
  126. package/dist/components/DeletePanelGroupDialog/index.js.map +1 -1
  127. package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js.map +1 -1
  128. package/dist/components/DiscardChangesConfirmationDialog/index.js.map +1 -1
  129. package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
  130. package/dist/components/DownloadButton/index.js.map +1 -1
  131. package/dist/components/EditButton/EditButton.js.map +1 -1
  132. package/dist/components/EditButton/index.js.map +1 -1
  133. package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
  134. package/dist/components/EditJsonButton/index.js.map +1 -1
  135. package/dist/components/EditJsonDialog/EditJsonDialog.d.ts +4 -1
  136. package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
  137. package/dist/components/EditJsonDialog/EditJsonDialog.js +12 -8
  138. package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -1
  139. package/dist/components/EditJsonDialog/index.js.map +1 -1
  140. package/dist/components/EmptyDashboard/EmptyDashboard.js.map +1 -1
  141. package/dist/components/EmptyDashboard/index.js.map +1 -1
  142. package/dist/components/GridLayout/GridContainer.js.map +1 -1
  143. package/dist/components/GridLayout/GridItemContent.d.ts +2 -0
  144. package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
  145. package/dist/components/GridLayout/GridItemContent.js +27 -8
  146. package/dist/components/GridLayout/GridItemContent.js.map +1 -1
  147. package/dist/components/GridLayout/GridLayout.d.ts +2 -0
  148. package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
  149. package/dist/components/GridLayout/GridLayout.js +3 -2
  150. package/dist/components/GridLayout/GridLayout.js.map +1 -1
  151. package/dist/components/GridLayout/GridTitle.js.map +1 -1
  152. package/dist/components/GridLayout/index.js.map +1 -1
  153. package/dist/components/Panel/Panel.d.ts +20 -0
  154. package/dist/components/Panel/Panel.d.ts.map +1 -1
  155. package/dist/components/Panel/Panel.js +8 -10
  156. package/dist/components/Panel/Panel.js.map +1 -1
  157. package/dist/components/Panel/PanelContent.js.map +1 -1
  158. package/dist/components/Panel/PanelHeader.d.ts +2 -1
  159. package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
  160. package/dist/components/Panel/PanelHeader.js +7 -3
  161. package/dist/components/Panel/PanelHeader.js.map +1 -1
  162. package/dist/components/Panel/index.js.map +1 -1
  163. package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
  164. package/dist/components/PanelDrawer/PanelDrawer.js +22 -76
  165. package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
  166. package/dist/components/PanelDrawer/PanelEditorForm.d.ts +4 -1
  167. package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
  168. package/dist/components/PanelDrawer/PanelEditorForm.js +223 -138
  169. package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
  170. package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
  171. package/dist/components/PanelDrawer/PanelPreview.js +2 -2
  172. package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
  173. package/dist/components/PanelDrawer/index.js.map +1 -1
  174. package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -1
  175. package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
  176. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -1
  177. package/dist/components/PanelGroupDialog/index.js.map +1 -1
  178. package/dist/components/QuerySummaryTable/QuerySummaryTable.js +4 -4
  179. package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
  180. package/dist/components/QuerySummaryTable/index.js.map +1 -1
  181. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +4 -4
  182. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
  183. package/dist/components/SaveChangesConfirmationDialog/index.js.map +1 -1
  184. package/dist/components/SaveDashboardButton/SaveDashboardButton.js +4 -4
  185. package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
  186. package/dist/components/SaveDashboardButton/index.js.map +1 -1
  187. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
  188. package/dist/components/TimeRangeControls/TimeRangeControls.js +19 -1
  189. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
  190. package/dist/components/TimeRangeControls/index.js.map +1 -1
  191. package/dist/components/ToolbarIconButton/ToolbarIconButton.js.map +1 -1
  192. package/dist/components/ToolbarIconButton/index.js.map +1 -1
  193. package/dist/components/Variables/BuiltinVariableAccordions.d.ts +8 -0
  194. package/dist/components/Variables/BuiltinVariableAccordions.d.ts.map +1 -0
  195. package/dist/components/Variables/BuiltinVariableAccordions.js +127 -0
  196. package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -0
  197. package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
  198. package/dist/components/Variables/EditVariablesButton.js +6 -1
  199. package/dist/components/Variables/EditVariablesButton.js.map +1 -1
  200. package/dist/components/Variables/TemplateVariable.d.ts +12 -2
  201. package/dist/components/Variables/TemplateVariable.d.ts.map +1 -1
  202. package/dist/components/Variables/TemplateVariable.js +102 -61
  203. package/dist/components/Variables/TemplateVariable.js.map +1 -1
  204. package/dist/components/Variables/VariableEditor.d.ts +9 -1
  205. package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
  206. package/dist/components/Variables/VariableEditor.js +326 -97
  207. package/dist/components/Variables/VariableEditor.js.map +1 -1
  208. package/dist/components/Variables/VariableList.d.ts +5 -0
  209. package/dist/components/Variables/VariableList.d.ts.map +1 -1
  210. package/dist/components/Variables/VariableList.js +32 -18
  211. package/dist/components/Variables/VariableList.js.map +1 -1
  212. package/dist/components/Variables/index.d.ts +1 -0
  213. package/dist/components/Variables/index.d.ts.map +1 -1
  214. package/dist/components/Variables/index.js +1 -0
  215. package/dist/components/Variables/index.js.map +1 -1
  216. package/dist/components/index.js.map +1 -1
  217. package/dist/constants/grid-layout-config.js.map +1 -1
  218. package/dist/constants/index.js.map +1 -1
  219. package/dist/constants/user-interface-text.js.map +1 -1
  220. package/dist/context/DashboardProvider/DashboardProvider.js +5 -5
  221. package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
  222. package/dist/context/DashboardProvider/common.js.map +1 -1
  223. package/dist/context/DashboardProvider/dashboard-provider-api.js +2 -2
  224. package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
  225. package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -1
  226. package/dist/context/DashboardProvider/delete-panel-slice.js +2 -2
  227. package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -1
  228. package/dist/context/DashboardProvider/discard-changes-dialog-slice.js.map +1 -1
  229. package/dist/context/DashboardProvider/duplicate-panel-slice.js.map +1 -1
  230. package/dist/context/DashboardProvider/edit-json-dialog-slice.js.map +1 -1
  231. package/dist/context/DashboardProvider/index.js.map +1 -1
  232. package/dist/context/DashboardProvider/panel-editor-slice.d.ts +2 -1
  233. package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
  234. package/dist/context/DashboardProvider/panel-editor-slice.js +7 -7
  235. package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
  236. package/dist/context/DashboardProvider/panel-group-editor-slice.js +2 -2
  237. package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
  238. package/dist/context/DashboardProvider/panel-group-slice.js +3 -3
  239. package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
  240. package/dist/context/DashboardProvider/panel-slice.js.map +1 -1
  241. package/dist/context/DashboardProvider/save-changes-dialog-slice.js.map +1 -1
  242. package/dist/context/DatasourceStoreProvider.d.ts +14 -10
  243. package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
  244. package/dist/context/DatasourceStoreProvider.js +107 -40
  245. package/dist/context/DatasourceStoreProvider.js.map +1 -1
  246. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +48 -13
  247. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +1 -1
  248. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +165 -41
  249. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +1 -1
  250. package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts +9 -2
  251. package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts.map +1 -1
  252. package/dist/context/TemplateVariableProvider/hydrationUtils.js +67 -12
  253. package/dist/context/TemplateVariableProvider/hydrationUtils.js.map +1 -1
  254. package/dist/context/TemplateVariableProvider/index.js.map +1 -1
  255. package/dist/context/TemplateVariableProvider/query-params.js.map +1 -1
  256. package/dist/context/TemplateVariableProvider/utils.d.ts +27 -2
  257. package/dist/context/TemplateVariableProvider/utils.d.ts.map +1 -1
  258. package/dist/context/TemplateVariableProvider/utils.js +48 -6
  259. package/dist/context/TemplateVariableProvider/utils.js.map +1 -1
  260. package/dist/context/index.js.map +1 -1
  261. package/dist/context/useDashboard.js +1 -1
  262. package/dist/context/useDashboard.js.map +1 -1
  263. package/dist/index.js.map +1 -1
  264. package/dist/stories/decorators/WithDashboard.js.map +1 -1
  265. package/dist/stories/decorators/WithDatasourceStore.js.map +1 -1
  266. package/dist/stories/decorators/WithTemplateVariables.js.map +1 -1
  267. package/dist/stories/decorators/constants.js +2 -2
  268. package/dist/stories/decorators/constants.js.map +1 -1
  269. package/dist/stories/decorators/index.js.map +1 -1
  270. package/dist/test/dashboard-provider.js.map +1 -1
  271. package/dist/test/datasource-provider.d.ts.map +1 -1
  272. package/dist/test/datasource-provider.js +5 -7
  273. package/dist/test/datasource-provider.js.map +1 -1
  274. package/dist/test/index.js.map +1 -1
  275. package/dist/test/plugin-registry.js.map +1 -1
  276. package/dist/test/render.d.ts.map +1 -1
  277. package/dist/test/render.js +8 -3
  278. package/dist/test/render.js.map +1 -1
  279. package/dist/test/setup-tests.js.map +1 -1
  280. package/dist/test/testDashboard.js +10 -10
  281. package/dist/test/testDashboard.js.map +1 -1
  282. package/dist/utils/index.js.map +1 -1
  283. package/dist/utils/panelUtils.js.map +1 -1
  284. package/dist/utils/time.js.map +1 -1
  285. package/dist/validation/index.d.ts +2 -0
  286. package/dist/validation/index.d.ts.map +1 -0
  287. package/dist/validation/index.js +15 -0
  288. package/dist/validation/index.js.map +1 -0
  289. package/dist/validation/panel.d.ts +19 -0
  290. package/dist/validation/panel.d.ts.map +1 -0
  291. package/dist/validation/panel.js +21 -0
  292. package/dist/validation/panel.js.map +1 -0
  293. package/dist/views/ViewDashboard/DashboardApp.d.ts +1 -0
  294. package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
  295. package/dist/views/ViewDashboard/DashboardApp.js +11 -4
  296. package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
  297. package/dist/views/ViewDashboard/ViewDashboard.d.ts +3 -1
  298. package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
  299. package/dist/views/ViewDashboard/ViewDashboard.js +51 -8
  300. package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
  301. package/dist/views/ViewDashboard/index.js.map +1 -1
  302. package/dist/views/index.js.map +1 -1
  303. package/package.json +8 -7
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/DeletePanelGroupDialog/DeletePanelGroupDialog.tsx"],"sourcesContent":["// Copyright 2023 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 { FormEvent } from 'react';\nimport { IconButton, Dialog, DialogTitle, DialogContent, DialogActions, Button } from '@mui/material';\nimport CloseIcon from 'mdi-material-ui/Close';\nimport { useDeletePanelGroupDialog } from '../../context';\n\nexport const DeletePanelGroupDialog = () => {\n const { deletePanelGroupDialog, closeDeletePanelGroupDialog, deletePanelGroup } = useDeletePanelGroupDialog();\n\n const panelGroupId = deletePanelGroupDialog?.panelGroupId;\n\n const handleDelete = (e: FormEvent) => {\n e.preventDefault();\n if (panelGroupId == undefined) {\n throw new Error('group index is undefined');\n }\n deletePanelGroup(panelGroupId);\n closeDeletePanelGroupDialog();\n };\n\n return (\n <Dialog open={deletePanelGroupDialog !== undefined}>\n <DialogTitle>Delete Panel Group</DialogTitle>\n <IconButton\n aria-label=\"Close\"\n onClick={() => closeDeletePanelGroupDialog()}\n sx={(theme) => ({\n position: 'absolute',\n top: theme.spacing(0.5),\n right: theme.spacing(0.5),\n })}\n >\n <CloseIcon />\n </IconButton>\n <form onSubmit={handleDelete}>\n <DialogContent dividers sx={{ width: '500px' }}>\n Are you sure you want to delete {deletePanelGroupDialog?.panelGroupName ?? 'panel group'}? This will delete\n all the panels within the group.\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" type=\"submit\">\n Delete\n </Button>\n <Button variant=\"outlined\" color=\"secondary\" onClick={() => closeDeletePanelGroupDialog()}>\n Cancel\n </Button>\n </DialogActions>\n </form>\n </Dialog>\n );\n};\n"],"names":["IconButton","Dialog","DialogTitle","DialogContent","DialogActions","Button","CloseIcon","useDeletePanelGroupDialog","DeletePanelGroupDialog","deletePanelGroupDialog","closeDeletePanelGroupDialog","deletePanelGroup","panelGroupId","handleDelete","e","preventDefault","undefined","Error","open","aria-label","onClick","sx","theme","position","top","spacing","right","form","onSubmit","dividers","width","panelGroupName","variant","type","color"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEA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AK,CAACG,OAAO,CAAC,GAAG,CAAC;qBAC1B,CAAA,AAAC;0BAEF,cAAA,KAACnB,SAAS,KAAG;cACF;0BACb,MAACqB,MAAI;gBAACC,QAAQ,EAAEf,YAAY;;kCAC1B,MAACV,aAAa;wBAAC0B,QAAQ;wBAACR,EAAE,EAAE;4BAAES,KAAK,EAAE,OAAO;yBAAE;;4BAAE,kCACd;4BAACrB,CAAAA,GAAsC,GAAtCA,sBAAsB,aAAtBA,sBAAsB,WAAgB,GAAtCA,KAAAA,CAAsC,GAAtCA,sBAAsB,CAAEsB,cAAc,cAAtCtB,GAAsC,cAAtCA,GAAsC,GAAI,aAAa;4BAAC,qDAE3F;;sBAAgB;kCAChB,MAACL,aAAa;;0CACZ,KAACC,MAAM;gCAAC2B,OAAO,EAAC,WAAW;gCAACC,IAAI,EAAC,QAAQ;0CAAC,QAE1C;8BAAS;0CACT,KAAC5B,MAAM;gCAAC2B,OAAO,EAAC,UAAU;gCAACE,KAAK,EAAC,WAAW;gCAACd,OAAO,EAAE,IAAMV,2BAA2B,EAAE;0CAAE,QAE3F;8BAAS;;sBACK;;cACX;;MACA,CACT;AACJ,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../../src/components/DeletePanelGroupDialog/DeletePanelGroupDialog.tsx"],"sourcesContent":["// Copyright 2023 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 { FormEvent } from 'react';\nimport { IconButton, Dialog, DialogTitle, DialogContent, DialogActions, Button } from '@mui/material';\nimport CloseIcon from 'mdi-material-ui/Close';\nimport { useDeletePanelGroupDialog } from '../../context';\n\nexport const DeletePanelGroupDialog = () => {\n const { deletePanelGroupDialog, closeDeletePanelGroupDialog, deletePanelGroup } = useDeletePanelGroupDialog();\n\n const panelGroupId = deletePanelGroupDialog?.panelGroupId;\n\n const handleDelete = (e: FormEvent) => {\n e.preventDefault();\n if (panelGroupId == undefined) {\n throw new Error('group index is undefined');\n }\n deletePanelGroup(panelGroupId);\n closeDeletePanelGroupDialog();\n };\n\n return (\n <Dialog open={deletePanelGroupDialog !== undefined}>\n <DialogTitle>Delete Panel Group</DialogTitle>\n <IconButton\n aria-label=\"Close\"\n onClick={() => closeDeletePanelGroupDialog()}\n sx={(theme) => ({\n position: 'absolute',\n top: theme.spacing(0.5),\n right: theme.spacing(0.5),\n })}\n >\n <CloseIcon />\n </IconButton>\n <form onSubmit={handleDelete}>\n <DialogContent dividers sx={{ width: '500px' }}>\n Are you sure you want to delete {deletePanelGroupDialog?.panelGroupName ?? 'panel group'}? This will delete\n all the panels within the group.\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" type=\"submit\">\n Delete\n </Button>\n <Button variant=\"outlined\" color=\"secondary\" onClick={() => closeDeletePanelGroupDialog()}>\n Cancel\n </Button>\n </DialogActions>\n </form>\n </Dialog>\n );\n};\n"],"names":["IconButton","Dialog","DialogTitle","DialogContent","DialogActions","Button","CloseIcon","useDeletePanelGroupDialog","DeletePanelGroupDialog","deletePanelGroupDialog","closeDeletePanelGroupDialog","deletePanelGroup","panelGroupId","handleDelete","e","preventDefault","undefined","Error","open","aria-label","onClick","sx","theme","position","top","spacing","right","form","onSubmit","dividers","width","panelGroupName","variant","type","color"],"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,SAASA,UAAU,EAAEC,MAAM,EAAEC,WAAW,EAAEC,aAAa,EAAEC,aAAa,EAAEC,MAAM,QAAQ,gBAAgB;AACtG,OAAOC,eAAe,wBAAwB;AAC9C,SAASC,yBAAyB,QAAQ,gBAAgB;AAE1D,OAAO,MAAMC,yBAAyB;IACpC,MAAM,EAAEC,uBAAsB,EAAEC,4BAA2B,EAAEC,iBAAgB,EAAE,GAAGJ;IAElF,MAAMK,eAAeH,mCAAAA,oCAAAA,KAAAA,IAAAA,uBAAwBG;IAE7C,MAAMC,eAAe,CAACC;QACpBA,EAAEC;QACF,IAAIH,gBAAgBI,WAAW;YAC7B,MAAM,IAAIC,MAAM;QAClB;QACAN,iBAAiBC;QACjBF;IACF;QAkByCD;IAhBzC,qBACE,MAACR;QAAOiB,MAAMT,2BAA2BO;;0BACvC,KAACd;0BAAY;;0BACb,KAACF;gBACCmB,cAAW;gBACXC,SAAS,IAAMV;gBACfW,IAAI,CAACC,QAAW,CAAA;wBACdC,UAAU;wBACVC,KAAKF,MAAMG,QAAQ;wBACnBC,OAAOJ,MAAMG,QAAQ;oBACvB,CAAA;0BAEA,cAAA,KAACnB;;0BAEH,MAACqB;gBAAKC,UAAUf;;kCACd,MAACV;wBAAc0B,QAAQ;wBAACR,IAAI;4BAAES,OAAO;wBAAQ;;4BAAG;4BACbrB,CAAAA,yCAAAA,mCAAAA,oCAAAA,KAAAA,IAAAA,uBAAwBsB,4BAAxBtB,oDAAAA,yCAA0C;4BAAc;;;kCAG3F,MAACL;;0CACC,KAACC;gCAAO2B,SAAQ;gCAAYC,MAAK;0CAAS;;0CAG1C,KAAC5B;gCAAO2B,SAAQ;gCAAWE,OAAM;gCAAYd,SAAS,IAAMV;0CAA+B;;;;;;;;AAOrG,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/DeletePanelGroupDialog/index.ts"],"sourcesContent":["// Copyright 2023 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 './DeletePanelGroupDialog';\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,0BAA0B,CAAC"}
1
+ {"version":3,"sources":["../../../src/components/DeletePanelGroupDialog/index.ts"],"sourcesContent":["// Copyright 2023 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 './DeletePanelGroupDialog';\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,2BAA2B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.tsx"],"sourcesContent":["// Copyright 2023 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 { DiscardChangesConfirmationDialog } from '@perses-dev/components';\nimport { useDiscardChangesConfirmationDialog } from '../../context';\n\nexport const DashboardDiscardChangesConfirmationDialog = () => {\n const { discardChangesConfirmationDialog: dialog } = useDiscardChangesConfirmationDialog();\n if (dialog === undefined) {\n return null;\n }\n return (\n <DiscardChangesConfirmationDialog\n description={\n dialog.description ||\n 'You have unsaved changes in this dashboard. Are you sure you want to discard these changes? Changes cannot be recovered.'\n }\n isOpen={true}\n onCancel={dialog.onCancel}\n onDiscardChanges={dialog.onDiscardChanges}\n />\n );\n};\n"],"names":["DiscardChangesConfirmationDialog","useDiscardChangesConfirmationDialog","DashboardDiscardChangesConfirmationDialog","discardChangesConfirmationDialog","dialog","undefined","description","isOpen","onCancel","onDiscardChanges"],"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,gCAAgC,QAAQ,wBAAwB,CAAC;AAC1E,SAASC,mCAAmC,QAAQ,eAAe,CAAC;AAEpE,OAAO,MAAMC,yCAAyC,GAAG,IAAM;IAC7D,MAAM,EAAEC,gCAAgC,EAAEC,MAAM,CAAA,EAAE,GAAGH,mCAAmC,EAAE,AAAC;IAC3F,IAAIG,MAAM,KAAKC,SAAS,EAAE;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,qBACE,KAACL,gCAAgC;QAC/BM,WAAW,EACTF,MAAM,CAACE,WAAW,IAClB,0HAA0H;QAE5HC,MAAM,EAAE,IAAI;QACZC,QAAQ,EAAEJ,MAAM,CAACI,QAAQ;QACzBC,gBAAgB,EAAEL,MAAM,CAACK,gBAAgB;MACzC,CACF;AACJ,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../../src/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.tsx"],"sourcesContent":["// Copyright 2023 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 { DiscardChangesConfirmationDialog } from '@perses-dev/components';\nimport { useDiscardChangesConfirmationDialog } from '../../context';\n\nexport const DashboardDiscardChangesConfirmationDialog = () => {\n const { discardChangesConfirmationDialog: dialog } = useDiscardChangesConfirmationDialog();\n if (dialog === undefined) {\n return null;\n }\n return (\n <DiscardChangesConfirmationDialog\n description={\n dialog.description ||\n 'You have unsaved changes in this dashboard. Are you sure you want to discard these changes? Changes cannot be recovered.'\n }\n isOpen={true}\n onCancel={dialog.onCancel}\n onDiscardChanges={dialog.onDiscardChanges}\n />\n );\n};\n"],"names":["DiscardChangesConfirmationDialog","useDiscardChangesConfirmationDialog","DashboardDiscardChangesConfirmationDialog","discardChangesConfirmationDialog","dialog","undefined","description","isOpen","onCancel","onDiscardChanges"],"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,SAASA,gCAAgC,QAAQ,yBAAyB;AAC1E,SAASC,mCAAmC,QAAQ,gBAAgB;AAEpE,OAAO,MAAMC,4CAA4C;IACvD,MAAM,EAAEC,kCAAkCC,OAAM,EAAE,GAAGH;IACrD,IAAIG,WAAWC,WAAW;QACxB,OAAO;IACT;IACA,qBACE,KAACL;QACCM,aACEF,OAAOE,eACP;QAEFC,QAAQ;QACRC,UAAUJ,OAAOI;QACjBC,kBAAkBL,OAAOK;;AAG/B,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/DiscardChangesConfirmationDialog/index.ts"],"sourcesContent":["// Copyright 2023 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 './DiscardChangesConfirmationDialog';\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,oCAAoC,CAAC"}
1
+ {"version":3,"sources":["../../../src/components/DiscardChangesConfirmationDialog/index.ts"],"sourcesContent":["// Copyright 2023 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 './DiscardChangesConfirmationDialog';\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,qCAAqC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/DownloadButton/DownloadButton.tsx"],"sourcesContent":["// Copyright 2023 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 { useRef } from 'react';\nimport DownloadIcon from 'mdi-material-ui/DownloadOutline';\nimport { InfoTooltip } from '@perses-dev/components';\nimport { TOOLTIP_TEXT } from '../../constants';\nimport { useDashboard } from '../../context';\nimport { ToolbarIconButton } from '../ToolbarIconButton';\n\ninterface DownloadButtonProps {\n // The button look best at heights >= 28 pixels\n heightPx?: number;\n}\n\n// Button that enables downloading the dashboard as a JSON file\nexport function DownloadButton({ heightPx }: DownloadButtonProps) {\n const { dashboard } = useDashboard();\n const hiddenLinkRef = useRef<HTMLAnchorElement>(null);\n const height = heightPx === undefined ? undefined : `${heightPx}px`;\n\n const onDownloadButtonClick = () => {\n if (!hiddenLinkRef || !hiddenLinkRef.current) return;\n // Create blob URL\n const hiddenLinkUrl = URL.createObjectURL(\n new Blob([JSON.stringify(dashboard)], {\n type: 'application/json',\n })\n );\n // Simulate click\n hiddenLinkRef.current.href = hiddenLinkUrl;\n hiddenLinkRef.current.click();\n // Remove blob URL (for memory management)\n URL.revokeObjectURL(hiddenLinkUrl);\n };\n\n return (\n <>\n <InfoTooltip description={TOOLTIP_TEXT.downloadDashboard}>\n <ToolbarIconButton aria-label={TOOLTIP_TEXT.downloadDashboard} onClick={onDownloadButtonClick} sx={{ height }}>\n <DownloadIcon />\n </ToolbarIconButton>\n </InfoTooltip>\n {/* Hidden link to download the dashboard as a JSON file */}\n {/* eslint-disable jsx-a11y/anchor-has-content */}\n {/* eslint-disable jsx-a11y/anchor-is-valid */}\n <a ref={hiddenLinkRef} style={{ display: 'none' }} download={`${dashboard.metadata.name}.json`} />\n </>\n );\n}\n"],"names":["useRef","DownloadIcon","InfoTooltip","TOOLTIP_TEXT","useDashboard","ToolbarIconButton","DownloadButton","heightPx","dashboard","hiddenLinkRef","height","undefined","onDownloadButtonClick","current","hiddenLinkUrl","URL","createObjectURL","Blob","JSON","stringify","type","href","click","revokeObjectURL","description","downloadDashboard","aria-label","onClick","sx","a","ref","style","display","download","metadata","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,SAASA,MAAM,QAAQ,OAAO,CAAC;AAC/B,OAAOC,YAAY,MAAM,iCAAiC,CAAC;AAC3D,SAASC,WAAW,QAAQ,wBAAwB,CAAC;AACrD,SAASC,YAAY,QAAQ,iBAAiB,CAAC;AAC/C,SAASC,YAAY,QAAQ,eAAe,CAAC;AAC7C,SAASC,iBAAiB,QAAQ,sBAAsB,CAAC;AAOzD,+DAA+D;AAC/D,OAAO,SAASC,cAAc,CAAC,EAAEC,QAAQ,CAAA,EAAuB,EAAE;IAChE,MAAM,EAAEC,SAAS,CAAA,EAAE,GAAGJ,YAAY,EAAE,AAAC;IACrC,MAAMK,aAAa,GAAGT,MAAM,CAAoB,IAAI,CAAC,AAAC;IACtD,MAAMU,MAAM,GAAGH,QAAQ,KAAKI,SAAS,GAAGA,SAAS,GAAG,CAAC,EAAEJ,QAAQ,CAAC,EAAE,CAAC,AAAC;IAEpE,MAAMK,qBAAqB,GAAG,IAAM;QAClC,IAAI,CAACH,aAAa,IAAI,CAACA,aAAa,CAACI,OAAO,EAAE,OAAO;QACrD,kBAAkB;QAClB,MAAMC,aAAa,GAAGC,GAAG,CAACC,eAAe,CACvC,IAAIC,IAAI,CAAC;YAACC,IAAI,CAACC,SAAS,CAACX,SAAS,CAAC;SAAC,EAAE;YACpCY,IAAI,EAAE,kBAAkB;SACzB,CAAC,CACH,AAAC;QACF,iBAAiB;QACjBX,aAAa,CAACI,OAAO,CAACQ,IAAI,GAAGP,aAAa,CAAC;QAC3CL,aAAa,CAACI,OAAO,CAACS,KAAK,EAAE,CAAC;QAC9B,0CAA0C;QAC1CP,GAAG,CAACQ,eAAe,CAACT,aAAa,CAAC,CAAC;IACrC,CAAC,AAAC;IAEF,qBACE;;0BACE,KAACZ,WAAW;gBAACsB,WAAW,EAAErB,YAAY,CAACsB,iBAAiB;0BACtD,cAAA,KAACpB,iBAAiB;oBAACqB,YAAU,EAAEvB,YAAY,CAACsB,iBAAiB;oBAAEE,OAAO,EAAEf,qBAAqB;oBAAEgB,EAAE,EAAE;wBAAElB,MAAM;qBAAE;8BAC3G,cAAA,KAACT,YAAY,KAAG;kBACE;cACR;0BAId,KAAC4B,GAAC;gBAACC,GAAG,EAAErB,aAAa;gBAAEsB,KAAK,EAAE;oBAAEC,OAAO,EAAE,MAAM;iBAAE;gBAAEC,QAAQ,EAAE,CAAC,EAAEzB,SAAS,CAAC0B,QAAQ,CAACC,IAAI,CAAC,KAAK,CAAC;cAAI;;MACjG,CACH;AACJ,CAAC"}
1
+ {"version":3,"sources":["../../../src/components/DownloadButton/DownloadButton.tsx"],"sourcesContent":["// Copyright 2023 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 { useRef } from 'react';\nimport DownloadIcon from 'mdi-material-ui/DownloadOutline';\nimport { InfoTooltip } from '@perses-dev/components';\nimport { TOOLTIP_TEXT } from '../../constants';\nimport { useDashboard } from '../../context';\nimport { ToolbarIconButton } from '../ToolbarIconButton';\n\ninterface DownloadButtonProps {\n // The button look best at heights >= 28 pixels\n heightPx?: number;\n}\n\n// Button that enables downloading the dashboard as a JSON file\nexport function DownloadButton({ heightPx }: DownloadButtonProps) {\n const { dashboard } = useDashboard();\n const hiddenLinkRef = useRef<HTMLAnchorElement>(null);\n const height = heightPx === undefined ? undefined : `${heightPx}px`;\n\n const onDownloadButtonClick = () => {\n if (!hiddenLinkRef || !hiddenLinkRef.current) return;\n // Create blob URL\n const hiddenLinkUrl = URL.createObjectURL(\n new Blob([JSON.stringify(dashboard)], {\n type: 'application/json',\n })\n );\n // Simulate click\n hiddenLinkRef.current.href = hiddenLinkUrl;\n hiddenLinkRef.current.click();\n // Remove blob URL (for memory management)\n URL.revokeObjectURL(hiddenLinkUrl);\n };\n\n return (\n <>\n <InfoTooltip description={TOOLTIP_TEXT.downloadDashboard}>\n <ToolbarIconButton aria-label={TOOLTIP_TEXT.downloadDashboard} onClick={onDownloadButtonClick} sx={{ height }}>\n <DownloadIcon />\n </ToolbarIconButton>\n </InfoTooltip>\n {/* Hidden link to download the dashboard as a JSON file */}\n {/* eslint-disable jsx-a11y/anchor-has-content */}\n {/* eslint-disable jsx-a11y/anchor-is-valid */}\n <a ref={hiddenLinkRef} style={{ display: 'none' }} download={`${dashboard.metadata.name}.json`} />\n </>\n );\n}\n"],"names":["useRef","DownloadIcon","InfoTooltip","TOOLTIP_TEXT","useDashboard","ToolbarIconButton","DownloadButton","heightPx","dashboard","hiddenLinkRef","height","undefined","onDownloadButtonClick","current","hiddenLinkUrl","URL","createObjectURL","Blob","JSON","stringify","type","href","click","revokeObjectURL","description","downloadDashboard","aria-label","onClick","sx","a","ref","style","display","download","metadata","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,SAASA,MAAM,QAAQ,QAAQ;AAC/B,OAAOC,kBAAkB,kCAAkC;AAC3D,SAASC,WAAW,QAAQ,yBAAyB;AACrD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,iBAAiB,QAAQ,uBAAuB;AAOzD,+DAA+D;AAC/D,OAAO,SAASC,eAAe,EAAEC,SAAQ,EAAuB;IAC9D,MAAM,EAAEC,UAAS,EAAE,GAAGJ;IACtB,MAAMK,gBAAgBT,OAA0B;IAChD,MAAMU,SAASH,aAAaI,YAAYA,YAAY,CAAC,EAAEJ,SAAS,EAAE,CAAC;IAEnE,MAAMK,wBAAwB;QAC5B,IAAI,CAACH,iBAAiB,CAACA,cAAcI,SAAS;QAC9C,kBAAkB;QAClB,MAAMC,gBAAgBC,IAAIC,gBACxB,IAAIC,KAAK;YAACC,KAAKC,UAAUX;SAAW,EAAE;YACpCY,MAAM;QACR;QAEF,iBAAiB;QACjBX,cAAcI,QAAQQ,OAAOP;QAC7BL,cAAcI,QAAQS;QACtB,0CAA0C;QAC1CP,IAAIQ,gBAAgBT;IACtB;IAEA,qBACE;;0BACE,KAACZ;gBAAYsB,aAAarB,aAAasB;0BACrC,cAAA,KAACpB;oBAAkBqB,cAAYvB,aAAasB;oBAAmBE,SAASf;oBAAuBgB,IAAI;wBAAElB;oBAAO;8BAC1G,cAAA,KAACT;;;0BAML,KAAC4B;gBAAEC,KAAKrB;gBAAesB,OAAO;oBAAEC,SAAS;gBAAO;gBAAGC,UAAU,CAAC,EAAEzB,UAAU0B,SAASC,KAAK,KAAK,CAAC;;;;AAGpG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/DownloadButton/index.ts"],"sourcesContent":["// Copyright 2023 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 './DownloadButton';\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,kBAAkB,CAAC"}
1
+ {"version":3,"sources":["../../../src/components/DownloadButton/index.ts"],"sourcesContent":["// Copyright 2023 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 './DownloadButton';\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,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/EditButton/EditButton.tsx"],"sourcesContent":["// Copyright 2023 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 { Button } from '@mui/material';\nimport PencilIcon from 'mdi-material-ui/PencilOutline';\n\nexport interface EditButtonProps {\n /**\n * The label used inside the button.\n */\n label?: string;\n\n /**\n * Handler that puts the dashboard into editing mode.\n */\n onClick: () => void;\n}\n\nexport const EditButton = ({ label = 'Edit', onClick }: EditButtonProps) => {\n return (\n <Button\n onClick={onClick}\n startIcon={<PencilIcon />}\n variant=\"outlined\"\n color=\"secondary\"\n sx={{ whiteSpace: 'nowrap', minWidth: 'auto' }}\n >\n {label}\n </Button>\n );\n};\n"],"names":["Button","PencilIcon","EditButton","label","onClick","startIcon","variant","color","sx","whiteSpace","minWidth"],"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,MAAM,QAAQ,eAAe,CAAC;AACvC,OAAOC,UAAU,MAAM,+BAA+B,CAAC;AAcvD,OAAO,MAAMC,UAAU,GAAG,CAAC,EAAEC,KAAK,EAAG,MAAM,CAAA,EAAEC,OAAO,CAAA,EAAmB,GAAK;IAC1E,qBACE,KAACJ,MAAM;QACLI,OAAO,EAAEA,OAAO;QAChBC,SAAS,gBAAE,KAACJ,UAAU,KAAG;QACzBK,OAAO,EAAC,UAAU;QAClBC,KAAK,EAAC,WAAW;QACjBC,EAAE,EAAE;YAAEC,UAAU,EAAE,QAAQ;YAAEC,QAAQ,EAAE,MAAM;SAAE;kBAE7CP,KAAK;MACC,CACT;AACJ,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../../src/components/EditButton/EditButton.tsx"],"sourcesContent":["// Copyright 2023 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 { Button } from '@mui/material';\nimport PencilIcon from 'mdi-material-ui/PencilOutline';\n\nexport interface EditButtonProps {\n /**\n * The label used inside the button.\n */\n label?: string;\n\n /**\n * Handler that puts the dashboard into editing mode.\n */\n onClick: () => void;\n}\n\nexport const EditButton = ({ label = 'Edit', onClick }: EditButtonProps) => {\n return (\n <Button\n onClick={onClick}\n startIcon={<PencilIcon />}\n variant=\"outlined\"\n color=\"secondary\"\n sx={{ whiteSpace: 'nowrap', minWidth: 'auto' }}\n >\n {label}\n </Button>\n );\n};\n"],"names":["Button","PencilIcon","EditButton","label","onClick","startIcon","variant","color","sx","whiteSpace","minWidth"],"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,SAASA,MAAM,QAAQ,gBAAgB;AACvC,OAAOC,gBAAgB,gCAAgC;AAcvD,OAAO,MAAMC,aAAa,CAAC,EAAEC,OAAQ,OAAM,EAAEC,QAAO,EAAmB;IACrE,qBACE,KAACJ;QACCI,SAASA;QACTC,yBAAW,KAACJ;QACZK,SAAQ;QACRC,OAAM;QACNC,IAAI;YAAEC,YAAY;YAAUC,UAAU;QAAO;kBAE5CP;;AAGP,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/EditButton/index.ts"],"sourcesContent":["// Copyright 2023 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 './EditButton';\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,cAAc,CAAC"}
1
+ {"version":3,"sources":["../../../src/components/EditButton/index.ts"],"sourcesContent":["// Copyright 2023 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 './EditButton';\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,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/EditJsonButton/EditJsonButton.tsx"],"sourcesContent":["// Copyright 2023 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 CodeIcon from 'mdi-material-ui/CodeBraces';\nimport { InfoTooltip } from '@perses-dev/components';\nimport { TOOLTIP_TEXT } from '../../constants';\nimport { ToolbarIconButton } from '../ToolbarIconButton';\nimport { useEditJsonDialog } from '../../context';\n\nexport const EditJsonButton = () => {\n const { openEditJsonDialog } = useEditJsonDialog();\n return (\n <InfoTooltip description={TOOLTIP_TEXT.editJson}>\n <ToolbarIconButton aria-label={TOOLTIP_TEXT.editJson} variant=\"outlined\" onClick={() => openEditJsonDialog()}>\n <CodeIcon />\n </ToolbarIconButton>\n </InfoTooltip>\n );\n};\n"],"names":["CodeIcon","InfoTooltip","TOOLTIP_TEXT","ToolbarIconButton","useEditJsonDialog","EditJsonButton","openEditJsonDialog","description","editJson","aria-label","variant","onClick"],"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,QAAQ,MAAM,4BAA4B,CAAC;AAClD,SAASC,WAAW,QAAQ,wBAAwB,CAAC;AACrD,SAASC,YAAY,QAAQ,iBAAiB,CAAC;AAC/C,SAASC,iBAAiB,QAAQ,sBAAsB,CAAC;AACzD,SAASC,iBAAiB,QAAQ,eAAe,CAAC;AAElD,OAAO,MAAMC,cAAc,GAAG,IAAM;IAClC,MAAM,EAAEC,kBAAkB,CAAA,EAAE,GAAGF,iBAAiB,EAAE,AAAC;IACnD,qBACE,KAACH,WAAW;QAACM,WAAW,EAAEL,YAAY,CAACM,QAAQ;kBAC7C,cAAA,KAACL,iBAAiB;YAACM,YAAU,EAAEP,YAAY,CAACM,QAAQ;YAAEE,OAAO,EAAC,UAAU;YAACC,OAAO,EAAE,IAAML,kBAAkB,EAAE;sBAC1G,cAAA,KAACN,QAAQ,KAAG;UACM;MACR,CACd;AACJ,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../../src/components/EditJsonButton/EditJsonButton.tsx"],"sourcesContent":["// Copyright 2023 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 CodeIcon from 'mdi-material-ui/CodeBraces';\nimport { InfoTooltip } from '@perses-dev/components';\nimport { TOOLTIP_TEXT } from '../../constants';\nimport { ToolbarIconButton } from '../ToolbarIconButton';\nimport { useEditJsonDialog } from '../../context';\n\nexport const EditJsonButton = () => {\n const { openEditJsonDialog } = useEditJsonDialog();\n return (\n <InfoTooltip description={TOOLTIP_TEXT.editJson}>\n <ToolbarIconButton aria-label={TOOLTIP_TEXT.editJson} variant=\"outlined\" onClick={() => openEditJsonDialog()}>\n <CodeIcon />\n </ToolbarIconButton>\n </InfoTooltip>\n );\n};\n"],"names":["CodeIcon","InfoTooltip","TOOLTIP_TEXT","ToolbarIconButton","useEditJsonDialog","EditJsonButton","openEditJsonDialog","description","editJson","aria-label","variant","onClick"],"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,OAAOA,cAAc,6BAA6B;AAClD,SAASC,WAAW,QAAQ,yBAAyB;AACrD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,iBAAiB,QAAQ,uBAAuB;AACzD,SAASC,iBAAiB,QAAQ,gBAAgB;AAElD,OAAO,MAAMC,iBAAiB;IAC5B,MAAM,EAAEC,mBAAkB,EAAE,GAAGF;IAC/B,qBACE,KAACH;QAAYM,aAAaL,aAAaM;kBACrC,cAAA,KAACL;YAAkBM,cAAYP,aAAaM;YAAUE,SAAQ;YAAWC,SAAS,IAAML;sBACtF,cAAA,KAACN;;;AAIT,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/EditJsonButton/index.ts"],"sourcesContent":["// Copyright 2023 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 './EditJsonButton';\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,kBAAkB,CAAC"}
1
+ {"version":3,"sources":["../../../src/components/EditJsonButton/index.ts"],"sourcesContent":["// Copyright 2023 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 './EditJsonButton';\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,mBAAmB"}
@@ -1,3 +1,6 @@
1
1
  /// <reference types="react" />
2
- export declare const EditJsonDialog: () => JSX.Element;
2
+ export interface EditJsonDialogProps {
3
+ disableMetadataEdition?: boolean;
4
+ }
5
+ export declare const EditJsonDialog: (props: EditJsonDialogProps) => JSX.Element;
3
6
  //# sourceMappingURL=EditJsonDialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditJsonDialog.d.ts","sourceRoot":"","sources":["../../../src/components/EditJsonDialog/EditJsonDialog.tsx"],"names":[],"mappings":";AAoBA,eAAO,MAAM,cAAc,mBAS1B,CAAC"}
1
+ {"version":3,"file":"EditJsonDialog.d.ts","sourceRoot":"","sources":["../../../src/components/EditJsonDialog/EditJsonDialog.tsx"],"names":[],"mappings":";AAoBA,MAAM,WAAW,mBAAmB;IAClC,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,eAAO,MAAM,cAAc,UAAW,mBAAmB,gBAUxD,CAAC"}
@@ -17,7 +17,8 @@ import { Dialog, JSONEditor } from '@perses-dev/components';
17
17
  import { useTimeRange } from '@perses-dev/plugin-system';
18
18
  import { useEditJsonDialog } from '../../context/DashboardProvider';
19
19
  import { useDashboard } from '../../context/useDashboard';
20
- export const EditJsonDialog = ()=>{
20
+ export const EditJsonDialog = (props)=>{
21
+ const { disableMetadataEdition } = props;
21
22
  const { editJsonDialog , closeEditJsonDialog } = useEditJsonDialog();
22
23
  return /*#__PURE__*/ _jsxs(Dialog, {
23
24
  open: !!(editJsonDialog === null || editJsonDialog === void 0 ? void 0 : editJsonDialog.isOpen),
@@ -27,13 +28,16 @@ export const EditJsonDialog = ()=>{
27
28
  children: [
28
29
  /*#__PURE__*/ _jsx(Dialog.Header, {
29
30
  onClose: ()=>closeEditJsonDialog(),
30
- children: "Edit Dashboard"
31
+ children: "Edit Dashboard JSON"
31
32
  }),
32
- (editJsonDialog === null || editJsonDialog === void 0 ? void 0 : editJsonDialog.isOpen) && /*#__PURE__*/ _jsx(EditJsonDialogForm, {})
33
+ (editJsonDialog === null || editJsonDialog === void 0 ? void 0 : editJsonDialog.isOpen) && /*#__PURE__*/ _jsx(EditJsonDialogForm, {
34
+ disableMetadataEdition: disableMetadataEdition
35
+ })
33
36
  ]
34
37
  });
35
38
  };
36
- const EditJsonDialogForm = ()=>{
39
+ const EditJsonDialogForm = (props)=>{
40
+ const { disableMetadataEdition } = props;
37
41
  const { closeEditJsonDialog } = useEditJsonDialog();
38
42
  const { setTimeRange , setRefreshInterval } = useTimeRange();
39
43
  const { dashboard , setDashboard } = useDashboard();
@@ -44,8 +48,8 @@ const EditJsonDialogForm = ()=>{
44
48
  setTimeRange({
45
49
  pastDuration: draftDashboard.spec.duration
46
50
  });
47
- var _refreshInterval;
48
- setRefreshInterval((_refreshInterval = draftDashboard.spec.refreshInterval) !== null && _refreshInterval !== void 0 ? _refreshInterval : '0s');
51
+ var _draftDashboard_spec_refreshInterval;
52
+ setRefreshInterval((_draftDashboard_spec_refreshInterval = draftDashboard.spec.refreshInterval) !== null && _draftDashboard_spec_refreshInterval !== void 0 ? _draftDashboard_spec_refreshInterval : '0s');
49
53
  closeEditJsonDialog();
50
54
  };
51
55
  return /*#__PURE__*/ _jsxs(Dialog.Form, {
@@ -56,7 +60,7 @@ const EditJsonDialogForm = ()=>{
56
60
  width: '100%'
57
61
  },
58
62
  children: [
59
- /*#__PURE__*/ _jsx(Alert, {
63
+ disableMetadataEdition && /*#__PURE__*/ _jsx(Alert, {
60
64
  sx: {
61
65
  marginBottom: (theme)=>theme.spacing(1)
62
66
  },
@@ -67,7 +71,7 @@ const EditJsonDialogForm = ()=>{
67
71
  fullWidth: true,
68
72
  children: /*#__PURE__*/ _jsx(JSONEditor, {
69
73
  minHeight: "300px",
70
- maxHeight: "700px",
74
+ maxHeight: "70vh",
71
75
  value: draftDashboard,
72
76
  onChange: (value)=>setDraftDashboard(value)
73
77
  })
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/EditJsonDialog/EditJsonDialog.tsx"],"sourcesContent":["// Copyright 2023 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 { FormEvent, useState } from 'react';\nimport { Alert, FormControl } from '@mui/material';\nimport { Dialog, JSONEditor } from '@perses-dev/components';\nimport { useTimeRange } from '@perses-dev/plugin-system';\nimport { useEditJsonDialog } from '../../context/DashboardProvider';\nimport { useDashboard } from '../../context/useDashboard';\n\nexport const EditJsonDialog = () => {\n const { editJsonDialog, closeEditJsonDialog } = useEditJsonDialog();\n\n return (\n <Dialog open={!!editJsonDialog?.isOpen} scroll=\"paper\" fullWidth maxWidth=\"lg\">\n <Dialog.Header onClose={() => closeEditJsonDialog()}>Edit Dashboard</Dialog.Header>\n {editJsonDialog?.isOpen && <EditJsonDialogForm />}\n </Dialog>\n );\n};\n\nconst EditJsonDialogForm = () => {\n const { closeEditJsonDialog } = useEditJsonDialog();\n const { setTimeRange, setRefreshInterval } = useTimeRange();\n const { dashboard, setDashboard } = useDashboard();\n const [draftDashboard, setDraftDashboard] = useState(dashboard);\n\n const handleApply = (e: FormEvent) => {\n e.preventDefault();\n setDashboard(draftDashboard);\n setTimeRange({ pastDuration: draftDashboard.spec.duration });\n setRefreshInterval(draftDashboard.spec.refreshInterval ?? '0s');\n closeEditJsonDialog();\n };\n\n return (\n <Dialog.Form onSubmit={handleApply}>\n <Dialog.Content sx={{ width: '100%' }}>\n <Alert sx={{ marginBottom: (theme) => theme.spacing(1) }} severity=\"warning\">\n Metadata cannot be modified or saved.\n </Alert>\n <FormControl fullWidth>\n <JSONEditor\n minHeight=\"300px\"\n maxHeight=\"700px\"\n value={draftDashboard}\n onChange={(value) => setDraftDashboard(value)}\n />\n </FormControl>\n </Dialog.Content>\n <Dialog.Actions>\n <Dialog.PrimaryButton onClick={handleApply}>Apply</Dialog.PrimaryButton>\n </Dialog.Actions>\n </Dialog.Form>\n );\n};\n"],"names":["useState","Alert","FormControl","Dialog","JSONEditor","useTimeRange","useEditJsonDialog","useDashboard","EditJsonDialog","editJsonDialog","closeEditJsonDialog","open","isOpen","scroll","fullWidth","maxWidth","Header","onClose","EditJsonDialogForm","setTimeRange","setRefreshInterval","dashboard","setDashboard","draftDashboard","setDraftDashboard","handleApply","e","preventDefault","pastDuration","spec","duration","refreshInterval","Form","onSubmit","Content","sx","width","marginBottom","theme","spacing","severity","minHeight","maxHeight","value","onChange","Actions","PrimaryButton","onClick"],"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,SAAoBA,QAAQ,QAAQ,OAAO,CAAC;AAC5C,SAASC,KAAK,EAAEC,WAAW,QAAQ,eAAe,CAAC;AACnD,SAASC,MAAM,EAAEC,UAAU,QAAQ,wBAAwB,CAAC;AAC5D,SAASC,YAAY,QAAQ,2BAA2B,CAAC;AACzD,SAASC,iBAAiB,QAAQ,iCAAiC,CAAC;AACpE,SAASC,YAAY,QAAQ,4BAA4B,CAAC;AAE1D,OAAO,MAAMC,cAAc,GAAG,IAAM;IAClC,MAAM,EAAEC,cAAc,CAAA,EAAEC,mBAAmB,CAAA,EAAE,GAAGJ,iBAAiB,EAAE,AAAC;IAEpE,qBACE,MAACH,MA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AAC6B,IAAI;QAACC,QAAQ,EAAER,WAAW;;0BAChC,MAACtB,MAAM,CAAC+B,OAAO;gBAACC,EAAE,EAAE;oBAAEC,KAAK,EAAE,MAAM;iBAAE;;kCACnC,KAACnC,KAAK;wBAACkC,EAAE,EAAE;4BAAEE,YAAY,EAAE,CAACC,KAAK,GAAKA,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC;yBAAE;wBAAEC,QAAQ,EAAC,SAAS;kCAAC,uCAE7E;sBAAQ;kCACR,KAACtC,WAAW;wBAACY,SAAS;kCACpB,cAAA,KAACV,UAAU;4BACTqC,SAAS,EAAC,OAAO;4BACjBC,SAAS,EAAC,OAAO;4BACjBC,KAAK,EAAEpB,cAAc;4BACrBqB,QAAQ,EAAE,CAACD,KAAK,GAAKnB,iBAAiB,CAACmB,KAAK,CAAC;0BAC7C;sBACU;;cACC;0BACjB,KAACxC,MAAM,CAAC0C,OAAO;0BACb,cAAA,KAAC1C,MAAM,CAAC2C,aAAa;oBAACC,OAAO,EAAEtB,WAAW;8BAAE,OAAK;kBAAuB;cACzD;;MACL,CACd;AACJ,CAAC,AAAC"}
1
+ {"version":3,"sources":["../../../src/components/EditJsonDialog/EditJsonDialog.tsx"],"sourcesContent":["// Copyright 2023 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 { FormEvent, useState } from 'react';\nimport { Alert, FormControl } from '@mui/material';\nimport { Dialog, JSONEditor } from '@perses-dev/components';\nimport { useTimeRange } from '@perses-dev/plugin-system';\nimport { useEditJsonDialog } from '../../context/DashboardProvider';\nimport { useDashboard } from '../../context/useDashboard';\n\nexport interface EditJsonDialogProps {\n disableMetadataEdition?: boolean;\n}\n\nexport const EditJsonDialog = (props: EditJsonDialogProps) => {\n const { disableMetadataEdition } = props;\n const { editJsonDialog, closeEditJsonDialog } = useEditJsonDialog();\n\n return (\n <Dialog open={!!editJsonDialog?.isOpen} scroll=\"paper\" fullWidth maxWidth=\"lg\">\n <Dialog.Header onClose={() => closeEditJsonDialog()}>Edit Dashboard JSON</Dialog.Header>\n {editJsonDialog?.isOpen && <EditJsonDialogForm disableMetadataEdition={disableMetadataEdition} />}\n </Dialog>\n );\n};\n\nconst EditJsonDialogForm = (props: EditJsonDialogProps) => {\n const { disableMetadataEdition } = props;\n const { closeEditJsonDialog } = useEditJsonDialog();\n const { setTimeRange, setRefreshInterval } = useTimeRange();\n const { dashboard, setDashboard } = useDashboard();\n const [draftDashboard, setDraftDashboard] = useState(dashboard);\n\n const handleApply = (e: FormEvent) => {\n e.preventDefault();\n setDashboard(draftDashboard);\n setTimeRange({ pastDuration: draftDashboard.spec.duration });\n setRefreshInterval(draftDashboard.spec.refreshInterval ?? '0s');\n closeEditJsonDialog();\n };\n\n return (\n <Dialog.Form onSubmit={handleApply}>\n <Dialog.Content sx={{ width: '100%' }}>\n {disableMetadataEdition && (\n <Alert sx={{ marginBottom: (theme) => theme.spacing(1) }} severity=\"warning\">\n Metadata cannot be modified or saved.\n </Alert>\n )}\n <FormControl fullWidth>\n <JSONEditor\n minHeight=\"300px\"\n maxHeight=\"70vh\"\n value={draftDashboard}\n onChange={(value) => setDraftDashboard(value)}\n />\n </FormControl>\n </Dialog.Content>\n <Dialog.Actions>\n <Dialog.PrimaryButton onClick={handleApply}>Apply</Dialog.PrimaryButton>\n </Dialog.Actions>\n </Dialog.Form>\n );\n};\n"],"names":["useState","Alert","FormControl","Dialog","JSONEditor","useTimeRange","useEditJsonDialog","useDashboard","EditJsonDialog","props","disableMetadataEdition","editJsonDialog","closeEditJsonDialog","open","isOpen","scroll","fullWidth","maxWidth","Header","onClose","EditJsonDialogForm","setTimeRange","setRefreshInterval","dashboard","setDashboard","draftDashboard","setDraftDashboard","handleApply","e","preventDefault","pastDuration","spec","duration","refreshInterval","Form","onSubmit","Content","sx","width","marginBottom","theme","spacing","severity","minHeight","maxHeight","value","onChange","Actions","PrimaryButton","onClick"],"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,SAAoBA,QAAQ,QAAQ,QAAQ;AAC5C,SAASC,KAAK,EAAEC,WAAW,QAAQ,gBAAgB;AACnD,SAASC,MAAM,EAAEC,UAAU,QAAQ,yBAAyB;AAC5D,SAASC,YAAY,QAAQ,4BAA4B;AACzD,SAASC,iBAAiB,QAAQ,kCAAkC;AACpE,SAASC,YAAY,QAAQ,6BAA6B;AAM1D,OAAO,MAAMC,iBAAiB,CAACC;IAC7B,MAAM,EAAEC,uBAAsB,EAAE,GAAGD;IACnC,MAAM,EAAEE,eAAc,EAAEC,oBAAmB,EAAE,GAAGN;IAEhD,qBACE,MAACH;QAAOU,MAAM,CAAC,CAACF,CAAAA,2BAAAA,4BAAAA,KAAAA,IAAAA,eAAgBG,MAAK;QAAGC,QAAO;QAAQC,SAAS;QAACC,UAAS;;0BACxE,KAACd,OAAOe;gBAAOC,SAAS,IAAMP;0BAAuB;;YACpDD,CAAAA,2BAAAA,4BAAAA,KAAAA,IAAAA,eAAgBG,MAAK,mBAAK,KAACM;gBAAmBV,wBAAwBA;;;;AAG7E,EAAE;AAEF,MAAMU,qBAAqB,CAACX;IAC1B,MAAM,EAAEC,uBAAsB,EAAE,GAAGD;IACnC,MAAM,EAAEG,oBAAmB,EAAE,GAAGN;IAChC,MAAM,EAAEe,aAAY,EAAEC,mBAAkB,EAAE,GAAGjB;IAC7C,MAAM,EAAEkB,UAAS,EAAEC,aAAY,EAAE,GAAGjB;IACpC,MAAM,CAACkB,gBAAgBC,kBAAkB,GAAG1B,SAASuB;IAErD,MAAMI,cAAc,CAACC;QACnBA,EAAEC;QACFL,aAAaC;QACbJ,aAAa;YAAES,cAAcL,eAAeM,KAAKC;QAAS;YACvCP;QAAnBH,mBAAmBG,CAAAA,uCAAAA,eAAeM,KAAKE,6BAApBR,kDAAAA,uCAAuC;QAC1Db;IACF;IAEA,qBACE,MAACT,OAAO+B;QAAKC,UAAUR;;0BACrB,MAACxB,OAAOiC;gBAAQC,IAAI;oBAAEC,OAAO;gBAAO;;oBACjC5B,wCACC,KAACT;wBAAMoC,IAAI;4BAAEE,cAAc,CAACC,QAAUA,MAAMC,QAAQ;wBAAG;wBAAGC,UAAS;kCAAU;;kCAI/E,KAACxC;wBAAYc,SAAS;kCACpB,cAAA,KAACZ;4BACCuC,WAAU;4BACVC,WAAU;4BACVC,OAAOpB;4BACPqB,UAAU,CAACD,QAAUnB,kBAAkBmB;;;;;0BAI7C,KAAC1C,OAAO4C;0BACN,cAAA,KAAC5C,OAAO6C;oBAAcC,SAAStB;8BAAa;;;;;AAIpD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/EditJsonDialog/index.ts"],"sourcesContent":["// Copyright 2023 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 './EditJsonDialog';\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,kBAAkB,CAAC"}
1
+ {"version":3,"sources":["../../../src/components/EditJsonDialog/index.ts"],"sourcesContent":["// Copyright 2023 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 './EditJsonDialog';\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,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/EmptyDashboard/EmptyDashboard.tsx"],"sourcesContent":["// Copyright 2023 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 { Typography, Box } from '@mui/material';\nimport { useEditMode } from '../../context';\nimport { AddPanelButton } from '../AddPanelButton';\nimport { EditVariablesButton } from '../Variables';\nimport { EditButton } from '../EditButton';\n\nexport interface EmptyDashboardProps {\n /**\n * The title, which should be relatively short text.\n */\n title?: string;\n\n /**\n * Imagery to display above the title.\n */\n image?: React.ReactNode;\n\n /**\n * Descriptive text, which can be a bit longer.\n */\n description?: string;\n\n /**\n * Additional text that will be displayed at the bottom of the empty state.\n * If not specified, no additional text is shown.\n */\n additionalText?: string;\n\n /**\n * Components that are placed below the title and description that include\n * actions for the user to take (e.g. buttons or links). If not specified,\n * the default buttons will be displayed. Set to `false` to disable the default\n * buttons.\n */\n actions?: JSX.Element | boolean;\n\n /**\n * Handler for clicking the edit button when the dashboard is in \"view\" mode.\n * Required when using the default empty state.\n */\n onEditButtonClick?: () => void;\n}\n\nconst DEFAULT_TITLE = \"Let's get started\";\n\nconst DEFAULT_DESCRIPTION = {\n edit: 'We currently support time series charts, gauge charts, stat charts and more!',\n view: 'This dashboard is currently empty. Get started by clicking the edit button.',\n};\n\n// Constants from specifics in designs to make the default messaging look good.\nconst CONTAINER_WIDTH = '450px';\nconst PRIMARY_CONTENT_WIDTH = '289px';\n\nconst COMMON_BUTTON_PROPS = {\n variant: 'outlined',\n color: 'secondary',\n} as const;\n\ntype EmptyDashboardActionsProps = Pick<EmptyDashboardProps, 'actions' | 'onEditButtonClick'> & {\n isEditMode: boolean;\n};\n\nconst EmptyDashboardActions = ({ actions, isEditMode, onEditButtonClick }: EmptyDashboardActionsProps) => {\n if (actions && typeof actions !== 'boolean') {\n // Custom actions\n return actions;\n }\n\n if (actions === false) {\n // Disable default actions\n return null;\n }\n\n if (isEditMode) {\n // Default edit mode actions\n return (\n <>\n <AddPanelButton variant=\"outlined\" color=\"secondary\" label=\"Add Panel\" fullWidth />\n <EditVariablesButton variant=\"outlined\" color=\"secondary\" label=\"Add Variables\" fullWidth />\n </>\n );\n }\n\n if (onEditButtonClick) {\n // Default view mode actions\n return <EditButton {...COMMON_BUTTON_PROPS} label=\"Edit Dashboard\" onClick={onEditButtonClick} />;\n }\n\n return null;\n};\n\n/**\n * Communicate that a dashboard is empty and prompt the user to get started.\n */\nexport const EmptyDashboard = ({\n title = DEFAULT_TITLE,\n image,\n description,\n additionalText,\n actions,\n onEditButtonClick,\n}: EmptyDashboardProps) => {\n const { isEditMode } = useEditMode();\n\n const defaultDescription = isEditMode ? DEFAULT_DESCRIPTION.edit : DEFAULT_DESCRIPTION.view;\n const actionsContent = (\n <EmptyDashboardActions actions={actions} onEditButtonClick={onEditButtonClick} isEditMode={isEditMode} />\n );\n\n return (\n <Box sx={{ width: CONTAINER_WIDTH, textAlign: 'center', margin: '0 auto' }}>\n <Box sx={{ width: PRIMARY_CONTENT_WIDTH, margin: '0 auto' }}>\n {!!image && image}\n <Typography variant=\"h2\" gutterBottom>\n {title}\n </Typography>\n <Typography variant=\"body1\">{description ?? defaultDescription}</Typography>\n {actionsContent && (\n <Box sx={{ display: 'flex', gap: 2, marginTop: 1, justifyContent: 'center' }}>{actionsContent}</Box>\n )}\n </Box>\n {additionalText && (\n <Typography variant=\"subtitle1\" sx={{ marginTop: 12 }}>\n {additionalText}\n </Typography>\n )}\n </Box>\n );\n};\n"],"names":["Typography","Box","useEditMode","AddPanelButton","EditVariablesButton","EditButton","DEFAULT_TITLE","DEFAULT_DESCRIPTION","edit","view","CONTAINER_WIDTH","PRIMARY_CONTENT_WIDTH","COMMON_BUTTON_PROPS","variant","color","EmptyDashboardActions","actions","isEditMode","onEditButtonClick","label","fullWidth","onClick","EmptyDashboard","title","image","description","additionalText","defaultDescription","actionsContent","sx","width","textAlign","margin","gutterBottom","display","gap","marginTop","justifyContent"],"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,UAAU,EAAEC,GAAG,QAAQ,eAAe,CAAC;AAChD,SAASC,WAAW,QAAQ,eAAe,CAAC;AAC5C,SAASC,cAAc,QAAQ,mBAAmB,CAAC;AACnD,SAASC,mBAAmB,QAAQ,cAAc,CAAC;AACnD,SAASC,UAAU,QAAQ,eAAe,CAAC;AAuC3C,MAAMC,aAAa,GAAG,mBAAmB,AAAC;AAE1C,MAAMC,mBA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yDashboard/EmptyDashboard.tsx"],"sourcesContent":["// Copyright 2023 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 { Typography, Box } from '@mui/material';\nimport { useEditMode } from '../../context';\nimport { AddPanelButton } from '../AddPanelButton';\nimport { EditVariablesButton } from '../Variables';\nimport { EditButton } from '../EditButton';\n\nexport interface EmptyDashboardProps {\n /**\n * The title, which should be relatively short text.\n */\n title?: string;\n\n /**\n * Imagery to display above the title.\n */\n image?: React.ReactNode;\n\n /**\n * Descriptive text, which can be a bit longer.\n */\n description?: string;\n\n /**\n * Additional text that will be displayed at the bottom of the empty state.\n * If not specified, no additional text is shown.\n */\n additionalText?: string;\n\n /**\n * Components that are placed below the title and description that include\n * actions for the user to take (e.g. buttons or links). If not specified,\n * the default buttons will be displayed. Set to `false` to disable the default\n * buttons.\n */\n actions?: JSX.Element | boolean;\n\n /**\n * Handler for clicking the edit button when the dashboard is in \"view\" mode.\n * Required when using the default empty state.\n */\n onEditButtonClick?: () => void;\n}\n\nconst DEFAULT_TITLE = \"Let's get started\";\n\nconst DEFAULT_DESCRIPTION = {\n edit: 'We currently support time series charts, gauge charts, stat charts and more!',\n view: 'This dashboard is currently empty. Get started by clicking the edit button.',\n};\n\n// Constants from specifics in designs to make the default messaging look good.\nconst CONTAINER_WIDTH = '450px';\nconst PRIMARY_CONTENT_WIDTH = '289px';\n\nconst COMMON_BUTTON_PROPS = {\n variant: 'outlined',\n color: 'secondary',\n} as const;\n\ntype EmptyDashboardActionsProps = Pick<EmptyDashboardProps, 'actions' | 'onEditButtonClick'> & {\n isEditMode: boolean;\n};\n\nconst EmptyDashboardActions = ({ actions, isEditMode, onEditButtonClick }: EmptyDashboardActionsProps) => {\n if (actions && typeof actions !== 'boolean') {\n // Custom actions\n return actions;\n }\n\n if (actions === false) {\n // Disable default actions\n return null;\n }\n\n if (isEditMode) {\n // Default edit mode actions\n return (\n <>\n <AddPanelButton variant=\"outlined\" color=\"secondary\" label=\"Add Panel\" fullWidth />\n <EditVariablesButton variant=\"outlined\" color=\"secondary\" label=\"Add Variables\" fullWidth />\n </>\n );\n }\n\n if (onEditButtonClick) {\n // Default view mode actions\n return <EditButton {...COMMON_BUTTON_PROPS} label=\"Edit Dashboard\" onClick={onEditButtonClick} />;\n }\n\n return null;\n};\n\n/**\n * Communicate that a dashboard is empty and prompt the user to get started.\n */\nexport const EmptyDashboard = ({\n title = DEFAULT_TITLE,\n image,\n description,\n additionalText,\n actions,\n onEditButtonClick,\n}: EmptyDashboardProps) => {\n const { isEditMode } = useEditMode();\n\n const defaultDescription = isEditMode ? DEFAULT_DESCRIPTION.edit : DEFAULT_DESCRIPTION.view;\n const actionsContent = (\n <EmptyDashboardActions actions={actions} onEditButtonClick={onEditButtonClick} isEditMode={isEditMode} />\n );\n\n return (\n <Box sx={{ width: CONTAINER_WIDTH, textAlign: 'center', margin: '0 auto' }}>\n <Box sx={{ width: PRIMARY_CONTENT_WIDTH, margin: '0 auto' }}>\n {!!image && image}\n <Typography variant=\"h2\" gutterBottom>\n {title}\n </Typography>\n <Typography variant=\"body1\">{description ?? defaultDescription}</Typography>\n {actionsContent && (\n <Box sx={{ display: 'flex', gap: 2, marginTop: 1, justifyContent: 'center' }}>{actionsContent}</Box>\n )}\n </Box>\n {additionalText && (\n <Typography variant=\"subtitle1\" sx={{ marginTop: 12 }}>\n {additionalText}\n </Typography>\n )}\n </Box>\n );\n};\n"],"names":["Typography","Box","useEditMode","AddPanelButton","EditVariablesButton","EditButton","DEFAULT_TITLE","DEFAULT_DESCRIPTION","edit","view","CONTAINER_WIDTH","PRIMARY_CONTENT_WIDTH","COMMON_BUTTON_PROPS","variant","color","EmptyDashboardActions","actions","isEditMode","onEditButtonClick","label","fullWidth","onClick","EmptyDashboard","title","image","description","additionalText","defaultDescription","actionsContent","sx","width","textAlign","margin","gutterBottom","display","gap","marginTop","justifyContent"],"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,SAASA,UAAU,EAAEC,GAAG,QAAQ,gBAAgB;AAChD,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,mBAAmB,QAAQ,eAAe;AACnD,SAASC,UAAU,QAAQ,gBAAgB;AAuC3C,MAAMC,gBAAgB;AAEtB,MAAMC,sBAAsB;IAC1BC,MAAM;IACNC,MAAM;AACR;AAEA,+EAA+E;AAC/E,MAAMC,kBAAkB;AACxB,MAAMC,wBAAwB;AAE9B,MAAMC,sBAAsB;IAC1BC,SAAS;IACTC,OAAO;AACT;AAMA,MAAMC,wBAAwB,CAAC,EAAEC,QAAO,EAAEC,WAAU,EAAEC,kBAAiB,EAA8B;IACnG,IAAIF,WAAW,OAAOA,YAAY,WAAW;QAC3C,iBAAiB;QACjB,OAAOA;IACT;IAEA,IAAIA,YAAY,OAAO;QACrB,0BAA0B;QAC1B,OAAO;IACT;IAEA,IAAIC,YAAY;QACd,4BAA4B;QAC5B,qBACE;;8BACE,KAACd;oBAAeU,SAAQ;oBAAWC,OAAM;oBAAYK,OAAM;oBAAYC,SAAS;;8BAChF,KAAChB;oBAAoBS,SAAQ;oBAAWC,OAAM;oBAAYK,OAAM;oBAAgBC,SAAS;;;;IAG/F;IAEA,IAAIF,mBAAmB;QACrB,4BAA4B;QAC5B,qBAAO,KAACb;YAAY,GAAGO,mBAAmB;YAAEO,OAAM;YAAiBE,SAASH;;IAC9E;IAEA,OAAO;AACT;AAEA;;CAEC,GACD,OAAO,MAAMI,iBAAiB,CAAC,EAC7BC,OAAQjB,cAAa,EACrBkB,MAAK,EACLC,YAAW,EACXC,eAAc,EACdV,QAAO,EACPE,kBAAiB,EACG;IACpB,MAAM,EAAED,WAAU,EAAE,GAAGf;IAEvB,MAAMyB,qBAAqBV,aAAaV,oBAAoBC,OAAOD,oBAAoBE;IACvF,MAAMmB,+BACJ,KAACb;QAAsBC,SAASA;QAASE,mBAAmBA;QAAmBD,YAAYA;;IAG7F,qBACE,MAAChB;QAAI4B,IAAI;YAAEC,OAAOpB;YAAiBqB,WAAW;YAAUC,QAAQ;QAAS;;0BACvE,MAAC/B;gBAAI4B,IAAI;oBAAEC,OAAOnB;oBAAuBqB,QAAQ;gBAAS;;oBACvD,CAAC,CAACR,SAASA;kCACZ,KAACxB;wBAAWa,SAAQ;wBAAKoB,YAAY;kCAClCV;;kCAEH,KAACvB;wBAAWa,SAAQ;kCAASY,wBAAAA,yBAAAA,cAAeE;;oBAC3CC,gCACC,KAAC3B;wBAAI4B,IAAI;4BAAEK,SAAS;4BAAQC,KAAK;4BAAGC,WAAW;4BAAGC,gBAAgB;wBAAS;kCAAIT;;;;YAGlFF,gCACC,KAAC1B;gBAAWa,SAAQ;gBAAYgB,IAAI;oBAAEO,WAAW;gBAAG;0BACjDV;;;;AAKX,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/EmptyDashboard/index.ts"],"sourcesContent":["// Copyright 2023 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 './EmptyDashboard';\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,kBAAkB,CAAC"}
1
+ {"version":3,"sources":["../../../src/components/EmptyDashboard/index.ts"],"sourcesContent":["// Copyright 2023 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 './EmptyDashboard';\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,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/GridLayout/GridContainer.tsx"],"sourcesContent":["// Copyright 2023 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 { useEffect, useState } from 'react';\nimport { styled } from '@mui/material';\n\nexport interface GridContainerProps {\n children: React.ReactNode;\n}\n\nexport function GridContainer(props: GridContainerProps) {\n const [isFirstRender, setIsFirstRender] = useState(true);\n useEffect(() => {\n if (isFirstRender) {\n setIsFirstRender(false);\n }\n }, [isFirstRender]);\n\n return (\n <ReactGridLayoutContainer\n sx={{\n // This adds spcing between grids (rows) in the overall dashboard\n '& + &': { marginTop: (theme) => theme.spacing(1) },\n // This disables the animation of grid items when a grid is first rendered\n // (see https://github.com/react-grid-layout/react-grid-layout/issues/103)\n '& .react-grid-item.cssTransforms': { transitionProperty: isFirstRender ? 'none' : 'transform' },\n }}\n data-testid=\"panel-group\"\n >\n {props.children}\n </ReactGridLayoutContainer>\n );\n}\n\n/**\n * These are the classes needed by react-grid-layout from their CSS stylesheet.\n */\nconst ReactGridLayoutContainer = styled('section')(({ theme }) => ({\n '& .react-grid-layout': {\n position: 'relative',\n transition: 'height 200ms ease',\n },\n '& .react-grid-item': {\n transition: 'all 200ms ease',\n transitionProperty: 'left, top',\n },\n '& .react-grid-item img': {\n pointerEvents: 'none',\n userSelect: 'none',\n },\n '& .react-grid-item.cssTransforms': {\n transitionProperty: 'transform',\n },\n '& .react-grid-item.resizing': {\n zIndex: 1,\n willChange: 'width, height',\n },\n '& .react-grid-item.react-draggable-dragging': {\n transition: 'none',\n zIndex: 3,\n willChange: 'transform',\n },\n '& .react-grid-item.dropping': {\n visibility: 'hidden',\n },\n '& .react-grid-item.react-grid-placeholder': {\n background: theme.palette.primary.main,\n opacity: 0.2,\n transitionDuration: '100ms',\n zIndex: 2,\n userSelect: 'none',\n WebkitUserSelect: 'none',\n MozUserSelect: 'none',\n msUserSelect: 'none',\n OUserSelect: 'none',\n },\n\n '& .react-grid-item > .react-resizable-handle': {\n position: 'absolute',\n width: '20px',\n height: '20px',\n },\n '& .react-grid-item > .react-resizable-handle::after': {\n content: '\"\"',\n position: 'absolute',\n right: '3px',\n bottom: '3px',\n width: '5px',\n height: '5px',\n borderRight: `2px solid ${theme.palette.text.secondary}`,\n borderBottom: `2px solid ${theme.palette.text.secondary}`,\n },\n\n '& .react-resizable-hide > .react-resizable-handle': {\n display: 'none',\n },\n\n '& .react-grid-item > .react-resizable-handle.react-resizable-handle-sw': {\n bottom: '0',\n left: '0',\n cursor: 'sw-resize',\n transform: 'rotate(90deg)',\n },\n '& .react-grid-item > .react-resizable-handle.react-resizable-handle-se': {\n bottom: '0',\n right: '0',\n cursor: 'se-resize',\n },\n '& .react-grid-item > .react-resizable-handle.react-resizable-handle-nw': {\n top: '0',\n left: '0',\n cursor: 'nw-resize',\n transform: 'rotate(180deg)',\n },\n '& .react-grid-item > .react-resizable-handle.react-resizable-handle-ne': {\n top: '0',\n right: '0',\n cursor: 'ne-resize',\n transform: 'rotate(270deg)',\n },\n '& .react-grid-item > .react-resizable-handle.react-resizable-handle-w, &.react-grid-item > .react-resizable-handle.react-resizable-handle-e':\n {\n top: '50%',\n marginTop: '-10px',\n cursor: 'ew-resize',\n },\n '& .react-grid-item > .react-resizable-handle.react-resizable-handle-w': {\n left: '0',\n transform: 'rotate(135deg)',\n },\n '& .react-grid-item > .react-resizable-handle.react-resizable-handle-e': {\n right: '0',\n transform: 'rotate(315deg)',\n },\n '& .react-grid-item > .react-resizable-handle.react-resizable-handle-n, &.react-grid-item > .react-resizable-handle.react-resizable-handle-s':\n {\n left: '50%',\n marginLeft: '-10px',\n cursor: 'ns-resize',\n },\n '& .react-grid-item > .react-resizable-handle.react-resizable-handle-n': {\n top: '0',\n transform: 'rotate(225deg)',\n },\n '& .react-grid-item > .react-resizable-handle.react-resizable-handle-s': {\n bottom: '0',\n transform: 'rotate(45deg)',\n },\n '& .react-resizable': {\n position: 'relative',\n },\n '& .react-resizable-handle': {\n position: 'absolute',\n width: '20px',\n height: '20px',\n backgroundRepeat: 'no-repeat',\n backgroundOrigin: 'content-box',\n boxSizing: 'border-box',\n backgroundImage: `url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+')`,\n backgroundPosition: 'bottom right',\n padding: '0 3px 3px 0',\n },\n '& .react-resizable-handle-sw': {\n bottom: '0',\n left: '0',\n cursor: 'sw-resize',\n transform: 'rotate(90deg)',\n },\n '& .react-resizable-handle-se': {\n bottom: '0',\n right: '0',\n cursor: 'se-resize',\n },\n '& .react-resizable-handle-nw': {\n top: '0',\n left: '0',\n cursor: 'nw-resize',\n transform: 'rotate(180deg)',\n },\n '& .react-resizable-handle-ne': {\n top: '0',\n right: '0',\n cursor: 'ne-resize',\n transform: 'rotate(270deg)',\n },\n '& .react-resizable-handle-w, .react-resizable-handle-e': {\n top: '50%',\n marginTop: '-10px',\n cursor: 'ew-resize',\n },\n '& .react-resizable-handle-w': {\n left: '0',\n transform: 'rotate(135deg)',\n },\n '& .react-resizable-handle-e': {\n right: '0',\n transform: 'rotate(315deg)',\n },\n '& .react-resizable-handle-n, .react-resizable-handle-s': {\n left: '50%',\n marginLeft: '-10px',\n cursor: 'ns-resize',\n },\n '& .react-resizable-handle-n': {\n top: '0',\n transform: 'rotate(225deg)',\n },\n '& .react-resizable-handle-s': {\n bottom: '0',\n transform: 'rotate(45deg)',\n },\n}));\n"],"names":["useEffect","useState","styled","GridContainer","props","isFirstRender","setIsFirstRender","ReactGridLayoutContainer","sx","marginTop","theme","spacing","transitionProperty","data-testid","children","position","transition","pointerEvents","userSelect","zIndex","willChange","visibility","background","palette","primary","main","opacity","transitionDuration","WebkitUserSelect","MozUserSelect","msUserSelect","OUserSelect","width","height","content","right","bottom","borderRight","text","secondary","borderBottom","display","left","cursor","transform","top","mar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EAAE,cAAc;YAClCC,OAAO,EAAE,aAAa;SACvB;QACD,8BAA8B,EAAE;YAC9BhB,MAAM,EAAE,GAAG;YACXM,IAAI,EAAE,GAAG;YACTC,MAAM,EAAE,WAAW;YACnBC,SAAS,EAAE,eAAe;SAC3B;QACD,8BAA8B,EAAE;YAC9BR,MAAM,EAAE,GAAG;YACXD,KAAK,EAAE,GAAG;YACVQ,MAAM,EAAE,WAAW;SACpB;QACD,8BAA8B,EAAE;YAC9BE,GAAG,EAAE,GAAG;YACRH,IAAI,EAAE,GAAG;YACTC,MAAM,EAAE,WAAW;YACnBC,SAAS,EAAE,gBAAgB;SAC5B;QACD,8BAA8B,EAAE;YAC9BC,GAAG,EAAE,GAAG;YACRV,KAAK,EAAE,GAAG;YACVQ,MAAM,EAAE,WAAW;YACnBC,SAAS,EAAE,gBAAgB;SAC5B;QACD,wDAAwD,EAAE;YACxDC,GAAG,EAAE,KAAK;YACVpC,SAAS,EAAE,OAAO;YAClBkC,MAAM,EAAE,WAAW;SACpB;QACD,6BAA6B,EAAE;YAC7BD,IAAI,EAAE,GAAG;YACTE,SAAS,EAAE,gBAAgB;SAC5B;QACD,6BAA6B,EAAE;YAC7BT,KAAK,EAAE,GAAG;YACVS,SAAS,EAAE,gBAAgB;SAC5B;QACD,wDAAwD,EAAE;YACxDF,IAAI,EAAE,KAAK;YACXI,UAAU,EAAE,OAAO;YACnBH,MAAM,EAAE,WAAW;SACpB;QACD,6BAA6B,EAAE;YAC7BE,GAAG,EAAE,GAAG;YACRD,SAAS,EAAE,gBAAgB;SAC5B;QACD,6BAA6B,EAAE;YAC7BR,MAAM,EAAE,GAAG;YACXQ,SAAS,EAAE,eAAe;SAC3B;KACF,CAAA,AAAC,CAAC,AAAC"}
1
+ {"version":3,"sources":["../../../src/components/GridLayout/GridContainer.tsx"],"sourcesContent":["// Copyright 2023 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 { useEffect, useState } from 'react';\nimport { styled } from '@mui/material';\n\nexport interface GridContainerProps {\n children: React.ReactNode;\n}\n\nexport function GridContainer(props: GridContainerProps) {\n const [isFirstRender, setIsFirstRender] = useState(true);\n useEffect(() => {\n if (isFirstRender) {\n setIsFirstRender(false);\n }\n }, [isFirstRender]);\n\n return (\n <ReactGridLayoutContainer\n sx={{\n // This adds spcing between grids (rows) in the overall dashboard\n '& + &': { marginTop: (theme) => theme.spacing(1) },\n // This disables the animation of grid items when a grid is first rendered\n // (see https://github.com/react-grid-layout/react-grid-layout/issues/103)\n '& .react-grid-item.cssTransforms': { transitionProperty: isFirstRender ? 'none' : 'transform' },\n }}\n data-testid=\"panel-group\"\n >\n {props.children}\n </ReactGridLayoutContainer>\n );\n}\n\n/**\n * These are the classes needed by react-grid-layout from their CSS stylesheet.\n */\nconst ReactGridLayoutContainer = styled('section')(({ theme }) => ({\n '& .react-grid-layout': {\n position: 'relative',\n transition: 'height 200ms ease',\n },\n '& .react-grid-item': {\n transition: 'all 200ms ease',\n transitionProperty: 'left, top',\n },\n '& .react-grid-item img': {\n pointerEvents: 'none',\n userSelect: 'none',\n },\n '& .react-grid-item.cssTransforms': {\n transitionProperty: 'transform',\n },\n '& .react-grid-item.resizing': {\n zIndex: 1,\n willChange: 'width, height',\n },\n '& .react-grid-item.react-draggable-dragging': {\n transition: 'none',\n zIndex: 3,\n willChange: 'transform',\n },\n '& .react-grid-item.dropping': {\n visibility: 'hidden',\n },\n '& .react-grid-item.react-grid-placeholder': {\n background: theme.palette.primary.main,\n opacity: 0.2,\n transitionDuration: '100ms',\n zIndex: 2,\n userSelect: 'none',\n WebkitUserSelect: 'none',\n MozUserSelect: 'none',\n msUserSelect: 'none',\n OUserSelect: 'none',\n },\n\n '& .react-grid-item > .react-resizable-handle': {\n position: 'absolute',\n width: '20px',\n height: '20px',\n },\n '& .react-grid-item > .react-resizable-handle::after': {\n content: '\"\"',\n position: 'absolute',\n right: '3px',\n bottom: '3px',\n width: '5px',\n height: '5px',\n borderRight: `2px solid ${theme.palette.text.secondary}`,\n borderBottom: `2px solid ${theme.palette.text.secondary}`,\n },\n\n '& .react-resizable-hide > .react-resizable-handle': {\n display: 'none',\n },\n\n '& .react-grid-item > .react-resizable-handle.react-resizable-handle-sw': {\n bottom: '0',\n left: '0',\n cursor: 'sw-resize',\n transform: 'rotate(90deg)',\n },\n '& .react-grid-item > .react-resizable-handle.react-resizable-handle-se': {\n bottom: '0',\n right: '0',\n cursor: 'se-resize',\n },\n '& .react-grid-item > .react-resizable-handle.react-resizable-handle-nw': {\n top: '0',\n left: '0',\n cursor: 'nw-resize',\n transform: 'rotate(180deg)',\n },\n '& .react-grid-item > .react-resizable-handle.react-resizable-handle-ne': {\n top: '0',\n right: '0',\n cursor: 'ne-resize',\n transform: 'rotate(270deg)',\n },\n '& .react-grid-item > .react-resizable-handle.react-resizable-handle-w, &.react-grid-item > .react-resizable-handle.react-resizable-handle-e':\n {\n top: '50%',\n marginTop: '-10px',\n cursor: 'ew-resize',\n },\n '& .react-grid-item > .react-resizable-handle.react-resizable-handle-w': {\n left: '0',\n transform: 'rotate(135deg)',\n },\n '& .react-grid-item > .react-resizable-handle.react-resizable-handle-e': {\n right: '0',\n transform: 'rotate(315deg)',\n },\n '& .react-grid-item > .react-resizable-handle.react-resizable-handle-n, &.react-grid-item > .react-resizable-handle.react-resizable-handle-s':\n {\n left: '50%',\n marginLeft: '-10px',\n cursor: 'ns-resize',\n },\n '& .react-grid-item > .react-resizable-handle.react-resizable-handle-n': {\n top: '0',\n transform: 'rotate(225deg)',\n },\n '& .react-grid-item > .react-resizable-handle.react-resizable-handle-s': {\n bottom: '0',\n transform: 'rotate(45deg)',\n },\n '& .react-resizable': {\n position: 'relative',\n },\n '& .react-resizable-handle': {\n position: 'absolute',\n width: '20px',\n height: '20px',\n backgroundRepeat: 'no-repeat',\n backgroundOrigin: 'content-box',\n boxSizing: 'border-box',\n backgroundImage: `url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+')`,\n backgroundPosition: 'bottom right',\n padding: '0 3px 3px 0',\n },\n '& .react-resizable-handle-sw': {\n bottom: '0',\n left: '0',\n cursor: 'sw-resize',\n transform: 'rotate(90deg)',\n },\n '& .react-resizable-handle-se': {\n bottom: '0',\n right: '0',\n cursor: 'se-resize',\n },\n '& .react-resizable-handle-nw': {\n top: '0',\n left: '0',\n cursor: 'nw-resize',\n transform: 'rotate(180deg)',\n },\n '& .react-resizable-handle-ne': {\n top: '0',\n right: '0',\n cursor: 'ne-resize',\n transform: 'rotate(270deg)',\n },\n '& .react-resizable-handle-w, .react-resizable-handle-e': {\n top: '50%',\n marginTop: '-10px',\n cursor: 'ew-resize',\n },\n '& .react-resizable-handle-w': {\n left: '0',\n transform: 'rotate(135deg)',\n },\n '& .react-resizable-handle-e': {\n right: '0',\n transform: 'rotate(315deg)',\n },\n '& .react-resizable-handle-n, .react-resizable-handle-s': {\n left: '50%',\n marginLeft: '-10px',\n cursor: 'ns-resize',\n },\n '& .react-resizable-handle-n': {\n top: '0',\n transform: 'rotate(225deg)',\n },\n '& .react-resizable-handle-s': {\n bottom: '0',\n transform: 'rotate(45deg)',\n },\n}));\n"],"names":["useEffect","useState","styled","GridContainer","props","isFirstRender","setIsFirstRender","ReactGridLayoutContainer","sx","marginTop","theme","spacing","transitionProperty","data-testid","children","position","transition","pointerEvents","userSelect","zIndex","willChange","visibility","background","palette","primary","main","opacity","transitionDuration","WebkitUserSelect","MozUserSelect","msUserSelect","OUserSelect","width","height","content","right","bottom","borderRight","text","secondary","borderBottom","display","left","cursor","transform","top","marginLeft","backgroundRepeat","backgroundOrigin","boxSizing","backgroundImage","backgroundPosition","padding"],"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,SAASA,SAAS,EAAEC,QAAQ,QAAQ,QAAQ;AAC5C,SAASC,MAAM,QAAQ,gBAAgB;AAMvC,OAAO,SAASC,cAAcC,KAAyB;IACrD,MAAM,CAACC,eAAeC,iBAAiB,GAAGL,SAAS;IACnDD,UAAU;QACR,IAAIK,eAAe;YACjBC,iBAAiB;QACnB;IACF,GAAG;QAACD;KAAc;IAElB,qBACE,KAACE;QACCC,IAAI;YACF,iEAAiE;YACjE,SAAS;gBAAEC,WAAW,CAACC,QAAUA,MAAMC,QAAQ;YAAG;YAClD,0EAA0E;YAC1E,0EAA0E;YAC1E,oCAAoC;gBAAEC,oBAAoBP,gBAAgB,SAAS;YAAY;QACjG;QACAQ,eAAY;kBAEXT,MAAMU;;AAGb;AAEA;;CAEC,GACD,MAAMP,2BAA2BL,OAAO,WAAW,CAAC,EAAEQ,MAAK,EAAE,GAAM,CAAA;QACjE,wBAAwB;YACtBK,UAAU;YACVC,YAAY;QACd;QACA,sBAAsB;YACpBA,YAAY;YACZJ,oBAAoB;QACtB;QACA,0BAA0B;YACxBK,eAAe;YACfC,YAAY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7B,UAAU;QACZ;QACA,6BAA6B;YAC3BA,UAAU;YACViB,OAAO;YACPC,QAAQ;YACRc,kBAAkB;YAClBC,kBAAkB;YAClBC,WAAW;YACXC,iBAAiB,CAAC,qXAAqX,CAAC;YACxYC,oBAAoB;YACpBC,SAAS;QACX;QACA,gCAAgC;YAC9BhB,QAAQ;YACRM,MAAM;YACNC,QAAQ;YACRC,WAAW;QACb;QACA,gCAAgC;YAC9BR,QAAQ;YACRD,OAAO;YACPQ,QAAQ;QACV;QACA,gCAAgC;YAC9BE,KAAK;YACLH,MAAM;YACNC,QAAQ;YACRC,WAAW;QACb;QACA,gCAAgC;YAC9BC,KAAK;YACLV,OAAO;YACPQ,QAAQ;YACRC,WAAW;QACb;QACA,0DAA0D;YACxDC,KAAK;YACLpC,WAAW;YACXkC,QAAQ;QACV;QACA,+BAA+B;YAC7BD,MAAM;YACNE,WAAW;QACb;QACA,+BAA+B;YAC7BT,OAAO;YACPS,WAAW;QACb;QACA,0DAA0D;YACxDF,MAAM;YACNI,YAAY;YACZH,QAAQ;QACV;QACA,+BAA+B;YAC7BE,KAAK;YACLD,WAAW;QACb;QACA,+BAA+B;YAC7BR,QAAQ;YACRQ,WAAW;QACb;IACF,CAAA"}
@@ -1,8 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import { PanelGroupItemId } from '../../context';
3
+ import { PanelOptions } from '../Panel';
3
4
  export interface GridItemContentProps {
4
5
  panelGroupItemId: PanelGroupItemId;
5
6
  width: number;
7
+ panelOptions?: PanelOptions;
6
8
  }
7
9
  /**
8
10
  * Resolves the reference to panel content in a GridItemDefinition and renders the panel.
@@ -1 +1 @@
1
- {"version":3,"file":"GridItemContent.d.ts","sourceRoot":"","sources":["../../../src/components/GridLayout/GridItemContent.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,gBAAgB,EAA0C,MAAM,eAAe,CAAC;AAIzF,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,eAkC1D"}
1
+ {"version":3,"file":"GridItemContent.d.ts","sourceRoot":"","sources":["../../../src/components/GridLayout/GridItemContent.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,gBAAgB,EAA0C,MAAM,eAAe,CAAC;AAGzF,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,eAuD1D"}
@@ -11,6 +11,8 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { Box } from '@mui/material';
15
+ import { useInView } from 'react-intersection-observer';
14
16
  import { DataQueriesProvider } from '@perses-dev/plugin-system';
15
17
  import { useEditMode, usePanel, usePanelActions } from '../../context';
16
18
  import { useSuggestedStepMs } from '../../utils';
@@ -20,9 +22,14 @@ import { Panel } from '../Panel/Panel';
20
22
  */ export function GridItemContent(props) {
21
23
  const { panelGroupItemId , width } = props;
22
24
  const panelDefinition = usePanel(panelGroupItemId);
23
- const { spec: { queries } , } = panelDefinition;
25
+ const { spec: { queries } } = panelDefinition;
24
26
  const { isEditMode } = useEditMode();
25
27
  const { openEditPanel , openDeletePanelDialog , duplicatePanel } = usePanelActions(panelGroupItemId);
28
+ const { ref , inView } = useInView({
29
+ threshold: 0.2,
30
+ initialInView: false,
31
+ triggerOnce: true
32
+ });
26
33
  // Provide actions to the panel when in edit mode
27
34
  let editHandlers = undefined;
28
35
  if (isEditMode) {
@@ -41,14 +48,26 @@ import { Panel } from '../Panel/Panel';
41
48
  spec: query.spec.plugin.spec
42
49
  };
43
50
  });
44
- return /*#__PURE__*/ _jsx(DataQueriesProvider, {
45
- definitions: definitions,
46
- options: {
47
- suggestedStepMs
51
+ return /*#__PURE__*/ _jsx(Box, {
52
+ ref: ref,
53
+ sx: {
54
+ width: '100%',
55
+ height: '100%'
48
56
  },
49
- children: /*#__PURE__*/ _jsx(Panel, {
50
- definition: panelDefinition,
51
- editHandlers: editHandlers
57
+ children: /*#__PURE__*/ _jsx(DataQueriesProvider, {
58
+ definitions: definitions,
59
+ options: {
60
+ suggestedStepMs
61
+ },
62
+ queryOptions: {
63
+ enabled: inView
64
+ },
65
+ children: inView && /*#__PURE__*/ _jsx(Panel, {
66
+ definition: panelDefinition,
67
+ editHandlers: editHandlers,
68
+ panelOptions: props.panelOptions,
69
+ panelGroupItemId: panelGroupItemId
70
+ })
52
71
  })
53
72
  });
54
73
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/GridLayout/GridItemContent.tsx"],"sourcesContent":["// Copyright 2023 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 { QueryDefinition } from '@perses-dev/core';\nimport { DataQueriesProvider } from '@perses-dev/plugin-system';\nimport { PanelGroupItemId, useEditMode, usePanel, usePanelActions } from '../../context';\nimport { useSuggestedStepMs } from '../../utils';\nimport { Panel, PanelProps } from '../Panel/Panel';\n\nexport interface GridItemContentProps {\n panelGroupItemId: PanelGroupItemId;\n width: number; // necessary for determining the suggested step ms\n}\n\n/**\n * Resolves the reference to panel content in a GridItemDefinition and renders the panel.\n */\nexport function GridItemContent(props: GridItemContentProps) {\n const { panelGroupItemId, width } = props;\n const panelDefinition = usePanel(panelGroupItemId);\n const {\n spec: { queries },\n } = panelDefinition;\n const { isEditMode } = useEditMode();\n const { openEditPanel, openDeletePanelDialog, duplicatePanel } = usePanelActions(panelGroupItemId);\n\n // Provide actions to the panel when in edit mode\n let editHandlers: PanelProps['editHandlers'] = undefined;\n if (isEditMode) {\n editHandlers = {\n onEditPanelClick: openEditPanel,\n onDuplicatePanelClick: duplicatePanel,\n onDeletePanelClick: openDeletePanelDialog,\n };\n }\n\n // map TimeSeriesQueryDefinition to Definition<UnknownSpec>\n const suggestedStepMs = useSuggestedStepMs(width);\n const queryDefinitions = queries ?? [];\n const definitions = queryDefinitions.map((query: QueryDefinition) => {\n return {\n kind: query.spec.plugin.kind,\n spec: query.spec.plugin.spec,\n };\n });\n\n return (\n <DataQueriesProvider definitions={definitions} options={{ suggestedStepMs }}>\n <Panel definition={panelDefinition} editHandlers={editHandlers} />\n </DataQueriesProvider>\n );\n}\n"],"names":["DataQueriesProvider","useEditMode","usePanel","usePanelActions","useSuggestedStepMs","Panel","GridItemContent","props","panelGroupItemId","width","panelDefinition","spec","queries","isEditMode","openEditPanel","openDeletePanelDialog","duplicatePanel","editHandlers","undefined","onEditPanelClick","onDuplicatePanelClick","onDeletePanelClick","suggestedStepMs","queryDefinitions","definitions","map","query","kind","plugin","options","definition"],"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;AACA,SAASA,mBAAmB,QAAQ,2BAA2B,CAAC;AAChE,SAA2BC,WAAW,EAAEC,QAAQ,EAAEC,eAAe,QAAQ,eAAe,CAAC;AACzF,SAASC,kBAAkB,QAAQ,aAAa,CAAC;AACjD,SAASC,KAAK,QAAoB,gBAAgB,CAAC;AAOnD;;CAEC,GACD,OAAO,SAASC,eAAe,CAACC,KAA2B,EAAE;IAC3D,MAAM,E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sources":["../../../src/components/GridLayout/GridItemContent.tsx"],"sourcesContent":["// Copyright 2023 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 { Box } from '@mui/material';\nimport { useInView } from 'react-intersection-observer';\nimport { DataQueriesProvider } from '@perses-dev/plugin-system';\nimport { PanelGroupItemId, useEditMode, usePanel, usePanelActions } from '../../context';\nimport { useSuggestedStepMs } from '../../utils';\nimport { Panel, PanelProps } from '../Panel/Panel';\nimport { PanelOptions } from '../Panel';\n\nexport interface GridItemContentProps {\n panelGroupItemId: PanelGroupItemId;\n width: number; // necessary for determining the suggested step ms\n panelOptions?: PanelOptions;\n}\n\n/**\n * Resolves the reference to panel content in a GridItemDefinition and renders the panel.\n */\nexport function GridItemContent(props: GridItemContentProps) {\n const { panelGroupItemId, width } = props;\n const panelDefinition = usePanel(panelGroupItemId);\n const {\n spec: { queries },\n } = panelDefinition;\n const { isEditMode } = useEditMode();\n const { openEditPanel, openDeletePanelDialog, duplicatePanel } = usePanelActions(panelGroupItemId);\n\n const { ref, inView } = useInView({\n threshold: 0.2, // we have the flexibility to adjust this threshold to trigger queries slightly earlier or later based on performance\n initialInView: false,\n triggerOnce: true,\n });\n\n // Provide actions to the panel when in edit mode\n let editHandlers: PanelProps['editHandlers'] = undefined;\n if (isEditMode) {\n editHandlers = {\n onEditPanelClick: openEditPanel,\n onDuplicatePanelClick: duplicatePanel,\n onDeletePanelClick: openDeletePanelDialog,\n };\n }\n\n // map TimeSeriesQueryDefinition to Definition<UnknownSpec>\n const suggestedStepMs = useSuggestedStepMs(width);\n const queryDefinitions = queries ?? [];\n const definitions = queryDefinitions.map((query) => {\n return {\n kind: query.spec.plugin.kind,\n spec: query.spec.plugin.spec,\n };\n });\n\n return (\n <Box\n ref={ref}\n sx={{\n width: '100%',\n height: '100%',\n }}\n >\n <DataQueriesProvider definitions={definitions} options={{ suggestedStepMs }} queryOptions={{ enabled: inView }}>\n {inView && (\n <Panel\n definition={panelDefinition}\n editHandlers={editHandlers}\n panelOptions={props.panelOptions}\n panelGroupItemId={panelGroupItemId}\n />\n )}\n </DataQueriesProvider>\n </Box>\n );\n}\n"],"names":["Box","useInView","DataQueriesProvider","useEditMode","usePanel","usePanelActions","useSuggestedStepMs","Panel","GridItemContent","props","panelGroupItemId","width","panelDefinition","spec","queries","isEditMode","openEditPanel","openDeletePanelDialog","duplicatePanel","ref","inView","threshold","initialInView","triggerOnce","editHandlers","undefined","onEditPanelClick","onDuplicatePanelClick","onDeletePanelClick","suggestedStepMs","queryDefinitions","definitions","map","query","kind","plugin","sx","height","options","queryOptions","enabled","definition","panelOptions"],"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,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,SAAS,QAAQ,8BAA8B;AACxD,SAASC,mBAAmB,QAAQ,4BAA4B;AAChE,SAA2BC,WAAW,EAAEC,QAAQ,EAAEC,eAAe,QAAQ,gBAAgB;AACzF,SAASC,kBAAkB,QAAQ,cAAc;AACjD,SAASC,KAAK,QAAoB,iBAAiB;AASnD;;CAEC,GACD,OAAO,SAASC,gBAAgBC,KAA2B;IACzD,MAAM,EAAEC,iBAAgB,EAAEC,MAAK,EAAE,GAAGF;IACpC,MAAMG,kBAAkBR,SAASM;IACjC,MAAM,EACJG,MAAM,EAAEC,QAAO,EAAE,CAAA,EAClB,GAAGF;IACJ,MAAM,EAAEG,WAAU,EAAE,GAAGZ;IACvB,MAAM,EAAEa,cAAa,EAAEC,sBAAqB,EAAEC,eAAc,EAAE,GAAGb,gBAAgBK;IAEjF,MAAM,EAAES,IAAG,EAAEC,OAAM,EAAE,GAAGnB,UAAU;QAChCoB,WAAW;QACXC,eAAe;QACfC,aAAa;IACf;IAEA,iDAAiD;IACjD,IAAIC,eAA2CC;IAC/C,IAAIV,YAAY;QACdS,eAAe;YACbE,kBAAkBV;YAClBW,uBAAuBT;YACvBU,oBAAoBX;QACtB;IACF;IAEA,2DAA2D;IAC3D,MAAMY,kBAAkBvB,mBAAmBK;IAC3C,MAAMmB,mBAAmBhB,oBAAAA,qBAAAA,UAAW,EAAE;IACtC,MAAMiB,cAAcD,iBAAiBE,IAAI,CAACC;QACxC,OAAO;YACLC,MAAMD,MAAMpB,KAAKsB,OAAOD;YACxBrB,MAAMoB,MAAMpB,KAAKsB,OAAOtB;QAC1B;IACF;IAEA,qBACE,KAACb;QACCmB,KAAKA;QACLiB,IAAI;YACFzB,OAAO;YACP0B,QAAQ;QACV;kBAEA,cAAA,KAACnC;YAAoB6B,aAAaA;YAAaO,SAAS;gBAAET;YAAgB;YAAGU,cAAc;gBAAEC,SAASpB;YAAO;sBAC1GA,wBACC,KAACb;gBACCkC,YAAY7B;gBACZY,cAAcA;gBACdkB,cAAcjC,MAAMiC;gBACpBhC,kBAAkBA;;;;AAM9B"}
@@ -1,7 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { PanelGroupId } from '../../context';
3
+ import { PanelOptions } from '../Panel';
3
4
  export interface GridLayoutProps {
4
5
  panelGroupId: PanelGroupId;
6
+ panelOptions?: PanelOptions;
5
7
  }
6
8
  /**
7
9
  * Layout component that arranges children in a Grid based on the definition.
@@ -1 +1 @@
1
- {"version":3,"file":"GridLayout.d.ts","sourceRoot":"","sources":["../../../src/components/GridLayout/GridLayout.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAoD,YAAY,EAAE,MAAM,eAAe,CAAC;AAS/F,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,eAkFhD"}
1
+ {"version":3,"file":"GridLayout.d.ts","sourceRoot":"","sources":["../../../src/components/GridLayout/GridLayout.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAoD,YAAY,EAAE,MAAM,eAAe,CAAC;AAE/F,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAOxC,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,eAmFhD"}
@@ -29,8 +29,8 @@ const ResponsiveGridLayout = WidthProvider(Responsive);
29
29
  const theme = useTheme();
30
30
  const groupDefinition = usePanelGroup(panelGroupId);
31
31
  const { updatePanelGroupLayouts } = usePanelGroupActions(panelGroupId);
32
- var ref;
33
- const [isOpen, setIsOpen] = useState((ref = !groupDefinition.isCollapsed) !== null && ref !== void 0 ? ref : true);
32
+ var _ref;
33
+ const [isOpen, setIsOpen] = useState((_ref = !groupDefinition.isCollapsed) !== null && _ref !== void 0 ? _ref : true);
34
34
  const { isEditMode } = useEditMode();
35
35
  const [gridColWidth, setGridColWidth] = useState(0);
36
36
  const handleLayoutChange = (currentLayout, allLayouts)=>{
@@ -99,6 +99,7 @@ const ResponsiveGridLayout = WidthProvider(Responsive);
99
99
  children: /*#__PURE__*/ _jsx(ErrorBoundary, {
100
100
  FallbackComponent: ErrorAlert,
101
101
  children: /*#__PURE__*/ _jsx(GridItemContent, {
102
+ panelOptions: props.panelOptions,
102
103
  panelGroupItemId: {
103
104
  panelGroupId,
104
105
  panelGroupItemLayoutId: i