@perses-dev/dashboards 0.0.0-snapshot-panel-extra-content-3-17f9c42 → 0.0.0-snapshot-scatterplot-fix-imports-95e1b59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/AddGroupButton/AddGroupButton.js +11 -8
- package/dist/cjs/components/AddGroupButton/index.js +10 -8
- package/dist/cjs/components/AddPanelButton/AddPanelButton.js +12 -13
- package/dist/cjs/components/AddPanelButton/index.js +10 -8
- package/dist/cjs/components/Dashboard/Dashboard.js +12 -10
- package/dist/cjs/components/Dashboard/index.js +10 -8
- package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +53 -22
- package/dist/cjs/components/DashboardStickyToolbar/index.js +10 -8
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +82 -103
- package/dist/cjs/components/DashboardToolbar/index.js +10 -8
- package/dist/cjs/components/Datasources/DatasourceEditor.js +236 -0
- package/dist/cjs/components/Datasources/EditDatasourcesButton.js +112 -0
- package/dist/cjs/components/{ToolbarIconButton → Datasources}/index.js +11 -8
- package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +16 -14
- package/dist/cjs/components/DeletePanelDialog/index.js +10 -8
- package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +18 -16
- package/dist/cjs/components/DeletePanelGroupDialog/index.js +10 -8
- package/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +6 -4
- package/dist/cjs/components/DiscardChangesConfirmationDialog/index.js +10 -8
- package/dist/cjs/components/DownloadButton/DownloadButton.js +13 -12
- package/dist/cjs/components/DownloadButton/index.js +10 -8
- package/dist/cjs/components/EditButton/EditButton.js +9 -7
- package/dist/cjs/components/EditButton/index.js +10 -8
- package/dist/cjs/components/EditJsonButton/EditJsonButton.js +15 -12
- package/dist/cjs/components/EditJsonButton/index.js +10 -8
- package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +54 -25
- package/dist/cjs/components/EditJsonDialog/index.js +10 -8
- package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +21 -19
- package/dist/cjs/components/EmptyDashboard/index.js +10 -8
- package/dist/cjs/components/GridLayout/GridContainer.js +6 -4
- package/dist/cjs/components/GridLayout/GridItemContent.js +37 -19
- package/dist/cjs/components/GridLayout/GridLayout.js +21 -19
- package/dist/cjs/components/GridLayout/GridTitle.js +40 -39
- package/dist/cjs/components/GridLayout/index.js +13 -11
- package/dist/cjs/components/Panel/Panel.js +19 -23
- package/dist/cjs/components/Panel/PanelContent.js +11 -8
- package/dist/cjs/components/Panel/PanelHeader.js +35 -33
- package/dist/cjs/components/Panel/index.js +10 -8
- package/dist/cjs/components/PanelDrawer/PanelDrawer.js +25 -77
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +237 -144
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +13 -12
- package/dist/cjs/components/PanelDrawer/index.js +11 -8
- package/dist/cjs/components/PanelDrawer/usePanelEditor.js +5 -3
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +18 -16
- package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +16 -12
- package/dist/cjs/components/PanelGroupDialog/index.js +10 -8
- package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +48 -46
- package/dist/cjs/components/QuerySummaryTable/index.js +10 -8
- package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +26 -24
- package/dist/cjs/components/SaveChangesConfirmationDialog/index.js +10 -8
- package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +14 -14
- package/dist/cjs/components/SaveDashboardButton/index.js +10 -8
- package/dist/cjs/components/Variables/BuiltinVariableAccordions.js +141 -0
- package/dist/cjs/components/Variables/EditVariablesButton.js +19 -17
- package/dist/cjs/components/Variables/TemplateVariable.js +261 -107
- package/dist/cjs/components/Variables/VariableEditor.js +282 -207
- package/dist/cjs/components/Variables/VariableList.js +24 -22
- package/dist/cjs/components/Variables/index.js +14 -11
- package/dist/cjs/components/index.js +30 -29
- package/dist/cjs/constants/grid-layout-config.js +6 -2
- package/dist/cjs/constants/index.js +12 -9
- package/dist/cjs/constants/styles.js +42 -0
- package/dist/cjs/constants/user-interface-text.js +8 -3
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +48 -35
- package/dist/cjs/context/DashboardProvider/common.js +6 -2
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +81 -49
- package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +4 -2
- package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +8 -6
- package/dist/cjs/context/DashboardProvider/discard-changes-dialog-slice.js +3 -1
- package/dist/cjs/context/DashboardProvider/duplicate-panel-slice.js +4 -2
- package/dist/cjs/context/DashboardProvider/edit-json-dialog-slice.js +3 -1
- package/dist/cjs/context/DashboardProvider/index.js +12 -10
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +17 -17
- package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +8 -6
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +16 -8
- package/dist/cjs/context/DashboardProvider/panel-slice.js +3 -1
- package/dist/cjs/context/DashboardProvider/save-changes-dialog-slice.js +3 -1
- package/dist/cjs/context/DatasourceStoreProvider.js +177 -50
- package/dist/cjs/context/TemplateVariableProvider/TemplateVariableProvider.js +150 -39
- package/dist/cjs/context/TemplateVariableProvider/hydrationUtils.js +12 -10
- package/dist/cjs/context/TemplateVariableProvider/index.js +10 -8
- package/dist/cjs/context/TemplateVariableProvider/query-params.js +17 -7
- package/dist/cjs/context/TemplateVariableProvider/utils.js +15 -7
- package/dist/cjs/context/index.js +13 -11
- package/dist/cjs/context/useDashboard.js +30 -11
- package/dist/cjs/index.js +12 -10
- package/dist/cjs/stories/decorators/WithDashboard.js +6 -4
- package/dist/cjs/stories/decorators/WithDatasourceStore.js +6 -4
- package/dist/cjs/stories/decorators/WithTemplateVariables.js +6 -4
- package/dist/cjs/stories/decorators/constants.js +5 -3
- package/dist/cjs/stories/decorators/index.js +13 -11
- package/dist/cjs/test/dashboard-provider.js +8 -4
- package/dist/cjs/test/datasource-provider.js +16 -12
- package/dist/cjs/test/index.js +13 -11
- package/dist/cjs/test/plugin-registry.js +6 -4
- package/dist/cjs/test/render.js +28 -21
- package/dist/cjs/test/setup-tests.js +2 -2
- package/dist/cjs/test/testDashboard.js +13 -11
- package/dist/cjs/utils/index.js +10 -9
- package/dist/cjs/utils/panelUtils.js +11 -5
- package/dist/cjs/{components/TimeRangeControls → validation}/index.js +10 -8
- package/dist/cjs/{utils/time.js → validation/panel.js} +11 -9
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +32 -18
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +64 -21
- package/dist/cjs/views/ViewDashboard/index.js +10 -8
- package/dist/cjs/views/index.js +10 -8
- package/dist/components/AddGroupButton/AddGroupButton.d.ts +1 -2
- package/dist/components/AddGroupButton/AddGroupButton.d.ts.map +1 -1
- package/dist/components/AddGroupButton/AddGroupButton.js +3 -2
- package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -1
- package/dist/components/AddGroupButton/index.js.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.d.ts +1 -2
- package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.js +4 -7
- package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -1
- package/dist/components/AddPanelButton/index.js.map +1 -1
- package/dist/components/Dashboard/Dashboard.d.ts +2 -3
- package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
- package/dist/components/Dashboard/Dashboard.js +1 -1
- package/dist/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Dashboard/index.js.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts +1 -2
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +38 -9
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -1
- package/dist/components/DashboardStickyToolbar/index.js.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +63 -86
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/DashboardToolbar/index.js.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.d.ts +7 -0
- package/dist/components/Datasources/DatasourceEditor.d.ts.map +1 -0
- package/dist/components/Datasources/DatasourceEditor.js +223 -0
- package/dist/components/Datasources/DatasourceEditor.js.map +1 -0
- package/dist/components/Datasources/EditDatasourcesButton.d.ts +2 -0
- package/dist/components/Datasources/EditDatasourcesButton.d.ts.map +1 -0
- package/dist/components/Datasources/EditDatasourcesButton.js +99 -0
- package/dist/components/Datasources/EditDatasourcesButton.js.map +1 -0
- package/dist/components/Datasources/index.d.ts +3 -0
- package/dist/components/Datasources/index.d.ts.map +1 -0
- package/dist/components/{TimeRangeControls → Datasources}/index.js +2 -1
- package/dist/components/Datasources/index.js.map +1 -0
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts +1 -2
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js +4 -4
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -1
- package/dist/components/DeletePanelDialog/index.js.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts +1 -2
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +3 -3
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
- package/dist/components/DeletePanelGroupDialog/index.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts +1 -2
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/index.js.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.d.ts +1 -2
- package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.js +3 -4
- package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
- package/dist/components/DownloadButton/index.js.map +1 -1
- package/dist/components/EditButton/EditButton.d.ts +1 -2
- package/dist/components/EditButton/EditButton.d.ts.map +1 -1
- package/dist/components/EditButton/EditButton.js +1 -1
- package/dist/components/EditButton/EditButton.js.map +1 -1
- package/dist/components/EditButton/index.js.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.d.ts +4 -2
- package/dist/components/EditJsonButton/EditJsonButton.d.ts.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.js +7 -6
- package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
- package/dist/components/EditJsonButton/index.js.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts +5 -2
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.js +43 -16
- package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -1
- package/dist/components/EditJsonDialog/index.js.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.js +3 -3
- package/dist/components/EmptyDashboard/EmptyDashboard.js.map +1 -1
- package/dist/components/EmptyDashboard/index.js.map +1 -1
- package/dist/components/GridLayout/GridContainer.d.ts +1 -1
- package/dist/components/GridLayout/GridContainer.d.ts.map +1 -1
- package/dist/components/GridLayout/GridContainer.js +1 -1
- package/dist/components/GridLayout/GridContainer.js.map +1 -1
- package/dist/components/GridLayout/GridItemContent.d.ts +1 -2
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +31 -15
- package/dist/components/GridLayout/GridItemContent.js.map +1 -1
- package/dist/components/GridLayout/GridLayout.d.ts +1 -2
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +6 -6
- package/dist/components/GridLayout/GridLayout.js.map +1 -1
- package/dist/components/GridLayout/GridTitle.d.ts +1 -2
- package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
- package/dist/components/GridLayout/GridTitle.js +5 -6
- package/dist/components/GridLayout/GridTitle.js.map +1 -1
- package/dist/components/GridLayout/index.js.map +1 -1
- package/dist/components/Panel/Panel.d.ts +2 -2
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +7 -13
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/PanelContent.d.ts +3 -3
- package/dist/components/Panel/PanelContent.d.ts.map +1 -1
- package/dist/components/Panel/PanelContent.js +4 -3
- package/dist/components/Panel/PanelContent.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts +2 -2
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
- package/dist/components/Panel/PanelHeader.js +2 -2
- package/dist/components/Panel/PanelHeader.js.map +1 -1
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.d.ts +1 -2
- package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js +22 -76
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts +5 -3
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js +231 -142
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.d.ts +1 -2
- package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js +4 -5
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
- package/dist/components/PanelDrawer/index.d.ts +1 -0
- package/dist/components/PanelDrawer/index.d.ts.map +1 -1
- package/dist/components/PanelDrawer/index.js +1 -0
- package/dist/components/PanelDrawer/index.js.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.js +2 -2
- package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts +1 -2
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts +1 -2
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -1
- package/dist/components/PanelGroupDialog/index.js.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts +1 -2
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js +8 -8
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
- package/dist/components/QuerySummaryTable/index.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts +1 -2
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +8 -8
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/index.js.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts +1 -2
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js +8 -10
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
- package/dist/components/SaveDashboardButton/index.js.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts +7 -0
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts.map +1 -0
- package/dist/components/Variables/BuiltinVariableAccordions.js +128 -0
- package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -0
- package/dist/components/Variables/EditVariablesButton.d.ts +1 -2
- package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
- package/dist/components/Variables/EditVariablesButton.js +7 -7
- package/dist/components/Variables/EditVariablesButton.js.map +1 -1
- package/dist/components/Variables/TemplateVariable.d.ts +12 -4
- package/dist/components/Variables/TemplateVariable.d.ts.map +1 -1
- package/dist/components/Variables/TemplateVariable.js +244 -100
- package/dist/components/Variables/TemplateVariable.js.map +1 -1
- package/dist/components/Variables/VariableEditor.d.ts +4 -4
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditor.js +232 -161
- package/dist/components/Variables/VariableEditor.js.map +1 -1
- package/dist/components/Variables/VariableList.d.ts +2 -3
- package/dist/components/Variables/VariableList.d.ts.map +1 -1
- package/dist/components/Variables/VariableList.js +11 -13
- package/dist/components/Variables/VariableList.js.map +1 -1
- package/dist/components/Variables/index.d.ts +1 -0
- package/dist/components/Variables/index.d.ts.map +1 -1
- package/dist/components/Variables/index.js +1 -0
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/components/index.d.ts +1 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -2
- package/dist/components/index.js.map +1 -1
- package/dist/constants/grid-layout-config.js.map +1 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +1 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/styles.d.ts +5 -0
- package/dist/constants/styles.d.ts.map +1 -0
- package/dist/{utils/time.js → constants/styles.js} +10 -10
- package/dist/constants/styles.js.map +1 -0
- package/dist/constants/user-interface-text.d.ts +2 -1
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +2 -1
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +7 -4
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +16 -9
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
- package/dist/context/DashboardProvider/common.d.ts +3 -3
- package/dist/context/DashboardProvider/common.d.ts.map +1 -1
- package/dist/context/DashboardProvider/common.js.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +17 -17
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.js +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-slice.js +5 -5
- package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/discard-changes-dialog-slice.js.map +1 -1
- package/dist/context/DashboardProvider/duplicate-panel-slice.js +1 -1
- package/dist/context/DashboardProvider/duplicate-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/edit-json-dialog-slice.js.map +1 -1
- package/dist/context/DashboardProvider/index.js.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts +2 -2
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.js +11 -13
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.js +2 -2
- package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.d.ts +2 -2
- package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js +4 -4
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/save-changes-dialog-slice.js.map +1 -1
- package/dist/context/DatasourceStoreProvider.d.ts +17 -12
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +172 -47
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +15 -8
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +1 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +115 -23
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +1 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts.map +1 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.js +7 -7
- package/dist/context/TemplateVariableProvider/hydrationUtils.js.map +1 -1
- package/dist/context/TemplateVariableProvider/index.js.map +1 -1
- package/dist/context/TemplateVariableProvider/query-params.js.map +1 -1
- package/dist/context/TemplateVariableProvider/utils.js +3 -3
- package/dist/context/TemplateVariableProvider/utils.js.map +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/context/useDashboard.d.ts +3 -3
- package/dist/context/useDashboard.d.ts.map +1 -1
- package/dist/context/useDashboard.js +24 -7
- package/dist/context/useDashboard.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/stories/decorators/WithDashboard.js.map +1 -1
- package/dist/stories/decorators/WithDatasourceStore.js.map +1 -1
- package/dist/stories/decorators/WithTemplateVariables.js.map +1 -1
- package/dist/stories/decorators/constants.js +2 -2
- package/dist/stories/decorators/constants.js.map +1 -1
- package/dist/stories/decorators/index.js.map +1 -1
- package/dist/test/dashboard-provider.js.map +1 -1
- package/dist/test/datasource-provider.d.ts.map +1 -1
- package/dist/test/datasource-provider.js +5 -7
- package/dist/test/datasource-provider.js.map +1 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test/plugin-registry.js.map +1 -1
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +9 -4
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test/testDashboard.js +10 -10
- package/dist/test/testDashboard.js.map +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/panelUtils.d.ts +1 -1
- package/dist/utils/panelUtils.d.ts.map +1 -1
- package/dist/utils/panelUtils.js +2 -2
- package/dist/utils/panelUtils.js.map +1 -1
- package/dist/validation/index.d.ts +2 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/{components/ToolbarIconButton → validation}/index.js +1 -1
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/panel.d.ts +19 -0
- package/dist/validation/panel.d.ts.map +1 -0
- package/dist/validation/panel.js +21 -0
- package/dist/validation/panel.js.map +1 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts +4 -3
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +19 -7
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +2 -2
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +53 -12
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/dist/views/ViewDashboard/index.js.map +1 -1
- package/dist/views/index.js.map +1 -1
- package/package.json +8 -7
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -183
- package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +0 -38
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +0 -14
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +0 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +0 -165
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +0 -1
- package/dist/components/TimeRangeControls/index.d.ts +0 -2
- package/dist/components/TimeRangeControls/index.d.ts.map +0 -1
- package/dist/components/TimeRangeControls/index.js.map +0 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts +0 -6
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts.map +0 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js +0 -32
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js.map +0 -1
- package/dist/components/ToolbarIconButton/index.d.ts +0 -2
- package/dist/components/ToolbarIconButton/index.d.ts.map +0 -1
- package/dist/components/ToolbarIconButton/index.js.map +0 -1
- package/dist/utils/time.d.ts +0 -5
- package/dist/utils/time.d.ts.map +0 -1
- package/dist/utils/time.js.map +0 -1
|
@@ -21,39 +21,71 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
useEditJsonDialog: ()
|
|
24
|
+
useDashboardActions: function() {
|
|
25
|
+
return useDashboardActions;
|
|
26
|
+
},
|
|
27
|
+
useDashboardDuration: function() {
|
|
28
|
+
return useDashboardDuration;
|
|
29
|
+
},
|
|
30
|
+
useDeletePanelDialog: function() {
|
|
31
|
+
return useDeletePanelDialog;
|
|
32
|
+
},
|
|
33
|
+
useDeletePanelGroupDialog: function() {
|
|
34
|
+
return useDeletePanelGroupDialog;
|
|
35
|
+
},
|
|
36
|
+
useDiscardChangesConfirmationDialog: function() {
|
|
37
|
+
return useDiscardChangesConfirmationDialog;
|
|
38
|
+
},
|
|
39
|
+
useEditJsonDialog: function() {
|
|
40
|
+
return useEditJsonDialog;
|
|
41
|
+
},
|
|
42
|
+
useEditMode: function() {
|
|
43
|
+
return useEditMode;
|
|
44
|
+
},
|
|
45
|
+
useListPanelGroups: function() {
|
|
46
|
+
return useListPanelGroups;
|
|
47
|
+
},
|
|
48
|
+
usePanel: function() {
|
|
49
|
+
return usePanel;
|
|
50
|
+
},
|
|
51
|
+
usePanelActions: function() {
|
|
52
|
+
return usePanelActions;
|
|
53
|
+
},
|
|
54
|
+
usePanelEditor: function() {
|
|
55
|
+
return usePanelEditor;
|
|
56
|
+
},
|
|
57
|
+
usePanelGroup: function() {
|
|
58
|
+
return usePanelGroup;
|
|
59
|
+
},
|
|
60
|
+
usePanelGroupActions: function() {
|
|
61
|
+
return usePanelGroupActions;
|
|
62
|
+
},
|
|
63
|
+
usePanelGroupEditor: function() {
|
|
64
|
+
return usePanelGroupEditor;
|
|
65
|
+
},
|
|
66
|
+
usePanelGroupIds: function() {
|
|
67
|
+
return usePanelGroupIds;
|
|
68
|
+
},
|
|
69
|
+
useSaveChangesConfirmationDialog: function() {
|
|
70
|
+
return useSaveChangesConfirmationDialog;
|
|
71
|
+
}
|
|
40
72
|
});
|
|
41
73
|
const _react = require("react");
|
|
42
|
-
const
|
|
43
|
-
const selectEditMode = ({ isEditMode
|
|
74
|
+
const _DashboardProvider = require("./DashboardProvider");
|
|
75
|
+
const selectEditMode = ({ isEditMode, setEditMode })=>({
|
|
44
76
|
isEditMode,
|
|
45
77
|
setEditMode
|
|
46
78
|
});
|
|
47
79
|
function useEditMode() {
|
|
48
|
-
return (0,
|
|
80
|
+
return (0, _DashboardProvider.useDashboardStore)(selectEditMode);
|
|
49
81
|
}
|
|
50
|
-
const selectDashboardActions = ({ setDashboard
|
|
82
|
+
const selectDashboardActions = ({ setDashboard, openAddPanelGroup, openAddPanel })=>({
|
|
51
83
|
setDashboard,
|
|
52
84
|
openAddPanelGroup,
|
|
53
85
|
openAddPanel
|
|
54
86
|
});
|
|
55
87
|
function useDashboardActions() {
|
|
56
|
-
const { setDashboard
|
|
88
|
+
const { setDashboard, openAddPanelGroup, openAddPanel } = (0, _DashboardProvider.useDashboardStore)(selectDashboardActions);
|
|
57
89
|
return {
|
|
58
90
|
setDashboard,
|
|
59
91
|
openAddPanelGroup: ()=>openAddPanelGroup(),
|
|
@@ -62,12 +94,12 @@ function useDashboardActions() {
|
|
|
62
94
|
}
|
|
63
95
|
const selectPanelGroupOrder = (state)=>state.panelGroupOrder;
|
|
64
96
|
function usePanelGroupIds() {
|
|
65
|
-
return (0,
|
|
97
|
+
return (0, _DashboardProvider.useDashboardStore)(selectPanelGroupOrder);
|
|
66
98
|
}
|
|
67
99
|
const selectPanelGroups = (state)=>state.panelGroups;
|
|
68
100
|
function useListPanelGroups() {
|
|
69
101
|
const panelGroupIds = usePanelGroupIds();
|
|
70
|
-
const panelGroups = (0,
|
|
102
|
+
const panelGroups = (0, _DashboardProvider.useDashboardStore)(selectPanelGroups);
|
|
71
103
|
return (0, _react.useMemo)(()=>{
|
|
72
104
|
return panelGroupIds.map((id)=>{
|
|
73
105
|
const group = panelGroups[id];
|
|
@@ -82,7 +114,7 @@ function useListPanelGroups() {
|
|
|
82
114
|
]);
|
|
83
115
|
}
|
|
84
116
|
function usePanelGroup(panelGroupId) {
|
|
85
|
-
const panelGroup = (0,
|
|
117
|
+
const panelGroup = (0, _DashboardProvider.useDashboardStore)((0, _react.useCallback)((state)=>state.panelGroups[panelGroupId], [
|
|
86
118
|
panelGroupId
|
|
87
119
|
]));
|
|
88
120
|
if (panelGroup === undefined) {
|
|
@@ -90,15 +122,15 @@ function usePanelGroup(panelGroupId) {
|
|
|
90
122
|
}
|
|
91
123
|
return panelGroup;
|
|
92
124
|
}
|
|
93
|
-
const selectPanelGroupActions = ({ openEditPanelGroup
|
|
125
|
+
const selectPanelGroupActions = ({ openEditPanelGroup, deletePanelGroup, openAddPanel, updatePanelGroupLayouts })=>({
|
|
94
126
|
openEditPanelGroup,
|
|
95
127
|
deletePanelGroup,
|
|
96
128
|
openAddPanel,
|
|
97
129
|
updatePanelGroupLayouts
|
|
98
130
|
});
|
|
99
131
|
function usePanelGroupActions(panelGroupId) {
|
|
100
|
-
const { moveUp
|
|
101
|
-
const { openEditPanelGroup
|
|
132
|
+
const { moveUp, moveDown } = useMovePanelGroup(panelGroupId);
|
|
133
|
+
const { openEditPanelGroup, deletePanelGroup, openAddPanel, updatePanelGroupLayouts } = (0, _DashboardProvider.useDashboardStore)(selectPanelGroupActions);
|
|
102
134
|
return {
|
|
103
135
|
openEditPanelGroup: ()=>openEditPanelGroup(panelGroupId),
|
|
104
136
|
deletePanelGroup: ()=>deletePanelGroup(panelGroupId),
|
|
@@ -114,11 +146,11 @@ const selectPanelGroupsLength = (state)=>state.panelGroupOrder.length;
|
|
|
114
146
|
* Returns functions for moving a panel group up or down. A function will be undefined if the panel group can't be
|
|
115
147
|
* moved in that direction.
|
|
116
148
|
*/ function useMovePanelGroup(panelGroupId) {
|
|
117
|
-
const currentIndex = (0,
|
|
149
|
+
const currentIndex = (0, _DashboardProvider.useDashboardStore)((0, _react.useCallback)((store)=>store.panelGroupOrder.findIndex((id)=>id === panelGroupId), [
|
|
118
150
|
panelGroupId
|
|
119
151
|
]));
|
|
120
|
-
const panelGroupsLength = (0,
|
|
121
|
-
const swapPanelGroups = (0,
|
|
152
|
+
const panelGroupsLength = (0, _DashboardProvider.useDashboardStore)(selectPanelGroupsLength);
|
|
153
|
+
const swapPanelGroups = (0, _DashboardProvider.useDashboardStore)(selectSwapPanelGroups);
|
|
122
154
|
if (currentIndex < 0) {
|
|
123
155
|
throw new Error(`Could not find panel group with Id ${panelGroupId} in order array`);
|
|
124
156
|
}
|
|
@@ -131,16 +163,16 @@ const selectPanelGroupsLength = (state)=>state.panelGroupOrder.length;
|
|
|
131
163
|
}
|
|
132
164
|
const selectPanelGroupEditor = (state)=>state.panelGroupEditor;
|
|
133
165
|
function usePanelGroupEditor() {
|
|
134
|
-
return (0,
|
|
166
|
+
return (0, _DashboardProvider.useDashboardStore)(selectPanelGroupEditor);
|
|
135
167
|
}
|
|
136
|
-
const selectDeletePanelGroupDialog = ({ deletePanelGroupDialog
|
|
168
|
+
const selectDeletePanelGroupDialog = ({ deletePanelGroupDialog, openDeletePanelGroupDialog, closeDeletePanelGroupDialog, deletePanelGroup })=>({
|
|
137
169
|
deletePanelGroupDialog,
|
|
138
170
|
openDeletePanelGroupDialog,
|
|
139
171
|
closeDeletePanelGroupDialog,
|
|
140
172
|
deletePanelGroup
|
|
141
173
|
});
|
|
142
174
|
function useDeletePanelGroupDialog() {
|
|
143
|
-
const { deletePanelGroupDialog
|
|
175
|
+
const { deletePanelGroupDialog, openDeletePanelGroupDialog, closeDeletePanelGroupDialog, deletePanelGroup } = (0, _DashboardProvider.useDashboardStore)(selectDeletePanelGroupDialog);
|
|
144
176
|
return {
|
|
145
177
|
deletePanelGroupDialog,
|
|
146
178
|
deletePanelGroup,
|
|
@@ -149,10 +181,10 @@ function useDeletePanelGroupDialog() {
|
|
|
149
181
|
};
|
|
150
182
|
}
|
|
151
183
|
function usePanel(panelGroupItemId) {
|
|
152
|
-
const { panelGroupId
|
|
153
|
-
const panel = (0,
|
|
154
|
-
var
|
|
155
|
-
const panelKey = (
|
|
184
|
+
const { panelGroupId, panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;
|
|
185
|
+
const panel = (0, _DashboardProvider.useDashboardStore)((0, _react.useCallback)((store)=>{
|
|
186
|
+
var _store_panelGroups_panelGroupId;
|
|
187
|
+
const panelKey = (_store_panelGroups_panelGroupId = store.panelGroups[panelGroupId]) === null || _store_panelGroups_panelGroupId === void 0 ? void 0 : _store_panelGroups_panelGroupId.itemPanelKeys[panelGroupLayoutId];
|
|
156
188
|
if (panelKey === undefined) return;
|
|
157
189
|
return store.panels[panelKey];
|
|
158
190
|
}, [
|
|
@@ -164,13 +196,13 @@ function usePanel(panelGroupItemId) {
|
|
|
164
196
|
}
|
|
165
197
|
return panel;
|
|
166
198
|
}
|
|
167
|
-
const selectPanelActions = ({ openEditPanel
|
|
199
|
+
const selectPanelActions = ({ openEditPanel, openDeletePanelDialog, duplicatePanel })=>({
|
|
168
200
|
openEditPanel,
|
|
169
201
|
openDeletePanelDialog,
|
|
170
202
|
duplicatePanel
|
|
171
203
|
});
|
|
172
204
|
function usePanelActions(panelGroupItemId) {
|
|
173
|
-
const { openEditPanel
|
|
205
|
+
const { openEditPanel, openDeletePanelDialog, duplicatePanel } = (0, _DashboardProvider.useDashboardStore)(selectPanelActions);
|
|
174
206
|
return {
|
|
175
207
|
openEditPanel: ()=>openEditPanel(panelGroupItemId),
|
|
176
208
|
openDeletePanelDialog: ()=>openDeletePanelDialog(panelGroupItemId),
|
|
@@ -179,42 +211,42 @@ function usePanelActions(panelGroupItemId) {
|
|
|
179
211
|
}
|
|
180
212
|
const selectPanelEditor = (state)=>state.panelEditor;
|
|
181
213
|
function usePanelEditor() {
|
|
182
|
-
return (0,
|
|
214
|
+
return (0, _DashboardProvider.useDashboardStore)(selectPanelEditor);
|
|
183
215
|
}
|
|
184
|
-
const selectDeletePanelDialog = ({ deletePanelDialog
|
|
216
|
+
const selectDeletePanelDialog = ({ deletePanelDialog, deletePanel, closeDeletePanelDialog })=>({
|
|
185
217
|
deletePanelDialog,
|
|
186
218
|
deletePanel,
|
|
187
219
|
closeDeletePanelDialog
|
|
188
220
|
});
|
|
189
221
|
function useDeletePanelDialog() {
|
|
190
222
|
// TODO: Refactor similar to other dialogs/editors so these are on the editor state itself
|
|
191
|
-
return (0,
|
|
223
|
+
return (0, _DashboardProvider.useDashboardStore)(selectDeletePanelDialog);
|
|
192
224
|
}
|
|
193
225
|
const selectDashboardDuration = (state)=>state.duration;
|
|
194
226
|
function useDashboardDuration() {
|
|
195
|
-
return (0,
|
|
227
|
+
return (0, _DashboardProvider.useDashboardStore)(selectDashboardDuration);
|
|
196
228
|
}
|
|
197
|
-
const selectSaveChangesConfirmationDialog = ({ saveChangesConfirmationDialog
|
|
229
|
+
const selectSaveChangesConfirmationDialog = ({ saveChangesConfirmationDialog, openSaveChangesConfirmationDialog, closeSaveChangesConfirmationDialog })=>({
|
|
198
230
|
saveChangesConfirmationDialog,
|
|
199
231
|
openSaveChangesConfirmationDialog,
|
|
200
232
|
closeSaveChangesConfirmationDialog
|
|
201
233
|
});
|
|
202
234
|
function useSaveChangesConfirmationDialog() {
|
|
203
|
-
return (0,
|
|
235
|
+
return (0, _DashboardProvider.useDashboardStore)(selectSaveChangesConfirmationDialog);
|
|
204
236
|
}
|
|
205
|
-
const selectDiscardChangesConfirmationDialog = ({ discardChangesConfirmationDialog
|
|
237
|
+
const selectDiscardChangesConfirmationDialog = ({ discardChangesConfirmationDialog, openDiscardChangesConfirmationDialog, closeDiscardChangesConfirmationDialog })=>({
|
|
206
238
|
discardChangesConfirmationDialog,
|
|
207
239
|
openDiscardChangesConfirmationDialog,
|
|
208
240
|
closeDiscardChangesConfirmationDialog
|
|
209
241
|
});
|
|
210
242
|
function useDiscardChangesConfirmationDialog() {
|
|
211
|
-
return (0,
|
|
243
|
+
return (0, _DashboardProvider.useDashboardStore)(selectDiscardChangesConfirmationDialog);
|
|
212
244
|
}
|
|
213
|
-
const selectEditJsonDialog = ({ editJsonDialog
|
|
245
|
+
const selectEditJsonDialog = ({ editJsonDialog, openEditJsonDialog, closeEditJsonDialog })=>({
|
|
214
246
|
editJsonDialog,
|
|
215
247
|
openEditJsonDialog,
|
|
216
248
|
closeEditJsonDialog
|
|
217
249
|
});
|
|
218
250
|
function useEditJsonDialog() {
|
|
219
|
-
return (0,
|
|
251
|
+
return (0, _DashboardProvider.useDashboardStore)(selectEditJsonDialog);
|
|
220
252
|
}
|
|
@@ -16,11 +16,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "createDeletePanelGroupSlice", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return createDeletePanelGroupSlice;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const createDeletePanelGroupSlice = (set, get)=>({
|
|
22
24
|
deletePanelGroup (panelGroupId) {
|
|
23
|
-
const { panelGroups
|
|
25
|
+
const { panelGroups, panelGroupOrder } = get();
|
|
24
26
|
const group = panelGroups[panelGroupId];
|
|
25
27
|
const idIndex = panelGroupOrder.findIndex((id)=>id === panelGroupId);
|
|
26
28
|
if (group === undefined || idIndex === -1) {
|
|
@@ -16,14 +16,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "createDeletePanelSlice", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return createDeletePanelSlice;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
function createDeletePanelSlice() {
|
|
22
24
|
// Return the state creator function for Zustand that uses the panels provided as intitial state
|
|
23
25
|
return (set, get)=>({
|
|
24
26
|
deletePanel (panelGroupItemId) {
|
|
25
27
|
set((draft)=>{
|
|
26
|
-
const { panelGroupId
|
|
28
|
+
const { panelGroupId, panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;
|
|
27
29
|
const existingGroup = draft.panelGroups[panelGroupId];
|
|
28
30
|
if (existingGroup === undefined) {
|
|
29
31
|
throw new Error(`Missing panel group ${panelGroupId}`);
|
|
@@ -43,8 +45,8 @@ function createDeletePanelSlice() {
|
|
|
43
45
|
});
|
|
44
46
|
},
|
|
45
47
|
openDeletePanelDialog (panelGroupItemId) {
|
|
46
|
-
const { panelGroupId
|
|
47
|
-
const { panels
|
|
48
|
+
const { panelGroupId, panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;
|
|
49
|
+
const { panels, panelGroups } = get();
|
|
48
50
|
const panelGroup = panelGroups[panelGroupId];
|
|
49
51
|
if (panelGroup === undefined) {
|
|
50
52
|
throw new Error(`Panel group not found ${panelGroupId}`);
|
|
@@ -58,11 +60,11 @@ function createDeletePanelSlice() {
|
|
|
58
60
|
throw new Error(`Could not find panel ${panelKey}`);
|
|
59
61
|
}
|
|
60
62
|
set((state)=>{
|
|
61
|
-
var
|
|
63
|
+
var _panelGroup_title;
|
|
62
64
|
state.deletePanelDialog = {
|
|
63
65
|
panelGroupItemId: panelGroupItemId,
|
|
64
66
|
panelName: panel.spec.display.name,
|
|
65
|
-
panelGroupName: (
|
|
67
|
+
panelGroupName: (_panelGroup_title = panelGroup.title) !== null && _panelGroup_title !== void 0 ? _panelGroup_title : ''
|
|
66
68
|
};
|
|
67
69
|
});
|
|
68
70
|
},
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "createDiscardChangesDialogSlice", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return createDiscardChangesDialogSlice;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const createDiscardChangesDialogSlice = (set)=>({
|
|
22
24
|
isOpen: false,
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "createDuplicatePanelSlice", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return createDuplicatePanelSlice;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const _panelUtils = require("../../utils/panelUtils");
|
|
22
24
|
const _common = require("./common");
|
|
@@ -26,7 +28,7 @@ function createDuplicatePanelSlice() {
|
|
|
26
28
|
set((state)=>{
|
|
27
29
|
const panels = state.panels;
|
|
28
30
|
// Figure out the panel key at that location
|
|
29
|
-
const { panelGroupId
|
|
31
|
+
const { panelGroupId, panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;
|
|
30
32
|
const group = state.panelGroups[panelGroupId];
|
|
31
33
|
if (group === undefined) {
|
|
32
34
|
throw new Error(`Missing panel group ${panelGroupId}`);
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "createEditJsonDialogSlice", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return createEditJsonDialogSlice;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const createEditJsonDialogSlice = (set)=>({
|
|
22
24
|
openEditJsonDialog () {
|
|
@@ -14,17 +14,19 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function
|
|
17
|
+
_export_star(require("./common"), exports);
|
|
18
|
+
_export_star(require("./dashboard-provider-api"), exports);
|
|
19
|
+
_export_star(require("./DashboardProvider"), exports);
|
|
20
|
+
function _export_star(from, to) {
|
|
21
21
|
Object.keys(from).forEach(function(k) {
|
|
22
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
23
|
+
Object.defineProperty(to, k, {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function() {
|
|
26
|
+
return from[k];
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
28
30
|
});
|
|
29
31
|
return from;
|
|
30
32
|
}
|
|
@@ -16,22 +16,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "createPanelEditorSlice", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return createPanelEditorSlice;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const _panelUtils = require("../../utils/panelUtils");
|
|
22
24
|
const _common = require("./common");
|
|
23
|
-
const
|
|
25
|
+
const _panelgroupslice = require("./panel-group-slice");
|
|
24
26
|
function createPanelEditorSlice() {
|
|
25
27
|
// Return the state creator function for Zustand that uses the panels provided as intitial state
|
|
26
|
-
return (set, get)=>{
|
|
27
|
-
return {
|
|
28
|
+
return (set, get)=>({
|
|
28
29
|
panelEditor: undefined,
|
|
29
30
|
openEditPanel (panelGroupItemId) {
|
|
30
|
-
var
|
|
31
|
-
const { panels
|
|
31
|
+
var _panelGroups_panelGroupId;
|
|
32
|
+
const { panels, panelGroups } = get();
|
|
32
33
|
// Figure out the panel key at that location
|
|
33
|
-
const { panelGroupId
|
|
34
|
-
const panelKey = (
|
|
34
|
+
const { panelGroupId, panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;
|
|
35
|
+
const panelKey = (_panelGroups_panelGroupId = panelGroups[panelGroupId]) === null || _panelGroups_panelGroupId === void 0 ? void 0 : _panelGroups_panelGroupId.itemPanelKeys[panelGroupLayoutId];
|
|
35
36
|
if (panelKey === undefined) {
|
|
36
37
|
throw new Error(`Could not find Panel Group item ${panelGroupItemId}`);
|
|
37
38
|
}
|
|
@@ -41,7 +42,7 @@ function createPanelEditorSlice() {
|
|
|
41
42
|
throw new Error(`Cannot find Panel with key '${panelKey}'`);
|
|
42
43
|
}
|
|
43
44
|
const editorState = {
|
|
44
|
-
mode: '
|
|
45
|
+
mode: 'update',
|
|
45
46
|
initialValues: {
|
|
46
47
|
groupId: panelGroupItemId.panelGroupId,
|
|
47
48
|
panelDefinition: panelToEdit
|
|
@@ -94,21 +95,21 @@ function createPanelEditorSlice() {
|
|
|
94
95
|
});
|
|
95
96
|
},
|
|
96
97
|
openAddPanel (panelGroupId) {
|
|
97
|
-
var
|
|
98
|
+
var _get_initialValues;
|
|
98
99
|
// If a panel group isn't supplied, add to the first group or create a group if there aren't any
|
|
99
100
|
let newGroup = undefined;
|
|
100
101
|
panelGroupId !== null && panelGroupId !== void 0 ? panelGroupId : panelGroupId = get().panelGroupOrder[0];
|
|
101
102
|
if (panelGroupId === undefined) {
|
|
102
|
-
newGroup = (0,
|
|
103
|
+
newGroup = (0, _panelgroupslice.createEmptyPanelGroup)();
|
|
103
104
|
newGroup.title = 'Panel Group';
|
|
104
105
|
panelGroupId = newGroup.id;
|
|
105
106
|
}
|
|
106
|
-
var
|
|
107
|
+
var _get_initialValues_panelDefinition;
|
|
107
108
|
const editorState = {
|
|
108
|
-
mode: '
|
|
109
|
+
mode: 'create',
|
|
109
110
|
initialValues: {
|
|
110
111
|
groupId: panelGroupId,
|
|
111
|
-
panelDefinition: (
|
|
112
|
+
panelDefinition: (_get_initialValues_panelDefinition = (_get_initialValues = get().initialValues) === null || _get_initialValues === void 0 ? void 0 : _get_initialValues.panelDefinition) !== null && _get_initialValues_panelDefinition !== void 0 ? _get_initialValues_panelDefinition : (0, _common.createPanelDefinition)()
|
|
112
113
|
},
|
|
113
114
|
applyChanges: (next)=>{
|
|
114
115
|
const name = next.panelDefinition.spec.display.name;
|
|
@@ -141,12 +142,11 @@ function createPanelEditorSlice() {
|
|
|
141
142
|
set((state)=>{
|
|
142
143
|
// Add the new panel group if one was created for the panel
|
|
143
144
|
if (newGroup !== undefined) {
|
|
144
|
-
(0,
|
|
145
|
+
(0, _panelgroupslice.addPanelGroup)(state, newGroup);
|
|
145
146
|
}
|
|
146
147
|
// Open the editor with the new state
|
|
147
148
|
state.panelEditor = editorState;
|
|
148
149
|
});
|
|
149
150
|
}
|
|
150
|
-
};
|
|
151
|
-
};
|
|
151
|
+
});
|
|
152
152
|
}
|
|
@@ -16,9 +16,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "createPanelGroupEditorSlice", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return createPanelGroupEditorSlice;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _panelgroupslice = require("./panel-group-slice");
|
|
22
24
|
const createPanelGroupEditorSlice = (set, get)=>({
|
|
23
25
|
panelGroupEditor: undefined,
|
|
24
26
|
openAddPanelGroup: ()=>{
|
|
@@ -30,11 +32,11 @@ const createPanelGroupEditorSlice = (set, get)=>({
|
|
|
30
32
|
isCollapsed: false
|
|
31
33
|
},
|
|
32
34
|
applyChanges (next) {
|
|
33
|
-
const newGroup = (0,
|
|
35
|
+
const newGroup = (0, _panelgroupslice.createEmptyPanelGroup)();
|
|
34
36
|
newGroup.title = next.title;
|
|
35
37
|
newGroup.isCollapsed = next.isCollapsed;
|
|
36
38
|
set((draft)=>{
|
|
37
|
-
(0,
|
|
39
|
+
(0, _panelgroupslice.addPanelGroup)(draft, newGroup);
|
|
38
40
|
});
|
|
39
41
|
},
|
|
40
42
|
close () {
|
|
@@ -53,12 +55,12 @@ const createPanelGroupEditorSlice = (set, get)=>({
|
|
|
53
55
|
if (existingGroup === undefined) {
|
|
54
56
|
throw new Error(`Panel group with Id ${panelGroupId} does not exist`);
|
|
55
57
|
}
|
|
56
|
-
var
|
|
58
|
+
var _existingGroup_title;
|
|
57
59
|
// Create the editor state
|
|
58
60
|
const editor = {
|
|
59
61
|
mode: 'Edit',
|
|
60
62
|
initialValues: {
|
|
61
|
-
title: (
|
|
63
|
+
title: (_existingGroup_title = existingGroup.title) !== null && _existingGroup_title !== void 0 ? _existingGroup_title : '',
|
|
62
64
|
isCollapsed: existingGroup.isCollapsed
|
|
63
65
|
},
|
|
64
66
|
applyChanges (next) {
|
|
@@ -21,15 +21,23 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
addPanelGroup: function() {
|
|
25
|
+
return addPanelGroup;
|
|
26
|
+
},
|
|
27
|
+
convertLayoutsToPanelGroups: function() {
|
|
28
|
+
return convertLayoutsToPanelGroups;
|
|
29
|
+
},
|
|
30
|
+
createEmptyPanelGroup: function() {
|
|
31
|
+
return createEmptyPanelGroup;
|
|
32
|
+
},
|
|
33
|
+
createPanelGroupSlice: function() {
|
|
34
|
+
return createPanelGroupSlice;
|
|
35
|
+
}
|
|
28
36
|
});
|
|
29
37
|
const _core = require("@perses-dev/core");
|
|
30
38
|
const _common = require("./common");
|
|
31
39
|
function createPanelGroupSlice(layouts) {
|
|
32
|
-
const { panelGroups
|
|
40
|
+
const { panelGroups, panelGroupOrder } = convertLayoutsToPanelGroups(layouts);
|
|
33
41
|
// Return the state creator function for Zustand
|
|
34
42
|
return (set)=>({
|
|
35
43
|
panelGroups,
|
|
@@ -67,7 +75,7 @@ function convertLayoutsToPanelGroups(layouts) {
|
|
|
67
75
|
const panelGroups = {};
|
|
68
76
|
const panelGroupIdOrder = [];
|
|
69
77
|
for (const layout of layouts){
|
|
70
|
-
var
|
|
78
|
+
var _layout_spec_display_collapse, _layout_spec_display, _layout_spec_display1;
|
|
71
79
|
const itemLayouts = [];
|
|
72
80
|
const itemPanelKeys = {};
|
|
73
81
|
// Split layout information from panel keys to make it easier to update just layouts on move/resize of panels
|
|
@@ -86,8 +94,8 @@ function convertLayoutsToPanelGroups(layouts) {
|
|
|
86
94
|
const panelGroupId = (0, _common.generateId)();
|
|
87
95
|
panelGroups[panelGroupId] = {
|
|
88
96
|
id: panelGroupId,
|
|
89
|
-
isCollapsed: ((
|
|
90
|
-
title: (
|
|
97
|
+
isCollapsed: ((_layout_spec_display = layout.spec.display) === null || _layout_spec_display === void 0 ? void 0 : (_layout_spec_display_collapse = _layout_spec_display.collapse) === null || _layout_spec_display_collapse === void 0 ? void 0 : _layout_spec_display_collapse.open) === false,
|
|
98
|
+
title: (_layout_spec_display1 = layout.spec.display) === null || _layout_spec_display1 === void 0 ? void 0 : _layout_spec_display1.title,
|
|
91
99
|
itemLayouts,
|
|
92
100
|
itemPanelKeys
|
|
93
101
|
};
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "createPanelSlice", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return createPanelSlice;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
function createPanelSlice(panels) {
|
|
22
24
|
return ()=>({
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "createSaveChangesDialogSlice", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return createSaveChangesDialogSlice;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const createSaveChangesDialogSlice = (set)=>({
|
|
22
24
|
isOpen: false,
|