@perses-dev/dashboards 0.0.0-snapshot-panel-extra-content-3-17f9c42 → 0.0.0-snapshot-scatterplot-fix-imports-95e1b59

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 (411) hide show
  1. package/dist/cjs/components/AddGroupButton/AddGroupButton.js +11 -8
  2. package/dist/cjs/components/AddGroupButton/index.js +10 -8
  3. package/dist/cjs/components/AddPanelButton/AddPanelButton.js +12 -13
  4. package/dist/cjs/components/AddPanelButton/index.js +10 -8
  5. package/dist/cjs/components/Dashboard/Dashboard.js +12 -10
  6. package/dist/cjs/components/Dashboard/index.js +10 -8
  7. package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +53 -22
  8. package/dist/cjs/components/DashboardStickyToolbar/index.js +10 -8
  9. package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +82 -103
  10. package/dist/cjs/components/DashboardToolbar/index.js +10 -8
  11. package/dist/cjs/components/Datasources/DatasourceEditor.js +236 -0
  12. package/dist/cjs/components/Datasources/EditDatasourcesButton.js +112 -0
  13. package/dist/cjs/components/{ToolbarIconButton → Datasources}/index.js +11 -8
  14. package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +16 -14
  15. package/dist/cjs/components/DeletePanelDialog/index.js +10 -8
  16. package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +18 -16
  17. package/dist/cjs/components/DeletePanelGroupDialog/index.js +10 -8
  18. package/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +6 -4
  19. package/dist/cjs/components/DiscardChangesConfirmationDialog/index.js +10 -8
  20. package/dist/cjs/components/DownloadButton/DownloadButton.js +13 -12
  21. package/dist/cjs/components/DownloadButton/index.js +10 -8
  22. package/dist/cjs/components/EditButton/EditButton.js +9 -7
  23. package/dist/cjs/components/EditButton/index.js +10 -8
  24. package/dist/cjs/components/EditJsonButton/EditJsonButton.js +15 -12
  25. package/dist/cjs/components/EditJsonButton/index.js +10 -8
  26. package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +54 -25
  27. package/dist/cjs/components/EditJsonDialog/index.js +10 -8
  28. package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +21 -19
  29. package/dist/cjs/components/EmptyDashboard/index.js +10 -8
  30. package/dist/cjs/components/GridLayout/GridContainer.js +6 -4
  31. package/dist/cjs/components/GridLayout/GridItemContent.js +37 -19
  32. package/dist/cjs/components/GridLayout/GridLayout.js +21 -19
  33. package/dist/cjs/components/GridLayout/GridTitle.js +40 -39
  34. package/dist/cjs/components/GridLayout/index.js +13 -11
  35. package/dist/cjs/components/Panel/Panel.js +19 -23
  36. package/dist/cjs/components/Panel/PanelContent.js +11 -8
  37. package/dist/cjs/components/Panel/PanelHeader.js +35 -33
  38. package/dist/cjs/components/Panel/index.js +10 -8
  39. package/dist/cjs/components/PanelDrawer/PanelDrawer.js +25 -77
  40. package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +237 -144
  41. package/dist/cjs/components/PanelDrawer/PanelPreview.js +13 -12
  42. package/dist/cjs/components/PanelDrawer/index.js +11 -8
  43. package/dist/cjs/components/PanelDrawer/usePanelEditor.js +5 -3
  44. package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +18 -16
  45. package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +16 -12
  46. package/dist/cjs/components/PanelGroupDialog/index.js +10 -8
  47. package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +48 -46
  48. package/dist/cjs/components/QuerySummaryTable/index.js +10 -8
  49. package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +26 -24
  50. package/dist/cjs/components/SaveChangesConfirmationDialog/index.js +10 -8
  51. package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +14 -14
  52. package/dist/cjs/components/SaveDashboardButton/index.js +10 -8
  53. package/dist/cjs/components/Variables/BuiltinVariableAccordions.js +141 -0
  54. package/dist/cjs/components/Variables/EditVariablesButton.js +19 -17
  55. package/dist/cjs/components/Variables/TemplateVariable.js +261 -107
  56. package/dist/cjs/components/Variables/VariableEditor.js +282 -207
  57. package/dist/cjs/components/Variables/VariableList.js +24 -22
  58. package/dist/cjs/components/Variables/index.js +14 -11
  59. package/dist/cjs/components/index.js +30 -29
  60. package/dist/cjs/constants/grid-layout-config.js +6 -2
  61. package/dist/cjs/constants/index.js +12 -9
  62. package/dist/cjs/constants/styles.js +42 -0
  63. package/dist/cjs/constants/user-interface-text.js +8 -3
  64. package/dist/cjs/context/DashboardProvider/DashboardProvider.js +48 -35
  65. package/dist/cjs/context/DashboardProvider/common.js +6 -2
  66. package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +81 -49
  67. package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +4 -2
  68. package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +8 -6
  69. package/dist/cjs/context/DashboardProvider/discard-changes-dialog-slice.js +3 -1
  70. package/dist/cjs/context/DashboardProvider/duplicate-panel-slice.js +4 -2
  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 +17 -17
  74. package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +8 -6
  75. package/dist/cjs/context/DashboardProvider/panel-group-slice.js +16 -8
  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 +177 -50
  79. package/dist/cjs/context/TemplateVariableProvider/TemplateVariableProvider.js +150 -39
  80. package/dist/cjs/context/TemplateVariableProvider/hydrationUtils.js +12 -10
  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 +15 -7
  84. package/dist/cjs/context/index.js +13 -11
  85. package/dist/cjs/context/useDashboard.js +30 -11
  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 +28 -21
  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 +10 -9
  100. package/dist/cjs/utils/panelUtils.js +11 -5
  101. package/dist/cjs/{components/TimeRangeControls → validation}/index.js +10 -8
  102. package/dist/cjs/{utils/time.js → validation/panel.js} +11 -9
  103. package/dist/cjs/views/ViewDashboard/DashboardApp.js +32 -18
  104. package/dist/cjs/views/ViewDashboard/ViewDashboard.js +64 -21
  105. package/dist/cjs/views/ViewDashboard/index.js +10 -8
  106. package/dist/cjs/views/index.js +10 -8
  107. package/dist/components/AddGroupButton/AddGroupButton.d.ts +1 -2
  108. package/dist/components/AddGroupButton/AddGroupButton.d.ts.map +1 -1
  109. package/dist/components/AddGroupButton/AddGroupButton.js +3 -2
  110. package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -1
  111. package/dist/components/AddGroupButton/index.js.map +1 -1
  112. package/dist/components/AddPanelButton/AddPanelButton.d.ts +1 -2
  113. package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -1
  114. package/dist/components/AddPanelButton/AddPanelButton.js +4 -7
  115. package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -1
  116. package/dist/components/AddPanelButton/index.js.map +1 -1
  117. package/dist/components/Dashboard/Dashboard.d.ts +2 -3
  118. package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
  119. package/dist/components/Dashboard/Dashboard.js +1 -1
  120. package/dist/components/Dashboard/Dashboard.js.map +1 -1
  121. package/dist/components/Dashboard/index.js.map +1 -1
  122. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts +1 -2
  123. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -1
  124. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +38 -9
  125. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -1
  126. package/dist/components/DashboardStickyToolbar/index.js.map +1 -1
  127. package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +1 -1
  128. package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
  129. package/dist/components/DashboardToolbar/DashboardToolbar.js +63 -86
  130. package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
  131. package/dist/components/DashboardToolbar/index.js.map +1 -1
  132. package/dist/components/Datasources/DatasourceEditor.d.ts +7 -0
  133. package/dist/components/Datasources/DatasourceEditor.d.ts.map +1 -0
  134. package/dist/components/Datasources/DatasourceEditor.js +223 -0
  135. package/dist/components/Datasources/DatasourceEditor.js.map +1 -0
  136. package/dist/components/Datasources/EditDatasourcesButton.d.ts +2 -0
  137. package/dist/components/Datasources/EditDatasourcesButton.d.ts.map +1 -0
  138. package/dist/components/Datasources/EditDatasourcesButton.js +99 -0
  139. package/dist/components/Datasources/EditDatasourcesButton.js.map +1 -0
  140. package/dist/components/Datasources/index.d.ts +3 -0
  141. package/dist/components/Datasources/index.d.ts.map +1 -0
  142. package/dist/components/{TimeRangeControls → Datasources}/index.js +2 -1
  143. package/dist/components/Datasources/index.js.map +1 -0
  144. package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts +1 -2
  145. package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts.map +1 -1
  146. package/dist/components/DeletePanelDialog/DeletePanelDialog.js +4 -4
  147. package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -1
  148. package/dist/components/DeletePanelDialog/index.js.map +1 -1
  149. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts +1 -2
  150. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -1
  151. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +3 -3
  152. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
  153. package/dist/components/DeletePanelGroupDialog/index.js.map +1 -1
  154. package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts +1 -2
  155. package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
  156. package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +1 -1
  157. package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js.map +1 -1
  158. package/dist/components/DiscardChangesConfirmationDialog/index.js.map +1 -1
  159. package/dist/components/DownloadButton/DownloadButton.d.ts +1 -2
  160. package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
  161. package/dist/components/DownloadButton/DownloadButton.js +3 -4
  162. package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
  163. package/dist/components/DownloadButton/index.js.map +1 -1
  164. package/dist/components/EditButton/EditButton.d.ts +1 -2
  165. package/dist/components/EditButton/EditButton.d.ts.map +1 -1
  166. package/dist/components/EditButton/EditButton.js +1 -1
  167. package/dist/components/EditButton/EditButton.js.map +1 -1
  168. package/dist/components/EditButton/index.js.map +1 -1
  169. package/dist/components/EditJsonButton/EditJsonButton.d.ts +4 -2
  170. package/dist/components/EditJsonButton/EditJsonButton.d.ts.map +1 -1
  171. package/dist/components/EditJsonButton/EditJsonButton.js +7 -6
  172. package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
  173. package/dist/components/EditJsonButton/index.js.map +1 -1
  174. package/dist/components/EditJsonDialog/EditJsonDialog.d.ts +5 -2
  175. package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
  176. package/dist/components/EditJsonDialog/EditJsonDialog.js +43 -16
  177. package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -1
  178. package/dist/components/EditJsonDialog/index.js.map +1 -1
  179. package/dist/components/EmptyDashboard/EmptyDashboard.d.ts +1 -1
  180. package/dist/components/EmptyDashboard/EmptyDashboard.d.ts.map +1 -1
  181. package/dist/components/EmptyDashboard/EmptyDashboard.js +3 -3
  182. package/dist/components/EmptyDashboard/EmptyDashboard.js.map +1 -1
  183. package/dist/components/EmptyDashboard/index.js.map +1 -1
  184. package/dist/components/GridLayout/GridContainer.d.ts +1 -1
  185. package/dist/components/GridLayout/GridContainer.d.ts.map +1 -1
  186. package/dist/components/GridLayout/GridContainer.js +1 -1
  187. package/dist/components/GridLayout/GridContainer.js.map +1 -1
  188. package/dist/components/GridLayout/GridItemContent.d.ts +1 -2
  189. package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
  190. package/dist/components/GridLayout/GridItemContent.js +31 -15
  191. package/dist/components/GridLayout/GridItemContent.js.map +1 -1
  192. package/dist/components/GridLayout/GridLayout.d.ts +1 -2
  193. package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
  194. package/dist/components/GridLayout/GridLayout.js +6 -6
  195. package/dist/components/GridLayout/GridLayout.js.map +1 -1
  196. package/dist/components/GridLayout/GridTitle.d.ts +1 -2
  197. package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
  198. package/dist/components/GridLayout/GridTitle.js +5 -6
  199. package/dist/components/GridLayout/GridTitle.js.map +1 -1
  200. package/dist/components/GridLayout/index.js.map +1 -1
  201. package/dist/components/Panel/Panel.d.ts +2 -2
  202. package/dist/components/Panel/Panel.d.ts.map +1 -1
  203. package/dist/components/Panel/Panel.js +7 -13
  204. package/dist/components/Panel/Panel.js.map +1 -1
  205. package/dist/components/Panel/PanelContent.d.ts +3 -3
  206. package/dist/components/Panel/PanelContent.d.ts.map +1 -1
  207. package/dist/components/Panel/PanelContent.js +4 -3
  208. package/dist/components/Panel/PanelContent.js.map +1 -1
  209. package/dist/components/Panel/PanelHeader.d.ts +2 -2
  210. package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
  211. package/dist/components/Panel/PanelHeader.js +2 -2
  212. package/dist/components/Panel/PanelHeader.js.map +1 -1
  213. package/dist/components/Panel/index.js.map +1 -1
  214. package/dist/components/PanelDrawer/PanelDrawer.d.ts +1 -2
  215. package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
  216. package/dist/components/PanelDrawer/PanelDrawer.js +22 -76
  217. package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
  218. package/dist/components/PanelDrawer/PanelEditorForm.d.ts +5 -3
  219. package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
  220. package/dist/components/PanelDrawer/PanelEditorForm.js +231 -142
  221. package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
  222. package/dist/components/PanelDrawer/PanelPreview.d.ts +1 -2
  223. package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
  224. package/dist/components/PanelDrawer/PanelPreview.js +4 -5
  225. package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
  226. package/dist/components/PanelDrawer/index.d.ts +1 -0
  227. package/dist/components/PanelDrawer/index.d.ts.map +1 -1
  228. package/dist/components/PanelDrawer/index.js +1 -0
  229. package/dist/components/PanelDrawer/index.js.map +1 -1
  230. package/dist/components/PanelDrawer/usePanelEditor.js +2 -2
  231. package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -1
  232. package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts +1 -2
  233. package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
  234. package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
  235. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts +1 -2
  236. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts.map +1 -1
  237. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
  238. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -1
  239. package/dist/components/PanelGroupDialog/index.js.map +1 -1
  240. package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts +1 -2
  241. package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts.map +1 -1
  242. package/dist/components/QuerySummaryTable/QuerySummaryTable.js +8 -8
  243. package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
  244. package/dist/components/QuerySummaryTable/index.js.map +1 -1
  245. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts +1 -2
  246. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts.map +1 -1
  247. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +8 -8
  248. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
  249. package/dist/components/SaveChangesConfirmationDialog/index.js.map +1 -1
  250. package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts +1 -2
  251. package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts.map +1 -1
  252. package/dist/components/SaveDashboardButton/SaveDashboardButton.js +8 -10
  253. package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
  254. package/dist/components/SaveDashboardButton/index.js.map +1 -1
  255. package/dist/components/Variables/BuiltinVariableAccordions.d.ts +7 -0
  256. package/dist/components/Variables/BuiltinVariableAccordions.d.ts.map +1 -0
  257. package/dist/components/Variables/BuiltinVariableAccordions.js +128 -0
  258. package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -0
  259. package/dist/components/Variables/EditVariablesButton.d.ts +1 -2
  260. package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
  261. package/dist/components/Variables/EditVariablesButton.js +7 -7
  262. package/dist/components/Variables/EditVariablesButton.js.map +1 -1
  263. package/dist/components/Variables/TemplateVariable.d.ts +12 -4
  264. package/dist/components/Variables/TemplateVariable.d.ts.map +1 -1
  265. package/dist/components/Variables/TemplateVariable.js +244 -100
  266. package/dist/components/Variables/TemplateVariable.js.map +1 -1
  267. package/dist/components/Variables/VariableEditor.d.ts +4 -4
  268. package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
  269. package/dist/components/Variables/VariableEditor.js +232 -161
  270. package/dist/components/Variables/VariableEditor.js.map +1 -1
  271. package/dist/components/Variables/VariableList.d.ts +2 -3
  272. package/dist/components/Variables/VariableList.d.ts.map +1 -1
  273. package/dist/components/Variables/VariableList.js +11 -13
  274. package/dist/components/Variables/VariableList.js.map +1 -1
  275. package/dist/components/Variables/index.d.ts +1 -0
  276. package/dist/components/Variables/index.d.ts.map +1 -1
  277. package/dist/components/Variables/index.js +1 -0
  278. package/dist/components/Variables/index.js.map +1 -1
  279. package/dist/components/index.d.ts +1 -2
  280. package/dist/components/index.d.ts.map +1 -1
  281. package/dist/components/index.js +1 -2
  282. package/dist/components/index.js.map +1 -1
  283. package/dist/constants/grid-layout-config.js.map +1 -1
  284. package/dist/constants/index.d.ts +1 -0
  285. package/dist/constants/index.d.ts.map +1 -1
  286. package/dist/constants/index.js +1 -0
  287. package/dist/constants/index.js.map +1 -1
  288. package/dist/constants/styles.d.ts +5 -0
  289. package/dist/constants/styles.d.ts.map +1 -0
  290. package/dist/{utils/time.js → constants/styles.js} +10 -10
  291. package/dist/constants/styles.js.map +1 -0
  292. package/dist/constants/user-interface-text.d.ts +2 -1
  293. package/dist/constants/user-interface-text.d.ts.map +1 -1
  294. package/dist/constants/user-interface-text.js +2 -1
  295. package/dist/constants/user-interface-text.js.map +1 -1
  296. package/dist/context/DashboardProvider/DashboardProvider.d.ts +7 -4
  297. package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
  298. package/dist/context/DashboardProvider/DashboardProvider.js +16 -9
  299. package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
  300. package/dist/context/DashboardProvider/common.d.ts +3 -3
  301. package/dist/context/DashboardProvider/common.d.ts.map +1 -1
  302. package/dist/context/DashboardProvider/common.js.map +1 -1
  303. package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +1 -1
  304. package/dist/context/DashboardProvider/dashboard-provider-api.js +17 -17
  305. package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
  306. package/dist/context/DashboardProvider/delete-panel-group-slice.js +1 -1
  307. package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -1
  308. package/dist/context/DashboardProvider/delete-panel-slice.js +5 -5
  309. package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -1
  310. package/dist/context/DashboardProvider/discard-changes-dialog-slice.js.map +1 -1
  311. package/dist/context/DashboardProvider/duplicate-panel-slice.js +1 -1
  312. package/dist/context/DashboardProvider/duplicate-panel-slice.js.map +1 -1
  313. package/dist/context/DashboardProvider/edit-json-dialog-slice.js.map +1 -1
  314. package/dist/context/DashboardProvider/index.js.map +1 -1
  315. package/dist/context/DashboardProvider/panel-editor-slice.d.ts +2 -2
  316. package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
  317. package/dist/context/DashboardProvider/panel-editor-slice.js +11 -13
  318. package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
  319. package/dist/context/DashboardProvider/panel-group-editor-slice.js +2 -2
  320. package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
  321. package/dist/context/DashboardProvider/panel-group-slice.d.ts +2 -2
  322. package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
  323. package/dist/context/DashboardProvider/panel-group-slice.js +4 -4
  324. package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
  325. package/dist/context/DashboardProvider/panel-slice.js.map +1 -1
  326. package/dist/context/DashboardProvider/save-changes-dialog-slice.js.map +1 -1
  327. package/dist/context/DatasourceStoreProvider.d.ts +17 -12
  328. package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
  329. package/dist/context/DatasourceStoreProvider.js +172 -47
  330. package/dist/context/DatasourceStoreProvider.js.map +1 -1
  331. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +15 -8
  332. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +1 -1
  333. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +115 -23
  334. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +1 -1
  335. package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts.map +1 -1
  336. package/dist/context/TemplateVariableProvider/hydrationUtils.js +7 -7
  337. package/dist/context/TemplateVariableProvider/hydrationUtils.js.map +1 -1
  338. package/dist/context/TemplateVariableProvider/index.js.map +1 -1
  339. package/dist/context/TemplateVariableProvider/query-params.js.map +1 -1
  340. package/dist/context/TemplateVariableProvider/utils.js +3 -3
  341. package/dist/context/TemplateVariableProvider/utils.js.map +1 -1
  342. package/dist/context/index.js.map +1 -1
  343. package/dist/context/useDashboard.d.ts +3 -3
  344. package/dist/context/useDashboard.d.ts.map +1 -1
  345. package/dist/context/useDashboard.js +24 -7
  346. package/dist/context/useDashboard.js.map +1 -1
  347. package/dist/index.js.map +1 -1
  348. package/dist/stories/decorators/WithDashboard.js.map +1 -1
  349. package/dist/stories/decorators/WithDatasourceStore.js.map +1 -1
  350. package/dist/stories/decorators/WithTemplateVariables.js.map +1 -1
  351. package/dist/stories/decorators/constants.js +2 -2
  352. package/dist/stories/decorators/constants.js.map +1 -1
  353. package/dist/stories/decorators/index.js.map +1 -1
  354. package/dist/test/dashboard-provider.js.map +1 -1
  355. package/dist/test/datasource-provider.d.ts.map +1 -1
  356. package/dist/test/datasource-provider.js +5 -7
  357. package/dist/test/datasource-provider.js.map +1 -1
  358. package/dist/test/index.js.map +1 -1
  359. package/dist/test/plugin-registry.js.map +1 -1
  360. package/dist/test/render.d.ts.map +1 -1
  361. package/dist/test/render.js +9 -4
  362. package/dist/test/render.js.map +1 -1
  363. package/dist/test/setup-tests.js.map +1 -1
  364. package/dist/test/testDashboard.js +10 -10
  365. package/dist/test/testDashboard.js.map +1 -1
  366. package/dist/utils/index.d.ts +0 -1
  367. package/dist/utils/index.d.ts.map +1 -1
  368. package/dist/utils/index.js +0 -1
  369. package/dist/utils/index.js.map +1 -1
  370. package/dist/utils/panelUtils.d.ts +1 -1
  371. package/dist/utils/panelUtils.d.ts.map +1 -1
  372. package/dist/utils/panelUtils.js +2 -2
  373. package/dist/utils/panelUtils.js.map +1 -1
  374. package/dist/validation/index.d.ts +2 -0
  375. package/dist/validation/index.d.ts.map +1 -0
  376. package/dist/{components/ToolbarIconButton → validation}/index.js +1 -1
  377. package/dist/validation/index.js.map +1 -0
  378. package/dist/validation/panel.d.ts +19 -0
  379. package/dist/validation/panel.d.ts.map +1 -0
  380. package/dist/validation/panel.js +21 -0
  381. package/dist/validation/panel.js.map +1 -0
  382. package/dist/views/ViewDashboard/DashboardApp.d.ts +4 -3
  383. package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
  384. package/dist/views/ViewDashboard/DashboardApp.js +19 -7
  385. package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
  386. package/dist/views/ViewDashboard/ViewDashboard.d.ts +2 -2
  387. package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
  388. package/dist/views/ViewDashboard/ViewDashboard.js +53 -12
  389. package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
  390. package/dist/views/ViewDashboard/index.js.map +1 -1
  391. package/dist/views/index.js.map +1 -1
  392. package/package.json +8 -7
  393. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -183
  394. package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +0 -38
  395. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +0 -14
  396. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +0 -1
  397. package/dist/components/TimeRangeControls/TimeRangeControls.js +0 -165
  398. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +0 -1
  399. package/dist/components/TimeRangeControls/index.d.ts +0 -2
  400. package/dist/components/TimeRangeControls/index.d.ts.map +0 -1
  401. package/dist/components/TimeRangeControls/index.js.map +0 -1
  402. package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts +0 -6
  403. package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts.map +0 -1
  404. package/dist/components/ToolbarIconButton/ToolbarIconButton.js +0 -32
  405. package/dist/components/ToolbarIconButton/ToolbarIconButton.js.map +0 -1
  406. package/dist/components/ToolbarIconButton/index.d.ts +0 -2
  407. package/dist/components/ToolbarIconButton/index.d.ts.map +0 -1
  408. package/dist/components/ToolbarIconButton/index.js.map +0 -1
  409. package/dist/utils/time.d.ts +0 -5
  410. package/dist/utils/time.d.ts.map +0 -1
  411. package/dist/utils/time.js.map +0 -1
