@perses-dev/plugin-system 0.0.0-snapshot-scatterplot-fix-imports-95e1b59 → 0.0.0-snapshot-histogram-types-78c5104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +82 -162
- package/dist/cjs/components/DatasourceSelect.js +8 -13
- package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +534 -0
- package/dist/cjs/components/{TimeSeriesQueryEditor → HTTPSettingsEditor}/index.js +2 -2
- package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +8 -7
- package/dist/cjs/components/MetricLabelInput/MetricLabelInput.js +41 -0
- package/dist/cjs/components/{TraceQueryEditor → MetricLabelInput}/index.js +2 -2
- package/dist/cjs/components/{TimeSeriesQueryEditor/TimeSeriesQueryEditor.js → MultiQueryEditor/MultiQueryEditor.js} +30 -23
- package/dist/cjs/components/{TimeSeriesQueryEditor/TimeSeriesQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +25 -13
- package/dist/cjs/{stories/shared-utils → components/MultiQueryEditor}/index.js +2 -2
- package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +51 -59
- package/dist/cjs/components/PluginEditor/PluginEditor.js +16 -13
- package/dist/cjs/components/PluginEditor/plugin-editor-api.js +43 -32
- package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +55 -7
- package/dist/cjs/components/PluginRegistry/PluginRegistry.js +8 -9
- package/dist/cjs/components/PluginRegistry/plugin-indexes.js +17 -14
- package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +1 -1
- package/dist/cjs/components/ProjectSelect.js +5 -5
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +10 -71
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +391 -442
- package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +7 -7
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +6 -11
- package/dist/cjs/components/Variables/variable-model.js +26 -27
- package/dist/cjs/components/index.js +3 -1
- package/dist/cjs/context/ProjectStoreProvider.js +7 -4
- package/dist/cjs/context/ValidationProvider.js +69 -0
- package/dist/cjs/context/index.js +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/{components/TimeSeriesQueryEditor/index.js → cjs/model/explore.js} +4 -3
- package/dist/cjs/remote/PersesPlugin.types.js +16 -0
- package/dist/cjs/remote/PluginLoaderComponent.js +75 -0
- package/dist/cjs/remote/PluginRuntime.js +273 -0
- package/dist/cjs/{validation → remote}/index.js +2 -5
- package/dist/cjs/remote/remotePluginLoader.js +61 -0
- package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +18 -9
- package/dist/cjs/runtime/DataQueriesProvider/model.js +10 -9
- package/dist/cjs/{stories/shared-utils/decorators/WithPluginRegistry.js → runtime/QueryCountProvider.js} +22 -39
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +17 -4
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +100 -0
- package/dist/cjs/runtime/TimeRangeProvider/index.js +2 -1
- package/dist/cjs/runtime/TimeRangeProvider/query-params.js +4 -7
- package/dist/cjs/runtime/UsageMetricsProvider.js +99 -0
- package/dist/cjs/runtime/builtin-variables.js +2 -2
- package/dist/cjs/runtime/datasources.js +23 -14
- package/dist/cjs/runtime/index.js +4 -2
- package/dist/cjs/runtime/plugin-registry.js +49 -28
- package/dist/cjs/runtime/time-series-queries.js +23 -28
- package/dist/cjs/runtime/trace-queries.js +1 -2
- package/dist/cjs/runtime/{template-variables.js → variables.js} +29 -47
- package/dist/cjs/test/mock-data.js +25 -4
- package/dist/cjs/test/render.js +2 -11
- package/dist/cjs/test/test-plugins/bert/index.js +20 -19
- package/dist/cjs/test-utils/mock-plugin-registry.js +10 -10
- package/dist/cjs/utils/variables.js +24 -24
- package/dist/components/CalculationSelector/CalculationSelector.d.ts +2 -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 +6 -5
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +85 -165
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
- package/dist/components/DatasourceSelect.d.ts +5 -4
- package/dist/components/DatasourceSelect.d.ts.map +1 -1
- package/dist/components/DatasourceSelect.js +8 -13
- package/dist/components/DatasourceSelect.js.map +1 -1
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +11 -0
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -0
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +480 -0
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -0
- package/dist/components/HTTPSettingsEditor/index.d.ts +2 -0
- package/dist/components/HTTPSettingsEditor/index.d.ts.map +1 -0
- package/dist/components/HTTPSettingsEditor/index.js +15 -0
- package/dist/components/HTTPSettingsEditor/index.js.map +1 -0
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +3 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +10 -9
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
- package/dist/components/MetricLabelInput/MetricLabelInput.d.ts +7 -0
- package/dist/components/MetricLabelInput/MetricLabelInput.d.ts.map +1 -0
- package/dist/components/MetricLabelInput/MetricLabelInput.js +33 -0
- package/dist/components/MetricLabelInput/MetricLabelInput.js.map +1 -0
- package/dist/components/MetricLabelInput/index.d.ts +2 -0
- package/dist/components/MetricLabelInput/index.d.ts.map +1 -0
- package/dist/components/MetricLabelInput/index.js +15 -0
- package/dist/components/MetricLabelInput/index.js.map +1 -0
- package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +17 -0
- package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -0
- package/dist/components/{TimeSeriesQueryEditor/TimeSeriesQueryEditor.js → MultiQueryEditor/MultiQueryEditor.js} +37 -23
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -0
- package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +29 -0
- package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -0
- package/dist/components/{TraceQueryEditor/TraceQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +35 -12
- package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -0
- package/dist/components/MultiQueryEditor/index.d.ts +2 -0
- package/dist/components/MultiQueryEditor/index.d.ts.map +1 -0
- package/dist/components/MultiQueryEditor/index.js +15 -0
- package/dist/components/{TraceQueryEditor → MultiQueryEditor}/index.js.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +2 -2
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +2 -2
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts.map +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +3 -3
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.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 +53 -61
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.d.ts +2 -1
- package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.js +16 -13
- package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.d.ts +15 -8
- package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.js +43 -32
- package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +10 -4
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.js +61 -10
- package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.d.ts +2 -2
- package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.js +8 -9
- package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.d.ts +4 -4
- package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.js +17 -14
- package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +5 -4
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
- package/dist/components/ProjectSelect.d.ts +2 -1
- package/dist/components/ProjectSelect.d.ts.map +1 -1
- package/dist/components/ProjectSelect.js +5 -5
- package/dist/components/ProjectSelect.js.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +3 -2
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +12 -70
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +4 -3
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +395 -446
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +3 -2
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js +7 -7
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +2 -2
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +6 -11
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
- package/dist/components/Variables/variable-model.d.ts +2 -1
- package/dist/components/Variables/variable-model.d.ts.map +1 -1
- package/dist/components/Variables/variable-model.js +27 -28
- package/dist/components/Variables/variable-model.js.map +1 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -1
- package/dist/components/index.js.map +1 -1
- package/dist/context/ProjectStoreProvider.d.ts +4 -4
- package/dist/context/ProjectStoreProvider.d.ts.map +1 -1
- package/dist/context/ProjectStoreProvider.js +7 -4
- package/dist/context/ProjectStoreProvider.js.map +1 -1
- package/dist/context/ValidationProvider.d.ts +19 -0
- package/dist/context/ValidationProvider.d.ts.map +1 -0
- package/dist/context/ValidationProvider.js +52 -0
- package/dist/context/ValidationProvider.js.map +1 -0
- package/dist/context/index.d.ts +1 -0
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +1 -0
- package/dist/context/index.js.map +1 -1
- package/dist/context/query-params.d.ts.map +1 -1
- package/dist/context/query-params.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/model/explore.d.ts +13 -0
- package/dist/model/explore.d.ts.map +1 -0
- package/dist/{validation/index.js → model/explore.js} +4 -6
- package/dist/model/explore.js.map +1 -0
- package/dist/model/legend.d.ts.map +1 -1
- package/dist/model/legend.js.map +1 -1
- package/dist/model/panels.d.ts +27 -5
- package/dist/model/panels.d.ts.map +1 -1
- package/dist/model/panels.js.map +1 -1
- package/dist/model/plugin-loading.js.map +1 -1
- package/dist/model/plugins.d.ts +31 -17
- package/dist/model/plugins.d.ts.map +1 -1
- package/dist/model/plugins.js.map +1 -1
- package/dist/model/time-series-queries.d.ts +2 -1
- package/dist/model/time-series-queries.d.ts.map +1 -1
- package/dist/model/time-series-queries.js.map +1 -1
- package/dist/remote/PersesPlugin.types.d.ts +7 -0
- package/dist/remote/PersesPlugin.types.d.ts.map +1 -0
- package/dist/{stories/shared-utils/index.js → remote/PersesPlugin.types.js} +3 -3
- package/dist/remote/PersesPlugin.types.js.map +1 -0
- package/dist/remote/PluginLoaderComponent.d.ts +10 -0
- package/dist/remote/PluginLoaderComponent.d.ts.map +1 -0
- package/dist/remote/PluginLoaderComponent.js +67 -0
- package/dist/remote/PluginLoaderComponent.js.map +1 -0
- package/dist/remote/PluginRuntime.d.ts +10 -0
- package/dist/remote/PluginRuntime.d.ts.map +1 -0
- package/dist/remote/PluginRuntime.js +211 -0
- package/dist/remote/PluginRuntime.js.map +1 -0
- package/dist/remote/index.d.ts +3 -0
- package/dist/remote/index.d.ts.map +1 -0
- package/dist/{components/TraceQueryEditor → remote}/index.js +2 -1
- package/dist/remote/index.js.map +1 -0
- package/dist/remote/remotePluginLoader.d.ts +3 -0
- package/dist/remote/remotePluginLoader.d.ts.map +1 -0
- package/dist/remote/remotePluginLoader.js +53 -0
- package/dist/remote/remotePluginLoader.js.map +1 -0
- 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 +18 -9
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.d.ts +5 -6
- package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.js +10 -9
- package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
- package/dist/runtime/QueryCountProvider.d.ts +9 -0
- package/dist/runtime/QueryCountProvider.d.ts.map +1 -0
- package/dist/{validation/duration.js → runtime/QueryCountProvider.js} +13 -4
- package/dist/runtime/QueryCountProvider.js.map +1 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +2 -2
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +17 -4
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts +2 -2
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +32 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +82 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -0
- package/dist/runtime/TimeRangeProvider/index.d.ts +1 -0
- package/dist/runtime/TimeRangeProvider/index.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/index.js +2 -1
- package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.js +4 -7
- package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -1
- package/dist/runtime/UsageMetricsProvider.d.ts +25 -0
- package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -0
- package/dist/runtime/UsageMetricsProvider.js +77 -0
- package/dist/runtime/UsageMetricsProvider.js.map +1 -0
- package/dist/runtime/builtin-variables.d.ts +1 -1
- package/dist/runtime/builtin-variables.d.ts.map +1 -1
- package/dist/runtime/builtin-variables.js +2 -2
- package/dist/runtime/builtin-variables.js.map +1 -1
- package/dist/runtime/datasources.d.ts +5 -4
- package/dist/runtime/datasources.d.ts.map +1 -1
- package/dist/runtime/datasources.js +23 -14
- package/dist/runtime/datasources.js.map +1 -1
- package/dist/runtime/index.d.ts +3 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +4 -2
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/plugin-registry.d.ts +10 -10
- package/dist/runtime/plugin-registry.d.ts.map +1 -1
- package/dist/runtime/plugin-registry.js +49 -28
- package/dist/runtime/plugin-registry.js.map +1 -1
- package/dist/runtime/time-series-queries.d.ts +5 -4
- package/dist/runtime/time-series-queries.d.ts.map +1 -1
- package/dist/runtime/time-series-queries.js +23 -28
- package/dist/runtime/time-series-queries.js.map +1 -1
- package/dist/runtime/trace-queries.d.ts +4 -3
- package/dist/runtime/trace-queries.d.ts.map +1 -1
- package/dist/runtime/trace-queries.js +2 -3
- package/dist/runtime/trace-queries.js.map +1 -1
- package/dist/runtime/{template-variables.d.ts → variables.d.ts} +4 -4
- package/dist/runtime/variables.d.ts.map +1 -0
- package/dist/runtime/{template-variables.js → variables.js} +28 -45
- package/dist/runtime/variables.js.map +1 -0
- package/dist/test/mock-data.d.ts.map +1 -1
- package/dist/test/mock-data.js +25 -4
- package/dist/test/mock-data.js.map +1 -1
- package/dist/test/render.d.ts +3 -3
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +2 -11
- package/dist/test/render.js.map +1 -1
- package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
- package/dist/test/test-plugins/bert/index.js +20 -19
- package/dist/test/test-plugins/bert/index.js.map +1 -1
- package/dist/test-utils/mock-plugin-registry.d.ts +5 -3
- package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
- package/dist/test-utils/mock-plugin-registry.js +10 -10
- package/dist/test-utils/mock-plugin-registry.js.map +1 -1
- package/dist/utils/variables.d.ts +4 -4
- package/dist/utils/variables.d.ts.map +1 -1
- package/dist/utils/variables.js +19 -19
- package/dist/utils/variables.js.map +1 -1
- package/package.json +10 -11
- package/dist/cjs/components/TraceQueryEditor/TraceQueryEditor.js +0 -143
- package/dist/cjs/components/TraceQueryEditor/TraceQueryInput.js +0 -96
- package/dist/cjs/stories/shared-utils/decorators/WithDataQueries.js +0 -41
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +0 -42
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +0 -101
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js +0 -42
- package/dist/cjs/stories/shared-utils/decorators/WithTimeRange.js +0 -41
- package/dist/cjs/stories/shared-utils/decorators/index.js +0 -35
- package/dist/cjs/validation/datasource.js +0 -30
- package/dist/cjs/validation/duration.js +0 -25
- package/dist/cjs/validation/resource.js +0 -24
- package/dist/cjs/validation/role.js +0 -86
- package/dist/cjs/validation/rolebinding.js +0 -55
- package/dist/cjs/validation/secret.js +0 -176
- package/dist/cjs/validation/user.js +0 -46
- package/dist/cjs/validation/variable.js +0 -48
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts +0 -7
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts.map +0 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +0 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts +0 -12
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts.map +0 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +0 -83
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +0 -1
- package/dist/components/TimeSeriesQueryEditor/index.d.ts +0 -2
- package/dist/components/TimeSeriesQueryEditor/index.d.ts.map +0 -1
- package/dist/components/TimeSeriesQueryEditor/index.js.map +0 -1
- package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts +0 -8
- package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts.map +0 -1
- package/dist/components/TraceQueryEditor/TraceQueryEditor.js +0 -130
- package/dist/components/TraceQueryEditor/TraceQueryEditor.js.map +0 -1
- package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts +0 -12
- package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts.map +0 -1
- package/dist/components/TraceQueryEditor/TraceQueryInput.js.map +0 -1
- package/dist/components/TraceQueryEditor/index.d.ts +0 -2
- package/dist/components/TraceQueryEditor/index.d.ts.map +0 -1
- package/dist/runtime/template-variables.d.ts.map +0 -1
- package/dist/runtime/template-variables.js.map +0 -1
- package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts +0 -12
- package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts.map +0 -1
- package/dist/stories/shared-utils/decorators/WithDataQueries.js +0 -33
- package/dist/stories/shared-utils/decorators/WithDataQueries.js.map +0 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts +0 -3
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts.map +0 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.js +0 -46
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.js.map +0 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts +0 -12
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts.map +0 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +0 -39
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js.map +0 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts +0 -12
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts.map +0 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +0 -95
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js.map +0 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts +0 -12
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts.map +0 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js +0 -39
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js.map +0 -1
- package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts +0 -12
- package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts.map +0 -1
- package/dist/stories/shared-utils/decorators/WithTimeRange.js +0 -33
- package/dist/stories/shared-utils/decorators/WithTimeRange.js.map +0 -1
- package/dist/stories/shared-utils/decorators/index.d.ts +0 -7
- package/dist/stories/shared-utils/decorators/index.d.ts.map +0 -1
- package/dist/stories/shared-utils/decorators/index.js +0 -20
- package/dist/stories/shared-utils/decorators/index.js.map +0 -1
- package/dist/stories/shared-utils/index.d.ts +0 -2
- package/dist/stories/shared-utils/index.d.ts.map +0 -1
- package/dist/stories/shared-utils/index.js.map +0 -1
- package/dist/validation/datasource.d.ts +0 -19
- package/dist/validation/datasource.d.ts.map +0 -1
- package/dist/validation/datasource.js +0 -22
- package/dist/validation/datasource.js.map +0 -1
- package/dist/validation/duration.d.ts +0 -3
- package/dist/validation/duration.d.ts.map +0 -1
- package/dist/validation/duration.js.map +0 -1
- package/dist/validation/index.d.ts +0 -6
- package/dist/validation/index.d.ts.map +0 -1
- package/dist/validation/index.js.map +0 -1
- package/dist/validation/resource.d.ts +0 -3
- package/dist/validation/resource.d.ts.map +0 -1
- package/dist/validation/resource.js +0 -16
- package/dist/validation/resource.js.map +0 -1
- package/dist/validation/role.d.ts +0 -228
- package/dist/validation/role.d.ts.map +0 -1
- package/dist/validation/role.js +0 -67
- package/dist/validation/role.js.map +0 -1
- package/dist/validation/rolebinding.d.ts +0 -137
- package/dist/validation/rolebinding.d.ts.map +0 -1
- package/dist/validation/rolebinding.js +0 -47
- package/dist/validation/rolebinding.js.map +0 -1
- package/dist/validation/secret.d.ts +0 -964
- package/dist/validation/secret.d.ts.map +0 -1
- package/dist/validation/secret.js +0 -157
- package/dist/validation/secret.js.map +0 -1
- package/dist/validation/user.d.ts +0 -93
- package/dist/validation/user.d.ts.map +0 -1
- package/dist/validation/user.js +0 -38
- package/dist/validation/user.js.map +0 -1
- package/dist/validation/variable.d.ts +0 -96
- package/dist/validation/variable.d.ts.map +0 -1
- package/dist/validation/variable.js +0 -40
- package/dist/validation/variable.js.map +0 -1
|
@@ -11,72 +11,384 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
-
import React, {
|
|
15
|
-
import { Box, Typography, Switch, TextField, Grid, FormControlLabel, MenuItem,
|
|
16
|
-
import { DiscardChangesConfirmationDialog, ErrorBoundary } from '@perses-dev/components';
|
|
17
|
-
import { Controller, FormProvider, useForm } from 'react-hook-form';
|
|
14
|
+
import React, { useState } from 'react';
|
|
15
|
+
import { Box, Typography, Switch, TextField, Grid, FormControlLabel, MenuItem, Stack, ClickAwayListener, Divider } from '@mui/material';
|
|
16
|
+
import { DiscardChangesConfirmationDialog, ErrorAlert, ErrorBoundary, FormActions } from '@perses-dev/components';
|
|
17
|
+
import { Controller, FormProvider, useForm, useFormContext, useWatch } from 'react-hook-form';
|
|
18
18
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
19
|
-
import { useImmer } from 'use-immer';
|
|
20
19
|
import { getSubmitText, getTitleAction } from '../../../utils';
|
|
21
20
|
import { VARIABLE_TYPES } from '../variable-model';
|
|
22
21
|
import { PluginEditor } from '../../PluginEditor';
|
|
23
|
-
import {
|
|
22
|
+
import { useValidationSchemas } from '../../../context';
|
|
24
23
|
import { VariableListPreview, VariablePreview } from './VariablePreview';
|
|
25
|
-
import { getVariableDefinitionFromState, getInitialState } from './variable-editor-form-model';
|
|
26
24
|
function FallbackPreview() {
|
|
27
25
|
return /*#__PURE__*/ _jsx("div", {
|
|
28
26
|
children: "Error previewing values"
|
|
29
27
|
});
|
|
30
28
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
function TextVariableEditorForm({ action, control }) {
|
|
30
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
31
|
+
children: [
|
|
32
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
33
|
+
py: 1,
|
|
34
|
+
variant: "subtitle1",
|
|
35
|
+
children: "Text Options"
|
|
36
|
+
}),
|
|
37
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
38
|
+
spacing: 2,
|
|
39
|
+
children: [
|
|
40
|
+
/*#__PURE__*/ _jsx(Controller, {
|
|
41
|
+
control: control,
|
|
42
|
+
name: "spec.value",
|
|
43
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ _jsxs(_Fragment, {
|
|
44
|
+
children: [
|
|
45
|
+
/*#__PURE__*/ _jsx(Box, {
|
|
46
|
+
children: /*#__PURE__*/ _jsx(VariablePreview, {
|
|
47
|
+
values: [
|
|
48
|
+
field.value
|
|
49
|
+
]
|
|
50
|
+
})
|
|
51
|
+
}),
|
|
52
|
+
/*#__PURE__*/ _jsx(TextField, {
|
|
53
|
+
...field,
|
|
54
|
+
label: "Value",
|
|
55
|
+
InputLabelProps: {
|
|
56
|
+
shrink: action === 'read' ? true : undefined
|
|
57
|
+
},
|
|
58
|
+
InputProps: {
|
|
59
|
+
readOnly: action === 'read'
|
|
60
|
+
},
|
|
61
|
+
error: !!fieldState.error,
|
|
62
|
+
helperText: fieldState.error?.message,
|
|
63
|
+
value: field.value ?? '',
|
|
64
|
+
onChange: (event)=>{
|
|
65
|
+
field.onChange(event);
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
})
|
|
70
|
+
}),
|
|
71
|
+
/*#__PURE__*/ _jsx(Controller, {
|
|
72
|
+
control: control,
|
|
73
|
+
name: "spec.constant",
|
|
74
|
+
render: ({ field })=>/*#__PURE__*/ _jsx(FormControlLabel, {
|
|
75
|
+
label: "Constant",
|
|
76
|
+
control: /*#__PURE__*/ _jsx(Switch, {
|
|
77
|
+
...field,
|
|
78
|
+
checked: !!field.value,
|
|
79
|
+
readOnly: action === 'read',
|
|
80
|
+
value: field.value ?? false,
|
|
81
|
+
onChange: (event)=>{
|
|
82
|
+
if (action === 'read') return; // ReadOnly prop is not blocking user interaction...
|
|
83
|
+
field.onChange(event);
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
})
|
|
88
|
+
]
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function ListVariableEditorForm({ action, control }) {
|
|
94
|
+
const form = useFormContext();
|
|
95
|
+
/** We use `previewSpec` to know when to explicitly update the
|
|
42
96
|
* spec that will be used for preview. The reason why we do this is to avoid
|
|
43
97
|
* having to re-fetch the values when the user is still editing the spec.
|
|
44
|
-
*/ const previewSpec =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
98
|
+
*/ const [previewSpec, setPreviewSpec] = useState(form.getValues());
|
|
99
|
+
const refreshPreview = ()=>{
|
|
100
|
+
setPreviewSpec(form.getValues());
|
|
101
|
+
};
|
|
102
|
+
const kind = useWatch({
|
|
103
|
+
control: control,
|
|
104
|
+
name: 'spec.plugin.kind'
|
|
105
|
+
});
|
|
106
|
+
const _allowAllValue = useWatch({
|
|
107
|
+
control: control,
|
|
108
|
+
name: 'spec.allowAllValue'
|
|
109
|
+
});
|
|
110
|
+
// When variable kind is selected we need to provide default values
|
|
111
|
+
// TODO: check if react-hook-form has a better way to do this
|
|
112
|
+
const values = form.getValues();
|
|
113
|
+
if (values.spec.allowAllValue === undefined) {
|
|
114
|
+
form.setValue('spec.allowAllValue', false);
|
|
115
|
+
}
|
|
116
|
+
if (values.spec.allowMultiple === undefined) {
|
|
117
|
+
form.setValue('spec.allowMultiple', false);
|
|
118
|
+
}
|
|
119
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
120
|
+
children: [
|
|
121
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
122
|
+
py: 1,
|
|
123
|
+
variant: "subtitle1",
|
|
124
|
+
children: "List Options"
|
|
125
|
+
}),
|
|
126
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
127
|
+
spacing: 2,
|
|
128
|
+
mb: 2,
|
|
129
|
+
children: [
|
|
130
|
+
kind ? /*#__PURE__*/ _jsx(Box, {
|
|
131
|
+
children: /*#__PURE__*/ _jsx(ErrorBoundary, {
|
|
132
|
+
FallbackComponent: FallbackPreview,
|
|
133
|
+
resetKeys: [
|
|
134
|
+
previewSpec
|
|
135
|
+
],
|
|
136
|
+
children: /*#__PURE__*/ _jsx(VariableListPreview, {
|
|
137
|
+
definition: previewSpec,
|
|
138
|
+
onRefresh: refreshPreview
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
}) : /*#__PURE__*/ _jsx(VariablePreview, {
|
|
142
|
+
isLoading: true
|
|
143
|
+
}),
|
|
144
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
145
|
+
children: [
|
|
146
|
+
/*#__PURE__*/ _jsx(ClickAwayListener, {
|
|
147
|
+
onClickAway: ()=>refreshPreview(),
|
|
148
|
+
children: /*#__PURE__*/ _jsx(Box, {})
|
|
149
|
+
}),
|
|
150
|
+
/*#__PURE__*/ _jsx(ErrorBoundary, {
|
|
151
|
+
FallbackComponent: ErrorAlert,
|
|
152
|
+
children: /*#__PURE__*/ _jsx(Controller, {
|
|
153
|
+
control: control,
|
|
154
|
+
name: "spec.plugin",
|
|
155
|
+
render: ({ field })=>/*#__PURE__*/ _jsx(PluginEditor, {
|
|
156
|
+
width: "100%",
|
|
157
|
+
pluginTypes: [
|
|
158
|
+
'Variable'
|
|
159
|
+
],
|
|
160
|
+
pluginKindLabel: "Source",
|
|
161
|
+
value: {
|
|
162
|
+
selection: {
|
|
163
|
+
type: 'Variable',
|
|
164
|
+
kind: field.value?.kind ?? 'StaticListVariable'
|
|
165
|
+
},
|
|
166
|
+
spec: field.value?.spec ?? {
|
|
167
|
+
values: []
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
isReadonly: action === 'read',
|
|
171
|
+
onChange: (v)=>{
|
|
172
|
+
field.onChange({
|
|
173
|
+
kind: v.selection.kind,
|
|
174
|
+
spec: v.spec
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
})
|
|
178
|
+
})
|
|
179
|
+
})
|
|
180
|
+
]
|
|
181
|
+
}),
|
|
182
|
+
/*#__PURE__*/ _jsx(Stack, {
|
|
183
|
+
children: /*#__PURE__*/ _jsx(Controller, {
|
|
184
|
+
control: control,
|
|
185
|
+
name: "spec.capturingRegexp",
|
|
186
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ _jsx(TextField, {
|
|
187
|
+
...field,
|
|
188
|
+
label: "Capturing Regexp Filter",
|
|
189
|
+
InputLabelProps: {
|
|
190
|
+
shrink: action === 'read' ? true : undefined
|
|
191
|
+
},
|
|
192
|
+
InputProps: {
|
|
193
|
+
readOnly: action === 'read'
|
|
194
|
+
},
|
|
195
|
+
error: !!fieldState.error,
|
|
196
|
+
value: field.value ?? '',
|
|
197
|
+
onChange: (event)=>{
|
|
198
|
+
if (event.target.value === '') {
|
|
199
|
+
field.onChange(undefined);
|
|
200
|
+
} else {
|
|
201
|
+
field.onChange(event);
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
helperText: fieldState.error?.message ? fieldState.error.message : 'Optional, if you want to filter on captured result.'
|
|
205
|
+
})
|
|
206
|
+
})
|
|
207
|
+
}),
|
|
208
|
+
/*#__PURE__*/ _jsx(Stack, {
|
|
209
|
+
children: /*#__PURE__*/ _jsx(Controller, {
|
|
210
|
+
control: control,
|
|
211
|
+
name: "spec.sort",
|
|
212
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ _jsxs(TextField, {
|
|
213
|
+
select: true,
|
|
214
|
+
...field,
|
|
215
|
+
fullWidth: true,
|
|
216
|
+
label: "Sort",
|
|
217
|
+
InputLabelProps: {
|
|
218
|
+
shrink: action === 'read' ? true : undefined
|
|
219
|
+
},
|
|
220
|
+
InputProps: {
|
|
221
|
+
readOnly: action === 'read'
|
|
222
|
+
},
|
|
223
|
+
error: !!fieldState.error,
|
|
224
|
+
helperText: fieldState.error?.message,
|
|
225
|
+
value: field.value ?? 'none',
|
|
226
|
+
onChange: (event)=>{
|
|
227
|
+
field.onChange(event);
|
|
228
|
+
},
|
|
229
|
+
children: [
|
|
230
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
231
|
+
value: "none",
|
|
232
|
+
children: "None"
|
|
233
|
+
}),
|
|
234
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
235
|
+
value: "alphabetical-asc",
|
|
236
|
+
children: "Alphabetical, asc"
|
|
237
|
+
}),
|
|
238
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
239
|
+
value: "alphabetical-desc",
|
|
240
|
+
children: "Alphabetical, desc"
|
|
241
|
+
}),
|
|
242
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
243
|
+
value: "numerical-asc",
|
|
244
|
+
children: "Numerical, asc"
|
|
245
|
+
}),
|
|
246
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
247
|
+
value: "numerical-desc",
|
|
248
|
+
children: "Numerical, desc"
|
|
249
|
+
}),
|
|
250
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
251
|
+
value: "alphabetical-ci-asc",
|
|
252
|
+
children: "Alphabetical, case-insensitive, asc"
|
|
253
|
+
}),
|
|
254
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
255
|
+
value: "alphabetical-ci-desc",
|
|
256
|
+
children: "Alphabetical, case-insensitive, desc"
|
|
257
|
+
})
|
|
258
|
+
]
|
|
259
|
+
})
|
|
260
|
+
})
|
|
261
|
+
})
|
|
262
|
+
]
|
|
263
|
+
}),
|
|
264
|
+
/*#__PURE__*/ _jsx(Divider, {}),
|
|
265
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
266
|
+
py: 1,
|
|
267
|
+
variant: "subtitle1",
|
|
268
|
+
children: "Dropdown Options"
|
|
269
|
+
}),
|
|
270
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
271
|
+
spacing: "2",
|
|
272
|
+
children: [
|
|
273
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
274
|
+
children: [
|
|
275
|
+
/*#__PURE__*/ _jsx(Controller, {
|
|
276
|
+
control: control,
|
|
277
|
+
name: "spec.allowMultiple",
|
|
278
|
+
render: ({ field })=>/*#__PURE__*/ _jsx(FormControlLabel, {
|
|
279
|
+
label: "Allow Multiple Values",
|
|
280
|
+
control: /*#__PURE__*/ _jsx(Switch, {
|
|
281
|
+
...field,
|
|
282
|
+
checked: !!field.value,
|
|
283
|
+
readOnly: action === 'read',
|
|
284
|
+
value: field.value ?? false,
|
|
285
|
+
onChange: (event)=>{
|
|
286
|
+
if (action === 'read') return; // ReadOnly prop is not blocking user interaction...
|
|
287
|
+
field.onChange(event);
|
|
288
|
+
}
|
|
289
|
+
})
|
|
290
|
+
})
|
|
291
|
+
}),
|
|
292
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
293
|
+
variant: "caption",
|
|
294
|
+
children: "Enables multiple values to be selected at the same time"
|
|
295
|
+
})
|
|
296
|
+
]
|
|
297
|
+
}),
|
|
298
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
299
|
+
children: [
|
|
300
|
+
/*#__PURE__*/ _jsx(Controller, {
|
|
301
|
+
control: control,
|
|
302
|
+
name: "spec.allowAllValue",
|
|
303
|
+
render: ({ field })=>/*#__PURE__*/ _jsx(FormControlLabel, {
|
|
304
|
+
label: "Allow All option",
|
|
305
|
+
control: /*#__PURE__*/ _jsx(Switch, {
|
|
306
|
+
...field,
|
|
307
|
+
checked: !!field.value,
|
|
308
|
+
readOnly: action === 'read',
|
|
309
|
+
value: field.value ?? false,
|
|
310
|
+
onChange: (event)=>{
|
|
311
|
+
if (action === 'read') return; // ReadOnly prop is not blocking user interaction...
|
|
312
|
+
field.onChange(event);
|
|
313
|
+
}
|
|
314
|
+
})
|
|
315
|
+
})
|
|
316
|
+
}),
|
|
317
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
318
|
+
mb: 1,
|
|
319
|
+
variant: "caption",
|
|
320
|
+
children: "Enables an option to include all variable values"
|
|
321
|
+
}),
|
|
322
|
+
_allowAllValue && /*#__PURE__*/ _jsx(Controller, {
|
|
323
|
+
control: control,
|
|
324
|
+
name: "spec.customAllValue",
|
|
325
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ _jsx(TextField, {
|
|
326
|
+
...field,
|
|
327
|
+
fullWidth: true,
|
|
328
|
+
label: "Custom All Value",
|
|
329
|
+
InputLabelProps: {
|
|
330
|
+
shrink: action === 'read' ? true : undefined
|
|
331
|
+
},
|
|
332
|
+
InputProps: {
|
|
333
|
+
readOnly: action === 'read'
|
|
334
|
+
},
|
|
335
|
+
error: !!fieldState.error,
|
|
336
|
+
helperText: fieldState.error?.message ? fieldState.error.message : 'When All is selected, this value will be used',
|
|
337
|
+
value: field.value ?? '',
|
|
338
|
+
onChange: (event)=>{
|
|
339
|
+
if (event.target.value === '') {
|
|
340
|
+
field.onChange(undefined);
|
|
341
|
+
} else {
|
|
342
|
+
field.onChange(event);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
})
|
|
346
|
+
})
|
|
347
|
+
]
|
|
348
|
+
})
|
|
349
|
+
]
|
|
350
|
+
})
|
|
351
|
+
]
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
export function VariableEditorForm({ initialVariableDefinition, action, isDraft, isReadonly, onActionChange, onSave, onClose, onDelete }) {
|
|
355
|
+
const [isDiscardDialogOpened, setDiscardDialogOpened] = useState(false);
|
|
50
356
|
const titleAction = getTitleAction(action, isDraft);
|
|
51
357
|
const submitText = getSubmitText(action, isDraft);
|
|
358
|
+
const { variableEditorSchema } = useValidationSchemas();
|
|
52
359
|
const form = useForm({
|
|
53
|
-
resolver: zodResolver(
|
|
360
|
+
resolver: zodResolver(variableEditorSchema),
|
|
54
361
|
mode: 'onBlur',
|
|
55
|
-
defaultValues:
|
|
362
|
+
defaultValues: initialVariableDefinition
|
|
56
363
|
});
|
|
57
|
-
const
|
|
364
|
+
const kind = useWatch({
|
|
365
|
+
control: form.control,
|
|
366
|
+
name: 'kind'
|
|
367
|
+
});
|
|
368
|
+
function clearFormData(data) {
|
|
369
|
+
const result = {
|
|
370
|
+
...data
|
|
371
|
+
};
|
|
372
|
+
if (result.spec.display?.name === undefined && result.spec.display?.description === undefined && result.spec.display?.hidden === undefined) {
|
|
373
|
+
delete result.spec.display;
|
|
374
|
+
}
|
|
375
|
+
return result;
|
|
376
|
+
}
|
|
377
|
+
const processForm = (data)=>{
|
|
58
378
|
// reset display attributes to undefined when empty, because we don't want to save empty strings
|
|
59
|
-
onSave(
|
|
60
|
-
...state,
|
|
61
|
-
title: state.title === '' ? undefined : state.title,
|
|
62
|
-
description: state.description === '' ? undefined : state.description
|
|
63
|
-
}));
|
|
379
|
+
onSave(clearFormData(data));
|
|
64
380
|
};
|
|
65
381
|
// When user click on cancel, several possibilities:
|
|
66
382
|
// - create action: ask for discard approval
|
|
67
383
|
// - update action: ask for discard approval if changed
|
|
68
384
|
// - read action: don´t ask for discard approval
|
|
69
|
-
|
|
70
|
-
if (JSON.stringify(
|
|
385
|
+
function handleCancel() {
|
|
386
|
+
if (JSON.stringify(initialVariableDefinition) !== JSON.stringify(clearFormData(form.getValues()))) {
|
|
71
387
|
setDiscardDialogOpened(true);
|
|
72
388
|
} else {
|
|
73
389
|
onClose();
|
|
74
390
|
}
|
|
75
|
-
}
|
|
76
|
-
initialState,
|
|
77
|
-
state,
|
|
78
|
-
onClose
|
|
79
|
-
]);
|
|
391
|
+
}
|
|
80
392
|
return /*#__PURE__*/ _jsxs(FormProvider, {
|
|
81
393
|
...form,
|
|
82
394
|
children: [
|
|
@@ -95,62 +407,15 @@ export function VariableEditorForm(props) {
|
|
|
95
407
|
" Variable"
|
|
96
408
|
]
|
|
97
409
|
}),
|
|
98
|
-
/*#__PURE__*/ _jsx(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
disabled: isReadonly,
|
|
108
|
-
variant: "contained",
|
|
109
|
-
onClick: ()=>setAction('update'),
|
|
110
|
-
children: "Edit"
|
|
111
|
-
}),
|
|
112
|
-
/*#__PURE__*/ _jsx(Button, {
|
|
113
|
-
color: "error",
|
|
114
|
-
disabled: isReadonly,
|
|
115
|
-
variant: "outlined",
|
|
116
|
-
onClick: onDelete,
|
|
117
|
-
children: "Delete"
|
|
118
|
-
}),
|
|
119
|
-
/*#__PURE__*/ _jsx(Divider, {
|
|
120
|
-
orientation: "vertical",
|
|
121
|
-
flexItem: true,
|
|
122
|
-
sx: (theme)=>({
|
|
123
|
-
borderColor: theme.palette.grey['500'],
|
|
124
|
-
'&.MuiDivider-root': {
|
|
125
|
-
marginLeft: 2,
|
|
126
|
-
marginRight: 1
|
|
127
|
-
}
|
|
128
|
-
})
|
|
129
|
-
}),
|
|
130
|
-
/*#__PURE__*/ _jsx(Button, {
|
|
131
|
-
color: "secondary",
|
|
132
|
-
variant: "outlined",
|
|
133
|
-
onClick: onClose,
|
|
134
|
-
children: "Close"
|
|
135
|
-
})
|
|
136
|
-
]
|
|
137
|
-
}) : /*#__PURE__*/ _jsxs(_Fragment, {
|
|
138
|
-
children: [
|
|
139
|
-
/*#__PURE__*/ _jsx(Button, {
|
|
140
|
-
type: "submit",
|
|
141
|
-
variant: "contained",
|
|
142
|
-
disabled: !form.formState.isValid,
|
|
143
|
-
onClick: form.handleSubmit(processForm),
|
|
144
|
-
children: submitText
|
|
145
|
-
}),
|
|
146
|
-
/*#__PURE__*/ _jsx(Button, {
|
|
147
|
-
color: "secondary",
|
|
148
|
-
variant: "outlined",
|
|
149
|
-
onClick: handleCancel,
|
|
150
|
-
children: "Cancel"
|
|
151
|
-
})
|
|
152
|
-
]
|
|
153
|
-
})
|
|
410
|
+
/*#__PURE__*/ _jsx(FormActions, {
|
|
411
|
+
action: action,
|
|
412
|
+
submitText: submitText,
|
|
413
|
+
isReadonly: isReadonly,
|
|
414
|
+
isValid: form.formState.isValid,
|
|
415
|
+
onActionChange: onActionChange,
|
|
416
|
+
onSubmit: form.handleSubmit(processForm),
|
|
417
|
+
onDelete: onDelete,
|
|
418
|
+
onCancel: handleCancel
|
|
154
419
|
})
|
|
155
420
|
]
|
|
156
421
|
}),
|
|
@@ -169,10 +434,9 @@ export function VariableEditorForm(props) {
|
|
|
169
434
|
item: true,
|
|
170
435
|
xs: 8,
|
|
171
436
|
children: /*#__PURE__*/ _jsx(Controller, {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
return /*#__PURE__*/ _jsx(TextField, {
|
|
437
|
+
control: form.control,
|
|
438
|
+
name: "spec.name",
|
|
439
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ _jsx(TextField, {
|
|
176
440
|
...field,
|
|
177
441
|
required: true,
|
|
178
442
|
fullWidth: true,
|
|
@@ -185,27 +449,21 @@ export function VariableEditorForm(props) {
|
|
|
185
449
|
readOnly: action === 'read'
|
|
186
450
|
},
|
|
187
451
|
error: !!fieldState.error,
|
|
188
|
-
helperText:
|
|
189
|
-
value:
|
|
452
|
+
helperText: fieldState.error?.message,
|
|
453
|
+
value: field.value ?? '',
|
|
190
454
|
onChange: (event)=>{
|
|
191
455
|
field.onChange(event);
|
|
192
|
-
setState((draft)=>{
|
|
193
|
-
draft.name = event.target.value;
|
|
194
|
-
});
|
|
195
456
|
}
|
|
196
|
-
})
|
|
197
|
-
}
|
|
457
|
+
})
|
|
198
458
|
})
|
|
199
459
|
}),
|
|
200
460
|
/*#__PURE__*/ _jsx(Grid, {
|
|
201
461
|
item: true,
|
|
202
462
|
xs: 4,
|
|
203
463
|
children: /*#__PURE__*/ _jsx(Controller, {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
var _state_title;
|
|
208
|
-
return _jsx(TextField, {
|
|
464
|
+
control: form.control,
|
|
465
|
+
name: "spec.display.name",
|
|
466
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ _jsx(TextField, {
|
|
209
467
|
...field,
|
|
210
468
|
fullWidth: true,
|
|
211
469
|
label: "Display Label",
|
|
@@ -216,27 +474,21 @@ export function VariableEditorForm(props) {
|
|
|
216
474
|
readOnly: action === 'read'
|
|
217
475
|
},
|
|
218
476
|
error: !!fieldState.error,
|
|
219
|
-
helperText:
|
|
220
|
-
value:
|
|
477
|
+
helperText: fieldState.error?.message,
|
|
478
|
+
value: field.value ?? '',
|
|
221
479
|
onChange: (event)=>{
|
|
222
480
|
field.onChange(event);
|
|
223
|
-
setState((draft)=>{
|
|
224
|
-
draft.title = event.target.value;
|
|
225
|
-
});
|
|
226
481
|
}
|
|
227
|
-
})
|
|
228
|
-
}
|
|
482
|
+
})
|
|
229
483
|
})
|
|
230
484
|
}),
|
|
231
485
|
/*#__PURE__*/ _jsx(Grid, {
|
|
232
486
|
item: true,
|
|
233
487
|
xs: 8,
|
|
234
488
|
children: /*#__PURE__*/ _jsx(Controller, {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
var _state_description;
|
|
239
|
-
return _jsx(TextField, {
|
|
489
|
+
control: form.control,
|
|
490
|
+
name: "spec.display.description",
|
|
491
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ _jsx(TextField, {
|
|
240
492
|
...field,
|
|
241
493
|
fullWidth: true,
|
|
242
494
|
label: "Description",
|
|
@@ -247,26 +499,21 @@ export function VariableEditorForm(props) {
|
|
|
247
499
|
readOnly: action === 'read'
|
|
248
500
|
},
|
|
249
501
|
error: !!fieldState.error,
|
|
250
|
-
helperText:
|
|
251
|
-
value:
|
|
502
|
+
helperText: fieldState.error?.message,
|
|
503
|
+
value: field.value ?? '',
|
|
252
504
|
onChange: (event)=>{
|
|
253
505
|
field.onChange(event);
|
|
254
|
-
setState((draft)=>{
|
|
255
|
-
draft.description = event.target.value;
|
|
256
|
-
});
|
|
257
506
|
}
|
|
258
|
-
})
|
|
259
|
-
}
|
|
507
|
+
})
|
|
260
508
|
})
|
|
261
509
|
}),
|
|
262
510
|
/*#__PURE__*/ _jsx(Grid, {
|
|
263
511
|
item: true,
|
|
264
512
|
xs: 4,
|
|
265
513
|
children: /*#__PURE__*/ _jsx(Controller, {
|
|
514
|
+
control: form.control,
|
|
266
515
|
name: "kind",
|
|
267
|
-
render: ({ field, fieldState })
|
|
268
|
-
var _fieldState_error;
|
|
269
|
-
return /*#__PURE__*/ _jsx(TextField, {
|
|
516
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ _jsx(TextField, {
|
|
270
517
|
select: true,
|
|
271
518
|
...field,
|
|
272
519
|
fullWidth: true,
|
|
@@ -278,332 +525,34 @@ export function VariableEditorForm(props) {
|
|
|
278
525
|
readOnly: action === 'read'
|
|
279
526
|
},
|
|
280
527
|
error: !!fieldState.error,
|
|
281
|
-
helperText:
|
|
282
|
-
value:
|
|
528
|
+
helperText: fieldState.error?.message,
|
|
529
|
+
value: field.value ?? 'TextVariable',
|
|
283
530
|
onChange: (event)=>{
|
|
284
531
|
field.onChange(event);
|
|
285
|
-
setState((draft)=>{
|
|
286
|
-
draft.kind = event.target.value;
|
|
287
|
-
});
|
|
288
532
|
},
|
|
289
533
|
children: VARIABLE_TYPES.map((v)=>/*#__PURE__*/ _jsx(MenuItem, {
|
|
290
534
|
value: v.kind,
|
|
291
535
|
children: v.label
|
|
292
536
|
}, v.kind))
|
|
293
|
-
})
|
|
294
|
-
}
|
|
537
|
+
})
|
|
295
538
|
})
|
|
296
539
|
})
|
|
297
540
|
]
|
|
298
541
|
}),
|
|
299
542
|
/*#__PURE__*/ _jsx(Divider, {}),
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
}),
|
|
307
|
-
/*#__PURE__*/ _jsxs(Stack, {
|
|
308
|
-
spacing: 2,
|
|
309
|
-
children: [
|
|
310
|
-
/*#__PURE__*/ _jsx(Box, {
|
|
311
|
-
children: /*#__PURE__*/ _jsx(VariablePreview, {
|
|
312
|
-
values: [
|
|
313
|
-
state.textVariableFields.value
|
|
314
|
-
]
|
|
315
|
-
})
|
|
316
|
-
}),
|
|
317
|
-
/*#__PURE__*/ _jsx(Controller, {
|
|
318
|
-
name: "textVariableFields.value",
|
|
319
|
-
render: ({ field, fieldState })=>{
|
|
320
|
-
var _fieldState_error;
|
|
321
|
-
return /*#__PURE__*/ _jsx(TextField, {
|
|
322
|
-
...field,
|
|
323
|
-
label: "Value",
|
|
324
|
-
InputLabelProps: {
|
|
325
|
-
shrink: action === 'read' ? true : undefined
|
|
326
|
-
},
|
|
327
|
-
InputProps: {
|
|
328
|
-
readOnly: action === 'read'
|
|
329
|
-
},
|
|
330
|
-
error: !!fieldState.error,
|
|
331
|
-
helperText: (_fieldState_error = fieldState.error) === null || _fieldState_error === void 0 ? void 0 : _fieldState_error.message,
|
|
332
|
-
value: state.textVariableFields.value,
|
|
333
|
-
onChange: (event)=>{
|
|
334
|
-
field.onChange(event);
|
|
335
|
-
setState((draft)=>{
|
|
336
|
-
draft.textVariableFields.value = event.target.value;
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
}),
|
|
342
|
-
/*#__PURE__*/ _jsx(Controller, {
|
|
343
|
-
name: "textVariableFields.constant",
|
|
344
|
-
render: ({ field })=>/*#__PURE__*/ _jsx(FormControlLabel, {
|
|
345
|
-
label: "Constant",
|
|
346
|
-
control: /*#__PURE__*/ _jsx(Switch, {
|
|
347
|
-
...field,
|
|
348
|
-
checked: !!field.value,
|
|
349
|
-
readOnly: action === 'read',
|
|
350
|
-
value: state.textVariableFields.constant,
|
|
351
|
-
onChange: (event)=>{
|
|
352
|
-
if (action === 'read') return; // ReadOnly prop is not blocking user interaction...
|
|
353
|
-
field.onChange(event);
|
|
354
|
-
setState((draft)=>{
|
|
355
|
-
draft.textVariableFields.constant = event.target.checked;
|
|
356
|
-
});
|
|
357
|
-
}
|
|
358
|
-
})
|
|
359
|
-
})
|
|
360
|
-
})
|
|
361
|
-
]
|
|
362
|
-
})
|
|
363
|
-
]
|
|
543
|
+
kind === 'TextVariable' && /*#__PURE__*/ _jsx(ErrorBoundary, {
|
|
544
|
+
FallbackComponent: ErrorAlert,
|
|
545
|
+
children: /*#__PURE__*/ _jsx(TextVariableEditorForm, {
|
|
546
|
+
action: action,
|
|
547
|
+
control: form.control
|
|
548
|
+
})
|
|
364
549
|
}),
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
}),
|
|
372
|
-
/*#__PURE__*/ _jsxs(Stack, {
|
|
373
|
-
spacing: 2,
|
|
374
|
-
mb: 2,
|
|
375
|
-
children: [
|
|
376
|
-
state.listVariableFields.plugin.kind ? /*#__PURE__*/ _jsx(Box, {
|
|
377
|
-
children: /*#__PURE__*/ _jsx(ErrorBoundary, {
|
|
378
|
-
FallbackComponent: FallbackPreview,
|
|
379
|
-
resetKeys: [
|
|
380
|
-
previewSpec
|
|
381
|
-
],
|
|
382
|
-
children: /*#__PURE__*/ _jsx(VariableListPreview, {
|
|
383
|
-
definition: previewSpec,
|
|
384
|
-
onRefresh: refreshPreview
|
|
385
|
-
})
|
|
386
|
-
})
|
|
387
|
-
}) : /*#__PURE__*/ _jsx(VariablePreview, {
|
|
388
|
-
isLoading: true
|
|
389
|
-
}),
|
|
390
|
-
/*#__PURE__*/ _jsxs(Stack, {
|
|
391
|
-
children: [
|
|
392
|
-
/*#__PURE__*/ _jsx(ClickAwayListener, {
|
|
393
|
-
onClickAway: ()=>refreshPreview(),
|
|
394
|
-
children: /*#__PURE__*/ _jsx(Box, {})
|
|
395
|
-
}),
|
|
396
|
-
/*#__PURE__*/ _jsx(Controller, {
|
|
397
|
-
name: "listVariableFields.plugin",
|
|
398
|
-
render: ({ field })=>/*#__PURE__*/ _jsx(PluginEditor, {
|
|
399
|
-
width: "100%",
|
|
400
|
-
pluginType: "Variable",
|
|
401
|
-
pluginKindLabel: "Source",
|
|
402
|
-
isReadonly: action === 'read',
|
|
403
|
-
value: state.listVariableFields.plugin,
|
|
404
|
-
onChange: (val)=>{
|
|
405
|
-
field.onChange(val);
|
|
406
|
-
setState((draft)=>{
|
|
407
|
-
draft.listVariableFields.plugin = val;
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
})
|
|
411
|
-
})
|
|
412
|
-
]
|
|
413
|
-
}),
|
|
414
|
-
/*#__PURE__*/ _jsx(Stack, {
|
|
415
|
-
children: /*#__PURE__*/ _jsx(Controller, {
|
|
416
|
-
name: "listVariableFields.capturingRegexp",
|
|
417
|
-
render: ({ field, fieldState })=>/*#__PURE__*/ {
|
|
418
|
-
var _fieldState_error;
|
|
419
|
-
var _state_listVariableFields_capturingRegexp;
|
|
420
|
-
return _jsx(TextField, {
|
|
421
|
-
...field,
|
|
422
|
-
label: "Capturing Regexp Filter",
|
|
423
|
-
InputLabelProps: {
|
|
424
|
-
shrink: action === 'read' ? true : undefined
|
|
425
|
-
},
|
|
426
|
-
InputProps: {
|
|
427
|
-
readOnly: action === 'read'
|
|
428
|
-
},
|
|
429
|
-
error: !!fieldState.error,
|
|
430
|
-
value: (_state_listVariableFields_capturingRegexp = state.listVariableFields.capturingRegexp) !== null && _state_listVariableFields_capturingRegexp !== void 0 ? _state_listVariableFields_capturingRegexp : '',
|
|
431
|
-
onChange: (event)=>{
|
|
432
|
-
field.onChange(event);
|
|
433
|
-
setState((draft)=>{
|
|
434
|
-
if (event.target.value) {
|
|
435
|
-
// TODO: do a better fix, if empty string => it should skip the filter
|
|
436
|
-
draft.listVariableFields.capturingRegexp = event.target.value;
|
|
437
|
-
} else {
|
|
438
|
-
draft.listVariableFields.capturingRegexp = undefined;
|
|
439
|
-
}
|
|
440
|
-
});
|
|
441
|
-
},
|
|
442
|
-
helperText: ((_fieldState_error = fieldState.error) === null || _fieldState_error === void 0 ? void 0 : _fieldState_error.message) ? fieldState.error.message : 'Optional, if you want to filter on captured result.'
|
|
443
|
-
});
|
|
444
|
-
}
|
|
445
|
-
})
|
|
446
|
-
}),
|
|
447
|
-
/*#__PURE__*/ _jsx(Stack, {
|
|
448
|
-
children: /*#__PURE__*/ _jsx(Controller, {
|
|
449
|
-
name: "listVariableFields.sort",
|
|
450
|
-
render: ({ field, fieldState })=>/*#__PURE__*/ {
|
|
451
|
-
var _fieldState_error;
|
|
452
|
-
var _state_listVariableFields_sort;
|
|
453
|
-
return _jsxs(TextField, {
|
|
454
|
-
select: true,
|
|
455
|
-
...field,
|
|
456
|
-
fullWidth: true,
|
|
457
|
-
label: "Sort",
|
|
458
|
-
InputLabelProps: {
|
|
459
|
-
shrink: action === 'read' ? true : undefined
|
|
460
|
-
},
|
|
461
|
-
InputProps: {
|
|
462
|
-
readOnly: action === 'read'
|
|
463
|
-
},
|
|
464
|
-
error: !!fieldState.error,
|
|
465
|
-
helperText: (_fieldState_error = fieldState.error) === null || _fieldState_error === void 0 ? void 0 : _fieldState_error.message,
|
|
466
|
-
value: (_state_listVariableFields_sort = state.listVariableFields.sort) !== null && _state_listVariableFields_sort !== void 0 ? _state_listVariableFields_sort : 'none',
|
|
467
|
-
onChange: (event)=>{
|
|
468
|
-
field.onChange(event);
|
|
469
|
-
setState((draft)=>{
|
|
470
|
-
draft.listVariableFields.sort = event.target.value;
|
|
471
|
-
});
|
|
472
|
-
},
|
|
473
|
-
children: [
|
|
474
|
-
/*#__PURE__*/ _jsx(MenuItem, {
|
|
475
|
-
value: "none",
|
|
476
|
-
children: "None"
|
|
477
|
-
}),
|
|
478
|
-
/*#__PURE__*/ _jsx(MenuItem, {
|
|
479
|
-
value: "alphabetical-asc",
|
|
480
|
-
children: "Alphabetical, asc"
|
|
481
|
-
}),
|
|
482
|
-
/*#__PURE__*/ _jsx(MenuItem, {
|
|
483
|
-
value: "alphabetical-desc",
|
|
484
|
-
children: "Alphabetical, desc"
|
|
485
|
-
}),
|
|
486
|
-
/*#__PURE__*/ _jsx(MenuItem, {
|
|
487
|
-
value: "numerical-asc",
|
|
488
|
-
children: "Numerical, asc"
|
|
489
|
-
}),
|
|
490
|
-
/*#__PURE__*/ _jsx(MenuItem, {
|
|
491
|
-
value: "numerical-desc",
|
|
492
|
-
children: "Numerical, desc"
|
|
493
|
-
}),
|
|
494
|
-
/*#__PURE__*/ _jsx(MenuItem, {
|
|
495
|
-
value: "alphabetical-ci-asc",
|
|
496
|
-
children: "Alphabetical, case-insensitive, asc"
|
|
497
|
-
}),
|
|
498
|
-
/*#__PURE__*/ _jsx(MenuItem, {
|
|
499
|
-
value: "alphabetical-ci-desc",
|
|
500
|
-
children: "Alphabetical, case-insensitive, desc"
|
|
501
|
-
})
|
|
502
|
-
]
|
|
503
|
-
});
|
|
504
|
-
}
|
|
505
|
-
})
|
|
506
|
-
})
|
|
507
|
-
]
|
|
508
|
-
}),
|
|
509
|
-
/*#__PURE__*/ _jsx(Divider, {}),
|
|
510
|
-
/*#__PURE__*/ _jsx(Typography, {
|
|
511
|
-
py: 1,
|
|
512
|
-
variant: "subtitle1",
|
|
513
|
-
children: "Dropdown Options"
|
|
514
|
-
}),
|
|
515
|
-
/*#__PURE__*/ _jsxs(Stack, {
|
|
516
|
-
spacing: "2",
|
|
517
|
-
children: [
|
|
518
|
-
/*#__PURE__*/ _jsxs(Stack, {
|
|
519
|
-
children: [
|
|
520
|
-
/*#__PURE__*/ _jsx(Controller, {
|
|
521
|
-
name: "listVariableFields.allowMultiple",
|
|
522
|
-
render: ({ field })=>/*#__PURE__*/ _jsx(FormControlLabel, {
|
|
523
|
-
label: "Allow Multiple Values",
|
|
524
|
-
control: /*#__PURE__*/ _jsx(Switch, {
|
|
525
|
-
...field,
|
|
526
|
-
checked: !!field.value,
|
|
527
|
-
readOnly: action === 'read',
|
|
528
|
-
value: state.listVariableFields.allowMultiple,
|
|
529
|
-
onChange: (event)=>{
|
|
530
|
-
if (action === 'read') return; // ReadOnly prop is not blocking user interaction...
|
|
531
|
-
field.onChange(event);
|
|
532
|
-
setState((draft)=>{
|
|
533
|
-
draft.listVariableFields.allowMultiple = event.target.checked;
|
|
534
|
-
});
|
|
535
|
-
}
|
|
536
|
-
})
|
|
537
|
-
})
|
|
538
|
-
}),
|
|
539
|
-
/*#__PURE__*/ _jsx(Typography, {
|
|
540
|
-
variant: "caption",
|
|
541
|
-
children: "Enables multiple values to be selected at the same time"
|
|
542
|
-
})
|
|
543
|
-
]
|
|
544
|
-
}),
|
|
545
|
-
/*#__PURE__*/ _jsxs(Stack, {
|
|
546
|
-
children: [
|
|
547
|
-
/*#__PURE__*/ _jsx(Controller, {
|
|
548
|
-
name: "listVariableFields.allowAllValue",
|
|
549
|
-
render: ({ field })=>/*#__PURE__*/ _jsx(FormControlLabel, {
|
|
550
|
-
label: "Allow All option",
|
|
551
|
-
control: /*#__PURE__*/ _jsx(Switch, {
|
|
552
|
-
...field,
|
|
553
|
-
checked: !!field.value,
|
|
554
|
-
readOnly: action === 'read',
|
|
555
|
-
value: state.listVariableFields.allowAllValue,
|
|
556
|
-
onChange: (event)=>{
|
|
557
|
-
if (action === 'read') return; // ReadOnly prop is not blocking user interaction...
|
|
558
|
-
field.onChange(event);
|
|
559
|
-
setState((draft)=>{
|
|
560
|
-
draft.listVariableFields.allowAllValue = event.target.checked;
|
|
561
|
-
});
|
|
562
|
-
}
|
|
563
|
-
})
|
|
564
|
-
})
|
|
565
|
-
}),
|
|
566
|
-
/*#__PURE__*/ _jsx(Typography, {
|
|
567
|
-
mb: 1,
|
|
568
|
-
variant: "caption",
|
|
569
|
-
children: "Enables an option to include all variable values"
|
|
570
|
-
}),
|
|
571
|
-
state.listVariableFields.allowAllValue && /*#__PURE__*/ _jsx(Controller, {
|
|
572
|
-
name: "listVariableFields.customAllValue",
|
|
573
|
-
render: ({ field, fieldState })=>/*#__PURE__*/ {
|
|
574
|
-
var _fieldState_error;
|
|
575
|
-
var _state_listVariableFields_customAllValue;
|
|
576
|
-
return _jsx(TextField, {
|
|
577
|
-
...field,
|
|
578
|
-
fullWidth: true,
|
|
579
|
-
label: "Custom All Value",
|
|
580
|
-
InputLabelProps: {
|
|
581
|
-
shrink: action === 'read' ? true : undefined
|
|
582
|
-
},
|
|
583
|
-
InputProps: {
|
|
584
|
-
readOnly: action === 'read'
|
|
585
|
-
},
|
|
586
|
-
error: !!fieldState.error,
|
|
587
|
-
helperText: ((_fieldState_error = fieldState.error) === null || _fieldState_error === void 0 ? void 0 : _fieldState_error.message) ? fieldState.error.message : 'When All is selected, this value will be used',
|
|
588
|
-
value: (_state_listVariableFields_customAllValue = state.listVariableFields.customAllValue) !== null && _state_listVariableFields_customAllValue !== void 0 ? _state_listVariableFields_customAllValue : '',
|
|
589
|
-
onChange: (event)=>{
|
|
590
|
-
field.onChange(event);
|
|
591
|
-
setState((draft)=>{
|
|
592
|
-
if (event.target.value) {
|
|
593
|
-
draft.listVariableFields.customAllValue = event.target.value;
|
|
594
|
-
} else {
|
|
595
|
-
draft.listVariableFields.customAllValue = undefined;
|
|
596
|
-
}
|
|
597
|
-
});
|
|
598
|
-
}
|
|
599
|
-
});
|
|
600
|
-
}
|
|
601
|
-
})
|
|
602
|
-
]
|
|
603
|
-
})
|
|
604
|
-
]
|
|
605
|
-
})
|
|
606
|
-
]
|
|
550
|
+
kind === 'ListVariable' && /*#__PURE__*/ _jsx(ErrorBoundary, {
|
|
551
|
+
FallbackComponent: ErrorAlert,
|
|
552
|
+
children: /*#__PURE__*/ _jsx(ListVariableEditorForm, {
|
|
553
|
+
action: action,
|
|
554
|
+
control: form.control
|
|
555
|
+
})
|
|
607
556
|
})
|
|
608
557
|
]
|
|
609
558
|
}),
|