@perses-dev/dashboards 0.0.0-snapshot-scatter-chart-embed-8efdfab → 0.0.0-snapshot-explorer-plugin-c4a7621
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 +1 -1
- package/dist/cjs/components/AddPanelButton/AddPanelButton.js +2 -2
- package/dist/cjs/components/Dashboard/Dashboard.js +9 -2
- package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +4 -4
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +6 -6
- package/dist/cjs/components/Datasources/DatasourceEditor.js +19 -20
- package/dist/cjs/components/Datasources/EditDatasourcesButton.js +11 -8
- package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +4 -4
- package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +4 -5
- package/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +1 -1
- package/dist/cjs/components/DownloadButton/DownloadButton.js +3 -4
- package/dist/cjs/components/EditButton/EditButton.js +1 -1
- package/dist/cjs/components/EditJsonButton/EditJsonButton.js +3 -4
- package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +21 -17
- package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +5 -5
- package/dist/cjs/components/GridLayout/GridContainer.js +16 -11
- package/dist/cjs/components/GridLayout/GridItemContent.js +24 -10
- package/dist/cjs/components/GridLayout/GridLayout.js +63 -14
- package/dist/cjs/components/GridLayout/GridTitle.js +8 -9
- package/dist/cjs/{validation/panel.js → components/Panel/HeaderIconButton.js} +8 -10
- package/dist/cjs/components/Panel/Panel.js +15 -11
- package/dist/cjs/components/Panel/PanelActions.js +216 -0
- package/dist/cjs/components/Panel/PanelContent.js +6 -6
- package/dist/cjs/components/Panel/PanelHeader.js +36 -103
- package/dist/cjs/components/Panel/PanelLinks.js +136 -0
- package/dist/cjs/components/PanelDrawer/PanelDrawer.js +9 -6
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +67 -62
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +9 -6
- package/dist/cjs/components/PanelDrawer/usePanelEditor.js +9 -6
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +1 -1
- package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
- package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +5 -7
- package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +7 -9
- package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +8 -8
- package/dist/cjs/components/Variables/BuiltinVariableAccordions.js +8 -14
- package/dist/cjs/components/Variables/EditVariablesButton.js +5 -5
- package/dist/cjs/components/Variables/{TemplateVariable.js → Variable.js} +48 -56
- package/dist/cjs/components/Variables/VariableEditor.js +39 -46
- package/dist/cjs/components/Variables/VariableList.js +23 -22
- package/dist/cjs/components/Variables/index.js +2 -2
- package/dist/cjs/components/index.js +0 -2
- package/dist/cjs/constants/styles.js +17 -9
- package/dist/cjs/constants/user-interface-text.js +6 -5
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +24 -17
- package/dist/cjs/context/DashboardProvider/DashboardProviderWithQueryParams.js +36 -0
- package/dist/cjs/context/DashboardProvider/common.js +5 -5
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +51 -43
- package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +4 -5
- package/dist/cjs/context/DashboardProvider/duplicate-panel-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +11 -16
- package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +1 -2
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +13 -8
- package/dist/cjs/context/DashboardProvider/view-panel-slice.js +79 -0
- package/dist/cjs/context/DatasourceStoreProvider.js +32 -31
- package/dist/cjs/context/{TemplateVariableProvider/TemplateVariableProvider.js → VariableProvider/VariableProvider.js} +128 -131
- package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.js +11 -14
- package/dist/cjs/{validation → context/VariableProvider}/index.js +2 -2
- package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/query-params.js +8 -8
- package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/utils.js +6 -6
- package/dist/cjs/context/index.js +2 -2
- package/dist/cjs/context/useDashboard.js +24 -9
- package/dist/cjs/stories/decorators/WithDashboard.js +1 -1
- package/dist/cjs/stories/decorators/WithDatasourceStore.js +1 -1
- package/dist/cjs/stories/decorators/{WithTemplateVariables.js → WithVariables.js} +9 -9
- package/dist/cjs/stories/decorators/index.js +2 -2
- package/dist/cjs/test/dashboard-provider.js +3 -3
- package/dist/cjs/test/datasource-provider.js +4 -4
- package/dist/cjs/test/plugin-registry.js +4 -2
- package/dist/cjs/test/render.js +14 -12
- package/dist/cjs/utils/index.js +0 -1
- package/dist/cjs/utils/panelUtils.js +5 -5
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +8 -8
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +10 -11
- package/dist/components/AddGroupButton/AddGroupButton.d.ts +2 -2
- package/dist/components/AddGroupButton/AddGroupButton.d.ts.map +1 -1
- package/dist/components/AddGroupButton/AddGroupButton.js +1 -1
- package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.d.ts +2 -2
- package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.js +2 -2
- package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -1
- package/dist/components/Dashboard/Dashboard.d.ts +3 -3
- package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
- package/dist/components/Dashboard/Dashboard.js +9 -2
- package/dist/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts +2 -2
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +4 -4
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +2 -2
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +5 -5
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.d.ts +2 -2
- package/dist/components/Datasources/DatasourceEditor.d.ts.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.js +20 -21
- package/dist/components/Datasources/DatasourceEditor.js.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.d.ts +2 -2
- package/dist/components/Datasources/EditDatasourcesButton.d.ts.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.js +11 -8
- package/dist/components/Datasources/EditDatasourcesButton.js.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts +2 -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/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts +2 -2
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +4 -5
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts +2 -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/DownloadButton/DownloadButton.d.ts +2 -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/EditButton/EditButton.d.ts +2 -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/EditJsonButton/EditJsonButton.d.ts +2 -2
- package/dist/components/EditJsonButton/EditJsonButton.d.ts.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.js +3 -4
- package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts +2 -2
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.js +21 -17
- package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts +3 -3
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.js +5 -5
- package/dist/components/EmptyDashboard/EmptyDashboard.js.map +1 -1
- package/dist/components/GridLayout/GridContainer.d.ts +5 -3
- package/dist/components/GridLayout/GridContainer.d.ts.map +1 -1
- package/dist/components/GridLayout/GridContainer.js +16 -11
- package/dist/components/GridLayout/GridContainer.js.map +1 -1
- package/dist/components/GridLayout/GridItemContent.d.ts +2 -2
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +25 -11
- package/dist/components/GridLayout/GridItemContent.js.map +1 -1
- package/dist/components/GridLayout/GridLayout.d.ts +4 -3
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +65 -16
- package/dist/components/GridLayout/GridLayout.js.map +1 -1
- package/dist/components/GridLayout/GridTitle.d.ts +3 -3
- package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
- package/dist/components/GridLayout/GridTitle.js +8 -9
- package/dist/components/GridLayout/GridTitle.js.map +1 -1
- package/dist/components/Panel/HeaderIconButton.d.ts +5 -0
- package/dist/components/Panel/HeaderIconButton.d.ts.map +1 -0
- package/dist/components/{TimeRangeControls/index.js → Panel/HeaderIconButton.js} +7 -3
- package/dist/components/Panel/HeaderIconButton.js.map +1 -0
- package/dist/components/Panel/Panel.d.ts +13 -7
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +16 -12
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/PanelActions.d.ts +16 -0
- package/dist/components/Panel/PanelActions.d.ts.map +1 -0
- package/dist/components/Panel/PanelActions.js +203 -0
- package/dist/components/Panel/PanelActions.js.map +1 -0
- package/dist/components/Panel/PanelContent.d.ts +2 -2
- package/dist/components/Panel/PanelContent.d.ts.map +1 -1
- package/dist/components/Panel/PanelContent.js +6 -6
- package/dist/components/Panel/PanelContent.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts +9 -9
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
- package/dist/components/Panel/PanelHeader.js +39 -106
- package/dist/components/Panel/PanelHeader.js.map +1 -1
- package/dist/components/Panel/PanelLinks.d.ts +6 -0
- package/dist/components/Panel/PanelLinks.d.ts.map +1 -0
- package/dist/components/Panel/PanelLinks.js +123 -0
- package/dist/components/Panel/PanelLinks.js.map +1 -0
- package/dist/components/PanelDrawer/PanelDrawer.d.ts +2 -2
- package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js +10 -7
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts +3 -4
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js +70 -65
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.d.ts +3 -3
- package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js +9 -6
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.d.ts +12 -10
- package/dist/components/PanelDrawer/usePanelEditor.d.ts.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.js +9 -6
- package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts +2 -2
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts +2 -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/QuerySummaryTable/QuerySummaryTable.d.ts +2 -2
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js +5 -7
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts +2 -2
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +8 -10
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts +2 -2
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js +9 -9
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts +3 -3
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.js +8 -14
- package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -1
- package/dist/components/Variables/EditVariablesButton.d.ts +2 -2
- package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
- package/dist/components/Variables/EditVariablesButton.js +6 -6
- package/dist/components/Variables/EditVariablesButton.js.map +1 -1
- package/dist/components/Variables/{TemplateVariable.d.ts → Variable.d.ts} +6 -6
- package/dist/components/Variables/Variable.d.ts.map +1 -0
- package/dist/components/Variables/{TemplateVariable.js → Variable.js} +49 -57
- package/dist/components/Variables/Variable.js.map +1 -0
- package/dist/components/Variables/VariableEditor.d.ts +3 -3
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditor.js +40 -47
- package/dist/components/Variables/VariableEditor.js.map +1 -1
- package/dist/components/Variables/VariableList.d.ts +4 -4
- package/dist/components/Variables/VariableList.d.ts.map +1 -1
- package/dist/components/Variables/VariableList.js +21 -20
- package/dist/components/Variables/VariableList.js.map +1 -1
- package/dist/components/Variables/index.d.ts +1 -1
- package/dist/components/Variables/index.d.ts.map +1 -1
- package/dist/components/Variables/index.js +2 -2
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +0 -2
- package/dist/components/index.js.map +1 -1
- package/dist/constants/styles.d.ts +4 -2
- package/dist/constants/styles.d.ts.map +1 -1
- package/dist/constants/styles.js +5 -3
- package/dist/constants/styles.js.map +1 -1
- package/dist/constants/user-interface-text.d.ts +3 -2
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +3 -2
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +11 -6
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +22 -15
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.d.ts +4 -0
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.d.ts.map +1 -0
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.js +28 -0
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.js.map +1 -0
- 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 +2 -2
- package/dist/context/DashboardProvider/common.js.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +36 -23
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +26 -19
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts +2 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts.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 +4 -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.d.ts +1 -2
- package/dist/context/DashboardProvider/index.d.ts.map +1 -1
- package/dist/context/DashboardProvider/index.js.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts +2 -9
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.js +8 -13
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts +2 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.js +1 -2
- package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.d.ts +3 -3
- package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js +8 -4
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/save-changes-dialog-slice.js.map +1 -1
- package/dist/context/DashboardProvider/view-panel-slice.d.ts +21 -0
- package/dist/context/DashboardProvider/view-panel-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/view-panel-slice.js +73 -0
- package/dist/context/DashboardProvider/view-panel-slice.js.map +1 -0
- package/dist/context/DatasourceStoreProvider.d.ts +10 -10
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +32 -31
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/context/VariableProvider/VariableProvider.d.ts +119 -0
- package/dist/context/VariableProvider/VariableProvider.d.ts.map +1 -0
- package/dist/context/{TemplateVariableProvider/TemplateVariableProvider.js → VariableProvider/VariableProvider.js} +117 -116
- package/dist/context/VariableProvider/VariableProvider.js.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.d.ts +1 -1
- package/dist/context/VariableProvider/hydrationUtils.d.ts.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.js +9 -12
- package/dist/context/VariableProvider/hydrationUtils.js.map +1 -0
- package/dist/context/VariableProvider/index.d.ts +2 -0
- package/dist/context/VariableProvider/index.d.ts.map +1 -0
- package/dist/{validation → context/VariableProvider}/index.js +2 -2
- package/dist/context/VariableProvider/index.js.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/query-params.d.ts +2 -6
- package/dist/context/VariableProvider/query-params.d.ts.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/query-params.js +1 -1
- package/dist/context/VariableProvider/query-params.js.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/utils.d.ts +1 -1
- package/dist/context/VariableProvider/utils.d.ts.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/utils.js +3 -3
- package/dist/context/VariableProvider/utils.js.map +1 -0
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +2 -2
- 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 -9
- package/dist/context/useDashboard.js.map +1 -1
- package/dist/stories/decorators/WithDashboard.js +1 -1
- package/dist/stories/decorators/WithDashboard.js.map +1 -1
- package/dist/stories/decorators/WithDatasourceStore.js +1 -1
- package/dist/stories/decorators/WithDatasourceStore.js.map +1 -1
- package/dist/stories/decorators/{WithTemplateVariables.js → WithVariables.js} +9 -9
- package/dist/stories/decorators/WithVariables.js.map +1 -0
- package/dist/stories/decorators/index.js +2 -2
- package/dist/stories/decorators/index.js.map +1 -1
- package/dist/test/dashboard-provider.d.ts +1 -1
- package/dist/test/dashboard-provider.d.ts.map +1 -1
- package/dist/test/dashboard-provider.js.map +1 -1
- package/dist/test/datasource-provider.d.ts +2 -2
- package/dist/test/datasource-provider.d.ts.map +1 -1
- package/dist/test/datasource-provider.js.map +1 -1
- package/dist/test/plugin-registry.d.ts.map +1 -1
- package/dist/test/plugin-registry.js +4 -2
- package/dist/test/plugin-registry.js.map +1 -1
- package/dist/test/render.d.ts +2 -2
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +10 -8
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.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/views/ViewDashboard/DashboardApp.d.ts +4 -4
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +8 -8
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +4 -4
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +11 -12
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/package.json +9 -9
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -210
- package/dist/cjs/components/TimeRangeControls/index.js +0 -30
- package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +0 -40
- package/dist/cjs/components/ToolbarIconButton/index.js +0 -30
- package/dist/cjs/context/TemplateVariableProvider/index.js +0 -30
- package/dist/cjs/utils/time.js +0 -29
- 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 -186
- 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 +0 -15
- package/dist/components/ToolbarIconButton/index.js.map +0 -1
- package/dist/components/Variables/TemplateVariable.d.ts.map +0 -1
- package/dist/components/Variables/TemplateVariable.js.map +0 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +0 -77
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +0 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.js.map +0 -1
- package/dist/context/TemplateVariableProvider/index.d.ts +0 -2
- package/dist/context/TemplateVariableProvider/index.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/index.js +0 -15
- package/dist/context/TemplateVariableProvider/index.js.map +0 -1
- package/dist/context/TemplateVariableProvider/query-params.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/query-params.js.map +0 -1
- package/dist/context/TemplateVariableProvider/utils.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/utils.js.map +0 -1
- package/dist/stories/decorators/WithTemplateVariables.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 +0 -23
- package/dist/utils/time.js.map +0 -1
- package/dist/validation/index.d.ts +0 -2
- package/dist/validation/index.d.ts.map +0 -1
- package/dist/validation/index.js.map +0 -1
- package/dist/validation/panel.d.ts +0 -19
- package/dist/validation/panel.d.ts.map +0 -1
- package/dist/validation/panel.js +0 -21
- package/dist/validation/panel.js.map +0 -1
|
@@ -31,23 +31,61 @@ const _GridTitle = require("./GridTitle");
|
|
|
31
31
|
const _GridItemContent = require("./GridItemContent");
|
|
32
32
|
const _GridContainer = require("./GridContainer");
|
|
33
33
|
const DEFAULT_MARGIN = 10;
|
|
34
|
-
const
|
|
34
|
+
const ROW_HEIGHT = 30;
|
|
35
35
|
function GridLayout(props) {
|
|
36
|
-
const { panelGroupId
|
|
36
|
+
const { panelGroupId, panelOptions, panelFullHeight } = props;
|
|
37
37
|
const theme = (0, _material.useTheme)();
|
|
38
38
|
const groupDefinition = (0, _context.usePanelGroup)(panelGroupId);
|
|
39
|
-
const { updatePanelGroupLayouts
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
const { isEditMode } = (0, _context.useEditMode)();
|
|
39
|
+
const { updatePanelGroupLayouts } = (0, _context.usePanelGroupActions)(panelGroupId);
|
|
40
|
+
const [isOpen, setIsOpen] = (0, _react.useState)(!groupDefinition.isCollapsed ?? true);
|
|
41
|
+
const { isEditMode } = (0, _context.useEditMode)();
|
|
43
42
|
const [gridColWidth, setGridColWidth] = (0, _react.useState)(0);
|
|
43
|
+
const viewPanelItemId = (0, _context.useViewPanel)();
|
|
44
|
+
const hasViewPanel = viewPanelItemId?.panelGroupId === panelGroupId; // current panelGroup contains the panel extended?
|
|
45
|
+
const itemLayoutViewed = viewPanelItemId?.panelGroupItemLayoutId;
|
|
46
|
+
// If there is a panel in view mode, we should hide the grid if the panel is not in the current group.
|
|
47
|
+
const isGridDisplayed = (0, _react.useMemo)(()=>{
|
|
48
|
+
if (viewPanelItemId === undefined) {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
if (hasViewPanel) {
|
|
52
|
+
setIsOpen(true);
|
|
53
|
+
}
|
|
54
|
+
return hasViewPanel;
|
|
55
|
+
}, [
|
|
56
|
+
hasViewPanel,
|
|
57
|
+
viewPanelItemId
|
|
58
|
+
]);
|
|
59
|
+
// Item layout is override if there is a panel in view mode
|
|
60
|
+
const itemLayouts = (0, _react.useMemo)(()=>{
|
|
61
|
+
if (itemLayoutViewed) {
|
|
62
|
+
return groupDefinition.itemLayouts.map((itemLayout)=>{
|
|
63
|
+
if (itemLayout.i === itemLayoutViewed) {
|
|
64
|
+
const rowTitleHeight = 40 + 8; // 40 is the height of the row title and 8 is the margin height
|
|
65
|
+
return {
|
|
66
|
+
h: Math.round(((panelFullHeight ?? window.innerHeight) - rowTitleHeight) / (ROW_HEIGHT + DEFAULT_MARGIN)),
|
|
67
|
+
i: itemLayoutViewed,
|
|
68
|
+
w: 48,
|
|
69
|
+
x: 0,
|
|
70
|
+
y: 0
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return itemLayout;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return groupDefinition.itemLayouts;
|
|
77
|
+
}, [
|
|
78
|
+
groupDefinition.itemLayouts,
|
|
79
|
+
itemLayoutViewed,
|
|
80
|
+
panelFullHeight
|
|
81
|
+
]);
|
|
44
82
|
const handleLayoutChange = (currentLayout, allLayouts)=>{
|
|
45
83
|
// Using the value from `allLayouts` instead of `currentLayout` because of
|
|
46
84
|
// a bug in react-layout-grid where `currentLayout` does not adjust properly
|
|
47
85
|
// when going to a smaller breakpoint and then back to a larger breakpoint.
|
|
48
86
|
// https://github.com/react-grid-layout/react-grid-layout/issues/1663
|
|
49
87
|
const smallLayout = allLayouts[_constants.GRID_LAYOUT_SMALL_BREAKPOINT];
|
|
50
|
-
if (smallLayout) {
|
|
88
|
+
if (smallLayout && !hasViewPanel) {
|
|
51
89
|
updatePanelGroupLayouts(smallLayout);
|
|
52
90
|
}
|
|
53
91
|
};
|
|
@@ -61,7 +99,14 @@ function GridLayout(props) {
|
|
|
61
99
|
// exclude margin and padding from total width
|
|
62
100
|
setGridColWidth((containerWidth - marginWidth - containerPaddingWidth) / cols);
|
|
63
101
|
};
|
|
102
|
+
// https://github.com/react-grid-layout/react-grid-layout?tab=readme-ov-file#react-hooks-performance
|
|
103
|
+
const ResponsiveGridLayout = (0, _react.useMemo)(()=>(0, _reactgridlayout.WidthProvider)(_reactgridlayout.Responsive), []);
|
|
64
104
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_GridContainer.GridContainer, {
|
|
105
|
+
sx: {
|
|
106
|
+
display: isGridDisplayed ? 'block' : 'none',
|
|
107
|
+
height: itemLayoutViewed ? `${panelFullHeight}px` : 'unset',
|
|
108
|
+
overflow: itemLayoutViewed ? 'hidden' : 'unset'
|
|
109
|
+
},
|
|
65
110
|
children: [
|
|
66
111
|
groupDefinition.title !== undefined && /*#__PURE__*/ (0, _jsxruntime.jsx)(_GridTitle.GridTitle, {
|
|
67
112
|
panelGroupId: panelGroupId,
|
|
@@ -83,13 +128,13 @@ function GridLayout(props) {
|
|
|
83
128
|
xxs: 0
|
|
84
129
|
},
|
|
85
130
|
cols: _constants.GRID_LAYOUT_COLS,
|
|
86
|
-
rowHeight:
|
|
87
|
-
draggableHandle:
|
|
131
|
+
rowHeight: ROW_HEIGHT,
|
|
132
|
+
draggableHandle: ".drag-handle",
|
|
88
133
|
resizeHandles: [
|
|
89
134
|
'se'
|
|
90
135
|
],
|
|
91
|
-
isDraggable: isEditMode,
|
|
92
|
-
isResizable: isEditMode,
|
|
136
|
+
isDraggable: isEditMode && !hasViewPanel,
|
|
137
|
+
isResizable: isEditMode && !hasViewPanel,
|
|
93
138
|
margin: [
|
|
94
139
|
DEFAULT_MARGIN,
|
|
95
140
|
DEFAULT_MARGIN
|
|
@@ -99,15 +144,19 @@ function GridLayout(props) {
|
|
|
99
144
|
10
|
|
100
145
|
],
|
|
101
146
|
layouts: {
|
|
102
|
-
[_constants.GRID_LAYOUT_SMALL_BREAKPOINT]:
|
|
147
|
+
[_constants.GRID_LAYOUT_SMALL_BREAKPOINT]: itemLayouts
|
|
103
148
|
},
|
|
104
149
|
onLayoutChange: handleLayoutChange,
|
|
105
150
|
onWidthChange: handleWidthChange,
|
|
106
|
-
|
|
151
|
+
allowOverlap: hasViewPanel,
|
|
152
|
+
children: itemLayouts.map(({ i, w })=>/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
153
|
+
style: {
|
|
154
|
+
display: itemLayoutViewed !== undefined ? itemLayoutViewed === i ? 'unset' : 'none' : 'unset'
|
|
155
|
+
},
|
|
107
156
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ErrorBoundary, {
|
|
108
157
|
FallbackComponent: _components.ErrorAlert,
|
|
109
158
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_GridItemContent.GridItemContent, {
|
|
110
|
-
panelOptions:
|
|
159
|
+
panelOptions: panelOptions,
|
|
111
160
|
panelGroupItemId: {
|
|
112
161
|
panelGroupId,
|
|
113
162
|
panelGroupItemLayoutId: i
|
|
@@ -39,24 +39,23 @@ function _interop_require_default(obj) {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
function GridTitle(props) {
|
|
42
|
-
const { panelGroupId
|
|
42
|
+
const { panelGroupId, title: rawTitle, collapse } = props;
|
|
43
43
|
const title = (0, _pluginsystem.useReplaceVariablesInString)(rawTitle);
|
|
44
|
-
const { openAddPanel
|
|
45
|
-
const { openDeletePanelGroupDialog
|
|
46
|
-
const { isEditMode
|
|
44
|
+
const { openAddPanel, openEditPanelGroup, moveUp, moveDown } = (0, _context.usePanelGroupActions)(panelGroupId);
|
|
45
|
+
const { openDeletePanelGroupDialog } = (0, _context.useDeletePanelGroupDialog)();
|
|
46
|
+
const { isEditMode } = (0, _context.useEditMode)();
|
|
47
47
|
const text = /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
48
48
|
variant: "h2",
|
|
49
49
|
children: title
|
|
50
50
|
});
|
|
51
51
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
52
|
-
onClick: collapse
|
|
52
|
+
onClick: collapse?.onToggleOpen,
|
|
53
53
|
sx: {
|
|
54
54
|
display: 'flex',
|
|
55
55
|
justifyContent: 'start',
|
|
56
56
|
alignItems: 'center',
|
|
57
|
-
padding: (theme)=>theme.spacing(1),
|
|
58
57
|
cursor: collapse ? 'pointer' : 'auto',
|
|
59
|
-
backgroundColor: ({ palette
|
|
58
|
+
backgroundColor: ({ palette })=>palette.background.paper
|
|
60
59
|
},
|
|
61
60
|
"data-testid": "panel-group-header",
|
|
62
61
|
children: collapse ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
@@ -117,7 +116,7 @@ function GridTitle(props) {
|
|
|
117
116
|
onClick: (e)=>{
|
|
118
117
|
// Don't trigger expand/collapse
|
|
119
118
|
e.stopPropagation();
|
|
120
|
-
moveDown
|
|
119
|
+
moveDown?.();
|
|
121
120
|
},
|
|
122
121
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ArrowDown.default, {})
|
|
123
122
|
})
|
|
@@ -130,7 +129,7 @@ function GridTitle(props) {
|
|
|
130
129
|
onClick: (e)=>{
|
|
131
130
|
// Don't trigger expand/collapse
|
|
132
131
|
e.stopPropagation();
|
|
133
|
-
moveUp
|
|
132
|
+
moveUp?.();
|
|
134
133
|
},
|
|
135
134
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ArrowUp.default, {})
|
|
136
135
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2025 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -14,16 +14,14 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
Object.defineProperty(exports, "
|
|
17
|
+
Object.defineProperty(exports, "HeaderIconButton", {
|
|
18
18
|
enumerable: true,
|
|
19
19
|
get: function() {
|
|
20
|
-
return
|
|
20
|
+
return HeaderIconButton;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
type: _zod.z.string().nonempty('Required')
|
|
29
|
-
});
|
|
23
|
+
const _material = require("@mui/material");
|
|
24
|
+
const HeaderIconButton = (0, _material.styled)(_material.IconButton)(({ theme })=>({
|
|
25
|
+
borderRadius: theme.shape.borderRadius,
|
|
26
|
+
padding: '4px'
|
|
27
|
+
}));
|
|
@@ -21,25 +21,24 @@ Object.defineProperty(exports, "Panel", {
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _material = require("@mui/material");
|
|
25
|
+
const _components = require("@perses-dev/components");
|
|
24
26
|
const _react = require("react");
|
|
25
27
|
const _useresizeobserver = /*#__PURE__*/ _interop_require_default(require("use-resize-observer"));
|
|
26
|
-
const _components = require("@perses-dev/components");
|
|
27
|
-
const _material = require("@mui/material");
|
|
28
|
-
const _PanelHeader = require("./PanelHeader");
|
|
29
28
|
const _PanelContent = require("./PanelContent");
|
|
29
|
+
const _PanelHeader = require("./PanelHeader");
|
|
30
30
|
function _interop_require_default(obj) {
|
|
31
31
|
return obj && obj.__esModule ? obj : {
|
|
32
32
|
default: obj
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
const Panel = /*#__PURE__*/ (0, _react.memo)(function Panel(props) {
|
|
36
|
-
|
|
37
|
-
const { definition , editHandlers , onMouseEnter , onMouseLeave , sx , panelOptions , panelGroupItemId , ...others } = props;
|
|
36
|
+
const { definition, readHandlers, editHandlers, onMouseEnter, onMouseLeave, sx, panelOptions, panelGroupItemId, ...others } = props;
|
|
38
37
|
// Make sure we have an ID we can use for aria attributes
|
|
39
38
|
const generatedPanelId = (0, _components.useId)('Panel');
|
|
40
39
|
const headerId = `${generatedPanelId}-header`;
|
|
41
40
|
const [contentElement, setContentElement] = (0, _react.useState)(null);
|
|
42
|
-
const { width
|
|
41
|
+
const { width, height } = (0, _useresizeobserver.default)({
|
|
43
42
|
ref: contentElement
|
|
44
43
|
});
|
|
45
44
|
const contentDimensions = (0, _react.useMemo)(()=>{
|
|
@@ -54,10 +53,10 @@ const Panel = /*#__PURE__*/ (0, _react.memo)(function Panel(props) {
|
|
|
54
53
|
]);
|
|
55
54
|
const chartsTheme = (0, _components.useChartsTheme)();
|
|
56
55
|
const handleMouseEnter = (e)=>{
|
|
57
|
-
onMouseEnter
|
|
56
|
+
onMouseEnter?.(e);
|
|
58
57
|
};
|
|
59
58
|
const handleMouseLeave = (e)=>{
|
|
60
|
-
onMouseLeave
|
|
59
|
+
onMouseLeave?.(e);
|
|
61
60
|
};
|
|
62
61
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Card, {
|
|
63
62
|
component: "section",
|
|
@@ -65,7 +64,10 @@ const Panel = /*#__PURE__*/ (0, _react.memo)(function Panel(props) {
|
|
|
65
64
|
width: '100%',
|
|
66
65
|
height: '100%',
|
|
67
66
|
display: 'flex',
|
|
68
|
-
flexFlow: 'column nowrap'
|
|
67
|
+
flexFlow: 'column nowrap',
|
|
68
|
+
':hover': {
|
|
69
|
+
'--panel-hover': 'true'
|
|
70
|
+
}
|
|
69
71
|
}, sx),
|
|
70
72
|
variant: "outlined",
|
|
71
73
|
onMouseEnter: handleMouseEnter,
|
|
@@ -75,15 +77,17 @@ const Panel = /*#__PURE__*/ (0, _react.memo)(function Panel(props) {
|
|
|
75
77
|
"data-testid": "panel",
|
|
76
78
|
...others,
|
|
77
79
|
children: [
|
|
78
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_PanelHeader.PanelHeader, {
|
|
79
|
-
extra: panelOptions
|
|
80
|
+
!panelOptions?.hideHeader && /*#__PURE__*/ (0, _jsxruntime.jsx)(_PanelHeader.PanelHeader, {
|
|
81
|
+
extra: panelOptions?.extra?.({
|
|
80
82
|
panelDefinition: definition,
|
|
81
83
|
panelGroupItemId
|
|
82
84
|
}),
|
|
83
85
|
id: headerId,
|
|
84
86
|
title: definition.spec.display.name,
|
|
85
87
|
description: definition.spec.display.description,
|
|
88
|
+
readHandlers: readHandlers,
|
|
86
89
|
editHandlers: editHandlers,
|
|
90
|
+
links: definition.spec.links,
|
|
87
91
|
sx: {
|
|
88
92
|
paddingX: `${chartsTheme.container.padding.default}px`
|
|
89
93
|
}
|
|
@@ -0,0 +1,216 @@
|
|
|
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
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "PanelActions", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return PanelActions;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _material = require("@mui/material");
|
|
25
|
+
const _react = require("react");
|
|
26
|
+
const _components = require("@perses-dev/components");
|
|
27
|
+
const _ArrowCollapse = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ArrowCollapse"));
|
|
28
|
+
const _ArrowExpand = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ArrowExpand"));
|
|
29
|
+
const _PencilOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/PencilOutline"));
|
|
30
|
+
const _DeleteOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/DeleteOutline"));
|
|
31
|
+
const _DragVertical = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/DragVertical"));
|
|
32
|
+
const _ContentCopy = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ContentCopy"));
|
|
33
|
+
const _Menu = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Menu"));
|
|
34
|
+
const _constants = require("../../constants");
|
|
35
|
+
const _HeaderIconButton = require("./HeaderIconButton");
|
|
36
|
+
function _interop_require_default(obj) {
|
|
37
|
+
return obj && obj.__esModule ? obj : {
|
|
38
|
+
default: obj
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const PanelActions = ({ editHandlers, readHandlers, extra, title })=>{
|
|
42
|
+
const readActions = (0, _react.useMemo)(()=>{
|
|
43
|
+
if (readHandlers !== undefined) {
|
|
44
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
45
|
+
description: _constants.TOOLTIP_TEXT.viewPanel,
|
|
46
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
|
|
47
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.viewPanel(title),
|
|
48
|
+
size: "small",
|
|
49
|
+
onClick: readHandlers.onViewPanelClick,
|
|
50
|
+
children: readHandlers.isPanelViewed ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_ArrowCollapse.default, {
|
|
51
|
+
fontSize: "inherit"
|
|
52
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_ArrowExpand.default, {
|
|
53
|
+
fontSize: "inherit"
|
|
54
|
+
})
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return undefined;
|
|
59
|
+
}, [
|
|
60
|
+
readHandlers,
|
|
61
|
+
title
|
|
62
|
+
]);
|
|
63
|
+
const editActions = (0, _react.useMemo)(()=>{
|
|
64
|
+
if (editHandlers !== undefined) {
|
|
65
|
+
// If there are edit handlers, always just show the edit buttons
|
|
66
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
67
|
+
children: [
|
|
68
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
69
|
+
description: _constants.TOOLTIP_TEXT.editPanel,
|
|
70
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
|
|
71
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.editPanel(title),
|
|
72
|
+
size: "small",
|
|
73
|
+
onClick: editHandlers.onEditPanelClick,
|
|
74
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PencilOutline.default, {
|
|
75
|
+
fontSize: "inherit"
|
|
76
|
+
})
|
|
77
|
+
})
|
|
78
|
+
}),
|
|
79
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
80
|
+
description: _constants.TOOLTIP_TEXT.duplicatePanel,
|
|
81
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
|
|
82
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.duplicatePanel(title),
|
|
83
|
+
size: "small",
|
|
84
|
+
onClick: editHandlers.onDuplicatePanelClick,
|
|
85
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ContentCopy.default, {
|
|
86
|
+
fontSize: "inherit",
|
|
87
|
+
sx: {
|
|
88
|
+
// Shrink this icon a little bit to look more consistent
|
|
89
|
+
// with the other icons in the header.
|
|
90
|
+
transform: 'scale(0.925)'
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
})
|
|
94
|
+
}),
|
|
95
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
96
|
+
description: _constants.TOOLTIP_TEXT.deletePanel,
|
|
97
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
|
|
98
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.deletePanel(title),
|
|
99
|
+
size: "small",
|
|
100
|
+
onClick: editHandlers.onDeletePanelClick,
|
|
101
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DeleteOutline.default, {
|
|
102
|
+
fontSize: "inherit"
|
|
103
|
+
})
|
|
104
|
+
})
|
|
105
|
+
})
|
|
106
|
+
]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return undefined;
|
|
110
|
+
}, [
|
|
111
|
+
editHandlers,
|
|
112
|
+
title
|
|
113
|
+
]);
|
|
114
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(HeaderActionWrapper, {
|
|
115
|
+
direction: "row",
|
|
116
|
+
spacing: 0.25,
|
|
117
|
+
alignItems: "center",
|
|
118
|
+
sx: {
|
|
119
|
+
display: editHandlers !== undefined || readHandlers?.isPanelViewed ? 'flex' : 'var(--panel-hover, none)'
|
|
120
|
+
},
|
|
121
|
+
children: [
|
|
122
|
+
editHandlers === undefined && extra,
|
|
123
|
+
" ",
|
|
124
|
+
readActions,
|
|
125
|
+
editActions && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
126
|
+
children: [
|
|
127
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
128
|
+
sx: (0, _components.combineSx)((theme)=>({
|
|
129
|
+
display: 'block',
|
|
130
|
+
[theme.containerQueries(_constants.HEADER_ACTIONS_CONTAINER_NAME).down(_constants.HEADER_ACTIONS_MIN_WIDTH)]: {
|
|
131
|
+
display: 'none'
|
|
132
|
+
}
|
|
133
|
+
})),
|
|
134
|
+
children: editActions
|
|
135
|
+
}),
|
|
136
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
137
|
+
sx: (0, _components.combineSx)((theme)=>({
|
|
138
|
+
display: 'block',
|
|
139
|
+
[theme.containerQueries(_constants.HEADER_ACTIONS_CONTAINER_NAME).up(_constants.HEADER_ACTIONS_MIN_WIDTH)]: {
|
|
140
|
+
display: 'none'
|
|
141
|
+
}
|
|
142
|
+
})),
|
|
143
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(ShowAction, {
|
|
144
|
+
title: title,
|
|
145
|
+
children: editActions
|
|
146
|
+
})
|
|
147
|
+
})
|
|
148
|
+
]
|
|
149
|
+
}),
|
|
150
|
+
editActions && /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
151
|
+
description: _constants.TOOLTIP_TEXT.movePanel,
|
|
152
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
|
|
153
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.movePanel(title),
|
|
154
|
+
size: "small",
|
|
155
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DragVertical.default, {
|
|
156
|
+
className: "drag-handle",
|
|
157
|
+
sx: {
|
|
158
|
+
cursor: 'grab'
|
|
159
|
+
},
|
|
160
|
+
fontSize: "inherit"
|
|
161
|
+
})
|
|
162
|
+
})
|
|
163
|
+
})
|
|
164
|
+
]
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
const HeaderActionWrapper = (0, _material.styled)(_material.Stack)(()=>({
|
|
168
|
+
// Adding back the negative margins from MUI's defaults for actions, so we
|
|
169
|
+
// avoid increasing the header size when actions are present while also being
|
|
170
|
+
// able to vertically center the actions.
|
|
171
|
+
// https://github.com/mui/material-ui/blob/master/packages/mui-material/src/CardHeader/CardHeader.js#L56-L58
|
|
172
|
+
marginTop: -4,
|
|
173
|
+
marginBottom: -4
|
|
174
|
+
}));
|
|
175
|
+
const ShowAction = ({ children, title })=>{
|
|
176
|
+
const [anchorEl, setAnchorEl] = (0, _react.useState)(null);
|
|
177
|
+
const handleClick = (event)=>{
|
|
178
|
+
setAnchorEl(event.currentTarget);
|
|
179
|
+
};
|
|
180
|
+
const handleClose = ()=>{
|
|
181
|
+
setAnchorEl(null);
|
|
182
|
+
};
|
|
183
|
+
const open = Boolean(anchorEl);
|
|
184
|
+
const id = open ? 'actions-popover' : undefined;
|
|
185
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
186
|
+
children: [
|
|
187
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
|
|
188
|
+
className: "show-actions",
|
|
189
|
+
"aria-describedby": id,
|
|
190
|
+
onClick: handleClick,
|
|
191
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.showPanelActions(title),
|
|
192
|
+
size: "small",
|
|
193
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Menu.default, {
|
|
194
|
+
fontSize: "inherit"
|
|
195
|
+
})
|
|
196
|
+
}),
|
|
197
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Popover, {
|
|
198
|
+
id: id,
|
|
199
|
+
open: open,
|
|
200
|
+
anchorEl: anchorEl,
|
|
201
|
+
onClose: handleClose,
|
|
202
|
+
anchorOrigin: {
|
|
203
|
+
vertical: 'bottom',
|
|
204
|
+
horizontal: 'left'
|
|
205
|
+
},
|
|
206
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
207
|
+
sx: {
|
|
208
|
+
padding: '8px'
|
|
209
|
+
},
|
|
210
|
+
onClick: handleClose,
|
|
211
|
+
children: children
|
|
212
|
+
})
|
|
213
|
+
})
|
|
214
|
+
]
|
|
215
|
+
});
|
|
216
|
+
};
|
|
@@ -24,16 +24,16 @@ const _jsxruntime = require("react/jsx-runtime");
|
|
|
24
24
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
25
25
|
const _material = require("@mui/material");
|
|
26
26
|
function PanelContent(props) {
|
|
27
|
-
const { panelPluginKind
|
|
28
|
-
const { data: plugin
|
|
29
|
-
|
|
27
|
+
const { panelPluginKind, contentDimensions, definition, ...others } = props;
|
|
28
|
+
const { data: plugin, isLoading } = (0, _pluginsystem.usePlugin)('Panel', panelPluginKind, {
|
|
29
|
+
throwOnError: true
|
|
30
30
|
});
|
|
31
|
-
const PanelComponent = plugin
|
|
31
|
+
const PanelComponent = plugin?.PanelComponent;
|
|
32
32
|
if (isLoading) {
|
|
33
33
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Skeleton, {
|
|
34
34
|
variant: "rectangular",
|
|
35
|
-
width: contentDimensions
|
|
36
|
-
height: contentDimensions
|
|
35
|
+
width: contentDimensions?.width,
|
|
36
|
+
height: contentDimensions?.height,
|
|
37
37
|
"aria-label": "Loading..."
|
|
38
38
|
});
|
|
39
39
|
}
|