@rocket.chat/fuselage 0.75.0 → 0.76.0
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/dist/components/Pagination/Pagination.d.ts +3 -4
- package/dist/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/fuselage.css +1 -1
- package/dist/fuselage.css.map +1 -1
- package/dist/fuselage.development.js +9 -3
- package/dist/fuselage.development.js.map +1 -1
- package/dist/fuselage.production.js +2 -2
- package/package.json +1 -1
|
@@ -3058,7 +3058,7 @@ const WithErrorWrapper_1 = __importDefault(__webpack_require__(/*! ../../helpers
|
|
|
3058
3058
|
const Box_1 = __webpack_require__(/*! ../Box */ "./src/components/Box/index.ts");
|
|
3059
3059
|
const Field_1 = __webpack_require__(/*! ./Field */ "./src/components/Field/Field.tsx");
|
|
3060
3060
|
const FieldLink = (props) => {
|
|
3061
|
-
const component = (0, jsx_runtime_1.jsx)(Box_1.Box, { is: 'a',
|
|
3061
|
+
const component = (0, jsx_runtime_1.jsx)(Box_1.Box, { is: 'a', "rcx-field__link": true, ...props });
|
|
3062
3062
|
if (true) {
|
|
3063
3063
|
return ((0, jsx_runtime_1.jsx)(WithErrorWrapper_1.default, { context: Field_1.FieldContext, parentComponent: 'Field', componentName: FieldLink.name, children: component }));
|
|
3064
3064
|
}
|
|
@@ -7112,12 +7112,13 @@ Object.defineProperty(exports, "PaginatedMultiSelectFiltered", ({ enumerable: tr
|
|
|
7112
7112
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7113
7113
|
const jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
|
|
7114
7114
|
const react_1 = __webpack_require__(/*! react */ "react");
|
|
7115
|
-
const Box_1 = __webpack_require__(/*! ../Box */ "./src/components/Box/index.ts");
|
|
7116
7115
|
const Chevron_1 = __webpack_require__(/*! ../Chevron */ "./src/components/Chevron/index.ts");
|
|
7117
7116
|
const defaultItemsPerPageLabel = () => 'Items per page:';
|
|
7118
7117
|
const defaultShowingResultsLabel = ({ count, current, itemsPerPage, }) => `Showing results ${current + 1} - ${Math.min(current + itemsPerPage, count)} of ${count}`;
|
|
7119
7118
|
const itemsPerPageOptions = [25, 50, 100];
|
|
7120
7119
|
const Pagination = ({ count, current = 0, itemsPerPage = 25, itemsPerPageLabel = defaultItemsPerPageLabel, showingResultsLabel = defaultShowingResultsLabel, onSetItemsPerPage, onSetCurrent, divider, ...props }) => {
|
|
7120
|
+
const paginationResultLabelId = (0, react_1.useId)();
|
|
7121
|
+
const itemsPerPageLabelId = (0, react_1.useId)();
|
|
7121
7122
|
const hasItemsPerPageSelection = itemsPerPageOptions.length > 1;
|
|
7122
7123
|
const currentPage = Math.floor(current / itemsPerPage);
|
|
7123
7124
|
const pages = Math.ceil(count / itemsPerPage);
|
|
@@ -7148,7 +7149,12 @@ const Pagination = ({ count, current = 0, itemsPerPage = 25, itemsPerPageLabel =
|
|
|
7148
7149
|
const handleSetPageLinkClick = (page) => () => {
|
|
7149
7150
|
onSetCurrent?.(page * itemsPerPage);
|
|
7150
7151
|
};
|
|
7151
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
7152
|
+
return ((0, jsx_runtime_1.jsxs)("nav", { className: [
|
|
7153
|
+
'rcx-box rcx-box--full rcx-pagination',
|
|
7154
|
+
divider && 'rcx-pagination--divider',
|
|
7155
|
+
]
|
|
7156
|
+
.filter(Boolean)
|
|
7157
|
+
.join(' '), "aria-label": 'Pagination Navigation', ...props, children: [hasItemsPerPageSelection && ((0, jsx_runtime_1.jsxs)("div", { className: 'rcx-pagination__left', children: [(0, jsx_runtime_1.jsx)("span", { className: 'rcx-pagination__label', id: itemsPerPageLabelId, children: itemsPerPageLabel(renderingContext) }), (0, jsx_runtime_1.jsx)("ol", { className: 'rcx-box rcx-box--full rcx-pagination__list', "aria-labelledby": itemsPerPageLabelId, children: itemsPerPageOptions.map((itemsPerPageOption) => ((0, jsx_runtime_1.jsx)("li", { className: 'rcx-pagination__list-item', children: (0, jsx_runtime_1.jsx)("button", { className: 'rcx-box rcx-box--full rcx-pagination__link', tabIndex: itemsPerPage === itemsPerPageOption ? -1 : 0, disabled: itemsPerPage === itemsPerPageOption, "aria-label": `Show ${itemsPerPageOption} items per page`, onClick: handleSetItemsPerPageLinkClick(itemsPerPageOption), children: itemsPerPageOption }) }, itemsPerPageOption))) })] })), (0, jsx_runtime_1.jsxs)("div", { className: 'rcx-pagination__right', children: [(0, jsx_runtime_1.jsx)("span", { className: 'rcx-pagination__label', id: paginationResultLabelId, children: showingResultsLabel(renderingContext) }), (0, jsx_runtime_1.jsxs)("ol", { className: 'rcx-box rcx-box--full rcx-pagination__list', "aria-labelledby": paginationResultLabelId, children: [(0, jsx_runtime_1.jsx)("li", { className: 'rcx-pagination__list-item', children: (0, jsx_runtime_1.jsx)("button", { className: 'rcx-box rcx-box--full rcx-pagination__back', disabled: currentPage === 0, "aria-label": 'Previous page', onClick: handleSetPageLinkClick(currentPage - 1), children: (0, jsx_runtime_1.jsx)(Chevron_1.Chevron, { left: true, size: 'x16' }) }) }), displayedPages.map((page, i) => ((0, jsx_runtime_1.jsx)("li", { className: 'rcx-pagination__list-item', children: page === '⋯' ? ('⋯') : ((0, jsx_runtime_1.jsx)("button", { className: 'rcx-box rcx-box--full rcx-pagination__link', disabled: currentPage === page, "aria-label": `Page ${Number(page) + 1}`, onClick: handleSetPageLinkClick(Number(page)), children: Number(page) + 1 })) }, i))), (0, jsx_runtime_1.jsx)("li", { className: 'rcx-pagination__list-item', children: (0, jsx_runtime_1.jsx)("button", { className: 'rcx-box rcx-box--full rcx-pagination__forward', disabled: currentPage === pages - 1, "aria-label": 'Next page', onClick: handleSetPageLinkClick(currentPage + 1), children: (0, jsx_runtime_1.jsx)(Chevron_1.Chevron, { right: true, size: 'x16' }) }) })] })] })] }));
|
|
7152
7158
|
};
|
|
7153
7159
|
exports["default"] = Pagination;
|
|
7154
7160
|
|