@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.
- package/dist/cjs/components/AddGroupButton/AddGroupButton.js +11 -8
- package/dist/cjs/components/AddGroupButton/index.js +10 -8
- package/dist/cjs/components/AddPanelButton/AddPanelButton.js +12 -13
- package/dist/cjs/components/AddPanelButton/index.js +10 -8
- package/dist/cjs/components/Dashboard/Dashboard.js +12 -10
- package/dist/cjs/components/Dashboard/index.js +10 -8
- package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +53 -22
- package/dist/cjs/components/DashboardStickyToolbar/index.js +10 -8
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +82 -103
- package/dist/cjs/components/DashboardToolbar/index.js +10 -8
- package/dist/cjs/components/Datasources/DatasourceEditor.js +236 -0
- package/dist/cjs/components/Datasources/EditDatasourcesButton.js +112 -0
- package/dist/cjs/components/{ToolbarIconButton → Datasources}/index.js +11 -8
- package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +16 -14
- package/dist/cjs/components/DeletePanelDialog/index.js +10 -8
- package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +18 -16
- package/dist/cjs/components/DeletePanelGroupDialog/index.js +10 -8
- package/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +6 -4
- package/dist/cjs/components/DiscardChangesConfirmationDialog/index.js +10 -8
- package/dist/cjs/components/DownloadButton/DownloadButton.js +13 -12
- package/dist/cjs/components/DownloadButton/index.js +10 -8
- package/dist/cjs/components/EditButton/EditButton.js +9 -7
- package/dist/cjs/components/EditButton/index.js +10 -8
- package/dist/cjs/components/EditJsonButton/EditJsonButton.js +15 -12
- package/dist/cjs/components/EditJsonButton/index.js +10 -8
- package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +54 -25
- package/dist/cjs/components/EditJsonDialog/index.js +10 -8
- package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +21 -19
- package/dist/cjs/components/EmptyDashboard/index.js +10 -8
- package/dist/cjs/components/GridLayout/GridContainer.js +6 -4
- package/dist/cjs/components/GridLayout/GridItemContent.js +37 -19
- package/dist/cjs/components/GridLayout/GridLayout.js +21 -19
- package/dist/cjs/components/GridLayout/GridTitle.js +40 -39
- package/dist/cjs/components/GridLayout/index.js +13 -11
- package/dist/cjs/components/Panel/Panel.js +19 -23
- package/dist/cjs/components/Panel/PanelContent.js +11 -8
- package/dist/cjs/components/Panel/PanelHeader.js +35 -33
- package/dist/cjs/components/Panel/index.js +10 -8
- package/dist/cjs/components/PanelDrawer/PanelDrawer.js +25 -77
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +237 -144
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +13 -12
- package/dist/cjs/components/PanelDrawer/index.js +11 -8
- package/dist/cjs/components/PanelDrawer/usePanelEditor.js +5 -3
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +18 -16
- package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +16 -12
- package/dist/cjs/components/PanelGroupDialog/index.js +10 -8
- package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +48 -46
- package/dist/cjs/components/QuerySummaryTable/index.js +10 -8
- package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +26 -24
- package/dist/cjs/components/SaveChangesConfirmationDialog/index.js +10 -8
- package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +14 -14
- package/dist/cjs/components/SaveDashboardButton/index.js +10 -8
- package/dist/cjs/components/Variables/BuiltinVariableAccordions.js +141 -0
- package/dist/cjs/components/Variables/EditVariablesButton.js +19 -17
- package/dist/cjs/components/Variables/TemplateVariable.js +261 -107
- package/dist/cjs/components/Variables/VariableEditor.js +282 -207
- package/dist/cjs/components/Variables/VariableList.js +24 -22
- package/dist/cjs/components/Variables/index.js +14 -11
- package/dist/cjs/components/index.js +30 -29
- package/dist/cjs/constants/grid-layout-config.js +6 -2
- package/dist/cjs/constants/index.js +12 -9
- package/dist/cjs/constants/styles.js +42 -0
- package/dist/cjs/constants/user-interface-text.js +8 -3
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +48 -35
- package/dist/cjs/context/DashboardProvider/common.js +6 -2
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +81 -49
- package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +4 -2
- package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +8 -6
- package/dist/cjs/context/DashboardProvider/discard-changes-dialog-slice.js +3 -1
- package/dist/cjs/context/DashboardProvider/duplicate-panel-slice.js +4 -2
- package/dist/cjs/context/DashboardProvider/edit-json-dialog-slice.js +3 -1
- package/dist/cjs/context/DashboardProvider/index.js +12 -10
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +17 -17
- package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +8 -6
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +16 -8
- package/dist/cjs/context/DashboardProvider/panel-slice.js +3 -1
- package/dist/cjs/context/DashboardProvider/save-changes-dialog-slice.js +3 -1
- package/dist/cjs/context/DatasourceStoreProvider.js +177 -50
- package/dist/cjs/context/TemplateVariableProvider/TemplateVariableProvider.js +150 -39
- package/dist/cjs/context/TemplateVariableProvider/hydrationUtils.js +12 -10
- package/dist/cjs/context/TemplateVariableProvider/index.js +10 -8
- package/dist/cjs/context/TemplateVariableProvider/query-params.js +17 -7
- package/dist/cjs/context/TemplateVariableProvider/utils.js +15 -7
- package/dist/cjs/context/index.js +13 -11
- package/dist/cjs/context/useDashboard.js +30 -11
- package/dist/cjs/index.js +12 -10
- package/dist/cjs/stories/decorators/WithDashboard.js +6 -4
- package/dist/cjs/stories/decorators/WithDatasourceStore.js +6 -4
- package/dist/cjs/stories/decorators/WithTemplateVariables.js +6 -4
- package/dist/cjs/stories/decorators/constants.js +5 -3
- package/dist/cjs/stories/decorators/index.js +13 -11
- package/dist/cjs/test/dashboard-provider.js +8 -4
- package/dist/cjs/test/datasource-provider.js +16 -12
- package/dist/cjs/test/index.js +13 -11
- package/dist/cjs/test/plugin-registry.js +6 -4
- package/dist/cjs/test/render.js +28 -21
- package/dist/cjs/test/setup-tests.js +2 -2
- package/dist/cjs/test/testDashboard.js +13 -11
- package/dist/cjs/utils/index.js +10 -9
- package/dist/cjs/utils/panelUtils.js +11 -5
- package/dist/cjs/{components/TimeRangeControls → validation}/index.js +10 -8
- package/dist/cjs/{utils/time.js → validation/panel.js} +11 -9
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +32 -18
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +64 -21
- package/dist/cjs/views/ViewDashboard/index.js +10 -8
- package/dist/cjs/views/index.js +10 -8
- package/dist/components/AddGroupButton/AddGroupButton.d.ts +1 -2
- package/dist/components/AddGroupButton/AddGroupButton.d.ts.map +1 -1
- package/dist/components/AddGroupButton/AddGroupButton.js +3 -2
- package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -1
- package/dist/components/AddGroupButton/index.js.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.d.ts +1 -2
- package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.js +4 -7
- package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -1
- package/dist/components/AddPanelButton/index.js.map +1 -1
- package/dist/components/Dashboard/Dashboard.d.ts +2 -3
- package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
- package/dist/components/Dashboard/Dashboard.js +1 -1
- package/dist/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Dashboard/index.js.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts +1 -2
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +38 -9
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -1
- package/dist/components/DashboardStickyToolbar/index.js.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +63 -86
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/DashboardToolbar/index.js.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.d.ts +7 -0
- package/dist/components/Datasources/DatasourceEditor.d.ts.map +1 -0
- package/dist/components/Datasources/DatasourceEditor.js +223 -0
- package/dist/components/Datasources/DatasourceEditor.js.map +1 -0
- package/dist/components/Datasources/EditDatasourcesButton.d.ts +2 -0
- package/dist/components/Datasources/EditDatasourcesButton.d.ts.map +1 -0
- package/dist/components/Datasources/EditDatasourcesButton.js +99 -0
- package/dist/components/Datasources/EditDatasourcesButton.js.map +1 -0
- package/dist/components/Datasources/index.d.ts +3 -0
- package/dist/components/Datasources/index.d.ts.map +1 -0
- package/dist/components/{TimeRangeControls → Datasources}/index.js +2 -1
- package/dist/components/Datasources/index.js.map +1 -0
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts +1 -2
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js +4 -4
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -1
- package/dist/components/DeletePanelDialog/index.js.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts +1 -2
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +3 -3
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
- package/dist/components/DeletePanelGroupDialog/index.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts +1 -2
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/index.js.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.d.ts +1 -2
- package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.js +3 -4
- package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
- package/dist/components/DownloadButton/index.js.map +1 -1
- package/dist/components/EditButton/EditButton.d.ts +1 -2
- package/dist/components/EditButton/EditButton.d.ts.map +1 -1
- package/dist/components/EditButton/EditButton.js +1 -1
- package/dist/components/EditButton/EditButton.js.map +1 -1
- package/dist/components/EditButton/index.js.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.d.ts +4 -2
- package/dist/components/EditJsonButton/EditJsonButton.d.ts.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.js +7 -6
- package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
- package/dist/components/EditJsonButton/index.js.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts +5 -2
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.js +43 -16
- package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -1
- package/dist/components/EditJsonDialog/index.js.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.js +3 -3
- package/dist/components/EmptyDashboard/EmptyDashboard.js.map +1 -1
- package/dist/components/EmptyDashboard/index.js.map +1 -1
- package/dist/components/GridLayout/GridContainer.d.ts +1 -1
- package/dist/components/GridLayout/GridContainer.d.ts.map +1 -1
- package/dist/components/GridLayout/GridContainer.js +1 -1
- package/dist/components/GridLayout/GridContainer.js.map +1 -1
- package/dist/components/GridLayout/GridItemContent.d.ts +1 -2
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +31 -15
- package/dist/components/GridLayout/GridItemContent.js.map +1 -1
- package/dist/components/GridLayout/GridLayout.d.ts +1 -2
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +6 -6
- package/dist/components/GridLayout/GridLayout.js.map +1 -1
- package/dist/components/GridLayout/GridTitle.d.ts +1 -2
- package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
- package/dist/components/GridLayout/GridTitle.js +5 -6
- package/dist/components/GridLayout/GridTitle.js.map +1 -1
- package/dist/components/GridLayout/index.js.map +1 -1
- package/dist/components/Panel/Panel.d.ts +2 -2
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +7 -13
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/PanelContent.d.ts +3 -3
- package/dist/components/Panel/PanelContent.d.ts.map +1 -1
- package/dist/components/Panel/PanelContent.js +4 -3
- package/dist/components/Panel/PanelContent.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts +2 -2
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
- package/dist/components/Panel/PanelHeader.js +2 -2
- package/dist/components/Panel/PanelHeader.js.map +1 -1
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.d.ts +1 -2
- package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js +22 -76
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts +5 -3
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js +231 -142
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.d.ts +1 -2
- package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js +4 -5
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
- package/dist/components/PanelDrawer/index.d.ts +1 -0
- package/dist/components/PanelDrawer/index.d.ts.map +1 -1
- package/dist/components/PanelDrawer/index.js +1 -0
- package/dist/components/PanelDrawer/index.js.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.js +2 -2
- package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts +1 -2
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts +1 -2
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -1
- package/dist/components/PanelGroupDialog/index.js.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts +1 -2
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js +8 -8
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
- package/dist/components/QuerySummaryTable/index.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts +1 -2
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +8 -8
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/index.js.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts +1 -2
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js +8 -10
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
- package/dist/components/SaveDashboardButton/index.js.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts +7 -0
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts.map +1 -0
- package/dist/components/Variables/BuiltinVariableAccordions.js +128 -0
- package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -0
- package/dist/components/Variables/EditVariablesButton.d.ts +1 -2
- package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
- package/dist/components/Variables/EditVariablesButton.js +7 -7
- package/dist/components/Variables/EditVariablesButton.js.map +1 -1
- package/dist/components/Variables/TemplateVariable.d.ts +12 -4
- package/dist/components/Variables/TemplateVariable.d.ts.map +1 -1
- package/dist/components/Variables/TemplateVariable.js +244 -100
- package/dist/components/Variables/TemplateVariable.js.map +1 -1
- package/dist/components/Variables/VariableEditor.d.ts +4 -4
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditor.js +232 -161
- package/dist/components/Variables/VariableEditor.js.map +1 -1
- package/dist/components/Variables/VariableList.d.ts +2 -3
- package/dist/components/Variables/VariableList.d.ts.map +1 -1
- package/dist/components/Variables/VariableList.js +11 -13
- package/dist/components/Variables/VariableList.js.map +1 -1
- package/dist/components/Variables/index.d.ts +1 -0
- package/dist/components/Variables/index.d.ts.map +1 -1
- package/dist/components/Variables/index.js +1 -0
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/components/index.d.ts +1 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -2
- package/dist/components/index.js.map +1 -1
- package/dist/constants/grid-layout-config.js.map +1 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +1 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/styles.d.ts +5 -0
- package/dist/constants/styles.d.ts.map +1 -0
- package/dist/{utils/time.js → constants/styles.js} +10 -10
- package/dist/constants/styles.js.map +1 -0
- package/dist/constants/user-interface-text.d.ts +2 -1
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +2 -1
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +7 -4
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +16 -9
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
- package/dist/context/DashboardProvider/common.d.ts +3 -3
- package/dist/context/DashboardProvider/common.d.ts.map +1 -1
- package/dist/context/DashboardProvider/common.js.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +17 -17
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.js +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-slice.js +5 -5
- package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/discard-changes-dialog-slice.js.map +1 -1
- package/dist/context/DashboardProvider/duplicate-panel-slice.js +1 -1
- package/dist/context/DashboardProvider/duplicate-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/edit-json-dialog-slice.js.map +1 -1
- package/dist/context/DashboardProvider/index.js.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts +2 -2
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.js +11 -13
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.js +2 -2
- package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.d.ts +2 -2
- package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js +4 -4
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/save-changes-dialog-slice.js.map +1 -1
- package/dist/context/DatasourceStoreProvider.d.ts +17 -12
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +172 -47
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +15 -8
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +1 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +115 -23
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +1 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts.map +1 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.js +7 -7
- package/dist/context/TemplateVariableProvider/hydrationUtils.js.map +1 -1
- package/dist/context/TemplateVariableProvider/index.js.map +1 -1
- package/dist/context/TemplateVariableProvider/query-params.js.map +1 -1
- package/dist/context/TemplateVariableProvider/utils.js +3 -3
- package/dist/context/TemplateVariableProvider/utils.js.map +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/context/useDashboard.d.ts +3 -3
- package/dist/context/useDashboard.d.ts.map +1 -1
- package/dist/context/useDashboard.js +24 -7
- package/dist/context/useDashboard.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/stories/decorators/WithDashboard.js.map +1 -1
- package/dist/stories/decorators/WithDatasourceStore.js.map +1 -1
- package/dist/stories/decorators/WithTemplateVariables.js.map +1 -1
- package/dist/stories/decorators/constants.js +2 -2
- package/dist/stories/decorators/constants.js.map +1 -1
- package/dist/stories/decorators/index.js.map +1 -1
- package/dist/test/dashboard-provider.js.map +1 -1
- package/dist/test/datasource-provider.d.ts.map +1 -1
- package/dist/test/datasource-provider.js +5 -7
- package/dist/test/datasource-provider.js.map +1 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test/plugin-registry.js.map +1 -1
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +9 -4
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test/testDashboard.js +10 -10
- package/dist/test/testDashboard.js.map +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/panelUtils.d.ts +1 -1
- package/dist/utils/panelUtils.d.ts.map +1 -1
- package/dist/utils/panelUtils.js +2 -2
- package/dist/utils/panelUtils.js.map +1 -1
- package/dist/validation/index.d.ts +2 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/{components/ToolbarIconButton → validation}/index.js +1 -1
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/panel.d.ts +19 -0
- package/dist/validation/panel.d.ts.map +1 -0
- package/dist/validation/panel.js +21 -0
- package/dist/validation/panel.js.map +1 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts +4 -3
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +19 -7
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +2 -2
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +53 -12
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/dist/views/ViewDashboard/index.js.map +1 -1
- package/dist/views/index.js.map +1 -1
- package/package.json +8 -7
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -183
- package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +0 -38
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +0 -14
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +0 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +0 -165
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +0 -1
- package/dist/components/TimeRangeControls/index.d.ts +0 -2
- package/dist/components/TimeRangeControls/index.d.ts.map +0 -1
- package/dist/components/TimeRangeControls/index.js.map +0 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts +0 -6
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts.map +0 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js +0 -32
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js.map +0 -1
- package/dist/components/ToolbarIconButton/index.d.ts +0 -2
- package/dist/components/ToolbarIconButton/index.d.ts.map +0 -1
- package/dist/components/ToolbarIconButton/index.js.map +0 -1
- package/dist/utils/time.d.ts +0 -5
- package/dist/utils/time.d.ts.map +0 -1
- package/dist/utils/time.js.map +0 -1
|
@@ -16,28 +16,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "GridLayout", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return GridLayout;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _react = require("react");
|
|
23
|
-
const
|
|
25
|
+
const _reactgridlayout = require("react-grid-layout");
|
|
24
26
|
const _material = require("@mui/material");
|
|
25
27
|
const _components = require("@perses-dev/components");
|
|
26
28
|
const _context = require("../../context");
|
|
27
29
|
const _constants = require("../../constants");
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
30
|
+
const _GridTitle = require("./GridTitle");
|
|
31
|
+
const _GridItemContent = require("./GridItemContent");
|
|
32
|
+
const _GridContainer = require("./GridContainer");
|
|
31
33
|
const DEFAULT_MARGIN = 10;
|
|
32
|
-
const ResponsiveGridLayout = (0,
|
|
34
|
+
const ResponsiveGridLayout = (0, _reactgridlayout.WidthProvider)(_reactgridlayout.Responsive);
|
|
33
35
|
function GridLayout(props) {
|
|
34
|
-
const { panelGroupId
|
|
36
|
+
const { panelGroupId/*...others */ } = props;
|
|
35
37
|
const theme = (0, _material.useTheme)();
|
|
36
38
|
const groupDefinition = (0, _context.usePanelGroup)(panelGroupId);
|
|
37
|
-
const { updatePanelGroupLayouts
|
|
38
|
-
var
|
|
39
|
-
const [isOpen, setIsOpen] = (0, _react.useState)((
|
|
40
|
-
const { isEditMode
|
|
39
|
+
const { updatePanelGroupLayouts } = (0, _context.usePanelGroupActions)(panelGroupId);
|
|
40
|
+
var _ref;
|
|
41
|
+
const [isOpen, setIsOpen] = (0, _react.useState)((_ref = !groupDefinition.isCollapsed) !== null && _ref !== void 0 ? _ref : true);
|
|
42
|
+
const { isEditMode } = (0, _context.useEditMode)();
|
|
41
43
|
const [gridColWidth, setGridColWidth] = (0, _react.useState)(0);
|
|
42
44
|
const handleLayoutChange = (currentLayout, allLayouts)=>{
|
|
43
45
|
// Using the value from `allLayouts` instead of `currentLayout` because of
|
|
@@ -59,9 +61,9 @@ function GridLayout(props) {
|
|
|
59
61
|
// exclude margin and padding from total width
|
|
60
62
|
setGridColWidth((containerWidth - marginWidth - containerPaddingWidth) / cols);
|
|
61
63
|
};
|
|
62
|
-
return /*#__PURE__*/ (0,
|
|
64
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_GridContainer.GridContainer, {
|
|
63
65
|
children: [
|
|
64
|
-
groupDefinition.title !== undefined && /*#__PURE__*/ (0,
|
|
66
|
+
groupDefinition.title !== undefined && /*#__PURE__*/ (0, _jsxruntime.jsx)(_GridTitle.GridTitle, {
|
|
65
67
|
panelGroupId: panelGroupId,
|
|
66
68
|
title: groupDefinition.title,
|
|
67
69
|
collapse: groupDefinition.isCollapsed === undefined ? undefined : {
|
|
@@ -69,12 +71,12 @@ function GridLayout(props) {
|
|
|
69
71
|
onToggleOpen: ()=>setIsOpen((current)=>!current)
|
|
70
72
|
}
|
|
71
73
|
}),
|
|
72
|
-
/*#__PURE__*/ (0,
|
|
74
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Collapse, {
|
|
73
75
|
in: isOpen,
|
|
74
76
|
unmountOnExit: true,
|
|
75
77
|
appear: false,
|
|
76
78
|
"data-testid": "panel-group-content",
|
|
77
|
-
children: /*#__PURE__*/ (0,
|
|
79
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(ResponsiveGridLayout, {
|
|
78
80
|
className: "layout",
|
|
79
81
|
breakpoints: {
|
|
80
82
|
sm: theme.breakpoints.values.sm,
|
|
@@ -101,10 +103,10 @@ function GridLayout(props) {
|
|
|
101
103
|
},
|
|
102
104
|
onLayoutChange: handleLayoutChange,
|
|
103
105
|
onWidthChange: handleWidthChange,
|
|
104
|
-
children: groupDefinition.itemLayouts.map(({ i
|
|
105
|
-
children: /*#__PURE__*/ (0,
|
|
106
|
+
children: groupDefinition.itemLayouts.map(({ i, w })=>/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
107
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ErrorBoundary, {
|
|
106
108
|
FallbackComponent: _components.ErrorAlert,
|
|
107
|
-
children: /*#__PURE__*/ (0,
|
|
109
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_GridItemContent.GridItemContent, {
|
|
108
110
|
panelOptions: props.panelOptions,
|
|
109
111
|
panelGroupItemId: {
|
|
110
112
|
panelGroupId,
|
|
@@ -16,100 +16,101 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "GridTitle", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return GridTitle;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _material = require("@mui/material");
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
25
|
+
const _ChevronDown = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ChevronDown"));
|
|
26
|
+
const _ChevronRight = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ChevronRight"));
|
|
27
|
+
const _ChartBoxPlusOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ChartBoxPlusOutline"));
|
|
28
|
+
const _PencilOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/PencilOutline"));
|
|
29
|
+
const _ArrowUp = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ArrowUp"));
|
|
30
|
+
const _ArrowDown = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ArrowDown"));
|
|
31
|
+
const _DeleteOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/DeleteOutline"));
|
|
30
32
|
const _components = require("@perses-dev/components");
|
|
31
|
-
const
|
|
33
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
32
34
|
const _constants = require("../../constants");
|
|
33
35
|
const _context = require("../../context");
|
|
34
|
-
function
|
|
36
|
+
function _interop_require_default(obj) {
|
|
35
37
|
return obj && obj.__esModule ? obj : {
|
|
36
38
|
default: obj
|
|
37
39
|
};
|
|
38
40
|
}
|
|
39
41
|
function GridTitle(props) {
|
|
40
|
-
const { panelGroupId
|
|
41
|
-
const title = (0,
|
|
42
|
-
const { openAddPanel
|
|
43
|
-
const { openDeletePanelGroupDialog
|
|
44
|
-
const { isEditMode
|
|
45
|
-
const text = /*#__PURE__*/ (0,
|
|
42
|
+
const { panelGroupId, title: rawTitle, collapse } = props;
|
|
43
|
+
const title = (0, _pluginsystem.useReplaceVariablesInString)(rawTitle);
|
|
44
|
+
const { openAddPanel, openEditPanelGroup, moveUp, moveDown } = (0, _context.usePanelGroupActions)(panelGroupId);
|
|
45
|
+
const { openDeletePanelGroupDialog } = (0, _context.useDeletePanelGroupDialog)();
|
|
46
|
+
const { isEditMode } = (0, _context.useEditMode)();
|
|
47
|
+
const text = /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
46
48
|
variant: "h2",
|
|
47
49
|
children: title
|
|
48
50
|
});
|
|
49
|
-
return /*#__PURE__*/ (0,
|
|
51
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
50
52
|
onClick: collapse === null || collapse === void 0 ? void 0 : collapse.onToggleOpen,
|
|
51
53
|
sx: {
|
|
52
54
|
display: 'flex',
|
|
53
55
|
justifyContent: 'start',
|
|
54
56
|
alignItems: 'center',
|
|
55
|
-
padding: (theme)=>theme.spacing(1),
|
|
56
57
|
cursor: collapse ? 'pointer' : 'auto',
|
|
57
|
-
backgroundColor: ({ palette
|
|
58
|
+
backgroundColor: ({ palette })=>palette.background.paper
|
|
58
59
|
},
|
|
59
60
|
"data-testid": "panel-group-header",
|
|
60
|
-
children: collapse ? /*#__PURE__*/ (0,
|
|
61
|
+
children: collapse ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
61
62
|
children: [
|
|
62
|
-
/*#__PURE__*/ (0,
|
|
63
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
63
64
|
sx: {
|
|
64
65
|
marginRight: 1
|
|
65
66
|
},
|
|
66
67
|
"aria-label": `${collapse.isOpen ? 'collapse' : 'expand'} group ${title}`,
|
|
67
|
-
children: collapse.isOpen ? /*#__PURE__*/ (0,
|
|
68
|
+
children: collapse.isOpen ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronDown.default, {}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronRight.default, {})
|
|
68
69
|
}),
|
|
69
70
|
text,
|
|
70
|
-
isEditMode && /*#__PURE__*/ (0,
|
|
71
|
+
isEditMode && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
71
72
|
direction: "row",
|
|
72
73
|
marginLeft: "auto",
|
|
73
74
|
children: [
|
|
74
|
-
/*#__PURE__*/ (0,
|
|
75
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
75
76
|
description: _constants.TOOLTIP_TEXT.addPanelToGroup,
|
|
76
|
-
children: /*#__PURE__*/ (0,
|
|
77
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
77
78
|
"aria-label": _constants.ARIA_LABEL_TEXT.addPanelToGroup(title),
|
|
78
79
|
onClick: (e)=>{
|
|
79
80
|
// Don't trigger expand/collapse
|
|
80
81
|
e.stopPropagation();
|
|
81
82
|
openAddPanel();
|
|
82
83
|
},
|
|
83
|
-
children: /*#__PURE__*/ (0,
|
|
84
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChartBoxPlusOutline.default, {})
|
|
84
85
|
})
|
|
85
86
|
}),
|
|
86
|
-
/*#__PURE__*/ (0,
|
|
87
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
87
88
|
description: _constants.TOOLTIP_TEXT.editGroup,
|
|
88
|
-
children: /*#__PURE__*/ (0,
|
|
89
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
89
90
|
"aria-label": _constants.ARIA_LABEL_TEXT.editGroup(title),
|
|
90
91
|
onClick: (e)=>{
|
|
91
92
|
// Don't trigger expand/collapse
|
|
92
93
|
e.stopPropagation();
|
|
93
94
|
openEditPanelGroup();
|
|
94
95
|
},
|
|
95
|
-
children: /*#__PURE__*/ (0,
|
|
96
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PencilOutline.default, {})
|
|
96
97
|
})
|
|
97
98
|
}),
|
|
98
|
-
/*#__PURE__*/ (0,
|
|
99
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
99
100
|
description: _constants.TOOLTIP_TEXT.deleteGroup,
|
|
100
|
-
children: /*#__PURE__*/ (0,
|
|
101
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
101
102
|
"aria-label": _constants.ARIA_LABEL_TEXT.deleteGroup(title),
|
|
102
103
|
onClick: (e)=>{
|
|
103
104
|
// Don't trigger expand/collapse
|
|
104
105
|
e.stopPropagation();
|
|
105
106
|
openDeletePanelGroupDialog(panelGroupId);
|
|
106
107
|
},
|
|
107
|
-
children: /*#__PURE__*/ (0,
|
|
108
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DeleteOutline.default, {})
|
|
108
109
|
})
|
|
109
110
|
}),
|
|
110
|
-
/*#__PURE__*/ (0,
|
|
111
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
111
112
|
description: _constants.TOOLTIP_TEXT.moveGroupDown,
|
|
112
|
-
children: /*#__PURE__*/ (0,
|
|
113
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
113
114
|
"aria-label": _constants.ARIA_LABEL_TEXT.moveGroupDown(title),
|
|
114
115
|
disabled: moveDown === undefined,
|
|
115
116
|
onClick: (e)=>{
|
|
@@ -117,12 +118,12 @@ function GridTitle(props) {
|
|
|
117
118
|
e.stopPropagation();
|
|
118
119
|
moveDown && moveDown();
|
|
119
120
|
},
|
|
120
|
-
children: /*#__PURE__*/ (0,
|
|
121
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ArrowDown.default, {})
|
|
121
122
|
})
|
|
122
123
|
}),
|
|
123
|
-
/*#__PURE__*/ (0,
|
|
124
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
124
125
|
description: _constants.TOOLTIP_TEXT.moveGroupUp,
|
|
125
|
-
children: /*#__PURE__*/ (0,
|
|
126
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
126
127
|
"aria-label": _constants.ARIA_LABEL_TEXT.moveGroupUp(title),
|
|
127
128
|
disabled: moveUp === undefined,
|
|
128
129
|
onClick: (e)=>{
|
|
@@ -130,7 +131,7 @@ function GridTitle(props) {
|
|
|
130
131
|
e.stopPropagation();
|
|
131
132
|
moveUp && moveUp();
|
|
132
133
|
},
|
|
133
|
-
children: /*#__PURE__*/ (0,
|
|
134
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ArrowUp.default, {})
|
|
134
135
|
})
|
|
135
136
|
})
|
|
136
137
|
]
|
|
@@ -14,18 +14,20 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
function
|
|
17
|
+
_export_star(require("./GridContainer"), exports);
|
|
18
|
+
_export_star(require("./GridItemContent"), exports);
|
|
19
|
+
_export_star(require("./GridLayout"), exports);
|
|
20
|
+
_export_star(require("./GridTitle"), exports);
|
|
21
|
+
function _export_star(from, to) {
|
|
22
22
|
Object.keys(from).forEach(function(k) {
|
|
23
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
24
|
+
Object.defineProperty(to, k, {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function() {
|
|
27
|
+
return from[k];
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
29
31
|
});
|
|
30
32
|
return from;
|
|
31
33
|
}
|
|
@@ -16,29 +16,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "Panel", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return Panel;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _react = require("react");
|
|
23
|
-
const
|
|
24
|
-
const _reactIntersectionObserver = require("react-intersection-observer");
|
|
25
|
+
const _useresizeobserver = /*#__PURE__*/ _interop_require_default(require("use-resize-observer"));
|
|
25
26
|
const _components = require("@perses-dev/components");
|
|
26
27
|
const _material = require("@mui/material");
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
function
|
|
28
|
+
const _PanelHeader = require("./PanelHeader");
|
|
29
|
+
const _PanelContent = require("./PanelContent");
|
|
30
|
+
function _interop_require_default(obj) {
|
|
30
31
|
return obj && obj.__esModule ? obj : {
|
|
31
32
|
default: obj
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
35
|
const Panel = /*#__PURE__*/ (0, _react.memo)(function Panel(props) {
|
|
35
|
-
var
|
|
36
|
-
const { definition
|
|
36
|
+
var _panelOptions_extra;
|
|
37
|
+
const { definition, editHandlers, onMouseEnter, onMouseLeave, sx, panelOptions, panelGroupItemId, ...others } = props;
|
|
37
38
|
// Make sure we have an ID we can use for aria attributes
|
|
38
39
|
const generatedPanelId = (0, _components.useId)('Panel');
|
|
39
40
|
const headerId = `${generatedPanelId}-header`;
|
|
40
41
|
const [contentElement, setContentElement] = (0, _react.useState)(null);
|
|
41
|
-
const { width
|
|
42
|
+
const { width, height } = (0, _useresizeobserver.default)({
|
|
42
43
|
ref: contentElement
|
|
43
44
|
});
|
|
44
45
|
const contentDimensions = (0, _react.useMemo)(()=>{
|
|
@@ -51,11 +52,6 @@ const Panel = /*#__PURE__*/ (0, _react.memo)(function Panel(props) {
|
|
|
51
52
|
width,
|
|
52
53
|
height
|
|
53
54
|
]);
|
|
54
|
-
const { ref: ref1 , inView } = (0, _reactIntersectionObserver.useInView)({
|
|
55
|
-
threshold: 0.3,
|
|
56
|
-
initialInView: false,
|
|
57
|
-
triggerOnce: true
|
|
58
|
-
});
|
|
59
55
|
const chartsTheme = (0, _components.useChartsTheme)();
|
|
60
56
|
const handleMouseEnter = (e)=>{
|
|
61
57
|
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter(e);
|
|
@@ -63,8 +59,7 @@ const Panel = /*#__PURE__*/ (0, _react.memo)(function Panel(props) {
|
|
|
63
59
|
const handleMouseLeave = (e)=>{
|
|
64
60
|
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(e);
|
|
65
61
|
};
|
|
66
|
-
return /*#__PURE__*/ (0,
|
|
67
|
-
ref: ref1,
|
|
62
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Card, {
|
|
68
63
|
component: "section",
|
|
69
64
|
sx: (0, _components.combineSx)({
|
|
70
65
|
width: '100%',
|
|
@@ -80,8 +75,8 @@ const Panel = /*#__PURE__*/ (0, _react.memo)(function Panel(props) {
|
|
|
80
75
|
"data-testid": "panel",
|
|
81
76
|
...others,
|
|
82
77
|
children: [
|
|
83
|
-
/*#__PURE__*/ (0,
|
|
84
|
-
extra: panelOptions === null || panelOptions === void 0 ? void 0 : (
|
|
78
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_PanelHeader.PanelHeader, {
|
|
79
|
+
extra: panelOptions === null || panelOptions === void 0 ? void 0 : (_panelOptions_extra = panelOptions.extra) === null || _panelOptions_extra === void 0 ? void 0 : _panelOptions_extra.call(panelOptions, {
|
|
85
80
|
panelDefinition: definition,
|
|
86
81
|
panelGroupItemId
|
|
87
82
|
}),
|
|
@@ -93,7 +88,7 @@ const Panel = /*#__PURE__*/ (0, _react.memo)(function Panel(props) {
|
|
|
93
88
|
paddingX: `${chartsTheme.container.padding.default}px`
|
|
94
89
|
}
|
|
95
90
|
}),
|
|
96
|
-
/*#__PURE__*/ (0,
|
|
91
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.CardContent, {
|
|
97
92
|
component: "figure",
|
|
98
93
|
sx: {
|
|
99
94
|
position: 'relative',
|
|
@@ -107,12 +102,13 @@ const Panel = /*#__PURE__*/ (0, _react.memo)(function Panel(props) {
|
|
|
107
102
|
}
|
|
108
103
|
},
|
|
109
104
|
ref: setContentElement,
|
|
110
|
-
children: /*#__PURE__*/ (0,
|
|
105
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ErrorBoundary, {
|
|
111
106
|
FallbackComponent: _components.ErrorAlert,
|
|
112
107
|
resetKeys: [
|
|
113
|
-
definition.spec
|
|
108
|
+
definition.spec
|
|
114
109
|
],
|
|
115
|
-
children:
|
|
110
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PanelContent.PanelContent, {
|
|
111
|
+
definition: definition,
|
|
116
112
|
panelPluginKind: definition.spec.plugin.kind,
|
|
117
113
|
spec: definition.spec.plugin.spec,
|
|
118
114
|
contentDimensions: contentDimensions
|
|
@@ -16,19 +16,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "PanelContent", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return PanelContent;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
23
25
|
const _material = require("@mui/material");
|
|
24
26
|
function PanelContent(props) {
|
|
25
|
-
const { panelPluginKind
|
|
26
|
-
const { data: plugin
|
|
27
|
+
const { panelPluginKind, contentDimensions, definition, ...others } = props;
|
|
28
|
+
const { data: plugin, isLoading } = (0, _pluginsystem.usePlugin)('Panel', panelPluginKind, {
|
|
27
29
|
useErrorBoundary: true
|
|
28
30
|
});
|
|
29
31
|
const PanelComponent = plugin === null || plugin === void 0 ? void 0 : plugin.PanelComponent;
|
|
30
32
|
if (isLoading) {
|
|
31
|
-
return /*#__PURE__*/ (0,
|
|
33
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Skeleton, {
|
|
32
34
|
variant: "rectangular",
|
|
33
35
|
width: contentDimensions === null || contentDimensions === void 0 ? void 0 : contentDimensions.width,
|
|
34
36
|
height: contentDimensions === null || contentDimensions === void 0 ? void 0 : contentDimensions.height,
|
|
@@ -38,8 +40,9 @@ function PanelContent(props) {
|
|
|
38
40
|
if (PanelComponent === undefined) {
|
|
39
41
|
throw new Error(`Missing PanelComponent from panel plugin for kind '${panelPluginKind}'`);
|
|
40
42
|
}
|
|
41
|
-
return /*#__PURE__*/ (0,
|
|
43
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(PanelComponent, {
|
|
42
44
|
...others,
|
|
43
|
-
contentDimensions: contentDimensions
|
|
45
|
+
contentDimensions: contentDimensions,
|
|
46
|
+
definition: definition
|
|
44
47
|
});
|
|
45
48
|
}
|
|
@@ -16,51 +16,53 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "PanelHeader", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return PanelHeader;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _material = require("@mui/material");
|
|
23
25
|
const _components = require("@perses-dev/components");
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
26
|
+
const _InformationOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/InformationOutline"));
|
|
27
|
+
const _PencilOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/PencilOutline"));
|
|
28
|
+
const _DeleteOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/DeleteOutline"));
|
|
29
|
+
const _DragVertical = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/DragVertical"));
|
|
30
|
+
const _ContentCopy = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ContentCopy"));
|
|
31
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
30
32
|
const _constants = require("../../constants");
|
|
31
|
-
function
|
|
33
|
+
function _interop_require_default(obj) {
|
|
32
34
|
return obj && obj.__esModule ? obj : {
|
|
33
35
|
default: obj
|
|
34
36
|
};
|
|
35
37
|
}
|
|
36
|
-
function PanelHeader({ id
|
|
38
|
+
function PanelHeader({ id, title: rawTitle, description: rawDescription, editHandlers, sx, extra, ...rest }) {
|
|
37
39
|
const titleElementId = `${id}-title`;
|
|
38
40
|
const descriptionTooltipId = `${id}-description`;
|
|
39
|
-
const title = (0,
|
|
40
|
-
const description = (0,
|
|
41
|
+
const title = (0, _pluginsystem.useReplaceVariablesInString)(rawTitle);
|
|
42
|
+
const description = (0, _pluginsystem.useReplaceVariablesInString)(rawDescription);
|
|
41
43
|
let actions = undefined;
|
|
42
44
|
if (editHandlers !== undefined) {
|
|
43
45
|
// If there are edit handlers, always just show the edit buttons
|
|
44
|
-
actions = /*#__PURE__*/ (0,
|
|
46
|
+
actions = /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
45
47
|
children: [
|
|
46
|
-
/*#__PURE__*/ (0,
|
|
48
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
47
49
|
description: _constants.TOOLTIP_TEXT.editPanel,
|
|
48
|
-
children: /*#__PURE__*/ (0,
|
|
50
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(HeaderIconButton, {
|
|
49
51
|
"aria-label": _constants.ARIA_LABEL_TEXT.editPanel(title),
|
|
50
52
|
size: "small",
|
|
51
53
|
onClick: editHandlers.onEditPanelClick,
|
|
52
|
-
children: /*#__PURE__*/ (0,
|
|
54
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PencilOutline.default, {
|
|
53
55
|
fontSize: "inherit"
|
|
54
56
|
})
|
|
55
57
|
})
|
|
56
58
|
}),
|
|
57
|
-
/*#__PURE__*/ (0,
|
|
59
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
58
60
|
description: _constants.TOOLTIP_TEXT.duplicatePanel,
|
|
59
|
-
children: /*#__PURE__*/ (0,
|
|
61
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(HeaderIconButton, {
|
|
60
62
|
"aria-label": _constants.ARIA_LABEL_TEXT.duplicatePanel(title),
|
|
61
63
|
size: "small",
|
|
62
64
|
onClick: editHandlers.onDuplicatePanelClick,
|
|
63
|
-
children: /*#__PURE__*/ (0,
|
|
65
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ContentCopy.default, {
|
|
64
66
|
fontSize: "inherit",
|
|
65
67
|
sx: {
|
|
66
68
|
// Shrink this icon a little bit to look more consistent
|
|
@@ -70,23 +72,23 @@ function PanelHeader({ id , title: rawTitle , description: rawDescription , edit
|
|
|
70
72
|
})
|
|
71
73
|
})
|
|
72
74
|
}),
|
|
73
|
-
/*#__PURE__*/ (0,
|
|
75
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
74
76
|
description: _constants.TOOLTIP_TEXT.deletePanel,
|
|
75
|
-
children: /*#__PURE__*/ (0,
|
|
77
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(HeaderIconButton, {
|
|
76
78
|
"aria-label": _constants.ARIA_LABEL_TEXT.deletePanel(title),
|
|
77
79
|
size: "small",
|
|
78
80
|
onClick: editHandlers.onDeletePanelClick,
|
|
79
|
-
children: /*#__PURE__*/ (0,
|
|
81
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DeleteOutline.default, {
|
|
80
82
|
fontSize: "inherit"
|
|
81
83
|
})
|
|
82
84
|
})
|
|
83
85
|
}),
|
|
84
|
-
/*#__PURE__*/ (0,
|
|
86
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
85
87
|
description: _constants.TOOLTIP_TEXT.movePanel,
|
|
86
|
-
children: /*#__PURE__*/ (0,
|
|
88
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(HeaderIconButton, {
|
|
87
89
|
"aria-label": _constants.ARIA_LABEL_TEXT.movePanel(title),
|
|
88
90
|
size: "small",
|
|
89
|
-
children: /*#__PURE__*/ (0,
|
|
91
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DragVertical.default, {
|
|
90
92
|
className: "drag-handle",
|
|
91
93
|
sx: {
|
|
92
94
|
cursor: 'grab'
|
|
@@ -98,16 +100,16 @@ function PanelHeader({ id , title: rawTitle , description: rawDescription , edit
|
|
|
98
100
|
]
|
|
99
101
|
});
|
|
100
102
|
}
|
|
101
|
-
return /*#__PURE__*/ (0,
|
|
103
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.CardHeader, {
|
|
102
104
|
id: id,
|
|
103
105
|
component: "header",
|
|
104
106
|
"aria-labelledby": titleElementId,
|
|
105
107
|
"aria-describedby": descriptionTooltipId,
|
|
106
108
|
disableTypography: true,
|
|
107
|
-
title: /*#__PURE__*/ (0,
|
|
109
|
+
title: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
108
110
|
direction: "row",
|
|
109
111
|
children: [
|
|
110
|
-
/*#__PURE__*/ (0,
|
|
112
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
111
113
|
id: titleElementId,
|
|
112
114
|
variant: "subtitle1",
|
|
113
115
|
sx: {
|
|
@@ -121,14 +123,14 @@ function PanelHeader({ id , title: rawTitle , description: rawDescription , edit
|
|
|
121
123
|
},
|
|
122
124
|
children: title
|
|
123
125
|
}),
|
|
124
|
-
description !== undefined && description.trim().length > 0 && /*#__PURE__*/ (0,
|
|
126
|
+
description !== undefined && description.trim().length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
125
127
|
id: descriptionTooltipId,
|
|
126
128
|
description: description,
|
|
127
129
|
enterDelay: 100,
|
|
128
|
-
children: /*#__PURE__*/ (0,
|
|
130
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(HeaderIconButton, {
|
|
129
131
|
"aria-label": "panel description",
|
|
130
132
|
size: "small",
|
|
131
|
-
children: /*#__PURE__*/ (0,
|
|
133
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_InformationOutline.default, {
|
|
132
134
|
"aria-describedby": "info-tooltip",
|
|
133
135
|
"aria-hidden": false,
|
|
134
136
|
fontSize: "inherit",
|
|
@@ -140,7 +142,7 @@ function PanelHeader({ id , title: rawTitle , description: rawDescription , edit
|
|
|
140
142
|
})
|
|
141
143
|
]
|
|
142
144
|
}),
|
|
143
|
-
action: /*#__PURE__*/ (0,
|
|
145
|
+
action: /*#__PURE__*/ (0, _jsxruntime.jsxs)(HeaderActionWrapper, {
|
|
144
146
|
direction: "row",
|
|
145
147
|
spacing: 0.25,
|
|
146
148
|
alignItems: "center",
|
|
@@ -167,7 +169,7 @@ function PanelHeader({ id , title: rawTitle , description: rawDescription , edit
|
|
|
167
169
|
...rest
|
|
168
170
|
});
|
|
169
171
|
}
|
|
170
|
-
const HeaderIconButton = (0, _material.styled)(_material.IconButton)(({ theme
|
|
172
|
+
const HeaderIconButton = (0, _material.styled)(_material.IconButton)(({ theme })=>({
|
|
171
173
|
borderRadius: theme.shape.borderRadius,
|
|
172
174
|
padding: '4px'
|
|
173
175
|
}));
|
|
@@ -14,15 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
function
|
|
17
|
+
_export_star(require("./Panel"), exports);
|
|
18
|
+
function _export_star(from, to) {
|
|
19
19
|
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
+
Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
26
28
|
});
|
|
27
29
|
return from;
|
|
28
30
|
}
|