@mui/material 9.0.0-alpha.4 → 9.0.0-beta.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/Accordion/Accordion.d.mts +1 -1
- package/Accordion/Accordion.d.ts +1 -1
- package/AccordionSummary/AccordionSummary.js +1 -0
- package/AccordionSummary/AccordionSummary.mjs +1 -0
- package/Backdrop/Backdrop.d.mts +1 -1
- package/Backdrop/Backdrop.d.ts +1 -1
- package/BottomNavigationAction/BottomNavigationAction.js +1 -0
- package/BottomNavigationAction/BottomNavigationAction.mjs +1 -0
- package/Breadcrumbs/BreadcrumbCollapsed.js +5 -1
- package/Breadcrumbs/BreadcrumbCollapsed.mjs +5 -1
- package/Button/Button.js +1 -0
- package/Button/Button.mjs +1 -0
- package/ButtonBase/ButtonBase.d.mts +5 -0
- package/ButtonBase/ButtonBase.d.ts +5 -0
- package/ButtonBase/ButtonBase.js +84 -85
- package/ButtonBase/ButtonBase.mjs +84 -85
- package/ButtonBase/useButtonBase.d.mts +91 -0
- package/ButtonBase/useButtonBase.d.ts +91 -0
- package/ButtonBase/useButtonBase.js +174 -0
- package/ButtonBase/useButtonBase.mjs +167 -0
- package/ButtonGroup/ButtonGroup.js +1 -9
- package/ButtonGroup/ButtonGroup.mjs +1 -9
- package/ButtonGroup/buttonGroupClasses.d.mts +0 -68
- package/ButtonGroup/buttonGroupClasses.d.ts +0 -68
- package/ButtonGroup/buttonGroupClasses.js +1 -1
- package/ButtonGroup/buttonGroupClasses.mjs +1 -1
- package/CHANGELOG.md +119 -4
- package/CardActionArea/CardActionArea.js +1 -0
- package/CardActionArea/CardActionArea.mjs +1 -0
- package/CardHeader/CardHeader.d.mts +13 -21
- package/CardHeader/CardHeader.d.ts +13 -21
- package/CardHeader/CardHeader.js +3 -21
- package/CardHeader/CardHeader.mjs +3 -21
- package/Checkbox/Checkbox.js +1 -7
- package/Checkbox/Checkbox.mjs +1 -7
- package/Chip/Chip.d.mts +7 -0
- package/Chip/Chip.d.ts +7 -0
- package/Chip/Chip.js +66 -55
- package/Chip/Chip.mjs +66 -55
- package/Chip/chipClasses.d.mts +0 -104
- package/Chip/chipClasses.d.ts +0 -104
- package/Chip/chipClasses.js +1 -1
- package/Chip/chipClasses.mjs +1 -1
- package/Dialog/Dialog.d.mts +8 -22
- package/Dialog/Dialog.d.ts +8 -22
- package/Dialog/Dialog.js +43 -72
- package/Dialog/Dialog.mjs +43 -72
- package/Dialog/dialogClasses.d.mts +0 -8
- package/Dialog/dialogClasses.d.ts +0 -8
- package/Dialog/dialogClasses.js +1 -1
- package/Dialog/dialogClasses.mjs +1 -1
- package/Divider/Divider.js +2 -10
- package/Divider/Divider.mjs +2 -10
- package/Divider/dividerClasses.d.mts +0 -4
- package/Divider/dividerClasses.d.ts +0 -4
- package/Divider/dividerClasses.js +1 -1
- package/Divider/dividerClasses.mjs +1 -1
- package/Drawer/Drawer.d.mts +1 -13
- package/Drawer/Drawer.d.ts +1 -13
- package/Drawer/Drawer.js +6 -40
- package/Drawer/Drawer.mjs +6 -40
- package/Drawer/drawerClasses.d.mts +0 -32
- package/Drawer/drawerClasses.d.ts +0 -32
- package/Drawer/drawerClasses.js +1 -1
- package/Drawer/drawerClasses.mjs +1 -1
- package/Fab/Fab.js +1 -0
- package/Fab/Fab.mjs +1 -0
- package/FilledInput/FilledInput.js +4 -33
- package/FilledInput/FilledInput.mjs +4 -33
- package/Grid/Grid.d.mts +8 -3
- package/Grid/Grid.d.ts +8 -3
- package/Grid/Grid.js +8 -3
- package/Grid/Grid.mjs +8 -3
- package/Grid/gridClasses.js +1 -1
- package/Grid/gridClasses.mjs +1 -1
- package/IconButton/IconButton.js +1 -0
- package/IconButton/IconButton.mjs +1 -0
- package/ImageListItemBar/ImageListItemBar.js +4 -17
- package/ImageListItemBar/ImageListItemBar.mjs +4 -17
- package/ImageListItemBar/imageListItemBarClasses.d.mts +0 -16
- package/ImageListItemBar/imageListItemBarClasses.d.ts +0 -16
- package/ImageListItemBar/imageListItemBarClasses.js +1 -1
- package/ImageListItemBar/imageListItemBarClasses.mjs +1 -1
- package/Input/Input.js +4 -33
- package/Input/Input.mjs +4 -33
- package/Input/inputClasses.d.mts +0 -16
- package/Input/inputClasses.d.ts +0 -16
- package/InputAdornment/inputAdornmentClasses.d.mts +2 -2
- package/InputAdornment/inputAdornmentClasses.d.ts +2 -2
- package/InputBase/InputBase.d.mts +0 -27
- package/InputBase/InputBase.d.ts +0 -27
- package/InputBase/InputBase.js +6 -35
- package/InputBase/InputBase.mjs +6 -35
- package/InputBase/inputBaseClasses.d.mts +0 -20
- package/InputBase/inputBaseClasses.d.ts +0 -20
- package/InputBase/inputBaseClasses.js +1 -1
- package/InputBase/inputBaseClasses.mjs +1 -1
- package/InputLabel/InputLabel.js +1 -1
- package/InputLabel/InputLabel.mjs +1 -1
- package/LinearProgress/LinearProgress.js +6 -18
- package/LinearProgress/LinearProgress.mjs +6 -18
- package/LinearProgress/linearProgressClasses.d.mts +0 -36
- package/LinearProgress/linearProgressClasses.d.ts +0 -36
- package/LinearProgress/linearProgressClasses.js +1 -1
- package/LinearProgress/linearProgressClasses.mjs +1 -1
- package/Link/Link.d.mts +1 -1
- package/Link/Link.d.ts +1 -1
- package/ListItem/ListItem.d.mts +2 -36
- package/ListItem/ListItem.d.ts +2 -36
- package/ListItem/ListItem.js +27 -152
- package/ListItem/ListItem.mjs +27 -152
- package/ListItem/listItemClasses.d.mts +2 -4
- package/ListItem/listItemClasses.d.ts +2 -4
- package/ListItem/listItemClasses.js +1 -1
- package/ListItem/listItemClasses.mjs +1 -1
- package/ListItemButton/ListItemButton.d.mts +1 -2
- package/ListItemButton/ListItemButton.d.ts +1 -2
- package/ListItemButton/ListItemButton.js +2 -2
- package/ListItemButton/ListItemButton.mjs +2 -2
- package/ListItemIcon/ListItemIcon.js +1 -1
- package/ListItemIcon/ListItemIcon.mjs +1 -1
- package/ListItemSecondaryAction/ListItemSecondaryAction.d.mts +10 -6
- package/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +10 -6
- package/ListItemSecondaryAction/ListItemSecondaryAction.js +7 -2
- package/ListItemSecondaryAction/ListItemSecondaryAction.mjs +7 -2
- package/ListItemText/ListItemText.d.mts +12 -20
- package/ListItemText/ListItemText.d.ts +12 -20
- package/ListItemText/ListItemText.js +2 -20
- package/ListItemText/ListItemText.mjs +2 -20
- package/ListSubheader/ListSubheader.js +0 -3
- package/ListSubheader/ListSubheader.mjs +0 -3
- package/Menu/Menu.d.mts +1 -1
- package/Menu/Menu.d.ts +1 -1
- package/Menu/Menu.js +15 -32
- package/Menu/Menu.mjs +15 -32
- package/MenuItem/MenuItem.js +36 -26
- package/MenuItem/MenuItem.mjs +34 -26
- package/MenuList/MenuList.js +136 -101
- package/MenuList/MenuList.mjs +135 -100
- package/MenuList/MenuListContext.d.mts +11 -0
- package/MenuList/MenuListContext.d.ts +11 -0
- package/MenuList/MenuListContext.js +25 -0
- package/MenuList/MenuListContext.mjs +19 -0
- package/Modal/Modal.d.mts +1 -41
- package/Modal/Modal.d.ts +1 -41
- package/Modal/Modal.js +5 -58
- package/Modal/Modal.mjs +5 -58
- package/OutlinedInput/OutlinedInput.js +2 -14
- package/OutlinedInput/OutlinedInput.mjs +2 -14
- package/OutlinedInput/outlinedInputClasses.d.mts +0 -16
- package/OutlinedInput/outlinedInputClasses.d.ts +0 -16
- package/PaginationItem/PaginationItem.d.mts +5 -15
- package/PaginationItem/PaginationItem.d.ts +5 -15
- package/PaginationItem/PaginationItem.js +9 -24
- package/PaginationItem/PaginationItem.mjs +9 -24
- package/PaginationItem/paginationItemClasses.d.mts +0 -16
- package/PaginationItem/paginationItemClasses.d.ts +0 -16
- package/PaginationItem/paginationItemClasses.js +1 -1
- package/PaginationItem/paginationItemClasses.mjs +1 -1
- package/PigmentGrid/PigmentGrid.d.mts +1 -1
- package/PigmentGrid/PigmentGrid.d.ts +1 -1
- package/PigmentGrid/PigmentGrid.js +1 -1
- package/PigmentGrid/PigmentGrid.mjs +1 -1
- package/Popover/Popover.d.mts +1 -1
- package/Popover/Popover.d.ts +1 -1
- package/Popover/Popover.js +19 -7
- package/Popover/Popover.mjs +18 -6
- package/Radio/Radio.js +1 -13
- package/Radio/Radio.mjs +1 -13
- package/Rating/Rating.d.mts +0 -9
- package/Rating/Rating.d.ts +0 -9
- package/Rating/Rating.js +1 -17
- package/Rating/Rating.mjs +1 -17
- package/Select/SelectInput.js +2 -3
- package/Select/SelectInput.mjs +2 -3
- package/Select/selectClasses.d.mts +0 -12
- package/Select/selectClasses.d.ts +0 -12
- package/Select/selectClasses.js +1 -1
- package/Select/selectClasses.mjs +1 -1
- package/Slider/Slider.d.mts +0 -5
- package/Slider/Slider.d.ts +0 -5
- package/Slider/Slider.js +2 -8
- package/Slider/Slider.mjs +2 -8
- package/Slider/sliderClasses.d.mts +0 -28
- package/Slider/sliderClasses.d.ts +0 -28
- package/Slider/sliderClasses.js +1 -1
- package/Slider/sliderClasses.mjs +1 -1
- package/Snackbar/Snackbar.d.mts +1 -1
- package/Snackbar/Snackbar.d.ts +1 -1
- package/SpeedDial/SpeedDial.d.mts +1 -1
- package/SpeedDial/SpeedDial.d.ts +1 -1
- package/Stack/Stack.d.mts +2 -2
- package/Stack/Stack.d.ts +2 -2
- package/StepButton/StepButton.js +44 -14
- package/StepButton/StepButton.mjs +44 -14
- package/StepConnector/StepConnector.js +2 -8
- package/StepConnector/StepConnector.mjs +2 -8
- package/StepConnector/stepConnectorClasses.d.mts +0 -8
- package/StepConnector/stepConnectorClasses.d.ts +0 -8
- package/StepConnector/stepConnectorClasses.js +1 -1
- package/StepConnector/stepConnectorClasses.mjs +1 -1
- package/StepContent/StepContent.d.mts +2 -17
- package/StepContent/StepContent.d.ts +2 -17
- package/StepContent/StepContent.js +3 -22
- package/StepContent/StepContent.mjs +3 -22
- package/StepLabel/StepLabel.d.mts +0 -22
- package/StepLabel/StepLabel.d.ts +0 -22
- package/StepLabel/StepLabel.js +2 -31
- package/StepLabel/StepLabel.mjs +2 -31
- package/Stepper/Stepper.js +54 -22
- package/Stepper/Stepper.mjs +54 -22
- package/Stepper/StepperContext.d.mts +0 -5
- package/Stepper/StepperContext.d.ts +0 -5
- package/Stepper/StepperContext.js +1 -2
- package/Stepper/StepperContext.mjs +0 -1
- package/SvgIcon/createSvgIcon.d.mts +2 -0
- package/SvgIcon/createSvgIcon.d.ts +2 -0
- package/SvgIcon/createSvgIcon.js +31 -0
- package/SvgIcon/createSvgIcon.mjs +26 -0
- package/SvgIcon/index.d.mts +1 -0
- package/SvgIcon/index.d.ts +1 -0
- package/SvgIcon/index.js +8 -0
- package/SvgIcon/index.mjs +1 -0
- package/SwipeableDrawer/SwipeableDrawer.d.mts +0 -5
- package/SwipeableDrawer/SwipeableDrawer.d.ts +0 -5
- package/SwipeableDrawer/SwipeableDrawer.js +6 -37
- package/SwipeableDrawer/SwipeableDrawer.mjs +6 -37
- package/Switch/Switch.js +0 -11
- package/Switch/Switch.mjs +0 -11
- package/Tab/Tab.js +18 -4
- package/Tab/Tab.mjs +18 -4
- package/Tab/tabClasses.d.mts +0 -4
- package/Tab/tabClasses.d.ts +0 -4
- package/Tab/tabClasses.js +1 -1
- package/Tab/tabClasses.mjs +1 -1
- package/TabScrollButton/TabScrollButton.d.mts +1 -1
- package/TabScrollButton/TabScrollButton.d.ts +1 -1
- package/TabScrollButton/TabScrollButton.js +6 -2
- package/TabScrollButton/TabScrollButton.mjs +6 -2
- package/TablePagination/TablePagination.d.mts +0 -24
- package/TablePagination/TablePagination.d.ts +0 -24
- package/TablePagination/TablePagination.js +1 -29
- package/TablePagination/TablePagination.mjs +1 -29
- package/TablePaginationActions/TablePaginationActions.d.mts +0 -10
- package/TablePaginationActions/TablePaginationActions.d.ts +0 -10
- package/TablePaginationActions/TablePaginationActions.js +2 -14
- package/TablePaginationActions/TablePaginationActions.mjs +2 -14
- package/TableSortLabel/TableSortLabel.js +6 -8
- package/TableSortLabel/TableSortLabel.mjs +6 -8
- package/TableSortLabel/tableSortLabelClasses.d.mts +0 -8
- package/TableSortLabel/tableSortLabelClasses.d.ts +0 -8
- package/TableSortLabel/tableSortLabelClasses.js +1 -1
- package/TableSortLabel/tableSortLabelClasses.mjs +1 -1
- package/Tabs/Tabs.js +33 -24
- package/Tabs/Tabs.mjs +32 -23
- package/Tabs/tabsClasses.d.mts +0 -6
- package/Tabs/tabsClasses.d.ts +0 -6
- package/Tabs/tabsClasses.js +1 -1
- package/Tabs/tabsClasses.mjs +1 -1
- package/ToggleButton/ToggleButton.js +1 -0
- package/ToggleButton/ToggleButton.mjs +1 -0
- package/ToggleButtonGroup/ToggleButtonGroup.js +1 -4
- package/ToggleButtonGroup/ToggleButtonGroup.mjs +1 -4
- package/ToggleButtonGroup/toggleButtonGroupClasses.d.mts +0 -8
- package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +0 -8
- package/ToggleButtonGroup/toggleButtonGroupClasses.js +1 -1
- package/ToggleButtonGroup/toggleButtonGroupClasses.mjs +1 -1
- package/Tooltip/Tooltip.d.mts +1 -1
- package/Tooltip/Tooltip.d.ts +1 -1
- package/Typography/Typography.d.mts +3 -3
- package/Typography/Typography.d.ts +3 -3
- package/Typography/Typography.js +2 -24
- package/Typography/Typography.mjs +3 -25
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internal/SwitchBase.d.mts +2 -12
- package/internal/SwitchBase.d.ts +2 -12
- package/internal/SwitchBase.js +6 -17
- package/internal/SwitchBase.mjs +6 -17
- package/locale/psAF.js +1 -1
- package/locale/psAF.mjs +1 -1
- package/package.json +7 -7
- package/styles/createThemeWithVars.js +10 -9
- package/styles/createThemeWithVars.mjs +10 -9
- package/styles/stringifyTheme.js +1 -1
- package/styles/stringifyTheme.mjs +1 -1
- package/useAutocomplete/useAutocomplete.js +8 -0
- package/useAutocomplete/useAutocomplete.mjs +8 -0
- package/utils/createSvgIcon.d.mts +4 -2
- package/utils/createSvgIcon.d.ts +4 -2
- package/utils/createSvgIcon.js +6 -24
- package/utils/createSvgIcon.mjs +2 -24
- package/utils/focusWithVisible.js +24 -0
- package/utils/focusWithVisible.mjs +19 -0
- package/utils/index.d.mts +0 -1
- package/utils/index.d.ts +0 -1
- package/utils/index.js +0 -7
- package/utils/index.mjs +0 -1
- package/utils/useFocusableWhenDisabled.d.mts +30 -0
- package/utils/useFocusableWhenDisabled.d.ts +30 -0
- package/utils/useFocusableWhenDisabled.js +47 -0
- package/utils/useFocusableWhenDisabled.mjs +41 -0
- package/utils/useRovingTabIndex.d.mts +1 -2
- package/utils/useRovingTabIndex.d.ts +1 -2
- package/utils/useRovingTabIndex.js +25 -4
- package/utils/useRovingTabIndex.mjs +1 -2
- package/version/index.js +2 -2
- package/version/index.mjs +2 -2
|
@@ -157,7 +157,6 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
|
|
|
157
157
|
});
|
|
158
158
|
const {
|
|
159
159
|
ActionsComponent = _TablePaginationActions.default,
|
|
160
|
-
backIconButtonProps,
|
|
161
160
|
colSpan: colSpanProp,
|
|
162
161
|
component = _TableCell.default,
|
|
163
162
|
count,
|
|
@@ -165,13 +164,11 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
|
|
|
165
164
|
getItemAriaLabel = defaultGetAriaLabel,
|
|
166
165
|
labelDisplayedRows = defaultLabelDisplayedRows,
|
|
167
166
|
labelRowsPerPage = 'Rows per page:',
|
|
168
|
-
nextIconButtonProps,
|
|
169
167
|
onPageChange,
|
|
170
168
|
onRowsPerPageChange,
|
|
171
169
|
page,
|
|
172
170
|
rowsPerPage,
|
|
173
171
|
rowsPerPageOptions = [10, 25, 50, 100],
|
|
174
|
-
SelectProps = {},
|
|
175
172
|
showFirstButton = false,
|
|
176
173
|
showLastButton = false,
|
|
177
174
|
slotProps = {},
|
|
@@ -180,7 +177,7 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
|
|
|
180
177
|
} = props;
|
|
181
178
|
const ownerState = props;
|
|
182
179
|
const classes = useUtilityClasses(ownerState);
|
|
183
|
-
const selectProps = slotProps?.select ??
|
|
180
|
+
const selectProps = typeof slotProps?.select === 'function' ? slotProps.select(ownerState) : slotProps?.select ?? {};
|
|
184
181
|
const MenuItemComponent = selectProps.native ? 'option' : TablePaginationMenuItem;
|
|
185
182
|
let colSpan;
|
|
186
183
|
if (component === _TableCell.default || component === 'td') {
|
|
@@ -295,9 +292,7 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
|
|
|
295
292
|
})
|
|
296
293
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionsComponent, {
|
|
297
294
|
className: classes.actions,
|
|
298
|
-
backIconButtonProps: backIconButtonProps,
|
|
299
295
|
count: count,
|
|
300
|
-
nextIconButtonProps: nextIconButtonProps,
|
|
301
296
|
onPageChange: onPageChange,
|
|
302
297
|
page: page,
|
|
303
298
|
rowsPerPage: rowsPerPage,
|
|
@@ -322,13 +317,6 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
|
|
|
322
317
|
* @default TablePaginationActions
|
|
323
318
|
*/
|
|
324
319
|
ActionsComponent: _propTypes.default.elementType,
|
|
325
|
-
/**
|
|
326
|
-
* Props applied to the back arrow [`IconButton`](https://mui.com/material-ui/api/icon-button/) component.
|
|
327
|
-
*
|
|
328
|
-
* This prop is an alias for `slotProps.actions.previousButton` and will be overridden by it if both are used.
|
|
329
|
-
* @deprecated Use `slotProps.actions.previousButton` instead.
|
|
330
|
-
*/
|
|
331
|
-
backIconButtonProps: _propTypes.default.object,
|
|
332
320
|
/**
|
|
333
321
|
* Override or extend the styles applied to the component.
|
|
334
322
|
*/
|
|
@@ -382,13 +370,6 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
|
|
|
382
370
|
* @default 'Rows per page:'
|
|
383
371
|
*/
|
|
384
372
|
labelRowsPerPage: _propTypes.default.node,
|
|
385
|
-
/**
|
|
386
|
-
* Props applied to the next arrow [`IconButton`](https://mui.com/material-ui/api/icon-button/) element.
|
|
387
|
-
*
|
|
388
|
-
* This prop is an alias for `slotProps.actions.nextButton` and will be overridden by it if both are used.
|
|
389
|
-
* @deprecated Use `slotProps.actions.nextButton` instead.
|
|
390
|
-
*/
|
|
391
|
-
nextIconButtonProps: _propTypes.default.object,
|
|
392
373
|
/**
|
|
393
374
|
* Callback fired when the page is changed.
|
|
394
375
|
*
|
|
@@ -436,15 +417,6 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
|
|
|
436
417
|
label: _propTypes.default.string.isRequired,
|
|
437
418
|
value: _propTypes.default.number.isRequired
|
|
438
419
|
})]).isRequired),
|
|
439
|
-
/**
|
|
440
|
-
* Props applied to the rows per page [`Select`](https://mui.com/material-ui/api/select/) element.
|
|
441
|
-
*
|
|
442
|
-
* This prop is an alias for `slotProps.select` and will be overridden by it if both are used.
|
|
443
|
-
* @deprecated Use `slotProps.select` instead.
|
|
444
|
-
*
|
|
445
|
-
* @default {}
|
|
446
|
-
*/
|
|
447
|
-
SelectProps: _propTypes.default.object,
|
|
448
420
|
/**
|
|
449
421
|
* If `true`, show the first-page button.
|
|
450
422
|
* @default false
|
|
@@ -150,7 +150,6 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
|
|
|
150
150
|
});
|
|
151
151
|
const {
|
|
152
152
|
ActionsComponent = TablePaginationActions,
|
|
153
|
-
backIconButtonProps,
|
|
154
153
|
colSpan: colSpanProp,
|
|
155
154
|
component = TableCell,
|
|
156
155
|
count,
|
|
@@ -158,13 +157,11 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
|
|
|
158
157
|
getItemAriaLabel = defaultGetAriaLabel,
|
|
159
158
|
labelDisplayedRows = defaultLabelDisplayedRows,
|
|
160
159
|
labelRowsPerPage = 'Rows per page:',
|
|
161
|
-
nextIconButtonProps,
|
|
162
160
|
onPageChange,
|
|
163
161
|
onRowsPerPageChange,
|
|
164
162
|
page,
|
|
165
163
|
rowsPerPage,
|
|
166
164
|
rowsPerPageOptions = [10, 25, 50, 100],
|
|
167
|
-
SelectProps = {},
|
|
168
165
|
showFirstButton = false,
|
|
169
166
|
showLastButton = false,
|
|
170
167
|
slotProps = {},
|
|
@@ -173,7 +170,7 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
|
|
|
173
170
|
} = props;
|
|
174
171
|
const ownerState = props;
|
|
175
172
|
const classes = useUtilityClasses(ownerState);
|
|
176
|
-
const selectProps = slotProps?.select ??
|
|
173
|
+
const selectProps = typeof slotProps?.select === 'function' ? slotProps.select(ownerState) : slotProps?.select ?? {};
|
|
177
174
|
const MenuItemComponent = selectProps.native ? 'option' : TablePaginationMenuItem;
|
|
178
175
|
let colSpan;
|
|
179
176
|
if (component === TableCell || component === 'td') {
|
|
@@ -288,9 +285,7 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
|
|
|
288
285
|
})
|
|
289
286
|
}), /*#__PURE__*/_jsx(ActionsComponent, {
|
|
290
287
|
className: classes.actions,
|
|
291
|
-
backIconButtonProps: backIconButtonProps,
|
|
292
288
|
count: count,
|
|
293
|
-
nextIconButtonProps: nextIconButtonProps,
|
|
294
289
|
onPageChange: onPageChange,
|
|
295
290
|
page: page,
|
|
296
291
|
rowsPerPage: rowsPerPage,
|
|
@@ -315,13 +310,6 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
|
|
|
315
310
|
* @default TablePaginationActions
|
|
316
311
|
*/
|
|
317
312
|
ActionsComponent: PropTypes.elementType,
|
|
318
|
-
/**
|
|
319
|
-
* Props applied to the back arrow [`IconButton`](https://mui.com/material-ui/api/icon-button/) component.
|
|
320
|
-
*
|
|
321
|
-
* This prop is an alias for `slotProps.actions.previousButton` and will be overridden by it if both are used.
|
|
322
|
-
* @deprecated Use `slotProps.actions.previousButton` instead.
|
|
323
|
-
*/
|
|
324
|
-
backIconButtonProps: PropTypes.object,
|
|
325
313
|
/**
|
|
326
314
|
* Override or extend the styles applied to the component.
|
|
327
315
|
*/
|
|
@@ -375,13 +363,6 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
|
|
|
375
363
|
* @default 'Rows per page:'
|
|
376
364
|
*/
|
|
377
365
|
labelRowsPerPage: PropTypes.node,
|
|
378
|
-
/**
|
|
379
|
-
* Props applied to the next arrow [`IconButton`](https://mui.com/material-ui/api/icon-button/) element.
|
|
380
|
-
*
|
|
381
|
-
* This prop is an alias for `slotProps.actions.nextButton` and will be overridden by it if both are used.
|
|
382
|
-
* @deprecated Use `slotProps.actions.nextButton` instead.
|
|
383
|
-
*/
|
|
384
|
-
nextIconButtonProps: PropTypes.object,
|
|
385
366
|
/**
|
|
386
367
|
* Callback fired when the page is changed.
|
|
387
368
|
*
|
|
@@ -429,15 +410,6 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
|
|
|
429
410
|
label: PropTypes.string.isRequired,
|
|
430
411
|
value: PropTypes.number.isRequired
|
|
431
412
|
})]).isRequired),
|
|
432
|
-
/**
|
|
433
|
-
* Props applied to the rows per page [`Select`](https://mui.com/material-ui/api/select/) element.
|
|
434
|
-
*
|
|
435
|
-
* This prop is an alias for `slotProps.select` and will be overridden by it if both are used.
|
|
436
|
-
* @deprecated Use `slotProps.select` instead.
|
|
437
|
-
*
|
|
438
|
-
* @default {}
|
|
439
|
-
*/
|
|
440
|
-
SelectProps: PropTypes.object,
|
|
441
413
|
/**
|
|
442
414
|
* If `true`, show the first-page button.
|
|
443
415
|
* @default false
|
|
@@ -2,11 +2,6 @@ import * as React from 'react';
|
|
|
2
2
|
import { IconButtonProps } from "../IconButton/IconButton.mjs";
|
|
3
3
|
import { SvgIconProps } from "../SvgIcon/index.mjs";
|
|
4
4
|
export interface TablePaginationActionsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
/**
|
|
6
|
-
* This prop is an alias for `slotProps.previousButton` and will be overridden by it if both are used.
|
|
7
|
-
* @deprecated Use `slotProps.previousButton` instead.
|
|
8
|
-
*/
|
|
9
|
-
backIconButtonProps?: Partial<IconButtonProps> | undefined;
|
|
10
5
|
/**
|
|
11
6
|
* Override or extend the styles applied to the component.
|
|
12
7
|
*/
|
|
@@ -27,11 +22,6 @@ export interface TablePaginationActionsProps extends React.HTMLAttributes<HTMLDi
|
|
|
27
22
|
* @returns {string}
|
|
28
23
|
*/
|
|
29
24
|
getItemAriaLabel: (type: 'first' | 'last' | 'next' | 'previous') => string;
|
|
30
|
-
/**
|
|
31
|
-
* This prop is an alias for `slotProps.nextButton` and will be overridden by it if both are used.
|
|
32
|
-
* @deprecated Use `slotProps.nextButton` instead.
|
|
33
|
-
*/
|
|
34
|
-
nextIconButtonProps?: Partial<IconButtonProps> | undefined;
|
|
35
25
|
onPageChange: (event: React.MouseEvent<HTMLButtonElement> | null, page: number) => void;
|
|
36
26
|
page: number;
|
|
37
27
|
rowsPerPage: number;
|
|
@@ -2,11 +2,6 @@ import * as React from 'react';
|
|
|
2
2
|
import { IconButtonProps } from "../IconButton/IconButton.js";
|
|
3
3
|
import { SvgIconProps } from "../SvgIcon/index.js";
|
|
4
4
|
export interface TablePaginationActionsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
/**
|
|
6
|
-
* This prop is an alias for `slotProps.previousButton` and will be overridden by it if both are used.
|
|
7
|
-
* @deprecated Use `slotProps.previousButton` instead.
|
|
8
|
-
*/
|
|
9
|
-
backIconButtonProps?: Partial<IconButtonProps> | undefined;
|
|
10
5
|
/**
|
|
11
6
|
* Override or extend the styles applied to the component.
|
|
12
7
|
*/
|
|
@@ -27,11 +22,6 @@ export interface TablePaginationActionsProps extends React.HTMLAttributes<HTMLDi
|
|
|
27
22
|
* @returns {string}
|
|
28
23
|
*/
|
|
29
24
|
getItemAriaLabel: (type: 'first' | 'last' | 'next' | 'previous') => string;
|
|
30
|
-
/**
|
|
31
|
-
* This prop is an alias for `slotProps.nextButton` and will be overridden by it if both are used.
|
|
32
|
-
* @deprecated Use `slotProps.nextButton` instead.
|
|
33
|
-
*/
|
|
34
|
-
nextIconButtonProps?: Partial<IconButtonProps> | undefined;
|
|
35
25
|
onPageChange: (event: React.MouseEvent<HTMLButtonElement> | null, page: number) => void;
|
|
36
26
|
page: number;
|
|
37
27
|
rowsPerPage: number;
|
|
@@ -40,12 +40,10 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
40
40
|
name: 'MuiTablePaginationActions'
|
|
41
41
|
});
|
|
42
42
|
const {
|
|
43
|
-
backIconButtonProps,
|
|
44
43
|
className,
|
|
45
44
|
count,
|
|
46
45
|
disabled = false,
|
|
47
46
|
getItemAriaLabel,
|
|
48
|
-
nextIconButtonProps,
|
|
49
47
|
onPageChange,
|
|
50
48
|
page,
|
|
51
49
|
rowsPerPage,
|
|
@@ -107,7 +105,7 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
107
105
|
color: "inherit",
|
|
108
106
|
"aria-label": getItemAriaLabel('previous', page),
|
|
109
107
|
title: getItemAriaLabel('previous', page),
|
|
110
|
-
...
|
|
108
|
+
...previousButtonSlotProps,
|
|
111
109
|
children: isRtl ? /*#__PURE__*/(0, _jsxRuntime.jsx)(NextButtonIcon, {
|
|
112
110
|
...slotProps.nextButtonIcon
|
|
113
111
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(PreviousButtonIcon, {
|
|
@@ -119,7 +117,7 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
119
117
|
color: "inherit",
|
|
120
118
|
"aria-label": getItemAriaLabel('next', page),
|
|
121
119
|
title: getItemAriaLabel('next', page),
|
|
122
|
-
...
|
|
120
|
+
...nextButtonSlotProps,
|
|
123
121
|
children: isRtl ? /*#__PURE__*/(0, _jsxRuntime.jsx)(PreviousButtonIcon, {
|
|
124
122
|
...slotProps.previousButtonIcon
|
|
125
123
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(NextButtonIcon, {
|
|
@@ -144,11 +142,6 @@ process.env.NODE_ENV !== "production" ? TablePaginationActions.propTypes /* remo
|
|
|
144
142
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
145
143
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
146
144
|
// └─────────────────────────────────────────────────────────────────────┘
|
|
147
|
-
/**
|
|
148
|
-
* This prop is an alias for `slotProps.previousButton` and will be overridden by it if both are used.
|
|
149
|
-
* @deprecated Use `slotProps.previousButton` instead.
|
|
150
|
-
*/
|
|
151
|
-
backIconButtonProps: _propTypes.default.object,
|
|
152
145
|
/**
|
|
153
146
|
* @ignore
|
|
154
147
|
*/
|
|
@@ -179,11 +172,6 @@ process.env.NODE_ENV !== "production" ? TablePaginationActions.propTypes /* remo
|
|
|
179
172
|
* @returns {string}
|
|
180
173
|
*/
|
|
181
174
|
getItemAriaLabel: _propTypes.default.func.isRequired,
|
|
182
|
-
/**
|
|
183
|
-
* This prop is an alias for `slotProps.nextButton` and will be overridden by it if both are used.
|
|
184
|
-
* @deprecated Use `slotProps.nextButton` instead.
|
|
185
|
-
*/
|
|
186
|
-
nextIconButtonProps: _propTypes.default.object,
|
|
187
175
|
/**
|
|
188
176
|
* @ignore
|
|
189
177
|
*/
|
|
@@ -33,12 +33,10 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
33
33
|
name: 'MuiTablePaginationActions'
|
|
34
34
|
});
|
|
35
35
|
const {
|
|
36
|
-
backIconButtonProps,
|
|
37
36
|
className,
|
|
38
37
|
count,
|
|
39
38
|
disabled = false,
|
|
40
39
|
getItemAriaLabel,
|
|
41
|
-
nextIconButtonProps,
|
|
42
40
|
onPageChange,
|
|
43
41
|
page,
|
|
44
42
|
rowsPerPage,
|
|
@@ -100,7 +98,7 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
100
98
|
color: "inherit",
|
|
101
99
|
"aria-label": getItemAriaLabel('previous', page),
|
|
102
100
|
title: getItemAriaLabel('previous', page),
|
|
103
|
-
...
|
|
101
|
+
...previousButtonSlotProps,
|
|
104
102
|
children: isRtl ? /*#__PURE__*/_jsx(NextButtonIcon, {
|
|
105
103
|
...slotProps.nextButtonIcon
|
|
106
104
|
}) : /*#__PURE__*/_jsx(PreviousButtonIcon, {
|
|
@@ -112,7 +110,7 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
112
110
|
color: "inherit",
|
|
113
111
|
"aria-label": getItemAriaLabel('next', page),
|
|
114
112
|
title: getItemAriaLabel('next', page),
|
|
115
|
-
...
|
|
113
|
+
...nextButtonSlotProps,
|
|
116
114
|
children: isRtl ? /*#__PURE__*/_jsx(PreviousButtonIcon, {
|
|
117
115
|
...slotProps.previousButtonIcon
|
|
118
116
|
}) : /*#__PURE__*/_jsx(NextButtonIcon, {
|
|
@@ -137,11 +135,6 @@ process.env.NODE_ENV !== "production" ? TablePaginationActions.propTypes /* remo
|
|
|
137
135
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
138
136
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
139
137
|
// └─────────────────────────────────────────────────────────────────────┘
|
|
140
|
-
/**
|
|
141
|
-
* This prop is an alias for `slotProps.previousButton` and will be overridden by it if both are used.
|
|
142
|
-
* @deprecated Use `slotProps.previousButton` instead.
|
|
143
|
-
*/
|
|
144
|
-
backIconButtonProps: PropTypes.object,
|
|
145
138
|
/**
|
|
146
139
|
* @ignore
|
|
147
140
|
*/
|
|
@@ -172,11 +165,6 @@ process.env.NODE_ENV !== "production" ? TablePaginationActions.propTypes /* remo
|
|
|
172
165
|
* @returns {string}
|
|
173
166
|
*/
|
|
174
167
|
getItemAriaLabel: PropTypes.func.isRequired,
|
|
175
|
-
/**
|
|
176
|
-
* This prop is an alias for `slotProps.nextButton` and will be overridden by it if both are used.
|
|
177
|
-
* @deprecated Use `slotProps.nextButton` instead.
|
|
178
|
-
*/
|
|
179
|
-
nextIconButtonProps: PropTypes.object,
|
|
180
168
|
/**
|
|
181
169
|
* @ignore
|
|
182
170
|
*/
|
|
@@ -28,7 +28,7 @@ const useUtilityClasses = ownerState => {
|
|
|
28
28
|
} = ownerState;
|
|
29
29
|
const slots = {
|
|
30
30
|
root: ['root', active && 'active', `direction${(0, _capitalize.default)(direction)}`],
|
|
31
|
-
icon: ['icon'
|
|
31
|
+
icon: ['icon']
|
|
32
32
|
};
|
|
33
33
|
return (0, _composeClasses.default)(slots, _tableSortLabelClasses.getTableSortLabelUtilityClass, classes);
|
|
34
34
|
};
|
|
@@ -69,12 +69,7 @@ const TableSortLabelRoot = (0, _zeroStyled.styled)(_ButtonBase.default, {
|
|
|
69
69
|
const TableSortLabelIcon = (0, _zeroStyled.styled)('span', {
|
|
70
70
|
name: 'MuiTableSortLabel',
|
|
71
71
|
slot: 'Icon',
|
|
72
|
-
overridesResolver: (props, styles) =>
|
|
73
|
-
const {
|
|
74
|
-
ownerState
|
|
75
|
-
} = props;
|
|
76
|
-
return [styles.icon, styles[`iconDirection${(0, _capitalize.default)(ownerState.direction)}`]];
|
|
77
|
-
}
|
|
72
|
+
overridesResolver: (props, styles) => styles.icon
|
|
78
73
|
})((0, _memoTheme.default)(({
|
|
79
74
|
theme
|
|
80
75
|
}) => ({
|
|
@@ -139,7 +134,10 @@ const TableSortLabel = /*#__PURE__*/React.forwardRef(function TableSortLabel(inP
|
|
|
139
134
|
externalForwardedProps,
|
|
140
135
|
ownerState,
|
|
141
136
|
className: (0, _clsx.default)(classes.root, className),
|
|
142
|
-
ref
|
|
137
|
+
ref,
|
|
138
|
+
additionalProps: {
|
|
139
|
+
internalNativeButton: false
|
|
140
|
+
}
|
|
143
141
|
});
|
|
144
142
|
const [IconSlot, iconProps] = (0, _useSlot.default)('icon', {
|
|
145
143
|
elementType: TableSortLabelIcon,
|
|
@@ -21,7 +21,7 @@ const useUtilityClasses = ownerState => {
|
|
|
21
21
|
} = ownerState;
|
|
22
22
|
const slots = {
|
|
23
23
|
root: ['root', active && 'active', `direction${capitalize(direction)}`],
|
|
24
|
-
icon: ['icon'
|
|
24
|
+
icon: ['icon']
|
|
25
25
|
};
|
|
26
26
|
return composeClasses(slots, getTableSortLabelUtilityClass, classes);
|
|
27
27
|
};
|
|
@@ -62,12 +62,7 @@ const TableSortLabelRoot = styled(ButtonBase, {
|
|
|
62
62
|
const TableSortLabelIcon = styled('span', {
|
|
63
63
|
name: 'MuiTableSortLabel',
|
|
64
64
|
slot: 'Icon',
|
|
65
|
-
overridesResolver: (props, styles) =>
|
|
66
|
-
const {
|
|
67
|
-
ownerState
|
|
68
|
-
} = props;
|
|
69
|
-
return [styles.icon, styles[`iconDirection${capitalize(ownerState.direction)}`]];
|
|
70
|
-
}
|
|
65
|
+
overridesResolver: (props, styles) => styles.icon
|
|
71
66
|
})(memoTheme(({
|
|
72
67
|
theme
|
|
73
68
|
}) => ({
|
|
@@ -132,7 +127,10 @@ const TableSortLabel = /*#__PURE__*/React.forwardRef(function TableSortLabel(inP
|
|
|
132
127
|
externalForwardedProps,
|
|
133
128
|
ownerState,
|
|
134
129
|
className: clsx(classes.root, className),
|
|
135
|
-
ref
|
|
130
|
+
ref,
|
|
131
|
+
additionalProps: {
|
|
132
|
+
internalNativeButton: false
|
|
133
|
+
}
|
|
136
134
|
});
|
|
137
135
|
const [IconSlot, iconProps] = useSlot('icon', {
|
|
138
136
|
elementType: TableSortLabelIcon,
|
|
@@ -9,14 +9,6 @@ export interface TableSortLabelClasses {
|
|
|
9
9
|
active: string;
|
|
10
10
|
/** Styles applied to the icon component. */
|
|
11
11
|
icon: string;
|
|
12
|
-
/** Styles applied to the icon component if `direction="desc"`.
|
|
13
|
-
* @deprecated Combine the [.MuiTableSortLabel-icon](/material-ui/api/table-sort-label/#TableSortLabel-css-MuiTableSortLabel-icon) and [.MuiTableSortLabel-directionDesc](/material-ui/api/table-sort-label/#table-sort-label-classes-MuiTableSortLabel-directionDesc) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
14
|
-
*/
|
|
15
|
-
iconDirectionDesc: string;
|
|
16
|
-
/** Styles applied to the icon component if `direction="asc"`.
|
|
17
|
-
* @deprecated Combine the [.MuiTableSortLabel-icon](/material-ui/api/table-sort-label/#TableSortLabel-css-MuiTableSortLabel-icon) and [.MuiTableSortLabel-directionAsc](/material-ui/api/table-sort-label/#table-sort-label-classes-MuiTableSortLabel-directionAsc) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
18
|
-
*/
|
|
19
|
-
iconDirectionAsc: string;
|
|
20
12
|
}
|
|
21
13
|
export type TableSortLabelClassKey = keyof TableSortLabelClasses;
|
|
22
14
|
export declare function getTableSortLabelUtilityClass(slot: string): string;
|
|
@@ -9,14 +9,6 @@ export interface TableSortLabelClasses {
|
|
|
9
9
|
active: string;
|
|
10
10
|
/** Styles applied to the icon component. */
|
|
11
11
|
icon: string;
|
|
12
|
-
/** Styles applied to the icon component if `direction="desc"`.
|
|
13
|
-
* @deprecated Combine the [.MuiTableSortLabel-icon](/material-ui/api/table-sort-label/#TableSortLabel-css-MuiTableSortLabel-icon) and [.MuiTableSortLabel-directionDesc](/material-ui/api/table-sort-label/#table-sort-label-classes-MuiTableSortLabel-directionDesc) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
14
|
-
*/
|
|
15
|
-
iconDirectionDesc: string;
|
|
16
|
-
/** Styles applied to the icon component if `direction="asc"`.
|
|
17
|
-
* @deprecated Combine the [.MuiTableSortLabel-icon](/material-ui/api/table-sort-label/#TableSortLabel-css-MuiTableSortLabel-icon) and [.MuiTableSortLabel-directionAsc](/material-ui/api/table-sort-label/#table-sort-label-classes-MuiTableSortLabel-directionAsc) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
18
|
-
*/
|
|
19
|
-
iconDirectionAsc: string;
|
|
20
12
|
}
|
|
21
13
|
export type TableSortLabelClassKey = keyof TableSortLabelClasses;
|
|
22
14
|
export declare function getTableSortLabelUtilityClass(slot: string): string;
|
|
@@ -11,5 +11,5 @@ var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateU
|
|
|
11
11
|
function getTableSortLabelUtilityClass(slot) {
|
|
12
12
|
return (0, _generateUtilityClass.default)('MuiTableSortLabel', slot);
|
|
13
13
|
}
|
|
14
|
-
const tableSortLabelClasses = (0, _generateUtilityClasses.default)('MuiTableSortLabel', ['root', 'active', 'icon', '
|
|
14
|
+
const tableSortLabelClasses = (0, _generateUtilityClasses.default)('MuiTableSortLabel', ['root', 'active', 'icon', 'directionDesc', 'directionAsc']);
|
|
15
15
|
var _default = exports.default = tableSortLabelClasses;
|
|
@@ -3,5 +3,5 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
|
3
3
|
export function getTableSortLabelUtilityClass(slot) {
|
|
4
4
|
return generateUtilityClass('MuiTableSortLabel', slot);
|
|
5
5
|
}
|
|
6
|
-
const tableSortLabelClasses = generateUtilityClasses('MuiTableSortLabel', ['root', 'active', 'icon', '
|
|
6
|
+
const tableSortLabelClasses = generateUtilityClasses('MuiTableSortLabel', ['root', 'active', 'icon', 'directionDesc', 'directionAsc']);
|
|
7
7
|
export default tableSortLabelClasses;
|
package/Tabs/Tabs.js
CHANGED
|
@@ -27,7 +27,10 @@ var _tabsClasses = _interopRequireWildcard(require("./tabsClasses"));
|
|
|
27
27
|
var _ownerWindow = _interopRequireDefault(require("../utils/ownerWindow"));
|
|
28
28
|
var _isLayoutSupported = _interopRequireDefault(require("../utils/isLayoutSupported"));
|
|
29
29
|
var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
|
|
30
|
-
var
|
|
30
|
+
var _getActiveElement = _interopRequireDefault(require("../utils/getActiveElement"));
|
|
31
|
+
var _ownerDocument = _interopRequireDefault(require("../utils/ownerDocument"));
|
|
32
|
+
var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
|
|
33
|
+
var _useRovingTabIndex = require("../utils/useRovingTabIndex");
|
|
31
34
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
32
35
|
const useUtilityClasses = ownerState => {
|
|
33
36
|
const {
|
|
@@ -43,7 +46,7 @@ const useUtilityClasses = ownerState => {
|
|
|
43
46
|
const slots = {
|
|
44
47
|
root: ['root', vertical && 'vertical'],
|
|
45
48
|
scroller: ['scroller', fixed && 'fixed', hideScrollbar && 'hideScrollbar', scrollableX && 'scrollableX', scrollableY && 'scrollableY'],
|
|
46
|
-
list: ['list',
|
|
49
|
+
list: ['list', vertical && 'vertical', centered && 'centered'],
|
|
47
50
|
indicator: ['indicator'],
|
|
48
51
|
scrollButtons: ['scrollButtons', scrollButtonsHideMobile && 'scrollButtonsHideMobile'],
|
|
49
52
|
scrollableX: [scrollableX && 'scrollableX'],
|
|
@@ -151,7 +154,7 @@ const List = (0, _zeroStyled.styled)('div', {
|
|
|
151
154
|
const {
|
|
152
155
|
ownerState
|
|
153
156
|
} = props;
|
|
154
|
-
return [styles.list,
|
|
157
|
+
return [styles.list, ownerState.centered && styles.centered];
|
|
155
158
|
}
|
|
156
159
|
})({
|
|
157
160
|
display: 'flex',
|
|
@@ -294,6 +297,10 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
294
297
|
const [displayStartScroll, setDisplayStartScroll] = React.useState(false);
|
|
295
298
|
const [displayEndScroll, setDisplayEndScroll] = React.useState(false);
|
|
296
299
|
const [updateScrollObserver, setUpdateScrollObserver] = React.useState(false);
|
|
300
|
+
const selectedValue = value === false ? null : value;
|
|
301
|
+
// Tracks whether DOM focus is currently inside the tab list. When it is, roving focus
|
|
302
|
+
// should follow in-list keyboard movement instead of snapping back to `selectedValue`.
|
|
303
|
+
const [isFocusWithinList, setIsFocusWithinList] = React.useState(false);
|
|
297
304
|
const [scrollerStyle, setScrollerStyle] = React.useState({
|
|
298
305
|
overflow: 'hidden',
|
|
299
306
|
scrollbarWidth: 0
|
|
@@ -621,6 +628,12 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
621
628
|
const indicator = /*#__PURE__*/(0, _jsxRuntime.jsx)(IndicatorSlot, {
|
|
622
629
|
...indicatorSlotProps
|
|
623
630
|
});
|
|
631
|
+
const rovingContainer = (0, _useRovingTabIndex.useRovingTabIndexRoot)({
|
|
632
|
+
activeItemId: isFocusWithinList ? undefined : selectedValue,
|
|
633
|
+
orientation,
|
|
634
|
+
isRtl
|
|
635
|
+
});
|
|
636
|
+
const rovingContainerProps = rovingContainer.getContainerProps();
|
|
624
637
|
const validChildren = React.Children.toArray(childrenProp).filter(React.isValidElement).map((child, index) => {
|
|
625
638
|
const childValue = child.props.value === undefined ? index : child.props.value;
|
|
626
639
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -635,23 +648,11 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
635
648
|
childValue
|
|
636
649
|
};
|
|
637
650
|
});
|
|
638
|
-
const focusableIndex = valueToIndex.get(value);
|
|
639
|
-
const {
|
|
640
|
-
getContainerProps,
|
|
641
|
-
getItemProps
|
|
642
|
-
} = (0, _utils.useRovingTabIndex)({
|
|
643
|
-
focusableIndex,
|
|
644
|
-
orientation,
|
|
645
|
-
isRtl
|
|
646
|
-
});
|
|
647
|
-
const rovingTabIndexContainerProps = getContainerProps();
|
|
648
651
|
const children = validChildren.map(({
|
|
649
652
|
child,
|
|
650
|
-
index,
|
|
651
653
|
childValue
|
|
652
654
|
}) => {
|
|
653
655
|
const selected = childValue === value;
|
|
654
|
-
const rovingTabIndexItemProps = getItemProps(index, child.ref);
|
|
655
656
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
656
657
|
fullWidth: variant === 'fullWidth',
|
|
657
658
|
indicator: selected && !mounted && indicator,
|
|
@@ -659,9 +660,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
659
660
|
selectionFollowsFocus,
|
|
660
661
|
onChange,
|
|
661
662
|
textColor,
|
|
662
|
-
value: childValue
|
|
663
|
-
ref: rovingTabIndexItemProps.ref,
|
|
664
|
-
tabIndex: child.props.tabIndex ?? rovingTabIndexItemProps.tabIndex
|
|
663
|
+
value: childValue
|
|
665
664
|
});
|
|
666
665
|
});
|
|
667
666
|
const conditionalElements = getConditionalElements();
|
|
@@ -689,10 +688,10 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
689
688
|
}
|
|
690
689
|
}
|
|
691
690
|
});
|
|
692
|
-
const mergedRef = (0,
|
|
691
|
+
const mergedRef = (0, _useForkRef.default)(rovingContainerProps.ref, tabListRef);
|
|
693
692
|
const handleKeyDown = event => {
|
|
694
693
|
const list = tabListRef.current;
|
|
695
|
-
const currentFocus = (0,
|
|
694
|
+
const currentFocus = (0, _getActiveElement.default)((0, _ownerDocument.default)(list));
|
|
696
695
|
// Keyboard navigation assumes that [role="tab"] are siblings
|
|
697
696
|
// though we might warn in the future about nested, interactive elements
|
|
698
697
|
// as a a11y violation
|
|
@@ -700,22 +699,29 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
700
699
|
if (role !== 'tab') {
|
|
701
700
|
return;
|
|
702
701
|
}
|
|
703
|
-
|
|
702
|
+
rovingContainerProps.onKeyDown(event);
|
|
704
703
|
};
|
|
705
704
|
const [ListSlot, listSlotProps] = (0, _useSlot.default)('list', {
|
|
706
705
|
ref: mergedRef,
|
|
707
|
-
className:
|
|
706
|
+
className: classes.list,
|
|
708
707
|
elementType: List,
|
|
709
708
|
externalForwardedProps,
|
|
710
709
|
ownerState,
|
|
711
710
|
getSlotProps: handlers => ({
|
|
712
711
|
...handlers,
|
|
712
|
+
onBlur: event => {
|
|
713
|
+
if (!event.currentTarget.contains(event.relatedTarget)) {
|
|
714
|
+
setIsFocusWithinList(false);
|
|
715
|
+
}
|
|
716
|
+
handlers.onBlur?.(event);
|
|
717
|
+
},
|
|
713
718
|
onKeyDown: event => {
|
|
714
719
|
handleKeyDown(event);
|
|
715
720
|
handlers.onKeyDown?.(event);
|
|
716
721
|
},
|
|
717
722
|
onFocus: event => {
|
|
718
|
-
|
|
723
|
+
setIsFocusWithinList(true);
|
|
724
|
+
rovingContainerProps.onFocus(event);
|
|
719
725
|
handlers.onFocus?.(event);
|
|
720
726
|
}
|
|
721
727
|
})
|
|
@@ -730,7 +736,10 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
730
736
|
"aria-orientation": orientation === 'vertical' ? 'vertical' : null,
|
|
731
737
|
role: "tablist",
|
|
732
738
|
...listSlotProps,
|
|
733
|
-
children:
|
|
739
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_useRovingTabIndex.RovingTabIndexContext.Provider, {
|
|
740
|
+
value: rovingContainer,
|
|
741
|
+
children: children
|
|
742
|
+
})
|
|
734
743
|
}), mounted && indicator]
|
|
735
744
|
}), conditionalElements.scrollButtonEnd]
|
|
736
745
|
});
|