@zanichelli/albe-web-components 7.1.0 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2337 -0
- package/dist/cjs/index-e3299e0a.js +6 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-app-header.cjs.entry.js +133 -0
- package/dist/cjs/z-button_3.cjs.entry.js +108 -0
- package/dist/cjs/z-list_3.cjs.entry.js +1 -1
- package/dist/cjs/z-menu-section.cjs.entry.js +3 -11
- package/dist/cjs/z-menu.cjs.entry.js +14 -26
- package/dist/cjs/z-searchbar.cjs.entry.js +3 -12
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/inputs/z-searchbar/index.js +3 -76
- package/dist/collection/components/inputs/z-searchbar/styles.css +0 -23
- package/dist/collection/components/list/z-list-element/index.js +1 -1
- package/dist/collection/components/navigation/z-app-header/index.js +15 -14
- package/dist/collection/components/navigation/z-app-header/styles.css +3 -2
- package/dist/collection/components/navigation/z-menu/index.js +21 -45
- package/dist/collection/components/navigation/z-menu/styles.css +13 -80
- package/dist/collection/components/navigation/z-menu-section/index.js +4 -13
- package/dist/collection/components/navigation/z-menu-section/styles.css +4 -37
- package/dist/collection/components/z-offcanvas/index.js +31 -31
- package/dist/collection/components/z-offcanvas/styles.css +78 -87
- package/dist/esm/index-a2ca4b97.js +6 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-app-header.entry.js +129 -0
- package/dist/esm/z-button_3.entry.js +102 -0
- package/dist/esm/z-list_3.entry.js +1 -1
- package/dist/esm/z-menu-section.entry.js +3 -11
- package/dist/esm/z-menu.entry.js +14 -26
- package/dist/esm/z-searchbar.entry.js +4 -13
- package/dist/types/components/inputs/z-searchbar/index.d.ts +1 -7
- package/dist/types/components/navigation/z-app-header/index.d.ts +4 -2
- package/dist/types/components/navigation/z-menu/index.d.ts +5 -13
- package/dist/types/components/navigation/z-menu-section/index.d.ts +3 -9
- package/dist/types/components/z-offcanvas/index.d.ts +4 -4
- package/dist/types/components.d.ts +14 -34
- package/dist/web-components-library/p-029e4fba.entry.js +1 -0
- package/dist/web-components-library/p-14a6abe4.entry.js +1 -0
- package/dist/web-components-library/p-73d9489b.entry.js +1 -0
- package/dist/web-components-library/p-f158d205.entry.js +1 -0
- package/dist/web-components-library/p-f95cc914.entry.js +1 -0
- package/dist/web-components-library/p-fa4c203a.entry.js +1 -0
- package/dist/web-components-library/web-components-library.css +1 -1
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/package.json +2 -2
- package/src-react/index.ts +1 -0
- package/www/build/p-029e4fba.entry.js +1 -0
- package/www/build/p-14a6abe4.entry.js +1 -0
- package/www/build/p-275801c6.css +1 -0
- package/www/build/p-73d9489b.entry.js +1 -0
- package/www/build/p-811ee64f.js +1 -0
- package/www/build/p-f158d205.entry.js +1 -0
- package/www/build/p-f95cc914.entry.js +1 -0
- package/www/build/p-fa4c203a.entry.js +1 -0
- package/www/build/web-components-library.css +1 -1
- package/www/build/web-components-library.esm.js +1 -1
- package/www/index.html +37 -1
- package/dist/cjs/z-app-header_2.cjs.entry.js +0 -152
- package/dist/cjs/z-button.cjs.entry.js +0 -43
- package/dist/cjs/z-offcanvas.cjs.entry.js +0 -70
- package/dist/esm/z-app-header_2.entry.js +0 -147
- package/dist/esm/z-button.entry.js +0 -39
- package/dist/esm/z-offcanvas.entry.js +0 -66
- package/dist/web-components-library/p-1570917d.entry.js +0 -1
- package/dist/web-components-library/p-157aea3b.entry.js +0 -1
- package/dist/web-components-library/p-1c8e7c24.entry.js +0 -1
- package/dist/web-components-library/p-8d134dc4.entry.js +0 -1
- package/dist/web-components-library/p-af283478.entry.js +0 -1
- package/dist/web-components-library/p-d0760bb1.entry.js +0 -1
- package/dist/web-components-library/p-deda8776.entry.js +0 -1
- package/www/build/p-1570917d.entry.js +0 -1
- package/www/build/p-157aea3b.entry.js +0 -1
- package/www/build/p-1c8e7c24.entry.js +0 -1
- package/www/build/p-6b4d4172.js +0 -1
- package/www/build/p-8d134dc4.entry.js +0 -1
- package/www/build/p-ab4e13f7.css +0 -1
- package/www/build/p-af283478.entry.js +0 -1
- package/www/build/p-d0760bb1.entry.js +0 -1
- package/www/build/p-deda8776.entry.js +0 -1
package/dist/esm/z-menu.entry.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a2ca4b97.js';
|
|
2
2
|
|
|
3
|
-
const stylesCss = ":host,::slotted(*),*{box-sizing:border-box}:host{position:relative;display:inline-flex;flex-direction:column}::slotted(a){text-decoration:none}::slotted(*){
|
|
3
|
+
const stylesCss = ":host,::slotted(*),*{box-sizing:border-box}:host{position:relative;display:inline-flex;flex-direction:column}::slotted(a){color:var(--color-text01);text-decoration:none}::slotted(*){font-family:var(--font-family-sans);font-weight:var(--font-rg)}.menu-label{padding:0;border:0;margin:0;background:transparent;border-radius:0;color:inherit;outline:none;text-align:left}button.menu-label{cursor:pointer}.menu-label:focus-within{z-index:1;padding-right:calc(var(--space-unit) * 0.5);padding-left:calc(var(--space-unit) * 0.5);margin-right:calc(var(--space-unit) * -0.5);margin-left:calc(var(--space-unit) * -0.5);box-shadow:var(--shadow-focus-primary)}.menu-label .menu-label-content{display:flex;align-items:center;padding:var(--space-unit) 0;border-bottom:var(--border-size-large) solid var(--color-surface05)}:host([active]) .menu-label-content,:host([open]) .menu-label-content,.menu-label:hover .menu-label-content,.menu-label:focus-within .menu-label-content{border-color:var(--color-secondary01)}.menu-label ::slotted(*){width:100%;margin:0;appearance:none;font-size:var(--font-size-5);line-height:1.2;outline:none}.menu-label z-icon{margin-left:calc(var(--space-unit) * 4);fill:currentcolor}.content{background:var(--color-surface01)}.content[hidden]{display:none}:host([floating]) .content{position:absolute;top:100%;left:0;width:375px;min-width:100%;max-width:100vw;padding:var(--space-unit) var(--space-unit) 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\"]){display:inline-flex;width:100%;margin:0;font-size:var(--font-size-3);line-height:1.25;outline:none}.items>::slotted([slot=\"item\"]:focus:focus-visible){box-shadow:var(--shadow-focus-primary)}.items>::slotted([slot=\"item\"]:not(z-menu-section)){padding:calc(var(--space-unit) * 2) calc(var(--space-unit) * 0.5);border-bottom:var(--border-size-small) solid var(--color-surface05)}.items>::slotted([slot=\"item\"]:hover),.items>::slotted([slot=\"item\"]:active){border-color:var(--color-secondary01)}";
|
|
4
4
|
|
|
5
5
|
const ZMenu = class {
|
|
6
6
|
constructor(hostRef) {
|
|
@@ -11,18 +11,16 @@ const ZMenu = class {
|
|
|
11
11
|
* Flag to set the display mode of the list.
|
|
12
12
|
* If true, the list will be absolutely positioned under the menu label,
|
|
13
13
|
* stacked beneath it otherwise.
|
|
14
|
+
* @default false
|
|
14
15
|
*/
|
|
15
16
|
this.floating = false;
|
|
16
|
-
/** The opening state of the menu. */
|
|
17
|
-
this.open = false;
|
|
18
17
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* The opening state of the menu.
|
|
19
|
+
* @default false
|
|
21
20
|
*/
|
|
22
|
-
this.
|
|
21
|
+
this.open = false;
|
|
23
22
|
this.toggle = this.toggle.bind(this);
|
|
24
23
|
this.checkContent = this.checkContent.bind(this);
|
|
25
|
-
this.onLabelSlotChange = this.onLabelSlotChange.bind(this);
|
|
26
24
|
this.onItemsChange = this.onItemsChange.bind(this);
|
|
27
25
|
}
|
|
28
26
|
toggle() {
|
|
@@ -52,14 +50,6 @@ const ZMenu = class {
|
|
|
52
50
|
componentWillLoad() {
|
|
53
51
|
this.checkContent();
|
|
54
52
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Sets slotted item text as `data-text` attribute value, to let CSS use it through `attr()`.
|
|
57
|
-
* @param ev Slotchange event
|
|
58
|
-
*/
|
|
59
|
-
onLabelSlotChange(ev) {
|
|
60
|
-
const labelElement = ev.target.assignedElements()[0];
|
|
61
|
-
labelElement.dataset.text = labelElement === null || labelElement === void 0 ? void 0 : labelElement.textContent;
|
|
62
|
-
}
|
|
63
53
|
/**
|
|
64
54
|
* Correctly set position of the floating menu in order to prevent overflow.
|
|
65
55
|
* @param live Should run the method on every refresh frame.
|
|
@@ -81,29 +71,27 @@ const ZMenu = class {
|
|
|
81
71
|
* Check if some content slot is set.
|
|
82
72
|
*/
|
|
83
73
|
checkContent() {
|
|
84
|
-
this.hasHeader = !!this.hostElement.querySelectorAll(
|
|
85
|
-
this.hasContent = !!this.hostElement.querySelectorAll(
|
|
74
|
+
this.hasHeader = !!this.hostElement.querySelectorAll('[slot="header"]').length;
|
|
75
|
+
this.hasContent = !!this.hostElement.querySelectorAll('[slot="item"]').length || this.hasHeader;
|
|
86
76
|
}
|
|
87
77
|
/**
|
|
88
78
|
* Set `menuitem` role to all menu items.
|
|
89
|
-
* Set the item's inner text to the `data-text` attribute (this is for using bold text avoiding layout shifts).
|
|
90
79
|
*/
|
|
91
80
|
onItemsChange() {
|
|
92
81
|
this.checkContent();
|
|
93
|
-
const items = this.hostElement.querySelectorAll(
|
|
94
|
-
items.forEach((item) =>
|
|
95
|
-
item.setAttribute("role", "menuitem");
|
|
96
|
-
item.dataset.text = item.textContent;
|
|
97
|
-
});
|
|
82
|
+
const items = this.hostElement.querySelectorAll('[slot="item"]');
|
|
83
|
+
items === null || items === void 0 ? void 0 : items.forEach((item) => item.setAttribute("role", "menuitem"));
|
|
98
84
|
}
|
|
99
85
|
renderMenuLabel() {
|
|
100
86
|
if (this.hasContent) {
|
|
101
|
-
return (h("button", { class: "menu-label", "aria-expanded": this.open ? "true" : "false", "aria-label": this.open ? "Chiudi menù" : "Apri menù", onClick: this.toggle }, h("div", { class: "menu-label-content" }, h("slot",
|
|
87
|
+
return (h("button", { class: "menu-label", "aria-expanded": this.open ? "true" : "false", "aria-label": this.open ? "Chiudi menù" : "Apri menù", onClick: this.toggle }, h("div", { class: "menu-label-content" }, h("slot", null), h("z-icon", { name: this.open ? "chevron-up" : "chevron-down" }))));
|
|
102
88
|
}
|
|
103
|
-
return (h("div", { class: "menu-label" }, h("div", { class: "menu-label-content" }, h("slot",
|
|
89
|
+
return (h("div", { class: "menu-label" }, h("div", { class: "menu-label-content" }, h("slot", null))));
|
|
104
90
|
}
|
|
105
91
|
render() {
|
|
106
|
-
return (h(Host, null, this.renderMenuLabel(),
|
|
92
|
+
return (h(Host, null, this.renderMenuLabel(), h("div", { class: "content", ref: (el) => {
|
|
93
|
+
this.content = el;
|
|
94
|
+
}, hidden: !this.open }, this.hasHeader && (h("header", { class: "header" }, h("slot", { name: "header", onSlotchange: this.checkContent }))), h("div", { class: "items", role: "menu" }, h("slot", { name: "item", onSlotchange: this.onItemsChange })))));
|
|
107
95
|
}
|
|
108
96
|
get hostElement() { return getElement(this); }
|
|
109
97
|
static get watchers() { return {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-a2ca4b97.js';
|
|
2
|
-
import {
|
|
2
|
+
import { l as ListDividerType, B as ButtonVariant } from './index-e36ec4a4.js';
|
|
3
3
|
import { r as randomId, a as handleEnterKeydSubmit } from './utils-970ac457.js';
|
|
4
4
|
import './breakpoints-c386984e.js';
|
|
5
5
|
|
|
6
|
-
const stylesCss = ":host{position:relative;z-index:5;display:block;width:inherit;height:44px;font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>div{position:absolute;z-index:10;display:grid;width:100%;gap:0 calc(var(--space-unit) * 2);grid-template-columns:auto;grid-template-rows:auto}:host>div.has-submit{grid-template-columns:auto min-content}:host>div.has-results{grid-template-rows:auto auto}:host>div>z-input{width:100%;grid-column:1;grid-row:1}:host>div>z-button{grid-column:2;grid-row:1}:host>div>div.results-wrapper{overflow:auto;padding:calc(var(--space-unit) / 4);padding-bottom:calc(var(--space-unit) / 4);border:var(--border-size-small) solid var(--color-surface03);border-top:none;margin-top:-1px;background:var(--color-surface01);grid-column:1;grid-row:2}:host>div>div.results-wrapper>div.results{overflow:auto;max-height:var(--z-searchbar-results-height, 540px);padding:var(--space-unit) calc(var(--space-unit) * 1.5);padding-bottom:calc(var(--space-unit) / 2);scrollbar-color:var(--color-primary01) transparent}:host>div>div.results-wrapper>div.results::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}:host>div>div.results-wrapper>div.results::-webkit-scrollbar-track{background-color:transparent}:host>div>div.results-wrapper>div.results::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}:host>div>div.results-wrapper>div.results .category-heading{display:block;font-size:var(--font-size-2);font-weight:var(--font-rg);line-height:var(--font-size-3)}:host>div>div.results-wrapper>div.results .category-heading>*{display:block}:host>div>div.results-wrapper>div.results span.category-heading>span.category{color:var(--color-text05);font-style:italic}:host>div>div.results-wrapper>div.results span.category-heading>span.subcategory{margin-top:8px;color:var(--color-text01);text-transform:uppercase}:host>div>div.results-wrapper>div.results z-list-element{display:block}:host>div>div.results-wrapper>div.results z-list-element:focus{box-shadow:var(--shadow-focus-primary)}:host>div>div.results-wrapper>div.results .item{--z-icon-height:12px;--z-icon-width:12px;display:flex;flex-flow:row nowrap;align-content:stretch;align-items:flex-start;justify-content:flex-start;color:var(--color-text01);fill:var(--color-icon02);font-size:var(--font-size-2);line-height:var(--font-size-3)}:host>div>div.results-wrapper>div.results .item.ellipsis>span.item-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host>div>div.results-wrapper>div.results .item>span.item-label>mark,:host>div>div.results-wrapper>div.results .item>span.item-label>*>mark{background:var(--color-primary03)}:host>div>div.results-wrapper>div.results .item.has-category{padding-left:calc(var(--space-unit) * 3)}:host>div>div.results-wrapper>div.results .item>z-icon.item-icon{padding:2px 0;margin-right:calc(var(--space-unit) * 1.5)}:host>div>div.results-wrapper>div.results .item.item-search{--z-icon-height:16px;--z-icon-width:16px}:host>div>div.results-wrapper>div.results .item.item-search>z-icon{margin-right:var(--space-unit)}:host>div>div.results-wrapper>div.results .item-show-all{display:block;text-align:center}:host>div>div.results-wrapper>div.results .item-no-results{display:block;font-size:var(--font-size-2);font-style:italic;line-height:var(--font-size-5)}:host>div>div.results-wrapper>div.results .item-no-results>ul{padding-left:calc(var(--space-unit) * 2);margin:var(--space-unit)}@media (min-width: 768px){:host>div>div.results-wrapper>div.results .category-heading{font-size:var(--font-size-3);line-height:var(--font-size-6)}:host>div>div.results-wrapper>div.results .item{--z-icon-height:12px;--z-icon-width:12px;font-size:var(--font-size-3);line-height:var(--font-size-6)}:host>div>div.results-wrapper>div.results .item.item-search{--z-icon-height:18px;--z-icon-width:18px}:host>div>div.results-wrapper>div.results .item.item-search>z-icon{margin-top:calc(var(--space-unit) / 4)}:host>div>div.results-wrapper>div.results .item.ellipsis>span.item-label{height:24px}:host>div>div.results-wrapper>div.results .item>z-icon.item-icon{padding:6px 0}}@media (min-width: 1152px){:host>div>div.results-wrapper>div.results .item{cursor:pointer}:host>div>div.results-wrapper>div.results .item-no-results{cursor:default;font-size:var(--font-size-3);line-height:var(--font-size-6)}}
|
|
6
|
+
const stylesCss = ":host{position:relative;z-index:5;display:block;width:inherit;height:44px;font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>div{position:absolute;z-index:10;display:grid;width:100%;gap:0 calc(var(--space-unit) * 2);grid-template-columns:auto;grid-template-rows:auto}:host>div.has-submit{grid-template-columns:auto min-content}:host>div.has-results{grid-template-rows:auto auto}:host>div>z-input{width:100%;grid-column:1;grid-row:1}:host>div>z-button{grid-column:2;grid-row:1}:host>div>div.results-wrapper{overflow:auto;padding:calc(var(--space-unit) / 4);padding-bottom:calc(var(--space-unit) / 4);border:var(--border-size-small) solid var(--color-surface03);border-top:none;margin-top:-1px;background:var(--color-surface01);grid-column:1;grid-row:2}:host>div>div.results-wrapper>div.results{overflow:auto;max-height:var(--z-searchbar-results-height, 540px);padding:var(--space-unit) calc(var(--space-unit) * 1.5);padding-bottom:calc(var(--space-unit) / 2);scrollbar-color:var(--color-primary01) transparent}:host>div>div.results-wrapper>div.results::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}:host>div>div.results-wrapper>div.results::-webkit-scrollbar-track{background-color:transparent}:host>div>div.results-wrapper>div.results::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}:host>div>div.results-wrapper>div.results .category-heading{display:block;font-size:var(--font-size-2);font-weight:var(--font-rg);line-height:var(--font-size-3)}:host>div>div.results-wrapper>div.results .category-heading>*{display:block}:host>div>div.results-wrapper>div.results span.category-heading>span.category{color:var(--color-text05);font-style:italic}:host>div>div.results-wrapper>div.results span.category-heading>span.subcategory{margin-top:8px;color:var(--color-text01);text-transform:uppercase}:host>div>div.results-wrapper>div.results z-list-element{display:block}:host>div>div.results-wrapper>div.results z-list-element:focus{box-shadow:var(--shadow-focus-primary)}:host>div>div.results-wrapper>div.results .item{--z-icon-height:12px;--z-icon-width:12px;display:flex;flex-flow:row nowrap;align-content:stretch;align-items:flex-start;justify-content:flex-start;color:var(--color-text01);fill:var(--color-icon02);font-size:var(--font-size-2);line-height:var(--font-size-3)}:host>div>div.results-wrapper>div.results .item.ellipsis>span.item-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host>div>div.results-wrapper>div.results .item>span.item-label>mark,:host>div>div.results-wrapper>div.results .item>span.item-label>*>mark{background:var(--color-primary03)}:host>div>div.results-wrapper>div.results .item.has-category{padding-left:calc(var(--space-unit) * 3)}:host>div>div.results-wrapper>div.results .item>z-icon.item-icon{padding:2px 0;margin-right:calc(var(--space-unit) * 1.5)}:host>div>div.results-wrapper>div.results .item.item-search{--z-icon-height:16px;--z-icon-width:16px}:host>div>div.results-wrapper>div.results .item.item-search>z-icon{margin-right:var(--space-unit)}:host>div>div.results-wrapper>div.results .item-show-all{display:block;text-align:center}:host>div>div.results-wrapper>div.results .item-no-results{display:block;font-size:var(--font-size-2);font-style:italic;line-height:var(--font-size-5)}:host>div>div.results-wrapper>div.results .item-no-results>ul{padding-left:calc(var(--space-unit) * 2);margin:var(--space-unit)}@media (min-width: 768px){:host>div>div.results-wrapper>div.results .category-heading{font-size:var(--font-size-3);line-height:var(--font-size-6)}:host>div>div.results-wrapper>div.results .item{--z-icon-height:12px;--z-icon-width:12px;font-size:var(--font-size-3);line-height:var(--font-size-6)}:host>div>div.results-wrapper>div.results .item.item-search{--z-icon-height:18px;--z-icon-width:18px}:host>div>div.results-wrapper>div.results .item.item-search>z-icon{margin-top:calc(var(--space-unit) / 4)}:host>div>div.results-wrapper>div.results .item.ellipsis>span.item-label{height:24px}:host>div>div.results-wrapper>div.results .item>z-icon.item-icon{padding:6px 0}}@media (min-width: 1152px){:host>div>div.results-wrapper>div.results .item{cursor:pointer}:host>div>div.results-wrapper>div.results .item-no-results{cursor:default;font-size:var(--font-size-3);line-height:var(--font-size-6)}}";
|
|
7
7
|
|
|
8
8
|
const ZSearchbar = class {
|
|
9
9
|
constructor(hostRef) {
|
|
@@ -27,12 +27,6 @@ const ZSearchbar = class {
|
|
|
27
27
|
this.sortResultsItems = false;
|
|
28
28
|
/** Show submit button */
|
|
29
29
|
this.showSearchButton = false;
|
|
30
|
-
/** Set button icon without label*/
|
|
31
|
-
this.searchButtonIconOnly = false;
|
|
32
|
-
/** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */
|
|
33
|
-
this.size = ControlSize.BIG;
|
|
34
|
-
/** Graphical variant: `primary`, `secondary`, `tertiary`. Defaults to `primary`. */
|
|
35
|
-
this.variant = ButtonVariant.PRIMARY;
|
|
36
30
|
this.searchString = "";
|
|
37
31
|
this.currResultsCount = 0;
|
|
38
32
|
this.showResults = false;
|
|
@@ -145,16 +139,13 @@ const ZSearchbar = class {
|
|
|
145
139
|
renderInput() {
|
|
146
140
|
return (h("z-input", { ref: (val) => {
|
|
147
141
|
this.inputRef = val;
|
|
148
|
-
}, message: false, placeholder: this.placeholder, onStopTyping: (e) => this.handleStopTyping(e), onKeyUp: (e) => handleEnterKeydSubmit(e, () => this.handleSubmit()), value: this.value
|
|
142
|
+
}, message: false, placeholder: this.placeholder, onStopTyping: (e) => this.handleStopTyping(e), onKeyUp: (e) => handleEnterKeydSubmit(e, () => this.handleSubmit()), value: this.value }));
|
|
149
143
|
}
|
|
150
144
|
renderButton() {
|
|
151
145
|
if (!this.showSearchButton) {
|
|
152
146
|
return null;
|
|
153
147
|
}
|
|
154
|
-
|
|
155
|
-
const buttonLabel = this.searchButtonIconOnly ? "" : "CERCA";
|
|
156
|
-
const defaultProps = Object.assign({ disabled: this.preventSubmit, variant: this.variant, size: this.size, onClick: () => this.handleSubmit() }, iconProp);
|
|
157
|
-
return h("z-button", Object.assign({}, defaultProps), buttonLabel);
|
|
148
|
+
return (h("z-button", { disabled: this.preventSubmit, variant: ButtonVariant.PRIMARY, onClick: () => this.handleSubmit() }, "CERCA"));
|
|
158
149
|
}
|
|
159
150
|
renderResults() {
|
|
160
151
|
if (!this.showResults ||
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from "../../../stencil-public-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { SearchbarItem } from "../../../beans";
|
|
3
3
|
/**
|
|
4
4
|
* @cssprop --z-searchbar-results-height - Max height of the results container (default: 540px)
|
|
5
5
|
*/
|
|
@@ -28,12 +28,6 @@ export declare class ZSearchbar {
|
|
|
28
28
|
sortResultsItems?: boolean;
|
|
29
29
|
/** Show submit button */
|
|
30
30
|
showSearchButton?: boolean;
|
|
31
|
-
/** Set button icon without label*/
|
|
32
|
-
searchButtonIconOnly?: boolean;
|
|
33
|
-
/** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */
|
|
34
|
-
size?: ControlSize;
|
|
35
|
-
/** Graphical variant: `primary`, `secondary`, `tertiary`. Defaults to `primary`. */
|
|
36
|
-
variant?: ButtonVariant;
|
|
37
31
|
searchString: string;
|
|
38
32
|
currResultsCount: number;
|
|
39
33
|
showResults: boolean;
|
|
@@ -73,6 +73,8 @@ export declare class ZAppHeader {
|
|
|
73
73
|
* - auto: the menu bar is positioned near the title
|
|
74
74
|
* - stack: the menu bar is positioned below the title
|
|
75
75
|
* - offcanvas: the menu bar is not displayed and a burger icon appears to open the offcanvas menu
|
|
76
|
+
*
|
|
77
|
+
* **Optional**
|
|
76
78
|
*/
|
|
77
79
|
flow: "auto" | "stack" | "offcanvas";
|
|
78
80
|
/**
|
|
@@ -95,8 +97,6 @@ export declare class ZAppHeader {
|
|
|
95
97
|
private container?;
|
|
96
98
|
private menuElements?;
|
|
97
99
|
private observer?;
|
|
98
|
-
private openDrawer;
|
|
99
|
-
private closeDrawer;
|
|
100
100
|
constructor();
|
|
101
101
|
componentDidLoad(): void;
|
|
102
102
|
private get title();
|
|
@@ -108,4 +108,6 @@ export declare class ZAppHeader {
|
|
|
108
108
|
onStuck(): void;
|
|
109
109
|
setMenuFloatingMode(): void;
|
|
110
110
|
render(): HTMLZAppHeaderElement;
|
|
111
|
+
private openDrawer;
|
|
112
|
+
private closeDrawer;
|
|
111
113
|
}
|
|
@@ -5,26 +5,24 @@ import { EventEmitter } from "../../../stencil-public-runtime";
|
|
|
5
5
|
* @slot item - Single entry of the section. Can be slotted multiple times to insert items onto the menu. Use `z-menu-section` for submenus.
|
|
6
6
|
*/
|
|
7
7
|
export declare class ZMenu {
|
|
8
|
-
hostElement: HTMLZMenuElement;
|
|
9
8
|
/** Flag to set the active status of the menu. */
|
|
10
9
|
active?: boolean;
|
|
11
10
|
/**
|
|
12
11
|
* Flag to set the display mode of the list.
|
|
13
12
|
* If true, the list will be absolutely positioned under the menu label,
|
|
14
13
|
* stacked beneath it otherwise.
|
|
14
|
+
* @default false
|
|
15
15
|
*/
|
|
16
16
|
floating?: boolean;
|
|
17
|
-
/** The opening state of the menu. */
|
|
18
|
-
open: boolean;
|
|
19
17
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* The opening state of the menu.
|
|
19
|
+
* @default false
|
|
22
20
|
*/
|
|
23
|
-
|
|
21
|
+
open: boolean;
|
|
24
22
|
hasHeader: boolean;
|
|
25
23
|
hasContent: boolean;
|
|
24
|
+
hostElement: HTMLZMenuElement;
|
|
26
25
|
private content;
|
|
27
|
-
/** Animation frame request id. */
|
|
28
26
|
private raf;
|
|
29
27
|
/** The menu has been opened. */
|
|
30
28
|
opened: EventEmitter;
|
|
@@ -36,11 +34,6 @@ export declare class ZMenu {
|
|
|
36
34
|
onOpenChanged(): void;
|
|
37
35
|
constructor();
|
|
38
36
|
componentWillLoad(): void;
|
|
39
|
-
/**
|
|
40
|
-
* Sets slotted item text as `data-text` attribute value, to let CSS use it through `attr()`.
|
|
41
|
-
* @param ev Slotchange event
|
|
42
|
-
*/
|
|
43
|
-
private onLabelSlotChange;
|
|
44
37
|
/**
|
|
45
38
|
* Correctly set position of the floating menu in order to prevent overflow.
|
|
46
39
|
* @param live Should run the method on every refresh frame.
|
|
@@ -52,7 +45,6 @@ export declare class ZMenu {
|
|
|
52
45
|
private checkContent;
|
|
53
46
|
/**
|
|
54
47
|
* Set `menuitem` role to all menu items.
|
|
55
|
-
* Set the item's inner text to the `data-text` attribute (this is for using bold text avoiding layout shifts).
|
|
56
48
|
*/
|
|
57
49
|
private onItemsChange;
|
|
58
50
|
private renderMenuLabel;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { EventEmitter } from "../../../stencil-public-runtime";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* @slot -
|
|
5
|
-
* @slot item - Single entry of the section. Set the same slot name to different items to put many of them. Add the `active` attribute to a slotted item to highlight it.
|
|
3
|
+
* @slot - Menu section label
|
|
4
|
+
* @slot item - Single entry of the section. Can be slotted multiple times to insert items.
|
|
6
5
|
*/
|
|
7
6
|
export declare class ZMenuSection {
|
|
8
|
-
hostElement: HTMLZMenuSectionElement;
|
|
9
7
|
/** Active state */
|
|
10
8
|
active?: boolean;
|
|
11
9
|
open: boolean;
|
|
12
10
|
hasContent: boolean;
|
|
11
|
+
hostElement: HTMLZMenuSectionElement;
|
|
13
12
|
/** The section has been opened. */
|
|
14
13
|
opened: EventEmitter;
|
|
15
14
|
/** The section has been closed. */
|
|
@@ -21,11 +20,6 @@ export declare class ZMenuSection {
|
|
|
21
20
|
* Check if some content slot is set.
|
|
22
21
|
*/
|
|
23
22
|
private checkContent;
|
|
24
|
-
/**
|
|
25
|
-
* Sets slotted item text as `data-text` attribute value, to let CSS use it through `attr()`.
|
|
26
|
-
* @param ev Slotchange event
|
|
27
|
-
*/
|
|
28
|
-
private onLabelSlotChange;
|
|
29
23
|
componentWillLoad(): void;
|
|
30
24
|
render(): HTMLZMenuSectionElement;
|
|
31
25
|
}
|
|
@@ -15,12 +15,12 @@ export declare class ZOffcanvas {
|
|
|
15
15
|
open: boolean;
|
|
16
16
|
/** open content transitioning in a specified direction left | right. Default: left */
|
|
17
17
|
transitiondirection?: TransitionDirection;
|
|
18
|
+
/** allows you to skip the entry animation on page load, to be used with the open prop at true */
|
|
19
|
+
skipanimationonload: boolean;
|
|
18
20
|
/** emitted when open prop changes */
|
|
19
21
|
canvasOpenStatusChanged: EventEmitter;
|
|
20
|
-
componentWillLoad(): void;
|
|
21
22
|
onOpenChanged(): void;
|
|
22
|
-
private
|
|
23
|
-
private
|
|
24
|
-
private handleAnimationStart;
|
|
23
|
+
private handleOverflowProperty;
|
|
24
|
+
private handledTransitionEnd;
|
|
25
25
|
render(): HTMLZOffcanvasElement;
|
|
26
26
|
}
|
|
@@ -28,7 +28,7 @@ export namespace Components {
|
|
|
28
28
|
*/
|
|
29
29
|
"drawerOpen": boolean;
|
|
30
30
|
/**
|
|
31
|
-
* Control menu bar position in the header. - auto: the menu bar is positioned near the title - stack: the menu bar is positioned below the title - offcanvas: the menu bar is not displayed and a burger icon appears to open the offcanvas menu
|
|
31
|
+
* Control menu bar position in the header. - auto: the menu bar is positioned near the title - stack: the menu bar is positioned below the title - offcanvas: the menu bar is not displayed and a burger icon appears to open the offcanvas menu **Optional**
|
|
32
32
|
*/
|
|
33
33
|
"flow": "auto" | "stack" | "offcanvas";
|
|
34
34
|
/**
|
|
@@ -743,16 +743,14 @@ export namespace Components {
|
|
|
743
743
|
"active"?: boolean;
|
|
744
744
|
/**
|
|
745
745
|
* Flag to set the display mode of the list. If true, the list will be absolutely positioned under the menu label, stacked beneath it otherwise.
|
|
746
|
+
* @default false
|
|
746
747
|
*/
|
|
747
748
|
"floating"?: boolean;
|
|
748
749
|
/**
|
|
749
750
|
* The opening state of the menu.
|
|
751
|
+
* @default false
|
|
750
752
|
*/
|
|
751
753
|
"open": boolean;
|
|
752
|
-
/**
|
|
753
|
-
* Tells the component that it's placed in a vertical context with other `ZMenu`s (e.g. in the ZAppHeader's offcanvas). A small border is placed under it as a separator from other elements.
|
|
754
|
-
*/
|
|
755
|
-
"verticalContext": boolean;
|
|
756
754
|
}
|
|
757
755
|
interface ZMenuSection {
|
|
758
756
|
/**
|
|
@@ -1112,6 +1110,10 @@ export namespace Components {
|
|
|
1112
1110
|
* open component. Default: false
|
|
1113
1111
|
*/
|
|
1114
1112
|
"open": boolean;
|
|
1113
|
+
/**
|
|
1114
|
+
* allows you to skip the entry animation on page load, to be used with the open prop at true
|
|
1115
|
+
*/
|
|
1116
|
+
"skipanimationonload": boolean;
|
|
1115
1117
|
/**
|
|
1116
1118
|
* open content transitioning in a specified direction left | right. Default: left
|
|
1117
1119
|
*/
|
|
@@ -1332,10 +1334,6 @@ export namespace Components {
|
|
|
1332
1334
|
* Autocomplete results items
|
|
1333
1335
|
*/
|
|
1334
1336
|
"resultsItems"?: SearchbarItem[] | string;
|
|
1335
|
-
/**
|
|
1336
|
-
* Set button icon without label
|
|
1337
|
-
*/
|
|
1338
|
-
"searchButtonIconOnly"?: boolean;
|
|
1339
1337
|
/**
|
|
1340
1338
|
* Search helper text
|
|
1341
1339
|
*/
|
|
@@ -1344,10 +1342,6 @@ export namespace Components {
|
|
|
1344
1342
|
* Show submit button
|
|
1345
1343
|
*/
|
|
1346
1344
|
"showSearchButton"?: boolean;
|
|
1347
|
-
/**
|
|
1348
|
-
* Available sizes: `big`, `small` and `x-small`. Defaults to `big`.
|
|
1349
|
-
*/
|
|
1350
|
-
"size"?: ControlSize;
|
|
1351
1345
|
/**
|
|
1352
1346
|
* Sort autocomplete results items
|
|
1353
1347
|
*/
|
|
@@ -1356,10 +1350,6 @@ export namespace Components {
|
|
|
1356
1350
|
* Input search string
|
|
1357
1351
|
*/
|
|
1358
1352
|
"value"?: string;
|
|
1359
|
-
/**
|
|
1360
|
-
* Graphical variant: `primary`, `secondary`, `tertiary`. Defaults to `primary`.
|
|
1361
|
-
*/
|
|
1362
|
-
"variant"?: ButtonVariant;
|
|
1363
1353
|
}
|
|
1364
1354
|
interface ZSectionTitle {
|
|
1365
1355
|
/**
|
|
@@ -2537,7 +2527,7 @@ declare namespace LocalJSX {
|
|
|
2537
2527
|
*/
|
|
2538
2528
|
"drawerOpen"?: boolean;
|
|
2539
2529
|
/**
|
|
2540
|
-
* Control menu bar position in the header. - auto: the menu bar is positioned near the title - stack: the menu bar is positioned below the title - offcanvas: the menu bar is not displayed and a burger icon appears to open the offcanvas menu
|
|
2530
|
+
* Control menu bar position in the header. - auto: the menu bar is positioned near the title - stack: the menu bar is positioned below the title - offcanvas: the menu bar is not displayed and a burger icon appears to open the offcanvas menu **Optional**
|
|
2541
2531
|
*/
|
|
2542
2532
|
"flow"?: "auto" | "stack" | "offcanvas";
|
|
2543
2533
|
/**
|
|
@@ -3320,6 +3310,7 @@ declare namespace LocalJSX {
|
|
|
3320
3310
|
"active"?: boolean;
|
|
3321
3311
|
/**
|
|
3322
3312
|
* Flag to set the display mode of the list. If true, the list will be absolutely positioned under the menu label, stacked beneath it otherwise.
|
|
3313
|
+
* @default false
|
|
3323
3314
|
*/
|
|
3324
3315
|
"floating"?: boolean;
|
|
3325
3316
|
/**
|
|
@@ -3332,12 +3323,9 @@ declare namespace LocalJSX {
|
|
|
3332
3323
|
"onOpened"?: (event: ZMenuCustomEvent<any>) => void;
|
|
3333
3324
|
/**
|
|
3334
3325
|
* The opening state of the menu.
|
|
3326
|
+
* @default false
|
|
3335
3327
|
*/
|
|
3336
3328
|
"open"?: boolean;
|
|
3337
|
-
/**
|
|
3338
|
-
* Tells the component that it's placed in a vertical context with other `ZMenu`s (e.g. in the ZAppHeader's offcanvas). A small border is placed under it as a separator from other elements.
|
|
3339
|
-
*/
|
|
3340
|
-
"verticalContext"?: boolean;
|
|
3341
3329
|
}
|
|
3342
3330
|
interface ZMenuSection {
|
|
3343
3331
|
/**
|
|
@@ -3749,6 +3737,10 @@ declare namespace LocalJSX {
|
|
|
3749
3737
|
* open component. Default: false
|
|
3750
3738
|
*/
|
|
3751
3739
|
"open"?: boolean;
|
|
3740
|
+
/**
|
|
3741
|
+
* allows you to skip the entry animation on page load, to be used with the open prop at true
|
|
3742
|
+
*/
|
|
3743
|
+
"skipanimationonload"?: boolean;
|
|
3752
3744
|
/**
|
|
3753
3745
|
* open content transitioning in a specified direction left | right. Default: left
|
|
3754
3746
|
*/
|
|
@@ -4005,10 +3997,6 @@ declare namespace LocalJSX {
|
|
|
4005
3997
|
* Autocomplete results items
|
|
4006
3998
|
*/
|
|
4007
3999
|
"resultsItems"?: SearchbarItem[] | string;
|
|
4008
|
-
/**
|
|
4009
|
-
* Set button icon without label
|
|
4010
|
-
*/
|
|
4011
|
-
"searchButtonIconOnly"?: boolean;
|
|
4012
4000
|
/**
|
|
4013
4001
|
* Search helper text
|
|
4014
4002
|
*/
|
|
@@ -4017,10 +4005,6 @@ declare namespace LocalJSX {
|
|
|
4017
4005
|
* Show submit button
|
|
4018
4006
|
*/
|
|
4019
4007
|
"showSearchButton"?: boolean;
|
|
4020
|
-
/**
|
|
4021
|
-
* Available sizes: `big`, `small` and `x-small`. Defaults to `big`.
|
|
4022
|
-
*/
|
|
4023
|
-
"size"?: ControlSize;
|
|
4024
4008
|
/**
|
|
4025
4009
|
* Sort autocomplete results items
|
|
4026
4010
|
*/
|
|
@@ -4029,10 +4013,6 @@ declare namespace LocalJSX {
|
|
|
4029
4013
|
* Input search string
|
|
4030
4014
|
*/
|
|
4031
4015
|
"value"?: string;
|
|
4032
|
-
/**
|
|
4033
|
-
* Graphical variant: `primary`, `secondary`, `tertiary`. Defaults to `primary`.
|
|
4034
|
-
*/
|
|
4035
|
-
"variant"?: ButtonVariant;
|
|
4036
4016
|
}
|
|
4037
4017
|
interface ZSectionTitle {
|
|
4038
4018
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as e,H as n,g as i,c as s}from"./p-d17ebc2f.js";import{h as o,m as a,j as l,l as c,D as r,E as h,f as u}from"./p-e1ac5c4e.js";const d=class{constructor(e){t(this,e),this.size=o.MEDIUM,this.listType=a.NONE}setChildrenSizeType(){const t=this.host.children;for(let e=0;e<t.length;e++)t[e].setAttribute("size",this.size),t[e].setAttribute("list-type",this.listType),t[e].setAttribute("list-element-position",(e+1).toString())}componentDidLoad(){this.setChildrenSizeType()}render(){return e(n,{role:"list"},e("slot",null))}get host(){return i(this)}};d.style=":host{display:flex;flex-direction:column;font-family:var(--font-family-sans);font-weight:var(--font-rg)}";const p=class{constructor(e){t(this,e),this.accessibleFocus=s(this,"accessibleFocus",7),this.clickItem=s(this,"clickItem",7),this.alignButton=l.LEFT,this.clickable=!1,this.dividerColor="color-surface03",this.dividerType=c.NONE,this.dividerSize=r.SMALL,this.expandable=!1,this.expandableStyle=h.ACCORDION,this.size=o.MEDIUM,this.color="none",this.disabled=!1,this.isContextualMenu=!1,this.listElementPosition="0",this.listType=a.NONE,this.showInnerContent=!1,this.openElementConfig={accordion:{open:"minus-circled",close:"plus-circled"},menu:{open:"chevron-up",close:"chevron-down"}},this.handleClick=this.handleClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}accessibleFocusHandler(t){this.listElementId===t.detail&&this.host.shadowRoot.getElementById(`z-list-element-id-${t.detail}`).focus()}handleClick(){this.clickItem.emit(this.listElementId),this.expandable&&(this.showInnerContent=!this.showInnerContent)}calculateClass(){return this.isContextualMenu?"container-contextual-menu":"container"}handleKeyDown(t){const e=t.code===u.ENTER;switch(t.code){case u.ARROW_DOWN:t.preventDefault(),this.accessibleFocus.emit(this.listElementId+1);break;case u.ARROW_UP:t.preventDefault(),this.accessibleFocus.emit(this.listElementId-1);break;case u.ENTER:t.preventDefault(),this.clickItem.emit(this.listElementId)}this.expandable&&e&&(this.showInnerContent=!this.showInnerContent)}renderExpandableButton(){return this.expandable?e("z-icon",{name:this.showInnerContent?this.openElementConfig[this.expandableStyle].open:this.openElementConfig[this.expandableStyle].close}):null}renderExpandedContent(){return this.expandable?e("div",{class:{"z-list-element-inner-container":!0,expanded:this.showInnerContent}},e("slot",{name:"inner-content"})):null}renderContent(){return this.listType===a.NONE?e("slot",null):this.listType===a.ORDERED?e("div",{class:"z-list-content-container"},e("div",null,this.listElementPosition,". "),e("slot",null)):this.listType===a.UNORDERED?e("div",{class:"z-list-content-container"},e("span",null,"• "),e("slot",null)):void 0}render(){return e(n,{role:"listitem","aria-expanded":this.expandable?this.showInnerContent:null,onClick:this.handleClick,onKeyDown:this.handleKeyDown,clickable:this.clickable&&!this.disabled,tabIndex:this.isContextualMenu?null:"0"},e("div",{class:`${this.calculateClass()}`,style:{color:`var(--${this.color})`},tabindex:this.isContextualMenu?"0":"-1",id:`z-list-element-id-${this.listElementId}`},e("div",{class:"z-list-element-container"},this.renderExpandableButton(),this.renderContent()),this.renderExpandedContent()),this.dividerType===c.ELEMENT&&e("z-divider",{color:this.dividerColor,size:this.dividerSize}))}get host(){return i(this)}};p.style=':host{outline:none}:host>.container,:host>.container-contextual-menu{--background-color-list-element:var(--bg-white);--background-hover-color-list-element:var(--color-surface02);--background-active-color-list-element:var(--color-surface02);display:flex;box-sizing:border-box;flex-direction:column;justify-content:center;font-family:var(--font-family-sans);font-weight:var(--font-rg);outline:none}:host([size="small"])>.container{min-height:calc(var(--space-unit) * 4);padding:calc(var(--space-unit) / 2) 0}:host([size="medium"])>.container{min-height:calc(var(--space-unit) * 5);padding:var(--space-unit) 0}:host([size="large"])>.container{min-height:calc(var(--space-unit) * 7);padding:calc(var(--space-unit) * 2) 0}:host([size="x-large"])>.container{min-height:calc(var(--space-unit) * 9);padding:calc(var(--space-unit) * 3) 0}:host([expandable])>.container,:host([expandable])>.container-contextual-menu,:host([clickable])>.container,:host([clickable])>.container-contextual-menu{cursor:pointer}:host([expandable]:hover)>.container,:host([expandable]:hover)>.container-contextual-menu,:host([clickable]:hover)>.container,:host([clickable]:hover)>.container-contextual-menu{background-color:var(--background-hover-color-list-element)}:host([expandable]:focus:focus-visible)>.container,:host([expandable]:focus:focus-visible)>.container-contextual-menu,:host([clickable]:focus:focus-visible)>.container,:host([clickable]:focus:focus-visible)>.container-contextual-menu{box-shadow:var(--shadow-focus-primary)}:host([clickable]:not([expandable]))>.container.clicked,:host([clickable]:not([expandable]))>.container-contextual-menu.clicked{box-shadow:var(--shadow-focus-primary)}:host([expandable]:active)>.container,:host([expandable]:active)>.container-contextual-menu,:host([clickable]:active)>.container,:host([clickable]:active)>.container-contextual-menu{background-color:var(--background-active-color-list-element)}:host([align-button="left"][expandable])>.container>.z-list-element-container,:host([align-button="left"][expandable])>.container-contextual-menu>.z-list-element-container{display:flex}:host([align-button="right"][expandable])>.container>.z-list-element-container,:host([align-button="right"][expandable])>.container-contextual-menu>.z-list-element-container{display:flex;flex-direction:row-reverse;justify-content:space-between}:host([align-button="left"][expandable])>.container>.z-list-element-container>z-icon,:host([align-button="left"][expandable])>.container-contextual-menu>.z-list-element-container>z-icon{margin-right:var(--space-unit)}:host([align-button="right"][expandable])>.container>.z-list-element-container>z-icon,:host([align-button="right"][expandable])>.container-contextual-menu>.z-list-element-container>z-icon{margin-left:var(--space-unit)}:host>.container>.z-list-element-inner-container,:host>.container-contextual-menu>.z-list-element-inner-container{display:none}:host>.container>.z-list-element-inner-container.expanded,:host>.container-contextual-menu>.z-list-element-inner-container.expanded{display:block}:host([clickable]:hover)>.container-contextual-menu{background-color:var(--color-surface03)}.container-contextual-menu:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}.z-list-content-container{display:flex;align-items:center}';const m=class{constructor(e){t(this,e),this.size=o.MEDIUM,this.dividerType=c.NONE,this.dividerSize=r.SMALL,this.dividerColor="gray200",this.listType=a.NONE}componentDidLoad(){const t=this.host.children;for(let e=0;e<t.length;e++)t.length-1>e&&(t[e].setAttribute("divider-type",this.dividerType),t[e].setAttribute("divider-size",this.dividerSize),t[e].setAttribute("divider-color",this.dividerColor)),t[e].setAttribute("size",this.size),t[e].setAttribute("list-type",this.listType),t[e].setAttribute("list-element-position",e.toString())}componentWillLoad(){this.hasHeader=!!this.host.querySelector('[slot="header-title"]')}render(){return e(n,{role:"group"},e("div",{class:{"z-list-group-header-container":!0,"has-header":this.hasHeader}},e("slot",{name:"header-title"}),this.dividerType===c.HEADER&&e("z-divider",{color:this.dividerColor,size:this.dividerSize})),e("slot",null))}get host(){return i(this)}};m.style=":host{font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>.z-list-group-header-container{color:var(--gray700);font-size:var(--font-size-2);font-weight:var(--font-sb) !important;letter-spacing:0.16px;line-height:1.4}:host>.z-list-group-header-container.has-header{padding-top:var(--space-unit);padding-bottom:var(--space-unit)}:host>.z-list-group-header-container.has-header>z-divider{margin-top:var(--space-unit)}";export{d as z_list,p as z_list_element,m as z_list_group}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as a,h as o,g as t,H as n,c as r}from"./p-d17ebc2f.js";import{b as i,B as s,d as c,O as e,v as l}from"./p-e1ac5c4e.js";import{I as v}from"./p-bb85c467.js";const h=class{constructor(o){a(this,o),this.ariaLabel="",this.disabled=!1,this.type=i.BUTTON,this.variant=s.PRIMARY,this.size=c.BIG}getAttributes(){return{id:this.htmlid,class:{"z-button--container":!0,"z-button--has-text":!!this.hostElement.textContent.trim()}}}render(){return this.href?o("a",Object.assign({},this.getAttributes(),{"aria-label":this.ariaLabel,href:this.href,target:this.target}),this.icon&&o("z-icon",{name:this.icon,width:16,height:16}),o("slot",null)):o("button",Object.assign({},this.getAttributes(),{"aria-label":this.ariaLabel,name:this.name,type:this.type,disabled:this.disabled}),this.icon&&o("z-icon",{name:this.icon,width:16,height:16}),o("slot",null))}get hostElement(){return t(this)}};h.style='.sc-z-button-h{display:inline-block;--z-icon-width:16px;--z-icon-height:16px;--z-icon-right-margin:0}[disabled].sc-z-button-h:not([disabled="false"]){pointer-events:none}.sc-z-button-h .z-button--container.sc-z-button{display:inline-flex;width:100%;box-sizing:border-box;align-items:center;justify-content:center;padding:0;border-width:var(--border-size-medium);border-style:solid;border-radius:var(--border-radius);cursor:pointer;fill:currentcolor;font-family:var(--font-family-sans);font-size:14px;font-weight:var(--font-sb);letter-spacing:0.3px;line-height:1;outline:none;text-decoration:none;text-transform:uppercase;white-space:nowrap}.sc-z-button-h .z-button--container.sc-z-button:focus:focus-visible{box-shadow:var(--shadow-focus-primary)}.sc-z-button-h .z-button--container.z-button--has-text.sc-z-button{min-width:calc(var(--space-unit) * 8);padding:0 calc(var(--space-unit) * 2)}.sc-z-button-h .z-button--container.z-button--has-text.sc-z-button z-icon.sc-z-button{--z-icon-right-margin:var(--space-unit)}[size="big"].sc-z-button-h .z-button--container.sc-z-button{min-width:44px;height:44px}[size="small"].sc-z-button-h .z-button--container.sc-z-button{min-width:36px;height:36px}[size="x-small"].sc-z-button-h .z-button--container.sc-z-button{min-width:32px;height:32px}[variant="primary"].sc-z-button-h .z-button--container.sc-z-button{border-color:var(--color-primary01);background-color:var(--color-primary01);color:var(--color-text-inverse)}@media (hover: hover){[variant="primary"].sc-z-button-h .z-button--container.sc-z-button:hover{border-color:var(--color-hover-primary);background-color:var(--color-hover-primary);color:var(--color-text-inverse)}}[variant="primary"].sc-z-button-h .z-button--container.sc-z-button:active{border-color:var(--color-pressed-primary);background-color:var(--color-pressed-primary);box-shadow:var(--shadow-2);color:var(--color-text-inverse)}[variant="primary"][disabled].sc-z-button-h:not([disabled="false"]) .z-button--container.sc-z-button{border-color:var(--color-disabled01);background-color:var(--color-disabled01);color:var(--color-disabled02)}[variant="secondary"].sc-z-button-h .z-button--container.sc-z-button{border-color:var(--color-primary01);background-color:var(--color-surface01);color:var(--color-primary01)}@media (hover: hover){[variant="secondary"].sc-z-button-h .z-button--container.sc-z-button:hover{border-color:var(--color-hover-primary);background-color:var(--color-surface01);color:var(--color-hover-primary)}}[variant="secondary"].sc-z-button-h .z-button--container.sc-z-button:active{border-color:var(--color-pressed-primary);background-color:var(--color-surface01);box-shadow:var(--shadow-2);color:var(--color-pressed-primary)}[variant="secondary"][disabled].sc-z-button-h:not([disabled="false"]) .z-button--container.sc-z-button{border-color:var(--color-disabled01);background-color:var(--color-surface01);color:var(--color-disabled02)}[variant="tertiary"].sc-z-button-h .z-button--container.sc-z-button{border-color:transparent;background-color:transparent;color:var(--color-primary01)}@media (hover: hover){[variant="tertiary"].sc-z-button-h .z-button--container.sc-z-button:hover{border-color:var(--color-primary03);background-color:var(--color-primary03);color:var(--color-hover-primary)}}[variant="tertiary"].sc-z-button-h .z-button--container.sc-z-button:focus:focus-visible{border-color:var(--color-surface01);background-color:var(--color-surface01);color:var(--color-primary01)}[variant="tertiary"].sc-z-button-h .z-button--container.sc-z-button:active{border-color:var(--color-surface01);background-color:var(--color-surface01);box-shadow:var(--shadow-2);color:var(--color-primary01)}[variant="tertiary"][disabled].sc-z-button-h:not([disabled="false"]) .z-button--container.sc-z-button{border-color:transparent;background-color:transparent;color:var(--color-disabled02)}';const d=class{constructor(o){a(this,o)}selectPathOrPolygon(a){return(null==a?void 0:a.startsWith("M"))?o("path",{d:v[this.name]}):o("polygon",{points:v[this.name]})}render(){return o(n,{"aria-hidden":"true"},o("svg",{viewBox:"0 0 1000 1000",width:this.width,height:this.height,id:this.iconid,fill:this.fill?`var(--${this.fill})`:""},this.selectPathOrPolygon(v[this.name])))}};d.style=":host{margin-right:var(--z-icon-right-margin, 0);margin-left:var(--z-icon-left-margin, 0);line-height:0;vertical-align:middle}:host svg:not([width]){width:var(--z-icon-width, 18px)}:host svg:not([height]){height:var(--z-icon-height, 18px)}";const f=class{constructor(o){a(this,o),this.canvasOpenStatusChanged=r(this,"canvasOpenStatusChanged",7),this.variant=e.PUSHCONTENT,this.open=!1,this.transitiondirection=l.LEFT,this.skipanimationonload=!1}onOpenChanged(){!this.open&&this.hostElement.hasAttribute("skipanimationonload")&&this.hostElement.removeAttribute("skipanimationonload"),this.open&&this.handleOverflowProperty(),this.canvasOpenStatusChanged.emit(this.open)}handleOverflowProperty(){document.body.style[this.variant===e.OVERLAY?"overflow-y":"overflow-x"]=this.open?"hidden":""}handledTransitionEnd(){this.handleOverflowProperty()}render(){return o(n,null,o("div",{role:"presentation",class:"canvas-container",onTransitionEnd:()=>this.handledTransitionEnd()},o("div",{role:"presentation",class:"canvas-content"},o("slot",{name:"canvasContent"}))),this.variant==e.OVERLAY&&o("div",{class:"canvas-background","data-action":"canvasBackground",onClick:()=>this.open=!1}))}get hostElement(){return t(this)}static get watchers(){return{open:["onOpenChanged"]}}};f.style='.sc-z-offcanvas-h{--z-offcanvas--container-width:375px;--z-offcanvas--top-space:0;min-width:100%;height:100%;font-family:var(--font-family-sans);font-weight:var(--font-rg);visibility:hidden}.canvas-container.sc-z-offcanvas{display:flex;overflow:-moz-scrollbars-none;overflow:hidden;min-width:100%;height:100%;flex-direction:column;background:var(--color-surface01)}[variant="pushcontent"].sc-z-offcanvas-h{display:none}[open].sc-z-offcanvas-h{display:flex;visibility:visible}[variant="overlay"].sc-z-offcanvas-h{position:fixed;z-index:1000;top:var(--z-offcanvas--top-space);right:0;bottom:0;left:0;display:flex;height:calc(100% - var(--z-offcanvas--top-space))}[variant="overlay"][transitiondirection="left"].sc-z-offcanvas-h{justify-content:end}[variant="overlay"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{z-index:1010}[variant="overlay"].sc-z-offcanvas-h .canvas-background.sc-z-offcanvas{position:absolute;left:0;width:100%;height:100%;background-color:var(--gray900);opacity:0.7}.canvas-container.sc-z-offcanvas>.canvas-content.sc-z-offcanvas{overflow:auto;flex:1 auto;padding:0 calc(var(--space-unit) * 2);margin:calc(var(--space-unit) * 2) calc(var(--space-unit) / 2) calc(var(--space-unit) * 2) 0;overflow-x:hidden}[variant="overlay"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas>.canvas-content.sc-z-offcanvas{padding:0 calc(var(--space-unit) * 2) calc(var(--space-unit) * 2) calc(var(--space-unit) * 2);margin:calc(var(--space-unit) * 2) calc(var(--space-unit) / 2) 0 0}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar-track{background-color:transparent}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas{scrollbar-color:var(--color-primary01) transparent}@media only screen and (max-width: 768px){[open][transitiondirection="left"].sc-z-offcanvas-h:not([skipAnimationOnLoad])>.canvas-container.sc-z-offcanvas{animation:enter-right 0.4s ease-out}[open][transitiondirection="right"].sc-z-offcanvas-h:not([skipAnimationOnLoad])>.canvas-container.sc-z-offcanvas{animation:enter-left 0.4s ease-out}}@media only screen and (min-width: 768px){.sc-z-offcanvas-h{min-width:auto}.canvas-container.sc-z-offcanvas{width:auto;min-width:max(var(--z-offcanvas--container-width), 375px);max-width:max(var(--z-offcanvas--container-width), 375px);height:auto;min-height:calc(var(--space-unit) * 40)}.sc-z-offcanvas-h:not([variant="overlay"])[open]:not([skipAnimationOnLoad]){width:auto;animation:grow 0.4s ease-out}}@keyframes grow{from{width:0}to{width:max(var(--z-offcanvas--container-width), 375px)}}@keyframes enter-left{from{transform:translateX(-100%)}to{transform:translateX(0)}}@keyframes enter-right{from{transform:translateX(100%)}to{transform:translateX(0)}}[open][variant="overlay"][transitiondirection="left"].sc-z-offcanvas-h:not([skipAnimationOnLoad])>.canvas-container.sc-z-offcanvas{animation:enter-right 0.4s ease-out}[open][transitiondirection="right"].sc-z-offcanvas-h:not([skipAnimationOnLoad])>.canvas-container.sc-z-offcanvas{animation:enter-left 0.4s ease-out}.sc-z-offcanvas-h:not([open])[variant="overlay"][transitiondirection="right"]>.canvas-container.sc-z-offcanvas{transform:translateX(-100%);transition:visibility 0.4s ease-out, transform 0.4s ease-out}.sc-z-offcanvas-h:not([open])[variant="overlay"][transitiondirection="left"]>.canvas-container.sc-z-offcanvas{transform:translateX(100%);transition:visibility 0.4s ease-out, transform 0.4s ease-out}.sc-z-offcanvas-h:not([open])[variant="overlay"] .canvas-background.sc-z-offcanvas{transition:visibility 0.4s ease-out;visibility:hidden}';export{h as z_button,d as z_icon,f as z_offcanvas}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as s,H as e}from"./p-d17ebc2f.js";import{l as r,B as a}from"./p-e1ac5c4e.js";import{r as l,a as o}from"./p-dfc69cc3.js";import"./p-d69e14fb.js";const n=class{constructor(s){t(this,s),this.searchSubmit=i(this,"searchSubmit",7),this.searchTyping=i(this,"searchTyping",7),this.searchItemClick=i(this,"searchItemClick",7),this.htmlid=`searchbar-${l()}`,this.preventSubmit=!1,this.autocomplete=!1,this.autocompleteMinChars=3,this.resultsEllipsis=!0,this.searchHelperLabel="Cerca {searchString}",this.sortResultsItems=!1,this.showSearchButton=!1,this.searchString="",this.currResultsCount=0,this.showResults=!1,this.resultsItemsList=null}emitSearchSubmit(){this.searchSubmit.emit(this.inputRef.value)}emitSearchTyping(t){this.searchTyping.emit(t)}emitSearchItemClick(t){this.searchItemClick.emit(t)}watchItems(){this.resultsItemsList=this.getResultsItemsList()}watchResultsCount(){this.currResultsCount=this.resultsCount}watchValue(){this.handleInput(this.value)}watchSearchString(){this.emitSearchTyping(this.searchString),this.searchString||(this.currResultsCount=this.resultsCount)}clickListener(t){this.handleOutsideClick(t)}componentWillLoad(){this.resultsItemsList=this.getResultsItemsList(),this.currResultsCount=this.resultsCount,this.handleInput(this.value)}getResultsItemsList(){return"string"==typeof this.resultsItems?JSON.parse(this.resultsItems):this.resultsItems}getGroupedItems(t){const i={};return t.forEach((t=>{var s;const e=`${null==t?void 0:t.category}${null==t?void 0:t.subcategory}`;i[e]=null!==(s=i[e])&&void 0!==s?s:{category:null==t?void 0:t.category,subcategory:null==t?void 0:t.subcategory,items:[]},i[e].items.push(t)})),this.sortResultsItems?Object.keys(i).sort().reduce(((t,s)=>(t[s]=Object.assign(Object.assign({},i[s]),{items:i[s].items.sort(((t,i)=>{const s=t.label.toUpperCase(),e=i.label.toUpperCase();return s<e?-1:s>e?1:0}))}),t)),{}):i}checkResultsCount(t){return!this.currResultsCount||t<this.currResultsCount}handleStopTyping(t){t.stopPropagation(),this.handleInput(t.detail.value)}handleInput(t){(null==t?void 0:t.length)>=this.autocompleteMinChars?this.searchString=t:this.searchString&&(this.searchString="")}handleSubmit(){this.preventSubmit||this.emitSearchSubmit()}handleOutsideClick(t){const i=t.composedPath(),s=i.find((t=>"Z-SEARCHBAR"===t.nodeName));this.showResults=!(!s||s.htmlid!==this.htmlid||!i.find((t=>{var i;return"Z-INPUT"===(null==t?void 0:t.nodeName)||(null===(i=null==t?void 0:t.classList)||void 0===i?void 0:i.contains("results"))})))}renderInput(){return s("z-input",{ref:t=>{this.inputRef=t},message:!1,placeholder:this.placeholder,onStopTyping:t=>this.handleStopTyping(t),onKeyUp:t=>o(t,(()=>this.handleSubmit())),value:this.value})}renderButton(){return this.showSearchButton?s("z-button",{disabled:this.preventSubmit,variant:a.PRIMARY,onClick:()=>this.handleSubmit()},"CERCA"):null}renderResults(){return this.showResults&&this.autocomplete&&this.searchString&&!(this.searchString.length<this.autocompleteMinChars)&&this.resultsItemsList?s("div",{class:"results-wrapper"},s("div",{class:"results"},this.renderResultsList())):null}renderResultsList(){var t,i;return this.preventSubmit&&!(null===(t=this.resultsItemsList)||void 0===t?void 0:t.length)?s("span",{class:"item item-no-results"},"Non abbiamo trovato risultati per ",s("b",null,this.searchString),s("br",null),s("br",null),"Cosa puoi fare?",s("ul",null,s("li",null,"Verificare di aver scritto bene"),s("li",null,"Provare a cercare un'altra parola"),s("li",null,"Provare a cercare qualcosa di più generico"))):s("z-list",{role:"listbox",id:`list-${this.htmlid}`},this.renderSearchHelper(!!(null===(i=this.resultsItemsList)||void 0===i?void 0:i.length)),this.renderItems(),this.renderShowAllResults())}renderItems(){var t;if(!(null===(t=this.resultsItemsList)||void 0===t?void 0:t.length))return[];const i=this.getGroupedItems(this.resultsItemsList),e=[];let a=0;return Object.values(i).forEach(((t,i,l)=>{if(this.checkResultsCount(a)){const o=[];t.items.forEach(((t,s,e)=>{this.checkResultsCount(a)&&o.push(this.renderItem(t,s,!(i===l.length-1&&s===e.length-1))),a++})),o.length&&e.push(s("z-list-group",{"divider-type":r.ELEMENT},this.renderItemCategory(t),o))}})),e}renderItem(t,i,e){return s("z-list-element",{id:`list-item-${this.htmlid}-${i}`,role:"option",tabindex:0,dividerType:e?r.ELEMENT:void 0,clickable:!0,onClickItem:()=>this.emitSearchItemClick(t)},s("span",{class:{item:!0,ellipsis:this.resultsEllipsis,"has-category":!!t.category}},(null==t?void 0:t.icon)&&s("z-icon",{class:"item-icon",name:t.icon}),s("span",{class:"item-label",title:t.label,innerHTML:this.renderItemLabel(t.label)})))}renderItemLabel(t){return this.searchString?t.replace(new RegExp(this.searchString.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gmi"),(t=>`<mark>${t}</mark>`)):t}renderItemCategory(t){return(null==t?void 0:t.category)?s("span",{class:"category-heading",slot:"header-title"},s("span",{class:"category"},t.category),(null==t?void 0:t.subcategory)&&s("span",{class:"subcategory"},t.subcategory)):null}renderSearchHelper(t=!0){return this.autocomplete&&!this.preventSubmit&&this.searchString?s("z-list-element",{role:"option",tabindex:0,dividerType:t?r.ELEMENT:void 0,clickable:!0,id:`list-item-${this.htmlid}-search`,onClickItem:()=>this.emitSearchSubmit()},s("span",{class:"item item-search"},s("z-icon",{class:"search-icon",name:"left-magnifying-glass"}),s("span",{class:"item-label",innerHTML:this.searchHelperLabel.replace("{searchString}",`<mark>${this.searchString}</mark>`)}))):null}renderShowAllResults(){var t,i;return!this.currResultsCount||!this.searchString||!(null===(t=this.resultsItemsList)||void 0===t?void 0:t.length)||this.currResultsCount>=(null===(i=this.resultsItemsList)||void 0===i?void 0:i.length)?null:s("z-list-element",{role:"option",tabindex:0,clickable:!0,id:`list-item-${this.htmlid}-show-all`,onClickItem:()=>this.currResultsCount=0},s("span",{class:"item-show-all"},s("z-link",null,"Vedi tutti i risultati")))}render(){return s(e,{onFocus:()=>this.showResults=!0,onClick:t=>this.handleOutsideClick(t)},s("div",{class:{"has-submit":this.showSearchButton,"has-results":this.autocomplete}},this.renderInput(),this.renderResults(),this.renderButton()))}static get watchers(){return{resultsItems:["watchItems"],resultsCount:["watchResultsCount"],value:["watchValue"],searchString:["watchSearchString"]}}};n.style=":host{position:relative;z-index:5;display:block;width:inherit;height:44px;font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>div{position:absolute;z-index:10;display:grid;width:100%;gap:0 calc(var(--space-unit) * 2);grid-template-columns:auto;grid-template-rows:auto}:host>div.has-submit{grid-template-columns:auto min-content}:host>div.has-results{grid-template-rows:auto auto}:host>div>z-input{width:100%;grid-column:1;grid-row:1}:host>div>z-button{grid-column:2;grid-row:1}:host>div>div.results-wrapper{overflow:auto;padding:calc(var(--space-unit) / 4);padding-bottom:calc(var(--space-unit) / 4);border:var(--border-size-small) solid var(--color-surface03);border-top:none;margin-top:-1px;background:var(--color-surface01);grid-column:1;grid-row:2}:host>div>div.results-wrapper>div.results{overflow:auto;max-height:var(--z-searchbar-results-height, 540px);padding:var(--space-unit) calc(var(--space-unit) * 1.5);padding-bottom:calc(var(--space-unit) / 2);scrollbar-color:var(--color-primary01) transparent}:host>div>div.results-wrapper>div.results::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}:host>div>div.results-wrapper>div.results::-webkit-scrollbar-track{background-color:transparent}:host>div>div.results-wrapper>div.results::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}:host>div>div.results-wrapper>div.results .category-heading{display:block;font-size:var(--font-size-2);font-weight:var(--font-rg);line-height:var(--font-size-3)}:host>div>div.results-wrapper>div.results .category-heading>*{display:block}:host>div>div.results-wrapper>div.results span.category-heading>span.category{color:var(--color-text05);font-style:italic}:host>div>div.results-wrapper>div.results span.category-heading>span.subcategory{margin-top:8px;color:var(--color-text01);text-transform:uppercase}:host>div>div.results-wrapper>div.results z-list-element{display:block}:host>div>div.results-wrapper>div.results z-list-element:focus{box-shadow:var(--shadow-focus-primary)}:host>div>div.results-wrapper>div.results .item{--z-icon-height:12px;--z-icon-width:12px;display:flex;flex-flow:row nowrap;align-content:stretch;align-items:flex-start;justify-content:flex-start;color:var(--color-text01);fill:var(--color-icon02);font-size:var(--font-size-2);line-height:var(--font-size-3)}:host>div>div.results-wrapper>div.results .item.ellipsis>span.item-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host>div>div.results-wrapper>div.results .item>span.item-label>mark,:host>div>div.results-wrapper>div.results .item>span.item-label>*>mark{background:var(--color-primary03)}:host>div>div.results-wrapper>div.results .item.has-category{padding-left:calc(var(--space-unit) * 3)}:host>div>div.results-wrapper>div.results .item>z-icon.item-icon{padding:2px 0;margin-right:calc(var(--space-unit) * 1.5)}:host>div>div.results-wrapper>div.results .item.item-search{--z-icon-height:16px;--z-icon-width:16px}:host>div>div.results-wrapper>div.results .item.item-search>z-icon{margin-right:var(--space-unit)}:host>div>div.results-wrapper>div.results .item-show-all{display:block;text-align:center}:host>div>div.results-wrapper>div.results .item-no-results{display:block;font-size:var(--font-size-2);font-style:italic;line-height:var(--font-size-5)}:host>div>div.results-wrapper>div.results .item-no-results>ul{padding-left:calc(var(--space-unit) * 2);margin:var(--space-unit)}@media (min-width: 768px){:host>div>div.results-wrapper>div.results .category-heading{font-size:var(--font-size-3);line-height:var(--font-size-6)}:host>div>div.results-wrapper>div.results .item{--z-icon-height:12px;--z-icon-width:12px;font-size:var(--font-size-3);line-height:var(--font-size-6)}:host>div>div.results-wrapper>div.results .item.item-search{--z-icon-height:18px;--z-icon-width:18px}:host>div>div.results-wrapper>div.results .item.item-search>z-icon{margin-top:calc(var(--space-unit) / 4)}:host>div>div.results-wrapper>div.results .item.ellipsis>span.item-label{height:24px}:host>div>div.results-wrapper>div.results .item>z-icon.item-icon{padding:6px 0}}@media (min-width: 1152px){:host>div>div.results-wrapper>div.results .item{cursor:pointer}:host>div>div.results-wrapper>div.results .item-no-results{cursor:default;font-size:var(--font-size-3);line-height:var(--font-size-6)}}";export{n as z_searchbar}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,h as i,H as n,g as s}from"./p-d17ebc2f.js";const a=class{constructor(i){t(this,i),this.opened=e(this,"opened",7),this.closed=e(this,"closed",7),this.floating=!1,this.open=!1,this.toggle=this.toggle.bind(this),this.checkContent=this.checkContent.bind(this),this.onItemsChange=this.onItemsChange.bind(this)}toggle(){this.hasContent&&(this.open=!this.open,this.open?this.opened.emit():this.closed.emit())}handleClick(t){this.floating&&this.open&&!this.hostElement.contains(t.target)&&(this.reflow(),this.open=!1,this.closed.emit())}onOpenChanged(){this.open?this.reflow(!0):cancelAnimationFrame(this.raf)}componentWillLoad(){this.checkContent()}reflow(t=!1){if(this.content){const{style:t}=this.content,{left:e}=this.hostElement.getBoundingClientRect(),i=getComputedStyle(this.content).width,n=i?parseFloat(i.replace("px","")):375;t.left=`${Math.min(window.innerWidth-e-n-30,0)}px`}t&&(this.raf=requestAnimationFrame(this.reflow.bind(this,t)))}checkContent(){this.hasHeader=!!this.hostElement.querySelectorAll('[slot="header"]').length,this.hasContent=!!this.hostElement.querySelectorAll('[slot="item"]').length||this.hasHeader}onItemsChange(){this.checkContent();const t=this.hostElement.querySelectorAll('[slot="item"]');null==t||t.forEach((t=>t.setAttribute("role","menuitem")))}renderMenuLabel(){return this.hasContent?i("button",{class:"menu-label","aria-expanded":this.open?"true":"false","aria-label":this.open?"Chiudi menù":"Apri menù",onClick:this.toggle},i("div",{class:"menu-label-content"},i("slot",null),i("z-icon",{name:this.open?"chevron-up":"chevron-down"}))):i("div",{class:"menu-label"},i("div",{class:"menu-label-content"},i("slot",null)))}render(){return i(n,null,this.renderMenuLabel(),i("div",{class:"content",ref:t=>{this.content=t},hidden:!this.open},this.hasHeader&&i("header",{class:"header"},i("slot",{name:"header",onSlotchange:this.checkContent})),i("div",{class:"items",role:"menu"},i("slot",{name:"item",onSlotchange:this.onItemsChange}))))}get hostElement(){return s(this)}static get watchers(){return{open:["onOpenChanged"]}}};a.style=':host,::slotted(*),*{box-sizing:border-box}:host{position:relative;display:inline-flex;flex-direction:column}::slotted(a){color:var(--color-text01);text-decoration:none}::slotted(*){font-family:var(--font-family-sans);font-weight:var(--font-rg)}.menu-label{padding:0;border:0;margin:0;background:transparent;border-radius:0;color:inherit;outline:none;text-align:left}button.menu-label{cursor:pointer}.menu-label:focus-within{z-index:1;padding-right:calc(var(--space-unit) * 0.5);padding-left:calc(var(--space-unit) * 0.5);margin-right:calc(var(--space-unit) * -0.5);margin-left:calc(var(--space-unit) * -0.5);box-shadow:var(--shadow-focus-primary)}.menu-label .menu-label-content{display:flex;align-items:center;padding:var(--space-unit) 0;border-bottom:var(--border-size-large) solid var(--color-surface05)}:host([active]) .menu-label-content,:host([open]) .menu-label-content,.menu-label:hover .menu-label-content,.menu-label:focus-within .menu-label-content{border-color:var(--color-secondary01)}.menu-label ::slotted(*){width:100%;margin:0;appearance:none;font-size:var(--font-size-5);line-height:1.2;outline:none}.menu-label z-icon{margin-left:calc(var(--space-unit) * 4);fill:currentcolor}.content{background:var(--color-surface01)}.content[hidden]{display:none}:host([floating]) .content{position:absolute;top:100%;left:0;width:375px;min-width:100%;max-width:100vw;padding:var(--space-unit) var(--space-unit) 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"]){display:inline-flex;width:100%;margin:0;font-size:var(--font-size-3);line-height:1.25;outline:none}.items>::slotted([slot="item"]:focus:focus-visible){box-shadow:var(--shadow-focus-primary)}.items>::slotted([slot="item"]:not(z-menu-section)){padding:calc(var(--space-unit) * 2) calc(var(--space-unit) * 0.5);border-bottom:var(--border-size-small) solid var(--color-surface05)}.items>::slotted([slot="item"]:hover),.items>::slotted([slot="item"]:active){border-color:var(--color-secondary01)}';export{a as z_menu}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,h as o,H as s,g as i}from"./p-d17ebc2f.js";const l=class{constructor(o){t(this,o),this.opened=e(this,"opened",7),this.closed=e(this,"closed",7)}toggle(){this.hasContent&&(this.open=!this.open,this.open?this.opened.emit():this.closed.emit())}handleClick(t){this.open&&!this.hostElement.contains(t.target)&&(this.open=!1,this.closed.emit())}checkContent(){this.hasContent=!!this.hostElement.querySelectorAll('[slot="item"]').length}componentWillLoad(){this.checkContent()}render(){return o(s,{role:"menu",open:this.open},o("button",{class:"label","aria-pressed":this.open?"true":"false",onClick:this.toggle.bind(this)},o("slot",null),this.hasContent&&o("z-icon",{name:this.open?"chevron-up":"chevron-down"})),this.open&&o("div",{class:"items"},o("slot",{name:"item",onSlotchange:this.checkContent.bind(this)})))}get hostElement(){return i(this)}};l.style=':host{display:inline-flex;flex-direction:column;align-items:flex-start;justify-content:center;padding:0;font-family:var(--font-family-sans)}:host,::slotted(*),*{box-sizing:border-box}::slotted(a){text-decoration:none}::slotted(*){color:var(--color-text01);font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host([active]) .label,:host([open]) .label,.label:hover{border-color:var(--color-secondary01)}.label{display:flex;width:100%;align-items:center;padding:calc(var(--space-unit) * 2) calc(var(--space-unit) * 0.5);border:0;border-bottom:var(--border-size-small) solid var(--color-surface05);margin:0;background:transparent;border-radius:0;cursor:pointer;text-align:left}.label ::slotted(*){width:100%;margin:0;font-size:var(--font-size-3);line-height:1.25}.label:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}.label z-icon{margin-left:calc(var(--space-unit) * 4);fill:currentcolor}.items{display:flex;width:100%;flex-direction:column;padding:calc(var(--space-unit) * 0.5);padding-bottom:calc(var(--space-unit) * 2)}.items>::slotted([slot="item"]){display:inline-flex;padding:calc(var(--space-unit) * 0.5);margin:0;font-size:var(--font-size-2);line-height:1.4;outline:none}.items>::slotted([slot="item"]:last-child){padding-bottom:0}.items>::slotted([slot="item"]:focus:focus-visible){box-shadow:var(--shadow-focus-primary);color:var(--color-secondary01)}.items>::slotted([slot="item"]:hover){color:var(--color-secondary01)}';export{l as z_menu_section}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,h as a,H as r,g as i}from"./p-d17ebc2f.js";const n="undefined"!=typeof IntersectionObserver,o=class{constructor(a){e(this,a),this.sticking=t(this,"sticking",7),this.stuck=!1,this.overlay=!1,this.flow="auto",this.drawerOpen=!1,this._stuck=!1,this.observer=n&&new IntersectionObserver((([e])=>{this._stuck=!e.isIntersecting}),{threshold:.5}),this.openDrawer=this.openDrawer.bind(this),this.closeDrawer=this.closeDrawer.bind(this),this.collectMenuElements.bind(this)}emitStickingEvent(){this.sticking.emit(this._stuck)}componentDidLoad(){this.collectMenuElements(),this.onStuckMode()}get title(){const e=this.hostElement.querySelector('[slot="title"]');return null===e?"":e.textContent.trim()}get scrollParent(){const e=this.hostElement.offsetParent;return e===document.body||e===document.documentElement?window:e}collectMenuElements(){const e=this.menuElements=this.hostElement.querySelectorAll('[slot="menu"]');this.menuLength=e.length,this.setMenuFloatingMode()}onStuckMode(){this.stuck?this.enableStuckObserver():this.disableStuckMode()}enableStuckObserver(){this.observer&&this.observer.observe(this.container)}disableStuckMode(){this._stuck=!1,this.observer&&this.observer.unobserve(this.container)}onStuck(){this.scrollParent&&this.emitStickingEvent()}setMenuFloatingMode(){if(0===this.menuElements.length)return;const e=this.menuElements;for(let t=0,a=e.length;t<a;t++)e[t].open=!1,e[t].floating=!this.drawerOpen}render(){return a(r,{"menu-length":this.menuLength},a("div",{class:"heading-panel",ref:e=>this.container=e},a("div",{class:"hero-container"},a("slot",{name:"hero"},this.hero&&a("img",{alt:"",src:this.hero}))),a("div",{class:"heading-container"},a("div",{class:"heading-title"},this.menuLength>0&&a("button",{class:"drawer-trigger","aria-label":"Apri menu",onClick:this.openDrawer},a("z-icon",{name:"burger-menu"})),a("slot",{name:"title"})),a("div",{class:"heading-subtitle"},a("slot",{name:"subtitle"}))),a("div",{class:"menu-container"},!this.drawerOpen&&"offcanvas"!==this.flow&&a("slot",{name:"menu",onSlotchange:()=>this.collectMenuElements()}))),a("div",{class:"drawer-container"},a("div",{class:"drawer-overlay",onClick:this.closeDrawer}),a("div",{class:"drawer-panel"},a("button",{class:"drawer-close","aria-label":"Chiudi menu",onClick:this.closeDrawer},a("z-icon",{name:"close"})),a("div",{class:"drawer-content"},this.drawerOpen&&a("slot",{name:"menu",onSlotchange:()=>this.collectMenuElements()})))),this._stuck&&a("div",{class:"heading-stuck"},a("div",{class:"heading-stuck-content"},this.menuLength>0&&a("button",{class:"drawer-trigger","aria-label":"Apri menu",onClick:this.openDrawer},a("z-icon",{name:"burger-menu"})),a("div",{class:"heading-title"},a("slot",{name:"stucked-title"},this.title)))))}openDrawer(){this.drawerOpen=!0}closeDrawer(){this.drawerOpen=!1}get hostElement(){return i(this)}static get watchers(){return{stuck:["onStuckMode"],_stuck:["onStuck"],drawerOpen:["setMenuFloatingMode"]}}};o.style=':host{--app-header-content-max-width:100%;--app-header-height:auto;--app-header-typography-1-size:24px;--app-header-typography-2-size:28px;--app-header-typography-3-size:32px;--app-header-typography-4-size:36px;--app-header-typography-5-size:42px;--app-header-typography-6-size:48px;--app-header-typography-7-size:54px;--app-header-typography-8-size:60px;--app-header-typography-9-size:68px;--app-header-typography-10-size:76px;--app-header-typography-11-size:84px;--app-header-typography-12-size:92px;--app-header-typography-1-lineheight:1.33;--app-header-typography-2-lineheight:1.29;--app-header-typography-3-lineheight:1.25;--app-header-typography-4-lineheight:1.24;--app-header-typography-5-lineheight:1.24;--app-header-typography-6-lineheight:1.25;--app-header-typography-7-lineheight:1.2;--app-header-typography-8-lineheight:1.26;--app-header-typography-9-lineheight:1.24;--app-header-typography-10-lineheight:1.26;--app-header-typography-11-lineheight:1.2;--app-header-typography-12-lineheight:1.2;--app-header-typography-1-tracking:calc(-0.2 / 1em);--app-header-typography-2-tracking:calc(-0.4 / 1em);--app-header-typography-3-tracking:calc(-0.6 / 1em);--app-header-typography-4-tracking:calc(-0.8 / 1em);--app-header-typography-5-tracking:calc(-1 / 1em);--app-header-typography-6-tracking:calc(-1.2 / 1em);--app-header-typography-7-tracking:calc(-1.4 / 1em);--app-header-typography-8-tracking:calc(-1.6 / 1em);--app-header-typography-9-tracking:calc(-1.8 / 1em);--app-header-typography-10-tracking:calc(-2 / 1em);--app-header-typography-11-tracking:calc(-2.2 / 1em);--app-header-typography-12-tracking:calc(-2.4 / 1em);--app-header-top-offset:48px;--app-header-drawer-trigger-size:calc(var(--space-unit) * 4);--app-header-bg:var(--color-white);--app-header-stucked-bg:var(--color-white);--app-header-text-color:var(--gray800);--app-header-stucked-text-color:var(--gray800);display:block;color:var(--app-header-text-color)}:host,*{box-sizing:border-box}.heading-panel{position:relative;display:flex;width:100%;max-width:var(--app-header-content-max-width);height:var(--app-header-height);flex-direction:column;flex-grow:0;flex-shrink:0;align-items:baseline;justify-content:flex-start;padding:var(--grid-margin);margin:0 auto;background:var(--app-header-bg)}:host(:empty) .heading-panel{padding:0}.heading-title{display:flex;max-width:100%;flex-direction:row;align-items:center}:host(:not([menu-length="0"])) .heading-subtitle{padding-left:calc(var(--app-header-drawer-trigger-size) + (var(--space-unit) * 1.5))}.heading-stuck{position:fixed;z-index:20;top:var(--app-header-top-offset);left:0;width:100%;max-width:100%;animation:slide-stuck-heading-in 250ms ease-out;background:var(--app-header-stucked-bg);box-shadow:var(--shadow-2);color:var(--app-header-stucked-text-color)}.heading-stuck-content{display:flex;max-width:var(--app-header-content-max-width);padding:var(--space-unit) var(--grid-margin);margin:0 auto}.heading-stuck .heading-title,.heading-stuck .heading-title>*,.heading-stuck .heading-title ::slotted([slot="stucked-title"]){display:block;overflow:hidden;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}.heading-stuck .heading-title>*,::slotted([slot="title"]),::slotted([slot="stucked-title"]){margin:0;font-family:"IBM Plex Serif", serif;font-size:var(--app-header-typography-3-size);font-weight:700;letter-spacing:var(--app-header-typography-3-tracking)}::slotted([slot="title"]){line-height:1}::slotted([slot="subtitle"]){margin:var(--space-unit) 0 0;font-family:var(--font-family-sans);font-size:20px;font-style:italic;font-weight:500;line-height:1.2}.heading-container{position:relative;z-index:1;display:flex;max-width:100%;flex-direction:column;align-items:flex-start;justify-content:flex-start;margin-right:auto}.menu-container{display:none;flex-flow:row wrap;align-items:baseline}.menu-container ::slotted([open]){position:relative;z-index:3}.menu-container ::slotted(*:not(:last-of-type)){margin-right:calc(var(--space-unit) * 4.5)}.drawer-trigger{padding:0;border:0;margin:0 calc(var(--space-unit) * 1.5) 0 0;appearance:none;background:none;border-radius:0;color:inherit;cursor:pointer}.drawer-trigger z-icon{--z-icon-width:var(--app-header-drawer-trigger-size);--z-icon-height:var(--app-header-drawer-trigger-size);fill:currentcolor}.drawer-container{position:fixed;z-index:100;top:var(--app-header-top-offset);left:0;width:100%;height:100%;pointer-events:none}.drawer-container .drawer-overlay{position:absolute;z-index:1;top:0;left:0;display:block;width:100%;height:100%;background:var(--gray900);opacity:0;pointer-events:none;transition:opacity 400ms ease-out}.drawer-panel{position:absolute;z-index:2;top:0;left:0;display:flex;width:375px;max-width:100%;height:100%;flex-direction:column;align-items:flex-start;padding:calc(var(--space-unit) * 2) var(--space-unit);background:var(--color-white);color:var(--gray800);pointer-events:none;transform:translate3d(-100%, 0, 0);transition:transform 400ms ease-out}.drawer-content{display:flex;overflow:auto;width:100%;flex:1 auto;flex-direction:column;padding:calc(var(--space-unit) * 0.5) var(--space-unit)}.drawer-content::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}.drawer-content::-webkit-scrollbar-track{background-color:transparent}.drawer-content::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}.drawer-content::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.drawer-content ::slotted(z-menu){width:100%}.drawer-content ::slotted(z-menu:not(:last-of-type)){margin-bottom:calc(var(--space-unit) * 2.5)}.drawer-close{--z-icon-width:var(--app-header-drawer-trigger-size);--z-icon-height:var(--app-header-drawer-trigger-size);padding:0;border:0;margin:0 0 calc(var(--space-unit) * 2.5) var(--space-unit);appearance:none;background:transparent;border-radius:0;color:inherit;cursor:pointer;fill:currentcolor;font-size:inherit;outline:none}.drawer-close:focus-visible{box-shadow:var(--shadow-focus-primary)}:host([drawer-open]) .drawer-container .drawer-overlay{opacity:0.7;pointer-events:all}:host([drawer-open]) .drawer-container .drawer-panel{pointer-events:all;transform:none}.hero-container{position:absolute;z-index:0;top:0;left:0;width:100%;height:100%}:host([overlay]) .heading-panel .drawer-trigger z-icon,:host([overlay]) .heading-panel .heading-container,:host([overlay]) .heading-panel .menu-container{color:var(--color-white);fill:var(--color-white)}:host([overlay]) .heading-panel .menu-container ::slotted(z-menu:not([open])){--color-surface05:var(--color-white)}:host([overlay]) .hero-container::after{position:absolute;z-index:0;top:0;left:0;width:100%;height:100%;background:var(--color-black);content:"";opacity:0.5}.hero-container img,.hero-container ::slotted(*){position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;object-position:top center;-webkit-user-drag:none}@media (min-width: 768px){:host(:not([flow="offcanvas"])) .heading-subtitle{padding-left:0}:host(:not([flow="offcanvas"])) .menu-container{display:flex}:host(:not([flow="offcanvas"])) .heading-container .drawer-trigger{display:none}:host(:not([flow="offcanvas"],[menu-length="0"])) .heading-container:not(:last-child){margin-bottom:calc(var(--space-unit) * 3)}::slotted([slot="title"]){font-size:var(--app-header-typography-6-size);letter-spacing:var(--app-header-typography-6-tracking)}::slotted([slot="subtitle"]){margin-top:calc(var(--space-unit) * 1.5)}}@media (min-width: 1152px){:host(:not([flow="stack"])) .heading-panel{flex-flow:row wrap}::slotted([slot="title"]){margin-right:var(--grid-gutter);font-size:var(--app-header-typography-7-size);letter-spacing:var(--app-header-typography-7-tracking)}:host(:not([flow="offcanvas"],[menu-length="0"])) .heading-container:not(:last-child){margin-bottom:calc(var(--space-unit) * 2)}.menu-container{margin-top:var(--space-unit)}}@media (min-width: 1366px){::slotted([slot="title"]){font-size:var(--app-header-typography-9-size);letter-spacing:var(--app-header-typography-9-tracking)}:host(:not([flow="offcanvas"],[menu-length="0"])) .heading-container:not(:last-child){margin-bottom:0}}@keyframes slide-stuck-heading-in{0%{transform:translate3d(0, -100%, 0)}100%{transform:none}}';export{o as z_app_header}
|