@mui/utils 5.12.3 → 5.13.1
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 +124 -0
- package/ClassNameGenerator/ClassNameGenerator.d.ts +6 -6
- package/ClassNameGenerator/index.d.ts +1 -1
- package/HTMLElementType.d.ts +3 -3
- package/chainPropTypes.d.ts +2 -2
- package/composeClasses/composeClasses.d.ts +1 -1
- package/composeClasses/index.d.ts +1 -1
- package/createChainedFunction.d.ts +7 -7
- package/deepmerge.d.ts +5 -5
- package/deepmerge.js +3 -3
- package/elementAcceptingRef.d.ts +3 -3
- package/elementTypeAcceptingRef.d.ts +3 -3
- package/esm/deepmerge.js +3 -2
- package/esm/exactProp.js +3 -3
- package/esm/requirePropFactory.js +3 -2
- package/esm/resolveProps.js +10 -4
- package/esm/useId.js +2 -2
- package/exactProp.d.ts +2 -2
- package/exactProp.js +3 -4
- package/formatMuiErrorMessage.d.ts +6 -6
- package/generateUtilityClass/generateUtilityClass.d.ts +2 -2
- package/generateUtilityClass/index.d.ts +2 -2
- package/generateUtilityClasses/generateUtilityClasses.d.ts +1 -1
- package/generateUtilityClasses/index.d.ts +1 -1
- package/getDisplayName.d.ts +8 -8
- package/getScrollbarSize.d.ts +1 -1
- package/index.d.ts +38 -38
- package/index.js +1 -1
- package/integerPropType.d.ts +7 -7
- package/isMuiElement.d.ts +1 -1
- package/legacy/deepmerge.js +4 -2
- package/legacy/exactProp.js +3 -2
- package/legacy/index.js +1 -1
- package/legacy/requirePropFactory.js +4 -2
- package/legacy/resolveProps.js +6 -4
- package/legacy/useId.js +2 -2
- package/modern/deepmerge.js +3 -2
- package/modern/exactProp.js +3 -3
- package/modern/index.js +1 -1
- package/modern/requirePropFactory.js +3 -2
- package/modern/resolveProps.js +10 -4
- package/modern/useId.js +2 -2
- package/ownerDocument.d.ts +1 -1
- package/ownerWindow.d.ts +1 -1
- package/package.json +2 -2
- package/ponyfillGlobal.d.ts +2 -2
- package/refType.d.ts +3 -3
- package/requirePropFactory.js +3 -3
- package/resolveProps.d.ts +12 -12
- package/resolveProps.js +10 -5
- package/setRef.d.ts +15 -15
- package/useEventCallback.d.ts +4 -4
- package/useEventCallback.spec.d.ts +1 -1
- package/useForkRef.d.ts +2 -2
- package/useId.d.ts +7 -7
- package/useId.js +2 -2
- package/useIsFocusVisible.d.ts +9 -9
- package/usePreviousProps.d.ts +2 -2
- package/visuallyHidden.d.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,129 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 5.13.1
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v5.13.0..master -->
|
|
6
|
+
|
|
7
|
+
_May 16, 2023_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 25 contributors who made this release possible. Here are some highlights ✨:
|
|
10
|
+
|
|
11
|
+
- 🌏 Added Central Myanmar (my-MY), Malay (ms-MS), Nepali (ne-NP), Tagalog (tl-TL) locales (#37017) @cccEric
|
|
12
|
+
- 🐛 bug fixes and 📚 documentation improvements.
|
|
13
|
+
|
|
14
|
+
### `@mui/material@5.13.1`
|
|
15
|
+
|
|
16
|
+
- [Autocomplete] Allow tooltip text selection (#36503) @safeamiiir
|
|
17
|
+
- [Dialog] Fixed broken dialog when using maxWidth="xs" and custom breakpoint unit (#37237) @jguddas
|
|
18
|
+
- [l10n] Add Central Myanmar (my-MY), Malay (ms-MS), Nepali (ne-NP), Tagalog (tl-TL) locales (#37017) @cccEric
|
|
19
|
+
|
|
20
|
+
### `@mui/utils@5.13.1`
|
|
21
|
+
|
|
22
|
+
- [utils] Fix downstream bundlers remove React 17 useId compatibility (#37183) @nickiaconis
|
|
23
|
+
|
|
24
|
+
### `@mui/base@5.0.0-beta.1`
|
|
25
|
+
|
|
26
|
+
- [Select][base] Keep focus on the trigger element when listbox is open (#37244) @michaldudak
|
|
27
|
+
|
|
28
|
+
### `@mui/joy@5.0.0-alpha.80`
|
|
29
|
+
|
|
30
|
+
- [Autocomplete] Fixed scroll into view (#37217) @sai6855
|
|
31
|
+
- [AutocompleteOption][Avatar] js test replaced with ts test (#37088) @PunitSoniME
|
|
32
|
+
- [Breadcrumbs] Replace js-tests with ts-tests (#37107) @mauwaz
|
|
33
|
+
- [RadioGroup] Turn JS test to TS test (#37138) @uuxxx
|
|
34
|
+
- [SvgIcon] Turn JS test to TS test (#37151) @nicolas-ot
|
|
35
|
+
- [Tooltip] Turn JS test to TS test (#37149) @nicolas-ot
|
|
36
|
+
- [Typography] Convert Typography test to TypeScript (#37165) @DerTimonius
|
|
37
|
+
- [Sheet][Slider][Stack][Switch] Replace js-tests with ts-tests (#37139) @mauwaz
|
|
38
|
+
- Miscellaneous fixes (#37274) @siriwatknp
|
|
39
|
+
|
|
40
|
+
### Docs
|
|
41
|
+
|
|
42
|
+
- [docs] Remove upload button (#36844) @Bastian
|
|
43
|
+
- [docs] Update link to overriding component structure guide (#36870) @hbjORbj
|
|
44
|
+
- [docs] Fix Material Design templates (#37187) @oliviertassinari
|
|
45
|
+
- [docs] Fix link to Joy UI GitHub issues @oliviertassinari
|
|
46
|
+
- [docs] Show default value for `filterOptions` prop in Autocomplete's API docs (#37230) @ZeeshanTamboli
|
|
47
|
+
- [docs] Add summary and improve `test_static` CI doc in CONTRIBUTING readme file (#36711) @kriskw1999
|
|
48
|
+
- [docs] Update theme customization typescript (#35551) @siriwatknp
|
|
49
|
+
- [docs] Add Joy Frames X web blocks template (#37203) @siriwatknp
|
|
50
|
+
- [docs] Change Base UI `alpha` to `beta` in README (#37228) @ZeeshanTamboli
|
|
51
|
+
- [docs] Improve Base UI overview page (#37227) @mnajdova
|
|
52
|
+
- [docs] Update Joy + Material guide (#36911) @cherniavskii
|
|
53
|
+
|
|
54
|
+
### Core
|
|
55
|
+
|
|
56
|
+
- [core] Remove `toEqualDateTime` chai matcher (#37073) @flaviendelangle
|
|
57
|
+
- [core] Check dependency cycles inside packages directory only (#37223) @michaldudak
|
|
58
|
+
- [core] Remove outdated babel proposal plugins (#36795) @kkocdko
|
|
59
|
+
- [website] Add Diego to About Us page (#37284) @DiegoAndai
|
|
60
|
+
- [website] Add Victor teamMember card to 'About' (#37283) @zanivan
|
|
61
|
+
- [website] Add Rich to the 'About' page (#37221) @richbustos
|
|
62
|
+
|
|
63
|
+
All contributors of this release in alphabetical order: @Bastian, @binh1298, @cccEric, @cherniavskii, @DerTimonius, @DiegoAndai, @flaviendelangle, @hbjORbj, @jguddas, @kkocdko, @kriskw1999, @mauwaz, @michaldudak, @mnajdova, @nickiaconis, @nicolas-ot, @oliviertassinari, @PunitSoniME, @richbustos, @safeamiiir, @sai6855, @siriwatknp, @uuxxx, @zanivan, @ZeeshanTamboli
|
|
64
|
+
|
|
65
|
+
## 5.13.0
|
|
66
|
+
|
|
67
|
+
<!-- generated comparing v5.12.3..master -->
|
|
68
|
+
|
|
69
|
+
_May 10, 2023_
|
|
70
|
+
|
|
71
|
+
A big thanks to the 18 contributors who made this release possible. Here are some highlights ✨:
|
|
72
|
+
|
|
73
|
+
- 🚀 Base UI is now in beta - all planned breaking changes are now complete!
|
|
74
|
+
- 🗺 We have a new [project roadmap](https://github.com/orgs/mui/projects/18/views/1) on GitHub where you can learn about what's coming next.
|
|
75
|
+
- 🐛 Various bug fixes, 📚 documentation and 🧪 testing improvements
|
|
76
|
+
|
|
77
|
+
### `@mui/material@5.13.0`
|
|
78
|
+
|
|
79
|
+
- [Autocomplete] Support `ChipComponent` type (#37112) @sai6855
|
|
80
|
+
- [AppBar] Fix component type (#37172) @sai6855
|
|
81
|
+
- [Select] Simplify handleChange in SelectInput (#37040) @ulrichstark
|
|
82
|
+
|
|
83
|
+
### `@mui/joy@5.0.0-alpha.79`
|
|
84
|
+
|
|
85
|
+
- [Input][joy] Improve alignment on date fields (#37146) @wewakekumar
|
|
86
|
+
- [Alery][joy] Turn JS test to TS test (#37077) @hbjORbj
|
|
87
|
+
- [AspectRatio][joy] js test replaced with ts test (#37087) @PunitSoniME
|
|
88
|
+
- [Badge][AvatarGroup][joy] js test replaced with ts test (#37089) @PunitSoniME
|
|
89
|
+
- [Box][Card][MenuList][joy] Turn JS test to TS test (#37126) @uuxxx
|
|
90
|
+
- [List][Menu][joy] Turn JS test to TS test (#37123) @uuxxx
|
|
91
|
+
- [test][Joy] Remove duplicate Avatar test (#37201) @zignis
|
|
92
|
+
- [test][joy] js test cases converted to ts (#37117) @PunitSoniME
|
|
93
|
+
- [Button][joy] Convert Button test to typescript (#37181) @akash191095
|
|
94
|
+
- [CardContent][CardCover][CardOverflow][Chip][ChipDelete][joy] js text case converted to ts (#37116) @PunitSoniME
|
|
95
|
+
- [Radio][IconButton][Checkbox][Option][joy] Switch to TypeScript unit test (#37137) @DerTimonius
|
|
96
|
+
|
|
97
|
+
### `@mui/base@5.0.0-beta.0`
|
|
98
|
+
|
|
99
|
+
- [Select][base] Do not call onChange after initial render (#37141) @michaldudak
|
|
100
|
+
- [Select][base] Rename the `optionStringifier` prop (#37118) @michaldudak
|
|
101
|
+
- [typescript][base] Fix types of components callbacks parameters (#37169) @michaldudak
|
|
102
|
+
- [Select], [TablePagination] Use more descriptive parameter names (#37064) @michaldudak
|
|
103
|
+
|
|
104
|
+
### Docs
|
|
105
|
+
|
|
106
|
+
- [docs] Stray design tweaks to Base UI demos (#37003) @danilo-leal
|
|
107
|
+
- [docs] Move outdated CSS prefixing docs (#36710) @kriskw1999
|
|
108
|
+
- [docs] Improve "Example projects" page design (#37007) @danilo-leal
|
|
109
|
+
- [docs] Redirect NoSsr, Portal and TextareaAutosize to Base UI API page (#37175) @ZeeshanTamboli
|
|
110
|
+
- [docs] Demonstrate `TextField` customization using theme style overrides (#36805) @ZeeshanTamboli
|
|
111
|
+
- [docs] Tweak the "Edit this page" button icon (#37142) @danilo-leal
|
|
112
|
+
- [docs] Update links to the public roadmap (#36995) @mnajdova
|
|
113
|
+
- [docs] Improve Multiselect demo styling (#37120) @michaldudak
|
|
114
|
+
- [Stack] Fix import description @oliviertassinari
|
|
115
|
+
|
|
116
|
+
### Core
|
|
117
|
+
|
|
118
|
+
- [blog] Fix images using "MUI Base" instead of "Base UI" (#37044) @danilo-leal
|
|
119
|
+
- [core] Add VSCode extensions recommendations (#37166) @michaldudak
|
|
120
|
+
- [test] `e2e-website` related minor fixes (#37204) @ZeeshanTamboli
|
|
121
|
+
- [website] Update the active positions (#37075) @DanailH
|
|
122
|
+
- [website] Add Romain to the About page (#37124) @romgrk
|
|
123
|
+
- [website] Make Toolpad alpha labels consistent (#37125) @gerdadesign
|
|
124
|
+
|
|
125
|
+
All contributors of this release in alphabetical order: @akash191095, @DanailH, @danilo-leal, @DerTimonius, @gerdadesign, @hbjORbj, @kriskw1999, @michaldudak, @mnajdova, @oliviertassinari, @PunitSoniME, @romgrk, @sai6855, @ulrichstark, @uuxxx, @wewakekumar, @ZeeshanTamboli, @zignis
|
|
126
|
+
|
|
3
127
|
## 5.12.3
|
|
4
128
|
|
|
5
129
|
<!-- generated comparing v5.12.2..master -->
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare const ClassNameGenerator: {
|
|
2
|
-
configure(generator: (componentName: string) => string): void;
|
|
3
|
-
generate(componentName: string): string;
|
|
4
|
-
reset(): void;
|
|
5
|
-
};
|
|
6
|
-
export default ClassNameGenerator;
|
|
1
|
+
declare const ClassNameGenerator: {
|
|
2
|
+
configure(generator: (componentName: string) => string): void;
|
|
3
|
+
generate(componentName: string): string;
|
|
4
|
+
reset(): void;
|
|
5
|
+
};
|
|
6
|
+
export default ClassNameGenerator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './ClassNameGenerator';
|
|
1
|
+
export { default } from './ClassNameGenerator';
|
package/HTMLElementType.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default function HTMLElementType(props: {
|
|
2
|
-
[key: string]: unknown;
|
|
3
|
-
}, propName: string, componentName: string, location: string, propFullName: string): Error | null;
|
|
1
|
+
export default function HTMLElementType(props: {
|
|
2
|
+
[key: string]: unknown;
|
|
3
|
+
}, propName: string, componentName: string, location: string, propFullName: string): Error | null;
|
package/chainPropTypes.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
export default function chainPropTypes<A, B>(propType1: PropTypes.Validator<A>, propType2: PropTypes.Validator<B>): PropTypes.Validator<A & B>;
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
export default function chainPropTypes<A, B>(propType1: PropTypes.Validator<A>, propType2: PropTypes.Validator<B>): PropTypes.Validator<A & B>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function composeClasses<ClassKey extends string>(slots: Record<ClassKey, ReadonlyArray<string | false | undefined | null>>, getUtilityClass: (slot: string) => string, classes?: Record<string, string> | undefined): Record<ClassKey, string>;
|
|
1
|
+
export default function composeClasses<ClassKey extends string>(slots: Record<ClassKey, ReadonlyArray<string | false | undefined | null>>, getUtilityClass: (slot: string) => string, classes?: Record<string, string> | undefined): Record<ClassKey, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './composeClasses';
|
|
1
|
+
export { default } from './composeClasses';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Safe chained function.
|
|
3
|
-
*
|
|
4
|
-
* Will only create a new function if needed,
|
|
5
|
-
* otherwise will pass back existing functions or null.
|
|
6
|
-
*/
|
|
7
|
-
export default function createChainedFunction<Args extends any[], This>(...funcs: Array<(this: This, ...args: Args) => any>): (this: This, ...args: Args) => void;
|
|
1
|
+
/**
|
|
2
|
+
* Safe chained function.
|
|
3
|
+
*
|
|
4
|
+
* Will only create a new function if needed,
|
|
5
|
+
* otherwise will pass back existing functions or null.
|
|
6
|
+
*/
|
|
7
|
+
export default function createChainedFunction<Args extends any[], This>(...funcs: Array<(this: This, ...args: Args) => any>): (this: This, ...args: Args) => void;
|
package/deepmerge.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare function isPlainObject(item: unknown): item is Record<keyof any, unknown>;
|
|
2
|
-
export interface DeepmergeOptions {
|
|
3
|
-
clone?: boolean;
|
|
4
|
-
}
|
|
5
|
-
export default function deepmerge<T>(target: T, source: unknown, options?: DeepmergeOptions): T;
|
|
1
|
+
export declare function isPlainObject(item: unknown): item is Record<keyof any, unknown>;
|
|
2
|
+
export interface DeepmergeOptions {
|
|
3
|
+
clone?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export default function deepmerge<T>(target: T, source: unknown, options?: DeepmergeOptions): T;
|
package/deepmerge.js
CHANGED
|
@@ -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
|
function isPlainObject(item) {
|
|
11
9
|
return item !== null && typeof item === 'object' && item.constructor === Object;
|
|
12
10
|
}
|
|
@@ -23,7 +21,9 @@ function deepClone(source) {
|
|
|
23
21
|
function deepmerge(target, source, options = {
|
|
24
22
|
clone: true
|
|
25
23
|
}) {
|
|
26
|
-
const output = options.clone ?
|
|
24
|
+
const output = options.clone ? {
|
|
25
|
+
...target
|
|
26
|
+
} : target;
|
|
27
27
|
if (isPlainObject(target) && isPlainObject(source)) {
|
|
28
28
|
Object.keys(source).forEach(key => {
|
|
29
29
|
// Avoid prototype pollution
|
package/elementAcceptingRef.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
declare const elementAcceptingRef: PropTypes.Requireable<unknown>;
|
|
3
|
-
export default elementAcceptingRef;
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
declare const elementAcceptingRef: PropTypes.Requireable<unknown>;
|
|
3
|
+
export default elementAcceptingRef;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
declare const _default: PropTypes.Validator<PropTypes.ReactComponentLike | null | undefined>;
|
|
3
|
-
export default _default;
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
declare const _default: PropTypes.Validator<PropTypes.ReactComponentLike | null | undefined>;
|
|
3
|
+
export default _default;
|
package/esm/deepmerge.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
export function isPlainObject(item) {
|
|
3
2
|
return item !== null && typeof item === 'object' && item.constructor === Object;
|
|
4
3
|
}
|
|
@@ -15,7 +14,9 @@ function deepClone(source) {
|
|
|
15
14
|
export default function deepmerge(target, source, options = {
|
|
16
15
|
clone: true
|
|
17
16
|
}) {
|
|
18
|
-
const output = options.clone ?
|
|
17
|
+
const output = options.clone ? {
|
|
18
|
+
...target
|
|
19
|
+
} : target;
|
|
19
20
|
if (isPlainObject(target) && isPlainObject(source)) {
|
|
20
21
|
Object.keys(source).forEach(key => {
|
|
21
22
|
// Avoid prototype pollution
|
package/esm/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.
|
|
@@ -7,7 +6,8 @@ export default function exactProp(propTypes) {
|
|
|
7
6
|
if (process.env.NODE_ENV === 'production') {
|
|
8
7
|
return propTypes;
|
|
9
8
|
}
|
|
10
|
-
return
|
|
9
|
+
return {
|
|
10
|
+
...propTypes,
|
|
11
11
|
[specialProperty]: props => {
|
|
12
12
|
const unsupportedProps = Object.keys(props).filter(prop => !propTypes.hasOwnProperty(prop));
|
|
13
13
|
if (unsupportedProps.length > 0) {
|
|
@@ -15,5 +15,5 @@ export default function exactProp(propTypes) {
|
|
|
15
15
|
}
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
19
|
}
|
|
@@ -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 == null ? void 0 : prevPropTypes[propFullNameSafe];
|
package/esm/resolveProps.js
CHANGED
|
@@ -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
|
});
|
package/esm/useId.js
CHANGED
|
@@ -16,8 +16,8 @@ function useGlobalId(idOverride) {
|
|
|
16
16
|
return id;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
//
|
|
20
|
-
const maybeReactUseId = React['useId'
|
|
19
|
+
// downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814
|
|
20
|
+
const maybeReactUseId = React['useId'.toString()];
|
|
21
21
|
/**
|
|
22
22
|
*
|
|
23
23
|
* @example <div id={useId()} />
|
package/exactProp.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ValidationMap } from 'prop-types';
|
|
2
|
-
export default function exactProp<T>(propTypes: ValidationMap<T>): ValidationMap<T>;
|
|
1
|
+
import { ValidationMap } from 'prop-types';
|
|
2
|
+
export default function exactProp<T>(propTypes: ValidationMap<T>): ValidationMap<T>;
|
package/exactProp.js
CHANGED
|
@@ -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.
|
|
@@ -14,7 +12,8 @@ function exactProp(propTypes) {
|
|
|
14
12
|
if (process.env.NODE_ENV === 'production') {
|
|
15
13
|
return propTypes;
|
|
16
14
|
}
|
|
17
|
-
return
|
|
15
|
+
return {
|
|
16
|
+
...propTypes,
|
|
18
17
|
[specialProperty]: props => {
|
|
19
18
|
const unsupportedProps = Object.keys(props).filter(prop => !propTypes.hasOwnProperty(prop));
|
|
20
19
|
if (unsupportedProps.length > 0) {
|
|
@@ -22,5 +21,5 @@ function exactProp(propTypes) {
|
|
|
22
21
|
}
|
|
23
22
|
return null;
|
|
24
23
|
}
|
|
25
|
-
}
|
|
24
|
+
};
|
|
26
25
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WARNING: Don't import this directly.
|
|
3
|
-
* Use `MuiError` from `@mui/utils/macros/MuiError.macro` instead.
|
|
4
|
-
* @param {number} code
|
|
5
|
-
*/
|
|
6
|
-
export default function formatMuiErrorMessage(code: number): string;
|
|
1
|
+
/**
|
|
2
|
+
* WARNING: Don't import this directly.
|
|
3
|
+
* Use `MuiError` from `@mui/utils/macros/MuiError.macro` instead.
|
|
4
|
+
* @param {number} code
|
|
5
|
+
*/
|
|
6
|
+
export default function formatMuiErrorMessage(code: number): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type GlobalStateSlot = 'active' | 'checked' | 'completed' | 'disabled' | 'readOnly' | 'error' | 'expanded' | 'focused' | 'focusVisible' | 'required' | 'selected';
|
|
2
|
-
export default function generateUtilityClass(componentName: string, slot: string, globalStatePrefix?: string): string;
|
|
1
|
+
export type GlobalStateSlot = 'active' | 'checked' | 'completed' | 'disabled' | 'readOnly' | 'error' | 'expanded' | 'focused' | 'focusVisible' | 'required' | 'selected';
|
|
2
|
+
export default function generateUtilityClass(componentName: string, slot: string, globalStatePrefix?: string): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from './generateUtilityClass';
|
|
2
|
-
export * from './generateUtilityClass';
|
|
1
|
+
export { default } from './generateUtilityClass';
|
|
2
|
+
export * from './generateUtilityClass';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function generateUtilityClasses<T extends string>(componentName: string, slots: T[], globalStatePrefix?: string): Record<T, string>;
|
|
1
|
+
export default function generateUtilityClasses<T extends string>(componentName: string, slots: T[], globalStatePrefix?: string): Record<T, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './generateUtilityClasses';
|
|
1
|
+
export { default } from './generateUtilityClasses';
|
package/getDisplayName.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export declare function getFunctionName(fn: Function): string;
|
|
3
|
-
/**
|
|
4
|
-
* cherry-pick from
|
|
5
|
-
* https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js
|
|
6
|
-
* originally forked from recompose/getDisplayName with added IE11 support
|
|
7
|
-
*/
|
|
8
|
-
export default function getDisplayName(Component: React.ElementType): string | undefined;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare function getFunctionName(fn: Function): string;
|
|
3
|
+
/**
|
|
4
|
+
* cherry-pick from
|
|
5
|
+
* https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js
|
|
6
|
+
* originally forked from recompose/getDisplayName with added IE11 support
|
|
7
|
+
*/
|
|
8
|
+
export default function getDisplayName(Component: React.ElementType): string | undefined;
|
package/getScrollbarSize.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function getScrollbarSize(doc: Document): number;
|
|
1
|
+
export default function getScrollbarSize(doc: Document): number;
|
package/index.d.ts
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
export { default as chainPropTypes } from './chainPropTypes';
|
|
2
|
-
export { default as deepmerge } from './deepmerge';
|
|
3
|
-
export { isPlainObject } from './deepmerge';
|
|
4
|
-
export { default as elementAcceptingRef } from './elementAcceptingRef';
|
|
5
|
-
export { default as elementTypeAcceptingRef } from './elementTypeAcceptingRef';
|
|
6
|
-
export { default as exactProp } from './exactProp';
|
|
7
|
-
export { default as formatMuiErrorMessage } from './formatMuiErrorMessage';
|
|
8
|
-
export { default as getDisplayName } from './getDisplayName';
|
|
9
|
-
export { default as HTMLElementType } from './HTMLElementType';
|
|
10
|
-
export { default as ponyfillGlobal } from './ponyfillGlobal';
|
|
11
|
-
export { default as refType } from './refType';
|
|
12
|
-
export { default as unstable_capitalize } from './capitalize';
|
|
13
|
-
export { default as unstable_createChainedFunction } from './createChainedFunction';
|
|
14
|
-
export { default as unstable_debounce } from './debounce';
|
|
15
|
-
export { default as unstable_deprecatedPropType } from './deprecatedPropType';
|
|
16
|
-
export { default as unstable_isMuiElement } from './isMuiElement';
|
|
17
|
-
export { default as unstable_ownerDocument } from './ownerDocument';
|
|
18
|
-
export { default as unstable_ownerWindow } from './ownerWindow';
|
|
19
|
-
export { default as unstable_requirePropFactory } from './requirePropFactory';
|
|
20
|
-
export { default as unstable_setRef } from './setRef';
|
|
21
|
-
export { default as unstable_useEnhancedEffect } from './useEnhancedEffect';
|
|
22
|
-
export { default as unstable_useId } from './useId';
|
|
23
|
-
export { default as unstable_unsupportedProp } from './unsupportedProp';
|
|
24
|
-
export { default as unstable_useControlled } from './useControlled';
|
|
25
|
-
export { default as unstable_useEventCallback } from './useEventCallback';
|
|
26
|
-
export { default as unstable_useForkRef } from './useForkRef';
|
|
27
|
-
export { default as unstable_useIsFocusVisible } from './useIsFocusVisible';
|
|
28
|
-
export { default as unstable_getScrollbarSize } from './getScrollbarSize';
|
|
29
|
-
export { detectScrollType as unstable_detectScrollType, getNormalizedScrollLeft as unstable_getNormalizedScrollLeft, } from './scrollLeft';
|
|
30
|
-
export { default as usePreviousProps } from './usePreviousProps';
|
|
31
|
-
export { default as visuallyHidden } from './visuallyHidden';
|
|
32
|
-
export { default as integerPropType } from './integerPropType';
|
|
33
|
-
export { default as internal_resolveProps } from './resolveProps';
|
|
34
|
-
export { default as unstable_composeClasses } from './composeClasses';
|
|
35
|
-
export { default as unstable_generateUtilityClass } from './generateUtilityClass';
|
|
36
|
-
export * from './generateUtilityClass';
|
|
37
|
-
export { default as unstable_generateUtilityClasses } from './generateUtilityClasses';
|
|
38
|
-
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator';
|
|
1
|
+
export { default as chainPropTypes } from './chainPropTypes';
|
|
2
|
+
export { default as deepmerge } from './deepmerge';
|
|
3
|
+
export { isPlainObject } from './deepmerge';
|
|
4
|
+
export { default as elementAcceptingRef } from './elementAcceptingRef';
|
|
5
|
+
export { default as elementTypeAcceptingRef } from './elementTypeAcceptingRef';
|
|
6
|
+
export { default as exactProp } from './exactProp';
|
|
7
|
+
export { default as formatMuiErrorMessage } from './formatMuiErrorMessage';
|
|
8
|
+
export { default as getDisplayName } from './getDisplayName';
|
|
9
|
+
export { default as HTMLElementType } from './HTMLElementType';
|
|
10
|
+
export { default as ponyfillGlobal } from './ponyfillGlobal';
|
|
11
|
+
export { default as refType } from './refType';
|
|
12
|
+
export { default as unstable_capitalize } from './capitalize';
|
|
13
|
+
export { default as unstable_createChainedFunction } from './createChainedFunction';
|
|
14
|
+
export { default as unstable_debounce } from './debounce';
|
|
15
|
+
export { default as unstable_deprecatedPropType } from './deprecatedPropType';
|
|
16
|
+
export { default as unstable_isMuiElement } from './isMuiElement';
|
|
17
|
+
export { default as unstable_ownerDocument } from './ownerDocument';
|
|
18
|
+
export { default as unstable_ownerWindow } from './ownerWindow';
|
|
19
|
+
export { default as unstable_requirePropFactory } from './requirePropFactory';
|
|
20
|
+
export { default as unstable_setRef } from './setRef';
|
|
21
|
+
export { default as unstable_useEnhancedEffect } from './useEnhancedEffect';
|
|
22
|
+
export { default as unstable_useId } from './useId';
|
|
23
|
+
export { default as unstable_unsupportedProp } from './unsupportedProp';
|
|
24
|
+
export { default as unstable_useControlled } from './useControlled';
|
|
25
|
+
export { default as unstable_useEventCallback } from './useEventCallback';
|
|
26
|
+
export { default as unstable_useForkRef } from './useForkRef';
|
|
27
|
+
export { default as unstable_useIsFocusVisible } from './useIsFocusVisible';
|
|
28
|
+
export { default as unstable_getScrollbarSize } from './getScrollbarSize';
|
|
29
|
+
export { detectScrollType as unstable_detectScrollType, getNormalizedScrollLeft as unstable_getNormalizedScrollLeft, } from './scrollLeft';
|
|
30
|
+
export { default as usePreviousProps } from './usePreviousProps';
|
|
31
|
+
export { default as visuallyHidden } from './visuallyHidden';
|
|
32
|
+
export { default as integerPropType } from './integerPropType';
|
|
33
|
+
export { default as internal_resolveProps } from './resolveProps';
|
|
34
|
+
export { default as unstable_composeClasses } from './composeClasses';
|
|
35
|
+
export { default as unstable_generateUtilityClass } from './generateUtilityClass';
|
|
36
|
+
export * from './generateUtilityClass';
|
|
37
|
+
export { default as unstable_generateUtilityClasses } from './generateUtilityClasses';
|
|
38
|
+
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator';
|
package/index.js
CHANGED
package/integerPropType.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export function getTypeByValue(value: any): any;
|
|
2
|
-
declare function _default(props: any, propName: any, ...other: any[]): RangeError | null;
|
|
3
|
-
declare namespace _default {
|
|
4
|
-
export { requiredInteger as isRequired };
|
|
5
|
-
}
|
|
6
|
-
export default _default;
|
|
7
|
-
declare function requiredInteger(props: any, propName: any, componentName: any, location: any): RangeError | null;
|
|
1
|
+
export function getTypeByValue(value: any): any;
|
|
2
|
+
declare function _default(props: any, propName: any, ...other: any[]): RangeError | null;
|
|
3
|
+
declare namespace _default {
|
|
4
|
+
export { requiredInteger as isRequired };
|
|
5
|
+
}
|
|
6
|
+
export default _default;
|
|
7
|
+
declare function requiredInteger(props: any, propName: any, componentName: any, location: any): RangeError | null;
|
package/isMuiElement.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function isMuiElement(element: any, muiNames: readonly string[]): boolean;
|
|
1
|
+
export default function isMuiElement(element: any, muiNames: readonly string[]): boolean;
|
package/legacy/deepmerge.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
5
|
export function isPlainObject(item) {
|
|
4
6
|
return item !== null && _typeof(item) === 'object' && item.constructor === Object;
|
|
5
7
|
}
|
|
@@ -17,7 +19,7 @@ export default function deepmerge(target, source) {
|
|
|
17
19
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
18
20
|
clone: true
|
|
19
21
|
};
|
|
20
|
-
var output = options.clone ?
|
|
22
|
+
var output = options.clone ? _objectSpread({}, target) : target;
|
|
21
23
|
if (isPlainObject(target) && isPlainObject(source)) {
|
|
22
24
|
Object.keys(source).forEach(function (key) {
|
|
23
25
|
// Avoid prototype pollution
|
package/legacy/exactProp.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
4
|
// This module is based on https://github.com/airbnb/prop-types-exact repository.
|
|
4
5
|
// However, in order to reduce the number of dependencies and to remove some extra safe checks
|
|
5
6
|
// the module was forked.
|
|
@@ -8,7 +9,7 @@ export default function exactProp(propTypes) {
|
|
|
8
9
|
if (process.env.NODE_ENV === 'production') {
|
|
9
10
|
return propTypes;
|
|
10
11
|
}
|
|
11
|
-
return
|
|
12
|
+
return _objectSpread(_objectSpread({}, propTypes), {}, _defineProperty({}, specialProperty, function (props) {
|
|
12
13
|
var unsupportedProps = Object.keys(props).filter(function (prop) {
|
|
13
14
|
return !propTypes.hasOwnProperty(prop);
|
|
14
15
|
});
|
package/legacy/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2
4
|
export default function requirePropFactory(componentNameInError, Component) {
|
|
3
5
|
if (process.env.NODE_ENV === 'production') {
|
|
4
6
|
return function () {
|
|
@@ -7,7 +9,7 @@ export default function requirePropFactory(componentNameInError, Component) {
|
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
// eslint-disable-next-line react/forbid-foreign-prop-types
|
|
10
|
-
var prevPropTypes = Component ?
|
|
12
|
+
var prevPropTypes = Component ? _objectSpread({}, Component.propTypes) : null;
|
|
11
13
|
var requireProp = function requireProp(requiredProp) {
|
|
12
14
|
return function (props, propName, componentName, location, propFullName) {
|
|
13
15
|
var propFullNameSafe = propFullName || propName;
|
package/legacy/resolveProps.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2
4
|
/**
|
|
3
5
|
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
4
6
|
* @param {object} defaultProps
|
|
@@ -6,10 +8,10 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
6
8
|
* @returns {object} resolved props
|
|
7
9
|
*/
|
|
8
10
|
export default function resolveProps(defaultProps, props) {
|
|
9
|
-
var output =
|
|
11
|
+
var output = _objectSpread({}, props);
|
|
10
12
|
Object.keys(defaultProps).forEach(function (propName) {
|
|
11
13
|
if (propName.toString().match(/^(components|slots)$/)) {
|
|
12
|
-
output[propName] =
|
|
14
|
+
output[propName] = _objectSpread(_objectSpread({}, defaultProps[propName]), output[propName]);
|
|
13
15
|
} else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {
|
|
14
16
|
var defaultSlotProps = defaultProps[propName] || {};
|
|
15
17
|
var slotProps = props[propName];
|
|
@@ -21,7 +23,7 @@ export default function resolveProps(defaultProps, props) {
|
|
|
21
23
|
// Reduce the iteration if the default slot props is empty
|
|
22
24
|
output[propName] = slotProps;
|
|
23
25
|
} else {
|
|
24
|
-
output[propName] =
|
|
26
|
+
output[propName] = _objectSpread({}, slotProps);
|
|
25
27
|
Object.keys(defaultSlotProps).forEach(function (slotPropName) {
|
|
26
28
|
output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
|
|
27
29
|
});
|
package/legacy/useId.js
CHANGED
|
@@ -18,8 +18,8 @@ function useGlobalId(idOverride) {
|
|
|
18
18
|
return id;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
//
|
|
22
|
-
var maybeReactUseId = React['useId'
|
|
21
|
+
// downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814
|
|
22
|
+
var maybeReactUseId = React['useId'.toString()];
|
|
23
23
|
/**
|
|
24
24
|
*
|
|
25
25
|
* @example <div id={useId()} />
|
package/modern/deepmerge.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
export function isPlainObject(item) {
|
|
3
2
|
return item !== null && typeof item === 'object' && item.constructor === Object;
|
|
4
3
|
}
|
|
@@ -15,7 +14,9 @@ function deepClone(source) {
|
|
|
15
14
|
export default function deepmerge(target, source, options = {
|
|
16
15
|
clone: true
|
|
17
16
|
}) {
|
|
18
|
-
const output = options.clone ?
|
|
17
|
+
const output = options.clone ? {
|
|
18
|
+
...target
|
|
19
|
+
} : target;
|
|
19
20
|
if (isPlainObject(target) && isPlainObject(source)) {
|
|
20
21
|
Object.keys(source).forEach(key => {
|
|
21
22
|
// Avoid prototype pollution
|
package/modern/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.
|
|
@@ -7,7 +6,8 @@ export default function exactProp(propTypes) {
|
|
|
7
6
|
if (process.env.NODE_ENV === 'production') {
|
|
8
7
|
return propTypes;
|
|
9
8
|
}
|
|
10
|
-
return
|
|
9
|
+
return {
|
|
10
|
+
...propTypes,
|
|
11
11
|
[specialProperty]: props => {
|
|
12
12
|
const unsupportedProps = Object.keys(props).filter(prop => !propTypes.hasOwnProperty(prop));
|
|
13
13
|
if (unsupportedProps.length > 0) {
|
|
@@ -15,5 +15,5 @@ export default function exactProp(propTypes) {
|
|
|
15
15
|
}
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
19
|
}
|
package/modern/index.js
CHANGED
|
@@ -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];
|
package/modern/resolveProps.js
CHANGED
|
@@ -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
|
});
|
package/modern/useId.js
CHANGED
|
@@ -16,8 +16,8 @@ function useGlobalId(idOverride) {
|
|
|
16
16
|
return id;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
//
|
|
20
|
-
const maybeReactUseId = React['useId'
|
|
19
|
+
// downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814
|
|
20
|
+
const maybeReactUseId = React['useId'.toString()];
|
|
21
21
|
/**
|
|
22
22
|
*
|
|
23
23
|
* @example <div id={useId()} />
|
package/ownerDocument.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function ownerDocument(node: Node | null | undefined): Document;
|
|
1
|
+
export default function ownerDocument(node: Node | null | undefined): Document;
|
package/ownerWindow.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function ownerWindow(node: Node | undefined): Window;
|
|
1
|
+
export default function ownerWindow(node: Node | undefined): Window;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/utils",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.13.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "Utility functions for React components.",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@babel/runtime": "^7.21.0",
|
|
33
33
|
"@types/prop-types": "^15.7.5",
|
|
34
|
-
"@types/react-is": "^
|
|
34
|
+
"@types/react-is": "^18.2.0",
|
|
35
35
|
"prop-types": "^15.8.1",
|
|
36
36
|
"react-is": "^18.2.0"
|
|
37
37
|
},
|
package/ponyfillGlobal.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: any;
|
|
2
|
-
export default _default;
|
|
1
|
+
declare const _default: any;
|
|
2
|
+
export default _default;
|
package/refType.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
declare const refType: PropTypes.Requireable<object>;
|
|
3
|
-
export default refType;
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
declare const refType: PropTypes.Requireable<object>;
|
|
3
|
+
export default refType;
|
package/requirePropFactory.js
CHANGED
|
@@ -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];
|
package/resolveProps.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
3
|
-
* @param {object} defaultProps
|
|
4
|
-
* @param {object} props
|
|
5
|
-
* @returns {object} resolved props
|
|
6
|
-
*/
|
|
7
|
-
export default function resolveProps<T extends {
|
|
8
|
-
components?: Record<string, unknown>;
|
|
9
|
-
componentsProps?: Record<string, unknown>;
|
|
10
|
-
slots?: Record<string, unknown>;
|
|
11
|
-
slotProps?: Record<string, unknown>;
|
|
12
|
-
} & Record<string, unknown>>(defaultProps: T, props: T): T;
|
|
1
|
+
/**
|
|
2
|
+
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
3
|
+
* @param {object} defaultProps
|
|
4
|
+
* @param {object} props
|
|
5
|
+
* @returns {object} resolved props
|
|
6
|
+
*/
|
|
7
|
+
export default function resolveProps<T extends {
|
|
8
|
+
components?: Record<string, unknown>;
|
|
9
|
+
componentsProps?: Record<string, unknown>;
|
|
10
|
+
slots?: Record<string, unknown>;
|
|
11
|
+
slotProps?: Record<string, unknown>;
|
|
12
|
+
} & Record<string, unknown>>(defaultProps: T, props: T): T;
|
package/resolveProps.js
CHANGED
|
@@ -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
|
});
|
package/setRef.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* TODO v5: consider making it private
|
|
4
|
-
*
|
|
5
|
-
* passes {value} to {ref}
|
|
6
|
-
*
|
|
7
|
-
* WARNING: Be sure to only call this inside a callback that is passed as a ref.
|
|
8
|
-
* Otherwise, make sure to cleanup the previous {ref} if it changes. See
|
|
9
|
-
* https://github.com/mui/material-ui/issues/13539
|
|
10
|
-
*
|
|
11
|
-
* Useful if you want to expose the ref of an inner component to the public API
|
|
12
|
-
* while still using it inside the component.
|
|
13
|
-
* @param ref A ref callback or ref object. If anything falsy, this is a no-op.
|
|
14
|
-
*/
|
|
15
|
-
export default function setRef<T>(ref: React.MutableRefObject<T | null> | ((instance: T | null) => void) | null | undefined, value: T | null): void;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* TODO v5: consider making it private
|
|
4
|
+
*
|
|
5
|
+
* passes {value} to {ref}
|
|
6
|
+
*
|
|
7
|
+
* WARNING: Be sure to only call this inside a callback that is passed as a ref.
|
|
8
|
+
* Otherwise, make sure to cleanup the previous {ref} if it changes. See
|
|
9
|
+
* https://github.com/mui/material-ui/issues/13539
|
|
10
|
+
*
|
|
11
|
+
* Useful if you want to expose the ref of an inner component to the public API
|
|
12
|
+
* while still using it inside the component.
|
|
13
|
+
* @param ref A ref callback or ref object. If anything falsy, this is a no-op.
|
|
14
|
+
*/
|
|
15
|
+
export default function setRef<T>(ref: React.MutableRefObject<T | null> | ((instance: T | null) => void) | null | undefined, value: T | null): void;
|
package/useEventCallback.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* https://github.com/facebook/react/issues/14099#issuecomment-440013892
|
|
3
|
-
*/
|
|
4
|
-
export default function useEventCallback<Args extends unknown[], Return>(fn: (...args: Args) => Return): (...args: Args) => Return;
|
|
1
|
+
/**
|
|
2
|
+
* https://github.com/facebook/react/issues/14099#issuecomment-440013892
|
|
3
|
+
*/
|
|
4
|
+
export default function useEventCallback<Args extends unknown[], Return>(fn: (...args: Args) => Return): (...args: Args) => Return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/useForkRef.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export default function useForkRef<Instance>(...refs: Array<React.Ref<Instance> | undefined>): React.RefCallback<Instance> | null;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export default function useForkRef<Instance>(...refs: Array<React.Ref<Instance> | undefined>): React.RefCallback<Instance> | null;
|
package/useId.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @example <div id={useId()} />
|
|
4
|
-
* @param idOverride
|
|
5
|
-
* @returns {string}
|
|
6
|
-
*/
|
|
7
|
-
export default function useId(idOverride?: string): string | undefined;
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @example <div id={useId()} />
|
|
4
|
+
* @param idOverride
|
|
5
|
+
* @returns {string}
|
|
6
|
+
*/
|
|
7
|
+
export default function useId(idOverride?: string): string | undefined;
|
package/useId.js
CHANGED
|
@@ -24,8 +24,8 @@ function useGlobalId(idOverride) {
|
|
|
24
24
|
return id;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
//
|
|
28
|
-
const maybeReactUseId = React['useId'
|
|
27
|
+
// downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814
|
|
28
|
+
const maybeReactUseId = React['useId'.toString()];
|
|
29
29
|
/**
|
|
30
30
|
*
|
|
31
31
|
* @example <div id={useId()} />
|
package/useIsFocusVisible.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export declare function teardown(doc: Document): void;
|
|
3
|
-
export interface UseIsFocusVisibleResult {
|
|
4
|
-
isFocusVisibleRef: React.MutableRefObject<boolean>;
|
|
5
|
-
onBlur: (event: React.FocusEvent<any>) => void;
|
|
6
|
-
onFocus: (event: React.FocusEvent<any>) => void;
|
|
7
|
-
ref: React.RefCallback<Element>;
|
|
8
|
-
}
|
|
9
|
-
export default function useIsFocusVisible(): UseIsFocusVisibleResult;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare function teardown(doc: Document): void;
|
|
3
|
+
export interface UseIsFocusVisibleResult {
|
|
4
|
+
isFocusVisibleRef: React.MutableRefObject<boolean>;
|
|
5
|
+
onBlur: (event: React.FocusEvent<any>) => void;
|
|
6
|
+
onFocus: (event: React.FocusEvent<any>) => void;
|
|
7
|
+
ref: React.RefCallback<Element>;
|
|
8
|
+
}
|
|
9
|
+
export default function useIsFocusVisible(): UseIsFocusVisibleResult;
|
package/usePreviousProps.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const usePreviousProps: <T>(value: T) => Partial<T>;
|
|
2
|
-
export default usePreviousProps;
|
|
1
|
+
declare const usePreviousProps: <T>(value: T) => Partial<T>;
|
|
2
|
+
export default usePreviousProps;
|
package/visuallyHidden.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const visuallyHidden: import('react').CSSProperties;
|
|
2
|
-
export default visuallyHidden;
|
|
1
|
+
declare const visuallyHidden: import('react').CSSProperties;
|
|
2
|
+
export default visuallyHidden;
|