pre-installations and preparations
This commit is contained in:
1 parent
3e5a0329cb
commit
201d621ac3
6977 files changed
+742826
No files matched your search
+324
@@ -0,0 +1,324 @@
|
||||
"use strict";
|
||||
'use client';
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.TablePagination = void 0;
|
||||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
||||
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
||||
var _react = _interopRequireWildcard(require("react"));
|
||||
var React = _react;
|
||||
var _propTypes = _interopRequireDefault(require("prop-types"));
|
||||
var _utils = require("@mui/utils");
|
||||
var _utils2 = require("../utils");
|
||||
var _composeClasses = require("../composeClasses");
|
||||
var _isHostComponent = require("../utils/isHostComponent");
|
||||
var _TablePaginationActions = require("./TablePaginationActions");
|
||||
var _tablePaginationClasses = require("./tablePaginationClasses");
|
||||
var _ClassNameConfigurator = require("../utils/ClassNameConfigurator");
|
||||
var _jsxRuntime = require("react/jsx-runtime");
|
||||
const _excluded = ["colSpan", "count", "getItemAriaLabel", "labelDisplayedRows", "labelId", "labelRowsPerPage", "onPageChange", "onRowsPerPageChange", "page", "rowsPerPage", "rowsPerPageOptions", "selectId", "slotProps", "slots"];
|
||||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
||||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
||||
function defaultLabelDisplayedRows({
|
||||
from,
|
||||
to,
|
||||
count
|
||||
}) {
|
||||
return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
|
||||
}
|
||||
function defaultGetAriaLabel(type) {
|
||||
return `Go to ${type} page`;
|
||||
}
|
||||
const useUtilityClasses = () => {
|
||||
const slots = {
|
||||
root: ['root'],
|
||||
toolbar: ['toolbar'],
|
||||
spacer: ['spacer'],
|
||||
selectLabel: ['selectLabel'],
|
||||
select: ['select'],
|
||||
input: ['input'],
|
||||
selectIcon: ['selectIcon'],
|
||||
menuItem: ['menuItem'],
|
||||
displayedRows: ['displayedRows'],
|
||||
actions: ['actions']
|
||||
};
|
||||
return (0, _composeClasses.unstable_composeClasses)(slots, (0, _ClassNameConfigurator.useClassNamesOverride)(_tablePaginationClasses.getTablePaginationUtilityClass));
|
||||
};
|
||||
|
||||
/**
|
||||
* A pagination for tables.
|
||||
*
|
||||
* Demos:
|
||||
*
|
||||
* - [Table Pagination](https://mui.com/base-ui/react-table-pagination/)
|
||||
*
|
||||
* API:
|
||||
*
|
||||
* - [TablePagination API](https://mui.com/base-ui/react-table-pagination/components-api/#table-pagination)
|
||||
*/
|
||||
const TablePagination = exports.TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(props, forwardedRef) {
|
||||
var _slots$root, _slots$select, _slots$actions, _slots$menuItem, _slots$selectLabel, _slots$displayedRows, _slots$toolbar, _slots$spacer;
|
||||
const {
|
||||
colSpan: colSpanProp,
|
||||
count,
|
||||
getItemAriaLabel = defaultGetAriaLabel,
|
||||
labelDisplayedRows = defaultLabelDisplayedRows,
|
||||
labelId: labelIdProp,
|
||||
labelRowsPerPage = 'Rows per page:',
|
||||
onPageChange,
|
||||
onRowsPerPageChange,
|
||||
page,
|
||||
rowsPerPage,
|
||||
rowsPerPageOptions = [10, 25, 50, 100],
|
||||
selectId: selectIdProp,
|
||||
slotProps = {},
|
||||
slots = {}
|
||||
} = props,
|
||||
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
||||
const ownerState = props;
|
||||
const classes = useUtilityClasses();
|
||||
let colSpan;
|
||||
const Root = (_slots$root = slots.root) != null ? _slots$root : 'td';
|
||||
if (Root === 'td' || !(0, _isHostComponent.isHostComponent)(Root)) {
|
||||
colSpan = colSpanProp || 1000; // col-span over everything
|
||||
}
|
||||
const getLabelDisplayedRowsTo = () => {
|
||||
if (count === -1) {
|
||||
return (page + 1) * rowsPerPage;
|
||||
}
|
||||
return rowsPerPage === -1 ? count : Math.min(count, (page + 1) * rowsPerPage);
|
||||
};
|
||||
const selectId = (0, _utils.unstable_useId)(selectIdProp);
|
||||
const labelId = (0, _utils.unstable_useId)(labelIdProp);
|
||||
const rootProps = (0, _utils2.useSlotProps)({
|
||||
elementType: Root,
|
||||
externalSlotProps: slotProps.root,
|
||||
externalForwardedProps: other,
|
||||
additionalProps: {
|
||||
colSpan,
|
||||
ref: forwardedRef
|
||||
},
|
||||
ownerState,
|
||||
className: classes.root
|
||||
});
|
||||
const Select = (_slots$select = slots.select) != null ? _slots$select : 'select';
|
||||
const selectProps = (0, _utils2.useSlotProps)({
|
||||
elementType: Select,
|
||||
externalSlotProps: slotProps.select,
|
||||
additionalProps: {
|
||||
value: rowsPerPage,
|
||||
id: selectId,
|
||||
onChange: event => onRowsPerPageChange && onRowsPerPageChange(event),
|
||||
'aria-label': rowsPerPage.toString(),
|
||||
'aria-labelledby': [labelId, selectId].filter(Boolean).join(' ') || undefined
|
||||
},
|
||||
ownerState,
|
||||
className: classes.select
|
||||
});
|
||||
const Actions = (_slots$actions = slots.actions) != null ? _slots$actions : _TablePaginationActions.TablePaginationActions;
|
||||
const actionsProps = (0, _utils2.useSlotProps)({
|
||||
elementType: Actions,
|
||||
externalSlotProps: slotProps.actions,
|
||||
additionalProps: {
|
||||
page,
|
||||
rowsPerPage,
|
||||
count,
|
||||
onPageChange,
|
||||
getItemAriaLabel
|
||||
},
|
||||
ownerState,
|
||||
className: classes.actions
|
||||
});
|
||||
const MenuItem = (_slots$menuItem = slots.menuItem) != null ? _slots$menuItem : 'option';
|
||||
const menuItemProps = (0, _utils2.useSlotProps)({
|
||||
elementType: MenuItem,
|
||||
externalSlotProps: slotProps.menuItem,
|
||||
additionalProps: {
|
||||
value: undefined
|
||||
},
|
||||
ownerState,
|
||||
className: classes.menuItem
|
||||
});
|
||||
const SelectLabel = (_slots$selectLabel = slots.selectLabel) != null ? _slots$selectLabel : 'p';
|
||||
const selectLabelProps = (0, _utils2.useSlotProps)({
|
||||
elementType: SelectLabel,
|
||||
externalSlotProps: slotProps.selectLabel,
|
||||
additionalProps: {
|
||||
id: labelId
|
||||
},
|
||||
ownerState,
|
||||
className: classes.selectLabel
|
||||
});
|
||||
const DisplayedRows = (_slots$displayedRows = slots.displayedRows) != null ? _slots$displayedRows : 'p';
|
||||
const displayedRowsProps = (0, _utils2.useSlotProps)({
|
||||
elementType: DisplayedRows,
|
||||
externalSlotProps: slotProps.displayedRows,
|
||||
ownerState,
|
||||
className: classes.displayedRows
|
||||
});
|
||||
const Toolbar = (_slots$toolbar = slots.toolbar) != null ? _slots$toolbar : 'div';
|
||||
const toolbarProps = (0, _utils2.useSlotProps)({
|
||||
elementType: Toolbar,
|
||||
externalSlotProps: slotProps.toolbar,
|
||||
ownerState,
|
||||
className: classes.toolbar
|
||||
});
|
||||
const Spacer = (_slots$spacer = slots.spacer) != null ? _slots$spacer : 'div';
|
||||
const spacerProps = (0, _utils2.useSlotProps)({
|
||||
elementType: Spacer,
|
||||
externalSlotProps: slotProps.spacer,
|
||||
ownerState,
|
||||
className: classes.spacer
|
||||
});
|
||||
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Root, (0, _extends2.default)({}, rootProps, {
|
||||
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(Toolbar, (0, _extends2.default)({}, toolbarProps, {
|
||||
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Spacer, (0, _extends2.default)({}, spacerProps)), rowsPerPageOptions.length > 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(SelectLabel, (0, _extends2.default)({}, selectLabelProps, {
|
||||
children: labelRowsPerPage
|
||||
})), rowsPerPageOptions.length > 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(Select, (0, _extends2.default)({}, selectProps, {
|
||||
children: rowsPerPageOptions.map(rowsPerPageOption => /*#__PURE__*/(0, _react.createElement)(MenuItem, (0, _extends2.default)({}, menuItemProps, {
|
||||
key: typeof rowsPerPageOption !== 'number' && rowsPerPageOption.label ? rowsPerPageOption.label : rowsPerPageOption,
|
||||
value: typeof rowsPerPageOption !== 'number' && rowsPerPageOption.value ? rowsPerPageOption.value : rowsPerPageOption
|
||||
}), typeof rowsPerPageOption !== 'number' && rowsPerPageOption.label ? rowsPerPageOption.label : rowsPerPageOption))
|
||||
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(DisplayedRows, (0, _extends2.default)({}, displayedRowsProps, {
|
||||
children: labelDisplayedRows({
|
||||
from: count === 0 ? 0 : page * rowsPerPage + 1,
|
||||
to: getLabelDisplayedRowsTo(),
|
||||
count: count === -1 ? -1 : count,
|
||||
page
|
||||
})
|
||||
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(Actions, (0, _extends2.default)({}, actionsProps))]
|
||||
}))
|
||||
}));
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-proptypes */ = {
|
||||
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
||||
// │ These PropTypes are generated from the TypeScript type definitions. │
|
||||
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
||||
// └─────────────────────────────────────────────────────────────────────┘
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
colSpan: _propTypes.default.number,
|
||||
/**
|
||||
* The total number of rows.
|
||||
*
|
||||
* To enable server side pagination for an unknown number of items, provide -1.
|
||||
*/
|
||||
count: _propTypes.default.number.isRequired,
|
||||
/**
|
||||
* Accepts a function which returns a string value that provides a user-friendly name for the current page.
|
||||
* This is important for screen reader users.
|
||||
*
|
||||
* For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
|
||||
* @param {string} type The link or button type to format ('first' | 'last' | 'next' | 'previous').
|
||||
* @returns {string}
|
||||
* @default function defaultGetAriaLabel(type: ItemAriaLabelType) {
|
||||
* return `Go to ${type} page`;
|
||||
* }
|
||||
*/
|
||||
getItemAriaLabel: _propTypes.default.func,
|
||||
/**
|
||||
* Customize the displayed rows label. Invoked with a `{ from, to, count, page }`
|
||||
* object.
|
||||
*
|
||||
* For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
|
||||
* @default function defaultLabelDisplayedRows({ from, to, count }: LabelDisplayedRowsArgs) {
|
||||
* return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
|
||||
* }
|
||||
*/
|
||||
labelDisplayedRows: _propTypes.default.func,
|
||||
/**
|
||||
* Id of the label element within the pagination.
|
||||
*/
|
||||
labelId: _propTypes.default.string,
|
||||
/**
|
||||
* Customize the rows per page label.
|
||||
*
|
||||
* For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
|
||||
* @default 'Rows per page:'
|
||||
*/
|
||||
labelRowsPerPage: _propTypes.default.node,
|
||||
/**
|
||||
* Callback fired when the page is changed.
|
||||
*
|
||||
* @param {React.MouseEvent<HTMLButtonElement> | null} event The event source of the callback.
|
||||
* @param {number} page The page selected.
|
||||
*/
|
||||
onPageChange: _propTypes.default.func.isRequired,
|
||||
/**
|
||||
* Callback fired when the number of rows per page is changed.
|
||||
*
|
||||
* @param {React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>} event The event source of the callback.
|
||||
*/
|
||||
onRowsPerPageChange: _propTypes.default.func,
|
||||
/**
|
||||
* The zero-based index of the current page.
|
||||
*/
|
||||
page: (0, _utils.chainPropTypes)(_utils.integerPropType.isRequired, props => {
|
||||
const {
|
||||
count,
|
||||
page,
|
||||
rowsPerPage
|
||||
} = props;
|
||||
if (count === -1) {
|
||||
return null;
|
||||
}
|
||||
const newLastPage = Math.max(0, Math.ceil(count / rowsPerPage) - 1);
|
||||
if (page < 0 || page > newLastPage) {
|
||||
return new Error('MUI: The page prop of a TablePagination is out of range ' + `(0 to ${newLastPage}, but page is ${page}).`);
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
/**
|
||||
* The number of rows per page.
|
||||
*
|
||||
* Set -1 to display all the rows.
|
||||
*/
|
||||
rowsPerPage: _utils.integerPropType.isRequired,
|
||||
/**
|
||||
* Customizes the options of the rows per page select field. If less than two options are
|
||||
* available, no select field will be displayed.
|
||||
* Use -1 for the value with a custom label to show all the rows.
|
||||
* @default [10, 25, 50, 100]
|
||||
*/
|
||||
rowsPerPageOptions: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
|
||||
label: _propTypes.default.string.isRequired,
|
||||
value: _propTypes.default.number.isRequired
|
||||
})]).isRequired),
|
||||
/**
|
||||
* Id of the select element within the pagination.
|
||||
*/
|
||||
selectId: _propTypes.default.string,
|
||||
/**
|
||||
* The props used for each slot inside the TablePagination.
|
||||
* @default {}
|
||||
*/
|
||||
slotProps: _propTypes.default /* @typescript-to-proptypes-ignore */.shape({
|
||||
actions: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
||||
displayedRows: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
||||
menuItem: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
||||
root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
||||
select: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
||||
selectLabel: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
||||
spacer: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
||||
toolbar: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
||||
}),
|
||||
/**
|
||||
* The components used for each slot inside the TablePagination.
|
||||
* Either a string to use a HTML element or a component.
|
||||
* @default {}
|
||||
*/
|
||||
slots: _propTypes.default.shape({
|
||||
actions: _propTypes.default.elementType,
|
||||
displayedRows: _propTypes.default.elementType,
|
||||
menuItem: _propTypes.default.elementType,
|
||||
root: _propTypes.default.elementType,
|
||||
select: _propTypes.default.elementType,
|
||||
selectLabel: _propTypes.default.elementType,
|
||||
spacer: _propTypes.default.elementType,
|
||||
toolbar: _propTypes.default.elementType
|
||||
})
|
||||
} : void 0;
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
+149
@@ -0,0 +1,149 @@
|
||||
"use strict";
|
||||
'use client';
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.TablePaginationActions = void 0;
|
||||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
||||
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _utils = require("../utils");
|
||||
var _jsxRuntime = require("react/jsx-runtime");
|
||||
const _excluded = ["count", "getItemAriaLabel", "onPageChange", "page", "rowsPerPage", "showFirstButton", "showLastButton", "direction", "ownerState", "slotProps", "slots"];
|
||||
var _span, _span2, _span3, _span4;
|
||||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
||||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
||||
function LastPageIconDefault() {
|
||||
return _span || (_span = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
||||
children: '⇾|'
|
||||
}));
|
||||
}
|
||||
function FirstPageIconDefault() {
|
||||
return _span2 || (_span2 = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
||||
children: '|⇽'
|
||||
}));
|
||||
}
|
||||
function NextPageIconDefault() {
|
||||
return _span3 || (_span3 = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
||||
children: '⇾'
|
||||
}));
|
||||
}
|
||||
function BackPageIconDefault() {
|
||||
return _span4 || (_span4 = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
||||
children: '⇽'
|
||||
}));
|
||||
}
|
||||
function defaultGetAriaLabel(type) {
|
||||
return `Go to ${type} page`;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ignore - internal component.
|
||||
*/
|
||||
const TablePaginationActions = exports.TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePaginationActions(props, forwardedRef) {
|
||||
var _slots$root, _slots$firstButton, _slots$lastButton, _slots$nextButton, _slots$backButton, _slots$lastPageIcon, _slots$firstPageIcon, _slots$nextPageIcon, _slots$backPageIcon;
|
||||
const {
|
||||
count,
|
||||
getItemAriaLabel = defaultGetAriaLabel,
|
||||
onPageChange,
|
||||
page,
|
||||
rowsPerPage,
|
||||
showFirstButton = false,
|
||||
showLastButton = false,
|
||||
direction
|
||||
// @ts-ignore
|
||||
,
|
||||
|
||||
slotProps = {},
|
||||
slots = {}
|
||||
} = props,
|
||||
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
||||
const ownerState = props;
|
||||
const handleFirstPageButtonClick = event => {
|
||||
onPageChange(event, 0);
|
||||
};
|
||||
const handleBackButtonClick = event => {
|
||||
onPageChange(event, page - 1);
|
||||
};
|
||||
const handleNextButtonClick = event => {
|
||||
onPageChange(event, page + 1);
|
||||
};
|
||||
const handleLastPageButtonClick = event => {
|
||||
onPageChange(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));
|
||||
};
|
||||
const Root = (_slots$root = slots.root) != null ? _slots$root : 'div';
|
||||
const rootProps = (0, _utils.useSlotProps)({
|
||||
elementType: Root,
|
||||
externalSlotProps: slotProps.root,
|
||||
externalForwardedProps: other,
|
||||
additionalProps: {
|
||||
ref: forwardedRef
|
||||
},
|
||||
ownerState
|
||||
});
|
||||
const FirstButton = (_slots$firstButton = slots.firstButton) != null ? _slots$firstButton : 'button';
|
||||
const firstButtonProps = (0, _utils.useSlotProps)({
|
||||
elementType: FirstButton,
|
||||
externalSlotProps: slotProps.firstButton,
|
||||
additionalProps: {
|
||||
onClick: handleFirstPageButtonClick,
|
||||
disabled: page === 0,
|
||||
'aria-label': getItemAriaLabel('first', page),
|
||||
title: getItemAriaLabel('first', page)
|
||||
},
|
||||
ownerState
|
||||
});
|
||||
const LastButton = (_slots$lastButton = slots.lastButton) != null ? _slots$lastButton : 'button';
|
||||
const lastButtonProps = (0, _utils.useSlotProps)({
|
||||
elementType: LastButton,
|
||||
externalSlotProps: slotProps.lastButton,
|
||||
additionalProps: {
|
||||
onClick: handleLastPageButtonClick,
|
||||
disabled: page >= Math.ceil(count / rowsPerPage) - 1,
|
||||
'aria-label': getItemAriaLabel('last', page),
|
||||
title: getItemAriaLabel('last', page)
|
||||
},
|
||||
ownerState
|
||||
});
|
||||
const NextButton = (_slots$nextButton = slots.nextButton) != null ? _slots$nextButton : 'button';
|
||||
const nextButtonProps = (0, _utils.useSlotProps)({
|
||||
elementType: NextButton,
|
||||
externalSlotProps: slotProps.nextButton,
|
||||
additionalProps: {
|
||||
onClick: handleNextButtonClick,
|
||||
disabled: count !== -1 ? page >= Math.ceil(count / rowsPerPage) - 1 : false,
|
||||
'aria-label': getItemAriaLabel('next', page),
|
||||
title: getItemAriaLabel('next', page)
|
||||
},
|
||||
ownerState
|
||||
});
|
||||
const BackButton = (_slots$backButton = slots.backButton) != null ? _slots$backButton : 'button';
|
||||
const backButtonProps = (0, _utils.useSlotProps)({
|
||||
elementType: BackButton,
|
||||
externalSlotProps: slotProps.backButton,
|
||||
additionalProps: {
|
||||
onClick: handleBackButtonClick,
|
||||
disabled: page === 0,
|
||||
'aria-label': getItemAriaLabel('previous', page),
|
||||
title: getItemAriaLabel('previous', page)
|
||||
},
|
||||
ownerState
|
||||
});
|
||||
const LastPageIcon = (_slots$lastPageIcon = slots.lastPageIcon) != null ? _slots$lastPageIcon : LastPageIconDefault;
|
||||
const FirstPageIcon = (_slots$firstPageIcon = slots.firstPageIcon) != null ? _slots$firstPageIcon : FirstPageIconDefault;
|
||||
const NextPageIcon = (_slots$nextPageIcon = slots.nextPageIcon) != null ? _slots$nextPageIcon : NextPageIconDefault;
|
||||
const BackPageIcon = (_slots$backPageIcon = slots.backPageIcon) != null ? _slots$backPageIcon : BackPageIconDefault;
|
||||
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Root, (0, _extends2.default)({}, rootProps, {
|
||||
children: [showFirstButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(FirstButton, (0, _extends2.default)({}, firstButtonProps, {
|
||||
children: direction === 'rtl' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(LastPageIcon, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(FirstPageIcon, {})
|
||||
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(BackButton, (0, _extends2.default)({}, backButtonProps, {
|
||||
children: direction === 'rtl' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(NextPageIcon, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(BackPageIcon, {})
|
||||
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(NextButton, (0, _extends2.default)({}, nextButtonProps, {
|
||||
children: direction === 'rtl' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(BackPageIcon, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(NextPageIcon, {})
|
||||
})), showLastButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(LastButton, (0, _extends2.default)({}, lastButtonProps, {
|
||||
children: direction === 'rtl' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(FirstPageIcon, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(LastPageIcon, {})
|
||||
}))]
|
||||
}));
|
||||
});
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
"use strict";
|
||||
'use client';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var _exportNames = {
|
||||
TablePagination: true,
|
||||
TablePaginationActions: true
|
||||
};
|
||||
Object.defineProperty(exports, "TablePagination", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _TablePagination.TablePagination;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "TablePaginationActions", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _TablePaginationActions.TablePaginationActions;
|
||||
}
|
||||
});
|
||||
var _TablePagination = require("./TablePagination");
|
||||
var _TablePagination2 = require("./TablePagination.types");
|
||||
Object.keys(_TablePagination2).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
if (key in exports && exports[key] === _TablePagination2[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _TablePagination2[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
var _TablePaginationActions = require("./TablePaginationActions");
|
||||
var _TablePaginationActions2 = require("./TablePaginationActions.types");
|
||||
Object.keys(_TablePaginationActions2).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
if (key in exports && exports[key] === _TablePaginationActions2[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _TablePaginationActions2[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
var _tablePaginationClasses = require("./tablePaginationClasses");
|
||||
Object.keys(_tablePaginationClasses).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
if (key in exports && exports[key] === _tablePaginationClasses[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _tablePaginationClasses[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
var _common = require("./common.types");
|
||||
Object.keys(_common).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
if (key in exports && exports[key] === _common[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _common[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getTablePaginationUtilityClass = getTablePaginationUtilityClass;
|
||||
exports.tablePaginationClasses = void 0;
|
||||
var _generateUtilityClass = require("../generateUtilityClass");
|
||||
var _generateUtilityClasses = require("../generateUtilityClasses");
|
||||
const COMPONENT_NAME = 'TablePagination';
|
||||
function getTablePaginationUtilityClass(slot) {
|
||||
return (0, _generateUtilityClass.generateUtilityClass)(COMPONENT_NAME, slot);
|
||||
}
|
||||
const tablePaginationClasses = exports.tablePaginationClasses = (0, _generateUtilityClasses.generateUtilityClasses)(COMPONENT_NAME, ['root', 'toolbar', 'spacer', 'selectLabel', 'selectRoot', 'select', 'selectIcon', 'input', 'menuItem', 'displayedRows', 'actions']);
|
||||
Reference in new issue
Block a user