@zanichelli/albe-web-components 19.3.0-RC5 → 19.3.0-rc1

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 (430) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/cjs/{iconset-Bcbz2MS1.js → iconset-oiCBBbd2.js} +15 -3
  3. package/dist/cjs/{index-2H1EJ2Tl.js → index-D_S5lGcb.js} +5 -5
  4. package/dist/cjs/index.cjs.js +1 -1
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/web-components-library.cjs.js +2 -2
  7. package/dist/cjs/z-accordion.cjs.entry.js +1 -1
  8. package/dist/cjs/z-alert.cjs.entry.js +2 -2
  9. package/dist/cjs/z-anchor-navigation.cjs.entry.js +1 -1
  10. package/dist/cjs/z-app-header-deprecated.cjs.entry.js +1 -1
  11. package/dist/cjs/z-app-header_12.cjs.entry.js +137 -204
  12. package/dist/cjs/z-aria-alert.cjs.entry.js +1 -1
  13. package/dist/cjs/z-avatar.cjs.entry.js +1 -1
  14. package/dist/cjs/z-book-card-app.cjs.entry.js +1 -1
  15. package/dist/cjs/z-book-card-deprecated.cjs.entry.js +1 -1
  16. package/dist/cjs/z-book-card.cjs.entry.js +1 -1
  17. package/dist/cjs/z-book-cover.cjs.entry.js +1 -1
  18. package/dist/cjs/z-breadcrumb.cjs.entry.js +6 -6
  19. package/dist/cjs/z-button-sort.cjs.entry.js +1 -1
  20. package/dist/cjs/z-card.cjs.entry.js +1 -1
  21. package/dist/cjs/z-carousel.cjs.entry.js +1 -1
  22. package/dist/cjs/z-chip.cjs.entry.js +1 -1
  23. package/dist/cjs/z-color-picker.cjs.entry.js +1 -1
  24. package/dist/cjs/z-combobox.cjs.entry.js +6 -4
  25. package/dist/cjs/z-cover-hero.cjs.entry.js +1 -1
  26. package/dist/cjs/z-date-picker.cjs.entry.js +1 -1
  27. package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +1 -1
  28. package/dist/cjs/z-file-upload.cjs.entry.js +1 -1
  29. package/dist/cjs/z-file.cjs.entry.js +1 -1
  30. package/dist/cjs/z-ghost-loading.cjs.entry.js +1 -1
  31. package/dist/cjs/z-info-box.cjs.entry.js +1 -1
  32. package/dist/cjs/z-info-reveal.cjs.entry.js +1 -1
  33. package/dist/cjs/z-logo.cjs.entry.js +1 -1
  34. package/dist/cjs/z-menu-deprecated.cjs.entry.js +1 -1
  35. package/dist/cjs/z-menu-section-deprecated.cjs.entry.js +1 -1
  36. package/dist/cjs/z-menu-section.cjs.entry.js +1 -1
  37. package/dist/cjs/z-menu.cjs.entry.js +1 -1
  38. package/dist/cjs/z-myz-card-alert.cjs.entry.js +2 -2
  39. package/dist/cjs/z-myz-card-dictionary.cjs.entry.js +2 -2
  40. package/dist/cjs/z-myz-card-footer-sections.cjs.entry.js +2 -2
  41. package/dist/cjs/z-myz-card-footer.cjs.entry.js +2 -2
  42. package/dist/cjs/z-myz-card-icon.cjs.entry.js +2 -2
  43. package/dist/cjs/z-myz-card-info.cjs.entry.js +2 -2
  44. package/dist/cjs/z-myz-card-list.cjs.entry.js +2 -2
  45. package/dist/cjs/z-myz-card_4.cjs.entry.js +5 -5
  46. package/dist/cjs/z-myz-list-item.cjs.entry.js +2 -2
  47. package/dist/cjs/z-myz-list.cjs.entry.js +2 -2
  48. package/dist/cjs/z-navigation-tabs.cjs.entry.js +1 -1
  49. package/dist/cjs/z-notification.cjs.entry.js +3 -3
  50. package/dist/cjs/z-otp.cjs.entry.js +3 -3
  51. package/dist/cjs/z-pagination.cjs.entry.js +3 -3
  52. package/dist/cjs/z-panel-elem.cjs.entry.js +1 -1
  53. package/dist/cjs/z-popover.cjs.entry.js +1 -1
  54. package/dist/cjs/z-range-picker.cjs.entry.js +1 -1
  55. package/dist/cjs/z-result-card.cjs.entry.js +1 -1
  56. package/dist/cjs/z-section-title.cjs.entry.js +1 -1
  57. package/dist/cjs/z-select.cjs.entry.js +1 -1
  58. package/dist/cjs/z-skip-to-content.cjs.entry.js +2 -2
  59. package/dist/cjs/z-slideshow.cjs.entry.js +1 -1
  60. package/dist/cjs/z-stepper-item.cjs.entry.js +2 -2
  61. package/dist/cjs/z-stepper.cjs.entry.js +2 -2
  62. package/dist/cjs/z-table.cjs.entry.js +1 -1
  63. package/dist/cjs/z-tbody.cjs.entry.js +1 -1
  64. package/dist/cjs/z-td.cjs.entry.js +4 -4
  65. package/dist/cjs/z-tfoot.cjs.entry.js +1 -1
  66. package/dist/cjs/z-th.cjs.entry.js +6 -4
  67. package/dist/cjs/z-thead.cjs.entry.js +1 -1
  68. package/dist/cjs/z-toast-notification-list.cjs.entry.js +2 -2
  69. package/dist/cjs/z-toast-notification.cjs.entry.js +96 -35
  70. package/dist/cjs/z-toggle-button.cjs.entry.js +3 -3
  71. package/dist/cjs/z-toggle-switch.cjs.entry.js +4 -4
  72. package/dist/cjs/z-tool.cjs.entry.js +3 -3
  73. package/dist/cjs/z-toolbar.cjs.entry.js +2 -2
  74. package/dist/cjs/z-tooltip.cjs.entry.js +2 -2
  75. package/dist/cjs/z-tr.cjs.entry.js +1 -1
  76. package/dist/cjs/z-tree-list.cjs.entry.js +1 -1
  77. package/dist/cjs/z-visually-hidden.cjs.entry.js +1 -1
  78. package/dist/collection/components/css-components/z-scrollbar/styles.css +40 -0
  79. package/dist/collection/components/table/cells/{z-td/styles.css → z-table-cells.css} +0 -1
  80. package/dist/collection/components/table/cells/z-td/index.js +3 -3
  81. package/dist/collection/components/table/cells/z-th/index.js +3 -3
  82. package/dist/collection/components/table/cells/z-th/styles.css +0 -72
  83. package/dist/collection/components/z-app-header/index.js +21 -2
  84. package/dist/collection/components/z-app-header/index.stories.js +25 -9
  85. package/dist/collection/components/z-breadcrumb/index.js +5 -5
  86. package/dist/collection/components/z-button/index.js +5 -2
  87. package/dist/collection/components/z-combobox/index.js +3 -3
  88. package/dist/collection/components/z-combobox/styles.css +0 -12
  89. package/dist/collection/components/z-input/index.js +3 -3
  90. package/dist/collection/components/z-input/styles-checkbox-radio.css +130 -0
  91. package/dist/collection/components/z-input/styles-general.css +166 -0
  92. package/dist/collection/components/z-input/styles-text.css +87 -0
  93. package/dist/collection/components/z-input/styles-textarea.css +19 -0
  94. package/dist/collection/components/z-notification/index.js +3 -2
  95. package/dist/collection/components/z-notification/index.stories.js +79 -77
  96. package/dist/collection/components/z-notification/styles.css +8 -6
  97. package/dist/collection/components/z-pagination/index.js +2 -2
  98. package/dist/collection/components/z-searchbar/index.js +133 -193
  99. package/dist/collection/components/z-searchbar/index.stories.js +12 -16
  100. package/dist/collection/components/z-searchbar/styles.css +87 -201
  101. package/dist/collection/components/z-skip-to-content/index.js +1 -1
  102. package/dist/collection/components/z-stepper/index.js +1 -1
  103. package/dist/collection/components/z-stepper-item/index.js +1 -1
  104. package/dist/collection/components/z-toast-notification/index.js +3 -3
  105. package/dist/collection/components/z-toast-notification-list/index.js +1 -1
  106. package/dist/collection/components/z-toggle-button/index.js +2 -2
  107. package/dist/collection/components/z-toggle-switch/index.js +3 -3
  108. package/dist/collection/components/z-tool/index.js +3 -3
  109. package/dist/collection/components/z-toolbar/index.js +1 -1
  110. package/dist/collection/components/z-tooltip/index.js +1 -1
  111. package/dist/collection/constants/iconset.js +15 -3
  112. package/dist/collection/snowflakes/myz/card/z-myz-card/index.js +1 -1
  113. package/dist/collection/snowflakes/myz/card/z-myz-card-alert/index.js +1 -1
  114. package/dist/collection/snowflakes/myz/card/z-myz-card-body/index.js +1 -1
  115. package/dist/collection/snowflakes/myz/card/z-myz-card-cover/index.js +1 -1
  116. package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/index.js +1 -1
  117. package/dist/collection/snowflakes/myz/card/z-myz-card-footer/index.js +1 -1
  118. package/dist/collection/snowflakes/myz/card/z-myz-card-footer-sections/index.js +1 -1
  119. package/dist/collection/snowflakes/myz/card/z-myz-card-header/index.js +1 -1
  120. package/dist/collection/snowflakes/myz/card/z-myz-card-icon/index.js +1 -1
  121. package/dist/collection/snowflakes/myz/card/z-myz-card-info/index.js +1 -1
  122. package/dist/collection/snowflakes/myz/card/z-myz-card-list/index.js +1 -1
  123. package/dist/collection/snowflakes/myz/list/z-myz-list/index.js +1 -1
  124. package/dist/collection/snowflakes/myz/list/z-myz-list-item/index.js +1 -1
  125. package/dist/collection/snowflakes/myz/z-alert/index.js +1 -1
  126. package/dist/collection/snowflakes/myz/z-otp/index.js +2 -2
  127. package/dist/components/iconset.js +1 -1
  128. package/dist/components/index13.js +1 -1
  129. package/dist/components/index22.js +1 -1
  130. package/dist/components/index23.js +1 -1
  131. package/dist/components/index24.js +1 -1
  132. package/dist/components/index25.js +1 -1
  133. package/dist/components/index26.js +1 -1
  134. package/dist/components/index27.js +1 -1
  135. package/dist/components/index4.js +1 -1
  136. package/dist/components/index5.js +1 -1
  137. package/dist/components/index7.js +1 -1
  138. package/dist/components/z-app-header.js +1 -1
  139. package/dist/components/z-breadcrumb.js +1 -1
  140. package/dist/components/z-combobox.js +1 -1
  141. package/dist/components/z-myz-card-alert.js +1 -1
  142. package/dist/components/z-myz-card-dictionary.js +1 -1
  143. package/dist/components/z-myz-card-footer-sections.js +1 -1
  144. package/dist/components/z-myz-card-footer.js +1 -1
  145. package/dist/components/z-myz-card-icon.js +1 -1
  146. package/dist/components/z-myz-card-info.js +1 -1
  147. package/dist/components/z-myz-card-list.js +1 -1
  148. package/dist/components/z-myz-list.js +1 -1
  149. package/dist/components/z-notification.js +1 -1
  150. package/dist/components/z-otp.js +1 -1
  151. package/dist/components/z-pagination.js +1 -1
  152. package/dist/components/z-skip-to-content.js +1 -1
  153. package/dist/components/z-stepper-item.js +1 -1
  154. package/dist/components/z-stepper.js +1 -1
  155. package/dist/components/z-td.js +1 -1
  156. package/dist/components/z-th.js +1 -1
  157. package/dist/components/z-toast-notification-list.js +1 -1
  158. package/dist/components/z-toast-notification.js +1 -1
  159. package/dist/components/z-toggle-button.js +1 -1
  160. package/dist/components/z-toggle-switch.js +1 -1
  161. package/dist/components/z-tool.js +1 -1
  162. package/dist/components/z-toolbar.js +1 -1
  163. package/dist/esm/{iconset-BanpkIXZ.js → iconset-CjHS9zeM.js} +15 -3
  164. package/dist/esm/{index-ByN2sYu6.js → index-DPdXlnVe.js} +5 -5
  165. package/dist/esm/index.js +2 -2
  166. package/dist/esm/loader.js +3 -3
  167. package/dist/esm/{utils-0PByxJyN.js → utils-DYd3kO0P.js} +1 -1
  168. package/dist/esm/web-components-library.js +3 -3
  169. package/dist/esm/z-accordion.entry.js +1 -1
  170. package/dist/esm/z-alert.entry.js +2 -2
  171. package/dist/esm/z-anchor-navigation.entry.js +1 -1
  172. package/dist/esm/z-app-header-deprecated.entry.js +1 -1
  173. package/dist/esm/z-app-header_12.entry.js +139 -206
  174. package/dist/esm/z-aria-alert.entry.js +1 -1
  175. package/dist/esm/z-avatar.entry.js +1 -1
  176. package/dist/esm/z-book-card-app.entry.js +1 -1
  177. package/dist/esm/z-book-card-deprecated.entry.js +2 -2
  178. package/dist/esm/z-book-card.entry.js +1 -1
  179. package/dist/esm/z-book-cover.entry.js +1 -1
  180. package/dist/esm/z-breadcrumb.entry.js +7 -7
  181. package/dist/esm/z-button-sort.entry.js +1 -1
  182. package/dist/esm/z-card.entry.js +1 -1
  183. package/dist/esm/z-carousel.entry.js +1 -1
  184. package/dist/esm/z-chip.entry.js +1 -1
  185. package/dist/esm/z-color-picker.entry.js +2 -2
  186. package/dist/esm/z-combobox.entry.js +7 -5
  187. package/dist/esm/z-cover-hero.entry.js +1 -1
  188. package/dist/esm/z-date-picker.entry.js +1 -1
  189. package/dist/esm/z-dragdrop-area_2.entry.js +1 -1
  190. package/dist/esm/z-file-upload.entry.js +1 -1
  191. package/dist/esm/z-file.entry.js +1 -1
  192. package/dist/esm/z-ghost-loading.entry.js +1 -1
  193. package/dist/esm/z-info-box.entry.js +1 -1
  194. package/dist/esm/z-info-reveal.entry.js +1 -1
  195. package/dist/esm/z-logo.entry.js +1 -1
  196. package/dist/esm/z-menu-deprecated.entry.js +1 -1
  197. package/dist/esm/z-menu-section-deprecated.entry.js +1 -1
  198. package/dist/esm/z-menu-section.entry.js +1 -1
  199. package/dist/esm/z-menu.entry.js +2 -2
  200. package/dist/esm/z-myz-card-alert.entry.js +2 -2
  201. package/dist/esm/z-myz-card-dictionary.entry.js +2 -2
  202. package/dist/esm/z-myz-card-footer-sections.entry.js +2 -2
  203. package/dist/esm/z-myz-card-footer.entry.js +2 -2
  204. package/dist/esm/z-myz-card-icon.entry.js +2 -2
  205. package/dist/esm/z-myz-card-info.entry.js +3 -3
  206. package/dist/esm/z-myz-card-list.entry.js +2 -2
  207. package/dist/esm/z-myz-card_4.entry.js +5 -5
  208. package/dist/esm/z-myz-list-item.entry.js +3 -3
  209. package/dist/esm/z-myz-list.entry.js +2 -2
  210. package/dist/esm/z-navigation-tabs.entry.js +1 -1
  211. package/dist/esm/z-notification.entry.js +3 -3
  212. package/dist/esm/z-otp.entry.js +3 -3
  213. package/dist/esm/z-pagination.entry.js +3 -3
  214. package/dist/esm/z-panel-elem.entry.js +1 -1
  215. package/dist/esm/z-popover.entry.js +2 -2
  216. package/dist/esm/z-range-picker.entry.js +1 -1
  217. package/dist/esm/z-result-card.entry.js +1 -1
  218. package/dist/esm/z-section-title.entry.js +1 -1
  219. package/dist/esm/z-select.entry.js +2 -2
  220. package/dist/esm/z-skip-to-content.entry.js +3 -3
  221. package/dist/esm/z-slideshow.entry.js +2 -2
  222. package/dist/esm/z-stepper-item.entry.js +2 -2
  223. package/dist/esm/z-stepper.entry.js +2 -2
  224. package/dist/esm/z-table.entry.js +2 -2
  225. package/dist/esm/z-tbody.entry.js +1 -1
  226. package/dist/esm/z-td.entry.js +4 -4
  227. package/dist/esm/z-tfoot.entry.js +1 -1
  228. package/dist/esm/z-th.entry.js +6 -4
  229. package/dist/esm/z-thead.entry.js +1 -1
  230. package/dist/esm/z-toast-notification-list.entry.js +2 -2
  231. package/dist/esm/z-toast-notification.entry.js +96 -35
  232. package/dist/esm/z-toggle-button.entry.js +3 -3
  233. package/dist/esm/z-toggle-switch.entry.js +5 -5
  234. package/dist/esm/z-tool.entry.js +4 -4
  235. package/dist/esm/z-toolbar.entry.js +2 -2
  236. package/dist/esm/z-tooltip.entry.js +2 -2
  237. package/dist/esm/z-tr.entry.js +2 -2
  238. package/dist/esm/z-tree-list.entry.js +1 -1
  239. package/dist/esm/z-visually-hidden.entry.js +1 -1
  240. package/dist/types/components/z-app-header/index.d.ts +4 -0
  241. package/dist/types/components/z-app-header/index.stories.d.ts +7 -0
  242. package/dist/types/components/z-notification/index.d.ts +2 -1
  243. package/dist/types/components/z-notification/index.stories.d.ts +27 -22
  244. package/dist/types/components/z-searchbar/index.d.ts +26 -28
  245. package/dist/types/components/z-searchbar/index.stories.d.ts +4 -0
  246. package/dist/types/components.d.ts +42 -18
  247. package/dist/types/constants/iconset.d.ts +30 -6
  248. package/dist/web-components-library/index.esm.js +1 -1
  249. package/dist/web-components-library/p-087956fa.entry.js +1 -0
  250. package/dist/web-components-library/{p-9b181c2c.entry.js → p-10e5e16e.entry.js} +1 -1
  251. package/dist/web-components-library/{p-8f945346.entry.js → p-13e7f751.entry.js} +1 -1
  252. package/dist/web-components-library/{p-366d2553.entry.js → p-14b804f9.entry.js} +1 -1
  253. package/{www/build/p-9d3bde23.entry.js → dist/web-components-library/p-1580db58.entry.js} +1 -1
  254. package/dist/web-components-library/p-15825811.entry.js +1 -0
  255. package/dist/web-components-library/{p-1210c90f.entry.js → p-1993b0ad.entry.js} +1 -1
  256. package/dist/web-components-library/{p-eb722234.entry.js → p-1a95491d.entry.js} +1 -1
  257. package/dist/web-components-library/{p-ebdbd84c.entry.js → p-1d023220.entry.js} +1 -1
  258. package/dist/web-components-library/{p-5fc4048b.entry.js → p-21c85e04.entry.js} +1 -1
  259. package/dist/web-components-library/{p-081b1648.entry.js → p-23b46642.entry.js} +1 -1
  260. package/dist/web-components-library/{p-59d4ac9e.entry.js → p-299f0f85.entry.js} +1 -1
  261. package/dist/web-components-library/p-29dde955.entry.js +1 -0
  262. package/dist/web-components-library/p-2c036e17.entry.js +1 -0
  263. package/dist/web-components-library/{p-c23bfec2.entry.js → p-2d4c01c3.entry.js} +1 -1
  264. package/dist/web-components-library/p-2dabe353.entry.js +1 -0
  265. package/dist/web-components-library/{p-1afd69ba.entry.js → p-2df6d169.entry.js} +1 -1
  266. package/dist/web-components-library/{p-2f99634d.entry.js → p-2ef82e17.entry.js} +1 -1
  267. package/dist/web-components-library/{p-30c86858.entry.js → p-324933f6.entry.js} +1 -1
  268. package/{www/build/p-50b59012.entry.js → dist/web-components-library/p-37e84b71.entry.js} +1 -1
  269. package/dist/web-components-library/{p-1e984688.entry.js → p-3c53e451.entry.js} +1 -1
  270. package/dist/web-components-library/{p-5883dbc1.entry.js → p-3ea03d34.entry.js} +1 -1
  271. package/dist/web-components-library/p-41584e90.entry.js +1 -0
  272. package/{www/build/p-6ece59b5.entry.js → dist/web-components-library/p-50e10a10.entry.js} +1 -1
  273. package/dist/web-components-library/{p-17429bce.entry.js → p-52899754.entry.js} +1 -1
  274. package/dist/web-components-library/p-53670be4.entry.js +1 -0
  275. package/dist/web-components-library/{p-02e588b4.entry.js → p-583b8152.entry.js} +1 -1
  276. package/dist/web-components-library/{p-afab22fc.entry.js → p-5a05dc1e.entry.js} +1 -1
  277. package/dist/web-components-library/{p-a975b91d.entry.js → p-5d20fc3d.entry.js} +1 -1
  278. package/{www/build/p-5c85b7f4.entry.js → dist/web-components-library/p-622466f9.entry.js} +1 -1
  279. package/dist/web-components-library/{p-0727e9aa.entry.js → p-658f022d.entry.js} +1 -1
  280. package/dist/web-components-library/{p-ecea3d09.entry.js → p-6bd35edf.entry.js} +1 -1
  281. package/dist/web-components-library/{p-00f09ae2.entry.js → p-7226f07a.entry.js} +1 -1
  282. package/dist/web-components-library/p-7371a543.entry.js +2 -0
  283. package/dist/web-components-library/{p-b5c180bc.entry.js → p-77bf39a4.entry.js} +1 -1
  284. package/dist/web-components-library/{p-acf23ad8.entry.js → p-788eaac7.entry.js} +1 -1
  285. package/{www/build/p-631f111d.entry.js → dist/web-components-library/p-7bf7539a.entry.js} +1 -1
  286. package/dist/web-components-library/p-81eb43fd.entry.js +1 -0
  287. package/dist/web-components-library/{p-abfdc045.entry.js → p-8261c869.entry.js} +1 -1
  288. package/{www/build/p-5bb77af2.entry.js → dist/web-components-library/p-83da1031.entry.js} +1 -1
  289. package/{www/build/p-d57c5efc.entry.js → dist/web-components-library/p-85cac60d.entry.js} +1 -1
  290. package/dist/web-components-library/{p-2294f1b0.entry.js → p-88a3ba7c.entry.js} +1 -1
  291. package/dist/web-components-library/{p-0ca6e928.entry.js → p-8a8df4f4.entry.js} +1 -1
  292. package/dist/web-components-library/{p-040fbd28.entry.js → p-8b026993.entry.js} +1 -1
  293. package/dist/web-components-library/{p-294f7b4e.entry.js → p-8d7e2e16.entry.js} +1 -1
  294. package/dist/web-components-library/{p-19536f5e.entry.js → p-8de064a4.entry.js} +1 -1
  295. package/dist/web-components-library/{p-aabb5aea.entry.js → p-8f4a04aa.entry.js} +1 -1
  296. package/dist/web-components-library/{p-D4yqZKyM.js → p-CPsEG702.js} +1 -1
  297. package/dist/web-components-library/p-CjHS9zeM.js +1 -0
  298. package/dist/web-components-library/{p-ByN2sYu6.js → p-DPdXlnVe.js} +1 -1
  299. package/dist/web-components-library/{p-58933ba5.entry.js → p-a4f673f8.entry.js} +1 -1
  300. package/dist/web-components-library/{p-a336c241.entry.js → p-aa4fc3d3.entry.js} +1 -1
  301. package/{www/build/p-48d72b52.entry.js → dist/web-components-library/p-aa72d766.entry.js} +1 -1
  302. package/{www/build/p-b38d52e5.entry.js → dist/web-components-library/p-ad2cd7fc.entry.js} +1 -1
  303. package/dist/web-components-library/{p-241eaed0.entry.js → p-b6223d7e.entry.js} +1 -1
  304. package/{www/build/p-41b55222.entry.js → dist/web-components-library/p-b851f20b.entry.js} +1 -1
  305. package/dist/web-components-library/{p-d304ce44.entry.js → p-b9343431.entry.js} +1 -1
  306. package/dist/web-components-library/{p-a3a7c406.entry.js → p-be354b22.entry.js} +1 -1
  307. package/dist/web-components-library/{p-c8f40472.entry.js → p-c42ddd93.entry.js} +1 -1
  308. package/dist/web-components-library/{p-896470e8.entry.js → p-c4e7bd16.entry.js} +1 -1
  309. package/dist/web-components-library/{p-794c613e.entry.js → p-c944a943.entry.js} +1 -1
  310. package/dist/web-components-library/{p-4b0a730e.entry.js → p-cd33f4b1.entry.js} +1 -1
  311. package/dist/web-components-library/{p-ad2ed505.entry.js → p-cdd88182.entry.js} +1 -1
  312. package/dist/web-components-library/{p-8745878e.entry.js → p-d3053434.entry.js} +1 -1
  313. package/dist/web-components-library/{p-fade8c19.entry.js → p-d63665c1.entry.js} +1 -1
  314. package/dist/web-components-library/{p-1b851174.entry.js → p-dabccb20.entry.js} +1 -1
  315. package/dist/web-components-library/p-dc5ab2cc.entry.js +1 -0
  316. package/dist/web-components-library/{p-5797bf38.entry.js → p-dfd43710.entry.js} +1 -1
  317. package/dist/web-components-library/{p-0a819ab4.entry.js → p-e1d0a6e3.entry.js} +1 -1
  318. package/dist/web-components-library/p-e48497f0.entry.js +1 -0
  319. package/dist/web-components-library/{p-a9534450.entry.js → p-ec4940ce.entry.js} +1 -1
  320. package/dist/web-components-library/{p-ed74f357.entry.js → p-eddc2d19.entry.js} +1 -1
  321. package/dist/web-components-library/{p-6d53942a.entry.js → p-ef5018bb.entry.js} +1 -1
  322. package/dist/web-components-library/{p-f5e7fa96.entry.js → p-f7e46ef2.entry.js} +1 -1
  323. package/dist/web-components-library/web-components-library.css +1 -1
  324. package/dist/web-components-library/web-components-library.esm.js +1 -1
  325. package/package.json +3 -3
  326. package/www/build/index.esm.js +1 -1
  327. package/www/build/p-087956fa.entry.js +1 -0
  328. package/www/build/{p-9b181c2c.entry.js → p-10e5e16e.entry.js} +1 -1
  329. package/www/build/{p-8f945346.entry.js → p-13e7f751.entry.js} +1 -1
  330. package/www/build/{p-366d2553.entry.js → p-14b804f9.entry.js} +1 -1
  331. package/{dist/web-components-library/p-9d3bde23.entry.js → www/build/p-1580db58.entry.js} +1 -1
  332. package/www/build/p-15825811.entry.js +1 -0
  333. package/www/build/{p-1210c90f.entry.js → p-1993b0ad.entry.js} +1 -1
  334. package/www/build/{p-eb722234.entry.js → p-1a95491d.entry.js} +1 -1
  335. package/www/build/{p-ebdbd84c.entry.js → p-1d023220.entry.js} +1 -1
  336. package/www/build/{p-5fc4048b.entry.js → p-21c85e04.entry.js} +1 -1
  337. package/www/build/{p-081b1648.entry.js → p-23b46642.entry.js} +1 -1
  338. package/www/build/{p-59d4ac9e.entry.js → p-299f0f85.entry.js} +1 -1
  339. package/www/build/p-29dde955.entry.js +1 -0
  340. package/www/build/p-2c036e17.entry.js +1 -0
  341. package/www/build/{p-c23bfec2.entry.js → p-2d4c01c3.entry.js} +1 -1
  342. package/www/build/p-2dabe353.entry.js +1 -0
  343. package/www/build/{p-1afd69ba.entry.js → p-2df6d169.entry.js} +1 -1
  344. package/www/build/{p-2f99634d.entry.js → p-2ef82e17.entry.js} +1 -1
  345. package/www/build/{p-30c86858.entry.js → p-324933f6.entry.js} +1 -1
  346. package/{dist/web-components-library/p-50b59012.entry.js → www/build/p-37e84b71.entry.js} +1 -1
  347. package/www/build/{p-1e984688.entry.js → p-3c53e451.entry.js} +1 -1
  348. package/www/build/{p-5883dbc1.entry.js → p-3ea03d34.entry.js} +1 -1
  349. package/www/build/p-41584e90.entry.js +1 -0
  350. package/{dist/web-components-library/p-6ece59b5.entry.js → www/build/p-50e10a10.entry.js} +1 -1
  351. package/www/build/{p-17429bce.entry.js → p-52899754.entry.js} +1 -1
  352. package/www/build/p-53670be4.entry.js +1 -0
  353. package/www/build/{p-02e588b4.entry.js → p-583b8152.entry.js} +1 -1
  354. package/www/build/{p-afab22fc.entry.js → p-5a05dc1e.entry.js} +1 -1
  355. package/www/build/{p-a975b91d.entry.js → p-5d20fc3d.entry.js} +1 -1
  356. package/{dist/web-components-library/p-5c85b7f4.entry.js → www/build/p-622466f9.entry.js} +1 -1
  357. package/www/build/{p-0727e9aa.entry.js → p-658f022d.entry.js} +1 -1
  358. package/www/build/{p-ecea3d09.entry.js → p-6bd35edf.entry.js} +1 -1
  359. package/www/build/{p-00f09ae2.entry.js → p-7226f07a.entry.js} +1 -1
  360. package/www/build/p-7371a543.entry.js +2 -0
  361. package/www/build/{p-b5c180bc.entry.js → p-77bf39a4.entry.js} +1 -1
  362. package/www/build/{p-acf23ad8.entry.js → p-788eaac7.entry.js} +1 -1
  363. package/{dist/web-components-library/p-631f111d.entry.js → www/build/p-7bf7539a.entry.js} +1 -1
  364. package/www/build/p-81eb43fd.entry.js +1 -0
  365. package/www/build/{p-abfdc045.entry.js → p-8261c869.entry.js} +1 -1
  366. package/{dist/web-components-library/p-5bb77af2.entry.js → www/build/p-83da1031.entry.js} +1 -1
  367. package/{dist/web-components-library/p-d57c5efc.entry.js → www/build/p-85cac60d.entry.js} +1 -1
  368. package/www/build/{p-2294f1b0.entry.js → p-88a3ba7c.entry.js} +1 -1
  369. package/www/build/{p-0ca6e928.entry.js → p-8a8df4f4.entry.js} +1 -1
  370. package/www/build/{p-040fbd28.entry.js → p-8b026993.entry.js} +1 -1
  371. package/www/build/{p-294f7b4e.entry.js → p-8d7e2e16.entry.js} +1 -1
  372. package/www/build/{p-19536f5e.entry.js → p-8de064a4.entry.js} +1 -1
  373. package/www/build/{p-aabb5aea.entry.js → p-8f4a04aa.entry.js} +1 -1
  374. package/www/build/{p-D4yqZKyM.js → p-CPsEG702.js} +1 -1
  375. package/www/build/p-CjHS9zeM.js +1 -0
  376. package/www/build/{p-ByN2sYu6.js → p-DPdXlnVe.js} +1 -1
  377. package/www/build/{p-58933ba5.entry.js → p-a4f673f8.entry.js} +1 -1
  378. package/www/build/{p-a336c241.entry.js → p-aa4fc3d3.entry.js} +1 -1
  379. package/{dist/web-components-library/p-48d72b52.entry.js → www/build/p-aa72d766.entry.js} +1 -1
  380. package/{dist/web-components-library/p-b38d52e5.entry.js → www/build/p-ad2cd7fc.entry.js} +1 -1
  381. package/www/build/{p-241eaed0.entry.js → p-b6223d7e.entry.js} +1 -1
  382. package/{dist/web-components-library/p-41b55222.entry.js → www/build/p-b851f20b.entry.js} +1 -1
  383. package/www/build/{p-d304ce44.entry.js → p-b9343431.entry.js} +1 -1
  384. package/www/build/{p-a3a7c406.entry.js → p-be354b22.entry.js} +1 -1
  385. package/www/build/{p-c8f40472.entry.js → p-c42ddd93.entry.js} +1 -1
  386. package/www/build/{p-896470e8.entry.js → p-c4e7bd16.entry.js} +1 -1
  387. package/www/build/{p-ea2cbe37.js → p-c5c5a64f.js} +1 -1
  388. package/www/build/{p-813bd63b.css → p-c60c851a.css} +1 -1
  389. package/www/build/{p-794c613e.entry.js → p-c944a943.entry.js} +1 -1
  390. package/www/build/{p-4b0a730e.entry.js → p-cd33f4b1.entry.js} +1 -1
  391. package/www/build/{p-ad2ed505.entry.js → p-cdd88182.entry.js} +1 -1
  392. package/www/build/{p-8745878e.entry.js → p-d3053434.entry.js} +1 -1
  393. package/www/build/{p-fade8c19.entry.js → p-d63665c1.entry.js} +1 -1
  394. package/www/build/{p-1b851174.entry.js → p-dabccb20.entry.js} +1 -1
  395. package/www/build/p-dc5ab2cc.entry.js +1 -0
  396. package/www/build/{p-5797bf38.entry.js → p-dfd43710.entry.js} +1 -1
  397. package/www/build/{p-0a819ab4.entry.js → p-e1d0a6e3.entry.js} +1 -1
  398. package/www/build/p-e48497f0.entry.js +1 -0
  399. package/www/build/{p-a9534450.entry.js → p-ec4940ce.entry.js} +1 -1
  400. package/www/build/{p-ed74f357.entry.js → p-eddc2d19.entry.js} +1 -1
  401. package/www/build/{p-6d53942a.entry.js → p-ef5018bb.entry.js} +1 -1
  402. package/www/build/{p-f5e7fa96.entry.js → p-f7e46ef2.entry.js} +1 -1
  403. package/www/build/web-components-library.css +1 -1
  404. package/www/build/web-components-library.esm.js +1 -1
  405. package/www/index.html +1 -1
  406. package/dist/collection/components/z-input/styles.css +0 -406
  407. package/dist/web-components-library/p-062ba668.entry.js +0 -1
  408. package/dist/web-components-library/p-0eb7baa4.entry.js +0 -1
  409. package/dist/web-components-library/p-1c5bbea1.entry.js +0 -1
  410. package/dist/web-components-library/p-27f93251.entry.js +0 -1
  411. package/dist/web-components-library/p-314302ce.entry.js +0 -1
  412. package/dist/web-components-library/p-3c861d49.entry.js +0 -1
  413. package/dist/web-components-library/p-7a55d688.entry.js +0 -2
  414. package/dist/web-components-library/p-8042aaf7.entry.js +0 -1
  415. package/dist/web-components-library/p-BanpkIXZ.js +0 -1
  416. package/dist/web-components-library/p-a1127213.entry.js +0 -1
  417. package/dist/web-components-library/p-afcabf3b.entry.js +0 -1
  418. package/dist/web-components-library/p-db0a60fc.entry.js +0 -1
  419. package/www/build/p-062ba668.entry.js +0 -1
  420. package/www/build/p-0eb7baa4.entry.js +0 -1
  421. package/www/build/p-1c5bbea1.entry.js +0 -1
  422. package/www/build/p-27f93251.entry.js +0 -1
  423. package/www/build/p-314302ce.entry.js +0 -1
  424. package/www/build/p-3c861d49.entry.js +0 -1
  425. package/www/build/p-7a55d688.entry.js +0 -2
  426. package/www/build/p-8042aaf7.entry.js +0 -1
  427. package/www/build/p-BanpkIXZ.js +0 -1
  428. package/www/build/p-a1127213.entry.js +0 -1
  429. package/www/build/p-afcabf3b.entry.js +0 -1
  430. package/www/build/p-db0a60fc.entry.js +0 -1
