@zanichelli/albe-web-components 7.1.1 → 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 (87) hide show
  1. package/CHANGELOG.md +0 -29
  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-dragdrop-area_2.cjs.entry.js +4 -24
  8. package/dist/cjs/z-list_3.cjs.entry.js +1 -1
  9. package/dist/cjs/z-menu-section.cjs.entry.js +3 -11
  10. package/dist/cjs/z-menu.cjs.entry.js +14 -26
  11. package/dist/cjs/z-searchbar.cjs.entry.js +3 -12
  12. package/dist/collection/collection-manifest.json +1 -1
  13. package/dist/collection/components/inputs/z-searchbar/index.js +3 -76
  14. package/dist/collection/components/inputs/z-searchbar/styles.css +0 -23
  15. package/dist/collection/components/list/z-list-element/index.js +1 -1
  16. package/dist/collection/components/modal/z-modal/index.js +4 -42
  17. package/dist/collection/components/navigation/z-app-header/index.js +15 -14
  18. package/dist/collection/components/navigation/z-app-header/styles.css +3 -2
  19. package/dist/collection/components/navigation/z-menu/index.js +21 -45
  20. package/dist/collection/components/navigation/z-menu/styles.css +13 -80
  21. package/dist/collection/components/navigation/z-menu-section/index.js +4 -13
  22. package/dist/collection/components/navigation/z-menu-section/styles.css +4 -37
  23. package/dist/collection/components/z-offcanvas/index.js +31 -31
  24. package/dist/collection/components/z-offcanvas/styles.css +78 -87
  25. package/dist/esm/index-a2ca4b97.js +6 -10
  26. package/dist/esm/loader.js +1 -1
  27. package/dist/esm/web-components-library.js +1 -1
  28. package/dist/esm/z-app-header.entry.js +129 -0
  29. package/dist/esm/z-button_3.entry.js +102 -0
  30. package/dist/esm/z-dragdrop-area_2.entry.js +4 -24
  31. package/dist/esm/z-list_3.entry.js +1 -1
  32. package/dist/esm/z-menu-section.entry.js +3 -11
  33. package/dist/esm/z-menu.entry.js +14 -26
  34. package/dist/esm/z-searchbar.entry.js +4 -13
  35. package/dist/types/components/inputs/z-searchbar/index.d.ts +1 -7
  36. package/dist/types/components/modal/z-modal/index.d.ts +0 -4
  37. package/dist/types/components/navigation/z-app-header/index.d.ts +4 -2
  38. package/dist/types/components/navigation/z-menu/index.d.ts +5 -13
  39. package/dist/types/components/navigation/z-menu-section/index.d.ts +3 -9
  40. package/dist/types/components/z-offcanvas/index.d.ts +4 -4
  41. package/dist/types/components.d.ts +14 -42
  42. package/dist/web-components-library/p-029e4fba.entry.js +1 -0
  43. package/dist/web-components-library/p-14a6abe4.entry.js +1 -0
  44. package/dist/web-components-library/p-73d9489b.entry.js +1 -0
  45. package/dist/web-components-library/p-f158d205.entry.js +1 -0
  46. package/dist/web-components-library/p-f95cc914.entry.js +1 -0
  47. package/dist/web-components-library/p-fa4c203a.entry.js +1 -0
  48. package/dist/web-components-library/p-fffb14e1.entry.js +1 -0
  49. package/dist/web-components-library/web-components-library.css +1 -1
  50. package/dist/web-components-library/web-components-library.esm.js +1 -1
  51. package/package.json +2 -2
  52. package/www/build/p-029e4fba.entry.js +1 -0
  53. package/www/build/p-14a6abe4.entry.js +1 -0
  54. package/www/build/p-275801c6.css +1 -0
  55. package/www/build/p-73d9489b.entry.js +1 -0
  56. package/www/build/p-811ee64f.js +1 -0
  57. package/www/build/p-f158d205.entry.js +1 -0
  58. package/www/build/p-f95cc914.entry.js +1 -0
  59. package/www/build/p-fa4c203a.entry.js +1 -0
  60. package/www/build/p-fffb14e1.entry.js +1 -0
  61. package/www/build/web-components-library.css +1 -1
  62. package/www/build/web-components-library.esm.js +1 -1
  63. package/www/index.html +37 -1
  64. package/dist/cjs/z-app-header_2.cjs.entry.js +0 -152
  65. package/dist/cjs/z-button.cjs.entry.js +0 -43
  66. package/dist/cjs/z-offcanvas.cjs.entry.js +0 -70
  67. package/dist/esm/z-app-header_2.entry.js +0 -147
  68. package/dist/esm/z-button.entry.js +0 -39
  69. package/dist/esm/z-offcanvas.entry.js +0 -66
  70. package/dist/web-components-library/p-1570917d.entry.js +0 -1
  71. package/dist/web-components-library/p-157aea3b.entry.js +0 -1
  72. package/dist/web-components-library/p-1c8e7c24.entry.js +0 -1
  73. package/dist/web-components-library/p-8d134dc4.entry.js +0 -1
  74. package/dist/web-components-library/p-af283478.entry.js +0 -1
  75. package/dist/web-components-library/p-d0760bb1.entry.js +0 -1
  76. package/dist/web-components-library/p-deda8776.entry.js +0 -1
  77. package/dist/web-components-library/p-f3a8cc14.entry.js +0 -1
  78. package/www/build/p-1570917d.entry.js +0 -1
  79. package/www/build/p-157aea3b.entry.js +0 -1
  80. package/www/build/p-1c8e7c24.entry.js +0 -1
  81. package/www/build/p-717b1737.js +0 -1
  82. package/www/build/p-8d134dc4.entry.js +0 -1
  83. package/www/build/p-ab4e13f7.css +0 -1
  84. package/www/build/p-af283478.entry.js +0 -1
  85. package/www/build/p-d0760bb1.entry.js +0 -1
  86. package/www/build/p-deda8776.entry.js +0 -1
  87. package/www/build/p-f3a8cc14.entry.js +0 -1
