@zanichelli/albe-web-components 18.7.7-RC1 → 18.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (549) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/cjs/index-96af6326.js +4 -0
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/web-components-library.cjs.js +1 -1
  5. package/dist/cjs/z-alert.cjs.entry.js +1 -1
  6. package/dist/cjs/z-app-header_12.cjs.entry.js +18 -18
  7. package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -1
  8. package/dist/cjs/z-aria-alert.cjs.entry.js +1 -1
  9. package/dist/cjs/z-avatar.cjs.entry.js +2 -2
  10. package/dist/cjs/z-book-card.cjs.entry.js +15 -14
  11. package/dist/cjs/z-book-card.cjs.entry.js.map +1 -1
  12. package/dist/{components/placeholder-cover.js → cjs/z-book-cover.cjs.entry.js} +26 -2
  13. package/dist/cjs/z-book-cover.cjs.entry.js.map +1 -0
  14. package/dist/cjs/z-breadcrumb.cjs.entry.js +2 -2
  15. package/dist/cjs/z-button-sort.cjs.entry.js +1 -1
  16. package/dist/cjs/z-chip.cjs.entry.js +2 -2
  17. package/dist/cjs/z-combobox.cjs.entry.js +26 -41
  18. package/dist/cjs/z-combobox.cjs.entry.js.map +1 -1
  19. package/dist/cjs/z-cover-hero.cjs.entry.js +2 -2
  20. package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +4 -4
  21. package/dist/cjs/z-ghost-loading.cjs.entry.js +1 -1
  22. package/dist/cjs/z-info-box.cjs.entry.js +1 -1
  23. package/dist/cjs/z-info-reveal.cjs.entry.js +1 -1
  24. package/dist/cjs/z-logo.cjs.entry.js +1 -1
  25. package/dist/cjs/z-menu-section.cjs.entry.js +1 -1
  26. package/dist/cjs/z-myz-card-alert.cjs.entry.js +1 -1
  27. package/dist/cjs/z-myz-card-dictionary.cjs.entry.js +1 -1
  28. package/dist/cjs/z-myz-card-footer-sections.cjs.entry.js +1 -1
  29. package/dist/cjs/z-myz-card-footer.cjs.entry.js +1 -1
  30. package/dist/cjs/z-myz-card-icon.cjs.entry.js +1 -1
  31. package/dist/cjs/z-myz-card-info.cjs.entry.js +1 -1
  32. package/dist/cjs/z-myz-card-list.cjs.entry.js +1 -1
  33. package/dist/cjs/z-myz-card_4.cjs.entry.js +4 -4
  34. package/dist/cjs/z-myz-list-item.cjs.entry.js +1 -1
  35. package/dist/cjs/z-myz-list.cjs.entry.js +1 -1
  36. package/dist/cjs/z-navigation-tabs.cjs.entry.js +2 -2
  37. package/dist/cjs/z-notification.cjs.entry.js +1 -1
  38. package/dist/cjs/z-otp.cjs.entry.js +2 -2
  39. package/dist/cjs/z-panel-elem.cjs.entry.js +2 -2
  40. package/dist/cjs/z-popover.cjs.entry.js +1 -1
  41. package/dist/cjs/z-result-card.cjs.entry.js +6 -14
  42. package/dist/cjs/z-result-card.cjs.entry.js.map +1 -1
  43. package/dist/cjs/z-select.cjs.entry.js +2 -2
  44. package/dist/cjs/z-select.cjs.entry.js.map +1 -1
  45. package/dist/cjs/z-skip-to-content.cjs.entry.js +1 -1
  46. package/dist/cjs/z-stepper-item.cjs.entry.js +1 -1
  47. package/dist/cjs/z-stepper.cjs.entry.js +1 -1
  48. package/dist/cjs/z-toast-notification-list.cjs.entry.js +1 -1
  49. package/dist/cjs/z-toast-notification.cjs.entry.js +1 -1
  50. package/dist/cjs/z-toggle-button.cjs.entry.js +2 -2
  51. package/dist/cjs/z-toggle-switch.cjs.entry.js +3 -3
  52. package/dist/cjs/z-tooltip.cjs.entry.js +1 -1
  53. package/dist/cjs/z-visually-hidden.cjs.entry.js +1 -1
  54. package/dist/collection/collection-manifest.json +2 -1
  55. package/dist/collection/components/book-card/z-book-card/index.js +66 -29
  56. package/dist/collection/components/book-card/z-book-card/index.js.map +1 -1
  57. package/dist/collection/components/book-card/z-book-card/index.stories.js +11 -13
  58. package/dist/collection/components/book-card/z-book-card/index.stories.js.map +1 -1
  59. package/dist/collection/components/book-card/z-book-card/styles.css +35 -67
  60. package/dist/collection/components/z-app-header/index.js +2 -1
  61. package/dist/collection/components/z-app-header/index.js.map +1 -1
  62. package/dist/collection/components/z-app-header/index.stories.js +16 -0
  63. package/dist/collection/components/z-app-header/index.stories.js.map +1 -1
  64. package/dist/collection/components/z-app-header/styles.css +2 -1
  65. package/dist/collection/components/z-aria-alert/index.js +1 -1
  66. package/dist/collection/components/z-avatar/index.js +2 -2
  67. package/dist/collection/components/z-book-cover/index.js +113 -0
  68. package/dist/collection/components/z-book-cover/index.js.map +1 -0
  69. package/dist/collection/components/z-book-cover/index.stories.js +31 -0
  70. package/dist/collection/components/z-book-cover/index.stories.js.map +1 -0
  71. package/dist/collection/components/z-book-cover/styles.css +95 -0
  72. package/dist/collection/components/z-breadcrumb/index.js +2 -2
  73. package/dist/collection/components/z-button-sort/index.js +1 -1
  74. package/dist/collection/components/z-chip/index.js +2 -2
  75. package/dist/collection/components/z-combobox/index.js +25 -40
  76. package/dist/collection/components/z-combobox/index.js.map +1 -1
  77. package/dist/collection/components/z-combobox/styles.css +0 -8
  78. package/dist/collection/components/z-cover-hero/index.js +2 -2
  79. package/dist/collection/components/z-divider/index.js +1 -1
  80. package/dist/collection/components/z-ghost-loading/index.js +1 -1
  81. package/dist/collection/components/z-info-box/index.js +1 -1
  82. package/dist/collection/components/z-info-reveal/index.js +1 -1
  83. package/dist/collection/components/z-input/index.js +17 -19
  84. package/dist/collection/components/z-input/index.js.map +1 -1
  85. package/dist/collection/components/z-input-message/index.js +1 -1
  86. package/dist/collection/components/z-logo/index.js +1 -1
  87. package/dist/collection/components/z-menu-section/index.js +1 -1
  88. package/dist/collection/components/z-modal/index.js +4 -4
  89. package/dist/collection/components/z-navigation-tabs/index.js +2 -2
  90. package/dist/collection/components/z-notification/index.js +1 -1
  91. package/dist/collection/components/z-offcanvas/index.js +21 -1
  92. package/dist/collection/components/z-offcanvas/index.js.map +1 -1
  93. package/dist/collection/components/z-offcanvas/index.stories.js +12 -0
  94. package/dist/collection/components/z-offcanvas/index.stories.js.map +1 -1
  95. package/dist/collection/components/z-offcanvas/styles.css +5 -4
  96. package/dist/collection/components/z-panel-elem/index.js +2 -2
  97. package/dist/collection/components/z-popover/index.js +1 -1
  98. package/dist/collection/components/{result-card/z-result-card → z-result-card}/index.js +10 -18
  99. package/dist/collection/components/z-result-card/index.js.map +1 -0
  100. package/dist/collection/components/{result-card/z-result-card → z-result-card}/styles.css +39 -108
  101. package/dist/collection/components/z-result-card/z-result-card.stories.js.map +1 -0
  102. package/dist/collection/components/z-searchbar/index.js +1 -1
  103. package/dist/collection/components/z-select/index.js +2 -2
  104. package/dist/collection/components/z-select/index.js.map +1 -1
  105. package/dist/collection/components/z-skip-to-content/index.js +1 -1
  106. package/dist/collection/components/z-stepper/index.js +1 -1
  107. package/dist/collection/components/z-stepper-item/index.js +1 -1
  108. package/dist/collection/components/z-toast-notification/index.js +1 -1
  109. package/dist/collection/components/z-toast-notification-list/index.js +1 -1
  110. package/dist/collection/components/z-toggle-button/index.js +2 -2
  111. package/dist/collection/components/z-toggle-switch/index.js +3 -3
  112. package/dist/collection/components/z-tooltip/index.js +1 -1
  113. package/dist/collection/components/z-visually-hidden/index.js +1 -1
  114. package/dist/collection/snowflakes/myz/card/z-myz-card/index.js +1 -1
  115. package/dist/collection/snowflakes/myz/card/z-myz-card-alert/index.js +1 -1
  116. package/dist/collection/snowflakes/myz/card/z-myz-card-body/index.js +1 -1
  117. package/dist/collection/snowflakes/myz/card/z-myz-card-cover/index.js +1 -1
  118. package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/index.js +1 -1
  119. package/dist/collection/snowflakes/myz/card/z-myz-card-footer/index.js +1 -1
  120. package/dist/collection/snowflakes/myz/card/z-myz-card-footer-sections/index.js +1 -1
  121. package/dist/collection/snowflakes/myz/card/z-myz-card-header/index.js +1 -1
  122. package/dist/collection/snowflakes/myz/card/z-myz-card-icon/index.js +1 -1
  123. package/dist/collection/snowflakes/myz/card/z-myz-card-info/index.js +1 -1
  124. package/dist/collection/snowflakes/myz/card/z-myz-card-list/index.js +1 -1
  125. package/dist/collection/snowflakes/myz/list/z-myz-list/index.js +1 -1
  126. package/dist/collection/snowflakes/myz/list/z-myz-list-item/index.js +1 -1
  127. package/dist/collection/snowflakes/myz/z-alert/index.js +1 -1
  128. package/dist/collection/snowflakes/myz/z-otp/index.js +2 -2
  129. package/dist/components/index.d.ts +3 -1
  130. package/dist/components/index.js +1 -0
  131. package/dist/components/index.js.map +1 -1
  132. package/dist/components/index10.js +24 -65
  133. package/dist/components/index10.js.map +1 -1
  134. package/dist/components/index11.js +58 -308
  135. package/dist/components/index11.js.map +1 -1
  136. package/dist/components/index12.js +311 -37
  137. package/dist/components/index12.js.map +1 -1
  138. package/dist/components/index13.js +40 -27
  139. package/dist/components/index13.js.map +1 -1
  140. package/dist/components/index14.js +23 -151
  141. package/dist/components/index14.js.map +1 -1
  142. package/dist/components/index15.js +144 -37
  143. package/dist/components/index15.js.map +1 -1
  144. package/dist/components/index16.js +42 -1008
  145. package/dist/components/index16.js.map +1 -1
  146. package/dist/components/index17.js +1012 -37
  147. package/dist/components/index17.js.map +1 -1
  148. package/dist/components/index18.js +42 -10
  149. package/dist/components/index18.js.map +1 -1
  150. package/dist/components/index19.js +10 -22
  151. package/dist/components/index19.js.map +1 -1
  152. package/dist/components/index20.js +16 -33
  153. package/dist/components/index20.js.map +1 -1
  154. package/dist/components/index21.js +39 -43
  155. package/dist/components/index21.js.map +1 -1
  156. package/dist/components/index22.js +44 -81
  157. package/dist/components/index22.js.map +1 -1
  158. package/dist/components/index23.js +60 -430
  159. package/dist/components/index23.js.map +1 -1
  160. package/dist/components/index24.js +415 -341
  161. package/dist/components/index24.js.map +1 -1
  162. package/dist/components/index25.js +376 -19
  163. package/dist/components/index25.js.map +1 -1
  164. package/dist/components/index26.js +45 -0
  165. package/dist/components/index26.js.map +1 -0
  166. package/dist/components/index3.js +1 -1
  167. package/dist/components/index4.js +23 -60
  168. package/dist/components/index4.js.map +1 -1
  169. package/dist/components/index5.js +53 -27
  170. package/dist/components/index5.js.map +1 -1
  171. package/dist/components/index6.js +34 -18
  172. package/dist/components/index6.js.map +1 -1
  173. package/dist/components/index7.js +18 -41
  174. package/dist/components/index7.js.map +1 -1
  175. package/dist/components/index8.js +41 -11
  176. package/dist/components/index8.js.map +1 -1
  177. package/dist/components/index9.js +10 -28
  178. package/dist/components/index9.js.map +1 -1
  179. package/dist/components/z-accordion.js +1 -1
  180. package/dist/components/z-anchor-navigation.js +2 -2
  181. package/dist/components/z-app-header-deprecated.js +11 -11
  182. package/dist/components/z-app-header.js +13 -13
  183. package/dist/components/z-app-header.js.map +1 -1
  184. package/dist/components/z-aria-alert.js +1 -1
  185. package/dist/components/z-avatar.js +2 -2
  186. package/dist/components/z-book-card-app.js +2 -2
  187. package/dist/components/z-book-card-deprecated.js +1 -1
  188. package/dist/components/z-book-card.js +26 -17
  189. package/dist/components/z-book-card.js.map +1 -1
  190. package/dist/components/z-book-cover.d.ts +11 -0
  191. package/dist/components/z-book-cover.js +8 -0
  192. package/dist/components/z-book-cover.js.map +1 -0
  193. package/dist/components/z-breadcrumb.js +8 -8
  194. package/dist/components/z-button-sort.js +2 -2
  195. package/dist/components/z-button.js +1 -1
  196. package/dist/components/z-card.js +1 -1
  197. package/dist/components/z-carousel.js +3 -3
  198. package/dist/components/z-chip.js +1 -1
  199. package/dist/components/z-combobox.js +32 -47
  200. package/dist/components/z-combobox.js.map +1 -1
  201. package/dist/components/z-cover-hero.js +2 -2
  202. package/dist/components/z-date-picker.js +3 -3
  203. package/dist/components/z-divider.js +1 -1
  204. package/dist/components/z-dragdrop-area.js +1 -1
  205. package/dist/components/z-file-upload.js +4 -4
  206. package/dist/components/z-file.js +3 -3
  207. package/dist/components/z-ghost-loading.js +1 -1
  208. package/dist/components/z-icon.js +1 -1
  209. package/dist/components/z-info-box.js +2 -2
  210. package/dist/components/z-info-reveal.js +1 -1
  211. package/dist/components/z-input-message.js +1 -1
  212. package/dist/components/z-input.js +1 -1
  213. package/dist/components/z-list-element.js +1 -1
  214. package/dist/components/z-list-group.js +1 -1
  215. package/dist/components/z-list.js +1 -1
  216. package/dist/components/z-logo.js +1 -1
  217. package/dist/components/z-menu-deprecated.js +1 -1
  218. package/dist/components/z-menu-section-deprecated.js +1 -1
  219. package/dist/components/z-menu-section.js +2 -2
  220. package/dist/components/z-menu.js +1 -1
  221. package/dist/components/z-modal.js +1 -1
  222. package/dist/components/z-myz-card-alert.js +2 -2
  223. package/dist/components/z-myz-card-body.js +1 -1
  224. package/dist/components/z-myz-card-cover.js +1 -1
  225. package/dist/components/z-myz-card-dictionary.js +7 -7
  226. package/dist/components/z-myz-card-footer-sections.js +1 -1
  227. package/dist/components/z-myz-card-footer.js +1 -1
  228. package/dist/components/z-myz-card-header.js +1 -1
  229. package/dist/components/z-myz-card-icon.js +2 -2
  230. package/dist/components/z-myz-card-info.js +3 -3
  231. package/dist/components/z-myz-card-list.js +1 -1
  232. package/dist/components/z-myz-card.js +1 -1
  233. package/dist/components/z-myz-list-item.js +1 -1
  234. package/dist/components/z-myz-list.js +3 -3
  235. package/dist/components/z-navigation-tabs.js +3 -3
  236. package/dist/components/z-notification.js +2 -2
  237. package/dist/components/z-offcanvas.js +1 -1
  238. package/dist/components/z-otp.js +4 -4
  239. package/dist/components/z-pagination.js +4 -4
  240. package/dist/components/z-panel-elem.js +3 -3
  241. package/dist/components/z-popover.js +1 -1
  242. package/dist/components/z-range-picker.js +3 -3
  243. package/dist/components/z-result-card.js +14 -16
  244. package/dist/components/z-result-card.js.map +1 -1
  245. package/dist/components/z-searchbar.js +1 -1
  246. package/dist/components/z-section-title.js +1 -1
  247. package/dist/components/z-select.js +10 -10
  248. package/dist/components/z-select.js.map +1 -1
  249. package/dist/components/z-skip-to-content.js +1 -1
  250. package/dist/components/z-slideshow.js +1 -1
  251. package/dist/components/z-stepper-item.js +2 -2
  252. package/dist/components/z-stepper.js +1 -1
  253. package/dist/components/z-table.js +1 -1
  254. package/dist/components/z-tag.js +1 -1
  255. package/dist/components/z-td.js +3 -3
  256. package/dist/components/z-th.js +3 -3
  257. package/dist/components/z-toast-notification-list.js +1 -1
  258. package/dist/components/z-toast-notification.js +2 -2
  259. package/dist/components/z-toggle-button.js +3 -3
  260. package/dist/components/z-toggle-switch.js +4 -4
  261. package/dist/components/z-tooltip.js +2 -2
  262. package/dist/components/z-tr.js +2 -2
  263. package/dist/components/z-tree-list.js +4 -4
  264. package/dist/components/z-visually-hidden.js +1 -1
  265. package/dist/esm/index-c8ceadeb.js +4 -0
  266. package/dist/esm/loader.js +1 -1
  267. package/dist/esm/web-components-library.js +1 -1
  268. package/dist/esm/z-alert.entry.js +1 -1
  269. package/dist/esm/z-app-header_12.entry.js +18 -18
  270. package/dist/esm/z-app-header_12.entry.js.map +1 -1
  271. package/dist/esm/z-aria-alert.entry.js +1 -1
  272. package/dist/esm/z-avatar.entry.js +2 -2
  273. package/dist/esm/z-book-card.entry.js +15 -14
  274. package/dist/esm/z-book-card.entry.js.map +1 -1
  275. package/dist/{cjs/placeholder-cover-b679e768.js → esm/z-book-cover.entry.js} +21 -3
  276. package/dist/esm/z-book-cover.entry.js.map +1 -0
  277. package/dist/esm/z-breadcrumb.entry.js +2 -2
  278. package/dist/esm/z-button-sort.entry.js +1 -1
  279. package/dist/esm/z-chip.entry.js +2 -2
  280. package/dist/esm/z-combobox.entry.js +26 -41
  281. package/dist/esm/z-combobox.entry.js.map +1 -1
  282. package/dist/esm/z-cover-hero.entry.js +2 -2
  283. package/dist/esm/z-dragdrop-area_2.entry.js +4 -4
  284. package/dist/esm/z-ghost-loading.entry.js +1 -1
  285. package/dist/esm/z-info-box.entry.js +1 -1
  286. package/dist/esm/z-info-reveal.entry.js +1 -1
  287. package/dist/esm/z-logo.entry.js +1 -1
  288. package/dist/esm/z-menu-section.entry.js +1 -1
  289. package/dist/esm/z-myz-card-alert.entry.js +1 -1
  290. package/dist/esm/z-myz-card-dictionary.entry.js +1 -1
  291. package/dist/esm/z-myz-card-footer-sections.entry.js +1 -1
  292. package/dist/esm/z-myz-card-footer.entry.js +1 -1
  293. package/dist/esm/z-myz-card-icon.entry.js +1 -1
  294. package/dist/esm/z-myz-card-info.entry.js +1 -1
  295. package/dist/esm/z-myz-card-list.entry.js +1 -1
  296. package/dist/esm/z-myz-card_4.entry.js +4 -4
  297. package/dist/esm/z-myz-list-item.entry.js +1 -1
  298. package/dist/esm/z-myz-list.entry.js +1 -1
  299. package/dist/esm/z-navigation-tabs.entry.js +2 -2
  300. package/dist/esm/z-notification.entry.js +1 -1
  301. package/dist/esm/z-otp.entry.js +2 -2
  302. package/dist/esm/z-panel-elem.entry.js +2 -2
  303. package/dist/esm/z-popover.entry.js +1 -1
  304. package/dist/esm/z-result-card.entry.js +6 -14
  305. package/dist/esm/z-result-card.entry.js.map +1 -1
  306. package/dist/esm/z-select.entry.js +2 -2
  307. package/dist/esm/z-select.entry.js.map +1 -1
  308. package/dist/esm/z-skip-to-content.entry.js +1 -1
  309. package/dist/esm/z-stepper-item.entry.js +1 -1
  310. package/dist/esm/z-stepper.entry.js +1 -1
  311. package/dist/esm/z-toast-notification-list.entry.js +1 -1
  312. package/dist/esm/z-toast-notification.entry.js +1 -1
  313. package/dist/esm/z-toggle-button.entry.js +2 -2
  314. package/dist/esm/z-toggle-switch.entry.js +3 -3
  315. package/dist/esm/z-tooltip.entry.js +1 -1
  316. package/dist/esm/z-visually-hidden.entry.js +1 -1
  317. package/dist/types/components/book-card/z-book-card/index.d.ts +20 -16
  318. package/dist/types/components/book-card/z-book-card/index.stories.d.ts +2 -35
  319. package/dist/types/components/z-app-header/index.d.ts +1 -0
  320. package/dist/types/components/z-app-header/index.stories.d.ts +8 -0
  321. package/dist/types/components/z-book-cover/index.d.ts +23 -0
  322. package/dist/types/components/z-book-cover/index.stories.d.ts +21 -0
  323. package/dist/types/components/z-combobox/index.d.ts +1 -0
  324. package/dist/types/components/z-input/index.d.ts +4 -4
  325. package/dist/types/components/z-offcanvas/index.d.ts +2 -0
  326. package/dist/types/components/z-offcanvas/index.stories.d.ts +9 -0
  327. package/dist/types/components/{result-card/z-result-card → z-result-card}/index.d.ts +8 -26
  328. package/dist/types/components.d.ts +185 -76
  329. package/{www/build/p-8117a929.entry.js → dist/web-components-library/p-01f941c2.entry.js} +2 -2
  330. package/dist/web-components-library/{p-0756fe6f.entry.js → p-028dd72a.entry.js} +2 -2
  331. package/{www/build/p-e160545f.entry.js → dist/web-components-library/p-0990d475.entry.js} +2 -2
  332. package/{www/build/p-e160545f.entry.js.map → dist/web-components-library/p-0990d475.entry.js.map} +1 -1
  333. package/dist/web-components-library/{p-6ca0ee2f.entry.js → p-0a49dd1c.entry.js} +2 -2
  334. package/dist/web-components-library/{p-09ba466b.entry.js → p-240de9aa.entry.js} +2 -2
  335. package/dist/web-components-library/{p-f1c55eda.entry.js → p-28534fb5.entry.js} +2 -2
  336. package/{www/build/p-966cbf03.entry.js → dist/web-components-library/p-28d83c86.entry.js} +2 -2
  337. package/dist/web-components-library/{p-cbab66f7.entry.js → p-2bdac94e.entry.js} +2 -2
  338. package/dist/web-components-library/{p-e8419614.entry.js → p-2ffdfbb1.entry.js} +2 -2
  339. package/dist/web-components-library/p-31bd2a1c.entry.js +2 -0
  340. package/dist/web-components-library/p-31bd2a1c.entry.js.map +1 -0
  341. package/dist/web-components-library/{p-8c52635e.entry.js → p-4551b0df.entry.js} +2 -2
  342. package/dist/web-components-library/{p-e639e1bc.entry.js → p-460b2068.entry.js} +2 -2
  343. package/{www/build/p-0eab3c09.entry.js → dist/web-components-library/p-46ea0b2e.entry.js} +3 -3
  344. package/dist/web-components-library/{p-689b0280.entry.js → p-4a257653.entry.js} +2 -2
  345. package/dist/web-components-library/{p-8dec332e.entry.js → p-4aaf0172.entry.js} +2 -2
  346. package/dist/web-components-library/{p-d6d3a92a.entry.js → p-4affbb99.entry.js} +2 -2
  347. package/dist/web-components-library/{p-caa491ca.entry.js → p-5989465b.entry.js} +2 -2
  348. package/dist/web-components-library/{p-d8aa6afa.entry.js → p-5a1f98a2.entry.js} +2 -2
  349. package/{www/build/p-d0d54d42.entry.js → dist/web-components-library/p-5c5882c6.entry.js} +2 -2
  350. package/dist/web-components-library/{p-01302e57.entry.js → p-5f94986f.entry.js} +2 -2
  351. package/dist/web-components-library/p-6cff173f.entry.js +2 -0
  352. package/dist/web-components-library/{p-97608d16.entry.js.map → p-6cff173f.entry.js.map} +1 -1
  353. package/dist/web-components-library/p-6cffbabc.entry.js +2 -0
  354. package/{www/build/p-ac585bcd.entry.js.map → dist/web-components-library/p-6cffbabc.entry.js.map} +1 -1
  355. package/dist/web-components-library/{p-1ad8810a.entry.js → p-7194003a.entry.js} +2 -2
  356. package/{www/build/p-2b8eb0c2.entry.js → dist/web-components-library/p-78146cef.entry.js} +2 -2
  357. package/dist/web-components-library/{p-4fbcf534.entry.js → p-7a4f6a5b.entry.js} +2 -2
  358. package/dist/web-components-library/{p-6793061a.entry.js → p-7ceddb7a.entry.js} +2 -2
  359. package/dist/web-components-library/{p-4c730d4a.entry.js → p-86160fe3.entry.js} +2 -2
  360. package/dist/web-components-library/{p-63c1bde5.entry.js → p-863fd1c4.entry.js} +2 -2
  361. package/dist/web-components-library/p-8fc213c2.entry.js +2 -0
  362. package/dist/web-components-library/p-8fc213c2.entry.js.map +1 -0
  363. package/dist/web-components-library/{p-5cf3a797.entry.js → p-943db3a8.entry.js} +2 -2
  364. package/dist/web-components-library/{p-dc5ba112.entry.js → p-94916bdf.entry.js} +2 -2
  365. package/dist/web-components-library/p-a2e87cec.entry.js +2 -0
  366. package/dist/web-components-library/{p-badd98ad.entry.js → p-ac477ae7.entry.js} +2 -2
  367. package/dist/web-components-library/p-af5e8524.entry.js +2 -0
  368. package/dist/web-components-library/{p-7916e0f7.entry.js → p-b3f1b5c1.entry.js} +2 -2
  369. package/dist/web-components-library/{p-962c7f6b.entry.js → p-ceeb3e2a.entry.js} +2 -2
  370. package/dist/web-components-library/p-d60684d5.entry.js +2 -0
  371. package/dist/web-components-library/p-d60684d5.entry.js.map +1 -0
  372. package/dist/web-components-library/{p-cb1de7b4.entry.js → p-dc086eb5.entry.js} +2 -2
  373. package/dist/web-components-library/p-deb7f8d7.entry.js +2 -0
  374. package/dist/web-components-library/{p-6273db7f.entry.js → p-e0b88075.entry.js} +2 -2
  375. package/dist/web-components-library/p-e4bb1256.entry.js +2 -0
  376. package/dist/web-components-library/p-e4bb1256.entry.js.map +1 -0
  377. package/dist/web-components-library/{p-e231e811.entry.js → p-f487290e.entry.js} +2 -2
  378. package/dist/web-components-library/p-f4bac89b.entry.js +2 -0
  379. package/dist/web-components-library/p-f4bac89b.entry.js.map +1 -0
  380. package/dist/web-components-library/web-components-library.esm.js +1 -1
  381. package/dist/web-components-library/web-components-library.esm.js.map +1 -1
  382. package/package.json +2 -3
  383. package/react/components.d.ts +1 -0
  384. package/react/components.js +3 -2
  385. package/react/components.js.map +1 -1
  386. package/{dist/web-components-library/p-8117a929.entry.js → www/build/p-01f941c2.entry.js} +2 -2
  387. package/www/build/{p-0756fe6f.entry.js → p-028dd72a.entry.js} +2 -2
  388. package/{dist/web-components-library/p-e160545f.entry.js → www/build/p-0990d475.entry.js} +2 -2
  389. package/{dist/web-components-library/p-e160545f.entry.js.map → www/build/p-0990d475.entry.js.map} +1 -1
  390. package/www/build/{p-6ca0ee2f.entry.js → p-0a49dd1c.entry.js} +2 -2
  391. package/www/build/{p-09ba466b.entry.js → p-240de9aa.entry.js} +2 -2
  392. package/www/build/{p-f1c55eda.entry.js → p-28534fb5.entry.js} +2 -2
  393. package/{dist/web-components-library/p-966cbf03.entry.js → www/build/p-28d83c86.entry.js} +2 -2
  394. package/www/build/{p-cbab66f7.entry.js → p-2bdac94e.entry.js} +2 -2
  395. package/www/build/{p-e8419614.entry.js → p-2ffdfbb1.entry.js} +2 -2
  396. package/www/build/p-31bd2a1c.entry.js +2 -0
  397. package/www/build/p-31bd2a1c.entry.js.map +1 -0
  398. package/www/build/{p-8c52635e.entry.js → p-4551b0df.entry.js} +2 -2
  399. package/www/build/{p-e639e1bc.entry.js → p-460b2068.entry.js} +2 -2
  400. package/{dist/web-components-library/p-0eab3c09.entry.js → www/build/p-46ea0b2e.entry.js} +3 -3
  401. package/www/build/{p-689b0280.entry.js → p-4a257653.entry.js} +2 -2
  402. package/www/build/{p-8dec332e.entry.js → p-4aaf0172.entry.js} +2 -2
  403. package/www/build/{p-d6d3a92a.entry.js → p-4affbb99.entry.js} +2 -2
  404. package/www/build/{p-caa491ca.entry.js → p-5989465b.entry.js} +2 -2
  405. package/www/build/{p-d8aa6afa.entry.js → p-5a1f98a2.entry.js} +2 -2
  406. package/{dist/web-components-library/p-d0d54d42.entry.js → www/build/p-5c5882c6.entry.js} +2 -2
  407. package/www/build/{p-01302e57.entry.js → p-5f94986f.entry.js} +2 -2
  408. package/www/build/p-6cff173f.entry.js +2 -0
  409. package/www/build/{p-97608d16.entry.js.map → p-6cff173f.entry.js.map} +1 -1
  410. package/www/build/p-6cffbabc.entry.js +2 -0
  411. package/{dist/web-components-library/p-ac585bcd.entry.js.map → www/build/p-6cffbabc.entry.js.map} +1 -1
  412. package/www/build/{p-1ad8810a.entry.js → p-7194003a.entry.js} +2 -2
  413. package/{dist/web-components-library/p-2b8eb0c2.entry.js → www/build/p-78146cef.entry.js} +2 -2
  414. package/www/build/{p-4fbcf534.entry.js → p-7a4f6a5b.entry.js} +2 -2
  415. package/www/build/{p-6793061a.entry.js → p-7ceddb7a.entry.js} +2 -2
  416. package/www/build/{p-4c730d4a.entry.js → p-86160fe3.entry.js} +2 -2
  417. package/www/build/{p-63c1bde5.entry.js → p-863fd1c4.entry.js} +2 -2
  418. package/www/build/p-8fc213c2.entry.js +2 -0
  419. package/www/build/p-8fc213c2.entry.js.map +1 -0
  420. package/www/build/{p-5cf3a797.entry.js → p-943db3a8.entry.js} +2 -2
  421. package/www/build/{p-dc5ba112.entry.js → p-94916bdf.entry.js} +2 -2
  422. package/www/build/p-a2e87cec.entry.js +2 -0
  423. package/www/build/{p-badd98ad.entry.js → p-ac477ae7.entry.js} +2 -2
  424. package/www/build/p-af5e8524.entry.js +2 -0
  425. package/www/build/{p-7916e0f7.entry.js → p-b3f1b5c1.entry.js} +2 -2
  426. package/www/build/p-b716b49c.js +2 -0
  427. package/www/build/{p-962c7f6b.entry.js → p-ceeb3e2a.entry.js} +2 -2
  428. package/www/build/p-d60684d5.entry.js +2 -0
  429. package/www/build/p-d60684d5.entry.js.map +1 -0
  430. package/www/build/{p-cb1de7b4.entry.js → p-dc086eb5.entry.js} +2 -2
  431. package/www/build/p-deb7f8d7.entry.js +2 -0
  432. package/www/build/{p-6273db7f.entry.js → p-e0b88075.entry.js} +2 -2
  433. package/www/build/p-e4bb1256.entry.js +2 -0
  434. package/www/build/p-e4bb1256.entry.js.map +1 -0
  435. package/www/build/{p-e231e811.entry.js → p-f487290e.entry.js} +2 -2
  436. package/www/build/p-f4bac89b.entry.js +2 -0
  437. package/www/build/p-f4bac89b.entry.js.map +1 -0
  438. package/www/build/web-components-library.esm.js +1 -1
  439. package/www/build/web-components-library.esm.js.map +1 -1
  440. package/www/index.html +1 -1
  441. package/dist/cjs/placeholder-cover-b679e768.js.map +0 -1
  442. package/dist/collection/components/result-card/z-result-card/index.js.map +0 -1
  443. package/dist/collection/components/result-card/z-result-card/z-result-card.stories.js.map +0 -1
  444. package/dist/components/placeholder-cover.js.map +0 -1
  445. package/dist/esm/placeholder-cover-9346be8f.js +0 -5
  446. package/dist/esm/placeholder-cover-9346be8f.js.map +0 -1
  447. package/dist/web-components-library/p-165d5acc.entry.js +0 -2
  448. package/dist/web-components-library/p-165d5acc.entry.js.map +0 -1
  449. package/dist/web-components-library/p-310c2215.entry.js +0 -2
  450. package/dist/web-components-library/p-310c2215.entry.js.map +0 -1
  451. package/dist/web-components-library/p-3ed25564.entry.js +0 -2
  452. package/dist/web-components-library/p-67edb420.entry.js +0 -2
  453. package/dist/web-components-library/p-74819cbe.entry.js +0 -2
  454. package/dist/web-components-library/p-8d55127c.entry.js +0 -2
  455. package/dist/web-components-library/p-8d55127c.entry.js.map +0 -1
  456. package/dist/web-components-library/p-8d923a1d.js +0 -2
  457. package/dist/web-components-library/p-8d923a1d.js.map +0 -1
  458. package/dist/web-components-library/p-97608d16.entry.js +0 -2
  459. package/dist/web-components-library/p-abd17b10.entry.js +0 -2
  460. package/dist/web-components-library/p-abd17b10.entry.js.map +0 -1
  461. package/dist/web-components-library/p-ac585bcd.entry.js +0 -2
  462. package/www/build/p-165d5acc.entry.js +0 -2
  463. package/www/build/p-165d5acc.entry.js.map +0 -1
  464. package/www/build/p-310c2215.entry.js +0 -2
  465. package/www/build/p-310c2215.entry.js.map +0 -1
  466. package/www/build/p-3ed25564.entry.js +0 -2
  467. package/www/build/p-67edb420.entry.js +0 -2
  468. package/www/build/p-74819cbe.entry.js +0 -2
  469. package/www/build/p-8d55127c.entry.js +0 -2
  470. package/www/build/p-8d55127c.entry.js.map +0 -1
  471. package/www/build/p-8d923a1d.js +0 -2
  472. package/www/build/p-8d923a1d.js.map +0 -1
  473. package/www/build/p-97608d16.entry.js +0 -2
  474. package/www/build/p-abd17b10.entry.js +0 -2
  475. package/www/build/p-abd17b10.entry.js.map +0 -1
  476. package/www/build/p-ac585bcd.entry.js +0 -2
  477. package/www/build/p-f9314f48.js +0 -2
  478. /package/dist/collection/components/{result-card/z-result-card → z-result-card}/z-result-card.stories.js +0 -0
  479. /package/dist/types/components/{result-card/z-result-card → z-result-card}/z-result-card.stories.d.ts +0 -0
  480. /package/dist/web-components-library/{p-8117a929.entry.js.map → p-01f941c2.entry.js.map} +0 -0
  481. /package/dist/web-components-library/{p-0756fe6f.entry.js.map → p-028dd72a.entry.js.map} +0 -0
  482. /package/dist/web-components-library/{p-6ca0ee2f.entry.js.map → p-0a49dd1c.entry.js.map} +0 -0
  483. /package/dist/web-components-library/{p-09ba466b.entry.js.map → p-240de9aa.entry.js.map} +0 -0
  484. /package/dist/web-components-library/{p-f1c55eda.entry.js.map → p-28534fb5.entry.js.map} +0 -0
  485. /package/dist/web-components-library/{p-966cbf03.entry.js.map → p-28d83c86.entry.js.map} +0 -0
  486. /package/dist/web-components-library/{p-cbab66f7.entry.js.map → p-2bdac94e.entry.js.map} +0 -0
  487. /package/dist/web-components-library/{p-e8419614.entry.js.map → p-2ffdfbb1.entry.js.map} +0 -0
  488. /package/dist/web-components-library/{p-8c52635e.entry.js.map → p-4551b0df.entry.js.map} +0 -0
  489. /package/dist/web-components-library/{p-e639e1bc.entry.js.map → p-460b2068.entry.js.map} +0 -0
  490. /package/dist/web-components-library/{p-0eab3c09.entry.js.map → p-46ea0b2e.entry.js.map} +0 -0
  491. /package/dist/web-components-library/{p-689b0280.entry.js.map → p-4a257653.entry.js.map} +0 -0
  492. /package/dist/web-components-library/{p-8dec332e.entry.js.map → p-4aaf0172.entry.js.map} +0 -0
  493. /package/dist/web-components-library/{p-d6d3a92a.entry.js.map → p-4affbb99.entry.js.map} +0 -0
  494. /package/dist/web-components-library/{p-caa491ca.entry.js.map → p-5989465b.entry.js.map} +0 -0
  495. /package/dist/web-components-library/{p-d8aa6afa.entry.js.map → p-5a1f98a2.entry.js.map} +0 -0
  496. /package/dist/web-components-library/{p-d0d54d42.entry.js.map → p-5c5882c6.entry.js.map} +0 -0
  497. /package/dist/web-components-library/{p-01302e57.entry.js.map → p-5f94986f.entry.js.map} +0 -0
  498. /package/dist/web-components-library/{p-1ad8810a.entry.js.map → p-7194003a.entry.js.map} +0 -0
  499. /package/dist/web-components-library/{p-2b8eb0c2.entry.js.map → p-78146cef.entry.js.map} +0 -0
  500. /package/dist/web-components-library/{p-4fbcf534.entry.js.map → p-7a4f6a5b.entry.js.map} +0 -0
  501. /package/dist/web-components-library/{p-6793061a.entry.js.map → p-7ceddb7a.entry.js.map} +0 -0
  502. /package/dist/web-components-library/{p-4c730d4a.entry.js.map → p-86160fe3.entry.js.map} +0 -0
  503. /package/dist/web-components-library/{p-63c1bde5.entry.js.map → p-863fd1c4.entry.js.map} +0 -0
  504. /package/dist/web-components-library/{p-5cf3a797.entry.js.map → p-943db3a8.entry.js.map} +0 -0
  505. /package/dist/web-components-library/{p-dc5ba112.entry.js.map → p-94916bdf.entry.js.map} +0 -0
  506. /package/dist/web-components-library/{p-67edb420.entry.js.map → p-a2e87cec.entry.js.map} +0 -0
  507. /package/dist/web-components-library/{p-badd98ad.entry.js.map → p-ac477ae7.entry.js.map} +0 -0
  508. /package/dist/web-components-library/{p-3ed25564.entry.js.map → p-af5e8524.entry.js.map} +0 -0
  509. /package/dist/web-components-library/{p-7916e0f7.entry.js.map → p-b3f1b5c1.entry.js.map} +0 -0
  510. /package/dist/web-components-library/{p-962c7f6b.entry.js.map → p-ceeb3e2a.entry.js.map} +0 -0
  511. /package/dist/web-components-library/{p-cb1de7b4.entry.js.map → p-dc086eb5.entry.js.map} +0 -0
  512. /package/dist/web-components-library/{p-74819cbe.entry.js.map → p-deb7f8d7.entry.js.map} +0 -0
  513. /package/dist/web-components-library/{p-6273db7f.entry.js.map → p-e0b88075.entry.js.map} +0 -0
  514. /package/dist/web-components-library/{p-e231e811.entry.js.map → p-f487290e.entry.js.map} +0 -0
  515. /package/www/build/{p-8117a929.entry.js.map → p-01f941c2.entry.js.map} +0 -0
  516. /package/www/build/{p-0756fe6f.entry.js.map → p-028dd72a.entry.js.map} +0 -0
  517. /package/www/build/{p-6ca0ee2f.entry.js.map → p-0a49dd1c.entry.js.map} +0 -0
  518. /package/www/build/{p-09ba466b.entry.js.map → p-240de9aa.entry.js.map} +0 -0
  519. /package/www/build/{p-f1c55eda.entry.js.map → p-28534fb5.entry.js.map} +0 -0
  520. /package/www/build/{p-966cbf03.entry.js.map → p-28d83c86.entry.js.map} +0 -0
  521. /package/www/build/{p-cbab66f7.entry.js.map → p-2bdac94e.entry.js.map} +0 -0
  522. /package/www/build/{p-e8419614.entry.js.map → p-2ffdfbb1.entry.js.map} +0 -0
  523. /package/www/build/{p-8c52635e.entry.js.map → p-4551b0df.entry.js.map} +0 -0
  524. /package/www/build/{p-e639e1bc.entry.js.map → p-460b2068.entry.js.map} +0 -0
  525. /package/www/build/{p-0eab3c09.entry.js.map → p-46ea0b2e.entry.js.map} +0 -0
  526. /package/www/build/{p-689b0280.entry.js.map → p-4a257653.entry.js.map} +0 -0
  527. /package/www/build/{p-8dec332e.entry.js.map → p-4aaf0172.entry.js.map} +0 -0
  528. /package/www/build/{p-d6d3a92a.entry.js.map → p-4affbb99.entry.js.map} +0 -0
  529. /package/www/build/{p-caa491ca.entry.js.map → p-5989465b.entry.js.map} +0 -0
  530. /package/www/build/{p-d8aa6afa.entry.js.map → p-5a1f98a2.entry.js.map} +0 -0
  531. /package/www/build/{p-d0d54d42.entry.js.map → p-5c5882c6.entry.js.map} +0 -0
  532. /package/www/build/{p-01302e57.entry.js.map → p-5f94986f.entry.js.map} +0 -0
  533. /package/www/build/{p-1ad8810a.entry.js.map → p-7194003a.entry.js.map} +0 -0
  534. /package/www/build/{p-2b8eb0c2.entry.js.map → p-78146cef.entry.js.map} +0 -0
  535. /package/www/build/{p-4fbcf534.entry.js.map → p-7a4f6a5b.entry.js.map} +0 -0
  536. /package/www/build/{p-6793061a.entry.js.map → p-7ceddb7a.entry.js.map} +0 -0
  537. /package/www/build/{p-4c730d4a.entry.js.map → p-86160fe3.entry.js.map} +0 -0
  538. /package/www/build/{p-63c1bde5.entry.js.map → p-863fd1c4.entry.js.map} +0 -0
  539. /package/www/build/{p-5cf3a797.entry.js.map → p-943db3a8.entry.js.map} +0 -0
  540. /package/www/build/{p-dc5ba112.entry.js.map → p-94916bdf.entry.js.map} +0 -0
  541. /package/www/build/{p-67edb420.entry.js.map → p-a2e87cec.entry.js.map} +0 -0
  542. /package/www/build/{p-badd98ad.entry.js.map → p-ac477ae7.entry.js.map} +0 -0
  543. /package/www/build/{p-3ed25564.entry.js.map → p-af5e8524.entry.js.map} +0 -0
  544. /package/www/build/{p-7916e0f7.entry.js.map → p-b3f1b5c1.entry.js.map} +0 -0
  545. /package/www/build/{p-962c7f6b.entry.js.map → p-ceeb3e2a.entry.js.map} +0 -0
  546. /package/www/build/{p-cb1de7b4.entry.js.map → p-dc086eb5.entry.js.map} +0 -0
  547. /package/www/build/{p-74819cbe.entry.js.map → p-deb7f8d7.entry.js.map} +0 -0
  548. /package/www/build/{p-6273db7f.entry.js.map → p-e0b88075.entry.js.map} +0 -0
  549. /package/www/build/{p-e231e811.entry.js.map → p-f487290e.entry.js.map} +0 -0
