@mui/material 5.14.7 → 5.14.9
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/Accordion/Accordion.d.ts +2 -2
- package/AccordionSummary/AccordionSummary.d.ts +22 -20
- package/AlertTitle/AlertTitle.d.ts +1 -0
- package/AppBar/AppBar.d.ts +33 -31
- package/Avatar/Avatar.d.ts +49 -50
- package/Backdrop/Backdrop.d.ts +87 -85
- package/Badge/Badge.d.ts +2 -2
- package/BottomNavigation/BottomNavigation.d.ts +35 -33
- package/BottomNavigationAction/BottomNavigationAction.d.ts +39 -37
- package/Breadcrumbs/Breadcrumbs.d.ts +70 -67
- package/Button/Button.d.ts +72 -73
- package/Button/Button.js +4 -1
- package/ButtonBase/ButtonBase.d.ts +83 -81
- package/ButtonGroup/ButtonGroup.d.ts +72 -70
- package/ButtonGroup/ButtonGroup.js +86 -54
- package/ButtonGroup/ButtonGroupButtonContext.d.ts +6 -0
- package/ButtonGroup/ButtonGroupButtonContext.js +9 -0
- package/ButtonGroup/buttonGroupClasses.d.ts +6 -0
- package/ButtonGroup/buttonGroupClasses.js +1 -1
- package/CHANGELOG.md +235 -38
- package/Card/Card.d.ts +19 -18
- package/CardActionArea/CardActionArea.d.ts +15 -13
- package/CardContent/CardContent.d.ts +18 -16
- package/CardHeader/CardHeader.d.ts +77 -67
- package/CardMedia/CardMedia.d.ts +30 -28
- package/Chip/Chip.d.ts +84 -82
- package/CircularProgress/CircularProgress.d.ts +1 -1
- package/CircularProgress/CircularProgress.js +1 -1
- package/Container/Container.d.ts +35 -33
- package/DialogContentText/DialogContentText.d.ts +14 -12
- package/DialogTitle/DialogTitle.d.ts +19 -16
- package/Divider/Divider.d.ts +49 -50
- package/Fab/Fab.d.ts +59 -56
- package/FormControl/FormControl.d.ts +74 -72
- package/FormHelperText/FormHelperText.d.ts +52 -50
- package/FormLabel/FormLabel.d.ts +7 -4
- package/Grid/Grid.d.ts +69 -68
- package/Hidden/Hidden.d.ts +10 -10
- package/Icon/Icon.d.ts +50 -48
- package/IconButton/IconButton.d.ts +52 -50
- package/ImageList/ImageList.d.ts +41 -39
- package/ImageListItem/ImageListItem.d.ts +28 -26
- package/ImageListItem/ImageListItem.js +2 -1
- package/InputAdornment/InputAdornment.d.ts +39 -37
- package/InputBase/InputBase.js +1 -1
- package/InputLabel/InputLabel.d.ts +58 -56
- package/InputLabel/InputLabel.js +2 -1
- package/Link/Link.d.ts +37 -39
- package/List/List.d.ts +34 -35
- package/ListItem/ListItem.d.ts +53 -49
- package/ListItemButton/ListItemButton.d.ts +9 -3
- package/ListSubheader/ListSubheader.d.ts +38 -36
- package/MenuItem/MenuItem.d.ts +47 -44
- package/MenuList/MenuList.d.ts +37 -35
- package/Modal/Modal.d.ts +172 -178
- package/Modal/Modal.js +1 -1
- package/PaginationItem/PaginationItem.d.ts +85 -83
- package/Paper/Paper.d.ts +2 -2
- package/README.md +9 -198
- package/Radio/Radio.js +3 -2
- package/Radio/radioClasses.d.ts +2 -0
- package/Radio/radioClasses.js +1 -1
- package/ScopedCssBaseline/ScopedCssBaseline.d.ts +25 -23
- package/Select/SelectInput.js +9 -5
- package/Skeleton/Skeleton.d.ts +42 -40
- package/Slider/Slider.d.ts +249 -247
- package/Slider/Slider.js +9 -86
- package/Stack/Stack.d.ts +39 -38
- package/Step/Step.d.ts +46 -44
- package/StepButton/StepButton.d.ts +27 -25
- package/Stepper/Stepper.d.ts +45 -44
- package/SvgIcon/SvgIcon.d.ts +77 -75
- package/SwipeableDrawer/SwipeableDrawer.js +4 -4
- package/Tab/Tab.d.ts +52 -50
- package/TabScrollButton/TabScrollButton.d.ts +3 -2
- package/Table/Table.d.ts +35 -33
- package/TableBody/TableBody.d.ts +18 -16
- package/TableContainer/TableContainer.d.ts +18 -16
- package/TableFooter/TableFooter.d.ts +18 -16
- package/TableHead/TableHead.d.ts +18 -16
- package/TablePagination/TablePagination.d.ts +113 -112
- package/TableRow/TableRow.d.ts +28 -26
- package/TableSortLabel/TableSortLabel.d.ts +40 -36
- package/Tabs/Tabs.d.ts +153 -150
- package/Tabs/Tabs.js +1 -4
- package/ToggleButton/ToggleButton.d.ts +72 -70
- package/Toolbar/Toolbar.d.ts +29 -27
- package/Typography/Typography.d.ts +2 -2
- package/index.js +1 -1
- package/legacy/Button/Button.js +4 -1
- package/legacy/ButtonGroup/ButtonGroup.js +81 -56
- package/legacy/ButtonGroup/ButtonGroupButtonContext.js +9 -0
- package/legacy/ButtonGroup/buttonGroupClasses.js +1 -1
- package/legacy/CircularProgress/CircularProgress.js +1 -1
- package/legacy/ImageListItem/ImageListItem.js +2 -1
- package/legacy/InputBase/InputBase.js +1 -1
- package/legacy/InputLabel/InputLabel.js +2 -1
- package/legacy/Modal/Modal.js +3 -1
- package/legacy/Radio/Radio.js +3 -2
- package/legacy/Radio/radioClasses.js +1 -1
- package/legacy/Select/SelectInput.js +9 -5
- package/legacy/Slider/Slider.js +9 -86
- package/legacy/SwipeableDrawer/SwipeableDrawer.js +4 -4
- package/legacy/Tabs/Tabs.js +1 -4
- package/legacy/index.js +1 -1
- package/legacy/useTouchRipple/useTouchRipple.js +4 -4
- package/modern/Button/Button.js +4 -1
- package/modern/ButtonGroup/ButtonGroup.js +86 -54
- package/modern/ButtonGroup/ButtonGroupButtonContext.js +9 -0
- package/modern/ButtonGroup/buttonGroupClasses.js +1 -1
- package/modern/CircularProgress/CircularProgress.js +1 -1
- package/modern/ImageListItem/ImageListItem.js +2 -1
- package/modern/InputBase/InputBase.js +1 -1
- package/modern/InputLabel/InputLabel.js +2 -1
- package/modern/Modal/Modal.js +1 -1
- package/modern/Radio/Radio.js +3 -2
- package/modern/Radio/radioClasses.js +1 -1
- package/modern/Select/SelectInput.js +8 -5
- package/modern/Slider/Slider.js +9 -86
- package/modern/SwipeableDrawer/SwipeableDrawer.js +4 -4
- package/modern/Tabs/Tabs.js +1 -4
- package/modern/index.js +1 -1
- package/node/Button/Button.js +4 -1
- package/node/ButtonGroup/ButtonGroup.js +86 -54
- package/node/ButtonGroup/ButtonGroupButtonContext.js +18 -0
- package/node/ButtonGroup/buttonGroupClasses.js +1 -1
- package/node/CircularProgress/CircularProgress.js +1 -1
- package/node/ImageListItem/ImageListItem.js +2 -1
- package/node/InputBase/InputBase.js +1 -1
- package/node/InputLabel/InputLabel.js +2 -1
- package/node/Modal/Modal.js +1 -1
- package/node/Radio/Radio.js +3 -2
- package/node/Radio/radioClasses.js +1 -1
- package/node/Select/SelectInput.js +9 -5
- package/node/Slider/Slider.js +3 -73
- package/node/SwipeableDrawer/SwipeableDrawer.js +4 -4
- package/node/Tabs/Tabs.js +1 -4
- package/node/index.js +1 -1
- package/node/useTouchRipple/useTouchRipple.js +4 -4
- package/package.json +16 -16
- package/umd/material-ui.development.js +258 -254
- package/umd/material-ui.production.min.js +18 -18
- package/useTouchRipple/useTouchRipple.js +4 -4
package/Slider/Slider.d.ts
CHANGED
|
@@ -20,256 +20,258 @@ export interface SliderOwnerState extends SliderProps {
|
|
|
20
20
|
focusedThumbIndex: number;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
export interface SliderOwnProps {
|
|
24
|
+
/**
|
|
25
|
+
* The label of the slider.
|
|
26
|
+
*/
|
|
27
|
+
'aria-label'?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The id of the element containing a label for the slider.
|
|
30
|
+
*/
|
|
31
|
+
'aria-labelledby'?: string;
|
|
32
|
+
/**
|
|
33
|
+
* A string value that provides a user-friendly name for the current value of the slider.
|
|
34
|
+
*/
|
|
35
|
+
'aria-valuetext'?: string;
|
|
36
|
+
/**
|
|
37
|
+
* The color of the component.
|
|
38
|
+
* It supports both default and custom theme colors, which can be added as shown in the
|
|
39
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
|
|
40
|
+
* @default 'primary'
|
|
41
|
+
*/
|
|
42
|
+
color?: OverridableStringUnion<'primary' | 'secondary', SliderPropsColorOverrides>;
|
|
43
|
+
/**
|
|
44
|
+
* The components used for each slot inside.
|
|
45
|
+
*
|
|
46
|
+
* This prop is an alias for the `slots` prop.
|
|
47
|
+
* It's recommended to use the `slots` prop instead.
|
|
48
|
+
*
|
|
49
|
+
* @default {}
|
|
50
|
+
*/
|
|
51
|
+
components?: {
|
|
52
|
+
Root?: React.ElementType;
|
|
53
|
+
Track?: React.ElementType;
|
|
54
|
+
Rail?: React.ElementType;
|
|
55
|
+
Thumb?: React.ElementType;
|
|
56
|
+
Mark?: React.ElementType;
|
|
57
|
+
MarkLabel?: React.ElementType;
|
|
58
|
+
ValueLabel?: React.ElementType;
|
|
59
|
+
Input?: React.ElementType;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* The extra props for the slot components.
|
|
63
|
+
* You can override the existing props or add new ones.
|
|
64
|
+
*
|
|
65
|
+
* This prop is an alias for the `slotProps` prop.
|
|
66
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
67
|
+
*
|
|
68
|
+
* @default {}
|
|
69
|
+
*/
|
|
70
|
+
componentsProps?: {
|
|
71
|
+
root?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
72
|
+
track?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
73
|
+
rail?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
74
|
+
thumb?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
75
|
+
mark?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
76
|
+
markLabel?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
77
|
+
valueLabel?: SlotComponentProps<
|
|
78
|
+
typeof SliderValueLabelComponent,
|
|
79
|
+
SliderComponentsPropsOverrides,
|
|
80
|
+
SliderOwnerState
|
|
81
|
+
>;
|
|
82
|
+
input?: SlotComponentProps<'input', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Override or extend the styles applied to the component.
|
|
86
|
+
*/
|
|
87
|
+
classes?: Partial<SliderClasses>;
|
|
88
|
+
/**
|
|
89
|
+
* @ignore
|
|
90
|
+
*/
|
|
91
|
+
className?: string;
|
|
92
|
+
/**
|
|
93
|
+
* The default value. Use when the component is not controlled.
|
|
94
|
+
*/
|
|
95
|
+
defaultValue?: number | number[];
|
|
96
|
+
/**
|
|
97
|
+
* If `true`, the component is disabled.
|
|
98
|
+
* @default false
|
|
99
|
+
*/
|
|
100
|
+
disabled?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* If `true`, the active thumb doesn't swap when moving pointer over a thumb while dragging another thumb.
|
|
103
|
+
* @default false
|
|
104
|
+
*/
|
|
105
|
+
disableSwap?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Accepts a function which returns a string value that provides a user-friendly name for the thumb labels of the slider.
|
|
108
|
+
* This is important for screen reader users.
|
|
109
|
+
* @param {number} index The thumb label's index to format.
|
|
110
|
+
* @returns {string}
|
|
111
|
+
*/
|
|
112
|
+
getAriaLabel?: (index: number) => string;
|
|
113
|
+
/**
|
|
114
|
+
* Accepts a function which returns a string value that provides a user-friendly name for the current value of the slider.
|
|
115
|
+
* This is important for screen reader users.
|
|
116
|
+
* @param {number} value The thumb label's value to format.
|
|
117
|
+
* @param {number} index The thumb label's index to format.
|
|
118
|
+
* @returns {string}
|
|
119
|
+
*/
|
|
120
|
+
getAriaValueText?: (value: number, index: number) => string;
|
|
121
|
+
/**
|
|
122
|
+
* Marks indicate predetermined values to which the user can move the slider.
|
|
123
|
+
* If `true` the marks are spaced according the value of the `step` prop.
|
|
124
|
+
* If an array, it should contain objects with `value` and an optional `label` keys.
|
|
125
|
+
* @default false
|
|
126
|
+
*/
|
|
127
|
+
marks?: boolean | Mark[];
|
|
128
|
+
/**
|
|
129
|
+
* The maximum allowed value of the slider.
|
|
130
|
+
* Should not be equal to min.
|
|
131
|
+
* @default 100
|
|
132
|
+
*/
|
|
133
|
+
max?: number;
|
|
134
|
+
/**
|
|
135
|
+
* The minimum allowed value of the slider.
|
|
136
|
+
* Should not be equal to max.
|
|
137
|
+
* @default 0
|
|
138
|
+
*/
|
|
139
|
+
min?: number;
|
|
140
|
+
/**
|
|
141
|
+
* Name attribute of the hidden `input` element.
|
|
142
|
+
*/
|
|
143
|
+
name?: string;
|
|
144
|
+
/**
|
|
145
|
+
* Callback function that is fired when the slider's value changed.
|
|
146
|
+
*
|
|
147
|
+
* @param {Event} event The event source of the callback.
|
|
148
|
+
* You can pull out the new value by accessing `event.target.value` (any).
|
|
149
|
+
* **Warning**: This is a generic event not a change event.
|
|
150
|
+
* @param {number | number[]} value The new value.
|
|
151
|
+
* @param {number} activeThumb Index of the currently moved thumb.
|
|
152
|
+
*/
|
|
153
|
+
onChange?: (event: Event, value: number | number[], activeThumb: number) => void;
|
|
154
|
+
/**
|
|
155
|
+
* Callback function that is fired when the `mouseup` is triggered.
|
|
156
|
+
*
|
|
157
|
+
* @param {React.SyntheticEvent | Event} event The event source of the callback. **Warning**: This is a generic event not a change event.
|
|
158
|
+
* @param {number | number[]} value The new value.
|
|
159
|
+
*/
|
|
160
|
+
onChangeCommitted?: (event: React.SyntheticEvent | Event, value: number | number[]) => void;
|
|
161
|
+
/**
|
|
162
|
+
* The component orientation.
|
|
163
|
+
* @default 'horizontal'
|
|
164
|
+
*/
|
|
165
|
+
orientation?: 'horizontal' | 'vertical';
|
|
166
|
+
/**
|
|
167
|
+
* A transformation function, to change the scale of the slider.
|
|
168
|
+
* @param {any} x
|
|
169
|
+
* @returns {any}
|
|
170
|
+
* @default function Identity(x) {
|
|
171
|
+
* return x;
|
|
172
|
+
* }
|
|
173
|
+
*/
|
|
174
|
+
scale?: (value: number) => number;
|
|
175
|
+
/**
|
|
176
|
+
* The size of the slider.
|
|
177
|
+
* @default 'medium'
|
|
178
|
+
*/
|
|
179
|
+
size?: OverridableStringUnion<'small' | 'medium', SliderPropsSizeOverrides>;
|
|
180
|
+
/**
|
|
181
|
+
* The props used for each slot inside the Slider.
|
|
182
|
+
* @default {}
|
|
183
|
+
*/
|
|
184
|
+
slotProps?: {
|
|
185
|
+
root?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
186
|
+
track?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
187
|
+
rail?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
188
|
+
thumb?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
189
|
+
mark?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
190
|
+
markLabel?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
191
|
+
valueLabel?: SlotComponentProps<
|
|
192
|
+
typeof SliderValueLabelComponent,
|
|
193
|
+
SliderComponentsPropsOverrides,
|
|
194
|
+
SliderOwnerState
|
|
195
|
+
>;
|
|
196
|
+
input?: SlotComponentProps<'input', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* The components used for each slot inside the Slider.
|
|
200
|
+
* Either a string to use a HTML element or a component.
|
|
201
|
+
* @default {}
|
|
202
|
+
*/
|
|
203
|
+
slots?: {
|
|
204
|
+
root?: React.ElementType;
|
|
205
|
+
track?: React.ElementType;
|
|
206
|
+
rail?: React.ElementType;
|
|
207
|
+
thumb?: React.ElementType;
|
|
208
|
+
mark?: React.ElementType;
|
|
209
|
+
markLabel?: React.ElementType;
|
|
210
|
+
valueLabel?: React.ElementType;
|
|
211
|
+
input?: React.ElementType;
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* The granularity with which the slider can step through values. (A "discrete" slider.)
|
|
215
|
+
* The `min` prop serves as the origin for the valid values.
|
|
216
|
+
* We recommend (max - min) to be evenly divisible by the step.
|
|
217
|
+
*
|
|
218
|
+
* When step is `null`, the thumb can only be slid onto marks provided with the `marks` prop.
|
|
219
|
+
* @default 1
|
|
220
|
+
*/
|
|
221
|
+
step?: number | null;
|
|
222
|
+
/**
|
|
223
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
224
|
+
*/
|
|
225
|
+
sx?: SxProps<Theme>;
|
|
226
|
+
/**
|
|
227
|
+
* Tab index attribute of the hidden `input` element.
|
|
228
|
+
*/
|
|
229
|
+
tabIndex?: number;
|
|
230
|
+
/**
|
|
231
|
+
* The track presentation:
|
|
232
|
+
*
|
|
233
|
+
* - `normal` the track will render a bar representing the slider value.
|
|
234
|
+
* - `inverted` the track will render a bar representing the remaining slider value.
|
|
235
|
+
* - `false` the track will render without a bar.
|
|
236
|
+
* @default 'normal'
|
|
237
|
+
*/
|
|
238
|
+
track?: 'normal' | false | 'inverted';
|
|
239
|
+
/**
|
|
240
|
+
* The value of the slider.
|
|
241
|
+
* For ranged sliders, provide an array with two values.
|
|
242
|
+
*/
|
|
243
|
+
value?: number | number[];
|
|
244
|
+
/**
|
|
245
|
+
* Controls when the value label is displayed:
|
|
246
|
+
*
|
|
247
|
+
* - `auto` the value label will display when the thumb is hovered or focused.
|
|
248
|
+
* - `on` will display persistently.
|
|
249
|
+
* - `off` will never display.
|
|
250
|
+
* @default 'off'
|
|
251
|
+
*/
|
|
252
|
+
valueLabelDisplay?: 'on' | 'auto' | 'off';
|
|
253
|
+
/**
|
|
254
|
+
* The format function the value label's value.
|
|
255
|
+
*
|
|
256
|
+
* When a function is provided, it should have the following signature:
|
|
257
|
+
*
|
|
258
|
+
* - {number} value The value label's value to format
|
|
259
|
+
* - {number} index The value label's index to format
|
|
260
|
+
* @param {any} x
|
|
261
|
+
* @returns {any}
|
|
262
|
+
* @default function Identity(x) {
|
|
263
|
+
* return x;
|
|
264
|
+
* }
|
|
265
|
+
*/
|
|
266
|
+
valueLabelFormat?: string | ((value: number, index: number) => React.ReactNode);
|
|
267
|
+
}
|
|
268
|
+
|
|
23
269
|
export interface SliderTypeMap<
|
|
24
|
-
|
|
270
|
+
RootComponent extends React.ElementType = 'span',
|
|
25
271
|
AdditionalProps = {},
|
|
26
272
|
> {
|
|
27
|
-
props: AdditionalProps &
|
|
28
|
-
|
|
29
|
-
* The label of the slider.
|
|
30
|
-
*/
|
|
31
|
-
'aria-label'?: string;
|
|
32
|
-
/**
|
|
33
|
-
* The id of the element containing a label for the slider.
|
|
34
|
-
*/
|
|
35
|
-
'aria-labelledby'?: string;
|
|
36
|
-
/**
|
|
37
|
-
* A string value that provides a user-friendly name for the current value of the slider.
|
|
38
|
-
*/
|
|
39
|
-
'aria-valuetext'?: string;
|
|
40
|
-
/**
|
|
41
|
-
* The color of the component.
|
|
42
|
-
* It supports both default and custom theme colors, which can be added as shown in the
|
|
43
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
|
|
44
|
-
* @default 'primary'
|
|
45
|
-
*/
|
|
46
|
-
color?: OverridableStringUnion<'primary' | 'secondary', SliderPropsColorOverrides>;
|
|
47
|
-
/**
|
|
48
|
-
* The components used for each slot inside.
|
|
49
|
-
*
|
|
50
|
-
* This prop is an alias for the `slots` prop.
|
|
51
|
-
* It's recommended to use the `slots` prop instead.
|
|
52
|
-
*
|
|
53
|
-
* @default {}
|
|
54
|
-
*/
|
|
55
|
-
components?: {
|
|
56
|
-
Root?: React.ElementType;
|
|
57
|
-
Track?: React.ElementType;
|
|
58
|
-
Rail?: React.ElementType;
|
|
59
|
-
Thumb?: React.ElementType;
|
|
60
|
-
Mark?: React.ElementType;
|
|
61
|
-
MarkLabel?: React.ElementType;
|
|
62
|
-
ValueLabel?: React.ElementType;
|
|
63
|
-
Input?: React.ElementType;
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* The extra props for the slot components.
|
|
67
|
-
* You can override the existing props or add new ones.
|
|
68
|
-
*
|
|
69
|
-
* This prop is an alias for the `slotProps` prop.
|
|
70
|
-
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
71
|
-
*
|
|
72
|
-
* @default {}
|
|
73
|
-
*/
|
|
74
|
-
componentsProps?: {
|
|
75
|
-
root?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
76
|
-
track?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
77
|
-
rail?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
78
|
-
thumb?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
79
|
-
mark?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
80
|
-
markLabel?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
81
|
-
valueLabel?: SlotComponentProps<
|
|
82
|
-
typeof SliderValueLabelComponent,
|
|
83
|
-
SliderComponentsPropsOverrides,
|
|
84
|
-
SliderOwnerState
|
|
85
|
-
>;
|
|
86
|
-
input?: SlotComponentProps<'input', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* Override or extend the styles applied to the component.
|
|
90
|
-
*/
|
|
91
|
-
classes?: Partial<SliderClasses>;
|
|
92
|
-
/**
|
|
93
|
-
* @ignore
|
|
94
|
-
*/
|
|
95
|
-
className?: string;
|
|
96
|
-
/**
|
|
97
|
-
* The default value. Use when the component is not controlled.
|
|
98
|
-
*/
|
|
99
|
-
defaultValue?: number | number[];
|
|
100
|
-
/**
|
|
101
|
-
* If `true`, the component is disabled.
|
|
102
|
-
* @default false
|
|
103
|
-
*/
|
|
104
|
-
disabled?: boolean;
|
|
105
|
-
/**
|
|
106
|
-
* If `true`, the active thumb doesn't swap when moving pointer over a thumb while dragging another thumb.
|
|
107
|
-
* @default false
|
|
108
|
-
*/
|
|
109
|
-
disableSwap?: boolean;
|
|
110
|
-
/**
|
|
111
|
-
* Accepts a function which returns a string value that provides a user-friendly name for the thumb labels of the slider.
|
|
112
|
-
* This is important for screen reader users.
|
|
113
|
-
* @param {number} index The thumb label's index to format.
|
|
114
|
-
* @returns {string}
|
|
115
|
-
*/
|
|
116
|
-
getAriaLabel?: (index: number) => string;
|
|
117
|
-
/**
|
|
118
|
-
* Accepts a function which returns a string value that provides a user-friendly name for the current value of the slider.
|
|
119
|
-
* This is important for screen reader users.
|
|
120
|
-
* @param {number} value The thumb label's value to format.
|
|
121
|
-
* @param {number} index The thumb label's index to format.
|
|
122
|
-
* @returns {string}
|
|
123
|
-
*/
|
|
124
|
-
getAriaValueText?: (value: number, index: number) => string;
|
|
125
|
-
/**
|
|
126
|
-
* Marks indicate predetermined values to which the user can move the slider.
|
|
127
|
-
* If `true` the marks are spaced according the value of the `step` prop.
|
|
128
|
-
* If an array, it should contain objects with `value` and an optional `label` keys.
|
|
129
|
-
* @default false
|
|
130
|
-
*/
|
|
131
|
-
marks?: boolean | Mark[];
|
|
132
|
-
/**
|
|
133
|
-
* The maximum allowed value of the slider.
|
|
134
|
-
* Should not be equal to min.
|
|
135
|
-
* @default 100
|
|
136
|
-
*/
|
|
137
|
-
max?: number;
|
|
138
|
-
/**
|
|
139
|
-
* The minimum allowed value of the slider.
|
|
140
|
-
* Should not be equal to max.
|
|
141
|
-
* @default 0
|
|
142
|
-
*/
|
|
143
|
-
min?: number;
|
|
144
|
-
/**
|
|
145
|
-
* Name attribute of the hidden `input` element.
|
|
146
|
-
*/
|
|
147
|
-
name?: string;
|
|
148
|
-
/**
|
|
149
|
-
* Callback function that is fired when the slider's value changed.
|
|
150
|
-
*
|
|
151
|
-
* @param {Event} event The event source of the callback.
|
|
152
|
-
* You can pull out the new value by accessing `event.target.value` (any).
|
|
153
|
-
* **Warning**: This is a generic event not a change event.
|
|
154
|
-
* @param {number | number[]} value The new value.
|
|
155
|
-
* @param {number} activeThumb Index of the currently moved thumb.
|
|
156
|
-
*/
|
|
157
|
-
onChange?: (event: Event, value: number | number[], activeThumb: number) => void;
|
|
158
|
-
/**
|
|
159
|
-
* Callback function that is fired when the `mouseup` is triggered.
|
|
160
|
-
*
|
|
161
|
-
* @param {React.SyntheticEvent | Event} event The event source of the callback. **Warning**: This is a generic event not a change event.
|
|
162
|
-
* @param {number | number[]} value The new value.
|
|
163
|
-
*/
|
|
164
|
-
onChangeCommitted?: (event: React.SyntheticEvent | Event, value: number | number[]) => void;
|
|
165
|
-
/**
|
|
166
|
-
* The component orientation.
|
|
167
|
-
* @default 'horizontal'
|
|
168
|
-
*/
|
|
169
|
-
orientation?: 'horizontal' | 'vertical';
|
|
170
|
-
/**
|
|
171
|
-
* A transformation function, to change the scale of the slider.
|
|
172
|
-
* @param {any} x
|
|
173
|
-
* @returns {any}
|
|
174
|
-
* @default function Identity(x) {
|
|
175
|
-
* return x;
|
|
176
|
-
* }
|
|
177
|
-
*/
|
|
178
|
-
scale?: (value: number) => number;
|
|
179
|
-
/**
|
|
180
|
-
* The size of the slider.
|
|
181
|
-
* @default 'medium'
|
|
182
|
-
*/
|
|
183
|
-
size?: OverridableStringUnion<'small' | 'medium', SliderPropsSizeOverrides>;
|
|
184
|
-
/**
|
|
185
|
-
* The props used for each slot inside the Slider.
|
|
186
|
-
* @default {}
|
|
187
|
-
*/
|
|
188
|
-
slotProps?: {
|
|
189
|
-
root?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
190
|
-
track?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
191
|
-
rail?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
192
|
-
thumb?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
193
|
-
mark?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
194
|
-
markLabel?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
195
|
-
valueLabel?: SlotComponentProps<
|
|
196
|
-
typeof SliderValueLabelComponent,
|
|
197
|
-
SliderComponentsPropsOverrides,
|
|
198
|
-
SliderOwnerState
|
|
199
|
-
>;
|
|
200
|
-
input?: SlotComponentProps<'input', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
201
|
-
};
|
|
202
|
-
/**
|
|
203
|
-
* The components used for each slot inside the Slider.
|
|
204
|
-
* Either a string to use a HTML element or a component.
|
|
205
|
-
* @default {}
|
|
206
|
-
*/
|
|
207
|
-
slots?: {
|
|
208
|
-
root?: React.ElementType;
|
|
209
|
-
track?: React.ElementType;
|
|
210
|
-
rail?: React.ElementType;
|
|
211
|
-
thumb?: React.ElementType;
|
|
212
|
-
mark?: React.ElementType;
|
|
213
|
-
markLabel?: React.ElementType;
|
|
214
|
-
valueLabel?: React.ElementType;
|
|
215
|
-
input?: React.ElementType;
|
|
216
|
-
};
|
|
217
|
-
/**
|
|
218
|
-
* The granularity with which the slider can step through values. (A "discrete" slider.)
|
|
219
|
-
* The `min` prop serves as the origin for the valid values.
|
|
220
|
-
* We recommend (max - min) to be evenly divisible by the step.
|
|
221
|
-
*
|
|
222
|
-
* When step is `null`, the thumb can only be slid onto marks provided with the `marks` prop.
|
|
223
|
-
* @default 1
|
|
224
|
-
*/
|
|
225
|
-
step?: number | null;
|
|
226
|
-
/**
|
|
227
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
228
|
-
*/
|
|
229
|
-
sx?: SxProps<Theme>;
|
|
230
|
-
/**
|
|
231
|
-
* Tab index attribute of the hidden `input` element.
|
|
232
|
-
*/
|
|
233
|
-
tabIndex?: number;
|
|
234
|
-
/**
|
|
235
|
-
* The track presentation:
|
|
236
|
-
*
|
|
237
|
-
* - `normal` the track will render a bar representing the slider value.
|
|
238
|
-
* - `inverted` the track will render a bar representing the remaining slider value.
|
|
239
|
-
* - `false` the track will render without a bar.
|
|
240
|
-
* @default 'normal'
|
|
241
|
-
*/
|
|
242
|
-
track?: 'normal' | false | 'inverted';
|
|
243
|
-
/**
|
|
244
|
-
* The value of the slider.
|
|
245
|
-
* For ranged sliders, provide an array with two values.
|
|
246
|
-
*/
|
|
247
|
-
value?: number | number[];
|
|
248
|
-
/**
|
|
249
|
-
* Controls when the value label is displayed:
|
|
250
|
-
*
|
|
251
|
-
* - `auto` the value label will display when the thumb is hovered or focused.
|
|
252
|
-
* - `on` will display persistently.
|
|
253
|
-
* - `off` will never display.
|
|
254
|
-
* @default 'off'
|
|
255
|
-
*/
|
|
256
|
-
valueLabelDisplay?: 'on' | 'auto' | 'off';
|
|
257
|
-
/**
|
|
258
|
-
* The format function the value label's value.
|
|
259
|
-
*
|
|
260
|
-
* When a function is provided, it should have the following signature:
|
|
261
|
-
*
|
|
262
|
-
* - {number} value The value label's value to format
|
|
263
|
-
* - {number} index The value label's index to format
|
|
264
|
-
* @param {any} x
|
|
265
|
-
* @returns {any}
|
|
266
|
-
* @default function Identity(x) {
|
|
267
|
-
* return x;
|
|
268
|
-
* }
|
|
269
|
-
*/
|
|
270
|
-
valueLabelFormat?: string | ((value: number, index: number) => React.ReactNode);
|
|
271
|
-
};
|
|
272
|
-
defaultComponent: DefaultComponent;
|
|
273
|
+
props: AdditionalProps & SliderOwnProps;
|
|
274
|
+
defaultComponent: RootComponent;
|
|
273
275
|
}
|
|
274
276
|
|
|
275
277
|
export interface SliderValueLabelProps extends React.HTMLAttributes<HTMLSpanElement> {
|
package/Slider/Slider.js
CHANGED
|
@@ -15,14 +15,14 @@ import styled, { slotShouldForwardProp } from '../styles/styled';
|
|
|
15
15
|
import useTheme from '../styles/useTheme';
|
|
16
16
|
import shouldSpreadAdditionalProps from '../utils/shouldSpreadAdditionalProps';
|
|
17
17
|
import capitalize from '../utils/capitalize';
|
|
18
|
-
import
|
|
18
|
+
import BaseSliderValueLabel from './SliderValueLabel';
|
|
19
19
|
import sliderClasses, { getSliderUtilityClass } from './sliderClasses';
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
21
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
22
|
function Identity(x) {
|
|
23
23
|
return x;
|
|
24
24
|
}
|
|
25
|
-
const SliderRoot = styled('span', {
|
|
25
|
+
export const SliderRoot = styled('span', {
|
|
26
26
|
name: 'MuiSlider',
|
|
27
27
|
slot: 'Root',
|
|
28
28
|
overridesResolver: (props, styles) => {
|
|
@@ -84,18 +84,7 @@ const SliderRoot = styled('span', {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
}));
|
|
87
|
-
|
|
88
|
-
// ----------------------------- Warning --------------------------------
|
|
89
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
90
|
-
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
91
|
-
// ----------------------------------------------------------------------
|
|
92
|
-
/**
|
|
93
|
-
* @ignore
|
|
94
|
-
*/
|
|
95
|
-
children: PropTypes.node
|
|
96
|
-
} : void 0;
|
|
97
|
-
export { SliderRoot };
|
|
98
|
-
const SliderRail = styled('span', {
|
|
87
|
+
export const SliderRail = styled('span', {
|
|
99
88
|
name: 'MuiSlider',
|
|
100
89
|
slot: 'Rail',
|
|
101
90
|
overridesResolver: (props, styles) => styles.rail
|
|
@@ -120,18 +109,7 @@ const SliderRail = styled('span', {
|
|
|
120
109
|
}, ownerState.track === 'inverted' && {
|
|
121
110
|
opacity: 1
|
|
122
111
|
}));
|
|
123
|
-
|
|
124
|
-
// ----------------------------- Warning --------------------------------
|
|
125
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
126
|
-
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
127
|
-
// ----------------------------------------------------------------------
|
|
128
|
-
/**
|
|
129
|
-
* @ignore
|
|
130
|
-
*/
|
|
131
|
-
children: PropTypes.node
|
|
132
|
-
} : void 0;
|
|
133
|
-
export { SliderRail };
|
|
134
|
-
const SliderTrack = styled('span', {
|
|
112
|
+
export const SliderTrack = styled('span', {
|
|
135
113
|
name: 'MuiSlider',
|
|
136
114
|
slot: 'Track',
|
|
137
115
|
overridesResolver: (props, styles) => styles.track
|
|
@@ -168,18 +146,7 @@ const SliderTrack = styled('span', {
|
|
|
168
146
|
borderColor: theme.vars ? theme.vars.palette.Slider[`${ownerState.color}Track`] : color
|
|
169
147
|
});
|
|
170
148
|
});
|
|
171
|
-
|
|
172
|
-
// ----------------------------- Warning --------------------------------
|
|
173
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
174
|
-
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
175
|
-
// ----------------------------------------------------------------------
|
|
176
|
-
/**
|
|
177
|
-
* @ignore
|
|
178
|
-
*/
|
|
179
|
-
children: PropTypes.node
|
|
180
|
-
} : void 0;
|
|
181
|
-
export { SliderTrack };
|
|
182
|
-
const SliderThumb = styled('span', {
|
|
149
|
+
export const SliderThumb = styled('span', {
|
|
183
150
|
name: 'MuiSlider',
|
|
184
151
|
slot: 'Thumb',
|
|
185
152
|
overridesResolver: (props, styles) => {
|
|
@@ -251,18 +218,7 @@ const SliderThumb = styled('span', {
|
|
|
251
218
|
}
|
|
252
219
|
}
|
|
253
220
|
}));
|
|
254
|
-
|
|
255
|
-
// ----------------------------- Warning --------------------------------
|
|
256
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
257
|
-
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
258
|
-
// ----------------------------------------------------------------------
|
|
259
|
-
/**
|
|
260
|
-
* @ignore
|
|
261
|
-
*/
|
|
262
|
-
children: PropTypes.node
|
|
263
|
-
} : void 0;
|
|
264
|
-
export { SliderThumb };
|
|
265
|
-
const StyledSliderValueLabel = styled(SliderValueLabel, {
|
|
221
|
+
export const SliderValueLabel = styled(BaseSliderValueLabel, {
|
|
266
222
|
name: 'MuiSlider',
|
|
267
223
|
slot: 'ValueLabel',
|
|
268
224
|
overridesResolver: (props, styles) => styles.valueLabel
|
|
@@ -320,18 +276,7 @@ const StyledSliderValueLabel = styled(SliderValueLabel, {
|
|
|
320
276
|
fontSize: theme.typography.pxToRem(12),
|
|
321
277
|
padding: '0.25rem 0.5rem'
|
|
322
278
|
}));
|
|
323
|
-
|
|
324
|
-
// ----------------------------- Warning --------------------------------
|
|
325
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
326
|
-
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
327
|
-
// ----------------------------------------------------------------------
|
|
328
|
-
/**
|
|
329
|
-
* @ignore
|
|
330
|
-
*/
|
|
331
|
-
children: PropTypes.node
|
|
332
|
-
} : void 0;
|
|
333
|
-
export { StyledSliderValueLabel as SliderValueLabel };
|
|
334
|
-
const SliderMark = styled('span', {
|
|
279
|
+
export const SliderMark = styled('span', {
|
|
335
280
|
name: 'MuiSlider',
|
|
336
281
|
slot: 'Mark',
|
|
337
282
|
shouldForwardProp: prop => slotShouldForwardProp(prop) && prop !== 'markActive',
|
|
@@ -361,18 +306,7 @@ const SliderMark = styled('span', {
|
|
|
361
306
|
backgroundColor: (theme.vars || theme).palette.background.paper,
|
|
362
307
|
opacity: 0.8
|
|
363
308
|
}));
|
|
364
|
-
|
|
365
|
-
// ----------------------------- Warning --------------------------------
|
|
366
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
367
|
-
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
368
|
-
// ----------------------------------------------------------------------
|
|
369
|
-
/**
|
|
370
|
-
* @ignore
|
|
371
|
-
*/
|
|
372
|
-
children: PropTypes.node
|
|
373
|
-
} : void 0;
|
|
374
|
-
export { SliderMark };
|
|
375
|
-
const SliderMarkLabel = styled('span', {
|
|
309
|
+
export const SliderMarkLabel = styled('span', {
|
|
376
310
|
name: 'MuiSlider',
|
|
377
311
|
slot: 'MarkLabel',
|
|
378
312
|
shouldForwardProp: prop => slotShouldForwardProp(prop) && prop !== 'markLabelActive',
|
|
@@ -400,17 +334,6 @@ const SliderMarkLabel = styled('span', {
|
|
|
400
334
|
}, markLabelActive && {
|
|
401
335
|
color: (theme.vars || theme).palette.text.primary
|
|
402
336
|
}));
|
|
403
|
-
process.env.NODE_ENV !== "production" ? SliderMarkLabel.propTypes /* remove-proptypes */ = {
|
|
404
|
-
// ----------------------------- Warning --------------------------------
|
|
405
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
406
|
-
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
407
|
-
// ----------------------------------------------------------------------
|
|
408
|
-
/**
|
|
409
|
-
* @ignore
|
|
410
|
-
*/
|
|
411
|
-
children: PropTypes.node
|
|
412
|
-
} : void 0;
|
|
413
|
-
export { SliderMarkLabel };
|
|
414
337
|
const useUtilityClasses = ownerState => {
|
|
415
338
|
const {
|
|
416
339
|
disabled,
|
|
@@ -524,7 +447,7 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
524
447
|
const RailSlot = (_ref2 = (_slots$rail = slots == null ? void 0 : slots.rail) != null ? _slots$rail : components.Rail) != null ? _ref2 : SliderRail;
|
|
525
448
|
const TrackSlot = (_ref3 = (_slots$track = slots == null ? void 0 : slots.track) != null ? _slots$track : components.Track) != null ? _ref3 : SliderTrack;
|
|
526
449
|
const ThumbSlot = (_ref4 = (_slots$thumb = slots == null ? void 0 : slots.thumb) != null ? _slots$thumb : components.Thumb) != null ? _ref4 : SliderThumb;
|
|
527
|
-
const ValueLabelSlot = (_ref5 = (_slots$valueLabel = slots == null ? void 0 : slots.valueLabel) != null ? _slots$valueLabel : components.ValueLabel) != null ? _ref5 :
|
|
450
|
+
const ValueLabelSlot = (_ref5 = (_slots$valueLabel = slots == null ? void 0 : slots.valueLabel) != null ? _slots$valueLabel : components.ValueLabel) != null ? _ref5 : SliderValueLabel;
|
|
528
451
|
const MarkSlot = (_ref6 = (_slots$mark = slots == null ? void 0 : slots.mark) != null ? _slots$mark : components.Mark) != null ? _ref6 : SliderMark;
|
|
529
452
|
const MarkLabelSlot = (_ref7 = (_slots$markLabel = slots == null ? void 0 : slots.markLabel) != null ? _slots$markLabel : components.MarkLabel) != null ? _ref7 : SliderMarkLabel;
|
|
530
453
|
const InputSlot = (_ref8 = (_slots$input = slots == null ? void 0 : slots.input) != null ? _slots$input : components.Input) != null ? _ref8 : 'input';
|