@zanichelli/albe-web-components 9.3.0-rc1 → 10.0.1

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 (191) hide show
  1. package/dist/cjs/index-e3299e0a.js +16 -20
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/web-components-library.cjs.js +1 -1
  4. package/dist/cjs/z-accordion.cjs.entry.js +1 -1
  5. package/dist/cjs/z-app-header_11.cjs.entry.js +1056 -0
  6. package/dist/cjs/z-book-card.cjs.entry.js +5 -1
  7. package/dist/cjs/z-breadcrumb.cjs.entry.js +1 -1
  8. package/dist/cjs/z-date-picker.cjs.entry.js +477 -0
  9. package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +1016 -0
  10. package/dist/cjs/z-navigation-tab-link.cjs.entry.js +4 -4
  11. package/dist/cjs/z-navigation-tab.cjs.entry.js +4 -4
  12. package/dist/cjs/z-navigation-tabs.cjs.entry.js +36 -44
  13. package/dist/cjs/z-panel-elem.cjs.entry.js +6 -2
  14. package/dist/cjs/z-select.cjs.entry.js +333 -0
  15. package/dist/cjs/z-skip-to-content.cjs.entry.js +10 -2
  16. package/dist/collection/collection-manifest.json +1 -4
  17. package/dist/collection/components/modal/z-modal/styles.css +2 -6
  18. package/dist/collection/components/navigation/tabs/navigation-tab.css +2 -1
  19. package/dist/collection/components/navigation/tabs/z-navigation-tab/index.js +19 -8
  20. package/dist/collection/components/navigation/tabs/z-navigation-tab-link/index.js +19 -8
  21. package/dist/collection/components/navigation/tabs/z-navigation-tabs/index.js +35 -43
  22. package/dist/collection/components/navigation/tabs/z-navigation-tabs/index.stories.js +11 -0
  23. package/dist/collection/components/navigation/tabs/z-navigation-tabs/styles.css +2 -2
  24. package/dist/collection/components/panel/z-panel-elem/index.js +6 -2
  25. package/dist/collection/components/panel/z-panel-elem/styles.css +9 -2
  26. package/dist/collection/components/z-accordion/index.js +10 -2
  27. package/dist/collection/components/z-accordion/styles.css +21 -10
  28. package/dist/collection/components/z-book-card/index.js +23 -1
  29. package/dist/collection/components/z-breadcrumb/index.js +1 -1
  30. package/dist/collection/components/z-skip-to-content/index.js +9 -1
  31. package/dist/collection/components/z-skip-to-content/styles.css +18 -17
  32. package/dist/esm/{index-8528dee0.js → index-1b2e3e53.js} +1 -1
  33. package/dist/esm/index-a2ca4b97.js +16 -20
  34. package/dist/esm/{index-5b83b0b1.js → index-d3dfe710.js} +1 -1
  35. package/dist/esm/index.js +1 -1
  36. package/dist/esm/loader.js +1 -1
  37. package/dist/esm/{utils-6c83dfcb.js → utils-4d2d99d9.js} +1 -1
  38. package/dist/esm/web-components-library.js +1 -1
  39. package/dist/esm/z-accordion.entry.js +1 -1
  40. package/dist/esm/z-app-header_11.entry.js +1042 -0
  41. package/dist/esm/z-book-card.entry.js +6 -2
  42. package/dist/esm/z-breadcrumb.entry.js +2 -2
  43. package/dist/esm/z-chip.entry.js +1 -1
  44. package/dist/esm/z-combobox.entry.js +1 -1
  45. package/dist/esm/z-date-picker.entry.js +473 -0
  46. package/dist/esm/z-dragdrop-area_2.entry.js +1011 -0
  47. package/dist/esm/z-file-upload.entry.js +1 -1
  48. package/dist/esm/z-myz-card-info.entry.js +1 -1
  49. package/dist/esm/z-myz-list-item.entry.js +1 -1
  50. package/dist/esm/z-navigation-tab-link.entry.js +5 -5
  51. package/dist/esm/z-navigation-tab.entry.js +5 -5
  52. package/dist/esm/z-navigation-tabs.entry.js +36 -44
  53. package/dist/esm/z-panel-elem.entry.js +6 -2
  54. package/dist/esm/z-pocket_3.entry.js +1 -1
  55. package/dist/esm/z-select.entry.js +329 -0
  56. package/dist/esm/z-skip-to-content.entry.js +11 -3
  57. package/dist/esm/z-slideshow.entry.js +1 -1
  58. package/dist/esm/z-table-deprecated.entry.js +2 -2
  59. package/dist/esm/z-table-header.entry.js +2 -2
  60. package/dist/esm/z-table.entry.js +2 -2
  61. package/dist/esm/z-toggle-switch.entry.js +1 -1
  62. package/dist/esm/z-tr.entry.js +2 -2
  63. package/dist/types/components/navigation/tabs/z-navigation-tab/index.d.ts +11 -5
  64. package/dist/types/components/navigation/tabs/z-navigation-tab-link/index.d.ts +11 -7
  65. package/dist/types/components/navigation/tabs/z-navigation-tabs/index.d.ts +4 -4
  66. package/dist/types/components/z-accordion/index.d.ts +10 -2
  67. package/dist/types/components/z-book-card/index.d.ts +4 -0
  68. package/dist/types/components.d.ts +28 -120
  69. package/dist/types/{components/navigation → deprecated}/z-link/index.d.ts +1 -1
  70. package/dist/web-components-library/index.esm.js +1 -1
  71. package/dist/web-components-library/p-06d2f371.entry.js +1 -0
  72. package/dist/web-components-library/p-09be4e46.entry.js +1 -0
  73. package/dist/web-components-library/p-113762ff.entry.js +1 -0
  74. package/dist/web-components-library/p-1976afea.entry.js +1 -0
  75. package/dist/web-components-library/{p-7eb6d043.entry.js → p-1cbd8a5f.entry.js} +1 -1
  76. package/dist/web-components-library/{p-c99acff4.entry.js → p-2d0ac109.entry.js} +1 -1
  77. package/dist/web-components-library/p-2d600a28.entry.js +1 -0
  78. package/dist/web-components-library/{p-dca0db1b.entry.js → p-2f013f10.entry.js} +1 -1
  79. package/dist/web-components-library/p-36487afc.entry.js +1 -0
  80. package/dist/web-components-library/{p-13ac8bd3.entry.js → p-37e8194f.entry.js} +1 -1
  81. package/dist/web-components-library/p-386bdb7f.entry.js +1 -0
  82. package/dist/web-components-library/p-3e61bad0.entry.js +1 -0
  83. package/dist/web-components-library/{p-327b7b79.js → p-65dd23d7.js} +1 -1
  84. package/dist/web-components-library/{p-b3093245.entry.js → p-69bde29c.entry.js} +1 -1
  85. package/dist/web-components-library/p-6b6453ba.entry.js +1 -0
  86. package/dist/web-components-library/{p-aa8b0c95.entry.js → p-8b2bf3b4.entry.js} +1 -1
  87. package/dist/web-components-library/p-9829f5bd.entry.js +16 -0
  88. package/dist/web-components-library/{p-432a2f5b.entry.js → p-a6a09ce6.entry.js} +1 -1
  89. package/{www/build/p-7f43e400.entry.js → dist/web-components-library/p-c1f20cec.entry.js} +1 -1
  90. package/dist/web-components-library/p-c4263223.entry.js +1 -0
  91. package/dist/web-components-library/p-c97d133c.entry.js +1 -0
  92. package/dist/web-components-library/{p-c8bd65d9.entry.js → p-cb07de86.entry.js} +1 -1
  93. package/dist/web-components-library/{p-eb9fa72b.js → p-d7668580.js} +1 -1
  94. package/dist/web-components-library/p-dd17b462.entry.js +1 -0
  95. package/dist/web-components-library/{p-91447194.js → p-dd3e0b4e.js} +1 -1
  96. package/dist/web-components-library/p-f5b5f897.entry.js +1 -0
  97. package/dist/web-components-library/p-fef8f2e1.entry.js +1 -0
  98. package/dist/web-components-library/web-components-library.css +1 -1
  99. package/dist/web-components-library/web-components-library.esm.js +1 -1
  100. package/package.json +2 -2
  101. package/react/components.d.ts +0 -3
  102. package/react/components.js +2 -5
  103. package/react/components.js.map +1 -1
  104. package/www/build/index.esm.js +1 -1
  105. package/www/build/p-06d2f371.entry.js +1 -0
  106. package/www/build/p-09be4e46.entry.js +1 -0
  107. package/www/build/p-113762ff.entry.js +1 -0
  108. package/www/build/p-1976afea.entry.js +1 -0
  109. package/www/build/{p-7eb6d043.entry.js → p-1cbd8a5f.entry.js} +1 -1
  110. package/www/build/p-1f34248a.css +2 -0
  111. package/www/build/{p-c99acff4.entry.js → p-2d0ac109.entry.js} +1 -1
  112. package/www/build/p-2d600a28.entry.js +1 -0
  113. package/www/build/{p-dca0db1b.entry.js → p-2f013f10.entry.js} +1 -1
  114. package/www/build/p-36487afc.entry.js +1 -0
  115. package/www/build/{p-13ac8bd3.entry.js → p-37e8194f.entry.js} +1 -1
  116. package/www/build/p-386bdb7f.entry.js +1 -0
  117. package/www/build/p-3e61bad0.entry.js +1 -0
  118. package/www/build/p-4d775062.js +1 -0
  119. package/www/build/{p-327b7b79.js → p-65dd23d7.js} +1 -1
  120. package/www/build/{p-b3093245.entry.js → p-69bde29c.entry.js} +1 -1
  121. package/www/build/p-6b6453ba.entry.js +1 -0
  122. package/www/build/{p-aa8b0c95.entry.js → p-8b2bf3b4.entry.js} +1 -1
  123. package/www/build/p-9829f5bd.entry.js +16 -0
  124. package/www/build/{p-432a2f5b.entry.js → p-a6a09ce6.entry.js} +1 -1
  125. package/{dist/web-components-library/p-7f43e400.entry.js → www/build/p-c1f20cec.entry.js} +1 -1
  126. package/www/build/p-c4263223.entry.js +1 -0
  127. package/www/build/p-c97d133c.entry.js +1 -0
  128. package/www/build/{p-c8bd65d9.entry.js → p-cb07de86.entry.js} +1 -1
  129. package/www/build/{p-eb9fa72b.js → p-d7668580.js} +1 -1
  130. package/www/build/p-dd17b462.entry.js +1 -0
  131. package/www/build/{p-91447194.js → p-dd3e0b4e.js} +1 -1
  132. package/www/build/p-f5b5f897.entry.js +1 -0
  133. package/www/build/p-fef8f2e1.entry.js +1 -0
  134. package/www/build/web-components-library.css +1 -1
  135. package/www/build/web-components-library.esm.js +1 -1
  136. package/www/index.html +1 -59
  137. package/CHANGELOG.md +0 -2694
  138. package/dist/cjs/z-app-header_14.cjs.entry.js +0 -2828
  139. package/dist/cjs/z-body.cjs.entry.js +0 -18
  140. package/dist/cjs/z-dragdrop-area.cjs.entry.js +0 -37
  141. package/dist/cjs/z-heading.cjs.entry.js +0 -18
  142. package/dist/cjs/z-typography.cjs.entry.js +0 -30
  143. package/dist/collection/deprecated/typography/z-body/index.js +0 -68
  144. package/dist/collection/deprecated/typography/z-heading/index.js +0 -68
  145. package/dist/collection/deprecated/typography/z-typography/index.js +0 -91
  146. package/dist/collection/deprecated/typography/z-typography/styles.css +0 -65
  147. package/dist/esm/z-app-header_14.entry.js +0 -2811
  148. package/dist/esm/z-body.entry.js +0 -14
  149. package/dist/esm/z-dragdrop-area.entry.js +0 -33
  150. package/dist/esm/z-heading.entry.js +0 -14
  151. package/dist/esm/z-typography.entry.js +0 -26
  152. package/dist/types/deprecated/typography/z-body/index.d.ts +0 -9
  153. package/dist/types/deprecated/typography/z-heading/index.d.ts +0 -9
  154. package/dist/types/deprecated/typography/z-typography/index.d.ts +0 -11
  155. package/dist/web-components-library/p-052c06ac.entry.js +0 -1
  156. package/dist/web-components-library/p-3ee4aa12.entry.js +0 -1
  157. package/dist/web-components-library/p-438f017e.entry.js +0 -1
  158. package/dist/web-components-library/p-4423b00c.entry.js +0 -1
  159. package/dist/web-components-library/p-466c3c0b.entry.js +0 -1
  160. package/dist/web-components-library/p-52b084fb.entry.js +0 -1
  161. package/dist/web-components-library/p-5ac6109d.entry.js +0 -1
  162. package/dist/web-components-library/p-625d603e.entry.js +0 -1
  163. package/dist/web-components-library/p-76c2c26d.entry.js +0 -1
  164. package/dist/web-components-library/p-b2420056.entry.js +0 -1
  165. package/dist/web-components-library/p-bbeb69ae.entry.js +0 -1
  166. package/dist/web-components-library/p-c1de287b.entry.js +0 -1
  167. package/dist/web-components-library/p-d147e995.entry.js +0 -1
  168. package/dist/web-components-library/p-d8de02a7.entry.js +0 -1
  169. package/dist/web-components-library/p-e78ce8ec.entry.js +0 -1
  170. package/dist/web-components-library/p-f01f4e9b.entry.js +0 -16
  171. package/src-react/index.ts +0 -1
  172. package/www/build/p-052c06ac.entry.js +0 -1
  173. package/www/build/p-39b528a6.js +0 -129
  174. package/www/build/p-3ee4aa12.entry.js +0 -1
  175. package/www/build/p-438f017e.entry.js +0 -1
  176. package/www/build/p-4423b00c.entry.js +0 -1
  177. package/www/build/p-466c3c0b.entry.js +0 -1
  178. package/www/build/p-52b084fb.entry.js +0 -1
  179. package/www/build/p-5a0a4f69.css +0 -1653
  180. package/www/build/p-5ac6109d.entry.js +0 -1
  181. package/www/build/p-625d603e.entry.js +0 -1
  182. package/www/build/p-76c2c26d.entry.js +0 -1
  183. package/www/build/p-b2420056.entry.js +0 -1
  184. package/www/build/p-bbeb69ae.entry.js +0 -1
  185. package/www/build/p-c1de287b.entry.js +0 -1
  186. package/www/build/p-d147e995.entry.js +0 -1
  187. package/www/build/p-d8de02a7.entry.js +0 -1
  188. package/www/build/p-e78ce8ec.entry.js +0 -1
  189. package/www/build/p-f01f4e9b.entry.js +0 -16
  190. /package/dist/collection/{components/navigation → deprecated}/z-link/index.js +0 -0
  191. /package/dist/collection/{components/navigation → deprecated}/z-link/styles.css +0 -0
