@zanichelli/albe-web-components 7.3.1 → 7.3.3

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