@mui/material 5.11.4 → 5.11.6
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.d.ts +3 -3
- package/Box/Box.d.ts +6 -22
- package/Button/Button.js +0 -2
- package/CHANGELOG.md +132 -0
- package/Slider/Slider.d.ts +215 -36
- package/Slider/Slider.js +225 -66
- package/Slider/SliderValueLabel.d.ts +15 -0
- package/Slider/SliderValueLabel.js +52 -0
- package/Slider/SliderValueLabel.types.d.ts +24 -0
- package/Slider/SliderValueLabel.types.js +1 -0
- package/Slider/index.d.ts +3 -0
- package/Slider/index.js +3 -1
- package/Slider/sliderClasses.d.ts +58 -0
- package/Slider/sliderClasses.js +7 -0
- package/SwipeableDrawer/SwipeableDrawer.d.ts +15 -0
- package/SwipeableDrawer/SwipeableDrawer.js +48 -17
- package/index.js +1 -1
- package/legacy/Button/Button.js +0 -2
- package/legacy/Slider/Slider.js +253 -74
- package/legacy/Slider/SliderValueLabel.js +48 -0
- package/legacy/Slider/SliderValueLabel.types.js +1 -0
- package/legacy/Slider/index.js +3 -1
- package/legacy/Slider/sliderClasses.js +7 -0
- package/legacy/SwipeableDrawer/SwipeableDrawer.js +50 -17
- package/legacy/index.js +1 -1
- package/legacy/locale/index.js +230 -144
- package/legacy/styles/experimental_extendTheme.js +16 -8
- package/locale/index.d.ts +1 -0
- package/locale/index.js +85 -0
- package/modern/Button/Button.js +0 -2
- package/modern/Slider/Slider.js +224 -65
- package/modern/Slider/SliderValueLabel.js +52 -0
- package/modern/Slider/SliderValueLabel.types.js +1 -0
- package/modern/Slider/index.js +3 -1
- package/modern/Slider/sliderClasses.js +7 -0
- package/modern/SwipeableDrawer/SwipeableDrawer.js +47 -17
- package/modern/index.js +1 -1
- package/modern/locale/index.js +85 -0
- package/modern/styles/experimental_extendTheme.js +16 -8
- package/node/Button/Button.js +0 -2
- package/node/Slider/Slider.js +231 -74
- package/node/Slider/SliderValueLabel.js +60 -0
- package/node/Slider/SliderValueLabel.types.js +5 -0
- package/node/Slider/index.js +21 -1
- package/node/Slider/sliderClasses.js +16 -0
- package/node/SwipeableDrawer/SwipeableDrawer.js +48 -17
- package/node/index.js +1 -1
- package/node/locale/index.js +87 -1
- package/node/styles/experimental_extendTheme.js +16 -8
- package/package.json +4 -4
- package/styles/experimental_extendTheme.js +16 -8
- package/umd/material-ui.development.js +556 -799
- package/umd/material-ui.production.min.js +21 -21
|
@@ -287,7 +287,7 @@ export interface AutocompleteProps<
|
|
|
287
287
|
*/
|
|
288
288
|
export default function Autocomplete<
|
|
289
289
|
T,
|
|
290
|
-
Multiple extends boolean | undefined =
|
|
291
|
-
DisableClearable extends boolean | undefined =
|
|
292
|
-
FreeSolo extends boolean | undefined =
|
|
290
|
+
Multiple extends boolean | undefined = false,
|
|
291
|
+
DisableClearable extends boolean | undefined = false,
|
|
292
|
+
FreeSolo extends boolean | undefined = false,
|
|
293
293
|
>(props: AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>): JSX.Element;
|
package/Box/Box.d.ts
CHANGED
|
@@ -1,24 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { OverridableComponent
|
|
3
|
-
import {
|
|
1
|
+
import { BoxTypeMap } from '@mui/system';
|
|
2
|
+
import { OverridableComponent } from '@mui/types';
|
|
3
|
+
import { OverrideProps } from '../OverridableComponent';
|
|
4
|
+
import { Theme as MaterialTheme } from '../styles';
|
|
4
5
|
|
|
5
|
-
export interface BoxTypeMap<P = {}, D extends React.ElementType = 'div'> {
|
|
6
|
-
props: P &
|
|
7
|
-
SystemProps<Theme> & {
|
|
8
|
-
children?: React.ReactNode;
|
|
9
|
-
/**
|
|
10
|
-
* The component used for the root node.
|
|
11
|
-
* Either a string to use a HTML element or a component.
|
|
12
|
-
*/
|
|
13
|
-
component?: React.ElementType;
|
|
14
|
-
ref?: React.Ref<unknown>;
|
|
15
|
-
/**
|
|
16
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
17
|
-
*/
|
|
18
|
-
sx?: SxProps<Theme>;
|
|
19
|
-
};
|
|
20
|
-
defaultComponent: D;
|
|
21
|
-
}
|
|
22
6
|
/**
|
|
23
7
|
*
|
|
24
8
|
* Demos:
|
|
@@ -29,11 +13,11 @@ export interface BoxTypeMap<P = {}, D extends React.ElementType = 'div'> {
|
|
|
29
13
|
*
|
|
30
14
|
* - [Box API](https://mui.com/material-ui/api/box/)
|
|
31
15
|
*/
|
|
32
|
-
declare const Box: OverridableComponent<BoxTypeMap
|
|
16
|
+
declare const Box: OverridableComponent<BoxTypeMap<{}, 'div', MaterialTheme>>;
|
|
33
17
|
|
|
34
18
|
export type BoxProps<
|
|
35
19
|
D extends React.ElementType = BoxTypeMap['defaultComponent'],
|
|
36
20
|
P = {},
|
|
37
|
-
> = OverrideProps<BoxTypeMap<P, D>, D>;
|
|
21
|
+
> = OverrideProps<BoxTypeMap<P, D, MaterialTheme>, D>;
|
|
38
22
|
|
|
39
23
|
export default Box;
|
package/Button/Button.js
CHANGED
|
@@ -113,8 +113,6 @@ const ButtonRoot = styled(ButtonBase, {
|
|
|
113
113
|
color: (theme.vars || theme).palette.action.disabled
|
|
114
114
|
}, ownerState.variant === 'outlined' && {
|
|
115
115
|
border: `1px solid ${(theme.vars || theme).palette.action.disabledBackground}`
|
|
116
|
-
}, ownerState.variant === 'outlined' && ownerState.color === 'secondary' && {
|
|
117
|
-
border: `1px solid ${(theme.vars || theme).palette.action.disabled}`
|
|
118
116
|
}, ownerState.variant === 'contained' && {
|
|
119
117
|
color: (theme.vars || theme).palette.action.disabled,
|
|
120
118
|
boxShadow: (theme.vars || theme).shadows[0],
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,137 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 5.11.6
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v5.11.5..master -->
|
|
6
|
+
|
|
7
|
+
_Jan 23, 2023_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
|
|
10
|
+
|
|
11
|
+
- @ZeeshanTamboli improved the logic for handling the value label in the `SliderUnstyled` (#35805)
|
|
12
|
+
- many other 🐛 bug fixes and 📚 documentation improvements
|
|
13
|
+
|
|
14
|
+
### `@mui/material@5.11.6`
|
|
15
|
+
|
|
16
|
+
- ​<!-- 15 -->[Box] Fix usage of not supported features in TypeScript 3.5 (#35877) @mnajdova
|
|
17
|
+
- ​<!-- 14 -->[Button] Fix border color for secondary disabled button (#35866) @SaidMarar
|
|
18
|
+
- ​<!-- 03 -->[SwipeableDrawer] Add callback to customise touchstart ignore for swipeable drawer (#30759) @tech-meppem
|
|
19
|
+
|
|
20
|
+
### `@mui/base@5.0.0-alpha.115`
|
|
21
|
+
|
|
22
|
+
#### Breaking changes
|
|
23
|
+
|
|
24
|
+
- ​<!-- 04 -->[SliderUnstyled] Improved logic for displaying the value label (#35805) @ZeeshanTamboli
|
|
25
|
+
|
|
26
|
+
- The `valueLabelDisplay` prop is removed from `SliderUnstyled`. The prop was not working as intended in `SliderUnstyled` (See #35398). You can instead provide a `valueLabel` slot with the `slots` prop API to show the value label:
|
|
27
|
+
|
|
28
|
+
```diff
|
|
29
|
+
- <SliderUnstyled valueLabelDisplay="on" />
|
|
30
|
+
+ <SliderUnstyled slots={{ valueLabel: SliderValueLabel }} />
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The following demo shows how to show a value label when it is hovered over with the thumb: https://mui.com/base/react-slider/#value-label
|
|
34
|
+
|
|
35
|
+
- The following classes are removed from `sliderUnstyledClasses` since they are not needed for the value label:
|
|
36
|
+
|
|
37
|
+
```diff
|
|
38
|
+
- valueLabel
|
|
39
|
+
- valueLabelOpen
|
|
40
|
+
- valueLabelCircle
|
|
41
|
+
- valueLabelLabel
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
In the custom value label component, you can define your own classNames and target them with CSS.
|
|
45
|
+
|
|
46
|
+
- The `SliderValueLabelUnstyled` component is removed from SliderUnstyled. You should provide your own custom component for the value label.
|
|
47
|
+
|
|
48
|
+
- To avoid using `React.cloneElement` API in value label, the component hierarchy structure of the value label is changed. The value label is now inside the Thumb slot - `Thumb` -> `Input`, `ValueLabel`.
|
|
49
|
+
|
|
50
|
+
#### Changes
|
|
51
|
+
|
|
52
|
+
- ​<!-- 05 -->[InputUnstyled] Fix externally provided `inputRef` is ignored (#35807) @sai6855
|
|
53
|
+
|
|
54
|
+
### `@mui/joy@5.0.0-alpha.64`
|
|
55
|
+
|
|
56
|
+
- ​<!-- 17 -->[Avatar][joy] Remove `imgProps` prop and add Codemod script for migration (#35859) @hbjORbj
|
|
57
|
+
|
|
58
|
+
### Docs
|
|
59
|
+
|
|
60
|
+
- ​<!-- 16 -->[blog] Date and time pickers revamped (#35486) @joserodolfofreitas
|
|
61
|
+
- ​<!-- 10 -->[docs] Fix incorrect breakpoint use (#34948) @rosita-dmello
|
|
62
|
+
- ​<!-- 09 -->[docs] Replace react-virtualized with react-virtuoso in Table (#35700) @petyosi
|
|
63
|
+
- ​<!-- 08 -->[docs] Fix account menu demo not closing with keyboard. (#35870) @mj12albert
|
|
64
|
+
- ​<!-- 07 -->[docs] Fix typos in the docs of Joy UI (#35876) @HeVictor
|
|
65
|
+
- ​<!-- 06 -->[docs] Fix wording in `Color` page (#35873) @oliv37
|
|
66
|
+
|
|
67
|
+
### Core
|
|
68
|
+
|
|
69
|
+
- ​<!-- 13 -->[core] Fix release changelog to handle commits with empty author field (#35921) @mnajdova
|
|
70
|
+
- ​<!-- 12 -->[core] Revert `docs-utilities` migration to TypeScript and fix type (#35881) @ZeeshanTamboli
|
|
71
|
+
- ​<!-- 11 -->[core] Migrate internal `docs-utilities` package to TypeScript (#35846) @ZeeshanTamboli
|
|
72
|
+
- ​<!-- 02 -->[website] Designer don't spend their time writing code @oliviertassinari
|
|
73
|
+
- ​<!-- 01 -->[website] Emphasis the technical background need for this role @oliviertassinari
|
|
74
|
+
|
|
75
|
+
All contributors of this release in alphabetical order: @HeVictor, @hbjORbj, @joserodolfofreitas, @mj12albert, @mnajdova, @oliv37, @oliviertassinari, @petyosi, @rosita-dmello, @sai6855, @SaidMarar, @tech-meppem, @ZeeshanTamboli
|
|
76
|
+
|
|
77
|
+
## 5.11.5
|
|
78
|
+
|
|
79
|
+
<!-- generated comparing v5.11.4..master -->
|
|
80
|
+
|
|
81
|
+
_Jan 17, 2023_
|
|
82
|
+
|
|
83
|
+
A big thanks to the 17 contributors who made this release possible.
|
|
84
|
+
This release was mostly about 🐛 bug fixes and 📚 documentation improvements.
|
|
85
|
+
|
|
86
|
+
### `@mui/material@5.11.5`
|
|
87
|
+
|
|
88
|
+
- [Material UI] Custom channel token should suppress the warning (#35804) @siriwatknp
|
|
89
|
+
- [Autocomplete] Fix value type when `strictNullChecks` is `false` (#35367) @fenghan34
|
|
90
|
+
- [Slider] Replace `SliderUnstyled` with `useSlider` hook (#35770) @ZeeshanTamboli
|
|
91
|
+
- [l10n] Add Belarusian translation (#35742) @volhalink
|
|
92
|
+
|
|
93
|
+
### `@mui/system@5.11.5`
|
|
94
|
+
|
|
95
|
+
- [system] Improve the `createBox` types (#35532) @mnajdova
|
|
96
|
+
|
|
97
|
+
### `@mui/codemod@5.11.5`
|
|
98
|
+
|
|
99
|
+
- Add `joy-text-field-to-input` codemod (#35462) @hbjORbj
|
|
100
|
+
|
|
101
|
+
### `@mui/base@5.0.0-alpha.114`
|
|
102
|
+
|
|
103
|
+
- [base] Fix typos (#35802) @nnmax
|
|
104
|
+
- [Slider] Convert code to TypeScript (#35445) @sai6855
|
|
105
|
+
|
|
106
|
+
### `@mui/joy@5.0.0-alpha.63`
|
|
107
|
+
|
|
108
|
+
- [Tabs][joy] Don't apply `:hover, :active` styles when `selected` (#35750) @sai6855
|
|
109
|
+
- Remove `TextField` component and replace its usage in docs with `FormControl`/`FormLabel`/`Input` (#35462) @hbjORbj
|
|
110
|
+
- [TextField] Throw error with migration message (#35845) @siriwatknp
|
|
111
|
+
- Miscellaneous fixes (#35847) @siriwatknp
|
|
112
|
+
|
|
113
|
+
### Docs
|
|
114
|
+
|
|
115
|
+
- [docs] Improve pickers lab migration stressing `mui-x` usage (#35740) @LukasTy
|
|
116
|
+
- [docs] Fix incorrectly named AccessibleTable demo component (#35832) @HeVictor
|
|
117
|
+
- [docs] Clarify where to find docs for MUI Base components in Material UI (#35799) @samuelsycamore
|
|
118
|
+
- [docs] Fix typos (#35814) @alexfauquette
|
|
119
|
+
- [docs] Revise and expand the Joy UI Card page (#35745) @samuelsycamore
|
|
120
|
+
- [docs] Fix navigation layout shift (#35679) @oliviertassinari
|
|
121
|
+
- [docs] Fix typo in the Composition page (#35774) @msoyka
|
|
122
|
+
- [docs][joy] Update Customization section code example to use the correct API (#35765) @pupudu
|
|
123
|
+
- [docs][joy] Fix grammar in `Typography` docs (#35796) @atrefonas
|
|
124
|
+
- [examples] Remove `next-env.d.ts` from Next.js examples (#35772) @Juneezee
|
|
125
|
+
|
|
126
|
+
### Core
|
|
127
|
+
|
|
128
|
+
- [website] Improve pricing page (#35767) @oliviertassinari
|
|
129
|
+
- [website] Add Greg in about page (#35816) @oliviertassinari
|
|
130
|
+
- [website] Update the Accessibility Engineer role (#35751) @oliviertassinari
|
|
131
|
+
- [website] Add docs for MUI for Figma @oliviertassinari
|
|
132
|
+
|
|
133
|
+
All contributors of this release in alphabetical order: @alexfauquette, @atrefonas, @fenghan34, @hbjORbj, @HeVictor, @Juneezee, @LukasTy, @mnajdova, @msoyka, @nnmax, @oliviertassinari, @pupudu, @sai6855, @samuelsycamore, @siriwatknp, @volhalink, @ZeeshanTamboli
|
|
134
|
+
|
|
3
135
|
## 5.11.4
|
|
4
136
|
|
|
5
137
|
<!-- generated comparing v5.11.3..master -->
|
package/Slider/Slider.d.ts
CHANGED
|
@@ -1,24 +1,39 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
ExtendSliderUnstyled,
|
|
5
|
-
SliderUnstyledTypeMap,
|
|
6
|
-
SliderValueLabelProps,
|
|
7
|
-
} from '@mui/base/SliderUnstyled';
|
|
2
|
+
import { SlotComponentProps } from '@mui/base';
|
|
3
|
+
import { Mark } from '@mui/base/SliderUnstyled';
|
|
8
4
|
import { SxProps } from '@mui/system';
|
|
9
5
|
import { OverridableStringUnion } from '@mui/types';
|
|
10
6
|
import { Theme } from '../styles';
|
|
11
|
-
import { OverrideProps } from '../OverridableComponent';
|
|
7
|
+
import { OverrideProps, OverridableComponent } from '../OverridableComponent';
|
|
8
|
+
import SliderValueLabelComponent from './SliderValueLabel';
|
|
9
|
+
import { SliderClasses } from './sliderClasses';
|
|
12
10
|
|
|
13
11
|
export interface SliderPropsColorOverrides {}
|
|
14
12
|
|
|
15
13
|
export interface SliderPropsSizeOverrides {}
|
|
16
14
|
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
export interface SliderComponentsPropsOverrides {}
|
|
16
|
+
|
|
17
|
+
export interface SliderOwnerState extends SliderProps {
|
|
18
|
+
dragging: boolean;
|
|
19
|
+
marked: boolean;
|
|
20
|
+
focusedThumbIndex: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface SliderTypeMap<D extends React.ElementType = 'span', P = {}> {
|
|
21
24
|
props: P & {
|
|
25
|
+
/**
|
|
26
|
+
* The label of the slider.
|
|
27
|
+
*/
|
|
28
|
+
'aria-label'?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The id of the element containing a label for the slider.
|
|
31
|
+
*/
|
|
32
|
+
'aria-labelledby'?: string;
|
|
33
|
+
/**
|
|
34
|
+
* A string value that provides a user-friendly name for the current value of the slider.
|
|
35
|
+
*/
|
|
36
|
+
'aria-valuetext'?: string;
|
|
22
37
|
/**
|
|
23
38
|
* The color of the component.
|
|
24
39
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
@@ -53,38 +68,209 @@ export type SliderTypeMap<
|
|
|
53
68
|
*
|
|
54
69
|
* @default {}
|
|
55
70
|
*/
|
|
56
|
-
componentsProps?:
|
|
71
|
+
componentsProps?: {
|
|
72
|
+
root?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
73
|
+
track?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
74
|
+
rail?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
75
|
+
thumb?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
76
|
+
mark?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
77
|
+
markLabel?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
78
|
+
valueLabel?: SlotComponentProps<
|
|
79
|
+
typeof SliderValueLabelComponent,
|
|
80
|
+
SliderComponentsPropsOverrides,
|
|
81
|
+
SliderOwnerState
|
|
82
|
+
>;
|
|
83
|
+
input?: SlotComponentProps<'input', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
84
|
+
};
|
|
57
85
|
/**
|
|
58
86
|
* Override or extend the styles applied to the component.
|
|
59
87
|
*/
|
|
60
|
-
classes?:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
88
|
+
classes?: Partial<SliderClasses>;
|
|
89
|
+
/**
|
|
90
|
+
* The default value. Use when the component is not controlled.
|
|
91
|
+
*/
|
|
92
|
+
defaultValue?: number | number[];
|
|
93
|
+
/**
|
|
94
|
+
* If `true`, the component is disabled.
|
|
95
|
+
* @default false
|
|
96
|
+
*/
|
|
97
|
+
disabled?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* If `true`, the active thumb doesn't swap when moving pointer over a thumb while dragging another thumb.
|
|
100
|
+
* @default false
|
|
101
|
+
*/
|
|
102
|
+
disableSwap?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Accepts a function which returns a string value that provides a user-friendly name for the thumb labels of the slider.
|
|
105
|
+
* This is important for screen reader users.
|
|
106
|
+
* @param {number} index The thumb label's index to format.
|
|
107
|
+
* @returns {string}
|
|
108
|
+
*/
|
|
109
|
+
getAriaLabel?: (index: number) => string;
|
|
110
|
+
/**
|
|
111
|
+
* Accepts a function which returns a string value that provides a user-friendly name for the current value of the slider.
|
|
112
|
+
* This is important for screen reader users.
|
|
113
|
+
* @param {number} value The thumb label's value to format.
|
|
114
|
+
* @param {number} index The thumb label's index to format.
|
|
115
|
+
* @returns {string}
|
|
116
|
+
*/
|
|
117
|
+
getAriaValueText?: (value: number, index: number) => string;
|
|
118
|
+
/**
|
|
119
|
+
* Marks indicate predetermined values to which the user can move the slider.
|
|
120
|
+
* If `true` the marks are spaced according the value of the `step` prop.
|
|
121
|
+
* If an array, it should contain objects with `value` and an optional `label` keys.
|
|
122
|
+
* @default false
|
|
123
|
+
*/
|
|
124
|
+
marks?: boolean | Mark[];
|
|
125
|
+
/**
|
|
126
|
+
* The maximum allowed value of the slider.
|
|
127
|
+
* Should not be equal to min.
|
|
128
|
+
* @default 100
|
|
129
|
+
*/
|
|
130
|
+
max?: number;
|
|
131
|
+
/**
|
|
132
|
+
* The minimum allowed value of the slider.
|
|
133
|
+
* Should not be equal to max.
|
|
134
|
+
* @default 0
|
|
135
|
+
*/
|
|
136
|
+
min?: number;
|
|
137
|
+
/**
|
|
138
|
+
* Name attribute of the hidden `input` element.
|
|
139
|
+
*/
|
|
140
|
+
name?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Callback function that is fired when the slider's value changed.
|
|
143
|
+
*
|
|
144
|
+
* @param {Event} event The event source of the callback.
|
|
145
|
+
* You can pull out the new value by accessing `event.target.value` (any).
|
|
146
|
+
* **Warning**: This is a generic event not a change event.
|
|
147
|
+
* @param {number | number[]} value The new value.
|
|
148
|
+
* @param {number} activeThumb Index of the currently moved thumb.
|
|
149
|
+
*/
|
|
150
|
+
onChange?: (event: Event, value: number | number[], activeThumb: number) => void;
|
|
151
|
+
/**
|
|
152
|
+
* Callback function that is fired when the `mouseup` is triggered.
|
|
153
|
+
*
|
|
154
|
+
* @param {React.SyntheticEvent | Event} event The event source of the callback. **Warning**: This is a generic event not a change event.
|
|
155
|
+
* @param {number | number[]} value The new value.
|
|
156
|
+
*/
|
|
157
|
+
onChangeCommitted?: (event: React.SyntheticEvent | Event, value: number | number[]) => void;
|
|
158
|
+
/**
|
|
159
|
+
* The component orientation.
|
|
160
|
+
* @default 'horizontal'
|
|
161
|
+
*/
|
|
162
|
+
orientation?: 'horizontal' | 'vertical';
|
|
163
|
+
/**
|
|
164
|
+
* A transformation function, to change the scale of the slider.
|
|
165
|
+
* @param {any} x
|
|
166
|
+
* @returns {any}
|
|
167
|
+
* @default function Identity(x) {
|
|
168
|
+
* return x;
|
|
169
|
+
* }
|
|
170
|
+
*/
|
|
171
|
+
scale?: (value: number) => number;
|
|
74
172
|
/**
|
|
75
173
|
* The size of the slider.
|
|
76
174
|
* @default 'medium'
|
|
77
175
|
*/
|
|
78
176
|
size?: OverridableStringUnion<'small' | 'medium', SliderPropsSizeOverrides>;
|
|
177
|
+
/**
|
|
178
|
+
* The props used for each slot inside the Slider.
|
|
179
|
+
* @default {}
|
|
180
|
+
*/
|
|
181
|
+
slotProps?: {
|
|
182
|
+
root?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
183
|
+
track?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
184
|
+
rail?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
185
|
+
thumb?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
186
|
+
mark?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
187
|
+
markLabel?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
188
|
+
valueLabel?: SlotComponentProps<
|
|
189
|
+
typeof SliderValueLabelComponent,
|
|
190
|
+
SliderComponentsPropsOverrides,
|
|
191
|
+
SliderOwnerState
|
|
192
|
+
>;
|
|
193
|
+
input?: SlotComponentProps<'input', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* The components used for each slot inside the Slider.
|
|
197
|
+
* Either a string to use a HTML element or a component.
|
|
198
|
+
* @default {}
|
|
199
|
+
*/
|
|
200
|
+
slots?: {
|
|
201
|
+
root?: React.ElementType;
|
|
202
|
+
track?: React.ElementType;
|
|
203
|
+
rail?: React.ElementType;
|
|
204
|
+
thumb?: React.ElementType;
|
|
205
|
+
mark?: React.ElementType;
|
|
206
|
+
markLabel?: React.ElementType;
|
|
207
|
+
valueLabel?: React.ElementType;
|
|
208
|
+
input?: React.ElementType;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* The granularity with which the slider can step through values. (A "discrete" slider.)
|
|
212
|
+
* The `min` prop serves as the origin for the valid values.
|
|
213
|
+
* We recommend (max - min) to be evenly divisible by the step.
|
|
214
|
+
*
|
|
215
|
+
* When step is `null`, the thumb can only be slid onto marks provided with the `marks` prop.
|
|
216
|
+
* @default 1
|
|
217
|
+
*/
|
|
218
|
+
step?: number | null;
|
|
79
219
|
/**
|
|
80
220
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
81
221
|
*/
|
|
82
222
|
sx?: SxProps<Theme>;
|
|
223
|
+
/**
|
|
224
|
+
* Tab index attribute of the hidden `input` element.
|
|
225
|
+
*/
|
|
226
|
+
tabIndex?: number;
|
|
227
|
+
/**
|
|
228
|
+
* The track presentation:
|
|
229
|
+
*
|
|
230
|
+
* - `normal` the track will render a bar representing the slider value.
|
|
231
|
+
* - `inverted` the track will render a bar representing the remaining slider value.
|
|
232
|
+
* - `false` the track will render without a bar.
|
|
233
|
+
* @default 'normal'
|
|
234
|
+
*/
|
|
235
|
+
track?: 'normal' | false | 'inverted';
|
|
236
|
+
/**
|
|
237
|
+
* The value of the slider.
|
|
238
|
+
* For ranged sliders, provide an array with two values.
|
|
239
|
+
*/
|
|
240
|
+
value?: number | number[];
|
|
241
|
+
/**
|
|
242
|
+
* Controls when the value label is displayed:
|
|
243
|
+
*
|
|
244
|
+
* - `auto` the value label will display when the thumb is hovered or focused.
|
|
245
|
+
* - `on` will display persistently.
|
|
246
|
+
* - `off` will never display.
|
|
247
|
+
* @default 'off'
|
|
248
|
+
*/
|
|
249
|
+
valueLabelDisplay?: 'on' | 'auto' | 'off';
|
|
250
|
+
/**
|
|
251
|
+
* The format function the value label's value.
|
|
252
|
+
*
|
|
253
|
+
* When a function is provided, it should have the following signature:
|
|
254
|
+
*
|
|
255
|
+
* - {number} value The value label's value to format
|
|
256
|
+
* - {number} index The value label's index to format
|
|
257
|
+
* @param {any} x
|
|
258
|
+
* @returns {any}
|
|
259
|
+
* @default function Identity(x) {
|
|
260
|
+
* return x;
|
|
261
|
+
* }
|
|
262
|
+
*/
|
|
263
|
+
valueLabelFormat?: string | ((value: number, index: number) => React.ReactNode);
|
|
83
264
|
};
|
|
84
265
|
defaultComponent: D;
|
|
85
|
-
}
|
|
266
|
+
}
|
|
86
267
|
|
|
87
|
-
export
|
|
268
|
+
export interface SliderValueLabelProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
269
|
+
children: React.ReactElement;
|
|
270
|
+
index: number;
|
|
271
|
+
open: boolean;
|
|
272
|
+
value: number;
|
|
273
|
+
}
|
|
88
274
|
|
|
89
275
|
type SliderRootProps = NonNullable<SliderTypeMap['props']['componentsProps']>['root'];
|
|
90
276
|
type SliderMarkProps = NonNullable<SliderTypeMap['props']['componentsProps']>['mark'];
|
|
@@ -110,19 +296,12 @@ export declare const SliderValueLabel: React.FC<SliderValueLabelProps>;
|
|
|
110
296
|
* API:
|
|
111
297
|
*
|
|
112
298
|
* - [Slider API](https://mui.com/material-ui/api/slider/)
|
|
113
|
-
* - inherits [SliderUnstyled API](https://mui.com/base/api/slider-unstyled/)
|
|
114
299
|
*/
|
|
115
|
-
declare const Slider:
|
|
116
|
-
|
|
117
|
-
export type SliderClassKey = keyof NonNullable<SliderTypeMap['props']['classes']>;
|
|
300
|
+
declare const Slider: OverridableComponent<SliderTypeMap>;
|
|
118
301
|
|
|
119
302
|
export type SliderProps<
|
|
120
303
|
D extends React.ElementType = SliderTypeMap['defaultComponent'],
|
|
121
304
|
P = {},
|
|
122
305
|
> = OverrideProps<SliderTypeMap<D, P>, D>;
|
|
123
306
|
|
|
124
|
-
export type SliderClasses = Record<SliderClassKey, string>;
|
|
125
|
-
|
|
126
|
-
export declare const sliderClasses: SliderClasses;
|
|
127
|
-
|
|
128
307
|
export default Slider;
|