@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.
Files changed (80) hide show
  1. package/CHANGELOG.md +2337 -0
  2. package/dist/cjs/index-e3299e0a.js +6 -10
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/web-components-library.cjs.js +1 -1
  5. package/dist/cjs/z-app-header.cjs.entry.js +133 -0
  6. package/dist/cjs/z-button_3.cjs.entry.js +108 -0
  7. package/dist/cjs/z-list_3.cjs.entry.js +1 -1
  8. package/dist/cjs/z-menu-section.cjs.entry.js +3 -11
  9. package/dist/cjs/z-menu.cjs.entry.js +14 -26
  10. package/dist/cjs/z-searchbar.cjs.entry.js +3 -12
  11. package/dist/collection/collection-manifest.json +1 -1
  12. package/dist/collection/components/inputs/z-searchbar/index.js +3 -76
  13. package/dist/collection/components/inputs/z-searchbar/styles.css +0 -23
  14. package/dist/collection/components/list/z-list-element/index.js +1 -1
  15. package/dist/collection/components/navigation/z-app-header/index.js +15 -14
  16. package/dist/collection/components/navigation/z-app-header/styles.css +3 -2
  17. package/dist/collection/components/navigation/z-menu/index.js +21 -45
  18. package/dist/collection/components/navigation/z-menu/styles.css +13 -80
  19. package/dist/collection/components/navigation/z-menu-section/index.js +4 -13
  20. package/dist/collection/components/navigation/z-menu-section/styles.css +4 -37
  21. package/dist/collection/components/z-offcanvas/index.js +31 -31
  22. package/dist/collection/components/z-offcanvas/styles.css +78 -87
  23. package/dist/esm/index-a2ca4b97.js +6 -10
  24. package/dist/esm/loader.js +1 -1
  25. package/dist/esm/web-components-library.js +1 -1
  26. package/dist/esm/z-app-header.entry.js +129 -0
  27. package/dist/esm/z-button_3.entry.js +102 -0
  28. package/dist/esm/z-list_3.entry.js +1 -1
  29. package/dist/esm/z-menu-section.entry.js +3 -11
  30. package/dist/esm/z-menu.entry.js +14 -26
  31. package/dist/esm/z-searchbar.entry.js +4 -13
  32. package/dist/types/components/inputs/z-searchbar/index.d.ts +1 -7
  33. package/dist/types/components/navigation/z-app-header/index.d.ts +4 -2
  34. package/dist/types/components/navigation/z-menu/index.d.ts +5 -13
  35. package/dist/types/components/navigation/z-menu-section/index.d.ts +3 -9
  36. package/dist/types/components/z-offcanvas/index.d.ts +4 -4
  37. package/dist/types/components.d.ts +14 -34
  38. package/dist/web-components-library/p-029e4fba.entry.js +1 -0
  39. package/dist/web-components-library/p-14a6abe4.entry.js +1 -0
  40. package/dist/web-components-library/p-73d9489b.entry.js +1 -0
  41. package/dist/web-components-library/p-f158d205.entry.js +1 -0
  42. package/dist/web-components-library/p-f95cc914.entry.js +1 -0
  43. package/dist/web-components-library/p-fa4c203a.entry.js +1 -0
  44. package/dist/web-components-library/web-components-library.css +1 -1
  45. package/dist/web-components-library/web-components-library.esm.js +1 -1
  46. package/package.json +2 -2
  47. package/src-react/index.ts +1 -0
  48. package/www/build/p-029e4fba.entry.js +1 -0
  49. package/www/build/p-14a6abe4.entry.js +1 -0
  50. package/www/build/p-275801c6.css +1 -0
  51. package/www/build/p-73d9489b.entry.js +1 -0
  52. package/www/build/p-811ee64f.js +1 -0
  53. package/www/build/p-f158d205.entry.js +1 -0
  54. package/www/build/p-f95cc914.entry.js +1 -0
  55. package/www/build/p-fa4c203a.entry.js +1 -0
  56. package/www/build/web-components-library.css +1 -1
  57. package/www/build/web-components-library.esm.js +1 -1
  58. package/www/index.html +37 -1
  59. package/dist/cjs/z-app-header_2.cjs.entry.js +0 -152
  60. package/dist/cjs/z-button.cjs.entry.js +0 -43
  61. package/dist/cjs/z-offcanvas.cjs.entry.js +0 -70
  62. package/dist/esm/z-app-header_2.entry.js +0 -147
  63. package/dist/esm/z-button.entry.js +0 -39
  64. package/dist/esm/z-offcanvas.entry.js +0 -66
  65. package/dist/web-components-library/p-1570917d.entry.js +0 -1
  66. package/dist/web-components-library/p-157aea3b.entry.js +0 -1
  67. package/dist/web-components-library/p-1c8e7c24.entry.js +0 -1
  68. package/dist/web-components-library/p-8d134dc4.entry.js +0 -1
  69. package/dist/web-components-library/p-af283478.entry.js +0 -1
  70. package/dist/web-components-library/p-d0760bb1.entry.js +0 -1
  71. package/dist/web-components-library/p-deda8776.entry.js +0 -1
  72. package/www/build/p-1570917d.entry.js +0 -1
  73. package/www/build/p-157aea3b.entry.js +0 -1
  74. package/www/build/p-1c8e7c24.entry.js +0 -1
  75. package/www/build/p-6b4d4172.js +0 -1
  76. package/www/build/p-8d134dc4.entry.js +0 -1
  77. package/www/build/p-ab4e13f7.css +0 -1
  78. package/www/build/p-af283478.entry.js +0 -1
  79. package/www/build/p-d0760bb1.entry.js +0 -1
  80. package/www/build/p-deda8776.entry.js +0 -1
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-e3299e0a.js');
6
6
 
