@zanichelli/albe-web-components 19.1.3-RC3 → 19.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/{index-e84fb4e1.js → index-805390c8.js} +2 -2
  3. package/dist/cjs/{index-e84fb4e1.js.map → index-805390c8.js.map} +1 -1
  4. package/dist/cjs/index.cjs.js +1 -1
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/{utils-3dc316f8.js → utils-5148245a.js} +69 -24
  7. package/dist/cjs/utils-5148245a.js.map +1 -0
  8. package/dist/cjs/web-components-library.cjs.js +1 -1
  9. package/dist/cjs/z-app-header_12.cjs.entry.js +4 -6
  10. package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -1
  11. package/dist/cjs/z-book-card-deprecated.cjs.entry.js +1 -1
  12. package/dist/cjs/z-breadcrumb.cjs.entry.js +1 -1
  13. package/dist/cjs/z-combobox.cjs.entry.js +62 -50
  14. package/dist/cjs/z-combobox.cjs.entry.js.map +1 -1
  15. package/dist/cjs/z-menu.cjs.entry.js +1 -1
  16. package/dist/cjs/z-myz-card-info.cjs.entry.js +1 -1
  17. package/dist/cjs/z-myz-list-item.cjs.entry.js +1 -1
  18. package/dist/cjs/z-popover.cjs.entry.js +111 -42
  19. package/dist/cjs/z-popover.cjs.entry.js.map +1 -1
  20. package/dist/cjs/z-select.cjs.entry.js +28 -63
  21. package/dist/cjs/z-select.cjs.entry.js.map +1 -1
  22. package/dist/cjs/z-skip-to-content.cjs.entry.js +1 -1
  23. package/dist/cjs/z-slideshow.cjs.entry.js +1 -1
  24. package/dist/cjs/z-stepper-item.cjs.entry.js +3 -3
  25. package/dist/cjs/z-stepper-item.cjs.entry.js.map +1 -1
  26. package/dist/cjs/z-stepper.cjs.entry.js +1 -1
  27. package/dist/cjs/z-stepper.cjs.entry.js.map +1 -1
  28. package/dist/cjs/z-table.cjs.entry.js +2 -2
  29. package/dist/cjs/z-toggle-switch.cjs.entry.js +1 -1
  30. package/dist/cjs/z-tooltip.cjs.entry.js +1 -1
  31. package/dist/cjs/z-tooltip.cjs.entry.js.map +1 -1
  32. package/dist/cjs/z-tr.cjs.entry.js +2 -2
  33. package/dist/collection/components/list/z-list-group/index.js +2 -39
  34. package/dist/collection/components/list/z-list-group/index.js.map +1 -1
  35. package/dist/collection/components/z-combobox/index.js +63 -48
  36. package/dist/collection/components/z-combobox/index.js.map +1 -1
  37. package/dist/collection/components/z-combobox/styles.css +0 -6
  38. package/dist/collection/components/z-input-message/index.js +1 -1
  39. package/dist/collection/components/z-input-message/index.js.map +1 -1
  40. package/dist/collection/components/z-popover/index.js +111 -42
  41. package/dist/collection/components/z-popover/index.js.map +1 -1
  42. package/dist/collection/components/z-popover/index.stories.js +49 -0
  43. package/dist/collection/components/z-popover/index.stories.js.map +1 -1
  44. package/dist/collection/components/z-popover/styles.css +0 -16
  45. package/dist/collection/components/z-select/index.js +27 -62
  46. package/dist/collection/components/z-select/index.js.map +1 -1
  47. package/dist/collection/components/z-stepper/index.js +1 -1
  48. package/dist/collection/components/z-stepper/index.js.map +1 -1
  49. package/dist/collection/components/z-stepper-item/index.js +3 -3
  50. package/dist/collection/components/z-stepper-item/index.js.map +1 -1
  51. package/dist/collection/components/z-tooltip/styles.css +7 -6
  52. package/dist/collection/utils/utils.js +66 -22
  53. package/dist/collection/utils/utils.js.map +1 -1
  54. package/dist/components/index13.js +1 -1
  55. package/dist/components/index13.js.map +1 -1
  56. package/dist/components/index16.js +3 -7
  57. package/dist/components/index16.js.map +1 -1
  58. package/dist/components/index24.js +111 -42
  59. package/dist/components/index24.js.map +1 -1
  60. package/dist/components/index25.js +1 -1
  61. package/dist/components/utils.js +67 -23
  62. package/dist/components/utils.js.map +1 -1
  63. package/dist/components/z-combobox.js +65 -51
  64. package/dist/components/z-combobox.js.map +1 -1
  65. package/dist/components/z-select.js +27 -62
  66. package/dist/components/z-select.js.map +1 -1
  67. package/dist/components/z-stepper-item.js +3 -3
  68. package/dist/components/z-stepper-item.js.map +1 -1
  69. package/dist/components/z-stepper.js +1 -1
  70. package/dist/components/z-stepper.js.map +1 -1
  71. package/dist/components/z-tooltip.js +1 -1
  72. package/dist/components/z-tooltip.js.map +1 -1
  73. package/dist/esm/{index-92064825.js → index-8a9f6d27.js} +2 -2
  74. package/dist/esm/{index-92064825.js.map → index-8a9f6d27.js.map} +1 -1
  75. package/dist/esm/index.js +1 -1
  76. package/dist/esm/loader.js +1 -1
  77. package/dist/esm/{utils-6e2be2b6.js → utils-e66d94c3.js} +68 -24
  78. package/dist/esm/utils-e66d94c3.js.map +1 -0
  79. package/dist/esm/web-components-library.js +1 -1
  80. package/dist/esm/z-app-header_12.entry.js +4 -6
  81. package/dist/esm/z-app-header_12.entry.js.map +1 -1
  82. package/dist/esm/z-book-card-deprecated.entry.js +1 -1
  83. package/dist/esm/z-breadcrumb.entry.js +1 -1
  84. package/dist/esm/z-combobox.entry.js +62 -50
  85. package/dist/esm/z-combobox.entry.js.map +1 -1
  86. package/dist/esm/z-menu.entry.js +1 -1
  87. package/dist/esm/z-myz-card-info.entry.js +1 -1
  88. package/dist/esm/z-myz-list-item.entry.js +1 -1
  89. package/dist/esm/z-popover.entry.js +111 -42
  90. package/dist/esm/z-popover.entry.js.map +1 -1
  91. package/dist/esm/z-select.entry.js +28 -63
  92. package/dist/esm/z-select.entry.js.map +1 -1
  93. package/dist/esm/z-skip-to-content.entry.js +1 -1
  94. package/dist/esm/z-slideshow.entry.js +1 -1
  95. package/dist/esm/z-stepper-item.entry.js +3 -3
  96. package/dist/esm/z-stepper-item.entry.js.map +1 -1
  97. package/dist/esm/z-stepper.entry.js +1 -1
  98. package/dist/esm/z-stepper.entry.js.map +1 -1
  99. package/dist/esm/z-table.entry.js +2 -2
  100. package/dist/esm/z-toggle-switch.entry.js +1 -1
  101. package/dist/esm/z-tooltip.entry.js +1 -1
  102. package/dist/esm/z-tooltip.entry.js.map +1 -1
  103. package/dist/esm/z-tr.entry.js +2 -2
  104. package/dist/types/components/list/z-list-group/index.d.ts +0 -8
  105. package/dist/types/components/z-combobox/index.d.ts +8 -1
  106. package/dist/types/components/z-popover/index.d.ts +15 -4
  107. package/dist/types/components/z-popover/index.stories.d.ts +8 -0
  108. package/dist/types/components.d.ts +2 -18
  109. package/dist/types/utils/utils.d.ts +14 -8
  110. package/dist/web-components-library/index.esm.js +1 -1
  111. package/dist/web-components-library/{p-2bf54364.js → p-030257b3.js} +2 -2
  112. package/{www/build/p-8bd4a2aa.entry.js → dist/web-components-library/p-1844a4f4.entry.js} +2 -2
  113. package/dist/web-components-library/{p-539f99db.entry.js → p-19f5b6a9.entry.js} +2 -2
  114. package/dist/web-components-library/{p-ce6e18f9.entry.js → p-1c7550f9.entry.js} +2 -2
  115. package/dist/web-components-library/p-22ba2a17.entry.js +2 -0
  116. package/dist/web-components-library/p-22ba2a17.entry.js.map +1 -0
  117. package/dist/web-components-library/{p-28d83c86.entry.js → p-307c9c33.entry.js} +2 -2
  118. package/dist/web-components-library/p-334cba5d.entry.js +2 -0
  119. package/dist/web-components-library/p-334cba5d.entry.js.map +1 -0
  120. package/dist/web-components-library/p-33d2a5db.entry.js +2 -0
  121. package/dist/web-components-library/p-33d2a5db.entry.js.map +1 -0
  122. package/{www/build/p-2e0923bd.entry.js → dist/web-components-library/p-3f5aa623.entry.js} +2 -2
  123. package/dist/web-components-library/{p-ee223a82.entry.js → p-75e47ecf.entry.js} +2 -2
  124. package/dist/web-components-library/p-75e47ecf.entry.js.map +1 -0
  125. package/dist/web-components-library/{p-b3f1b5c1.entry.js → p-99210133.entry.js} +2 -2
  126. package/dist/web-components-library/p-b71a3f69.entry.js +2 -0
  127. package/dist/web-components-library/{p-6cff173f.entry.js.map → p-b71a3f69.entry.js.map} +1 -1
  128. package/dist/web-components-library/{p-7ceddb7a.entry.js → p-b7ec2cc4.entry.js} +2 -2
  129. package/dist/web-components-library/p-b7ec2cc4.entry.js.map +1 -0
  130. package/dist/web-components-library/{p-4aaf0172.entry.js → p-b96900bb.entry.js} +2 -2
  131. package/dist/web-components-library/{p-57314d68.entry.js → p-cc18a2b7.entry.js} +2 -2
  132. package/dist/web-components-library/p-cc18a2b7.entry.js.map +1 -0
  133. package/dist/web-components-library/p-d2035d26.entry.js +2 -0
  134. package/{www/build/p-5f94986f.entry.js → dist/web-components-library/p-daa1ffe9.entry.js} +2 -2
  135. package/dist/web-components-library/p-e6778114.js +2 -0
  136. package/dist/web-components-library/p-e6778114.js.map +1 -0
  137. package/{www/build/p-7194003a.entry.js → dist/web-components-library/p-e9e2ceb4.entry.js} +2 -2
  138. package/dist/web-components-library/web-components-library.esm.js +1 -1
  139. package/dist/web-components-library/web-components-library.esm.js.map +1 -1
  140. package/package.json +2 -3
  141. package/www/build/index.esm.js +1 -1
  142. package/www/build/{p-2bf54364.js → p-030257b3.js} +2 -2
  143. package/{dist/web-components-library/p-8bd4a2aa.entry.js → www/build/p-1844a4f4.entry.js} +2 -2
  144. package/www/build/{p-539f99db.entry.js → p-19f5b6a9.entry.js} +2 -2
  145. package/www/build/{p-ce6e18f9.entry.js → p-1c7550f9.entry.js} +2 -2
  146. package/www/build/p-22ba2a17.entry.js +2 -0
  147. package/www/build/p-22ba2a17.entry.js.map +1 -0
  148. package/www/build/{p-28d83c86.entry.js → p-307c9c33.entry.js} +2 -2
  149. package/www/build/p-334cba5d.entry.js +2 -0
  150. package/www/build/p-334cba5d.entry.js.map +1 -0
  151. package/www/build/p-33d2a5db.entry.js +2 -0
  152. package/www/build/p-33d2a5db.entry.js.map +1 -0
  153. package/{dist/web-components-library/p-2e0923bd.entry.js → www/build/p-3f5aa623.entry.js} +2 -2
  154. package/www/build/{p-ee223a82.entry.js → p-75e47ecf.entry.js} +2 -2
  155. package/www/build/p-75e47ecf.entry.js.map +1 -0
  156. package/www/build/p-7646bea0.js +2 -0
  157. package/www/build/{p-b3f1b5c1.entry.js → p-99210133.entry.js} +2 -2
  158. package/www/build/p-b71a3f69.entry.js +2 -0
  159. package/www/build/{p-6cff173f.entry.js.map → p-b71a3f69.entry.js.map} +1 -1
  160. package/www/build/{p-7ceddb7a.entry.js → p-b7ec2cc4.entry.js} +2 -2
  161. package/www/build/p-b7ec2cc4.entry.js.map +1 -0
  162. package/www/build/{p-4aaf0172.entry.js → p-b96900bb.entry.js} +2 -2
  163. package/www/build/{p-57314d68.entry.js → p-cc18a2b7.entry.js} +2 -2
  164. package/www/build/p-cc18a2b7.entry.js.map +1 -0
  165. package/www/build/p-d2035d26.entry.js +2 -0
  166. package/{dist/web-components-library/p-5f94986f.entry.js → www/build/p-daa1ffe9.entry.js} +2 -2
  167. package/www/build/p-e6778114.js +2 -0
  168. package/www/build/p-e6778114.js.map +1 -0
  169. package/{dist/web-components-library/p-7194003a.entry.js → www/build/p-e9e2ceb4.entry.js} +2 -2
  170. package/www/build/web-components-library.esm.js +1 -1
  171. package/www/build/web-components-library.esm.js.map +1 -1
  172. package/www/index.html +1 -1
  173. package/dist/cjs/utils-3dc316f8.js.map +0 -1
  174. package/dist/esm/utils-6e2be2b6.js.map +0 -1
  175. package/dist/web-components-library/p-57314d68.entry.js.map +0 -1
  176. package/dist/web-components-library/p-625e2cee.js +0 -2
  177. package/dist/web-components-library/p-625e2cee.js.map +0 -1
  178. package/dist/web-components-library/p-6cff173f.entry.js +0 -2
  179. package/dist/web-components-library/p-78146cef.entry.js +0 -2
  180. package/dist/web-components-library/p-78146cef.entry.js.map +0 -1
  181. package/dist/web-components-library/p-7ceddb7a.entry.js.map +0 -1
  182. package/dist/web-components-library/p-ac477ae7.entry.js +0 -2
  183. package/dist/web-components-library/p-ac477ae7.entry.js.map +0 -1
  184. package/dist/web-components-library/p-bc2fb71e.entry.js +0 -2
  185. package/dist/web-components-library/p-bc2fb71e.entry.js.map +0 -1
  186. package/dist/web-components-library/p-dc156429.entry.js +0 -2
  187. package/dist/web-components-library/p-ee223a82.entry.js.map +0 -1
  188. package/www/build/p-57314d68.entry.js.map +0 -1
  189. package/www/build/p-625e2cee.js +0 -2
  190. package/www/build/p-625e2cee.js.map +0 -1
  191. package/www/build/p-6cff173f.entry.js +0 -2
  192. package/www/build/p-78146cef.entry.js +0 -2
  193. package/www/build/p-78146cef.entry.js.map +0 -1
  194. package/www/build/p-7ceddb7a.entry.js.map +0 -1
  195. package/www/build/p-ac477ae7.entry.js +0 -2
  196. package/www/build/p-ac477ae7.entry.js.map +0 -1
  197. package/www/build/p-bc2fb71e.entry.js +0 -2
  198. package/www/build/p-bc2fb71e.entry.js.map +0 -1
  199. package/www/build/p-dc156429.entry.js +0 -2
  200. package/www/build/p-e13b193a.js +0 -2
  201. package/www/build/p-ee223a82.entry.js.map +0 -1
  202. /package/dist/web-components-library/{p-2bf54364.js.map → p-030257b3.js.map} +0 -0
  203. /package/dist/web-components-library/{p-8bd4a2aa.entry.js.map → p-1844a4f4.entry.js.map} +0 -0
  204. /package/dist/web-components-library/{p-539f99db.entry.js.map → p-19f5b6a9.entry.js.map} +0 -0
  205. /package/dist/web-components-library/{p-ce6e18f9.entry.js.map → p-1c7550f9.entry.js.map} +0 -0
  206. /package/dist/web-components-library/{p-28d83c86.entry.js.map → p-307c9c33.entry.js.map} +0 -0
  207. /package/dist/web-components-library/{p-2e0923bd.entry.js.map → p-3f5aa623.entry.js.map} +0 -0
  208. /package/dist/web-components-library/{p-b3f1b5c1.entry.js.map → p-99210133.entry.js.map} +0 -0
  209. /package/dist/web-components-library/{p-4aaf0172.entry.js.map → p-b96900bb.entry.js.map} +0 -0
  210. /package/dist/web-components-library/{p-dc156429.entry.js.map → p-d2035d26.entry.js.map} +0 -0
  211. /package/dist/web-components-library/{p-5f94986f.entry.js.map → p-daa1ffe9.entry.js.map} +0 -0
  212. /package/dist/web-components-library/{p-7194003a.entry.js.map → p-e9e2ceb4.entry.js.map} +0 -0
  213. /package/www/build/{p-2bf54364.js.map → p-030257b3.js.map} +0 -0
  214. /package/www/build/{p-8bd4a2aa.entry.js.map → p-1844a4f4.entry.js.map} +0 -0
  215. /package/www/build/{p-539f99db.entry.js.map → p-19f5b6a9.entry.js.map} +0 -0
  216. /package/www/build/{p-ce6e18f9.entry.js.map → p-1c7550f9.entry.js.map} +0 -0
  217. /package/www/build/{p-28d83c86.entry.js.map → p-307c9c33.entry.js.map} +0 -0
  218. /package/www/build/{p-2e0923bd.entry.js.map → p-3f5aa623.entry.js.map} +0 -0
  219. /package/www/build/{p-b3f1b5c1.entry.js.map → p-99210133.entry.js.map} +0 -0
  220. /package/www/build/{p-4aaf0172.entry.js.map → p-b96900bb.entry.js.map} +0 -0
  221. /package/www/build/{p-dc156429.entry.js.map → p-d2035d26.entry.js.map} +0 -0
  222. /package/www/build/{p-5f94986f.entry.js.map → p-daa1ffe9.entry.js.map} +0 -0
  223. /package/www/build/{p-7194003a.entry.js.map → p-e9e2ceb4.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,WAAW,EAAC,MAAM,0BAA0B,CAAC;AAErD;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,KAAgC;IACtD,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,IAAI,CAAC;QACV,KAAK,MAAM,CAAC;QACZ,KAAK,CAAC,CAAC;QACP,KAAK,GAAG,CAAC;QACT,KAAK,IAAI,CAAC;QACV,KAAK,KAAK;YACR,OAAO,IAAI,CAAC;QACd,KAAK,KAAK,CAAC;QACX,KAAK,OAAO,CAAC;QACb,KAAK,CAAC,CAAC;QACP,KAAK,GAAG,CAAC;QACT,KAAK,KAAK,CAAC;QACX,KAAK,IAAI;YACP,OAAO,KAAK,CAAC;QACf;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,SAAiB;IAC7C,OAAO,SAAS,I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AC,OAAoB,EAAE,SAAsB;IACtF,MAAM,QAAQ,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IACjD,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,WAAW,CAAC;IACxE,MAAM,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,YAAY,CAAC;IAE1E,0CAA0C;IAC1C,MAAM,mBAAmB,GACvB,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,GAAG,cAAc,IAAI,QAAQ,CAAC,KAAK,GAAG,CAAC,IAAI,QAAQ,CAAC,IAAI,GAAG,aAAa,CAAC;IAE9G,uEAAuE;IACvE,IAAI,SAAS,KAAK,OAAO,CAAC,aAAa,CAAC,eAAe,IAAI,SAAS,KAAK,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;QACpG,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAED,qEAAqE;IACrE,MAAM,aAAa,GAAG,SAAS,CAAC,qBAAqB,EAAE,CAAC;IACxD,MAAM,oBAAoB,GACxB,QAAQ,CAAC,MAAM,GAAG,aAAa,CAAC,GAAG;QACnC,QAAQ,CAAC,GAAG,GAAG,aAAa,CAAC,MAAM;QACnC,QAAQ,CAAC,KAAK,GAAG,aAAa,CAAC,IAAI;QACnC,QAAQ,CAAC,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC;IAEtC,OAAO,oBAAoB,IAAI,mBAAmB,CAAC;AACrD,CAAC","sourcesContent":["import {ChildNode} from \"@stencil/core\";\nimport {Device, KeyboardCode} from \"../beans/index\";\nimport {Breakpoints} from \"../constants/breakpoints\";\n\n/**\n * Return boolean value for passed value if a boolean corresponding value is found\n * Return passed value otherwise\n */\nexport function boolean(value: string | number | boolean): boolean | string | number {\n switch (value) {\n case true:\n case \"true\":\n case 1:\n case \"1\":\n case \"on\":\n case \"yes\":\n return true;\n case false:\n case \"false\":\n case 0:\n case \"0\":\n case \"off\":\n case \"no\":\n return false;\n default:\n return value;\n }\n}\n\nexport function retrieveAsset(assetName: string): string {\n return assetName && \"assets/images/png/\" + assetName;\n}\n\nexport function randomId(): string {\n return Math.random().toString(36).replace(\"0.\", \"\");\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function handleKeyboardSubmit(ev: KeyboardEvent, callback: (...args) => void, ...args: any[]): void {\n if (ev.code === KeyboardCode.ENTER || ev.code === KeyboardCode.SPACE) {\n ev.preventDefault();\n callback(...args);\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function handleEnterKeydSubmit(ev: KeyboardEvent, callback: (...args) => void, ...args: any[]): void {\n if (ev.code === KeyboardCode.ENTER) {\n ev.preventDefault();\n callback(...args);\n }\n}\n\nexport function getClickedElement(elem: null | Element = null): null | Element {\n if (!elem) {\n elem = document.activeElement;\n }\n\n if (elem && elem.shadowRoot && elem.shadowRoot.activeElement) {\n elem = elem.shadowRoot.activeElement;\n\n return getClickedElement(elem);\n }\n\n return elem;\n}\n\nexport function getElementTree(elem: Element, tree: Element[] = []): null | Element[] {\n tree.push(elem);\n\n if (elem.parentElement) {\n elem = elem.parentElement;\n\n return getElementTree(elem, tree);\n } else if (elem.parentNode && (elem.parentNode as ShadowRoot).host) {\n elem = (elem.parentNode as ShadowRoot).host;\n\n return getElementTree(elem, tree);\n }\n\n return tree;\n}\n\nexport function getSiblings(elem: HTMLElement): ChildNode[] {\n const siblings = [];\n if (!elem || !elem.parentNode || !elem.parentNode.childNodes) {\n return siblings;\n }\n\n elem.parentNode.childNodes.forEach((child) => {\n if (child.nodeType === 1 && child !== elem) {\n siblings.push(child);\n }\n });\n\n return siblings;\n}\n\n/**\n * Get the current device type based on the window width.\n * @returns {Device} - The current device type\n */\nexport function getDevice(): Device {\n switch (true) {\n case window.innerWidth <= Breakpoints.MOBILE:\n return Device.MOBILE;\n case window.innerWidth <= Breakpoints.TABLET:\n return Device.TABLET;\n case window.innerWidth <= Breakpoints.DESKTOP:\n return Device.DESKTOP;\n default:\n return Device.DESKTOP_WIDE;\n }\n}\n\ntype JSONValue = string | number | boolean | JSONObject | JSONArray;\ninterface JSONObject {\n [x: string]: JSONValue;\n}\ntype JSONArray = JSONValue[];\n\nexport function convertJson(data: string): JSONValue {\n try {\n return JSON.parse(data);\n } catch {\n return false;\n }\n}\n\nexport function colorFromId(id: number): string {\n const prefix = \"avatar-C\"; // prefix for color vars name\n const colorsCount = 19; // available colors\n const seed = Math.ceil(2 ** 31 - 1) * parseFloat(`0.${id}`);\n let color = Math.ceil(colorsCount * (seed % 1));\n\n // if result of mc is 0\n // es.: 3895229\n if (color === 0) {\n color = 1;\n }\n\n return `${prefix}${color.toString().padStart(2, \"0\")}`;\n}\n\n/**\n * Check if the passed CSS selector is valid.\n * @param selector CSS selector to validate\n */\nexport function isSelectorValid(selector: string): boolean {\n try {\n document.createDocumentFragment().querySelector(selector);\n\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Check if an element contains another element, checking both light and shadow DOM.\n * @param ancestor Ancestor element\n * @param descendant Descendant element\n */\nexport function containsElement(ancestor: HTMLElement, descendant: Node): boolean {\n return ancestor.contains(descendant) || !!ancestor.shadowRoot?.contains(descendant);\n}\n\n/** Get the parent of passed element, accounting for shadow DOM.\n * @param element The element whose parent is to be found.\n */\nexport function getParentElement(element: Element): Element {\n if (element.parentNode === element.shadowRoot) {\n return element.shadowRoot.host;\n }\n\n return element.parentElement;\n}\n\n/**\n * Find the nearest ancestor of an element to take as a reference for positioning.\n * The chosen ancestor is the first to have an overflow set to hidden or is scrollable.\n * Falls back to the `offsetParent` of the element (the closest positioned ancestor, for example the one with `position: relative`).\n * @link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent\n */\nexport function findScrollableParent(element: HTMLElement): HTMLElement {\n let parent = getParentElement(element);\n\n while (parent && parent !== element.ownerDocument.documentElement) {\n const style = window.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 * Check if the element is visible within the container or in the viewport.\n * @param element The element to check.\n * @param container The container to check against, which must be the nearest scrollable ancestor.\n */\nexport function isElementVisibleInContainer(element: HTMLElement, container: HTMLElement): boolean {\n const elemRect = element.getBoundingClientRect();\n const documentWidth = element.ownerDocument.documentElement.clientWidth;\n const documentHeight = element.ownerDocument.documentElement.clientHeight;\n\n // Check if element is visible in viewport\n const isVisibleInViewport =\n elemRect.bottom > 0 && elemRect.top < documentHeight && elemRect.right > 0 && elemRect.left < documentWidth;\n\n // If container is the document element, only check viewport visibility\n if (container === element.ownerDocument.documentElement || container === element.ownerDocument.body) {\n return isVisibleInViewport;\n }\n\n // For other containers, check both container and viewport visibility\n const containerRect = container.getBoundingClientRect();\n const isVisibleInContainer =\n elemRect.bottom > containerRect.top &&\n elemRect.top < containerRect.bottom &&\n elemRect.right > containerRect.left &&\n elemRect.left < containerRect.right;\n\n return isVisibleInContainer && isVisibleInViewport;\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,WAAW,EAAC,MAAM,0BAA0B,CAAC;AAErD;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,KAAgC;IACtD,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,IAAI,CAAC;QACV,KAAK,MAAM,CAAC;QACZ,KAAK,CAAC,CAAC;QACP,KAAK,GAAG,CAAC;QACT,KAAK,IAAI,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Aa,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,EACtG,CAAC;oBACD,OAAO,MAAqB,CAAC;gBAC/B,CAAC;gBACD,MAAM;YACR,CAAC;YACD,KAAK,UAAU;gBACb,IAAI,WAAW,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;oBACtC,OAAO,MAAqB,CAAC;gBAC/B,CAAC;gBACD,MAAM;YACR,oGAAoG;YACpG,KAAK,UAAU,CAAC;YAChB,KAAK,QAAQ,CAAC;YACd,KAAK,QAAQ,CAAC,CAAC,CAAC;gBACd,MAAM,OAAO,GAAG,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;gBAExD,wDAAwD;gBACxD,IACE,OAAO,KAAK,OAAO;oBACnB,OAAO,KAAK,MAAM;oBAClB,OAAO,KAAK,MAAM;oBAClB,OAAO,KAAK,OAAO;oBACnB,OAAO,KAAK,WAAW;oBACvB,OAAO,KAAK,cAAc;oBAC1B,OAAO,KAAK,aAAa;oBACzB,OAAO,KAAK,aAAa,EACzB,CAAC;oBACD,OAAO,MAAqB,CAAC;gBAC/B,CAAC;gBAED,MAAM;YACR,CAAC;QACH,CAAC;QAED,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC;AAC/C,CAAC","sourcesContent":["import {ChildNode} from \"@stencil/core\";\nimport {Device, KeyboardCode} from \"../beans/index\";\nimport {Breakpoints} from \"../constants/breakpoints\";\n\n/**\n * Return boolean value for passed value if a boolean corresponding value is found\n * Return passed value otherwise\n */\nexport function boolean(value: string | number | boolean): boolean | string | number {\n switch (value) {\n case true:\n case \"true\":\n case 1:\n case \"1\":\n case \"on\":\n case \"yes\":\n return true;\n case false:\n case \"false\":\n case 0:\n case \"0\":\n case \"off\":\n case \"no\":\n return false;\n default:\n return value;\n }\n}\n\nexport function retrieveAsset(assetName: string): string {\n return assetName && \"assets/images/png/\" + assetName;\n}\n\nexport function randomId(): string {\n return Math.random().toString(36).replace(\"0.\", \"\");\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function handleKeyboardSubmit(ev: KeyboardEvent, callback: (...args) => void, ...args: any[]): void {\n if (ev.code === KeyboardCode.ENTER || ev.code === KeyboardCode.SPACE) {\n ev.preventDefault();\n callback(...args);\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function handleEnterKeydSubmit(ev: KeyboardEvent, callback: (...args) => void, ...args: any[]): void {\n if (ev.code === KeyboardCode.ENTER) {\n ev.preventDefault();\n callback(...args);\n }\n}\n\nexport function getClickedElement(elem: null | Element = null): null | Element {\n if (!elem) {\n elem = document.activeElement;\n }\n\n if (elem && elem.shadowRoot && elem.shadowRoot.activeElement) {\n elem = elem.shadowRoot.activeElement;\n\n return getClickedElement(elem);\n }\n\n return elem;\n}\n\nexport function getElementTree(elem: Element, tree: Element[] = []): null | Element[] {\n tree.push(elem);\n\n if (elem.parentElement) {\n elem = elem.parentElement;\n\n return getElementTree(elem, tree);\n } else if (elem.parentNode && (elem.parentNode as ShadowRoot).host) {\n elem = (elem.parentNode as ShadowRoot).host;\n\n return getElementTree(elem, tree);\n }\n\n return tree;\n}\n\nexport function getSiblings(elem: HTMLElement): ChildNode[] {\n const siblings = [];\n if (!elem || !elem.parentNode || !elem.parentNode.childNodes) {\n return siblings;\n }\n\n elem.parentNode.childNodes.forEach((child) => {\n if (child.nodeType === 1 && child !== elem) {\n siblings.push(child);\n }\n });\n\n return siblings;\n}\n\n/**\n * Get the current device type based on the window width.\n * @returns {Device} - The current device type\n */\nexport function getDevice(): Device {\n switch (true) {\n case window.innerWidth <= Breakpoints.MOBILE:\n return Device.MOBILE;\n case window.innerWidth <= Breakpoints.TABLET:\n return Device.TABLET;\n case window.innerWidth <= Breakpoints.DESKTOP:\n return Device.DESKTOP;\n default:\n return Device.DESKTOP_WIDE;\n }\n}\n\ntype JSONValue = string | number | boolean | JSONObject | JSONArray;\ninterface JSONObject {\n [x: string]: JSONValue;\n}\ntype JSONArray = JSONValue[];\n\nexport function convertJson(data: string): JSONValue {\n try {\n return JSON.parse(data);\n } catch {\n return false;\n }\n}\n\nexport function colorFromId(id: number): string {\n const prefix = \"avatar-C\"; // prefix for color vars name\n const colorsCount = 19; // available colors\n const seed = Math.ceil(2 ** 31 - 1) * parseFloat(`0.${id}`);\n let color = Math.ceil(colorsCount * (seed % 1));\n\n // if result of mc is 0\n // es.: 3895229\n if (color === 0) {\n color = 1;\n }\n\n return `${prefix}${color.toString().padStart(2, \"0\")}`;\n}\n\n/**\n * Check if the passed CSS selector is valid.\n * @param selector CSS selector to validate\n */\nexport function isSelectorValid(selector: string): boolean {\n try {\n document.createDocumentFragment().querySelector(selector);\n\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Check if an element contains another element, checking both light and shadow DOM.\n * @param ancestor Ancestor element\n * @param descendant Descendant element\n */\nexport function containsElement(ancestor: HTMLElement, descendant: Node): boolean {\n return ancestor.contains(descendant) || !!ancestor.shadowRoot?.contains(descendant);\n}\n\n/** Get the parent of passed element, accounting for shadow DOM.\n * @param element The element whose parent is to be found.\n */\nexport function getParentElement(element: Element): Element {\n if (element.parentNode === element.shadowRoot) {\n return element.shadowRoot.host;\n }\n\n if (element.parentNode instanceof ShadowRoot) {\n return element.parentNode.host;\n }\n\n return element.parentElement;\n}\n\n/**\n * Check if the `element` is visible within the `container` or in the viewport.\n * @param element The element to check.\n * @param container The container to check against, which must be the nearest scrollable ancestor.\n */\nexport function isElementVisibleInContainer(element: HTMLElement, container: HTMLElement): boolean {\n const elemRect = element.getBoundingClientRect();\n const documentWidth = element.ownerDocument.documentElement.clientWidth;\n const documentHeight = element.ownerDocument.documentElement.clientHeight;\n\n // Check if element is visible in viewport\n const isVisibleInViewport =\n elemRect.bottom > 0 && elemRect.top < documentHeight && elemRect.right > 0 && elemRect.left < documentWidth;\n\n // If container is the document element, only check viewport visibility\n if (container === element.ownerDocument.documentElement || container === element.ownerDocument.body) {\n return isVisibleInViewport;\n }\n\n // For other containers, check both container and viewport visibility\n const containerRect = container.getBoundingClientRect();\n const isVisibleInContainer =\n elemRect.bottom > containerRect.top &&\n elemRect.top < containerRect.bottom &&\n elemRect.right > containerRect.left &&\n elemRect.left < containerRect.right;\n\n return isVisibleInContainer && isVisibleInViewport;\n}\n\n/**\n * Find the nearest containing block ancestor of an element.\n * The containing block is determined based on the element's `position` value:\n * - `static`, `sticky` or `relative`: nearest block container or root\n * - `absolute`: nearest ancestor with `position` != `static`\n * - `fixed`: nearest ancestor with properties that create a containing block (`transform`, `filter`, `will-change`, `backdrop-filter`, `perspective`, etc.).\n * An ancestor with these properties will create a containing block for fixed positioned elements, making them behave like absolute positioned elements relative to that ancestor.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Display/Containing_block#identifying_the_containing_block\n * @param element The element for which to find the containing block\n * @returns The containing block element if any, or the `documentElement`\n */\nexport function findContainingBlockAncestor(element: HTMLElement): HTMLElement {\n let parent = getParentElement(element);\n const elementPosition = window.getComputedStyle(element).position;\n while (parent && parent !== element.ownerDocument.documentElement) {\n const parentStyle = window.getComputedStyle(parent);\n\n switch (elementPosition) {\n case \"fixed\": {\n const affectingProperties = [\n \"filter\",\n \"transform\",\n \"translate\",\n \"perspective\",\n \"scale\",\n \"rotate\",\n \"backdrop-filter\",\n ];\n if (\n affectingProperties.some((property) => parentStyle.getPropertyValue(property) !== \"none\") ||\n affectingProperties.some((property) => parentStyle.getPropertyValue(\"will-change\").includes(property))\n ) {\n return parent as HTMLElement;\n }\n break;\n }\n case \"absolute\":\n if (parentStyle.position !== \"static\") {\n return parent as HTMLElement;\n }\n break;\n // Handle position: static, relative, sticky (they all look for the nearest block container or root)\n case \"relative\":\n case \"sticky\":\n case \"static\": {\n const display = window.getComputedStyle(parent).display;\n\n // Block containers: block, flex, grid, table, flow-root\n if (\n display === \"block\" ||\n display === \"flex\" ||\n display === \"grid\" ||\n display === \"table\" ||\n display === \"flow-root\" ||\n display === \"inline-block\" ||\n display === \"inline-flex\" ||\n display === \"inline-grid\"\n ) {\n return parent as HTMLElement;\n }\n\n break;\n }\n }\n\n parent = getParentElement(parent);\n }\n\n return element.ownerDocument.documentElement;\n}\n"]}
