@zanichelli/albe-web-components 3.0.0 → 3.2.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.
- package/dist/cjs/{icons-30810e62.js → icons-9fc3ff30.js} +101 -70
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-app-switcher_12.cjs.entry.js +4 -1
- package/dist/cjs/z-date-picker.cjs.entry.js +104 -4
- package/dist/cjs/z-icon-package.cjs.entry.js +1 -1
- package/dist/cjs/z-navigation-tab-link.cjs.entry.js +1 -1
- package/dist/cjs/z-navigation-tab.cjs.entry.js +1 -1
- package/dist/cjs/z-pagination.cjs.entry.js +229 -0
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/buttons/z-button/index.js +3 -0
- package/dist/collection/components/icons/icons.js +101 -70
- package/dist/collection/components/z-date-picker/index.js +111 -4
- package/dist/collection/components/z-date-picker/styles.css +14 -4
- package/dist/collection/components/z-pagination/index.js +447 -0
- package/dist/collection/components/z-pagination/styles.css +204 -0
- package/dist/collection/{components → deprecated}/pagination/z-pagination-bar/index.js +0 -0
- package/dist/collection/{components → deprecated}/pagination/z-pagination-bar/styles.css +0 -0
- package/dist/collection/{components → deprecated}/pagination/z-pagination-page/index.js +0 -0
- package/dist/collection/{components → deprecated}/pagination/z-pagination-page/styles.css +0 -0
- package/dist/esm/{icons-d8a127bf.js → icons-92a7dcde.js} +101 -70
- package/dist/esm/loader.js +1 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-app-switcher_12.entry.js +4 -1
- package/dist/esm/z-date-picker.entry.js +104 -4
- package/dist/esm/z-icon-package.entry.js +1 -1
- package/dist/esm/z-navigation-tab-link.entry.js +1 -1
- package/dist/esm/z-navigation-tab.entry.js +1 -1
- package/dist/esm/z-pagination.entry.js +225 -0
- package/dist/types/components/buttons/z-button/index.d.ts +1 -0
- package/dist/types/components/icons/icons.d.ts +249 -232
- package/dist/types/components/z-date-picker/index.d.ts +6 -0
- package/dist/types/components/z-pagination/index.d.ts +109 -0
- package/dist/types/components.d.ts +89 -0
- package/dist/types/{components → deprecated}/pagination/z-pagination-bar/index.d.ts +0 -0
- package/dist/types/{components → deprecated}/pagination/z-pagination-page/index.d.ts +0 -0
- package/dist/web-components-library/p-14c9344f.entry.js +1 -0
- package/dist/web-components-library/p-42b0972c.js +1 -0
- package/dist/web-components-library/{p-393c31c0.entry.js → p-56437e20.entry.js} +1 -1
- package/dist/web-components-library/{p-3dba3a83.entry.js → p-bbb0e7a7.entry.js} +2 -2
- package/dist/web-components-library/{p-64b2b415.entry.js → p-d0fea19f.entry.js} +1 -1
- package/dist/web-components-library/p-d3723aa7.entry.js +1 -0
- package/dist/web-components-library/{p-cadcf677.entry.js → p-f3080685.entry.js} +1 -1
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +3 -2
- package/react/components.js.map +1 -1
- package/www/build/p-14c9344f.entry.js +1 -0
- package/www/build/p-42b0972c.js +1 -0
- package/www/build/{p-393c31c0.entry.js → p-56437e20.entry.js} +1 -1
- package/www/build/p-88b56b6e.css +1 -0
- package/www/build/p-9ebf28f8.js +1 -0
- package/www/build/{p-3dba3a83.entry.js → p-bbb0e7a7.entry.js} +2 -2
- package/www/build/{p-64b2b415.entry.js → p-d0fea19f.entry.js} +1 -1
- package/www/build/p-d3723aa7.entry.js +1 -0
- package/www/build/{p-cadcf677.entry.js → p-f3080685.entry.js} +1 -1
- package/www/build/web-components-library.esm.js +1 -1
- package/www/index.html +49 -49
- package/CHANGELOG.md +0 -1629
- package/dist/web-components-library/p-571e9db9.js +0 -1
- package/dist/web-components-library/p-8b62bd85.entry.js +0 -1
- package/src-react/index.ts +0 -1
- package/www/build/p-2e24f261.js +0 -129
- package/www/build/p-571e9db9.js +0 -1
- package/www/build/p-8b62bd85.entry.js +0 -1
- package/www/build/p-fcff1237.css +0 -812
|
@@ -1243,6 +1243,44 @@ export namespace Components {
|
|
|
1243
1243
|
"message"?: string;
|
|
1244
1244
|
"status"?: InputStatusBean;
|
|
1245
1245
|
}
|
|
1246
|
+
interface ZPagination {
|
|
1247
|
+
/**
|
|
1248
|
+
* Current page.
|
|
1249
|
+
*/
|
|
1250
|
+
"currentPage": number;
|
|
1251
|
+
/**
|
|
1252
|
+
* Enable buttons to go to the first and last pages.
|
|
1253
|
+
*/
|
|
1254
|
+
"edges": boolean;
|
|
1255
|
+
/**
|
|
1256
|
+
* Whether to show "go to page" feature.
|
|
1257
|
+
*/
|
|
1258
|
+
"goToPage": boolean;
|
|
1259
|
+
/**
|
|
1260
|
+
* Pagination label placed before the bar.
|
|
1261
|
+
*/
|
|
1262
|
+
"label"?: string;
|
|
1263
|
+
/**
|
|
1264
|
+
* Enable navigation arrows.
|
|
1265
|
+
*/
|
|
1266
|
+
"navArrows": boolean;
|
|
1267
|
+
/**
|
|
1268
|
+
* Number of pages to skip.
|
|
1269
|
+
*/
|
|
1270
|
+
"skip": number;
|
|
1271
|
+
/**
|
|
1272
|
+
* Number of pages to show left/right of the current, before showing "load more" symbol (…).
|
|
1273
|
+
*/
|
|
1274
|
+
"split"?: number;
|
|
1275
|
+
/**
|
|
1276
|
+
* Total number of pages. Required.
|
|
1277
|
+
*/
|
|
1278
|
+
"totalPages": number;
|
|
1279
|
+
/**
|
|
1280
|
+
* Number of pages to show at a time. If not set, all pages will be shown.
|
|
1281
|
+
*/
|
|
1282
|
+
"visiblePages"?: number;
|
|
1283
|
+
}
|
|
1246
1284
|
interface ZPaginationBar {
|
|
1247
1285
|
/**
|
|
1248
1286
|
* current displayed page (mutable)
|
|
@@ -2188,6 +2226,12 @@ declare global {
|
|
|
2188
2226
|
prototype: HTMLZOtpElement;
|
|
2189
2227
|
new (): HTMLZOtpElement;
|
|
2190
2228
|
};
|
|
2229
|
+
interface HTMLZPaginationElement extends Components.ZPagination, HTMLStencilElement {
|
|
2230
|
+
}
|
|
2231
|
+
var HTMLZPaginationElement: {
|
|
2232
|
+
prototype: HTMLZPaginationElement;
|
|
2233
|
+
new (): HTMLZPaginationElement;
|
|
2234
|
+
};
|
|
2191
2235
|
interface HTMLZPaginationBarElement extends Components.ZPaginationBar, HTMLStencilElement {
|
|
2192
2236
|
}
|
|
2193
2237
|
var HTMLZPaginationBarElement: {
|
|
@@ -2466,6 +2510,7 @@ declare global {
|
|
|
2466
2510
|
"z-notification": HTMLZNotificationElement;
|
|
2467
2511
|
"z-offcanvas": HTMLZOffcanvasElement;
|
|
2468
2512
|
"z-otp": HTMLZOtpElement;
|
|
2513
|
+
"z-pagination": HTMLZPaginationElement;
|
|
2469
2514
|
"z-pagination-bar": HTMLZPaginationBarElement;
|
|
2470
2515
|
"z-pagination-page": HTMLZPaginationPageElement;
|
|
2471
2516
|
"z-panel-elem": HTMLZPanelElemElement;
|
|
@@ -3900,6 +3945,48 @@ declare namespace LocalJSX {
|
|
|
3900
3945
|
"onOtpChange"?: (event: CustomEvent<any>) => void;
|
|
3901
3946
|
"status"?: InputStatusBean;
|
|
3902
3947
|
}
|
|
3948
|
+
interface ZPagination {
|
|
3949
|
+
/**
|
|
3950
|
+
* Current page.
|
|
3951
|
+
*/
|
|
3952
|
+
"currentPage"?: number;
|
|
3953
|
+
/**
|
|
3954
|
+
* Enable buttons to go to the first and last pages.
|
|
3955
|
+
*/
|
|
3956
|
+
"edges"?: boolean;
|
|
3957
|
+
/**
|
|
3958
|
+
* Whether to show "go to page" feature.
|
|
3959
|
+
*/
|
|
3960
|
+
"goToPage"?: boolean;
|
|
3961
|
+
/**
|
|
3962
|
+
* Pagination label placed before the bar.
|
|
3963
|
+
*/
|
|
3964
|
+
"label"?: string;
|
|
3965
|
+
/**
|
|
3966
|
+
* Enable navigation arrows.
|
|
3967
|
+
*/
|
|
3968
|
+
"navArrows"?: boolean;
|
|
3969
|
+
/**
|
|
3970
|
+
* Event emitted when the current page has changed.
|
|
3971
|
+
*/
|
|
3972
|
+
"onPageChanged"?: (event: CustomEvent<any>) => void;
|
|
3973
|
+
/**
|
|
3974
|
+
* Number of pages to skip.
|
|
3975
|
+
*/
|
|
3976
|
+
"skip"?: number;
|
|
3977
|
+
/**
|
|
3978
|
+
* Number of pages to show left/right of the current, before showing "load more" symbol (…).
|
|
3979
|
+
*/
|
|
3980
|
+
"split"?: number;
|
|
3981
|
+
/**
|
|
3982
|
+
* Total number of pages. Required.
|
|
3983
|
+
*/
|
|
3984
|
+
"totalPages": number;
|
|
3985
|
+
/**
|
|
3986
|
+
* Number of pages to show at a time. If not set, all pages will be shown.
|
|
3987
|
+
*/
|
|
3988
|
+
"visiblePages"?: number;
|
|
3989
|
+
}
|
|
3903
3990
|
interface ZPaginationBar {
|
|
3904
3991
|
/**
|
|
3905
3992
|
* current displayed page (mutable)
|
|
@@ -4555,6 +4642,7 @@ declare namespace LocalJSX {
|
|
|
4555
4642
|
"z-notification": ZNotification;
|
|
4556
4643
|
"z-offcanvas": ZOffcanvas;
|
|
4557
4644
|
"z-otp": ZOtp;
|
|
4645
|
+
"z-pagination": ZPagination;
|
|
4558
4646
|
"z-pagination-bar": ZPaginationBar;
|
|
4559
4647
|
"z-pagination-page": ZPaginationPage;
|
|
4560
4648
|
"z-panel-elem": ZPanelElem;
|
|
@@ -4663,6 +4751,7 @@ declare module "@stencil/core" {
|
|
|
4663
4751
|
"z-notification": LocalJSX.ZNotification & JSXBase.HTMLAttributes<HTMLZNotificationElement>;
|
|
4664
4752
|
"z-offcanvas": LocalJSX.ZOffcanvas & JSXBase.HTMLAttributes<HTMLZOffcanvasElement>;
|
|
4665
4753
|
"z-otp": LocalJSX.ZOtp & JSXBase.HTMLAttributes<HTMLZOtpElement>;
|
|
4754
|
+
"z-pagination": LocalJSX.ZPagination & JSXBase.HTMLAttributes<HTMLZPaginationElement>;
|
|
4666
4755
|
"z-pagination-bar": LocalJSX.ZPaginationBar & JSXBase.HTMLAttributes<HTMLZPaginationBarElement>;
|
|
4667
4756
|
"z-pagination-page": LocalJSX.ZPaginationPage & JSXBase.HTMLAttributes<HTMLZPaginationPageElement>;
|
|
4668
4757
|
"z-panel-elem": LocalJSX.ZPanelElem & JSXBase.HTMLAttributes<HTMLZPanelElemElement>;
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as a,g as n}from"./p-98268a57.js";const o=class{constructor(a){t(this,a),this.pageChanged=i(this,"pageChanged",7),this.navArrows=!0,this.skip=0,this.edges=!1,this.currentPage=1,this._visiblePages=this.visiblePages,this.isMobile=!1,this.goToPageValue=null}setPagesContainerWidth(){if(!this._visiblePages||this.split)return void this.host.style.setProperty("--z-pagination--pages-container-max-width","100%");const t=window.getComputedStyle(this.host).getPropertyValue("--z-pagination--page-button-width");this.host.style.setProperty("--z-pagination--pages-container-max-width",`calc(${t} * ${this._visiblePages})`)}setVisiblePages(){this._visiblePages=Math.min(this.visiblePages||this.totalPages,this.totalPages)}onPageChanged(){this.pageChanged.emit(this.currentPage),this.scrollToPage()}onSplitChanged(){this.split&&(this.edges=!1)}onResize(){this.setMobile()}setMobile(){this.isMobile=window.matchMedia("screen and (max-width: 767px)").matches}getPagesChunks(){const t=Array.from({length:this.totalPages},((t,i)=>i+1));let i=[];const a=Math.ceil(t.length/this._visiblePages);for(let n=0;n<a;n++)i.push(t.slice(n*this._visiblePages,(n+1)*this._visiblePages));return i}scrollToPage(){const t=this.host.querySelector(`[data-page="${this.currentPage}"]`);t&&t.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}selectPage(t){this.currentPage=Math.min(Math.max(t,1),this.totalPages)}renderPage(t){return a("button",{class:"page-button",type:"button","aria-current":this.currentPage===t?"page":"false",title:`Vai alla pagina ${t}`,"data-page":t,"data-current":this.currentPage===t,onClick:()=>this.selectPage(t)},t)}renderEllipsisButton(t){return a("button",{class:"ellipsis-button",type:"button",title:`Vai alla pagina ${t}`,onClick:()=>this.selectPage(t)},"…")}renderPages(){const t=this.getPagesChunks();if(!(t.length<=0))return t.map((t=>a("div",{class:"pages-chunk"},t.map((t=>this.renderPage(t))))))}renderSplitPages(){return this.totalPages<=2*this.split+5?Array.from({length:this.totalPages},((t,i)=>this.renderPage(i+1))):this.currentPage<=2*this.split+2?[...Array.from({length:2*this.split+3},((t,i)=>this.renderPage(i+1))),this.renderEllipsisButton(2*this.split+4),this.renderPage(this.totalPages)]:this.currentPage>2*this.split+2&&this.currentPage<this.totalPages-2*this.split-1?[this.renderPage(1),this.renderEllipsisButton(this.currentPage-this.split-1),...Array.from({length:2*this.split+1},((t,i)=>this.renderPage(this.currentPage-this.split+i))),this.renderEllipsisButton(this.currentPage+this.split+1),this.renderPage(this.totalPages)]:[this.renderPage(1),this.renderEllipsisButton(this.totalPages-2*this.split-3),...Array.from({length:2*this.split+3},((t,i)=>this.renderPage(this.totalPages-2*this.split-2+i)))]}renderBackButton(){return a("button",{class:"navigation-button",type:"button",title:"Vai alla pagina precedente",disabled:1===this.currentPage,onClick:()=>this.selectPage(this.currentPage-1)},a("z-icon",{name:"chevron-left"}))}renderForwardButton(){return a("button",{class:"navigation-button",type:"button",title:"Vai alla prossima pagina",disabled:this.currentPage===this.totalPages,onClick:()=>this.selectPage(this.currentPage+1)},a("z-icon",{name:"chevron-right"}))}renderMobile(){const t=this.getPagesChunks();return[this.label&&a("span",{class:"page-label body-1-sb"},this.label),a("div",{class:"pagination-bar"},this.renderBackButton(),!this.goToPage&&a("div",{class:"pages-container",role:"navigation",tabIndex:-1},t.length>0&&t.map((t=>a("div",{class:"pages-chunk"},t.map((t=>this.renderPage(t))))))),this.goToPage&&a("form",{class:"mobile-go-to-page",onSubmit:t=>{t.preventDefault(),this.selectPage(this.goToPageValue)}},a("z-input",{class:"go-to-page-input",type:"number",hasmessage:!1,onInput:t=>{this.goToPageValue=t.target.value},placeholder:this.currentPage.toString(),hasclearicon:!1}),a("span",null,`/${this.totalPages}`)),this.renderForwardButton())]}componentDidLoad(){this.setVisiblePages()}componentDidRender(){this.split&&(this.edges=!1),this.setPagesContainerWidth(),this.setMobile()}render(){return this.isMobile?this.renderMobile():[a("div",{class:"pagination-bar"},this.label&&a("span",{class:"page-label body-1-sb"},this.label),this.edges&&a("button",{class:"pagination-button",type:"button",title:"Vai alla pagina 1",disabled:1===this.currentPage,onClick:()=>this.selectPage(1)},"Pagina 1"),this.skip<this.totalPages&&this.skip>1&&a("button",{class:"pagination-button",type:"button",title:"Vai alla pagina "+(this.currentPage-this.skip),disabled:this.currentPage<=this.skip,onClick:()=>this.selectPage(this.currentPage-this.skip)},"-",this.skip),this.navArrows&&this.renderBackButton(),a("div",{class:"pages-container",role:"navigation",tabIndex:-1},this.split?this.renderSplitPages():this.renderPages()),this.navArrows&&this.renderForwardButton(),this.skip<this.totalPages&&this.skip>1&&a("button",{class:"pagination-button",type:"button",title:`Vai alla pagina ${this.currentPage+this.skip}`,disabled:this.currentPage>this.totalPages-this.skip,onClick:()=>this.selectPage(this.currentPage+this.skip)},"+",this.skip),this.edges&&a("button",{class:"pagination-button",type:"button",title:`Vai alla pagina ${this.totalPages}`,disabled:this.currentPage===this.totalPages,onClick:()=>this.selectPage(this.totalPages)},"Pagina ",this.totalPages)),this.goToPage&&a("div",{class:"go-to-page"},a("span",{class:"label body-5-sb"},"Vai a pagina:"),a("div",{class:"inputs"},a("z-input",{class:"go-to-page-input",type:"number",hasmessage:!1,placeholder:"2",hasclearicon:!1,onInput:t=>{this.goToPageValue=t.target.value},onKeyDown:t=>"Enter"===t.key&&this.selectPage(this.goToPageValue)}),a("z-button",{disabled:!this.goToPageValue,title:"Vai alla pagina inserita",onClick:()=>this.selectPage(this.goToPageValue)},"vai")))]}get host(){return n(this)}static get watchers(){return{_visiblePages:["setPagesContainerWidth"],visiblePages:["setVisiblePages"],currentPage:["onPageChanged"],split:["onSplitChanged"]}}};o.style="z-pagination{--z-pagination--page-button-width:64px;--z-pagination--pages-container-max-width:100%;display:flex;flex-direction:column;gap:calc(var(--space-unit) * 2) calc(var(--space-unit) * 4);max-width:100%;flex-wrap:wrap;font-family:var(--font-family-sans);font-weight:var(--font-rg)}z-pagination,z-pagination *{box-sizing:border-box}z-pagination button{height:100%}z-pagination z-icon{fill:var(--color-icon01)}z-pagination *:disabled z-icon{fill:var(--color-disabled02)}z-pagination .page-label{margin-right:calc(var(--space-unit) * 3);color:var(--color-text02)}z-pagination .pagination-bar{display:flex;align-items:center;height:48px;max-width:100%}z-pagination .pagination-bar button{display:flex;align-items:center;justify-content:center;margin:0;background-color:var(--color-surface03);transition:background-color .150s ease-out,\n color .150s ease-out,\n border-bottom-color .150s ease-out,\n font-size .150s ease-in-out,\n font-weight .150s ease-in-out;color:var(--color-primary01);border:none;font-family:inherit;font-weight:inherit;cursor:pointer}z-pagination .pagination-bar button:focus-visible{outline:none;box-shadow:inset var(--shadow-focus-primary);background-color:var(--color-hover-surface)}z-pagination .pagination-bar .pagination-button{padding:calc(var(--space-unit) * 2);text-transform:uppercase;white-space:nowrap;font-weight:var(--font-sb)}z-pagination .pagination-bar .navigation-button{padding:calc(var(--space-unit) * 2) calc(var(--space-unit) * 1.5)}z-pagination .pagination-bar .pagination-button:disabled,z-pagination .pagination-bar .navigation-button:disabled{background-color:var(--color-disabled01);color:var(--color-disabled02);cursor:default;pointer-events:none}z-pagination .pagination-bar .page-button,z-pagination .pagination-bar .ellipsis-button{width:var(--z-pagination--page-button-width)}z-pagination .pages-container{position:relative;display:inline-flex;max-width:100%;height:100%;overflow-x:auto;scroll-behavior:smooth;scroll-snap-align:center;scrollbar-width:none}z-pagination .pages-container::-webkit-scrollbar{display:none}z-pagination .pages-chunk{display:flex;scroll-snap-align:center}z-pagination .pagination-bar .page-button{padding-top:var(--border-size-large) solid transparent;border-bottom:var(--border-size-large) solid transparent;font-size:var(--font-size-2);font-weight:var(--font-sb)}z-pagination .pagination-bar .page-button:focus-visible{border-bottom-color:var(--color-hover-light)}z-pagination .pagination-bar .page-button[data-current]{font-size:var(--font-size-7);border-bottom-color:var(--color-primary01)}z-pagination .go-to-page{display:flex;flex-direction:column;row-gap:var(--space-unit)}z-pagination .go-to-page .label{color:var(--color-text02);text-transform:uppercase}z-pagination .go-to-page .inputs{display:flex;column-gap:var(--space-unit)}z-pagination .go-to-page .inputs z-input{width:calc(var(--space-unit) * 11)}z-pagination .go-to-page .inputs z-input input,z-pagination .mobile-go-to-page z-input input{padding:0 calc(var(--space-unit) * 1.5) !important;-moz-appearance:none}z-pagination .mobile-go-to-page{display:flex;justify-content:center;align-items:center;flex:1 auto;height:100%;background-color:var(--color-surface03)}z-pagination .mobile-go-to-page z-input{width:var(--z-pagination--page-button-width);margin-right:var(--space-unit)}z-pagination .mobile-go-to-page z-input input{text-align:center}z-pagination .mobile-go-to-page z-input input::-webkit-outer-spin-button,z-pagination .mobile-go-to-page z-input input::-webkit-inner-spin-button{appearance:none;-webkit-appearance:none}z-pagination .mobile-go-to-page>span{font-size:var(--font-size-2)}@media (hover: hover){z-pagination .pagination-bar button:hover{background-color:var(--color-hover-surface)}z-pagination .pagination-bar .page-button:hover{border-bottom-color:var(--color-hover-light)}}@media (min-width: 768px){z-pagination{--z-pagination--page-button-width:88px;flex-direction:row;align-items:flex-end}z-pagination .pages-container{max-width:var(--z-pagination--pages-container-max-width)}}";export{o as z_pagination}
|