7
- const stylesCss = ":host,::slotted(*),*{box-sizing:border-box}:host{position:relative;display:inline-flex;flex-direction:column}::slotted(a){text-decoration:none}::slotted(*){color:var(--color-text01);font-family:var(--font-family-sans);font-weight:var(--font-rg);letter-spacing:0.36px}.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{position:relative;display:flex;align-items:center}:host(:is([active],[open])) .menu-label-content,.menu-label .menu-label-content:hover,.menu-label:focus-within .menu-label-content{font-weight:var(--font-bd)}:host(:is([active],[open])) .menu-label-content ::slotted(*),.menu-label .menu-label-content:hover ::slotted(*),.menu-label:focus-within .menu-label-content ::slotted(*){letter-spacing:normal}:host(:is([active],[open],[vertical-context])) .menu-label .menu-label-content::after,.menu-label .menu-label-content:hover::after,.menu-label:focus-within .menu-label-content::after{position:absolute;bottom:0;left:0;width:100%;content:\"\";pointer-events:none}:host([vertical-context]) .menu-label-content::after{height:var(--border-size-small);background-color:var(--color-surface03)}:host(:is([active],[open])) .menu-label .menu-label-content::after,.menu-label .menu-label-content:hover::after,.menu-label:focus-within .menu-label-content::after{height:var(--border-size-large);background-color:var(--color-secondary01)}::slotted([data-text])::after{height:0;content:attr(data-text);content:attr(data-text) / \"\";font-weight:var(--font-bd);letter-spacing:normal;pointer-events:none;user-select:none;visibility:hidden}@media speech{::slotted([data-text])::after{display:none}}::slotted([data-text]){display:inline-flex;flex-direction:column}.menu-label .menu-label-content ::slotted(*){display:inline-flex;width:100%;margin:0;appearance:none;font-size:var(--font-size-5);font-weight:inherit;line-height:1.2;outline:none}.menu-label .menu-label-content ::slotted(*),.menu-label .menu-label-content z-icon{padding:var(--space-unit) 0}.menu-label .menu-label-content z-icon{margin-left:calc(var(--space-unit) * 1.5);fill:var(--color-icon02)}.content{background:var(--color-surface01)}:host(:not([open])) .content{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\"]){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);font-weight:var(--font-bd)}";
7
+ 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)}";
8
8
 