@@ -0,0 +1,223 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
14
+ import { Box, Button, IconButton, Stack, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Typography } from '@mui/material';
15
+ import AddIcon from 'mdi-material-ui/Plus';
16
+ import PencilIcon from 'mdi-material-ui/Pencil';
17
+ import TrashIcon from 'mdi-material-ui/TrashCan';
18
+ import { DatasourceEditorForm } from '@perses-dev/plugin-system';
19
+ import { useState } from 'react';
20
+ import { useImmer } from 'use-immer';
21
+ import { useDiscardChangesConfirmationDialog } from '../../context';
22
+ export function DatasourceEditor(props) {
23
+ const [datasources, setDatasources] = useImmer(props.datasources);
24
+ const [datasourceFormAction, setDatasourceFormAction] = useState('update');
25
+ const [datasourceEdit, setDatasourceEdit] = useState(null);
26
+ const defaultSpec = {
27
+ default: false,
28
+ plugin: {
29
+ // TODO: find a way to avoid assuming that the PrometheusDatasource plugin is installed
30
+ kind: 'PrometheusDatasource',
31
+ spec: {}
32
+ }
33
+ };
34
+ const { openDiscardChangesConfirmationDialog, closeDiscardChangesConfirmationDialog } = useDiscardChangesConfirmationDialog();
35
+ const handleCancel = ()=>{
36
+ if (JSON.stringify(props.datasources) !== JSON.stringify(datasources)) {
37
+ openDiscardChangesConfirmationDialog({
38
+ onDiscardChanges: ()=>{
39
+ closeDiscardChangesConfirmationDialog();
40
+ props.onCancel();
41
+ },
42
+ onCancel: ()=>{
43
+ closeDiscardChangesConfirmationDialog();
44
+ },
45
+ description: 'You have unapplied changes. Are you sure you want to discard these changes? Changes cannot be recovered.'
46
+ });
47
+ } else {
48
+ props.onCancel();
49
+ }
50
+ };
51
+ const removeDatasource = (name)=>{
52
+ setDatasources((draft)=>{
53
+ delete draft[name];
54
+ });
55
+ };
56
+ const addDatasource = ()=>{
57
+ setDatasourceFormAction('create');
58
+ setDatasourceEdit({
59
+ name: 'NewDatasource',
60
+ spec: defaultSpec
61
+ });
62
+ };
63
+ const editDatasource = (name)=>{
64
+ setDatasourceFormAction('update');
65
+ var _datasources_name;
66
+ setDatasourceEdit({
67
+ name: name,
68
+ spec: (_datasources_name = datasources[name]) !== null && _datasources_name !== void 0 ? _datasources_name : defaultSpec
69
+ });
70
+ };
71
+ return /*#__PURE__*/ _jsx(_Fragment, {
72
+ children: datasourceEdit ? /*#__PURE__*/ _jsx(DatasourceEditorForm, {
73
+ initialDatasourceDefinition: datasourceEdit,
74
+ initialAction: datasourceFormAction,
75
+ isDraft: true,
76
+ onSave: (name, spec)=>{
77
+ setDatasources((draft)=>{
78
+ delete draft[datasourceEdit.name]; // to tackle the case where datasource name has been changed
79
+ draft[name] = spec;
80
+ setDatasourceEdit(null);
81
+ });
82
+ },
83
+ onClose: ()=>{
84
+ setDatasourceEdit(null);
85
+ }
86
+ }) : /*#__PURE__*/ _jsxs(_Fragment, {
87
+ children: [
88
+ /*#__PURE__*/ _jsxs(Box, {
89
+ sx: {
90
+ display: 'flex',
91
+ alignItems: 'center',
92
+ padding: (theme)=>theme.spacing(1, 2),
93
+ borderBottom: (theme)=>`1px solid ${theme.palette.divider}`
94
+ },
95
+ children: [
96
+ /*#__PURE__*/ _jsx(Typography, {
97
+ variant: "h2",
98
+ children: "Edit Dashboard Datasources"
99
+ }),
100
+ /*#__PURE__*/ _jsxs(Stack, {
101
+ direction: "row",
102
+ spacing: 1,
103
+ marginLeft: "auto",
104
+ children: [
105
+ /*#__PURE__*/ _jsx(Button, {
106
+ disabled: props.datasources === datasources,
107
+ variant: "contained",
108
+ onClick: ()=>{
109
+ props.onChange(datasources);
110
+ },
111
+ children: "Apply"
112
+ }),
113
+ /*#__PURE__*/ _jsx(Button, {
114
+ color: "secondary",
115
+ variant: "outlined",
116
+ onClick: handleCancel,
117
+ children: "Cancel"
118
+ })
119
+ ]
120
+ })
121
+ ]
122
+ }),
123
+ /*#__PURE__*/ _jsx(Box, {
124
+ padding: 2,
125
+ sx: {
126
+ overflowY: 'scroll'
127
+ },
128
+ children: /*#__PURE__*/ _jsx(Stack, {
129
+ spacing: 2,
130
+ children: /*#__PURE__*/ _jsxs(Stack, {
131
+ spacing: 2,
132
+ children: [
133
+ /*#__PURE__*/ _jsx(TableContainer, {
134
+ children: /*#__PURE__*/ _jsxs(Table, {
135
+ sx: {
136
+ minWidth: 650
137
+ },
138
+ "aria-label": "table of datasources",
139
+ children: [
140
+ /*#__PURE__*/ _jsx(TableHead, {
141
+ children: /*#__PURE__*/ _jsxs(TableRow, {
142
+ children: [
143
+ /*#__PURE__*/ _jsx(TableCell, {
144
+ children: "Name"
145
+ }),
146
+ /*#__PURE__*/ _jsx(TableCell, {
147
+ children: "Type"
148
+ }),
149
+ /*#__PURE__*/ _jsx(TableCell, {
150
+ children: "Description"
151
+ }),
152
+ /*#__PURE__*/ _jsx(TableCell, {
153
+ align: "right",
154
+ children: "Actions"
155
+ })
156
+ ]
157
+ })
158
+ }),
159
+ /*#__PURE__*/ _jsx(TableBody, {
160
+ children: Object.entries(datasources).map(([name, spec])=>{
161
+ var _spec_display;
162
+ var _spec_display_description;
163
+ return /*#__PURE__*/ _jsxs(TableRow, {
164
+ children: [
165
+ /*#__PURE__*/ _jsx(TableCell, {
166
+ component: "th",
167
+ scope: "row",
168
+ sx: {
169
+ fontWeight: 'bold'
170
+ },
171
+ children: name
172
+ }),
173
+ /*#__PURE__*/ _jsx(TableCell, {
174
+ children: spec.plugin.kind
175
+ }),
176
+ /*#__PURE__*/ _jsx(TableCell, {
177
+ children: (_spec_display_description = (_spec_display = spec.display) === null || _spec_display === void 0 ? void 0 : _spec_display.description) !== null && _spec_display_description !== void 0 ? _spec_display_description : ''
178
+ }),
179
+ /*#__PURE__*/ _jsxs(TableCell, {
180
+ align: "right",
181
+ sx: {
182
+ whiteSpace: 'nowrap'
183
+ },
184
+ children: [
185
+ /*#__PURE__*/ _jsx(IconButton, {
186
+ onClick: ()=>editDatasource(name),
187
+ children: /*#__PURE__*/ _jsx(PencilIcon, {})
188
+ }),
189
+ /*#__PURE__*/ _jsx(IconButton, {
190
+ onClick: ()=>removeDatasource(name),
191
+ children: /*#__PURE__*/ _jsx(TrashIcon, {})
192
+ })
193
+ ]
194
+ })
195
+ ]
196
+ }, name);
197
+ })
198
+ })
199
+ ]
200
+ })
201
+ }),
202
+ /*#__PURE__*/ _jsx(Box, {
203
+ display: "flex",
204
+ children: /*#__PURE__*/ _jsx(Button, {
205
+ variant: "contained",
206
+ startIcon: /*#__PURE__*/ _jsx(AddIcon, {}),
207
+ sx: {
208
+ marginLeft: 'auto'
209
+ },
210
+ onClick: addDatasource,
211
+ children: "Add Datasource"
212
+ })
213
+ })
214
+ ]
215
+ })
216
+ })
217
+ })
218
+ ]
219
+ })
220
+ });
221
+ }
222
+
223
+ //# sourceMappingURL=DatasourceEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Datasources/DatasourceEditor.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 {\n Box,\n Button,\n IconButton,\n Stack,\n Table,\n TableBody,\n TableCell,\n TableContainer,\n TableHead,\n TableRow,\n Typography,\n} from '@mui/material';\nimport AddIcon from 'mdi-material-ui/Plus';\nimport PencilIcon from 'mdi-material-ui/Pencil';\nimport TrashIcon from 'mdi-material-ui/TrashCan';\nimport { Action, DatasourceDefinition, DatasourceSpec } from '@perses-dev/core';\nimport { DatasourceEditorForm } from '@perses-dev/plugin-system';\nimport { useState } from 'react';\nimport { useImmer } from 'use-immer';\nimport { useDiscardChangesConfirmationDialog } from '../../context';\n\nexport function DatasourceEditor(props: {\n datasources: Record<string, DatasourceSpec>;\n onChange: (datasources: Record<string, DatasourceSpec>) => void;\n onCancel: () => void;\n}) {\n const [datasources, setDatasources] = useImmer(props.datasources);\n const [datasourceFormAction, setDatasourceFormAction] = useState<Action>('update');\n const [datasourceEdit, setDatasourceEdit] = useState<DatasourceDefinition | null>(null);\n const defaultSpec: DatasourceSpec = {\n default: false,\n plugin: {\n // TODO: find a way to avoid assuming that the PrometheusDatasource plugin is installed\n kind: 'PrometheusDatasource',\n spec: {},\n },\n };\n\n const { openDiscardChangesConfirmationDialog, closeDiscardChangesConfirmationDialog } =\n useDiscardChangesConfirmationDialog();\n\n const handleCancel = () => {\n if (JSON.stringify(props.datasources) !== JSON.stringify(datasources)) {\n openDiscardChangesConfirmationDialog({\n onDiscardChanges: () => {\n closeDiscardChangesConfirmationDialog();\n props.onCancel();\n },\n onCancel: () => {\n closeDiscardChangesConfirmationDialog();\n },\n description:\n 'You have unapplied changes. Are you sure you want to discard these changes? Changes cannot be recovered.',\n });\n } else {\n props.onCancel();\n }\n };\n\n const removeDatasource = (name: string) => {\n setDatasources((draft) => {\n delete draft[name];\n });\n };\n\n const addDatasource = () => {\n setDatasourceFormAction('create');\n setDatasourceEdit({\n name: 'NewDatasource',\n spec: defaultSpec,\n });\n };\n\n const editDatasource = (name: string) => {\n setDatasourceFormAction('update');\n setDatasourceEdit({\n name: name,\n spec: datasources[name] ?? defaultSpec,\n });\n };\n\n return (\n <>\n {datasourceEdit ? (\n <DatasourceEditorForm\n initialDatasourceDefinition={datasourceEdit}\n initialAction={datasourceFormAction}\n isDraft={true}\n onSave={(name: string, spec: DatasourceSpec) => {\n setDatasources((draft) => {\n delete draft[datasourceEdit.name]; // to tackle the case where datasource name has been changed\n draft[name] = spec;\n setDatasourceEdit(null);\n });\n }}\n onClose={() => {\n setDatasourceEdit(null);\n }}\n />\n ) : (\n <>\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n padding: (theme) => theme.spacing(1, 2),\n borderBottom: (theme) => `1px solid ${theme.palette.divider}`,\n }}\n >\n <Typography variant=\"h2\">Edit Dashboard Datasources</Typography>\n <Stack direction=\"row\" spacing={1} marginLeft=\"auto\">\n <Button\n disabled={props.datasources === datasources}\n variant=\"contained\"\n onClick={() => {\n props.onChange(datasources);\n }}\n >\n Apply\n </Button>\n <Button color=\"secondary\" variant=\"outlined\" onClick={handleCancel}>\n Cancel\n </Button>\n </Stack>\n </Box>\n <Box padding={2} sx={{ overflowY: 'scroll' }}>\n <Stack spacing={2}>\n <Stack spacing={2}>\n <TableContainer>\n <Table sx={{ minWidth: 650 }} aria-label=\"table of datasources\">\n <TableHead>\n <TableRow>\n <TableCell>Name</TableCell>\n <TableCell>Type</TableCell>\n <TableCell>Description</TableCell>\n <TableCell align=\"right\">Actions</TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {Object.entries(datasources).map(([name, spec]) => {\n return (\n <TableRow key={name}>\n <TableCell component=\"th\" scope=\"row\" sx={{ fontWeight: 'bold' }}>\n {name}\n </TableCell>\n <TableCell>{spec.plugin.kind}</TableCell>\n <TableCell>{spec.display?.description ?? ''}</TableCell>\n <TableCell align=\"right\" sx={{ whiteSpace: 'nowrap' }}>\n <IconButton onClick={() => editDatasource(name)}>\n <PencilIcon />\n </IconButton>\n <IconButton onClick={() => removeDatasource(name)}>\n <TrashIcon />\n </IconButton>\n </TableCell>\n </TableRow>\n );\n })}\n </TableBody>\n </Table>\n </TableContainer>\n <Box display=\"flex\">\n <Button\n variant=\"contained\"\n startIcon={<AddIcon />}\n sx={{ marginLeft: 'auto' }}\n onClick={addDatasource}\n >\n Add Datasource\n </Button>\n </Box>\n </Stack>\n </Stack>\n </Box>\n </>\n )}\n </>\n );\n}\n"],"names":["Box","Button","IconButton","Stack","Table","TableBody","TableCell","TableContainer","TableHead","TableRow","Typography","AddIcon","PencilIcon","TrashIcon","DatasourceEditorForm","useState","useImmer","useDiscardChangesConfirmationDialog","DatasourceEditor","props","datasources","setDatasources","datasourceFormAction","setDatasourceFormAction","datasourceEdit","setDatasourceEdit","defaultSpec","default","plugin","kind","spec","openDiscardChangesConfirmationDialog","closeDiscardChangesConfirmationDialog","handleCancel","JSON","stringify","onDiscardChanges","onCancel","description","removeDatasource","name","draft","addDatasource","editDatasource","initialDatasourceDefinition","initialAction","isDraft","onSave","onClose","sx","display","alignItems","padding","theme","spacing","borderBottom","palette","divider","variant","direction","marginLeft","disabled","onClick","onChange","color","overflowY","minWidth","aria-label","align","Object","entries","map","component","scope","fontWeight","whiteSpace","startIcon"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ export declare function EditDatasourcesButton(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=EditDatasourcesButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditDatasourcesButton.d.ts","sourceRoot":"","sources":["../../../src/components/Datasources/EditDatasourcesButton.tsx"],"names":[],"mappings":"AAuBA,wBAAgB,qBAAqB,4CAwFpC"}
@@ -0,0 +1,99 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
14
+ import { useState } from 'react';
15
+ import { Button } from '@mui/material';
16
+ import PencilIcon from 'mdi-material-ui/PencilOutline';
17
+ import { Drawer, InfoTooltip } from '@perses-dev/components';
18
+ import { useDatasourceStore } from '@perses-dev/plugin-system';
19
+ import { TOOLTIP_TEXT, editButtonStyle } from '../../constants';
20
+ import { useDashboard } from '../../context';
21
+ import { DatasourceEditor } from './DatasourceEditor';
22
+ export function EditDatasourcesButton() {
23
+ const [isDatasourceEditorOpen, setIsDatasourceEditorOpen] = useState(false);
24
+ const { getLocalDatasources, setLocalDatasources, getSavedDatasources, setSavedDatasources } = useDatasourceStore();
25
+ const localDatasources = getLocalDatasources();
26
+ const savedDatasources = getSavedDatasources();
27
+ const { dashboard, setDashboard } = useDashboard();
28
+ const openDatasourceEditor = ()=>{
29
+ setIsDatasourceEditorOpen(true);
30
+ };
31
+ const closeDatasourceEditor = ()=>{
32
+ setIsDatasourceEditorOpen(false);
33
+ };
34
+ const handleChangeDatasources = (datasources)=>{
35
+ // Calculates the new list of datasources that are allowed to be used.
36
+ const newSavedDatasources = Object.keys(datasources).filter((key)=>{
37
+ var _datasources_key_plugin, _datasources_key, _savedDatasources_key_plugin, _savedDatasources_key, _datasources_key_plugin_spec, _datasources_key_plugin1, _datasources_key1, _savedDatasources_key_plugin_spec, _savedDatasources_key_plugin1, _savedDatasources_key1;
38
+ var _datasources_key_plugin_spec1;
39
+ // Datasources are allowed to be used if a) they are direct, or b) they are proxied, and their
40
+ // proxy is the same as what we have saved.
41
+ const isDirect = 'directUrl' in ((_datasources_key_plugin_spec1 = (_datasources_key = datasources[key]) === null || _datasources_key === void 0 ? void 0 : (_datasources_key_plugin = _datasources_key.plugin) === null || _datasources_key_plugin === void 0 ? void 0 : _datasources_key_plugin.spec) !== null && _datasources_key_plugin_spec1 !== void 0 ? _datasources_key_plugin_spec1 : {});
42
+ var _savedDatasources_key_plugin_spec1;
43
+ const isSavedProxy = !isDirect && !('directUrl' in ((_savedDatasources_key_plugin_spec1 = (_savedDatasources_key = savedDatasources[key]) === null || _savedDatasources_key === void 0 ? void 0 : (_savedDatasources_key_plugin = _savedDatasources_key.plugin) === null || _savedDatasources_key_plugin === void 0 ? void 0 : _savedDatasources_key_plugin.spec) !== null && _savedDatasources_key_plugin_spec1 !== void 0 ? _savedDatasources_key_plugin_spec1 : {})) && ((_datasources_key1 = datasources[key]) === null || _datasources_key1 === void 0 ? void 0 : (_datasources_key_plugin1 = _datasources_key1.plugin) === null || _datasources_key_plugin1 === void 0 ? void 0 : (_datasources_key_plugin_spec = _datasources_key_plugin1.spec) === null || _datasources_key_plugin_spec === void 0 ? void 0 : _datasources_key_plugin_spec.proxy) === ((_savedDatasources_key1 = savedDatasources[key]) === null || _savedDatasources_key1 === void 0 ? void 0 : (_savedDatasources_key_plugin1 = _savedDatasources_key1.plugin) === null || _savedDatasources_key_plugin1 === void 0 ? void 0 : (_savedDatasources_key_plugin_spec = _savedDatasources_key_plugin1.spec) === null || _savedDatasources_key_plugin_spec === void 0 ? void 0 : _savedDatasources_key_plugin_spec.proxy);
44
+ return isDirect || isSavedProxy;
45
+ }).reduce((obj, key)=>{
46
+ obj[key] = datasources[key];
47
+ return obj;
48
+ }, {});
49
+ setDashboard(dashboard.kind === 'Dashboard' ? {
50
+ ...dashboard,
51
+ spec: {
52
+ ...dashboard.spec,
53
+ datasources: datasources
54
+ }
55
+ } : {
56
+ ...dashboard,
57
+ spec: {
58
+ ...dashboard.spec,
59
+ datasources: datasources
60
+ }
61
+ });
62
+ setSavedDatasources(newSavedDatasources);
63
+ setLocalDatasources(datasources);
64
+ setIsDatasourceEditorOpen(false);
65
+ };
66
+ return /*#__PURE__*/ _jsxs(_Fragment, {
67
+ children: [
68
+ /*#__PURE__*/ _jsx(InfoTooltip, {
69
+ description: TOOLTIP_TEXT.editDatasources,
70
+ children: /*#__PURE__*/ _jsx(Button, {
71
+ startIcon: /*#__PURE__*/ _jsx(PencilIcon, {}),
72
+ onClick: openDatasourceEditor,
73
+ "aria-label": TOOLTIP_TEXT.editDatasources,
74
+ variant: "text",
75
+ color: "primary",
76
+ sx: editButtonStyle,
77
+ children: "Datasources"
78
+ })
79
+ }),
80
+ /*#__PURE__*/ _jsx(Drawer, {
81
+ isOpen: isDatasourceEditorOpen,
82
+ onClose: closeDatasourceEditor,
83
+ PaperProps: {
84
+ sx: {
85
+ width: '50%'
86
+ }
87
+ },
88
+ "data-testid": "datasource-editor",
89
+ children: /*#__PURE__*/ _jsx(DatasourceEditor, {
90
+ datasources: localDatasources,
91
+ onCancel: closeDatasourceEditor,
92
+ onChange: handleChangeDatasources
93
+ })
94
+ })
95
+ ]
96
+ });
97
+ }
98
+
99
+ //# sourceMappingURL=EditDatasourcesButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Datasources/EditDatasourcesButton.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 { useState } from 'react';\nimport { Button } from '@mui/material';\nimport PencilIcon from 'mdi-material-ui/PencilOutline';\nimport { Drawer, InfoTooltip } from '@perses-dev/components';\nimport { DashboardResource, DatasourceSpec, EphemeralDashboardResource } from '@perses-dev/core';\nimport { useDatasourceStore } from '@perses-dev/plugin-system';\nimport { TOOLTIP_TEXT, editButtonStyle } from '../../constants';\nimport { useDashboard } from '../../context';\nimport { DatasourceEditor } from './DatasourceEditor';\n\nexport function EditDatasourcesButton() {\n const [isDatasourceEditorOpen, setIsDatasourceEditorOpen] = useState(false);\n const { getLocalDatasources, setLocalDatasources, getSavedDatasources, setSavedDatasources } = useDatasourceStore();\n const localDatasources: Record<string, DatasourceSpec> = getLocalDatasources();\n const savedDatasources: Record<string, DatasourceSpec> = getSavedDatasources();\n const { dashboard, setDashboard } = useDashboard();\n\n const openDatasourceEditor = () => {\n setIsDatasourceEditorOpen(true);\n };\n\n const closeDatasourceEditor = () => {\n setIsDatasourceEditorOpen(false);\n };\n\n const handleChangeDatasources = (datasources: Record<string, DatasourceSpec>) => {\n // Calculates the new list of datasources that are allowed to be used.\n const newSavedDatasources: Record<string, DatasourceSpec> = Object.keys(datasources)\n .filter((key) => {\n // Datasources are allowed to be used if a) they are direct, or b) they are proxied, and their\n // proxy is the same as what we have saved.\n const isDirect = 'directUrl' in (datasources[key]?.plugin?.spec ?? {});\n const isSavedProxy =\n !isDirect &&\n !('directUrl' in (savedDatasources[key]?.plugin?.spec ?? {})) &&\n datasources[key]?.plugin?.spec?.proxy === savedDatasources[key]?.plugin?.spec?.proxy;\n\n return isDirect || isSavedProxy;\n })\n .reduce(\n (obj, key) => {\n obj[key] = datasources[key] as DatasourceSpec;\n\n return obj;\n },\n {} as Record<string, DatasourceSpec>\n );\n\n setDashboard(\n dashboard.kind === 'Dashboard'\n ? ({\n ...dashboard,\n spec: {\n ...dashboard.spec,\n datasources: datasources,\n },\n } as DashboardResource)\n : ({\n ...dashboard,\n spec: {\n ...dashboard.spec,\n datasources: datasources,\n },\n } as EphemeralDashboardResource)\n );\n setSavedDatasources(newSavedDatasources);\n setLocalDatasources(datasources);\n setIsDatasourceEditorOpen(false);\n };\n\n return (\n <>\n <InfoTooltip description={TOOLTIP_TEXT.editDatasources}>\n <Button\n startIcon={<PencilIcon />}\n onClick={openDatasourceEditor}\n aria-label={TOOLTIP_TEXT.editDatasources}\n variant=\"text\"\n color=\"primary\"\n sx={editButtonStyle}\n >\n Datasources\n </Button>\n </InfoTooltip>\n <Drawer\n isOpen={isDatasourceEditorOpen}\n onClose={closeDatasourceEditor}\n PaperProps={{ sx: { width: '50%' } }}\n data-testid=\"datasource-editor\"\n >\n <DatasourceEditor\n datasources={localDatasources}\n onCancel={closeDatasourceEditor}\n onChange={handleChangeDatasources}\n />\n </Drawer>\n </>\n );\n}\n"],"names":["useState","Button","PencilIcon","Drawer","InfoTooltip","useDatasourceStore","TOOLTIP_TEXT","editButtonStyle","useDashboard","DatasourceEditor","EditDatasourcesButton","isDatasourceEditorOpen","setIsDatasourceEditorOpen","getLocalDatasources","setLocalDatasources","getSavedDatasources","setSavedDatasources","localDatasources","savedDatasources","dashboard","setDashboard","openDatasourceEditor","closeDatasourceEditor","handleChangeDatasources","datasources","newSavedDatasources","Object","keys","filter","key","isDirect","plugin","spec","isSavedProxy","proxy","reduce","obj","kind","description","editDatasources","startIcon","onClick","aria-label","variant","color","sx","isOpen","onClose","PaperProps","width","data-testid","onCancel","onChange"],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ export * from './EditDatasourcesButton';
2
+ export * from './DatasourceEditor';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Datasources/index.ts"],"names":[],"mappings":"AAaA,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC"}
@@ -10,6 +10,7 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export * from './TimeRangeControls';
13
+ export * from './EditDatasourcesButton';
14
+ export * from './DatasourceEditor';
14
15
 
