@perses-dev/dashboards 0.0.0-snapshot-scatterplot-fix-imports-95e1b59 → 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/Dashboard/Dashboard.js +8 -1
- package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +2 -2
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +1 -1
- package/dist/cjs/components/Datasources/DatasourceEditor.js +18 -18
- package/dist/cjs/components/Datasources/EditDatasourcesButton.js +2 -5
- package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +3 -4
- package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +10 -13
- package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +2 -2
- package/dist/cjs/components/GridLayout/GridContainer.js +15 -10
- package/dist/cjs/components/GridLayout/GridItemContent.js +19 -4
- package/dist/cjs/components/GridLayout/GridLayout.js +61 -12
- package/dist/cjs/components/GridLayout/GridTitle.js +3 -3
- package/dist/cjs/{validation/panel.js → components/Panel/HeaderIconButton.js} +8 -10
- package/dist/cjs/components/Panel/Panel.js +14 -10
- package/dist/cjs/components/Panel/PanelActions.js +216 -0
- package/dist/cjs/components/Panel/PanelContent.js +4 -4
- 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 -65
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +7 -3
- package/dist/cjs/components/PanelDrawer/usePanelEditor.js +9 -6
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +1 -1
- package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +3 -5
- package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +4 -6
- package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +2 -2
- package/dist/cjs/components/Variables/BuiltinVariableAccordions.js +7 -14
- package/dist/cjs/components/Variables/EditVariablesButton.js +4 -4
- package/dist/cjs/components/Variables/{TemplateVariable.js → Variable.js} +43 -60
- package/dist/cjs/components/Variables/VariableEditor.js +34 -40
- package/dist/cjs/components/Variables/VariableList.js +23 -22
- package/dist/cjs/components/Variables/index.js +2 -2
- package/dist/cjs/constants/styles.js +15 -7
- package/dist/cjs/constants/user-interface-text.js +3 -0
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +10 -8
- package/dist/cjs/context/DashboardProvider/DashboardProviderWithQueryParams.js +36 -0
- package/dist/cjs/context/DashboardProvider/common.js +2 -2
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +14 -6
- package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +1 -2
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +7 -10
- package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +1 -2
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +8 -3
- package/dist/cjs/context/DashboardProvider/view-panel-slice.js +79 -0
- package/dist/cjs/context/DatasourceStoreProvider.js +18 -23
- package/dist/cjs/context/{TemplateVariableProvider/TemplateVariableProvider.js → VariableProvider/VariableProvider.js} +62 -69
- 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 +1 -1
- package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/utils.js +3 -3
- package/dist/cjs/context/index.js +2 -2
- package/dist/cjs/context/useDashboard.js +4 -4
- 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/plugin-registry.js +4 -2
- package/dist/cjs/test/render.js +13 -11
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +3 -3
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +7 -8
- package/dist/components/AddGroupButton/AddGroupButton.d.ts +2 -1
- package/dist/components/AddGroupButton/AddGroupButton.d.ts.map +1 -1
- package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.d.ts +2 -1
- package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -1
- package/dist/components/Dashboard/Dashboard.d.ts +2 -1
- package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
- package/dist/components/Dashboard/Dashboard.js +8 -1
- package/dist/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts +2 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +3 -3
- 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 +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.d.ts +2 -1
- package/dist/components/Datasources/DatasourceEditor.d.ts.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.js +19 -19
- package/dist/components/Datasources/DatasourceEditor.js.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.d.ts +2 -1
- package/dist/components/Datasources/EditDatasourcesButton.d.ts.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.js +2 -5
- package/dist/components/Datasources/EditDatasourcesButton.js.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts +2 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts +2 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +3 -4
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts +2 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.d.ts +2 -1
- package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
- package/dist/components/EditButton/EditButton.d.ts +2 -1
- package/dist/components/EditButton/EditButton.d.ts.map +1 -1
- package/dist/components/EditButton/EditButton.js.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.d.ts +2 -1
- package/dist/components/EditJsonButton/EditJsonButton.d.ts.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts +2 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.js +7 -10
- 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 +2 -2
- 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 +15 -10
- package/dist/components/GridLayout/GridContainer.js.map +1 -1
- package/dist/components/GridLayout/GridItemContent.d.ts +2 -1
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +21 -6
- package/dist/components/GridLayout/GridItemContent.js.map +1 -1
- package/dist/components/GridLayout/GridLayout.d.ts +4 -2
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +63 -14
- package/dist/components/GridLayout/GridLayout.js.map +1 -1
- package/dist/components/GridLayout/GridTitle.d.ts +3 -2
- package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
- package/dist/components/GridLayout/GridTitle.js +3 -3
- 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/{context/TemplateVariableProvider/index.js → components/Panel/HeaderIconButton.js} +7 -3
- package/dist/components/Panel/HeaderIconButton.js.map +1 -0
- package/dist/components/Panel/Panel.d.ts +11 -5
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +15 -11
- 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 -1
- package/dist/components/Panel/PanelContent.d.ts.map +1 -1
- package/dist/components/Panel/PanelContent.js +4 -4
- package/dist/components/Panel/PanelContent.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts +8 -8
- 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 -1
- 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 -3
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js +70 -68
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.d.ts +3 -2
- package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js +8 -4
- 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 -1
- 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 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts +2 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js +3 -5
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts +2 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +5 -7
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts +2 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js +3 -3
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts +2 -1
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.js +7 -14
- package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -1
- package/dist/components/Variables/EditVariablesButton.d.ts +2 -1
- package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
- package/dist/components/Variables/EditVariablesButton.js +5 -5
- package/dist/components/Variables/EditVariablesButton.js.map +1 -1
- package/dist/components/Variables/{TemplateVariable.d.ts → Variable.d.ts} +6 -5
- package/dist/components/Variables/Variable.d.ts.map +1 -0
- package/dist/components/Variables/{TemplateVariable.js → Variable.js} +44 -61
- package/dist/components/Variables/Variable.js.map +1 -0
- package/dist/components/Variables/VariableEditor.d.ts +3 -2
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditor.js +35 -41
- package/dist/components/Variables/VariableEditor.js.map +1 -1
- package/dist/components/Variables/VariableList.d.ts +4 -3
- 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/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 -0
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +3 -0
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +6 -3
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +11 -9
- 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.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 +13 -6
- 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.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-slice.js +1 -2
- 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.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 +4 -7
- 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 +2 -2
- package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js +7 -3
- 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 +7 -7
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +18 -23
- 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} +51 -54
- 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.map +1 -1
- package/dist/context/useDashboard.js +4 -4
- 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 +9 -7
- package/dist/test/render.js.map +1 -1
- package/dist/utils/panelUtils.d.ts.map +1 -1
- package/dist/utils/panelUtils.js.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.d.ts +2 -2
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +3 -3
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +4 -3
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +8 -9
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/package.json +9 -9
- package/dist/cjs/context/TemplateVariableProvider/index.js +0 -30
- 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.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/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
|
@@ -23,17 +23,23 @@ Object.defineProperty(exports, "Dashboard", {
|
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
24
|
const _material = require("@mui/material");
|
|
25
25
|
const _components = require("@perses-dev/components");
|
|
26
|
+
const _react = require("react");
|
|
26
27
|
const _context = require("../../context");
|
|
27
28
|
const _GridLayout = require("../GridLayout");
|
|
28
29
|
const _EmptyDashboard = require("../EmptyDashboard");
|
|
30
|
+
const HEADER_HEIGHT = 165; // Approximate height of the header in dashboard view (including the navbar and variables toolbar)
|
|
29
31
|
function Dashboard({ emptyDashboardProps, panelOptions, ...boxProps }) {
|
|
30
32
|
const panelGroupIds = (0, _context.usePanelGroupIds)();
|
|
33
|
+
const boxRef = (0, _react.useRef)(null);
|
|
31
34
|
const isEmpty = !panelGroupIds.length;
|
|
35
|
+
const dashboardTopPosition = boxRef.current?.getBoundingClientRect().top ?? HEADER_HEIGHT;
|
|
36
|
+
const panelFullHeight = window.innerHeight - dashboardTopPosition - window.scrollY;
|
|
32
37
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
33
38
|
...boxProps,
|
|
34
39
|
sx: {
|
|
35
40
|
height: '100%'
|
|
36
41
|
},
|
|
42
|
+
ref: boxRef,
|
|
37
43
|
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_components.ErrorBoundary, {
|
|
38
44
|
FallbackComponent: _components.ErrorAlert,
|
|
39
45
|
children: [
|
|
@@ -49,7 +55,8 @@ function Dashboard({ emptyDashboardProps, panelOptions, ...boxProps }) {
|
|
|
49
55
|
}),
|
|
50
56
|
!isEmpty && panelGroupIds.map((panelGroupId)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_GridLayout.GridLayout, {
|
|
51
57
|
panelGroupId: panelGroupId,
|
|
52
|
-
panelOptions: panelOptions
|
|
58
|
+
panelOptions: panelOptions,
|
|
59
|
+
panelFullHeight: panelFullHeight
|
|
53
60
|
}, panelGroupId))
|
|
54
61
|
]
|
|
55
62
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 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
|
|
@@ -84,7 +84,7 @@ function DashboardStickyToolbar(props) {
|
|
|
84
84
|
},
|
|
85
85
|
gap: 1,
|
|
86
86
|
children: [
|
|
87
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Variables.
|
|
87
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Variables.VariableList, {}),
|
|
88
88
|
props.initialVariableIsSticky && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
89
89
|
style: {
|
|
90
90
|
width: 'fit-content',
|
|
@@ -77,27 +77,29 @@ function DatasourceEditor(props) {
|
|
|
77
77
|
};
|
|
78
78
|
const editDatasource = (name)=>{
|
|
79
79
|
setDatasourceFormAction('update');
|
|
80
|
-
var _datasources_name;
|
|
81
80
|
setDatasourceEdit({
|
|
82
81
|
name: name,
|
|
83
|
-
spec:
|
|
82
|
+
spec: datasources[name] ?? defaultSpec
|
|
84
83
|
});
|
|
85
84
|
};
|
|
86
85
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
|
|
87
|
-
children: datasourceEdit ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
draft
|
|
86
|
+
children: datasourceEdit ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.ValidationProvider, {
|
|
87
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DatasourceEditorForm, {
|
|
88
|
+
initialDatasourceDefinition: datasourceEdit,
|
|
89
|
+
action: datasourceFormAction,
|
|
90
|
+
isDraft: true,
|
|
91
|
+
onActionChange: setDatasourceFormAction,
|
|
92
|
+
onSave: (def)=>{
|
|
93
|
+
setDatasources((draft)=>{
|
|
94
|
+
delete draft[datasourceEdit.name]; // to tackle the case where datasource name has been changed
|
|
95
|
+
draft[def.name] = def.spec;
|
|
96
|
+
setDatasourceEdit(null);
|
|
97
|
+
});
|
|
98
|
+
},
|
|
99
|
+
onClose: ()=>{
|
|
95
100
|
setDatasourceEdit(null);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
onClose: ()=>{
|
|
99
|
-
setDatasourceEdit(null);
|
|
100
|
-
}
|
|
101
|
+
}
|
|
102
|
+
})
|
|
101
103
|
}) : /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
102
104
|
children: [
|
|
103
105
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
@@ -173,8 +175,6 @@ function DatasourceEditor(props) {
|
|
|
173
175
|
}),
|
|
174
176
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableBody, {
|
|
175
177
|
children: Object.entries(datasources).map(([name, spec])=>{
|
|
176
|
-
var _spec_display;
|
|
177
|
-
var _spec_display_description;
|
|
178
178
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TableRow, {
|
|
179
179
|
children: [
|
|
180
180
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
|
|
@@ -189,7 +189,7 @@ function DatasourceEditor(props) {
|
|
|
189
189
|
children: spec.plugin.kind
|
|
190
190
|
}),
|
|
191
191
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
|
|
192
|
-
children:
|
|
192
|
+
children: spec.display?.description ?? ''
|
|
193
193
|
}),
|
|
194
194
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TableCell, {
|
|
195
195
|
align: "right",
|
|
@@ -49,13 +49,10 @@ function EditDatasourcesButton() {
|
|
|
49
49
|
const handleChangeDatasources = (datasources)=>{
|
|
50
50
|
// Calculates the new list of datasources that are allowed to be used.
|
|
51
51
|
const newSavedDatasources = Object.keys(datasources).filter((key)=>{
|
|
52
|
-
var _datasources_key_plugin, _datasources_key, _savedDatasources_key_plugin, _savedDatasources_key, _datasources_key_plugin_spec, _datasources_key_plugin1, _datasources_key1, _savedDatasources_key_plugin_spec, _savedDatasources_key_plugin1, _savedDatasources_key1;
|
|
53
|
-
var _datasources_key_plugin_spec1;
|
|
54
52
|
// Datasources are allowed to be used if a) they are direct, or b) they are proxied, and their
|
|
55
53
|
// proxy is the same as what we have saved.
|
|
56
|
-
const isDirect = 'directUrl' in (
|
|
57
|
-
|
|
58
|
-
const isSavedProxy = !isDirect && !('directUrl' in ((_savedDatasources_key_plugin_spec1 = (_savedDatasources_key = savedDatasources[key]) === null || _savedDatasources_key === void 0 ? void 0 : (_savedDatasources_key_plugin = _savedDatasources_key.plugin) === null || _savedDatasources_key_plugin === void 0 ? void 0 : _savedDatasources_key_plugin.spec) !== null && _savedDatasources_key_plugin_spec1 !== void 0 ? _savedDatasources_key_plugin_spec1 : {})) && ((_datasources_key1 = datasources[key]) === null || _datasources_key1 === void 0 ? void 0 : (_datasources_key_plugin1 = _datasources_key1.plugin) === null || _datasources_key_plugin1 === void 0 ? void 0 : (_datasources_key_plugin_spec = _datasources_key_plugin1.spec) === null || _datasources_key_plugin_spec === void 0 ? void 0 : _datasources_key_plugin_spec.proxy) === ((_savedDatasources_key1 = savedDatasources[key]) === null || _savedDatasources_key1 === void 0 ? void 0 : (_savedDatasources_key_plugin1 = _savedDatasources_key1.plugin) === null || _savedDatasources_key_plugin1 === void 0 ? void 0 : (_savedDatasources_key_plugin_spec = _savedDatasources_key_plugin1.spec) === null || _savedDatasources_key_plugin_spec === void 0 ? void 0 : _savedDatasources_key_plugin_spec.proxy);
|
|
54
|
+
const isDirect = 'directUrl' in (datasources[key]?.plugin?.spec ?? {});
|
|
55
|
+
const isSavedProxy = !isDirect && !('directUrl' in (savedDatasources[key]?.plugin?.spec ?? {})) && datasources[key]?.plugin?.spec?.proxy === savedDatasources[key]?.plugin?.spec?.proxy;
|
|
59
56
|
return isDirect || isSavedProxy;
|
|
60
57
|
}).reduce((obj, key)=>{
|
|
61
58
|
obj[key] = datasources[key];
|
|
@@ -31,16 +31,15 @@ function _interop_require_default(obj) {
|
|
|
31
31
|
}
|
|
32
32
|
const DeletePanelGroupDialog = ()=>{
|
|
33
33
|
const { deletePanelGroupDialog, closeDeletePanelGroupDialog, deletePanelGroup } = (0, _context.useDeletePanelGroupDialog)();
|
|
34
|
-
const panelGroupId = deletePanelGroupDialog
|
|
34
|
+
const panelGroupId = deletePanelGroupDialog?.panelGroupId;
|
|
35
35
|
const handleDelete = (e)=>{
|
|
36
36
|
e.preventDefault();
|
|
37
|
-
if (panelGroupId
|
|
37
|
+
if (panelGroupId === undefined) {
|
|
38
38
|
throw new Error('group index is undefined');
|
|
39
39
|
}
|
|
40
40
|
deletePanelGroup(panelGroupId);
|
|
41
41
|
closeDeletePanelGroupDialog();
|
|
42
42
|
};
|
|
43
|
-
var _deletePanelGroupDialog_panelGroupName;
|
|
44
43
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Dialog, {
|
|
45
44
|
open: deletePanelGroupDialog !== undefined,
|
|
46
45
|
children: [
|
|
@@ -67,7 +66,7 @@ const DeletePanelGroupDialog = ()=>{
|
|
|
67
66
|
},
|
|
68
67
|
children: [
|
|
69
68
|
"Are you sure you want to delete ",
|
|
70
|
-
|
|
69
|
+
deletePanelGroupDialog?.panelGroupName ?? 'panel group',
|
|
71
70
|
"? This will delete all the panels within the group."
|
|
72
71
|
]
|
|
73
72
|
}),
|
|
@@ -25,13 +25,12 @@ const _react = require("react");
|
|
|
25
25
|
const _material = require("@mui/material");
|
|
26
26
|
const _components = require("@perses-dev/components");
|
|
27
27
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
28
|
-
const
|
|
29
|
-
const _useDashboard = require("../../context/useDashboard");
|
|
28
|
+
const _context = require("../../context");
|
|
30
29
|
const EditJsonDialog = (props)=>{
|
|
31
30
|
const { isReadonly, disableMetadataEdition } = props;
|
|
32
|
-
const { editJsonDialog, closeEditJsonDialog } = (0,
|
|
31
|
+
const { editJsonDialog, closeEditJsonDialog } = (0, _context.useEditJsonDialog)();
|
|
33
32
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_components.Dialog, {
|
|
34
|
-
open: !!
|
|
33
|
+
open: !!editJsonDialog?.isOpen,
|
|
35
34
|
scroll: "paper",
|
|
36
35
|
fullWidth: true,
|
|
37
36
|
maxWidth: "lg",
|
|
@@ -43,7 +42,7 @@ const EditJsonDialog = (props)=>{
|
|
|
43
42
|
" Dashboard JSON"
|
|
44
43
|
]
|
|
45
44
|
}),
|
|
46
|
-
|
|
45
|
+
editJsonDialog?.isOpen && /*#__PURE__*/ (0, _jsxruntime.jsx)(EditJsonDialogForm, {
|
|
47
46
|
isReadonly: isReadonly,
|
|
48
47
|
disableMetadataEdition: disableMetadataEdition
|
|
49
48
|
})
|
|
@@ -52,9 +51,9 @@ const EditJsonDialog = (props)=>{
|
|
|
52
51
|
};
|
|
53
52
|
const EditJsonDialogForm = (props)=>{
|
|
54
53
|
const { isReadonly, disableMetadataEdition } = props;
|
|
55
|
-
const { closeEditJsonDialog } = (0,
|
|
54
|
+
const { closeEditJsonDialog } = (0, _context.useEditJsonDialog)();
|
|
56
55
|
const { setTimeRange, setRefreshInterval } = (0, _pluginsystem.useTimeRange)();
|
|
57
|
-
const { dashboard, setDashboard } = (0,
|
|
56
|
+
const { dashboard, setDashboard } = (0, _context.useDashboard)();
|
|
58
57
|
const { setLocalDatasources } = (0, _pluginsystem.useDatasourceStore)();
|
|
59
58
|
const [draftDashboard, setDraftDashboard] = (0, _react.useState)(dashboard);
|
|
60
59
|
const handleApply = (e)=>{
|
|
@@ -63,17 +62,15 @@ const EditJsonDialogForm = (props)=>{
|
|
|
63
62
|
setTimeRange({
|
|
64
63
|
pastDuration: draftDashboard.spec.duration
|
|
65
64
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
var _draftDashboard_spec_datasources;
|
|
69
|
-
setLocalDatasources((_draftDashboard_spec_datasources = draftDashboard.spec.datasources) !== null && _draftDashboard_spec_datasources !== void 0 ? _draftDashboard_spec_datasources : {});
|
|
65
|
+
setRefreshInterval(draftDashboard.spec.refreshInterval ?? '0s');
|
|
66
|
+
setLocalDatasources(draftDashboard.spec.datasources ?? {});
|
|
70
67
|
closeEditJsonDialog();
|
|
71
68
|
};
|
|
72
69
|
const completeDraftDashboard = (dashboard)=>{
|
|
73
70
|
try {
|
|
74
|
-
const json = JSON.parse(dashboard
|
|
71
|
+
const json = JSON.parse(dashboard ?? '{}');
|
|
75
72
|
setDraftDashboard(json);
|
|
76
|
-
} catch (
|
|
73
|
+
} catch (_) {
|
|
77
74
|
// do nothing
|
|
78
75
|
}
|
|
79
76
|
};
|
|
@@ -32,7 +32,7 @@ const DEFAULT_DESCRIPTION = {
|
|
|
32
32
|
view: 'This dashboard is currently empty. Get started by clicking the edit button.'
|
|
33
33
|
};
|
|
34
34
|
// Constants from specifics in designs to make the default messaging look good.
|
|
35
|
-
const CONTAINER_WIDTH = '
|
|
35
|
+
const CONTAINER_WIDTH = '500px';
|
|
36
36
|
const PRIMARY_CONTENT_WIDTH = '289px';
|
|
37
37
|
const COMMON_BUTTON_PROPS = {
|
|
38
38
|
variant: 'outlined',
|
|
@@ -105,7 +105,7 @@ const EmptyDashboard = ({ title = DEFAULT_TITLE, image, description, additionalT
|
|
|
105
105
|
}),
|
|
106
106
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
107
107
|
variant: "body1",
|
|
108
|
-
children: description
|
|
108
|
+
children: description ?? defaultDescription
|
|
109
109
|
}),
|
|
110
110
|
actionsContent && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
111
111
|
sx: {
|
|
@@ -33,17 +33,22 @@ function GridContainer(props) {
|
|
|
33
33
|
isFirstRender
|
|
34
34
|
]);
|
|
35
35
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(ReactGridLayoutContainer, {
|
|
36
|
-
sx:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
sx: [
|
|
37
|
+
{
|
|
38
|
+
// This adds spacing between grids (rows) in the overall dashboard
|
|
39
|
+
'& + &': {
|
|
40
|
+
marginTop: 1
|
|
41
|
+
},
|
|
42
|
+
// This disables the animation of grid items when a grid is first rendered
|
|
43
|
+
// (see https://github.com/react-grid-layout/react-grid-layout/issues/103)
|
|
44
|
+
'& .react-grid-item.cssTransforms': {
|
|
45
|
+
transitionProperty: isFirstRender ? 'none' : 'transform'
|
|
46
|
+
}
|
|
40
47
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
},
|
|
48
|
+
...Array.isArray(props.sx) ? props.sx : [
|
|
49
|
+
props.sx
|
|
50
|
+
]
|
|
51
|
+
],
|
|
47
52
|
"data-testid": "panel-group",
|
|
48
53
|
children: props.children
|
|
49
54
|
});
|
|
@@ -25,18 +25,30 @@ const _material = require("@mui/material");
|
|
|
25
25
|
const _reactintersectionobserver = require("react-intersection-observer");
|
|
26
26
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
27
27
|
const _context = require("../../context");
|
|
28
|
-
const _Panel = require("../Panel
|
|
28
|
+
const _Panel = require("../Panel");
|
|
29
|
+
const _panelgroupslice = require("../../context/DashboardProvider/panel-group-slice");
|
|
29
30
|
function GridItemContent(props) {
|
|
30
31
|
const { panelGroupItemId, width } = props;
|
|
31
32
|
const panelDefinition = (0, _context.usePanel)(panelGroupItemId);
|
|
32
33
|
const { spec: { queries } } = panelDefinition;
|
|
33
34
|
const { isEditMode } = (0, _context.useEditMode)();
|
|
34
|
-
const { openEditPanel, openDeletePanelDialog, duplicatePanel } = (0, _context.usePanelActions)(panelGroupItemId);
|
|
35
|
+
const { openEditPanel, openDeletePanelDialog, duplicatePanel, viewPanel } = (0, _context.usePanelActions)(panelGroupItemId);
|
|
36
|
+
const viewPanelGroupItemId = (0, _context.useViewPanel)();
|
|
35
37
|
const { ref, inView } = (0, _reactintersectionobserver.useInView)({
|
|
36
38
|
threshold: 0.2,
|
|
37
39
|
initialInView: false,
|
|
38
40
|
triggerOnce: true
|
|
39
41
|
});
|
|
42
|
+
const readHandlers = {
|
|
43
|
+
isPanelViewed: (0, _panelgroupslice.isPanelGroupItemIdEqual)(viewPanelGroupItemId, panelGroupItemId),
|
|
44
|
+
onViewPanelClick: function() {
|
|
45
|
+
if (viewPanelGroupItemId === undefined) {
|
|
46
|
+
viewPanel(panelGroupItemId);
|
|
47
|
+
} else {
|
|
48
|
+
viewPanel(undefined);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
40
52
|
// Provide actions to the panel when in edit mode
|
|
41
53
|
let editHandlers = undefined;
|
|
42
54
|
if (isEditMode) {
|
|
@@ -48,7 +60,8 @@ function GridItemContent(props) {
|
|
|
48
60
|
}
|
|
49
61
|
// map TimeSeriesQueryDefinition to Definition<UnknownSpec>
|
|
50
62
|
const suggestedStepMs = (0, _pluginsystem.useSuggestedStepMs)(width);
|
|
51
|
-
const
|
|
63
|
+
const { data: plugin } = (0, _pluginsystem.usePlugin)('Panel', panelDefinition.spec.plugin.kind);
|
|
64
|
+
const queryDefinitions = queries ?? [];
|
|
52
65
|
const definitions = queryDefinitions.map((query)=>{
|
|
53
66
|
return {
|
|
54
67
|
kind: query.spec.plugin.kind,
|
|
@@ -64,13 +77,15 @@ function GridItemContent(props) {
|
|
|
64
77
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DataQueriesProvider, {
|
|
65
78
|
definitions: definitions,
|
|
66
79
|
options: {
|
|
67
|
-
suggestedStepMs
|
|
80
|
+
suggestedStepMs,
|
|
81
|
+
...plugin?.queryOptions
|
|
68
82
|
},
|
|
69
83
|
queryOptions: {
|
|
70
84
|
enabled: inView
|
|
71
85
|
},
|
|
72
86
|
children: inView && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Panel.Panel, {
|
|
73
87
|
definition: panelDefinition,
|
|
88
|
+
readHandlers: readHandlers,
|
|
74
89
|
editHandlers: editHandlers,
|
|
75
90
|
panelOptions: props.panelOptions,
|
|
76
91
|
panelGroupItemId: panelGroupItemId
|
|
@@ -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
39
|
const { updatePanelGroupLayouts } = (0, _context.usePanelGroupActions)(panelGroupId);
|
|
40
|
-
|
|
41
|
-
const [isOpen, setIsOpen] = (0, _react.useState)((_ref = !groupDefinition.isCollapsed) !== null && _ref !== void 0 ? _ref : true);
|
|
40
|
+
const [isOpen, setIsOpen] = (0, _react.useState)(!groupDefinition.isCollapsed ?? true);
|
|
42
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
|
|
@@ -49,7 +49,7 @@ function GridTitle(props) {
|
|
|
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',
|
|
@@ -116,7 +116,7 @@ function GridTitle(props) {
|
|
|
116
116
|
onClick: (e)=>{
|
|
117
117
|
// Don't trigger expand/collapse
|
|
118
118
|
e.stopPropagation();
|
|
119
|
-
moveDown
|
|
119
|
+
moveDown?.();
|
|
120
120
|
},
|
|
121
121
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ArrowDown.default, {})
|
|
122
122
|
})
|
|
@@ -129,7 +129,7 @@ function GridTitle(props) {
|
|
|
129
129
|
onClick: (e)=>{
|
|
130
130
|
// Don't trigger expand/collapse
|
|
131
131
|
e.stopPropagation();
|
|
132
|
-
moveUp
|
|
132
|
+
moveUp?.();
|
|
133
133
|
},
|
|
134
134
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ArrowUp.default, {})
|
|
135
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,20 +21,19 @@ 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`;
|
|
@@ -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
|
}
|