@mui/utils 5.15.3 → 5.15.5
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 +184 -1
- package/clamp/clamp.d.ts +2 -0
- package/clamp/clamp.js +10 -0
- package/clamp/index.d.ts +1 -0
- package/clamp/index.js +13 -0
- package/clamp/package.json +6 -0
- package/deepmerge.js +6 -1
- package/esm/clamp/clamp.js +4 -0
- package/esm/clamp/index.js +1 -0
- package/esm/deepmerge.js +6 -1
- package/esm/generateUtilityClass/generateUtilityClass.js +5 -6
- package/esm/index.js +3 -1
- package/generateUtilityClass/generateUtilityClass.d.ts +16 -1
- package/generateUtilityClass/generateUtilityClass.js +7 -5
- package/index.d.ts +2 -0
- package/index.js +17 -2
- package/legacy/clamp/clamp.js +6 -0
- package/legacy/clamp/index.js +1 -0
- package/legacy/deepmerge.js +6 -1
- package/legacy/generateUtilityClass/generateUtilityClass.js +5 -6
- package/legacy/index.js +4 -2
- package/modern/clamp/clamp.js +4 -0
- package/modern/clamp/index.js +1 -0
- package/modern/deepmerge.js +6 -1
- package/modern/generateUtilityClass/generateUtilityClass.js +5 -6
- package/modern/index.js +4 -2
- package/package.json +4 -3
- package/useEventCallback/useEventCallback.spec.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,188 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## v5.15.5
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v5.15.4..master -->
|
|
6
|
+
|
|
7
|
+
_Jan 17, 2024_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 18 contributors who made this release possible. Here are some highlights ✨:
|
|
10
|
+
|
|
11
|
+
- Base UI's CSS class prefix is now `base-` (#40205) @michaldudak
|
|
12
|
+
- Bug fixes, and a lot of improvements to code and docs infra
|
|
13
|
+
|
|
14
|
+
### `@mui/material@5.15.5`
|
|
15
|
+
|
|
16
|
+
- ​<!-- 42 -->[Accordion] Deprecate \*Props props and classes for v6 (#40418) @DiegoAndai
|
|
17
|
+
- ​<!-- 41 -->[Alert] Update TypeScript types to allow color override types to be added to `iconMapping` and `severity` props (#40551) @2metres
|
|
18
|
+
- ​<!-- 27 -->[Dialog] Remove deprecated onBackdropClick from Dialog tests (#40505) @sai6855
|
|
19
|
+
- ​<!-- 26 -->[Divider] Deprecate props and classes for v6 (#40563) @sai6855
|
|
20
|
+
|
|
21
|
+
### `@mui/material-next@6.0.0-alpha.118`
|
|
22
|
+
|
|
23
|
+
- ​<!-- 36 -->[ButtonGroup] Apply MD3 style to `ButtonGroup` (#40124) @lhilgert9
|
|
24
|
+
|
|
25
|
+
### `@mui/base@5.0.0-beta.32`
|
|
26
|
+
|
|
27
|
+
#### Breaking changes
|
|
28
|
+
|
|
29
|
+
- ​<!-- 40 -->Change the CSS class prefix to `base-` (#40205) @michaldudak
|
|
30
|
+
|
|
31
|
+
The class prefix of Base UI components have been changed from `Mui-` to `base-`. This only affects codebases that uses class names verbatim, i.e. not exposed by JS objects such as `buttonClasses`, but as plain strings or in CSS stylesheets (`.MuiButton.root`)
|
|
32
|
+
|
|
33
|
+
To adapt your code to the new pattern:
|
|
34
|
+
|
|
35
|
+
- replace all occurrences of the regex `.Mui([A-Z][A-Za-z]*)-` with `.base-$1-` (so `MuiButton-root` becomes `base-Button-root`, etc.),
|
|
36
|
+
- replace all occurrences of the regex `.Mui-([a-z]*)` with `.base--$1` (so `Mui-disabled` becomes `base--disabled`, etc.).
|
|
37
|
+
|
|
38
|
+
#### Changes
|
|
39
|
+
|
|
40
|
+
- ​<!-- 39 -->[Select] Fix screen-reader CSS to avoid body scrollbar (#40599) @brijeshb42
|
|
41
|
+
- ​<!-- 38 -->[Switch] Add border-box to demos (#40638) @zanivan
|
|
42
|
+
|
|
43
|
+
### `@mui/joy@5.0.0-beta.23`
|
|
44
|
+
|
|
45
|
+
- ​<!-- 11 -->[ModalDialog] Fix ModalDialog layout prop override (#40512) @maakcode
|
|
46
|
+
- ​<!-- 10 -->[RadioGroup] Allow zero number as a value (#40344) @aacevski
|
|
47
|
+
|
|
48
|
+
### `@mui/codemod@5.15.5`
|
|
49
|
+
|
|
50
|
+
- ​<!-- 31 -->Allow `json` files to be transformed (#40536) @ZeeshanTamboli
|
|
51
|
+
|
|
52
|
+
### `@mui/lab@5.0.0-alpha.161`
|
|
53
|
+
|
|
54
|
+
- ​<!-- 09 -->Update `@mui/material` peer dependency version (#40528) @ZeeshanTamboli
|
|
55
|
+
|
|
56
|
+
### `@mui/material-nextjs@5.15.5`
|
|
57
|
+
|
|
58
|
+
- ​<!-- 08 -->Fix release script (#40519) @petrovmiroslav
|
|
59
|
+
- ​<!-- 07 -->Support Nonces in the App Router Provider (#40269) @josh-feldman
|
|
60
|
+
- ​<!-- 06 -->Polish @mui/material-nextjs (#40473) @oliviertassinari
|
|
61
|
+
|
|
62
|
+
### `@mui/system@5.15.5`
|
|
63
|
+
|
|
64
|
+
- ​<!-- 05 -->Fix import path for @mui/system in vite apps (#40490) @brijeshb42
|
|
65
|
+
- ​<!-- 02 -->Fix css vars generation and simplify the code (#40530) @siriwatknp
|
|
66
|
+
- ​<!-- 01 -->Identify zero runtime styled path (#40555) @brijeshb42
|
|
67
|
+
|
|
68
|
+
### Docs
|
|
69
|
+
|
|
70
|
+
- ​<!-- 35 -->[joy-ui][Card] Fix text alignment in horizontal aligned card demo (#40562) @ZeeshanTamboli
|
|
71
|
+
- ​<!-- 25 -->Improve instructions about peer dependencies (#40621) @danilo-leal
|
|
72
|
+
- ​<!-- 24 -->Solve page description length @oliviertassinari
|
|
73
|
+
- ​<!-- 23 -->Fix MUI Treasury links (#40561) @siriwatknp
|
|
74
|
+
- ​<!-- 17 -->[material-ui] Update <ListItem button/> to ListItemButton in demos (#40564) @sai6855
|
|
75
|
+
- ​<!-- 16 -->[material-ui] Revise the Snackbar page (#39298) @danilo-leal
|
|
76
|
+
- ​<!-- 15 -->[material-ui] Sharpen Material 3 copy on demo pages (#40546) @samuelsycamore
|
|
77
|
+
- ​<!-- 14 -->[material-ui] Fix typo on Next.js integration guide (#40538) @zanivan
|
|
78
|
+
- ​<!-- 13 -->[material-ui][Snackbar] Remove unused `State` interface from Consecutive Snackbars demo (#40410)
|
|
79
|
+
@zinoroman
|
|
80
|
+
- ​<!-- 12 -->[website] Resolve broken links reported by `docs:link-check` (#40547) @samuelsycamore
|
|
81
|
+
|
|
82
|
+
### Core
|
|
83
|
+
|
|
84
|
+
- ​<!-- 37 -->[blog] Fix 404 link to MUI Treasury @oliviertassinari
|
|
85
|
+
- ​<!-- 34 -->[code-infra] Add `run` command to deploy docs (#40513) @siriwatknp
|
|
86
|
+
- ​<!-- 32 -->[core] Update the lockfile (#40628) @michaldudak
|
|
87
|
+
- ​<!-- 31 -->[core] Remove dead code and follow standard @oliviertassinari
|
|
88
|
+
- ​<!-- 30 -->[core] Simplify server detection (#40471) @oliviertassinari
|
|
89
|
+
- ​<!-- 29 -->[core] Sync playwright cache between MUI X and Material UI (#40475) @oliviertassinari
|
|
90
|
+
- ​<!-- 28 -->[dependencies] Bump tough-cookie (#40437) @michaldudak
|
|
91
|
+
- ​<!-- 22 -->[docs-infra] Enforce brand name rules (#40525) @oliviertassinari
|
|
92
|
+
- ​<!-- 21 -->[docs-infra] Minimize ad layout shift on mobile (#40582) @oliviertassinari
|
|
93
|
+
- ​<!-- 20 -->[docs-infra] Improve API page deprecation info (#40440) @DiegoAndai
|
|
94
|
+
- ​<!-- 19 -->[docs-infra] Remove old tocs banners (#40537) @oliviertassinari
|
|
95
|
+
- ​<!-- 18 -->[docs-infra] Remove dead code aria-label sponsors (#40526) @oliviertassinari
|
|
96
|
+
- ​<!-- 04 -->[utils] Centralize clamp implementation in utils (#40267) @Kamino0
|
|
97
|
+
- ​<!-- 03 -->[website] Polish the Base UI page demos (#40504) @danilo-leal
|
|
98
|
+
|
|
99
|
+
All contributors of this release in alphabetical order: @2metres, @aacevski, @brijeshb42, @danilo-leal, @DiegoAndai, @josh-feldman, @Kamino0, @lhilgert9, @maakcode, @michaldudak, @oliviertassinari, @petrovmiroslav, @sai6855, @samuelsycamore, @siriwatknp, @zanivan, @ZeeshanTamboli, @zinoroman
|
|
100
|
+
|
|
101
|
+
## 5.15.4
|
|
102
|
+
|
|
103
|
+
<!-- generated comparing v5.15.3..master -->
|
|
104
|
+
|
|
105
|
+
_Jan 10, 2024_
|
|
106
|
+
|
|
107
|
+
A big thanks to the 22 contributors who made this release possible. Here are some highlights:
|
|
108
|
+
|
|
109
|
+
- ✨ Material UI's [ToggleButtonGroup](https://mui.com/material-ui/react-toggle-button/) now supports non-button element as a child (e.g., showing a Tooltip on a disabled ToggleButton) (#40220) @Methuselah96
|
|
110
|
+
|
|
111
|
+
### `@mui/material@5.15.4`
|
|
112
|
+
|
|
113
|
+
- [TextField][FormLabel][InputLabel][FormControl] Use exact children type to allow React children type augmentation (#38872) @nicegamer7
|
|
114
|
+
- [Select] Add form submission regression test (#40176) @mj12albert
|
|
115
|
+
- [ToggleButtonGroup] Support different elements under it (#40220) @Methuselah96
|
|
116
|
+
- [ClickAwayListener] Fix export of types (#40485) @illume
|
|
117
|
+
|
|
118
|
+
### `@mui/material-nextjs@5.15.4`
|
|
119
|
+
|
|
120
|
+
- Improve build size issue (#40436) @siriwatknp
|
|
121
|
+
|
|
122
|
+
### `@mui/icons-material@5.15.4`
|
|
123
|
+
|
|
124
|
+
- Update the icons (#40365) @michaldudak
|
|
125
|
+
|
|
126
|
+
### `@mui/system@5.15.4`
|
|
127
|
+
|
|
128
|
+
- [zero] Move zero runtime related packages (#40426) @brijeshb42
|
|
129
|
+
- Fix all use of styled(Box) (#40449) @oliviertassinari
|
|
130
|
+
|
|
131
|
+
### `@mui/utils@5.15.4`
|
|
132
|
+
|
|
133
|
+
- Fix `isPlainObject` to work across realm (#39981) @brijeshb42
|
|
134
|
+
|
|
135
|
+
### `@mui/base@5.0.0-beta.31`
|
|
136
|
+
|
|
137
|
+
- [base-ui][NumberInput] Remove inputId and inputRef types from NumberInput component (#40425) @sai6855
|
|
138
|
+
|
|
139
|
+
### `@mui/joy@5.0.0-beta.22`
|
|
140
|
+
|
|
141
|
+
- [Badge] Shouldn't crash when using custom size (#39986) @iamsaumya
|
|
142
|
+
- [ToggleButtonGroup] Add `JoyToggleButtonGroup` to extendTheme's components type export (#40407) @RiceCrisp
|
|
143
|
+
|
|
144
|
+
### Docs
|
|
145
|
+
|
|
146
|
+
- [base-ui] Visual tweaks to the plain CSS theme stylesheet (#40487) @zanivan
|
|
147
|
+
- [base-ui] Add tokens to plain CSS theme stylesheet (#40113) @zanivan
|
|
148
|
+
- [base-ui] Update the overview page (#40412) @danilo-leal
|
|
149
|
+
- [material-ui][Drawer] Resolve flickering when double-clicking on the backdrop to close it (#40343) @aacevski
|
|
150
|
+
- [material-ui] Refactor form submission in FormDialog component (#40470) @sai6855
|
|
151
|
+
- [material-ui] Replace recharts with MUI X charts on the Dashboard template (#40107) @alexfauquette
|
|
152
|
+
- [material-ui] Revise the Alert demo page (#34892) @samuelsycamore
|
|
153
|
+
- [material-ui] Revise the Accordion page (#40284) @anle9650
|
|
154
|
+
- [material-ui] Add docs for complementary Card components (#40346) @anle9650
|
|
155
|
+
- [material-ui] Add Material 3 components page (#40350) @DiegoAndai
|
|
156
|
+
- Fix strange italic style @oliviertassinari
|
|
157
|
+
- Fix references to ESLint @oliviertassinari
|
|
158
|
+
- Fix 301 redirections @oliviertassinari
|
|
159
|
+
- Right-to-left revision and addition to Joy UI (#39158) @danilo-leal
|
|
160
|
+
|
|
161
|
+
### Core
|
|
162
|
+
|
|
163
|
+
- [examples] Use material-nextjs integration package (#40199) @siriwatknp
|
|
164
|
+
- [code-infra] Configure build dependencies in nx (#40482) @michaldudak
|
|
165
|
+
- [code-infra] Don't require noreferrer on target link (#40447) @oliviertassinari
|
|
166
|
+
- [code-infra] Use tsx instead of ts-node (#40428) @michaldudak
|
|
167
|
+
- [code-infra] Add options to docs-api generation to support X code structure (#40111) @alexfauquette
|
|
168
|
+
- [docs-infra] Add types for withDocsInfra (#40301) @oliviertassinari
|
|
169
|
+
- [docs-infra] Fix anchor links in API pages (#40450) @oliviertassinari
|
|
170
|
+
- [docs-infra] Fix API table full-width (#40476) @oliviertassinari
|
|
171
|
+
- [docs-infra] Fix the copy button overlapping with the scrollbar (#40405) @danilo-leal
|
|
172
|
+
- [docs-infra] Remove explicit `mui-x` dependency resolving (#40257) @LukasTy
|
|
173
|
+
- [docs-infra] Update the outlined Demo container dark mode color (#40488) @danilo-leal
|
|
174
|
+
- [core] Lock file maintenance (#34538) @renovate[bot]
|
|
175
|
+
- [core] Remove duplicate devDependencies (#40438) @michaldudak
|
|
176
|
+
- [core] Remove issue emoji @oliviertassinari
|
|
177
|
+
- [core] Move prefetch at the core, will propagate to MUI X @oliviertassinari
|
|
178
|
+
- [core] Change package manager to pnpm (#36287) @Janpot
|
|
179
|
+
- [core][docs] Remove the "Understand MUI packages" page (#39835) @savalaram-redkar
|
|
180
|
+
- [website] Evolve the Developer Advocate role (#40337) @oliviertassinari
|
|
181
|
+
- [website] Fix default social card @oliviertassinari
|
|
182
|
+
- [test] Restore the `t` command (#40430) @michaldudak
|
|
183
|
+
|
|
184
|
+
All contributors of this release in alphabetical order: @aacevski, @alexfauquette, @anle9650, @brijeshb42, @danilo-leal, @DiegoAndai, @iamsaumya, @illume, @Janpot, @LukasTy, @Methuselah96, @michaldudak, @mj12albert, @nicegamer7, @oliviertassinari, @renovate[bot], @RiceCrisp, @sai6855, @samuelsycamore, @savalaram-redkar, @siriwatknp, @zanivan
|
|
185
|
+
|
|
3
186
|
## 5.15.3
|
|
4
187
|
|
|
5
188
|
<!-- generated comparing v5.15.2..master -->
|
|
@@ -12480,7 +12663,7 @@ Here are some highlights ✨:
|
|
|
12480
12663
|
|
|
12481
12664
|
- 👩🎨 A first iteration on the new styling solution.
|
|
12482
12665
|
|
|
12483
|
-
You can find a [new version](https://mui.com/components/slider-styled/) of the slider in the lab powered by [
|
|
12666
|
+
You can find a [new version](https://mui.com/components/slider-styled/) of the slider in the lab powered by [Emotion](https://emotion.sh/).
|
|
12484
12667
|
|
|
12485
12668
|
In the event that you are already using styled-components in your application, you can swap emotion for styled-components 💅. Check [this CodeSandbox](https://codesandbox.io/p/sandbox/sliderstyled-with-styled-components-forked-olc27?file=/package.json) for a demo. It relies on aliases to prevent any bundle size overhead.
|
|
12486
12669
|
|
package/clamp/clamp.d.ts
ADDED
package/clamp/clamp.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {
|
|
8
|
+
return Math.max(min, Math.min(val, max));
|
|
9
|
+
}
|
|
10
|
+
var _default = exports.default = clamp;
|
package/clamp/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './clamp';
|
package/clamp/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "default", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _clamp.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _clamp = _interopRequireDefault(require("./clamp"));
|
package/deepmerge.js
CHANGED
|
@@ -7,8 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = deepmerge;
|
|
8
8
|
exports.isPlainObject = isPlainObject;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
// https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
|
|
10
11
|
function isPlainObject(item) {
|
|
11
|
-
|
|
12
|
+
if (typeof item !== 'object' || item === null) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
const prototype = Object.getPrototypeOf(item);
|
|
16
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in item) && !(Symbol.iterator in item);
|
|
12
17
|
}
|
|
13
18
|
function deepClone(source) {
|
|
14
19
|
if (!isPlainObject(source)) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './clamp';
|
package/esm/deepmerge.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
// https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
|
|
2
3
|
export function isPlainObject(item) {
|
|
3
|
-
|
|
4
|
+
if (typeof item !== 'object' || item === null) {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
const prototype = Object.getPrototypeOf(item);
|
|
8
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in item) && !(Symbol.iterator in item);
|
|
4
9
|
}
|
|
5
10
|
function deepClone(source) {
|
|
6
11
|
if (!isPlainObject(source)) {
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import ClassNameGenerator from '../ClassNameGenerator';
|
|
2
|
-
|
|
3
|
-
// If GlobalStateSlot is changed, GLOBAL_STATE_CLASSES in
|
|
4
|
-
// \packages\api-docs-builder\utils\parseSlotsAndClasses.ts must be updated accordingly.
|
|
5
|
-
|
|
6
|
-
const globalStateClassesMapping = {
|
|
2
|
+
export const globalStateClasses = {
|
|
7
3
|
active: 'active',
|
|
8
4
|
checked: 'checked',
|
|
9
5
|
completed: 'completed',
|
|
@@ -18,6 +14,9 @@ const globalStateClassesMapping = {
|
|
|
18
14
|
selected: 'selected'
|
|
19
15
|
};
|
|
20
16
|
export default function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') {
|
|
21
|
-
const globalStateClass =
|
|
17
|
+
const globalStateClass = globalStateClasses[slot];
|
|
22
18
|
return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator.generate(componentName)}-${slot}`;
|
|
19
|
+
}
|
|
20
|
+
export function isGlobalState(slot) {
|
|
21
|
+
return globalStateClasses[slot] !== undefined;
|
|
23
22
|
}
|
package/esm/index.js
CHANGED
|
@@ -36,6 +36,8 @@ export { default as integerPropType } from './integerPropType';
|
|
|
36
36
|
export { default as internal_resolveProps } from './resolveProps';
|
|
37
37
|
export { default as unstable_composeClasses } from './composeClasses';
|
|
38
38
|
export { default as unstable_generateUtilityClass } from './generateUtilityClass';
|
|
39
|
+
export { isGlobalState as unstable_isGlobalState } from './generateUtilityClass';
|
|
39
40
|
export * from './generateUtilityClass';
|
|
40
41
|
export { default as unstable_generateUtilityClasses } from './generateUtilityClasses';
|
|
41
|
-
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator';
|
|
42
|
+
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator';
|
|
43
|
+
export { default as clamp } from './clamp';
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
export type GlobalStateSlot =
|
|
1
|
+
export type GlobalStateSlot = keyof typeof globalStateClasses;
|
|
2
|
+
export declare const globalStateClasses: {
|
|
3
|
+
active: string;
|
|
4
|
+
checked: string;
|
|
5
|
+
completed: string;
|
|
6
|
+
disabled: string;
|
|
7
|
+
error: string;
|
|
8
|
+
expanded: string;
|
|
9
|
+
focused: string;
|
|
10
|
+
focusVisible: string;
|
|
11
|
+
open: string;
|
|
12
|
+
readOnly: string;
|
|
13
|
+
required: string;
|
|
14
|
+
selected: string;
|
|
15
|
+
};
|
|
2
16
|
export default function generateUtilityClass(componentName: string, slot: string, globalStatePrefix?: string): string;
|
|
17
|
+
export declare function isGlobalState(slot: string): boolean;
|
|
@@ -5,11 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = generateUtilityClass;
|
|
8
|
+
exports.globalStateClasses = void 0;
|
|
9
|
+
exports.isGlobalState = isGlobalState;
|
|
8
10
|
var _ClassNameGenerator = _interopRequireDefault(require("../ClassNameGenerator"));
|
|
9
|
-
|
|
10
|
-
// \packages\api-docs-builder\utils\parseSlotsAndClasses.ts must be updated accordingly.
|
|
11
|
-
|
|
12
|
-
const globalStateClassesMapping = {
|
|
11
|
+
const globalStateClasses = exports.globalStateClasses = {
|
|
13
12
|
active: 'active',
|
|
14
13
|
checked: 'checked',
|
|
15
14
|
completed: 'completed',
|
|
@@ -24,6 +23,9 @@ const globalStateClassesMapping = {
|
|
|
24
23
|
selected: 'selected'
|
|
25
24
|
};
|
|
26
25
|
function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') {
|
|
27
|
-
const globalStateClass =
|
|
26
|
+
const globalStateClass = globalStateClasses[slot];
|
|
28
27
|
return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${_ClassNameGenerator.default.generate(componentName)}-${slot}`;
|
|
28
|
+
}
|
|
29
|
+
function isGlobalState(slot) {
|
|
30
|
+
return globalStateClasses[slot] !== undefined;
|
|
29
31
|
}
|
package/index.d.ts
CHANGED
|
@@ -34,6 +34,8 @@ export { default as integerPropType } from './integerPropType';
|
|
|
34
34
|
export { default as internal_resolveProps } from './resolveProps';
|
|
35
35
|
export { default as unstable_composeClasses } from './composeClasses';
|
|
36
36
|
export { default as unstable_generateUtilityClass } from './generateUtilityClass';
|
|
37
|
+
export { isGlobalState as unstable_isGlobalState } from './generateUtilityClass';
|
|
37
38
|
export * from './generateUtilityClass';
|
|
38
39
|
export { default as unstable_generateUtilityClasses } from './generateUtilityClasses';
|
|
39
40
|
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator';
|
|
41
|
+
export { default as clamp } from './clamp';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/utils v5.15.
|
|
2
|
+
* @mui/utils v5.15.5
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -50,8 +50,10 @@ var _exportNames = {
|
|
|
50
50
|
internal_resolveProps: true,
|
|
51
51
|
unstable_composeClasses: true,
|
|
52
52
|
unstable_generateUtilityClass: true,
|
|
53
|
+
unstable_isGlobalState: true,
|
|
53
54
|
unstable_generateUtilityClasses: true,
|
|
54
|
-
unstable_ClassNameGenerator: true
|
|
55
|
+
unstable_ClassNameGenerator: true,
|
|
56
|
+
clamp: true
|
|
55
57
|
};
|
|
56
58
|
Object.defineProperty(exports, "HTMLElementType", {
|
|
57
59
|
enumerable: true,
|
|
@@ -65,6 +67,12 @@ Object.defineProperty(exports, "chainPropTypes", {
|
|
|
65
67
|
return _chainPropTypes.default;
|
|
66
68
|
}
|
|
67
69
|
});
|
|
70
|
+
Object.defineProperty(exports, "clamp", {
|
|
71
|
+
enumerable: true,
|
|
72
|
+
get: function () {
|
|
73
|
+
return _clamp.default;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
68
76
|
Object.defineProperty(exports, "deepmerge", {
|
|
69
77
|
enumerable: true,
|
|
70
78
|
get: function () {
|
|
@@ -203,6 +211,12 @@ Object.defineProperty(exports, "unstable_getScrollbarSize", {
|
|
|
203
211
|
return _getScrollbarSize.default;
|
|
204
212
|
}
|
|
205
213
|
});
|
|
214
|
+
Object.defineProperty(exports, "unstable_isGlobalState", {
|
|
215
|
+
enumerable: true,
|
|
216
|
+
get: function () {
|
|
217
|
+
return _generateUtilityClass.isGlobalState;
|
|
218
|
+
}
|
|
219
|
+
});
|
|
206
220
|
Object.defineProperty(exports, "unstable_isMuiElement", {
|
|
207
221
|
enumerable: true,
|
|
208
222
|
get: function () {
|
|
@@ -335,5 +349,6 @@ Object.keys(_generateUtilityClass).forEach(function (key) {
|
|
|
335
349
|
});
|
|
336
350
|
var _generateUtilityClasses = _interopRequireDefault(require("./generateUtilityClasses"));
|
|
337
351
|
var _ClassNameGenerator = _interopRequireDefault(require("./ClassNameGenerator"));
|
|
352
|
+
var _clamp = _interopRequireDefault(require("./clamp"));
|
|
338
353
|
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); }
|
|
339
354
|
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; }
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
function clamp(val) {
|
|
2
|
+
var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MIN_SAFE_INTEGER;
|
|
3
|
+
var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Number.MAX_SAFE_INTEGER;
|
|
4
|
+
return Math.max(min, Math.min(val, max));
|
|
5
|
+
}
|
|
6
|
+
export default clamp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './clamp';
|
package/legacy/deepmerge.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
3
|
+
// https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
|
|
3
4
|
export function isPlainObject(item) {
|
|
4
|
-
|
|
5
|
+
if (_typeof(item) !== 'object' || item === null) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
var prototype = Object.getPrototypeOf(item);
|
|
9
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in item) && !(Symbol.iterator in item);
|
|
5
10
|
}
|
|
6
11
|
function deepClone(source) {
|
|
7
12
|
if (!isPlainObject(source)) {
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import ClassNameGenerator from '../ClassNameGenerator';
|
|
2
|
-
|
|
3
|
-
// If GlobalStateSlot is changed, GLOBAL_STATE_CLASSES in
|
|
4
|
-
// \packages\api-docs-builder\utils\parseSlotsAndClasses.ts must be updated accordingly.
|
|
5
|
-
|
|
6
|
-
var globalStateClassesMapping = {
|
|
2
|
+
export var globalStateClasses = {
|
|
7
3
|
active: 'active',
|
|
8
4
|
checked: 'checked',
|
|
9
5
|
completed: 'completed',
|
|
@@ -19,6 +15,9 @@ var globalStateClassesMapping = {
|
|
|
19
15
|
};
|
|
20
16
|
export default function generateUtilityClass(componentName, slot) {
|
|
21
17
|
var globalStatePrefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Mui';
|
|
22
|
-
var globalStateClass =
|
|
18
|
+
var globalStateClass = globalStateClasses[slot];
|
|
23
19
|
return globalStateClass ? "".concat(globalStatePrefix, "-").concat(globalStateClass) : "".concat(ClassNameGenerator.generate(componentName), "-").concat(slot);
|
|
20
|
+
}
|
|
21
|
+
export function isGlobalState(slot) {
|
|
22
|
+
return globalStateClasses[slot] !== undefined;
|
|
24
23
|
}
|
package/legacy/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/utils v5.15.
|
|
2
|
+
* @mui/utils v5.15.5
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -43,6 +43,8 @@ export { default as integerPropType } from './integerPropType';
|
|
|
43
43
|
export { default as internal_resolveProps } from './resolveProps';
|
|
44
44
|
export { default as unstable_composeClasses } from './composeClasses';
|
|
45
45
|
export { default as unstable_generateUtilityClass } from './generateUtilityClass';
|
|
46
|
+
export { isGlobalState as unstable_isGlobalState } from './generateUtilityClass';
|
|
46
47
|
export * from './generateUtilityClass';
|
|
47
48
|
export { default as unstable_generateUtilityClasses } from './generateUtilityClasses';
|
|
48
|
-
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator';
|
|
49
|
+
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator';
|
|
50
|
+
export { default as clamp } from './clamp';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './clamp';
|
package/modern/deepmerge.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
// https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
|
|
2
3
|
export function isPlainObject(item) {
|
|
3
|
-
|
|
4
|
+
if (typeof item !== 'object' || item === null) {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
const prototype = Object.getPrototypeOf(item);
|
|
8
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in item) && !(Symbol.iterator in item);
|
|
4
9
|
}
|
|
5
10
|
function deepClone(source) {
|
|
6
11
|
if (!isPlainObject(source)) {
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import ClassNameGenerator from '../ClassNameGenerator';
|
|
2
|
-
|
|
3
|
-
// If GlobalStateSlot is changed, GLOBAL_STATE_CLASSES in
|
|
4
|
-
// \packages\api-docs-builder\utils\parseSlotsAndClasses.ts must be updated accordingly.
|
|
5
|
-
|
|
6
|
-
const globalStateClassesMapping = {
|
|
2
|
+
export const globalStateClasses = {
|
|
7
3
|
active: 'active',
|
|
8
4
|
checked: 'checked',
|
|
9
5
|
completed: 'completed',
|
|
@@ -18,6 +14,9 @@ const globalStateClassesMapping = {
|
|
|
18
14
|
selected: 'selected'
|
|
19
15
|
};
|
|
20
16
|
export default function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') {
|
|
21
|
-
const globalStateClass =
|
|
17
|
+
const globalStateClass = globalStateClasses[slot];
|
|
22
18
|
return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator.generate(componentName)}-${slot}`;
|
|
19
|
+
}
|
|
20
|
+
export function isGlobalState(slot) {
|
|
21
|
+
return globalStateClasses[slot] !== undefined;
|
|
23
22
|
}
|
package/modern/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/utils v5.15.
|
|
2
|
+
* @mui/utils v5.15.5
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -43,6 +43,8 @@ export { default as integerPropType } from './integerPropType';
|
|
|
43
43
|
export { default as internal_resolveProps } from './resolveProps';
|
|
44
44
|
export { default as unstable_composeClasses } from './composeClasses';
|
|
45
45
|
export { default as unstable_generateUtilityClass } from './generateUtilityClass';
|
|
46
|
+
export { isGlobalState as unstable_isGlobalState } from './generateUtilityClass';
|
|
46
47
|
export * from './generateUtilityClass';
|
|
47
48
|
export { default as unstable_generateUtilityClasses } from './generateUtilityClasses';
|
|
48
|
-
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator';
|
|
49
|
+
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator';
|
|
50
|
+
export { default as clamp } from './clamp';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/utils",
|
|
3
|
-
"version": "5.15.
|
|
3
|
+
"version": "5.15.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "Utility functions for React components.",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"url": "https://opencollective.com/mui-org"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@babel/runtime": "^7.23.
|
|
29
|
+
"@babel/runtime": "^7.23.8",
|
|
30
30
|
"@types/prop-types": "^15.7.11",
|
|
31
31
|
"prop-types": "^15.8.1",
|
|
32
32
|
"react-is": "^18.2.0"
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
},
|
|
43
43
|
"sideEffects": false,
|
|
44
44
|
"publishConfig": {
|
|
45
|
-
"access": "public"
|
|
45
|
+
"access": "public",
|
|
46
|
+
"directory": "build"
|
|
46
47
|
},
|
|
47
48
|
"engines": {
|
|
48
49
|
"node": ">=12.0.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|