9
9
  const ZMenu = class {
10
10
  constructor(hostRef) {
@@ -15,18 +15,16 @@ const ZMenu = class {
15
15
  * Flag to set the display mode of the list.
16
16
  * If true, the list will be absolutely positioned under the menu label,
17
17
  * stacked beneath it otherwise.
18
+ * @default false
18
19
  */
19
20
  this.floating = false;
20
- /** The opening state of the menu. */
21
- this.open = false;
22
21
  /**
23
- * Tells the component that it's placed in a vertical context with other `ZMenu`s (e.g. in the ZAppHeader's offcanvas).
24
- * A small border is placed under it as a separator from other elements.
22
+ * The opening state of the menu.
23
+ * @default false
25
24
  */
26
- this.verticalContext = false;
25
+ this.open = false;
27
26
  this.toggle = this.toggle.bind(this);
28
27
  this.checkContent = this.checkContent.bind(this);
29
- this.onLabelSlotChange = this.onLabelSlotChange.bind(this);
30
28
  this.onItemsChange = this.onItemsChange.bind(this);
31
29
  }
32
30
  toggle() {
@@ -56,14 +54,6 @@ const ZMenu = class {
56
54
  componentWillLoad() {
57
55
  this.checkContent();
58
56
  }
59
- /**
60
- * Sets slotted item text as `data-text` attribute value, to let CSS use it through `attr()`.
61
- * @param ev Slotchange event
62
- */
63
- onLabelSlotChange(ev) {
64
- const labelElement = ev.target.assignedElements()[0];
65
- labelElement.dataset.text = labelElement === null || labelElement === void 0 ? void 0 : labelElement.textContent;
66
- }
67
57
  /**
68
58
  * Correctly set position of the floating menu in order to prevent overflow.
69
59
  * @param live Should run the method on every refresh frame.
@@ -85,29 +75,27 @@ const ZMenu = class {
85
75
  * Check if some content slot is set.
86
76
  */
87
77
  checkContent() {
88
- this.hasHeader = !!this.hostElement.querySelectorAll("[slot=header]").length;
89
- this.hasContent = !!this.hostElement.querySelectorAll("[slot=item]").length || this.hasHeader;
78
+ this.hasHeader = !!this.hostElement.querySelectorAll('[slot="header"]').length;
79
+ this.hasContent = !!this.hostElement.querySelectorAll('[slot="item"]').length || this.hasHeader;
90
80
  }
91
81
  /**
92
82
  * Set `menuitem` role to all menu items.
93
- * Set the item's inner text to the `data-text` attribute (this is for using bold text avoiding layout shifts).
94
83
  */
95
84
  onItemsChange() {
96
85
  this.checkContent();
97
- const items = this.hostElement.querySelectorAll("[slot=item]");
98
- items.forEach((item) => {
99
- item.setAttribute("role", "menuitem");
100
- item.dataset.text = item.textContent;
101
- });
86
+ const items = this.hostElement.querySelectorAll('[slot="item"]');
87
+ items === null || items === void 0 ? void 0 : items.forEach((item) => item.setAttribute("role", "menuitem"));
102
88
  }
103
89
  renderMenuLabel() {
104
90
  if (this.hasContent) {
105
- return (index.h("button", { class: "menu-label", "aria-expanded": this.open ? "true" : "false", "aria-label": this.open ? "Chiudi menù" : "Apri menù", onClick: this.toggle }, index.h("div", { class: "menu-label-content" }, index.h("slot", { onSlotchange: this.onLabelSlotChange }), index.h("z-icon", { name: this.open ? "chevron-up" : "chevron-down" }))));
91
+ return (index.h("button", { class: "menu-label", "aria-expanded": this.open ? "true" : "false", "aria-label": this.open ? "Chiudi menù" : "Apri menù", onClick: this.toggle }, index.h("div", { class: "menu-label-content" }, index.h("slot", null), index.h("z-icon", { name: this.open ? "chevron-up" : "chevron-down" }))));
106
92
  }
107
- return (index.h("div", { class: "menu-label" }, index.h("div", { class: "menu-label-content" }, index.h("slot", { onSlotchange: this.onLabelSlotChange }))));
93
+ return (index.h("div", { class: "menu-label" }, index.h("div", { class: "menu-label-content" }, index.h("slot", null))));
108
94
  }
109
95
  render() {
110
- return (index.h(index.Host, null, this.renderMenuLabel(), this.hasContent && (index.h("div", { class: "content", ref: (el) => (this.content = el) }, this.hasHeader && (index.h("header", { class: "header" }, index.h("slot", { name: "header", onSlotchange: this.checkContent }))), index.h("div", { class: "items", role: "menu" }, index.h("slot", { name: "item", onSlotchange: this.onItemsChange }))))));
96
+ return (index.h(index.Host, null, this.renderMenuLabel(), index.h("div", { class: "content", ref: (el) => {
97
+ this.content = el;
98
+ }, hidden: !this.open }, this.hasHeader && (index.h("header", { class: "header" }, index.h("slot", { name: "header", onSlotchange: this.checkContent }))), index.h("div", { class: "items", role: "menu" }, index.h("slot", { name: "item", onSlotchange: this.onItemsChange })))));
111
99
  }
112
100
  get hostElement() { return index.getElement(this); }
113
101
  static get watchers() { return {
@@ -7,7 +7,7 @@ const index$1 = require('./index-7a9a8430.js');
7
7
  const utils = require('./utils-305151da.js');
8
8
  require('./breakpoints-88c4fd6c.js');
9
9
 
10
- 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)}}:host([size=\"small\"])>div>div.results-wrapper>div.results .item,:host([size=\"x-small\"])>div>div.results-wrapper>div.results .item,:host([size=\"small\"])>div>div.results-wrapper>div.results .category-heading,:host([size=\"x-small\"])>div>div.results-wrapper>div.results .category-heading{font-size:var(--font-size-2)}:host([size=\"small\"])>div>div.results-wrapper>div.results .item:not(.has-category),:host([size=\"x-small\"])>div>div.results-wrapper>div.results .item:not(.has-category){--z-icon-height:16px;--z-icon-width:16px}:host([size=\"small\"])::part(list-item-container){min-height:calc(var(--space-unit) * 4.5);padding:0}:host([size=\"x-small\"])::part(list-item-container){min-height:calc(var(--space-unit) * 4);padding:0}";
10
+ 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)}}";
11
11
 
12
12
  const ZSearchbar = class {
13
13
  constructor(hostRef) {
@@ -31,12 +31,6 @@ const ZSearchbar = class {
31
31
  this.sortResultsItems = false;
32
32
  /** Show submit button */
33
33
  this.showSearchButton = false;
34
- /** Set button icon without label*/
35
- this.searchButtonIconOnly = false;
36
- /** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */
37
- this.size = index$1.ControlSize.BIG;
38
- /** Graphical variant: `primary`, `secondary`, `tertiary`. Defaults to `primary`. */
39
- this.variant = index$1.ButtonVariant.PRIMARY;
40
34
  this.searchString = "";
41
35
  this.currResultsCount = 0;
42
36
  this.showResults = false;
@@ -149,16 +143,13 @@ const ZSearchbar = class {
149
143
  renderInput() {
150
144
  return (index.h("z-input", { ref: (val) => {
151
145
  this.inputRef = val;
152
- }, message: false, placeholder: this.placeholder, onStopTyping: (e) => this.handleStopTyping(e), onKeyUp: (e) => utils.handleEnterKeydSubmit(e, () => this.handleSubmit()), value: this.value, size: this.size }));
146
+ }, message: false, placeholder: this.placeholder, onStopTyping: (e) => this.handleStopTyping(e), onKeyUp: (e) => utils.handleEnterKeydSubmit(e, () => this.handleSubmit()), value: this.value }));
153
147
  }
154
148
  renderButton() {
155
149
  if (!this.showSearchButton) {
156
150
  return null;
157
151
  }
158
- const iconProp = this.searchButtonIconOnly ? { icon: "search" } : null;
159
- const buttonLabel = this.searchButtonIconOnly ? "" : "CERCA";
160
- const defaultProps = Object.assign({ disabled: this.preventSubmit, variant: this.variant, size: this.size, onClick: () => this.handleSubmit() }, iconProp);
161
- return index.h("z-button", Object.assign({}, defaultProps), buttonLabel);
152
+ return (index.h("z-button", { disabled: this.preventSubmit, variant: index$1.ButtonVariant.PRIMARY, onClick: () => this.handleSubmit() }, "CERCA"));
162
153
  }
163
154
  renderResults() {
164
155
  if (!this.showResults ||
@@ -29,9 +29,9 @@
29
29
  "./components/navigation/tabs/z-navigation-tab/index.js",
30
30
  "./components/navigation/tabs/z-navigation-tab-link/index.js",
31
31
  "./components/navigation/tabs/z-navigation-tabs/index.js",
32
+ "./components/navigation/z-menu/index.js",
32
33
  "./components/navigation/z-app-header/index.js",
33
34
  "./components/navigation/z-link/index.js",
34
- "./components/navigation/z-menu/index.js",
35
35
  "./components/navigation/z-menu-section/index.js",
36
36
  "./components/notification/z-info-box/index.js",
37
37
  "./components/notification/z-notification/index.js",
@@ -1,5 +1,5 @@
1
1
  import { h, Host } from "@stencil/core";
2
- import { ButtonVariant, ListDividerType, ControlSize, } from "../../../beans";
2
+ import { ButtonVariant, ListDividerType } from "../../../beans";
3
3
  import { handleEnterKeydSubmit, randomId } from "../../../utils/utils";
4
4
  /**
5
5
  * @cssprop --z-searchbar-results-height - Max height of the results container (default: 540px)
@@ -22,12 +22,6 @@ export class ZSearchbar {
22
22
  this.sortResultsItems = false;
23
23
  /** Show submit button */
24
24
  this.showSearchButton = false;
25
- /** Set button icon without label*/
26
- this.searchButtonIconOnly = false;
27
- /** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */
28
- this.size = ControlSize.BIG;
29
- /** Graphical variant: `primary`, `secondary`, `tertiary`. Defaults to `primary`. */
30
- this.variant = ButtonVariant.PRIMARY;
31
25
  this.searchString = "";
32
26
  this.currResultsCount = 0;
33
27
  this.showResults = false;
@@ -140,16 +134,13 @@ export class ZSearchbar {
140
134
  renderInput() {
141
135
  return (h("z-input", { ref: (val) => {
142
136
  this.inputRef = val;
143
- }, message: false, placeholder: this.placeholder, onStopTyping: (e) => this.handleStopTyping(e), onKeyUp: (e) => handleEnterKeydSubmit(e, () => this.handleSubmit()), value: this.value, size: this.size }));
137
+ }, message: false, placeholder: this.placeholder, onStopTyping: (e) => this.handleStopTyping(e), onKeyUp: (e) => handleEnterKeydSubmit(e, () => this.handleSubmit()), value: this.value }));
144
138
  }
145
139
  renderButton() {
146
140
  if (!this.showSearchButton) {
147
141
  return null;
148
142
  }
149
- const iconProp = this.searchButtonIconOnly ? { icon: "search" } : null;
150
- const buttonLabel = this.searchButtonIconOnly ? "" : "CERCA";
151
- const defaultProps = Object.assign({ disabled: this.preventSubmit, variant: this.variant, size: this.size, onClick: () => this.handleSubmit() }, iconProp);
152
- return h("z-button", Object.assign({}, defaultProps), buttonLabel);
143
+ return (h("z-button", { disabled: this.preventSubmit, variant: ButtonVariant.PRIMARY, onClick: () => this.handleSubmit() }, "CERCA"));
153
144
  }
154
145
  renderResults() {
155
146
  if (!this.showResults ||
@@ -457,70 +448,6 @@ export class ZSearchbar {
457
448
  "attribute": "show-search-button",
458
449
  "reflect": false,
459
450
  "defaultValue": "false"
460
- },
461
- "searchButtonIconOnly": {
462
- "type": "boolean",
463
- "mutable": false,
464
- "complexType": {
465
- "original": "boolean",
466
- "resolved": "boolean",
467
- "references": {}
468
- },
469
- "required": false,
470
- "optional": true,
471
- "docs": {
472
- "tags": [],
473
- "text": "Set button icon without label"
474
- },
475
- "attribute": "search-button-icon-only",
476
- "reflect": false,
477
- "defaultValue": "false"
478
- },
479
- "size": {
480
- "type": "string",
481
- "mutable": false,
482
- "complexType": {
483
- "original": "ControlSize",
484
- "resolved": "ControlSize.BIG | ControlSize.SMALL | ControlSize.X_SMALL",
485
- "references": {
486
- "ControlSize": {
487
- "location": "import",
488
- "path": "../../../beans"
489
- }
490
- }
491
- },
492
- "required": false,
493
- "optional": true,
494
- "docs": {
495
- "tags": [],
496
- "text": "Available sizes: `big`, `small` and `x-small`. Defaults to `big`."
497
- },
498
- "attribute": "size",
499
- "reflect": false,
500
- "defaultValue": "ControlSize.BIG"
501
- },
502
- "variant": {
503
- "type": "string",
504
- "mutable": false,
505
- "complexType": {
506
- "original": "ButtonVariant",
507
- "resolved": "ButtonVariant.DARK_BG | ButtonVariant.PRIMARY | ButtonVariant.SECONDARY | ButtonVariant.TERTIARY",
508
- "references": {
509
- "ButtonVariant": {
510
- "location": "import",
511
- "path": "../../../beans"
512
- }
513
- }
514
- },
515
- "required": false,
516
- "optional": true,
517
- "docs": {
518
- "tags": [],
519
- "text": "Graphical variant: `primary`, `secondary`, `tertiary`. Defaults to `primary`."
520
- },
521
- "attribute": "variant",
522
- "reflect": false,
523
- "defaultValue": "ButtonVariant.PRIMARY"
524
451
  }
525
452
  };
526
453
  }
@@ -209,26 +209,3 @@
209
209
  line-height: var(--font-size-6);
210
210
  }
