@mui/material 5.15.0 → 5.15.1
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/AccordionActions/AccordionActions.js +1 -1
- package/Autocomplete/Autocomplete.js +4 -4
- package/CHANGELOG.md +42 -0
- package/CardActions/CardActions.js +1 -1
- package/TablePagination/TablePagination.d.ts +8 -0
- package/TablePagination/TablePagination.js +27 -4
- package/TablePagination/TablePaginationActions.d.ts +49 -0
- package/TablePagination/TablePaginationActions.js +54 -19
- package/index.js +1 -1
- package/legacy/AccordionActions/AccordionActions.js +1 -1
- package/legacy/Autocomplete/Autocomplete.js +4 -4
- package/legacy/CardActions/CardActions.js +1 -1
- package/legacy/TablePagination/TablePagination.js +29 -4
- package/legacy/TablePagination/TablePaginationActions.js +56 -19
- package/legacy/index.js +1 -1
- package/legacy/styles/experimental_extendTheme.js +12 -6
- package/modern/AccordionActions/AccordionActions.js +1 -1
- package/modern/Autocomplete/Autocomplete.js +4 -4
- package/modern/CardActions/CardActions.js +1 -1
- package/modern/TablePagination/TablePagination.js +27 -4
- package/modern/TablePagination/TablePaginationActions.js +53 -18
- package/modern/index.js +1 -1
- package/modern/styles/experimental_extendTheme.js +12 -6
- package/node/AccordionActions/AccordionActions.js +1 -1
- package/node/Autocomplete/Autocomplete.js +4 -4
- package/node/CardActions/CardActions.js +1 -1
- package/node/TablePagination/TablePagination.js +27 -4
- package/node/TablePagination/TablePaginationActions.js +54 -19
- package/node/index.js +1 -1
- package/node/styles/experimental_extendTheme.js +11 -5
- package/package.json +6 -6
- package/styles/experimental_extendTheme.js +12 -6
- package/umd/material-ui.development.js +103 -39
- package/umd/material-ui.production.min.js +20 -20
|
@@ -660,7 +660,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
660
660
|
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
661
661
|
// ----------------------------------------------------------------------
|
|
662
662
|
/**
|
|
663
|
-
* If `true`, the portion of the selected suggestion that
|
|
663
|
+
* If `true`, the portion of the selected suggestion that the user hasn't typed,
|
|
664
664
|
* known as the completion string, appears inline after the input cursor in the textbox.
|
|
665
665
|
* The inline completion string is visually highlighted and has a selected state.
|
|
666
666
|
* @default false
|
|
@@ -676,7 +676,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
676
676
|
* when the Autocomplete loses focus unless the user chooses
|
|
677
677
|
* a different option or changes the character string in the input.
|
|
678
678
|
*
|
|
679
|
-
* When using `freeSolo` mode, the typed value will be the input value
|
|
679
|
+
* When using the `freeSolo` mode, the typed value will be the input value
|
|
680
680
|
* if the Autocomplete loses focus without highlighting an option.
|
|
681
681
|
* @default false
|
|
682
682
|
*/
|
|
@@ -711,8 +711,8 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
711
711
|
/**
|
|
712
712
|
* If `true`, the input's text is cleared on blur if no value is selected.
|
|
713
713
|
*
|
|
714
|
-
* Set to `true` if you want to help the user enter a new value.
|
|
715
|
-
* Set to `false` if you want to help the user resume their search.
|
|
714
|
+
* Set it to `true` if you want to help the user enter a new value.
|
|
715
|
+
* Set it to `false` if you want to help the user resume their search.
|
|
716
716
|
* @default !props.freeSolo
|
|
717
717
|
*/
|
|
718
718
|
clearOnBlur: PropTypes.bool,
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 5.15.1
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v5.15.0..master -->
|
|
6
|
+
|
|
7
|
+
_Dec 19, 2023_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 15 contributors who made this release possible.
|
|
10
|
+
This release was mostly about 🐛 bug fixes and 📚 documentation improvements.
|
|
11
|
+
|
|
12
|
+
### `@mui/material@5.15.1`
|
|
13
|
+
|
|
14
|
+
- ​<!-- 13 -->[CardActions][DialogActions] Apply margin for all children except for 1st child (#40168) @sai6855
|
|
15
|
+
- ​<!-- 03 -->[TablePagination] Add ability to change icons in TablePaginationActions using `slots` and `slotProps` (#33797) @pratikkarad
|
|
16
|
+
- ​<!-- 13 -->[CssVarsProvider] Fix HSL breaking button styles (#39869) @gitstart
|
|
17
|
+
|
|
18
|
+
### `@mui/joy@5.0.0-beta.19`
|
|
19
|
+
|
|
20
|
+
- ​<!-- 05 -->[FormControl] Fix issue with the conditional setting of `htmlFor` and `id` attributes not functioning properly for form labels (#40180) @ReaZzy
|
|
21
|
+
- ​<!-- 04 -->[typescript] Address TypeScript issue with custom zIndex not functioning (#40133) @qiweiii
|
|
22
|
+
|
|
23
|
+
### `@mui/styled-engine-sc@6.0.0-alpha.9`
|
|
24
|
+
|
|
25
|
+
- ​<!-- 02 -->[typescript] Fix `theme` being of type any (#40200) @mnajdova
|
|
26
|
+
|
|
27
|
+
### Docs
|
|
28
|
+
|
|
29
|
+
- ​<!-- 09 -->[joy-ui] Fix typo in the CSS baseline page (#40222) @possibilities
|
|
30
|
+
- ​<!-- 08 -->[joy-ui] Document missing Autocomplete props (#39979) @ZeeshanTamboli
|
|
31
|
+
- ​<!-- 10 -->[joy-ui] Fix typo about Typography levels (#40230) @zanivan
|
|
32
|
+
- ​<!-- 07 -->[material-ui] Update the related projects page to list `mui-tiptap` for rich text (#40216) @sjdemartini
|
|
33
|
+
- ​<!-- 06 -->[material-ui] Fix typo in the Next.js integration page (#40209) @s8990
|
|
34
|
+
|
|
35
|
+
### Core
|
|
36
|
+
|
|
37
|
+
- ​<!-- 14 -->[blog] Fix access to Notion without an account @oliviertassinari
|
|
38
|
+
- ​<!-- 12 -->[core] Update workflows and issue templates to reflect the updated label (#40197) @MBilalShafi
|
|
39
|
+
- ​<!-- 11 -->[docs] Replace Twitter with X (#40193) @mbrookes
|
|
40
|
+
- ​<!-- 10 -->[docs-infra] Uplift the Algolia search modal design (#40186) @danilo-leal
|
|
41
|
+
- ​<!-- 01 -->[website] Update product descriptions and social preview images (#32181) @danilo-leal
|
|
42
|
+
|
|
43
|
+
All contributors of this release in alphabetical order: @danilo-leal, @gitstart, @MBilalShafi, @mbrookes, @mnajdova, @oliviertassinari, @possibilities, @pratikkarad, @qiweiii, @ReaZzy, @s8990, @sai6855, @sjdemartini, @zanivan, @ZeeshanTamboli
|
|
44
|
+
|
|
3
45
|
## 5.15.0
|
|
4
46
|
|
|
5
47
|
<!-- generated comparing v5.14.20..master -->
|
|
@@ -142,6 +142,14 @@ export interface TablePaginationOwnProps extends TablePaginationBaseProps {
|
|
|
142
142
|
actions?: TablePaginationActionsProps['slotProps'];
|
|
143
143
|
select?: Partial<SelectProps>;
|
|
144
144
|
};
|
|
145
|
+
/**
|
|
146
|
+
* The components used for each slot inside the TablePagination.
|
|
147
|
+
* Either a string to use a HTML element or a component.
|
|
148
|
+
* @default {}
|
|
149
|
+
*/
|
|
150
|
+
slots?: {
|
|
151
|
+
actions?: TablePaginationActionsProps['slots'];
|
|
152
|
+
};
|
|
145
153
|
/**
|
|
146
154
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
147
155
|
*/
|
|
@@ -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", "disabled", "getItemAriaLabel", "labelDisplayedRows", "labelRowsPerPage", "nextIconButtonProps", "onPageChange", "onRowsPerPageChange", "page", "rowsPerPage", "rowsPerPageOptions", "SelectProps", "showFirstButton", "showLastButton", "slotProps"];
|
|
6
|
+
const _excluded = ["ActionsComponent", "backIconButtonProps", "className", "colSpan", "component", "count", "disabled", "getItemAriaLabel", "labelDisplayedRows", "labelRowsPerPage", "nextIconButtonProps", "onPageChange", "onRowsPerPageChange", "page", "rowsPerPage", "rowsPerPageOptions", "SelectProps", "showFirstButton", "showLastButton", "slotProps", "slots"];
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import clsx from 'clsx';
|
|
@@ -168,7 +168,8 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
|
|
|
168
168
|
SelectProps = {},
|
|
169
169
|
showFirstButton = false,
|
|
170
170
|
showLastButton = false,
|
|
171
|
-
slotProps
|
|
171
|
+
slotProps = {},
|
|
172
|
+
slots = {}
|
|
172
173
|
} = props,
|
|
173
174
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
174
175
|
const ownerState = props;
|
|
@@ -245,7 +246,8 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
|
|
|
245
246
|
rowsPerPage: rowsPerPage,
|
|
246
247
|
showFirstButton: showFirstButton,
|
|
247
248
|
showLastButton: showLastButton,
|
|
248
|
-
slotProps: slotProps
|
|
249
|
+
slotProps: slotProps.actions,
|
|
250
|
+
slots: slots.actions,
|
|
249
251
|
getItemAriaLabel: getItemAriaLabel,
|
|
250
252
|
disabled: disabled
|
|
251
253
|
})]
|
|
@@ -407,12 +409,33 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
|
|
|
407
409
|
slotProps: PropTypes.shape({
|
|
408
410
|
actions: PropTypes.shape({
|
|
409
411
|
firstButton: PropTypes.object,
|
|
412
|
+
firstButtonIcon: PropTypes.object,
|
|
410
413
|
lastButton: PropTypes.object,
|
|
414
|
+
lastButtonIcon: PropTypes.object,
|
|
411
415
|
nextButton: PropTypes.object,
|
|
412
|
-
|
|
416
|
+
nextButtonIcon: PropTypes.object,
|
|
417
|
+
previousButton: PropTypes.object,
|
|
418
|
+
previousButtonIcon: PropTypes.object
|
|
413
419
|
}),
|
|
414
420
|
select: PropTypes.object
|
|
415
421
|
}),
|
|
422
|
+
/**
|
|
423
|
+
* The components used for each slot inside the TablePagination.
|
|
424
|
+
* Either a string to use a HTML element or a component.
|
|
425
|
+
* @default {}
|
|
426
|
+
*/
|
|
427
|
+
slots: PropTypes.shape({
|
|
428
|
+
actions: PropTypes.shape({
|
|
429
|
+
firstButton: PropTypes.elementType,
|
|
430
|
+
firstButtonIcon: PropTypes.elementType,
|
|
431
|
+
lastButton: PropTypes.elementType,
|
|
432
|
+
lastButtonIcon: PropTypes.elementType,
|
|
433
|
+
nextButton: PropTypes.elementType,
|
|
434
|
+
nextButtonIcon: PropTypes.elementType,
|
|
435
|
+
previousButton: PropTypes.elementType,
|
|
436
|
+
previousButtonIcon: PropTypes.elementType
|
|
437
|
+
})
|
|
438
|
+
}),
|
|
416
439
|
/**
|
|
417
440
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
418
441
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { IconButtonProps } from '../IconButton/IconButton';
|
|
3
|
+
import { SvgIconProps } from '../SvgIcon';
|
|
3
4
|
|
|
4
5
|
export interface TablePaginationActionsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
6
|
/**
|
|
@@ -41,7 +42,55 @@ export interface TablePaginationActionsProps extends React.HTMLAttributes<HTMLDi
|
|
|
41
42
|
lastButton?: Partial<IconButtonProps>;
|
|
42
43
|
nextButton?: Partial<IconButtonProps>;
|
|
43
44
|
previousButton?: Partial<IconButtonProps>;
|
|
45
|
+
firstButtonIcon?: Partial<SvgIconProps>;
|
|
46
|
+
lastButtonIcon?: Partial<SvgIconProps>;
|
|
47
|
+
nextButtonIcon?: Partial<SvgIconProps>;
|
|
48
|
+
previousButtonIcon?: Partial<SvgIconProps>;
|
|
44
49
|
};
|
|
50
|
+
slots?: TablePaginationActionsSlots;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface TablePaginationActionsSlots {
|
|
54
|
+
/**
|
|
55
|
+
* The component that renders the first button.
|
|
56
|
+
* @default IconButton
|
|
57
|
+
*/
|
|
58
|
+
firstButton?: React.ElementType;
|
|
59
|
+
/**
|
|
60
|
+
* The component that renders the last button.
|
|
61
|
+
* @default IconButton
|
|
62
|
+
*/
|
|
63
|
+
lastButton?: React.ElementType;
|
|
64
|
+
/**
|
|
65
|
+
* The component that renders the next button.
|
|
66
|
+
* @default IconButton
|
|
67
|
+
*/
|
|
68
|
+
nextButton?: React.ElementType;
|
|
69
|
+
/**
|
|
70
|
+
* The component that renders the previous button.
|
|
71
|
+
* @default IconButton
|
|
72
|
+
*/
|
|
73
|
+
previousButton?: React.ElementType;
|
|
74
|
+
/**
|
|
75
|
+
* The component that renders the first button icon.
|
|
76
|
+
* @default FirstPageIcon
|
|
77
|
+
*/
|
|
78
|
+
firstButtonIcon?: React.ElementType;
|
|
79
|
+
/**
|
|
80
|
+
* The component that renders the last button icon.
|
|
81
|
+
* @default LastPageIcon
|
|
82
|
+
*/
|
|
83
|
+
lastButtonIcon?: React.ElementType;
|
|
84
|
+
/**
|
|
85
|
+
* The component that renders the next button icon.
|
|
86
|
+
* @default KeyboardArrowRight
|
|
87
|
+
*/
|
|
88
|
+
nextButtonIcon?: React.ElementType;
|
|
89
|
+
/**
|
|
90
|
+
* The component that renders the previous button icon.
|
|
91
|
+
* @default KeyboardArrowLeft
|
|
92
|
+
*/
|
|
93
|
+
previousButtonIcon?: React.ElementType;
|
|
45
94
|
}
|
|
46
95
|
|
|
47
96
|
declare const TablePaginationActions: React.JSXElementConstructor<TablePaginationActionsProps>;
|
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
|
|
6
|
-
const _excluded = ["backIconButtonProps", "count", "disabled", "getItemAriaLabel", "nextIconButtonProps", "onPageChange", "page", "rowsPerPage", "showFirstButton", "showLastButton", "slotProps"];
|
|
5
|
+
const _excluded = ["backIconButtonProps", "count", "disabled", "getItemAriaLabel", "nextIconButtonProps", "onPageChange", "page", "rowsPerPage", "showFirstButton", "showLastButton", "slots", "slotProps"];
|
|
7
6
|
import * as React from 'react';
|
|
8
7
|
import PropTypes from 'prop-types';
|
|
9
8
|
import KeyboardArrowLeft from '../internal/svg-icons/KeyboardArrowLeft';
|
|
10
9
|
import KeyboardArrowRight from '../internal/svg-icons/KeyboardArrowRight';
|
|
11
10
|
import useTheme from '../styles/useTheme';
|
|
12
11
|
import IconButton from '../IconButton';
|
|
13
|
-
import
|
|
14
|
-
import
|
|
12
|
+
import LastPageIconDefault from '../internal/svg-icons/LastPage';
|
|
13
|
+
import FirstPageIconDefault from '../internal/svg-icons/FirstPage';
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
16
|
* @ignore - internal component.
|
|
@@ -19,7 +18,7 @@ import FirstPageIcon from '../internal/svg-icons/FirstPage';
|
|
|
19
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
20
|
const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePaginationActions(props, ref) {
|
|
22
|
-
var
|
|
21
|
+
var _slots$firstButton, _slots$lastButton, _slots$nextButton, _slots$previousButton, _slots$firstButtonIco, _slots$lastButtonIcon, _slots$nextButtonIcon, _slots$previousButton2;
|
|
23
22
|
const {
|
|
24
23
|
backIconButtonProps,
|
|
25
24
|
count,
|
|
@@ -31,7 +30,8 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
31
30
|
rowsPerPage,
|
|
32
31
|
showFirstButton,
|
|
33
32
|
showLastButton,
|
|
34
|
-
|
|
33
|
+
slots = {},
|
|
34
|
+
slotProps = {}
|
|
35
35
|
} = props,
|
|
36
36
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
37
37
|
const theme = useTheme();
|
|
@@ -47,39 +47,55 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
47
47
|
const handleLastPageButtonClick = event => {
|
|
48
48
|
onPageChange(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));
|
|
49
49
|
};
|
|
50
|
+
const FirstButton = (_slots$firstButton = slots.firstButton) != null ? _slots$firstButton : IconButton;
|
|
51
|
+
const LastButton = (_slots$lastButton = slots.lastButton) != null ? _slots$lastButton : IconButton;
|
|
52
|
+
const NextButton = (_slots$nextButton = slots.nextButton) != null ? _slots$nextButton : IconButton;
|
|
53
|
+
const PreviousButton = (_slots$previousButton = slots.previousButton) != null ? _slots$previousButton : IconButton;
|
|
54
|
+
const FirstButtonIcon = (_slots$firstButtonIco = slots.firstButtonIcon) != null ? _slots$firstButtonIco : FirstPageIconDefault;
|
|
55
|
+
const LastButtonIcon = (_slots$lastButtonIcon = slots.lastButtonIcon) != null ? _slots$lastButtonIcon : LastPageIconDefault;
|
|
56
|
+
const NextButtonIcon = (_slots$nextButtonIcon = slots.nextButtonIcon) != null ? _slots$nextButtonIcon : KeyboardArrowRight;
|
|
57
|
+
const PreviousButtonIcon = (_slots$previousButton2 = slots.previousButtonIcon) != null ? _slots$previousButton2 : KeyboardArrowLeft;
|
|
58
|
+
const FirstButtonSlot = theme.direction === 'rtl' ? LastButton : FirstButton;
|
|
59
|
+
const PreviousButtonSlot = theme.direction === 'rtl' ? NextButton : PreviousButton;
|
|
60
|
+
const NextButtonSlot = theme.direction === 'rtl' ? PreviousButton : NextButton;
|
|
61
|
+
const LastButtonSlot = theme.direction === 'rtl' ? FirstButton : LastButton;
|
|
62
|
+
const firstButtonSlotProps = theme.direction === 'rtl' ? slotProps.lastButton : slotProps.firstButton;
|
|
63
|
+
const previousButtonSlotProps = theme.direction === 'rtl' ? slotProps.nextButton : slotProps.previousButton;
|
|
64
|
+
const nextButtonSlotProps = theme.direction === 'rtl' ? slotProps.previousButton : slotProps.nextButton;
|
|
65
|
+
const lastButtonSlotProps = theme.direction === 'rtl' ? slotProps.firstButton : slotProps.lastButton;
|
|
50
66
|
return /*#__PURE__*/_jsxs("div", _extends({
|
|
51
67
|
ref: ref
|
|
52
68
|
}, other, {
|
|
53
|
-
children: [showFirstButton && /*#__PURE__*/_jsx(
|
|
69
|
+
children: [showFirstButton && /*#__PURE__*/_jsx(FirstButtonSlot, _extends({
|
|
54
70
|
onClick: handleFirstPageButtonClick,
|
|
55
71
|
disabled: disabled || page === 0,
|
|
56
72
|
"aria-label": getItemAriaLabel('first', page),
|
|
57
73
|
title: getItemAriaLabel('first', page)
|
|
58
|
-
},
|
|
59
|
-
children: theme.direction === 'rtl' ?
|
|
60
|
-
})), /*#__PURE__*/_jsx(
|
|
74
|
+
}, firstButtonSlotProps, {
|
|
75
|
+
children: theme.direction === 'rtl' ? /*#__PURE__*/_jsx(LastButtonIcon, _extends({}, slotProps.lastButtonIcon)) : /*#__PURE__*/_jsx(FirstButtonIcon, _extends({}, slotProps.firstButtonIcon))
|
|
76
|
+
})), /*#__PURE__*/_jsx(PreviousButtonSlot, _extends({
|
|
61
77
|
onClick: handleBackButtonClick,
|
|
62
78
|
disabled: disabled || page === 0,
|
|
63
79
|
color: "inherit",
|
|
64
80
|
"aria-label": getItemAriaLabel('previous', page),
|
|
65
81
|
title: getItemAriaLabel('previous', page)
|
|
66
|
-
},
|
|
67
|
-
children: theme.direction === 'rtl' ?
|
|
68
|
-
})), /*#__PURE__*/_jsx(
|
|
82
|
+
}, previousButtonSlotProps != null ? previousButtonSlotProps : backIconButtonProps, {
|
|
83
|
+
children: theme.direction === 'rtl' ? /*#__PURE__*/_jsx(NextButtonIcon, _extends({}, slotProps.nextButtonIcon)) : /*#__PURE__*/_jsx(PreviousButtonIcon, _extends({}, slotProps.previousButtonIcon))
|
|
84
|
+
})), /*#__PURE__*/_jsx(NextButtonSlot, _extends({
|
|
69
85
|
onClick: handleNextButtonClick,
|
|
70
86
|
disabled: disabled || (count !== -1 ? page >= Math.ceil(count / rowsPerPage) - 1 : false),
|
|
71
87
|
color: "inherit",
|
|
72
88
|
"aria-label": getItemAriaLabel('next', page),
|
|
73
89
|
title: getItemAriaLabel('next', page)
|
|
74
|
-
},
|
|
75
|
-
children: theme.direction === 'rtl' ?
|
|
76
|
-
})), showLastButton && /*#__PURE__*/_jsx(
|
|
90
|
+
}, nextButtonSlotProps != null ? nextButtonSlotProps : nextIconButtonProps, {
|
|
91
|
+
children: theme.direction === 'rtl' ? /*#__PURE__*/_jsx(PreviousButtonIcon, _extends({}, slotProps.previousButtonIcon)) : /*#__PURE__*/_jsx(NextButtonIcon, _extends({}, slotProps.nextButtonIcon))
|
|
92
|
+
})), showLastButton && /*#__PURE__*/_jsx(LastButtonSlot, _extends({
|
|
77
93
|
onClick: handleLastPageButtonClick,
|
|
78
94
|
disabled: disabled || page >= Math.ceil(count / rowsPerPage) - 1,
|
|
79
95
|
"aria-label": getItemAriaLabel('last', page),
|
|
80
96
|
title: getItemAriaLabel('last', page)
|
|
81
|
-
},
|
|
82
|
-
children: theme.direction === 'rtl' ?
|
|
97
|
+
}, lastButtonSlotProps, {
|
|
98
|
+
children: theme.direction === 'rtl' ? /*#__PURE__*/_jsx(FirstButtonIcon, _extends({}, slotProps.firstButtonIcon)) : /*#__PURE__*/_jsx(LastButtonIcon, _extends({}, slotProps.lastButtonIcon))
|
|
83
99
|
}))]
|
|
84
100
|
}));
|
|
85
101
|
});
|
|
@@ -140,9 +156,28 @@ process.env.NODE_ENV !== "production" ? TablePaginationActions.propTypes = {
|
|
|
140
156
|
*/
|
|
141
157
|
slotProps: PropTypes.shape({
|
|
142
158
|
firstButton: PropTypes.object,
|
|
159
|
+
firstButtonIcon: PropTypes.object,
|
|
143
160
|
lastButton: PropTypes.object,
|
|
161
|
+
lastButtonIcon: PropTypes.object,
|
|
144
162
|
nextButton: PropTypes.object,
|
|
145
|
-
|
|
163
|
+
nextButtonIcon: PropTypes.object,
|
|
164
|
+
previousButton: PropTypes.object,
|
|
165
|
+
previousButtonIcon: PropTypes.object
|
|
166
|
+
}),
|
|
167
|
+
/**
|
|
168
|
+
* The components used for each slot inside the TablePaginationActions.
|
|
169
|
+
* Either a string to use a HTML element or a component.
|
|
170
|
+
* @default {}
|
|
171
|
+
*/
|
|
172
|
+
slots: PropTypes.shape({
|
|
173
|
+
firstButton: PropTypes.elementType,
|
|
174
|
+
firstButtonIcon: PropTypes.elementType,
|
|
175
|
+
lastButton: PropTypes.elementType,
|
|
176
|
+
lastButtonIcon: PropTypes.elementType,
|
|
177
|
+
nextButton: PropTypes.elementType,
|
|
178
|
+
nextButtonIcon: PropTypes.elementType,
|
|
179
|
+
previousButton: PropTypes.elementType,
|
|
180
|
+
previousButtonIcon: PropTypes.elementType
|
|
146
181
|
})
|
|
147
182
|
} : void 0;
|
|
148
183
|
export default TablePaginationActions;
|
package/index.js
CHANGED
|
@@ -671,7 +671,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
671
671
|
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
672
672
|
// ----------------------------------------------------------------------
|
|
673
673
|
/**
|
|
674
|
-
* If `true`, the portion of the selected suggestion that
|
|
674
|
+
* If `true`, the portion of the selected suggestion that the user hasn't typed,
|
|
675
675
|
* known as the completion string, appears inline after the input cursor in the textbox.
|
|
676
676
|
* The inline completion string is visually highlighted and has a selected state.
|
|
677
677
|
* @default false
|
|
@@ -687,7 +687,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
687
687
|
* when the Autocomplete loses focus unless the user chooses
|
|
688
688
|
* a different option or changes the character string in the input.
|
|
689
689
|
*
|
|
690
|
-
* When using `freeSolo` mode, the typed value will be the input value
|
|
690
|
+
* When using the `freeSolo` mode, the typed value will be the input value
|
|
691
691
|
* if the Autocomplete loses focus without highlighting an option.
|
|
692
692
|
* @default false
|
|
693
693
|
*/
|
|
@@ -722,8 +722,8 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
722
722
|
/**
|
|
723
723
|
* If `true`, the input's text is cleared on blur if no value is selected.
|
|
724
724
|
*
|
|
725
|
-
* Set to `true` if you want to help the user enter a new value.
|
|
726
|
-
* Set to `false` if you want to help the user resume their search.
|
|
725
|
+
* Set it to `true` if you want to help the user enter a new value.
|
|
726
|
+
* Set it to `false` if you want to help the user resume their search.
|
|
727
727
|
* @default !props.freeSolo
|
|
728
728
|
*/
|
|
729
729
|
clearOnBlur: PropTypes.bool,
|
|
@@ -183,8 +183,11 @@ var TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(inP
|
|
|
183
183
|
showFirstButton = _props$showFirstButto === void 0 ? false : _props$showFirstButto,
|
|
184
184
|
_props$showLastButton = props.showLastButton,
|
|
185
185
|
showLastButton = _props$showLastButton === void 0 ? false : _props$showLastButton,
|
|
186
|
-
slotProps = props.slotProps,
|
|
187
|
-
|
|
186
|
+
_props$slotProps = props.slotProps,
|
|
187
|
+
slotProps = _props$slotProps === void 0 ? {} : _props$slotProps,
|
|
188
|
+
_props$slots = props.slots,
|
|
189
|
+
slots = _props$slots === void 0 ? {} : _props$slots,
|
|
190
|
+
other = _objectWithoutProperties(props, ["ActionsComponent", "backIconButtonProps", "className", "colSpan", "component", "count", "disabled", "getItemAriaLabel", "labelDisplayedRows", "labelRowsPerPage", "nextIconButtonProps", "onPageChange", "onRowsPerPageChange", "page", "rowsPerPage", "rowsPerPageOptions", "SelectProps", "showFirstButton", "showLastButton", "slotProps", "slots"]);
|
|
188
191
|
var ownerState = props;
|
|
189
192
|
var classes = useUtilityClasses(ownerState);
|
|
190
193
|
var selectProps = (_slotProps$select = slotProps == null ? void 0 : slotProps.select) != null ? _slotProps$select : SelectProps;
|
|
@@ -261,7 +264,8 @@ var TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(inP
|
|
|
261
264
|
rowsPerPage: rowsPerPage,
|
|
262
265
|
showFirstButton: showFirstButton,
|
|
263
266
|
showLastButton: showLastButton,
|
|
264
|
-
slotProps: slotProps
|
|
267
|
+
slotProps: slotProps.actions,
|
|
268
|
+
slots: slots.actions,
|
|
265
269
|
getItemAriaLabel: getItemAriaLabel,
|
|
266
270
|
disabled: disabled
|
|
267
271
|
})]
|
|
@@ -421,12 +425,33 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
|
|
|
421
425
|
slotProps: PropTypes.shape({
|
|
422
426
|
actions: PropTypes.shape({
|
|
423
427
|
firstButton: PropTypes.object,
|
|
428
|
+
firstButtonIcon: PropTypes.object,
|
|
424
429
|
lastButton: PropTypes.object,
|
|
430
|
+
lastButtonIcon: PropTypes.object,
|
|
425
431
|
nextButton: PropTypes.object,
|
|
426
|
-
|
|
432
|
+
nextButtonIcon: PropTypes.object,
|
|
433
|
+
previousButton: PropTypes.object,
|
|
434
|
+
previousButtonIcon: PropTypes.object
|
|
427
435
|
}),
|
|
428
436
|
select: PropTypes.object
|
|
429
437
|
}),
|
|
438
|
+
/**
|
|
439
|
+
* The components used for each slot inside the TablePagination.
|
|
440
|
+
* Either a string to use a HTML element or a component.
|
|
441
|
+
* @default {}
|
|
442
|
+
*/
|
|
443
|
+
slots: PropTypes.shape({
|
|
444
|
+
actions: PropTypes.shape({
|
|
445
|
+
firstButton: PropTypes.elementType,
|
|
446
|
+
firstButtonIcon: PropTypes.elementType,
|
|
447
|
+
lastButton: PropTypes.elementType,
|
|
448
|
+
lastButtonIcon: PropTypes.elementType,
|
|
449
|
+
nextButton: PropTypes.elementType,
|
|
450
|
+
nextButtonIcon: PropTypes.elementType,
|
|
451
|
+
previousButton: PropTypes.elementType,
|
|
452
|
+
previousButtonIcon: PropTypes.elementType
|
|
453
|
+
})
|
|
454
|
+
}),
|
|
430
455
|
/**
|
|
431
456
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
432
457
|
*/
|
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
var _LastPageIcon, _FirstPageIcon, _KeyboardArrowRight, _KeyboardArrowLeft, _KeyboardArrowLeft2, _KeyboardArrowRight2, _FirstPageIcon2, _LastPageIcon2;
|
|
6
5
|
import * as React from 'react';
|
|
7
6
|
import PropTypes from 'prop-types';
|
|
8
7
|
import KeyboardArrowLeft from '../internal/svg-icons/KeyboardArrowLeft';
|
|
9
8
|
import KeyboardArrowRight from '../internal/svg-icons/KeyboardArrowRight';
|
|
10
9
|
import useTheme from '../styles/useTheme';
|
|
11
10
|
import IconButton from '../IconButton';
|
|
12
|
-
import
|
|
13
|
-
import
|
|
11
|
+
import LastPageIconDefault from '../internal/svg-icons/LastPage';
|
|
12
|
+
import FirstPageIconDefault from '../internal/svg-icons/FirstPage';
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* @ignore - internal component.
|
|
@@ -18,7 +17,7 @@ import FirstPageIcon from '../internal/svg-icons/FirstPage';
|
|
|
18
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
19
|
var TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePaginationActions(props, ref) {
|
|
21
|
-
var
|
|
20
|
+
var _slots$firstButton, _slots$lastButton, _slots$nextButton, _slots$previousButton, _slots$firstButtonIco, _slots$lastButtonIcon, _slots$nextButtonIcon, _slots$previousButton2;
|
|
22
21
|
var backIconButtonProps = props.backIconButtonProps,
|
|
23
22
|
count = props.count,
|
|
24
23
|
_props$disabled = props.disabled,
|
|
@@ -30,8 +29,11 @@ var TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePaginat
|
|
|
30
29
|
rowsPerPage = props.rowsPerPage,
|
|
31
30
|
showFirstButton = props.showFirstButton,
|
|
32
31
|
showLastButton = props.showLastButton,
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
_props$slots = props.slots,
|
|
33
|
+
slots = _props$slots === void 0 ? {} : _props$slots,
|
|
34
|
+
_props$slotProps = props.slotProps,
|
|
35
|
+
slotProps = _props$slotProps === void 0 ? {} : _props$slotProps,
|
|
36
|
+
other = _objectWithoutProperties(props, ["backIconButtonProps", "count", "disabled", "getItemAriaLabel", "nextIconButtonProps", "onPageChange", "page", "rowsPerPage", "showFirstButton", "showLastButton", "slots", "slotProps"]);
|
|
35
37
|
var theme = useTheme();
|
|
36
38
|
var handleFirstPageButtonClick = function handleFirstPageButtonClick(event) {
|
|
37
39
|
onPageChange(event, 0);
|
|
@@ -45,39 +47,55 @@ var TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePaginat
|
|
|
45
47
|
var handleLastPageButtonClick = function handleLastPageButtonClick(event) {
|
|
46
48
|
onPageChange(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));
|
|
47
49
|
};
|
|
50
|
+
var FirstButton = (_slots$firstButton = slots.firstButton) != null ? _slots$firstButton : IconButton;
|
|
51
|
+
var LastButton = (_slots$lastButton = slots.lastButton) != null ? _slots$lastButton : IconButton;
|
|
52
|
+
var NextButton = (_slots$nextButton = slots.nextButton) != null ? _slots$nextButton : IconButton;
|
|
53
|
+
var PreviousButton = (_slots$previousButton = slots.previousButton) != null ? _slots$previousButton : IconButton;
|
|
54
|
+
var FirstButtonIcon = (_slots$firstButtonIco = slots.firstButtonIcon) != null ? _slots$firstButtonIco : FirstPageIconDefault;
|
|
55
|
+
var LastButtonIcon = (_slots$lastButtonIcon = slots.lastButtonIcon) != null ? _slots$lastButtonIcon : LastPageIconDefault;
|
|
56
|
+
var NextButtonIcon = (_slots$nextButtonIcon = slots.nextButtonIcon) != null ? _slots$nextButtonIcon : KeyboardArrowRight;
|
|
57
|
+
var PreviousButtonIcon = (_slots$previousButton2 = slots.previousButtonIcon) != null ? _slots$previousButton2 : KeyboardArrowLeft;
|
|
58
|
+
var FirstButtonSlot = theme.direction === 'rtl' ? LastButton : FirstButton;
|
|
59
|
+
var PreviousButtonSlot = theme.direction === 'rtl' ? NextButton : PreviousButton;
|
|
60
|
+
var NextButtonSlot = theme.direction === 'rtl' ? PreviousButton : NextButton;
|
|
61
|
+
var LastButtonSlot = theme.direction === 'rtl' ? FirstButton : LastButton;
|
|
62
|
+
var firstButtonSlotProps = theme.direction === 'rtl' ? slotProps.lastButton : slotProps.firstButton;
|
|
63
|
+
var previousButtonSlotProps = theme.direction === 'rtl' ? slotProps.nextButton : slotProps.previousButton;
|
|
64
|
+
var nextButtonSlotProps = theme.direction === 'rtl' ? slotProps.previousButton : slotProps.nextButton;
|
|
65
|
+
var lastButtonSlotProps = theme.direction === 'rtl' ? slotProps.firstButton : slotProps.lastButton;
|
|
48
66
|
return /*#__PURE__*/_jsxs("div", _extends({
|
|
49
67
|
ref: ref
|
|
50
68
|
}, other, {
|
|
51
|
-
children: [showFirstButton && /*#__PURE__*/_jsx(
|
|
69
|
+
children: [showFirstButton && /*#__PURE__*/_jsx(FirstButtonSlot, _extends({
|
|
52
70
|
onClick: handleFirstPageButtonClick,
|
|
53
71
|
disabled: disabled || page === 0,
|
|
54
72
|
"aria-label": getItemAriaLabel('first', page),
|
|
55
73
|
title: getItemAriaLabel('first', page)
|
|
56
|
-
},
|
|
57
|
-
children: theme.direction === 'rtl' ?
|
|
58
|
-
})), /*#__PURE__*/_jsx(
|
|
74
|
+
}, firstButtonSlotProps, {
|
|
75
|
+
children: theme.direction === 'rtl' ? /*#__PURE__*/_jsx(LastButtonIcon, _extends({}, slotProps.lastButtonIcon)) : /*#__PURE__*/_jsx(FirstButtonIcon, _extends({}, slotProps.firstButtonIcon))
|
|
76
|
+
})), /*#__PURE__*/_jsx(PreviousButtonSlot, _extends({
|
|
59
77
|
onClick: handleBackButtonClick,
|
|
60
78
|
disabled: disabled || page === 0,
|
|
61
79
|
color: "inherit",
|
|
62
80
|
"aria-label": getItemAriaLabel('previous', page),
|
|
63
81
|
title: getItemAriaLabel('previous', page)
|
|
64
|
-
},
|
|
65
|
-
children: theme.direction === 'rtl' ?
|
|
66
|
-
})), /*#__PURE__*/_jsx(
|
|
82
|
+
}, previousButtonSlotProps != null ? previousButtonSlotProps : backIconButtonProps, {
|
|
83
|
+
children: theme.direction === 'rtl' ? /*#__PURE__*/_jsx(NextButtonIcon, _extends({}, slotProps.nextButtonIcon)) : /*#__PURE__*/_jsx(PreviousButtonIcon, _extends({}, slotProps.previousButtonIcon))
|
|
84
|
+
})), /*#__PURE__*/_jsx(NextButtonSlot, _extends({
|
|
67
85
|
onClick: handleNextButtonClick,
|
|
68
86
|
disabled: disabled || (count !== -1 ? page >= Math.ceil(count / rowsPerPage) - 1 : false),
|
|
69
87
|
color: "inherit",
|
|
70
88
|
"aria-label": getItemAriaLabel('next', page),
|
|
71
89
|
title: getItemAriaLabel('next', page)
|
|
72
|
-
},
|
|
73
|
-
children: theme.direction === 'rtl' ?
|
|
74
|
-
})), showLastButton && /*#__PURE__*/_jsx(
|
|
90
|
+
}, nextButtonSlotProps != null ? nextButtonSlotProps : nextIconButtonProps, {
|
|
91
|
+
children: theme.direction === 'rtl' ? /*#__PURE__*/_jsx(PreviousButtonIcon, _extends({}, slotProps.previousButtonIcon)) : /*#__PURE__*/_jsx(NextButtonIcon, _extends({}, slotProps.nextButtonIcon))
|
|
92
|
+
})), showLastButton && /*#__PURE__*/_jsx(LastButtonSlot, _extends({
|
|
75
93
|
onClick: handleLastPageButtonClick,
|
|
76
94
|
disabled: disabled || page >= Math.ceil(count / rowsPerPage) - 1,
|
|
77
95
|
"aria-label": getItemAriaLabel('last', page),
|
|
78
96
|
title: getItemAriaLabel('last', page)
|
|
79
|
-
},
|
|
80
|
-
children: theme.direction === 'rtl' ?
|
|
97
|
+
}, lastButtonSlotProps, {
|
|
98
|
+
children: theme.direction === 'rtl' ? /*#__PURE__*/_jsx(FirstButtonIcon, _extends({}, slotProps.firstButtonIcon)) : /*#__PURE__*/_jsx(LastButtonIcon, _extends({}, slotProps.lastButtonIcon))
|
|
81
99
|
}))]
|
|
82
100
|
}));
|
|
83
101
|
});
|
|
@@ -138,9 +156,28 @@ process.env.NODE_ENV !== "production" ? TablePaginationActions.propTypes = {
|
|
|
138
156
|
*/
|
|
139
157
|
slotProps: PropTypes.shape({
|
|
140
158
|
firstButton: PropTypes.object,
|
|
159
|
+
firstButtonIcon: PropTypes.object,
|
|
141
160
|
lastButton: PropTypes.object,
|
|
161
|
+
lastButtonIcon: PropTypes.object,
|
|
142
162
|
nextButton: PropTypes.object,
|
|
143
|
-
|
|
163
|
+
nextButtonIcon: PropTypes.object,
|
|
164
|
+
previousButton: PropTypes.object,
|
|
165
|
+
previousButtonIcon: PropTypes.object
|
|
166
|
+
}),
|
|
167
|
+
/**
|
|
168
|
+
* The components used for each slot inside the TablePaginationActions.
|
|
169
|
+
* Either a string to use a HTML element or a component.
|
|
170
|
+
* @default {}
|
|
171
|
+
*/
|
|
172
|
+
slots: PropTypes.shape({
|
|
173
|
+
firstButton: PropTypes.elementType,
|
|
174
|
+
firstButtonIcon: PropTypes.elementType,
|
|
175
|
+
lastButton: PropTypes.elementType,
|
|
176
|
+
lastButtonIcon: PropTypes.elementType,
|
|
177
|
+
nextButton: PropTypes.elementType,
|
|
178
|
+
nextButtonIcon: PropTypes.elementType,
|
|
179
|
+
previousButton: PropTypes.elementType,
|
|
180
|
+
previousButtonIcon: PropTypes.elementType
|
|
144
181
|
})
|
|
145
182
|
} : void 0;
|
|
146
183
|
export default TablePaginationActions;
|
package/legacy/index.js
CHANGED