@contentful/f36-pagination
Advanced tools
Comparing version 4.19.0 to 4.19.1
# @contentful/f36-pagination | ||
## 4.19.1 | ||
### Patch Changes | ||
- [#2209](https://github.com/contentful/forma-36/pull/2209) [`42f0c321`](https://github.com/contentful/forma-36/commit/42f0c3218965137191842f492fe5dbf4bd10784c) Thanks [@denkristoffer](https://github.com/denkristoffer)! - build: build ESM to JS file - legacy output | ||
fix(notification): use type imports | ||
- Updated dependencies [[`42f0c321`](https://github.com/contentful/forma-36/commit/42f0c3218965137191842f492fe5dbf4bd10784c)]: | ||
- @contentful/f36-button@4.19.1 | ||
- @contentful/f36-forms@4.19.1 | ||
- @contentful/f36-icons@4.19.1 | ||
- @contentful/f36-typography@4.19.1 | ||
- @contentful/f36-core@4.19.1 | ||
## 4.19.0 | ||
@@ -4,0 +17,0 @@ |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var a = require('react'); | ||
var e = require('react'); | ||
var f36Button = require('@contentful/f36-button'); | ||
@@ -15,8 +15,8 @@ var f36Forms = require('@contentful/f36-forms'); | ||
var a__default = /*#__PURE__*/_interopDefaultLegacy(a); | ||
var e__default = /*#__PURE__*/_interopDefaultLegacy(e); | ||
var O=Object.defineProperty;var m=Object.getOwnPropertySymbols;var h=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var b=(t,n,e)=>n in t?O(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,d=(t,n)=>{for(var e in n||(n={}))h.call(n,e)&&b(t,e,n[e]);if(m)for(var e of m(n))C.call(n,e)&&b(t,e,n[e]);return t};var w=(t,n)=>{var e={};for(var o in t)h.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&m)for(var o of m(t))n.indexOf(o)<0&&C.call(t,o)&&(e[o]=t[o]);return e};function l({activePage:t,itemsPerPage:n,totalItems:e=0,pageLength:o,isLastPage:p=!1}){let g=e?`of ${e} items`:"",i=t*n+1;if(p&&o)return [`${i} - ${i-1+o}`,g].join(" ");if(e){let P=Math.min(i-1+n,e);return [`${i} - ${P}`,g].join(" ")}return [`${i} - ${i-1+n}`,g].join(" ")}function L(t,n){let v=t,{className:e,onPageChange:o,testId:p="cf-ui-pagination",activePage:g,itemsPerPage:i=20,pageLength:P,isLastPage:S=!1,activePage:r=0,viewPerPageOptions:$=[20,100],showViewPerPage:k=!1,totalItems:f,onViewPerPageChange:c}=v,j=w(v,["className","onPageChange","testId","activePage","itemsPerPage","pageLength","isLastPage","activePage","viewPerPageOptions","showViewPerPage","totalItems","onViewPerPageChange"]),V=r===0,x=S||f&&(r+1)*i>=f,N=l({totalItems:f,activePage:r,itemsPerPage:i,pageLength:P,isLastPage:x});return a__default["default"].createElement(f36Core.Flex,d({flexDirection:"row",justifyContent:"space-between",fullWidth:!0,className:e,testId:p,ref:n},j),k&&a__default["default"].createElement(f36Core.Stack,null,a__default["default"].createElement(f36Typography.Text,{fontColor:"gray500"},"View"),a__default["default"].createElement(f36Forms.Select,{value:`${i}`,onChange:s=>c&&c(+s.target.value)},$.map(s=>a__default["default"].createElement(f36Forms.Select.Option,{key:s,value:s},s)))),a__default["default"].createElement(f36Core.Stack,{flexGrow:1,justifyContent:"flex-end"},a__default["default"].createElement(f36Typography.Text,{fontColor:"gray500"},N),a__default["default"].createElement(f36Core.Stack,{spacing:"spacingS"},!V&&a__default["default"].createElement(f36Button.Button,{"aria-label":"To previous page",startIcon:a__default["default"].createElement(f36Icons.ChevronLeftIcon,null),variant:"secondary",onClick:()=>o(r-1),testId:"cf-ui-pagination-previous"},"Previous"),!x&&a__default["default"].createElement(f36Button.Button,{"aria-label":"To next page",variant:"secondary",endIcon:a__default["default"].createElement(f36Icons.ChevronRightIcon,null),onClick:()=>o(r+1),testId:"cf-ui-pagination-next"},"Next"))))}L.displayName="Pagination";var M=a__default["default"].forwardRef(L); | ||
function f({activePage:g,itemsPerPage:o,totalItems:n=0,pageLength:a,isLastPage:m=!1}){let s=n?`of ${n} items`:"",t=g*o+1;if(m&&a)return [`${t} - ${t-1+a}`,s].join(" ");if(n){let p=Math.min(t-1+o,n);return [`${t} - ${p}`,s].join(" ")}return [`${t} - ${t-1+o}`,s].join(" ")}function h(g,o){let{className:n,onPageChange:a,testId:m="cf-ui-pagination",activePage:s,itemsPerPage:t=20,pageLength:p,isLastPage:C=!1,activePage:i=0,viewPerPageOptions:d=[20,100],showViewPerPage:w=!1,totalItems:P,onViewPerPageChange:u,...y}=g,I=i===0,c=C||P&&(i+1)*t>=P,T=f({totalItems:P,activePage:i,itemsPerPage:t,pageLength:p,isLastPage:c});return e__default["default"].createElement(f36Core.Flex,{flexDirection:"row",justifyContent:"space-between",fullWidth:!0,className:n,testId:m,ref:o,...y},w&&e__default["default"].createElement(f36Core.Stack,null,e__default["default"].createElement(f36Typography.Text,{fontColor:"gray500"},"View"),e__default["default"].createElement(f36Forms.Select,{value:`${t}`,onChange:r=>u&&u(+r.target.value)},d.map(r=>e__default["default"].createElement(f36Forms.Select.Option,{key:r,value:r},r)))),e__default["default"].createElement(f36Core.Stack,{flexGrow:1,justifyContent:"flex-end"},e__default["default"].createElement(f36Typography.Text,{fontColor:"gray500"},T),e__default["default"].createElement(f36Core.Stack,{spacing:"spacingS"},!I&&e__default["default"].createElement(f36Button.Button,{"aria-label":"To previous page",startIcon:e__default["default"].createElement(f36Icons.ChevronLeftIcon,null),variant:"secondary",onClick:()=>a(i-1),testId:"cf-ui-pagination-previous"},"Previous"),!c&&e__default["default"].createElement(f36Button.Button,{"aria-label":"To next page",variant:"secondary",endIcon:e__default["default"].createElement(f36Icons.ChevronRightIcon,null),onClick:()=>a(i+1),testId:"cf-ui-pagination-next"},"Next"))))}h.displayName="Pagination";var k=e__default["default"].forwardRef(h); | ||
exports.Pagination = M; | ||
exports.getRangeText = l; | ||
exports.Pagination = k; | ||
exports.getRangeText = f; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@contentful/f36-pagination", | ||
"version": "4.19.0", | ||
"version": "4.19.1", | ||
"description": "Forma 36: Pagination component", | ||
@@ -10,8 +10,8 @@ "scripts": { | ||
"@babel/runtime": "^7.6.2", | ||
"@contentful/f36-button": "^4.19.0", | ||
"@contentful/f36-core": "^4.19.0", | ||
"@contentful/f36-forms": "^4.19.0", | ||
"@contentful/f36-icons": "^4.19.0", | ||
"@contentful/f36-button": "^4.19.1", | ||
"@contentful/f36-core": "^4.19.1", | ||
"@contentful/f36-forms": "^4.19.1", | ||
"@contentful/f36-icons": "^4.19.1", | ||
"@contentful/f36-tokens": "^4.0.0", | ||
"@contentful/f36-typography": "^4.19.0", | ||
"@contentful/f36-typography": "^4.19.1", | ||
"emotion": "^10.0.17" | ||
@@ -27,3 +27,3 @@ }, | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"module": "dist/esm/index.js", | ||
"types": "dist/index.d.ts", | ||
@@ -30,0 +30,0 @@ "source": "src/index.ts", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32108
90