@perses-dev/dashboards 0.0.0-snapshot-ts-panel-actions-90e9ef0 → 0.0.0-snapshot-reverse-proxy-75afbd7

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 (194) hide show
  1. package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +0 -2
  2. package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +5 -20
  3. package/dist/cjs/components/GridLayout/GridItemContent.js +79 -17
  4. package/dist/cjs/components/GridLayout/GridLayout.js +78 -126
  5. package/dist/cjs/components/GridLayout/Row.js +150 -0
  6. package/dist/cjs/components/GridLayout/index.js +1 -0
  7. package/dist/cjs/components/LeaveDialog/LeaveDialog.js +81 -0
  8. package/dist/cjs/components/LeaveDialog/index.js +30 -0
  9. package/dist/cjs/components/Panel/Panel.js +90 -2
  10. package/dist/cjs/components/Panel/PanelActions.js +37 -11
  11. package/dist/cjs/components/Panel/PanelHeader.js +37 -16
  12. package/dist/cjs/components/Panel/index.js +1 -0
  13. package/dist/cjs/components/PanelDrawer/PanelDrawer.js +58 -21
  14. package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +202 -180
  15. package/dist/cjs/components/PanelDrawer/PanelPreview.js +3 -0
  16. package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +9 -21
  17. package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +35 -15
  18. package/dist/cjs/components/QueryViewerDialog/QueryViewerDialog.js +121 -0
  19. package/dist/cjs/components/QueryViewerDialog/index.js +30 -0
  20. package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +2 -1
  21. package/dist/cjs/components/Variables/ListVariableListBox.js +201 -0
  22. package/dist/cjs/components/Variables/Variable.js +130 -72
  23. package/dist/cjs/components/Variables/VariableEditor.js +22 -15
  24. package/dist/cjs/components/Variables/index.js +1 -0
  25. package/dist/cjs/components/index.js +3 -1
  26. package/dist/cjs/constants/user-interface-text.js +4 -2
  27. package/dist/cjs/context/DashboardProvider/DashboardProvider.js +7 -8
  28. package/dist/cjs/context/DashboardProvider/DashboardProviderWithQueryParams.js +4 -4
  29. package/dist/cjs/context/DashboardProvider/duplicate-panel-slice.js +1 -1
  30. package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +2 -2
  31. package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +6 -2
  32. package/dist/cjs/context/DashboardProvider/panel-group-slice.js +1 -0
  33. package/dist/cjs/context/DashboardProvider/view-panel-slice.js +10 -3
  34. package/dist/cjs/context/PanelEditorProvider/PanelEditorProvider.js +49 -0
  35. package/dist/cjs/context/PanelEditorProvider/index.js +23 -0
  36. package/dist/cjs/context/VariableProvider/VariableProvider.js +1 -1
  37. package/dist/cjs/context/index.js +1 -0
  38. package/dist/cjs/context/useDashboard.js +5 -4
  39. package/dist/cjs/views/ViewDashboard/DashboardApp.js +7 -3
  40. package/dist/cjs/views/ViewDashboard/ViewDashboard.js +9 -8
  41. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -1
  42. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +0 -2
  43. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -1
  44. package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +2 -2
  45. package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
  46. package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
  47. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -1
  48. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +5 -15
  49. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
  50. package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
  51. package/dist/components/GridLayout/GridItemContent.js +39 -18
  52. package/dist/components/GridLayout/GridItemContent.js.map +1 -1
  53. package/dist/components/GridLayout/GridLayout.d.ts +8 -0
  54. package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
  55. package/dist/components/GridLayout/GridLayout.js +72 -126
  56. package/dist/components/GridLayout/GridLayout.js.map +1 -1
  57. package/dist/components/GridLayout/Row.d.ts +17 -0
  58. package/dist/components/GridLayout/Row.d.ts.map +1 -0
  59. package/dist/components/GridLayout/Row.js +142 -0
  60. package/dist/components/GridLayout/Row.js.map +1 -0
  61. package/dist/components/GridLayout/index.d.ts +1 -0
  62. package/dist/components/GridLayout/index.d.ts.map +1 -1
  63. package/dist/components/GridLayout/index.js +1 -0
  64. package/dist/components/GridLayout/index.js.map +1 -1
  65. package/dist/components/LeaveDialog/LeaveDialog.d.ts +13 -0
  66. package/dist/components/LeaveDialog/LeaveDialog.d.ts.map +1 -0
  67. package/dist/components/LeaveDialog/LeaveDialog.js +70 -0
  68. package/dist/components/LeaveDialog/LeaveDialog.js.map +1 -0
  69. package/dist/components/LeaveDialog/index.d.ts +2 -0
  70. package/dist/components/LeaveDialog/index.d.ts.map +1 -0
  71. package/dist/components/LeaveDialog/index.js +15 -0
  72. package/dist/components/LeaveDialog/index.js.map +1 -0
  73. package/dist/components/Panel/HeaderIconButton.d.ts +1 -1
  74. package/dist/components/Panel/Panel.d.ts +6 -0
  75. package/dist/components/Panel/Panel.d.ts.map +1 -1
  76. package/dist/components/Panel/Panel.js +92 -4
  77. package/dist/components/Panel/Panel.js.map +1 -1
  78. package/dist/components/Panel/PanelActions.d.ts +7 -1
  79. package/dist/components/Panel/PanelActions.d.ts.map +1 -1
  80. package/dist/components/Panel/PanelActions.js +37 -11
  81. package/dist/components/Panel/PanelActions.js.map +1 -1
  82. package/dist/components/Panel/PanelHeader.d.ts +8 -1
  83. package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
  84. package/dist/components/Panel/PanelHeader.js +38 -17
  85. package/dist/components/Panel/PanelHeader.js.map +1 -1
  86. package/dist/components/Panel/index.d.ts +1 -0
  87. package/dist/components/Panel/index.d.ts.map +1 -1
  88. package/dist/components/Panel/index.js +1 -0
  89. package/dist/components/Panel/index.js.map +1 -1
  90. package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
  91. package/dist/components/PanelDrawer/PanelDrawer.js +59 -22
  92. package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
  93. package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
  94. package/dist/components/PanelDrawer/PanelEditorForm.js +205 -183
  95. package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
  96. package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
  97. package/dist/components/PanelDrawer/PanelPreview.js +4 -1
  98. package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
  99. package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
  100. package/dist/components/PanelGroupDialog/PanelGroupDialog.js +8 -15
  101. package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
  102. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts +1 -0
  103. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts.map +1 -1
  104. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js +36 -16
  105. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -1
  106. package/dist/components/QueryViewerDialog/QueryViewerDialog.d.ts +9 -0
  107. package/dist/components/QueryViewerDialog/QueryViewerDialog.d.ts.map +1 -0
  108. package/dist/components/QueryViewerDialog/QueryViewerDialog.js +72 -0
  109. package/dist/components/QueryViewerDialog/QueryViewerDialog.js.map +1 -0
  110. package/dist/components/QueryViewerDialog/index.d.ts +2 -0
  111. package/dist/components/QueryViewerDialog/index.d.ts.map +1 -0
  112. package/dist/components/QueryViewerDialog/index.js +15 -0
  113. package/dist/components/QueryViewerDialog/index.js.map +1 -0
  114. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts.map +1 -1
  115. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +2 -1
  116. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
  117. package/dist/components/Variables/ListVariableListBox.d.ts +16 -0
  118. package/dist/components/Variables/ListVariableListBox.d.ts.map +1 -0
  119. package/dist/components/Variables/ListVariableListBox.js +141 -0
  120. package/dist/components/Variables/ListVariableListBox.js.map +1 -0
  121. package/dist/components/Variables/Variable.d.ts.map +1 -1
  122. package/dist/components/Variables/Variable.js +134 -76
  123. package/dist/components/Variables/Variable.js.map +1 -1
  124. package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
  125. package/dist/components/Variables/VariableEditor.js +24 -17
  126. package/dist/components/Variables/VariableEditor.js.map +1 -1
  127. package/dist/components/Variables/index.d.ts +1 -0
  128. package/dist/components/Variables/index.d.ts.map +1 -1
  129. package/dist/components/Variables/index.js +1 -0
  130. package/dist/components/Variables/index.js.map +1 -1
  131. package/dist/components/index.d.ts +3 -1
  132. package/dist/components/index.d.ts.map +1 -1
  133. package/dist/components/index.js +3 -1
  134. package/dist/components/index.js.map +1 -1
  135. package/dist/constants/user-interface-text.d.ts +2 -0
  136. package/dist/constants/user-interface-text.d.ts.map +1 -1
  137. package/dist/constants/user-interface-text.js +4 -2
  138. package/dist/constants/user-interface-text.js.map +1 -1
  139. package/dist/context/DashboardProvider/DashboardProvider.d.ts +5 -5
  140. package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
  141. package/dist/context/DashboardProvider/DashboardProvider.js +7 -8
  142. package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
  143. package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.d.ts.map +1 -1
  144. package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.js +5 -5
  145. package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.js.map +1 -1
  146. package/dist/context/DashboardProvider/common.d.ts +1 -1
  147. package/dist/context/DashboardProvider/common.d.ts.map +1 -1
  148. package/dist/context/DashboardProvider/common.js.map +1 -1
  149. package/dist/context/DashboardProvider/duplicate-panel-slice.js +2 -2
  150. package/dist/context/DashboardProvider/duplicate-panel-slice.js.map +1 -1
  151. package/dist/context/DashboardProvider/panel-editor-slice.d.ts +1 -0
  152. package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
  153. package/dist/context/DashboardProvider/panel-editor-slice.js +3 -3
  154. package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
  155. package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts +1 -0
  156. package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts.map +1 -1
  157. package/dist/context/DashboardProvider/panel-group-editor-slice.js +6 -2
  158. package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
  159. package/dist/context/DashboardProvider/panel-group-slice.d.ts +3 -0
  160. package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
  161. package/dist/context/DashboardProvider/panel-group-slice.js +1 -0
  162. package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
  163. package/dist/context/DashboardProvider/view-panel-slice.d.ts +6 -2
  164. package/dist/context/DashboardProvider/view-panel-slice.d.ts.map +1 -1
  165. package/dist/context/DashboardProvider/view-panel-slice.js +10 -3
  166. package/dist/context/DashboardProvider/view-panel-slice.js.map +1 -1
  167. package/dist/context/PanelEditorProvider/PanelEditorProvider.d.ts +13 -0
  168. package/dist/context/PanelEditorProvider/PanelEditorProvider.d.ts.map +1 -0
  169. package/dist/context/PanelEditorProvider/PanelEditorProvider.js +33 -0
  170. package/dist/context/PanelEditorProvider/PanelEditorProvider.js.map +1 -0
  171. package/dist/context/PanelEditorProvider/index.d.ts +3 -0
  172. package/dist/context/PanelEditorProvider/index.d.ts.map +1 -0
  173. package/dist/context/PanelEditorProvider/index.js +16 -0
  174. package/dist/context/PanelEditorProvider/index.js.map +1 -0
  175. package/dist/context/VariableProvider/VariableProvider.js +1 -1
  176. package/dist/context/VariableProvider/VariableProvider.js.map +1 -1
  177. package/dist/context/index.d.ts +1 -0
  178. package/dist/context/index.d.ts.map +1 -1
  179. package/dist/context/index.js +1 -0
  180. package/dist/context/index.js.map +1 -1
  181. package/dist/context/useDashboard.js +5 -4
  182. package/dist/context/useDashboard.js.map +1 -1
  183. package/dist/utils/panelUtils.d.ts +3 -0
  184. package/dist/utils/panelUtils.d.ts.map +1 -1
  185. package/dist/utils/panelUtils.js +3 -0
  186. package/dist/utils/panelUtils.js.map +1 -1
  187. package/dist/views/ViewDashboard/DashboardApp.d.ts +7 -6
  188. package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
  189. package/dist/views/ViewDashboard/DashboardApp.js +8 -4
  190. package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
  191. package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
  192. package/dist/views/ViewDashboard/ViewDashboard.js +9 -8
  193. package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
  194. package/package.json +8 -8
