@perses-dev/dashboards 0.0.0-snapshot-scatterplot-fix-imports-95e1b59 → 0.0.0-snapshot-histogram-types-78c5104
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 +4 -4
- package/dist/cjs/components/Datasources/DatasourceEditor.js +18 -18
- package/dist/cjs/components/Datasources/EditDatasourcesButton.js +2 -5
- package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +2 -0
- package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +5 -4
- package/dist/cjs/components/DownloadButton/DownloadButton.js +135 -29
- 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 +20 -4
- package/dist/cjs/components/GridLayout/GridLayout.js +57 -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 +19 -11
- package/dist/cjs/components/Panel/PanelActions.js +365 -0
- package/dist/cjs/components/Panel/PanelContent.js +59 -13
- package/dist/cjs/components/Panel/PanelHeader.js +14 -117
- package/dist/cjs/components/Panel/PanelLinks.js +136 -0
- package/dist/cjs/components/Panel/PanelPluginLoader.js +56 -0
- package/dist/cjs/components/Panel/index.js +1 -0
- package/dist/cjs/components/PanelDrawer/PanelDrawer.js +9 -6
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +81 -67
- 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} +52 -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 +19 -7
- package/dist/cjs/constants/user-interface-text.js +3 -1
- 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 +25 -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} +76 -87
- 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/test/datasource-provider.js +1 -1
- package/dist/cjs/test/plugin-registry.js +8 -3
- package/dist/cjs/test/render.js +13 -11
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +6 -4
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +10 -9
- 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 +4 -2
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +4 -4
- 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 +3 -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 +6 -5
- 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 -5
- package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.js +94 -29
- 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 +22 -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 +59 -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/{stories/decorators/index.js → components/Panel/HeaderIconButton.js} +7 -6
- package/dist/components/Panel/HeaderIconButton.js.map +1 -0
- package/dist/components/Panel/Panel.d.ts +16 -5
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +25 -12
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/PanelActions.d.ts +22 -0
- package/dist/components/Panel/PanelActions.d.ts.map +1 -0
- package/dist/components/Panel/PanelActions.js +352 -0
- package/dist/components/Panel/PanelActions.js.map +1 -0
- package/dist/components/Panel/PanelContent.d.ts +7 -5
- package/dist/components/Panel/PanelContent.d.ts.map +1 -1
- package/dist/components/Panel/PanelContent.js +61 -15
- package/dist/components/Panel/PanelContent.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts +10 -8
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
- package/dist/components/Panel/PanelHeader.js +18 -116
- 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/Panel/PanelPluginLoader.d.ts +13 -0
- package/dist/components/Panel/PanelPluginLoader.d.ts.map +1 -0
- package/dist/components/Panel/PanelPluginLoader.js +51 -0
- package/dist/components/Panel/PanelPluginLoader.js.map +1 -0
- package/dist/components/Panel/index.d.ts +1 -0
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +1 -0
- package/dist/components/Panel/index.js.map +1 -1
- 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 +84 -70
- 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} +53 -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 +5 -2
- package/dist/constants/styles.d.ts.map +1 -1
- package/dist/constants/styles.js +6 -3
- package/dist/constants/styles.js.map +1 -1
- package/dist/constants/user-interface-text.d.ts +3 -1
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +3 -1
- 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 +45 -23
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +23 -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 +3 -3
- 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} +62 -64
- 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/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 +3 -3
- package/dist/test/datasource-provider.d.ts.map +1 -1
- package/dist/test/datasource-provider.js +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 +8 -3
- 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 +4 -2
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +6 -4
- 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 +11 -10
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/package.json +12 -12
- package/dist/cjs/context/TemplateVariableProvider/index.js +0 -30
- package/dist/cjs/stories/decorators/WithDashboard.js +0 -41
- package/dist/cjs/stories/decorators/WithDatasourceStore.js +0 -39
- package/dist/cjs/stories/decorators/WithTemplateVariables.js +0 -37
- package/dist/cjs/stories/decorators/constants.js +0 -39
- package/dist/cjs/stories/decorators/index.js +0 -33
- 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/WithDashboard.js +0 -33
- package/dist/stories/decorators/WithDashboard.js.map +0 -1
- package/dist/stories/decorators/WithDatasourceStore.js +0 -31
- package/dist/stories/decorators/WithDatasourceStore.js.map +0 -1
- package/dist/stories/decorators/WithTemplateVariables.js +0 -29
- package/dist/stories/decorators/WithTemplateVariables.js.map +0 -1
- package/dist/stories/decorators/constants.js +0 -31
- package/dist/stories/decorators/constants.js.map +0 -1
- package/dist/stories/decorators/index.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,57 @@ 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);
|
|
42
41
|
const { isEditMode } = (0, _context.useEditMode)();
|
|
43
42
|
const [gridColWidth, setGridColWidth] = (0, _react.useState)(0);
|
|
43
|
+
const viewPanelItemId = (0, _context.useViewPanelGroup)();
|
|
44
|
+
const hasViewPanel = viewPanelItemId?.panelGroupId === panelGroupId; // current panelGroup contains the panel extended?
|
|
45
|
+
const itemLayoutViewed = viewPanelItemId?.panelGroupItemLayoutId;
|
|
46
|
+
(0, _react.useEffect)(()=>{
|
|
47
|
+
if (hasViewPanel) {
|
|
48
|
+
setIsOpen(true);
|
|
49
|
+
}
|
|
50
|
+
}, [
|
|
51
|
+
hasViewPanel
|
|
52
|
+
]);
|
|
53
|
+
// If there is a panel in view mode, we should hide the grid if the panel is not in the current group.
|
|
54
|
+
const isGridDisplayed = viewPanelItemId === undefined || hasViewPanel;
|
|
55
|
+
// Item layout is override if there is a panel in view mode
|
|
56
|
+
const itemLayouts = (0, _react.useMemo)(()=>{
|
|
57
|
+
if (itemLayoutViewed) {
|
|
58
|
+
return groupDefinition.itemLayouts.map((itemLayout)=>{
|
|
59
|
+
if (itemLayout.i === itemLayoutViewed) {
|
|
60
|
+
const rowTitleHeight = 40 + 8; // 40 is the height of the row title and 8 is the margin height
|
|
61
|
+
return {
|
|
62
|
+
h: Math.round(((panelFullHeight ?? window.innerHeight) - rowTitleHeight) / (ROW_HEIGHT + DEFAULT_MARGIN)),
|
|
63
|
+
i: itemLayoutViewed,
|
|
64
|
+
w: 48,
|
|
65
|
+
x: 0,
|
|
66
|
+
y: 0
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
return itemLayout;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return groupDefinition.itemLayouts;
|
|
73
|
+
}, [
|
|
74
|
+
groupDefinition.itemLayouts,
|
|
75
|
+
itemLayoutViewed,
|
|
76
|
+
panelFullHeight
|
|
77
|
+
]);
|
|
44
78
|
const handleLayoutChange = (currentLayout, allLayouts)=>{
|
|
45
79
|
// Using the value from `allLayouts` instead of `currentLayout` because of
|
|
46
80
|
// a bug in react-layout-grid where `currentLayout` does not adjust properly
|
|
47
81
|
// when going to a smaller breakpoint and then back to a larger breakpoint.
|
|
48
82
|
// https://github.com/react-grid-layout/react-grid-layout/issues/1663
|
|
49
83
|
const smallLayout = allLayouts[_constants.GRID_LAYOUT_SMALL_BREAKPOINT];
|
|
50
|
-
if (smallLayout) {
|
|
84
|
+
if (smallLayout && !hasViewPanel) {
|
|
51
85
|
updatePanelGroupLayouts(smallLayout);
|
|
52
86
|
}
|
|
53
87
|
};
|
|
@@ -61,7 +95,14 @@ function GridLayout(props) {
|
|
|
61
95
|
// exclude margin and padding from total width
|
|
62
96
|
setGridColWidth((containerWidth - marginWidth - containerPaddingWidth) / cols);
|
|
63
97
|
};
|
|
98
|
+
// https://github.com/react-grid-layout/react-grid-layout?tab=readme-ov-file#react-hooks-performance
|
|
99
|
+
const ResponsiveGridLayout = (0, _react.useMemo)(()=>(0, _reactgridlayout.WidthProvider)(_reactgridlayout.Responsive), []);
|
|
64
100
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_GridContainer.GridContainer, {
|
|
101
|
+
sx: {
|
|
102
|
+
display: isGridDisplayed ? 'block' : 'none',
|
|
103
|
+
height: itemLayoutViewed ? `${panelFullHeight}px` : 'unset',
|
|
104
|
+
overflow: itemLayoutViewed ? 'hidden' : 'unset'
|
|
105
|
+
},
|
|
65
106
|
children: [
|
|
66
107
|
groupDefinition.title !== undefined && /*#__PURE__*/ (0, _jsxruntime.jsx)(_GridTitle.GridTitle, {
|
|
67
108
|
panelGroupId: panelGroupId,
|
|
@@ -83,13 +124,13 @@ function GridLayout(props) {
|
|
|
83
124
|
xxs: 0
|
|
84
125
|
},
|
|
85
126
|
cols: _constants.GRID_LAYOUT_COLS,
|
|
86
|
-
rowHeight:
|
|
87
|
-
draggableHandle:
|
|
127
|
+
rowHeight: ROW_HEIGHT,
|
|
128
|
+
draggableHandle: ".drag-handle",
|
|
88
129
|
resizeHandles: [
|
|
89
130
|
'se'
|
|
90
131
|
],
|
|
91
|
-
isDraggable: isEditMode,
|
|
92
|
-
isResizable: isEditMode,
|
|
132
|
+
isDraggable: isEditMode && !hasViewPanel,
|
|
133
|
+
isResizable: isEditMode && !hasViewPanel,
|
|
93
134
|
margin: [
|
|
94
135
|
DEFAULT_MARGIN,
|
|
95
136
|
DEFAULT_MARGIN
|
|
@@ -99,15 +140,19 @@ function GridLayout(props) {
|
|
|
99
140
|
10
|
|
100
141
|
],
|
|
101
142
|
layouts: {
|
|
102
|
-
[_constants.GRID_LAYOUT_SMALL_BREAKPOINT]:
|
|
143
|
+
[_constants.GRID_LAYOUT_SMALL_BREAKPOINT]: itemLayouts
|
|
103
144
|
},
|
|
104
145
|
onLayoutChange: handleLayoutChange,
|
|
105
146
|
onWidthChange: handleWidthChange,
|
|
106
|
-
|
|
147
|
+
allowOverlap: hasViewPanel,
|
|
148
|
+
children: itemLayouts.map(({ i, w })=>/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
149
|
+
style: {
|
|
150
|
+
display: itemLayoutViewed !== undefined ? itemLayoutViewed === i ? 'unset' : 'none' : 'unset'
|
|
151
|
+
},
|
|
107
152
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ErrorBoundary, {
|
|
108
153
|
FallbackComponent: _components.ErrorAlert,
|
|
109
154
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_GridItemContent.GridItemContent, {
|
|
110
|
-
panelOptions:
|
|
155
|
+
panelOptions: panelOptions,
|
|
111
156
|
panelGroupItemId: {
|
|
112
157
|
panelGroupId,
|
|
113
158
|
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,20 @@ 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");
|
|
26
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
24
27
|
const _react = require("react");
|
|
25
28
|
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
29
|
const _PanelContent = require("./PanelContent");
|
|
30
|
+
const _PanelHeader = require("./PanelHeader");
|
|
30
31
|
function _interop_require_default(obj) {
|
|
31
32
|
return obj && obj.__esModule ? obj : {
|
|
32
33
|
default: obj
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
36
|
const Panel = /*#__PURE__*/ (0, _react.memo)(function Panel(props) {
|
|
36
|
-
|
|
37
|
-
const { definition, editHandlers, onMouseEnter, onMouseLeave, sx, panelOptions, panelGroupItemId, ...others } = props;
|
|
37
|
+
const { definition, readHandlers, editHandlers, onMouseEnter, onMouseLeave, sx, panelOptions, panelGroupItemId, ...others } = props;
|
|
38
38
|
// Make sure we have an ID we can use for aria attributes
|
|
39
39
|
const generatedPanelId = (0, _components.useId)('Panel');
|
|
40
40
|
const headerId = `${generatedPanelId}-header`;
|
|
@@ -53,11 +53,12 @@ const Panel = /*#__PURE__*/ (0, _react.memo)(function Panel(props) {
|
|
|
53
53
|
height
|
|
54
54
|
]);
|
|
55
55
|
const chartsTheme = (0, _components.useChartsTheme)();
|
|
56
|
+
const { queryResults } = (0, _pluginsystem.useDataQueriesContext)();
|
|
56
57
|
const handleMouseEnter = (e)=>{
|
|
57
|
-
onMouseEnter
|
|
58
|
+
onMouseEnter?.(e);
|
|
58
59
|
};
|
|
59
60
|
const handleMouseLeave = (e)=>{
|
|
60
|
-
onMouseLeave
|
|
61
|
+
onMouseLeave?.(e);
|
|
61
62
|
};
|
|
62
63
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Card, {
|
|
63
64
|
component: "section",
|
|
@@ -65,7 +66,10 @@ const Panel = /*#__PURE__*/ (0, _react.memo)(function Panel(props) {
|
|
|
65
66
|
width: '100%',
|
|
66
67
|
height: '100%',
|
|
67
68
|
display: 'flex',
|
|
68
|
-
flexFlow: 'column nowrap'
|
|
69
|
+
flexFlow: 'column nowrap',
|
|
70
|
+
':hover': {
|
|
71
|
+
'--panel-hover': 'block'
|
|
72
|
+
}
|
|
69
73
|
}, sx),
|
|
70
74
|
variant: "outlined",
|
|
71
75
|
onMouseEnter: handleMouseEnter,
|
|
@@ -75,15 +79,18 @@ const Panel = /*#__PURE__*/ (0, _react.memo)(function Panel(props) {
|
|
|
75
79
|
"data-testid": "panel",
|
|
76
80
|
...others,
|
|
77
81
|
children: [
|
|
78
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_PanelHeader.PanelHeader, {
|
|
79
|
-
extra: panelOptions
|
|
82
|
+
!panelOptions?.hideHeader && /*#__PURE__*/ (0, _jsxruntime.jsx)(_PanelHeader.PanelHeader, {
|
|
83
|
+
extra: panelOptions?.extra?.({
|
|
80
84
|
panelDefinition: definition,
|
|
81
85
|
panelGroupItemId
|
|
82
86
|
}),
|
|
83
87
|
id: headerId,
|
|
84
88
|
title: definition.spec.display.name,
|
|
85
89
|
description: definition.spec.display.description,
|
|
90
|
+
queryResults: queryResults,
|
|
91
|
+
readHandlers: readHandlers,
|
|
86
92
|
editHandlers: editHandlers,
|
|
93
|
+
links: definition.spec.links,
|
|
87
94
|
sx: {
|
|
88
95
|
paddingX: `${chartsTheme.container.padding.default}px`
|
|
89
96
|
}
|
|
@@ -111,7 +118,8 @@ const Panel = /*#__PURE__*/ (0, _react.memo)(function Panel(props) {
|
|
|
111
118
|
definition: definition,
|
|
112
119
|
panelPluginKind: definition.spec.plugin.kind,
|
|
113
120
|
spec: definition.spec.plugin.spec,
|
|
114
|
-
contentDimensions: contentDimensions
|
|
121
|
+
contentDimensions: contentDimensions,
|
|
122
|
+
queryResults: queryResults
|
|
115
123
|
})
|
|
116
124
|
})
|
|
117
125
|
})
|
|
@@ -0,0 +1,365 @@
|
|
|
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 _Alert = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Alert"));
|
|
35
|
+
const _InformationOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/InformationOutline"));
|
|
36
|
+
const _constants = require("../../constants");
|
|
37
|
+
const _HeaderIconButton = require("./HeaderIconButton");
|
|
38
|
+
const _PanelLinks = require("./PanelLinks");
|
|
39
|
+
function _interop_require_default(obj) {
|
|
40
|
+
return obj && obj.__esModule ? obj : {
|
|
41
|
+
default: obj
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
const ConditionalBox = (0, _material.styled)(_material.Box)({
|
|
45
|
+
display: 'none',
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
flexGrow: 1,
|
|
48
|
+
justifyContent: 'flex-end'
|
|
49
|
+
});
|
|
50
|
+
const PanelActions = ({ editHandlers, readHandlers, extra, title, description, descriptionTooltipId, links, queryResults })=>{
|
|
51
|
+
const descriptionAction = (0, _react.useMemo)(()=>{
|
|
52
|
+
if (description && description.trim().length > 0) {
|
|
53
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
54
|
+
id: descriptionTooltipId,
|
|
55
|
+
description: description,
|
|
56
|
+
enterDelay: 100,
|
|
57
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
|
|
58
|
+
"aria-label": "panel description",
|
|
59
|
+
size: "small",
|
|
60
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_InformationOutline.default, {
|
|
61
|
+
"aria-describedby": "info-tooltip",
|
|
62
|
+
"aria-hidden": false,
|
|
63
|
+
fontSize: "inherit",
|
|
64
|
+
sx: {
|
|
65
|
+
color: (theme)=>theme.palette.text.secondary
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return undefined;
|
|
72
|
+
}, [
|
|
73
|
+
descriptionTooltipId,
|
|
74
|
+
description
|
|
75
|
+
]);
|
|
76
|
+
const linksAction = links && links.length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_PanelLinks.PanelLinks, {
|
|
77
|
+
links: links
|
|
78
|
+
});
|
|
79
|
+
const extraActions = editHandlers === undefined && extra;
|
|
80
|
+
const queryStateIndicator = (0, _react.useMemo)(()=>{
|
|
81
|
+
const hasData = queryResults.some((q)=>q.data);
|
|
82
|
+
const isFetching = queryResults.some((q)=>q.isFetching);
|
|
83
|
+
const queryErrors = queryResults.filter((q)=>q.error);
|
|
84
|
+
if (isFetching && hasData) {
|
|
85
|
+
// If the panel has no data, the panel content will show the loading overlay.
|
|
86
|
+
// Therefore, show the circular loading indicator only in case the panel doesn't display the loading overlay already.
|
|
87
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.CircularProgress, {
|
|
88
|
+
"aria-label": "loading",
|
|
89
|
+
size: "1.125rem"
|
|
90
|
+
});
|
|
91
|
+
} else if (queryErrors.length > 0) {
|
|
92
|
+
const errorTexts = queryErrors.map((q)=>q.error).map((e)=>e?.message ?? e?.toString() ?? 'Unknown error') // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
93
|
+
.join('\n');
|
|
94
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
95
|
+
description: errorTexts,
|
|
96
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
|
|
97
|
+
"aria-label": "panel errors",
|
|
98
|
+
size: "small",
|
|
99
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Alert.default, {
|
|
100
|
+
fontSize: "inherit"
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}, [
|
|
106
|
+
queryResults
|
|
107
|
+
]);
|
|
108
|
+
const readActions = (0, _react.useMemo)(()=>{
|
|
109
|
+
if (readHandlers !== undefined) {
|
|
110
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
111
|
+
description: _constants.TOOLTIP_TEXT.viewPanel,
|
|
112
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
|
|
113
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.viewPanel(title),
|
|
114
|
+
size: "small",
|
|
115
|
+
onClick: readHandlers.onViewPanelClick,
|
|
116
|
+
children: readHandlers.isPanelViewed ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_ArrowCollapse.default, {
|
|
117
|
+
fontSize: "inherit"
|
|
118
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_ArrowExpand.default, {
|
|
119
|
+
fontSize: "inherit"
|
|
120
|
+
})
|
|
121
|
+
})
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
return undefined;
|
|
125
|
+
}, [
|
|
126
|
+
readHandlers,
|
|
127
|
+
title
|
|
128
|
+
]);
|
|
129
|
+
const editActions = (0, _react.useMemo)(()=>{
|
|
130
|
+
if (editHandlers !== undefined) {
|
|
131
|
+
// If there are edit handlers, always just show the edit buttons
|
|
132
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
133
|
+
children: [
|
|
134
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
135
|
+
description: _constants.TOOLTIP_TEXT.editPanel,
|
|
136
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
|
|
137
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.editPanel(title),
|
|
138
|
+
size: "small",
|
|
139
|
+
onClick: editHandlers.onEditPanelClick,
|
|
140
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PencilOutline.default, {
|
|
141
|
+
fontSize: "inherit"
|
|
142
|
+
})
|
|
143
|
+
})
|
|
144
|
+
}),
|
|
145
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
146
|
+
description: _constants.TOOLTIP_TEXT.duplicatePanel,
|
|
147
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
|
|
148
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.duplicatePanel(title),
|
|
149
|
+
size: "small",
|
|
150
|
+
onClick: editHandlers.onDuplicatePanelClick,
|
|
151
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ContentCopy.default, {
|
|
152
|
+
fontSize: "inherit",
|
|
153
|
+
sx: {
|
|
154
|
+
// Shrink this icon a little bit to look more consistent
|
|
155
|
+
// with the other icons in the header.
|
|
156
|
+
transform: 'scale(0.925)'
|
|
157
|
+
}
|
|
158
|
+
})
|
|
159
|
+
})
|
|
160
|
+
}),
|
|
161
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
162
|
+
description: _constants.TOOLTIP_TEXT.deletePanel,
|
|
163
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
|
|
164
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.deletePanel(title),
|
|
165
|
+
size: "small",
|
|
166
|
+
onClick: editHandlers.onDeletePanelClick,
|
|
167
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DeleteOutline.default, {
|
|
168
|
+
fontSize: "inherit"
|
|
169
|
+
})
|
|
170
|
+
})
|
|
171
|
+
})
|
|
172
|
+
]
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
return undefined;
|
|
176
|
+
}, [
|
|
177
|
+
editHandlers,
|
|
178
|
+
title
|
|
179
|
+
]);
|
|
180
|
+
const moveAction = (0, _react.useMemo)(()=>{
|
|
181
|
+
if (editActions && !readHandlers?.isPanelViewed) {
|
|
182
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
183
|
+
description: _constants.TOOLTIP_TEXT.movePanel,
|
|
184
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
|
|
185
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.movePanel(title),
|
|
186
|
+
size: "small",
|
|
187
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DragVertical.default, {
|
|
188
|
+
className: "drag-handle",
|
|
189
|
+
sx: {
|
|
190
|
+
cursor: 'grab'
|
|
191
|
+
},
|
|
192
|
+
fontSize: "inherit"
|
|
193
|
+
})
|
|
194
|
+
})
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
return undefined;
|
|
198
|
+
}, [
|
|
199
|
+
editActions,
|
|
200
|
+
readHandlers,
|
|
201
|
+
title
|
|
202
|
+
]);
|
|
203
|
+
const divider = /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
204
|
+
sx: {
|
|
205
|
+
flexGrow: 1
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
// if the panel is in non-editing, non-fullscreen mode, show certain icons only on hover
|
|
209
|
+
const OnHover = ({ children })=>editHandlers === undefined && !readHandlers?.isPanelViewed ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
210
|
+
sx: {
|
|
211
|
+
display: 'var(--panel-hover, none)'
|
|
212
|
+
},
|
|
213
|
+
children: children
|
|
214
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
|
|
215
|
+
children: children
|
|
216
|
+
});
|
|
217
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
218
|
+
children: [
|
|
219
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(ConditionalBox, {
|
|
220
|
+
sx: (theme)=>({
|
|
221
|
+
[theme.containerQueries(_constants.HEADER_ACTIONS_CONTAINER_NAME).between(0, _constants.HEADER_SMALL_WIDTH)]: {
|
|
222
|
+
display: 'flex'
|
|
223
|
+
}
|
|
224
|
+
}),
|
|
225
|
+
children: [
|
|
226
|
+
divider,
|
|
227
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(OnHover, {
|
|
228
|
+
children: [
|
|
229
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(OverflowMenu, {
|
|
230
|
+
title: title,
|
|
231
|
+
children: [
|
|
232
|
+
descriptionAction,
|
|
233
|
+
" ",
|
|
234
|
+
linksAction,
|
|
235
|
+
" ",
|
|
236
|
+
queryStateIndicator,
|
|
237
|
+
" ",
|
|
238
|
+
extraActions,
|
|
239
|
+
" ",
|
|
240
|
+
readActions,
|
|
241
|
+
" ",
|
|
242
|
+
editActions
|
|
243
|
+
]
|
|
244
|
+
}),
|
|
245
|
+
moveAction
|
|
246
|
+
]
|
|
247
|
+
})
|
|
248
|
+
]
|
|
249
|
+
}),
|
|
250
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(ConditionalBox, {
|
|
251
|
+
sx: (theme)=>({
|
|
252
|
+
[theme.containerQueries(_constants.HEADER_ACTIONS_CONTAINER_NAME).between(_constants.HEADER_SMALL_WIDTH, _constants.HEADER_MEDIUM_WIDTH)]: {
|
|
253
|
+
display: 'flex'
|
|
254
|
+
}
|
|
255
|
+
}),
|
|
256
|
+
children: [
|
|
257
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(OnHover, {
|
|
258
|
+
children: [
|
|
259
|
+
descriptionAction,
|
|
260
|
+
" ",
|
|
261
|
+
linksAction
|
|
262
|
+
]
|
|
263
|
+
}),
|
|
264
|
+
divider,
|
|
265
|
+
" ",
|
|
266
|
+
queryStateIndicator,
|
|
267
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(OnHover, {
|
|
268
|
+
children: [
|
|
269
|
+
extraActions,
|
|
270
|
+
" ",
|
|
271
|
+
readActions,
|
|
272
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(OverflowMenu, {
|
|
273
|
+
title: title,
|
|
274
|
+
children: editActions
|
|
275
|
+
}),
|
|
276
|
+
moveAction
|
|
277
|
+
]
|
|
278
|
+
})
|
|
279
|
+
]
|
|
280
|
+
}),
|
|
281
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(ConditionalBox, {
|
|
282
|
+
sx: (theme)=>({
|
|
283
|
+
// flip the logic here; if the browser (or jsdom) does not support container queries, always show all icons
|
|
284
|
+
display: 'flex',
|
|
285
|
+
[theme.containerQueries(_constants.HEADER_ACTIONS_CONTAINER_NAME).down(_constants.HEADER_MEDIUM_WIDTH)]: {
|
|
286
|
+
display: 'none'
|
|
287
|
+
}
|
|
288
|
+
}),
|
|
289
|
+
children: [
|
|
290
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(OnHover, {
|
|
291
|
+
children: [
|
|
292
|
+
descriptionAction,
|
|
293
|
+
" ",
|
|
294
|
+
linksAction
|
|
295
|
+
]
|
|
296
|
+
}),
|
|
297
|
+
divider,
|
|
298
|
+
" ",
|
|
299
|
+
queryStateIndicator,
|
|
300
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(OnHover, {
|
|
301
|
+
children: [
|
|
302
|
+
extraActions,
|
|
303
|
+
" ",
|
|
304
|
+
readActions,
|
|
305
|
+
" ",
|
|
306
|
+
editActions,
|
|
307
|
+
" ",
|
|
308
|
+
moveAction
|
|
309
|
+
]
|
|
310
|
+
})
|
|
311
|
+
]
|
|
312
|
+
})
|
|
313
|
+
]
|
|
314
|
+
});
|
|
315
|
+
};
|
|
316
|
+
const OverflowMenu = ({ children, title })=>{
|
|
317
|
+
const [anchorPosition, setAnchorPosition] = (0, _react.useState)();
|
|
318
|
+
// do not show overflow menu if there is no content (for example, edit actions are hidden)
|
|
319
|
+
const hasContent = /*#__PURE__*/ (0, _react.isValidElement)(children) || Array.isArray(children) && children.some(_react.isValidElement);
|
|
320
|
+
if (!hasContent) {
|
|
321
|
+
return undefined;
|
|
322
|
+
}
|
|
323
|
+
const handleClick = (event)=>{
|
|
324
|
+
setAnchorPosition(event.currentTarget.getBoundingClientRect());
|
|
325
|
+
};
|
|
326
|
+
const handleClose = ()=>{
|
|
327
|
+
setAnchorPosition(undefined);
|
|
328
|
+
};
|
|
329
|
+
const open = Boolean(anchorPosition);
|
|
330
|
+
const id = open ? 'actions-menu' : undefined;
|
|
331
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
332
|
+
children: [
|
|
333
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
|
|
334
|
+
className: "show-actions",
|
|
335
|
+
"aria-describedby": id,
|
|
336
|
+
onClick: handleClick,
|
|
337
|
+
"aria-label": _constants.ARIA_LABEL_TEXT.showPanelActions(title),
|
|
338
|
+
size: "small",
|
|
339
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Menu.default, {
|
|
340
|
+
fontSize: "inherit"
|
|
341
|
+
})
|
|
342
|
+
}),
|
|
343
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Popover, {
|
|
344
|
+
id: id,
|
|
345
|
+
open: open,
|
|
346
|
+
anchorReference: "anchorPosition",
|
|
347
|
+
anchorPosition: anchorPosition,
|
|
348
|
+
onClose: handleClose,
|
|
349
|
+
anchorOrigin: {
|
|
350
|
+
vertical: 'bottom',
|
|
351
|
+
horizontal: 'left'
|
|
352
|
+
},
|
|
353
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
354
|
+
direction: "row",
|
|
355
|
+
alignItems: "center",
|
|
356
|
+
sx: {
|
|
357
|
+
padding: 1
|
|
358
|
+
},
|
|
359
|
+
onClick: handleClose,
|
|
360
|
+
children: children
|
|
361
|
+
})
|
|
362
|
+
})
|
|
363
|
+
]
|
|
364
|
+
});
|
|
365
|
+
};
|