@@ -1,402 +1,476 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { e as ControlSize, B as ButtonVariant, p as Device, l as ListDividerType, g as KeyboardCode } from './index2.js';
3
- import { r as randomId, g as getDevice, k as handleEnterKeydSubmit } from './utils.js';
4
- import { d as defineCustomElement$9 } from './index4.js';
5
- import { d as defineCustomElement$8 } from './index6.js';
6
- import { d as defineCustomElement$7 } from './index9.js';
7
- import { d as defineCustomElement$6 } from './index11.js';
8
- import { d as defineCustomElement$5 } from './index12.js';
9
- import { d as defineCustomElement$4 } from './index13.js';
10
- import { d as defineCustomElement$3 } from './index14.js';
11
- import { d as defineCustomElement$2 } from './index15.js';
12
- import { d as defineCustomElement$1 } from './index25.js';
2
+ import { P as PopoverPosition, g as KeyboardCode, p as Device } from './index2.js';
3
+ import { a as containsElement, i as findScrollableParent, g as getDevice, j as isElementVisibleInContainer } from './utils.js';
13
4
 
14
- const stylesCss = ":host{--z-searchbar-tag-text-color:var(--color-primary03);--z-searchbar-tag-bg:var(--color-hover-primary);--z-searchbar-item-height:44px;z-index:15;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}:host::part(list-item-container){display:block;min-height:unset;padding:0}.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)}.results::-webkit-scrollbar{width:6px;background:linear-gradient(to right, transparent 0 1px, var(--gray200) 1px 5px, transparent 5px 6px)}.results::-webkit-scrollbar-thumb{background-color:var(--color-primary01)}.results::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}@supports not selector(.results::-webkit-scrollbar-track){.results{scrollbar-color:var(--color-primary01) transparent}}.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-default-text);text-transform:uppercase}.results z-list-element{position:relative;display:block}z-list-element>.item-search{padding:var(--space-unit) 0}z-list z-list-element::before{position:absolute;z-index:100;top:5px;left:-20px;width:8px;height:1em;border-bottom:1px solid var(--color-disabled01-icon);border-left:1px solid var(--color-disabled01-icon);content:\"\";cursor:pointer}z-list z-list-element::after{position:absolute;z-index:100;top:5px;left:-20px;width:8px;height:100%;border-left:1px solid var(--color-disabled01-icon);content:\"\";cursor:pointer}z-list z-list-element:last-child::after{display:none}z-list>z-list-element::before,z-list>z-list-element::after,z-list>z-list-group>z-list-element::before,z-list>z-list-group>z-list-element::after{display:none}z-list>div.children-node{padding-left:calc(var(--space-unit) * 3)}.results z-list-element>.list-element{display:flex;justify-content:space-between;padding:calc(var(--space-unit) * 1.25) 0;cursor:pointer}.results z-list-element>.list-element:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}.results z-list-element>.list-element .item.ellipsis{overflow:hidden}.results z-list-element .list-element::after{position:absolute;top:0;right:0;display:block;width:100%;height:44px;content:\"\";transform:translateX(-100%)}.results z-list-element .list-element.focused.hovered::after{padding-left:6px}.results z-list-element>.list-element:hover,.results z-list-element>.list-element:hover::after{background-color:var(--color-background);cursor:pointer}.results z-list-element>.list-element>z-tag{border:1px solid var(--gray800);font-size:var(--font-size-1);font-weight:var(--font-sb);--z-tag-bg:var(--z-searchbar-tag-bg);--z-tag-text-color:var(--z-searchbar-tag-text-color)}.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-default-text);column-gap:calc(var(--space-unit) * 1.5);fill:var(--color-default-icon);font-size:var(--font-size-2);line-height:var(--font-size-6)}.results .item.ellipsis>.item-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.results .item>.item-label mark{background:var(--color-primary03)}.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}.results z-list-element>.list-element>z-tag{min-width:max-content}}@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\"]) z-list-element>.list-element,:host([size=\"small\"]) z-list-element>.item-search{padding:calc(var(--space-unit) * 0.75) 0}:host([size=\"x-small\"]) z-list-element>.list-element,:host([size=\"x-small\"]) z-list-element>.item-search{padding:calc(var(--space-unit) / 2) 0}:host([size=\"small\"]) z-list-element .list-element::after{height:36px}:host([size=\"x-small\"]) z-list-element .list-element::after{height:32px}";
15
- const ZSearchbarStyle0 = stylesCss;
5
+ const stylesCss = ":host{position:fixed;display:none;max-width:calc(100% - var(--grid-margin) * 2);max-height:calc(100% - var(--grid-margin) * 2);padding:var(--z-popover-padding, 0);background:var(--z-popover-theme--surface, var(--color-surface01));border-radius:var(--border-radius-small);color:var(--z-popover-theme--text, var(--color-default-text));fill:currentcolor;filter:var(--z-popover-shadow-filter, drop-shadow(0 1px 2px var(--shadow-color-base)));text-align:center;visibility:hidden;}:host([open]:not([open=\"false\"])[current-position]){display:block}:host([center][current-position=\"top\"]),:host([center][current-position=\"bottom\"]){transform:translateX(-50%)}:host([center][current-position=\"right\"]),:host([center][current-position=\"left\"]){transform:translateY(-50%)}:host([current-position^=\"top\"]){margin:0 0 var(--space-unit)}:host([current-position^=\"bottom\"]){margin:var(--space-unit) 0 0}:host([current-position^=\"left\"]){margin:0 var(--space-unit) 0 0}:host([current-position^=\"right\"]){margin:0 0 0 var(--space-unit)}:host([current-position])::before{--arrow-size:6px;--arrow-edge-offset:calc(100% - var(--space-unit) - (var(--arrow-size) / 2));--arrow-center-x-offset:calc(50% - (var(--arrow-size) / 2));--arrow-center-y-offset:calc(100% - (var(--arrow-size) / 2));position:absolute;display:block;width:var(--arrow-size);height:var(--arrow-size);background:var(--z-popover-theme--surface, var(--color-surface01));content:\"\";transform:rotate(45deg)}:host([show-arrow=\"false\"])::before,:host(:not([show-arrow]))::before{display:none}:host([current-position^=\"top\"])::before{top:var(--arrow-center-y-offset)}:host([current-position^=\"bottom\"])::before{bottom:var(--arrow-center-y-offset)}:host([current-position=\"top\"])::before,:host([current-position=\"bottom\"])::before{right:var(--arrow-edge-offset)}:host([current-position=\"right\"])::before,:host([current-position=\"left\"])::before{bottom:var(--arrow-edge-offset)}:host([current-position=\"right\"])::before{right:var(--arrow-center-y-offset)}:host([current-position=\"left\"])::before{left:var(--arrow-center-y-offset)}:host([current-position=\"top_right\"])::before,:host([current-position=\"bottom_right\"])::before{right:var(--arrow-edge-offset)}:host([current-position=\"top_left\"])::before,:host([current-position=\"bottom_left\"])::before{left:var(--arrow-edge-offset)}:host([current-position=\"right_top\"])::before,:host([current-position=\"left_top\"])::before{top:var(--arrow-edge-offset)}:host([current-position=\"right_top\"])::before,:host([current-position=\"right_bottom\"])::before{right:var(--arrow-center-y-offset)}:host([current-position=\"left_top\"])::before,:host([current-position=\"left_bottom\"])::before{left:var(--arrow-center-y-offset)}:host([current-position=\"right_bottom\"])::before,:host([current-position=\"left_bottom\"])::before{bottom:var(--arrow-edge-offset)}:host([center][current-position=\"top\"])::before,:host([center][current-position=\"bottom\"])::before{right:auto;left:var(--arrow-center-x-offset)}:host([center][current-position=\"right\"])::before,:host([center][current-position=\"left\"])::before{top:var(--arrow-center-x-offset);bottom:auto}";
6
+ const ZPopoverStyle0 = stylesCss;
16
7
 
