@rankingcoach/vanguard 1.4.2 → 1.5.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/index-Accordion2.js +1 -1
- package/dist/index-AccordionDetails.js +1 -1
- package/dist/index-AccordionSummary.js +1 -1
- package/dist/index-AiGlow.js +1 -1
- package/dist/index-AppBar2.js +1 -1
- package/dist/index-Autocomplete.js +2 -2
- package/dist/index-Autocomplete2.js +1 -1
- package/dist/index-Backdrop.js +1 -1
- package/dist/index-BasePopper.js +1 -1
- package/dist/index-Box.js +1 -1
- package/dist/index-Button2.js +1 -1
- package/dist/index-ButtonBase.js +1 -1
- package/dist/index-CSSTransition.js +1 -1
- package/dist/index-CalendarPicker.js +1 -1
- package/dist/index-Chip.js +1 -1
- package/dist/index-ClickAwayListener.js +1 -1
- package/dist/index-ClockPicker.js +1 -1
- package/dist/index-Collapse2.js +1 -1
- package/dist/index-DatePicker2.js +1 -1
- package/dist/index-DefaultPropsProvider.js +1 -1
- package/dist/index-DefaultPropsProvider2.js +1 -1
- package/dist/index-DesktopDatePicker.js +1 -1
- package/dist/index-Dialog.js +1 -1
- package/dist/index-DialogActions.js +1 -1
- package/dist/index-DialogContent.js +1 -1
- package/dist/index-Drawer.js +1 -1
- package/dist/index-Drawer2.js +1 -1
- package/dist/index-DropdownMenu.js +1 -1
- package/dist/index-Fade.js +1 -1
- package/dist/index-FilledInput.js +1 -1
- package/dist/index-FocusTrap.js +1 -1
- package/dist/index-FormControl2.js +1 -1
- package/dist/index-FormHelperText.js +1 -1
- package/dist/index-FormLabel.js +1 -1
- package/dist/index-GlobalStyles.js +1 -1
- package/dist/index-GlobalStyles2.js +1 -1
- package/dist/index-GlobalStyles3.js +1 -1
- package/dist/index-Grid.js +1 -1
- package/dist/index-Grow.js +1 -1
- package/dist/index-Header.js +1 -1
- package/dist/index-IconButton2.js +1 -1
- package/dist/index-Input2.js +1 -1
- package/dist/index-InputAdornment.js +1 -1
- package/dist/index-InputBase2.js +1 -1
- package/dist/index-InputLabel.js +1 -1
- package/dist/index-LinearProgress.js +1 -1
- package/dist/index-List2.js +1 -1
- package/dist/index-ListSubheader.js +1 -1
- package/dist/index-LocalizationProvider.js +1 -1
- package/dist/index-Menu.js +41 -251
- package/dist/index-Menu2.js +254 -0
- package/dist/index-MenuItem.js +38 -237
- package/dist/index-MenuItem2.js +240 -0
- package/dist/index-MenuList.js +1 -1
- package/dist/index-MobileDatePicker.js +1 -1
- package/dist/index-Modal2.js +1 -1
- package/dist/index-MonthPicker.js +1 -1
- package/dist/index-NativeSelectInput.js +1 -1
- package/dist/index-NotchedOutline.js +1 -1
- package/dist/index-OutlinedInput.js +1 -1
- package/dist/index-Paper.js +1 -1
- package/dist/index-Parser2.js +2 -3
- package/dist/index-PickersDay.js +1 -1
- package/dist/index-Popover2.js +1 -1
- package/dist/index-Popper.js +1 -1
- package/dist/index-Portal.js +1 -1
- package/dist/index-PropTypes.js +1 -1
- package/dist/index-QuoteContainer.js +1 -1
- package/dist/index-Ripple.js +1 -1
- package/dist/index-RtlProvider.js +1 -1
- package/dist/index-ScrollbarSize.js +1 -1
- package/dist/index-SearchableSelect.js +1 -1
- package/dist/index-Select.js +1 -1
- package/dist/index-Select2.js +1 -1
- package/dist/index-SelectInput2.js +2 -2
- package/dist/index-Skeleton2.js +1 -1
- package/dist/index-Slide.js +1 -1
- package/dist/index-Slider2.js +1 -1
- package/dist/index-SliderValueLabel.js +1 -1
- package/dist/index-Snackbar2.js +1 -1
- package/dist/index-SnackbarContent.js +1 -1
- package/dist/index-StyledEngineProvider.js +1 -1
- package/dist/index-SvgIcon.js +1 -1
- package/dist/index-Tab2.js +1 -1
- package/dist/index-TabScrollButton.js +1 -1
- package/dist/index-Tabs2.js +1 -1
- package/dist/index-TextField.js +1 -1
- package/dist/index-TextareaAutosize.js +1 -1
- package/dist/index-ToggleButton2.js +1 -1
- package/dist/index-ToggleButtonGroup2.js +1 -1
- package/dist/index-Toolbar2.js +1 -1
- package/dist/index-Tooltip.js +1 -1
- package/dist/index-TouchRipple.js +1 -1
- package/dist/index-Transition.js +1 -1
- package/dist/index-TransitionGroup.js +1 -1
- package/dist/index-Typography.js +1 -1
- package/dist/index-YearPicker.js +1 -1
- package/dist/index-_virtual16.js +3 -5
- package/dist/index-_virtual17.js +5 -3
- package/dist/index-_virtual2.js +5 -5
- package/dist/index-_virtual3.js +4 -4
- package/dist/index-_virtual4.js +5 -5
- package/dist/index-elementAcceptingRef.js +1 -1
- package/dist/index-elementTypeAcceptingRef.js +1 -1
- package/dist/index-helpers3.js +1 -1
- package/dist/index-refType.js +1 -1
- package/dist/index-responsivePropType.js +1 -1
- package/dist/index.js +396 -392
- package/dist/types/core/Menu/Menu.d.ts +17 -0
- package/dist/types/core/Menu/index.d.ts +2 -0
- package/dist/types/core/MenuItem/MenuItem.d.ts +14 -0
- package/dist/types/core/MenuItem/index.d.ts +2 -0
- package/dist/types/index.d.ts +62 -58
- package/dist/vanguard-asset-analysis.json +1 -1
- package/dist/vanguard.css +1 -1
- package/dist-wordpress/vanguard.css +1 -1
- package/package.json +1 -1
package/dist/index-Menu.js
CHANGED
|
@@ -1,254 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
slot: "Paper",
|
|
41
|
-
overridesResolver: (r, t) => t.paper
|
|
42
|
-
})({
|
|
43
|
-
// specZ: The maximum height of a simple menu should be one or more rows less than the view
|
|
44
|
-
// height. This ensures a tappable area outside of the simple menu with which to dismiss
|
|
45
|
-
// the menu.
|
|
46
|
-
maxHeight: "calc(100% - 96px)",
|
|
47
|
-
// Add iOS momentum scrolling for iOS < 13.0
|
|
48
|
-
WebkitOverflowScrolling: "touch"
|
|
49
|
-
}), po = h(Y, {
|
|
50
|
-
name: "MuiMenu",
|
|
51
|
-
slot: "List",
|
|
52
|
-
overridesResolver: (r, t) => t.list
|
|
53
|
-
})({
|
|
54
|
-
// We disable the focus ring for mouse, touch and keyboard users.
|
|
55
|
-
outline: 0
|
|
56
|
-
}), io = /* @__PURE__ */ l.forwardRef(function(t, y) {
|
|
57
|
-
var O, R;
|
|
58
|
-
const s = q({
|
|
59
|
-
props: t,
|
|
60
|
-
name: "MuiMenu"
|
|
61
|
-
}), {
|
|
62
|
-
autoFocus: c = !0,
|
|
63
|
-
children: g,
|
|
64
|
-
className: D,
|
|
65
|
-
disableAutoFocusItem: u = !1,
|
|
66
|
-
MenuListProps: m = {},
|
|
67
|
-
onClose: f,
|
|
68
|
-
open: F,
|
|
69
|
-
PaperProps: j = {},
|
|
70
|
-
PopoverClasses: _,
|
|
71
|
-
transitionDuration: x = "auto",
|
|
72
|
-
TransitionProps: {
|
|
73
|
-
onEntering: d
|
|
74
|
-
} = {},
|
|
75
|
-
variant: P = "selectedMenu",
|
|
76
|
-
slots: b = {},
|
|
77
|
-
slotProps: N = {}
|
|
78
|
-
} = s, S = E(s.TransitionProps, oo), w = E(s, eo), M = W(), n = i({}, s, {
|
|
79
|
-
autoFocus: c,
|
|
80
|
-
disableAutoFocusItem: u,
|
|
81
|
-
MenuListProps: m,
|
|
82
|
-
onEntering: d,
|
|
83
|
-
PaperProps: j,
|
|
84
|
-
transitionDuration: x,
|
|
85
|
-
TransitionProps: S,
|
|
86
|
-
variant: P
|
|
87
|
-
}), v = so(n), A = c && !u && F, T = l.useRef(null), z = (e, p) => {
|
|
88
|
-
T.current && T.current.adjustStyleForScrollbar(e, {
|
|
89
|
-
direction: M ? "rtl" : "ltr"
|
|
90
|
-
}), d && d(e, p);
|
|
91
|
-
}, K = (e) => {
|
|
92
|
-
e.key === "Tab" && (e.preventDefault(), f && f(e, "tabKeyDown"));
|
|
93
|
-
};
|
|
94
|
-
let a = -1;
|
|
95
|
-
l.Children.map(g, (e, p) => {
|
|
96
|
-
/* @__PURE__ */ l.isValidElement(e) && (process.env.NODE_ENV !== "production" && G(e), e.props.disabled || (P === "selectedMenu" && e.props.selected || a === -1) && (a = p));
|
|
1
|
+
import { jsx as P } from "react/jsx-runtime";
|
|
2
|
+
import { MenuItem as M } from "./index-MenuItem.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import j from "./index-Menu2.js";
|
|
5
|
+
const b = ({
|
|
6
|
+
testId: a,
|
|
7
|
+
items: p,
|
|
8
|
+
children: c,
|
|
9
|
+
width: r,
|
|
10
|
+
height: s,
|
|
11
|
+
maxWidth: t,
|
|
12
|
+
maxHeight: e,
|
|
13
|
+
...o
|
|
14
|
+
}) => {
|
|
15
|
+
var l, m, u;
|
|
16
|
+
const n = r || s || t || e ? {
|
|
17
|
+
width: r,
|
|
18
|
+
height: s,
|
|
19
|
+
maxWidth: t,
|
|
20
|
+
maxHeight: e
|
|
21
|
+
} : void 0, f = n ? {
|
|
22
|
+
paper: {
|
|
23
|
+
style: {
|
|
24
|
+
...n,
|
|
25
|
+
...(m = (l = o.slotProps) == null ? void 0 : l.paper) == null ? void 0 : m.style
|
|
26
|
+
},
|
|
27
|
+
...(u = o.slotProps) == null ? void 0 : u.paper
|
|
28
|
+
}
|
|
29
|
+
} : o.slotProps;
|
|
30
|
+
return P(j, {
|
|
31
|
+
"data-testid": a,
|
|
32
|
+
...o,
|
|
33
|
+
slotProps: f,
|
|
34
|
+
children: p ? p.map(({
|
|
35
|
+
key: d,
|
|
36
|
+
...i
|
|
37
|
+
}, y) => P(M, {
|
|
38
|
+
...i
|
|
39
|
+
}, d ?? y)) : c
|
|
97
40
|
});
|
|
98
|
-
|
|
99
|
-
elementType: b.root,
|
|
100
|
-
externalSlotProps: N.root,
|
|
101
|
-
ownerState: n,
|
|
102
|
-
className: [v.root, D]
|
|
103
|
-
}), k = L({
|
|
104
|
-
elementType: C,
|
|
105
|
-
externalSlotProps: U,
|
|
106
|
-
ownerState: n,
|
|
107
|
-
className: v.paper
|
|
108
|
-
});
|
|
109
|
-
return /* @__PURE__ */ I(no, i({
|
|
110
|
-
onClose: f,
|
|
111
|
-
anchorOrigin: {
|
|
112
|
-
vertical: "bottom",
|
|
113
|
-
horizontal: M ? "right" : "left"
|
|
114
|
-
},
|
|
115
|
-
transformOrigin: M ? to : ro,
|
|
116
|
-
slots: {
|
|
117
|
-
paper: C,
|
|
118
|
-
root: b.root
|
|
119
|
-
},
|
|
120
|
-
slotProps: {
|
|
121
|
-
root: V,
|
|
122
|
-
paper: k
|
|
123
|
-
},
|
|
124
|
-
open: F,
|
|
125
|
-
ref: y,
|
|
126
|
-
transitionDuration: x,
|
|
127
|
-
TransitionProps: i({
|
|
128
|
-
onEntering: z
|
|
129
|
-
}, S),
|
|
130
|
-
ownerState: n
|
|
131
|
-
}, w, {
|
|
132
|
-
classes: _,
|
|
133
|
-
children: /* @__PURE__ */ I(po, i({
|
|
134
|
-
onKeyDown: K,
|
|
135
|
-
actions: T,
|
|
136
|
-
autoFocus: c && (a === -1 || u),
|
|
137
|
-
autoFocusItem: A,
|
|
138
|
-
variant: P
|
|
139
|
-
}, m, {
|
|
140
|
-
className: H(v.list, m.className),
|
|
141
|
-
children: g
|
|
142
|
-
}))
|
|
143
|
-
}));
|
|
144
|
-
});
|
|
145
|
-
process.env.NODE_ENV !== "production" && (io.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
|
-
* An HTML element, or a function that returns one.
|
|
152
|
-
* It's used to set the position of the menu.
|
|
153
|
-
*/
|
|
154
|
-
anchorEl: o.oneOfType([Z, o.func]),
|
|
155
|
-
/**
|
|
156
|
-
* If `true` (Default) will focus the `[role="menu"]` if no focusable child is found. Disabled
|
|
157
|
-
* children are not focusable. If you set this prop to `false` focus will be placed
|
|
158
|
-
* on the parent modal container. This has severe accessibility implications
|
|
159
|
-
* and should only be considered if you manage focus otherwise.
|
|
160
|
-
* @default true
|
|
161
|
-
*/
|
|
162
|
-
autoFocus: o.bool,
|
|
163
|
-
/**
|
|
164
|
-
* Menu contents, normally `MenuItem`s.
|
|
165
|
-
*/
|
|
166
|
-
children: o.node,
|
|
167
|
-
/**
|
|
168
|
-
* Override or extend the styles applied to the component.
|
|
169
|
-
*/
|
|
170
|
-
classes: o.object,
|
|
171
|
-
/**
|
|
172
|
-
* @ignore
|
|
173
|
-
*/
|
|
174
|
-
className: o.string,
|
|
175
|
-
/**
|
|
176
|
-
* When opening the menu will not focus the active item but the `[role="menu"]`
|
|
177
|
-
* unless `autoFocus` is also set to `false`. Not using the default means not
|
|
178
|
-
* following WAI-ARIA authoring practices. Please be considerate about possible
|
|
179
|
-
* accessibility implications.
|
|
180
|
-
* @default false
|
|
181
|
-
*/
|
|
182
|
-
disableAutoFocusItem: o.bool,
|
|
183
|
-
/**
|
|
184
|
-
* Props applied to the [`MenuList`](/material-ui/api/menu-list/) element.
|
|
185
|
-
* @default {}
|
|
186
|
-
*/
|
|
187
|
-
MenuListProps: o.object,
|
|
188
|
-
/**
|
|
189
|
-
* Callback fired when the component requests to be closed.
|
|
190
|
-
*
|
|
191
|
-
* @param {object} event The event source of the callback.
|
|
192
|
-
* @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`, `"tabKeyDown"`.
|
|
193
|
-
*/
|
|
194
|
-
onClose: o.func,
|
|
195
|
-
/**
|
|
196
|
-
* If `true`, the component is shown.
|
|
197
|
-
*/
|
|
198
|
-
open: o.bool.isRequired,
|
|
199
|
-
/**
|
|
200
|
-
* @ignore
|
|
201
|
-
*/
|
|
202
|
-
PaperProps: o.object,
|
|
203
|
-
/**
|
|
204
|
-
* `classes` prop applied to the [`Popover`](/material-ui/api/popover/) element.
|
|
205
|
-
*/
|
|
206
|
-
PopoverClasses: o.object,
|
|
207
|
-
/**
|
|
208
|
-
* The extra props for the slot components.
|
|
209
|
-
* You can override the existing props or add new ones.
|
|
210
|
-
*
|
|
211
|
-
* @default {}
|
|
212
|
-
*/
|
|
213
|
-
slotProps: o.shape({
|
|
214
|
-
paper: o.oneOfType([o.func, o.object]),
|
|
215
|
-
root: o.oneOfType([o.func, o.object])
|
|
216
|
-
}),
|
|
217
|
-
/**
|
|
218
|
-
* The components used for each slot inside.
|
|
219
|
-
*
|
|
220
|
-
* @default {}
|
|
221
|
-
*/
|
|
222
|
-
slots: o.shape({
|
|
223
|
-
paper: o.elementType,
|
|
224
|
-
root: o.elementType
|
|
225
|
-
}),
|
|
226
|
-
/**
|
|
227
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
228
|
-
*/
|
|
229
|
-
sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
|
|
230
|
-
/**
|
|
231
|
-
* The length of the transition in `ms`, or 'auto'
|
|
232
|
-
* @default 'auto'
|
|
233
|
-
*/
|
|
234
|
-
transitionDuration: o.oneOfType([o.oneOf(["auto"]), o.number, o.shape({
|
|
235
|
-
appear: o.number,
|
|
236
|
-
enter: o.number,
|
|
237
|
-
exit: o.number
|
|
238
|
-
})]),
|
|
239
|
-
/**
|
|
240
|
-
* Props applied to the transition element.
|
|
241
|
-
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
|
242
|
-
* @default {}
|
|
243
|
-
*/
|
|
244
|
-
TransitionProps: o.object,
|
|
245
|
-
/**
|
|
246
|
-
* The variant to use. Use `menu` to prevent selected items from impacting the initial focus.
|
|
247
|
-
* @default 'selectedMenu'
|
|
248
|
-
*/
|
|
249
|
-
variant: o.oneOf(["menu", "selectedMenu"])
|
|
250
|
-
});
|
|
41
|
+
};
|
|
251
42
|
export {
|
|
252
|
-
|
|
253
|
-
io as default
|
|
43
|
+
b as Menu
|
|
254
44
|
};
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import i from "./index-extends.js";
|
|
2
|
+
import E from "./index-objectWithoutPropertiesLoose.js";
|
|
3
|
+
import * as l from "react";
|
|
4
|
+
import { isFragment as G } from "react-is";
|
|
5
|
+
import o from "./index-_virtual17.js";
|
|
6
|
+
import { clsx as H } from "./index-clsx.js";
|
|
7
|
+
import { useRtl as W } from "./index-RtlProvider.js";
|
|
8
|
+
import h from "./index-styled.js";
|
|
9
|
+
import { getMenuUtilityClass as $ } from "./index-menuClasses.js";
|
|
10
|
+
import { jsx as I } from "react/jsx-runtime";
|
|
11
|
+
import { useDefaultProps as q } from "./index-DefaultPropsProvider.js";
|
|
12
|
+
import L from "./index-useSlotProps.js";
|
|
13
|
+
import B from "./index-composeClasses.js";
|
|
14
|
+
import J, { PopoverPaper as Q } from "./index-Popover2.js";
|
|
15
|
+
import X from "./index-rootShouldForwardProp.js";
|
|
16
|
+
import Y from "./index-MenuList.js";
|
|
17
|
+
import Z from "./index-HTMLElementType.js";
|
|
18
|
+
const oo = ["onEntering"], eo = ["autoFocus", "children", "className", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "PaperProps", "PopoverClasses", "transitionDuration", "TransitionProps", "variant", "slots", "slotProps"], to = {
|
|
19
|
+
vertical: "top",
|
|
20
|
+
horizontal: "right"
|
|
21
|
+
}, ro = {
|
|
22
|
+
vertical: "top",
|
|
23
|
+
horizontal: "left"
|
|
24
|
+
}, so = (r) => {
|
|
25
|
+
const {
|
|
26
|
+
classes: t
|
|
27
|
+
} = r;
|
|
28
|
+
return B({
|
|
29
|
+
root: ["root"],
|
|
30
|
+
paper: ["paper"],
|
|
31
|
+
list: ["list"]
|
|
32
|
+
}, $, t);
|
|
33
|
+
}, no = h(J, {
|
|
34
|
+
shouldForwardProp: (r) => X(r) || r === "classes",
|
|
35
|
+
name: "MuiMenu",
|
|
36
|
+
slot: "Root",
|
|
37
|
+
overridesResolver: (r, t) => t.root
|
|
38
|
+
})({}), ao = h(Q, {
|
|
39
|
+
name: "MuiMenu",
|
|
40
|
+
slot: "Paper",
|
|
41
|
+
overridesResolver: (r, t) => t.paper
|
|
42
|
+
})({
|
|
43
|
+
// specZ: The maximum height of a simple menu should be one or more rows less than the view
|
|
44
|
+
// height. This ensures a tappable area outside of the simple menu with which to dismiss
|
|
45
|
+
// the menu.
|
|
46
|
+
maxHeight: "calc(100% - 96px)",
|
|
47
|
+
// Add iOS momentum scrolling for iOS < 13.0
|
|
48
|
+
WebkitOverflowScrolling: "touch"
|
|
49
|
+
}), po = h(Y, {
|
|
50
|
+
name: "MuiMenu",
|
|
51
|
+
slot: "List",
|
|
52
|
+
overridesResolver: (r, t) => t.list
|
|
53
|
+
})({
|
|
54
|
+
// We disable the focus ring for mouse, touch and keyboard users.
|
|
55
|
+
outline: 0
|
|
56
|
+
}), io = /* @__PURE__ */ l.forwardRef(function(t, y) {
|
|
57
|
+
var O, R;
|
|
58
|
+
const s = q({
|
|
59
|
+
props: t,
|
|
60
|
+
name: "MuiMenu"
|
|
61
|
+
}), {
|
|
62
|
+
autoFocus: c = !0,
|
|
63
|
+
children: g,
|
|
64
|
+
className: D,
|
|
65
|
+
disableAutoFocusItem: u = !1,
|
|
66
|
+
MenuListProps: m = {},
|
|
67
|
+
onClose: f,
|
|
68
|
+
open: F,
|
|
69
|
+
PaperProps: j = {},
|
|
70
|
+
PopoverClasses: _,
|
|
71
|
+
transitionDuration: x = "auto",
|
|
72
|
+
TransitionProps: {
|
|
73
|
+
onEntering: d
|
|
74
|
+
} = {},
|
|
75
|
+
variant: P = "selectedMenu",
|
|
76
|
+
slots: b = {},
|
|
77
|
+
slotProps: N = {}
|
|
78
|
+
} = s, S = E(s.TransitionProps, oo), w = E(s, eo), M = W(), n = i({}, s, {
|
|
79
|
+
autoFocus: c,
|
|
80
|
+
disableAutoFocusItem: u,
|
|
81
|
+
MenuListProps: m,
|
|
82
|
+
onEntering: d,
|
|
83
|
+
PaperProps: j,
|
|
84
|
+
transitionDuration: x,
|
|
85
|
+
TransitionProps: S,
|
|
86
|
+
variant: P
|
|
87
|
+
}), v = so(n), A = c && !u && F, T = l.useRef(null), z = (e, p) => {
|
|
88
|
+
T.current && T.current.adjustStyleForScrollbar(e, {
|
|
89
|
+
direction: M ? "rtl" : "ltr"
|
|
90
|
+
}), d && d(e, p);
|
|
91
|
+
}, K = (e) => {
|
|
92
|
+
e.key === "Tab" && (e.preventDefault(), f && f(e, "tabKeyDown"));
|
|
93
|
+
};
|
|
94
|
+
let a = -1;
|
|
95
|
+
l.Children.map(g, (e, p) => {
|
|
96
|
+
/* @__PURE__ */ l.isValidElement(e) && (process.env.NODE_ENV !== "production" && G(e), e.props.disabled || (P === "selectedMenu" && e.props.selected || a === -1) && (a = p));
|
|
97
|
+
});
|
|
98
|
+
const C = (O = b.paper) != null ? O : ao, U = (R = N.paper) != null ? R : j, V = L({
|
|
99
|
+
elementType: b.root,
|
|
100
|
+
externalSlotProps: N.root,
|
|
101
|
+
ownerState: n,
|
|
102
|
+
className: [v.root, D]
|
|
103
|
+
}), k = L({
|
|
104
|
+
elementType: C,
|
|
105
|
+
externalSlotProps: U,
|
|
106
|
+
ownerState: n,
|
|
107
|
+
className: v.paper
|
|
108
|
+
});
|
|
109
|
+
return /* @__PURE__ */ I(no, i({
|
|
110
|
+
onClose: f,
|
|
111
|
+
anchorOrigin: {
|
|
112
|
+
vertical: "bottom",
|
|
113
|
+
horizontal: M ? "right" : "left"
|
|
114
|
+
},
|
|
115
|
+
transformOrigin: M ? to : ro,
|
|
116
|
+
slots: {
|
|
117
|
+
paper: C,
|
|
118
|
+
root: b.root
|
|
119
|
+
},
|
|
120
|
+
slotProps: {
|
|
121
|
+
root: V,
|
|
122
|
+
paper: k
|
|
123
|
+
},
|
|
124
|
+
open: F,
|
|
125
|
+
ref: y,
|
|
126
|
+
transitionDuration: x,
|
|
127
|
+
TransitionProps: i({
|
|
128
|
+
onEntering: z
|
|
129
|
+
}, S),
|
|
130
|
+
ownerState: n
|
|
131
|
+
}, w, {
|
|
132
|
+
classes: _,
|
|
133
|
+
children: /* @__PURE__ */ I(po, i({
|
|
134
|
+
onKeyDown: K,
|
|
135
|
+
actions: T,
|
|
136
|
+
autoFocus: c && (a === -1 || u),
|
|
137
|
+
autoFocusItem: A,
|
|
138
|
+
variant: P
|
|
139
|
+
}, m, {
|
|
140
|
+
className: H(v.list, m.className),
|
|
141
|
+
children: g
|
|
142
|
+
}))
|
|
143
|
+
}));
|
|
144
|
+
});
|
|
145
|
+
process.env.NODE_ENV !== "production" && (io.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
|
+
* An HTML element, or a function that returns one.
|
|
152
|
+
* It's used to set the position of the menu.
|
|
153
|
+
*/
|
|
154
|
+
anchorEl: o.oneOfType([Z, o.func]),
|
|
155
|
+
/**
|
|
156
|
+
* If `true` (Default) will focus the `[role="menu"]` if no focusable child is found. Disabled
|
|
157
|
+
* children are not focusable. If you set this prop to `false` focus will be placed
|
|
158
|
+
* on the parent modal container. This has severe accessibility implications
|
|
159
|
+
* and should only be considered if you manage focus otherwise.
|
|
160
|
+
* @default true
|
|
161
|
+
*/
|
|
162
|
+
autoFocus: o.bool,
|
|
163
|
+
/**
|
|
164
|
+
* Menu contents, normally `MenuItem`s.
|
|
165
|
+
*/
|
|
166
|
+
children: o.node,
|
|
167
|
+
/**
|
|
168
|
+
* Override or extend the styles applied to the component.
|
|
169
|
+
*/
|
|
170
|
+
classes: o.object,
|
|
171
|
+
/**
|
|
172
|
+
* @ignore
|
|
173
|
+
*/
|
|
174
|
+
className: o.string,
|
|
175
|
+
/**
|
|
176
|
+
* When opening the menu will not focus the active item but the `[role="menu"]`
|
|
177
|
+
* unless `autoFocus` is also set to `false`. Not using the default means not
|
|
178
|
+
* following WAI-ARIA authoring practices. Please be considerate about possible
|
|
179
|
+
* accessibility implications.
|
|
180
|
+
* @default false
|
|
181
|
+
*/
|
|
182
|
+
disableAutoFocusItem: o.bool,
|
|
183
|
+
/**
|
|
184
|
+
* Props applied to the [`MenuList`](/material-ui/api/menu-list/) element.
|
|
185
|
+
* @default {}
|
|
186
|
+
*/
|
|
187
|
+
MenuListProps: o.object,
|
|
188
|
+
/**
|
|
189
|
+
* Callback fired when the component requests to be closed.
|
|
190
|
+
*
|
|
191
|
+
* @param {object} event The event source of the callback.
|
|
192
|
+
* @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`, `"tabKeyDown"`.
|
|
193
|
+
*/
|
|
194
|
+
onClose: o.func,
|
|
195
|
+
/**
|
|
196
|
+
* If `true`, the component is shown.
|
|
197
|
+
*/
|
|
198
|
+
open: o.bool.isRequired,
|
|
199
|
+
/**
|
|
200
|
+
* @ignore
|
|
201
|
+
*/
|
|
202
|
+
PaperProps: o.object,
|
|
203
|
+
/**
|
|
204
|
+
* `classes` prop applied to the [`Popover`](/material-ui/api/popover/) element.
|
|
205
|
+
*/
|
|
206
|
+
PopoverClasses: o.object,
|
|
207
|
+
/**
|
|
208
|
+
* The extra props for the slot components.
|
|
209
|
+
* You can override the existing props or add new ones.
|
|
210
|
+
*
|
|
211
|
+
* @default {}
|
|
212
|
+
*/
|
|
213
|
+
slotProps: o.shape({
|
|
214
|
+
paper: o.oneOfType([o.func, o.object]),
|
|
215
|
+
root: o.oneOfType([o.func, o.object])
|
|
216
|
+
}),
|
|
217
|
+
/**
|
|
218
|
+
* The components used for each slot inside.
|
|
219
|
+
*
|
|
220
|
+
* @default {}
|
|
221
|
+
*/
|
|
222
|
+
slots: o.shape({
|
|
223
|
+
paper: o.elementType,
|
|
224
|
+
root: o.elementType
|
|
225
|
+
}),
|
|
226
|
+
/**
|
|
227
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
228
|
+
*/
|
|
229
|
+
sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
|
|
230
|
+
/**
|
|
231
|
+
* The length of the transition in `ms`, or 'auto'
|
|
232
|
+
* @default 'auto'
|
|
233
|
+
*/
|
|
234
|
+
transitionDuration: o.oneOfType([o.oneOf(["auto"]), o.number, o.shape({
|
|
235
|
+
appear: o.number,
|
|
236
|
+
enter: o.number,
|
|
237
|
+
exit: o.number
|
|
238
|
+
})]),
|
|
239
|
+
/**
|
|
240
|
+
* Props applied to the transition element.
|
|
241
|
+
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
|
242
|
+
* @default {}
|
|
243
|
+
*/
|
|
244
|
+
TransitionProps: o.object,
|
|
245
|
+
/**
|
|
246
|
+
* The variant to use. Use `menu` to prevent selected items from impacting the initial focus.
|
|
247
|
+
* @default 'selectedMenu'
|
|
248
|
+
*/
|
|
249
|
+
variant: o.oneOf(["menu", "selectedMenu"])
|
|
250
|
+
});
|
|
251
|
+
export {
|
|
252
|
+
ao as MenuPaper,
|
|
253
|
+
io as default
|
|
254
|
+
};
|