@perses-dev/components 0.55.0-rc.1 → 0.56.0-beta.0
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/AlignSelector/AlignSelector.js +115 -25
- package/dist/AlignSelector/AlignSelector.js.map +1 -1
- package/dist/CodeEditor/CodeEditor.d.ts +19 -0
- package/dist/CodeEditor/CodeEditor.d.ts.map +1 -0
- package/dist/CodeEditor/CodeEditor.js +122 -0
- package/dist/CodeEditor/CodeEditor.js.map +1 -0
- package/dist/ColorPicker/ColorPicker.js +153 -61
- package/dist/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/ColorPicker/OptionsColorPicker.js +147 -52
- package/dist/ColorPicker/OptionsColorPicker.js.map +1 -1
- package/dist/ContentWithLegend/ContentWithLegend.js +144 -41
- package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -1
- package/dist/DensitySelector/DensitySelector.js +53 -20
- package/dist/DensitySelector/DensitySelector.js.map +1 -1
- package/dist/Dialog/Dialog.d.ts +3 -2
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +202 -49
- package/dist/Dialog/Dialog.js.map +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.js +79 -27
- package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/DragAndDrop/DragAndDropList.js +184 -113
- package/dist/DragAndDrop/DragAndDropList.js.map +1 -1
- package/dist/DragAndDrop/DragButton.js +131 -52
- package/dist/DragAndDrop/DragButton.js.map +1 -1
- package/dist/DragAndDrop/DropIndicator.js +51 -26
- package/dist/DragAndDrop/DropIndicator.js.map +1 -1
- package/dist/Drawer/Drawer.js +75 -15
- package/dist/Drawer/Drawer.js.map +1 -1
- package/dist/EChart/EChart.js +179 -90
- package/dist/EChart/EChart.js.map +1 -1
- package/dist/ErrorAlert.js +14 -4
- package/dist/ErrorAlert.js.map +1 -1
- package/dist/ExemplarMetadata/ExemplarMetadataTooltip.js +463 -190
- package/dist/ExemplarMetadata/ExemplarMetadataTooltip.js.map +1 -1
- package/dist/FontSizeSelector/FontSizeSelector.js +82 -50
- package/dist/FontSizeSelector/FontSizeSelector.js.map +1 -1
- package/dist/FormEditor/FormActions.js +88 -14
- package/dist/FormEditor/FormActions.js.map +1 -1
- package/dist/FormatControls/FormatControls.js +246 -99
- package/dist/FormatControls/FormatControls.js.map +1 -1
- package/dist/FormatControls/UnitSelector.js +90 -25
- package/dist/FormatControls/UnitSelector.js.map +1 -1
- package/dist/InfoTooltip/InfoTooltip.js +105 -42
- package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
- package/dist/JSONEditor.d.ts +2 -6
- package/dist/JSONEditor.d.ts.map +1 -1
- package/dist/JSONEditor.js +24 -37
- package/dist/JSONEditor.js.map +1 -1
- package/dist/Legend/CompactLegend.js +77 -27
- package/dist/Legend/CompactLegend.js.map +1 -1
- package/dist/Legend/Legend.js +184 -82
- package/dist/Legend/Legend.js.map +1 -1
- package/dist/Legend/LegendColorBadge.js +54 -9
- package/dist/Legend/LegendColorBadge.js.map +1 -1
- package/dist/Legend/ListLegend.js +46 -16
- package/dist/Legend/ListLegend.js.map +1 -1
- package/dist/Legend/ListLegendItem.js +184 -48
- package/dist/Legend/ListLegendItem.js.map +1 -1
- package/dist/Legend/TableLegend.d.ts.map +1 -1
- package/dist/Legend/TableLegend.js +90 -48
- package/dist/Legend/TableLegend.js.map +1 -1
- package/dist/Legend/legend-model.d.ts +2 -2
- package/dist/Legend/legend-model.d.ts.map +1 -1
- package/dist/Legend/legend-model.js.map +1 -1
- package/dist/LinksEditor/LinkEditorForm.js +148 -67
- package/dist/LinksEditor/LinkEditorForm.js.map +1 -1
- package/dist/ModeSelector/ModeSelector.js +61 -19
- package/dist/ModeSelector/ModeSelector.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js +20 -9
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.js +130 -54
- package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js +17 -6
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js +76 -28
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
- package/dist/Overlay/Overlay.js +71 -27
- package/dist/Overlay/Overlay.js.map +1 -1
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js +96 -38
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
- package/dist/RepeatGrid/RepeatGrid.js +117 -45
- package/dist/RepeatGrid/RepeatGrid.js.map +1 -1
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js +99 -38
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
- package/dist/SortSelector/SortSelector.js +51 -18
- package/dist/SortSelector/SortSelector.js.map +1 -1
- package/dist/SortSelector/SortSelectorButtons.js +109 -25
- package/dist/SortSelector/SortSelectorButtons.js.map +1 -1
- package/dist/Table/InnerTable.js +46 -15
- package/dist/Table/InnerTable.js.map +1 -1
- package/dist/Table/Table.d.ts +3 -1
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +410 -158
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/TableBody.js +15 -4
- package/dist/Table/TableBody.js.map +1 -1
- package/dist/Table/TableCell.js +284 -107
- package/dist/Table/TableCell.js.map +1 -1
- package/dist/Table/TableCheckbox.js +101 -32
- package/dist/Table/TableCheckbox.js.map +1 -1
- package/dist/Table/TableFoot.js +15 -4
- package/dist/Table/TableFoot.js.map +1 -1
- package/dist/Table/TableHead.js +15 -4
- package/dist/Table/TableHead.js.map +1 -1
- package/dist/Table/TableHeaderCell.js +119 -62
- package/dist/Table/TableHeaderCell.js.map +1 -1
- package/dist/Table/TableRow.js +33 -9
- package/dist/Table/TableRow.js.map +1 -1
- package/dist/Table/TableToolbar.d.ts +5 -4
- package/dist/Table/TableToolbar.d.ts.map +1 -1
- package/dist/Table/TableToolbar.js +172 -100
- package/dist/Table/TableToolbar.js.map +1 -1
- package/dist/Table/VirtualizedTable.d.ts +11 -11
- package/dist/Table/VirtualizedTable.d.ts.map +1 -1
- package/dist/Table/VirtualizedTable.js +387 -219
- package/dist/Table/VirtualizedTable.js.map +1 -1
- package/dist/Table/VirtualizedTableContainer.js +27 -7
- package/dist/Table/VirtualizedTableContainer.js.map +1 -1
- package/dist/Table/hooks/useFuzzySearch.d.ts +6 -5
- package/dist/Table/hooks/useFuzzySearch.d.ts.map +1 -1
- package/dist/Table/hooks/useFuzzySearch.js +57 -32
- package/dist/Table/hooks/useFuzzySearch.js.map +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.js +115 -74
- package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.d.ts +1 -1
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.d.ts.map +1 -1
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js +74 -53
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
- package/dist/Table/model/table-model.d.ts +44 -15
- package/dist/Table/model/table-model.d.ts.map +1 -1
- package/dist/Table/model/table-model.js +33 -1
- package/dist/Table/model/table-model.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdInput.js +137 -47
- package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.js +341 -174
- package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
- package/dist/TimeRangeSelector/DateTimeRangePicker.js +368 -162
- package/dist/TimeRangeSelector/DateTimeRangePicker.js.map +1 -1
- package/dist/TimeRangeSelector/TimeRangeSelector.js +580 -209
- package/dist/TimeRangeSelector/TimeRangeSelector.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.js +189 -65
- package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js +168 -78
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.js +38 -11
- package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js +229 -72
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.js +73 -27
- package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.js +221 -121
- package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.js +44 -38
- package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
- package/dist/TimeZoneSelector.js +131 -36
- package/dist/TimeZoneSelector.js.map +1 -1
- package/dist/ToolbarIconButton/ToolbarIconButton.js +18 -7
- package/dist/ToolbarIconButton/ToolbarIconButton.js.map +1 -1
- package/dist/TransformsEditor/TransformEditor.js +830 -334
- package/dist/TransformsEditor/TransformEditor.js.map +1 -1
- package/dist/TransformsEditor/TransformEditorContainer.js +252 -90
- package/dist/TransformsEditor/TransformEditorContainer.js.map +1 -1
- package/dist/TransformsEditor/TransformsEditor.js +170 -59
- package/dist/TransformsEditor/TransformsEditor.js.map +1 -1
- package/dist/ValueMappingEditor/ValueMappingEditor.js +800 -322
- package/dist/ValueMappingEditor/ValueMappingEditor.js.map +1 -1
- package/dist/ValueMappingEditor/ValueMappingsEditor.js +218 -91
- package/dist/ValueMappingEditor/ValueMappingsEditor.js.map +1 -1
- package/dist/YAMLEditor/YAMLEditor.d.ts +12 -0
- package/dist/YAMLEditor/YAMLEditor.d.ts.map +1 -0
- package/dist/YAMLEditor/YAMLEditor.js +41 -0
- package/dist/YAMLEditor/YAMLEditor.js.map +1 -0
- package/dist/YAMLEditor/index.d.ts +2 -0
- package/dist/YAMLEditor/index.d.ts.map +1 -0
- package/dist/YAMLEditor/index.js +15 -0
- package/dist/YAMLEditor/index.js.map +1 -0
- package/dist/YAMLEditor/yaml-utils.d.ts +11 -0
- package/dist/YAMLEditor/yaml-utils.d.ts.map +1 -0
- package/dist/YAMLEditor/yaml-utils.js +52 -0
- package/dist/YAMLEditor/yaml-utils.js.map +1 -0
- package/dist/YAxisLabel.js +64 -20
- package/dist/YAxisLabel.js.map +1 -1
- package/dist/context/ChartsProvider.js +32 -16
- package/dist/context/ChartsProvider.js.map +1 -1
- package/dist/context/ItemActionsProvider.js +110 -61
- package/dist/context/ItemActionsProvider.js.map +1 -1
- package/dist/context/SelectionProvider.js +170 -66
- package/dist/context/SelectionProvider.js.map +1 -1
- package/dist/context/SnackbarProvider.js +101 -44
- package/dist/context/SnackbarProvider.js.map +1 -1
- package/dist/context/TimeZoneProvider.js +35 -14
- package/dist/context/TimeZoneProvider.js.map +1 -1
- package/dist/controls/TextField.js +86 -25
- package/dist/controls/TextField.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/browser-storage.js +64 -34
- package/dist/utils/browser-storage.js.map +1 -1
- package/dist/utils/time-series-data.d.ts.map +1 -1
- package/dist/utils/time-series-data.js +5 -2
- package/dist/utils/time-series-data.js.map +1 -1
- package/package.json +13 -7
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { c as _c } from "react-compiler-runtime";
|
|
2
3
|
// Copyright The Perses Authors
|
|
3
4
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
5
|
// you may not use this file except in compliance with the License.
|
|
@@ -14,75 +15,155 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
15
|
import { Checkbox, FormControlLabel, Stack } from "@mui/material";
|
|
15
16
|
import { TextField } from "../controls/index.js";
|
|
16
17
|
export const LinkEditorForm = (props)=>{
|
|
18
|
+
const $ = _c(29);
|
|
17
19
|
const { mode, url, name, newTabOpen, renderVariables, tooltip } = props;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
20
|
+
const t0 = url.error?.hasError;
|
|
21
|
+
const t1 = url.error?.helperText;
|
|
22
|
+
let t2;
|
|
23
|
+
if ($[0] !== t0 || $[1] !== t1 || $[2] !== url.label || $[3] !== url.onBlur || $[4] !== url.onChange || $[5] !== url.placeholder || $[6] !== url.value) {
|
|
24
|
+
t2 = /*#__PURE__*/ _jsx(TextField, {
|
|
25
|
+
label: url.label,
|
|
26
|
+
error: t0,
|
|
27
|
+
helperText: t1,
|
|
28
|
+
onChange: url.onChange,
|
|
29
|
+
onBlur: url.onBlur,
|
|
30
|
+
placeholder: url.placeholder,
|
|
31
|
+
multiline: true,
|
|
32
|
+
maxRows: 5,
|
|
33
|
+
required: true,
|
|
34
|
+
fullWidth: true,
|
|
35
|
+
value: url.value
|
|
36
|
+
});
|
|
37
|
+
$[0] = t0;
|
|
38
|
+
$[1] = t1;
|
|
39
|
+
$[2] = url.label;
|
|
40
|
+
$[3] = url.onBlur;
|
|
41
|
+
$[4] = url.onChange;
|
|
42
|
+
$[5] = url.placeholder;
|
|
43
|
+
$[6] = url.value;
|
|
44
|
+
$[7] = t2;
|
|
45
|
+
} else {
|
|
46
|
+
t2 = $[7];
|
|
47
|
+
}
|
|
48
|
+
let t3;
|
|
49
|
+
if ($[8] !== mode || $[9] !== name || $[10] !== tooltip) {
|
|
50
|
+
t3 = (name || tooltip) && /*#__PURE__*/ _jsxs(Stack, {
|
|
51
|
+
gap: 1,
|
|
52
|
+
direction: mode === "inline" ? "row" : "column",
|
|
53
|
+
children: [
|
|
54
|
+
name && /*#__PURE__*/ _jsx(TextField, {
|
|
55
|
+
sx: {
|
|
56
|
+
flexGrow: "1"
|
|
57
|
+
},
|
|
58
|
+
label: name.label,
|
|
59
|
+
onChange: name?.onChange,
|
|
60
|
+
placeholder: name?.placeholder,
|
|
61
|
+
value: name?.value
|
|
62
|
+
}),
|
|
63
|
+
tooltip && /*#__PURE__*/ _jsx(TextField, {
|
|
64
|
+
sx: {
|
|
65
|
+
flexGrow: "1"
|
|
66
|
+
},
|
|
67
|
+
label: tooltip.label,
|
|
68
|
+
onChange: tooltip?.onChange,
|
|
69
|
+
placeholder: tooltip?.placeholder,
|
|
70
|
+
value: tooltip?.value
|
|
71
|
+
})
|
|
72
|
+
]
|
|
73
|
+
});
|
|
74
|
+
$[8] = mode;
|
|
75
|
+
$[9] = name;
|
|
76
|
+
$[10] = tooltip;
|
|
77
|
+
$[11] = t3;
|
|
78
|
+
} else {
|
|
79
|
+
t3 = $[11];
|
|
80
|
+
}
|
|
81
|
+
let t4;
|
|
82
|
+
if ($[12] !== renderVariables) {
|
|
83
|
+
t4 = renderVariables && /*#__PURE__*/ _jsx(FormControlLabel, {
|
|
84
|
+
label: renderVariables.label,
|
|
85
|
+
control: /*#__PURE__*/ _jsx(Checkbox, {
|
|
86
|
+
checked: renderVariables.value,
|
|
87
|
+
onChange: (e)=>{
|
|
88
|
+
renderVariables?.onChange(e.target.checked);
|
|
89
|
+
}
|
|
83
90
|
})
|
|
84
|
-
|
|
85
|
-
|
|
91
|
+
});
|
|
92
|
+
$[12] = renderVariables;
|
|
93
|
+
$[13] = t4;
|
|
94
|
+
} else {
|
|
95
|
+
t4 = $[13];
|
|
96
|
+
}
|
|
97
|
+
let t5;
|
|
98
|
+
if ($[14] !== newTabOpen) {
|
|
99
|
+
t5 = (e_0)=>{
|
|
100
|
+
newTabOpen?.onChange(e_0.target.checked);
|
|
101
|
+
};
|
|
102
|
+
$[14] = newTabOpen;
|
|
103
|
+
$[15] = t5;
|
|
104
|
+
} else {
|
|
105
|
+
t5 = $[15];
|
|
106
|
+
}
|
|
107
|
+
let t6;
|
|
108
|
+
if ($[16] !== newTabOpen.value || $[17] !== t5) {
|
|
109
|
+
t6 = /*#__PURE__*/ _jsx(Checkbox, {
|
|
110
|
+
checked: newTabOpen.value,
|
|
111
|
+
onChange: t5
|
|
112
|
+
});
|
|
113
|
+
$[16] = newTabOpen.value;
|
|
114
|
+
$[17] = t5;
|
|
115
|
+
$[18] = t6;
|
|
116
|
+
} else {
|
|
117
|
+
t6 = $[18];
|
|
118
|
+
}
|
|
119
|
+
let t7;
|
|
120
|
+
if ($[19] !== newTabOpen.label || $[20] !== t6) {
|
|
121
|
+
t7 = /*#__PURE__*/ _jsx(FormControlLabel, {
|
|
122
|
+
label: newTabOpen.label,
|
|
123
|
+
control: t6
|
|
124
|
+
});
|
|
125
|
+
$[19] = newTabOpen.label;
|
|
126
|
+
$[20] = t6;
|
|
127
|
+
$[21] = t7;
|
|
128
|
+
} else {
|
|
129
|
+
t7 = $[21];
|
|
130
|
+
}
|
|
131
|
+
let t8;
|
|
132
|
+
if ($[22] !== t4 || $[23] !== t7) {
|
|
133
|
+
t8 = /*#__PURE__*/ _jsxs(Stack, {
|
|
134
|
+
direction: "row",
|
|
135
|
+
gap: 1,
|
|
136
|
+
children: [
|
|
137
|
+
t4,
|
|
138
|
+
t7
|
|
139
|
+
]
|
|
140
|
+
});
|
|
141
|
+
$[22] = t4;
|
|
142
|
+
$[23] = t7;
|
|
143
|
+
$[24] = t8;
|
|
144
|
+
} else {
|
|
145
|
+
t8 = $[24];
|
|
146
|
+
}
|
|
147
|
+
let t9;
|
|
148
|
+
if ($[25] !== t2 || $[26] !== t3 || $[27] !== t8) {
|
|
149
|
+
t9 = /*#__PURE__*/ _jsxs(Stack, {
|
|
150
|
+
direction: "column",
|
|
151
|
+
gap: 2,
|
|
152
|
+
flexGrow: 1,
|
|
153
|
+
children: [
|
|
154
|
+
t2,
|
|
155
|
+
t3,
|
|
156
|
+
t8
|
|
157
|
+
]
|
|
158
|
+
});
|
|
159
|
+
$[25] = t2;
|
|
160
|
+
$[26] = t3;
|
|
161
|
+
$[27] = t8;
|
|
162
|
+
$[28] = t9;
|
|
163
|
+
} else {
|
|
164
|
+
t9 = $[28];
|
|
165
|
+
}
|
|
166
|
+
return t9;
|
|
86
167
|
};
|
|
87
168
|
|
|
88
169
|
//# sourceMappingURL=LinkEditorForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/LinksEditor/LinkEditorForm.tsx"],"sourcesContent":["// Copyright 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 { Checkbox, FormControlLabel, Stack } from '@mui/material';\nimport type { ReactElement } from 'react';\n\nimport { TextField } from '../controls';\n\nexport interface LinkEditorFormField<T> {\n value: T;\n onChange: (value: T) => void;\n onBlur?: () => void;\n placeholder?: string;\n label: string;\n error: { hasError?: boolean; helperText?: string };\n}\n\nexport interface LinkEditorFormProps {\n mode: 'inline' | 'modalEmbedded';\n url: LinkEditorFormField<string>;\n name?: Omit<LinkEditorFormField<string>, 'error'>;\n tooltip?: Omit<LinkEditorFormField<string>, 'error'>;\n newTabOpen: Omit<LinkEditorFormField<boolean>, 'error'>;\n renderVariables?: Omit<LinkEditorFormField<boolean>, 'error'>;\n}\n\nexport const LinkEditorForm = (props: LinkEditorFormProps): ReactElement => {\n const { mode, url, name, newTabOpen, renderVariables, tooltip } = props;\n\n return (\n <Stack direction=\"column\" gap={2} flexGrow={1}>\n <TextField\n label={url.label}\n error={url.error?.hasError}\n helperText={url.error?.helperText}\n onChange={url.onChange}\n onBlur={url.onBlur}\n placeholder={url.placeholder}\n multiline\n maxRows={5}\n required\n fullWidth\n value={url.value}\n />\n {(name || tooltip) && (\n <Stack gap={1} direction={mode === 'inline' ? 'row' : 'column'}>\n {name && (\n <TextField\n sx={{ flexGrow: '1' }}\n label={name.label}\n onChange={name?.onChange}\n placeholder={name?.placeholder}\n value={name?.value}\n />\n )}\n {tooltip && (\n <TextField\n sx={{ flexGrow: '1' }}\n label={tooltip.label}\n onChange={tooltip?.onChange}\n placeholder={tooltip?.placeholder}\n value={tooltip?.value}\n />\n )}\n </Stack>\n )}\n <Stack direction=\"row\" gap={1}>\n {renderVariables && (\n <FormControlLabel\n label={renderVariables.label}\n control={\n <Checkbox\n checked={renderVariables.value}\n onChange={(e) => {\n renderVariables?.onChange(e.target.checked);\n }}\n />\n }\n />\n )}\n\n <FormControlLabel\n label={newTabOpen.label}\n control={\n <Checkbox\n checked={newTabOpen.value}\n onChange={(e) => {\n newTabOpen?.onChange(e.target.checked);\n }}\n />\n }\n />\n </Stack>\n </Stack>\n );\n};\n"],"names":["Checkbox","FormControlLabel","Stack","TextField","LinkEditorForm"
|
|
1
|
+
{"version":3,"sources":["../../src/LinksEditor/LinkEditorForm.tsx"],"sourcesContent":["// Copyright 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 { Checkbox, FormControlLabel, Stack } from '@mui/material';\nimport type { ReactElement } from 'react';\n\nimport { TextField } from '../controls';\n\nexport interface LinkEditorFormField<T> {\n value: T;\n onChange: (value: T) => void;\n onBlur?: () => void;\n placeholder?: string;\n label: string;\n error: { hasError?: boolean; helperText?: string };\n}\n\nexport interface LinkEditorFormProps {\n mode: 'inline' | 'modalEmbedded';\n url: LinkEditorFormField<string>;\n name?: Omit<LinkEditorFormField<string>, 'error'>;\n tooltip?: Omit<LinkEditorFormField<string>, 'error'>;\n newTabOpen: Omit<LinkEditorFormField<boolean>, 'error'>;\n renderVariables?: Omit<LinkEditorFormField<boolean>, 'error'>;\n}\n\nexport const LinkEditorForm = (props: LinkEditorFormProps): ReactElement => {\n const { mode, url, name, newTabOpen, renderVariables, tooltip } = props;\n\n return (\n <Stack direction=\"column\" gap={2} flexGrow={1}>\n <TextField\n label={url.label}\n error={url.error?.hasError}\n helperText={url.error?.helperText}\n onChange={url.onChange}\n onBlur={url.onBlur}\n placeholder={url.placeholder}\n multiline\n maxRows={5}\n required\n fullWidth\n value={url.value}\n />\n {(name || tooltip) && (\n <Stack gap={1} direction={mode === 'inline' ? 'row' : 'column'}>\n {name && (\n <TextField\n sx={{ flexGrow: '1' }}\n label={name.label}\n onChange={name?.onChange}\n placeholder={name?.placeholder}\n value={name?.value}\n />\n )}\n {tooltip && (\n <TextField\n sx={{ flexGrow: '1' }}\n label={tooltip.label}\n onChange={tooltip?.onChange}\n placeholder={tooltip?.placeholder}\n value={tooltip?.value}\n />\n )}\n </Stack>\n )}\n <Stack direction=\"row\" gap={1}>\n {renderVariables && (\n <FormControlLabel\n label={renderVariables.label}\n control={\n <Checkbox\n checked={renderVariables.value}\n onChange={(e) => {\n renderVariables?.onChange(e.target.checked);\n }}\n />\n }\n />\n )}\n\n <FormControlLabel\n label={newTabOpen.label}\n control={\n <Checkbox\n checked={newTabOpen.value}\n onChange={(e) => {\n newTabOpen?.onChange(e.target.checked);\n }}\n />\n }\n />\n </Stack>\n </Stack>\n );\n};\n"],"names":["Checkbox","FormControlLabel","Stack","TextField","LinkEditorForm"],"mappings":";;AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,QAAQ,EAAEC,gBAAgB,EAAEC,KAAK,QAAQ,gBAAgB;AAGlE,SAASC,SAAS,QAAQ,uBAAc;AAoBxC,OAAO,MAAMC,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqE5B"}
|
|
@@ -11,33 +11,75 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { c as _c } from "react-compiler-runtime";
|
|
14
15
|
import { OptionsEditorControl } from "../OptionsEditorLayout/index.js";
|
|
15
16
|
import { SettingsAutocomplete } from "../SettingsAutocomplete/index.js";
|
|
16
17
|
const MODE_OPTIONS = [
|
|
17
18
|
{
|
|
18
|
-
id:
|
|
19
|
-
label:
|
|
19
|
+
id: "value",
|
|
20
|
+
label: "Value"
|
|
20
21
|
},
|
|
21
22
|
{
|
|
22
|
-
id:
|
|
23
|
-
label:
|
|
23
|
+
id: "percentage",
|
|
24
|
+
label: "Percentage"
|
|
24
25
|
}
|
|
25
26
|
];
|
|
26
|
-
export function ModeSelector(
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
27
|
+
export function ModeSelector(t0) {
|
|
28
|
+
const $ = _c(10);
|
|
29
|
+
const { disablePercentageMode, onChange, value: t1 } = t0;
|
|
30
|
+
const value = t1 === undefined ? "value" : t1;
|
|
31
|
+
let t2;
|
|
32
|
+
if ($[0] !== onChange) {
|
|
33
|
+
t2 = (_, t3)=>{
|
|
34
|
+
const { id } = t3;
|
|
35
|
+
onChange(id);
|
|
36
|
+
};
|
|
37
|
+
$[0] = onChange;
|
|
38
|
+
$[1] = t2;
|
|
39
|
+
} else {
|
|
40
|
+
t2 = $[1];
|
|
41
|
+
}
|
|
42
|
+
const handleModeChange = t2;
|
|
43
|
+
let t3;
|
|
44
|
+
if ($[2] !== value) {
|
|
45
|
+
t3 = MODE_OPTIONS.find((o)=>o.id === value);
|
|
46
|
+
$[2] = value;
|
|
47
|
+
$[3] = t3;
|
|
48
|
+
} else {
|
|
49
|
+
t3 = $[3];
|
|
50
|
+
}
|
|
51
|
+
let t4;
|
|
52
|
+
if ($[4] !== disablePercentageMode) {
|
|
53
|
+
t4 = (o_1)=>o_1.id === "percentage" && disablePercentageMode;
|
|
54
|
+
$[4] = disablePercentageMode;
|
|
55
|
+
$[5] = t4;
|
|
56
|
+
} else {
|
|
57
|
+
t4 = $[5];
|
|
58
|
+
}
|
|
59
|
+
let t5;
|
|
60
|
+
if ($[6] !== handleModeChange || $[7] !== t3 || $[8] !== t4) {
|
|
61
|
+
t5 = /*#__PURE__*/ _jsx(OptionsEditorControl, {
|
|
62
|
+
label: "Mode",
|
|
63
|
+
control: /*#__PURE__*/ _jsx(SettingsAutocomplete, {
|
|
64
|
+
value: t3,
|
|
65
|
+
options: MODE_OPTIONS,
|
|
66
|
+
getOptionLabel: _temp,
|
|
67
|
+
getOptionDisabled: t4,
|
|
68
|
+
onChange: handleModeChange,
|
|
69
|
+
disableClearable: true
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
$[6] = handleModeChange;
|
|
73
|
+
$[7] = t3;
|
|
74
|
+
$[8] = t4;
|
|
75
|
+
$[9] = t5;
|
|
76
|
+
} else {
|
|
77
|
+
t5 = $[9];
|
|
78
|
+
}
|
|
79
|
+
return t5;
|
|
80
|
+
}
|
|
81
|
+
function _temp(o_0) {
|
|
82
|
+
return o_0.label;
|
|
41
83
|
}
|
|
42
84
|
|
|
43
85
|
//# sourceMappingURL=ModeSelector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ModeSelector/ModeSelector.tsx"],"sourcesContent":["// Copyright 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 type { ReactElement } from 'react';\n\nimport { OptionsEditorControl } from '../OptionsEditorLayout';\nimport { SettingsAutocomplete } from '../SettingsAutocomplete';\n\nconst MODE_OPTIONS: Array<{ id: ModeOption; label: string }> = [\n { id: 'value', label: 'Value' },\n { id: 'percentage', label: 'Percentage' },\n];\n\nexport type ModeOption = 'value' | 'percentage';\n\nexport interface ModeSelectorProps {\n disablePercentageMode: boolean;\n onChange: (mode: ModeOption) => void;\n value?: ModeOption;\n}\n\nexport function ModeSelector({ disablePercentageMode, onChange, value = 'value' }: ModeSelectorProps): ReactElement {\n const handleModeChange = (_: unknown, { id }: { id: ModeOption }): void => {\n onChange(id);\n };\n\n return (\n <OptionsEditorControl\n label=\"Mode\"\n control={\n <SettingsAutocomplete\n value={MODE_OPTIONS.find((o) => o.id === value)}\n options={MODE_OPTIONS}\n getOptionLabel={(o) => o.label}\n getOptionDisabled={(o) => o.id === 'percentage' && disablePercentageMode}\n onChange={handleModeChange}\n disableClearable\n />\n }\n />\n );\n}\n"],"names":["OptionsEditorControl","SettingsAutocomplete","MODE_OPTIONS","id","label"
|
|
1
|
+
{"version":3,"sources":["../../src/ModeSelector/ModeSelector.tsx"],"sourcesContent":["// Copyright 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 type { ReactElement } from 'react';\n\nimport { OptionsEditorControl } from '../OptionsEditorLayout';\nimport { SettingsAutocomplete } from '../SettingsAutocomplete';\n\nconst MODE_OPTIONS: Array<{ id: ModeOption; label: string }> = [\n { id: 'value', label: 'Value' },\n { id: 'percentage', label: 'Percentage' },\n];\n\nexport type ModeOption = 'value' | 'percentage';\n\nexport interface ModeSelectorProps {\n disablePercentageMode: boolean;\n onChange: (mode: ModeOption) => void;\n value?: ModeOption;\n}\n\nexport function ModeSelector({ disablePercentageMode, onChange, value = 'value' }: ModeSelectorProps): ReactElement {\n const handleModeChange = (_: unknown, { id }: { id: ModeOption }): void => {\n onChange(id);\n };\n\n return (\n <OptionsEditorControl\n label=\"Mode\"\n control={\n <SettingsAutocomplete\n value={MODE_OPTIONS.find((o) => o.id === value)}\n options={MODE_OPTIONS}\n getOptionLabel={(o) => o.label}\n getOptionDisabled={(o) => o.id === 'percentage' && disablePercentageMode}\n onChange={handleModeChange}\n disableClearable\n />\n }\n />\n );\n}\n"],"names":["OptionsEditorControl","SettingsAutocomplete","MODE_OPTIONS","id","label"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,wEAAwE;AACxE,qEAAqE;AACrE,6EAA6E;AAC7E,sEAAsE;AACtE,iCAAiC;;;AAIjC,SAASA,oBAAoB,QAAQ,kCAAyB;AAC9D,SAASC,oBAAoB,QAAQ,mCAA0B;AAE/D,MAAMC,eAAyD;IAC7D;QAAEC,IAAI;QAASC,OAAO;IAAQ;IAC9B;QAAED,IAAI;QAAcC,OAAO;IAAa;CACzC;AAUD,OAAO"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c as _c } from "react-compiler-runtime";
|
|
2
3
|
// Copyright The Perses Authors
|
|
3
4
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
5
|
// you may not use this file except in compliance with the License.
|
|
@@ -14,15 +15,25 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
14
15
|
import { Grid, Stack } from "@mui/material";
|
|
15
16
|
/**
|
|
16
17
|
* Lay out content in a column within panel options.
|
|
17
|
-
*/ export const OptionsEditorColumn = (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
*/ export const OptionsEditorColumn = (t0)=>{
|
|
19
|
+
const $ = _c(2);
|
|
20
|
+
const { children } = t0;
|
|
21
|
+
let t1;
|
|
22
|
+
if ($[0] !== children) {
|
|
23
|
+
t1 = /*#__PURE__*/ _jsx(Grid, {
|
|
24
|
+
item: true,
|
|
25
|
+
xs: 4,
|
|
26
|
+
children: /*#__PURE__*/ _jsx(Stack, {
|
|
27
|
+
spacing: 3,
|
|
28
|
+
children: children
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
$[0] = children;
|
|
32
|
+
$[1] = t1;
|
|
33
|
+
} else {
|
|
34
|
+
t1 = $[1];
|
|
35
|
+
}
|
|
36
|
+
return t1;
|
|
26
37
|
};
|
|
27
38
|
|
|
28
39
|
//# sourceMappingURL=OptionsEditorColumn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorColumn.tsx"],"sourcesContent":["// Copyright 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 { Grid, Stack } from '@mui/material';\nimport type { ReactElement } from 'react';\n\nexport type OptionsEditorColumnProps = {\n /**\n * Components to render in the column. These will usually be\n * `OptionsEditorGroup` components.\n */\n children: React.ReactNode;\n};\n\n/**\n * Lay out content in a column within panel options.\n */\nexport const OptionsEditorColumn = ({ children }: OptionsEditorColumnProps): ReactElement => {\n return (\n <Grid item xs={4}>\n <Stack spacing={3}>{children}</Stack>\n </Grid>\n );\n};\n"],"names":["Grid","Stack","OptionsEditorColumn"
|
|
1
|
+
{"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorColumn.tsx"],"sourcesContent":["// Copyright 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 { Grid, Stack } from '@mui/material';\nimport type { ReactElement } from 'react';\n\nexport type OptionsEditorColumnProps = {\n /**\n * Components to render in the column. These will usually be\n * `OptionsEditorGroup` components.\n */\n children: React.ReactNode;\n};\n\n/**\n * Lay out content in a column within panel options.\n */\nexport const OptionsEditorColumn = ({ children }: OptionsEditorColumnProps): ReactElement => {\n return (\n <Grid item xs={4}>\n <Stack spacing={3}>{children}</Stack>\n </Grid>\n );\n};\n"],"names":["Grid","Stack","OptionsEditorColumn"],"mappings":";;AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,IAAI,EAAEC,KAAK,QAAQ,gBAAgB;AAW5C;;CAEC,GACD,OAAO,MAAMC,sBAAsB;;;;;;;;;;;;;;;;;;;EAMjC"}
|
|
@@ -11,71 +11,147 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
14
|
+
import { c as _c } from "react-compiler-runtime";
|
|
14
15
|
import { FormControl, FormLabel, Stack, Box, IconButton } from "@mui/material";
|
|
15
16
|
import InformationOutlineIcon from "mdi-material-ui/InformationOutline";
|
|
16
17
|
import React, { useId } from "react";
|
|
17
18
|
import { InfoTooltip } from "../InfoTooltip/index.js";
|
|
18
|
-
export const OptionsEditorControl = (
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
export const OptionsEditorControl = (t0)=>{
|
|
20
|
+
const $ = _c(21);
|
|
21
|
+
const { label, control, description } = t0;
|
|
21
22
|
const generatedControlId = `EditorSectionControl-${useId()}`;
|
|
22
23
|
const controlId = `${generatedControlId}-control`;
|
|
23
24
|
const labelId = `${generatedControlId}-label`;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
let t1;
|
|
26
|
+
if ($[0] !== controlId || $[1] !== labelId) {
|
|
27
|
+
t1 = {
|
|
28
|
+
id: controlId,
|
|
29
|
+
"aria-labelledby": labelId
|
|
30
|
+
};
|
|
31
|
+
$[0] = controlId;
|
|
32
|
+
$[1] = labelId;
|
|
33
|
+
$[2] = t1;
|
|
34
|
+
} else {
|
|
35
|
+
t1 = $[2];
|
|
36
|
+
}
|
|
37
|
+
const controlProps = t1;
|
|
38
|
+
let t2;
|
|
39
|
+
if ($[3] !== controlId || $[4] !== label || $[5] !== labelId) {
|
|
40
|
+
t2 = /*#__PURE__*/ _jsx(FormLabel, {
|
|
41
|
+
id: labelId,
|
|
42
|
+
htmlFor: controlId,
|
|
43
|
+
children: label
|
|
44
|
+
});
|
|
45
|
+
$[3] = controlId;
|
|
46
|
+
$[4] = label;
|
|
47
|
+
$[5] = labelId;
|
|
48
|
+
$[6] = t2;
|
|
49
|
+
} else {
|
|
50
|
+
t2 = $[6];
|
|
51
|
+
}
|
|
52
|
+
let t3;
|
|
53
|
+
if ($[7] !== description) {
|
|
54
|
+
t3 = description && /*#__PURE__*/ _jsx(InfoTooltip, {
|
|
55
|
+
description: description,
|
|
56
|
+
enterDelay: 100,
|
|
57
|
+
children: /*#__PURE__*/ _jsx(IconButton, {
|
|
58
|
+
size: "small",
|
|
59
|
+
sx: _temp,
|
|
60
|
+
children: /*#__PURE__*/ _jsx(InformationOutlineIcon, {
|
|
61
|
+
"aria-describedby": "info-tooltip",
|
|
62
|
+
"aria-hidden": false,
|
|
63
|
+
fontSize: "inherit",
|
|
64
|
+
sx: {
|
|
65
|
+
color: _temp2
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
$[7] = description;
|
|
71
|
+
$[8] = t3;
|
|
72
|
+
} else {
|
|
73
|
+
t3 = $[8];
|
|
74
|
+
}
|
|
75
|
+
let t4;
|
|
76
|
+
if ($[9] !== t2 || $[10] !== t3) {
|
|
77
|
+
t4 = /*#__PURE__*/ _jsxs(Stack, {
|
|
30
78
|
direction: "row",
|
|
31
79
|
alignItems: "center",
|
|
32
|
-
justifyContent: "
|
|
80
|
+
justifyContent: "center",
|
|
33
81
|
children: [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
children: [
|
|
72
|
-
" ",
|
|
73
|
-
/*#__PURE__*/ React.cloneElement(control, controlProps)
|
|
74
|
-
]
|
|
75
|
-
})
|
|
82
|
+
t2,
|
|
83
|
+
t3
|
|
84
|
+
]
|
|
85
|
+
});
|
|
86
|
+
$[9] = t2;
|
|
87
|
+
$[10] = t3;
|
|
88
|
+
$[11] = t4;
|
|
89
|
+
} else {
|
|
90
|
+
t4 = $[11];
|
|
91
|
+
}
|
|
92
|
+
let t5;
|
|
93
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
94
|
+
t5 = {
|
|
95
|
+
width: "180px",
|
|
96
|
+
textAlign: "right"
|
|
97
|
+
};
|
|
98
|
+
$[12] = t5;
|
|
99
|
+
} else {
|
|
100
|
+
t5 = $[12];
|
|
101
|
+
}
|
|
102
|
+
let t6;
|
|
103
|
+
if ($[13] !== control || $[14] !== controlProps) {
|
|
104
|
+
t6 = /*#__PURE__*/ React.cloneElement(control, controlProps);
|
|
105
|
+
$[13] = control;
|
|
106
|
+
$[14] = controlProps;
|
|
107
|
+
$[15] = t6;
|
|
108
|
+
} else {
|
|
109
|
+
t6 = $[15];
|
|
110
|
+
}
|
|
111
|
+
let t7;
|
|
112
|
+
if ($[16] !== t6) {
|
|
113
|
+
t7 = /*#__PURE__*/ _jsxs(Box, {
|
|
114
|
+
sx: t5,
|
|
115
|
+
children: [
|
|
116
|
+
" ",
|
|
117
|
+
t6
|
|
76
118
|
]
|
|
77
|
-
})
|
|
78
|
-
|
|
119
|
+
});
|
|
120
|
+
$[16] = t6;
|
|
121
|
+
$[17] = t7;
|
|
122
|
+
} else {
|
|
123
|
+
t7 = $[17];
|
|
124
|
+
}
|
|
125
|
+
let t8;
|
|
126
|
+
if ($[18] !== t4 || $[19] !== t7) {
|
|
127
|
+
t8 = /*#__PURE__*/ _jsx(FormControl, {
|
|
128
|
+
children: /*#__PURE__*/ _jsxs(Stack, {
|
|
129
|
+
direction: "row",
|
|
130
|
+
alignItems: "center",
|
|
131
|
+
justifyContent: "space-between",
|
|
132
|
+
children: [
|
|
133
|
+
t4,
|
|
134
|
+
t7
|
|
135
|
+
]
|
|
136
|
+
})
|
|
137
|
+
});
|
|
138
|
+
$[18] = t4;
|
|
139
|
+
$[19] = t7;
|
|
140
|
+
$[20] = t8;
|
|
141
|
+
} else {
|
|
142
|
+
t8 = $[20];
|
|
143
|
+
}
|
|
144
|
+
return t8;
|
|
79
145
|
};
|
|
146
|
+
function _temp(theme) {
|
|
147
|
+
return {
|
|
148
|
+
borderRadius: theme.shape.borderRadius,
|
|
149
|
+
padding: "4x",
|
|
150
|
+
margin: "0 2px"
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function _temp2(theme_0) {
|
|
154
|
+
return theme_0.palette.grey[700];
|
|
155
|
+
}
|
|
80
156
|
|
|
81
157
|
//# sourceMappingURL=OptionsEditorControl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorControl.tsx"],"sourcesContent":["// Copyright 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 type { FormControlLabelProps } from '@mui/material';\nimport { FormControl, FormLabel, Stack, Box, IconButton } from '@mui/material';\nimport InformationOutlineIcon from 'mdi-material-ui/InformationOutline';\nimport type { ReactElement } from 'react';\nimport React, { useId } from 'react';\n\nimport { InfoTooltip } from '../InfoTooltip';\n\nexport type OptionsEditorControlProps = Pick<FormControlLabelProps, 'label' | 'control'> & {\n description?: string;\n};\n\nexport const OptionsEditorControl = ({ label, control, description }: OptionsEditorControlProps): ReactElement => {\n // Make sure we have a unique ID we can use for associating labels and\n // controls for a11y.\n const generatedControlId = `EditorSectionControl-${useId()}`;\n const controlId = `${generatedControlId}-control`;\n const labelId = `${generatedControlId}-label`;\n\n const controlProps = {\n id: controlId,\n 'aria-labelledby': labelId,\n };\n\n return (\n <FormControl>\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\">\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"center\">\n <FormLabel id={labelId} htmlFor={controlId}>\n {label}\n </FormLabel>\n {description && (\n <InfoTooltip description={description} enterDelay={100}>\n <IconButton\n size=\"small\"\n sx={(theme) => ({ borderRadius: theme.shape.borderRadius, padding: '4x', margin: '0 2px' })}\n >\n <InformationOutlineIcon\n aria-describedby=\"info-tooltip\"\n aria-hidden={false}\n fontSize=\"inherit\"\n sx={{ color: (theme) => theme.palette.grey[700] }}\n />\n </IconButton>\n </InfoTooltip>\n )}\n </Stack>\n <Box sx={{ width: '180px', textAlign: 'right' }}> {React.cloneElement(control, controlProps)}</Box>\n </Stack>\n </FormControl>\n );\n};\n"],"names":["FormControl","FormLabel","Stack","Box","IconButton","InformationOutlineIcon","React","useId","InfoTooltip","OptionsEditorControl"
|
|
1
|
+
{"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorControl.tsx"],"sourcesContent":["// Copyright 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 type { FormControlLabelProps } from '@mui/material';\nimport { FormControl, FormLabel, Stack, Box, IconButton } from '@mui/material';\nimport InformationOutlineIcon from 'mdi-material-ui/InformationOutline';\nimport type { ReactElement } from 'react';\nimport React, { useId } from 'react';\n\nimport { InfoTooltip } from '../InfoTooltip';\n\nexport type OptionsEditorControlProps = Pick<FormControlLabelProps, 'label' | 'control'> & {\n description?: string;\n};\n\nexport const OptionsEditorControl = ({ label, control, description }: OptionsEditorControlProps): ReactElement => {\n // Make sure we have a unique ID we can use for associating labels and\n // controls for a11y.\n const generatedControlId = `EditorSectionControl-${useId()}`;\n const controlId = `${generatedControlId}-control`;\n const labelId = `${generatedControlId}-label`;\n\n const controlProps = {\n id: controlId,\n 'aria-labelledby': labelId,\n };\n\n return (\n <FormControl>\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\">\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"center\">\n <FormLabel id={labelId} htmlFor={controlId}>\n {label}\n </FormLabel>\n {description && (\n <InfoTooltip description={description} enterDelay={100}>\n <IconButton\n size=\"small\"\n sx={(theme) => ({ borderRadius: theme.shape.borderRadius, padding: '4x', margin: '0 2px' })}\n >\n <InformationOutlineIcon\n aria-describedby=\"info-tooltip\"\n aria-hidden={false}\n fontSize=\"inherit\"\n sx={{ color: (theme) => theme.palette.grey[700] }}\n />\n </IconButton>\n </InfoTooltip>\n )}\n </Stack>\n <Box sx={{ width: '180px', textAlign: 'right' }}> {React.cloneElement(control, controlProps)}</Box>\n </Stack>\n </FormControl>\n );\n};\n"],"names":["FormControl","FormLabel","Stack","Box","IconButton","InformationOutlineIcon","React","useId","InfoTooltip","OptionsEditorControl"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAGjC,SAASA,WAAW,EAAEC,SAAS,EAAEC,KAAK,EAAEC,GAAG,EAAEC,UAAU,QAAQ,gBAAgB;AAC/E,OAAOC,4BAA4B,qCAAqC;AAExE,OAAOC,SAASC,KAAK,QAAQ,QAAQ;AAErC,SAASC,WAAW,QAAQ,0BAAiB;AAM7C,OAAO,MAAMC,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuClC"}
|