@perses-dev/plugin-system 0.55.0-beta.1 → 0.55.0-beta.3
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/Annotations/AnnotationEditorForm/AnnotationEditorForm.js +4 -4
- package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationPreview.js +1 -1
- package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +3 -2
- package/dist/cjs/components/DatasourceSelect/DatasourceSelect.js +1 -1
- package/dist/cjs/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js +53 -0
- package/dist/cjs/components/DatasourceTestConnectionButton/index.js +30 -0
- package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +49 -24
- package/dist/cjs/components/LayoutEditor/LayoutEditor.js +123 -0
- package/dist/cjs/components/LayoutEditor/RepeatLayoutPreview.js +105 -0
- package/dist/cjs/components/LayoutEditor/RepeatVariableEditor.js +176 -0
- package/dist/cjs/components/LayoutEditor/index.js +32 -0
- package/dist/cjs/components/LinksEditor/LinksEditor.js +4 -4
- package/dist/cjs/components/MultiQueryEditor/MultiQueryEditor.js +8 -5
- package/dist/cjs/components/MultiQueryEditor/QueryEditorContainer.js +7 -7
- package/dist/cjs/components/PanelSpecEditor/PanelAnnotationsEditor.js +4 -4
- package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +18 -6
- package/dist/cjs/components/PluginEditor/PluginEditor.js +4 -3
- package/dist/cjs/components/PluginEditor/plugin-editor-api.js +1 -1
- package/dist/cjs/components/PluginRegistry/PluginRegistry.js +1 -1
- package/dist/cjs/components/PluginSpecEditor/DatasourceSpecEditor.js +70 -0
- package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +17 -3
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +6 -7
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +5 -5
- package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +1 -1
- package/dist/cjs/components/index.js +2 -0
- package/dist/cjs/constants/index.js +1 -0
- package/dist/cjs/constants/repeat.js +32 -0
- package/dist/cjs/context/ValidationProvider.js +2 -2
- package/dist/cjs/model/index.js +1 -0
- package/dist/cjs/model/json-queries.js +16 -0
- package/dist/cjs/remote/PluginRuntime.js +12 -20
- package/dist/cjs/remote/remotePluginLoader.js +1 -1
- package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +14 -6
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +18 -4
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviders.js +2 -2
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +14 -1
- package/dist/cjs/runtime/TimeRangeProvider/query-params.js +2 -2
- package/dist/cjs/runtime/alerts-queries.js +1 -1
- package/dist/cjs/runtime/annotations.js +2 -2
- package/dist/cjs/runtime/index.js +1 -0
- package/dist/cjs/runtime/item-actions.js +1 -1
- package/dist/cjs/runtime/json-queries.js +70 -0
- package/dist/cjs/runtime/silences-queries.js +1 -1
- package/dist/cjs/runtime/time-series-queries.js +1 -1
- package/dist/cjs/runtime/trace-queries.js +1 -1
- package/dist/cjs/schema/panel.js +17 -3
- package/dist/cjs/test/mock-data.js +9 -0
- package/dist/cjs/test/setup-tests.js +9 -3
- package/dist/cjs/test/test-plugins/ernie/index.js +58 -1
- package/dist/cjs/utils/csv-export.js +1 -1
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.d.ts +2 -2
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.d.ts.map +1 -1
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js +4 -4
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js.map +1 -1
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.d.ts +2 -2
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.d.ts.map +1 -1
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.js +1 -1
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.js.map +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +2 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +3 -2
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
- package/dist/components/DatasourceSelect/DatasourceSelect.d.ts.map +1 -1
- package/dist/components/DatasourceSelect/DatasourceSelect.js +1 -1
- package/dist/components/DatasourceSelect/DatasourceSelect.js.map +1 -1
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts +8 -0
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts.map +1 -0
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js +45 -0
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js.map +1 -0
- package/dist/components/DatasourceTestConnectionButton/index.d.ts +2 -0
- package/dist/components/DatasourceTestConnectionButton/index.d.ts.map +1 -0
- package/dist/components/DatasourceTestConnectionButton/index.js +15 -0
- package/dist/components/DatasourceTestConnectionButton/index.js.map +1 -0
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +2 -1
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -1
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +50 -25
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -1
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js.map +1 -1
- package/dist/components/LayoutEditor/LayoutEditor.d.ts +16 -0
- package/dist/components/LayoutEditor/LayoutEditor.d.ts.map +1 -0
- package/dist/components/LayoutEditor/LayoutEditor.js +115 -0
- package/dist/components/LayoutEditor/LayoutEditor.js.map +1 -0
- package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts +7 -0
- package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts.map +1 -0
- package/dist/components/LayoutEditor/RepeatLayoutPreview.js +92 -0
- package/dist/components/LayoutEditor/RepeatLayoutPreview.js.map +1 -0
- package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts +18 -0
- package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts.map +1 -0
- package/dist/components/LayoutEditor/RepeatVariableEditor.js +168 -0
- package/dist/components/LayoutEditor/RepeatVariableEditor.js.map +1 -0
- package/dist/components/LayoutEditor/index.d.ts +4 -0
- package/dist/components/LayoutEditor/index.d.ts.map +1 -0
- package/dist/components/LayoutEditor/index.js +17 -0
- package/dist/components/LayoutEditor/index.js.map +1 -0
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
- package/dist/components/LinksEditor/LinksEditor.d.ts.map +1 -1
- package/dist/components/LinksEditor/LinksEditor.js +4 -4
- package/dist/components/LinksEditor/LinksEditor.js.map +1 -1
- package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +0 -1
- package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -1
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js +8 -5
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -1
- package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +0 -1
- package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -1
- package/dist/components/MultiQueryEditor/QueryEditorContainer.js +7 -7
- package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
- package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.d.ts +1 -1
- package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.d.ts.map +1 -1
- package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.js +4 -4
- package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.js.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +5 -2
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js +18 -6
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.js +4 -3
- package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.d.ts +2 -1
- package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.js +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +0 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.js +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
- package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts.map +1 -1
- package/dist/components/PluginRegistry/getPluginSearchHelper.js.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.d.ts +10 -0
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.d.ts.map +1 -0
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js +62 -0
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js.map +1 -0
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +2 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js +17 -3
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +9 -10
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +2 -2
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +5 -5
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
- package/dist/components/Variables/variable-model.d.ts.map +1 -1
- package/dist/components/Variables/variable-model.js.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.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/repeat.d.ts +3 -0
- package/dist/constants/repeat.d.ts.map +1 -0
- package/dist/constants/repeat.js +16 -0
- package/dist/constants/repeat.js.map +1 -0
- package/dist/context/ValidationProvider.d.ts +2 -2
- package/dist/context/ValidationProvider.d.ts.map +1 -1
- package/dist/context/ValidationProvider.js +2 -2
- package/dist/context/ValidationProvider.js.map +1 -1
- package/dist/model/alerts-queries.d.ts +1 -1
- package/dist/model/alerts-queries.d.ts.map +1 -1
- package/dist/model/alerts-queries.js.map +1 -1
- package/dist/model/annotations.d.ts.map +1 -1
- package/dist/model/annotations.js.map +1 -1
- package/dist/model/calculations.js.map +1 -1
- package/dist/model/datasource.d.ts +9 -2
- package/dist/model/datasource.d.ts.map +1 -1
- package/dist/model/datasource.js +1 -1
- package/dist/model/datasource.js.map +1 -1
- package/dist/model/explore.d.ts +0 -1
- package/dist/model/explore.d.ts.map +1 -1
- package/dist/model/explore.js.map +1 -1
- package/dist/model/index.d.ts +1 -0
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +1 -0
- package/dist/model/index.js.map +1 -1
- package/dist/model/json-queries.d.ts +29 -0
- package/dist/model/json-queries.d.ts.map +1 -0
- package/dist/model/json-queries.js +17 -0
- package/dist/model/json-queries.js.map +1 -0
- package/dist/model/legend.d.ts.map +1 -1
- package/dist/model/legend.js.map +1 -1
- package/dist/model/log-queries.d.ts.map +1 -1
- package/dist/model/log-queries.js.map +1 -1
- package/dist/model/panels.d.ts +10 -1
- package/dist/model/panels.d.ts.map +1 -1
- package/dist/model/panels.js.map +1 -1
- package/dist/model/plugin-base.d.ts +2 -2
- package/dist/model/plugin-base.d.ts.map +1 -1
- package/dist/model/plugin-base.js.map +1 -1
- package/dist/model/plugins.d.ts +8 -6
- package/dist/model/plugins.d.ts.map +1 -1
- package/dist/model/plugins.js.map +1 -1
- package/dist/model/profile-queries.d.ts +1 -1
- package/dist/model/profile-queries.d.ts.map +1 -1
- package/dist/model/profile-queries.js.map +1 -1
- package/dist/model/silences-queries.d.ts +1 -1
- package/dist/model/silences-queries.d.ts.map +1 -1
- package/dist/model/silences-queries.js.map +1 -1
- package/dist/model/time-series-queries.d.ts +1 -1
- package/dist/model/time-series-queries.d.ts.map +1 -1
- package/dist/model/time-series-queries.js.map +1 -1
- package/dist/model/trace-queries.d.ts +1 -1
- package/dist/model/trace-queries.d.ts.map +1 -1
- package/dist/model/trace-queries.js.map +1 -1
- package/dist/model/variables.d.ts +5 -1
- package/dist/model/variables.d.ts.map +1 -1
- package/dist/model/variables.js +1 -3
- package/dist/model/variables.js.map +1 -1
- package/dist/remote/PluginLoaderComponent.d.ts +0 -1
- package/dist/remote/PluginLoaderComponent.d.ts.map +1 -1
- package/dist/remote/PluginLoaderComponent.js.map +1 -1
- package/dist/remote/PluginRuntime.d.ts.map +1 -1
- package/dist/remote/PluginRuntime.js +12 -20
- package/dist/remote/PluginRuntime.js.map +1 -1
- package/dist/remote/remotePluginLoader.d.ts +1 -1
- package/dist/remote/remotePluginLoader.d.ts.map +1 -1
- package/dist/remote/remotePluginLoader.js +1 -1
- package/dist/remote/remotePluginLoader.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +2 -2
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +15 -7
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +18 -4
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js +3 -3
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +8 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +14 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.js +2 -2
- package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
- package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -1
- package/dist/runtime/alerts-queries.d.ts.map +1 -1
- package/dist/runtime/alerts-queries.js +1 -1
- package/dist/runtime/alerts-queries.js.map +1 -1
- package/dist/runtime/annotations.d.ts.map +1 -1
- package/dist/runtime/annotations.js +2 -2
- package/dist/runtime/annotations.js.map +1 -1
- package/dist/runtime/builtin-variables.d.ts +0 -1
- package/dist/runtime/builtin-variables.d.ts.map +1 -1
- package/dist/runtime/builtin-variables.js.map +1 -1
- package/dist/runtime/datasources.d.ts +0 -1
- package/dist/runtime/datasources.d.ts.map +1 -1
- package/dist/runtime/datasources.js.map +1 -1
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/item-actions.d.ts +1 -1
- package/dist/runtime/item-actions.d.ts.map +1 -1
- package/dist/runtime/item-actions.js +1 -1
- package/dist/runtime/item-actions.js.map +1 -1
- package/dist/runtime/json-queries.d.ts +11 -0
- package/dist/runtime/json-queries.d.ts.map +1 -0
- package/dist/runtime/json-queries.js +58 -0
- package/dist/runtime/json-queries.js.map +1 -0
- package/dist/runtime/log-queries.d.ts.map +1 -1
- package/dist/runtime/log-queries.js.map +1 -1
- package/dist/runtime/plugin-registry.d.ts +0 -1
- package/dist/runtime/plugin-registry.d.ts.map +1 -1
- package/dist/runtime/plugin-registry.js.map +1 -1
- package/dist/runtime/profile-queries.d.ts.map +1 -1
- package/dist/runtime/profile-queries.js.map +1 -1
- package/dist/runtime/silences-queries.d.ts.map +1 -1
- package/dist/runtime/silences-queries.js +1 -1
- package/dist/runtime/silences-queries.js.map +1 -1
- package/dist/runtime/time-series-queries.d.ts.map +1 -1
- package/dist/runtime/time-series-queries.js +1 -1
- package/dist/runtime/time-series-queries.js.map +1 -1
- package/dist/runtime/trace-queries.d.ts.map +1 -1
- package/dist/runtime/trace-queries.js +1 -1
- package/dist/runtime/trace-queries.js.map +1 -1
- package/dist/runtime/variables.d.ts +0 -1
- package/dist/runtime/variables.d.ts.map +1 -1
- package/dist/runtime/variables.js.map +1 -1
- package/dist/schema/panel.d.ts +1 -1
- package/dist/schema/panel.d.ts.map +1 -1
- package/dist/schema/panel.js +17 -3
- package/dist/schema/panel.js.map +1 -1
- package/dist/test/mock-data.d.ts +2 -1
- package/dist/test/mock-data.d.ts.map +1 -1
- package/dist/test/mock-data.js +6 -0
- package/dist/test/mock-data.js.map +1 -1
- package/dist/test/render-hook.d.ts.map +1 -1
- package/dist/test/render-hook.js.map +1 -1
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.d.ts +1 -1
- package/dist/test/setup-tests.d.ts.map +1 -1
- package/dist/test/setup-tests.js +3 -2
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
- package/dist/test/test-plugins/bert/index.js.map +1 -1
- package/dist/test/test-plugins/ernie/index.d.ts +7 -1
- package/dist/test/test-plugins/ernie/index.d.ts.map +1 -1
- package/dist/test/test-plugins/ernie/index.js +58 -1
- package/dist/test/test-plugins/ernie/index.js.map +1 -1
- package/dist/test/utils.d.ts.map +1 -1
- package/dist/test/utils.js +1 -1
- package/dist/test/utils.js.map +1 -1
- package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
- package/dist/test-utils/mock-plugin-registry.js.map +1 -1
- package/dist/utils/csv-export.d.ts.map +1 -1
- package/dist/utils/csv-export.js +1 -1
- package/dist/utils/csv-export.js.map +1 -1
- package/package.json +8 -8
|
@@ -21,15 +21,15 @@ Object.defineProperty(exports, "AnnotationEditorForm", {
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const
|
|
24
|
+
const _zod = require("@hookform/resolvers/zod");
|
|
25
25
|
const _material = require("@mui/material");
|
|
26
26
|
const _components = require("@perses-dev/components");
|
|
27
|
-
const _reacthookform = require("react-hook-form");
|
|
28
|
-
const _zod = require("@hookform/resolvers/zod");
|
|
29
27
|
const _reactquery = require("@tanstack/react-query");
|
|
30
28
|
const _InvertColors = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/InvertColors"));
|
|
31
|
-
const
|
|
29
|
+
const _react = require("react");
|
|
30
|
+
const _reacthookform = require("react-hook-form");
|
|
32
31
|
const _context = require("../../../context");
|
|
32
|
+
const _PluginEditor = require("../../PluginEditor");
|
|
33
33
|
const _constants = require("../constants");
|
|
34
34
|
const _AnnotationPreview = require("./AnnotationPreview");
|
|
35
35
|
function _interop_require_default(obj) {
|
|
@@ -21,10 +21,10 @@ Object.defineProperty(exports, "AnnotationPreview", {
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _react = require("react");
|
|
25
24
|
const _material = require("@mui/material");
|
|
26
25
|
const _components = require("@perses-dev/components");
|
|
27
26
|
const _Alert = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Alert"));
|
|
27
|
+
const _react = require("react");
|
|
28
28
|
const _runtime = require("../../../runtime");
|
|
29
29
|
function _interop_require_default(obj) {
|
|
30
30
|
return obj && obj.__esModule ? obj : {
|
|
@@ -29,7 +29,7 @@ const _reacthookform = require("react-hook-form");
|
|
|
29
29
|
const _context = require("../../context");
|
|
30
30
|
const _PluginEditor = require("../PluginEditor");
|
|
31
31
|
function DatasourceEditorForm(props) {
|
|
32
|
-
const { initialDatasourceDefinition, action, isDraft, isReadonly, onActionChange, onSave, onClose, onDelete } = props;
|
|
32
|
+
const { initialDatasourceDefinition, action, isDraft, isReadonly, onActionChange, onSave, onClose, onDelete, testConnection } = props;
|
|
33
33
|
const [isDiscardDialogOpened, setDiscardDialogOpened] = (0, _react.useState)(false);
|
|
34
34
|
const titleAction = (0, _components.getTitleAction)(action, isDraft);
|
|
35
35
|
const submitText = (0, _components.getSubmitText)(action, isDraft);
|
|
@@ -251,7 +251,8 @@ function DatasourceEditorForm(props) {
|
|
|
251
251
|
kind: v.selection.kind,
|
|
252
252
|
spec: v.spec
|
|
253
253
|
});
|
|
254
|
-
}
|
|
254
|
+
},
|
|
255
|
+
testConnection: testConnection
|
|
255
256
|
})
|
|
256
257
|
})
|
|
257
258
|
]
|
|
@@ -45,8 +45,8 @@ _export(exports, {
|
|
|
45
45
|
});
|
|
46
46
|
const _jsxruntime = require("react/jsx-runtime");
|
|
47
47
|
const _react = require("react");
|
|
48
|
-
const _OpenInNew = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/OpenInNew"));
|
|
49
48
|
const _material = require("@mui/material");
|
|
49
|
+
const _OpenInNew = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/OpenInNew"));
|
|
50
50
|
const _runtime = require("../../runtime");
|
|
51
51
|
const _utils = require("../../utils");
|
|
52
52
|
function _interop_require_default(obj) {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Copyright 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, "DatasourceTestConnectionButton", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return DatasourceTestConnectionButton;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _material = require("@mui/material");
|
|
25
|
+
const _components = require("@perses-dev/components");
|
|
26
|
+
const _react = require("react");
|
|
27
|
+
const DatasourceTestConnectionButton = ({ testConnection, disabled, ...buttonProps })=>{
|
|
28
|
+
const { successSnackbar, exceptionSnackbar } = (0, _components.useSnackbar)();
|
|
29
|
+
const [isTesting, setIsTesting] = (0, _react.useState)(false);
|
|
30
|
+
const handleClick = (0, _react.useCallback)(async ()=>{
|
|
31
|
+
setIsTesting(true);
|
|
32
|
+
try {
|
|
33
|
+
await testConnection();
|
|
34
|
+
successSnackbar('Datasource is healthy');
|
|
35
|
+
} catch (e) {
|
|
36
|
+
exceptionSnackbar(e instanceof Error ? e : new Error('Datasource is not healthy'));
|
|
37
|
+
} finally{
|
|
38
|
+
setIsTesting(false);
|
|
39
|
+
}
|
|
40
|
+
}, [
|
|
41
|
+
testConnection,
|
|
42
|
+
successSnackbar,
|
|
43
|
+
exceptionSnackbar
|
|
44
|
+
]);
|
|
45
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
46
|
+
onClick: handleClick,
|
|
47
|
+
color: "info",
|
|
48
|
+
variant: "outlined",
|
|
49
|
+
disabled: disabled || isTesting,
|
|
50
|
+
...buttonProps,
|
|
51
|
+
children: "Test Connection"
|
|
52
|
+
});
|
|
53
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright 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
|
+
_export_star(require("./DatasourceTestConnectionButton"), exports);
|
|
18
|
+
function _export_star(from, to) {
|
|
19
|
+
Object.keys(from).forEach(function(k) {
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
+
Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return from;
|
|
30
|
+
}
|
|
@@ -22,11 +22,13 @@ Object.defineProperty(exports, "HTTPSettingsEditor", {
|
|
|
22
22
|
});
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
24
|
const _material = require("@mui/material");
|
|
25
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
26
25
|
const _immer = require("immer");
|
|
27
|
-
const _reacthookform = require("react-hook-form");
|
|
28
26
|
const _Minus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Minus"));
|
|
29
27
|
const _Plus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Plus"));
|
|
28
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
29
|
+
const _reacthookform = require("react-hook-form");
|
|
30
|
+
const _zod = require("zod");
|
|
31
|
+
const _DatasourceTestConnectionButton = require("../DatasourceTestConnectionButton");
|
|
30
32
|
const _OptionsEditorRadios = require("../OptionsEditorRadios");
|
|
31
33
|
function _interop_require_default(obj) {
|
|
32
34
|
return obj && obj.__esModule ? obj : {
|
|
@@ -74,8 +76,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
74
76
|
}
|
|
75
77
|
return newObj;
|
|
76
78
|
}
|
|
79
|
+
const urlSchema = _zod.z.string().url();
|
|
77
80
|
function HTTPSettingsEditor(props) {
|
|
78
|
-
const { value, onChange, isReadonly, initialSpecDirect, initialSpecProxy } = props;
|
|
81
|
+
const { value, onChange, isReadonly, initialSpecDirect, initialSpecProxy, testConnection } = props;
|
|
79
82
|
const strDirect = 'Direct access';
|
|
80
83
|
const strProxy = 'Proxy';
|
|
81
84
|
// Initialize Proxy mode by default, if neither direct nor proxy mode is selected.
|
|
@@ -160,6 +163,15 @@ function HTTPSettingsEditor(props) {
|
|
|
160
163
|
}
|
|
161
164
|
})
|
|
162
165
|
}),
|
|
166
|
+
testConnection && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
167
|
+
mb: 2,
|
|
168
|
+
display: "flex",
|
|
169
|
+
justifyContent: "flex-end",
|
|
170
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DatasourceTestConnectionButton.DatasourceTestConnectionButton, {
|
|
171
|
+
testConnection: testConnection,
|
|
172
|
+
disabled: !urlSchema.safeParse(value.proxy?.spec.url).success
|
|
173
|
+
})
|
|
174
|
+
}),
|
|
163
175
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
164
176
|
variant: "h5",
|
|
165
177
|
mb: 2,
|
|
@@ -493,28 +505,41 @@ function HTTPSettingsEditor(props) {
|
|
|
493
505
|
},
|
|
494
506
|
{
|
|
495
507
|
label: strDirect,
|
|
496
|
-
content: /*#__PURE__*/ (0, _jsxruntime.
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
508
|
+
content: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
509
|
+
children: [
|
|
510
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
511
|
+
name: "URL",
|
|
512
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
513
|
+
...field,
|
|
514
|
+
fullWidth: true,
|
|
515
|
+
label: "URL",
|
|
516
|
+
value: value.directUrl || '',
|
|
517
|
+
error: !!fieldState.error,
|
|
518
|
+
helperText: fieldState.error?.message,
|
|
519
|
+
InputProps: {
|
|
520
|
+
readOnly: isReadonly
|
|
521
|
+
},
|
|
522
|
+
InputLabelProps: {
|
|
523
|
+
shrink: isReadonly ? true : undefined
|
|
524
|
+
},
|
|
525
|
+
onChange: (e)=>{
|
|
526
|
+
field.onChange(e);
|
|
527
|
+
onChange((0, _immer.produce)(value, (draft)=>{
|
|
528
|
+
draft.directUrl = e.target.value;
|
|
529
|
+
}));
|
|
530
|
+
}
|
|
531
|
+
})
|
|
532
|
+
}),
|
|
533
|
+
testConnection && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
534
|
+
my: 2,
|
|
535
|
+
display: "flex",
|
|
536
|
+
justifyContent: "flex-end",
|
|
537
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DatasourceTestConnectionButton.DatasourceTestConnectionButton, {
|
|
538
|
+
testConnection: testConnection,
|
|
539
|
+
disabled: !urlSchema.safeParse(value.directUrl).success
|
|
540
|
+
})
|
|
517
541
|
})
|
|
542
|
+
]
|
|
518
543
|
})
|
|
519
544
|
}
|
|
520
545
|
];
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// Copyright 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, "LayoutEditor", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return LayoutEditor;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _material = require("@mui/material");
|
|
25
|
+
const _react = require("react");
|
|
26
|
+
const _reacthookform = require("react-hook-form");
|
|
27
|
+
const _constants = require("../../constants");
|
|
28
|
+
const _runtime = require("../../runtime");
|
|
29
|
+
const _RepeatLayoutPreview = require("./RepeatLayoutPreview");
|
|
30
|
+
const _RepeatVariableEditor = require("./RepeatVariableEditor");
|
|
31
|
+
const DEFAULT_LAYOUT_WIDTH = 24;
|
|
32
|
+
function LayoutEditor({ control, variableDefinitionGroups, panelGroups }) {
|
|
33
|
+
const { formState, setValue } = (0, _reacthookform.useFormContext)();
|
|
34
|
+
const variableValues = (0, _runtime.useVariableValues)();
|
|
35
|
+
const watchedRepeatVariableValue = (0, _reacthookform.useWatch)({
|
|
36
|
+
control,
|
|
37
|
+
name: 'layoutDefinition.repeatVariable.value'
|
|
38
|
+
});
|
|
39
|
+
const watchedAlignment = (0, _reacthookform.useWatch)({
|
|
40
|
+
control,
|
|
41
|
+
name: 'layoutDefinition.repeatVariable.alignment'
|
|
42
|
+
});
|
|
43
|
+
const watchedMaxPer = (0, _reacthookform.useWatch)({
|
|
44
|
+
control,
|
|
45
|
+
name: 'layoutDefinition.repeatVariable.maxPer'
|
|
46
|
+
});
|
|
47
|
+
const optionCount = (0, _react.useMemo)(()=>{
|
|
48
|
+
if (!watchedRepeatVariableValue) return 0;
|
|
49
|
+
return variableValues[watchedRepeatVariableValue]?.options?.length ?? 0;
|
|
50
|
+
}, [
|
|
51
|
+
watchedRepeatVariableValue,
|
|
52
|
+
variableValues
|
|
53
|
+
]);
|
|
54
|
+
const isVertical = (watchedAlignment ?? _constants.DEFAULT_REPEAT_ALIGNMENT) === 'vertical';
|
|
55
|
+
const perRow = isVertical ? 1 : watchedMaxPer ?? _constants.DEFAULT_MAX_PER_ROW;
|
|
56
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Grid2, {
|
|
57
|
+
container: true,
|
|
58
|
+
spacing: 2,
|
|
59
|
+
width: "100%",
|
|
60
|
+
children: [
|
|
61
|
+
panelGroups && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
62
|
+
children: [
|
|
63
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid2, {
|
|
64
|
+
size: 12,
|
|
65
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
66
|
+
variant: "h4",
|
|
67
|
+
children: "Panel Group"
|
|
68
|
+
})
|
|
69
|
+
}),
|
|
70
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid2, {
|
|
71
|
+
size: 4,
|
|
72
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
73
|
+
control: control,
|
|
74
|
+
name: "groupId",
|
|
75
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
76
|
+
select: true,
|
|
77
|
+
...field,
|
|
78
|
+
required: true,
|
|
79
|
+
fullWidth: true,
|
|
80
|
+
label: "Group",
|
|
81
|
+
error: !!fieldState.error,
|
|
82
|
+
helperText: fieldState.error?.message,
|
|
83
|
+
children: panelGroups.map((panelGroup, index)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
84
|
+
value: panelGroup.id,
|
|
85
|
+
children: panelGroup.title ?? `Group ${index + 1}`
|
|
86
|
+
}, panelGroup.id))
|
|
87
|
+
})
|
|
88
|
+
})
|
|
89
|
+
}),
|
|
90
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid2, {
|
|
91
|
+
size: 8
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
}),
|
|
95
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid2, {
|
|
96
|
+
size: 12,
|
|
97
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
98
|
+
variant: "h4",
|
|
99
|
+
children: "Repeat Options"
|
|
100
|
+
})
|
|
101
|
+
}),
|
|
102
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
103
|
+
control: control,
|
|
104
|
+
name: "layoutDefinition.repeatVariable",
|
|
105
|
+
render: ({ field })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_RepeatVariableEditor.RepeatVariableEditor, {
|
|
106
|
+
value: field.value,
|
|
107
|
+
onChange: field.onChange,
|
|
108
|
+
errors: formState.errors.layoutDefinition?.repeatVariable ?? {},
|
|
109
|
+
variableDefinitionGroups: variableDefinitionGroups,
|
|
110
|
+
isVertical: isVertical,
|
|
111
|
+
onRepeatVariableSet: ()=>setValue('layoutDefinition.width', DEFAULT_LAYOUT_WIDTH)
|
|
112
|
+
})
|
|
113
|
+
}),
|
|
114
|
+
watchedRepeatVariableValue && optionCount > 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid2, {
|
|
115
|
+
size: 12,
|
|
116
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_RepeatLayoutPreview.RepeatLayoutPreview, {
|
|
117
|
+
optionCount: optionCount,
|
|
118
|
+
maxPer: perRow
|
|
119
|
+
})
|
|
120
|
+
})
|
|
121
|
+
]
|
|
122
|
+
});
|
|
123
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// Copyright 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, "RepeatLayoutPreview", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return RepeatLayoutPreview;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _material = require("@mui/material");
|
|
25
|
+
const _components = require("@perses-dev/components");
|
|
26
|
+
const _InformationOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/InformationOutline"));
|
|
27
|
+
const _react = require("react");
|
|
28
|
+
function _interop_require_default(obj) {
|
|
29
|
+
return obj && obj.__esModule ? obj : {
|
|
30
|
+
default: obj
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const PREVIEW_GAP = 4;
|
|
34
|
+
function RepeatLayoutPreview({ optionCount, maxPer }) {
|
|
35
|
+
const repeatItems = (0, _react.useMemo)(()=>Array.from({
|
|
36
|
+
length: optionCount
|
|
37
|
+
}, (_, i)=>i), [
|
|
38
|
+
optionCount
|
|
39
|
+
]);
|
|
40
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
41
|
+
children: [
|
|
42
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
43
|
+
sx: {
|
|
44
|
+
display: 'flex',
|
|
45
|
+
alignItems: 'center',
|
|
46
|
+
gap: 0.5,
|
|
47
|
+
mb: 0.5
|
|
48
|
+
},
|
|
49
|
+
children: [
|
|
50
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
|
|
51
|
+
variant: "subtitle2",
|
|
52
|
+
color: "text.secondary",
|
|
53
|
+
children: [
|
|
54
|
+
"Layout preview (",
|
|
55
|
+
optionCount,
|
|
56
|
+
" panel",
|
|
57
|
+
optionCount !== 1 ? 's' : '',
|
|
58
|
+
")"
|
|
59
|
+
]
|
|
60
|
+
}),
|
|
61
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
62
|
+
description: "Preview of the layout when all available options of the selected variable are selected.",
|
|
63
|
+
enterDelay: 100,
|
|
64
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
65
|
+
size: "small",
|
|
66
|
+
sx: (theme)=>({
|
|
67
|
+
borderRadius: theme.shape.borderRadius,
|
|
68
|
+
padding: '2px'
|
|
69
|
+
}),
|
|
70
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_InformationOutline.default, {
|
|
71
|
+
"aria-hidden": false,
|
|
72
|
+
"aria-label": "Show layout preview information",
|
|
73
|
+
fontSize: "inherit",
|
|
74
|
+
sx: {
|
|
75
|
+
color: (theme)=>theme.palette.grey[700]
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
}),
|
|
82
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
83
|
+
sx: {
|
|
84
|
+
height: 315,
|
|
85
|
+
overflow: 'auto'
|
|
86
|
+
},
|
|
87
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.RepeatGrid, {
|
|
88
|
+
repeatItems: repeatItems,
|
|
89
|
+
maxPer: maxPer,
|
|
90
|
+
gap: PREVIEW_GAP,
|
|
91
|
+
renderItem: ()=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
92
|
+
sx: {
|
|
93
|
+
width: `100%`,
|
|
94
|
+
height: 150,
|
|
95
|
+
borderRadius: 1,
|
|
96
|
+
bgcolor: 'action.selected',
|
|
97
|
+
border: '1px solid',
|
|
98
|
+
borderColor: 'divider'
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
]
|
|
104
|
+
});
|
|
105
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// Copyright 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, "RepeatVariableEditor", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return RepeatVariableEditor;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _material = require("@mui/material");
|
|
25
|
+
const _react = require("react");
|
|
26
|
+
const _constants = require("../../constants");
|
|
27
|
+
function RepeatVariableEditor({ value: current, onChange, errors, variableDefinitionGroups, isVertical, onRepeatVariableSet }) {
|
|
28
|
+
const handleVariableChange = (0, _react.useCallback)((selected)=>{
|
|
29
|
+
if (!selected) {
|
|
30
|
+
onChange(undefined);
|
|
31
|
+
} else {
|
|
32
|
+
onChange(current ? {
|
|
33
|
+
...current,
|
|
34
|
+
value: selected
|
|
35
|
+
} : {
|
|
36
|
+
value: selected,
|
|
37
|
+
alignment: _constants.DEFAULT_REPEAT_ALIGNMENT
|
|
38
|
+
});
|
|
39
|
+
if (!current) {
|
|
40
|
+
onRepeatVariableSet();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}, [
|
|
44
|
+
current,
|
|
45
|
+
onChange,
|
|
46
|
+
onRepeatVariableSet
|
|
47
|
+
]);
|
|
48
|
+
const handleAlignmentChange = (0, _react.useCallback)((selected)=>{
|
|
49
|
+
if (!current) return;
|
|
50
|
+
onChange(selected === 'vertical' ? {
|
|
51
|
+
...current,
|
|
52
|
+
alignment: selected,
|
|
53
|
+
maxPer: undefined
|
|
54
|
+
} : {
|
|
55
|
+
...current,
|
|
56
|
+
alignment: selected
|
|
57
|
+
});
|
|
58
|
+
}, [
|
|
59
|
+
current,
|
|
60
|
+
onChange
|
|
61
|
+
]);
|
|
62
|
+
const handleMaxPerChange = (0, _react.useCallback)((value)=>{
|
|
63
|
+
if (!current) return;
|
|
64
|
+
onChange({
|
|
65
|
+
...current,
|
|
66
|
+
maxPer: value === '' ? undefined : Number(value)
|
|
67
|
+
});
|
|
68
|
+
}, [
|
|
69
|
+
current,
|
|
70
|
+
onChange
|
|
71
|
+
]);
|
|
72
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
73
|
+
children: [
|
|
74
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid2, {
|
|
75
|
+
size: 4,
|
|
76
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TextField, {
|
|
77
|
+
select: true,
|
|
78
|
+
fullWidth: true,
|
|
79
|
+
label: "Repeat Variable",
|
|
80
|
+
value: current?.value ?? '',
|
|
81
|
+
error: !!errors.value,
|
|
82
|
+
helperText: errors.value?.message,
|
|
83
|
+
onChange: (event)=>handleVariableChange(event.target.value),
|
|
84
|
+
slotProps: {
|
|
85
|
+
select: {
|
|
86
|
+
MenuProps: {
|
|
87
|
+
PaperProps: {
|
|
88
|
+
sx: {
|
|
89
|
+
maxHeight: 240
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
children: [
|
|
96
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
97
|
+
value: "",
|
|
98
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
99
|
+
sx: {
|
|
100
|
+
fontStyle: 'italic'
|
|
101
|
+
},
|
|
102
|
+
children: "None"
|
|
103
|
+
})
|
|
104
|
+
}),
|
|
105
|
+
variableDefinitionGroups.flatMap(({ source, definitions })=>{
|
|
106
|
+
const listDefs = definitions.filter((def)=>def.kind === 'ListVariable' && def.spec.allowMultiple);
|
|
107
|
+
if (listDefs.length === 0) return [];
|
|
108
|
+
return [
|
|
109
|
+
source && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ListSubheader, {
|
|
110
|
+
children: source
|
|
111
|
+
}, `group-${source}`),
|
|
112
|
+
...listDefs.map((def)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
113
|
+
value: def.spec.name,
|
|
114
|
+
children: def.spec.display?.name ?? def.spec.name
|
|
115
|
+
}, `${source ?? 'dashboard'}-${def.spec.name}`))
|
|
116
|
+
];
|
|
117
|
+
})
|
|
118
|
+
]
|
|
119
|
+
})
|
|
120
|
+
}),
|
|
121
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid2, {
|
|
122
|
+
size: 4,
|
|
123
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TextField, {
|
|
124
|
+
select: true,
|
|
125
|
+
fullWidth: true,
|
|
126
|
+
label: "Alignment",
|
|
127
|
+
value: current?.alignment ?? _constants.DEFAULT_REPEAT_ALIGNMENT,
|
|
128
|
+
disabled: !current,
|
|
129
|
+
error: !!errors.alignment,
|
|
130
|
+
helperText: errors.alignment?.message,
|
|
131
|
+
onChange: (event)=>handleAlignmentChange(event.target.value),
|
|
132
|
+
children: [
|
|
133
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
134
|
+
value: "horizontal",
|
|
135
|
+
children: "Horizontal"
|
|
136
|
+
}),
|
|
137
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
138
|
+
value: "vertical",
|
|
139
|
+
children: "Vertical"
|
|
140
|
+
})
|
|
141
|
+
]
|
|
142
|
+
})
|
|
143
|
+
}),
|
|
144
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid2, {
|
|
145
|
+
size: 4,
|
|
146
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
147
|
+
select: true,
|
|
148
|
+
fullWidth: true,
|
|
149
|
+
label: "Max Per Row",
|
|
150
|
+
value: current?.maxPer ?? _constants.DEFAULT_MAX_PER_ROW,
|
|
151
|
+
disabled: !current || isVertical,
|
|
152
|
+
error: !!errors.maxPer,
|
|
153
|
+
helperText: errors.maxPer?.message,
|
|
154
|
+
onChange: (event)=>handleMaxPerChange(event.target.value),
|
|
155
|
+
slotProps: {
|
|
156
|
+
select: {
|
|
157
|
+
MenuProps: {
|
|
158
|
+
PaperProps: {
|
|
159
|
+
sx: {
|
|
160
|
+
maxHeight: 240
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
children: Array.from({
|
|
167
|
+
length: 12
|
|
168
|
+
}, (_, i)=>i + 1).map((n)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
169
|
+
value: n,
|
|
170
|
+
children: n
|
|
171
|
+
}, n))
|
|
172
|
+
})
|
|
173
|
+
})
|
|
174
|
+
]
|
|
175
|
+
});
|
|
176
|
+
}
|