@mui/utils 9.4.0 → 10.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +179 -0
- package/elementTypeAcceptingRef/elementTypeAcceptingRef.js +1 -1
- package/elementTypeAcceptingRef/elementTypeAcceptingRef.mjs +1 -1
- package/extractEventHandlers/extractEventHandlers.js +5 -3
- package/extractEventHandlers/extractEventHandlers.mjs +5 -3
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/mergeSlotProps/mergeSlotProps.js +19 -15
- package/mergeSlotProps/mergeSlotProps.mjs +19 -15
- package/omitEventHandlers/omitEventHandlers.js +9 -3
- package/omitEventHandlers/omitEventHandlers.mjs +9 -3
- package/package.json +4 -4
- package/resolveComponentProps/resolveComponentProps.d.mts +5 -1
- package/resolveComponentProps/resolveComponentProps.d.ts +5 -1
- package/resolveComponentProps/resolveComponentProps.js +5 -1
- package/resolveComponentProps/resolveComponentProps.mjs +5 -1
- package/types/DataAttributes.d.mts +1 -1
- package/types/DataAttributes.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,184 @@
|
|
|
1
1
|
# [Versions](https://mui.com/material-ui/getting-started/versions/)
|
|
2
2
|
|
|
3
|
+
## 10.0.0-alpha.0
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v9.4.0..master -->
|
|
6
|
+
|
|
7
|
+
_Oct 9, 2026_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 30 contributors who made this release possible. Here are some highlights ✨:
|
|
10
|
+
|
|
11
|
+
- ⚙️ Support [values other than raw options](https://next.mui.com/material-ui/react-autocomplete/#object-options-with-primitive-values) for Autocomplete via the `getOptionValue` prop.
|
|
12
|
+
- ♿️ Extend the theme's [focus indicator](https://next.mui.com/material-ui/customization/focus-visible/) to `InputBase` and text fields with `disableUnderline` via `theme.focusVisible`.
|
|
13
|
+
|
|
14
|
+
### `@mui/material@10.0.0-alpha.0`
|
|
15
|
+
|
|
16
|
+
#### Breaking Changes
|
|
17
|
+
|
|
18
|
+
- [autocomplete] Change the default popup Paper elevation from 1 to 8 (#49110) @namansancheti
|
|
19
|
+
|
|
20
|
+
#### Changes
|
|
21
|
+
|
|
22
|
+
- Add missing override interfaces for `slotProps` (#49343) @sai6855
|
|
23
|
+
- Export private focus-visible utilities (#49139) @siriwatknp
|
|
24
|
+
- Fix `onClose` types for Menu, Snackbar, and SwipeableDrawer (#49340) @Janpot
|
|
25
|
+
- Fix slot handling in Autocomplete chips, TextField `inputLabel`, and NativeSelect `input` (#49336) @Janpot
|
|
26
|
+
- Fix theme `defaultProps` and missing exports (#49332) @Janpot
|
|
27
|
+
- Remove unnecessary `Omit` types (#49328) @sai6855
|
|
28
|
+
- [autocomplete] Lazily derive the initial input value (#49057) @OskarEichler
|
|
29
|
+
- [autocomplete] Prevent crash when changing `groupBy` (#49150) @silviuaavram
|
|
30
|
+
- [autocomplete] Stop filtering once the result limit is reached (#49295) @valkiara
|
|
31
|
+
- [autocomplete] Support values other than raw options (#49078) @silviuaavram
|
|
32
|
+
- [avatargroup] Improve TypeScript performance when using `slotProps` (#49213) @sai6855
|
|
33
|
+
- [bottomnavigationaction] Document the `selected` prop (#49190) @siriwatknp
|
|
34
|
+
- [breadcrumbs] Build separators in one pass (#49058) @OskarEichler
|
|
35
|
+
- [button] Fix loading-position style leaking to non-loading buttons (#49182) @siriwatknp
|
|
36
|
+
- [button] Simplify `ExtendButton` type (#49364) @sai6855
|
|
37
|
+
- [buttonbase] Fix LazyRipple retaining event objects when ripples are disabled (#49000) @dizhurnikita
|
|
38
|
+
- [checkbox] Set the native indeterminate state on the input (#49053) @lazerg
|
|
39
|
+
- [dialogcontent] Render the `theme.focusVisible` ring on the scrollable content (#49311) @siriwatknp
|
|
40
|
+
- [inputbase] Fix `slotProps.input` event handlers and ref being ignored (#49333) @Janpot
|
|
41
|
+
- [link] Remove unwanted `Omit` type (#49331) @sai6855
|
|
42
|
+
- [link] Revert to `color-mix` when underline color is not accepted (#49077) @silviuaavram
|
|
43
|
+
- [modal] Prevent `aria-hidden` from being applied to non-portal modals (#49026) @ZeeshanTamboli
|
|
44
|
+
- [select] Fix flaky opening mouseup timing (#49024) @michelengelen
|
|
45
|
+
- [skeleton] Fix the background fallback with CSS theme variables (#49322) @aarongarciah
|
|
46
|
+
- [slider] Fix `disableSwap` when a neighboring thumb is at 0 (#49234) @kwy404
|
|
47
|
+
- [snackbar][speeddial] Remove unnecessary `Omit` in props definitions (#49214) @sai6855
|
|
48
|
+
- [speeddial] Fix horizontal persistent tooltip placement (#49073) @Cunninger
|
|
49
|
+
- [speeddial] Support action slot object refs (#49056) @OskarEichler
|
|
50
|
+
- [table] Improve accessibility for the pagination buttons (#49112) @silviuaavram
|
|
51
|
+
- [tablepaginationactions] Align common types with other components (#49347) @sai6855
|
|
52
|
+
- [tabs] Derive mounted state from the indicator style instead of setting it in an effect (#49324) @ZeeshanTamboli
|
|
53
|
+
- [tabs] Fix selected tab not scrolling into view when scroll buttons appear in auto mode (#48489) @starboyvarun
|
|
54
|
+
- [tabs] Respect `scroll-padding` when scrolling the selected tab into view (#49039) @crispinc-omnea
|
|
55
|
+
- [textfield] Add theme CSS variable for autofill `box-shadow` (#47472) @ludij
|
|
56
|
+
- [theme] Fix `theme.alpha()` for raw colors with CSS variables (#49273) @siriwatknp
|
|
57
|
+
- [theme] Fix theming outliers in Paper, BreadcrumbCollapsed, TablePagination, and Tooltip (#49335) @Janpot
|
|
58
|
+
- [theme] Keep CSS variable fallbacks in `theme.alpha()` (#49297) @aarongarciah
|
|
59
|
+
- [theme] Render the `theme.focusVisible` ring on inputs (#49152) @siriwatknp
|
|
60
|
+
|
|
61
|
+
### `@mui/icons-material@10.0.0-alpha.0`
|
|
62
|
+
|
|
63
|
+
- Center the WarningRounded icon within its `viewBox` (#49043) @itd-mb
|
|
64
|
+
|
|
65
|
+
### `@mui/system@10.0.0-alpha.0`
|
|
66
|
+
|
|
67
|
+
- Remove duplicated `filterProps` mapping in `getThemeValue` (#48640) @sai6855
|
|
68
|
+
- Resolve InitColorSchemeScript `%s` placeholder at build time (#49113) @Janpot
|
|
69
|
+
- Serialize InitColorSchemeScript configuration values (#49091) @Janpot
|
|
70
|
+
|
|
71
|
+
### `@mui/utils@10.0.0-alpha.0`
|
|
72
|
+
|
|
73
|
+
- Document the deprecated `slotState` parameter and add `resolveComponentProps` tests (#49137) @usamabhatti1998
|
|
74
|
+
- Improve `mergeSlotProps` performance (#48002) @mj12albert
|
|
75
|
+
|
|
76
|
+
### `@mui/types@10.0.0-alpha.0`
|
|
77
|
+
|
|
78
|
+
- Remove invalid `number` type from supported `OverridableStringUnion` type arguments (#49278) @sai6855
|
|
79
|
+
|
|
80
|
+
### `@mui/lab@10.0.0-alpha.0`
|
|
81
|
+
|
|
82
|
+
- [masonry] Fix styles with CSS theme variables (#49294) @aarongarciah
|
|
83
|
+
- [timelineitem] Keep the spacer selector at one class of specificity (#49028) @Janpot
|
|
84
|
+
|
|
85
|
+
### `@mui/codemod@10.0.0-alpha.0`
|
|
86
|
+
|
|
87
|
+
- Upgrade required Node.js version in the `engines` field (#49070) @ZeeshanTamboli
|
|
88
|
+
- [formcontrollabel] Stop migrating `ActionsComponent` and remove `inputRef` (#49334) @Janpot
|
|
89
|
+
|
|
90
|
+
### `@mui/material-nextjs@10.0.0-alpha.0`
|
|
91
|
+
|
|
92
|
+
- Escape the `</style>` tag in server-rendered style output (#49183) @Janpot
|
|
93
|
+
|
|
94
|
+
### Docs
|
|
95
|
+
|
|
96
|
+
- Add the accessibility conformance report page (#48926) @michelengelen
|
|
97
|
+
- Add the v10 migration guide (#49349) @silviuaavram
|
|
98
|
+
- Allow reopening cookie preferences from a URL hash (#49124) @brijeshb42
|
|
99
|
+
- Clarify how to restore icon `data-testid` attributes in the v7 migration guide (#49109) @alexfauquette
|
|
100
|
+
- Fix @mui/lab version in v7.3.6 changelog (#49145) @mateuseap
|
|
101
|
+
- Fix Next.js font optimization docs to preserve typography letter-spacing (#48488) @starboyvarun
|
|
102
|
+
- Fix the dead Popper.js documentation links (#49081) @lazerg
|
|
103
|
+
- Fix the LLM generated docs paths (#49076) @silviuaavram
|
|
104
|
+
- Improve accessibility for checkbox lists (#49111) @silviuaavram
|
|
105
|
+
- Warn about untrusted values in the `sx` prop (#49199) @Janpot
|
|
106
|
+
- [autocomplete] Add removal and navigation ARIA descriptions to Chip examples (#49086) @silviuaavram
|
|
107
|
+
- [backdrop] Move Backdrop to Utils and clarify it is a low-level utility (#49072) @webernir
|
|
108
|
+
- [drawer] Add accessible names to close buttons (#49161) @sai6855
|
|
109
|
+
- [material-icons] Add `frame` synonym for the Portrait icon (#49201) @Janpot
|
|
110
|
+
- [material-icons] Improve icon search performance (#44450) @oliviertassinari
|
|
111
|
+
- [numberfield] Document the `format` prop for units and currency (#49160) @Denimworld12
|
|
112
|
+
- [snackbar] Demonstrate Escape handling inside a dialog (#49306) @minwookshin
|
|
113
|
+
- [system] Avoid `any` when spreading the `sx` prop (#49083) @LeusMaximus
|
|
114
|
+
|
|
115
|
+
### Core
|
|
116
|
+
|
|
117
|
+
- [ci] Add Claude PR review via mui-public reusable workflow (#49037) @Janpot
|
|
118
|
+
- [ci] Add the Claude CI flake-fix caller (#49197) @Janpot
|
|
119
|
+
- [code-infra] Add the release skill (#48938) @brijeshb42
|
|
120
|
+
- [code-infra] Backport #target-branch-reference to docs `package.json` (#49372) @silviuaavram
|
|
121
|
+
- [code-infra] Backport #target-branch-references to master (#49194) @silviuaavram
|
|
122
|
+
- [code-infra] Bump @types/node to 22 and group it with Node.js in Renovate (#49189) @Janpot
|
|
123
|
+
- [code-infra] Compare the nightly React runs with the stable Argos build (#49123) @LukasTy
|
|
124
|
+
- [code-infra] Consume shared commands from code-infra orb (#49082) @brijeshb42
|
|
125
|
+
- [code-infra] Convert @mui/lab to TypeScript (#49140) @Janpot
|
|
126
|
+
- [code-infra] Convert @mui/material internal svg-icons to TypeScript (#49143) @Janpot
|
|
127
|
+
- [code-infra] Convert remaining @mui/system .js+.d.ts pairs to TypeScript (part 2) (#48699) @Janpot
|
|
128
|
+
- [code-infra] Enable pnpm `autoDedupe` (#49242) @Janpot
|
|
129
|
+
- [code-infra] Fix Autocomplete JSDoc links after a stale merge (#49315) @silviuaavram
|
|
130
|
+
- [code-infra] Fix `package.json` metadata (#49243) @Janpot
|
|
131
|
+
- [code-infra] Include cherry-picks in the changelog (#49375) @brijeshb42
|
|
132
|
+
- [code-infra] Mark the Argos reference branch for release branch cuts (#49317) @Janpot
|
|
133
|
+
- [code-infra] Migrate to Babel 8 (#49162) @brijeshb42
|
|
134
|
+
- [code-infra] Pin the only-allow version in the preinstall hook (#49114) @Janpot
|
|
135
|
+
- [code-infra] Prune stale `minimumReleaseAgeExclude` entries (#49178) @Janpot
|
|
136
|
+
- [code-infra] Remove the legacy mark-duplicate workflow (#49363) @brijeshb42
|
|
137
|
+
- [code-infra] Run TypeScript 7 alongside the TS6 JS API (#49075) @brijeshb42
|
|
138
|
+
- [code-infra] Ship documentation Markdown inside the @mui/material package (#48722) @Janpot
|
|
139
|
+
- [code-infra] Show progress and rate limit retry time in `release:changelog` (#49376) @Janpot
|
|
140
|
+
- [code-infra] Update deprecated options in the Vitest test configuration (#49193) @ZeeshanTamboli
|
|
141
|
+
- [code-infra] Widen @babel/runtime range and stop emitting empty class fields (#49241) @brijeshb42
|
|
142
|
+
- [core] Remove the leftover canary release script (#49163) @Janpot
|
|
143
|
+
- [core] Replace @mui/internal-waterfall with es-toolkit (#49155) @Janpot
|
|
144
|
+
- [docs-infra] Derive accessibility report data from defaults and tests (#49271) @JCQuintas
|
|
145
|
+
- [docs-infra] Generate the accessibility Known gaps table (#49265) @michelengelen
|
|
146
|
+
- [docs-infra] Harden the OG image edge function (#49116) @Janpot
|
|
147
|
+
- [docs-infra] Keep generated LLM docs on filtered runs (#49290) @Janpot
|
|
148
|
+
- [docs-infra] Make core-docs agnostic of styled-components (#49138) @Janpot
|
|
149
|
+
- [docs-infra] Migrate deploy-succeeded to event-triggered function (#49158) @brijeshb42
|
|
150
|
+
- [docs-infra] Pin StackBlitz demo vite to v7 and plugin-react to v5 (#49151) @Janpot
|
|
151
|
+
- [docs-infra] Rate-limit the documentation feedback endpoint (#49115) @Janpot
|
|
152
|
+
- [docs-infra] Retire the docs service worker (#49188) @Janpot
|
|
153
|
+
- [docs-infra] Use JSON as the source of truth for the accessibility reports (#49270) @michelengelen
|
|
154
|
+
- [docs-infra] Validate docs feedback content before posting to Slack (#49088) @Janpot
|
|
155
|
+
- [internal] Prepare master for the alpha release (#49284) @silviuaavram
|
|
156
|
+
- [material] Convert colors to TypeScript (#49180) @Janpot
|
|
157
|
+
- [material] Convert utils and six barrels to TypeScript (#49185) @Janpot
|
|
158
|
+
- [test] Add a palette contrast contract for the accessibility reports (#49049) @michelengelen
|
|
159
|
+
- [test] Add a visual regression fixture for the DocSearch modal (#49002) @LukasTy
|
|
160
|
+
- [test] Automate WCAG 2.4.7 Focus Visible checks (#48945) @michelengelen
|
|
161
|
+
- [test] Fix flaky DocSearch modal screenshots (#49122) @LukasTy
|
|
162
|
+
- [test] Fix Vitest imports (#49184) @silviuaavram
|
|
163
|
+
- [test] Load the regression fonts from npm instead of Google Fonts (#49310) @Janpot
|
|
164
|
+
- [test] Make regression screenshot rasterization deterministic (#49208) @Janpot
|
|
165
|
+
- [test] Roll the component reports up into a library scorecard (#48925) @michelengelen
|
|
166
|
+
- [test] Run module augmentation tests against built declarations (#49142) @LukasTy
|
|
167
|
+
- [test][accordion] Add axe tests and WCAG conformance reports (#48924) @michelengelen
|
|
168
|
+
- [test][avatar] Add axe tests and WCAG conformance report (#48917) @michelengelen
|
|
169
|
+
- [test][avatar] Move the accessibility fixture to the fixture tree (#49087) @michelengelen
|
|
170
|
+
- [test][button] Add axe test coverage and WCAG conformance report (#48916) @michelengelen
|
|
171
|
+
- [test][checkbox] Add axe tests and WCAG conformance report (#48918) @michelengelen
|
|
172
|
+
- [test][docs-infra] Reduce timing dependencies in the cookie consent test (#49154) @LukasTy
|
|
173
|
+
- [test][linearprogress] Add axe tests and WCAG conformance report (#48922) @michelengelen
|
|
174
|
+
- [test][pagination] Add tests for zero boundary and sibling counts (#49118) @Janpot
|
|
175
|
+
- [test][radio] Add axe tests and WCAG conformance reports (#48920) @michelengelen
|
|
176
|
+
- [test][switch] Add axe tests and WCAG conformance report (#48919) @michelengelen
|
|
177
|
+
- [test][textfield] Add axe tests and WCAG conformance report (#48923) @michelengelen
|
|
178
|
+
- [test][togglebutton] Add axe tests and WCAG conformance reports (#48921) @michelengelen
|
|
179
|
+
|
|
180
|
+
All contributors of this release in alphabetical order: @aarongarciah, @alexfauquette, @brijeshb42, @crispinc-omnea, @Cunninger, @Denimworld12, @dizhurnikita, @itd-mb, @Janpot, @JCQuintas, @kwy404, @lazerg, @LeusMaximus, @ludij, @LukasTy, @mateuseap, @michelengelen, @minwookshin, @mj12albert, @namansancheti, @oliviertassinari, @OskarEichler, @sai6855, @silviuaavram, @siriwatknp, @starboyvarun, @usamabhatti1998, @valkiara, @webernir, @ZeeshanTamboli
|
|
181
|
+
|
|
3
182
|
## 9.4.0
|
|
4
183
|
|
|
5
184
|
<!-- generated comparing v9.3.1..master -->
|
|
@@ -46,7 +46,7 @@ function elementTypeAcceptingRef(props, propName, componentName, location, propF
|
|
|
46
46
|
}
|
|
47
47
|
if (warningHint !== undefined) {
|
|
48
48
|
// #host-reference
|
|
49
|
-
return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. ` + `Expected an element type that can hold a ref. ${warningHint} ` + 'For more information see https://mui.com/r/caveat-with-refs-guide');
|
|
49
|
+
return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. ` + `Expected an element type that can hold a ref. ${warningHint} ` + 'For more information see https://next.mui.com/r/caveat-with-refs-guide');
|
|
50
50
|
}
|
|
51
51
|
return null;
|
|
52
52
|
}
|
|
@@ -38,7 +38,7 @@ function elementTypeAcceptingRef(props, propName, componentName, location, propF
|
|
|
38
38
|
}
|
|
39
39
|
if (warningHint !== undefined) {
|
|
40
40
|
// #host-reference
|
|
41
|
-
return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. ` + `Expected an element type that can hold a ref. ${warningHint} ` + 'For more information see https://mui.com/r/caveat-with-refs-guide');
|
|
41
|
+
return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. ` + `Expected an element type that can hold a ref. ${warningHint} ` + 'For more information see https://next.mui.com/r/caveat-with-refs-guide');
|
|
42
42
|
}
|
|
43
43
|
return null;
|
|
44
44
|
}
|
|
@@ -17,9 +17,11 @@ function extractEventHandlers(object) {
|
|
|
17
17
|
return {};
|
|
18
18
|
}
|
|
19
19
|
const result = {};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const keys = Object.keys(object);
|
|
21
|
+
for (let i = 0; i < keys.length; i += 1) {
|
|
22
|
+
const key = keys[i];
|
|
23
|
+
if ((0, _isEventHandler.default)(key, object[key])) {
|
|
24
|
+
result[key] = object[key];
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
27
|
return result;
|
|
@@ -10,9 +10,11 @@ function extractEventHandlers(object) {
|
|
|
10
10
|
return {};
|
|
11
11
|
}
|
|
12
12
|
const result = {};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const keys = Object.keys(object);
|
|
14
|
+
for (let i = 0; i < keys.length; i += 1) {
|
|
15
|
+
const key = keys[i];
|
|
16
|
+
if (isEventHandler(key, object[key])) {
|
|
17
|
+
result[key] = object[key];
|
|
16
18
|
}
|
|
17
19
|
}
|
|
18
20
|
return result;
|
package/index.js
CHANGED
package/index.mjs
CHANGED
|
@@ -33,11 +33,6 @@ function mergeSlotProps(parameters) {
|
|
|
33
33
|
// The simpler case - getSlotProps is not defined, so no internal event handlers are defined,
|
|
34
34
|
// so we can simply merge all the props without having to worry about extracting event handlers.
|
|
35
35
|
const joinedClasses = (0, _clsx.default)(additionalProps?.className, className, externalForwardedProps?.className, externalSlotProps?.className);
|
|
36
|
-
const mergedStyle = {
|
|
37
|
-
...additionalProps?.style,
|
|
38
|
-
...externalForwardedProps?.style,
|
|
39
|
-
...externalSlotProps?.style
|
|
40
|
-
};
|
|
41
36
|
const props = {
|
|
42
37
|
...additionalProps,
|
|
43
38
|
...externalForwardedProps,
|
|
@@ -46,8 +41,15 @@ function mergeSlotProps(parameters) {
|
|
|
46
41
|
if (joinedClasses.length > 0) {
|
|
47
42
|
props.className = joinedClasses;
|
|
48
43
|
}
|
|
49
|
-
if (
|
|
50
|
-
|
|
44
|
+
if (additionalProps?.style || externalForwardedProps?.style || externalSlotProps?.style) {
|
|
45
|
+
const mergedStyle = {
|
|
46
|
+
...additionalProps?.style,
|
|
47
|
+
...externalForwardedProps?.style,
|
|
48
|
+
...externalSlotProps?.style
|
|
49
|
+
};
|
|
50
|
+
if (Object.keys(mergedStyle).length > 0) {
|
|
51
|
+
props.style = mergedStyle;
|
|
52
|
+
}
|
|
51
53
|
}
|
|
52
54
|
return {
|
|
53
55
|
props,
|
|
@@ -71,12 +73,6 @@ function mergeSlotProps(parameters) {
|
|
|
71
73
|
// to properly override style. It requires the most important classes to be last
|
|
72
74
|
// (see https://github.com/mui/material-ui/pull/33205) for the related discussion.
|
|
73
75
|
const joinedClasses = (0, _clsx.default)(internalSlotProps?.className, additionalProps?.className, className, externalForwardedProps?.className, externalSlotProps?.className);
|
|
74
|
-
const mergedStyle = {
|
|
75
|
-
...internalSlotProps?.style,
|
|
76
|
-
...additionalProps?.style,
|
|
77
|
-
...externalForwardedProps?.style,
|
|
78
|
-
...externalSlotProps?.style
|
|
79
|
-
};
|
|
80
76
|
const props = {
|
|
81
77
|
...internalSlotProps,
|
|
82
78
|
...additionalProps,
|
|
@@ -86,8 +82,16 @@ function mergeSlotProps(parameters) {
|
|
|
86
82
|
if (joinedClasses.length > 0) {
|
|
87
83
|
props.className = joinedClasses;
|
|
88
84
|
}
|
|
89
|
-
if (
|
|
90
|
-
|
|
85
|
+
if (internalSlotProps?.style || additionalProps?.style || externalForwardedProps?.style || externalSlotProps?.style) {
|
|
86
|
+
const mergedStyle = {
|
|
87
|
+
...internalSlotProps?.style,
|
|
88
|
+
...additionalProps?.style,
|
|
89
|
+
...externalForwardedProps?.style,
|
|
90
|
+
...externalSlotProps?.style
|
|
91
|
+
};
|
|
92
|
+
if (Object.keys(mergedStyle).length > 0) {
|
|
93
|
+
props.style = mergedStyle;
|
|
94
|
+
}
|
|
91
95
|
}
|
|
92
96
|
return {
|
|
93
97
|
props,
|
|
@@ -26,11 +26,6 @@ function mergeSlotProps(parameters) {
|
|
|
26
26
|
// The simpler case - getSlotProps is not defined, so no internal event handlers are defined,
|
|
27
27
|
// so we can simply merge all the props without having to worry about extracting event handlers.
|
|
28
28
|
const joinedClasses = clsx(additionalProps?.className, className, externalForwardedProps?.className, externalSlotProps?.className);
|
|
29
|
-
const mergedStyle = {
|
|
30
|
-
...additionalProps?.style,
|
|
31
|
-
...externalForwardedProps?.style,
|
|
32
|
-
...externalSlotProps?.style
|
|
33
|
-
};
|
|
34
29
|
const props = {
|
|
35
30
|
...additionalProps,
|
|
36
31
|
...externalForwardedProps,
|
|
@@ -39,8 +34,15 @@ function mergeSlotProps(parameters) {
|
|
|
39
34
|
if (joinedClasses.length > 0) {
|
|
40
35
|
props.className = joinedClasses;
|
|
41
36
|
}
|
|
42
|
-
if (
|
|
43
|
-
|
|
37
|
+
if (additionalProps?.style || externalForwardedProps?.style || externalSlotProps?.style) {
|
|
38
|
+
const mergedStyle = {
|
|
39
|
+
...additionalProps?.style,
|
|
40
|
+
...externalForwardedProps?.style,
|
|
41
|
+
...externalSlotProps?.style
|
|
42
|
+
};
|
|
43
|
+
if (Object.keys(mergedStyle).length > 0) {
|
|
44
|
+
props.style = mergedStyle;
|
|
45
|
+
}
|
|
44
46
|
}
|
|
45
47
|
return {
|
|
46
48
|
props,
|
|
@@ -64,12 +66,6 @@ function mergeSlotProps(parameters) {
|
|
|
64
66
|
// to properly override style. It requires the most important classes to be last
|
|
65
67
|
// (see https://github.com/mui/material-ui/pull/33205) for the related discussion.
|
|
66
68
|
const joinedClasses = clsx(internalSlotProps?.className, additionalProps?.className, className, externalForwardedProps?.className, externalSlotProps?.className);
|
|
67
|
-
const mergedStyle = {
|
|
68
|
-
...internalSlotProps?.style,
|
|
69
|
-
...additionalProps?.style,
|
|
70
|
-
...externalForwardedProps?.style,
|
|
71
|
-
...externalSlotProps?.style
|
|
72
|
-
};
|
|
73
69
|
const props = {
|
|
74
70
|
...internalSlotProps,
|
|
75
71
|
...additionalProps,
|
|
@@ -79,8 +75,16 @@ function mergeSlotProps(parameters) {
|
|
|
79
75
|
if (joinedClasses.length > 0) {
|
|
80
76
|
props.className = joinedClasses;
|
|
81
77
|
}
|
|
82
|
-
if (
|
|
83
|
-
|
|
78
|
+
if (internalSlotProps?.style || additionalProps?.style || externalForwardedProps?.style || externalSlotProps?.style) {
|
|
79
|
+
const mergedStyle = {
|
|
80
|
+
...internalSlotProps?.style,
|
|
81
|
+
...additionalProps?.style,
|
|
82
|
+
...externalForwardedProps?.style,
|
|
83
|
+
...externalSlotProps?.style
|
|
84
|
+
};
|
|
85
|
+
if (Object.keys(mergedStyle).length > 0) {
|
|
86
|
+
props.style = mergedStyle;
|
|
87
|
+
}
|
|
84
88
|
}
|
|
85
89
|
return {
|
|
86
90
|
props,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = void 0;
|
|
8
|
+
var _isEventHandler = _interopRequireDefault(require("../isEventHandler"));
|
|
7
9
|
/**
|
|
8
10
|
* Removes event handlers from the given object.
|
|
9
11
|
* A field is considered an event handler if it is a function with a name beginning with `on`.
|
|
@@ -16,9 +18,13 @@ function omitEventHandlers(object) {
|
|
|
16
18
|
return {};
|
|
17
19
|
}
|
|
18
20
|
const result = {};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
const keys = Object.keys(object);
|
|
22
|
+
for (let i = 0; i < keys.length; i += 1) {
|
|
23
|
+
const key = keys[i];
|
|
24
|
+
if (!(0, _isEventHandler.default)(key, object[key])) {
|
|
25
|
+
result[key] = object[key];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
22
28
|
return result;
|
|
23
29
|
}
|
|
24
30
|
var _default = exports.default = omitEventHandlers;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import isEventHandler from "../isEventHandler/index.mjs";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Removes event handlers from the given object.
|
|
3
5
|
* A field is considered an event handler if it is a function with a name beginning with `on`.
|
|
@@ -10,9 +12,13 @@ function omitEventHandlers(object) {
|
|
|
10
12
|
return {};
|
|
11
13
|
}
|
|
12
14
|
const result = {};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
const keys = Object.keys(object);
|
|
16
|
+
for (let i = 0; i < keys.length; i += 1) {
|
|
17
|
+
const key = keys[i];
|
|
18
|
+
if (!isEventHandler(key, object[key])) {
|
|
19
|
+
result[key] = object[key];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
16
22
|
return result;
|
|
17
23
|
}
|
|
18
24
|
export default omitEventHandlers;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0-alpha.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "Utility functions for React components.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"url": "https://opencollective.com/mui-org"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@babel/runtime": "^7.29.7",
|
|
27
|
+
"@babel/runtime": "^7.29.7 || ^8.0.5",
|
|
28
|
+
"@mui/types": "^10.0.0-alpha.0",
|
|
28
29
|
"@types/prop-types": "^15.7.15",
|
|
29
30
|
"clsx": "^2.1.1",
|
|
30
31
|
"prop-types": "^15.8.1",
|
|
31
|
-
"react-is": "^19.
|
|
32
|
-
"@mui/types": "^9.4.0"
|
|
32
|
+
"react-is": "^19.3.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
@@ -2,5 +2,9 @@
|
|
|
2
2
|
* If `componentProps` is a function, calls it with the provided `ownerState`.
|
|
3
3
|
* Otherwise, just returns `componentProps`.
|
|
4
4
|
*/
|
|
5
|
-
declare function resolveComponentProps<TProps, TOwnerState, TSlotState>(componentProps: TProps | ((ownerState: TOwnerState, slotState?: TSlotState) => TProps) | undefined, ownerState: TOwnerState,
|
|
5
|
+
declare function resolveComponentProps<TProps, TOwnerState, TSlotState>(componentProps: TProps | ((ownerState: TOwnerState, slotState?: TSlotState) => TProps) | undefined, ownerState: TOwnerState,
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Not used internally and will be removed in the next major version.
|
|
8
|
+
*/
|
|
9
|
+
slotState?: TSlotState): TProps | undefined;
|
|
6
10
|
export default resolveComponentProps;
|
|
@@ -2,5 +2,9 @@
|
|
|
2
2
|
* If `componentProps` is a function, calls it with the provided `ownerState`.
|
|
3
3
|
* Otherwise, just returns `componentProps`.
|
|
4
4
|
*/
|
|
5
|
-
declare function resolveComponentProps<TProps, TOwnerState, TSlotState>(componentProps: TProps | ((ownerState: TOwnerState, slotState?: TSlotState) => TProps) | undefined, ownerState: TOwnerState,
|
|
5
|
+
declare function resolveComponentProps<TProps, TOwnerState, TSlotState>(componentProps: TProps | ((ownerState: TOwnerState, slotState?: TSlotState) => TProps) | undefined, ownerState: TOwnerState,
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Not used internally and will be removed in the next major version.
|
|
8
|
+
*/
|
|
9
|
+
slotState?: TSlotState): TProps | undefined;
|
|
6
10
|
export default resolveComponentProps;
|
|
@@ -8,7 +8,11 @@ exports.default = void 0;
|
|
|
8
8
|
* If `componentProps` is a function, calls it with the provided `ownerState`.
|
|
9
9
|
* Otherwise, just returns `componentProps`.
|
|
10
10
|
*/
|
|
11
|
-
function resolveComponentProps(componentProps, ownerState,
|
|
11
|
+
function resolveComponentProps(componentProps, ownerState,
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Not used internally and will be removed in the next major version.
|
|
14
|
+
*/
|
|
15
|
+
slotState) {
|
|
12
16
|
if (typeof componentProps === 'function') {
|
|
13
17
|
return componentProps(ownerState, slotState);
|
|
14
18
|
}
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
* If `componentProps` is a function, calls it with the provided `ownerState`.
|
|
3
3
|
* Otherwise, just returns `componentProps`.
|
|
4
4
|
*/
|
|
5
|
-
function resolveComponentProps(componentProps, ownerState,
|
|
5
|
+
function resolveComponentProps(componentProps, ownerState,
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Not used internally and will be removed in the next major version.
|
|
8
|
+
*/
|
|
9
|
+
slotState) {
|
|
6
10
|
if (typeof componentProps === 'function') {
|
|
7
11
|
return componentProps(ownerState, slotState);
|
|
8
12
|
}
|
|
@@ -42,4 +42,4 @@ export interface DataAttributesOverrides {}
|
|
|
42
42
|
* index signature themselves, while object literals can pick up the widened
|
|
43
43
|
* branch and include the augmented keys.
|
|
44
44
|
*/
|
|
45
|
-
export type WithDataAttributes<T> = T |
|
|
45
|
+
export type WithDataAttributes<T> = T | T & DataAttributesOverrides;
|
|
@@ -42,4 +42,4 @@ export interface DataAttributesOverrides {}
|
|
|
42
42
|
* index signature themselves, while object literals can pick up the widened
|
|
43
43
|
* branch and include the augmented keys.
|
|
44
44
|
*/
|
|
45
|
-
export type WithDataAttributes<T> = T |
|
|
45
|
+
export type WithDataAttributes<T> = T | T & DataAttributesOverrides;
|