@@ -1,6 +1,6 @@
1
1
  import { Host, h, } from "@stencil/core";
2
- import { ButtonVariant, ControlSize, Device, KeyboardCode, ListDividerType, } from "../../beans";
3
- import { getDevice, handleEnterKeydSubmit, randomId } from "../../utils/utils";
2
+ import { ButtonVariant, ControlSize, KeyboardCode, } from "../../beans";
3
+ import { handleEnterKeydSubmit, randomId } from "../../utils/utils";
4
4
  /**
5
5
  * @cssprop --z-searchbar-results-height - Max height of the results container (default: 540px)
6
6
  * @cssprop --z-searchbar-tag-text-color - Color of tag's text (default --color-primary03);
@@ -8,7 +8,7 @@ import { getDevice, handleEnterKeydSubmit, randomId } from "../../utils/utils";
8
8
  */
9
9
  export class ZSearchbar {
10
10
  constructor() {
11
- /** the id of the searchbar element */
11
+ /** The id of the searchbar element */
12
12
  this.htmlid = `searchbar-${randomId()}`;
13
13
  /** Prevent submit action */
14
14
  this.preventSubmit = false;
@@ -22,30 +22,28 @@ export class ZSearchbar {
22
22
  this.sortResultsItems = false;
23
23
  /** Show submit button */
24
24
  this.showSearchButton = false;
25
- /** Set button icon without label*/
25
+ /** Hide the label of the submit button, showing only the icon */
26
26
  this.searchButtonIconOnly = false;
27
- /** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */
27
+ /** The label of the submit button */
28
+ this.searchButtonLabel = "CERCA";
29
+ /** Size of the `z-input` and submit `z-button` */
28
30
  this.size = ControlSize.BIG;
29
- /** Graphical variant: `primary`, `secondary`, `tertiary`. Defaults to `primary`. */
31
+ /** Submit `z-button` variant */
30
32
  this.variant = ButtonVariant.PRIMARY;
31
33
  this.searchString = this.value;
32
- this.currResultsCount = 0;
34
+ this.currResultsCount = this.resultsCount;
33
35
  this.showResults = false;
34
36
  this.isMobile = false;
35
37
  this.resultsItemsList = null;
36
- this.items = [];
37
- }
38
- emitSearchSubmit() {
39
- this.searchSubmit.emit(this.inputRef.value);
40
- }
41
- emitSearchTyping(search) {
42
- this.searchTyping.emit(search);
43
38
  }
44
39
  emitSearchItemClick(item) {
45
40
  this.searchItemClick.emit(item);
46
41
  this.selectedItem = item;
47
42
  this.searchString = "";
48
43
  }
44
+ emitSearchSubmit() {
45
+ this.searchSubmit.emit(this.inputRef.value);
46
+ }
49
47
  watchItems() {
50
48
  this.resultsItemsList = this.getResultsItemsList();
51
49
  }
@@ -56,42 +54,17 @@ export class ZSearchbar {
56
54
  this.searchString = this.value;
57
55
  }
58
56
  watchSearchString() {
59
- this.emitSearchTyping(this.searchString);
60
- this.items = [];
57
+ this.searchTyping.emit(this.searchString);
61
58
  if (!this.searchString) {
62
59
  this.currResultsCount = this.resultsCount;
63
60
  }
64
61
  }
65
- watchShowResults() {
66
- if (!this.showResults) {
67
- this.items = [];
68
- }
69
- }
70
- disconnectedCallback() {
71
- var _a;
72
- (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
73
- }
74
- componentDidLoad() {
75
- this.resizeObserver = new ResizeObserver(() => {
76
- if (getDevice() === Device.MOBILE && !this.isMobile) {
77
- this.isMobile = true;
78
- }
79
- if (getDevice() !== Device.MOBILE && this.isMobile) {
80
- this.isMobile = false;
81
- }
82
- });
83
- this.resizeObserver.observe(this.element);
84
- }
85
- componentWillLoad() {
86
- this.resultsItemsList = this.getResultsItemsList();
87
- this.currResultsCount = this.resultsCount;
88
- }
89
62
  getResultsItemsList() {
90
63
  return typeof this.resultsItems === "string" ? JSON.parse(this.resultsItems) : this.resultsItems;
91
64
  }
92
- getGroupedItems(items) {
65
+ getGroupedItems() {
93
66
  const groupedItems = {};
94
- items.forEach((item) => {
67
+ this.resultsItemsList.forEach((item) => {
95
68
  var _a;
96
69
  const key = `${item === null || item === void 0 ? void 0 : item.category}${item === null || item === void 0 ? void 0 : item.subcategory}`;
97
70
  groupedItems[key] = (_a = groupedItems[key]) !== null && _a !== void 0 ? _a : {
@@ -121,148 +94,77 @@ export class ZSearchbar {
121
94
  }
122
95
  return groupedItems;
123
96
  }
124
- checkResultsCount(counter) {
125
- if (!this.currResultsCount || counter < this.currResultsCount) {
126
- return true;
127
- }
128
- return false;
129
- }
130
- handleStopTyping(e) {
131
- e.stopPropagation();
132
- this.searchString = e.detail.value;
133
- if (this.selectedItem) {
134
- this.selectedItem = undefined;
135
- }
136
- }
137
- handleSubmit() {
138
- if (this.preventSubmit) {
97
+ onListItemKeyDown(e, item) {
98
+ if (e.key === KeyboardCode.ENTER) {
99
+ e.preventDefault();
100
+ this.emitSearchItemClick(item);
139
101
  return;
140
102
  }
141
- this.emitSearchSubmit();
103
+ this.handleArrowsNavigation(e);
142
104
  }
143
- handleOutsideClick(e) {
144
- const cp = e.composedPath();
145
- const searchbar = cp.find((elem) => elem.nodeName === "Z-SEARCHBAR");
146
- if (!searchbar || searchbar.htmlid !== this.htmlid) {
147
- this.showResults = false;
148
- return;
149
- }
150
- 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")); })) {
151
- this.showResults = true;
105
+ onSearchHelperKeyDown(e) {
106
+ if (e.key === KeyboardCode.ENTER) {
107
+ e.preventDefault();
108
+ this.emitSearchSubmit();
152
109
  return;
153
110
  }
154
- this.showResults = false;
155
- }
156
- renderInput() {
157
- var _a;
158
- return (h("z-input", { ref: (val) => {
159
- this.inputRef = val;
160
- }, htmlid: `input-${this.htmlid}`, message: false, placeholder: this.placeholder, onStopTyping: (e) => this.handleStopTyping(e), onKeyUp: (e) => {
161
- handleEnterKeydSubmit(e, () => this.handleSubmit());
162
- this.handleArrowsNavigation(e);
163
- }, value: this.searchString || ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.label), size: this.size, label: this.label, "aria-label": this.htmlAriaLabel || this.placeholder }));
164
- }
165
- renderButton() {
166
- if (!this.showSearchButton) {
167
- return null;
168
- }
169
- const iconProp = this.searchButtonIconOnly ? { icon: "search" } : null;
170
- const buttonLabel = this.searchButtonIconOnly ? "" : "CERCA";
171
- const ariaLabel = this.searchButtonIconOnly ? { "aria-label": "CERCA" } : null;
172
- const defaultProps = Object.assign(Object.assign({ disabled: this.preventSubmit, variant: this.variant, size: this.size, onClick: () => this.handleSubmit() }, iconProp), ariaLabel);
173
- return h("z-button", Object.assign({}, defaultProps), buttonLabel);
174
- }
175
- renderResults() {
176
- if (!this.showResults ||
177
- !this.autocomplete ||
178
- !this.searchString ||
179
- this.searchString.length < this.autocompleteMinChars ||
180
- !this.resultsItemsList) {
181
- return null;
182
- }
183
- return (h("div", { class: "results-wrapper" }, h("div", { class: "results" }, this.renderResultsList())));
184
- }
185
- renderResultsList() {
186
- var _a, _b;
187
- if (this.preventSubmit && !((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length)) {
188
- return (h("span", { class: "item item-no-results" }, "Non abbiamo trovato risultati per ", h("b", null, this.searchString), h("br", null), h("br", null), "Cosa puoi fare?", h("ul", null, h("li", null, "Verificare di aver scritto bene"), h("li", null, "Provare a cercare un'altra parola"), h("li", null, "Provare a cercare qualcosa di pi\u00F9 generico"))));
189
- }
190
- return (h("z-list", { role: "listbox", id: `list-${this.htmlid}`, "aria-label": this.htmlAriaLabel || this.label }, this.renderSearchHelper(!!((_b = this.resultsItemsList) === null || _b === void 0 ? void 0 : _b.length)), this.renderItems(), this.renderShowAllResults()));
191
- }
192
- renderItems() {
193
- var _a;
194
- if (!((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length)) {
195
- return [];
196
- }
197
- const groupedItems = this.getGroupedItems(this.resultsItemsList);
198
- const listGroups = [];
199
- let counter = 0;
200
- Object.values(groupedItems).forEach((groupItem, index, array) => {
201
- if (this.checkResultsCount(counter)) {
202
- const listGroupsElements = [];
203
- groupItem.items.forEach((item, subindex, subarray) => {
204
- if (this.checkResultsCount(counter)) {
205
- const isLast = index === array.length - 1 && subindex === subarray.length - 1;
206
- listGroupsElements.push(this.renderItem(item, subindex, !isLast));
207
- }
208
- counter++;
209
- });
210
- if (listGroupsElements.length) {
211
- listGroups.push(h("z-list-group", { "divider-type": ListDividerType.ELEMENT }, this.renderItemCategory(groupItem), listGroupsElements));
212
- }
213
- }
214
- });
215
- return listGroups;
111
+ this.handleArrowsNavigation(e);
216
112
  }
217
113
  handleArrowsNavigation(e) {
218
- const currentElement = e.target;
219
- const arrows = [KeyboardCode.ARROW_DOWN, KeyboardCode.ARROW_UP];
220
- if (!arrows.includes(e.key)) {
221
- e.preventDefault();
114
+ var _a, _b, _c, _d, _e, _f;
115
+ if (![KeyboardCode.ARROW_DOWN, KeyboardCode.ARROW_UP].includes(e.key)) {
222
116
  return;
223
117
  }
224
- if (!this.items.length) {
225
- const list = this.element.shadowRoot.querySelector("z-list");
226
- if (!list) {
227
- return;
228
- }
229
- this.items = Array.from(list.querySelectorAll(".list-element"));
230
- }
231
- this.items.forEach((item) => {
232
- item.classList.toggle("focused", false);
233
- });
234
- const currentIndex = this.items.indexOf(currentElement);
118
+ const currentElement = e.target;
119
+ const items = Array.from((_b = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll("z-list .list-item")) !== null && _b !== void 0 ? _b : []);
120
+ const currentIndex = items.indexOf(currentElement);
235
121
  if (e.key === KeyboardCode.ARROW_DOWN) {
236
122
  e.preventDefault();
237
123
  const nextIndex = currentIndex + 1;
238
- if (nextIndex < this.items.length) {
239
- this.items[nextIndex].focus();
240
- this.items[nextIndex].classList.add("focused");
124
+ if (nextIndex < items.length) {
125
+ items[nextIndex].focus();
241
126
  }
242
127
  }
243
128
  if (e.key === KeyboardCode.ARROW_UP) {
244
129
  e.preventDefault();
245
130
  const prevIndex = currentIndex - 1;
246
131
  if (prevIndex < 0) {
247
- this.element.shadowRoot.querySelector("input").focus();
248
- this.element.shadowRoot
249
- .querySelector("input")
250
- .setSelectionRange(this.inputRef.value.length, this.inputRef.value.length);
132
+ (_d = (_c = this.host.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector("input")) === null || _d === void 0 ? void 0 : _d.focus();
133
+ (_f = (_e = this.host.shadowRoot) === null || _e === void 0 ? void 0 : _e.querySelector("input")) === null || _f === void 0 ? void 0 : _f.setSelectionRange(this.inputRef.value.length, this.inputRef.value.length);
251
134
  }
252
135
  if (prevIndex >= 0) {
253
- this.items[prevIndex].focus();
254
- this.items[prevIndex].classList.add("focused");
136
+ items[prevIndex].focus();
255
137
  }
256
138
  }
257
139
  }
258
- renderItem(item, key, divider) {
259
- return (h("z-list-element", { id: `list-item-${this.htmlid}-${key}`, tabIndex: 0, role: "option", dividerType: divider ? ListDividerType.ELEMENT : undefined, onKeyDown: (e) => this.handleArrowsNavigation(e) }, h("div", { class: "list-element", tabIndex: 0, onClick: () => this.emitSearchItemClick(item), onKeyDown: (e) => handleEnterKeydSubmit(e, () => this.emitSearchItemClick(item)), onMouseEnter: (e) => {
260
- const currentElement = e.target;
261
- currentElement.classList.add("hovered");
262
- }, onMouseLeave: (e) => {
263
- const currentElement = e.target;
264
- currentElement.classList.toggle("hovered", false);
265
- } }, h("span", { class: "item ellipsis" }, (item === null || item === void 0 ? void 0 : item.icon) && (h("z-icon", { class: "item-icon", name: item.icon })), h("span", { class: "item-label", title: item.label, innerHTML: this.renderItemLabel(item.label) })), (item === null || item === void 0 ? void 0 : item.tag) && h("z-tag", { icon: item.tag.icon }, !this.isMobile ? item.tag.text : "")), item.children && item.children.length > 0 ? (h("z-list", null, h("div", { class: "children-node" }, item.children.map((child, index) => this.renderItem(child, index, false))))) : null));
140
+ handleStopTyping(e) {
141
+ e.stopPropagation();
142
+ this.searchString = e.detail.value;
143
+ this.selectedItem = undefined;
144
+ }
145
+ handleSubmit() {
146
+ if (this.preventSubmit) {
147
+ return;
148
+ }
149
+ this.emitSearchSubmit();
150
+ }
151
+ handleOutsideClick(e) {
152
+ const cp = e.composedPath();
153
+ if (cp.includes(this.host)) {
154
+ return;
155
+ }
156
+ this.showResults = false;
157
+ }
158
+ componentWillLoad() {
159
+ this.resultsItemsList = this.getResultsItemsList();
160
+ this.mql = matchMedia("(max-width: 767px)");
161
+ this.onMobileViewChange = (e) => (this.isMobile = e.matches);
162
+ this.mql.addEventListener("change", this.onMobileViewChange);
163
+ this.isMobile = this.mql.matches;
164
+ }
165
+ disconnectedCallback() {
166
+ var _a;
167
+ (_a = this.mql) === null || _a === void 0 ? void 0 : _a.removeEventListener("change", this.onMobileViewChange);
266
168
  }
267
169
  renderItemLabel(label) {
268
170
  if (!this.searchString) {
@@ -270,41 +172,62 @@ export class ZSearchbar {
270
172
  }
271
173
  return label.replace(new RegExp(this.searchString.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "gmi"), (found) => `<mark>${found}</mark>`);
272
174
  }
273
- renderItemCategory(groupItem) {
274
- if (!(groupItem === null || groupItem === void 0 ? void 0 : groupItem.category)) {
275
- return null;
276
- }
277
- return (h("span", { class: "category-heading", slot: "header-title" }, h("span", { class: "category" }, groupItem.category), (groupItem === null || groupItem === void 0 ? void 0 : groupItem.subcategory) && h("span", { class: "subcategory" }, groupItem.subcategory)));
175
+ renderItem(item, index) {
176
+ var _a;
177
+ return (h("z-list-element", { id: `list-item-${this.htmlid}-${index}`, role: "presentation", htmlTabindex: -1, onKeyDown: (e) => this.onListItemKeyDown(e, item), onClick: () => this.emitSearchItemClick(item) }, h("div", { class: "list-item ellipsis", role: "option", tabindex: 0 }, !!(item === null || item === void 0 ? void 0 : item.icon) && (h("z-icon", { class: "item-icon", name: item.icon })), h("div", { class: "item-label body-3 mobile-body-4", title: item.label, innerHTML: this.renderItemLabel(item.label) }), !!(item === null || item === void 0 ? void 0 : item.tag) && h("z-tag", { icon: item.tag.icon }, !this.isMobile ? item.tag.text : "")), !!((_a = item.children) === null || _a === void 0 ? void 0 : _a.length) && (h("z-list", { class: "sub-list", role: "group", "aria-label": item.label || undefined }, item.children.map((child, index) => this.renderItem(child, index))))));
278
178
  }
279
- renderSearchHelper(hasDivider = true) {
280
- if (!this.autocomplete || this.preventSubmit || !this.searchString) {
281
- return null;
179
+ /**
180
+ * Renders the item grouped by category and subcategory. If `resultsCount` is set, it limits the number of rendered items.
181
+ */
182
+ renderItemGroups() {
183
+ var _a;
184
+ if (!((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length)) {
185
+ return;
282
186
  }
283
- return (h("z-list-element", { role: "option", dividerType: hasDivider ? ListDividerType.ELEMENT : undefined, id: `list-item-${this.htmlid}-search`, onKeyDown: (e) => this.handleArrowsNavigation(e) }, h("div", { tabindex: 0, onClick: () => this.emitSearchSubmit(), onKeyDown: (e) => handleEnterKeydSubmit(e, () => this.emitSearchSubmit()), class: "list-element" }, h("span", { class: "item item-search" }, h("z-icon", { class: "search-icon", name: "left-magnifying-glass" }), h("span", { class: "item-label", innerHTML: this.searchHelperLabel.replace("{searchString}", `<mark>${this.searchString}</mark>`) })))));
284
- }
285
- renderShowAllResults() {
286
- var _a, _b;
287
- if (!this.currResultsCount ||
288
- !this.searchString ||
289
- !((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length) ||
290
- this.currResultsCount >= ((_b = this.resultsItemsList) === null || _b === void 0 ? void 0 : _b.length)) {
291
- return null;
187
+ const groupedItems = Object.values(this.getGroupedItems());
188
+ const listGroups = [];
189
+ const hasResultsLimit = !!this.currResultsCount;
190
+ let renderedCount = 0;
191
+ for (const groupItem of groupedItems) {
192
+ const remaining = hasResultsLimit ? this.currResultsCount - renderedCount : groupItem.items.length;
193
+ if (remaining <= 0) {
194
+ break;
195
+ }
196
+ const visibleItems = groupItem.items.slice(0, remaining);
197
+ const listGroupsElements = visibleItems.map((item, subindex) => this.renderItem(item, subindex));
198
+ renderedCount += listGroupsElements.length;
199
+ if (!listGroupsElements.length) {
200
+ continue;
201
+ }
202
+ const ariaLabel = [groupItem.category, groupItem.subcategory].filter(Boolean).join(" ");
203
+ listGroups.push(h("z-list-group", { "aria-label": ariaLabel || undefined }, groupItem.category && (h("z-list-element", { class: "category-heading body-3 mobile-body-4", slot: "header-title", role: "presentation", htmlTabindex: -1 }, h("div", { class: "category" }, groupItem.category), groupItem.subcategory && h("div", { class: "subcategory" }, groupItem.subcategory))), listGroupsElements));
292
204
  }
293
- return (h("z-list-element", { role: "option", tabindex: 0, clickable: true, id: `list-item-${this.htmlid}-show-all`, onClickItem: () => (this.currResultsCount = 0), color: "color-primary01" }, h("div", { class: "item-show-all" }, "Vedi tutti i risultati")));
205
+ return listGroups;
294
206
  }
295
207
  render() {
296
- return (h(Host, { key: '6ccdb51d39d0e211de9b79cbbed90f4597b2c25b', onFocus: () => (this.showResults = true), onClick: (e) => this.handleOutsideClick(e), class: { "has-submit": this.showSearchButton, "has-results": this.autocomplete } }, h("div", { key: '90e51c50fe4b06429aad4d222cb26e5789183c30', class: "input-container" }, this.renderInput(), this.renderResults()), this.renderButton()));
208
+ var _a, _b, _c, _d, _e;
209
+ return (h(Host, { key: 'cf8441e139a28aa53bd6d61c4b17a12739998d59', onFocus: () => (this.showResults = true), onClick: (e) => this.handleOutsideClick(e), class: { "has-submit": !!this.showSearchButton, "has-results": !!this.autocomplete } }, h("div", { key: 'b24a5060ef65a27fa1096ca0056f1f2d566c9aca', class: "input-container" }, h("z-input", { key: 'fa2648f2a11a83dedbd9c1c5d00712675713936d', ref: (el) => (this.inputRef = el), htmlid: `input-${this.htmlid}`, message: false, placeholder: this.placeholder, onStopTyping: (e) => this.handleStopTyping(e), onKeyUp: (e) => {
210
+ handleEnterKeydSubmit(e, () => this.handleSubmit());
211
+ this.handleArrowsNavigation(e);
212
+ }, onFocus: () => (this.showResults = true), value: this.searchString || ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.label), size: this.size, label: this.label, "aria-label": this.htmlAriaLabel || this.placeholder || undefined }), !!(this.showResults &&
213
+ this.autocomplete &&
214
+ this.searchString &&
215
+ this.searchString.length >= this.autocompleteMinChars &&
216
+ this.resultsItemsList) && (h("div", { key: '060a4065341f54257d85e8989f55f3b6e8fe1505', class: "results z-scrollbar" }, this.preventSubmit && !((_b = this.resultsItemsList) === null || _b === void 0 ? void 0 : _b.length) ? (h("div", { class: "item-no-results body-3 mobile-body-4" }, "Non abbiamo trovato risultati per ", h("b", null, this.searchString), h("br", null), h("br", null), "Cosa puoi fare?", h("ul", null, h("li", null, "Verificare di aver scritto bene"), h("li", null, "Provare a cercare un'altra parola"), h("li", null, "Provare a cercare qualcosa di pi\u00F9 generico")))) : (h("z-list", { role: "listbox", id: `list-${this.htmlid}`, "aria-label": this.htmlAriaLabel || this.label || undefined }, this.autocomplete && !this.preventSubmit && !!this.searchString && (h("z-list-element", { role: "presentation", htmlTabindex: -1, id: `list-item-${this.htmlid}-search`, onKeyDown: (e) => this.onSearchHelperKeyDown(e), onClick: () => this.emitSearchSubmit() }, h("div", { class: "list-item item-search", role: "option", tabindex: 0 }, h("z-icon", { class: "search-icon", name: "left-magnifying-glass" }), h("div", { class: "item-label body-3 mobile-body-4", innerHTML: (_c = this.searchHelperLabel) === null || _c === void 0 ? void 0 : _c.replace("{searchString}", `<mark>${this.searchString}</mark>`) })))), this.renderItemGroups(), !!(this.searchString &&
217
+ ((_d = this.resultsItemsList) === null || _d === void 0 ? void 0 : _d.length) &&
218
+ this.currResultsCount &&
219
+ this.currResultsCount < ((_e = this.resultsItemsList) === null || _e === void 0 ? void 0 : _e.length)) && (h("z-list-element", { role: "presentation", htmlTabindex: -1, id: `list-item-${this.htmlid}-show-all` }, h("div", { role: "option", class: "item-show-all body-3 mobile-body-4", tabindex: 0, onClick: () => (this.currResultsCount = undefined) }, "Vedi tutti i risultati")))))))), this.showSearchButton && (h("z-button", { key: 'e37aec8f5feb61ab23fe0c497a11290d2b121375', icon: this.searchButtonIconOnly ? "search" : undefined, "aria-label": this.searchButtonIconOnly ? this.searchButtonLabel.trim() || "CERCA" : undefined, disabled: !!this.preventSubmit, variant: this.variant, size: this.size, onClick: () => this.handleSubmit() }, this.searchButtonIconOnly ? "" : this.searchButtonLabel.trim() || "CERCA"))));
297
220
  }
298
221
  static get is() { return "z-searchbar"; }
299
222
  static get encapsulation() { return "shadow"; }
300
223
  static get originalStyleUrls() {
301
224
  return {
302
- "$": ["styles.css", "../css-components/z-label/styles.css"]
225
+ "$": ["styles.css", "../css-components/z-label/styles.css", "../css-components/z-scrollbar/styles.css", "../../tokens/typography.css"]
303
226
  };
304
227
  }
305
228
  static get styleUrls() {
306
229
  return {
307
- "$": ["styles.css", "../css-components/z-label/styles.css"]
230
+ "$": ["styles.css", "../css-components/z-label/styles.css", "../css-components/z-scrollbar/styles.css", "../../tokens/typography.css"]
308
231
  };
309
232
  }
310
233
  static get properties() {
@@ -321,7 +244,7 @@ export class ZSearchbar {
321
244
  "optional": false,
322
245
  "docs": {
323
246
  "tags": [],
324
- "text": "the id of the searchbar element"
247
+ "text": "The id of the searchbar element"
325
248
  },
326
249
  "getter": false,
327
250
  "setter": false,
@@ -361,7 +284,7 @@ export class ZSearchbar {
361
284
  "optional": true,
362
285
  "docs": {
363
286
  "tags": [],
364
- "text": "the input label"
287
+ "text": "The input label"
365
288
  },
366
289
  "getter": false,
367
290
  "setter": false,
@@ -380,7 +303,7 @@ export class ZSearchbar {
380
303
  "optional": true,
381
304
  "docs": {
382
305
  "tags": [],
383
- "text": "the input aria-label"
306
+ "text": "The input aria-label"
384
307
  },
385
308
  "getter": false,
386
309
  "setter": false,
@@ -477,7 +400,7 @@ export class ZSearchbar {
477
400
  "optional": true,
478
401
  "docs": {
479
402
  "tags": [],
480
- "text": "Number of results shown - default all"
403
+ "text": "Number of results shown. Default: all"
481
404
  },
482
405
  "getter": false,
483
406
  "setter": false,
@@ -582,7 +505,7 @@ export class ZSearchbar {
582
505
  "optional": true,
583
506
  "docs": {
584
507
  "tags": [],
585
- "text": "Set button icon without label"
508
+ "text": "Hide the label of the submit button, showing only the icon"
586
509
  },
587
510
  "getter": false,
588
511
  "setter": false,
@@ -590,6 +513,26 @@ export class ZSearchbar {
590
513
  "attribute": "search-button-icon-only",
591
514
  "defaultValue": "false"
592
515
  },
516
+ "searchButtonLabel": {
517
+ "type": "string",
518
+ "mutable": false,
519
+ "complexType": {
520
+ "original": "string",
521
+ "resolved": "string",
522
+ "references": {}
523
+ },
524
+ "required": false,
525
+ "optional": true,
526
+ "docs": {
527
+ "tags": [],
528
+ "text": "The label of the submit button"
529
+ },
530
+ "getter": false,
531
+ "setter": false,
532
+ "reflect": false,
533
+ "attribute": "search-button-label",
534
+ "defaultValue": "\"CERCA\""
535
+ },
593
536
  "size": {
594
537
  "type": "string",
595
538
  "mutable": false,
@@ -609,7 +552,7 @@ export class ZSearchbar {
609
552
  "optional": true,
610
553
  "docs": {
611
554
  "tags": [],
612
- "text": "Available sizes: `big`, `small` and `x-small`. Defaults to `big`."
555
+ "text": "Size of the `z-input` and submit `z-button`"
613
556
  },
614
557
  "getter": false,
615
558
  "setter": false,
@@ -636,7 +579,7 @@ export class ZSearchbar {
636
579
  "optional": true,
637
580
  "docs": {
638
581
  "tags": [],
639
- "text": "Graphical variant: `primary`, `secondary`, `tertiary`. Defaults to `primary`."
582
+ "text": "Submit `z-button` variant"
640
583
  },
641
584
  "getter": false,
642
585
  "setter": false,
@@ -710,7 +653,7 @@ export class ZSearchbar {
710
653
  }
711
654
  }];
712
655
  }
713
- static get elementRef() { return "element"; }
656
+ static get elementRef() { return "host"; }
714
657
  static get watchers() {
715
658
  return [{
716
659
  "propName": "resultsItems",
@@ -724,9 +667,6 @@ export class ZSearchbar {
724
667
  }, {
725
668
  "propName": "searchString",
726
669
  "methodName": "watchSearchString"
727
- }, {
728
- "propName": "showResults",
729
- "methodName": "watchShowResults"
730
670
  }];
731
671
  }
732
672
  static get listeners() {
@@ -22,31 +22,19 @@ const StoryMeta = {
22
22
  "preventSubmit": false,
23
23
  "showSearchButton": false,
24
24
  "searchButtonIconOnly": false,
25
+ "searchButtonLabel": "",
25
26
  "autocomplete": false,
26
27
  "autocompleteMinChars": 3,
27
- "resultsCount": null,
28
+ "resultsCount": undefined,
28
29
  "searchHelperLabel": "Cerca {searchString}",
29
- "resultsItems": [
30
- {
31
- label: "first item",
32
- },
33
- {
34
- label: "second item",
35
- },
36
- {
37
- label: "third item",
38
- },
39
- {
40
- label: "fourth item",
41
- },
42
- ],
30
+ "resultsItems": [{ label: "first item" }, { label: "second item" }, { label: "third item" }, { label: "fourth item" }],
43
31
  "sortResultsItems": false,
44
32
  "htmlid": "myId",
45
33
  "placeholder": "my placeholder",
46
34
  "value": "",
47
35
  "label": "",
48
36
  "htmlAriaLabel": "",
49
- "--z-searchbar-results-height": "",
37
+ "--z-searchbar-results-height": "540px",
50
38
  "--z-searchbar-tag-text-color": "var(--color-primary03)",
51
39
  "--z-searchbar-tag-bg": "var(--color-hover-primary)",
52
40
  "size": ControlSize.BIG,
@@ -59,6 +47,7 @@ export const Default = {
59
47
  <z-searchbar
60
48
  prevent-submit=${args.preventSubmit}
61
49
  show-search-button=${args.showSearchButton}
50
+ search-button-label=${args.searchButtonLabel}
62
51
  search-button-icon-only=${args.searchButtonIconOnly}
63
52
  autocomplete=${args.autocomplete}
64
53
  autocomplete-min-chars=${args.autocompleteMinChars}
@@ -91,6 +80,7 @@ export const SimpleSearch = {
91
80
  prevent-submit="false"
92
81
  show-search-button=${args.showSearchButton}
93
82
  search-button-icon-only=${args.searchButtonIconOnly}
83
+ search-button-label=${args.searchButtonLabel}
94
84
  autcomplete="false"
95
85
  value=${args.value}
96
86
  placeholder=${args.placeholder}
@@ -107,12 +97,14 @@ export const Autocomplete = {
107
97
  htmlid: "myIdAutocomplete",
108
98
  showSearchButton: false,
109
99
  searchButtonIconOnly: false,
100
+ searchButtonLabel: "Cliccami",
110
101
  },
111
102
  render: (args) => html `
112
103
  <z-searchbar
113
104
  prevent-submit=${args.preventSubmit}
114
105
  show-search-button=${args.showSearchButton}
115
106
  search-button-icon-only=${args.searchButtonIconOnly}
107
+ search-button-label=${args.searchButtonLabel}
116
108
  autocomplete=${args.autocomplete}
117
109
  autocomplete-min-chars=${args.autocompleteMinChars}
118
110
  results-count=${args.resultsCount}
@@ -136,6 +128,7 @@ export const AutocompleteWithComplexItems = {
136
128
  htmlid: "myIdGroupedAutocomplete",
137
129
  showSearchButton: false,
138
130
  searchButtonIconOnly: false,
131
+ searchButtonLabel: "Cliccami",
139
132
  resultsItems: [
140
133
  {
141
134
  label: "first item",
@@ -184,6 +177,7 @@ export const AutocompleteWithComplexItems = {
184
177
  prevent-submit=${args.preventSubmit}
185
178
  show-search-button=${args.showSearchButton}
186
179
  search-button-icon-only=${args.searchButtonIconOnly}
180
+ search-button-label=${args.searchButtonLabel}
187
181
  autocomplete=${args.autocomplete}
188
182
  autocomplete-min-chars=${args.autocompleteMinChars}
189
183
  results-count=${args.resultsCount}
@@ -207,6 +201,7 @@ export const AutocompleteWithComplexTreeItems = {
207
201
  htmlid: "myIdGroupedAutocomplete",
208
202
  showSearchButton: false,
209
203
  searchButtonIconOnly: false,
204
+ searchButtonLabel: "Cliccami",
210
205
  resultsItems: [
211
206
  {
212
207
  label: "first item",
@@ -317,6 +312,7 @@ export const AutocompleteWithComplexTreeItems = {
317
312
  prevent-submit=${args.preventSubmit}
318
313
  show-search-button=${args.showSearchButton}
319
314
  search-button-icon-only=${args.searchButtonIconOnly}
315
+ search-button-label=${args.searchButtonLabel}
320
316
  autocomplete=${args.autocomplete}
321
317
  autocomplete-min-chars=${args.autocompleteMinChars}
322
318
  results-count=${args.resultsCount}