@citygross/components 0.7.184 → 0.7.185

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.
@@ -38,16 +38,17 @@ function createPagination(totalItems, itemsPerPage, numOfPaginationsToShow) {
38
38
  return pagination;
39
39
  }
40
40
  function Pagination(_a) {
41
- var totalItems = _a.totalItems, currentPage = _a.currentPage, fetchItems = _a.fetchItems, itemsPerPage = _a.itemsPerPage, setPage = _a.setPage, _b = _a.numOfPaginationsToShow, numOfPaginationsToShow = _b === void 0 ? 4 : _b;
42
- var _c = React.useState(Math.floor((currentPage - 1) / numOfPaginationsToShow)), currentIndex = _c[0], setIndex = _c[1];
41
+ var _b;
42
+ var totalItems = _a.totalItems, currentPage = _a.currentPage, fetchItems = _a.fetchItems, itemsPerPage = _a.itemsPerPage, setPage = _a.setPage, _c = _a.numOfPaginationsToShow, numOfPaginationsToShow = _c === void 0 ? 4 : _c;
43
+ var _d = React.useState(Math.floor((currentPage - 1) / numOfPaginationsToShow)), currentIndex = _d[0], setIndex = _d[1];
43
44
  var pagination = createPagination(totalItems, itemsPerPage, numOfPaginationsToShow);
44
45
  return (React__default["default"].createElement(Box.Box, null, pagination && pagination.length > 0 && (React__default["default"].createElement(Pagination_styles.Flex, null,
45
46
  currentIndex > 0 && (React__default["default"].createElement(Pagination_styles.PaginationButtonWrapper, null,
46
47
  React__default["default"].createElement(PaginationButton.PaginationButton, { color: 'white', onClick: function () {
47
48
  setPage && setPage(currentPage - 1);
48
49
  setIndex(currentIndex - 1);
49
- }, width: 36, height: 36 }, '...'))),
50
- pagination[currentIndex].map(function (page) { return (React__default["default"].createElement(Pagination_styles.PaginationButtonWrapper, { key: page },
50
+ }, width: 36, height: 36 }, '...'))), (_b = pagination === null || pagination === void 0 ? void 0 : pagination[currentIndex]) === null || _b === void 0 ? void 0 :
51
+ _b.map(function (page) { return (React__default["default"].createElement(Pagination_styles.PaginationButtonWrapper, { key: page },
51
52
  React__default["default"].createElement(PaginationButton.PaginationButton, { color: currentPage === page + 1 ? 'primary' : 'white', width: 36, height: 36, onClick: function () { return fetchItems(page + 1); } }, page + 1))); }),
52
53
  pagination.length > 1 && currentIndex < pagination.length - 1 && (React__default["default"].createElement(Pagination_styles.PaginationButtonWrapper, null,
53
54
  React__default["default"].createElement(PaginationButton.PaginationButton, { color: 'white', onClick: function () { return setIndex(currentIndex + 1); }, width: 36, height: 36 }, '...')))))));
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Pagination.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -30,16 +30,17 @@ function createPagination(totalItems, itemsPerPage, numOfPaginationsToShow) {
30
30
  return pagination;
31
31
  }
32
32
  function Pagination(_a) {
33
- var totalItems = _a.totalItems, currentPage = _a.currentPage, fetchItems = _a.fetchItems, itemsPerPage = _a.itemsPerPage, setPage = _a.setPage, _b = _a.numOfPaginationsToShow, numOfPaginationsToShow = _b === void 0 ? 4 : _b;
34
- var _c = useState(Math.floor((currentPage - 1) / numOfPaginationsToShow)), currentIndex = _c[0], setIndex = _c[1];
33
+ var _b;
34
+ var totalItems = _a.totalItems, currentPage = _a.currentPage, fetchItems = _a.fetchItems, itemsPerPage = _a.itemsPerPage, setPage = _a.setPage, _c = _a.numOfPaginationsToShow, numOfPaginationsToShow = _c === void 0 ? 4 : _c;
35
+ var _d = useState(Math.floor((currentPage - 1) / numOfPaginationsToShow)), currentIndex = _d[0], setIndex = _d[1];
35
36
  var pagination = createPagination(totalItems, itemsPerPage, numOfPaginationsToShow);
36
37
  return (React.createElement(Box, null, pagination && pagination.length > 0 && (React.createElement(Flex, null,
37
38
  currentIndex > 0 && (React.createElement(PaginationButtonWrapper, null,
38
39
  React.createElement(PaginationButton, { color: 'white', onClick: function () {
39
40
  setPage && setPage(currentPage - 1);
40
41
  setIndex(currentIndex - 1);
41
- }, width: 36, height: 36 }, '...'))),
42
- pagination[currentIndex].map(function (page) { return (React.createElement(PaginationButtonWrapper, { key: page },
42
+ }, width: 36, height: 36 }, '...'))), (_b = pagination === null || pagination === void 0 ? void 0 : pagination[currentIndex]) === null || _b === void 0 ? void 0 :
43
+ _b.map(function (page) { return (React.createElement(PaginationButtonWrapper, { key: page },
43
44
  React.createElement(PaginationButton, { color: currentPage === page + 1 ? 'primary' : 'white', width: 36, height: 36, onClick: function () { return fetchItems(page + 1); } }, page + 1))); }),
44
45
  pagination.length > 1 && currentIndex < pagination.length - 1 && (React.createElement(PaginationButtonWrapper, null,
45
46
  React.createElement(PaginationButton, { color: 'white', onClick: function () { return setIndex(currentIndex + 1); }, width: 36, height: 36 }, '...')))))));
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Pagination.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.7.184",
3
+ "version": "0.7.185",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "./build/cjs/components/src/index.js",
@@ -71,5 +71,5 @@
71
71
  "moment": "^2.29.1",
72
72
  "react-loading-skeleton": "^2.2.0"
73
73
  },
74
- "gitHead": "9bba5e5e1a09e01a0281833a1e57a2a7363ac6f6"
74
+ "gitHead": "aa1a3a7e9cebfc5948a40c485746d3a5839a718f"
75
75
  }