@@ -26,7 +26,7 @@ const ZInputMessage = /*@__PURE__*/ proxyCustomElement(class ZInputMessage exten
26
26
  this.onMessageChange();
27
27
  }
28
28
  render() {
29
- return (h(Host, Object.assign({ key: '699a01ded83a2d58155aa15517407898cc85090e' }, this.statusRole, { "aria-label": this.message }), this.statusIcons[this.status] && this.message && h("z-icon", { key: '9205f3ab174eb8d7286df9edde0964a68ee6f600', name: this.statusIcons[this.status] }), h("span", { key: 'a80253cec8145ccfa30de68bf9d5a3ce152d6538', innerHTML: this.message })));
29
+ return (h(Host, Object.assign({ key: 'd3c9ebc08047c7dda297e667f0923025a123c218' }, this.statusRole), this.statusIcons[this.status] && this.message && h("z-icon", { key: 'fd12602621b437c130e82fe747e422fc98b3a87e', name: this.statusIcons[this.status] }), h("span", { key: 'b3af731acdef8e2c890789f158d9db68e426f798', innerHTML: this.message })));
30
30
  }
31
31
  static get watchers() { return {
32
32
  "message": ["onMessageChange"],
@@ -1 +1 @@
1
- {"file":"index13.js","mappings":";;;AAAA,MAAM,SAAS,GAAG,o7BAAo7B,CAAC;AACv8B,4BAAe,SAAS;;MCOX,aAAa;;;;;QAahB,gBAAW,GAAG;YACpB,OAAO,EAAE,kBAAkB;YAC3B,KAAK,EAAE,kBAAkB;YACzB,OAAO,EAAE,oBAAoB;SAC9B,CAAC;;;;0BAGW,EAAE;;IAIf,eAAe;QACb,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,GAAG,EAAC,IAAI,EAAE,OAAO,EAAC,GAAG,EAAE,CAAC;KACtE;IAED,iBAAiB;QACf,IAAI,CAAC,eAAe,EAAE,CAAC;KACxB;IAED,MAAM;QACJ,QACE,EAAC,IAAI,qEACC,IAAI,CAAC,UAAU,kBACP,IAAI,CAAC,OAAO,KAEvB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,IAAI,+DAAQ,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,GAAW,EACxG,6DAAM,SAAS,EAAE,IAAI,CAAC,OAAO,GAAI,CAC5B,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/z-input-message/styles.css?tag=z-input-message&encapsulation=shadow","src/components/z-input-message/index.tsx"],"sourcesContent":[":host {\n display: flex;\n min-height: calc(var(--space-unit) * 2.5);\n align-items: start;\n margin-top: var(--space-unit);\n color: var(--color-default-text);\n fill: currentcolor;\n font-family: var(--font-family-sans);\n font-size: var(--font-size-2);\n letter-spacing: 0.16px;\n}\n\n:host(.small),\n:host(.x-small) {\n margin-top: calc(var(--space-unit) * 0.5);\n font-size: var(--font-size-1);\n}\n\n:host([status=\"success\"]) {\n color: var(--color-hover-success);\n}\n\n:host([status=\"error\"]) {\n color: var(--color-hover-error);\n}\n\n:host([status=\"warning\"]) {\n color: var(--color-hover-warning);\n}\n\n:host(:focus) {\n outline: none;\n}\n\n:host > z-icon {\n --z-icon-width: calc(var(--space-unit) * 2);\n --z-icon-height: calc(var(--space-unit) * 2);\n --z-icon-right-margin: var(--space-unit);\n\n margin-top: calc(var(--space-unit) * 0.25);\n}\n\n:host(.small) > z-icon,\n:host(.x-small) > z-icon {\n --z-icon-width: 14px;\n --z-icon-height: 14px;\n --z-icon-right-margin: calc(var(--space-unit) * 0.5);\n}\n\n:host([disabled]) {\n color: var(--color-disabled03);\n fill: var(--color-disabled03);\n}\n","import {Component, Host, Prop, State, Watch, h} from \"@stencil/core\";\nimport {InputStatus} from \"../../beans\";\n\n@Component({\n tag: \"z-input-message\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZInputMessage {\n /** input helper message */\n @Prop()\n message: string;\n\n /** input status (optional) */\n @Prop({reflect: true})\n status?: InputStatus;\n\n /** input disabled status (optional) */\n @Prop({reflect: true})\n disabled?: boolean;\n\n private statusIcons = {\n success: \"checkmark-circle\",\n error: \"multiply-circled\",\n warning: \"exclamation-circle\",\n };\n\n @State()\n statusRole = {};\n\n @Watch(\"message\")\n @Watch(\"status\")\n onMessageChange(): void {\n this.statusRole = this.message && this.status ? {role: \"alert\"} : {};\n }\n\n componentWillLoad(): void {\n this.onMessageChange();\n }\n\n render(): HTMLZInputMessageElement {\n return (\n <Host\n {...this.statusRole}\n aria-label={this.message}\n >\n {this.statusIcons[this.status] && this.message && <z-icon name={this.statusIcons[this.status]}></z-icon>}\n <span innerHTML={this.message} />\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"index13.js","mappings":";;;AAAA,MAAM,SAAS,GAAG,o7BAAo7B,CAAC;AACv8B,4BAAe,SAAS;;MCOX,aAAa;;;;;QAahB,gBAAW,GAAG;YACpB,OAAO,EAAE,kBAAkB;YAC3B,KAAK,EAAE,kBAAkB;YACzB,OAAO,EAAE,oBAAoB;SAC9B,CAAC;;;;0BAGW,EAAE;;IAIf,eAAe;QACb,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,GAAG,EAAC,IAAI,EAAE,OAAO,EAAC,GAAG,EAAE,CAAC;KACtE;IAED,iBAAiB;QACf,IAAI,CAAC,eAAe,EAAE,CAAC;KACxB;IAED,MAAM;QACJ,QACE,EAAC,IAAI,qEAAK,IAAI,CAAC,UAAU,GACtB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,IAAI,+DAAQ,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,GAAW,EACxG,6DAAM,SAAS,EAAE,IAAI,CAAC,OAAO,GAAI,CAC5B,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/z-input-message/styles.css?tag=z-input-message&encapsulation=shadow","src/components/z-input-message/index.tsx"],"sourcesContent":[":host {\n display: flex;\n min-height: calc(var(--space-unit) * 2.5);\n align-items: start;\n margin-top: var(--space-unit);\n color: var(--color-default-text);\n fill: currentcolor;\n font-family: var(--font-family-sans);\n font-size: var(--font-size-2);\n letter-spacing: 0.16px;\n}\n\n:host(.small),\n:host(.x-small) {\n margin-top: calc(var(--space-unit) * 0.5);\n font-size: var(--font-size-1);\n}\n\n:host([status=\"success\"]) {\n color: var(--color-hover-success);\n}\n\n:host([status=\"error\"]) {\n color: var(--color-hover-error);\n}\n\n:host([status=\"warning\"]) {\n color: var(--color-hover-warning);\n}\n\n:host(:focus) {\n outline: none;\n}\n\n:host > z-icon {\n --z-icon-width: calc(var(--space-unit) * 2);\n --z-icon-height: calc(var(--space-unit) * 2);\n --z-icon-right-margin: var(--space-unit);\n\n margin-top: calc(var(--space-unit) * 0.25);\n}\n\n:host(.small) > z-icon,\n:host(.x-small) > z-icon {\n --z-icon-width: 14px;\n --z-icon-height: 14px;\n --z-icon-right-margin: calc(var(--space-unit) * 0.5);\n}\n\n:host([disabled]) {\n color: var(--color-disabled03);\n fill: var(--color-disabled03);\n}\n","import {Component, Host, Prop, State, Watch, h} from \"@stencil/core\";\nimport {InputStatus} from \"../../beans\";\n\n@Component({\n tag: \"z-input-message\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZInputMessage {\n /** input helper message */\n @Prop()\n message: string;\n\n /** input status (optional) */\n @Prop({reflect: true})\n status?: InputStatus;\n\n /** input disabled status (optional) */\n @Prop({reflect: true})\n disabled?: boolean;\n\n private statusIcons = {\n success: \"checkmark-circle\",\n error: \"multiply-circled\",\n warning: \"exclamation-circle\",\n };\n\n @State()\n statusRole = {};\n\n @Watch(\"message\")\n @Watch(\"status\")\n onMessageChange(): void {\n this.statusRole = this.message && this.status ? {role: \"alert\"} : {};\n }\n\n componentWillLoad(): void {\n this.onMessageChange();\n }\n\n render(): HTMLZInputMessageElement {\n return (\n <Host {...this.statusRole}>\n {this.statusIcons[this.status] && this.message && <z-icon name={this.statusIcons[this.status]}></z-icon>}\n <span innerHTML={this.message} />\n </Host>\n );\n }\n}\n"],"version":3}
@@ -16,8 +16,6 @@ const ZListGroup = /*@__PURE__*/ proxyCustomElement(class ZListGroup extends HTM
16
16
  this.dividerColor = "gray200";
17
17
  this.listType = ListType.NONE;
18
18
  this.hasTreeItems = undefined;
19
- this.role = "group";
20
- this.ariaLabelledby = undefined;
21
19
  }
22
20
  componentDidLoad() {
23
21
  const children = this.host.children;
@@ -36,11 +34,11 @@ const ZListGroup = /*@__PURE__*/ proxyCustomElement(class ZListGroup extends HTM
36
34
  this.hasHeader = !!this.host.querySelector('[slot="header-title"]');
37
35
  }
38
36
  render() {
39
- return (h(Host, { key: 'a38ad7b14163e15a94476bfc9398933dff5dd465', role: this.role, "aria-labelledby": this.ariaLabelledby }, h("div", { key: '1f8da0318208cc93c6732a87031e2cdb15dc2333', class: {
37
+ return (h(Host, { key: '1e3229205e55482b92dc8d0a972d9f9e1805ba56', role: "group" }, h("div", { key: 'ede88ef3d1845e0c432b7a00b8f9dc959ce258e6', class: {
40
38
  "z-list-group-header-container": true,
41
39
  "has-header": this.hasHeader && !this.hasTreeItems,
42
40
  "grouped-tree-list-header": this.hasTreeItems,
43
- } }, h("slot", { key: '10e4cbf3b3597c4e99f73aeb28163290d5d47e0c', name: "header-title" }), this.dividerType === ListDividerType.HEADER && (h("z-divider", { key: '3d11a05b47a0a6d30d744b06a372da989187058c', color: this.dividerColor, size: this.dividerSize }))), h("slot", { key: 'f36fa8a083eab57628b5b12090a6c18414c19afe' })));
41
+ } }, h("slot", { key: 'd6c2cef7568424ebab1ae5d3dc572d4bc2aba61c', name: "header-title" }), this.dividerType === ListDividerType.HEADER && (h("z-divider", { key: '5e45b81c54db4f623d366e62817f2a60ede8fa19', color: this.dividerColor, size: this.dividerSize }))), h("slot", { key: '2a1a7ad0e3f8b56dd4880b8215ab79bd27981804' })));
44
42
  }
45
43
  get host() { return this; }
46
44
  static get style() { return ZListGroupStyle0; }
@@ -50,9 +48,7 @@ const ZListGroup = /*@__PURE__*/ proxyCustomElement(class ZListGroup extends HTM
50
48
  "dividerSize": [513, "divider-size"],
51
49
  "dividerColor": [513, "divider-color"],
52
50
  "listType": [513, "list-type"],
53
- "hasTreeItems": [4, "has-tree-items"],
54
- "role": [513],
55
- "ariaLabelledby": [513, "aria-labelledby"]
51
+ "hasTreeItems": [4, "has-tree-items"]
56
52
  }]);
57
53
  function defineCustomElement() {
58
54
  if (typeof customElements === "undefined") {
@@ -1 +1 @@
1
- {"file":"index16.js","mappings":";;;;AAAA,MAAM,SAAS,GAAG,uiBAAuiB,CAAC;AAC1jB,yBAAe,SAAS;;MCOX,UAAU;;;;;oBAOH,QAAQ,CAAC,MAAM;2BAMD,eAAe,CAAC,IAAI;2BAMxB,WAAW,CAAC,KAAK;4BAMrB,SAAS;wBAMX,QAAQ,CAAC,IAAI;;oBAY5B,OAAO;;;IAUd,gBAAgB;QACd,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;QACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACxC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,EAAE;gBAC3B,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,cAAc,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;gBAC3D,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,cAAc,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;gBAC3D,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,eAAe,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;aAC9D;YACD,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YAC5C,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrD,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,uBAAuB,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;SACjE;KACF;IAED,iBAAiB;QACf,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC;KACrE;IAED,MAAM;QACJ,QACE,EAAC,IAAI,qDACH,IAAI,EAAE,IAAI,CAAC,IAAI,qBACE,IAAI,CAAC,cAAc,IAEpC,4DACE,KAAK,EAAE;gBACL,+BAA+B,EAAE,IAAI;gBACrC,YAAY,EAAE,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,YAAY;gBAClD,0BAA0B,EAAE,IAAI,CAAC,YAAY;aAC9C,IAED,6DAAM,IAAI,EAAC,cAAc,GAAG,EAC3B,IAAI,CAAC,WAAW,KAAK,eAAe,CAAC,MAAM,KAC1C,kEACE,KAAK,EAAE,IAAI,CAAC,YAAY,EACxB,IAAI,EAAE,IAAI,CAAC,WAAW,GACtB,CACH,CACG,EACN,8DAAQ,CACH,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/list/z-list-group/styles.css?tag=z-list-group&encapsulation=shadow","src/components/list/z-list-group/index.tsx"],"sourcesContent":[":host {\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n}\n\n:host > .z-list-group-header-container {\n color: var(--gray700);\n font-size: var(--font-size-2);\n font-weight: var(--font-sb) !important;\n letter-spacing: 0.16px;\n line-height: 1.4;\n}\n\n:host > .z-list-group-header-container.has-header {\n padding-top: calc(var(--space-unit) * 1.5);\n padding-bottom: var(--space-unit);\n}\n\n:host > .z-list-group-header-container.has-header > z-divider {\n margin-top: var(--space-unit);\n}\n\n:host > .grouped-tree-list-header {\n padding-top: calc(var(--space-unit) * 1.5);\n padding-bottom: var(--space-unit);\n}\n","import {Component, Element, h, Host, Prop} from \"@stencil/core\";\nimport {DividerSize, ListDividerType, ListSize, ListType} from \"../../../beans\";\n\n@Component({\n tag: \"z-list-group\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZListGroup {\n @Element() host: HTMLZListGroupElement;\n\n /**\n * [optional] Sets size of inside elements.\n */\n @Prop({reflect: true})\n size?: ListSize = ListSize.MEDIUM;\n\n /**\n * [optional] Sets the position where to insert the divider.\n */\n @Prop({reflect: true})\n dividerType?: ListDividerType = ListDividerType.NONE;\n\n /**\n * [optional] Sets the divider size.\n */\n @Prop({reflect: true})\n dividerSize?: DividerSize = DividerSize.SMALL;\n\n /**\n * [optional] Sets the divider color.\n */\n @Prop({reflect: true})\n dividerColor?: string = \"gray200\";\n\n /**\n * [optional] type of the list marker for each element\n */\n @Prop({reflect: true})\n listType?: ListType = ListType.NONE;\n\n /**\n * [optional] check for tree items in grouped lists\n */\n @Prop()\n hasTreeItems?: boolean;\n\n /**\n * Sets element role.\n */\n @Prop({reflect: true})\n role = \"group\";\n\n /**\n * [optional] Sets aria-labelledby attribute\n */\n @Prop({reflect: true})\n ariaLabelledby?: string;\n\n private hasHeader: boolean;\n\n componentDidLoad(): void {\n const children = this.host.children;\n for (let i = 0; i < children.length; i++) {\n if (children.length - 1 > i) {\n children[i].setAttribute(\"divider-type\", this.dividerType);\n children[i].setAttribute(\"divider-size\", this.dividerSize);\n children[i].setAttribute(\"divider-color\", this.dividerColor);\n }\n children[i].setAttribute(\"size\", this.size);\n children[i].setAttribute(\"list-type\", this.listType);\n children[i].setAttribute(\"list-element-position\", i.toString());\n }\n }\n\n componentWillLoad(): void {\n this.hasHeader = !!this.host.querySelector('[slot=\"header-title\"]');\n }\n\n render(): HTMLZListGroupElement {\n return (\n <Host\n role={this.role}\n aria-labelledby={this.ariaLabelledby}\n >\n <div\n class={{\n \"z-list-group-header-container\": true,\n \"has-header\": this.hasHeader && !this.hasTreeItems,\n \"grouped-tree-list-header\": this.hasTreeItems,\n }}\n >\n <slot name=\"header-title\" />\n {this.dividerType === ListDividerType.HEADER && (\n <z-divider\n color={this.dividerColor}\n size={this.dividerSize}\n />\n )}\n </div>\n <slot />\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"index16.js","mappings":";;;;AAAA,MAAM,SAAS,GAAG,uiBAAuiB,CAAC;AAC1jB,yBAAe,SAAS;;MCOX,UAAU;;;;;oBAOH,QAAQ,CAAC,MAAM;2BAMD,eAAe,CAAC,IAAI;2BAMxB,WAAW,CAAC,KAAK;4BAMrB,SAAS;wBAMX,QAAQ,CAAC,IAAI;;;IAUnC,gBAAgB;QACd,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;QACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACxC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,EAAE;gBAC3B,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,cAAc,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;gBAC3D,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,cAAc,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;gBAC3D,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,eAAe,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;aAC9D;YACD,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YAC5C,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrD,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,uBAAuB,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;SACjE;KACF;IAED,iBAAiB;QACf,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC;KACrE;IAED,MAAM;QACJ,QACE,EAAC,IAAI,qDAAC,IAAI,EAAC,OAAO,IAChB,4DACE,KAAK,EAAE;gBACL,+BAA+B,EAAE,IAAI;gBACrC,YAAY,EAAE,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,YAAY;gBAClD,0BAA0B,EAAE,IAAI,CAAC,YAAY;aAC9C,IAED,6DAAM,IAAI,EAAC,cAAc,GAAG,EAC3B,IAAI,CAAC,WAAW,KAAK,eAAe,CAAC,MAAM,KAC1C,kEACE,KAAK,EAAE,IAAI,CAAC,YAAY,EACxB,IAAI,EAAE,IAAI,CAAC,WAAW,GACtB,CACH,CACG,EACN,8DAAQ,CACH,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/list/z-list-group/styles.css?tag=z-list-group&encapsulation=shadow","src/components/list/z-list-group/index.tsx"],"sourcesContent":[":host {\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n}\n\n:host > .z-list-group-header-container {\n color: var(--gray700);\n font-size: var(--font-size-2);\n font-weight: var(--font-sb) !important;\n letter-spacing: 0.16px;\n line-height: 1.4;\n}\n\n:host > .z-list-group-header-container.has-header {\n padding-top: calc(var(--space-unit) * 1.5);\n padding-bottom: var(--space-unit);\n}\n\n:host > .z-list-group-header-container.has-header > z-divider {\n margin-top: var(--space-unit);\n}\n\n:host > .grouped-tree-list-header {\n padding-top: calc(var(--space-unit) * 1.5);\n padding-bottom: var(--space-unit);\n}\n","import {Component, Element, h, Host, Prop} from \"@stencil/core\";\nimport {DividerSize, ListDividerType, ListSize, ListType} from \"../../../beans\";\n\n@Component({\n tag: \"z-list-group\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZListGroup {\n @Element() host: HTMLZListGroupElement;\n\n /**\n * [optional] Sets size of inside elements.\n */\n @Prop({reflect: true})\n size?: ListSize = ListSize.MEDIUM;\n\n /**\n * [optional] Sets the position where to insert the divider.\n */\n @Prop({reflect: true})\n dividerType?: ListDividerType = ListDividerType.NONE;\n\n /**\n * [optional] Sets the divider size.\n */\n @Prop({reflect: true})\n dividerSize?: DividerSize = DividerSize.SMALL;\n\n /**\n * [optional] Sets the divider color.\n */\n @Prop({reflect: true})\n dividerColor?: string = \"gray200\";\n\n /**\n * [optional] type of the list marker for each element\n */\n @Prop({reflect: true})\n listType?: ListType = ListType.NONE;\n\n /**\n * [optional] check for tree items in grouped lists\n */\n @Prop()\n hasTreeItems?: boolean;\n\n private hasHeader: boolean;\n\n componentDidLoad(): void {\n const children = this.host.children;\n for (let i = 0; i < children.length; i++) {\n if (children.length - 1 > i) {\n children[i].setAttribute(\"divider-type\", this.dividerType);\n children[i].setAttribute(\"divider-size\", this.dividerSize);\n children[i].setAttribute(\"divider-color\", this.dividerColor);\n }\n children[i].setAttribute(\"size\", this.size);\n children[i].setAttribute(\"list-type\", this.listType);\n children[i].setAttribute(\"list-element-position\", i.toString());\n }\n }\n\n componentWillLoad(): void {\n this.hasHeader = !!this.host.querySelector('[slot=\"header-title\"]');\n }\n\n render(): HTMLZListGroupElement {\n return (\n <Host role=\"group\">\n <div\n class={{\n \"z-list-group-header-container\": true,\n \"has-header\": this.hasHeader && !this.hasTreeItems,\n \"grouped-tree-list-header\": this.hasTreeItems,\n }}\n >\n <slot name=\"header-title\" />\n {this.dividerType === ListDividerType.HEADER && (\n <z-divider\n color={this.dividerColor}\n size={this.dividerSize}\n />\n )}\n </div>\n <slot />\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,8 +1,8 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
2
  import { P as PopoverPosition, g as KeyboardCode, p as Device } from './index2.js';
3
- import { a as containsElement, i as findScrollableParent, g as getDevice, j as isElementVisibleInContainer } from './utils.js';
3
+ import { a as containsElement, i as getParentElement, j as findContainingBlockAncestor, g as getDevice, k as isElementVisibleInContainer } from './utils.js';
4
4
 
5
- const stylesCss = ":host{position:fixed;display:none;max-width:calc(100% - var(--grid-margin) * 2);max-height:calc(100% - var(--grid-margin) * 2);padding:var(--z-popover-padding, 0);background:var(--z-popover-theme--surface, var(--color-surface01));border-radius:var(--border-radius-small);color:var(--z-popover-theme--text, var(--color-default-text));fill:currentcolor;filter:var(--z-popover-shadow-filter, drop-shadow(0 1px 2px var(--shadow-color-base)));text-align:center;visibility:hidden;}:host([open]:not([open=\"false\"])[current-position]){display:block}:host([center][current-position=\"top\"]),:host([center][current-position=\"bottom\"]){transform:translateX(-50%)}:host([center][current-position=\"right\"]),:host([center][current-position=\"left\"]){transform:translateY(-50%)}:host([current-position^=\"top\"]){margin:0 0 var(--space-unit)}:host([current-position^=\"bottom\"]){margin:var(--space-unit) 0 0}:host([current-position^=\"left\"]){margin:0 var(--space-unit) 0 0}:host([current-position^=\"right\"]){margin:0 0 0 var(--space-unit)}:host([current-position])::before{--arrow-size:6px;--arrow-edge-offset:calc(100% - var(--space-unit) - (var(--arrow-size) / 2));--arrow-center-x-offset:calc(50% - (var(--arrow-size) / 2));--arrow-center-y-offset:calc(100% - (var(--arrow-size) / 2));position:absolute;display:block;width:var(--arrow-size);height:var(--arrow-size);background:var(--z-popover-theme--surface, var(--color-surface01));content:\"\";transform:rotate(45deg)}:host([show-arrow=\"false\"])::before,:host(:not([show-arrow]))::before{display:none}:host([current-position^=\"top\"])::before{top:var(--arrow-center-y-offset)}:host([current-position^=\"bottom\"])::before{bottom:var(--arrow-center-y-offset)}:host([current-position=\"top\"])::before,:host([current-position=\"bottom\"])::before{right:var(--arrow-edge-offset)}:host([current-position=\"right\"])::before,:host([current-position=\"left\"])::before{bottom:var(--arrow-edge-offset)}:host([current-position=\"right\"])::before{right:var(--arrow-center-y-offset)}:host([current-position=\"left\"])::before{left:var(--arrow-center-y-offset)}:host([current-position=\"top_right\"])::before,:host([current-position=\"bottom_right\"])::before{right:var(--arrow-edge-offset)}:host([current-position=\"top_left\"])::before,:host([current-position=\"bottom_left\"])::before{left:var(--arrow-edge-offset)}:host([current-position=\"right_top\"])::before,:host([current-position=\"left_top\"])::before{top:var(--arrow-edge-offset)}:host([current-position=\"right_top\"])::before,:host([current-position=\"right_bottom\"])::before{right:var(--arrow-center-y-offset)}:host([current-position=\"left_top\"])::before,:host([current-position=\"left_bottom\"])::before{left:var(--arrow-center-y-offset)}:host([current-position=\"right_bottom\"])::before,:host([current-position=\"left_bottom\"])::before{bottom:var(--arrow-edge-offset)}:host([center][current-position=\"top\"])::before,:host([center][current-position=\"bottom\"])::before{right:auto;left:var(--arrow-center-x-offset)}:host([center][current-position=\"right\"])::before,:host([center][current-position=\"left\"])::before{top:var(--arrow-center-x-offset);bottom:auto}";
5
+ const stylesCss = ":host{position:fixed;display:none;max-width:calc(100% - var(--grid-margin) * 2);max-height:calc(100% - var(--grid-margin) * 2);padding:var(--z-popover-padding, 0);background:var(--z-popover-theme--surface, var(--color-surface01));border-radius:var(--border-radius-small);color:var(--z-popover-theme--text, var(--color-default-text));fill:currentcolor;filter:var(--z-popover-shadow-filter, drop-shadow(0 1px 2px var(--shadow-color-base)));text-align:center;visibility:hidden;}:host([open]:not([open=\"false\"])[current-position]){display:block}:host([center][current-position=\"top\"]),:host([center][current-position=\"bottom\"]){transform:translateX(-50%)}:host([center][current-position=\"right\"]),:host([center][current-position=\"left\"]){transform:translateY(-50%)}:host([current-position])::before{--arrow-size:6px;--arrow-edge-offset:calc(100% - var(--space-unit) - (var(--arrow-size) / 2));--arrow-center-x-offset:calc(50% - (var(--arrow-size) / 2));--arrow-center-y-offset:calc(100% - (var(--arrow-size) / 2));position:absolute;display:block;width:var(--arrow-size);height:var(--arrow-size);background:var(--z-popover-theme--surface, var(--color-surface01));content:\"\";transform:rotate(45deg)}:host([show-arrow=\"false\"])::before,:host(:not([show-arrow]))::before{display:none}:host([current-position^=\"top\"])::before{top:var(--arrow-center-y-offset)}:host([current-position^=\"bottom\"])::before{bottom:var(--arrow-center-y-offset)}:host([current-position=\"top\"])::before,:host([current-position=\"bottom\"])::before{right:var(--arrow-edge-offset)}:host([current-position=\"right\"])::before,:host([current-position=\"left\"])::before{bottom:var(--arrow-edge-offset)}:host([current-position=\"right\"])::before{right:var(--arrow-center-y-offset)}:host([current-position=\"left\"])::before{left:var(--arrow-center-y-offset)}:host([current-position=\"top_right\"])::before,:host([current-position=\"bottom_right\"])::before{right:var(--arrow-edge-offset)}:host([current-position=\"top_left\"])::before,:host([current-position=\"bottom_left\"])::before{left:var(--arrow-edge-offset)}:host([current-position=\"right_top\"])::before,:host([current-position=\"left_top\"])::before{top:var(--arrow-edge-offset)}:host([current-position=\"right_top\"])::before,:host([current-position=\"right_bottom\"])::before{right:var(--arrow-center-y-offset)}:host([current-position=\"left_top\"])::before,:host([current-position=\"left_bottom\"])::before{left:var(--arrow-center-y-offset)}:host([current-position=\"right_bottom\"])::before,:host([current-position=\"left_bottom\"])::before{bottom:var(--arrow-edge-offset)}:host([center][current-position=\"top\"])::before,:host([center][current-position=\"bottom\"])::before{right:auto;left:var(--arrow-center-x-offset)}:host([center][current-position=\"right\"])::before,:host([center][current-position=\"left\"])::before{top:var(--arrow-center-x-offset);bottom:auto}";
6
6
  const ZPopoverStyle0 = stylesCss;
7
7
 
8
8
  const ZPopover = /*@__PURE__*/ proxyCustomElement(class ZPopover extends HTMLElement {
@@ -99,7 +99,11 @@ const ZPopover = /*@__PURE__*/ proxyCustomElement(class ZPopover extends HTMLEle
99
99
  this.boundElement = this.bindTo;
100
100
  }
101
101
  else {
102
- this.boundElement = this.host.parentElement;
102
+ this.boundElement = getParentElement(this.host);
103
+ if (this.boundElement.tagName.toLowerCase() === "z-tooltip") {
104
+ // If the popover is used inside a tooltip without a specified `bindTo`, bind it to the parent of the tooltip.
105
+ this.boundElement = getParentElement(this.boundElement);
106
+ }
103
107
  }
104
108
  }
105
109
  /**
@@ -240,6 +244,28 @@ const ZPopover = /*@__PURE__*/ proxyCustomElement(class ZPopover extends HTMLEle
240
244
  // Return a combined position (e.g., "bottom_right")
241
245
  return `${mainDirection}_${secondaryDirection}`;
242
246
  }
247
+ /**
248
+ * Find the nearest scrollable ancestor of an element to take as a reference for positioning.
249
+ * 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.
250
+ */
251
+ findScrollableAncestor(element) {
252
+ let parent = getParentElement(element);
253
+ while (parent) {
254
+ if (parent === element.ownerDocument.documentElement) {
255
+ return parent;
256
+ }
257
+ const style = window.getComputedStyle(parent);
258
+ const { overflow, overflowX, overflowY } = style;
259
+ const hasHiddenOverflow = overflow === "hidden" || overflowY === "hidden" || overflowX === "hidden";
260
+ const isScrollable = (parent.scrollHeight > parent.clientHeight && overflow !== "visible" && overflowY !== "visible") ||
261
+ (parent.scrollWidth > parent.clientWidth && overflow !== "visible" && overflowX !== "visible");
262
+ if (!hasHiddenOverflow && isScrollable) {
263
+ return parent;
264
+ }
265
+ parent = getParentElement(parent);
266
+ }
267
+ return element.ownerDocument.documentElement;
268
+ }
243
269
  /**
244
270
  * Calculate available space around the element bound with the popover, based on its nearest scrollable ancestor.
245
271
  *
@@ -259,19 +285,19 @@ const ZPopover = /*@__PURE__*/ proxyCustomElement(class ZPopover extends HTMLEle
259
285
  return this.cachedAvailableSpace;
260
286
  }
261
287
  this.lastBoundRect = boundElementRect;
262
- const scrollableParent = findScrollableParent(this.boundElement);
263
- const scrollableParentRect = scrollableParent.getBoundingClientRect();
264
- const hasNestedScrollableParent = scrollableParent !== this.boundElement.ownerDocument.documentElement;
288
+ const scrollableAncestor = this.findScrollableAncestor(this.boundElement);
289
+ const scrollableAncestorRect = scrollableAncestor.getBoundingClientRect();
290
+ const isScrollableAncestorNested = scrollableAncestor !== this.boundElement.ownerDocument.documentElement;
265
291
  const documentWidth = this.boundElement.ownerDocument.documentElement.clientWidth;
266
292
  const documentHeight = this.boundElement.ownerDocument.documentElement.clientHeight;
267
293
  const safeSpace = 8; // extra space to avoid popover being too close to the edges
268
- // These deltas represent the offset between the scrollable parent and the viewport.
269
- // They are used to adjust the available space calculations when the scrollable parent is not the document or body,
270
- // to try to fit the popover inside the scrollable parent.
271
- const deltaTop = hasNestedScrollableParent ? scrollableParentRect.top : 0;
272
- const deltaRight = hasNestedScrollableParent ? documentWidth - scrollableParentRect.right : 0;
273
- const deltaBottom = hasNestedScrollableParent ? documentHeight - scrollableParentRect.bottom : 0;
274
- const deltaLeft = hasNestedScrollableParent ? scrollableParentRect.left : 0;
294
+ // These deltas represent the offset between the scrollable ancestor and the viewport.
295
+ // They are used to adjust the available space calculations when the scrollable ancestor is not the document or body,
296
+ // to try to fit the popover inside the scrollable ancestor.
297
+ const deltaTop = isScrollableAncestorNested ? scrollableAncestorRect.top : 0;
298
+ const deltaRight = isScrollableAncestorNested ? documentWidth - scrollableAncestorRect.right : 0;
299
+ const deltaBottom = isScrollableAncestorNested ? documentHeight - scrollableAncestorRect.bottom : 0;
300
+ const deltaLeft = isScrollableAncestorNested ? scrollableAncestorRect.left : 0;
275
301
  this.cachedAvailableSpace = {
276
302
  top: boundElementRect.top - deltaTop - safeSpace,
277
303
  right: documentWidth - boundElementRect.right - deltaRight - safeSpace,
@@ -280,66 +306,109 @@ const ZPopover = /*@__PURE__*/ proxyCustomElement(class ZPopover extends HTMLEle
280
306
  };
281
307
  return this.cachedAvailableSpace;
282
308
  }
283
- /** Calculate the space around an element relative to the viewport. */
284
- calculateElementOffsets(element) {
285
- const elementRect = element.getBoundingClientRect();
286
- const viewportWidth = element.ownerDocument.documentElement.clientWidth;
287
- const viewportHeight = element.ownerDocument.documentElement.clientHeight;
309
+ /** Calculate the space around the bound element relative to the viewport. */
310
+ getBoundElementOffsets() {
311
+ const elementRect = this.boundElement.getBoundingClientRect();
312
+ const documentWidth = this.boundElement.ownerDocument.documentElement.clientWidth;
313
+ const documentHeight = this.boundElement.ownerDocument.documentElement.clientHeight;
288
314
  return {
289
315
  top: elementRect.top,
290
- right: viewportWidth - elementRect.right,
291
- bottom: viewportHeight - elementRect.bottom,
316
+ right: documentWidth - elementRect.right,
317
+ bottom: documentHeight - elementRect.bottom,
292
318
  left: elementRect.left,
293
319
  };
294
320
  }
295
- /** Apply positioning styles based on passed position. */
321
+ /** Compute positioning offsets in the appropriate coordinate space, accounting for transformed containing blocks and scroll. */
322
+ computePositionOffsets() {
323
+ const boundElementOffsets = this.getBoundElementOffsets();
324
+ const containingBlockAncestor = findContainingBlockAncestor(this.host);
325
+ const isDocumentElement = containingBlockAncestor === this.host.ownerDocument.documentElement;
326
+ if (isDocumentElement) {
327
+ return boundElementOffsets;
328
+ }
329
+ const containingBlockRect = containingBlockAncestor.getBoundingClientRect();
330
+ const containingBlockStyle = getComputedStyle(containingBlockAncestor);
331
+ /** Padding box of the containing block, accounting for borders. */
332
+ const paddingBox = {
333
+ top: containingBlockRect.top + parseFloat(containingBlockStyle.borderTopWidth),
334
+ right: containingBlockRect.right - parseFloat(containingBlockStyle.borderRightWidth),
335
+ bottom: containingBlockRect.bottom - parseFloat(containingBlockStyle.borderBottomWidth),
336
+ left: containingBlockRect.left + parseFloat(containingBlockStyle.borderLeftWidth),
337
+ };
338
+ const boundElementRect = this.boundElement.getBoundingClientRect();
339
+ /** Bound element offsets relative to the containing block padding box. */
340
+ const relativeOffsets = {
341
+ top: boundElementRect.top - paddingBox.top,
342
+ right: paddingBox.right - boundElementRect.right,
343
+ bottom: paddingBox.bottom - boundElementRect.bottom,
344
+ left: boundElementRect.left - paddingBox.left,
345
+ };
346
+ /** Account for scroll to keep the popover aligned while the containing block scrolls. */
347
+ return {
348
+ top: relativeOffsets.top + containingBlockAncestor.scrollTop,
349
+ right: relativeOffsets.right - containingBlockAncestor.scrollLeft,
350
+ bottom: relativeOffsets.bottom - containingBlockAncestor.scrollTop,
351
+ left: relativeOffsets.left + containingBlockAncestor.scrollLeft,
352
+ };
353
+ }
354
+ /** Apply positioning styles based on `position` parameter. */
296
355
  applyPositionStyles(position, availableSpace) {
297
356
  const boundElementWidth = this.boundElement.offsetWidth;
298
357
  const boundElementHeight = this.boundElement.offsetHeight;
299
- /** Distance between the popover and the bound element */
300
- const distanceFromBound = 8;
301
358
  const offsetModifier = this.offsetModifier;
302
359
  /** Distance between the arrow center and the popover edge. Needed to align the center of the arrow with the center of the bound element when `showArrow` and `center` are enabled. */
303
360
  const arrowModifier = this.showArrow && this.center ? 8 : 0;
304
361
  const hostStyle = this.host.style;
305
- const boundElementOffsets = this.calculateElementOffsets(this.boundElement);
362
+ /** Gap between the popover and the bound element. */
363
+ const distanceFromBound = parseInt(hostStyle.getPropertyValue("--space-unit")) || 8;
364
+ const positionOffsets = this.computePositionOffsets();
365
+ /**
366
+ * Precomputed bases to reduce repeated arithmetic in the switch below.
367
+ * They represent the bound element edges plus optional centering offsets.
368
+ */
369
+ const leftBase = positionOffsets.left + boundElementWidth * offsetModifier;
370
+ const rightBase = positionOffsets.right + boundElementWidth * offsetModifier;
371
+ const topBase = positionOffsets.top + boundElementHeight;
372
+ const bottomBase = positionOffsets.bottom + boundElementHeight;
373
+ const sideTopBase = positionOffsets.top + boundElementHeight * offsetModifier;
374
+ const sideBottomBase = positionOffsets.bottom + boundElementHeight * offsetModifier;
306
375
  let maxWidth;
307
376
  let maxHeight;
308
377
  switch (position) {
309
378
  case PopoverPosition.TOP:
310
379
  case PopoverPosition.TOP_RIGHT:
311
- hostStyle.bottom = `${boundElementOffsets.bottom + boundElementHeight}px`;
312
- hostStyle.left = `${boundElementOffsets.left + boundElementWidth * offsetModifier - (position === PopoverPosition.TOP_RIGHT ? arrowModifier : 0)}px`;
380
+ hostStyle.bottom = `${bottomBase + distanceFromBound}px`;
381
+ hostStyle.left = `${leftBase - (position === PopoverPosition.TOP_RIGHT ? arrowModifier : 0)}px`;
313
382
  maxHeight = availableSpace.top - distanceFromBound;
314
383
  if (position === PopoverPosition.TOP_RIGHT) {
315
384
  maxWidth = availableSpace.right + boundElementWidth * offsetModifier;
316
385
  }
317
386
  break;
318
387
  case PopoverPosition.TOP_LEFT:
319
- hostStyle.right = `${boundElementOffsets.right + boundElementWidth * offsetModifier - arrowModifier}px`;
320
- hostStyle.bottom = `${boundElementOffsets.bottom + boundElementHeight}px`;
388
+ hostStyle.right = `${rightBase - arrowModifier}px`;
389
+ hostStyle.bottom = `${bottomBase + distanceFromBound}px`;
321
390
  maxWidth = availableSpace.left + boundElementWidth * offsetModifier;
322
391
  maxHeight = availableSpace.top - distanceFromBound;
323
392
  break;
324
393
  case PopoverPosition.BOTTOM:
325
394
  case PopoverPosition.BOTTOM_RIGHT:
326
- hostStyle.top = `${boundElementOffsets.top + boundElementHeight}px`;
327
- hostStyle.left = `${boundElementOffsets.left + boundElementWidth * offsetModifier - (position === PopoverPosition.BOTTOM_RIGHT ? arrowModifier : 0)}px`;
395
+ hostStyle.top = `${topBase + distanceFromBound}px`;
396
+ hostStyle.left = `${leftBase - (position === PopoverPosition.BOTTOM_RIGHT ? arrowModifier : 0)}px`;
328
397
  maxHeight = availableSpace.bottom - distanceFromBound;
329
398
  if (position === PopoverPosition.BOTTOM_RIGHT) {
330
399
  maxWidth = availableSpace.right + boundElementWidth * offsetModifier;
331
400
  }
332
401
  break;
333
402
  case PopoverPosition.BOTTOM_LEFT:
334
- hostStyle.top = `${boundElementOffsets.top + boundElementHeight}px`;
335
- hostStyle.right = `${boundElementOffsets.right + boundElementWidth * offsetModifier - arrowModifier}px`;
403
+ hostStyle.top = `${topBase + distanceFromBound}px`;
404
+ hostStyle.right = `${rightBase - arrowModifier}px`;
336
405
  maxWidth = availableSpace.left + boundElementWidth * offsetModifier;
337
406
  maxHeight = availableSpace.bottom - distanceFromBound;
338
407
  break;
339
408
  case PopoverPosition.RIGHT:
340
409
  case PopoverPosition.RIGHT_BOTTOM:
341
- hostStyle.top = `${boundElementOffsets.top + boundElementHeight * offsetModifier - (position === PopoverPosition.RIGHT_BOTTOM ? arrowModifier : 0)}px`;
342
- hostStyle.left = `${boundElementOffsets.left + boundElementWidth}px`;
410
+ hostStyle.top = `${sideTopBase - (position === PopoverPosition.RIGHT_BOTTOM ? arrowModifier : 0)}px`;
411
+ hostStyle.left = `${positionOffsets.left + boundElementWidth + distanceFromBound}px`;
343
412
  maxWidth = availableSpace.right - distanceFromBound;
344
413
  if (position === PopoverPosition.RIGHT) {
345
414
  maxHeight = availableSpace.top + availableSpace.bottom + boundElementHeight;
@@ -349,23 +418,23 @@ const ZPopover = /*@__PURE__*/ proxyCustomElement(class ZPopover extends HTMLEle
349
418
  }
350
419
  break;
351
420
  case PopoverPosition.RIGHT_TOP:
352
- hostStyle.bottom = `${boundElementOffsets.bottom + boundElementHeight * offsetModifier - arrowModifier}px`;
353
- hostStyle.left = `${boundElementOffsets.left + boundElementWidth}px`;
421
+ hostStyle.bottom = `${sideBottomBase - arrowModifier}px`;
422
+ hostStyle.left = `${positionOffsets.left + boundElementWidth + distanceFromBound}px`;
354
423
  maxWidth = availableSpace.right - distanceFromBound;
355
424
  maxHeight = availableSpace.top + boundElementHeight * offsetModifier;
356
425
  break;
357
426
  case PopoverPosition.LEFT:
358
427
  case PopoverPosition.LEFT_BOTTOM:
359
- hostStyle.top = `${boundElementOffsets.top + boundElementHeight * offsetModifier - (position === PopoverPosition.LEFT_BOTTOM ? arrowModifier : 0)}px`;
360
- hostStyle.right = `${boundElementOffsets.right + boundElementWidth}px`;
428
+ hostStyle.top = `${sideTopBase - (position === PopoverPosition.LEFT_BOTTOM ? arrowModifier : 0)}px`;
429
+ hostStyle.right = `${positionOffsets.right + boundElementWidth + distanceFromBound}px`;
361
430
  maxWidth = availableSpace.left - distanceFromBound;
362
431
  if (position === PopoverPosition.LEFT_BOTTOM) {
363
432
  maxHeight = availableSpace.bottom + boundElementHeight * offsetModifier;
364
433
  }
365
434
  break;
366
435
  case PopoverPosition.LEFT_TOP:
367
- hostStyle.right = `${boundElementOffsets.right + boundElementWidth}px`;
368
- hostStyle.bottom = `${boundElementOffsets.bottom + boundElementHeight * offsetModifier - arrowModifier}px`;
436
+ hostStyle.right = `${positionOffsets.right + boundElementWidth + distanceFromBound}px`;
437
+ hostStyle.bottom = `${sideBottomBase - arrowModifier}px`;
369
438
  maxWidth = availableSpace.left - distanceFromBound;
370
439
  maxHeight = availableSpace.top + boundElementHeight * offsetModifier;
371
440
  break;
@@ -383,7 +452,7 @@ const ZPopover = /*@__PURE__*/ proxyCustomElement(class ZPopover extends HTMLEle
383
452
  if (!this.boundElement) {
384
453
  return;
385
454
  }
386
- if (!isElementVisibleInContainer(this.boundElement, findScrollableParent(this.boundElement))) {
455
+ if (!isElementVisibleInContainer(this.boundElement, this.findScrollableAncestor(this.boundElement))) {
387
456
  // If the bound element is not visible, hide the popover too
388
457
  this.open = false;
389
458
  return;
@@ -420,7 +489,7 @@ const ZPopover = /*@__PURE__*/ proxyCustomElement(class ZPopover extends HTMLEle
420
489
  cancelAnimationFrame(this.animationFrameRequestId);
421
490
  }
422
491
  render() {
423
- return (h(Host, { key: 'aeb6c7ccabc279af16d9a957e732ad611612589f', "current-position": this.currentPosition }, h("slot", { key: '77fecb1bbfa49e1a8f97c078e7cef01a03420d9c' })));
492
+ return (h(Host, { key: 'a778d9679d27ca18fe92eab0f596a86cb904a49f', "current-position": this.currentPosition }, h("slot", { key: 'de51304770f9f501a10ca26232448a31482da68d' })));
424
493
  }
425
494
  get host() { return this; }
426
495
  static get watchers() { return {