17
- const ZSearchbar = /*@__PURE__*/ proxyCustomElement(class ZSearchbar extends HTMLElement {
8
+ const ZPopover = /*@__PURE__*/ proxyCustomElement(class ZPopover extends HTMLElement {
18
9
  constructor() {
19
10
  super();
20
11
  this.__registerHost();
21
12
  this.__attachShadow();
22
- this.searchSubmit = createEvent(this, "searchSubmit", 7);
23
- this.searchTyping = createEvent(this, "searchTyping", 7);
24
- this.searchItemClick = createEvent(this, "searchItemClick", 7);
25
- this.resultsItemsList = null;
26
- this.items = [];
27
- this.htmlid = `searchbar-${randomId()}`;
28
- this.preventSubmit = false;
29
- this.value = undefined;
30
- this.placeholder = undefined;
31
- this.autocomplete = false;
32
- this.autocompleteMinChars = 3;
33
- this.resultsCount = undefined;
34
- this.searchHelperLabel = "Cerca {searchString}";
35
- this.resultsItems = undefined;
36
- this.sortResultsItems = false;
37
- this.showSearchButton = false;
38
- this.searchButtonIconOnly = false;
39
- this.size = ControlSize.BIG;
40
- this.variant = ButtonVariant.PRIMARY;
41
- this.searchString = this.value;
42
- this.currResultsCount = 0;
43
- this.showResults = false;
44
- this.isMobile = false;
45
- this.selectedItem = undefined;
13
+ this.positionChange = createEvent(this, "positionChange", 7);
14
+ this.openChange = createEvent(this, "openChange", 7);
15
+ /** space tolerance for space calculations */
16
+ this.spaceTolerance = 3;
17
+ this.position = PopoverPosition.TOP;
18
+ this.open = false;
19
+ this.bindTo = undefined;
20
+ this.showArrow = false;
21
+ this.center = false;
22
+ this.closable = true;
23
+ this.currentPosition = undefined;
46
24
  }
47
- emitSearchSubmit() {
48
- this.searchSubmit.emit(this.inputRef.value);
49
- }
50
- emitSearchTyping(search) {
51
- this.searchTyping.emit(search);
52
- }
53
- emitSearchItemClick(item) {
54
- this.searchItemClick.emit(item);
55
- this.selectedItem = item;
56
- this.searchString = "";
57
- }
58
- watchItems() {
59
- this.resultsItemsList = this.getResultsItemsList();
60
- }
61
- watchResultsCount() {
62
- this.currResultsCount = this.resultsCount;
63
- }
64
- watchValue() {
65
- this.searchString = this.value;
66
- }
67
- watchSearchString() {
68
- this.emitSearchTyping(this.searchString);
69
- this.items = [];
70
- if (!this.searchString) {
71
- this.currResultsCount = this.resultsCount;
25
+ closePopoverWithKeyboard(e) {
26
+ if (this.closable && e.key === KeyboardCode.ESC) {
27
+ this.open = false;
72
28
  }
73
29
  }
74
- watchShowResults() {
75
- if (!this.showResults) {
76
- this.items = [];
30
+ /**
31
+ * Close the popover when clicking outside of its content.
32
+ * Stop event propagation if the click was fired by popover's trigger element,
33
+ * to prevent close and reopen glitches.
34
+ */
35
+ handleOutsideClick(e) {
36
+ const target = e.target;
37
+ if (!this.closable || !this.open || containsElement(this.host, target)) {
38
+ return;
77
39
  }
78
- }
79
- disconnectedCallback() {
80
- var _a;
81
- (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
82
- }
83
- componentDidLoad() {
84
- this.resizeObserver = new ResizeObserver(() => {
85
- if (getDevice() === Device.MOBILE && !this.isMobile) {
86
- this.isMobile = true;
87
- }
88
- if (getDevice() !== Device.MOBILE && this.isMobile) {
89
- this.isMobile = false;
90
- }
91
- });
92
- this.resizeObserver.observe(this.element);
93
- }
94
- componentWillLoad() {
95
- this.resultsItemsList = this.getResultsItemsList();
96
- this.currResultsCount = this.resultsCount;
97
- }
98
- getResultsItemsList() {
99
- return typeof this.resultsItems === "string" ? JSON.parse(this.resultsItems) : this.resultsItems;
100
- }
101
- getGroupedItems(items) {
102
- const groupedItems = {};
103
- items.forEach((item) => {
104
- var _a;
105
- const key = `${item === null || item === void 0 ? void 0 : item.category}${item === null || item === void 0 ? void 0 : item.subcategory}`;
106
- groupedItems[key] = (_a = groupedItems[key]) !== null && _a !== void 0 ? _a : {
107
- category: item === null || item === void 0 ? void 0 : item.category,
108
- subcategory: item === null || item === void 0 ? void 0 : item.subcategory,
109
- items: [],
110
- };
111
- groupedItems[key]["items"].push(item);
112
- });
113
- if (this.sortResultsItems) {
114
- return Object.keys(groupedItems)
115
- .sort()
116
- .reduce((obj, key) => {
117
- obj[key] = Object.assign(Object.assign({}, groupedItems[key]), { items: groupedItems[key]["items"].sort((a, b) => {
118
- const nameA = a.label.toUpperCase();
119
- const nameB = b.label.toUpperCase();
120
- if (nameA < nameB) {
121
- return -1;
122
- }
123
- if (nameA > nameB) {
124
- return 1;
125
- }
126
- return 0;
127
- }) });
128
- return obj;
129
- }, {});
40
+ if (containsElement(this.boundElement, target)) {
41
+ // stop propagation if the click was on the trigger element to prevent close and reopen glitches
42
+ e.stopPropagation();
130
43
  }
131
- return groupedItems;
44
+ this.open = false;
132
45
  }
133
- checkResultsCount(counter) {
134
- if (!this.currResultsCount || counter < this.currResultsCount) {
135
- return true;
46
+ validatePosition(newValue) {
47
+ if (!Object.values(PopoverPosition).includes(newValue) || newValue === PopoverPosition.AUTO) {
48
+ newValue = PopoverPosition.TOP;
49
+ this.position = newValue;
136
50
  }
137
- return false;
138
- }
139
- handleStopTyping(e) {
140
- e.stopPropagation();
141
- this.searchString = e.detail.value;
142
- if (this.selectedItem) {
143
- this.selectedItem = undefined;
51
+ this.currentPosition = newValue;
52
+ if (this.open) {
53
+ this.setPosition();
144
54
  }
145
55
  }
146
- handleSubmit() {
147
- if (this.preventSubmit) {
56
+ /** Setup popover behaviors when `open` changes. */
57
+ onOpen() {
58
+ cancelAnimationFrame(this.animationFrameRequestId);
59
+ this.openChange.emit({ open: this.open });
60
+ if (!this.open) {
61
+ Object.assign(this.host.style, {
62
+ // Reset all positioning properties
63
+ top: "auto",
64
+ right: "auto",
65
+ bottom: "auto",
66
+ left: "auto",
67
+ maxWidth: "",
68
+ maxHeight: "",
69
+ // Set initial visibility to hidden while calculating position...
70
+ visibility: "hidden",
71
+ });
72
+ this.currentPosition = undefined;
148
73
  return;
149
74
  }
150
- this.emitSearchSubmit();
75
+ const updatePositionLoop = () => {
76
+ if (!this.open) {
77
+ return;
78
+ }
79
+ this.setPosition();
80
+ this.animationFrameRequestId = requestAnimationFrame(updatePositionLoop);
81
+ };
82
+ // call `setPosition` after a tick to ensure the DOM is ready and sizes are available
83
+ setTimeout(() => {
84
+ updatePositionLoop();
85
+ }, 0);
151
86
  }
152
- handleOutsideClick(e) {
153
- const cp = e.composedPath();
154
- const searchbar = cp.find((elem) => elem.nodeName === "Z-SEARCHBAR");
155
- if (!searchbar || searchbar.htmlid !== this.htmlid) {
156
- this.showResults = false;
157
- return;
158
- }
159
- 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")); })) {
160
- this.showResults = true;
161
- return;
162
- }
163
- this.showResults = false;
87
+ onBindingChange() {
88
+ this.findBoundElement();
164
89
  }
165
- renderInput() {
166
- var _a;
167
- return (h("z-input", { ref: (val) => {
168
- this.inputRef = val;
169
- }, htmlid: `input-${this.htmlid}`, message: false, placeholder: this.placeholder, onStopTyping: (e) => this.handleStopTyping(e), onKeyUp: (e) => {
170
- handleEnterKeydSubmit(e, () => this.handleSubmit());
171
- this.handleArrowsNavigation(e);
172
- }, value: this.searchString || ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.label), ariaLabel: this.placeholder, size: this.size }));
90
+ /** Returns the offset modifier to use in calculations to align the popover with the bound element. */
91
+ get offsetModifier() {
92
+ return this.center ? 0.5 : 0;
173
93
  }
174
- renderButton() {
175
- if (!this.showSearchButton) {
176
- return null;
94
+ findBoundElement() {
95
+ if (typeof this.bindTo === "string") {
96
+ this.boundElement = this.host.ownerDocument.querySelector(this.bindTo);
177
97
  }
178
- const iconProp = this.searchButtonIconOnly ? { icon: "search" } : null;
179
- const buttonLabel = this.searchButtonIconOnly ? "" : "CERCA";
180
- const ariaLabel = this.searchButtonIconOnly ? { "aria-label": "CERCA" } : null;
181
- const defaultProps = Object.assign(Object.assign({ disabled: this.preventSubmit, variant: this.variant, size: this.size, onClick: () => this.handleSubmit() }, iconProp), ariaLabel);
182
- return h("z-button", Object.assign({}, defaultProps), buttonLabel);
183
- }
184
- renderResults() {
185
- if (!this.showResults ||
186
- !this.autocomplete ||
187
- !this.searchString ||
188
- this.searchString.length < this.autocompleteMinChars ||
189
- !this.resultsItemsList) {
190
- return null;
98
+ else if (this.bindTo) {
99
+ this.boundElement = this.bindTo;
191
100
  }
192
- return (h("div", { class: "results-wrapper" }, h("div", { class: "results" }, this.renderResultsList())));
193
- }
194
- renderResultsList() {
195
- var _a, _b;
196
- if (this.preventSubmit && !((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length)) {
197
- 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"))));
101
+ else {
102
+ this.boundElement = this.host.parentElement;
198
103
  }
199
- return (h("z-list", { role: "listbox", id: `list-${this.htmlid}` }, this.renderSearchHelper(!!((_b = this.resultsItemsList) === null || _b === void 0 ? void 0 : _b.length)), this.renderItems(), this.renderShowAllResults()));
200
104
  }
201
- renderItems() {
202
- var _a;
203
- if (!((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length)) {
204
- return [];
105
+ /**
106
+ * Check if element has enough space to the right and left to be centered.
107
+ * Used for `TOP` and `BOTTOM` position.
108
+ * When `center` is not enabled, only one side needs to be checked and `RIGHT` is the default.
109
+ */
110
+ hasCenteredHorizontalSpace(availableLeft, availableRight, hostWidth, boundElementWidth) {
111
+ const requiredSideSpace = (hostWidth - boundElementWidth) * (1 - this.offsetModifier);
112
+ if (!this.center) {
113
+ return availableRight >= requiredSideSpace - this.spaceTolerance;
205
114
  }
206
- const groupedItems = this.getGroupedItems(this.resultsItemsList);
207
- const listGroups = [];
208
- let counter = 0;
209
- Object.values(groupedItems).forEach((groupItem, index, array) => {
210
- if (this.checkResultsCount(counter)) {
211
- const listGroupsElements = [];
212
- groupItem.items.forEach((item, subindex, subarray) => {
213
- if (this.checkResultsCount(counter)) {
214
- const isLast = index === array.length - 1 && subindex === subarray.length - 1;
215
- listGroupsElements.push(this.renderItem(item, subindex, !isLast));
216
- }
217
- counter++;
218
- });
219
- if (listGroupsElements.length) {
220
- listGroups.push(h("z-list-group", { "divider-type": ListDividerType.ELEMENT }, this.renderItemCategory(groupItem), listGroupsElements));
221
- }
222
- }
223
- });
224
- return listGroups;
115
+ return (availableRight >= requiredSideSpace - this.spaceTolerance &&
116
+ availableLeft >= requiredSideSpace - this.spaceTolerance);
225
117
  }
226
- handleArrowsNavigation(e) {
227
- const currentElement = e.target;
228
- const arrows = [KeyboardCode.ARROW_DOWN, KeyboardCode.ARROW_UP];
229
- if (!arrows.includes(e.key)) {
230
- e.preventDefault();
231
- return;
118
+ /**
119
+ * Check if element has enough space to the top and bottom to be centered.
120
+ * Used for `RIGHT` and `LEFT` position.
121
+ * When `center` is not enabled, only one side needs to be checked and `BOTTOM` is the default.
122
+ */
123
+ hasCenteredVerticalSpace(availableTop, availableBottom, hostHeight, boundElementHeight) {
124
+ const requiredSideSpace = (hostHeight - boundElementHeight) * (1 - this.offsetModifier);
125
+ if (!this.center) {
126
+ return availableBottom >= requiredSideSpace - this.spaceTolerance;
232
127
  }
233
- if (!this.items.length) {
234
- const list = this.element.shadowRoot.querySelector("z-list");
235
- if (!list) {
236
- return;
128
+ return (availableTop >= requiredSideSpace - this.spaceTolerance &&
129
+ availableBottom >= requiredSideSpace - this.spaceTolerance);
130
+ }
131
+ /**
132
+ * Check if there is enough space in the given direction to fit the popover.
133
+ * Used for composed positions like TOP_RIGHT, LEFT_BOTTOM, etc.
134
+ */
135
+ hasEnoughSideSpace(availableSpace, hostSize, boundElementSize, offsetModifier) {
136
+ return availableSpace >= hostSize - boundElementSize * (1 - offsetModifier) - this.spaceTolerance;
137
+ }
138
+ /**
139
+ * Given a desired position and available space around the bound element, returns the best position
140
+ * that fits the popover, trying all positions if needed.
141
+ * Takes into account offsetModifier for centering.
142
+ * @param desiredPosition The desired position of the popover.
143
+ * @param availableSpace The available space around the bound element.
144
+ */
145
+ getOptimalPopoverPosition(desiredPosition, availableSpace) {
146
+ const hostWidth = this.host.offsetWidth;
147
+ const hostHeight = this.host.offsetHeight;
148
+ const boundElementWidth = this.boundElement.getBoundingClientRect().width;
149
+ const boundElementHeight = this.boundElement.getBoundingClientRect().height;
150
+ const offsetModifier = this.offsetModifier;
151
+ /** Check if there is enough space to fit the popover in the desired position */
152
+ const fits = (pos) => {
153
+ switch (pos) {
154
+ case PopoverPosition.TOP:
155
+ return (availableSpace.top >= hostHeight - this.spaceTolerance &&
156
+ this.hasCenteredHorizontalSpace(availableSpace.left, availableSpace.right, hostWidth, boundElementWidth));
157
+ case PopoverPosition.TOP_RIGHT:
158
+ return (availableSpace.top >= hostHeight &&
159
+ this.hasEnoughSideSpace(availableSpace.right, hostWidth, boundElementWidth, offsetModifier));
160
+ case PopoverPosition.TOP_LEFT:
161
+ return (availableSpace.top >= hostHeight &&
162
+ this.hasEnoughSideSpace(availableSpace.left, hostWidth, boundElementWidth, offsetModifier));
163
+ case PopoverPosition.RIGHT:
164
+ return (availableSpace.right >= hostWidth &&
165
+ this.hasCenteredVerticalSpace(availableSpace.top, availableSpace.bottom, hostHeight, boundElementHeight));
166
+ case PopoverPosition.RIGHT_BOTTOM:
167
+ return (availableSpace.right >= hostWidth &&
168
+ this.hasEnoughSideSpace(availableSpace.bottom, hostHeight, boundElementHeight, offsetModifier));
169
+ case PopoverPosition.RIGHT_TOP:
170
+ return (availableSpace.right >= hostWidth &&
171
+ this.hasEnoughSideSpace(availableSpace.top, hostHeight, boundElementHeight, offsetModifier));
172
+ case PopoverPosition.BOTTOM:
173
+ return (availableSpace.bottom >= hostHeight &&
174
+ this.hasCenteredHorizontalSpace(availableSpace.left, availableSpace.right, hostWidth, boundElementWidth));
175
+ case PopoverPosition.BOTTOM_LEFT:
176
+ return (availableSpace.bottom >= hostHeight &&
177
+ this.hasEnoughSideSpace(availableSpace.left, hostWidth, boundElementWidth, offsetModifier));
178
+ case PopoverPosition.BOTTOM_RIGHT:
179
+ return (availableSpace.bottom >= hostHeight &&
180
+ this.hasEnoughSideSpace(availableSpace.right, hostWidth, boundElementWidth, offsetModifier));
181
+ case PopoverPosition.LEFT:
182
+ return (availableSpace.left >= hostWidth &&
183
+ this.hasCenteredVerticalSpace(availableSpace.top, availableSpace.bottom, hostHeight, boundElementHeight));
184
+ case PopoverPosition.LEFT_TOP:
185
+ return (availableSpace.left >= hostWidth &&
186
+ this.hasEnoughSideSpace(availableSpace.top, hostHeight, boundElementHeight, offsetModifier));
187
+ case PopoverPosition.LEFT_BOTTOM:
188
+ return (availableSpace.left >= hostWidth &&
189
+ this.hasEnoughSideSpace(availableSpace.bottom, hostHeight, boundElementHeight, offsetModifier));
190
+ default:
191
+ return false;
237
192
  }
238
- this.items = Array.from(list.querySelectorAll(".list-element"));
193
+ };
194
+ // Check desired position first
195
+ if (fits(desiredPosition)) {
196
+ return desiredPosition;
239
197
  }
240
- this.items.forEach((item) => item.classList.contains("focused") && item.classList.remove("focused"));
241
- const currentIndex = this.items.indexOf(currentElement);
242
- if (e.key === KeyboardCode.ARROW_DOWN) {
243
- e.preventDefault();
244
- const nextIndex = currentIndex + 1;
245
- if (nextIndex < this.items.length) {
246
- this.items[nextIndex].focus();
247
- this.items[nextIndex].classList.add("focused");
248
- }
198
+ // Find position index and create rotation starting from next position
199
+ const positions = ZPopover.positionOrder;
200
+ const startIndex = positions.indexOf(desiredPosition);
201
+ if (startIndex === -1) {
202
+ return desiredPosition; // fallback if position not found
249
203
  }
250
- if (e.key === KeyboardCode.ARROW_UP) {
251
- e.preventDefault();
252
- const prevIndex = currentIndex - 1;
253
- if (prevIndex < 0) {
254
- this.element.shadowRoot.querySelector("input").focus();
255
- this.element.shadowRoot
256
- .querySelector("input")
257
- .setSelectionRange(this.inputRef.value.length, this.inputRef.value.length);
258
- }
259
- if (prevIndex >= 0) {
260
- this.items[prevIndex].focus();
261
- this.items[prevIndex].classList.add("focused");
204
+ // Try all other positions starting from the next one
205
+ for (let i = 1; i < positions.length; i++) {
206
+ const posIndex = (startIndex + i) % positions.length;
207
+ const pos = positions[posIndex];
208
+ if (fits(pos)) {
209
+ return pos;
262
210
  }
263
211
  }
212
+ return this.findBestFallbackPosition(availableSpace);
264
213
  }
265
- renderItem(item, key, divider) {
266
- 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) => {
267
- const currentElement = e.target;
268
- currentElement.classList.add("hovered");
269
- }, onMouseLeave: (e) => {
270
- const currentElement = e.target;
271
- currentElement.classList.contains("hovered") && currentElement.classList.remove("hovered");
272
- } }, 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));
214
+ /** Find the best fallback position based on available space when no position fits perfectly. */
215
+ findBestFallbackPosition(availableSpace) {
216
+ // Determine which horizontal and vertical direction has the most available space
217
+ const bestHorizontalDirection = availableSpace.right >= availableSpace.left ? PopoverPosition.RIGHT : PopoverPosition.LEFT;
218
+ const bestVerticalDirection = availableSpace.bottom >= availableSpace.top ? PopoverPosition.BOTTOM : PopoverPosition.TOP;
219
+ // Choose the main direction based on which axis has more space overall
220
+ const maxHorizontalSpace = Math.max(availableSpace.right, availableSpace.left);
221
+ const maxVerticalSpace = Math.max(availableSpace.bottom, availableSpace.top);
222
+ const mainDirection = maxVerticalSpace >= maxHorizontalSpace ? bestVerticalDirection : bestHorizontalDirection;
223
+ // Decide if a secondary direction is needed
224
+ // Only add a secondary direction if the difference between min and max in that axis is at least double
225
+ let needsSecondaryDirection = false;
226
+ if (mainDirection === bestVerticalDirection) {
227
+ // If main direction is vertical, check horizontal space difference
228
+ const minHorizontalSpace = Math.min(availableSpace.right, availableSpace.left);
229
+ needsSecondaryDirection = maxHorizontalSpace >= minHorizontalSpace * 2;
230
+ }
231
+ else {
232
+ // If main direction is horizontal, check vertical space difference
233
+ const minVerticalSpace = Math.min(availableSpace.bottom, availableSpace.top);
234
+ needsSecondaryDirection = maxVerticalSpace >= minVerticalSpace * 2;
235
+ }
236
+ if (!needsSecondaryDirection) {
237
+ return mainDirection;
238
+ }
239
+ const secondaryDirection = mainDirection === bestVerticalDirection ? bestHorizontalDirection : bestVerticalDirection;
240
+ // Return a combined position (e.g., "bottom_right")
241
+ return `${mainDirection}_${secondaryDirection}`;
273
242
  }
274
- renderItemLabel(label) {
275
- if (!this.searchString) {
276
- return label;
243
+ /**
244
+ * Calculate available space around the element bound with the popover, based on its nearest scrollable ancestor.
245
+ *
246
+ * Calculations for `right` and `bottom` can be a little bit confusing because `boundingRect.right` and `bottom` may not be what you expect...
247
+ * For more information see the explanation in the docs.
248
+ * @link https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#return_value
249
+ */
250
+ calculateAvailableSpace() {
251
+ const boundElementRect = this.boundElement.getBoundingClientRect();
252
+ if (this.lastBoundRect &&
253
+ this.lastBoundRect.x === boundElementRect.x &&
254
+ this.lastBoundRect.y === boundElementRect.y &&
255
+ this.lastBoundRect.width === boundElementRect.width &&
256
+ this.lastBoundRect.height === boundElementRect.height &&
257
+ this.cachedAvailableSpace) {
258
+ // If the bound element's rect hasn't changed, return the cached rect
259
+ return this.cachedAvailableSpace;
277
260
  }
278
- return label.replace(new RegExp(this.searchString.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "gmi"), (found) => `<mark>${found}</mark>`);
261
+ this.lastBoundRect = boundElementRect;
262
+ const scrollableParent = findScrollableParent(this.boundElement);
263
+ const scrollableParentRect = scrollableParent.getBoundingClientRect();
264
+ const hasNestedScrollableParent = scrollableParent !== this.boundElement.ownerDocument.documentElement;
265
+ const documentWidth = this.boundElement.ownerDocument.documentElement.clientWidth;
266
+ const documentHeight = this.boundElement.ownerDocument.documentElement.clientHeight;
267
+ const safeSpace = 8; // extra space to avoid popover being too close to the edges
268
+ // These deltas represent the offset between the scrollable parent and the viewport.
269
+ // They are used to adjust the available space calculations when the scrollable parent is not the document or body,
270
+ // to try to fit the popover inside the scrollable parent.
271
+ const deltaTop = hasNestedScrollableParent ? scrollableParentRect.top : 0;
272
+ const deltaRight = hasNestedScrollableParent ? documentWidth - scrollableParentRect.right : 0;
273
+ const deltaBottom = hasNestedScrollableParent ? documentHeight - scrollableParentRect.bottom : 0;
274
+ const deltaLeft = hasNestedScrollableParent ? scrollableParentRect.left : 0;
275
+ this.cachedAvailableSpace = {
276
+ top: boundElementRect.top - deltaTop - safeSpace,
277
+ right: documentWidth - boundElementRect.right - deltaRight - safeSpace,
278
+ bottom: documentHeight - boundElementRect.bottom - deltaBottom - safeSpace,
279
+ left: boundElementRect.left - deltaLeft - safeSpace,
280
+ };
281
+ return this.cachedAvailableSpace;
282
+ }
283
+ /** Calculate the space around an element relative to the viewport. */
284
+ calculateElementOffsets(element) {
285
+ const elementRect = element.getBoundingClientRect();
286
+ const viewportWidth = element.ownerDocument.documentElement.clientWidth;
287
+ const viewportHeight = element.ownerDocument.documentElement.clientHeight;
288
+ return {
289
+ top: elementRect.top,
290
+ right: viewportWidth - elementRect.right,
291
+ bottom: viewportHeight - elementRect.bottom,
292
+ left: elementRect.left,
293
+ };
279
294
  }
280
- renderItemCategory(groupItem) {
281
- if (!(groupItem === null || groupItem === void 0 ? void 0 : groupItem.category)) {
282
- return null;
295
+ /** Apply positioning styles based on passed position. */
296
+ applyPositionStyles(position, availableSpace) {
297
+ const boundElementWidth = this.boundElement.offsetWidth;
298
+ const boundElementHeight = this.boundElement.offsetHeight;
299
+ /** Distance between the popover and the bound element */
300
+ const distanceFromBound = 8;
301
+ const offsetModifier = this.offsetModifier;
302
+ /** Distance between the arrow center and the popover edge. Needed to align the center of the arrow with the center of the bound element when `showArrow` and `center` are enabled. */
303
+ const arrowModifier = this.showArrow && this.center ? 8 : 0;
304
+ const hostStyle = this.host.style;
305
+ const boundElementOffsets = this.calculateElementOffsets(this.boundElement);
306
+ let maxWidth;
307
+ let maxHeight;
308
+ switch (position) {
309
+ case PopoverPosition.TOP:
310
+ case PopoverPosition.TOP_RIGHT:
311
+ hostStyle.bottom = `${boundElementOffsets.bottom + boundElementHeight}px`;
312
+ hostStyle.left = `${boundElementOffsets.left + boundElementWidth * offsetModifier - (position === PopoverPosition.TOP_RIGHT ? arrowModifier : 0)}px`;
313
+ maxHeight = availableSpace.top - distanceFromBound;
314
+ if (position === PopoverPosition.TOP_RIGHT) {
315
+ maxWidth = availableSpace.right + boundElementWidth * offsetModifier;
316
+ }
317
+ break;
318
+ case PopoverPosition.TOP_LEFT:
319
+ hostStyle.right = `${boundElementOffsets.right + boundElementWidth * offsetModifier - arrowModifier}px`;
320
+ hostStyle.bottom = `${boundElementOffsets.bottom + boundElementHeight}px`;
321
+ maxWidth = availableSpace.left + boundElementWidth * offsetModifier;
322
+ maxHeight = availableSpace.top - distanceFromBound;
323
+ break;
324
+ case PopoverPosition.BOTTOM:
325
+ case PopoverPosition.BOTTOM_RIGHT:
326
+ hostStyle.top = `${boundElementOffsets.top + boundElementHeight}px`;
327
+ hostStyle.left = `${boundElementOffsets.left + boundElementWidth * offsetModifier - (position === PopoverPosition.BOTTOM_RIGHT ? arrowModifier : 0)}px`;
328
+ maxHeight = availableSpace.bottom - distanceFromBound;
329
+ if (position === PopoverPosition.BOTTOM_RIGHT) {
330
+ maxWidth = availableSpace.right + boundElementWidth * offsetModifier;
331
+ }
332
+ break;
333
+ case PopoverPosition.BOTTOM_LEFT:
334
+ hostStyle.top = `${boundElementOffsets.top + boundElementHeight}px`;
335
+ hostStyle.right = `${boundElementOffsets.right + boundElementWidth * offsetModifier - arrowModifier}px`;
336
+ maxWidth = availableSpace.left + boundElementWidth * offsetModifier;
337
+ maxHeight = availableSpace.bottom - distanceFromBound;
338
+ break;
339
+ case PopoverPosition.RIGHT:
340
+ case PopoverPosition.RIGHT_BOTTOM:
341
+ hostStyle.top = `${boundElementOffsets.top + boundElementHeight * offsetModifier - (position === PopoverPosition.RIGHT_BOTTOM ? arrowModifier : 0)}px`;
342
+ hostStyle.left = `${boundElementOffsets.left + boundElementWidth}px`;
343
+ maxWidth = availableSpace.right - distanceFromBound;
344
+ if (position === PopoverPosition.RIGHT) {
345
+ maxHeight = availableSpace.top + availableSpace.bottom + boundElementHeight;
346
+ }
347
+ else {
348
+ maxHeight = availableSpace.bottom + boundElementHeight * offsetModifier;
349
+ }
350
+ break;
351
+ case PopoverPosition.RIGHT_TOP:
352
+ hostStyle.bottom = `${boundElementOffsets.bottom + boundElementHeight * offsetModifier - arrowModifier}px`;
353
+ hostStyle.left = `${boundElementOffsets.left + boundElementWidth}px`;
354
+ maxWidth = availableSpace.right - distanceFromBound;
355
+ maxHeight = availableSpace.top + boundElementHeight * offsetModifier;
356
+ break;
357
+ case PopoverPosition.LEFT:
358
+ case PopoverPosition.LEFT_BOTTOM:
359
+ hostStyle.top = `${boundElementOffsets.top + boundElementHeight * offsetModifier - (position === PopoverPosition.LEFT_BOTTOM ? arrowModifier : 0)}px`;
360
+ hostStyle.right = `${boundElementOffsets.right + boundElementWidth}px`;
361
+ maxWidth = availableSpace.left - distanceFromBound;
362
+ if (position === PopoverPosition.LEFT_BOTTOM) {
363
+ maxHeight = availableSpace.bottom + boundElementHeight * offsetModifier;
364
+ }
365
+ break;
366
+ case PopoverPosition.LEFT_TOP:
367
+ hostStyle.right = `${boundElementOffsets.right + boundElementWidth}px`;
368
+ hostStyle.bottom = `${boundElementOffsets.bottom + boundElementHeight * offsetModifier - arrowModifier}px`;
369
+ maxWidth = availableSpace.left - distanceFromBound;
370
+ maxHeight = availableSpace.top + boundElementHeight * offsetModifier;
371
+ break;
372
+ }
373
+ if (getDevice() !== Device.MOBILE) {
374
+ // Only force max sizes on non-mobile viewports
375
+ Object.assign(hostStyle, {
376
+ maxWidth: maxWidth ? `${maxWidth}px` : "",
377
+ maxHeight: maxHeight ? `${maxHeight}px` : "",
378
+ });
283
379
  }
284
- 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)));
285
380
  }
286
- renderSearchHelper(hasDivider = true) {
287
- if (!this.autocomplete || this.preventSubmit || !this.searchString) {
288
- return null;
381
+ /** Set the position of the popover. */
382
+ setPosition() {
383
+ if (!this.boundElement) {
384
+ return;
385
+ }
386
+ if (!isElementVisibleInContainer(this.boundElement, findScrollableParent(this.boundElement))) {
387
+ // If the bound element is not visible, hide the popover too
388
+ this.open = false;
389
+ return;
289
390
  }
290
- 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>`) })))));
391
+ Object.assign(this.host.style, {
392
+ // Reset all positioning properties
393
+ top: "auto",
394
+ right: "auto",
395
+ bottom: "auto",
396
+ left: "auto",
397
+ maxWidth: "",
398
+ maxHeight: "",
399
+ // Set initial visibility to hidden while calculating position...
400
+ visibility: "hidden",
401
+ });
402
+ const availableSpace = this.calculateAvailableSpace();
403
+ const position = this.getOptimalPopoverPosition(this.position, availableSpace);
404
+ this.applyPositionStyles(position, availableSpace);
405
+ this.currentPosition = position;
406
+ this.positionChange.emit({ position: this.currentPosition });
407
+ // ...then restore the visibility
408
+ this.host.style.visibility = "visible";
291
409
  }
292
- renderShowAllResults() {
293
- var _a, _b;
294
- if (!this.currResultsCount ||
295
- !this.searchString ||
296
- !((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length) ||
297
- this.currResultsCount >= ((_b = this.resultsItemsList) === null || _b === void 0 ? void 0 : _b.length)) {
298
- return null;
410
+ componentWillLoad() {
411
+ this.validatePosition(this.position);
412
+ }
413
+ componentDidLoad() {
414
+ this.findBoundElement();
415
+ if (this.open) {
416
+ this.onOpen();
299
417
  }
300
- 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")));
418
+ }
419
+ disconnectedCallback() {
420
+ cancelAnimationFrame(this.animationFrameRequestId);
301
421
  }
302
422
  render() {
303
- return (h(Host, { key: '0ecc3fd73df3cf20449c6b241b526153e08caddb', onFocus: () => (this.showResults = true), onClick: (e) => this.handleOutsideClick(e), class: { "has-submit": this.showSearchButton, "has-results": this.autocomplete } }, h("div", { key: '860e5fea6661aad7aaa4ddfdf0e340754cf5275e', class: "input-container" }, this.renderInput(), this.renderResults()), this.renderButton()));
423
+ return (h(Host, { key: 'aeb6c7ccabc279af16d9a957e732ad611612589f', "current-position": this.currentPosition }, h("slot", { key: '77fecb1bbfa49e1a8f97c078e7cef01a03420d9c' })));
304
424
  }
305
- get element() { return this; }
425
+ get host() { return this; }
306
426
  static get watchers() { return {
307
- "resultsItems": ["watchItems"],
308
- "resultsCount": ["watchResultsCount"],
309
- "value": ["watchValue"],
310
- "searchString": ["watchSearchString"],
311
- "showResults": ["watchShowResults"]
427
+ "position": ["validatePosition"],
428
+ "open": ["onOpen"],
429
+ "bindTo": ["onBindingChange"]
312
430
  }; }
313
- static get style() { return ZSearchbarStyle0; }
314
- }, [1, "z-searchbar", {
315
- "htmlid": [513],
316
- "preventSubmit": [4, "prevent-submit"],
317
- "value": [1],
318
- "placeholder": [1],
319
- "autocomplete": [4],
320
- "autocompleteMinChars": [2, "autocomplete-min-chars"],
321
- "resultsCount": [2, "results-count"],
322
- "searchHelperLabel": [1, "search-helper-label"],
323
- "resultsItems": [1, "results-items"],
324
- "sortResultsItems": [4, "sort-results-items"],
325
- "showSearchButton": [4, "show-search-button"],
326
- "searchButtonIconOnly": [4, "search-button-icon-only"],
327
- "size": [1],
328
- "variant": [1],
329
- "searchString": [32],
330
- "currResultsCount": [32],
331
- "showResults": [32],
332
- "isMobile": [32],
333
- "selectedItem": [32]
334
- }, [[4, "click", "handleOutsideClick"]], {
335
- "resultsItems": ["watchItems"],
336
- "resultsCount": ["watchResultsCount"],
337
- "value": ["watchValue"],
338
- "searchString": ["watchSearchString"],
339
- "showResults": ["watchShowResults"]
431
+ static get style() { return ZPopoverStyle0; }
432
+ }, [1, "z-popover", {
433
+ "position": [1537],
434
+ "open": [1540],
435
+ "bindTo": [1, "bind-to"],
436
+ "showArrow": [516, "show-arrow"],
437
+ "center": [516],
438
+ "closable": [4],
439
+ "currentPosition": [32]
440
+ }, [[8, "keyup", "closePopoverWithKeyboard"], [18, "click", "handleOutsideClick"]], {
441
+ "position": ["validatePosition"],
442
+ "open": ["onOpen"],
443
+ "bindTo": ["onBindingChange"]
340
444
  }]);
445
+ // Clockwise order of positions.
446
+ ZPopover.positionOrder = [
447
+ PopoverPosition.TOP,
448
+ PopoverPosition.TOP_RIGHT,
449
+ PopoverPosition.TOP_LEFT,
450
+ PopoverPosition.RIGHT,
451
+ PopoverPosition.RIGHT_BOTTOM,
452
+ PopoverPosition.RIGHT_TOP,
453
+ PopoverPosition.BOTTOM,
454
+ PopoverPosition.BOTTOM_LEFT,
455
+ PopoverPosition.BOTTOM_RIGHT,
456
+ PopoverPosition.LEFT,
457
+ PopoverPosition.LEFT_TOP,
458
+ PopoverPosition.LEFT_BOTTOM,
459
+ ];
341
460
  function defineCustomElement() {
342
461
  if (typeof customElements === "undefined") {
343
462
  return;
344
463
  }
345
- const components = ["z-searchbar", "z-button", "z-divider", "z-icon", "z-input", "z-input-message", "z-list", "z-list-element", "z-list-group", "z-tag"];
464
+ const components = ["z-popover"];
346
465
  components.forEach(tagName => { switch (tagName) {
347
- case "z-searchbar":
348
- if (!customElements.get(tagName)) {
349
- customElements.define(tagName, ZSearchbar);
350
- }
351
- break;
352
- case "z-button":
353
- if (!customElements.get(tagName)) {
354
- defineCustomElement$9();
355
- }
356
- break;
357
- case "z-divider":
358
- if (!customElements.get(tagName)) {
359
- defineCustomElement$8();
360
- }
361
- break;
362
- case "z-icon":
363
- if (!customElements.get(tagName)) {
364
- defineCustomElement$7();
365
- }
366
- break;
367
- case "z-input":
368
- if (!customElements.get(tagName)) {
369
- defineCustomElement$6();
370
- }
371
- break;
372
- case "z-input-message":
373
- if (!customElements.get(tagName)) {
374
- defineCustomElement$5();
375
- }
376
- break;
377
- case "z-list":
378
- if (!customElements.get(tagName)) {
379
- defineCustomElement$4();
380
- }
381
- break;
382
- case "z-list-element":
383
- if (!customElements.get(tagName)) {
384
- defineCustomElement$3();
385
- }
386
- break;
387
- case "z-list-group":
388
- if (!customElements.get(tagName)) {
389
- defineCustomElement$2();
390
- }
391
- break;
392
- case "z-tag":
466
+ case "z-popover":
393
467
  if (!customElements.get(tagName)) {
394
- defineCustomElement$1();
468
+ customElements.define(tagName, ZPopover);
395
469
  }
396
470
  break;
397
471
  } });
398
472
  }
399
473
 
400
- export { ZSearchbar as Z, defineCustomElement as d };
474
+ export { ZPopover as Z, defineCustomElement as d };
401
475
 
402
476
  //# sourceMappingURL=index24.js.map