@mui/material 6.1.3 → 6.1.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/Autocomplete/Autocomplete.js +12 -5
- package/CHANGELOG.md +371 -350
- package/Checkbox/Checkbox.js +1 -0
- package/Dialog/Dialog.d.ts +6 -0
- package/Dialog/Dialog.js +8 -0
- package/IconButton/IconButton.js +5 -16
- package/PigmentHidden/PigmentHidden.js +1 -0
- package/Slider/Slider.js +52 -33
- package/index.js +1 -1
- package/modern/Autocomplete/Autocomplete.js +12 -5
- package/modern/Checkbox/Checkbox.js +1 -0
- package/modern/Dialog/Dialog.js +8 -0
- package/modern/IconButton/IconButton.js +5 -16
- package/modern/PigmentHidden/PigmentHidden.js +1 -0
- package/modern/Slider/Slider.js +52 -33
- package/modern/index.js +1 -1
- package/modern/styles/createPalette.js +78 -70
- package/modern/styles/createThemeNoVars.js +3 -0
- package/modern/useAutocomplete/useAutocomplete.js +1 -3
- package/modern/version/index.js +2 -2
- package/node/Autocomplete/Autocomplete.js +12 -5
- package/node/Checkbox/Checkbox.js +1 -0
- package/node/Dialog/Dialog.js +8 -0
- package/node/IconButton/IconButton.js +5 -16
- package/node/PigmentHidden/PigmentHidden.js +1 -0
- package/node/Slider/Slider.js +50 -32
- package/node/index.js +1 -1
- package/node/styles/createPalette.js +78 -70
- package/node/styles/createThemeNoVars.js +3 -0
- package/node/useAutocomplete/useAutocomplete.js +1 -3
- package/node/version/index.js +2 -2
- package/package.json +6 -6
- package/styles/createPalette.js +78 -70
- package/styles/createThemeNoVars.js +3 -0
- package/useAutocomplete/useAutocomplete.js +1 -3
- package/version/index.js +2 -2
package/Checkbox/Checkbox.js
CHANGED
package/Dialog/Dialog.d.ts
CHANGED
|
@@ -15,6 +15,12 @@ export interface DialogProps extends StandardProps<ModalProps, 'children'> {
|
|
|
15
15
|
* The id(s) of the element(s) that label the dialog.
|
|
16
16
|
*/
|
|
17
17
|
'aria-labelledby'?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Informs assistive technologies that the element is modal.
|
|
20
|
+
* It's added on the element with role="dialog".
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
'aria-modal'?: boolean | 'true' | 'false';
|
|
18
24
|
/**
|
|
19
25
|
* Dialog children, usually the included sub-components.
|
|
20
26
|
*/
|
package/Dialog/Dialog.js
CHANGED
|
@@ -202,6 +202,7 @@ const Dialog = /*#__PURE__*/React.forwardRef(function Dialog(inProps, ref) {
|
|
|
202
202
|
const {
|
|
203
203
|
'aria-describedby': ariaDescribedby,
|
|
204
204
|
'aria-labelledby': ariaLabelledbyProp,
|
|
205
|
+
'aria-modal': ariaModal = true,
|
|
205
206
|
BackdropComponent,
|
|
206
207
|
BackdropProps,
|
|
207
208
|
children,
|
|
@@ -296,6 +297,7 @@ const Dialog = /*#__PURE__*/React.forwardRef(function Dialog(inProps, ref) {
|
|
|
296
297
|
role: "dialog",
|
|
297
298
|
"aria-describedby": ariaDescribedby,
|
|
298
299
|
"aria-labelledby": ariaLabelledby,
|
|
300
|
+
"aria-modal": ariaModal,
|
|
299
301
|
...PaperProps,
|
|
300
302
|
className: clsx(classes.paper, PaperProps.className),
|
|
301
303
|
ownerState: ownerState,
|
|
@@ -321,6 +323,12 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes /* remove-proptypes */
|
|
|
321
323
|
* The id(s) of the element(s) that label the dialog.
|
|
322
324
|
*/
|
|
323
325
|
'aria-labelledby': PropTypes.string,
|
|
326
|
+
/**
|
|
327
|
+
* Informs assistive technologies that the element is modal.
|
|
328
|
+
* It's added on the element with role="dialog".
|
|
329
|
+
* @default true
|
|
330
|
+
*/
|
|
331
|
+
'aria-modal': PropTypes.oneOfType([PropTypes.oneOf(['false', 'true']), PropTypes.bool]),
|
|
324
332
|
/**
|
|
325
333
|
* A backdrop component. This prop enables custom backdrop rendering.
|
|
326
334
|
* @deprecated Use `slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
|
package/IconButton/IconButton.js
CHANGED
|
@@ -49,12 +49,11 @@ const IconButtonRoot = styled(ButtonBase, {
|
|
|
49
49
|
duration: theme.transitions.duration.shortest
|
|
50
50
|
}),
|
|
51
51
|
variants: [{
|
|
52
|
-
props:
|
|
53
|
-
disableRipple: false
|
|
54
|
-
},
|
|
52
|
+
props: props => !props.disableRipple,
|
|
55
53
|
style: {
|
|
54
|
+
'--IconButton-hoverBg': theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.action.active, theme.palette.action.hoverOpacity),
|
|
56
55
|
'&:hover': {
|
|
57
|
-
backgroundColor:
|
|
56
|
+
backgroundColor: 'var(--IconButton-hoverBg)',
|
|
58
57
|
// Reset on touch devices, it doesn't add specificity
|
|
59
58
|
'@media (hover: none)': {
|
|
60
59
|
backgroundColor: 'transparent'
|
|
@@ -113,17 +112,10 @@ const IconButtonRoot = styled(ButtonBase, {
|
|
|
113
112
|
})), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()) // check all the used fields in the style below
|
|
114
113
|
.map(([color]) => ({
|
|
115
114
|
props: {
|
|
116
|
-
color
|
|
117
|
-
disableRipple: false
|
|
115
|
+
color
|
|
118
116
|
},
|
|
119
117
|
style: {
|
|
120
|
-
'
|
|
121
|
-
backgroundColor: theme.vars ? `rgba(${(theme.vars || theme).palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha((theme.vars || theme).palette[color].main, theme.palette.action.hoverOpacity),
|
|
122
|
-
// Reset on touch devices, it doesn't add specificity
|
|
123
|
-
'@media (hover: none)': {
|
|
124
|
-
backgroundColor: 'transparent'
|
|
125
|
-
}
|
|
126
|
-
}
|
|
118
|
+
'--IconButton-hoverBg': theme.vars ? `rgba(${(theme.vars || theme).palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha((theme.vars || theme).palette[color].main, theme.palette.action.hoverOpacity)
|
|
127
119
|
}
|
|
128
120
|
})), {
|
|
129
121
|
props: {
|
|
@@ -164,7 +156,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
164
156
|
color = 'default',
|
|
165
157
|
disabled = false,
|
|
166
158
|
disableFocusRipple = false,
|
|
167
|
-
disableRipple = false,
|
|
168
159
|
size = 'medium',
|
|
169
160
|
...other
|
|
170
161
|
} = props;
|
|
@@ -174,7 +165,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
174
165
|
color,
|
|
175
166
|
disabled,
|
|
176
167
|
disableFocusRipple,
|
|
177
|
-
disableRipple,
|
|
178
168
|
size
|
|
179
169
|
};
|
|
180
170
|
const classes = useUtilityClasses(ownerState);
|
|
@@ -183,7 +173,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
183
173
|
centerRipple: true,
|
|
184
174
|
focusRipple: !disableFocusRipple,
|
|
185
175
|
disabled: disabled,
|
|
186
|
-
disableRipple: disableRipple,
|
|
187
176
|
ref: ref,
|
|
188
177
|
...other,
|
|
189
178
|
ownerState: ownerState,
|
package/Slider/Slider.js
CHANGED
|
@@ -335,7 +335,7 @@ export const SliderThumb = styled('span', {
|
|
|
335
335
|
}
|
|
336
336
|
}))]
|
|
337
337
|
})));
|
|
338
|
-
|
|
338
|
+
const SliderValueLabel = styled(BaseSliderValueLabel, {
|
|
339
339
|
name: 'MuiSlider',
|
|
340
340
|
slot: 'ValueLabel',
|
|
341
341
|
overridesResolver: (props, styles) => styles.valueLabel
|
|
@@ -420,6 +420,29 @@ export const SliderValueLabel = styled(BaseSliderValueLabel, {
|
|
|
420
420
|
}
|
|
421
421
|
}]
|
|
422
422
|
})));
|
|
423
|
+
process.env.NODE_ENV !== "production" ? SliderValueLabel.propTypes /* remove-proptypes */ = {
|
|
424
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
425
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
426
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
427
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
428
|
+
/**
|
|
429
|
+
* @ignore
|
|
430
|
+
*/
|
|
431
|
+
children: PropTypes.element.isRequired,
|
|
432
|
+
/**
|
|
433
|
+
* @ignore
|
|
434
|
+
*/
|
|
435
|
+
index: PropTypes.number.isRequired,
|
|
436
|
+
/**
|
|
437
|
+
* @ignore
|
|
438
|
+
*/
|
|
439
|
+
open: PropTypes.bool.isRequired,
|
|
440
|
+
/**
|
|
441
|
+
* @ignore
|
|
442
|
+
*/
|
|
443
|
+
value: PropTypes.number.isRequired
|
|
444
|
+
} : void 0;
|
|
445
|
+
export { SliderValueLabel };
|
|
423
446
|
export const SliderMark = styled('span', {
|
|
424
447
|
name: 'MuiSlider',
|
|
425
448
|
slot: 'Mark',
|
|
@@ -759,40 +782,36 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
759
782
|
const percent = valueToPercent(value, min, max);
|
|
760
783
|
const style = axisProps[axis].offset(percent);
|
|
761
784
|
const ValueLabelComponent = valueLabelDisplay === 'off' ? Forward : ValueLabelSlot;
|
|
762
|
-
return (
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
...
|
|
775
|
-
|
|
785
|
+
return /*#__PURE__*/ /* TODO v6: Change component structure. It will help in avoiding the complicated React.cloneElement API added in SliderValueLabel component. Should be: Thumb -> Input, ValueLabel. Follow Joy UI's Slider structure. */_jsx(ValueLabelComponent, {
|
|
786
|
+
...(!isHostComponent(ValueLabelComponent) && {
|
|
787
|
+
valueLabelFormat,
|
|
788
|
+
valueLabelDisplay,
|
|
789
|
+
value: typeof valueLabelFormat === 'function' ? valueLabelFormat(scale(value), index) : valueLabelFormat,
|
|
790
|
+
index,
|
|
791
|
+
open: open === index || active === index || valueLabelDisplay === 'on',
|
|
792
|
+
disabled
|
|
793
|
+
}),
|
|
794
|
+
...valueLabelProps,
|
|
795
|
+
children: /*#__PURE__*/_jsx(ThumbSlot, {
|
|
796
|
+
"data-index": index,
|
|
797
|
+
...thumbProps,
|
|
798
|
+
className: clsx(classes.thumb, thumbProps.className, active === index && classes.active, focusedThumbIndex === index && classes.focusVisible),
|
|
799
|
+
style: {
|
|
800
|
+
...style,
|
|
801
|
+
...getThumbStyle(index),
|
|
802
|
+
...thumbProps.style
|
|
803
|
+
},
|
|
804
|
+
children: /*#__PURE__*/_jsx(InputSlot, {
|
|
776
805
|
"data-index": index,
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
},
|
|
784
|
-
children: /*#__PURE__*/_jsx(InputSlot, {
|
|
785
|
-
"data-index": index,
|
|
786
|
-
"aria-label": getAriaLabel ? getAriaLabel(index) : ariaLabel,
|
|
787
|
-
"aria-valuenow": scale(value),
|
|
788
|
-
"aria-labelledby": ariaLabelledby,
|
|
789
|
-
"aria-valuetext": getAriaValueText ? getAriaValueText(scale(value), index) : ariaValuetext,
|
|
790
|
-
value: values[index],
|
|
791
|
-
...inputSliderProps
|
|
792
|
-
})
|
|
806
|
+
"aria-label": getAriaLabel ? getAriaLabel(index) : ariaLabel,
|
|
807
|
+
"aria-valuenow": scale(value),
|
|
808
|
+
"aria-labelledby": ariaLabelledby,
|
|
809
|
+
"aria-valuetext": getAriaValueText ? getAriaValueText(scale(value), index) : ariaValuetext,
|
|
810
|
+
value: values[index],
|
|
811
|
+
...inputSliderProps
|
|
793
812
|
})
|
|
794
|
-
}
|
|
795
|
-
);
|
|
813
|
+
})
|
|
814
|
+
}, index);
|
|
796
815
|
})]
|
|
797
816
|
});
|
|
798
817
|
});
|
package/index.js
CHANGED
|
@@ -533,7 +533,6 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
533
533
|
const classes = useUtilityClasses(ownerState);
|
|
534
534
|
const externalForwardedProps = {
|
|
535
535
|
slots: {
|
|
536
|
-
listbox: ListboxComponentProp,
|
|
537
536
|
paper: PaperComponentProp,
|
|
538
537
|
popper: PopperComponentProp,
|
|
539
538
|
...slots
|
|
@@ -546,7 +545,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
546
545
|
}
|
|
547
546
|
};
|
|
548
547
|
const [ListboxSlot, listboxProps] = useSlot('listbox', {
|
|
549
|
-
elementType:
|
|
548
|
+
elementType: AutocompleteListbox,
|
|
550
549
|
externalForwardedProps,
|
|
551
550
|
ownerState,
|
|
552
551
|
className: classes.listbox,
|
|
@@ -662,8 +661,12 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
662
661
|
});
|
|
663
662
|
let autocompletePopper = null;
|
|
664
663
|
if (groupedOptions.length > 0) {
|
|
665
|
-
autocompletePopper = renderAutocompletePopperChildren(
|
|
666
|
-
|
|
664
|
+
autocompletePopper = renderAutocompletePopperChildren(
|
|
665
|
+
/*#__PURE__*/
|
|
666
|
+
// TODO v7: remove `as` prop and move ListboxComponentProp to externalForwardedProps or remove ListboxComponentProp entirely
|
|
667
|
+
// https://github.com/mui/material-ui/pull/43994#issuecomment-2401945800
|
|
668
|
+
_jsx(ListboxSlot, {
|
|
669
|
+
as: ListboxComponentProp,
|
|
667
670
|
...listboxProps,
|
|
668
671
|
children: groupedOptions.map((option, index) => {
|
|
669
672
|
if (groupBy) {
|
|
@@ -710,7 +713,11 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
710
713
|
ref: setAnchorEl,
|
|
711
714
|
className: classes.inputRoot,
|
|
712
715
|
startAdornment,
|
|
713
|
-
onMouseDown: event =>
|
|
716
|
+
onMouseDown: event => {
|
|
717
|
+
if (event.target === event.currentTarget) {
|
|
718
|
+
handleInputMouseDown(event);
|
|
719
|
+
}
|
|
720
|
+
},
|
|
714
721
|
...((hasClearIcon || hasPopupIcon) && {
|
|
715
722
|
endAdornment: /*#__PURE__*/_jsxs(AutocompleteEndAdornment, {
|
|
716
723
|
className: classes.endAdornment,
|
package/modern/Dialog/Dialog.js
CHANGED
|
@@ -202,6 +202,7 @@ const Dialog = /*#__PURE__*/React.forwardRef(function Dialog(inProps, ref) {
|
|
|
202
202
|
const {
|
|
203
203
|
'aria-describedby': ariaDescribedby,
|
|
204
204
|
'aria-labelledby': ariaLabelledbyProp,
|
|
205
|
+
'aria-modal': ariaModal = true,
|
|
205
206
|
BackdropComponent,
|
|
206
207
|
BackdropProps,
|
|
207
208
|
children,
|
|
@@ -296,6 +297,7 @@ const Dialog = /*#__PURE__*/React.forwardRef(function Dialog(inProps, ref) {
|
|
|
296
297
|
role: "dialog",
|
|
297
298
|
"aria-describedby": ariaDescribedby,
|
|
298
299
|
"aria-labelledby": ariaLabelledby,
|
|
300
|
+
"aria-modal": ariaModal,
|
|
299
301
|
...PaperProps,
|
|
300
302
|
className: clsx(classes.paper, PaperProps.className),
|
|
301
303
|
ownerState: ownerState,
|
|
@@ -321,6 +323,12 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes /* remove-proptypes */
|
|
|
321
323
|
* The id(s) of the element(s) that label the dialog.
|
|
322
324
|
*/
|
|
323
325
|
'aria-labelledby': PropTypes.string,
|
|
326
|
+
/**
|
|
327
|
+
* Informs assistive technologies that the element is modal.
|
|
328
|
+
* It's added on the element with role="dialog".
|
|
329
|
+
* @default true
|
|
330
|
+
*/
|
|
331
|
+
'aria-modal': PropTypes.oneOfType([PropTypes.oneOf(['false', 'true']), PropTypes.bool]),
|
|
324
332
|
/**
|
|
325
333
|
* A backdrop component. This prop enables custom backdrop rendering.
|
|
326
334
|
* @deprecated Use `slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
|
|
@@ -49,12 +49,11 @@ const IconButtonRoot = styled(ButtonBase, {
|
|
|
49
49
|
duration: theme.transitions.duration.shortest
|
|
50
50
|
}),
|
|
51
51
|
variants: [{
|
|
52
|
-
props:
|
|
53
|
-
disableRipple: false
|
|
54
|
-
},
|
|
52
|
+
props: props => !props.disableRipple,
|
|
55
53
|
style: {
|
|
54
|
+
'--IconButton-hoverBg': theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.action.active, theme.palette.action.hoverOpacity),
|
|
56
55
|
'&:hover': {
|
|
57
|
-
backgroundColor:
|
|
56
|
+
backgroundColor: 'var(--IconButton-hoverBg)',
|
|
58
57
|
// Reset on touch devices, it doesn't add specificity
|
|
59
58
|
'@media (hover: none)': {
|
|
60
59
|
backgroundColor: 'transparent'
|
|
@@ -113,17 +112,10 @@ const IconButtonRoot = styled(ButtonBase, {
|
|
|
113
112
|
})), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()) // check all the used fields in the style below
|
|
114
113
|
.map(([color]) => ({
|
|
115
114
|
props: {
|
|
116
|
-
color
|
|
117
|
-
disableRipple: false
|
|
115
|
+
color
|
|
118
116
|
},
|
|
119
117
|
style: {
|
|
120
|
-
'
|
|
121
|
-
backgroundColor: theme.vars ? `rgba(${(theme.vars || theme).palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha((theme.vars || theme).palette[color].main, theme.palette.action.hoverOpacity),
|
|
122
|
-
// Reset on touch devices, it doesn't add specificity
|
|
123
|
-
'@media (hover: none)': {
|
|
124
|
-
backgroundColor: 'transparent'
|
|
125
|
-
}
|
|
126
|
-
}
|
|
118
|
+
'--IconButton-hoverBg': theme.vars ? `rgba(${(theme.vars || theme).palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha((theme.vars || theme).palette[color].main, theme.palette.action.hoverOpacity)
|
|
127
119
|
}
|
|
128
120
|
})), {
|
|
129
121
|
props: {
|
|
@@ -164,7 +156,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
164
156
|
color = 'default',
|
|
165
157
|
disabled = false,
|
|
166
158
|
disableFocusRipple = false,
|
|
167
|
-
disableRipple = false,
|
|
168
159
|
size = 'medium',
|
|
169
160
|
...other
|
|
170
161
|
} = props;
|
|
@@ -174,7 +165,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
174
165
|
color,
|
|
175
166
|
disabled,
|
|
176
167
|
disableFocusRipple,
|
|
177
|
-
disableRipple,
|
|
178
168
|
size
|
|
179
169
|
};
|
|
180
170
|
const classes = useUtilityClasses(ownerState);
|
|
@@ -183,7 +173,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
183
173
|
centerRipple: true,
|
|
184
174
|
focusRipple: !disableFocusRipple,
|
|
185
175
|
disabled: disabled,
|
|
186
|
-
disableRipple: disableRipple,
|
|
187
176
|
ref: ref,
|
|
188
177
|
...other,
|
|
189
178
|
ownerState: ownerState,
|
package/modern/Slider/Slider.js
CHANGED
|
@@ -335,7 +335,7 @@ export const SliderThumb = styled('span', {
|
|
|
335
335
|
}
|
|
336
336
|
}))]
|
|
337
337
|
})));
|
|
338
|
-
|
|
338
|
+
const SliderValueLabel = styled(BaseSliderValueLabel, {
|
|
339
339
|
name: 'MuiSlider',
|
|
340
340
|
slot: 'ValueLabel',
|
|
341
341
|
overridesResolver: (props, styles) => styles.valueLabel
|
|
@@ -420,6 +420,29 @@ export const SliderValueLabel = styled(BaseSliderValueLabel, {
|
|
|
420
420
|
}
|
|
421
421
|
}]
|
|
422
422
|
})));
|
|
423
|
+
process.env.NODE_ENV !== "production" ? SliderValueLabel.propTypes /* remove-proptypes */ = {
|
|
424
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
425
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
426
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
427
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
428
|
+
/**
|
|
429
|
+
* @ignore
|
|
430
|
+
*/
|
|
431
|
+
children: PropTypes.element.isRequired,
|
|
432
|
+
/**
|
|
433
|
+
* @ignore
|
|
434
|
+
*/
|
|
435
|
+
index: PropTypes.number.isRequired,
|
|
436
|
+
/**
|
|
437
|
+
* @ignore
|
|
438
|
+
*/
|
|
439
|
+
open: PropTypes.bool.isRequired,
|
|
440
|
+
/**
|
|
441
|
+
* @ignore
|
|
442
|
+
*/
|
|
443
|
+
value: PropTypes.number.isRequired
|
|
444
|
+
} : void 0;
|
|
445
|
+
export { SliderValueLabel };
|
|
423
446
|
export const SliderMark = styled('span', {
|
|
424
447
|
name: 'MuiSlider',
|
|
425
448
|
slot: 'Mark',
|
|
@@ -759,40 +782,36 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
759
782
|
const percent = valueToPercent(value, min, max);
|
|
760
783
|
const style = axisProps[axis].offset(percent);
|
|
761
784
|
const ValueLabelComponent = valueLabelDisplay === 'off' ? Forward : ValueLabelSlot;
|
|
762
|
-
return (
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
...
|
|
775
|
-
|
|
785
|
+
return /*#__PURE__*/ /* TODO v6: Change component structure. It will help in avoiding the complicated React.cloneElement API added in SliderValueLabel component. Should be: Thumb -> Input, ValueLabel. Follow Joy UI's Slider structure. */_jsx(ValueLabelComponent, {
|
|
786
|
+
...(!isHostComponent(ValueLabelComponent) && {
|
|
787
|
+
valueLabelFormat,
|
|
788
|
+
valueLabelDisplay,
|
|
789
|
+
value: typeof valueLabelFormat === 'function' ? valueLabelFormat(scale(value), index) : valueLabelFormat,
|
|
790
|
+
index,
|
|
791
|
+
open: open === index || active === index || valueLabelDisplay === 'on',
|
|
792
|
+
disabled
|
|
793
|
+
}),
|
|
794
|
+
...valueLabelProps,
|
|
795
|
+
children: /*#__PURE__*/_jsx(ThumbSlot, {
|
|
796
|
+
"data-index": index,
|
|
797
|
+
...thumbProps,
|
|
798
|
+
className: clsx(classes.thumb, thumbProps.className, active === index && classes.active, focusedThumbIndex === index && classes.focusVisible),
|
|
799
|
+
style: {
|
|
800
|
+
...style,
|
|
801
|
+
...getThumbStyle(index),
|
|
802
|
+
...thumbProps.style
|
|
803
|
+
},
|
|
804
|
+
children: /*#__PURE__*/_jsx(InputSlot, {
|
|
776
805
|
"data-index": index,
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
},
|
|
784
|
-
children: /*#__PURE__*/_jsx(InputSlot, {
|
|
785
|
-
"data-index": index,
|
|
786
|
-
"aria-label": getAriaLabel ? getAriaLabel(index) : ariaLabel,
|
|
787
|
-
"aria-valuenow": scale(value),
|
|
788
|
-
"aria-labelledby": ariaLabelledby,
|
|
789
|
-
"aria-valuetext": getAriaValueText ? getAriaValueText(scale(value), index) : ariaValuetext,
|
|
790
|
-
value: values[index],
|
|
791
|
-
...inputSliderProps
|
|
792
|
-
})
|
|
806
|
+
"aria-label": getAriaLabel ? getAriaLabel(index) : ariaLabel,
|
|
807
|
+
"aria-valuenow": scale(value),
|
|
808
|
+
"aria-labelledby": ariaLabelledby,
|
|
809
|
+
"aria-valuetext": getAriaValueText ? getAriaValueText(scale(value), index) : ariaValuetext,
|
|
810
|
+
value: values[index],
|
|
811
|
+
...inputSliderProps
|
|
793
812
|
})
|
|
794
|
-
}
|
|
795
|
-
);
|
|
813
|
+
})
|
|
814
|
+
}, index);
|
|
796
815
|
})]
|
|
797
816
|
});
|
|
798
817
|
});
|
package/modern/index.js
CHANGED