@perses-dev/dashboards 0.0.0-snapshot-time-range-height-80d08fc
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/LICENSE +201 -0
- package/dist/cjs/components/Dashboard/Dashboard.js +37 -0
- package/dist/cjs/components/Dashboard/index.js +28 -0
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +176 -0
- package/dist/cjs/components/DashboardToolbar/index.js +28 -0
- package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +92 -0
- package/dist/cjs/components/DeletePanelDialog/index.js +28 -0
- package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +88 -0
- package/dist/cjs/components/DeletePanelGroupDialog/index.js +28 -0
- package/dist/cjs/components/DownloadButton/DownloadButton.js +109 -0
- package/dist/cjs/components/DownloadButton/index.js +28 -0
- package/dist/cjs/components/GridLayout/GridContainer.js +219 -0
- package/dist/cjs/components/GridLayout/GridItemContent.js +41 -0
- package/dist/cjs/components/GridLayout/GridLayout.js +104 -0
- package/dist/cjs/components/GridLayout/GridTitle.js +100 -0
- package/dist/cjs/components/GridLayout/index.js +29 -0
- package/dist/cjs/components/Panel/Panel.js +123 -0
- package/dist/cjs/components/Panel/Panel.test.js +129 -0
- package/dist/cjs/components/Panel/PanelContent.js +44 -0
- package/dist/cjs/components/Panel/PanelHeader.js +120 -0
- package/dist/cjs/components/Panel/index.js +28 -0
- package/dist/cjs/components/PanelDrawer/PanelDrawer.js +98 -0
- package/dist/cjs/components/PanelDrawer/PanelDrawer.test.js +131 -0
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +202 -0
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +47 -0
- package/dist/cjs/components/PanelDrawer/index.js +28 -0
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +101 -0
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.test.js +87 -0
- package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +92 -0
- package/dist/cjs/components/PanelGroupDialog/index.js +28 -0
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +136 -0
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.test.js +95 -0
- package/dist/cjs/components/TimeRangeControls/index.js +28 -0
- package/dist/cjs/components/UnsavedChangesConfirmationDialog/UnsavedChangesConfirmationDialog.js +67 -0
- package/dist/cjs/components/UnsavedChangesConfirmationDialog/index.js +28 -0
- package/dist/cjs/components/Variables/Variable.js +194 -0
- package/dist/cjs/components/Variables/VariableEditor.js +276 -0
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +459 -0
- package/dist/cjs/components/Variables/VariableEditorForm/index.js +28 -0
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +89 -0
- package/dist/cjs/components/Variables/VariableList.js +150 -0
- package/dist/cjs/components/Variables/index.js +30 -0
- package/dist/cjs/components/Variables/variable-model.js +117 -0
- package/dist/cjs/components/Variables/variable-model.test.js +106 -0
- package/dist/cjs/components/index.js +39 -0
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +95 -0
- package/dist/cjs/context/DashboardProvider/common.js +28 -0
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +191 -0
- package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +70 -0
- package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +85 -0
- package/dist/cjs/context/DashboardProvider/index.js +29 -0
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +205 -0
- package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +85 -0
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +113 -0
- package/dist/cjs/context/DashboardProvider/panel-slice.js +25 -0
- package/dist/cjs/context/DatasourceStoreProvider.js +170 -0
- package/dist/cjs/context/TemplateVariableProvider/TemplateVariableProvider.js +228 -0
- package/dist/cjs/context/TemplateVariableProvider/index.js +28 -0
- package/dist/cjs/context/TemplateVariableProvider/query-params.js +81 -0
- package/dist/cjs/context/TemplateVariableProvider/query-params.test.js +82 -0
- package/dist/cjs/context/index.js +31 -0
- package/dist/cjs/context/useDashboard.js +94 -0
- package/dist/cjs/index.js +30 -0
- package/dist/cjs/test/dashboard-provider.js +51 -0
- package/dist/cjs/test/index.js +30 -0
- package/dist/cjs/test/plugin-registry.js +42 -0
- package/dist/cjs/test/render.js +62 -0
- package/dist/cjs/test/setup-tests.js +23 -0
- package/dist/cjs/test/testDashboard.js +293 -0
- package/dist/cjs/utils/functions.js +23 -0
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +96 -0
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +68 -0
- package/dist/cjs/views/ViewDashboard/index.js +28 -0
- package/dist/cjs/views/ViewDashboard/tests/panelGroups.test.js +110 -0
- package/dist/cjs/views/index.js +28 -0
- package/dist/components/Dashboard/Dashboard.d.ts +8 -0
- package/dist/components/Dashboard/Dashboard.d.ts.map +1 -0
- package/dist/components/Dashboard/Dashboard.js +33 -0
- package/dist/components/Dashboard/Dashboard.js.map +1 -0
- package/dist/components/Dashboard/index.d.ts +2 -0
- package/dist/components/Dashboard/index.d.ts.map +1 -0
- package/dist/components/Dashboard/index.js +15 -0
- package/dist/components/Dashboard/index.js.map +1 -0
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +11 -0
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -0
- package/dist/components/DashboardToolbar/DashboardToolbar.js +165 -0
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -0
- package/dist/components/DashboardToolbar/index.d.ts +2 -0
- package/dist/components/DashboardToolbar/index.d.ts.map +1 -0
- package/dist/components/DashboardToolbar/index.js +15 -0
- package/dist/components/DashboardToolbar/index.js.map +1 -0
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts +3 -0
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts.map +1 -0
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js +81 -0
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -0
- package/dist/components/DeletePanelDialog/index.d.ts +2 -0
- package/dist/components/DeletePanelDialog/index.d.ts.map +1 -0
- package/dist/components/DeletePanelDialog/index.js +15 -0
- package/dist/components/DeletePanelDialog/index.js.map +1 -0
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts +3 -0
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -0
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +77 -0
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -0
- package/dist/components/DeletePanelGroupDialog/index.d.ts +2 -0
- package/dist/components/DeletePanelGroupDialog/index.d.ts.map +1 -0
- package/dist/components/DeletePanelGroupDialog/index.js +15 -0
- package/dist/components/DeletePanelGroupDialog/index.js.map +1 -0
- package/dist/components/DownloadButton/DownloadButton.d.ts +3 -0
- package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -0
- package/dist/components/DownloadButton/DownloadButton.js +60 -0
- package/dist/components/DownloadButton/DownloadButton.js.map +1 -0
- package/dist/components/DownloadButton/index.d.ts +2 -0
- package/dist/components/DownloadButton/index.d.ts.map +1 -0
- package/dist/components/DownloadButton/index.js +15 -0
- package/dist/components/DownloadButton/index.js.map +1 -0
- package/dist/components/GridLayout/GridContainer.d.ts +6 -0
- package/dist/components/GridLayout/GridContainer.d.ts.map +1 -0
- package/dist/components/GridLayout/GridContainer.js +213 -0
- package/dist/components/GridLayout/GridContainer.js.map +1 -0
- package/dist/components/GridLayout/GridItemContent.d.ts +10 -0
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -0
- package/dist/components/GridLayout/GridItemContent.js +37 -0
- package/dist/components/GridLayout/GridItemContent.js.map +1 -0
- package/dist/components/GridLayout/GridLayout.d.ts +10 -0
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -0
- package/dist/components/GridLayout/GridLayout.js +100 -0
- package/dist/components/GridLayout/GridLayout.js.map +1 -0
- package/dist/components/GridLayout/GridTitle.d.ts +16 -0
- package/dist/components/GridLayout/GridTitle.d.ts.map +1 -0
- package/dist/components/GridLayout/GridTitle.js +92 -0
- package/dist/components/GridLayout/GridTitle.js.map +1 -0
- package/dist/components/GridLayout/index.d.ts +3 -0
- package/dist/components/GridLayout/index.d.ts.map +1 -0
- package/dist/components/GridLayout/index.js +16 -0
- package/dist/components/GridLayout/index.js.map +1 -0
- package/dist/components/Panel/Panel.d.ts +13 -0
- package/dist/components/Panel/Panel.d.ts.map +1 -0
- package/dist/components/Panel/Panel.js +114 -0
- package/dist/components/Panel/Panel.js.map +1 -0
- package/dist/components/Panel/Panel.test.d.ts +2 -0
- package/dist/components/Panel/Panel.test.d.ts.map +1 -0
- package/dist/components/Panel/Panel.test.js +122 -0
- package/dist/components/Panel/Panel.test.js.map +1 -0
- package/dist/components/Panel/PanelContent.d.ts +12 -0
- package/dist/components/Panel/PanelContent.d.ts.map +1 -0
- package/dist/components/Panel/PanelContent.js +41 -0
- package/dist/components/Panel/PanelContent.js.map +1 -0
- package/dist/components/Panel/PanelHeader.d.ts +16 -0
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -0
- package/dist/components/Panel/PanelHeader.js +109 -0
- package/dist/components/Panel/PanelHeader.js.map +1 -0
- package/dist/components/Panel/index.d.ts +2 -0
- package/dist/components/Panel/index.d.ts.map +1 -0
- package/dist/components/Panel/index.js +15 -0
- package/dist/components/Panel/index.js.map +1 -0
- package/dist/components/PanelDrawer/PanelDrawer.d.ts +6 -0
- package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -0
- package/dist/components/PanelDrawer/PanelDrawer.js +94 -0
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -0
- package/dist/components/PanelDrawer/PanelDrawer.test.d.ts +2 -0
- package/dist/components/PanelDrawer/PanelDrawer.test.d.ts.map +1 -0
- package/dist/components/PanelDrawer/PanelDrawer.test.js +124 -0
- package/dist/components/PanelDrawer/PanelDrawer.test.js.map +1 -0
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts +12 -0
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -0
- package/dist/components/PanelDrawer/PanelEditorForm.js +192 -0
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -0
- package/dist/components/PanelDrawer/PanelPreview.d.ts +4 -0
- package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -0
- package/dist/components/PanelDrawer/PanelPreview.js +41 -0
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -0
- package/dist/components/PanelDrawer/index.d.ts +2 -0
- package/dist/components/PanelDrawer/index.d.ts.map +1 -0
- package/dist/components/PanelDrawer/index.js +15 -0
- package/dist/components/PanelDrawer/index.js.map +1 -0
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts +6 -0
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -0
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js +92 -0
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -0
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.d.ts +2 -0
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.d.ts.map +1 -0
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js +80 -0
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js.map +1 -0
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts +12 -0
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts.map +1 -0
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js +82 -0
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -0
- package/dist/components/PanelGroupDialog/index.d.ts +2 -0
- package/dist/components/PanelGroupDialog/index.d.ts.map +1 -0
- package/dist/components/PanelGroupDialog/index.js +15 -0
- package/dist/components/PanelGroupDialog/index.js.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +9 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.js +119 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.test.d.ts +2 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.test.d.ts.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.test.js +88 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.test.js.map +1 -0
- package/dist/components/TimeRangeControls/index.d.ts +2 -0
- package/dist/components/TimeRangeControls/index.d.ts.map +1 -0
- package/dist/components/TimeRangeControls/index.js +15 -0
- package/dist/components/TimeRangeControls/index.js.map +1 -0
- package/dist/components/UnsavedChangesConfirmationDialog/UnsavedChangesConfirmationDialog.d.ts +8 -0
- package/dist/components/UnsavedChangesConfirmationDialog/UnsavedChangesConfirmationDialog.d.ts.map +1 -0
- package/dist/components/UnsavedChangesConfirmationDialog/UnsavedChangesConfirmationDialog.js +56 -0
- package/dist/components/UnsavedChangesConfirmationDialog/UnsavedChangesConfirmationDialog.js.map +1 -0
- package/dist/components/UnsavedChangesConfirmationDialog/index.d.ts +2 -0
- package/dist/components/UnsavedChangesConfirmationDialog/index.d.ts.map +1 -0
- package/dist/components/UnsavedChangesConfirmationDialog/index.js +15 -0
- package/dist/components/UnsavedChangesConfirmationDialog/index.js.map +1 -0
- package/dist/components/Variables/Variable.d.ts +8 -0
- package/dist/components/Variables/Variable.d.ts.map +1 -0
- package/dist/components/Variables/Variable.js +188 -0
- package/dist/components/Variables/Variable.js.map +1 -0
- package/dist/components/Variables/VariableEditor.d.ts +8 -0
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -0
- package/dist/components/Variables/VariableEditor.js +265 -0
- package/dist/components/Variables/VariableEditor.js.map +1 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +8 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +409 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -0
- package/dist/components/Variables/VariableEditorForm/index.d.ts +2 -0
- package/dist/components/Variables/VariableEditorForm/index.d.ts.map +1 -0
- package/dist/components/Variables/VariableEditorForm/index.js +15 -0
- package/dist/components/Variables/VariableEditorForm/index.js.map +1 -0
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +22 -0
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -0
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +77 -0
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -0
- package/dist/components/Variables/VariableList.d.ts +9 -0
- package/dist/components/Variables/VariableList.d.ts.map +1 -0
- package/dist/components/Variables/VariableList.js +100 -0
- package/dist/components/Variables/VariableList.js.map +1 -0
- package/dist/components/Variables/index.d.ts +4 -0
- package/dist/components/Variables/index.d.ts.map +1 -0
- package/dist/components/Variables/index.js +17 -0
- package/dist/components/Variables/index.js.map +1 -0
- package/dist/components/Variables/variable-model.d.ts +16 -0
- package/dist/components/Variables/variable-model.d.ts.map +1 -0
- package/dist/components/Variables/variable-model.js +105 -0
- package/dist/components/Variables/variable-model.js.map +1 -0
- package/dist/components/Variables/variable-model.test.d.ts +2 -0
- package/dist/components/Variables/variable-model.test.d.ts.map +1 -0
- package/dist/components/Variables/variable-model.test.js +104 -0
- package/dist/components/Variables/variable-model.test.js.map +1 -0
- package/dist/components/index.d.ts +13 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +26 -0
- package/dist/components/index.js.map +1 -0
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +28 -0
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -0
- package/dist/context/DashboardProvider/DashboardProvider.js +77 -0
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -0
- package/dist/context/DashboardProvider/common.d.ts +12 -0
- package/dist/context/DashboardProvider/common.d.ts.map +1 -0
- package/dist/context/DashboardProvider/common.js +24 -0
- package/dist/context/DashboardProvider/common.js.map +1 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +74 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.js +190 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -0
- package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts +23 -0
- package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/delete-panel-group-slice.js +64 -0
- package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -0
- package/dist/context/DashboardProvider/delete-panel-slice.d.ts +36 -0
- package/dist/context/DashboardProvider/delete-panel-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/delete-panel-slice.js +81 -0
- package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -0
- package/dist/context/DashboardProvider/index.d.ts +7 -0
- package/dist/context/DashboardProvider/index.d.ts.map +1 -0
- package/dist/context/DashboardProvider/index.js +16 -0
- package/dist/context/DashboardProvider/index.js.map +1 -0
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts +56 -0
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/panel-editor-slice.js +201 -0
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -0
- package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts +33 -0
- package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/panel-group-editor-slice.js +79 -0
- package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -0
- package/dist/context/DashboardProvider/panel-group-slice.d.ts +59 -0
- package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/panel-group-slice.js +105 -0
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -0
- package/dist/context/DashboardProvider/panel-slice.d.ts +14 -0
- package/dist/context/DashboardProvider/panel-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/panel-slice.js +21 -0
- package/dist/context/DashboardProvider/panel-slice.js.map +1 -0
- package/dist/context/DatasourceStoreProvider.d.ts +24 -0
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -0
- package/dist/context/DatasourceStoreProvider.js +166 -0
- package/dist/context/DatasourceStoreProvider.js.map +1 -0
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +30 -0
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +1 -0
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +212 -0
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +1 -0
- package/dist/context/TemplateVariableProvider/index.d.ts +2 -0
- package/dist/context/TemplateVariableProvider/index.d.ts.map +1 -0
- package/dist/context/TemplateVariableProvider/index.js +15 -0
- package/dist/context/TemplateVariableProvider/index.js.map +1 -0
- package/dist/context/TemplateVariableProvider/query-params.d.ts +12 -0
- package/dist/context/TemplateVariableProvider/query-params.d.ts.map +1 -0
- package/dist/context/TemplateVariableProvider/query-params.js +66 -0
- package/dist/context/TemplateVariableProvider/query-params.js.map +1 -0
- package/dist/context/TemplateVariableProvider/query-params.test.d.ts +2 -0
- package/dist/context/TemplateVariableProvider/query-params.test.d.ts.map +1 -0
- package/dist/context/TemplateVariableProvider/query-params.test.js +80 -0
- package/dist/context/TemplateVariableProvider/query-params.test.js.map +1 -0
- package/dist/context/index.d.ts +5 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +18 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/useDashboard.d.ts +6 -0
- package/dist/context/useDashboard.d.ts.map +1 -0
- package/dist/context/useDashboard.js +88 -0
- package/dist/context/useDashboard.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/test/dashboard-provider.d.ts +19 -0
- package/dist/test/dashboard-provider.d.ts.map +1 -0
- package/dist/test/dashboard-provider.js +40 -0
- package/dist/test/dashboard-provider.js.map +1 -0
- package/dist/test/index.d.ts +4 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +17 -0
- package/dist/test/index.js.map +1 -0
- package/dist/test/plugin-registry.d.ts +3 -0
- package/dist/test/plugin-registry.d.ts.map +1 -0
- package/dist/test/plugin-registry.js +37 -0
- package/dist/test/plugin-registry.js.map +1 -0
- package/dist/test/render.d.ts +8 -0
- package/dist/test/render.d.ts.map +1 -0
- package/dist/test/render.js +58 -0
- package/dist/test/render.js.map +1 -0
- package/dist/test/setup-tests.d.ts +2 -0
- package/dist/test/setup-tests.d.ts.map +1 -0
- package/dist/test/setup-tests.js +22 -0
- package/dist/test/setup-tests.js.map +1 -0
- package/dist/test/testDashboard.d.ts +4 -0
- package/dist/test/testDashboard.d.ts.map +1 -0
- package/dist/test/testDashboard.js +287 -0
- package/dist/test/testDashboard.js.map +1 -0
- package/dist/utils/functions.d.ts +2 -0
- package/dist/utils/functions.d.ts.map +1 -0
- package/dist/utils/functions.js +17 -0
- package/dist/utils/functions.js.map +1 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts +10 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -0
- package/dist/views/ViewDashboard/DashboardApp.js +90 -0
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -0
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +16 -0
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -0
- package/dist/views/ViewDashboard/ViewDashboard.js +64 -0
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -0
- package/dist/views/ViewDashboard/index.d.ts +2 -0
- package/dist/views/ViewDashboard/index.d.ts.map +1 -0
- package/dist/views/ViewDashboard/index.js +15 -0
- package/dist/views/ViewDashboard/index.js.map +1 -0
- package/dist/views/ViewDashboard/tests/panelGroups.test.d.ts +2 -0
- package/dist/views/ViewDashboard/tests/panelGroups.test.d.ts.map +1 -0
- package/dist/views/ViewDashboard/tests/panelGroups.test.js +103 -0
- package/dist/views/ViewDashboard/tests/panelGroups.test.js.map +1 -0
- package/dist/views/index.d.ts +2 -0
- package/dist/views/index.d.ts.map +1 -0
- package/dist/views/index.js +15 -0
- package/dist/views/index.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
// Copyright 2022 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, "VariableEditForm", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: ()=>VariableEditForm
|
|
20
|
+
});
|
|
21
|
+
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
23
|
+
const _material = require("@mui/material");
|
|
24
|
+
const _useImmer = require("use-immer");
|
|
25
|
+
const _pluginSystem = require("@perses-dev/plugin-system");
|
|
26
|
+
const _components = require("@perses-dev/components");
|
|
27
|
+
const _refresh = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/Refresh"));
|
|
28
|
+
const _clipboardOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/ClipboardOutline"));
|
|
29
|
+
const _variableModel = require("../variable-model");
|
|
30
|
+
const _variableEditorFormModel = require("./variable-editor-form-model");
|
|
31
|
+
function _interopRequireDefault(obj) {
|
|
32
|
+
return obj && obj.__esModule ? obj : {
|
|
33
|
+
default: obj
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
37
|
+
if (typeof WeakMap !== "function") return null;
|
|
38
|
+
var cacheBabelInterop = new WeakMap();
|
|
39
|
+
var cacheNodeInterop = new WeakMap();
|
|
40
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
41
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
42
|
+
})(nodeInterop);
|
|
43
|
+
}
|
|
44
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
45
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
46
|
+
return obj;
|
|
47
|
+
}
|
|
48
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
49
|
+
return {
|
|
50
|
+
default: obj
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
54
|
+
if (cache && cache.has(obj)) {
|
|
55
|
+
return cache.get(obj);
|
|
56
|
+
}
|
|
57
|
+
var newObj = {};
|
|
58
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
59
|
+
for(var key in obj){
|
|
60
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
61
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
62
|
+
if (desc && (desc.get || desc.set)) {
|
|
63
|
+
Object.defineProperty(newObj, key, desc);
|
|
64
|
+
} else {
|
|
65
|
+
newObj[key] = obj[key];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
newObj.default = obj;
|
|
70
|
+
if (cache) {
|
|
71
|
+
cache.set(obj, newObj);
|
|
72
|
+
}
|
|
73
|
+
return newObj;
|
|
74
|
+
}
|
|
75
|
+
const DEFAULT_MAX_PREVIEW_VALUES = 50;
|
|
76
|
+
// TODO: Replace with proper validation library
|
|
77
|
+
function getValidation(state) {
|
|
78
|
+
/** Name validation */ let name = null;
|
|
79
|
+
if (!state.name) {
|
|
80
|
+
name = 'Name is required';
|
|
81
|
+
}
|
|
82
|
+
// name can only contain alphanumeric characters and underscores and no spaces
|
|
83
|
+
if (state.name && !/^[a-zA-Z0-9_-]+$/.test(state.name)) {
|
|
84
|
+
name = 'Name can only contain alphanumeric characters, underscores, and dashes';
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
name,
|
|
88
|
+
isValid: !name
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
const SectionHeader = ({ children })=>/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Typography, {
|
|
92
|
+
pb: 2,
|
|
93
|
+
variant: "subtitle1",
|
|
94
|
+
children: children
|
|
95
|
+
});
|
|
96
|
+
function VariableListPreview({ definition , onRefresh }) {
|
|
97
|
+
const { data , isFetching , error } = (0, _variableModel.useListVariablePluginValues)(definition);
|
|
98
|
+
const [maxValues, setMaxValues] = (0, _react.useState)(DEFAULT_MAX_PREVIEW_VALUES);
|
|
99
|
+
const showAll = ()=>{
|
|
100
|
+
setMaxValues(undefined);
|
|
101
|
+
};
|
|
102
|
+
let notShown = 0;
|
|
103
|
+
if (data && (data === null || data === void 0 ? void 0 : data.length) > 0 && maxValues) {
|
|
104
|
+
notShown = data.length - maxValues;
|
|
105
|
+
}
|
|
106
|
+
const errorMessage = error === null || error === void 0 ? void 0 : error.message;
|
|
107
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
108
|
+
children: [
|
|
109
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
110
|
+
direction: 'row',
|
|
111
|
+
spacing: 1,
|
|
112
|
+
alignItems: "center",
|
|
113
|
+
children: [
|
|
114
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Typography, {
|
|
115
|
+
variant: "caption",
|
|
116
|
+
children: "Preview Values"
|
|
117
|
+
}),
|
|
118
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
119
|
+
title: "Refresh Values",
|
|
120
|
+
placement: "right",
|
|
121
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
122
|
+
onClick: onRefresh,
|
|
123
|
+
size: "small",
|
|
124
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_refresh.default, {})
|
|
125
|
+
})
|
|
126
|
+
}),
|
|
127
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
128
|
+
title: "Copy Values to Clipboard",
|
|
129
|
+
placement: "right",
|
|
130
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
131
|
+
onClick: async ()=>{
|
|
132
|
+
if (data === null || data === void 0 ? void 0 : data.length) {
|
|
133
|
+
await navigator.clipboard.writeText(data.map((d)=>d.label).join(','));
|
|
134
|
+
alert('Copied to clipboard!');
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
size: "small",
|
|
138
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_clipboardOutline.default, {})
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
]
|
|
142
|
+
}),
|
|
143
|
+
errorMessage && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Alert, {
|
|
144
|
+
severity: "error",
|
|
145
|
+
children: errorMessage
|
|
146
|
+
}),
|
|
147
|
+
isFetching && 'Loading...',
|
|
148
|
+
(data === null || data === void 0 ? void 0 : data.length) === 0 && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Alert, {
|
|
149
|
+
severity: "info",
|
|
150
|
+
children: "No results"
|
|
151
|
+
}),
|
|
152
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
153
|
+
children: [
|
|
154
|
+
data === null || data === void 0 ? void 0 : data.slice(0, maxValues).map((val)=>/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Chip, {
|
|
155
|
+
sx: {
|
|
156
|
+
mr: 1,
|
|
157
|
+
mb: 1
|
|
158
|
+
},
|
|
159
|
+
size: "small",
|
|
160
|
+
label: val.label
|
|
161
|
+
}, val.value)),
|
|
162
|
+
notShown > 0 && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Chip, {
|
|
163
|
+
onClick: showAll,
|
|
164
|
+
variant: "outlined",
|
|
165
|
+
sx: {
|
|
166
|
+
mr: 1,
|
|
167
|
+
mb: 1
|
|
168
|
+
},
|
|
169
|
+
size: "small",
|
|
170
|
+
label: `+${notShown} more`
|
|
171
|
+
})
|
|
172
|
+
]
|
|
173
|
+
})
|
|
174
|
+
]
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
function VariableEditForm({ initialVariableDefinition , onChange , onCancel }) {
|
|
178
|
+
const [state, setState] = (0, _useImmer.useImmer)((0, _variableEditorFormModel.getInitialState)(initialVariableDefinition));
|
|
179
|
+
const validation = (0, _react.useMemo)(()=>getValidation(state), [
|
|
180
|
+
state
|
|
181
|
+
]);
|
|
182
|
+
const [previewKey, setPreviewKey] = _react.default.useState(0);
|
|
183
|
+
const refreshPreview = ()=>{
|
|
184
|
+
setPreviewKey((prev)=>prev + 1);
|
|
185
|
+
};
|
|
186
|
+
/** We use the `previewKey` that we increment to know when to explicity update the
|
|
187
|
+
* spec that will be used for preview. The reason why we do this is to avoid
|
|
188
|
+
* having to re-fetch the values when the user is still editing the spec.
|
|
189
|
+
*/ const previewSpec = (0, _react.useMemo)(()=>{
|
|
190
|
+
return (0, _variableEditorFormModel.getVariableDefinitionFromState)(state);
|
|
191
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
192
|
+
}, [
|
|
193
|
+
previewKey
|
|
194
|
+
]);
|
|
195
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
196
|
+
children: [
|
|
197
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
198
|
+
sx: {
|
|
199
|
+
display: 'flex',
|
|
200
|
+
alignItems: 'center',
|
|
201
|
+
padding: (theme)=>theme.spacing(1, 2),
|
|
202
|
+
borderBottom: (theme)=>`1px solid ${theme.palette.divider}`
|
|
203
|
+
},
|
|
204
|
+
children: [
|
|
205
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Typography, {
|
|
206
|
+
variant: "h2",
|
|
207
|
+
children: "Edit Variable"
|
|
208
|
+
}),
|
|
209
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
210
|
+
direction: "row",
|
|
211
|
+
spacing: 1,
|
|
212
|
+
sx: {
|
|
213
|
+
marginLeft: 'auto'
|
|
214
|
+
},
|
|
215
|
+
children: [
|
|
216
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
|
|
217
|
+
disabled: !validation.isValid,
|
|
218
|
+
variant: "contained",
|
|
219
|
+
onClick: ()=>{
|
|
220
|
+
onChange((0, _variableEditorFormModel.getVariableDefinitionFromState)(state));
|
|
221
|
+
},
|
|
222
|
+
children: "Update"
|
|
223
|
+
}),
|
|
224
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
|
|
225
|
+
color: "secondary",
|
|
226
|
+
variant: "outlined",
|
|
227
|
+
onClick: ()=>{
|
|
228
|
+
onCancel();
|
|
229
|
+
},
|
|
230
|
+
children: "Cancel"
|
|
231
|
+
})
|
|
232
|
+
]
|
|
233
|
+
})
|
|
234
|
+
]
|
|
235
|
+
}),
|
|
236
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
237
|
+
padding: 2,
|
|
238
|
+
sx: {
|
|
239
|
+
overflowY: 'scroll'
|
|
240
|
+
},
|
|
241
|
+
children: [
|
|
242
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(SectionHeader, {
|
|
243
|
+
children: "General"
|
|
244
|
+
}),
|
|
245
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
246
|
+
container: true,
|
|
247
|
+
spacing: 2,
|
|
248
|
+
mb: 2,
|
|
249
|
+
children: [
|
|
250
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Grid, {
|
|
251
|
+
item: true,
|
|
252
|
+
xs: 6,
|
|
253
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.TextField, {
|
|
254
|
+
required: true,
|
|
255
|
+
error: !!validation.name,
|
|
256
|
+
fullWidth: true,
|
|
257
|
+
label: "Name",
|
|
258
|
+
value: state.name,
|
|
259
|
+
helperText: validation.name,
|
|
260
|
+
onChange: (v)=>{
|
|
261
|
+
setState((draft)=>{
|
|
262
|
+
draft.name = v.target.value;
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
})
|
|
266
|
+
}),
|
|
267
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Grid, {
|
|
268
|
+
item: true,
|
|
269
|
+
xs: 6,
|
|
270
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.FormControl, {
|
|
271
|
+
fullWidth: true,
|
|
272
|
+
children: [
|
|
273
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.InputLabel, {
|
|
274
|
+
id: "variable-type-select-label",
|
|
275
|
+
children: "Type"
|
|
276
|
+
}),
|
|
277
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Select, {
|
|
278
|
+
labelId: "variable-type-select-label",
|
|
279
|
+
id: "variable-type-select",
|
|
280
|
+
label: "Type",
|
|
281
|
+
value: state.kind,
|
|
282
|
+
onChange: (v)=>{
|
|
283
|
+
setState((draft)=>{
|
|
284
|
+
draft.kind = v.target.value;
|
|
285
|
+
});
|
|
286
|
+
},
|
|
287
|
+
children: _variableModel.VARIABLE_TYPES.map((v)=>/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.MenuItem, {
|
|
288
|
+
value: v.kind,
|
|
289
|
+
children: v.label
|
|
290
|
+
}, v.kind))
|
|
291
|
+
})
|
|
292
|
+
]
|
|
293
|
+
})
|
|
294
|
+
}),
|
|
295
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Grid, {
|
|
296
|
+
item: true,
|
|
297
|
+
xs: 6,
|
|
298
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.TextField, {
|
|
299
|
+
fullWidth: true,
|
|
300
|
+
label: "Display Label",
|
|
301
|
+
value: state.title,
|
|
302
|
+
onChange: (v)=>{
|
|
303
|
+
setState((draft)=>{
|
|
304
|
+
draft.title = v.target.value;
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
})
|
|
308
|
+
}),
|
|
309
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Grid, {
|
|
310
|
+
item: true,
|
|
311
|
+
xs: 12,
|
|
312
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.TextField, {
|
|
313
|
+
fullWidth: true,
|
|
314
|
+
label: "Description",
|
|
315
|
+
value: state.description,
|
|
316
|
+
onChange: (v)=>{
|
|
317
|
+
setState((draft)=>{
|
|
318
|
+
draft.description = v.target.value;
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
})
|
|
322
|
+
})
|
|
323
|
+
]
|
|
324
|
+
}),
|
|
325
|
+
state.kind === 'TextVariable' && /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
326
|
+
children: [
|
|
327
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(SectionHeader, {
|
|
328
|
+
children: "Text Options"
|
|
329
|
+
}),
|
|
330
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Grid, {
|
|
331
|
+
container: true,
|
|
332
|
+
spacing: 2,
|
|
333
|
+
mb: 2,
|
|
334
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Grid, {
|
|
335
|
+
item: true,
|
|
336
|
+
xs: 12,
|
|
337
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.TextField, {
|
|
338
|
+
label: "Value",
|
|
339
|
+
value: state.textVariableFields.value,
|
|
340
|
+
onChange: (v)=>{
|
|
341
|
+
setState((draft)=>{
|
|
342
|
+
draft.textVariableFields.value = v.target.value;
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
})
|
|
346
|
+
})
|
|
347
|
+
})
|
|
348
|
+
]
|
|
349
|
+
}),
|
|
350
|
+
state.kind === 'ListVariable' && /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
351
|
+
children: [
|
|
352
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(SectionHeader, {
|
|
353
|
+
children: "List Options"
|
|
354
|
+
}),
|
|
355
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
356
|
+
container: true,
|
|
357
|
+
spacing: 2,
|
|
358
|
+
mb: 2,
|
|
359
|
+
children: [
|
|
360
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
361
|
+
item: true,
|
|
362
|
+
xs: 6,
|
|
363
|
+
children: [
|
|
364
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.ClickAwayListener, {
|
|
365
|
+
onClickAway: ()=>refreshPreview(),
|
|
366
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {})
|
|
367
|
+
}),
|
|
368
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_pluginSystem.PluginEditor, {
|
|
369
|
+
width: 500,
|
|
370
|
+
pluginType: "Variable",
|
|
371
|
+
pluginKindLabel: "Source",
|
|
372
|
+
value: state.listVariableFields.plugin,
|
|
373
|
+
onChange: (val)=>{
|
|
374
|
+
setState((draft)=>{
|
|
375
|
+
draft.listVariableFields.plugin = val;
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
})
|
|
379
|
+
]
|
|
380
|
+
}),
|
|
381
|
+
state.listVariableFields.plugin.kind && /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
382
|
+
item: true,
|
|
383
|
+
xs: 12,
|
|
384
|
+
children: [
|
|
385
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.TextField, {
|
|
386
|
+
sx: {
|
|
387
|
+
mb: 1
|
|
388
|
+
},
|
|
389
|
+
label: "Capturing Regexp Filter",
|
|
390
|
+
value: state.listVariableFields.capturing_regexp,
|
|
391
|
+
onChange: (e)=>{
|
|
392
|
+
setState((draft)=>{
|
|
393
|
+
draft.listVariableFields.capturing_regexp = e.target.value;
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
}),
|
|
397
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.ErrorBoundary, {
|
|
398
|
+
FallbackComponent: ()=>/*#__PURE__*/ (0, _jsxRuntime.jsx)("div", {
|
|
399
|
+
children: "Error previewing values"
|
|
400
|
+
}),
|
|
401
|
+
resetKeys: [
|
|
402
|
+
previewSpec
|
|
403
|
+
],
|
|
404
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(VariableListPreview, {
|
|
405
|
+
onRefresh: refreshPreview,
|
|
406
|
+
definition: previewSpec
|
|
407
|
+
})
|
|
408
|
+
})
|
|
409
|
+
]
|
|
410
|
+
})
|
|
411
|
+
]
|
|
412
|
+
}),
|
|
413
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(SectionHeader, {
|
|
414
|
+
children: "Dropdown Options"
|
|
415
|
+
}),
|
|
416
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
417
|
+
container: true,
|
|
418
|
+
spacing: 1,
|
|
419
|
+
mb: 1,
|
|
420
|
+
children: [
|
|
421
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
422
|
+
item: true,
|
|
423
|
+
xs: 12,
|
|
424
|
+
children: [
|
|
425
|
+
"Allow Multiple",
|
|
426
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Switch, {
|
|
427
|
+
checked: state.listVariableFields.allowMultiple,
|
|
428
|
+
onChange: (e)=>{
|
|
429
|
+
setState((draft)=>{
|
|
430
|
+
draft.listVariableFields.allowMultiple = e.target.checked;
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
})
|
|
434
|
+
]
|
|
435
|
+
}),
|
|
436
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
437
|
+
item: true,
|
|
438
|
+
xs: 12,
|
|
439
|
+
children: [
|
|
440
|
+
"Allow All",
|
|
441
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Switch, {
|
|
442
|
+
checked: state.listVariableFields.allowAll,
|
|
443
|
+
onChange: (e)=>{
|
|
444
|
+
setState((draft)=>{
|
|
445
|
+
draft.listVariableFields.allowAll = e.target.checked;
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
})
|
|
449
|
+
]
|
|
450
|
+
})
|
|
451
|
+
]
|
|
452
|
+
})
|
|
453
|
+
]
|
|
454
|
+
})
|
|
455
|
+
]
|
|
456
|
+
})
|
|
457
|
+
]
|
|
458
|
+
});
|
|
459
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright 2022 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
|
+
_exportStar(require("./VariableEditorForm"), exports);
|
|
18
|
+
function _exportStar(from, to) {
|
|
19
|
+
Object.keys(from).forEach(function(k) {
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function() {
|
|
23
|
+
return from[k];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
return from;
|
|
28
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// Copyright 2022 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
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
getInitialState: ()=>getInitialState,
|
|
25
|
+
getVariableDefinitionFromState: ()=>getVariableDefinitionFromState
|
|
26
|
+
});
|
|
27
|
+
function getInitialState(initialVariableDefinition) {
|
|
28
|
+
var ref;
|
|
29
|
+
var _value;
|
|
30
|
+
const textVariableFields = {
|
|
31
|
+
value: (_value = initialVariableDefinition.spec.value) !== null && _value !== void 0 ? _value : ''
|
|
32
|
+
};
|
|
33
|
+
const listVariableFields = {
|
|
34
|
+
allowMultiple: false,
|
|
35
|
+
allowAll: false,
|
|
36
|
+
capturing_regexp: undefined,
|
|
37
|
+
plugin: {
|
|
38
|
+
kind: '',
|
|
39
|
+
spec: {}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
if (initialVariableDefinition.kind === 'ListVariable') {
|
|
43
|
+
var _allow_all_value;
|
|
44
|
+
listVariableFields.allowMultiple = (_allow_all_value = initialVariableDefinition.spec.allow_all_value) !== null && _allow_all_value !== void 0 ? _allow_all_value : false;
|
|
45
|
+
var _allow_all_value1;
|
|
46
|
+
listVariableFields.allowAll = (_allow_all_value1 = initialVariableDefinition.spec.allow_all_value) !== null && _allow_all_value1 !== void 0 ? _allow_all_value1 : false;
|
|
47
|
+
listVariableFields.capturing_regexp = initialVariableDefinition.spec.capturing_regexp;
|
|
48
|
+
listVariableFields.plugin = initialVariableDefinition.spec.plugin;
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
name: initialVariableDefinition.spec.name,
|
|
52
|
+
title: (ref = initialVariableDefinition.spec.display) === null || ref === void 0 ? void 0 : ref.name,
|
|
53
|
+
kind: initialVariableDefinition.kind,
|
|
54
|
+
description: '',
|
|
55
|
+
listVariableFields,
|
|
56
|
+
textVariableFields
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function getVariableDefinitionFromState(state) {
|
|
60
|
+
const { name , title , kind } = state;
|
|
61
|
+
const commonSpec = {
|
|
62
|
+
name,
|
|
63
|
+
display: {
|
|
64
|
+
name: title
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
if (kind === 'TextVariable') {
|
|
68
|
+
return {
|
|
69
|
+
kind,
|
|
70
|
+
spec: {
|
|
71
|
+
...commonSpec,
|
|
72
|
+
...state.textVariableFields
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
if (kind === 'ListVariable') {
|
|
77
|
+
return {
|
|
78
|
+
kind,
|
|
79
|
+
spec: {
|
|
80
|
+
...commonSpec,
|
|
81
|
+
allow_multiple: state.listVariableFields.allowMultiple,
|
|
82
|
+
allow_all_value: state.listVariableFields.allowAll,
|
|
83
|
+
capturing_regexp: state.listVariableFields.capturing_regexp,
|
|
84
|
+
plugin: state.listVariableFields.plugin
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
throw new Error(`Unknown variable kind: ${kind}`);
|
|
89
|
+
}
|