211
211
  }
212
-
213
- :host([size="small"]) > div > div.results-wrapper > div.results .item,
214
- :host([size="x-small"]) > div > div.results-wrapper > div.results .item,
215
- :host([size="small"]) > div > div.results-wrapper > div.results .category-heading,
216
- :host([size="x-small"]) > div > div.results-wrapper > div.results .category-heading {
217
- font-size: var(--font-size-2);
218
- }
219
-
220
- :host([size="small"]) > div > div.results-wrapper > div.results .item:not(.has-category),
221
- :host([size="x-small"]) > div > div.results-wrapper > div.results .item:not(.has-category) {
222
- --z-icon-height: 16px;
223
- --z-icon-width: 16px;
224
- }
225
-
226
- :host([size="small"])::part(list-item-container) {
227
- min-height: calc(var(--space-unit) * 4.5);
228
- padding: 0;
229
- }
230
-
231
- :host([size="x-small"])::part(list-item-container) {
232
- min-height: calc(var(--space-unit) * 4);
233
- padding: 0;
234
- }
@@ -158,7 +158,7 @@ export class ZListElement {
158
158
  }
159
159
  }
160
160
  render() {
161
- return (h(Host, { role: "listitem", "aria-expanded": this.expandable ? this.showInnerContent : null, onClick: this.handleClick, onKeyDown: this.handleKeyDown, clickable: this.clickable && !this.disabled, tabIndex: !this.isContextualMenu ? "0" : null }, h("div", { class: `${this.calculateClass()}`, style: { color: `var(--${this.color})` }, tabindex: this.isContextualMenu ? "0" : "-1", id: `z-list-element-id-${this.listElementId}`, part: "list-item-container" }, h("div", { class: "z-list-element-container" }, this.renderExpandableButton(), this.renderContent()), this.renderExpandedContent()), this.dividerType === ListDividerType.ELEMENT && (h("z-divider", { color: this.dividerColor, size: this.dividerSize }))));
161
+ return (h(Host, { role: "listitem", "aria-expanded": this.expandable ? this.showInnerContent : null, onClick: this.handleClick, onKeyDown: this.handleKeyDown, clickable: this.clickable && !this.disabled, tabIndex: !this.isContextualMenu ? "0" : null }, h("div", { class: `${this.calculateClass()}`, style: { color: `var(--${this.color})` }, tabindex: this.isContextualMenu ? "0" : "-1", id: `z-list-element-id-${this.listElementId}` }, h("div", { class: "z-list-element-container" }, this.renderExpandableButton(), this.renderContent()), this.renderExpandedContent()), this.dividerType === ListDividerType.ELEMENT && (h("z-divider", { color: this.dividerColor, size: this.dividerSize }))));
162
162
  }
