@everymatrix/bonus-pagination-nav 1.31.2 → 1.32.4
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/LICENSE +21 -0
- package/package.json +3 -2
- package/dist/bonus-pagination-nav/bonus-pagination-nav.esm.js +0 -1
- package/dist/bonus-pagination-nav/index.esm.js +0 -0
- package/dist/bonus-pagination-nav/p-06373b64.js +0 -1
- package/dist/bonus-pagination-nav/p-fc173a41.entry.js +0 -1
- package/dist/cjs/bonus-pagination-nav.cjs.entry.js +0 -188
- package/dist/cjs/bonus-pagination-nav.cjs.js +0 -19
- package/dist/cjs/index-fb15607a.js +0 -1189
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +0 -21
- package/dist/collection/collection-manifest.json +0 -12
- package/dist/collection/components/bonus-pagination-nav/bonus-pagination-nav.css +0 -51
- package/dist/collection/components/bonus-pagination-nav/bonus-pagination-nav.js +0 -359
- package/dist/collection/index.js +0 -1
- package/dist/collection/utils/locale.utils.js +0 -65
- package/dist/components/bonus-pagination-nav.d.ts +0 -11
- package/dist/components/bonus-pagination-nav.js +0 -215
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/esm/bonus-pagination-nav.entry.js +0 -184
- package/dist/esm/bonus-pagination-nav.js +0 -17
- package/dist/esm/index-7299a1fa.js +0 -1163
- package/dist/esm/index.js +0 -1
- package/dist/esm/loader.js +0 -17
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/stencil.config.js +0 -24
- package/dist/types/Users/dragos.bodea/Documents/everymatrix-prjs/emfe-widgets/widgets-stencil/packages/bonus-pagination-nav/.stencil/packages/bonus-pagination-nav/stencil.config.d.ts +0 -2
- package/dist/types/components/bonus-pagination-nav/bonus-pagination-nav.d.ts +0 -55
- package/dist/types/components.d.ts +0 -118
- package/dist/types/index.d.ts +0 -1
- package/dist/types/stencil-public-runtime.d.ts +0 -1565
- package/dist/types/utils/locale.utils.d.ts +0 -17
- package/loader/cdn.js +0 -3
- package/loader/index.cjs.js +0 -3
- package/loader/index.d.ts +0 -12
- package/loader/index.es2017.js +0 -3
- package/loader/index.js +0 -4
- package/loader/package.json +0 -10
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/bonus-pagination-nav",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.4",
|
|
4
4
|
"main": "./dist/index.cjs.js",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"es2015": "./dist/esm/index.mjs",
|
|
@@ -15,5 +15,6 @@
|
|
|
15
15
|
],
|
|
16
16
|
"publishConfig": {
|
|
17
17
|
"access": "public"
|
|
18
|
-
}
|
|
18
|
+
},
|
|
19
|
+
"gitHead": "69a4e0bb1b0460c07baef352d283492a6e2dc4b0"
|
|
19
20
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as a,b as e}from"./p-06373b64.js";(()=>{const e=import.meta.url,r={};return""!==e&&(r.resourcesUrl=new URL(".",e).href),a(r)})().then((a=>e([["p-fc173a41",[[0,"bonus-pagination-nav",{total:[1538],limit:[1538],offset:[1538],tableId:[1537,"table-id"],language:[1537],translationUrl:[513,"translation-url"],arrowsActive:[1540,"arrows-active"],secondaryArrowsActive:[1540,"secondary-arrows-active"],displayPageNumbers:[1540,"display-page-numbers"],displayRangeOfTotal:[1540,"display-range-of-total"],endPageIndex:[32],pagesArray:[32],currentPage:[32]},[[8,"paginationReset","pageLimitChangedHandler"],[8,"pageLimitChanged","pageLimitChangedHandler"]]]]]],a)));
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e=!1;const t="undefined"!=typeof window?window:{},n=t.document||{head:{}},l={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},s=e=>Promise.resolve(e),o=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),c=(e,t,n)=>{n&&n.map((([n,s,o])=>{const c=r(e,n),u=i(t,o),f=a(n);l.ael(c,s,u,f),(t.o=t.o||[]).push((()=>l.rel(c,s,u,f)))}))},i=(e,t)=>n=>{try{256&e.t?e.i[t](n):(e.u=e.u||[]).push([t,n])}catch(e){D(e)}},r=(e,n)=>8&n?t:e,a=e=>0!=(2&e),u=new WeakMap,f=e=>"sc-"+e.$,$={},h=e=>"object"==(e=typeof e)||"function"===e,y=(e,t,...n)=>{let l=null,s=!1,o=!1,c=[];const i=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!h(l))&&(l+=""),s&&o?c[c.length-1].h+=l:c.push(s?d(null,l):l),o=s)};if(i(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const r=d(e,null);return r.p=t,c.length>0&&(r.m=c),r},d=(e,t)=>({t:0,S:e,h:t,g:null,m:null,p:null}),p={},m=(e,n,s,o,c,i)=>{if(s!==o){let r=B(e,n),a=n.toLowerCase();if("class"===n){const t=e.classList,n=w(s),l=w(o);t.remove(...n.filter((e=>e&&!l.includes(e)))),t.add(...l.filter((e=>e&&!n.includes(e))))}else if(r||"o"!==n[0]||"n"!==n[1]){const t=h(o);if((r||t&&null!==o)&&!c)try{if(e.tagName.includes("-"))e[n]=o;else{let t=null==o?"":o;"list"===n?r=!1:null!=s&&e[n]==t||(e[n]=t)}}catch(e){}null==o||!1===o?!1===o&&""!==e.getAttribute(n)||e.removeAttribute(n):(!r||4&i||c)&&!t&&e.setAttribute(n,o=!0===o?"":o)}else n="-"===n[2]?n.slice(3):B(t,a)?a.slice(2):a[2]+n.slice(3),s&&l.rel(e,n,s,!1),o&&l.ael(e,n,o,!1)}},b=/\s/,w=e=>e?e.split(b):[],S=(e,t,n,l)=>{const s=11===t.g.nodeType&&t.g.host?t.g.host:t.g,o=e&&e.p||$,c=t.p||$;for(l in o)l in c||m(s,l,o[l],void 0,n,t.t);for(l in c)m(s,l,o[l],c[l],n,t.t)},g=(e,t,l)=>{let s,o,c=t.m[l],i=0;if(null!==c.h)s=c.g=n.createTextNode(c.h);else if(s=c.g=n.createElement(c.S),S(null,c,!1),c.m)for(i=0;i<c.m.length;++i)o=g(e,c,i),o&&s.appendChild(o);return s},j=(e,t,n,l,s,o)=>{let c,i=e;for(;s<=o;++s)l[s]&&(c=g(null,n,s),c&&(l[s].g=c,i.insertBefore(c,t)))},v=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.g.remove()},M=(e,t)=>e.S===t.S,k=(e,t)=>{const n=t.g=e.g,l=e.m,s=t.m,o=t.h;null===o?(S(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,c=0,i=t.length-1,r=t[0],a=t[i],u=l.length-1,f=l[0],$=l[u];for(;o<=i&&c<=u;)null==r?r=t[++o]:null==a?a=t[--i]:null==f?f=l[++c]:null==$?$=l[--u]:M(r,f)?(k(r,f),r=t[++o],f=l[++c]):M(a,$)?(k(a,$),a=t[--i],$=l[--u]):M(r,$)?(k(r,$),e.insertBefore(r.g,a.g.nextSibling),r=t[++o],$=l[--u]):M(a,f)?(k(a,f),e.insertBefore(a.g,r.g),a=t[--i],f=l[++c]):(s=g(t&&t[c],n,c),f=l[++c],s&&r.g.parentNode.insertBefore(s,r.g));o>i?j(e,null==l[u+1]?null:l[u+1].g,n,l,c,u):c>u&&v(t,o,i)})(n,l,t,s):null!==s?(null!==e.h&&(n.textContent=""),j(n,null,t,s,0,s.length-1)):null!==l&&v(l,0,l.length-1)):e.h!==o&&(n.data=o)},C=(e,t,n)=>{const l=(e=>V(e).j)(e);return{emit:e=>O(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},O=(e,t,n)=>{const s=l.ce(t,n);return e.dispatchEvent(s),s},P=(e,t)=>{t&&!e.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.v=t)))},x=(e,t)=>{if(e.t|=16,!(4&e.t))return P(e,e.M),te((()=>E(e,t)));e.t|=512},E=(e,t)=>{const n=e.i;let l;return t&&(e.t|=256,e.u&&(e.u.map((([e,t])=>A(n,e,t))),e.u=null)),l=F(l,(()=>A(n,"componentWillRender"))),F(l,(()=>N(e,n,t)))},N=async(e,t,l)=>{const s=e.j,o=s["s-rc"];l&&(e=>{const t=e.k;((e,t)=>{let l=f(t),s=J.get(l);if(e=11===e.nodeType?e:n,s)if("string"==typeof s){let t,o=u.get(e=e.head||e);o||u.set(e,o=new Set),o.has(l)||(t=n.createElement("style"),t.innerHTML=s,e.insertBefore(t,e.querySelector("link")),o&&o.add(l))}else e.adoptedStyleSheets.includes(s)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,s])})(e.j.getRootNode(),t)})(e);R(e,t),o&&(o.map((e=>e())),s["s-rc"]=void 0);{const t=s["s-p"],n=()=>T(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},R=(e,t)=>{try{t=t.render(),e.t&=-17,e.t|=2,((e,t)=>{const n=e.j,l=e.k,s=e.C||d(null,null),o=(e=>e&&e.S===p)(t)?t:y(null,null,t);l.O&&(o.p=o.p||{},l.O.map((([e,t])=>o.p[t]=n[e]))),o.S=null,o.t|=4,e.C=o,o.g=s.g=n,k(s,o)})(e,t)}catch(t){D(t,e.j)}return null},T=e=>{const t=e.j,n=e.M;64&e.t||(e.t|=64,L(t),e.P(t),n||W()),e.v&&(e.v(),e.v=void 0),512&e.t&&ee((()=>x(e,!1))),e.t&=-517},W=()=>{L(n.documentElement),ee((()=>O(t,"appload",{detail:{namespace:"bonus-pagination-nav"}})))},A=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){D(e)}},F=(e,t)=>e&&e.then?e.then(t):t(),L=e=>e.classList.add("hydrated"),U=(e,t,n)=>{if(t.N){const s=Object.entries(t.N),o=e.prototype;if(s.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(o,e,{get(){return((e,t)=>V(this).R.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=V(e),o=s.R.get(t),c=s.t,i=s.i;n=((e,t)=>null==e||h(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.N[t][0]),8&c&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(s.R.set(t,n),i&&2==(18&c)&&x(s,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;o.attributeChangedCallback=function(e,t,s){l.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))s=this[t],delete this[t];else if(o.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==s)return;this[t]=(null!==s||"boolean"!=typeof this[t])&&s}))},e.observedAttributes=s.filter((([e,t])=>15&t[0])).map((([e,l])=>{const s=l[1]||e;return n.set(s,e),512&l[0]&&t.O.push([e,s]),s}))}}return e},q=(e,s={})=>{const i=[],r=s.exclude||[],a=t.customElements,u=n.head,$=u.querySelector("meta[charset]"),h=n.createElement("style"),y=[];let d,p=!0;Object.assign(l,s),l.l=new URL(s.resourcesUrl||"./",n.baseURI).href,e.map((e=>{e[1].map((t=>{const n={t:t[0],$:t[1],N:t[2],T:t[3]};n.N=t[2],n.T=t[3],n.O=[];const s=n.$,u=class extends HTMLElement{constructor(e){super(e),z(e=this,n)}connectedCallback(){d&&(clearTimeout(d),d=null),p?y.push(this):l.jmp((()=>(e=>{if(0==(1&l.t)){const t=V(e),n=t.k,l=()=>{};if(1&t.t)c(e,t,n.T);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){P(t,t.M=n);break}}n.N&&Object.entries(n.N).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=I(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(U(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){D(e)}t.t&=-9,e()}if(s.style){let e=s.style;const t=f(n);if(!J.has(t)){const l=()=>{};((e,t,n)=>{let l=J.get(e);o&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,J.set(e,l)})(t,e,!!(1&n.t)),l()}}}const c=t.M,i=()=>x(t,!0);c&&c["s-rc"]?c["s-rc"].push(i):i()})(0,t,n)}l()}})(this)))}disconnectedCallback(){l.jmp((()=>(()=>{if(0==(1&l.t)){const e=V(this);e.o&&(e.o.map((e=>e())),e.o=void 0)}})()))}componentOnReady(){return V(this).W}};n.A=e[0],r.includes(s)||a.get(s)||(i.push(s),a.define(s,U(u,n,1)))}))})),h.innerHTML=i+"{visibility:hidden}.hydrated{visibility:inherit}",h.setAttribute("data-styles",""),u.insertBefore(h,$?$.nextSibling:u.firstChild),p=!1,y.length?y.map((e=>e.connectedCallback())):l.jmp((()=>d=setTimeout(W,30)))},H=new WeakMap,V=e=>H.get(e),_=(e,t)=>H.set(t.i=e,t),z=(e,t)=>{const n={t:0,j:e,k:t,R:new Map};return n.W=new Promise((e=>n.P=e)),e["s-p"]=[],e["s-rc"]=[],c(e,n,t.T),H.set(e,n)},B=(e,t)=>t in e,D=(e,t)=>(0,console.error)(e,t),G=new Map,I=e=>{const t=e.$.replace(/-/g,"_"),n=e.A,l=G.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(G.set(n,e),e[t])),D)},J=new Map,K=[],Q=[],X=(t,n)=>s=>{t.push(s),e||(e=!0,n&&4&l.t?ee(Z):l.raf(Z))},Y=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){D(e)}e.length=0},Z=()=>{Y(K),Y(Q),(e=K.length>0)&&l.raf(Z)},ee=e=>s().then(e),te=X(Q,!0);export{q as b,C as c,y as h,s as p,_ as r}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as a}from"./p-06373b64.js";const s=["pt-br","en","es-mx","hu","hr"],e={en:{firstPage:"|<",lastPage:">|",prePage:"<",nextPage:">",pageOfTotal:"{start}-{end} of {total}"},hu:{firstPage:"First",lastPage:"Last",prePage:"<",nextPage:">",pageOfTotal:"{start}-{end} of {total}"},hr:{firstPage:"First",lastPage:"Last",prePage:"<",nextPage:">",pageOfTotal:"{start}-{end} of {total}"},"pt-br":{firstPage:"First",lastPage:"Last",prePage:"<",nextPage:">",pageOfTotal:"{start}-{end} of {total}"},"es-mx":{firstPage:"First",lastPage:"Last",prePage:"<",nextPage:">",pageOfTotal:"{start}-{end} of {total}"}},r=(t,i,a)=>{const r=i;let h=e[void 0!==r&&s.includes(r)?r:"en"][t];if(void 0!==a)for(const[t,i]of Object.entries(a.values)){const a=new RegExp(`{${t}}`,"g");h=h.replace(a,i)}return h},h=class{constructor(a){t(this,a),this.reloadPageEmitter=i(this,"reloadPageByType",7),this.total=1,this.limit=10,this.offset=0,this.tableId="default",this.language="en",this.translationUrl="",this.arrowsActive=!0,this.secondaryArrowsActive=!0,this.displayPageNumbers=!0,this.endPageIndex=0,this.currentPage=1}pageLimitChangedHandler(t){this.limit=t.detail.limit?t.detail.limit:this.limit,this.currentPage=1,this.offset=0,this.updatePageStatus(),"pageLimitChanged"==t.type&&this.reloadPageEmitter.emit({offset:0,limit:this.limit,tableId:this.tableId})}goTo(t){"..."==t||0==t||t>this.endPageIndex+1||(this.currentPage=t,this.reloadPageEmitter.emit({offset:(this.currentPage-1)*this.limit,limit:this.limit,tableId:this.tableId}))}renderPageList(){return a("ul",{class:"PaginationArea"},this.pagesArray.map((t=>a("li",{class:"PageItem "+(this.currentPage==t?"Active":""),onClick:()=>{this.goTo(t)}},t))))}renderStylingWrapper(){return a("general-styling-wrapper",{targetTranslations:e,translationUrl:this.translationUrl})}updatePageStatus(){this.endPageIndex=Math.ceil(this.total/this.limit)-1,this.endPageIndex=this.endPageIndex<0?this.endPageIndex=0:this.endPageIndex,this.pagesArray=[],this.endPageIndex<5?this.pagesArray=Array.from({length:this.endPageIndex+1},((t,i)=>i+1)):1==this.currentPage||2==this.currentPage?(this.pagesArray=Array.from({length:4},((t,i)=>i+1)),this.pagesArray.push("...")):this.currentPage>=3&&this.endPageIndex-this.currentPage>=2?(this.pagesArray=Array.from({length:3},((t,i)=>this.currentPage+i-1)),this.pagesArray.push("..."),this.pagesArray.unshift("...")):this.endPageIndex-this.currentPage<3&&(this.pagesArray=Array.from({length:4},((t,i)=>this.endPageIndex-2+i)),this.pagesArray.unshift("..."))}componentWillRender(){this.currentPage=Math.floor(this.offset/this.limit)+1,this.updatePageStatus()}render(){return a("div",{class:"PageNavigationWrapper"},this.displayRangeOfTotal&&this.total>0&&a("span",{class:"PageOfMessage"},r("pageOfTotal",this.language,{values:{start:(this.currentPage-1)*this.limit+1,end:this.currentPage*this.limit>this.total?this.total:this.currentPage*this.limit,total:this.total}})),a("div",{class:"PageNavigation"},this.arrowsActive&&a("div",{class:"PageArrow FirstPage "+(1==this.currentPage?"Disabled":""),onClick:()=>{this.goTo(1)}},r("firstPage",this.language)),this.secondaryArrowsActive&&a("span",{class:"PageArrow PrePage "+(1==this.currentPage?"Disabled":""),onClick:()=>{this.goTo(this.currentPage-1)}},r("prePage",this.language)),this.displayPageNumbers&&this.renderPageList(),this.secondaryArrowsActive&&a("span",{class:"PageArrow NextPage "+(this.currentPage==this.endPageIndex+1?"Disabled":""),onClick:()=>{this.goTo(this.currentPage+1)}},r("nextPage",this.language)),this.arrowsActive&&a("div",{class:"PageArrow LastPage "+(this.currentPage==this.endPageIndex+1?"Disabled":""),onClick:()=>{this.goTo(this.endPageIndex+1)}}," ",r("lastPage",this.language)," "),this.renderStylingWrapper()))}};h.style=":host{display:block}.PageNavigationWrapper{display:flex;flex-direction:row}.PageNavigationWrapper .PageOfMessage{margin:5px;padding:5px 6px;margin:2px}.PageNavigation{display:flex;flex-direction:row;align-items:center}.PageNavigation .PageArrow{color:var(--emfe-w-color-primary, #777676);padding:6px 5px;cursor:pointer;font-weight:bold;width:1.2rem;text-align:center}.PageNavigation .PageArrow.Disabled{color:var(--emfe-w-color-gray-100, #e0e0e0)}ul.PaginationArea{list-style:none;padding:0px;margin:0px;display:flex}ul.PaginationArea li.PageItem{cursor:pointer;padding:5px 6px;margin:2px;width:0.9rem;text-align:center}ul.PaginationArea li.PageItem.Active,ul.PaginationArea li.PageItem:hover{font-weight:bold;color:var(--emfe-w-color-primary, #f5f1f1);background-color:var(--emfe-w-color-secondary, #8c8989);border-radius:0.3rem}";export{h as bonus_pagination_nav}
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-fb15607a.js');
|
|
6
|
-
|
|
7
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
8
|
-
const SUPPORTED_LANGUAGES = ['pt-br', 'en', 'es-mx', 'hu', 'hr'];
|
|
9
|
-
const TRANSLATIONS = {
|
|
10
|
-
"en": {
|
|
11
|
-
"firstPage": '|<',
|
|
12
|
-
"lastPage": '>|',
|
|
13
|
-
"prePage": '<',
|
|
14
|
-
"nextPage": '>',
|
|
15
|
-
"pageOfTotal": '{start}-{end} of {total}',
|
|
16
|
-
},
|
|
17
|
-
"hu": {
|
|
18
|
-
"firstPage": 'First',
|
|
19
|
-
"lastPage": 'Last',
|
|
20
|
-
"prePage": '<',
|
|
21
|
-
"nextPage": '>',
|
|
22
|
-
"pageOfTotal": '{start}-{end} of {total}',
|
|
23
|
-
},
|
|
24
|
-
"hr": {
|
|
25
|
-
"firstPage": 'First',
|
|
26
|
-
"lastPage": 'Last',
|
|
27
|
-
"prePage": '<',
|
|
28
|
-
"nextPage": '>',
|
|
29
|
-
"pageOfTotal": '{start}-{end} of {total}',
|
|
30
|
-
},
|
|
31
|
-
"pt-br": {
|
|
32
|
-
"firstPage": 'First',
|
|
33
|
-
"lastPage": 'Last',
|
|
34
|
-
"prePage": '<',
|
|
35
|
-
"nextPage": '>',
|
|
36
|
-
"pageOfTotal": '{start}-{end} of {total}',
|
|
37
|
-
},
|
|
38
|
-
"es-mx": {
|
|
39
|
-
"firstPage": 'First',
|
|
40
|
-
"lastPage": 'Last',
|
|
41
|
-
"prePage": '<',
|
|
42
|
-
"nextPage": '>',
|
|
43
|
-
"pageOfTotal": '{start}-{end} of {total}',
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
const translate = (key, customLang, values) => {
|
|
47
|
-
const lang = customLang;
|
|
48
|
-
let translation = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
49
|
-
if (values !== undefined) {
|
|
50
|
-
for (const [key, value] of Object.entries(values.values)) {
|
|
51
|
-
const regex = new RegExp(`{${key}}`, 'g');
|
|
52
|
-
translation = translation.replace(regex, value);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return translation;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const bonusPaginationNavCss = ":host{display:block}.PageNavigationWrapper{display:flex;flex-direction:row}.PageNavigationWrapper .PageOfMessage{margin:5px;padding:5px 6px;margin:2px}.PageNavigation{display:flex;flex-direction:row;align-items:center}.PageNavigation .PageArrow{color:var(--emfe-w-color-primary, #777676);padding:6px 5px;cursor:pointer;font-weight:bold;width:1.2rem;text-align:center}.PageNavigation .PageArrow.Disabled{color:var(--emfe-w-color-gray-100, #e0e0e0)}ul.PaginationArea{list-style:none;padding:0px;margin:0px;display:flex}ul.PaginationArea li.PageItem{cursor:pointer;padding:5px 6px;margin:2px;width:0.9rem;text-align:center}ul.PaginationArea li.PageItem.Active,ul.PaginationArea li.PageItem:hover{font-weight:bold;color:var(--emfe-w-color-primary, #f5f1f1);background-color:var(--emfe-w-color-secondary, #8c8989);border-radius:0.3rem}";
|
|
59
|
-
|
|
60
|
-
const BonusPaginationNav = class {
|
|
61
|
-
constructor(hostRef) {
|
|
62
|
-
index.registerInstance(this, hostRef);
|
|
63
|
-
this.reloadPageEmitter = index.createEvent(this, "reloadPageByType", 7);
|
|
64
|
-
/**
|
|
65
|
-
* The received length of dataset
|
|
66
|
-
*/
|
|
67
|
-
this.total = 1;
|
|
68
|
-
/**
|
|
69
|
-
* The received limit for the number of pages
|
|
70
|
-
*/
|
|
71
|
-
this.limit = 10;
|
|
72
|
-
/**
|
|
73
|
-
* The offset of dataset
|
|
74
|
-
*/
|
|
75
|
-
this.offset = 0;
|
|
76
|
-
/**
|
|
77
|
-
* The table id, use to identify which table listen the page change message
|
|
78
|
-
* when there is more than 1 table on same page
|
|
79
|
-
*/
|
|
80
|
-
this.tableId = 'default';
|
|
81
|
-
/**
|
|
82
|
-
* Language
|
|
83
|
-
*/
|
|
84
|
-
this.language = 'en';
|
|
85
|
-
/**
|
|
86
|
-
* Translation via url
|
|
87
|
-
*/
|
|
88
|
-
this.translationUrl = '';
|
|
89
|
-
/**
|
|
90
|
-
* Customize pagination: Activate pagination arrows
|
|
91
|
-
*/
|
|
92
|
-
this.arrowsActive = true;
|
|
93
|
-
/**
|
|
94
|
-
* Customize pagination: Activate pagination secondary arrows
|
|
95
|
-
*/
|
|
96
|
-
this.secondaryArrowsActive = true;
|
|
97
|
-
/**
|
|
98
|
-
* Customize pagination: Activate pagination numbered navigation
|
|
99
|
-
*/
|
|
100
|
-
this.displayPageNumbers = true;
|
|
101
|
-
this.endPageIndex = 0;
|
|
102
|
-
this.currentPage = 1;
|
|
103
|
-
}
|
|
104
|
-
pageLimitChangedHandler(event) {
|
|
105
|
-
this.limit = event.detail.limit ? event.detail.limit : this.limit;
|
|
106
|
-
//reset offset = 0, this.currentPage = 1 when page limit changed
|
|
107
|
-
this.currentPage = 1;
|
|
108
|
-
this.offset = 0;
|
|
109
|
-
this.updatePageStatus();
|
|
110
|
-
if (event.type == 'pageLimitChanged') {
|
|
111
|
-
this.reloadPageEmitter.emit({ offset: 0, limit: this.limit, tableId: this.tableId });
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
goTo(step) {
|
|
115
|
-
if (step == '...' || step == 0 || step > this.endPageIndex + 1) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
this.currentPage = step;
|
|
119
|
-
let offset = (this.currentPage - 1) * this.limit;
|
|
120
|
-
this.reloadPageEmitter.emit({ offset, limit: this.limit, tableId: this.tableId });
|
|
121
|
-
}
|
|
122
|
-
renderPageList() {
|
|
123
|
-
return index.h("ul", { class: 'PaginationArea' }, this.pagesArray.map((page) => {
|
|
124
|
-
return (index.h("li", { class: `PageItem ${this.currentPage == page ? 'Active' : ''}`, onClick: () => {
|
|
125
|
-
this.goTo(page);
|
|
126
|
-
} }, page));
|
|
127
|
-
}));
|
|
128
|
-
}
|
|
129
|
-
renderStylingWrapper() {
|
|
130
|
-
return index.h("general-styling-wrapper", { targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl });
|
|
131
|
-
}
|
|
132
|
-
updatePageStatus() {
|
|
133
|
-
this.endPageIndex = (Math.ceil(this.total / this.limit) - 1);
|
|
134
|
-
this.endPageIndex = this.endPageIndex < 0 ? this.endPageIndex = 0 : this.endPageIndex;
|
|
135
|
-
this.pagesArray = [];
|
|
136
|
-
if (this.endPageIndex < 5) {
|
|
137
|
-
this.pagesArray = Array.from({ length: this.endPageIndex + 1 }, (_, i) => i + 1);
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
/**
|
|
141
|
-
* Construct numbered navigation area based on current page position
|
|
142
|
-
*/
|
|
143
|
-
if (this.currentPage == 1 || this.currentPage == 2) {
|
|
144
|
-
this.pagesArray = Array.from({ length: 4 }, (_, i) => i + 1);
|
|
145
|
-
this.pagesArray.push('...');
|
|
146
|
-
}
|
|
147
|
-
else if (this.currentPage >= 3 && ((this.endPageIndex - this.currentPage) >= 2)) {
|
|
148
|
-
this.pagesArray = Array.from({ length: 3 }, (_, i) => this.currentPage + i - 1);
|
|
149
|
-
this.pagesArray.push('...');
|
|
150
|
-
this.pagesArray.unshift('...');
|
|
151
|
-
}
|
|
152
|
-
else if ((this.endPageIndex - this.currentPage) < 3) {
|
|
153
|
-
this.pagesArray = Array.from({ length: 4 }, (_, i) => this.endPageIndex - 2 + i);
|
|
154
|
-
this.pagesArray.unshift('...');
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
componentWillRender() {
|
|
159
|
-
this.currentPage = Math.floor(this.offset / this.limit) + 1;
|
|
160
|
-
this.updatePageStatus();
|
|
161
|
-
}
|
|
162
|
-
render() {
|
|
163
|
-
const startOffset = (this.currentPage - 1) * this.limit + 1;
|
|
164
|
-
const endOffset = this.currentPage * this.limit > this.total ? this.total : this.currentPage * this.limit;
|
|
165
|
-
return index.h("div", { class: 'PageNavigationWrapper' }, this.displayRangeOfTotal && this.total > 0 && index.h("span", { class: 'PageOfMessage' }, translate('pageOfTotal', this.language, {
|
|
166
|
-
values: {
|
|
167
|
-
start: startOffset,
|
|
168
|
-
end: endOffset,
|
|
169
|
-
total: this.total
|
|
170
|
-
}
|
|
171
|
-
})), index.h("div", { class: 'PageNavigation' }, this.arrowsActive &&
|
|
172
|
-
index.h("div", { class: `PageArrow FirstPage ${this.currentPage == 1 ? 'Disabled' : ''}`, onClick: () => {
|
|
173
|
-
this.goTo(1);
|
|
174
|
-
} }, translate('firstPage', this.language)), this.secondaryArrowsActive &&
|
|
175
|
-
index.h("span", { class: `PageArrow PrePage ${this.currentPage == 1 ? 'Disabled' : ''}`, onClick: () => {
|
|
176
|
-
this.goTo(this.currentPage - 1);
|
|
177
|
-
} }, translate('prePage', this.language)), this.displayPageNumbers && this.renderPageList(), this.secondaryArrowsActive &&
|
|
178
|
-
index.h("span", { class: `PageArrow NextPage ${this.currentPage == (this.endPageIndex + 1) ? 'Disabled' : ''}`, onClick: () => {
|
|
179
|
-
this.goTo(this.currentPage + 1);
|
|
180
|
-
} }, translate('nextPage', this.language)), this.arrowsActive &&
|
|
181
|
-
index.h("div", { class: `PageArrow LastPage ${this.currentPage == this.endPageIndex + 1 ? 'Disabled' : ''}`, onClick: () => {
|
|
182
|
-
this.goTo(this.endPageIndex + 1);
|
|
183
|
-
} }, " ", translate('lastPage', this.language), " "), this.renderStylingWrapper()));
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
BonusPaginationNav.style = bonusPaginationNavCss;
|
|
187
|
-
|
|
188
|
-
exports.bonus_pagination_nav = BonusPaginationNav;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index-fb15607a.js');
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
7
|
-
*/
|
|
8
|
-
const patchBrowser = () => {
|
|
9
|
-
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('bonus-pagination-nav.cjs.js', document.baseURI).href));
|
|
10
|
-
const opts = {};
|
|
11
|
-
if (importMeta !== '') {
|
|
12
|
-
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
13
|
-
}
|
|
14
|
-
return index.promiseResolve(opts);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["bonus-pagination-nav.cjs",[[0,"bonus-pagination-nav",{"total":[1538],"limit":[1538],"offset":[1538],"tableId":[1537,"table-id"],"language":[1537],"translationUrl":[513,"translation-url"],"arrowsActive":[1540,"arrows-active"],"secondaryArrowsActive":[1540,"secondary-arrows-active"],"displayPageNumbers":[1540,"display-page-numbers"],"displayRangeOfTotal":[1540,"display-range-of-total"],"endPageIndex":[32],"pagesArray":[32],"currentPage":[32]},[[8,"paginationReset","pageLimitChangedHandler"],[8,"pageLimitChanged","pageLimitChangedHandler"]]]]]], options);
|
|
19
|
-
});
|