@mui/material 5.14.5 → 5.14.7
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/CHANGELOG.md +163 -3
- package/Drawer/Drawer.d.ts +2 -0
- package/Drawer/Drawer.js +2 -0
- package/InputBase/InputBase.js +1 -1
- package/Modal/Modal.d.ts +117 -12
- package/Modal/Modal.js +97 -36
- package/Modal/index.d.ts +3 -0
- package/Modal/index.js +2 -1
- package/Modal/modalClasses.d.ts +12 -0
- package/Modal/modalClasses.js +7 -0
- package/Popover/Popover.d.ts +2 -1
- package/Popover/Popover.js +20 -6
- package/README.md +2 -3
- package/Select/Select.js +5 -3
- package/Select/selectClasses.d.ts +2 -0
- package/Select/selectClasses.js +1 -1
- package/Skeleton/Skeleton.js +2 -2
- package/Snackbar/Snackbar.d.ts +4 -4
- package/Snackbar/Snackbar.js +4 -4
- package/TextField/TextField.d.ts +0 -4
- package/TextField/TextField.js +2 -17
- package/index.js +1 -1
- package/legacy/Drawer/Drawer.js +2 -0
- package/legacy/InputBase/InputBase.js +1 -1
- package/legacy/Modal/Modal.js +93 -43
- package/legacy/Modal/index.js +2 -1
- package/legacy/Modal/modalClasses.js +7 -0
- package/legacy/Popover/Popover.js +22 -5
- package/legacy/Select/Select.js +4 -2
- package/legacy/Select/selectClasses.js +1 -1
- package/legacy/Skeleton/Skeleton.js +2 -2
- package/legacy/Snackbar/Snackbar.js +4 -4
- package/legacy/TextField/TextField.js +2 -17
- package/legacy/index.js +1 -1
- package/modern/Drawer/Drawer.js +2 -0
- package/modern/InputBase/InputBase.js +1 -1
- package/modern/Modal/Modal.js +97 -36
- package/modern/Modal/index.js +2 -1
- package/modern/Modal/modalClasses.js +7 -0
- package/modern/Popover/Popover.js +20 -6
- package/modern/Select/Select.js +5 -3
- package/modern/Select/selectClasses.js +1 -1
- package/modern/Skeleton/Skeleton.js +2 -2
- package/modern/Snackbar/Snackbar.js +4 -4
- package/modern/TextField/TextField.js +2 -17
- package/modern/index.js +1 -1
- package/node/Drawer/Drawer.js +2 -0
- package/node/InputBase/InputBase.js +1 -1
- package/node/Modal/Modal.js +100 -41
- package/node/Modal/index.js +14 -5
- package/node/Modal/modalClasses.js +16 -0
- package/node/Popover/Popover.js +20 -6
- package/node/Select/Select.js +5 -3
- package/node/Select/selectClasses.js +1 -1
- package/node/Skeleton/Skeleton.js +2 -2
- package/node/Snackbar/Snackbar.js +4 -4
- package/node/TextField/TextField.js +2 -17
- package/node/index.js +1 -1
- package/package.json +6 -6
- package/umd/material-ui.development.js +456 -657
- package/umd/material-ui.production.min.js +23 -23
package/node/Modal/Modal.js
CHANGED
|
@@ -5,24 +5,38 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.default = void 0;
|
|
9
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
14
|
+
var _utils = require("@mui/utils");
|
|
15
|
+
var _base = require("@mui/base");
|
|
16
|
+
var _unstable_useModal = require("@mui/base/unstable_useModal");
|
|
17
|
+
var _composeClasses = require("@mui/base/composeClasses");
|
|
18
|
+
var _Unstable_TrapFocus = _interopRequireDefault(require("../Unstable_TrapFocus"));
|
|
19
|
+
var _Portal = _interopRequireDefault(require("../Portal"));
|
|
17
20
|
var _styled = _interopRequireDefault(require("../styles/styled"));
|
|
18
21
|
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
19
22
|
var _Backdrop = _interopRequireDefault(require("../Backdrop"));
|
|
23
|
+
var _modalClasses = require("./modalClasses");
|
|
20
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
25
|
const _excluded = ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "container", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "onBackdropClick", "onClose", "open", "slotProps", "slots", "theme"];
|
|
22
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
27
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
24
|
-
const
|
|
25
|
-
|
|
28
|
+
const useUtilityClasses = ownerState => {
|
|
29
|
+
const {
|
|
30
|
+
open,
|
|
31
|
+
exited,
|
|
32
|
+
classes
|
|
33
|
+
} = ownerState;
|
|
34
|
+
const slots = {
|
|
35
|
+
root: ['root', !open && exited && 'hidden'],
|
|
36
|
+
backdrop: ['backdrop']
|
|
37
|
+
};
|
|
38
|
+
return (0, _composeClasses.unstable_composeClasses)(slots, _modalClasses.getModalUtilityClass, classes);
|
|
39
|
+
};
|
|
26
40
|
const ModalRoot = (0, _styled.default)('div', {
|
|
27
41
|
name: 'MuiModal',
|
|
28
42
|
slot: 'Root',
|
|
@@ -77,7 +91,6 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
77
91
|
const {
|
|
78
92
|
BackdropComponent = ModalBackdrop,
|
|
79
93
|
BackdropProps,
|
|
80
|
-
classes,
|
|
81
94
|
className,
|
|
82
95
|
closeAfterTransition = false,
|
|
83
96
|
children,
|
|
@@ -94,17 +107,13 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
94
107
|
hideBackdrop = false,
|
|
95
108
|
keepMounted = false,
|
|
96
109
|
onBackdropClick,
|
|
97
|
-
onClose,
|
|
98
110
|
open,
|
|
99
111
|
slotProps,
|
|
100
|
-
slots
|
|
112
|
+
slots
|
|
101
113
|
// eslint-disable-next-line react/prop-types
|
|
102
|
-
theme
|
|
103
114
|
} = props,
|
|
104
115
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
105
|
-
const
|
|
106
|
-
const commonProps = {
|
|
107
|
-
container,
|
|
116
|
+
const propsWithDefaults = (0, _extends2.default)({}, props, {
|
|
108
117
|
closeAfterTransition,
|
|
109
118
|
disableAutoFocus,
|
|
110
119
|
disableEnforceFocus,
|
|
@@ -113,40 +122,90 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
113
122
|
disableRestoreFocus,
|
|
114
123
|
disableScrollLock,
|
|
115
124
|
hideBackdrop,
|
|
116
|
-
keepMounted
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
125
|
+
keepMounted
|
|
126
|
+
});
|
|
127
|
+
const {
|
|
128
|
+
getRootProps,
|
|
129
|
+
getBackdropProps,
|
|
130
|
+
getTransitionProps,
|
|
131
|
+
portalRef,
|
|
132
|
+
isTopModal,
|
|
133
|
+
exited,
|
|
134
|
+
hasTransition
|
|
135
|
+
} = (0, _unstable_useModal.unstable_useModal)((0, _extends2.default)({}, propsWithDefaults, {
|
|
136
|
+
rootRef: ref
|
|
137
|
+
}));
|
|
138
|
+
const ownerState = (0, _extends2.default)({}, propsWithDefaults, {
|
|
122
139
|
exited
|
|
123
140
|
});
|
|
141
|
+
const classes = useUtilityClasses(ownerState);
|
|
142
|
+
const childProps = {};
|
|
143
|
+
if (children.props.tabIndex === undefined) {
|
|
144
|
+
childProps.tabIndex = '-1';
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// It's a Transition like component
|
|
148
|
+
if (hasTransition) {
|
|
149
|
+
const {
|
|
150
|
+
onEnter,
|
|
151
|
+
onExited
|
|
152
|
+
} = getTransitionProps();
|
|
153
|
+
childProps.onEnter = onEnter;
|
|
154
|
+
childProps.onExited = onExited;
|
|
155
|
+
}
|
|
124
156
|
const RootSlot = (_ref = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components.Root) != null ? _ref : ModalRoot;
|
|
125
157
|
const BackdropSlot = (_ref2 = (_slots$backdrop = slots == null ? void 0 : slots.backdrop) != null ? _slots$backdrop : components.Backdrop) != null ? _ref2 : BackdropComponent;
|
|
126
158
|
const rootSlotProps = (_slotProps$root = slotProps == null ? void 0 : slotProps.root) != null ? _slotProps$root : componentsProps.root;
|
|
127
159
|
const backdropSlotProps = (_slotProps$backdrop = slotProps == null ? void 0 : slotProps.backdrop) != null ? _slotProps$backdrop : componentsProps.backdrop;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
160
|
+
const rootProps = (0, _base.useSlotProps)({
|
|
161
|
+
elementType: RootSlot,
|
|
162
|
+
externalSlotProps: rootSlotProps,
|
|
163
|
+
externalForwardedProps: other,
|
|
164
|
+
getSlotProps: getRootProps,
|
|
165
|
+
additionalProps: {
|
|
166
|
+
ref,
|
|
167
|
+
as: component
|
|
132
168
|
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
169
|
+
ownerState,
|
|
170
|
+
className: (0, _clsx.default)(className, rootSlotProps == null ? void 0 : rootSlotProps.className, classes == null ? void 0 : classes.root, !ownerState.open && ownerState.exited && (classes == null ? void 0 : classes.hidden))
|
|
171
|
+
});
|
|
172
|
+
const backdropProps = (0, _base.useSlotProps)({
|
|
173
|
+
elementType: BackdropSlot,
|
|
174
|
+
externalSlotProps: backdropSlotProps,
|
|
175
|
+
additionalProps: BackdropProps,
|
|
176
|
+
getSlotProps: otherHandlers => {
|
|
177
|
+
return getBackdropProps((0, _extends2.default)({}, otherHandlers, {
|
|
178
|
+
onClick: e => {
|
|
179
|
+
if (onBackdropClick) {
|
|
180
|
+
onBackdropClick(e);
|
|
181
|
+
}
|
|
182
|
+
if (otherHandlers != null && otherHandlers.onClick) {
|
|
183
|
+
otherHandlers.onClick(e);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}));
|
|
143
187
|
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
188
|
+
className: (0, _clsx.default)(backdropSlotProps == null ? void 0 : backdropSlotProps.className, BackdropProps == null ? void 0 : BackdropProps.className, classes == null ? void 0 : classes.backdrop),
|
|
189
|
+
ownerState
|
|
190
|
+
});
|
|
191
|
+
if (!keepMounted && !open && (!hasTransition || exited)) {
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Portal.default, {
|
|
195
|
+
ref: portalRef,
|
|
196
|
+
container: container,
|
|
197
|
+
disablePortal: disablePortal,
|
|
198
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(RootSlot, (0, _extends2.default)({}, rootProps, {
|
|
199
|
+
children: [!hideBackdrop && BackdropComponent ? /*#__PURE__*/(0, _jsxRuntime.jsx)(BackdropSlot, (0, _extends2.default)({}, backdropProps)) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Unstable_TrapFocus.default, {
|
|
200
|
+
disableEnforceFocus: disableEnforceFocus,
|
|
201
|
+
disableAutoFocus: disableAutoFocus,
|
|
202
|
+
disableRestoreFocus: disableRestoreFocus,
|
|
203
|
+
isEnabled: isTopModal,
|
|
204
|
+
open: open,
|
|
205
|
+
children: /*#__PURE__*/React.cloneElement(children, childProps)
|
|
206
|
+
})]
|
|
207
|
+
}))
|
|
208
|
+
});
|
|
150
209
|
});
|
|
151
210
|
process.env.NODE_ENV !== "production" ? Modal.propTypes /* remove-proptypes */ = {
|
|
152
211
|
// ----------------------------- Warning --------------------------------
|
|
@@ -176,7 +235,7 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes /* remove-proptypes */ =
|
|
|
176
235
|
/**
|
|
177
236
|
* A single child content element.
|
|
178
237
|
*/
|
|
179
|
-
children:
|
|
238
|
+
children: _utils.elementAcceptingRef.isRequired,
|
|
180
239
|
/**
|
|
181
240
|
* Override or extend the styles applied to the component.
|
|
182
241
|
*/
|
|
@@ -227,7 +286,7 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes /* remove-proptypes */ =
|
|
|
227
286
|
* By default, it uses the body of the top-level document object,
|
|
228
287
|
* so it's simply `document.body` most of the time.
|
|
229
288
|
*/
|
|
230
|
-
container: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([
|
|
289
|
+
container: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_utils.HTMLElementType, _propTypes.default.func]),
|
|
231
290
|
/**
|
|
232
291
|
* If `true`, the modal will not automatically shift focus to itself when it opens, and
|
|
233
292
|
* replace it to the last focused element when it closes.
|
package/node/Modal/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
3
|
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
var _exportNames = {
|
|
8
|
-
ModalManager: true
|
|
9
|
+
ModalManager: true,
|
|
10
|
+
modalClasses: true
|
|
9
11
|
};
|
|
10
12
|
Object.defineProperty(exports, "ModalManager", {
|
|
11
13
|
enumerable: true,
|
|
@@ -19,16 +21,23 @@ Object.defineProperty(exports, "default", {
|
|
|
19
21
|
return _Modal.default;
|
|
20
22
|
}
|
|
21
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "modalClasses", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _modalClasses.default;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
22
30
|
var _unstable_useModal = require("@mui/base/unstable_useModal");
|
|
23
|
-
var _Modal =
|
|
24
|
-
|
|
31
|
+
var _Modal = _interopRequireDefault(require("./Modal"));
|
|
32
|
+
var _modalClasses = _interopRequireWildcard(require("./modalClasses"));
|
|
33
|
+
Object.keys(_modalClasses).forEach(function (key) {
|
|
25
34
|
if (key === "default" || key === "__esModule") return;
|
|
26
35
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
27
|
-
if (key in exports && exports[key] ===
|
|
36
|
+
if (key in exports && exports[key] === _modalClasses[key]) return;
|
|
28
37
|
Object.defineProperty(exports, key, {
|
|
29
38
|
enumerable: true,
|
|
30
39
|
get: function () {
|
|
31
|
-
return
|
|
40
|
+
return _modalClasses[key];
|
|
32
41
|
}
|
|
33
42
|
});
|
|
34
43
|
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
exports.getModalUtilityClass = getModalUtilityClass;
|
|
9
|
+
var _utils = require("@mui/utils");
|
|
10
|
+
var _generateUtilityClass = _interopRequireDefault(require("../generateUtilityClass"));
|
|
11
|
+
function getModalUtilityClass(slot) {
|
|
12
|
+
return (0, _generateUtilityClass.default)('MuiModal', slot);
|
|
13
|
+
}
|
|
14
|
+
const modalClasses = (0, _utils.unstable_generateUtilityClasses)('MuiModal', ['root', 'hidden', 'backdrop']);
|
|
15
|
+
var _default = modalClasses;
|
|
16
|
+
exports.default = _default;
|
package/node/Popover/Popover.js
CHANGED
|
@@ -27,7 +27,7 @@ var _Paper = _interopRequireDefault(require("../Paper"));
|
|
|
27
27
|
var _popoverClasses = require("./popoverClasses");
|
|
28
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
29
|
const _excluded = ["onEntering"],
|
|
30
|
-
_excluded2 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps"],
|
|
30
|
+
_excluded2 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps", "disableScrollLock"],
|
|
31
31
|
_excluded3 = ["slotProps"];
|
|
32
32
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
33
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -125,7 +125,8 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
125
125
|
transitionDuration: transitionDurationProp = 'auto',
|
|
126
126
|
TransitionProps: {
|
|
127
127
|
onEntering
|
|
128
|
-
} = {}
|
|
128
|
+
} = {},
|
|
129
|
+
disableScrollLock = false
|
|
129
130
|
} = props,
|
|
130
131
|
TransitionProps = (0, _objectWithoutPropertiesLoose2.default)(props.TransitionProps, _excluded),
|
|
131
132
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded2);
|
|
@@ -213,11 +214,11 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
213
214
|
const widthThreshold = containerWindow.innerWidth - marginThreshold;
|
|
214
215
|
|
|
215
216
|
// Check if the vertical axis needs shifting
|
|
216
|
-
if (top < marginThreshold) {
|
|
217
|
+
if (marginThreshold !== null && top < marginThreshold) {
|
|
217
218
|
const diff = top - marginThreshold;
|
|
218
219
|
top -= diff;
|
|
219
220
|
elemTransformOrigin.vertical += diff;
|
|
220
|
-
} else if (bottom > heightThreshold) {
|
|
221
|
+
} else if (marginThreshold !== null && bottom > heightThreshold) {
|
|
221
222
|
const diff = bottom - heightThreshold;
|
|
222
223
|
top -= diff;
|
|
223
224
|
elemTransformOrigin.vertical += diff;
|
|
@@ -229,7 +230,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
229
230
|
}
|
|
230
231
|
|
|
231
232
|
// Check if the horizontal axis needs shifting
|
|
232
|
-
if (left < marginThreshold) {
|
|
233
|
+
if (marginThreshold !== null && left < marginThreshold) {
|
|
233
234
|
const diff = left - marginThreshold;
|
|
234
235
|
left -= diff;
|
|
235
236
|
elemTransformOrigin.horizontal += diff;
|
|
@@ -260,6 +261,12 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
260
261
|
element.style.transformOrigin = positioning.transformOrigin;
|
|
261
262
|
setIsPositioned(true);
|
|
262
263
|
}, [getPositioningStyle]);
|
|
264
|
+
React.useEffect(() => {
|
|
265
|
+
if (disableScrollLock) {
|
|
266
|
+
window.addEventListener('scroll', setPositioningStyles);
|
|
267
|
+
}
|
|
268
|
+
return () => window.removeEventListener('scroll', setPositioningStyles);
|
|
269
|
+
}, [anchorEl, disableScrollLock, setPositioningStyles]);
|
|
263
270
|
const handleEntering = (element, isAppearing) => {
|
|
264
271
|
if (onEntering) {
|
|
265
272
|
onEntering(element, isAppearing);
|
|
@@ -340,7 +347,8 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
340
347
|
} = _useSlotProps,
|
|
341
348
|
rootProps = (0, _objectWithoutPropertiesLoose2.default)(_useSlotProps, _excluded3);
|
|
342
349
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(RootSlot, (0, _extends2.default)({}, rootProps, !(0, _base.isHostComponent)(RootSlot) && {
|
|
343
|
-
slotProps: rootSlotPropsProp
|
|
350
|
+
slotProps: rootSlotPropsProp,
|
|
351
|
+
disableScrollLock
|
|
344
352
|
}, {
|
|
345
353
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TransitionComponent, (0, _extends2.default)({
|
|
346
354
|
appear: true,
|
|
@@ -435,6 +443,11 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
|
|
|
435
443
|
* so it's simply `document.body` most of the time.
|
|
436
444
|
*/
|
|
437
445
|
container: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_utils.HTMLElementType, _propTypes.default.func]),
|
|
446
|
+
/**
|
|
447
|
+
* Disable the scroll lock behavior.
|
|
448
|
+
* @default false
|
|
449
|
+
*/
|
|
450
|
+
disableScrollLock: _propTypes.default.bool,
|
|
438
451
|
/**
|
|
439
452
|
* The elevation of the popover.
|
|
440
453
|
* @default 8
|
|
@@ -442,6 +455,7 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
|
|
|
442
455
|
elevation: _utils.integerPropType,
|
|
443
456
|
/**
|
|
444
457
|
* Specifies how close to the edge of the window the popover can appear.
|
|
458
|
+
* If null, the popover will not be constrained by the window.
|
|
445
459
|
* @default 16
|
|
446
460
|
*/
|
|
447
461
|
marginThreshold: _propTypes.default.number,
|
package/node/Select/Select.js
CHANGED
|
@@ -24,7 +24,8 @@ var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
|
24
24
|
var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
|
|
25
25
|
var _styled = _interopRequireWildcard(require("../styles/styled"));
|
|
26
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
|
-
const _excluded = ["autoWidth", "children", "classes", "className", "defaultOpen", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"]
|
|
27
|
+
const _excluded = ["autoWidth", "children", "classes", "className", "defaultOpen", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"],
|
|
28
|
+
_excluded2 = ["root"];
|
|
28
29
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
30
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
30
31
|
const useUtilityClasses = ownerState => {
|
|
@@ -84,6 +85,7 @@ const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
84
85
|
classes: classesProp
|
|
85
86
|
});
|
|
86
87
|
const classes = useUtilityClasses(ownerState);
|
|
88
|
+
const restOfClasses = (0, _objectWithoutPropertiesLoose2.default)(classes, _excluded2);
|
|
87
89
|
const InputComponent = input || {
|
|
88
90
|
standard: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledInput, {
|
|
89
91
|
ownerState: ownerState
|
|
@@ -126,13 +128,13 @@ const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
126
128
|
id
|
|
127
129
|
}, SelectDisplayProps)
|
|
128
130
|
}, inputProps, {
|
|
129
|
-
classes: inputProps ? (0, _utils.deepmerge)(
|
|
131
|
+
classes: inputProps ? (0, _utils.deepmerge)(restOfClasses, inputProps.classes) : restOfClasses
|
|
130
132
|
}, input ? input.props.inputProps : {})
|
|
131
133
|
}, multiple && native && variant === 'outlined' ? {
|
|
132
134
|
notched: true
|
|
133
135
|
} : {}, {
|
|
134
136
|
ref: inputComponentRef,
|
|
135
|
-
className: (0, _clsx.default)(InputComponent.props.className, className)
|
|
137
|
+
className: (0, _clsx.default)(InputComponent.props.className, className, classes.root)
|
|
136
138
|
}, !input && {
|
|
137
139
|
variant
|
|
138
140
|
}, other))
|
|
@@ -11,6 +11,6 @@ var _generateUtilityClass = _interopRequireDefault(require("../generateUtilityCl
|
|
|
11
11
|
function getSelectUtilityClasses(slot) {
|
|
12
12
|
return (0, _generateUtilityClass.default)('MuiSelect', slot);
|
|
13
13
|
}
|
|
14
|
-
const selectClasses = (0, _utils.unstable_generateUtilityClasses)('MuiSelect', ['select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'focused', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput', 'error']);
|
|
14
|
+
const selectClasses = (0, _utils.unstable_generateUtilityClasses)('MuiSelect', ['root', 'select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'focused', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput', 'error']);
|
|
15
15
|
var _default = selectClasses;
|
|
16
16
|
exports.default = _default;
|
|
@@ -108,7 +108,7 @@ const SkeletonRoot = (0, _styled.default)('span', {
|
|
|
108
108
|
}, ({
|
|
109
109
|
ownerState
|
|
110
110
|
}) => ownerState.animation === 'pulse' && (0, _system.css)`
|
|
111
|
-
animation: ${pulseKeyframe}
|
|
111
|
+
animation: ${pulseKeyframe} 2s ease-in-out 0.5s infinite;
|
|
112
112
|
`, ({
|
|
113
113
|
ownerState,
|
|
114
114
|
theme
|
|
@@ -120,7 +120,7 @@ const SkeletonRoot = (0, _styled.default)('span', {
|
|
|
120
120
|
-webkit-mask-image: -webkit-radial-gradient(white, black);
|
|
121
121
|
|
|
122
122
|
&::after {
|
|
123
|
-
animation: ${waveKeyframe}
|
|
123
|
+
animation: ${waveKeyframe} 2s linear 0.5s infinite;
|
|
124
124
|
background: linear-gradient(
|
|
125
125
|
90deg,
|
|
126
126
|
transparent,
|
|
@@ -235,10 +235,10 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes /* remove-proptypes *
|
|
|
235
235
|
*/
|
|
236
236
|
disableWindowBlurListener: _propTypes.default.bool,
|
|
237
237
|
/**
|
|
238
|
-
* When displaying multiple consecutive
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
* features
|
|
238
|
+
* When displaying multiple consecutive snackbars using a single parent-rendered
|
|
239
|
+
* `<Snackbar/>`, add the `key` prop to ensure independent treatment of each message.
|
|
240
|
+
* For instance, use `<Snackbar key={message} />`. Otherwise, messages might update
|
|
241
|
+
* in place, and features like `autoHideDuration` could be affected.
|
|
242
242
|
*/
|
|
243
243
|
key: () => null,
|
|
244
244
|
/**
|
|
@@ -24,7 +24,7 @@ var _FormHelperText = _interopRequireDefault(require("../FormHelperText"));
|
|
|
24
24
|
var _Select = _interopRequireDefault(require("../Select"));
|
|
25
25
|
var _textFieldClasses = require("./textFieldClasses");
|
|
26
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
|
-
const _excluded = ["autoComplete", "autoFocus", "children", "className", "color", "defaultValue", "disabled", "error", "FormHelperTextProps", "fullWidth", "helperText", "id", "InputLabelProps", "inputProps", "InputProps", "inputRef", "label", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "
|
|
27
|
+
const _excluded = ["autoComplete", "autoFocus", "children", "className", "color", "defaultValue", "disabled", "error", "FormHelperTextProps", "fullWidth", "helperText", "id", "InputLabelProps", "inputProps", "InputProps", "inputRef", "label", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onFocus", "placeholder", "required", "rows", "select", "SelectProps", "type", "value", "variant"];
|
|
28
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
29
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
30
30
|
const variantComponent = {
|
|
@@ -108,7 +108,6 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
|
|
|
108
108
|
name,
|
|
109
109
|
onBlur,
|
|
110
110
|
onChange,
|
|
111
|
-
onClick,
|
|
112
111
|
onFocus,
|
|
113
112
|
placeholder,
|
|
114
113
|
required = false,
|
|
@@ -151,14 +150,6 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
|
|
|
151
150
|
}
|
|
152
151
|
InputMore['aria-describedby'] = undefined;
|
|
153
152
|
}
|
|
154
|
-
const handleClick = event => {
|
|
155
|
-
if (!disabled && onClick) {
|
|
156
|
-
// The `onClick` is registered both on the root and the input elements.
|
|
157
|
-
// Without stopping the propagation, the event could be triggered twice.
|
|
158
|
-
event.stopPropagation();
|
|
159
|
-
onClick(event);
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
153
|
const id = (0, _utils.unstable_useId)(idOverride);
|
|
163
154
|
const helperTextId = helperText && id ? `${id}-helper-text` : undefined;
|
|
164
155
|
const inputLabelId = label && id ? `${id}-label` : undefined;
|
|
@@ -181,7 +172,6 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
|
|
|
181
172
|
onBlur: onBlur,
|
|
182
173
|
onChange: onChange,
|
|
183
174
|
onFocus: onFocus,
|
|
184
|
-
onClick: handleClick,
|
|
185
175
|
placeholder: placeholder,
|
|
186
176
|
inputProps: inputProps
|
|
187
177
|
}, InputMore, InputProps));
|
|
@@ -194,8 +184,7 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
|
|
|
194
184
|
required: required,
|
|
195
185
|
color: color,
|
|
196
186
|
variant: variant,
|
|
197
|
-
ownerState: ownerState
|
|
198
|
-
onClick: handleClick
|
|
187
|
+
ownerState: ownerState
|
|
199
188
|
}, other, {
|
|
200
189
|
children: [label != null && label !== '' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputLabel.default, (0, _extends2.default)({
|
|
201
190
|
htmlFor: id,
|
|
@@ -341,10 +330,6 @@ process.env.NODE_ENV !== "production" ? TextField.propTypes /* remove-proptypes
|
|
|
341
330
|
* You can pull out the new value by accessing `event.target.value` (string).
|
|
342
331
|
*/
|
|
343
332
|
onChange: _propTypes.default.func,
|
|
344
|
-
/**
|
|
345
|
-
* @ignore
|
|
346
|
-
*/
|
|
347
|
-
onClick: _propTypes.default.func,
|
|
348
333
|
/**
|
|
349
334
|
* @ignore
|
|
350
335
|
*/
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/material",
|
|
3
|
-
"version": "5.14.
|
|
3
|
+
"version": "5.14.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "React components that implement Google's Material Design.",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@babel/runtime": "^7.22.
|
|
49
|
-
"@mui/base": "5.0.0-beta.
|
|
50
|
-
"@mui/core-downloads-tracker": "^5.14.
|
|
51
|
-
"@mui/system": "^5.14.
|
|
48
|
+
"@babel/runtime": "^7.22.10",
|
|
49
|
+
"@mui/base": "5.0.0-beta.13",
|
|
50
|
+
"@mui/core-downloads-tracker": "^5.14.7",
|
|
51
|
+
"@mui/system": "^5.14.7",
|
|
52
52
|
"@mui/types": "^7.2.4",
|
|
53
|
-
"@mui/utils": "^5.14.
|
|
53
|
+
"@mui/utils": "^5.14.7",
|
|
54
54
|
"@types/react-transition-group": "^4.4.6",
|
|
55
55
|
"clsx": "^2.0.0",
|
|
56
56
|
"csstype": "^3.1.2",
|