@perses-dev/plugin-system 0.0.0-snapshot-ts-panel-actions-76080ec → 0.0.0-snapshot-reverse-proxy-75afbd7
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 +1 -0
- package/dist/cjs/components/{DatasourceSelect.js → DatasourceSelect/DatasourceSelect.js} +4 -3
- package/dist/cjs/components/DatasourceSelect/index.js +30 -0
- package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +117 -90
- package/dist/cjs/components/MultiQueryEditor/MultiQueryEditor.js +5 -2
- package/dist/cjs/components/MultiQueryEditor/QueryEditorContainer.js +14 -4
- package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +7 -5
- package/dist/cjs/components/PluginEditor/PluginEditor.js +57 -17
- package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +6 -3
- package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +13 -9
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +62 -120
- package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +42 -33
- package/dist/cjs/components/Variables/VariableEditorForm/index.js +1 -0
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +47 -0
- package/dist/cjs/components/Variables/variable-model.js +3 -3
- package/dist/cjs/components/index.js +0 -1
- package/dist/cjs/context/index.js +0 -1
- package/dist/cjs/model/legend.js +13 -0
- package/dist/cjs/model/log-queries.js +16 -0
- package/dist/cjs/remote/PluginRuntime.js +3 -2
- package/dist/cjs/remote/remotePluginLoader.js +19 -4
- package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +10 -2
- package/dist/cjs/runtime/DataQueriesProvider/model.js +17 -4
- package/dist/cjs/runtime/RouterProvider.js +114 -0
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +6 -1
- package/dist/cjs/runtime/UsageMetricsProvider.js +4 -3
- package/dist/cjs/runtime/index.js +1 -0
- package/dist/cjs/runtime/log-queries.js +68 -0
- package/dist/cjs/runtime/time-series-queries.js +4 -4
- package/dist/cjs/runtime/variables.js +15 -0
- package/dist/cjs/test/mock-data.js +182 -0
- package/dist/cjs/test/utils.js +17 -8
- package/dist/cjs/utils/variables.js +109 -14
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +1 -0
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
- package/dist/components/{DatasourceSelect.d.ts → DatasourceSelect/DatasourceSelect.d.ts} +1 -1
- package/dist/components/DatasourceSelect/DatasourceSelect.d.ts.map +1 -0
- package/dist/components/{DatasourceSelect.js → DatasourceSelect/DatasourceSelect.js} +4 -3
- package/dist/components/DatasourceSelect/DatasourceSelect.js.map +1 -0
- package/dist/components/DatasourceSelect/index.d.ts +2 -0
- package/dist/components/DatasourceSelect/index.d.ts.map +1 -0
- package/dist/components/DatasourceSelect/index.js +15 -0
- package/dist/components/DatasourceSelect/index.js.map +1 -0
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +2 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +120 -93
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
- package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +3 -2
- package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -1
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js +6 -3
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -1
- package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +3 -2
- package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -1
- package/dist/components/MultiQueryEditor/QueryEditorContainer.js +14 -4
- package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +3 -2
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js +7 -5
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.d.ts +3 -3
- package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.js +57 -17
- package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.d.ts +5 -0
- package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.js +7 -4
- package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js +13 -9
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +63 -80
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +2 -2
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js +43 -34
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/index.d.ts +1 -0
- package/dist/components/Variables/VariableEditorForm/index.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/index.js +1 -0
- package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +6 -0
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +44 -0
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
- package/dist/components/Variables/variable-model.js +3 -3
- package/dist/components/Variables/variable-model.js.map +1 -1
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +0 -1
- package/dist/components/index.js.map +1 -1
- package/dist/context/index.d.ts +0 -1
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +0 -1
- package/dist/context/index.js.map +1 -1
- package/dist/model/legend.d.ts +3 -1
- package/dist/model/legend.d.ts.map +1 -1
- package/dist/model/legend.js +10 -0
- package/dist/model/legend.js.map +1 -1
- package/dist/model/log-queries.d.ts +24 -0
- package/dist/model/log-queries.d.ts.map +1 -0
- package/dist/model/log-queries.js +15 -0
- package/dist/model/log-queries.js.map +1 -0
- package/dist/model/plugin-base.d.ts +6 -1
- 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 +2 -0
- 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 +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/variables.d.ts +1 -1
- package/dist/model/variables.d.ts.map +1 -1
- package/dist/model/variables.js.map +1 -1
- package/dist/remote/PluginRuntime.d.ts +2 -2
- package/dist/remote/PluginRuntime.d.ts.map +1 -1
- package/dist/remote/PluginRuntime.js +4 -3
- package/dist/remote/PluginRuntime.js.map +1 -1
- package/dist/remote/remotePluginLoader.d.ts +18 -1
- package/dist/remote/remotePluginLoader.d.ts.map +1 -1
- package/dist/remote/remotePluginLoader.js +22 -4
- package/dist/remote/remotePluginLoader.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +10 -2
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.js +17 -4
- package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
- package/dist/runtime/RouterProvider.d.ts +32 -0
- package/dist/runtime/RouterProvider.d.ts.map +1 -0
- package/dist/runtime/RouterProvider.js +59 -0
- package/dist/runtime/RouterProvider.js.map +1 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +6 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
- package/dist/runtime/UsageMetricsProvider.d.ts +3 -1
- package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -1
- package/dist/runtime/UsageMetricsProvider.js +4 -3
- package/dist/runtime/UsageMetricsProvider.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/log-queries.d.ts +7 -0
- package/dist/runtime/log-queries.d.ts.map +1 -0
- package/dist/runtime/log-queries.js +52 -0
- package/dist/runtime/log-queries.js.map +1 -0
- package/dist/runtime/time-series-queries.d.ts.map +1 -1
- package/dist/runtime/time-series-queries.js +4 -4
- package/dist/runtime/time-series-queries.js.map +1 -1
- package/dist/runtime/variables.d.ts +1 -0
- package/dist/runtime/variables.d.ts.map +1 -1
- package/dist/runtime/variables.js +13 -0
- package/dist/runtime/variables.js.map +1 -1
- package/dist/test/mock-data.d.ts +136 -1
- package/dist/test/mock-data.d.ts.map +1 -1
- package/dist/test/mock-data.js +156 -0
- package/dist/test/mock-data.js.map +1 -1
- package/dist/test/utils.d.ts.map +1 -1
- package/dist/test/utils.js +17 -8
- package/dist/test/utils.js.map +1 -1
- package/dist/utils/variables.d.ts +24 -2
- package/dist/utils/variables.d.ts.map +1 -1
- package/dist/utils/variables.js +102 -14
- package/dist/utils/variables.js.map +1 -1
- package/package.json +7 -7
- package/dist/cjs/components/ProjectSelect.js +0 -96
- package/dist/cjs/context/ProjectStoreProvider.js +0 -81
- package/dist/cjs/context/query-params.js +0 -49
- package/dist/components/DatasourceSelect.d.ts.map +0 -1
- package/dist/components/DatasourceSelect.js.map +0 -1
- package/dist/components/ProjectSelect.d.ts +0 -15
- package/dist/components/ProjectSelect.d.ts.map +0 -1
- package/dist/components/ProjectSelect.js +0 -91
- package/dist/components/ProjectSelect.js.map +0 -1
- package/dist/context/ProjectStoreProvider.d.ts +0 -16
- package/dist/context/ProjectStoreProvider.d.ts.map +0 -1
- package/dist/context/ProjectStoreProvider.js +0 -59
- package/dist/context/ProjectStoreProvider.js.map +0 -1
- package/dist/context/query-params.d.ts +0 -5
- package/dist/context/query-params.d.ts.map +0 -1
- package/dist/context/query-params.js +0 -41
- package/dist/context/query-params.js.map +0 -1
|
@@ -10,36 +10,25 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
import { Switch } from '@mui/material';
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
+
import { Switch, ToggleButtonGroup, ToggleButton } from '@mui/material';
|
|
15
15
|
import { DEFAULT_LEGEND, getLegendMode, getLegendPosition, getLegendSize } from '@perses-dev/core';
|
|
16
16
|
import { ErrorAlert, OptionsEditorControl, OptionsEditorGroup, SettingsAutocomplete } from '@perses-dev/components';
|
|
17
|
-
import {
|
|
17
|
+
import { useMemo } from 'react';
|
|
18
|
+
import { LEGEND_MODE_CONFIG, LEGEND_POSITIONS_CONFIG, validateLegendSpec, LEGEND_VALUE_CONFIG, LEGEND_SIZE_CONFIG, comparisonLegends } from '../../model';
|
|
18
19
|
const POSITION_OPTIONS = Object.entries(LEGEND_POSITIONS_CONFIG).map(([id, config])=>{
|
|
19
20
|
return {
|
|
20
21
|
id: id,
|
|
21
22
|
...config
|
|
22
23
|
};
|
|
23
24
|
});
|
|
24
|
-
const MODE_OPTIONS = Object.entries(LEGEND_MODE_CONFIG).map(([id, config])=>{
|
|
25
|
-
return {
|
|
26
|
-
id: id,
|
|
27
|
-
...config
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
25
|
const SIZE_OPTIONS = Object.entries(LEGEND_SIZE_CONFIG).map(([id, config])=>{
|
|
31
26
|
return {
|
|
32
27
|
id: id,
|
|
33
28
|
...config
|
|
34
29
|
};
|
|
35
30
|
});
|
|
36
|
-
|
|
37
|
-
return {
|
|
38
|
-
id: id,
|
|
39
|
-
...config
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
export function LegendOptionsEditor({ value, onChange, showValuesEditor = true }) {
|
|
31
|
+
export function LegendOptionsEditor({ value, onChange, showValuesEditor = true, calculation = 'aggregation' }) {
|
|
43
32
|
const handleLegendShowChange = (_, checked)=>{
|
|
44
33
|
// legend is hidden when legend obj is undefined
|
|
45
34
|
const legendValue = checked === true ? {
|
|
@@ -53,13 +42,6 @@ export function LegendOptionsEditor({ value, onChange, showValuesEditor = true }
|
|
|
53
42
|
position: newValue.id
|
|
54
43
|
});
|
|
55
44
|
};
|
|
56
|
-
const handleLegendModeChange = (_, newValue)=>{
|
|
57
|
-
onChange({
|
|
58
|
-
...value,
|
|
59
|
-
position: currentPosition,
|
|
60
|
-
mode: newValue.id
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
45
|
const handleLegendSizeChange = (_, newValue)=>{
|
|
64
46
|
onChange({
|
|
65
47
|
...value,
|
|
@@ -80,20 +62,51 @@ export function LegendOptionsEditor({ value, onChange, showValuesEditor = true }
|
|
|
80
62
|
const currentPosition = getLegendPosition(value?.position);
|
|
81
63
|
const legendPositionConfig = LEGEND_POSITIONS_CONFIG[currentPosition];
|
|
82
64
|
const currentMode = getLegendMode(value?.mode);
|
|
83
|
-
const legendModeConfig = LEGEND_MODE_CONFIG[currentMode];
|
|
84
65
|
const currentSize = getLegendSize(value?.size);
|
|
85
66
|
const legendSizeConfig = LEGEND_SIZE_CONFIG[currentSize];
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if (
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
67
|
+
const legendValuesConfig = useMemo(()=>{
|
|
68
|
+
const currentValues = value?.values;
|
|
69
|
+
if (!currentValues?.length) return [];
|
|
70
|
+
if (calculation === 'aggregation') {
|
|
71
|
+
return currentValues.reduce((result, item)=>{
|
|
72
|
+
const config = LEGEND_VALUE_CONFIG[item];
|
|
73
|
+
if (config) {
|
|
74
|
+
result.push({
|
|
75
|
+
...config,
|
|
76
|
+
id: item
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return result;
|
|
80
|
+
}, []);
|
|
81
|
+
}
|
|
82
|
+
return currentValues.map((id)=>{
|
|
83
|
+
const { label, description } = comparisonLegends[id];
|
|
84
|
+
return {
|
|
85
|
+
id,
|
|
86
|
+
label,
|
|
87
|
+
description
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
}, [
|
|
91
|
+
calculation,
|
|
92
|
+
value?.values
|
|
93
|
+
]);
|
|
94
|
+
const valueOptions = useMemo(()=>{
|
|
95
|
+
if (calculation === 'aggregation') {
|
|
96
|
+
return Object.entries(LEGEND_VALUE_CONFIG || {}).map(([id, config])=>{
|
|
97
|
+
return {
|
|
98
|
+
id: id,
|
|
99
|
+
...config
|
|
100
|
+
};
|
|
93
101
|
});
|
|
94
102
|
}
|
|
95
|
-
return
|
|
96
|
-
|
|
103
|
+
return Object.entries(comparisonLegends).map(([id, config])=>({
|
|
104
|
+
id: id,
|
|
105
|
+
...config
|
|
106
|
+
}));
|
|
107
|
+
}, [
|
|
108
|
+
calculation
|
|
109
|
+
]);
|
|
97
110
|
return /*#__PURE__*/ _jsxs(OptionsEditorGroup, {
|
|
98
111
|
title: "Legend",
|
|
99
112
|
children: [
|
|
@@ -106,69 +119,83 @@ export function LegendOptionsEditor({ value, onChange, showValuesEditor = true }
|
|
|
106
119
|
/*#__PURE__*/ _jsx(OptionsEditorControl, {
|
|
107
120
|
label: "Show",
|
|
108
121
|
control: /*#__PURE__*/ _jsx(Switch, {
|
|
109
|
-
checked: value
|
|
122
|
+
checked: !!value,
|
|
110
123
|
onChange: handleLegendShowChange
|
|
111
124
|
})
|
|
112
125
|
}),
|
|
113
|
-
/*#__PURE__*/
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
126
|
+
value && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
127
|
+
children: [
|
|
128
|
+
/*#__PURE__*/ _jsx(OptionsEditorControl, {
|
|
129
|
+
label: "Position",
|
|
130
|
+
control: /*#__PURE__*/ _jsx(SettingsAutocomplete, {
|
|
131
|
+
value: {
|
|
132
|
+
...legendPositionConfig,
|
|
133
|
+
id: currentPosition
|
|
134
|
+
},
|
|
135
|
+
options: POSITION_OPTIONS,
|
|
136
|
+
onChange: handleLegendPositionChange,
|
|
137
|
+
disableClearable: true
|
|
138
|
+
})
|
|
139
|
+
}),
|
|
140
|
+
/*#__PURE__*/ _jsx(OptionsEditorControl, {
|
|
141
|
+
label: "Mode",
|
|
142
|
+
control: /*#__PURE__*/ _jsx(ToggleButtonGroup, {
|
|
143
|
+
color: "primary",
|
|
144
|
+
exclusive: true,
|
|
145
|
+
value: currentMode,
|
|
146
|
+
"aria-label": "Mode",
|
|
147
|
+
onChange: (__, newValue)=>{
|
|
148
|
+
onChange({
|
|
149
|
+
...value,
|
|
150
|
+
position: currentPosition,
|
|
151
|
+
mode: newValue
|
|
152
|
+
});
|
|
153
|
+
},
|
|
154
|
+
children: Object.entries(LEGEND_MODE_CONFIG).map(([modeId, config])=>/*#__PURE__*/ _jsx(ToggleButton, {
|
|
155
|
+
value: modeId,
|
|
156
|
+
selected: currentMode === modeId,
|
|
157
|
+
"aria-label": `display ${modeId} mode`,
|
|
158
|
+
children: config.label
|
|
159
|
+
}, modeId))
|
|
160
|
+
})
|
|
161
|
+
}),
|
|
162
|
+
currentMode === 'table' && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
163
|
+
children: [
|
|
164
|
+
/*#__PURE__*/ _jsx(OptionsEditorControl, {
|
|
165
|
+
label: "Size",
|
|
166
|
+
control: /*#__PURE__*/ _jsx(SettingsAutocomplete, {
|
|
167
|
+
value: {
|
|
168
|
+
...legendSizeConfig,
|
|
169
|
+
id: currentSize
|
|
170
|
+
},
|
|
171
|
+
options: SIZE_OPTIONS,
|
|
172
|
+
onChange: handleLegendSizeChange,
|
|
173
|
+
// TODO: enable sizes for list mode when we normalize the layout of
|
|
174
|
+
// lists to more closely match tables.
|
|
175
|
+
disableClearable: true
|
|
176
|
+
})
|
|
177
|
+
}),
|
|
178
|
+
showValuesEditor && /*#__PURE__*/ _jsx(OptionsEditorControl, {
|
|
179
|
+
label: "Values",
|
|
180
|
+
control: // For some reason, the inferred option type doesn't always seem to work
|
|
181
|
+
// quite right when `multiple` is true. Explicitly setting the generics
|
|
182
|
+
// to work around this.
|
|
183
|
+
/*#__PURE__*/ _jsx(SettingsAutocomplete, {
|
|
184
|
+
multiple: true,
|
|
185
|
+
disableCloseOnSelect: true,
|
|
186
|
+
disableClearable: true,
|
|
187
|
+
value: legendValuesConfig,
|
|
188
|
+
options: valueOptions,
|
|
189
|
+
onChange: handleLegendValueChange,
|
|
190
|
+
limitTags: 1,
|
|
191
|
+
ChipProps: {
|
|
192
|
+
size: 'small'
|
|
193
|
+
}
|
|
194
|
+
})
|
|
195
|
+
})
|
|
196
|
+
]
|
|
197
|
+
})
|
|
198
|
+
]
|
|
172
199
|
})
|
|
173
200
|
]
|
|
174
201
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/LegendOptionsEditor/LegendOptionsEditor.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Switch, SwitchProps } from '@mui/material';\nimport { DEFAULT_LEGEND, getLegendMode, getLegendPosition, getLegendSize } from '@perses-dev/core';\nimport { ErrorAlert, OptionsEditorControl, OptionsEditorGroup, SettingsAutocomplete } from '@perses-dev/components';\nimport { ReactElement } from 'react';\nimport {\n LEGEND_MODE_CONFIG,\n LEGEND_POSITIONS_CONFIG,\n LegendSpecOptions,\n LegendSingleSelectConfig,\n validateLegendSpec,\n LEGEND_VALUE_CONFIG,\n LegendValue,\n LEGEND_SIZE_CONFIG,\n} from '../../model';\n\ntype LegendPositionOption = LegendSingleSelectConfig & { id: LegendSpecOptions['position'] };\n\nconst POSITION_OPTIONS: LegendPositionOption[] = Object.entries(LEGEND_POSITIONS_CONFIG).map(([id, config]) => {\n return {\n id: id as LegendSpecOptions['position'],\n ...config,\n };\n});\n\ntype LegendModeOption = LegendSingleSelectConfig & { id: Required<LegendSpecOptions>['mode'] };\n\nconst MODE_OPTIONS: LegendModeOption[] = Object.entries(LEGEND_MODE_CONFIG).map(([id, config]) => {\n return {\n id: id as Required<LegendSpecOptions>['mode'],\n ...config,\n };\n});\n\ntype LegendSizeOption = LegendSingleSelectConfig & { id: Required<LegendSpecOptions>['size'] };\n\nconst SIZE_OPTIONS: LegendSizeOption[] = Object.entries(LEGEND_SIZE_CONFIG).map(([id, config]) => {\n return {\n id: id as Required<LegendSpecOptions>['size'],\n ...config,\n };\n});\n\ntype LegendValueOption = LegendSingleSelectConfig & { id: LegendValue };\nconst VALUE_OPTIONS: LegendValueOption[] = Object.entries(LEGEND_VALUE_CONFIG).map(([id, config]) => {\n return {\n id: id as LegendValue,\n ...config,\n };\n});\n\nexport interface LegendOptionsEditorProps {\n value?: LegendSpecOptions;\n onChange: (legend?: LegendSpecOptions) => void;\n showValuesEditor?: boolean;\n}\n\nexport function LegendOptionsEditor({\n value,\n onChange,\n showValuesEditor = true,\n}: LegendOptionsEditorProps): ReactElement {\n const handleLegendShowChange: SwitchProps['onChange'] = (_: unknown, checked: boolean) => {\n // legend is hidden when legend obj is undefined\n const legendValue = checked === true ? { position: DEFAULT_LEGEND.position } : undefined;\n onChange(legendValue);\n };\n\n const handleLegendPositionChange = (_: unknown, newValue: LegendPositionOption): void => {\n onChange({\n ...value,\n position: newValue.id,\n });\n };\n\n const handleLegendModeChange = (_: unknown, newValue: LegendModeOption): void => {\n onChange({\n ...value,\n position: currentPosition,\n mode: newValue.id,\n });\n };\n\n const handleLegendSizeChange = (_: unknown, newValue: LegendSizeOption): void => {\n onChange({\n ...value,\n position: currentPosition,\n size: newValue.id,\n });\n };\n\n const handleLegendValueChange = (_: unknown, newValue: LegendValueOption[]): void => {\n onChange({\n ...value,\n position: currentPosition,\n values: newValue.map((value) => {\n return value.id;\n }),\n });\n };\n\n const isValidLegend = validateLegendSpec(value);\n const currentPosition = getLegendPosition(value?.position);\n const legendPositionConfig = LEGEND_POSITIONS_CONFIG[currentPosition];\n\n const currentMode = getLegendMode(value?.mode);\n const legendModeConfig = LEGEND_MODE_CONFIG[currentMode];\n\n const currentSize = getLegendSize(value?.size);\n const legendSizeConfig = LEGEND_SIZE_CONFIG[currentSize];\n\n const currentValues = value?.values || [];\n const legendValuesConfig = currentValues.reduce((result, item) => {\n const config = LEGEND_VALUE_CONFIG[item];\n if (config) {\n result.push({ ...config, id: item });\n }\n return result;\n }, [] as LegendValueOption[]);\n\n return (\n <OptionsEditorGroup title=\"Legend\">\n {!isValidLegend && <ErrorAlert error={{ name: 'invalid-legend', message: 'Invalid legend spec' }} />}\n <OptionsEditorControl\n label=\"Show\"\n control={<Switch checked={value !== undefined} onChange={handleLegendShowChange} />}\n />\n <OptionsEditorControl\n label=\"Position\"\n control={\n <SettingsAutocomplete\n value={{\n ...legendPositionConfig,\n id: currentPosition,\n }}\n options={POSITION_OPTIONS}\n onChange={handleLegendPositionChange}\n disabled={value === undefined}\n disableClearable\n ></SettingsAutocomplete>\n }\n />\n <OptionsEditorControl\n label=\"Mode\"\n control={\n <SettingsAutocomplete\n value={{\n ...legendModeConfig,\n id: currentMode,\n }}\n options={MODE_OPTIONS}\n onChange={handleLegendModeChange}\n disabled={value === undefined}\n disableClearable\n ></SettingsAutocomplete>\n }\n />\n <OptionsEditorControl\n label=\"Size\"\n control={\n <SettingsAutocomplete\n value={{\n ...legendSizeConfig,\n id: currentSize,\n }}\n options={SIZE_OPTIONS}\n onChange={handleLegendSizeChange}\n // TODO: enable sizes for list mode when we normalize the layout of\n // lists to more closely match tables.\n disabled={value === undefined || currentMode !== 'table'}\n disableClearable\n ></SettingsAutocomplete>\n }\n />\n {showValuesEditor && (\n <OptionsEditorControl\n label=\"Values\"\n control={\n // For some reason, the inferred option type doesn't always seem to work\n // quite right when `multiple` is true. Explicitly setting the generics\n // to work around this.\n <SettingsAutocomplete<LegendValueOption, true, true>\n multiple={true}\n disableCloseOnSelect\n disableClearable\n value={legendValuesConfig}\n options={VALUE_OPTIONS}\n onChange={handleLegendValueChange}\n disabled={value === undefined || currentMode !== 'table'}\n limitTags={1}\n ChipProps={{\n size: 'small',\n }}\n />\n }\n />\n )}\n </OptionsEditorGroup>\n );\n}\n"],"names":["Switch","DEFAULT_LEGEND","getLegendMode","getLegendPosition","getLegendSize","ErrorAlert","OptionsEditorControl","OptionsEditorGroup","SettingsAutocomplete","LEGEND_MODE_CONFIG","LEGEND_POSITIONS_CONFIG","validateLegendSpec","LEGEND_VALUE_CONFIG","LEGEND_SIZE_CONFIG","POSITION_OPTIONS","Object","entries","map","id","config","MODE_OPTIONS","SIZE_OPTIONS","VALUE_OPTIONS","LegendOptionsEditor","value","onChange","showValuesEditor","handleLegendShowChange","_","checked","legendValue","position","undefined","handleLegendPositionChange","newValue","handleLegendModeChange","currentPosition","mode","handleLegendSizeChange","size","handleLegendValueChange","values","isValidLegend","legendPositionConfig","currentMode","legendModeConfig","currentSize","legendSizeConfig","currentValues","legendValuesConfig","reduce","result","item","push","title","error","name","message","label","control","options","disabled","disableClearable","multiple","disableCloseOnSelect","limitTags","ChipProps"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1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;oBAAWP,UAAUE;;;0BAE3D,KAACrB;gBACCoD,OAAM;gBACNC,uBACE,KAACnD;oBACCgB,OAAO;wBACL,GAAGmB,oBAAoB;wBACvBzB,IAAIkB;oBACN;oBACAwB,SAAS9C;oBACTW,UAAUQ;oBACV4B,UAAUrC,UAAUQ;oBACpB8B,gBAAgB;;;0BAItB,KAACxD;gBACCoD,OAAM;gBACNC,uBACE,KAACnD;oBACCgB,OAAO;wBACL,GAAGqB,gBAAgB;wBACnB3B,IAAI0B;oBACN;oBACAgB,SAASxC;oBACTK,UAAUU;oBACV0B,UAAUrC,UAAUQ;oBACpB8B,gBAAgB;;;0BAItB,KAACxD;gBACCoD,OAAM;gBACNC,uBACE,KAACnD;oBACCgB,OAAO;wBACL,GAAGuB,gBAAgB;wBACnB7B,IAAI4B;oBACN;oBACAc,SAASvC;oBACTI,UAAUa;oBACV,mEAAmE;oBACnE,sCAAsC;oBACtCuB,UAAUrC,UAAUQ,aAAaY,gBAAgB;oBACjDkB,gBAAgB;;;YAIrBpC,kCACC,KAACpB;gBACCoD,OAAM;gBACNC,SACE,wEAAwE;gBACxE,uEAAuE;gBACvE,uBAAuB;8BACvB,KAACnD;oBACCuD,UAAU;oBACVC,oBAAoB;oBACpBF,gBAAgB;oBAChBtC,OAAOyB;oBACPW,SAAStC;oBACTG,UAAUe;oBACVqB,UAAUrC,UAAUQ,aAAaY,gBAAgB;oBACjDqB,WAAW;oBACXC,WAAW;wBACT3B,MAAM;oBACR;;;;;AAOd"}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/LegendOptionsEditor/LegendOptionsEditor.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Switch, SwitchProps, ToggleButtonGroup, ToggleButton } from '@mui/material';\nimport { DEFAULT_LEGEND, getLegendMode, getLegendPosition, getLegendSize } from '@perses-dev/core';\nimport { ErrorAlert, OptionsEditorControl, OptionsEditorGroup, SettingsAutocomplete } from '@perses-dev/components';\nimport { ReactElement, useMemo } from 'react';\nimport {\n LEGEND_MODE_CONFIG,\n LEGEND_POSITIONS_CONFIG,\n LegendSpecOptions,\n LegendSingleSelectConfig,\n validateLegendSpec,\n LEGEND_VALUE_CONFIG,\n LegendValue,\n LEGEND_SIZE_CONFIG,\n comparisonLegends,\n ComparisonValues,\n} from '../../model';\n\ntype LegendPositionOption = LegendSingleSelectConfig & { id: LegendSpecOptions['position'] };\n\nconst POSITION_OPTIONS: LegendPositionOption[] = Object.entries(LEGEND_POSITIONS_CONFIG).map(([id, config]) => {\n return {\n id: id as LegendSpecOptions['position'],\n ...config,\n };\n});\n\ntype LegendSizeOption = LegendSingleSelectConfig & { id: Required<LegendSpecOptions>['size'] };\n\nconst SIZE_OPTIONS: LegendSizeOption[] = Object.entries(LEGEND_SIZE_CONFIG).map(([id, config]) => {\n return {\n id: id as Required<LegendSpecOptions>['size'],\n ...config,\n };\n});\n\ntype LegendValueOption = LegendSingleSelectConfig & { id: LegendValue | ComparisonValues };\n\nexport interface LegendOptionsEditorProps {\n value?: LegendSpecOptions;\n onChange: (legend?: LegendSpecOptions) => void;\n showValuesEditor?: boolean;\n calculation?: 'aggregation' | 'comparison';\n}\n\nexport function LegendOptionsEditor({\n value,\n onChange,\n showValuesEditor = true,\n calculation = 'aggregation',\n}: LegendOptionsEditorProps): ReactElement {\n const handleLegendShowChange: SwitchProps['onChange'] = (_: unknown, checked: boolean) => {\n // legend is hidden when legend obj is undefined\n const legendValue = checked === true ? { position: DEFAULT_LEGEND.position } : undefined;\n onChange(legendValue);\n };\n\n const handleLegendPositionChange = (_: unknown, newValue: LegendPositionOption): void => {\n onChange({\n ...value,\n position: newValue.id,\n });\n };\n\n const handleLegendSizeChange = (_: unknown, newValue: LegendSizeOption): void => {\n onChange({\n ...value,\n position: currentPosition,\n size: newValue.id,\n });\n };\n\n const handleLegendValueChange = (_: unknown, newValue: LegendValueOption[]): void => {\n onChange({\n ...value,\n position: currentPosition,\n values: newValue.map((value) => {\n return value.id;\n }),\n });\n };\n\n const isValidLegend = validateLegendSpec(value);\n const currentPosition = getLegendPosition(value?.position);\n const legendPositionConfig = LEGEND_POSITIONS_CONFIG[currentPosition];\n\n const currentMode = getLegendMode(value?.mode);\n\n const currentSize = getLegendSize(value?.size);\n const legendSizeConfig = LEGEND_SIZE_CONFIG[currentSize];\n\n const legendValuesConfig = useMemo(() => {\n const currentValues = value?.values;\n if (!currentValues?.length) return [];\n\n if (calculation === 'aggregation') {\n return currentValues.reduce((result, item) => {\n const config = LEGEND_VALUE_CONFIG[item as LegendValue];\n if (config) {\n result.push({ ...config, id: item });\n }\n return result;\n }, [] as LegendValueOption[]);\n }\n\n return currentValues.map((id) => {\n const { label, description } = comparisonLegends[id as ComparisonValues];\n return {\n id,\n label,\n description,\n };\n });\n }, [calculation, value?.values]);\n\n const valueOptions = useMemo(() => {\n if (calculation === 'aggregation') {\n return Object.entries(LEGEND_VALUE_CONFIG || {}).map(([id, config]) => {\n return {\n id: id as LegendValue,\n ...config,\n };\n });\n }\n\n return Object.entries(comparisonLegends).map(([id, config]) => ({\n id: id as ComparisonValues,\n ...config,\n }));\n }, [calculation]);\n\n return (\n <OptionsEditorGroup title=\"Legend\">\n {!isValidLegend && <ErrorAlert error={{ name: 'invalid-legend', message: 'Invalid legend spec' }} />}\n <OptionsEditorControl label=\"Show\" control={<Switch checked={!!value} onChange={handleLegendShowChange} />} />\n {value && (\n <>\n <OptionsEditorControl\n label=\"Position\"\n control={\n <SettingsAutocomplete\n value={{\n ...legendPositionConfig,\n id: currentPosition,\n }}\n options={POSITION_OPTIONS}\n onChange={handleLegendPositionChange}\n disableClearable\n />\n }\n />\n <OptionsEditorControl\n label=\"Mode\"\n control={\n <ToggleButtonGroup\n color=\"primary\"\n exclusive\n value={currentMode}\n aria-label=\"Mode\"\n onChange={(__, newValue) => {\n onChange({\n ...value,\n position: currentPosition,\n mode: newValue,\n });\n }}\n >\n {Object.entries(LEGEND_MODE_CONFIG).map(([modeId, config]) => (\n <ToggleButton\n key={modeId}\n value={modeId}\n selected={currentMode === modeId}\n aria-label={`display ${modeId} mode`}\n >\n {config.label}\n </ToggleButton>\n ))}\n </ToggleButtonGroup>\n }\n />\n {currentMode === 'table' && (\n <>\n <OptionsEditorControl\n label=\"Size\"\n control={\n <SettingsAutocomplete\n value={{\n ...legendSizeConfig,\n id: currentSize,\n }}\n options={SIZE_OPTIONS}\n onChange={handleLegendSizeChange}\n // TODO: enable sizes for list mode when we normalize the layout of\n // lists to more closely match tables.\n disableClearable\n />\n }\n />\n {showValuesEditor && (\n <OptionsEditorControl\n label=\"Values\"\n control={\n // For some reason, the inferred option type doesn't always seem to work\n // quite right when `multiple` is true. Explicitly setting the generics\n // to work around this.\n <SettingsAutocomplete<LegendValueOption, true, true>\n multiple={true}\n disableCloseOnSelect\n disableClearable\n value={legendValuesConfig}\n options={valueOptions}\n onChange={handleLegendValueChange}\n limitTags={1}\n ChipProps={{\n size: 'small',\n }}\n />\n }\n />\n )}\n </>\n )}\n </>\n )}\n </OptionsEditorGroup>\n );\n}\n"],"names":["Switch","ToggleButtonGroup","ToggleButton","DEFAULT_LEGEND","getLegendMode","getLegendPosition","getLegendSize","ErrorAlert","OptionsEditorControl","OptionsEditorGroup","SettingsAutocomplete","useMemo","LEGEND_MODE_CONFIG","LEGEND_POSITIONS_CONFIG","validateLegendSpec","LEGEND_VALUE_CONFIG","LEGEND_SIZE_CONFIG","comparisonLegends","POSITION_OPTIONS","Object","entries","map","id","config","SIZE_OPTIONS","LegendOptionsEditor","value","onChange","showValuesEditor","calculation","handleLegendShowChange","_","checked","legendValue","position","undefined","handleLegendPositionChange","newValue","handleLegendSizeChange","currentPosition","size","handleLegendValueChange","values","isValidLegend","legendPositionConfig","currentMode","mode","currentSize","legendSizeConfig","legendValuesConfig","currentValues","length","reduce","result","item","push","label","description","valueOptions","title","error","name","message","control","options","disableClearable","color","exclusive","aria-label","__","modeId","selected","multiple","disableCloseOnSelect","limitTags","ChipProps"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,MAAM,EAAeC,iBAAiB,EAAEC,YAAY,QAAQ,gBAAgB;AACrF,SAASC,cAAc,EAAEC,aAAa,EAAEC,iBAAiB,EAAEC,aAAa,QAAQ,mBAAmB;AACnG,SAASC,UAAU,EAAEC,oBAAoB,EAAEC,kBAAkB,EAAEC,oBAAoB,QAAQ,yBAAyB;AACpH,SAAuBC,OAAO,QAAQ,QAAQ;AAC9C,SACEC,kBAAkB,EAClBC,uBAAuB,EAGvBC,kBAAkB,EAClBC,mBAAmB,EAEnBC,kBAAkB,EAClBC,iBAAiB,QAEZ,cAAc;AAIrB,MAAMC,mBAA2CC,OAAOC,OAAO,CAACP,yBAAyBQ,GAAG,CAAC,CAAC,CAACC,IAAIC,OAAO;IACxG,OAAO;QACLD,IAAIA;QACJ,GAAGC,MAAM;IACX;AACF;AAIA,MAAMC,eAAmCL,OAAOC,OAAO,CAACJ,oBAAoBK,GAAG,CAAC,CAAC,CAACC,IAAIC,OAAO;IAC3F,OAAO;QACLD,IAAIA;QACJ,GAAGC,MAAM;IACX;AACF;AAWA,OAAO,SAASE,oBAAoB,EAClCC,KAAK,EACLC,QAAQ,EACRC,mBAAmB,IAAI,EACvBC,cAAc,aAAa,EACF;IACzB,MAAMC,yBAAkD,CAACC,GAAYC;QACnE,gDAAgD;QAChD,MAAMC,cAAcD,YAAY,OAAO;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/C,OAAOiC,KAAK;mCALRc;;;oBAWdzB,gBAAgB,yBACf;;0CACE,KAACrC;gCACCgD,OAAM;gCACNO,uBACE,KAACrD;oCACCgB,OAAO;wCACL,GAAGsB,gBAAgB;wCACnB1B,IAAIyB;oCACN;oCACAiB,SAASxC;oCACTG,UAAUW;oCACV,mEAAmE;oCACnE,sCAAsC;oCACtC2B,gBAAgB;;;4BAIrBrC,kCACC,KAACpB;gCACCgD,OAAM;gCACNO,SACE,wEAAwE;gCACxE,uEAAuE;gCACvE,uBAAuB;8CACvB,KAACrD;oCACC8D,UAAU;oCACVC,oBAAoB;oCACpBR,gBAAgB;oCAChBvC,OAAOuB;oCACPe,SAASN;oCACT/B,UAAUc;oCACViC,WAAW;oCACXC,WAAW;wCACTnC,MAAM;oCACR;;;;;;;;;AAWtB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { QueryDefinition, QueryPluginType } from '@perses-dev/core';
|
|
3
|
+
import { PluginEditorRef } from '../PluginEditor';
|
|
3
4
|
export interface MultiQueryEditorProps {
|
|
4
5
|
queryTypes: QueryPluginType[];
|
|
5
6
|
queries?: QueryDefinition[];
|
|
@@ -13,5 +14,5 @@ export interface MultiQueryEditorProps {
|
|
|
13
14
|
* @param onChange The callback to call when the queries are modified
|
|
14
15
|
* @constructor
|
|
15
16
|
*/
|
|
16
|
-
export declare
|
|
17
|
+
export declare const MultiQueryEditor: import("react").ForwardRefExoticComponent<MultiQueryEditorProps & import("react").RefAttributes<PluginEditorRef>>;
|
|
17
18
|
//# sourceMappingURL=MultiQueryEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiQueryEditor.d.ts","sourceRoot":"","sources":["../../../src/components/MultiQueryEditor/MultiQueryEditor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MultiQueryEditor.d.ts","sourceRoot":"","sources":["../../../src/components/MultiQueryEditor/MultiQueryEditor.tsx"],"names":[],"mappings":";AAiBA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEpE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;CAChD;AAmCD;;;;;;;GAOG;AAEH,eAAO,MAAM,gBAAgB,mHAmF3B,CAAC"}
|
|
@@ -11,7 +11,7 @@
|
|
|
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 { useState } from 'react';
|
|
14
|
+
import { forwardRef, useState } from 'react';
|
|
15
15
|
import { produce } from 'immer';
|
|
16
16
|
import { Button, Stack } from '@mui/material';
|
|
17
17
|
import AddIcon from 'mdi-material-ui/Plus';
|
|
@@ -52,7 +52,8 @@ function useDefaultQueryDefinition(queryTypes) {
|
|
|
52
52
|
* @param queries The list of query definitions to render
|
|
53
53
|
* @param onChange The callback to call when the queries are modified
|
|
54
54
|
* @constructor
|
|
55
|
-
*/ export
|
|
55
|
+
*/ export const MultiQueryEditor = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
56
|
+
const { queryTypes, queries = [], onChange } = props;
|
|
56
57
|
const { defaultInitialQueryDefinition, isLoading } = useDefaultQueryDefinition(queryTypes);
|
|
57
58
|
// State for which queries are collapsed
|
|
58
59
|
const [queriesCollapsed, setQueriesCollapsed] = useState(queries.map(()=>false));
|
|
@@ -114,6 +115,7 @@ function useDefaultQueryDefinition(queryTypes) {
|
|
|
114
115
|
/*#__PURE__*/ _jsx(Stack, {
|
|
115
116
|
spacing: 1,
|
|
116
117
|
children: queryDefinitions.map((query, i)=>/*#__PURE__*/ _jsx(QueryEditorContainer, {
|
|
118
|
+
ref: ref,
|
|
117
119
|
queryTypes: queryTypes,
|
|
118
120
|
index: i,
|
|
119
121
|
query: query,
|
|
@@ -134,6 +136,7 @@ function useDefaultQueryDefinition(queryTypes) {
|
|
|
134
136
|
})
|
|
135
137
|
]
|
|
136
138
|
});
|
|
137
|
-
}
|
|
139
|
+
});
|
|
140
|
+
MultiQueryEditor.displayName = 'MultiQueryEditor';
|
|
138
141
|
|
|
139
142
|
//# sourceMappingURL=MultiQueryEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MultiQueryEditor/MultiQueryEditor.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement, useState } from 'react';\nimport { produce } from 'immer';\nimport { Button, Stack } from '@mui/material';\nimport AddIcon from 'mdi-material-ui/Plus';\nimport { QueryDefinition, QueryPluginType } from '@perses-dev/core';\nimport { useListPluginMetadata, usePlugin, usePluginRegistry } from '../../runtime';\nimport { QueryEditorContainer } from './QueryEditorContainer';\n\nexport interface MultiQueryEditorProps {\n queryTypes: QueryPluginType[];\n queries?: QueryDefinition[];\n onChange: (queries: QueryDefinition[]) => void;\n}\n\nfunction useDefaultQueryDefinition(queryTypes: QueryPluginType[]): {\n defaultInitialQueryDefinition: QueryDefinition;\n isLoading: boolean;\n} {\n // Build the default query plugin\n // This will be used only if the queries are empty, to open a starting query\n\n // Firs the default query type\n const defaultQueryType = queryTypes[0]!;\n\n // Then the default plugin kind\n // Use as default the plugin kind explicitly set as default or the first in the list\n const { data: queryPlugins, isLoading } = useListPluginMetadata(queryTypes);\n const { defaultPluginKinds } = usePluginRegistry();\n const defaultQueryKind = defaultPluginKinds?.[defaultQueryType] ?? queryPlugins?.[0]?.spec.name ?? '';\n\n const { data: defaultQueryPlugin } = usePlugin(defaultQueryType, defaultQueryKind, {\n useErrorBoundary: true,\n enabled: true,\n });\n\n // This default query definition is used if no query is provided initially or when we add a new query\n return {\n defaultInitialQueryDefinition: {\n kind: defaultQueryType,\n spec: {\n plugin: { kind: defaultQueryKind, spec: defaultQueryPlugin?.createInitialOptions() || {} },\n },\n },\n isLoading,\n };\n}\n\n/**\n * A component render a list of {@link QueryEditorContainer} for the given query definitions.\n * It allows adding, removing and editing queries.\n * @param queryTypes The list of query types that the underlying editor will propose\n * @param queries The list of query definitions to render\n * @param onChange The callback to call when the queries are modified\n * @constructor\n */\nexport
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MultiQueryEditor/MultiQueryEditor.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { forwardRef, ReactElement, useState } from 'react';\nimport { produce } from 'immer';\nimport { Button, Stack } from '@mui/material';\nimport AddIcon from 'mdi-material-ui/Plus';\nimport { QueryDefinition, QueryPluginType } from '@perses-dev/core';\nimport { useListPluginMetadata, usePlugin, usePluginRegistry } from '../../runtime';\nimport { PluginEditorRef } from '../PluginEditor';\nimport { QueryEditorContainer } from './QueryEditorContainer';\n\nexport interface MultiQueryEditorProps {\n queryTypes: QueryPluginType[];\n queries?: QueryDefinition[];\n onChange: (queries: QueryDefinition[]) => void;\n}\n\nfunction useDefaultQueryDefinition(queryTypes: QueryPluginType[]): {\n defaultInitialQueryDefinition: QueryDefinition;\n isLoading: boolean;\n} {\n // Build the default query plugin\n // This will be used only if the queries are empty, to open a starting query\n\n // Firs the default query type\n const defaultQueryType = queryTypes[0]!;\n\n // Then the default plugin kind\n // Use as default the plugin kind explicitly set as default or the first in the list\n const { data: queryPlugins, isLoading } = useListPluginMetadata(queryTypes);\n const { defaultPluginKinds } = usePluginRegistry();\n const defaultQueryKind = defaultPluginKinds?.[defaultQueryType] ?? queryPlugins?.[0]?.spec.name ?? '';\n\n const { data: defaultQueryPlugin } = usePlugin(defaultQueryType, defaultQueryKind, {\n useErrorBoundary: true,\n enabled: true,\n });\n\n // This default query definition is used if no query is provided initially or when we add a new query\n return {\n defaultInitialQueryDefinition: {\n kind: defaultQueryType,\n spec: {\n plugin: { kind: defaultQueryKind, spec: defaultQueryPlugin?.createInitialOptions() || {} },\n },\n },\n isLoading,\n };\n}\n\n/**\n * A component render a list of {@link QueryEditorContainer} for the given query definitions.\n * It allows adding, removing and editing queries.\n * @param queryTypes The list of query types that the underlying editor will propose\n * @param queries The list of query definitions to render\n * @param onChange The callback to call when the queries are modified\n * @constructor\n */\n\nexport const MultiQueryEditor = forwardRef<PluginEditorRef, MultiQueryEditorProps>((props, ref): ReactElement => {\n const { queryTypes, queries = [], onChange } = props;\n const { defaultInitialQueryDefinition, isLoading } = useDefaultQueryDefinition(queryTypes);\n // State for which queries are collapsed\n const [queriesCollapsed, setQueriesCollapsed] = useState(queries.map(() => false));\n\n // Query handlers\n const handleQueryChange = (index: number, queryDef: QueryDefinition): void => {\n onChange(\n produce(queries, (draft) => {\n if (draft) {\n draft[index] = queryDef;\n } else {\n draft = [queryDef];\n }\n })\n );\n };\n\n const handleQueryAdd = (): void => {\n onChange(\n produce(queries, (draft) => {\n if (draft) {\n draft.push(defaultInitialQueryDefinition);\n } else {\n draft = [...queries, defaultInitialQueryDefinition];\n }\n })\n );\n setQueriesCollapsed((queriesCollapsed) => {\n queriesCollapsed.push(false);\n return [...queriesCollapsed];\n });\n };\n\n const handleQueryDelete = (index: number): void => {\n onChange(\n produce(queries, (draft) => {\n draft.splice(index, 1);\n })\n );\n setQueriesCollapsed((queriesCollapsed) => {\n queriesCollapsed.splice(index, 1);\n return [...queriesCollapsed];\n });\n };\n\n const handleQueryCollapseExpand = (index: number): void => {\n setQueriesCollapsed((queriesCollapsed) => {\n queriesCollapsed[index] = !queriesCollapsed[index];\n return [...queriesCollapsed];\n });\n };\n\n // show one query input if queries is empty\n const queryDefinitions: QueryDefinition[] = queries.length\n ? queries\n : !isLoading\n ? [defaultInitialQueryDefinition]\n : [];\n\n return (\n <>\n <Stack spacing={1}>\n {queryDefinitions.map((query: QueryDefinition, i: number) => (\n <QueryEditorContainer\n ref={ref}\n queryTypes={queryTypes}\n key={i}\n index={i}\n query={query}\n isCollapsed={!!queriesCollapsed[i]}\n onChange={handleQueryChange}\n onDelete={queries.length > 1 ? handleQueryDelete : undefined}\n onCollapseExpand={handleQueryCollapseExpand}\n />\n ))}\n </Stack>\n <Button variant=\"contained\" startIcon={<AddIcon />} sx={{ marginTop: 1 }} onClick={handleQueryAdd}>\n Add Query\n </Button>\n </>\n );\n});\n\nMultiQueryEditor.displayName = 'MultiQueryEditor';\n"],"names":["forwardRef","useState","produce","Button","Stack","AddIcon","useListPluginMetadata","usePlugin","usePluginRegistry","QueryEditorContainer","useDefaultQueryDefinition","queryTypes","defaultQueryType","data","queryPlugins","isLoading","defaultPluginKinds","defaultQueryKind","spec","name","defaultQueryPlugin","useErrorBoundary","enabled","defaultInitialQueryDefinition","kind","plugin","createInitialOptions","MultiQueryEditor","props","ref","queries","onChange","queriesCollapsed","setQueriesCollapsed","map","handleQueryChange","index","queryDef","draft","handleQueryAdd","push","handleQueryDelete","splice","handleQueryCollapseExpand","queryDefinitions","length","spacing","query","i","isCollapsed","onDelete","undefined","onCollapseExpand","variant","startIcon","sx","marginTop","onClick","displayName"],"mappings":"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CAACjB,gBAAgB,CAACgB,EAAE;wBAClCjB,UAAUI;wBACVe,UAAUpB,QAAQe,MAAM,GAAG,IAAIJ,oBAAoBU;wBACnDC,kBAAkBT;uBANbK;;0BAUX,KAAC7C;gBAAOkD,SAAQ;gBAAYC,yBAAW,KAACjD;gBAAYkD,IAAI;oBAAEC,WAAW;gBAAE;gBAAGC,SAASlB;0BAAgB;;;;AAKzG,GAAG;AAEHZ,iBAAiB+B,WAAW,GAAG"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { QueryDefinition, QueryPluginType } from '@perses-dev/core';
|
|
2
|
-
import {
|
|
3
|
+
import { PluginEditorRef } from '../PluginEditor';
|
|
3
4
|
/**
|
|
4
5
|
* Properties for {@link QueryEditorContainer}
|
|
5
6
|
*/
|
|
@@ -24,6 +25,6 @@ interface QueryEditorContainerProps {
|
|
|
24
25
|
* @param onCollapseExpand callback when the query is collapsed or expanded
|
|
25
26
|
* @constructor
|
|
26
27
|
*/
|
|
27
|
-
export declare const QueryEditorContainer: (
|
|
28
|
+
export declare const QueryEditorContainer: import("react").ForwardRefExoticComponent<QueryEditorContainerProps & import("react").RefAttributes<PluginEditorRef>>;
|
|
28
29
|
export {};
|
|
29
30
|
//# sourceMappingURL=QueryEditorContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryEditorContainer.d.ts","sourceRoot":"","sources":["../../../src/components/MultiQueryEditor/QueryEditorContainer.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"QueryEditorContainer.d.ts","sourceRoot":"","sources":["../../../src/components/MultiQueryEditor/QueryEditorContainer.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAMpE,OAAO,EAAmC,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGnF;;GAEG;AACH,UAAU,yBAAyB;IACjC,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAC1D,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,oBAAoB,uHA2BhC,CAAC"}
|
|
@@ -16,7 +16,9 @@ import { Stack, IconButton, Typography, Box } from '@mui/material';
|
|
|
16
16
|
import DeleteIcon from 'mdi-material-ui/DeleteOutline';
|
|
17
17
|
import ChevronDown from 'mdi-material-ui/ChevronDown';
|
|
18
18
|
import ChevronRight from 'mdi-material-ui/ChevronRight';
|
|
19
|
+
import { forwardRef } from 'react';
|
|
19
20
|
import { PluginEditor } from '../PluginEditor';
|
|
21
|
+
import { useTimeRange } from '../../runtime';
|
|
20
22
|
/**
|
|
21
23
|
* Container for a query editor. This component is responsible for rendering the query editor, and make it collapsible
|
|
22
24
|
* to not take too much space.
|
|
@@ -28,7 +30,8 @@ import { PluginEditor } from '../PluginEditor';
|
|
|
28
30
|
* @param onChange callback when the query is changed
|
|
29
31
|
* @param onCollapseExpand callback when the query is collapsed or expanded
|
|
30
32
|
* @constructor
|
|
31
|
-
*/ export const QueryEditorContainer = (
|
|
33
|
+
*/ export const QueryEditorContainer = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
34
|
+
const { queryTypes, index, query, isCollapsed, onDelete, onChange, onCollapseExpand } = props;
|
|
32
35
|
return /*#__PURE__*/ _jsxs(Stack, {
|
|
33
36
|
spacing: 1,
|
|
34
37
|
children: [
|
|
@@ -64,21 +67,24 @@ import { PluginEditor } from '../PluginEditor';
|
|
|
64
67
|
]
|
|
65
68
|
}),
|
|
66
69
|
!isCollapsed && /*#__PURE__*/ _jsx(QueryEditor, {
|
|
70
|
+
ref: ref,
|
|
67
71
|
queryTypes: queryTypes,
|
|
68
72
|
value: query,
|
|
69
73
|
onChange: (next)=>onChange(index, next)
|
|
70
74
|
})
|
|
71
75
|
]
|
|
72
76
|
}, index);
|
|
73
|
-
};
|
|
77
|
+
});
|
|
78
|
+
QueryEditorContainer.displayName = 'QueryEditorContainer';
|
|
74
79
|
/**
|
|
75
80
|
* Editor for a query definition. This component is responsible for rendering the plugin editor for the given query.
|
|
76
81
|
* This will allow user to select a plugin extending from the given supported query types, and then edit the plugin
|
|
77
82
|
* spec for this plugin.
|
|
78
83
|
* @param props
|
|
79
84
|
* @constructor
|
|
80
|
-
*/
|
|
85
|
+
*/ const QueryEditor = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
81
86
|
const { value, onChange, queryTypes, ...others } = props;
|
|
87
|
+
const { refresh } = useTimeRange();
|
|
82
88
|
const handlePluginChange = (next)=>{
|
|
83
89
|
onChange(produce(value, (draft)=>{
|
|
84
90
|
draft.kind = next.selection.type;
|
|
@@ -89,6 +95,9 @@ import { PluginEditor } from '../PluginEditor';
|
|
|
89
95
|
return /*#__PURE__*/ _jsx(Box, {
|
|
90
96
|
...others,
|
|
91
97
|
children: /*#__PURE__*/ _jsx(PluginEditor, {
|
|
98
|
+
postExecuteRunQuery: refresh,
|
|
99
|
+
ref: ref,
|
|
100
|
+
withRunQueryButton: true,
|
|
92
101
|
pluginTypes: queryTypes,
|
|
93
102
|
pluginKindLabel: "Query Type",
|
|
94
103
|
value: {
|
|
@@ -101,6 +110,7 @@ import { PluginEditor } from '../PluginEditor';
|
|
|
101
110
|
onChange: handlePluginChange
|
|
102
111
|
})
|
|
103
112
|
});
|
|
104
|
-
}
|
|
113
|
+
});
|
|
114
|
+
QueryEditor.displayName = 'QueryEditor';
|
|
105
115
|
|
|
106
116
|
//# sourceMappingURL=QueryEditorContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MultiQueryEditor/QueryEditorContainer.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { produce } from 'immer';\nimport { QueryDefinition, QueryPluginType } from '@perses-dev/core';\nimport { Stack, IconButton, Typography, BoxProps, Box } from '@mui/material';\nimport DeleteIcon from 'mdi-material-ui/DeleteOutline';\nimport ChevronDown from 'mdi-material-ui/ChevronDown';\nimport ChevronRight from 'mdi-material-ui/ChevronRight';\nimport { ReactElement } from 'react';\nimport { PluginEditor, PluginEditorProps } from '../PluginEditor';\n\n/**\n * Properties for {@link QueryEditorContainer}\n */\ninterface QueryEditorContainerProps {\n queryTypes: QueryPluginType[];\n index: number;\n query: QueryDefinition;\n onChange: (index: number, query: QueryDefinition) => void;\n onCollapseExpand: (index: number) => void;\n isCollapsed?: boolean;\n onDelete?: (index: number) => void;\n}\n\n/**\n * Container for a query editor. This component is responsible for rendering the query editor, and make it collapsible\n * to not take too much space.\n * @param queryTypes the supported query types\n * @param index the index of the query in the list\n * @param query the query definition\n * @param isCollapsed whether the query editor is collapsed or not\n * @param onDelete callback when the query is deleted\n * @param onChange callback when the query is changed\n * @param onCollapseExpand callback when the query is collapsed or expanded\n * @constructor\n */\nexport const QueryEditorContainer = (
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MultiQueryEditor/QueryEditorContainer.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { produce } from 'immer';\nimport { QueryDefinition, QueryPluginType } from '@perses-dev/core';\nimport { Stack, IconButton, Typography, BoxProps, Box } from '@mui/material';\nimport DeleteIcon from 'mdi-material-ui/DeleteOutline';\nimport ChevronDown from 'mdi-material-ui/ChevronDown';\nimport ChevronRight from 'mdi-material-ui/ChevronRight';\nimport { forwardRef, ReactElement } from 'react';\nimport { PluginEditor, PluginEditorProps, PluginEditorRef } from '../PluginEditor';\nimport { useTimeRange } from '../../runtime';\n\n/**\n * Properties for {@link QueryEditorContainer}\n */\ninterface QueryEditorContainerProps {\n queryTypes: QueryPluginType[];\n index: number;\n query: QueryDefinition;\n onChange: (index: number, query: QueryDefinition) => void;\n onCollapseExpand: (index: number) => void;\n isCollapsed?: boolean;\n onDelete?: (index: number) => void;\n}\n\n/**\n * Container for a query editor. This component is responsible for rendering the query editor, and make it collapsible\n * to not take too much space.\n * @param queryTypes the supported query types\n * @param index the index of the query in the list\n * @param query the query definition\n * @param isCollapsed whether the query editor is collapsed or not\n * @param onDelete callback when the query is deleted\n * @param onChange callback when the query is changed\n * @param onCollapseExpand callback when the query is collapsed or expanded\n * @constructor\n */\n\nexport const QueryEditorContainer = forwardRef<PluginEditorRef, QueryEditorContainerProps>(\n (props, ref): ReactElement => {\n const { queryTypes, index, query, isCollapsed, onDelete, onChange, onCollapseExpand } = props;\n return (\n <Stack key={index} spacing={1}>\n <Stack direction=\"row\" alignItems=\"center\" borderBottom={1} borderColor={(theme) => theme.palette.divider}>\n <IconButton size=\"small\" onClick={() => onCollapseExpand(index)}>\n {isCollapsed ? <ChevronRight /> : <ChevronDown />}\n </IconButton>\n <Typography variant=\"overline\" component=\"h4\">\n Query #{index + 1}\n </Typography>\n <IconButton\n size=\"small\"\n // Use `visibility` to ensure that the row has the same height when delete button is visible or not visible\n sx={{ marginLeft: 'auto', visibility: `${onDelete ? 'visible' : 'hidden'}` }}\n onClick={() => onDelete && onDelete(index)}\n >\n <DeleteIcon />\n </IconButton>\n </Stack>\n {!isCollapsed && (\n <QueryEditor ref={ref} queryTypes={queryTypes} value={query} onChange={(next) => onChange(index, next)} />\n )}\n </Stack>\n );\n }\n);\n\nQueryEditorContainer.displayName = 'QueryEditorContainer';\n\n// Props on MUI Box that we don't want people to pass because we're either redefining them or providing them in\n// this component\ntype OmittedMuiProps = 'children' | 'value' | 'onChange';\ninterface QueryEditorProps extends Omit<BoxProps, OmittedMuiProps> {\n queryTypes: QueryPluginType[];\n value: QueryDefinition;\n onChange: (next: QueryDefinition) => void;\n}\n\n/**\n * Editor for a query definition. This component is responsible for rendering the plugin editor for the given query.\n * This will allow user to select a plugin extending from the given supported query types, and then edit the plugin\n * spec for this plugin.\n * @param props\n * @constructor\n */\n\nconst QueryEditor = forwardRef<PluginEditorRef, QueryEditorProps>((props, ref): ReactElement => {\n const { value, onChange, queryTypes, ...others } = props;\n const { refresh } = useTimeRange();\n const handlePluginChange: PluginEditorProps['onChange'] = (next) => {\n onChange(\n produce(value, (draft) => {\n draft.kind = next.selection.type;\n draft.spec.plugin.kind = next.selection.kind;\n draft.spec.plugin.spec = next.spec;\n })\n );\n };\n\n return (\n <Box {...others}>\n <PluginEditor\n postExecuteRunQuery={refresh}\n ref={ref}\n withRunQueryButton\n pluginTypes={queryTypes}\n pluginKindLabel=\"Query Type\"\n value={{\n selection: {\n kind: value.spec.plugin.kind,\n type: value.kind,\n },\n spec: value.spec.plugin.spec,\n }}\n onChange={handlePluginChange}\n />\n </Box>\n );\n});\n\nQueryEditor.displayName = 'QueryEditor';\n"],"names":["produce","Stack","IconButton","Typography","Box","DeleteIcon","ChevronDown","ChevronRight","forwardRef","PluginEditor","useTimeRange","QueryEditorContainer","props","ref","queryTypes","index","query","isCollapsed","onDelete","onChange","onCollapseExpand","spacing","direction","alignItems","borderBottom","borderColor","theme","palette","divider","size","onClick","variant","component","sx","marginLeft","visibility","QueryEditor","value","next","displayName","others","refresh","handlePluginChange","draft","kind","selection","type","spec","plugin","postExecuteRunQuery","withRunQueryButton","pluginTypes","pluginKindLabel"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,OAAO,QAAQ,QAAQ;AAEhC,SAASC,KAAK,EAAEC,UAAU,EAAEC,UAAU,EAAYC,GAAG,QAAQ,gBAAgB;AAC7E,OAAOC,gBAAgB,gCAAgC;AACvD,OAAOC,iBAAiB,8BAA8B;AACtD,OAAOC,kBAAkB,+BAA+B;AACxD,SAASC,UAAU,QAAsB,QAAQ;AACjD,SAASC,YAAY,QAA4C,kBAAkB;AACnF,SAASC,YAAY,QAAQ,gBAAgB;AAe7C;;;;;;;;;;;CAWC,GAED,OAAO,MAAMC,qCAAuBH,WAClC,CAACI,OAAOC;IACN,MAAM,EAAEC,UAAU,EAAEC,KAAK,EAAEC,KAAK,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,gBAAgB,EAAE,GAAGR;IACxF,qBACE,MAACX;QAAkBoB,SAAS;;0BAC1B,MAACpB;gBAAMqB,WAAU;gBAAMC,YAAW;gBAASC,cAAc;gBAAGC,aAAa,CAACC,QAAUA,MAAMC,OAAO,CAACC,OAAO;;kCACvG,KAAC1B;wBAAW2B,MAAK;wBAAQC,SAAS,IAAMV,iBAAiBL;kCACtDE,4BAAc,KAACV,kCAAkB,KAACD;;kCAErC,MAACH;wBAAW4B,SAAQ;wBAAWC,WAAU;;4BAAK;4BACpCjB,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|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { PanelDefinition, PanelEditorValues, QueryDefinition, UnknownSpec } from '@perses-dev/core';
|
|
2
3
|
import { Control } from 'react-hook-form';
|
|
3
|
-
import {
|
|
4
|
+
import { PluginEditorRef } from '../PluginEditor';
|
|
4
5
|
export interface PanelSpecEditorProps {
|
|
5
6
|
control: Control<PanelEditorValues>;
|
|
6
7
|
panelDefinition: PanelDefinition;
|
|
@@ -8,5 +9,5 @@ export interface PanelSpecEditorProps {
|
|
|
8
9
|
onPluginSpecChange: (spec: UnknownSpec) => void;
|
|
9
10
|
onJSONChange: (panelDefinitionStr: string) => void;
|
|
10
11
|
}
|
|
11
|
-
export declare
|
|
12
|
+
export declare const PanelSpecEditor: import("react").ForwardRefExoticComponent<PanelSpecEditorProps & import("react").RefAttributes<PluginEditorRef>>;
|
|
12
13
|
//# sourceMappingURL=PanelSpecEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelSpecEditor.d.ts","sourceRoot":"","sources":["../../../src/components/PanelSpecEditor/PanelSpecEditor.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpG,OAAO,EAAE,OAAO,EAAc,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"PanelSpecEditor.d.ts","sourceRoot":"","sources":["../../../src/components/PanelSpecEditor/PanelSpecEditor.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpG,OAAO,EAAE,OAAO,EAAc,MAAM,iBAAiB,CAAC;AAMtD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACpC,eAAe,EAAE,eAAe,CAAC;IACjC,eAAe,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;IACtD,kBAAkB,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;IAChD,YAAY,EAAE,CAAC,kBAAkB,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD;AAED,eAAO,MAAM,eAAe,kHAgG1B,CAAC"}
|