@@ -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{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(:is([active],[open])) .label,.label:hover{border-color:var(--color-secondary01)}:is(:host(:is([active],[open])) .label,.label:hover) ::slotted(*){font-weight:var(--font-bd)}.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}::slotted([data-text]){display:inline-flex;flex-direction:column}::slotted([data-text])::after{overflow:hidden;height:0;content:attr(data-text);content:attr(data-text) / \"\";font-weight:var(--font-bd);pointer-events:none;user-select:none;visibility:hidden}@media speech{::slotted([data-text])::after{display:none}}.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:var(--color-icon02)}.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),.items>::slotted([slot=\"item\"][active]){color:var(--color-secondary01);font-weight:var(--font-bd)}";
3
+ const stylesCss = ":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)}";
4
4
 
5
5
  const ZMenuSection = class {
6
6
  constructor(hostRef) {
@@ -27,21 +27,13 @@ const ZMenuSection = class {
27
27
  * Check if some content slot is set.
28
28
  */
29
29
  checkContent() {
30
- this.hasContent = this.hostElement.querySelectorAll('[slot="item"]').length > 0;
31
- }
32
- /**
33
- * Sets slotted item text as `data-text` attribute value, to let CSS use it through `attr()`.
34
- * @param ev Slotchange event
35
- */
36
- onLabelSlotChange(ev) {
37
- const labelElement = ev.target.assignedElements()[0];
38
- labelElement.dataset.text = (labelElement === null || labelElement === void 0 ? void 0 : labelElement.innerText) || null;
30
+ this.hasContent = !!this.hostElement.querySelectorAll('[slot="item"]').length;
39
31
  }
40
32
  componentWillLoad() {
41
33
  this.checkContent();
42
34
  }
43
35
  render() {
44
- return (h(Host, { role: "menu", open: this.open }, h("button", { class: "label", "aria-pressed": this.open ? "true" : "false", onClick: this.toggle.bind(this) }, h("slot", { onSlotchange: this.onLabelSlotChange.bind(this) }), this.hasContent && h("z-icon", { name: this.open ? "chevron-up" : "chevron-down" })), this.open && (h("div", { class: "items" }, h("slot", { name: "item", onSlotchange: this.checkContent.bind(this) })))));
36
+ return (h(Host, { role: "menu", open: this.open }, h("button", { class: "label", "aria-pressed": this.open ? "true" : "false", onClick: this.toggle.bind(this) }, h("slot", null), this.hasContent && h("z-icon", { name: this.open ? "chevron-up" : "chevron-down" })), this.open && (h("div", { class: "items" }, h("slot", { name: "item", onSlotchange: this.checkContent.bind(this) })))));
45
37
  }
46
38
  get hostElement() { return getElement(this); }
47
39
  };
@@ -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(*){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)}";
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
- * Tells the component that it's placed in a vertical context with other `ZMenu`s (e.g. in the ZAppHeader's offcanvas).
20
- * A small border is placed under it as a separator from other elements.
18
+ * The opening state of the menu.
19
+ * @default false
21
20
  */
22
- this.verticalContext = false;
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("[slot=header]").length;
85
- this.hasContent = !!this.hostElement.querySelectorAll("[slot=item]").length || this.hasHeader;
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("[slot=item]");
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", { onSlotchange: this.onLabelSlotChange }), h("z-icon", { name: this.open ? "chevron-up" : "chevron-down" }))));
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", { onSlotchange: this.onLabelSlotChange }))));
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(), 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 }))))));
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 { d as ControlSize, B as ButtonVariant, l as ListDividerType } from './index-e36ec4a4.js';
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)}}: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}";
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, size: this.size }));
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
- const iconProp = this.searchButtonIconOnly ? { icon: "search" } : null;
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 { ButtonVariant, SearchbarItem, ControlSize } from "../../../beans";
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;
@@ -14,8 +14,6 @@ export declare class ZModal {
14
14
  closeButtonLabel: string;
15
15
  /** add role "alertdialog" to dialog (optional, default is false) */
16
16
  alertdialog?: boolean;
17
- /** if true, the modal is closable (optional, default is true) */
18
- closable?: boolean;
19
17
  private dialog;
20
18
  host: HTMLZModalElement;
21
19
  /** emitted on close button click, returns modalid */
@@ -41,7 +39,5 @@ export declare class ZModal {
41
39
  */
42
40
  private get focusableElements();
43
41
  handleKeyDown(e: KeyboardEvent): void;
44
- private closeButtonSlot;
45
- private handleEscape;
46
42
  render(): HTMLZModalElement;
47
43
  }
@@ -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
- * Tells the component that it's placed in a vertical context with other `ZMenu`s (e.g. in the ZAppHeader's offcanvas).
21
- * A small border is placed under it as a separator from other elements.
18
+ * The opening state of the menu.
19
+ * @default false
22
20
  */
