@zanichelli/albe-web-components 19.2.1-RC → 19.2.2
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 +44 -0
- package/dist/cjs/{index-938c9669.js → index-c38e5b9e.js} +2 -2
- package/dist/cjs/{index-938c9669.js.map → index-c38e5b9e.js.map} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-e8b453d5.js → utils-b1859d65.js} +7 -1
- package/dist/cjs/utils-b1859d65.js.map +1 -0
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-app-header_12.cjs.entry.js +5 -4
- package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -1
- package/dist/cjs/z-book-card-deprecated.cjs.entry.js +1 -1
- package/dist/cjs/z-book-card.cjs.entry.js +1 -1
- package/dist/cjs/z-book-card.cjs.entry.js.map +1 -1
- package/dist/cjs/z-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/z-color-picker.cjs.entry.js +1 -1
- package/dist/cjs/z-combobox.cjs.entry.js +125 -96
- package/dist/cjs/z-combobox.cjs.entry.js.map +1 -1
- package/dist/cjs/z-menu.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-info.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-list-item.cjs.entry.js +1 -1
- package/dist/cjs/z-popover.cjs.entry.js +1 -1
- package/dist/cjs/z-select.cjs.entry.js +100 -134
- package/dist/cjs/z-select.cjs.entry.js.map +1 -1
- package/dist/cjs/z-skip-to-content.cjs.entry.js +1 -1
- package/dist/cjs/z-slideshow.cjs.entry.js +1 -1
- package/dist/cjs/z-table.cjs.entry.js +2 -2
- package/dist/cjs/z-toast-notification-list.cjs.entry.js +2 -1
- package/dist/cjs/z-toast-notification-list.cjs.entry.js.map +1 -1
- package/dist/cjs/z-toggle-switch.cjs.entry.js +1 -1
- package/dist/cjs/z-tool.cjs.entry.js +1 -1
- package/dist/cjs/z-tr.cjs.entry.js +2 -2
- package/dist/collection/components/book-card/z-book-card/styles.css +2 -1
- package/dist/collection/components/list/z-list-group/index.js +21 -2
- package/dist/collection/components/list/z-list-group/index.js.map +1 -1
- package/dist/collection/components/list/z-list-group/index.stories.js +3 -0
- package/dist/collection/components/list/z-list-group/index.stories.js.map +1 -1
- package/dist/collection/components/z-combobox/index.js +141 -98
- package/dist/collection/components/z-combobox/index.js.map +1 -1
- package/dist/collection/components/z-combobox/index.stories.js +2 -0
- package/dist/collection/components/z-combobox/index.stories.js.map +1 -1
- package/dist/collection/components/z-combobox/styles.css +41 -0
- package/dist/collection/components/z-searchbar/styles.css +1 -1
- package/dist/collection/components/z-select/index.js +99 -142
- package/dist/collection/components/z-select/index.js.map +1 -1
- package/dist/collection/components/z-select/styles.css +9 -2
- package/dist/collection/components/z-toast-notification-list/index.js +2 -1
- package/dist/collection/components/z-toast-notification-list/index.js.map +1 -1
- package/dist/collection/utils/utils.js +5 -0
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/index12.js +1 -1
- package/dist/components/index16.js +5 -3
- package/dist/components/index16.js.map +1 -1
- package/dist/components/index24.js +1 -1
- package/dist/components/index25.js +2 -2
- package/dist/components/index25.js.map +1 -1
- package/dist/components/utils.js +6 -1
- package/dist/components/utils.js.map +1 -1
- package/dist/components/z-book-card.js +1 -1
- package/dist/components/z-book-card.js.map +1 -1
- package/dist/components/z-combobox.js +128 -100
- package/dist/components/z-combobox.js.map +1 -1
- package/dist/components/z-select.js +101 -135
- package/dist/components/z-select.js.map +1 -1
- package/dist/components/z-skip-to-content.js +1 -1
- package/dist/components/z-slideshow.js +1 -1
- package/dist/components/z-toast-notification-list.js +2 -1
- package/dist/components/z-toast-notification-list.js.map +1 -1
- package/dist/esm/{index-83248f5c.js → index-a0b957e0.js} +2 -2
- package/dist/esm/{index-83248f5c.js.map → index-a0b957e0.js.map} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-1b64bcd9.js → utils-8d6ca808.js} +7 -2
- package/dist/esm/utils-8d6ca808.js.map +1 -0
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-app-header_12.entry.js +5 -4
- package/dist/esm/z-app-header_12.entry.js.map +1 -1
- package/dist/esm/z-book-card-deprecated.entry.js +1 -1
- package/dist/esm/z-book-card.entry.js +1 -1
- package/dist/esm/z-book-card.entry.js.map +1 -1
- package/dist/esm/z-breadcrumb.entry.js +1 -1
- package/dist/esm/z-color-picker.entry.js +1 -1
- package/dist/esm/z-combobox.entry.js +125 -96
- package/dist/esm/z-combobox.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-popover.entry.js +1 -1
- package/dist/esm/z-select.entry.js +100 -134
- 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-toast-notification-list.entry.js +2 -1
- package/dist/esm/z-toast-notification-list.entry.js.map +1 -1
- package/dist/esm/z-toggle-switch.entry.js +1 -1
- package/dist/esm/z-tool.entry.js +1 -1
- package/dist/esm/z-tr.entry.js +2 -2
- package/dist/types/components/list/z-list-group/index.d.ts +4 -0
- package/dist/types/components/list/z-list-group/index.stories.d.ts +1 -0
- package/dist/types/components/z-combobox/index.d.ts +10 -11
- package/dist/types/components/z-combobox/index.stories.d.ts +1 -0
- package/dist/types/components/z-select/index.d.ts +5 -7
- package/dist/types/components.d.ts +16 -0
- package/dist/types/utils/utils.d.ts +2 -0
- package/dist/web-components-library/index.esm.js +1 -1
- package/{www/build/p-a5146ef3.entry.js → dist/web-components-library/p-05be939d.entry.js} +2 -2
- package/dist/web-components-library/{p-a5146ef3.entry.js.map → p-05be939d.entry.js.map} +1 -1
- package/dist/web-components-library/{p-1a0c206d.js → p-061e28d6.js} +2 -2
- package/dist/web-components-library/p-061e28d6.js.map +1 -0
- package/dist/web-components-library/{p-4844c774.js → p-0b03b0e3.js} +2 -2
- package/dist/web-components-library/p-1b972597.entry.js +2 -0
- package/dist/web-components-library/{p-862989b6.entry.js.map → p-1b972597.entry.js.map} +1 -1
- package/dist/web-components-library/{p-19103e70.entry.js → p-35d73edf.entry.js} +2 -2
- package/dist/web-components-library/p-43adca09.entry.js +2 -0
- package/{www/build/p-2d4cf6ff.entry.js.map → dist/web-components-library/p-43adca09.entry.js.map} +1 -1
- package/{www/build/p-47813782.entry.js → dist/web-components-library/p-447a6391.entry.js} +2 -2
- package/dist/web-components-library/p-8503c87a.entry.js +2 -0
- package/dist/web-components-library/p-8503c87a.entry.js.map +1 -0
- package/dist/web-components-library/{p-a8609510.entry.js → p-869295ce.entry.js} +2 -2
- package/dist/web-components-library/{p-771dea79.entry.js → p-9814f864.entry.js} +2 -2
- package/{www/build/p-c5d52872.entry.js → dist/web-components-library/p-a3f9a5da.entry.js} +2 -2
- package/dist/web-components-library/p-a8790237.entry.js +2 -0
- package/dist/web-components-library/p-a8790237.entry.js.map +1 -0
- package/dist/web-components-library/{p-613987cd.entry.js → p-accbc381.entry.js} +2 -2
- package/dist/web-components-library/{p-613987cd.entry.js.map → p-accbc381.entry.js.map} +1 -1
- package/{www/build/p-8a53fefb.entry.js → dist/web-components-library/p-b0324c7d.entry.js} +2 -2
- package/dist/web-components-library/{p-c12f93e4.entry.js → p-bd76ca35.entry.js} +2 -2
- package/dist/web-components-library/p-c3e03e41.entry.js +2 -0
- package/dist/web-components-library/p-c3e03e41.entry.js.map +1 -0
- package/dist/web-components-library/{p-5905cca0.entry.js → p-ec1270db.entry.js} +2 -2
- package/{www/build/p-55e5e53a.entry.js → dist/web-components-library/p-f2c2ad04.entry.js} +2 -2
- package/dist/web-components-library/p-f7e65eb0.entry.js +2 -0
- package/dist/web-components-library/{p-26ed6c96.entry.js → p-fbce9614.entry.js} +2 -2
- 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 +2 -3
- package/www/build/index.esm.js +1 -1
- package/{dist/web-components-library/p-a5146ef3.entry.js → www/build/p-05be939d.entry.js} +2 -2
- package/www/build/{p-a5146ef3.entry.js.map → p-05be939d.entry.js.map} +1 -1
- package/www/build/{p-1a0c206d.js → p-061e28d6.js} +2 -2
- package/www/build/p-061e28d6.js.map +1 -0
- package/www/build/{p-4844c774.js → p-0b03b0e3.js} +2 -2
- package/www/build/p-1b972597.entry.js +2 -0
- package/www/build/{p-862989b6.entry.js.map → p-1b972597.entry.js.map} +1 -1
- package/www/build/{p-19103e70.entry.js → p-35d73edf.entry.js} +2 -2
- package/www/build/p-43adca09.entry.js +2 -0
- package/{dist/web-components-library/p-2d4cf6ff.entry.js.map → www/build/p-43adca09.entry.js.map} +1 -1
- package/{dist/web-components-library/p-47813782.entry.js → www/build/p-447a6391.entry.js} +2 -2
- package/www/build/p-4b38182a.js +2 -0
- package/www/build/p-8503c87a.entry.js +2 -0
- package/www/build/p-8503c87a.entry.js.map +1 -0
- package/www/build/{p-a8609510.entry.js → p-869295ce.entry.js} +2 -2
- package/www/build/{p-771dea79.entry.js → p-9814f864.entry.js} +2 -2
- package/{dist/web-components-library/p-c5d52872.entry.js → www/build/p-a3f9a5da.entry.js} +2 -2
- package/www/build/p-a8790237.entry.js +2 -0
- package/www/build/p-a8790237.entry.js.map +1 -0
- package/www/build/{p-613987cd.entry.js → p-accbc381.entry.js} +2 -2
- package/www/build/{p-613987cd.entry.js.map → p-accbc381.entry.js.map} +1 -1
- package/{dist/web-components-library/p-8a53fefb.entry.js → www/build/p-b0324c7d.entry.js} +2 -2
- package/www/build/{p-c12f93e4.entry.js → p-bd76ca35.entry.js} +2 -2
- package/www/build/p-c3e03e41.entry.js +2 -0
- package/www/build/p-c3e03e41.entry.js.map +1 -0
- package/www/build/{p-5905cca0.entry.js → p-ec1270db.entry.js} +2 -2
- package/{dist/web-components-library/p-55e5e53a.entry.js → www/build/p-f2c2ad04.entry.js} +2 -2
- package/www/build/p-f7e65eb0.entry.js +2 -0
- package/www/build/{p-26ed6c96.entry.js → p-fbce9614.entry.js} +2 -2
- 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/dist/cjs/utils-e8b453d5.js.map +0 -1
- package/dist/esm/utils-1b64bcd9.js.map +0 -1
- package/dist/web-components-library/p-1a0c206d.js.map +0 -1
- package/dist/web-components-library/p-2d4cf6ff.entry.js +0 -2
- package/dist/web-components-library/p-3ba7621b.entry.js +0 -2
- package/dist/web-components-library/p-58aeaf21.entry.js +0 -2
- package/dist/web-components-library/p-58aeaf21.entry.js.map +0 -1
- package/dist/web-components-library/p-5e2f6ab7.entry.js +0 -2
- package/dist/web-components-library/p-5e2f6ab7.entry.js.map +0 -1
- package/dist/web-components-library/p-862989b6.entry.js +0 -2
- package/dist/web-components-library/p-daa442e6.entry.js +0 -2
- package/dist/web-components-library/p-daa442e6.entry.js.map +0 -1
- package/www/build/p-156f9df4.js +0 -2
- package/www/build/p-1a0c206d.js.map +0 -1
- package/www/build/p-2d4cf6ff.entry.js +0 -2
- package/www/build/p-3ba7621b.entry.js +0 -2
- package/www/build/p-58aeaf21.entry.js +0 -2
- package/www/build/p-58aeaf21.entry.js.map +0 -1
- package/www/build/p-5e2f6ab7.entry.js +0 -2
- package/www/build/p-5e2f6ab7.entry.js.map +0 -1
- package/www/build/p-862989b6.entry.js +0 -2
- package/www/build/p-daa442e6.entry.js +0 -2
- package/www/build/p-daa442e6.entry.js.map +0 -1
- /package/dist/web-components-library/{p-4844c774.js.map → p-0b03b0e3.js.map} +0 -0
- /package/dist/web-components-library/{p-19103e70.entry.js.map → p-35d73edf.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-47813782.entry.js.map → p-447a6391.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-a8609510.entry.js.map → p-869295ce.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-771dea79.entry.js.map → p-9814f864.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-c5d52872.entry.js.map → p-a3f9a5da.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-8a53fefb.entry.js.map → p-b0324c7d.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-c12f93e4.entry.js.map → p-bd76ca35.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-5905cca0.entry.js.map → p-ec1270db.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-55e5e53a.entry.js.map → p-f2c2ad04.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-3ba7621b.entry.js.map → p-f7e65eb0.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-26ed6c96.entry.js.map → p-fbce9614.entry.js.map} +0 -0
- /package/www/build/{p-4844c774.js.map → p-0b03b0e3.js.map} +0 -0
- /package/www/build/{p-19103e70.entry.js.map → p-35d73edf.entry.js.map} +0 -0
- /package/www/build/{p-47813782.entry.js.map → p-447a6391.entry.js.map} +0 -0
- /package/www/build/{p-a8609510.entry.js.map → p-869295ce.entry.js.map} +0 -0
- /package/www/build/{p-771dea79.entry.js.map → p-9814f864.entry.js.map} +0 -0
- /package/www/build/{p-c5d52872.entry.js.map → p-a3f9a5da.entry.js.map} +0 -0
- /package/www/build/{p-8a53fefb.entry.js.map → p-b0324c7d.entry.js.map} +0 -0
- /package/www/build/{p-c12f93e4.entry.js.map → p-bd76ca35.entry.js.map} +0 -0
- /package/www/build/{p-5905cca0.entry.js.map → p-ec1270db.entry.js.map} +0 -0
- /package/www/build/{p-55e5e53a.entry.js.map → p-f2c2ad04.entry.js.map} +0 -0
- /package/www/build/{p-3ba7621b.entry.js.map → p-f7e65eb0.entry.js.map} +0 -0
- /package/www/build/{p-26ed6c96.entry.js.map → p-fbce9614.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g as t,p as r}from"./p-86618221.js";import{B as e}from"./p-5145a606.js";function n(t){switch(t){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 t}}function a(){return Math.random().toString(36).replace("0.","")}function s(r,e,...n){if(r.code===t.ENTER||r.code===t.SPACE){r.preventDefault();e(...n)}}function c(r,e,...n){if(r.code===t.ENTER){r.preventDefault();e(...n)}}function i(t=null){if(!t){t=document.activeElement}if(t&&t.shadowRoot&&t.shadowRoot.activeElement){t=t.shadowRoot.activeElement;return i(t)}return t}function o(t,r=[]){r.push(t);if(t.parentElement){t=t.parentElement;return o(t,r)}else if(t.parentNode&&t.parentNode.host){t=t.parentNode.host;return o(t,r)}return r}function u(){switch(true){case window.innerWidth<=e.MOBILE:return r.MOBILE;case window.innerWidth<=e.TABLET:return r.TABLET;case window.innerWidth<=e.DESKTOP:return r.DESKTOP;default:return r.DESKTOP_WIDE}}function f(t){try{return JSON.parse(t)}catch(t){return false}}function l(t){const r="avatar-C";const e=19;const n=Math.ceil(2**31-1)*parseFloat(`0.${t}`);let a=Math.ceil(e*(n%1));if(a===0){a=1}return`${r}${a.toString().padStart(2,"0")}`}function
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{g as t,p as r}from"./p-86618221.js";import{B as e}from"./p-5145a606.js";function n(t){switch(t){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 t}}function a(){return Math.random().toString(36).replace("0.","")}function s(r,e,...n){if(r.code===t.ENTER||r.code===t.SPACE){r.preventDefault();e(...n)}}function c(r,e,...n){if(r.code===t.ENTER){r.preventDefault();e(...n)}}function i(t=null){if(!t){t=document.activeElement}if(t&&t.shadowRoot&&t.shadowRoot.activeElement){t=t.shadowRoot.activeElement;return i(t)}return t}function o(t,r=[]){r.push(t);if(t.parentElement){t=t.parentElement;return o(t,r)}else if(t.parentNode&&t.parentNode.host){t=t.parentNode.host;return o(t,r)}return r}function u(){switch(true){case window.innerWidth<=e.MOBILE:return r.MOBILE;case window.innerWidth<=e.TABLET:return r.TABLET;case window.innerWidth<=e.DESKTOP:return r.DESKTOP;default:return r.DESKTOP_WIDE}}function f(t){try{return JSON.parse(t)}catch(t){return false}}function l(t){const r="avatar-C";const e=19;const n=Math.ceil(2**31-1)*parseFloat(`0.${t}`);let a=Math.ceil(e*(n%1));if(a===0){a=1}return`${r}${a.toString().padStart(2,"0")}`}function w(t,r){var e;if(t.contains(r)||((e=t.shadowRoot)===null||e===void 0?void 0:e.contains(r))){return true}const n=t=>{if(t===r){return true}const e=t.shadowRoot;if(!e){return Array.from(t.childNodes).some(n)}if(e.contains(r)){return true}const a=Array.from(e.querySelectorAll("slot")).some((t=>t.assignedNodes({flatten:true}).some((t=>{var e,a;return((a=(e=t).contains)===null||a===void 0?void 0:a.call(e,r))||n(t)}))));if(a){return true}return Array.from(e.children).some(n)||Array.from(t.childNodes).some(n)};return n(t)}function d(t){if(t.assignedSlot){return t.assignedSlot}if(t.parentNode instanceof ShadowRoot){return t.parentNode.host}return t.parentElement}function h(t,r){const e=t.getBoundingClientRect();const n=t.ownerDocument.documentElement.clientWidth;const a=t.ownerDocument.documentElement.clientHeight;const s=e.bottom>0&&e.top<a&&e.right>0&&e.left<n;if(r===t.ownerDocument.documentElement||r===t.ownerDocument.body){return s}const c=r.getBoundingClientRect();const i=e.bottom>c.top&&e.top<c.bottom&&e.right>c.left&&e.left<c.right;return i&&s}function p(t){let r=d(t);const e=window.getComputedStyle(t).position;while(r&&r!==t.ownerDocument.documentElement){const t=window.getComputedStyle(r);switch(e){case"fixed":{const e=["filter","transform","translate","perspective","scale","rotate","backdrop-filter"];if(e.some((r=>t.getPropertyValue(r)!=="none"))||e.some((r=>t.getPropertyValue("will-change").includes(r)))){return r}break}case"absolute":if(t.position!=="static"){return r}break;case"relative":case"sticky":case"static":{const t=window.getComputedStyle(r).display;if(t==="block"||t==="flex"||t==="grid"||t==="table"||t==="flow-root"||t==="inline-block"||t==="inline-flex"||t==="inline-grid"){return r}break}}r=d(r)}return t.ownerDocument.documentElement}const b=t=>{const r=(new DOMParser).parseFromString(t,"text/html");return r.body.textContent||""};export{w as a,n as b,l as c,s as d,b as e,o as f,u as g,c as h,i,f as j,d as k,p as l,h as m,a as r};
|
|
2
|
+
//# sourceMappingURL=p-061e28d6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["boolean","value","randomId","Math","random","toString","replace","handleKeyboardSubmit","ev","callback","args","code","KeyboardCode","ENTER","SPACE","preventDefault","handleEnterKeydSubmit","getClickedElement","elem","document","activeElement","shadowRoot","getElementTree","tree","push","parentElement","parentNode","host","getDevice","window","innerWidth","Breakpoints","MOBILE","Device","TABLET","DESKTOP","DESKTOP_WIDE","convertJson","data","JSON","parse","_a","colorFromId","id","prefix","colorsCount","seed","ceil","parseFloat","color","padStart","containsElement","ancestor","descendant","contains","checkRecursive","node","Array","from","childNodes","some","hasDescendantInAssignedNodes","querySelectorAll","slot","assignedNodes","flatten","assigned","_b","call","children","getParentElement","element","assignedSlot","ShadowRoot","isElementVisibleInContainer","container","elemRect","getBoundingClientRect","documentWidth","ownerDocument","documentElement","clientWidth","documentHeight","clientHeight","isVisibleInViewport","bottom","top","right","left","body","containerRect","isVisibleInContainer","findContainingBlockAncestor","parent","elementPosition","getComputedStyle","position","parentStyle","affectingProperties","property","getPropertyValue","includes","display","getPlainText","html","doc","DOMParser","parseFromString","textContent"],"sources":["src/utils/utils.ts"],"sourcesContent":["import {ChildNode} from \"@stencil/core\";\nimport {Device, KeyboardCode} from \"../beans/index\";\nimport {Breakpoints} from \"../constants/breakpoints\";\n\n/**\n * Return boolean value for passed value if a boolean corresponding value is found\n * Return passed value otherwise\n */\nexport function boolean(value: string | number | boolean): boolean | string | number {\n switch (value) {\n case true:\n case \"true\":\n case 1:\n case \"1\":\n case \"on\":\n case \"yes\":\n return true;\n case false:\n case \"false\":\n case 0:\n case \"0\":\n case \"off\":\n case \"no\":\n return false;\n default:\n return value;\n }\n}\n\nexport function retrieveAsset(assetName: string): string {\n return assetName && \"assets/images/png/\" + assetName;\n}\n\nexport function randomId(): string {\n return Math.random().toString(36).replace(\"0.\", \"\");\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function handleKeyboardSubmit(ev: KeyboardEvent, callback: (...args) => void, ...args: any[]): void {\n if (ev.code === KeyboardCode.ENTER || ev.code === KeyboardCode.SPACE) {\n ev.preventDefault();\n callback(...args);\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function handleEnterKeydSubmit(ev: KeyboardEvent, callback: (...args) => void, ...args: any[]): void {\n if (ev.code === KeyboardCode.ENTER) {\n ev.preventDefault();\n callback(...args);\n }\n}\n\nexport function getClickedElement(elem: null | Element = null): null | Element {\n if (!elem) {\n elem = document.activeElement;\n }\n\n if (elem && elem.shadowRoot && elem.shadowRoot.activeElement) {\n elem = elem.shadowRoot.activeElement;\n\n return getClickedElement(elem);\n }\n\n return elem;\n}\n\nexport function getElementTree(elem: Element, tree: Element[] = []): null | Element[] {\n tree.push(elem);\n\n if (elem.parentElement) {\n elem = elem.parentElement;\n\n return getElementTree(elem, tree);\n } else if (elem.parentNode && (elem.parentNode as ShadowRoot).host) {\n elem = (elem.parentNode as ShadowRoot).host;\n\n return getElementTree(elem, tree);\n }\n\n return tree;\n}\n\nexport function getSiblings(elem: HTMLElement): ChildNode[] {\n const siblings = [];\n if (!elem || !elem.parentNode || !elem.parentNode.childNodes) {\n return siblings;\n }\n\n elem.parentNode.childNodes.forEach((child) => {\n if (child.nodeType === 1 && child !== elem) {\n siblings.push(child);\n }\n });\n\n return siblings;\n}\n\n/**\n * Get the current device type based on the window width.\n * @returns {Device} - The current device type\n */\nexport function getDevice(): Device {\n switch (true) {\n case window.innerWidth <= Breakpoints.MOBILE:\n return Device.MOBILE;\n case window.innerWidth <= Breakpoints.TABLET:\n return Device.TABLET;\n case window.innerWidth <= Breakpoints.DESKTOP:\n return Device.DESKTOP;\n default:\n return Device.DESKTOP_WIDE;\n }\n}\n\ntype JSONValue = string | number | boolean | JSONObject | JSONArray;\ninterface JSONObject {\n [x: string]: JSONValue;\n}\ntype JSONArray = JSONValue[];\n\nexport function convertJson(data: string): JSONValue {\n try {\n return JSON.parse(data);\n } catch {\n return false;\n }\n}\n\nexport function colorFromId(id: number): string {\n const prefix = \"avatar-C\"; // prefix for color vars name\n const colorsCount = 19; // available colors\n const seed = Math.ceil(2 ** 31 - 1) * parseFloat(`0.${id}`);\n let color = Math.ceil(colorsCount * (seed % 1));\n\n // if result of mc is 0\n // es.: 3895229\n if (color === 0) {\n color = 1;\n }\n\n return `${prefix}${color.toString().padStart(2, \"0\")}`;\n}\n\n/**\n * Check if the passed CSS selector is valid.\n * @param selector CSS selector to validate\n */\nexport function isSelectorValid(selector: string): boolean {\n try {\n document.createDocumentFragment().querySelector(selector);\n\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Check if an element contains another element, checking both light and shadow DOM recursively.\n * This function also checks slot assignments, so it correctly handles nested slots across components.\n * @param ancestor Ancestor element\n * @param descendant Descendant element\n */\nexport function containsElement(ancestor: HTMLElement, descendant: Node): boolean {\n if (ancestor.contains(descendant) || ancestor.shadowRoot?.contains(descendant)) {\n return true;\n }\n\n const checkRecursive = (node: Node): boolean => {\n if (node === descendant) {\n return true;\n }\n\n const shadowRoot = (node as HTMLElement).shadowRoot;\n if (!shadowRoot) {\n // Check light DOM children only\n return Array.from(node.childNodes).some(checkRecursive);\n }\n\n if (shadowRoot.contains(descendant)) {\n return true;\n }\n\n // Check slot assigned nodes\n const hasDescendantInAssignedNodes = Array.from(shadowRoot.querySelectorAll(\"slot\")).some((slot) =>\n (slot as HTMLSlotElement)\n .assignedNodes({flatten: true})\n .some((assigned) => (assigned as HTMLElement).contains?.(descendant) || checkRecursive(assigned))\n );\n if (hasDescendantInAssignedNodes) {\n return true;\n }\n\n // Check shadow and light DOM children\n return Array.from(shadowRoot.children).some(checkRecursive) || Array.from(node.childNodes).some(checkRecursive);\n };\n\n return checkRecursive(ancestor);\n}\n\n/** Get the parent of passed element, accounting for shadow DOM.\n * @param element The element whose parent is to be found.\n */\nexport function getParentElement(element: Element): Element | null {\n // If the element is slotted, the direct rendered parent is the target slot in shadow DOM.\n if (element.assignedSlot) {\n return element.assignedSlot;\n }\n\n // If the element is in a shadow root, the parent is the shadow host.\n if (element.parentNode instanceof ShadowRoot) {\n return element.parentNode.host;\n }\n\n // Otherwise fall back to standard light DOM parent.\n return element.parentElement;\n}\n\n/**\n * Check if the `element` is visible within the `container` or in the viewport.\n * @param element The element to check.\n * @param container The container to check against, which must be the nearest scrollable ancestor.\n */\nexport function isElementVisibleInContainer(element: HTMLElement, container: HTMLElement): boolean {\n const elemRect = element.getBoundingClientRect();\n const documentWidth = element.ownerDocument.documentElement.clientWidth;\n const documentHeight = element.ownerDocument.documentElement.clientHeight;\n\n // Check if element is visible in viewport\n const isVisibleInViewport =\n elemRect.bottom > 0 && elemRect.top < documentHeight && elemRect.right > 0 && elemRect.left < documentWidth;\n\n // If container is the document element, only check viewport visibility\n if (container === element.ownerDocument.documentElement || container === element.ownerDocument.body) {\n return isVisibleInViewport;\n }\n\n // For other containers, check both container and viewport visibility\n const containerRect = container.getBoundingClientRect();\n const isVisibleInContainer =\n elemRect.bottom > containerRect.top &&\n elemRect.top < containerRect.bottom &&\n elemRect.right > containerRect.left &&\n elemRect.left < containerRect.right;\n\n return isVisibleInContainer && isVisibleInViewport;\n}\n\n/**\n * Find the nearest containing block ancestor of an element.\n * The containing block is determined based on the element's `position` value:\n * - `static`, `sticky` or `relative`: nearest block container or root\n * - `absolute`: nearest ancestor with `position` != `static`\n * - `fixed`: nearest ancestor with properties that create a containing block (`transform`, `filter`, `will-change`, `backdrop-filter`, `perspective`, etc.).\n * An ancestor with these properties will create a containing block for fixed positioned elements, making them behave like absolute positioned elements relative to that ancestor.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Display/Containing_block#identifying_the_containing_block\n * @param element The element for which to find the containing block\n * @returns The containing block element if any, or the `documentElement`\n */\nexport function findContainingBlockAncestor(element: HTMLElement): HTMLElement {\n let parent = getParentElement(element);\n const elementPosition = window.getComputedStyle(element).position;\n while (parent && parent !== element.ownerDocument.documentElement) {\n const parentStyle = window.getComputedStyle(parent);\n\n switch (elementPosition) {\n case \"fixed\": {\n const affectingProperties = [\n \"filter\",\n \"transform\",\n \"translate\",\n \"perspective\",\n \"scale\",\n \"rotate\",\n \"backdrop-filter\",\n ];\n if (\n affectingProperties.some((property) => parentStyle.getPropertyValue(property) !== \"none\") ||\n affectingProperties.some((property) => parentStyle.getPropertyValue(\"will-change\").includes(property))\n ) {\n return parent as HTMLElement;\n }\n break;\n }\n case \"absolute\":\n if (parentStyle.position !== \"static\") {\n return parent as HTMLElement;\n }\n break;\n // Handle position: static, relative, sticky (they all look for the nearest block container or root)\n case \"relative\":\n case \"sticky\":\n case \"static\": {\n const display = window.getComputedStyle(parent).display;\n\n // Block containers: block, flex, grid, table, flow-root\n if (\n display === \"block\" ||\n display === \"flex\" ||\n display === \"grid\" ||\n display === \"table\" ||\n display === \"flow-root\" ||\n display === \"inline-block\" ||\n display === \"inline-flex\" ||\n display === \"inline-grid\"\n ) {\n return parent as HTMLElement;\n }\n\n break;\n }\n }\n\n parent = getParentElement(parent);\n }\n\n return element.ownerDocument.documentElement;\n}\n\n/** Convert HTML to plain text */\nexport const getPlainText = (html: string): string => {\n const doc = new DOMParser().parseFromString(html, \"text/html\");\n\n return doc.body.textContent || \"\";\n};\n"],"mappings":"wFAQgBA,EAAQC,GACtB,OAAQA,GACN,KAAK,KACL,IAAK,OACL,KAAK,EACL,IAAK,IACL,IAAK,KACL,IAAK,MACH,OAAO,KACT,KAAK,MACL,IAAK,QACL,KAAK,EACL,IAAK,IACL,IAAK,MACL,IAAK,KACH,OAAO,MACT,QACE,OAAOA,EAEb,C,SAMgBC,IACd,OAAOC,KAAKC,SAASC,SAAS,IAAIC,QAAQ,KAAM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oreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as o,h as e,a as r,g as
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as o,h as e,a as r,g as n}from"./p-75c4a726.js";import{r as a}from"./p-061e28d6.js";import"./p-68d91a93.js";import"./p-8b367393.js";const s=":host{position:relative;display:grid;width:100%;box-sizing:border-box;grid-auto-flow:column;grid-template-columns:var(--z-table--expand-button-size, 0) repeat(var(--columns), minmax(128px, 1fr));--columns:1}*{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)}:host(:hover) ::slotted(z-td),:host(:hover) ::slotted(z-th){border-top:var(--border-size-small) solid var(--color-surface04);border-bottom:var(--border-size-small) solid var(--color-surface04);background-color:var(--color-surface02)}:host(:focus){position:relative;z-index:20;box-shadow:var(--shadow-focus-primary);outline:none}.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 z-icon{--z-icon-width:16px;--z-icon-height:16px}.z-tr--focus-overlay{position:absolute;z-index:30;right:0;left:0;width:100%;border-radius:4px;box-shadow:none;inset:0;outline:none;pointer-events:none;transition:box-shadow 0.2s}:host(:focus) .z-tr--focus-overlay{box-shadow:0 0 0 2px var(--shadow-focus-primary),\n var(--shadow-focus-primary);outline:none}:host(:focus) ::slotted(*){border-bottom:none}:host(:focus) .z-tr--expand-button-container{border-bottom:none}";const i=s;const d=class{constructor(e){t(this,e);this.expand=o(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 o=t.map((t=>t.colspan||1)).reduce(((t,o)=>t+o),0);this.host.style.setProperty("--columns",`${o}`);if(this.expandable){const o=t.pop();o.id=o.id||`z-tr-expandable-content-${a()}`;this.expandableContentId=o.id}}onRowClick(t){const o=t.target.closest(".prevent-expand");if(!this.expandable||o){return}this.expanded=!this.expanded;this.expand.emit({expanded:this.expanded})}onKeyDown(t){if(!this.expandable){return}const o=document.activeElement;if(o!==this.host){return}if(t.key==="Enter"||t.key===" "){t.preventDefault();this.expanded=!this.expanded;this.expand.emit({expanded:this.expanded})}}componentWillLoad(){this.updateColumns()}render(){return e(r,{key:"c1edcb26241c7528d544f61ab75d2920b545e62d",role:"row",tabIndex:0,expanded:this.expanded,onClick:this.onRowClick.bind(this),onKeyDown:this.onKeyDown.bind(this)},e("div",{key:"8bb2db80cfdd9dd4065466a97381dfacd4ef5395",class:"z-tr--focus-overlay","aria-hidden":"true"}),e("div",{key:"1ab915207f73524dc1dbffe3d79190ee4c177c62",class:"z-tr--expand-button-container"},this.expandable&&e("button",{key:"419b53264646264a73687faa3ee007531e0c3ac9",tabIndex:-1,"aria-expanded":this.expanded?"true":"false","aria-label":this.expanded?"Comprimi riga":"Espandi riga","aria-controls":this.expandableContentId,type:"button"},e("z-icon",{key:"048a03b706c82e5dfb2f55001b24864bf5bad97c",name:this.expanded?"minus-circled":"plus-circled"}))),e("slot",{key:"c44fd9d9808651d63d9eb5f25fe8a0c31faadfe8",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-0b03b0e3.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as o,h as e,a as s,g as r}from"./p-75c4a726.js";import{P as i,g as n,p as a}from"./p-86618221.js";import{a as h,k as c,l as f,g as p,m as l}from"./p-061e28d6.js";import"./p-5145a606.js";const u=':host{position:fixed;display:none;max-width:calc(100dvw - var(--grid-margin) * 2);max-height:calc(100dvh - var(--grid-margin) * 2);padding:var(--z-popover-padding, 0);background:var(--z-popover-theme--surface, var(--color-surface01));border-radius:var(--border-radius-small);color:var(--z-popover-theme--text, var(--color-default-text));fill:currentcolor;filter:var(--z-popover-shadow-filter, drop-shadow(0 1px 2px var(--shadow-color-base)));text-align:center;visibility:hidden;}:host([open]:not([open="false"])[current-position]){display:block}:host([center][current-position="top"]),:host([center][current-position="bottom"]){transform:translateX(-50%)}:host([center][current-position="right"]),:host([center][current-position="left"]){transform:translateY(-50%)}:host([current-position^="top"]){margin:0 0 var(--space-unit)}:host([current-position^="bottom"]){margin:var(--space-unit) 0 0}:host([current-position^="left"]){margin:0 var(--space-unit) 0 0}:host([current-position^="right"]){margin:0 0 0 var(--space-unit)}:host([current-position])::before{--arrow-size:6px;--arrow-edge-offset:calc(100% - var(--space-unit) - (var(--arrow-size) / 2));--arrow-center-x-offset:calc(50% - (var(--arrow-size) / 2));--arrow-center-y-offset:calc(100% - (var(--arrow-size) / 2));position:absolute;display:block;width:var(--arrow-size);height:var(--arrow-size);background:var(--z-popover-theme--surface, var(--color-surface01));content:"";transform:rotate(45deg)}:host([show-arrow="false"])::before,:host(:not([show-arrow]))::before{display:none}:host([current-position^="top"])::before{top:var(--arrow-center-y-offset)}:host([current-position^="bottom"])::before{bottom:var(--arrow-center-y-offset)}:host([current-position="top"])::before,:host([current-position="bottom"])::before{right:var(--arrow-edge-offset)}:host([current-position="right"])::before,:host([current-position="left"])::before{bottom:var(--arrow-edge-offset)}:host([current-position="right"])::before{right:var(--arrow-center-y-offset)}:host([current-position="left"])::before{left:var(--arrow-center-y-offset)}:host([current-position="top_right"])::before,:host([current-position="bottom_right"])::before{right:var(--arrow-edge-offset)}:host([current-position="top_left"])::before,:host([current-position="bottom_left"])::before{left:var(--arrow-edge-offset)}:host([current-position="right_top"])::before,:host([current-position="left_top"])::before{top:var(--arrow-edge-offset)}:host([current-position="right_top"])::before,:host([current-position="right_bottom"])::before{right:var(--arrow-center-y-offset)}:host([current-position="left_top"])::before,:host([current-position="left_bottom"])::before{left:var(--arrow-center-y-offset)}:host([current-position="right_bottom"])::before,:host([current-position="left_bottom"])::before{bottom:var(--arrow-edge-offset)}:host([center][current-position="top"])::before,:host([center][current-position="bottom"])::before{right:auto;left:var(--arrow-center-x-offset)}:host([center][current-position="right"])::before,:host([center][current-position="left"])::before{top:var(--arrow-center-x-offset);bottom:auto}';const b=u;const d=class{constructor(e){t(this,e);this.positionChange=o(this,"positionChange",7);this.openChange=o(this,"openChange",7);this.spaceTolerance=3;this.position=i.TOP;this.open=false;this.bindTo=undefined;this.showArrow=false;this.center=false;this.closable=true;this.currentPosition=undefined}closePopoverWithKeyboard(t){if(this.closable&&t.key===n.ESC){t.stopPropagation();this.open=false}}handleOutsideClick(t){const o=t.target;if(!this.closable||!this.open||h(this.host,o)){return}if(h(this.boundElement,o)){t.stopPropagation()}this.open=false}validatePosition(t){if(!Object.values(i).includes(t)||t===i.AUTO){t=i.TOP;this.position=t}this.currentPosition=t;if(this.open){this.setPosition()}}onOpen(){cancelAnimationFrame(this.animationFrameRequestId);this.openChange.emit({open:this.open});if(!this.open){Object.assign(this.host.style,{top:"auto",right:"auto",bottom:"auto",left:"auto",maxWidth:"",maxHeight:"",visibility:"hidden"});this.currentPosition=undefined;return}const t=()=>{if(!this.open){return}this.setPosition();this.animationFrameRequestId=requestAnimationFrame(t)};setTimeout((()=>{t()}),0)}onBindingChange(){this.findBoundElement()}get offsetModifier(){return this.center?.5:0}findBoundElement(){if(typeof this.bindTo==="string"){this.boundElement=this.host.ownerDocument.querySelector(this.bindTo)}else if(this.bindTo){this.boundElement=this.bindTo}else{this.boundElement=c(this.host);if(this.boundElement.tagName.toLowerCase()==="z-tooltip"){this.boundElement=c(this.boundElement)}}}hasCenteredHorizontalSpace(t,o,e,s){const r=(e-s)*(1-this.offsetModifier);if(!this.center){return o>=r-this.spaceTolerance}return o>=r-this.spaceTolerance&&t>=r-this.spaceTolerance}hasCenteredVerticalSpace(t,o,e,s){const r=(e-s)*(1-this.offsetModifier);if(!this.center){return o>=r-this.spaceTolerance}return t>=r-this.spaceTolerance&&o>=r-this.spaceTolerance}hasEnoughSideSpace(t,o,e,s){return t>=o-e*(1-s)-this.spaceTolerance}getOptimalPopoverPosition(t,o){const e=this.host.offsetWidth;const s=this.host.offsetHeight;const r=this.boundElement.getBoundingClientRect().width;const n=this.boundElement.getBoundingClientRect().height;const a=this.offsetModifier;const h=t=>{switch(t){case i.TOP:return o.top>=s-this.spaceTolerance&&this.hasCenteredHorizontalSpace(o.left,o.right,e,r);case i.TOP_RIGHT:return o.top>=s&&this.hasEnoughSideSpace(o.right,e,r,a);case i.TOP_LEFT:return o.top>=s&&this.hasEnoughSideSpace(o.left,e,r,a);case i.RIGHT:return o.right>=e&&this.hasCenteredVerticalSpace(o.top,o.bottom,s,n);case i.RIGHT_BOTTOM:return o.right>=e&&this.hasEnoughSideSpace(o.bottom,s,n,a);case i.RIGHT_TOP:return o.right>=e&&this.hasEnoughSideSpace(o.top,s,n,a);case i.BOTTOM:return o.bottom>=s&&this.hasCenteredHorizontalSpace(o.left,o.right,e,r);case i.BOTTOM_LEFT:return o.bottom>=s&&this.hasEnoughSideSpace(o.left,e,r,a);case i.BOTTOM_RIGHT:return o.bottom>=s&&this.hasEnoughSideSpace(o.right,e,r,a);case i.LEFT:return o.left>=e&&this.hasCenteredVerticalSpace(o.top,o.bottom,s,n);case i.LEFT_TOP:return o.left>=e&&this.hasEnoughSideSpace(o.top,s,n,a);case i.LEFT_BOTTOM:return o.left>=e&&this.hasEnoughSideSpace(o.bottom,s,n,a);default:return false}};if(h(t)){return t}const c=d.positionOrder;const f=c.indexOf(t);if(f===-1){return t}for(let t=1;t<c.length;t++){const o=(f+t)%c.length;const e=c[o];if(h(e)){return e}}return this.findBestFallbackPosition(o)}findBestFallbackPosition(t){const o=t.right>=t.left?i.RIGHT:i.LEFT;const e=t.bottom>=t.top?i.BOTTOM:i.TOP;const s=Math.max(t.right,t.left);const r=Math.max(t.bottom,t.top);const n=r>=s?e:o;let a=false;if(n===e){const o=Math.min(t.right,t.left);a=s>=o*2}else{const o=Math.min(t.bottom,t.top);a=r>=o*2}if(!a){return n}const h=n===e?o:e;return`${n}_${h}`}findScrollableAncestor(t){let o=c(t);while(o){if(o===t.ownerDocument.documentElement){return o}const e=getComputedStyle(o);const{overflow:s,overflowX:r,overflowY:i}=e;const n=s==="hidden"||i==="hidden"||r==="hidden";const a=o.scrollHeight>o.clientHeight&&s!=="visible"&&i!=="visible"||o.scrollWidth>o.clientWidth&&s!=="visible"&&r!=="visible";if(!n&&a){return o}o=c(o)}return t.ownerDocument.documentElement}calculateAvailableSpace(){const t=this.boundElement.getBoundingClientRect();if(this.lastBoundRect&&this.lastBoundRect.x===t.x&&this.lastBoundRect.y===t.y&&this.lastBoundRect.width===t.width&&this.lastBoundRect.height===t.height&&this.cachedAvailableSpace){return this.cachedAvailableSpace}this.lastBoundRect=t;const o=this.findScrollableAncestor(this.boundElement);const e=o.getBoundingClientRect();const s=o!==this.boundElement.ownerDocument.documentElement;const r=this.boundElement.ownerDocument.documentElement.clientWidth;const i=this.boundElement.ownerDocument.documentElement.clientHeight;const n=8;const a=s?e.top:0;const h=s?r-e.right:0;const c=s?i-e.bottom:0;const f=s?e.left:0;this.cachedAvailableSpace={top:t.top-a-n,right:r-t.right-h-n,bottom:i-t.bottom-c-n,left:t.left-f-n};return this.cachedAvailableSpace}getBoundElementOffsets(){const t=this.boundElement.getBoundingClientRect();const o=this.boundElement.ownerDocument.documentElement.clientWidth;const e=this.boundElement.ownerDocument.documentElement.clientHeight;return{top:t.top,right:o-t.right,bottom:e-t.bottom,left:t.left}}computePositionOffsets(){const t=this.getBoundElementOffsets();const o=f(this.host);const e=o===this.host.ownerDocument.documentElement;if(e){return t}const s=o.getBoundingClientRect();const r=getComputedStyle(o);const i={top:s.top+parseFloat(r.borderTopWidth),right:s.right-parseFloat(r.borderRightWidth),bottom:s.bottom-parseFloat(r.borderBottomWidth),left:s.left+parseFloat(r.borderLeftWidth)};const n=this.boundElement.getBoundingClientRect();const a={top:n.top-i.top,right:i.right-n.right,bottom:i.bottom-n.bottom,left:n.left-i.left};return{top:a.top+o.scrollTop,right:a.right-o.scrollLeft,bottom:a.bottom-o.scrollTop,left:a.left+o.scrollLeft}}applyPositionStyles(t,o){const e=this.boundElement.offsetWidth;const s=this.boundElement.offsetHeight;const r=this.offsetModifier;const n=this.showArrow&&this.center?8:0;const h=this.host.style;const c=parseFloat(getComputedStyle(this.host).marginTop.replace("px",""))||0;const f=this.computePositionOffsets();const l=f.left+e*r;const u=f.right+e*r;const b=f.top+s;const d=f.bottom+s;const g=f.top+s*r;const m=f.bottom+s*r;let v;let w;switch(t){case i.TOP:case i.TOP_RIGHT:h.bottom=`${d}px`;h.left=`${l-(t===i.TOP_RIGHT?n:0)}px`;w=o.top-c;if(t===i.TOP_RIGHT){v=o.right+e*r}break;case i.TOP_LEFT:h.right=`${u-n}px`;h.bottom=`${d}px`;v=o.left+e*r;w=o.top-c;break;case i.BOTTOM:case i.BOTTOM_RIGHT:h.top=`${b}px`;h.left=`${l-(t===i.BOTTOM_RIGHT?n:0)}px`;w=o.bottom-c;if(t===i.BOTTOM_RIGHT){v=o.right+e*r}break;case i.BOTTOM_LEFT:h.top=`${b}px`;h.right=`${u-n}px`;v=o.left+e*r;w=o.bottom-c;break;case i.RIGHT:case i.RIGHT_BOTTOM:h.top=`${g-(t===i.RIGHT_BOTTOM?n:0)}px`;h.left=`${f.left+e}px`;v=o.right-c;if(t===i.RIGHT){w=o.top+o.bottom+s}else{w=o.bottom+s*r}break;case i.RIGHT_TOP:h.bottom=`${m-n}px`;h.left=`${f.left+e}px`;v=o.right-c;w=o.top+s*r;break;case i.LEFT:case i.LEFT_BOTTOM:h.top=`${g-(t===i.LEFT_BOTTOM?n:0)}px`;h.right=`${f.right+e}px`;v=o.left-c;if(t===i.LEFT_BOTTOM){w=o.bottom+s*r}break;case i.LEFT_TOP:h.right=`${f.right+e}px`;h.bottom=`${m-n}px`;v=o.left-c;w=o.top+s*r;break}if(p()!==a.MOBILE){Object.assign(h,{maxWidth:v?`${v}px`:"",maxHeight:w?`${w}px`:""})}}setPosition(){if(!this.boundElement){return}if(!l(this.boundElement,this.findScrollableAncestor(this.boundElement))){this.open=false;return}Object.assign(this.host.style,{top:"auto",right:"auto",bottom:"auto",left:"auto",maxWidth:"",maxHeight:"",visibility:"hidden"});const t=this.calculateAvailableSpace();const o=this.getOptimalPopoverPosition(this.position,t);this.applyPositionStyles(o,t);this.currentPosition=o;this.positionChange.emit({position:this.currentPosition});this.host.style.visibility="visible"}componentWillLoad(){this.validatePosition(this.position)}componentDidLoad(){this.findBoundElement();if(this.open){this.onOpen()}}disconnectedCallback(){cancelAnimationFrame(this.animationFrameRequestId)}render(){return e(s,{key:"c3483157f2664088a337118936d81f551dcf25b1","current-position":this.currentPosition},e("slot",{key:"fc9856b30959fc041dbf295fe7bbf523ce6adaf6"}))}get host(){return r(this)}static get watchers(){return{position:["validatePosition"],open:["onOpen"],bindTo:["onBindingChange"]}}};d.positionOrder=[i.TOP,i.TOP_RIGHT,i.TOP_LEFT,i.RIGHT,i.RIGHT_BOTTOM,i.RIGHT_TOP,i.BOTTOM,i.BOTTOM_LEFT,i.BOTTOM_RIGHT,i.LEFT,i.LEFT_TOP,i.LEFT_BOTTOM];d.style=b;export{d as z_popover};
|
|
2
|
+
//# sourceMappingURL=p-1b972597.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["stylesCss","ZPopoverStyle0","ZPopover","this","spaceTolerance","PopoverPosition","TOP","closePopoverWithKeyboard","e","closable","key","KeyboardCode","ESC","stopPropagation","open","handleOutsideClick","target","containsElement","host","boundElement","validatePosition","newValue","Object","values","includes","AUTO","position","currentPosition","setPosition","onOpen","cancelAnimationFrame","animationFrameRequestId","openChange","emit","assign","style","top","right","bottom","left","maxWidth","maxHeight","visibility","undefined","updatePositionLoop","requestAnimationFrame","setTimeout","onBindingChange","findBoundElement","offsetModifier","center","bindTo","ownerDocument","querySelector","getParentElement","tagName","toLowerCase","hasCenteredHorizontalSpace","availableLeft","availableRight","hostWidth","boundElementWidth","requiredSideSpace","hasCenteredVerticalSpace","availableTop","availableBottom","hostHeight","boundElementHeight","hasEnoughSideSpace","availableSpace","hostSize","boundElementSize","getOptimalPopoverPosition","desiredPosition","offsetWidth","offsetHeight","getBoundingClientRect","width","height","fits","pos","TOP_RIGHT","TOP_LEFT","RIGHT","RIGHT_BOTTOM","RIGHT_TOP","BOTTOM","BOTTOM_LEFT","BOTTOM_RIGHT","LEFT","LEFT_TOP","LEFT_BOTTOM","positions","positionOrder","startIndex","indexOf","i","length","posIndex","findBestFallbackPosition","bestHorizontalDirection","bestVerticalDirection","maxHorizontalSpace","Math","max","maxVerticalSpace","mainDirection","needsSecondaryDirection","minHorizontalSpace","min","minVerticalSpace","secondaryDirection","findScrollableAncestor","element","parent","documentElement","getComputedStyle","overflow","overflowX","overflowY","hasHiddenOverflow","isScrollable","scrollHeight","clientHeight","scrollWidth","clientWidth","calculateAvailableSpace","boundElementRect","lastBoundRect","x","y","cachedAvailableSpace","scrollableAncestor","scrollableAncestorRect","isScrollableAncestorNested","documentWidth","documentHeight","safeSpace","deltaTop","deltaRight","deltaBottom","deltaLeft","getBoundElementOffsets","elementRect","computePositionOffsets","boundElementOffsets","containingBlockAncestor","findContainingBlockAncestor","isDocumentElement","containingBlockRect","containingBlockStyle","paddingBox","parseFloat","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","relativeOffsets","scrollTop","scrollLeft","applyPositionStyles","arrowModifier","showArrow","hostStyle","distanceFromBound","marginTop","replace","positionOffsets","leftBase","rightBase","topBase","bottomBase","sideTopBase","sideBottomBase","getDevice","Device","MOBILE","isElementVisibleInContainer","positionChange","componentWillLoad","componentDidLoad","disconnectedCallback","render","h","Host"],"sources":["src/components/z-popover/styles.css?tag=z-popover&encapsulation=shadow","src/components/z-popover/index.tsx"],"sourcesContent":[":host {\n --z-popover-theme--surface: ;\n --z-popover-theme--text: ;\n --z-popover-padding: ;\n --z-popover-shadow-filter: ;\n\n position: fixed;\n display: none;\n max-width: calc(100dvw - var(--grid-margin) * 2);\n max-height: calc(100dvh - var(--grid-margin) * 2);\n padding: var(--z-popover-padding, 0);\n background: var(--z-popover-theme--surface, var(--color-surface01));\n border-radius: var(--border-radius-small);\n color: var(--z-popover-theme--text, var(--color-default-text));\n fill: currentcolor;\n filter: var(--z-popover-shadow-filter, drop-shadow(0 1px 2px var(--shadow-color-base)));\n text-align: center;\n visibility: hidden; /* hidden by default. the positioning algorithm will set it to 'visible' when needed */\n}\n\n:host([open]:not([open=\"false\"])[current-position]) {\n display: block;\n}\n\n:host([center][current-position=\"top\"]),\n:host([center][current-position=\"bottom\"]) {\n transform: translateX(-50%);\n}\n\n:host([center][current-position=\"right\"]),\n:host([center][current-position=\"left\"]) {\n transform: translateY(-50%);\n}\n\n:host([current-position^=\"top\"]) {\n margin: 0 0 var(--space-unit);\n}\n\n:host([current-position^=\"bottom\"]) {\n margin: var(--space-unit) 0 0;\n}\n\n:host([current-position^=\"left\"]) {\n margin: 0 var(--space-unit) 0 0;\n}\n\n:host([current-position^=\"right\"]) {\n margin: 0 0 0 var(--space-unit);\n}\n\n/* Arrow style */\n:host([current-position])::before {\n --arrow-size: 6px;\n --arrow-edge-offset: calc(100% - var(--space-unit) - (var(--arrow-size) / 2));\n --arrow-center-x-offset: calc(50% - (var(--arrow-size) / 2));\n --arrow-center-y-offset: calc(100% - (var(--arrow-size) / 2));\n\n position: absolute;\n display: block;\n width: var(--arrow-size);\n height: var(--arrow-size);\n background: var(--z-popover-theme--surface, var(--color-surface01));\n content: \"\";\n transform: rotate(45deg);\n}\n\n:host([show-arrow=\"false\"])::before,\n:host(:not([show-arrow]))::before {\n display: none;\n}\n\n:host([current-position^=\"top\"])::before {\n top: var(--arrow-center-y-offset);\n}\n\n:host([current-position^=\"bottom\"])::before {\n bottom: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"top\"])::before,\n:host([current-position=\"bottom\"])::before {\n right: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right\"])::before,\n:host([current-position=\"left\"])::before {\n bottom: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right\"])::before {\n right: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"left\"])::before {\n left: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"top_right\"])::before,\n:host([current-position=\"bottom_right\"])::before {\n right: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"top_left\"])::before,\n:host([current-position=\"bottom_left\"])::before {\n left: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right_top\"])::before,\n:host([current-position=\"left_top\"])::before {\n top: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right_top\"])::before,\n:host([current-position=\"right_bottom\"])::before {\n right: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"left_top\"])::before,\n:host([current-position=\"left_bottom\"])::before {\n left: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"right_bottom\"])::before,\n:host([current-position=\"left_bottom\"])::before {\n bottom: var(--arrow-edge-offset);\n}\n\n:host([center][current-position=\"top\"])::before,\n:host([center][current-position=\"bottom\"])::before {\n right: auto;\n left: var(--arrow-center-x-offset);\n}\n\n:host([center][current-position=\"right\"])::before,\n:host([center][current-position=\"left\"])::before {\n top: var(--arrow-center-x-offset);\n bottom: auto;\n}\n","import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {Device, KeyboardCode, PopoverPosition} from \"../../beans\";\nimport {\n containsElement,\n findContainingBlockAncestor,\n getDevice,\n getParentElement,\n isElementVisibleInContainer,\n} from \"../../utils/utils\";\n\n/** Centering offset modifier. 0 for no offset, 0.5 for centering. */\ntype OffsetModifier = 0 | 0.5;\ntype Offsets = {top: number; right: number; bottom: number; left: number};\n\n/**\n * Popover component.\n * This component displays a popover bound to an element.\n * It supports various positions and can automatically adjust it based on available space, accounting for scrollable containers.\n *\n * Notes:\n * - If positioning has an odd behavior, consider manually adjusting the size of the slotted elements (using `width`, `height`, `max-width`, `max-height`, etc...) when its content is \"fluid\" (like text), because it can interfere with the position calculation (for example a long text on one single line can be bigger than the available space, letting the algorithm think the popover doesn't fits).\n *\n * @cssprop --z-popover-theme--surface - background color of the popover.\n * @cssprop --z-popover-theme--text - foreground color of the popover.\n * @cssprop --z-popover-padding - padding of the popover.\n * @cssprop --z-popover-shadow-filter - drop-shadow filter of the popover. Defaults to `drop-shadow(0 1px 2px var(--shadow-color-base))`.\n */\n@Component({\n tag: \"z-popover\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZPopover {\n /**\n * The preferred position to render the popover.\n * The popover will automatically search another position if not enough space is available for the preferred position.\n * If the preferred position is not available, it will try to find the best position starting from `TOP` and going clockwise.\n */\n @Prop({reflect: true, mutable: true})\n position?: PopoverPosition = PopoverPosition.TOP;\n\n /**\n * The initial open state of the popover.\n * Internal changes of this prop are emitted through the `openChange` event.\n * Make sure to listen to that event if you need the updated state of the popover from the outside, to avoid inconsistent values.\n */\n @Prop({reflect: true, mutable: true})\n open = false;\n\n /**\n * The selector or the element bound with the popover.\n * If string css selector is provided make sure to use a valid selector.\n */\n @Prop()\n bindTo?: string | HTMLElement;\n\n /** Whether to show popover's arrow. */\n @Prop({reflect: true})\n showArrow = false;\n\n /** Whether to center the popup on the main side (according to \"position\"). */\n @Prop({reflect: true})\n center = false;\n\n /**\n * Whether the popover can be closed by clicking outside of it or pressing the escape key.\n * Otherwise, it will be closed only programmatically (by setting `open` to `false`).\n * Default: `true`.\n */\n @Prop()\n closable = true;\n\n /**\n * The current position of the popover.\n * It differs from `position` only when calculated automatically for space reasons.\n */\n @State()\n currentPosition?: PopoverPosition;\n\n @Element() host: HTMLZPopoverElement;\n\n // Clockwise order of positions.\n private static readonly positionOrder: PopoverPosition[] = [\n PopoverPosition.TOP,\n PopoverPosition.TOP_RIGHT,\n PopoverPosition.TOP_LEFT,\n PopoverPosition.RIGHT,\n PopoverPosition.RIGHT_BOTTOM,\n PopoverPosition.RIGHT_TOP,\n PopoverPosition.BOTTOM,\n PopoverPosition.BOTTOM_LEFT,\n PopoverPosition.BOTTOM_RIGHT,\n PopoverPosition.LEFT,\n PopoverPosition.LEFT_TOP,\n PopoverPosition.LEFT_BOTTOM,\n ] as const;\n\n private animationFrameRequestId?: number;\n\n /** space tolerance for space calculations */\n private readonly spaceTolerance = 3;\n\n /** The element bound to the popover. */\n private boundElement?: HTMLElement;\n\n /** Cached available space around the bound element to avoid unnecessary recalculations */\n private cachedAvailableSpace?: Offsets;\n\n /** Last bounding rect of the bound element to detect changes and eventually invalidate the caches. */\n private lastBoundRect?: DOMRect;\n\n /** Fired when the position changes. */\n @Event()\n positionChange: EventEmitter<{position: PopoverPosition}>;\n\n /** Event emitted when the open state of the popover changes (e.g. when the user clicks outside the popover to close it, if `closable` is true). */\n @Event()\n openChange: EventEmitter<{open: boolean}>;\n\n @Listen(\"keyup\", {target: \"window\", capture: true})\n closePopoverWithKeyboard(e: KeyboardEvent): void {\n if (this.closable && e.key === KeyboardCode.ESC) {\n e.stopPropagation();\n this.open = false;\n }\n }\n\n /**\n * Close the popover when clicking outside of its content.\n * Stop event propagation if the click was fired by popover's trigger element,\n * to prevent close and reopen glitches.\n */\n @Listen(\"click\", {target: \"body\", capture: true})\n handleOutsideClick(e: MouseEvent): void {\n const target = e.target as Element;\n if (!this.closable || !this.open || containsElement(this.host, target)) {\n return;\n }\n\n if (containsElement(this.boundElement, target)) {\n // stop propagation if the click was on the trigger element to prevent close and reopen glitches\n e.stopPropagation();\n }\n this.open = false;\n }\n\n @Watch(\"position\")\n validatePosition(newValue: PopoverPosition): void {\n if (!Object.values(PopoverPosition).includes(newValue as PopoverPosition) || newValue === PopoverPosition.AUTO) {\n newValue = PopoverPosition.TOP;\n this.position = newValue;\n }\n this.currentPosition = newValue;\n if (this.open) {\n this.setPosition();\n }\n }\n\n /** Setup popover behaviors when `open` changes. */\n @Watch(\"open\")\n onOpen(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n this.openChange.emit({open: this.open});\n if (!this.open) {\n Object.assign(this.host.style, {\n // Reset all positioning properties\n top: \"auto\",\n right: \"auto\",\n bottom: \"auto\",\n left: \"auto\",\n maxWidth: \"\",\n maxHeight: \"\",\n // Set initial visibility to hidden while calculating position...\n visibility: \"hidden\",\n });\n this.currentPosition = undefined;\n\n return;\n }\n\n const updatePositionLoop = (): void => {\n if (!this.open) {\n return;\n }\n\n this.setPosition();\n this.animationFrameRequestId = requestAnimationFrame(updatePositionLoop);\n };\n\n // call `setPosition` after a tick to ensure the DOM is ready and sizes are available\n setTimeout(() => {\n updatePositionLoop();\n }, 0);\n }\n\n @Watch(\"bindTo\")\n onBindingChange(): void {\n this.findBoundElement();\n }\n\n /** Returns the offset modifier to use in calculations to align the popover with the bound element. */\n private get offsetModifier(): OffsetModifier {\n return this.center ? 0.5 : 0;\n }\n\n private findBoundElement(): void {\n if (typeof this.bindTo === \"string\") {\n this.boundElement = this.host.ownerDocument.querySelector(this.bindTo) as HTMLElement;\n } else if (this.bindTo) {\n this.boundElement = this.bindTo;\n } else {\n this.boundElement = getParentElement(this.host) as HTMLElement;\n if (this.boundElement.tagName.toLowerCase() === \"z-tooltip\") {\n // If the popover is used inside a tooltip without a specified `bindTo`, bind it to the parent of the tooltip.\n this.boundElement = getParentElement(this.boundElement) as HTMLElement;\n }\n }\n }\n\n /**\n * Check if element has enough space to the right and left to be centered.\n * Used for `TOP` and `BOTTOM` position.\n * When `center` is not enabled, only one side needs to be checked and `RIGHT` is the default.\n */\n private hasCenteredHorizontalSpace(\n availableLeft: number,\n availableRight: number,\n hostWidth: number,\n boundElementWidth: number\n ): boolean {\n const requiredSideSpace = (hostWidth - boundElementWidth) * (1 - this.offsetModifier);\n\n if (!this.center) {\n return availableRight >= requiredSideSpace - this.spaceTolerance;\n }\n\n return (\n availableRight >= requiredSideSpace - this.spaceTolerance &&\n availableLeft >= requiredSideSpace - this.spaceTolerance\n );\n }\n\n /**\n * Check if element has enough space to the top and bottom to be centered.\n * Used for `RIGHT` and `LEFT` position.\n * When `center` is not enabled, only one side needs to be checked and `BOTTOM` is the default.\n */\n private hasCenteredVerticalSpace(\n availableTop: number,\n availableBottom: number,\n hostHeight: number,\n boundElementHeight: number\n ): boolean {\n const requiredSideSpace = (hostHeight - boundElementHeight) * (1 - this.offsetModifier);\n\n if (!this.center) {\n return availableBottom >= requiredSideSpace - this.spaceTolerance;\n }\n\n return (\n availableTop >= requiredSideSpace - this.spaceTolerance &&\n availableBottom >= requiredSideSpace - this.spaceTolerance\n );\n }\n\n /**\n * Check if there is enough space in the given direction to fit the popover.\n * Used for composed positions like TOP_RIGHT, LEFT_BOTTOM, etc.\n */\n private hasEnoughSideSpace(\n availableSpace: number,\n hostSize: number,\n boundElementSize: number,\n offsetModifier: OffsetModifier\n ): boolean {\n return availableSpace >= hostSize - boundElementSize * (1 - offsetModifier) - this.spaceTolerance;\n }\n\n /**\n * Given a desired position and available space around the bound element, returns the best position\n * that fits the popover, trying all positions if needed.\n * Takes into account offsetModifier for centering.\n * @param desiredPosition The desired position of the popover.\n * @param availableSpace The available space around the bound element.\n */\n private getOptimalPopoverPosition(desiredPosition: PopoverPosition, availableSpace: Offsets): PopoverPosition {\n const hostWidth = this.host.offsetWidth;\n const hostHeight = this.host.offsetHeight;\n const boundElementWidth = this.boundElement.getBoundingClientRect().width;\n const boundElementHeight = this.boundElement.getBoundingClientRect().height;\n const offsetModifier = this.offsetModifier;\n\n /** Check if there is enough space to fit the popover in the desired position */\n const fits = (pos: PopoverPosition): boolean => {\n switch (pos) {\n case PopoverPosition.TOP:\n return (\n availableSpace.top >= hostHeight - this.spaceTolerance &&\n this.hasCenteredHorizontalSpace(availableSpace.left, availableSpace.right, hostWidth, boundElementWidth)\n );\n case PopoverPosition.TOP_RIGHT:\n return (\n availableSpace.top >= hostHeight &&\n this.hasEnoughSideSpace(availableSpace.right, hostWidth, boundElementWidth, offsetModifier)\n );\n case PopoverPosition.TOP_LEFT:\n return (\n availableSpace.top >= hostHeight &&\n this.hasEnoughSideSpace(availableSpace.left, hostWidth, boundElementWidth, offsetModifier)\n );\n case PopoverPosition.RIGHT:\n return (\n availableSpace.right >= hostWidth &&\n this.hasCenteredVerticalSpace(availableSpace.top, availableSpace.bottom, hostHeight, boundElementHeight)\n );\n case PopoverPosition.RIGHT_BOTTOM:\n return (\n availableSpace.right >= hostWidth &&\n this.hasEnoughSideSpace(availableSpace.bottom, hostHeight, boundElementHeight, offsetModifier)\n );\n case PopoverPosition.RIGHT_TOP:\n return (\n availableSpace.right >= hostWidth &&\n this.hasEnoughSideSpace(availableSpace.top, hostHeight, boundElementHeight, offsetModifier)\n );\n case PopoverPosition.BOTTOM:\n return (\n availableSpace.bottom >= hostHeight &&\n this.hasCenteredHorizontalSpace(availableSpace.left, availableSpace.right, hostWidth, boundElementWidth)\n );\n case PopoverPosition.BOTTOM_LEFT:\n return (\n availableSpace.bottom >= hostHeight &&\n this.hasEnoughSideSpace(availableSpace.left, hostWidth, boundElementWidth, offsetModifier)\n );\n case PopoverPosition.BOTTOM_RIGHT:\n return (\n availableSpace.bottom >= hostHeight &&\n this.hasEnoughSideSpace(availableSpace.right, hostWidth, boundElementWidth, offsetModifier)\n );\n case PopoverPosition.LEFT:\n return (\n availableSpace.left >= hostWidth &&\n this.hasCenteredVerticalSpace(availableSpace.top, availableSpace.bottom, hostHeight, boundElementHeight)\n );\n case PopoverPosition.LEFT_TOP:\n return (\n availableSpace.left >= hostWidth &&\n this.hasEnoughSideSpace(availableSpace.top, hostHeight, boundElementHeight, offsetModifier)\n );\n case PopoverPosition.LEFT_BOTTOM:\n return (\n availableSpace.left >= hostWidth &&\n this.hasEnoughSideSpace(availableSpace.bottom, hostHeight, boundElementHeight, offsetModifier)\n );\n\n default:\n return false;\n }\n };\n\n // Check desired position first\n if (fits(desiredPosition)) {\n return desiredPosition;\n }\n\n // Find position index and create rotation starting from next position\n const positions = ZPopover.positionOrder;\n const startIndex = positions.indexOf(desiredPosition);\n\n if (startIndex === -1) {\n return desiredPosition; // fallback if position not found\n }\n\n // Try all other positions starting from the next one\n for (let i = 1; i < positions.length; i++) {\n const posIndex = (startIndex + i) % positions.length;\n const pos = positions[posIndex];\n if (fits(pos)) {\n return pos;\n }\n }\n\n return this.findBestFallbackPosition(availableSpace);\n }\n\n /** Find the best fallback position based on available space when no position fits perfectly. */\n private findBestFallbackPosition(availableSpace: Offsets): PopoverPosition {\n // Determine which horizontal and vertical direction has the most available space\n const bestHorizontalDirection =\n availableSpace.right >= availableSpace.left ? PopoverPosition.RIGHT : PopoverPosition.LEFT;\n\n const bestVerticalDirection =\n availableSpace.bottom >= availableSpace.top ? PopoverPosition.BOTTOM : PopoverPosition.TOP;\n\n // Choose the main direction based on which axis has more space overall\n const maxHorizontalSpace = Math.max(availableSpace.right, availableSpace.left);\n const maxVerticalSpace = Math.max(availableSpace.bottom, availableSpace.top);\n\n const mainDirection = maxVerticalSpace >= maxHorizontalSpace ? bestVerticalDirection : bestHorizontalDirection;\n\n // Decide if a secondary direction is needed\n // Only add a secondary direction if the difference between min and max in that axis is at least double\n let needsSecondaryDirection = false;\n\n if (mainDirection === bestVerticalDirection) {\n // If main direction is vertical, check horizontal space difference\n const minHorizontalSpace = Math.min(availableSpace.right, availableSpace.left);\n needsSecondaryDirection = maxHorizontalSpace >= minHorizontalSpace * 2;\n } else {\n // If main direction is horizontal, check vertical space difference\n const minVerticalSpace = Math.min(availableSpace.bottom, availableSpace.top);\n needsSecondaryDirection = maxVerticalSpace >= minVerticalSpace * 2;\n }\n\n if (!needsSecondaryDirection) {\n return mainDirection;\n }\n\n const secondaryDirection =\n mainDirection === bestVerticalDirection ? bestHorizontalDirection : bestVerticalDirection;\n\n // Return a combined position (e.g., \"bottom_right\")\n return `${mainDirection}_${secondaryDirection}` as PopoverPosition;\n }\n\n /**\n * Find the nearest scrollable ancestor of an element to take as a reference for positioning.\n * The ancestor is considered scrollable if it doesn't have `overflow` property set to `hidden` and its scroll size is bigger than its client size.\n */\n private findScrollableAncestor(element: HTMLElement): HTMLElement {\n let parent = getParentElement(element);\n\n while (parent) {\n if (parent === element.ownerDocument.documentElement) {\n return parent as HTMLElement;\n }\n\n const style = getComputedStyle(parent);\n const {overflow, overflowX, overflowY} = style;\n const hasHiddenOverflow = overflow === \"hidden\" || overflowY === \"hidden\" || overflowX === \"hidden\";\n const isScrollable =\n (parent.scrollHeight > parent.clientHeight && overflow !== \"visible\" && overflowY !== \"visible\") ||\n (parent.scrollWidth > parent.clientWidth && overflow !== \"visible\" && overflowX !== \"visible\");\n\n if (!hasHiddenOverflow && isScrollable) {\n return parent as HTMLElement;\n }\n\n parent = getParentElement(parent);\n }\n\n return element.ownerDocument.documentElement;\n }\n\n /**\n * Calculate available space around the element bound with the popover, based on its nearest scrollable ancestor.\n *\n * Calculations for `right` and `bottom` can be a little bit confusing because `boundingRect.right` and `bottom` may not be what you expect...\n * For more information see the explanation in the docs.\n * @link https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#return_value\n */\n private calculateAvailableSpace(): Offsets {\n const boundElementRect = this.boundElement.getBoundingClientRect();\n\n if (\n this.lastBoundRect &&\n this.lastBoundRect.x === boundElementRect.x &&\n this.lastBoundRect.y === boundElementRect.y &&\n this.lastBoundRect.width === boundElementRect.width &&\n this.lastBoundRect.height === boundElementRect.height &&\n this.cachedAvailableSpace\n ) {\n // If the bound element's rect hasn't changed, return the cached rect\n return this.cachedAvailableSpace;\n }\n\n this.lastBoundRect = boundElementRect;\n const scrollableAncestor = this.findScrollableAncestor(this.boundElement);\n const scrollableAncestorRect = scrollableAncestor.getBoundingClientRect();\n const isScrollableAncestorNested = scrollableAncestor !== this.boundElement.ownerDocument.documentElement;\n const documentWidth = this.boundElement.ownerDocument.documentElement.clientWidth;\n const documentHeight = this.boundElement.ownerDocument.documentElement.clientHeight;\n const safeSpace = 8; // extra space to avoid popover being too close to the edges\n\n // These deltas represent the offset between the scrollable ancestor and the viewport.\n // They are used to adjust the available space calculations when the scrollable ancestor is not the document or body,\n // to try to fit the popover inside the scrollable ancestor.\n const deltaTop = isScrollableAncestorNested ? scrollableAncestorRect.top : 0;\n const deltaRight = isScrollableAncestorNested ? documentWidth - scrollableAncestorRect.right : 0;\n const deltaBottom = isScrollableAncestorNested ? documentHeight - scrollableAncestorRect.bottom : 0;\n const deltaLeft = isScrollableAncestorNested ? scrollableAncestorRect.left : 0;\n\n this.cachedAvailableSpace = {\n top: boundElementRect.top - deltaTop - safeSpace,\n right: documentWidth - boundElementRect.right - deltaRight - safeSpace,\n bottom: documentHeight - boundElementRect.bottom - deltaBottom - safeSpace,\n left: boundElementRect.left - deltaLeft - safeSpace,\n };\n\n return this.cachedAvailableSpace;\n }\n\n /** Calculate the space around the bound element relative to the viewport. */\n private getBoundElementOffsets(): Offsets {\n const elementRect = this.boundElement.getBoundingClientRect();\n const documentWidth = this.boundElement.ownerDocument.documentElement.clientWidth;\n const documentHeight = this.boundElement.ownerDocument.documentElement.clientHeight;\n\n return {\n top: elementRect.top,\n right: documentWidth - elementRect.right,\n bottom: documentHeight - elementRect.bottom,\n left: elementRect.left,\n };\n }\n\n /** Compute positioning offsets in the appropriate coordinate space, accounting for transformed containing blocks and scroll. */\n private computePositionOffsets(): Offsets {\n const boundElementOffsets = this.getBoundElementOffsets();\n const containingBlockAncestor = findContainingBlockAncestor(this.host);\n const isDocumentElement = containingBlockAncestor === this.host.ownerDocument.documentElement;\n\n if (isDocumentElement) {\n return boundElementOffsets;\n }\n\n const containingBlockRect = containingBlockAncestor.getBoundingClientRect();\n const containingBlockStyle = getComputedStyle(containingBlockAncestor);\n /** Padding box of the containing block, accounting for borders. */\n const paddingBox = {\n top: containingBlockRect.top + parseFloat(containingBlockStyle.borderTopWidth),\n right: containingBlockRect.right - parseFloat(containingBlockStyle.borderRightWidth),\n bottom: containingBlockRect.bottom - parseFloat(containingBlockStyle.borderBottomWidth),\n left: containingBlockRect.left + parseFloat(containingBlockStyle.borderLeftWidth),\n };\n\n const boundElementRect = this.boundElement.getBoundingClientRect();\n /** Bound element offsets relative to the containing block padding box. */\n const relativeOffsets = {\n top: boundElementRect.top - paddingBox.top,\n right: paddingBox.right - boundElementRect.right,\n bottom: paddingBox.bottom - boundElementRect.bottom,\n left: boundElementRect.left - paddingBox.left,\n };\n\n /** Account for scroll to keep the popover aligned while the containing block scrolls. */\n return {\n top: relativeOffsets.top + containingBlockAncestor.scrollTop,\n right: relativeOffsets.right - containingBlockAncestor.scrollLeft,\n bottom: relativeOffsets.bottom - containingBlockAncestor.scrollTop,\n left: relativeOffsets.left + containingBlockAncestor.scrollLeft,\n };\n }\n\n /** Apply positioning styles based on `position` parameter. */\n private applyPositionStyles(position: PopoverPosition, availableSpace: Offsets): void {\n const boundElementWidth = this.boundElement.offsetWidth;\n const boundElementHeight = this.boundElement.offsetHeight;\n const offsetModifier = this.offsetModifier;\n /**\n * Distance between the arrow center and the popover edge.\n * Needed to align the center of the arrow with the center of the bound element when `showArrow` and `center` are enabled.\n */\n const arrowModifier = this.showArrow && this.center ? 8 : 0;\n const hostStyle = this.host.style;\n /** Gap between the popover and the bound element, set as margin in CSS. */\n const distanceFromBound = parseFloat(getComputedStyle(this.host).marginTop.replace(\"px\", \"\")) || 0;\n const positionOffsets = this.computePositionOffsets();\n\n /**\n * Precomputed bases to reduce repeated arithmetic in the switch below.\n * They represent the bound element edges plus optional centering offsets.\n */\n const leftBase = positionOffsets.left + boundElementWidth * offsetModifier;\n const rightBase = positionOffsets.right + boundElementWidth * offsetModifier;\n const topBase = positionOffsets.top + boundElementHeight;\n const bottomBase = positionOffsets.bottom + boundElementHeight;\n const sideTopBase = positionOffsets.top + boundElementHeight * offsetModifier;\n const sideBottomBase = positionOffsets.bottom + boundElementHeight * offsetModifier;\n\n let maxWidth: number;\n let maxHeight: number;\n\n switch (position) {\n case PopoverPosition.TOP:\n case PopoverPosition.TOP_RIGHT:\n hostStyle.bottom = `${bottomBase}px`;\n hostStyle.left = `${leftBase - (position === PopoverPosition.TOP_RIGHT ? arrowModifier : 0)}px`;\n maxHeight = availableSpace.top - distanceFromBound;\n if (position === PopoverPosition.TOP_RIGHT) {\n maxWidth = availableSpace.right + boundElementWidth * offsetModifier;\n }\n break;\n\n case PopoverPosition.TOP_LEFT:\n hostStyle.right = `${rightBase - arrowModifier}px`;\n hostStyle.bottom = `${bottomBase}px`;\n maxWidth = availableSpace.left + boundElementWidth * offsetModifier;\n maxHeight = availableSpace.top - distanceFromBound;\n break;\n\n case PopoverPosition.BOTTOM:\n case PopoverPosition.BOTTOM_RIGHT:\n hostStyle.top = `${topBase}px`;\n hostStyle.left = `${leftBase - (position === PopoverPosition.BOTTOM_RIGHT ? arrowModifier : 0)}px`;\n maxHeight = availableSpace.bottom - distanceFromBound;\n if (position === PopoverPosition.BOTTOM_RIGHT) {\n maxWidth = availableSpace.right + boundElementWidth * offsetModifier;\n }\n break;\n\n case PopoverPosition.BOTTOM_LEFT:\n hostStyle.top = `${topBase}px`;\n hostStyle.right = `${rightBase - arrowModifier}px`;\n maxWidth = availableSpace.left + boundElementWidth * offsetModifier;\n maxHeight = availableSpace.bottom - distanceFromBound;\n break;\n\n case PopoverPosition.RIGHT:\n case PopoverPosition.RIGHT_BOTTOM:\n hostStyle.top = `${sideTopBase - (position === PopoverPosition.RIGHT_BOTTOM ? arrowModifier : 0)}px`;\n hostStyle.left = `${positionOffsets.left + boundElementWidth}px`;\n maxWidth = availableSpace.right - distanceFromBound;\n if (position === PopoverPosition.RIGHT) {\n maxHeight = availableSpace.top + availableSpace.bottom + boundElementHeight;\n } else {\n maxHeight = availableSpace.bottom + boundElementHeight * offsetModifier;\n }\n break;\n\n case PopoverPosition.RIGHT_TOP:\n hostStyle.bottom = `${sideBottomBase - arrowModifier}px`;\n hostStyle.left = `${positionOffsets.left + boundElementWidth}px`;\n maxWidth = availableSpace.right - distanceFromBound;\n maxHeight = availableSpace.top + boundElementHeight * offsetModifier;\n break;\n\n case PopoverPosition.LEFT:\n case PopoverPosition.LEFT_BOTTOM:\n hostStyle.top = `${sideTopBase - (position === PopoverPosition.LEFT_BOTTOM ? arrowModifier : 0)}px`;\n hostStyle.right = `${positionOffsets.right + boundElementWidth}px`;\n maxWidth = availableSpace.left - distanceFromBound;\n if (position === PopoverPosition.LEFT_BOTTOM) {\n maxHeight = availableSpace.bottom + boundElementHeight * offsetModifier;\n }\n break;\n\n case PopoverPosition.LEFT_TOP:\n hostStyle.right = `${positionOffsets.right + boundElementWidth}px`;\n hostStyle.bottom = `${sideBottomBase - arrowModifier}px`;\n maxWidth = availableSpace.left - distanceFromBound;\n maxHeight = availableSpace.top + boundElementHeight * offsetModifier;\n break;\n }\n\n if (getDevice() !== Device.MOBILE) {\n // Only force max sizes on non-mobile viewports\n Object.assign(hostStyle, {\n maxWidth: maxWidth ? `${maxWidth}px` : \"\",\n maxHeight: maxHeight ? `${maxHeight}px` : \"\",\n });\n }\n }\n\n /** Set the position of the popover. */\n private setPosition(): void {\n if (!this.boundElement) {\n return;\n }\n\n if (!isElementVisibleInContainer(this.boundElement, this.findScrollableAncestor(this.boundElement))) {\n // If the bound element is not visible, hide the popover too\n this.open = false;\n\n return;\n }\n\n Object.assign(this.host.style, {\n // Reset all positioning properties\n top: \"auto\",\n right: \"auto\",\n bottom: \"auto\",\n left: \"auto\",\n maxWidth: \"\",\n maxHeight: \"\",\n // Set initial visibility to hidden while calculating position...\n visibility: \"hidden\",\n });\n\n const availableSpace = this.calculateAvailableSpace();\n const position = this.getOptimalPopoverPosition(this.position, availableSpace);\n\n this.applyPositionStyles(position, availableSpace);\n this.currentPosition = position;\n this.positionChange.emit({position: this.currentPosition});\n\n // ...then restore the visibility\n this.host.style.visibility = \"visible\";\n }\n\n componentWillLoad(): void {\n this.validatePosition(this.position);\n }\n\n componentDidLoad(): void {\n this.findBoundElement();\n if (this.open) {\n this.onOpen();\n }\n }\n\n disconnectedCallback(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n }\n\n render(): HTMLZPopoverElement {\n return (\n <Host current-position={this.currentPosition}>\n <slot></slot>\n </Host>\n );\n }\n}\n"],"mappings":"qMAAA,MAAMA,EAAY,+iGAClB,MAAAC,EAAeD,E,MC+BFE,EAAQ,M,+GAoEFC,KAAAC,eAAiB,E,cA7DLC,EAAgBC,I,UAQtC,M,qCAWK,M,YAIH,M,cAQE,K,+BAkDX,wBAAAC,CAAyBC,GACvB,GAAIL,KAAKM,UAAYD,EAAEE,MAAQC,EAAaC,IAAK,CAC/CJ,EAAEK,kBACFV,KAAKW,KAAO,K,EAUhB,kBAAAC,CAAmBP,GACjB,MAAMQ,EAASR,EAAEQ,OACjB,IAAKb,KAAKM,WAAaN,KAAKW,MAAQG,EAAgBd,KAAKe,KAAMF,GAAS,CACtE,M,CAGF,GAAIC,EAAgBd,KAAKgB,aAAcH,GAAS,CAE9CR,EAAEK,iB,CAEJV,KAAKW,KAAO,K,CAId,gBAAAM,CAAiBC,GACf,IAAKC,OAAOC,OAAOlB,GAAiBmB,SAASH,IAAgCA,IAAahB,EAAgBoB,KAAM,CAC9GJ,EAAWhB,EAAgBC,IAC3BH,KAAKuB,SAAWL,C,CAElBlB,KAAKwB,gBAAkBN,EACvB,GAAIlB,KAAKW,KAAM,CACbX,KAAKyB,a,EAMT,MAAAC,GACEC,qBAAqB3B,KAAK4B,yBAC1B5B,KAAK6B,WAAWC,KAAK,CAACnB,KAAMX,KAAKW,OACjC,IAAKX,K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AKe,KAAKiB,MAAO,CAE7BC,IAAK,OACLC,MAAO,OACPC,OAAQ,OACRC,KAAM,OACNC,SAAU,GACVC,UAAW,GAEXC,WAAY,WAGd,MAAM2B,EAAiBlE,KAAK2H,0BAC5B,MAAMpG,EAAWvB,KAAKqE,0BAA0BrE,KAAKuB,SAAU2C,GAE/DlE,KAAK6J,oBAAoBtI,EAAU2C,GACnClE,KAAKwB,gBAAkBD,EACvBvB,KAAK+K,eAAejJ,KAAK,CAACP,SAAUvB,KAAKwB,kBAGzCxB,KAAKe,KAAKiB,MAAMO,WAAa,S,CAG/B,iBAAAyI,GACEhL,KAAKiB,iBAAiBjB,KAAKuB,S,CAG7B,gBAAA0J,GACEjL,KAAK6C,mBACL,GAAI7C,KAAKW,KAAM,CACbX,KAAK0B,Q,EAIT,oBAAAwJ,GACEvJ,qBAAqB3B,KAAK4B,wB,CAG5B,MAAAuJ,GACE,OACEC,EAACC,EAAI,CAAA9K,IAAA,8DAAmBP,KAAKwB,iBAC3B4J,EAAA,QAAA7K,IAAA,6C,oIA7nBkBR,EAAA2F,cAAmC,CACzDxF,EAAgBC,IAChBD,EAAgB4E,UAChB5E,EAAgB6E,SAChB7E,EAAgB8E,MAChB9E,EAAgB+E,aAChB/E,EAAgBgF,UAChBhF,EAAgBiF,OAChBjF,EAAgBkF,YAChBlF,EAAgBmF,aAChBnF,EAAgBoF,KAChBpF,EAAgBqF,SAChBrF,EAAgBsF,a","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["stylesCss","ZPopoverStyle0","ZPopover","this","spaceTolerance","PopoverPosition","TOP","closePopoverWithKeyboard","e","closable","key","KeyboardCode","ESC","stopPropagation","open","handleOutsideClick","target","containsElement","host","boundElement","validatePosition","newValue","Object","values","includes","AUTO","position","currentPosition","setPosition","onOpen","cancelAnimationFrame","animationFrameRequestId","openChange","emit","assign","style","top","right","bottom","left","maxWidth","maxHeight","visibility","undefined","updatePositionLoop","requestAnimationFrame","setTimeout","onBindingChange","findBoundElement","offsetModifier","center","bindTo","ownerDocument","querySelector","getParentElement","tagName","toLowerCase","hasCenteredHorizontalSpace","availableLeft","availableRight","hostWidth","boundElementWidth","requiredSideSpace","hasCenteredVerticalSpace","availableTop","availableBottom","hostHeight","boundElementHeight","hasEnoughSideSpace","availableSpace","hostSize","boundElementSize","getOptimalPopoverPosition","desiredPosition","offsetWidth","offsetHeight","getBoundingClientRect","width","height","fits","pos","TOP_RIGHT","TOP_LEFT","RIGHT","RIGHT_BOTTOM","RIGHT_TOP","BOTTOM","BOTTOM_LEFT","BOTTOM_RIGHT","LEFT","LEFT_TOP","LEFT_BOTTOM","positions","positionOrder","startIndex","indexOf","i","length","posIndex","findBestFallbackPosition","bestHorizontalDirection","bestVerticalDirection","maxHorizontalSpace","Math","max","maxVerticalSpace","mainDirection","needsSecondaryDirection","minHorizontalSpace","min","minVerticalSpace","secondaryDirection","findScrollableAncestor","element","parent","documentElement","getComputedStyle","overflow","overflowX","overflowY","hasHiddenOverflow","isScrollable","scrollHeight","clientHeight","scrollWidth","clientWidth","calculateAvailableSpace","boundElementRect","lastBoundRect","x","y","cachedAvailableSpace","scrollableAncestor","scrollableAncestorRect","isScrollableAncestorNested","documentWidth","documentHeight","safeSpace","deltaTop","deltaRight","deltaBottom","deltaLeft","getBoundElementOffsets","elementRect","computePositionOffsets","boundElementOffsets","containingBlockAncestor","findContainingBlockAncestor","isDocumentElement","containingBlockRect","containingBlockStyle","paddingBox","parseFloat","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","relativeOffsets","scrollTop","scrollLeft","applyPositionStyles","arrowModifier","showArrow","hostStyle","distanceFromBound","marginTop","replace","positionOffsets","leftBase","rightBase","topBase","bottomBase","sideTopBase","sideBottomBase","getDevice","Device","MOBILE","isElementVisibleInContainer","positionChange","componentWillLoad","componentDidLoad","disconnectedCallback","render","h","Host"],"sources":["src/components/z-popover/styles.css?tag=z-popover&encapsulation=shadow","src/components/z-popover/index.tsx"],"sourcesContent":[":host {\n --z-popover-theme--surface: ;\n --z-popover-theme--text: ;\n --z-popover-padding: ;\n --z-popover-shadow-filter: ;\n\n position: fixed;\n display: none;\n max-width: calc(100dvw - var(--grid-margin) * 2);\n max-height: calc(100dvh - var(--grid-margin) * 2);\n padding: var(--z-popover-padding, 0);\n background: var(--z-popover-theme--surface, var(--color-surface01));\n border-radius: var(--border-radius-small);\n color: var(--z-popover-theme--text, var(--color-default-text));\n fill: currentcolor;\n filter: var(--z-popover-shadow-filter, drop-shadow(0 1px 2px var(--shadow-color-base)));\n text-align: center;\n visibility: hidden; /* hidden by default. the positioning algorithm will set it to 'visible' when needed */\n}\n\n:host([open]:not([open=\"false\"])[current-position]) {\n display: block;\n}\n\n:host([center][current-position=\"top\"]),\n:host([center][current-position=\"bottom\"]) {\n transform: translateX(-50%);\n}\n\n:host([center][current-position=\"right\"]),\n:host([center][current-position=\"left\"]) {\n transform: translateY(-50%);\n}\n\n:host([current-position^=\"top\"]) {\n margin: 0 0 var(--space-unit);\n}\n\n:host([current-position^=\"bottom\"]) {\n margin: var(--space-unit) 0 0;\n}\n\n:host([current-position^=\"left\"]) {\n margin: 0 var(--space-unit) 0 0;\n}\n\n:host([current-position^=\"right\"]) {\n margin: 0 0 0 var(--space-unit);\n}\n\n/* Arrow style */\n:host([current-position])::before {\n --arrow-size: 6px;\n --arrow-edge-offset: calc(100% - var(--space-unit) - (var(--arrow-size) / 2));\n --arrow-center-x-offset: calc(50% - (var(--arrow-size) / 2));\n --arrow-center-y-offset: calc(100% - (var(--arrow-size) / 2));\n\n position: absolute;\n display: block;\n width: var(--arrow-size);\n height: var(--arrow-size);\n background: var(--z-popover-theme--surface, var(--color-surface01));\n content: \"\";\n transform: rotate(45deg);\n}\n\n:host([show-arrow=\"false\"])::before,\n:host(:not([show-arrow]))::before {\n display: none;\n}\n\n:host([current-position^=\"top\"])::before {\n top: var(--arrow-center-y-offset);\n}\n\n:host([current-position^=\"bottom\"])::before {\n bottom: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"top\"])::before,\n:host([current-position=\"bottom\"])::before {\n right: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right\"])::before,\n:host([current-position=\"left\"])::before {\n bottom: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right\"])::before {\n right: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"left\"])::before {\n left: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"top_right\"])::before,\n:host([current-position=\"bottom_right\"])::before {\n right: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"top_left\"])::before,\n:host([current-position=\"bottom_left\"])::before {\n left: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right_top\"])::before,\n:host([current-position=\"left_top\"])::before {\n top: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right_top\"])::before,\n:host([current-position=\"right_bottom\"])::before {\n right: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"left_top\"])::before,\n:host([current-position=\"left_bottom\"])::before {\n left: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"right_bottom\"])::before,\n:host([current-position=\"left_bottom\"])::before {\n bottom: var(--arrow-edge-offset);\n}\n\n:host([center][current-position=\"top\"])::before,\n:host([center][current-position=\"bottom\"])::before {\n right: auto;\n left: var(--arrow-center-x-offset);\n}\n\n:host([center][current-position=\"right\"])::before,\n:host([center][current-position=\"left\"])::before {\n top: var(--arrow-center-x-offset);\n bottom: auto;\n}\n","import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {Device, KeyboardCode, PopoverPosition} from \"../../beans\";\nimport {\n containsElement,\n findContainingBlockAncestor,\n getDevice,\n getParentElement,\n isElementVisibleInContainer,\n} from \"../../utils/utils\";\n\n/** Centering offset modifier. 0 for no offset, 0.5 for centering. */\ntype OffsetModifier = 0 | 0.5;\ntype Offsets = {top: number; right: number; bottom: number; left: number};\n\n/**\n * Popover component.\n * This component displays a popover bound to an element.\n * It supports various positions and can automatically adjust it based on available space, accounting for scrollable containers.\n *\n * Notes:\n * - If positioning has an odd behavior, consider manually adjusting the size of the slotted elements (using `width`, `height`, `max-width`, `max-height`, etc...) when its content is \"fluid\" (like text), because it can interfere with the position calculation (for example a long text on one single line can be bigger than the available space, letting the algorithm think the popover doesn't fits).\n *\n * @cssprop --z-popover-theme--surface - background color of the popover.\n * @cssprop --z-popover-theme--text - foreground color of the popover.\n * @cssprop --z-popover-padding - padding of the popover.\n * @cssprop --z-popover-shadow-filter - drop-shadow filter of the popover. Defaults to `drop-shadow(0 1px 2px var(--shadow-color-base))`.\n */\n@Component({\n tag: \"z-popover\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZPopover {\n /**\n * The preferred position to render the popover.\n * The popover will automatically search another position if not enough space is available for the preferred position.\n * If the preferred position is not available, it will try to find the best position starting from `TOP` and going clockwise.\n */\n @Prop({reflect: true, mutable: true})\n position?: PopoverPosition = PopoverPosition.TOP;\n\n /**\n * The initial open state of the popover.\n * Internal changes of this prop are emitted through the `openChange` event.\n * Make sure to listen to that event if you need the updated state of the popover from the outside, to avoid inconsistent values.\n */\n @Prop({reflect: true, mutable: true})\n open = false;\n\n /**\n * The selector or the element bound with the popover.\n * If string css selector is provided make sure to use a valid selector.\n */\n @Prop()\n bindTo?: string | HTMLElement;\n\n /** Whether to show popover's arrow. */\n @Prop({reflect: true})\n showArrow = false;\n\n /** Whether to center the popup on the main side (according to \"position\"). */\n @Prop({reflect: true})\n center = false;\n\n /**\n * Whether the popover can be closed by clicking outside of it or pressing the escape key.\n * Otherwise, it will be closed only programmatically (by setting `open` to `false`).\n * Default: `true`.\n */\n @Prop()\n closable = true;\n\n /**\n * The current position of the popover.\n * It differs from `position` only when calculated automatically for space reasons.\n */\n @State()\n currentPosition?: PopoverPosition;\n\n @Element() host: HTMLZPopoverElement;\n\n // Clockwise order of positions.\n private static readonly positionOrder: PopoverPosition[] = [\n PopoverPosition.TOP,\n PopoverPosition.TOP_RIGHT,\n PopoverPosition.TOP_LEFT,\n PopoverPosition.RIGHT,\n PopoverPosition.RIGHT_BOTTOM,\n PopoverPosition.RIGHT_TOP,\n PopoverPosition.BOTTOM,\n PopoverPosition.BOTTOM_LEFT,\n PopoverPosition.BOTTOM_RIGHT,\n PopoverPosition.LEFT,\n PopoverPosition.LEFT_TOP,\n PopoverPosition.LEFT_BOTTOM,\n ] as const;\n\n private animationFrameRequestId?: number;\n\n /** space tolerance for space calculations */\n private readonly spaceTolerance = 3;\n\n /** The element bound to the popover. */\n private boundElement?: HTMLElement;\n\n /** Cached available space around the bound element to avoid unnecessary recalculations */\n private cachedAvailableSpace?: Offsets;\n\n /** Last bounding rect of the bound element to detect changes and eventually invalidate the caches. */\n private lastBoundRect?: DOMRect;\n\n /** Fired when the position changes. */\n @Event()\n positionChange: EventEmitter<{position: PopoverPosition}>;\n\n /** Event emitted when the open state of the popover changes (e.g. when the user clicks outside the popover to close it, if `closable` is true). */\n @Event()\n openChange: EventEmitter<{open: boolean}>;\n\n @Listen(\"keyup\", {target: \"window\", capture: true})\n closePopoverWithKeyboard(e: KeyboardEvent): void {\n if (this.closable && e.key === KeyboardCode.ESC) {\n e.stopPropagation();\n this.open = false;\n }\n }\n\n /**\n * Close the popover when clicking outside of its content.\n * Stop event propagation if the click was fired by popover's trigger element,\n * to prevent close and reopen glitches.\n */\n @Listen(\"click\", {target: \"body\", capture: true})\n handleOutsideClick(e: MouseEvent): void {\n const target = e.target as Element;\n if (!this.closable || !this.open || containsElement(this.host, target)) {\n return;\n }\n\n if (containsElement(this.boundElement, target)) {\n // stop propagation if the click was on the trigger element to prevent close and reopen glitches\n e.stopPropagation();\n }\n this.open = false;\n }\n\n @Watch(\"position\")\n validatePosition(newValue: PopoverPosition): void {\n if (!Object.values(PopoverPosition).includes(newValue as PopoverPosition) || newValue === PopoverPosition.AUTO) {\n newValue = PopoverPosition.TOP;\n this.position = newValue;\n }\n this.currentPosition = newValue;\n if (this.open) {\n this.setPosition();\n }\n }\n\n /** Setup popover behaviors when `open` changes. */\n @Watch(\"open\")\n onOpen(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n this.openChange.emit({open: this.open});\n if (!this.open) {\n Object.assign(this.host.style, {\n // Reset all positioning properties\n top: \"auto\",\n right: \"auto\",\n bottom: \"auto\",\n left: \"auto\",\n maxWidth: \"\",\n maxHeight: \"\",\n // Set initial visibility to hidden while calculating position...\n visibility: \"hidden\",\n });\n this.currentPosition = undefined;\n\n return;\n }\n\n const updatePositionLoop = (): void => {\n if (!this.open) {\n return;\n }\n\n this.setPosition();\n this.animationFrameRequestId = requestAnimationFrame(updatePositionLoop);\n };\n\n // call `setPosition` after a tick to ensure the DOM is ready and sizes are available\n setTimeout(() => {\n updatePositionLoop();\n }, 0);\n }\n\n @Watch(\"bindTo\")\n onBindingChange(): void {\n this.findBoundElement();\n }\n\n /** Returns the offset modifier to use in calculations to align the popover with the bound element. */\n private get offsetModifier(): OffsetModifier {\n return this.center ? 0.5 : 0;\n }\n\n private findBoundElement(): void {\n if (typeof this.bindTo === \"string\") {\n this.boundElement = this.host.ownerDocument.querySelector(this.bindTo) as HTMLElement;\n } else if (this.bindTo) {\n this.boundElement = this.bindTo;\n } else {\n this.boundElement = getParentElement(this.host) as HTMLElement;\n if (this.boundElement.tagName.toLowerCase() === \"z-tooltip\") {\n // If the popover is used inside a tooltip without a specified `bindTo`, bind it to the parent of the tooltip.\n this.boundElement = getParentElement(this.boundElement) as HTMLElement;\n }\n }\n }\n\n /**\n * Check if element has enough space to the right and left to be centered.\n * Used for `TOP` and `BOTTOM` position.\n * When `center` is not enabled, only one side needs to be checked and `RIGHT` is the default.\n */\n private hasCenteredHorizontalSpace(\n availableLeft: number,\n availableRight: number,\n hostWidth: number,\n boundElementWidth: number\n ): boolean {\n const requiredSideSpace = (hostWidth - boundElementWidth) * (1 - this.offsetModifier);\n\n if (!this.center) {\n return availableRight >= requiredSideSpace - this.spaceTolerance;\n }\n\n return (\n availableRight >= requiredSideSpace - this.spaceTolerance &&\n availableLeft >= requiredSideSpace - this.spaceTolerance\n );\n }\n\n /**\n * Check if element has enough space to the top and bottom to be centered.\n * Used for `RIGHT` and `LEFT` position.\n * When `center` is not enabled, only one side needs to be checked and `BOTTOM` is the default.\n */\n private hasCenteredVerticalSpace(\n availableTop: number,\n availableBottom: number,\n hostHeight: number,\n boundElementHeight: number\n ): boolean {\n const requiredSideSpace = (hostHeight - boundElementHeight) * (1 - this.offsetModifier);\n\n if (!this.center) {\n return availableBottom >= requiredSideSpace - this.spaceTolerance;\n }\n\n return (\n availableTop >= requiredSideSpace - this.spaceTolerance &&\n availableBottom >= requiredSideSpace - this.spaceTolerance\n );\n }\n\n /**\n * Check if there is enough space in the given direction to fit the popover.\n * Used for composed positions like TOP_RIGHT, LEFT_BOTTOM, etc.\n */\n private hasEnoughSideSpace(\n availableSpace: number,\n hostSize: number,\n boundElementSize: number,\n offsetModifier: OffsetModifier\n ): boolean {\n return availableSpace >= hostSize - boundElementSize * (1 - offsetModifier) - this.spaceTolerance;\n }\n\n /**\n * Given a desired position and available space around the bound element, returns the best position\n * that fits the popover, trying all positions if needed.\n * Takes into account offsetModifier for centering.\n * @param desiredPosition The desired position of the popover.\n * @param availableSpace The available space around the bound element.\n */\n private getOptimalPopoverPosition(desiredPosition: PopoverPosition, availableSpace: Offsets): PopoverPosition {\n const hostWidth = this.host.offsetWidth;\n const hostHeight = this.host.offsetHeight;\n const boundElementWidth = this.boundElement.getBoundingClientRect().width;\n const boundElementHeight = this.boundElement.getBoundingClientRect().height;\n const offsetModifier = this.offsetModifier;\n\n /** Check if there is enough space to fit the popover in the desired position */\n const fits = (pos: PopoverPosition): boolean => {\n switch (pos) {\n case PopoverPosition.TOP:\n return (\n availableSpace.top >= hostHeight - this.spaceTolerance &&\n this.hasCenteredHorizontalSpace(availableSpace.left, availableSpace.right, hostWidth, boundElementWidth)\n );\n case PopoverPosition.TOP_RIGHT:\n return (\n availableSpace.top >= hostHeight &&\n this.hasEnoughSideSpace(availableSpace.right, hostWidth, boundElementWidth, offsetModifier)\n );\n case PopoverPosition.TOP_LEFT:\n return (\n availableSpace.top >= hostHeight &&\n this.hasEnoughSideSpace(availableSpace.left, hostWidth, boundElementWidth, offsetModifier)\n );\n case PopoverPosition.RIGHT:\n return (\n availableSpace.right >= hostWidth &&\n this.hasCenteredVerticalSpace(availableSpace.top, availableSpace.bottom, hostHeight, boundElementHeight)\n );\n case PopoverPosition.RIGHT_BOTTOM:\n return (\n availableSpace.right >= hostWidth &&\n this.hasEnoughSideSpace(availableSpace.bottom, hostHeight, boundElementHeight, offsetModifier)\n );\n case PopoverPosition.RIGHT_TOP:\n return (\n availableSpace.right >= hostWidth &&\n this.hasEnoughSideSpace(availableSpace.top, hostHeight, boundElementHeight, offsetModifier)\n );\n case PopoverPosition.BOTTOM:\n return (\n availableSpace.bottom >= hostHeight &&\n this.hasCenteredHorizontalSpace(availableSpace.left, availableSpace.right, hostWidth, boundElementWidth)\n );\n case PopoverPosition.BOTTOM_LEFT:\n return (\n availableSpace.bottom >= hostHeight &&\n this.hasEnoughSideSpace(availableSpace.left, hostWidth, boundElementWidth, offsetModifier)\n );\n case PopoverPosition.BOTTOM_RIGHT:\n return (\n availableSpace.bottom >= hostHeight &&\n this.hasEnoughSideSpace(availableSpace.right, hostWidth, boundElementWidth, offsetModifier)\n );\n case PopoverPosition.LEFT:\n return (\n availableSpace.left >= hostWidth &&\n this.hasCenteredVerticalSpace(availableSpace.top, availableSpace.bottom, hostHeight, boundElementHeight)\n );\n case PopoverPosition.LEFT_TOP:\n return (\n availableSpace.left >= hostWidth &&\n this.hasEnoughSideSpace(availableSpace.top, hostHeight, boundElementHeight, offsetModifier)\n );\n case PopoverPosition.LEFT_BOTTOM:\n return (\n availableSpace.left >= hostWidth &&\n this.hasEnoughSideSpace(availableSpace.bottom, hostHeight, boundElementHeight, offsetModifier)\n );\n\n default:\n return false;\n }\n };\n\n // Check desired position first\n if (fits(desiredPosition)) {\n return desiredPosition;\n }\n\n // Find position index and create rotation starting from next position\n const positions = ZPopover.positionOrder;\n const startIndex = positions.indexOf(desiredPosition);\n\n if (startIndex === -1) {\n return desiredPosition; // fallback if position not found\n }\n\n // Try all other positions starting from the next one\n for (let i = 1; i < positions.length; i++) {\n const posIndex = (startIndex + i) % positions.length;\n const pos = positions[posIndex];\n if (fits(pos)) {\n return pos;\n }\n }\n\n return this.findBestFallbackPosition(availableSpace);\n }\n\n /** Find the best fallback position based on available space when no position fits perfectly. */\n private findBestFallbackPosition(availableSpace: Offsets): PopoverPosition {\n // Determine which horizontal and vertical direction has the most available space\n const bestHorizontalDirection =\n availableSpace.right >= availableSpace.left ? PopoverPosition.RIGHT : PopoverPosition.LEFT;\n\n const bestVerticalDirection =\n availableSpace.bottom >= availableSpace.top ? PopoverPosition.BOTTOM : PopoverPosition.TOP;\n\n // Choose the main direction based on which axis has more space overall\n const maxHorizontalSpace = Math.max(availableSpace.right, availableSpace.left);\n const maxVerticalSpace = Math.max(availableSpace.bottom, availableSpace.top);\n\n const mainDirection = maxVerticalSpace >= maxHorizontalSpace ? bestVerticalDirection : bestHorizontalDirection;\n\n // Decide if a secondary direction is needed\n // Only add a secondary direction if the difference between min and max in that axis is at least double\n let needsSecondaryDirection = false;\n\n if (mainDirection === bestVerticalDirection) {\n // If main direction is vertical, check horizontal space difference\n const minHorizontalSpace = Math.min(availableSpace.right, availableSpace.left);\n needsSecondaryDirection = maxHorizontalSpace >= minHorizontalSpace * 2;\n } else {\n // If main direction is horizontal, check vertical space difference\n const minVerticalSpace = Math.min(availableSpace.bottom, availableSpace.top);\n needsSecondaryDirection = maxVerticalSpace >= minVerticalSpace * 2;\n }\n\n if (!needsSecondaryDirection) {\n return mainDirection;\n }\n\n const secondaryDirection =\n mainDirection === bestVerticalDirection ? bestHorizontalDirection : bestVerticalDirection;\n\n // Return a combined position (e.g., \"bottom_right\")\n return `${mainDirection}_${secondaryDirection}` as PopoverPosition;\n }\n\n /**\n * Find the nearest scrollable ancestor of an element to take as a reference for positioning.\n * The ancestor is considered scrollable if it doesn't have `overflow` property set to `hidden` and its scroll size is bigger than its client size.\n */\n private findScrollableAncestor(element: HTMLElement): HTMLElement {\n let parent = getParentElement(element);\n\n while (parent) {\n if (parent === element.ownerDocument.documentElement) {\n return parent as HTMLElement;\n }\n\n const style = getComputedStyle(parent);\n const {overflow, overflowX, overflowY} = style;\n const hasHiddenOverflow = overflow === \"hidden\" || overflowY === \"hidden\" || overflowX === \"hidden\";\n const isScrollable =\n (parent.scrollHeight > parent.clientHeight && overflow !== \"visible\" && overflowY !== \"visible\") ||\n (parent.scrollWidth > parent.clientWidth && overflow !== \"visible\" && overflowX !== \"visible\");\n\n if (!hasHiddenOverflow && isScrollable) {\n return parent as HTMLElement;\n }\n\n parent = getParentElement(parent);\n }\n\n return element.ownerDocument.documentElement;\n }\n\n /**\n * Calculate available space around the element bound with the popover, based on its nearest scrollable ancestor.\n *\n * Calculations for `right` and `bottom` can be a little bit confusing because `boundingRect.right` and `bottom` may not be what you expect...\n * For more information see the explanation in the docs.\n * @link https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#return_value\n */\n private calculateAvailableSpace(): Offsets {\n const boundElementRect = this.boundElement.getBoundingClientRect();\n\n if (\n this.lastBoundRect &&\n this.lastBoundRect.x === boundElementRect.x &&\n this.lastBoundRect.y === boundElementRect.y &&\n this.lastBoundRect.width === boundElementRect.width &&\n this.lastBoundRect.height === boundElementRect.height &&\n this.cachedAvailableSpace\n ) {\n // If the bound element's rect hasn't changed, return the cached rect\n return this.cachedAvailableSpace;\n }\n\n this.lastBoundRect = boundElementRect;\n const scrollableAncestor = this.findScrollableAncestor(this.boundElement);\n const scrollableAncestorRect = scrollableAncestor.getBoundingClientRect();\n const isScrollableAncestorNested = scrollableAncestor !== this.boundElement.ownerDocument.documentElement;\n const documentWidth = this.boundElement.ownerDocument.documentElement.clientWidth;\n const documentHeight = this.boundElement.ownerDocument.documentElement.clientHeight;\n const safeSpace = 8; // extra space to avoid popover being too close to the edges\n\n // These deltas represent the offset between the scrollable ancestor and the viewport.\n // They are used to adjust the available space calculations when the scrollable ancestor is not the document or body,\n // to try to fit the popover inside the scrollable ancestor.\n const deltaTop = isScrollableAncestorNested ? scrollableAncestorRect.top : 0;\n const deltaRight = isScrollableAncestorNested ? documentWidth - scrollableAncestorRect.right : 0;\n const deltaBottom = isScrollableAncestorNested ? documentHeight - scrollableAncestorRect.bottom : 0;\n const deltaLeft = isScrollableAncestorNested ? scrollableAncestorRect.left : 0;\n\n this.cachedAvailableSpace = {\n top: boundElementRect.top - deltaTop - safeSpace,\n right: documentWidth - boundElementRect.right - deltaRight - safeSpace,\n bottom: documentHeight - boundElementRect.bottom - deltaBottom - safeSpace,\n left: boundElementRect.left - deltaLeft - safeSpace,\n };\n\n return this.cachedAvailableSpace;\n }\n\n /** Calculate the space around the bound element relative to the viewport. */\n private getBoundElementOffsets(): Offsets {\n const elementRect = this.boundElement.getBoundingClientRect();\n const documentWidth = this.boundElement.ownerDocument.documentElement.clientWidth;\n const documentHeight = this.boundElement.ownerDocument.documentElement.clientHeight;\n\n return {\n top: elementRect.top,\n right: documentWidth - elementRect.right,\n bottom: documentHeight - elementRect.bottom,\n left: elementRect.left,\n };\n }\n\n /** Compute positioning offsets in the appropriate coordinate space, accounting for transformed containing blocks and scroll. */\n private computePositionOffsets(): Offsets {\n const boundElementOffsets = this.getBoundElementOffsets();\n const containingBlockAncestor = findContainingBlockAncestor(this.host);\n const isDocumentElement = containingBlockAncestor === this.host.ownerDocument.documentElement;\n\n if (isDocumentElement) {\n return boundElementOffsets;\n }\n\n const containingBlockRect = containingBlockAncestor.getBoundingClientRect();\n const containingBlockStyle = getComputedStyle(containingBlockAncestor);\n /** Padding box of the containing block, accounting for borders. */\n const paddingBox = {\n top: containingBlockRect.top + parseFloat(containingBlockStyle.borderTopWidth),\n right: containingBlockRect.right - parseFloat(containingBlockStyle.borderRightWidth),\n bottom: containingBlockRect.bottom - parseFloat(containingBlockStyle.borderBottomWidth),\n left: containingBlockRect.left + parseFloat(containingBlockStyle.borderLeftWidth),\n };\n\n const boundElementRect = this.boundElement.getBoundingClientRect();\n /** Bound element offsets relative to the containing block padding box. */\n const relativeOffsets = {\n top: boundElementRect.top - paddingBox.top,\n right: paddingBox.right - boundElementRect.right,\n bottom: paddingBox.bottom - boundElementRect.bottom,\n left: boundElementRect.left - paddingBox.left,\n };\n\n /** Account for scroll to keep the popover aligned while the containing block scrolls. */\n return {\n top: relativeOffsets.top + containingBlockAncestor.scrollTop,\n right: relativeOffsets.right - containingBlockAncestor.scrollLeft,\n bottom: relativeOffsets.bottom - containingBlockAncestor.scrollTop,\n left: relativeOffsets.left + containingBlockAncestor.scrollLeft,\n };\n }\n\n /** Apply positioning styles based on `position` parameter. */\n private applyPositionStyles(position: PopoverPosition, availableSpace: Offsets): void {\n const boundElementWidth = this.boundElement.offsetWidth;\n const boundElementHeight = this.boundElement.offsetHeight;\n const offsetModifier = this.offsetModifier;\n /**\n * Distance between the arrow center and the popover edge.\n * Needed to align the center of the arrow with the center of the bound element when `showArrow` and `center` are enabled.\n */\n const arrowModifier = this.showArrow && this.center ? 8 : 0;\n const hostStyle = this.host.style;\n /** Gap between the popover and the bound element, set as margin in CSS. */\n const distanceFromBound = parseFloat(getComputedStyle(this.host).marginTop.replace(\"px\", \"\")) || 0;\n const positionOffsets = this.computePositionOffsets();\n\n /**\n * Precomputed bases to reduce repeated arithmetic in the switch below.\n * They represent the bound element edges plus optional centering offsets.\n */\n const leftBase = positionOffsets.left + boundElementWidth * offsetModifier;\n const rightBase = positionOffsets.right + boundElementWidth * offsetModifier;\n const topBase = positionOffsets.top + boundElementHeight;\n const bottomBase = positionOffsets.bottom + boundElementHeight;\n const sideTopBase = positionOffsets.top + boundElementHeight * offsetModifier;\n const sideBottomBase = positionOffsets.bottom + boundElementHeight * offsetModifier;\n\n let maxWidth: number;\n let maxHeight: number;\n\n switch (position) {\n case PopoverPosition.TOP:\n case PopoverPosition.TOP_RIGHT:\n hostStyle.bottom = `${bottomBase}px`;\n hostStyle.left = `${leftBase - (position === PopoverPosition.TOP_RIGHT ? arrowModifier : 0)}px`;\n maxHeight = availableSpace.top - distanceFromBound;\n if (position === PopoverPosition.TOP_RIGHT) {\n maxWidth = availableSpace.right + boundElementWidth * offsetModifier;\n }\n break;\n\n case PopoverPosition.TOP_LEFT:\n hostStyle.right = `${rightBase - arrowModifier}px`;\n hostStyle.bottom = `${bottomBase}px`;\n maxWidth = availableSpace.left + boundElementWidth * offsetModifier;\n maxHeight = availableSpace.top - distanceFromBound;\n break;\n\n case PopoverPosition.BOTTOM:\n case PopoverPosition.BOTTOM_RIGHT:\n hostStyle.top = `${topBase}px`;\n hostStyle.left = `${leftBase - (position === PopoverPosition.BOTTOM_RIGHT ? arrowModifier : 0)}px`;\n maxHeight = availableSpace.bottom - distanceFromBound;\n if (position === PopoverPosition.BOTTOM_RIGHT) {\n maxWidth = availableSpace.right + boundElementWidth * offsetModifier;\n }\n break;\n\n case PopoverPosition.BOTTOM_LEFT:\n hostStyle.top = `${topBase}px`;\n hostStyle.right = `${rightBase - arrowModifier}px`;\n maxWidth = availableSpace.left + boundElementWidth * offsetModifier;\n maxHeight = availableSpace.bottom - distanceFromBound;\n break;\n\n case PopoverPosition.RIGHT:\n case PopoverPosition.RIGHT_BOTTOM:\n hostStyle.top = `${sideTopBase - (position === PopoverPosition.RIGHT_BOTTOM ? arrowModifier : 0)}px`;\n hostStyle.left = `${positionOffsets.left + boundElementWidth}px`;\n maxWidth = availableSpace.right - distanceFromBound;\n if (position === PopoverPosition.RIGHT) {\n maxHeight = availableSpace.top + availableSpace.bottom + boundElementHeight;\n } else {\n maxHeight = availableSpace.bottom + boundElementHeight * offsetModifier;\n }\n break;\n\n case PopoverPosition.RIGHT_TOP:\n hostStyle.bottom = `${sideBottomBase - arrowModifier}px`;\n hostStyle.left = `${positionOffsets.left + boundElementWidth}px`;\n maxWidth = availableSpace.right - distanceFromBound;\n maxHeight = availableSpace.top + boundElementHeight * offsetModifier;\n break;\n\n case PopoverPosition.LEFT:\n case PopoverPosition.LEFT_BOTTOM:\n hostStyle.top = `${sideTopBase - (position === PopoverPosition.LEFT_BOTTOM ? arrowModifier : 0)}px`;\n hostStyle.right = `${positionOffsets.right + boundElementWidth}px`;\n maxWidth = availableSpace.left - distanceFromBound;\n if (position === PopoverPosition.LEFT_BOTTOM) {\n maxHeight = availableSpace.bottom + boundElementHeight * offsetModifier;\n }\n break;\n\n case PopoverPosition.LEFT_TOP:\n hostStyle.right = `${positionOffsets.right + boundElementWidth}px`;\n hostStyle.bottom = `${sideBottomBase - arrowModifier}px`;\n maxWidth = availableSpace.left - distanceFromBound;\n maxHeight = availableSpace.top + boundElementHeight * offsetModifier;\n break;\n }\n\n if (getDevice() !== Device.MOBILE) {\n // Only force max sizes on non-mobile viewports\n Object.assign(hostStyle, {\n maxWidth: maxWidth ? `${maxWidth}px` : \"\",\n maxHeight: maxHeight ? `${maxHeight}px` : \"\",\n });\n }\n }\n\n /** Set the position of the popover. */\n private setPosition(): void {\n if (!this.boundElement) {\n return;\n }\n\n if (!isElementVisibleInContainer(this.boundElement, this.findScrollableAncestor(this.boundElement))) {\n // If the bound element is not visible, hide the popover too\n this.open = false;\n\n return;\n }\n\n Object.assign(this.host.style, {\n // Reset all positioning properties\n top: \"auto\",\n right: \"auto\",\n bottom: \"auto\",\n left: \"auto\",\n maxWidth: \"\",\n maxHeight: \"\",\n // Set initial visibility to hidden while calculating position...\n visibility: \"hidden\",\n });\n\n const availableSpace = this.calculateAvailableSpace();\n const position = this.getOptimalPopoverPosition(this.position, availableSpace);\n\n this.applyPositionStyles(position, availableSpace);\n this.currentPosition = position;\n this.positionChange.emit({position: this.currentPosition});\n\n // ...then restore the visibility\n this.host.style.visibility = \"visible\";\n }\n\n componentWillLoad(): void {\n this.validatePosition(this.position);\n }\n\n componentDidLoad(): void {\n this.findBoundElement();\n if (this.open) {\n this.onOpen();\n }\n }\n\n disconnectedCallback(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n }\n\n render(): H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KiB,MAAMO,WAAa,S,CAG/B,iBAAAyI,GACEhL,KAAKiB,iBAAiBjB,KAAKuB,S,CAG7B,gBAAA0J,GACEjL,KAAK6C,mBACL,GAAI7C,KAAKW,KAAM,CACbX,KAAK0B,Q,EAIT,oBAAAwJ,GACEvJ,qBAAqB3B,KAAK4B,wB,CAG5B,MAAAuJ,GACE,OACEC,EAACC,EAAI,CAAA9K,IAAA,8DAAmBP,KAAKwB,iBAC3B4J,EAAA,QAAA7K,IAAA,6C,oIA7nBkBR,EAAA2F,cAAmC,CACzDxF,EAAgBC,IAChBD,EAAgB4E,UAChB5E,EAAgB6E,SAChB7E,EAAgB8E,MAChB9E,EAAgB+E,aAChB/E,EAAgBgF,UAChBhF,EAAgBiF,OAChBjF,EAAgBkF,YAChBlF,EAAgBmF,aAChBnF,EAAgBoF,KAChBpF,EAAgBqF,SAChBrF,EAAgBsF,a","ignoreList":[]}
|
|
@@ -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-86618221.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-86618221.js";import{r as a}from"./p-061e28d6.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-35d73edf.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-86618221.js";import{f as e,d as c}from"./p-061e28d6.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:"1a7ea404cfe0bc4dcf7f60787b218cdf58f28a28",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-43adca09.entry.js.map
|
package/{dist/web-components-library/p-2d4cf6ff.entry.js.map → www/build/p-43adca09.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":[]}
|
|
@@ -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-86618221.js";import{B as o}from"./p-5145a606.js";import{r as s}from"./p-1a0c206d.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:"46b384be19cd2de4a07ca7962f4559af73f3b2ef",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-86618221.js";import{B as o}from"./p-5145a606.js";import{r as s}from"./p-061e28d6.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:"46b384be19cd2de4a07ca7962f4559af73f3b2ef",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-447a6391.entry.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as e,H as a,b as t}from"./p-75c4a726.js";export{s as setNonce}from"./p-75c4a726.js";import{g as o}from"./p-e1255160.js";var l=()=>{{i(a.prototype)}const t=import.meta.url;const o={};if(t!==""){o.resourcesUrl=new URL(".",t).href}return e(o)};var i=e=>{const a=e.cloneNode;e.cloneNode=function(e){if(this.nodeName==="TEMPLATE"){return a.call(this,e)}const t=a.call(this,false);const o=this.childNodes;if(e){for(let e=0;e<o.length;e++){if(o[e].nodeType!==2){t.appendChild(o[e].cloneNode(true))}}}return t}};l().then((async e=>{await o();return t(JSON.parse('[["p-05be939d",[[1,"z-app-header",{"stuck":[516],"enableOffcanvas":[1540,"enable-offcanvas"],"enableSearch":[516,"enable-search"],"searchPlaceholder":[1,"search-placeholder"],"searchString":[1025,"search-string"],"searchPageUrl":[1,"search-page-url"],"enableZLogo":[516,"enable-z-logo"],"drawerOpen":[1028,"drawer-open"],"_stuck":[32],"menuLength":[32],"isMobile":[32],"isTablet":[32]},[[5,"focusin","manageMenus"],[5,"click","manageMenus"],[1,"keydown","handleKeydown"]],{"_stuck":["onStuck"],"drawerOpen":["setMenuFloatingMode"],"stuck":["onStuckChange"]}],[1,"z-searchbar",{"htmlid":[513],"preventSubmit":[4,"prevent-submit"],"label":[1],"htmlAriaLabel":[1,"html-aria-label"],"value":[1],"placeholder":[1],"autocomplete":[4],"autocompleteMinChars":[2,"autocomplete-min-chars"],"resultsCount":[2,"results-count"],"searchHelperLabel":[1,"search-helper-label"],"resultsItems":[1,"results-items"],"sortResultsItems":[4,"sort-results-items"],"showSearchButton":[4,"show-search-button"],"searchButtonIconOnly":[4,"search-button-icon-only"],"size":[1],"variant":[1],"searchString":[32],"currResultsCount":[32],"showResults":[32],"isMobile":[32],"selectedItem":[32]},[[4,"click","handleOutsideClick"]],{"resultsItems":["watchItems"],"resultsCount":["watchResultsCount"],"value":["watchValue"],"searchString":["watchSearchString"],"showResults":["watchShowResults"]}],[6,"z-offcanvas",{"variant":[513],"open":[1540],"transitiondirection":[513],"skipLoadAnimation":[4,"skip-load-animation"],"showBackdrop":[4,"show-backdrop"],"skipAnimation":[32]},[[4,"keydown","handleKeyDown"],[2,"click","stopEvent"],[2,"focusin","stopEvent"]],{"variant":["handlePageOverflow"],"open":["onOpenChanged"]}],[6,"z-tag",{"icon":[1],"expandable":[4]}],[1,"z-list-group",{"size":[513],"dividerType":[513,"divider-type"],"dividerSize":[513,"divider-size"],"dividerColor":[513,"divider-color"],"listType":[513,"list-type"],"hasTreeItems":[4,"has-tree-items"],"role":[513]}],[1,"z-list",{"size":[513],"listType":[513,"list-type"],"role":[513]}],[1,"z-list-element",{"alignButton":[513,"align-button"],"clickable":[516],"dividerColor":[1,"divider-color"],"dividerType":[1,"divider-type"],"dividerSize":[1,"divider-size"],"expandable":[516],"expandableStyle":[1,"expandable-style"],"listElementId":[514,"list-element-id"],"size":[513],"color":[513],"disabled":[516],"listElementPosition":[513,"list-element-position"],"listType":[513,"list-type"],"hasTreeItems":[4,"has-tree-items"],"role":[513],"htmlTabindex":[2,"html-tabindex"],"showInnerContent":[32]},[[4,"accessibleFocus","accessibleFocusHandler"]]],[2,"z-input",{"htmlid":[1],"type":[1],"name":[1],"label":[1],"ariaLabel":[1,"aria-label"],"htmlAriaExpanded":[1,"html-aria-expanded"],"htmlAriaControls":[1,"html-aria-controls"],"htmlAriaAutocomplete":[1,"html-aria-autocomplete"],"htmlAriaActivedescendant":[1,"html-aria-activedescendant"],"value":[1025],"disabled":[516],"readonly":[4],"required":[4],"checked":[1028],"placeholder":[1],"htmltitle":[1],"status":[1],"message":[8],"labelPosition":[1,"label-position"],"autocomplete":[1],"role":[1],"hasclearicon":[4],"icon":[1],"min":[2],"minlength":[2],"max":[2],"maxlength":[2],"step":[2],"pattern":[1],"size":[513],"isTyping":[32],"passwordHidden":[32],"isChecked":[64]},[[4,"inputCheck","inputCheckListener"]]],[1,"z-input-message",{"message":[1],"status":[513],"disabled":[516],"statusRole":[32]},null,{"message":["onMessageChange"],"status":["onMessageChange"]}],[2,"z-divider",{"size":[1],"color":[1],"orientation":[1]}],[6,"z-button",{"ariaLabel":[1,"aria-label"],"role":[1],"htmlrole":[1],"href":[1],"target":[1],"htmlid":[1],"name":[1],"disabled":[516],"type":[1],"variant":[513],"icon":[1],"iconPosition":[513,"icon-position"],"size":[513]}],[1,"z-icon",{"name":[1],"height":[8],"width":[8],"iconid":[1],"fill":[1],"indicatorColor":[1,"indicator-color"]}]]],["p-6164feb9",[[1,"z-app-header-deprecated",{"stuck":[516],"hero":[1],"overlay":[516],"flow":[513],"drawerOpen":[516,"drawer-open"],"enableSearch":[516,"enable-search"],"searchPlaceholder":[1,"search-placeholder"],"searchString":[1025,"search-string"],"searchPageUrl":[1,"search-page-url"],"_stuck":[32],"currentViewport":[32],"menuLength":[32]},[[9,"resize","evaluateViewport"]],{"_stuck":["onStuck"],"drawerOpen":["setMenuFloatingMode"],"stuck":["onStuckMode"]}]]],["p-a8790237",[[2,"z-select",{"htmlid":[1],"items":[1],"name":[1],"label":[1],"ariaLabel":[1,"aria-label"],"disabled":[4],"readonly":[4],"placeholder":[1],"htmltitle":[1],"status":[1],"message":[8],"autocomplete":[4],"noresultslabel":[1],"hasGroupItems":[4,"has-group-items"],"hasTreeItems":[4,"has-tree-items"],"showChildrenOfMatchingParent":[4,"show-children-of-matching-parent"],"isfixed":[4],"resetItem":[1,"reset-item"],"size":[1],"isOpen":[32],"selectedItem":[32],"focusedItemId":[32],"searchString":[32],"getSelectedItem":[64],"getValue":[64],"setValue":[64]},null,{"items":["watchItems"]}]]],["p-9814f864",[[1,"z-breadcrumb",{"pathStyle":[513,"path-style"],"homepageVariant":[1,"homepage-variant"],"maxNodesToShow":[2,"max-nodes-to-show"],"preventFollowUrl":[4,"prevent-follow-url"],"overflowMenuItemRows":[2,"overflow-menu-item-rows"],"truncateChar":[2,"truncate-char"],"viewPortWidth":[32],"hasOverflow":[32],"popoverEllipsisOpen":[32]},[[9,"resize","handleResize"]],{"maxNodesToShow":["handlePropChange"],"viewPortWidth":["handleResizeUp"]}]]],["p-c3e03e41",[[1,"z-combobox",{"inputid":[1],"items":[1],"label":[1],"disabled":[516],"hassearch":[4],"searchlabel":[1],"searchplaceholder":[1],"searchtitle":[1],"noresultslabel":[1],"isopen":[1028],"isfixed":[4],"hascheckall":[4],"checkalltext":[1],"uncheckalltext":[1],"maxcheckableitems":[2],"hasgroupitems":[4],"size":[1],"htmlAriaLabel":[1,"html-aria-label"],"searchValue":[32],"selectedCounter":[32],"renderItemsList":[32],"focusedItemId":[32]},null,{"items":["watchItems"],"searchValue":["watchSearchValue"]}]]],["p-30a78a06",[[1,"z-myz-card-dictionary",{"name":[1],"cover":[1],"disabled":[4],"flipped":[1028],"flipbuttonlabel":[1],"hideinfobtn":[4]},[[0,"flipCard","handleFlipCard"]]]]],["p-88a9865c",[[6,"z-file-upload",{"type":[513],"buttonVariant":[1,"button-variant"],"acceptedFormat":[1,"accepted-format"],"fileMaxSize":[2,"file-max-size"],"mainTitle":[1,"main-title"],"description":[1],"uploadBtnLabel":[1,"upload-btn-label"],"dragAndDropLabel":[1,"drag-and-drop-label"],"allowedFilesMessage":[1,"allowed-files-message"],"uploadClickableMessage":[1,"upload-clickable-message"],"uploadMessage":[1,"upload-message"],"errorModalTitle":[1,"error-modal-title"],"errorModalMessage":[1,"error-modal-message"],"uploadedFilesLabel":[1,"uploaded-files-label"],"hasFileSection":[4,"has-file-section"],"inputName":[1,"input-name"],"showErrors":[4,"show-errors"],"_type":[32],"files":[32],"invalidFiles":[32],"input":[32],"getFiles":[64],"removeFile":[64]},[[0,"removeFile","onFileRemoved"],[0,"fileDropped","fileDroppedListener"]]]]],["p-41891d34",[[0,"z-pagination",{"label":[1],"navArrows":[4,"nav-arrows"],"totalPages":[2,"total-pages"],"skip":[2],"edges":[4],"split":[2],"visiblePages":[2,"visible-pages"],"currentPage":[1026,"current-page"],"goToPage":[4,"go-to-page"],"_visiblePages":[32],"isMobile":[32],"goToPageValue":[32]},[[9,"resize","onResize"]],{"_visiblePages":["setPagesContainerWidth"],"visiblePages":["setVisiblePages"],"currentPage":["onPageChanged"],"split":["onSplitChanged"]}]]],["p-a2ee659d",[[1,"z-tree-list",{"items":[1],"htmlAriaLabelledby":[513,"html-aria-labelledby"],"htmlSectionTitle":[513,"html-section-title"]},null,{"items":["watchItems"]}]]],["p-8503c87a",[[1,"z-book-card",{"variant":[513],"cover":[1],"operaTitle":[1,"opera-title"],"volumeTitle":[1,"volume-title"],"authors":[1],"isbn":[1],"isbnLabel":[1,"isbn-label"],"year":[1],"ebookUrl":[1,"ebook-url"],"linkTarget":[1,"link-target"],"fallbackCover":[1,"fallback-cover"],"hasMultipleCovers":[4,"has-multiple-covers"],"titleHtmlTag":[1,"title-html-tag"]}]]],["p-b421424f",[[1,"z-carousel",{"isLoading":[4,"is-loading"],"label":[1],"single":[516],"arrowsPosition":[513,"arrows-position"],"progressMode":[1,"progress-mode"],"fixedArrows":[516,"fixed-arrows"],"ghostLoadingHeight":[2,"ghost-loading-height"],"infinite":[4],"current":[32],"items":[32],"highlightedIndicator":[32],"canNavigatePrev":[32],"canNavigateNext":[32]},null,{"current":["onIndexChange"],"single":["onSingleModeChange"],"infinite":["onInfiniteModeChange"]}]]],["p-aaa96c12",[[4,"z-date-picker",{"datePickerId":[1,"date-picker-id"],"ariaLabel":[1,"aria-label"],"label":[1],"mode":[1],"name":[1],"value":[1],"flatpickrPosition":[32],"inputError":[32]},[[2,"keydown","handleKeyDown"]],{"mode":["setupPickers"]}]]],["p-ff89d630",[[2,"z-file",{"fileNumber":[2,"file-number"],"fileName":[1,"file-name"],"allowPopover":[32],"popoverVisible":[32]},[[1,"mouseover","onMouseOver"],[1,"mouseleave","onMouseLeave"],[0,"interactiveIconClick","onInteractiveIconClick"]]]]],["p-6e13aa8e",[[0,"z-range-picker",{"rangePickerId":[1,"range-picker-id"],"firstAriaLabel":[1,"first-aria-label"],"firstLabel":[1,"first-label"],"secondAriaLabel":[1,"second-aria-label"],"secondLabel":[1,"second-label"],"mode":[1],"firstPickerReadOnly":[4,"first-picker-read-only"],"lastPickerReadOnly":[4,"last-picker-read-only"],"firstPickerPlaceholder":[1,"first-picker-placeholder"],"lastPickerPlaceholder":[1,"last-picker-placeholder"],"flatpickrPosition":[32],"activeInput":[32],"firstInputError":[32],"lastInputError":[32]},[[18,"click","handleClick"],[18,"keyup","handleKeyDown"]],{"firstPickerReadOnly":["setupFirstPickersReadOnly"],"lastPickerReadOnly":["setupLastPickersReadOnly"],"mode":["setupPickers"]}]]],["p-82eeea83",[[1,"z-td",{"colspan":[2],"sticky":[516],"showMenu":[513,"show-menu"],"popoverPosition":[1,"popover-position"],"isMenuOpen":[32]},null,{"colspan":["updateColspan"]}]]],["p-efa6b991",[[1,"z-th",{"colspan":[2],"showMenu":[513,"show-menu"],"showSorting":[513,"show-sorting"],"sticky":[516],"sortDirection":[1025,"sort-direction"],"sorted":[1540],"popoverPosition":[1,"popover-position"],"isMenuOpen":[32]},null,{"colspan":["updateColspan"]}]]],["p-f2c2ad04",[[1,"z-tool",{"icon":[1],"tooltip":[1],"tooltipPosition":[1,"tooltip-position"],"htmlAriaLabel":[1,"html-aria-label"],"active":[516],"disabled":[516],"open":[1540],"indicatorColor":[1025,"indicator-color"],"tooltipOpen":[32],"hasSlottedContent":[32],"isMobile":[32],"hasNestedOpenTools":[32],"setFocus":[64],"setTabIndex":[64],"closeTooltip":[64]},[[0,"keydown","handleKeyDown"],[16,"click","onOutsideClick"],[0,"toggleSubmenu","onNestedToolToggle"],[0,"colorSelected","handleColorSelected"],[17,"focusin","handleExternalFocusin"]],{"open":["handleOpenChange"],"tooltipOpen":["handleTooltipOpenChange"]}]]],["p-47b59f05",[[4,"z-anchor-navigation",{"hideUnselected":[516,"hide-unselected"],"autoCurrent":[4,"auto-current"],"collapsedLabel":[1,"collapsed-label"],"isCollapsed":[516,"is-collapsed"],"collapsed":[32]}]]],["p-92f13701",[[1,"z-book-card-app",{"logo":[1],"name":[1],"link":[1],"laz":[4],"info":[1]}]]],["p-c811b0cf",[[1,"z-myz-card-alert",{"iconname":[1],"contenttext":[1],"actiontext":[1],"type":[1]}]]],["p-fbce9614",[[1,"z-myz-card-info",{"data":[1],"htmltabindex":[2],"hiddenContent":[32],"tooltip":[32]}]]],["p-4504375f",[[1,"z-myz-list",{"inputrawdata":[1],"list":[1040]},null,{"inputrawdata":["oninputrawdataChange"]}]]],["p-0aed3ddc",[[1,"z-otp",{"inputNum":[2,"input-num"],"status":[1],"message":[1]}]]],["p-31bd2a1c",[[1,"z-result-card",{"cardTitle":[1,"card-title"],"cardSubtitle":[1,"card-subtitle"],"authors":[1],"cover":[1],"fallbackCover":[1,"fallback-cover"],"hasMultipleCovers":[4,"has-multiple-covers"],"isInfoCard":[4,"is-info-card"],"titleHtmlTag":[1,"title-html-tag"]}]]],["p-32bc8a40",[[1,"z-accordion",{"label":[1],"icon":[1],"size":[513],"isDisabled":[516,"is-disabled"],"open":[1540],"highlight":[516],"variant":[513],"shadow":[516],"hasSlottedTags":[32]},null,{"isDisabled":["onDisabledChange"]}]]],["p-447a6391",[[1,"z-book-card-deprecated",{"variant":[1],"cover":[1],"operaTitle":[1,"opera-title"],"volumeTitle":[1,"volume-title"],"authors":[1],"isbn":[1],"isbnLabel":[1,"isbn-label"],"ribbon":[1],"ribbonIcon":[1,"ribbon-icon"],"ribbonInteractive":[4,"ribbon-interactive"],"borderless":[4],"fallbackCover":[1,"fallback-cover"],"operaTitleTag":[1,"opera-title-tag"],"isMobile":[32],"hasResources":[32],"showResources":[32]}]]],["p-7d655f96",[[1,"z-button-sort",{"buttonid":[1],"label":[1],"desclabel":[1],"counter":[2],"sortlabelasc":[1],"sortlabeldesc":[1],"isselected":[1028],"sortasc":[1028],"allowTooltip":[32]}]]],["p-66c0f993",[[1,"z-card",{"variant":[513],"coverIcon":[1,"cover-icon"],"showShadow":[516,"show-shadow"],"clickable":[516],"hasCoverImage":[32]}]]],["p-7a4f6a5b",[[1,"z-info-box",{"boxid":[1],"isclosable":[4]}]]],["p-a3f9a5da",[[1,"z-menu",{"active":[516],"floating":[516],"open":[1540],"verticalContext":[516,"vertical-context"],"htmlTabindex":[1026,"html-tabindex"],"hasHeader":[32],"hasContent":[32],"setFocus":[64],"focusLastItem":[64]},[[4,"click","onItemClick"],[0,"keydown","onKeyDown"]],{"open":["onOpenChanged"],"htmlTabindex":["setLabelA11yAttrs"]}]]],["p-6c6a655e",[[1,"z-menu-deprecated",{"active":[516],"floating":[516],"open":[1540],"verticalContext":[516,"vertical-context"],"hasHeader":[32],"hasContent":[32]},[[4,"click","handleClick"]],{"open":["onOpenChanged"]}]]],["p-93d349ee",[[1,"z-menu-section",{"active":[516],"htmlTabindex":[2,"html-tabindex"],"open":[1028],"hasItems":[32],"items":[32],"focusLastItem":[64],"setFocus":[64]},[[0,"keydown","onItemsKeydown"]],{"open":["onOpenChange"],"htmlTabindex":["onTabindexChange"]}]]],["p-9ae0c0c6",[[1,"z-menu-section-deprecated",{"active":[516],"open":[32],"hasContent":[32]},[[4,"click","handleClick"]]]]],["p-b7056859",[[1,"z-myz-card-icon",{"icon":[1],"isdisabled":[4],"ariaLabel":[1,"aria-label"]}]]],["p-f4b987ed",[[4,"z-navigation-tabs",{"ariaLabel":[1,"aria-label"],"orientation":[513],"size":[513],"selectedTab":[1026,"selected-tab"],"canNavigate":[32],"canNavigatePrev":[32],"canNavigateNext":[32]},[[0,"click","handleTabClick"],[0,"focusin","onTabFocusIn"],[0,"keydown","navigateThroughTabs"],[0,"focusout","onTabFocusOut"]],{"canNavigate":["checkScrollEnabled"],"selectedTab":["onTabSelected"]}]]],["p-c89e1f4b",[[1,"z-notification",{"contenticonname":[1],"actiontext":[1],"type":[513],"showclose":[4],"showshadow":[516],"sticky":[516]}]]],["p-5989465b",[[6,"z-panel-elem",{"elemid":[1],"imgurl":[1],"imgalt":[1],"linkicon":[1],"linklabel":[1],"url":[1],"target":[1],"isdisabled":[4],"descrSlotName":[1,"descr-slot-name"]}]]],["p-252893a8",[[1,"z-section-title",{"dividerPosition":[1,"divider-position"],"uppercase":[516]}]]],["p-b0324c7d",[[1,"z-slideshow",{"slideshowid":[1],"data":[1],"device":[32],"currentSlide":[32]},null,{"data":["watchData"]}]]],["p-b7ec2cc4",[[1,"z-stepper-item",{"index":[514],"href":[513],"pressed":[516],"checked":[516],"disabled":[516]}]]],["p-e8eacbeb",[[1,"z-toast-notification",{"heading":[1],"message":[1],"closebutton":[4],"autoclose":[2],"pauseonfocusloss":[4],"type":[1],"isdraggable":[4],"draggablepercentage":[2],"transition":[1],"percentage":[32],"hasSlottedButton":[32]},null,{"isdraggable":["watchPropIsdraggable"],"autoclose":["watchPropAutoclose"],"pauseonfocusloss":["watchPropPauseonfocusloss"]}]]],["p-b391211f",[[1,"z-toggle-button",{"label":[1],"isdisabled":[4],"avoidclick":[4],"opened":[1028],"ariaLabel":[1,"aria-label"]}]]],["p-35d73edf",[[6,"z-toggle-switch",{"disabled":[516],"labelPosition":[513,"label-position"],"checked":[1028],"htmlid":[1]}]]],["p-f7e65eb0",[[1,"z-tr",{"expandable":[516],"expanded":[32],"expandableContentId":[32]},[[0,"colspanchange","updateColumns"]],{"expandable":["updateColumns"]}]]],["p-da3abb97",[[4,"z-aria-alert",{"mode":[1]}]]],["p-c9b81cab",[[1,"z-avatar",{"size":[1],"text":[1],"textColor":[1,"text-color"],"backgroundColor":[1,"background-color"],"image":[1025]}]]],["p-bd76ca35",[[1,"z-color-picker",{"selectedColor":[1025,"selected-color"],"lng":[1],"htmlAriaLabel":[1,"html-aria-label"],"disableTransparent":[4,"disable-transparent"],"setFocus":[64]},[[0,"focus","setFocus"],[0,"keydown","handleKeyDown"],[0,"blur","handleBlur"]],{"disableTransparent":["validateTransparentSelection"],"selectedColor":["validateTransparentSelection","emitColorSelected"]}]]],["p-8fd50cc5",[[1,"z-cover-hero",{"variant":[513],"contentPosition":[513,"content-position"],"preserveAspectRatio":[516,"preserve-aspect-ratio"]},[[2,"load","onImgLoad"]]]]],["p-943db3a8",[[1,"z-logo",{"width":[2],"height":[2],"imageAlt":[1,"image-alt"],"link":[1],"targetBlank":[4,"target-blank"],"mobileLogo":[4,"mobile-logo"]}]]],["p-76d1d0e4",[[1,"z-myz-card-footer",{"titolo":[1],"autori":[1],"isbn":[1],"faded":[4],"cardtype":[1],"opened":[4],"customContent":[4,"custom-content"],"isOpen":[32],"allowTooltipAuthors":[32]},[[0,"toggleClick","handleToggle"]]]]],["p-f92e0c29",[[1,"z-myz-card-footer-sections"]]],["p-8988eee3",[[1,"z-myz-card-list",{"listdata":[1]}]]],["p-43adca09",[[2,"z-skip-to-content",{"variant":[513],"links":[1025],"visible":[32],"visibleLink":[32]},[[4,"focusout","handleFocusOutSkipToContent"],[4,"focusin","handleFocusSkipToContent"]]]]],["p-b71a3f69",[[1,"z-stepper"]]],["p-ec1270db",[[1,"z-table",{"bordered":[516],"expandable":[32]}]]],["p-988a58dd",[[1,"z-tbody"]]],["p-3977b0ae",[[1,"z-tfoot",{"sticky":[516]}]]],["p-42abfe3b",[[1,"z-thead",{"sticky":[516],"isFocusable":[516,"is-focusable"]}]]],["p-accbc381",[[1,"z-toast-notification-list",{"position":[513],"newestontop":[4]},null,{"newestontop":["watchPropNewestontop"]}]]],["p-b54d923e",[[1,"z-toolbar",{"htmlAriaLabel":[1,"html-aria-label"],"currentFocusIndex":[32]},[[0,"toggleSubmenu","closeSiblingSubmenusOnOpen"],[0,"toggleTooltip","closeSiblingTooltipsOnOpen"],[0,"keydown","handleKeyDown"],[0,"focusin","handleFocusIn"]]]]],["p-8c52635e",[[1,"z-visually-hidden"]]],["p-cbc09112",[[6,"z-chip",{"icon":[1],"type":[513],"interactiveIcon":[513,"interactive-icon"],"disabled":[516],"ariaLabel":[1,"aria-label"]}]]],["p-a4d2cf55",[[1,"z-info-reveal",{"icon":[1],"position":[513],"label":[1],"ariaLabel":[1,"aria-label"],"size":[513],"open":[32]},[[9,"resize","adjustPanelPosition"],[10,"keydown","handleEscapeKey"]],{"position":["adjustPanelPosition"],"open":["adjustPanelPosition"]}]]],["p-869295ce",[[1,"z-myz-list-item",{"text":[1],"link":[1],"linktarget":[1],"icon":[1],"listitemid":[1],"action":[1],"underlined":[4]}]]],["p-6d15da6f",[[1,"z-tooltip",{"position":[513],"dark":[516],"open":[1540],"bindTo":[1,"bind-to"],"closable":[4]},[[0,"openChange","onPopoverOpenChange"]]]]],["p-f662e7ff",[[1,"z-alert",{"type":[1]}]]],["p-767b66ca",[[1,"z-ghost-loading"]]],["p-565c1815",[[1,"z-dragdrop-area",{"dragAndDropLabel":[1,"drag-and-drop-label"],"dragging":[32]}],[1,"z-modal",{"modalid":[1],"modaltitle":[1],"modalsubtitle":[1],"closeButtonLabel":[1,"close-button-label"],"alertdialog":[4],"closable":[4],"scrollInside":[4,"scroll-inside"],"lockPageScroll":[4,"lock-page-scroll"],"open":[64],"close":[64]},[[0,"keydown","handleKeyDown"]]]]],["p-6c9cd6be",[[1,"z-book-cover",{"cover":[1],"fallbackCover":[1,"fallback-cover"],"multiple":[516],"bordered":[516]}]]],["p-0643d684",[[1,"z-myz-card",{"faded":[4],"cardtype":[1],"ispressed":[4],"ishighlighted":[4]}],[1,"z-myz-card-body"],[1,"z-myz-card-cover",{"img":[1],"titolo":[1],"faded":[4],"defaultimg":[1]}],[1,"z-myz-card-header",{"titolo":[1],"faded":[4],"cardtype":[1],"allowTooltip":[32]}]]],["p-1b972597",[[1,"z-popover",{"position":[1537],"open":[1540],"bindTo":[1,"bind-to"],"showArrow":[516,"show-arrow"],"center":[516],"closable":[4],"currentPosition":[32]},[[10,"keyup","closePopoverWithKeyboard"],[18,"click","handleOutsideClick"]],{"position":["validatePosition"],"open":["onOpen"],"bindTo":["onBindingChange"]}]]]]'),e)}));
|
|
2
|
+
//# sourceMappingURL=web-components-library.esm.js.map
|