@zanichelli/albe-web-components 20.0.2-RC → 21.0.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 (354) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/z-app-header_12.cjs.entry.js +7 -1
  3. package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -1
  4. package/dist/collection/components/z-input/index.js +7 -1
  5. package/dist/collection/components/z-input/index.js.map +1 -1
  6. package/dist/components/index.js +1 -1
  7. package/dist/components/index.js.map +1 -1
  8. package/dist/components/{utils.js → p-8C_CrFxp.js} +3 -3
  9. package/dist/components/p-B3VFztJH.js +6 -0
  10. package/dist/components/p-B5U9pSXR.js +2 -0
  11. package/dist/components/{index14.js.map → p-B5U9pSXR.js.map} +1 -1
  12. package/dist/components/p-B6jtvVtV.js +2 -0
  13. package/dist/components/{utils2.js.map → p-B6jtvVtV.js.map} +1 -1
  14. package/dist/components/{_commonjsHelpers.js → p-B85MJLTf.js} +1 -1
  15. package/dist/components/p-BAguKZnb.js +2 -0
  16. package/dist/components/{index4.js.map → p-BAguKZnb.js.map} +1 -1
  17. package/dist/components/p-BbZelagf.js +2 -0
  18. package/dist/components/{index20.js.map → p-BbZelagf.js.map} +1 -1
  19. package/dist/components/p-BeSVHdId.js +2 -0
  20. package/dist/components/{index9.js.map → p-BeSVHdId.js.map} +1 -1
  21. package/dist/components/p-Bj8MyegH.js +2 -0
  22. package/dist/components/{index18.js.map → p-Bj8MyegH.js.map} +1 -1
  23. package/dist/components/p-BoiZb7m1.js +2 -0
  24. package/dist/components/{index13.js.map → p-BoiZb7m1.js.map} +1 -1
  25. package/dist/components/p-BolVsvfr.js +2 -0
  26. package/dist/components/{index5.js.map → p-BolVsvfr.js.map} +1 -1
  27. package/dist/components/p-CGSP8diU.js +2 -0
  28. package/dist/components/{index15.js.map → p-CGSP8diU.js.map} +1 -1
  29. package/dist/components/p-CJjo0ntH.js +2 -0
  30. package/dist/components/{index12.js.map → p-CJjo0ntH.js.map} +1 -1
  31. package/dist/components/p-CaSvyuw6.js +2 -0
  32. package/dist/components/{index17.js.map → p-CaSvyuw6.js.map} +1 -1
  33. package/dist/components/p-CbXEdwLi.js +2 -0
  34. package/dist/components/{index3.js.map → p-CbXEdwLi.js.map} +1 -1
  35. package/dist/components/p-CdBqnUF6.js +2 -0
  36. package/dist/components/{index7.js.map → p-CdBqnUF6.js.map} +1 -1
  37. package/dist/components/p-Ch6o4_VN.js +2 -0
  38. package/dist/components/{index21.js.map → p-Ch6o4_VN.js.map} +1 -1
  39. package/dist/components/{iconset.js → p-D1c5gR45.js} +1 -1
  40. package/dist/components/p-D8wde41u.js +2 -0
  41. package/dist/components/{index16.js.map → p-D8wde41u.js.map} +1 -1
  42. package/dist/components/p-DL2QAfIP.js +2 -0
  43. package/dist/components/{index11.js.map → p-DL2QAfIP.js.map} +1 -1
  44. package/dist/components/{index2.js → p-DdetsoIY.js} +1 -1
  45. package/dist/components/p-LXvmZzZa.js +2 -0
  46. package/dist/components/p-LXvmZzZa.js.map +1 -0
  47. package/dist/components/{breakpoints.js → p-Q-tWjk7P.js} +1 -1
  48. package/dist/components/p-RmbDDbWd.js +2 -0
  49. package/dist/components/p-RmbDDbWd.js.map +1 -0
  50. package/dist/components/p-VP75-vje.js +2 -0
  51. package/dist/components/{index19.js.map → p-VP75-vje.js.map} +1 -1
  52. package/dist/components/p-cpTAMdcF.js +2 -0
  53. package/dist/components/{index8.js.map → p-cpTAMdcF.js.map} +1 -1
  54. package/dist/components/p-mphirYN3.js +2 -0
  55. package/dist/components/{index10.js.map → p-mphirYN3.js.map} +1 -1
  56. package/dist/components/z-accordion.js +1 -1
  57. package/dist/components/z-accordion.js.map +1 -1
  58. package/dist/components/z-anchor-navigation.js +1 -1
  59. package/dist/components/z-anchor-navigation.js.map +1 -1
  60. package/dist/components/z-app-header.js +1 -1
  61. package/dist/components/z-app-header.js.map +1 -1
  62. package/dist/components/z-aria-alert.js +1 -1
  63. package/dist/components/z-aria-alert.js.map +1 -1
  64. package/dist/components/z-avatar.js +1 -1
  65. package/dist/components/z-avatar.js.map +1 -1
  66. package/dist/components/z-book-card-app.js +1 -1
  67. package/dist/components/z-book-card-app.js.map +1 -1
  68. package/dist/components/z-book-card.js +1 -1
  69. package/dist/components/z-book-card.js.map +1 -1
  70. package/dist/components/z-book-cover.js +1 -1
  71. package/dist/components/z-breadcrumb.js +1 -1
  72. package/dist/components/z-breadcrumb.js.map +1 -1
  73. package/dist/components/z-button-sort.js +1 -1
  74. package/dist/components/z-button-sort.js.map +1 -1
  75. package/dist/components/z-button.js +1 -1
  76. package/dist/components/z-card.js +1 -1
  77. package/dist/components/z-card.js.map +1 -1
  78. package/dist/components/z-carousel.js +1 -1
  79. package/dist/components/z-carousel.js.map +1 -1
  80. package/dist/components/z-chip.js +1 -1
  81. package/dist/components/z-color-picker.js +1 -1
  82. package/dist/components/z-color-picker.js.map +1 -1
  83. package/dist/components/z-combobox.js +1 -1
  84. package/dist/components/z-combobox.js.map +1 -1
  85. package/dist/components/z-cover-hero.js +1 -1
  86. package/dist/components/z-cover-hero.js.map +1 -1
  87. package/dist/components/z-date-picker.js +2 -2
  88. package/dist/components/z-date-picker.js.map +1 -1
  89. package/dist/components/z-divider.js +1 -1
  90. package/dist/components/z-dragdrop-area.js +1 -1
  91. package/dist/components/z-file-upload.js +1 -1
  92. package/dist/components/z-file-upload.js.map +1 -1
  93. package/dist/components/z-file.js +1 -1
  94. package/dist/components/z-file.js.map +1 -1
  95. package/dist/components/z-ghost-loading.js +1 -1
  96. package/dist/components/z-icon.js +1 -1
  97. package/dist/components/z-info-box.js +1 -1
  98. package/dist/components/z-info-box.js.map +1 -1
  99. package/dist/components/z-info-reveal.js +1 -1
  100. package/dist/components/z-input-message.js +1 -1
  101. package/dist/components/z-input-range.js +1 -1
  102. package/dist/components/z-input-range.js.map +1 -1
  103. package/dist/components/z-input.js +1 -1
  104. package/dist/components/z-list-element.js +1 -1
  105. package/dist/components/z-list-group.js +1 -1
  106. package/dist/components/z-list.js +1 -1
  107. package/dist/components/z-logo.js +1 -1
  108. package/dist/components/z-logo.js.map +1 -1
  109. package/dist/components/z-menu-section.js +1 -1
  110. package/dist/components/z-menu-section.js.map +1 -1
  111. package/dist/components/z-menu.js +1 -1
  112. package/dist/components/z-menu.js.map +1 -1
  113. package/dist/components/z-modal.js +1 -1
  114. package/dist/components/z-navigation-tabs.js +1 -1
  115. package/dist/components/z-navigation-tabs.js.map +1 -1
  116. package/dist/components/z-notification.js +1 -1
  117. package/dist/components/z-notification.js.map +1 -1
  118. package/dist/components/z-offcanvas.js +1 -1
  119. package/dist/components/z-pagination.js +1 -1
  120. package/dist/components/z-pagination.js.map +1 -1
  121. package/dist/components/z-popover.js +1 -1
  122. package/dist/components/z-range-picker.js +1 -1
  123. package/dist/components/z-range-picker.js.map +1 -1
  124. package/dist/components/z-result-card.js +1 -1
  125. package/dist/components/z-result-card.js.map +1 -1
  126. package/dist/components/z-searchbar.js +1 -1
  127. package/dist/components/z-select.js +1 -1
  128. package/dist/components/z-select.js.map +1 -1
  129. package/dist/components/z-skip-to-content.js +1 -1
  130. package/dist/components/z-skip-to-content.js.map +1 -1
  131. package/dist/components/z-stepper-item.js +1 -1
  132. package/dist/components/z-stepper-item.js.map +1 -1
  133. package/dist/components/z-stepper.js +1 -1
  134. package/dist/components/z-stepper.js.map +1 -1
  135. package/dist/components/z-table.js +1 -1
  136. package/dist/components/z-table.js.map +1 -1
  137. package/dist/components/z-tag.js +1 -1
  138. package/dist/components/z-tbody.js +1 -1
  139. package/dist/components/z-tbody.js.map +1 -1
  140. package/dist/components/z-td.js +1 -1
  141. package/dist/components/z-td.js.map +1 -1
  142. package/dist/components/z-tfoot.js +1 -1
  143. package/dist/components/z-tfoot.js.map +1 -1
  144. package/dist/components/z-th.js +1 -1
  145. package/dist/components/z-th.js.map +1 -1
  146. package/dist/components/z-thead.js +1 -1
  147. package/dist/components/z-thead.js.map +1 -1
  148. package/dist/components/z-toast-notification-list.js +1 -1
  149. package/dist/components/z-toast-notification-list.js.map +1 -1
  150. package/dist/components/z-toast-notification.js +3 -3
  151. package/dist/components/z-toggle-switch.js +1 -1
  152. package/dist/components/z-toggle-switch.js.map +1 -1
  153. package/dist/components/z-tool.js +1 -1
  154. package/dist/components/z-tool.js.map +1 -1
  155. package/dist/components/z-toolbar.js +1 -1
  156. package/dist/components/z-toolbar.js.map +1 -1
  157. package/dist/components/z-tooltip.js +1 -1
  158. package/dist/components/z-tr.js +1 -1
  159. package/dist/components/z-tr.js.map +1 -1
  160. package/dist/components/z-tree-list.js +1 -1
  161. package/dist/components/z-tree-list.js.map +1 -1
  162. package/dist/components/z-visually-hidden.js +1 -1
  163. package/dist/components/z-visually-hidden.js.map +1 -1
  164. package/dist/esm/z-app-header_12.entry.js +7 -1
  165. package/dist/esm/z-app-header_12.entry.js.map +1 -1
  166. package/dist/types/components/z-input/index.d.ts +1 -0
  167. package/dist/web-components-library/p-e2eea612.entry.js +2 -0
  168. package/dist/web-components-library/p-e2eea612.entry.js.map +1 -0
  169. package/dist/web-components-library/web-components-library.esm.js +1 -1
  170. package/package.json +8 -4
  171. package/react/components.d.ts +68 -66
  172. package/react/components.js +134 -69
  173. package/react/z-accordion.d.ts +12 -0
  174. package/react/z-accordion.js +18 -0
  175. package/react/z-anchor-navigation.d.ts +9 -0
  176. package/react/z-anchor-navigation.js +18 -0
  177. package/react/z-app-header.d.ts +12 -0
  178. package/react/z-app-header.js +18 -0
  179. package/react/z-aria-alert.d.ts +9 -0
  180. package/react/z-aria-alert.js +18 -0
  181. package/react/z-avatar.d.ts +9 -0
  182. package/react/z-avatar.js +18 -0
  183. package/react/z-book-card-app.d.ts +12 -0
  184. package/react/z-book-card-app.js +18 -0
  185. package/react/z-book-card.d.ts +14 -0
  186. package/react/z-book-card.js +22 -0
  187. package/react/z-book-cover.d.ts +9 -0
  188. package/react/z-book-cover.js +18 -0
  189. package/react/z-breadcrumb.d.ts +12 -0
  190. package/react/z-breadcrumb.js +18 -0
  191. package/react/z-button-sort.d.ts +12 -0
  192. package/react/z-button-sort.js +18 -0
  193. package/react/z-button.d.ts +9 -0
  194. package/react/z-button.js +18 -0
  195. package/react/z-card.d.ts +9 -0
  196. package/react/z-card.js +18 -0
  197. package/react/z-carousel.d.ts +14 -0
  198. package/react/z-carousel.js +18 -0
  199. package/react/z-chip.d.ts +12 -0
  200. package/react/z-chip.js +18 -0
  201. package/react/z-color-picker.d.ts +12 -0
  202. package/react/z-color-picker.js +18 -0
  203. package/react/z-combobox.d.ts +12 -0
  204. package/react/z-combobox.js +18 -0
  205. package/react/z-cover-hero.d.ts +9 -0
  206. package/react/z-cover-hero.js +18 -0
  207. package/react/z-date-picker.d.ts +12 -0
  208. package/react/z-date-picker.js +18 -0
  209. package/react/z-divider.d.ts +9 -0
  210. package/react/z-divider.js +18 -0
  211. package/react/z-dragdrop-area.d.ts +12 -0
  212. package/react/z-dragdrop-area.js +18 -0
  213. package/react/z-file-upload.d.ts +16 -0
  214. package/react/z-file-upload.js +21 -0
  215. package/react/z-file.d.ts +12 -0
  216. package/react/z-file.js +18 -0
  217. package/react/z-ghost-loading.d.ts +9 -0
  218. package/react/z-ghost-loading.js +18 -0
  219. package/react/z-icon.d.ts +9 -0
  220. package/react/z-icon.js +18 -0
  221. package/react/z-info-box.d.ts +14 -0
  222. package/react/z-info-box.js +18 -0
  223. package/react/z-info-reveal.d.ts +9 -0
  224. package/react/z-info-reveal.js +18 -0
  225. package/react/z-input-message.d.ts +9 -0
  226. package/react/z-input-message.js +18 -0
  227. package/react/z-input-range.d.ts +13 -0
  228. package/react/z-input-range.js +21 -0
  229. package/react/z-input.d.ts +17 -0
  230. package/react/z-input.js +25 -0
  231. package/react/z-list-element.d.ts +14 -0
  232. package/react/z-list-element.js +22 -0
  233. package/react/z-list-group.d.ts +9 -0
  234. package/react/z-list-group.js +18 -0
  235. package/react/z-list.d.ts +9 -0
  236. package/react/z-list.js +18 -0
  237. package/react/z-logo.d.ts +9 -0
  238. package/react/z-logo.js +18 -0
  239. package/react/z-menu-section.d.ts +13 -0
  240. package/react/z-menu-section.js +21 -0
  241. package/react/z-menu.d.ts +13 -0
  242. package/react/z-menu.js +21 -0
  243. package/react/z-modal.d.ts +14 -0
  244. package/react/z-modal.js +22 -0
  245. package/react/z-navigation-tabs.d.ts +12 -0
  246. package/react/z-navigation-tabs.js +18 -0
  247. package/react/z-notification.d.ts +13 -0
  248. package/react/z-notification.js +21 -0
  249. package/react/z-offcanvas.d.ts +12 -0
  250. package/react/z-offcanvas.js +18 -0
  251. package/react/z-pagination.d.ts +12 -0
  252. package/react/z-pagination.js +18 -0
  253. package/react/z-popover.d.ts +17 -0
  254. package/react/z-popover.js +21 -0
  255. package/react/z-range-picker.d.ts +12 -0
  256. package/react/z-range-picker.js +18 -0
  257. package/react/z-result-card.d.ts +9 -0
  258. package/react/z-result-card.js +18 -0
  259. package/react/z-searchbar.d.ts +14 -0
  260. package/react/z-searchbar.js +22 -0
  261. package/react/z-select.d.ts +13 -0
  262. package/react/z-select.js +21 -0
  263. package/react/z-skip-to-content.d.ts +9 -0
  264. package/react/z-skip-to-content.js +18 -0
  265. package/react/z-stepper-item.d.ts +9 -0
  266. package/react/z-stepper-item.js +18 -0
  267. package/react/z-stepper.d.ts +9 -0
  268. package/react/z-stepper.js +18 -0
  269. package/react/z-table.d.ts +9 -0
  270. package/react/z-table.js +18 -0
  271. package/react/z-tag.d.ts +9 -0
  272. package/react/z-tag.js +18 -0
  273. package/react/z-tbody.d.ts +9 -0
  274. package/react/z-tbody.js +18 -0
  275. package/react/z-td.d.ts +12 -0
  276. package/react/z-td.js +18 -0
  277. package/react/z-tfoot.d.ts +9 -0
  278. package/react/z-tfoot.js +18 -0
  279. package/react/z-th.d.ts +12 -0
  280. package/react/z-th.js +18 -0
  281. package/react/z-thead.d.ts +9 -0
  282. package/react/z-thead.js +18 -0
  283. package/react/z-toast-notification-list.d.ts +9 -0
  284. package/react/z-toast-notification-list.js +18 -0
  285. package/react/z-toast-notification.d.ts +12 -0
  286. package/react/z-toast-notification.js +18 -0
  287. package/react/z-toggle-switch.d.ts +12 -0
  288. package/react/z-toggle-switch.js +18 -0
  289. package/react/z-tool.d.ts +13 -0
  290. package/react/z-tool.js +21 -0
  291. package/react/z-toolbar.d.ts +9 -0
  292. package/react/z-toolbar.js +18 -0
  293. package/react/z-tooltip.d.ts +14 -0
  294. package/react/z-tooltip.js +18 -0
  295. package/react/z-tr.d.ts +12 -0
  296. package/react/z-tr.js +18 -0
  297. package/react/z-tree-list.d.ts +16 -0
  298. package/react/z-tree-list.js +18 -0
  299. package/react/z-visually-hidden.d.ts +9 -0
  300. package/react/z-visually-hidden.js +18 -0
  301. package/readme.md +7 -4
  302. package/www/build/{p-9a93e186.js → p-de6e8c2b.js} +1 -1
  303. package/www/build/p-e2eea612.entry.js +2 -0
  304. package/www/build/p-e2eea612.entry.js.map +1 -0
  305. package/www/build/web-components-library.esm.js +1 -1
  306. package/www/index.html +1 -1
  307. package/dist/components/index10.js +0 -2
  308. package/dist/components/index11.js +0 -2
  309. package/dist/components/index12.js +0 -2
  310. package/dist/components/index13.js +0 -2
  311. package/dist/components/index14.js +0 -2
  312. package/dist/components/index15.js +0 -2
  313. package/dist/components/index16.js +0 -2
  314. package/dist/components/index17.js +0 -2
  315. package/dist/components/index18.js +0 -2
  316. package/dist/components/index19.js +0 -2
  317. package/dist/components/index20.js +0 -2
  318. package/dist/components/index21.js +0 -2
  319. package/dist/components/index3.js +0 -2
  320. package/dist/components/index4.js +0 -2
  321. package/dist/components/index5.js +0 -2
  322. package/dist/components/index6.js +0 -2
  323. package/dist/components/index6.js.map +0 -1
  324. package/dist/components/index7.js +0 -2
  325. package/dist/components/index8.js +0 -2
  326. package/dist/components/index9.js +0 -2
  327. package/dist/components/reactive-controller.js +0 -6
  328. package/dist/components/utils2.js +0 -2
  329. package/dist/web-components-library/p-1fad41b2.entry.js +0 -2
  330. package/dist/web-components-library/p-1fad41b2.entry.js.map +0 -1
  331. package/react/react-component-lib/createComponent.d.ts +0 -10
  332. package/react/react-component-lib/createComponent.js +0 -101
  333. package/react/react-component-lib/createOverlayComponent.d.ts +0 -21
  334. package/react/react-component-lib/createOverlayComponent.js +0 -115
  335. package/react/react-component-lib/index.d.ts +0 -2
  336. package/react/react-component-lib/index.js +0 -7
  337. package/react/react-component-lib/interfaces.d.ts +0 -29
  338. package/react/react-component-lib/interfaces.js +0 -2
  339. package/react/react-component-lib/utils/attachProps.d.ts +0 -16
  340. package/react/react-component-lib/utils/attachProps.js +0 -115
  341. package/react/react-component-lib/utils/case.d.ts +0 -2
  342. package/react/react-component-lib/utils/case.js +0 -11
  343. package/react/react-component-lib/utils/dev.d.ts +0 -2
  344. package/react/react-component-lib/utils/dev.js +0 -17
  345. package/react/react-component-lib/utils/index.d.ts +0 -10
  346. package/react/react-component-lib/utils/index.js +0 -55
  347. package/www/build/p-1fad41b2.entry.js +0 -2
  348. package/www/build/p-1fad41b2.entry.js.map +0 -1
  349. /package/dist/components/{utils.js.map → p-8C_CrFxp.js.map} +0 -0
  350. /package/dist/components/{reactive-controller.js.map → p-B3VFztJH.js.map} +0 -0
  351. /package/dist/components/{_commonjsHelpers.js.map → p-B85MJLTf.js.map} +0 -0
  352. /package/dist/components/{iconset.js.map → p-D1c5gR45.js.map} +0 -0
  353. /package/dist/components/{index2.js.map → p-DdetsoIY.js.map} +0 -0
  354. /package/dist/components/{breakpoints.js.map → p-Q-tWjk7P.js.map} +0 -0