163
163
  static get is() { return "z-list-element"; }
164
164
  static get encapsulation() { return "shadow"; }
@@ -68,6 +68,8 @@ export class ZAppHeader {
68
68
  * - auto: the menu bar is positioned near the title
69
69
  * - stack: the menu bar is positioned below the title
70
70
  * - offcanvas: the menu bar is not displayed and a burger icon appears to open the offcanvas menu
71
+ *
72
+ * **Optional**
71
73
  */
72
74
  this.flow = "auto";
73
75
  /**
@@ -86,17 +88,11 @@ export class ZAppHeader {
86
88
  });
87
89
  this.openDrawer = this.openDrawer.bind(this);
88
90
  this.closeDrawer = this.closeDrawer.bind(this);
89
- this.collectMenuElements = this.collectMenuElements.bind(this);
91
+ this.collectMenuElements.bind(this);
90
92
  }
91
93
  emitStickingEvent() {
92
94
  this.sticking.emit(this._stuck);
93
95
  }
94
- openDrawer() {
95
- this.drawerOpen = true;
96
- }
97
- closeDrawer() {
98
- this.drawerOpen = false;
99
- }
100
96
  componentDidLoad() {
101
97
  this.collectMenuElements();
102
98
  this.onStuckMode();
@@ -151,14 +147,19 @@ export class ZAppHeader {
151
147
  return;
152
148
  }
153
149
  const elements = this.menuElements;
154
- elements.forEach((element) => {
155
- element.open = false;
156
- element.floating = !this.drawerOpen;
157
- element.verticalContext = this.drawerOpen;
158
- });
150
+ for (let i = 0, len = elements.length; i < len; i++) {
151
+ elements[i].open = false;
152
+ elements[i].floating = !this.drawerOpen;
153
+ }
159
154
  }
160
155
  render() {
161
- return (h(Host, { "menu-length": this.menuLength }, h("div", { class: "heading-panel", ref: (el) => (this.container = el) }, h("div", { class: "hero-container" }, h("slot", { name: "hero" }, this.hero && (h("img", { alt: "", src: this.hero })))), h("div", { class: "heading-container" }, h("div", { class: "heading-title" }, this.menuLength > 0 && (h("button", { class: "drawer-trigger", "aria-label": "Apri menu", onClick: this.openDrawer }, h("z-icon", { name: "burger-menu" }))), h("slot", { name: "title" })), h("div", { class: "heading-subtitle" }, h("slot", { name: "subtitle" }))), h("div", { class: "menu-container" }, !this.drawerOpen && this.flow !== "offcanvas" && (h("slot", { name: "menu", onSlotchange: this.collectMenuElements })))), h("div", { class: "drawer-container" }, h("div", { class: "drawer-overlay", onClick: this.closeDrawer }), h("div", { class: "drawer-panel" }, h("button", { class: "drawer-close", "aria-label": "Chiudi menu", onClick: this.closeDrawer }, h("z-icon", { name: "close" })), h("div", { class: "drawer-content" }, this.drawerOpen && (h("slot", { name: "menu", onSlotchange: this.collectMenuElements }))))), this._stuck && (h("div", { class: "heading-stuck" }, h("div", { class: "heading-stuck-content" }, this.menuLength > 0 && (h("button", { class: "drawer-trigger", "aria-label": "Apri menu", onClick: this.openDrawer }, h("z-icon", { name: "burger-menu" }))), h("div", { class: "heading-title" }, h("slot", { name: "stucked-title" }, this.title)))))));
156
+ return (h(Host, { "menu-length": this.menuLength }, h("div", { class: "heading-panel", ref: (el) => (this.container = el) }, h("div", { class: "hero-container" }, h("slot", { name: "hero" }, this.hero && (h("img", { alt: "", src: this.hero })))), h("div", { class: "heading-container" }, h("div", { class: "heading-title" }, this.menuLength > 0 && (h("button", { class: "drawer-trigger", "aria-label": "Apri menu", onClick: this.openDrawer }, h("z-icon", { name: "burger-menu" }))), h("slot", { name: "title" })), h("div", { class: "heading-subtitle" }, h("slot", { name: "subtitle" }))), h("div", { class: "menu-container" }, !this.drawerOpen && this.flow !== "offcanvas" && (h("slot", { name: "menu", onSlotchange: () => this.collectMenuElements() })))), h("div", { class: "drawer-container" }, h("div", { class: "drawer-overlay", onClick: this.closeDrawer }), h("div", { class: "drawer-panel" }, h("button", { class: "drawer-close", "aria-label": "Chiudi menu", onClick: this.closeDrawer }, h("z-icon", { name: "close" })), h("div", { class: "drawer-content" }, this.drawerOpen && (h("slot", { name: "menu", onSlotchange: () => this.collectMenuElements() }))))), this._stuck && (h("div", { class: "heading-stuck" }, h("div", { class: "heading-stuck-content" }, this.menuLength > 0 && (h("button", { class: "drawer-trigger", "aria-label": "Apri menu", onClick: this.openDrawer }, h("z-icon", { name: "burger-menu" }))), h("div", { class: "heading-title" }, h("slot", { name: "stucked-title" }, this.title)))))));
157
+ }
158
+ openDrawer() {
159
+ this.drawerOpen = true;
160
+ }
161
+ closeDrawer() {
162
+ this.drawerOpen = false;
162
163
  }
163
164
  static get is() { return "z-app-header"; }
164
165
  static get encapsulation() { return "shadow"; }
@@ -239,7 +240,7 @@ export class ZAppHeader {
239
240
  "optional": false,
240
241
  "docs": {
241
242
  "tags": [],
242
- "text": "Control menu bar position in the header.\n- auto: the menu bar is positioned near the title\n- stack: the menu bar is positioned below the title\n- offcanvas: the menu bar is not displayed and a burger icon appears to open the offcanvas menu"
243
+ "text": "Control menu bar position in the header.\n- auto: the menu bar is positioned near the title\n- stack: the menu bar is positioned below the title\n- offcanvas: the menu bar is not displayed and a burger icon appears to open the offcanvas menu\n\n**Optional**"
243
244
  },
244
245
  "attribute": "flow",
245
246
  "reflect": true,
@@ -38,8 +38,9 @@
38
38
  --app-header-typography-11-tracking: calc(-2.2 / 1em);
39
39
  --app-header-typography-12-tracking: calc(-2.4 / 1em);
40
40
 
41
- /* Variable to set stuck header and drawer's top offset.
42
- Useful when something is absolutely positioned above the header. */
41
+ /**
42
+ * Variable to set stuck header and drawer's top offset. Useful when something is absolutely positioned above the header.
43
+ */
43
44
  --app-header-top-offset: 48px;
44
45
  --app-header-drawer-trigger-size: calc(var(--space-unit) * 4);
45
46
 
@@ -10,18 +10,16 @@ export class ZMenu {
10
10
  * Flag to set the display mode of the list.
11
11
  * If true, the list will be absolutely positioned under the menu label,
12
12
  * stacked beneath it otherwise.
13
+ * @default false
13
14
  */
14
15
  this.floating = false;
15
- /** The opening state of the menu. */
16
- this.open = false;
17
16
  /**
18
- * Tells the component that it's placed in a vertical context with other `ZMenu`s (e.g. in the ZAppHeader's offcanvas).
19
- * A small border is placed under it as a separator from other elements.
17
+ * The opening state of the menu.
18
+ * @default false
20
19
  */
21
- this.verticalContext = false;
20
+ this.open = false;
22
21
  this.toggle = this.toggle.bind(this);
23
22
  this.checkContent = this.checkContent.bind(this);
24
- this.onLabelSlotChange = this.onLabelSlotChange.bind(this);
25
23
  this.onItemsChange = this.onItemsChange.bind(this);
26
24
  }
27
25
  toggle() {
@@ -51,14 +49,6 @@ export class ZMenu {
51
49
  componentWillLoad() {
52
50
  this.checkContent();
53
51
  }
54
- /**
55
- * Sets slotted item text as `data-text` attribute value, to let CSS use it through `attr()`.
56
- * @param ev Slotchange event
57
- */
58
- onLabelSlotChange(ev) {
59
- const labelElement = ev.target.assignedElements()[0];
60
- labelElement.dataset.text = labelElement === null || labelElement === void 0 ? void 0 : labelElement.textContent;
61
- }
62
52
  /**
63
53
  * Correctly set position of the floating menu in order to prevent overflow.
64
54
  * @param live Should run the method on every refresh frame.
@@ -80,29 +70,27 @@ export class ZMenu {
80
70
  * Check if some content slot is set.
81
71
  */
82
72
  checkContent() {
83
- this.hasHeader = !!this.hostElement.querySelectorAll("[slot=header]").length;
84
- this.hasContent = !!this.hostElement.querySelectorAll("[slot=item]").length || this.hasHeader;
73
+ this.hasHeader = !!this.hostElement.querySelectorAll('[slot="header"]').length;
74
+ this.hasContent = !!this.hostElement.querySelectorAll('[slot="item"]').length || this.hasHeader;
85
75
  }
86
76
  /**
87
77
  * Set `menuitem` role to all menu items.
88
- * Set the item's inner text to the `data-text` attribute (this is for using bold text avoiding layout shifts).
89
78
  */
90
79
  onItemsChange() {
91
80
  this.checkContent();
92
- const items = this.hostElement.querySelectorAll("[slot=item]");
93
- items.forEach((item) => {
94
- item.setAttribute("role", "menuitem");
95
- item.dataset.text = item.textContent;
96
- });
81
+ const items = this.hostElement.querySelectorAll('[slot="item"]');
82
+ items === null || items === void 0 ? void 0 : items.forEach((item) => item.setAttribute("role", "menuitem"));
97
83
  }
98
84
  renderMenuLabel() {
99
85
  if (this.hasContent) {
100
- 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", { onSlotchange: this.onLabelSlotChange }), h("z-icon", { name: this.open ? "chevron-up" : "chevron-down" }))));
86
+ 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" }))));
101
87
  }
102
- return (h("div", { class: "menu-label" }, h("div", { class: "menu-label-content" }, h("slot", { onSlotchange: this.onLabelSlotChange }))));
88
+ return (h("div", { class: "menu-label" }, h("div", { class: "menu-label-content" }, h("slot", null))));
103
89
  }
104
90
  render() {
105
- return (h(Host, null, this.renderMenuLabel(), this.hasContent && (h("div", { class: "content", ref: (el) => (this.content = el) }, 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 }))))));
91
+ return (h(Host, null, this.renderMenuLabel(), h("div", { class: "content", ref: (el) => {
92
+ this.content = el;
93
+ }, 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 })))));
106
94
  }
