@everymatrix/bonus-pagination-nav 1.66.1 → 1.67.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.
@@ -0,0 +1 @@
1
+ import{r as t,c as e,h as a}from"./index-9c2a4b03.js";const i=["pt-br","en","es-mx","hu","hr"],s={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,e,a)=>{const r=e;let h=s[void 0!==r&&i.includes(r)?r:"en"][t];if(void 0!==a)for(const[t,e]of Object.entries(a.values)){const a=new RegExp(`{${t}}`,"g");h=h.replace(a,e)}return h},h=class{constructor(a){t(this,a),this.reloadPageEmitter=e(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.displayRangeOfTotal=void 0,this.navItemAccount=5,this.endPageIndex=0,this.pagesArray=void 0,this.currentPage=1,this.showAsEllipsisMid=!this.arrowsActive}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||parseInt(t.toString(),10)>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:s,translationUrl:this.translationUrl})}generateNavItemsByType(t,e){if(this.endPageIndex<t)return Array.from({length:this.endPageIndex+1},((t,e)=>e+1));let a=[],i=Math.floor(t/2);const s=this.endPageIndex+1;return e?this.currentPage<i||this.currentPage>s-i+1?(a=Array.from({length:i},((t,e)=>e+1)),a.push("..."),a=a.concat(Array.from({length:i},((t,e)=>this.endPageIndex-1+e)))):this.currentPage==i?(a=Array.from({length:i+1},((t,e)=>e+1)),a.push("..."),a=a.concat(Array.from({length:i-1},((t,e)=>this.endPageIndex+e)))):this.currentPage==s-i+1?(a=Array.from({length:i-1},((t,e)=>e+1)),a.push("..."),a=a.concat(Array.from({length:i+1},((t,e)=>this.endPageIndex-2+e)))):(a=[1,"..."],a=a.concat([this.currentPage-1],[this.currentPage],[this.currentPage+1]),a=a.concat(["...",s])):this.currentPage<i-1?(a=Array.from({length:t-1},((t,e)=>e+1)),a.push("...")):this.endPageIndex-this.currentPage<i+1?(a=Array.from({length:t-1},((t,e)=>this.endPageIndex-i+e)),a.unshift("...")):(a=Array.from({length:i+1},((t,e)=>this.currentPage+e-1)),a.push("..."),a.unshift("...")),a}updatePageStatus(){this.endPageIndex=Math.ceil(this.total/this.limit)-1,this.endPageIndex=this.endPageIndex<0?this.endPageIndex=0:this.endPageIndex,this.pagesArray=this.generateNavItemsByType(this.navItemAccount,this.showAsEllipsisMid)}componentWillRender(){this.currentPage=Math.floor(this.offset/this.limit)+1,this.updatePageStatus()}render(){return a("div",{key:"aa8d14788833b1b0e13ea20943935b03a3b043ac",class:"PageNavigationWrapper"},this.displayRangeOfTotal&&this.total>0&&a("span",{key:"a018261b6c598116829d878b8120aee7ae2576c4",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",{key:"64fc17d0b992b30a4b8d712e47442ee6a2d44b82",class:"PageNavigation"},this.arrowsActive&&a("div",{key:"f5f3b562fbdfb9e4b39ffd9755e5dba41e6231ba",class:"PageArrow FirstPage "+(1==this.currentPage?"Disabled":""),onClick:()=>{this.goTo(1)}},r("firstPage",this.language)),this.secondaryArrowsActive&&a("span",{key:"39222e258f6c63502bfd3914c673d804edc96b53",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",{key:"d6f9a1394debdae49702713ccc59bea710ccd7ae",class:"PageArrow NextPage "+(this.currentPage==this.endPageIndex+1?"Disabled":""),onClick:()=>{this.goTo(this.currentPage+1)}},r("nextPage",this.language)),this.arrowsActive&&a("div",{key:"d2bb76f9d40fcfc3dbc6bb5fbfe6d237e77f0ee6",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;height:100%;align-content:center}.PageNavigationWrapper .PageOfMessage{margin:5px;padding:5px 6px;margin:2px}.PageNavigation{display:flex;flex-direction:row;align-items:center}.PageNavigation .PageArrow{color:var(--emw--color-primary, #777676);padding:6px 5px;cursor:pointer;font-weight:bold;width:1.2rem;text-align:center}.PageNavigation .PageArrow.Disabled{color:var(--emw--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(--emw--color-primary, #f5f1f1);background-color:var(--emw--color-secondary, #8c8989);border-radius:0.3rem}";export{h as bonus_pagination_nav}
@@ -1 +1 @@
1
- import{p as a,b as e}from"./p-206f54f8.js";export{s as setNonce}from"./p-206f54f8.js";import{g as t}from"./p-e1255160.js";(()=>{const e=import.meta.url,t={};return""!==e&&(t.resourcesUrl=new URL(".",e).href),a(t)})().then((async a=>(await t(),e([["p-d29d4ec0",[[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"],navItemAccount:[1538,"nav-item-account"],endPageIndex:[32],pagesArray:[32],currentPage:[32],showAsEllipsisMid:[32]},[[8,"paginationReset","pageLimitChangedHandler"],[8,"pageLimitChanged","pageLimitChangedHandler"]]]]]],a))));
1
+ import{p as a,b as e}from"./index-9c2a4b03.js";export{s as setNonce}from"./index-9c2a4b03.js";import{g as n}from"./app-globals-0f993ce5.js";(()=>{const e=import.meta.url,n={};return""!==e&&(n.resourcesUrl=new URL(".",e).href),a(n)})().then((async a=>(await n(),e([["bonus-pagination-nav",[[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"],navItemAccount:[1538,"nav-item-account"],endPageIndex:[32],pagesArray:[32],currentPage:[32],showAsEllipsisMid:[32]},[[8,"paginationReset","pageLimitChangedHandler"],[8,"pageLimitChanged","pageLimitChangedHandler"]]]]]],a))));
@@ -5,6 +5,7 @@ export const config = {
5
5
  taskQueue: 'async',
6
6
  sourceMap: false,
7
7
  minifyJs: true,
8
+ hashFileNames: false,
8
9
  extras: {
9
10
  experimentalImportInjection: true
10
11
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/bonus-pagination-nav",
3
- "version": "1.66.1",
3
+ "version": "1.67.0",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
1
- import{r as t,c as e,h as a}from"./p-206f54f8.js";const i=["pt-br","en","es-mx","hu","hr"],s={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,e,a)=>{const r=e;let h=s[void 0!==r&&i.includes(r)?r:"en"][t];if(void 0!==a)for(const[t,e]of Object.entries(a.values)){const a=new RegExp(`{${t}}`,"g");h=h.replace(a,e)}return h},h=class{constructor(a){t(this,a),this.reloadPageEmitter=e(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.displayRangeOfTotal=void 0,this.navItemAccount=5,this.endPageIndex=0,this.pagesArray=void 0,this.currentPage=1,this.showAsEllipsisMid=!this.arrowsActive}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||parseInt(t.toString(),10)>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:s,translationUrl:this.translationUrl})}generateNavItemsByType(t,e){if(this.endPageIndex<t)return Array.from({length:this.endPageIndex+1},((t,e)=>e+1));let a=[],i=Math.floor(t/2);const s=this.endPageIndex+1;return e?this.currentPage<i||this.currentPage>s-i+1?(a=Array.from({length:i},((t,e)=>e+1)),a.push("..."),a=a.concat(Array.from({length:i},((t,e)=>this.endPageIndex-1+e)))):this.currentPage==i?(a=Array.from({length:i+1},((t,e)=>e+1)),a.push("..."),a=a.concat(Array.from({length:i-1},((t,e)=>this.endPageIndex+e)))):this.currentPage==s-i+1?(a=Array.from({length:i-1},((t,e)=>e+1)),a.push("..."),a=a.concat(Array.from({length:i+1},((t,e)=>this.endPageIndex-2+e)))):(a=[1,"..."],a=a.concat([this.currentPage-1],[this.currentPage],[this.currentPage+1]),a=a.concat(["...",s])):this.currentPage<i-1?(a=Array.from({length:t-1},((t,e)=>e+1)),a.push("...")):this.endPageIndex-this.currentPage<i+1?(a=Array.from({length:t-1},((t,e)=>this.endPageIndex-i+e)),a.unshift("...")):(a=Array.from({length:i+1},((t,e)=>this.currentPage+e-1)),a.push("..."),a.unshift("...")),a}updatePageStatus(){this.endPageIndex=Math.ceil(this.total/this.limit)-1,this.endPageIndex=this.endPageIndex<0?this.endPageIndex=0:this.endPageIndex,this.pagesArray=this.generateNavItemsByType(this.navItemAccount,this.showAsEllipsisMid)}componentWillRender(){this.currentPage=Math.floor(this.offset/this.limit)+1,this.updatePageStatus()}render(){return a("div",{key:"aa8d14788833b1b0e13ea20943935b03a3b043ac",class:"PageNavigationWrapper"},this.displayRangeOfTotal&&this.total>0&&a("span",{key:"a018261b6c598116829d878b8120aee7ae2576c4",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",{key:"64fc17d0b992b30a4b8d712e47442ee6a2d44b82",class:"PageNavigation"},this.arrowsActive&&a("div",{key:"f5f3b562fbdfb9e4b39ffd9755e5dba41e6231ba",class:"PageArrow FirstPage "+(1==this.currentPage?"Disabled":""),onClick:()=>{this.goTo(1)}},r("firstPage",this.language)),this.secondaryArrowsActive&&a("span",{key:"39222e258f6c63502bfd3914c673d804edc96b53",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",{key:"d6f9a1394debdae49702713ccc59bea710ccd7ae",class:"PageArrow NextPage "+(this.currentPage==this.endPageIndex+1?"Disabled":""),onClick:()=>{this.goTo(this.currentPage+1)}},r("nextPage",this.language)),this.arrowsActive&&a("div",{key:"d2bb76f9d40fcfc3dbc6bb5fbfe6d237e77f0ee6",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;height:100%;align-content:center}.PageNavigationWrapper .PageOfMessage{margin:5px;padding:5px 6px;margin:2px}.PageNavigation{display:flex;flex-direction:row;align-items:center}.PageNavigation .PageArrow{color:var(--emw--color-primary, #777676);padding:6px 5px;cursor:pointer;font-weight:bold;width:1.2rem;text-align:center}.PageNavigation .PageArrow.Disabled{color:var(--emw--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(--emw--color-primary, #f5f1f1);background-color:var(--emw--color-secondary, #8c8989);border-radius:0.3rem}";export{h as bonus_pagination_nav}