@@ -0,0 +1,2 @@
1
+ import{p as t,t as o,H as e,c as s,h as r,d as i}from"./p-RmbDDbWd.js";import{P as n,g as a,p as h}from"./p-DdetsoIY.js";import{a as c,k as f,l as p,g as l,m as u}from"./p-8C_CrFxp.js";const b=()=>`:host{position:fixed;display:none;max-width:calc(100dvw - var(--grid-margin) * 2);max-height:calc(100dvh - 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}`;const d=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.positionChange=s(this,"positionChange",7);this.openChange=s(this,"openChange",7);this.position=n.TOP;this.open=false;this.showArrow=false;this.center=false;this.closable=true;this.spaceTolerance=3}closePopoverWithKeyboard(t){if(this.closable&&t.key===a.ESC){t.stopPropagation();this.open=false}}handleOutsideClick(t){const o=t.target;if(!this.closable||!this.open||c(this.host,o)){return}if(c(this.boundElement,o)){t.stopPropagation()}this.open=false}validatePosition(t){if(!Object.values(n).includes(t)||t===n.AUTO){t=n.TOP;this.position=t}this.currentPosition=t;if(this.open){this.setPosition()}}onOpen(){cancelAnimationFrame(this.animationFrameRequestId);this.openChange.emit({open:this.open});if(!this.open){Object.assign(this.host.style,{top:"auto",right:"auto",bottom:"auto",left:"auto",maxWidth:"",maxHeight:"",visibility:"hidden"});this.currentPosition=undefined;return}const t=()=>{if(!this.open){return}this.setPosition();this.animationFrameRequestId=requestAnimationFrame(t)};setTimeout((()=>{t()}),0)}onBindingChange(){this.findBoundElement()}get offsetModifier(){return this.center?.5:0}findBoundElement(){if(typeof this.bindTo==="string"){this.boundElement=this.host.ownerDocument.querySelector(this.bindTo)}else if(this.bindTo){this.boundElement=this.bindTo}else{this.boundElement=f(this.host);if(this.boundElement.tagName.toLowerCase()==="z-tooltip"){this.boundElement=f(this.boundElement)}}}hasCenteredHorizontalSpace(t,o,e,s){const r=(e-s)*(1-this.offsetModifier);if(!this.center){return o>=r-this.spaceTolerance}return o>=r-this.spaceTolerance&&t>=r-this.spaceTolerance}hasCenteredVerticalSpace(t,o,e,s){const r=(e-s)*(1-this.offsetModifier);if(!this.center){return o>=r-this.spaceTolerance}return t>=r-this.spaceTolerance&&o>=r-this.spaceTolerance}hasEnoughSideSpace(t,o,e,s){return t>=o-e*(1-s)-this.spaceTolerance}getOptimalPopoverPosition(o,e){const s=this.host.offsetWidth;const r=this.host.offsetHeight;const i=this.boundElement.getBoundingClientRect().width;const a=this.boundElement.getBoundingClientRect().height;const h=this.offsetModifier;const c=t=>{switch(t){case n.TOP:return e.top>=r-this.spaceTolerance&&this.hasCenteredHorizontalSpace(e.left,e.right,s,i);case n.TOP_RIGHT:return e.top>=r&&this.hasEnoughSideSpace(e.right,s,i,h);case n.TOP_LEFT:return e.top>=r&&this.hasEnoughSideSpace(e.left,s,i,h);case n.RIGHT:return e.right>=s&&this.hasCenteredVerticalSpace(e.top,e.bottom,r,a);case n.RIGHT_BOTTOM:return e.right>=s&&this.hasEnoughSideSpace(e.bottom,r,a,h);case n.RIGHT_TOP:return e.right>=s&&this.hasEnoughSideSpace(e.top,r,a,h);case n.BOTTOM:return e.bottom>=r&&this.hasCenteredHorizontalSpace(e.left,e.right,s,i);case n.BOTTOM_LEFT:return e.bottom>=r&&this.hasEnoughSideSpace(e.left,s,i,h);case n.BOTTOM_RIGHT:return e.bottom>=r&&this.hasEnoughSideSpace(e.right,s,i,h);case n.LEFT:return e.left>=s&&this.hasCenteredVerticalSpace(e.top,e.bottom,r,a);case n.LEFT_TOP:return e.left>=s&&this.hasEnoughSideSpace(e.top,r,a,h);case n.LEFT_BOTTOM:return e.left>=s&&this.hasEnoughSideSpace(e.bottom,r,a,h);default:return false}};if(c(o)){return o}const f=t.positionOrder;const p=f.indexOf(o);if(p===-1){return o}for(let t=1;t<f.length;t++){const o=(p+t)%f.length;const e=f[o];if(c(e)){return e}}return this.findBestFallbackPosition(e)}findBestFallbackPosition(t){const o=t.right>=t.left?n.RIGHT:n.LEFT;const e=t.bottom>=t.top?n.BOTTOM:n.TOP;const s=Math.max(t.right,t.left);const r=Math.max(t.bottom,t.top);const i=r>=s?e:o;let a=false;if(i===e){const o=Math.min(t.right,t.left);a=s>=o*2}else{const o=Math.min(t.bottom,t.top);a=r>=o*2}if(!a){return i}const h=i===e?o:e;return`${i}_${h}`}findScrollableAncestor(t){let o=f(t);while(o){if(o===t.ownerDocument.documentElement){return o}const e=getComputedStyle(o);const{overflow:s,overflowX:r,overflowY:i}=e;const n=s==="hidden"||i==="hidden"||r==="hidden";const a=o.scrollHeight>o.clientHeight&&s!=="visible"&&i!=="visible"||o.scrollWidth>o.clientWidth&&s!=="visible"&&r!=="visible";if(!n&&a){return o}o=f(o)}return t.ownerDocument.documentElement}calculateAvailableSpace(){const t=this.boundElement.getBoundingClientRect();if(this.lastBoundRect&&this.lastBoundRect.x===t.x&&this.lastBoundRect.y===t.y&&this.lastBoundRect.width===t.width&&this.lastBoundRect.height===t.height&&this.cachedAvailableSpace){return this.cachedAvailableSpace}this.lastBoundRect=t;const o=this.findScrollableAncestor(this.boundElement);const e=o.getBoundingClientRect();const s=o!==this.boundElement.ownerDocument.documentElement;const r=this.boundElement.ownerDocument.documentElement.clientWidth;const i=this.boundElement.ownerDocument.documentElement.clientHeight;const n=8;const a=s?e.top:0;const h=s?r-e.right:0;const c=s?i-e.bottom:0;const f=s?e.left:0;this.cachedAvailableSpace={top:t.top-a-n,right:r-t.right-h-n,bottom:i-t.bottom-c-n,left:t.left-f-n};return this.cachedAvailableSpace}getBoundElementOffsets(){const t=this.boundElement.getBoundingClientRect();const o=this.boundElement.ownerDocument.documentElement.clientWidth;const e=this.boundElement.ownerDocument.documentElement.clientHeight;return{top:t.top,right:o-t.right,bottom:e-t.bottom,left:t.left}}computePositionOffsets(){const t=this.getBoundElementOffsets();const o=p(this.host);const e=o===this.host.ownerDocument.documentElement;if(e){return t}const s=o.getBoundingClientRect();const r=getComputedStyle(o);const i={top:s.top+parseFloat(r.borderTopWidth),right:s.right-parseFloat(r.borderRightWidth),bottom:s.bottom-parseFloat(r.borderBottomWidth),left:s.left+parseFloat(r.borderLeftWidth)};const n=this.boundElement.getBoundingClientRect();const a={top:n.top-i.top,right:i.right-n.right,bottom:i.bottom-n.bottom,left:n.left-i.left};return{top:a.top+o.scrollTop,right:a.right-o.scrollLeft,bottom:a.bottom-o.scrollTop,left:a.left+o.scrollLeft}}applyPositionStyles(t,o){const e=this.boundElement.offsetWidth;const s=this.boundElement.offsetHeight;const r=this.offsetModifier;const i=this.showArrow&&this.center?8:0;const a=this.host.style;const c=parseFloat(getComputedStyle(this.host).marginTop.replace("px",""))||0;const f=this.computePositionOffsets();const p=f.left+e*r;const u=f.right+e*r;const b=f.top+s;const d=f.bottom+s;const m=f.top+s*r;const g=f.bottom+s*r;let v;let w;switch(t){case n.TOP:case n.TOP_RIGHT:a.bottom=`${d}px`;a.left=`${p-(t===n.TOP_RIGHT?i:0)}px`;w=o.top-c;if(t===n.TOP_RIGHT){v=o.right+e*r}break;case n.TOP_LEFT:a.right=`${u-i}px`;a.bottom=`${d}px`;v=o.left+e*r;w=o.top-c;break;case n.BOTTOM:case n.BOTTOM_RIGHT:a.top=`${b}px`;a.left=`${p-(t===n.BOTTOM_RIGHT?i:0)}px`;w=o.bottom-c;if(t===n.BOTTOM_RIGHT){v=o.right+e*r}break;case n.BOTTOM_LEFT:a.top=`${b}px`;a.right=`${u-i}px`;v=o.left+e*r;w=o.bottom-c;break;case n.RIGHT:case n.RIGHT_BOTTOM:a.top=`${m-(t===n.RIGHT_BOTTOM?i:0)}px`;a.left=`${f.left+e}px`;v=o.right-c;if(t===n.RIGHT){w=o.top+o.bottom+s}else{w=o.bottom+s*r}break;case n.RIGHT_TOP:a.bottom=`${g-i}px`;a.left=`${f.left+e}px`;v=o.right-c;w=o.top+s*r;break;case n.LEFT:case n.LEFT_BOTTOM:a.top=`${m-(t===n.LEFT_BOTTOM?i:0)}px`;a.right=`${f.right+e}px`;v=o.left-c;if(t===n.LEFT_BOTTOM){w=o.bottom+s*r}break;case n.LEFT_TOP:a.right=`${f.right+e}px`;a.bottom=`${g-i}px`;v=o.left-c;w=o.top+s*r;break}if(l()!==h.MOBILE){Object.assign(a,{maxWidth:v?`${v}px`:"",maxHeight:w?`${w}px`:""})}}setPosition(){if(!this.boundElement){return}if(!u(this.boundElement,this.findScrollableAncestor(this.boundElement))){this.open=false;return}Object.assign(this.host.style,{top:"auto",right:"auto",bottom:"auto",left:"auto",maxWidth:"",maxHeight:"",visibility:"hidden"});const t=this.calculateAvailableSpace();const o=this.getOptimalPopoverPosition(this.position,t);this.applyPositionStyles(o,t);this.currentPosition=o;this.positionChange.emit({position:this.currentPosition});this.host.style.visibility="visible"}componentWillLoad(){this.validatePosition(this.position)}componentDidLoad(){this.findBoundElement();if(this.open){this.onOpen()}}disconnectedCallback(){cancelAnimationFrame(this.animationFrameRequestId)}render(){return r(i,{key:"b04b0fffd481a2872f357fd1247acd1d46787bd3","current-position":this.currentPosition},r("slot",{key:"abc61612f74abd3b168a72ac689c7cb95339cfb1"}))}get host(){return this}static get watchers(){return{position:[{validatePosition:0}],open:[{onOpen:0}],bindTo:[{onBindingChange:0}]}}static get style(){return b()}},[257,"z-popover",{position:[1537],open:[1540],bindTo:[1,"bind-to"],showArrow:[516,"show-arrow"],center:[516],closable:[4],currentPosition:[32]},[[10,"keyup","closePopoverWithKeyboard"],[18,"click","handleOutsideClick"]],{position:[{validatePosition:0}],open:[{onOpen:0}],bindTo:[{onBindingChange:0}]}]);d.positionOrder=[n.TOP,n.TOP_RIGHT,n.TOP_LEFT,n.RIGHT,n.RIGHT_BOTTOM,n.RIGHT_TOP,n.BOTTOM,n.BOTTOM_LEFT,n.BOTTOM_RIGHT,n.LEFT,n.LEFT_TOP,n.LEFT_BOTTOM];function m(){if(typeof customElements==="undefined"){return}const t=["z-popover"];t.forEach((t=>{switch(t){case"z-popover":if(!customElements.get(o(t))){customElements.define(o(t),d)}break}}))}export{d as Z,m as d};
2
+ //# sourceMappingURL=p-D8wde41u.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["stylesCss","ZPopover","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","position","PopoverPosition","TOP","open","showArrow","center","closable","spaceTolerance","closePopoverWithKeyboard","e","key","KeyboardCode","ESC","stopPropagation","handleOutsideClick","target","containsElement","host","boundElement","validatePosition","newValue","Object","values","includes","AUTO","currentPosition","setPosition","onOpen","cancelAnimationFrame","animationFrameRequestId","openChange","emit","assign","style","top","right","bottom","left","maxWidth","maxHeight","visibility","undefined","updatePositionLoop","requestAnimationFrame","setTimeout","onBindingChange","findBoundElement","offsetModifier","bindTo","ownerDocument","querySelector","getParentElement","tagName","toLowerCase","hasCenteredHorizontalSpace","availableLeft","availableRight","hostWidth","boundElementWidth","requiredSideSpace","hasCenteredVerticalSpace","availableTop","availableBottom","hostHeight","boundElementHeight","hasEnoughSideSpace","availableSpace","hostSize","boundElementSize","getOptimalPopoverPosition","desiredPosition","offsetWidth","offsetHeight","getBoundingClientRect","width","height","fits","pos","TOP_RIGHT","TOP_LEFT","RIGHT","RIGHT_BOTTOM","RIGHT_TOP","BOTTOM","BOTTOM_LEFT","BOTTOM_RIGHT","LEFT","LEFT_TOP","LEFT_BOTTOM","positions","positionOrder","startIndex","indexOf","i","length","posIndex","findBestFallbackPosition","bestHorizontalDirection","bestVerticalDirection","maxHorizontalSpace","Math","max","maxVerticalSpace","mainDirection","needsSecondaryDirection","minHorizontalSpace","min","minVerticalSpace","secondaryDirection","findScrollableAncestor","element","parent","documentElement","getComputedStyle","overflow","overflowX","overflowY","hasHiddenOverflow","isScrollable","scrollHeight","clientHeight","scrollWidth","clientWidth","calculateAvailableSpace","boundElementRect","lastBoundRect","x","y","cachedAvailableSpace","scrollableAncestor","scrollableAncestorRect","isScrollableAncestorNested","documentWidth","documentHeight","safeSpace","deltaTop","deltaRight","deltaBottom","deltaLeft","getBoundElementOffsets","elementRect","computePositionOffsets","boundElementOffsets","containingBlockAncestor","findContainingBlockAncestor","isDocumentElement","containingBlockRect","containingBlockStyle","paddingBox","parseFloat","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","relativeOffsets","scrollTop","scrollLeft","applyPositionStyles","arrowModifier","hostStyle","distanceFromBound","marginTop","replace","positionOffsets","leftBase","rightBase","topBase","bottomBase","sideTopBase","sideBottomBase","getDevice","Device","MOBILE","isElementVisibleInContainer","positionChange","componentWillLoad","componentDidLoad","disconnectedCallback","render","h","Host"],"sources":["src/components/z-popover/styles.css?tag=z-popover&encapsulation=shadow","src/components/z-popover/index.tsx"],"sourcesContent":[":host {\n /**\n * @prop --z-popover-theme--surface: background color of the popover.\n * @prop --z-popover-theme--text: foreground color of the popover.\n * @prop --z-popover-padding: padding of the popover.\n * @prop --z-popover-shadow-filter: drop-shadow filter of the popover. Defaults to `drop-shadow(0 1px 2px var(--shadow-color-base))`.\n */\n --z-popover-theme--surface: ;\n --z-popover-theme--text: ;\n --z-popover-padding: ;\n --z-popover-shadow-filter: ;\n\n position: fixed;\n display: none;\n max-width: calc(100dvw - var(--grid-margin) * 2);\n max-height: calc(100dvh - var(--grid-margin) * 2);\n padding: var(--z-popover-padding, 0);\n background: var(--z-popover-theme--surface, var(--color-surface01));\n border-radius: var(--border-radius-small);\n color: var(--z-popover-theme--text, var(--color-default-text));\n fill: currentcolor;\n filter: var(--z-popover-shadow-filter, drop-shadow(0 1px 2px var(--shadow-color-base)));\n text-align: center;\n visibility: hidden; /* hidden by default. the positioning algorithm will set it to 'visible' when needed */\n}\n\n:host([open]:not([open=\"false\"])[current-position]) {\n display: block;\n}\n\n:host([center][current-position=\"top\"]),\n:host([center][current-position=\"bottom\"]) {\n transform: translateX(-50%);\n}\n\n:host([center][current-position=\"right\"]),\n:host([center][current-position=\"left\"]) {\n transform: translateY(-50%);\n}\n\n:host([current-position^=\"top\"]) {\n margin: 0 0 var(--space-unit);\n}\n\n:host([current-position^=\"bottom\"]) {\n margin: var(--space-unit) 0 0;\n}\n\n:host([current-position^=\"left\"]) {\n margin: 0 var(--space-unit) 0 0;\n}\n\n:host([current-position^=\"right\"]) {\n margin: 0 0 0 var(--space-unit);\n}\n\n/* Arrow style */\n:host([current-position])::before {\n --arrow-size: 6px;\n --arrow-edge-offset: calc(100% - var(--space-unit) - (var(--arrow-size) / 2));\n --arrow-center-x-offset: calc(50% - (var(--arrow-size) / 2));\n --arrow-center-y-offset: calc(100% - (var(--arrow-size) / 2));\n\n position: absolute;\n display: block;\n width: var(--arrow-size);\n height: var(--arrow-size);\n background: var(--z-popover-theme--surface, var(--color-surface01));\n content: \"\";\n transform: rotate(45deg);\n}\n\n:host([show-arrow=\"false\"])::before,\n:host(:not([show-arrow]))::before {\n display: none;\n}\n\n:host([current-position^=\"top\"])::before {\n top: var(--arrow-center-y-offset);\n}\n\n:host([current-position^=\"bottom\"])::before {\n bottom: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"top\"])::before,\n:host([current-position=\"bottom\"])::before {\n right: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right\"])::before,\n:host([current-position=\"left\"])::before {\n bottom: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right\"])::before {\n right: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"left\"])::before {\n left: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"top_right\"])::before,\n:host([current-position=\"bottom_right\"])::before {\n right: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"top_left\"])::before,\n:host([current-position=\"bottom_left\"])::before {\n left: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right_top\"])::before,\n:host([current-position=\"left_top\"])::before {\n top: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right_top\"])::before,\n:host([current-position=\"right_bottom\"])::before {\n right: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"left_top\"])::before,\n:host([current-position=\"left_bottom\"])::before {\n left: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"right_bottom\"])::before,\n:host([current-position=\"left_bottom\"])::before {\n bottom: var(--arrow-edge-offset);\n}\n\n:host([center][current-position=\"top\"])::before,\n:host([center][current-position=\"bottom\"])::before {\n right: auto;\n left: var(--arrow-center-x-offset);\n}\n\n:host([center][current-position=\"right\"])::before,\n:host([center][current-position=\"left\"])::before {\n top: var(--arrow-center-x-offset);\n bottom: auto;\n}\n","import {\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n h,\n} from \"@stencil/core\";\nimport {Device, KeyboardCode, PopoverPosition} from \"../../beans\";\nimport {\n containsElement,\n findContainingBlockAncestor,\n getDevice,\n getParentElement,\n isElementVisibleInContainer,\n} from \"../../utils/utils\";\n\n/** Centering offset modifier. 0 for no offset, 0.5 for centering. */\ntype OffsetModifier = 0 | 0.5;\ntype Offsets = {top: number; right: number; bottom: number; left: number};\n\n/**\n * Popover component.\n * This component displays a popover bound to an element.\n * It supports various positions and can automatically adjust it based on available space, accounting for scrollable containers.\n *\n * Notes:\n * - If positioning has an odd behavior, consider manually adjusting the size of the slotted elements (using `width`, `height`, `max-width`, `max-height`, etc...) when its content is \"fluid\" (like text), because it can interfere with the position calculation (for example a long text on one single line can be bigger than the available space, letting the algorithm think the popover doesn't fits).\n */\n@Component({\n tag: \"z-popover\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZPopover implements ComponentInterface {\n /**\n * The preferred position to render the popover.\n * The popover will automatically search another position if not enough space is available for the preferred position.\n * If the preferred position is not available, it will try to find the best position starting from `TOP` and going clockwise.\n */\n @Prop({reflect: true, mutable: true})\n position?: PopoverPosition = PopoverPosition.TOP;\n\n /**\n * The initial open state of the popover.\n * Internal changes of this prop are emitted through the `openChange` event.\n * Make sure to listen to that event if you need the updated state of the popover from the outside, to avoid inconsistent values.\n */\n @Prop({reflect: true, mutable: true})\n open = false;\n\n /**\n * The selector or the element bound with the popover.\n * If string css selector is provided make sure to use a valid selector.\n */\n @Prop()\n bindTo?: string | HTMLElement;\n\n /** Whether to show popover's arrow. */\n @Prop({reflect: true})\n showArrow = false;\n\n /** Whether to center the popup on the main side (according to \"position\"). */\n @Prop({reflect: true})\n center = false;\n\n /**\n * Whether the popover can be closed by clicking outside of it or pressing the escape key.\n * Otherwise, it will be closed only programmatically (by setting `open` to `false`).\n * Default: `true`.\n */\n @Prop()\n closable = true;\n\n /**\n * The current position of the popover.\n * It differs from `position` only when calculated automatically for space reasons.\n */\n @State()\n currentPosition?: PopoverPosition;\n\n @Element() host: HTMLZPopoverElement;\n\n // Clockwise order of positions.\n private static readonly positionOrder: PopoverPosition[] = [\n PopoverPosition.TOP,\n PopoverPosition.TOP_RIGHT,\n PopoverPosition.TOP_LEFT,\n PopoverPosition.RIGHT,\n PopoverPosition.RIGHT_BOTTOM,\n PopoverPosition.RIGHT_TOP,\n PopoverPosition.BOTTOM,\n PopoverPosition.BOTTOM_LEFT,\n PopoverPosition.BOTTOM_RIGHT,\n PopoverPosition.LEFT,\n PopoverPosition.LEFT_TOP,\n PopoverPosition.LEFT_BOTTOM,\n ] as const;\n\n private animationFrameRequestId?: number;\n\n /** space tolerance for space calculations */\n private readonly spaceTolerance = 3;\n\n /** The element bound to the popover. */\n private boundElement?: HTMLElement;\n\n /** Cached available space around the bound element to avoid unnecessary recalculations */\n private cachedAvailableSpace?: Offsets;\n\n /** Last bounding rect of the bound element to detect changes and eventually invalidate the caches. */\n private lastBoundRect?: DOMRect;\n\n /** Fired when the position changes. */\n @Event()\n positionChange: EventEmitter<{position: PopoverPosition}>;\n\n /** Event emitted when the open state of the popover changes (e.g. when the user clicks outside the popover to close it, if `closable` is true). */\n @Event()\n openChange: EventEmitter<{open: boolean}>;\n\n @Listen(\"keyup\", {target: \"window\", capture: true})\n closePopoverWithKeyboard(e: KeyboardEvent): void {\n if (this.closable && e.key === KeyboardCode.ESC) {\n e.stopPropagation();\n this.open = false;\n }\n }\n\n /**\n * Close the popover when clicking outside of its content.\n * Stop event propagation if the click was fired by popover's trigger element,\n * to prevent close and reopen glitches.\n */\n @Listen(\"click\", {target: \"body\", capture: true})\n handleOutsideClick(e: MouseEvent): void {\n const target = e.target as Element;\n if (!this.closable || !this.open || containsElement(this.host, target)) {\n return;\n }\n\n if (containsElement(this.boundElement, target)) {\n // stop propagation if the click was on the trigger element to prevent close and reopen glitches\n e.stopPropagation();\n }\n this.open = false;\n }\n\n @Watch(\"position\")\n validatePosition(newValue: PopoverPosition): void {\n if (!Object.values(PopoverPosition).includes(newValue as PopoverPosition) || newValue === PopoverPosition.AUTO) {\n newValue = PopoverPosition.TOP;\n this.position = newValue;\n }\n this.currentPosition = newValue;\n if (this.open) {\n this.setPosition();\n }\n }\n\n /** Setup popover behaviors when `open` changes. */\n @Watch(\"open\")\n onOpen(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n this.openChange.emit({open: this.open});\n if (!this.open) {\n Object.assign(this.host.style, {\n // Reset all positioning properties\n top: \"auto\",\n right: \"auto\",\n bottom: \"auto\",\n left: \"auto\",\n maxWidth: \"\",\n maxHeight: \"\",\n // Set initial visibility to hidden while calculating position...\n visibility: \"hidden\",\n });\n this.currentPosition = undefined;\n\n return;\n }\n\n const updatePositionLoop = (): void => {\n if (!this.open) {\n return;\n }\n\n this.setPosition();\n this.animationFrameRequestId = requestAnimationFrame(updatePositionLoop);\n };\n\n // call `setPosition` after a tick to ensure the DOM is ready and sizes are available\n setTimeout(() => {\n updatePositionLoop();\n }, 0);\n }\n\n @Watch(\"bindTo\")\n onBindingChange(): void {\n this.findBoundElement();\n }\n\n /** Returns the offset modifier to use in calculations to align the popover with the bound element. */\n private get offsetModifier(): OffsetModifier {\n return this.center ? 0.5 : 0;\n }\n\n private findBoundElement(): void {\n if (typeof this.bindTo === \"string\") {\n this.boundElement = this.host.ownerDocument.querySelector(this.bindTo) as HTMLElement;\n } else if (this.bindTo) {\n this.boundElement = this.bindTo;\n } else {\n this.boundElement = getParentElement(this.host) as HTMLElement;\n if (this.boundElement.tagName.toLowerCase() === \"z-tooltip\") {\n // If the popover is used inside a tooltip without a specified `bindTo`, bind it to the parent of the tooltip.\n this.boundElement = getParentElement(this.boundElement) as HTMLElement;\n }\n }\n }\n\n /**\n * Check if element has enough space to the right and left to be centered.\n * Used for `TOP` and `BOTTOM` position.\n * When `center` is not enabled, only one side needs to be checked and `RIGHT` is the default.\n */\n private hasCenteredHorizontalSpace(\n availableLeft: number,\n availableRight: number,\n hostWidth: number,\n boundElementWidth: number\n ): boolean {\n const requiredSideSpace = (hostWidth - boundElementWidth) * (1 - this.offsetModifier);\n\n if (!this.center) {\n return availableRight >= requiredSideSpace - this.spaceTolerance;\n }\n\n return (\n availableRight >= requiredSideSpace - this.spaceTolerance &&\n availableLeft >= requiredSideSpace - this.spaceTolerance\n );\n }\n\n /**\n * Check if element has enough space to the top and bottom to be centered.\n * Used for `RIGHT` and `LEFT` position.\n * When `center` is not enabled, only one side needs to be checked and `BOTTOM` is the default.\n */\n private hasCenteredVerticalSpace(\n availableTop: number,\n availableBottom: number,\n hostHeight: number,\n boundElementHeight: number\n ): boolean {\n const requiredSideSpace = (hostHeight - boundElementHeight) * (1 - this.offsetModifier);\n\n if (!this.center) {\n return availableBottom >= requiredSideSpace - this.spaceTolerance;\n }\n\n return (\n availableTop >= requiredSideSpace - this.spaceTolerance &&\n availableBottom >= requiredSideSpace - this.spaceTolerance\n );\n }\n\n /**\n * Check if there is enough space in the given direction to fit the popover.\n * Used for composed positions like TOP_RIGHT, LEFT_BOTTOM, etc.\n */\n private hasEnoughSideSpace(\n availableSpace: number,\n hostSize: number,\n boundElementSize: number,\n offsetModifier: OffsetModifier\n ): boolean {\n return availableSpace >= hostSize - boundElementSize * (1 - offsetModifier) - this.spaceTolerance;\n }\n\n /**\n * Given a desired position and available space around the bound element, returns the best position\n * that fits the popover, trying all positions if needed.\n * Takes into account offsetModifier for centering.\n * @param desiredPosition The desired position of the popover.\n * @param availableSpace The available space around the bound element.\n */\n private getOptimalPopoverPosition(desiredPosition: PopoverPosition, availableSpace: Offsets): PopoverPosition {\n const hostWidth = this.host.offsetWidth;\n const hostHeight = this.host.offsetHeight;\n const boundElementWidth = this.boundElement.getBoundingClientRect().width;\n const boundElementHeight = this.boundElement.getBoundingClientRect().height;\n const offsetModifier = this.offsetModifier;\n\n /** Check if there is enough space to fit the popover in the desired position */\n const fits = (pos: PopoverPosition): boolean => {\n switch (pos) {\n case PopoverPosition.TOP:\n return (\n availableSpace.top >= hostHeight - this.spaceTolerance &&\n this.hasCenteredHorizontalSpace(availableSpace.left, availableSpace.right, hostWidth, boundElementWidth)\n );\n case PopoverPosition.TOP_RIGHT:\n return (\n availableSpace.top >= hostHeight &&\n this.hasEnoughSideSpace(availableSpace.right, hostWidth, boundElementWidth, offsetModifier)\n );\n case PopoverPosition.TOP_LEFT:\n return (\n availableSpace.top >= hostHeight &&\n this.hasEnoughSideSpace(availableSpace.left, hostWidth, boundElementWidth, offsetModifier)\n );\n case PopoverPosition.RIGHT:\n return (\n availableSpace.right >= hostWidth &&\n this.hasCenteredVerticalSpace(availableSpace.top, availableSpace.bottom, hostHeight, boundElementHeight)\n );\n case PopoverPosition.RIGHT_BOTTOM:\n return (\n availableSpace.right >= hostWidth &&\n this.hasEnoughSideSpace(availableSpace.bottom, hostHeight, boundElementHeight, offsetModifier)\n );\n case PopoverPosition.RIGHT_TOP:\n return (\n availableSpace.right >= hostWidth &&\n this.hasEnoughSideSpace(availableSpace.top, hostHeight, boundElementHeight, offsetModifier)\n );\n case PopoverPosition.BOTTOM:\n return (\n availableSpace.bottom >= hostHeight &&\n this.hasCenteredHorizontalSpace(availableSpace.left, availableSpace.right, hostWidth, boundElementWidth)\n );\n case PopoverPosition.BOTTOM_LEFT:\n return (\n availableSpace.bottom >= hostHeight &&\n this.hasEnoughSideSpace(availableSpace.left, hostWidth, boundElementWidth, offsetModifier)\n );\n case PopoverPosition.BOTTOM_RIGHT:\n return (\n availableSpace.bottom >= hostHeight &&\n this.hasEnoughSideSpace(availableSpace.right, hostWidth, boundElementWidth, offsetModifier)\n );\n case PopoverPosition.LEFT:\n return (\n availableSpace.left >= hostWidth &&\n this.hasCenteredVerticalSpace(availableSpace.top, availableSpace.bottom, hostHeight, boundElementHeight)\n );\n case PopoverPosition.LEFT_TOP:\n return (\n availableSpace.left >= hostWidth &&\n this.hasEnoughSideSpace(availableSpace.top, hostHeight, boundElementHeight, offsetModifier)\n );\n case PopoverPosition.LEFT_BOTTOM:\n return (\n availableSpace.left >= hostWidth &&\n this.hasEnoughSideSpace(availableSpace.bottom, hostHeight, boundElementHeight, offsetModifier)\n );\n\n default:\n return false;\n }\n };\n\n // Check desired position first\n if (fits(desiredPosition)) {\n return desiredPosition;\n }\n\n // Find position index and create rotation starting from next position\n const positions = ZPopover.positionOrder;\n const startIndex = positions.indexOf(desiredPosition);\n\n if (startIndex === -1) {\n return desiredPosition; // fallback if position not found\n }\n\n // Try all other positions starting from the next one\n for (let i = 1; i < positions.length; i++) {\n const posIndex = (startIndex + i) % positions.length;\n const pos = positions[posIndex];\n if (fits(pos)) {\n return pos;\n }\n }\n\n return this.findBestFallbackPosition(availableSpace);\n }\n\n /** Find the best fallback position based on available space when no position fits perfectly. */\n private findBestFallbackPosition(availableSpace: Offsets): PopoverPosition {\n // Determine which horizontal and vertical direction has the most available space\n const bestHorizontalDirection =\n availableSpace.right >= availableSpace.left ? PopoverPosition.RIGHT : PopoverPosition.LEFT;\n\n const bestVerticalDirection =\n availableSpace.bottom >= availableSpace.top ? PopoverPosition.BOTTOM : PopoverPosition.TOP;\n\n // Choose the main direction based on which axis has more space overall\n const maxHorizontalSpace = Math.max(availableSpace.right, availableSpace.left);\n const maxVerticalSpace = Math.max(availableSpace.bottom, availableSpace.top);\n\n const mainDirection = maxVerticalSpace >= maxHorizontalSpace ? bestVerticalDirection : bestHorizontalDirection;\n\n // Decide if a secondary direction is needed\n // Only add a secondary direction if the difference between min and max in that axis is at least double\n let needsSecondaryDirection = false;\n\n if (mainDirection === bestVerticalDirection) {\n // If main direction is vertical, check horizontal space difference\n const minHorizontalSpace = Math.min(availableSpace.right, availableSpace.left);\n needsSecondaryDirection = maxHorizontalSpace >= minHorizontalSpace * 2;\n } else {\n // If main direction is horizontal, check vertical space difference\n const minVerticalSpace = Math.min(availableSpace.bottom, availableSpace.top);\n needsSecondaryDirection = maxVerticalSpace >= minVerticalSpace * 2;\n }\n\n if (!needsSecondaryDirection) {\n return mainDirection;\n }\n\n const secondaryDirection =\n mainDirection === bestVerticalDirection ? bestHorizontalDirection : bestVerticalDirection;\n\n // Return a combined position (e.g., \"bottom_right\")\n return `${mainDirection}_${secondaryDirection}` as PopoverPosition;\n }\n\n /**\n * Find the nearest scrollable ancestor of an element to take as a reference for positioning.\n * The ancestor is considered scrollable if it doesn't have `overflow` property set to `hidden` and its scroll size is bigger than its client size.\n */\n private findScrollableAncestor(element: HTMLElement): HTMLElement {\n let parent = getParentElement(element);\n\n while (parent) {\n if (parent === element.ownerDocument.documentElement) {\n return parent as HTMLElement;\n }\n\n const style = getComputedStyle(parent);\n const {overflow, overflowX, overflowY} = style;\n const hasHiddenOverflow = overflow === \"hidden\" || overflowY === \"hidden\" || overflowX === \"hidden\";\n const isScrollable =\n (parent.scrollHeight > parent.clientHeight && overflow !== \"visible\" && overflowY !== \"visible\") ||\n (parent.scrollWidth > parent.clientWidth && overflow !== \"visible\" && overflowX !== \"visible\");\n\n if (!hasHiddenOverflow && isScrollable) {\n return parent as HTMLElement;\n }\n\n parent = getParentElement(parent);\n }\n\n return element.ownerDocument.documentElement;\n }\n\n /**\n * Calculate available space around the element bound with the popover, based on its nearest scrollable ancestor.\n *\n * Calculations for `right` and `bottom` can be a little bit confusing because `boundingRect.right` and `bottom` may not be what you expect...\n * For more information see the explanation in the docs.\n * @link https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#return_value\n */\n private calculateAvailableSpace(): Offsets {\n const boundElementRect = this.boundElement.getBoundingClientRect();\n\n if (\n this.lastBoundRect &&\n this.lastBoundRect.x === boundElementRect.x &&\n this.lastBoundRect.y === boundElementRect.y &&\n this.lastBoundRect.width === boundElementRect.width &&\n this.lastBoundRect.height === boundElementRect.height &&\n this.cachedAvailableSpace\n ) {\n // If the bound element's rect hasn't changed, return the cached rect\n return this.cachedAvailableSpace;\n }\n\n this.lastBoundRect = boundElementRect;\n const scrollableAncestor = this.findScrollableAncestor(this.boundElement);\n const scrollableAncestorRect = scrollableAncestor.getBoundingClientRect();\n const isScrollableAncestorNested = scrollableAncestor !== this.boundElement.ownerDocument.documentElement;\n const documentWidth = this.boundElement.ownerDocument.documentElement.clientWidth;\n const documentHeight = this.boundElement.ownerDocument.documentElement.clientHeight;\n const safeSpace = 8; // extra space to avoid popover being too close to the edges\n\n // These deltas represent the offset between the scrollable ancestor and the viewport.\n // They are used to adjust the available space calculations when the scrollable ancestor is not the document or body,\n // to try to fit the popover inside the scrollable ancestor.\n const deltaTop = isScrollableAncestorNested ? scrollableAncestorRect.top : 0;\n const deltaRight = isScrollableAncestorNested ? documentWidth - scrollableAncestorRect.right : 0;\n const deltaBottom = isScrollableAncestorNested ? documentHeight - scrollableAncestorRect.bottom : 0;\n const deltaLeft = isScrollableAncestorNested ? scrollableAncestorRect.left : 0;\n\n this.cachedAvailableSpace = {\n top: boundElementRect.top - deltaTop - safeSpace,\n right: documentWidth - boundElementRect.right - deltaRight - safeSpace,\n bottom: documentHeight - boundElementRect.bottom - deltaBottom - safeSpace,\n left: boundElementRect.left - deltaLeft - safeSpace,\n };\n\n return this.cachedAvailableSpace;\n }\n\n /** Calculate the space around the bound element relative to the viewport. */\n private getBoundElementOffsets(): Offsets {\n const elementRect = this.boundElement.getBoundingClientRect();\n const documentWidth = this.boundElement.ownerDocument.documentElement.clientWidth;\n const documentHeight = this.boundElement.ownerDocument.documentElement.clientHeight;\n\n return {\n top: elementRect.top,\n right: documentWidth - elementRect.right,\n bottom: documentHeight - elementRect.bottom,\n left: elementRect.left,\n };\n }\n\n /** Compute positioning offsets in the appropriate coordinate space, accounting for transformed containing blocks and scroll. */\n private computePositionOffsets(): Offsets {\n const boundElementOffsets = this.getBoundElementOffsets();\n const containingBlockAncestor = findContainingBlockAncestor(this.host);\n const isDocumentElement = containingBlockAncestor === this.host.ownerDocument.documentElement;\n\n if (isDocumentElement) {\n return boundElementOffsets;\n }\n\n const containingBlockRect = containingBlockAncestor.getBoundingClientRect();\n const containingBlockStyle = getComputedStyle(containingBlockAncestor);\n /** Padding box of the containing block, accounting for borders. */\n const paddingBox = {\n top: containingBlockRect.top + parseFloat(containingBlockStyle.borderTopWidth),\n right: containingBlockRect.right - parseFloat(containingBlockStyle.borderRightWidth),\n bottom: containingBlockRect.bottom - parseFloat(containingBlockStyle.borderBottomWidth),\n left: containingBlockRect.left + parseFloat(containingBlockStyle.borderLeftWidth),\n };\n\n const boundElementRect = this.boundElement.getBoundingClientRect();\n /** Bound element offsets relative to the containing block padding box. */\n const relativeOffsets = {\n top: boundElementRect.top - paddingBox.top,\n right: paddingBox.right - boundElementRect.right,\n bottom: paddingBox.bottom - boundElementRect.bottom,\n left: boundElementRect.left - paddingBox.left,\n };\n\n /** Account for scroll to keep the popover aligned while the containing block scrolls. */\n return {\n top: relativeOffsets.top + containingBlockAncestor.scrollTop,\n right: relativeOffsets.right - containingBlockAncestor.scrollLeft,\n bottom: relativeOffsets.bottom - containingBlockAncestor.scrollTop,\n left: relativeOffsets.left + containingBlockAncestor.scrollLeft,\n };\n }\n\n /** Apply positioning styles based on `position` parameter. */\n private applyPositionStyles(position: PopoverPosition, availableSpace: Offsets): void {\n const boundElementWidth = this.boundElement.offsetWidth;\n const boundElementHeight = this.boundElement.offsetHeight;\n const offsetModifier = this.offsetModifier;\n /**\n * Distance between the arrow center and the popover edge.\n * Needed to align the center of the arrow with the center of the bound element when `showArrow` and `center` are enabled.\n */\n const arrowModifier = this.showArrow && this.center ? 8 : 0;\n const hostStyle = this.host.style;\n /** Gap between the popover and the bound element, set as margin in CSS. */\n const distanceFromBound = parseFloat(getComputedStyle(this.host).marginTop.replace(\"px\", \"\")) || 0;\n const positionOffsets = this.computePositionOffsets();\n\n /**\n * Precomputed bases to reduce repeated arithmetic in the switch below.\n * They represent the bound element edges plus optional centering offsets.\n */\n const leftBase = positionOffsets.left + boundElementWidth * offsetModifier;\n const rightBase = positionOffsets.right + boundElementWidth * offsetModifier;\n const topBase = positionOffsets.top + boundElementHeight;\n const bottomBase = positionOffsets.bottom + boundElementHeight;\n const sideTopBase = positionOffsets.top + boundElementHeight * offsetModifier;\n const sideBottomBase = positionOffsets.bottom + boundElementHeight * offsetModifier;\n\n let maxWidth: number;\n let maxHeight: number;\n\n switch (position) {\n case PopoverPosition.TOP:\n case PopoverPosition.TOP_RIGHT:\n hostStyle.bottom = `${bottomBase}px`;\n hostStyle.left = `${leftBase - (position === PopoverPosition.TOP_RIGHT ? arrowModifier : 0)}px`;\n maxHeight = availableSpace.top - distanceFromBound;\n if (position === PopoverPosition.TOP_RIGHT) {\n maxWidth = availableSpace.right + boundElementWidth * offsetModifier;\n }\n break;\n\n case PopoverPosition.TOP_LEFT:\n hostStyle.right = `${rightBase - arrowModifier}px`;\n hostStyle.bottom = `${bottomBase}px`;\n maxWidth = availableSpace.left + boundElementWidth * offsetModifier;\n maxHeight = availableSpace.top - distanceFromBound;\n break;\n\n case PopoverPosition.BOTTOM:\n case PopoverPosition.BOTTOM_RIGHT:\n hostStyle.top = `${topBase}px`;\n hostStyle.left = `${leftBase - (position === PopoverPosition.BOTTOM_RIGHT ? arrowModifier : 0)}px`;\n maxHeight = availableSpace.bottom - distanceFromBound;\n if (position === PopoverPosition.BOTTOM_RIGHT) {\n maxWidth = availableSpace.right + boundElementWidth * offsetModifier;\n }\n break;\n\n case PopoverPosition.BOTTOM_LEFT:\n hostStyle.top = `${topBase}px`;\n hostStyle.right = `${rightBase - arrowModifier}px`;\n maxWidth = availableSpace.left + boundElementWidth * offsetModifier;\n maxHeight = availableSpace.bottom - distanceFromBound;\n break;\n\n case PopoverPosition.RIGHT:\n case PopoverPosition.RIGHT_BOTTOM:\n hostStyle.top = `${sideTopBase - (position === PopoverPosition.RIGHT_BOTTOM ? arrowModifier : 0)}px`;\n hostStyle.left = `${positionOffsets.left + boundElementWidth}px`;\n maxWidth = availableSpace.right - distanceFromBound;\n if (position === PopoverPosition.RIGHT) {\n maxHeight = availableSpace.top + availableSpace.bottom + boundElementHeight;\n } else {\n maxHeight = availableSpace.bottom + boundElementHeight * offsetModifier;\n }\n break;\n\n case PopoverPosition.RIGHT_TOP:\n hostStyle.bottom = `${sideBottomBase - arrowModifier}px`;\n hostStyle.left = `${positionOffsets.left + boundElementWidth}px`;\n maxWidth = availableSpace.right - distanceFromBound;\n maxHeight = availableSpace.top + boundElementHeight * offsetModifier;\n break;\n\n case PopoverPosition.LEFT:\n case PopoverPosition.LEFT_BOTTOM:\n hostStyle.top = `${sideTopBase - (position === PopoverPosition.LEFT_BOTTOM ? arrowModifier : 0)}px`;\n hostStyle.right = `${positionOffsets.right + boundElementWidth}px`;\n maxWidth = availableSpace.left - distanceFromBound;\n if (position === PopoverPosition.LEFT_BOTTOM) {\n maxHeight = availableSpace.bottom + boundElementHeight * offsetModifier;\n }\n break;\n\n case PopoverPosition.LEFT_TOP:\n hostStyle.right = `${positionOffsets.right + boundElementWidth}px`;\n hostStyle.bottom = `${sideBottomBase - arrowModifier}px`;\n maxWidth = availableSpace.left - distanceFromBound;\n maxHeight = availableSpace.top + boundElementHeight * offsetModifier;\n break;\n }\n\n if (getDevice() !== Device.MOBILE) {\n // Only force max sizes on non-mobile viewports\n Object.assign(hostStyle, {\n maxWidth: maxWidth ? `${maxWidth}px` : \"\",\n maxHeight: maxHeight ? `${maxHeight}px` : \"\",\n });\n }\n }\n\n /** Set the position of the popover. */\n private setPosition(): void {\n if (!this.boundElement) {\n return;\n }\n\n if (!isElementVisibleInContainer(this.boundElement, this.findScrollableAncestor(this.boundElement))) {\n // If the bound element is not visible, hide the popover too\n this.open = false;\n\n return;\n }\n\n Object.assign(this.host.style, {\n // Reset all positioning properties\n top: \"auto\",\n right: \"auto\",\n bottom: \"auto\",\n left: \"auto\",\n maxWidth: \"\",\n maxHeight: \"\",\n // Set initial visibility to hidden while calculating position...\n visibility: \"hidden\",\n });\n\n const availableSpace = this.calculateAvailableSpace();\n const position = this.getOptimalPopoverPosition(this.position, availableSpace);\n\n this.applyPositionStyles(position, availableSpace);\n this.currentPosition = position;\n this.positionChange.emit({position: this.currentPosition});\n\n // ...then restore the visibility\n this.host.style.visibility = \"visible\";\n }\n\n componentWillLoad(): void {\n this.validatePosition(this.position);\n }\n\n componentDidLoad(): void {\n this.findBoundElement();\n if (this.open) {\n this.onOpen();\n }\n }\n\n disconnectedCallback(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n }\n\n render(): HTMLZPopoverElement {\n return (\n <Host current-position={this.currentPosition}>\n <slot></slot>\n </Host>\n );\n }\n}\n"],"mappings":"iPAAA,MAAMA,EAAY,IAAM,+iG,MCuCXC,EAAQC,EAAA,MAAAD,UAAAE,EALrB,WAAAC,CAAAC,G,wJAYEC,KAAAC,SAA6BC,EAAgBC,IAQ7CH,KAAAI,KAAO,MAWPJ,KAAAK,UAAY,MAIZL,KAAAM,OAAS,MAQTN,KAAAO,SAAW,KA8BMP,KAAAQ,eAAiB,CA+mBnC,CA3lBC,wBAAAC,CAAyBC,GACvB,GAAIV,KAAKO,UAAYG,EAAEC,MAAQC,EAAaC,IAAK,CAC/CH,EAAEI,kBACFd,KAAKI,KAAO,K,EAUhB,kBAAAW,CAAmBL,GACjB,MAAMM,EAASN,EAAEM,OACjB,IAAKhB,KAAKO,WAAaP,KAAKI,MAAQa,EAAgBjB,KAAKkB,KAAMF,GAAS,CACtE,M,CAGF,GAAIC,EAAgBjB,KAAKmB,aAAcH,GAAS,CAE9CN,EAAEI,iB,CAEJd,KAAKI,KAAO,K,CAId,gBAAAgB,CAAiBC,GACf,IAAKC,OAAOC,OAAOrB,GAAiBsB,SAASH,IAAgCA,IAAanB,EAAgBuB,KAAM,CAC9GJ,EAAWnB,EAAgBC,IAC3BH,KAAKC,SAAWoB,C,CAElBrB,KAAK0B,gBAAkBL,EACvB,GAAIrB,KAAKI,KAAM,CACbJ,KAAK2B,a,EAMT,MAAAC,GACEC,qBAAqB7B,KAAK8B,yBAC1B9B,KAAK+B,WAAWC,KAA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eAAgB,CAEnGnB,KAAKI,KAAO,MAEZ,M,CAGFkB,OAAOW,OAAOjC,KAAKkB,KAAKgB,MAAO,CAE7BC,IAAK,OACLC,MAAO,OACPC,OAAQ,OACRC,KAAM,OACNC,SAAU,GACVC,UAAW,GAEXC,WAAY,WAGd,MAAM0B,EAAiBnE,KAAK4H,0BAC5B,MAAM3H,EAAWD,KAAKsE,0BAA0BtE,KAAKC,SAAUkE,GAE/DnE,KAAK8J,oBAAoB7J,EAAUkE,GACnCnE,KAAK0B,gBAAkBzB,EACvBD,KAAK+K,eAAe/I,KAAK,CAAC/B,SAAUD,KAAK0B,kBAGzC1B,KAAKkB,KAAKgB,MAAMO,WAAa,S,CAG/B,iBAAAuI,GACEhL,KAAKoB,iBAAiBpB,KAAKC,S,CAG7B,gBAAAgL,GACEjL,KAAK+C,mBACL,GAAI/C,KAAKI,KAAM,CACbJ,KAAK4B,Q,EAIT,oBAAAsJ,GACErJ,qBAAqB7B,KAAK8B,wB,CAG5B,MAAAqJ,GACE,OACEC,EAACC,EAAI,CAAA1K,IAAA,8DAAmBX,KAAK0B,iBAC3B0J,EAAA,QAAAzK,IAAA,6C,odA7nBkBhB,EAAAgG,cAAmC,CACzDzF,EAAgBC,IAChBD,EAAgB6E,UAChB7E,EAAgB8E,SAChB9E,EAAgB+E,MAChB/E,EAAgBgF,aAChBhF,EAAgBiF,UAChBjF,EAAgBkF,OAChBlF,EAAgBmF,YAChBnF,EAAgBoF,aAChBpF,EAAgBqF,KAChBrF,EAAgBsF,SAChBtF,EAAgBuF,a","ignoreList":[]}
1
+ {"version":3,"names":["stylesCss","ZPopover","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","position","PopoverPosition","TOP","open","showArrow","center","closable","spaceTolerance","closePopoverWithKeyboard","e","key","KeyboardCode","ESC","stopPropagation","handleOutsideClick","target","containsElement","host","boundElement","validatePosition","newValue","Object","values","includes","AUTO","currentPosition","setPosition","onOpen","cancelAnimationFrame","animationFrameRequestId","openChange","emit","assign","style","top","right","bottom","left","maxWidth","maxHeight","visibility","undefined","updatePositionLoop","requestAnimationFrame","setTimeout","onBindingChange","findBoundElement","offsetModifier","bindTo","ownerDocument","querySelector","getParentElement","tagName","toLowerCase","hasCenteredHorizontalSpace","availableLeft","availableRight","hostWidth","boundElementWidth","requiredSideSpace","hasCenteredVerticalSpace","availableTop","availableBottom","hostHeight","boundElementHeight","hasEnoughSideSpace","availableSpace","hostSize","boundElementSize","getOptimalPopoverPosition","desiredPosition","offsetWidth","offsetHeight","getBoundingClientRect","width","height","fits","pos","TOP_RIGHT","TOP_LEFT","RIGHT","RIGHT_BOTTOM","RIGHT_TOP","BOTTOM","BOTTOM_LEFT","BOTTOM_RIGHT","LEFT","LEFT_TOP","LEFT_BOTTOM","positions","positionOrder","startIndex","indexOf","i","length","posIndex","findBestFallbackPosition","bestHorizontalDirection","bestVerticalDirection","maxHorizontalSpace","Math","max","maxVerticalSpace","mainDirection","needsSecondaryDirection","minHorizontalSpace","min","minVerticalSpace","secondaryDirection","findScrollableAncestor","element","parent","documentElement","getComputedStyle","overflow","overflowX","overflowY","hasHiddenOverflow","isScrollable","scrollHeight","clientHeight","scrollWidth","clientWidth","calculateAvailableSpace","boundElementRect","lastBoundRect","x","y","cachedAvailableSpace","scrollableAncestor","scrollableAncestorRect","isScrollableAncestorNested","documentWidth","documentHeight","safeSpace","deltaTop","deltaRight","deltaBottom","deltaLeft","getBoundElementOffsets","elementRect","computePositionOffsets","boundElementOffsets","containingBlockAncestor","findContainingBlockAncestor","isDocumentElement","containingBlockRect","containingBlockStyle","paddingBox","parseFloat","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","relativeOffsets","scrollTop","scrollLeft","applyPositionStyles","arrowModifier","hostStyle","distanceFromBound","marginTop","replace","positionOffsets","leftBase","rightBase","topBase","bottomBase","sideTopBase","sideBottomBase","getDevice","Device","MOBILE","isElementVisibleInContainer","positionChange","componentWillLoad","componentDidLoad","disconnectedCallback","render","h","Host"],"sources":["src/components/z-popover/styles.css?tag=z-popover&encapsulation=shadow","src/components/z-popover/index.tsx"],"sourcesContent":[":host {\n /**\n * @prop --z-popover-theme--surface: background color of the popover.\n * @prop --z-popover-theme--text: foreground color of the popover.\n * @prop --z-popover-padding: padding of the popover.\n * @prop --z-popover-shadow-filter: drop-shadow filter of the popover. Defaults to `drop-shadow(0 1px 2px var(--shadow-color-base))`.\n */\n --z-popover-theme--surface: ;\n --z-popover-theme--text: ;\n --z-popover-padding: ;\n --z-popover-shadow-filter: ;\n\n position: fixed;\n display: none;\n max-width: calc(100dvw - var(--grid-margin) * 2);\n max-height: calc(100dvh - var(--grid-margin) * 2);\n padding: var(--z-popover-padding, 0);\n background: var(--z-popover-theme--surface, var(--color-surface01));\n border-radius: var(--border-radius-small);\n color: var(--z-popover-theme--text, var(--color-default-text));\n fill: currentcolor;\n filter: var(--z-popover-shadow-filter, drop-shadow(0 1px 2px var(--shadow-color-base)));\n text-align: center;\n visibility: hidden; /* hidden by default. the positioning algorithm will set it to 'visible' when needed */\n}\n\n:host([open]:not([open=\"false\"])[current-position]) {\n display: block;\n}\n\n:host([center][current-position=\"top\"]),\n:host([center][current-position=\"bottom\"]) {\n transform: translateX(-50%);\n}\n\n:host([center][current-position=\"right\"]),\n:host([center][current-position=\"left\"]) {\n transform: translateY(-50%);\n}\n\n:host([current-position^=\"top\"]) {\n margin: 0 0 var(--space-unit);\n}\n\n:host([current-position^=\"bottom\"]) {\n margin: var(--space-unit) 0 0;\n}\n\n:host([current-position^=\"left\"]) {\n margin: 0 var(--space-unit) 0 0;\n}\n\n:host([current-position^=\"right\"]) {\n margin: 0 0 0 var(--space-unit);\n}\n\n/* Arrow style */\n:host([current-position])::before {\n --arrow-size: 6px;\n --arrow-edge-offset: calc(100% - var(--space-unit) - (var(--arrow-size) / 2));\n --arrow-center-x-offset: calc(50% - (var(--arrow-size) / 2));\n --arrow-center-y-offset: calc(100% - (var(--arrow-size) / 2));\n\n position: absolute;\n display: block;\n width: var(--arrow-size);\n height: var(--arrow-size);\n background: var(--z-popover-theme--surface, var(--color-surface01));\n content: \"\";\n transform: rotate(45deg);\n}\n\n:host([show-arrow=\"false\"])::before,\n:host(:not([show-arrow]))::before {\n display: none;\n}\n\n:host([current-position^=\"top\"])::before {\n top: var(--arrow-center-y-offset);\n}\n\n:host([current-position^=\"bottom\"])::before {\n bottom: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"top\"])::before,\n:host([current-position=\"bottom\"])::before {\n right: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right\"])::before,\n:host([current-position=\"left\"])::before {\n bottom: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right\"])::before {\n right: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"left\"])::before {\n left: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"top_right\"])::before,\n:host([current-position=\"bottom_right\"])::before {\n right: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"top_left\"])::before,\n:host([current-position=\"bottom_left\"])::before {\n left: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right_top\"])::before,\n:host([current-position=\"left_top\"])::before {\n top: var(--arrow-edge-offset);\n}\n\n:host([current-position=\"right_top\"])::before,\n:host([current-position=\"right_bottom\"])::before {\n right: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"left_top\"])::before,\n:host([current-position=\"left_bottom\"])::before {\n left: var(--arrow-center-y-offset);\n}\n\n:host([current-position=\"right_bottom\"])::before,\n:host([current-position=\"left_bottom\"])::before {\n bottom: var(--arrow-edge-offset);\n}\n\n:host([center][current-position=\"top\"])::before,\n:host([center][current-position=\"bottom\"])::before {\n right: auto;\n left: var(--arrow-center-x-offset);\n}\n\n:host([center][current-position=\"right\"])::before,\n:host([center][current-position=\"left\"])::before {\n top: var(--arrow-center-x-offset);\n bottom: auto;\n}\n","import {\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n h,\n} from \"@stencil/core\";\nimport {Device, KeyboardCode, PopoverPosition} from \"../../beans\";\nimport {\n containsElement,\n findContainingBlockAncestor,\n getDevice,\n getParentElement,\n isElementVisibleInContainer,\n} from \"../../utils/utils\";\n\n/** Centering offset modifier. 0 for no offset, 0.5 for centering. */\ntype OffsetModifier = 0 | 0.5;\ntype Offsets = {top: number; right: number; bottom: number; left: number};\n\n/**\n * Popover component.\n * This component displays a popover bound to an element.\n * It supports various positions and can automatically adjust it based on available space, accounting for scrollable containers.\n *\n * Notes:\n * - If positioning has an odd behavior, consider manually adjusting the size of the slotted elements (using `width`, `height`, `max-width`, `max-height`, etc...) when its content is \"fluid\" (like text), because it can interfere with the position calculation (for example a long text on one single line can be bigger than the available space, letting the algorithm think the popover doesn't fits).\n */\n@Component({\n tag: \"z-popover\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZPopover implements ComponentInterface {\n /**\n * The preferred position to render the popover.\n * The popover will automatically search another position if not enough space is available for the preferred position.\n * If the preferred position is not available, it will try to find the best position starting from `TOP` and going clockwise.\n */\n @Prop({reflect: true, mutable: true})\n position?: PopoverPosition = PopoverPosition.TOP;\n\n /**\n * The initial open state of the popover.\n * Internal changes of this prop are emitted through the `openChange` event.\n * Make sure to listen to that event if you need the updated state of the popover from the outside, to avoid inconsistent values.\n */\n @Prop({reflect: true, mutable: true})\n open = false;\n\n /**\n * The selector or the element bound with the popover.\n * If string css selector is provided make sure to use a valid selector.\n */\n @Prop()\n bindTo?: string | HTMLElement;\n\n /** Whether to show popover's arrow. */\n @Prop({reflect: true})\n showArrow = false;\n\n /** Whether to center the popup on the main side (according to \"position\"). */\n @Prop({reflect: true})\n center = false;\n\n /**\n * Whether the popover can be closed by clicking outside of it or pressing the escape key.\n * Otherwise, it will be closed only programmatically (by setting `open` to `false`).\n * Default: `true`.\n */\n @Prop()\n closable = true;\n\n /**\n * The current position of the popover.\n * It differs from `position` only when calculated automatically for space reasons.\n */\n @State()\n currentPosition?: PopoverPosition;\n\n @Element() host: HTMLZPopoverElement;\n\n // Clockwise order of positions.\n private static readonly positionOrder: PopoverPosition[] = [\n PopoverPosition.TOP,\n PopoverPosition.TOP_RIGHT,\n PopoverPosition.TOP_LEFT,\n PopoverPosition.RIGHT,\n PopoverPosition.RIGHT_BOTTOM,\n PopoverPosition.RIGHT_TOP,\n PopoverPosition.BOTTOM,\n PopoverPosition.BOTTOM_LEFT,\n PopoverPosition.BOTTOM_RIGHT,\n PopoverPosition.LEFT,\n PopoverPosition.LEFT_TOP,\n PopoverPosition.LEFT_BOTTOM,\n ] as const;\n\n private animationFrameRequestId?: number;\n\n /** space tolerance for space calculations */\n private readonly spaceTolerance = 3;\n\n /** The element bound to the popover. */\n private boundElement?: HTMLElement;\n\n /** Cached available space around the bound element to avoid unnecessary recalculations */\n private cachedAvailableSpace?: Offsets;\n\n /** Last bounding rect of the bound element to detect changes and eventually invalidate the caches. */\n private lastBoundRect?: DOMRect;\n\n /** Fired when the position changes. */\n @Event()\n positionChange: EventEmitter<{position: PopoverPosition}>;\n\n /** Event emitted when the open state of the popover changes (e.g. when the user clicks outside the popover to close it, if `closable` is true). */\n @Event()\n openChange: EventEmitter<{open: boolean}>;\n\n @Listen(\"keyup\", {target: \"window\", capture: true})\n closePopoverWithKeyboard(e: KeyboardEvent): void {\n if (this.closable && e.key === KeyboardCode.ESC) {\n e.stopPropagation();\n this.open = false;\n }\n }\n\n /**\n * Close the popover when clicking outside of its content.\n * Stop event propagation if the click was fired by popover's trigger element,\n * to prevent close and reopen glitches.\n */\n @Listen(\"click\", {target: \"body\", capture: true})\n handleOutsideClick(e: MouseEvent): void {\n const target = e.target as Element;\n if (!this.closable || !this.open || containsElement(this.host, target)) {\n return;\n }\n\n if (containsElement(this.boundElement, target)) {\n // stop propagation if the click was on the trigger element to prevent close and reopen glitches\n e.stopPropagation();\n }\n this.open = false;\n }\n\n @Watch(\"position\")\n validatePosition(newValue: PopoverPosition): void {\n if (!Object.values(PopoverPosition).includes(newValue as PopoverPosition) || newValue === PopoverPosition.AUTO) {\n newValue = PopoverPosition.TOP;\n this.position = newValue;\n }\n this.currentPosition = newValue;\n if (this.open) {\n this.setPosition();\n }\n }\n\n /** Setup popover behaviors when `open` changes. */\n @Watch(\"open\")\n onOpen(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n this.openChange.emit({open: this.open});\n if (!this.open) {\n Object.assign(this.host.style, {\n // Reset all positioning properties\n top: \"auto\",\n right: \"auto\",\n bottom: \"auto\",\n left: \"auto\",\n maxWidth: \"\",\n maxHeight: \"\",\n // Set initial visibility to hidden while calculating position...\n visibility: \"hidden\",\n });\n this.currentPosition = undefined;\n\n return;\n }\n\n const updatePositionLoop = (): void => {\n if (!this.open) {\n return;\n }\n\n this.setPosition();\n this.animationFrameRequestId = requestAnimationFrame(updatePositionLoop);\n };\n\n // call `setPosition` after a tick to ensure the DOM is ready and sizes are available\n setTimeout(() => {\n updatePositionLoop();\n }, 0);\n }\n\n @Watch(\"bindTo\")\n onBindingChange(): void {\n this.findBoundElement();\n }\n\n /** Returns the offset modifier to use in calculations to align the popover with the bound element. */\n private get offsetModifier(): OffsetModifier {\n return this.center ? 0.5 : 0;\n }\n\n private findBoundElement(): void {\n if (typeof this.bindTo === \"string\") {\n this.boundElement = this.host.ownerDocument.querySelector(this.bindTo) as HTMLElement;\n } else if (this.bindTo) {\n this.boundElement = this.bindTo;\n } else {\n this.boundElement = getParentElement(this.host) as HTMLElement;\n if (this.boundElement.tagName.toLowerCase() === \"z-tooltip\") {\n // If the popover is used inside a tooltip without a specified `bindTo`, bind it to the parent of the tooltip.\n this.boundElement = getParentElement(this.boundElement) as HTMLElement;\n }\n }\n }\n\n /**\n * Check if element has enough space to the right and left to be centered.\n * Used for `TOP` and `BOTTOM` position.\n * When `center` is not enabled, only one side needs to be checked and `RIGHT` is the default.\n */\n private hasCenteredHorizontalSpace(\n availableLeft: number,\n availableRight: number,\n hostWidth: number,\n boundElementWidth: number\n ): boolean {\n const requiredSideSpace = (hostWidth - boundElementWidth) * (1 - this.offsetModifier);\n\n if (!this.center) {\n return availableRight >= requiredSideSpace - this.spaceTolerance;\n }\n\n return (\n availableRight >= requiredSideSpace - this.spaceTolerance &&\n availableLeft >= requiredSideSpace - this.spaceTolerance\n );\n }\n\n /**\n * Check if element has enough space to the top and bottom to be centered.\n * Used for `RIGHT` and `LEFT` position.\n * When `center` is not enabled, only one side needs to be checked and `BOTTOM` is the default.\n */\n private hasCenteredVerticalSpace(\n availableTop: number,\n availableBottom: number,\n hostHeight: number,\n boundElementHeight: number\n ): boolean {\n const requiredSideSpace = (hostHeight - boundElementHeight) * (1 - this.offsetModifier);\n\n if (!this.center) {\n return availableBottom >= requiredSideSpace - this.spaceTolerance;\n }\n\n return (\n availableTop >= requiredSideSpace - this.spaceTolerance &&\n availableBottom >= requiredSideSpace - this.spaceTolerance\n );\n }\n\n /**\n * Check if there is enough space in the given direction to fit the popover.\n * Used for composed positions like TOP_RIGHT, LEFT_BOTTOM, etc.\n */\n private hasEnoughSideSpace(\n availableSpace: number,\n hostSize: number,\n boundElementSize: number,\n offsetModifier: OffsetModifier\n ): boolean {\n return availableSpace >= hostSize - boundElementSize * (1 - offsetModifier) - this.spaceTolerance;\n }\n\n /**\n * Given a desired position and available space around the bound element, returns the best position\n * that fits the popover, trying all positions if needed.\n * Takes into account offsetModifier for centering.\n * @param desiredPosition The desired position of the popover.\n * @param availableSpace The available space around the bound element.\n */\n private getOptimalPopoverPosition(desiredPosition: PopoverPosition, availableSpace: Offsets): PopoverPosition {\n const hostWidth = this.host.offsetWidth;\n const hostHeight = this.host.offsetHeight;\n const boundElementWidth = this.boundElement.getBoundingClientRect().width;\n const boundElementHeight = this.boundElement.getBoundingClientRect().height;\n const offsetModifier = this.offsetModifier;\n\n /** Check if there is enough space to fit the popover in the desired position */\n const fits = (pos: PopoverPosition): boolean => {\n switch (pos) {\n case PopoverPosition.TOP:\n return (\n availableSpace.top >= hostHeight - this.spaceTolerance &&\n this.hasCenteredHorizontalSpace(availableSpace.left, availableSpace.right, hostWidth, boundElementWidth)\n );\n case PopoverPosition.TOP_RIGHT:\n return (\n availableSpace.top >= hostHeight &&\n this.hasEnoughSideSpace(availableSpace.right, hostWidth, boundElementWidth, offsetModifier)\n );\n case PopoverPosition.TOP_LEFT:\n return (\n availableSpace.top >= hostHeight &&\n this.hasEnoughSideSpace(availableSpace.left, hostWidth, boundElementWidth, offsetModifier)\n );\n case PopoverPosition.RIGHT:\n return (\n availableSpace.right >= hostWidth &&\n this.hasCenteredVerticalSpace(availableSpace.top, availableSpace.bottom, hostHeight, boundElementHeight)\n );\n case PopoverPosition.RIGHT_BOTTOM:\n return (\n availableSpace.right >= hostWidth &&\n this.hasEnoughSideSpace(availableSpace.bottom, hostHeight, boundElementHeight, offsetModifier)\n );\n case PopoverPosition.RIGHT_TOP:\n return (\n availableSpace.right >= hostWidth &&\n this.hasEnoughSideSpace(availableSpace.top, hostHeight, boundElementHeight, offsetModifier)\n );\n case PopoverPosition.BOTTOM:\n return (\n availableSpace.bottom >= hostHeight &&\n this.hasCenteredHorizontalSpace(availableSpace.left, availableSpace.right, hostWidth, boundElementWidth)\n );\n case PopoverPosition.BOTTOM_LEFT:\n return (\n availableSpace.bottom >= hostHeight &&\n this.hasEnoughSideSpace(availableSpace.left, hostWidth, boundElementWidth, offsetModifier)\n );\n case PopoverPosition.BOTTOM_RIGHT:\n return (\n availableSpace.bottom >= hostHeight &&\n this.hasEnoughSideSpace(availableSpace.right, hostWidth, boundElementWidth, offsetModifier)\n );\n case PopoverPosition.LEFT:\n return (\n availableSpace.left >= hostWidth &&\n this.hasCenteredVerticalSpace(availableSpace.top, availableSpace.bottom, hostHeight, boundElementHeight)\n );\n case PopoverPosition.LEFT_TOP:\n return (\n availableSpace.left >= hostWidth &&\n this.hasEnoughSideSpace(availableSpace.top, hostHeight, boundElementHeight, offsetModifier)\n );\n case PopoverPosition.LEFT_BOTTOM:\n return (\n availableSpace.left >= hostWidth &&\n this.hasEnoughSideSpace(availableSpace.bottom, hostHeight, boundElementHeight, offsetModifier)\n );\n\n default:\n return false;\n }\n };\n\n // Check desired position first\n if (fits(desiredPosition)) {\n return desiredPosition;\n }\n\n // Find position index and create rotation starting from next position\n const positions = ZPopover.positionOrder;\n const startIndex = positions.indexOf(desiredPosition);\n\n if (startIndex === -1) {\n return desiredPosition; // fallback if position not found\n }\n\n // Try all other positions starting from the next one\n for (let i = 1; i < positions.length; i++) {\n const posIndex = (startIndex + i) % positions.length;\n const pos = positions[posIndex];\n if (fits(pos)) {\n return pos;\n }\n }\n\n return this.findBestFallbackPosition(availableSpace);\n }\n\n /** Find the best fallback position based on available space when no position fits perfectly. */\n private findBestFallbackPosition(availableSpace: Offsets): PopoverPosition {\n // Determine which horizontal and vertical direction has the most available space\n const bestHorizontalDirection =\n availableSpace.right >= availableSpace.left ? PopoverPosition.RIGHT : PopoverPosition.LEFT;\n\n const bestVerticalDirection =\n availableSpace.bottom >= availableSpace.top ? PopoverPosition.BOTTOM : PopoverPosition.TOP;\n\n // Choose the main direction based on which axis has more space overall\n const maxHorizontalSpace = Math.max(availableSpace.right, availableSpace.left);\n const maxVerticalSpace = Math.max(availableSpace.bottom, availableSpace.top);\n\n const mainDirection = maxVerticalSpace >= maxHorizontalSpace ? bestVerticalDirection : bestHorizontalDirection;\n\n // Decide if a secondary direction is needed\n // Only add a secondary direction if the difference between min and max in that axis is at least double\n let needsSecondaryDirection = false;\n\n if (mainDirection === bestVerticalDirection) {\n // If main direction is vertical, check horizontal space difference\n const minHorizontalSpace = Math.min(availableSpace.right, availableSpace.left);\n needsSecondaryDirection = maxHorizontalSpace >= minHorizontalSpace * 2;\n } else {\n // If main direction is horizontal, check vertical space difference\n const minVerticalSpace = Math.min(availableSpace.bottom, availableSpace.top);\n needsSecondaryDirection = maxVerticalSpace >= minVerticalSpace * 2;\n }\n\n if (!needsSecondaryDirection) {\n return mainDirection;\n }\n\n const secondaryDirection =\n mainDirection === bestVerticalDirection ? bestHorizontalDirection : bestVerticalDirection;\n\n // Return a combined position (e.g., \"bottom_right\")\n return `${mainDirection}_${secondaryDirection}` as PopoverPosition;\n }\n\n /**\n * Find the nearest scrollable ancestor of an element to take as a reference for positioning.\n * The ancestor is considered scrollable if it doesn't have `overflow` property set to `hidden` and its scroll size is bigger than its client size.\n */\n private findScrollableAncestor(element: HTMLElement): HTMLElement {\n let parent = getParentElement(element);\n\n while (parent) {\n if (parent === element.ownerDocument.documentElement) {\n return parent as HTMLElement;\n }\n\n const style = getComputedStyle(parent);\n const {overflow, overflowX, overflowY} = style;\n const hasHiddenOverflow = overflow === \"hidden\" || overflowY === \"hidden\" || overflowX === \"hidden\";\n const isScrollable =\n (parent.scrollHeight > parent.clientHeight && overflow !== \"visible\" && overflowY !== \"visible\") ||\n (parent.scrollWidth > parent.clientWidth && overflow !== \"visible\" && overflowX !== \"visible\");\n\n if (!hasHiddenOverflow && isScrollable) {\n return parent as HTMLElement;\n }\n\n parent = getParentElement(parent);\n }\n\n return element.ownerDocument.documentElement;\n }\n\n /**\n * Calculate available space around the element bound with the popover, based on its nearest scrollable ancestor.\n *\n * Calculations for `right` and `bottom` can be a little bit confusing because `boundingRect.right` and `bottom` may not be what you expect...\n * For more information see the explanation in the docs.\n * @link https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#return_value\n */\n private calculateAvailableSpace(): Offsets {\n const boundElementRect = this.boundElement.getBoundingClientRect();\n\n if (\n this.lastBoundRect &&\n this.lastBoundRect.x === boundElementRect.x &&\n this.lastBoundRect.y === boundElementRect.y &&\n this.lastBoundRect.width === boundElementRect.width &&\n this.lastBoundRect.height === boundElementRect.height &&\n this.cachedAvailableSpace\n ) {\n // If the bound element's rect hasn't changed, return the cached rect\n return this.cachedAvailableSpace;\n }\n\n this.lastBoundRect = boundElementRect;\n const scrollableAncestor = this.findScrollableAncestor(this.boundElement);\n const scrollableAncestorRect = scrollableAncestor.getBoundingClientRect();\n const isScrollableAncestorNested = scrollableAncestor !== this.boundElement.ownerDocument.documentElement;\n const documentWidth = this.boundElement.ownerDocument.documentElement.clientWidth;\n const documentHeight = this.boundElement.ownerDocument.documentElement.clientHeight;\n const safeSpace = 8; // extra space to avoid popover being too close to the edges\n\n // These deltas represent the offset between the scrollable ancestor and the viewport.\n // They are used to adjust the available space calculations when the scrollable ancestor is not the document or body,\n // to try to fit the popover inside the scrollable ancestor.\n const deltaTop = isScrollableAncestorNested ? scrollableAncestorRect.top : 0;\n const deltaRight = isScrollableAncestorNested ? documentWidth - scrollableAncestorRect.right : 0;\n const deltaBottom = isScrollableAncestorNested ? documentHeight - scrollableAncestorRect.bottom : 0;\n const deltaLeft = isScrollableAncestorNested ? scrollableAncestorRect.left : 0;\n\n this.cachedAvailableSpace = {\n top: boundElementRect.top - deltaTop - safeSpace,\n right: documentWidth - boundElementRect.right - deltaRight - safeSpace,\n bottom: documentHeight - boundElementRect.bottom - deltaBottom - safeSpace,\n left: boundElementRect.left - deltaLeft - safeSpace,\n };\n\n return this.cachedAvailableSpace;\n }\n\n /** Calculate the space around the bound element relative to the viewport. */\n private getBoundElementOffsets(): Offsets {\n const elementRect = this.boundElement.getBoundingClientRect();\n const documentWidth = this.boundElement.ownerDocument.documentElement.clientWidth;\n const documentHeight = this.boundElement.ownerDocument.documentElement.clientHeight;\n\n return {\n top: elementRect.top,\n right: documentWidth - elementRect.right,\n bottom: documentHeight - elementRect.bottom,\n left: elementRect.left,\n };\n }\n\n /** Compute positioning offsets in the appropriate coordinate space, accounting for transformed containing blocks and scroll. */\n private computePositionOffsets(): Offsets {\n const boundElementOffsets = this.getBoundElementOffsets();\n const containingBlockAncestor = findContainingBlockAncestor(this.host);\n const isDocumentElement = containingBlockAncestor === this.host.ownerDocument.documentElement;\n\n if (isDocumentElement) {\n return boundElementOffsets;\n }\n\n const containingBlockRect = containingBlockAncestor.getBoundingClientRect();\n const containingBlockStyle = getComputedStyle(containingBlockAncestor);\n /** Padding box of the containing block, accounting for borders. */\n const paddingBox = {\n top: containingBlockRect.top + parseFloat(containingBlockStyle.borderTopWidth),\n right: containingBlockRect.right - parseFloat(containingBlockStyle.borderRightWidth),\n bottom: containingBlockRect.bottom - parseFloat(containingBlockStyle.borderBottomWidth),\n left: containingBlockRect.left + parseFloat(containingBlockStyle.borderLeftWidth),\n };\n\n const boundElementRect = this.boundElement.getBoundingClientRect();\n /** Bound element offsets relative to the containing block padding box. */\n const relativeOffsets = {\n top: boundElementRect.top - paddingBox.top,\n right: paddingBox.right - boundElementRect.right,\n bottom: paddingBox.bottom - boundElementRect.bottom,\n left: boundElementRect.left - paddingBox.left,\n };\n\n /** Account for scroll to keep the popover aligned while the containing block scrolls. */\n return {\n top: relativeOffsets.top + containingBlockAncestor.scrollTop,\n right: relativeOffsets.right - containingBlockAncestor.scrollLeft,\n bottom: relativeOffsets.bottom - containingBlockAncestor.scrollTop,\n left: relativeOffsets.left + containingBlockAncestor.scrollLeft,\n };\n }\n\n /** Apply positioning styles based on `position` parameter. */\n private applyPositionStyles(position: PopoverPosition, availableSpace: Offsets): void {\n const boundElementWidth = this.boundElement.offsetWidth;\n const boundElementHeight = this.boundElement.offsetHeight;\n const offsetModifier = this.offsetModifier;\n /**\n * Distance between the arrow center and the popover edge.\n * Needed to align the center of the arrow with the center of the bound element when `showArrow` and `center` are enabled.\n */\n const arrowModifier = this.showArrow && this.center ? 8 : 0;\n const hostStyle = this.host.style;\n /** Gap between the popover and the bound element, set as margin in CSS. */\n const distanceFromBound = parseFloat(getComputedStyle(this.host).marginTop.replace(\"px\", \"\")) || 0;\n const positionOffsets = this.computePositionOffsets();\n\n /**\n * Precomputed bases to reduce repeated arithmetic in the switch below.\n * They represent the bound element edges plus optional centering offsets.\n */\n const leftBase = positionOffsets.left + boundElementWidth * offsetModifier;\n const rightBase = positionOffsets.right + boundElementWidth * offsetModifier;\n const topBase = positionOffsets.top + boundElementHeight;\n const bottomBase = positionOffsets.bottom + boundElementHeight;\n const sideTopBase = positionOffsets.top + boundElementHeight * offsetModifier;\n const sideBottomBase = positionOffsets.bottom + boundElementHeight * offsetModifier;\n\n let maxWidth: number;\n let maxHeight: number;\n\n switch (position) {\n case PopoverPosition.TOP:\n case PopoverPosition.TOP_RIGHT:\n hostStyle.bottom = `${bottomBase}px`;\n hostStyle.left = `${leftBase - (position === PopoverPosition.TOP_RIGHT ? arrowModifier : 0)}px`;\n maxHeight = availableSpace.top - distanceFromBound;\n if (position === PopoverPosition.TOP_RIGHT) {\n maxWidth = availableSpace.right + boundElementWidth * offsetModifier;\n }\n break;\n\n case PopoverPosition.TOP_LEFT:\n hostStyle.right = `${rightBase - arrowModifier}px`;\n hostStyle.bottom = `${bottomBase}px`;\n maxWidth = availableSpace.left + boundElementWidth * offsetModifier;\n maxHeight = availableSpace.top - distanceFromBound;\n break;\n\n case PopoverPosition.BOTTOM:\n case PopoverPosition.BOTTOM_RIGHT:\n hostStyle.top = `${topBase}px`;\n hostStyle.left = `${leftBase - (position === PopoverPosition.BOTTOM_RIGHT ? arrowModifier : 0)}px`;\n maxHeight = availableSpace.bottom - distanceFromBound;\n if (position === PopoverPosition.BOTTOM_RIGHT) {\n maxWidth = availableSpace.right + boundElementWidth * offsetModifier;\n }\n break;\n\n case PopoverPosition.BOTTOM_LEFT:\n hostStyle.top = `${topBase}px`;\n hostStyle.right = `${rightBase - arrowModifier}px`;\n maxWidth = availableSpace.left + boundElementWidth * offsetModifier;\n maxHeight = availableSpace.bottom - distanceFromBound;\n break;\n\n case PopoverPosition.RIGHT:\n case PopoverPosition.RIGHT_BOTTOM:\n hostStyle.top = `${sideTopBase - (position === PopoverPosition.RIGHT_BOTTOM ? arrowModifier : 0)}px`;\n hostStyle.left = `${positionOffsets.left + boundElementWidth}px`;\n maxWidth = availableSpace.right - distanceFromBound;\n if (position === PopoverPosition.RIGHT) {\n maxHeight = availableSpace.top + availableSpace.bottom + boundElementHeight;\n } else {\n maxHeight = availableSpace.bottom + boundElementHeight * offsetModifier;\n }\n break;\n\n case PopoverPosition.RIGHT_TOP:\n hostStyle.bottom = `${sideBottomBase - arrowModifier}px`;\n hostStyle.left = `${positionOffsets.left + boundElementWidth}px`;\n maxWidth = availableSpace.right - distanceFromBound;\n maxHeight = availableSpace.top + boundElementHeight * offsetModifier;\n break;\n\n case PopoverPosition.LEFT:\n case PopoverPosition.LEFT_BOTTOM:\n hostStyle.top = `${sideTopBase - (position === PopoverPosition.LEFT_BOTTOM ? arrowModifier : 0)}px`;\n hostStyle.right = `${positionOffsets.right + boundElementWidth}px`;\n maxWidth = availableSpace.left - distanceFromBound;\n if (position === PopoverPosition.LEFT_BOTTOM) {\n maxHeight = availableSpace.bottom + boundElementHeight * offsetModifier;\n }\n break;\n\n case PopoverPosition.LEFT_TOP:\n hostStyle.right = `${positionOffsets.right + boundElementWidth}px`;\n hostStyle.bottom = `${sideBottomBase - arrowModifier}px`;\n maxWidth = availableSpace.left - distanceFromBound;\n maxHeight = availableSpace.top + boundElementHeight * offsetModifier;\n break;\n }\n\n if (getDevice() !== Device.MOBILE) {\n // Only force max sizes on non-mobile viewports\n Object.assign(hostStyle, {\n maxWidth: maxWidth ? `${maxWidth}px` : \"\",\n maxHeight: maxHeight ? `${maxHeight}px` : \"\",\n });\n }\n }\n\n /** Set the position of the popover. */\n private setPosition(): void {\n if (!this.boundElement) {\n return;\n }\n\n if (!isElementVisibleInContainer(this.boundElement, this.findScrollableAncestor(this.boundElement))) {\n // If the bound element is not visible, hide the popover too\n this.open = false;\n\n return;\n }\n\n Object.assign(this.host.style, {\n // Reset all positioning properties\n top: \"auto\",\n right: \"auto\",\n bottom: \"auto\",\n left: \"auto\",\n maxWidth: \"\",\n maxHeight: \"\",\n // Set initial visibility to hidden while calculating position...\n visibility: \"hidden\",\n });\n\n const availableSpace = this.calculateAvailableSpace();\n const position = this.getOptimalPopoverPosition(this.position, availableSpace);\n\n this.applyPositionStyles(position, availableSpace);\n this.currentPosition = position;\n this.positionChange.emit({position: this.currentPosition});\n\n // ...then restore the visibility\n this.host.style.visibility = \"visible\";\n }\n\n componentWillLoad(): void {\n this.validatePosition(this.position);\n }\n\n componentDidLoad(): void {\n this.findBoundElement();\n if (this.open) {\n this.onOpen();\n }\n }\n\n disconnectedCallback(): void {\n cancelAnimationFrame(this.animationFrameRequestId);\n }\n\n render(): HTMLZPopoverElement {\n return (\n <Host current-position={this.currentPosition}>\n <slot></slot>\n </Host>\n );\n }\n}\n"],"mappings":"yLAAA,MAAMA,EAAY,IAAM,+iG,MCuCXC,EAAQC,EAAA,MAAAD,UAAAE,EALrB,WAAAC,CAAAC,G,wJAYEC,KAAAC,SAA6BC,EAAgBC,IAQ7CH,KAAAI,KAAO,MAWPJ,KAAAK,UAAY,MAIZL,KAAAM,OAAS,MAQTN,KAAAO,SAAW,KA8BMP,KAAAQ,eAAiB,CA+mBnC,CA3lBC,wBAAAC,CAAyBC,GACvB,GAAIV,KAAKO,UAAYG,EAAEC,MAAQC,EAAaC,IAAK,CAC/CH,EAAEI,kBACFd,KAAKI,KAAO,K,EAUhB,kBAAAW,CAAmBL,GACjB,MAAMM,EAASN,EAAEM,OACjB,IAAKhB,KAAKO,WAAaP,KAAKI,MAAQa,EAAgBjB,KAAKkB,KAAMF,GAAS,CACtE,M,CAGF,GAAIC,EAAgBjB,KAAKmB,aAAcH,GAAS,CAE9CN,EAAEI,iB,CAEJd,KAAKI,KAAO,K,CAId,gBAAAgB,CAAiBC,GACf,IAAKC,OAAOC,OAAOrB,GAAiBsB,SAASH,IAAgCA,IAAanB,EAAgBuB,KAAM,CAC9GJ,EAAWnB,EAAgBC,IAC3BH,KAAKC,SAAWoB,C,CAElBrB,KAAK0B,gBAAkBL,EACvB,GAAIrB,KAAKI,KAAM,CACbJ,KAAK2B,a,EAMT,MAAAC,GACEC,qBAAqB7B,KAAK8B,yBAC1B9B,KAAK+B,WAAWC,KAAK,CAAC5B,KAAMJ,KAAKI,OACjC,IAAKJ,KAAKI,KAAM,CACdkB,OAAOW,OAAOjC,KAAKkB,KAAKgB,MAAO,CAE7BC,IAAK,OACLC,MAAO,OACPC,OAAQ,OACRC,KAAM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GACVC,UAAW,GAEXC,WAAY,WAGd,MAAM0B,EAAiBnE,KAAK4H,0BAC5B,MAAM3H,EAAWD,KAAKsE,0BAA0BtE,KAAKC,SAAUkE,GAE/DnE,KAAK8J,oBAAoB7J,EAAUkE,GACnCnE,KAAK0B,gBAAkBzB,EACvBD,KAAK+K,eAAe/I,KAAK,CAAC/B,SAAUD,KAAK0B,kBAGzC1B,KAAKkB,KAAKgB,MAAMO,WAAa,S,CAG/B,iBAAAuI,GACEhL,KAAKoB,iBAAiBpB,KAAKC,S,CAG7B,gBAAAgL,GACEjL,KAAK+C,mBACL,GAAI/C,KAAKI,KAAM,CACbJ,KAAK4B,Q,EAIT,oBAAAsJ,GACErJ,qBAAqB7B,KAAK8B,wB,CAG5B,MAAAqJ,GACE,OACEC,EAACC,EAAI,CAAA1K,IAAA,8DAAmBX,KAAK0B,iBAC3B0J,EAAA,QAAAzK,IAAA,6C,odA7nBkBhB,EAAAgG,cAAmC,CACzDzF,EAAgBC,IAChBD,EAAgB6E,UAChB7E,EAAgB8E,SAChB9E,EAAgB+E,MAChB/E,EAAgBgF,aAChBhF,EAAgBiF,UAChBjF,EAAgBkF,OAChBlF,EAAgBmF,YAChBnF,EAAgBoF,aAChBpF,EAAgBqF,KAChBrF,EAAgBsF,SAChBtF,EAAgBuF,a","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{p as a,c as n,h as t,d as s,t as o}from"./p-RmbDDbWd.js";import{v as i,u as c,g as e}from"./p-DdetsoIY.js";import{R as f,F as r}from"./p-B3VFztJH.js";import{j as h}from"./p-8C_CrFxp.js";const v=()=>`.sc-z-offcanvas-h{font-family:var(--font-family-sans);font-weight:var(--font-rg)}[variant="pushcontent"].sc-z-offcanvas-h:not([transitiondirection="up"]){overflow:hidden}.canvas-container.sc-z-offcanvas{display:flex;overflow:hidden;min-width:100%;height:100%;background:var(--color-surface01);transform:translateX(0);transition:transform 0.4s ease-out}.sc-z-offcanvas-h>*.sc-z-offcanvas{position:fixed;top:var(--z-offcanvas--top-space, 0);right:0;bottom:0;left:0}[open].sc-z-offcanvas-h>*.sc-z-offcanvas{height:calc(100% - var(--z-offcanvas--top-space, 0px))}[transitiondirection="right"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{transform:translateX(-100%)}[transitiondirection="left"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{transform:translateX(100%)}[open][transitiondirection="right"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas,[open][transitiondirection="left"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{transform:translateX(0)}[transitiondirection="up"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{top:auto;bottom:0;height:var(--z-offcanvas--container-height, 90%);transform:translateY(100%)}[transitiondirection="up"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas,[variant="overlay"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{z-index:1001}[open][transitiondirection="up"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{transform:translateY(0)}[variant="pushcontent"].sc-z-offcanvas-h:not([transitiondirection="up"])>.canvas-container.sc-z-offcanvas{position:relative;height:100%}[variant="pushcontent"].sc-z-offcanvas-h:not([open]){display:none}[skip-animation].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{transition:none}.backdrop.sc-z-offcanvas{z-index:1000;width:100%;height:100%;background-color:var(--gray900);opacity:0;pointer-events:none;transition:opacity 0.4s ease-out}[open].sc-z-offcanvas-h>.backdrop.sc-z-offcanvas{opacity:0.7;pointer-events:unset}.canvas-container.sc-z-offcanvas>.canvas-content.sc-z-offcanvas{overflow:hidden auto;flex:1 auto;padding:0 calc(var(--space-unit) * 2);margin:calc(var(--space-unit) * 2) calc(var(--space-unit) / 2) calc(var(--space-unit) * 2) 0;outline:none}@media (min-width: 768px){[variant="pushcontent"].sc-z-offcanvas-h:not([transitiondirection="up"]){flex:none}.canvas-container.sc-z-offcanvas{width:var(--z-offcanvas--container-width, 375px);min-width:var(--z-offcanvas--container-width, 375px)}[transitiondirection="up"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{width:100%}[transitiondirection="right"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{right:auto;left:0}[transitiondirection="left"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{right:0;left:auto}}`;const d=a(class a extends f{constructor(a){super(false);if(a!==false){this.__registerHost()}this.canvasOpenStatusChanged=n(this,"canvasOpenStatusChanged",7);this.variant=i.PUSHCONTENT;this.open=false;this.transitiondirection=c.LEFT;this.skipLoadAnimation=false;this.showBackdrop=true;this.skipAnimation=false;this.focusTrapController=new r(this,{fallbackFocus:()=>this.canvasContent,isActive:()=>this.open&&this.variant===i.OVERLAY})}handleKeyDown(a){if(!this.open||this.variant!==i.OVERLAY){return}if(a.key===e.ESC){a.preventDefault();this.open=false;return}this.focusTrapController.handleWrapTab(a)}handlePageScroll(){const a=this.variant===i.OVERLAY||this.transitiondirection===c.UP?"overflow-y":"overflow-x";this.host.ownerDocument.body.style[a]=this.open?"hidden":""}onOpenChanged(){this.canvasOpenStatusChanged.emit(this.open);this.handlePageScroll();this.focusTrapController.sync()}componentWillLoad(){if(this.open){this.skipAnimation=true}return super.componentWillLoad()}componentDidRender(){this.skipAnimation=false}componentDidLoad(){if(this.open){this.onOpenChanged()}}disconnectedCallback(){this.handlePageScroll();super.disconnectedCallback()}render(){return t(s,{key:"c3e830f6e06a3f5bfcfa491417b3f4a04c694d22","skip-animation":this.skipAnimation,"aria-hidden":!this.open?"true":null,"aria-modal":this.open&&this.variant===i.OVERLAY?"true":null,role:this.open&&this.variant===i.OVERLAY?"dialog":null},t("div",{key:"70347123fbb93082b6e38ff1de4a6364a4f433fb",class:"canvas-container"},t("div",{key:"ef277c0f8e0fc7c69fbd1c654f67f4ec40aed0ec",class:"canvas-content z-scrollbar",ref:a=>this.canvasContent=a,tabIndex:h(this.host).length?undefined:-1},t("slot",{key:"1a2a5ff0fba5b2eae9dc90af4a0a238007008e11",name:"canvasContent"}))),(this.variant==i.OVERLAY||this.transitiondirection===c.UP)&&this.showBackdrop&&t("div",{key:"fbe7fb00cfcc67e3021fbb50ab042a22d0cc5053",class:"backdrop",onClick:a=>{a.preventDefault();a.stopPropagation();this.open=false}}))}get host(){return this}static get watchers(){return{variant:[{handlePageScroll:1}],open:[{onOpenChanged:0}]}}static get style(){return v()}},[774,"z-offcanvas",{variant:[513],open:[1540],transitiondirection:[513],skipLoadAnimation:[4,"skip-load-animation"],showBackdrop:[4,"show-backdrop"],skipAnimation:[32]},[[4,"keydown","handleKeyDown"]],{variant:[{handlePageScroll:1}],open:[{onOpenChanged:0}]}]);function l(){if(typeof customElements==="undefined"){return}const a=["z-offcanvas"];a.forEach((a=>{switch(a){case"z-offcanvas":if(!customElements.get(o(a))){customElements.define(o(a),d)}break}}))}export{d as Z,l as d};
2
+ //# sourceMappingURL=p-DL2QAfIP.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["stylesCss","ZOffcanvas","__stencil_proxyCustomElement","ReactiveControllerHost","this","variant","OffCanvasVariant","PUSHCONTENT","open","transitiondirection","TransitionDirection","LEFT","skipLoadAnimation","showBackdrop","skipAnimation","focusTrapController","FocusTrapController","fallbackFocus","canvasContent","isActive","OVERLAY","handleKeyDown","event","key","KeyboardCode","ESC","preventDefault","handleWrapTab","handlePageScroll","overflow","UP","host","ownerDocument","body","style","onOpenChanged","canvasOpenStatusChanged","emit","sync","componentWillLoad","super","componentDidRender","componentDidLoad","disconnectedCallback","render","h","Host","role","class","ref","el","tabIndex","getTabbableElements","length","undefined","name","onClick","ev","stopPropagation"],"sources":["src/components/z-offcanvas/styles.css?tag=z-offcanvas&encapsulation=scoped","src/components/z-offcanvas/index.tsx"],"sourcesContent":[":host {\n /**\n * @prop --z-offcanvas--top-space: Top offset of the offcanvas, for `overlay` variant. Useful when there is some fixed element above the offcanvas. Default: `0`.\n * @prop --z-offcanvas--container-width: Width of the offcanvas for `left` and `right` direction. Default: `375px`.\n * @prop --z-offcanvas--container-height: Height of the offcanvas for `up` direction. Default: `90%`.\n */\n --z-offcanvas--container-width: ;\n --z-offcanvas--container-height: ;\n --z-offcanvas--top-space: ;\n\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n}\n\n:host([variant=\"pushcontent\"]:not([transitiondirection=\"up\"])) {\n overflow: hidden;\n}\n\n.canvas-container {\n display: flex;\n overflow: hidden;\n min-width: 100%;\n height: 100%;\n background: var(--color-surface01);\n transform: translateX(0);\n transition: transform 0.4s ease-out;\n}\n\n:host > * {\n position: fixed;\n top: var(--z-offcanvas--top-space, 0);\n right: 0;\n bottom: 0;\n left: 0;\n}\n\n:host([open]) > * {\n height: calc(100% - var(--z-offcanvas--top-space, 0px));\n}\n\n:host([transitiondirection=\"right\"]) > .canvas-container {\n transform: translateX(-100%);\n}\n\n:host([transitiondirection=\"left\"]) > .canvas-container {\n transform: translateX(100%);\n}\n\n:host([open][transitiondirection=\"right\"]) > .canvas-container,\n:host([open][transitiondirection=\"left\"]) > .canvas-container {\n transform: translateX(0);\n}\n\n:host([transitiondirection=\"up\"]) > .canvas-container {\n top: auto;\n bottom: 0;\n height: var(--z-offcanvas--container-height, 90%);\n transform: translateY(100%);\n}\n\n:host([transitiondirection=\"up\"], [variant=\"overlay\"]) > .canvas-container {\n z-index: 1001;\n}\n\n:host([open][transitiondirection=\"up\"]) > .canvas-container {\n transform: translateY(0);\n}\n\n:host([variant=\"pushcontent\"]:not([transitiondirection=\"up\"])) > .canvas-container {\n position: relative;\n height: 100%;\n}\n\n:host([variant=\"pushcontent\"]:not([open])) {\n display: none;\n}\n\n:host([skip-animation]) > .canvas-container {\n transition: none;\n}\n\n.backdrop {\n z-index: 1000;\n width: 100%;\n height: 100%;\n background-color: var(--gray900);\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.4s ease-out;\n}\n\n:host([open]) > .backdrop {\n opacity: 0.7;\n pointer-events: unset;\n}\n\n.canvas-container > .canvas-content {\n overflow: hidden auto;\n flex: 1 auto;\n padding: 0 calc(var(--space-unit) * 2);\n margin: calc(var(--space-unit) * 2) calc(var(--space-unit) / 2) calc(var(--space-unit) * 2) 0;\n outline: none;\n}\n\n/* Tablet / Desktop */\n@media (min-width: 768px) {\n :host([variant=\"pushcontent\"]:not([transitiondirection=\"up\"])) {\n flex: none; /* Prevent unwanted width changes in flex containers */\n }\n\n .canvas-container {\n width: var(--z-offcanvas--container-width, 375px);\n min-width: var(--z-offcanvas--container-width, 375px);\n }\n\n :host([transitiondirection=\"up\"]) > .canvas-container {\n width: 100%;\n }\n\n :host([transitiondirection=\"right\"]) > .canvas-container {\n right: auto;\n left: 0;\n }\n\n :host([transitiondirection=\"left\"]) > .canvas-container {\n right: 0;\n left: auto;\n }\n}\n","import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {KeyboardCode, OffCanvasVariant, TransitionDirection} from \"../../beans\";\nimport {FocusTrapController} from \"../../utils/focus-trap-controller\";\nimport {ReactiveControllerHost} from \"../../utils/reactive-controller\";\nimport {getTabbableElements} from \"../../utils/utils\";\n\n/**\n * @slot canvasContent - Slot for the offcanvas content.\n */\n@Component({\n tag: \"z-offcanvas\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZOffcanvas extends ReactiveControllerHost {\n @Element() host: HTMLZOffcanvasElement;\n\n /**\n * Offcanvas variant.\n * - `overlay`: The offcanvas covers the page content putting an overlay.\n * - `pushcontent`: The offcanvas isn't absolutely positioned and \"pushes\" the page content.\n * > NB: `pushcontent` variant may need some extra style tuning of the context around the component to work properly.\n * Also, the `pushcontent` variant doesn't have the open/close transition.\n */\n @Prop({reflect: true})\n variant?: OffCanvasVariant = OffCanvasVariant.PUSHCONTENT;\n\n /** Whether the offcanvas is open. Default: false */\n @Prop({reflect: true, mutable: true})\n open = false;\n\n /**\n * Open the content transitioning to a specified direction.\n * The `up` direction always show the `overlay`, also when the variant is `pushcontent`.\n */\n @Prop({reflect: true})\n transitiondirection?: TransitionDirection = TransitionDirection.LEFT;\n\n /**\n * Skip the opening transition when the offcanvas is already open at the first render.\n * @deprecated This prop is not needed anymore, the component will automatically skip the transition\n * when it starts with `open` set to `true`. Only exists for Typescript backward compatibility.\n */\n @Prop()\n skipLoadAnimation = false;\n\n /** Whether to show the backdrop when the offcanvas is open and variant is not `pushcontent`. Default: `true` */\n @Prop()\n showBackdrop = true;\n\n /** emitted when `open` prop changes */\n @Event()\n canvasOpenStatusChanged: EventEmitter<boolean>;\n\n /** Used to skip the opening transition when the offcanvas is already open at the first render. */\n @State()\n private skipAnimation = false;\n\n private canvasContent: HTMLElement;\n\n private focusTrapController = new FocusTrapController(this, {\n fallbackFocus: () => this.canvasContent,\n isActive: () => this.open && this.variant === OffCanvasVariant.OVERLAY,\n });\n\n /**\n * Handles Escape and wrap-around Tab navigation at the focus boundaries.\n */\n @Listen(\"keydown\", {target: \"document\"})\n handleKeyDown(event: KeyboardEvent): void {\n if (!this.open || this.variant !== OffCanvasVariant.OVERLAY) {\n return;\n }\n\n if (event.key === KeyboardCode.ESC) {\n event.preventDefault();\n this.open = false;\n\n return;\n }\n\n this.focusTrapController.handleWrapTab(event);\n }\n\n /**\n * Lock the page scroll when the offcanvas is open and unlock it when the offcanvas is closed.\n */\n @Watch(\"variant\", {immediate: true})\n private handlePageScroll(): void {\n const overflow =\n this.variant === OffCanvasVariant.OVERLAY || this.transitiondirection === TransitionDirection.UP\n ? \"overflow-y\"\n : \"overflow-x\";\n\n this.host.ownerDocument.body.style[overflow] = this.open ? \"hidden\" : \"\";\n }\n\n @Watch(\"open\")\n onOpenChanged(): void {\n this.canvasOpenStatusChanged.emit(this.open);\n\n this.handlePageScroll();\n this.focusTrapController.sync();\n }\n\n componentWillLoad() {\n if (this.open) {\n this.skipAnimation = true; // TODO: remove this line when `skipLoadAnimation` prop is removed.\n }\n\n return super.componentWillLoad();\n }\n\n componentDidRender() {\n this.skipAnimation = false; // TODO: remove this line when `skipLoadAnimation` prop is removed.\n }\n\n componentDidLoad() {\n if (this.open) {\n this.onOpenChanged();\n }\n }\n\n disconnectedCallback() {\n this.handlePageScroll();\n super.disconnectedCallback();\n }\n\n render(): HTMLZOffcanvasElement {\n return (\n <Host\n skip-animation={this.skipAnimation}\n aria-hidden={!this.open ? \"true\" : null}\n aria-modal={this.open && this.variant === OffCanvasVariant.OVERLAY ? \"true\" : null}\n role={this.open && this.variant === OffCanvasVariant.OVERLAY ? \"dialog\" : null}\n >\n <div class=\"canvas-container\">\n <div\n class=\"canvas-content z-scrollbar\"\n ref={(el) => (this.canvasContent = el)}\n tabIndex={getTabbableElements(this.host).length ? undefined : -1} // allows the div to programmatically receive focus when there are no focusable elements inside, necessary for the focus trap to work properly\n >\n <slot name=\"canvasContent\"></slot>\n </div>\n </div>\n {(this.variant == OffCanvasVariant.OVERLAY || this.transitiondirection === TransitionDirection.UP) &&\n this.showBackdrop && (\n <div\n class=\"backdrop\"\n onClick={(ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n this.open = false;\n }}\n ></div>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"wPAAA,MAAMA,EAAY,IAAM,6oF,MCeXC,EAAWC,EAAA,MAAAD,UAAQE,E,iIAW9BC,KAAAC,QAA6BC,EAAiBC,YAI9CH,KAAAI,KAAO,MAOPJ,KAAAK,oBAA4CC,EAAoBC,KAQhEP,KAAAQ,kBAAoB,MAIpBR,KAAAS,aAAe,KAQPT,KAAAU,cAAgB,MAIhBV,KAAAW,oBAAsB,IAAIC,EAAoBZ,KAAM,CAC1Da,cAAe,IAAMb,KAAKc,cAC1BC,SAAU,IAAMf,KAAKI,MAAQJ,KAAKC,UAAYC,EAAiBc,S,CAOjE,aAAAC,CAAcC,GACZ,IAAKlB,KAAKI,MAAQJ,KAAKC,UAAYC,EAAiBc,QAAS,CAC3D,M,CAGF,GAAIE,EAAMC,MAAQC,EAAaC,IAAK,CAClCH,EAAMI,iBACNtB,KAAKI,KAAO,MAEZ,M,CAGFJ,KAAKW,oBAAoBY,cA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as","__stencil_proxyCustomElement","ReactiveControllerHost","this","variant","OffCanvasVariant","PUSHCONTENT","open","transitiondirection","TransitionDirection","LEFT","skipLoadAnimation","showBackdrop","skipAnimation","focusTrapController","FocusTrapController","fallbackFocus","canvasContent","isActive","OVERLAY","handleKeyDown","event","key","KeyboardCode","ESC","preventDefault","handleWrapTab","handlePageScroll","overflow","UP","host","ownerDocument","body","style","onOpenChanged","canvasOpenStatusChanged","emit","sync","componentWillLoad","super","componentDidRender","componentDidLoad","disconnectedCallback","render","h","Host","role","class","ref","el","tabIndex","getTabbableElements","length","undefined","name","onClick","ev","stopPropagation"],"sources":["src/components/z-offcanvas/styles.css?tag=z-offcanvas&encapsulation=scoped","src/components/z-offcanvas/index.tsx"],"sourcesContent":[":host {\n /**\n * @prop --z-offcanvas--top-space: Top offset of the offcanvas, for `overlay` variant. Useful when there is some fixed element above the offcanvas. Default: `0`.\n * @prop --z-offcanvas--container-width: Width of the offcanvas for `left` and `right` direction. Default: `375px`.\n * @prop --z-offcanvas--container-height: Height of the offcanvas for `up` direction. Default: `90%`.\n */\n --z-offcanvas--container-width: ;\n --z-offcanvas--container-height: ;\n --z-offcanvas--top-space: ;\n\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n}\n\n:host([variant=\"pushcontent\"]:not([transitiondirection=\"up\"])) {\n overflow: hidden;\n}\n\n.canvas-container {\n display: flex;\n overflow: hidden;\n min-width: 100%;\n height: 100%;\n background: var(--color-surface01);\n transform: translateX(0);\n transition: transform 0.4s ease-out;\n}\n\n:host > * {\n position: fixed;\n top: var(--z-offcanvas--top-space, 0);\n right: 0;\n bottom: 0;\n left: 0;\n}\n\n:host([open]) > * {\n height: calc(100% - var(--z-offcanvas--top-space, 0px));\n}\n\n:host([transitiondirection=\"right\"]) > .canvas-container {\n transform: translateX(-100%);\n}\n\n:host([transitiondirection=\"left\"]) > .canvas-container {\n transform: translateX(100%);\n}\n\n:host([open][transitiondirection=\"right\"]) > .canvas-container,\n:host([open][transitiondirection=\"left\"]) > .canvas-container {\n transform: translateX(0);\n}\n\n:host([transitiondirection=\"up\"]) > .canvas-container {\n top: auto;\n bottom: 0;\n height: var(--z-offcanvas--container-height, 90%);\n transform: translateY(100%);\n}\n\n:host([transitiondirection=\"up\"], [variant=\"overlay\"]) > .canvas-container {\n z-index: 1001;\n}\n\n:host([open][transitiondirection=\"up\"]) > .canvas-container {\n transform: translateY(0);\n}\n\n:host([variant=\"pushcontent\"]:not([transitiondirection=\"up\"])) > .canvas-container {\n position: relative;\n height: 100%;\n}\n\n:host([variant=\"pushcontent\"]:not([open])) {\n display: none;\n}\n\n:host([skip-animation]) > .canvas-container {\n transition: none;\n}\n\n.backdrop {\n z-index: 1000;\n width: 100%;\n height: 100%;\n background-color: var(--gray900);\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.4s ease-out;\n}\n\n:host([open]) > .backdrop {\n opacity: 0.7;\n pointer-events: unset;\n}\n\n.canvas-container > .canvas-content {\n overflow: hidden auto;\n flex: 1 auto;\n padding: 0 calc(var(--space-unit) * 2);\n margin: calc(var(--space-unit) * 2) calc(var(--space-unit) / 2) calc(var(--space-unit) * 2) 0;\n outline: none;\n}\n\n/* Tablet / Desktop */\n@media (min-width: 768px) {\n :host([variant=\"pushcontent\"]:not([transitiondirection=\"up\"])) {\n flex: none; /* Prevent unwanted width changes in flex containers */\n }\n\n .canvas-container {\n width: var(--z-offcanvas--container-width, 375px);\n min-width: var(--z-offcanvas--container-width, 375px);\n }\n\n :host([transitiondirection=\"up\"]) > .canvas-container {\n width: 100%;\n }\n\n :host([transitiondirection=\"right\"]) > .canvas-container {\n right: auto;\n left: 0;\n }\n\n :host([transitiondirection=\"left\"]) > .canvas-container {\n right: 0;\n left: auto;\n }\n}\n","import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {KeyboardCode, OffCanvasVariant, TransitionDirection} from \"../../beans\";\nimport {FocusTrapController} from \"../../utils/focus-trap-controller\";\nimport {ReactiveControllerHost} from \"../../utils/reactive-controller\";\nimport {getTabbableElements} from \"../../utils/utils\";\n\n/**\n * @slot canvasContent - Slot for the offcanvas content.\n */\n@Component({\n tag: \"z-offcanvas\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZOffcanvas extends ReactiveControllerHost {\n @Element() host: HTMLZOffcanvasElement;\n\n /**\n * Offcanvas variant.\n * - `overlay`: The offcanvas covers the page content putting an overlay.\n * - `pushcontent`: The offcanvas isn't absolutely positioned and \"pushes\" the page content.\n * > NB: `pushcontent` variant may need some extra style tuning of the context around the component to work properly.\n * Also, the `pushcontent` variant doesn't have the open/close transition.\n */\n @Prop({reflect: true})\n variant?: OffCanvasVariant = OffCanvasVariant.PUSHCONTENT;\n\n /** Whether the offcanvas is open. Default: false */\n @Prop({reflect: true, mutable: true})\n open = false;\n\n /**\n * Open the content transitioning to a specified direction.\n * The `up` direction always show the `overlay`, also when the variant is `pushcontent`.\n */\n @Prop({reflect: true})\n transitiondirection?: TransitionDirection = TransitionDirection.LEFT;\n\n /**\n * Skip the opening transition when the offcanvas is already open at the first render.\n * @deprecated This prop is not needed anymore, the component will automatically skip the transition\n * when it starts with `open` set to `true`. Only exists for Typescript backward compatibility.\n */\n @Prop()\n skipLoadAnimation = false;\n\n /** Whether to show the backdrop when the offcanvas is open and variant is not `pushcontent`. Default: `true` */\n @Prop()\n showBackdrop = true;\n\n /** emitted when `open` prop changes */\n @Event()\n canvasOpenStatusChanged: EventEmitter<boolean>;\n\n /** Used to skip the opening transition when the offcanvas is already open at the first render. */\n @State()\n private skipAnimation = false;\n\n private canvasContent: HTMLElement;\n\n private focusTrapController = new FocusTrapController(this, {\n fallbackFocus: () => this.canvasContent,\n isActive: () => this.open && this.variant === OffCanvasVariant.OVERLAY,\n });\n\n /**\n * Handles Escape and wrap-around Tab navigation at the focus boundaries.\n */\n @Listen(\"keydown\", {target: \"document\"})\n handleKeyDown(event: KeyboardEvent): void {\n if (!this.open || this.variant !== OffCanvasVariant.OVERLAY) {\n return;\n }\n\n if (event.key === KeyboardCode.ESC) {\n event.preventDefault();\n this.open = false;\n\n return;\n }\n\n this.focusTrapController.handleWrapTab(event);\n }\n\n /**\n * Lock the page scroll when the offcanvas is open and unlock it when the offcanvas is closed.\n */\n @Watch(\"variant\", {immediate: true})\n private handlePageScroll(): void {\n const overflow =\n this.variant === OffCanvasVariant.OVERLAY || this.transitiondirection === TransitionDirection.UP\n ? \"overflow-y\"\n : \"overflow-x\";\n\n this.host.ownerDocument.body.style[overflow] = this.open ? \"hidden\" : \"\";\n }\n\n @Watch(\"open\")\n onOpenChanged(): void {\n this.canvasOpenStatusChanged.emit(this.open);\n\n this.handlePageScroll();\n this.focusTrapController.sync();\n }\n\n componentWillLoad() {\n if (this.open) {\n this.skipAnimation = true; // TODO: remove this line when `skipLoadAnimation` prop is removed.\n }\n\n return super.componentWillLoad();\n }\n\n componentDidRender() {\n this.skipAnimation = false; // TODO: remove this line when `skipLoadAnimation` prop is removed.\n }\n\n componentDidLoad() {\n if (this.open) {\n this.onOpenChanged();\n }\n }\n\n disconnectedCallback() {\n this.handlePageScroll();\n super.disconnectedCallback();\n }\n\n render(): HTMLZOffcanvasElement {\n return (\n <Host\n skip-animation={this.skipAnimation}\n aria-hidden={!this.open ? \"true\" : null}\n aria-modal={this.open && this.variant === OffCanvasVariant.OVERLAY ? \"true\" : null}\n role={this.open && this.variant === OffCanvasVariant.OVERLAY ? \"dialog\" : null}\n >\n <div class=\"canvas-container\">\n <div\n class=\"canvas-content z-scrollbar\"\n ref={(el) => (this.canvasContent = el)}\n tabIndex={getTabbableElements(this.host).length ? undefined : -1} // allows the div to programmatically receive focus when there are no focusable elements inside, necessary for the focus trap to work properly\n >\n <slot name=\"canvasContent\"></slot>\n </div>\n </div>\n {(this.variant == OffCanvasVariant.OVERLAY || this.transitiondirection === TransitionDirection.UP) &&\n this.showBackdrop && (\n <div\n class=\"backdrop\"\n onClick={(ev) => {\n ev.preventDefault();\n ev.stop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ACpBV,KAAKI,KAAO,OAAS,KAAI,aAC3BJ,KAAKI,MAAQJ,KAAKC,UAAYC,EAAiBc,QAAU,OAAS,KAC9E2B,KAAM3C,KAAKI,MAAQJ,KAAKC,UAAYC,EAAiBc,QAAU,SAAW,MAE1EyB,EAAA,OAAAtB,IAAA,2CAAKyB,MAAM,oBACTH,EAAA,OAAAtB,IAAA,2CACEyB,MAAM,6BACNC,IAAMC,GAAQ9C,KAAKc,cAAgBgC,EACnCC,SAAUC,EAAoBhD,KAAK2B,MAAMsB,OAASC,WAAY,GAE9DT,EAAA,QAAAtB,IAAA,2CAAMgC,KAAK,qBAGbnD,KAAKC,SAAWC,EAAiBc,SAAWhB,KAAKK,sBAAwBC,EAAoBoB,KAC7F1B,KAAKS,cACHgC,EAAA,OAAAtB,IAAA,2CACEyB,MAAM,WACNQ,QAAUC,IACRA,EAAG/B,iBACH+B,EAAGC,kBACHtD,KAAKI,KAAO,KAAK,I","ignoreList":[]}
@@ -1,2 +1,2 @@
1
1
  var a;(function(a){a["REAL"]="reale";a["VIRTUAL"]="virtuale";a["TRIAL"]="saggio";a["TEMP"]="reale_temp"})(a||(a={}));var r;(function(a){a["BORDER"]="border";a["SHADOW"]="shadow";a["OVERLAY"]="overlay";a["TEXT"]="text"})(r||(r={}));var t;(function(a){a["HORIZONTAL"]="horizontal";a["VERTICAL"]="vertical"})(t||(t={}));var e;(function(a){a["HORIZONTAL"]="horizontal";a["VERTICAL"]="vertical"})(e||(e={}));var n;(function(a){a["BIG"]="big";a["SMALL"]="small"})(n||(n={}));var o;(function(a){a["LEFT"]="ArrowLeft";a["RIGHT"]="ArrowRight";a["UP"]="ArrowUp";a["DOWN"]="ArrowDown"})(o||(o={}));var i;(function(a){a["PRIMARY"]="primary";a["SECONDARY"]="secondary";a["TERTIARY"]="tertiary"})(i||(i={}));var s;(function(a){a["SUBMIT"]="submit";a["RESET"]="reset";a["BUTTON"]="button"})(s||(s={}));var c;(function(a){a["BIG"]="big";a["SMALL"]="small";a["X_SMALL"]="x-small"})(c||(c={}));var u;(function(a){a["BIG"]="big";a["SMALL"]="small";a["X_SMALL"]="x-small"})(u||(u={}));var l;(function(a){a["TEXT"]="text";a["PASSWORD"]="password";a["NUMBER"]="number";a["EMAIL"]="email";a["TEXTAREA"]="textarea";a["CHECKBOX"]="checkbox";a["RADIO"]="radio";a["TEL"]="tel";a["URL"]="url";a["SEARCH"]="search"})(l||(l={}));var f;(function(a){a["SUCCESS"]="success";a["ERROR"]="error";a["WARNING"]="warning"})(f||(f={}));var d;(function(a){a["AUTO"]="auto";a["TOP"]="top";a["RIGHT"]="right";a["BOTTOM"]="bottom";a["LEFT"]="left";a["TOP_RIGHT"]="top_right";a["TOP_LEFT"]="top_left";a["BOTTOM_RIGHT"]="bottom_right";a["BOTTOM_LEFT"]="bottom_left";a["RIGHT_TOP"]="right_top";a["RIGHT_BOTTOM"]="right_bottom";a["LEFT_TOP"]="left_top";a["LEFT_BOTTOM"]="left_bottom"})(d||(d={}));var F;(function(a){a[a["TAB"]=9]="TAB";a[a["SPACE"]=32]="SPACE";a[a["ESC"]=27]="ESC";a[a["ENTER"]=13]="ENTER";a[a["ARROW_UP"]=38]="ARROW_UP";a[a["ARROW_DOWN"]=40]="ARROW_DOWN";a[a["BACKSPACE"]=8]="BACKSPACE";a[a["DELETE"]=46]="DELETE"})(F||(F={}));var v;(function(a){a["TAB"]="Tab";a["SPACE"]="Space";a["ESC"]="Escape";a["ENTER"]="Enter";a["ARROW_UP"]="ArrowUp";a["ARROW_DOWN"]="ArrowDown";a["BACKSPACE"]="Backspace";a["DELETE"]="Delete";a["ARROW_RIGHT"]="ArrowRight";a["ARROW_LEFT"]="ArrowLeft"})(v||(v={}));var g;(function(a){a["DARK"]="dark";a["LIGHT"]="light"})(g||(g={}));var h;(function(a){a["SMALL"]="small";a["MEDIUM"]="medium";a["LARGE"]="large"})(h||(h={}));var p;(function(a){a["HORIZONTAL"]="horizontal";a["VERTICAL"]="vertical"})(p||(p={}));var m;(function(a){a["ASC"]="asc";a["DESC"]="desc"})(m||(m={}));var C;(function(a){a["SMALL"]="small";a["MEDIUM"]="medium";a["LARGE"]="large"})(C||(C={}));var b;(function(a){a["SMALL"]="small";a["MEDIUM"]="medium";a["LARGE"]="large";a["X_LARGE"]="x-large";a["NONE"]="none"})(b||(b={}));var D;(function(a){a["ACCORDION"]="accordion";a["MENU"]="menu"})(D||(D={}));var k;(function(a){a["RIGHT"]="right";a["LEFT"]="left"})(k||(k={}));var A;(function(a){a["RIGHT"]="right";a["LEFT"]="left"})(A||(A={}));var w;(function(a){a["NONE"]="none";a["HEADER"]="header";a["ELEMENT"]="element"})(w||(w={}));var E;(function(a){a["NONE"]="none";a["ORDERED"]="ordered";a["UNORDERED"]="unordered"})(E||(E={}));var L;(function(a){a["SUCCESS"]="success";a["WARNING"]="warning";a["ERROR"]="error"})(L||(L={}));var R;(function(a){a["SUCCESS"]="success";a["WARNING"]="warning";a["ERROR"]="error"})(R||(R={}));var _;(function(a){a["MOBILE"]="mobile";a["TABLET"]="tablet";a["DESKTOP"]="desktop";a["DESKTOP_WIDE"]="desktop-wide"})(_||(_={}));var V;(function(a){a["DARK"]="dark";a["LIGHT"]="light";a["ACCENT"]="accent";a["ERROR"]="error";a["SUCCESS"]="success";a["WARNING"]="warning"})(V||(V={}));var y;(function(a){a["SLIDE_IN_LEFT"]="slide-in-left";a["SLIDE_IN_RIGHT"]="slide-in-right";a["SLIDE_IN_DOWN"]="slide-in-down";a["SLIDE_IN_UP"]="slide-in-up";a["SLIDE_OUT_LEFT"]="slide-out-left";a["SLIDE_OUT_RIGHT"]="slide-out-right";a["SLIDE_OUT_DOWN"]="slide-out-down";a["SLIDE_OUT_UP"]="slide-out-up"})(y||(y={}));var z;(function(a){a["TOP_RIGHT"]="top-right";a["TOP_LEFT"]="top-left";a["TOP_CENTRE"]="top-centre";a["BOTTOM_RIGHT"]="bottom-right";a["BOTTOM_LEFT"]="bottom-left";a["BOTTOM_CENTRE"]="bottom-centre"})(z||(z={}));var x;(function(a){a["EXPANDABLE"]="expandable";a["PADDING"]="padding";a["NONE"]="none"})(x||(x={}));var q;(function(a){a["POLITE"]="polite";a["ASSERTIVE"]="assertive"})(q||(q={}));var B;(function(a){a["LEFT"]="left";a["RIGHT"]="right";a["UP"]="up"})(B||(B={}));var G;(function(a){a["OVERLAY"]="overlay";a["PUSHCONTENT"]="pushcontent"})(G||(G={}));var T;(function(a){a["DEFAULT"]="default";a["DRAGDROP"]="dragdrop"})(T||(T={}));var O;(function(a){a["DEFAULT"]="default";a["MEDIUM"]="medium";a["SMALL"]="small"})(O||(O={}));var P;(function(a){a["OUTLINE"]="outline";a["FILLED"]="filled";a["SOFT"]="soft"})(P||(P={}));var S;(function(a){a["BEFORE"]="before";a["AFTER"]="after"})(S||(S={}));var W;(function(a){a["DATE"]="date";a["DATE_TIME"]="date-time";a["MONTHS"]="months"})(W||(W={}));var N;(function(a){a[a["DATE"]=401]="DATE";a[a["DATE_TIME"]=523]="DATE_TIME";a[a["MONTHS"]=288]="MONTHS"})(N||(N={}));var U;(function(a){a["TOP"]="top";a["BOTTOM"]="bottom"})(U||(U={}));var M;(function(a){a["DATE"]="date";a["DATE_TIME"]="date-time"})(M||(M={}));var H;(function(a){a["TOP_RIGHT"]="top_right";a["TOP_LEFT"]="top_left";a["BOTTOM_RIGHT"]="bottom_right";a["BOTTOM_LEFT"]="bottom_left"})(H||(H={}));var I;(function(a){a["OVERLAY"]="overlay";a["STACKED"]="stacked"})(I||(I={}));var K;(function(a){a["TOP"]="top";a["BOTTOM"]="bottom"})(K||(K={}));var Y;(function(a){a["OVER"]="over";a["BOTTOM"]="bottom"})(Y||(Y={}));var j;(function(a){a["DOTS"]="dots";a["NUMBERS"]="numbers"})(j||(j={}));var J;(function(a){a["SEMIBOLD"]="semibold";a["UNDERLINED"]="underlined"})(J||(J={}));var Q;(function(a){a["TEXT"]="text";a["ICON"]="icon"})(Q||(Q={}));var X;(function(a){a["HOVER"]="hover";a["ALWAYS"]="always"})(X||(X={}));var Z;(function(a){a["LANDSCAPE"]="landscape";a["PORTRAIT"]="portrait"})(Z||(Z={}));var $;(function(a){a["EXPANDED"]="expanded";a["COMPACT"]="compact";a["SEARCH"]="search"})($||($={}));var aa;(function(a){a["DEFAULT"]="default";a["BACKGROUND"]="background"})(aa||(aa={}));var ra;(function(a){a["LEFT"]="left";a["RIGHT"]="right"})(ra||(ra={}));const ta={"#FFFFFF00":{it:"Trasparente",en:"Transparent"},"#FFFFFF":{it:"Bianco",en:"White"},"#CCCCCC":{it:"Grigio",en:"Gray"},"#7E7E7E":{it:"Grigio scuro 1",en:"Dark gray 1"},"#333333":{it:"Grigio scuro 2",en:"Dark gray 2"},"#FFCCCC":{it:"Rosso chiaro 1",en:"Light red 1"},"#FF9999":{it:"Rosso chiaro 2",en:"Light red 2"},"#FF3333":{it:"Rosso",en:"Red"},"#CC0000":{it:"Rosso scuro 1",en:"Dark red 1"},"#660000":{it:"Rosso scuro 2",en:"Dark red 2"},"#FFE1CC":{it:"Arancione chiaro 1",en:"Light orange 1"},"#FFC399":{it:"Arancione chiaro 2",en:"Light orange 2"},"#FF8933":{it:"Arancione",en:"Orange"},"#CC5500":{it:"Arancione scuro 1",en:"Dark orange 1"},"#662B00":{it:"Arancione scuro 2",en:"Dark orange 2"},"#FFF7CC":{it:"Giallo chiaro 1",en:"Light yellow 1"},"#FFEE99":{it:"Giallo chiaro 2",en:"Light yellow 2"},"#FFDD33":{it:"Giallo",en:"Yellow"},"#CCAA00":{it:"Giallo scuro 1",en:"Dark yellow 1"},"#665600":{it:"Giallo scuro 2",en:"Dark yellow 2"},"#DDFFCC":{it:"Verde chiaro 1",en:"Light green 1"},"#BBFF99":{it:"Verde chiaro 2",en:"Light green 2"},"#77FF33":{it:"Verde",en:"Green"},"#44CC00":{it:"Verde scuro 1",en:"Dark green 1"},"#226600":{it:"Verde scuro 2",en:"Dark green 2"},"#CCFFE5":{it:"Verde acqua chiaro 1",en:"Light aquamarine 1"},"#99FFCC":{it:"Verde acqua chiaro 2",en:"Light aquamarine 2"},"#33FF99":{it:"Verde acqua",en:"Aquamarine"},"#00CC66":{it:"Verde acqua scuro 1",en:"Dark aquamarine 1"},"#006633":{it:"Verde acqua scuro 2",en:"Dark aquamarine 2"},"#CCEEFF":{it:"Azzurro chiaro 1",en:"Light blue 1"},"#99DDFF":{it:"Azzurro chiaro 2",en:"Light blue 2"},"#33BBFF":{it:"Azzurro",en:"Blue"},"#0088CC":{it:"Azzurro scuro 1",en:"Dark blue 1"},"#004466":{it:"Azzurro scuro 2",en:"Dark blue 2"},"#D4CCFF":{it:"Viola chiaro 1",en:"Light purple 1"},"#AA99FF":{it:"Viola chiaro 2",en:"Light purple 2"},"#5533FF":{it:"Viola",en:"Purple"},"#2200CC":{it:"Viola scuro 1",en:"Dark purple 1"},"#110066":{it:"Viola scuro 2",en:"Dark purple 2"},"#FFCCFF":{it:"Rosa chiaro 1",en:"Light pink 1"},"#FF99FF":{it:"Rosa chiaro 2",en:"Light pink 2"},"#FF33FF":{it:"Rosa",en:"Pink"},"#CC00CC":{it:"Rosa scuro 1",en:"Dark pink 1"},"#660066":{it:"Rosa scuro 2",en:"Dark pink 2"}};export{$,C as A,i as B,r as C,h as D,D as E,W as F,N as G,U as H,l as I,M as J,F as K,a as L,H as M,e as N,t as O,d as P,I as Q,K as R,m as S,g as T,Y as U,j as V,J as W,Q as X,X as Y,x as Z,Z as _,n as a,aa as a0,ra as a1,ta as a2,o as b,s as c,c as d,u as e,f,v as g,p as h,b as i,k as j,A as k,w as l,E as m,L as n,R as o,_ as p,V as q,y as r,z as s,q as t,B as u,G as v,T as w,O as x,P as y,S as z};
2
- //# sourceMappingURL=index2.js.map
2
+ //# sourceMappingURL=p-DdetsoIY.js.map
@@ -0,0 +1,2 @@
1
+ import{p as i,H as t,c as e,h as s,F as r,t as n}from"./p-RmbDDbWd.js";import{I as c,k as a,e as p,f as o}from"./p-DdetsoIY.js";import{r as u,d as l}from"./p-8C_CrFxp.js";import{d as h}from"./p-CbXEdwLi.js";import{d}from"./p-CdBqnUF6.js";const z=()=>`.sc-z-input-h{display:inline-block;width:inherit}.sc-z-input-h *.sc-z-input{box-sizing:border-box}input.sc-z-input::-ms-clear,input.sc-z-input::-ms-reveal{display:none}input[type="search"].sc-z-input::-webkit-search-decoration,input[type="search"].sc-z-input::-webkit-search-cancel-button,input[type="search"].sc-z-input::-webkit-search-results-button,input[type="search"].sc-z-input::-webkit-search-results-decoration{display:none}input.sc-z-input,textarea.sc-z-input{background:var(--color-form-background);fill:var(--color-form-default-icon);font-family:var(--font-family-sans);font-size:var(--font-size-3);font-weight:var(--font-rg);outline:none}input.sc-z-input,.textarea-wrapper.sc-z-input{border:var(--border-size-small) solid var(--color-form-surface04);border-radius:var(--border-radius-small);color:var(--color-form-default-text)}[size="small"].sc-z-input-h input.sc-z-input,[size="small"].sc-z-input-h textarea.sc-z-input,[size="x-small"].sc-z-input-h input.sc-z-input,[size="x-small"].sc-z-input-h textarea.sc-z-input{font-size:var(--font-size-2)}.cursor-select.sc-z-input-h input.sc-z-input{cursor:pointer}input.sc-z-input:not([readonly]):hover,.textarea-wrapper.sc-z-input:not(.readonly):hover{outline:var(--border-size-medium) solid var(--color-surface04);outline-offset:-2px}.sc-z-input-h:not(.active-select) input.sc-z-input:focus:focus-visible,.sc-z-input-h:not([readonly="true"]) .textarea-wrapper.sc-z-input:focus-within{border-color:var(--color-form-active-primary);box-shadow:var(--shadow-focus-primary);color:var(--color-form-active-primary)}.sc-z-input-h input.sc-z-input:focus:focus-visible:hover,.textarea-wrapper.sc-z-input:not(.readonly):focus-within:hover{outline-color:var(--color-form-active-primary)}.sc-z-input-h input.sc-z-input:focus:focus-visible+.icons-wrapper.sc-z-input{fill:var(--color-form-active-primary)}.active-select.sc-z-input-h input.sc-z-input{border:var(--border-size-small) solid var(--color-form-active-primary)}.cursor-select.sc-z-input-h input.sc-z-input:focus:focus-visible{box-shadow:var(--shadow-focus-primary)}.sc-z-input-h input[readonly].sc-z-input:focus:focus-visible{border-color:var(--color-form-surface03);box-shadow:none}.input-success.sc-z-input{border-color:var(--color-form-success01);background:var(--color-form-inverse-success)}.input-success.sc-z-input:focus:focus-visible+.icons-wrapper.sc-z-input,.input-success.sc-z-input+.icons-wrapper.sc-z-input{fill:var(--color-form-success01)}.input-error.sc-z-input{border-color:var(--color-form-hover-error);background:var(--color-form-inverse-error)}.input-error.sc-z-input:focus:focus-visible+.icons-wrapper.sc-z-input,.input-error.sc-z-input+.icons-wrapper.sc-z-input{fill:var(--color-form-hover-error)}.input-warning.sc-z-input{border-color:var(--color-form-hover-warning);background:var(--color-form-inverse-warning)}.input-warning.sc-z-input:focus:focus-visible+.icons-wrapper.sc-z-input,.input-warning.sc-z-input+.icons-wrapper.sc-z-input{fill:var(--color-form-hover-warning)}.sc-z-input:is(.input-success,.input-error.sc-z-input,.input-warning).sc-z-input:focus:focus-visible{color:var(--color-form-default-text)}.sc-z-input-h:not(.active-select) input[readonly].sc-z-input,.textarea-wrapper.readonly.sc-z-input{border-color:var(--color-form-surface03);fill:var(--color-form-disabled01-icon);pointer-events:none}[disabled].sc-z-input-h:not([disabled="false"]) input.sc-z-input,[disabled].sc-z-input-h:not([disabled="false"]) .textarea-wrapper.sc-z-input,[disabled].sc-z-input-h:not([disabled="false"]) z-icon.sc-z-input{border-color:var(--color-form-disabled03);box-shadow:none;color:var(--color-form-disabled-text);fill:var(--color-form-disabled01-icon);pointer-events:none}[disabled].sc-z-input-h:not([disabled="false"]) input.sc-z-input:hover{border-width:var(--border-size-small)}input.sc-z-input::placeholder,textarea.sc-z-input::placeholder{color:var(--color-form-placeholder-text)}.sc-z-input::-webkit-textarea-placeholder{color:var(--color-form-placeholder-text)}.sc-z-input:-ms-textarea-placeholder{color:var(--color-form-placeholder-text)}.sc-z-input::placeholder{color:var(--color-form-placeholder-text)}[disabled].sc-z-input-h:not([disabled="false"]) label.z-label.sc-z-input{color:var(--color-disabled03)}`;const b=()=>`.text-wrapper.sc-z-input>div.sc-z-input{position:relative;z-index:1;fill:var(--color-form-default-icon)}.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input{width:100%;height:calc(var(--space-unit) * 5.5);box-sizing:border-box;padding:0 calc(var(--space-unit) * 1.5);margin:0}[size="small"].sc-z-input-h .text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input{height:calc(var(--space-unit) * 4.5)}[size="x-small"].sc-z-input-h .text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input{height:calc(var(--space-unit) * 4)}.text-wrapper.sc-z-input>div.sc-z-input>input.has-icon.sc-z-input,.text-wrapper.sc-z-input>div.sc-z-input>input.has-clear-icon.sc-z-input{padding-right:calc(var(--space-unit) * 5.25)}.text-wrapper.sc-z-input>div.sc-z-input>input.has-icon.has-clear-icon.sc-z-input{padding-right:calc(var(--space-unit) * 8)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input{position:absolute;z-index:2;top:50%;right:calc(var(--space-unit) * 1.5);display:flex;pointer-events:none;transform:translateY(-50%)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.input-icon.sc-z-input{display:flex;padding:0;border:0;background:none;color:inherit;font:inherit;pointer-events:initial}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>.input-icon.sc-z-input+.input-icon.sc-z-input{margin-left:calc(var(--space-unit) * 0.5)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.input-icon.hidden.sc-z-input{display:none}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.reset-icon.sc-z-input,.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.toggle-password-icon.sc-z-input{display:flex;min-width:24px;min-height:24px;align-items:center;justify-content:center;cursor:pointer}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>.input-icon.sc-z-input{--z-icon-width:18px;--z-icon-height:18px;display:block}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>.input-icon.small.sc-z-input,.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>.input-icon.x-small.sc-z-input{--z-icon-width:16px;--z-icon-height:16px}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.input-icon.sc-z-input:focus{box-shadow:var(--shadow-focus-primary);outline:none !important}.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px #fff inset;-webkit-text-fill-color:currentcolor}`;const f=()=>`.textarea-wrapper.sc-z-input{width:100%;height:100%;padding:calc(var(--space-unit) * 1.5)}.textarea-wrapper.sc-z-input:not(.input-error,.input-success.sc-z-input,.input-warning).sc-z-input{background-color:var(--color-form-background)}textarea.sc-z-input{width:100%;min-height:132px;padding:0;border:none;margin:0;color:currentcolor;resize:none}`;const m=()=>`.radio-wrapper.sc-z-input,.checkbox-wrapper.sc-z-input{position:relative;display:inline-flex;flex-direction:row;align-items:center;color:var(--color-default-text);fill:var(--color-primary01-icon);font-family:var(--font-family-sans)}.radio-wrapper.sc-z-input:hover,.checkbox-wrapper.sc-z-input:hover{color:var(--color-hover-primary);fill:var(--color-hover-primary-icon)}.radio-wrapper.sc-z-input>input.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input{position:absolute;z-index:-1;opacity:0;pointer-events:none}.radio-wrapper.sc-z-input .radio-label.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input{display:inline-flex;min-height:24px;align-items:center;padding:3px 0;margin:0;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:1;text-transform:inherit}.radio-wrapper.sc-z-input input.sc-z-input:not(:disabled)+.radio-label.sc-z-input,.checkbox-wrapper.sc-z-input input.sc-z-input:not(:disabled)+.checkbox-label.sc-z-input{cursor:pointer}.radio-wrapper.sc-z-input .radio-label.sc-z-input z-icon.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input z-icon.sc-z-input{cursor:pointer;fill:inherit}[size="small"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.sc-z-input z-icon.sc-z-input,[size="small"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input z-icon.sc-z-input{--z-icon-width:16px;--z-icon-height:16px}[size="small"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.sc-z-input,[size="small"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input{font-size:var(--font-size-2)}[size="x-small"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.sc-z-input z-icon.sc-z-input,[size="x-small"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input z-icon.sc-z-input{--z-icon-width:14px;--z-icon-height:14px}[size="x-small"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.sc-z-input,[size="x-small"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input{font-size:var(--font-size-1)}.radio-wrapper.sc-z-input .radio-label.after.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input{flex-direction:row}.radio-wrapper.sc-z-input .radio-label.before.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input{flex-direction:row-reverse}.radio-wrapper.sc-z-input .radio-label.after.sc-z-input>span.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input>span.sc-z-input{margin-left:var(--space-unit)}.radio-wrapper.sc-z-input .radio-label.before.sc-z-input>span.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input>span.sc-z-input{margin-right:var(--space-unit)}[size="small"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.after.sc-z-input>span.sc-z-input,[size="small"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input>span.sc-z-input,[size="x-small"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.after.sc-z-input>span.sc-z-input,[size="x-small"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input>span.sc-z-input{margin-left:calc(var(--space-unit) * 0.5)}[size="small"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.before.sc-z-input>span.sc-z-input,[size="small"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input>span.sc-z-input,[size="x-small"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.before.sc-z-input>span.sc-z-input,[size="x-small"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input>span.sc-z-input{margin-right:calc(var(--space-unit) * 0.5)}.radio-wrapper.sc-z-input>input.sc-z-input:focus:focus-visible+.radio-label.sc-z-input>z-icon.sc-z-input{border-radius:50%}.checkbox-wrapper.sc-z-input>input.sc-z-input:focus:focus-visible+.checkbox-label.sc-z-input>z-icon.sc-z-input{border-radius:var(--border-radius-small)}.radio-wrapper.sc-z-input>input.sc-z-input:focus:focus-visible+.radio-label.sc-z-input>z-icon.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:focus:focus-visible+.checkbox-label.sc-z-input>z-icon.sc-z-input{box-shadow:var(--shadow-focus-primary)}.radio-wrapper.sc-z-input>input.sc-z-input:disabled+.radio-label.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:disabled+.checkbox-label.sc-z-input{color:var(--color-disabled03)}.radio-wrapper.sc-z-input>input.sc-z-input:disabled+.radio-label.sc-z-input>z-icon.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:disabled+.checkbox-label.sc-z-input>z-icon.sc-z-input{cursor:default;fill:var(--color-disabled03-icon)}`;const x=i(class i extends t{constructor(i){super();if(i!==false){this.__registerHost()}this.inputChange=e(this,"inputChange",7);this.startTyping=e(this,"startTyping",7);this.stopTyping=e(this,"stopTyping",7);this.inputCheck=e(this,"inputCheck",7);this.inputFocus=e(this,"inputFocus",7);this.inputBlur=e(this,"inputBlur",7);this.htmlid=`id-${u()}`;this.type=c.TEXT;this.disabled=false;this.readonly=false;this.required=false;this.checked=false;this.indeterminate=false;this.message=true;this.labelPosition=a.RIGHT;this.hasclearicon=true;this.size=p.BIG;this.isTyping=false;this.passwordHidden=true;this.typingtimeout=300}inputCheckListener(i){const t=i.detail;switch(this.type){case c.RADIO:if(t.type===c.RADIO&&t.name===this.name&&t.id!==this.htmlid){this.checked=false}break}}watchIndeterminate(){this.syncCheckboxIndeterminate()}syncCheckboxIndeterminate(){if(this.type!==c.CHECKBOX||!this.inputRef){return}this.inputRef.indeterminate=!!this.indeterminate}async isChecked(){switch(this.type){case c.CHECKBOX:case c.RADIO:return this.checked;default:console.warn("`isChecked` method is only available for type `checkbox` and `radio`");return false}}emitInputChange(i){if(!this.isTyping){this.emitStartTyping()}let t;if(this.type===c.TEXTAREA){t=this.getValidity("textarea")}else{t=this.getValidity("input")}this.value=i;this.inputChange.emit({value:i,validity:t});clearTimeout(this.timer);this.timer=setTimeout((()=>{this.emitStopTyping(this.value,t)}),this.typingtimeout)}emitStartTyping(){this.isTyping=true;this.startTyping.emit()}emitStopTyping(i,t){this.isTyping=false;this.stopTyping.emit({value:i,validity:t})}emitInputCheck(i){this.inputCheck.emit({id:this.htmlid,checked:i,type:this.type,name:this.name,value:this.value,validity:this.getValidity("input")})}emitInputFocus(){this.inputFocus.emit({id:this.htmlid})}emitInputBlur(){this.inputBlur.emit({id:this.htmlid})}getValidity(i){const t=this.hostElement.querySelector(i);return t.validity}getTextAttributes(){return{id:this.htmlid,name:this.name,placeholder:this.placeholder,value:this.value,disabled:this.disabled,readonly:this.readonly,required:this.required,title:this.htmltitle,minlength:this.minlength,maxlength:this.maxlength,class:{[`input-${this.status}`]:!!this.status},autocomplete:this.autocomplete,onInput:i=>this.emitInputChange(i.target.value)}}getNumberAttributes(i){if(i!=c.NUMBER){return}return{min:this.min,max:this.max,step:this.step}}getPatternAttribute(i){if(i!=c.PASSWORD&&i!=c.TEXT&&i!=c.TEL&&i!=c.SEARCH&&i!=c.URL&&i!=c.EMAIL){return}return{pattern:this.pattern}}inputHasMessage(){if(typeof l(this.message)==="boolean"){return false}return true}getAriaAttributes(){return{role:this.htmlRole||undefined,"aria-describedby":this.htmlAriaDescribedby||undefined,"aria-labelledby":this.htmlAriaLabelledby||undefined}}getTextAriaAttributes(){return Object.assign(Object.assign({},this.getAriaAttributes()),{"aria-expanded":this.htmlAriaExpanded||undefined,"aria-controls":this.htmlAriaControls||undefined,"aria-autocomplete":this.htmlAriaAutocomplete||undefined,"aria-activedescendant":this.htmlAriaActivedescendant||undefined,"aria-describedby":this.htmlAriaDescribedby||this.inputHasMessage()?this.htmlAriaDescribedby||`${this.htmlid}-message`:undefined,"aria-invalid":this.status===o.ERROR?"true":undefined,"aria-required":this.required?"true":undefined})}getFocusBlurAttributes(){return{onFocus:()=>this.emitInputFocus(),onBlur:()=>this.emitInputBlur()}}renderInputText(i=c.TEXT){const t=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.getTextAttributes()),this.getNumberAttributes(i)),this.getPatternAttribute(i)),this.getTextAriaAttributes()),this.getFocusBlurAttributes()),{"aria-label":this.htmlAriaLabel||undefined});t.class=Object.assign(Object.assign({},t.class),{"has-icon":!!this.icon||i===c.PASSWORD,"has-clear-icon":this.hasclearicon&&i!=c.NUMBER});return s("div",{class:"text-wrapper"},this.renderLabel(),s("div",null,s("input",Object.assign({},t,{type:i===c.PASSWORD&&!this.passwordHidden?c.TEXT:i,ref:i=>this.inputRef=i})),this.renderIcons()),this.renderMessage())}renderLabel(){if(!this.label){return}return s("label",{class:"z-label body-5-sb",id:`${this.htmlid}_label`,htmlFor:this.htmlid},this.label)}renderIcons(){return s("span",{class:"icons-wrapper"},this.renderResetIcon(),this.renderIcon())}renderIcon(){if(this.type===c.PASSWORD){return this.renderShowHidePassword()}if(!this.icon){return}return s("z-icon",{name:this.icon,class:{[this.size]:true,"input-icon":true}})}renderResetIcon(){let i=false;if(!this.hasclearicon||!this.value||this.disabled||this.readonly||this.type==c.NUMBER){i=true}return s("button",{type:"button",class:{"reset-icon":true,"input-icon":true,hidden:i},"aria-label":"cancella il contenuto dell'input",onClick:()=>{this.inputRef.value="";this.emitInputChange("");this.inputRef.focus()}},s("z-icon",{name:"multiply",class:this.size}))}renderShowHidePassword(){return s("button",{type:"button",class:"input-icon toggle-password-icon",disabled:this.disabled,"aria-label":"mostra password","aria-pressed":!this.passwordHidden?"true":"false",onClick:()=>this.passwordHidden=!this.passwordHidden},s("z-icon",{name:this.passwordHidden?"view-filled":"view-off-filled",class:this.size}))}renderMessage(){if(l(this.message)===false){return}return s("z-input-message",{"html-id":`${this.htmlid}-message`,message:l(this.message)===true?undefined:this.message,status:this.status,class:this.size,disabled:this.disabled})}renderTextarea(){const i=this.getTextAttributes();const t=this.getTextAriaAttributes();return s(r,null,this.renderLabel(),s("div",{class:Object.assign(Object.assign({},i.class),{"textarea-wrapper":true,readonly:!!i.readonly})},s("textarea",Object.assign({},i,t,{class:Object.assign(Object.assign({},i.class),{"z-scrollbar":true}),"aria-label":this.htmlAriaLabel||undefined}))),this.renderMessage())}handleCheck(i){if(this.type===c.CHECKBOX&&this.indeterminate){this.indeterminate=false}this.checked=i.target.checked;this.emitInputCheck(this.checked)}getCheckboxAriaChecked(){if(this.indeterminate){return"mixed"}return this.checked?"true":"false"}renderCheckbox(){const i=this.required?{"aria-required":"true"}:{};return s("div",{class:"checkbox-wrapper"},s("input",Object.assign({id:this.htmlid,type:"checkbox",name:this.name,checked:this.indeterminate?false:this.checked,disabled:this.disabled,readonly:this.readonly,required:this.required,onChange:this.handleCheck.bind(this),value:this.value,"aria-checked":this.getCheckboxAriaChecked()},i,this.getAriaAttributes(),this.getFocusBlurAttributes(),{ref:i=>{this.inputRef=i;this.syncCheckboxIndeterminate()}})),s("label",{htmlFor:this.htmlid,class:{"checkbox-label":true,after:this.labelPosition===a.RIGHT,before:this.labelPosition===a.LEFT}},s("z-icon",{name:this.indeterminate?"indeterminated-checkbox":this.checked?"checkbox-checked":"checkbox",class:this.size}),this.label&&s("span",{innerHTML:this.label})))}renderRadio(){const i=this.required?{"aria-required":"true"}:{};return s("div",{class:"radio-wrapper"},s("input",Object.assign({id:this.htmlid,type:"radio",name:this.name,checked:this.checked,disabled:this.disabled,readonly:this.readonly,required:this.required,onChange:this.handleCheck.bind(this),value:this.value},this.getAriaAttributes(),this.getFocusBlurAttributes(),i)),s("label",{htmlFor:this.htmlid,class:{"radio-label":true,after:this.labelPosition===a.RIGHT,before:this.labelPosition===a.LEFT}},s("z-icon",{name:this.checked?"radio-button-checked":"radio-button",class:this.size}),this.label&&s("span",{innerHTML:this.label})))}render(){switch(this.type){case c.TEXTAREA:return this.renderTextarea();case c.CHECKBOX:return this.renderCheckbox();case c.RADIO:return this.renderRadio();case c.TEXT:default:return this.renderInputText(this.type)}}get hostElement(){return this}static get watchers(){return{indeterminate:[{watchIndeterminate:0}]}}static get style(){return z()+(b()+(f()+m()))}},[2,"z-input",{htmlid:[1],type:[1],name:[1],label:[1],htmlAriaLabel:[1,"html-aria-label"],htmlAriaExpanded:[1,"html-aria-expanded"],htmlAriaControls:[1,"html-aria-controls"],htmlAriaAutocomplete:[1,"html-aria-autocomplete"],htmlAriaActivedescendant:[1,"html-aria-activedescendant"],htmlAriaDescribedby:[1,"html-aria-describedby"],htmlAriaLabelledby:[1,"html-aria-labelledby"],value:[1025],disabled:[516],readonly:[4],required:[4],checked:[1028],indeterminate:[1028],placeholder:[1],htmltitle:[1],status:[1],message:[8],labelPosition:[1,"label-position"],autocomplete:[1],htmlRole:[1,"html-role"],hasclearicon:[4],icon:[1],min:[2],minlength:[2],max:[2],maxlength:[2],step:[2],pattern:[1],size:[513],isTyping:[32],passwordHidden:[32],isChecked:[64]},[[4,"inputCheck","inputCheckListener"]],{indeterminate:[{watchIndeterminate:0}]}]);function w(){if(typeof customElements==="undefined"){return}const i=["z-input","z-icon","z-input-message"];i.forEach((i=>{switch(i){case"z-input":if(!customElements.get(n(i))){customElements.define(n(i),x)}break;case"z-icon":if(!customElements.get(n(i))){h()}break;case"z-input-message":if(!customElements.get(n(i))){d()}break}}))}export{x as Z,w as d};
2
+ //# sourceMappingURL=p-LXvmZzZa.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["stylesGeneralCss","stylesTextCss","stylesTextareaCss","stylesCheckboxRadioCss","ZInput","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","htmlid","randomId","type","InputType","TEXT","disabled","readonly","required","checked","indeterminate","message","labelPosition","LabelPosition","RIGHT","hasclearicon","size","ControlSize","BIG","isTyping","passwordHidden","typingtimeout","inputCheckListener","e","data","detail","RADIO","name","id","watchIndeterminate","syncCheckboxIndeterminate","CHECKBOX","inputRef","isChecked","console","warn","emitInputChange","value","emitStartTyping","validity","TEXTAREA","getValidity","inputChange","emit","clearTimeout","timer","setTimeout","emitStopTyping","startTyping","stopTyping","emitInputCheck","inputCheck","emitInputFocus","inputFocus","emitInputBlur","inputBlur","input","hostElement","querySelector","getTextAttributes","placeholder","title","htmltitle","minlength","maxlength","class","status","autocomplete","onInput","target","getNumberAttributes","NUMBER","min","max","step","getPatternAttribute","PASSWORD","TEL","SEARCH","URL","EMAIL","pattern","inputHasMessage","boolean","getAriaAttributes","role","htmlRole","undefined","htmlAriaDescribedby","htmlAriaLabelledby","getTextAriaAttributes","Object","assign","htmlAriaExpanded","htmlAriaControls","htmlAriaAutocomplete","htmlAriaActivedescendant","InputStatus","ERROR","getFocusBlurAttributes","onFocus","onBlur","renderInputText","attr","htmlAriaLabel","icon","h","renderLabel","ref","el","renderIcons","renderMessage","label","htmlFor","renderResetIcon","renderIcon","renderShowHidePassword","hidden","onClick","focus","renderTextarea","attributes","ariaAttributes","Fragment","handleCheck","ev","getCheckboxAriaChecked","renderCheckbox","ariaRequired","onChange","bind","after","before","LEFT","innerHTML","renderRadio","render"],"sources":["src/components/z-input/styles-general.css?tag=z-input&encapsulation=scoped","src/components/z-input/styles-text.css?tag=z-input&encapsulation=scoped","src/components/z-input/styles-textarea.css?tag=z-input&encapsulation=scoped","src/components/z-input/styles-checkbox-radio.css?tag=z-input&encapsulation=scoped","src/components/z-input/index.tsx"],"sourcesContent":[":host {\n display: inline-block;\n width: inherit;\n}\n\n:host * {\n box-sizing: border-box;\n}\n\n/* GENERAL */\ninput::-ms-clear,\ninput::-ms-reveal {\n display: none;\n}\n\ninput[type=\"search\"]::-webkit-search-decoration,\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-results-button,\ninput[type=\"search\"]::-webkit-search-results-decoration {\n display: none;\n}\n\ninput,\ntextarea {\n background: var(--color-form-background);\n fill: var(--color-form-default-icon);\n font-family: var(--font-family-sans);\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n outline: none;\n}\n\ninput,\n.textarea-wrapper {\n border: var(--border-size-small) solid var(--color-form-surface04);\n border-radius: var(--border-radius-small);\n color: var(--color-form-default-text);\n}\n\n:host([size=\"small\"]) input,\n:host([size=\"small\"]) textarea,\n:host([size=\"x-small\"]) input,\n:host([size=\"x-small\"]) textarea {\n font-size: var(--font-size-2);\n}\n\n:host.cursor-select input {\n cursor: pointer;\n}\n\n/* HOVER */\ninput:not([readonly]):hover,\n.textarea-wrapper:not(.readonly):hover {\n outline: var(--border-size-medium) solid var(--color-surface04);\n outline-offset: -2px;\n}\n\n/* FOCUS */\n:host:not(.active-select) input:focus:focus-visible,\n:host:not([readonly=\"true\"]) .textarea-wrapper:focus-within {\n border-color: var(--color-form-active-primary);\n box-shadow: var(--shadow-focus-primary);\n color: var(--color-form-active-primary);\n}\n\n:host input:focus:focus-visible:hover,\n.textarea-wrapper:not(.readonly):focus-within:hover {\n outline-color: var(--color-form-active-primary);\n}\n\n:host input:focus:focus-visible + .icons-wrapper {\n fill: var(--color-form-active-primary);\n}\n\n:host.active-select input {\n border: var(--border-size-small) solid var(--color-form-active-primary);\n}\n\n:host.cursor-select input:focus:focus-visible {\n box-shadow: var(--shadow-focus-primary);\n}\n\n:host input[readonly]:focus:focus-visible {\n border-color: var(--color-form-surface03);\n box-shadow: none;\n}\n\n/* STATUSES (success, warning, error) */\n.input-success {\n border-color: var(--color-form-success01);\n background: var(--color-form-inverse-success);\n}\n\n.input-success:focus:focus-visible + .icons-wrapper,\n.input-success + .icons-wrapper {\n fill: var(--color-form-success01);\n}\n\n.input-error {\n border-color: var(--color-form-hover-error);\n background: var(--color-form-inverse-error);\n}\n\n.input-error:focus:focus-visible + .icons-wrapper,\n.input-error + .icons-wrapper {\n fill: var(--color-form-hover-error);\n}\n\n.input-warning {\n border-color: var(--color-form-hover-warning);\n background: var(--color-form-inverse-warning);\n}\n\n.input-warning:focus:focus-visible + .icons-wrapper,\n.input-warning + .icons-wrapper {\n fill: var(--color-form-hover-warning);\n}\n\n:is(.input-success, .input-error, .input-warning):focus:focus-visible {\n color: var(--color-form-default-text);\n}\n\n/* READONLY */\n:host:not(.active-select) input[readonly],\n.textarea-wrapper.readonly {\n border-color: var(--color-form-surface03);\n fill: var(--color-form-disabled01-icon);\n pointer-events: none;\n}\n\n/* DISABLED */\n:host([disabled]:not([disabled=\"false\"])) input,\n:host([disabled]:not([disabled=\"false\"])) .textarea-wrapper,\n:host([disabled]:not([disabled=\"false\"])) z-icon {\n border-color: var(--color-form-disabled03);\n box-shadow: none;\n color: var(--color-form-disabled-text);\n fill: var(--color-form-disabled01-icon);\n pointer-events: none;\n}\n\n:host([disabled]:not([disabled=\"false\"])) input:hover {\n border-width: var(--border-size-small);\n}\n\n/* PLACEHOLDER */\ninput::placeholder,\ntextarea::placeholder {\n color: var(--color-form-placeholder-text);\n}\n\n::-webkit-textarea-placeholder {\n color: var(--color-form-placeholder-text);\n}\n\n:-ms-textarea-placeholder {\n color: var(--color-form-placeholder-text);\n}\n\n::placeholder {\n color: var(--color-form-placeholder-text);\n}\n\n:host([disabled]:not([disabled=\"false\"])) label.z-label {\n color: var(--color-disabled03);\n}\n",".text-wrapper > div {\n position: relative;\n z-index: 1;\n fill: var(--color-form-default-icon);\n}\n\n.text-wrapper > div > input {\n width: 100%;\n height: calc(var(--space-unit) * 5.5);\n box-sizing: border-box;\n padding: 0 calc(var(--space-unit) * 1.5);\n margin: 0;\n}\n\n:host([size=\"small\"]) .text-wrapper > div > input {\n height: calc(var(--space-unit) * 4.5);\n}\n\n:host([size=\"x-small\"]) .text-wrapper > div > input {\n height: calc(var(--space-unit) * 4);\n}\n\n.text-wrapper > div > input.has-icon,\n.text-wrapper > div > input.has-clear-icon {\n padding-right: calc(var(--space-unit) * 5.25);\n}\n\n.text-wrapper > div > input.has-icon.has-clear-icon {\n padding-right: calc(var(--space-unit) * 8);\n}\n\n.text-wrapper .icons-wrapper {\n position: absolute;\n z-index: 2;\n top: 50%;\n right: calc(var(--space-unit) * 1.5);\n display: flex;\n pointer-events: none;\n transform: translateY(-50%);\n}\n\n.text-wrapper .icons-wrapper > button.input-icon {\n display: flex;\n padding: 0;\n border: 0;\n background: none;\n color: inherit;\n font: inherit;\n pointer-events: initial;\n}\n\n.text-wrapper .icons-wrapper > .input-icon + .input-icon {\n margin-left: calc(var(--space-unit) * 0.5);\n}\n\n.text-wrapper .icons-wrapper > button.input-icon.hidden {\n display: none;\n}\n\n.text-wrapper .icons-wrapper > button.reset-icon,\n.text-wrapper .icons-wrapper > button.toggle-password-icon {\n display: flex;\n min-width: 24px;\n min-height: 24px;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n\n.text-wrapper .icons-wrapper > .input-icon {\n --z-icon-width: 18px;\n --z-icon-height: 18px;\n\n display: block;\n}\n\n.text-wrapper .icons-wrapper > .input-icon.small,\n.text-wrapper .icons-wrapper > .input-icon.x-small {\n --z-icon-width: 16px;\n --z-icon-height: 16px;\n}\n\n.text-wrapper .icons-wrapper > button.input-icon:focus {\n box-shadow: var(--shadow-focus-primary);\n outline: none !important;\n}\n\n/* stylelint-disable property-no-vendor-prefix */\n.text-wrapper > div > input:-webkit-autofill {\n -webkit-box-shadow: 0 0 0 1000px #fff inset;\n -webkit-text-fill-color: currentcolor;\n}\n",".textarea-wrapper {\n width: 100%;\n height: 100%;\n padding: calc(var(--space-unit) * 1.5);\n}\n\n.textarea-wrapper:not(.input-error, .input-success, .input-warning) {\n background-color: var(--color-form-background);\n}\n\ntextarea {\n width: 100%;\n min-height: 132px;\n padding: 0;\n border: none;\n margin: 0;\n color: currentcolor;\n resize: none;\n}\n",".radio-wrapper,\n.checkbox-wrapper {\n position: relative;\n display: inline-flex;\n flex-direction: row;\n align-items: center;\n color: var(--color-default-text);\n fill: var(--color-primary01-icon);\n font-family: var(--font-family-sans);\n}\n\n.radio-wrapper:hover,\n.checkbox-wrapper:hover {\n color: var(--color-hover-primary);\n fill: var(--color-hover-primary-icon);\n}\n\n.radio-wrapper > input,\n.checkbox-wrapper > input {\n position: absolute;\n z-index: -1;\n opacity: 0;\n pointer-events: none;\n}\n\n.radio-wrapper .radio-label,\n.checkbox-wrapper .checkbox-label {\n display: inline-flex;\n min-height: 24px;\n align-items: center;\n padding: 3px 0;\n margin: 0;\n color: inherit;\n font-family: inherit;\n font-size: inherit;\n font-weight: inherit;\n line-height: 1;\n text-transform: inherit;\n}\n\n.radio-wrapper input:not(:disabled) + .radio-label,\n.checkbox-wrapper input:not(:disabled) + .checkbox-label {\n cursor: pointer;\n}\n\n.radio-wrapper .radio-label z-icon,\n.checkbox-wrapper .checkbox-label z-icon {\n cursor: pointer;\n fill: inherit;\n}\n\n:host([size=\"small\"]) .radio-wrapper .radio-label z-icon,\n:host([size=\"small\"]) .checkbox-wrapper .checkbox-label z-icon {\n --z-icon-width: 16px;\n --z-icon-height: 16px;\n}\n\n:host([size=\"small\"]) .radio-wrapper .radio-label,\n:host([size=\"small\"]) .checkbox-wrapper .checkbox-label {\n font-size: var(--font-size-2);\n}\n\n:host([size=\"x-small\"]) .radio-wrapper .radio-label z-icon,\n:host([size=\"x-small\"]) .checkbox-wrapper .checkbox-label z-icon {\n --z-icon-width: 14px;\n --z-icon-height: 14px;\n}\n\n:host([size=\"x-small\"]) .radio-wrapper .radio-label,\n:host([size=\"x-small\"]) .checkbox-wrapper .checkbox-label {\n font-size: var(--font-size-1);\n}\n\n.radio-wrapper .radio-label.after,\n.checkbox-wrapper .checkbox-label.after {\n flex-direction: row;\n}\n\n.radio-wrapper .radio-label.before,\n.checkbox-wrapper .checkbox-label.before {\n flex-direction: row-reverse;\n}\n\n.radio-wrapper .radio-label.after > span,\n.checkbox-wrapper .checkbox-label.after > span {\n margin-left: var(--space-unit);\n}\n\n.radio-wrapper .radio-label.before > span,\n.checkbox-wrapper .checkbox-label.before > span {\n margin-right: var(--space-unit);\n}\n\n:host([size=\"small\"]) .radio-wrapper .radio-label.after > span,\n:host([size=\"small\"]) .checkbox-wrapper .checkbox-label.after > span,\n:host([size=\"x-small\"]) .radio-wrapper .radio-label.after > span,\n:host([size=\"x-small\"]) .checkbox-wrapper .checkbox-label.after > span {\n margin-left: calc(var(--space-unit) * 0.5);\n}\n\n:host([size=\"small\"]) .radio-wrapper .radio-label.before > span,\n:host([size=\"small\"]) .checkbox-wrapper .checkbox-label.before > span,\n:host([size=\"x-small\"]) .radio-wrapper .radio-label.before > span,\n:host([size=\"x-small\"]) .checkbox-wrapper .checkbox-label.before > span {\n margin-right: calc(var(--space-unit) * 0.5);\n}\n\n/* focus */\n.radio-wrapper > input:focus:focus-visible + .radio-label > z-icon {\n border-radius: 50%;\n}\n\n.checkbox-wrapper > input:focus:focus-visible + .checkbox-label > z-icon {\n border-radius: var(--border-radius-small);\n}\n\n.radio-wrapper > input:focus:focus-visible + .radio-label > z-icon,\n.checkbox-wrapper > input:focus:focus-visible + .checkbox-label > z-icon {\n box-shadow: var(--shadow-focus-primary);\n}\n\n/* disabled */\n.radio-wrapper > input:disabled + .radio-label,\n.checkbox-wrapper > input:disabled + .checkbox-label {\n color: var(--color-disabled03);\n}\n\n.radio-wrapper > input:disabled + .radio-label > z-icon,\n.checkbox-wrapper > input:disabled + .checkbox-label > z-icon {\n cursor: default;\n fill: var(--color-disabled03-icon);\n}\n","import {\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n Listen,\n Method,\n Prop,\n State,\n Watch,\n h,\n} from \"@stencil/core\";\nimport {Fragment, JSXBase} from \"@stencil/core/internal\";\nimport {ControlSize, InputStatus, InputType, LabelPosition} from \"../../beans\";\nimport {boolean, randomId} from \"../../utils/utils\";\n\n@Component({\n tag: \"z-input\",\n styleUrls: [\"styles-general.css\", \"styles-text.css\", \"styles-textarea.css\", \"styles-checkbox-radio.css\"],\n shadow: false,\n scoped: true,\n})\nexport class ZInput implements ComponentInterface {\n @Element() hostElement: HTMLZInputElement;\n\n /** the id of the input element */\n @Prop()\n htmlid = `id-${randomId()}`;\n\n /** Input type */\n @Prop()\n type: InputType = InputType.TEXT;\n\n /** the input `name` attribute */\n @Prop()\n name?: string;\n\n /** the input label */\n @Prop()\n label?: string;\n\n /** the input `aria-label` */\n @Prop()\n htmlAriaLabel?: string;\n\n /** the input `aria-expanded`: available for text, password, number, email */\n @Prop()\n htmlAriaExpanded?: string;\n\n /** the input `aria-controls` (optional): available for text, password, number, email */\n @Prop()\n htmlAriaControls?: string;\n\n /** the input `aria-autocomplete` (optional): available for text, password, number, email */\n @Prop()\n htmlAriaAutocomplete?: string;\n\n /** the input `aria-activedescendant` (optional): available for text, password, number, email */\n @Prop()\n htmlAriaActivedescendant?: string;\n\n /** the input `aria-describedby` (optional) */\n @Prop()\n htmlAriaDescribedby?: string;\n\n /** the input `aria-labelledby` (optional) */\n @Prop()\n htmlAriaLabelledby?: string;\n\n /** the input value */\n @Prop({mutable: true})\n value?: string;\n\n /** the input is disabled */\n @Prop({reflect: true})\n disabled?: boolean = false;\n\n /** the input is readonly */\n @Prop()\n readonly?: boolean = false;\n\n /** the input is required (optional): available for text, password, number, email, textarea, checkbox */\n @Prop()\n required?: boolean = false;\n\n /** checked: available for checkbox, radio */\n @Prop({mutable: true})\n checked?: boolean = false;\n\n /** indeterminate: available for checkbox */\n @Prop({mutable: true})\n indeterminate?: boolean = false;\n\n /** the input placeholder (optional) */\n @Prop()\n placeholder?: string;\n\n /** the input html title (optional) */\n @Prop()\n htmltitle?: string;\n\n /** the input status (optional): available for text, password, number, email, textarea */\n @Prop()\n status?: InputStatus;\n\n /** input helper message (optional): available for text, password, number, email, textarea - if set to `false` message won't be displayed */\n @Prop()\n message?: string | boolean = true;\n\n /** the input label position: available for checkbox, radio */\n @Prop()\n labelPosition?: LabelPosition = LabelPosition.RIGHT;\n\n /** the input has autocomplete option (optional): available for text, password, number, email */\n @Prop()\n autocomplete?: string;\n\n /** the input `role` */\n @Prop()\n htmlRole?: string;\n\n /** render clear icon when typing (optional): available for text */\n @Prop()\n hasclearicon?: boolean = true;\n\n /** render icon (optional): available for text */\n @Prop()\n icon?: string;\n\n /** min number value (optional): available for number */\n @Prop()\n min?: number;\n\n /** Min length value (optional): available for text */\n @Prop()\n minlength?: number;\n\n /** max number value (optional): available for number */\n @Prop()\n max?: number;\n\n /** Max length value (optional): available for text */\n @Prop()\n maxlength?: number;\n\n /** step number value (optional): available for number */\n @Prop()\n step?: number;\n\n /** pattern value (optional): available for tel, text, search, url, email, password*/\n @Prop()\n pattern?: string;\n\n /** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */\n @Prop({reflect: true})\n size?: ControlSize = ControlSize.BIG;\n\n @State()\n isTyping = false;\n\n @State()\n passwordHidden = true;\n\n private timer;\n\n private typingtimeout = 300;\n\n private inputRef: HTMLInputElement;\n\n @Listen(\"inputCheck\", {target: \"document\"})\n inputCheckListener(e: CustomEvent): void {\n const data = e.detail;\n switch (this.type) {\n case InputType.RADIO:\n if (data.type === InputType.RADIO && data.name === this.name && data.id !== this.htmlid) {\n this.checked = false;\n }\n break;\n }\n }\n\n @Watch(\"indeterminate\")\n watchIndeterminate(): void {\n this.syncCheckboxIndeterminate();\n }\n\n private syncCheckboxIndeterminate(): void {\n if (this.type !== InputType.CHECKBOX || !this.inputRef) {\n return;\n }\n\n this.inputRef.indeterminate = !!this.indeterminate;\n }\n\n /** get checked status */\n @Method()\n async isChecked(): Promise<boolean> {\n switch (this.type) {\n case InputType.CHECKBOX:\n case InputType.RADIO:\n return this.checked;\n default:\n console.warn(\"`isChecked` method is only available for type `checkbox` and `radio`\");\n\n return false;\n }\n }\n\n /** Emitted on input value change, returns value, validity */\n @Event()\n inputChange: EventEmitter;\n\n private emitInputChange(value: string): void {\n if (!this.isTyping) {\n this.emitStartTyping();\n }\n\n let validity: ValidityState;\n if (this.type === InputType.TEXTAREA) {\n validity = this.getValidity(\"textarea\");\n } else {\n validity = this.getValidity(\"input\");\n }\n this.value = value;\n this.inputChange.emit({value, validity});\n\n clearTimeout(this.timer);\n this.timer = setTimeout(() => {\n this.emitStopTyping(this.value, validity);\n }, this.typingtimeout);\n }\n\n /** Emitted when user starts typing */\n @Event()\n startTyping: EventEmitter;\n\n private emitStartTyping(): void {\n this.isTyping = true;\n this.startTyping.emit();\n }\n\n /** Emitted when user stops typing, returns value, validity */\n @Event()\n stopTyping: EventEmitter;\n\n private emitStopTyping(value: string, validity: ValidityState): void {\n this.isTyping = false;\n this.stopTyping.emit({\n value: value,\n validity: validity,\n });\n }\n\n /** Emitted on checkbox check/uncheck, returns id, checked, type, name, value, validity */\n @Event()\n inputCheck: EventEmitter;\n\n private emitInputCheck(checked: boolean): void {\n this.inputCheck.emit({\n id: this.htmlid,\n checked: checked,\n type: this.type,\n name: this.name,\n value: this.value,\n validity: this.getValidity(\"input\"),\n });\n }\n\n /** Emitted on input focus */\n @Event()\n inputFocus: EventEmitter;\n\n private emitInputFocus(): void {\n this.inputFocus.emit({id: this.htmlid});\n }\n\n /** Emitted on input blur */\n @Event()\n inputBlur: EventEmitter;\n\n private emitInputBlur(): void {\n this.inputBlur.emit({id: this.htmlid});\n }\n\n private getValidity(type: string): ValidityState {\n const input = this.hostElement.querySelector(type) as HTMLInputElement;\n\n return input.validity;\n }\n\n /* START text/password/email/number */\n\n private getTextAttributes(): JSXBase.InputHTMLAttributes<HTMLInputElement | HTMLTextAreaElement> {\n return {\n id: this.htmlid,\n name: this.name,\n placeholder: this.placeholder,\n value: this.value,\n disabled: this.disabled,\n readonly: this.readonly,\n required: this.required,\n title: this.htmltitle,\n minlength: this.minlength,\n maxlength: this.maxlength,\n class: {\n [`input-${this.status}`]: !!this.status,\n },\n autocomplete: this.autocomplete,\n onInput: (e: InputEvent) => this.emitInputChange((e.target as HTMLInputElement).value),\n };\n }\n\n private getNumberAttributes(type: InputType): JSXBase.InputHTMLAttributes<HTMLInputElement> {\n if (type != InputType.NUMBER) {\n return;\n }\n\n return {\n min: this.min,\n max: this.max,\n step: this.step,\n };\n }\n\n private getPatternAttribute(type: InputType): JSXBase.InputHTMLAttributes<HTMLInputElement> {\n if (\n type != InputType.PASSWORD &&\n type != InputType.TEXT &&\n type != InputType.TEL &&\n type != InputType.SEARCH &&\n type != InputType.URL &&\n type != InputType.EMAIL\n ) {\n return;\n }\n\n return {\n pattern: this.pattern,\n };\n }\n\n private inputHasMessage(): boolean {\n if (typeof boolean(this.message) === \"boolean\") {\n return false;\n }\n\n return true;\n }\n\n private getAriaAttributes(): Record<string, string | undefined> {\n return {\n \"role\": this.htmlRole || undefined,\n \"aria-describedby\": this.htmlAriaDescribedby || undefined,\n \"aria-labelledby\": this.htmlAriaLabelledby || undefined,\n };\n }\n\n private getTextAriaAttributes(): Record<string, string | undefined> {\n return {\n ...this.getAriaAttributes(),\n \"aria-expanded\": this.htmlAriaExpanded || undefined,\n \"aria-controls\": this.htmlAriaControls || undefined,\n \"aria-autocomplete\": this.htmlAriaAutocomplete || undefined,\n \"aria-activedescendant\": this.htmlAriaActivedescendant || undefined,\n \"aria-describedby\":\n this.htmlAriaDescribedby || this.inputHasMessage()\n ? this.htmlAriaDescribedby || `${this.htmlid}-message`\n : undefined,\n \"aria-invalid\": this.status === InputStatus.ERROR ? \"true\" : undefined,\n \"aria-required\": this.required ? \"true\" : undefined,\n };\n }\n\n private getFocusBlurAttributes(): JSXBase.InputHTMLAttributes<HTMLInputElement | HTMLTextAreaElement> {\n return {\n onFocus: () => this.emitInputFocus(),\n onBlur: () => this.emitInputBlur(),\n };\n }\n\n private renderInputText(type: InputType = InputType.TEXT): HTMLDivElement {\n const attr = {\n ...this.getTextAttributes(),\n ...this.getNumberAttributes(type),\n ...this.getPatternAttribute(type),\n ...this.getTextAriaAttributes(),\n ...this.getFocusBlurAttributes(),\n \"aria-label\": this.htmlAriaLabel || undefined,\n };\n\n attr.class = {\n ...(attr.class as {[className: string]: boolean}),\n \"has-icon\": !!this.icon || type === InputType.PASSWORD,\n \"has-clear-icon\": this.hasclearicon && type != InputType.NUMBER,\n };\n\n return (\n <div class=\"text-wrapper\">\n {this.renderLabel()}\n <div>\n <input\n {...attr}\n type={type === InputType.PASSWORD && !this.passwordHidden ? InputType.TEXT : type}\n ref={(el) => (this.inputRef = el)}\n />\n {this.renderIcons()}\n </div>\n {this.renderMessage()}\n </div>\n );\n }\n\n private renderLabel(): HTMLLabelElement {\n if (!this.label) {\n return;\n }\n\n return (\n <label\n class=\"z-label body-5-sb\"\n id={`${this.htmlid}_label`}\n htmlFor={this.htmlid}\n >\n {this.label}\n </label>\n );\n }\n\n private renderIcons(): HTMLSpanElement {\n return (\n <span class=\"icons-wrapper\">\n {this.renderResetIcon()}\n {this.renderIcon()}\n </span>\n );\n }\n\n private renderIcon(): HTMLButtonElement {\n if (this.type === InputType.PASSWORD) {\n return this.renderShowHidePassword();\n }\n\n if (!this.icon) {\n return;\n }\n\n return (\n <z-icon\n name={this.icon}\n class={{[this.size]: true, \"input-icon\": true}}\n />\n );\n }\n\n private renderResetIcon(): HTMLButtonElement {\n let hidden = false;\n if (!this.hasclearicon || !this.value || this.disabled || this.readonly || this.type == InputType.NUMBER) {\n hidden = true;\n }\n\n return (\n <button\n type=\"button\"\n class={{\"reset-icon\": true, \"input-icon\": true, hidden}}\n aria-label=\"cancella il contenuto dell'input\"\n onClick={() => {\n this.inputRef.value = \"\";\n this.emitInputChange(\"\");\n this.inputRef.focus();\n }}\n >\n <z-icon\n name=\"multiply\"\n class={this.size}\n />\n </button>\n );\n }\n\n private renderShowHidePassword(): HTMLButtonElement {\n return (\n <button\n type=\"button\"\n class=\"input-icon toggle-password-icon\"\n disabled={this.disabled}\n aria-label=\"mostra password\"\n aria-pressed={!this.passwordHidden ? \"true\" : \"false\"}\n onClick={() => (this.passwordHidden = !this.passwordHidden)}\n >\n <z-icon\n name={this.passwordHidden ? \"view-filled\" : \"view-off-filled\"}\n class={this.size}\n />\n </button>\n );\n }\n\n private renderMessage(): HTMLZInputMessageElement {\n if (boolean(this.message) === false) {\n return;\n }\n\n return (\n <z-input-message\n html-id={`${this.htmlid}-message`}\n message={boolean(this.message) === true ? undefined : (this.message as string)}\n status={this.status}\n class={this.size}\n disabled={this.disabled}\n />\n );\n }\n\n /* END text/password/email/number */\n\n /* START textarea */\n\n private renderTextarea(): HTMLDivElement {\n const attributes = this.getTextAttributes();\n const ariaAttributes = this.getTextAriaAttributes();\n\n return (\n <Fragment>\n {this.renderLabel()}\n <div\n class={{\n ...(attributes.class as {[className: string]: boolean}),\n \"textarea-wrapper\": true,\n \"readonly\": !!attributes.readonly,\n }}\n >\n <textarea\n {...attributes}\n {...ariaAttributes}\n class={{\n ...(attributes.class as {[className: string]: boolean}),\n \"z-scrollbar\": true,\n }}\n aria-label={this.htmlAriaLabel || undefined}\n ></textarea>\n </div>\n {this.renderMessage()}\n </Fragment>\n );\n }\n\n /* END textarea */\n\n private handleCheck(ev: Event): void {\n if (this.type === InputType.CHECKBOX && this.indeterminate) {\n this.indeterminate = false;\n }\n\n this.checked = (ev.target as HTMLInputElement).checked;\n this.emitInputCheck(this.checked);\n }\n\n private getCheckboxAriaChecked(): \"true\" | \"false\" | \"mixed\" {\n if (this.indeterminate) {\n return \"mixed\";\n }\n\n return this.checked ? \"true\" : \"false\";\n }\n\n /* START checkbox */\n private renderCheckbox(): HTMLDivElement {\n const ariaRequired = this.required ? {\"aria-required\": \"true\"} : {};\n\n return (\n <div class=\"checkbox-wrapper\">\n <input\n id={this.htmlid}\n type=\"checkbox\"\n name={this.name}\n checked={this.indeterminate ? false : this.checked}\n disabled={this.disabled}\n readonly={this.readonly}\n required={this.required}\n onChange={this.handleCheck.bind(this)}\n value={this.value}\n aria-checked={this.getCheckboxAriaChecked()}\n {...ariaRequired}\n {...this.getAriaAttributes()}\n {...this.getFocusBlurAttributes()}\n ref={(el) => {\n this.inputRef = el;\n this.syncCheckboxIndeterminate();\n }}\n />\n\n <label\n htmlFor={this.htmlid}\n class={{\n \"checkbox-label\": true,\n \"after\": this.labelPosition === LabelPosition.RIGHT,\n \"before\": this.labelPosition === LabelPosition.LEFT,\n }}\n >\n <z-icon\n name={this.indeterminate ? \"indeterminated-checkbox\" : this.checked ? \"checkbox-checked\" : \"checkbox\"}\n class={this.size}\n />\n {this.label && <span innerHTML={this.label}></span>}\n </label>\n </div>\n );\n }\n\n /* END checkbox */\n\n /* START radio */\n private renderRadio(): HTMLDivElement {\n const ariaRequired = this.required ? {\"aria-required\": \"true\"} : {};\n\n return (\n <div class=\"radio-wrapper\">\n <input\n id={this.htmlid}\n type=\"radio\"\n name={this.name}\n checked={this.checked}\n disabled={this.disabled}\n readonly={this.readonly}\n required={this.required}\n onChange={this.handleCheck.bind(this)}\n value={this.value}\n {...this.getAriaAttributes()}\n {...this.getFocusBlurAttributes()}\n {...ariaRequired}\n />\n\n <label\n htmlFor={this.htmlid}\n class={{\n \"radio-label\": true,\n \"after\": this.labelPosition === LabelPosition.RIGHT,\n \"before\": this.labelPosition === LabelPosition.LEFT,\n }}\n >\n <z-icon\n name={this.checked ? \"radio-button-checked\" : \"radio-button\"}\n class={this.size}\n />\n {this.label && <span innerHTML={this.label} />}\n </label>\n </div>\n );\n }\n /* END radio */\n\n render(): HTMLInputElement | HTMLDivElement {\n switch (this.type) {\n case InputType.TEXTAREA:\n return this.renderTextarea();\n case InputType.CHECKBOX:\n return this.renderCheckbox();\n case InputType.RADIO:\n return this.renderRadio();\n case InputType.TEXT:\n default:\n return this.renderInputText(this.type);\n }\n }\n}\n"],"mappings":"8OAAA,MAAMA,EAAmB,IAAM,kpICA/B,MAAMC,EAAgB,IAAM,myECA5B,MAAMC,EAAoB,IAAM,4VCAhC,MA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,KAAKoF,oBACLpF,KAAKmG,yBACL6B,IAGNtB,EAAA,SACEO,QAASjH,KAAKC,OACdgE,MAAO,CACL,cAAe,KACfkE,MAASnI,KAAKY,gBAAkBC,EAAcC,MAC9CsH,OAAUpI,KAAKY,gBAAkBC,EAAcwH,OAGjD3B,EAAA,UACE/E,KAAM3B,KAAKS,QAAU,uBAAyB,eAC9CwD,MAAOjE,KAAKgB,OAEbhB,KAAKgH,OAASN,EAAA,QAAM4B,UAAWtI,KAAKgH,S,CAO7C,MAAAwB,GACE,OAAQxI,KAAKG,MACX,KAAKC,EAAUoC,SACb,OAAOxC,KAAKwH,iBACd,KAAKpH,EAAU2B,SACb,OAAO/B,KAAK+H,iBACd,KAAK3H,EAAUsB,MACb,OAAO1B,KAAKuI,cACd,KAAKnI,EAAUC,KACf,QACE,OAAOL,KAAKsG,gBAAgBtG,KAAKG,M","ignoreList":[]}
@@ -1,2 +1,2 @@
1
1
  var B;(function(B){B[B["MOBILE"]=767]="MOBILE";B[B["TABLET"]=1151]="TABLET";B[B["DESKTOP"]=1365]="DESKTOP"})(B||(B={}));export{B};
2
- //# sourceMappingURL=breakpoints.js.map
2
+ //# sourceMappingURL=p-Q-tWjk7P.js.map