15
16
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Datasources/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 './EditDatasourcesButton';\nexport * from './DatasourceEditor';\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;AACxC,cAAc,qBAAqB"}
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const DeletePanelDialog: () => JSX.Element;
1
+ export declare const DeletePanelDialog: () => import("react/jsx-runtime").JSX.Element;
3
2
  //# sourceMappingURL=DeletePanelDialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeletePanelDialog.d.ts","sourceRoot":"","sources":["../../../src/components/DeletePanelDialog/DeletePanelDialog.tsx"],"names":[],"mappings":";AAiBA,eAAO,MAAM,iBAAiB,mBAS7B,CAAC"}
1
+ {"version":3,"file":"DeletePanelDialog.d.ts","sourceRoot":"","sources":["../../../src/components/DeletePanelDialog/DeletePanelDialog.tsx"],"names":[],"mappings":"AAiBA,eAAO,MAAM,iBAAiB,+CAS7B,CAAC"}
@@ -14,7 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  import { Dialog } from '@perses-dev/components';
15
15
  import { useDeletePanelDialog } from '../../context';
16
16
  export const DeletePanelDialog = ()=>{
17
- const { deletePanelDialog , closeDeletePanelDialog } = useDeletePanelDialog();
17
+ const { deletePanelDialog, closeDeletePanelDialog } = useDeletePanelDialog();
18
18
  return /*#__PURE__*/ _jsxs(Dialog, {
19
19
  open: deletePanelDialog !== undefined,
20
20
  children: [
@@ -28,11 +28,11 @@ export const DeletePanelDialog = ()=>{
28
28
  ]
29
29
  });
30
30
  };
31
- const DeletePanelForm = ({ deletePanelDialog })=>{
32
- const { deletePanel , closeDeletePanelDialog } = useDeletePanelDialog();
31
+ const DeletePanelForm = ({ deletePanelDialog })=>{
32
+ const { deletePanel, closeDeletePanelDialog } = useDeletePanelDialog();
33
33
  const handleDelete = (e)=>{
34
34
  e.preventDefault();
35
- const { panelGroupItemId } = deletePanelDialog;
35
+ const { panelGroupItemId } = deletePanelDialog;
36
36
  deletePanel(panelGroupItemId);
37
37
  closeDeletePanelDialog();
38
38
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/DeletePanelDialog/DeletePanelDialog.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 { Dialog } from '@perses-dev/components';\nimport { useDeletePanelDialog, DeletePanelDialogState } from '../../context';\n\nexport const DeletePanelDialog = () => {\n const { deletePanelDialog, closeDeletePanelDialog } = useDeletePanelDialog();\n\n return (\n <Dialog open={deletePanelDialog !== undefined}>\n <Dialog.Header onClose={() => closeDeletePanelDialog()}>Delete Panel</Dialog.Header>\n {deletePanelDialog && <DeletePanelForm deletePanelDialog={deletePanelDialog} />}\n </Dialog>\n );\n};\n\ninterface DeletePanelFormProps {\n deletePanelDialog: DeletePanelDialogState;\n}\n\nconst DeletePanelForm = ({ deletePanelDialog }: DeletePanelFormProps) => {\n const { deletePanel, closeDeletePanelDialog } = useDeletePanelDialog();\n\n const handleDelete = (e: FormEvent) => {\n e.preventDefault();\n const { panelGroupItemId } = deletePanelDialog;\n deletePanel(panelGroupItemId);\n closeDeletePanelDialog();\n };\n return (\n <form onSubmit={handleDelete}>\n <Dialog.Content>\n Are you sure you want to delete {deletePanelDialog.panelName} from {deletePanelDialog.panelGroupName}? This\n action cannot be undone.\n </Dialog.Content>\n <Dialog.Actions>\n <Dialog.PrimaryButton>Delete</Dialog.PrimaryButton>\n <Dialog.SecondaryButton onClick={() => closeDeletePanelDialog()}>Cancel</Dialog.SecondaryButton>\n </Dialog.Actions>\n </form>\n );\n};\n"],"names":["Dialog","useDeletePanelDialog","DeletePanelDialog","deletePanelDialog","closeDeletePanelDialog","open","undefined","Header","onClose","DeletePanelForm","deletePanel","handleDelete","e","preventDefault","panelGroupItemId","form","onSubmit","Content","panelName","panelGroupName","Actions","PrimaryButton","SecondaryButton","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;AACA,SAASA,MAAM,QAAQ,wBAAwB,CAAC;AAChD,SAASC,oBAAoB,QAAgC,eAAe,CAAC;AAE7E,OAAO,MAAMC,iBAAiB,GAAG,IAAM;IACrC,MAAM,EAAEC,iBAAiB,CAAA,EAAEC,sBAAsB,CAAA,EAAE,GAAGH,oBAAoB,EAAE,AAAC;IAE7E,qBACE,MAACD,MAAM;QAACK,IAAI,EAAEF,iBAAiB,KAAKG,SAAS;;0BAC3C,KAACN,MAAM,CAACO,MAAM;gBAACC,OAAO,EAAE,IAAMJ,sBAAsB,EAAE;0BAAE,cAAY;cAAgB;YACnFD,iBAAiB,kBAAI,KAACM,eAAe;gBAACN,iBAAiB,EAAEA,iBAAiB;cAAI;;MACxE,CACT;AACJ,CAAC,CAAC;AAMF,MAAMM,eAAe,GAAG,CAAC,EAAEN,iBAAiB,CAAA,EAAwB,GAAK;IACvE,MAAM,EAAEO,WAAW,CAAA,EAAEN,sBAAsB,CAAA,EAAE,GAAGH,oBAAoB,EAAE,AAAC;IAEvE,MAAMU,YAAY,GAAG,CAACC,CAAY,GAAK;QACrCA,CAAC,CAACC,cAAc,EAAE,CAAC;QACnB,MAAM,EAAEC,gBAAgB,CAAA,EAAE,GAAGX,iBAAiB,AAAC;QAC/CO,WAAW,CAACI,gBAAgB,CAAC,CAAC;QAC9BV,sBAAsB,EAAE,CAAC;IAC3B,CAAC,AAAC;IACF,qBACE,MAACW,MAAI;QAACC,QAAQ,EAAEL,YAAY;;0BAC1B,MAACX,MAAM,CAACiB,OAAO;;oBAAC,kCACkB;oBAACd,iBAAiB,CAACe,SAAS;oBAAC,QAAM;oBAACf,iBAAiB,CAACgB,cAAc;oBAAC,iCAEvG;;cAAiB;0BACjB,MAACnB,MAAM,CAACoB,OAAO;;kCACb,KAACpB,MAAM,CAACqB,aAAa;kCAAC,QAAM;sBAAuB;kCACnD,KAACrB,MAAM,CAACsB,eAAe;wBAACC,OAAO,EAAE,IAAMnB,sBAAsB,EAAE;kCAAE,QAAM;sBAAyB;;cACjF;;MACZ,CACP;AACJ,CAAC,AAAC"}
1
+ {"version":3,"sources":["../../../src/components/DeletePanelDialog/DeletePanelDialog.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 { Dialog } from '@perses-dev/components';\nimport { useDeletePanelDialog, DeletePanelDialogState } from '../../context';\n\nexport const DeletePanelDialog = () => {\n const { deletePanelDialog, closeDeletePanelDialog } = useDeletePanelDialog();\n\n return (\n <Dialog open={deletePanelDialog !== undefined}>\n <Dialog.Header onClose={() => closeDeletePanelDialog()}>Delete Panel</Dialog.Header>\n {deletePanelDialog && <DeletePanelForm deletePanelDialog={deletePanelDialog} />}\n </Dialog>\n );\n};\n\ninterface DeletePanelFormProps {\n deletePanelDialog: DeletePanelDialogState;\n}\n\nconst DeletePanelForm = ({ deletePanelDialog }: DeletePanelFormProps) => {\n const { deletePanel, closeDeletePanelDialog } = useDeletePanelDialog();\n\n const handleDelete = (e: FormEvent) => {\n e.preventDefault();\n const { panelGroupItemId } = deletePanelDialog;\n deletePanel(panelGroupItemId);\n closeDeletePanelDialog();\n };\n return (\n <form onSubmit={handleDelete}>\n <Dialog.Content>\n Are you sure you want to delete {deletePanelDialog.panelName} from {deletePanelDialog.panelGroupName}? This\n action cannot be undone.\n </Dialog.Content>\n <Dialog.Actions>\n <Dialog.PrimaryButton>Delete</Dialog.PrimaryButton>\n <Dialog.SecondaryButton onClick={() => closeDeletePanelDialog()}>Cancel</Dialog.SecondaryButton>\n </Dialog.Actions>\n </form>\n );\n};\n"],"names":["Dialog","useDeletePanelDialog","DeletePanelDialog","deletePanelDialog","closeDeletePanelDialog","open","undefined","Header","onClose","DeletePanelForm","deletePanel","handleDelete","e","preventDefault","panelGroupItemId","form","onSubmit","Content","panelName","panelGroupName","Actions","PrimaryButton","SecondaryButton","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;;AAGjC,SAASA,MAAM,QAAQ,yBAAyB;AAChD,SAASC,oBAAoB,QAAgC,gBAAgB;AAE7E,OAAO,MAAMC,oBAAoB;IAC/B,MAAM,EAAEC,iBAAiB,EAAEC,sBAAsB,EAAE,GAAGH;IAEtD,qBACE,MAACD;QAAOK,MAAMF,sBAAsBG;;0BAClC,KAACN,OAAOO,MAAM;gBAACC,SAAS,IAAMJ;0BAA0B;;YACvDD,mCAAqB,KAACM;gBAAgBN,mBAAmBA;;;;AAGhE,EAAE;AAMF,MAAMM,kBAAkB,CAAC,EAAEN,iBAAiB,EAAwB;IAClE,MAAM,EAAEO,WAAW,EAAEN,sBAAsB,EAAE,GAAGH;IAEhD,MAAMU,eAAe,CAACC;QACpBA,EAAEC,cAAc;QAChB,MAAM,EAAEC,gBAAgB,EAAE,GAAGX;QAC7BO,YAAYI;QACZV;IACF;IACA,qBACE,MAACW;QAAKC,UAAUL;;0BACd,MAACX,OAAOiB,OAAO;;oBAAC;oBACmBd,kBAAkBe,SAAS;oBAAC;oBAAOf,kBAAkBgB,cAAc;oBAAC;;;0BAGvG,MAACnB,OAAOoB,OAAO;;kCACb,KAACpB,OAAOqB,aAAa;kCAAC;;kCACtB,KAACrB,OAAOsB,eAAe;wBAACC,SAAS,IAAMnB;kCAA0B;;;;;;AAIzE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/DeletePanelDialog/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 './DeletePanelDialog';\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,qBAAqB,CAAC"}
1
+ {"version":3,"sources":["../../../src/components/DeletePanelDialog/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 './DeletePanelDialog';\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,sBAAsB"}
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const DeletePanelGroupDialog: () => JSX.Element;
1
+ export declare const DeletePanelGroupDialog: () => import("react/jsx-runtime").JSX.Element;
3
2
  //# sourceMappingURL=DeletePanelGroupDialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeletePanelGroupDialog.d.ts","sourceRoot":"","sources":["../../../src/components/DeletePanelGroupDialog/DeletePanelGroupDialog.tsx"],"names":[],"mappings":";AAkBA,eAAO,MAAM,sBAAsB,mBA4ClC,CAAC"}
1
+ {"version":3,"file":"DeletePanelGroupDialog.d.ts","sourceRoot":"","sources":["../../../src/components/DeletePanelGroupDialog/DeletePanelGroupDialog.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,sBAAsB,+CA4ClC,CAAC"}
@@ -15,7 +15,7 @@ import { IconButton, Dialog, DialogTitle, DialogContent, DialogActions, Button }
15
15
  import CloseIcon from 'mdi-material-ui/Close';
16
16
  import { useDeletePanelGroupDialog } from '../../context';
17
17
  export const DeletePanelGroupDialog = ()=>{
18
- const { deletePanelGroupDialog , closeDeletePanelGroupDialog , deletePanelGroup } = useDeletePanelGroupDialog();
18
+ const { deletePanelGroupDialog, closeDeletePanelGroupDialog, deletePanelGroup } = useDeletePanelGroupDialog();
19
19
  const panelGroupId = deletePanelGroupDialog === null || deletePanelGroupDialog === void 0 ? void 0 : deletePanelGroupDialog.panelGroupId;
20
20
  const handleDelete = (e)=>{
21
21
  e.preventDefault();
@@ -25,7 +25,7 @@ export const DeletePanelGroupDialog = ()=>{
25
25
  deletePanelGroup(panelGroupId);
26
26
  closeDeletePanelGroupDialog();
27
27
  };
28
- var ref;
28
+ var _deletePanelGroupDialog_panelGroupName;
29
29
  return /*#__PURE__*/ _jsxs(Dialog, {
30
30
  open: deletePanelGroupDialog !== undefined,
31
31
  children: [
@@ -52,7 +52,7 @@ export const DeletePanelGroupDialog = ()=>{
52
52
  },
53
53
  children: [
54
54
  "Are you sure you want to delete ",
55
- (ref = deletePanelGroupDialog === null || deletePanelGroupDialog === void 0 ? void 0 : deletePanelGroupDialog.panelGroupName) !== null && ref !== void 0 ? ref : 'panel group',
55
+ (_deletePanelGroupDialog_panelGroupName = deletePanelGroupDialog === null || deletePanelGroupDialog === void 0 ? void 0 : deletePanelGroupDialog.panelGroupName) !== null && _deletePanelGroupDialog_panelGroupName !== void 0 ? _deletePanelGroupDialog_panelGroupName : 'panel group',
56
56
  "? This will delete all the panels within the group."
57
57
  ]
58
58
  }),
@@ -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,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AACA,SAASA,UAAU,EAAEC,MAAM,EAAEC,WAAW,EAAEC,aAAa,EAAEC,aAAa,EAAEC,MAAM,QAAQ,eAAe,CAAC;AACtG,OAAOC,SAAS,MAAM,uBAAuB,CAAC;AAC9C,SAASC,yBAAyB,QAAQ,eAAe,CAAC;AAE1D,OAAO,MAAMC,sBAAsB,GAAG,IAAM;IAC1C,MAAM,EAAEC,sBAAsB,CAAA,EAAEC,2BAA2B,CAAA,EAAEC,gBAAgB,CAAA,EAAE,GAAGJ,yBAAyB,EAAE,AAAC;IAE9G,MAAMK,YAAY,GAAGH,sBAAsB,aAAtBA,sBAAsB,WAAc,GAApCA,KAAAA,CAAoC,GAApCA,sBAAsB,CAAEG,YAAY,AAAC;IAE1D,MAAMC,YAAY,GAAG,CAACC,CAAY,GAAK;QACrCA,CAAC,CAACC,cAAc,EAAE,CAAC;QACnB,IAAIH,YAAY,IAAII,SAAS,EAAE;YAC7B,MAAM,IAAIC,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAC9C,CAAC;QACDN,gBAAgB,CAACC,YAAY,CAAC,CAAC;QAC/BF,2BAA2B,EAAE,CAAC;IAChC,CAAC,AAAC;QAkBuCD,GAAsC;IAhB/E,qBACE,MAACR,MAAM;QAACiB,IAAI,EAAET,sBAAsB,KAAKO,SAAS;;0BAChD,KAACd,WAAW;0BAAC,oBAAkB;cAAc;0BAC7C,KAACF,UAAU;gBACTmB,YAAU,EAAC,OAAO;gBAClBC,OAAO,EAAE,IAAMV,2BAA2B,EAAE;gBAC5CW,EAAE,EAAE,CAACC,KAAK,GAAM,CAAA;wBACdC,QAAQ,EAAE,UAAU;wBACpBC,GAAG,EAAEF,KAAK,CAACG,OAAO,CAAC,GAAG,CAAC;wBACvBC,KAAK,EAAEJ,KAAK,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,sBAAsB,EAAEC,2BAA2B,EAAEC,gBAAgB,EAAE,GAAGJ;IAElF,MAAMK,eAAeH,mCAAAA,6CAAAA,uBAAwBG,YAAY;IAEzD,MAAMC,eAAe,CAACC;QACpBA,EAAEC,cAAc;QAChB,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,OAAO,CAAC;wBACnBC,OAAOJ,MAAMG,OAAO,CAAC;oBACvB,CAAA;0BAEA,cAAA,KAACnB;;0BAEH,MAACqB;gBAAKC,UAAUf;;kCACd,MAACV;wBAAc0B,QAAQ;wBAACR,IAAI;4BAAES,OAAO;wBAAQ;;4BAAG;4BACbrB,CAAAA,yCAAAA,mCAAAA,6CAAAA,uBAAwBsB,cAAc,cAAtCtB,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,3 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const DashboardDiscardChangesConfirmationDialog: () => JSX.Element | null;
1
+ export declare const DashboardDiscardChangesConfirmationDialog: () => import("react/jsx-runtime").JSX.Element | null;
3
2
  //# sourceMappingURL=DiscardChangesConfirmationDialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DiscardChangesConfirmationDialog.d.ts","sourceRoot":"","sources":["../../../src/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.tsx"],"names":[],"mappings":";AAgBA,eAAO,MAAM,yCAAyC,0BAgBrD,CAAC"}
1
+ {"version":3,"file":"DiscardChangesConfirmationDialog.d.ts","sourceRoot":"","sources":["../../../src/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.tsx"],"names":[],"mappings":"AAgBA,eAAO,MAAM,yCAAyC,sDAgBrD,CAAC"}
@@ -14,7 +14,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import { DiscardChangesConfirmationDialog } from '@perses-dev/components';
15
15
  import { useDiscardChangesConfirmationDialog } from '../../context';
16
16
  export const DashboardDiscardChangesConfirmationDialog = ()=>{
17
- const { discardChangesConfirmationDialog: dialog } = useDiscardChangesConfirmationDialog();
17
+ const { discardChangesConfirmationDialog: dialog } = useDiscardChangesConfirmationDialog();
18
18
  if (dialog === undefined) {
19
19
  return null;
20
20
  }
@@ -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,MAAM,EAAE,GAAGH;IACrD,IAAIG,WAAWC,WAAW;QACxB,OAAO;IACT;IACA,qBACE,KAACL;QACCM,aACEF,OAAOE,WAAW,IAClB;QAEFC,QAAQ;QACRC,UAAUJ,OAAOI,QAAQ;QACzBC,kBAAkBL,OAAOK,gBAAgB;;AAG/C,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,7 +1,6 @@
1
- /// <reference types="react" />
2
1
  interface DownloadButtonProps {
3
2
  heightPx?: number;
4
3
  }
5
- export declare function DownloadButton({ heightPx }: DownloadButtonProps): JSX.Element;
4
+ export declare function DownloadButton({ heightPx }: DownloadButtonProps): import("react/jsx-runtime").JSX.Element;
6
5
  export {};
7
6
  //# sourceMappingURL=DownloadButton.d.ts.map