@zanichelli/albe-web-components 19.2.0 → 19.3.0-RC2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-844c7a99.js → index-44e3cf31.js} +2 -2
- package/dist/cjs/{index-844c7a99.js.map → index-44e3cf31.js.map} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-e8b453d5.js → utils-b1859d65.js} +7 -1
- package/dist/cjs/utils-b1859d65.js.map +1 -0
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-app-header_12.cjs.entry.js +5 -4
- package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -1
- package/dist/cjs/z-book-card-deprecated.cjs.entry.js +1 -1
- package/dist/cjs/z-book-card.cjs.entry.js +1 -1
- package/dist/cjs/z-book-card.cjs.entry.js.map +1 -1
- package/dist/cjs/z-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/z-color-picker.cjs.entry.js +1 -1
- package/dist/cjs/z-combobox.cjs.entry.js +126 -95
- package/dist/cjs/z-combobox.cjs.entry.js.map +1 -1
- package/dist/cjs/z-menu.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-info.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-list-item.cjs.entry.js +1 -1
- package/dist/cjs/z-popover.cjs.entry.js +1 -1
- package/dist/cjs/z-select.cjs.entry.js +98 -133
- package/dist/cjs/z-select.cjs.entry.js.map +1 -1
- package/dist/cjs/z-skip-to-content.cjs.entry.js +1 -1
- package/dist/cjs/z-slideshow.cjs.entry.js +1 -1
- package/dist/cjs/z-table.cjs.entry.js +2 -2
- package/dist/cjs/z-toast-notification-list.cjs.entry.js +2 -1
- package/dist/cjs/z-toast-notification-list.cjs.entry.js.map +1 -1
- package/dist/cjs/z-toggle-switch.cjs.entry.js +1 -1
- package/dist/cjs/z-tool.cjs.entry.js +1 -1
- package/dist/cjs/z-tr.cjs.entry.js +2 -2
- package/dist/collection/components/book-card/z-book-card/styles.css +2 -1
- package/dist/collection/components/list/z-list-group/index.js +21 -2
- package/dist/collection/components/list/z-list-group/index.js.map +1 -1
- package/dist/collection/components/z-combobox/index.js +142 -97
- package/dist/collection/components/z-combobox/index.js.map +1 -1
- package/dist/collection/components/z-combobox/styles.css +41 -0
- package/dist/collection/components/z-searchbar/styles.css +1 -1
- package/dist/collection/components/z-select/index.js +97 -141
- package/dist/collection/components/z-select/index.js.map +1 -1
- package/dist/collection/components/z-select/styles.css +9 -2
- package/dist/collection/components/z-toast-notification-list/index.js +2 -1
- package/dist/collection/components/z-toast-notification-list/index.js.map +1 -1
- package/dist/collection/utils/utils.js +5 -0
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/index12.js +1 -1
- package/dist/components/index16.js +5 -3
- package/dist/components/index16.js.map +1 -1
- package/dist/components/index24.js +1 -1
- package/dist/components/index25.js +2 -2
- package/dist/components/index25.js.map +1 -1
- package/dist/components/utils.js +6 -1
- package/dist/components/utils.js.map +1 -1
- package/dist/components/z-book-card.js +1 -1
- package/dist/components/z-book-card.js.map +1 -1
- package/dist/components/z-combobox.js +129 -99
- package/dist/components/z-combobox.js.map +1 -1
- package/dist/components/z-select.js +99 -134
- package/dist/components/z-select.js.map +1 -1
- package/dist/components/z-skip-to-content.js +1 -1
- package/dist/components/z-slideshow.js +1 -1
- package/dist/components/z-toast-notification-list.js +2 -1
- package/dist/components/z-toast-notification-list.js.map +1 -1
- package/dist/esm/{index-d003e5d7.js → index-167f46ad.js} +2 -2
- package/dist/esm/{index-d003e5d7.js.map → index-167f46ad.js.map} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-1b64bcd9.js → utils-8d6ca808.js} +7 -2
- package/dist/esm/utils-8d6ca808.js.map +1 -0
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-app-header_12.entry.js +5 -4
- package/dist/esm/z-app-header_12.entry.js.map +1 -1
- package/dist/esm/z-book-card-deprecated.entry.js +1 -1
- package/dist/esm/z-book-card.entry.js +1 -1
- package/dist/esm/z-book-card.entry.js.map +1 -1
- package/dist/esm/z-breadcrumb.entry.js +1 -1
- package/dist/esm/z-color-picker.entry.js +1 -1
- package/dist/esm/z-combobox.entry.js +126 -95
- package/dist/esm/z-combobox.entry.js.map +1 -1
- package/dist/esm/z-menu.entry.js +1 -1
- package/dist/esm/z-myz-card-info.entry.js +1 -1
- package/dist/esm/z-myz-list-item.entry.js +1 -1
- package/dist/esm/z-popover.entry.js +1 -1
- package/dist/esm/z-select.entry.js +98 -133
- package/dist/esm/z-select.entry.js.map +1 -1
- package/dist/esm/z-skip-to-content.entry.js +1 -1
- package/dist/esm/z-slideshow.entry.js +1 -1
- package/dist/esm/z-table.entry.js +2 -2
- package/dist/esm/z-toast-notification-list.entry.js +2 -1
- package/dist/esm/z-toast-notification-list.entry.js.map +1 -1
- package/dist/esm/z-toggle-switch.entry.js +1 -1
- package/dist/esm/z-tool.entry.js +1 -1
- package/dist/esm/z-tr.entry.js +2 -2
- package/dist/types/components/list/z-list-group/index.d.ts +4 -0
- package/dist/types/components/z-combobox/index.d.ts +10 -11
- package/dist/types/components/z-select/index.d.ts +5 -7
- package/dist/types/components.d.ts +16 -0
- package/dist/types/utils/utils.d.ts +2 -0
- package/dist/web-components-library/index.esm.js +1 -1
- package/dist/web-components-library/{p-1a0c206d.js → p-061e28d6.js} +2 -2
- package/dist/web-components-library/p-061e28d6.js.map +1 -0
- package/dist/web-components-library/{p-0a192ddf.entry.js → p-22b683a3.entry.js} +2 -2
- package/dist/web-components-library/p-42bbe6c8.entry.js +2 -0
- package/dist/web-components-library/p-42bbe6c8.entry.js.map +1 -0
- package/dist/web-components-library/{p-f9e41b2e.entry.js → p-47b7bc63.entry.js} +2 -2
- package/dist/web-components-library/{p-84ed6163.entry.js → p-5838b77c.entry.js} +2 -2
- package/dist/web-components-library/{p-6af67a60.entry.js → p-59fac888.entry.js} +2 -2
- package/dist/web-components-library/{p-6af67a60.entry.js.map → p-59fac888.entry.js.map} +1 -1
- package/dist/web-components-library/p-64b3d620.entry.js +2 -0
- package/dist/web-components-library/p-64b3d620.entry.js.map +1 -0
- package/dist/web-components-library/p-83a26e88.entry.js +2 -0
- package/{www/build/p-2501dd29.entry.js.map → dist/web-components-library/p-83a26e88.entry.js.map} +1 -1
- package/dist/web-components-library/p-8503c87a.entry.js +2 -0
- package/dist/web-components-library/p-8503c87a.entry.js.map +1 -0
- package/dist/web-components-library/{p-59baa7f5.entry.js → p-87edcc75.entry.js} +2 -2
- package/{www/build/p-7d6c4b21.entry.js → dist/web-components-library/p-8aaceeed.entry.js} +2 -2
- package/dist/web-components-library/p-901518b8.entry.js +2 -0
- package/dist/web-components-library/{p-7b199026.entry.js → p-90babaaa.entry.js} +2 -2
- package/dist/web-components-library/{p-7b199026.entry.js.map → p-90babaaa.entry.js.map} +1 -1
- package/dist/web-components-library/{p-9a63ec80.entry.js → p-9eba4a37.entry.js} +2 -2
- package/{www/build/p-c5d52872.entry.js → dist/web-components-library/p-a3f9a5da.entry.js} +2 -2
- package/{www/build/p-8a53fefb.entry.js → dist/web-components-library/p-b0324c7d.entry.js} +2 -2
- package/dist/web-components-library/{p-d1a04722.entry.js → p-b70ff542.entry.js} +2 -2
- package/{www/build/p-684142d7.entry.js → dist/web-components-library/p-bc15e1dc.entry.js} +2 -2
- package/dist/web-components-library/{p-a7bb5e87.js → p-ec2a0b31.js} +2 -2
- package/dist/web-components-library/p-f8e95a75.entry.js +2 -0
- package/dist/web-components-library/{p-db2c3235.entry.js.map → p-f8e95a75.entry.js.map} +1 -1
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/dist/web-components-library/web-components-library.esm.js.map +1 -1
- package/package.json +3 -2
- package/www/build/index.esm.js +1 -1
- package/www/build/{p-1a0c206d.js → p-061e28d6.js} +2 -2
- package/www/build/p-061e28d6.js.map +1 -0
- package/www/build/{p-0a192ddf.entry.js → p-22b683a3.entry.js} +2 -2
- package/www/build/p-2ba3b584.js +2 -0
- package/www/build/p-42bbe6c8.entry.js +2 -0
- package/www/build/p-42bbe6c8.entry.js.map +1 -0
- package/www/build/{p-f9e41b2e.entry.js → p-47b7bc63.entry.js} +2 -2
- package/www/build/{p-84ed6163.entry.js → p-5838b77c.entry.js} +2 -2
- package/www/build/{p-6af67a60.entry.js → p-59fac888.entry.js} +2 -2
- package/www/build/{p-6af67a60.entry.js.map → p-59fac888.entry.js.map} +1 -1
- package/www/build/p-64b3d620.entry.js +2 -0
- package/www/build/p-64b3d620.entry.js.map +1 -0
- package/www/build/p-83a26e88.entry.js +2 -0
- package/{dist/web-components-library/p-2501dd29.entry.js.map → www/build/p-83a26e88.entry.js.map} +1 -1
- package/www/build/p-8503c87a.entry.js +2 -0
- package/www/build/p-8503c87a.entry.js.map +1 -0
- package/www/build/{p-59baa7f5.entry.js → p-87edcc75.entry.js} +2 -2
- package/{dist/web-components-library/p-7d6c4b21.entry.js → www/build/p-8aaceeed.entry.js} +2 -2
- package/www/build/p-901518b8.entry.js +2 -0
- package/www/build/{p-7b199026.entry.js → p-90babaaa.entry.js} +2 -2
- package/www/build/{p-7b199026.entry.js.map → p-90babaaa.entry.js.map} +1 -1
- package/www/build/{p-9a63ec80.entry.js → p-9eba4a37.entry.js} +2 -2
- package/{dist/web-components-library/p-c5d52872.entry.js → www/build/p-a3f9a5da.entry.js} +2 -2
- package/{dist/web-components-library/p-8a53fefb.entry.js → www/build/p-b0324c7d.entry.js} +2 -2
- package/www/build/{p-d1a04722.entry.js → p-b70ff542.entry.js} +2 -2
- package/{dist/web-components-library/p-684142d7.entry.js → www/build/p-bc15e1dc.entry.js} +2 -2
- package/www/build/{p-a7bb5e87.js → p-ec2a0b31.js} +2 -2
- package/www/build/p-f8e95a75.entry.js +2 -0
- package/www/build/{p-db2c3235.entry.js.map → p-f8e95a75.entry.js.map} +1 -1
- package/www/build/web-components-library.esm.js +1 -1
- package/www/build/web-components-library.esm.js.map +1 -1
- package/www/index.html +1 -1
- package/dist/cjs/utils-e8b453d5.js.map +0 -1
- package/dist/esm/utils-1b64bcd9.js.map +0 -1
- package/dist/web-components-library/p-1a0c206d.js.map +0 -1
- package/dist/web-components-library/p-2501dd29.entry.js +0 -2
- package/dist/web-components-library/p-6d11da08.entry.js +0 -2
- package/dist/web-components-library/p-6d11da08.entry.js.map +0 -1
- package/dist/web-components-library/p-839e2478.entry.js +0 -2
- package/dist/web-components-library/p-b8211903.entry.js +0 -2
- package/dist/web-components-library/p-b8211903.entry.js.map +0 -1
- package/dist/web-components-library/p-daa442e6.entry.js +0 -2
- package/dist/web-components-library/p-daa442e6.entry.js.map +0 -1
- package/dist/web-components-library/p-db2c3235.entry.js +0 -2
- package/www/build/p-1a0c206d.js.map +0 -1
- package/www/build/p-2501dd29.entry.js +0 -2
- package/www/build/p-385363df.js +0 -2
- package/www/build/p-6d11da08.entry.js +0 -2
- package/www/build/p-6d11da08.entry.js.map +0 -1
- package/www/build/p-839e2478.entry.js +0 -2
- package/www/build/p-b8211903.entry.js +0 -2
- package/www/build/p-b8211903.entry.js.map +0 -1
- package/www/build/p-daa442e6.entry.js +0 -2
- package/www/build/p-daa442e6.entry.js.map +0 -1
- package/www/build/p-db2c3235.entry.js +0 -2
- /package/dist/web-components-library/{p-0a192ddf.entry.js.map → p-22b683a3.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-f9e41b2e.entry.js.map → p-47b7bc63.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-84ed6163.entry.js.map → p-5838b77c.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-59baa7f5.entry.js.map → p-87edcc75.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-7d6c4b21.entry.js.map → p-8aaceeed.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-839e2478.entry.js.map → p-901518b8.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-9a63ec80.entry.js.map → p-9eba4a37.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-c5d52872.entry.js.map → p-a3f9a5da.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-8a53fefb.entry.js.map → p-b0324c7d.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-d1a04722.entry.js.map → p-b70ff542.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-684142d7.entry.js.map → p-bc15e1dc.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-a7bb5e87.js.map → p-ec2a0b31.js.map} +0 -0
- /package/www/build/{p-0a192ddf.entry.js.map → p-22b683a3.entry.js.map} +0 -0
- /package/www/build/{p-f9e41b2e.entry.js.map → p-47b7bc63.entry.js.map} +0 -0
- /package/www/build/{p-84ed6163.entry.js.map → p-5838b77c.entry.js.map} +0 -0
- /package/www/build/{p-59baa7f5.entry.js.map → p-87edcc75.entry.js.map} +0 -0
- /package/www/build/{p-7d6c4b21.entry.js.map → p-8aaceeed.entry.js.map} +0 -0
- /package/www/build/{p-839e2478.entry.js.map → p-901518b8.entry.js.map} +0 -0
- /package/www/build/{p-9a63ec80.entry.js.map → p-9eba4a37.entry.js.map} +0 -0
- /package/www/build/{p-c5d52872.entry.js.map → p-a3f9a5da.entry.js.map} +0 -0
- /package/www/build/{p-8a53fefb.entry.js.map → p-b0324c7d.entry.js.map} +0 -0
- /package/www/build/{p-d1a04722.entry.js.map → p-b70ff542.entry.js.map} +0 -0
- /package/www/build/{p-684142d7.entry.js.map → p-bc15e1dc.entry.js.map} +0 -0
- /package/www/build/{p-a7bb5e87.js.map → p-ec2a0b31.js.map} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as e,h as i,g as o}from"./p-75c4a726.js";import{I as s,e as a,i as r,g as n,l}from"./p-86618221.js";import{r as c,e as h}from"./p-061e28d6.js";import"./p-5145a606.js";const d='.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)\n 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)}';const p=d;const u=class{watchItems(){this.itemsList=typeof this.items==="string"?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.itemsList=[];this.inputType=s.TEXT;this.inputid=`combo-${c()}`;this.items=undefined;this.label=undefined;this.disabled=false;this.hassearch=false;this.searchlabel=undefined;this.searchplaceholder=undefined;this.searchtitle=undefined;this.noresultslabel="Nessun risultato";this.isopen=false;this.isfixed=false;this.hascheckall=false;this.checkalltext="Seleziona tutti";this.uncheckalltext="Deseleziona tutti";this.maxcheckableitems=0;this.hasgroupitems=undefined;this.size=a.BIG;this.htmlAriaLabel=undefined;this.searchValue=undefined;this.selectedCounter=undefined;this.renderItemsList=[];this.focusedItemId="";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 a.X_SMALL:return r.SMALL;case a.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()}if(!this.isopen||this.hassearch){return}switch(t.code){case n.SPACE:case n.ENTER:if(this.focusedItemId){t.preventDefault();this.checkOption(this.focusedItemId)}break;case n.ESC:if(this.focusedItemId){this.focusedItemId=""}break;case n.ARROW_DOWN:case n.ARROW_UP:this.handleArrowsNavigation(t);break}}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="";break}}checkOption(t){if(t===this.getCheckAllOptionId()){this.itemsList=this.itemsList.map((t=>Object.assign(Object.assign({},t),{checked:!this.allOptionsSelected()})));this.focusedItemId=this.getCheckAllOptionId()}else{this.itemsList=this.itemsList.map((e=>{if(t===this.getOptionId(e.id)){e.checked=!e.checked}return 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;const i=Array.from(this.element.shadowRoot.querySelectorAll('[role="option"]'));if(!i.length){return}const o=e?i.indexOf(e):null;const s=0;const a=i.length-1;let r=null;if(t.code===n.ARROW_DOWN){r=o===null?i[s]:i[o+1]||i[a]}else if(t.code===n.ARROW_UP){r=o===null?i[a]:i[o-1]||i[s]}this.focusedItemId=r.id;r.scrollIntoView({block:"center"})}updateRenderItemsList(){if(this.searchValue){this.filterItems(this.searchValue)}else{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());const o=i+t.length;const s=e.name.substring(0,i)+"<strong>"+e.name.substring(i,o)+"</strong>"+e.name.substring(o,e.name.length);e.name=s;return i>=0}))}closeFilterItems(){this.searchValue="";this.resetRenderItemsList()}toggleComboBox(){this.isopen=!this.isopen}getComboboxA11yAttributes(t){const e="combobox";const i=this.htmlAriaLabel;const o=this.isopen?"true":"false";const s=this.isopen?this.focusedItemId:"";const a=`${this.inputid}_list`;if(t){return{role:e,"aria-label":i,"html-aria-expanded":o,"html-aria-activedescendant":s,"html-aria-controls":a}}return{role:e,"aria-label":i,"aria-expanded":o,"aria-activedescendant":s,"aria-controls":a}}renderHeader(){const t=!this.hassearch?this.getComboboxA11yAttributes(false):{};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`:``}`:undefined},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":Array.from(this.element.shadowRoot.querySelectorAll("[role='option']")).map((t=>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);const 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":h(t.name),innerHTML:t.name})))}renderList(t){if(!t){return}if(!t.length&&this.searchValue){return this.renderNoSearchResults()}if(this.hasgroupitems){return this.renderGroups(t)}return 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";const r=this.renderItem(i,o,t.length);e[a]=(s=e[a])!==null&&s!==void 0?s:[];e[a].push(r);return e}),{});const 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:false,size:this.size,"html-aria-autocomplete":"list"},this.getComboboxA11yAttributes(true),{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();const e=this.allOptionsSelected();const 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:"1d32261bd5f2e41b8b8ab9fbbe7b603059824d3e","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"],searchValue:["watchSearchValue"]}}};u.style=p;export{u as z_combobox};
|
|
2
|
+
//# sourceMappingURL=p-64b3d620.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["stylesCss","ZComboboxStyle0","ZCombobox","watchItems","this","itemsList","items","JSON","parse","selectedCounter","filter","item","checked","length","updateRenderItemsList","watchSearchValue","filterItems","searchValue","emitComboboxChange","comboboxChange","emit","id","inputid","constructor","hostRef","inputType","InputType","TEXT","randomId","ControlSize","BIG","toggleComboBox","bind","closeFilterItems","componentWillLoad","componentWillRender","getControlToListSize","size","X_SMALL","ListSize","SMALL","MEDIUM","LARGE","getOptionId","itemId","getCheckAllOptionId","allOptionsSelected","hasReachedMaxSelections","maxcheckableitems","handleHeaderKeyDown","e","code","KeyboardCode","ENTER","focusedItemId","isopen","hassearch","SPACE","preventDefault","checkOption","ESC","ARROW_DOWN","ARROW_UP","handleArrowsNavigation","handleInputKeyDown","TAB","optionId","map","Object","assign","i","includes","stopPropagation","currElem","element","shadowRoot","querySelector","options","Array","from","querySelectorAll","currElemIndex","indexOf","firstElemIndex","lastElemIndex","nextElem","scrollIntoView","block","resetRenderItemsList","renderItemsList","forEach","push","value","start","name","toUpperCase","end","newName","substring","getComboboxA11yAttributes","isZInput","role","ariaLabel","htmlAriaLabel","ariaExpanded","ariaActivedescendant","ariaControls","renderHeader","comboboxA11yAttributes","h","class","onClick","onKeyDown","tabindex","label","undefined","renderContent","renderSearchInput","join","renderItems","tabIndex","renderList","renderItem","index","isDisabled","htmlTabindex","dividerType","ListDividerType","ELEMENT","NONE","disabled","getPlainText","innerHTML","renderNoSearchResults","hasgroupitems","renderGroups","renderCheckAll","newData","reduce","group","category","zListItem","_a","listGroups","entries","key","slot","noresultslabel","htmlid","searchlabel","placeholder","searchplaceholder","htmltitle","searchtitle","type","message","onInputChange","detail","hascheckall","allChecked","dividerColor","uncheckalltext","checkalltext","render","open","fixed","isfixed"],"sources":["src/components/z-combobox/styles.css?tag=z-combobox&encapsulation=shadow","src/components/z-combobox/index.tsx"],"sourcesContent":["@import \"../css-components/z-label/styles.css\";\n\n:host {\n display: block;\n min-width: 290px;\n color: var(--color-form-default-text);\n fill: var(--color-form-default-icon);\n font-family: var(--font-family-sans);\n}\n\n:host > div.fixed {\n position: relative;\n}\n\n:host > div > .header {\n position: relative;\n z-index: 10;\n display: flex;\n min-height: 42px;\n align-items: center;\n justify-content: space-between;\n padding: 0 calc(var(--space-unit) * 1.5);\n border: var(--border-size-small) solid var(--color-form-surface04);\n margin: 0;\n background-color: var(--color-form-background);\n border-radius: var(--border-radius-small);\n cursor: pointer;\n}\n\n:host([size=\"small\"]) > div > .header {\n min-height: 34px;\n font-size: var(--font-size-2);\n}\n\n:host([size=\"x-small\"]) > div > .header {\n min-height: 30px;\n font-size: var(--font-size-2);\n}\n\n:host > div > .header:hover {\n outline: var(--border-size-medium) solid var(--color-form-surface04);\n outline-offset: -2px;\n}\n\n:host > div > div.header:focus:focus-visible {\n z-index: 16;\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n:host > div > .header > span.body-3 > span {\n font-weight: var(--font-sb);\n}\n\n:host > div > .header > z-icon {\n fill: var(--color-form-default-icon);\n transform: rotate(360deg);\n transition: all 200ms linear;\n}\n\n:host > div > .header > z-icon.small,\n:host > div > .header > z-icon.x-small {\n --z-icon-width: 16px;\n --z-icon-height: 16px;\n}\n\n:host > div.open > .header {\n border: var(--border-size-small) solid var(--color-form-active-primary);\n border-radius: var(--border-radius-small) var(--border-radius-small) 0 0;\n}\n\n:host > div.disabled {\n pointer-events: none;\n}\n\n:host > div.disabled .header {\n border-color: var(--color-form-disabled03);\n fill: var(--color-form-disabled01-icon);\n}\n\n:host > div.disabled .header > span.body-3 {\n color: var(--color-form-disabled03);\n}\n\n:host > div.disabled .header > z-icon:last-child {\n fill: var(--color-form-disabled01-icon);\n}\n\n:host > div.open > .header > z-icon {\n fill: var(--color-form-default-icon);\n transform: rotate(180deg);\n transition: all 200ms linear;\n}\n\n:host > div > div.open-combo-data {\n display: none;\n}\n\n:host > div.open > div.open-combo-data {\n position: relative;\n z-index: 12;\n display: block;\n padding: var(--space-unit) calc(var(--space-unit) * 2);\n border: var(--border-size-small) solid var(--color-form-surface03);\n border-top: 0;\n background-color: var(--color-form-background);\n border-radius: 0;\n box-shadow: var(--shadow-2);\n}\n\n:host .open .open-combo-data z-input .z-label {\n color: var(--color-form-default-text);\n}\n\n:host > div.open > div.open-combo-data > div > div {\n overflow: auto;\n max-height: 235px;\n padding: 0;\n padding-left: var(--space-unit); /* padding left and negative margin in order to enable focus */\n margin-left: calc(var(--space-unit) * -1); /* padding left and negative margin in order to enable focus */\n}\n\n:host > div.open > div.open-combo-data > z-input {\n width: 100%;\n margin-bottom: calc(var(--space-unit) * 2);\n}\n\n:host > div.open > div.open-combo-data > div > div > ul {\n max-height: 235px;\n padding: 0 calc(var(--space-unit) * 0.5); /* needed for checkbox focus shadow */\n margin: 0;\n}\n\n:host .open-combo-data z-list-element {\n --background-color-list-element: var(--color-form-background);\n --background-hover-color-list-element: var(--color-form-surface03);\n --background-active-color-list-element: var(--color-form-surface03);\n}\n\n:host .open-combo-data z-list-element[disabled] {\n pointer-events: none;\n}\n\n:host .open-combo-data z-list-element .option-wrap {\n display: flex;\n flex-direction: row;\n align-items: center;\n cursor: pointer;\n gap: var(--space-unit);\n}\n\n:host .open-combo-data z-list-element[size=\"medium\"] .option-wrap,\n:host .open-combo-data z-list-element[size=\"small\"] .option-wrap {\n --z-icon-width: 16px;\n --z-icon-height: 16px;\n\n font-size: var(--font-size-2);\n gap: calc(var(--space-unit) / 2);\n}\n\n:host .open-combo-data z-list-element .option-wrap > z-icon {\n fill: var(--color-primary01);\n}\n\n:host .open-combo-data z-list-element[disabled] .option-wrap > z-icon {\n fill: var(--color-disabled01);\n}\n\n:host .open-combo-data z-list-element .option-wrap > z-icon.focused {\n border-radius: var(--border-radius-small);\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n:host .open-combo-data z-list-element .option-wrap > [role=\"option\"]:focus,\n:host .open-combo-data z-list-element .option-wrap > [role=\"option\"]:focus-visible {\n outline: none;\n}\n\n::-webkit-scrollbar {\n width: 6px;\n background: linear-gradient(to right, transparent 0 1px, var(--gray200) 1px 5px, transparent 5px 6px);\n}\n\n::-webkit-scrollbar-thumb {\n background-color: var(--color-primary01);\n}\n\n::-webkit-scrollbar-thumb:hover {\n background-color: var(--color-hover-primary);\n}\n\n/* Firefox scrollbar */\n@supports not selector(::-webkit-scrollbar-track) {\n :host {\n scrollbar-color: var(--color-primary01) transparent;\n }\n}\n\n:host > div.open > z-input {\n position: relative;\n z-index: 1;\n width: 238px;\n margin: 0 calc(var(--space-unit) * 2);\n color: var(--color-form-active-primary);\n}\n\n:host > div.open > div.open-combo-data > div > div.search {\n overflow: hidden;\n max-height: none;\n margin-top: 0;\n}\n\n:host > div.open > div.open-combo-data > div > div.search > ul {\n overflow: auto;\n max-height: 180px;\n padding: var(--space-unit) calc(var(--space-unit) * 2);\n}\n\n:host .open .open-combo-data .search .no-results {\n display: flex;\n align-items: center;\n column-gap: var(--space-unit);\n}\n\n:host > .open > .open-combo-data .search .close-search {\n display: flex;\n justify-content: center;\n}\n\n:host > div.open > div.open-combo-data > div > div.search .close-search > a {\n display: inline-block;\n height: 44px;\n color: var(--color-form-active-primary);\n cursor: pointer;\n font-size: 14px;\n font-weight: var(--font-sb);\n line-height: 44px;\n text-align: center;\n text-transform: uppercase;\n}\n\n:host > div.open > div.open-combo-data > div > div.search .close-search > a:focus:focus-visible {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n:host > div.open > div.open-combo-data > div > div.check-all-wrapper {\n /* padding left and negative margin in order to enable focus */\n padding: calc(var(--space-unit) * 2) calc(var(--space-unit) * 0.5) calc(var(--space-unit) * 2)\n calc(var(--space-unit) * 1.5);\n border-bottom: var(--border-size-small) solid var(--gray800);\n margin-bottom: var(--space-unit);\n margin-left: calc(var(--space-unit) * -1);\n text-align: left;\n}\n\n:host([size=\"small\"]) > div.open > div.open-combo-data > div > div.check-all-wrapper {\n padding: calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 0.5);\n}\n\n:host([size=\"x-small\"]) > div.open > div.open-combo-data > div > div.check-all-wrapper {\n padding: var(--space-unit) calc(var(--space-unit) * 0.5);\n}\n","import {Component, Element, Event, EventEmitter, Prop, State, Watch, h} from \"@stencil/core\";\nimport {ComboItem, ControlSize, InputType, KeyboardCode, ListDividerType, ListSize} from \"../../beans\";\nimport {getPlainText, randomId} from \"../../utils/utils\";\nimport {ZInput} from \"../z-input\";\n\n@Component({\n tag: \"z-combobox\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZCombobox {\n @Element() element: HTMLZComboboxElement;\n\n /** input unique id */\n @Prop()\n inputid = `combo-${randomId()}`;\n\n /** list items array */\n @Prop()\n items: ComboItem[] | string;\n\n /** label text */\n @Prop()\n label: string;\n\n /** the combobox is disabled */\n @Prop({reflect: true})\n disabled?: boolean = false;\n\n /** show search input flag (optional) */\n @Prop()\n hassearch?: boolean = false;\n\n /** search input label text (optional) */\n @Prop()\n searchlabel?: string;\n\n /** search input placeholder text (optional) */\n @Prop()\n searchplaceholder?: string;\n\n /** search input title text (optional) */\n @Prop()\n searchtitle?: string;\n\n /** no result text message */\n @Prop()\n noresultslabel?: string = \"Nessun risultato\";\n\n /** toggle combo list opening flag */\n @Prop({mutable: true})\n isopen = false;\n\n /** fixed style flag */\n @Prop()\n isfixed = false;\n\n /** show \"check all\" checkbox (optional) */\n @Prop()\n hascheckall?: boolean = false;\n\n /** check all label (optional) */\n @Prop()\n checkalltext?: string = \"Seleziona tutti\";\n\n /** uncheck all label (optional) */\n @Prop()\n uncheckalltext?: string = \"Deseleziona tutti\";\n\n /** max number of checkable items (0 = unlimited) */\n @Prop()\n maxcheckableitems = 0;\n\n /** group items by category */\n @Prop()\n hasgroupitems?: boolean;\n\n /** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */\n @Prop()\n size?: ControlSize = ControlSize.BIG;\n\n /** the combobox aria-label */\n @Prop()\n htmlAriaLabel?: string;\n\n @State()\n searchValue: string;\n\n @State()\n selectedCounter: number;\n\n @State()\n renderItemsList: ComboItem[] = []; // used for render only\n\n @State()\n focusedItemId = \"\";\n\n private itemsList: ComboItem[] = [];\n\n private inputType: InputType = InputType.TEXT;\n\n @Watch(\"items\")\n watchItems(): void {\n this.itemsList = typeof this.items === \"string\" ? JSON.parse(this.items) : this.items;\n this.selectedCounter = this.itemsList.filter((item) => item.checked).length;\n this.updateRenderItemsList();\n }\n\n @Watch(\"searchValue\")\n watchSearchValue(): void {\n this.filterItems(this.searchValue);\n }\n\n /** Emitted when value is checked/unchecked. Returns id, items. */\n @Event()\n comboboxChange: EventEmitter;\n\n private emitComboboxChange(): void {\n this.comboboxChange.emit({id: this.inputid, items: this.itemsList});\n }\n\n constructor() {\n this.toggleComboBox = this.toggleComboBox.bind(this);\n this.closeFilterItems = this.closeFilterItems.bind(this);\n }\n\n componentWillLoad(): void {\n this.watchItems();\n }\n\n componentWillRender(): void {\n this.selectedCounter = this.itemsList.filter((item) => item.checked).length;\n }\n\n private getControlToListSize(): ListSize {\n switch (this.size) {\n case ControlSize.X_SMALL:\n return ListSize.SMALL;\n case ControlSize.SMALL:\n return ListSize.MEDIUM;\n default:\n return ListSize.LARGE;\n }\n }\n\n private getOptionId(itemId: string): string {\n return `${this.inputid}-option-${itemId}`;\n }\n\n private getCheckAllOptionId(): string {\n return `${this.inputid}-check-all`;\n }\n\n private allOptionsSelected(): boolean {\n return this.selectedCounter === this.itemsList.length;\n }\n\n private hasReachedMaxSelections(): boolean {\n return !!(this.maxcheckableitems && this.selectedCounter >= this.maxcheckableitems);\n }\n\n private handleHeaderKeyDown(e: KeyboardEvent): void {\n if (e.code === KeyboardCode.ENTER && !this.focusedItemId) {\n this.toggleComboBox();\n }\n\n if (!this.isopen || this.hassearch) {\n return;\n }\n\n switch (e.code as KeyboardCode) {\n case KeyboardCode.SPACE:\n case KeyboardCode.ENTER:\n if (this.focusedItemId) {\n e.preventDefault();\n this.checkOption(this.focusedItemId);\n }\n break;\n case KeyboardCode.ESC:\n if (this.focusedItemId) {\n this.focusedItemId = \"\";\n }\n break;\n case KeyboardCode.ARROW_DOWN:\n case KeyboardCode.ARROW_UP:\n this.handleArrowsNavigation(e);\n break;\n }\n }\n\n private handleInputKeyDown(e: KeyboardEvent): void {\n switch (e.code as KeyboardCode) {\n case KeyboardCode.ENTER:\n case KeyboardCode.SPACE:\n if (this.focusedItemId) {\n e.preventDefault();\n this.checkOption(this.focusedItemId);\n break;\n }\n break;\n case KeyboardCode.ARROW_DOWN:\n case KeyboardCode.ARROW_UP:\n this.handleArrowsNavigation(e);\n break;\n case KeyboardCode.ESC:\n if (this.focusedItemId) {\n this.focusedItemId = \"\";\n break;\n }\n this.closeFilterItems();\n break;\n case KeyboardCode.TAB:\n this.focusedItemId = \"\";\n break;\n }\n }\n\n private checkOption(optionId: string): void {\n if (optionId === this.getCheckAllOptionId()) {\n this.itemsList = this.itemsList.map((item: ComboItem) => ({\n ...item,\n checked: !this.allOptionsSelected(),\n }));\n\n this.focusedItemId = this.getCheckAllOptionId();\n } else {\n this.itemsList = this.itemsList.map((i: ComboItem) => {\n if (optionId === this.getOptionId(i.id)) {\n i.checked = !i.checked;\n }\n\n return i;\n });\n }\n\n this.updateRenderItemsList();\n this.emitComboboxChange();\n }\n\n private handleArrowsNavigation(e: KeyboardEvent): void {\n if (![KeyboardCode.ARROW_DOWN, KeyboardCode.ARROW_UP].includes(e.code as KeyboardCode) || !this.isopen) {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n\n const currElem = this.focusedItemId ? this.element.shadowRoot.querySelector(`#${this.focusedItemId}`) : null;\n const options = Array.from(this.element.shadowRoot.querySelectorAll('[role=\"option\"]'));\n\n if (!options.length) {\n return;\n }\n\n const currElemIndex = currElem ? options.indexOf(currElem) : null;\n const firstElemIndex = 0;\n const lastElemIndex = options.length - 1;\n\n let nextElem = null;\n if (e.code === KeyboardCode.ARROW_DOWN) {\n nextElem =\n currElemIndex === null ? options[firstElemIndex] : options[currElemIndex + 1] || options[lastElemIndex];\n } else if (e.code === KeyboardCode.ARROW_UP) {\n nextElem =\n currElemIndex === null ? options[lastElemIndex] : options[currElemIndex - 1] || options[firstElemIndex];\n }\n\n this.focusedItemId = nextElem.id;\n nextElem.scrollIntoView({block: \"center\"});\n }\n\n private updateRenderItemsList(): void {\n if (this.searchValue) {\n this.filterItems(this.searchValue);\n } else {\n this.resetRenderItemsList();\n }\n }\n\n private resetRenderItemsList(): void {\n const renderItemsList = [];\n this.itemsList.forEach((item: ComboItem) => {\n renderItemsList.push({...item});\n });\n this.renderItemsList = renderItemsList;\n }\n\n private filterItems(value: string): void {\n if (!value) {\n return this.closeFilterItems();\n }\n\n this.resetRenderItemsList();\n this.renderItemsList = this.renderItemsList.filter((item) => {\n const start = item.name.toUpperCase().indexOf(value.toUpperCase());\n const end = start + value.length;\n const newName =\n item.name.substring(0, start) +\n \"<strong>\" +\n item.name.substring(start, end) +\n \"</strong>\" +\n item.name.substring(end, item.name.length);\n\n item.name = newName;\n\n return start >= 0;\n });\n }\n\n private closeFilterItems(): void {\n this.searchValue = \"\";\n this.resetRenderItemsList();\n }\n\n private toggleComboBox(): void {\n this.isopen = !this.isopen;\n }\n\n private getComboboxA11yAttributes(isZInput: boolean): Record<string, string> {\n const role = \"combobox\";\n const ariaLabel = this.htmlAriaLabel;\n const ariaExpanded = this.isopen ? \"true\" : \"false\";\n const ariaActivedescendant = this.isopen ? this.focusedItemId : \"\";\n const ariaControls = `${this.inputid}_list`;\n\n if (isZInput) {\n return {\n \"role\": role,\n \"aria-label\": ariaLabel,\n \"html-aria-expanded\": ariaExpanded,\n \"html-aria-activedescendant\": ariaActivedescendant,\n \"html-aria-controls\": ariaControls,\n };\n }\n\n return {\n \"role\": role,\n \"aria-label\": ariaLabel,\n \"aria-expanded\": ariaExpanded,\n \"aria-activedescendant\": ariaActivedescendant,\n \"aria-controls\": ariaControls,\n };\n }\n\n private renderHeader(): HTMLDivElement {\n const comboboxA11yAttributes = !this.hassearch ? this.getComboboxA11yAttributes(false) : {};\n\n return (\n <div\n class=\"header\"\n onClick={() => this.toggleComboBox()}\n onKeyDown={(e: KeyboardEvent) => this.handleHeaderKeyDown(e)}\n role=\"button\"\n tabindex={0}\n aria-controls=\"open-combo-data\"\n aria-expanded={this.isopen ? \"true\" : \"false\"}\n {...comboboxA11yAttributes}\n >\n <span\n class=\"body-3\"\n aria-label={\n this.label\n ? `${this.label}${this.selectedCounter > 0 ? ` - ${this.selectedCounter} selezionati` : ``}`\n : undefined\n }\n >\n {this.label}\n <span>{this.selectedCounter > 0 && ` (${this.selectedCounter})`}</span>\n </span>\n <z-icon\n name=\"caret-down\"\n class={this.size}\n />\n </div>\n );\n }\n\n private renderContent(): HTMLDivElement {\n return (\n <div\n id=\"open-combo-data\"\n class=\"open-combo-data\"\n >\n {this.hassearch && this.renderSearchInput()}\n <div\n role=\"listbox\"\n aria-label={this.label}\n aria-multiselectable=\"true\"\n id={`${this.inputid}_list`}\n aria-owns={Array.from(this.element.shadowRoot.querySelectorAll(\"[role='option']\"))\n .map((item) => item.id)\n .join(\" \")}\n >\n {this.renderItems()}\n </div>\n </div>\n );\n }\n\n private renderItems(): HTMLDivElement {\n return (\n <div\n class={this.searchValue && \"search\"}\n tabIndex={-1}\n role=\"presentation\"\n >\n {this.renderList(this.renderItemsList)}\n </div>\n );\n }\n\n private renderItem(item: ComboItem, index: number, length: number): HTMLZListElement {\n const optionId = this.getOptionId(item.id);\n const isDisabled = !item.checked && this.hasReachedMaxSelections();\n\n return (\n <z-list-element\n htmlTabindex={-1}\n dividerType={index !== length - 1 ? ListDividerType.ELEMENT : ListDividerType.NONE}\n size={this.getControlToListSize()}\n role=\"presentation\"\n disabled={!!isDisabled}\n >\n <span\n class=\"option-wrap\"\n role=\"presentation\"\n onClick={() => {\n this.focusedItemId = \"\";\n this.checkOption(optionId);\n }}\n >\n <z-icon\n name={item.checked ? \"checkbox-checked\" : \"checkbox\"}\n class={this.focusedItemId === optionId ? \"focused\" : \"\"}\n />\n <span\n id={optionId}\n role={isDisabled ? \"presentation\" : \"option\"}\n aria-selected={item.checked ? \"true\" : \"false\"}\n aria-label={getPlainText(item.name)}\n innerHTML={item.name}\n />\n </span>\n </z-list-element>\n );\n }\n\n private renderList(items: ComboItem[]): HTMLUListElement {\n if (!items) {\n return;\n }\n if (!items.length && this.searchValue) {\n return this.renderNoSearchResults();\n }\n\n if (this.hasgroupitems) {\n return this.renderGroups(items);\n }\n\n return (\n <ul role=\"presentation\">\n {this.renderCheckAll()}\n {items.map((item, i) => {\n return this.renderItem(item, i, items.length);\n })}\n </ul>\n );\n }\n\n private renderGroups(items: ComboItem[]): HTMLUListElement {\n const newData = items.reduce((group, item, index) => {\n const category = item.category || \"Altra categoria\";\n const zListItem = this.renderItem(item, index, items.length);\n\n group[category] = group[category] ?? [];\n group[category].push(zListItem);\n\n return group;\n }, {});\n\n const listGroups = Object.entries(newData as {[key: string]: HTMLZListElementElement[]}).map(\n ([key, value], index) => {\n return (\n <z-list-group\n size={this.getControlToListSize()}\n divider-type={ListDividerType.ELEMENT}\n aria-labelledby={`${this.inputid}_list_group_${index}`}\n >\n <span\n class=\"body-3-sb z-list-group-title\"\n slot=\"header-title\"\n id={`${this.inputid}_list_group_${index}`}\n aria-hidden=\"true\"\n >\n {key}\n </span>\n {value.map((item) => item)}\n </z-list-group>\n );\n }\n );\n\n return (\n <ul role=\"presentation\">\n {this.renderCheckAll()}\n {listGroups}\n </ul>\n );\n }\n\n private renderNoSearchResults(): HTMLUListElement {\n return (\n <div class=\"no-results\">\n <span>{this.noresultslabel}</span>\n </div>\n );\n }\n\n private renderSearchInput(): ZInput {\n return (\n <z-input\n htmlid={`${this.inputid}_search`}\n label={this.searchlabel}\n placeholder={this.searchplaceholder}\n htmltitle={this.searchtitle}\n type={this.inputType}\n value={this.searchValue}\n message={false}\n size={this.size}\n html-aria-autocomplete=\"list\"\n {...this.getComboboxA11yAttributes(true)}\n onKeyDown={(e: KeyboardEvent) => this.handleInputKeyDown(e)}\n onInputChange={(e: CustomEvent) => {\n this.searchValue = e.detail.value;\n this.focusedItemId = \"\";\n }}\n />\n );\n }\n\n private renderCheckAll(): HTMLDivElement {\n if (!this.hascheckall || this.searchValue) {\n return;\n }\n\n const optionId = this.getCheckAllOptionId();\n const allChecked = this.allOptionsSelected();\n const isDisabled =\n this.hasReachedMaxSelections() || (this.maxcheckableitems && this.maxcheckableitems < this.itemsList.length);\n\n return (\n <z-list-element\n class=\"check-all-wrapper\"\n role=\"presentation\"\n htmlTabindex={-1}\n dividerType={ListDividerType.ELEMENT}\n dividerColor=\"gray800\"\n size={this.getControlToListSize()}\n disabled={!!isDisabled}\n >\n <span\n class=\"option-wrap\"\n role=\"presentation\"\n onClick={() => this.checkOption(optionId)}\n >\n <z-icon\n name={allChecked ? \"checkbox-checked\" : \"checkbox\"}\n class={this.focusedItemId === optionId ? \"focused\" : \"\"}\n />\n <span\n id={optionId}\n role={isDisabled ? \"presentation\" : \"option\"}\n aria-selected={allChecked ? \"true\" : \"false\"}\n >\n {allChecked ? this.uncheckalltext : this.checkalltext}\n </span>\n </span>\n </z-list-element>\n );\n }\n\n render(): HTMLDivElement {\n return (\n <div\n data-action={`combo-${this.inputid}`}\n class={{open: this.isopen, fixed: this.isfixed, disabled: this.disabled}}\n id={this.inputid}\n >\n {this.renderHeader()}\n {!this.disabled && this.renderContent()}\n </div>\n );\n }\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,h as i,a as n,g as o}from"./p-75c4a726.js";import{T as s}from"./p-86618221.js";import{f as e,d as c}from"./p-061e28d6.js";import"./p-5145a606.js";const r=".sc-z-skip-to-content-h{position:absolute;left:-100%;height:60px;box-sizing:border-box;padding:calc(var(--space-unit) * 1.25) calc(var(--space-unit) * 3);background-color:#24f4ff;font-family:var(--font-family-sans);font-weight:var(--font-rg);text-align:center}.sc-z-skip-to-content-h>.link-container.sc-z-skip-to-content{display:inline-flex;height:100%;align-items:center}.skip-to-content-visible.sc-z-skip-to-content-h,.sc-z-skip-to-content-h:focus{position:static;display:block}.sc-z-skip-to-content-h>.link-container.sc-z-skip-to-content>a.z-link.link-invisible.sc-z-skip-to-content{overflow:hidden;width:0;height:0}.sc-z-skip-to-content-h>.link-container.sc-z-skip-to-content>a.z-link.link-visible.sc-z-skip-to-content{width:initial;height:initial}.dark.sc-z-skip-to-content-h{background-color:var(--color-surface05);color:var(--color-surface01)}.light.sc-z-skip-to-content-h{border:var(--border-size-medium) solid var(--color-surface05);background-color:var(--color-surface01);color:var(--color-default-text)}@media (min-width: 768px){.sc-z-skip-to-content-h{text-align:start}}@media (min-width: 1152px){.sc-z-skip-to-content-h>.link-container.sc-z-skip-to-content{padding:0 calc(var(--space-unit) * 3);border-right:var(--border-size-small) solid var(--color-surface05)}.sc-z-skip-to-content-h>.link-container.sc-z-skip-to-content>a.z-link.link-invisible.sc-z-skip-to-content{overflow:initial;width:initial;height:initial}.sc-z-skip-to-content-h>.link-container.sc-z-skip-to-content:first-child{padding-left:0}.sc-z-skip-to-content-h>.link-container.sc-z-skip-to-content:last-child,.dark.sc-z-skip-to-content-h>.link-container.sc-z-skip-to-content:last-child,.light.sc-z-skip-to-content-h>.link-container.sc-z-skip-to-content:last-child{padding-right:0;border-right:none}.dark.sc-z-skip-to-content-h>.link-container.sc-z-skip-to-content{border-right:var(--border-size-small) solid var(--color-surface01)}}";const a=r;const l=class{constructor(i){t(this,i);this.variant=undefined;this.links=[];this.visible=false;this.visibleLink=""}handleFocusOutSkipToContent(t){if(this.isInSkipToContent(t.target)){this.visible=false}}handleFocusSkipToContent(t){if(this.isInSkipToContent(t.target)){this.visible=true}}componentDidLoad(){this.showFirstChild()}componentWillRender(){if(this.links){this.links=typeof this.links==="string"?JSON.parse(this.links):this.links}}isInSkipToContent(t){const i=e(t);const n=i.find((t=>t.nodeName.toLowerCase()==="z-skip-to-content"));return!!n}showFirstChild(){var t;const i=(t=this.hostElement.children)===null||t===void 0?void 0:t[0];if(i){this.visibleLink=i.id}}handleLinkClick(){this.visible=false}render(){return i(n,{key:"8b913cd494118ddb3e53d529d40a60693b75a157",class:{[this.variant]:true,"skip-to-content-visible":this.visible}},this.links.map(((t,n)=>{const o=`skip-to-content-${n}`;return i("div",{class:"link-container"},i("a",{id:o,class:{"body-1-sb":true,"z-link":true,"z-link-underline":true,"z-link-inverse":this.variant===s.DARK,"link-visible":o==this.visibleLink,"link-invisible":o!=this.visibleLink},"aria-label":t.ariaLabel||t.label,href:t.href,onFocus:()=>this.visibleLink=o,onClick:()=>this.handleLinkClick(),onKeyUp:t=>c(t,this.handleLinkClick.bind(this))},t.label))})))}get hostElement(){return o(this)}};l.style=a;export{l as z_skip_to_content};
|
|
2
|
+
//# sourceMappingURL=p-83a26e88.entry.js.map
|
package/{www/build/p-2501dd29.entry.js.map → dist/web-components-library/p-83a26e88.entry.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["stylesCss","ZSkipToContentStyle0","ZSkipToContent","handleFocusOutSkipToContent","e","this","isInSkipToContent","target","visible","handleFocusSkipToContent","componentDidLoad","showFirstChild","componentWillRender","links","JSON","parse","elem","tree","getElementTree","menuParent","find","nodeName","toLowerCase","firstChild","_a","hostElement","children","visibleLink","id","handleLinkClick","render","h","Host","key","class","variant","map","link","i","ThemeVariant","DARK","ariaLabel","label","href","onFocus","onClick","onKeyUp","handleKeyboardSubmit","bind"],"sources":["src/components/z-skip-to-content/styles.css?tag=z-skip-to-content&encapsulation=scoped","src/components/z-skip-to-content/index.tsx"],"sourcesContent":[":host {\n position: absolute;\n left: -100%;\n height: 60px;\n box-sizing: border-box;\n padding: calc(var(--space-unit) * 1.25) calc(var(--space-unit) * 3);\n background-color: #24f4ff;\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n text-align: center;\n}\n\n:host > .link-container {\n display: inline-flex;\n height: 100%;\n align-items: center;\n}\n\n:host.skip-to-content-visible,\n:host:focus {\n position: static;\n display: block;\n}\n\n:host > .link-container > a.z-link.link-invisible {\n overflow: hidden;\n width: 0;\n height: 0;\n}\n\n:host > .link-container > a.z-link.link-visible {\n width: initial;\n height: initial;\n}\n\n:host.dark {\n background-color: var(--color-surface05);\n color: var(--color-surface01);\n}\n\n:host.light {\n border: var(--border-size-medium) solid var(--color-surface05);\n background-color: var(--color-surface01);\n color: var(--color-default-text);\n}\n\n/* Tablet breakpoint */\n@media (min-width: 768px) {\n :host {\n text-align: start;\n }\n}\n\n/* Desktop breakpoint */\n@media (min-width: 1152px) {\n :host > .link-container {\n padding: 0 calc(var(--space-unit) * 3);\n border-right: var(--border-size-small) solid var(--color-surface05);\n }\n\n :host > .link-container > a.z-link.link-invisible {\n overflow: initial;\n width: initial;\n height: initial;\n }\n\n :host > .link-container:first-child {\n padding-left: 0;\n }\n\n :host > .link-container:last-child,\n :host.dark > .link-container:last-child,\n :host.light > .link-container:last-child {\n padding-right: 0;\n border-right: none;\n }\n\n :host.dark > .link-container {\n border-right: var(--border-size-small) solid var(--color-surface01);\n }\n}\n","import {Component, Element, Host, Listen, Prop, State, h} from \"@stencil/core\";\nimport {SkipToContentLink, ThemeVariant} from \"../../beans\";\nimport {getElementTree, handleKeyboardSubmit} from \"../../utils/utils\";\n\n/**\n * Component short description.\n */\n@Component({\n tag: \"z-skip-to-content\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZSkipToContent {\n /** Graphical variant: `dark`, `light`. */\n @Prop({reflect: true})\n variant?: ThemeVariant;\n\n /** Array to fill link into skip-content */\n @Prop({mutable: true})\n links: string | SkipToContentLink[] = [];\n\n @State()\n visible = false;\n\n @State()\n visibleLink = \"\";\n\n @Element() hostElement: HTMLZSkipToContentElement;\n\n @Listen(\"focusout\", {target: \"document\"})\n handleFocusOutSkipToContent(e: FocusEvent): void {\n if (this.isInSkipToContent(e.target)) {\n this.visible = false;\n }\n }\n\n @Listen(\"focusin\", {target: \"document\"})\n handleFocusSkipToContent(e: FocusEvent): void {\n if (this.isInSkipToContent(e.target)) {\n this.visible = true;\n }\n }\n\n componentDidLoad(): void {\n this.showFirstChild();\n }\n\n componentWillRender(): void {\n if (this.links) {\n this.links = typeof this.links === \"string\" ? JSON.parse(this.links) : this.links;\n }\n }\n\n private isInSkipToContent(elem): boolean {\n const tree = getElementTree(elem);\n const menuParent = tree.find((elem: Element) => elem.nodeName.toLowerCase() === \"z-skip-to-content\");\n\n return !!menuParent;\n }\n\n private showFirstChild(): void {\n const firstChild = this.hostElement.children?.[0];\n if (firstChild) {\n this.visibleLink = firstChild.id;\n }\n }\n\n private handleLinkClick(): void {\n this.visible = false;\n }\n\n render(): HTMLZSkipToContentElement {\n return (\n <Host\n class={{\n [this.variant]: true,\n \"skip-to-content-visible\": this.visible,\n }}\n >\n {(this.links as SkipToContentLink[]).map((link, i) => {\n const id = `skip-to-content-${i}`;\n\n return (\n <div class=\"link-container\">\n <a\n id={id}\n class={{\n \"body-1-sb\": true,\n \"z-link\": true,\n \"z-link-underline\": true,\n \"z-link-inverse\": this.variant === ThemeVariant.DARK,\n \"link-visible\": id == this.visibleLink,\n \"link-invisible\": id != this.visibleLink,\n }}\n aria-label={link.ariaLabel || link.label}\n href={link.href}\n onFocus={() => (this.visibleLink = id)}\n onClick={() => this.handleLinkClick()}\n onKeyUp={(e) => handleKeyboardSubmit(e, this.handleLinkClick.bind(this))}\n >\n {link.label}\n </a>\n </div>\n );\n })}\n </Host>\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["stylesCss","ZSkipToContentStyle0","ZSkipToContent","handleFocusOutSkipToContent","e","this","isInSkipToContent","target","visible","handleFocusSkipToContent","componentDidLoad","showFirstChild","componentWillRender","links","JSON","parse","elem","tree","getElementTree","menuParent","find","nodeName","toLowerCase","firstChild","_a","hostElement","children","visibleLink","id","handleLinkClick","render","h","Host","key","class","variant","map","link","i","ThemeVariant","DARK","ariaLabel","label","href","onFocus","onClick","onKeyUp","handleKeyboardSubmit","bind"],"sources":["src/components/z-skip-to-content/styles.css?tag=z-skip-to-content&encapsulation=scoped","src/components/z-skip-to-content/index.tsx"],"sourcesContent":[":host {\n position: absolute;\n left: -100%;\n height: 60px;\n box-sizing: border-box;\n padding: calc(var(--space-unit) * 1.25) calc(var(--space-unit) * 3);\n background-color: #24f4ff;\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n text-align: center;\n}\n\n:host > .link-container {\n display: inline-flex;\n height: 100%;\n align-items: center;\n}\n\n:host.skip-to-content-visible,\n:host:focus {\n position: static;\n display: block;\n}\n\n:host > .link-container > a.z-link.link-invisible {\n overflow: hidden;\n width: 0;\n height: 0;\n}\n\n:host > .link-container > a.z-link.link-visible {\n width: initial;\n height: initial;\n}\n\n:host.dark {\n background-color: var(--color-surface05);\n color: var(--color-surface01);\n}\n\n:host.light {\n border: var(--border-size-medium) solid var(--color-surface05);\n background-color: var(--color-surface01);\n color: var(--color-default-text);\n}\n\n/* Tablet breakpoint */\n@media (min-width: 768px) {\n :host {\n text-align: start;\n }\n}\n\n/* Desktop breakpoint */\n@media (min-width: 1152px) {\n :host > .link-container {\n padding: 0 calc(var(--space-unit) * 3);\n border-right: var(--border-size-small) solid var(--color-surface05);\n }\n\n :host > .link-container > a.z-link.link-invisible {\n overflow: initial;\n width: initial;\n height: initial;\n }\n\n :host > .link-container:first-child {\n padding-left: 0;\n }\n\n :host > .link-container:last-child,\n :host.dark > .link-container:last-child,\n :host.light > .link-container:last-child {\n padding-right: 0;\n border-right: none;\n }\n\n :host.dark > .link-container {\n border-right: var(--border-size-small) solid var(--color-surface01);\n }\n}\n","import {Component, Element, Host, Listen, Prop, State, h} from \"@stencil/core\";\nimport {SkipToContentLink, ThemeVariant} from \"../../beans\";\nimport {getElementTree, handleKeyboardSubmit} from \"../../utils/utils\";\n\n/**\n * Component short description.\n */\n@Component({\n tag: \"z-skip-to-content\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZSkipToContent {\n /** Graphical variant: `dark`, `light`. */\n @Prop({reflect: true})\n variant?: ThemeVariant;\n\n /** Array to fill link into skip-content */\n @Prop({mutable: true})\n links: string | SkipToContentLink[] = [];\n\n @State()\n visible = false;\n\n @State()\n visibleLink = \"\";\n\n @Element() hostElement: HTMLZSkipToContentElement;\n\n @Listen(\"focusout\", {target: \"document\"})\n handleFocusOutSkipToContent(e: FocusEvent): void {\n if (this.isInSkipToContent(e.target)) {\n this.visible = false;\n }\n }\n\n @Listen(\"focusin\", {target: \"document\"})\n handleFocusSkipToContent(e: FocusEvent): void {\n if (this.isInSkipToContent(e.target)) {\n this.visible = true;\n }\n }\n\n componentDidLoad(): void {\n this.showFirstChild();\n }\n\n componentWillRender(): void {\n if (this.links) {\n this.links = typeof this.links === \"string\" ? JSON.parse(this.links) : this.links;\n }\n }\n\n private isInSkipToContent(elem): boolean {\n const tree = getElementTree(elem);\n const menuParent = tree.find((elem: Element) => elem.nodeName.toLowerCase() === \"z-skip-to-content\");\n\n return !!menuParent;\n }\n\n private showFirstChild(): void {\n const firstChild = this.hostElement.children?.[0];\n if (firstChild) {\n this.visibleLink = firstChild.id;\n }\n }\n\n private handleLinkClick(): void {\n this.visible = false;\n }\n\n render(): HTMLZSkipToContentElement {\n return (\n <Host\n class={{\n [this.variant]: true,\n \"skip-to-content-visible\": this.visible,\n }}\n >\n {(this.links as SkipToContentLink[]).map((link, i) => {\n const id = `skip-to-content-${i}`;\n\n return (\n <div class=\"link-container\">\n <a\n id={id}\n class={{\n \"body-1-sb\": true,\n \"z-link\": true,\n \"z-link-underline\": true,\n \"z-link-inverse\": this.variant === ThemeVariant.DARK,\n \"link-visible\": id == this.visibleLink,\n \"link-invisible\": id != this.visibleLink,\n }}\n aria-label={link.ariaLabel || link.label}\n href={link.href}\n onFocus={() => (this.visibleLink = id)}\n onClick={() => this.handleLinkClick()}\n onKeyUp={(e) => handleKeyboardSubmit(e, this.handleLinkClick.bind(this))}\n >\n {link.label}\n </a>\n </div>\n );\n })}\n </Host>\n );\n }\n}\n"],"mappings":"gKAAA,MAAMA,EAAY,y3DAClB,MAAAC,EAAeD,E,MCYFE,EAAc,M,2DAOa,G,aAG5B,M,iBAGI,E,CAKd,2BAAAC,CAA4BC,GAC1B,GAAIC,KAAKC,kBAAkBF,EAAEG,QAAS,CACpCF,KAAKG,QAAU,K,EAKnB,wBAAAC,CAAyBL,GACvB,GAAIC,KAAKC,kBAAkBF,EAAEG,QAAS,CACpCF,KAAKG,QAAU,I,EAInB,gBAAAE,GACEL,KAAKM,gB,CAGP,mBAAAC,GACE,GAAIP,KAAKQ,MAAO,CACdR,KAAKQ,aAAeR,KAAKQ,QAAU,SAAWC,KAAKC,MAAMV,KAAKQ,OAASR,KAAKQ,K,EAIxE,iBAAAP,CAAkBU,GACxB,MAAMC,EAAOC,EAAeF,GAC5B,MAAMG,EAAaF,EAAKG,MAAMJ,GAAkBA,EAAKK,SAASC,gBAAkB,sBAEhF,QAASH,C,CAGH,cAAAR,G,MACN,MAAMY,GAAaC,EAAAnB,KAAKoB,YAAYC,YAAQ,MAAAF,SAAA,SAAAA,EAAG,GAC/C,GAAID,EAAY,CACdlB,KAAKsB,YAAcJ,EAAWK,E,EAI1B,eAAAC,GACNxB,KAAKG,QAAU,K,CAGjB,MAAAsB,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,2CACHC,MAAO,CACL,CAAC7B,KAAK8B,SAAU,KAChB,0BAA2B9B,KAAKG,UAGhCH,KAAKQ,MAA8BuB,KAAI,CAACC,EAAMC,KAC9C,MAAMV,EAAK,mBAAmBU,IAE9B,OACEP,EAAA,OAAKG,MAAM,kBACTH,EAAA,KACEH,GAAIA,EACJM,MAAO,CACL,YAAa,KACb,SAAU,KACV,mBAAoB,KACpB,iBAAkB7B,KAAK8B,UAAYI,EAAaC,KAChD,eAAgBZ,GAAMvB,KAAKsB,YAC3B,iBAAkBC,GAAMvB,KAAKsB,aAC9B,aACWU,EAAKI,WAAaJ,EAAKK,MACnCC,KAAMN,EAAKM,KACXC,QAAS,IAAOvC,KAAKsB,YAAcC,EACnCiB,QAAS,IAAMxC,KAAKwB,kBACpBiB,QAAU1C,GAAM2C,EAAqB3C,EAAGC,KAAKwB,gBAAgBmB,KAAK3C,QAEjEgC,EAAKK,OAEJ,I","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as e,h as i,a as n,g as o}from"./p-75c4a726.js";import{X as a,e as l}from"./p-86618221.js";const r=':host{--z-book-card-portrait-cover-height:378px;--z-book-card-title-lines:2;--z-book-card-title-word-break:initial;--z-book-card-subtitle-lines:1;--z-book-card-subtitle-word-break:break-all;--z-book-card-authors-lines:1;--z-book-card-authors-word-break:break-all;display:flex;width:304px;box-sizing:border-box;flex-direction:column;border:solid var(--border-size-medium) var(--color-surface03);background-color:var(--color-surface01);border-radius:var(--border-radius);color:var(--color-default-text);font-family:var(--font-family-sans)}:host,*{box-sizing:border-box}.main-content{display:flex;height:100%;flex-direction:column;padding:var(--space-unit);gap:var(--space-unit)}.main-content .cover{position:relative;display:flex;overflow:hidden;align-items:flex-end;justify-content:center;border-radius:var(--border-radius)}.main-content .cover z-book-cover{--z-book-cover-height:var(--z-book-card-portrait-cover-height)}.main-content a.cover:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}.main-content .card-info{display:flex;flex:1;flex-direction:column;justify-content:space-between;gap:var(--space-unit)}.main-content .card-info .top{display:flex;flex-direction:column;gap:calc(var(--space-unit) * 2)}.main-content .card-info .top ::slotted([slot="tags"]){display:flex;flex-wrap:wrap;gap:var(--space-unit)}.main-content .card-info .top ::slotted([slot="data"]){display:flex;justify-content:space-between}.main-content .card-info .top .ellipsis{display:-webkit-box;overflow:hidden;height:1.4rem;-webkit-box-orient:vertical;-webkit-line-clamp:1;line-clamp:1;line-height:1.4rem;text-overflow:ellipsis;word-break:break-all}.main-content .card-info .top .ellipsis.opera-title{height:auto;max-height:calc(1.5rem * var(--z-book-card-title-lines));-webkit-line-clamp:var(--z-book-card-title-lines);line-clamp:var(--z-book-card-title-lines);line-height:1.5rem;word-break:var(--z-book-card-title-word-break)}.main-content .card-info .top .ellipsis.volume-title{height:auto;max-height:calc(1.4rem * var(--z-book-card-subtitle-lines));-webkit-line-clamp:var(--z-book-card-subtitle-lines);line-clamp:var(--z-book-card-subtitle-lines);line-height:1.4rem;word-break:var(--z-book-card-subtitle-word-break)}.main-content .card-info .top .ellipsis.authors{height:auto;max-height:calc(1.4rem * var(--z-book-card-authors-lines));-webkit-line-clamp:var(--z-book-card-authors-lines);line-clamp:var(--z-book-card-authors-lines);line-height:1.4rem;word-break:var(--z-book-card-authors-word-break)}.main-content .card-info .top .opera-title *{all:unset}.main-content .cta-wrapper{display:flex;justify-content:space-between;gap:calc(var(--space-unit) / 2)}.main-content .card-info .top .link-chip-wrapper{display:flex;justify-content:space-between}.main-content .card-info .bottom .ebook{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;padding:var(--space-unit);background-color:var(--color-primary02);border-radius:var(--border-radius);gap:var(--space-unit)}.main-content .card-info .bottom .ebook .app-name{display:flex;align-items:center;padding:calc(var(--space-unit) / 2) 0;font-family:var(--font-family-serif);gap:calc(var(--space-unit) / 2)}.main-content .card-info .bottom .ebook .app-name .ebook-logo{width:1.5rem;height:1.5rem;content:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 20 20%22 fill=%22none%22 aria-hidden=%22true%22%3E%3Cg clip-path=%22url(%23clip0_11996_224)%22%3E%3Cpath d=%22M14.6644 0.469604H5.00141C2.33305 0.469604 0.169922 2.63274 0.169922 5.3011V14.9641C0.169922 17.6324 2.33305 19.7956 5.00141 19.7956H14.6644C17.3328 19.7956 19.4959 17.6324 19.4959 14.9641V5.3011C19.4959 2.63274 17.3328 0.469604 14.6644 0.469604Z%22 fill=%22%23E2011A%22/%3E%3Cpath d=%22M15.9523 13.3536H12.7313C11.6861 13.3536 10.6683 13.6934 9.83241 14.3199C8.99657 13.6934 7.97873 13.3536 6.93352 13.3536H3.71252V5.30115H6.93352C7.97873 5.30115 8.99657 5.64096 9.83241 6.26745C10.6683 5.64096 11.6861 5.30115 12.7313 5.30115H15.9523V13.3536Z%22 fill=%22white%22/%3E%3Cpath d=%22M15.9523 14.3201H3.71252V14.9643H15.9523V14.3201Z%22 fill=%22black%22/%3E%3Cpath d=%22M8.22229 10.732V8.24543C8.22229 7.97165 8.51057 7.79449 8.75375 7.91689L11.2404 9.16019C11.5109 9.29548 11.5109 9.682 11.2404 9.81728L8.75375 11.0606C8.50896 11.183 8.22229 11.0058 8.22229 10.732Z%22 fill=%22black%22/%3E%3Cpath d=%22M4.35704 7.87826C5.42438 7.87826 6.28963 7.013 6.28963 5.94566C6.28963 4.87831 5.42438 4.01306 4.35704 4.01306C3.28969 4.01306 2.42444 4.87831 2.42444 5.94566C2.42444 7.013 3.28969 7.87826 4.35704 7.87826Z%22 fill=%22black%22/%3E%3Cpath d=%22M5.6454 5.62354H3.0686V6.26773H5.6454V5.62354Z%22 fill=%22white%22/%3E%3Cpath d=%22M4.67917 4.65723H4.03497V7.23402H4.67917V4.65723Z%22 fill=%22white%22/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id=%22clip0_11996_224%22%3E%3Crect width=%2219.326%22 height=%2219.326%22 fill=%22white%22 transform=%22translate(0.169922 0.469604)%22/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E")}:host([variant="landscape"]){width:635px;min-height:max(332px, 20.75rem);padding:0}:host([variant="landscape"]) .main-content{min-height:max(332px, 20.75rem);flex-direction:row;padding:calc(var(--space-unit) * 2);gap:calc(var(--space-unit) * 2)}:host([variant="landscape"]) .main-content .cover z-book-cover{--z-book-cover-height:300px}:host([variant="landscape"]) .main-content .card-info,:host([variant="landscape"]) .main-content .card-info .top{gap:calc(var(--space-unit) / 2)}@media (max-width: 767px){:host([variant="portrait"]){width:100%;max-width:400px}}';const s=r;const d=':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)}';const b=d;const f="button.z-link{padding:0;border:0;margin:0;background-color:transparent}a.z-link,button.z-link{display:inline-flex;cursor:pointer;font-family:var(--font-family-sans);line-height:inherit;text-decoration:none}a.z-link.z-link-icon,button.z-link.z-link-icon{--z-icon-width:1.125em;--z-icon-height:1.125em;align-items:center;column-gap:0.5em}a.z-link.z-link-sb,button.z-link.z-link-sb{font-weight:var(--font-sb)}a.z-link.z-link-underline,button.z-link.z-link-underline{text-decoration:underline}a.z-link:hover,button.z-link:hover,a.z-link:focus-visible,button.z-link:focus-visible,a.z-link:active,button.z-link:active{text-decoration:underline}a.z-link:focus-visible,button.z-link:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}a.z-link.z-link-disabled,button.z-link.z-link-disabled{box-shadow:none;color:var(--color-disabled03);cursor:default;fill:var(--color-disabled03);outline:none;pointer-events:none;text-decoration:none}a.z-link,button.z-link,a.z-link.z-link-active,button.z-link.z-link-active,a.z-link:hover,button.z-link:hover,a.z-link.z-link-active:hover,button.z-link.z-link-active:hover,a.z-link:focus-visible,button.z-link:focus-visible,a.z-link.z-link-active:focus-visible,button.z-link.z-link-active:focus-visible,a.z-link:active,button.z-link:active,a.z-link.z-link-active:active,button.z-link.z-link-active:active,a.z-link:visited,button.z-link:visited,a.z-link.z-link-active:visited,button.z-link.z-link-active:visited{color:var(--color-text-link-default);fill:var(--color-text-link-default)}a.z-link.z-link-blue,button.z-link.z-link-blue,a.z-link.z-link-blue.z-link-active,button.z-link.z-link-blue.z-link-active{color:var(--color-text-link-blue);fill:var(--color-text-link-blue)}a.z-link.z-link-red,button.z-link.z-link-red,a.z-link.z-link-red.z-link-active,button.z-link.z-link-red.z-link-active{color:var(--color-text-link-red);fill:var(--color-text-link-red)}a.z-link.z-link-inverse,button.z-link.z-link-inverse,a.z-link.z-link-inverse.z-link-active,button.z-link.z-link-inverse.z-link-active{color:var(--color-text-link-inverse);fill:var(--color-text-link-inverse)}a.z-link.z-link-blue:hover,button.z-link.z-link-blue:hover{color:var(--color-text-link-blue-hover);fill:var(--color-text-link-blue-hover)}a.z-link.z-link-red:hover,button.z-link.z-link-red:hover{color:var(--color-text-link-red-hover);fill:var(--color-text-link-red-hover)}a.z-link.z-link-inverse:hover,button.z-link.z-link-inverse:hover{color:var(--color-text-link-inverse);fill:var(--color-text-link-inverse)}a.z-link.z-link-blue:active,button.z-link.z-link-blue:active,a.z-link.z-link-blue:focus-visible,button.z-link.z-link-blue:focus-visible{color:var(--color-text-link-blue-active);fill:var(--color-text-link-blue-active)}a.z-link.z-link-red:active,button.z-link.z-link-red:active,a.z-link.z-link-red:focus-visible,button.z-link.z-link-red:focus-visible{color:var(--color-text-link-red-active);fill:var(--color-text-link-red-active)}a.z-link.z-link-inverse:active,button.z-link.z-link-inverse:active,a.z-link.z-link-inverse:focus-visible,button.z-link.z-link-inverse:focus-visible{color:var(--color-text-link-inverse);fill:var(--color-text-link-inverse)}a.z-link.z-link-blue:visited,button.z-link.z-link-blue:visited{color:var(--color-text-link-blue-visited);fill:var(--color-text-link-blue-visited)}a.z-link.z-link-red:visited,button.z-link.z-link-red:visited{color:var(--color-text-link-red-visited);fill:var(--color-text-link-red-visited)}a.z-link.z-link-inverse:visited,button.z-link.z-link-inverse:visited{color:var(--color-text-link-inverse);fill:var(--color-text-link-inverse)}";const h=f;const c=class{constructor(i){t(this,i);this.ebookClick=e(this,"ebookClick",7);this.coverClick=e(this,"coverClick",7);this.titleClick=e(this,"titleClick",7);this.variant=a.PORTRAIT;this.cover=undefined;this.operaTitle=undefined;this.volumeTitle=undefined;this.authors=undefined;this.isbn=undefined;this.isbnLabel="";this.year=undefined;this.ebookUrl=undefined;this.linkTarget="_blank";this.fallbackCover=undefined;this.hasMultipleCovers=false;this.titleHtmlTag=undefined}emitEbookClick(){this.ebookClick.emit()}emitCoverClick(){this.coverClick.emit()}emitTitleClick(){this.titleClick.emit()}renderCover(){const t=this.ebookUrl?"a":"div";const e=this.ebookUrl?{href:this.ebookUrl,onClick:()=>this.emitCoverClick(),target:this.linkTarget}:{};return i(t,Object.assign({class:"cover"},e),i("z-book-cover",{cover:this.cover,fallbackCover:this.fallbackCover,multiple:this.hasMultipleCovers&&this.variant===a.PORTRAIT},i("slot",{name:"coverOverlay",slot:"coverOverlay"})))}renderYear(){if(!this.year){return null}return i("div",{class:"year ellipsis body-4","aria-description":"anno"},this.year)}renderAuthors(){if(!this.authors){return null}return i("div",{class:"cta-wrapper"},i("div",{class:"authors ellipsis body-4","aria-description":"autori"},this.authors),this.variant===a.LANDSCAPE?this.renderCtaSlot():null)}renderOperaTitle(){const t=this.titleHtmlTag?`<${this.titleHtmlTag}>${this.operaTitle}</${this.titleHtmlTag}>`:this.operaTitle;const e=i("div",{class:"opera-title ellipsis body-2-sb",innerHTML:t});return i("div",{class:"cta-wrapper"},this.ebookUrl?i("a",{class:"z-link",href:this.ebookUrl,onClick:()=>this.emitTitleClick(),target:this.linkTarget},e):e,this.variant===a.PORTRAIT?this.renderCtaSlot():null)}renderVolumeTitle(){if(!this.volumeTitle){return null}return i("div",{class:"volume-title ellipsis body-4"},this.volumeTitle)}renderIsbn(){if(!this.isbn){return null}return i("div",{class:"isbn ellipsis body-4-sb","aria-description":`isbn ${this.isbnLabel}`},this.isbn," ",this.isbnLabel?i("span",{class:"body-4"},this.isbnLabel):null)}renderEbook(){return i("div",{class:"ebook"},i("div",{class:"app-name"},i("img",{class:"ebook-logo","aria-hidden":"true"}),i("div",{class:"body-4-sb"},"laZ Ebook")),i("z-button",{size:l.X_SMALL,href:this.ebookUrl,target:this.linkTarget,onClick:()=>this.emitEbookClick(),htmlrole:"link","aria-description":`leggi l'ebook ${this.operaTitle} su laZ Ebook`},"leggi ebook"))}renderCtaSlot(){return i("slot",{name:"cta"})}render(){return i(n,{key:"5fae727734d46a2bff95228aba24343fe8b44d71"},i("div",{key:"68bae5839bfd59cfbf64c525085db9945fccfa22",class:"main-content"},this.renderCover(),i("div",{key:"0f79c65a3b4778db175867ea3ef71a331c567dbf",class:"card-info"},i("div",{key:"14f31c2adeb8ba009385cad9f3e5b91b1571402f",class:"top"},i("div",{key:"6f53c622d7c46bc9c7086129d6e61efc3b8e87ac"},this.renderYear(),this.renderAuthors(),this.renderOperaTitle(),this.renderVolumeTitle(),this.renderIsbn()),i("slot",{key:"e320abfb8ccb71748b7f786e44f8acb7579c9008",name:"tags"}),i("slot",{key:"718e46c2db387806e6835db0a1f14880e1990a5f",name:"data"})),i("slot",{key:"625086bafb8ebb76bb4d419bfaa1f0e6a6bda8c4",name:"ebook"},!!this.ebookUrl&&i("div",{key:"534cddf3d9e4b7b184eda121d74999645bc60b4f",class:"bottom"},this.renderEbook())))),i("slot",{key:"64cf4f52982302d9aa44a0a0b63b5d54cac3c3dc",name:"apps"}))}get hostElement(){return o(this)}};c.style=s+(b+h);export{c as z_book_card};
|
|
2
|
+
//# sourceMappingURL=p-8503c87a.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["stylesCss","ZBookCardStyle0","typographyCss","ZBookCardStyle1","ZBookCardStyle2","ZBookCard","BookCardVariant","PORTRAIT","emitEbookClick","this","ebookClick","emit","emitCoverClick","coverClick","emitTitleClick","titleClick","renderCover","CoverTag","ebookUrl","coverAttrs","href","onClick","target","linkTarget","h","Object","assign","class","cover","fallbackCover","multiple","hasMultipleCovers","variant","name","slot","renderYear","year","renderAuthors","authors","LANDSCAPE","renderCtaSlot","renderOperaTitle","title","titleHtmlTag","operaTitle","innerHTML","renderVolumeTitle","volumeTitle","renderIsbn","isbn","isbnLabel","renderEbook","size","ControlSize","X_SMALL","htmlrole","render","Host","key"],"sources":["src/components/book-card/z-book-card/styles.css?tag=z-book-card&encapsulation=shadow","src/tokens/typography.css?tag=z-book-card&encapsulation=shadow","src/components/css-components/z-link/styles.css?tag=z-book-card&encapsulation=shadow","src/components/book-card/z-book-card/index.tsx"],"sourcesContent":[":host {\n --z-book-card-portrait-cover-height: 378px;\n --z-book-card-title-lines: 2;\n --z-book-card-title-word-break: initial;\n --z-book-card-subtitle-lines: 1;\n --z-book-card-subtitle-word-break: break-all;\n --z-book-card-authors-lines: 1;\n --z-book-card-authors-word-break: break-all;\n\n display: flex;\n width: 304px;\n box-sizing: border-box;\n flex-direction: column;\n border: solid var(--border-size-medium) var(--color-surface03);\n background-color: var(--color-surface01);\n border-radius: var(--border-radius);\n color: var(--color-default-text);\n font-family: var(--font-family-sans);\n}\n\n:host,\n* {\n box-sizing: border-box;\n}\n\n.main-content {\n display: flex;\n height: 100%;\n flex-direction: column;\n padding: var(--space-unit);\n gap: var(--space-unit);\n}\n\n.main-content .cover {\n position: relative;\n display: flex;\n overflow: hidden;\n align-items: flex-end;\n justify-content: center;\n border-radius: var(--border-radius);\n}\n\n.main-content .cover z-book-cover {\n --z-book-cover-height: var(--z-book-card-portrait-cover-height);\n}\n\n.main-content a.cover:focus-visible {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n.main-content .card-info {\n display: flex;\n flex: 1;\n flex-direction: column;\n justify-content: space-between;\n gap: var(--space-unit);\n}\n\n.main-content .card-info .top {\n display: flex;\n flex-direction: column;\n gap: calc(var(--space-unit) * 2);\n}\n\n.main-content .card-info .top ::slotted([slot=\"tags\"]) {\n display: flex;\n flex-wrap: wrap;\n gap: var(--space-unit);\n}\n\n.main-content .card-info .top ::slotted([slot=\"data\"]) {\n display: flex;\n justify-content: space-between;\n}\n\n.main-content .card-info .top .ellipsis {\n display: -webkit-box;\n overflow: hidden;\n height: 1.4rem;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 1;\n line-clamp: 1;\n line-height: 1.4rem;\n text-overflow: ellipsis;\n word-break: break-all;\n}\n\n.main-content .card-info .top .ellipsis.opera-title {\n height: auto;\n max-height: calc(1.5rem * var(--z-book-card-title-lines));\n -webkit-line-clamp: var(--z-book-card-title-lines);\n line-clamp: var(--z-book-card-title-lines);\n line-height: 1.5rem;\n word-break: var(--z-book-card-title-word-break);\n}\n\n.main-content .card-info .top .ellipsis.volume-title {\n height: auto;\n max-height: calc(1.4rem * var(--z-book-card-subtitle-lines));\n -webkit-line-clamp: var(--z-book-card-subtitle-lines);\n line-clamp: var(--z-book-card-subtitle-lines);\n line-height: 1.4rem;\n word-break: var(--z-book-card-subtitle-word-break);\n}\n\n.main-content .card-info .top .ellipsis.authors {\n height: auto;\n max-height: calc(1.4rem * var(--z-book-card-authors-lines));\n -webkit-line-clamp: var(--z-book-card-authors-lines);\n line-clamp: var(--z-book-card-authors-lines);\n line-height: 1.4rem;\n word-break: var(--z-book-card-authors-word-break);\n}\n\n.main-content .card-info .top .opera-title * {\n all: unset;\n}\n\n.main-content .cta-wrapper {\n display: flex;\n justify-content: space-between;\n gap: calc(var(--space-unit) / 2);\n}\n\n.main-content .card-info .top .link-chip-wrapper {\n display: flex;\n justify-content: space-between;\n}\n\n.main-content .card-info .bottom .ebook {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n padding: var(--space-unit);\n background-color: var(--color-primary02);\n border-radius: var(--border-radius);\n gap: var(--space-unit);\n}\n\n.main-content .card-info .bottom .ebook .app-name {\n display: flex;\n align-items: center;\n padding: calc(var(--space-unit) / 2) 0;\n font-family: var(--font-family-serif);\n gap: calc(var(--space-unit) / 2);\n}\n\n.main-content .card-info .bottom .ebook .app-name .ebook-logo {\n width: 1.5rem;\n height: 1.5rem;\n content: url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 20 20%22 fill=%22none%22 aria-hidden=%22true%22%3E%3Cg clip-path=%22url(%23clip0_11996_224)%22%3E%3Cpath d=%22M14.6644 0.469604H5.00141C2.33305 0.469604 0.169922 2.63274 0.169922 5.3011V14.9641C0.169922 17.6324 2.33305 19.7956 5.00141 19.7956H14.6644C17.3328 19.7956 19.4959 17.6324 19.4959 14.9641V5.3011C19.4959 2.63274 17.3328 0.469604 14.6644 0.469604Z%22 fill=%22%23E2011A%22/%3E%3Cpath d=%22M15.9523 13.3536H12.7313C11.6861 13.3536 10.6683 13.6934 9.83241 14.3199C8.99657 13.6934 7.97873 13.3536 6.93352 13.3536H3.71252V5.30115H6.93352C7.97873 5.30115 8.99657 5.64096 9.83241 6.26745C10.6683 5.64096 11.6861 5.30115 12.7313 5.30115H15.9523V13.3536Z%22 fill=%22white%22/%3E%3Cpath d=%22M15.9523 14.3201H3.71252V14.9643H15.9523V14.3201Z%22 fill=%22black%22/%3E%3Cpath d=%22M8.22229 10.732V8.24543C8.22229 7.97165 8.51057 7.79449 8.75375 7.91689L11.2404 9.16019C11.5109 9.29548 11.5109 9.682 11.2404 9.81728L8.75375 11.0606C8.50896 11.183 8.22229 11.0058 8.22229 10.732Z%22 fill=%22black%22/%3E%3Cpath d=%22M4.35704 7.87826C5.42438 7.87826 6.28963 7.013 6.28963 5.94566C6.28963 4.87831 5.42438 4.01306 4.35704 4.01306C3.28969 4.01306 2.42444 4.87831 2.42444 5.94566C2.42444 7.013 3.28969 7.87826 4.35704 7.87826Z%22 fill=%22black%22/%3E%3Cpath d=%22M5.6454 5.62354H3.0686V6.26773H5.6454V5.62354Z%22 fill=%22white%22/%3E%3Cpath d=%22M4.67917 4.65723H4.03497V7.23402H4.67917V4.65723Z%22 fill=%22white%22/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id=%22clip0_11996_224%22%3E%3Crect width=%2219.326%22 height=%2219.326%22 fill=%22white%22 transform=%22translate(0.169922 0.469604)%22/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E\");\n}\n\n:host([variant=\"landscape\"]) {\n width: 635px;\n min-height: max(332px, 20.75rem);\n padding: 0;\n}\n\n:host([variant=\"landscape\"]) .main-content {\n min-height: max(332px, 20.75rem);\n flex-direction: row;\n padding: calc(var(--space-unit) * 2);\n gap: calc(var(--space-unit) * 2);\n}\n\n:host([variant=\"landscape\"]) .main-content .cover z-book-cover {\n --z-book-cover-height: 300px;\n}\n\n:host([variant=\"landscape\"]) .main-content .card-info,\n:host([variant=\"landscape\"]) .main-content .card-info .top {\n gap: calc(var(--space-unit) / 2);\n}\n\n@media (max-width: 767px) {\n :host([variant=\"portrait\"]) {\n width: 100%;\n max-width: 400px;\n }\n}\n",":root {\n /* font-family */\n --font-family-sans: \"IBM Plex Sans\", sans-serif;\n --font-family-serif: \"IBM Plex Serif\", serif;\n\n /* font-weight */\n --font-lt: 300;\n --font-rg: 400;\n --font-sb: 600;\n --font-bd: 700;\n\n /* font-size type scale */\n --font-size-1: 0.75rem; /* 12px */\n --font-size-2: 0.875rem; /* 14px */\n --font-size-3: 1rem; /* assuming 16px */\n --font-size-4: 1.125rem; /* 18px */\n --font-size-5: 1.25rem; /* 20px */\n --font-size-6: 1.5rem; /* 24px */\n --font-size-7: 1.75rem; /* 28px */\n --font-size-8: 2rem; /* 32px */\n --font-size-9: 2.25rem; /* 36px */\n --font-size-10: 2.625rem; /* 42px */\n --font-size-11: 3rem; /* 48px */\n --font-size-12: 3.375rem; /* 54px */\n --font-size-13: 3.75rem; /* 60px */\n --font-size-14: 4.25rem; /* 68px */\n --font-size-15: 4.75rem; /* 76px */\n --font-size-16: 5.25rem; /* 84px */\n --font-size-17: 5.75rem; /* 92px */\n\n /* cssprops to use with `font` shorthand property */\n --section-title-1: var(--font-sb) var(--font-size-11) / 1.083 var(--font-family-serif);\n --section-title-2: var(--font-sb) var(--font-size-10) / 1.142 var(--font-family-serif);\n --section-title-3: var(--font-sb) var(--font-size-9) / 1.222 var(--font-family-serif);\n --section-title-4: var(--font-sb) var(--font-size-8) / 1.25 var(--font-family-serif);\n --section-title-5: var(--font-sb) var(--font-size-7) / 1.2857 var(--font-family-serif);\n --section-title-6: var(--font-sb) var(--font-size-6) / 1.333 var(--font-family-serif);\n}\n\n/* Typography classes */\n.heading-1,\n.heading-1-sb,\n.heading-1-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n}\n\n.heading-2,\n.heading-2-sb,\n.heading-2-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n}\n\n.heading-3,\n.heading-3-sb,\n.heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n}\n\n.heading-4,\n.heading-4-sb,\n.heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n}\n\n.body-1,\n.body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n}\n\n.body-2,\n.body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n}\n\n.body-3,\n.body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n}\n\n.body-4,\n.body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n}\n\n.body-5,\n.body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n}\n\n.interactive-1,\n.interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n}\n\n.interactive-2,\n.interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n}\n\n.interactive-3,\n.interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n}\n\n.helper,\n.helper-sb {\n font-size: var(--font-size-1);\n font-style: italic;\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n}\n\n/* section title */\n.section-title-1 {\n font: var(--section-title-1);\n}\n\n.section-title-2 {\n font: var(--section-title-2);\n}\n\n.section-title-3 {\n font: var(--section-title-3);\n}\n\n.section-title-4 {\n font: var(--section-title-4);\n}\n\n.section-title-5 {\n font: var(--section-title-5);\n}\n\n.section-title-6 {\n font: var(--section-title-6);\n}\n\n/* heading-1/2 for desktop and wide viewports */\n@media (min-width: 1152px) {\n .heading-1,\n .heading-1-sb,\n .heading-1-lt {\n font-size: var(--font-size-8);\n font-weight: var(--font-rg);\n line-height: 1.25;\n }\n\n .heading-2,\n .heading-2-sb,\n .heading-2-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n}\n\n/* viewport classes */\n@media (max-width: 767px) {\n .mobile-heading-1,\n .mobile-heading-1-sb,\n .mobile-heading-1-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .mobile-heading-2,\n .mobile-heading-2-sb,\n .mobile-heading-2-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .mobile-heading-3,\n .mobile-heading-3-sb,\n .mobile-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .mobile-heading-4,\n .mobile-heading-4-sb,\n .mobile-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .mobile-body-1,\n .mobile-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .mobile-body-2,\n .mobile-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .mobile-body-3,\n .mobile-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .mobile-body-4,\n .mobile-body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .mobile-body-5,\n .mobile-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .mobile-interactive-1,\n .mobile-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .mobile-interactive-2,\n .mobile-interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .mobile-interactive-3,\n .mobile-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .mobile-section-title-1 {\n font: var(--section-title-1);\n }\n\n .mobile-section-title-2 {\n font: var(--section-title-2);\n }\n\n .mobile-section-title-3 {\n font: var(--section-title-3);\n }\n\n .mobile-section-title-4 {\n font: var(--section-title-4);\n }\n\n .mobile-section-title-5 {\n font: var(--section-title-5);\n }\n\n .mobile-section-title-6 {\n font: var(--section-title-6);\n }\n\n .mobile-heading-1-lt,\n .mobile-heading-2-lt,\n .mobile-heading-3-lt,\n .mobile-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .mobile-heading-1-sb,\n .mobile-heading-2-sb,\n .mobile-heading-3-sb,\n .mobile-heading-4-sb,\n .mobile-body-1-sb,\n .mobile-body-2-sb,\n .mobile-body-3-sb,\n .mobile-body-4-sb,\n .mobile-body-5-sb,\n .mobile-interactive-1-sb,\n .mobile-interactive-2-sb,\n .mobile-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n@media (min-width: 768px) and (max-width: 1151px) {\n .tablet-heading-1,\n .tablet-heading-1-sb,\n .tablet-heading-1-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .tablet-heading-2,\n .tablet-heading-2-sb,\n .tablet-heading-2-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .tablet-heading-3,\n .tablet-heading-3-sb,\n .tablet-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .tablet-heading-4,\n .tablet-heading-4-sb,\n .tablet-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .tablet-body-1,\n .tablet-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .tablet-body-2,\n .tablet-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .tablet-body-3,\n .tablet-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .tablet-body-4,\n .tablet-body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .tablet-body-5,\n .tablet-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .tablet-interactive-1,\n .tablet-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .tablet-interactive-2,\n .tablet-interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .tablet-interactive-3,\n .tablet-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .tablet-section-title-1 {\n font: var(--section-title-1);\n }\n\n .tablet-section-title-2 {\n font: var(--section-title-2);\n }\n\n .tablet-section-title-3 {\n font: var(--section-title-3);\n }\n\n .tablet-section-title-4 {\n font: var(--section-title-4);\n }\n\n .tablet-section-title-5 {\n font: var(--section-title-5);\n }\n\n .tablet-section-title-6 {\n font: var(--section-title-6);\n }\n\n .tablet-heading-1-lt,\n .tablet-heading-2-lt,\n .tablet-heading-3-lt,\n .tablet-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .tablet-heading-1-sb,\n .tablet-heading-2-sb,\n .tablet-heading-3-sb,\n .tablet-heading-4-sb,\n .tablet-body-1-sb,\n .tablet-body-2-sb,\n .tablet-body-3-sb,\n .tablet-body-4-sb,\n .tablet-body-5-sb,\n .tablet-interactive-1-sb,\n .tablet-interactive-2-sb,\n .tablet-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n@media (min-width: 1152px) and (max-width: 1365px) {\n .desktop-heading-1,\n .desktop-heading-1-sb,\n .desktop-heading-1-lt {\n font-size: var(--font-size-8);\n font-weight: var(--font-rg);\n line-height: 1.25;\n }\n\n .desktop-heading-2,\n .desktop-heading-2-sb,\n .desktop-heading-2-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .desktop-heading-3,\n .desktop-heading-3-sb,\n .desktop-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .desktop-heading-4,\n .desktop-heading-4-sb,\n .desktop-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .desktop-body-1,\n .desktop-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .desktop-body-2,\n .desktop-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .desktop-body-3,\n .desktop-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .desktop-body-4,\n .desktop-body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .desktop-body-5,\n .desktop-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .desktop-interactive-1,\n .desktop-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .desktop-interactive-2,\n .desktop-interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .desktop-interactive-3,\n .desktop-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .desktop-section-title-1 {\n font: var(--section-title-1);\n }\n\n .desktop-section-title-2 {\n font: var(--section-title-2);\n }\n\n .desktop-section-title-3 {\n font: var(--section-title-3);\n }\n\n .desktop-section-title-4 {\n font: var(--section-title-4);\n }\n\n .desktop-section-title-5 {\n font: var(--section-title-5);\n }\n\n .desktop-section-title-6 {\n font: var(--section-title-6);\n }\n\n .desktop-heading-1-lt,\n .desktop-heading-2-lt,\n .desktop-heading-3-lt,\n .desktop-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .desktop-heading-1-sb,\n .desktop-heading-2-sb,\n .desktop-heading-3-sb,\n .desktop-heading-4-sb,\n .desktop-body-1-sb,\n .desktop-body-2-sb,\n .desktop-body-3-sb,\n .desktop-body-4-sb,\n .desktop-body-5-sb,\n .desktop-interactive-1-sb,\n .desktop-interactive-2-sb,\n .desktop-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n@media (min-width: 1366px) {\n .wide-heading-1,\n .wide-heading-1-sb,\n .wide-heading-1-lt {\n font-size: var(--font-size-8);\n font-weight: var(--font-rg);\n line-height: 1.25;\n }\n\n .wide-heading-2,\n .wide-heading-2-sb,\n .wide-heading-2-lt {\n font-size: var(--font-size-7);\n font-weight: var(--font-rg);\n line-height: 1.28;\n }\n\n .wide-heading-3,\n .wide-heading-3-sb,\n .wide-heading-3-lt {\n font-size: var(--font-size-6);\n font-weight: var(--font-rg);\n line-height: 1.333;\n }\n\n .wide-heading-4,\n .wide-heading-4-sb,\n .wide-heading-4-lt {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .wide-body-1,\n .wide-body-1-sb {\n font-size: var(--font-size-5);\n font-weight: var(--font-rg);\n line-height: 1.4;\n }\n\n .wide-body-2,\n .wide-body-2-sb {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .wide-body-3,\n .wide-body-3-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .wide-body-4,\n .wide-body-4-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .wide-body-5,\n .wide-body-5-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .wide-interactive-1,\n .wide-interactive-1-sb {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n line-height: 1.5;\n }\n\n .wide-interactive-2,\n .wide-interactive-2-sb {\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 1.4;\n }\n\n .wide-interactive-3,\n .wide-interactive-3-sb {\n font-size: var(--font-size-1);\n font-weight: var(--font-rg);\n letter-spacing: 0.32px;\n line-height: 1.333;\n }\n\n .wide-section-title-1 {\n font: var(--section-title-1);\n }\n\n .wide-section-title-2 {\n font: var(--section-title-2);\n }\n\n .wide-section-title-3 {\n font: var(--section-title-3);\n }\n\n .wide-section-title-4 {\n font: var(--section-title-4);\n }\n\n .wide-section-title-5 {\n font: var(--section-title-5);\n }\n\n .wide-section-title-6 {\n font: var(--section-title-6);\n }\n\n .wide-heading-1-lt,\n .wide-heading-2-lt,\n .wide-heading-3-lt,\n .wide-heading-4-lt {\n font-weight: var(--font-lt);\n }\n\n .wide-heading-1-sb,\n .wide-heading-2-sb,\n .wide-heading-3-sb,\n .wide-heading-4-sb,\n .wide-body-1-sb,\n .wide-body-2-sb,\n .wide-body-3-sb,\n .wide-body-4-sb,\n .wide-body-5-sb,\n .wide-interactive-1-sb,\n .wide-interactive-2-sb,\n .wide-interactive-3-sb {\n font-weight: var(--font-sb);\n }\n}\n\n/* font-weight variants */\n.heading-1-lt,\n.heading-2-lt,\n.heading-3-lt,\n.heading-4-lt {\n font-weight: var(--font-lt);\n}\n\n.heading-1-sb,\n.heading-2-sb,\n.heading-3-sb,\n.heading-4-sb,\n.body-1-sb,\n.body-2-sb,\n.body-3-sb,\n.body-4-sb,\n.body-5-sb,\n.interactive-1-sb,\n.interactive-2-sb,\n.interactive-3-sb,\n.helper-sb {\n font-weight: var(--font-sb);\n}\n","button.z-link {\n padding: 0;\n border: 0;\n margin: 0;\n background-color: transparent;\n}\n\na.z-link,\nbutton.z-link {\n display: inline-flex;\n cursor: pointer;\n font-family: var(--font-family-sans);\n line-height: inherit;\n text-decoration: none;\n}\n\na.z-link.z-link-icon,\nbutton.z-link.z-link-icon {\n --z-icon-width: 1.125em;\n --z-icon-height: 1.125em;\n\n align-items: center;\n column-gap: 0.5em;\n}\n\na.z-link.z-link-sb,\nbutton.z-link.z-link-sb {\n font-weight: var(--font-sb);\n}\n\na.z-link.z-link-underline,\nbutton.z-link.z-link-underline {\n text-decoration: underline;\n}\n\na.z-link:hover,\nbutton.z-link:hover,\na.z-link:focus-visible,\nbutton.z-link:focus-visible,\na.z-link:active,\nbutton.z-link:active {\n text-decoration: underline;\n}\n\na.z-link:focus-visible,\nbutton.z-link:focus-visible {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\na.z-link.z-link-disabled,\nbutton.z-link.z-link-disabled {\n box-shadow: none;\n color: var(--color-disabled03);\n cursor: default;\n fill: var(--color-disabled03);\n outline: none;\n pointer-events: none;\n text-decoration: none;\n}\n\na.z-link,\nbutton.z-link,\na.z-link.z-link-active,\nbutton.z-link.z-link-active,\na.z-link:hover,\nbutton.z-link:hover,\na.z-link.z-link-active:hover,\nbutton.z-link.z-link-active:hover,\na.z-link:focus-visible,\nbutton.z-link:focus-visible,\na.z-link.z-link-active:focus-visible,\nbutton.z-link.z-link-active:focus-visible,\na.z-link:active,\nbutton.z-link:active,\na.z-link.z-link-active:active,\nbutton.z-link.z-link-active:active,\na.z-link:visited,\nbutton.z-link:visited,\na.z-link.z-link-active:visited,\nbutton.z-link.z-link-active:visited {\n color: var(--color-text-link-default);\n fill: var(--color-text-link-default);\n}\n\na.z-link.z-link-blue,\nbutton.z-link.z-link-blue,\na.z-link.z-link-blue.z-link-active,\nbutton.z-link.z-link-blue.z-link-active {\n color: var(--color-text-link-blue);\n fill: var(--color-text-link-blue);\n}\n\na.z-link.z-link-red,\nbutton.z-link.z-link-red,\na.z-link.z-link-red.z-link-active,\nbutton.z-link.z-link-red.z-link-active {\n color: var(--color-text-link-red);\n fill: var(--color-text-link-red);\n}\n\na.z-link.z-link-inverse,\nbutton.z-link.z-link-inverse,\na.z-link.z-link-inverse.z-link-active,\nbutton.z-link.z-link-inverse.z-link-active {\n color: var(--color-text-link-inverse);\n fill: var(--color-text-link-inverse);\n}\n\na.z-link.z-link-blue:hover,\nbutton.z-link.z-link-blue:hover {\n color: var(--color-text-link-blue-hover);\n fill: var(--color-text-link-blue-hover);\n}\n\na.z-link.z-link-red:hover,\nbutton.z-link.z-link-red:hover {\n color: var(--color-text-link-red-hover);\n fill: var(--color-text-link-red-hover);\n}\n\na.z-link.z-link-inverse:hover,\nbutton.z-link.z-link-inverse:hover {\n color: var(--color-text-link-inverse);\n fill: var(--color-text-link-inverse);\n}\n\na.z-link.z-link-blue:active,\nbutton.z-link.z-link-blue:active,\na.z-link.z-link-blue:focus-visible,\nbutton.z-link.z-link-blue:focus-visible {\n color: var(--color-text-link-blue-active);\n fill: var(--color-text-link-blue-active);\n}\n\na.z-link.z-link-red:active,\nbutton.z-link.z-link-red:active,\na.z-link.z-link-red:focus-visible,\nbutton.z-link.z-link-red:focus-visible {\n color: var(--color-text-link-red-active);\n fill: var(--color-text-link-red-active);\n}\n\na.z-link.z-link-inverse:active,\nbutton.z-link.z-link-inverse:active,\na.z-link.z-link-inverse:focus-visible,\nbutton.z-link.z-link-inverse:focus-visible {\n color: var(--color-text-link-inverse);\n fill: var(--color-text-link-inverse);\n}\n\na.z-link.z-link-blue:visited,\nbutton.z-link.z-link-blue:visited {\n color: var(--color-text-link-blue-visited);\n fill: var(--color-text-link-blue-visited);\n}\n\na.z-link.z-link-red:visited,\nbutton.z-link.z-link-red:visited {\n color: var(--color-text-link-red-visited);\n fill: var(--color-text-link-red-visited);\n}\n\na.z-link.z-link-inverse:visited,\nbutton.z-link.z-link-inverse:visited {\n color: var(--color-text-link-inverse);\n fill: var(--color-text-link-inverse);\n}\n","import {Component, Element, Event, EventEmitter, Host, Prop, h} from \"@stencil/core\";\nimport {BookCardVariant, ControlSize} from \"../../../beans\";\n\n/**\n * @slot cta - Top right cta (e.g. bookmark icon)\n * @slot ebook - As default, it shows laZ ebook link\n * @slot tags - Tags section, default empty\n * @slot data - External link and pill, default empty\n * @slot apps - List of card-related apps, default empty\n * @slot coverOverlay - Content to be displayed in the `z-book-cover` component slot\n * @cssprop --z-book-card-portrait-cover-height - Set custom cover height for portrait variant - Default: `378px`\n * @cssprop --z-book-card-title-lines - Set title avilable lines - Default: `2`\n * @cssprop --z-book-card-title-word-break - Set title word-break rule - Default: `initial`\n * @cssprop --z-book-card-subtitle-lines - Set subtitle available lines - Default: `1`\n * @cssprop --z-book-card-subtitle-word-break - Set subtitle word-break rule - Default: `break-all`\n * @cssprop --z-book-card-authors-lines - Set authors available lines - Default: `1`\n * @cssprop --z-book-card-authors-word-break - Set authors word-break rule - Default: `break-all`\n */\n@Component({\n tag: \"z-book-card\",\n styleUrls: [\"styles.css\", \"../../../tokens/typography.css\", \"../../css-components/z-link/styles.css\"],\n shadow: true,\n})\nexport class ZBookCard {\n @Element() hostElement: HTMLZBookCardElement;\n\n /** Card variant: landscape, portrait */\n @Prop({reflect: true})\n variant: BookCardVariant = BookCardVariant.PORTRAIT;\n\n /** Cover URL */\n @Prop()\n cover: string;\n\n /** Opera title (card title) */\n @Prop()\n operaTitle: string;\n\n /** [optional] Volume title (card subvolume) */\n @Prop()\n volumeTitle?: string;\n\n /** [optional] Authors */\n @Prop()\n authors?: string;\n\n /** [optional] Main ISBN */\n @Prop()\n isbn?: string;\n\n /** [optional] ISBN label */\n @Prop()\n isbnLabel = \"\";\n\n /** [optional] year */\n @Prop()\n year?: string;\n\n /** [optional] Link to the ebook resource. Creates a link also around the cover and title. */\n @Prop()\n ebookUrl?: string;\n\n /** [optional] Value for the `target` attribute of the links created by `ebookUrl` prop. */\n @Prop()\n linkTarget = \"_blank\";\n\n /** [optional] Fallback cover URL. */\n @Prop()\n fallbackCover?: string;\n\n /** Whether to show a stack of covers to represent multiple books (only for `portrait` variant). */\n @Prop()\n hasMultipleCovers = false;\n\n /** [optional] Set a specific heading level as html tag for the title. */\n @Prop()\n titleHtmlTag?: string;\n\n /** click on ebook link */\n @Event()\n ebookClick: EventEmitter;\n\n /** click on cover link */\n @Event()\n coverClick: EventEmitter;\n\n /** click on title link */\n @Event()\n titleClick: EventEmitter;\n\n private emitEbookClick(): void {\n this.ebookClick.emit();\n }\n\n private emitCoverClick(): void {\n this.coverClick.emit();\n }\n\n private emitTitleClick(): void {\n this.titleClick.emit();\n }\n\n private renderCover(): HTMLDivElement {\n const CoverTag = this.ebookUrl ? \"a\" : \"div\";\n const coverAttrs = this.ebookUrl\n ? {\n href: this.ebookUrl,\n onClick: () => this.emitCoverClick(),\n target: this.linkTarget,\n }\n : {};\n\n return (\n <CoverTag\n class=\"cover\"\n {...coverAttrs}\n >\n <z-book-cover\n cover={this.cover}\n fallbackCover={this.fallbackCover}\n multiple={this.hasMultipleCovers && this.variant === BookCardVariant.PORTRAIT}\n >\n <slot\n name=\"coverOverlay\"\n slot=\"coverOverlay\"\n ></slot>\n </z-book-cover>\n </CoverTag>\n );\n }\n\n private renderYear(): null | HTMLDivElement {\n if (!this.year) {\n return null;\n }\n\n return (\n <div\n class=\"year ellipsis body-4\"\n aria-description=\"anno\"\n >\n {this.year}\n </div>\n );\n }\n\n private renderAuthors(): null | HTMLDivElement {\n if (!this.authors) {\n return null;\n }\n\n return (\n <div class=\"cta-wrapper\">\n <div\n class=\"authors ellipsis body-4\"\n aria-description=\"autori\"\n >\n {this.authors}\n </div>\n {this.variant === BookCardVariant.LANDSCAPE ? this.renderCtaSlot() : null}\n </div>\n );\n }\n\n private renderOperaTitle(): HTMLDivElement {\n const title = this.titleHtmlTag\n ? `<${this.titleHtmlTag}>${this.operaTitle}</${this.titleHtmlTag}>`\n : this.operaTitle;\n\n const operaTitle = (\n <div\n class=\"opera-title ellipsis body-2-sb\"\n innerHTML={title}\n />\n );\n\n return (\n <div class=\"cta-wrapper\">\n {this.ebookUrl ? (\n <a\n class=\"z-link\"\n href={this.ebookUrl}\n onClick={() => this.emitTitleClick()}\n target={this.linkTarget}\n >\n {operaTitle}\n </a>\n ) : (\n operaTitle\n )}\n {this.variant === BookCardVariant.PORTRAIT ? this.renderCtaSlot() : null}\n </div>\n );\n }\n\n private renderVolumeTitle(): null | HTMLDivElement {\n if (!this.volumeTitle) {\n return null;\n }\n\n return <div class=\"volume-title ellipsis body-4\">{this.volumeTitle}</div>;\n }\n\n private renderIsbn(): null | HTMLDivElement {\n if (!this.isbn) {\n return null;\n }\n\n return (\n <div\n class=\"isbn ellipsis body-4-sb\"\n aria-description={`isbn ${this.isbnLabel}`}\n >\n {this.isbn} {this.isbnLabel ? <span class=\"body-4\">{this.isbnLabel}</span> : null}\n </div>\n );\n }\n\n private renderEbook(): HTMLDivElement {\n return (\n <div class=\"ebook\">\n <div class=\"app-name\">\n <img\n class=\"ebook-logo\"\n aria-hidden=\"true\"\n />\n <div class=\"body-4-sb\">laZ Ebook</div>\n </div>\n <z-button\n size={ControlSize.X_SMALL}\n href={this.ebookUrl}\n target={this.linkTarget}\n onClick={() => this.emitEbookClick()}\n htmlrole=\"link\"\n aria-description={`leggi l'ebook ${this.operaTitle} su laZ Ebook`}\n >\n leggi ebook\n </z-button>\n </div>\n );\n }\n\n private renderCtaSlot(): HTMLSlotElement {\n return <slot name=\"cta\"></slot>;\n }\n\n render(): HTMLZBookCardElement {\n return (\n <Host>\n <div class=\"main-content\">\n {this.renderCover()}\n <div class=\"card-info\">\n <div class=\"top\">\n <div>\n {this.renderYear()}\n {this.renderAuthors()}\n {this.renderOperaTitle()}\n {this.renderVolumeTitle()}\n {this.renderIsbn()}\n </div>\n <slot name=\"tags\"></slot>\n <slot name=\"data\"></slot>\n </div>\n <slot name=\"ebook\">{!!this.ebookUrl && <div class=\"bottom\">{this.renderEbook()}</div>}</slot>\n </div>\n </div>\n <slot name=\"apps\"></slot>\n </Host>\n );\n }\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as t,h as s,a as c}from"./p-75c4a726.js";import{k as i}from"./p-86618221.js";import{r as a}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as t,h as s,a as c}from"./p-75c4a726.js";import{k as i}from"./p-86618221.js";import{r as a}from"./p-061e28d6.js";import"./p-5145a606.js";const l='.sc-z-toggle-switch-h{position:relative;display:inline-flex;font-family:var(--font-family-sans);font-weight:var(--font-rg)}label.sc-z-toggle-switch{display:flex;flex-direction:row;align-items:center;cursor:pointer}label.disabled.sc-z-toggle-switch{cursor:default}label.right.sc-z-toggle-switch{flex-direction:row-reverse}label.sc-z-toggle-switch>span.sc-z-toggle-switch:first-child{color:var(--color-default-text);letter-spacing:0}label.left.sc-z-toggle-switch>span.sc-z-toggle-switch:first-child{margin-right:var(--space-unit)}label.right.sc-z-toggle-switch>span.sc-z-toggle-switch:first-child{margin-left:var(--space-unit)}label.sc-z-toggle-switch>span.container.sc-z-toggle-switch{position:relative;top:1px;left:1px;display:flex;width:calc(var(--space-unit) * 4);height:18px;align-items:center;background-color:var(--gray500);border-radius:var(--space-unit);color:var(--gray500);cursor:pointer}label.sc-z-toggle-switch>span.container.disabled.sc-z-toggle-switch,label.sc-z-toggle-switch>span.container.checked.disabled.sc-z-toggle-switch{background-color:var(--color-disabled01);cursor:default}label.sc-z-toggle-switch>span.container.checked.disabled.sc-z-toggle-switch>span.circle.sc-z-toggle-switch>z-icon.sc-z-toggle-switch{fill:var(--color-disabled01)}label.sc-z-toggle-switch>span.container.checked.sc-z-toggle-switch{background-color:var(--color-primary01);fill:var(--color-primary01)}input.sc-z-toggle-switch:focus:focus-visible+label.sc-z-toggle-switch>span.container.sc-z-toggle-switch:not(.disabled){box-shadow:var(--shadow-focus-primary);outline:none}input.sc-z-toggle-switch:focus:focus-visible+label.sc-z-toggle-switch>span.container.disabled.sc-z-toggle-switch{outline:none}label.sc-z-toggle-switch>span.container.sc-z-toggle-switch:not(.disabled):hover{background-color:var(--color-hover-primary);fill:var(--color-hover-primary)}label.sc-z-toggle-switch>span.container.sc-z-toggle-switch>span.circle.sc-z-toggle-switch{position:absolute;top:1px;left:1px;display:flex;width:calc(var(--space-unit) * 2);height:calc(var(--space-unit) * 2);align-items:center;justify-content:center;margin:0;background-color:var(--color-white);border-radius:7px;box-shadow:var(--shadow-1);transition:transform 0.3s ease}label.sc-z-toggle-switch>span.container.checked.sc-z-toggle-switch>span.circle.sc-z-toggle-switch{transform:translateX(calc(100% - 2px))}input[type="checkbox"].sc-z-toggle-switch{position:absolute;z-index:-1;opacity:0;pointer-events:none}';const o=l;const r=class{constructor(s){e(this,s);this.toggleClick=t(this,"toggleClick",7);this.disabled=false;this.labelPosition=i.LEFT;this.checked=false;this.htmlid=`toggle-switch-id-${a()}`}emitToggleClick(){this.toggleClick.emit({id:this.htmlid,checked:this.checked})}handleClick(e){if(this.disabled){return}this.checked=e.target.checked;this.emitToggleClick()}render(){return s(c,{key:"9120676414a277bcb8e4065053b0aaad1d409ec8"},s("input",{key:"740b199120f448f225068f6a927ae392d5eb909f",id:this.htmlid,type:"checkbox",checked:this.checked,disabled:this.disabled,onChange:this.handleClick.bind(this)}),s("label",{key:"fcb131a2e4a88c821fd3e9d6f4d0aae7e0ea690d",htmlFor:this.htmlid,class:{[this.labelPosition]:true,disabled:this.disabled}},s("span",{key:"2b9f61e89130980eefabb651d0c9c906322092f3"},s("slot",{key:"b99547f1dbdaa8cc212c0949307ae1c61b234d40"})),s("span",{key:"010e9e4b9a47e58a14b54a540bb0b07d5d5b6c50",class:{container:true,disabled:this.disabled,checked:this.checked}},s("span",{key:"c42cc68eb1f57de72a035e32f1cff8dcbc7f736b",class:"circle"},this.checked&&s("z-icon",{key:"497788b7e87823921ea47973be378c74138d8f48",width:12,height:12,name:"checkmark"})))))}};r.style=o;export{r as z_toggle_switch};
|
|
2
|
+
//# sourceMappingURL=p-87edcc75.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,a as o,g as n}from"./p-75c4a726.js";import{P as s,g as a}from"./p-86618221.js";import{a as r}from"./p-1a0c206d.js";import"./p-5145a606.js";const h=":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}}";const l=h;const f=':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)}';const d=f;const b=class{constructor(i){t(this,i);this.toggleSubmenu=e(this,"toggleSubmenu",7);this.toggleTooltip=e(this,"toggleTooltip",7);this.isNested=false;this.handleTooltipOpen=t=>{if(!this.tooltip||this.open||!this.buttonRef.contains(t.target)){return}clearTimeout(this.hoverDelay);this.hoverDelay=setTimeout((()=>{this.tooltipOpen=true}),1e3)};this.handleTooltipClose=t=>{var e;if(!this.tooltip||((e=t.relatedTarget)===null||e===void 0?void 0:e.closest("z-tooltip"))===this.tooltipRef){return}clearTimeout(this.hoverDelay);this.tooltipOpen=false};this.handleClick=()=>{if(this.disabled||!this.hasSlottedContent){return}this.open=!this.open;if(this.open){const t=this.hostElement.querySelector(":scope > z-color-picker");if(t){t.setFocus();return}const e=this.hostElement.querySelector(":scope > z-toolbar z-tool[active]:not(:disabled)")||this.hostElement.querySelector(":scope > z-toolbar z-tool:not(:disabled)");e===null||e===void 0?void 0:e.setFocus()}};this.onTooltipOpenChange=t=>{if(t.target===this.tooltipRef){return}this.tooltipOpen=t.detail.open};this.icon=undefined;this.tooltip=undefined;this.tooltipPosition=s.TOP;this.htmlAriaLabel=undefined;this.active=false;this.disabled=false;this.open=false;this.indicatorColor=undefined;this.tooltipOpen=false;this.hasSlottedContent=false;this.isMobile=false;this.hasNestedOpenTools=false}handleOpenChange(){this.toggleSubmenu.emit(this.open)}handleTooltipOpenChange(){this.toggleTooltip.emit(this.tooltipOpen)}handleKeyDown(t){if(!this.open||this.hasNestedOpenTools){return}switch(t.key){case a.ESC:t.stopPropagation();this.open=false;this.setFocus();break;case a.TAB:if(t.shiftKey&&t.target.closest("z-tool:not(:scope)")===this.hostElement){this.open=false}break}}onOutsideClick(t){const e=t.composedPath()[0];if(!this.open||r(this.hostElement,e)||this.hasNestedOpenTools){return}this.open=false}onNestedToolToggle(t){if(t.target===this.hostElement){return}if(t.detail===true){this.hasNestedOpenTools=true;return}this.hasNestedOpenTools=Array.from(this.hostElement.querySelectorAll("z-tool")).some((t=>t.open))}handleColorSelected(t){if(!Array.from(this.hostElement.children).includes(t.target)){return}this.indicatorColor=t.detail;this.open=false;this.setFocus()}handleExternalFocusin(t){const e=t.target;if(!r(this.hostElement,e)){this.open=false}}async setFocus(){if(this.disabled){return}setTimeout((()=>{var t;(t=this.buttonRef)===null||t===void 0?void 0:t.focus()}),50)}async setTabIndex(t){if(!this.buttonRef){return}this.buttonRef.tabIndex=this.disabled?-1:t}async closeTooltip(){clearTimeout(this.hoverDelay);this.tooltipOpen=false}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);(t=this.mql)===null||t===void 0?void 0:t.removeEventListener("change",this.onMobileViewChange)}render(){return i(o,{key:"81b929ee3738e7533405c8ea47535d7fb52bfb92",class:{"z-tool-tooltip-open":this.tooltipOpen}},i("button",{key:"1b68af441ac69dbdf805b823b852c093b944e586",class:"z-tool",type:"button",ref:t=>this.buttonRef=t,"aria-pressed":this.hasSlottedContent?undefined:this.active?"true":"false","aria-expanded":this.hasSlottedContent?this.open?"true":"false":undefined,"aria-haspopup":this.hasSlottedContent?"true":undefined,"aria-label":this.htmlAriaLabel||this.tooltip||undefined,disabled:this.disabled,onClick:this.handleClick,onMouseEnter:this.handleTooltipOpen,onMouseLeave:this.handleTooltipClose,onFocus:this.handleTooltipOpen,onBlur:this.handleTooltipClose},i("z-icon",{key:"580cf2210393974cb2300ea6e50018149f6ef123",ref:t=>this.iconRef=t,name:this.icon,indicatorColor:this.indicatorColor})),this.tooltip&&i("z-tooltip",{key:"9b0e197d25135e1a0016fbbdca48751e8350be7b",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:true,onMouseLeave:this.handleTooltipClose,onBlur:this.handleTooltipClose,onOpenChange:this.onTooltipOpenChange},i("span",{key:"d6580708f0b79853cc3644cb6ea61b64cbe73a21",class:"body-4"},this.tooltip)),this.hasSlottedContent&&i("z-popover",{key:"121b6662678738de67739beb733edfe94a6df3f6",class:"z-tool-submenu",open:this.open,bindTo:this.isMobile&&this.mainToolbar?this.mainToolbar:this.hostElement,center:true,closable:false,position:this.isMobile?s.TOP:s.BOTTOM},i("slot",{key:"6bb4815374940bd0ce6dc21bf38a1372454bf830"})))}get hostElement(){return n(this)}static get watchers(){return{open:["handleOpenChange"],tooltipOpen:["handleTooltipOpenChange"]}}};b.style=l+d;export{b as z_tool};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as e,h as i,a as o,g as n}from"./p-75c4a726.js";import{P as s,g as a}from"./p-86618221.js";import{a as r}from"./p-061e28d6.js";import"./p-5145a606.js";const h=":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}}";const l=h;const f=':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)}';const d=f;const b=class{constructor(i){t(this,i);this.toggleSubmenu=e(this,"toggleSubmenu",7);this.toggleTooltip=e(this,"toggleTooltip",7);this.isNested=false;this.handleTooltipOpen=t=>{if(!this.tooltip||this.open||!this.buttonRef.contains(t.target)){return}clearTimeout(this.hoverDelay);this.hoverDelay=setTimeout((()=>{this.tooltipOpen=true}),1e3)};this.handleTooltipClose=t=>{var e;if(!this.tooltip||((e=t.relatedTarget)===null||e===void 0?void 0:e.closest("z-tooltip"))===this.tooltipRef){return}clearTimeout(this.hoverDelay);this.tooltipOpen=false};this.handleClick=()=>{if(this.disabled||!this.hasSlottedContent){return}this.open=!this.open;if(this.open){const t=this.hostElement.querySelector(":scope > z-color-picker");if(t){t.setFocus();return}const e=this.hostElement.querySelector(":scope > z-toolbar z-tool[active]:not(:disabled)")||this.hostElement.querySelector(":scope > z-toolbar z-tool:not(:disabled)");e===null||e===void 0?void 0:e.setFocus()}};this.onTooltipOpenChange=t=>{if(t.target===this.tooltipRef){return}this.tooltipOpen=t.detail.open};this.icon=undefined;this.tooltip=undefined;this.tooltipPosition=s.TOP;this.htmlAriaLabel=undefined;this.active=false;this.disabled=false;this.open=false;this.indicatorColor=undefined;this.tooltipOpen=false;this.hasSlottedContent=false;this.isMobile=false;this.hasNestedOpenTools=false}handleOpenChange(){this.toggleSubmenu.emit(this.open)}handleTooltipOpenChange(){this.toggleTooltip.emit(this.tooltipOpen)}handleKeyDown(t){if(!this.open||this.hasNestedOpenTools){return}switch(t.key){case a.ESC:t.stopPropagation();this.open=false;this.setFocus();break;case a.TAB:if(t.shiftKey&&t.target.closest("z-tool:not(:scope)")===this.hostElement){this.open=false}break}}onOutsideClick(t){const e=t.composedPath()[0];if(!this.open||r(this.hostElement,e)||this.hasNestedOpenTools){return}this.open=false}onNestedToolToggle(t){if(t.target===this.hostElement){return}if(t.detail===true){this.hasNestedOpenTools=true;return}this.hasNestedOpenTools=Array.from(this.hostElement.querySelectorAll("z-tool")).some((t=>t.open))}handleColorSelected(t){if(!Array.from(this.hostElement.children).includes(t.target)){return}this.indicatorColor=t.detail;this.open=false;this.setFocus()}handleExternalFocusin(t){const e=t.target;if(!r(this.hostElement,e)){this.open=false}}async setFocus(){if(this.disabled){return}setTimeout((()=>{var t;(t=this.buttonRef)===null||t===void 0?void 0:t.focus()}),50)}async setTabIndex(t){if(!this.buttonRef){return}this.buttonRef.tabIndex=this.disabled?-1:t}async closeTooltip(){clearTimeout(this.hoverDelay);this.tooltipOpen=false}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);(t=this.mql)===null||t===void 0?void 0:t.removeEventListener("change",this.onMobileViewChange)}render(){return i(o,{key:"81b929ee3738e7533405c8ea47535d7fb52bfb92",class:{"z-tool-tooltip-open":this.tooltipOpen}},i("button",{key:"1b68af441ac69dbdf805b823b852c093b944e586",class:"z-tool",type:"button",ref:t=>this.buttonRef=t,"aria-pressed":this.hasSlottedContent?undefined:this.active?"true":"false","aria-expanded":this.hasSlottedContent?this.open?"true":"false":undefined,"aria-haspopup":this.hasSlottedContent?"true":undefined,"aria-label":this.htmlAriaLabel||this.tooltip||undefined,disabled:this.disabled,onClick:this.handleClick,onMouseEnter:this.handleTooltipOpen,onMouseLeave:this.handleTooltipClose,onFocus:this.handleTooltipOpen,onBlur:this.handleTooltipClose},i("z-icon",{key:"580cf2210393974cb2300ea6e50018149f6ef123",ref:t=>this.iconRef=t,name:this.icon,indicatorColor:this.indicatorColor})),this.tooltip&&i("z-tooltip",{key:"9b0e197d25135e1a0016fbbdca48751e8350be7b",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:true,onMouseLeave:this.handleTooltipClose,onBlur:this.handleTooltipClose,onOpenChange:this.onTooltipOpenChange},i("span",{key:"d6580708f0b79853cc3644cb6ea61b64cbe73a21",class:"body-4"},this.tooltip)),this.hasSlottedContent&&i("z-popover",{key:"121b6662678738de67739beb733edfe94a6df3f6",class:"z-tool-submenu",open:this.open,bindTo:this.isMobile&&this.mainToolbar?this.mainToolbar:this.hostElement,center:true,closable:false,position:this.isMobile?s.TOP:s.BOTTOM},i("slot",{key:"6bb4815374940bd0ce6dc21bf38a1372454bf830"})))}get hostElement(){return n(this)}static get watchers(){return{open:["handleOpenChange"],tooltipOpen:["handleTooltipOpenChange"]}}};b.style=l+d;export{b as z_tool};
|
|
2
|
+
//# sourceMappingURL=p-8aaceeed.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,h as o,g as s}from"./p-75c4a726.js";import{s as i}from"./p-86618221.js";const n=':host{position:fixed;z-index:10000;display:flex;flex-flow:column nowrap;margin-top:calc(var(--space-unit) * 2);margin-bottom:calc(var(--space-unit) * 2);font-family:var(--font-family-sans);font-weight:var(--font-rg)}::slotted(z-toast-notification){width:100vw}::slotted(:not(:last-child)){margin-bottom:calc(var(--space-unit) * 1)}:host([position="bottom-centre"]),:host([position="bottom-right"]),:host([position="bottom-left"]){bottom:0;align-items:flex-end;justify-content:flex-end}:host([position="top-left"]),:host([position="top-right"]),:host([position="top-centre"]){top:0;align-items:flex-start;justify-content:flex-start}@media only screen and (min-width: 768px){:host{margin:calc(var(--space-unit) * 3)}:host([position="top-centre"]){top:0;left:50%;align-items:center;justify-content:flex-start;transform:translateX(-50%)}:host([position="top-left"]){top:0;left:0;align-items:flex-start;justify-content:flex-start}:host([position="top-right"]){top:0;right:0;align-items:flex-end;justify-content:flex-start}:host([position="bottom-centre"]){bottom:0;left:50%;align-items:center;justify-content:flex-end;transform:translateX(-50%)}:host([position="bottom-right"]){right:0;bottom:0;align-items:flex-end;justify-content:flex-end}:host([position="bottom-left"]){bottom:0;left:0;align-items:flex-start;justify-content:flex-end}::slotted(z-toast-notification){width:50vw}}@media only screen and (min-width: 1366px){:host{margin:calc(var(--space-unit) * 4)}::slotted(z-toast-notification){width:33vw}}';const e=n;const a=class{constructor(o){t(this,o);this.position=i.TOP_RIGHT;this.newestontop=true}watchPropNewestontop(t){this.hostElement.append(...this.notificationArray.reverse());if(t){this.hostElement.shadowRoot.addEventListener("slotchange",this.slotChangeHandler)}else{this.hostElement.shadowRoot.removeEventListener("slotchange",this.slotChangeHandler)}}componentWillLoad(){if(this.newestontop){this.handleNewestOnTop()}}handleNewestOnTop(){this.notificationArray=Array.from(this.hostElement.children);this.hostElement.append(...this.notificationArray.reverse());this.hostElement.shadowRoot.addEventListener("slotchange",this.slotChangeHandler.bind(this))}slotChangeHandler(){const t=Array.from(this.hostElement.children).filter((t=>!this.notificationArray.includes(t)));if(t){t.forEach((t=>{this.notificationArray.push(t);const o=t;t.remove();this.hostElement.prepend(o)}))}}render(){return o("slot",{key:"
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as o,g as s}from"./p-75c4a726.js";import{s as i}from"./p-86618221.js";const n=':host{position:fixed;z-index:10000;display:flex;flex-flow:column nowrap;margin-top:calc(var(--space-unit) * 2);margin-bottom:calc(var(--space-unit) * 2);font-family:var(--font-family-sans);font-weight:var(--font-rg)}::slotted(z-toast-notification){width:100vw}::slotted(:not(:last-child)){margin-bottom:calc(var(--space-unit) * 1)}:host([position="bottom-centre"]),:host([position="bottom-right"]),:host([position="bottom-left"]){bottom:0;align-items:flex-end;justify-content:flex-end}:host([position="top-left"]),:host([position="top-right"]),:host([position="top-centre"]){top:0;align-items:flex-start;justify-content:flex-start}@media only screen and (min-width: 768px){:host{margin:calc(var(--space-unit) * 3)}:host([position="top-centre"]){top:0;left:50%;align-items:center;justify-content:flex-start;transform:translateX(-50%)}:host([position="top-left"]){top:0;left:0;align-items:flex-start;justify-content:flex-start}:host([position="top-right"]){top:0;right:0;align-items:flex-end;justify-content:flex-start}:host([position="bottom-centre"]){bottom:0;left:50%;align-items:center;justify-content:flex-end;transform:translateX(-50%)}:host([position="bottom-right"]){right:0;bottom:0;align-items:flex-end;justify-content:flex-end}:host([position="bottom-left"]){bottom:0;left:0;align-items:flex-start;justify-content:flex-end}::slotted(z-toast-notification){width:50vw}}@media only screen and (min-width: 1366px){:host{margin:calc(var(--space-unit) * 4)}::slotted(z-toast-notification){width:33vw}}';const e=n;const a=class{constructor(o){t(this,o);this.notificationArray=[];this.position=i.TOP_RIGHT;this.newestontop=true}watchPropNewestontop(t){this.hostElement.append(...this.notificationArray.reverse());if(t){this.hostElement.shadowRoot.addEventListener("slotchange",this.slotChangeHandler)}else{this.hostElement.shadowRoot.removeEventListener("slotchange",this.slotChangeHandler)}}componentWillLoad(){if(this.newestontop){this.handleNewestOnTop()}}handleNewestOnTop(){this.notificationArray=Array.from(this.hostElement.children);this.hostElement.append(...this.notificationArray.reverse());this.hostElement.shadowRoot.addEventListener("slotchange",this.slotChangeHandler.bind(this))}slotChangeHandler(){const t=Array.from(this.hostElement.children).filter((t=>!this.notificationArray.includes(t)));if(t){t.forEach((t=>{this.notificationArray.push(t);const o=t;t.remove();this.hostElement.prepend(o)}))}}render(){return o("slot",{key:"b05c58feada71e3eb2fcfcbd5a5f465b91c39ac3",name:"toasts"})}get hostElement(){return s(this)}static get watchers(){return{newestontop:["watchPropNewestontop"]}}};a.style=e;export{a as z_toast_notification_list};
|
|
2
|
+
//# sourceMappingURL=p-90babaaa.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["stylesCss","ZToastNotificationListStyle0","ZToastNotificationList","ToastNotificationPosition","TOP_RIGHT","watchPropNewestontop","newValue","
|
|
1
|
+
{"version":3,"names":["stylesCss","ZToastNotificationListStyle0","ZToastNotificationList","this","notificationArray","ToastNotificationPosition","TOP_RIGHT","watchPropNewestontop","newValue","hostElement","append","reverse","shadowRoot","addEventListener","slotChangeHandler","removeEventListener","componentWillLoad","newestontop","handleNewestOnTop","Array","from","children","bind","difference","filter","elem","includes","forEach","push","newElem","remove","prepend","render","h","key","name"],"sources":["src/components/z-toast-notification-list/styles.css?tag=z-toast-notification-list&encapsulation=shadow","src/components/z-toast-notification-list/index.tsx"],"sourcesContent":[":host {\n position: fixed;\n z-index: 10000;\n display: flex;\n flex-flow: column nowrap;\n margin-top: calc(var(--space-unit) * 2);\n margin-bottom: calc(var(--space-unit) * 2);\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n}\n\n::slotted(z-toast-notification) {\n width: 100vw;\n}\n\n::slotted(:not(:last-child)) {\n margin-bottom: calc(var(--space-unit) * 1);\n}\n\n:host([position=\"bottom-centre\"]),\n:host([position=\"bottom-right\"]),\n:host([position=\"bottom-left\"]) {\n bottom: 0;\n align-items: flex-end;\n justify-content: flex-end;\n}\n\n:host([position=\"top-left\"]),\n:host([position=\"top-right\"]),\n:host([position=\"top-centre\"]) {\n top: 0;\n align-items: flex-start;\n justify-content: flex-start;\n}\n\n/* Tablet breakpoint */\n@media only screen and (min-width: 768px) {\n :host {\n margin: calc(var(--space-unit) * 3);\n }\n\n :host([position=\"top-centre\"]) {\n top: 0;\n left: 50%;\n align-items: center;\n justify-content: flex-start;\n transform: translateX(-50%);\n }\n\n :host([position=\"top-left\"]) {\n top: 0;\n left: 0;\n align-items: flex-start;\n justify-content: flex-start;\n }\n\n :host([position=\"top-right\"]) {\n top: 0;\n right: 0;\n align-items: flex-end;\n justify-content: flex-start;\n }\n\n :host([position=\"bottom-centre\"]) {\n bottom: 0;\n left: 50%;\n align-items: center;\n justify-content: flex-end;\n transform: translateX(-50%);\n }\n\n :host([position=\"bottom-right\"]) {\n right: 0;\n bottom: 0;\n align-items: flex-end;\n justify-content: flex-end;\n }\n\n :host([position=\"bottom-left\"]) {\n bottom: 0;\n left: 0;\n align-items: flex-start;\n justify-content: flex-end;\n }\n\n ::slotted(z-toast-notification) {\n width: 50vw;\n }\n}\n\n/* Wide breakpoint */\n@media only screen and (min-width: 1366px) {\n :host {\n margin: calc(var(--space-unit) * 4);\n }\n\n ::slotted(z-toast-notification) {\n width: 33vw;\n }\n}\n","import {Component, Element, Prop, Watch, h} from \"@stencil/core\";\nimport {ToastNotificationPosition} from \"../../beans\";\n\n@Component({\n tag: \"z-toast-notification-list\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZToastNotificationList {\n @Element() hostElement: HTMLZToastNotificationListElement;\n\n /**Set the position of toast notification list - top-left, top-centre, top-right, bottom-left, bottom-centre, bottom-right */\n @Prop({reflect: true})\n position: ToastNotificationPosition = ToastNotificationPosition.TOP_RIGHT;\n\n /**Set the entry position of new notification in the list */\n @Prop()\n newestontop?: boolean = true;\n\n private notificationArray: Element[] = [];\n\n @Watch(\"newestontop\")\n watchPropNewestontop(newValue: boolean): void {\n this.hostElement.append(...this.notificationArray.reverse());\n if (newValue) {\n this.hostElement.shadowRoot.addEventListener(\"slotchange\", this.slotChangeHandler);\n } else {\n this.hostElement.shadowRoot.removeEventListener(\"slotchange\", this.slotChangeHandler);\n }\n }\n\n componentWillLoad(): void {\n if (this.newestontop) {\n this.handleNewestOnTop();\n }\n }\n\n private handleNewestOnTop(): void {\n this.notificationArray = Array.from(this.hostElement.children);\n this.hostElement.append(...this.notificationArray.reverse());\n this.hostElement.shadowRoot.addEventListener(\"slotchange\", this.slotChangeHandler.bind(this));\n }\n\n private slotChangeHandler(): void {\n const difference = Array.from(this.hostElement.children).filter((elem) => !this.notificationArray.includes(elem));\n if (difference) {\n difference.forEach((elem) => {\n this.notificationArray.push(elem);\n const newElem = elem;\n elem.remove();\n this.hostElement.prepend(newElem);\n });\n }\n }\n\n render(): HTMLSlotElement {\n return <slot name=\"toasts\"></slot>;\n }\n}\n"],"mappings":"sFAAA,MAAMA,EAAY,m+CAClB,MAAAC,EAAeD,E,MCOFE,EAAsB,M,yBAWzBC,KAAAC,kBAA+B,G,cANDC,EAA0BC,U,iBAIxC,I,CAKxB,oBAAAC,CAAqBC,GACnBL,KAAKM,YAAYC,UAAUP,KAAKC,kBAAkBO,WAClD,GAAIH,EAAU,CACZL,KAAKM,YAAYG,WAAWC,iBAAiB,aAAcV,KAAKW,kB,KAC3D,CACLX,KAAKM,YAAYG,WAAWG,oBAAoB,aAAcZ,KAAKW,kB,EAIvE,iBAAAE,GACE,GAAIb,KAAKc,YAAa,CACpBd,KAAKe,mB,EAID,iBAAAA,GACNf,KAAKC,kBAAoBe,MAAMC,KAAKjB,KAAKM,YAAYY,UACrDlB,KAAKM,YAAYC,UAAUP,KAAKC,kBAAkBO,WAClDR,KAAKM,YAAYG,WAAWC,iBAAiB,aAAcV,KAAKW,kBAAkBQ,KAAKnB,M,CAGjF,iBAAAW,GACN,MAAMS,EAAaJ,MAAMC,KAAKjB,KAAKM,YAAYY,UAAUG,QAAQC,IAAUtB,KAAKC,kBAAkBsB,SAASD,KAC3G,GAAIF,EAAY,CACdA,EAAWI,SAASF,IAClBtB,KAAKC,kBAAkBwB,KAAKH,GAC5B,MAAMI,EAAUJ,EAChBA,EAAKK,SACL3B,KAAKM,YAAYsB,QAAQF,EAAQ,G,EAKvC,MAAAG,GACE,OAAOC,EAAA,QAAAC,IAAA,2CAAMC,KAAK,U","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as i,c as t,h as s}from"./p-75c4a726.js";import{d as a}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as i,c as t,h as s}from"./p-75c4a726.js";import{d as a}from"./p-061e28d6.js";import"./p-86618221.js";import"./p-5145a606.js";const e=":host li{all:unset;all:reset;width:100%;line-height:14px;list-style-type:none}:host li>span{display:flex;padding:calc(var(--space-unit) * 2) 0;color:var(--color-default-text);fill:var(--color-default-icon);font-family:var(--font-family-sans);font-size:16px;font-weight:var(--font-rg);letter-spacing:0.23px;line-height:14px}:host(.small) li>span{padding:calc(var(--space-unit) * 1.5) 0;font-size:var(--font-size-2)}:host(.x-small) li>span{padding:var(--space-unit) 0;font-size:var(--font-size-2)}:host(.small) li>span>z-icon,:host(.x-small) li>span>z-icon{--z-icon-width:16px;--z-icon-height:16px;--z-icon-right-margin:calc(var(--space-unit) * 0.5);padding:0}:host li>span.border{border-bottom:2px solid var(--color-surface03)}:host li span:hover,a:hover{color:var(--color-primary01);fill:var(--color-primary01)}a,a:visited,a:active{color:inherit;fill:inherit;text-decoration:none}:host li span z-icon{width:calc(var(--space-unit) * 2);height:calc(var(--space-unit) * 2);padding:0 calc(var(--space-unit) * 1.5) 0 0;background-repeat:no-repeat;background-size:contain;color:var(--color-primary01);fill:var(--color-primary01)}";const n=e;const o=class{emitZListItemLinkClick(i,t){this.zListItemLinkClick.emit({e:i,linkId:t})}emitZListItemClick(i,t){this.zListItemClick.emit({e:i,listitemid:t})}constructor(s){i(this,s);this.zListItemLinkClick=t(this,"zListItemLinkClick",7);this.zListItemClick=t(this,"zListItemClick",7);this.text=undefined;this.link=undefined;this.linktarget="_self";this.icon=undefined;this.listitemid=undefined;this.action=undefined;this.underlined=true;this.emitZListItemLinkClick=this.emitZListItemLinkClick.bind(this);this.emitZListItemClick=this.emitZListItemClick.bind(this)}render(){const i=this.listitemid?`link_${this.listitemid}`:"";return s("li",{key:"fa9a1fe93a8da6b853089c51b697c187d9f2dcdd",role:"button",id:this.listitemid,"data-action":this.action,onClick:i=>this.emitZListItemClick(i,this.listitemid),onKeyPress:i=>a(i,this.emitZListItemClick,this.listitemid)},s("span",{key:"169378aabe049931a38f93f7e113428e60cabcda",class:this.underlined&&"border"},this.icon&&s("z-icon",{key:"a64bd8fe8a7344cc0017441350a2b8874a9b887b",name:this.icon}),this.link?s("a",{href:this.link?this.link:null,target:this.linktarget,id:i,onClick:t=>this.emitZListItemLinkClick(t,i),onKeyPress:t=>a(t,this.emitZListItemLinkClick,i),role:this.link?"link":"button",tabindex:"0"},this.text):s("span",{innerHTML:this.text}),s("slot",{key:"f54ba653e232e027eab252f88819ac961e31532d"})))}};o.style=n;export{o as z_myz_list_item};
|
|
2
|
+
//# sourceMappingURL=p-9eba4a37.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,a as s,g as o}from"./p-75c4a726.js";import{g as n}from"./p-86618221.js";import{a}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as i,h as e,a as s,g as o}from"./p-75c4a726.js";import{g as n}from"./p-86618221.js";import{a}from"./p-061e28d6.js";import"./p-5145a606.js";const r=':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)}';const h=r;const l=t=>(t===null||t===void 0?void 0:t.tagName)==="Z-MENU-SECTION";const c=class{get focusableItem(){return this.items.find((t=>l(t)?t.htmlTabindex===0:t.tabIndex===0))}toggle(){if(!this.hasContent){return}this.open=!this.open}onLabelSlotChange(t){const i=t.target.assignedElements()[0];i.dataset.text=i===null||i===void 0?void 0:i.textContent;this.setLabelA11yAttrs()}reflow(t=false){if(!this.floating){return}if(this.content&&this.hasContent){const{style:t}=this.content;const{left:i}=this.host.getBoundingClientRect();const e=getComputedStyle(this.content).width;const s=e?parseFloat(e.replace("px","")):375;const o=30;t.left=`${Math.min(window.innerWidth-i-s-o,0)}px`}if(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){if(l(t)){t.htmlTabindex=i}else{t.tabIndex=i}}setItemsA11yAttrs(){this.items.forEach(((t,i)=>{const e=i===0?0:-1;this.setItemTabindex(t,e);if(!l(t)){t.setAttribute("role","menuitem")}}))}onItemsChange(){this.checkContent();this.items=Array.from(this.host.children).filter((({slot:t})=>t==="item"));this.setItemsA11yAttrs();this.items.forEach((t=>{if(!l(t)){t.dataset.text=t.textContent}}))}moveFocus(t,i){if(l(t)){t.setFocus()}else{t.tabIndex=0;setTimeout((()=>{t.focus()}),100)}if(!i){return}this.setItemTabindex(i,-1)}onLabelClick(){this.toggle();this.setFocus()}onLabelKeydown(t){if(t.key===n.ENTER||t.key===n.SPACE){t.preventDefault();t.stopPropagation();this.toggle();if(this.open){this.moveFocus(this.items[0])}return}if(!this.verticalContext){return}if(t.key===n.ARROW_RIGHT&&!this.open){t.preventDefault();t.stopPropagation();this.open=true;this.moveFocus(this.items[0])}}async setFocus(){this.htmlTabindex=0;const t=this.hasContent?this.labelButton:this.host.firstElementChild;t.focus()}async focusLastItem(){const t=this.items[this.items.length-1];if(l(t)&&t.open){t.focusLastItem();return}this.moveFocus(t)}onOpenChanged(){if(!this.open){cancelAnimationFrame(this.raf);this.closed.emit();this.items.forEach((t=>{if(l(t)&&t.open){t.open=false}}));return}this.setItemsA11yAttrs();this.opened.emit();if(this.floating){this.reflow(true)}}setLabelA11yAttrs(){if(this.hasContent&&this.labelButton){this.labelButton.tabIndex=this.htmlTabindex;return}const t=this.host.firstElementChild;t.role="menuitem";t.tabIndex=this.htmlTabindex}onItemClick(t){const i=this.items.find((i=>a(i,t.target)));if(i){this.items.forEach((t=>{if(t===i){return}if(l(t)){t.htmlTabindex=-1}else{t.tabIndex=-1}}))}}onKeyDown(t){var i;if(!this.hasContent){return}switch(t.key){case n.ESC:if(!this.open){break}t.stopPropagation();t.preventDefault();this.open=false;this.setFocus();break;case n.ARROW_DOWN:{if(document.activeElement===this.host){if(this.verticalContext&&!this.open){break}t.stopPropagation();t.preventDefault();if(!this.open){this.open=true}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(e!==null&&e!==void 0?e:this.items[0],this.focusableItem);break}case n.ARROW_UP:{if(document.activeElement===this.host){if(this.verticalContext){break}t.stopPropagation();t.preventDefault();if(!this.open){this.open=true}this.moveFocus(this.items[this.items.length-1],this.focusableItem);break}t.stopPropagation();t.preventDefault();const e=this.items.indexOf(this.focusableItem);if(e===0&&this.verticalContext){this.setItemTabindex(this.focusableItem,-1);this.setFocus();break}const s=(i=this.items[e-1])!==null&&i!==void 0?i:this.items[this.items.length-1];if(l(s)&&s.open){this.setItemTabindex(this.focusableItem,-1);s.focusLastItem();break}this.moveFocus(s,this.focusableItem);break}case n.ARROW_LEFT:if(!this.open||!this.verticalContext){break}t.preventDefault();t.stopPropagation();this.open=false;this.setFocus()}}constructor(e){t(this,e);this.opened=i(this,"opened",7);this.closed=i(this,"closed",7);this.items=[];this.active=undefined;this.floating=true;this.open=false;this.verticalContext=false;this.htmlTabindex=-1;this.hasHeader=undefined;this.hasContent=undefined;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(){if(!this.hasContent){return e("div",{class:"menu-label"},e("slot",{onSlotchange:this.onLabelSlotChange}))}return 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}))))}get host(){return o(this)}static get watchers(){return{open:["onOpenChanged"],htmlTabindex:["setLabelA11yAttrs"]}}};c.style=h;export{c as z_menu};
|
|
2
|
+
//# sourceMappingURL=p-a3f9a5da.entry.js.map
|