107
95
  static get is() { return "z-menu"; }
108
96
  static get encapsulation() { return "shadow"; }
@@ -146,7 +134,10 @@ export class ZMenu {
146
134
  "required": false,
147
135
  "optional": true,
148
136
  "docs": {
149
- "tags": [],
137
+ "tags": [{
138
+ "name": "default",
139
+ "text": "false"
140
+ }],
150
141
  "text": "Flag to set the display mode of the list.\nIf true, the list will be absolutely positioned under the menu label,\nstacked beneath it otherwise."
151
142
  },
152
143
  "attribute": "floating",
@@ -164,30 +155,15 @@ export class ZMenu {
164
155
  "required": false,
165
156
  "optional": false,
166
157
  "docs": {
167
- "tags": [],
158
+ "tags": [{
159
+ "name": "default",
160
+ "text": "false"
161
+ }],
168
162
  "text": "The opening state of the menu."
169
163
  },
170
164
  "attribute": "open",
171
165
  "reflect": true,
172
166
  "defaultValue": "false"
173
- },
174
- "verticalContext": {
175
- "type": "boolean",
176
- "mutable": false,
177
- "complexType": {
178
- "original": "boolean",
179
- "resolved": "boolean",
180
- "references": {}
181
- },
182
- "required": false,
183
- "optional": false,
184
- "docs": {
185
- "tags": [],
186
- "text": "Tells the component that it's placed in a vertical context with other `ZMenu`s (e.g. in the ZAppHeader's offcanvas).\nA small border is placed under it as a separator from other elements."
187
- },
188
- "attribute": "vertical-context",
189
- "reflect": true,
190
- "defaultValue": "false"
191
167
  }
192
168
  };
193
169
  }