@mui/material 6.1.1 → 6.1.3
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/Autocomplete/Autocomplete.js +1 -5
- package/Badge/Badge.d.ts +2 -2
- package/Badge/Badge.js +12 -8
- package/Button/Button.js +3 -4
- package/CHANGELOG.md +136 -0
- package/ClickAwayListener/ClickAwayListener.js +2 -2
- package/Fade/Fade.js +2 -2
- package/Grid2/Grid2.d.ts +16 -11
- package/Grid2/Grid2.js +29 -11
- package/Grow/Grow.js +2 -2
- package/Icon/Icon.js +1 -1
- package/InputBase/InputBase.js +1 -1
- package/LinearProgress/LinearProgress.js +7 -0
- package/MenuList/MenuList.js +2 -1
- package/Modal/Modal.js +3 -3
- package/Modal/ModalManager.d.ts +1 -1
- package/Modal/ModalManager.js +5 -5
- package/Modal/useModal.js +9 -5
- package/OutlinedInput/OutlinedInput.js +6 -6
- package/PigmentGrid/PigmentGrid.d.ts +0 -23
- package/PigmentGrid/PigmentGrid.js +0 -23
- package/Portal/Portal.js +2 -2
- package/Rating/Rating.d.ts +1 -1
- package/Rating/Rating.js +7 -2
- package/Select/Select.js +2 -2
- package/Select/SelectInput.js +1 -1
- package/Slide/Slide.js +2 -2
- package/SwipeableDrawer/SwipeableDrawer.d.ts +1 -1
- package/Tooltip/Tooltip.js +2 -2
- package/Unstable_TrapFocus/FocusTrap.js +3 -3
- package/Zoom/Zoom.js +2 -2
- package/index.js +1 -1
- package/modern/Autocomplete/Autocomplete.js +1 -5
- package/modern/Badge/Badge.js +12 -8
- package/modern/Button/Button.js +3 -4
- package/modern/ClickAwayListener/ClickAwayListener.js +2 -2
- package/modern/Fade/Fade.js +2 -2
- package/modern/Grid2/Grid2.js +29 -11
- package/modern/Grow/Grow.js +2 -2
- package/modern/Icon/Icon.js +1 -1
- package/modern/InputBase/InputBase.js +1 -1
- package/modern/LinearProgress/LinearProgress.js +7 -0
- package/modern/MenuList/MenuList.js +2 -1
- package/modern/Modal/Modal.js +3 -3
- package/modern/Modal/ModalManager.js +5 -5
- package/modern/Modal/useModal.js +9 -5
- package/modern/OutlinedInput/OutlinedInput.js +6 -6
- package/modern/PigmentGrid/PigmentGrid.js +0 -23
- package/modern/Portal/Portal.js +2 -2
- package/modern/Rating/Rating.js +7 -2
- package/modern/Select/Select.js +2 -2
- package/modern/Select/SelectInput.js +1 -1
- package/modern/Slide/Slide.js +2 -2
- package/modern/Tooltip/Tooltip.js +2 -2
- package/modern/Unstable_TrapFocus/FocusTrap.js +3 -3
- package/modern/Zoom/Zoom.js +2 -2
- package/modern/index.js +1 -1
- package/modern/styles/createGetSelector.js +8 -7
- package/modern/styles/createPalette.js +2 -16
- package/modern/styles/createThemeNoVars.js +1 -2
- package/modern/styles/createThemeWithVars.js +2 -0
- package/modern/styles/index.js +1 -1
- package/modern/styles/makeStyles.js +1 -3
- package/modern/styles/responsiveFontSizes.js +1 -2
- package/modern/styles/shouldSkipGeneratingVar.js +1 -1
- package/modern/styles/withStyles.js +1 -3
- package/modern/styles/withTheme.js +1 -3
- package/modern/useAutocomplete/useAutocomplete.js +3 -1
- package/modern/utils/memoTheme.js +3 -24
- package/modern/version/index.js +2 -2
- package/node/Autocomplete/Autocomplete.js +1 -5
- package/node/Badge/Badge.js +12 -8
- package/node/Button/Button.js +3 -4
- package/node/ClickAwayListener/ClickAwayListener.js +2 -2
- package/node/Fade/Fade.js +2 -2
- package/node/Grid2/Grid2.js +29 -11
- package/node/Grow/Grow.js +2 -2
- package/node/Icon/Icon.js +1 -1
- package/node/InputBase/InputBase.js +1 -1
- package/node/LinearProgress/LinearProgress.js +7 -0
- package/node/MenuList/MenuList.js +2 -1
- package/node/Modal/Modal.js +3 -3
- package/node/Modal/ModalManager.js +5 -5
- package/node/Modal/useModal.js +9 -5
- package/node/OutlinedInput/OutlinedInput.js +6 -6
- package/node/PigmentGrid/PigmentGrid.js +0 -23
- package/node/Portal/Portal.js +1 -1
- package/node/Rating/Rating.js +7 -2
- package/node/Select/Select.js +2 -2
- package/node/Select/SelectInput.js +1 -1
- package/node/Slide/Slide.js +2 -2
- package/node/Tooltip/Tooltip.js +2 -2
- package/node/Unstable_TrapFocus/FocusTrap.js +2 -2
- package/node/Zoom/Zoom.js +2 -2
- package/node/index.js +1 -1
- package/node/styles/createGetSelector.js +8 -7
- package/node/styles/createPalette.js +2 -16
- package/node/styles/createThemeNoVars.js +1 -2
- package/node/styles/createThemeWithVars.js +2 -0
- package/node/styles/index.js +1 -1
- package/node/styles/makeStyles.js +1 -3
- package/node/styles/responsiveFontSizes.js +1 -2
- package/node/styles/shouldSkipGeneratingVar.js +1 -1
- package/node/styles/withStyles.js +1 -3
- package/node/styles/withTheme.js +1 -3
- package/node/useAutocomplete/useAutocomplete.js +3 -1
- package/node/utils/memoTheme.js +4 -25
- package/node/version/index.js +2 -2
- package/package.json +6 -6
- package/styles/ThemeProvider.d.ts +6 -0
- package/styles/ThemeProviderWithVars.d.ts +2 -1
- package/styles/createGetSelector.d.ts +3 -8
- package/styles/createGetSelector.js +8 -7
- package/styles/createPalette.js +2 -16
- package/styles/createTheme.d.ts +1 -1
- package/styles/createThemeNoVars.d.ts +1 -0
- package/styles/createThemeNoVars.js +1 -2
- package/styles/createThemeWithVars.d.ts +8 -0
- package/styles/createThemeWithVars.js +2 -0
- package/styles/index.js +1 -1
- package/styles/makeStyles.js +1 -3
- package/styles/responsiveFontSizes.js +1 -2
- package/styles/shouldSkipGeneratingVar.js +1 -1
- package/styles/withStyles.js +1 -3
- package/styles/withTheme.js +1 -3
- package/useAutocomplete/useAutocomplete.js +3 -1
- package/utils/memoTheme.d.ts +4 -10
- package/utils/memoTheme.js +3 -24
- package/version/index.js +2 -2
|
@@ -40,10 +40,11 @@ export declare const CssVarsProvider: (props: React.PropsWithChildren<Partial<im
|
|
|
40
40
|
colorSchemeSelector?: "media" | "class" | "data" | string;
|
|
41
41
|
};
|
|
42
42
|
} | undefined;
|
|
43
|
+
defaultMode?: "light" | "dark" | "system";
|
|
43
44
|
documentNode?: Document | null;
|
|
44
45
|
colorSchemeNode?: Element | null;
|
|
45
46
|
storageWindow?: Window | null;
|
|
46
47
|
disableNestedContext?: boolean;
|
|
47
48
|
disableStyleSheetGeneration?: boolean;
|
|
48
|
-
}>) => React.
|
|
49
|
+
}>) => React.JSX.Element;
|
|
49
50
|
export { useColorScheme, getInitColorSchemeScript, Experimental_CssVarsProvider };
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
declare const _default: <T extends {
|
|
2
|
+
rootSelector?: string;
|
|
2
3
|
colorSchemeSelector?: "media" | "class" | "data" | string;
|
|
3
4
|
colorSchemes?: Record<string, any>;
|
|
4
5
|
defaultColorScheme?: string;
|
|
5
6
|
cssVarPrefix?: string;
|
|
6
7
|
}>(theme: T) => (colorScheme: keyof T["colorSchemes"] | undefined, css: Record<string, any>) => string | {
|
|
7
|
-
|
|
8
|
+
[x: string]: Record<string, any>;
|
|
8
9
|
"@media (prefers-color-scheme: dark)": {
|
|
9
|
-
|
|
10
|
+
[x: string]: Record<string, any>;
|
|
10
11
|
};
|
|
11
12
|
} | {
|
|
12
13
|
[x: string]: Record<string, any>;
|
|
13
|
-
':root'?: undefined;
|
|
14
|
-
"@media (prefers-color-scheme: dark)"?: undefined;
|
|
15
|
-
} | {
|
|
16
|
-
':root': {
|
|
17
|
-
[x: string]: any;
|
|
18
|
-
};
|
|
19
14
|
"@media (prefers-color-scheme: dark)"?: undefined;
|
|
20
15
|
};
|
|
21
16
|
export default _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import excludeVariablesFromRoot from "./excludeVariablesFromRoot.js";
|
|
2
2
|
export default theme => (colorScheme, css) => {
|
|
3
|
+
const root = theme.rootSelector || ':root';
|
|
3
4
|
const selector = theme.colorSchemeSelector;
|
|
4
5
|
let rule = selector;
|
|
5
6
|
if (selector === 'class') {
|
|
@@ -21,33 +22,33 @@ export default theme => (colorScheme, css) => {
|
|
|
21
22
|
});
|
|
22
23
|
if (rule === 'media') {
|
|
23
24
|
return {
|
|
24
|
-
|
|
25
|
+
[root]: css,
|
|
25
26
|
[`@media (prefers-color-scheme: dark)`]: {
|
|
26
|
-
|
|
27
|
+
[root]: excludedVariables
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
30
|
}
|
|
30
31
|
if (rule) {
|
|
31
32
|
return {
|
|
32
33
|
[rule.replace('%s', colorScheme)]: excludedVariables,
|
|
33
|
-
[
|
|
34
|
+
[`${root}, ${rule.replace('%s', colorScheme)}`]: css
|
|
34
35
|
};
|
|
35
36
|
}
|
|
36
37
|
return {
|
|
37
|
-
|
|
38
|
+
[root]: {
|
|
38
39
|
...css,
|
|
39
40
|
...excludedVariables
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
44
|
if (rule && rule !== 'media') {
|
|
44
|
-
return
|
|
45
|
+
return `${root}, ${rule.replace('%s', String(colorScheme))}`;
|
|
45
46
|
}
|
|
46
47
|
} else if (colorScheme) {
|
|
47
48
|
if (rule === 'media') {
|
|
48
49
|
return {
|
|
49
50
|
[`@media (prefers-color-scheme: ${String(colorScheme)})`]: {
|
|
50
|
-
|
|
51
|
+
[root]: css
|
|
51
52
|
}
|
|
52
53
|
};
|
|
53
54
|
}
|
|
@@ -55,5 +56,5 @@ export default theme => (colorScheme, css) => {
|
|
|
55
56
|
return rule.replace('%s', String(colorScheme));
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
|
-
return
|
|
59
|
+
return root;
|
|
59
60
|
};
|
package/styles/createPalette.js
CHANGED
|
@@ -212,24 +212,10 @@ export default function createPalette(palette) {
|
|
|
212
212
|
color.main = color[mainShade];
|
|
213
213
|
}
|
|
214
214
|
if (!color.hasOwnProperty('main')) {
|
|
215
|
-
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid
|
|
216
|
-
The color object needs to have a \`main\` property or a \`${mainShade}\` property.` : _formatMuiErrorMessage(11, name ? ` (${name})` : '', mainShade));
|
|
215
|
+
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n` + `The color object needs to have a \`main\` property or a \`${mainShade}\` property.` : _formatMuiErrorMessage(11, name ? ` (${name})` : '', mainShade));
|
|
217
216
|
}
|
|
218
217
|
if (typeof color.main !== 'string') {
|
|
219
|
-
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.
|
|
220
|
-
\`color.main\` should be a string, but \`${JSON.stringify(color.main)}\` was provided instead.
|
|
221
|
-
|
|
222
|
-
Did you intend to use one of the following approaches?
|
|
223
|
-
|
|
224
|
-
import { green } from "@mui/material/colors";
|
|
225
|
-
|
|
226
|
-
const theme1 = createTheme({ palette: {
|
|
227
|
-
primary: green,
|
|
228
|
-
} });
|
|
229
|
-
|
|
230
|
-
const theme2 = createTheme({ palette: {
|
|
231
|
-
primary: { main: green[500] },
|
|
232
|
-
} });` : _formatMuiErrorMessage(12, name ? ` (${name})` : '', JSON.stringify(color.main)));
|
|
218
|
+
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n` + `\`color.main\` should be a string, but \`${JSON.stringify(color.main)}\` was provided instead.\n` + '\n' + 'Did you intend to use one of the following approaches?\n' + '\n' + 'import { green } from "@mui/material/colors";\n' + '\n' + 'const theme1 = createTheme({ palette: {\n' + ' primary: green,\n' + '} });\n' + '\n' + 'const theme2 = createTheme({ palette: {\n' + ' primary: { main: green[500] },\n' + '} });' : _formatMuiErrorMessage(12, name ? ` (${name})` : '', JSON.stringify(color.main)));
|
|
233
219
|
}
|
|
234
220
|
addLightOrDark(color, 'light', lightShade, tonalOffset);
|
|
235
221
|
addLightOrDark(color, 'dark', darkShade, tonalOffset);
|
package/styles/createTheme.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export type { ThemeOptions, Theme, CssThemeVariables } from './createThemeNoVars
|
|
|
9
9
|
* @returns A complete, ready-to-use theme object.
|
|
10
10
|
*/
|
|
11
11
|
export default function createTheme(options?: Omit<ThemeOptions, 'components'> & Pick<CssVarsThemeOptions, 'defaultColorScheme' | 'colorSchemes' | 'components'> & {
|
|
12
|
-
cssVariables?: boolean | Pick<CssVarsThemeOptions, 'colorSchemeSelector' | 'disableCssColorScheme' | 'cssVarPrefix' | 'shouldSkipGeneratingVar'>;
|
|
12
|
+
cssVariables?: boolean | Pick<CssVarsThemeOptions, 'colorSchemeSelector' | 'rootSelector' | 'disableCssColorScheme' | 'cssVarPrefix' | 'shouldSkipGeneratingVar'>;
|
|
13
13
|
}, // cast type to skip module augmentation test
|
|
14
14
|
...args: object[]): Theme;
|
|
@@ -21,8 +21,7 @@ function createThemeNoVars(options = {}, ...args) {
|
|
|
21
21
|
...other
|
|
22
22
|
} = options;
|
|
23
23
|
if (options.vars) {
|
|
24
|
-
throw new Error(process.env.NODE_ENV !== "production" ?
|
|
25
|
-
Please use another name.` : _formatMuiErrorMessage(20));
|
|
24
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: `vars` is a private field used for CSS variables support.\n' + 'Please use another name.' : _formatMuiErrorMessage(20));
|
|
26
25
|
}
|
|
27
26
|
const palette = createPalette(paletteInput);
|
|
28
27
|
const systemTheme = systemCreateTheme(options);
|
|
@@ -306,6 +306,13 @@ export interface CssVarsThemeOptions extends Omit<ThemeOptions, 'palette' | 'com
|
|
|
306
306
|
* Generate CSS variables within a data attribute [data-mode-light], [data-mode-dark]
|
|
307
307
|
*/
|
|
308
308
|
colorSchemeSelector?: 'media' | 'class' | 'data' | string;
|
|
309
|
+
/**
|
|
310
|
+
* The selector to generate the global CSS variables (non-color-scheme related)
|
|
311
|
+
* @default ':root'
|
|
312
|
+
* @example ':host' // (for shadow DOM)
|
|
313
|
+
* @see https://mui.com/material-ui/customization/shadow-dom/#3-css-theme-variables-optional
|
|
314
|
+
*/
|
|
315
|
+
rootSelector?: string;
|
|
309
316
|
/**
|
|
310
317
|
* If `true`, the CSS color-scheme will not be set.
|
|
311
318
|
* https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
|
|
@@ -430,6 +437,7 @@ export type ThemeCssVar = OverridableStringUnion<
|
|
|
430
437
|
*/
|
|
431
438
|
export interface CssVarsTheme extends ColorSystem {
|
|
432
439
|
colorSchemes: Partial<Record<SupportedColorScheme, ColorSystem>>;
|
|
440
|
+
rootSelector: string;
|
|
433
441
|
colorSchemeSelector: 'media' | 'class' | 'data' | string;
|
|
434
442
|
cssVarPrefix: string;
|
|
435
443
|
defaultColorScheme: SupportedColorScheme;
|
|
@@ -109,6 +109,7 @@ export default function createThemeWithVars(options = {}, ...args) {
|
|
|
109
109
|
cssVarPrefix = 'mui',
|
|
110
110
|
shouldSkipGeneratingVar = defaultShouldSkipGeneratingVar,
|
|
111
111
|
colorSchemeSelector: selector = colorSchemesInput.light && colorSchemesInput.dark ? 'media' : undefined,
|
|
112
|
+
rootSelector = ':root',
|
|
112
113
|
...input
|
|
113
114
|
} = options;
|
|
114
115
|
const firstColorScheme = Object.keys(colorSchemesInput)[0];
|
|
@@ -146,6 +147,7 @@ export default function createThemeWithVars(options = {}, ...args) {
|
|
|
146
147
|
...muiTheme,
|
|
147
148
|
cssVarPrefix,
|
|
148
149
|
colorSchemeSelector: selector,
|
|
150
|
+
rootSelector,
|
|
149
151
|
getCssVar,
|
|
150
152
|
colorSchemes,
|
|
151
153
|
font: {
|
package/styles/index.js
CHANGED
|
@@ -6,7 +6,7 @@ export { unstable_createBreakpoints } from '@mui/system/createBreakpoints';
|
|
|
6
6
|
// TODO: Remove this function in v6.
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
8
8
|
export function experimental_sx() {
|
|
9
|
-
throw new Error(process.env.NODE_ENV !== "production" ?
|
|
9
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.' + 'For more details, see https://github.com/mui/material-ui/pull/35150.' : _formatMuiErrorMessage(19));
|
|
10
10
|
}
|
|
11
11
|
export { default as createTheme, createMuiTheme } from "./createTheme.js";
|
|
12
12
|
export { default as unstable_createMuiStrictModeTheme } from "./createMuiStrictModeTheme.js";
|
package/styles/makeStyles.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
|
|
2
2
|
export default function makeStyles() {
|
|
3
|
-
throw new Error(process.env.NODE_ENV !== "production" ?
|
|
4
|
-
You have to import it from @mui/styles.
|
|
5
|
-
See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(14));
|
|
3
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: makeStyles is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : _formatMuiErrorMessage(14));
|
|
6
4
|
}
|
|
@@ -34,8 +34,7 @@ export default function responsiveFontSizes(themeInput, options = {}) {
|
|
|
34
34
|
lineHeight
|
|
35
35
|
} = style;
|
|
36
36
|
if (!isUnitless(lineHeight) && !disableAlign) {
|
|
37
|
-
throw new Error(process.env.NODE_ENV !== "production" ?
|
|
38
|
-
Use unitless line heights instead.` : _formatMuiErrorMessage(6));
|
|
37
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: Unsupported non-unitless line height with grid alignment.\n' + 'Use unitless line heights instead.' : _formatMuiErrorMessage(6));
|
|
39
38
|
}
|
|
40
39
|
if (!isUnitless(lineHeight)) {
|
|
41
40
|
// make it unitless
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default function shouldSkipGeneratingVar(keys) {
|
|
2
|
-
return !!keys[0].match(/(cssVarPrefix|colorSchemeSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys[0].match(/sxConfig$/) ||
|
|
2
|
+
return !!keys[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys[0].match(/sxConfig$/) ||
|
|
3
3
|
// ends with sxConfig
|
|
4
4
|
keys[0] === 'palette' && !!keys[1]?.match(/(mode|contrastThreshold|tonalOffset)/);
|
|
5
5
|
}
|
package/styles/withStyles.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
|
|
2
2
|
export default function withStyles() {
|
|
3
|
-
throw new Error(process.env.NODE_ENV !== "production" ?
|
|
4
|
-
You have to import it from @mui/styles.
|
|
5
|
-
See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(15));
|
|
3
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: withStyles is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : _formatMuiErrorMessage(15));
|
|
6
4
|
}
|
package/styles/withTheme.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
|
|
2
2
|
export default function withTheme() {
|
|
3
|
-
throw new Error(process.env.NODE_ENV !== "production" ?
|
|
4
|
-
You have to import it from @mui/styles.
|
|
5
|
-
See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(16));
|
|
3
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: withTheme is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : _formatMuiErrorMessage(16));
|
|
6
4
|
}
|
|
@@ -838,6 +838,7 @@ function useAutocomplete(props) {
|
|
|
838
838
|
const handleInputMouseDown = event => {
|
|
839
839
|
if (!disabledProp && (inputValue === '' || !open)) {
|
|
840
840
|
handlePopupIndicator(event);
|
|
841
|
+
event.stopPropagation();
|
|
841
842
|
}
|
|
842
843
|
};
|
|
843
844
|
let dirty = freeSolo && inputValue.length > 0;
|
|
@@ -914,7 +915,8 @@ function useAutocomplete(props) {
|
|
|
914
915
|
getPopupIndicatorProps: () => ({
|
|
915
916
|
tabIndex: -1,
|
|
916
917
|
type: 'button',
|
|
917
|
-
onClick: handlePopupIndicator
|
|
918
|
+
onClick: handlePopupIndicator,
|
|
919
|
+
onMouseDown: event => event.stopPropagation()
|
|
918
920
|
}),
|
|
919
921
|
getTagProps: ({
|
|
920
922
|
index
|
package/utils/memoTheme.d.ts
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { CSSInterpolation } from '@mui/system';
|
|
2
1
|
import { Theme } from '../styles/createTheme';
|
|
3
|
-
|
|
2
|
+
declare const memoTheme: (styleFn: (props: {
|
|
4
3
|
theme: Theme;
|
|
5
|
-
}) => CSSInterpolation
|
|
6
|
-
/**
|
|
7
|
-
* Memoize style function on theme.
|
|
8
|
-
* Intended to be used in styled() calls that only need access to the theme.
|
|
9
|
-
*/
|
|
10
|
-
export default function memoTheme(styleFn: ThemeStyleFunction): (props: {
|
|
4
|
+
}) => import("@mui/styled-engine").CSSInterpolation) => (props: {
|
|
11
5
|
theme: Theme;
|
|
12
|
-
}) =>
|
|
13
|
-
export
|
|
6
|
+
}) => string | number | boolean | import("@mui/styled-engine").ComponentSelector | import("@mui/styled-engine").Keyframes | import("@mui/styled-engine").SerializedStyles | import("@mui/styled-engine").CSSObject | import("@mui/styled-engine").ArrayCSSInterpolation | null;
|
|
7
|
+
export default memoTheme;
|
package/utils/memoTheme.js
CHANGED
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
theme: undefined
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Memoize style function on theme.
|
|
9
|
-
* Intended to be used in styled() calls that only need access to the theme.
|
|
10
|
-
*/
|
|
11
|
-
export default function memoTheme(styleFn) {
|
|
12
|
-
let lastValue;
|
|
13
|
-
let lastTheme;
|
|
14
|
-
return props => {
|
|
15
|
-
let value = lastValue;
|
|
16
|
-
if (value === undefined || props.theme !== lastTheme) {
|
|
17
|
-
arg.theme = props.theme;
|
|
18
|
-
value = styleFn(arg);
|
|
19
|
-
lastValue = value;
|
|
20
|
-
lastTheme = props.theme;
|
|
21
|
-
}
|
|
22
|
-
return value;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
1
|
+
import { unstable_memoTheme } from '@mui/system';
|
|
2
|
+
const memoTheme = unstable_memoTheme;
|
|
3
|
+
export default memoTheme;
|
package/version/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const version = "6.1.
|
|
1
|
+
export const version = "6.1.3";
|
|
2
2
|
export const major = Number("6");
|
|
3
3
|
export const minor = Number("1");
|
|
4
|
-
export const patch = Number("
|
|
4
|
+
export const patch = Number("3");
|
|
5
5
|
export const prerelease = undefined;
|
|
6
6
|
export default version;
|