@zanichelli/albe-web-components 19.1.3 → 19.1.4-RC1
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-96af6326.js +8 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-alert.cjs.entry.js +1 -1
- package/dist/cjs/z-app-header_12.cjs.entry.js +31 -26
- package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -1
- package/dist/cjs/z-myz-card-alert.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-dictionary.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-footer-sections.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-footer.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-icon.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-info.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-list.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card_4.cjs.entry.js +4 -4
- package/dist/cjs/z-myz-list-item.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-list.cjs.entry.js +1 -1
- package/dist/cjs/z-otp.cjs.entry.js +2 -2
- package/dist/cjs/z-tool.cjs.entry.js +105 -0
- package/dist/cjs/z-tool.cjs.entry.js.map +1 -0
- package/dist/cjs/z-toolbar.cjs.entry.js +150 -0
- package/dist/cjs/z-toolbar.cjs.entry.js.map +1 -0
- package/dist/cjs/z-tooltip.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/css-components/z-label/styles.css +10 -0
- package/dist/collection/components/z-searchbar/index.js +41 -5
- package/dist/collection/components/z-searchbar/index.js.map +1 -1
- package/dist/collection/components/z-searchbar/index.stories.js +13 -1
- package/dist/collection/components/z-searchbar/index.stories.js.map +1 -1
- package/dist/collection/components/z-tool/index.js +268 -0
- package/dist/collection/components/z-tool/index.js.map +1 -0
- package/dist/collection/components/z-tool/index.stories.js +70 -0
- package/dist/collection/components/z-tool/index.stories.js.map +1 -0
- package/dist/collection/components/z-tool/styles.css +91 -0
- package/dist/collection/components/z-toolbar/index.js +227 -0
- package/dist/collection/components/z-toolbar/index.js.map +1 -0
- package/dist/collection/components/z-toolbar/index.stories.js +437 -0
- package/dist/collection/components/z-toolbar/index.stories.js.map +1 -0
- package/dist/collection/components/z-toolbar/styles.css +55 -0
- package/dist/collection/components/z-tooltip/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-alert/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-body/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-cover/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer-sections/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-header/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-icon/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-info/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-list/index.js +1 -1
- package/dist/collection/snowflakes/myz/list/z-myz-list/index.js +1 -1
- package/dist/collection/snowflakes/myz/list/z-myz-list-item/index.js +1 -1
- package/dist/collection/snowflakes/myz/z-alert/index.js +1 -1
- package/dist/collection/snowflakes/myz/z-otp/index.js +2 -2
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/index18.js +1 -1
- package/dist/components/index19.js +1 -1
- package/dist/components/index20.js +1 -1
- package/dist/components/index21.js +1 -1
- package/dist/components/index22.js +1 -1
- package/dist/components/index25.js +13 -6
- package/dist/components/index25.js.map +1 -1
- package/dist/components/index3.js +1 -1
- package/dist/components/z-myz-card-alert.js +1 -1
- package/dist/components/z-myz-card-dictionary.js +1 -1
- package/dist/components/z-myz-card-footer-sections.js +1 -1
- package/dist/components/z-myz-card-footer.js +1 -1
- package/dist/components/z-myz-card-icon.js +1 -1
- package/dist/components/z-myz-card-info.js +1 -1
- package/dist/components/z-myz-card-list.js +1 -1
- package/dist/components/z-myz-list.js +1 -1
- package/dist/components/z-otp.js +2 -2
- package/dist/components/z-tool.d.ts +11 -0
- package/dist/components/z-tool.js +144 -0
- package/dist/components/z-tool.js.map +1 -0
- package/dist/components/z-toolbar.d.ts +11 -0
- package/dist/components/z-toolbar.js +168 -0
- package/dist/components/z-toolbar.js.map +1 -0
- package/dist/components/z-tooltip.js +1 -1
- package/dist/esm/index-c8ceadeb.js +8 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-alert.entry.js +1 -1
- package/dist/esm/z-app-header_12.entry.js +31 -26
- package/dist/esm/z-app-header_12.entry.js.map +1 -1
- package/dist/esm/z-myz-card-alert.entry.js +1 -1
- package/dist/esm/z-myz-card-dictionary.entry.js +1 -1
- package/dist/esm/z-myz-card-footer-sections.entry.js +1 -1
- package/dist/esm/z-myz-card-footer.entry.js +1 -1
- package/dist/esm/z-myz-card-icon.entry.js +1 -1
- package/dist/esm/z-myz-card-info.entry.js +1 -1
- package/dist/esm/z-myz-card-list.entry.js +1 -1
- package/dist/esm/z-myz-card_4.entry.js +4 -4
- package/dist/esm/z-myz-list-item.entry.js +1 -1
- package/dist/esm/z-myz-list.entry.js +1 -1
- package/dist/esm/z-otp.entry.js +2 -2
- package/dist/esm/z-tool.entry.js +101 -0
- package/dist/esm/z-tool.entry.js.map +1 -0
- package/dist/esm/z-toolbar.entry.js +146 -0
- package/dist/esm/z-toolbar.entry.js.map +1 -0
- package/dist/esm/z-tooltip.entry.js +1 -1
- package/dist/types/components/z-searchbar/index.d.ts +4 -0
- package/dist/types/components/z-searchbar/index.stories.d.ts +2 -0
- package/dist/types/components/z-tool/index.d.ts +39 -0
- package/dist/types/components/z-tool/index.stories.d.ts +44 -0
- package/dist/types/components/z-toolbar/index.d.ts +29 -0
- package/dist/types/components/z-toolbar/index.stories.d.ts +49 -0
- package/dist/types/components.d.ts +165 -0
- package/dist/web-components-library/{p-307c9c33.entry.js → p-04f80811.entry.js} +2 -2
- package/dist/web-components-library/{p-75e47ecf.entry.js → p-17e1abca.entry.js} +2 -2
- package/dist/web-components-library/p-17e1abca.entry.js.map +1 -0
- package/dist/web-components-library/p-198b1692.entry.js +2 -0
- package/dist/web-components-library/{p-33d2a5db.entry.js → p-22128478.entry.js} +2 -2
- package/dist/web-components-library/{p-daa1ffe9.entry.js → p-2aeffcf9.entry.js} +2 -2
- package/{www/build/p-28534fb5.entry.js → dist/web-components-library/p-2f948bac.entry.js} +2 -2
- package/dist/web-components-library/{p-028dd72a.entry.js → p-34975328.entry.js} +2 -2
- package/dist/web-components-library/{p-5c5882c6.entry.js → p-375f8542.entry.js} +2 -2
- package/dist/web-components-library/{p-dc086eb5.entry.js → p-44459393.entry.js} +2 -2
- package/dist/web-components-library/{p-863fd1c4.entry.js → p-5159edb1.entry.js} +2 -2
- package/dist/web-components-library/{p-af5e8524.entry.js → p-60e3fa30.entry.js} +2 -2
- package/dist/web-components-library/{p-f487290e.entry.js → p-8687691b.entry.js} +2 -2
- package/dist/web-components-library/p-bc7fd8af.entry.js +2 -0
- package/dist/web-components-library/p-bc7fd8af.entry.js.map +1 -0
- package/dist/web-components-library/{p-2ffdfbb1.entry.js → p-bdbcf353.entry.js} +2 -2
- package/dist/web-components-library/{p-460b2068.entry.js → p-d9c9de15.entry.js} +2 -2
- package/dist/web-components-library/p-f5dfd04d.entry.js +2 -0
- package/dist/web-components-library/p-f5dfd04d.entry.js.map +1 -0
- 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 +4 -3
- package/react/components.d.ts +2 -0
- package/react/components.js +3 -1
- package/react/components.js.map +1 -1
- package/www/build/{p-307c9c33.entry.js → p-04f80811.entry.js} +2 -2
- package/www/build/p-0aba9c42.js +2 -0
- package/www/build/{p-75e47ecf.entry.js → p-17e1abca.entry.js} +2 -2
- package/www/build/p-17e1abca.entry.js.map +1 -0
- package/www/build/p-198b1692.entry.js +2 -0
- package/www/build/{p-33d2a5db.entry.js → p-22128478.entry.js} +2 -2
- package/www/build/{p-daa1ffe9.entry.js → p-2aeffcf9.entry.js} +2 -2
- package/{dist/web-components-library/p-28534fb5.entry.js → www/build/p-2f948bac.entry.js} +2 -2
- package/www/build/{p-028dd72a.entry.js → p-34975328.entry.js} +2 -2
- package/www/build/{p-5c5882c6.entry.js → p-375f8542.entry.js} +2 -2
- package/www/build/{p-dc086eb5.entry.js → p-44459393.entry.js} +2 -2
- package/www/build/{p-863fd1c4.entry.js → p-5159edb1.entry.js} +2 -2
- package/www/build/{p-af5e8524.entry.js → p-60e3fa30.entry.js} +2 -2
- package/www/build/{p-f487290e.entry.js → p-8687691b.entry.js} +2 -2
- package/www/build/p-bc7fd8af.entry.js +2 -0
- package/www/build/p-bc7fd8af.entry.js.map +1 -0
- package/www/build/{p-2ffdfbb1.entry.js → p-bdbcf353.entry.js} +2 -2
- package/www/build/{p-460b2068.entry.js → p-d9c9de15.entry.js} +2 -2
- package/www/build/p-f5dfd04d.entry.js +2 -0
- package/www/build/p-f5dfd04d.entry.js.map +1 -0
- 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/web-components-library/p-75e47ecf.entry.js.map +0 -1
- package/dist/web-components-library/p-a2e87cec.entry.js +0 -2
- package/www/build/p-75e47ecf.entry.js.map +0 -1
- package/www/build/p-7646bea0.js +0 -2
- package/www/build/p-a2e87cec.entry.js +0 -2
- /package/dist/web-components-library/{p-307c9c33.entry.js.map → p-04f80811.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-a2e87cec.entry.js.map → p-198b1692.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-33d2a5db.entry.js.map → p-22128478.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-daa1ffe9.entry.js.map → p-2aeffcf9.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-28534fb5.entry.js.map → p-2f948bac.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-028dd72a.entry.js.map → p-34975328.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-5c5882c6.entry.js.map → p-375f8542.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-dc086eb5.entry.js.map → p-44459393.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-863fd1c4.entry.js.map → p-5159edb1.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-af5e8524.entry.js.map → p-60e3fa30.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-f487290e.entry.js.map → p-8687691b.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-2ffdfbb1.entry.js.map → p-bdbcf353.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-460b2068.entry.js.map → p-d9c9de15.entry.js.map} +0 -0
- /package/www/build/{p-307c9c33.entry.js.map → p-04f80811.entry.js.map} +0 -0
- /package/www/build/{p-a2e87cec.entry.js.map → p-198b1692.entry.js.map} +0 -0
- /package/www/build/{p-33d2a5db.entry.js.map → p-22128478.entry.js.map} +0 -0
- /package/www/build/{p-daa1ffe9.entry.js.map → p-2aeffcf9.entry.js.map} +0 -0
- /package/www/build/{p-28534fb5.entry.js.map → p-2f948bac.entry.js.map} +0 -0
- /package/www/build/{p-028dd72a.entry.js.map → p-34975328.entry.js.map} +0 -0
- /package/www/build/{p-5c5882c6.entry.js.map → p-375f8542.entry.js.map} +0 -0
- /package/www/build/{p-dc086eb5.entry.js.map → p-44459393.entry.js.map} +0 -0
- /package/www/build/{p-863fd1c4.entry.js.map → p-5159edb1.entry.js.map} +0 -0
- /package/www/build/{p-af5e8524.entry.js.map → p-60e3fa30.entry.js.map} +0 -0
- /package/www/build/{p-f487290e.entry.js.map → p-8687691b.entry.js.map} +0 -0
- /package/www/build/{p-2ffdfbb1.entry.js.map → p-bdbcf353.entry.js.map} +0 -0
- /package/www/build/{p-460b2068.entry.js.map → p-d9c9de15.entry.js.map} +0 -0
|
@@ -56,7 +56,7 @@ const ZMyzCardAlert = class {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
render() {
|
|
59
|
-
return (index.h("div", { key: '
|
|
59
|
+
return (index.h("div", { key: '78631a84365b1c5c436dde0fd52b2c2866deebfe', class: "alert-external-wrapper " + this.retrieveClass() }, index.h("z-alert", { key: '8e54a3f758e17f6fff72efdd994c00a237965153', type: this.getAlertType() }, index.h("div", { key: '17029eac681c851ce079a4471b229f105ac018ad', class: "relative-container" }, index.h("z-icon", { key: 'bbbe8c42c16d3571e5acdd56d3c2332a2eb36c18', name: this.iconname, width: 18, height: 18, class: this.retrieveClass() }), index.h("span", { key: '7ca5d395e3631b20f50b9cd62724a56721f3ec77', class: "content-text" }, this.contenttext), this.actiontext && !!this.actiontext.trim().length && (index.h("span", { key: 'ac7627ad12844fa386e550d48ac0267579e3a2e0', role: "button", tabindex: "0", class: "content-action", onClick: (e) => {
|
|
60
60
|
this.handleActionButtonClick(e);
|
|
61
61
|
}, onKeyPress: (e) => {
|
|
62
62
|
this.handleSpaceKeyPress(e);
|
|
@@ -27,7 +27,7 @@ const ZMyzCardDictionary = class {
|
|
|
27
27
|
this.cardFlipped.emit(showBack);
|
|
28
28
|
}
|
|
29
29
|
render() {
|
|
30
|
-
return (index.h("div", { key: '
|
|
30
|
+
return (index.h("div", { key: '4a22e906f15a897300c47195338a4ac7a8d097e0' }, index.h("z-myz-card", { key: '10ed7010f036216a498600fd7203ffb12c9dcdbe' }, index.h("z-myz-card-header", { key: 'df5a2bacb28913152f3f26172c6de9ea284722b1', titolo: this.name }), index.h("div", { key: 'df91b83426145ccf632233e2c0443e4f48c8b435', class: `content ${this.flipped ? "flipped" : ""}` }, index.h("div", { key: 'dfc0904493c116f39fd773fa93bac35eb8291c56', class: "front" }, index.h("z-myz-card-body", { key: '92c03400d1bafe40b1832cc5385d234acdcb589d' }, index.h("z-myz-card-cover", { key: 'de77df38946fa1dfcea760e46c371474bc034515', slot: "cover", titolo: this.name, img: this.cover, faded: this.disabled })), index.h("z-button", { key: 'c01d012aab0f5fe885482b3cc56614f1944faa95', class: { "hide-info": this.hideinfobtn }, variant: index$1.ButtonVariant.SECONDARY, icon: "informationsource", size: index$1.ButtonSize.X_SMALL, onClick: () => this.flipCard(true), disabled: this.flipped }, this.flipbuttonlabel)), index.h("div", { key: '8ce8e9790fa052fc7fcbd82063b77bbce10e2eb4', class: "back" }, index.h("slot", { key: '8f8136511b5e5e297d09e40f244d77df22e90dfb', name: "info" }))), index.h("slot", { key: 'bb52dcbe9f214bb84159a0d271d16a35978b82ac' }))));
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
ZMyzCardDictionary.style = ZMyzCardDictionaryStyle0;
|
|
@@ -12,7 +12,7 @@ const ZMyzCardFooterSections = class {
|
|
|
12
12
|
index.registerInstance(this, hostRef);
|
|
13
13
|
}
|
|
14
14
|
render() {
|
|
15
|
-
return (index.h("div", { key: '
|
|
15
|
+
return (index.h("div", { key: '4376492df8f4ac40ddb747fbb84702d7306a087d' }, index.h("footer", { key: '65ad57d32ecfa342c12900d2341c120fb2b13287' }, index.h("div", { key: 'a76dc6bd6b6e0702a0290f19226a5545993b8d87', class: "top" }, index.h("slot", { key: 'bce482d729d4f3d3e74eee129994e7d4593e6c8e', name: "top" })), index.h("div", { key: '8e440e41d186ffc5673bf0dcf0dc99fff504c043', class: "bottom" }, index.h("slot", { key: '8b685dd25a9049c960aa2272ced67556a3490654', name: "bottom" })))));
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
ZMyzCardFooterSections.style = ZMyzCardFooterSectionsStyle0;
|
|
@@ -64,7 +64,7 @@ const ZMyzCardFooter = class {
|
|
|
64
64
|
return this.host.querySelector("[slot=list] > li a");
|
|
65
65
|
}
|
|
66
66
|
render() {
|
|
67
|
-
return (index.h("div", { key: '
|
|
67
|
+
return (index.h("div", { key: '83e5307ed8967021822985e89efa8558d0018e72', class: Object.assign(Object.assign({}, this.retrieveClass()), { wrapper: true }) }, index.h("footer", { key: 'cf70e9a043cb396ae4aabc3f8e01d1dcfa3d5665', class: this.retrieveClass(), onTransitionEnd: (e) => this.footerTransitionHandler(e) }, index.h("span", { key: 'd6bdb1b37ad753489715fafdc5304de27bf85edc', class: "toggle" }, index.h("slot", { key: 'b35d85cf87e3cd59d9989c1c7d4d7139fbc4d549', name: "toggle" })), this.titolo && index.h("p", { key: '36ad25e514b88f22927ee74d4a0a81ccfe52cc62', class: { "custom-content": this.customContent } }, this.titolo), index.h("div", { key: '56c2b85852b762e305a69a7f977f2a8fb7ec12a3', class: { "content": true, "custom-content": this.customContent } }, index.h("div", { key: '1cbc7add9f6238292fc9ea7567a51ccfc62b46c7' }, index.h("p", { key: 'c0404f81e382330d6e56320f02aceee17e085926', class: "authors", ref: (el) => (this.ellipsisAuthors = el) }, index.h("span", { key: '0ec1e3a90d09bc379b34269b276da18e3a4f9388', title: this.getTitleAuthors() }, index.h("span", { key: '8d65743c8185c0ee4eb3c071f535eb5cda8dabab', "aria-description": "Autori", class: "bold" }, this.autori))), index.h("p", { key: '744e7e705826acfc3f2a9f9305250a0ecb293274', class: "year-isbn" }, index.h("span", { key: '9d29d231ed9186ffeb7376cf947613a581b626da', class: "isbn" }, index.h("span", { key: 'b3f8863a8d5e21438dfcaef4394c2f92ae513913' }, index.h("span", { key: 'b88062286041d060510ff4d17362a2f29485d15f', "aria-description": "ISBN edizione cartacea", class: "bold" }, this.isbn), " ", "(ed. cartacea)")))), index.h("div", { key: 'ded3e83f86629e34067e1dd316e54427b65cac6f', class: `slot-handler ${this.isOpen ? "visible" : "hidden"}` }, index.h("slot", { key: 'a5239567c931b5b880eef53a09e934dd8e7b65de', name: "list" })))), this.customContent && index.h("slot", { key: '42670c82172f6f86102f0d51209e2297cdf2c338', name: "content" })));
|
|
68
68
|
}
|
|
69
69
|
get host() { return index.getElement(this); }
|
|
70
70
|
};
|
|
@@ -15,7 +15,7 @@ const ZMyzCardIcon = class {
|
|
|
15
15
|
this.ariaLabel = "";
|
|
16
16
|
}
|
|
17
17
|
render() {
|
|
18
|
-
return (index.h("button", { key: '
|
|
18
|
+
return (index.h("button", { key: '9635ccd0f31e2fdf3e23cb14093b5eba6849c398', disabled: this.isdisabled, "aria-label": this.ariaLabel }, index.h("span", { key: 'de736d5eb1390564e2ffafb5a250594c8cf7a880' }, index.h("z-icon", { key: 'f93ea254dc71bf5ffae324ebab7bc467f511e403', name: this.icon, width: 16, height: 16 }))));
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
ZMyzCardIcon.style = ZMyzCardIconStyle0;
|
|
@@ -122,7 +122,7 @@ const ZMyzCardInfo = class {
|
|
|
122
122
|
return (index.h("section", { ref: (el) => (this.offlineLicenseWrapper = el) }, index.h("span", { class: "license-heading" }, index.h("span", null, "Licenza offline"), this.setExpirationLicenseMessage("offline")), "Scadenza il ", index.h("b", null, this.cardData.offlineLicense.expiration), index.h("br", null), "Installazioni disponibili: ", index.h("b", null, this.cardData.offlineLicense.installations)));
|
|
123
123
|
}
|
|
124
124
|
render() {
|
|
125
|
-
return (index.h("div", { key: '
|
|
125
|
+
return (index.h("div", { key: 'd1cea01909cd1c227b51cdc35de24751da0a0018' }, this.renderCloseIcon(), index.h("div", { key: '07fb4515f7735245515acf5b0b8685198aa2249a', class: "content-wrapper", ref: (el) => (this.contentWrapper = el) }, this.renderGeneralSection(), this.renderTooltip(), this.renderOnlineLicenseSection(), this.renderOfflineLicenseSection()), index.h("div", { key: 'cbaf2982c5ca62b1049ee900af1611ba01aa50fc', class: "cta-wrapper" }, index.h("slot", { key: '13033a69da6547029197f008abe3f9953eb09c12' }))));
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
128
|
ZMyzCardInfo.style = ZMyzCardInfoStyle0;
|
|
@@ -32,7 +32,7 @@ const ZMyzCardList = class {
|
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
render() {
|
|
35
|
-
return index.h("ul", { key: '
|
|
35
|
+
return index.h("ul", { key: '9ddf6f6fb65ea56c128db833841501fc03559231' }, this.renderList(JSON.parse(this.listdata)));
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
ZMyzCardList.style = ZMyzCardListStyle0;
|
|
@@ -39,7 +39,7 @@ const ZMyzCardComponent = class {
|
|
|
39
39
|
return elemClasses;
|
|
40
40
|
}
|
|
41
41
|
render() {
|
|
42
|
-
return (index.h("div", { key: '
|
|
42
|
+
return (index.h("div", { key: '7adb7b75ea965adc868514cf96d3098522d6b4bb', class: this.retrieveClass(), tabindex: "0" }, index.h("slot", { key: 'b1a3947eee9d39c8677e3e37b9f5a9da6887e7a1' })));
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
ZMyzCardComponent.style = ZMyzCardStyle0;
|
|
@@ -52,7 +52,7 @@ const ZMyzCardBody = class {
|
|
|
52
52
|
index.registerInstance(this, hostRef);
|
|
53
53
|
}
|
|
54
54
|
render() {
|
|
55
|
-
return (index.h("div", { key: '
|
|
55
|
+
return (index.h("div", { key: '0d02c2eac0ea628074ca649483b983e9c32673b7' }, index.h("slot", { key: '18354bf9d35e688c4ec5d6be8fe4e961dd5152e6', name: "alert" }), index.h("slot", { key: 'e81ab31f9de5bcbfb71b01e4a3578ec990a6cee2', name: "cover" })));
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
ZMyzCardBody.style = ZMyzCardBodyStyle0;
|
|
@@ -72,7 +72,7 @@ const ZMyzCardCover = class {
|
|
|
72
72
|
this.img = this.defaultimg;
|
|
73
73
|
}
|
|
74
74
|
render() {
|
|
75
|
-
return (index.h("img", { key: '
|
|
75
|
+
return (index.h("img", { key: '8e57d894119bd3c99b76a26b87f31856670aabec', class: this.faded && "faded", onError: this.hadleOnImageError.bind(this), alt: this.titolo, src: this.img }));
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
78
|
ZMyzCardCover.style = ZMyzCardCoverStyle0;
|
|
@@ -108,7 +108,7 @@ const ZMyzCardHeader = class {
|
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
110
|
render() {
|
|
111
|
-
return (index.h("header", { key: '
|
|
111
|
+
return (index.h("header", { key: '3441319103ffb2f4a1097b78233793b57f5cb601', class: this.retrieveClass() }, index.h("slot", { key: 'bade30d0e781d514d7280971c673091c6831f1a2', name: "aria-heading" }), index.h("span", { key: 'eee042b64a4aa2e01af89f0ebea2a93ef6df7c14', class: "card-title", ref: (el) => (this.ellipsis = el), title: this.getTitle() }, this.titolo), index.h("slot", { key: 'c94d1b4a500ab3efcb19cdf26652580d0d054a84', name: "icon" })));
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
114
|
ZMyzCardHeader.style = ZMyzCardHeaderStyle0;
|
|
@@ -33,7 +33,7 @@ const ZMyzListItem = class {
|
|
|
33
33
|
}
|
|
34
34
|
render() {
|
|
35
35
|
const linkId = this.listitemid ? `link_${this.listitemid}` : "";
|
|
36
|
-
return (index.h("li", { key: '
|
|
36
|
+
return (index.h("li", { key: 'f005ec38bc4d2531a311c35e46c52a2298519f39', role: "button", id: this.listitemid, "data-action": this.action, onClick: (e) => this.emitZListItemClick(e, this.listitemid), onKeyPress: (ev) => utils.handleKeyboardSubmit(ev, this.emitZListItemClick, this.listitemid) }, index.h("span", { key: 'fafa72132d9d089e54ff91cddce53cbe9dc380bb', class: this.underlined && "border" }, this.icon && index.h("z-icon", { key: 'f3315017c1db508f183294607ac2c98d971c3ed0', name: this.icon }), this.link ? (index.h("a", { href: this.link ? this.link : null, target: this.linktarget, id: linkId, onClick: (e) => this.emitZListItemLinkClick(e, linkId), onKeyPress: (ev) => utils.handleKeyboardSubmit(ev, this.emitZListItemLinkClick, linkId), role: this.link ? "link" : "button", tabindex: "0" }, this.text)) : (index.h("span", { innerHTML: this.text })), index.h("slot", { key: 'bfcf1098a059c5f3a56dfa45d9b1fa76c269cf68' }))));
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
ZMyzListItem.style = ZMyzListItemStyle0;
|
|
@@ -26,7 +26,7 @@ const ZMyzList = class {
|
|
|
26
26
|
}
|
|
27
27
|
render() {
|
|
28
28
|
const lastElem = this.list ? this.list.length - 1 : -1;
|
|
29
|
-
return (index.h("ul", { key: '
|
|
29
|
+
return (index.h("ul", { key: '6ec3bbeab4df0bb06bf5dd54f5a8d9e406da4446' }, this.list &&
|
|
30
30
|
this.list.map((bean, i) => (index.h("z-myz-list-item", { listitemid: bean.listitemid, text: bean.text, link: bean.link, linktarget: bean.linktarget, icon: bean.icon, underlined: lastElem != i })))));
|
|
31
31
|
}
|
|
32
32
|
static get watchers() { return {
|
|
@@ -24,7 +24,7 @@ const ZOtp = class {
|
|
|
24
24
|
this.otpRef = [...Array(this.inputNum)];
|
|
25
25
|
}
|
|
26
26
|
render() {
|
|
27
|
-
return (index.h("div", { key: '
|
|
27
|
+
return (index.h("div", { key: 'a990fff0baff0fea6c5728f5f27ce7463f190270', class: "otp-container" }, index.h("div", { key: 'c2f05fb85c20ebcf1b14729fdbaec8712dfd8c06', class: "digits-container" }, this.otp.map((_val, i) => (index.h("input", { class: this.status == index$1.InputStatus.ERROR ? "error" : null, onKeyDown: (e) => {
|
|
28
28
|
if (e.keyCode > 47) {
|
|
29
29
|
this.otpRef[i].value = "";
|
|
30
30
|
}
|
|
@@ -35,7 +35,7 @@ const ZOtp = class {
|
|
|
35
35
|
}, onInput: (e) => {
|
|
36
36
|
this.otp[i] = e.target.value;
|
|
37
37
|
this.emitInputChange(this.otp.join(""));
|
|
38
|
-
}, type: "text", minlength: "1", maxlength: "1", autoComplete: "off", ref: (el) => (this.otpRef[i] = el) })))), index.h("z-input-message", { key: '
|
|
38
|
+
}, type: "text", minlength: "1", maxlength: "1", autoComplete: "off", ref: (el) => (this.otpRef[i] = el) })))), index.h("z-input-message", { key: '52e8e505f1817635f529b8a1dc971f94655f0ffd', message: this.message, status: this.status })));
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
ZOtp.style = ZOtpStyle0;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-96af6326.js');
|
|
6
|
+
const index$1 = require('./index-97a4c18d.js');
|
|
7
|
+
|
|
8
|
+
const stylesCss = ":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);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([active]) .z-tool{box-shadow:inset 0 0 0 2px var(--color-primary01)}:host([open]) .z-tool{box-shadow:inset 0 0 0 2px var(--color-primary01)}@media (hover: hover){:host(:not([disabled])) .z-tool:hover{background-color:var(--color-primary03)}}:host([disabled]) .z-tool{color:var(--color-disabled01-icon);cursor:not-allowed}.z-tool:focus-visible{box-shadow:inset 0 0 0 2px var(--color-primary01);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-icon{fill:var(--color-disabled01-icon)}.z-tool-tooltip{--z-popover-padding:calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 2);--z-popover-theme--surface:var(--color-surface05);--z-popover-theme--text:var(--color-text-inverse);--z-popover-shadow-filter:drop-shadow(0 4px 8px var(--shadow-color-base));z-index:2;font-family:var(--font-family-sans)}@media (max-width: 767px){.z-tool-tooltip{display:none !important}}:host{position:var(--z-tool-host-position, relative)}.z-tool-submenu{position:var(--z-tool-submenu-position, absolute);z-index:1;top:var(--z-tool-submenu-top, calc(100% + 4px));bottom:var(--z-tool-submenu-bottom, auto);left:var(--z-tool-submenu-left, 50%);display:none;transform:var(--z-tool-submenu-transform, translateX(-50%))}.z-tool-submenu-open{display:block}";
|
|
9
|
+
const ZToolStyle0 = stylesCss;
|
|
10
|
+
|
|
11
|
+
const ZTool = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.toggleSubmenu = index.createEvent(this, "toggleSubmenu", 7);
|
|
15
|
+
this.handleTooltipOpen = () => {
|
|
16
|
+
//This.isNested check prevents tooltips from showing on nested tools, e.g. inside submenus
|
|
17
|
+
//This control will be removed in future versions when nested tooltips will be supported
|
|
18
|
+
if (!this.tooltip || this.isNested) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
clearTimeout(this.hoverDelay);
|
|
22
|
+
this.hoverDelay = setTimeout(() => {
|
|
23
|
+
this.tooltipOpen = true;
|
|
24
|
+
}, 1000);
|
|
25
|
+
};
|
|
26
|
+
this.handleTooltipClose = () => {
|
|
27
|
+
if (!this.tooltip) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
clearTimeout(this.hoverDelay);
|
|
31
|
+
this.tooltipOpen = false;
|
|
32
|
+
};
|
|
33
|
+
this.handleClick = () => {
|
|
34
|
+
if (this.disabled) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (this.hasSlottedContent) {
|
|
38
|
+
this.open = !this.open;
|
|
39
|
+
if (this.open) {
|
|
40
|
+
this.focusNestedToolbar();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
this.icon = undefined;
|
|
45
|
+
this.tooltip = undefined;
|
|
46
|
+
this.tooltipPosition = index$1.PopoverPosition.TOP;
|
|
47
|
+
this.htmlAriaLabel = undefined;
|
|
48
|
+
this.active = false;
|
|
49
|
+
this.disabled = false;
|
|
50
|
+
this.open = false;
|
|
51
|
+
this.tooltipOpen = false;
|
|
52
|
+
this.hasSlottedContent = false;
|
|
53
|
+
this.isNested = false;
|
|
54
|
+
}
|
|
55
|
+
handleOpenChange() {
|
|
56
|
+
this.toggleSubmenu.emit(this.open);
|
|
57
|
+
}
|
|
58
|
+
focusNestedToolbar() {
|
|
59
|
+
requestAnimationFrame(() => {
|
|
60
|
+
var _a;
|
|
61
|
+
const nestedToolbar = this.hostElement.querySelector("z-toolbar");
|
|
62
|
+
if (nestedToolbar) {
|
|
63
|
+
const firstTool = nestedToolbar.querySelector("z-tool");
|
|
64
|
+
if (firstTool) {
|
|
65
|
+
const button = (_a = firstTool.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("button");
|
|
66
|
+
if (button) {
|
|
67
|
+
button.focus();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
checkIfNested() {
|
|
74
|
+
let parent = this.hostElement.parentElement;
|
|
75
|
+
while (parent) {
|
|
76
|
+
if (parent.tagName.toLowerCase() === "z-tool") {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
parent = parent.parentElement;
|
|
80
|
+
}
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
componentWillLoad() {
|
|
84
|
+
this.hasSlottedContent = this.hostElement.children.length > 0;
|
|
85
|
+
this.isNested = this.checkIfNested();
|
|
86
|
+
}
|
|
87
|
+
disconnectedCallback() {
|
|
88
|
+
clearTimeout(this.hoverDelay);
|
|
89
|
+
}
|
|
90
|
+
render() {
|
|
91
|
+
return (index.h(index.Host, { key: '29475c2061b8031c6d742e0b67bdcaa657acf269', nested: this.isNested }, index.h("button", { key: '7b2c77c12e7d62a0560a8c71d8660e45927d4024', class: "z-tool", type: "button", "aria-pressed": this.active ? "true" : "false", "aria-expanded": this.hasSlottedContent ? (this.open ? "true" : "false") : 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 }, index.h("z-icon", { key: '4c4b2d93bb5d8869cff58970f6c1a52ae82041e9', ref: (el) => (this.iconRef = el), name: this.icon })), this.tooltip && !this.isNested && (index.h("z-popover", { key: '87078924f19cbd8ec1efeaa460fad64d3d45701d', class: "z-tool-tooltip", bindTo: this.iconRef, open: this.tooltipOpen, position: this.tooltipPosition, showArrow: true, center: true, closable: false }, index.h("span", { key: 'a11623609058d4106f18ed8d523e32ee102afaa7', class: "body-4" }, this.tooltip))), this.hasSlottedContent && (index.h("div", { key: 'c22cf9f4ffe622afc11be4e94722d5232df7dd58', class: {
|
|
92
|
+
"z-tool-submenu": true,
|
|
93
|
+
"z-tool-submenu-open": this.open,
|
|
94
|
+
} }, index.h("slot", { key: '0e789c315bbcdc50c6ffbb32d225be7f12b9cd59' })))));
|
|
95
|
+
}
|
|
96
|
+
get hostElement() { return index.getElement(this); }
|
|
97
|
+
static get watchers() { return {
|
|
98
|
+
"open": ["handleOpenChange"]
|
|
99
|
+
}; }
|
|
100
|
+
};
|
|
101
|
+
ZTool.style = ZToolStyle0;
|
|
102
|
+
|
|
103
|
+
exports.z_tool = ZTool;
|
|
104
|
+
|
|
105
|
+
//# sourceMappingURL=z-tool.cjs.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"z-tool.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,SAAS,GAAG,krDAAkrD,CAAC;AACrsD,oBAAe,SAAS;;MCWX,KAAK;;;;QAqDR,sBAAiB,GAAG;;;YAG1B,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE;gBAClC,OAAO;aACR;YACD,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC9B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;gBAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;aACzB,EAAE,IAAI,CAAC,CAAC;SACV,CAAC;QAEM,uBAAkB,GAAG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,eAAe,EAC9B,SAAS,QACT,MAAM,QACN,QAAQ,EAAE,KAAK,IAEfA,mEAAM,KAAK,EAAC,QAAQ,IAAE,IAAI,CAAC,OAAO,CAAQ,CAChC,CACb,EACA,IAAI,CAAC,iBAAiB,KACrBA,kEACE,KAAK,EAAE;gBACL,gBAAgB,EAAE,IAAI;gBACtB,qBAAqB,EAAE,IAAI,CAAC,IAAI;aACjC,IAEDA,oEAAa,CACT,CACP,CACI,EACP;KACH;;;;;;;;;;","names":["PopoverPosition","h","Host"],"sources":["src/components/z-tool/styles.css?tag=z-tool&encapsulation=shadow","src/components/z-tool/index.tsx"],"sourcesContent":[":host,\n* {\n box-sizing: border-box;\n}\n\n.z-tool {\n --z-tool-size: calc(var(--space-unit) * 5.5);\n --z-tool-icon-size: calc(var(--space-unit) * 2.5);\n\n display: inline-flex;\n width: var(--z-tool-size);\n height: var(--z-tool-size);\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n margin: 0;\n background-color: var(--color-surface01);\n border-radius: var(--border-radius);\n cursor: pointer;\n}\n\n:host([active]) .z-tool {\n box-shadow: inset 0 0 0 2px var(--color-primary01);\n}\n\n:host([open]) .z-tool {\n box-shadow: inset 0 0 0 2px var(--color-primary01);\n}\n\n@media (hover: hover) {\n :host(:not([disabled])) .z-tool:hover {\n background-color: var(--color-primary03);\n }\n}\n\n:host([disabled]) .z-tool {\n color: var(--color-disabled01-icon);\n cursor: not-allowed;\n}\n\n.z-tool:focus-visible {\n box-shadow: inset 0 0 0 2px var(--color-primary01);\n outline: none;\n}\n\nz-icon {\n --z-icon-width: var(--z-tool-icon-size);\n --z-icon-height: var(--z-tool-icon-size);\n\n display: block;\n fill: var(--color-default-icon);\n}\n\n:host([disabled]) z-icon {\n fill: var(--color-disabled01-icon);\n}\n\n.z-tool-tooltip {\n --z-popover-padding: calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 2);\n --z-popover-theme--surface: var(--color-surface05);\n --z-popover-theme--text: var(--color-text-inverse);\n --z-popover-shadow-filter: drop-shadow(0 4px 8px var(--shadow-color-base));\n\n z-index: 2;\n font-family: var(--font-family-sans);\n}\n\n@media (max-width: 767px) {\n .z-tool-tooltip {\n display: none !important;\n }\n}\n\n:host {\n position: var(--z-tool-host-position, relative);\n}\n\n.z-tool-submenu {\n position: var(--z-tool-submenu-position, absolute);\n z-index: 1;\n top: var(--z-tool-submenu-top, calc(100% + 4px));\n bottom: var(--z-tool-submenu-bottom, auto);\n left: var(--z-tool-submenu-left, 50%);\n display: none;\n transform: var(--z-tool-submenu-transform, translateX(-50%));\n}\n\n.z-tool-submenu-open {\n display: block;\n}\n","import {Component, Element, Event, EventEmitter, Host, Prop, State, Watch, h} from \"@stencil/core\";\nimport {PopoverPosition} from \"../../beans\";\n\n/**\n * ZTool component.\n * @slot - Optional slot for nested content (e.g., a secondary z-toolbar) that appears when the tool is open/clicked.\n */\n@Component({\n tag: \"z-tool\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZTool {\n @Element() hostElement: HTMLZToolElement;\n\n /** Tool icon */\n @Prop()\n icon: string;\n\n /** Text displayed inside the tooltip. */\n @Prop()\n tooltip?: string;\n\n /** Preferred tooltip position. Defaults to true. */\n @Prop()\n tooltipPosition: PopoverPosition = PopoverPosition.TOP;\n\n /** Accessible label for the tool trigger. Falls back to tooltip content. */\n @Prop()\n htmlAriaLabel?: string;\n\n /** Visual selected state. */\n @Prop({reflect: true})\n active = false;\n\n /** Disabled state. */\n @Prop({reflect: true})\n disabled = false;\n\n /** Open state. */\n @Prop({reflect: true, mutable: true})\n open = false;\n\n @State()\n tooltipOpen = false;\n\n @State()\n hasSlottedContent = false;\n\n @State()\n isNested = false;\n\n /** Emitted when the open state changes. */\n @Event()\n toggleSubmenu: EventEmitter;\n\n private iconRef?: HTMLElement;\n\n private hoverDelay?: ReturnType<typeof setTimeout>;\n\n @Watch(\"open\")\n handleOpenChange(): void {\n this.toggleSubmenu.emit(this.open);\n }\n\n private handleTooltipOpen = (): void => {\n //This.isNested check prevents tooltips from showing on nested tools, e.g. inside submenus\n //This control will be removed in future versions when nested tooltips will be supported\n if (!this.tooltip || this.isNested) {\n return;\n }\n clearTimeout(this.hoverDelay);\n this.hoverDelay = setTimeout(() => {\n this.tooltipOpen = true;\n }, 1000);\n };\n\n private handleTooltipClose = (): void => {\n if (!this.tooltip) {\n return;\n }\n clearTimeout(this.hoverDelay);\n this.tooltipOpen = false;\n };\n\n private handleClick = (): void => {\n if (this.disabled) {\n return;\n }\n\n if (this.hasSlottedContent) {\n this.open = !this.open;\n if (this.open) {\n this.focusNestedToolbar();\n }\n }\n };\n\n private focusNestedToolbar(): void {\n requestAnimationFrame(() => {\n const nestedToolbar = this.hostElement.querySelector(\"z-toolbar\");\n if (nestedToolbar) {\n const firstTool = nestedToolbar.querySelector(\"z-tool\");\n if (firstTool) {\n const button = firstTool.shadowRoot?.querySelector(\"button\");\n if (button) {\n button.focus();\n }\n }\n }\n });\n }\n\n private checkIfNested(): boolean {\n let parent = this.hostElement.parentElement;\n while (parent) {\n if (parent.tagName.toLowerCase() === \"z-tool\") {\n return true;\n }\n parent = parent.parentElement;\n }\n\n return false;\n }\n\n componentWillLoad(): void {\n this.hasSlottedContent = this.hostElement.children.length > 0;\n this.isNested = this.checkIfNested();\n }\n\n disconnectedCallback(): void {\n clearTimeout(this.hoverDelay);\n }\n\n render(): HTMLZToolElement {\n return (\n <Host nested={this.isNested}>\n <button\n class=\"z-tool\"\n type=\"button\"\n aria-pressed={this.active ? \"true\" : \"false\"}\n aria-expanded={this.hasSlottedContent ? (this.open ? \"true\" : \"false\") : undefined}\n aria-label={this.htmlAriaLabel || this.tooltip || undefined}\n disabled={this.disabled}\n onClick={this.handleClick}\n onMouseEnter={this.handleTooltipOpen}\n onMouseLeave={this.handleTooltipClose}\n onFocus={this.handleTooltipOpen}\n onBlur={this.handleTooltipClose}\n >\n <z-icon\n ref={(el) => (this.iconRef = el)}\n name={this.icon}\n ></z-icon>\n </button>\n {this.tooltip && !this.isNested && (\n <z-popover\n class=\"z-tool-tooltip\"\n bindTo={this.iconRef}\n open={this.tooltipOpen}\n position={this.tooltipPosition}\n showArrow\n center\n closable={false}\n >\n <span class=\"body-4\">{this.tooltip}</span>\n </z-popover>\n )}\n {this.hasSlottedContent && (\n <div\n class={{\n \"z-tool-submenu\": true,\n \"z-tool-submenu-open\": this.open,\n }}\n >\n <slot></slot>\n </div>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-96af6326.js');
|
|
6
|
+
const index$1 = require('./index-97a4c18d.js');
|
|
7
|
+
|
|
8
|
+
const stylesCss = ":host,*{box-sizing:border-box}:host{display:inline-flex;align-items:center;padding:0;border:var(--border-size-small) solid var(--color-surface03);background-color:var(--color-surface01);border-radius:var(--border-radius);box-shadow:var(--shadow-4);gap:calc(var(--space-unit) / 2)}::slotted(z-divider){height:calc(var(--space-unit) * 4.5) !important}@media (max-width: 767px){:host{--z-toolbar-columns:8;position:relative;display:inline-grid;align-items:stretch;background:repeating-linear-gradient(\n to bottom,\n transparent 0,\n transparent calc(var(--space-unit) * 5.5),\n var(--color-surface03) calc(var(--space-unit) * 5.5),\n var(--color-surface03) calc(var(--space-unit) * 5.5 + 1px)\n )\n center / calc(100% - var(--space-unit)) 100% no-repeat var(--color-surface01);column-gap:calc(var(--space-unit) / 2);grid-template-columns:repeat(var(--z-toolbar-columns, auto-fill), auto);row-gap:var(--border-size-small);--z-tool-host-position:static;--z-tool-submenu-top:auto;--z-tool-submenu-bottom:calc(100% + calc(var(--space-unit) / 2));--z-tool-submenu-left:0;--z-tool-submenu-transform:none}::slotted(z-divider){display:none !important}::slotted(z-tool){border-radius:var(--border-radius)}}";
|
|
9
|
+
const ZToolbarStyle0 = stylesCss;
|
|
10
|
+
|
|
11
|
+
const ZToolbar = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
/** List of focusable tool elements. */
|
|
15
|
+
this.toolItems = [];
|
|
16
|
+
this.htmlAriaLabel = undefined;
|
|
17
|
+
this.currentFocusIndex = 0;
|
|
18
|
+
}
|
|
19
|
+
componentDidLoad() {
|
|
20
|
+
this.collectToolItems();
|
|
21
|
+
this.updateTabIndexes();
|
|
22
|
+
//set css variable --z-toolbar-columns based on the number of tools in the toolbar, so that the background pattern can adapt to the number of rows
|
|
23
|
+
let colBreakpoint = parseInt(getComputedStyle(this.hostElement).getPropertyValue("--z-toolbar-columns") || "8");
|
|
24
|
+
colBreakpoint = this.toolItems.length <= colBreakpoint ? this.toolItems.length : colBreakpoint;
|
|
25
|
+
this.hostElement.style.setProperty("--z-toolbar-columns", colBreakpoint.toString());
|
|
26
|
+
}
|
|
27
|
+
/** Collect all z-tool elements in the toolbar (not nested ones). */
|
|
28
|
+
collectToolItems() {
|
|
29
|
+
this.toolItems = Array.from(this.hostElement.querySelectorAll("z-tool:not(:scope z-tool z-tool)"));
|
|
30
|
+
}
|
|
31
|
+
updateTabIndexes() {
|
|
32
|
+
this.toolItems.forEach((tool, index) => {
|
|
33
|
+
var _a;
|
|
34
|
+
const button = (_a = tool.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("button");
|
|
35
|
+
if (button) {
|
|
36
|
+
button.tabIndex = index === this.currentFocusIndex ? 0 : -1;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
focusToolAt(index, fallback = "next") {
|
|
41
|
+
var _a;
|
|
42
|
+
const tool = this.toolItems[index];
|
|
43
|
+
if (tool) {
|
|
44
|
+
const button = (_a = tool.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("button");
|
|
45
|
+
this.currentFocusIndex = index;
|
|
46
|
+
if (button.disabled || !button) {
|
|
47
|
+
if (fallback === "next") {
|
|
48
|
+
this.focusNextTool();
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
this.focusPreviousTool();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else if (button) {
|
|
55
|
+
button.focus();
|
|
56
|
+
this.updateTabIndexes();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
focusNextTool() {
|
|
61
|
+
const nextIndex = (this.currentFocusIndex + 1) % this.toolItems.length;
|
|
62
|
+
this.focusToolAt(nextIndex);
|
|
63
|
+
}
|
|
64
|
+
focusPreviousTool() {
|
|
65
|
+
const prevIndex = (this.currentFocusIndex - 1 + this.toolItems.length) % this.toolItems.length;
|
|
66
|
+
this.focusToolAt(prevIndex, "previous");
|
|
67
|
+
}
|
|
68
|
+
focusParentTool(event) {
|
|
69
|
+
var _a;
|
|
70
|
+
const parentTool = this.hostElement.closest("z-tool");
|
|
71
|
+
if (parentTool) {
|
|
72
|
+
event.preventDefault();
|
|
73
|
+
event.stopPropagation();
|
|
74
|
+
parentTool.open = false;
|
|
75
|
+
const parentButton = (_a = parentTool.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("button");
|
|
76
|
+
if (parentButton) {
|
|
77
|
+
parentButton.focus();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/** Close all open submenus in the toolbar. */
|
|
82
|
+
async closeSubmenus() {
|
|
83
|
+
const tools = this.hostElement.querySelectorAll(":scope > z-tool");
|
|
84
|
+
tools.forEach((tool) => {
|
|
85
|
+
if (tool.open) {
|
|
86
|
+
tool.open = false;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
closeSibilingSubmenusOnOpen(event) {
|
|
91
|
+
if (event.detail === true) {
|
|
92
|
+
const tools = this.hostElement.querySelectorAll(":scope > z-tool");
|
|
93
|
+
tools.forEach((tool) => {
|
|
94
|
+
if (tool !== event.target.closest("z-tool") && tool.open) {
|
|
95
|
+
tool.open = false;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
handleKeyDown(event) {
|
|
101
|
+
this.collectToolItems();
|
|
102
|
+
const target = event.target;
|
|
103
|
+
const toolElement = target.closest("z-tool");
|
|
104
|
+
if (!toolElement || !this.toolItems.includes(toolElement)) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const focusedIndex = this.toolItems.indexOf(toolElement);
|
|
108
|
+
if (focusedIndex !== -1) {
|
|
109
|
+
this.currentFocusIndex = focusedIndex;
|
|
110
|
+
}
|
|
111
|
+
switch (event.key) {
|
|
112
|
+
case index$1.KeyboardCode.ARROW_RIGHT:
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
this.focusNextTool();
|
|
115
|
+
break;
|
|
116
|
+
case index$1.KeyboardCode.ARROW_LEFT:
|
|
117
|
+
event.preventDefault();
|
|
118
|
+
this.focusPreviousTool();
|
|
119
|
+
break;
|
|
120
|
+
case index$1.KeyboardCode.ESC:
|
|
121
|
+
case index$1.KeyboardCode.TAB:
|
|
122
|
+
this.focusParentTool(event);
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
handleFocusIn(event) {
|
|
127
|
+
// When focus enters the toolbar, update the current focus index
|
|
128
|
+
const target = event.target;
|
|
129
|
+
const toolElement = target.closest("z-tool");
|
|
130
|
+
if (toolElement && this.toolItems.includes(toolElement)) {
|
|
131
|
+
const index = this.toolItems.indexOf(toolElement);
|
|
132
|
+
if (index !== -1 && index !== this.currentFocusIndex) {
|
|
133
|
+
this.currentFocusIndex = index;
|
|
134
|
+
this.updateTabIndexes();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
render() {
|
|
139
|
+
return (index.h(index.Host, { key: 'b03b77a808c6e0c1724e6765210e83bad3a7c4dc', role: "toolbar", "aria-label": this.htmlAriaLabel }, index.h("slot", { key: '448035bb2842a93ed4e0bb433d1e506007b93519', onSlotchange: () => {
|
|
140
|
+
this.collectToolItems();
|
|
141
|
+
this.updateTabIndexes();
|
|
142
|
+
} })));
|
|
143
|
+
}
|
|
144
|
+
get hostElement() { return index.getElement(this); }
|
|
145
|
+
};
|
|
146
|
+
ZToolbar.style = ZToolbarStyle0;
|
|
147
|
+
|
|
148
|
+
exports.z_toolbar = ZToolbar;
|
|
149
|
+
|
|
150
|
+
//# sourceMappingURL=z-toolbar.cjs.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"z-toolbar.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,SAAS,GAAG,0tCAA0tC,CAAC;AAC7uC,uBAAe,SAAS;;MCaX,QAAQ;;;;QAYX,cAAS,GAAuB,EAAE,CAAC;;iCAHvB,CAAC;;IAKrB,gBAAgB;QACd,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,gBAAgB,EAAE,CAAC;;QAExB,IAAI,aAAa,GAAG,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,IAAI,GAAG,CAAC,CAAC;QAChH,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,aAAa,CAAC;QAC/F,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,qBAAqB,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC;KACrF;;IAGO,gBAAgB;QACtB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,kCAAkC,CAAC,CAAC,CAAC;KACpG;IAEO,gBAAgB;QACtB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK;;YACjC,MAAM,MAAM,GAAG,MAAA,IAAI,CAAC,UAAU,0CAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;YACxD,I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AAI,CAAC,gBAAgB,EAAE,CAAC;aACzB,GACK,CACH,EACP;KACH;;;;;;;","names":["KeyboardCode","h","Host"],"sources":["src/components/z-toolbar/styles.css?tag=z-toolbar&encapsulation=shadow","src/components/z-toolbar/index.tsx"],"sourcesContent":[":host,\n* {\n box-sizing: border-box;\n}\n\n:host {\n display: inline-flex;\n align-items: center;\n padding: 0;\n border: var(--border-size-small) solid var(--color-surface03);\n background-color: var(--color-surface01);\n border-radius: var(--border-radius);\n box-shadow: var(--shadow-4);\n gap: calc(var(--space-unit) / 2);\n}\n\n::slotted(z-divider) {\n height: calc(var(--space-unit) * 4.5) !important;\n}\n\n@media (max-width: 767px) {\n :host {\n --z-toolbar-columns: 8;\n\n position: relative;\n display: inline-grid;\n align-items: stretch;\n background: repeating-linear-gradient(\n to bottom,\n transparent 0,\n transparent calc(var(--space-unit) * 5.5),\n var(--color-surface03) calc(var(--space-unit) * 5.5),\n var(--color-surface03) calc(var(--space-unit) * 5.5 + 1px)\n )\n center / calc(100% - var(--space-unit)) 100% no-repeat var(--color-surface01);\n column-gap: calc(var(--space-unit) / 2);\n grid-template-columns: repeat(var(--z-toolbar-columns, auto-fill), auto);\n row-gap: var(--border-size-small);\n\n /* Overrides z-tool submenu positioning */\n --z-tool-host-position: static;\n --z-tool-submenu-top: auto;\n --z-tool-submenu-bottom: calc(100% + calc(var(--space-unit) / 2));\n --z-tool-submenu-left: 0;\n --z-tool-submenu-transform: none;\n }\n\n ::slotted(z-divider) {\n display: none !important;\n }\n\n ::slotted(z-tool) {\n border-radius: var(--border-radius);\n }\n}\n","import {Component, Element, Host, Listen, Method, Prop, State, h} from \"@stencil/core\";\nimport {KeyboardCode} from \"../../beans\";\n\n/**\n * ZToolbar component.\n * Implements WCAG toolbar pattern with roving tabindex keyboard navigation.\n * Tools can be visually grouped using `z-divider` elements as separators.\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/toolbar/\n */\n@Component({\n tag: \"z-toolbar\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZToolbar {\n @Element() hostElement: HTMLZToolbarElement;\n\n /** Accessible label for the toolbar. */\n @Prop()\n htmlAriaLabel?: string;\n\n /** Index of the currently focusable item (roving tabindex). */\n @State()\n currentFocusIndex = 0;\n\n /** List of focusable tool elements. */\n private toolItems: HTMLZToolElement[] = [];\n\n componentDidLoad(): void {\n this.collectToolItems();\n this.updateTabIndexes();\n //set css variable --z-toolbar-columns based on the number of tools in the toolbar, so that the background pattern can adapt to the number of rows\n let colBreakpoint = parseInt(getComputedStyle(this.hostElement).getPropertyValue(\"--z-toolbar-columns\") || \"8\");\n colBreakpoint = this.toolItems.length <= colBreakpoint ? this.toolItems.length : colBreakpoint;\n this.hostElement.style.setProperty(\"--z-toolbar-columns\", colBreakpoint.toString());\n }\n\n /** Collect all z-tool elements in the toolbar (not nested ones). */\n private collectToolItems(): void {\n this.toolItems = Array.from(this.hostElement.querySelectorAll(\"z-tool:not(:scope z-tool z-tool)\"));\n }\n\n private updateTabIndexes(): void {\n this.toolItems.forEach((tool, index) => {\n const button = tool.shadowRoot?.querySelector(\"button\");\n if (button) {\n button.tabIndex = index === this.currentFocusIndex ? 0 : -1;\n }\n });\n }\n\n private focusToolAt(index: number, fallback: \"previous\" | \"next\" = \"next\"): void {\n const tool = this.toolItems[index];\n if (tool) {\n const button = tool.shadowRoot?.querySelector(\"button\");\n this.currentFocusIndex = index;\n if (button.disabled || !button) {\n if (fallback === \"next\") {\n this.focusNextTool();\n } else {\n this.focusPreviousTool();\n }\n } else if (button) {\n button.focus();\n this.updateTabIndexes();\n }\n }\n }\n\n private focusNextTool(): void {\n const nextIndex = (this.currentFocusIndex + 1) % this.toolItems.length;\n this.focusToolAt(nextIndex);\n }\n\n private focusPreviousTool(): void {\n const prevIndex = (this.currentFocusIndex - 1 + this.toolItems.length) % this.toolItems.length;\n this.focusToolAt(prevIndex, \"previous\");\n }\n\n private focusParentTool(event: KeyboardEvent): void {\n const parentTool = this.hostElement.closest(\"z-tool\") as HTMLZToolElement;\n if (parentTool) {\n event.preventDefault();\n event.stopPropagation();\n parentTool.open = false;\n const parentButton = parentTool.shadowRoot?.querySelector(\"button\");\n if (parentButton) {\n parentButton.focus();\n }\n }\n }\n\n /** Close all open submenus in the toolbar. */\n @Method()\n async closeSubmenus(): Promise<void> {\n const tools = this.hostElement.querySelectorAll<HTMLZToolElement>(\":scope > z-tool\");\n tools.forEach((tool) => {\n if (tool.open) {\n tool.open = false;\n }\n });\n }\n\n @Listen(\"toggleSubmenu\")\n closeSibilingSubmenusOnOpen(event: CustomEvent): void {\n if (event.detail === true) {\n const tools = this.hostElement.querySelectorAll<HTMLZToolElement>(\":scope > z-tool\");\n tools.forEach((tool) => {\n if (tool !== (event.target as HTMLElement).closest(\"z-tool\") && tool.open) {\n tool.open = false;\n }\n });\n }\n }\n\n @Listen(\"keydown\")\n handleKeyDown(event: KeyboardEvent): void {\n this.collectToolItems();\n\n const target = event.target as HTMLElement;\n const toolElement = target.closest(\"z-tool\") as HTMLZToolElement;\n\n if (!toolElement || !this.toolItems.includes(toolElement)) {\n return;\n }\n\n const focusedIndex = this.toolItems.indexOf(toolElement);\n if (focusedIndex !== -1) {\n this.currentFocusIndex = focusedIndex;\n }\n\n switch (event.key) {\n case KeyboardCode.ARROW_RIGHT:\n event.preventDefault();\n this.focusNextTool();\n break;\n case KeyboardCode.ARROW_LEFT:\n event.preventDefault();\n this.focusPreviousTool();\n break;\n case KeyboardCode.ESC:\n case KeyboardCode.TAB:\n this.focusParentTool(event);\n break;\n }\n }\n\n @Listen(\"focusin\")\n handleFocusIn(event: FocusEvent): void {\n // When focus enters the toolbar, update the current focus index\n const target = event.target as HTMLElement;\n const toolElement = target.closest(\"z-tool\") as HTMLZToolElement;\n\n if (toolElement && this.toolItems.includes(toolElement)) {\n const index = this.toolItems.indexOf(toolElement);\n if (index !== -1 && index !== this.currentFocusIndex) {\n this.currentFocusIndex = index;\n this.updateTabIndexes();\n }\n }\n }\n\n render(): HTMLZToolbarElement {\n return (\n <Host\n role=\"toolbar\"\n aria-label={this.htmlAriaLabel}\n >\n <slot\n onSlotchange={() => {\n this.collectToolItems();\n this.updateTabIndexes();\n }}\n ></slot>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -21,7 +21,7 @@ const ZTooltip = class {
|
|
|
21
21
|
this.open = this.popoverEl.open;
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
|
-
return (index.h("z-popover", { key: '
|
|
24
|
+
return (index.h("z-popover", { key: 'fe8da17a58d70db3756fb35f8230d95b4546ee8a', ref: (el) => (this.popoverEl = el), bindTo: this.bindTo, open: this.open, position: this.position, closable: this.closable, center: true, showArrow: true }, index.h("slot", { key: 'cc8f284849ce1a08a6fdbe2b521006babd87de24' })));
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
ZTooltip.style = ZTooltipStyle0;
|
|
@@ -66,6 +66,8 @@
|
|
|
66
66
|
"components/z-toast-notification-list/index.js",
|
|
67
67
|
"components/z-toggle-button/index.js",
|
|
68
68
|
"components/z-toggle-switch/index.js",
|
|
69
|
+
"components/z-tool/index.js",
|
|
70
|
+
"components/z-toolbar/index.js",
|
|
69
71
|
"components/z-tooltip/index.js",
|
|
70
72
|
"snowflakes/myz/card/z-myz-card/index.js",
|
|
71
73
|
"snowflakes/myz/card/z-myz-card-alert/index.js",
|
|
@@ -12,6 +12,8 @@ export class ZSearchbar {
|
|
|
12
12
|
this.items = [];
|
|
13
13
|
this.htmlid = `searchbar-${randomId()}`;
|
|
14
14
|
this.preventSubmit = false;
|
|
15
|
+
this.label = undefined;
|
|
16
|
+
this.htmlAriaLabel = undefined;
|
|
15
17
|
this.value = undefined;
|
|
16
18
|
this.placeholder = undefined;
|
|
17
19
|
this.autocomplete = false;
|
|
@@ -155,7 +157,7 @@ export class ZSearchbar {
|
|
|
155
157
|
}, htmlid: `input-${this.htmlid}`, message: false, placeholder: this.placeholder, onStopTyping: (e) => this.handleStopTyping(e), onKeyUp: (e) => {
|
|
156
158
|
handleEnterKeydSubmit(e, () => this.handleSubmit());
|
|
157
159
|
this.handleArrowsNavigation(e);
|
|
158
|
-
}, value: this.searchString || ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.label),
|
|
160
|
+
}, value: this.searchString || ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.label), size: this.size, label: this.label, "aria-label": this.htmlAriaLabel || this.placeholder }));
|
|
159
161
|
}
|
|
160
162
|
renderButton() {
|
|
161
163
|
if (!this.showSearchButton) {
|
|
@@ -182,7 +184,7 @@ export class ZSearchbar {
|
|
|
182
184
|
if (this.preventSubmit && !((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
183
185
|
return (h("span", { class: "item item-no-results" }, "Non abbiamo trovato risultati per ", h("b", null, this.searchString), h("br", null), h("br", null), "Cosa puoi fare?", h("ul", null, h("li", null, "Verificare di aver scritto bene"), h("li", null, "Provare a cercare un'altra parola"), h("li", null, "Provare a cercare qualcosa di pi\u00F9 generico"))));
|
|
184
186
|
}
|
|
185
|
-
return (h("z-list", { role: "listbox", id: `list-${this.htmlid}
|
|
187
|
+
return (h("z-list", { role: "listbox", id: `list-${this.htmlid}`, "aria-label": this.htmlAriaLabel || this.label }, this.renderSearchHelper(!!((_b = this.resultsItemsList) === null || _b === void 0 ? void 0 : _b.length)), this.renderItems(), this.renderShowAllResults()));
|
|
186
188
|
}
|
|
187
189
|
renderItems() {
|
|
188
190
|
var _a;
|
|
@@ -286,18 +288,18 @@ export class ZSearchbar {
|
|
|
286
288
|
return (h("z-list-element", { role: "option", tabindex: 0, clickable: true, id: `list-item-${this.htmlid}-show-all`, onClickItem: () => (this.currResultsCount = 0), color: "color-primary01" }, h("div", { class: "item-show-all" }, "Vedi tutti i risultati")));
|
|
287
289
|
}
|
|
288
290
|
render() {
|
|
289
|
-
return (h(Host, { key: '
|
|
291
|
+
return (h(Host, { key: '80709d742a085bb3045a2a8795e5e77ce8aa9e3e', onFocus: () => (this.showResults = true), onClick: (e) => this.handleOutsideClick(e), class: { "has-submit": this.showSearchButton, "has-results": this.autocomplete } }, h("div", { key: 'fb03a352402836b09da8b315e84a37c8bee98583', class: "input-container" }, this.renderInput(), this.renderResults()), this.renderButton()));
|
|
290
292
|
}
|
|
291
293
|
static get is() { return "z-searchbar"; }
|
|
292
294
|
static get encapsulation() { return "shadow"; }
|
|
293
295
|
static get originalStyleUrls() {
|
|
294
296
|
return {
|
|
295
|
-
"$": ["styles.css"]
|
|
297
|
+
"$": ["styles.css", "../css-components/z-label/styles.css"]
|
|
296
298
|
};
|
|
297
299
|
}
|
|
298
300
|
static get styleUrls() {
|
|
299
301
|
return {
|
|
300
|
-
"$": ["styles.css"]
|
|
302
|
+
"$": ["styles.css", "../css-components/z-label/styles.css"]
|
|
301
303
|
};
|
|
302
304
|
}
|
|
303
305
|
static get properties() {
|
|
@@ -338,6 +340,40 @@ export class ZSearchbar {
|
|
|
338
340
|
"reflect": false,
|
|
339
341
|
"defaultValue": "false"
|
|
340
342
|
},
|
|
343
|
+
"label": {
|
|
344
|
+
"type": "string",
|
|
345
|
+
"mutable": false,
|
|
346
|
+
"complexType": {
|
|
347
|
+
"original": "string",
|
|
348
|
+
"resolved": "string",
|
|
349
|
+
"references": {}
|
|
350
|
+
},
|
|
351
|
+
"required": false,
|
|
352
|
+
"optional": true,
|
|
353
|
+
"docs": {
|
|
354
|
+
"tags": [],
|
|
355
|
+
"text": "the input label"
|
|
356
|
+
},
|
|
357
|
+
"attribute": "label",
|
|
358
|
+
"reflect": false
|
|
359
|
+
},
|
|
360
|
+
"htmlAriaLabel": {
|
|
361
|
+
"type": "string",
|
|
362
|
+
"mutable": false,
|
|
363
|
+
"complexType": {
|
|
364
|
+
"original": "string",
|
|
365
|
+
"resolved": "string",
|
|
366
|
+
"references": {}
|
|
367
|
+
},
|
|
368
|
+
"required": false,
|
|
369
|
+
"optional": true,
|
|
370
|
+
"docs": {
|
|
371
|
+
"tags": [],
|
|
372
|
+
"text": "the input aria-label"
|
|
373
|
+
},
|
|
374
|
+
"attribute": "html-aria-label",
|
|
375
|
+
"reflect": false
|
|
376
|
+
},
|
|
341
377
|
"value": {
|
|
342
378
|
"type": "string",
|
|
343
379
|
"mutable": false,
|