@@ -0,0 +1,1042 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a2ca4b97.js';
2
+ import { O as OffCanvasVariant, v as TransitionDirection, B as ButtonVariant, e as ControlSize, c as ButtonType, D as DividerSize, h as DividerOrientation, k as LabelPosition, I as InputType, i as ListSize, m as ListType, j as ExpandableListButtonAlign, l as ListDividerType, E as ExpandableListStyle, g as KeyboardCode } from './index-03c8b0f0.js';
3
+ import { I as ICONS } from './icons-4b57811d.js';
4
+ import { r as randomId, b as boolean, h as handleEnterKeydSubmit } from './utils-4d2d99d9.js';
5
+ import './breakpoints-9b81eb1b.js';
6
+
7
+ const stylesCss$a = ":host{--app-header-typography-1-size:24px;--app-header-typography-2-size:28px;--app-header-typography-3-size:32px;--app-header-typography-4-size:36px;--app-header-typography-5-size:42px;--app-header-typography-6-size:48px;--app-header-typography-7-size:54px;--app-header-typography-8-size:60px;--app-header-typography-9-size:68px;--app-header-typography-10-size:76px;--app-header-typography-11-size:84px;--app-header-typography-12-size:92px;--app-header-typography-1-lineheight:1.33;--app-header-typography-2-lineheight:1.29;--app-header-typography-3-lineheight:1.25;--app-header-typography-4-lineheight:1.24;--app-header-typography-5-lineheight:1.24;--app-header-typography-6-lineheight:1.25;--app-header-typography-7-lineheight:1.2;--app-header-typography-8-lineheight:1.26;--app-header-typography-9-lineheight:1.24;--app-header-typography-10-lineheight:1.26;--app-header-typography-11-lineheight:1.2;--app-header-typography-12-lineheight:1.2;--app-header-typography-1-tracking:calc(-0.2 / 1em);--app-header-typography-2-tracking:calc(-0.4 / 1em);--app-header-typography-3-tracking:calc(-0.6 / 1em);--app-header-typography-4-tracking:calc(-0.8 / 1em);--app-header-typography-5-tracking:calc(-1 / 1em);--app-header-typography-6-tracking:calc(-1.2 / 1em);--app-header-typography-7-tracking:calc(-1.4 / 1em);--app-header-typography-8-tracking:calc(-1.6 / 1em);--app-header-typography-9-tracking:calc(-1.8 / 1em);--app-header-typography-10-tracking:calc(-2 / 1em);--app-header-typography-11-tracking:calc(-2.2 / 1em);--app-header-typography-12-tracking:calc(-2.4 / 1em);--app-header-content-max-width:100%;--app-header-height:auto;--app-header-top-offset:48px;--app-header-drawer-trigger-size:calc(var(--space-unit) * 4);--app-header-bg:var(--color-surface01);--app-header-stucked-bg:var(--color-surface01);--app-header-text-color:var(--color-text01);--app-header-title-font-size:var(--app-header-typography-3-size);--app-header-title-lineheight:var(--app-header-typography-3-lineheight);--app-header-title-letter-spacing:var(--app-header-typography-3-tracking);--app-header-stucked-text-color:var(--color-text01);position:relative;display:block;height:var(--app-header-height);color:var(--app-header-text-color)}:host,*{box-sizing:border-box}.heading-panel{position:relative;display:flex;width:100%;max-width:var(--app-header-content-max-width);flex-direction:column;flex-grow:0;flex-shrink:0;align-items:baseline;padding:var(--grid-margin);margin:0 auto;background:var(--app-header-bg);gap:calc(var(--space-unit) * 2) calc(var(--space-unit) * 5)}.hero-container+.heading-panel{background:transparent}:host(:empty) .heading-panel{padding:0}.heading-container{position:relative;z-index:1;display:flex;width:100%;max-width:100%;flex:1 auto;flex-direction:column;justify-content:flex-start}.heading-title{display:flex;max-width:100%;flex-direction:row;align-items:flex-start;column-gap:calc(var(--space-unit) * 2)}::slotted([slot=\"title\"]),.heading-stuck .heading-title>*,::slotted([slot=\"stucked-title\"]){margin:0;font-family:\"IBM Plex Serif\", serif;font-weight:var(--font-bd)}::slotted([slot=\"title\"]){font-size:var(--app-header-title-font-size);letter-spacing:var(--app-header-title-letter-spacing);line-height:var(--app-header-title-lineheight)}.heading-stuck .heading-title>*,::slotted([slot=\"stucked-title\"]){font-size:var(--app-header-typography-3-size);letter-spacing:var(--app-header-typography-3-tracking);line-height:var(--app-header-typography-3-lineheight)}:host(:not([menu-length=\"0\"])) .heading-subtitle{padding-left:calc(var(--app-header-drawer-trigger-size) + (var(--space-unit) * 2))}::slotted([slot=\"subtitle\"]){margin:0;font-family:var(--font-family-sans);font-size:20px;font-style:italic;font-weight:500;line-height:26px}.menu-container{display:flex;width:100%;flex:1 auto;flex-flow:row wrap}:host([menu-length=\"0\"]:not([enable-search])) .menu-container,.menu-container:empty{display:none}.menu-container ::slotted([open]){position:relative;z-index:3}z-searchbar{z-index:0;display:flex;width:auto;min-width:calc(var(--space-unit) * 32);flex:1 auto;align-items:center;margin-left:auto}.heading-stuck{position:fixed;z-index:20;top:var(--app-header-top-offset);left:0;width:100%;max-width:100%;animation:slide-stuck-heading-in 250ms ease-out;background:var(--app-header-stucked-bg);box-shadow:var(--shadow-2);color:var(--app-header-stucked-text-color)}.heading-stuck-content{display:flex;max-width:var(--app-header-content-max-width);align-items:center;padding:var(--space-unit) var(--grid-margin);margin:0 auto;column-gap:calc(var(--space-unit) * 2)}.heading-stuck .heading-title>*,.heading-stuck .heading-title ::slotted([slot=\"stucked-title\"]){display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.heading-stuck-content z-button{margin-left:auto}.drawer-trigger{padding:0;border:0;margin:0;appearance:none;background:none;border-radius:0;color:inherit;cursor:pointer}.drawer-trigger z-icon{--z-icon-width:var(--app-header-drawer-trigger-size);--z-icon-height:var(--app-header-drawer-trigger-size);fill:currentcolor}.heading-container :is(.drawer-trigger,z-button.search-page-button){display:flex;height:calc(var(--app-header-title-font-size) * var(--app-header-title-lineheight));align-items:center}.heading-container z-button.search-page-button{margin-left:auto}.drawer-content{display:none}z-offcanvas[open] .drawer-content{display:flex;width:100%;flex:1 auto;flex-direction:column;row-gap:calc(var(--space-unit) * 2.5)}z-offcanvas[open] .drawer-content ::slotted(z-menu){width:100%}.drawer-close{--z-icon-width:var(--app-header-drawer-trigger-size);--z-icon-height:var(--app-header-drawer-trigger-size);padding:0;border:0;margin:var(--space-unit) 0 calc(var(--space-unit) * 2.5);appearance:none;background:transparent;border-radius:0;color:inherit;cursor:pointer;fill:currentcolor;font-size:inherit;outline:none}.drawer-close:focus-visible{box-shadow:var(--shadow-focus-primary)}.hero-container{position:absolute;z-index:0;top:0;left:0;width:100%;height:100%}:host([overlay]) .heading-panel .drawer-trigger z-icon,:host([overlay]) .heading-panel .heading-container,:host([overlay]) .heading-panel .menu-container{color:var(--color-white);fill:var(--color-white)}:host([overlay]) .heading-panel .menu-container ::slotted(z-menu){--z-menu-label-color:var(--color-white)}:host([overlay]) .hero-container::after{position:absolute;z-index:0;top:0;left:0;width:100%;height:100%;background:var(--color-black);content:\"\";opacity:0.5}.hero-container img,.hero-container ::slotted(*){position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;object-position:top center;-webkit-user-drag:none}@media (min-width: 768px){:host{--app-header-title-font-size:var(--app-header-typography-6-size);--app-header-title-lineheight:var(--app-header-typography-6-lineheight);--app-header-title-letter-spacing:var(--app-header-typography-6-tracking)}.heading-panel{flex-flow:row wrap;align-items:center;padding-bottom:calc(var(--space-unit) * 2)}.heading-container{margin-right:auto}:host(:is([flow=\"offcanvas\"],[menu-length=\"0\"])) :is(.heading-container,.menu-container){width:auto}:host(:not([flow=\"offcanvas\"])) .heading-subtitle{padding-left:0}.menu-container{flex:initial;align-items:center}:host([menu-length=\"0\"]) .menu-container:not(:empty){height:calc(var(--app-header-title-font-size) * var(--app-header-title-lineheight))}:host(:not([flow=\"offcanvas\"])) .menu-container{gap:var(--space-unit) calc(var(--space-unit) * 5)}:host(:not([flow=\"offcanvas\"])) .heading-container .drawer-trigger{display:none}}@media (min-width: 1152px){:host{--app-header-title-font-size:var(--app-header-typography-7-size);--app-header-title-lineheight:var(--app-header-typography-7-lineheight);--app-header-title-letter-spacing:var(--app-header-typography-7-tracking)}.heading-panel{justify-content:flex-start;padding-bottom:calc(var(--space-unit) * 3)}.heading-container,.menu-container{width:auto}:host([flow=\"stack\"]) .heading-panel{flex-flow:column;align-items:flex-start}:host([flow=\"stack\"]) .menu-container{width:100%}:host(:not([flow=\"offcanvas\"],[menu-length=\"0\"])) .heading-panel{row-gap:calc(var(--space-unit) * 3)}z-searchbar{min-width:calc(var(--space-unit) * 45);flex:initial}}@media (min-width: 1366px){:host{--app-header-title-font-size:var(--app-header-typography-9-size);--app-header-title-lineheight:var(--app-header-typography-9-lineheight);--app-header-title-letter-spacing:var(--app-header-typography-9-tracking)}}@keyframes slide-stuck-heading-in{0%{transform:translate3d(0, -100%, 0)}100%{transform:none}}";
8
+
9
+ const SUPPORT_INTERSECTION_OBSERVER = typeof IntersectionObserver !== "undefined";
10
+ const ZAppHeader = class {
11
+ constructor(hostRef) {
12
+ registerInstance(this, hostRef);
13
+ this.sticking = createEvent(this, "sticking", 7);
14
+ /**
15
+ * Stuck mode for the header.
16
+ * You can programmatically set it using an IntersectionObserver.
17
+ */
18
+ this.stuck = false;
19
+ /**
20
+ * Should place an overlay over the hero image.
21
+ * Useful for legibility purpose.
22
+ */
23
+ this.overlay = false;
24
+ /**
25
+ * Control menu bar position in the header.
26
+ * - auto: the menu bar is positioned near the title
27
+ * - stack: the menu bar is positioned below the title
28
+ * - offcanvas: the menu bar is not displayed and a burger icon appears to open the offcanvas menu
29
+ */
30
+ this.flow = "auto";
31
+ /**
32
+ * The opening state of the drawer.
33
+ */
34
+ this.drawerOpen = false;
35
+ /**
36
+ * Enable the search bar.
37
+ */
38
+ this.enableSearch = false;
39
+ /**
40
+ * Placeholder text for the search bar.
41
+ */
42
+ this.searchPlaceholder = "Cerca";
43
+ /**
44
+ * Search string for the search bar.
45
+ */
46
+ this.searchString = "";
47
+ /**
48
+ * The stuck state of the bar.
49
+ */
50
+ this._stuck = false;
51
+ /**
52
+ * Current viewport.
53
+ * Used to change the aspect of the search button (icon only) on mobile and tablet.
54
+ */
55
+ this.currentViewport = "mobile";
56
+ this.observer = SUPPORT_INTERSECTION_OBSERVER &&
57
+ new IntersectionObserver(([entry]) => {
58
+ this._stuck = !entry.isIntersecting;
59
+ }, {
60
+ threshold: 0.5,
61
+ });
62
+ this.openDrawer = this.openDrawer.bind(this);
63
+ this.closeDrawer = this.closeDrawer.bind(this);
64
+ this.collectMenuElements = this.collectMenuElements.bind(this);
65
+ }
66
+ evaluateViewport() {
67
+ if (window.innerWidth < 768) {
68
+ this.currentViewport = "mobile";
69
+ }
70
+ else if (window.innerWidth >= 768 && window.innerWidth < 1152) {
71
+ this.currentViewport = "tablet";
72
+ }
73
+ else {
74
+ this.currentViewport = "desktop";
75
+ }
76
+ }
77
+ onStuck() {
78
+ const scrollParent = this.scrollParent;
79
+ if (!scrollParent) {
80
+ return;
81
+ }
82
+ this.sticking.emit(this._stuck);
83
+ }
84
+ setMenuFloatingMode() {
85
+ if (this.menuElements.length === 0) {
86
+ return;
87
+ }
88
+ const elements = this.menuElements;
89
+ elements.forEach((element) => {
90
+ element.open = false;
91
+ element.floating = !this.drawerOpen;
92
+ element.verticalContext = this.drawerOpen;
93
+ });
94
+ }
95
+ get title() {
96
+ const titleElement = this.hostElement.querySelector('[slot="title"]');
97
+ if (titleElement === null) {
98
+ return "";
99
+ }
100
+ return titleElement.textContent.trim();
101
+ }
102
+ get scrollParent() {
103
+ const parent = this.hostElement.offsetParent;
104
+ if (parent === document.body || parent === document.documentElement) {
105
+ return window;
106
+ }
107
+ return parent;
108
+ }
109
+ get canShowMenu() {
110
+ return this.flow !== "offcanvas" && this.currentViewport !== "mobile" && !this.drawerOpen;
111
+ }
112
+ get canShowSearchbar() {
113
+ if (!this.enableSearch) {
114
+ return false;
115
+ }
116
+ // Always show the searchbar on desktop, even if a searchPageUrl is set
117
+ if (this.searchPageUrl) {
118
+ return this.currentViewport === "desktop";
119
+ }
120
+ return true;
121
+ }
122
+ /**
123
+ * Whether the header has a hero image, either as a prop or as a slot.
124
+ */
125
+ get hasHero() {
126
+ return !!this.hero || this.hostElement.querySelector("[slot=hero]") !== null;
127
+ }
128
+ openDrawer() {
129
+ this.drawerOpen = true;
130
+ }
131
+ closeDrawer() {
132
+ this.drawerOpen = false;
133
+ }
134
+ collectMenuElements() {
135
+ const menuElements = (this.menuElements = this.hostElement.querySelectorAll('[slot="menu"]'));
136
+ this.menuLength = menuElements.length;
137
+ this.setMenuFloatingMode();
138
+ }
139
+ enableStuckObserver() {
140
+ if (this.observer) {
141
+ this.observer.observe(this.container);
142
+ }
143
+ }
144
+ disableStuckMode() {
145
+ this._stuck = false;
146
+ if (this.observer) {
147
+ this.observer.unobserve(this.container);
148
+ }
149
+ }
150
+ onStuckMode() {
151
+ if (this.stuck) {
152
+ this.enableStuckObserver();
153
+ }
154
+ else {
155
+ this.disableStuckMode();
156
+ }
157
+ }
158
+ renderSearchLinkButton() {
159
+ if (!this.enableSearch || !this.searchPageUrl || this.currentViewport === "desktop") {
160
+ return null;
161
+ }
162
+ return (h("z-button", { class: "search-page-button", variant: ButtonVariant.SECONDARY, href: this.searchPageUrl, icon: "search", size: ControlSize.X_SMALL }));
163
+ }
164
+ renderSeachbar(searchButtonIconOnly) {
165
+ return (h("z-searchbar", { value: this.searchString, placeholder: this.searchPlaceholder, showSearchButton: true, searchButtonIconOnly: searchButtonIconOnly, size: ControlSize.X_SMALL, variant: ButtonVariant.SECONDARY, preventSubmit: this.searchString.length < 3, onSearchTyping: (e) => (this.searchString = e.detail) }));
166
+ }
167
+ componentDidLoad() {
168
+ this.collectMenuElements();
169
+ this.onStuckMode();
170
+ this.evaluateViewport();
171
+ }
172
+ render() {
173
+ return (h(Host, { "menu-length": this.menuLength }, this.hasHero && (h("div", { class: "hero-container" }, h("slot", { name: "hero" }, this.hero && (h("img", { alt: "", src: this.hero }))))), h("div", { class: "heading-panel", ref: (el) => (this.container = el) }, 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" }), this.renderSearchLinkButton()), h("div", { class: "heading-subtitle" }, h("slot", { name: "subtitle" }))), (this.canShowMenu || this.canShowSearchbar) && (h("div", { class: "menu-container" }, this.canShowMenu && (h("slot", { name: "menu", onSlotchange: this.collectMenuElements })), this.canShowSearchbar && this.renderSeachbar(this.currentViewport !== "desktop")))), h("z-offcanvas", { variant: OffCanvasVariant.OVERLAY, transitiondirection: TransitionDirection.RIGHT, open: this.drawerOpen, onCanvasOpenStatusChanged: (ev) => (this.drawerOpen = ev.detail) }, h("button", { class: "drawer-close", "aria-label": "Chiudi menu", onClick: this.closeDrawer, slot: "canvasContent" }, h("z-icon", { name: "close" })), h("div", { class: "drawer-content", slot: "canvasContent", "aria-hidden": !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)), this.renderSearchLinkButton(), this.canShowSearchbar && this.currentViewport === "desktop" && this.renderSeachbar(false))))));
174
+ }
175
+ get hostElement() { return getElement(this); }
176
+ static get watchers() { return {
177
+ "_stuck": ["onStuck"],
178
+ "drawerOpen": ["setMenuFloatingMode"],
179
+ "stuck": ["onStuckMode"]
180
+ }; }
181
+ };
182
+ ZAppHeader.style = stylesCss$a;
183
+
184
+ const stylesCss$9 = ".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)}";
185
+
186
+ const ZButton = class {
187
+ constructor(hostRef) {
188
+ registerInstance(this, hostRef);
189
+ /** defines a string value that labels an interactive element, used for accessibility. */
190
+ this.ariaLabel = "";
191
+ /** HTML button disabled attribute. */
192
+ this.disabled = false;
193
+ /** HTML button type attribute. */
194
+ this.type = ButtonType.BUTTON;
195
+ /** Graphical variant: `primary`, `secondary`, `tertiary`. Defaults to `primary`. */
196
+ this.variant = ButtonVariant.PRIMARY;
197
+ /** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */
198
+ this.size = ControlSize.BIG;
199
+ }
200
+ getAttributes() {
201
+ return {
202
+ id: this.htmlid,
203
+ class: {
204
+ "z-button--container": true,
205
+ "z-button--has-text": !!this.hostElement.textContent.trim(),
206
+ },
207
+ };
208
+ }
209
+ render() {
210
+ if (this.href) {
211
+ return (h("a", Object.assign({}, this.getAttributes(), { "aria-label": this.ariaLabel, href: this.href, target: this.target }), this.icon && (h("z-icon", { name: this.icon, width: 16, height: 16 })), h("slot", null)));
212
+ }
213
+ return (h("button", Object.assign({}, this.getAttributes(), { "aria-label": this.ariaLabel, name: this.name, type: this.type, disabled: this.disabled }), this.icon && (h("z-icon", { name: this.icon, width: 16, height: 16 })), h("slot", null)));
214
+ }
215
+ get hostElement() { return getElement(this); }
216
+ };
217
+ ZButton.style = stylesCss$9;
218
+
219
+ const stylesCss$8 = ".sc-z-divider-h{display:block;padding:0;margin:0}.divider-horizontal.sc-z-divider-h{width:100%}.divider-vertical.sc-z-divider-h{height:100%}.divider-small.divider-horizontal.sc-z-divider-h{height:var(--border-size-small)}.divider-medium.divider-horizontal.sc-z-divider-h{height:var(--border-size-medium)}.divider-large.divider-horizontal.sc-z-divider-h{height:var(--border-size-large)}.divider-small.divider-vertical.sc-z-divider-h{width:var(--border-size-small)}.divider-medium.divider-vertical.sc-z-divider-h{width:var(--border-size-medium)}.divider-large.divider-vertical.sc-z-divider-h{width:var(--border-size-large)}";
220
+
221
+ const ZDivider = class {
222
+ constructor(hostRef) {
223
+ registerInstance(this, hostRef);
224
+ /** [optional] Divider size */
225
+ this.size = DividerSize.SMALL;
226
+ /** [optional] Divider color */
227
+ this.color = "gray200";
228
+ /** [optional] Divider orintation */
229
+ this.orientation = DividerOrientation.HORIZONTAL;
230
+ }
231
+ render() {
232
+ return (h(Host, { class: `divider-${this.size} divider-${this.orientation}`, style: { backgroundColor: `var(--${this.color})` } }));
233
+ }
234
+ };
235
+ ZDivider.style = stylesCss$8;
236
+
237
+ const stylesCss$7 = ":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)}";
238
+
239
+ const ZIcon = class {
240
+ constructor(hostRef) {
241
+ registerInstance(this, hostRef);
242
+ }
243
+ selectPathOrPolygon(iconValue) {
244
+ if (iconValue === null || iconValue === void 0 ? void 0 : iconValue.startsWith("M")) {
245
+ return h("path", { d: ICONS[this.name] });
246
+ }
247
+ return h("polygon", { points: ICONS[this.name] });
248
+ }
249
+ render() {
250
+ return (h(Host, { "aria-hidden": "true" }, h("svg", { viewBox: "0 0 1000 1000", width: this.width, height: this.height, id: this.iconid, fill: this.fill ? `var(--${this.fill})` : "" }, this.selectPathOrPolygon(ICONS[this.name]))));
251
+ }
252
+ };
253
+ ZIcon.style = stylesCss$7;
254
+
255
+ const stylesCss$6 = ".sc-z-input-h{display:inline-block;width:inherit}input.sc-z-input::-ms-clear,input.sc-z-input::-ms-reveal{display:none}.sc-z-input-h input.sc-z-input::-ms-clear,.sc-z-input-h input.sc-z-input::-ms-reveal{display:none}input.sc-z-input,textarea.sc-z-input,.textarea-wrapper.sc-z-input{box-sizing:border-box;border:var(--border-size-small) solid var(--color-surface04);background:var(--color-input-field01);border-radius:var(--border-radius-small);color:var(--color-text01);fill:var(--color-icon02);font-family:var(--font-family-sans);font-size:var(--font-size-3);font-weight:var(--font-rg);outline:none}[size=\"small\"].sc-z-input-h input.sc-z-input,[size=\"small\"].sc-z-input-h textarea.sc-z-input,[size=\"small\"].sc-z-input-h .textarea-wrapper.sc-z-input,[size=\"x-small\"].sc-z-input-h input.sc-z-input,[size=\"x-small\"].sc-z-input-h textarea.sc-z-input,[size=\"x-small\"].sc-z-input-h .textarea-wrapper.sc-z-input{font-size:var(--font-size-2)}.cursor-select.sc-z-input-h input.sc-z-input{cursor:pointer}.sc-z-input-h:not(.active-select) input.sc-z-input:focus:focus-visible,.textarea-wrapper.sc-z-input:focus-within{box-shadow:var(--shadow-focus-primary)}input.sc-z-input:focus:focus-visible,textarea.sc-z-input:focus:focus-visible{color:var(--color-primary02)}.active-select.sc-z-input-h input.sc-z-input{border:var(--border-size-small) solid var(--blue500)}.cursor-select.sc-z-input-h input.sc-z-input:focus:focus-visible{box-shadow:var(--shadow-focus-primary)}.sc-z-input-h input[readonly].sc-z-input:focus:focus-visible{box-shadow:none}.filled.sc-z-input{border-color:var(--color-surface05)}.input-success.sc-z-input{border-color:var(--color-success01);background:var(--color-success-inverse);fill:var(--color-success01)}.input-error.sc-z-input{border-color:var(--color-error01);background:var(--color-error-inverse);fill:var(--color-error01)}.input-warning.sc-z-input{border-color:var(--color-warning01);background:var(--color-warning-inverse);fill:var(--color-warning01)}input.sc-z-input:hover,.textarea-wrapper.sc-z-input:hover{outline:var(--border-size-medium) solid var(--color-surface04);outline-offset:-2px}.sc-z-input-h:not(.active-select) input[readonly].sc-z-input,.readonly.sc-z-input{border-color:var(--color-disabled01);fill:var(--color-disabled01);pointer-events:none}[disabled].sc-z-input-h:not([disabled=\"false\"]) input.sc-z-input,[disabled].sc-z-input-h:not([disabled=\"false\"]) .textarea-wrapper.sc-z-input,[disabled].sc-z-input-h:not([disabled=\"false\"]) z-icon.sc-z-input{border-color:var(--color-disabled01);box-shadow:none;color:var(--color-disabled02);fill:var(--color-disabled01);pointer-events:none}[disabled].sc-z-input-h:not([disabled=\"false\"]) input.sc-z-input:hover{border-width:var(--border-size-small)}input.sc-z-input::placeholder,textarea.sc-z-input::placeholder{color:var(--color-text05)}.sc-z-input::-webkit-textarea-placeholder{color:var(--color-text05)}.sc-z-input:-ms-textarea-placeholder{color:var(--color-text05)}.sc-z-input::placeholder{color:var(--color-text05)}label.input-label.sc-z-input{display:block;padding-bottom:var(--space-unit);color:var(--color-text02);font-family:var(--font-family-sans);font-size:var(--font-size-1);font-weight:var(--font-sb);text-align:left;text-transform:uppercase}[disabled].sc-z-input-h:not([disabled=\"false\"]) label.input-label.sc-z-input{color:var(--color-disabled02)}.text-wrapper.sc-z-input>div.sc-z-input{position:relative;z-index:1;fill:var(--color-icon02)}.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input{width:100%;height:calc(var(--space-unit) * 5.5);box-sizing:border-box;padding:0 calc(var(--space-unit) * 1.5);margin:0}[size=\"small\"].sc-z-input-h .text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input{height:calc(var(--space-unit) * 4.5)}[size=\"x-small\"].sc-z-input-h .text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input{height:calc(var(--space-unit) * 4)}.text-wrapper.sc-z-input>div.sc-z-input>input.has-icon.sc-z-input,.text-wrapper.sc-z-input>div.sc-z-input>input.has-clear-icon.sc-z-input{padding-right:calc(var(--space-unit) * 5.25)}.text-wrapper.sc-z-input>div.sc-z-input>input.has-icon.has-clear-icon.sc-z-input{padding-right:calc(var(--space-unit) * 8)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input{position:absolute;z-index:2;top:50%;right:calc(var(--space-unit) * 1.5);display:flex;pointer-events:none;transform:translateY(-50%)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input{padding:0;border:0;background:none;color:inherit;font:inherit;pointer-events:initial}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input+button.icon-button.sc-z-input{margin-left:calc(var(--space-unit) * 0.5)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.hidden.sc-z-input{display:none}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.reset-icon.sc-z-input,.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.toggle-password-icon.sc-z-input{cursor:pointer}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input>z-icon.sc-z-input{--z-icon-width:18px;--z-icon-height:18px;display:block}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input>z-icon.small.sc-z-input,.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input>z-icon.x-small.sc-z-input{--z-icon-width:16px;--z-icon-height:16px}.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill,.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill:hover,.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill:focus,.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill:active{background:var(--color-white) !important;background-clip:text !important;-webkit-transition-delay:99999s !important}.textarea-wrapper.sc-z-input{padding:calc(var(--space-unit) * 1.5);scrollbar-color:var(--color-primary01) transparent}textarea.sc-z-input::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}textarea.sc-z-input::-webkit-scrollbar-track{background-color:transparent}textarea.sc-z-input::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}textarea.sc-z-input::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}textarea.sc-z-input{width:100%;min-height:132px;padding:0;border:none;margin:0;resize:none}.radio-wrapper.sc-z-input,.checkbox-wrapper.sc-z-input{position:relative;display:inline-flex;flex-direction:row;align-items:center;color:var(--color-text01);fill:var(--color-primary01);font-family:var(--font-family-sans)}.radio-wrapper.sc-z-input:hover,.checkbox-wrapper.sc-z-input:hover{color:var(--color-hover-primary);fill:currentcolor}.radio-wrapper.sc-z-input>input.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input{position:absolute;z-index:-1;opacity:0;pointer-events:none}.radio-wrapper.sc-z-input .radio-label.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input{display:inline-flex;align-items:center;margin:0;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:1;text-transform:inherit}.radio-wrapper.sc-z-input input.sc-z-input:not(:disabled)+.radio-label.sc-z-input,.checkbox-wrapper.sc-z-input input.sc-z-input:not(:disabled)+.checkbox-label.sc-z-input{cursor:pointer}.radio-wrapper.sc-z-input .radio-label.sc-z-input z-icon.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input z-icon.sc-z-input{cursor:pointer;fill:inherit}[size=\"small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.sc-z-input z-icon.sc-z-input,[size=\"small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input z-icon.sc-z-input{--z-icon-width:16px;--z-icon-height:16px}[size=\"small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.sc-z-input,[size=\"small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input{font-size:var(--font-size-2)}[size=\"x-small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.sc-z-input z-icon.sc-z-input,[size=\"x-small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input z-icon.sc-z-input{--z-icon-width:14px;--z-icon-height:14px}[size=\"x-small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.sc-z-input,[size=\"x-small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input{font-size:var(--font-size-1)}.radio-wrapper.sc-z-input .radio-label.after.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input{flex-direction:row}.radio-wrapper.sc-z-input .radio-label.before.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input{flex-direction:row-reverse}.radio-wrapper.sc-z-input .radio-label.after.sc-z-input>span.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input>span.sc-z-input{margin-left:var(--space-unit)}.radio-wrapper.sc-z-input .radio-label.before.sc-z-input>span.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input>span.sc-z-input{margin-right:var(--space-unit)}[size=\"small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.after.sc-z-input>span.sc-z-input,[size=\"small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input>span.sc-z-input,[size=\"x-small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.after.sc-z-input>span.sc-z-input,[size=\"x-small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input>span.sc-z-input{margin-left:calc(var(--space-unit) * 0.5)}[size=\"small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.before.sc-z-input>span.sc-z-input,[size=\"small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input>span.sc-z-input,[size=\"x-small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.before.sc-z-input>span.sc-z-input,[size=\"x-small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input>span.sc-z-input{margin-right:calc(var(--space-unit) * 0.5)}.radio-wrapper.sc-z-input>input.sc-z-input:focus:focus-visible+.radio-label.sc-z-input>z-icon.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:focus:focus-visible+.checkbox-label.sc-z-input>z-icon.sc-z-input{border-radius:var(--border-radius-small);box-shadow:var(--shadow-focus-primary)}.radio-wrapper.sc-z-input>input.sc-z-input:disabled+.radio-label.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:disabled+.checkbox-label.sc-z-input{color:var(--color-disabled02)}.radio-wrapper.sc-z-input>input.sc-z-input:disabled+.radio-label.sc-z-input>z-icon.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:disabled+.checkbox-label.sc-z-input>z-icon.sc-z-input{cursor:default;fill:var(--color-disabled01)}";
256
+
257
+ const ZInput = class {
258
+ constructor(hostRef) {
259
+ registerInstance(this, hostRef);
260
+ this.inputChange = createEvent(this, "inputChange", 7);
261
+ this.startTyping = createEvent(this, "startTyping", 7);
262
+ this.stopTyping = createEvent(this, "stopTyping", 7);
263
+ this.inputCheck = createEvent(this, "inputCheck", 7);
264
+ /** the id of the input element */
265
+ this.htmlid = `id-${randomId()}`;
266
+ /** the input aria-label */
267
+ this.ariaLabel = "";
268
+ /** the input is disabled */
269
+ this.disabled = false;
270
+ /** the input is readonly */
271
+ this.readonly = false;
272
+ /** the input is required (optional): available for text, password, number, email, textarea, checkbox */
273
+ this.required = false;
274
+ /** checked: available for checkbox, radio */
275
+ this.checked = false;
276
+ /** input helper message (optional): available for text, password, number, email, textarea - if set to `false` message won't be displayed */
277
+ this.message = true;
278
+ /** the input label position: available for checkbox, radio */
279
+ this.labelPosition = LabelPosition.RIGHT;
280
+ /** render clear icon when typing (optional): available for text */
281
+ this.hasclearicon = true;
282
+ /** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */
283
+ this.size = ControlSize.BIG;
284
+ this.isTyping = false;
285
+ this.passwordHidden = true;
286
+ this.typingtimeout = 300;
287
+ }
288
+ inputCheckListener(e) {
289
+ const data = e.detail;
290
+ switch (this.type) {
291
+ case InputType.RADIO:
292
+ if (data.type === InputType.RADIO && data.name === this.name && data.id !== this.htmlid) {
293
+ this.checked = false;
294
+ }
295
+ break;
296
+ }
297
+ }
298
+ /** get checked status */
299
+ async isChecked() {
300
+ switch (this.type) {
301
+ case InputType.CHECKBOX:
302
+ case InputType.RADIO:
303
+ return this.checked;
304
+ default:
305
+ console.warn("`isChecked` method is only available for type `checkbox` and `radio`");
306
+ return false;
307
+ }
308
+ }
309
+ emitInputChange(value) {
310
+ if (!this.isTyping) {
311
+ this.emitStartTyping();
312
+ }
313
+ let validity;
314
+ if (this.type === InputType.TEXTAREA) {
315
+ validity = this.getValidity("textarea");
316
+ }
317
+ else {
318
+ validity = this.getValidity("input");
319
+ }
320
+ this.value = value;
321
+ this.inputChange.emit({ value, validity });
322
+ clearTimeout(this.timer);
323
+ this.timer = setTimeout(() => {
324
+ this.emitStopTyping(this.value, validity);
325
+ }, this.typingtimeout);
326
+ }
327
+ emitStartTyping() {
328
+ this.isTyping = true;
329
+ this.startTyping.emit();
330
+ }
331
+ emitStopTyping(value, validity) {
332
+ this.isTyping = false;
333
+ this.stopTyping.emit({
334
+ value: value,
335
+ validity: validity,
336
+ });
337
+ }
338
+ emitInputCheck(checked) {
339
+ this.inputCheck.emit({
340
+ id: this.htmlid,
341
+ checked: checked,
342
+ type: this.type,
343
+ name: this.name,
344
+ value: this.value,
345
+ validity: this.getValidity("input"),
346
+ });
347
+ }
348
+ getValidity(type) {
349
+ const input = this.hostElement.querySelector(type);
350
+ return input.validity;
351
+ }
352
+ /* START text/password/email/number */
353
+ getTextAttributes() {
354
+ return {
355
+ id: this.htmlid,
356
+ name: this.name,
357
+ placeholder: this.placeholder,
358
+ value: this.value,
359
+ disabled: this.disabled,
360
+ readonly: this.readonly,
361
+ required: this.required,
362
+ title: this.htmltitle,
363
+ class: {
364
+ [`input-${this.status}`]: !!this.status,
365
+ filled: !!this.value,
366
+ },
367
+ autocomplete: this.autocomplete,
368
+ onInput: (e) => this.emitInputChange(e.target.value),
369
+ };
370
+ }
371
+ getNumberAttributes(type) {
372
+ if (type != InputType.NUMBER) {
373
+ return;
374
+ }
375
+ return {
376
+ min: this.min,
377
+ max: this.max,
378
+ step: this.step,
379
+ };
380
+ }
381
+ getPatternAttribute(type) {
382
+ if (type != InputType.PASSWORD &&
383
+ type != InputType.TEXT &&
384
+ type != InputType.TEL &&
385
+ type != InputType.SEARCH &&
386
+ type != InputType.URL &&
387
+ type != InputType.EMAIL) {
388
+ return;
389
+ }
390
+ return {
391
+ pattern: this.pattern,
392
+ };
393
+ }
394
+ renderInputText(type = InputType.TEXT) {
395
+ const ariaLabel = this.ariaLabel ? { "aria-label": this.ariaLabel } : {};
396
+ const attr = Object.assign(Object.assign(Object.assign(Object.assign({}, this.getTextAttributes()), this.getNumberAttributes(type)), this.getPatternAttribute(type)), ariaLabel);
397
+ if (this.icon || type === InputType.PASSWORD) {
398
+ Object.assign(attr.class, { "has-icon": true });
399
+ }
400
+ if (this.hasclearicon && type != InputType.NUMBER) {
401
+ Object.assign(attr.class, { "has-clear-icon": true });
402
+ }
403
+ return (h("div", { class: "text-wrapper" }, this.renderLabel(), h("div", null, h("input", Object.assign({ type: type === InputType.PASSWORD && !this.passwordHidden ? InputType.TEXT : type }, attr, { ref: (el) => (this.inputRef = el) })), this.renderIcons()), this.renderMessage()));
404
+ }
405
+ renderLabel() {
406
+ if (!this.label) {
407
+ return;
408
+ }
409
+ return (h("label", { class: "input-label body-5-sb", id: `${this.htmlid}_label`, htmlFor: this.htmlid }, this.label));
410
+ }
411
+ renderIcons() {
412
+ return (h("span", { class: "icons-wrapper" }, this.renderResetIcon(), this.renderIcon()));
413
+ }
414
+ renderIcon() {
415
+ if (this.type === InputType.PASSWORD) {
416
+ return this.renderShowHidePassword();
417
+ }
418
+ if (!this.icon) {
419
+ return;
420
+ }
421
+ return (h("button", { type: "button", class: "icon-button input-icon", tabIndex: -1 }, h("z-icon", { name: this.icon, class: this.size })));
422
+ }
423
+ renderResetIcon() {
424
+ let hidden = false;
425
+ if (!this.hasclearicon || !this.value || this.disabled || this.readonly || this.type == InputType.NUMBER) {
426
+ hidden = true;
427
+ }
428
+ return (h("button", { type: "button", class: `icon-button reset-icon ${hidden ? "hidden" : ""}`, "aria-label": "cancella il contenuto dell'input", onClick: () => {
429
+ this.inputRef.value = "";
430
+ this.emitInputChange("");
431
+ } }, h("z-icon", { name: "multiply", class: this.size })));
432
+ }
433
+ renderShowHidePassword() {
434
+ return (h("button", { type: "button", class: "icon-button toggle-password-icon", disabled: this.disabled, "aria-label": this.passwordHidden ? "mostra password" : "nascondi password", onClick: () => (this.passwordHidden = !this.passwordHidden) }, h("z-icon", { name: this.passwordHidden ? "view-filled" : "view-off-filled", class: this.size })));
435
+ }
436
+ renderMessage() {
437
+ if (boolean(this.message) === false) {
438
+ return;
439
+ }
440
+ return (h("z-input-message", { message: boolean(this.message) === true ? undefined : this.message, status: this.status, class: this.size }));
441
+ }
442
+ /* END text/password/email/number */
443
+ /* START textarea */
444
+ renderTextarea() {
445
+ const attributes = this.getTextAttributes();
446
+ const ariaLabel = this.ariaLabel ? { "aria-label": this.ariaLabel } : {};
447
+ return (h("div", { class: "text-wrapper" }, this.renderLabel(), h("div", { class: Object.assign(Object.assign({}, attributes.class), { "textarea-wrapper": true, "readonly": attributes.readonly }) }, h("textarea", Object.assign({}, attributes, ariaLabel))), this.renderMessage()));
448
+ }
449
+ /* END textarea */
450
+ handleCheck(ev) {
451
+ this.checked = ev.target.checked;
452
+ this.emitInputCheck(this.checked);
453
+ }
454
+ /* START checkbox */
455
+ renderCheckbox() {
456
+ return (h("div", { class: "checkbox-wrapper" }, h("input", { id: this.htmlid, type: "checkbox", name: this.name, checked: this.checked, disabled: this.disabled, readonly: this.readonly, required: this.required, onChange: this.handleCheck.bind(this), value: this.value }), h("label", { htmlFor: this.htmlid, class: {
457
+ "checkbox-label": true,
458
+ "after": this.labelPosition === LabelPosition.RIGHT,
459
+ "before": this.labelPosition === LabelPosition.LEFT,
460
+ } }, h("z-icon", { name: this.checked ? "checkbox-checked" : "checkbox", "aria-hidden": "true", class: this.size }), this.label && h("span", { innerHTML: this.label }))));
461
+ }
462
+ /* END checkbox */
463
+ /* START radio */
464
+ renderRadio() {
465
+ return (h("div", { class: "radio-wrapper" }, h("input", { id: this.htmlid, type: "radio", name: this.name, checked: this.checked, disabled: this.disabled, readonly: this.readonly, onChange: this.handleCheck.bind(this), value: this.value }), h("label", { htmlFor: this.htmlid, class: {
466
+ "radio-label": true,
467
+ "after": this.labelPosition === LabelPosition.RIGHT,
468
+ "before": this.labelPosition === LabelPosition.LEFT,
469
+ } }, h("z-icon", { name: this.checked ? "radio-button-checked" : "radio-button", "aria-hidden": "true", class: this.size }), this.label && h("span", { innerHTML: this.label }))));
470
+ }
471
+ /* END radio */
472
+ render() {
473
+ let input;
474
+ switch (this.type) {
475
+ case InputType.TEXTAREA:
476
+ input = this.renderTextarea();
477
+ break;
478
+ case InputType.CHECKBOX:
479
+ input = this.renderCheckbox();
480
+ break;
481
+ case InputType.RADIO:
482
+ input = this.renderRadio();
483
+ break;
484
+ default:
485
+ input = this.renderInputText(this.type);
486
+ }
487
+ return h(Host, null, input);
488
+ }
489
+ get hostElement() { return getElement(this); }
490
+ };
491
+ ZInput.style = stylesCss$6;
492
+
493
+ const stylesCss$5 = ":host{display:flex;min-height:calc(var(--space-unit) * 2.5);align-items:start;margin-top:var(--space-unit);color:var(--color-text05);fill:currentcolor;font-family:var(--font-family-sans);font-size:var(--font-size-2);letter-spacing:0.16px}:host(.small),:host(.x-small){margin-top:calc(var(--space-unit) * 0.5);font-size:var(--font-size-1)}:host([status=\"success\"]){color:var(--color-text-success)}:host([status=\"error\"]){color:var(--color-text-error)}:host([status=\"warning\"]){color:var(--color-warning02)}:host(:focus){outline:none}:host>z-icon{--z-icon-width:calc(var(--space-unit) * 2);--z-icon-height:calc(var(--space-unit) * 2);--z-icon-right-margin:var(--space-unit);margin-top:calc(var(--space-unit) * 0.25)}:host(.small)>z-icon,:host(.x-small)>z-icon{--z-icon-width:14px;--z-icon-height:14px;--z-icon-right-margin:calc(var(--space-unit) * 0.5)}";
494
+
495
+ const ZInputMessage = class {
496
+ constructor(hostRef) {
497
+ registerInstance(this, hostRef);
498
+ this.statusIcons = {
499
+ success: "checkmark-circle",
500
+ error: "multiply-circled",
501
+ warning: "exclamation-circle",
502
+ };
503
+ this.statusRole = {};
504
+ }
505
+ onMessageChange() {
506
+ this.statusRole = this.message && this.status ? { role: "alert" } : {};
507
+ }
508
+ componentWillLoad() {
509
+ this.onMessageChange();
510
+ }
511
+ render() {
512
+ return (h(Host, Object.assign({}, this.statusRole, { "aria-label": this.message }), this.statusIcons[this.status] && this.message && h("z-icon", { name: this.statusIcons[this.status] }), h("span", { innerHTML: this.message })));
513
+ }
514
+ static get watchers() { return {
515
+ "message": ["onMessageChange"],
516
+ "status": ["onMessageChange"]
517
+ }; }
518
+ };
519
+ ZInputMessage.style = stylesCss$5;
520
+
521
+ const stylesCss$4 = ":host{display:flex;flex-direction:column;font-family:var(--font-family-sans);font-weight:var(--font-rg)}";
522
+
523
+ const ZList = class {
524
+ constructor(hostRef) {
525
+ registerInstance(this, hostRef);
526
+ /**
527
+ * [optional] Sets size of inside elements.
528
+ */
529
+ this.size = ListSize.MEDIUM;
530
+ /**
531
+ * [optional] type of the list marker for each element
532
+ */
533
+ this.listType = ListType.NONE;
534
+ }
535
+ setChildrenSizeType() {
536
+ const children = this.host.children;
537
+ for (let i = 0; i < children.length; i++) {
538
+ children[i].setAttribute("size", this.size);
539
+ children[i].setAttribute("list-type", this.listType);
540
+ children[i].setAttribute("list-element-position", (i + 1).toString());
541
+ }
542
+ }
543
+ componentDidLoad() {
544
+ this.setChildrenSizeType();
545
+ }
546
+ render() {
547
+ return (h(Host, { role: "list" }, h("slot", null)));
548
+ }
549
+ get host() { return getElement(this); }
550
+ };
551
+ ZList.style = stylesCss$4;
552
+
553
+ const stylesCss$3 = ":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}";
554
+
555
+ const ZListElement = class {
556
+ /**
557
+ * Constructor.
558
+ */
559
+ constructor(hostRef) {
560
+ registerInstance(this, hostRef);
561
+ this.accessibleFocus = createEvent(this, "accessibleFocus", 7);
562
+ this.clickItem = createEvent(this, "clickItem", 7);
563
+ /**
564
+ * [optional] Align expandable button left or right.
565
+ */
566
+ this.alignButton = ExpandableListButtonAlign.LEFT;
567
+ /**
568
+ * [optional] Sets element clickable.
569
+ */
570
+ this.clickable = false;
571
+ /**
572
+ * [optional] Sets the divider color.
573
+ */
574
+ this.dividerColor = "color-surface03";
575
+ /**
576
+ * [optional] Sets the position where to insert the divider.
577
+ */
578
+ this.dividerType = ListDividerType.NONE;
579
+ /**
580
+ * [optional] Sets the divider size.
581
+ */
582
+ this.dividerSize = DividerSize.SMALL;
583
+ /**
584
+ * [optional] Sets element as expandable.
585
+ */
586
+ this.expandable = false;
587
+ /**
588
+ * [optional] Sets expandable style to element.
589
+ */
590
+ this.expandableStyle = ExpandableListStyle.ACCORDION;
591
+ /**
592
+ * [optional] Sets size of inside elements.
593
+ */
594
+ this.size = ListSize.MEDIUM;
595
+ /**
596
+ * [optional] Sets text color of the element.
597
+ */
598
+ this.color = "none";
599
+ /**
600
+ * [optional] Sets disabled style of the element.
601
+ */
602
+ this.disabled = false;
603
+ /**
604
+ * [optional] If is used in ZContextualMenu component
605
+ */
606
+ this.isContextualMenu = false;
607
+ /**
608
+ * [optional] position of the list element inside the list or the group
609
+ */
610
+ this.listElementPosition = "0";
611
+ /**
612
+ * [optional] type of the list marker for each element
613
+ */
614
+ this.listType = ListType.NONE;
615
+ this.showInnerContent = false;
616
+ this.openElementConfig = {
617
+ accordion: {
618
+ open: "minus-circled",
619
+ close: "plus-circled",
620
+ },
621
+ menu: {
622
+ open: "chevron-up",
623
+ close: "chevron-down",
624
+ },
625
+ };
626
+ this.handleClick = this.handleClick.bind(this);
627
+ this.handleKeyDown = this.handleKeyDown.bind(this);
628
+ }
629
+ accessibleFocusHandler(e) {
630
+ if (this.listElementId === e.detail) {
631
+ const toFocus = this.host.shadowRoot.getElementById(`z-list-element-id-${e.detail}`);
632
+ toFocus.focus();
633
+ }
634
+ }
635
+ /**
636
+ * Handler for click on element. If element is expandable, change state.
637
+ * @returns void
638
+ */
639
+ handleClick() {
640
+ this.clickItem.emit(this.listElementId);
641
+ if (!this.expandable) {
642
+ return;
643
+ }
644
+ this.showInnerContent = !this.showInnerContent;
645
+ }
646
+ calculateClass() {
647
+ if (this.isContextualMenu) {
648
+ return "container-contextual-menu";
649
+ }
650
+ return "container";
651
+ }
652
+ handleKeyDown(event) {
653
+ const expandByKey = event.code === KeyboardCode.ENTER;
654
+ switch (event.code) {
655
+ case KeyboardCode.ARROW_DOWN:
656
+ event.preventDefault();
657
+ this.accessibleFocus.emit(this.listElementId + 1);
658
+ break;
659
+ case KeyboardCode.ARROW_UP:
660
+ event.preventDefault();
661
+ this.accessibleFocus.emit(this.listElementId - 1);
662
+ break;
663
+ case KeyboardCode.ENTER:
664
+ event.preventDefault();
665
+ this.clickItem.emit(this.listElementId);
666
+ break;
667
+ }
668
+ if (!this.expandable || !expandByKey) {
669
+ return;
670
+ }
671
+ this.showInnerContent = !this.showInnerContent;
672
+ }
673
+ /**
674
+ * Renders button to expand element.
675
+ * @returns expadable button
676
+ */
677
+ renderExpandableButton() {
678
+ if (!this.expandable) {
679
+ return null;
680
+ }
681
+ return (h("z-icon", { name: this.showInnerContent
682
+ ? this.openElementConfig[this.expandableStyle].open
683
+ : this.openElementConfig[this.expandableStyle].close }));
684
+ }
685
+ /**
686
+ * Renders expanded content if element is expandable.
687
+ * @returns expanded content
688
+ */
689
+ renderExpandedContent() {
690
+ if (!this.expandable) {
691
+ return null;
692
+ }
693
+ return (h("div", { class: {
694
+ "z-list-element-inner-container": true,
695
+ "expanded": this.showInnerContent,
696
+ } }, h("slot", { name: "inner-content" })));
697
+ }
698
+ /**
699
+ * Renders content of the z-list-element
700
+ * @returns list content
701
+ */
702
+ renderContent() {
703
+ if (this.listType === ListType.NONE) {
704
+ return h("slot", null);
705
+ }
706
+ if (this.listType === ListType.ORDERED) {
707
+ return (h("div", { class: "z-list-content-container" }, h("div", null, this.listElementPosition, ".\u2003"), h("slot", null)));
708
+ }
709
+ if (this.listType === ListType.UNORDERED) {
710
+ return (h("div", { class: "z-list-content-container" }, h("span", null, "\u2022\u2003"), h("slot", null)));
711
+ }
712
+ }
713
+ render() {
714
+ 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 }))));
715
+ }
716
+ get host() { return getElement(this); }
717
+ };
718
+ ZListElement.style = stylesCss$3;
719
+
720
+ const stylesCss$2 = ":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)}";
721
+
722
+ const ZListGroup = class {
723
+ constructor(hostRef) {
724
+ registerInstance(this, hostRef);
725
+ /**
726
+ * [optional] Sets size of inside elements.
727
+ */
728
+ this.size = ListSize.MEDIUM;
729
+ /**
730
+ * [optional] Sets the position where to insert the divider.
731
+ */
732
+ this.dividerType = ListDividerType.NONE;
733
+ /**
734
+ * [optional] Sets the divider size.
735
+ */
736
+ this.dividerSize = DividerSize.SMALL;
737
+ /**
738
+ * [optional] Sets the divider color.
739
+ */
740
+ this.dividerColor = "gray200";
741
+ /**
742
+ * [optional] type of the list marker for each element
743
+ */
744
+ this.listType = ListType.NONE;
745
+ }
746
+ componentDidLoad() {
747
+ const children = this.host.children;
748
+ for (let i = 0; i < children.length; i++) {
749
+ if (children.length - 1 > i) {
750
+ children[i].setAttribute("divider-type", this.dividerType);
751
+ children[i].setAttribute("divider-size", this.dividerSize);
752
+ children[i].setAttribute("divider-color", this.dividerColor);
753
+ }
754
+ children[i].setAttribute("size", this.size);
755
+ children[i].setAttribute("list-type", this.listType);
756
+ children[i].setAttribute("list-element-position", i.toString());
757
+ }
758
+ }
759
+ componentWillLoad() {
760
+ this.hasHeader = !!this.host.querySelector('[slot="header-title"]');
761
+ }
762
+ render() {
763
+ return (h(Host, { role: "group" }, h("div", { class: {
764
+ "z-list-group-header-container": true,
765
+ "has-header": this.hasHeader,
766
+ } }, h("slot", { name: "header-title" }), this.dividerType === ListDividerType.HEADER && (h("z-divider", { color: this.dividerColor, size: this.dividerSize }))), h("slot", null)));
767
+ }
768
+ get host() { return getElement(this); }
769
+ };
770
+ ZListGroup.style = stylesCss$2;
771
+
772
+ const stylesCss$1 = ".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(.skip-animation)>.canvas-container.sc-z-offcanvas{animation:enter-right 0.4s ease-out}[open][transitiondirection=\"right\"].sc-z-offcanvas-h:not(.skip-animation)>.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(.skip-animation){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(.skip-animation)>.canvas-container.sc-z-offcanvas{animation:enter-right 0.4s ease-out}[open][transitiondirection=\"right\"].sc-z-offcanvas-h:not(.skip-animation)>.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}";
773
+
774
+ const ZOffcanvas = class {
775
+ constructor(hostRef) {
776
+ registerInstance(this, hostRef);
777
+ this.canvasOpenStatusChanged = createEvent(this, "canvasOpenStatusChanged", 7);
778
+ /**
779
+ * Offcanvas variant.
780
+ * Can be one `overlay` or `pushcontent`.
781
+ * Default variant: pushcontent
782
+ */
783
+ this.variant = OffCanvasVariant.PUSHCONTENT;
784
+ /** Whether the offcanvas is open. Default: false */
785
+ this.open = false;
786
+ /** open content transitioning in a specified direction left | right. Default: left */
787
+ this.transitiondirection = TransitionDirection.LEFT;
788
+ /**
789
+ * Whether to skip the initial animation.
790
+ * Useful when the initial value of the `open` prop is set to `true`.
791
+ */
792
+ this.skipLoadAnimation = false;
793
+ }
794
+ onOpenChanged() {
795
+ if (!this.open && this.skipLoadAnimation) {
796
+ this.skipLoadAnimation = false;
797
+ }
798
+ if (this.open) {
799
+ this.handlePageOverflow();
800
+ }
801
+ this.canvasOpenStatusChanged.emit(this.open);
802
+ }
803
+ handlePageOverflow() {
804
+ const overflow = this.variant === OffCanvasVariant.OVERLAY ? "overflow-y" : "overflow-x";
805
+ document.body.style[overflow] = this.open ? "hidden" : "";
806
+ }
807
+ render() {
808
+ return (h(Host, { class: { "skip-animation": this.skipLoadAnimation } }, h("div", { role: "presentation", class: "canvas-container", onTransitionEnd: () => this.handlePageOverflow() }, h("div", { role: "presentation", class: "canvas-content" }, h("slot", { name: "canvasContent" }))), this.variant == OffCanvasVariant.OVERLAY && (h("div", { class: "canvas-background", "data-action": "canvasBackground", onClick: () => (this.open = false) }))));
809
+ }
810
+ static get watchers() { return {
811
+ "open": ["onOpenChanged"]
812
+ }; }
813
+ };
814
+ ZOffcanvas.style = stylesCss$1;
815
+
816
+ const stylesCss = ":host{z-index:10;display:flex;column-gap:calc(var(--space-unit) * 2);font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host,*{box-sizing:border-box}.input-container{position:relative;display:flex;width:100%;flex-direction:column}.results-wrapper{position:absolute;top:calc(100% - 1px);left:0;width:100%;padding:calc(var(--space-unit) / 4);border:var(--border-size-small) solid var(--color-surface03);border-top:none;background:var(--color-surface01)}.results{overflow:auto;max-height:var(--z-searchbar-results-height, 540px);padding:calc(var(--space-unit) / 2) calc(var(--space-unit) * 1.5);scrollbar-color:var(--color-primary01) transparent}.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)}.results::-webkit-scrollbar-track{background-color:transparent}.results::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}.results .category-heading{display:block;font-size:var(--font-size-2);font-weight:var(--font-rg);line-height:var(--font-size-3)}.results .category-heading>*{display:block}.results .category-heading>.category{color:var(--color-text05);font-style:italic}.results .category-heading>.subcategory{margin-top:var(--space-unit);color:var(--color-text01);text-transform:uppercase}.results z-list-element{display:block}.results .item{--z-icon-height:12px;--z-icon-width:12px;display:flex;flex-flow:row nowrap;align-items:center;justify-content:flex-start;color:var(--color-text01);column-gap:calc(var(--space-unit) * 1.5);fill:var(--color-icon02);font-size:var(--font-size-2);line-height:var(--font-size-3)}.results .item.ellipsis>.item-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.results .item>.item-label mark{background:var(--color-primary03)}.results .item.has-category{padding-left:calc(var(--space-unit) * 3)}.results .item.item-search{--z-icon-height:16px;--z-icon-width:16px}.results .item-show-all{text-align:center}.results .item-no-results{display:block;font-size:var(--font-size-2);font-style:italic;line-height:var(--font-size-5)}.results .item-no-results>ul{padding-left:calc(var(--space-unit) * 2);margin:var(--space-unit)}@media (min-width: 768px){.results .category-heading{font-size:var(--font-size-3);line-height:var(--font-size-6)}.results .item{font-size:var(--font-size-3);line-height:var(--font-size-6)}.results .item.item-search{--z-icon-height:18px;--z-icon-width:18px}.results .item.ellipsis>.item-label{height:24px}}@media (min-width: 1152px){.results .item{cursor:pointer}.results .item-no-results{cursor:default;font-size:var(--font-size-3);line-height:var(--font-size-6)}}:host([size=\"small\"]) .results :is(.item,.category-heading),:host([size=\"x-small\"]) .results :is(.item,.category-heading){font-size:var(--font-size-2)}:host([size=\"small\"]) .results .item:not(.has-category),:host([size=\"x-small\"]) .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}";
817
+
818
+ const ZSearchbar = class {
819
+ constructor(hostRef) {
820
+ registerInstance(this, hostRef);
821
+ this.searchSubmit = createEvent(this, "searchSubmit", 7);
822
+ this.searchTyping = createEvent(this, "searchTyping", 7);
823
+ this.searchItemClick = createEvent(this, "searchItemClick", 7);
824
+ /** the id of the searchbar element */
825
+ this.htmlid = `searchbar-${randomId()}`;
826
+ /** Prevent submit action */
827
+ this.preventSubmit = false;
828
+ /** Show autocomplete results */
829
+ this.autocomplete = false;
830
+ /** Minimun number of characters to dispatch typing event */
831
+ this.autocompleteMinChars = 3;
832
+ /** Truncate results to single row */
833
+ this.resultsEllipsis = true;
834
+ /** Search helper text */
835
+ this.searchHelperLabel = "Cerca {searchString}";
836
+ /** Sort autocomplete results items */
837
+ this.sortResultsItems = false;
838
+ /** Show submit button */
839
+ this.showSearchButton = false;
840
+ /** Set button icon without label*/
841
+ this.searchButtonIconOnly = false;
842
+ /** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */
843
+ this.size = ControlSize.BIG;
844
+ /** Graphical variant: `primary`, `secondary`, `tertiary`. Defaults to `primary`. */
845
+ this.variant = ButtonVariant.PRIMARY;
846
+ this.searchString = this.value;
847
+ this.currResultsCount = 0;
848
+ this.showResults = false;
849
+ this.resultsItemsList = null;
850
+ }
851
+ emitSearchSubmit() {
852
+ this.searchSubmit.emit(this.inputRef.value);
853
+ }
854
+ emitSearchTyping(search) {
855
+ this.searchTyping.emit(search);
856
+ }
857
+ emitSearchItemClick(item) {
858
+ this.searchItemClick.emit(item);
859
+ }
860
+ watchItems() {
861
+ this.resultsItemsList = this.getResultsItemsList();
862
+ }
863
+ watchResultsCount() {
864
+ this.currResultsCount = this.resultsCount;
865
+ }
866
+ watchValue() {
867
+ this.searchString = this.value;
868
+ }
869
+ watchSearchString() {
870
+ this.emitSearchTyping(this.searchString);
871
+ if (!this.searchString) {
872
+ this.currResultsCount = this.resultsCount;
873
+ }
874
+ }
875
+ componentWillLoad() {
876
+ this.resultsItemsList = this.getResultsItemsList();
877
+ this.currResultsCount = this.resultsCount;
878
+ }
879
+ getResultsItemsList() {
880
+ return typeof this.resultsItems === "string" ? JSON.parse(this.resultsItems) : this.resultsItems;
881
+ }
882
+ getGroupedItems(items) {
883
+ const groupedItems = {};
884
+ items.forEach((item) => {
885
+ var _a;
886
+ const key = `${item === null || item === void 0 ? void 0 : item.category}${item === null || item === void 0 ? void 0 : item.subcategory}`;
887
+ groupedItems[key] = (_a = groupedItems[key]) !== null && _a !== void 0 ? _a : {
888
+ category: item === null || item === void 0 ? void 0 : item.category,
889
+ subcategory: item === null || item === void 0 ? void 0 : item.subcategory,
890
+ items: [],
891
+ };
892
+ groupedItems[key]["items"].push(item);
893
+ });
894
+ if (this.sortResultsItems) {
895
+ return Object.keys(groupedItems)
896
+ .sort()
897
+ .reduce((obj, key) => {
898
+ obj[key] = Object.assign(Object.assign({}, groupedItems[key]), { items: groupedItems[key]["items"].sort((a, b) => {
899
+ const nameA = a.label.toUpperCase();
900
+ const nameB = b.label.toUpperCase();
901
+ if (nameA < nameB) {
902
+ return -1;
903
+ }
904
+ if (nameA > nameB) {
905
+ return 1;
906
+ }
907
+ return 0;
908
+ }) });
909
+ return obj;
910
+ }, {});
911
+ }
912
+ return groupedItems;
913
+ }
914
+ checkResultsCount(counter) {
915
+ if (!this.currResultsCount || counter < this.currResultsCount) {
916
+ return true;
917
+ }
918
+ return false;
919
+ }
920
+ handleStopTyping(e) {
921
+ e.stopPropagation();
922
+ this.searchString = e.detail.value;
923
+ }
924
+ handleSubmit() {
925
+ if (this.preventSubmit) {
926
+ return;
927
+ }
928
+ this.emitSearchSubmit();
929
+ }
930
+ handleOutsideClick(e) {
931
+ const cp = e.composedPath();
932
+ const searchbar = cp.find((elem) => elem.nodeName === "Z-SEARCHBAR");
933
+ if (!searchbar || searchbar.htmlid !== this.htmlid) {
934
+ this.showResults = false;
935
+ return;
936
+ }
937
+ if (cp.find((elem) => { var _a; return (elem === null || elem === void 0 ? void 0 : elem.nodeName) === "Z-INPUT" || ((_a = elem === null || elem === void 0 ? void 0 : elem.classList) === null || _a === void 0 ? void 0 : _a.contains("results")); })) {
938
+ this.showResults = true;
939
+ return;
940
+ }
941
+ this.showResults = false;
942
+ }
943
+ renderInput() {
944
+ return (h("z-input", { ref: (val) => {
945
+ this.inputRef = val;
946
+ }, message: false, placeholder: this.placeholder, onStopTyping: (e) => this.handleStopTyping(e), onKeyUp: (e) => handleEnterKeydSubmit(e, () => this.handleSubmit()), value: this.value, size: this.size }));
947
+ }
948
+ renderButton() {
949
+ if (!this.showSearchButton) {
950
+ return null;
951
+ }
952
+ const iconProp = this.searchButtonIconOnly ? { icon: "search" } : null;
953
+ const buttonLabel = this.searchButtonIconOnly ? "" : "CERCA";
954
+ const defaultProps = Object.assign({ disabled: this.preventSubmit, variant: this.variant, size: this.size, onClick: () => this.handleSubmit() }, iconProp);
955
+ return h("z-button", Object.assign({}, defaultProps), buttonLabel);
956
+ }
957
+ renderResults() {
958
+ if (!this.showResults ||
959
+ !this.autocomplete ||
960
+ !this.searchString ||
961
+ this.searchString.length < this.autocompleteMinChars ||
962
+ !this.resultsItemsList) {
963
+ return null;
964
+ }
965
+ return (h("div", { class: "results-wrapper" }, h("div", { class: "results" }, this.renderResultsList())));
966
+ }
967
+ renderResultsList() {
968
+ var _a, _b;
969
+ if (this.preventSubmit && !((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length)) {
970
+ return (h("span", { class: "item item-no-results" }, "Non abbiamo trovato risultati per ", h("b", null, this.searchString), h("br", null), h("br", null), "Cosa puoi fare?", h("ul", null, h("li", null, "Verificare di aver scritto bene"), h("li", null, "Provare a cercare un'altra parola"), h("li", null, "Provare a cercare qualcosa di pi\u00F9 generico"))));
971
+ }
972
+ return (h("z-list", { role: "listbox", id: `list-${this.htmlid}` }, this.renderSearchHelper(!!((_b = this.resultsItemsList) === null || _b === void 0 ? void 0 : _b.length)), this.renderItems(), this.renderShowAllResults()));
973
+ }
974
+ renderItems() {
975
+ var _a;
976
+ if (!((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length)) {
977
+ return [];
978
+ }
979
+ const groupedItems = this.getGroupedItems(this.resultsItemsList);
980
+ const listGroups = [];
981
+ let counter = 0;
982
+ Object.values(groupedItems).forEach((groupItem, index, array) => {
983
+ if (this.checkResultsCount(counter)) {
984
+ const listGroupsElements = [];
985
+ groupItem.items.forEach((item, subindex, subarray) => {
986
+ if (this.checkResultsCount(counter)) {
987
+ const isLast = index === array.length - 1 && subindex === subarray.length - 1;
988
+ listGroupsElements.push(this.renderItem(item, subindex, !isLast));
989
+ }
990
+ counter++;
991
+ });
992
+ if (listGroupsElements.length) {
993
+ listGroups.push(h("z-list-group", { "divider-type": ListDividerType.ELEMENT }, this.renderItemCategory(groupItem), listGroupsElements));
994
+ }
995
+ }
996
+ });
997
+ return listGroups;
998
+ }
999
+ renderItem(item, key, divider) {
1000
+ return (h("z-list-element", { id: `list-item-${this.htmlid}-${key}`, role: "option", tabindex: 0, dividerType: divider ? ListDividerType.ELEMENT : undefined, clickable: true, onClickItem: () => this.emitSearchItemClick(item) }, h("span", { class: { "item": true, "ellipsis": this.resultsEllipsis, "has-category": !!item.category } }, (item === null || item === void 0 ? void 0 : item.icon) && (h("z-icon", { class: "item-icon", name: item.icon })), h("span", { class: "item-label", title: item.label, innerHTML: this.renderItemLabel(item.label) }))));
1001
+ }
1002
+ renderItemLabel(label) {
1003
+ if (!this.searchString) {
1004
+ return label;
1005
+ }
1006
+ return label.replace(new RegExp(this.searchString.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "gmi"), (found) => `<mark>${found}</mark>`);
1007
+ }
1008
+ renderItemCategory(groupItem) {
1009
+ if (!(groupItem === null || groupItem === void 0 ? void 0 : groupItem.category)) {
1010
+ return null;
1011
+ }
1012
+ return (h("span", { class: "category-heading", slot: "header-title" }, h("span", { class: "category" }, groupItem.category), (groupItem === null || groupItem === void 0 ? void 0 : groupItem.subcategory) && h("span", { class: "subcategory" }, groupItem.subcategory)));
1013
+ }
1014
+ renderSearchHelper(hasDivider = true) {
1015
+ if (!this.autocomplete || this.preventSubmit || !this.searchString) {
1016
+ return null;
1017
+ }
1018
+ return (h("z-list-element", { role: "option", tabindex: 0, dividerType: hasDivider ? ListDividerType.ELEMENT : undefined, clickable: true, id: `list-item-${this.htmlid}-search`, onClickItem: () => this.emitSearchSubmit() }, h("span", { class: "item item-search" }, h("z-icon", { class: "search-icon", name: "left-magnifying-glass" }), h("span", { class: "item-label", innerHTML: this.searchHelperLabel.replace("{searchString}", `<mark>${this.searchString}</mark>`) }))));
1019
+ }
1020
+ renderShowAllResults() {
1021
+ var _a, _b;
1022
+ if (!this.currResultsCount ||
1023
+ !this.searchString ||
1024
+ !((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length) ||
1025
+ this.currResultsCount >= ((_b = this.resultsItemsList) === null || _b === void 0 ? void 0 : _b.length)) {
1026
+ return null;
1027
+ }
1028
+ return (h("z-list-element", { role: "option", tabindex: 0, clickable: true, id: `list-item-${this.htmlid}-show-all`, onClickItem: () => (this.currResultsCount = 0), color: "color-primary01" }, h("div", { class: "item-show-all" }, "Vedi tutti i risultati")));
1029
+ }
1030
+ render() {
1031
+ return (h(Host, { onFocus: () => (this.showResults = true), onClick: (e) => this.handleOutsideClick(e), class: { "has-submit": this.showSearchButton, "has-results": this.autocomplete } }, h("div", { class: "input-container" }, this.renderInput(), this.renderResults()), this.renderButton()));
1032
+ }
1033
+ static get watchers() { return {
1034
+ "resultsItems": ["watchItems"],
1035
+ "resultsCount": ["watchResultsCount"],
1036
+ "value": ["watchValue"],
1037
+ "searchString": ["watchSearchString"]
1038
+ }; }
1039
+ };
1040
+ ZSearchbar.style = stylesCss;
1041
+
1042
+ export { ZAppHeader as z_app_header, ZButton as z_button, ZDivider as z_divider, ZIcon as z_icon, ZInput as z_input, ZInputMessage as z_input_message, ZList as z_list, ZListElement as z_list_element, ZListGroup as z_list_group, ZOffcanvas as z_offcanvas, ZSearchbar as z_searchbar };