@@ -11,15 +11,17 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
14
- import { IconButton, Dialog, DialogTitle, DialogContent, DialogActions, Button } from '@mui/material';
15
- import CloseIcon from 'mdi-material-ui/Close';
16
14
  import { useState } from 'react';
15
+ import { useVariableValues } from '@perses-dev/plugin-system';
16
+ import { Dialog } from '@perses-dev/components';
17
+ import { Button } from '@mui/material';
17
18
  import { usePanelGroupEditor } from '../../context';
18
19
  import { PanelGroupEditorForm, panelGroupEditorFormId } from './PanelGroupEditorForm';
19
20
  /**
20
21
  * A dialog for adding or editing a Panel Group. Open and initial state is controlled by the DashboardStore.
21
22
  */ export function PanelGroupDialog() {
22
23
  const panelGroupEditor = usePanelGroupEditor();
24
+ const variables = useVariableValues();
23
25
  // When the user clicks close, start closing but don't call the store yet to keep values stable during animtation
24
26
  const [isClosing, setIsClosing] = useState(false);
25
27
  const handleClose = ()=>setIsClosing(true);
@@ -45,33 +47,24 @@ import { PanelGroupEditorForm, panelGroupEditorFormId } from './PanelGroupEditor
45
47
  },
46
48
  children: panelGroupEditor !== undefined && /*#__PURE__*/ _jsxs(_Fragment, {
47
49
  children: [
48
- /*#__PURE__*/ _jsxs(DialogTitle, {
50
+ /*#__PURE__*/ _jsxs(Dialog.Header, {
49
51
  children: [
50
52
  panelGroupEditor.mode,
51
53
  " Panel Group"
52
54
  ]
53
55
  }),
54
- /*#__PURE__*/ _jsx(IconButton, {
55
- "aria-label": "Close",
56
- onClick: panelGroupEditor.close,
57
- sx: (theme)=>({
58
- position: 'absolute',
59
- top: theme.spacing(0.5),
60
- right: theme.spacing(0.5)
61
- }),
62
- children: /*#__PURE__*/ _jsx(CloseIcon, {})
63
- }),
64
- /*#__PURE__*/ _jsx(DialogContent, {
56
+ /*#__PURE__*/ _jsx(Dialog.Content, {
65
57
  dividers: true,
66
58
  sx: {
67
59
  width: '500px'
68
60
  },
69
61
  children: /*#__PURE__*/ _jsx(PanelGroupEditorForm, {
70
62
  initialValues: panelGroupEditor.initialValues,
63
+ variables: Object.keys(variables),
71
64
  onSubmit: handleSubmit
72
65
  })
73
66
  }),
74
- /*#__PURE__*/ _jsxs(DialogActions, {
67
+ /*#__PURE__*/ _jsxs(Dialog.Actions, {
75
68
  children: [
76
69
  /*#__PURE__*/ _jsx(Button, {
77
70
  variant: "contained",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PanelGroupDialog/PanelGroupDialog.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 { IconButton, Dialog, DialogTitle, DialogContent, DialogActions, Button } from '@mui/material';\nimport CloseIcon from 'mdi-material-ui/Close';\nimport { ReactElement, useState } from 'react';\nimport { usePanelGroupEditor } from '../../context';\nimport { PanelGroupEditorForm, panelGroupEditorFormId, PanelGroupEditorFormProps } from './PanelGroupEditorForm';\n\n/**\n * A dialog for adding or editing a Panel Group. Open and initial state is controlled by the DashboardStore.\n */\nexport function PanelGroupDialog(): ReactElement {\n const panelGroupEditor = usePanelGroupEditor();\n\n // When the user clicks close, start closing but don't call the store yet to keep values stable during animtation\n const [isClosing, setIsClosing] = useState(false);\n const handleClose = (): void => setIsClosing(true);\n\n // Don't call close on the store until the Dialog has completely transitioned out\n const handleExited = (): void => {\n panelGroupEditor?.close();\n setIsClosing(false);\n };\n\n // Dialog is open if we have a model and we're not transitioning out\n const isOpen = panelGroupEditor !== undefined && isClosing === false;\n\n const handleSubmit: PanelGroupEditorFormProps['onSubmit'] = (values) => {\n // This shouldn't happen since we don't render the submit button until we have a model, but check to make TS happy\n if (panelGroupEditor === undefined) {\n throw new Error('Cannot apply changes');\n }\n panelGroupEditor.applyChanges(values);\n handleClose();\n };\n\n return (\n <Dialog open={isOpen} TransitionProps={{ onExited: handleExited }}>\n {panelGroupEditor !== undefined && (\n <>\n <DialogTitle>{panelGroupEditor.mode} Panel Group</DialogTitle>\n <IconButton\n aria-label=\"Close\"\n onClick={panelGroupEditor.close}\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 <DialogContent dividers sx={{ width: '500px' }}>\n <PanelGroupEditorForm initialValues={panelGroupEditor.initialValues} onSubmit={handleSubmit} />\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" type=\"submit\" form={panelGroupEditorFormId}>\n {panelGroupEditor.mode === 'Edit' ? 'Apply' : 'Add'}\n </Button>\n <Button variant=\"outlined\" color=\"secondary\" onClick={panelGroupEditor.close}>\n Cancel\n </Button>\n </DialogActions>\n </>\n )}\n </Dialog>\n );\n}\n"],"names":["IconButton","Dialog","DialogTitle","DialogContent","DialogActions","Button","CloseIcon","useState","usePanelGroupEditor","PanelGroupEditorForm","panelGroupEditorFormId","PanelGroupDialog","panelGroupEditor","isClosing","setIsClosing","handleClose","handleExited","close","isOpen","undefined","handleSubmit","values","Error","applyChanges","open","TransitionProps","onExited","mode","aria-label","onClick","sx","theme","position","top","spacing","right","dividers","width","initialValues","onSubmit","variant","type","form","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,SAASA,UAAU,EAAEC,MAAM,EAAEC,WAAW,EAAEC,aAAa,EAAEC,aAAa,EAAEC,MAAM,QAAQ,gBAAgB;AACtG,OAAOC,eAAe,wBAAwB;AAC9C,SAAuBC,QAAQ,QAAQ,QAAQ;AAC/C,SAASC,mBAAmB,QAAQ,gBAAgB;AACpD,SAASC,oBAAoB,EAAEC,sBAAsB,QAAmC,yBAAyB;AAEjH;;CAEC,GACD,OAAO,SAASC;IACd,MAAMC,mBAAmBJ;IAEzB,iHAAiH;IACjH,MAAM,CAACK,WAAWC,aAAa,GAAGP,SAAS;IAC3C,MAAMQ,cAAc,IAAYD,aAAa;IAE7C,iFAAiF;IACjF,MAAME,eAAe;QACnBJ,kBAAkBK;QAClBH,aAAa;IACf;IAEA,oEAAoE;IACpE,MAAMI,SAASN,qBAAqBO,aAAaN,cAAc;IAE/D,MAAMO,eAAsD,CAACC;QAC3D,kHAAkH;QAClH,IAAIT,qBAAqBO,WAAW;YAClC,MAAM,IAAIG,MAAM;QAClB;QACAV,iBAAiBW,YAAY,CAACF;QAC9BN;IACF;IAEA,qBACE,KAACd;QAAOuB,MAAMN;QAAQO,iBAAiB;YAAEC,UAAUV;QAAa;kBAC7DJ,qBAAqBO,2BACpB;;8BACE,MAACjB;;wBAAaU,iBAAiBe,IAAI;wBAAC;;;8BACpC,KAAC3B;oBACC4B,cAAW;oBACXC,SAASjB,iBAAiBK,KAAK;oBAC/Ba,IAAI,CAACC,QAAW,CAAA;4BACdC,UAAU;4BACVC,KAAKF,MAAMG,OAAO,CAAC;4BACnBC,OAAOJ,MAAMG,OAAO,CAAC;wBACvB,CAAA;8BAEA,cAAA,KAAC5B;;8BAEH,KAACH;oBAAciC,QAAQ;oBAACN,IAAI;wBAAEO,OAAO;oBAAQ;8BAC3C,cAAA,KAAC5B;wBAAqB6B,eAAe1B,iBAAiB0B,aAAa;wBAAEC,UAAUnB;;;8BAEjF,MAAChB;;sCACC,KAACC;4BAAOmC,SAAQ;4BAAYC,MAAK;4BAASC,MAAMhC;sCAC7CE,iBAAiBe,IAAI,KAAK,SAAS,UAAU;;sCAEhD,KAACtB;4BAAOmC,SAAQ;4BAAWG,OAAM;4BAAYd,SAASjB,iBAAiBK,KAAK;sCAAE;;;;;;;AAQ1F"}
1
+ {"version":3,"sources":["../../../src/components/PanelGroupDialog/PanelGroupDialog.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 { ReactElement, useState } from 'react';\nimport { useVariableValues } from '@perses-dev/plugin-system';\nimport { Dialog } from '@perses-dev/components';\nimport { Button } from '@mui/material';\nimport { usePanelGroupEditor } from '../../context';\nimport { PanelGroupEditorForm, panelGroupEditorFormId, PanelGroupEditorFormProps } from './PanelGroupEditorForm';\n\n/**\n * A dialog for adding or editing a Panel Group. Open and initial state is controlled by the DashboardStore.\n */\nexport function PanelGroupDialog(): ReactElement {\n const panelGroupEditor = usePanelGroupEditor();\n const variables = useVariableValues();\n\n // When the user clicks close, start closing but don't call the store yet to keep values stable during animtation\n const [isClosing, setIsClosing] = useState(false);\n const handleClose = (): void => setIsClosing(true);\n\n // Don't call close on the store until the Dialog has completely transitioned out\n const handleExited = (): void => {\n panelGroupEditor?.close();\n setIsClosing(false);\n };\n\n // Dialog is open if we have a model and we're not transitioning out\n const isOpen = panelGroupEditor !== undefined && isClosing === false;\n\n const handleSubmit: PanelGroupEditorFormProps['onSubmit'] = (values) => {\n // This shouldn't happen since we don't render the submit button until we have a model, but check to make TS happy\n if (panelGroupEditor === undefined) {\n throw new Error('Cannot apply changes');\n }\n panelGroupEditor.applyChanges(values);\n handleClose();\n };\n\n return (\n <Dialog open={isOpen} TransitionProps={{ onExited: handleExited }}>\n {panelGroupEditor !== undefined && (\n <>\n <Dialog.Header>{panelGroupEditor.mode} Panel Group</Dialog.Header>\n <Dialog.Content dividers sx={{ width: '500px' }}>\n <PanelGroupEditorForm\n initialValues={panelGroupEditor.initialValues}\n variables={Object.keys(variables)}\n onSubmit={handleSubmit}\n />\n </Dialog.Content>\n <Dialog.Actions>\n <Button variant=\"contained\" type=\"submit\" form={panelGroupEditorFormId}>\n {panelGroupEditor.mode === 'Edit' ? 'Apply' : 'Add'}\n </Button>\n <Button variant=\"outlined\" color=\"secondary\" onClick={panelGroupEditor.close}>\n Cancel\n </Button>\n </Dialog.Actions>\n </>\n )}\n </Dialog>\n );\n}\n"],"names":["useState","useVariableValues","Dialog","Button","usePanelGroupEditor","PanelGroupEditorForm","panelGroupEditorFormId","PanelGroupDialog","panelGroupEditor","variables","isClosing","setIsClosing","handleClose","handleExited","close","isOpen","undefined","handleSubmit","values","Error","applyChanges","open","TransitionProps","onExited","Header","mode","Content","dividers","sx","width","initialValues","Object","keys","onSubmit","Actions","variant","type","form","color","onClick"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C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CAC7CE,iBAAiBiB,IAAI,KAAK,SAAS,UAAU;;sCAEhD,KAACtB;4BAAOgC,SAAQ;4BAAWG,OAAM;4BAAYC,SAAS/B,iBAAiBM,KAAK;sCAAE;;;;;;;AAQ1F"}
@@ -2,6 +2,7 @@ import { ReactElement } from 'react';
2
2
  import { PanelGroupEditorValues } from '../../context';
3
3
  export interface PanelGroupEditorFormProps {
4
4
  initialValues: PanelGroupEditorValues;
5
+ variables?: string[];
5
6
  onSubmit: (next: PanelGroupEditorValues) => void;
6
7
  }
7
8
  export declare function PanelGroupEditorForm(props: PanelGroupEditorFormProps): ReactElement;
@@ -1 +1 @@
1
- {"version":3,"file":"PanelGroupEditorForm.d.ts","sourceRoot":"","sources":["../../../src/components/PanelGroupDialog/PanelGroupEditorForm.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAoB,YAAY,EAAY,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAIvD,MAAM,WAAW,yBAAyB;IACxC,aAAa,EAAE,sBAAsB,CAAC;IACtC,QAAQ,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,IAAI,CAAC;CAClD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,YAAY,CAsCnF;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,4BAA4B,CAAC"}
1
+ {"version":3,"file":"PanelGroupEditorForm.d.ts","sourceRoot":"","sources":["../../../src/components/PanelGroupDialog/PanelGroupEditorForm.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAoB,YAAY,EAAY,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAM,WAAW,yBAAyB;IACxC,aAAa,EAAE,sBAAsB,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,IAAI,CAAC;CAClD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,YAAY,CA2DnF;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,4BAA4B,CAAC"}
@@ -12,20 +12,18 @@
12
12
  // limitations under the License.
13
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  import { useState } from 'react';
15
- import { FormControl, InputLabel, TextField, Select, MenuItem } from '@mui/material';
15
+ import { FormControl, TextField, MenuItem, Typography } from '@mui/material';
16
16
  export function PanelGroupEditorForm(props) {
17
- const { initialValues, onSubmit } = props;
17
+ const { initialValues, variables, onSubmit } = props;
18
18
  const [title, setTitle] = useState(initialValues.title);
19
19
  const [isCollapsed, setIsCollapsed] = useState(initialValues.isCollapsed);
20
- const handleCollapsedChange = (e)=>{
21
- const next = e.target.value;
22
- setIsCollapsed(next === 'Closed');
23
- };
20
+ const [repeatVariable, setRepeatVariable] = useState(initialValues.repeatVariable);
24
21
  const handleSubmit = (e)=>{
25
22
  e.preventDefault();
26
23
  onSubmit({
27
24
  title,
28
- isCollapsed
25
+ isCollapsed,
26
+ repeatVariable
29
27
  });
30
28
  };
31
29
  return /*#__PURE__*/ _jsxs("form", {
@@ -40,25 +38,21 @@ export function PanelGroupEditorForm(props) {
40
38
  label: "Name",
41
39
  variant: "outlined",
42
40
  value: title,
43
- onChange: (e)=>setTitle(e.target.value)
41
+ onChange: (e)=>setTitle(e.target.value),
42
+ "data-testid": "panel-group-editor-name"
44
43
  })
45
44
  }),
46
45
  /*#__PURE__*/ _jsxs(FormControl, {
47
46
  fullWidth: true,
48
47
  margin: "normal",
49
48
  children: [
50
- /*#__PURE__*/ _jsx(InputLabel, {
51
- id: "select-collapse-state",
52
- children: "Collapse State"
53
- }),
54
- /*#__PURE__*/ _jsxs(Select, {
49
+ /*#__PURE__*/ _jsxs(TextField, {
50
+ select: true,
55
51
  required: true,
56
- displayEmpty: true,
57
- labelId: "select-collapse-state",
58
52
  label: "Collapse State",
59
53
  size: "small",
60
54
  value: isCollapsed ? 'Closed' : 'Open',
61
- onChange: handleCollapsedChange,
55
+ onChange: (e)=>setIsCollapsed(e.target.value === 'Closed'),
62
56
  children: [
63
57
  /*#__PURE__*/ _jsx(MenuItem, {
64
58
  value: "Open",
@@ -69,6 +63,32 @@ export function PanelGroupEditorForm(props) {
69
63
  children: "Closed"
70
64
  })
71
65
  ]
66
+ }),
67
+ /*#__PURE__*/ _jsx(FormControl, {
68
+ fullWidth: true,
69
+ margin: "normal",
70
+ children: /*#__PURE__*/ _jsxs(TextField, {
71
+ select: true,
72
+ label: "Repeat Variable",
73
+ variant: "outlined",
74
+ value: repeatVariable ?? '',
75
+ onChange: (e)=>setRepeatVariable(e.target.value === '' ? undefined : e.target.value),
76
+ children: [
77
+ /*#__PURE__*/ _jsx(MenuItem, {
78
+ value: "",
79
+ children: /*#__PURE__*/ _jsx(Typography, {
80
+ sx: {
81
+ fontStyle: 'italic'
82
+ },
83
+ children: "None"
84
+ })
85
+ }),
86
+ variables?.sort((a, b)=>a.localeCompare(b)).map((variable)=>/*#__PURE__*/ _jsx(MenuItem, {
87
+ value: variable,
88
+ children: variable
89
+ }, variable))
90
+ ]
91
+ })
72
92
  })
73
93
  ]
74
94
  })
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PanelGroupDialog/PanelGroupEditorForm.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 { FormEventHandler, ReactElement, useState } from 'react';\nimport { FormControl, InputLabel, TextField, Select, SelectProps, MenuItem } from '@mui/material';\nimport { PanelGroupEditorValues } from '../../context';\n\ntype CollapsedState = 'Open' | 'Closed';\n\nexport interface PanelGroupEditorFormProps {\n initialValues: PanelGroupEditorValues;\n onSubmit: (next: PanelGroupEditorValues) => void;\n}\n\nexport function PanelGroupEditorForm(props: PanelGroupEditorFormProps): ReactElement {\n const { initialValues, onSubmit } = props;\n\n const [title, setTitle] = useState(initialValues.title);\n const [isCollapsed, setIsCollapsed] = useState(initialValues.isCollapsed);\n\n const handleCollapsedChange: SelectProps<CollapsedState>['onChange'] = (e) => {\n const next = e.target.value;\n setIsCollapsed(next === 'Closed');\n };\n\n const handleSubmit: FormEventHandler = (e) => {\n e.preventDefault();\n onSubmit({ title, isCollapsed });\n };\n\n return (\n <form id={panelGroupEditorFormId} onSubmit={handleSubmit}>\n <FormControl fullWidth margin=\"normal\">\n <TextField required label=\"Name\" variant=\"outlined\" value={title} onChange={(e) => setTitle(e.target.value)} />\n </FormControl>\n <FormControl fullWidth margin=\"normal\">\n <InputLabel id=\"select-collapse-state\">Collapse State</InputLabel>\n <Select<CollapsedState>\n required\n displayEmpty\n labelId=\"select-collapse-state\"\n label=\"Collapse State\"\n size=\"small\"\n value={isCollapsed ? 'Closed' : 'Open'}\n onChange={handleCollapsedChange}\n >\n <MenuItem value=\"Open\">Open</MenuItem>\n <MenuItem value=\"Closed\">Closed</MenuItem>\n </Select>\n </FormControl>\n </form>\n );\n}\n\n/**\n * The `id` attribute added to the `PanelGroupEditorForm` component, allowing submit buttons to live outside the form.\n */\nexport const panelGroupEditorFormId = 'panel-group-editor-form';\n"],"names":["useState","FormControl","InputLabel","TextField","Select","MenuItem","PanelGroupEditorForm","props","initialValues","onSubmit","title","setTitle","isCollapsed","setIsCollapsed","handleCollapsedChange","e","next","target","value","handleSubmit","preventDefault","form","id","panelGroupEditorFormId","fullWidth","margin","required","label","variant","onChange","displayEmpty","labelId","size"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C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roupDialog/PanelGroupEditorForm.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 { FormEventHandler, ReactElement, useState } from 'react';\nimport { FormControl, TextField, MenuItem, Typography } from '@mui/material';\nimport { PanelGroupEditorValues } from '../../context';\n\nexport interface PanelGroupEditorFormProps {\n initialValues: PanelGroupEditorValues;\n variables?: string[];\n onSubmit: (next: PanelGroupEditorValues) => void;\n}\n\nexport function PanelGroupEditorForm(props: PanelGroupEditorFormProps): ReactElement {\n const { initialValues, variables, onSubmit } = props;\n\n const [title, setTitle] = useState(initialValues.title);\n const [isCollapsed, setIsCollapsed] = useState(initialValues.isCollapsed);\n const [repeatVariable, setRepeatVariable] = useState<string | undefined>(initialValues.repeatVariable);\n\n const handleSubmit: FormEventHandler = (e) => {\n e.preventDefault();\n onSubmit({ title, isCollapsed, repeatVariable });\n };\n\n return (\n <form id={panelGroupEditorFormId} onSubmit={handleSubmit}>\n <FormControl fullWidth margin=\"normal\">\n <TextField\n required\n label=\"Name\"\n variant=\"outlined\"\n value={title}\n onChange={(e) => setTitle(e.target.value)}\n data-testid=\"panel-group-editor-name\"\n />\n </FormControl>\n <FormControl fullWidth margin=\"normal\">\n <TextField\n select\n required\n label=\"Collapse State\"\n size=\"small\"\n value={isCollapsed ? 'Closed' : 'Open'}\n onChange={(e) => setIsCollapsed(e.target.value === 'Closed')}\n >\n <MenuItem value=\"Open\">Open</MenuItem>\n <MenuItem value=\"Closed\">Closed</MenuItem>\n </TextField>\n <FormControl fullWidth margin=\"normal\">\n <TextField\n select\n label=\"Repeat Variable\"\n variant=\"outlined\"\n value={repeatVariable ?? ''}\n onChange={(e) => setRepeatVariable(e.target.value === '' ? undefined : e.target.value)}\n >\n <MenuItem value=\"\">\n <Typography sx={{ fontStyle: 'italic' }}>None</Typography>\n </MenuItem>\n {variables\n ?.sort((a, b) => a.localeCompare(b))\n .map((variable) => (\n <MenuItem key={variable} value={variable}>\n {variable}\n </MenuItem>\n ))}\n </TextField>\n </FormControl>\n </FormControl>\n </form>\n );\n}\n\n/**\n * The `id` attribute added to the `PanelGroupEditorForm` component, allowing submit buttons to live outside the form.\n */\nexport const panelGroupEditorFormId = 'panel-group-editor-form';\n"],"names":["useState","FormControl","TextField","MenuItem","Typography","PanelGroupEditorForm","props","initialValues","variables","onSubmit","title","setTitle","isCollapsed","setIsCollapsed","repeatVariable","setRepeatVariable","handleSubmit","e","preventDefault","form","id","panelGroupEditorFormId","fullWidth","margin","required","label","variant","value","onChange","target","data-testid","select","size","undefined","sx","fontStyle","sort","a","b","localeCompare","map","variable"],"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,SAAyCA,QAAQ,QAAQ,QAAQ;AACjE,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,gBAAgB;AAS7E,OAAO,SAASC,qBAAqBC,KAAgC;IACnE,MAAM,EAAEC,aAAa,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGH;IAE/C,MAAM,CAACI,OAAOC,SAAS,GAAGX,SAASO,cAAcG,KAAK;IACtD,MAAM,CAACE,aAAaC,eAAe,GAAGb,SAASO,cAAcK,WAAW;IACxE,MAAM,CAACE,gBAAgBC,kBAAkB,GAAGf,SAA6BO,cAAcO,cAAc;IAErG,MAAME,eAAiC,CAACC;QACtCA,EAAEC,cAAc;QAChBT,SAAS;YAAEC;YAAOE;YAAaE;QAAe;IAChD;IAEA,qBACE,MAACK;QAAKC,IAAIC;QAAwBZ,UAAUO;;0BAC1C,KAACf;gBAAYqB,SAAS;gBAACC,QAAO;0BAC5B,cAAA,KAACrB;oBACCsB,QAAQ;oBACRC,OAAM;oBACNC,SAAQ;oBACRC,OAAOjB;oBACPkB,UAAU,CAACX,IAAMN,SAASM,EAAEY,MAAM,CAACF,KAAK;oBACxCG,eAAY;;;0BAGhB,MAAC7B;gBAAYqB,SAAS;gBAACC,QAAO;;kCAC5B,MAACrB;wBACC6B,MAAM;wBACNP,QAAQ;wBACRC,OAAM;wBACNO,MAAK;wBACLL,OAAOf,cAAc,WAAW;wBAChCgB,UAAU,CAACX,IAAMJ,eAAeI,EAAEY,MAAM,CAACF,KAAK,KAAK;;0CAEnD,KAACxB;gCAASwB,OAAM;0CAAO;;0CACvB,KAACxB;gCAASwB,OAAM;0CAAS;;;;kCAE3B,KAAC1B;wBAAYqB,SAAS;wBAACC,QAAO;kCAC5B,cAAA,MAACrB;4BACC6B,MAAM;4BACNN,OAAM;4BACNC,SAAQ;4BACRC,OAAOb,kBAAkB;4BACzBc,UAAU,CAACX,IAAMF,kBAAkBE,EAAEY,MAAM,CAACF,KAAK,KAAK,KAAKM,YAAYhB,EAAEY,MAAM,CAACF,KAAK;;8CAErF,KAACxB;oCAASwB,OAAM;8CACd,cAAA,KAACvB;wCAAW8B,IAAI;4CAAEC,WAAW;wCAAS;kDAAG;;;gCAE1C3B,WACG4B,KAAK,CAACC,GAAGC,IAAMD,EAAEE,aAAa,CAACD,IAChCE,IAAI,CAACC,yBACJ,KAACtC;wCAAwBwB,OAAOc;kDAC7BA;uCADYA;;;;;;;;AAS/B;AAEA;;CAEC,GACD,OAAO,MAAMpB,yBAAyB,0BAA0B"}
@@ -0,0 +1,9 @@
1
+ import { ReactElement } from 'react';
2
+ import { QueryDefinition } from '@perses-dev/core';
3
+ export interface QueryViewerDialogProps {
4
+ open: boolean;
5
+ queryDefinitions: QueryDefinition[];
6
+ onClose: () => void;
7
+ }
8
+ export declare function QueryViewerDialog({ open, queryDefinitions, onClose }: QueryViewerDialogProps): ReactElement;
9
+ //# sourceMappingURL=QueryViewerDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryViewerDialog.d.ts","sourceRoot":"","sources":["../../../src/components/QueryViewerDialog/QueryViewerDialog.tsx"],"names":[],"mappings":"AAaA,OAAc,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAIrD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,CAAC;IACd,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,EAAE,sBAAsB,GAAG,YAAY,CAmC3G"}
@@ -0,0 +1,72 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import React, { useMemo } from 'react';
15
+ import { Dialog } from '@perses-dev/components';
16
+ import { Button, Divider } from '@mui/material';
17
+ import { PluginSpecEditor } from '@perses-dev/plugin-system';
18
+ export function QueryViewerDialog({ open, queryDefinitions, onClose }) {
19
+ const queryRows = useMemo(()=>{
20
+ if (!queryDefinitions?.length) return null;
21
+ const queryItems = [];
22
+ queryDefinitions.forEach((query, index)=>{
23
+ if (query?.spec?.plugin?.kind && query?.kind) {
24
+ queryItems.push(/*#__PURE__*/ _jsxs(React.Fragment, {
25
+ children: [
26
+ /*#__PURE__*/ _jsx(PluginSpecEditor, {
27
+ value: query.spec.plugin.spec,
28
+ pluginSelection: {
29
+ kind: query.spec.plugin.kind,
30
+ type: query.kind
31
+ },
32
+ onChange: ()=>{},
33
+ isReadonly: true
34
+ }),
35
+ index < queryDefinitions.length - 1 && /*#__PURE__*/ _jsx(Divider, {
36
+ sx: {
37
+ my: 2
38
+ }
39
+ })
40
+ ]
41
+ }, `query-${index}`));
42
+ }
43
+ });
44
+ return queryItems;
45
+ }, [
46
+ queryDefinitions
47
+ ]);
48
+ return /*#__PURE__*/ _jsxs(Dialog, {
49
+ open: open,
50
+ onClose: onClose,
51
+ maxWidth: "lg",
52
+ fullWidth: true,
53
+ children: [
54
+ /*#__PURE__*/ _jsx(Dialog.Header, {
55
+ children: "Query Viewer"
56
+ }),
57
+ /*#__PURE__*/ _jsx(Dialog.Content, {
58
+ children: queryRows
59
+ }),
60
+ /*#__PURE__*/ _jsx(Dialog.Actions, {
61
+ children: /*#__PURE__*/ _jsx(Button, {
62
+ variant: "outlined",
63
+ color: "secondary",
64
+ onClick: onClose,
65
+ children: "Close"
66
+ })
67
+ })
68
+ ]
69
+ });
70
+ }
71
+
72
+ //# sourceMappingURL=QueryViewerDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/QueryViewerDialog/QueryViewerDialog.tsx"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React, { ReactElement, useMemo } from 'react';\nimport { Dialog } from '@perses-dev/components';\nimport { Button, Divider } from '@mui/material';\nimport { PluginSpecEditor } from '@perses-dev/plugin-system';\nimport { QueryDefinition } from '@perses-dev/core';\n\nexport interface QueryViewerDialogProps {\n open: boolean;\n queryDefinitions: QueryDefinition[];\n onClose: () => void;\n}\n\nexport function QueryViewerDialog({ open, queryDefinitions, onClose }: QueryViewerDialogProps): ReactElement {\n const queryRows = useMemo(() => {\n if (!queryDefinitions?.length) return null;\n\n const queryItems: ReactElement[] = [];\n queryDefinitions.forEach((query, index) => {\n if (query?.spec?.plugin?.kind && query?.kind) {\n queryItems.push(\n <React.Fragment key={`query-${index}`}>\n <PluginSpecEditor\n value={query.spec.plugin.spec}\n pluginSelection={{ kind: query.spec.plugin.kind, type: query.kind }}\n onChange={(): void => {}}\n isReadonly\n />\n {index < queryDefinitions.length - 1 && <Divider sx={{ my: 2 }} />}\n </React.Fragment>\n );\n }\n });\n\n return queryItems;\n }, [queryDefinitions]);\n\n return (\n <Dialog open={open} onClose={onClose} maxWidth=\"lg\" fullWidth={true}>\n <Dialog.Header>Query Viewer</Dialog.Header>\n <Dialog.Content>{queryRows}</Dialog.Content>\n <Dialog.Actions>\n <Button variant=\"outlined\" color=\"secondary\" onClick={onClose}>\n Close\n </Button>\n </Dialog.Actions>\n </Dialog>\n );\n}\n"],"names":["React","useMemo","Dialog","Button","Divider","PluginSpecEditor","QueryViewerDialog","open","queryDefinitions","onClose","queryRows","length","queryItems","forEach","query","index","spec","plugin","kind","push","Fragment","value","pluginSelection","type","onChange","isReadonly","sx","my","maxWidth","fullWidth","Header","Content","Actions","variant","color","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,SAAuBC,OAAO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"","sources":["../../../src/components/QueryViewerDialog/index.ts"],"names":[],"mappings":"AAaA,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,15 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ export * from './QueryViewerDialog';
14
+
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/QueryViewerDialog/index.ts"],"sourcesContent":["// Copyright 2025 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 './QueryViewerDialog';\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 +1 @@
1
- {"version":3,"file":"SaveChangesConfirmationDialog.d.ts","sourceRoot":"","sources":["../../../src/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AAO/C,eAAO,MAAM,6BAA6B,QAAO,YAqEhD,CAAC"}
1
+ {"version":3,"file":"SaveChangesConfirmationDialog.d.ts","sourceRoot":"","sources":["../../../src/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AAU/C,eAAO,MAAM,6BAA6B,QAAO,YAqEhD,CAAC"}
@@ -14,9 +14,10 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
14
14
  import { useState } from 'react';
15
15
  import { Checkbox, FormGroup, FormControlLabel, Typography } from '@mui/material';
16
16
  import { useTimeRange } from '@perses-dev/plugin-system';
17
- import { isRelativeTimeRange, SAVE_DEFAULTS_DIALOG_TEXT } from '@perses-dev/core';
17
+ import { isRelativeTimeRange } from '@perses-dev/core';
18
18
  import { Dialog } from '@perses-dev/components';
19
19
  import { useSaveChangesConfirmationDialog, useVariableDefinitionActions } from '../../context';
20
+ const SAVE_DEFAULTS_DIALOG_TEXT = 'You have made changes to the time range or the variables values. Would you like to save these as defaults?';
20
21
  export const SaveChangesConfirmationDialog = ()=>{
21
22
  const { saveChangesConfirmationDialog: dialog } = useSaveChangesConfirmationDialog();
22
23
  const isSavedDurationModified = dialog?.isSavedDurationModified ?? true;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.tsx"],"sourcesContent":["// Copyright 2024 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 { ReactElement, useState } from 'react';\nimport { Checkbox, FormGroup, FormControlLabel, Typography } from '@mui/material';\nimport { useTimeRange } from '@perses-dev/plugin-system';\nimport { isRelativeTimeRange, SAVE_DEFAULTS_DIALOG_TEXT } from '@perses-dev/core';\nimport { Dialog } from '@perses-dev/components';\nimport { useSaveChangesConfirmationDialog, useVariableDefinitionActions } from '../../context';\n\nexport const SaveChangesConfirmationDialog = (): ReactElement => {\n const { saveChangesConfirmationDialog: dialog } = useSaveChangesConfirmationDialog();\n const isSavedDurationModified = dialog?.isSavedDurationModified ?? true;\n const isSavedVariableModified = dialog?.isSavedVariableModified ?? true;\n const [saveDefaultTimeRange, setSaveDefaultTimeRange] = useState(isSavedDurationModified);\n const [saveDefaultVariables, setSaveDefaultVariables] = useState(isSavedVariableModified);\n\n const { getSavedVariablesStatus } = useVariableDefinitionActions();\n const { modifiedVariableNames } = getSavedVariablesStatus();\n\n const isOpen = dialog !== undefined;\n\n const { timeRange } = useTimeRange();\n const currentTimeRangeText = isRelativeTimeRange(timeRange)\n ? `(Last ${timeRange.pastDuration})`\n : '(Absolute time ranges can not be saved)';\n\n const saveTimeRangeText = `Save current time range as new default ${currentTimeRangeText}`;\n\n const saveVariablesText = `Save current variable values as new default (${\n modifiedVariableNames.length > 0 ? modifiedVariableNames.join(', ') : 'No modified variables'\n })`;\n\n return (\n <Dialog open={isOpen}>\n {dialog !== undefined && (\n <>\n <Dialog.Header onClose={() => dialog.onCancel()}>Save Dashboard</Dialog.Header>\n\n <Dialog.Content>\n <Typography marginBottom={2}>{dialog.description || SAVE_DEFAULTS_DIALOG_TEXT}</Typography>\n <FormGroup>\n <FormControlLabel\n control={\n <Checkbox\n disabled={!isSavedDurationModified || !isRelativeTimeRange(timeRange)}\n checked={saveDefaultTimeRange && isSavedDurationModified && isRelativeTimeRange(timeRange)}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => setSaveDefaultTimeRange(e.target.checked)}\n />\n }\n label={saveTimeRangeText}\n />\n <FormControlLabel\n control={\n <Checkbox\n disabled={!isSavedVariableModified}\n checked={saveDefaultVariables && isSavedVariableModified}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => setSaveDefaultVariables(e.target.checked)}\n />\n }\n label={saveVariablesText}\n />\n </FormGroup>\n </Dialog.Content>\n\n <Dialog.Actions>\n <Dialog.PrimaryButton\n onClick={() => {\n return dialog.onSaveChanges(saveDefaultTimeRange, saveDefaultVariables);\n }}\n >\n Save Changes\n </Dialog.PrimaryButton>\n <Dialog.SecondaryButton onClick={() => dialog.onCancel()}>Cancel</Dialog.SecondaryButton>\n </Dialog.Actions>\n </>\n )}\n </Dialog>\n );\n};\n"],"names":["useState","Checkbox","FormGroup","FormControlLabel","Typography","useTimeRange","isRelativeTimeRange","SAVE_DEFAULTS_DIALOG_TEXT","Dialog","useSaveChangesConfirmationDialog","useVariableDefinitionActions","SaveChangesConfirmationDialog","saveChangesConfirmationDialog","dialog","isSavedDurationModified","isSavedVariableModified","saveDefaultTimeRange","setSaveDefaultTimeRange","saveDefaultVariables","setSaveDefaultVariables","getSavedVariablesStatus","modifiedVariableNames","isOpen","undefined","timeRange","currentTimeRangeText","pastDuration","saveTimeRangeText","saveVariablesText","length","join","open","Header","onClose","onCancel","Content","marginBottom","description","control","disabled","checked","onChange","e","target","label","Actions","PrimaryButton","onClick","onSaveChanges","SecondaryButton"],"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,SAAuBA,QAAQ,QAAQ,QAAQ;AAC/C,SAASC,QAAQ,EAAEC,SAAS,EAAEC,gBAAgB,EAAEC,UAAU,QAAQ,gBAAgB;AAClF,SAASC,YAAY,QAAQ,4BAA4B;AACzD,SAASC,mBAAmB,EAAEC,yBAAyB,QAAQ,mBAAmB;AAClF,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,gCAAgC,EAAEC,4B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BAAwBH;wCACjC0B,UAAU,CAACC,IAA2CvB,wBAAwBuB,EAAEC,MAAM,CAACH,OAAO;;oCAGlGI,OAAOhB;;;;;;8BAKb,MAACpB,OAAOqC,OAAO;;sCACb,KAACrC,OAAOsC,aAAa;4BACnBC,SAAS;gCACP,OAAOlC,OAAOmC,aAAa,CAAChC,sBAAsBE;4BACpD;sCACD;;sCAGD,KAACV,OAAOyC,eAAe;4BAACF,SAAS,IAAMlC,OAAOqB,QAAQ;sCAAI;;;;;;;AAMtE,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.tsx"],"sourcesContent":["// Copyright 2024 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 { ReactElement, useState } from 'react';\nimport { Checkbox, FormGroup, FormControlLabel, Typography } from '@mui/material';\nimport { useTimeRange } from '@perses-dev/plugin-system';\nimport { isRelativeTimeRange } from '@perses-dev/core';\nimport { Dialog } from '@perses-dev/components';\nimport { useSaveChangesConfirmationDialog, useVariableDefinitionActions } from '../../context';\n\nconst SAVE_DEFAULTS_DIALOG_TEXT =\n 'You have made changes to the time range or the variables values. Would you like to save these as defaults?';\n\nexport const SaveChangesConfirmationDialog = (): ReactElement => {\n const { saveChangesConfirmationDialog: dialog } = useSaveChangesConfirmationDialog();\n const isSavedDurationModified = dialog?.isSavedDurationModified ?? true;\n const isSavedVariableModified = dialog?.isSavedVariableModified ?? true;\n const [saveDefaultTimeRange, setSaveDefaultTimeRange] = useState(isSavedDurationModified);\n const [saveDefaultVariables, setSaveDefaultVariables] = useState(isSavedVariableModified);\n\n const { getSavedVariablesStatus } = useVariableDefinitionActions();\n const { modifiedVariableNames } = getSavedVariablesStatus();\n\n const isOpen = dialog !== undefined;\n\n const { timeRange } = useTimeRange();\n const currentTimeRangeText = isRelativeTimeRange(timeRange)\n ? `(Last ${timeRange.pastDuration})`\n : '(Absolute time ranges can not be saved)';\n\n const saveTimeRangeText = `Save current time range as new default ${currentTimeRangeText}`;\n\n const saveVariablesText = `Save current variable values as new default (${\n modifiedVariableNames.length > 0 ? modifiedVariableNames.join(', ') : 'No modified variables'\n })`;\n\n return (\n <Dialog open={isOpen}>\n {dialog !== undefined && (\n <>\n <Dialog.Header onClose={() => dialog.onCancel()}>Save Dashboard</Dialog.Header>\n\n <Dialog.Content>\n <Typography marginBottom={2}>{dialog.description || SAVE_DEFAULTS_DIALOG_TEXT}</Typography>\n <FormGroup>\n <FormControlLabel\n control={\n <Checkbox\n disabled={!isSavedDurationModified || !isRelativeTimeRange(timeRange)}\n checked={saveDefaultTimeRange && isSavedDurationModified && isRelativeTimeRange(timeRange)}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => setSaveDefaultTimeRange(e.target.checked)}\n />\n }\n label={saveTimeRangeText}\n />\n <FormControlLabel\n control={\n <Checkbox\n disabled={!isSavedVariableModified}\n checked={saveDefaultVariables && isSavedVariableModified}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => setSaveDefaultVariables(e.target.checked)}\n />\n }\n label={saveVariablesText}\n />\n </FormGroup>\n </Dialog.Content>\n\n <Dialog.Actions>\n <Dialog.PrimaryButton\n onClick={() => {\n return dialog.onSaveChanges(saveDefaultTimeRange, saveDefaultVariables);\n }}\n >\n Save Changes\n </Dialog.PrimaryButton>\n <Dialog.SecondaryButton onClick={() => dialog.onCancel()}>Cancel</Dialog.SecondaryButton>\n </Dialog.Actions>\n </>\n )}\n </Dialog>\n );\n};\n"],"names":["useState","Checkbox","FormGroup","FormControlLabel","Typography","useTimeRange","isRelativeTimeRange","Dialog","useSaveChangesConfirmationDialog","useVariableDefinitionActions","SAVE_DEFAULTS_DIALOG_TEXT","SaveChangesConfirmationDialog","saveChangesConfirmationDialog","dialog","isSavedDurationModified","isSavedVariableModified","saveDefaultTimeRange","setSaveDefaultTimeRange","saveDefaultVariables","setSaveDefaultVariables","getSavedVariablesStatus","modifiedVariableNames","isOpen","undefined","timeRange","currentTimeRangeText","pastDuration","saveTimeRangeText","saveVariablesText","length","join","open","Header","onClose","onCancel","Content","marginBottom","description","control","disabled","checked","onChange","e","target","label","Actions","PrimaryButton","onClick","onSaveChanges","SecondaryButton"],"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,SAAuBA,QAAQ,QAAQ,QAAQ;AAC/C,SAASC,QAAQ,EAAEC,SAAS,EAAEC,gBAAgB,EAAEC,UAAU,QAAQ,gBAAgB;AAClF,SAASC,YAAY,QAAQ,4BAA4B;AACzD,SAASC,mBAAmB,QAAQ,mBAAmB;AACvD,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,gCAAgC,EAAEC,4BAA4B,QAAQ,gBAAgB;AAE/F,MAAMC,4BACJ;AAEF,OAAO,MAAMC,gCAAgC;IAC3C,MAAM,EAAEC,+BAA+BC,MAAM,EAAE,GAAGL;IAClD,MAAMM,0BAA0BD,QAAQC,2BAA2B;IACnE,MAAMC,0BAA0BF,QAAQE,2BAA2B;IACnE,MAAM,CAACC,sBAAsBC,wBAAwB,GAAGjB,SAASc;IACjE,MAAM,CAACI,sBAAsBC,wBAAwB,GAAGnB,SAASe;IAEjE,MAAM,EAAEK,uBAAuB,EAAE,GAAGX;IACpC,MAAM,EAAEY,qBAAqB,EAAE,GAAGD;IAElC,MAAME,SAAST,WAAWU;IAE1B,MAAM,EAAEC,SAAS,EAAE,GAAGnB;IACtB,MAAMoB,uBAAuBnB,oBAAoBkB,aAC7C,CAAC,MAAM,EAAEA,UAAUE,YAAY,CAAC,CAAC,CAAC,GAClC;IAEJ,MAAMC,oBAAoB,CAAC,uCAAuC,EAAEF,sBAAsB;IAE1F,MAAMG,oBAAoB,CAAC,6CAA6C,EACtEP,sBAAsBQ,MAAM,GAAG,IAAIR,sBAAsBS,IAAI,CAAC,QAAQ,wBACvE,CAAC,CAAC;IAEH,qBACE,KAACvB;QAAOwB,MAAMT;kBACXT,WAAWU,2BACV;;8BACE,KAAChB,OAAOyB,MAAM;oBAACC,SAAS,IAAMpB,OAAOqB,QAAQ;8BAAI;;8BAEjD,MAAC3B,OAAO4B,OAAO;;sCACb,KAAC/B;4BAAWgC,cAAc;sCAAIvB,OAAOwB,WAAW,IAAI3B;;sCACpD,MAACR;;8CACC,KAACC;oCACCmC,uBACE,KAACrC;wCACCsC,UAAU,CAACzB,2BAA2B,CAACR,oBAAoBkB;wCAC3DgB,SAASxB,wBAAwBF,2BAA2BR,oBAAoBkB;wCAChFiB,UAAU,CAACC,IAA2CzB,wBAAwByB,EAAEC,MAAM,CAACH,OAAO;;oCAGlGI,OAAOjB;;8CAET,KAACxB;oCACCmC,uBACE,KAACrC;wCACCsC,UAAU,CAACxB;wCACXyB,SAAStB,wBAAwBH;wCACjC0B,UAAU,CAACC,IAA2CvB,wBAAwBuB,EAAEC,MAAM,CAACH,OAAO;;oCAGlGI,OAAOhB;;;;;;8BAKb,MAACrB,OAAOsC,OAAO;;sCACb,KAACtC,OAAOuC,aAAa;4BACnBC,SAAS;gCACP,OAAOlC,OAAOmC,aAAa,CAAChC,sBAAsBE;4BACpD;sCACD;;sCAGD,KAACX,OAAO0C,eAAe;4BAACF,SAAS,IAAMlC,OAAOqB,QAAQ;sCAAI;;;;;;;AAMtE,EAAE"}
@@ -0,0 +1,16 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { VariableOption } from '@perses-dev/plugin-system';
3
+ export interface ListVariableListBoxContextValue {
4
+ options: VariableOption[];
5
+ selectedOptions: VariableOption[];
6
+ filteredOptions: VariableOption[];
7
+ allowAllValue: boolean;
8
+ onChange: (selectedOptions: VariableOption[]) => void;
9
+ }
10
+ export declare function useListVariableListBoxContext(): ListVariableListBoxContextValue;
11
+ export declare function ListVariableListBoxProvider({ value, children, }: {
12
+ value: ListVariableListBoxContextValue;
13
+ children: ReactNode;
14
+ }): React.ReactElement;
15
+ export declare const ListVariableListBox: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLUListElement> & React.RefAttributes<HTMLUListElement>>;
16
+ //# sourceMappingURL=ListVariableListBox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListVariableListBox.d.ts","sourceRoot":"","sources":["../../../src/components/Variables/ListVariableListBox.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,EAAgC,SAAS,EAAmC,MAAM,OAAO,CAAC;AAExG,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D,MAAM,WAAW,+BAA+B;IAC9C,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,CAAC,eAAe,EAAE,cAAc,EAAE,KAAK,IAAI,CAAC;CACvD;AAID,wBAAgB,6BAA6B,IAAI,+BAA+B,CAI/E;AAmED,wBAAgB,2BAA2B,CAAC,EAC1C,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,+BAA+B,CAAC;IACvC,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,KAAK,CAAC,YAAY,CAErB;AAED,eAAO,MAAM,mBAAmB,iHA0C9B,CAAC"}
@@ -0,0 +1,141 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import React, { forwardRef, useContext, useMemo } from 'react';
15
+ import { Checkbox, Divider } from '@mui/material';
16
+ import { DEFAULT_ALL_VALUE } from '@perses-dev/core';
17
+ const ListVariableListBoxContext = /*#__PURE__*/ React.createContext(undefined);
18
+ export function useListVariableListBoxContext() {
19
+ const ctx = useContext(ListVariableListBoxContext);
20
+ if (!ctx) throw new Error('ListVariableListBoxContext not found');
21
+ return ctx;
22
+ }
23
+ /*
24
+ * Handles the logic for toggling the global select checkbox in the ListBox header.
25
+ *
26
+ * If all options are selected, it will deselect all options.
27
+ * Except if filteredOptions is a subset of options, then it will only deselect the filtered options.
28
+ *
29
+ * If some options are selected, it will select all filtered options.
30
+ *
31
+ * If no options are selected, it will select all filtered options.
32
+ * Should be not possible since a ListVariable has always at least one value.
33
+ *
34
+ * If allowAllValue is true, it will handle the special "All" option logic.
35
+ * Main difference is if some options are selected and there is no filter, it will select the "All" option
36
+ */ function handleGlobalSelectToggle(options, selectedOptions, filteredOptions, isIndeterminate, isAllSelected, allowAllValue, onChange) {
37
+ if (isAllSelected) {
38
+ if (filteredOptions.length !== options.length) {
39
+ onChange(selectedOptions.filter((o)=>!filteredOptions.includes(o)));
40
+ } else {
41
+ onChange([]);
42
+ }
43
+ return;
44
+ }
45
+ if (isIndeterminate) {
46
+ if (allowAllValue) {
47
+ if (filteredOptions.length === options.length) {
48
+ if (selectedOptions[0]?.value === DEFAULT_ALL_VALUE) {
49
+ onChange(options.filter((o)=>o.value !== DEFAULT_ALL_VALUE));
50
+ } else {
51
+ onChange([
52
+ {
53
+ label: DEFAULT_ALL_VALUE,
54
+ value: DEFAULT_ALL_VALUE
55
+ }
56
+ ]);
57
+ }
58
+ } else {
59
+ if (filteredOptions.every((o)=>selectedOptions.includes(o))) {
60
+ onChange(selectedOptions.filter((o)=>!filteredOptions.includes(o)));
61
+ } else {
62
+ onChange([
63
+ ...selectedOptions,
64
+ ...filteredOptions.filter((o)=>o.value !== DEFAULT_ALL_VALUE)
65
+ ]);
66
+ }
67
+ }
68
+ } else {
69
+ if (filteredOptions.length === options.length) {
70
+ onChange(options);
71
+ } else {
72
+ if (filteredOptions.every((o)=>selectedOptions.includes(o))) {
73
+ onChange(selectedOptions.filter((o)=>!filteredOptions.includes(o)));
74
+ } else {
75
+ onChange([
76
+ ...selectedOptions,
77
+ ...filteredOptions
78
+ ]);
79
+ }
80
+ }
81
+ }
82
+ return;
83
+ }
84
+ // Nothing selected, so select filtered options
85
+ onChange(filteredOptions);
86
+ }
87
+ export function ListVariableListBoxProvider({ value, children }) {
88
+ return /*#__PURE__*/ _jsx(ListVariableListBoxContext.Provider, {
89
+ value: value,
90
+ children: children
91
+ });
92
+ }
93
+ export const ListVariableListBox = /*#__PURE__*/ forwardRef(function ListVariableListBox(props, ref) {
94
+ const { children, ...rest } = props;
95
+ const { options, selectedOptions, filteredOptions, allowAllValue, onChange } = useListVariableListBoxContext();
96
+ // Derived selection metadata for context listbox header
97
+ const selectedCount = useMemo(()=>selectedOptions.length, [
98
+ selectedOptions
99
+ ]);
100
+ const isIndeterminate = useMemo(()=>options.length > 0 && selectedCount > 0 && selectedCount !== options.length, [
101
+ selectedCount,
102
+ options
103
+ ]);
104
+ const isAllSelected = useMemo(()=>options.length > 0 && selectedCount === options.length, [
105
+ selectedCount,
106
+ options
107
+ ]);
108
+ return /*#__PURE__*/ _jsxs("ul", {
109
+ ...rest,
110
+ ref: ref,
111
+ role: "listbox",
112
+ children: [
113
+ /*#__PURE__*/ _jsxs("li", {
114
+ style: {
115
+ display: 'flex',
116
+ alignItems: 'center'
117
+ },
118
+ children: [
119
+ /*#__PURE__*/ _jsx(Checkbox, {
120
+ indeterminate: isIndeterminate,
121
+ checked: isAllSelected,
122
+ // intentionally not passing event to underlying handler to mimic previous behavior
123
+ onChange: ()=>handleGlobalSelectToggle(options, selectedOptions, filteredOptions, isIndeterminate, isAllSelected, allowAllValue, onChange)
124
+ }),
125
+ /*#__PURE__*/ _jsxs("span", {
126
+ children: [
127
+ /*#__PURE__*/ _jsx("strong", {
128
+ children: selectedCount
129
+ }),
130
+ " Selected"
131
+ ]
132
+ })
133
+ ]
134
+ }),
135
+ /*#__PURE__*/ _jsx(Divider, {}),
136
+ children
137
+ ]
138
+ });
139
+ });
140
+
141
+ //# sourceMappingURL=ListVariableListBox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Variables/ListVariableListBox.tsx"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React, { ForwardedRef, HTMLAttributes, ReactNode, forwardRef, useContext, useMemo } from 'react';\nimport { Checkbox, Divider } from '@mui/material';\nimport { VariableOption } from '@perses-dev/plugin-system';\nimport { DEFAULT_ALL_VALUE } from '@perses-dev/core';\n\nexport interface ListVariableListBoxContextValue {\n options: VariableOption[];\n selectedOptions: VariableOption[];\n filteredOptions: VariableOption[];\n allowAllValue: boolean;\n onChange: (selectedOptions: VariableOption[]) => void;\n}\n\nconst ListVariableListBoxContext = React.createContext<ListVariableListBoxContextValue | undefined>(undefined);\n\nexport function useListVariableListBoxContext(): ListVariableListBoxContextValue {\n const ctx = useContext(ListVariableListBoxContext);\n if (!ctx) throw new Error('ListVariableListBoxContext not found');\n return ctx;\n}\n\n/*\n * Handles the logic for toggling the global select checkbox in the ListBox header.\n *\n * If all options are selected, it will deselect all options.\n * Except if filteredOptions is a subset of options, then it will only deselect the filtered options.\n *\n * If some options are selected, it will select all filtered options.\n *\n * If no options are selected, it will select all filtered options.\n * Should be not possible since a ListVariable has always at least one value.\n *\n * If allowAllValue is true, it will handle the special \"All\" option logic.\n * Main difference is if some options are selected and there is no filter, it will select the \"All\" option\n */\nfunction handleGlobalSelectToggle(\n options: VariableOption[],\n selectedOptions: VariableOption[],\n filteredOptions: VariableOption[],\n isIndeterminate: boolean,\n isAllSelected: boolean,\n allowAllValue: boolean,\n onChange: (selectedOptions: VariableOption[]) => void\n): void {\n if (isAllSelected) {\n if (filteredOptions.length !== options.length) {\n onChange(selectedOptions.filter((o) => !filteredOptions.includes(o)));\n } else {\n onChange([]);\n }\n return;\n }\n\n if (isIndeterminate) {\n if (allowAllValue) {\n if (filteredOptions.length === options.length) {\n if (selectedOptions[0]?.value === DEFAULT_ALL_VALUE) {\n onChange(options.filter((o) => o.value !== DEFAULT_ALL_VALUE));\n } else {\n onChange([{ label: DEFAULT_ALL_VALUE, value: DEFAULT_ALL_VALUE }]);\n }\n } else {\n if (filteredOptions.every((o) => selectedOptions.includes(o))) {\n onChange(selectedOptions.filter((o) => !filteredOptions.includes(o)));\n } else {\n onChange([...selectedOptions, ...filteredOptions.filter((o) => o.value !== DEFAULT_ALL_VALUE)]);\n }\n }\n } else {\n if (filteredOptions.length === options.length) {\n onChange(options);\n } else {\n if (filteredOptions.every((o) => selectedOptions.includes(o))) {\n onChange(selectedOptions.filter((o) => !filteredOptions.includes(o)));\n } else {\n onChange([...selectedOptions, ...filteredOptions]);\n }\n }\n }\n return;\n }\n\n // Nothing selected, so select filtered options\n onChange(filteredOptions);\n}\n\nexport function ListVariableListBoxProvider({\n value,\n children,\n}: {\n value: ListVariableListBoxContextValue;\n children: ReactNode;\n}): React.ReactElement {\n return <ListVariableListBoxContext.Provider value={value}>{children}</ListVariableListBoxContext.Provider>;\n}\n\nexport const ListVariableListBox = forwardRef(function ListVariableListBox(\n props: HTMLAttributes<HTMLUListElement>,\n ref: ForwardedRef<HTMLUListElement>\n) {\n const { children, ...rest } = props;\n const { options, selectedOptions, filteredOptions, allowAllValue, onChange } = useListVariableListBoxContext();\n\n // Derived selection metadata for context listbox header\n const selectedCount = useMemo(() => selectedOptions.length, [selectedOptions]);\n const isIndeterminate = useMemo(\n () => options.length > 0 && selectedCount > 0 && selectedCount !== options.length,\n [selectedCount, options]\n );\n const isAllSelected = useMemo(() => options.length > 0 && selectedCount === options.length, [selectedCount, options]);\n\n return (\n <ul {...rest} ref={ref} role=\"listbox\">\n <li style={{ display: 'flex', alignItems: 'center' }}>\n <Checkbox\n indeterminate={isIndeterminate}\n checked={isAllSelected}\n // intentionally not passing event to underlying handler to mimic previous behavior\n onChange={() =>\n handleGlobalSelectToggle(\n options,\n selectedOptions,\n filteredOptions,\n isIndeterminate,\n isAllSelected,\n allowAllValue,\n onChange\n )\n }\n />\n <span>\n <strong>{selectedCount}</strong> Selected\n </span>\n </li>\n <Divider />\n {children}\n </ul>\n );\n});\n"],"names":["React","forwardRef","useContext","useMemo","Checkbox","Divider","DEFAULT_ALL_VALUE","ListVariableListBoxContext","createContext","undefined","useListVariableListBoxContext","ctx","Error","handleGlobalSelectToggle","options","selectedOptions","filteredOptions","isIndeterminate","isAllSelected","allowAllValue","onChange","length","filter","o","includes","value","label","every","ListVariableListBoxProvider","children","Provider","ListVariableListBox","props","ref","rest","selectedCount","ul","role","li","style","display","alignItems","indeterminate","checked","span","strong"],"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,SAAkDC,UAAU,EAAEC,UAAU,EAAEC,OAAO,QAAQ,QAAQ;AACxG,SAASC,QA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,eACAC,eACAC;;kCAIN,MAACwB;;0CACC,KAACC;0CAAQV;;4BAAuB;;;;;0BAGpC,KAAC9B;YACAwB;;;AAGP,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"Variable.d.ts","sourceRoot":"","sources":["../../../src/components/Variables/Variable.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAgC,MAAM,OAAO,CAAC;AAEnE,OAAO,EAGL,gBAAgB,EAEhB,YAAY,EACZ,aAAa,EACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAA+B,cAAc,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACvG,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAcF,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,aAAa,GAAG,YAAY,CAWtE;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,gBAAgB,GAAG,SAAS,EAClC,KAAK,EAAE,aAAa,GAAG,SAAS,EAChC,qBAAqB,EAAE,OAAO,CAAC,cAAc,CAAC,cAAc,EAAE,CAAC,CAAC,GAC/D;IAED,KAAK,EAAE,aAAa,GAAG,SAAS,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC;IAEtC,eAAe,EAAE,cAAc,GAAG,cAAc,EAAE,CAAC;IAEnD,WAAW,EAAE,cAAc,EAAE,CAAC;CAC/B,CA2FA"}
1
+ {"version":3,"file":"Variable.d.ts","sourceRoot":"","sources":["../../../src/components/Variables/Variable.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAA6C,MAAM,OAAO,CAAC;AAEhF,OAAO,EAGL,gBAAgB,EAEhB,YAAY,EACZ,aAAa,EACd,MAAM,kBAAkB,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