@hybridcore/ui 1.0.2 → 1.1.2
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/ButtonBase-BYmh3G5j.js +967 -0
- package/dist/CardContent-C8PxkJz4.js +73 -0
- package/dist/Checkbox-DostZSwR.js +673 -0
- package/dist/DialogContent-2aPOjKE7.js +2025 -0
- package/dist/FormControl-BiAFm76F.js +1491 -0
- package/dist/IconButton-CQJ8wZE8.js +183 -0
- package/dist/Input-Bf5G3tFN.js +324 -0
- package/dist/OutlinedInput-BEVE8VZQ.js +452 -0
- package/dist/Paper-CaiWdndQ.js +162 -0
- package/dist/Select-DxpxZbJp.js +2526 -0
- package/dist/Source-CnCcu5UP.js +4374 -0
- package/dist/Text-BT5kPHOo.js +2192 -0
- package/dist/Typography-XIiVCSto.js +178 -0
- package/dist/assertThisInitialized-BUtkG-md.js +13 -0
- package/dist/assets/index.css +1 -0
- package/dist/assets/index2.css +1 -0
- package/dist/chainPropTypes-DtBfUj5o.js +96 -0
- package/dist/components/access/helpers.js +32 -0
- package/dist/components/access/index.js +15 -0
- package/dist/components/card/index.js +159 -469
- package/dist/components/card/styled.js +75 -7
- package/dist/components/conditional-wrapper/index.js +9 -0
- package/dist/components/confirm/dialog.js +151 -0
- package/dist/components/confirm/index.js +23 -0
- package/dist/components/container/index.js +270 -0
- package/dist/components/context-menu/index.js +973 -0
- package/dist/components/data-management/instance-form/components/composite-list/index.js +12 -0
- package/dist/components/data-management/instance-form/components/composite-list/styled.js +64 -0
- package/dist/components/data-management/instance-form/components/policy-list/index.js +86 -0
- package/dist/components/data-management/instance-form/components/variable/index.js +15 -0
- package/dist/components/data-management/instance-form/components/variables/index.js +39 -0
- package/dist/components/data-management/instance-form/index.js +437 -0
- package/dist/components/data-security-selectors/dissemination-list/index.js +3201 -0
- package/dist/components/data-security-selectors/security-level/index.js +81 -0
- package/dist/components/date-time-picker/index.js +103 -0
- package/dist/components/geometry-picker/coordinate/index.js +93 -0
- package/dist/components/geometry-picker/edit/index.js +71 -0
- package/dist/components/geometry-picker/geometry/index.js +160 -0
- package/dist/components/geometry-picker/geometry/map-overlay.js +22 -0
- package/dist/components/geometry-picker/index.js +140 -0
- package/dist/components/geometry-picker/kml/index.js +62 -0
- package/dist/components/geometry-picker/kml/select-input-method.js +75 -0
- package/dist/components/geometry-picker/logic.js +69 -0
- package/dist/components/geometry-picker/map/index.js +42 -0
- package/dist/components/geometry-picker/map/logic.js +2360 -0
- package/dist/components/geometry-picker/map/style.js +88 -0
- package/dist/components/geometry-picker/parser/coordinate-input/index.js +78 -0
- package/dist/components/geometry-picker/parser/coordinate-input/logic.js +1305 -0
- package/dist/components/geometry-picker/parser/index.js +179 -0
- package/dist/components/geometry-picker/parser/logic.js +84 -0
- package/dist/components/geometry-picker/parser/styled.js +25 -0
- package/dist/components/geometry-picker/styled.js +48 -0
- package/dist/components/geometry-picker/wkt/index.js +59 -0
- package/dist/components/geometry-picker/wkt/select-input-method.js +75 -0
- package/dist/components/icon-button/index.js +18 -0
- package/dist/components/icon-button/styled.js +51 -0
- package/dist/components/key-protection/index.js +4 -0
- package/dist/components/key-protection/menu.js +85 -0
- package/dist/components/key-protection/utils.js +10 -0
- package/dist/components/loading/index.js +7 -0
- package/dist/components/loading/styled.js +16 -0
- package/dist/components/map/helpers/kml.js +45 -0
- package/dist/components/map/helpers/mapbox.js +48 -0
- package/dist/components/map/helpers/ol.js +25 -0
- package/dist/components/map/helpers/wkt.js +29 -0
- package/dist/components/map/index.js +8 -0
- package/dist/components/map/logic.js +140 -0
- package/dist/components/map/styled.js +8 -0
- package/dist/components/phone-input/index.js +25 -0
- package/dist/components/phone-input/styled.js +26 -0
- package/dist/components/search-input/index.js +76 -0
- package/dist/components/tree-select/index.js +70 -0
- package/dist/components/tree-select/styled.js +64 -0
- package/dist/components/treeview-filter/index.js +621 -0
- package/dist/components/treeview-filter/item/index.js +7 -0
- package/dist/components/treeview-filter/item-label/index.js +44 -0
- package/dist/createTheme-agWfFD64.js +2392 -0
- package/dist/exactProp-CI8dagM-.js +36 -0
- package/dist/extends-C3382pL0.js +22 -0
- package/dist/has-9_asnBxn.js +688 -0
- package/dist/hooks/useMenuLogic.js +21 -0
- package/dist/hooks/useToggle.js +23 -0
- package/dist/index-Bw_m9ult.js +1105 -0
- package/dist/index-IvOfmM1F.js +34 -0
- package/dist/index-wW2D1aTG.js +957 -0
- package/dist/isHostComponent-kiaBvYVo.js +6 -0
- package/dist/isMuiElement-CxT3_ACP.js +13 -0
- package/dist/listItemTextClasses-BvXFz-Oc.js +132 -0
- package/dist/main.d.ts +1317 -0
- package/dist/main.js +41 -2
- package/dist/ol-DXmSLlWv.js +15041 -0
- package/dist/ownerDocument-CUrv0DIK.js +6 -0
- package/dist/ownerWindow-niciwP7I.js +7 -0
- package/dist/styled-C43K9x7T.js +229 -0
- package/dist/styled-Iq9jsO4F.js +1033 -0
- package/dist/useFormControl-CatNKXAi.js +10 -0
- package/dist/useId-BHG98T5I.js +26 -0
- package/dist/useTheme-C0Dky5rV.js +17 -0
- package/dist/useTheme-CeyGVuQP.js +10 -0
- package/dist/useThemeProps-CzAjOL6F.js +26 -0
- package/dist/utils/ontology.js +37 -0
- package/dist/utils-Bq0ye5vf.js +115 -0
- package/dist/utils-DLpkeyhZ.js +365 -0
- package/package.json +26 -5
- package/dist/styled-BG5UIpPU.js +0 -3459
|
@@ -0,0 +1,973 @@
|
|
|
1
|
+
import { jsx as b, jsxs as U, Fragment as ye } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
import { P as t } from "../../createTheme-agWfFD64.js";
|
|
4
|
+
import { B as se, u as ne, a as H, e as be, b as ge } from "../../ButtonBase-BYmh3G5j.js";
|
|
5
|
+
import { o as z } from "../../ownerDocument-CUrv0DIK.js";
|
|
6
|
+
import { e as ve, a as Ie } from "../../exactProp-CI8dagM-.js";
|
|
7
|
+
import { L, g as Ce, l as ee, a as xe, b as he } from "../../listItemTextClasses-BvXFz-Oc.js";
|
|
8
|
+
import { a as u, _ as $ } from "../../extends-C3382pL0.js";
|
|
9
|
+
import { g as Y, u as M, c as T, a as w, b as Le } from "../../chainPropTypes-DtBfUj5o.js";
|
|
10
|
+
import { g as q, s as A, r as Te, a as h } from "../../styled-Iq9jsO4F.js";
|
|
11
|
+
import { i as ae } from "../../isMuiElement-CxT3_ACP.js";
|
|
12
|
+
import { i as te } from "../../isHostComponent-kiaBvYVo.js";
|
|
13
|
+
import { T as F } from "../../Typography-XIiVCSto.js";
|
|
14
|
+
function Oe(e) {
|
|
15
|
+
return q("MuiListItem", e);
|
|
16
|
+
}
|
|
17
|
+
const P = Y("MuiListItem", ["root", "container", "focusVisible", "dense", "alignItemsFlexStart", "disabled", "divider", "gutters", "padding", "button", "secondaryAction", "selected"]);
|
|
18
|
+
function Re(e) {
|
|
19
|
+
return q("MuiListItemButton", e);
|
|
20
|
+
}
|
|
21
|
+
const E = Y("MuiListItemButton", ["root", "focusVisible", "dense", "alignItemsFlexStart", "disabled", "divider", "gutters", "selected"]), Ne = ["alignItems", "autoFocus", "component", "children", "dense", "disableGutters", "divider", "focusVisibleClassName", "selected", "className"], Pe = (e, o) => {
|
|
22
|
+
const {
|
|
23
|
+
ownerState: s
|
|
24
|
+
} = e;
|
|
25
|
+
return [o.root, s.dense && o.dense, s.alignItems === "flex-start" && o.alignItemsFlexStart, s.divider && o.divider, !s.disableGutters && o.gutters];
|
|
26
|
+
}, Ee = (e) => {
|
|
27
|
+
const {
|
|
28
|
+
alignItems: o,
|
|
29
|
+
classes: s,
|
|
30
|
+
dense: n,
|
|
31
|
+
disabled: c,
|
|
32
|
+
disableGutters: i,
|
|
33
|
+
divider: d,
|
|
34
|
+
selected: r
|
|
35
|
+
} = e, f = w({
|
|
36
|
+
root: ["root", n && "dense", !i && "gutters", d && "divider", c && "disabled", o === "flex-start" && "alignItemsFlexStart", r && "selected"]
|
|
37
|
+
}, Re, s);
|
|
38
|
+
return u({}, s, f);
|
|
39
|
+
}, $e = A(se, {
|
|
40
|
+
shouldForwardProp: (e) => Te(e) || e === "classes",
|
|
41
|
+
name: "MuiListItemButton",
|
|
42
|
+
slot: "Root",
|
|
43
|
+
overridesResolver: Pe
|
|
44
|
+
})(({
|
|
45
|
+
theme: e,
|
|
46
|
+
ownerState: o
|
|
47
|
+
}) => u({
|
|
48
|
+
display: "flex",
|
|
49
|
+
flexGrow: 1,
|
|
50
|
+
justifyContent: "flex-start",
|
|
51
|
+
alignItems: "center",
|
|
52
|
+
position: "relative",
|
|
53
|
+
textDecoration: "none",
|
|
54
|
+
minWidth: 0,
|
|
55
|
+
boxSizing: "border-box",
|
|
56
|
+
textAlign: "left",
|
|
57
|
+
paddingTop: 8,
|
|
58
|
+
paddingBottom: 8,
|
|
59
|
+
transition: e.transitions.create("background-color", {
|
|
60
|
+
duration: e.transitions.duration.shortest
|
|
61
|
+
}),
|
|
62
|
+
"&:hover": {
|
|
63
|
+
textDecoration: "none",
|
|
64
|
+
backgroundColor: (e.vars || e).palette.action.hover,
|
|
65
|
+
// Reset on touch devices, it doesn't add specificity
|
|
66
|
+
"@media (hover: none)": {
|
|
67
|
+
backgroundColor: "transparent"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
[`&.${E.selected}`]: {
|
|
71
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : h(e.palette.primary.main, e.palette.action.selectedOpacity),
|
|
72
|
+
[`&.${E.focusVisible}`]: {
|
|
73
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))` : h(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.focusOpacity)
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
[`&.${E.selected}:hover`]: {
|
|
77
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` : h(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
|
|
78
|
+
// Reset on touch devices, it doesn't add specificity
|
|
79
|
+
"@media (hover: none)": {
|
|
80
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : h(e.palette.primary.main, e.palette.action.selectedOpacity)
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
[`&.${E.focusVisible}`]: {
|
|
84
|
+
backgroundColor: (e.vars || e).palette.action.focus
|
|
85
|
+
},
|
|
86
|
+
[`&.${E.disabled}`]: {
|
|
87
|
+
opacity: (e.vars || e).palette.action.disabledOpacity
|
|
88
|
+
}
|
|
89
|
+
}, o.divider && {
|
|
90
|
+
borderBottom: `1px solid ${(e.vars || e).palette.divider}`,
|
|
91
|
+
backgroundClip: "padding-box"
|
|
92
|
+
}, o.alignItems === "flex-start" && {
|
|
93
|
+
alignItems: "flex-start"
|
|
94
|
+
}, !o.disableGutters && {
|
|
95
|
+
paddingLeft: 16,
|
|
96
|
+
paddingRight: 16
|
|
97
|
+
}, o.dense && {
|
|
98
|
+
paddingTop: 4,
|
|
99
|
+
paddingBottom: 4
|
|
100
|
+
})), re = /* @__PURE__ */ l.forwardRef(function(o, s) {
|
|
101
|
+
const n = M({
|
|
102
|
+
props: o,
|
|
103
|
+
name: "MuiListItemButton"
|
|
104
|
+
}), {
|
|
105
|
+
alignItems: c = "center",
|
|
106
|
+
autoFocus: i = !1,
|
|
107
|
+
component: d = "div",
|
|
108
|
+
children: r,
|
|
109
|
+
dense: m = !1,
|
|
110
|
+
disableGutters: f = !1,
|
|
111
|
+
divider: C = !1,
|
|
112
|
+
focusVisibleClassName: g,
|
|
113
|
+
selected: x = !1,
|
|
114
|
+
className: I
|
|
115
|
+
} = n, a = $(n, Ne), p = l.useContext(L), y = l.useMemo(() => ({
|
|
116
|
+
dense: m || p.dense || !1,
|
|
117
|
+
alignItems: c,
|
|
118
|
+
disableGutters: f
|
|
119
|
+
}), [c, p.dense, m, f]), v = l.useRef(null);
|
|
120
|
+
ne(() => {
|
|
121
|
+
i && (v.current ? v.current.focus() : process.env.NODE_ENV !== "production" && console.error("MUI: Unable to set focus to a ListItemButton whose component has not been rendered."));
|
|
122
|
+
}, [i]);
|
|
123
|
+
const j = u({}, n, {
|
|
124
|
+
alignItems: c,
|
|
125
|
+
dense: y.dense,
|
|
126
|
+
disableGutters: f,
|
|
127
|
+
divider: C,
|
|
128
|
+
selected: x
|
|
129
|
+
}), S = Ee(j), V = H(v, s);
|
|
130
|
+
return /* @__PURE__ */ b(L.Provider, {
|
|
131
|
+
value: y,
|
|
132
|
+
children: /* @__PURE__ */ b($e, u({
|
|
133
|
+
ref: V,
|
|
134
|
+
href: a.href || a.to,
|
|
135
|
+
component: (a.href || a.to) && d === "div" ? "button" : d,
|
|
136
|
+
focusVisibleClassName: T(S.focusVisible, g),
|
|
137
|
+
ownerState: j,
|
|
138
|
+
className: T(S.root, I)
|
|
139
|
+
}, a, {
|
|
140
|
+
classes: S,
|
|
141
|
+
children: r
|
|
142
|
+
}))
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
process.env.NODE_ENV !== "production" && (re.propTypes = {
|
|
146
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
147
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
148
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
149
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
150
|
+
/**
|
|
151
|
+
* Defines the `align-items` style property.
|
|
152
|
+
* @default 'center'
|
|
153
|
+
*/
|
|
154
|
+
alignItems: t.oneOf(["center", "flex-start"]),
|
|
155
|
+
/**
|
|
156
|
+
* If `true`, the list item is focused during the first mount.
|
|
157
|
+
* Focus will also be triggered if the value changes from false to true.
|
|
158
|
+
* @default false
|
|
159
|
+
*/
|
|
160
|
+
autoFocus: t.bool,
|
|
161
|
+
/**
|
|
162
|
+
* The content of the component if a `ListItemSecondaryAction` is used it must
|
|
163
|
+
* be the last child.
|
|
164
|
+
*/
|
|
165
|
+
children: t.node,
|
|
166
|
+
/**
|
|
167
|
+
* Override or extend the styles applied to the component.
|
|
168
|
+
*/
|
|
169
|
+
classes: t.object,
|
|
170
|
+
/**
|
|
171
|
+
* @ignore
|
|
172
|
+
*/
|
|
173
|
+
className: t.string,
|
|
174
|
+
/**
|
|
175
|
+
* The component used for the root node.
|
|
176
|
+
* Either a string to use a HTML element or a component.
|
|
177
|
+
*/
|
|
178
|
+
component: t.elementType,
|
|
179
|
+
/**
|
|
180
|
+
* If `true`, compact vertical padding designed for keyboard and mouse input is used.
|
|
181
|
+
* The prop defaults to the value inherited from the parent List component.
|
|
182
|
+
* @default false
|
|
183
|
+
*/
|
|
184
|
+
dense: t.bool,
|
|
185
|
+
/**
|
|
186
|
+
* If `true`, the component is disabled.
|
|
187
|
+
* @default false
|
|
188
|
+
*/
|
|
189
|
+
disabled: t.bool,
|
|
190
|
+
/**
|
|
191
|
+
* If `true`, the left and right padding is removed.
|
|
192
|
+
* @default false
|
|
193
|
+
*/
|
|
194
|
+
disableGutters: t.bool,
|
|
195
|
+
/**
|
|
196
|
+
* If `true`, a 1px light border is added to the bottom of the list item.
|
|
197
|
+
* @default false
|
|
198
|
+
*/
|
|
199
|
+
divider: t.bool,
|
|
200
|
+
/**
|
|
201
|
+
* This prop can help identify which element has keyboard focus.
|
|
202
|
+
* The class name will be applied when the element gains the focus through keyboard interaction.
|
|
203
|
+
* It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
|
|
204
|
+
* The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
|
|
205
|
+
* A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
|
|
206
|
+
* if needed.
|
|
207
|
+
*/
|
|
208
|
+
focusVisibleClassName: t.string,
|
|
209
|
+
/**
|
|
210
|
+
* @ignore
|
|
211
|
+
*/
|
|
212
|
+
href: t.string,
|
|
213
|
+
/**
|
|
214
|
+
* Use to apply selected styling.
|
|
215
|
+
* @default false
|
|
216
|
+
*/
|
|
217
|
+
selected: t.bool,
|
|
218
|
+
/**
|
|
219
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
220
|
+
*/
|
|
221
|
+
sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object])
|
|
222
|
+
});
|
|
223
|
+
function Ae(e) {
|
|
224
|
+
return q("MuiListItemSecondaryAction", e);
|
|
225
|
+
}
|
|
226
|
+
Y("MuiListItemSecondaryAction", ["root", "disableGutters"]);
|
|
227
|
+
const Se = ["className"], ke = (e) => {
|
|
228
|
+
const {
|
|
229
|
+
disableGutters: o,
|
|
230
|
+
classes: s
|
|
231
|
+
} = e;
|
|
232
|
+
return w({
|
|
233
|
+
root: ["root", o && "disableGutters"]
|
|
234
|
+
}, Ae, s);
|
|
235
|
+
}, Me = A("div", {
|
|
236
|
+
name: "MuiListItemSecondaryAction",
|
|
237
|
+
slot: "Root",
|
|
238
|
+
overridesResolver: (e, o) => {
|
|
239
|
+
const {
|
|
240
|
+
ownerState: s
|
|
241
|
+
} = e;
|
|
242
|
+
return [o.root, s.disableGutters && o.disableGutters];
|
|
243
|
+
}
|
|
244
|
+
})(({
|
|
245
|
+
ownerState: e
|
|
246
|
+
}) => u({
|
|
247
|
+
position: "absolute",
|
|
248
|
+
right: 16,
|
|
249
|
+
top: "50%",
|
|
250
|
+
transform: "translateY(-50%)"
|
|
251
|
+
}, e.disableGutters && {
|
|
252
|
+
right: 0
|
|
253
|
+
})), X = /* @__PURE__ */ l.forwardRef(function(o, s) {
|
|
254
|
+
const n = M({
|
|
255
|
+
props: o,
|
|
256
|
+
name: "MuiListItemSecondaryAction"
|
|
257
|
+
}), {
|
|
258
|
+
className: c
|
|
259
|
+
} = n, i = $(n, Se), d = l.useContext(L), r = u({}, n, {
|
|
260
|
+
disableGutters: d.disableGutters
|
|
261
|
+
}), m = ke(r);
|
|
262
|
+
return /* @__PURE__ */ b(Me, u({
|
|
263
|
+
className: T(m.root, c),
|
|
264
|
+
ownerState: r,
|
|
265
|
+
ref: s
|
|
266
|
+
}, i));
|
|
267
|
+
});
|
|
268
|
+
process.env.NODE_ENV !== "production" && (X.propTypes = {
|
|
269
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
270
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
271
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
272
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
273
|
+
/**
|
|
274
|
+
* The content of the component, normally an `IconButton` or selection control.
|
|
275
|
+
*/
|
|
276
|
+
children: t.node,
|
|
277
|
+
/**
|
|
278
|
+
* Override or extend the styles applied to the component.
|
|
279
|
+
*/
|
|
280
|
+
classes: t.object,
|
|
281
|
+
/**
|
|
282
|
+
* @ignore
|
|
283
|
+
*/
|
|
284
|
+
className: t.string,
|
|
285
|
+
/**
|
|
286
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
287
|
+
*/
|
|
288
|
+
sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object])
|
|
289
|
+
});
|
|
290
|
+
X.muiName = "ListItemSecondaryAction";
|
|
291
|
+
const we = ["className"], je = ["alignItems", "autoFocus", "button", "children", "className", "component", "components", "componentsProps", "ContainerComponent", "ContainerProps", "dense", "disabled", "disableGutters", "disablePadding", "divider", "focusVisibleClassName", "secondaryAction", "selected", "slotProps", "slots"], Ve = (e, o) => {
|
|
292
|
+
const {
|
|
293
|
+
ownerState: s
|
|
294
|
+
} = e;
|
|
295
|
+
return [o.root, s.dense && o.dense, s.alignItems === "flex-start" && o.alignItemsFlexStart, s.divider && o.divider, !s.disableGutters && o.gutters, !s.disablePadding && o.padding, s.button && o.button, s.hasSecondaryAction && o.secondaryAction];
|
|
296
|
+
}, Be = (e) => {
|
|
297
|
+
const {
|
|
298
|
+
alignItems: o,
|
|
299
|
+
button: s,
|
|
300
|
+
classes: n,
|
|
301
|
+
dense: c,
|
|
302
|
+
disabled: i,
|
|
303
|
+
disableGutters: d,
|
|
304
|
+
disablePadding: r,
|
|
305
|
+
divider: m,
|
|
306
|
+
hasSecondaryAction: f,
|
|
307
|
+
selected: C
|
|
308
|
+
} = e;
|
|
309
|
+
return w({
|
|
310
|
+
root: ["root", c && "dense", !d && "gutters", !r && "padding", m && "divider", i && "disabled", s && "button", o === "flex-start" && "alignItemsFlexStart", f && "secondaryAction", C && "selected"],
|
|
311
|
+
container: ["container"]
|
|
312
|
+
}, Oe, n);
|
|
313
|
+
}, Ge = A("div", {
|
|
314
|
+
name: "MuiListItem",
|
|
315
|
+
slot: "Root",
|
|
316
|
+
overridesResolver: Ve
|
|
317
|
+
})(({
|
|
318
|
+
theme: e,
|
|
319
|
+
ownerState: o
|
|
320
|
+
}) => u({
|
|
321
|
+
display: "flex",
|
|
322
|
+
justifyContent: "flex-start",
|
|
323
|
+
alignItems: "center",
|
|
324
|
+
position: "relative",
|
|
325
|
+
textDecoration: "none",
|
|
326
|
+
width: "100%",
|
|
327
|
+
boxSizing: "border-box",
|
|
328
|
+
textAlign: "left"
|
|
329
|
+
}, !o.disablePadding && u({
|
|
330
|
+
paddingTop: 8,
|
|
331
|
+
paddingBottom: 8
|
|
332
|
+
}, o.dense && {
|
|
333
|
+
paddingTop: 4,
|
|
334
|
+
paddingBottom: 4
|
|
335
|
+
}, !o.disableGutters && {
|
|
336
|
+
paddingLeft: 16,
|
|
337
|
+
paddingRight: 16
|
|
338
|
+
}, !!o.secondaryAction && {
|
|
339
|
+
// Add some space to avoid collision as `ListItemSecondaryAction`
|
|
340
|
+
// is absolutely positioned.
|
|
341
|
+
paddingRight: 48
|
|
342
|
+
}), !!o.secondaryAction && {
|
|
343
|
+
[`& > .${E.root}`]: {
|
|
344
|
+
paddingRight: 48
|
|
345
|
+
}
|
|
346
|
+
}, {
|
|
347
|
+
[`&.${P.focusVisible}`]: {
|
|
348
|
+
backgroundColor: (e.vars || e).palette.action.focus
|
|
349
|
+
},
|
|
350
|
+
[`&.${P.selected}`]: {
|
|
351
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : h(e.palette.primary.main, e.palette.action.selectedOpacity),
|
|
352
|
+
[`&.${P.focusVisible}`]: {
|
|
353
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))` : h(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.focusOpacity)
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
[`&.${P.disabled}`]: {
|
|
357
|
+
opacity: (e.vars || e).palette.action.disabledOpacity
|
|
358
|
+
}
|
|
359
|
+
}, o.alignItems === "flex-start" && {
|
|
360
|
+
alignItems: "flex-start"
|
|
361
|
+
}, o.divider && {
|
|
362
|
+
borderBottom: `1px solid ${(e.vars || e).palette.divider}`,
|
|
363
|
+
backgroundClip: "padding-box"
|
|
364
|
+
}, o.button && {
|
|
365
|
+
transition: e.transitions.create("background-color", {
|
|
366
|
+
duration: e.transitions.duration.shortest
|
|
367
|
+
}),
|
|
368
|
+
"&:hover": {
|
|
369
|
+
textDecoration: "none",
|
|
370
|
+
backgroundColor: (e.vars || e).palette.action.hover,
|
|
371
|
+
// Reset on touch devices, it doesn't add specificity
|
|
372
|
+
"@media (hover: none)": {
|
|
373
|
+
backgroundColor: "transparent"
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
[`&.${P.selected}:hover`]: {
|
|
377
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` : h(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
|
|
378
|
+
// Reset on touch devices, it doesn't add specificity
|
|
379
|
+
"@media (hover: none)": {
|
|
380
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : h(e.palette.primary.main, e.palette.action.selectedOpacity)
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}, o.hasSecondaryAction && {
|
|
384
|
+
// Add some space to avoid collision as `ListItemSecondaryAction`
|
|
385
|
+
// is absolutely positioned.
|
|
386
|
+
paddingRight: 48
|
|
387
|
+
})), Fe = A("li", {
|
|
388
|
+
name: "MuiListItem",
|
|
389
|
+
slot: "Container",
|
|
390
|
+
overridesResolver: (e, o) => o.container
|
|
391
|
+
})({
|
|
392
|
+
position: "relative"
|
|
393
|
+
}), ie = /* @__PURE__ */ l.forwardRef(function(o, s) {
|
|
394
|
+
const n = M({
|
|
395
|
+
props: o,
|
|
396
|
+
name: "MuiListItem"
|
|
397
|
+
}), {
|
|
398
|
+
alignItems: c = "center",
|
|
399
|
+
autoFocus: i = !1,
|
|
400
|
+
button: d = !1,
|
|
401
|
+
children: r,
|
|
402
|
+
className: m,
|
|
403
|
+
component: f,
|
|
404
|
+
components: C = {},
|
|
405
|
+
componentsProps: g = {},
|
|
406
|
+
ContainerComponent: x = "li",
|
|
407
|
+
ContainerProps: {
|
|
408
|
+
className: I
|
|
409
|
+
} = {},
|
|
410
|
+
dense: a = !1,
|
|
411
|
+
disabled: p = !1,
|
|
412
|
+
disableGutters: y = !1,
|
|
413
|
+
disablePadding: v = !1,
|
|
414
|
+
divider: j = !1,
|
|
415
|
+
focusVisibleClassName: S,
|
|
416
|
+
secondaryAction: V,
|
|
417
|
+
selected: de = !1,
|
|
418
|
+
slotProps: pe = {},
|
|
419
|
+
slots: ue = {}
|
|
420
|
+
} = n, me = $(n.ContainerProps, we), fe = $(n, je), J = l.useContext(L), D = l.useMemo(() => ({
|
|
421
|
+
dense: a || J.dense || !1,
|
|
422
|
+
alignItems: c,
|
|
423
|
+
disableGutters: y
|
|
424
|
+
}), [c, J.dense, a, y]), W = l.useRef(null);
|
|
425
|
+
ne(() => {
|
|
426
|
+
i && (W.current ? W.current.focus() : process.env.NODE_ENV !== "production" && console.error("MUI: Unable to set focus to a ListItem whose component has not been rendered."));
|
|
427
|
+
}, [i]);
|
|
428
|
+
const N = l.Children.toArray(r), K = N.length && ae(N[N.length - 1], ["ListItemSecondaryAction"]), B = u({}, n, {
|
|
429
|
+
alignItems: c,
|
|
430
|
+
autoFocus: i,
|
|
431
|
+
button: d,
|
|
432
|
+
dense: D.dense,
|
|
433
|
+
disabled: p,
|
|
434
|
+
disableGutters: y,
|
|
435
|
+
disablePadding: v,
|
|
436
|
+
divider: j,
|
|
437
|
+
hasSecondaryAction: K,
|
|
438
|
+
selected: de
|
|
439
|
+
}), Q = Be(B), Z = H(W, s), G = ue.root || C.Root || Ge, k = pe.root || g.root || {}, O = u({
|
|
440
|
+
className: T(Q.root, k.className, m),
|
|
441
|
+
disabled: p
|
|
442
|
+
}, fe);
|
|
443
|
+
let R = f || "li";
|
|
444
|
+
return d && (O.component = f || "div", O.focusVisibleClassName = T(P.focusVisible, S), R = se), K ? (R = !O.component && !f ? "div" : R, x === "li" && (R === "li" ? R = "div" : O.component === "li" && (O.component = "div")), /* @__PURE__ */ b(L.Provider, {
|
|
445
|
+
value: D,
|
|
446
|
+
children: /* @__PURE__ */ U(Fe, u({
|
|
447
|
+
as: x,
|
|
448
|
+
className: T(Q.container, I),
|
|
449
|
+
ref: Z,
|
|
450
|
+
ownerState: B
|
|
451
|
+
}, me, {
|
|
452
|
+
children: [/* @__PURE__ */ b(G, u({}, k, !te(G) && {
|
|
453
|
+
as: R,
|
|
454
|
+
ownerState: u({}, B, k.ownerState)
|
|
455
|
+
}, O, {
|
|
456
|
+
children: N
|
|
457
|
+
})), N.pop()]
|
|
458
|
+
}))
|
|
459
|
+
})) : /* @__PURE__ */ b(L.Provider, {
|
|
460
|
+
value: D,
|
|
461
|
+
children: /* @__PURE__ */ U(G, u({}, k, {
|
|
462
|
+
as: R,
|
|
463
|
+
ref: Z
|
|
464
|
+
}, !te(G) && {
|
|
465
|
+
ownerState: u({}, B, k.ownerState)
|
|
466
|
+
}, O, {
|
|
467
|
+
children: [N, V && /* @__PURE__ */ b(X, {
|
|
468
|
+
children: V
|
|
469
|
+
})]
|
|
470
|
+
}))
|
|
471
|
+
});
|
|
472
|
+
});
|
|
473
|
+
process.env.NODE_ENV !== "production" && (ie.propTypes = {
|
|
474
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
475
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
476
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
477
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
478
|
+
/**
|
|
479
|
+
* Defines the `align-items` style property.
|
|
480
|
+
* @default 'center'
|
|
481
|
+
*/
|
|
482
|
+
alignItems: t.oneOf(["center", "flex-start"]),
|
|
483
|
+
/**
|
|
484
|
+
* If `true`, the list item is focused during the first mount.
|
|
485
|
+
* Focus will also be triggered if the value changes from false to true.
|
|
486
|
+
* @default false
|
|
487
|
+
* @deprecated checkout [ListItemButton](/material-ui/api/list-item-button/) instead
|
|
488
|
+
*/
|
|
489
|
+
autoFocus: t.bool,
|
|
490
|
+
/**
|
|
491
|
+
* If `true`, the list item is a button (using `ButtonBase`). Props intended
|
|
492
|
+
* for `ButtonBase` can then be applied to `ListItem`.
|
|
493
|
+
* @default false
|
|
494
|
+
* @deprecated checkout [ListItemButton](/material-ui/api/list-item-button/) instead
|
|
495
|
+
*/
|
|
496
|
+
button: t.bool,
|
|
497
|
+
/**
|
|
498
|
+
* The content of the component if a `ListItemSecondaryAction` is used it must
|
|
499
|
+
* be the last child.
|
|
500
|
+
*/
|
|
501
|
+
children: Le(t.node, (e) => {
|
|
502
|
+
const o = l.Children.toArray(e.children);
|
|
503
|
+
let s = -1;
|
|
504
|
+
for (let n = o.length - 1; n >= 0; n -= 1) {
|
|
505
|
+
const c = o[n];
|
|
506
|
+
if (ae(c, ["ListItemSecondaryAction"])) {
|
|
507
|
+
s = n;
|
|
508
|
+
break;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
return s !== -1 && s !== o.length - 1 ? new Error("MUI: You used an element after ListItemSecondaryAction. For ListItem to detect that it has a secondary action you must pass it as the last child to ListItem.") : null;
|
|
512
|
+
}),
|
|
513
|
+
/**
|
|
514
|
+
* Override or extend the styles applied to the component.
|
|
515
|
+
*/
|
|
516
|
+
classes: t.object,
|
|
517
|
+
/**
|
|
518
|
+
* @ignore
|
|
519
|
+
*/
|
|
520
|
+
className: t.string,
|
|
521
|
+
/**
|
|
522
|
+
* The component used for the root node.
|
|
523
|
+
* Either a string to use a HTML element or a component.
|
|
524
|
+
*/
|
|
525
|
+
component: t.elementType,
|
|
526
|
+
/**
|
|
527
|
+
* The components used for each slot inside.
|
|
528
|
+
*
|
|
529
|
+
* This prop is an alias for the `slots` prop.
|
|
530
|
+
* It's recommended to use the `slots` prop instead.
|
|
531
|
+
*
|
|
532
|
+
* @default {}
|
|
533
|
+
*/
|
|
534
|
+
components: t.shape({
|
|
535
|
+
Root: t.elementType
|
|
536
|
+
}),
|
|
537
|
+
/**
|
|
538
|
+
* The extra props for the slot components.
|
|
539
|
+
* You can override the existing props or add new ones.
|
|
540
|
+
*
|
|
541
|
+
* This prop is an alias for the `slotProps` prop.
|
|
542
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
543
|
+
*
|
|
544
|
+
* @default {}
|
|
545
|
+
*/
|
|
546
|
+
componentsProps: t.shape({
|
|
547
|
+
root: t.object
|
|
548
|
+
}),
|
|
549
|
+
/**
|
|
550
|
+
* The container component used when a `ListItemSecondaryAction` is the last child.
|
|
551
|
+
* @default 'li'
|
|
552
|
+
* @deprecated
|
|
553
|
+
*/
|
|
554
|
+
ContainerComponent: be,
|
|
555
|
+
/**
|
|
556
|
+
* Props applied to the container component if used.
|
|
557
|
+
* @default {}
|
|
558
|
+
* @deprecated
|
|
559
|
+
*/
|
|
560
|
+
ContainerProps: t.object,
|
|
561
|
+
/**
|
|
562
|
+
* If `true`, compact vertical padding designed for keyboard and mouse input is used.
|
|
563
|
+
* The prop defaults to the value inherited from the parent List component.
|
|
564
|
+
* @default false
|
|
565
|
+
*/
|
|
566
|
+
dense: t.bool,
|
|
567
|
+
/**
|
|
568
|
+
* If `true`, the component is disabled.
|
|
569
|
+
* @default false
|
|
570
|
+
* @deprecated checkout [ListItemButton](/material-ui/api/list-item-button/) instead
|
|
571
|
+
*/
|
|
572
|
+
disabled: t.bool,
|
|
573
|
+
/**
|
|
574
|
+
* If `true`, the left and right padding is removed.
|
|
575
|
+
* @default false
|
|
576
|
+
*/
|
|
577
|
+
disableGutters: t.bool,
|
|
578
|
+
/**
|
|
579
|
+
* If `true`, all padding is removed.
|
|
580
|
+
* @default false
|
|
581
|
+
*/
|
|
582
|
+
disablePadding: t.bool,
|
|
583
|
+
/**
|
|
584
|
+
* If `true`, a 1px light border is added to the bottom of the list item.
|
|
585
|
+
* @default false
|
|
586
|
+
*/
|
|
587
|
+
divider: t.bool,
|
|
588
|
+
/**
|
|
589
|
+
* @ignore
|
|
590
|
+
*/
|
|
591
|
+
focusVisibleClassName: t.string,
|
|
592
|
+
/**
|
|
593
|
+
* The element to display at the end of ListItem.
|
|
594
|
+
*/
|
|
595
|
+
secondaryAction: t.node,
|
|
596
|
+
/**
|
|
597
|
+
* Use to apply selected styling.
|
|
598
|
+
* @default false
|
|
599
|
+
* @deprecated checkout [ListItemButton](/material-ui/api/list-item-button/) instead
|
|
600
|
+
*/
|
|
601
|
+
selected: t.bool,
|
|
602
|
+
/**
|
|
603
|
+
* The extra props for the slot components.
|
|
604
|
+
* You can override the existing props or add new ones.
|
|
605
|
+
*
|
|
606
|
+
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
607
|
+
*
|
|
608
|
+
* @default {}
|
|
609
|
+
*/
|
|
610
|
+
slotProps: t.shape({
|
|
611
|
+
root: t.object
|
|
612
|
+
}),
|
|
613
|
+
/**
|
|
614
|
+
* The components used for each slot inside.
|
|
615
|
+
*
|
|
616
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
617
|
+
*
|
|
618
|
+
* @default {}
|
|
619
|
+
*/
|
|
620
|
+
slots: t.shape({
|
|
621
|
+
root: t.elementType
|
|
622
|
+
}),
|
|
623
|
+
/**
|
|
624
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
625
|
+
*/
|
|
626
|
+
sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object])
|
|
627
|
+
});
|
|
628
|
+
const Ue = ["className"], _e = (e) => {
|
|
629
|
+
const {
|
|
630
|
+
alignItems: o,
|
|
631
|
+
classes: s
|
|
632
|
+
} = e;
|
|
633
|
+
return w({
|
|
634
|
+
root: ["root", o === "flex-start" && "alignItemsFlexStart"]
|
|
635
|
+
}, Ce, s);
|
|
636
|
+
}, De = A("div", {
|
|
637
|
+
name: "MuiListItemIcon",
|
|
638
|
+
slot: "Root",
|
|
639
|
+
overridesResolver: (e, o) => {
|
|
640
|
+
const {
|
|
641
|
+
ownerState: s
|
|
642
|
+
} = e;
|
|
643
|
+
return [o.root, s.alignItems === "flex-start" && o.alignItemsFlexStart];
|
|
644
|
+
}
|
|
645
|
+
})(({
|
|
646
|
+
theme: e,
|
|
647
|
+
ownerState: o
|
|
648
|
+
}) => u({
|
|
649
|
+
minWidth: 56,
|
|
650
|
+
color: (e.vars || e).palette.action.active,
|
|
651
|
+
flexShrink: 0,
|
|
652
|
+
display: "inline-flex"
|
|
653
|
+
}, o.alignItems === "flex-start" && {
|
|
654
|
+
marginTop: 8
|
|
655
|
+
})), ce = /* @__PURE__ */ l.forwardRef(function(o, s) {
|
|
656
|
+
const n = M({
|
|
657
|
+
props: o,
|
|
658
|
+
name: "MuiListItemIcon"
|
|
659
|
+
}), {
|
|
660
|
+
className: c
|
|
661
|
+
} = n, i = $(n, Ue), d = l.useContext(L), r = u({}, n, {
|
|
662
|
+
alignItems: d.alignItems
|
|
663
|
+
}), m = _e(r);
|
|
664
|
+
return /* @__PURE__ */ b(De, u({
|
|
665
|
+
className: T(m.root, c),
|
|
666
|
+
ownerState: r,
|
|
667
|
+
ref: s
|
|
668
|
+
}, i));
|
|
669
|
+
});
|
|
670
|
+
process.env.NODE_ENV !== "production" && (ce.propTypes = {
|
|
671
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
672
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
673
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
674
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
675
|
+
/**
|
|
676
|
+
* The content of the component, normally `Icon`, `SvgIcon`,
|
|
677
|
+
* or a `@mui/icons-material` SVG icon element.
|
|
678
|
+
*/
|
|
679
|
+
children: t.node,
|
|
680
|
+
/**
|
|
681
|
+
* Override or extend the styles applied to the component.
|
|
682
|
+
*/
|
|
683
|
+
classes: t.object,
|
|
684
|
+
/**
|
|
685
|
+
* @ignore
|
|
686
|
+
*/
|
|
687
|
+
className: t.string,
|
|
688
|
+
/**
|
|
689
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
690
|
+
*/
|
|
691
|
+
sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object])
|
|
692
|
+
});
|
|
693
|
+
const We = ["children", "className", "disableTypography", "inset", "primary", "primaryTypographyProps", "secondary", "secondaryTypographyProps"], ze = (e) => {
|
|
694
|
+
const {
|
|
695
|
+
classes: o,
|
|
696
|
+
inset: s,
|
|
697
|
+
primary: n,
|
|
698
|
+
secondary: c,
|
|
699
|
+
dense: i
|
|
700
|
+
} = e;
|
|
701
|
+
return w({
|
|
702
|
+
root: ["root", s && "inset", i && "dense", n && c && "multiline"],
|
|
703
|
+
primary: ["primary"],
|
|
704
|
+
secondary: ["secondary"]
|
|
705
|
+
}, xe, o);
|
|
706
|
+
}, He = A("div", {
|
|
707
|
+
name: "MuiListItemText",
|
|
708
|
+
slot: "Root",
|
|
709
|
+
overridesResolver: (e, o) => {
|
|
710
|
+
const {
|
|
711
|
+
ownerState: s
|
|
712
|
+
} = e;
|
|
713
|
+
return [{
|
|
714
|
+
[`& .${ee.primary}`]: o.primary
|
|
715
|
+
}, {
|
|
716
|
+
[`& .${ee.secondary}`]: o.secondary
|
|
717
|
+
}, o.root, s.inset && o.inset, s.primary && s.secondary && o.multiline, s.dense && o.dense];
|
|
718
|
+
}
|
|
719
|
+
})(({
|
|
720
|
+
ownerState: e
|
|
721
|
+
}) => u({
|
|
722
|
+
flex: "1 1 auto",
|
|
723
|
+
minWidth: 0,
|
|
724
|
+
marginTop: 4,
|
|
725
|
+
marginBottom: 4
|
|
726
|
+
}, e.primary && e.secondary && {
|
|
727
|
+
marginTop: 6,
|
|
728
|
+
marginBottom: 6
|
|
729
|
+
}, e.inset && {
|
|
730
|
+
paddingLeft: 56
|
|
731
|
+
})), le = /* @__PURE__ */ l.forwardRef(function(o, s) {
|
|
732
|
+
const n = M({
|
|
733
|
+
props: o,
|
|
734
|
+
name: "MuiListItemText"
|
|
735
|
+
}), {
|
|
736
|
+
children: c,
|
|
737
|
+
className: i,
|
|
738
|
+
disableTypography: d = !1,
|
|
739
|
+
inset: r = !1,
|
|
740
|
+
primary: m,
|
|
741
|
+
primaryTypographyProps: f,
|
|
742
|
+
secondary: C,
|
|
743
|
+
secondaryTypographyProps: g
|
|
744
|
+
} = n, x = $(n, We), {
|
|
745
|
+
dense: I
|
|
746
|
+
} = l.useContext(L);
|
|
747
|
+
let a = m ?? c, p = C;
|
|
748
|
+
const y = u({}, n, {
|
|
749
|
+
disableTypography: d,
|
|
750
|
+
inset: r,
|
|
751
|
+
primary: !!a,
|
|
752
|
+
secondary: !!p,
|
|
753
|
+
dense: I
|
|
754
|
+
}), v = ze(y);
|
|
755
|
+
return a != null && a.type !== F && !d && (a = /* @__PURE__ */ b(F, u({
|
|
756
|
+
variant: I ? "body2" : "body1",
|
|
757
|
+
className: v.primary,
|
|
758
|
+
component: f != null && f.variant ? void 0 : "span",
|
|
759
|
+
display: "block"
|
|
760
|
+
}, f, {
|
|
761
|
+
children: a
|
|
762
|
+
}))), p != null && p.type !== F && !d && (p = /* @__PURE__ */ b(F, u({
|
|
763
|
+
variant: "body2",
|
|
764
|
+
className: v.secondary,
|
|
765
|
+
color: "text.secondary",
|
|
766
|
+
display: "block"
|
|
767
|
+
}, g, {
|
|
768
|
+
children: p
|
|
769
|
+
}))), /* @__PURE__ */ U(He, u({
|
|
770
|
+
className: T(v.root, i),
|
|
771
|
+
ownerState: y,
|
|
772
|
+
ref: s
|
|
773
|
+
}, x, {
|
|
774
|
+
children: [a, p]
|
|
775
|
+
}));
|
|
776
|
+
});
|
|
777
|
+
process.env.NODE_ENV !== "production" && (le.propTypes = {
|
|
778
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
779
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
780
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
781
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
782
|
+
/**
|
|
783
|
+
* Alias for the `primary` prop.
|
|
784
|
+
*/
|
|
785
|
+
children: t.node,
|
|
786
|
+
/**
|
|
787
|
+
* Override or extend the styles applied to the component.
|
|
788
|
+
*/
|
|
789
|
+
classes: t.object,
|
|
790
|
+
/**
|
|
791
|
+
* @ignore
|
|
792
|
+
*/
|
|
793
|
+
className: t.string,
|
|
794
|
+
/**
|
|
795
|
+
* If `true`, the children won't be wrapped by a Typography component.
|
|
796
|
+
* This can be useful to render an alternative Typography variant by wrapping
|
|
797
|
+
* the `children` (or `primary`) text, and optional `secondary` text
|
|
798
|
+
* with the Typography component.
|
|
799
|
+
* @default false
|
|
800
|
+
*/
|
|
801
|
+
disableTypography: t.bool,
|
|
802
|
+
/**
|
|
803
|
+
* If `true`, the children are indented.
|
|
804
|
+
* This should be used if there is no left avatar or left icon.
|
|
805
|
+
* @default false
|
|
806
|
+
*/
|
|
807
|
+
inset: t.bool,
|
|
808
|
+
/**
|
|
809
|
+
* The main content element.
|
|
810
|
+
*/
|
|
811
|
+
primary: t.node,
|
|
812
|
+
/**
|
|
813
|
+
* These props will be forwarded to the primary typography component
|
|
814
|
+
* (as long as disableTypography is not `true`).
|
|
815
|
+
*/
|
|
816
|
+
primaryTypographyProps: t.object,
|
|
817
|
+
/**
|
|
818
|
+
* The secondary content element.
|
|
819
|
+
*/
|
|
820
|
+
secondary: t.node,
|
|
821
|
+
/**
|
|
822
|
+
* These props will be forwarded to the secondary typography component
|
|
823
|
+
* (as long as disableTypography is not `true`).
|
|
824
|
+
*/
|
|
825
|
+
secondaryTypographyProps: t.object,
|
|
826
|
+
/**
|
|
827
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
828
|
+
*/
|
|
829
|
+
sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object])
|
|
830
|
+
});
|
|
831
|
+
function oe(e) {
|
|
832
|
+
return e.substring(2).toLowerCase();
|
|
833
|
+
}
|
|
834
|
+
function Ye(e, o) {
|
|
835
|
+
return o.documentElement.clientWidth < e.clientX || o.documentElement.clientHeight < e.clientY;
|
|
836
|
+
}
|
|
837
|
+
function _(e) {
|
|
838
|
+
const {
|
|
839
|
+
children: o,
|
|
840
|
+
disableReactTree: s = !1,
|
|
841
|
+
mouseEvent: n = "onClick",
|
|
842
|
+
onClickAway: c,
|
|
843
|
+
touchEvent: i = "onTouchEnd"
|
|
844
|
+
} = e, d = l.useRef(!1), r = l.useRef(null), m = l.useRef(!1), f = l.useRef(!1);
|
|
845
|
+
l.useEffect(() => (setTimeout(() => {
|
|
846
|
+
m.current = !0;
|
|
847
|
+
}, 0), () => {
|
|
848
|
+
m.current = !1;
|
|
849
|
+
}), []);
|
|
850
|
+
const C = H(
|
|
851
|
+
// @ts-expect-error TODO upstream fix
|
|
852
|
+
o.ref,
|
|
853
|
+
r
|
|
854
|
+
), g = ge((a) => {
|
|
855
|
+
const p = f.current;
|
|
856
|
+
f.current = !1;
|
|
857
|
+
const y = z(r.current);
|
|
858
|
+
if (!m.current || !r.current || "clientX" in a && Ye(a, y))
|
|
859
|
+
return;
|
|
860
|
+
if (d.current) {
|
|
861
|
+
d.current = !1;
|
|
862
|
+
return;
|
|
863
|
+
}
|
|
864
|
+
let v;
|
|
865
|
+
a.composedPath ? v = a.composedPath().indexOf(r.current) > -1 : v = !y.documentElement.contains(
|
|
866
|
+
// @ts-expect-error returns `false` as intended when not dispatched from a Node
|
|
867
|
+
a.target
|
|
868
|
+
) || r.current.contains(
|
|
869
|
+
// @ts-expect-error returns `false` as intended when not dispatched from a Node
|
|
870
|
+
a.target
|
|
871
|
+
), !v && (s || !p) && c(a);
|
|
872
|
+
}), x = (a) => (p) => {
|
|
873
|
+
f.current = !0;
|
|
874
|
+
const y = o.props[a];
|
|
875
|
+
y && y(p);
|
|
876
|
+
}, I = {
|
|
877
|
+
ref: C
|
|
878
|
+
};
|
|
879
|
+
return i !== !1 && (I[i] = x(i)), l.useEffect(() => {
|
|
880
|
+
if (i !== !1) {
|
|
881
|
+
const a = oe(i), p = z(r.current), y = () => {
|
|
882
|
+
d.current = !0;
|
|
883
|
+
};
|
|
884
|
+
return p.addEventListener(a, g), p.addEventListener("touchmove", y), () => {
|
|
885
|
+
p.removeEventListener(a, g), p.removeEventListener("touchmove", y);
|
|
886
|
+
};
|
|
887
|
+
}
|
|
888
|
+
}, [g, i]), n !== !1 && (I[n] = x(n)), l.useEffect(() => {
|
|
889
|
+
if (n !== !1) {
|
|
890
|
+
const a = oe(n), p = z(r.current);
|
|
891
|
+
return p.addEventListener(a, g), () => {
|
|
892
|
+
p.removeEventListener(a, g);
|
|
893
|
+
};
|
|
894
|
+
}
|
|
895
|
+
}, [g, n]), /* @__PURE__ */ b(l.Fragment, {
|
|
896
|
+
children: /* @__PURE__ */ l.cloneElement(o, I)
|
|
897
|
+
});
|
|
898
|
+
}
|
|
899
|
+
process.env.NODE_ENV !== "production" && (_.propTypes = {
|
|
900
|
+
// ----------------------------- Warning --------------------------------
|
|
901
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
902
|
+
// | To update them edit TypeScript types and run "yarn proptypes" |
|
|
903
|
+
// ----------------------------------------------------------------------
|
|
904
|
+
/**
|
|
905
|
+
* The wrapped element.
|
|
906
|
+
*/
|
|
907
|
+
children: ve.isRequired,
|
|
908
|
+
/**
|
|
909
|
+
* If `true`, the React tree is ignored and only the DOM tree is considered.
|
|
910
|
+
* This prop changes how portaled elements are handled.
|
|
911
|
+
* @default false
|
|
912
|
+
*/
|
|
913
|
+
disableReactTree: t.bool,
|
|
914
|
+
/**
|
|
915
|
+
* The mouse event to listen to. You can disable the listener by providing `false`.
|
|
916
|
+
* @default 'onClick'
|
|
917
|
+
*/
|
|
918
|
+
mouseEvent: t.oneOf(["onClick", "onMouseDown", "onMouseUp", "onPointerDown", "onPointerUp", !1]),
|
|
919
|
+
/**
|
|
920
|
+
* Callback fired when a "click away" event is detected.
|
|
921
|
+
*/
|
|
922
|
+
onClickAway: t.func.isRequired,
|
|
923
|
+
/**
|
|
924
|
+
* The touch event to listen to. You can disable the listener by providing `false`.
|
|
925
|
+
* @default 'onTouchEnd'
|
|
926
|
+
*/
|
|
927
|
+
touchEvent: t.oneOf(["onTouchEnd", "onTouchStart", !1])
|
|
928
|
+
});
|
|
929
|
+
process.env.NODE_ENV !== "production" && (_.propTypes = Ie(_.propTypes));
|
|
930
|
+
const rt = ({
|
|
931
|
+
open: e,
|
|
932
|
+
buttons: o,
|
|
933
|
+
position: s,
|
|
934
|
+
width: n = 160,
|
|
935
|
+
sx: c,
|
|
936
|
+
onClose: i
|
|
937
|
+
}) => {
|
|
938
|
+
const d = () => {
|
|
939
|
+
i && i();
|
|
940
|
+
};
|
|
941
|
+
return e ? /* @__PURE__ */ b(_, { onClickAway: d, children: /* @__PURE__ */ b(
|
|
942
|
+
he,
|
|
943
|
+
{
|
|
944
|
+
sx: {
|
|
945
|
+
position: "absolute",
|
|
946
|
+
zIndex: 9999999,
|
|
947
|
+
width: n,
|
|
948
|
+
maxWidth: 360,
|
|
949
|
+
bgcolor: "background.paper",
|
|
950
|
+
left: s == null ? void 0 : s.left,
|
|
951
|
+
top: s == null ? void 0 : s.top,
|
|
952
|
+
borderRadius: 0.5,
|
|
953
|
+
...c
|
|
954
|
+
},
|
|
955
|
+
disablePadding: !0,
|
|
956
|
+
children: o.map((r, m) => /* @__PURE__ */ b(ie, { secondaryAction: r.endIcon, disablePadding: !0, children: /* @__PURE__ */ U(re, { role: void 0, onClick: r.onClick, dense: !0, children: [
|
|
957
|
+
r.startIcon !== void 0 && /* @__PURE__ */ b(ce, { sx: { minWidth: "auto", mr: 1 }, children: r.startIcon }),
|
|
958
|
+
/* @__PURE__ */ b(
|
|
959
|
+
le,
|
|
960
|
+
{
|
|
961
|
+
primary: r.label,
|
|
962
|
+
primaryTypographyProps: {
|
|
963
|
+
fontSize: "12px"
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
)
|
|
967
|
+
] }) }, m))
|
|
968
|
+
}
|
|
969
|
+
) }) : /* @__PURE__ */ b(ye, {});
|
|
970
|
+
};
|
|
971
|
+
export {
|
|
972
|
+
rt as ContextMenu
|
|
973
|
+
};
|