@mui/material 5.14.16 → 5.14.18

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.
Files changed (36) hide show
  1. package/Autocomplete/Autocomplete.d.ts +3 -0
  2. package/Autocomplete/Autocomplete.js +15 -4
  3. package/CHANGELOG.md +129 -7
  4. package/FilledInput/FilledInput.js +8 -5
  5. package/FormControlLabel/FormControlLabel.js +1 -2
  6. package/InputBase/InputBase.d.ts +4 -2
  7. package/Rating/Rating.js +4 -6
  8. package/TablePagination/TablePagination.d.ts +23 -0
  9. package/TablePagination/TablePagination.js +47 -12
  10. package/TablePagination/TablePaginationActions.d.ts +19 -0
  11. package/TablePagination/TablePaginationActions.js +35 -15
  12. package/index.js +1 -1
  13. package/legacy/Autocomplete/Autocomplete.js +8 -2
  14. package/legacy/FilledInput/FilledInput.js +8 -5
  15. package/legacy/FormControlLabel/FormControlLabel.js +1 -2
  16. package/legacy/Rating/Rating.js +4 -5
  17. package/legacy/TablePagination/TablePagination.js +47 -11
  18. package/legacy/TablePagination/TablePaginationActions.js +35 -14
  19. package/legacy/index.js +1 -1
  20. package/modern/Autocomplete/Autocomplete.js +15 -4
  21. package/modern/FilledInput/FilledInput.js +8 -5
  22. package/modern/FormControlLabel/FormControlLabel.js +1 -2
  23. package/modern/Rating/Rating.js +4 -6
  24. package/modern/TablePagination/TablePagination.js +46 -12
  25. package/modern/TablePagination/TablePaginationActions.js +34 -15
  26. package/modern/index.js +1 -1
  27. package/node/Autocomplete/Autocomplete.js +15 -4
  28. package/node/FilledInput/FilledInput.js +8 -5
  29. package/node/FormControlLabel/FormControlLabel.js +1 -2
  30. package/node/Rating/Rating.js +4 -6
  31. package/node/TablePagination/TablePagination.js +47 -12
  32. package/node/TablePagination/TablePaginationActions.js +35 -15
  33. package/node/index.js +1 -1
  34. package/package.json +6 -6
  35. package/umd/material-ui.development.js +114 -46
  36. package/umd/material-ui.production.min.js +18 -18
@@ -195,6 +195,9 @@ export interface AutocompleteProps<
195
195
  * @default 'No options'
196
196
  */
197
197
  noOptionsText?: React.ReactNode;
198
+ onKeyDown?: (
199
+ event: React.KeyboardEvent<HTMLDivElement> & { defaultMuiPrevented?: boolean },
200
+ ) => void;
198
201
  /**
199
202
  * Override the default text for the *open popup* icon button.
200
203
  *
@@ -4,7 +4,8 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
4
4
  import _extends from "@babel/runtime/helpers/esm/extends";
5
5
  var _ClearIcon, _ArrowDropDownIcon;
6
6
  const _excluded = ["autoComplete", "autoHighlight", "autoSelect", "blurOnSelect", "ChipProps", "className", "clearIcon", "clearOnBlur", "clearOnEscape", "clearText", "closeText", "componentsProps", "defaultValue", "disableClearable", "disableCloseOnSelect", "disabled", "disabledItemsFocusable", "disableListWrap", "disablePortal", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "fullWidth", "getLimitTagsText", "getOptionDisabled", "getOptionLabel", "isOptionEqualToValue", "groupBy", "handleHomeEndKeys", "id", "includeInputInList", "inputValue", "limitTags", "ListboxComponent", "ListboxProps", "loading", "loadingText", "multiple", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "PaperComponent", "PopperComponent", "popupIcon", "readOnly", "renderGroup", "renderInput", "renderOption", "renderTags", "selectOnFocus", "size", "slotProps", "value"],
7
- _excluded2 = ["ref"];
7
+ _excluded2 = ["ref"],
8
+ _excluded3 = ["key"];
8
9
  import * as React from 'react';
9
10
  import PropTypes from 'prop-types';
10
11
  import clsx from 'clsx';
@@ -527,9 +528,15 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
527
528
  })]
528
529
  }, params.key);
529
530
  const renderGroup = renderGroupProp || defaultRenderGroup;
530
- const defaultRenderOption = (props2, option) => /*#__PURE__*/_jsx("li", _extends({}, props2, {
531
- children: getOptionLabel(option)
532
- }));
531
+ const defaultRenderOption = (props2, option) => {
532
+ const {
533
+ key
534
+ } = props2,
535
+ otherProps = _objectWithoutPropertiesLoose(props2, _excluded3);
536
+ return /*#__PURE__*/_jsx("li", _extends({}, otherProps, {
537
+ children: getOptionLabel(option)
538
+ }), key);
539
+ };
533
540
  const renderOption = renderOptionProp || defaultRenderOption;