23
- verticalContext: boolean;
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
- * A component to create submenus inside the ZMenu.
4
- * @slot - Label of the menu section.
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 handleOpenStatus;
23
- private handleAnimationEnd;
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
  /**
@@ -779,10 +777,6 @@ export namespace Components {
779
777
  * add role "alertdialog" to dialog (optional, default is false)
780
778
  */
781
779
  "alertdialog"?: boolean;
782
- /**
783
- * if true, the modal is closable (optional, default is true)
784
- */
785
- "closable"?: boolean;
786
780
  /**
787
781
  * close modal
788
782
  */
@@ -1116,6 +1110,10 @@ export namespace Components {
1116
1110
  * open component. Default: false
1117
1111
  */
1118
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;
1119
1117
  /**
1120
1118
  * open content transitioning in a specified direction left | right. Default: left
1121
1119
  */
@@ -1336,10 +1334,6 @@ export namespace Components {
1336
1334
  * Autocomplete results items
1337
1335
  */
1338
1336
  "resultsItems"?: SearchbarItem[] | string;
1339
- /**
1340
- * Set button icon without label
1341
- */
1342
- "searchButtonIconOnly"?: boolean;
1343
1337
  /**
1344
1338
  * Search helper text
1345
1339
  */
@@ -1348,10 +1342,6 @@ export namespace Components {
1348
1342
  * Show submit button
1349
1343
  */
1350
1344
  "showSearchButton"?: boolean;
1351
- /**
1352
- * Available sizes: `big`, `small` and `x-small`. Defaults to `big`.
1353
- */
1354
- "size"?: ControlSize;
1355
1345
  /**
1356
1346
  * Sort autocomplete results items
1357
1347
  */
@@ -1360,10 +1350,6 @@ export namespace Components {
1360
1350
  * Input search string
1361
1351
  */
1362
1352
  "value"?: string;
1363
- /**
1364
- * Graphical variant: `primary`, `secondary`, `tertiary`. Defaults to `primary`.
1365
- */
1366
- "variant"?: ButtonVariant;
1367
1353
  }
1368
1354
  interface ZSectionTitle {
1369
1355
  /**
@@ -2541,7 +2527,7 @@ declare namespace LocalJSX {
2541
2527
  */
2542
2528
  "drawerOpen"?: boolean;
2543
2529
  /**
2544
- * 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**
2545
2531
  */
2546
2532
  "flow"?: "auto" | "stack" | "offcanvas";
2547
2533
  /**
@@ -3324,6 +3310,7 @@ declare namespace LocalJSX {
3324
3310
  "active"?: boolean;
3325
3311
  /**
3326
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
3327
3314
  */
3328
3315
  "floating"?: boolean;
3329
3316
  /**
@@ -3336,12 +3323,9 @@ declare namespace LocalJSX {
3336
3323
  "onOpened"?: (event: ZMenuCustomEvent<any>) => void;
3337
3324
  /**
3338
3325
  * The opening state of the menu.
3326
+ * @default false
3339
3327
  */
3340
3328
  "open"?: boolean;
3341
- /**
3342
- * 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.
3343
- */
3344
- "verticalContext"?: boolean;
3345
3329
  }
3346
3330
  interface ZMenuSection {
3347
3331
  /**
@@ -3376,10 +3360,6 @@ declare namespace LocalJSX {
3376
3360
  * add role "alertdialog" to dialog (optional, default is false)
3377
3361
  */
3378
3362
  "alertdialog"?: boolean;
3379
- /**
3380
- * if true, the modal is closable (optional, default is true)
3381
- */
3382
- "closable"?: boolean;
3383
3363
  /**
3384
3364
  * aria-label for close button (optional)
3385
3365
  */
@@ -3757,6 +3737,10 @@ declare namespace LocalJSX {
3757
3737
  * open component. Default: false
3758
3738
  */
3759
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;
3760
3744
  /**
3761
3745
  * open content transitioning in a specified direction left | right. Default: left
3762
3746
  */
@@ -4013,10 +3997,6 @@ declare namespace LocalJSX {
4013
3997
  * Autocomplete results items
4014
3998
  */
4015
3999
  "resultsItems"?: SearchbarItem[] | string;
4016
- /**
4017
- * Set button icon without label
4018
- */
4019
- "searchButtonIconOnly"?: boolean;
4020
4000
  /**
4021
4001
  * Search helper text
4022
4002
  */
@@ -4025,10 +4005,6 @@ declare namespace LocalJSX {
4025
4005
  * Show submit button
4026
4006
  */
4027
4007
  "showSearchButton"?: boolean;
4028
- /**
4029
- * Available sizes: `big`, `small` and `x-small`. Defaults to `big`.
4030
- */
4031
- "size"?: ControlSize;
4032
4008
  /**
4033
4009
  * Sort autocomplete results items
4034
4010
  */
@@ -4037,10 +4013,6 @@ declare namespace LocalJSX {
4037
4013
  * Input search string
4038
4014
  */
4039
4015
  "value"?: string;
4040
- /**
4041
- * Graphical variant: `primary`, `secondary`, `tertiary`. Defaults to `primary`.
4042
- */
4043
- "variant"?: ButtonVariant;
4044
4016
  }
4045
4017
  interface ZSectionTitle {
4046
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}