@thecb/components 7.8.2-beta.4 → 7.8.2-beta.6
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/index.cjs.js +18 -14
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +18 -14
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/pagination/Pagination.js +24 -15
package/dist/index.esm.js
CHANGED
|
@@ -46594,26 +46594,30 @@ var getPagesPanel = function getPagesPanel(page, pagesCount) {
|
|
|
46594
46594
|
|
|
46595
46595
|
if (page > space + 1) {
|
|
46596
46596
|
pages.push({
|
|
46597
|
-
isDelimiter: true
|
|
46597
|
+
isDelimiter: true,
|
|
46598
|
+
id: "first-delimiter"
|
|
46598
46599
|
});
|
|
46599
46600
|
}
|
|
46600
46601
|
|
|
46601
46602
|
for (var j = Math.max(1, page - space) + 1; j < Math.min(lastPageNumber, page + space); j++) {
|
|
46602
46603
|
pages.push({
|
|
46603
46604
|
index: j,
|
|
46604
|
-
isButton: true
|
|
46605
|
+
isButton: true,
|
|
46606
|
+
id: "page-".concat(j)
|
|
46605
46607
|
});
|
|
46606
46608
|
}
|
|
46607
46609
|
|
|
46608
46610
|
if (page < lastPageNumber - space) {
|
|
46609
46611
|
pages.push({
|
|
46610
|
-
isDelimiter: true
|
|
46612
|
+
isDelimiter: true,
|
|
46613
|
+
id: "last-delimiter"
|
|
46611
46614
|
});
|
|
46612
46615
|
}
|
|
46613
46616
|
|
|
46614
46617
|
pages.push({
|
|
46615
46618
|
index: lastPageNumber,
|
|
46616
|
-
isButton: true
|
|
46619
|
+
isButton: true,
|
|
46620
|
+
id: "page-".concat(lastPageNumber)
|
|
46617
46621
|
});
|
|
46618
46622
|
var activePage = pages.find(function (p) {
|
|
46619
46623
|
return p.index === page;
|
|
@@ -46655,18 +46659,19 @@ var Pagination = function Pagination(_ref3) {
|
|
|
46655
46659
|
isMobile = _useContext.isMobile;
|
|
46656
46660
|
|
|
46657
46661
|
var extraStyles = "\n min-width: ".concat(buttonWidth, "; min-height: 100%; padding: 0;\n border-radius: ").concat(borderRadius, ";\n &:hover, &:focus {\n text-decoration: none;\n > * > span {\n text-decoration: none;\n }\n }\n > * > span {\n color: ").concat(numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor, "\n }\n margin: 0;\n &:hover {\n background-color: ").concat(themeValues.hoverBackgroundColor, "\n }\n ");
|
|
46658
|
-
var
|
|
46662
|
+
var currentPageStyles = "\n border: ".concat(activeBorderWidth, " solid ").concat(numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor, ";\n color: ").concat(numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.activeColor, ";\n background-color: ").concat(themeValues.activeBackgroundColor, ";\n &:focus {\n box-shadow: none;\n }\n &:hover {\n background-color: initial;\n border: ").concat(activeBorderWidth, " solid ").concat(numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor, ";\n background-color: ").concat(themeValues.activeBackgroundColor, ";\n }\n ");
|
|
46659
46663
|
return /*#__PURE__*/React.createElement(Cluster, {
|
|
46660
46664
|
justify: "center",
|
|
46661
46665
|
childGap: childGap,
|
|
46662
46666
|
overflow: true,
|
|
46663
46667
|
as: "nav",
|
|
46668
|
+
role: "navigation",
|
|
46664
46669
|
innerWrapperAs: "ul",
|
|
46665
46670
|
"aria-label": ariaLabel,
|
|
46666
46671
|
extraStyles: "> ul { padding: 0px; > li { list-style-type: none; } };"
|
|
46667
46672
|
}, currentPage > 1 ? /*#__PURE__*/React.createElement(PrevNextButton, {
|
|
46668
46673
|
action: pagePrevious,
|
|
46669
|
-
ariaLabel: "Previous Page
|
|
46674
|
+
ariaLabel: "Previous Page",
|
|
46670
46675
|
arrowColor: arrowColor !== null && arrowColor !== void 0 ? arrowColor : themeValues.arrowColor,
|
|
46671
46676
|
borderRadius: borderRadius,
|
|
46672
46677
|
buttonHeight: buttonHeight,
|
|
@@ -46690,36 +46695,35 @@ var Pagination = function Pagination(_ref3) {
|
|
|
46690
46695
|
padding: "0",
|
|
46691
46696
|
extraStyles: "max-height: ".concat(buttonHeight, ";"),
|
|
46692
46697
|
as: "li",
|
|
46693
|
-
key:
|
|
46698
|
+
key: item.id
|
|
46694
46699
|
}, /*#__PURE__*/React.createElement(ButtonWithAction, {
|
|
46695
46700
|
variant: "ghost",
|
|
46696
46701
|
text: item.index,
|
|
46697
|
-
disabled: item.active,
|
|
46698
|
-
extraDisabledStyles: extraDisabledStyles,
|
|
46699
46702
|
"aria-current": item.active ? "page" : undefined,
|
|
46700
|
-
"aria-label": "".concat(item.
|
|
46703
|
+
"aria-label": "".concat(item.index == pageCount ? "Last Page, " : "", "page ").concat(item.index),
|
|
46701
46704
|
action: !item.active ? function () {
|
|
46702
46705
|
return setCurrentPage({
|
|
46703
46706
|
pageNumber: item.index
|
|
46704
46707
|
});
|
|
46705
46708
|
} : noop,
|
|
46706
46709
|
textExtraStyles: "font-size: ".concat(fontSize, "; font-weight: ").concat(fontWeight, ";"),
|
|
46707
|
-
extraStyles: extraStyles,
|
|
46710
|
+
extraStyles: "".concat(extraStyles).concat(item.active ? currentPageStyles : ""),
|
|
46708
46711
|
dataQa: index
|
|
46709
46712
|
}, item.index)) : /*#__PURE__*/React.createElement(Box, {
|
|
46710
46713
|
padding: "0 10px",
|
|
46711
46714
|
as: "li",
|
|
46712
|
-
key:
|
|
46715
|
+
key: item.id
|
|
46713
46716
|
}, /*#__PURE__*/React.createElement(Cluster, {
|
|
46714
46717
|
justify: "flex-end"
|
|
46715
46718
|
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
46716
46719
|
variant: "pXL",
|
|
46717
46720
|
weight: fontWeight,
|
|
46718
|
-
color: numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor
|
|
46721
|
+
color: numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor,
|
|
46722
|
+
"aria-label": "ellipsis"
|
|
46719
46723
|
}, "...")));
|
|
46720
46724
|
}), currentPage < pageCount ? /*#__PURE__*/React.createElement(PrevNextButton, {
|
|
46721
46725
|
action: pageNext,
|
|
46722
|
-
ariaLabel: "Next Page
|
|
46726
|
+
ariaLabel: "Next Page",
|
|
46723
46727
|
arrowColor: arrowColor !== null && arrowColor !== void 0 ? arrowColor : themeValues.arrowColor,
|
|
46724
46728
|
borderRadius: borderRadius,
|
|
46725
46729
|
buttonHeight: buttonHeight,
|