@mui/utils 5.15.20 → 6.0.0-alpha.11
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 +623 -111
- package/deepmerge/deepmerge.js +3 -2
- package/exactProp/exactProp.js +3 -3
- package/getDisplayName/getDisplayName.d.ts +0 -1
- package/getDisplayName/getDisplayName.js +1 -10
- package/getDisplayName/index.d.ts +0 -1
- package/getDisplayName/index.js +1 -2
- package/index.js +1 -1
- package/integerPropType/integerPropType.js +1 -8
- package/isMuiElement/isMuiElement.js +3 -3
- package/modern/deepmerge/deepmerge.js +3 -2
- package/modern/exactProp/exactProp.js +3 -3
- package/modern/getDisplayName/getDisplayName.js +1 -10
- package/modern/getDisplayName/index.js +1 -2
- package/modern/index.js +1 -1
- package/modern/integerPropType/integerPropType.js +1 -8
- package/modern/requirePropFactory/requirePropFactory.js +3 -2
- package/modern/resolveProps/resolveProps.js +10 -4
- package/modern/useControlled/useControlled.js +2 -0
- package/modern/useTimeout/useTimeout.js +11 -12
- package/node/debounce/index.js +1 -1
- package/node/deepmerge/deepmerge.js +3 -3
- package/node/deepmerge/index.js +1 -1
- package/node/exactProp/exactProp.js +3 -4
- package/node/generateUtilityClass/index.js +1 -1
- package/node/getDisplayName/getDisplayName.js +1 -10
- package/node/getDisplayName/index.js +2 -15
- package/node/getValidReactChildren/getValidReactChildren.js +1 -1
- package/node/index.js +2 -2
- package/node/integerPropType/index.js +1 -1
- package/node/integerPropType/integerPropType.js +1 -8
- package/node/isMuiElement/isMuiElement.js +1 -1
- package/node/requirePropFactory/requirePropFactory.js +3 -3
- package/node/resolveProps/resolveProps.js +10 -5
- package/node/useControlled/useControlled.js +3 -1
- package/node/useEnhancedEffect/useEnhancedEffect.js +1 -1
- package/node/useEventCallback/useEventCallback.js +1 -1
- package/node/useForkRef/useForkRef.js +1 -1
- package/node/useId/useId.js +1 -1
- package/node/useIsFocusVisible/index.js +1 -1
- package/node/useIsFocusVisible/useIsFocusVisible.js +1 -1
- package/node/useLazyRef/useLazyRef.js +1 -1
- package/node/useLocalStorageState/useLocalStorageState.js +1 -1
- package/node/useOnMount/useOnMount.js +1 -1
- package/node/usePreviousProps/usePreviousProps.js +1 -1
- package/node/useTimeout/index.js +1 -1
- package/node/useTimeout/useTimeout.js +11 -12
- package/package.json +3 -3
- package/requirePropFactory/requirePropFactory.js +4 -3
- package/resolveProps/resolveProps.js +10 -4
- package/useControlled/useControlled.js +2 -0
- package/useId/useId.js +1 -1
- package/useLocalStorageState/useLocalStorageState.js +1 -4
- package/useTimeout/useTimeout.js +11 -12
- package/legacy/ClassNameGenerator/ClassNameGenerator.js +0 -19
- package/legacy/ClassNameGenerator/index.js +0 -1
- package/legacy/HTMLElementType/HTMLElementType.js +0 -14
- package/legacy/HTMLElementType/index.js +0 -1
- package/legacy/capitalize/capitalize.js +0 -11
- package/legacy/capitalize/index.js +0 -1
- package/legacy/chainPropTypes/chainPropTypes.js +0 -10
- package/legacy/chainPropTypes/index.js +0 -1
- package/legacy/clamp/clamp.js +0 -6
- package/legacy/clamp/index.js +0 -1
- package/legacy/composeClasses/composeClasses.js +0 -22
- package/legacy/composeClasses/index.js +0 -1
- package/legacy/createChainedFunction/createChainedFunction.js +0 -23
- package/legacy/createChainedFunction/index.js +0 -1
- package/legacy/debounce/debounce.js +0 -22
- package/legacy/debounce/index.js +0 -2
- package/legacy/deepmerge/deepmerge.js +0 -41
- package/legacy/deepmerge/index.js +0 -2
- package/legacy/deprecatedPropType/deprecatedPropType.js +0 -15
- package/legacy/deprecatedPropType/index.js +0 -1
- package/legacy/elementAcceptingRef/elementAcceptingRef.js +0 -41
- package/legacy/elementAcceptingRef/index.js +0 -1
- package/legacy/elementTypeAcceptingRef/elementTypeAcceptingRef.js +0 -39
- package/legacy/elementTypeAcceptingRef/index.js +0 -1
- package/legacy/exactProp/exactProp.js +0 -23
- package/legacy/exactProp/index.js +0 -1
- package/legacy/formatMuiErrorMessage/formatMuiErrorMessage.js +0 -19
- package/legacy/formatMuiErrorMessage/index.js +0 -1
- package/legacy/generateUtilityClass/generateUtilityClass.js +0 -23
- package/legacy/generateUtilityClass/index.js +0 -2
- package/legacy/generateUtilityClasses/generateUtilityClasses.js +0 -9
- package/legacy/generateUtilityClasses/index.js +0 -1
- package/legacy/getDisplayName/getDisplayName.js +0 -49
- package/legacy/getDisplayName/index.js +0 -2
- package/legacy/getScrollbarSize/getScrollbarSize.js +0 -7
- package/legacy/getScrollbarSize/index.js +0 -1
- package/legacy/getValidReactChildren/getValidReactChildren.js +0 -13
- package/legacy/getValidReactChildren/index.js +0 -1
- package/legacy/index.js +0 -51
- package/legacy/integerPropType/index.js +0 -2
- package/legacy/integerPropType/integerPropType.js +0 -55
- package/legacy/isMuiElement/index.js +0 -1
- package/legacy/isMuiElement/isMuiElement.js +0 -8
- package/legacy/ownerDocument/index.js +0 -1
- package/legacy/ownerDocument/ownerDocument.js +0 -3
- package/legacy/ownerWindow/index.js +0 -1
- package/legacy/ownerWindow/ownerWindow.js +0 -5
- package/legacy/ponyfillGlobal/index.js +0 -1
- package/legacy/ponyfillGlobal/ponyfillGlobal.js +0 -3
- package/legacy/refType/index.js +0 -1
- package/legacy/refType/refType.js +0 -3
- package/legacy/requirePropFactory/index.js +0 -1
- package/legacy/requirePropFactory/requirePropFactory.js +0 -31
- package/legacy/resolveProps/index.js +0 -1
- package/legacy/resolveProps/resolveProps.js +0 -34
- package/legacy/scrollLeft/index.js +0 -1
- package/legacy/scrollLeft/scrollLeft.js +0 -70
- package/legacy/setRef/index.js +0 -1
- package/legacy/setRef/setRef.js +0 -20
- package/legacy/unsupportedProp/index.js +0 -1
- package/legacy/unsupportedProp/unsupportedProp.js +0 -10
- package/legacy/useControlled/index.js +0 -1
- package/legacy/useControlled/useControlled.js +0 -38
- package/legacy/useEnhancedEffect/index.js +0 -1
- package/legacy/useEnhancedEffect/useEnhancedEffect.js +0 -13
- package/legacy/useEventCallback/index.js +0 -1
- package/legacy/useEventCallback/useEventCallback.js +0 -23
- package/legacy/useForkRef/index.js +0 -1
- package/legacy/useForkRef/useForkRef.js +0 -27
- package/legacy/useId/index.js +0 -1
- package/legacy/useId/useId.js +0 -38
- package/legacy/useIsFocusVisible/index.js +0 -2
- package/legacy/useIsFocusVisible/useIsFocusVisible.js +0 -160
- package/legacy/useLazyRef/index.js +0 -1
- package/legacy/useLazyRef/useLazyRef.js +0 -19
- package/legacy/useLocalStorageState/index.js +0 -1
- package/legacy/useLocalStorageState/useLocalStorageState.js +0 -121
- package/legacy/useOnMount/index.js +0 -1
- package/legacy/useOnMount/useOnMount.js +0 -13
- package/legacy/usePreviousProps/index.js +0 -1
- package/legacy/usePreviousProps/usePreviousProps.js +0 -11
- package/legacy/useTimeout/index.js +0 -2
- package/legacy/useTimeout/useTimeout.js +0 -48
- package/legacy/visuallyHidden/index.js +0 -1
- package/legacy/visuallyHidden/visuallyHidden.js +0 -12
package/deepmerge/deepmerge.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
// https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
|
|
3
2
|
export function isPlainObject(item) {
|
|
4
3
|
if (typeof item !== 'object' || item === null) {
|
|
@@ -20,7 +19,9 @@ function deepClone(source) {
|
|
|
20
19
|
export default function deepmerge(target, source, options = {
|
|
21
20
|
clone: true
|
|
22
21
|
}) {
|
|
23
|
-
const output = options.clone ?
|
|
22
|
+
const output = options.clone ? {
|
|
23
|
+
...target
|
|
24
|
+
} : target;
|
|
24
25
|
if (isPlainObject(target) && isPlainObject(source)) {
|
|
25
26
|
Object.keys(source).forEach(key => {
|
|
26
27
|
if (isPlainObject(source[key]) &&
|
package/exactProp/exactProp.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
// This module is based on https://github.com/airbnb/prop-types-exact repository.
|
|
3
2
|
// However, in order to reduce the number of dependencies and to remove some extra safe checks
|
|
4
3
|
// the module was forked.
|
|
@@ -8,7 +7,8 @@ export default function exactProp(propTypes) {
|
|
|
8
7
|
if (process.env.NODE_ENV === 'production') {
|
|
9
8
|
return propTypes;
|
|
10
9
|
}
|
|
11
|
-
return
|
|
10
|
+
return {
|
|
11
|
+
...propTypes,
|
|
12
12
|
[specialProperty]: props => {
|
|
13
13
|
const unsupportedProps = Object.keys(props).filter(prop => !propTypes.hasOwnProperty(prop));
|
|
14
14
|
if (unsupportedProps.length > 0) {
|
|
@@ -16,5 +16,5 @@ export default function exactProp(propTypes) {
|
|
|
16
16
|
}
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
}
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import { ForwardRef, Memo } from 'react-is';
|
|
2
|
-
|
|
3
|
-
// Simplified polyfill for IE11 support
|
|
4
|
-
// https://github.com/JamesMGreene/Function.name/blob/58b314d4a983110c3682f1228f845d39ccca1817/Function.name.js#L3
|
|
5
|
-
const fnNameMatchRegex = /^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;
|
|
6
|
-
export function getFunctionName(fn) {
|
|
7
|
-
const match = `${fn}`.match(fnNameMatchRegex);
|
|
8
|
-
const name = match && match[1];
|
|
9
|
-
return name || '';
|
|
10
|
-
}
|
|
11
2
|
function getFunctionComponentName(Component, fallback = '') {
|
|
12
|
-
return Component.displayName || Component.name ||
|
|
3
|
+
return Component.displayName || Component.name || fallback;
|
|
13
4
|
}
|
|
14
5
|
function getWrappedName(outerType, innerType, wrapperName) {
|
|
15
6
|
const functionName = getFunctionComponentName(innerType);
|
package/getDisplayName/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { default } from './getDisplayName';
|
|
2
|
-
export * from './getDisplayName';
|
|
1
|
+
export { default } from './getDisplayName';
|
package/index.js
CHANGED
|
@@ -21,16 +21,9 @@ export function getTypeByValue(value) {
|
|
|
21
21
|
return valueType;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
// IE 11 support
|
|
26
|
-
function ponyfillIsInteger(x) {
|
|
27
|
-
// eslint-disable-next-line no-restricted-globals
|
|
28
|
-
return typeof x === 'number' && isFinite(x) && Math.floor(x) === x;
|
|
29
|
-
}
|
|
30
|
-
const isInteger = Number.isInteger || ponyfillIsInteger;
|
|
31
24
|
function requiredInteger(props, propName, componentName, location) {
|
|
32
25
|
const propValue = props[propName];
|
|
33
|
-
if (propValue == null || !isInteger(propValue)) {
|
|
26
|
+
if (propValue == null || !Number.isInteger(propValue)) {
|
|
34
27
|
const propType = getTypeByValue(propValue);
|
|
35
28
|
return new RangeError(`Invalid ${location} \`${propName}\` of type \`${propType}\` supplied to \`${componentName}\`, expected \`integer\`.`);
|
|
36
29
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export default function isMuiElement(element, muiNames) {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf(
|
|
4
|
+
// For server components `muiName` is avaialble in element.type._payload.value.muiName
|
|
5
5
|
// relevant info - https://github.com/facebook/react/blob/2807d781a08db8e9873687fccc25c0f12b4fb3d4/packages/react/src/ReactLazy.js#L45
|
|
6
6
|
// eslint-disable-next-line no-underscore-dangle
|
|
7
|
-
|
|
7
|
+
element.type.muiName ?? element.type?._payload?.value?.muiName) !== -1;
|
|
8
8
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
// https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
|
|
3
2
|
export function isPlainObject(item) {
|
|
4
3
|
if (typeof item !== 'object' || item === null) {
|
|
@@ -20,7 +19,9 @@ function deepClone(source) {
|
|
|
20
19
|
export default function deepmerge(target, source, options = {
|
|
21
20
|
clone: true
|
|
22
21
|
}) {
|
|
23
|
-
const output = options.clone ?
|
|
22
|
+
const output = options.clone ? {
|
|
23
|
+
...target
|
|
24
|
+
} : target;
|
|
24
25
|
if (isPlainObject(target) && isPlainObject(source)) {
|
|
25
26
|
Object.keys(source).forEach(key => {
|
|
26
27
|
if (isPlainObject(source[key]) &&
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
// This module is based on https://github.com/airbnb/prop-types-exact repository.
|
|
3
2
|
// However, in order to reduce the number of dependencies and to remove some extra safe checks
|
|
4
3
|
// the module was forked.
|
|
@@ -8,7 +7,8 @@ export default function exactProp(propTypes) {
|
|
|
8
7
|
if (process.env.NODE_ENV === 'production') {
|
|
9
8
|
return propTypes;
|
|
10
9
|
}
|
|
11
|
-
return
|
|
10
|
+
return {
|
|
11
|
+
...propTypes,
|
|
12
12
|
[specialProperty]: props => {
|
|
13
13
|
const unsupportedProps = Object.keys(props).filter(prop => !propTypes.hasOwnProperty(prop));
|
|
14
14
|
if (unsupportedProps.length > 0) {
|
|
@@ -16,5 +16,5 @@ export default function exactProp(propTypes) {
|
|
|
16
16
|
}
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
}
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import { ForwardRef, Memo } from 'react-is';
|
|
2
|
-
|
|
3
|
-
// Simplified polyfill for IE11 support
|
|
4
|
-
// https://github.com/JamesMGreene/Function.name/blob/58b314d4a983110c3682f1228f845d39ccca1817/Function.name.js#L3
|
|
5
|
-
const fnNameMatchRegex = /^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;
|
|
6
|
-
export function getFunctionName(fn) {
|
|
7
|
-
const match = `${fn}`.match(fnNameMatchRegex);
|
|
8
|
-
const name = match && match[1];
|
|
9
|
-
return name || '';
|
|
10
|
-
}
|
|
11
2
|
function getFunctionComponentName(Component, fallback = '') {
|
|
12
|
-
return Component.displayName || Component.name ||
|
|
3
|
+
return Component.displayName || Component.name || fallback;
|
|
13
4
|
}
|
|
14
5
|
function getWrappedName(outerType, innerType, wrapperName) {
|
|
15
6
|
const functionName = getFunctionComponentName(innerType);
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { default } from './getDisplayName';
|
|
2
|
-
export * from './getDisplayName';
|
|
1
|
+
export { default } from './getDisplayName';
|
package/modern/index.js
CHANGED
|
@@ -21,16 +21,9 @@ export function getTypeByValue(value) {
|
|
|
21
21
|
return valueType;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
// IE 11 support
|
|
26
|
-
function ponyfillIsInteger(x) {
|
|
27
|
-
// eslint-disable-next-line no-restricted-globals
|
|
28
|
-
return typeof x === 'number' && isFinite(x) && Math.floor(x) === x;
|
|
29
|
-
}
|
|
30
|
-
const isInteger = Number.isInteger || ponyfillIsInteger;
|
|
31
24
|
function requiredInteger(props, propName, componentName, location) {
|
|
32
25
|
const propValue = props[propName];
|
|
33
|
-
if (propValue == null || !isInteger(propValue)) {
|
|
26
|
+
if (propValue == null || !Number.isInteger(propValue)) {
|
|
34
27
|
const propType = getTypeByValue(propValue);
|
|
35
28
|
return new RangeError(`Invalid ${location} \`${propName}\` of type \`${propType}\` supplied to \`${componentName}\`, expected \`integer\`.`);
|
|
36
29
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
export default function requirePropFactory(componentNameInError, Component) {
|
|
3
2
|
if (process.env.NODE_ENV === 'production') {
|
|
4
3
|
return () => null;
|
|
5
4
|
}
|
|
6
5
|
|
|
7
6
|
// eslint-disable-next-line react/forbid-foreign-prop-types
|
|
8
|
-
const prevPropTypes = Component ?
|
|
7
|
+
const prevPropTypes = Component ? {
|
|
8
|
+
...Component.propTypes
|
|
9
|
+
} : null;
|
|
9
10
|
const requireProp = requiredProp => (props, propName, componentName, location, propFullName, ...args) => {
|
|
10
11
|
const propFullNameSafe = propFullName || propName;
|
|
11
12
|
const defaultTypeChecker = prevPropTypes?.[propFullNameSafe];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
/**
|
|
3
2
|
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
4
3
|
* @param {object} defaultProps
|
|
@@ -6,10 +5,15 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
6
5
|
* @returns {object} resolved props
|
|
7
6
|
*/
|
|
8
7
|
export default function resolveProps(defaultProps, props) {
|
|
9
|
-
const output =
|
|
8
|
+
const output = {
|
|
9
|
+
...props
|
|
10
|
+
};
|
|
10
11
|
Object.keys(defaultProps).forEach(propName => {
|
|
11
12
|
if (propName.toString().match(/^(components|slots)$/)) {
|
|
12
|
-
output[propName] =
|
|
13
|
+
output[propName] = {
|
|
14
|
+
...defaultProps[propName],
|
|
15
|
+
...output[propName]
|
|
16
|
+
};
|
|
13
17
|
} else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {
|
|
14
18
|
const defaultSlotProps = defaultProps[propName] || {};
|
|
15
19
|
const slotProps = props[propName];
|
|
@@ -21,7 +25,9 @@ export default function resolveProps(defaultProps, props) {
|
|
|
21
25
|
// Reduce the iteration if the default slot props is empty
|
|
22
26
|
output[propName] = slotProps;
|
|
23
27
|
} else {
|
|
24
|
-
output[propName] =
|
|
28
|
+
output[propName] = {
|
|
29
|
+
...slotProps
|
|
30
|
+
};
|
|
25
31
|
Object.keys(defaultSlotProps).forEach(slotPropName => {
|
|
26
32
|
output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
|
|
27
33
|
});
|
|
@@ -24,6 +24,8 @@ export default function useControlled({
|
|
|
24
24
|
current: defaultValue
|
|
25
25
|
} = React.useRef(defaultProp);
|
|
26
26
|
React.useEffect(() => {
|
|
27
|
+
// Object.is() is not equivalent to the === operator.
|
|
28
|
+
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is for more details.
|
|
27
29
|
if (!isControlled && !Object.is(defaultValue, defaultProp)) {
|
|
28
30
|
console.error([`MUI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\n'));
|
|
29
31
|
}
|
|
@@ -3,21 +3,11 @@
|
|
|
3
3
|
import useLazyRef from '../useLazyRef/useLazyRef';
|
|
4
4
|
import useOnMount from '../useOnMount/useOnMount';
|
|
5
5
|
export class Timeout {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.currentId = null;
|
|
8
|
-
this.clear = () => {
|
|
9
|
-
if (this.currentId !== null) {
|
|
10
|
-
clearTimeout(this.currentId);
|
|
11
|
-
this.currentId = null;
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
this.disposeEffect = () => {
|
|
15
|
-
return this.clear;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
6
|
static create() {
|
|
19
7
|
return new Timeout();
|
|
20
8
|
}
|
|
9
|
+
currentId = null;
|
|
10
|
+
|
|
21
11
|
/**
|
|
22
12
|
* Executes `fn` after `delay`, clearing any previously scheduled call.
|
|
23
13
|
*/
|
|
@@ -28,6 +18,15 @@ export class Timeout {
|
|
|
28
18
|
fn();
|
|
29
19
|
}, delay);
|
|
30
20
|
}
|
|
21
|
+
clear = () => {
|
|
22
|
+
if (this.currentId !== null) {
|
|
23
|
+
clearTimeout(this.currentId);
|
|
24
|
+
this.currentId = null;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
disposeEffect = () => {
|
|
28
|
+
return this.clear;
|
|
29
|
+
};
|
|
31
30
|
}
|
|
32
31
|
export default function useTimeout() {
|
|
33
32
|
const timeout = useLazyRef(Timeout.create).current;
|
package/node/debounce/index.js
CHANGED
|
@@ -23,4 +23,4 @@ Object.keys(_debounce).forEach(function (key) {
|
|
|
23
23
|
});
|
|
24
24
|
});
|
|
25
25
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
26
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
26
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = deepmerge;
|
|
8
7
|
exports.isPlainObject = isPlainObject;
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
8
|
// https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
|
|
11
9
|
function isPlainObject(item) {
|
|
12
10
|
if (typeof item !== 'object' || item === null) {
|
|
@@ -28,7 +26,9 @@ function deepClone(source) {
|
|
|
28
26
|
function deepmerge(target, source, options = {
|
|
29
27
|
clone: true
|
|
30
28
|
}) {
|
|
31
|
-
const output = options.clone ?
|
|
29
|
+
const output = options.clone ? {
|
|
30
|
+
...target
|
|
31
|
+
} : target;
|
|
32
32
|
if (isPlainObject(target) && isPlainObject(source)) {
|
|
33
33
|
Object.keys(source).forEach(key => {
|
|
34
34
|
if (isPlainObject(source[key]) &&
|
package/node/deepmerge/index.js
CHANGED
|
@@ -23,4 +23,4 @@ Object.keys(_deepmerge).forEach(function (key) {
|
|
|
23
23
|
});
|
|
24
24
|
});
|
|
25
25
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
26
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
26
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = exactProp;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
7
|
// This module is based on https://github.com/airbnb/prop-types-exact repository.
|
|
10
8
|
// However, in order to reduce the number of dependencies and to remove some extra safe checks
|
|
11
9
|
// the module was forked.
|
|
@@ -15,7 +13,8 @@ function exactProp(propTypes) {
|
|
|
15
13
|
if (process.env.NODE_ENV === 'production') {
|
|
16
14
|
return propTypes;
|
|
17
15
|
}
|
|
18
|
-
return
|
|
16
|
+
return {
|
|
17
|
+
...propTypes,
|
|
19
18
|
[specialProperty]: props => {
|
|
20
19
|
const unsupportedProps = Object.keys(props).filter(prop => !propTypes.hasOwnProperty(prop));
|
|
21
20
|
if (unsupportedProps.length > 0) {
|
|
@@ -23,5 +22,5 @@ function exactProp(propTypes) {
|
|
|
23
22
|
}
|
|
24
23
|
return null;
|
|
25
24
|
}
|
|
26
|
-
}
|
|
25
|
+
};
|
|
27
26
|
}
|
|
@@ -23,4 +23,4 @@ Object.keys(_generateUtilityClass).forEach(function (key) {
|
|
|
23
23
|
});
|
|
24
24
|
});
|
|
25
25
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
26
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
26
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -4,18 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = getDisplayName;
|
|
7
|
-
exports.getFunctionName = getFunctionName;
|
|
8
7
|
var _reactIs = require("react-is");
|
|
9
|
-
// Simplified polyfill for IE11 support
|
|
10
|
-
// https://github.com/JamesMGreene/Function.name/blob/58b314d4a983110c3682f1228f845d39ccca1817/Function.name.js#L3
|
|
11
|
-
const fnNameMatchRegex = /^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;
|
|
12
|
-
function getFunctionName(fn) {
|
|
13
|
-
const match = `${fn}`.match(fnNameMatchRegex);
|
|
14
|
-
const name = match && match[1];
|
|
15
|
-
return name || '';
|
|
16
|
-
}
|
|
17
8
|
function getFunctionComponentName(Component, fallback = '') {
|
|
18
|
-
return Component.displayName || Component.name ||
|
|
9
|
+
return Component.displayName || Component.name || fallback;
|
|
19
10
|
}
|
|
20
11
|
function getWrappedName(outerType, innerType, wrapperName) {
|
|
21
12
|
const functionName = getFunctionComponentName(innerType);
|
|
@@ -1,26 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
var _exportNames = {};
|
|
7
7
|
Object.defineProperty(exports, "default", {
|
|
8
8
|
enumerable: true,
|
|
9
9
|
get: function () {
|
|
10
10
|
return _getDisplayName.default;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
var _getDisplayName =
|
|
14
|
-
Object.keys(_getDisplayName).forEach(function (key) {
|
|
15
|
-
if (key === "default" || key === "__esModule") return;
|
|
16
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
17
|
-
if (key in exports && exports[key] === _getDisplayName[key]) return;
|
|
18
|
-
Object.defineProperty(exports, key, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _getDisplayName[key];
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
26
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
var _getDisplayName = _interopRequireDefault(require("./getDisplayName"));
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = getValidReactChildren;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
9
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
10
|
/**
|
|
11
11
|
* Gets only the valid children of a component,
|
|
12
12
|
* and ignores any nullish or falsy child.
|
package/node/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/utils
|
|
2
|
+
* @mui/utils v6.0.0-alpha.11
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -381,4 +381,4 @@ var _generateUtilityClasses = _interopRequireDefault(require("./generateUtilityC
|
|
|
381
381
|
var _ClassNameGenerator = _interopRequireDefault(require("./ClassNameGenerator"));
|
|
382
382
|
var _clamp = _interopRequireDefault(require("./clamp"));
|
|
383
383
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
384
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
384
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -23,4 +23,4 @@ Object.keys(_integerPropType).forEach(function (key) {
|
|
|
23
23
|
});
|
|
24
24
|
});
|
|
25
25
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
26
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
26
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -28,16 +28,9 @@ function getTypeByValue(value) {
|
|
|
28
28
|
return valueType;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
// IE 11 support
|
|
33
|
-
function ponyfillIsInteger(x) {
|
|
34
|
-
// eslint-disable-next-line no-restricted-globals
|
|
35
|
-
return typeof x === 'number' && isFinite(x) && Math.floor(x) === x;
|
|
36
|
-
}
|
|
37
|
-
const isInteger = Number.isInteger || ponyfillIsInteger;
|
|
38
31
|
function requiredInteger(props, propName, componentName, location) {
|
|
39
32
|
const propValue = props[propName];
|
|
40
|
-
if (propValue == null || !isInteger(propValue)) {
|
|
33
|
+
if (propValue == null || !Number.isInteger(propValue)) {
|
|
41
34
|
const propType = getTypeByValue(propValue);
|
|
42
35
|
return new RangeError(`Invalid ${location} \`${propName}\` of type \`${propType}\` supplied to \`${componentName}\`, expected \`integer\`.`);
|
|
43
36
|
}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = isMuiElement;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
9
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
10
|
function isMuiElement(element, muiNames) {
|
|
11
11
|
var _muiName, _element$type;
|
|
12
12
|
return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf( // For server components `muiName` is avaialble in element.type._payload.value.muiName
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = requirePropFactory;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
7
|
function requirePropFactory(componentNameInError, Component) {
|
|
10
8
|
if (process.env.NODE_ENV === 'production') {
|
|
11
9
|
return () => null;
|
|
12
10
|
}
|
|
13
11
|
|
|
14
12
|
// eslint-disable-next-line react/forbid-foreign-prop-types
|
|
15
|
-
const prevPropTypes = Component ?
|
|
13
|
+
const prevPropTypes = Component ? {
|
|
14
|
+
...Component.propTypes
|
|
15
|
+
} : null;
|
|
16
16
|
const requireProp = requiredProp => (props, propName, componentName, location, propFullName, ...args) => {
|
|
17
17
|
const propFullNameSafe = propFullName || propName;
|
|
18
18
|
const defaultTypeChecker = prevPropTypes == null ? void 0 : prevPropTypes[propFullNameSafe];
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = resolveProps;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
7
|
/**
|
|
10
8
|
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
11
9
|
* @param {object} defaultProps
|
|
@@ -13,10 +11,15 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
13
11
|
* @returns {object} resolved props
|
|
14
12
|
*/
|
|
15
13
|
function resolveProps(defaultProps, props) {
|
|
16
|
-
const output =
|
|
14
|
+
const output = {
|
|
15
|
+
...props
|
|
16
|
+
};
|
|
17
17
|
Object.keys(defaultProps).forEach(propName => {
|
|
18
18
|
if (propName.toString().match(/^(components|slots)$/)) {
|
|
19
|
-
output[propName] =
|
|
19
|
+
output[propName] = {
|
|
20
|
+
...defaultProps[propName],
|
|
21
|
+
...output[propName]
|
|
22
|
+
};
|
|
20
23
|
} else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {
|
|
21
24
|
const defaultSlotProps = defaultProps[propName] || {};
|
|
22
25
|
const slotProps = props[propName];
|
|
@@ -28,7 +31,9 @@ function resolveProps(defaultProps, props) {
|
|
|
28
31
|
// Reduce the iteration if the default slot props is empty
|
|
29
32
|
output[propName] = slotProps;
|
|
30
33
|
} else {
|
|
31
|
-
output[propName] =
|
|
34
|
+
output[propName] = {
|
|
35
|
+
...slotProps
|
|
36
|
+
};
|
|
32
37
|
Object.keys(defaultSlotProps).forEach(slotPropName => {
|
|
33
38
|
output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
|
|
34
39
|
});
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = useControlled;
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
10
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
12
|
function useControlled({
|
|
13
13
|
controlled,
|
|
14
14
|
default: defaultProp,
|
|
@@ -31,6 +31,8 @@ function useControlled({
|
|
|
31
31
|
current: defaultValue
|
|
32
32
|
} = React.useRef(defaultProp);
|
|
33
33
|
React.useEffect(() => {
|
|
34
|
+
// Object.is() is not equivalent to the === operator.
|
|
35
|
+
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is for more details.
|
|
34
36
|
if (!isControlled && !Object.is(defaultValue, defaultProp)) {
|
|
35
37
|
console.error([`MUI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\n'));
|
|
36
38
|
}
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
11
|
/**
|
|
12
12
|
* A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.
|
|
13
13
|
* This is useful for effects that are only needed for client-side rendering but not for SSR.
|
|
@@ -9,7 +9,7 @@ exports.default = void 0;
|
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _useEnhancedEffect = _interopRequireDefault(require("../useEnhancedEffect"));
|
|
11
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
13
|
/**
|
|
14
14
|
* Inspired by https://github.com/facebook/react/issues/14099#issuecomment-440013892
|
|
15
15
|
* See RFC in https://github.com/reactjs/rfcs/pull/220
|
|
@@ -9,7 +9,7 @@ exports.default = useForkRef;
|
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _setRef = _interopRequireDefault(require("../setRef"));
|
|
11
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
13
|
function useForkRef(...refs) {
|
|
14
14
|
/**
|
|
15
15
|
* This will create a new function if the refs passed to this hook change and are all defined.
|