@zanichelli/albe-web-components 17.0.2 → 17.0.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/CHANGELOG.md +4 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-anchor-navigation.cjs.entry.js +1 -1
- package/dist/cjs/z-anchor-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/z-app-header_12.cjs.entry.js +13 -14
- package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -1
- package/dist/cjs/z-book-card-app.cjs.entry.js +1 -1
- package/dist/cjs/z-book-card-app.cjs.entry.js.map +1 -1
- package/dist/cjs/z-book-card.cjs.entry.js +2 -2
- package/dist/cjs/z-book-card.cjs.entry.js.map +1 -1
- package/dist/cjs/z-date-picker.cjs.entry.js +5 -3
- package/dist/cjs/z-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/z-pagination.cjs.entry.js +1 -1
- package/dist/cjs/z-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/z-select.cjs.entry.js +27 -35
- package/dist/cjs/z-select.cjs.entry.js.map +1 -1
- package/dist/collection/components/book-card/z-book-card/index.js +1 -1
- package/dist/collection/components/book-card/z-book-card/index.js.map +1 -1
- package/dist/collection/components/book-card/z-book-card/styles.css +3 -0
- package/dist/collection/components/book-card/z-book-card-app/styles.css +1 -0
- package/dist/collection/components/date-picker/z-date-picker/index.js +41 -3
- package/dist/collection/components/date-picker/z-date-picker/index.js.map +1 -1
- package/dist/collection/components/date-picker/z-date-picker/index.stories.js +17 -5
- package/dist/collection/components/date-picker/z-date-picker/index.stories.js.map +1 -1
- package/dist/collection/components/z-anchor-navigation/index.stories.js +16 -4
- package/dist/collection/components/z-anchor-navigation/index.stories.js.map +1 -1
- package/dist/collection/components/z-anchor-navigation/styles.css +7 -4
- package/dist/collection/components/z-app-header/styles.css +1 -0
- package/dist/collection/components/z-input/index.js +9 -11
- package/dist/collection/components/z-input/index.js.map +1 -1
- package/dist/collection/components/z-input/index.stories.js +21 -21
- package/dist/collection/components/z-input/index.stories.js.map +1 -1
- package/dist/collection/components/z-input/styles.css +97 -75
- package/dist/collection/components/z-input-message/index.js +19 -1
- package/dist/collection/components/z-input-message/index.js.map +1 -1
- package/dist/collection/components/z-input-message/styles.css +9 -4
- package/dist/collection/components/z-pagination/styles.css +7 -11
- package/dist/collection/components/z-select/index.js +27 -35
- package/dist/collection/components/z-select/index.js.map +1 -1
- package/dist/collection/components/z-select/styles.css +18 -17
- package/dist/components/index11.js +10 -12
- package/dist/components/index11.js.map +1 -1
- package/dist/components/index12.js +4 -2
- package/dist/components/index12.js.map +1 -1
- package/dist/components/utils.js +1 -1
- package/dist/components/z-anchor-navigation.js +1 -1
- package/dist/components/z-anchor-navigation.js.map +1 -1
- package/dist/components/z-app-header.js +1 -1
- package/dist/components/z-app-header.js.map +1 -1
- package/dist/components/z-book-card-app.js +1 -1
- package/dist/components/z-book-card-app.js.map +1 -1
- package/dist/components/z-book-card.js +2 -2
- package/dist/components/z-book-card.js.map +1 -1
- package/dist/components/z-date-picker.js +7 -3
- package/dist/components/z-date-picker.js.map +1 -1
- package/dist/components/z-pagination.js +1 -1
- package/dist/components/z-pagination.js.map +1 -1
- package/dist/components/z-select.js +28 -36
- package/dist/components/z-select.js.map +1 -1
- package/dist/components/z-skip-to-content.js +1 -1
- package/dist/esm/{index-8df19678.js → index-092fc7cc.js} +2 -2
- package/dist/esm/{index-8df19678.js.map → index-092fc7cc.js.map} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-ed82ce58.js → utils-b924649f.js} +2 -2
- package/dist/esm/{utils-ed82ce58.js.map → utils-b924649f.js.map} +1 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-anchor-navigation.entry.js +1 -1
- package/dist/esm/z-anchor-navigation.entry.js.map +1 -1
- package/dist/esm/z-app-header_12.entry.js +14 -15
- package/dist/esm/z-app-header_12.entry.js.map +1 -1
- package/dist/esm/z-book-card-app.entry.js +1 -1
- package/dist/esm/z-book-card-app.entry.js.map +1 -1
- package/dist/esm/z-book-card-deprecated.entry.js +1 -1
- package/dist/esm/z-book-card.entry.js +2 -2
- package/dist/esm/z-book-card.entry.js.map +1 -1
- package/dist/esm/z-breadcrumb.entry.js +1 -1
- package/dist/esm/z-combobox.entry.js +1 -1
- package/dist/esm/z-date-picker.entry.js +5 -3
- package/dist/esm/z-date-picker.entry.js.map +1 -1
- package/dist/esm/z-menu.entry.js +1 -1
- package/dist/esm/z-myz-card-info.entry.js +1 -1
- package/dist/esm/z-myz-list-item.entry.js +1 -1
- package/dist/esm/z-pagination.entry.js +1 -1
- package/dist/esm/z-pagination.entry.js.map +1 -1
- package/dist/esm/z-select.entry.js +28 -36
- package/dist/esm/z-select.entry.js.map +1 -1
- package/dist/esm/z-skip-to-content.entry.js +1 -1
- package/dist/esm/z-slideshow.entry.js +1 -1
- package/dist/esm/z-table.entry.js +2 -2
- package/dist/esm/z-toggle-switch.entry.js +1 -1
- package/dist/esm/z-tr.entry.js +2 -2
- package/dist/types/components/date-picker/z-date-picker/index.d.ts +4 -0
- package/dist/types/components/z-input-message/index.d.ts +2 -0
- package/dist/types/components/z-select/index.d.ts +1 -1
- package/dist/types/components.d.ts +24 -0
- package/dist/web-components-library/index.esm.js +1 -1
- package/dist/web-components-library/p-0378c12a.entry.js +2 -0
- package/dist/web-components-library/p-0378c12a.entry.js.map +1 -0
- package/dist/web-components-library/p-1e3ff105.entry.js +2 -0
- package/dist/web-components-library/p-1e3ff105.entry.js.map +1 -0
- package/dist/web-components-library/{p-caccf490.entry.js → p-22e32e11.entry.js} +2 -2
- package/{www/build/p-caccf490.entry.js.map → dist/web-components-library/p-22e32e11.entry.js.map} +1 -1
- package/dist/web-components-library/{p-20b628e7.entry.js → p-2fa0042e.entry.js} +2 -2
- package/dist/web-components-library/p-4a3fedbf.entry.js +2 -0
- package/dist/web-components-library/p-4a3fedbf.entry.js.map +1 -0
- package/dist/web-components-library/{p-4fedcbc2.entry.js → p-5387e6f3.entry.js} +2 -2
- package/{www/build/p-0565f1b2.entry.js → dist/web-components-library/p-758333dc.entry.js} +2 -2
- package/{www/build/p-605f6780.entry.js → dist/web-components-library/p-7af33b00.entry.js} +2 -2
- package/{www/build/p-b309bd71.entry.js → dist/web-components-library/p-7f370d17.entry.js} +2 -2
- package/dist/web-components-library/{p-65f1b68b.entry.js → p-9c4b7a51.entry.js} +2 -2
- package/dist/web-components-library/{p-037c59b3.js → p-bba6129f.js} +2 -2
- package/dist/web-components-library/{p-cc8186a9.entry.js → p-bd571858.entry.js} +2 -2
- package/dist/web-components-library/p-c29a520b.entry.js +2 -0
- package/{www/build/p-34f4f441.entry.js.map → dist/web-components-library/p-c29a520b.entry.js.map} +1 -1
- package/dist/web-components-library/p-ce0d5448.entry.js +2 -0
- package/dist/web-components-library/p-ce0d5448.entry.js.map +1 -0
- package/dist/web-components-library/{p-9f0a3d88.entry.js → p-cf7b7e73.entry.js} +2 -2
- package/dist/web-components-library/p-d1cca5ea.entry.js +2 -0
- package/dist/web-components-library/p-d1cca5ea.entry.js.map +1 -0
- package/dist/web-components-library/p-d6a2b1c6.entry.js +2 -0
- package/dist/web-components-library/p-d6a2b1c6.entry.js.map +1 -0
- package/dist/web-components-library/p-e185545c.entry.js +2 -0
- package/dist/web-components-library/{p-10607a39.js → p-e691c0b8.js} +2 -2
- package/{www/build/p-3bf02cab.entry.js → dist/web-components-library/p-e78353d6.entry.js} +2 -2
- package/dist/web-components-library/web-components-library.css +125 -72
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/dist/web-components-library/web-components-library.esm.js.map +1 -1
- package/package.json +1 -1
- package/www/build/index.esm.js +1 -1
- package/www/build/p-01994cd6.js +2 -0
- package/www/build/p-0378c12a.entry.js +2 -0
- package/www/build/p-0378c12a.entry.js.map +1 -0
- package/www/build/p-1e3ff105.entry.js +2 -0
- package/www/build/p-1e3ff105.entry.js.map +1 -0
- package/www/build/{p-caccf490.entry.js → p-22e32e11.entry.js} +2 -2
- package/{dist/web-components-library/p-caccf490.entry.js.map → www/build/p-22e32e11.entry.js.map} +1 -1
- package/www/build/{p-20b628e7.entry.js → p-2fa0042e.entry.js} +2 -2
- package/www/build/p-4a3fedbf.entry.js +2 -0
- package/www/build/p-4a3fedbf.entry.js.map +1 -0
- package/www/build/{p-4fedcbc2.entry.js → p-5387e6f3.entry.js} +2 -2
- package/{dist/web-components-library/p-0565f1b2.entry.js → www/build/p-758333dc.entry.js} +2 -2
- package/{dist/web-components-library/p-605f6780.entry.js → www/build/p-7af33b00.entry.js} +2 -2
- package/{dist/web-components-library/p-b309bd71.entry.js → www/build/p-7f370d17.entry.js} +2 -2
- package/www/build/{p-65f1b68b.entry.js → p-9c4b7a51.entry.js} +2 -2
- package/www/build/{p-4c358c38.css → p-a35437c8.css} +125 -72
- package/www/build/{p-037c59b3.js → p-bba6129f.js} +2 -2
- package/www/build/{p-cc8186a9.entry.js → p-bd571858.entry.js} +2 -2
- package/www/build/p-c29a520b.entry.js +2 -0
- package/{dist/web-components-library/p-34f4f441.entry.js.map → www/build/p-c29a520b.entry.js.map} +1 -1
- package/www/build/p-ce0d5448.entry.js +2 -0
- package/www/build/p-ce0d5448.entry.js.map +1 -0
- package/www/build/{p-9f0a3d88.entry.js → p-cf7b7e73.entry.js} +2 -2
- package/www/build/p-d1cca5ea.entry.js +2 -0
- package/www/build/p-d1cca5ea.entry.js.map +1 -0
- package/www/build/p-d6a2b1c6.entry.js +2 -0
- package/www/build/p-d6a2b1c6.entry.js.map +1 -0
- package/www/build/p-e185545c.entry.js +2 -0
- package/www/build/{p-10607a39.js → p-e691c0b8.js} +2 -2
- package/{dist/web-components-library/p-3bf02cab.entry.js → www/build/p-e78353d6.entry.js} +2 -2
- package/www/build/web-components-library.css +125 -72
- package/www/build/web-components-library.esm.js +1 -1
- package/www/build/web-components-library.esm.js.map +1 -1
- package/www/index.html +1 -1
- package/www/pages/book-cards.html +20 -14
- package/dist/web-components-library/p-015621c8.entry.js +0 -2
- package/dist/web-components-library/p-015621c8.entry.js.map +0 -1
- package/dist/web-components-library/p-34f4f441.entry.js +0 -2
- package/dist/web-components-library/p-38e8c15d.entry.js +0 -2
- package/dist/web-components-library/p-38e8c15d.entry.js.map +0 -1
- package/dist/web-components-library/p-54a70792.entry.js +0 -2
- package/dist/web-components-library/p-54a70792.entry.js.map +0 -1
- package/dist/web-components-library/p-60a9cb8b.entry.js +0 -2
- package/dist/web-components-library/p-60a9cb8b.entry.js.map +0 -1
- package/dist/web-components-library/p-972098a5.entry.js +0 -2
- package/dist/web-components-library/p-972098a5.entry.js.map +0 -1
- package/dist/web-components-library/p-a90027c2.entry.js +0 -2
- package/dist/web-components-library/p-a90027c2.entry.js.map +0 -1
- package/dist/web-components-library/p-deb86b5c.entry.js +0 -2
- package/www/build/p-015621c8.entry.js +0 -2
- package/www/build/p-015621c8.entry.js.map +0 -1
- package/www/build/p-34f4f441.entry.js +0 -2
- package/www/build/p-38e8c15d.entry.js +0 -2
- package/www/build/p-38e8c15d.entry.js.map +0 -1
- package/www/build/p-45f04bb4.js +0 -2
- package/www/build/p-54a70792.entry.js +0 -2
- package/www/build/p-54a70792.entry.js.map +0 -1
- package/www/build/p-60a9cb8b.entry.js +0 -2
- package/www/build/p-60a9cb8b.entry.js.map +0 -1
- package/www/build/p-972098a5.entry.js +0 -2
- package/www/build/p-972098a5.entry.js.map +0 -1
- package/www/build/p-a90027c2.entry.js +0 -2
- package/www/build/p-a90027c2.entry.js.map +0 -1
- package/www/build/p-deb86b5c.entry.js +0 -2
- /package/dist/web-components-library/{p-20b628e7.entry.js.map → p-2fa0042e.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-4fedcbc2.entry.js.map → p-5387e6f3.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-0565f1b2.entry.js.map → p-758333dc.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-605f6780.entry.js.map → p-7af33b00.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-b309bd71.entry.js.map → p-7f370d17.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-65f1b68b.entry.js.map → p-9c4b7a51.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-037c59b3.js.map → p-bba6129f.js.map} +0 -0
- /package/dist/web-components-library/{p-cc8186a9.entry.js.map → p-bd571858.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-9f0a3d88.entry.js.map → p-cf7b7e73.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-deb86b5c.entry.js.map → p-e185545c.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-10607a39.js.map → p-e691c0b8.js.map} +0 -0
- /package/dist/web-components-library/{p-3bf02cab.entry.js.map → p-e78353d6.entry.js.map} +0 -0
- /package/www/build/{p-20b628e7.entry.js.map → p-2fa0042e.entry.js.map} +0 -0
- /package/www/build/{p-4fedcbc2.entry.js.map → p-5387e6f3.entry.js.map} +0 -0
- /package/www/build/{p-0565f1b2.entry.js.map → p-758333dc.entry.js.map} +0 -0
- /package/www/build/{p-605f6780.entry.js.map → p-7af33b00.entry.js.map} +0 -0
- /package/www/build/{p-b309bd71.entry.js.map → p-7f370d17.entry.js.map} +0 -0
- /package/www/build/{p-65f1b68b.entry.js.map → p-9c4b7a51.entry.js.map} +0 -0
- /package/www/build/{p-037c59b3.js.map → p-bba6129f.js.map} +0 -0
- /package/www/build/{p-cc8186a9.entry.js.map → p-bd571858.entry.js.map} +0 -0
- /package/www/build/{p-9f0a3d88.entry.js.map → p-cf7b7e73.entry.js.map} +0 -0
- /package/www/build/{p-deb86b5c.entry.js.map → p-e185545c.entry.js.map} +0 -0
- /package/www/build/{p-10607a39.js.map → p-e691c0b8.js.map} +0 -0
- /package/www/build/{p-3bf02cab.entry.js.map → p-e78353d6.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,h as t,a,g as s}from"./p-75c4a726.js";import"./p-feb84d36.js";import"./p-c13ef624.js";import"./p-4c462e7f.js";import"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,h as t,a,g as s}from"./p-75c4a726.js";import"./p-feb84d36.js";import"./p-c13ef624.js";import"./p-4c462e7f.js";import"./p-bba6129f.js";import"./p-e691c0b8.js";import"./p-b34993de.js";import"./p-5145a606.js";import"./p-14e61df6.js";import"./p-123739cb.js";const r=":host{--z-table--cells-padding:calc(var(--space-unit) * 2);position:relative;display:block;overflow:auto;max-width:100%;box-sizing:border-box;background-color:var(--color-surface01)}:host([expandable]){--z-table--expand-button-size:40px}:host([bordered]){--z-table--cell-left-border:1px solid var(--color-surface03)}";const o=r;const i=class{constructor(t){e(this,t);this.bordered=false;this.expandable=false}updateExpandable(){this.expandable=this.host.querySelectorAll("z-tr[expandable]").length>0}componentWillLoad(){this.expandableMutationObserver=new MutationObserver((()=>{this.updateExpandable()}));this.expandableMutationObserver.observe(this.host,{childList:true,subtree:true,attributes:true,attributeFilter:["expandable"],attributeOldValue:false})}disconnectedCallback(){var e;(e=this.expandableMutationObserver)===null||e===void 0?void 0:e.disconnect()}render(){return t(a,{key:"8cc330079f36a6c9112ef15dd5bb66f7c0e07db5",expandable:this.expandable},t("div",{key:"5b9783130bb30d5e0dc3e62c132b043900cb746f",class:"table",role:"table"},t("slot",{key:"e339c4892e8c433fb79e054ac47e45c8a6ac40e5"})))}get host(){return s(this)}};i.style=o;export{i as z_table};
|
|
2
|
+
//# sourceMappingURL=p-5387e6f3.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,g as r}from"./p-75c4a726.js";import{Y as a}from"./p-b34993de.js";import{B as o}from"./p-5145a606.js";import{r as s}from"./p-10607a39.js";const n=':host{--z-book-card-ribbon-background-color:var(--avatar-C08);--z-book-card-ribbon-shadow-color:var(--green950);--z-book-card-compact-width:262px;--z-book-card-compact-height:568px}:host>article{display:block;width:100%;max-width:360px;box-sizing:border-box;border:var(--border-size-medium) solid var(--color-surface03);background-color:var(--color-surface01);border-radius:var(--border-radius);font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>article div.cover{position:relative}:host>article div.cover div.img-wrapper{display:flex;overflow:hidden;border:var(--border-size-small) solid var(--color-surface03);line-height:0}:host>article div.cover div.img-wrapper img{width:auto;max-width:100%;height:auto;max-height:100%;align-self:flex-end}:host>article div.cover .ribbon{position:absolute;z-index:10;top:calc(var(--space-unit) * 2);left:calc(var(--space-unit) * -2);display:flex;max-width:100%;height:calc(var(--space-unit) * 4);box-sizing:border-box;align-items:center;padding:0 calc(var(--space-unit) * 2);border:var(--border-size-medium) solid var(--color-surface01);background:var(--z-book-card-ribbon-background-color);border-radius:0 var(--border-radius) var(--border-radius) 0;box-shadow:var(--shadow-2);color:var(--color-text-inverse);font-family:var(--font-family-sans);font-size:var(--font-size-2);font-weight:var(--font-sb);line-height:initial}:host>article div.cover .ribbon.interactive:hover{cursor:pointer}:host>article div.cover .ribbon.interactive:focus{box-shadow:var(--shadow-focus-primary);outline:none !important}:host>article div.cover .ribbon span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:nowrap}:host>article div.cover .ribbon::before{position:absolute;bottom:-12px;left:-2px;width:0;height:0;border-top:10px solid var(--z-book-card-ribbon-shadow-color);border-left:16px solid transparent;content:""}:host>article div.cover .ribbon z-icon{margin-right:var(--space-unit)}:host>article div.content{margin:var(--space-unit) 0;border-radius:var(--border-radius)}:host>article .title{display:flex;height:100%;align-self:center;color:var(--color-default-text);font-size:var(--font-size-4);font-weight:var(--font-sb);line-height:1.5}:host>article .title *{all:unset}:host>article div.subtitle{color:var(--color-default-text);font-size:var(--font-size-2);font-weight:var(--font-rg);line-height:1.4}:host>article div.authors{color:var(--color-default-text);font-size:var(--font-size-1);font-weight:var(--font-rg);line-height:1.33}:host>article div.isbn{overflow:hidden;color:var(--color-default-text);font-size:var(--font-size-2);line-height:1.33;text-overflow:ellipsis;white-space:nowrap;word-wrap:nowrap}:host>article div.isbn>.code{font-weight:var(--font-sb)}:host>article div.tags{display:flex;overflow:hidden;max-height:32px;flex-flow:row wrap;align-content:stretch;align-items:stretch;justify-content:flex-start;gap:calc(var(--space-unit) / 2)}:host>article ::slotted([slot="tags"]){margin-bottom:var(--space-unit)}:host>article ::slotted([slot="header-cta"]){--z-icon-width:20px;--z-icon-height:20px;padding:var(--space-unit);cursor:pointer;fill:var(--color-primary01-icon)}:host>article ::slotted([slot="header-cta"]:focus){box-shadow:var(--shadow-focus-primary);outline:none !important}:host>article.expanded{width:100%;min-width:328px;padding:calc(var(--space-unit) * 2);padding-bottom:0}:host>article.expanded div.header{display:flex;flex-flow:row nowrap;align-content:stretch;align-items:top;justify-content:space-between;margin-bottom:var(--space-unit);white-space:nowrap}:host>article.expanded div.cover div.img-wrapper{border-radius:var(--border-radius)}:host>article.expanded div.cover div.img-wrapper img{width:100%}:host>article.expanded .title,:host>article.expanded .subtitle,:host>article.expanded .authors{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:initial}:host>article.expanded div.footer{border-top:var(--border-size-small) solid var(--color-surface03);margin-bottom:calc(var(--space-unit) * 1.5)}:host>article.expanded div.footer.open{padding-top:calc(var(--space-unit) * 1.5)}:host>article.expanded div.footer.open div.resources{display:initial}:host>article.expanded div.footer.close div.resources{display:none}:host>article.expanded button.show-resources{--z-icon-height:16px;--z-icon-width:16px;all:unset;display:flex;width:100%;flex-flow:row nowrap;align-content:center;align-items:center;justify-content:center;padding:calc(var(--space-unit) * 1) 0;color:var(--color-text-link-blue);cursor:pointer;fill:var(--color-text-link-blue);font-size:var(--font-size-2);font-weight:var(--font-sb);gap:var(--space-unit)}:host>article.expanded button.show-resources:focus{box-shadow:var(--shadow-focus-primary)}:host>article.search{width:262px;height:616px;padding:calc(var(--space-unit) * 2);padding-bottom:0}:host>article.search .wrapper-container{display:flex;height:100%;flex-direction:column;justify-content:space-between}:host>article.search .wrapper-container .wrapper{height:451px}:host>article.search .wrapper-container .action-container{padding-bottom:calc(var(--space-unit) * 2)}:host>article.search div.header{display:flex;height:24px;flex-flow:row nowrap;align-content:stretch;align-items:center;justify-content:space-between;margin-bottom:calc(var(--space-unit) * 1.5);white-space:nowrap}:host>article.search div.cover div.img-wrapper{height:314px;border-radius:var(--border-radius)}:host>article.search .title{display:block;height:initial;align-self:unset;font-size:var(--font-size-3)}:host>article.search .title,:host>article.search .subtitle,:host>article.search .authors{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host>article.compact{width:var(--z-book-card-compact-width);height:var(--z-book-card-compact-height)}:host>article.compact.borderless{border:none}:host>article.compact div.cover div.img-wrapper{width:100%;height:calc(var(--z-book-card-compact-width) * 1.36);box-sizing:border-box;border:none;background:var(--color-white);border-radius:var(--border-radius) var(--border-radius) 0 0;box-shadow:var(--shadow-2)}:host>article.compact div.wrapper{display:flex;height:100%;flex-flow:column nowrap;align-content:stretch;align-items:stretch;justify-content:flex-start}:host>article.compact div.content{display:flex;box-sizing:border-box;flex-flow:column nowrap;align-content:stretch;align-items:stretch;justify-content:space-between;padding:calc(var(--space-unit) * 2);padding-top:var(--space-unit);margin:0}:host>article.compact div.action-container{padding:calc(var(--space-unit) * 2);padding-top:0;margin-top:auto}:host>article.compact.borderless div.cover div.img-wrapper{width:var(--z-book-card-compact-width)}:host>article.compact.borderless div.content{padding:0;padding-top:var(--space-unit)}:host>article.compact.borderless div.action-container{padding:0;padding-bottom:calc(var(--space-unit) * 2)}:host>article.compact .title{display:block;height:initial;align-self:unset}:host>article.compact .title,:host>article.compact .subtitle,:host>article.compact .authors{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:initial}@media (min-width: 768px){:host>article{width:100%;max-width:initial}:host>article .title{display:block;height:initial;align-self:unset}:host>article.expanded{width:100%;min-width:initial;max-width:initial;height:360px;padding:0;border:0}:host>article.expanded div.wrapper{display:flex;flex-flow:row nowrap;align-content:stretch;align-items:stretch;justify-content:flex-start}:host>article.expanded div.cover div.img-wrapper{width:262px;height:356px;border:0;border:var(--border-size-medium) solid var(--color-surface03);border-right:none;background:var(--color-surface01);border-radius:var(--border-radius) 0 0 var(--border-radius)}:host>article.expanded div.cover div.img-wrapper img{width:auto;border-radius:0}:host>article.expanded div.content{display:flex;overflow:hidden;width:100%;height:356px;flex-flow:column nowrap;align-content:stretch;align-items:stretch;justify-content:space-between;border:var(--border-size-medium) solid var(--color-surface03);border-left:none;margin:0;background:var(--color-surface01);border-radius:0 var(--border-radius) var(--border-radius) 0}:host>article.expanded div.content div.top{padding:calc(var(--space-unit) * 2);padding-bottom:0}:host>article.expanded div.content div.top div.info{display:flex;flex-flow:row nowrap;align-content:stretch;align-items:stretch;justify-content:space-between;margin-bottom:calc(var(--space-unit) / 2)}:host>article.expanded div.content div.top div.info>div.left{width:100%}:host>article.expanded div.content div.bottom{padding:calc(var(--space-unit) * 2);padding-bottom:0}}@media (min-width: 1152px){:host>article{width:fit-content;max-width:initial}}@media (min-width: 1366px){:host>article.expanded{width:635px}:host>article.expanded div.content{width:369px}}';const d=n;const c=class{constructor(i){t(this,i);this.ribbonClick=e(this,"ribbonClick",7);this.variant=undefined;this.cover=undefined;this.operaTitle=undefined;this.volumeTitle=undefined;this.authors=undefined;this.isbn=undefined;this.isbnLabel="";this.ribbon=undefined;this.ribbonIcon=undefined;this.ribbonInteractive=undefined;this.borderless=undefined;this.fallbackCover=undefined;this.operaTitleTag=undefined;this.isMobile=false;this.hasResources=false;this.showResources=false}emitRibbonClick(){this.ribbonClick.emit()}componentWillLoad(){this.id=`id-${s()}`;const t=window.matchMedia(`(max-width: ${o.MOBILE}px)`);this.isMobile=t.matches;t.onchange=t=>this.isMobile=t.matches}componentDidLoad(){this.handleResources()}handleResources(){var t;if(this.variant!==a.EXPANDED||!this.isMobile){return}this.hasResources=((t=this.hostElement.querySelectorAll("[slot=resources]"))===null||t===void 0?void 0:t.length)>0}toggleResources(){this.showResources=!this.showResources}renderCard(){switch(this.variant){case a.EXPANDED:return this.isMobile?this.renderMobileExpandedCard():this.renderExpandedCard();case a.COMPACT:return this.renderCompactCard();case a.SEARCH:return this.renderSearchCard()}}renderExpandedCard(){return i("div",{class:"wrapper"},this.renderCover(),i("div",{class:"content"},i("div",{class:"top"},i("div",{class:"info"},i("div",{class:"left"},this.renderAuthors(),this.renderOperaTitle(),this.renderVolumeTitle(),this.renderIsbn()),i("div",{class:"right"},this.renderHeaderCtaSlot())),this.renderTagsSlot()),i("div",{class:"bottom"},this.renderResourcesSlot())))}renderMobileExpandedCard(){return i("div",{class:"wrapper"},i("div",{class:"header"},this.renderOperaTitle(),this.renderHeaderCtaSlot()),this.renderCover(),i("div",{class:"content"},this.renderTagsSlot(),this.renderAuthors(),this.renderVolumeTitle(),this.renderIsbn()),this.hasResources&&i("div",{class:{footer:true,open:this.showResources,close:!this.showResources}},!this.showResources&&this.renderShowResources(),this.renderResourcesSlot(),this.showResources&&this.renderShowResources()))}renderSearchCard(){return i("div",{class:"wrapper-container"},i("div",{class:"wrapper"},i("div",{class:"header"},this.renderOperaTitle(),this.renderHeaderCtaSlot()),this.renderCover(),i("div",{class:"content"},this.renderTagsSlot(),this.renderAuthors(),this.renderVolumeTitle(),this.renderIsbn())),this.renderFooterCtaSlot())}renderCompactCard(){return i("div",{class:"wrapper"},this.renderCover(),i("div",{class:"content"},this.renderAuthors(),this.renderOperaTitle(),this.renderVolumeTitle(),this.renderIsbn()),this.renderFooterCtaSlot())}renderCover(){return i("div",{class:"cover"},this.ribbon&&this.variant!==a.COMPACT&&this.renderRibbon(),i("div",{class:"img-wrapper"},i("img",{src:this.cover,onError:()=>{if(this.fallbackCover){this.cover=this.fallbackCover}},"aria-hidden":"true"})))}renderRibbon(){const t=[this.ribbonIcon&&i("z-icon",{name:this.ribbonIcon,width:16,height:16,fill:"color-inverse-icon"}),i("span",null,this.ribbon)];return this.ribbonInteractive?i("button",{class:"ribbon interactive",onClick:()=>this.emitRibbonClick()},t):i("div",{class:"ribbon"},t)}renderOperaTitle(){const t=this.operaTitleTag?`<${this.operaTitleTag}>${this.operaTitle}</${this.operaTitleTag}>`:this.operaTitle;return i("div",{class:"title",innerHTML:t})}renderVolumeTitle(){return this.volumeTitle?i("div",{class:"subtitle"},this.volumeTitle):null}renderAuthors(){return this.authors?i("div",{class:"authors","aria-description":"Autori"},this.authors):null}renderIsbn(){return this.isbn?i("div",{class:"isbn"},i("span",{class:"code","aria-description":`ISBN ${this.isbnLabel}`},this.isbn),this.isbnLabel?i("span",{class:"label"}," ",this.isbnLabel):null):null}renderShowResources(){return i("button",{class:"show-resources","aria-label":`Risorse del libro ${this.operaTitle}`,"aria-expanded":this.showResources.toString(),"aria-controls":`resources-${this.id}`,onClick:()=>this.toggleResources()},this.showResources?"Chiudi":"Vedi tutto",i("z-icon",{name:this.showResources?"chevron-up":"chevron-down"}))}renderTagsSlot(){return i("div",{class:"tags"},i("slot",{name:"tags"}))}renderHeaderCtaSlot(){return i("slot",{name:"header-cta"})}renderResourcesSlot(){return i("div",{id:`resources-${this.id}`,class:"resources"},i("slot",{name:"resources",onSlotchange:()=>this.handleResources()}))}renderFooterCtaSlot(){return i("div",{class:"action-container"},i("slot",{name:"footer-cta"}))}render(){return i("article",{key:"a2248d9206aec07d317dddb8cb8d6061eccc7a53",class:{[this.variant]:true,borderless:!!this.borderless}},this.renderCard())}get hostElement(){return r(this)}};c.style=d;export{c as z_book_card_deprecated};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as e,h as i,g as r}from"./p-75c4a726.js";import{Y as a}from"./p-b34993de.js";import{B as o}from"./p-5145a606.js";import{r as s}from"./p-e691c0b8.js";const n=':host{--z-book-card-ribbon-background-color:var(--avatar-C08);--z-book-card-ribbon-shadow-color:var(--green950);--z-book-card-compact-width:262px;--z-book-card-compact-height:568px}:host>article{display:block;width:100%;max-width:360px;box-sizing:border-box;border:var(--border-size-medium) solid var(--color-surface03);background-color:var(--color-surface01);border-radius:var(--border-radius);font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>article div.cover{position:relative}:host>article div.cover div.img-wrapper{display:flex;overflow:hidden;border:var(--border-size-small) solid var(--color-surface03);line-height:0}:host>article div.cover div.img-wrapper img{width:auto;max-width:100%;height:auto;max-height:100%;align-self:flex-end}:host>article div.cover .ribbon{position:absolute;z-index:10;top:calc(var(--space-unit) * 2);left:calc(var(--space-unit) * -2);display:flex;max-width:100%;height:calc(var(--space-unit) * 4);box-sizing:border-box;align-items:center;padding:0 calc(var(--space-unit) * 2);border:var(--border-size-medium) solid var(--color-surface01);background:var(--z-book-card-ribbon-background-color);border-radius:0 var(--border-radius) var(--border-radius) 0;box-shadow:var(--shadow-2);color:var(--color-text-inverse);font-family:var(--font-family-sans);font-size:var(--font-size-2);font-weight:var(--font-sb);line-height:initial}:host>article div.cover .ribbon.interactive:hover{cursor:pointer}:host>article div.cover .ribbon.interactive:focus{box-shadow:var(--shadow-focus-primary);outline:none !important}:host>article div.cover .ribbon span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:nowrap}:host>article div.cover .ribbon::before{position:absolute;bottom:-12px;left:-2px;width:0;height:0;border-top:10px solid var(--z-book-card-ribbon-shadow-color);border-left:16px solid transparent;content:""}:host>article div.cover .ribbon z-icon{margin-right:var(--space-unit)}:host>article div.content{margin:var(--space-unit) 0;border-radius:var(--border-radius)}:host>article .title{display:flex;height:100%;align-self:center;color:var(--color-default-text);font-size:var(--font-size-4);font-weight:var(--font-sb);line-height:1.5}:host>article .title *{all:unset}:host>article div.subtitle{color:var(--color-default-text);font-size:var(--font-size-2);font-weight:var(--font-rg);line-height:1.4}:host>article div.authors{color:var(--color-default-text);font-size:var(--font-size-1);font-weight:var(--font-rg);line-height:1.33}:host>article div.isbn{overflow:hidden;color:var(--color-default-text);font-size:var(--font-size-2);line-height:1.33;text-overflow:ellipsis;white-space:nowrap;word-wrap:nowrap}:host>article div.isbn>.code{font-weight:var(--font-sb)}:host>article div.tags{display:flex;overflow:hidden;max-height:32px;flex-flow:row wrap;align-content:stretch;align-items:stretch;justify-content:flex-start;gap:calc(var(--space-unit) / 2)}:host>article ::slotted([slot="tags"]){margin-bottom:var(--space-unit)}:host>article ::slotted([slot="header-cta"]){--z-icon-width:20px;--z-icon-height:20px;padding:var(--space-unit);cursor:pointer;fill:var(--color-primary01-icon)}:host>article ::slotted([slot="header-cta"]:focus){box-shadow:var(--shadow-focus-primary);outline:none !important}:host>article.expanded{width:100%;min-width:328px;padding:calc(var(--space-unit) * 2);padding-bottom:0}:host>article.expanded div.header{display:flex;flex-flow:row nowrap;align-content:stretch;align-items:top;justify-content:space-between;margin-bottom:var(--space-unit);white-space:nowrap}:host>article.expanded div.cover div.img-wrapper{border-radius:var(--border-radius)}:host>article.expanded div.cover div.img-wrapper img{width:100%}:host>article.expanded .title,:host>article.expanded .subtitle,:host>article.expanded .authors{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:initial}:host>article.expanded div.footer{border-top:var(--border-size-small) solid var(--color-surface03);margin-bottom:calc(var(--space-unit) * 1.5)}:host>article.expanded div.footer.open{padding-top:calc(var(--space-unit) * 1.5)}:host>article.expanded div.footer.open div.resources{display:initial}:host>article.expanded div.footer.close div.resources{display:none}:host>article.expanded button.show-resources{--z-icon-height:16px;--z-icon-width:16px;all:unset;display:flex;width:100%;flex-flow:row nowrap;align-content:center;align-items:center;justify-content:center;padding:calc(var(--space-unit) * 1) 0;color:var(--color-text-link-blue);cursor:pointer;fill:var(--color-text-link-blue);font-size:var(--font-size-2);font-weight:var(--font-sb);gap:var(--space-unit)}:host>article.expanded button.show-resources:focus{box-shadow:var(--shadow-focus-primary)}:host>article.search{width:262px;height:616px;padding:calc(var(--space-unit) * 2);padding-bottom:0}:host>article.search .wrapper-container{display:flex;height:100%;flex-direction:column;justify-content:space-between}:host>article.search .wrapper-container .wrapper{height:451px}:host>article.search .wrapper-container .action-container{padding-bottom:calc(var(--space-unit) * 2)}:host>article.search div.header{display:flex;height:24px;flex-flow:row nowrap;align-content:stretch;align-items:center;justify-content:space-between;margin-bottom:calc(var(--space-unit) * 1.5);white-space:nowrap}:host>article.search div.cover div.img-wrapper{height:314px;border-radius:var(--border-radius)}:host>article.search .title{display:block;height:initial;align-self:unset;font-size:var(--font-size-3)}:host>article.search .title,:host>article.search .subtitle,:host>article.search .authors{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host>article.compact{width:var(--z-book-card-compact-width);height:var(--z-book-card-compact-height)}:host>article.compact.borderless{border:none}:host>article.compact div.cover div.img-wrapper{width:100%;height:calc(var(--z-book-card-compact-width) * 1.36);box-sizing:border-box;border:none;background:var(--color-white);border-radius:var(--border-radius) var(--border-radius) 0 0;box-shadow:var(--shadow-2)}:host>article.compact div.wrapper{display:flex;height:100%;flex-flow:column nowrap;align-content:stretch;align-items:stretch;justify-content:flex-start}:host>article.compact div.content{display:flex;box-sizing:border-box;flex-flow:column nowrap;align-content:stretch;align-items:stretch;justify-content:space-between;padding:calc(var(--space-unit) * 2);padding-top:var(--space-unit);margin:0}:host>article.compact div.action-container{padding:calc(var(--space-unit) * 2);padding-top:0;margin-top:auto}:host>article.compact.borderless div.cover div.img-wrapper{width:var(--z-book-card-compact-width)}:host>article.compact.borderless div.content{padding:0;padding-top:var(--space-unit)}:host>article.compact.borderless div.action-container{padding:0;padding-bottom:calc(var(--space-unit) * 2)}:host>article.compact .title{display:block;height:initial;align-self:unset}:host>article.compact .title,:host>article.compact .subtitle,:host>article.compact .authors{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:initial}@media (min-width: 768px){:host>article{width:100%;max-width:initial}:host>article .title{display:block;height:initial;align-self:unset}:host>article.expanded{width:100%;min-width:initial;max-width:initial;height:360px;padding:0;border:0}:host>article.expanded div.wrapper{display:flex;flex-flow:row nowrap;align-content:stretch;align-items:stretch;justify-content:flex-start}:host>article.expanded div.cover div.img-wrapper{width:262px;height:356px;border:0;border:var(--border-size-medium) solid var(--color-surface03);border-right:none;background:var(--color-surface01);border-radius:var(--border-radius) 0 0 var(--border-radius)}:host>article.expanded div.cover div.img-wrapper img{width:auto;border-radius:0}:host>article.expanded div.content{display:flex;overflow:hidden;width:100%;height:356px;flex-flow:column nowrap;align-content:stretch;align-items:stretch;justify-content:space-between;border:var(--border-size-medium) solid var(--color-surface03);border-left:none;margin:0;background:var(--color-surface01);border-radius:0 var(--border-radius) var(--border-radius) 0}:host>article.expanded div.content div.top{padding:calc(var(--space-unit) * 2);padding-bottom:0}:host>article.expanded div.content div.top div.info{display:flex;flex-flow:row nowrap;align-content:stretch;align-items:stretch;justify-content:space-between;margin-bottom:calc(var(--space-unit) / 2)}:host>article.expanded div.content div.top div.info>div.left{width:100%}:host>article.expanded div.content div.bottom{padding:calc(var(--space-unit) * 2);padding-bottom:0}}@media (min-width: 1152px){:host>article{width:fit-content;max-width:initial}}@media (min-width: 1366px){:host>article.expanded{width:635px}:host>article.expanded div.content{width:369px}}';const d=n;const c=class{constructor(i){t(this,i);this.ribbonClick=e(this,"ribbonClick",7);this.variant=undefined;this.cover=undefined;this.operaTitle=undefined;this.volumeTitle=undefined;this.authors=undefined;this.isbn=undefined;this.isbnLabel="";this.ribbon=undefined;this.ribbonIcon=undefined;this.ribbonInteractive=undefined;this.borderless=undefined;this.fallbackCover=undefined;this.operaTitleTag=undefined;this.isMobile=false;this.hasResources=false;this.showResources=false}emitRibbonClick(){this.ribbonClick.emit()}componentWillLoad(){this.id=`id-${s()}`;const t=window.matchMedia(`(max-width: ${o.MOBILE}px)`);this.isMobile=t.matches;t.onchange=t=>this.isMobile=t.matches}componentDidLoad(){this.handleResources()}handleResources(){var t;if(this.variant!==a.EXPANDED||!this.isMobile){return}this.hasResources=((t=this.hostElement.querySelectorAll("[slot=resources]"))===null||t===void 0?void 0:t.length)>0}toggleResources(){this.showResources=!this.showResources}renderCard(){switch(this.variant){case a.EXPANDED:return this.isMobile?this.renderMobileExpandedCard():this.renderExpandedCard();case a.COMPACT:return this.renderCompactCard();case a.SEARCH:return this.renderSearchCard()}}renderExpandedCard(){return i("div",{class:"wrapper"},this.renderCover(),i("div",{class:"content"},i("div",{class:"top"},i("div",{class:"info"},i("div",{class:"left"},this.renderAuthors(),this.renderOperaTitle(),this.renderVolumeTitle(),this.renderIsbn()),i("div",{class:"right"},this.renderHeaderCtaSlot())),this.renderTagsSlot()),i("div",{class:"bottom"},this.renderResourcesSlot())))}renderMobileExpandedCard(){return i("div",{class:"wrapper"},i("div",{class:"header"},this.renderOperaTitle(),this.renderHeaderCtaSlot()),this.renderCover(),i("div",{class:"content"},this.renderTagsSlot(),this.renderAuthors(),this.renderVolumeTitle(),this.renderIsbn()),this.hasResources&&i("div",{class:{footer:true,open:this.showResources,close:!this.showResources}},!this.showResources&&this.renderShowResources(),this.renderResourcesSlot(),this.showResources&&this.renderShowResources()))}renderSearchCard(){return i("div",{class:"wrapper-container"},i("div",{class:"wrapper"},i("div",{class:"header"},this.renderOperaTitle(),this.renderHeaderCtaSlot()),this.renderCover(),i("div",{class:"content"},this.renderTagsSlot(),this.renderAuthors(),this.renderVolumeTitle(),this.renderIsbn())),this.renderFooterCtaSlot())}renderCompactCard(){return i("div",{class:"wrapper"},this.renderCover(),i("div",{class:"content"},this.renderAuthors(),this.renderOperaTitle(),this.renderVolumeTitle(),this.renderIsbn()),this.renderFooterCtaSlot())}renderCover(){return i("div",{class:"cover"},this.ribbon&&this.variant!==a.COMPACT&&this.renderRibbon(),i("div",{class:"img-wrapper"},i("img",{src:this.cover,onError:()=>{if(this.fallbackCover){this.cover=this.fallbackCover}},"aria-hidden":"true"})))}renderRibbon(){const t=[this.ribbonIcon&&i("z-icon",{name:this.ribbonIcon,width:16,height:16,fill:"color-inverse-icon"}),i("span",null,this.ribbon)];return this.ribbonInteractive?i("button",{class:"ribbon interactive",onClick:()=>this.emitRibbonClick()},t):i("div",{class:"ribbon"},t)}renderOperaTitle(){const t=this.operaTitleTag?`<${this.operaTitleTag}>${this.operaTitle}</${this.operaTitleTag}>`:this.operaTitle;return i("div",{class:"title",innerHTML:t})}renderVolumeTitle(){return this.volumeTitle?i("div",{class:"subtitle"},this.volumeTitle):null}renderAuthors(){return this.authors?i("div",{class:"authors","aria-description":"Autori"},this.authors):null}renderIsbn(){return this.isbn?i("div",{class:"isbn"},i("span",{class:"code","aria-description":`ISBN ${this.isbnLabel}`},this.isbn),this.isbnLabel?i("span",{class:"label"}," ",this.isbnLabel):null):null}renderShowResources(){return i("button",{class:"show-resources","aria-label":`Risorse del libro ${this.operaTitle}`,"aria-expanded":this.showResources.toString(),"aria-controls":`resources-${this.id}`,onClick:()=>this.toggleResources()},this.showResources?"Chiudi":"Vedi tutto",i("z-icon",{name:this.showResources?"chevron-up":"chevron-down"}))}renderTagsSlot(){return i("div",{class:"tags"},i("slot",{name:"tags"}))}renderHeaderCtaSlot(){return i("slot",{name:"header-cta"})}renderResourcesSlot(){return i("div",{id:`resources-${this.id}`,class:"resources"},i("slot",{name:"resources",onSlotchange:()=>this.handleResources()}))}renderFooterCtaSlot(){return i("div",{class:"action-container"},i("slot",{name:"footer-cta"}))}render(){return i("article",{key:"a2248d9206aec07d317dddb8cb8d6061eccc7a53",class:{[this.variant]:true,borderless:!!this.borderless}},this.renderCard())}get hostElement(){return r(this)}};c.style=d;export{c as z_book_card_deprecated};
|
|
2
|
+
//# sourceMappingURL=p-758333dc.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as i,c as t,h as e}from"./p-75c4a726.js";import{P as n}from"./p-b34993de.js";import{d as s}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as i,c as t,h as e}from"./p-75c4a726.js";import{P as n}from"./p-b34993de.js";import{d as s}from"./p-e691c0b8.js";import"./p-5145a606.js";const o=':host{width:100%;font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>div{position:relative;display:grid;width:calc(100% + calc(var(--space-unit) * 2));height:402px;box-sizing:border-box;padding:calc(var(--space-unit) * 2) calc(var(--space-unit) * 3);border:var(--border-size-small) solid var(--color-primary01);margin-left:calc(-1 * var(--space-unit));background:var(--color-surface01);border-radius:0;box-shadow:0 2px 4px 0 rgb(66 69 72 / 35%)}:host>div>z-icon{position:absolute;top:var(--space-unit);right:var(--space-unit);cursor:pointer;fill:var(--color-primary01)}:host>div>div.cta-wrapper{display:flex;flex-flow:column nowrap;align-self:end;justify-content:space-between}:host>div>div.content-wrapper{position:relative;overflow:hidden;align-self:stretch}:host>div>div.content-wrapper>section{box-sizing:border-box;padding:var(--space-unit) 0;border-bottom:var(--border-size-small) solid var(--color-surface04);color:var(--color-surface05);font-size:14px;line-height:20px}:host>div>div.content-wrapper>section:last-child{border-bottom:none}:host>div>div.content-wrapper>section.info-wrapper{position:relative;overflow:hidden;box-sizing:border-box}:host>div>div.content-wrapper>section.info-wrapper.hidden::after{position:absolute;top:0;right:0;bottom:0;left:0;background:linear-gradient(180deg, rgb(255 0 0 / 0%), rgb(255 0 0 / 0%) 60%, white);content:"";pointer-events:none}:host>div>div.content-wrapper>section>span.license-heading{display:flex;justify-content:space-between}:host>div>div.content-wrapper>section>span.license-heading>span.expired{color:var(--color-primary01);font-size:12px;font-weight:600}:host>div>div.content-wrapper>section>span.license-heading>span.expiring{color:var(--color-warning01);font-size:12px;font-weight:600}:host>div>div.content-wrapper>z-popover{position:absolute;top:0;left:calc(var(--space-unit) * 4)}';const r=o;const l=class{emitFlipCard(i=false){this.flipCard.emit(i)}constructor(e){i(this,e);this.flipCard=t(this,"flipCard",7);this.data=undefined;this.htmltabindex=0;this.hiddenContent=false;this.tooltip=false;this.emitFlipCard=this.emitFlipCard.bind(this)}componentWillLoad(){this.setStringOrArray()}componentWillUpdate(){this.setStringOrArray()}componentDidRender(){this.handleContentHeight()}handleContentHeight(){if(!this.contentWrapper&&!this.infoWrapper){this.hiddenContent=false;return}if(this.contentWrapper.scrollHeight>this.contentWrapper.offsetHeight||this.infoWrapper.scrollHeight>this.infoWrapper.offsetHeight){const i=this.contentWrapper.offsetHeight-this.onlineLicenseWrapper.offsetHeight-this.offlineLicenseWrapper.offsetHeight;this.infoWrapper.style.height=`${i}px`;this.hiddenContent=true;return}this.hiddenContent=false}setStringOrArray(){if(typeof this.data==="string"){this.cardData=JSON.parse(this.data)}else{this.cardData=this.data}}renderCloseIcon(){return e("z-icon",{name:"multiply-circled-filled",height:18,width:18,onClick:()=>this.emitFlipCard(false),tabindex:this.htmltabindex,onKeyUp:i=>{s(i,this.emitFlipCard,false)}})}renderGeneralSection(){var i,t;const n=(i=this===null||this===void 0?void 0:this.cardData)===null||i===void 0?void 0:i.title;const s=(t=this===null||this===void 0?void 0:this.cardData)===null||t===void 0?void 0:t.description;return e("section",{class:`info-wrapper ${this.hiddenContent?"hidden":""}`,onClick:()=>{if(this.hiddenContent){this.tooltip=!this.tooltip}},ref:i=>this.infoWrapper=i},this.renderAuthor(),this.renderYear(),n,e("br",null),s)}renderAuthor(){var i;const t=(i=this===null||this===void 0?void 0:this.cardData)===null||i===void 0?void 0:i.author;if(!t){return null}return e("span",null,"Autore: ",e("b",null,t),e("br",null))}renderYear(){var i;const t=(i=this===null||this===void 0?void 0:this.cardData)===null||i===void 0?void 0:i.year;if(!t){return null}return e("span",null,"Anno: ",e("b",null,t),e("br",null))}renderTooltip(){if(!this.tooltip){return}if(!this.cardData){return}const{title:i,year:t,author:s,description:o}=this.cardData;return e("z-popover",{position:n.RIGHT,onClick:()=>this.tooltip=false},`${i} ${t} ${s} ${o}`)}setExpirationLicenseMessage(i){if(i==="online"&&this.cardData.onlineLicense.expired||i==="offline"&&this.cardData.offlineLicense.expired){return e("span",{class:"expired"},"SCADUTA")}if(i==="online"&&this.cardData.onlineLicense.expiring||i==="offline"&&this.cardData.offlineLicense.expiring){return e("span",{class:"expiring"},"IN SCADENZA")}}renderOnlineLicenseSection(){var i;if(!((i=this===null||this===void 0?void 0:this.cardData)===null||i===void 0?void 0:i.onlineLicense)){return}return e("section",{ref:i=>this.onlineLicenseWrapper=i},e("span",{class:"license-heading"},e("span",null,"Licenza online"),this.setExpirationLicenseMessage("online")),"Scadenza il ",e("b",null,this.cardData.onlineLicense.expiration),e("br",null))}renderOfflineLicenseSection(){var i;if(!((i=this===null||this===void 0?void 0:this.cardData)===null||i===void 0?void 0:i.offlineLicense)){return}return e("section",{ref:i=>this.offlineLicenseWrapper=i},e("span",{class:"license-heading"},e("span",null,"Licenza offline"),this.setExpirationLicenseMessage("offline")),"Scadenza il ",e("b",null,this.cardData.offlineLicense.expiration),e("br",null),"Installazioni disponibili: ",e("b",null,this.cardData.offlineLicense.installations))}render(){return e("div",{key:"0f8111d48191f306b232f8b9e167aeffced4674b"},this.renderCloseIcon(),e("div",{key:"57b77f2f3ad645cebb44d6a247d93c1e82b8f281",class:"content-wrapper",ref:i=>this.contentWrapper=i},this.renderGeneralSection(),this.renderTooltip(),this.renderOnlineLicenseSection(),this.renderOfflineLicenseSection()),e("div",{key:"226bd8e804cecfee34ff748a5d1936e68f6b2307",class:"cta-wrapper"},e("slot",{key:"2fc25a5fd61a0a04a44ceabb3372265424708f5f"})))}};l.style=r;export{l as z_myz_card_info};
|
|
2
|
+
//# sourceMappingURL=p-7af33b00.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,a as s,g as o}from"./p-75c4a726.js";import{U as n,V as r,p as a,g as l,P as h,i as
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as i,h as e,a as s,g as o}from"./p-75c4a726.js";import{U as n,V as r,p as a,g as l,P as h,i as c}from"./p-b34993de.js";import{g as p,d}from"./p-e691c0b8.js";import"./p-5145a606.js";const u=":host{font-family:var(--font-family-sans);font-weight:var(--font-rg);--line-clamp-popover:0;--line-clamp-mobile:1}*{box-sizing:border-box}button{padding:0;border:none;margin:0;background-color:transparent}nav{display:flex;align-items:center}ol{display:flex;align-items:center;padding:0;margin:0;column-gap:var(--space-unit);list-style:none}li{display:flex;align-items:center;justify-content:flex-start;column-gap:var(--space-unit)}ol li>a,ol li>button{font-size:var(--font-size-2);letter-spacing:0.16px;line-height:1.4}a:focus,button:focus{box-shadow:var(--shadow-focus-primary);outline:none}a{color:var(--color-text-link-blue);white-space:nowrap}a.missing-path{color:var(--color-default-text)}.text-ellipsis{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:var(--line-clamp-mobile);text-overflow:ellipsis;white-space:initial}nav.semibold>ol>li>a:not(.missing-path),nav.semibold>ol>li>button{font-weight:var(--font-sb);text-decoration:none}nav.underlined a,nav.underlined button{text-decoration:underline}z-icon{--z-icon-width:16px;--z-icon-height:16px;display:block;fill:var(--color-text-link-blue)}z-icon.separator{--z-icon-width:10px;--z-icon-height:10px;fill:var(--gray500)}button.dots{display:inline-block;color:var(--color-text-link-blue);cursor:pointer}.hidden-paths-popover .popover-content{max-width:302px;padding:calc(var(--space-unit) / 2) var(--space-unit);text-align:left}.hidden-paths-popover .popover-content a{font-weight:var(--font-rg);text-decoration:none}.hidden-paths-popover{--z-popover-theme--surface:var(--color-background);--z-popover-padding:0}.hidden-paths-popover::before,.full-path-tooltip::before{--arrow-edge-offset:calc(100% - (var(--space-unit) * 2.55))}.full-path-tooltip{--z-popover-theme--surface:var(--color-surface05);--z-popover-theme--text:var(--color-text-inverse);--z-popover-padding:0}.tooltip-content{padding:0 var(--space-unit);font-size:var(--font-size-2)}@media (min-width: 768px){.text-ellipsis{-webkit-line-clamp:var(--line-clamp-popover)}}@media (max-width: 767px){li a{display:flex;align-items:center;column-gap:var(--space-unit)}}";const f=u;const m=class{constructor(e){t(this,e);this.clickOnNode=i(this,"clickOnNode",7);this.collapsedElements=[];this.currentIndex=0;this.truncatePosition=null;this.pathStyle=n.UNDERLINED;this.homepageVariant=r.ICON;this.maxNodesToShow=5;this.preventFollowUrl=false;this.overflowMenuItemRows=0;this.truncateChar=30;this.viewPortWidth=undefined;this.hasOverflow=false;this.popoverEllipsisOpen=false}handleResize(){this.viewPortWidth=p();if(this.viewPortWidth!==a.MOBILE&&this.wrapElement&&this.wrapElement.scrollWidth>this.wrapElement.clientWidth){this.hasOverflow=true}}handlePropChange(){this.initializeBreadcrumb()}handleResizeUp(t,i){if(t===a.MOBILE||i===a.MOBILE&&t===a.TABLET||i===a.MOBILE&&t===a.DESKTOP||i===a.MOBILE&&t===a.DESKTOP_WIDE||i===a.TABLET&&t===a.DESKTOP||i===a.TABLET&&t===a.DESKTOP_WIDE||i===a.DESKTOP&&t===a.DESKTOP_WIDE){this.initializeBreadcrumb()}}componentWillLoad(){this.viewPortWidth=p();this.initializeBreadcrumb()}componentWillRender(){if(this.viewPortWidth!==a.MOBILE&&this.hasOverflow){this.checkEllipsisOrOverflowMenu();this.hasOverflow=false}}componentDidRender(){if(this.collapsedElementsRef){this.anchorElements=Array.from(this.hostElement.shadowRoot.querySelectorAll("z-list-group a"))}if(this.viewPortWidth!==a.MOBILE&&this.wrapElement.scrollWidth>this.wrapElement.clientWidth){this.hasOverflow=true}}initializeBreadcrumb(){if(this.viewPortWidth===a.MOBILE){this.pathsList=this.getPathsItemsList().filter((t=>!!t.path))}else{this.pathsList=this.getPathsItemsList()}this.homepageNode=this.pathsList.shift();this.pathListCopy=[...this.pathsList];this.collapsedElements=[];if(this.pathsList.length>this.maxNodesToShow){this.collapsedElements=this.pathsList.splice(0,this.pathsList.length-2)}}checkEllipsisOrOverflowMenu(){for(let t=0;t<this.pathsList.length;t++){if(this.pathsList[t].text.length<=this.truncateChar){continue}if(this.truncatePosition>0){this.collapsedElements.push(...this.pathListCopy.splice(0,this.truncatePosition));this.pathsList.splice(0,this.truncatePosition);this.truncatePosition=0;return}else if(this.truncatePosition===0){this.collapsedElements.push(...this.pathListCopy.splice(0,this.truncatePosition+1));this.pathsList.splice(0,this.truncatePosition+1);this.truncatePosition=null;return}if(t!==this.pathsList.length-1){const i=this.truncateWithEllipsis(this.pathsList[t].text,this.truncateChar);this.currentEllipsisText=this.pathsList[t].text;this.pathsList[t].text=i;this.pathsList[t].hasTooltip=true;this.truncatePosition=t;return}}}truncateWithEllipsis(t,i){if(t.length<=i){return t}return t.substring(0,i-1)+"…"}getPathsItemsList(){return Array.from(this.hostElement.children).map((t=>({text:t.textContent,path:t.href,hasTooltip:false})))}renderHomepageNode(){return e("li",null,e("a",{class:{"homepage-text":this.homepageVariant===r.TEXT},href:this.homepageNode.path,onClick:t=>this.handlePreventFollowUrl(t,this.homepageNode),innerHTML:this.homepageVariant===r.ICON?`<z-icon name="home" />`:this.homepageNode.text||"Home"}),this.pathsList.length>0&&e("z-icon",{class:"separator",name:"chevron-right"}))}togglePopover(){if(!this.collapsedElementsRef.open){this.collapsedElementsRef.open=true}}handlePreventFollowUrl(t,i){if(this.preventFollowUrl){t.preventDefault();this.clickOnNode.emit(i.path)}}handleOverflowMenuAccessibility(t){const i=this.anchorElements.length;if(t.key===l.TAB){t.preventDefault();return}t.stopPropagation();const e=[l.ARROW_DOWN,l.ARROW_UP];if(e.includes(t.key)){t.preventDefault();if(t.key===l.ARROW_DOWN){this.currentIndex=i===this.currentIndex+1?0:this.currentIndex+1}if(t.key===l.ARROW_UP){this.currentIndex=this.currentIndex<=0?i-1:this.currentIndex-1}this.anchorElements[this.currentIndex].focus()}if(t.key===l.ESC){this.triggerButton.focus()}}renderOverflowMenu(){return e("li",null,e("z-popover",{class:"hidden-paths-popover",ref:t=>this.collapsedElementsRef=t,bindTo:this.triggerButton,position:h.BOTTOM_RIGHT,closable:true,showArrow:true},e("div",{class:"popover-content"},e("z-list",null,e("z-list-group",{size:c.SMALL},this.collapsedElements.map(((t,i,s)=>e("div",null,e("z-list-element",{clickable:true},e("a",{class:"text-ellipsis",href:t.path,onClick:i=>this.handlePreventFollowUrl(i,t),onKeyDown:t=>this.handleOverflowMenuAccessibility(t),innerHTML:t.text})),i<s.length-1&&e("z-divider",{color:"color-surface03"})))))))),e("button",{class:"dots",ref:t=>this.triggerButton=t,"aria-label":"Mostra più breadcrumb","aria-haspopup":"true",onClick:()=>{this.togglePopover()},onKeyDown:t=>{d(t,this.togglePopover.bind(this));setTimeout((()=>{this.anchorElements[0].focus()}),100)},innerHTML:"…"}),this.pathsList.length>0&&e("z-icon",{class:"separator",name:"chevron-right"}))}renderMobileItems(){const t=this.pathsList[this.pathsList.length-1];if(!t){return}return e("li",null,e("a",{"aria-current":t.path?undefined:"page",href:t.path,onClick:i=>this.handlePreventFollowUrl(i,t)},e("z-icon",{name:"chevron-left"}),e("span",{class:{"missing-path":!t.path,"text-ellipsis":true}},t.text)))}renderItems(){let t;return[this.renderHomepageNode(),this.collapsedElements.length>0&&this.renderOverflowMenu(),...this.pathsList.map(((i,s)=>e("li",null,i.hasTooltip&&e("z-popover",{class:"full-path-tooltip",bindTo:t,open:this.popoverEllipsisOpen,position:h.BOTTOM_RIGHT,closable:false,showArrow:true},e("span",{class:"tooltip-content"},this.currentEllipsisText)),e("a",{class:{"missing-path":!i.path},ref:i=>t=i,"aria-current":i.path?undefined:"page",href:i.path,onClick:t=>this.handlePreventFollowUrl(t,i),onMouseOver:()=>{if(i.hasTooltip){this.popoverEllipsisOpen=true}},onMouseLeave:()=>{if(i.hasTooltip){this.popoverEllipsisOpen=false}},innerHTML:i.text}),s!==this.pathsList.length-1&&e("z-icon",{class:"separator",name:"chevron-right"}))))]}render(){return e(s,{key:"3d0996a611fe483de9a015c3ac5b25b06d5e302c",style:{"--line-clamp-popover":`${this.overflowMenuItemRows}`}},e("nav",{key:"8c45a561fcdebb6c7685010dc7105b6c756025e1",ref:t=>this.wrapElement=t,"aria-label":"Breadcrumb",class:{semibold:this.pathStyle===n.SEMIBOLD,underlined:this.pathStyle===n.UNDERLINED}},e("ol",{key:"5cbdbcb8a14a471ae6dbad1d5d7eeb4ca3c8482b"},this.viewPortWidth===a.MOBILE?this.renderMobileItems():this.renderItems())))}get hostElement(){return o(this)}static get watchers(){return{maxNodesToShow:["handlePropChange"],viewPortWidth:["handleResizeUp"]}}};m.style=f;export{m as z_breadcrumb};
|
|
2
|
+
//# sourceMappingURL=p-7f370d17.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,h as e,g as i}from"./p-75c4a726.js";import{p as r}from"./p-b34993de.js";import{i as s,g as o,d as n}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as e,g as i}from"./p-75c4a726.js";import{p as r}from"./p-b34993de.js";import{i as s,g as o,d as n}from"./p-e691c0b8.js";import"./p-5145a606.js";const a=':host{display:block;width:inherit;font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>div{display:flex;width:inherit;flex-direction:column}main{position:relative;overflow:hidden;width:100%}main z-icon.scroll{position:absolute;z-index:10;top:50%;width:auto;margin:0 var(--space-unit);cursor:pointer;fill:var(--color-primary01);transition:0.6s ease}main .scroll.disabled{opacity:0.5;pointer-events:none}main .scroll.right{right:0}#slides{display:flex;flex-wrap:wrap;line-height:0px;overflow-y:hidden;transition:all 300ms}footer{display:grid;width:100%;height:56px;align-items:center;border-top:var(--border-size-medium) solid var(--color-background);grid-template:2 / 2;grid-template-areas:"center center" "left right"}footer>div{width:100%;align-items:center}footer .footer-center{grid-area:center}footer .footer-left{grid-area:left}footer .footer-right{grid-area:right}footer .bullet-container{display:flex;min-height:60px;align-items:center;justify-content:center;margin:0 auto}footer .bullet-container .bullet{width:8px;height:8px;margin:var(--space-unit) 2px;background-color:var(--gray200);border-radius:50%;pointer-events:none}footer .bullet-container .bullet.selected{background-color:var(--gray400)}main z-icon:focus,footer .bullet-container .bullet:focus{border-radius:50%;box-shadow:var(--shadow-focus-primary);outline:none !important}@media only screen and (min-width: 768px){footer{height:76px;border-top:var(--border-size-medium) solid var(--color-background);grid-template:1 / 1fr 2fr 1fr;grid-template-areas:"left center right"}footer .bullet-container .bullet{width:10px;height:10px;margin:var(--space-unit) 3px}}@media only screen and (min-width: 1025px){main z-icon.scroll{margin:0 10px}footer .bullet-container .bullet{width:16px;height:16px;margin:var(--space-unit) calc(var(--space-unit) * 0.5);cursor:pointer;pointer-events:auto}}';const l=a;function d(t){return Array.isArray(t)&&t.every((t=>typeof t==="string"))}const h=class{constructor(e){t(this,e);this.slideshowid=undefined;this.data=undefined;this.device=undefined;this.currentSlide=0}watchData(){this.parseLinks()}componentWillLoad(){this.parseLinks();this.setDevice();window.addEventListener("resize",this.handleResize.bind(this))}componentDidRender(){this.setStyle()}handleResize(){this.setDevice();this.setStyle()}parseLinks(){var t;switch(typeof this.data){case"string":{const e=(t=s(this.data))!==null&&t!==void 0?t:[];if(!d(e)){throw new Error("Passed data is invalid")}this.links=e;break}default:this.links=this.data;break}}setStyle(){const t=this.el.shadowRoot.querySelector("#slides");if(!t){return}const e=this.el.shadowRoot.querySelectorAll(".slide");const i=this.el.offsetWidth;const r=i*this.links.length;t.style.width=`${r}px`;t.style.transform=`translate(-${i*this.currentSlide}px)`;e.forEach((t=>{const e=t.querySelector("img");e.style.width=`${i}px`}))}setDevice(){this.device=o()}setCurrentSlide(t){this.currentSlide=t}getBulletDimension(){switch(this.device){case r.MOBILE:return 24;case r.TABLET:return 32;default:return 40}}renderSlides(t){return e("div",{id:"slides"},t.map(((t,i)=>e("div",{id:"slide"+i,class:`slide ${this.currentSlide!==i&&"hide"}`},e("img",{src:t})))))}renderScroll(t){let i=false,r=this.currentSlide;if(t==="left"){i=this.currentSlide===0;r--}else if(t==="right"){i=this.currentSlide===this.links.length-1;r++}return e("z-icon",{class:`scroll ${t} ${i&&"disabled"}`,width:this.getBulletDimension(),height:this.getBulletDimension(),name:`chevron-${t}-circle`,onClick:()=>{!i&&this.setCurrentSlide(r)},onKeyUp:t=>!i&&n(t,(()=>{this.setCurrentSlide(r)})),tabindex:0,role:"button"})}renderSlideshowMain(){return e("main",null,this.renderScroll("left"),this.renderSlides(this.links),this.renderScroll("right"))}renderBullet(t){return e("a",{class:`bullet ${this.currentSlide===t&&"selected"}`,onClick:()=>this.setCurrentSlide(t),onKeyUp:e=>n(e,(()=>this.setCurrentSlide(t))),tabindex:0,role:"button"})}renderSlideshowFooter(){return e("footer",null,e("div",{class:"footer-left"},e("slot",{name:"footer-left"})),e("div",{class:"footer-center"},e("div",{class:"bullet-container"},Object.keys(this.links).map((t=>this.renderBullet(parseInt(t)))))),e("div",{class:"footer-right"},e("slot",{name:"footer-right"})))}render(){if(!this.links||!this.links.length){return e("div",null)}return e("div",{id:this.slideshowid},this.renderSlideshowMain(),this.renderSlideshowFooter())}get el(){return i(this)}static get watchers(){return{data:["watchData"]}}};h.style=l;export{h as z_slideshow};
|
|
2
|
+
//# sourceMappingURL=p-9c4b7a51.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as e,h as o,a,g as n}from"./p-75c4a726.js";import{r}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as e,h as o,a,g as n}from"./p-75c4a726.js";import{r}from"./p-e691c0b8.js";import"./p-14e61df6.js";import"./p-123739cb.js";const s=":host{--columns:1;display:grid;box-sizing:border-box;grid-auto-flow:column;grid-template-columns:var(--z-table--expand-button-size, 0) repeat(var(--columns), minmax(128px, 1fr))}*{box-sizing:border-box}.z-tr--expand-button-container,::slotted(*){border-bottom:var(--z-table--cells-bottom-border-size, var(--border-size-small)) solid var(--color-surface03)}::slotted(*:not(:last-child)){border-right:var(--z-table--cell-left-border, none)}:host([expandable]){--show-expandable-button:visible;cursor:pointer}:host([expandable]) ::slotted(*){grid-row:1}:host([expandable]) ::slotted(:nth-last-child(2)){border-right:none}:host([expandable]) ::slotted(*:last-child){border-left:0;grid-column:1 / span calc(var(--columns) + 1);grid-row:2}:host([expandable]:not([expanded])) ::slotted(*:last-child){display:none}:host([expanded]){margin-bottom:4px;box-shadow:0 4px 4px -2px var(--shadow-color-base)}:host([expanded]) .z-tr--expand-button-container,:host([expanded]) ::slotted(*){background-color:var(--color-background)}.z-tr--expand-button-container{display:flex;align-items:center;justify-content:center;background-color:var(--z-table--cells-background, var(--color-surface01))}.z-tr--expand-button-container button{display:flex;align-items:center;justify-content:center;padding:0;border:none;margin:auto;appearance:none;background:transparent;cursor:pointer;visibility:var(--show-expandable-button, hidden)}.z-tr--expand-button-container button:focus{box-shadow:var(--shadow-focus-primary);outline:none}.z-tr--expand-button-container button z-icon{--z-icon-width:16px;--z-icon-height:16px}";const i=s;const d=class{constructor(o){t(this,o);this.expand=e(this,"expand",7);this.expandable=false;this.expanded=false;this.expandableContentId=undefined}updateColumns(){const t=Array.from(this.host.querySelectorAll("z-td, z-th"));if(this.expandable){t.pop()}const e=t.map((t=>t.colspan||1)).reduce(((t,e)=>t+e),0);this.host.style.setProperty("--columns",`${e}`);if(this.expandable){const e=t.pop();e.id=e.id||`z-tr-expandable-content-${r()}`;this.expandableContentId=e.id}}onRowClick(t){const e=t.target.closest(".prevent-expand");if(!this.expandable||e){return}this.expanded=!this.expanded;this.expand.emit({expanded:this.expanded})}componentWillLoad(){this.updateColumns()}render(){return o(a,{key:"467c0a01f3c28851b85d47bd178e6555cbb3f57f",role:"row",onClick:this.onRowClick.bind(this),expanded:this.expanded},o("div",{key:"ff2c7ecbc7775ee60951a3df3e7ecf67a6d77362",class:"z-tr--expand-button-container"},this.expandable&&o("button",{key:"fe1297aafa51d66acd09794bf47333079bc90604","aria-expanded":this.expanded?"true":"false","aria-label":this.expanded?"Comprimi riga":"Espandi riga","aria-controls":this.expandableContentId,type:"button"},o("z-icon",{key:"517ffd66223d3ca7dc093aaa730455a02e6a61fd",name:this.expanded?"minus-circled":"plus-circled"}))),o("slot",{key:"cead9ff3b1da3cf20982bdc87413414925264c40",onSlotchange:this.updateColumns.bind(this)}))}get host(){return n(this)}static get watchers(){return{expandable:["updateColumns"]}}};d.style=i;export{d as Z};
|
|
2
|
+
//# sourceMappingURL=p-bba6129f.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as t,h as s,a as c}from"./p-75c4a726.js";import{k as i}from"./p-b34993de.js";import{r as a}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as t,h as s,a as c}from"./p-75c4a726.js";import{k as i}from"./p-b34993de.js";import{r as a}from"./p-e691c0b8.js";import"./p-5145a606.js";const l='.sc-z-toggle-switch-h{position:relative;display:inline-flex;font-family:var(--font-family-sans);font-weight:var(--font-rg)}label.sc-z-toggle-switch{display:flex;flex-direction:row;align-items:center;cursor:pointer}label.disabled.sc-z-toggle-switch{cursor:default}label.right.sc-z-toggle-switch{flex-direction:row-reverse}label.sc-z-toggle-switch>span.sc-z-toggle-switch:first-child{color:var(--color-default-text);letter-spacing:0}label.left.sc-z-toggle-switch>span.sc-z-toggle-switch:first-child{margin-right:var(--space-unit)}label.right.sc-z-toggle-switch>span.sc-z-toggle-switch:first-child{margin-left:var(--space-unit)}label.sc-z-toggle-switch>span.container.sc-z-toggle-switch{position:relative;top:1px;left:1px;display:flex;width:calc(var(--space-unit) * 4);height:18px;align-items:center;background-color:var(--gray500);border-radius:var(--space-unit);color:var(--gray500);cursor:pointer}label.sc-z-toggle-switch>span.container.disabled.sc-z-toggle-switch,label.sc-z-toggle-switch>span.container.checked.disabled.sc-z-toggle-switch{background-color:var(--color-disabled01);cursor:default}label.sc-z-toggle-switch>span.container.checked.disabled.sc-z-toggle-switch>span.circle.sc-z-toggle-switch>z-icon.sc-z-toggle-switch{fill:var(--color-disabled01)}label.sc-z-toggle-switch>span.container.checked.sc-z-toggle-switch{background-color:var(--color-primary01);fill:var(--color-primary01)}input.sc-z-toggle-switch:focus:focus-visible+label.sc-z-toggle-switch>span.container.sc-z-toggle-switch:not(.disabled){box-shadow:var(--shadow-focus-primary);outline:none}input.sc-z-toggle-switch:focus:focus-visible+label.sc-z-toggle-switch>span.container.disabled.sc-z-toggle-switch{outline:none}label.sc-z-toggle-switch>span.container.sc-z-toggle-switch:not(.disabled):hover{background-color:var(--color-hover-primary);fill:var(--color-hover-primary)}label.sc-z-toggle-switch>span.container.sc-z-toggle-switch>span.circle.sc-z-toggle-switch{position:absolute;top:1px;left:1px;display:flex;width:calc(var(--space-unit) * 2);height:calc(var(--space-unit) * 2);align-items:center;justify-content:center;margin:0;background-color:var(--color-white);border-radius:7px;box-shadow:var(--shadow-1);transition:transform 0.3s ease}label.sc-z-toggle-switch>span.container.checked.sc-z-toggle-switch>span.circle.sc-z-toggle-switch{transform:translateX(calc(100% - 2px))}input[type="checkbox"].sc-z-toggle-switch{position:absolute;z-index:-1;opacity:0;pointer-events:none}';const o=l;const r=class{constructor(s){e(this,s);this.toggleClick=t(this,"toggleClick",7);this.disabled=false;this.labelPosition=i.LEFT;this.checked=false;this.htmlid=`toggle-switch-id-${a()}`}emitToggleClick(){this.toggleClick.emit({id:this.htmlid,checked:this.checked})}handleClick(e){if(this.disabled){return}this.checked=e.target.checked;this.emitToggleClick()}render(){return s(c,{key:"b572a91e4ed2f91cbe0b7a393371425a5b9b896a"},s("input",{key:"acff3447044eba6dd7622feb954a03d5503111f1",id:this.htmlid,type:"checkbox",checked:this.checked,disabled:this.disabled,onChange:this.handleClick.bind(this)}),s("label",{key:"58b70932d34e39bb1c078947eea614d6384b9660",htmlFor:this.htmlid,class:{[this.labelPosition]:true,disabled:this.disabled}},s("span",{key:"824e029aeb434813b35f72891d991f19a90daded"},s("slot",{key:"37e8bad4378c65f4a3411fee47a960b9220af5d3"})),s("span",{key:"55eaf2b824ce8e91b77b5f8f2677724b2834fad6",class:{container:true,disabled:this.disabled,checked:this.checked}},s("span",{key:"41b7660f89b5ba9829782d3e6b041323357fdefa",class:"circle"},this.checked&&s("z-icon",{key:"ae68c35e2765c6eece7dcee8f7ad570a6fc0aa34",width:12,height:12,name:"checkmark"})))))}};r.style=o;export{r as z_toggle_switch};
|
|
2
|
+
//# sourceMappingURL=p-bd571858.entry.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,h as i,a as n,g as o}from"./p-75c4a726.js";import{T as s}from"./p-b34993de.js";import{f as e,d as c}from"./p-e691c0b8.js";import"./p-5145a606.js";const r=".sc-z-skip-to-content-h{position:absolute;left:-100%;height:60px;box-sizing:border-box;padding:calc(var(--space-unit) * 1.25) calc(var(--space-unit) * 3);background-color:#24f4ff;font-family:var(--font-family-sans);font-weight:var(--font-rg);text-align:center}.sc-z-skip-to-content-h>.link-container.sc-z-skip-to-content{display:inline-flex;height:100%;align-items:center}.skip-to-content-visible.sc-z-skip-to-content-h,.sc-z-skip-to-content-h:focus{position:static;display:block}.sc-z-skip-to-content-h>.link-container.sc-z-skip-to-content>a.z-link.link-invisible.sc-z-skip-to-content{overflow:hidden;width:0;height:0}.sc-z-skip-to-content-h>.link-container.sc-z-skip-to-content>a.z-link.link-visible.sc-z-skip-to-content{width:initial;height:initial}.dark.sc-z-skip-to-content-h{background-color:var(--color-surface05);color:var(--color-surface01)}.light.sc-z-skip-to-content-h{border:var(--border-size-medium) solid var(--color-surface05);background-color:var(--color-surface01);color:var(--color-default-text)}@media (min-width: 768px){.sc-z-skip-to-content-h{text-align:start}}@media (min-width: 1152px){.sc-z-skip-to-content-h>.link-container.sc-z-skip-to-content{padding:0 calc(var(--space-unit) * 3);border-right:var(--border-size-small) solid var(--color-surface05)}.sc-z-skip-to-content-h>.link-container.sc-z-skip-to-content>a.z-link.link-invisible.sc-z-skip-to-content{overflow:initial;width:initial;height:initial}.sc-z-skip-to-content-h>.link-container.sc-z-skip-to-content:first-child{padding-left:0}.sc-z-skip-to-content-h>.link-container.sc-z-skip-to-content:last-child,.dark.sc-z-skip-to-content-h>.link-container.sc-z-skip-to-content:last-child,.light.sc-z-skip-to-content-h>.link-container.sc-z-skip-to-content:last-child{padding-right:0;border-right:none}.dark.sc-z-skip-to-content-h>.link-container.sc-z-skip-to-content{border-right:var(--border-size-small) solid var(--color-surface01)}}";const a=r;const l=class{constructor(i){t(this,i);this.variant=undefined;this.links=[];this.visible=false;this.visibleLink=""}handleFocusOutSkipToContent(t){if(this.isInSkipToContent(t.target)){this.visible=false}}handleFocusSkipToContent(t){if(this.isInSkipToContent(t.target)){this.visible=true}}componentDidLoad(){this.showFirstChild()}componentWillRender(){if(this.links){this.links=typeof this.links==="string"?JSON.parse(this.links):this.links}}isInSkipToContent(t){const i=e(t);const n=i.find((t=>t.nodeName.toLowerCase()==="z-skip-to-content"));return!!n}showFirstChild(){var t;const i=(t=this.hostElement.children)===null||t===void 0?void 0:t[0];if(i){this.visibleLink=i.id}}handleLinkClick(){this.visible=false}render(){return i(n,{key:"3887a0d40964e8bb4dd860e49dccca7863f2a902",class:{[this.variant]:true,"skip-to-content-visible":this.visible}},this.links.map(((t,n)=>{const o=`skip-to-content-${n}`;return i("div",{class:"link-container"},i("a",{id:o,class:{"body-1-sb":true,"z-link":true,"z-link-underline":true,"z-link-inverse":this.variant===s.DARK,"link-visible":o==this.visibleLink,"link-invisible":o!=this.visibleLink},"aria-label":t.ariaLabel||t.label,href:t.href,onFocus:()=>this.visibleLink=o,onClick:()=>this.handleLinkClick(),onKeyUp:t=>c(t,this.handleLinkClick.bind(this))},t.label))})))}get hostElement(){return o(this)}};l.style=a;export{l as z_skip_to_content};
|
|
2
|
+
//# sourceMappingURL=p-c29a520b.entry.js.map
|
package/{www/build/p-34f4f441.entry.js.map → dist/web-components-library/p-c29a520b.entry.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["stylesCss","ZSkipToContentStyle0","ZSkipToContent","handleFocusOutSkipToContent","e","this","isInSkipToContent","target","visible","handleFocusSkipToContent","componentDidLoad","showFirstChild","componentWillRender","links","JSON","parse","elem","tree","getElementTree","menuParent","find","nodeName","toLowerCase","firstChild","_a","hostElement","children","visibleLink","id","handleLinkClick","render","h","Host","key","class","variant","map","link","i","ThemeVariant","DARK","ariaLabel","label","href","onFocus","onClick","onKeyUp","handleKeyboardSubmit","bind"],"sources":["src/components/z-skip-to-content/styles.css?tag=z-skip-to-content&encapsulation=scoped","src/components/z-skip-to-content/index.tsx"],"sourcesContent":[":host {\n position: absolute;\n left: -100%;\n height: 60px;\n box-sizing: border-box;\n padding: calc(var(--space-unit) * 1.25) calc(var(--space-unit) * 3);\n background-color: #24f4ff;\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n text-align: center;\n}\n\n:host > .link-container {\n display: inline-flex;\n height: 100%;\n align-items: center;\n}\n\n:host.skip-to-content-visible,\n:host:focus {\n position: static;\n display: block;\n}\n\n:host > .link-container > a.z-link.link-invisible {\n overflow: hidden;\n width: 0;\n height: 0;\n}\n\n:host > .link-container > a.z-link.link-visible {\n width: initial;\n height: initial;\n}\n\n:host.dark {\n background-color: var(--color-surface05);\n color: var(--color-surface01);\n}\n\n:host.light {\n border: var(--border-size-medium) solid var(--color-surface05);\n background-color: var(--color-surface01);\n color: var(--color-default-text);\n}\n\n/* Tablet breakpoint */\n@media (min-width: 768px) {\n :host {\n text-align: start;\n }\n}\n\n/* Desktop breakpoint */\n@media (min-width: 1152px) {\n :host > .link-container {\n padding: 0 calc(var(--space-unit) * 3);\n border-right: var(--border-size-small) solid var(--color-surface05);\n }\n\n :host > .link-container > a.z-link.link-invisible {\n overflow: initial;\n width: initial;\n height: initial;\n }\n\n :host > .link-container:first-child {\n padding-left: 0;\n }\n\n :host > .link-container:last-child,\n :host.dark > .link-container:last-child,\n :host.light > .link-container:last-child {\n padding-right: 0;\n border-right: none;\n }\n\n :host.dark > .link-container {\n border-right: var(--border-size-small) solid var(--color-surface01);\n }\n}\n","import {Component, Element, Host, Listen, Prop, State, h} from \"@stencil/core\";\nimport {SkipToContentLink, ThemeVariant} from \"../../beans\";\nimport {getElementTree, handleKeyboardSubmit} from \"../../utils/utils\";\n\n/**\n * Component short description.\n */\n@Component({\n tag: \"z-skip-to-content\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZSkipToContent {\n /** Graphical variant: `dark`, `light`. */\n @Prop({reflect: true})\n variant?: ThemeVariant;\n\n /** Array to fill link into skip-content */\n @Prop({mutable: true})\n links: string | SkipToContentLink[] = [];\n\n @State()\n visible = false;\n\n @State()\n visibleLink = \"\";\n\n @Element() hostElement: HTMLZSkipToContentElement;\n\n @Listen(\"focusout\", {target: \"document\"})\n handleFocusOutSkipToContent(e: FocusEvent): void {\n if (this.isInSkipToContent(e.target)) {\n this.visible = false;\n }\n }\n\n @Listen(\"focusin\", {target: \"document\"})\n handleFocusSkipToContent(e: FocusEvent): void {\n if (this.isInSkipToContent(e.target)) {\n this.visible = true;\n }\n }\n\n componentDidLoad(): void {\n this.showFirstChild();\n }\n\n componentWillRender(): void {\n if (this.links) {\n this.links = typeof this.links === \"string\" ? JSON.parse(this.links) : this.links;\n }\n }\n\n private isInSkipToContent(elem): boolean {\n const tree = getElementTree(elem);\n const menuParent = tree.find((elem: Element) => elem.nodeName.toLowerCase() === \"z-skip-to-content\");\n\n return !!menuParent;\n }\n\n private showFirstChild(): void {\n const firstChild = this.hostElement.children?.[0];\n if (firstChild) {\n this.visibleLink = firstChild.id;\n }\n }\n\n private handleLinkClick(): void {\n this.visible = false;\n }\n\n render(): HTMLZSkipToContentElement {\n return (\n <Host\n class={{\n [this.variant]: true,\n \"skip-to-content-visible\": this.visible,\n }}\n >\n {(this.links as SkipToContentLink[]).map((link, i) => {\n const id = `skip-to-content-${i}`;\n\n return (\n <div class=\"link-container\">\n <a\n id={id}\n class={{\n \"body-1-sb\": true,\n \"z-link\": true,\n \"z-link-underline\": true,\n \"z-link-inverse\": this.variant === ThemeVariant.DARK,\n \"link-visible\": id == this.visibleLink,\n \"link-invisible\": id != this.visibleLink,\n }}\n aria-label={link.ariaLabel || link.label}\n href={link.href}\n onFocus={() => (this.visibleLink = id)}\n onClick={() => this.handleLinkClick()}\n onKeyUp={(e) => handleKeyboardSubmit(e, this.handleLinkClick.bind(this))}\n >\n {link.label}\n </a>\n </div>\n );\n })}\n </Host>\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["stylesCss","ZSkipToContentStyle0","ZSkipToContent","handleFocusOutSkipToContent","e","this","isInSkipToContent","target","visible","handleFocusSkipToContent","componentDidLoad","showFirstChild","componentWillRender","links","JSON","parse","elem","tree","getElementTree","menuParent","find","nodeName","toLowerCase","firstChild","_a","hostElement","children","visibleLink","id","handleLinkClick","render","h","Host","key","class","variant","map","link","i","ThemeVariant","DARK","ariaLabel","label","href","onFocus","onClick","onKeyUp","handleKeyboardSubmit","bind"],"sources":["src/components/z-skip-to-content/styles.css?tag=z-skip-to-content&encapsulation=scoped","src/components/z-skip-to-content/index.tsx"],"sourcesContent":[":host {\n position: absolute;\n left: -100%;\n height: 60px;\n box-sizing: border-box;\n padding: calc(var(--space-unit) * 1.25) calc(var(--space-unit) * 3);\n background-color: #24f4ff;\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n text-align: center;\n}\n\n:host > .link-container {\n display: inline-flex;\n height: 100%;\n align-items: center;\n}\n\n:host.skip-to-content-visible,\n:host:focus {\n position: static;\n display: block;\n}\n\n:host > .link-container > a.z-link.link-invisible {\n overflow: hidden;\n width: 0;\n height: 0;\n}\n\n:host > .link-container > a.z-link.link-visible {\n width: initial;\n height: initial;\n}\n\n:host.dark {\n background-color: var(--color-surface05);\n color: var(--color-surface01);\n}\n\n:host.light {\n border: var(--border-size-medium) solid var(--color-surface05);\n background-color: var(--color-surface01);\n color: var(--color-default-text);\n}\n\n/* Tablet breakpoint */\n@media (min-width: 768px) {\n :host {\n text-align: start;\n }\n}\n\n/* Desktop breakpoint */\n@media (min-width: 1152px) {\n :host > .link-container {\n padding: 0 calc(var(--space-unit) * 3);\n border-right: var(--border-size-small) solid var(--color-surface05);\n }\n\n :host > .link-container > a.z-link.link-invisible {\n overflow: initial;\n width: initial;\n height: initial;\n }\n\n :host > .link-container:first-child {\n padding-left: 0;\n }\n\n :host > .link-container:last-child,\n :host.dark > .link-container:last-child,\n :host.light > .link-container:last-child {\n padding-right: 0;\n border-right: none;\n }\n\n :host.dark > .link-container {\n border-right: var(--border-size-small) solid var(--color-surface01);\n }\n}\n","import {Component, Element, Host, Listen, Prop, State, h} from \"@stencil/core\";\nimport {SkipToContentLink, ThemeVariant} from \"../../beans\";\nimport {getElementTree, handleKeyboardSubmit} from \"../../utils/utils\";\n\n/**\n * Component short description.\n */\n@Component({\n tag: \"z-skip-to-content\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZSkipToContent {\n /** Graphical variant: `dark`, `light`. */\n @Prop({reflect: true})\n variant?: ThemeVariant;\n\n /** Array to fill link into skip-content */\n @Prop({mutable: true})\n links: string | SkipToContentLink[] = [];\n\n @State()\n visible = false;\n\n @State()\n visibleLink = \"\";\n\n @Element() hostElement: HTMLZSkipToContentElement;\n\n @Listen(\"focusout\", {target: \"document\"})\n handleFocusOutSkipToContent(e: FocusEvent): void {\n if (this.isInSkipToContent(e.target)) {\n this.visible = false;\n }\n }\n\n @Listen(\"focusin\", {target: \"document\"})\n handleFocusSkipToContent(e: FocusEvent): void {\n if (this.isInSkipToContent(e.target)) {\n this.visible = true;\n }\n }\n\n componentDidLoad(): void {\n this.showFirstChild();\n }\n\n componentWillRender(): void {\n if (this.links) {\n this.links = typeof this.links === \"string\" ? JSON.parse(this.links) : this.links;\n }\n }\n\n private isInSkipToContent(elem): boolean {\n const tree = getElementTree(elem);\n const menuParent = tree.find((elem: Element) => elem.nodeName.toLowerCase() === \"z-skip-to-content\");\n\n return !!menuParent;\n }\n\n private showFirstChild(): void {\n const firstChild = this.hostElement.children?.[0];\n if (firstChild) {\n this.visibleLink = firstChild.id;\n }\n }\n\n private handleLinkClick(): void {\n this.visible = false;\n }\n\n render(): HTMLZSkipToContentElement {\n return (\n <Host\n class={{\n [this.variant]: true,\n \"skip-to-content-visible\": this.visible,\n }}\n >\n {(this.links as SkipToContentLink[]).map((link, i) => {\n const id = `skip-to-content-${i}`;\n\n return (\n <div class=\"link-container\">\n <a\n id={id}\n class={{\n \"body-1-sb\": true,\n \"z-link\": true,\n \"z-link-underline\": true,\n \"z-link-inverse\": this.variant === ThemeVariant.DARK,\n \"link-visible\": id == this.visibleLink,\n \"link-invisible\": id != this.visibleLink,\n }}\n aria-label={link.ariaLabel || link.label}\n href={link.href}\n onFocus={() => (this.visibleLink = id)}\n onClick={() => this.handleLinkClick()}\n onKeyUp={(e) => handleKeyboardSubmit(e, this.handleLinkClick.bind(this))}\n >\n {link.label}\n </a>\n </div>\n );\n })}\n </Host>\n );\n }\n}\n"],"mappings":"gKAAA,MAAMA,EAAY,y3DAClB,MAAAC,EAAeD,E,MCYFE,EAAc,M,2DAOa,G,aAG5B,M,iBAGI,E,CAKd,2BAAAC,CAA4BC,GAC1B,GAAIC,KAAKC,kBAAkBF,EAAEG,QAAS,CACpCF,KAAKG,QAAU,K,EAKnB,wBAAAC,CAAyBL,GACvB,GAAIC,KAAKC,kBAAkBF,EAAEG,QAAS,CACpCF,KAAKG,QAAU,I,EAInB,gBAAAE,GACEL,KAAKM,gB,CAGP,mBAAAC,GACE,GAAIP,KAAKQ,MAAO,CACdR,KAAKQ,aAAeR,KAAKQ,QAAU,SAAWC,KAAKC,MAAMV,KAAKQ,OAASR,KAAKQ,K,EAIxE,iBAAAP,CAAkBU,GACxB,MAAMC,EAAOC,EAAeF,GAC5B,MAAMG,EAAaF,EAAKG,MAAMJ,GAAkBA,EAAKK,SAASC,gBAAkB,sBAEhF,QAASH,C,CAGH,cAAAR,G,MACN,MAAMY,GAAaC,EAAAnB,KAAKoB,YAAYC,YAAQ,MAAAF,SAAA,SAAAA,EAAG,GAC/C,GAAID,EAAY,CACdlB,KAAKsB,YAAcJ,EAAWK,E,EAI1B,eAAAC,GACNxB,KAAKG,QAAU,K,CAGjB,MAAAsB,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,2CACHC,MAAO,CACL,CAAC7B,KAAK8B,SAAU,KAChB,0BAA2B9B,KAAKG,UAGhCH,KAAKQ,MAA8BuB,KAAI,CAACC,EAAMC,KAC9C,MAAMV,EAAK,mBAAmBU,IAE9B,OACEP,EAAA,OAAKG,MAAM,kBACTH,EAAA,KACEH,GAAIA,EACJM,MAAO,CACL,YAAa,KACb,SAAU,KACV,mBAAoB,KACpB,iBAAkB7B,KAAK8B,UAAYI,EAAaC,KAChD,eAAgBZ,GAAMvB,KAAKsB,YAC3B,iBAAkBC,GAAMvB,KAAKsB,aAC9B,aACWU,EAAKI,WAAaJ,EAAKK,MACnCC,KAAMN,EAAKM,KACXC,QAAS,IAAOvC,KAAKsB,YAAcC,EACnCiB,QAAS,IAAMxC,KAAKwB,kBACpBiB,QAAU1C,GAAM2C,EAAqB3C,EAAGC,KAAKwB,gBAAgBmB,KAAK3C,QAEjEgC,EAAKK,OAEJ,I","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,c as t,h as s,g as i}from"./p-75c4a726.js";import{e as l,g as c,l as r,i as n}from"./p-b34993de.js";import{r as a,b as o,a as h,d as p,e as d}from"./p-e691c0b8.js";import"./p-5145a606.js";const z='.sc-z-select-h{display:inline-block;width:inherit;color:var(--color-default-text);font-family:var(--font-family-sans);font-size:var(--font-size-3);font-weight:var(--font-rg)}[size="small"].sc-z-select-h,[size="x-small"].sc-z-select-h{font-size:var(--font-size-2)}.select-wrapper.sc-z-select>z-input.sc-z-select{width:100%}.select-wrapper.sc-z-select>z-input.sc-z-select .input-icon.sc-z-select{cursor:pointer}.select-wrapper.sc-z-select>div.sc-z-select{position:relative}.select-wrapper.sc-z-select>div.closed.sc-z-select{overflow:hidden;height:0}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select{position:absolute;width:100%;box-sizing:border-box;border-top:none;background:var(--color-form-background);box-shadow:var(--shadow-2);outline:none}.select-wrapper.sc-z-select .closed.sc-z-select .ul-scroll-wrapper.sc-z-select{z-index:10}.select-wrapper.sc-z-select .open.sc-z-select .ul-scroll-wrapper.sc-z-select{z-index:20}.select-wrapper.sc-z-select .ul-scroll-wrapper.fixed.sc-z-select{position:static}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select{position:relative;overflow:auto;max-height:240px;padding:0 calc(var(--space-unit) * 1.5);outline:none;scrollbar-color:var(--color-primary01) transparent}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-track{background-color:transparent}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element[disabled].sc-z-select{color:var(--color-form-disabled03)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select{display:flex;align-items:center;padding:calc(var(--space-unit) / 2) var(--space-unit);column-gap:var(--space-unit)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select .list-element-content.sc-z-select{margin-right:auto}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select>z-icon.sc-z-select+.list-element-content.sc-z-select{padding:calc(var(--space-unit) * 0.5) var(--space-unit)}[size="x-small"].sc-z-select-h .select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select .list-element-content.sc-z-select{padding:0}[size="small"].sc-z-select-h .select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select>z-icon.sc-z-select{--z-icon-width:16px;--z-icon-height:16px}[size="x-small"].sc-z-select-h .select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select>z-icon.sc-z-select{--z-icon-width:14px;--z-icon-height:14px}[size="x-small"].sc-z-select-h .select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select>z-icon.sc-z-select+.list-element-content.sc-z-select{padding:0 var(--space-unit)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-container.sc-z-select .list-element-content.selected.sc-z-select{font-weight:var(--font-sb)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select .no-results.sc-z-select z-icon.sc-z-select{margin-right:var(--space-unit)}.z-list-group-title.sc-z-select{color:var(--color-default-text)}.reset-item.sc-z-select{color:var(--color-primary01);fill:var(--color-primary01-icon)}.reset-item-content.sc-z-select{display:flex;align-items:center}.reset-item.reset-item-margin.sc-z-select .reset-item-content.sc-z-select{margin-left:var(--space-unit)}.reset-item.sc-z-select .reset-item-content.sc-z-select>z-icon.sc-z-select{margin-right:var(--space-unit)}.reset-item.hide.sc-z-select{display:none}';const u=z;const m=class{constructor(s){e(this,s);this.optionSelect=t(this,"optionSelect",7);this.resetSelect=t(this,"resetSelect",7);this.itemsList=[];this.htmlid=`id-${a()}`;this.items=undefined;this.name=undefined;this.label=undefined;this.ariaLabel="";this.disabled=false;this.readonly=false;this.placeholder=undefined;this.htmltitle=undefined;this.status=undefined;this.message=true;this.autocomplete=false;this.noresultslabel="Nessun risultato";this.hasGroupItems=undefined;this.isfixed=false;this.resetItem=undefined;this.size=l.BIG;this.isOpen=false;this.selectedItem=null;this.focusedItemId=undefined;this.searchString=undefined;this.toggleSelectUl=this.toggleSelectUl.bind(this);this.handleSelectFocus=this.handleSelectFocus.bind(this)}watchItems(){this.itemsList=this.getInitialItemsArray();this.selectedItem=this.itemsList.find((e=>e.selected))}getFocusedItemHandler(e){this.focusedItemId=e.target.id}async getSelectedItem(){return this.selectedItem}async getValue(){return this.getSelectedValue()}async setValue(e){let t=[];if(typeof e==="string"){t.push(e)}else{t=e}this.selectedItem=this.itemsList.find((e=>t.includes(e.id)))}emitOptionSelect(){this.optionSelect.emit({id:this.htmlid,selected:this.getSelectedValue()})}emitResetSelect(){this.resetSelect.emit({id:this.htmlid})}componentWillLoad(){this.watchItems()}componentWillRender(){this.filterItems(this.searchString)}getInitialItemsArray(){return typeof this.items==="string"?JSON.parse(this.items):this.items}mapSelectedItemToItemsArray(){const e=this.getInitialItemsArray();return e.map((e=>{var t;e.selected=e.id===((t=this.selectedItem)===null||t===void 0?void 0:t.id);return e}))}getSelectedValue(){var e;return(e=this.selectedItem)===null||e===void 0?void 0:e.id}filterItems(e){const t=this.mapSelectedItemToItemsArray();if(!(e===null||e===void 0?void 0:e.length)){this.itemsList=t}else{this.itemsList=t.filter((t=>t.name.toUpperCase().includes(e.toUpperCase()))).map((t=>{const s=t.name.toUpperCase().indexOf(e.toUpperCase());const i=s+e.length;const l=t.name.substring(0,s)+`<strong>${t.name.substring(s,i)}</strong>`+t.name.substring(i,t.name.length);t.name=l;return t}))}}hasAutocomplete(){return o(this.autocomplete)===true}handleInputChange(e){this.searchString=e.detail.value;if(!this.isOpen){this.toggleSelectUl()}}selectItem(e){if(e===null||e===void 0?void 0:e.disabled){return}this.itemsList=this.mapSelectedItemToItemsArray();this.itemsList.forEach((t=>{t.selected=t.id===(e===null||e===void 0?void 0:e.id);return t}));this.selectedItem=this.itemsList.find((e=>e.selected));this.emitOptionSelect();this.toggleSelectUl(true);if(this.searchString){this.searchString=null}}arrowsSelectNav(e,t){const s=this.resetItem&&!!this.selectedItem;const i=[c.ARROW_DOWN,c.ARROW_UP];if(!i.includes(e.key)){return}e.preventDefault();e.stopPropagation();if(!this.isOpen){this.toggleSelectUl()}let l;if(this.resetItem){if(e.key===c.ARROW_DOWN){l=t+1===this.itemsList.length+1?+!s:t+1}else if(e.key===c.ARROW_UP){l=t<=+!s?this.itemsList.length:t-1}}if(!this.resetItem){if(e.key===c.ARROW_DOWN){l=t+1===this.itemsList.length?0:t+1}else if(e.key===c.ARROW_UP){l=t<=0?this.itemsList.length-1:t-1}}this.focusSelectItem(l)}focusSelectItem(e){var t;(t=this.host.querySelector(`#${this.htmlid}_${e}`))===null||t===void 0?void 0:t.focus()}toggleSelectUl(e=false){if(this.disabled||this.readonly){return}if(!this.isOpen){document.addEventListener("click",this.handleSelectFocus);document.addEventListener("keyup",this.handleSelectFocus)}else{document.removeEventListener("click",this.handleSelectFocus);document.removeEventListener("keyup",this.handleSelectFocus);if(e){this.host.querySelector(`#${this.htmlid}_input`).focus()}}this.focusedItemId="";this.isOpen=!this.isOpen}handleInputClick(e){if(e.target.closest(".reset-icon")){e.stopPropagation();return}this.toggleSelectUl()}handleSelectFocus(e){const t=d();if(t===null||t===void 0?void 0:t.hasAttribute("disabled")){return}if(e instanceof KeyboardEvent&&e.key===c.ESC){e.stopPropagation();return this.toggleSelectUl(true)}if(e instanceof KeyboardEvent&&e.key!==c.TAB&&e.key!==c.ENTER){return}if(!h(this.host,t)){this.toggleSelectUl(e instanceof MouseEvent)}}scrollToLetter(e){const t=this.itemsList.findIndex((t=>t.name.charAt(0)===e));if(t>-1){this.focusSelectItem(t)}}renderInput(){return s("z-input",{class:{"active-select":this.isOpen,"cursor-select":!this.autocomplete},id:`${this.htmlid}_input`,htmlid:`${this.htmlid}_select_input`,placeholder:this.placeholder,value:!this.isOpen&&this.selectedItem?this.selectedItem.name.replace(/<[^>]+>/g,""):null,label:this.label,"aria-expanded":this.isOpen?"true":"false","aria-label":this.ariaLabel,"aria-controls":`${this.htmlid}_list`,"aria-autocomplete":this.hasAutocomplete()?"list":"none","aria-activedescendant":this.isOpen?this.focusedItemId:"",icon:this.isOpen?"caret-up":"caret-down",hasclearicon:this.hasAutocomplete(),message:false,disabled:this.disabled,readonly:this.readonly||!this.hasAutocomplete()&&this.isOpen,status:this.isOpen?undefined:this.status,role:"combobox",size:this.size,onClick:e=>{this.handleInputClick(e)},onKeyUp:e=>{if(e.key!==c.ENTER){e.preventDefault()}p(e,this.toggleSelectUl)},onKeyDown:e=>this.arrowsSelectNav(e,this.selectedItem?this.itemsList.indexOf(this.selectedItem):this.resetItem?0:-1),onInputChange:e=>{this.handleInputChange(e)},onKeyPress:e=>{if(!this.hasAutocomplete()){e.preventDefault();this.scrollToLetter(String.fromCharCode(e.keyCode))}}})}renderSelectUl(){return s("div",{class:this.isOpen?"open":"closed"},s("div",{class:{"ul-scroll-wrapper":true,fixed:this.isfixed}},s("z-list",{role:"listbox","aria-label":this.ariaLabel||this.label,tabindex:this.disabled||this.readonly||!this.isOpen?-1:0,id:`${this.htmlid}_list`,"aria-multiselectable":false,size:this.listSizeType(),class:{disabled:this.disabled,readonly:this.readonly,[`input-${this.status}`]:!this.isOpen&&!!this.status}},this.resetItem&&this.renderResetItem(),this.renderSelectUlItems())))}renderResetItem(){return s("z-list-element",{class:{hide:!this.selectedItem||!this.resetItem,"reset-item":true,"reset-item-margin":!this.hasGroupItems},clickable:true,disabled:false,dividerType:r.ELEMENT,role:"option",tabindex:"0","aria-selected":"false",id:`${this.htmlid}_${this.resetItem?"0":"none"}`,size:this.listSizeType(),onClickItem:()=>{this.selectedItem=null;this.searchString=null;this.emitResetSelect()},onKeyDown:e=>this.arrowsSelectNav(e,0)},s("div",{class:"reset-item-content"},s("z-icon",{name:"multiply-circled"}),s("span",null,this.resetItem)))}renderItem(e,t,i){return s("z-list-element",{clickable:!e.disabled,disabled:e.disabled,dividerType:i?r.HEADER:r.ELEMENT,role:"option",tabindex:e.disabled||!this.isOpen?-1:0,"aria-selected":e.selected?"true":"false",id:`${this.htmlid}_${t}`,size:this.listSizeType(),onClickItem:()=>this.selectItem(e),onKeyDown:e=>this.arrowsSelectNav(e,t)},s("div",{class:"list-element-container"},s("div",{class:{selected:!!e.selected,"list-element-content":true},innerHTML:e.name}),e.icon&&s("z-tag",{icon:e.icon})))}listSizeType(){if(this.size===l.SMALL||this.size===l.X_SMALL){return n.SMALL}return n.MEDIUM}renderSelectUlItems(){if(!this.itemsList.length){return this.renderNoSearchResults()}if(this.hasGroupItems){return this.renderSelectGroupItems()}return this.itemsList.map(((e,t,s)=>{const i=s.length===t+1;const l=this.resetItem?t+1:t;return this.renderItem(e,l,i)}))}renderSelectGroupItems(){const e=this.itemsList.reduce(((e,t,s,i)=>{var l;const{category:c}=t;const r=i.length===s+1;const n=this.resetItem?s+1:s;const a=this.renderItem(t,n,r);e[c]=(l=e[c])!==null&&l!==void 0?l:[];e[c].push(a);return e}),{});return Object.entries(e).map((([e,t])=>s("z-list-group",{"divider-type":r.ELEMENT},s("span",{class:"body-3-sb z-list-group-title",slot:"header-title"},e),t.map((e=>e)))))}renderNoSearchResults(){return s("z-list-element",{color:"color-primary01",class:"no-results",size:this.listSizeType()},s("z-icon",{name:"multiply-circle",fill:"color-primary01-icon"}),this.noresultslabel)}renderMessage(){if(o(this.message)===false){return}return s("z-input-message",{message:o(this.message)===true?undefined:this.message,status:this.status,class:this.size,disabled:this.disabled})}render(){return s("div",{key:"e6bd4b8c9c016ca713f09226ebe4a81866f6caba",class:"select-wrapper"},this.renderInput(),this.renderSelectUl(),this.renderMessage())}get host(){return i(this)}static get watchers(){return{items:["watchItems"]}}};m.style=u;export{m as z_select};
|
|
2
|
+
//# sourceMappingURL=p-ce0d5448.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["stylesCss","ZSelectStyle0","ZSelect","constructor","hostRef","this","itemsList","randomId","ControlSize","BIG","toggleSelectUl","bind","handleSelectFocus","watchItems","getInitialItemsArray","selectedItem","find","item","selected","getFocusedItemHandler","e","focusedItemId","target","id","getSelectedItem","getValue","getSelectedValue","setValue","value","values","push","includes","emitOptionSelect","optionSelect","emit","htmlid","emitResetSelect","resetSelect","componentWillLoad","componentWillRender","filterItems","searchString","items","JSON","parse","mapSelectedItemToItemsArray","initialItemsList","map","_a","prevList","length","filter","name","toUpperCase","start","indexOf","end","newName","substring","hasAutocomplete","boolean","autocomplete","handleInputChange","detail","isOpen","selectItem","disabled","forEach","i","arrowsSelectNav","key","showResetIcon","resetItem","arrows","KeyboardCode","ARROW_DOWN","ARROW_UP","preventDefault","stopPropagation","index","focusSelectItem","host","querySelector","focus","selfFocusOnClose","readonly","document","addEventListener","removeEventListener","handleInputClick","closest","clickedElement","getClickedElement","hasAttribute","KeyboardEvent","ESC","TAB","ENTER","containsElement","MouseEvent","scrollToLetter","letter","foundItem","findIndex","charAt","renderInput","h","class","placeholder","replace","label","ariaLabel","icon","hasclearicon","message","status","undefined","role","size","onClick","onKeyUp","handleKeyboardSubmit","onKeyDown","onInputChange","onKeyPress","String","fromCharCode","keyCode","renderSelectUl","fixed","isfixed","tabindex","listSizeType","renderResetItem","renderSelectUlItems","hide","hasGroupItems","clickable","dividerType","ListDividerType","ELEMENT","onClickItem","renderItem","lastItem","HEADER","innerHTML","SMALL","X_SMALL","ListSize","MEDIUM","renderNoSearchResults","renderSelectGroupItems","array","itemKey","newData","reduce","group","category","zListItem","Object","entries","slot","color","fill","noresultslabel","renderMessage","render"],"sources":["src/components/z-select/styles.css?tag=z-select&encapsulation=scoped","src/components/z-select/index.tsx"],"sourcesContent":[":host {\n display: inline-block;\n width: inherit;\n color: var(--color-default-text);\n font-family: var(--font-family-sans);\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n}\n\n:host([size=\"small\"]),\n:host([size=\"x-small\"]) {\n font-size: var(--font-size-2);\n}\n\n.select-wrapper > z-input {\n width: 100%;\n}\n\n.select-wrapper > z-input .input-icon {\n cursor: pointer;\n}\n\n.select-wrapper > div {\n position: relative;\n}\n\n.select-wrapper > div.closed {\n overflow: hidden;\n height: 0;\n}\n\n.select-wrapper .ul-scroll-wrapper {\n position: absolute;\n width: 100%;\n box-sizing: border-box;\n border-top: none;\n background: var(--color-form-background);\n box-shadow: var(--shadow-2);\n outline: none;\n}\n\n.select-wrapper .closed .ul-scroll-wrapper {\n z-index: 10;\n}\n\n.select-wrapper .open .ul-scroll-wrapper {\n z-index: 20;\n}\n\n.select-wrapper .ul-scroll-wrapper.fixed {\n position: static;\n}\n\n.select-wrapper .ul-scroll-wrapper > z-list {\n position: relative;\n overflow: auto;\n max-height: 240px;\n padding: 0 calc(var(--space-unit) * 1.5);\n outline: none;\n\n /* Firefox scrollbar */\n scrollbar-color: var(--color-primary01) transparent;\n}\n\n.select-wrapper .ul-scroll-wrapper > z-list::-webkit-scrollbar {\n width: 10px;\n background: linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);\n border-radius: var(--border-radius);\n}\n\n.select-wrapper .ul-scroll-wrapper > z-list::-webkit-scrollbar-track {\n background-color: transparent;\n}\n\n.select-wrapper .ul-scroll-wrapper > z-list::-webkit-scrollbar-thumb {\n width: 10px;\n background-color: var(--color-primary01);\n border-radius: var(--border-radius);\n}\n\n.select-wrapper .ul-scroll-wrapper > z-list::-webkit-scrollbar-thumb:hover {\n background-color: var(--color-hover-primary);\n}\n\n.select-wrapper .ul-scroll-wrapper z-list z-list-element[disabled] {\n color: var(--color-form-disabled03);\n}\n\n.select-wrapper .ul-scroll-wrapper z-list z-list-element .list-element-container {\n display: flex;\n align-items: center;\n padding: calc(var(--space-unit) / 2) var(--space-unit);\n column-gap: var(--space-unit);\n}\n\n.select-wrapper .ul-scroll-wrapper z-list z-list-element .list-element-container .list-element-content {\n margin-right: auto;\n}\n\n.select-wrapper .ul-scroll-wrapper z-list z-list-element .list-element-container > z-icon + .list-element-content {\n padding: calc(var(--space-unit) * 0.5) var(--space-unit);\n}\n\n:host([size=\"x-small\"])\n .select-wrapper\n .ul-scroll-wrapper\n z-list\n z-list-element\n .list-element-container\n .list-element-content {\n padding: 0;\n}\n\n:host([size=\"small\"]) .select-wrapper .ul-scroll-wrapper z-list z-list-element .list-element-container > z-icon {\n --z-icon-width: 16px;\n --z-icon-height: 16px;\n}\n\n:host([size=\"x-small\"]) .select-wrapper .ul-scroll-wrapper z-list z-list-element .list-element-container > z-icon {\n --z-icon-width: 14px;\n --z-icon-height: 14px;\n}\n\n:host([size=\"x-small\"])\n .select-wrapper\n .ul-scroll-wrapper\n z-list\n z-list-element\n .list-element-container\n > z-icon\n + .list-element-content {\n padding: 0 var(--space-unit);\n}\n\n.select-wrapper .ul-scroll-wrapper z-list z-list-element .list-element-container .list-element-content.selected {\n font-weight: var(--font-sb);\n}\n\n.select-wrapper .ul-scroll-wrapper .no-results z-icon {\n margin-right: var(--space-unit);\n}\n\n.z-list-group-title {\n color: var(--color-default-text);\n}\n\n.reset-item {\n color: var(--color-primary01);\n fill: var(--color-primary01-icon);\n}\n\n.reset-item-content {\n display: flex;\n align-items: center;\n}\n\n.reset-item.reset-item-margin .reset-item-content {\n margin-left: var(--space-unit);\n}\n\n.reset-item .reset-item-content > z-icon {\n margin-right: var(--space-unit);\n}\n\n.reset-item.hide {\n display: none;\n}\n","import {Component, Element, Event, EventEmitter, Listen, Method, Prop, State, Watch, h} from \"@stencil/core\";\nimport {ControlSize, InputStatus, KeyboardCode, ListDividerType, ListSize, SelectItem} from \"../../beans\";\nimport {boolean, containsElement, getClickedElement, handleKeyboardSubmit, randomId} from \"../../utils/utils\";\n\n@Component({\n tag: \"z-select\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZSelect {\n @Element() host: HTMLZSelectElement;\n\n /** the id of the input element */\n @Prop()\n htmlid = `id-${randomId()}`;\n\n /** the input select options */\n @Prop()\n items: SelectItem[] | string;\n\n /** the input name */\n @Prop()\n name?: string;\n\n /** the input label */\n @Prop()\n label?: string;\n\n /** the input aria-label */\n @Prop()\n ariaLabel = \"\";\n\n /** the input is disabled */\n @Prop()\n disabled?: boolean = false;\n\n /** the input is readonly */\n @Prop()\n readonly?: boolean = false;\n\n /** the input placeholder (optional) */\n @Prop()\n placeholder?: string;\n\n /** the input html title (optional) */\n @Prop()\n htmltitle?: string;\n\n /** the input status (optional) */\n @Prop()\n status?: InputStatus;\n\n /** input helper message (optional) - if set to `false` message won't be displayed */\n @Prop()\n message?: string | boolean = true;\n\n /** the input has autocomplete option */\n @Prop()\n autocomplete?: boolean = false;\n\n /** no result text message */\n @Prop()\n noresultslabel?: string = \"Nessun risultato\";\n\n /** */\n @Prop()\n hasGroupItems?: boolean;\n\n /** When fixed, it occupies space and pushes down next elements. */\n @Prop()\n isfixed?: boolean = false;\n\n /** */\n @Prop()\n resetItem?: string;\n\n /** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */\n @Prop()\n size?: ControlSize = ControlSize.BIG;\n\n @State()\n isOpen = false;\n\n @State()\n selectedItem: null | SelectItem = null;\n\n @State()\n focusedItemId: string;\n\n @State()\n searchString: null | string;\n\n private itemsList: SelectItem[] = [];\n\n constructor() {\n this.toggleSelectUl = this.toggleSelectUl.bind(this);\n this.handleSelectFocus = this.handleSelectFocus.bind(this);\n }\n\n @Watch(\"items\")\n watchItems(): void {\n this.itemsList = this.getInitialItemsArray();\n this.selectedItem = this.itemsList.find((item: SelectItem) => item.selected);\n }\n\n @Listen(\"ariaDescendantFocus\")\n getFocusedItemHandler(e: CustomEvent): void {\n this.focusedItemId = (e.target as Element).id;\n }\n\n /** get the input selected options */\n @Method()\n async getSelectedItem(): Promise<SelectItem> {\n return this.selectedItem;\n }\n\n /** get the input value */\n @Method()\n async getValue(): Promise<string> {\n return this.getSelectedValue();\n }\n\n /** set the input value */\n @Method()\n async setValue(value: string | string[]): Promise<void> {\n let values: string[] = [];\n if (typeof value === \"string\") {\n values.push(value);\n } else {\n values = value;\n }\n\n this.selectedItem = this.itemsList.find((item: SelectItem) => values.includes(item.id));\n }\n\n /** Emitted on select option selection, returns select id, selected item id */\n @Event()\n optionSelect: EventEmitter;\n\n private emitOptionSelect(): void {\n this.optionSelect.emit({\n id: this.htmlid,\n selected: this.getSelectedValue(),\n });\n }\n\n /** Emitted on reset selected item, returns select id, selected item id */\n @Event()\n resetSelect: EventEmitter;\n\n private emitResetSelect(): void {\n this.resetSelect.emit({\n id: this.htmlid,\n });\n }\n\n componentWillLoad(): void {\n this.watchItems();\n }\n\n componentWillRender(): void {\n this.filterItems(this.searchString);\n }\n\n private getInitialItemsArray(): SelectItem[] {\n return typeof this.items === \"string\" ? JSON.parse(this.items) : this.items;\n }\n\n private mapSelectedItemToItemsArray(): SelectItem[] {\n const initialItemsList = this.getInitialItemsArray();\n\n return initialItemsList.map((item: SelectItem) => {\n item.selected = item.id === this.selectedItem?.id;\n\n return item;\n });\n }\n\n private getSelectedValue(): string {\n return this.selectedItem?.id;\n }\n\n private filterItems(searchString: string): void {\n const prevList = this.mapSelectedItemToItemsArray();\n if (!searchString?.length) {\n this.itemsList = prevList;\n } else {\n this.itemsList = prevList\n .filter((item: SelectItem) => {\n return item.name.toUpperCase().includes(searchString.toUpperCase());\n })\n .map((item: SelectItem) => {\n const start = item.name.toUpperCase().indexOf(searchString.toUpperCase());\n const end = start + searchString.length;\n const newName =\n item.name.substring(0, start) +\n `<strong>${item.name.substring(start, end)}</strong>` +\n item.name.substring(end, item.name.length);\n item.name = newName;\n\n return item;\n });\n }\n }\n\n private hasAutocomplete(): boolean {\n return boolean(this.autocomplete) === true;\n }\n\n private handleInputChange(e: CustomEvent): void {\n this.searchString = e.detail.value;\n if (!this.isOpen) {\n this.toggleSelectUl();\n }\n }\n\n private selectItem(selected: null | SelectItem): void {\n if (selected?.disabled) {\n return;\n }\n\n this.itemsList = this.mapSelectedItemToItemsArray();\n this.itemsList.forEach((i: SelectItem) => {\n i.selected = i.id === selected?.id;\n\n return i;\n });\n\n this.selectedItem = this.itemsList.find((item: SelectItem) => item.selected);\n\n this.emitOptionSelect();\n this.toggleSelectUl(true);\n\n if (this.searchString) {\n this.searchString = null;\n }\n }\n\n private arrowsSelectNav(e: KeyboardEvent, key: number): void {\n const showResetIcon = this.resetItem && !!this.selectedItem;\n const arrows = [KeyboardCode.ARROW_DOWN, KeyboardCode.ARROW_UP];\n if (!arrows.includes(e.key as KeyboardCode)) {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n\n if (!this.isOpen) {\n this.toggleSelectUl();\n }\n\n let index: number;\n\n if (this.resetItem) {\n if (e.key === KeyboardCode.ARROW_DOWN) {\n index = key + 1 === this.itemsList.length + 1 ? +!showResetIcon : key + 1;\n } else if (e.key === KeyboardCode.ARROW_UP) {\n index = key <= +!showResetIcon ? this.itemsList.length : key - 1;\n }\n }\n\n if (!this.resetItem) {\n if (e.key === KeyboardCode.ARROW_DOWN) {\n index = key + 1 === this.itemsList.length ? 0 : key + 1;\n } else if (e.key === KeyboardCode.ARROW_UP) {\n index = key <= 0 ? this.itemsList.length - 1 : key - 1;\n }\n }\n\n this.focusSelectItem(index);\n }\n\n private focusSelectItem(index: number): void {\n this.host.querySelector<HTMLLIElement>(`#${this.htmlid}_${index}`)?.focus();\n }\n\n private toggleSelectUl(selfFocusOnClose = false): void {\n if (this.disabled || this.readonly) {\n return;\n }\n\n if (!this.isOpen) {\n document.addEventListener(\"click\", this.handleSelectFocus);\n document.addEventListener(\"keyup\", this.handleSelectFocus);\n } else {\n document.removeEventListener(\"click\", this.handleSelectFocus);\n document.removeEventListener(\"keyup\", this.handleSelectFocus);\n if (selfFocusOnClose) {\n (this.host.querySelector(`#${this.htmlid}_input`) as HTMLInputElement).focus();\n }\n }\n\n this.focusedItemId = \"\";\n this.isOpen = !this.isOpen;\n }\n\n private handleInputClick(e: MouseEvent | KeyboardEvent): void {\n if ((e.target as HTMLElement).closest(\".reset-icon\")) {\n e.stopPropagation();\n\n return;\n }\n\n this.toggleSelectUl();\n }\n\n private handleSelectFocus(e: MouseEvent | KeyboardEvent): void {\n const clickedElement = getClickedElement();\n if (clickedElement?.hasAttribute(\"disabled\")) {\n return;\n }\n\n if (e instanceof KeyboardEvent && e.key === KeyboardCode.ESC) {\n e.stopPropagation();\n\n return this.toggleSelectUl(true);\n }\n\n if (e instanceof KeyboardEvent && e.key !== KeyboardCode.TAB && e.key !== KeyboardCode.ENTER) {\n return;\n }\n\n if (!containsElement(this.host, clickedElement)) {\n this.toggleSelectUl(e instanceof MouseEvent);\n }\n }\n\n private scrollToLetter(letter: string): void {\n const foundItem = this.itemsList.findIndex((item: SelectItem) => item.name.charAt(0) === letter);\n if (foundItem > -1) {\n this.focusSelectItem(foundItem);\n }\n }\n\n private renderInput(): HTMLZInputElement {\n return (\n <z-input\n class={{\n \"active-select\": this.isOpen,\n \"cursor-select\": !this.autocomplete,\n }}\n id={`${this.htmlid}_input`}\n htmlid={`${this.htmlid}_select_input`}\n placeholder={this.placeholder}\n value={!this.isOpen && this.selectedItem ? this.selectedItem.name.replace(/<[^>]+>/g, \"\") : null}\n label={this.label}\n aria-expanded={this.isOpen ? \"true\" : \"false\"}\n aria-label={this.ariaLabel}\n aria-controls={`${this.htmlid}_list`}\n aria-autocomplete={this.hasAutocomplete() ? \"list\" : \"none\"}\n aria-activedescendant={this.isOpen ? this.focusedItemId : \"\"}\n icon={this.isOpen ? \"caret-up\" : \"caret-down\"}\n hasclearicon={this.hasAutocomplete()}\n message={false}\n disabled={this.disabled}\n readonly={this.readonly || (!this.hasAutocomplete() && this.isOpen)}\n status={this.isOpen ? undefined : this.status}\n role=\"combobox\"\n size={this.size}\n onClick={(e: MouseEvent) => {\n this.handleInputClick(e);\n }}\n onKeyUp={(e: KeyboardEvent) => {\n if (e.key !== KeyboardCode.ENTER) {\n e.preventDefault();\n }\n handleKeyboardSubmit(e, this.toggleSelectUl);\n }}\n onKeyDown={(e: KeyboardEvent) => {\n return this.arrowsSelectNav(\n e,\n this.selectedItem ? this.itemsList.indexOf(this.selectedItem) : this.resetItem ? 0 : -1\n );\n }}\n onInputChange={(e: CustomEvent) => {\n this.handleInputChange(e);\n }}\n onKeyPress={(e: KeyboardEvent) => {\n if (!this.hasAutocomplete()) {\n e.preventDefault();\n this.scrollToLetter(String.fromCharCode(e.keyCode));\n }\n }}\n />\n );\n }\n\n private renderSelectUl(): HTMLDivElement {\n return (\n <div class={this.isOpen ? \"open\" : \"closed\"}>\n <div\n class={{\n \"ul-scroll-wrapper\": true,\n \"fixed\": this.isfixed,\n }}\n >\n <z-list\n role=\"listbox\"\n aria-label={this.ariaLabel || this.label}\n tabindex={this.disabled || this.readonly || !this.isOpen ? -1 : 0}\n id={`${this.htmlid}_list`}\n aria-multiselectable={false}\n size={this.listSizeType()}\n class={{\n disabled: this.disabled,\n readonly: this.readonly,\n [`input-${this.status}`]: !this.isOpen && !!this.status,\n }}\n >\n {this.resetItem && this.renderResetItem()}\n {this.renderSelectUlItems()}\n </z-list>\n </div>\n </div>\n );\n }\n\n private renderResetItem(): HTMLZListElementElement {\n return (\n <z-list-element\n class={{\n \"hide\": !this.selectedItem || !this.resetItem,\n \"reset-item\": true,\n \"reset-item-margin\": !this.hasGroupItems,\n }}\n clickable={true}\n disabled={false}\n dividerType={ListDividerType.ELEMENT}\n role=\"option\"\n tabindex=\"0\"\n aria-selected=\"false\"\n id={`${this.htmlid}_${this.resetItem ? \"0\" : \"none\"}`}\n size={this.listSizeType()}\n onClickItem={() => {\n this.selectedItem = null;\n this.searchString = null;\n this.emitResetSelect();\n }}\n onKeyDown={(e: KeyboardEvent) => this.arrowsSelectNav(e, 0)}\n >\n <div class=\"reset-item-content\">\n <z-icon name=\"multiply-circled\" />\n <span>{this.resetItem}</span>\n </div>\n </z-list-element>\n );\n }\n\n private renderItem(item: SelectItem, key: number, lastItem: boolean): HTMLZListElementElement {\n return (\n <z-list-element\n clickable={!item.disabled}\n disabled={item.disabled}\n dividerType={lastItem ? ListDividerType.HEADER : ListDividerType.ELEMENT}\n role=\"option\"\n tabindex={item.disabled || !this.isOpen ? -1 : 0}\n aria-selected={item.selected ? \"true\" : \"false\"}\n id={`${this.htmlid}_${key}`}\n size={this.listSizeType()}\n onClickItem={() => this.selectItem(item)}\n onKeyDown={(e: KeyboardEvent) => this.arrowsSelectNav(e, key)}\n >\n <div class=\"list-element-container\">\n <div\n class={{\n \"selected\": !!item.selected,\n \"list-element-content\": true,\n }}\n innerHTML={item.name}\n />\n\n {item.icon && <z-tag icon={item.icon}></z-tag>}\n </div>\n </z-list-element>\n );\n }\n\n private listSizeType(): ListSize {\n if (this.size === ControlSize.SMALL || this.size === ControlSize.X_SMALL) {\n return ListSize.SMALL;\n }\n\n return ListSize.MEDIUM;\n }\n\n private renderSelectUlItems(): HTMLZListElementElement | HTMLZListElementElement[] {\n if (!this.itemsList.length) {\n return this.renderNoSearchResults();\n }\n\n if (this.hasGroupItems) {\n return this.renderSelectGroupItems();\n }\n\n return this.itemsList.map((item: SelectItem, key, array) => {\n const lastItem = array.length === key + 1;\n const itemKey = this.resetItem ? key + 1 : key;\n\n return this.renderItem(item, itemKey, lastItem);\n });\n }\n\n private renderSelectGroupItems(): HTMLZListElementElement | HTMLZListElementElement[] {\n const newData = this.itemsList.reduce((group, item, index, array) => {\n const {category} = item;\n const lastItem = array.length === index + 1;\n const itemKey = this.resetItem ? index + 1 : index;\n const zListItem = this.renderItem(item, itemKey, lastItem);\n\n group[category] = group[category] ?? [];\n group[category].push(zListItem);\n\n return group;\n }, {});\n\n return Object.entries(newData as {[key: string]: HTMLZListElementElement[]}).map(([key, value]) => {\n return (\n <z-list-group divider-type={ListDividerType.ELEMENT}>\n <span\n class=\"body-3-sb z-list-group-title\"\n slot=\"header-title\"\n >\n {key}\n </span>\n {value.map((item) => item)}\n </z-list-group>\n );\n });\n }\n\n private renderNoSearchResults(): HTMLZListElementElement {\n return (\n <z-list-element\n color=\"color-primary01\"\n class=\"no-results\"\n size={this.listSizeType()}\n >\n <z-icon\n name=\"multiply-circle\"\n fill=\"color-primary01-icon\"\n />\n {this.noresultslabel}\n </z-list-element>\n );\n }\n\n private renderMessage(): HTMLZInputMessageElement {\n if (boolean(this.message) === false) {\n return;\n }\n\n return (\n <z-input-message\n message={boolean(this.message) === true ? undefined : (this.message as string)}\n status={this.status}\n class={this.size}\n disabled={this.disabled}\n />\n );\n }\n\n render(): HTMLDivElement {\n return (\n <div class=\"select-wrapper\">\n {this.renderInput()}\n {this.renderSelectU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AC,GACN,GAAIzG,EAAQvD,KAAK6G,WAAa,MAAO,CACnC,M,CAGF,OACER,EAAA,mBACEQ,QAAStD,EAAQvD,KAAK6G,WAAa,KAAOE,UAAa/G,KAAK6G,QAC5DC,OAAQ9G,KAAK8G,OACbR,MAAOtG,KAAKiH,KACZpD,SAAU7D,KAAK6D,U,CAKrB,MAAAoG,GACE,OACE5D,EAAA,OAAApC,IAAA,2CAAKqC,MAAM,kBACRtG,KAAKoG,cACLpG,KAAK2H,iBACL3H,KAAKgK,gB","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as i,c as t,h as s}from"./p-75c4a726.js";import{d as e}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as i,c as t,h as s}from"./p-75c4a726.js";import{d as e}from"./p-e691c0b8.js";import"./p-b34993de.js";import"./p-5145a606.js";const a=":host li{all:unset;all:reset;width:100%;line-height:14px;list-style-type:none}:host li>span{display:flex;padding:calc(var(--space-unit) * 2) 0;color:var(--color-default-text);fill:var(--color-default-icon);font-family:var(--font-family-sans);font-size:16px;font-weight:var(--font-rg);letter-spacing:0.23px;line-height:14px}:host(.small) li>span{padding:calc(var(--space-unit) * 1.5) 0;font-size:var(--font-size-2)}:host(.x-small) li>span{padding:var(--space-unit) 0;font-size:var(--font-size-2)}:host(.small) li>span>z-icon,:host(.x-small) li>span>z-icon{--z-icon-width:16px;--z-icon-height:16px;--z-icon-right-margin:calc(var(--space-unit) * 0.5);padding:0}:host li>span.border{border-bottom:2px solid var(--color-surface03)}:host li span:hover,a:hover{color:var(--color-primary01);fill:var(--color-primary01)}a,a:visited,a:active{color:inherit;fill:inherit;text-decoration:none}:host li span z-icon{width:calc(var(--space-unit) * 2);height:calc(var(--space-unit) * 2);padding:0 calc(var(--space-unit) * 1.5) 0 0;background-repeat:no-repeat;background-size:contain;color:var(--color-primary01);fill:var(--color-primary01)}";const n=a;const o=class{emitZListItemLinkClick(i,t){this.zListItemLinkClick.emit({e:i,linkId:t})}emitZListItemClick(i,t){this.zListItemClick.emit({e:i,listitemid:t})}constructor(s){i(this,s);this.zListItemLinkClick=t(this,"zListItemLinkClick",7);this.zListItemClick=t(this,"zListItemClick",7);this.text=undefined;this.link=undefined;this.linktarget="_self";this.icon=undefined;this.listitemid=undefined;this.action=undefined;this.underlined=true;this.emitZListItemLinkClick=this.emitZListItemLinkClick.bind(this);this.emitZListItemClick=this.emitZListItemClick.bind(this)}render(){const i=this.listitemid?`link_${this.listitemid}`:"";return s("li",{key:"b96b5f850ed4f955ef40eafdedfabe71c942e886",role:"button",id:this.listitemid,"data-action":this.action,onClick:i=>this.emitZListItemClick(i,this.listitemid),onKeyPress:i=>e(i,this.emitZListItemClick,this.listitemid)},s("span",{key:"2ca05ec788e9ff591ad7b1cdbb5517b32d5681a9",class:this.underlined&&"border"},this.icon&&s("z-icon",{key:"e573f22f4797e9420e9a460a4aa4c793be06c14f",name:this.icon}),this.link?s("a",{href:this.link?this.link:null,target:this.linktarget,id:i,onClick:t=>this.emitZListItemLinkClick(t,i),onKeyPress:t=>e(t,this.emitZListItemLinkClick,i),role:this.link?"link":"button",tabindex:"0"},this.text):s("span",{innerHTML:this.text}),s("slot",{key:"6efed7b8ca33c2dcb7402555330443244340bae5"})))}};o.style=n;export{o as z_myz_list_item};
|
|
2
|
+
//# sourceMappingURL=p-cf7b7e73.entry.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as i,h as a,a as n,g as o}from"./p-75c4a726.js";import{I as s}from"./p-b34993de.js";const e="z-pagination{--z-pagination--page-button-width:64px;--z-pagination--pages-container-max-width:100%;display:flex;max-width:100%;flex-flow:column wrap;font-family:var(--font-family-sans);font-weight:var(--font-rg);gap:calc(var(--space-unit) * 2) calc(var(--space-unit) * 4)}z-pagination,z-pagination *{box-sizing:border-box}z-pagination button{height:100%}z-pagination z-icon{fill:var(--color-primary01-icon)}z-pagination *:disabled z-icon{fill:var(--color-disabled03)}z-pagination .page-label{margin-right:calc(var(--space-unit) * 3);color:var(--color-default-text)}z-pagination .pagination-bar{display:flex;max-width:100%;height:48px;align-items:center}z-pagination .pagination-bar button{display:flex;align-items:center;justify-content:center;border:none;margin:0;background-color:var(--color-surface02);color:var(--color-primary01);cursor:pointer;font-family:inherit;font-weight:inherit;transition:background-color 0.15s ease-out,\n color 0.15s ease-out,\n border-bottom-color 0.15s ease-out,\n font-size 0.15s ease-in-out,\n font-weight 0.15s ease-in-out}z-pagination .pagination-bar button:focus-visible{background-color:var(--color-surface01);outline:none}z-pagination .pagination-bar .pagination-button{padding:calc(var(--space-unit) * 2);font-weight:var(--font-sb);text-transform:uppercase;white-space:nowrap}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{color:var(--color-disabled03);cursor:default;fill:var(--color-disabled03);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[data-current]{border-bottom-color:var(--color-primary01);font-size:var(--font-size-7)}z-pagination .go-to-page{display:flex;flex-direction:column;row-gap:var(--space-unit)}z-pagination .go-to-page .label{color:var(--color-default-text);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;appearance:none}z-pagination .mobile-go-to-page{display:flex;height:100%;flex:1 auto;align-items:center;justify-content:center;background-color:var(--color-surface02)}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}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-surface01)}z-pagination .pagination-bar .page-button:hover{border-bottom-color:var(--color-hover-primary);color:var(--color-hover-primary)}}@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)}}";const r=e;const l=class{constructor(a){t(this,a);this.pageChanged=i(this,"pageChanged",7);this.label=undefined;this.navArrows=true;this.totalPages=undefined;this.skip=0;this.edges=false;this.split=undefined;this.visiblePages=undefined;this.currentPage=1;this.goToPage=undefined;this._visiblePages=this.visiblePages;this.isMobile=false;this.goToPageValue=null}setPagesContainerWidth(){if(!this._visiblePages||this.split){this.host.style.setProperty("--z-pagination--pages-container-max-width","100%");return}const t=window.getComputedStyle(this.host);const i=t.getPropertyValue("--z-pagination--page-button-width");this.host.style.setProperty("--z-pagination--pages-container-max-width",`calc(${i} * ${this._visiblePages})`)}setVisiblePages(){this._visiblePages=Math.min(this.visiblePages||this.totalPages,this.totalPages)}onPageChanged(){this.pageChanged.emit(this.currentPage);this.scrollToPage()}onSplitChanged(){if(this.split){this.edges=false}}onResize(){this.setMobile()}setMobile(){const t="screen and (max-width: 767px)";this.isMobile=window.matchMedia(t).matches}getPagesChunks(){const t=Array.from({length:this.totalPages},((t,i)=>i+1));const 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}"]`);if(!t){return}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}return t.map((t=>a("div",{class:"pages-chunk"},t.map((t=>this.renderPage(t))))))}renderSplitPages(){if(this.totalPages<=this.split*2+5){return Array.from({length:this.totalPages},((t,i)=>this.renderPage(i+1)))}if(this.currentPage<=this.split*2+2){return[...Array.from({length:this.split*2+3},((t,i)=>this.renderPage(i+1))),this.renderEllipsisButton(this.split*2+4),this.renderPage(this.totalPages)]}if(this.currentPage>this.split*2+2&&this.currentPage<this.totalPages-this.split*2-1){return[this.renderPage(1),this.renderEllipsisButton(this.currentPage-this.split-1),...Array.from({length:this.split*2+1},((t,i)=>this.renderPage(this.currentPage-this.split+i))),this.renderEllipsisButton(this.currentPage+this.split+1),this.renderPage(this.totalPages)]}return[this.renderPage(1),this.renderEllipsisButton(this.totalPages-this.split*2-3),...Array.from({length:this.split*2+3},((t,i)=>this.renderPage(this.totalPages-this.split*2-2+i)))]}renderBackButton(){return a("button",{class:"navigation-button",type:"button",title:"Vai alla pagina precedente",disabled:this.currentPage===1,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:s.NUMBER,min:1,max:this.totalPages,message:false,onInput:t=>{this.goToPageValue=t.target.value},placeholder:this.currentPage.toString(),hasclearicon:false}),a("span",null,`/${this.totalPages}`)),this.renderForwardButton())]}componentDidLoad(){this.setVisiblePages()}componentDidRender(){if(this.split){this.edges=false}this.setPagesContainerWidth();this.setMobile()}render(){if(this.isMobile){return a(n,null,this.renderMobile())}return a(n,null,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:this.currentPage===1,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:s.NUMBER,min:1,max:this.totalPages,message:false,placeholder:"2",hasclearicon:false,onInput:t=>{this.goToPageValue=t.target.value},onKeyDown:t=>t.key==="Enter"&&this.selectPage(this.goToPageValue)}),a("z-button",{disabled:!this.goToPageValue,title:"Vai alla pagina inserita",onClick:()=>this.selectPage(this.goToPageValue)},"vai"))))}get host(){return o(this)}static get watchers(){return{_visiblePages:["setPagesContainerWidth"],visiblePages:["setVisiblePages"],currentPage:["onPageChanged"],split:["onSplitChanged"]}}};l.style=r;export{l as z_pagination};
|
|
2
|
+
//# sourceMappingURL=p-d1cca5ea.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["stylesCss","ZPaginationStyle0","ZPagination","this","visiblePages","setPagesContainerWidth","_visiblePages","split","host","style","setProperty","pagesContainerStyle","window","getComputedStyle","pageButtonWidth","getPropertyValue","setVisiblePages","Math","min","totalPages","onPageChanged","pageChanged","emit","currentPage","scrollToPage","onSplitChanged","edges","onResize","setMobile","mobileMediaQuery","isMobile","matchMedia","matches","getPagesChunks","pages","Array","from","length","_","i","chunks","chunksCount","ceil","index","push","slice","pageBtn","querySelector","scrollIntoView","behavior","block","inline","selectPage","page","max","renderPage","h","class","type","title","onClick","renderEllipsisButton","renderPages","pagesChunks","map","chunk","renderSplitPages","renderBackButton","disabled","name","renderForwardButton","renderMobile","label","goToPage","role","tabIndex","onSubmit","ev","preventDefault","goToPageValue","InputType","NUMBER","message","onInput","target","value","placeholder","toString","hasclearicon","componentDidLoad","componentDidRender","render","Host","skip","navArrows","onKeyDown","key"],"sources":["src/components/z-pagination/styles.css?tag=z-pagination","src/components/z-pagination/index.tsx"],"sourcesContent":["z-pagination {\n --z-pagination--page-button-width: 64px;\n --z-pagination--pages-container-max-width: 100%;\n\n display: flex;\n max-width: 100%;\n flex-flow: column wrap;\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n gap: calc(var(--space-unit) * 2) calc(var(--space-unit) * 4);\n}\n\nz-pagination,\nz-pagination * {\n box-sizing: border-box;\n}\n\nz-pagination button {\n height: 100%;\n}\n\nz-pagination z-icon {\n fill: var(--color-primary01-icon);\n}\n\nz-pagination *:disabled z-icon {\n fill: var(--color-disabled03);\n}\n\nz-pagination .page-label {\n margin-right: calc(var(--space-unit) * 3);\n color: var(--color-default-text);\n}\n\nz-pagination .pagination-bar {\n display: flex;\n max-width: 100%;\n height: 48px;\n align-items: center;\n}\n\nz-pagination .pagination-bar button {\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n margin: 0;\n background-color: var(--color-surface02);\n color: var(--color-primary01);\n cursor: pointer;\n font-family: inherit;\n font-weight: inherit;\n transition:\n background-color 0.15s ease-out,\n color 0.15s ease-out,\n border-bottom-color 0.15s ease-out,\n font-size 0.15s ease-in-out,\n font-weight 0.15s ease-in-out;\n}\n\nz-pagination .pagination-bar button:focus-visible {\n background-color: var(--color-surface01);\n outline: none;\n}\n\nz-pagination .pagination-bar .pagination-button {\n padding: calc(var(--space-unit) * 2);\n font-weight: var(--font-sb);\n text-transform: uppercase;\n white-space: nowrap;\n}\n\nz-pagination .pagination-bar .navigation-button {\n padding: calc(var(--space-unit) * 2) calc(var(--space-unit) * 1.5);\n}\n\nz-pagination .pagination-bar .pagination-button:disabled,\nz-pagination .pagination-bar .navigation-button:disabled {\n color: var(--color-disabled03);\n cursor: default;\n fill: var(--color-disabled03);\n pointer-events: none;\n}\n\nz-pagination .pagination-bar .page-button,\nz-pagination .pagination-bar .ellipsis-button {\n width: var(--z-pagination--page-button-width);\n}\n\nz-pagination .pages-container {\n position: relative;\n display: inline-flex;\n max-width: 100%;\n height: 100%;\n overflow-x: auto;\n scroll-behavior: smooth;\n scroll-snap-align: center;\n\n /* hide scrollbar in Firefox */\n scrollbar-width: none;\n}\n\nz-pagination .pages-container::-webkit-scrollbar {\n display: none;\n}\n\nz-pagination .pages-chunk {\n display: flex;\n scroll-snap-align: center;\n}\n\nz-pagination .pagination-bar .page-button {\n padding-top: var(--border-size-large) solid transparent;\n border-bottom: var(--border-size-large) solid transparent;\n font-size: var(--font-size-2);\n font-weight: var(--font-sb);\n}\n\nz-pagination .pagination-bar .page-button[data-current] {\n border-bottom-color: var(--color-primary01);\n font-size: var(--font-size-7);\n}\n\nz-pagination .go-to-page {\n display: flex;\n flex-direction: column;\n row-gap: var(--space-unit);\n}\n\nz-pagination .go-to-page .label {\n color: var(--color-default-text);\n text-transform: uppercase;\n}\n\nz-pagination .go-to-page .inputs {\n display: flex;\n column-gap: var(--space-unit);\n}\n\nz-pagination .go-to-page .inputs z-input {\n width: calc(var(--space-unit) * 11);\n}\n\nz-pagination .go-to-page .inputs z-input input,\nz-pagination .mobile-go-to-page z-input input {\n padding: 0 calc(var(--space-unit) * 1.5) !important;\n appearance: none;\n}\n\nz-pagination .mobile-go-to-page {\n display: flex;\n height: 100%;\n flex: 1 auto;\n align-items: center;\n justify-content: center;\n background-color: var(--color-surface02);\n}\n\nz-pagination .mobile-go-to-page z-input {\n width: var(--z-pagination--page-button-width);\n margin-right: var(--space-unit);\n}\n\nz-pagination .mobile-go-to-page z-input input {\n text-align: center;\n}\n\nz-pagination .mobile-go-to-page z-input input::-webkit-outer-spin-button,\nz-pagination .mobile-go-to-page z-input input::-webkit-inner-spin-button {\n appearance: none;\n}\n\nz-pagination .mobile-go-to-page > span {\n font-size: var(--font-size-2);\n}\n\n@media (hover: hover) {\n z-pagination .pagination-bar button:hover {\n background-color: var(--color-surface01);\n }\n\n z-pagination .pagination-bar .page-button:hover {\n border-bottom-color: var(--color-hover-primary);\n color: var(--color-hover-primary);\n }\n}\n\n@media (min-width: 768px) {\n z-pagination {\n --z-pagination--page-button-width: 88px;\n\n flex-direction: row;\n align-items: flex-end;\n }\n\n z-pagination .pages-container {\n max-width: var(--z-pagination--pages-container-max-width);\n }\n}\n","import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {InputType} from \"../../beans\";\n\n/**\n * Pagination bar component.\n */\n@Component({\n tag: \"z-pagination\",\n styleUrl: \"styles.css\",\n})\nexport class ZPagination {\n @Element() host: HTMLZPaginationElement;\n\n /** Pagination label placed before the bar. */\n @Prop()\n label?: string;\n\n /** Enable navigation arrows. */\n @Prop()\n navArrows = true;\n\n /** Total number of pages. Required. */\n @Prop()\n totalPages!: number;\n\n /** Number of pages to skip. */\n @Prop()\n skip = 0;\n\n /** Enable buttons to go to the first and last pages. */\n @Prop()\n edges = false;\n\n /** Number of pages to show left/right of the current, before showing \"load more\" symbol (…). */\n @Prop()\n split?: number;\n\n /** Number of pages to show at a time. If not set, all pages will be shown. */\n @Prop()\n visiblePages?: number;\n\n /** Current page. */\n @Prop({mutable: true})\n currentPage = 1;\n\n /** Whether to show \"go to page\" feature. */\n @Prop()\n goToPage: boolean;\n\n /**\n * Internal visible pages variable.\n * Needed to better handle conflicting props like `visiblePages` and `split`.\n * This state will change based on props values and validation,\n * keeping original `visiblePages` value intact.\n */\n @State()\n private _visiblePages = this.visiblePages;\n\n /** Used to hides/change some functionalities on smaller screen sizes */\n @State()\n isMobile = false;\n\n /** Value of the go to page input */\n @State()\n goToPageValue = null;\n\n /** Event emitted when the current page has changed. */\n @Event()\n pageChanged: EventEmitter;\n\n /**\n * Set the max width of the pages container.\n */\n @Watch(\"_visiblePages\")\n setPagesContainerWidth(): void {\n if (!this._visiblePages || this.split) {\n this.host.style.setProperty(\"--z-pagination--pages-container-max-width\", \"100%\");\n\n return;\n }\n\n const pagesContainerStyle = window.getComputedStyle(this.host);\n const pageButtonWidth = pagesContainerStyle.getPropertyValue(\"--z-pagination--page-button-width\");\n this.host.style.setProperty(\n \"--z-pagination--pages-container-max-width\",\n `calc(${pageButtonWidth} * ${this._visiblePages})`\n );\n }\n\n /**\n * Set visible pages.\n * Ensure that the visible pages are always <= the total pages.\n * If `visiblePages` isn't set, fallback to the total pages.\n */\n @Watch(\"visiblePages\")\n setVisiblePages(): void {\n this._visiblePages = Math.min(this.visiblePages || this.totalPages, this.totalPages);\n }\n\n /**\n * On page changed.\n * @emits pageChanged\n */\n @Watch(\"currentPage\")\n onPageChanged(): void {\n this.pageChanged.emit(this.currentPage);\n this.scrollToPage();\n }\n\n /**\n * On split changed.\n * Empty `edges` value. The split feature wins over the pages chunks and edges.\n */\n @Watch(\"split\")\n onSplitChanged(): void {\n if (this.split) {\n this.edges = false;\n }\n }\n\n /**\n * Hide stuff on mobile.\n */\n @Listen(\"resize\", {target: \"window\", passive: true})\n onResize(): void {\n this.setMobile();\n }\n\n /**\n * Set functionalities according to screen size.\n */\n private setMobile(): void {\n const mobileMediaQuery = \"screen and (max-width: 767px)\";\n this.isMobile = window.matchMedia(mobileMediaQuery).matches;\n }\n\n /**\n * Get a list of pages chunks, each of `visiblePages` length.\n * @returns {number[][]}\n */\n private getPagesChunks(): number[][] {\n // array of numbers from 1 to `totalPages`\n const pages = Array.from({length: this.totalPages}, (_, i) => i + 1);\n\n const chunks = [];\n const chunksCount = Math.ceil(pages.length / this._visiblePages);\n for (let index = 0; index < chunksCount; index++) {\n chunks.push(pages.slice(index * this._visiblePages, (index + 1) * this._visiblePages));\n }\n\n return chunks;\n }\n\n /**\n * Scroll to the left the chunk of pages containing the current page.\n */\n private scrollToPage(): void {\n const pageBtn = this.host.querySelector(`[data-page=\"${this.currentPage}\"]`) as HTMLElement;\n\n if (!pageBtn) {\n return;\n }\n\n pageBtn.scrollIntoView({\n behavior: \"smooth\",\n block: \"nearest\",\n inline: \"center\",\n });\n }\n\n /**\n * Select a page.\n * Do validations on the passed value before assigning it to `currentPage`.\n * @param {number} page Page number to set\n */\n private selectPage(page): void {\n this.currentPage = Math.min(Math.max(page, 1), this.totalPages);\n }\n\n /**\n * Render page number button.\n * @param {number} page Page number to render\n * @returns {HTMLButtonElement}\n */\n private renderPage(page): HTMLButtonElement {\n return (\n <button\n class=\"page-button\"\n type=\"button\"\n aria-current={this.currentPage === page ? \"page\" : \"false\"}\n title={`Vai alla pagina ${page}`}\n data-page={page}\n data-current={this.currentPage === page}\n onClick={() => this.selectPage(page)}\n >\n {page}\n </button>\n );\n }\n\n /**\n * Render split button.\n * @param {number} page Page to select on click.\n * @returns {HTMLButtonElement}\n */\n private renderEllipsisButton(page): HTMLButtonElement {\n return (\n <button\n class=\"ellipsis-button\"\n type=\"button\"\n title={`Vai alla pagina ${page}`}\n onClick={() => this.selectPage(page)}\n >\n …\n </button>\n );\n }\n\n /**\n * Render chunked page buttons.\n * @returns {HTMLDivElement[]}\n */\n private renderPages(): HTMLDivElement[] {\n const pagesChunks = this.getPagesChunks();\n if (pagesChunks.length <= 0) {\n return;\n }\n\n return pagesChunks.map((chunk) => <div class=\"pages-chunk\">{chunk.map((page) => this.renderPage(page))}</div>);\n }\n\n /**\n * Render page buttons when split feature is enabled.\n * @returns {HTMLButtonElement[]}\n */\n private renderSplitPages(): HTMLButtonElement[] {\n // left and right split pages, current page, first and last page, left and right ellipsis button\n if (this.totalPages <= this.split * 2 + 5) {\n // Too few pages: ellipsis will never be rendered, so let's just render all pages and that's it.\n return Array.from({length: this.totalPages}, (_, i) => this.renderPage(i + 1));\n }\n\n if (this.currentPage <= this.split * 2 + 2) {\n // Render first (2 * split + 3) pages, ellipsis, then last page.\n return [\n ...Array.from({length: this.split * 2 + 3}, (_, i) => this.renderPage(i + 1)),\n this.renderEllipsisButton(this.split * 2 + 4),\n this.renderPage(this.totalPages),\n ];\n }\n\n if (this.currentPage > this.split * 2 + 2 && this.currentPage < this.totalPages - this.split * 2 - 1) {\n // Render first page, ellipsis, current page surrounded by (split) pages both before and after, another ellipsis, then last page.\n return [\n this.renderPage(1),\n this.renderEllipsisButton(this.currentPage - this.split - 1),\n ...Array.from({length: this.split * 2 + 1}, (_, i) => this.renderPage(this.currentPage - this.split + i)),\n this.renderEllipsisButton(this.currentPage + this.split + 1),\n this.renderPage(this.totalPages),\n ];\n }\n\n // Render first page, ellipsis, then last (2 * split + 3) pages.\n return [\n this.renderPage(1),\n this.renderEllipsisButton(this.totalPages - this.split * 2 - 3),\n ...Array.from({length: this.split * 2 + 3}, (_, i) => this.renderPage(this.totalPages - this.split * 2 - 2 + i)),\n ];\n }\n\n private renderBackButton(): HTMLButtonElement {\n return (\n <button\n class=\"navigation-button\"\n type=\"button\"\n title=\"Vai alla pagina precedente\"\n disabled={this.currentPage === 1}\n onClick={() => this.selectPage(this.currentPage - 1)}\n >\n <z-icon name=\"chevron-left\"></z-icon>\n </button>\n );\n }\n\n private renderForwardButton(): HTMLButtonElement {\n return (\n <button\n class=\"navigation-button\"\n type=\"button\"\n title=\"Vai alla prossima pagina\"\n disabled={this.currentPage === this.totalPages}\n onClick={() => this.selectPage(this.currentPage + 1)}\n >\n <z-icon name=\"chevron-right\"></z-icon>\n </button>\n );\n }\n\n private renderMobile(): HTMLElement[] {\n const pagesChunks = this.getPagesChunks();\n\n return [\n this.label && <span class=\"page-label body-1-sb\">{this.label}</span>,\n\n <div class=\"pagination-bar\">\n {this.renderBackButton()}\n\n {!this.goToPage && (\n <div\n class=\"pages-container\"\n role=\"navigation\"\n tabIndex={-1}\n >\n {pagesChunks.length > 0 &&\n pagesChunks.map((chunk) => <div class=\"pages-chunk\">{chunk.map((page) => this.renderPage(page))}</div>)}\n </div>\n )}\n\n {this.goToPage && (\n <form\n class=\"mobile-go-to-page\"\n onSubmit={(ev) => {\n ev.preventDefault();\n this.selectPage(this.goToPageValue);\n }}\n >\n <z-input\n class=\"go-to-page-input\"\n type={InputType.NUMBER}\n min={1}\n max={this.totalPages}\n message={false}\n onInput={(ev: InputEvent) => {\n this.goToPageValue = (ev.target as HTMLZInputElement).value;\n }}\n placeholder={this.currentPage.toString()}\n hasclearicon={false}\n ></z-input>\n <span>{`/${this.totalPages}`}</span>\n </form>\n )}\n\n {this.renderForwardButton()}\n </div>,\n ];\n }\n\n componentDidLoad(): void {\n this.setVisiblePages();\n }\n\n componentDidRender(): void {\n if (this.split) {\n this.edges = false;\n }\n\n this.setPagesContainerWidth();\n this.setMobile();\n }\n\n render(): HTMLZPaginationElement {\n if (this.isMobile) {\n return <Host>{this.renderMobile()}</Host>;\n }\n\n return (\n <Host>\n <div class=\"pagination-bar\">\n {this.label && <span class=\"page-label body-1-sb\">{this.label}</span>}\n\n {this.edges && (\n <button\n class=\"pagination-button\"\n type=\"button\"\n title=\"Vai alla pagina 1\"\n disabled={this.currentPage === 1}\n onClick={() => this.selectPage(1)}\n >\n Pagina 1\n </button>\n )}\n\n {this.skip < this.totalPages && this.skip > 1 && (\n <button\n class=\"pagination-button\"\n type=\"button\"\n title={`Vai alla pagina ${this.currentPage - this.skip}`}\n disabled={this.currentPage <= this.skip}\n onClick={() => this.selectPage(this.currentPage - this.skip)}\n >\n -{this.skip}\n </button>\n )}\n\n {this.navArrows && this.renderBackButton()}\n\n <div\n class=\"pages-container\"\n role=\"navigation\"\n tabIndex={-1}\n >\n {this.split ? this.renderSplitPages() : this.renderPages()}\n </div>\n\n {this.navArrows && this.renderForwardButton()}\n\n {this.skip < this.totalPages && this.skip > 1 && (\n <button\n class=\"pagination-button\"\n type=\"button\"\n title={`Vai alla pagina ${this.currentPage + this.skip}`}\n disabled={this.currentPage > this.totalPages - this.skip}\n onClick={() => this.selectPage(this.currentPage + this.skip)}\n >\n +{this.skip}\n </button>\n )}\n\n {this.edges && (\n <button\n class=\"pagination-button\"\n type=\"button\"\n title={`Vai alla pagina ${this.totalPages}`}\n disabled={this.currentPage === this.totalPages}\n onClick={() => this.selectPage(this.totalPages)}\n >\n Pagina {this.totalPages}\n </button>\n )}\n </div>\n {this.goToPage && (\n <div class=\"go-to-page\">\n <span class=\"label body-5-sb\">Vai a pagina:</span>\n <div class=\"inputs\">\n <z-input\n class=\"go-to-page-input\"\n type={InputType.NUMBER}\n min={1}\n max={this.totalPages}\n message={false}\n placeholder=\"2\"\n hasclearicon={false}\n onInput={(ev: InputEvent) => {\n this.goToPageValue = (ev.target as HTMLZInputElement).value;\n }}\n onKeyDown={(ev) => ev.key === \"Enter\" && this.selectPage(this.goToPageValue)}\n ></z-input>\n <z-button\n disabled={!this.goToPageValue}\n title=\"Vai alla pagina inserita\"\n onClick={() => this.selectPage(this.goToPageValue)}\n >\n vai\n </z-button>\n </div>\n </div>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"oGAAA,MAAMA,EAAY,00HAClB,MAAAC,EAAeD,E,MCSFE,EAAW,M,sGASV,K,oCAQL,E,WAIC,M,kEAYM,E,2CAaUC,KAAKC,a,cAIlB,M,mBAIK,I,CAUhB,sBAAAC,GACE,IAAKF,KAAKG,eAAiBH,KAAKI,MAAO,CACrCJ,KAAKK,KAAKC,MAAMC,YAAY,4CAA6C,QAEzE,M,CAGF,MAAMC,EAAsBC,OAAOC,iBAAiBV,KAAKK,MACzD,MAAMM,EAAkBH,EAAoBI,iBAAiB,qCAC7DZ,KAAKK,KAAKC,MAAMC,YACd,4CACA,QAAQI,OAAqBX,KAAKG,iB,CAUtC,eAAAU,GACEb,KAAKG,cAAgBW,KAAKC,IAAIf,KAAKC,cAAgBD,KAAKgB,WAAYhB,KAAKgB,W,CAQ3E,aAAAC,GACEjB,KAAKkB,YAAYC,KAAKnB,KAAKoB,aAC3BpB,KAAKqB,c,CAQP,cAAAC,GACE,GAAItB,KAAKI,MAAO,CACdJ,KAAKuB,MAAQ,K,EAQjB,QAAAC,GACExB,KAAKyB,W,CAMC,SAAAA,GACN,MAAMC,EAAmB,gCACzB1B,KAAK2B,SAAWlB,OAAOmB,WAAWF,GAAkBG,O,CAO9C,cAAAC,GAEN,MAAMC,EAAQC,MAAMC,KAAK,CAACC,OAAQlC,KAAKgB,aAAa,CAACmB,EAAGC,IAAMA,EAAI,IAElE,MAAMC,EAAS,GACf,MAAMC,EAAcxB,KAAKyB,KAAKR,EAAMG,OAASlC,KAAKG,eAClD,IAAK,IAAIqC,EAAQ,EAAGA,EAAQF,EAAaE,IAAS,CAChDH,EAAOI,KAAKV,EAAMW,MAAMF,EAAQxC,KAAKG,eAAgBqC,EAAQ,GAAKxC,KAAKG,e,CAGzE,OAAOkC,C,CAMD,YAAAhB,GAC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zD,KAAKiD,WAAWjD,KAAK4E,gBAAc,S","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as a,h as o,a as n,g as t}from"./p-75c4a726.js";import{B as i}from"./p-b34993de.js";const r="html{scroll-behavior:smooth}z-anchor-navigation nav{display:none;flex-direction:column;justify-content:flex-start;row-gap:calc(var(--space-unit) / 2)}z-anchor-navigation[collapsed] nav{display:flex;margin-top:var(--space-unit)}z-anchor-navigation nav a{display:-webkit-box;overflow:clip;width:100%;box-sizing:border-box;padding:calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 2);-webkit-box-orient:vertical;font-weight:inherit;-webkit-line-clamp:2;line-clamp:2;overflow-clip-margin:content-box;text-decoration:none}z-anchor-navigation nav>* a{color:inherit}z-anchor-navigation nav * a:not(:only-child){padding-right:calc(var(--space-unit) * 5)}@supports not (overflow-clip-margin: content-box){z-anchor-navigation nav a{display:inline-block;overflow:hidden;-webkit-line-clamp:none;line-clamp:none;text-overflow:ellipsis;white-space:nowrap}}z-anchor-navigation nav>*{position:relative;border-left:var(--border-size-large) solid var(--color-surface05);color:var(--color-default-text);font-family:var(--font-family-sans);transition:background-color 0.3s ease-in-out,\n border-color 0.3s ease-in-out,\n color 0.3s ease-in-out}z-anchor-navigation nav>[data-current]{border-left-color:var(--color-primary01);color:var(--color-primary01);font-weight:var(--font-sb)}z-anchor-navigation nav>*>*:is(z-button,button){position:absolute;top:50%;right:0;transform:translateY(-50%);transition:opacity 0.3s ease-in-out}z-anchor-navigation nav>*:focus:focus-visible,z-anchor-navigation nav>*>*:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}z-anchor-navigation nav button{padding:0;border:none;margin:0;background-color:transparent}@media (min-width: 768px){z-anchor-navigation z-button.toggle{display:none !important}z-anchor-navigation nav{display:flex}z-anchor-navigation nav>*>:is(z-button,button){opacity:0;pointer-events:none}@media (hover: hover){z-anchor-navigation nav>:is([data-current],:hover,:focus,:focus-within)>:is(z-button,button){opacity:1;pointer-events:unset}z-anchor-navigation nav>*:hover{border-left-color:var(--color-hover-primary);background-color:var(--color-surface02);color:var(--color-hover-primary)}}z-anchor-navigation[hide-unselected] nav>*:not([data-current],:hover,:focus,:focus-within){color:transparent;fill:transparent}}";const e=r;const c=class{constructor(o){a(this,o);this.hideUnselected=false;this.autoCurrent=true;this.collapsed=false}setCurrent(){const a=Array.from(this.nav.querySelectorAll("a")).find((a=>a.href===this.host.ownerDocument.location.href));Array.from(this.nav.children).forEach((o=>{const n=o instanceof HTMLAnchorElement?o:o.querySelector("a");const t=n===a;n.setAttribute("aria-current",t.toString());o.toggleAttribute("data-current",t)}))}toggleCollapsed(){this.collapsed=!this.collapsed}componentDidLoad(){if(this.autoCurrent){window.addEventListener("hashchange",this.setCurrent.bind(this));this.setCurrent()}}disconnectedCallback(){window.removeEventListener("hashchange",this.setCurrent)}render(){return o(n,{key:"13b73e5270d20ed2fe6993c36bcc67b462e906c6",collapsed:this.collapsed},o("z-button",{key:"e30c82721fc47924bcea1d16d0df1809ce8bf9e5",class:"toggle",variant:i.SECONDARY,icon:this.collapsed?"chevron-up":"chevron-down",onClick:this.toggleCollapsed.bind(this)},"salta a"),o("nav",{key:"2947b460bbaa7df8d2a8a9a50c51d1b4aa9230d4",ref:a=>this.nav=a},o("slot",{key:"9db93583f854c9a6ca57da4d7efeebca6c88836e"})))}get host(){return t(this)}};c.style=e;export{c as z_anchor_navigation};
|
|
2
|
+
//# sourceMappingURL=p-d6a2b1c6.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["stylesCss","ZAnchorNavigationStyle0","ZAnchorNavigation","setCurrent","currentElement","Array","from","this","nav","querySelectorAll","find","anchor","href","host","ownerDocument","location","children","forEach","item","HTMLAnchorElement","querySelector","isCurrent","setAttribute","toString","toggleAttribute","toggleCollapsed","collapsed","componentDidLoad","autoCurrent","window","addEventListener","bind","disconnectedCallback","removeEventListener","render","h","Host","key","class","variant","ButtonVariant","SECONDARY","icon","onClick","ref","el"],"sources":["src/components/z-anchor-navigation/styles.css?tag=z-anchor-navigation","src/components/z-anchor-navigation/index.tsx"],"sourcesContent":["html {\n scroll-behavior: smooth;\n}\n\nz-anchor-navigation nav {\n display: none;\n flex-direction: column;\n justify-content: flex-start;\n row-gap: calc(var(--space-unit) / 2);\n}\n\nz-anchor-navigation[collapsed] nav {\n display: flex;\n margin-top: var(--space-unit);\n}\n\nz-anchor-navigation nav a {\n display: -webkit-box;\n overflow: clip;\n width: 100%;\n box-sizing: border-box;\n padding: calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 2);\n -webkit-box-orient: vertical;\n font-weight: inherit;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n overflow-clip-margin: content-box;\n text-decoration: none;\n}\n\nz-anchor-navigation nav > * a {\n color: inherit;\n}\n\nz-anchor-navigation nav * a:not(:only-child) {\n padding-right: calc(var(--space-unit) * 5);\n}\n\n@supports not (overflow-clip-margin: content-box) {\n z-anchor-navigation nav a {\n display: inline-block;\n overflow: hidden;\n -webkit-line-clamp: none;\n line-clamp: none;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n}\n\nz-anchor-navigation nav > * {\n position: relative;\n border-left: var(--border-size-large) solid var(--color-surface05);\n color: var(--color-default-text);\n font-family: var(--font-family-sans);\n transition:\n background-color 0.3s ease-in-out,\n border-color 0.3s ease-in-out,\n color 0.3s ease-in-out;\n}\n\nz-anchor-navigation nav > [data-current] {\n border-left-color: var(--color-primary01);\n color: var(--color-primary01);\n font-weight: var(--font-sb);\n}\n\nz-anchor-navigation nav > * > *:is(z-button, button) {\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n transition: opacity 0.3s ease-in-out;\n}\n\nz-anchor-navigation nav > *:focus:focus-visible,\nz-anchor-navigation nav > * > *:focus:focus-visible {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\nz-anchor-navigation nav button {\n padding: 0;\n border: none;\n margin: 0;\n background-color: transparent;\n}\n\n@media (min-width: 768px) {\n z-anchor-navigation z-button.toggle {\n display: none !important;\n }\n\n z-anchor-navigation nav {\n display: flex;\n }\n\n /* hide anchor actions by default... */\n z-anchor-navigation nav > * > :is(z-button, button) {\n opacity: 0;\n pointer-events: none;\n }\n\n @media (hover: hover) {\n /* ...show them only hovering/focusing the anchor */\n z-anchor-navigation nav > :is([data-current], :hover, :focus, :focus-within) > :is(z-button, button) {\n opacity: 1;\n pointer-events: unset;\n }\n\n z-anchor-navigation nav > *:hover {\n border-left-color: var(--color-hover-primary);\n background-color: var(--color-surface02);\n color: var(--color-hover-primary);\n }\n }\n\n z-anchor-navigation[hide-unselected] nav > *:not([data-current], :hover, :focus, :focus-within) {\n color: transparent;\n fill: transparent;\n }\n}\n","import {Component, Element, h, Host, Prop, State} from \"@stencil/core\";\nimport {ButtonVariant} from \"../../beans\";\n\n/**\n * Anchor navigation component.\n * @slot - Anchor navigation items. Use `<a>` elements inside. If you need an extra action element, use a wrapper around it and the anchor.\n * @example\n * ```\n * <z-anchor-navigation>\n * <div>\n * <a href=\"#section-id\">Section name</a>\n * <button type=\"button\">\n * <z-icon name=\"share\" />\n * </button>\n * </div>\n * </z-anchor-navigation>\n * ```\n */\n@Component({\n tag: \"z-anchor-navigation\",\n styleUrl: \"styles.css\",\n shadow: false,\n})\nexport class ZAnchorNavigation {\n /**\n * If enabled, the text of each anchor will be hidden unless\n * for the current one or the one the user is hovering.\n */\n @Prop({reflect: true})\n hideUnselected = false;\n\n /**\n * Enables automatic inference of the current item, listening for hash change\n * and checking the `href` of the slotted anchors.\n * When disabled, the highlight of current item must be handled manually by setting the `data-current`\n * attribute to the correct slotted items and the `aria-current` attribute to the anchors.\n */\n @Prop()\n autoCurrent = true;\n\n /**\n * Whether the mobile list is collapsed.\n */\n @State()\n collapsed = false;\n\n @Element() host: HTMLZAnchorNavigationElement;\n\n /** Reference to the nav element. */\n private nav: HTMLElement;\n\n /**\n * Set `aria-current` attribute to the anchors.\n */\n private setCurrent(): void {\n const currentElement = Array.from(this.nav.querySelectorAll(\"a\")).find(\n (anchor) => anchor.href === this.host.ownerDocument.location.href\n );\n Array.from(this.nav.children).forEach((item) => {\n const anchor = item instanceof HTMLAnchorElement ? item : item.querySelector(\"a\");\n const isCurrent = anchor === currentElement;\n anchor.setAttribute(\"aria-current\", isCurrent.toString());\n item.toggleAttribute(\"data-current\", isCurrent);\n });\n }\n\n /**\n * Toggle collapsed state.\n */\n private toggleCollapsed(): void {\n this.collapsed = !this.collapsed;\n }\n\n componentDidLoad(): void {\n if (this.autoCurrent) {\n window.addEventListener(\"hashchange\", this.setCurrent.bind(this));\n this.setCurrent();\n }\n }\n\n disconnectedCallback(): void {\n window.removeEventListener(\"hashchange\", this.setCurrent);\n }\n\n render(): HTMLZAnchorNavigationElement {\n return (\n <Host collapsed={this.collapsed}>\n <z-button\n class=\"toggle\"\n variant={ButtonVariant.SECONDARY}\n icon={this.collapsed ? \"chevron-up\" : \"chevron-down\"}\n onClick={this.toggleCollapsed.bind(this)}\n >\n salta a\n </z-button>\n <nav ref={(el) => (this.nav = el)}>\n <slot></slot>\n </nav>\n </Host>\n );\n }\n}\n"],"mappings":"6FAAA,MAAMA,EAAY,wuEAClB,MAAAC,EAAeD,E,MCsBFE,EAAiB,M,6CAMX,M,iBASH,K,eAMF,K,CAUJ,UAAAC,GACN,MAAMC,EAAiBC,MAAMC,KAAKC,KAAKC,IAAIC,iBAAiB,MAAMC,MAC/DC,GAAWA,EAAOC,OAASL,KAAKM,KAAKC,cAAcC,SAASH,OAE/DP,MAAMC,KAAKC,KAAKC,IAAIQ,UAAUC,SAASC,IACrC,MAAMP,EAASO,aAAgBC,kBAAoBD,EAAOA,EAAKE,cAAc,KAC7E,MAAMC,EAAYV,IAAWP,EAC7BO,EAAOW,aAAa,eAAgBD,EAAUE,YAC9CL,EAAKM,gBAAgB,eAAgBH,EAAU,G,CAO3C,eAAAI,GACNlB,KAAKmB,WAAanB,KAAKmB,S,CAGzB,gBAAAC,GACE,GAAIpB,KAAKqB,YAAa,CACpBC,OAAOC,iBAAiB,aAAcvB,KAAKJ,WAAW4B,KAAKxB,OAC3DA,KAAKJ,Y,EAIT,oBAAA6B,GACEH,OAAOI,oBAAoB,aAAc1B,KAAKJ,W,CAGhD,MAAA+B,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,2CAACX,UAAWnB,KAAKmB,WACpBS,EAAA,YAAAE,IAAA,2CACEC,MAAM,SACNC,QAASC,EAAcC,UACvBC,KAAMnC,KAAKmB,UAAY,aAAe,eACtCiB,QAASpC,KAAKkB,gBAAgBM,KAAKxB,OAAK,WAI1C4B,EAAA,OAAAE,IAAA,2CAAKO,IAAMC,GAAQtC,KAAKC,IAAMqC,GAC5BV,EAAA,QAAAE,IAAA,8C","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g as e,p as t}from"./p-b34993de.js";import{B as n}from"./p-5145a606.js";function r(e){switch(e){case true:case"true":case 1:case"1":case"on":case"yes":return true;case false:case"false":case 0:case"0":case"off":case"no":return false;default:return e}}function a(){return Math.random().toString(36).replace("0.","")}function s(t,n,...r){if(t.code===e.ENTER||t.code===e.SPACE){t.preventDefault();n(...r)}}function u(t,n,...r){if(t.code===e.ENTER){t.preventDefault();n(...r)}}function c(e=null){if(!e){e=document.activeElement}if(e&&e.shadowRoot&&e.shadowRoot.activeElement){e=e.shadowRoot.activeElement;return c(e)}return e}function f(e,t=[]){t.push(e);if(e.parentElement){e=e.parentElement;return f(e,t)}else if(e.parentNode&&e.parentNode.host){e=e.parentNode.host;return f(e,t)}return t}function o(){switch(true){case window.innerWidth<=n.MOBILE:return t.MOBILE;case window.innerWidth<=n.TABLET:return t.TABLET;case window.innerWidth<=n.DESKTOP:return t.DESKTOP;default:return t.DESKTOP_WIDE}}function i(e){try{return JSON.parse(e)}catch(e){return false}}function l(e){const t="avatar-C";const n=19;const r=Math.ceil(2**31-1)*parseFloat(`0.${e}`);let a=Math.ceil(n*(r%1));if(a===0){a=1}return`${t}${a.toString().padStart(2,"0")}`}function d(e,t){var n;return e.contains(t)||!!((n=e.shadowRoot)===null||n===void 0?void 0:n.contains(t))}export{d as a,r as b,l as c,s as d,
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{g as e,p as t}from"./p-b34993de.js";import{B as n}from"./p-5145a606.js";function r(e){switch(e){case true:case"true":case 1:case"1":case"on":case"yes":return true;case false:case"false":case 0:case"0":case"off":case"no":return false;default:return e}}function a(){return Math.random().toString(36).replace("0.","")}function s(t,n,...r){if(t.code===e.ENTER||t.code===e.SPACE){t.preventDefault();n(...r)}}function u(t,n,...r){if(t.code===e.ENTER){t.preventDefault();n(...r)}}function c(e=null){if(!e){e=document.activeElement}if(e&&e.shadowRoot&&e.shadowRoot.activeElement){e=e.shadowRoot.activeElement;return c(e)}return e}function f(e,t=[]){t.push(e);if(e.parentElement){e=e.parentElement;return f(e,t)}else if(e.parentNode&&e.parentNode.host){e=e.parentNode.host;return f(e,t)}return t}function o(){switch(true){case window.innerWidth<=n.MOBILE:return t.MOBILE;case window.innerWidth<=n.TABLET:return t.TABLET;case window.innerWidth<=n.DESKTOP:return t.DESKTOP;default:return t.DESKTOP_WIDE}}function i(e){try{return JSON.parse(e)}catch(e){return false}}function l(e){const t="avatar-C";const n=19;const r=Math.ceil(2**31-1)*parseFloat(`0.${e}`);let a=Math.ceil(n*(r%1));if(a===0){a=1}return`${t}${a.toString().padStart(2,"0")}`}function d(e,t){var n;return e.contains(t)||!!((n=e.shadowRoot)===null||n===void 0?void 0:n.contains(t))}export{d as a,r as b,l as c,s as d,c as e,f,o as g,u as h,i,a as r};
|
|
2
|
+
//# sourceMappingURL=p-e691c0b8.js.map
|