@mui/material 5.11.5 → 5.11.7
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/Box/Box.d.ts +3 -2
- package/Button/Button.js +0 -2
- package/CHANGELOG.md +160 -0
- 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/Radio/Radio.js +2 -0
- package/Slider/Slider.d.ts +215 -35
- package/Slider/Slider.js +7 -7
- package/Slider/SliderValueLabel.d.ts +1 -1
- package/Slider/SliderValueLabel.js +3 -0
- package/Slider/SliderValueLabel.types.d.ts +1 -1
- package/Slider/index.d.ts +2 -0
- package/Slider/index.js +2 -1
- package/Slider/sliderClasses.d.ts +40 -11
- package/Slider/sliderClasses.js +5 -3
- package/SwipeableDrawer/SwipeableDrawer.d.ts +15 -0
- package/SwipeableDrawer/SwipeableDrawer.js +48 -17
- 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/Button/Button.js +0 -2
- package/legacy/Checkbox/Checkbox.js +3 -0
- package/legacy/Radio/Radio.js +2 -0
- package/legacy/Slider/Slider.js +7 -7
- package/legacy/Slider/SliderValueLabel.js +3 -0
- package/legacy/Slider/index.js +2 -1
- package/legacy/Slider/sliderClasses.js +5 -3
- package/legacy/SwipeableDrawer/SwipeableDrawer.js +50 -17
- 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/Button/Button.js +0 -2
- package/modern/Checkbox/Checkbox.js +3 -0
- package/modern/Radio/Radio.js +2 -0
- package/modern/Slider/Slider.js +7 -7
- package/modern/Slider/SliderValueLabel.js +3 -0
- package/modern/Slider/index.js +2 -1
- package/modern/Slider/sliderClasses.js +5 -3
- package/modern/SwipeableDrawer/SwipeableDrawer.js +47 -17
- 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/Button/Button.js +0 -2
- package/node/Checkbox/Checkbox.js +3 -0
- package/node/Radio/Radio.js +2 -0
- package/node/Slider/Slider.js +6 -6
- package/node/Slider/SliderValueLabel.js +3 -0
- package/node/Slider/index.js +12 -2
- package/node/Slider/sliderClasses.js +6 -3
- package/node/SwipeableDrawer/SwipeableDrawer.js +48 -17
- 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 +121 -58
- 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.7
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -10216,7 +10216,9 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
10216
10216
|
|
|
10217
10217
|
const shouldSkipGeneratingVar = keys => {
|
|
10218
10218
|
var _keys$;
|
|
10219
|
-
return !!keys[0].match(/(typography|mixins|breakpoints|direction|transitions)/) || keys[0]
|
|
10219
|
+
return !!keys[0].match(/(typography|mixins|breakpoints|direction|transitions)/) || !!keys[0].match(/sxConfig$/) ||
|
|
10220
|
+
// ends with sxConfig
|
|
10221
|
+
keys[0] === 'palette' && !!((_keys$ = keys[1]) != null && _keys$.match(/(mode|contrastThreshold|tonalOffset)/));
|
|
10220
10222
|
};
|
|
10221
10223
|
const defaultTheme$1 = extendTheme();
|
|
10222
10224
|
const {
|
|
@@ -10585,20 +10587,6 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
10585
10587
|
onInputChange(event, newInputValue, 'reset');
|
|
10586
10588
|
}
|
|
10587
10589
|
}, [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
10590
|
const [open, setOpenState] = useControlled({
|
|
10603
10591
|
controlled: openProp,
|
|
10604
10592
|
default: false,
|
|
@@ -10620,6 +10608,22 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
10620
10608
|
inputValue: inputValueIsSelectedValue && inputPristine ? '' : inputValue,
|
|
10621
10609
|
getOptionLabel
|
|
10622
10610
|
}) : [];
|
|
10611
|
+
const previousProps = usePreviousProps$1({
|
|
10612
|
+
filteredOptions,
|
|
10613
|
+
value
|
|
10614
|
+
});
|
|
10615
|
+
React__namespace.useEffect(() => {
|
|
10616
|
+
const valueChange = value !== previousProps.value;
|
|
10617
|
+
if (focused && !valueChange) {
|
|
10618
|
+
return;
|
|
10619
|
+
}
|
|
10620
|
+
|
|
10621
|
+
// Only reset the input's value when freeSolo if the component's value changes.
|
|
10622
|
+
if (freeSolo && !valueChange) {
|
|
10623
|
+
return;
|
|
10624
|
+
}
|
|
10625
|
+
resetInputValue(null, value);
|
|
10626
|
+
}, [value, resetInputValue, focused, previousProps.value, freeSolo]);
|
|
10623
10627
|
const listboxAvailable = open && filteredOptions.length > 0 && !readOnly;
|
|
10624
10628
|
{
|
|
10625
10629
|
if (value !== null && !freeSolo && options.length > 0) {
|
|
@@ -10790,10 +10794,31 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
10790
10794
|
}
|
|
10791
10795
|
}
|
|
10792
10796
|
});
|
|
10797
|
+
const checkHighlightedOptionExists = () => {
|
|
10798
|
+
var _previousProps$value;
|
|
10799
|
+
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 : ''))) {
|
|
10800
|
+
const previousHighlightedOption = previousProps.filteredOptions[highlightedIndexRef.current];
|
|
10801
|
+
if (previousHighlightedOption) {
|
|
10802
|
+
const previousHighlightedOptionExists = filteredOptions.some(option => {
|
|
10803
|
+
return getOptionLabel(option) === getOptionLabel(previousHighlightedOption);
|
|
10804
|
+
});
|
|
10805
|
+
if (previousHighlightedOptionExists) {
|
|
10806
|
+
return true;
|
|
10807
|
+
}
|
|
10808
|
+
}
|
|
10809
|
+
}
|
|
10810
|
+
return false;
|
|
10811
|
+
};
|
|
10793
10812
|
const syncHighlightedIndex = React__namespace.useCallback(() => {
|
|
10794
10813
|
if (!popupOpen) {
|
|
10795
10814
|
return;
|
|
10796
10815
|
}
|
|
10816
|
+
|
|
10817
|
+
// Check if the previously highlighted option still exists in the updated filtered options list and if the value hasn't changed
|
|
10818
|
+
// If it exists and the value hasn't changed, return, otherwise continue execution
|
|
10819
|
+
if (checkHighlightedOptionExists()) {
|
|
10820
|
+
return;
|
|
10821
|
+
}
|
|
10797
10822
|
const valueItem = multiple ? value[0] : value;
|
|
10798
10823
|
|
|
10799
10824
|
// The popup is empty, reset
|
|
@@ -15086,12 +15111,6 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
15086
15111
|
NoSsr['propTypes' + ''] = exactProp(NoSsr.propTypes);
|
|
15087
15112
|
}
|
|
15088
15113
|
|
|
15089
|
-
function getSliderUtilityClass(slot) {
|
|
15090
|
-
return generateUtilityClass('MuiSlider', slot);
|
|
15091
|
-
}
|
|
15092
|
-
const sliderUnstyledClasses = generateUtilityClasses('MuiSlider', ['root', 'active', 'focusVisible', 'disabled', 'dragging', 'marked', 'vertical', 'trackInverted', 'trackFalse', 'rail', 'track', 'mark', 'markActive', 'markLabel', 'markLabelActive', 'thumb', 'valueLabel', 'valueLabelOpen', 'valueLabelCircle', 'valueLabelLabel']);
|
|
15093
|
-
var sliderUnstyledClasses$1 = sliderUnstyledClasses;
|
|
15094
|
-
|
|
15095
15114
|
const INTENTIONAL_DRAG_COUNT_THRESHOLD = 2;
|
|
15096
15115
|
function asc(a, b) {
|
|
15097
15116
|
return a - b;
|
|
@@ -24516,8 +24535,6 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
24516
24535
|
color: (theme.vars || theme).palette.action.disabled
|
|
24517
24536
|
}, ownerState.variant === 'outlined' && {
|
|
24518
24537
|
border: `1px solid ${(theme.vars || theme).palette.action.disabledBackground}`
|
|
24519
|
-
}, ownerState.variant === 'outlined' && ownerState.color === 'secondary' && {
|
|
24520
|
-
border: `1px solid ${(theme.vars || theme).palette.action.disabled}`
|
|
24521
24538
|
}, ownerState.variant === 'contained' && {
|
|
24522
24539
|
color: (theme.vars || theme).palette.action.disabled,
|
|
24523
24540
|
boxShadow: (theme.vars || theme).shadows[0],
|
|
@@ -25763,7 +25780,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
25763
25780
|
onChange,
|
|
25764
25781
|
onFocus,
|
|
25765
25782
|
readOnly,
|
|
25766
|
-
required,
|
|
25783
|
+
required = false,
|
|
25767
25784
|
tabIndex,
|
|
25768
25785
|
type,
|
|
25769
25786
|
value
|
|
@@ -26103,10 +26120,12 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
26103
26120
|
defaultChecked: PropTypes.bool,
|
|
26104
26121
|
/**
|
|
26105
26122
|
* If `true`, the component is disabled.
|
|
26123
|
+
* @default false
|
|
26106
26124
|
*/
|
|
26107
26125
|
disabled: PropTypes.bool,
|
|
26108
26126
|
/**
|
|
26109
26127
|
* If `true`, the ripple effect is disabled.
|
|
26128
|
+
* @default false
|
|
26110
26129
|
*/
|
|
26111
26130
|
disableRipple: PropTypes.bool,
|
|
26112
26131
|
/**
|
|
@@ -26148,6 +26167,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
26148
26167
|
onChange: PropTypes.func,
|
|
26149
26168
|
/**
|
|
26150
26169
|
* If `true`, the `input` element is required.
|
|
26170
|
+
* @default false
|
|
26151
26171
|
*/
|
|
26152
26172
|
required: PropTypes.bool,
|
|
26153
26173
|
/**
|
|
@@ -37734,6 +37754,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
37734
37754
|
disabled: PropTypes.bool,
|
|
37735
37755
|
/**
|
|
37736
37756
|
* If `true`, the ripple effect is disabled.
|
|
37757
|
+
* @default false
|
|
37737
37758
|
*/
|
|
37738
37759
|
disableRipple: PropTypes.bool,
|
|
37739
37760
|
/**
|
|
@@ -37767,6 +37788,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
37767
37788
|
onChange: PropTypes.func,
|
|
37768
37789
|
/**
|
|
37769
37790
|
* If `true`, the `input` element is required.
|
|
37791
|
+
* @default false
|
|
37770
37792
|
*/
|
|
37771
37793
|
required: PropTypes.bool,
|
|
37772
37794
|
/**
|
|
@@ -39728,7 +39750,10 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
39728
39750
|
} ;
|
|
39729
39751
|
var Skeleton$1 = Skeleton;
|
|
39730
39752
|
|
|
39731
|
-
|
|
39753
|
+
function getSliderUtilityClass(slot) {
|
|
39754
|
+
return generateUtilityClass('MuiSlider', slot);
|
|
39755
|
+
}
|
|
39756
|
+
const sliderClasses = generateUtilityClasses('MuiSlider', ['root', 'active', 'colorPrimary', 'colorSecondary', 'disabled', 'dragging', 'focusVisible', 'mark', 'markActive', 'marked', 'markLabel', 'markLabelActive', 'rail', 'sizeSmall', 'thumb', 'thumbColorPrimary', 'thumbColorSecondary', 'track', 'trackInverted', 'trackFalse', 'thumbSizeSmall', 'valueLabel', 'valueLabelOpen', 'valueLabelCircle', 'valueLabelLabel', 'vertical']);
|
|
39732
39757
|
var sliderClasses$1 = sliderClasses;
|
|
39733
39758
|
|
|
39734
39759
|
const useValueLabelClasses = props => {
|
|
@@ -39746,13 +39771,16 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
39746
39771
|
/**
|
|
39747
39772
|
* @ignore - internal component.
|
|
39748
39773
|
*/
|
|
39749
|
-
function SliderValueLabel
|
|
39774
|
+
function SliderValueLabel(props) {
|
|
39750
39775
|
const {
|
|
39751
39776
|
children,
|
|
39752
39777
|
className,
|
|
39753
39778
|
value
|
|
39754
39779
|
} = props;
|
|
39755
39780
|
const classes = useValueLabelClasses(props);
|
|
39781
|
+
if (!children) {
|
|
39782
|
+
return null;
|
|
39783
|
+
}
|
|
39756
39784
|
return /*#__PURE__*/React__namespace.cloneElement(children, {
|
|
39757
39785
|
className: clsx(children.props.className)
|
|
39758
39786
|
}, /*#__PURE__*/jsxRuntime_2(React__namespace.Fragment, {
|
|
@@ -39769,7 +39797,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
39769
39797
|
})]
|
|
39770
39798
|
}));
|
|
39771
39799
|
}
|
|
39772
|
-
SliderValueLabel
|
|
39800
|
+
SliderValueLabel.propTypes = {
|
|
39773
39801
|
children: PropTypes.element.isRequired,
|
|
39774
39802
|
className: PropTypes.string,
|
|
39775
39803
|
value: PropTypes.node
|
|
@@ -40016,7 +40044,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
40016
40044
|
*/
|
|
40017
40045
|
children: PropTypes.node
|
|
40018
40046
|
} ;
|
|
40019
|
-
const
|
|
40047
|
+
const StyledSliderValueLabel = styled$1(SliderValueLabel, {
|
|
40020
40048
|
name: 'MuiSlider',
|
|
40021
40049
|
slot: 'ValueLabel',
|
|
40022
40050
|
overridesResolver: (props, styles) => styles.valueLabel
|
|
@@ -40074,7 +40102,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
40074
40102
|
fontSize: theme.typography.pxToRem(12),
|
|
40075
40103
|
padding: '0.25rem 0.5rem'
|
|
40076
40104
|
}));
|
|
40077
|
-
|
|
40105
|
+
StyledSliderValueLabel.propTypes /* remove-proptypes */ = {
|
|
40078
40106
|
// ----------------------------- Warning --------------------------------
|
|
40079
40107
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
40080
40108
|
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
@@ -40275,7 +40303,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
40275
40303
|
const RailSlot = (_ref2 = (_slots$rail = slots == null ? void 0 : slots.rail) != null ? _slots$rail : components.Rail) != null ? _ref2 : SliderRail;
|
|
40276
40304
|
const TrackSlot = (_ref3 = (_slots$track = slots == null ? void 0 : slots.track) != null ? _slots$track : components.Track) != null ? _ref3 : SliderTrack;
|
|
40277
40305
|
const ThumbSlot = (_ref4 = (_slots$thumb = slots == null ? void 0 : slots.thumb) != null ? _slots$thumb : components.Thumb) != null ? _ref4 : SliderThumb;
|
|
40278
|
-
const ValueLabelSlot = (_ref5 = (_slots$valueLabel = slots == null ? void 0 : slots.valueLabel) != null ? _slots$valueLabel : components.ValueLabel) != null ? _ref5 :
|
|
40306
|
+
const ValueLabelSlot = (_ref5 = (_slots$valueLabel = slots == null ? void 0 : slots.valueLabel) != null ? _slots$valueLabel : components.ValueLabel) != null ? _ref5 : StyledSliderValueLabel;
|
|
40279
40307
|
const MarkSlot = (_ref6 = (_slots$mark = slots == null ? void 0 : slots.mark) != null ? _slots$mark : components.Mark) != null ? _ref6 : SliderMark;
|
|
40280
40308
|
const MarkLabelSlot = (_ref7 = (_slots$markLabel = slots == null ? void 0 : slots.markLabel) != null ? _slots$markLabel : components.MarkLabel) != null ? _ref7 : SliderMarkLabel;
|
|
40281
40309
|
const InputSlot = (_ref8 = (_slots$input = slots == null ? void 0 : slots.input) != null ? _slots$input : components.Input) != null ? _ref8 : 'input';
|
|
@@ -42069,6 +42097,10 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
42069
42097
|
}));
|
|
42070
42098
|
let hystersisOpen = false;
|
|
42071
42099
|
let hystersisTimer = null;
|
|
42100
|
+
let cursorPosition = {
|
|
42101
|
+
x: 0,
|
|
42102
|
+
y: 0
|
|
42103
|
+
};
|
|
42072
42104
|
function composeEventHandler(handler, eventHandler) {
|
|
42073
42105
|
return event => {
|
|
42074
42106
|
if (eventHandler) {
|
|
@@ -42306,17 +42338,13 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
42306
42338
|
if (!title && title !== 0) {
|
|
42307
42339
|
open = false;
|
|
42308
42340
|
}
|
|
42309
|
-
const positionRef = React__namespace.useRef({
|
|
42310
|
-
x: 0,
|
|
42311
|
-
y: 0
|
|
42312
|
-
});
|
|
42313
42341
|
const popperRef = React__namespace.useRef();
|
|
42314
42342
|
const handleMouseMove = event => {
|
|
42315
42343
|
const childrenProps = children.props;
|
|
42316
42344
|
if (childrenProps.onMouseMove) {
|
|
42317
42345
|
childrenProps.onMouseMove(event);
|
|
42318
42346
|
}
|
|
42319
|
-
|
|
42347
|
+
cursorPosition = {
|
|
42320
42348
|
x: event.clientX,
|
|
42321
42349
|
y: event.clientY
|
|
42322
42350
|
};
|
|
@@ -42422,10 +42450,10 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
42422
42450
|
placement: placement,
|
|
42423
42451
|
anchorEl: followCursor ? {
|
|
42424
42452
|
getBoundingClientRect: () => ({
|
|
42425
|
-
top:
|
|
42426
|
-
left:
|
|
42427
|
-
right:
|
|
42428
|
-
bottom:
|
|
42453
|
+
top: cursorPosition.y,
|
|
42454
|
+
left: cursorPosition.x,
|
|
42455
|
+
right: cursorPosition.x,
|
|
42456
|
+
bottom: cursorPosition.y,
|
|
42429
42457
|
width: 0,
|
|
42430
42458
|
height: 0
|
|
42431
42459
|
})
|
|
@@ -44347,7 +44375,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
44347
44375
|
var SwipeArea$1 = SwipeArea;
|
|
44348
44376
|
|
|
44349
44377
|
const _excluded$k = ["BackdropProps"],
|
|
44350
|
-
_excluded2 = ["anchor", "disableBackdropTransition", "disableDiscovery", "disableSwipeToOpen", "hideBackdrop", "hysteresis", "minFlingVelocity", "ModalProps", "onClose", "onOpen", "open", "PaperProps", "SwipeAreaProps", "swipeAreaWidth", "transitionDuration", "variant"];
|
|
44378
|
+
_excluded2 = ["anchor", "disableBackdropTransition", "disableDiscovery", "disableSwipeToOpen", "hideBackdrop", "hysteresis", "allowSwipeInChildren", "minFlingVelocity", "ModalProps", "onClose", "onOpen", "open", "PaperProps", "SwipeAreaProps", "swipeAreaWidth", "transitionDuration", "variant"];
|
|
44351
44379
|
const UNCERTAINTY_THRESHOLD = 3; // px
|
|
44352
44380
|
|
|
44353
44381
|
// This is the part of the drawer displayed on touch start.
|
|
@@ -44452,6 +44480,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
44452
44480
|
disableSwipeToOpen = iOS,
|
|
44453
44481
|
hideBackdrop,
|
|
44454
44482
|
hysteresis = 0.52,
|
|
44483
|
+
allowSwipeInChildren = false,
|
|
44455
44484
|
minFlingVelocity = 450,
|
|
44456
44485
|
ModalProps: {
|
|
44457
44486
|
BackdropProps
|
|
@@ -44571,6 +44600,30 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
44571
44600
|
});
|
|
44572
44601
|
}
|
|
44573
44602
|
});
|
|
44603
|
+
const startMaybeSwiping = (force = false) => {
|
|
44604
|
+
if (!maybeSwiping) {
|
|
44605
|
+
// on Safari Mobile, if you want to be able to have the 'click' event fired on child elements, nothing in the DOM can be changed.
|
|
44606
|
+
// this is because Safari Mobile will not fire any mouse events (still fires touch though) if the DOM changes during mousemove.
|
|
44607
|
+
// so do this change on first touchmove instead of touchstart
|
|
44608
|
+
if (force || !(disableDiscovery && allowSwipeInChildren)) {
|
|
44609
|
+
ReactDOM.flushSync(() => {
|
|
44610
|
+
setMaybeSwiping(true);
|
|
44611
|
+
});
|
|
44612
|
+
}
|
|
44613
|
+
const horizontalSwipe = isHorizontal(anchor);
|
|
44614
|
+
if (!open && paperRef.current) {
|
|
44615
|
+
// The ref may be null when a parent component updates while swiping.
|
|
44616
|
+
setPosition(getMaxTranslate(horizontalSwipe, paperRef.current) + (disableDiscovery ? 15 : -DRAG_STARTED_SIGNAL), {
|
|
44617
|
+
changeTransition: false
|
|
44618
|
+
});
|
|
44619
|
+
}
|
|
44620
|
+
swipeInstance.current.velocity = 0;
|
|
44621
|
+
swipeInstance.current.lastTime = null;
|
|
44622
|
+
swipeInstance.current.lastTranslate = null;
|
|
44623
|
+
swipeInstance.current.paperHit = false;
|
|
44624
|
+
touchDetected.current = true;
|
|
44625
|
+
}
|
|
44626
|
+
};
|
|
44574
44627
|
const handleBodyTouchMove = useEventCallback(nativeEvent => {
|
|
44575
44628
|
// the ref may be null when a parent component updates while swiping
|
|
44576
44629
|
if (!paperRef.current || !touchDetected.current) {
|
|
@@ -44581,6 +44634,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
44581
44634
|
if (claimedSwipeInstance !== null && claimedSwipeInstance !== swipeInstance.current) {
|
|
44582
44635
|
return;
|
|
44583
44636
|
}
|
|
44637
|
+
startMaybeSwiping(true);
|
|
44584
44638
|
const anchorRtl = getAnchor(theme, anchor);
|
|
44585
44639
|
const horizontalSwipe = isHorizontal(anchor);
|
|
44586
44640
|
const currentX = calculateCurrentX(anchorRtl, nativeEvent.touches, ownerDocument(nativeEvent.currentTarget));
|
|
@@ -44691,7 +44745,12 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
44691
44745
|
const currentX = calculateCurrentX(anchorRtl, nativeEvent.touches, ownerDocument(nativeEvent.currentTarget));
|
|
44692
44746
|
const currentY = calculateCurrentY(anchorRtl, nativeEvent.touches, ownerWindow(nativeEvent.currentTarget));
|
|
44693
44747
|
if (!open) {
|
|
44694
|
-
|
|
44748
|
+
var _paperRef$current;
|
|
44749
|
+
// logic for if swipe should be ignored:
|
|
44750
|
+
// if disableSwipeToOpen
|
|
44751
|
+
// if target != swipeArea, and target is not a child of paper ref
|
|
44752
|
+
// if is a child of paper ref, and `allowSwipeInChildren` does not allow it
|
|
44753
|
+
if (disableSwipeToOpen || !(nativeEvent.target === swipeAreaRef.current || (_paperRef$current = paperRef.current) != null && _paperRef$current.contains(nativeEvent.target) && (typeof allowSwipeInChildren === 'function' ? allowSwipeInChildren(nativeEvent, swipeAreaRef.current, paperRef.current) : allowSwipeInChildren))) {
|
|
44695
44754
|
return;
|
|
44696
44755
|
}
|
|
44697
44756
|
if (horizontalSwipe) {
|
|
@@ -44706,20 +44765,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
44706
44765
|
claimedSwipeInstance = null;
|
|
44707
44766
|
swipeInstance.current.startX = currentX;
|
|
44708
44767
|
swipeInstance.current.startY = currentY;
|
|
44709
|
-
|
|
44710
|
-
setMaybeSwiping(true);
|
|
44711
|
-
});
|
|
44712
|
-
if (!open && paperRef.current) {
|
|
44713
|
-
// The ref may be null when a parent component updates while swiping.
|
|
44714
|
-
setPosition(getMaxTranslate(horizontalSwipe, paperRef.current) + (disableDiscovery ? 15 : -DRAG_STARTED_SIGNAL), {
|
|
44715
|
-
changeTransition: false
|
|
44716
|
-
});
|
|
44717
|
-
}
|
|
44718
|
-
swipeInstance.current.velocity = 0;
|
|
44719
|
-
swipeInstance.current.lastTime = null;
|
|
44720
|
-
swipeInstance.current.lastTranslate = null;
|
|
44721
|
-
swipeInstance.current.paperHit = false;
|
|
44722
|
-
touchDetected.current = true;
|
|
44768
|
+
startMaybeSwiping();
|
|
44723
44769
|
});
|
|
44724
44770
|
React__namespace.useEffect(() => {
|
|
44725
44771
|
if (variant === 'temporary') {
|
|
@@ -44767,7 +44813,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
44767
44813
|
hideBackdrop: hideBackdrop,
|
|
44768
44814
|
PaperProps: _extends({}, PaperProps, {
|
|
44769
44815
|
style: _extends({
|
|
44770
|
-
pointerEvents: variant === 'temporary' && !open ? 'none' : ''
|
|
44816
|
+
pointerEvents: variant === 'temporary' && !open && !allowSwipeInChildren ? 'none' : ''
|
|
44771
44817
|
}, PaperProps.style),
|
|
44772
44818
|
ref: handleRef
|
|
44773
44819
|
}),
|
|
@@ -44789,6 +44835,19 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
44789
44835
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
44790
44836
|
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
44791
44837
|
// ----------------------------------------------------------------------
|
|
44838
|
+
/**
|
|
44839
|
+
* If set to true, the swipe event will open the drawer even if the user begins the swipe on one of the drawer's children.
|
|
44840
|
+
* This can be useful in scenarios where the drawer is partially visible.
|
|
44841
|
+
* You can customize it further with a callback that determines which children the user can drag over to open the drawer
|
|
44842
|
+
* (for example, to ignore other elements that handle touch move events, like sliders).
|
|
44843
|
+
*
|
|
44844
|
+
* @param {TouchEvent} event The 'touchstart' event
|
|
44845
|
+
* @param {HTMLDivElement} swipeArea The swipe area element
|
|
44846
|
+
* @param {HTMLDivElement} paper The drawer's paper element
|
|
44847
|
+
*
|
|
44848
|
+
* @default false
|
|
44849
|
+
*/
|
|
44850
|
+
allowSwipeInChildren: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
|
|
44792
44851
|
/**
|
|
44793
44852
|
* @ignore
|
|
44794
44853
|
*/
|
|
@@ -45144,6 +45203,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
45144
45203
|
disabled: PropTypes.bool,
|
|
45145
45204
|
/**
|
|
45146
45205
|
* If `true`, the ripple effect is disabled.
|
|
45206
|
+
* @default false
|
|
45147
45207
|
*/
|
|
45148
45208
|
disableRipple: PropTypes.bool,
|
|
45149
45209
|
/**
|
|
@@ -45180,6 +45240,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
45180
45240
|
onChange: PropTypes.func,
|
|
45181
45241
|
/**
|
|
45182
45242
|
* If `true`, the `input` element is required.
|
|
45243
|
+
* @default false
|
|
45183
45244
|
*/
|
|
45184
45245
|
required: PropTypes.bool,
|
|
45185
45246
|
/**
|
|
@@ -47200,6 +47261,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
47200
47261
|
direction: PropTypes.oneOf(['left', 'right']).isRequired,
|
|
47201
47262
|
/**
|
|
47202
47263
|
* If `true`, the component is disabled.
|
|
47264
|
+
* @default false
|
|
47203
47265
|
*/
|
|
47204
47266
|
disabled: PropTypes.bool,
|
|
47205
47267
|
/**
|
|
@@ -48930,7 +48992,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
48930
48992
|
exports.SliderRoot = SliderRoot;
|
|
48931
48993
|
exports.SliderThumb = SliderThumb;
|
|
48932
48994
|
exports.SliderTrack = SliderTrack;
|
|
48933
|
-
exports.SliderValueLabel =
|
|
48995
|
+
exports.SliderValueLabel = StyledSliderValueLabel;
|
|
48934
48996
|
exports.Snackbar = Snackbar$1;
|
|
48935
48997
|
exports.SnackbarContent = SnackbarContent$1;
|
|
48936
48998
|
exports.SpeedDial = SpeedDial$1;
|
|
@@ -49126,6 +49188,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
49126
49188
|
exports.getScopedCssBaselineUtilityClass = getScopedCssBaselineUtilityClass;
|
|
49127
49189
|
exports.getSelectUtilityClasses = getSelectUtilityClasses;
|
|
49128
49190
|
exports.getSkeletonUtilityClass = getSkeletonUtilityClass;
|
|
49191
|
+
exports.getSliderUtilityClass = getSliderUtilityClass;
|
|
49129
49192
|
exports.getSnackbarContentUtilityClass = getSnackbarContentUtilityClass;
|
|
49130
49193
|
exports.getSnackbarUtilityClass = getSnackbarUtilityClass;
|
|
49131
49194
|
exports.getSpeedDialActionUtilityClass = getSpeedDialActionUtilityClass;
|