@mui/material 5.11.6 → 5.11.8
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 +141 -1
- package/Checkbox/Checkbox.d.ts +3 -0
- package/Checkbox/Checkbox.js +3 -0
- package/FormLabel/FormLabel.d.ts +51 -45
- package/InputLabel/InputLabel.d.ts +70 -57
- package/MenuList/MenuList.d.ts +1 -1
- package/MenuList/MenuList.js +1 -1
- package/Popper/Popper.d.ts +19 -1
- package/Radio/Radio.js +2 -0
- package/Select/SelectInput.js +1 -1
- package/Switch/Switch.js +2 -0
- package/TabScrollButton/TabScrollButton.d.ts +1 -0
- package/TabScrollButton/TabScrollButton.js +1 -0
- package/Tooltip/Tooltip.js +9 -9
- package/index.js +1 -1
- package/internal/SwitchBase.d.ts +5 -0
- package/internal/SwitchBase.js +1 -1
- package/legacy/Checkbox/Checkbox.js +3 -0
- package/legacy/MenuList/MenuList.js +1 -1
- package/legacy/Radio/Radio.js +2 -0
- package/legacy/Select/SelectInput.js +1 -1
- package/legacy/Switch/Switch.js +2 -0
- package/legacy/TabScrollButton/TabScrollButton.js +1 -0
- package/legacy/Tooltip/Tooltip.js +9 -9
- package/legacy/index.js +1 -1
- package/legacy/internal/SwitchBase.js +2 -1
- package/legacy/styles/CssVarsProvider.js +3 -1
- package/modern/Checkbox/Checkbox.js +3 -0
- package/modern/MenuList/MenuList.js +1 -1
- package/modern/Radio/Radio.js +2 -0
- package/modern/Select/SelectInput.js +1 -1
- package/modern/Switch/Switch.js +2 -0
- package/modern/TabScrollButton/TabScrollButton.js +1 -0
- package/modern/Tooltip/Tooltip.js +9 -9
- package/modern/index.js +1 -1
- package/modern/internal/SwitchBase.js +1 -1
- package/modern/styles/CssVarsProvider.js +3 -1
- package/node/Checkbox/Checkbox.js +3 -0
- package/node/MenuList/MenuList.js +1 -1
- package/node/Radio/Radio.js +2 -0
- package/node/Select/SelectInput.js +1 -1
- package/node/Switch/Switch.js +2 -0
- package/node/TabScrollButton/TabScrollButton.js +1 -0
- package/node/Tooltip/Tooltip.js +9 -9
- package/node/index.js +1 -1
- package/node/internal/SwitchBase.js +1 -1
- package/node/styles/CssVarsProvider.js +3 -1
- package/package.json +5 -5
- package/styles/CssVarsProvider.js +3 -1
- package/umd/material-ui.development.js +149 -72
- package/umd/material-ui.production.min.js +20 -20
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/material v5.11.
|
|
2
|
+
* @mui/material v5.11.8
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -3217,8 +3217,6 @@
|
|
|
3217
3217
|
return cache;
|
|
3218
3218
|
};
|
|
3219
3219
|
|
|
3220
|
-
var createCache$1 = createCache;
|
|
3221
|
-
|
|
3222
3220
|
var FORWARD_REF_STATICS = {
|
|
3223
3221
|
'$$typeof': true,
|
|
3224
3222
|
render: true,
|
|
@@ -3717,7 +3715,7 @@
|
|
|
3717
3715
|
// and we could have a special build just for that
|
|
3718
3716
|
// but this is much easier and the native packages
|
|
3719
3717
|
// might use a different theme context in the future anyway
|
|
3720
|
-
typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache
|
|
3718
|
+
typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({
|
|
3721
3719
|
key: 'css'
|
|
3722
3720
|
}) : null);
|
|
3723
3721
|
|
|
@@ -3747,7 +3745,7 @@
|
|
|
3747
3745
|
// so there will only every be a single render
|
|
3748
3746
|
// that could change in the future because of suspense and etc. but for now,
|
|
3749
3747
|
// this works and i don't want to optimise for a future thing that we aren't sure about
|
|
3750
|
-
cache = createCache
|
|
3748
|
+
cache = createCache({
|
|
3751
3749
|
key: 'css'
|
|
3752
3750
|
});
|
|
3753
3751
|
return /*#__PURE__*/React.createElement(EmotionCacheContext.Provider, {
|
|
@@ -5781,10 +5779,13 @@
|
|
|
5781
5779
|
var jsxRuntime_1 = jsxRuntime.jsx;
|
|
5782
5780
|
var jsxRuntime_2 = jsxRuntime.jsxs;
|
|
5783
5781
|
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5782
|
+
let cache;
|
|
5783
|
+
if (typeof document === 'object') {
|
|
5784
|
+
cache = createCache({
|
|
5785
|
+
key: 'css',
|
|
5786
|
+
prepend: true
|
|
5787
|
+
});
|
|
5788
|
+
}
|
|
5788
5789
|
function StyledEngineProvider(props) {
|
|
5789
5790
|
const {
|
|
5790
5791
|
injectFirst,
|
|
@@ -8247,14 +8248,14 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
8247
8248
|
colorScheme = ctx.colorScheme;
|
|
8248
8249
|
}
|
|
8249
8250
|
const calculatedMode = (() => {
|
|
8250
|
-
if (
|
|
8251
|
-
|
|
8252
|
-
if (defaultMode === 'system') {
|
|
8253
|
-
return designSystemMode;
|
|
8254
|
-
}
|
|
8255
|
-
return defaultMode;
|
|
8251
|
+
if (mode) {
|
|
8252
|
+
return mode;
|
|
8256
8253
|
}
|
|
8257
|
-
|
|
8254
|
+
// This scope occurs on the server
|
|
8255
|
+
if (defaultMode === 'system') {
|
|
8256
|
+
return designSystemMode;
|
|
8257
|
+
}
|
|
8258
|
+
return defaultMode;
|
|
8258
8259
|
})();
|
|
8259
8260
|
const calculatedColorScheme = (() => {
|
|
8260
8261
|
if (!colorScheme) {
|
|
@@ -8647,6 +8648,22 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
8647
8648
|
return Container;
|
|
8648
8649
|
}
|
|
8649
8650
|
|
|
8651
|
+
function isNestedContainer(ownerState) {
|
|
8652
|
+
return ownerState.level > 0 && ownerState.container;
|
|
8653
|
+
}
|
|
8654
|
+
function createGetSelfSpacing(ownerState) {
|
|
8655
|
+
return function getSelfSpacing(axis) {
|
|
8656
|
+
return `var(--Grid-${axis}Spacing${ownerState.level || ''})`;
|
|
8657
|
+
};
|
|
8658
|
+
}
|
|
8659
|
+
function createGetParentSpacing(ownerState) {
|
|
8660
|
+
return function getParentSpacing(axis) {
|
|
8661
|
+
if (ownerState.level === 0) {
|
|
8662
|
+
return `var(--Grid-${axis}Spacing)`;
|
|
8663
|
+
}
|
|
8664
|
+
return `var(--Grid-${axis}Spacing${ownerState.level - 1 || ''})`;
|
|
8665
|
+
};
|
|
8666
|
+
}
|
|
8650
8667
|
const filterBreakpointKeys = (breakpointsKeys, responsiveKeys) => breakpointsKeys.filter(key => responsiveKeys.includes(key));
|
|
8651
8668
|
const traverseBreakpoints = (breakpoints, responsive, iterator) => {
|
|
8652
8669
|
const smallestBreakpoint = breakpoints.keys[0]; // the keys is sorted from smallest to largest by `createBreakpoints`.
|
|
@@ -8693,6 +8710,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
8693
8710
|
theme,
|
|
8694
8711
|
ownerState
|
|
8695
8712
|
}) => {
|
|
8713
|
+
const getSelfSpacing = createGetSelfSpacing(ownerState);
|
|
8696
8714
|
const styles = {};
|
|
8697
8715
|
traverseBreakpoints(theme.breakpoints, ownerState.gridSize, (appendStyle, value) => {
|
|
8698
8716
|
let style = {};
|
|
@@ -8716,7 +8734,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
8716
8734
|
style = {
|
|
8717
8735
|
flexGrow: 0,
|
|
8718
8736
|
flexBasis: 'auto',
|
|
8719
|
-
width: `calc(100% * ${value} / var(--Grid-columns)${ownerState
|
|
8737
|
+
width: `calc(100% * ${value} / var(--Grid-columns)${isNestedContainer(ownerState) ? ` + ${getSelfSpacing('column')}` : ''})`
|
|
8720
8738
|
};
|
|
8721
8739
|
}
|
|
8722
8740
|
appendStyle(styles, style);
|
|
@@ -8768,11 +8786,16 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
8768
8786
|
if (!ownerState.container) {
|
|
8769
8787
|
return {};
|
|
8770
8788
|
}
|
|
8771
|
-
const
|
|
8789
|
+
const getParentSpacing = createGetParentSpacing(ownerState);
|
|
8790
|
+
const styles = isNestedContainer(ownerState) ? {
|
|
8791
|
+
// Set the default spacing as its parent spacing.
|
|
8792
|
+
// It will be overridden if spacing props are provided
|
|
8793
|
+
[`--Grid-rowSpacing${ownerState.level || ''}`]: getParentSpacing('row')
|
|
8794
|
+
} : {};
|
|
8772
8795
|
traverseBreakpoints(theme.breakpoints, ownerState.rowSpacing, (appendStyle, value) => {
|
|
8773
8796
|
var _theme$spacing;
|
|
8774
8797
|
appendStyle(styles, {
|
|
8775
|
-
|
|
8798
|
+
[`--Grid-rowSpacing${ownerState.level || ''}`]: typeof value === 'string' ? value : (_theme$spacing = theme.spacing) == null ? void 0 : _theme$spacing.call(theme, value)
|
|
8776
8799
|
});
|
|
8777
8800
|
});
|
|
8778
8801
|
return styles;
|
|
@@ -8784,11 +8807,16 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
8784
8807
|
if (!ownerState.container) {
|
|
8785
8808
|
return {};
|
|
8786
8809
|
}
|
|
8787
|
-
const
|
|
8810
|
+
const getParentSpacing = createGetParentSpacing(ownerState);
|
|
8811
|
+
const styles = isNestedContainer(ownerState) ? {
|
|
8812
|
+
// Set the default spacing as its parent spacing.
|
|
8813
|
+
// It will be overridden if spacing props are provided
|
|
8814
|
+
[`--Grid-columnSpacing${ownerState.level || ''}`]: getParentSpacing('column')
|
|
8815
|
+
} : {};
|
|
8788
8816
|
traverseBreakpoints(theme.breakpoints, ownerState.columnSpacing, (appendStyle, value) => {
|
|
8789
8817
|
var _theme$spacing2;
|
|
8790
8818
|
appendStyle(styles, {
|
|
8791
|
-
|
|
8819
|
+
[`--Grid-columnSpacing${ownerState.level || ''}`]: typeof value === 'string' ? value : (_theme$spacing2 = theme.spacing) == null ? void 0 : _theme$spacing2.call(theme, value)
|
|
8792
8820
|
});
|
|
8793
8821
|
});
|
|
8794
8822
|
return styles;
|
|
@@ -8811,29 +8839,24 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
8811
8839
|
const generateGridStyles = ({
|
|
8812
8840
|
ownerState
|
|
8813
8841
|
}) => {
|
|
8842
|
+
const getSelfSpacing = createGetSelfSpacing(ownerState);
|
|
8843
|
+
const getParentSpacing = createGetParentSpacing(ownerState);
|
|
8814
8844
|
return _extends({
|
|
8815
8845
|
minWidth: 0,
|
|
8816
8846
|
boxSizing: 'border-box'
|
|
8817
|
-
}, ownerState.container
|
|
8847
|
+
}, ownerState.container && _extends({
|
|
8818
8848
|
display: 'flex',
|
|
8819
8849
|
flexWrap: 'wrap'
|
|
8820
8850
|
}, ownerState.wrap && ownerState.wrap !== 'wrap' && {
|
|
8821
8851
|
flexWrap: ownerState.wrap
|
|
8822
8852
|
}, {
|
|
8823
|
-
margin: `calc(
|
|
8853
|
+
margin: `calc(${getSelfSpacing('row')} / -2) calc(${getSelfSpacing('column')} / -2)`
|
|
8824
8854
|
}, ownerState.disableEqualOverflow && {
|
|
8825
|
-
margin: `calc(
|
|
8826
|
-
}, ownerState.
|
|
8827
|
-
padding: `calc(
|
|
8855
|
+
margin: `calc(${getSelfSpacing('row')} * -1) 0px 0px calc(${getSelfSpacing('column')} * -1)`
|
|
8856
|
+
}), (!ownerState.container || isNestedContainer(ownerState)) && _extends({
|
|
8857
|
+
padding: `calc(${getParentSpacing('row')} / 2) calc(${getParentSpacing('column')} / 2)`
|
|
8828
8858
|
}, (ownerState.disableEqualOverflow || ownerState.parentDisableEqualOverflow) && {
|
|
8829
|
-
padding:
|
|
8830
|
-
}) : {
|
|
8831
|
-
'--Grid-nested-rowSpacing': 'var(--Grid-rowSpacing)',
|
|
8832
|
-
'--Grid-nested-columnSpacing': 'var(--Grid-columnSpacing)'
|
|
8833
|
-
}) : _extends({
|
|
8834
|
-
padding: `calc(var(--Grid-rowSpacing) / 2) calc(var(--Grid-columnSpacing) / 2)`
|
|
8835
|
-
}, ownerState.disableEqualOverflow && {
|
|
8836
|
-
padding: `calc(var(--Grid-rowSpacing)) 0px 0px calc(var(--Grid-columnSpacing))`
|
|
8859
|
+
padding: `${getParentSpacing('row')} 0px 0px ${getParentSpacing('column')}`
|
|
8837
8860
|
}));
|
|
8838
8861
|
};
|
|
8839
8862
|
const generateSizeClassNames = gridSize => {
|
|
@@ -8899,7 +8922,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
8899
8922
|
useThemeProps = useThemePropsDefault,
|
|
8900
8923
|
componentName = 'MuiGrid'
|
|
8901
8924
|
} = options;
|
|
8902
|
-
const NestedContext = /*#__PURE__*/React__namespace.createContext(
|
|
8925
|
+
const NestedContext = /*#__PURE__*/React__namespace.createContext(0);
|
|
8903
8926
|
const OverflowContext = /*#__PURE__*/React__namespace.createContext(undefined);
|
|
8904
8927
|
const useUtilityClasses = (ownerState, theme) => {
|
|
8905
8928
|
const {
|
|
@@ -8920,7 +8943,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
8920
8943
|
const theme = useTheme$1();
|
|
8921
8944
|
const themeProps = useThemeProps(inProps);
|
|
8922
8945
|
const props = extendSxProp(themeProps); // `color` type conflicts with html color attribute.
|
|
8923
|
-
const
|
|
8946
|
+
const level = React__namespace.useContext(NestedContext);
|
|
8924
8947
|
const overflow = React__namespace.useContext(OverflowContext);
|
|
8925
8948
|
const {
|
|
8926
8949
|
className,
|
|
@@ -8937,7 +8960,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
8937
8960
|
rest = _objectWithoutPropertiesLoose(props, _excluded$2f);
|
|
8938
8961
|
// Because `disableEqualOverflow` can be set from the theme's defaultProps, the **nested** grid should look at the instance props instead.
|
|
8939
8962
|
let disableEqualOverflow = themeDisableEqualOverflow;
|
|
8940
|
-
if (
|
|
8963
|
+
if (level && themeDisableEqualOverflow !== undefined) {
|
|
8941
8964
|
disableEqualOverflow = inProps.disableEqualOverflow;
|
|
8942
8965
|
}
|
|
8943
8966
|
// collect breakpoints related props because they can be customized from the theme.
|
|
@@ -8953,12 +8976,12 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
8953
8976
|
other[key] = val;
|
|
8954
8977
|
}
|
|
8955
8978
|
});
|
|
8956
|
-
const columns = (_inProps$columns = inProps.columns) != null ? _inProps$columns :
|
|
8957
|
-
const spacing = (_inProps$spacing = inProps.spacing) != null ? _inProps$spacing :
|
|
8958
|
-
const rowSpacing = (_ref = (_inProps$rowSpacing = inProps.rowSpacing) != null ? _inProps$rowSpacing : inProps.spacing) != null ? _ref :
|
|
8959
|
-
const columnSpacing = (_ref2 = (_inProps$columnSpacin = inProps.columnSpacing) != null ? _inProps$columnSpacin : inProps.spacing) != null ? _ref2 :
|
|
8979
|
+
const columns = (_inProps$columns = inProps.columns) != null ? _inProps$columns : level ? undefined : columnsProp;
|
|
8980
|
+
const spacing = (_inProps$spacing = inProps.spacing) != null ? _inProps$spacing : level ? undefined : spacingProp;
|
|
8981
|
+
const rowSpacing = (_ref = (_inProps$rowSpacing = inProps.rowSpacing) != null ? _inProps$rowSpacing : inProps.spacing) != null ? _ref : level ? undefined : rowSpacingProp;
|
|
8982
|
+
const columnSpacing = (_ref2 = (_inProps$columnSpacin = inProps.columnSpacing) != null ? _inProps$columnSpacin : inProps.spacing) != null ? _ref2 : level ? undefined : columnSpacingProp;
|
|
8960
8983
|
const ownerState = _extends({}, props, {
|
|
8961
|
-
|
|
8984
|
+
level,
|
|
8962
8985
|
columns,
|
|
8963
8986
|
container,
|
|
8964
8987
|
direction,
|
|
@@ -8980,9 +9003,9 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
8980
9003
|
ownerState: ownerState,
|
|
8981
9004
|
className: clsx(classes.root, className)
|
|
8982
9005
|
}, other));
|
|
8983
|
-
if (
|
|
9006
|
+
if (container) {
|
|
8984
9007
|
result = /*#__PURE__*/jsxRuntime_1(NestedContext.Provider, {
|
|
8985
|
-
value:
|
|
9008
|
+
value: level + 1,
|
|
8986
9009
|
children: result
|
|
8987
9010
|
});
|
|
8988
9011
|
}
|
|
@@ -10216,7 +10239,9 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
10216
10239
|
|
|
10217
10240
|
const shouldSkipGeneratingVar = keys => {
|
|
10218
10241
|
var _keys$;
|
|
10219
|
-
return !!keys[0].match(/(typography|mixins|breakpoints|direction|transitions)/) || keys[0]
|
|
10242
|
+
return !!keys[0].match(/(typography|mixins|breakpoints|direction|transitions)/) || !!keys[0].match(/sxConfig$/) ||
|
|
10243
|
+
// ends with sxConfig
|
|
10244
|
+
keys[0] === 'palette' && !!((_keys$ = keys[1]) != null && _keys$.match(/(mode|contrastThreshold|tonalOffset)/));
|
|
10220
10245
|
};
|
|
10221
10246
|
const defaultTheme$1 = extendTheme();
|
|
10222
10247
|
const {
|
|
@@ -10398,6 +10423,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
10398
10423
|
|
|
10399
10424
|
const _excluded$28 = ["elementType", "externalSlotProps", "ownerState"];
|
|
10400
10425
|
/**
|
|
10426
|
+
* @ignore - do not document.
|
|
10401
10427
|
* Builds the props to be passed into the slot of an unstyled component.
|
|
10402
10428
|
* It merges the internal props of the component with the ones supplied by the user, allowing to customize the behavior.
|
|
10403
10429
|
* If the slot component is not a host component, it also merges in the `ownerState`.
|
|
@@ -10585,20 +10611,6 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
10585
10611
|
onInputChange(event, newInputValue, 'reset');
|
|
10586
10612
|
}
|
|
10587
10613
|
}, [getOptionLabel, inputValue, multiple, onInputChange, setInputValueState, clearOnBlur, value]);
|
|
10588
|
-
const prevValue = React__namespace.useRef();
|
|
10589
|
-
React__namespace.useEffect(() => {
|
|
10590
|
-
const valueChange = value !== prevValue.current;
|
|
10591
|
-
prevValue.current = value;
|
|
10592
|
-
if (focused && !valueChange) {
|
|
10593
|
-
return;
|
|
10594
|
-
}
|
|
10595
|
-
|
|
10596
|
-
// Only reset the input's value when freeSolo if the component's value changes.
|
|
10597
|
-
if (freeSolo && !valueChange) {
|
|
10598
|
-
return;
|
|
10599
|
-
}
|
|
10600
|
-
resetInputValue(null, value);
|
|
10601
|
-
}, [value, resetInputValue, focused, prevValue, freeSolo]);
|
|
10602
10614
|
const [open, setOpenState] = useControlled({
|
|
10603
10615
|
controlled: openProp,
|
|
10604
10616
|
default: false,
|
|
@@ -10620,6 +10632,22 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
10620
10632
|
inputValue: inputValueIsSelectedValue && inputPristine ? '' : inputValue,
|
|
10621
10633
|
getOptionLabel
|
|
10622
10634
|
}) : [];
|
|
10635
|
+
const previousProps = usePreviousProps$1({
|
|
10636
|
+
filteredOptions,
|
|
10637
|
+
value
|
|
10638
|
+
});
|
|
10639
|
+
React__namespace.useEffect(() => {
|
|
10640
|
+
const valueChange = value !== previousProps.value;
|
|
10641
|
+
if (focused && !valueChange) {
|
|
10642
|
+
return;
|
|
10643
|
+
}
|
|
10644
|
+
|
|
10645
|
+
// Only reset the input's value when freeSolo if the component's value changes.
|
|
10646
|
+
if (freeSolo && !valueChange) {
|
|
10647
|
+
return;
|
|
10648
|
+
}
|
|
10649
|
+
resetInputValue(null, value);
|
|
10650
|
+
}, [value, resetInputValue, focused, previousProps.value, freeSolo]);
|
|
10623
10651
|
const listboxAvailable = open && filteredOptions.length > 0 && !readOnly;
|
|
10624
10652
|
{
|
|
10625
10653
|
if (value !== null && !freeSolo && options.length > 0) {
|
|
@@ -10710,7 +10738,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
10710
10738
|
}
|
|
10711
10739
|
|
|
10712
10740
|
// Scroll active descendant into view.
|
|
10713
|
-
// Logic copied from https://www.w3.org/WAI/
|
|
10741
|
+
// Logic copied from https://www.w3.org/WAI/content-assets/wai-aria-practices/patterns/combobox/examples/js/select-only.js
|
|
10714
10742
|
//
|
|
10715
10743
|
// Consider this API instead once it has a better browser support:
|
|
10716
10744
|
// .scrollIntoView({ scrollMode: 'if-needed', block: 'nearest' });
|
|
@@ -10790,10 +10818,31 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
10790
10818
|
}
|
|
10791
10819
|
}
|
|
10792
10820
|
});
|
|
10821
|
+
const checkHighlightedOptionExists = () => {
|
|
10822
|
+
var _previousProps$value;
|
|
10823
|
+
if (highlightedIndexRef.current !== -1 && previousProps.filteredOptions && previousProps.filteredOptions.length !== filteredOptions.length && (multiple ? previousProps.value.every((val, i) => getOptionLabel(value[i]) === getOptionLabel(val)) : getOptionLabel((_previousProps$value = previousProps.value) != null ? _previousProps$value : '') === getOptionLabel(value != null ? value : ''))) {
|
|
10824
|
+
const previousHighlightedOption = previousProps.filteredOptions[highlightedIndexRef.current];
|
|
10825
|
+
if (previousHighlightedOption) {
|
|
10826
|
+
const previousHighlightedOptionExists = filteredOptions.some(option => {
|
|
10827
|
+
return getOptionLabel(option) === getOptionLabel(previousHighlightedOption);
|
|
10828
|
+
});
|
|
10829
|
+
if (previousHighlightedOptionExists) {
|
|
10830
|
+
return true;
|
|
10831
|
+
}
|
|
10832
|
+
}
|
|
10833
|
+
}
|
|
10834
|
+
return false;
|
|
10835
|
+
};
|
|
10793
10836
|
const syncHighlightedIndex = React__namespace.useCallback(() => {
|
|
10794
10837
|
if (!popupOpen) {
|
|
10795
10838
|
return;
|
|
10796
10839
|
}
|
|
10840
|
+
|
|
10841
|
+
// Check if the previously highlighted option still exists in the updated filtered options list and if the value hasn't changed
|
|
10842
|
+
// If it exists and the value hasn't changed, return, otherwise continue execution
|
|
10843
|
+
if (checkHighlightedOptionExists()) {
|
|
10844
|
+
return;
|
|
10845
|
+
}
|
|
10797
10846
|
const valueItem = multiple ? value[0] : value;
|
|
10798
10847
|
|
|
10799
10848
|
// The popup is empty, reset
|
|
@@ -11352,6 +11401,16 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
11352
11401
|
};
|
|
11353
11402
|
}
|
|
11354
11403
|
|
|
11404
|
+
/**
|
|
11405
|
+
*
|
|
11406
|
+
* Demos:
|
|
11407
|
+
*
|
|
11408
|
+
* - [Unstyled badge](https://mui.com/base/react-badge/#hook)
|
|
11409
|
+
*
|
|
11410
|
+
* API:
|
|
11411
|
+
*
|
|
11412
|
+
* - [useBadge API](https://mui.com/base/api/use-badge/)
|
|
11413
|
+
*/
|
|
11355
11414
|
function useBadge(parameters) {
|
|
11356
11415
|
const {
|
|
11357
11416
|
badgeContent: badgeContentProp,
|
|
@@ -15228,6 +15287,16 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
15228
15287
|
}
|
|
15229
15288
|
return cachedSupportsTouchActionNone;
|
|
15230
15289
|
}
|
|
15290
|
+
/**
|
|
15291
|
+
*
|
|
15292
|
+
* Demos:
|
|
15293
|
+
*
|
|
15294
|
+
* - [Unstyled Slider](https://mui.com/base/react-slider/#hook)
|
|
15295
|
+
*
|
|
15296
|
+
* API:
|
|
15297
|
+
*
|
|
15298
|
+
* - [useSlider API](https://mui.com/base/api/use-slider/)
|
|
15299
|
+
*/
|
|
15231
15300
|
function useSlider(parameters) {
|
|
15232
15301
|
const {
|
|
15233
15302
|
'aria-labelledby': ariaLabelledby,
|
|
@@ -25755,7 +25824,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
25755
25824
|
onChange,
|
|
25756
25825
|
onFocus,
|
|
25757
25826
|
readOnly,
|
|
25758
|
-
required,
|
|
25827
|
+
required = false,
|
|
25759
25828
|
tabIndex,
|
|
25760
25829
|
type,
|
|
25761
25830
|
value
|
|
@@ -26095,10 +26164,12 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
26095
26164
|
defaultChecked: PropTypes.bool,
|
|
26096
26165
|
/**
|
|
26097
26166
|
* If `true`, the component is disabled.
|
|
26167
|
+
* @default false
|
|
26098
26168
|
*/
|
|
26099
26169
|
disabled: PropTypes.bool,
|
|
26100
26170
|
/**
|
|
26101
26171
|
* If `true`, the ripple effect is disabled.
|
|
26172
|
+
* @default false
|
|
26102
26173
|
*/
|
|
26103
26174
|
disableRipple: PropTypes.bool,
|
|
26104
26175
|
/**
|
|
@@ -26140,6 +26211,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
26140
26211
|
onChange: PropTypes.func,
|
|
26141
26212
|
/**
|
|
26142
26213
|
* If `true`, the `input` element is required.
|
|
26214
|
+
* @default false
|
|
26143
26215
|
*/
|
|
26144
26216
|
required: PropTypes.bool,
|
|
26145
26217
|
/**
|
|
@@ -34652,7 +34724,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
34652
34724
|
}
|
|
34653
34725
|
|
|
34654
34726
|
/**
|
|
34655
|
-
* A permanently displayed menu following https://www.w3.org/WAI/ARIA/apg/patterns/
|
|
34727
|
+
* A permanently displayed menu following https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/.
|
|
34656
34728
|
* It's exposed to help customization of the [`Menu`](/material-ui/api/menu/) component if you
|
|
34657
34729
|
* use it separately you need to move focus into the component manually. Once
|
|
34658
34730
|
* the focus is placed inside the component it is fully keyboard accessible.
|
|
@@ -37726,6 +37798,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
37726
37798
|
disabled: PropTypes.bool,
|
|
37727
37799
|
/**
|
|
37728
37800
|
* If `true`, the ripple effect is disabled.
|
|
37801
|
+
* @default false
|
|
37729
37802
|
*/
|
|
37730
37803
|
disableRipple: PropTypes.bool,
|
|
37731
37804
|
/**
|
|
@@ -37759,6 +37832,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
37759
37832
|
onChange: PropTypes.func,
|
|
37760
37833
|
/**
|
|
37761
37834
|
* If `true`, the `input` element is required.
|
|
37835
|
+
* @default false
|
|
37762
37836
|
*/
|
|
37763
37837
|
required: PropTypes.bool,
|
|
37764
37838
|
/**
|
|
@@ -38882,7 +38956,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
38882
38956
|
if (!readOnly) {
|
|
38883
38957
|
const validKeys = [' ', 'ArrowUp', 'ArrowDown',
|
|
38884
38958
|
// The native select doesn't respond to enter on macOS, but it's recommended by
|
|
38885
|
-
// https://www.w3.org/WAI/ARIA/apg/
|
|
38959
|
+
// https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/
|
|
38886
38960
|
'Enter'];
|
|
38887
38961
|
if (validKeys.indexOf(event.key) !== -1) {
|
|
38888
38962
|
event.preventDefault();
|
|
@@ -42067,6 +42141,10 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
42067
42141
|
}));
|
|
42068
42142
|
let hystersisOpen = false;
|
|
42069
42143
|
let hystersisTimer = null;
|
|
42144
|
+
let cursorPosition = {
|
|
42145
|
+
x: 0,
|
|
42146
|
+
y: 0
|
|
42147
|
+
};
|
|
42070
42148
|
function composeEventHandler(handler, eventHandler) {
|
|
42071
42149
|
return event => {
|
|
42072
42150
|
if (eventHandler) {
|
|
@@ -42304,17 +42382,13 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
42304
42382
|
if (!title && title !== 0) {
|
|
42305
42383
|
open = false;
|
|
42306
42384
|
}
|
|
42307
|
-
const positionRef = React__namespace.useRef({
|
|
42308
|
-
x: 0,
|
|
42309
|
-
y: 0
|
|
42310
|
-
});
|
|
42311
42385
|
const popperRef = React__namespace.useRef();
|
|
42312
42386
|
const handleMouseMove = event => {
|
|
42313
42387
|
const childrenProps = children.props;
|
|
42314
42388
|
if (childrenProps.onMouseMove) {
|
|
42315
42389
|
childrenProps.onMouseMove(event);
|
|
42316
42390
|
}
|
|
42317
|
-
|
|
42391
|
+
cursorPosition = {
|
|
42318
42392
|
x: event.clientX,
|
|
42319
42393
|
y: event.clientY
|
|
42320
42394
|
};
|
|
@@ -42420,10 +42494,10 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
42420
42494
|
placement: placement,
|
|
42421
42495
|
anchorEl: followCursor ? {
|
|
42422
42496
|
getBoundingClientRect: () => ({
|
|
42423
|
-
top:
|
|
42424
|
-
left:
|
|
42425
|
-
right:
|
|
42426
|
-
bottom:
|
|
42497
|
+
top: cursorPosition.y,
|
|
42498
|
+
left: cursorPosition.x,
|
|
42499
|
+
right: cursorPosition.x,
|
|
42500
|
+
bottom: cursorPosition.y,
|
|
42427
42501
|
width: 0,
|
|
42428
42502
|
height: 0
|
|
42429
42503
|
})
|
|
@@ -45173,6 +45247,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
45173
45247
|
disabled: PropTypes.bool,
|
|
45174
45248
|
/**
|
|
45175
45249
|
* If `true`, the ripple effect is disabled.
|
|
45250
|
+
* @default false
|
|
45176
45251
|
*/
|
|
45177
45252
|
disableRipple: PropTypes.bool,
|
|
45178
45253
|
/**
|
|
@@ -45209,6 +45284,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
45209
45284
|
onChange: PropTypes.func,
|
|
45210
45285
|
/**
|
|
45211
45286
|
* If `true`, the `input` element is required.
|
|
45287
|
+
* @default false
|
|
45212
45288
|
*/
|
|
45213
45289
|
required: PropTypes.bool,
|
|
45214
45290
|
/**
|
|
@@ -47229,6 +47305,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
47229
47305
|
direction: PropTypes.oneOf(['left', 'right']).isRequired,
|
|
47230
47306
|
/**
|
|
47231
47307
|
* If `true`, the component is disabled.
|
|
47308
|
+
* @default false
|
|
47232
47309
|
*/
|
|
47233
47310
|
disabled: PropTypes.bool,
|
|
47234
47311
|
/**
|