534
541
  const renderListOption = (option, index) => {
535
542
  const optionProps = getOptionProps({
@@ -945,6 +952,10 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
945
952
  * @param {string} reason Can be: `"input"` (user input), `"reset"` (programmatic change), `"clear"`.
946
953
  */
947
954
  onInputChange: PropTypes.func,
955
+ /**
956
+ * @ignore
957
+ */
958
+ onKeyDown: PropTypes.func,
948
959
  /**
949
960
  * Callback fired when the popup requests to be opened.
950
961
  * Use in controlled mode (see open).
package/CHANGELOG.md CHANGED
@@ -1,5 +1,127 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 5.14.18
4
+
5
+ <!-- generated comparing v5.14.17..master -->
6
+
7
+ _Nov 14, 2023_
8
+
9
+ A big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - 💫 Introduced new [Stepper](https://mui.com/joy-ui/react-stepper/) component in Joy UI (#39688) @siriwatknp
12
+ - other 🐛 bug fixes and 📚 documentation improvements
13
+
14
+ ### `@mui/material@5.14.18`
15
+
16
+ - &#8203;<!-- 32 -->[Autocomplete] Add `defaultMuiPrevented` to onKeyDown type (#39820) @sai6855
17
+ - &#8203;<!-- 31 -->[Autocomplete] Fix React key warning in Next.js (#39795) @mj12albert
18
+ - &#8203;<!-- 24 -->[Checkbox] Asterisk placement aligned correctly (#39721) @axelbostrom
19
+ - &#8203;<!-- 04 -->[Rating] Fix the hover highlighting for spaced icons (#39775) @ZeeshanTamboli
20
+ - &#8203;<!-- 03 -->[TablePagination] Implement `slotProps` pattern for the actions and the select slots (#39353) @anle9650
21
+ - &#8203;<!-- 02 -->[TextField] Fix padding on small filled multiline TextField (#39769) @mj12albert
22
+
23
+ ### `@mui/joy@5.0.0-beta.15`
24
+
25
+ - &#8203;<!-- 11 -->[Stepper] Add new `Stepper` component (#39688) @siriwatknp
26
+ - &#8203;<!-- 12 -->[Select] Fix displaying placeholder when multiple is true (#39806) @sai6855
27
+
28
+ ### `@mui/material-next@6.0.0-alpha.110`
29
+
30
+ - &#8203;<!-- 26 -->[ButtonGroup] Copy `ButtonGroup` to material next (#39739) @lhilgert9
31
+ - &#8203;<!-- 09 -->[ProgressIndicator] Change `CircularProgress` files to ts (#39791) @lhilgert9
32
+ - &#8203;<!-- 08 -->[ProgressIndicator] Change `LinearProgress` files to ts (#39793) @lhilgert9
33
+ - &#8203;<!-- 07 -->[ProgressIndicator] Copy `LinearProgress` to material next (#39779) @lhilgert9
34
+ - &#8203;<!-- 06 -->[ProgressIndicator] Copy `CircularProgress` to material next (#39780) @lhilgert9
35
+ - &#8203;<!-- 05 -->[TextField] Add FormLabel and InputLabel components (#39483) @mj12albert
36
+
37
+ ## Docs
38
+
39
+ - &#8203;<!-- 30 -->[base-ui][NumberInput] Fix inconsistent demo component names (#39786) @mnajdova
40
+ - &#8203;<!-- 29 -->[base-ui][Menu] Refine demos (#39823) @zanivan
41
+ - &#8203;<!-- 28 -->[base-ui][Switch] Refine demos (#39822) @zanivan
42
+ - &#8203;<!-- 16 -->[joy-ui] Fix API generation for Grid (#39861) @oliviertassinari
43
+ - &#8203;<!-- 15 -->[joy-ui] Fix menu in color inversion header demo (#39785) @sai6855
44
+ - &#8203;<!-- 14 -->[joy-ui] Change the design kit link on the Overview page (#39725) @danilo-leal
45
+ - &#8203;<!-- 13 -->[joy-ui] Add `CssBaseline` to integration with Material UI page (#39790) @swillianc
46
+ - &#8203;<!-- 10 -->[joy-ui][Tabs] Add wordBreak style to demo (#39821) @sai6855
47
+
48
+ ## Core
49
+
50
+ - &#8203;<!-- 27 -->[blog] MUI X late v6 blog post (#39700) @joserodolfofreitas
51
+ - &#8203;<!-- 25 -->[CHANGELOG] Correct the Joy UI version in the changelog (#39788) @michaldudak
52
+ - &#8203;<!-- 23 -->[core] Remove legacy docs files (#39860) @oliviertassinari
53
+ - &#8203;<!-- 22 -->[core] Fix GitHub title tag consistency @oliviertassinari
54
+ - &#8203;<!-- 21 -->[core] Make the API docs builder configurable per project (#39772) @michaldudak
55
+ - &#8203;<!-- 20 -->[docs] Fix the default theme viewer font family (#39782) @danilo-leal
56
+ - &#8203;<!-- 19 -->[docs-infra] Fix hydration api (#39706) @oliviertassinari
57
+ - &#8203;<!-- 18 -->[docs-infra] Adjust the website & docs footer (#39810) @danilo-leal
58
+ - &#8203;<!-- 17 -->[docs-infra] Fix bug on API prop copy experience (#39707) @oliviertassinari
59
+ - &#8203;<!-- 01 -->[website] Change roadmap link destination (#39639) @danilo-leal
60
+
61
+ All contributors of this release in alphabetical order: @anle9650, @axelbostrom, @danilo-leal, @joserodolfofreitas, @lhilgert9, @michaldudak, @mj12albert, @mnajdova, @oliviertassinari, @sai6855, @siriwatknp, @swillianc, @zanivan, @ZeeshanTamboli
62
+
63
+ ## 5.14.17
64
+
65
+ <!-- generated comparing v5.14.16..master -->
66
+
67
+ _Nov 6, 2023_
68
+
69
+ A big thanks to the 12 contributors who made this release possible.
70
+ This release was mostly about 🐛 bug fixes and 📚 documentation improvements.
71
+
72
+ ### `@mui/material@5.14.17`
73
+
74
+ - [Dialog] Should not close until the IME is cancelled (#39713) @megos
75
+ - [InputBase] Add `sx` type to `input` and `root` slot (#39569) @sai6855
76
+
77
+ ### `@mui/joy@5.0.0-beta.14`
78
+
79
+ - [ModalDialog] Remove redundant code (#39719) @sai6855
80
+ - [ToggleButtonGroup] Fix toggling button state when `Button` is not immediate children (#39571) @sai6855
81
+
82
+ ### `@mui/base@5.0.0-beta.23`
83
+
84
+ - Make list components more reliable (#39380) @michaldudak
85
+
86
+ ### `@mui/material-next@6.0.0-alpha.109`
87
+
88
+ - [InputBase] InputBase slotProps accepts sx type (#39714) @mj12albert
89
+ - [OutlinedInput] Copy v5 OutlinedInput (#39698) @mj12albert
90
+
91
+ ### `@mui/lab@5.0.0-alpha.152`
92
+
93
+ - [TreeView] Remove tree view import from @mui/lab (#39685) @alexfauquette
94
+
95
+ ### Docs
96
+
97
+ - Update Taiwan country name in demos (#39729) @chiahao
98
+ - Update release doc for unchanged packages (#39487) @brijeshb42
99
+ - [joy-ui] Make code readable to set next color in color inversion demos (#39669) @ZeeshanTamboli
100
+ - [material-ui] Remove numeric input workaround from TextField docs (#39629) @mj12albert
101
+ - [material-ui] Add comment about code to be removed from Drawer demo (#39678) @samuelsycamore
102
+
103
+ ### Core
104
+
105
+ - [docs-infra] Fix path bloat client-side (#39708) @oliviertassinari
106
+ - [docs-infra] Render footer in SSR (#39710) @oliviertassinari
107
+ - [docs-infra] Simplify footer (#39709) @oliviertassinari
108
+ - [docs-infra] Fix dark theme color (#39720) @alexfauquette
109
+ - [docs-infra] Remove the design feedback alert (#39691) @danilo-leal
110
+ - [docs-infra] Bring back scroll gradient in API page with table (#39689) @alexfauquette
111
+ - [docs-infra] Clarify the content of the ads @oliviertassinari
112
+ - [docs-infra] Link to ScaffoldHub v2 @oliviertassinari
113
+ - [docs-infra] Improve access to the component demos via the API page (#39690) @danilo-leal
114
+ - [docs-infra] Add appropriate aria-label to docs buttons (#39638) @danilo-leal
115
+ - [docs-infra] Fix crawler on API pages (#39490) @alexfauquette
116
+ - [docs–infra] Small polish on API toggle (#39704) @oliviertassinari
117
+ - [core] Speed up the CI by removing the second build (#39684) @michaldudak
118
+ - [core][docs] Fix broken MUI System link in README.md (#39734) @samuelsycamore
119
+ - [website] List benefits for sponsors (#39640) @oliviertassinari
120
+ - [website] Add Vadym teamMember card to 'About' (#39701) @hasdfa
121
+ - [test] Fix flaky screenshot (#39711) @oliviertassinari
122
+
123
+ All contributors of this release in alphabetical order: @alexfauquette, @brijeshb42, @chiahao, @danilo-leal, @hasdfa, @megos, @michaldudak, @mj12albert, @oliviertassinari, @sai6855, @samuelsycamore, @ZeeshanTamboli
124
+
3
125
  ## 5.14.16
4
126
 
5
127
  <!-- generated comparing v5.14.15..master -->
@@ -814,7 +936,7 @@ A big thanks to the 21 contributors who made this release possible. Here are som
814
936
 
815
937
  ### Core
816
938
 
817
- - [CHANGELOG] Fix issues in highlight @oliviertassinari
939
+ - [changelog] Fix issues in highlight @oliviertassinari
818
940
  - [core] Remove redundant `@material-ui/` aliases from regression test webpack config (#38574) @ZeeshanTamboli
819
941
  - [core] Fix CI error @oliviertassinari
820
942
  - [core] Remove unnecessary Box (#38461) @oliviertassinari
@@ -1473,7 +1595,7 @@ A big thanks to the 25 contributors who made this release possible. Here are som
1473
1595
  - &#8203;<!-- 20 -->[docs-infra] Fix demos border radius (#37658) @oliviertassinari
1474
1596
  - &#8203;<!-- 19 -->[docs-infra] Add analyticsTags to Algolia (#37600) @Janpot
1475
1597
  - &#8203;<!-- 18 -->[docs-infra] Simplify product id handling (#37593) @oliviertassinari
1476
- - &#8203;<!-- 35 -->[CHANGELOG] Add missing release date for v5.13.5 @oliviertassinari
1598
+ - &#8203;<!-- 35 -->[changelog] Add missing release date for v5.13.5 @oliviertassinari
1477
1599
  - &#8203;<!-- 16 -->[examples] Shell command fix in the readme file of material-next-ts example (#37675) @bablukpik
1478
1600
  - &#8203;<!-- 15 -->[examples] Next.js v13 app router with Material UI (#37315) @smo043
1479
1601
 
@@ -3220,7 +3342,7 @@ A big thanks to the 19 contributors who made this release possible. Here are som
3220
3342
  - [docs] Improve line-height readability (#35387) @oliviertassinari
3221
3343
  - [docs] Improve a bit the Composition docs (#35329) @oliviertassinari
3222
3344
  - [docs] Refactor `ToggleButtonSizes` demo (#35375) @Armanio
3223
- - [docs] Standardize the usage of callouts in the MUI Core docs (#35361) @samuelsycamore
3345
+ - [docs] Standardize the usage of callouts in the docs (#35361) @samuelsycamore
3224
3346
  - [docs] Format feedback to add a link to the commented section (#35381) @alexfauquette
3225
3347
  - [docs] Direct users from Material UI to Base UI for duplicated components (#35293) @samuelsycamore
3226
3348
  - [docs] Fix typo in FormControl API docs (#35449) @Spanishiwa
@@ -3586,7 +3708,7 @@ A big thanks to the 16 contributors who made this release possible. Here are som
3586
3708
  - &#8203;<!-- 16 -->[docs] Fix typo in docs title (#34926) @PunitSoniME
3587
3709
  - &#8203;<!-- 25 -->[docs] Fix missing emotion prefixes (#34958) @oliviertassinari
3588
3710
  - &#8203;<!-- 26 -->[docs] Improve UI display for copy code (#34950) @oliviertassinari
3589
- - &#8203;<!-- 15 -->[docs] Standardize all MUI Core "Usage" pages (#34183) @samuelsycamore
3711
+ - &#8203;<!-- 15 -->[docs] Standardize all "Usage" pages (#34183) @samuelsycamore
3590
3712
  - &#8203;<!-- 14 -->[docs] Update templates' readme files to include required dependencies (#34757) @michaldudak
3591
3713
  - &#8203;<!-- 13 -->[docs] Fix inconsistent theme colors when applying custom colors in playground (#34866) @cherniavskii
3592
3714
  - &#8203;<!-- 12 -->[docs] Fix typo in bottom-navigation.md (#34884) @RoodyCode
@@ -3952,7 +4074,7 @@ A big thanks to the 21 contributors who made this release possible. Here are som
3952
4074
  - [docs] Update the guide for migrating to TSS (#34417) @garronej
3953
4075
  - [docs] Fix typo in `Grid` docs (#34475) @Dustin-Digitar
3954
4076
  - [docs] Fix typo in `Back to top` section in AppBar docs (#34479) @Dustin-Digitar
3955
- - [docs] Standardize all MUI Core "Installation" pages (#34168) @samuelsycamore
4077
+ - [docs] Standardize all "Installation" pages (#34168) @samuelsycamore
3956
4078
  - [docs] Fix webpack file name to the standard: `webpack.config.js` (#34446) @CodingItWrong
3957
4079
  - [docs] Fix Select `onChange` call (#34408) @siriwatknp
3958
4080
  - [docs] Notification for pickers blog - v5 stable (#34400) @joserodolfofreitas
@@ -6816,7 +6938,7 @@ A big thanks to the 18 contributors who made this release possible. Here are som
6816
6938
 
6817
6939
  - [blog] MUI X v5 blog post (#29590) @DanailH
6818
6940
  - [blog] Polish the Benny Joo joins MUI post (#29697) @oliviertassinari
6819
- - [CHANGELOG] Explain why we do breaking changes @oliviertassinari
6941
+ - [changelog] Explain why we do breaking changes @oliviertassinari
6820
6942
  - [core] Update latest issue template for codesandbox CI (#29783) @eps1lon
6821
6943
  - [core] Ensure `@mui/core` is an alias for `@mui/base` (#29762) @eps1lon
6822
6944
  - [docs] Fix broken Next and Previous links (#29711) @scallaway
@@ -10059,7 +10181,7 @@ The prop didn't solve any important problem better than any of its alternatives
10059
10181
 
10060
10182
  ### Core
10061
10183
 
10062
- - &#8203;<!-- 01 -->[CHANGELOG] Better document breaking changes @oliviertassinari
10184
+ - &#8203;<!-- 01 -->[changelog] Better document breaking changes @oliviertassinari
10063
10185
  - &#8203;<!-- 05 -->[core] Modernize icons `builder:src` (#25137) @eps1lon
10064
10186
  - &#8203;<!-- 04 -->[core] Properly use BABEL_ENV test and development (#25139) @eps1lon
10065
10187
  - &#8203;<!-- 15 -->[test] Add (manual) visual regression test for icons (#25160) @eps1lon
@@ -126,6 +126,9 @@ const FilledInputRoot = styled(InputBaseRoot, {
126
126
  }, ownerState.hiddenLabel && {
127
127
  paddingTop: 16,
128
128
  paddingBottom: 17
129
+ }, ownerState.hiddenLabel && ownerState.size === 'small' && {
130
+ paddingTop: 8,
131
+ paddingBottom: 9
129
132
  }));
130
133
  });
131
134
  const FilledInputInput = styled(InputBaseInput, {
@@ -166,11 +169,6 @@ const FilledInputInput = styled(InputBaseInput, {
166
169
  }, ownerState.hiddenLabel && {
167
170
  paddingTop: 16,
168
171
  paddingBottom: 17
169
- }, ownerState.multiline && {
170
- paddingTop: 0,
171
- paddingBottom: 0,
172
- paddingLeft: 0,
173
- paddingRight: 0
174
172
  }, ownerState.startAdornment && {
175
173
  paddingLeft: 0
176
174
  }, ownerState.endAdornment && {
@@ -178,6 +176,11 @@ const FilledInputInput = styled(InputBaseInput, {
178
176
  }, ownerState.hiddenLabel && ownerState.size === 'small' && {
179
177
  paddingTop: 8,
180
178
  paddingBottom: 9
179
+ }, ownerState.multiline && {
180
+ paddingTop: 0,
181
+ paddingBottom: 0,
182
+ paddingLeft: 0,
183
+ paddingRight: 0
181
184
  }));
182
185
  const FilledInput = /*#__PURE__*/React.forwardRef(function FilledInput(inProps, ref) {
183
186
  var _ref, _slots$root, _ref2, _slots$input;
@@ -152,8 +152,7 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
152
152
  ref: ref
153
153
  }, other, {
154
154
  children: [/*#__PURE__*/React.cloneElement(control, controlProps), required ? /*#__PURE__*/_jsxs(Stack, {
155
- direction: "row",
156
- alignItems: "center",
155
+ display: "block",
157
156
  children: [label, /*#__PURE__*/_jsxs(AsteriskComponent, {
158
157
  ownerState: ownerState,
159
158
  "aria-hidden": true,
@@ -209,8 +209,10 @@ export interface InputBaseProps
209
209
  * @default {}
210
210
  */
211
211
  slotProps?: {
212
- root?: React.HTMLAttributes<HTMLDivElement> & InputBaseComponentsPropsOverrides;
213
- input?: React.InputHTMLAttributes<HTMLInputElement> & InputBaseComponentsPropsOverrides;
212
+ root?: React.HTMLAttributes<HTMLDivElement> &
213
+ InputBaseComponentsPropsOverrides & { sx?: SxProps<Theme> };
214
+ input?: React.InputHTMLAttributes<HTMLInputElement> &
215
+ InputBaseComponentsPropsOverrides & { sx?: SxProps<Theme> };
214
216
  };
215
217
  /**
216
218
  * The components used for each slot inside.
package/Rating/Rating.js CHANGED
@@ -337,16 +337,14 @@ const Rating = /*#__PURE__*/React.forwardRef(function Rating(inProps, ref) {
337
337
  const rootNode = rootRef.current;
338
338
  const {
339
339
  right,
340
- left
340
+ left,
341
+ width: containerWidth
341
342
  } = rootNode.getBoundingClientRect();
342
- const {
343
- width
344
- } = rootNode.firstChild.getBoundingClientRect();
345
343
  let percent;
346
344
  if (theme.direction === 'rtl') {
347
- percent = (right - event.clientX) / (width * max);
345
+ percent = (right - event.clientX) / containerWidth;
348
346
  } else {
349
- percent = (event.clientX - left) / (width * max);
347
+ percent = (event.clientX - left) / containerWidth;
350
348
  }
351
349
  let newHover = roundValueToPrecision(max * percent + precision / 2, precision);
352
350
  newHover = clamp(newHover, precision, max);
@@ -29,6 +29,9 @@ export interface TablePaginationOwnProps extends TablePaginationBaseProps {
29
29
  ActionsComponent?: React.ElementType<TablePaginationActionsProps>;
30
30
  /**
31
31
  * Props applied to the back arrow [`IconButton`](/material-ui/api/icon-button/) component.
32
+ *
33
+ * This prop is an alias for `slotProps.actions.previousButton` and will be overriden by it if both are used.
34
+ * @deprecated Use `slotProps.actions.previousButton` instead.
32
35
  */
33
36
  backIconButtonProps?: Partial<IconButtonProps>;
34
37
  /**
@@ -41,6 +44,11 @@ export interface TablePaginationOwnProps extends TablePaginationBaseProps {
41
44
  * To enable server side pagination for an unknown number of items, provide -1.
42
45
  */
43
46
  count: number;
47
+ /**
48
+ * If `true`, the component is disabled.
49
+ * @default false
50
+ */
51
+ disabled?: boolean;
44
52
  /**
45
53
  * Accepts a function which returns a string value that provides a user-friendly name for the current page.
46
54
  * This is important for screen reader users.
@@ -72,6 +80,9 @@ export interface TablePaginationOwnProps extends TablePaginationBaseProps {
72
80
  labelRowsPerPage?: React.ReactNode;
73
81
  /**
74
82
  * Props applied to the next arrow [`IconButton`](/material-ui/api/icon-button/) element.
83
+ *
84
+ * This prop is an alias for `slotProps.actions.nextButton` and will be overriden by it if both are used.
85
+ * @deprecated Use `slotProps.actions.nextButton` instead.
75
86
  */
76
87
  nextIconButtonProps?: Partial<IconButtonProps>;
77
88
  /**
@@ -106,6 +117,10 @@ export interface TablePaginationOwnProps extends TablePaginationBaseProps {
106
117
  rowsPerPageOptions?: Array<number | { value: number; label: string }>;
107
118
  /**
108
119
  * Props applied to the rows per page [`Select`](/material-ui/api/select/) element.
120
+ *
121
+ * This prop is an alias for `slotProps.select` and will be overriden by it if both are used.
122
+ * @deprecated Use `slotProps.select` instead.
123
+ *
109
124
  * @default {}
110
125
  */
111
126
  SelectProps?: Partial<SelectProps>;
@@ -119,6 +134,14 @@ export interface TablePaginationOwnProps extends TablePaginationBaseProps {
119
134
  * @default false
120
135
  */
121
136
  showLastButton?: boolean;
137
+ /**
138
+ * The props used for each slot inside the TablePagination.
139
+ * @default {}
140
+ */
141
+ slotProps?: {
142
+ actions?: TablePaginationActionsProps['slotProps'];
143
+ select?: Partial<SelectProps>;
144
+ };
122
145
  /**
123
146
  * The system prop that allows defining system overrides as well as additional CSS styles.
124
147
  */
@@ -3,7 +3,7 @@
3
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
4
  import _extends from "@babel/runtime/helpers/esm/extends";
5
5
  var _InputBase;
6
- const _excluded = ["ActionsComponent", "backIconButtonProps", "className", "colSpan", "component", "count", "getItemAriaLabel", "labelDisplayedRows", "labelRowsPerPage", "nextIconButtonProps", "onPageChange", "onRowsPerPageChange", "page", "rowsPerPage", "rowsPerPageOptions", "SelectProps", "showFirstButton", "showLastButton"];
6
+ const _excluded = ["ActionsComponent", "backIconButtonProps", "className", "colSpan", "component", "count", "disabled", "getItemAriaLabel", "labelDisplayedRows", "labelRowsPerPage", "nextIconButtonProps", "onPageChange", "onRowsPerPageChange", "page", "rowsPerPage", "rowsPerPageOptions", "SelectProps", "showFirstButton", "showLastButton", "slotProps"];
7
7
  import * as React from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import clsx from 'clsx';
@@ -144,6 +144,7 @@ const useUtilityClasses = ownerState => {
144
144
  * A `TableCell` based component for placing inside `TableFooter` for pagination.
145
145
  */
146
146
  const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(inProps, ref) {
147
+ var _slotProps$select;
147
148
  const props = useThemeProps({
148
149
  props: inProps,
149
150
  name: 'MuiTablePagination'
@@ -155,6 +156,7 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
155
156
  colSpan: colSpanProp,
156
157
  component = TableCell,
157
158
  count,
159
+ disabled = false,
158
160
  getItemAriaLabel = defaultGetAriaLabel,
159
161
  labelDisplayedRows = defaultLabelDisplayedRows,
160
162
  labelRowsPerPage = 'Rows per page:',
@@ -166,19 +168,21 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
166
168
  rowsPerPageOptions = [10, 25, 50, 100],
167
169
  SelectProps = {},
168
170
  showFirstButton = false,
169
- showLastButton = false
171
+ showLastButton = false,
172
+ slotProps
170
173
  } = props,
171
174
  other = _objectWithoutPropertiesLoose(props, _excluded);
172
175
  const ownerState = props;
173
176
  const classes = useUtilityClasses(ownerState);
174
- const MenuItemComponent = SelectProps.native ? 'option' : TablePaginationMenuItem;
177
+ const selectProps = (_slotProps$select = slotProps == null ? void 0 : slotProps.select) != null ? _slotProps$select : SelectProps;
178
+ const MenuItemComponent = selectProps.native ? 'option' : TablePaginationMenuItem;
175
179
  let colSpan;
176
180
  if (component === TableCell || component === 'td') {
177
181
  colSpan = colSpanProp || 1000; // col-span over everything
178
182
  }
179
183
 
180
- const selectId = useId(SelectProps.id);
181
- const labelId = useId(SelectProps.labelId);
184
+ const selectId = useId(selectProps.id);
185
+ const labelId = useId(selectProps.labelId);
182
186
  const getLabelDisplayedRowsTo = () => {
183
187
  if (count === -1) {
184
188
  return (page + 1) * rowsPerPage;
@@ -202,21 +206,22 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
202
206
  children: labelRowsPerPage
203
207
  }), rowsPerPageOptions.length > 1 && /*#__PURE__*/_jsx(TablePaginationSelect, _extends({
204
208
  variant: "standard"
205
- }, !SelectProps.variant && {
209
+ }, !selectProps.variant && {
206
210
  input: _InputBase || (_InputBase = /*#__PURE__*/_jsx(InputBase, {}))
207
211
  }, {
208
212
  value: rowsPerPage,
209
213
  onChange: onRowsPerPageChange,
210
214
  id: selectId,
211
215
  labelId: labelId
212
- }, SelectProps, {
213
- classes: _extends({}, SelectProps.classes, {
216
+ }, selectProps, {
217
+ classes: _extends({}, selectProps.classes, {
214
218
  // TODO v5 remove `classes.input`
215
- root: clsx(classes.input, classes.selectRoot, (SelectProps.classes || {}).root),
216
- select: clsx(classes.select, (SelectProps.classes || {}).select),
219
+ root: clsx(classes.input, classes.selectRoot, (selectProps.classes || {}).root),
220
+ select: clsx(classes.select, (selectProps.classes || {}).select),
217
221
  // TODO v5 remove `selectIcon`
218
- icon: clsx(classes.selectIcon, (SelectProps.classes || {}).icon)
222
+ icon: clsx(classes.selectIcon, (selectProps.classes || {}).icon)
219
223
  }),
224
+ disabled: disabled,
220
225
  children: rowsPerPageOptions.map(rowsPerPageOption => /*#__PURE__*/_createElement(MenuItemComponent, _extends({}, !isHostComponent(MenuItemComponent) && {
221
226
  ownerState
222
227
  }, {
@@ -242,7 +247,9 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
242
247
  rowsPerPage: rowsPerPage,
243
248
  showFirstButton: showFirstButton,
244
249
  showLastButton: showLastButton,
245
- getItemAriaLabel: getItemAriaLabel
250
+ slotProps: slotProps == null ? void 0 : slotProps.actions,
251
+ getItemAriaLabel: getItemAriaLabel,
252
+ disabled: disabled
246
253
  })]
247
254
  })
248
255
  }));
@@ -260,6 +267,9 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
260
267
  ActionsComponent: PropTypes.elementType,
261
268
  /**
262
269
  * Props applied to the back arrow [`IconButton`](/material-ui/api/icon-button/) component.
270
+ *
271
+ * This prop is an alias for `slotProps.actions.previousButton` and will be overriden by it if both are used.
272
+ * @deprecated Use `slotProps.actions.previousButton` instead.
263
273
  */
264
274
  backIconButtonProps: PropTypes.object,
265
275
  /**
@@ -285,6 +295,11 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
285
295
  * To enable server side pagination for an unknown number of items, provide -1.
286
296
  */
287
297
  count: integerPropType.isRequired,
298
+ /**
299
+ * If `true`, the component is disabled.
300
+ * @default false
301
+ */
302
+ disabled: PropTypes.bool,
288
303
  /**
289
304
  * Accepts a function which returns a string value that provides a user-friendly name for the current page.
290
305
  * This is important for screen reader users.
@@ -316,6 +331,9 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
316
331
  labelRowsPerPage: PropTypes.node,
317
332
  /**
318
333
  * Props applied to the next arrow [`IconButton`](/material-ui/api/icon-button/) element.
334
+ *
335
+ * This prop is an alias for `slotProps.actions.nextButton` and will be overriden by it if both are used.
336
+ * @deprecated Use `slotProps.actions.nextButton` instead.
319
337
  */
320
338
  nextIconButtonProps: PropTypes.object,
321
339
  /**
@@ -367,6 +385,10 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
367
385
  })]).isRequired),
368
386
  /**
369
387
  * Props applied to the rows per page [`Select`](/material-ui/api/select/) element.
388
+ *
389
+ * This prop is an alias for `slotProps.select` and will be overriden by it if both are used.
390
+ * @deprecated Use `slotProps.select` instead.
391
+ *
370
392
  * @default {}
371
393
  */
372
394
  SelectProps: PropTypes.object,
@@ -380,6 +402,19 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
380
402
  * @default false
381
403
  */
382
404
  showLastButton: PropTypes.bool,
405
+ /**
406
+ * The props used for each slot inside the TablePagination.
407
+ * @default {}
408
+ */
409
+ slotProps: PropTypes.shape({
410
+ actions: PropTypes.shape({
411
+ firstButton: PropTypes.object,
412
+ lastButton: PropTypes.object,
413
+ nextButton: PropTypes.object,
414
+ previousButton: PropTypes.object
415
+ }),
416
+ select: PropTypes.object
417
+ }),
383
418
  /**
384
419
  * The system prop that allows defining system overrides as well as additional CSS styles.
385
420
  */
@@ -2,12 +2,21 @@ import * as React from 'react';
2
2
  import { IconButtonProps } from '../IconButton/IconButton';
3
3
 
4
4
  export interface TablePaginationActionsProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ /**
6
+ * This prop is an alias for `slotProps.previousButton` and will be overriden by it if both are used.
7
+ * @deprecated Use `slotProps.previousButton` instead.
8
+ */
5
9
  backIconButtonProps?: Partial<IconButtonProps>;
6
10
  /**
7
11
  * Override or extend the styles applied to the component.
8
12
  */
9
13
  classes?: {};
10
14
  count: number;
15
+ /**
16
+ * If `true`, the component is disabled.
17
+ * @default false
18
+ */
19
+ disabled?: boolean;
11
20
  /**
12
21
  * Accepts a function which returns a string value that provides a user-friendly name for the current page.
13
22
  * This is important for screen reader users.
@@ -17,12 +26,22 @@ export interface TablePaginationActionsProps extends React.HTMLAttributes<HTMLDi
17
26
  * @returns {string}
18
27
  */
19
28
  getItemAriaLabel: (type: 'first' | 'last' | 'next' | 'previous') => string;
29
+ /**
30
+ * This prop is an alias for `slotProps.nextButton` and will be overriden by it if both are used.
31
+ * @deprecated Use `slotProps.nextButton` instead.
32
+ */
20
33
  nextIconButtonProps?: Partial<IconButtonProps>;
21
34
  onPageChange: (event: React.MouseEvent<HTMLButtonElement> | null, page: number) => void;
22
35
  page: number;
23
36
  rowsPerPage: number;
24
37
  showFirstButton: boolean;
25
38
  showLastButton: boolean;
39
+ slotProps?: {
40
+ firstButton?: Partial<IconButtonProps>;
41
+ lastButton?: Partial<IconButtonProps>;
42
+ nextButton?: Partial<IconButtonProps>;
43
+ previousButton?: Partial<IconButtonProps>;
44
+ };
26
45
  }
27
46
 
28
47
  declare const TablePaginationActions: React.JSXElementConstructor<TablePaginationActionsProps>;