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