@zanichelli/albe-web-components 19.2.6-RC2 → 19.2.7
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 +21 -0
- package/dist/cjs/{iconset-Bcbz2MS1.js → iconset-oiCBBbd2.js} +15 -3
- package/dist/cjs/index-D_S5lGcb.js +4 -4
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-alert.cjs.entry.js +1 -1
- package/dist/cjs/z-app-header_12.cjs.entry.js +127 -199
- package/dist/cjs/z-combobox.cjs.entry.js +5 -3
- package/dist/cjs/z-myz-card-alert.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-dictionary.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-footer-sections.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-footer.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-icon.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-info.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-list.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card_4.cjs.entry.js +4 -4
- package/dist/cjs/z-myz-list-item.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-list.cjs.entry.js +1 -1
- package/dist/cjs/z-otp.cjs.entry.js +2 -2
- package/dist/cjs/z-pagination.cjs.entry.js +2 -2
- package/dist/cjs/z-skip-to-content.cjs.entry.js +1 -1
- package/dist/cjs/z-stepper-item.cjs.entry.js +1 -1
- package/dist/cjs/z-stepper.cjs.entry.js +1 -1
- package/dist/cjs/z-td.cjs.entry.js +3 -3
- package/dist/cjs/z-th.cjs.entry.js +5 -3
- package/dist/cjs/z-toast-notification-list.cjs.entry.js +1 -1
- package/dist/cjs/z-toast-notification.cjs.entry.js +3 -3
- package/dist/cjs/z-toggle-button.cjs.entry.js +2 -2
- package/dist/cjs/z-toggle-switch.cjs.entry.js +3 -3
- package/dist/cjs/z-tool.cjs.entry.js +2 -2
- package/dist/cjs/z-toolbar.cjs.entry.js +1 -1
- package/dist/cjs/z-tooltip.cjs.entry.js +1 -1
- package/dist/collection/components/css-components/z-scrollbar/styles.css +40 -0
- package/dist/collection/components/table/cells/{z-td/styles.css → z-table-cells.css} +0 -1
- package/dist/collection/components/table/cells/z-td/index.js +3 -3
- package/dist/collection/components/table/cells/z-th/index.js +3 -3
- package/dist/collection/components/table/cells/z-th/styles.css +0 -72
- package/dist/collection/components/z-combobox/index.js +3 -3
- package/dist/collection/components/z-combobox/styles.css +0 -12
- package/dist/collection/components/z-input/index.js +3 -3
- package/dist/collection/components/z-input/styles-checkbox-radio.css +130 -0
- package/dist/collection/components/z-input/styles-general.css +166 -0
- package/dist/collection/components/z-input/styles-text.css +87 -0
- package/dist/collection/components/z-input/styles-textarea.css +19 -0
- package/dist/collection/components/z-pagination/index.js +2 -2
- package/dist/collection/components/z-searchbar/index.js +111 -193
- package/dist/collection/components/z-searchbar/index.stories.js +3 -16
- package/dist/collection/components/z-searchbar/styles.css +87 -201
- package/dist/collection/components/z-skip-to-content/index.js +1 -1
- package/dist/collection/components/z-stepper/index.js +1 -1
- package/dist/collection/components/z-stepper-item/index.js +1 -1
- package/dist/collection/components/z-toast-notification/index.js +3 -3
- package/dist/collection/components/z-toast-notification-list/index.js +1 -1
- package/dist/collection/components/z-toggle-button/index.js +2 -2
- package/dist/collection/components/z-toggle-switch/index.js +3 -3
- package/dist/collection/components/z-tool/index.js +3 -3
- package/dist/collection/components/z-toolbar/index.js +1 -1
- package/dist/collection/components/z-tooltip/index.js +1 -1
- package/dist/collection/constants/iconset.js +15 -3
- package/dist/collection/snowflakes/myz/card/z-myz-card/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-alert/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-body/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-cover/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer-sections/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-header/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-icon/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-info/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-list/index.js +1 -1
- package/dist/collection/snowflakes/myz/list/z-myz-list/index.js +1 -1
- package/dist/collection/snowflakes/myz/list/z-myz-list-item/index.js +1 -1
- package/dist/collection/snowflakes/myz/z-alert/index.js +1 -1
- package/dist/collection/snowflakes/myz/z-otp/index.js +2 -2
- package/dist/components/iconset.js +1 -1
- package/dist/components/index13.js +1 -1
- package/dist/components/index22.js +1 -1
- package/dist/components/index23.js +1 -1
- package/dist/components/index24.js +1 -1
- package/dist/components/index25.js +1 -1
- package/dist/components/index26.js +1 -1
- package/dist/components/index27.js +1 -1
- package/dist/components/index4.js +1 -1
- package/dist/components/index7.js +1 -1
- package/dist/components/z-combobox.js +1 -1
- package/dist/components/z-myz-card-alert.js +1 -1
- package/dist/components/z-myz-card-dictionary.js +1 -1
- package/dist/components/z-myz-card-footer-sections.js +1 -1
- package/dist/components/z-myz-card-footer.js +1 -1
- package/dist/components/z-myz-card-icon.js +1 -1
- package/dist/components/z-myz-card-info.js +1 -1
- package/dist/components/z-myz-card-list.js +1 -1
- package/dist/components/z-myz-list.js +1 -1
- package/dist/components/z-otp.js +1 -1
- package/dist/components/z-pagination.js +1 -1
- package/dist/components/z-skip-to-content.js +1 -1
- package/dist/components/z-stepper-item.js +1 -1
- package/dist/components/z-stepper.js +1 -1
- package/dist/components/z-td.js +1 -1
- package/dist/components/z-th.js +1 -1
- package/dist/components/z-toast-notification-list.js +1 -1
- package/dist/components/z-toast-notification.js +1 -1
- package/dist/components/z-toggle-button.js +1 -1
- package/dist/components/z-toggle-switch.js +1 -1
- package/dist/components/z-tool.js +1 -1
- package/dist/components/z-toolbar.js +1 -1
- package/dist/esm/{iconset-BanpkIXZ.js → iconset-CjHS9zeM.js} +15 -3
- package/dist/esm/index-DPdXlnVe.js +4 -4
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-0PByxJyN.js → utils-DYd3kO0P.js} +1 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-alert.entry.js +1 -1
- package/dist/esm/z-app-header_12.entry.js +129 -201
- package/dist/esm/z-book-card-deprecated.entry.js +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 +6 -4
- package/dist/esm/z-menu.entry.js +1 -1
- package/dist/esm/z-myz-card-alert.entry.js +1 -1
- package/dist/esm/z-myz-card-dictionary.entry.js +1 -1
- package/dist/esm/z-myz-card-footer-sections.entry.js +1 -1
- package/dist/esm/z-myz-card-footer.entry.js +1 -1
- package/dist/esm/z-myz-card-icon.entry.js +1 -1
- package/dist/esm/z-myz-card-info.entry.js +2 -2
- package/dist/esm/z-myz-card-list.entry.js +1 -1
- package/dist/esm/z-myz-card_4.entry.js +4 -4
- package/dist/esm/z-myz-list-item.entry.js +2 -2
- package/dist/esm/z-myz-list.entry.js +1 -1
- package/dist/esm/z-otp.entry.js +2 -2
- package/dist/esm/z-pagination.entry.js +2 -2
- package/dist/esm/z-popover.entry.js +1 -1
- package/dist/esm/z-select.entry.js +1 -1
- package/dist/esm/z-skip-to-content.entry.js +2 -2
- package/dist/esm/z-slideshow.entry.js +1 -1
- package/dist/esm/z-stepper-item.entry.js +1 -1
- package/dist/esm/z-stepper.entry.js +1 -1
- package/dist/esm/z-table.entry.js +1 -1
- package/dist/esm/z-td.entry.js +3 -3
- package/dist/esm/z-th.entry.js +5 -3
- package/dist/esm/z-toast-notification-list.entry.js +1 -1
- package/dist/esm/z-toast-notification.entry.js +3 -3
- package/dist/esm/z-toggle-button.entry.js +2 -2
- package/dist/esm/z-toggle-switch.entry.js +4 -4
- package/dist/esm/z-tool.entry.js +3 -3
- package/dist/esm/z-toolbar.entry.js +1 -1
- package/dist/esm/z-tooltip.entry.js +1 -1
- package/dist/esm/z-tr.entry.js +1 -1
- package/dist/types/components/z-searchbar/index.d.ts +24 -28
- package/dist/types/components.d.ts +14 -14
- package/dist/types/constants/iconset.d.ts +30 -6
- package/dist/web-components-library/index.esm.js +1 -1
- package/dist/web-components-library/p-087956fa.entry.js +1 -0
- package/dist/web-components-library/{p-5fa910e4.entry.js → p-13e7f751.entry.js} +1 -1
- package/dist/web-components-library/{p-2ce3ac48.entry.js → p-14b804f9.entry.js} +1 -1
- package/dist/web-components-library/{p-45866f64.entry.js → p-1580db58.entry.js} +1 -1
- package/{www/build/p-eed4e897.entry.js → dist/web-components-library/p-1d023220.entry.js} +1 -1
- package/dist/web-components-library/{p-de0b7109.entry.js → p-299f0f85.entry.js} +1 -1
- package/dist/web-components-library/{p-d11d39f5.entry.js → p-2c036e17.entry.js} +1 -1
- package/dist/web-components-library/{p-5b9cacd7.entry.js → p-2df6d169.entry.js} +1 -1
- package/dist/web-components-library/{p-550ee6c3.entry.js → p-37e84b71.entry.js} +1 -1
- package/dist/web-components-library/{p-6fb8a984.entry.js → p-3ea03d34.entry.js} +1 -1
- package/dist/web-components-library/p-41584e90.entry.js +1 -0
- package/dist/web-components-library/p-53670be4.entry.js +1 -0
- package/dist/web-components-library/{p-7d9477ed.entry.js → p-583b8152.entry.js} +1 -1
- package/dist/web-components-library/{p-538a1bd2.entry.js → p-5d20fc3d.entry.js} +1 -1
- package/dist/web-components-library/{p-364b0ca4.entry.js → p-658f022d.entry.js} +1 -1
- package/dist/web-components-library/{p-f94c360f.entry.js → p-788eaac7.entry.js} +1 -1
- package/dist/web-components-library/{p-a40ae683.entry.js → p-8261c869.entry.js} +1 -1
- package/{www/build/p-4ae7df7f.entry.js → dist/web-components-library/p-83da1031.entry.js} +1 -1
- package/{www/build/p-c6920758.entry.js → dist/web-components-library/p-85cac60d.entry.js} +1 -1
- package/dist/web-components-library/{p-c6ae9241.entry.js → p-88a3ba7c.entry.js} +1 -1
- package/dist/web-components-library/{p-e2d94c86.entry.js → p-8a8df4f4.entry.js} +1 -1
- package/dist/web-components-library/{p-ab50e989.entry.js → p-8b026993.entry.js} +1 -1
- package/dist/web-components-library/{p-8fd25c59.entry.js → p-9d15ecdf.entry.js} +1 -1
- package/dist/web-components-library/{p-D4yqZKyM.js → p-CPsEG702.js} +1 -1
- package/dist/web-components-library/p-CjHS9zeM.js +1 -0
- package/dist/web-components-library/{p-f5bbcaa6.entry.js → p-a4f673f8.entry.js} +1 -1
- package/dist/web-components-library/{p-2d6a4515.entry.js → p-b6223d7e.entry.js} +1 -1
- package/dist/web-components-library/{p-7835fdda.entry.js → p-b9343431.entry.js} +1 -1
- package/dist/web-components-library/{p-c539ae57.entry.js → p-c42ddd93.entry.js} +1 -1
- package/{www/build/p-eadf2552.entry.js → dist/web-components-library/p-c4e7bd16.entry.js} +1 -1
- package/dist/web-components-library/{p-3f996a63.entry.js → p-c944a943.entry.js} +1 -1
- package/dist/web-components-library/{p-19f5fdd3.entry.js → p-cd33f4b1.entry.js} +1 -1
- package/dist/web-components-library/p-d10e6b1a.entry.js +1 -0
- package/dist/web-components-library/p-dc5ab2cc.entry.js +1 -0
- package/dist/web-components-library/p-e48497f0.entry.js +1 -0
- package/dist/web-components-library/{p-19d3a16b.entry.js → p-eddc2d19.entry.js} +1 -1
- package/dist/web-components-library/{p-91503030.entry.js → p-ef5018bb.entry.js} +1 -1
- package/dist/web-components-library/{p-7a9d19b8.entry.js → p-f7e46ef2.entry.js} +1 -1
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/package.json +2 -3
- package/www/build/index.esm.js +1 -1
- package/www/build/p-087956fa.entry.js +1 -0
- package/www/build/{p-5fa910e4.entry.js → p-13e7f751.entry.js} +1 -1
- package/www/build/{p-2ce3ac48.entry.js → p-14b804f9.entry.js} +1 -1
- package/www/build/{p-45866f64.entry.js → p-1580db58.entry.js} +1 -1
- package/{dist/web-components-library/p-eed4e897.entry.js → www/build/p-1d023220.entry.js} +1 -1
- package/www/build/{p-38f551b0.js → p-23143b48.js} +1 -1
- package/www/build/{p-de0b7109.entry.js → p-299f0f85.entry.js} +1 -1
- package/www/build/{p-d11d39f5.entry.js → p-2c036e17.entry.js} +1 -1
- package/www/build/{p-5b9cacd7.entry.js → p-2df6d169.entry.js} +1 -1
- package/www/build/{p-550ee6c3.entry.js → p-37e84b71.entry.js} +1 -1
- package/www/build/{p-6fb8a984.entry.js → p-3ea03d34.entry.js} +1 -1
- package/www/build/p-41584e90.entry.js +1 -0
- package/www/build/p-53670be4.entry.js +1 -0
- package/www/build/{p-7d9477ed.entry.js → p-583b8152.entry.js} +1 -1
- package/www/build/{p-538a1bd2.entry.js → p-5d20fc3d.entry.js} +1 -1
- package/www/build/{p-364b0ca4.entry.js → p-658f022d.entry.js} +1 -1
- package/www/build/{p-f94c360f.entry.js → p-788eaac7.entry.js} +1 -1
- package/www/build/{p-a40ae683.entry.js → p-8261c869.entry.js} +1 -1
- package/{dist/web-components-library/p-4ae7df7f.entry.js → www/build/p-83da1031.entry.js} +1 -1
- package/{dist/web-components-library/p-c6920758.entry.js → www/build/p-85cac60d.entry.js} +1 -1
- package/www/build/{p-c6ae9241.entry.js → p-88a3ba7c.entry.js} +1 -1
- package/www/build/{p-e2d94c86.entry.js → p-8a8df4f4.entry.js} +1 -1
- package/www/build/{p-ab50e989.entry.js → p-8b026993.entry.js} +1 -1
- package/www/build/{p-8fd25c59.entry.js → p-9d15ecdf.entry.js} +1 -1
- package/www/build/{p-D4yqZKyM.js → p-CPsEG702.js} +1 -1
- package/www/build/p-CjHS9zeM.js +1 -0
- package/www/build/{p-f5bbcaa6.entry.js → p-a4f673f8.entry.js} +1 -1
- package/www/build/{p-2d6a4515.entry.js → p-b6223d7e.entry.js} +1 -1
- package/www/build/{p-7835fdda.entry.js → p-b9343431.entry.js} +1 -1
- package/www/build/{p-c539ae57.entry.js → p-c42ddd93.entry.js} +1 -1
- package/{dist/web-components-library/p-eadf2552.entry.js → www/build/p-c4e7bd16.entry.js} +1 -1
- package/www/build/{p-3f996a63.entry.js → p-c944a943.entry.js} +1 -1
- package/www/build/{p-19f5fdd3.entry.js → p-cd33f4b1.entry.js} +1 -1
- package/www/build/p-d10e6b1a.entry.js +1 -0
- package/www/build/p-dc5ab2cc.entry.js +1 -0
- package/www/build/p-e48497f0.entry.js +1 -0
- package/www/build/{p-19d3a16b.entry.js → p-eddc2d19.entry.js} +1 -1
- package/www/build/{p-91503030.entry.js → p-ef5018bb.entry.js} +1 -1
- package/www/build/{p-7a9d19b8.entry.js → p-f7e46ef2.entry.js} +1 -1
- package/www/build/web-components-library.esm.js +1 -1
- package/www/index.html +1 -1
- package/dist/collection/components/z-input/styles.css +0 -406
- package/dist/web-components-library/p-2b7ceab2.entry.js +0 -1
- package/dist/web-components-library/p-BanpkIXZ.js +0 -1
- package/dist/web-components-library/p-a9d90b04.entry.js +0 -1
- package/dist/web-components-library/p-a9f848ef.entry.js +0 -1
- package/dist/web-components-library/p-ae69bb7d.entry.js +0 -1
- package/dist/web-components-library/p-f3436721.entry.js +0 -1
- package/dist/web-components-library/p-fc15a666.entry.js +0 -1
- package/www/build/p-2b7ceab2.entry.js +0 -1
- package/www/build/p-BanpkIXZ.js +0 -1
- package/www/build/p-a9d90b04.entry.js +0 -1
- package/www/build/p-a9f848ef.entry.js +0 -1
- package/www/build/p-ae69bb7d.entry.js +0 -1
- package/www/build/p-f3436721.entry.js +0 -1
- package/www/build/p-fc15a666.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as
|
|
1
|
+
import{r as t,h as a}from"./p-DPdXlnVe.js";const n=class{constructor(a){t(this,a),this.renderList=this.renderList.bind(this)}handleSpaceKeyPress(t,a){32!=t.keyCode&&13!=t.keyCode||(t.preventDefault(),window.open(a,"_blank"))}formatListContent(t){const{value:n,isLink:e,url:r}=t;return e?a("a",{role:"button",onKeyPress:t=>this.handleSpaceKeyPress(t,r),href:r,target:"_blank"},n):a("span",null,n)}renderList(t){return t.map((t=>a("li",null,this.formatListContent(t))))}render(){return a("ul",{key:"7ed6a040b79c3ea63fc94c941dcf31b8d220aea5"},this.renderList(JSON.parse(this.listdata)))}};n.style='*:focus{box-shadow:var(--shadow-focus-primary);outline:none !important}ul{overflow:hidden;width:auto;height:auto;padding:0;margin:0 calc(var(--space-unit) * 2);color:var(--color-primary01);font-family:var(--font-family-sans);list-style:none}ul>li{padding-left:10px;text-indent:-10px}ul>li>a{display:block;padding-top:calc(var(--space-unit) * 0.5);color:var(--color-primary01);font-size:14px;font-weight:var(--font-sb);letter-spacing:0.16px;line-height:calc(var(--space-unit) * 2.5);text-decoration:none}ul>li>a::before{padding-right:5px;content:"•"}ul>li>span{padding:0 calc(var(--space-unit) * 2);color:var(--color-surface04);font-size:14px;font-weight:var(--font-rg);letter-spacing:0.16px;line-height:calc(var(--space-unit) * 2.5);text-decoration:none}';export{n as z_myz_card_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,h as
|
|
1
|
+
import{r,h as a}from"./p-DPdXlnVe.js";const o=class{constructor(a){r(this,a),this.isdisabled=!1,this.ariaLabel=""}render(){return a("button",{key:"07cb991da26a22d55fb6cca776a5ef0208d53311",disabled:this.isdisabled,"aria-label":this.ariaLabel},a("span",{key:"6f71110aba5937ec76b6916cb4fdec52856af097"},a("z-icon",{key:"b01cbee366497b8b3d27f997e884f8be5a14e6fb",name:this.icon,width:16,height:16})))}};o.style="button{display:flex;width:42px;width:calc(var(--space-unit) * 6);height:calc(var(--space-unit) * 5);height:calc(var(--space-unit) * 6);align-items:center;justify-content:center;padding:0;border:none;border-left:var(--border-size-medium) solid var(--color-surface03);margin:0;background:none;border-radius:0 var(--border-radius) 0 0;color:var(--color-primary01);cursor:pointer;fill:var(--color-primary01);outline:none}button:active,button:focus{color:var(--blue700);fill:var(--blue700)}button>span{display:flex;width:28px;height:28px;align-items:center;justify-content:center;border:0;border-radius:var(--border-radius)}button:hover>span{background:var(--color-primary03)}button:focus>span{background:var(--color-surface01);border-radius:var(--border-radius);box-shadow:var(--shadow-focus-primary)}button:active>span{background:var(--color-surface01);border-radius:var(--border-radius);box-shadow:var(--shadow-2)}button:disabled{cursor:not-allowed}button:disabled>span{background:none;box-shadow:var(--shadow-0);pointer-events:none}button:disabled>span>z-icon{fill:var(--color-surface03)}button::-moz-focus-inner{border:0}";export{o as z_myz_card_icon}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,c as t,h as e}from"./p-DPdXlnVe.js";import{P as r}from"./p-BKCj6NR2.js";const p=class{constructor(e){o(this,e),this.openChange=t(this,"openChange",7),this.position=r.AUTO,this.dark=!1,this.open=!1,this.closable=!0}onPopoverOpenChange(){this.open=this.popoverEl.open}render(){return e("z-popover",{key:"
|
|
1
|
+
import{r as o,c as t,h as e}from"./p-DPdXlnVe.js";import{P as r}from"./p-BKCj6NR2.js";const p=class{constructor(e){o(this,e),this.openChange=t(this,"openChange",7),this.position=r.AUTO,this.dark=!1,this.open=!1,this.closable=!0}onPopoverOpenChange(){this.open=this.popoverEl.open}render(){return e("z-popover",{key:"0cc1e8ea0e6896f5031309a5984c09df4b095d8b",ref:o=>this.popoverEl=o,bindTo:this.bindTo,open:this.open,position:this.position,closable:this.closable,center:!0,showArrow:!0,onOpenChange:o=>this.openChange.emit(o.detail)},e("slot",{key:"a0548343b099fe7986066d821a455f1092428b38"}))}};p.style=":host{--z-tooltip-theme--surface:var(--color-surface01);--z-tooltip-theme--text:var(--color-default-text);--z-tooltip-shadow-filter:drop-shadow(0 1px 2px var(--shadow-color-base));--z-tooltip-padding:var(--space-unit)}z-popover{--z-popover-theme--surface:var(--z-tooltip-theme--surface);--z-popover-theme--text:var(--z-tooltip-theme--text);--z-popover-padding:var(--z-tooltip-padding);--z-popover-shadow-filter:var(--z-tooltip-shadow-filter)}:host([dark]) z-popover{--z-popover-theme--surface:var(--color-surface05);--z-popover-theme--text:var(--color-text-inverse)}";export{p as z_tooltip}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,c as t,h as o,H as e,d as a}from"./p-DPdXlnVe.js";import{a0 as s}from"./p-BKCj6NR2.js";import{a as i}from"./p-
|
|
1
|
+
import{r,c as t,h as o,H as e,d as a}from"./p-DPdXlnVe.js";import{a0 as s}from"./p-BKCj6NR2.js";import{a as i}from"./p-CPsEG702.js";import"./p-Q-tWjk7P.js";const c={it:{"Select a color":"Seleziona un colore","Color swatch":"Campione di colore"},en:{"Select a color":"Select a color","Color swatch":"Color swatch"}},l=class{constructor(o){r(this,o),this.colorSelected=t(this,"colorSelected",7),this.lng="it",this.disableTransparent=!1,this.colorKeysByRow=[],this._colorButtons=[]}get colorButtons(){return this._colorButtons.length||(this._colorButtons=Array.from(this.host.shadowRoot.querySelectorAll("button"))),this._colorButtons}sortColorKeysByRow(){const r=Object.keys(s),t=[];for(let o=0;o<5;o++)for(let e=0;e<9;e++){const a=5*e+o;a<r.length&&t.push(r[a])}return t}moveFocusTo(r){this.colorButtons.forEach(((t,o)=>t.tabIndex=o===r?0:-1)),this.colorButtons[r].focus()}validateTransparentSelection(){this.disableTransparent&&"#FFFFFF00"===this.selectedColor&&(this.selectedColor="#333333")}emitColorSelected(){this.colorSelected.emit(this.selectedColor)}async setFocus(){this.colorButtons.forEach((r=>r.tabIndex=-1));const r=this.colorButtons.find((r=>"true"===r.ariaSelected))||this.colorButtons.find((r=>!r.disabled));r&&(r.tabIndex=0,setTimeout((()=>{r.focus()}),50),this.host.tabIndex=-1)}getNextIndexByKey(r,t,o){const e=Math.floor(r/9),a=r%9;let s=r;switch(t){case"ArrowRight":{const r=a+1;s=9*(r>=9?(e+1)%5:e)+r%9,s>=o&&(s=0);break}case"ArrowLeft":{const r=a-1;s=9*(r<0?(e-1+5)%5:e)+(r+9)%9,s>=o&&(s=o-1);break}case"ArrowDown":{let r=e+1,t=a;r>=5&&(r=0,t=(a+1)%9),s=9*r+t,s>=o&&(s=0);break}case"ArrowUp":{let r=e-1,t=a;r<0&&(r=4,t=(a-1+9)%9),s=9*r+t,s>=o&&(s=o-1);break}}return s}handleKeyDown(r){var t,o;const e=r.composedPath()[0];if(!e.dataset.color)return;const a=this.colorButtons.indexOf(e),s=this.colorButtons.length;if(a<0||!["ArrowRight","ArrowLeft","ArrowDown","ArrowUp"].includes(r.key))return;let i=a,c=0;do{i=this.getNextIndexByKey(i,r.key,s),c++}while(c<s&&(null===(t=this.colorButtons[i])||void 0===t?void 0:t.disabled));i!==a&&i>=0&&i<s&&!(null===(o=this.colorButtons[i])||void 0===o?void 0:o.disabled)&&(this.moveFocusTo(i),r.preventDefault(),r.stopPropagation())}handleBlur(r){i(this.host,r.relatedTarget)||(this.host.tabIndex=0,this.colorButtons.forEach((r=>r.tabIndex=-1)))}componentWillLoad(){this.colorKeysByRow=this.sortColorKeysByRow()}render(){return o(e,{key:"c834820884acc8c3bdf4571379cbe6da74e7ea89",role:"listbox","aria-label":this.htmlAriaLabel||c[this.lng]["Select a color"],tabIndex:0},this.colorKeysByRow.map((r=>{var t;return o("button",{class:"color-swatch","data-color":r,role:"option","aria-selected":(null===(t=this.selectedColor)||void 0===t?void 0:t.toUpperCase())===r.toUpperCase()?"true":"false",tabIndex:-1,onClick:()=>this.selectedColor=r,disabled:this.disableTransparent&&"#FFFFFF00"===r},o("div",{class:"color-swatch",role:"img","aria-roledescription":c[this.lng]["Color swatch"],"aria-label":s[r][this.lng],title:s[r][this.lng],style:{backgroundColor:r}}))})))}get host(){return a(this)}static get watchers(){return{disableTransparent:[{validateTransparentSelection:0}],selectedColor:[{validateTransparentSelection:0},{emitColorSelected:0}]}}};l.style=':host{display:grid;width:fit-content;padding:calc(var(--space-unit) * 2);background:var(--color-surface01);gap:var(--space-unit);grid-template-columns:repeat(9, calc(var(--space-unit) * 3));grid-template-rows:repeat(5, calc(var(--space-unit) * 3))}:host,*{box-sizing:border-box}button{--border-color:var(--color-surface05);padding:0;border:none;appearance:none;background:none;border-radius:var(--border-radius);cursor:pointer}button[data-color="#FFFFFF00"]{position:relative}button[data-color="#FFFFFF00"]::after{position:absolute;top:0;right:0;width:100%;height:100%;background:linear-gradient( -45deg, transparent 48%, var(--border-color) 48%, var(--border-color) 52%, transparent 52% );border-radius:var(--border-radius);content:""}button[aria-selected="true"]{box-shadow:0 0 0 1px var(--color-white), 0 0 0 3px var(--color-active-primary)}button:focus-visible{box-shadow:var(--shadow-focus-primary)}button .color-swatch{width:calc(var(--space-unit) * 3);height:calc(var(--space-unit) * 3);border:var(--border-size-small) solid var(--border-color);border-radius:var(--border-radius)}button[data-color="#FFFFFF00"]:disabled{--border-color:var(--color-disabled01-icon);cursor:not-allowed}button[data-color="#FFFFFF00"]:disabled .color-swatch{background-color:var(--color-disabled02)}';export{l as z_color_picker}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,H as s,d as o}from"./p-DPdXlnVe.js";import{g as a}from"./p-BKCj6NR2.js";import{a as n}from"./p-
|
|
1
|
+
import{r as t,c as i,h as e,H as s,d as o}from"./p-DPdXlnVe.js";import{g as a}from"./p-BKCj6NR2.js";import{a as n}from"./p-CPsEG702.js";import"./p-Q-tWjk7P.js";const h=t=>"Z-MENU-SECTION"===(null==t?void 0:t.tagName),l=class{get focusableItem(){return this.items.find((t=>h(t)?0===t.htmlTabindex:0===t.tabIndex))}toggle(){this.hasContent&&(this.open=!this.open)}onLabelSlotChange(t){const i=t.target.assignedElements()[0];i.dataset.text=null==i?void 0:i.textContent,this.setLabelA11yAttrs()}reflow(t=!1){if(this.floating){if(this.content&&this.hasContent){const{style:t}=this.content,{left:i}=this.host.getBoundingClientRect(),e=getComputedStyle(this.content).width,s=e?parseFloat(e.replace("px","")):375;t.left=`${Math.min(window.innerWidth-i-s-30,0)}px`}t&&(this.raf=requestAnimationFrame(this.reflow.bind(this,t)))}}checkContent(){this.hasHeader=!!this.host.querySelectorAll("[slot=header]").length,this.hasContent=!!this.host.querySelectorAll("[slot=item]").length||this.hasHeader}setItemTabindex(t,i){h(t)?t.htmlTabindex=i:t.tabIndex=i}setItemsA11yAttrs(){this.items.forEach(((t,i)=>{this.setItemTabindex(t,0===i?0:-1),h(t)||t.setAttribute("role","menuitem")}))}onItemsChange(){this.checkContent(),this.items=Array.from(this.host.children).filter((({slot:t})=>"item"===t)),this.setItemsA11yAttrs(),this.items.forEach((t=>{h(t)||(t.dataset.text=t.textContent)}))}moveFocus(t,i){h(t)?t.setFocus():(t.tabIndex=0,setTimeout((()=>{t.focus()}),100)),i&&this.setItemTabindex(i,-1)}onLabelClick(){this.toggle(),this.setFocus()}onLabelKeydown(t){if(t.key===a.ENTER||t.key===a.SPACE)return t.preventDefault(),t.stopPropagation(),this.toggle(),void(this.open&&this.moveFocus(this.items[0]));this.verticalContext&&(t.key!==a.ARROW_RIGHT||this.open||(t.preventDefault(),t.stopPropagation(),this.open=!0,this.moveFocus(this.items[0])))}async setFocus(){this.htmlTabindex=0,(this.hasContent?this.labelButton:this.host.firstElementChild).focus()}async focusLastItem(){const t=this.items[this.items.length-1];h(t)&&t.open?t.focusLastItem():this.moveFocus(t)}onOpenChanged(){if(!this.open)return cancelAnimationFrame(this.raf),this.closed.emit(),void this.items.forEach((t=>{h(t)&&t.open&&(t.open=!1)}));this.setItemsA11yAttrs(),this.opened.emit(),this.floating&&this.reflow(!0)}setLabelA11yAttrs(){if(this.hasContent&&this.labelButton)return void(this.labelButton.tabIndex=this.htmlTabindex);const t=this.host.firstElementChild;t.role="menuitem",t.tabIndex=this.htmlTabindex}onItemClick(t){const i=this.items.find((i=>n(i,t.target)));i&&this.items.forEach((t=>{t!==i&&(h(t)?t.htmlTabindex=-1:t.tabIndex=-1)}))}onKeyDown(t){var i;if(this.hasContent)switch(t.key){case a.ESC:if(!this.open)break;t.stopPropagation(),t.preventDefault(),this.open=!1,this.setFocus();break;case a.ARROW_DOWN:{if(document.activeElement===this.host){if(this.verticalContext&&!this.open)break;t.stopPropagation(),t.preventDefault(),this.open||(this.open=!0),this.moveFocus(this.items[0]);break}const i=this.items.indexOf(this.focusableItem);if(this.verticalContext&&i===this.items.length-1){this.setItemTabindex(this.items[i],-1),this.htmlTabindex=0;break}t.stopPropagation(),t.preventDefault();const e=this.items[i+1];this.moveFocus(null!=e?e:this.items[0],this.focusableItem);break}case a.ARROW_UP:{if(document.activeElement===this.host){if(this.verticalContext)break;t.stopPropagation(),t.preventDefault(),this.open||(this.open=!0),this.moveFocus(this.items[this.items.length-1],this.focusableItem);break}t.stopPropagation(),t.preventDefault();const e=this.items.indexOf(this.focusableItem);if(0===e&&this.verticalContext){this.setItemTabindex(this.focusableItem,-1),this.setFocus();break}const s=null!==(i=this.items[e-1])&&void 0!==i?i:this.items[this.items.length-1];if(h(s)&&s.open){this.setItemTabindex(this.focusableItem,-1),s.focusLastItem();break}this.moveFocus(s,this.focusableItem);break}case a.ARROW_LEFT:if(!this.open||!this.verticalContext)break;t.preventDefault(),t.stopPropagation(),this.open=!1,this.setFocus()}}constructor(e){t(this,e),this.opened=i(this,"opened",7),this.closed=i(this,"closed",7),this.floating=!0,this.open=!1,this.verticalContext=!1,this.htmlTabindex=-1,this.items=[],this.toggle=this.toggle.bind(this),this.checkContent=this.checkContent.bind(this),this.onLabelSlotChange=this.onLabelSlotChange.bind(this),this.onLabelClick=this.onLabelClick.bind(this),this.onItemsChange=this.onItemsChange.bind(this),this.onLabelKeydown=this.onLabelKeydown.bind(this)}componentWillLoad(){this.setLabelA11yAttrs(),this.onItemsChange()}render(){return this.hasContent?e(s,null,e("button",{ref:t=>this.labelButton=t,class:"menu-label","aria-expanded":`${!!this.open}`,"aria-haspopup":`${this.hasContent}`,"aria-label":this.open?"Chiudi menù":"Apri menù",role:"menuitem",tabIndex:this.htmlTabindex,onClick:this.onLabelClick,onKeyDown:this.onLabelKeydown},e("slot",{onSlotchange:this.onLabelSlotChange}),e("z-icon",{name:this.open?"chevron-up":"chevron-down"})),e("div",{class:"content",ref:t=>this.content=t},this.hasHeader&&e("header",{class:"header"},e("slot",{name:"header",onSlotchange:this.checkContent})),e("div",{class:"items",role:"menu"},e("slot",{name:"item",onSlotchange:this.onItemsChange})))):e("div",{class:"menu-label"},e("slot",{onSlotchange:this.onLabelSlotChange}))}get host(){return o(this)}static get watchers(){return{open:[{onOpenChanged:0}],htmlTabindex:[{setLabelA11yAttrs:0}]}}};l.style=':host,::slotted(*),*{box-sizing:border-box;outline:none}:host{position:relative;display:inline-flex;height:fit-content;flex-direction:column}::slotted(a){text-decoration:none}::slotted(*){color:var(--color-default-text);font-family:var(--font-family-sans);font-weight:var(--font-rg)}.menu-label{position:relative;display:flex;width:100%;align-items:center;padding:0;border:0;border-bottom:var(--border-size-large) solid transparent;margin:0;background:transparent;border-radius:0;color:inherit;text-align:left}button.menu-label{cursor:pointer}.menu-label:focus-visible,div.menu-label:focus-within{box-shadow:var(--shadow-focus-primary)}:host(:is([active],[open])) .menu-label ::slotted(*),.menu-label:focus-visible ::slotted(*),div.menu-label:focus-within ::slotted(*){color:var(--color-primary01);font-weight:var(--font-bd)}:host([vertical-context]) .menu-label{padding:var(--space-unit) 0;border-width:var(--border-size-small);border-color:var(--color-surface03)}:host(:is([active],[open])) .menu-label,.menu-label:hover,.menu-label:focus-visible,div.menu-label:focus-within{border-color:var(--color-primary01)}:host([vertical-context]:is([active],[open])) .menu-label::after,:host([vertical-context]) .menu-label:hover::after,:host([vertical-context]) .menu-label:focus-visible::after,:host([vertical-context]) div.menu-label:focus-within::after{position:absolute;bottom:calc(var(--border-size-small) * -1);left:0;width:100%;height:var(--border-size-large);background-color:var(--color-primary01);content:""}:host([vertical-context]) .menu-label ::slotted(*){padding:0}.menu-label ::slotted(*){display:inline-flex;width:100%;min-width:fit-content;padding-bottom:2px;margin:0;appearance:none;color:var(--z-menu-label-color, var(--color-default-text));font-family:var(--font-family-sans);font-size:var(--font-size-3);font-weight:inherit;line-height:1.5;white-space:nowrap}.menu-label z-icon{margin-left:calc(var(--space-unit) * 1.5);fill:var(--color-default-icon)}::slotted([data-text]:not([slot]))::after{height:0;content:attr(data-text);content:attr(data-text) / "";font-weight:var(--font-bd);letter-spacing:normal;pointer-events:none;user-select:none;visibility:hidden}@media speech{::slotted([data-text]:not([slot]))::after{display:none}}::slotted([data-text]:not([slot])){display:inline-flex;flex-direction:column}.content{background:var(--color-surface01)}:host(:not([open])) .content{display:none}:host([floating]:not([vertical-context])) .content{position:absolute;top:100%;left:0;width:375px;min-width:100%;max-width:100vw;padding:0 calc(var(--space-unit) * 2);box-shadow:var(--shadow-2)}:host(:not([floating])) .content{width:100%}.header{display:flex;align-items:center;padding:var(--space-unit) 0 calc(var(--space-unit) * 2)}.header ::slotted(img[slot="header"]){width:calc(var(--space-unit) * 11.25);height:auto;object-fit:contain}.header ::slotted([slot="header"]:not(:first-child)){margin:auto 0;margin-left:calc(var(--space-unit) * 2.5);font-size:var(--font-size-3);font-weight:var(--font-sb);line-height:1.5}.items{display:flex;flex-direction:column;align-items:flex-start;background:inherit}.items>::slotted([slot="item"]){width:100%;margin:0;font-size:var(--font-size-3);line-height:1.5}.items>::slotted([slot="item"]:focus:focus-visible){box-shadow:var(--shadow-focus-primary)}.items>::slotted([slot="item"]:not(z-menu-section)){padding:var(--space-unit) 0;border-bottom:var(--border-size-small) solid var(--color-surface03)}:host(:not([vertical-context])) .items>::slotted([slot="item"]:last-child){border-bottom:0}.items>::slotted([slot="item"]:hover),.items>::slotted([slot="item"]:focus:focus-visible),.items>::slotted([slot="item"]:active),.items>::slotted([slot="item"][active]),.items>::slotted([slot="item"][data-active]){border-color:var(--color-primary01);font-weight:var(--font-bd)}';export{l as z_menu}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as o,d as n}from"./p-DPdXlnVe.js";import{P as s,g as a}from"./p-BKCj6NR2.js";import{a as r}from"./p-D4yqZKyM.js";import"./p-Q-tWjk7P.js";const h=class{constructor(i){t(this,i),this.toggleSubmenu=e(this,"toggleSubmenu",7),this.toggleTooltip=e(this,"toggleTooltip",7),this.tooltipPosition=s.TOP,this.active=!1,this.disabled=!1,this.open=!1,this.tooltipOpen=!1,this.hasSlottedContent=!1,this.isMobile=!1,this.hasNestedOpenTools=!1,this.isNested=!1,this.handleTooltipOpen=t=>{this.tooltip&&!this.open&&this.buttonRef.contains(t.target)&&(clearTimeout(this.hoverDelay),this.hoverDelay=setTimeout((()=>{this.tooltipOpen=!0}),1e3))},this.handleTooltipClose=t=>{var e;this.tooltip&&(null===(e=t.relatedTarget)||void 0===e?void 0:e.closest("z-tooltip"))!==this.tooltipRef&&(clearTimeout(this.hoverDelay),this.tooltipOpen=!1)},this.handleClick=()=>{if(!this.disabled&&this.hasSlottedContent&&(this.open=!this.open,this.open)){const t=this.hostElement.querySelector(":scope > z-color-picker");if(t)return void t.setFocus();const e=this.hostElement.querySelector(":scope > z-toolbar z-tool[active]:not(:disabled)")||this.hostElement.querySelector(":scope > z-toolbar z-tool:not(:disabled)");null==e||e.setFocus()}},this.onTooltipOpenChange=t=>{t.target!==this.tooltipRef&&(this.tooltipOpen=t.detail.open)}}handleOpenChange(){this.toggleSubmenu.emit(this.open)}handleTooltipOpenChange(){this.toggleTooltip.emit(this.tooltipOpen)}handleKeyDown(t){if(this.open&&!this.hasNestedOpenTools)switch(t.key){case a.ESC:t.stopPropagation(),this.open=!1,this.setFocus();break;case a.TAB:t.shiftKey&&t.target.closest("z-tool:not(:scope)")===this.hostElement&&(this.open=!1)}}onOutsideClick(t){const e=t.composedPath()[0];!this.open||r(this.hostElement,e)||this.hasNestedOpenTools||(this.open=!1)}onNestedToolToggle(t){t.target!==this.hostElement&&(this.hasNestedOpenTools=!0===t.detail||Array.from(this.hostElement.querySelectorAll("z-tool")).some((t=>t.open)))}handleColorSelected(t){Array.from(this.hostElement.children).includes(t.target)&&(this.indicatorColor=t.detail,this.open=!1,this.setFocus())}handleExternalFocusin(t){r(this.hostElement,t.target)||(this.open=!1)}async setFocus(){this.disabled||setTimeout((()=>{var t;null===(t=this.buttonRef)||void 0===t||t.focus()}),50)}async setTabIndex(t){this.buttonRef&&(this.buttonRef.tabIndex=this.disabled?-1:t)}async closeTooltip(){clearTimeout(this.hoverDelay),this.tooltipOpen=!1}componentWillLoad(){this.hasSlottedContent=this.hostElement.children.length>0,this.isNested=!!this.hostElement.closest("z-tool:not(:scope)"),this.mainToolbar=this.hostElement.closest("z-toolbar:not(z-toolbar z-toolbar)"),this.hasNestedOpenTools=!!this.hostElement.querySelector("z-tool[open]"),this.mql=matchMedia("(max-width: 767px)"),this.onMobileViewChange=t=>this.isMobile=t.matches,this.mql.addEventListener("change",this.onMobileViewChange),this.isMobile=this.mql.matches}disconnectedCallback(){var t;clearTimeout(this.hoverDelay),null===(t=this.mql)||void 0===t||t.removeEventListener("change",this.onMobileViewChange)}render(){return i(o,{key:"1a87f70e20dca23bc4207f03aa1cd933c5fa668e",class:{"z-tool-tooltip-open":this.tooltipOpen}},i("button",{key:"df7f4ad8a47dee955b9c4c249354fa114410409d",class:"z-tool",type:"button",ref:t=>this.buttonRef=t,"aria-pressed":this.hasSlottedContent?void 0:this.active?"true":"false","aria-expanded":this.hasSlottedContent?this.open?"true":"false":void 0,"aria-haspopup":this.hasSlottedContent?"true":void 0,"aria-label":this.htmlAriaLabel||this.tooltip||void 0,disabled:this.disabled,onClick:this.handleClick,onMouseEnter:this.handleTooltipOpen,onMouseLeave:this.handleTooltipClose,onFocus:this.handleTooltipOpen,onBlur:this.handleTooltipClose},i("z-icon",{key:"43bd668b9d58377caa755e7eeaf68e3381b036f0",ref:t=>this.iconRef=t,name:this.icon,indicatorColor:this.indicatorColor})),this.tooltip&&i("z-tooltip",{key:"a86766b86ee4cf878f5a48f48e135b8cd3092f3a",class:"z-tool-tooltip",ref:t=>this.tooltipRef=t,bindTo:this.iconRef,open:this.tooltipOpen&&!this.open,position:this.isNested?s.BOTTOM:this.tooltipPosition,dark:!0,onMouseLeave:this.handleTooltipClose,onBlur:this.handleTooltipClose,onOpenChange:this.onTooltipOpenChange},i("span",{key:"91ddd32599a6a6a3b4fbf34fb69fdabff0dbbda9",class:"body-4"},this.tooltip)),this.hasSlottedContent&&i("z-popover",{key:"ec7b937f451db4a1b206b386d6f199b5cf71117d",class:"z-tool-submenu",open:this.open,bindTo:this.isMobile&&this.mainToolbar?this.mainToolbar:this.hostElement,center:!0,closable:!1,position:this.isMobile?s.TOP:s.BOTTOM},i("slot",{key:"85e016cb92ce6c7356afa7f93bbdd278ab3ff88e"})))}get hostElement(){return n(this)}static get watchers(){return{open:[{handleOpenChange:0}],tooltipOpen:[{handleTooltipOpenChange:0}]}}};h.style=':host,*{box-sizing:border-box}.z-tool{--z-tool-size:calc(var(--space-unit) * 5.5);--z-tool-icon-size:calc(var(--space-unit) * 2.5);position:relative;display:inline-flex;width:var(--z-tool-size);height:var(--z-tool-size);align-items:center;justify-content:center;padding:0;border:none;margin:0;background-color:var(--color-surface01);border-radius:var(--border-radius);cursor:pointer}:host(:is([active],[open])) .z-tool{box-shadow:inset 0 0 0 2px var(--color-primary01)}:host([open]) .z-tool{background:var(--color-primary03)}@media (hover: hover){:host(:hover),:host(.z-tool-tooltip-open){z-index:1}:host(:not([disabled])) .z-tool:hover{background-color:var(--color-primary03)}}.z-tool:focus:focus-visible{background-color:var(--color-primary03);outline:none}z-icon{--z-icon-width:var(--z-tool-icon-size);--z-icon-height:var(--z-tool-icon-size);display:block;fill:var(--color-default-icon)}:host([disabled]) .z-tool{color:var(--color-disabled01-icon);cursor:not-allowed}:host([disabled]) z-icon{fill:var(--color-disabled01-icon)}.z-tool-tooltip{--z-tooltip-padding:calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 2);--z-tooltip-shadow-filter:drop-shadow(0 4px 8px var(--shadow-color-base));position:relative;z-index:2;font-family:var(--font-family-sans);white-space:nowrap}.z-tool-submenu{z-index:3;border-radius:calc(var(--border-radius) + var(--border-size-small))}.z-tool-submenu ::slotted(z-color-picker){border:var(--border-size-small) solid var(--color-surface03);border-radius:var(--border-radius)}@media (max-width: 767px) and (hover: none){.z-tool-tooltip{display:none !important}}:root{--font-family-sans:"IBM Plex Sans", sans-serif;--font-family-serif:"IBM Plex Serif", serif;--font-lt:300;--font-rg:400;--font-sb:600;--font-bd:700;--font-size-1:0.75rem;--font-size-2:0.875rem;--font-size-3:1rem;--font-size-4:1.125rem;--font-size-5:1.25rem;--font-size-6:1.5rem;--font-size-7:1.75rem;--font-size-8:2rem;--font-size-9:2.25rem;--font-size-10:2.625rem;--font-size-11:3rem;--font-size-12:3.375rem;--font-size-13:3.75rem;--font-size-14:4.25rem;--font-size-15:4.75rem;--font-size-16:5.25rem;--font-size-17:5.75rem;--section-title-1:var(--font-sb) var(--font-size-11) / 1.083 var(--font-family-serif);--section-title-2:var(--font-sb) var(--font-size-10) / 1.142 var(--font-family-serif);--section-title-3:var(--font-sb) var(--font-size-9) / 1.222 var(--font-family-serif);--section-title-4:var(--font-sb) var(--font-size-8) / 1.25 var(--font-family-serif);--section-title-5:var(--font-sb) var(--font-size-7) / 1.2857 var(--font-family-serif);--section-title-6:var(--font-sb) var(--font-size-6) / 1.333 var(--font-family-serif)}.heading-1,.heading-1-sb,.heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.heading-2,.heading-2-sb,.heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.heading-3,.heading-3-sb,.heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.heading-4,.heading-4-sb,.heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.body-1,.body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.body-2,.body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.body-3,.body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.body-4,.body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.body-5,.body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.interactive-1,.interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.interactive-2,.interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.interactive-3,.interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.helper,.helper-sb{font-size:var(--font-size-1);font-style:italic;font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.section-title-1{font:var(--section-title-1)}.section-title-2{font:var(--section-title-2)}.section-title-3{font:var(--section-title-3)}.section-title-4{font:var(--section-title-4)}.section-title-5{font:var(--section-title-5)}.section-title-6{font:var(--section-title-6)}@media (min-width: 1152px){.heading-1,.heading-1-sb,.heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.heading-2,.heading-2-sb,.heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}}@media (max-width: 767px){.mobile-heading-1,.mobile-heading-1-sb,.mobile-heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.mobile-heading-2,.mobile-heading-2-sb,.mobile-heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.mobile-heading-3,.mobile-heading-3-sb,.mobile-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.mobile-heading-4,.mobile-heading-4-sb,.mobile-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.mobile-body-1,.mobile-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.mobile-body-2,.mobile-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.mobile-body-3,.mobile-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.mobile-body-4,.mobile-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.mobile-body-5,.mobile-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.mobile-interactive-1,.mobile-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.mobile-interactive-2,.mobile-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.mobile-interactive-3,.mobile-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.mobile-section-title-1{font:var(--section-title-1)}.mobile-section-title-2{font:var(--section-title-2)}.mobile-section-title-3{font:var(--section-title-3)}.mobile-section-title-4{font:var(--section-title-4)}.mobile-section-title-5{font:var(--section-title-5)}.mobile-section-title-6{font:var(--section-title-6)}.mobile-heading-1-lt,.mobile-heading-2-lt,.mobile-heading-3-lt,.mobile-heading-4-lt{font-weight:var(--font-lt)}.mobile-heading-1-sb,.mobile-heading-2-sb,.mobile-heading-3-sb,.mobile-heading-4-sb,.mobile-body-1-sb,.mobile-body-2-sb,.mobile-body-3-sb,.mobile-body-4-sb,.mobile-body-5-sb,.mobile-interactive-1-sb,.mobile-interactive-2-sb,.mobile-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 768px) and (max-width: 1151px){.tablet-heading-1,.tablet-heading-1-sb,.tablet-heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.tablet-heading-2,.tablet-heading-2-sb,.tablet-heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.tablet-heading-3,.tablet-heading-3-sb,.tablet-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.tablet-heading-4,.tablet-heading-4-sb,.tablet-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.tablet-body-1,.tablet-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.tablet-body-2,.tablet-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.tablet-body-3,.tablet-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.tablet-body-4,.tablet-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.tablet-body-5,.tablet-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.tablet-interactive-1,.tablet-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.tablet-interactive-2,.tablet-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.tablet-interactive-3,.tablet-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.tablet-section-title-1{font:var(--section-title-1)}.tablet-section-title-2{font:var(--section-title-2)}.tablet-section-title-3{font:var(--section-title-3)}.tablet-section-title-4{font:var(--section-title-4)}.tablet-section-title-5{font:var(--section-title-5)}.tablet-section-title-6{font:var(--section-title-6)}.tablet-heading-1-lt,.tablet-heading-2-lt,.tablet-heading-3-lt,.tablet-heading-4-lt{font-weight:var(--font-lt)}.tablet-heading-1-sb,.tablet-heading-2-sb,.tablet-heading-3-sb,.tablet-heading-4-sb,.tablet-body-1-sb,.tablet-body-2-sb,.tablet-body-3-sb,.tablet-body-4-sb,.tablet-body-5-sb,.tablet-interactive-1-sb,.tablet-interactive-2-sb,.tablet-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 1152px) and (max-width: 1365px){.desktop-heading-1,.desktop-heading-1-sb,.desktop-heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.desktop-heading-2,.desktop-heading-2-sb,.desktop-heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.desktop-heading-3,.desktop-heading-3-sb,.desktop-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.desktop-heading-4,.desktop-heading-4-sb,.desktop-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.desktop-body-1,.desktop-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.desktop-body-2,.desktop-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.desktop-body-3,.desktop-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.desktop-body-4,.desktop-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.desktop-body-5,.desktop-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.desktop-interactive-1,.desktop-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.desktop-interactive-2,.desktop-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.desktop-interactive-3,.desktop-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.desktop-section-title-1{font:var(--section-title-1)}.desktop-section-title-2{font:var(--section-title-2)}.desktop-section-title-3{font:var(--section-title-3)}.desktop-section-title-4{font:var(--section-title-4)}.desktop-section-title-5{font:var(--section-title-5)}.desktop-section-title-6{font:var(--section-title-6)}.desktop-heading-1-lt,.desktop-heading-2-lt,.desktop-heading-3-lt,.desktop-heading-4-lt{font-weight:var(--font-lt)}.desktop-heading-1-sb,.desktop-heading-2-sb,.desktop-heading-3-sb,.desktop-heading-4-sb,.desktop-body-1-sb,.desktop-body-2-sb,.desktop-body-3-sb,.desktop-body-4-sb,.desktop-body-5-sb,.desktop-interactive-1-sb,.desktop-interactive-2-sb,.desktop-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 1366px){.wide-heading-1,.wide-heading-1-sb,.wide-heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.wide-heading-2,.wide-heading-2-sb,.wide-heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.wide-heading-3,.wide-heading-3-sb,.wide-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.wide-heading-4,.wide-heading-4-sb,.wide-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.wide-body-1,.wide-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.wide-body-2,.wide-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.wide-body-3,.wide-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.wide-body-4,.wide-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.wide-body-5,.wide-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.wide-interactive-1,.wide-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.wide-interactive-2,.wide-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.wide-interactive-3,.wide-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.wide-section-title-1{font:var(--section-title-1)}.wide-section-title-2{font:var(--section-title-2)}.wide-section-title-3{font:var(--section-title-3)}.wide-section-title-4{font:var(--section-title-4)}.wide-section-title-5{font:var(--section-title-5)}.wide-section-title-6{font:var(--section-title-6)}.wide-heading-1-lt,.wide-heading-2-lt,.wide-heading-3-lt,.wide-heading-4-lt{font-weight:var(--font-lt)}.wide-heading-1-sb,.wide-heading-2-sb,.wide-heading-3-sb,.wide-heading-4-sb,.wide-body-1-sb,.wide-body-2-sb,.wide-body-3-sb,.wide-body-4-sb,.wide-body-5-sb,.wide-interactive-1-sb,.wide-interactive-2-sb,.wide-interactive-3-sb{font-weight:var(--font-sb)}}.heading-1-lt,.heading-2-lt,.heading-3-lt,.heading-4-lt{font-weight:var(--font-lt)}.heading-1-sb,.heading-2-sb,.heading-3-sb,.heading-4-sb,.body-1-sb,.body-2-sb,.body-3-sb,.body-4-sb,.body-5-sb,.interactive-1-sb,.interactive-2-sb,.interactive-3-sb,.helper-sb{font-weight:var(--font-sb)}';export{h as z_tool}
|
|
1
|
+
import{r as t,c as e,h as i,H as o,d as n}from"./p-DPdXlnVe.js";import{P as s,g as a}from"./p-BKCj6NR2.js";import{a as r}from"./p-CPsEG702.js";import"./p-Q-tWjk7P.js";const h=class{constructor(i){t(this,i),this.toggleSubmenu=e(this,"toggleSubmenu",7),this.toggleTooltip=e(this,"toggleTooltip",7),this.tooltipPosition=s.TOP,this.active=!1,this.disabled=!1,this.open=!1,this.tooltipOpen=!1,this.hasSlottedContent=!1,this.isMobile=!1,this.hasNestedOpenTools=!1,this.isNested=!1,this.handleTooltipOpen=t=>{this.tooltip&&!this.open&&this.buttonRef.contains(t.target)&&(clearTimeout(this.hoverDelay),this.hoverDelay=setTimeout((()=>{this.tooltipOpen=!0}),1e3))},this.handleTooltipClose=t=>{var e;this.tooltip&&(null===(e=t.relatedTarget)||void 0===e?void 0:e.closest("z-tooltip"))!==this.tooltipRef&&(clearTimeout(this.hoverDelay),this.tooltipOpen=!1)},this.handleClick=()=>{if(!this.disabled&&this.hasSlottedContent&&(this.open=!this.open,this.open)){const t=this.hostElement.querySelector(":scope > z-color-picker");if(t)return void t.setFocus();const e=this.hostElement.querySelector(":scope > z-toolbar z-tool[active]:not(:disabled)")||this.hostElement.querySelector(":scope > z-toolbar z-tool:not(:disabled)");null==e||e.setFocus()}},this.onTooltipOpenChange=t=>{t.target!==this.tooltipRef&&(this.tooltipOpen=t.detail.open)}}handleOpenChange(){this.toggleSubmenu.emit(this.open)}handleTooltipOpenChange(){this.toggleTooltip.emit(this.tooltipOpen)}handleKeyDown(t){if(this.open&&!this.hasNestedOpenTools)switch(t.key){case a.ESC:t.stopPropagation(),this.open=!1,this.setFocus();break;case a.TAB:t.shiftKey&&t.target.closest("z-tool:not(:scope)")===this.hostElement&&(this.open=!1)}}onOutsideClick(t){const e=t.composedPath()[0];!this.open||r(this.hostElement,e)||this.hasNestedOpenTools||(this.open=!1)}onNestedToolToggle(t){t.target!==this.hostElement&&(this.hasNestedOpenTools=!0===t.detail||Array.from(this.hostElement.querySelectorAll("z-tool")).some((t=>t.open)))}handleColorSelected(t){Array.from(this.hostElement.children).includes(t.target)&&(this.indicatorColor=t.detail,this.open=!1,this.setFocus())}handleExternalFocusin(t){r(this.hostElement,t.target)||(this.open=!1)}async setFocus(){this.disabled||setTimeout((()=>{var t;null===(t=this.buttonRef)||void 0===t||t.focus()}),50)}async setTabIndex(t){this.buttonRef&&(this.buttonRef.tabIndex=this.disabled?-1:t)}async closeTooltip(){clearTimeout(this.hoverDelay),this.tooltipOpen=!1}componentWillLoad(){this.hasSlottedContent=this.hostElement.children.length>0,this.isNested=!!this.hostElement.closest("z-tool:not(:scope)"),this.mainToolbar=this.hostElement.closest("z-toolbar:not(z-toolbar z-toolbar)"),this.hasNestedOpenTools=!!this.hostElement.querySelector("z-tool[open]"),this.mql=matchMedia("(max-width: 767px)"),this.onMobileViewChange=t=>this.isMobile=t.matches,this.mql.addEventListener("change",this.onMobileViewChange),this.isMobile=this.mql.matches}disconnectedCallback(){var t;clearTimeout(this.hoverDelay),null===(t=this.mql)||void 0===t||t.removeEventListener("change",this.onMobileViewChange)}render(){return i(o,{key:"f5da5cd309607dc94dd12a28596b2ea02d28ba4c",class:{"z-tool-tooltip-open":this.tooltipOpen}},i("button",{key:"be63d078b5035ba1f08c480c8c08f365b3115191",class:"z-tool",type:"button",ref:t=>this.buttonRef=t,"aria-pressed":this.hasSlottedContent?void 0:this.active?"true":"false","aria-expanded":this.hasSlottedContent?this.open?"true":"false":void 0,"aria-haspopup":this.hasSlottedContent?"true":void 0,"aria-label":this.htmlAriaLabel||this.tooltip||void 0,disabled:this.disabled,onClick:this.handleClick,onMouseEnter:this.handleTooltipOpen,onMouseLeave:this.handleTooltipClose,onFocus:this.handleTooltipOpen,onBlur:this.handleTooltipClose},i("z-icon",{key:"a08b5432871a1522374633050a835bb18001a6d6",ref:t=>this.iconRef=t,name:this.icon,indicatorColor:this.indicatorColor})),this.tooltip&&i("z-tooltip",{key:"9e0fa11a43662f333404543e315b097aa96ab08c",class:"z-tool-tooltip",ref:t=>this.tooltipRef=t,bindTo:this.iconRef,open:this.tooltipOpen&&!this.open,position:this.isNested?s.BOTTOM:this.tooltipPosition,dark:!0,onMouseLeave:this.handleTooltipClose,onBlur:this.handleTooltipClose,onOpenChange:this.onTooltipOpenChange},i("span",{key:"bfc2be83824830ed05b70f423e9f044015624f49",class:"body-4"},this.tooltip)),this.hasSlottedContent&&i("z-popover",{key:"717697756e5333f066f96c96695cd9741b006e93",class:"z-tool-submenu",open:this.open,bindTo:this.isMobile&&this.mainToolbar?this.mainToolbar:this.hostElement,center:!0,closable:!1,position:this.isMobile?s.TOP:s.BOTTOM},i("slot",{key:"d151d02e38fb7a0941012ec969b6cea647721846"})))}get hostElement(){return n(this)}static get watchers(){return{open:[{handleOpenChange:0}],tooltipOpen:[{handleTooltipOpenChange:0}]}}};h.style=':host,*{box-sizing:border-box}.z-tool{--z-tool-size:calc(var(--space-unit) * 5.5);--z-tool-icon-size:calc(var(--space-unit) * 2.5);position:relative;display:inline-flex;width:var(--z-tool-size);height:var(--z-tool-size);align-items:center;justify-content:center;padding:0;border:none;margin:0;background-color:var(--color-surface01);border-radius:var(--border-radius);cursor:pointer}:host(:is([active],[open])) .z-tool{box-shadow:inset 0 0 0 2px var(--color-primary01)}:host([open]) .z-tool{background:var(--color-primary03)}@media (hover: hover){:host(:hover),:host(.z-tool-tooltip-open){z-index:1}:host(:not([disabled])) .z-tool:hover{background-color:var(--color-primary03)}}.z-tool:focus:focus-visible{background-color:var(--color-primary03);outline:none}z-icon{--z-icon-width:var(--z-tool-icon-size);--z-icon-height:var(--z-tool-icon-size);display:block;fill:var(--color-default-icon)}:host([disabled]) .z-tool{color:var(--color-disabled01-icon);cursor:not-allowed}:host([disabled]) z-icon{fill:var(--color-disabled01-icon)}.z-tool-tooltip{--z-tooltip-padding:calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 2);--z-tooltip-shadow-filter:drop-shadow(0 4px 8px var(--shadow-color-base));position:relative;z-index:2;font-family:var(--font-family-sans);white-space:nowrap}.z-tool-submenu{z-index:3;border-radius:calc(var(--border-radius) + var(--border-size-small))}.z-tool-submenu ::slotted(z-color-picker){border:var(--border-size-small) solid var(--color-surface03);border-radius:var(--border-radius)}@media (max-width: 767px) and (hover: none){.z-tool-tooltip{display:none !important}}:root{--font-family-sans:"IBM Plex Sans", sans-serif;--font-family-serif:"IBM Plex Serif", serif;--font-lt:300;--font-rg:400;--font-sb:600;--font-bd:700;--font-size-1:0.75rem;--font-size-2:0.875rem;--font-size-3:1rem;--font-size-4:1.125rem;--font-size-5:1.25rem;--font-size-6:1.5rem;--font-size-7:1.75rem;--font-size-8:2rem;--font-size-9:2.25rem;--font-size-10:2.625rem;--font-size-11:3rem;--font-size-12:3.375rem;--font-size-13:3.75rem;--font-size-14:4.25rem;--font-size-15:4.75rem;--font-size-16:5.25rem;--font-size-17:5.75rem;--section-title-1:var(--font-sb) var(--font-size-11) / 1.083 var(--font-family-serif);--section-title-2:var(--font-sb) var(--font-size-10) / 1.142 var(--font-family-serif);--section-title-3:var(--font-sb) var(--font-size-9) / 1.222 var(--font-family-serif);--section-title-4:var(--font-sb) var(--font-size-8) / 1.25 var(--font-family-serif);--section-title-5:var(--font-sb) var(--font-size-7) / 1.2857 var(--font-family-serif);--section-title-6:var(--font-sb) var(--font-size-6) / 1.333 var(--font-family-serif)}.heading-1,.heading-1-sb,.heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.heading-2,.heading-2-sb,.heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.heading-3,.heading-3-sb,.heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.heading-4,.heading-4-sb,.heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.body-1,.body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.body-2,.body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.body-3,.body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.body-4,.body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.body-5,.body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.interactive-1,.interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.interactive-2,.interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.interactive-3,.interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.helper,.helper-sb{font-size:var(--font-size-1);font-style:italic;font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.section-title-1{font:var(--section-title-1)}.section-title-2{font:var(--section-title-2)}.section-title-3{font:var(--section-title-3)}.section-title-4{font:var(--section-title-4)}.section-title-5{font:var(--section-title-5)}.section-title-6{font:var(--section-title-6)}@media (min-width: 1152px){.heading-1,.heading-1-sb,.heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.heading-2,.heading-2-sb,.heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}}@media (max-width: 767px){.mobile-heading-1,.mobile-heading-1-sb,.mobile-heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.mobile-heading-2,.mobile-heading-2-sb,.mobile-heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.mobile-heading-3,.mobile-heading-3-sb,.mobile-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.mobile-heading-4,.mobile-heading-4-sb,.mobile-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.mobile-body-1,.mobile-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.mobile-body-2,.mobile-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.mobile-body-3,.mobile-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.mobile-body-4,.mobile-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.mobile-body-5,.mobile-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.mobile-interactive-1,.mobile-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.mobile-interactive-2,.mobile-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.mobile-interactive-3,.mobile-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.mobile-section-title-1{font:var(--section-title-1)}.mobile-section-title-2{font:var(--section-title-2)}.mobile-section-title-3{font:var(--section-title-3)}.mobile-section-title-4{font:var(--section-title-4)}.mobile-section-title-5{font:var(--section-title-5)}.mobile-section-title-6{font:var(--section-title-6)}.mobile-heading-1-lt,.mobile-heading-2-lt,.mobile-heading-3-lt,.mobile-heading-4-lt{font-weight:var(--font-lt)}.mobile-heading-1-sb,.mobile-heading-2-sb,.mobile-heading-3-sb,.mobile-heading-4-sb,.mobile-body-1-sb,.mobile-body-2-sb,.mobile-body-3-sb,.mobile-body-4-sb,.mobile-body-5-sb,.mobile-interactive-1-sb,.mobile-interactive-2-sb,.mobile-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 768px) and (max-width: 1151px){.tablet-heading-1,.tablet-heading-1-sb,.tablet-heading-1-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.tablet-heading-2,.tablet-heading-2-sb,.tablet-heading-2-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.tablet-heading-3,.tablet-heading-3-sb,.tablet-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.tablet-heading-4,.tablet-heading-4-sb,.tablet-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.tablet-body-1,.tablet-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.tablet-body-2,.tablet-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.tablet-body-3,.tablet-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.tablet-body-4,.tablet-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.tablet-body-5,.tablet-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.tablet-interactive-1,.tablet-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.tablet-interactive-2,.tablet-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.tablet-interactive-3,.tablet-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.tablet-section-title-1{font:var(--section-title-1)}.tablet-section-title-2{font:var(--section-title-2)}.tablet-section-title-3{font:var(--section-title-3)}.tablet-section-title-4{font:var(--section-title-4)}.tablet-section-title-5{font:var(--section-title-5)}.tablet-section-title-6{font:var(--section-title-6)}.tablet-heading-1-lt,.tablet-heading-2-lt,.tablet-heading-3-lt,.tablet-heading-4-lt{font-weight:var(--font-lt)}.tablet-heading-1-sb,.tablet-heading-2-sb,.tablet-heading-3-sb,.tablet-heading-4-sb,.tablet-body-1-sb,.tablet-body-2-sb,.tablet-body-3-sb,.tablet-body-4-sb,.tablet-body-5-sb,.tablet-interactive-1-sb,.tablet-interactive-2-sb,.tablet-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 1152px) and (max-width: 1365px){.desktop-heading-1,.desktop-heading-1-sb,.desktop-heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.desktop-heading-2,.desktop-heading-2-sb,.desktop-heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.desktop-heading-3,.desktop-heading-3-sb,.desktop-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.desktop-heading-4,.desktop-heading-4-sb,.desktop-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.desktop-body-1,.desktop-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.desktop-body-2,.desktop-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.desktop-body-3,.desktop-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.desktop-body-4,.desktop-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.desktop-body-5,.desktop-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.desktop-interactive-1,.desktop-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.desktop-interactive-2,.desktop-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.desktop-interactive-3,.desktop-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.desktop-section-title-1{font:var(--section-title-1)}.desktop-section-title-2{font:var(--section-title-2)}.desktop-section-title-3{font:var(--section-title-3)}.desktop-section-title-4{font:var(--section-title-4)}.desktop-section-title-5{font:var(--section-title-5)}.desktop-section-title-6{font:var(--section-title-6)}.desktop-heading-1-lt,.desktop-heading-2-lt,.desktop-heading-3-lt,.desktop-heading-4-lt{font-weight:var(--font-lt)}.desktop-heading-1-sb,.desktop-heading-2-sb,.desktop-heading-3-sb,.desktop-heading-4-sb,.desktop-body-1-sb,.desktop-body-2-sb,.desktop-body-3-sb,.desktop-body-4-sb,.desktop-body-5-sb,.desktop-interactive-1-sb,.desktop-interactive-2-sb,.desktop-interactive-3-sb{font-weight:var(--font-sb)}}@media (min-width: 1366px){.wide-heading-1,.wide-heading-1-sb,.wide-heading-1-lt{font-size:var(--font-size-8);font-weight:var(--font-rg);line-height:1.25}.wide-heading-2,.wide-heading-2-sb,.wide-heading-2-lt{font-size:var(--font-size-7);font-weight:var(--font-rg);line-height:1.28}.wide-heading-3,.wide-heading-3-sb,.wide-heading-3-lt{font-size:var(--font-size-6);font-weight:var(--font-rg);line-height:1.333}.wide-heading-4,.wide-heading-4-sb,.wide-heading-4-lt{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.wide-body-1,.wide-body-1-sb{font-size:var(--font-size-5);font-weight:var(--font-rg);line-height:1.4}.wide-body-2,.wide-body-2-sb{font-size:var(--font-size-4);font-weight:var(--font-rg);line-height:1.5}.wide-body-3,.wide-body-3-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.wide-body-4,.wide-body-4-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.wide-body-5,.wide-body-5-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.wide-interactive-1,.wide-interactive-1-sb{font-size:var(--font-size-3);font-weight:var(--font-rg);line-height:1.5}.wide-interactive-2,.wide-interactive-2-sb{font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:1.4}.wide-interactive-3,.wide-interactive-3-sb{font-size:var(--font-size-1);font-weight:var(--font-rg);letter-spacing:0.32px;line-height:1.333}.wide-section-title-1{font:var(--section-title-1)}.wide-section-title-2{font:var(--section-title-2)}.wide-section-title-3{font:var(--section-title-3)}.wide-section-title-4{font:var(--section-title-4)}.wide-section-title-5{font:var(--section-title-5)}.wide-section-title-6{font:var(--section-title-6)}.wide-heading-1-lt,.wide-heading-2-lt,.wide-heading-3-lt,.wide-heading-4-lt{font-weight:var(--font-lt)}.wide-heading-1-sb,.wide-heading-2-sb,.wide-heading-3-sb,.wide-heading-4-sb,.wide-body-1-sb,.wide-body-2-sb,.wide-body-3-sb,.wide-body-4-sb,.wide-body-5-sb,.wide-interactive-1-sb,.wide-interactive-2-sb,.wide-interactive-3-sb{font-weight:var(--font-sb)}}.heading-1-lt,.heading-2-lt,.heading-3-lt,.heading-4-lt{font-weight:var(--font-lt)}.heading-1-sb,.heading-2-sb,.heading-3-sb,.heading-4-sb,.body-1-sb,.body-2-sb,.body-3-sb,.body-4-sb,.body-5-sb,.interactive-1-sb,.interactive-2-sb,.interactive-3-sb,.helper-sb{font-weight:var(--font-sb)}';export{h as z_tool}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as o,h as e,H as s,d as n}from"./p-DPdXlnVe.js";import{P as i,S as a,e as r,B as c}from"./p-BKCj6NR2.js";const h=class{constructor(e){t(this,e),this.sort=o(this,"sort",7),this.showMenu=null,this.showSorting=null,this.sticky=!1,this.sorted=!1,this.popoverPosition=i.AUTO,this.isMenuOpen=!1}get ariaSortDirection(){return this.sortDirection?this.sortDirection===a.ASC?"ascending":"descending":null}handleSort(){this.sortDirection?(this.sortDirection=this.sortDirection===a.ASC?a.DESC:a.ASC,this.sorted=!0,this.sort.emit({sortDirection:this.sortDirection})):this.sorted=!1}updateColspan(){this.colspan?this.host.style.gridColumn=`span ${this.colspan}`:this.host.style.removeProperty("grid-column")}componentWillLoad(){this.updateColspan()}render(){return e(s,{key:"
|
|
1
|
+
import{r as t,c as o,h as e,H as s,d as n}from"./p-DPdXlnVe.js";import{P as i,S as a,e as r,B as c}from"./p-BKCj6NR2.js";const h=class{constructor(e){t(this,e),this.sort=o(this,"sort",7),this.showMenu=null,this.showSorting=null,this.sticky=!1,this.sorted=!1,this.popoverPosition=i.AUTO,this.isMenuOpen=!1}get ariaSortDirection(){return this.sortDirection?this.sortDirection===a.ASC?"ascending":"descending":null}handleSort(){this.sortDirection?(this.sortDirection=this.sortDirection===a.ASC?a.DESC:a.ASC,this.sorted=!0,this.sort.emit({sortDirection:this.sortDirection})):this.sorted=!1}updateColspan(){this.colspan?this.host.style.gridColumn=`span ${this.colspan}`:this.host.style.removeProperty("grid-column")}componentWillLoad(){this.updateColspan()}render(){return e(s,{key:"deec9e49e024f48b68fe8f54ebb141dcc2b19ec1",role:"columnheader","menu-open":this.isMenuOpen,"aria-sort":this.ariaSortDirection,sortable:this.showSorting},e("div",{key:"65fefbfef58a64f3287a2f1b5defd301392bba2b",class:"cell--content"},e("slot",{key:"a88011856bacb3b2e0875ed46b8b1468660e5b31"}),this.showSorting&&e("button",{key:"46f462137de04bb88eda2e14767660fc4629f087",class:"z-th--sort-button",type:"button",onClick:this.handleSort.bind(this)},e("z-icon",{key:"bcfe38f7ff932f2074dad3ab11b5df5867292654",name:this.sortDirection===a.DESC?"arrow-simple-up":"arrow-simple-down",width:14,height:14})),this.showMenu&&e("div",{key:"90ccc4ecc6f49f8d41a45c9979fabebfd8bcad01",class:"cell--menu-container"},e("z-button",{key:"58b57db3a7129b6a811eca6f014a7b2c02050a41",variant:c.TERTIARY,icon:"contextual-menu",size:r.X_SMALL,ref:t=>this.menuTrigger=t,onClick:()=>this.popoverEl.open=!this.popoverEl.open}),e("z-popover",{key:"927004bdbc077e358c00b765d58b64a70f95c83d",ref:t=>this.popoverEl=t,bindTo:this.menuTrigger,onOpenChange:t=>this.isMenuOpen=t.detail.open,position:this.popoverPosition},e("slot",{key:"3b5dbcb8631fa4383366ff718c7e9a080b7ca3be",name:"contextual-menu"})))))}get host(){return n(this)}static get watchers(){return{colspan:[{updateColspan:0}]}}};h.style=':host{position:relative;display:flex;max-width:100%;align-items:center;padding:calc(var(--z-table--cells-padding, calc(var(--space-unit) * 2)));background-color:var(--color-surface01);gap:calc(var(--space-unit) * 2) var(--space-unit)}:host,*{box-sizing:border-box}:host([sticky]){position:sticky;z-index:1;top:0;left:0;box-shadow:8px 0 16px -8px var(--shadow-color-base)}:host([menu-open]){z-index:2}.cell--content{display:flex;width:100%;height:100%;align-items:center}:host([show-menu]) .cell--content{column-gap:var(--space-unit)}.cell--menu-container{margin-left:auto}:host(:not([show-menu])) .cell--menu-container{opacity:0;pointer-events:none}:host(:is([show-menu],[menu-open])) .cell--menu-container,:host([show-menu]) .cell--menu-container:focus-within{z-index:1;opacity:1;pointer-events:all}:host .cell-popover{z-index:100}@media (min-width: 768px) and (hover: hover){:host([show-menu="hover"]) .cell--menu-container{opacity:0;pointer-events:none}:host([show-menu="hover"]:hover) .cell--menu-container{z-index:1;opacity:1;pointer-events:all}}:host{z-index:1;padding:0;background-color:var(--color-background);font-weight:var(--font-sb)}.cell--content{padding:var(--z-table--cells-padding, calc(var(--space-unit) * 2))}:host([show-sorting]) .cell--content{column-gap:var(--space-unit)}.z-th--sort-button{position:relative;padding:0;border:none;background-color:transparent;cursor:pointer;outline:none}.z-th--sort-button:focus,.z-th--sort-button:focus-visible{box-shadow:var(--shadow-focus-primary);opacity:1;outline:none;pointer-events:all}@media (min-width: 768px) and (hover: hover){:host([show-sorting="hover"]) .z-th--sort-button{opacity:0;pointer-events:none}:host([show-sorting="hover"]:hover) .z-th--sort-button,:host([show-sorting="hover"]) .z-th--sort-button:focus:focus-visible,:host([show-sorting="always"]) .z-th--sort-button,:host([sorted]) .z-th--sort-button{opacity:1;pointer-events:all}}:host([show-sorting="hover"]:hover) .z-th--sort-button::after,:host([show-sorting="hover"]) .z-th--sort-button:focus:focus-visible::after,:host([show-sorting="always"]) .z-th--sort-button::after,:host([sorted]) .z-th--sort-button::after{position:absolute;top:6px;left:6px;width:calc(100% - 12px);height:calc(100% - 10px);background-color:transparent;content:""}';export{h as z_th}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,h as o,H as r,d as i}from"./p-DPdXlnVe.js";import{P as s,g as n,p as a}from"./p-BKCj6NR2.js";import{a as h,j as c,k as p,g as f,l as u}from"./p-D4yqZKyM.js";import"./p-Q-tWjk7P.js";const l=class{constructor(o){t(this,o),this.positionChange=e(this,"positionChange",7),this.openChange=e(this,"openChange",7),this.position=s.TOP,this.open=!1,this.showArrow=!1,this.center=!1,this.closable=!0,this.spaceTolerance=3}closePopoverWithKeyboard(t){this.closable&&t.key===n.ESC&&(t.stopPropagation(),this.open=!1)}handleOutsideClick(t){const e=t.target;this.closable&&this.open&&!h(this.host,e)&&(h(this.boundElement,e)&&t.stopPropagation(),this.open=!1)}validatePosition(t){Object.values(s).includes(t)&&t!==s.AUTO||(this.position=t=s.TOP),this.currentPosition=t,this.open&&this.setPosition()}onOpen(){if(cancelAnimationFrame(this.animationFrameRequestId),this.openChange.emit({open:this.open}),!this.open)return Object.assign(this.host.style,{top:"auto",right:"auto",bottom:"auto",left:"auto",maxWidth:"",maxHeight:"",visibility:"hidden"}),void(this.currentPosition=void 0);const t=()=>{this.open&&(this.setPosition(),this.animationFrameRequestId=requestAnimationFrame(t))};setTimeout((()=>{t()}),0)}onBindingChange(){this.findBoundElement()}get offsetModifier(){return this.center?.5:0}findBoundElement(){"string"==typeof this.bindTo?this.boundElement=this.host.ownerDocument.querySelector(this.bindTo):this.bindTo?this.boundElement=this.bindTo:(this.boundElement=c(this.host),"z-tooltip"===this.boundElement.tagName.toLowerCase()&&(this.boundElement=c(this.boundElement)))}hasCenteredHorizontalSpace(t,e,o,r){const i=(o-r)*(1-this.offsetModifier);return this.center?e>=i-this.spaceTolerance&&t>=i-this.spaceTolerance:e>=i-this.spaceTolerance}hasCenteredVerticalSpace(t,e,o,r){const i=(o-r)*(1-this.offsetModifier);return this.center?t>=i-this.spaceTolerance&&e>=i-this.spaceTolerance:e>=i-this.spaceTolerance}hasEnoughSideSpace(t,e,o,r){return t>=e-o*(1-r)-this.spaceTolerance}getOptimalPopoverPosition(t,e){const o=this.host.offsetWidth,r=this.host.offsetHeight,i=this.boundElement.getBoundingClientRect().width,n=this.boundElement.getBoundingClientRect().height,a=this.offsetModifier,h=t=>{switch(t){case s.TOP:return e.top>=r-this.spaceTolerance&&this.hasCenteredHorizontalSpace(e.left,e.right,o,i);case s.TOP_RIGHT:return e.top>=r&&this.hasEnoughSideSpace(e.right,o,i,a);case s.TOP_LEFT:return e.top>=r&&this.hasEnoughSideSpace(e.left,o,i,a);case s.RIGHT:return e.right>=o&&this.hasCenteredVerticalSpace(e.top,e.bottom,r,n);case s.RIGHT_BOTTOM:return e.right>=o&&this.hasEnoughSideSpace(e.bottom,r,n,a);case s.RIGHT_TOP:return e.right>=o&&this.hasEnoughSideSpace(e.top,r,n,a);case s.BOTTOM:return e.bottom>=r&&this.hasCenteredHorizontalSpace(e.left,e.right,o,i);case s.BOTTOM_LEFT:return e.bottom>=r&&this.hasEnoughSideSpace(e.left,o,i,a);case s.BOTTOM_RIGHT:return e.bottom>=r&&this.hasEnoughSideSpace(e.right,o,i,a);case s.LEFT:return e.left>=o&&this.hasCenteredVerticalSpace(e.top,e.bottom,r,n);case s.LEFT_TOP:return e.left>=o&&this.hasEnoughSideSpace(e.top,r,n,a);case s.LEFT_BOTTOM:return e.left>=o&&this.hasEnoughSideSpace(e.bottom,r,n,a);default:return!1}};if(h(t))return t;const c=l.positionOrder,p=c.indexOf(t);if(-1===p)return t;for(let t=1;t<c.length;t++){const e=c[(p+t)%c.length];if(h(e))return e}return this.findBestFallbackPosition(e)}findBestFallbackPosition(t){const e=t.right>=t.left?s.RIGHT:s.LEFT,o=t.bottom>=t.top?s.BOTTOM:s.TOP,r=Math.max(t.right,t.left),i=Math.max(t.bottom,t.top),n=i>=r?o:e;let a=!1;return a=n===o?r>=2*Math.min(t.right,t.left):i>=2*Math.min(t.bottom,t.top),a?`${n}_${n===o?e:o}`:n}findScrollableAncestor(t){let e=c(t);for(;e;){if(e===t.ownerDocument.documentElement)return e;const o=getComputedStyle(e),{overflow:r,overflowX:i,overflowY:s}=o;if("hidden"!==r&&"hidden"!==s&&"hidden"!==i&&(e.scrollHeight>e.clientHeight&&"visible"!==r&&"visible"!==s||e.scrollWidth>e.clientWidth&&"visible"!==r&&"visible"!==i))return e;e=c(e)}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 e=this.findScrollableAncestor(this.boundElement),o=e.getBoundingClientRect(),r=e!==this.boundElement.ownerDocument.documentElement,i=this.boundElement.ownerDocument.documentElement.clientWidth,s=this.boundElement.ownerDocument.documentElement.clientHeight;return this.cachedAvailableSpace={top:t.top-(r?o.top:0)-8,right:i-t.right-(r?i-o.right:0)-8,bottom:s-t.bottom-(r?s-o.bottom:0)-8,left:t.left-(r?o.left:0)-8},this.cachedAvailableSpace}getBoundElementOffsets(){const t=this.boundElement.getBoundingClientRect();return{top:t.top,right:this.boundElement.ownerDocument.documentElement.clientWidth-t.right,bottom:this.boundElement.ownerDocument.documentElement.clientHeight-t.bottom,left:t.left}}computePositionOffsets(){const t=this.getBoundElementOffsets(),e=p(this.host);if(e===this.host.ownerDocument.documentElement)return t;const o=e.getBoundingClientRect(),r=getComputedStyle(e),i=o.top+parseFloat(r.borderTopWidth),s=o.right-parseFloat(r.borderRightWidth),n=o.bottom-parseFloat(r.borderBottomWidth),a=o.left+parseFloat(r.borderLeftWidth),h=this.boundElement.getBoundingClientRect();return{top:h.top-i+e.scrollTop,right:s-h.right-e.scrollLeft,bottom:n-h.bottom-e.scrollTop,left:h.left-a+e.scrollLeft}}applyPositionStyles(t,e){const o=this.boundElement.offsetWidth,r=this.boundElement.offsetHeight,i=this.offsetModifier,n=this.showArrow&&this.center?8:0,h=this.host.style,c=parseFloat(getComputedStyle(this.host).marginTop.replace("px",""))||0,p=this.computePositionOffsets(),u=p.left+o*i,l=p.right+o*i,d=p.top+r,b=p.bottom+r,g=p.top+r*i,m=p.bottom+r*i;let v,w;switch(t){case s.TOP:case s.TOP_RIGHT:h.bottom=`${b}px`,h.left=u-(t===s.TOP_RIGHT?n:0)+"px",w=e.top-c,t===s.TOP_RIGHT&&(v=e.right+o*i);break;case s.TOP_LEFT:h.right=l-n+"px",h.bottom=`${b}px`,v=e.left+o*i,w=e.top-c;break;case s.BOTTOM:case s.BOTTOM_RIGHT:h.top=`${d}px`,h.left=u-(t===s.BOTTOM_RIGHT?n:0)+"px",w=e.bottom-c,t===s.BOTTOM_RIGHT&&(v=e.right+o*i);break;case s.BOTTOM_LEFT:h.top=`${d}px`,h.right=l-n+"px",v=e.left+o*i,w=e.bottom-c;break;case s.RIGHT:case s.RIGHT_BOTTOM:h.top=g-(t===s.RIGHT_BOTTOM?n:0)+"px",h.left=`${p.left+o}px`,v=e.right-c,w=t===s.RIGHT?e.top+e.bottom+r:e.bottom+r*i;break;case s.RIGHT_TOP:h.bottom=m-n+"px",h.left=`${p.left+o}px`,v=e.right-c,w=e.top+r*i;break;case s.LEFT:case s.LEFT_BOTTOM:h.top=g-(t===s.LEFT_BOTTOM?n:0)+"px",h.right=`${p.right+o}px`,v=e.left-c,t===s.LEFT_BOTTOM&&(w=e.bottom+r*i);break;case s.LEFT_TOP:h.right=`${p.right+o}px`,h.bottom=m-n+"px",v=e.left-c,w=e.top+r*i}f()!==a.MOBILE&&Object.assign(h,{maxWidth:v?`${v}px`:"",maxHeight:w?`${w}px`:""})}setPosition(){if(!this.boundElement)return;if(!u(this.boundElement,this.findScrollableAncestor(this.boundElement)))return void(this.open=!1);Object.assign(this.host.style,{top:"auto",right:"auto",bottom:"auto",left:"auto",maxWidth:"",maxHeight:"",visibility:"hidden"});const t=this.calculateAvailableSpace(),e=this.getOptimalPopoverPosition(this.position,t);this.applyPositionStyles(e,t),this.currentPosition=e,this.positionChange.emit({position:this.currentPosition}),this.host.style.visibility="visible"}componentWillLoad(){this.validatePosition(this.position)}componentDidLoad(){this.findBoundElement(),this.open&&this.onOpen()}disconnectedCallback(){cancelAnimationFrame(this.animationFrameRequestId)}render(){return o(r,{key:"11ab6b060fdc4a10752881c38d3a369f2ae267a6","current-position":this.currentPosition},o("slot",{key:"40ae4b9e51638e5d92d916937ccfac5f85c0d36f"}))}get host(){return i(this)}static get watchers(){return{position:[{validatePosition:0}],open:[{onOpen:0}],bindTo:[{onBindingChange:0}]}}};l.positionOrder=[s.TOP,s.TOP_RIGHT,s.TOP_LEFT,s.RIGHT,s.RIGHT_BOTTOM,s.RIGHT_TOP,s.BOTTOM,s.BOTTOM_LEFT,s.BOTTOM_RIGHT,s.LEFT,s.LEFT_TOP,s.LEFT_BOTTOM],l.style=':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}';export{l as z_popover}
|
|
1
|
+
import{r as t,c as e,h as o,H as r,d as i}from"./p-DPdXlnVe.js";import{P as s,g as n,p as a}from"./p-BKCj6NR2.js";import{a as h,j as c,k as p,g as f,l as u}from"./p-CPsEG702.js";import"./p-Q-tWjk7P.js";const l=class{constructor(o){t(this,o),this.positionChange=e(this,"positionChange",7),this.openChange=e(this,"openChange",7),this.position=s.TOP,this.open=!1,this.showArrow=!1,this.center=!1,this.closable=!0,this.spaceTolerance=3}closePopoverWithKeyboard(t){this.closable&&t.key===n.ESC&&(t.stopPropagation(),this.open=!1)}handleOutsideClick(t){const e=t.target;this.closable&&this.open&&!h(this.host,e)&&(h(this.boundElement,e)&&t.stopPropagation(),this.open=!1)}validatePosition(t){Object.values(s).includes(t)&&t!==s.AUTO||(this.position=t=s.TOP),this.currentPosition=t,this.open&&this.setPosition()}onOpen(){if(cancelAnimationFrame(this.animationFrameRequestId),this.openChange.emit({open:this.open}),!this.open)return Object.assign(this.host.style,{top:"auto",right:"auto",bottom:"auto",left:"auto",maxWidth:"",maxHeight:"",visibility:"hidden"}),void(this.currentPosition=void 0);const t=()=>{this.open&&(this.setPosition(),this.animationFrameRequestId=requestAnimationFrame(t))};setTimeout((()=>{t()}),0)}onBindingChange(){this.findBoundElement()}get offsetModifier(){return this.center?.5:0}findBoundElement(){"string"==typeof this.bindTo?this.boundElement=this.host.ownerDocument.querySelector(this.bindTo):this.bindTo?this.boundElement=this.bindTo:(this.boundElement=c(this.host),"z-tooltip"===this.boundElement.tagName.toLowerCase()&&(this.boundElement=c(this.boundElement)))}hasCenteredHorizontalSpace(t,e,o,r){const i=(o-r)*(1-this.offsetModifier);return this.center?e>=i-this.spaceTolerance&&t>=i-this.spaceTolerance:e>=i-this.spaceTolerance}hasCenteredVerticalSpace(t,e,o,r){const i=(o-r)*(1-this.offsetModifier);return this.center?t>=i-this.spaceTolerance&&e>=i-this.spaceTolerance:e>=i-this.spaceTolerance}hasEnoughSideSpace(t,e,o,r){return t>=e-o*(1-r)-this.spaceTolerance}getOptimalPopoverPosition(t,e){const o=this.host.offsetWidth,r=this.host.offsetHeight,i=this.boundElement.getBoundingClientRect().width,n=this.boundElement.getBoundingClientRect().height,a=this.offsetModifier,h=t=>{switch(t){case s.TOP:return e.top>=r-this.spaceTolerance&&this.hasCenteredHorizontalSpace(e.left,e.right,o,i);case s.TOP_RIGHT:return e.top>=r&&this.hasEnoughSideSpace(e.right,o,i,a);case s.TOP_LEFT:return e.top>=r&&this.hasEnoughSideSpace(e.left,o,i,a);case s.RIGHT:return e.right>=o&&this.hasCenteredVerticalSpace(e.top,e.bottom,r,n);case s.RIGHT_BOTTOM:return e.right>=o&&this.hasEnoughSideSpace(e.bottom,r,n,a);case s.RIGHT_TOP:return e.right>=o&&this.hasEnoughSideSpace(e.top,r,n,a);case s.BOTTOM:return e.bottom>=r&&this.hasCenteredHorizontalSpace(e.left,e.right,o,i);case s.BOTTOM_LEFT:return e.bottom>=r&&this.hasEnoughSideSpace(e.left,o,i,a);case s.BOTTOM_RIGHT:return e.bottom>=r&&this.hasEnoughSideSpace(e.right,o,i,a);case s.LEFT:return e.left>=o&&this.hasCenteredVerticalSpace(e.top,e.bottom,r,n);case s.LEFT_TOP:return e.left>=o&&this.hasEnoughSideSpace(e.top,r,n,a);case s.LEFT_BOTTOM:return e.left>=o&&this.hasEnoughSideSpace(e.bottom,r,n,a);default:return!1}};if(h(t))return t;const c=l.positionOrder,p=c.indexOf(t);if(-1===p)return t;for(let t=1;t<c.length;t++){const e=c[(p+t)%c.length];if(h(e))return e}return this.findBestFallbackPosition(e)}findBestFallbackPosition(t){const e=t.right>=t.left?s.RIGHT:s.LEFT,o=t.bottom>=t.top?s.BOTTOM:s.TOP,r=Math.max(t.right,t.left),i=Math.max(t.bottom,t.top),n=i>=r?o:e;let a=!1;return a=n===o?r>=2*Math.min(t.right,t.left):i>=2*Math.min(t.bottom,t.top),a?`${n}_${n===o?e:o}`:n}findScrollableAncestor(t){let e=c(t);for(;e;){if(e===t.ownerDocument.documentElement)return e;const o=getComputedStyle(e),{overflow:r,overflowX:i,overflowY:s}=o;if("hidden"!==r&&"hidden"!==s&&"hidden"!==i&&(e.scrollHeight>e.clientHeight&&"visible"!==r&&"visible"!==s||e.scrollWidth>e.clientWidth&&"visible"!==r&&"visible"!==i))return e;e=c(e)}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 e=this.findScrollableAncestor(this.boundElement),o=e.getBoundingClientRect(),r=e!==this.boundElement.ownerDocument.documentElement,i=this.boundElement.ownerDocument.documentElement.clientWidth,s=this.boundElement.ownerDocument.documentElement.clientHeight;return this.cachedAvailableSpace={top:t.top-(r?o.top:0)-8,right:i-t.right-(r?i-o.right:0)-8,bottom:s-t.bottom-(r?s-o.bottom:0)-8,left:t.left-(r?o.left:0)-8},this.cachedAvailableSpace}getBoundElementOffsets(){const t=this.boundElement.getBoundingClientRect();return{top:t.top,right:this.boundElement.ownerDocument.documentElement.clientWidth-t.right,bottom:this.boundElement.ownerDocument.documentElement.clientHeight-t.bottom,left:t.left}}computePositionOffsets(){const t=this.getBoundElementOffsets(),e=p(this.host);if(e===this.host.ownerDocument.documentElement)return t;const o=e.getBoundingClientRect(),r=getComputedStyle(e),i=o.top+parseFloat(r.borderTopWidth),s=o.right-parseFloat(r.borderRightWidth),n=o.bottom-parseFloat(r.borderBottomWidth),a=o.left+parseFloat(r.borderLeftWidth),h=this.boundElement.getBoundingClientRect();return{top:h.top-i+e.scrollTop,right:s-h.right-e.scrollLeft,bottom:n-h.bottom-e.scrollTop,left:h.left-a+e.scrollLeft}}applyPositionStyles(t,e){const o=this.boundElement.offsetWidth,r=this.boundElement.offsetHeight,i=this.offsetModifier,n=this.showArrow&&this.center?8:0,h=this.host.style,c=parseFloat(getComputedStyle(this.host).marginTop.replace("px",""))||0,p=this.computePositionOffsets(),u=p.left+o*i,l=p.right+o*i,d=p.top+r,b=p.bottom+r,g=p.top+r*i,m=p.bottom+r*i;let v,w;switch(t){case s.TOP:case s.TOP_RIGHT:h.bottom=`${b}px`,h.left=u-(t===s.TOP_RIGHT?n:0)+"px",w=e.top-c,t===s.TOP_RIGHT&&(v=e.right+o*i);break;case s.TOP_LEFT:h.right=l-n+"px",h.bottom=`${b}px`,v=e.left+o*i,w=e.top-c;break;case s.BOTTOM:case s.BOTTOM_RIGHT:h.top=`${d}px`,h.left=u-(t===s.BOTTOM_RIGHT?n:0)+"px",w=e.bottom-c,t===s.BOTTOM_RIGHT&&(v=e.right+o*i);break;case s.BOTTOM_LEFT:h.top=`${d}px`,h.right=l-n+"px",v=e.left+o*i,w=e.bottom-c;break;case s.RIGHT:case s.RIGHT_BOTTOM:h.top=g-(t===s.RIGHT_BOTTOM?n:0)+"px",h.left=`${p.left+o}px`,v=e.right-c,w=t===s.RIGHT?e.top+e.bottom+r:e.bottom+r*i;break;case s.RIGHT_TOP:h.bottom=m-n+"px",h.left=`${p.left+o}px`,v=e.right-c,w=e.top+r*i;break;case s.LEFT:case s.LEFT_BOTTOM:h.top=g-(t===s.LEFT_BOTTOM?n:0)+"px",h.right=`${p.right+o}px`,v=e.left-c,t===s.LEFT_BOTTOM&&(w=e.bottom+r*i);break;case s.LEFT_TOP:h.right=`${p.right+o}px`,h.bottom=m-n+"px",v=e.left-c,w=e.top+r*i}f()!==a.MOBILE&&Object.assign(h,{maxWidth:v?`${v}px`:"",maxHeight:w?`${w}px`:""})}setPosition(){if(!this.boundElement)return;if(!u(this.boundElement,this.findScrollableAncestor(this.boundElement)))return void(this.open=!1);Object.assign(this.host.style,{top:"auto",right:"auto",bottom:"auto",left:"auto",maxWidth:"",maxHeight:"",visibility:"hidden"});const t=this.calculateAvailableSpace(),e=this.getOptimalPopoverPosition(this.position,t);this.applyPositionStyles(e,t),this.currentPosition=e,this.positionChange.emit({position:this.currentPosition}),this.host.style.visibility="visible"}componentWillLoad(){this.validatePosition(this.position)}componentDidLoad(){this.findBoundElement(),this.open&&this.onOpen()}disconnectedCallback(){cancelAnimationFrame(this.animationFrameRequestId)}render(){return o(r,{key:"11ab6b060fdc4a10752881c38d3a369f2ae267a6","current-position":this.currentPosition},o("slot",{key:"40ae4b9e51638e5d92d916937ccfac5f85c0d36f"}))}get host(){return i(this)}static get watchers(){return{position:[{validatePosition:0}],open:[{onOpen:0}],bindTo:[{onBindingChange:0}]}}};l.positionOrder=[s.TOP,s.TOP_RIGHT,s.TOP_LEFT,s.RIGHT,s.RIGHT_BOTTOM,s.RIGHT_TOP,s.BOTTOM,s.BOTTOM_LEFT,s.BOTTOM_RIGHT,s.LEFT,s.LEFT_TOP,s.LEFT_BOTTOM],l.style=':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}';export{l as z_popover}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,d as o}from"./p-DPdXlnVe.js";import{e as s,I as a,i as r,g as n,l}from"./p-BKCj6NR2.js";import{r as h,b as c}from"./p-D4yqZKyM.js";import"./p-Q-tWjk7P.js";const d=class{watchItems(){this.itemsList="string"==typeof this.items?JSON.parse(this.items):this.items,this.selectedCounter=this.itemsList.filter((t=>t.checked)).length,this.updateRenderItemsList()}watchSearchValue(){this.filterItems(this.searchValue)}emitComboboxChange(){this.comboboxChange.emit({id:this.inputid,items:this.itemsList})}constructor(i){t(this,i),this.comboboxChange=e(this,"comboboxChange",7),this.inputid=`combo-${h()}`,this.disabled=!1,this.hassearch=!1,this.noresultslabel="Nessun risultato",this.isopen=!1,this.isfixed=!1,this.hascheckall=!1,this.checkalltext="Seleziona tutti",this.uncheckalltext="Deseleziona tutti",this.maxcheckableitems=0,this.size=s.BIG,this.renderItemsList=[],this.focusedItemId="",this.itemsList=[],this.inputType=a.TEXT,this.toggleComboBox=this.toggleComboBox.bind(this),this.closeFilterItems=this.closeFilterItems.bind(this)}componentWillLoad(){this.watchItems()}componentWillRender(){this.selectedCounter=this.itemsList.filter((t=>t.checked)).length}getControlToListSize(){switch(this.size){case s.X_SMALL:return r.SMALL;case s.SMALL:return r.MEDIUM;default:return r.LARGE}}getOptionId(t){return`${this.inputid}-option-${t}`}getCheckAllOptionId(){return`${this.inputid}-check-all`}allOptionsSelected(){return this.selectedCounter===this.itemsList.length}hasReachedMaxSelections(){return!!(this.maxcheckableitems&&this.selectedCounter>=this.maxcheckableitems)}handleHeaderKeyDown(t){if(t.code!==n.ENTER||this.focusedItemId||this.toggleComboBox(),this.isopen&&!this.hassearch)switch(t.code){case n.SPACE:case n.ENTER:this.focusedItemId&&(t.preventDefault(),this.checkOption(this.focusedItemId));break;case n.ESC:this.focusedItemId&&(this.focusedItemId="");break;case n.ARROW_DOWN:case n.ARROW_UP:this.handleArrowsNavigation(t)}}handleInputKeyDown(t){switch(t.code){case n.ENTER:case n.SPACE:if(this.focusedItemId){t.preventDefault(),this.checkOption(this.focusedItemId);break}break;case n.ARROW_DOWN:case n.ARROW_UP:this.handleArrowsNavigation(t);break;case n.ESC:if(this.focusedItemId){this.focusedItemId="";break}this.closeFilterItems();break;case n.TAB:this.focusedItemId=""}}checkOption(t){t===this.getCheckAllOptionId()?(this.itemsList=this.itemsList.map((t=>Object.assign(Object.assign({},t),{checked:!this.allOptionsSelected()}))),this.focusedItemId=this.getCheckAllOptionId()):this.itemsList=this.itemsList.map((e=>(t===this.getOptionId(e.id)&&(e.checked=!e.checked),e))),this.updateRenderItemsList(),this.emitComboboxChange()}handleArrowsNavigation(t){if(![n.ARROW_DOWN,n.ARROW_UP].includes(t.code)||!this.isopen)return;t.preventDefault(),t.stopPropagation();const e=this.focusedItemId?this.element.shadowRoot.querySelector(`#${this.focusedItemId}`):null,i=Array.from(this.element.shadowRoot.querySelectorAll('[role="option"]'));if(!i.length)return;const o=e?i.indexOf(e):null,s=i.length-1;let a=null;t.code===n.ARROW_DOWN?a=null===o?i[0]:i[o+1]||i[s]:t.code===n.ARROW_UP&&(a=null===o?i[s]:i[o-1]||i[0]),this.focusedItemId=a.id,a.scrollIntoView({block:"nearest",container:"nearest"})}updateRenderItemsList(){this.searchValue?this.filterItems(this.searchValue):this.resetRenderItemsList()}resetRenderItemsList(){const t=[];this.itemsList.forEach((e=>{t.push(Object.assign({},e))})),this.renderItemsList=t}filterItems(t){if(!t)return this.closeFilterItems();this.resetRenderItemsList(),this.renderItemsList=this.renderItemsList.filter((e=>{const i=e.name.toUpperCase().indexOf(t.toUpperCase()),o=i+t.length,s=e.name.substring(0,i)+"<strong>"+e.name.substring(i,o)+"</strong>"+e.name.substring(o,e.name.length);return e.name=s,i>=0}))}closeFilterItems(){this.searchValue="",this.resetRenderItemsList()}toggleComboBox(){this.isopen=!this.isopen}getComboboxA11yAttributes(t){const e="combobox",i=this.htmlAriaLabel,o=this.isopen?"true":"false",s=this.isopen?this.focusedItemId:"",a=`${this.inputid}_list`;return t?{role:e,"aria-label":i,"html-aria-expanded":o,"html-aria-activedescendant":s,"html-aria-controls":a}:{role:e,"aria-label":i,"aria-expanded":o,"aria-activedescendant":s,"aria-controls":a}}renderHeader(){const t=this.hassearch?{}:this.getComboboxA11yAttributes(!1);return i("div",Object.assign({class:"header",onClick:()=>this.toggleComboBox(),onKeyDown:t=>this.handleHeaderKeyDown(t),role:"button",tabindex:0,"aria-controls":"open-combo-data","aria-expanded":this.isopen?"true":"false"},t),i("span",{class:"body-3","aria-label":this.label?`${this.label}${this.selectedCounter>0?` - ${this.selectedCounter} selezionati`:""}`:void 0},this.label,i("span",null,this.selectedCounter>0&&` (${this.selectedCounter})`)),i("z-icon",{name:"caret-down",class:this.size}))}renderContent(){return i("div",{id:"open-combo-data",class:"open-combo-data"},this.hassearch&&this.renderSearchInput(),i("div",{role:"listbox","aria-label":this.label,"aria-multiselectable":"true",id:`${this.inputid}_list`,"aria-owns":`${this.hascheckall?`${this.getCheckAllOptionId()} `:""}${this.itemsList.map((t=>this.getOptionId(t.id))).join(" ")}`},this.renderItems()))}renderItems(){return i("div",{class:this.searchValue&&"search",tabIndex:-1,role:"presentation"},this.renderList(this.renderItemsList))}renderItem(t,e,o){const s=this.getOptionId(t.id),a=!t.checked&&this.hasReachedMaxSelections();return i("z-list-element",{htmlTabindex:-1,dividerType:e!==o-1?l.ELEMENT:l.NONE,size:this.getControlToListSize(),role:"presentation",disabled:!!a},i("span",{class:"option-wrap",role:"presentation",onClick:()=>{this.focusedItemId="",this.checkOption(s)}},i("z-icon",{name:t.checked?"checkbox-checked":"checkbox",class:this.focusedItemId===s?"focused":""}),i("span",{id:s,role:a?"presentation":"option","aria-selected":t.checked?"true":"false","aria-label":a?void 0:c(t.name)},i("span",{"aria-hidden":"true",innerHTML:t.name}))))}renderList(t){if(t)return!t.length&&this.searchValue?this.renderNoSearchResults():this.hasgroupitems?this.renderGroups(t):i("ul",{role:"presentation"},this.renderCheckAll(),t.map(((e,i)=>this.renderItem(e,i,t.length))))}renderGroups(t){const e=t.reduce(((e,i,o)=>{var s;const a=i.category||"Altra categoria",r=this.renderItem(i,o,t.length);return e[a]=null!==(s=e[a])&&void 0!==s?s:[],e[a].push(r),e}),{}),o=Object.entries(e).map((([t,e],o)=>i("z-list-group",{size:this.getControlToListSize(),"divider-type":l.ELEMENT,"aria-labelledby":`${this.inputid}_list_group_${o}`},i("span",{class:"body-3-sb z-list-group-title",slot:"header-title",id:`${this.inputid}_list_group_${o}`,"aria-hidden":"true"},t),e.map((t=>t)))));return i("ul",{role:"presentation"},this.renderCheckAll(),o)}renderNoSearchResults(){return i("div",{class:"no-results"},i("span",null,this.noresultslabel))}renderSearchInput(){return i("z-input",Object.assign({htmlid:`${this.inputid}_search`,label:this.searchlabel,placeholder:this.searchplaceholder,htmltitle:this.searchtitle,type:this.inputType,value:this.searchValue,message:!1,size:this.size,"html-aria-autocomplete":"list"},this.getComboboxA11yAttributes(!0),{onKeyDown:t=>this.handleInputKeyDown(t),onInputChange:t=>{this.searchValue=t.detail.value,this.focusedItemId=""}}))}renderCheckAll(){if(!this.hascheckall||this.searchValue)return;const t=this.getCheckAllOptionId(),e=this.allOptionsSelected(),o=this.hasReachedMaxSelections()||this.maxcheckableitems&&this.maxcheckableitems<this.itemsList.length;return i("z-list-element",{class:"check-all-wrapper",role:"presentation",htmlTabindex:-1,dividerType:l.ELEMENT,dividerColor:"gray800",size:this.getControlToListSize(),disabled:!!o},i("span",{class:"option-wrap",role:"presentation",onClick:()=>this.checkOption(t)},i("z-icon",{name:e?"checkbox-checked":"checkbox",class:this.focusedItemId===t?"focused":""}),i("span",{id:t,role:o?"presentation":"option","aria-selected":e?"true":"false"},e?this.uncheckalltext:this.checkalltext)))}render(){return i("div",{key:"f65a92eded2c6cd7d4bb42ddc5f667806a4f5582","data-action":`combo-${this.inputid}`,class:{open:this.isopen,fixed:this.isfixed,disabled:this.disabled},id:this.inputid},this.renderHeader(),!this.disabled&&this.renderContent())}get element(){return o(this)}static get watchers(){return{items:[{watchItems:0}],searchValue:[{watchSearchValue:0}]}}};d.style='.z-label{display:block;padding-bottom:var(--space-unit);color:var(--color-default-text);font-family:var(--font-family-sans);font-size:var(--font-size-1);font-weight:var(--font-sb);text-align:left;text-transform:uppercase}:host{display:block;min-width:290px;color:var(--color-form-default-text);fill:var(--color-form-default-icon);font-family:var(--font-family-sans)}:host>div.fixed{position:relative}:host>div>.header{position:relative;z-index:10;display:flex;min-height:42px;align-items:center;justify-content:space-between;padding:0 calc(var(--space-unit) * 1.5);border:var(--border-size-small) solid var(--color-form-surface04);margin:0;background-color:var(--color-form-background);border-radius:var(--border-radius-small);cursor:pointer}:host([size="small"])>div>.header{min-height:34px;font-size:var(--font-size-2)}:host([size="x-small"])>div>.header{min-height:30px;font-size:var(--font-size-2)}:host>div>.header:hover{outline:var(--border-size-medium) solid var(--color-form-surface04);outline-offset:-2px}:host>div>div.header:focus:focus-visible{z-index:16;box-shadow:var(--shadow-focus-primary);outline:none}:host>div>.header>span.body-3>span{font-weight:var(--font-sb)}:host>div>.header>z-icon{fill:var(--color-form-default-icon);transform:rotate(360deg);transition:all 200ms linear}:host>div>.header>z-icon.small,:host>div>.header>z-icon.x-small{--z-icon-width:16px;--z-icon-height:16px}:host>div.open>.header{border:var(--border-size-small) solid var(--color-form-active-primary);border-radius:var(--border-radius-small) var(--border-radius-small) 0 0}:host>div.disabled{pointer-events:none}:host>div.disabled .header{border-color:var(--color-form-disabled03);fill:var(--color-form-disabled01-icon)}:host>div.disabled .header>span.body-3{color:var(--color-form-disabled03)}:host>div.disabled .header>z-icon:last-child{fill:var(--color-form-disabled01-icon)}:host>div.open>.header>z-icon{fill:var(--color-form-default-icon);transform:rotate(180deg);transition:all 200ms linear}:host>div>div.open-combo-data{display:none}:host>div.open>div.open-combo-data{position:relative;z-index:12;display:block;padding:var(--space-unit) calc(var(--space-unit) * 2);border:var(--border-size-small) solid var(--color-form-surface03);border-top:0;background-color:var(--color-form-background);border-radius:0;box-shadow:var(--shadow-2)}:host .open .open-combo-data z-input .z-label{color:var(--color-form-default-text)}:host>div.open>div.open-combo-data>div>div{overflow:auto;max-height:235px;padding:0;padding-left:var(--space-unit);margin-left:calc(var(--space-unit) * -1);}:host>div.open>div.open-combo-data>z-input{width:100%;margin-bottom:calc(var(--space-unit) * 2)}:host>div.open>div.open-combo-data>div>div>ul{max-height:235px;padding:0 calc(var(--space-unit) * 0.5);margin:0}:host .open-combo-data z-list-element{--background-color-list-element:var(--color-form-background);--background-hover-color-list-element:var(--color-form-surface03);--background-active-color-list-element:var(--color-form-surface03)}:host .open-combo-data z-list-element[disabled]{pointer-events:none}:host .open-combo-data z-list-element .option-wrap{display:flex;flex-direction:row;align-items:center;cursor:pointer;gap:var(--space-unit)}:host .open-combo-data z-list-element[size="medium"] .option-wrap,:host .open-combo-data z-list-element[size="small"] .option-wrap{--z-icon-width:16px;--z-icon-height:16px;font-size:var(--font-size-2);gap:calc(var(--space-unit) / 2)}:host .open-combo-data z-list-element .option-wrap>z-icon{fill:var(--color-primary01)}:host .open-combo-data z-list-element[disabled] .option-wrap>z-icon{fill:var(--color-disabled01)}:host .open-combo-data z-list-element .option-wrap>z-icon.focused{border-radius:var(--border-radius-small);box-shadow:var(--shadow-focus-primary);outline:none}:host .open-combo-data z-list-element .option-wrap>[role="option"]:focus,:host .open-combo-data z-list-element .option-wrap>[role="option"]:focus-visible{outline:none}::-webkit-scrollbar{width:6px;background:linear-gradient(to right, transparent 0 1px, var(--gray200) 1px 5px, transparent 5px 6px)}::-webkit-scrollbar-thumb{background-color:var(--color-primary01)}::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}@supports not selector(::-webkit-scrollbar-track){:host{scrollbar-color:var(--color-primary01) transparent}}:host>div.open>z-input{position:relative;z-index:1;width:238px;margin:0 calc(var(--space-unit) * 2);color:var(--color-form-active-primary)}:host>div.open>div.open-combo-data>div>div.search{overflow:hidden;max-height:none;margin-top:0}:host>div.open>div.open-combo-data>div>div.search>ul{overflow:auto;max-height:180px;padding:var(--space-unit) calc(var(--space-unit) * 2)}:host .open .open-combo-data .search .no-results{display:flex;align-items:center;column-gap:var(--space-unit)}:host>.open>.open-combo-data .search .close-search{display:flex;justify-content:center}:host>div.open>div.open-combo-data>div>div.search .close-search>a{display:inline-block;height:44px;color:var(--color-form-active-primary);cursor:pointer;font-size:14px;font-weight:var(--font-sb);line-height:44px;text-align:center;text-transform:uppercase}:host>div.open>div.open-combo-data>div>div.search .close-search>a:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}:host>div.open>div.open-combo-data>div>div.check-all-wrapper{padding:calc(var(--space-unit) * 2) calc(var(--space-unit) * 0.5) calc(var(--space-unit) * 2) calc(var(--space-unit) * 1.5);border-bottom:var(--border-size-small) solid var(--gray800);margin-bottom:var(--space-unit);margin-left:calc(var(--space-unit) * -1);text-align:left}:host([size="small"])>div.open>div.open-combo-data>div>div.check-all-wrapper{padding:calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 0.5)}:host([size="x-small"])>div.open>div.open-combo-data>div>div.check-all-wrapper{padding:var(--space-unit) calc(var(--space-unit) * 0.5)}';export{d as z_combobox}
|
|
1
|
+
import{r as t,c as e,h as i,d as o}from"./p-DPdXlnVe.js";import{e as s,I as a,i as r,g as n,l}from"./p-BKCj6NR2.js";import{r as h,b as c}from"./p-CPsEG702.js";import"./p-Q-tWjk7P.js";const d=class{watchItems(){this.itemsList="string"==typeof this.items?JSON.parse(this.items):this.items,this.selectedCounter=this.itemsList.filter((t=>t.checked)).length,this.updateRenderItemsList()}watchSearchValue(){this.filterItems(this.searchValue)}emitComboboxChange(){this.comboboxChange.emit({id:this.inputid,items:this.itemsList})}constructor(i){t(this,i),this.comboboxChange=e(this,"comboboxChange",7),this.inputid=`combo-${h()}`,this.disabled=!1,this.hassearch=!1,this.noresultslabel="Nessun risultato",this.isopen=!1,this.isfixed=!1,this.hascheckall=!1,this.checkalltext="Seleziona tutti",this.uncheckalltext="Deseleziona tutti",this.maxcheckableitems=0,this.size=s.BIG,this.renderItemsList=[],this.focusedItemId="",this.itemsList=[],this.inputType=a.TEXT,this.toggleComboBox=this.toggleComboBox.bind(this),this.closeFilterItems=this.closeFilterItems.bind(this)}componentWillLoad(){this.watchItems()}componentWillRender(){this.selectedCounter=this.itemsList.filter((t=>t.checked)).length}getControlToListSize(){switch(this.size){case s.X_SMALL:return r.SMALL;case s.SMALL:return r.MEDIUM;default:return r.LARGE}}getOptionId(t){return`${this.inputid}-option-${t}`}getCheckAllOptionId(){return`${this.inputid}-check-all`}allOptionsSelected(){return this.selectedCounter===this.itemsList.length}hasReachedMaxSelections(){return!!(this.maxcheckableitems&&this.selectedCounter>=this.maxcheckableitems)}handleHeaderKeyDown(t){if(t.code!==n.ENTER||this.focusedItemId||this.toggleComboBox(),this.isopen&&!this.hassearch)switch(t.code){case n.SPACE:case n.ENTER:this.focusedItemId&&(t.preventDefault(),this.checkOption(this.focusedItemId));break;case n.ESC:this.focusedItemId&&(this.focusedItemId="");break;case n.ARROW_DOWN:case n.ARROW_UP:this.handleArrowsNavigation(t)}}handleInputKeyDown(t){switch(t.code){case n.ENTER:case n.SPACE:if(this.focusedItemId){t.preventDefault(),this.checkOption(this.focusedItemId);break}break;case n.ARROW_DOWN:case n.ARROW_UP:this.handleArrowsNavigation(t);break;case n.ESC:if(this.focusedItemId){this.focusedItemId="";break}this.closeFilterItems();break;case n.TAB:this.focusedItemId=""}}checkOption(t){t===this.getCheckAllOptionId()?(this.itemsList=this.itemsList.map((t=>Object.assign(Object.assign({},t),{checked:!this.allOptionsSelected()}))),this.focusedItemId=this.getCheckAllOptionId()):this.itemsList=this.itemsList.map((e=>(t===this.getOptionId(e.id)&&(e.checked=!e.checked),e))),this.updateRenderItemsList(),this.emitComboboxChange()}handleArrowsNavigation(t){if(![n.ARROW_DOWN,n.ARROW_UP].includes(t.code)||!this.isopen)return;t.preventDefault(),t.stopPropagation();const e=this.focusedItemId?this.element.shadowRoot.querySelector(`#${this.focusedItemId}`):null,i=Array.from(this.element.shadowRoot.querySelectorAll('[role="option"]'));if(!i.length)return;const o=e?i.indexOf(e):null,s=i.length-1;let a=null;t.code===n.ARROW_DOWN?a=null===o?i[0]:i[o+1]||i[s]:t.code===n.ARROW_UP&&(a=null===o?i[s]:i[o-1]||i[0]),this.focusedItemId=a.id,a.scrollIntoView({block:"nearest",container:"nearest"})}updateRenderItemsList(){this.searchValue?this.filterItems(this.searchValue):this.resetRenderItemsList()}resetRenderItemsList(){const t=[];this.itemsList.forEach((e=>{t.push(Object.assign({},e))})),this.renderItemsList=t}filterItems(t){if(!t)return this.closeFilterItems();this.resetRenderItemsList(),this.renderItemsList=this.renderItemsList.filter((e=>{const i=e.name.toUpperCase().indexOf(t.toUpperCase()),o=i+t.length,s=e.name.substring(0,i)+"<strong>"+e.name.substring(i,o)+"</strong>"+e.name.substring(o,e.name.length);return e.name=s,i>=0}))}closeFilterItems(){this.searchValue="",this.resetRenderItemsList()}toggleComboBox(){this.isopen=!this.isopen}getComboboxA11yAttributes(t){const e="combobox",i=this.htmlAriaLabel,o=this.isopen?"true":"false",s=this.isopen?this.focusedItemId:"",a=`${this.inputid}_list`;return t?{role:e,"aria-label":i,"html-aria-expanded":o,"html-aria-activedescendant":s,"html-aria-controls":a}:{role:e,"aria-label":i,"aria-expanded":o,"aria-activedescendant":s,"aria-controls":a}}renderHeader(){const t=this.hassearch?{}:this.getComboboxA11yAttributes(!1);return i("div",Object.assign({class:"header",onClick:()=>this.toggleComboBox(),onKeyDown:t=>this.handleHeaderKeyDown(t),role:"button",tabindex:0,"aria-controls":"open-combo-data","aria-expanded":this.isopen?"true":"false"},t),i("span",{class:"body-3","aria-label":this.label?`${this.label}${this.selectedCounter>0?` - ${this.selectedCounter} selezionati`:""}`:void 0},this.label,i("span",null,this.selectedCounter>0&&` (${this.selectedCounter})`)),i("z-icon",{name:"caret-down",class:this.size}))}renderContent(){return i("div",{id:"open-combo-data",class:"open-combo-data"},this.hassearch&&this.renderSearchInput(),i("div",{role:"listbox","aria-label":this.label,"aria-multiselectable":"true",id:`${this.inputid}_list`,"aria-owns":`${this.hascheckall?`${this.getCheckAllOptionId()} `:""}${this.itemsList.map((t=>this.getOptionId(t.id))).join(" ")}`},this.renderItems()))}renderItems(){return i("div",{class:this.searchValue&&"search",tabIndex:-1,role:"presentation"},this.renderList(this.renderItemsList))}renderItem(t,e,o){const s=this.getOptionId(t.id),a=!t.checked&&this.hasReachedMaxSelections();return i("z-list-element",{htmlTabindex:-1,dividerType:e!==o-1?l.ELEMENT:l.NONE,size:this.getControlToListSize(),role:"presentation",disabled:!!a},i("span",{class:"option-wrap",role:"presentation",onClick:()=>{this.focusedItemId="",this.checkOption(s)}},i("z-icon",{name:t.checked?"checkbox-checked":"checkbox",class:this.focusedItemId===s?"focused":""}),i("span",{id:s,role:a?"presentation":"option","aria-selected":t.checked?"true":"false","aria-label":a?void 0:c(t.name)},i("span",{"aria-hidden":"true",innerHTML:t.name}))))}renderList(t){if(t)return!t.length&&this.searchValue?this.renderNoSearchResults():this.hasgroupitems?this.renderGroups(t):i("ul",{role:"presentation"},this.renderCheckAll(),t.map(((e,i)=>this.renderItem(e,i,t.length))))}renderGroups(t){const e=t.reduce(((e,i,o)=>{var s;const a=i.category||"Altra categoria",r=this.renderItem(i,o,t.length);return e[a]=null!==(s=e[a])&&void 0!==s?s:[],e[a].push(r),e}),{}),o=Object.entries(e).map((([t,e],o)=>i("z-list-group",{size:this.getControlToListSize(),"divider-type":l.ELEMENT,"aria-labelledby":`${this.inputid}_list_group_${o}`},i("span",{class:"body-3-sb z-list-group-title",slot:"header-title",id:`${this.inputid}_list_group_${o}`,"aria-hidden":"true"},t),e.map((t=>t)))));return i("ul",{role:"presentation"},this.renderCheckAll(),o)}renderNoSearchResults(){return i("div",{class:"no-results"},i("span",null,this.noresultslabel))}renderSearchInput(){return i("z-input",Object.assign({htmlid:`${this.inputid}_search`,label:this.searchlabel,placeholder:this.searchplaceholder,htmltitle:this.searchtitle,type:this.inputType,value:this.searchValue,message:!1,size:this.size,"html-aria-autocomplete":"list"},this.getComboboxA11yAttributes(!0),{onKeyDown:t=>this.handleInputKeyDown(t),onInputChange:t=>{this.searchValue=t.detail.value,this.focusedItemId=""}}))}renderCheckAll(){if(!this.hascheckall||this.searchValue)return;const t=this.getCheckAllOptionId(),e=this.allOptionsSelected(),o=this.hasReachedMaxSelections()||this.maxcheckableitems&&this.maxcheckableitems<this.itemsList.length;return i("z-list-element",{class:"check-all-wrapper",role:"presentation",htmlTabindex:-1,dividerType:l.ELEMENT,dividerColor:"gray800",size:this.getControlToListSize(),disabled:!!o},i("span",{class:"option-wrap",role:"presentation",onClick:()=>this.checkOption(t)},i("z-icon",{name:e?"checkbox-checked":"checkbox",class:this.focusedItemId===t?"focused":""}),i("span",{id:t,role:o?"presentation":"option","aria-selected":e?"true":"false"},e?this.uncheckalltext:this.checkalltext)))}render(){return i("div",{key:"23cd031ec2894308960df94374713e9395521a56","data-action":`combo-${this.inputid}`,class:{open:this.isopen,fixed:this.isfixed,disabled:this.disabled},id:this.inputid},this.renderHeader(),!this.disabled&&this.renderContent())}get element(){return o(this)}static get watchers(){return{items:[{watchItems:0}],searchValue:[{watchSearchValue:0}]}}};d.style='.z-label{display:block;padding-bottom:var(--space-unit);color:var(--color-default-text);font-family:var(--font-family-sans);font-size:var(--font-size-1);font-weight:var(--font-sb);text-align:left;text-transform:uppercase}:host{display:block;min-width:290px;color:var(--color-form-default-text);fill:var(--color-form-default-icon);font-family:var(--font-family-sans)}:host>div.fixed{position:relative}:host>div>.header{position:relative;z-index:10;display:flex;min-height:42px;align-items:center;justify-content:space-between;padding:0 calc(var(--space-unit) * 1.5);border:var(--border-size-small) solid var(--color-form-surface04);margin:0;background-color:var(--color-form-background);border-radius:var(--border-radius-small);cursor:pointer}:host([size="small"])>div>.header{min-height:34px;font-size:var(--font-size-2)}:host([size="x-small"])>div>.header{min-height:30px;font-size:var(--font-size-2)}:host>div>.header:hover{outline:var(--border-size-medium) solid var(--color-form-surface04);outline-offset:-2px}:host>div>div.header:focus:focus-visible{z-index:16;box-shadow:var(--shadow-focus-primary);outline:none}:host>div>.header>span.body-3>span{font-weight:var(--font-sb)}:host>div>.header>z-icon{fill:var(--color-form-default-icon);transform:rotate(360deg);transition:all 200ms linear}:host>div>.header>z-icon.small,:host>div>.header>z-icon.x-small{--z-icon-width:16px;--z-icon-height:16px}:host>div.open>.header{border:var(--border-size-small) solid var(--color-form-active-primary);border-radius:var(--border-radius-small) var(--border-radius-small) 0 0}:host>div.disabled{pointer-events:none}:host>div.disabled .header{border-color:var(--color-form-disabled03);fill:var(--color-form-disabled01-icon)}:host>div.disabled .header>span.body-3{color:var(--color-form-disabled03)}:host>div.disabled .header>z-icon:last-child{fill:var(--color-form-disabled01-icon)}:host>div.open>.header>z-icon{fill:var(--color-form-default-icon);transform:rotate(180deg);transition:all 200ms linear}:host>div>div.open-combo-data{display:none}:host>div.open>div.open-combo-data{position:relative;z-index:12;display:block;padding:var(--space-unit) calc(var(--space-unit) * 2);border:var(--border-size-small) solid var(--color-form-surface03);border-top:0;background-color:var(--color-form-background);border-radius:0;box-shadow:var(--shadow-2)}:host .open .open-combo-data z-input .z-label{color:var(--color-form-default-text)}:host>div.open>div.open-combo-data>div>div{overflow:auto;max-height:235px;padding:0;padding-left:var(--space-unit);margin-left:calc(var(--space-unit) * -1);}:host>div.open>div.open-combo-data>z-input{width:100%;margin-bottom:calc(var(--space-unit) * 2)}:host>div.open>div.open-combo-data>div>div>ul{max-height:235px;padding:0 calc(var(--space-unit) * 0.5);margin:0}:host .open-combo-data z-list-element{--background-color-list-element:var(--color-form-background);--background-hover-color-list-element:var(--color-form-surface03);--background-active-color-list-element:var(--color-form-surface03)}:host .open-combo-data z-list-element[disabled]{pointer-events:none}:host .open-combo-data z-list-element .option-wrap{display:flex;flex-direction:row;align-items:center;cursor:pointer;gap:var(--space-unit)}:host .open-combo-data z-list-element[size="medium"] .option-wrap,:host .open-combo-data z-list-element[size="small"] .option-wrap{--z-icon-width:16px;--z-icon-height:16px;font-size:var(--font-size-2);gap:calc(var(--space-unit) / 2)}:host .open-combo-data z-list-element .option-wrap>z-icon{fill:var(--color-primary01)}:host .open-combo-data z-list-element[disabled] .option-wrap>z-icon{fill:var(--color-disabled01)}:host .open-combo-data z-list-element .option-wrap>z-icon.focused{border-radius:var(--border-radius-small);box-shadow:var(--shadow-focus-primary);outline:none}:host .open-combo-data z-list-element .option-wrap>[role="option"]:focus,:host .open-combo-data z-list-element .option-wrap>[role="option"]:focus-visible{outline:none}::-webkit-scrollbar{width:6px;background:linear-gradient(to right, transparent 0 1px, var(--gray200) 1px 5px, transparent 5px 6px)}::-webkit-scrollbar-thumb{background-color:var(--color-primary01)}::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}@supports not selector(::-webkit-scrollbar-track){:host{scrollbar-color:var(--color-primary01) transparent}}:host>div.open>z-input{position:relative;z-index:1;width:238px;margin:0 calc(var(--space-unit) * 2);color:var(--color-form-active-primary)}:host>div.open>div.open-combo-data>div>div.search{overflow:hidden;max-height:none;margin-top:0}:host>div.open>div.open-combo-data>div>div.search>ul{overflow:auto;max-height:180px;padding:var(--space-unit) calc(var(--space-unit) * 2)}:host .open .open-combo-data .search .no-results{display:flex;align-items:center;column-gap:var(--space-unit)}:host>.open>.open-combo-data .search .close-search{display:flex;justify-content:center}:host>div.open>div.open-combo-data>div>div.search .close-search>a{display:inline-block;height:44px;color:var(--color-form-active-primary);cursor:pointer;font-size:14px;font-weight:var(--font-sb);line-height:44px;text-align:center;text-transform:uppercase}:host>div.open>div.open-combo-data>div>div.search .close-search>a:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}:host>div.open>div.open-combo-data>div>div.check-all-wrapper{padding:calc(var(--space-unit) * 2) calc(var(--space-unit) * 0.5) calc(var(--space-unit) * 2) calc(var(--space-unit) * 1.5);border-bottom:var(--border-size-small) solid var(--gray800);margin-bottom:var(--space-unit);margin-left:calc(var(--space-unit) * -1);text-align:left}:host([size="small"])>div.open>div.open-combo-data>div>div.check-all-wrapper{padding:calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 0.5)}:host([size="x-small"])>div.open>div.open-combo-data>div>div.check-all-wrapper{padding:var(--space-unit) calc(var(--space-unit) * 0.5)}';export{d as z_combobox}
|