@perses-dev/components 0.55.0 → 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/package.json +12 -6
package/dist/Dialog/Dialog.js
CHANGED
|
@@ -11,74 +11,227 @@
|
|
|
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 { c as _c } from "react-compiler-runtime";
|
|
14
15
|
import { Button, DialogActions, DialogContent, DialogTitle, IconButton, Dialog as MuiDialog, styled } from "@mui/material";
|
|
15
16
|
import CloseIcon from "mdi-material-ui/Close";
|
|
16
17
|
import { combineSx } from "../utils/index.js";
|
|
17
|
-
const Header = (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
18
|
+
const Header = (t0)=>{
|
|
19
|
+
const $ = _c(13);
|
|
20
|
+
let children;
|
|
21
|
+
let onClose;
|
|
22
|
+
let props;
|
|
23
|
+
if ($[0] !== t0) {
|
|
24
|
+
({ children, onClose, ...props } = t0);
|
|
25
|
+
$[0] = t0;
|
|
26
|
+
$[1] = children;
|
|
27
|
+
$[2] = onClose;
|
|
28
|
+
$[3] = props;
|
|
29
|
+
} else {
|
|
30
|
+
children = $[1];
|
|
31
|
+
onClose = $[2];
|
|
32
|
+
props = $[3];
|
|
33
|
+
}
|
|
34
|
+
let t1;
|
|
35
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
36
|
+
t1 = {
|
|
37
|
+
textOverflow: "ellipsis",
|
|
38
|
+
overflow: "hidden"
|
|
39
|
+
};
|
|
40
|
+
$[4] = t1;
|
|
41
|
+
} else {
|
|
42
|
+
t1 = $[4];
|
|
43
|
+
}
|
|
44
|
+
let t2;
|
|
45
|
+
if ($[5] !== children || $[6] !== props) {
|
|
46
|
+
t2 = /*#__PURE__*/ _jsx(DialogTitle, {
|
|
47
|
+
style: t1,
|
|
48
|
+
...props,
|
|
49
|
+
children: children
|
|
50
|
+
});
|
|
51
|
+
$[5] = children;
|
|
52
|
+
$[6] = props;
|
|
53
|
+
$[7] = t2;
|
|
54
|
+
} else {
|
|
55
|
+
t2 = $[7];
|
|
56
|
+
}
|
|
57
|
+
let t3;
|
|
58
|
+
if ($[8] !== onClose) {
|
|
59
|
+
t3 = onClose && /*#__PURE__*/ _jsx(IconButton, {
|
|
60
|
+
"aria-label": "Close",
|
|
61
|
+
onClick: onClose,
|
|
62
|
+
sx: dialogCloseIconButtonStyle,
|
|
63
|
+
children: /*#__PURE__*/ _jsx(CloseIcon, {})
|
|
64
|
+
});
|
|
65
|
+
$[8] = onClose;
|
|
66
|
+
$[9] = t3;
|
|
67
|
+
} else {
|
|
68
|
+
t3 = $[9];
|
|
69
|
+
}
|
|
70
|
+
let t4;
|
|
71
|
+
if ($[10] !== t2 || $[11] !== t3) {
|
|
72
|
+
t4 = /*#__PURE__*/ _jsxs(_Fragment, {
|
|
73
|
+
children: [
|
|
74
|
+
t2,
|
|
75
|
+
t3
|
|
76
|
+
]
|
|
77
|
+
});
|
|
78
|
+
$[10] = t2;
|
|
79
|
+
$[11] = t3;
|
|
80
|
+
$[12] = t4;
|
|
81
|
+
} else {
|
|
82
|
+
t4 = $[12];
|
|
83
|
+
}
|
|
84
|
+
return t4;
|
|
85
|
+
};
|
|
86
|
+
const Content = (t0)=>{
|
|
87
|
+
const $ = _c(10);
|
|
88
|
+
let children;
|
|
89
|
+
let props;
|
|
90
|
+
let sx;
|
|
91
|
+
if ($[0] !== t0) {
|
|
92
|
+
({ children, sx, ...props } = t0);
|
|
93
|
+
$[0] = t0;
|
|
94
|
+
$[1] = children;
|
|
95
|
+
$[2] = props;
|
|
96
|
+
$[3] = sx;
|
|
97
|
+
} else {
|
|
98
|
+
children = $[1];
|
|
99
|
+
props = $[2];
|
|
100
|
+
sx = $[3];
|
|
101
|
+
}
|
|
102
|
+
let t1;
|
|
103
|
+
if ($[4] !== sx) {
|
|
104
|
+
t1 = combineSx({
|
|
105
|
+
minWidth: "500px",
|
|
106
|
+
textWrap: "balance"
|
|
107
|
+
}, sx);
|
|
108
|
+
$[4] = sx;
|
|
109
|
+
$[5] = t1;
|
|
110
|
+
} else {
|
|
111
|
+
t1 = $[5];
|
|
112
|
+
}
|
|
113
|
+
let t2;
|
|
114
|
+
if ($[6] !== children || $[7] !== props || $[8] !== t1) {
|
|
115
|
+
t2 = /*#__PURE__*/ _jsx(DialogContent, {
|
|
116
|
+
dividers: true,
|
|
117
|
+
...props,
|
|
118
|
+
sx: t1,
|
|
119
|
+
children: children
|
|
120
|
+
});
|
|
121
|
+
$[6] = children;
|
|
122
|
+
$[7] = props;
|
|
123
|
+
$[8] = t1;
|
|
124
|
+
$[9] = t2;
|
|
125
|
+
} else {
|
|
126
|
+
t2 = $[9];
|
|
127
|
+
}
|
|
128
|
+
return t2;
|
|
129
|
+
};
|
|
130
|
+
const PrimaryButton = (t0)=>{
|
|
131
|
+
const $ = _c(6);
|
|
132
|
+
let children;
|
|
133
|
+
let props;
|
|
134
|
+
if ($[0] !== t0) {
|
|
135
|
+
({ children, ...props } = t0);
|
|
136
|
+
$[0] = t0;
|
|
137
|
+
$[1] = children;
|
|
138
|
+
$[2] = props;
|
|
139
|
+
} else {
|
|
140
|
+
children = $[1];
|
|
141
|
+
props = $[2];
|
|
142
|
+
}
|
|
143
|
+
let t1;
|
|
144
|
+
if ($[3] !== children || $[4] !== props) {
|
|
145
|
+
t1 = /*#__PURE__*/ _jsx(Button, {
|
|
146
|
+
variant: "contained",
|
|
147
|
+
type: "submit",
|
|
148
|
+
...props,
|
|
149
|
+
children: children
|
|
150
|
+
});
|
|
151
|
+
$[3] = children;
|
|
152
|
+
$[4] = props;
|
|
153
|
+
$[5] = t1;
|
|
154
|
+
} else {
|
|
155
|
+
t1 = $[5];
|
|
156
|
+
}
|
|
157
|
+
return t1;
|
|
158
|
+
};
|
|
159
|
+
const SecondaryButton = (t0)=>{
|
|
160
|
+
const $ = _c(6);
|
|
161
|
+
let children;
|
|
162
|
+
let props;
|
|
163
|
+
if ($[0] !== t0) {
|
|
164
|
+
({ children, ...props } = t0);
|
|
165
|
+
$[0] = t0;
|
|
166
|
+
$[1] = children;
|
|
167
|
+
$[2] = props;
|
|
168
|
+
} else {
|
|
169
|
+
children = $[1];
|
|
170
|
+
props = $[2];
|
|
171
|
+
}
|
|
172
|
+
let t1;
|
|
173
|
+
if ($[3] !== children || $[4] !== props) {
|
|
174
|
+
t1 = /*#__PURE__*/ _jsx(Button, {
|
|
175
|
+
variant: "outlined",
|
|
176
|
+
color: "secondary",
|
|
177
|
+
...props,
|
|
178
|
+
children: children
|
|
179
|
+
});
|
|
180
|
+
$[3] = children;
|
|
181
|
+
$[4] = props;
|
|
182
|
+
$[5] = t1;
|
|
183
|
+
} else {
|
|
184
|
+
t1 = $[5];
|
|
185
|
+
}
|
|
186
|
+
return t1;
|
|
36
187
|
};
|
|
37
|
-
const Content = ({ children, sx, ...props })=>/*#__PURE__*/ _jsx(DialogContent, {
|
|
38
|
-
dividers: true,
|
|
39
|
-
...props,
|
|
40
|
-
sx: combineSx({
|
|
41
|
-
minWidth: `500px`,
|
|
42
|
-
textWrap: 'balance'
|
|
43
|
-
}, sx),
|
|
44
|
-
children: children
|
|
45
|
-
});
|
|
46
|
-
const PrimaryButton = ({ children, ...props })=>/*#__PURE__*/ _jsx(Button, {
|
|
47
|
-
variant: "contained",
|
|
48
|
-
type: "submit",
|
|
49
|
-
...props,
|
|
50
|
-
children: children
|
|
51
|
-
});
|
|
52
|
-
const SecondaryButton = ({ children, ...props })=>/*#__PURE__*/ _jsx(Button, {
|
|
53
|
-
variant: "outlined",
|
|
54
|
-
color: "secondary",
|
|
55
|
-
...props,
|
|
56
|
-
children: children
|
|
57
|
-
});
|
|
58
188
|
/*
|
|
59
189
|
* Material-ui has a prop "scroll=paper" that is specifically for dialog header and actions to be sticky and body to scroll,
|
|
60
190
|
* but that doesn't work when dialog content is wrapped in form.
|
|
61
191
|
* https://github.com/mui-org/material-ui/issues/13253
|
|
62
192
|
* This component adds style to get expected behavior & should be used whenever we have a Form inside a Dialog
|
|
63
|
-
*/ const Form = styled(
|
|
64
|
-
overflowY:
|
|
65
|
-
display:
|
|
66
|
-
flexDirection:
|
|
193
|
+
*/ const Form = styled("form")({
|
|
194
|
+
overflowY: "auto",
|
|
195
|
+
display: "flex",
|
|
196
|
+
flexDirection: "column"
|
|
67
197
|
});
|
|
68
198
|
/**
|
|
69
199
|
* Render the CSS of the dialog's close button, according to the given material theme.
|
|
70
200
|
* @param theme material theme
|
|
71
201
|
*/ const dialogCloseIconButtonStyle = (theme)=>{
|
|
72
202
|
return {
|
|
73
|
-
position:
|
|
203
|
+
position: "absolute",
|
|
74
204
|
top: theme.spacing(0.5),
|
|
75
205
|
right: theme.spacing(0.5)
|
|
76
206
|
};
|
|
77
207
|
};
|
|
78
|
-
export const Dialog = (
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
208
|
+
export const Dialog = (t0)=>{
|
|
209
|
+
const $ = _c(6);
|
|
210
|
+
let children;
|
|
211
|
+
let props;
|
|
212
|
+
if ($[0] !== t0) {
|
|
213
|
+
({ children, ...props } = t0);
|
|
214
|
+
$[0] = t0;
|
|
215
|
+
$[1] = children;
|
|
216
|
+
$[2] = props;
|
|
217
|
+
} else {
|
|
218
|
+
children = $[1];
|
|
219
|
+
props = $[2];
|
|
220
|
+
}
|
|
221
|
+
let t1;
|
|
222
|
+
if ($[3] !== children || $[4] !== props) {
|
|
223
|
+
t1 = /*#__PURE__*/ _jsx(MuiDialog, {
|
|
224
|
+
...props,
|
|
225
|
+
children: children
|
|
226
|
+
});
|
|
227
|
+
$[3] = children;
|
|
228
|
+
$[4] = props;
|
|
229
|
+
$[5] = t1;
|
|
230
|
+
} else {
|
|
231
|
+
t1 = $[5];
|
|
232
|
+
}
|
|
233
|
+
return t1;
|
|
234
|
+
};
|
|
82
235
|
Dialog.Header = Header;
|
|
83
236
|
Dialog.Form = Form;
|
|
84
237
|
Dialog.Content = Content;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Dialog/Dialog.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 { StyledComponent } from '@emotion/styled';\nimport type {\n ButtonProps,\n DialogProps,\n DialogTitleProps,\n DialogContentProps as MuiDialogContentProps,\n Theme,\n} from '@mui/material';\nimport {\n Button,\n DialogActions,\n DialogContent,\n DialogTitle,\n IconButton,\n Dialog as MuiDialog,\n styled,\n} from '@mui/material';\nimport CloseIcon from 'mdi-material-ui/Close';\nimport type { MouseEvent, ReactElement } from 'react';\n\nimport { combineSx } from '../utils';\n\nexport interface DialogHeaderProps extends DialogTitleProps {\n /**\n * Callback fired when close button is clicked. If undefined, close button will not appear in header.\n */\n onClose?: (e: MouseEvent<HTMLElement>) => void;\n}\n\nexport type DialogButtonProps = Omit<ButtonProps, 'variant' | 'color' | 'type'>;\n\nexport type DialogContentProps = MuiDialogContentProps;\n\nconst Header = ({ children, onClose, ...props }: DialogHeaderProps): ReactElement => {\n return (\n <>\n <DialogTitle style={{ textOverflow: 'ellipsis', overflow: 'hidden' }} {...props}>\n {children}\n </DialogTitle>\n {onClose && (\n <IconButton aria-label=\"Close\" onClick={onClose} sx={dialogCloseIconButtonStyle}>\n <CloseIcon />\n </IconButton>\n )}\n </>\n );\n};\n\nconst Content = ({ children, sx, ...props }: DialogContentProps): ReactElement => (\n <DialogContent dividers {...props} sx={combineSx({ minWidth: `500px`, textWrap: 'balance' }, sx)}>\n {children}\n </DialogContent>\n);\n\nconst PrimaryButton = ({ children, ...props }: DialogButtonProps): ReactElement => (\n <Button variant=\"contained\" type=\"submit\" {...props}>\n {children}\n </Button>\n);\n\nconst SecondaryButton = ({ children, ...props }: DialogButtonProps): ReactElement => (\n <Button variant=\"outlined\" color=\"secondary\" {...props}>\n {children}\n </Button>\n);\n\n/*\n * Material-ui has a prop \"scroll=paper\" that is specifically for dialog header and actions to be sticky and body to scroll,\n * but that doesn't work when dialog content is wrapped in form.\n * https://github.com/mui-org/material-ui/issues/13253\n * This component adds style to get expected behavior & should be used whenever we have a Form inside a Dialog\n */\nconst Form: StyledComponent<React.ComponentProps<'form'>> = styled('form')({\n overflowY: 'auto',\n display: 'flex',\n flexDirection: 'column',\n});\n\n/**\n * Render the CSS of the dialog's close button, according to the given material theme.\n * @param theme material theme\n */\nconst dialogCloseIconButtonStyle = (theme: Theme): Record<string, unknown> => {\n return { position: 'absolute', top: theme.spacing(0.5), right: theme.spacing(0.5) };\n};\n\nexport const Dialog: React.FC<DialogProps> & {\n Header: typeof Header;\n Form: typeof Form;\n Content: typeof Content;\n PrimaryButton: typeof PrimaryButton;\n SecondaryButton: typeof SecondaryButton;\n Actions: typeof DialogActions;\n} = ({ children, ...props }) => <MuiDialog {...props}>{children}</MuiDialog>;\n\nDialog.Header = Header;\nDialog.Form = Form;\nDialog.Content = Content;\nDialog.PrimaryButton = PrimaryButton;\nDialog.SecondaryButton = SecondaryButton;\nDialog.Actions = DialogActions;\n"],"names":["Button","DialogActions","DialogContent","DialogTitle","IconButton","Dialog","MuiDialog","styled","CloseIcon","combineSx","Header","
|
|
1
|
+
{"version":3,"sources":["../../src/Dialog/Dialog.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 { StyledComponent } from '@emotion/styled';\nimport type {\n ButtonProps,\n DialogProps,\n DialogTitleProps,\n DialogContentProps as MuiDialogContentProps,\n Theme,\n} from '@mui/material';\nimport {\n Button,\n DialogActions,\n DialogContent,\n DialogTitle,\n IconButton,\n Dialog as MuiDialog,\n styled,\n} from '@mui/material';\nimport type { MUIStyledCommonProps } from '@mui/system';\nimport CloseIcon from 'mdi-material-ui/Close';\nimport type { MouseEvent, ReactElement } from 'react';\n\nimport { combineSx } from '../utils';\n\nexport interface DialogHeaderProps extends DialogTitleProps {\n /**\n * Callback fired when close button is clicked. If undefined, close button will not appear in header.\n */\n onClose?: (e: MouseEvent<HTMLElement>) => void;\n}\n\nexport type DialogButtonProps = Omit<ButtonProps, 'variant' | 'color' | 'type'>;\n\nexport type DialogContentProps = MuiDialogContentProps;\n\nconst Header = ({ children, onClose, ...props }: DialogHeaderProps): ReactElement => {\n return (\n <>\n <DialogTitle style={{ textOverflow: 'ellipsis', overflow: 'hidden' }} {...props}>\n {children}\n </DialogTitle>\n {onClose && (\n <IconButton aria-label=\"Close\" onClick={onClose} sx={dialogCloseIconButtonStyle}>\n <CloseIcon />\n </IconButton>\n )}\n </>\n );\n};\n\nconst Content = ({ children, sx, ...props }: DialogContentProps): ReactElement => (\n <DialogContent dividers {...props} sx={combineSx({ minWidth: `500px`, textWrap: 'balance' }, sx)}>\n {children}\n </DialogContent>\n);\n\nconst PrimaryButton = ({ children, ...props }: DialogButtonProps): ReactElement => (\n <Button variant=\"contained\" type=\"submit\" {...props}>\n {children}\n </Button>\n);\n\nconst SecondaryButton = ({ children, ...props }: DialogButtonProps): ReactElement => (\n <Button variant=\"outlined\" color=\"secondary\" {...props}>\n {children}\n </Button>\n);\n\n/*\n * Material-ui has a prop \"scroll=paper\" that is specifically for dialog header and actions to be sticky and body to scroll,\n * but that doesn't work when dialog content is wrapped in form.\n * https://github.com/mui-org/material-ui/issues/13253\n * This component adds style to get expected behavior & should be used whenever we have a Form inside a Dialog\n */\nconst Form: StyledComponent<MUIStyledCommonProps<Theme>, React.ComponentProps<'form'>> = styled('form')({\n overflowY: 'auto',\n display: 'flex',\n flexDirection: 'column',\n});\n\n/**\n * Render the CSS of the dialog's close button, according to the given material theme.\n * @param theme material theme\n */\nconst dialogCloseIconButtonStyle = (theme: Theme): Record<string, unknown> => {\n return { position: 'absolute', top: theme.spacing(0.5), right: theme.spacing(0.5) };\n};\n\nexport const Dialog: React.FC<DialogProps> & {\n Header: typeof Header;\n Form: typeof Form;\n Content: typeof Content;\n PrimaryButton: typeof PrimaryButton;\n SecondaryButton: typeof SecondaryButton;\n Actions: typeof DialogActions;\n} = ({ children, ...props }) => <MuiDialog {...props}>{children}</MuiDialog>;\n\nDialog.Header = Header;\nDialog.Form = Form;\nDialog.Content = Content;\nDialog.PrimaryButton = PrimaryButton;\nDialog.SecondaryButton = SecondaryButton;\nDialog.Actions = DialogActions;\n"],"names":["Button","DialogActions","DialogContent","DialogTitle","IconButton","Dialog","MuiDialog","styled","CloseIcon","combineSx","Header","Content","PrimaryButton","SecondaryButton","Form","overflowY","display","flexDirection","dialogCloseIconButtonStyle","theme","position","top","spacing","right","Actions"],"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;;;AAUjC,SACEA,MAAM,EACNC,aAAa,EACbC,aAAa,EACbC,WAAW,EACXC,UAAU,EACVC,UAAUC,SAAS,EACnBC,MAAM,QACD,gBAAgB;AAEvB,OAAOC,eAAe,wBAAwB;AAG9C,SAASC,SAAS,QAAQ,oBAAW;AAarC,MAAMC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAef,MAAMC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMhB,MAAMC,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMtB,MAAMC,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMxB;;;;;CAKC,GACD,MAAMC,OAAmFP,OAAO,QAAQ;IACtGQ,WAAW;IACXC,SAAS;IACTC,eAAe;AACjB;AAEA;;;CAGC,GACD,MAAMC,6BAA6B,CAACC;IAClC,OAAO;QAAEC,UAAU;QAAYC,KAAKF,MAAMG,OAAO,CAAC;QAAMC,OAAOJ,MAAMG,OAAO,CAAC;IAAK;AACpF;AAEA,OAAO,MAAMjB,SAOT;;;;;;;;;;;;;;;;;;;;;;;;;;EAAyE;AAE7EA,OAAOK,MAAM,GAAGA;AAChBL,OAAOS,IAAI,GAAGA;AACdT,OAAOM,OAAO,GAAGA;AACjBN,OAAOO,aAAa,GAAGA;AACvBP,OAAOQ,eAAe,GAAGA;AACzBR,OAAOmB,OAAO,GAAGvB"}
|
|
@@ -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,34 +15,85 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
15
|
import { Button } from "@mui/material";
|
|
15
16
|
import { Dialog } from "./Dialog.js";
|
|
16
17
|
export const DiscardChangesConfirmationDialog = (props)=>{
|
|
18
|
+
const $ = _c(14);
|
|
17
19
|
const { description, isOpen, onCancel, onDiscardChanges } = 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
|
-
|
|
20
|
+
let t0;
|
|
21
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
22
|
+
t0 = /*#__PURE__*/ _jsx(Dialog.Header, {
|
|
23
|
+
children: "Discard Changes"
|
|
24
|
+
});
|
|
25
|
+
$[0] = t0;
|
|
26
|
+
} else {
|
|
27
|
+
t0 = $[0];
|
|
28
|
+
}
|
|
29
|
+
let t1;
|
|
30
|
+
if ($[1] !== description) {
|
|
31
|
+
t1 = /*#__PURE__*/ _jsx(Dialog.Content, {
|
|
32
|
+
children: description
|
|
33
|
+
});
|
|
34
|
+
$[1] = description;
|
|
35
|
+
$[2] = t1;
|
|
36
|
+
} else {
|
|
37
|
+
t1 = $[2];
|
|
38
|
+
}
|
|
39
|
+
let t2;
|
|
40
|
+
if ($[3] !== onDiscardChanges) {
|
|
41
|
+
t2 = /*#__PURE__*/ _jsx(Button, {
|
|
42
|
+
variant: "contained",
|
|
43
|
+
onClick: onDiscardChanges,
|
|
44
|
+
children: "Discard Changes"
|
|
45
|
+
});
|
|
46
|
+
$[3] = onDiscardChanges;
|
|
47
|
+
$[4] = t2;
|
|
48
|
+
} else {
|
|
49
|
+
t2 = $[4];
|
|
50
|
+
}
|
|
51
|
+
let t3;
|
|
52
|
+
if ($[5] !== onCancel) {
|
|
53
|
+
t3 = /*#__PURE__*/ _jsx(Button, {
|
|
54
|
+
variant: "outlined",
|
|
55
|
+
color: "secondary",
|
|
56
|
+
onClick: onCancel,
|
|
57
|
+
children: "Cancel"
|
|
58
|
+
});
|
|
59
|
+
$[5] = onCancel;
|
|
60
|
+
$[6] = t3;
|
|
61
|
+
} else {
|
|
62
|
+
t3 = $[6];
|
|
63
|
+
}
|
|
64
|
+
let t4;
|
|
65
|
+
if ($[7] !== t2 || $[8] !== t3) {
|
|
66
|
+
t4 = /*#__PURE__*/ _jsxs(Dialog.Actions, {
|
|
67
|
+
children: [
|
|
68
|
+
t2,
|
|
69
|
+
t3
|
|
70
|
+
]
|
|
71
|
+
});
|
|
72
|
+
$[7] = t2;
|
|
73
|
+
$[8] = t3;
|
|
74
|
+
$[9] = t4;
|
|
75
|
+
} else {
|
|
76
|
+
t4 = $[9];
|
|
77
|
+
}
|
|
78
|
+
let t5;
|
|
79
|
+
if ($[10] !== isOpen || $[11] !== t1 || $[12] !== t4) {
|
|
80
|
+
t5 = /*#__PURE__*/ _jsxs(Dialog, {
|
|
81
|
+
open: isOpen,
|
|
82
|
+
"aria-labelledby": "discard-dialog",
|
|
83
|
+
children: [
|
|
84
|
+
t0,
|
|
85
|
+
t1,
|
|
86
|
+
t4
|
|
87
|
+
]
|
|
88
|
+
});
|
|
89
|
+
$[10] = isOpen;
|
|
90
|
+
$[11] = t1;
|
|
91
|
+
$[12] = t4;
|
|
92
|
+
$[13] = t5;
|
|
93
|
+
} else {
|
|
94
|
+
t5 = $[13];
|
|
95
|
+
}
|
|
96
|
+
return t5;
|
|
45
97
|
};
|
|
46
98
|
|
|
47
99
|
//# sourceMappingURL=DiscardChangesConfirmationDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Dialog/DiscardChangesConfirmationDialog.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 { Button } from '@mui/material';\nimport type { ReactElement } from 'react';\n\nimport { Dialog } from './Dialog';\n\ninterface DiscardChangesConfirmationDialogProps {\n description: string;\n isOpen: boolean;\n onCancel: () => void;\n onDiscardChanges: () => void;\n}\n\nexport const DiscardChangesConfirmationDialog = (props: DiscardChangesConfirmationDialogProps): ReactElement => {\n const { description, isOpen, onCancel, onDiscardChanges } = props;\n\n return (\n <Dialog open={isOpen} aria-labelledby=\"discard-dialog\">\n <Dialog.Header>Discard Changes</Dialog.Header>\n <Dialog.Content>{description}</Dialog.Content>\n <Dialog.Actions>\n <Button variant=\"contained\" onClick={onDiscardChanges}>\n Discard Changes\n </Button>\n <Button variant=\"outlined\" color=\"secondary\" onClick={onCancel}>\n Cancel\n </Button>\n </Dialog.Actions>\n </Dialog>\n );\n};\n"],"names":["Button","Dialog","DiscardChangesConfirmationDialog"
|
|
1
|
+
{"version":3,"sources":["../../src/Dialog/DiscardChangesConfirmationDialog.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 { Button } from '@mui/material';\nimport type { ReactElement } from 'react';\n\nimport { Dialog } from './Dialog';\n\ninterface DiscardChangesConfirmationDialogProps {\n description: string;\n isOpen: boolean;\n onCancel: () => void;\n onDiscardChanges: () => void;\n}\n\nexport const DiscardChangesConfirmationDialog = (props: DiscardChangesConfirmationDialogProps): ReactElement => {\n const { description, isOpen, onCancel, onDiscardChanges } = props;\n\n return (\n <Dialog open={isOpen} aria-labelledby=\"discard-dialog\">\n <Dialog.Header>Discard Changes</Dialog.Header>\n <Dialog.Content>{description}</Dialog.Content>\n <Dialog.Actions>\n <Button variant=\"contained\" onClick={onDiscardChanges}>\n Discard Changes\n </Button>\n <Button variant=\"outlined\" color=\"secondary\" onClick={onCancel}>\n Cancel\n </Button>\n </Dialog.Actions>\n </Dialog>\n );\n};\n"],"names":["Button","Dialog","DiscardChangesConfirmationDialog"],"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,MAAM,QAAQ,gBAAgB;AAGvC,SAASC,MAAM,QAAQ,cAAW;AASlC,OAAO,MAAMC,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiB9C"}
|