@zanichelli/albe-web-components 15.0.1-RC → 15.0.2

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 (372) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/dist/cjs/index-5dc4a8de.js +10 -2
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{utils-f5f944ed.js → utils-2b313a8e.js} +1 -1
  5. package/dist/cjs/{utils-f5f944ed.js.map → utils-2b313a8e.js.map} +1 -1
  6. package/dist/cjs/web-components-library.cjs.js +1 -1
  7. package/dist/cjs/{z-app-header_15.cjs.entry.js → z-app-header_12.cjs.entry.js} +21 -1240
  8. package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -0
  9. package/dist/cjs/z-book-card.cjs.entry.js +1 -1
  10. package/dist/cjs/z-book-card.cjs.entry.js.map +1 -1
  11. package/dist/cjs/z-card.cjs.entry.js +1 -1
  12. package/dist/cjs/z-card.cjs.entry.js.map +1 -1
  13. package/dist/cjs/z-date-picker.cjs.entry.js +1 -1
  14. package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +1033 -0
  15. package/dist/cjs/z-dragdrop-area_2.cjs.entry.js.map +1 -0
  16. package/dist/cjs/z-file-upload.cjs.entry.js +215 -0
  17. package/dist/cjs/z-file-upload.cjs.entry.js.map +1 -0
  18. package/dist/cjs/z-myz-card-list.cjs.entry.js +1 -1
  19. package/dist/cjs/z-myz-card-list.cjs.entry.js.map +1 -1
  20. package/dist/cjs/z-navigation-tabs.cjs.entry.js +1 -1
  21. package/dist/cjs/z-navigation-tabs.cjs.entry.js.map +1 -1
  22. package/dist/cjs/z-notification.cjs.entry.js +1 -1
  23. package/dist/cjs/z-notification.cjs.entry.js.map +1 -1
  24. package/dist/cjs/z-otp.cjs.entry.js +1 -1
  25. package/dist/cjs/z-otp.cjs.entry.js.map +1 -1
  26. package/dist/cjs/z-range-picker.cjs.entry.js +1 -1
  27. package/dist/cjs/z-slideshow.cjs.entry.js +1 -1
  28. package/dist/cjs/z-slideshow.cjs.entry.js.map +1 -1
  29. package/dist/cjs/z-stepper.cjs.entry.js +1 -1
  30. package/dist/cjs/z-stepper.cjs.entry.js.map +1 -1
  31. package/dist/cjs/z-toast-notification.cjs.entry.js +1 -1
  32. package/dist/cjs/z-toast-notification.cjs.entry.js.map +1 -1
  33. package/dist/collection/components/file-upload/z-file-upload/index.js +1 -1
  34. package/dist/collection/components/file-upload/z-file-upload/index.js.map +1 -1
  35. package/dist/collection/components/file-upload/z-file-upload/index.spec.js +3 -3
  36. package/dist/collection/components/file-upload/z-file-upload/index.spec.js.map +1 -1
  37. package/dist/collection/components/file-upload/z-file-upload/styles.css +5 -0
  38. package/dist/collection/components/z-app-header/styles.css +5 -0
  39. package/dist/collection/components/z-book-card/styles.css +10 -0
  40. package/dist/collection/components/z-card/styles.css +15 -0
  41. package/dist/collection/components/z-input/styles-checkbox-radio.css +8 -1
  42. package/dist/collection/components/z-input/styles-general.css +1 -1
  43. package/dist/collection/components/z-input/styles-text.css +5 -0
  44. package/dist/collection/components/z-modal/index.js +13 -4
  45. package/dist/collection/components/z-modal/index.js.map +1 -1
  46. package/dist/collection/components/z-modal/styles.css +18 -19
  47. package/dist/collection/components/z-navigation-tabs/styles.css +1 -1
  48. package/dist/collection/components/z-notification/styles.css +6 -1
  49. package/dist/collection/components/z-searchbar/styles.css +5 -0
  50. package/dist/collection/components/z-stepper/index.js +2 -2
  51. package/dist/collection/components/z-stepper/index.js.map +1 -1
  52. package/dist/collection/components/z-stepper/index.stories.js +44 -3
  53. package/dist/collection/components/z-stepper/index.stories.js.map +1 -1
  54. package/dist/collection/components/z-stepper-item/index.stories.js +44 -19
  55. package/dist/collection/components/z-stepper-item/index.stories.js.map +1 -1
  56. package/dist/collection/components/z-tag/index.stories.js +11 -7
  57. package/dist/collection/components/z-tag/index.stories.js.map +1 -1
  58. package/dist/collection/components/z-toast-notification/styles.css +12 -0
  59. package/dist/collection/snowflakes/myz/card/z-myz-card-list/styles.css +5 -0
  60. package/dist/collection/snowflakes/myz/z-otp/styles.css +5 -0
  61. package/dist/collection/snowflakes/myz/z-slideshow/styles.css +7 -0
  62. package/dist/components/index10.js +3 -3
  63. package/dist/components/index10.js.map +1 -1
  64. package/dist/components/index15.js +14 -5
  65. package/dist/components/index15.js.map +1 -1
  66. package/dist/components/index26.js +1 -1
  67. package/dist/components/index26.js.map +1 -1
  68. package/dist/components/z-app-header.js +1 -1
  69. package/dist/components/z-app-header.js.map +1 -1
  70. package/dist/components/z-book-card.js +1 -1
  71. package/dist/components/z-book-card.js.map +1 -1
  72. package/dist/components/z-card.js +1 -1
  73. package/dist/components/z-card.js.map +1 -1
  74. package/dist/components/z-file-upload.js +2 -2
  75. package/dist/components/z-file-upload.js.map +1 -1
  76. package/dist/components/z-myz-card-list.js +1 -1
  77. package/dist/components/z-myz-card-list.js.map +1 -1
  78. package/dist/components/z-navigation-tabs.js +1 -1
  79. package/dist/components/z-navigation-tabs.js.map +1 -1
  80. package/dist/components/z-notification.js +1 -1
  81. package/dist/components/z-notification.js.map +1 -1
  82. package/dist/components/z-otp.js +1 -1
  83. package/dist/components/z-otp.js.map +1 -1
  84. package/dist/components/z-slideshow.js +1 -1
  85. package/dist/components/z-slideshow.js.map +1 -1
  86. package/dist/components/z-stepper.js +1 -1
  87. package/dist/components/z-stepper.js.map +1 -1
  88. package/dist/components/z-toast-notification.js +1 -1
  89. package/dist/components/z-toast-notification.js.map +1 -1
  90. package/dist/esm/index-ab5f1eaa.js +10 -2
  91. package/dist/esm/loader.js +1 -1
  92. package/dist/esm/{utils-ba4f0770.js → utils-cd008fbc.js} +1 -1
  93. package/dist/esm/{utils-ba4f0770.js.map → utils-cd008fbc.js.map} +1 -1
  94. package/dist/esm/web-components-library.js +1 -1
  95. package/dist/esm/{z-app-header_15.entry.js → z-app-header_12.entry.js} +24 -1240
  96. package/dist/esm/z-app-header_12.entry.js.map +1 -0
  97. package/dist/esm/z-book-card.entry.js +1 -1
  98. package/dist/esm/z-book-card.entry.js.map +1 -1
  99. package/dist/esm/z-card.entry.js +1 -1
  100. package/dist/esm/z-card.entry.js.map +1 -1
  101. package/dist/esm/z-date-picker.entry.js +1 -1
  102. package/dist/esm/z-dragdrop-area_2.entry.js +1028 -0
  103. package/dist/esm/z-dragdrop-area_2.entry.js.map +1 -0
  104. package/dist/esm/z-file-upload.entry.js +211 -0
  105. package/dist/esm/z-file-upload.entry.js.map +1 -0
  106. package/dist/esm/z-myz-card-list.entry.js +1 -1
  107. package/dist/esm/z-myz-card-list.entry.js.map +1 -1
  108. package/dist/esm/z-navigation-tabs.entry.js +1 -1
  109. package/dist/esm/z-navigation-tabs.entry.js.map +1 -1
  110. package/dist/esm/z-notification.entry.js +1 -1
  111. package/dist/esm/z-notification.entry.js.map +1 -1
  112. package/dist/esm/z-otp.entry.js +1 -1
  113. package/dist/esm/z-otp.entry.js.map +1 -1
  114. package/dist/esm/z-range-picker.entry.js +1 -1
  115. package/dist/esm/z-slideshow.entry.js +1 -1
  116. package/dist/esm/z-slideshow.entry.js.map +1 -1
  117. package/dist/esm/z-stepper.entry.js +1 -1
  118. package/dist/esm/z-stepper.entry.js.map +1 -1
  119. package/dist/esm/z-toast-notification.entry.js +1 -1
  120. package/dist/esm/z-toast-notification.entry.js.map +1 -1
  121. package/dist/esm-es5/index-ab5f1eaa.js +1 -1
  122. package/dist/esm-es5/index-ab5f1eaa.js.map +1 -1
  123. package/dist/esm-es5/loader.js +1 -1
  124. package/dist/esm-es5/loader.js.map +1 -1
  125. package/dist/esm-es5/{utils-ba4f0770.js → utils-cd008fbc.js} +1 -1
  126. package/dist/esm-es5/web-components-library.js +1 -1
  127. package/dist/esm-es5/web-components-library.js.map +1 -1
  128. package/dist/esm-es5/z-app-header_12.entry.js +2 -0
  129. package/dist/esm-es5/z-app-header_12.entry.js.map +1 -0
  130. package/dist/esm-es5/z-book-card.entry.js +1 -1
  131. package/dist/esm-es5/z-book-card.entry.js.map +1 -1
  132. package/dist/esm-es5/z-card.entry.js +1 -1
  133. package/dist/esm-es5/z-card.entry.js.map +1 -1
  134. package/dist/esm-es5/z-date-picker.entry.js +1 -1
  135. package/dist/esm-es5/z-dragdrop-area_2.entry.js +2 -0
  136. package/dist/esm-es5/z-dragdrop-area_2.entry.js.map +1 -0
  137. package/dist/esm-es5/z-file-upload.entry.js +2 -0
  138. package/dist/esm-es5/z-file-upload.entry.js.map +1 -0
  139. package/dist/esm-es5/z-myz-card-list.entry.js +1 -1
  140. package/dist/esm-es5/z-myz-card-list.entry.js.map +1 -1
  141. package/dist/esm-es5/z-navigation-tabs.entry.js +1 -1
  142. package/dist/esm-es5/z-navigation-tabs.entry.js.map +1 -1
  143. package/dist/esm-es5/z-notification.entry.js +1 -1
  144. package/dist/esm-es5/z-notification.entry.js.map +1 -1
  145. package/dist/esm-es5/z-otp.entry.js +1 -1
  146. package/dist/esm-es5/z-otp.entry.js.map +1 -1
  147. package/dist/esm-es5/z-range-picker.entry.js +1 -1
  148. package/dist/esm-es5/z-slideshow.entry.js +1 -1
  149. package/dist/esm-es5/z-slideshow.entry.js.map +1 -1
  150. package/dist/esm-es5/z-stepper.entry.js +1 -1
  151. package/dist/esm-es5/z-stepper.entry.js.map +1 -1
  152. package/dist/esm-es5/z-toast-notification.entry.js +1 -1
  153. package/dist/esm-es5/z-toast-notification.entry.js.map +1 -1
  154. package/dist/types/components/z-modal/index.d.ts +1 -0
  155. package/dist/types/components/z-stepper/index.d.ts +1 -1
  156. package/dist/types/components/z-stepper/index.stories.d.ts +6 -0
  157. package/dist/types/components/z-stepper-item/index.stories.d.ts +22 -9
  158. package/dist/types/components/z-tag/index.stories.d.ts +6 -2
  159. package/dist/web-components-library/p-0108191f.system.entry.js +2 -0
  160. package/dist/web-components-library/{p-ffee2568.system.entry.js.map → p-0108191f.system.entry.js.map} +1 -1
  161. package/dist/web-components-library/p-05827ca5.entry.js +2 -0
  162. package/dist/web-components-library/{p-8f28871c.entry.js.map → p-05827ca5.entry.js.map} +1 -1
  163. package/dist/web-components-library/p-0a6424ef.entry.js +2 -0
  164. package/dist/web-components-library/p-0a6424ef.entry.js.map +1 -0
  165. package/dist/web-components-library/p-0bde1f0e.entry.js +2 -0
  166. package/dist/web-components-library/{p-df6ef4b4.entry.js.map → p-0bde1f0e.entry.js.map} +1 -1
  167. package/{www/build/p-3b801ea6.entry.js → dist/web-components-library/p-0e342fa3.entry.js} +2 -2
  168. package/dist/web-components-library/{p-fb6c02f1.entry.js → p-114088a1.entry.js} +2 -2
  169. package/dist/web-components-library/p-12008903.system.entry.js +2 -0
  170. package/dist/web-components-library/p-12008903.system.entry.js.map +1 -0
  171. package/dist/web-components-library/p-16b1b35a.entry.js +2 -0
  172. package/dist/web-components-library/p-16b1b35a.entry.js.map +1 -0
  173. package/dist/web-components-library/p-21941767.entry.js +2 -0
  174. package/dist/web-components-library/p-21941767.entry.js.map +1 -0
  175. package/dist/web-components-library/p-22d9f9c3.entry.js +2 -0
  176. package/dist/web-components-library/p-22d9f9c3.entry.js.map +1 -0
  177. package/dist/web-components-library/p-23975a98.system.entry.js +2 -0
  178. package/dist/web-components-library/p-23975a98.system.entry.js.map +1 -0
  179. package/dist/web-components-library/p-25872e04.system.entry.js +2 -0
  180. package/dist/web-components-library/p-25872e04.system.entry.js.map +1 -0
  181. package/{www/build/p-7519c72d.system.entry.js → dist/web-components-library/p-2dd2d037.system.entry.js} +2 -2
  182. package/dist/web-components-library/p-2df54d7d.entry.js +2 -0
  183. package/dist/web-components-library/p-2df54d7d.entry.js.map +1 -0
  184. package/dist/web-components-library/p-33368291.system.entry.js +2 -0
  185. package/dist/web-components-library/p-33368291.system.entry.js.map +1 -0
  186. package/dist/web-components-library/p-49256720.system.entry.js +2 -0
  187. package/dist/web-components-library/p-49256720.system.entry.js.map +1 -0
  188. package/{www/build/p-662c8342.js → dist/web-components-library/p-49a35cf0.js} +1 -1
  189. package/dist/web-components-library/p-4d0200ca.system.entry.js +2 -0
  190. package/dist/web-components-library/p-4d0200ca.system.entry.js.map +1 -0
  191. package/dist/web-components-library/p-5a6d6203.system.entry.js +2 -0
  192. package/dist/web-components-library/p-5a6d6203.system.entry.js.map +1 -0
  193. package/dist/web-components-library/{p-22610d00.entry.js → p-6830461d.entry.js} +2 -2
  194. package/dist/web-components-library/p-6830461d.entry.js.map +1 -0
  195. package/{www/build/p-461cf578.system.entry.js → dist/web-components-library/p-751c58e2.system.entry.js} +2 -2
  196. package/dist/web-components-library/{p-dead4830.system.js → p-7dd29d4d.system.js} +1 -1
  197. package/dist/web-components-library/p-7e5ae5bd.entry.js +2 -0
  198. package/dist/web-components-library/p-7e5ae5bd.entry.js.map +1 -0
  199. package/dist/web-components-library/p-8078896f.system.entry.js +2 -0
  200. package/dist/web-components-library/p-8078896f.system.entry.js.map +1 -0
  201. package/dist/web-components-library/p-9450cc97.system.entry.js +2 -0
  202. package/dist/web-components-library/p-9450cc97.system.entry.js.map +1 -0
  203. package/dist/web-components-library/{p-eea9f7fd.system.entry.js → p-9551ea7a.system.entry.js} +2 -2
  204. package/dist/web-components-library/{p-eea9f7fd.system.entry.js.map → p-9551ea7a.system.entry.js.map} +1 -1
  205. package/dist/web-components-library/p-a5f739b0.entry.js +2 -0
  206. package/dist/web-components-library/p-a5f739b0.entry.js.map +1 -0
  207. package/dist/web-components-library/p-d2a11d41.system.entry.js +2 -0
  208. package/dist/web-components-library/p-d2a11d41.system.entry.js.map +1 -0
  209. package/dist/web-components-library/p-f3ef3a26.entry.js +2 -0
  210. package/dist/web-components-library/p-f3ef3a26.entry.js.map +1 -0
  211. package/dist/web-components-library/p-f530271b.system.js +1 -1
  212. package/dist/web-components-library/p-f530271b.system.js.map +1 -1
  213. package/dist/web-components-library/p-ff54b247.entry.js +2 -0
  214. package/dist/web-components-library/p-ff54b247.entry.js.map +1 -0
  215. package/dist/web-components-library/web-components-library.css +4 -3
  216. package/dist/web-components-library/web-components-library.esm.js +1 -1
  217. package/dist/web-components-library/web-components-library.esm.js.map +1 -1
  218. package/package.json +2 -2
  219. package/www/build/p-0108191f.system.entry.js +2 -0
  220. package/www/build/{p-ffee2568.system.entry.js.map → p-0108191f.system.entry.js.map} +1 -1
  221. package/www/build/p-05827ca5.entry.js +2 -0
  222. package/www/build/{p-8f28871c.entry.js.map → p-05827ca5.entry.js.map} +1 -1
  223. package/www/build/p-0a6424ef.entry.js +2 -0
  224. package/www/build/p-0a6424ef.entry.js.map +1 -0
  225. package/www/build/p-0bde1f0e.entry.js +2 -0
  226. package/www/build/{p-df6ef4b4.entry.js.map → p-0bde1f0e.entry.js.map} +1 -1
  227. package/{dist/web-components-library/p-3b801ea6.entry.js → www/build/p-0e342fa3.entry.js} +2 -2
  228. package/www/build/{p-fb6c02f1.entry.js → p-114088a1.entry.js} +2 -2
  229. package/www/build/p-12008903.system.entry.js +2 -0
  230. package/www/build/p-12008903.system.entry.js.map +1 -0
  231. package/www/build/p-16b1b35a.entry.js +2 -0
  232. package/www/build/p-16b1b35a.entry.js.map +1 -0
  233. package/www/build/p-21941767.entry.js +2 -0
  234. package/www/build/p-21941767.entry.js.map +1 -0
  235. package/www/build/p-22d9f9c3.entry.js +2 -0
  236. package/www/build/p-22d9f9c3.entry.js.map +1 -0
  237. package/www/build/p-23975a98.system.entry.js +2 -0
  238. package/www/build/p-23975a98.system.entry.js.map +1 -0
  239. package/www/build/p-25872e04.system.entry.js +2 -0
  240. package/www/build/p-25872e04.system.entry.js.map +1 -0
  241. package/{dist/web-components-library/p-7519c72d.system.entry.js → www/build/p-2dd2d037.system.entry.js} +2 -2
  242. package/www/build/p-2df54d7d.entry.js +2 -0
  243. package/www/build/p-2df54d7d.entry.js.map +1 -0
  244. package/www/build/p-33368291.system.entry.js +2 -0
  245. package/www/build/p-33368291.system.entry.js.map +1 -0
  246. package/www/build/p-49256720.system.entry.js +2 -0
  247. package/www/build/p-49256720.system.entry.js.map +1 -0
  248. package/{dist/web-components-library/p-662c8342.js → www/build/p-49a35cf0.js} +1 -1
  249. package/www/build/p-4d0200ca.system.entry.js +2 -0
  250. package/www/build/p-4d0200ca.system.entry.js.map +1 -0
  251. package/www/build/p-5a6d6203.system.entry.js +2 -0
  252. package/www/build/p-5a6d6203.system.entry.js.map +1 -0
  253. package/www/build/{p-22610d00.entry.js → p-6830461d.entry.js} +2 -2
  254. package/www/build/p-6830461d.entry.js.map +1 -0
  255. package/{dist/web-components-library/p-461cf578.system.entry.js → www/build/p-751c58e2.system.entry.js} +2 -2
  256. package/www/build/p-751c7014.css +4 -0
  257. package/www/build/{p-dead4830.system.js → p-7dd29d4d.system.js} +1 -1
  258. package/www/build/p-7e5ae5bd.entry.js +2 -0
  259. package/www/build/p-7e5ae5bd.entry.js.map +1 -0
  260. package/www/build/p-8078896f.system.entry.js +2 -0
  261. package/www/build/p-8078896f.system.entry.js.map +1 -0
  262. package/www/build/p-9450cc97.system.entry.js +2 -0
  263. package/www/build/p-9450cc97.system.entry.js.map +1 -0
  264. package/www/build/{p-eea9f7fd.system.entry.js → p-9551ea7a.system.entry.js} +2 -2
  265. package/www/build/{p-eea9f7fd.system.entry.js.map → p-9551ea7a.system.entry.js.map} +1 -1
  266. package/www/build/p-a5f739b0.entry.js +2 -0
  267. package/www/build/p-a5f739b0.entry.js.map +1 -0
  268. package/www/build/p-d2a11d41.system.entry.js +2 -0
  269. package/www/build/p-d2a11d41.system.entry.js.map +1 -0
  270. package/www/build/p-e65aa787.js +2 -0
  271. package/www/build/p-f3ef3a26.entry.js +2 -0
  272. package/www/build/p-f3ef3a26.entry.js.map +1 -0
  273. package/www/build/p-f530271b.system.js +1 -1
  274. package/www/build/p-f530271b.system.js.map +1 -1
  275. package/www/build/p-ff54b247.entry.js +2 -0
  276. package/www/build/p-ff54b247.entry.js.map +1 -0
  277. package/www/build/web-components-library.css +4 -3
  278. package/www/build/web-components-library.esm.js +1 -1
  279. package/www/build/web-components-library.esm.js.map +1 -1
  280. package/www/index.html +1 -11
  281. package/dist/cjs/z-app-header_15.cjs.entry.js.map +0 -1
  282. package/dist/esm/z-app-header_15.entry.js.map +0 -1
  283. package/dist/esm-es5/z-app-header_15.entry.js +0 -2
  284. package/dist/esm-es5/z-app-header_15.entry.js.map +0 -1
  285. package/dist/web-components-library/p-22610d00.entry.js.map +0 -1
  286. package/dist/web-components-library/p-353c9666.entry.js +0 -2
  287. package/dist/web-components-library/p-353c9666.entry.js.map +0 -1
  288. package/dist/web-components-library/p-3970d479.entry.js +0 -2
  289. package/dist/web-components-library/p-3970d479.entry.js.map +0 -1
  290. package/dist/web-components-library/p-3cd2a911.system.entry.js +0 -2
  291. package/dist/web-components-library/p-3cd2a911.system.entry.js.map +0 -1
  292. package/dist/web-components-library/p-5d0fd3e4.system.entry.js +0 -2
  293. package/dist/web-components-library/p-5d0fd3e4.system.entry.js.map +0 -1
  294. package/dist/web-components-library/p-8f28871c.entry.js +0 -2
  295. package/dist/web-components-library/p-93f6a3ca.system.entry.js +0 -2
  296. package/dist/web-components-library/p-93f6a3ca.system.entry.js.map +0 -1
  297. package/dist/web-components-library/p-94bfd79b.system.entry.js +0 -2
  298. package/dist/web-components-library/p-94bfd79b.system.entry.js.map +0 -1
  299. package/dist/web-components-library/p-9bae8b1c.system.entry.js +0 -2
  300. package/dist/web-components-library/p-9bae8b1c.system.entry.js.map +0 -1
  301. package/dist/web-components-library/p-a0893037.entry.js +0 -2
  302. package/dist/web-components-library/p-a0893037.entry.js.map +0 -1
  303. package/dist/web-components-library/p-a8d78db5.system.entry.js +0 -2
  304. package/dist/web-components-library/p-a8d78db5.system.entry.js.map +0 -1
  305. package/dist/web-components-library/p-b6aa9719.entry.js +0 -2
  306. package/dist/web-components-library/p-b6aa9719.entry.js.map +0 -1
  307. package/dist/web-components-library/p-c012f19c.entry.js +0 -2
  308. package/dist/web-components-library/p-c012f19c.entry.js.map +0 -1
  309. package/dist/web-components-library/p-df6ef4b4.entry.js +0 -2
  310. package/dist/web-components-library/p-efda4ff7.system.entry.js +0 -2
  311. package/dist/web-components-library/p-efda4ff7.system.entry.js.map +0 -1
  312. package/dist/web-components-library/p-fc1e9ce0.entry.js +0 -2
  313. package/dist/web-components-library/p-fc1e9ce0.entry.js.map +0 -1
  314. package/dist/web-components-library/p-ffcf7250.entry.js +0 -2
  315. package/dist/web-components-library/p-ffcf7250.entry.js.map +0 -1
  316. package/dist/web-components-library/p-ffeb3d1b.system.entry.js +0 -2
  317. package/dist/web-components-library/p-ffeb3d1b.system.entry.js.map +0 -1
  318. package/dist/web-components-library/p-ffee2568.system.entry.js +0 -2
  319. package/www/build/p-22610d00.entry.js.map +0 -1
  320. package/www/build/p-353c9666.entry.js +0 -2
  321. package/www/build/p-353c9666.entry.js.map +0 -1
  322. package/www/build/p-3970d479.entry.js +0 -2
  323. package/www/build/p-3970d479.entry.js.map +0 -1
  324. package/www/build/p-3cd2a911.system.entry.js +0 -2
  325. package/www/build/p-3cd2a911.system.entry.js.map +0 -1
  326. package/www/build/p-5d0fd3e4.system.entry.js +0 -2
  327. package/www/build/p-5d0fd3e4.system.entry.js.map +0 -1
  328. package/www/build/p-6232f1d4.css +0 -3
  329. package/www/build/p-8f28871c.entry.js +0 -2
  330. package/www/build/p-93f6a3ca.system.entry.js +0 -2
  331. package/www/build/p-93f6a3ca.system.entry.js.map +0 -1
  332. package/www/build/p-94bfd79b.system.entry.js +0 -2
  333. package/www/build/p-94bfd79b.system.entry.js.map +0 -1
  334. package/www/build/p-9bae8b1c.system.entry.js +0 -2
  335. package/www/build/p-9bae8b1c.system.entry.js.map +0 -1
  336. package/www/build/p-a0893037.entry.js +0 -2
  337. package/www/build/p-a0893037.entry.js.map +0 -1
  338. package/www/build/p-a8d78db5.system.entry.js +0 -2
  339. package/www/build/p-a8d78db5.system.entry.js.map +0 -1
  340. package/www/build/p-b6aa9719.entry.js +0 -2
  341. package/www/build/p-b6aa9719.entry.js.map +0 -1
  342. package/www/build/p-c012f19c.entry.js +0 -2
  343. package/www/build/p-c012f19c.entry.js.map +0 -1
  344. package/www/build/p-c94a3f4f.js +0 -2
  345. package/www/build/p-df6ef4b4.entry.js +0 -2
  346. package/www/build/p-efda4ff7.system.entry.js +0 -2
  347. package/www/build/p-efda4ff7.system.entry.js.map +0 -1
  348. package/www/build/p-fc1e9ce0.entry.js +0 -2
  349. package/www/build/p-fc1e9ce0.entry.js.map +0 -1
  350. package/www/build/p-ffcf7250.entry.js +0 -2
  351. package/www/build/p-ffcf7250.entry.js.map +0 -1
  352. package/www/build/p-ffeb3d1b.system.entry.js +0 -2
  353. package/www/build/p-ffeb3d1b.system.entry.js.map +0 -1
  354. package/www/build/p-ffee2568.system.entry.js +0 -2
  355. /package/dist/esm-es5/{utils-ba4f0770.js.map → utils-cd008fbc.js.map} +0 -0
  356. /package/dist/types/home/{veronica/zanichelli/ds → runner/work/design-system}/design-system/.stencil/.storybook/elements/args-controls.d.ts +0 -0
  357. /package/dist/types/home/{veronica/zanichelli/ds → runner/work/design-system}/design-system/.stencil/.storybook/elements/docs-template.d.ts +0 -0
  358. /package/dist/types/home/{veronica/zanichelli/ds → runner/work/design-system}/design-system/.stencil/docs/grid/index.stories.d.ts +0 -0
  359. /package/dist/types/home/{veronica/zanichelli/ds → runner/work/design-system}/design-system/.stencil/docs/iconset/index.stories.d.ts +0 -0
  360. /package/dist/types/home/{veronica/zanichelli/ds → runner/work/design-system}/design-system/.stencil/docs/themes/index.stories.d.ts +0 -0
  361. /package/dist/web-components-library/{p-3b801ea6.entry.js.map → p-0e342fa3.entry.js.map} +0 -0
  362. /package/dist/web-components-library/{p-fb6c02f1.entry.js.map → p-114088a1.entry.js.map} +0 -0
  363. /package/dist/web-components-library/{p-7519c72d.system.entry.js.map → p-2dd2d037.system.entry.js.map} +0 -0
  364. /package/dist/web-components-library/{p-662c8342.js.map → p-49a35cf0.js.map} +0 -0
  365. /package/dist/web-components-library/{p-461cf578.system.entry.js.map → p-751c58e2.system.entry.js.map} +0 -0
  366. /package/dist/web-components-library/{p-dead4830.system.js.map → p-7dd29d4d.system.js.map} +0 -0
  367. /package/www/build/{p-3b801ea6.entry.js.map → p-0e342fa3.entry.js.map} +0 -0
  368. /package/www/build/{p-fb6c02f1.entry.js.map → p-114088a1.entry.js.map} +0 -0
  369. /package/www/build/{p-7519c72d.system.entry.js.map → p-2dd2d037.system.entry.js.map} +0 -0
  370. /package/www/build/{p-662c8342.js.map → p-49a35cf0.js.map} +0 -0
  371. /package/www/build/{p-461cf578.system.entry.js.map → p-751c58e2.system.entry.js.map} +0 -0
  372. /package/www/build/{p-dead4830.system.js.map → p-7dd29d4d.system.js.map} +0 -0
@@ -0,0 +1,2 @@
1
+ var __awaiter=this&&this.__awaiter||function(t,i,n,e){function r(t){return t instanceof n?t:new n((function(i){i(t)}))}return new(n||(n=Promise))((function(n,a){function s(t){try{c(e.next(t))}catch(t){a(t)}}function o(t){try{c(e["throw"](t))}catch(t){a(t)}}function c(t){t.done?n(t.value):r(t.value).then(s,o)}c((e=e.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},e,r,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(i){return c([t,i])}}function c(o){if(e)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(n=0)),n)try{if(e=1,r&&(a=o[0]&2?r["return"]:o[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,o[1])).done)return a;if(r=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;r=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1];a=o;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(o);break}if(a[2])n.ops.pop();n.trys.pop();continue}o=i.call(t,n)}catch(t){o=[6,t];r=0}finally{e=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,i,n){if(n||arguments.length===2)for(var e=0,r=i.length,a;e<r;e++){if(a||!(e in i)){if(!a)a=Array.prototype.slice.call(i,0,e);a[e]=i[e]}}return t.concat(a||Array.prototype.slice.call(i))};System.register(["./p-d8fcaf1f.system.js","./p-c39f227f.system.js","./p-1fe56b25.system.js","./p-ad6b3f77.system.js"],(function(t){"use strict";var i,n,e,r,a,s,o,c,u;return{setters:[function(t){i=t.r;n=t.c;e=t.h;r=t.a;a=t.g},function(t){s=t.w;o=t.p;c=t.D},function(t){u=t.g},function(){}],execute:function(){var l='*:focus{-webkit-box-shadow:var(--shadow-focus-primary);box-shadow:var(--shadow-focus-primary);outline:none !important}:host{color:var(--color-default-text);font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>.container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .modal-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:calc(var(--space-unit) * 2)}:host .modal-wrapper>.files-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin:calc(var(--space-unit) * 4);gap:var(--space-unit)}:host .text-container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin:auto}:host .text-container .body-1{text-align:center}:host .text-container .upload-link{color:var(--color-link-primary);cursor:pointer}:host .text-container .upload-link-text{margin-bottom:var(--space-unit)}input#file-elem{display:none}#title{display:inline-block;margin:calc(var(--space-unit) * 2.5) 0 calc(var(--space-unit) * 4);font-size:calc(var(--space-unit) * 3);font-weight:var(--font-sb)}:host>.container>z-button{display:inline-block;margin-top:calc(var(--space-unit) * 3)}:host>.container>.files-container.hidden{display:none}:host>.container>.files-container>.heading-4-sb{display:inline-block;margin:calc(var(--space-unit) * 3) 0;font-size:calc(var(--space-unit) * 2);font-weight:var(--font-sb)}:host([type="dragdrop"])>.container>.files-container>.heading-4-sb{margin-top:0;margin-bottom:calc(var(--space-unit) * 3)}:host>.container>.files-container>.files-wrapper{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:calc(var(--space-unit) * 2);-moz-column-gap:calc(var(--space-unit) * 2);column-gap:calc(var(--space-unit) * 2);row-gap:calc(var(--space-unit) * 2)}:host>.container>.files-container>z-divider{margin-top:calc(var(--space-unit) * 3);margin-bottom:0}:host([type="dragdrop"])>.container>.files-container>z-divider{margin:calc(var(--space-unit) * 3) 0}:host .error-message{font-size:14px;font-weight:400;letter-spacing:0.16%;line-height:20px;text-align:left}:host .error-message>.file-name{font-weight:600}@media only screen and (min-width: 768px){:host>.container>z-button{-ms-flex-item-align:start;align-self:flex-start}:host .modal-wrapper{padding:calc(var(--space-unit) * 3)}}@media only screen and (min-width: 1152px){:host .modal-wrapper{padding:calc(var(--space-unit) * 4)}}';var f=l;var h=t("z_file_upload",function(){function t(t){i(this,t);this.fileInput=n(this,"fileInput",7);this.inputAttributes={type:"file",id:"file-elem",multiple:true};this.type=s.DEFAULT;this.buttonVariant=undefined;this.acceptedFormat=undefined;this.fileMaxSize=undefined;this.mainTitle=undefined;this.description=undefined;this.files=[];this.uploadBtnLabel="allega";this.dragAndDropLabel="Rilascia i file in questa area per allegarli.";this.allowedFilesMessage=undefined;this.uploadClickableMessage="Carica";this.uploadMessage="o trascina dal tuo computer";this.errorModalTitle="Errore di caricamento";this.errorModalMessage=undefined;this.uploadedFilesLabel="File appena caricati";this.hasFileSection=true;this.invalidFiles=undefined}t.prototype.removeFileListener=function(t){this.removeFileHandler(t.detail)};t.prototype.fileDroppedListener=function(t){this.input.files=t.detail;this.fileInputHandler()};t.prototype.componentDidUpdate=function(){this.handleAccessibility();this.invalidFiles.size&&this.errorModal.focus()};t.prototype.componentWillLoad=function(){this.invalidFiles=new Map};t.prototype.fileInputHandler=function(){if(this.input.files.length){this.invalidFiles=this.checkFiles(Array.from(this.input.files))}};t.prototype.getFiles=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.files]}))}))};t.prototype.removeFile=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.removeFileHandler(t);return[2]}))}))};t.prototype.removeFileHandler=function(t){var i=this.files;var n=i.find((function(i){return i.name===t}));if(n){var e=i.indexOf(n);if(e>=0){i.splice(e,1);this.files=__spreadArray([],i,true)}}};t.prototype.getType=function(){if(u()!==o.DESKTOP&&u()!==o.DESKTOP_WIDE){return s.DEFAULT}return this.type};t.prototype.handleAccessibility=function(){var t=this.el.querySelector("z-file:last-child z-chip button");if(this.files.length>0&&t){t.focus()}else{this.getType()===s.DEFAULT?this.button.querySelector("button").focus():this.uploadLink.focus()}};t.prototype.checkFiles=function(t){var i=this;var n=new Map;var e="supera il limite di ".concat(this.fileMaxSize,"MB");var r=" ha un formato non supportato";t.forEach((function(t){var a=t.size/1024/1024;var s=i.acceptedFormat.split(",").some((function(i){return t.name.toLowerCase().endsWith(i.trim())}));var o=a<=i.fileMaxSize;if(o&&s){if(!i.files.find((function(i){return i.name===t.name}))){i.files.push(t);i.fileInput.emit(t);i.input.value=""}return}n.set(t.name,[]);if(!o){n.get(t.name).push(e)}if(!s){n.get(t.name).push(r)}}));return n};t.prototype.renderTitle=function(){return e("span",{id:"title"},this.mainTitle)};t.prototype.renderDescription=function(t){return e("span",{class:t},this.description)};t.prototype.renderAllowedFileExtensions=function(){var t="";var i="";if(this.acceptedFormat){var n=this.acceptedFormat.split(", ").map((function(t){return t.substring(1).toUpperCase()})).join(", ");t=" nei formati ".concat(n)}if(this.fileMaxSize){i=" per un massimo di ".concat(this.fileMaxSize,"MB di peso")}var r="Puoi allegare file".concat(t).concat(i,".");return e("span",{class:"body-3"},this.allowedFilesMessage?this.allowedFilesMessage:t||i?r:null)};t.prototype.renderFileSection=function(){if(!this.hasFileSection){return}return e("section",{class:"files-container ".concat(!this.files.length?"hidden":"")},e("span",{class:"heading-4-sb"},this.uploadedFilesLabel),e("div",{class:"files-wrapper"},e("slot",{name:"files"})),e("z-divider",{size:c.MEDIUM}))};t.prototype.renderInput=function(){var t=this;return e("input",Object.assign({},this.inputAttributes,{onChange:function(){return t.fileInputHandler()},accept:this.acceptedFormat,ref:function(i){return t.input=i}}))};t.prototype.renderUploadButton=function(){var t=this;return[this.renderInput(),e("z-button",{onClick:function(){return t.input.click()},onKeyPress:function(i){if(i.code=="Space"||i.code=="Enter"){i.preventDefault();t.input.click()}},id:"fileSelect",variant:this.buttonVariant,icon:"upload",ref:function(i){return t.button=i}},this.uploadBtnLabel)]};t.prototype.renderUploadLink=function(){var t=this;return[this.renderInput(),e("span",{class:"body-1 upload-link-text"},e("span",{tabIndex:0,class:"body-1-sb upload-link",onClick:function(){return t.input.click()},onKeyPress:function(i){if(i.code=="Space"||i.code=="Enter"){i.preventDefault();t.input.click()}},ref:function(i){return t.uploadLink=i}},this.uploadClickableMessage)," ",this.uploadMessage)]};t.prototype.renderDefaultMode=function(){return[this.renderDescription("body-3-sb"),this.renderAllowedFileExtensions(),this.renderFileSection(),this.renderUploadButton()]};t.prototype.renderDragDropMode=function(){return[this.renderFileSection(),e("z-dragdrop-area",{"drag-and-drop-label":this.dragAndDropLabel},e("div",{class:"text-container"},this.renderDescription("body-1"),this.renderUploadLink(),this.renderAllowedFileExtensions()))]};t.prototype.formatErrorString=function(t,i){var n,r;var a=i[0]&&i[1]?" e ":"";return e("span",{class:"error-message"},"Il file ",e("span",{class:"file-name"},t)," ",(n=i[1])!==null&&n!==void 0?n:"",a,(r=i[0])!==null&&r!==void 0?r:"",".")};t.prototype.handleErrorModalContent=function(){var t=this;return e("div",{slot:"modalContent"},e("div",{class:"modal-wrapper"},e("div",{class:"files"},this.errorModalMessage?e("span",{class:"body-3"},this.errorModalMessage):Array.from(this.invalidFiles).map((function(i){var n=i[0],r=i[1];return e("span",{class:"body-3"},t.formatErrorString(n,r))})))))};t.prototype.render=function(){var t=this;return e(r,{key:"30d78f7ce88aa6e994de1355cf4bb8bbc79e6f85"},e("div",{key:"b95129c709a9161cb1c08bc39a308196fc26644d",class:"container ".concat(this.getType())},this.mainTitle&&this.renderTitle(),this.getType()==s.DEFAULT?this.renderDefaultMode():this.renderDragDropMode()),!!this.invalidFiles.size&&e("z-modal",{key:"2e0db26fa301fa0141ac14fe92f2a222f2a5f2c8",modalid:"file-upload-".concat(this.type,"-error-modal"),tabIndex:0,ref:function(i){return t.errorModal=i},modaltitle:this.errorModalTitle,onModalClose:function(){return t.invalidFiles=new Map},onModalBackgroundClick:function(){return t.invalidFiles=new Map}},this.handleErrorModalContent()))};Object.defineProperty(t.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());h.style=f}}}));
2
+ //# sourceMappingURL=p-12008903.system.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["stylesCss","ZFileUploadStyle0","ZFileUpload","exports","this","inputAttributes","type","id","multiple","ZFileUploadType","DEFAULT","class_1","prototype","removeFileListener","e","removeFileHandler","detail","fileDroppedListener","input","files","fileInputHandler","componentDidUpdate","handleAccessibility","invalidFiles","size","errorModal","focus","componentWillLoad","Map","length","checkFiles","Array","from","getFiles","removeFile","fileName","file","find","name","index","indexOf","splice","__spreadArray","getType","getDevice","Device","DESKTOP","DESKTOP_WIDE","lastFile","el","querySelector","button","uploadLink","_this","errors","sizeErrorString","concat","fileMaxSize","formatErrorString","forEach","fileSize","fileFormatOk","acceptedFormat","split","some","ext","toLowerCase","endsWith","trim","fileSizeOk","f","push","fileInput","emit","value","set","get","renderTitle","h","mainTitle","renderDescription","cssClass","class","description","renderAllowedFileExtensions","fileFormatString","fileWeightString","fileFormat","map","string","substring","toUpperCase","join","finalString","allowedFilesMessage","renderFileSection","hasFileSection","uploadedFilesLabel","DividerSize","MEDIUM","renderInput","Object","assign","onChange","accept","ref","val","renderUploadButton","onClick","click","onKeyPress","code","preventDefault","variant","buttonVariant","icon","uploadBtnLabel","renderUploadLink","tabIndex","uploadClickableMessage","uploadMessage","renderDefaultMode","renderDragDropMode","dragAndDropLabel","key","bothErrors","_a","_b","handleErrorModalContent","slot","errorModalMessage","_c","render","Host","modalid","modaltitle","errorModalTitle","onModalClose","onModalBackgroundClick"],"sources":["src/components/file-upload/z-file-upload/styles.css?tag=z-file-upload&encapsulation=shadow","src/components/file-upload/z-file-upload/index.tsx"],"sourcesContent":["*:focus {\n box-shadow: var(--shadow-focus-primary);\n outline: none !important;\n}\n\n:host {\n color: var(--color-default-text);\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n}\n\n:host > .container {\n display: flex;\n flex-direction: column;\n}\n\n:host .modal-wrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: calc(var(--space-unit) * 2);\n}\n\n:host .modal-wrapper > .files-wrapper {\n display: flex;\n flex-direction: column;\n margin: calc(var(--space-unit) * 4);\n gap: var(--space-unit);\n}\n\n:host .text-container {\n display: flex;\n flex-direction: column;\n margin: auto;\n}\n\n:host .text-container .body-1 {\n text-align: center;\n}\n\n:host .text-container .upload-link {\n color: var(--color-link-primary);\n cursor: pointer;\n}\n\n:host .text-container .upload-link-text {\n margin-bottom: var(--space-unit);\n}\n\ninput#file-elem {\n display: none;\n}\n\n#title {\n display: inline-block;\n margin: calc(var(--space-unit) * 2.5) 0 calc(var(--space-unit) * 4);\n font-size: calc(var(--space-unit) * 3);\n font-weight: var(--font-sb);\n}\n\n:host > .container > z-button {\n display: inline-block;\n margin-top: calc(var(--space-unit) * 3);\n}\n\n:host > .container > .files-container.hidden {\n display: none;\n}\n\n:host > .container > .files-container > .heading-4-sb {\n display: inline-block;\n margin: calc(var(--space-unit) * 3) 0;\n font-size: calc(var(--space-unit) * 2);\n font-weight: var(--font-sb);\n}\n\n:host([type=\"dragdrop\"]) > .container > .files-container > .heading-4-sb {\n margin-top: 0;\n margin-bottom: calc(var(--space-unit) * 3);\n}\n\n:host > .container > .files-container > .files-wrapper {\n display: flex;\n flex-wrap: wrap;\n column-gap: calc(var(--space-unit) * 2);\n row-gap: calc(var(--space-unit) * 2);\n}\n\n:host > .container > .files-container > z-divider {\n margin-top: calc(var(--space-unit) * 3);\n margin-bottom: 0;\n}\n\n:host([type=\"dragdrop\"]) > .container > .files-container > z-divider {\n margin: calc(var(--space-unit) * 3) 0;\n}\n\n:host .error-message {\n font-size: 14px;\n font-weight: 400;\n letter-spacing: 0.16%;\n line-height: 20px;\n text-align: left;\n}\n\n:host .error-message > .file-name {\n font-weight: 600;\n}\n\n/* Tablet breakpoint */\n@media only screen and (min-width: 768px) {\n :host > .container > z-button {\n align-self: flex-start;\n }\n\n :host .modal-wrapper {\n padding: calc(var(--space-unit) * 3);\n }\n}\n\n@media only screen and (min-width: 1152px) {\n :host .modal-wrapper {\n padding: calc(var(--space-unit) * 4);\n }\n}\n","import {Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, h} from \"@stencil/core\";\nimport {ButtonVariant, Device, DividerSize, ZFileUploadType} from \"../../../beans\";\nimport {getDevice} from \"../../../utils/utils\";\n\n@Component({\n tag: \"z-file-upload\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZFileUpload {\n /** Prop indicating the file upload type - can be default or dragdrop */\n @Prop({reflect: true})\n type: ZFileUploadType = ZFileUploadType.DEFAULT;\n\n /** Prop indicating the button variant*/\n @Prop()\n buttonVariant?: ButtonVariant;\n\n /** Prop indicating the accepted file type: ex \".pdf, .doc, .jpg\" */\n @Prop()\n acceptedFormat?: string;\n\n /** Max file dimension in Megabyte */\n @Prop()\n fileMaxSize?: number;\n\n /** Title */\n @Prop()\n mainTitle?: string;\n\n /** Description */\n @Prop()\n description?: string;\n\n /** Files added by the user */\n @State()\n files: File[] = [];\n\n /** upoload button label */\n @Prop()\n uploadBtnLabel?: string = \"allega\";\n\n /** drag & drop button label */\n @Prop()\n dragAndDropLabel?: string = \"Rilascia i file in questa area per allegarli.\";\n\n /** allowed file message */\n @Prop()\n allowedFilesMessage?: string;\n\n /** upload clickable message */\n @Prop()\n uploadClickableMessage?: string = \"Carica\";\n\n /** upload message */\n @Prop()\n uploadMessage?: string = \"o trascina dal tuo computer\";\n\n /** error modal title */\n @Prop()\n errorModalTitle?: string = \"Errore di caricamento\";\n\n /** error modal message */\n @Prop()\n errorModalMessage?: string;\n\n /** loaded files label */\n @Prop()\n uploadedFilesLabel?: string = \"File appena caricati\";\n\n /** uploaded files history rendering */\n @Prop()\n hasFileSection?: boolean = true;\n\n /** List of files not allowed to be uploaded */\n @State()\n invalidFiles: Map<string, string[]>;\n\n @Element() el: HTMLZFileUploadElement;\n\n private input: HTMLInputElement;\n\n private button: HTMLZButtonElement;\n\n private errorModal: HTMLZModalElement;\n\n private uploadLink: HTMLSpanElement;\n\n private inputAttributes = {\n type: \"file\",\n id: \"file-elem\",\n multiple: true,\n };\n\n /** Listen removeFile event sent from z-file component */\n @Listen(\"removeFile\")\n removeFileListener(e: CustomEvent): void {\n this.removeFileHandler(e.detail);\n }\n\n /** Listen fileDropped event sent from z-dragdrop-area component */\n @Listen(\"fileDropped\")\n fileDroppedListener(e: CustomEvent): void {\n this.input.files = e.detail;\n this.fileInputHandler();\n }\n\n componentDidUpdate(): void {\n this.handleAccessibility();\n this.invalidFiles.size && this.errorModal.focus();\n }\n\n componentWillLoad(): void {\n this.invalidFiles = new Map<string, string[]>();\n }\n\n /** Emitted when user select one or more files */\n @Event()\n fileInput: EventEmitter;\n\n private fileInputHandler(): void {\n if (this.input.files.length) {\n this.invalidFiles = this.checkFiles(Array.from(this.input.files));\n }\n }\n\n /** get array of uploaded files */\n @Method()\n async getFiles(): Promise<File[]> {\n return this.files;\n }\n\n /** remove file from the array */\n @Method()\n async removeFile(fileName: string): Promise<void> {\n this.removeFileHandler(fileName);\n }\n\n private removeFileHandler(fileName: string): void {\n const files = this.files;\n const file = files.find((file) => file.name === fileName);\n if (file) {\n const index = files.indexOf(file);\n if (index >= 0) {\n files.splice(index, 1);\n this.files = [...files];\n }\n }\n }\n\n private getType(): ZFileUploadType {\n if (getDevice() !== Device.DESKTOP && getDevice() !== Device.DESKTOP_WIDE) {\n return ZFileUploadType.DEFAULT;\n }\n\n return this.type;\n }\n\n private handleAccessibility(): void {\n const lastFile = this.el.querySelector(\"z-file:last-child z-chip button\");\n if (this.files.length > 0 && lastFile) {\n (lastFile as HTMLElement).focus();\n } else {\n this.getType() === ZFileUploadType.DEFAULT\n ? this.button.querySelector(\"button\").focus()\n : this.uploadLink.focus();\n }\n }\n\n private checkFiles(files: File[]): Map<string, string[]> {\n const errors = new Map<string, string[]>();\n const sizeErrorString = `supera il limite di ${this.fileMaxSize}MB`;\n const formatErrorString = \" ha un formato non supportato\";\n files.forEach((file: File) => {\n const fileSize = file.size / 1024 / 1024;\n const fileFormatOk = this.acceptedFormat\n .split(\",\")\n .some((ext: string) => file.name.toLowerCase().endsWith(ext.trim()));\n const fileSizeOk = fileSize <= this.fileMaxSize;\n if (fileSizeOk && fileFormatOk) {\n if (!this.files.find((f) => f.name === file.name)) {\n this.files.push(file);\n this.fileInput.emit(file);\n this.input.value = \"\";\n }\n\n return;\n }\n errors.set(file.name, []);\n if (!fileSizeOk) {\n errors.get(file.name).push(sizeErrorString);\n }\n if (!fileFormatOk) {\n errors.get(file.name).push(formatErrorString);\n }\n });\n\n return errors;\n }\n\n private renderTitle(): HTMLElement {\n return <span id=\"title\">{this.mainTitle}</span>;\n }\n\n private renderDescription(cssClass): HTMLElement {\n return <span class={cssClass}>{this.description}</span>;\n }\n\n private renderAllowedFileExtensions(): HTMLElement {\n let fileFormatString = \"\";\n let fileWeightString = \"\";\n\n if (this.acceptedFormat) {\n const fileFormat = this.acceptedFormat\n .split(\", \")\n .map((string) => string.substring(1).toUpperCase())\n .join(\", \");\n fileFormatString = ` nei formati ${fileFormat}`;\n }\n\n if (this.fileMaxSize) {\n fileWeightString = ` per un massimo di ${this.fileMaxSize}MB di peso`;\n }\n\n const finalString = `Puoi allegare file${fileFormatString}${fileWeightString}.`;\n\n return (\n <span class=\"body-3\">\n {this.allowedFilesMessage\n ? this.allowedFilesMessage\n : fileFormatString || fileWeightString\n ? finalString\n : null}\n </span>\n );\n }\n\n private renderFileSection(): HTMLElement {\n if (!this.hasFileSection) {\n return;\n }\n\n return (\n <section class={`files-container ${!this.files.length ? \"hidden\" : \"\"}`}>\n <span class=\"heading-4-sb\">{this.uploadedFilesLabel}</span>\n <div class=\"files-wrapper\">\n <slot name=\"files\" />\n </div>\n <z-divider size={DividerSize.MEDIUM} />\n </section>\n );\n }\n\n private renderInput(): HTMLInputElement {\n return (\n <input\n {...this.inputAttributes}\n onChange={() => this.fileInputHandler()}\n accept={this.acceptedFormat}\n ref={(val) => (this.input = val)}\n />\n );\n }\n\n private renderUploadButton(): unknown[] {\n return [\n this.renderInput(),\n <z-button\n onClick={() => this.input.click()}\n onKeyPress={(e) => {\n if (e.code == \"Space\" || e.code == \"Enter\") {\n e.preventDefault();\n this.input.click();\n }\n }}\n id=\"fileSelect\"\n variant={this.buttonVariant}\n icon=\"upload\"\n ref={(val) => (this.button = val)}\n >\n {this.uploadBtnLabel}\n </z-button>,\n ];\n }\n\n private renderUploadLink(): unknown[] {\n return [\n this.renderInput(),\n <span class=\"body-1 upload-link-text\">\n <span\n tabIndex={0}\n class=\"body-1-sb upload-link\"\n onClick={() => this.input.click()}\n onKeyPress={(e) => {\n if (e.code == \"Space\" || e.code == \"Enter\") {\n e.preventDefault();\n this.input.click();\n }\n }}\n ref={(val) => (this.uploadLink = val)}\n >\n {this.uploadClickableMessage}\n </span>{\" \"}\n {this.uploadMessage}\n </span>,\n ];\n }\n\n private renderDefaultMode(): unknown[] {\n return [\n this.renderDescription(\"body-3-sb\"),\n this.renderAllowedFileExtensions(),\n this.renderFileSection(),\n this.renderUploadButton(),\n ];\n }\n\n private renderDragDropMode(): unknown[] {\n return [\n this.renderFileSection(),\n <z-dragdrop-area drag-and-drop-label={this.dragAndDropLabel}>\n <div class=\"text-container\">\n {this.renderDescription(\"body-1\")}\n {this.renderUploadLink()}\n {this.renderAllowedFileExtensions()}\n </div>\n </z-dragdrop-area>,\n ];\n }\n\n private formatErrorString(key, value): string {\n const bothErrors = value[0] && value[1] ? \" e \" : \"\";\n\n return (\n <span class=\"error-message\">\n Il file <span class=\"file-name\">{key}</span> {value[1] ?? \"\"}\n {bothErrors}\n {value[0] ?? \"\"}.\n </span>\n );\n }\n\n private handleErrorModalContent(): HTMLDivElement {\n return (\n <div slot=\"modalContent\">\n <div class=\"modal-wrapper\">\n <div class=\"files\">\n {this.errorModalMessage ? (\n <span class=\"body-3\">{this.errorModalMessage}</span>\n ) : (\n Array.from(this.invalidFiles).map(([key, value]) => {\n return <span class=\"body-3\">{this.formatErrorString(key, value)}</span>;\n })\n )}\n </div>\n </div>\n </div>\n );\n }\n\n render(): HTMLZFileUploadElement {\n return (\n <Host>\n <div class={`container ${this.getType()}`}>\n {this.mainTitle && this.renderTitle()}\n {this.getType() == ZFileUploadType.DEFAULT ? this.renderDefaultMode() : this.renderDragDropMode()}\n </div>\n {!!this.invalidFiles.size && (\n <z-modal\n modalid={`file-upload-${this.type}-error-modal`}\n tabIndex={0}\n ref={(val) => (this.errorModal = val)}\n modaltitle={this.errorModalTitle}\n onModalClose={() => (this.invalidFiles = new Map<string, string[]>())}\n onModalBackgroundClick={() => (this.invalidFiles = new Map<string, string[]>())}\n >\n {this.handleErrorModalContent()}\n </z-modal>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"o/DAAA,IAAMA,EAAY,s9EAClB,IAAAC,EAAeD,E,ICQFE,EAAWC,EAAA,2B,6DA+EdC,KAAAC,gBAAkB,CACxBC,KAAM,OACNC,GAAI,YACJC,SAAU,M,UA/EYC,EAAgBC,Q,qJAwBxB,G,oBAIU,S,sBAIE,gD,+DAQM,S,mBAIT,8B,qBAIE,wB,yDAQG,uB,oBAIH,K,4BAwB3BC,EAAAC,UAAAC,mBAAA,SAAmBC,GACjBV,KAAKW,kBAAk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,EAAKyD,EAAA,GAC5C,OAAOrD,EAAA,QAAMI,MAAM,UAAU7B,EAAKK,kBAAkBkE,EAAKlD,G,QASvE/D,EAAAC,UAAAwH,OAAA,eAAA/E,EAAAjD,KACE,OACE0E,EAACuD,EAAI,CAAAT,IAAA,4CACH9C,EAAA,OAAA8C,IAAA,2CAAK1C,MAAO,aAAA1B,OAAapD,KAAKuC,YAC3BvC,KAAK2E,WAAa3E,KAAKyE,cACvBzE,KAAKuC,WAAalC,EAAgBC,QAAUN,KAAKqH,oBAAsBrH,KAAKsH,wBAE5EtH,KAAKmB,aAAaC,MACnBsD,EAAA,WAAA8C,IAAA,2CACEU,QAAS,eAAA9E,OAAepD,KAAKE,KAAI,gBACjCgH,SAAU,EACVb,IAAK,SAACC,GAAG,OAAMrD,EAAK5B,WAAaiF,CAAxB,EACT6B,WAAYnI,KAAKoI,gBACjBC,aAAc,kBAAOpF,EAAK9B,aAAe,IAAIK,GAA/B,EACd8G,uBAAwB,kBAAOrF,EAAK9B,aAAe,IAAIK,GAA/B,GAEvBxB,KAAK4H,2B,uHA/WM,I","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r as t,c as i,h as a}from"./p-cc3c02fe.js";import{f as e}from"./p-025f494e.js";const o="input:focus{-webkit-box-shadow:var(--shadow-focus-primary);box-shadow:var(--shadow-focus-primary);outline:none !important}:host{font-family:var(--font-family-sans);font-weight:var(--font-rg)}.digits-container{display:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:flex-start}input{width:calc(var(--space-unit) * 5);height:72px;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0;caret-color:transparent;color:var(--color-surface05);font-family:var(--font-family-sans);font-size:32px;font-weight:300;text-align:center}input.error{border:1px solid;border-color:var(--color-error01);background-color:var(--color-error-inverse);border-radius:4px}input:not(:last-of-type){margin-right:var(--space-unit)}@media only screen and (min-width: 768px){input:not(:last-of-type){margin-right:calc(var(--space-unit) * 2)}}@media only screen and (min-width: 1025px){input{width:calc(var(--space-unit) * 6)}}";const r=o;const s=class{constructor(a){t(this,a);this.otpChange=i(this,"otpChange",7);this.inputNum=6;this.status=undefined;this.message=undefined}emitInputChange(t){this.otpChange.emit({value:t})}componentWillLoad(){this.otp=[...Array(this.inputNum)];this.otpRef=[...Array(this.inputNum)]}render(){return a("div",{key:"9e28959418f6f1b382f16836935e12b3acddfa8f",class:"otp-container"},a("div",{key:"9348bd6807e797441789a465ebdae3a03d1a7534",class:"digits-container"},this.otp.map(((t,i)=>a("input",{class:this.status==e.ERROR?"error":null,onKeyDown:t=>{if(t.keyCode>47){this.otpRef[i].value=""}},onKeyUp:t=>{if(t.keyCode>47){i<this.inputNum-1&&this.otpRef[i+1].focus()}},onInput:t=>{this.otp[i]=t.target.value;this.emitInputChange(this.otp.join(""))},type:"text",minlength:"1",maxlength:"1",autoComplete:"off",ref:t=>this.otpRef[i]=t})))),a("z-input-message",{key:"87ee18c72daec6c0c903aa91e5a717c4d5a729b5",message:this.message,status:this.status}))}};s.style=r;export{s as z_otp};
2
+ //# sourceMappingURL=p-16b1b35a.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["stylesCss","ZOtpStyle0","ZOtp","emitInputChange","value","this","otpChange","emit","componentWillLoad","otp","Array","inputNum","otpRef","render","h","key","class","map","_val","i","status","InputStatus","ERROR","onKeyDown","e","keyCode","onKeyUp","focus","onInput","target","join","type","minlength","maxlength","autoComplete","ref","el","message"],"sources":["src/snowflakes/myz/z-otp/styles.css?tag=z-otp&encapsulation=shadow","src/snowflakes/myz/z-otp/index.tsx"],"sourcesContent":["input:focus {\n box-shadow: var(--shadow-focus-primary);\n outline: none !important;\n}\n\n:host {\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n}\n\n.digits-container {\n display: flex;\n justify-content: flex-start;\n}\n\ninput {\n width: calc(var(--space-unit) * 5);\n height: 72px;\n box-sizing: border-box;\n padding: 0;\n caret-color: transparent;\n color: var(--color-surface05);\n font-family: var(--font-family-sans);\n font-size: 32px;\n font-weight: 300;\n text-align: center;\n}\n\ninput.error {\n border: 1px solid;\n border-color: var(--color-error01);\n background-color: var(--color-error-inverse);\n border-radius: 4px;\n}\n\ninput:not(:last-of-type) {\n margin-right: var(--space-unit);\n}\n\n/* Tablet breakpoint */\n@media only screen and (min-width: 768px) {\n input:not(:last-of-type) {\n margin-right: calc(var(--space-unit) * 2);\n }\n}\n\n/* Desktop breakpoint */\n@media only screen and (min-width: 1025px) {\n input {\n width: calc(var(--space-unit) * 6);\n }\n}\n","import {Component, Event, EventEmitter, Prop, h} from \"@stencil/core\";\nimport {InputStatus} from \"../../../beans\";\n\n@Component({\n tag: \"z-otp\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZOtp {\n /** Input number */\n @Prop()\n inputNum?: number = 6;\n\n /** Input status */\n @Prop()\n status?: InputStatus;\n\n /** Input message */\n @Prop()\n message?: string;\n\n private otp: string[];\n\n private otpRef: HTMLInputElement[];\n\n /** Otp change event */\n @Event()\n otpChange: EventEmitter;\n\n private emitInputChange(value: string): void {\n this.otpChange.emit({value});\n }\n\n componentWillLoad(): void {\n this.otp = [...Array(this.inputNum)];\n this.otpRef = [...Array(this.inputNum)];\n }\n\n render(): HTMLDivElement {\n return (\n <div class=\"otp-container\">\n <div class=\"digits-container\">\n {this.otp.map((_val, i) => (\n <input\n class={this.status == InputStatus.ERROR ? \"error\" : null}\n onKeyDown={(e: KeyboardEvent) => {\n if (e.keyCode > 47) {\n this.otpRef[i].value = \"\";\n }\n }}\n onKeyUp={(e: KeyboardEvent) => {\n if (e.keyCode > 47) {\n i < this.inputNum - 1 && this.otpRef[i + 1].focus();\n }\n }}\n onInput={(e: InputEvent) => {\n this.otp[i] = (e.target as HTMLInputElement).value;\n this.emitInputChange(this.otp.join(\"\"));\n }}\n type=\"text\"\n minlength=\"1\"\n maxlength=\"1\"\n autoComplete=\"off\"\n ref={(el) => (this.otpRef[i] = el)}\n />\n ))}\n </div>\n <z-input-message\n message={this.message}\n status={this.status}\n ></z-input-message>\n </div>\n );\n }\n}\n"],"mappings":"sFAAA,MAAMA,EAAY,s5BAClB,MAAAC,EAAeD,E,MCOFE,EAAI,M,4EAGK,E,6CAkBZ,eAAAC,CAAgBC,GACtBC,KAAKC,UAAUC,KAAK,CAACH,S,CAGvB,iBAAAI,GACEH,KAAKI,IAAM,IAAIC,MAAML,KAAKM,WAC1BN,KAAKO,OAAS,IAAIF,MAAML,KAAKM,U,CAG/B,MAAAE,GACE,OACEC,EAAA,OAAAC,IAAA,2CAAKC,MAAM,iBACTF,EAAA,OAAAC,IAAA,2CAAKC,MAAM,oBACRX,KAAKI,IAAIQ,KAAI,CAACC,EAAMC,IACnBL,EAAA,SACEE,MAAOX,KAAKe,QAAUC,EAAYC,MAAQ,QAAU,KACpDC,UAAYC,IACV,GAAIA,EAAEC,QAAU,GAAI,CAClBpB,KAAKO,OAAOO,GAAGf,MAAQ,E,GAG3BsB,QAAUF,IACR,GAAIA,EAAEC,QAAU,GAAI,CAClBN,EAAId,KAAKM,SAAW,GAAKN,KAAKO,OAAOO,EAAI,GAAGQ,O,GAGhDC,QAAUJ,IACRnB,KAAKI,IAAIU,GAAMK,EAAEK,OAA4BzB,MAC7CC,KAAKF,gBAAgBE,KAAKI,IAAIqB,KAAK,IAAI,EAEzCC,KAAK,OACLC,UAAU,IACVC,UAAU,IACVC,aAAa,MACbC,IAAMC,GAAQ/B,KAAKO,OAAOO,GAAKiB,OAIrCtB,EAAA,mBAAAC,IAAA,2CACEsB,QAAShC,KAAKgC,QACdjB,OAAQf,KAAKe,S","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r as t,c as e,h as i,g as o}from"./p-cc3c02fe.js";import{g as a}from"./p-025f494e.js";import{m as n}from"./p-2c886e8b.js";const r=":host{font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>.dragdrop{position:relative;display:-ms-flexbox;display:flex;height:228px;-ms-flex-direction:column;flex-direction:column;padding:calc(var(--space-unit) * 2);border-color:var(--color-surface04);background-color:var(--color-surface02);background-image:url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='2' ry='2' stroke='%23CACCCEFF' stroke-width='2' stroke-dasharray='15%2c 10%2c 14%2c 11' stroke-dashoffset='3' stroke-linecap='square'/%3e%3c/svg%3e\");border-radius:2px;color:var(--color-default-text)}:host>.dragdrop.dragover *{pointer-events:none}:host>.dragdrop .dragover-container{position:absolute;z-index:10;top:0;left:0;display:none;width:100%;height:100%;background-color:var(--color-primary03);-webkit-box-shadow:var(--shadow-focus-primary);box-shadow:var(--shadow-focus-primary)}:host>.dragdrop .dragover-container .dragover-message{padding:10px 28px;background-color:var(--color-link-primary);color:var(--color-text-inverse)}:host>.dragdrop.dragover .dragover-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}";const s=r;const l=class{constructor(i){t(this,i);this.fileDropped=e(this,"fileDropped",7);this.dragAndDropLabel=undefined}fileDroppedHandler(t){this.fileDropped.emit(t)}renderOnDragOverMessage(){return i("div",{class:"dragover-container"},i("div",{class:"dragover-message"},i("span",{class:"body-2-sb"},this.dragAndDropLabel)))}render(){return i("div",{key:"41334ac77bca3fb0d30518480b702c815d95b125",tabIndex:0,ref:t=>this.dragDropContainer=t,class:"dragdrop",onDragOver:t=>{t.preventDefault();this.dragDropContainer.classList.add("dragover")},onDragLeave:()=>{this.dragDropContainer.classList.remove("dragover")},onDrop:t=>{t.preventDefault();if(t.dataTransfer.files.length){this.dragDropContainer.classList.remove("dragover");this.fileDroppedHandler(t.dataTransfer.files)}}},this.renderOnDragOverMessage(),i("slot",{key:"83344ee14fcec799690b644fe0a56cc86e1b4476"}))}};l.style=s;var d=window.CustomEvent;if(!d||typeof d==="object"){d=function t(e,i){i=i||{};var o=document.createEvent("CustomEvent");o.initCustomEvent(e,!!i.bubbles,!!i.cancelable,i.detail||null);return o};d.prototype=window.Event.prototype}function c(t,e){var i="on"+e.type.toLowerCase();if(typeof t[i]==="function"){t[i](e)}return t.dispatchEvent(e)}function h(t){while(t&&t!==document.body){var e=window.getComputedStyle(t);var i=function(t,i){return!(e[t]===undefined||e[t]===i)};if(e.opacity<1||i("zIndex","auto")||i("transform","none")||i("mixBlendMode","normal")||i("filter","none")||i("perspective","none")||e["isolation"]==="isolate"||e.position==="fixed"||e.webkitOverflowScrolling==="touch"){return true}t=t.parentElement}return false}function u(t){while(t){if(t.localName==="dialog"){return t}if(t.parentElement){t=t.parentElement}else if(t.parentNode){t=t.parentNode.host}else{t=null}}return null}function f(t){while(t&&t.shadowRoot&&t.shadowRoot.activeElement){t=t.shadowRoot.activeElement}if(t&&t.blur&&t!==document.body){t.blur()}}function m(t,e){for(var i=0;i<t.length;++i){if(t[i]===e){return true}}return false}function v(t){if(!t||!t.hasAttribute("method")){return false}return t.getAttribute("method").toLowerCase()==="dialog"}function b(t){var e=["button","input","keygen","select","textarea"];var i=e.map((function(t){return t+":not([disabled])"}));i.push('[tabindex]:not([disabled]):not([tabindex=""])');var o=t.querySelector(i.join(", "));if(!o&&"attachShadow"in Element.prototype){var a=t.querySelectorAll("*");for(var n=0;n<a.length;n++){if(a[n].tagName&&a[n].shadowRoot){o=b(a[n].shadowRoot);if(o){break}}}}return o}function p(t){return t.isConnected||document.body.contains(t)}function g(t){if(t.submitter){return t.submitter}var e=t.target;if(!(e instanceof HTMLFormElement)){return null}var i=k.formSubmitter;if(!i){var o=t.target;var a="getRootNode"in o&&o.getRootNode()||document;i=a.activeElement}if(!i||i.form!==e){return null}return i}function w(t){if(t.defaultPrevented){return}var e=t.target;var i=k.imagemapUseValue;var o=g(t);if(i===null&&o){i=o.value}var a=u(e);if(!a){return}var n=o&&o.getAttribute("formmethod")||e.getAttribute("method");if(n!=="dialog"){return}t.preventDefault();if(i!=null){a.close(i)}else{a.close()}}function y(t){this.dialog_=t;this.replacedStyleTop_=false;this.openAsModal_=false;if(!t.hasAttribute("role")){t.setAttribute("role","dialog")}t.show=this.show.bind(this);t.showModal=this.showModal.bind(this);t.close=this.close.bind(this);t.addEventListener("submit",w,false);if(!("returnValue"in t)){t.returnValue=""}if("MutationObserver"in window){var e=new MutationObserver(this.maybeHideModal.bind(this));e.observe(t,{attributes:true,attributeFilter:["open"]})}else{var i=false;var o=function(){i?this.downgradeModal():this.maybeHideModal();i=false}.bind(this);var a;var n=function(e){if(e.target!==t){return}var n="DOMNodeRemoved";i|=e.type.substr(0,n.length)===n;window.clearTimeout(a);a=window.setTimeout(o,0)};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach((function(e){t.addEventListener(e,n)}))}Object.defineProperty(t,"open",{set:this.setOpen.bind(this),get:t.hasAttribute.bind(t,"open")});this.backdrop_=document.createElement("div");this.backdrop_.className="backdrop";this.backdrop_.addEventListener("mouseup",this.backdropMouseEvent_.bind(this));this.backdrop_.addEventListener("mousedown",this.backdropMouseEvent_.bind(this));this.backdrop_.addEventListener("click",this.backdropMouseEvent_.bind(this))}y.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){if(this.dialog_.hasAttribute("open")&&p(this.dialog_)){return}this.downgradeModal()},downgradeModal:function(){if(!this.openAsModal_){return}this.openAsModal_=false;this.dialog_.style.zIndex="";if(this.replacedStyleTop_){this.dialog_.style.top="";this.replacedStyleTop_=false}this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_);k.dm.removeDialog(this)},setOpen:function(t){if(t){this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open","")}else{this.dialog_.removeAttribute("open");this.maybeHideModal()}},backdropMouseEvent_:function(t){if(!this.dialog_.hasAttribute("tabindex")){var e=document.createElement("div");this.dialog_.insertBefore(e,this.dialog_.firstChild);e.tabIndex=-1;e.focus();this.dialog_.removeChild(e)}else{this.dialog_.focus()}var i=document.createEvent("MouseEvents");i.initMouseEvent(t.type,t.bubbles,t.cancelable,window,t.detail,t.screenX,t.screenY,t.clientX,t.clientY,t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget);this.dialog_.dispatchEvent(i);t.stopPropagation()},focus_:function(){var t=this.dialog_.querySelector("[autofocus]:not([disabled])");if(!t&&this.dialog_.tabIndex>=0){t=this.dialog_}if(!t){t=b(this.dialog_)}f(document.activeElement);t&&t.focus()},updateZIndex:function(t,e){if(t<e){throw new Error("dialogZ should never be < backdropZ")}this.dialog_.style.zIndex=t;this.backdrop_.style.zIndex=e},show:function(){if(!this.dialog_.open){this.setOpen(true);this.focus_()}},showModal:function(){if(this.dialog_.hasAttribute("open")){throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.")}if(!p(this.dialog_)){throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.")}if(!k.dm.pushDialog(this)){throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.")}if(h(this.dialog_.parentElement)){console.warn("A dialog is being shown inside a stacking context. "+"This may cause it to be unusable. For more information, see this link: "+"https://github.com/GoogleChrome/dialog-polyfill/#stacking-context")}this.setOpen(true);this.openAsModal_=true;if(k.needsCentering(this.dialog_)){k.reposition(this.dialog_);this.replacedStyleTop_=true}else{this.replacedStyleTop_=false}this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling);this.focus_()},close:function(t){if(!this.dialog_.hasAttribute("open")){throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.")}this.setOpen(false);if(t!==undefined){this.dialog_.returnValue=t}var e=new d("close",{bubbles:false,cancelable:false});c(this.dialog_,e)}};var k={};k.reposition=function(t){var e=document.body.scrollTop||document.documentElement.scrollTop;var i=e+(window.innerHeight-t.offsetHeight)/2;t.style.top=Math.max(e,i)+"px"};k.isInlinePositionSetByStylesheet=function(t){for(var e=0;e<document.styleSheets.length;++e){var i=document.styleSheets[e];var o=null;try{o=i.cssRules}catch(t){}if(!o){continue}for(var a=0;a<o.length;++a){var n=o[a];var r=null;try{r=document.querySelectorAll(n.selectorText)}catch(t){}if(!r||!m(r,t)){continue}var s=n.style.getPropertyValue("top");var l=n.style.getPropertyValue("bottom");if(s&&s!=="auto"||l&&l!=="auto"){return true}}}return false};k.needsCentering=function(t){var e=window.getComputedStyle(t);if(e.position!=="absolute"){return false}if(t.style.top!=="auto"&&t.style.top!==""||t.style.bottom!=="auto"&&t.style.bottom!==""){return false}return!k.isInlinePositionSetByStylesheet(t)};k.forceRegisterDialog=function(t){if(window.HTMLDialogElement||t.showModal){console.warn("This browser already supports <dialog>, the polyfill "+"may not work correctly",t)}if(t.localName!=="dialog"){throw new Error("Failed to register dialog: The element is not a dialog.")}new y(t)};k.registerDialog=function(t){if(!t.showModal){k.forceRegisterDialog(t)}};k.DialogManager=function(){this.pendingDialogStack=[];var t=this.checkDOM_.bind(this);this.overlay=document.createElement("div");this.overlay.className="_dialog_overlay";this.overlay.addEventListener("click",function(e){this.forwardTab_=undefined;e.stopPropagation();t([])}.bind(this));this.handleKey_=this.handleKey_.bind(this);this.handleFocus_=this.handleFocus_.bind(this);this.zIndexLow_=1e5;this.zIndexHigh_=1e5+150;this.forwardTab_=undefined;if("MutationObserver"in window){this.mo_=new MutationObserver((function(e){var i=[];e.forEach((function(t){for(var e=0,o;o=t.removedNodes[e];++e){if(!(o instanceof Element)){continue}else if(o.localName==="dialog"){i.push(o)}i=i.concat(o.querySelectorAll("dialog"))}}));i.length&&t(i)}))}};k.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,true);document.addEventListener("keydown",this.handleKey_);this.mo_&&this.mo_.observe(document,{childList:true,subtree:true})};k.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,true);document.removeEventListener("keydown",this.handleKey_);this.mo_&&this.mo_.disconnect()};k.DialogManager.prototype.updateStacking=function(){var t=this.zIndexHigh_;for(var e=0,i;i=this.pendingDialogStack[e];++e){i.updateZIndex(--t,--t);if(e===0){this.overlay.style.zIndex=--t}}var o=this.pendingDialogStack[0];if(o){var a=o.dialog.parentNode||document.body;a.appendChild(this.overlay)}else if(this.overlay.parentNode){this.overlay.parentNode.removeChild(this.overlay)}};k.DialogManager.prototype.containedByTopDialog_=function(t){while(t=u(t)){for(var e=0,i;i=this.pendingDialogStack[e];++e){if(i.dialog===t){return e===0}}t=t.parentElement}return false};k.DialogManager.prototype.handleFocus_=function(t){var e=t.composedPath?t.composedPath()[0]:t.target;if(this.containedByTopDialog_(e)){return}if(document.activeElement===document.documentElement){return}t.preventDefault();t.stopPropagation();f(e);if(this.forwardTab_===undefined){return}var i=this.pendingDialogStack[0];var o=i.dialog;var a=o.compareDocumentPosition(e);if(a&Node.DOCUMENT_POSITION_PRECEDING){if(this.forwardTab_){i.focus_()}else if(e!==document.documentElement){document.documentElement.focus()}}return false};k.DialogManager.prototype.handleKey_=function(t){this.forwardTab_=undefined;if(t.keyCode===27){t.preventDefault();t.stopPropagation();var e=new d("cancel",{bubbles:false,cancelable:true});var i=this.pendingDialogStack[0];if(i&&c(i.dialog,e)){i.dialog.close()}}else if(t.keyCode===9){this.forwardTab_=!t.shiftKey}};k.DialogManager.prototype.checkDOM_=function(t){var e=this.pendingDialogStack.slice();e.forEach((function(e){if(t.indexOf(e.dialog)!==-1){e.downgradeModal()}else{e.maybeHideModal()}}))};k.DialogManager.prototype.pushDialog=function(t){var e=(this.zIndexHigh_-this.zIndexLow_)/2-1;if(this.pendingDialogStack.length>=e){return false}if(this.pendingDialogStack.unshift(t)===1){this.blockDocument()}this.updateStacking();return true};k.DialogManager.prototype.removeDialog=function(t){var e=this.pendingDialogStack.indexOf(t);if(e===-1){return}this.pendingDialogStack.splice(e,1);if(this.pendingDialogStack.length===0){this.unblockDocument()}this.updateStacking()};k.dm=new k.DialogManager;k.formSubmitter=null;k.imagemapUseValue=null;if(window.HTMLDialogElement===undefined){var x=document.createElement("form");x.setAttribute("method","dialog");if(x.method!=="dialog"){var M=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(M){var E=M.get;M.get=function(){if(v(this)){return"dialog"}return E.call(this)};var z=M.set;M.set=function(t){if(typeof t==="string"&&t.toLowerCase()==="dialog"){return this.setAttribute("method",t)}return z.call(this,t)};Object.defineProperty(HTMLFormElement.prototype,"method",M)}}document.addEventListener("click",(function(t){k.formSubmitter=null;k.imagemapUseValue=null;if(t.defaultPrevented){return}var e=t.target;if("composedPath"in t){var i=t.composedPath();e=i.shift()||e}if(!e||!v(e.form)){return}var o=e.type==="submit"&&["button","input"].indexOf(e.localName)>-1;if(!o){if(!(e.localName==="input"&&e.type==="image")){return}k.imagemapUseValue=t.offsetX+","+t.offsetY}var a=u(e);if(!a){return}k.formSubmitter=e}),false);document.addEventListener("submit",(function(t){var e=t.target;var i=u(e);if(i){return}var o=g(t);var a=o&&o.getAttribute("formmethod")||e.getAttribute("method");if(a==="dialog"){t.preventDefault()}}));var C=HTMLFormElement.prototype.submit;var O=function(){if(!v(this)){return C.call(this)}var t=u(this);t&&t.close()};HTMLFormElement.prototype.submit=O}const F='*:focus{border-radius:50%;-webkit-box-shadow:var(--shadow-focus-primary);box-shadow:var(--shadow-focus-primary);outline:none !important}:host{font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>dialog{padding:0;border:none;margin:0;background-color:transparent}:host>dialog:modal{width:100%;max-width:100%;max-height:100%}:host>dialog::-webkit-backdrop{display:none}:host>dialog::-ms-backdrop{display:none}:host>dialog::backdrop{display:none}:host>dialog+.backdrop{display:none}:host>dialog:not([open]){display:none}:host>dialog[open]{display:block}.modal-container{z-index:1010;display:-ms-flexbox;display:flex;overflow:-moz-scrollbars-none;width:100%;height:100vh;-ms-flex-direction:column;flex-direction:column}.modal-container>.modal-content-scroll-outside{overflow:auto;background:var(--color-surface01)}.modal-container>header{padding:calc(var(--space-unit) * 1.75) calc(var(--space-unit) * 2) calc(var(--space-unit) * 1.75)\n calc(var(--space-unit) * 2);background:var(--color-surface02)}.modal-container>header button{padding:0;border:none;margin:0;margin-left:auto;background:transparent;cursor:pointer}.modal-container>header z-icon{--z-icon-width:calc(var(--space-unit) * 2.25);--z-icon-height:calc(var(--space-unit) * 2.25);display:-ms-flexbox;display:flex;fill:var(--color-primary01-icon)}.modal-container>header>div{display:-ms-flexbox;display:flex;width:100%;-ms-flex-align:baseline;align-items:baseline;margin-right:calc(var(--space-unit) * 2)}.modal-container>header h1,.modal-container>header .subtitle{padding:0;margin:0;color:var(--color-default-text);font-weight:var(--font-sb)}.modal-container>header h1{font-size:var(--font-size-5);letter-spacing:0;line-height:1.4}.modal-container>header .subtitle{font-size:var(--font-size-3);font-weight:var(--font-rg);letter-spacing:0;line-height:1.5}.modal-container>header>div>h1 *:empty{display:none}.modal-container>header h1+.subtitle{margin-top:calc(var(--space-unit) * 0.5)}.modal-container-scroll-inside>.modal-content-scroll-inside{overflow:hidden auto;-ms-flex:1 auto;flex:1 auto;background:var(--color-surface01)}.modal-container-scroll-inside>.modal-content-scroll-inside::-webkit-scrollbar,.modal-container-scroll-outside>.modal-content-scroll-outside::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}.modal-container-scroll-inside>.modal-content-scroll-inside::-webkit-scrollbar-thumb,.modal-container-scroll-outside>.modal-content-scroll-outside::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01)}.modal-container-scroll-inside>.modal-content-scroll-inside::-webkit-scrollbar-thumb:hover,.modal-container-scroll-outside>.modal-content-scroll-outside::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.modal-container-scroll-inside .modal-content-scroll-inside,.modal-container-scroll-outside .modal-content-scroll-outside{scrollbar-color:var(--color-primary01) transparent}@media only screen and (min-width: 768px){.modal-background{position:fixed;top:0;left:0;overflow:hidden;width:100vw;height:100vh;background-color:var(--gray900);opacity:0.7}.modal-background.modal-background-scroll-outside{position:-webkit-sticky;position:sticky}.modal-container-scroll-inside{position:fixed;top:calc(var(--space-unit) * 6);left:50%;overflow:hidden;width:auto;min-width:calc(var(--space-unit) * 40);height:auto;min-height:calc(var(--space-unit) * 40);max-height:calc(100vh - calc(var(--space-unit) * 6 * 2));border-radius:var(--border-radius);-webkit-transform:translateX(-50%);transform:translateX(-50%)}.modal-container-scroll-outside{position:absolute;top:calc(var(--space-unit) * 6);left:50%;display:block;overflow:initial;width:auto;min-width:calc(var(--space-unit) * 40);height:auto;min-height:calc(var(--space-unit) * 40);max-height:calc(100vh - calc(var(--space-unit) * 6 * 2));-webkit-transform:translateX(-50%);transform:translateX(-50%)}.modal-container>.modal-content-scroll-outside{overflow:initial}.modal-container-scroll-outside>header,.modal-container-scroll-inside>header{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius)}.modal-container-scroll-outside::after{display:block;height:calc(var(--space-unit) * 6);content:" "}.modal-dialog{position:fixed;top:0;left:0;height:auto;overflow-x:hidden;overflow-y:auto}.modal-content-scroll-outside{border-bottom-left-radius:var(--border-radius);border-bottom-right-radius:var(--border-radius)}.modal-dialog::-webkit-scrollbar{display:none}}@media only screen and (min-width: 1152px){.modal-container>header{padding-top:calc(var(--space-unit) * 1.5);padding-bottom:calc(var(--space-unit) * 1.5)}.modal-container>header h1{font-size:var(--font-size-6);font-weight:var(--font-sb);letter-spacing:0;line-height:1.333}.modal-container>header .subtitle{font-size:var(--font-size-4);font-weight:var(--font-rg);letter-spacing:0;line-height:1.5}.modal-container>header h1+.subtitle{margin-top:0}}';const D=F;const T=':is(button, input, select, textarea, [contenteditable=""], [contenteditable="true"], a[href], [tabindex], summary):not([disabled], [disabled=""], [tabindex="-1"], [aria-hidden="true"], [hidden])';const j=class{constructor(i){t(this,i);this.modalClose=e(this,"modalClose",7);this.modalHeaderActive=e(this,"modalHeaderActive",7);this.modalBackgroundClick=e(this,"modalBackgroundClick",7);this.modalid=undefined;this.modaltitle=undefined;this.modalsubtitle=undefined;this.closeButtonLabel="chiudi modale";this.alertdialog=false;this.closable=true;this.scrollInside=true}emitModalClose(){if(this.closable){this.modalClose.emit({modalid:this.modalid})}}emitModalHeaderActive(){this.modalHeaderActive.emit({modalid:this.modalid})}emitBackgroundClick(){if(this.closable){this.modalBackgroundClick.emit({modalid:this.modalid})}}handlePageOverflow(){const t=window.matchMedia(`(max-width: ${n}px)`);document.body.style["overflow-y"]=t.matches?"hidden":""}componentDidLoad(){if(typeof window.HTMLDialogElement!=="function"){if(!this.dialog.localName){Object.defineProperty(this.dialog,"localName",{value:"dialog"})}k.registerDialog(this.dialog);this.dialog.setAttribute("open","true")}else{this.open()}this.handlePageOverflow()}async open(){var t;(t=this.dialog)===null||t===void 0?void 0:t.showModal()}async close(){var t;if(this.closable){(t=this.dialog)===null||t===void 0?void 0:t.close()}}get focusableElements(){return[...Array.from(this.host.shadowRoot.querySelectorAll(T)),...Array.from(this.host.querySelectorAll(T))].filter((t=>getComputedStyle(t).display!=="none"))}handleKeyDown(t){if(t.code===a.ESC&&!this.closable){t.preventDefault()}if(t.code!==a.TAB){return}const e=this.focusableElements;const i=this.host.shadowRoot.activeElement;const o=this.host.ownerDocument.activeElement;const n=e[0];const r=e[e.length-1];if(t.shiftKey&&(i==n||o==n)){t.preventDefault();r.focus()}else if(!t.shiftKey&&(i==r||o==r)){t.preventDefault();n.focus()}}closeButtonSlot(){if(this.closable){return i("slot",{name:"modalCloseButton"},i("button",{"aria-label":this.closeButtonLabel,onClick:()=>this.close()},i("z-icon",{name:"multiply-circle-filled"})))}}handleEscape(t){if(this.closable){return}t.preventDefault()}render(){return i("dialog",{key:"50df4e07a74c86679fd2243e6795da0eeaae9c2c",class:{"modal-dialog":!this.scrollInside},"aria-labelledby":"modal-title","aria-describedby":"modal-content",role:this.alertdialog?"alertdialog":undefined,ref:t=>this.dialog=t,onClose:()=>this.emitModalClose(),onCancel:t=>this.handleEscape(t)},i("div",{key:"035ad0b71a6726e43c1fb52dae69257afd054525",class:{"modal-container":true,"modal-container-scroll-inside":this.scrollInside,"modal-container-scroll-outside":!this.scrollInside},id:this.modalid},i("header",{key:"8f9e92a6c41e4dbff647c4140a1efc42adf258a9",onClick:this.emitModalHeaderActive.bind(this)},i("div",{key:"3521275e24a100ba06c2f259ef239a361a6841e5"},this.modaltitle&&i("h1",{key:"3c345754f355fbe4cb7c0515404b01a3ff647b26",id:"modal-title"},this.modaltitle),this.closeButtonSlot()),this.modalsubtitle&&i("div",{key:"5307334b7aca04ae351a0a69cbdaa6ec0ee32654",class:"subtitle",id:"modal-subtitle"},this.modalsubtitle)),i("div",{key:"fe5a158f3a0f0d6a06e83ce4cf32fb50ea5bf79f",class:{"modal-content-scroll-inside":this.scrollInside,"modal-content-scroll-outside":!this.scrollInside},id:"modal-content"},i("slot",{key:"c2e5855dc48026fda519ad69bf5a7f9c3c1a2773",name:"modalContent"}))),i("div",{key:"d7f80d8206c262bf5166ee1231d78eb0e55e4bb5",class:{"modal-background":true,"modal-background-scroll-outside":!this.scrollInside},"data-action":"modalBackground","data-modal":this.modalid,onClick:()=>{this.emitBackgroundClick();this.close()}}))}get host(){return o(this)}};j.style=D;export{l as z_dragdrop_area,j as z_modal};
2
+ //# sourceMappingURL=p-21941767.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["stylesCss","ZDragdropAreaStyle0","ZDragdropArea","fileDroppedHandler","files","this","fileDropped","emit","renderOnDragOverMessage","h","class","dragAndDropLabel","render","key","tabIndex","ref","val","dragDropContainer","onDragOver","e","preventDefault","classList","add","onDragLeave","remove","onDrop","dataTransfer","length","supportCustomEvent","window","CustomEvent","event","x","ev","document","createEvent","initCustomEvent","bubbles","cancelable","detail","prototype","Event","safeDispatchEvent","target","check","type","toLowerCase","dispatchEvent","createsStackingContext","el","body","s","getComputedStyle","invalid","k","ok","undefined","opacity","position","webkitOverflowScrolling","parentElement","findNearestDialog","localName","parentNode","host","safeBlur","shadowRoot","activeElement","blur","inNodeList","nodeList","node","i","isFormMethodDialog","hasAttribute","getAttribute","findFocusableElementWithin","hostElement","opts","query","map","push","querySelector","join","Element","elems","querySelectorAll","tagName","isConnected","element","contains","findFormSubmitter","submitter","form","HTMLFormElement","dialogPolyfill","formSubmitter","root","getRootNode","maybeHandleSubmit","defaultPrevented","value","imagemapUseValue","dialog","formmethod","close","dialogPolyfillInfo","dialog_","replacedStyleTop_","openAsModal_","setAttribute","show","bind","showModal","addEventListener","returnValue","mo","MutationObserver","maybeHideModal","observe","attributes","attributeFilter","removed","cb","downgradeModal","timeout","delayModel","cand","substr","clearTimeout","setTimeout","forEach","name","Object","defineProperty","set","setOpen","get","backdrop_","createElement","className","backdropMouseEvent_","style","zIndex","top","removeChild","dm","removeDialog","removeAttribute","fake","insertBefore","firstChild","focus","redirectedEvent","initMouseEvent","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","stopPropagation","focus_","updateZIndex","dialogZ","backdropZ","Error","open","pushDialog","console","warn","needsCentering","reposition","nextSibling","opt_returnValue","closeEvent","scrollTop","documentElement","topValue","innerHeight","offsetHeight","Math","max","isInlinePositionSetByStylesheet","styleSheets","styleSheet","cssRules","j","rule","selectedNodes","selectorText","cssTop","getPropertyValue","cssBottom","computedStyle","bottom","forceRegisterDialog","HTMLDialogElement","registerDialog","DialogManager","pendingDialogStack","checkDOM","checkDOM_","overlay","forwardTab_","handleKey_","handleFocus_","zIndexLow_","zIndexHigh_","mo_","records","rec","c","removedNodes","concat","blockDocument","childList","subtree","unblockDocument","removeEventListener","disconnect","updateStacking","dpi","last","p","appendChild","containedByTopDialog_","candidate","composedPath","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","keyCode","cancelEvent","clone","slice","indexOf","allowed","unshift","index","splice","testForm","method","methodDescriptor","getOwnPropertyDescriptor","realGet","call","realSet","v","path","shift","valid","offsetX","offsetY","nativeFormSubmit","submit","replacementFormSubmit","ZModalStyle0","FOCUSABLE_ELEMENTS_SELECTOR","ZModal","emitModalClose","closable","modalClose","modalid","emitModalHeaderActive","modalHeaderActive","emitBackgroundClick","modalBackgroundClick","handlePageOverflow","mobileMediaQuery","matchMedia","mobileBreakpoint","matches","componentDidLoad","_a","focusableElements","Array","from","filter","display","handleKeyDown","code","KeyboardCode","ESC","TAB","shadowActiveElement","ownerDocument","firstFocusableElement","lastFocusableElement","closeButtonSlot","closeButtonLabel","onClick","handleEscape","scrollInside","role","alertdialog","onClose","onCancel","id","modaltitle","modalsubtitle"],"sources":["src/components/file-upload/z-dragdrop-area/styles.css?tag=z-dragdrop-area&encapsulation=shadow","src/components/file-upload/z-dragdrop-area/index.tsx","node_modules/dialog-polyfill/dist/dialog-polyfill.esm.js","src/components/z-modal/styles.css?tag=z-modal&encapsulation=shadow","src/components/z-modal/index.tsx"],"sourcesContent":[":host {\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n}\n\n:host > .dragdrop {\n position: relative;\n display: flex;\n height: 228px;\n flex-direction: column;\n padding: calc(var(--space-unit) * 2);\n border-color: var(--color-surface04);\n background-color: var(--color-surface02);\n\n /* Native CSS properties don't support the customization of border-style.\n Therefore, we use a trick with an SVG image inside background-image property.\n The SVG features give us the ability to change the distance between dashed lines, set custom pattern, add dash offset or even change a line cap.\n Generated SVG image is vector and it fills width and height of elements by 100%, so it doesn't matter what size elements have. */\n background-image: url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='2' ry='2' stroke='%23CACCCEFF' stroke-width='2' stroke-dasharray='15%2c 10%2c 14%2c 11' stroke-dashoffset='3' stroke-linecap='square'/%3e%3c/svg%3e\");\n border-radius: 2px;\n color: var(--color-default-text);\n}\n\n/* https://stackoverflow.com/questions/7110353/html5-dragleave-fired-when-hovering-a-child-element */\n:host > .dragdrop.dragover * {\n pointer-events: none;\n}\n\n:host > .dragdrop .dragover-container {\n position: absolute;\n z-index: 10;\n top: 0;\n left: 0;\n display: none;\n width: 100%;\n height: 100%;\n background-color: var(--color-primary03);\n box-shadow: var(--shadow-focus-primary);\n}\n\n:host > .dragdrop .dragover-container .dragover-message {\n padding: 10px 28px;\n background-color: var(--color-link-primary);\n color: var(--color-text-inverse);\n}\n\n:host > .dragdrop.dragover .dragover-container {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n","import {Component, Event, EventEmitter, Prop, h} from \"@stencil/core\";\n\n@Component({\n tag: \"z-dragdrop-area\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZDragdropArea {\n /** drag & drop button label */\n @Prop()\n dragAndDropLabel: string;\n\n /** Emitted when user drop one or more files */\n @Event()\n fileDropped: EventEmitter;\n\n private fileDroppedHandler(files: FileList): void {\n this.fileDropped.emit(files);\n }\n\n private dragDropContainer: HTMLDivElement;\n\n private renderOnDragOverMessage(): HTMLDivElement {\n return (\n <div class=\"dragover-container\">\n <div class=\"dragover-message\">\n <span class=\"body-2-sb\">{this.dragAndDropLabel}</span>\n </div>\n </div>\n );\n }\n\n render(): HTMLDivElement {\n return (\n <div\n tabIndex={0}\n ref={(val) => (this.dragDropContainer = val)}\n class=\"dragdrop\"\n onDragOver={(e) => {\n e.preventDefault();\n this.dragDropContainer.classList.add(\"dragover\");\n }}\n onDragLeave={() => {\n this.dragDropContainer.classList.remove(\"dragover\");\n }}\n onDrop={(e) => {\n e.preventDefault();\n if (e.dataTransfer.files.length) {\n this.dragDropContainer.classList.remove(\"dragover\");\n this.fileDroppedHandler(e.dataTransfer.files);\n }\n }}\n >\n {this.renderOnDragOverMessage()}\n <slot />\n </div>\n );\n }\n}\n","// nb. This is for IE10 and lower _only_.\nvar supportCustomEvent = window.CustomEvent;\nif (!supportCustomEvent || typeof supportCustomEvent === 'object') {\n supportCustomEvent = function CustomEvent(event, x) {\n x = x || {};\n var ev = document.createEvent('CustomEvent');\n ev.initCustomEvent(event, !!x.bubbles, !!x.cancelable, x.detail || null);\n return ev;\n };\n supportCustomEvent.prototype = window.Event.prototype;\n}\n\n/**\n * Dispatches the passed event to both an \"on<type>\" handler as well as via the\n * normal dispatch operation. Does not bubble.\n *\n * @param {!EventTarget} target\n * @param {!Event} event\n * @return {boolean}\n */\nfunction safeDispatchEvent(target, event) {\n var check = 'on' + event.type.toLowerCase();\n if (typeof target[check] === 'function') {\n target[check](event);\n }\n return target.dispatchEvent(event);\n}\n\n/**\n * @param {Element} el to check for stacking context\n * @return {boolean} whether this el or its parents creates a stacking context\n */\nfunction createsStackingContext(el) {\n while (el && el !== document.body) {\n var s = window.getComputedStyle(el);\n var invalid = function(k, ok) {\n return !(s[k] === undefined || s[k] === ok);\n };\n\n if (s.opacity < 1 ||\n invalid('zIndex', 'auto') ||\n invalid('transform', 'none') ||\n invalid('mixBlendMode', 'normal') ||\n invalid('filter', 'none') ||\n invalid('perspective', 'none') ||\n s['isolation'] === 'isolate' ||\n s.position === 'fixed' ||\n s.webkitOverflowScrolling === 'touch') {\n return true;\n }\n el = el.parentElement;\n }\n return false;\n}\n\n/**\n * Finds the nearest <dialog> from the passed element.\n *\n * @param {Element} el to search from\n * @return {HTMLDialogElement} dialog found\n */\nfunction findNearestDialog(el) {\n while (el) {\n if (el.localName === 'dialog') {\n return /** @type {HTMLDialogElement} */ (el);\n }\n if (el.parentElement) {\n el = el.parentElement;\n } else if (el.parentNode) {\n el = el.parentNode.host;\n } else {\n el = null;\n }\n }\n return null;\n}\n\n/**\n * Blur the specified element, as long as it's not the HTML body element.\n * This works around an IE9/10 bug - blurring the body causes Windows to\n * blur the whole application.\n *\n * @param {Element} el to blur\n */\nfunction safeBlur(el) {\n // Find the actual focused element when the active element is inside a shadow root\n while (el && el.shadowRoot && el.shadowRoot.activeElement) {\n el = el.shadowRoot.activeElement;\n }\n\n if (el && el.blur && el !== document.body) {\n el.blur();\n }\n}\n\n/**\n * @param {!NodeList} nodeList to search\n * @param {Node} node to find\n * @return {boolean} whether node is inside nodeList\n */\nfunction inNodeList(nodeList, node) {\n for (var i = 0; i < nodeList.length; ++i) {\n if (nodeList[i] === node) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * @param {HTMLFormElement} el to check\n * @return {boolean} whether this form has method=\"dialog\"\n */\nfunction isFormMethodDialog(el) {\n if (!el || !el.hasAttribute('method')) {\n return false;\n }\n return el.getAttribute('method').toLowerCase() === 'dialog';\n}\n\n/**\n * @param {!DocumentFragment|!Element} hostElement\n * @return {?Element}\n */\nfunction findFocusableElementWithin(hostElement) {\n // Note that this is 'any focusable area'. This list is probably not exhaustive, but the\n // alternative involves stepping through and trying to focus everything.\n var opts = ['button', 'input', 'keygen', 'select', 'textarea'];\n var query = opts.map(function(el) {\n return el + ':not([disabled])';\n });\n // TODO(samthor): tabindex values that are not numeric are not focusable.\n query.push('[tabindex]:not([disabled]):not([tabindex=\"\"])'); // tabindex != \"\", not disabled\n var target = hostElement.querySelector(query.join(', '));\n\n if (!target && 'attachShadow' in Element.prototype) {\n // If we haven't found a focusable target, see if the host element contains an element\n // which has a shadowRoot.\n // Recursively search for the first focusable item in shadow roots.\n var elems = hostElement.querySelectorAll('*');\n for (var i = 0; i < elems.length; i++) {\n if (elems[i].tagName && elems[i].shadowRoot) {\n target = findFocusableElementWithin(elems[i].shadowRoot);\n if (target) {\n break;\n }\n }\n }\n }\n return target;\n}\n\n/**\n * Determines if an element is attached to the DOM.\n * @param {Element} element to check\n * @return {boolean} whether the element is in DOM\n */\nfunction isConnected(element) {\n return element.isConnected || document.body.contains(element);\n}\n\n/**\n * @param {!Event} event\n * @return {?Element}\n */\nfunction findFormSubmitter(event) {\n if (event.submitter) {\n return event.submitter;\n }\n\n var form = event.target;\n if (!(form instanceof HTMLFormElement)) {\n return null;\n }\n\n var submitter = dialogPolyfill.formSubmitter;\n if (!submitter) {\n var target = event.target;\n var root = ('getRootNode' in target && target.getRootNode() || document);\n submitter = root.activeElement;\n }\n\n if (!submitter || submitter.form !== form) {\n return null;\n }\n return submitter;\n}\n\n/**\n * @param {!Event} event\n */\nfunction maybeHandleSubmit(event) {\n if (event.defaultPrevented) {\n return;\n }\n var form = /** @type {!HTMLFormElement} */ (event.target);\n\n // We'd have a value if we clicked on an imagemap.\n var value = dialogPolyfill.imagemapUseValue;\n var submitter = findFormSubmitter(event);\n if (value === null && submitter) {\n value = submitter.value;\n }\n\n // There should always be a dialog as this handler is added specifically on them, but check just\n // in case.\n var dialog = findNearestDialog(form);\n if (!dialog) {\n return;\n }\n\n // Prefer formmethod on the button.\n var formmethod = submitter && submitter.getAttribute('formmethod') || form.getAttribute('method');\n if (formmethod !== 'dialog') {\n return;\n }\n event.preventDefault();\n\n if (value != null) {\n // nb. we explicitly check against null/undefined\n dialog.close(value);\n } else {\n dialog.close();\n }\n}\n\n/**\n * @param {!HTMLDialogElement} dialog to upgrade\n * @constructor\n */\nfunction dialogPolyfillInfo(dialog) {\n this.dialog_ = dialog;\n this.replacedStyleTop_ = false;\n this.openAsModal_ = false;\n\n // Set a11y role. Browsers that support dialog implicitly know this already.\n if (!dialog.hasAttribute('role')) {\n dialog.setAttribute('role', 'dialog');\n }\n\n dialog.show = this.show.bind(this);\n dialog.showModal = this.showModal.bind(this);\n dialog.close = this.close.bind(this);\n\n dialog.addEventListener('submit', maybeHandleSubmit, false);\n\n if (!('returnValue' in dialog)) {\n dialog.returnValue = '';\n }\n\n if ('MutationObserver' in window) {\n var mo = new MutationObserver(this.maybeHideModal.bind(this));\n mo.observe(dialog, {attributes: true, attributeFilter: ['open']});\n } else {\n // IE10 and below support. Note that DOMNodeRemoved etc fire _before_ removal. They also\n // seem to fire even if the element was removed as part of a parent removal. Use the removed\n // events to force downgrade (useful if removed/immediately added).\n var removed = false;\n var cb = function() {\n removed ? this.downgradeModal() : this.maybeHideModal();\n removed = false;\n }.bind(this);\n var timeout;\n var delayModel = function(ev) {\n if (ev.target !== dialog) { return; } // not for a child element\n var cand = 'DOMNodeRemoved';\n removed |= (ev.type.substr(0, cand.length) === cand);\n window.clearTimeout(timeout);\n timeout = window.setTimeout(cb, 0);\n };\n ['DOMAttrModified', 'DOMNodeRemoved', 'DOMNodeRemovedFromDocument'].forEach(function(name) {\n dialog.addEventListener(name, delayModel);\n });\n }\n // Note that the DOM is observed inside DialogManager while any dialog\n // is being displayed as a modal, to catch modal removal from the DOM.\n\n Object.defineProperty(dialog, 'open', {\n set: this.setOpen.bind(this),\n get: dialog.hasAttribute.bind(dialog, 'open')\n });\n\n this.backdrop_ = document.createElement('div');\n this.backdrop_.className = 'backdrop';\n this.backdrop_.addEventListener('mouseup' , this.backdropMouseEvent_.bind(this));\n this.backdrop_.addEventListener('mousedown', this.backdropMouseEvent_.bind(this));\n this.backdrop_.addEventListener('click' , this.backdropMouseEvent_.bind(this));\n}\n\ndialogPolyfillInfo.prototype = /** @type {HTMLDialogElement.prototype} */ ({\n\n get dialog() {\n return this.dialog_;\n },\n\n /**\n * Maybe remove this dialog from the modal top layer. This is called when\n * a modal dialog may no longer be tenable, e.g., when the dialog is no\n * longer open or is no longer part of the DOM.\n */\n maybeHideModal: function() {\n if (this.dialog_.hasAttribute('open') && isConnected(this.dialog_)) { return; }\n this.downgradeModal();\n },\n\n /**\n * Remove this dialog from the modal top layer, leaving it as a non-modal.\n */\n downgradeModal: function() {\n if (!this.openAsModal_) { return; }\n this.openAsModal_ = false;\n this.dialog_.style.zIndex = '';\n\n // This won't match the native <dialog> exactly because if the user set top on a centered\n // polyfill dialog, that top gets thrown away when the dialog is closed. Not sure it's\n // possible to polyfill this perfectly.\n if (this.replacedStyleTop_) {\n this.dialog_.style.top = '';\n this.replacedStyleTop_ = false;\n }\n\n // Clear the backdrop and remove from the manager.\n this.backdrop_.parentNode && this.backdrop_.parentNode.removeChild(this.backdrop_);\n dialogPolyfill.dm.removeDialog(this);\n },\n\n /**\n * @param {boolean} value whether to open or close this dialog\n */\n setOpen: function(value) {\n if (value) {\n this.dialog_.hasAttribute('open') || this.dialog_.setAttribute('open', '');\n } else {\n this.dialog_.removeAttribute('open');\n this.maybeHideModal(); // nb. redundant with MutationObserver\n }\n },\n\n /**\n * Handles mouse events ('mouseup', 'mousedown', 'click') on the fake .backdrop element, redirecting them as if\n * they were on the dialog itself.\n *\n * @param {!Event} e to redirect\n */\n backdropMouseEvent_: function(e) {\n if (!this.dialog_.hasAttribute('tabindex')) {\n // Clicking on the backdrop should move the implicit cursor, even if dialog cannot be\n // focused. Create a fake thing to focus on. If the backdrop was _before_ the dialog, this\n // would not be needed - clicks would move the implicit cursor there.\n var fake = document.createElement('div');\n this.dialog_.insertBefore(fake, this.dialog_.firstChild);\n fake.tabIndex = -1;\n fake.focus();\n this.dialog_.removeChild(fake);\n } else {\n this.dialog_.focus();\n }\n\n var redirectedEvent = document.createEvent('MouseEvents');\n redirectedEvent.initMouseEvent(e.type, e.bubbles, e.cancelable, window,\n e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey,\n e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget);\n this.dialog_.dispatchEvent(redirectedEvent);\n e.stopPropagation();\n },\n\n /**\n * Focuses on the first focusable element within the dialog. This will always blur the current\n * focus, even if nothing within the dialog is found.\n */\n focus_: function() {\n // Find element with `autofocus` attribute, or fall back to the first form/tabindex control.\n var target = this.dialog_.querySelector('[autofocus]:not([disabled])');\n if (!target && this.dialog_.tabIndex >= 0) {\n target = this.dialog_;\n }\n if (!target) {\n target = findFocusableElementWithin(this.dialog_);\n }\n safeBlur(document.activeElement);\n target && target.focus();\n },\n\n /**\n * Sets the zIndex for the backdrop and dialog.\n *\n * @param {number} dialogZ\n * @param {number} backdropZ\n */\n updateZIndex: function(dialogZ, backdropZ) {\n if (dialogZ < backdropZ) {\n throw new Error('dialogZ should never be < backdropZ');\n }\n this.dialog_.style.zIndex = dialogZ;\n this.backdrop_.style.zIndex = backdropZ;\n },\n\n /**\n * Shows the dialog. If the dialog is already open, this does nothing.\n */\n show: function() {\n if (!this.dialog_.open) {\n this.setOpen(true);\n this.focus_();\n }\n },\n\n /**\n * Show this dialog modally.\n */\n showModal: function() {\n if (this.dialog_.hasAttribute('open')) {\n throw new Error('Failed to execute \\'showModal\\' on dialog: The element is already open, and therefore cannot be opened modally.');\n }\n if (!isConnected(this.dialog_)) {\n throw new Error('Failed to execute \\'showModal\\' on dialog: The element is not in a Document.');\n }\n if (!dialogPolyfill.dm.pushDialog(this)) {\n throw new Error('Failed to execute \\'showModal\\' on dialog: There are too many open modal dialogs.');\n }\n\n if (createsStackingContext(this.dialog_.parentElement)) {\n console.warn('A dialog is being shown inside a stacking context. ' +\n 'This may cause it to be unusable. For more information, see this link: ' +\n 'https://github.com/GoogleChrome/dialog-polyfill/#stacking-context');\n }\n\n this.setOpen(true);\n this.openAsModal_ = true;\n\n // Optionally center vertically, relative to the current viewport.\n if (dialogPolyfill.needsCentering(this.dialog_)) {\n dialogPolyfill.reposition(this.dialog_);\n this.replacedStyleTop_ = true;\n } else {\n this.replacedStyleTop_ = false;\n }\n\n // Insert backdrop.\n this.dialog_.parentNode.insertBefore(this.backdrop_, this.dialog_.nextSibling);\n\n // Focus on whatever inside the dialog.\n this.focus_();\n },\n\n /**\n * Closes this HTMLDialogElement. This is optional vs clearing the open\n * attribute, however this fires a 'close' event.\n *\n * @param {string=} opt_returnValue to use as the returnValue\n */\n close: function(opt_returnValue) {\n if (!this.dialog_.hasAttribute('open')) {\n throw new Error('Failed to execute \\'close\\' on dialog: The element does not have an \\'open\\' attribute, and therefore cannot be closed.');\n }\n this.setOpen(false);\n\n // Leave returnValue untouched in case it was set directly on the element\n if (opt_returnValue !== undefined) {\n this.dialog_.returnValue = opt_returnValue;\n }\n\n // Triggering \"close\" event for any attached listeners on the <dialog>.\n var closeEvent = new supportCustomEvent('close', {\n bubbles: false,\n cancelable: false\n });\n safeDispatchEvent(this.dialog_, closeEvent);\n }\n\n});\n\nvar dialogPolyfill = {};\n\ndialogPolyfill.reposition = function(element) {\n var scrollTop = document.body.scrollTop || document.documentElement.scrollTop;\n var topValue = scrollTop + (window.innerHeight - element.offsetHeight) / 2;\n element.style.top = Math.max(scrollTop, topValue) + 'px';\n};\n\ndialogPolyfill.isInlinePositionSetByStylesheet = function(element) {\n for (var i = 0; i < document.styleSheets.length; ++i) {\n var styleSheet = document.styleSheets[i];\n var cssRules = null;\n // Some browsers throw on cssRules.\n try {\n cssRules = styleSheet.cssRules;\n } catch (e) {}\n if (!cssRules) { continue; }\n for (var j = 0; j < cssRules.length; ++j) {\n var rule = cssRules[j];\n var selectedNodes = null;\n // Ignore errors on invalid selector texts.\n try {\n selectedNodes = document.querySelectorAll(rule.selectorText);\n } catch(e) {}\n if (!selectedNodes || !inNodeList(selectedNodes, element)) {\n continue;\n }\n var cssTop = rule.style.getPropertyValue('top');\n var cssBottom = rule.style.getPropertyValue('bottom');\n if ((cssTop && cssTop !== 'auto') || (cssBottom && cssBottom !== 'auto')) {\n return true;\n }\n }\n }\n return false;\n};\n\ndialogPolyfill.needsCentering = function(dialog) {\n var computedStyle = window.getComputedStyle(dialog);\n if (computedStyle.position !== 'absolute') {\n return false;\n }\n\n // We must determine whether the top/bottom specified value is non-auto. In\n // WebKit/Blink, checking computedStyle.top == 'auto' is sufficient, but\n // Firefox returns the used value. So we do this crazy thing instead: check\n // the inline style and then go through CSS rules.\n if ((dialog.style.top !== 'auto' && dialog.style.top !== '') ||\n (dialog.style.bottom !== 'auto' && dialog.style.bottom !== '')) {\n return false;\n }\n return !dialogPolyfill.isInlinePositionSetByStylesheet(dialog);\n};\n\n/**\n * @param {!Element} element to force upgrade\n */\ndialogPolyfill.forceRegisterDialog = function(element) {\n if (window.HTMLDialogElement || element.showModal) {\n console.warn('This browser already supports <dialog>, the polyfill ' +\n 'may not work correctly', element);\n }\n if (element.localName !== 'dialog') {\n throw new Error('Failed to register dialog: The element is not a dialog.');\n }\n new dialogPolyfillInfo(/** @type {!HTMLDialogElement} */ (element));\n};\n\n/**\n * @param {!Element} element to upgrade, if necessary\n */\ndialogPolyfill.registerDialog = function(element) {\n if (!element.showModal) {\n dialogPolyfill.forceRegisterDialog(element);\n }\n};\n\n/**\n * @constructor\n */\ndialogPolyfill.DialogManager = function() {\n /** @type {!Array<!dialogPolyfillInfo>} */\n this.pendingDialogStack = [];\n\n var checkDOM = this.checkDOM_.bind(this);\n\n // The overlay is used to simulate how a modal dialog blocks the document.\n // The blocking dialog is positioned on top of the overlay, and the rest of\n // the dialogs on the pending dialog stack are positioned below it. In the\n // actual implementation, the modal dialog stacking is controlled by the\n // top layer, where z-index has no effect.\n this.overlay = document.createElement('div');\n this.overlay.className = '_dialog_overlay';\n this.overlay.addEventListener('click', function(e) {\n this.forwardTab_ = undefined;\n e.stopPropagation();\n checkDOM([]); // sanity-check DOM\n }.bind(this));\n\n this.handleKey_ = this.handleKey_.bind(this);\n this.handleFocus_ = this.handleFocus_.bind(this);\n\n this.zIndexLow_ = 100000;\n this.zIndexHigh_ = 100000 + 150;\n\n this.forwardTab_ = undefined;\n\n if ('MutationObserver' in window) {\n this.mo_ = new MutationObserver(function(records) {\n var removed = [];\n records.forEach(function(rec) {\n for (var i = 0, c; c = rec.removedNodes[i]; ++i) {\n if (!(c instanceof Element)) {\n continue;\n } else if (c.localName === 'dialog') {\n removed.push(c);\n }\n removed = removed.concat(c.querySelectorAll('dialog'));\n }\n });\n removed.length && checkDOM(removed);\n });\n }\n};\n\n/**\n * Called on the first modal dialog being shown. Adds the overlay and related\n * handlers.\n */\ndialogPolyfill.DialogManager.prototype.blockDocument = function() {\n document.documentElement.addEventListener('focus', this.handleFocus_, true);\n document.addEventListener('keydown', this.handleKey_);\n this.mo_ && this.mo_.observe(document, {childList: true, subtree: true});\n};\n\n/**\n * Called on the first modal dialog being removed, i.e., when no more modal\n * dialogs are visible.\n */\ndialogPolyfill.DialogManager.prototype.unblockDocument = function() {\n document.documentElement.removeEventListener('focus', this.handleFocus_, true);\n document.removeEventListener('keydown', this.handleKey_);\n this.mo_ && this.mo_.disconnect();\n};\n\n/**\n * Updates the stacking of all known dialogs.\n */\ndialogPolyfill.DialogManager.prototype.updateStacking = function() {\n var zIndex = this.zIndexHigh_;\n\n for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) {\n dpi.updateZIndex(--zIndex, --zIndex);\n if (i === 0) {\n this.overlay.style.zIndex = --zIndex;\n }\n }\n\n // Make the overlay a sibling of the dialog itself.\n var last = this.pendingDialogStack[0];\n if (last) {\n var p = last.dialog.parentNode || document.body;\n p.appendChild(this.overlay);\n } else if (this.overlay.parentNode) {\n this.overlay.parentNode.removeChild(this.overlay);\n }\n};\n\n/**\n * @param {Element} candidate to check if contained or is the top-most modal dialog\n * @return {boolean} whether candidate is contained in top dialog\n */\ndialogPolyfill.DialogManager.prototype.containedByTopDialog_ = function(candidate) {\n while (candidate = findNearestDialog(candidate)) {\n for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) {\n if (dpi.dialog === candidate) {\n return i === 0; // only valid if top-most\n }\n }\n candidate = candidate.parentElement;\n }\n return false;\n};\n\ndialogPolyfill.DialogManager.prototype.handleFocus_ = function(event) {\n var target = event.composedPath ? event.composedPath()[0] : event.target;\n\n if (this.containedByTopDialog_(target)) { return; }\n\n if (document.activeElement === document.documentElement) { return; }\n\n event.preventDefault();\n event.stopPropagation();\n safeBlur(/** @type {Element} */ (target));\n\n if (this.forwardTab_ === undefined) { return; } // move focus only from a tab key\n\n var dpi = this.pendingDialogStack[0];\n var dialog = dpi.dialog;\n var position = dialog.compareDocumentPosition(target);\n if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n if (this.forwardTab_) {\n // forward\n dpi.focus_();\n } else if (target !== document.documentElement) {\n // backwards if we're not already focused on <html>\n document.documentElement.focus();\n }\n }\n\n return false;\n};\n\ndialogPolyfill.DialogManager.prototype.handleKey_ = function(event) {\n this.forwardTab_ = undefined;\n if (event.keyCode === 27) {\n event.preventDefault();\n event.stopPropagation();\n var cancelEvent = new supportCustomEvent('cancel', {\n bubbles: false,\n cancelable: true\n });\n var dpi = this.pendingDialogStack[0];\n if (dpi && safeDispatchEvent(dpi.dialog, cancelEvent)) {\n dpi.dialog.close();\n }\n } else if (event.keyCode === 9) {\n this.forwardTab_ = !event.shiftKey;\n }\n};\n\n/**\n * Finds and downgrades any known modal dialogs that are no longer displayed. Dialogs that are\n * removed and immediately readded don't stay modal, they become normal.\n *\n * @param {!Array<!HTMLDialogElement>} removed that have definitely been removed\n */\ndialogPolyfill.DialogManager.prototype.checkDOM_ = function(removed) {\n // This operates on a clone because it may cause it to change. Each change also calls\n // updateStacking, which only actually needs to happen once. But who removes many modal dialogs\n // at a time?!\n var clone = this.pendingDialogStack.slice();\n clone.forEach(function(dpi) {\n if (removed.indexOf(dpi.dialog) !== -1) {\n dpi.downgradeModal();\n } else {\n dpi.maybeHideModal();\n }\n });\n};\n\n/**\n * @param {!dialogPolyfillInfo} dpi\n * @return {boolean} whether the dialog was allowed\n */\ndialogPolyfill.DialogManager.prototype.pushDialog = function(dpi) {\n var allowed = (this.zIndexHigh_ - this.zIndexLow_) / 2 - 1;\n if (this.pendingDialogStack.length >= allowed) {\n return false;\n }\n if (this.pendingDialogStack.unshift(dpi) === 1) {\n this.blockDocument();\n }\n this.updateStacking();\n return true;\n};\n\n/**\n * @param {!dialogPolyfillInfo} dpi\n */\ndialogPolyfill.DialogManager.prototype.removeDialog = function(dpi) {\n var index = this.pendingDialogStack.indexOf(dpi);\n if (index === -1) { return; }\n\n this.pendingDialogStack.splice(index, 1);\n if (this.pendingDialogStack.length === 0) {\n this.unblockDocument();\n }\n this.updateStacking();\n};\n\ndialogPolyfill.dm = new dialogPolyfill.DialogManager();\ndialogPolyfill.formSubmitter = null;\ndialogPolyfill.imagemapUseValue = null;\n\n/**\n * Installs global handlers, such as click listers and native method overrides. These are needed\n * even if a no dialog is registered, as they deal with <form method=\"dialog\">.\n */\nif (window.HTMLDialogElement === undefined) {\n\n /**\n * If HTMLFormElement translates method=\"DIALOG\" into 'get', then replace the descriptor with\n * one that returns the correct value.\n */\n var testForm = document.createElement('form');\n testForm.setAttribute('method', 'dialog');\n if (testForm.method !== 'dialog') {\n var methodDescriptor = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, 'method');\n if (methodDescriptor) {\n // nb. Some older iOS and older PhantomJS fail to return the descriptor. Don't do anything\n // and don't bother to update the element.\n var realGet = methodDescriptor.get;\n methodDescriptor.get = function() {\n if (isFormMethodDialog(this)) {\n return 'dialog';\n }\n return realGet.call(this);\n };\n var realSet = methodDescriptor.set;\n /** @this {HTMLElement} */\n methodDescriptor.set = function(v) {\n if (typeof v === 'string' && v.toLowerCase() === 'dialog') {\n return this.setAttribute('method', v);\n }\n return realSet.call(this, v);\n };\n Object.defineProperty(HTMLFormElement.prototype, 'method', methodDescriptor);\n }\n }\n\n /**\n * Global 'click' handler, to capture the <input type=\"submit\"> or <button> element which has\n * submitted a <form method=\"dialog\">. Needed as Safari and others don't report this inside\n * document.activeElement.\n */\n document.addEventListener('click', function(ev) {\n dialogPolyfill.formSubmitter = null;\n dialogPolyfill.imagemapUseValue = null;\n if (ev.defaultPrevented) { return; } // e.g. a submit which prevents default submission\n\n var target = /** @type {Element} */ (ev.target);\n if ('composedPath' in ev) {\n var path = ev.composedPath();\n target = path.shift() || target;\n }\n if (!target || !isFormMethodDialog(target.form)) { return; }\n\n var valid = (target.type === 'submit' && ['button', 'input'].indexOf(target.localName) > -1);\n if (!valid) {\n if (!(target.localName === 'input' && target.type === 'image')) { return; }\n // this is a <input type=\"image\">, which can submit forms\n dialogPolyfill.imagemapUseValue = ev.offsetX + ',' + ev.offsetY;\n }\n\n var dialog = findNearestDialog(target);\n if (!dialog) { return; }\n\n dialogPolyfill.formSubmitter = target;\n\n }, false);\n\n /**\n * Global 'submit' handler. This handles submits of `method=\"dialog\"` which are invalid, i.e.,\n * outside a dialog. They get prevented.\n */\n document.addEventListener('submit', function(ev) {\n var form = ev.target;\n var dialog = findNearestDialog(form);\n if (dialog) {\n return; // ignore, handle there\n }\n\n var submitter = findFormSubmitter(ev);\n var formmethod = submitter && submitter.getAttribute('formmethod') || form.getAttribute('method');\n if (formmethod === 'dialog') {\n ev.preventDefault();\n }\n });\n\n /**\n * Replace the native HTMLFormElement.submit() method, as it won't fire the\n * submit event and give us a chance to respond.\n */\n var nativeFormSubmit = HTMLFormElement.prototype.submit;\n var replacementFormSubmit = function () {\n if (!isFormMethodDialog(this)) {\n return nativeFormSubmit.call(this);\n }\n var dialog = findNearestDialog(this);\n dialog && dialog.close();\n };\n HTMLFormElement.prototype.submit = replacementFormSubmit;\n}\n\nexport default dialogPolyfill;\n","*:focus {\n border-radius: 50%;\n box-shadow: var(--shadow-focus-primary);\n outline: none !important;\n}\n\n:host {\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n}\n\n:host > dialog {\n padding: 0;\n border: none;\n margin: 0;\n background-color: transparent;\n}\n\n/* stylelint-disable selector-pseudo-class-no-unknown */\n:host > dialog:modal {\n width: 100%;\n max-width: 100%;\n max-height: 100%;\n}\n\n:host > dialog::backdrop {\n display: none;\n}\n\n/* polyfill style */\n:host > dialog + .backdrop {\n display: none;\n}\n\n:host > dialog:not([open]) {\n display: none;\n}\n\n:host > dialog[open] {\n display: block;\n}\n\n.modal-container {\n z-index: 1010;\n display: flex;\n overflow: -moz-scrollbars-none;\n width: 100%;\n height: 100vh;\n flex-direction: column;\n}\n\n.modal-container > .modal-content-scroll-outside {\n overflow: auto;\n background: var(--color-surface01);\n}\n\n.modal-container > header {\n padding: calc(var(--space-unit) * 1.75) calc(var(--space-unit) * 2) calc(var(--space-unit) * 1.75)\n calc(var(--space-unit) * 2);\n background: var(--color-surface02);\n}\n\n.modal-container > header button {\n padding: 0;\n border: none;\n margin: 0;\n margin-left: auto;\n background: transparent;\n cursor: pointer;\n}\n\n.modal-container > header z-icon {\n --z-icon-width: calc(var(--space-unit) * 2.25);\n --z-icon-height: calc(var(--space-unit) * 2.25);\n\n display: flex;\n fill: var(--color-primary01-icon);\n}\n\n.modal-container > header > div {\n display: flex;\n width: 100%;\n align-items: baseline;\n margin-right: calc(var(--space-unit) * 2);\n}\n\n.modal-container > header h1,\n.modal-container > header .subtitle {\n padding: 0;\n margin: 0;\n color: var(--color-default-text);\n font-weight: var(--font-sb);\n}\n\n.modal-container > header h1 {\n font-size: var(--font-size-5);\n letter-spacing: 0;\n line-height: 1.4;\n}\n\n.modal-container > header .subtitle {\n font-size: var(--font-size-3);\n font-weight: var(--font-rg);\n letter-spacing: 0;\n line-height: 1.5;\n}\n\n.modal-container > header > div > h1 *:empty {\n display: none;\n}\n\n.modal-container > header h1 + .subtitle {\n margin-top: calc(var(--space-unit) * 0.5);\n}\n\n.modal-container-scroll-inside > .modal-content-scroll-inside {\n overflow: hidden auto;\n flex: 1 auto;\n background: var(--color-surface01);\n}\n\n.modal-container-scroll-inside > .modal-content-scroll-inside::-webkit-scrollbar,\n.modal-container-scroll-outside > .modal-content-scroll-outside::-webkit-scrollbar {\n width: 10px;\n background: linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);\n border-radius: var(--border-radius);\n}\n\n.modal-container-scroll-inside > .modal-content-scroll-inside::-webkit-scrollbar-thumb,\n.modal-container-scroll-outside > .modal-content-scroll-outside::-webkit-scrollbar-thumb {\n width: 10px;\n background-color: var(--color-primary01);\n}\n\n.modal-container-scroll-inside > .modal-content-scroll-inside::-webkit-scrollbar-thumb:hover,\n.modal-container-scroll-outside > .modal-content-scroll-outside::-webkit-scrollbar-thumb:hover {\n background-color: var(--color-hover-primary);\n}\n\n/* Firefox */\n.modal-container-scroll-inside .modal-content-scroll-inside,\n.modal-container-scroll-outside .modal-content-scroll-outside {\n scrollbar-color: var(--color-primary01) transparent;\n}\n\n/* Tablet / Desktop */\n@media only screen and (min-width: 768px) {\n .modal-background {\n position: fixed;\n top: 0;\n left: 0;\n overflow: hidden;\n width: 100vw;\n height: 100vh;\n background-color: var(--gray900);\n opacity: 0.7;\n }\n\n .modal-background.modal-background-scroll-outside {\n position: sticky;\n }\n\n .modal-container-scroll-inside {\n position: fixed;\n top: calc(var(--space-unit) * 6);\n left: 50%;\n overflow: hidden;\n width: auto;\n min-width: calc(var(--space-unit) * 40);\n height: auto;\n min-height: calc(var(--space-unit) * 40);\n max-height: calc(100vh - calc(var(--space-unit) * 6 * 2));\n border-radius: var(--border-radius);\n transform: translateX(-50%);\n }\n\n .modal-container-scroll-outside {\n position: absolute;\n top: calc(var(--space-unit) * 6);\n left: 50%;\n display: block;\n overflow: initial;\n width: auto;\n min-width: calc(var(--space-unit) * 40);\n height: auto;\n min-height: calc(var(--space-unit) * 40);\n max-height: calc(100vh - calc(var(--space-unit) * 6 * 2));\n transform: translateX(-50%);\n }\n\n .modal-container > .modal-content-scroll-outside {\n overflow: initial;\n }\n\n .modal-container-scroll-outside > header,\n .modal-container-scroll-inside > header {\n border-top-left-radius: var(--border-radius);\n border-top-right-radius: var(--border-radius);\n }\n\n .modal-container-scroll-outside::after {\n display: block;\n height: calc(var(--space-unit) * 6);\n content: \" \";\n }\n\n .modal-dialog {\n position: fixed;\n top: 0;\n left: 0;\n height: auto;\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n .modal-content-scroll-outside {\n border-bottom-left-radius: var(--border-radius);\n border-bottom-right-radius: var(--border-radius);\n }\n\n .modal-dialog::-webkit-scrollbar {\n display: none;\n }\n}\n\n/* Desktop */\n@media only screen and (min-width: 1152px) {\n .modal-container > header {\n padding-top: calc(var(--space-unit) * 1.5);\n padding-bottom: calc(var(--space-unit) * 1.5);\n }\n\n .modal-container > header h1 {\n font-size: var(--font-size-6);\n font-weight: var(--font-sb);\n letter-spacing: 0;\n line-height: 1.333;\n }\n\n .modal-container > header .subtitle {\n font-size: var(--font-size-4);\n font-weight: var(--font-rg);\n letter-spacing: 0;\n line-height: 1.5;\n }\n\n .modal-container > header h1 + .subtitle {\n margin-top: 0;\n }\n}\n","import {Component, Element, Event, EventEmitter, Listen, Method, Prop, h} from \"@stencil/core\";\nimport dialogPolyfill from \"dialog-polyfill\";\nimport {KeyboardCode} from \"../../beans\";\nimport {mobileBreakpoint} from \"../../constants/breakpoints\";\n\nconst FOCUSABLE_ELEMENTS_SELECTOR =\n ':is(button, input, select, textarea, [contenteditable=\"\"], [contenteditable=\"true\"], a[href], [tabindex], summary):not([disabled], [disabled=\"\"], [tabindex=\"-1\"], [aria-hidden=\"true\"], [hidden])';\n\n/**\n * @slot modalCloseButton - accept custom close button\n * @slot modalContent - set the content of the modal\n */\n@Component({\n tag: \"z-modal\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZModal {\n /** unique id */\n @Prop()\n modalid: string;\n\n /** title text (optional) */\n @Prop()\n modaltitle?: string;\n\n /** subtitle (optional) */\n @Prop()\n modalsubtitle?: string;\n\n /** aria-label for close button (optional) */\n @Prop()\n closeButtonLabel = \"chiudi modale\";\n\n /** add role \"alertdialog\" to dialog (optional, default is false) */\n @Prop()\n alertdialog?: boolean = false;\n\n /** if true, the modal is closable (optional, default is true) */\n @Prop()\n closable?: boolean = true;\n\n /** if true, the modal can scroll inside, if false the viewport can scroll */\n @Prop()\n scrollInside?: boolean = true;\n\n private dialog: HTMLDialogElement;\n\n @Element() host: HTMLZModalElement;\n\n /** emitted on close button click, returns modalid */\n @Event()\n modalClose: EventEmitter;\n\n private emitModalClose(): void {\n if (this.closable) {\n this.modalClose.emit({modalid: this.modalid});\n }\n }\n\n /** emitted on modal header click, returns modalid */\n @Event()\n modalHeaderActive: EventEmitter;\n\n private emitModalHeaderActive(): void {\n this.modalHeaderActive.emit({modalid: this.modalid});\n }\n\n /** emitted on background click, returns modalid */\n @Event()\n modalBackgroundClick: EventEmitter;\n\n private emitBackgroundClick(): void {\n if (this.closable) {\n this.modalBackgroundClick.emit({modalid: this.modalid});\n }\n }\n\n private handlePageOverflow(): void {\n const mobileMediaQuery = window.matchMedia(`(max-width: ${mobileBreakpoint}px)`);\n document.body.style[\"overflow-y\"] = mobileMediaQuery.matches ? \"hidden\" : \"\";\n }\n\n componentDidLoad(): void {\n if (typeof window.HTMLDialogElement !== \"function\") {\n /* workaround to fix `registerDialog` in test environment:\n stencil converts html elements to MockHTMLElement but this element is missing the `localName` property,\n which is used by `registerDialog` to recognize the element as dialog */\n if (!this.dialog.localName) {\n Object.defineProperty(this.dialog, \"localName\", {value: \"dialog\"});\n }\n dialogPolyfill.registerDialog(this.dialog);\n this.dialog.setAttribute(\"open\", \"true\");\n } else {\n this.open();\n }\n\n this.handlePageOverflow();\n }\n\n /** open modal */\n @Method()\n async open(): Promise<void> {\n this.dialog?.showModal();\n }\n\n /** close modal */\n @Method()\n async close(): Promise<void> {\n if (this.closable) {\n this.dialog?.close();\n }\n }\n\n /**\n * Get a list of focusable elements in the dialog.\n * Remove elements with `display: none` from the list, because they're not focusable.\n *\n * N.B. The list is built on the assumption that elements inside shadow root are placed ALL before the `modalContent` slot.\n * Adding focusable elements after the `modalContent` slot would break the order of elements in the list.\n */\n private get focusableElements(): HTMLElement[] {\n return [\n ...Array.from(this.host.shadowRoot.querySelectorAll<HTMLElement>(FOCUSABLE_ELEMENTS_SELECTOR)),\n ...Array.from(this.host.querySelectorAll<HTMLElement>(FOCUSABLE_ELEMENTS_SELECTOR)),\n ].filter((element) => getComputedStyle(element).display !== \"none\");\n }\n\n @Listen(\"keydown\")\n handleKeyDown(e: KeyboardEvent): void {\n if (e.code === KeyboardCode.ESC && !this.closable) {\n e.preventDefault();\n }\n\n if (e.code !== KeyboardCode.TAB) {\n return;\n }\n\n const focusableElements = this.focusableElements;\n const shadowActiveElement = this.host.shadowRoot.activeElement;\n const activeElement = this.host.ownerDocument.activeElement;\n const firstFocusableElement = focusableElements[0];\n const lastFocusableElement = focusableElements[focusableElements.length - 1];\n if (e.shiftKey && (shadowActiveElement == firstFocusableElement || activeElement == firstFocusableElement)) {\n // shift + tab was pressed and current active element is the first focusable element\n e.preventDefault();\n lastFocusableElement.focus();\n } else if (!e.shiftKey && (shadowActiveElement == lastFocusableElement || activeElement == lastFocusableElement)) {\n // shift + tab was pressed and current active element is the first focusable element\n e.preventDefault();\n firstFocusableElement.focus();\n }\n }\n\n private closeButtonSlot(): HTMLElement | void {\n if (this.closable) {\n return (\n <slot name=\"modalCloseButton\">\n <button\n aria-label={this.closeButtonLabel}\n onClick={() => this.close()}\n >\n <z-icon name=\"multiply-circle-filled\"></z-icon>\n </button>\n </slot>\n );\n }\n }\n\n private handleEscape(e: Event): void {\n if (this.closable) {\n return;\n }\n e.preventDefault();\n }\n\n render(): HTMLZModalElement {\n return (\n <dialog\n class={{\n \"modal-dialog\": !this.scrollInside,\n }}\n aria-labelledby=\"modal-title\"\n aria-describedby=\"modal-content\"\n role={this.alertdialog ? \"alertdialog\" : undefined}\n ref={(el) => (this.dialog = el as HTMLDialogElement)}\n onClose={() => this.emitModalClose()}\n onCancel={(e) => this.handleEscape(e)}\n >\n <div\n class={{\n \"modal-container\": true,\n \"modal-container-scroll-inside\": this.scrollInside,\n \"modal-container-scroll-outside\": !this.scrollInside,\n }}\n id={this.modalid}\n >\n <header onClick={this.emitModalHeaderActive.bind(this)}>\n <div>\n {this.modaltitle && <h1 id=\"modal-title\">{this.modaltitle}</h1>}\n {this.closeButtonSlot()}\n </div>\n {this.modalsubtitle && (\n <div\n class=\"subtitle\"\n id=\"modal-subtitle\"\n >\n {this.modalsubtitle}\n </div>\n )}\n </header>\n\n <div\n class={{\n \"modal-content-scroll-inside\": this.scrollInside,\n \"modal-content-scroll-outside\": !this.scrollInside,\n }}\n id=\"modal-content\"\n >\n <slot name=\"modalContent\"></slot>\n </div>\n </div>\n <div\n class={{\n \"modal-background\": true,\n \"modal-background-scroll-outside\": !this.scrollInside,\n }}\n data-action=\"modalBackground\"\n data-modal={this.modalid}\n onClick={() => {\n this.emitBackgroundClick();\n this.close();\n }}\n ></div>\n </dialog>\n );\n }\n}\n"],"mappings":"iIAAA,MAAMA,EAAY,kwCAClB,MAAAC,EAAeD,E,MCMFE,EAAa,M,kGAShB,kBAAAC,CAAmBC,GACzBC,KAAKC,YAAYC,KAAKH,E,CAKhB,uBAAAI,GACN,OACEC,EAAA,OAAKC,MAAM,sBACTD,EAAA,OAAKC,MAAM,oBACTD,EAAA,QAAMC,MAAM,aAAaL,KAAKM,mB,CAMtC,MAAAC,GACE,OACEH,EAAA,OAAAI,IAAA,2CACEC,SAAU,EACVC,IAAM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,UACzCzC,IAAMkC,GAAQ5C,KAAKkG,OAAStD,EAC5B2P,QAAS,IAAMvS,KAAKmQ,iBACpBqC,SAAW1R,GAAMd,KAAKmS,aAAarR,IAEnCV,EAAA,OAAAI,IAAA,2CACEH,MAAO,CACL,kBAAmB,KACnB,gCAAiCL,KAAKoS,aACtC,kCAAmCpS,KAAKoS,cAE1CK,GAAIzS,KAAKsQ,SAETlQ,EAAA,UAAAI,IAAA,2CAAQ0R,QAASlS,KAAKuQ,sBAAsB5J,KAAK3G,OAC/CI,EAAA,OAAAI,IAAA,4CACGR,KAAK0S,YAActS,EAAA,MAAAI,IAAA,2CAAIiS,GAAG,eAAezS,KAAK0S,YAC9C1S,KAAKgS,mBAEPhS,KAAK2S,eACJvS,EAAA,OAAAI,IAAA,2CACEH,MAAM,WACNoS,GAAG,kBAEFzS,KAAK2S,gBAKZvS,EAAA,OAAAI,IAAA,2CACEH,MAAO,CACL,8BAA+BL,KAAKoS,aACpC,gCAAiCpS,KAAKoS,cAExCK,GAAG,iBAEHrS,EAAA,QAAAI,IAAA,2CAAMuH,KAAK,mBAGf3H,EAAA,OAAAI,IAAA,2CACEH,MAAO,CACL,mBAAoB,KACpB,mCAAoCL,KAAKoS,cAC1C,cACW,kBAAiB,aACjBpS,KAAKsQ,QACjB4B,QAAS,KACPlS,KAAKyQ,sBACLzQ,KAAKoG,OAAO,I","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r as t,h as a}from"./p-cc3c02fe.js";const n='*:focus{-webkit-box-shadow:var(--shadow-focus-primary);box-shadow:var(--shadow-focus-primary);outline:none !important}ul{overflow:hidden;width:auto;height:auto;padding:0;margin:0 calc(var(--space-unit) * 2);color:var(--color-primary01);font-family:var(--font-family-sans);list-style:none}ul>li{padding-left:10px;text-indent:-10px}ul>li>a{display:block;padding-top:calc(var(--space-unit) * 0.5);color:var(--color-primary01);font-size:14px;font-weight:var(--font-sb);letter-spacing:0.16px;line-height:calc(var(--space-unit) * 2.5);text-decoration:none}ul>li>a::before{padding-right:5px;content:"•"}ul>li>span{padding:0 calc(var(--space-unit) * 2);color:var(--color-surface04);font-size:14px;font-weight:var(--font-rg);letter-spacing:0.16px;line-height:calc(var(--space-unit) * 2.5);text-decoration:none}';const e=n;const r=class{constructor(a){t(this,a);this.listdata=undefined;this.renderList=this.renderList.bind(this)}handleSpaceKeyPress(t,a){if(t.keyCode==32||t.keyCode==13){t.preventDefault();window.open(a,"_blank")}}formatListContent(t){const{value:n,isLink:e,url:r}=t;if(!e){return a("span",null,n)}return a("a",{role:"button",onKeyPress:t=>this.handleSpaceKeyPress(t,r),href:r,target:"_blank"},n)}renderList(t){return t.map((t=>a("li",null,this.formatListContent(t))))}render(){return a("ul",{key:"04fd2a50aca23fe43cb8126e7325dda58393cb7b"},this.renderList(JSON.parse(this.listdata)))}};r.style=e;export{r as z_myz_card_list};
2
+ //# sourceMappingURL=p-22d9f9c3.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["stylesCss","ZMyzCardListStyle0","ZMyzCardList","constructor","hostRef","this","renderList","bind","handleSpaceKeyPress","e","url","keyCode","preventDefault","window","open","formatListContent","data","value","isLink","h","role","onKeyPress","href","target","dataArray","map","render","key","JSON","parse","listdata"],"sources":["src/snowflakes/myz/card/z-myz-card-list/styles.css?tag=z-myz-card-list&encapsulation=shadow","src/snowflakes/myz/card/z-myz-card-list/index.tsx"],"sourcesContent":["*:focus {\n box-shadow: var(--shadow-focus-primary);\n outline: none !important;\n}\n\nul {\n overflow: hidden;\n width: auto;\n height: auto;\n padding: 0;\n margin: 0 calc(var(--space-unit) * 2);\n color: var(--color-primary01);\n font-family: var(--font-family-sans);\n list-style: none;\n}\n\nul > li {\n padding-left: 10px;\n text-indent: -10px;\n}\n\nul > li > a {\n display: block;\n padding-top: calc(var(--space-unit) * 0.5);\n color: var(--color-primary01);\n font-size: 14px;\n font-weight: var(--font-sb);\n letter-spacing: 0.16px;\n line-height: calc(var(--space-unit) * 2.5);\n text-decoration: none;\n}\n\nul > li > a::before {\n padding-right: 5px;\n content: \"•\";\n}\n\nul > li > span {\n padding: 0 calc(var(--space-unit) * 2);\n color: var(--color-surface04);\n font-size: 14px;\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: calc(var(--space-unit) * 2.5);\n text-decoration: none;\n}\n","import {Component, Prop, h} from \"@stencil/core\";\nimport {Action} from \"../../../../beans\";\n\n@Component({\n tag: \"z-myz-card-list\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZMyzCardList {\n /** list data stringified array */\n @Prop()\n listdata: string;\n\n constructor() {\n this.renderList = this.renderList.bind(this);\n }\n\n private handleSpaceKeyPress(e: KeyboardEvent, url: string): void {\n if (e.keyCode == 32 || e.keyCode == 13) {\n e.preventDefault();\n window.open(url, \"_blank\");\n }\n }\n\n private formatListContent(data: Action): HTMLAnchorElement {\n const {value, isLink, url} = data;\n if (!isLink) {\n return <span>{value}</span>;\n }\n\n return (\n <a\n role=\"button\"\n onKeyPress={(e: KeyboardEvent) => this.handleSpaceKeyPress(e, url)}\n href={url}\n target=\"_blank\"\n >\n {value}\n </a>\n );\n }\n\n private renderList(dataArray: Action[]): HTMLLIElement[] {\n return dataArray.map((data: Action) => {\n return <li>{this.formatListContent(data)}</li>;\n });\n }\n\n render(): HTMLUListElement {\n return <ul>{this.renderList(JSON.parse(this.listdata))}</ul>;\n }\n}\n"],"mappings":"2CAAA,MAAMA,EAAY,oyBAClB,MAAAC,EAAeD,E,MCOFE,EAAY,MAKvB,WAAAC,CAAAC,G,kCACEC,KAAKC,WAAaD,KAAKC,WAAWC,KAAKF,K,CAGjC,mBAAAG,CAAoBC,EAAkBC,GAC5C,GAAID,EAAEE,SAAW,IAAMF,EAAEE,SAAW,GAAI,CACtCF,EAAEG,iBACFC,OAAOC,KAAKJ,EAAK,S,EAIb,iBAAAK,CAAkBC,GACxB,MAAMC,MAACA,EAAKC,OAAEA,EAAMR,IAAEA,GAAOM,EAC7B,IAAKE,EAAQ,CACX,OAAOC,EAAA,YAAOF,E,CAGhB,OACEE,EAAA,KACEC,KAAK,SACLC,WAAaZ,GAAqBJ,KAAKG,oBAAoBC,EAAGC,GAC9DY,KAAMZ,EACNa,OAAO,UAENN,E,CAKC,UAAAX,CAAWkB,GACjB,OAAOA,EAAUC,KAAKT,GACbG,EAAA,UAAKd,KAAKU,kBAAkBC,K,CAIvC,MAAAU,GACE,OAAOP,EAAA,MAAAQ,IAAA,4CAAKtB,KAAKC,WAAWsB,KAAKC,MAAMxB,KAAKyB,W","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ System.register(["./p-d8fcaf1f.system.js","./p-c39f227f.system.js"],(function(t){"use strict";var i,n,a,e,o,s,r,l;return{setters:[function(t){i=t.r;n=t.c;a=t.h;e=t.a;o=t.g},function(t){s=t.N;r=t.a;l=t.b}],execute:function(){var c='z-navigation-tabs{position:relative;z-index:0;display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex-direction:row;flex-direction:row;font-family:var(--font-family-sans);font-weight:var(--font-rg)}z-navigation-tabs,z-navigation-tabs *{-webkit-box-sizing:border-box;box-sizing:border-box}z-navigation-tabs>nav::-webkit-scrollbar{display:none}z-navigation-tabs .navigation-button{position:absolute;z-index:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:0;border:none;margin:0;background-color:var(--z-navigation-tabs-nav-buttons-bg, var(--color-surface01));border-radius:var(--border-no-radius);-webkit-box-shadow:0 0 4px 1px var(--shadow-color-base);box-shadow:0 0 4px 1px var(--shadow-color-base);cursor:pointer;fill:var(--z-navigation-tabs-nav-buttons-fg, var(--color-primary01));outline:none}z-navigation-tabs .navigation-button:disabled{display:none}z-navigation-tabs>nav{z-index:0;display:-ms-flexbox;display:flex;overflow:auto;-ms-flex-align:center;align-items:center;-ms-flex-pack:start;justify-content:flex-start;scroll-behavior:smooth;scrollbar-width:none}z-navigation-tabs[orientation="horizontal"]>nav{width:100%}z-navigation-tabs[orientation="horizontal"] .navigation-button{top:0;width:calc(var(--space-unit) * 4);height:100%}z-navigation-tabs[orientation="horizontal"] .navigation-button:first-child{left:0}z-navigation-tabs[orientation="horizontal"] .navigation-button:last-child{right:0}z-navigation-tabs[orientation="vertical"]{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;-ms-flex-direction:column;flex-direction:column}z-navigation-tabs[orientation="vertical"]>nav{height:100%;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:stretch;align-items:stretch}z-navigation-tabs[orientation="vertical"] .navigation-button{left:0;width:100%;height:calc(var(--space-unit) * 4)}z-navigation-tabs[orientation="vertical"] .navigation-button:first-child{top:0}z-navigation-tabs[orientation="vertical"] .navigation-button:last-child{bottom:0}z-navigation-tabs[size="small"][orientation="vertical"] .navigation-button{height:calc(var(--space-unit) * 4)}z-navigation-tabs>nav>*{position:relative;z-index:0;display:-ms-inline-flexbox;display:inline-flex;width:auto;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:calc(var(--space-unit) * 2) calc(var(--space-unit) * 5);border:none;margin:0;background-color:unset;border-radius:var(--border-no-radius);color:var(--color-primary01);cursor:pointer;fill:currentcolor;font-family:var(--font-family-sans);font-size:inherit;gap:var(--space-unit);letter-spacing:inherit;line-height:inherit;outline:none;text-align:center;white-space:nowrap}z-navigation-tabs>nav>a{text-decoration:none}z-navigation-tabs>nav>*:focus:focus-visible{z-index:1;-webkit-box-shadow:inset 0 0 4px 3px var(--blue800);box-shadow:inset 0 0 4px 3px var(--blue800)}z-navigation-tabs>nav>:not([disabled]):hover{background-color:var(--color-surface02)}z-navigation-tabs>nav>button[disabled]{color:var(--color-disabled03);cursor:not-allowed;fill:currentcolor;pointer-events:all}z-navigation-tabs>nav>:not([disabled]):hover,nav>[aria-selected="true"]{color:var(--color-hover-secondary);fill:currentcolor}z-navigation-tabs>nav>:not([disabled]):hover::after,nav>[aria-selected="true"]::after{position:absolute;background-color:var(--color-hover-secondary);content:""}z-navigation-tabs[orientation="horizontal"]>nav>:not([disabled]):hover::after,z-navigation-tabs[orientation="horizontal"]>nav>[aria-selected="true"]::after{bottom:0;left:0;width:100%;height:var(--border-size-large)}z-navigation-tabs>nav>* z-icon{--z-icon-width:calc(var(--space-unit) * 2);--z-icon-height:calc(var(--space-unit) * 2);display:-ms-flexbox;display:flex;margin:0}z-navigation-tabs[size="small"][orientation="horizontal"]>nav>*{padding:var(--space-unit) calc(var(--space-unit) * 2)}z-navigation-tabs[size="small"][orientation="horizontal"]>nav>:not([disabled]):hover::after,z-navigation-tabs[size="small"][orientation="horizontal"]>nav>[aria-selected="true"]::after{height:var(--border-size-medium)}z-navigation-tabs[size="small"]:not([orientation="vertical"])>nav>* z-icon{--z-icon-width:14px;--z-icon-height:14px}z-navigation-tabs[orientation="vertical"]>nav>*{padding:calc(var(--space-unit) * 3) calc(var(--space-unit) * 2)}z-navigation-tabs[orientation="vertical"]>nav>*>:not(z-icon){display:none}z-navigation-tabs[orientation="vertical"]>nav>:not([disabled]):hover::after,z-navigation-tabs[orientation="vertical"]>nav>[aria-selected="true"]::after{top:0;right:0;width:var(--border-size-large);height:100%}';var h=c;var v=t("z_navigation_tabs",function(){function t(t){i(this,t);this.selected=n(this,"selected",7);this.focusedTab=undefined;this.ariaLabel="";this.orientation=s.HORIZONTAL;this.size=r.BIG;this.selectedTab=undefined;this.canNavigate=undefined;this.canNavigatePrev=undefined;this.canNavigateNext=undefined}Object.defineProperty(t.prototype,"direction",{get:function(){return this.orientation==s.HORIZONTAL?"Left":"Top"},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"dimension",{get:function(){return this.orientation==s.HORIZONTAL?"Width":"Height"},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"tabs",{get:function(){return Array.from(this.nav.children)},enumerable:false,configurable:true});t.prototype.scrollToTab=function(t){var i=this.orientation===s.HORIZONTAL?{block:"nearest",inline:"center"}:{block:"center",inline:"nearest"};t.scrollIntoView(Object.assign({behavior:"smooth"},i))};t.prototype.navigateBackwards=function(){var t;this.nav.scrollBy((t={},t[this.direction.toLowerCase()]=0-this.nav["client".concat(this.dimension)]/2,t.behavior="smooth",t))};t.prototype.navigateForward=function(){var t;this.nav.scrollBy((t={},t[this.direction.toLowerCase()]=this.nav["scroll".concat(this.direction)]+this.nav["client".concat(this.dimension)]/2,t.behavior="smooth",t))};t.prototype.isArrowNavigation=function(t){return Object.values(l).includes(t.key)};t.prototype.checkScrollVisible=function(){if(!this.nav){return}this.canNavigate=this.nav["scroll".concat(this.dimension)]>this.nav["client".concat(this.dimension)]};t.prototype.checkScrollEnabled=function(){if(!this.nav){return}this.canNavigateNext=this.nav["scroll".concat(this.direction)]+this.nav["client".concat(this.dimension)]<this.nav["scroll".concat(this.dimension)];this.canNavigatePrev=this.nav["scroll".concat(this.direction)]>0};t.prototype.onTabSelected=function(){var t=this;this.tabs.forEach((function(i,n){var a=i.querySelector("z-icon");var e=a===null||a===void 0?void 0:a.getAttribute("name").replace("-filled","");if(n!==t.selectedTab){i.setAttribute("aria-selected","false");i.tabIndex=-1;a===null||a===void 0?void 0:a.setAttribute("name",e);return}a===null||a===void 0?void 0:a.setAttribute("name","".concat(e,"-filled"));i.setAttribute("aria-selected","true")}));this.selected.emit(this.selectedTab);if(this.selectedTab!==undefined){this.scrollToTab(this.tabs[this.selectedTab])}};t.prototype.handleTabClick=function(t){var i=t.target.closest("[role='tab']");if(!this.tabs.some((function(t){return t.contains(i)}))){return}this.selectedTab=this.tabs.indexOf(i)};t.prototype.onTabFocusIn=function(t){var i=this.tabs.findIndex((function(i){return i.contains(t.target)}));if(i===-1){return}if(this.selectedTab!==undefined){this.tabs[this.selectedTab].tabIndex=-1}this.focusedTab=i;this.tabs[this.focusedTab].tabIndex=-1;this.scrollToTab(this.tabs[this.focusedTab])};t.prototype.navigateThroughTabs=function(t){if(!this.tabs.some((function(i){return i.contains(t.target)}))||!this.isArrowNavigation(t)){return true}t.preventDefault();if(t.key===l.RIGHT&&this.orientation==s.HORIZONTAL||t.key===l.DOWN&&this.orientation==s.VERTICAL){this.focusedTab++;if(this.focusedTab>=this.tabs.length){this.focusedTab=0}}else if(t.key===l.LEFT&&this.orientation==s.HORIZONTAL||t.key===l.UP&&this.orientation==s.VERTICAL){this.focusedTab--;if(this.focusedTab<0){this.focusedTab=this.tabs.length-1}}if(this.tabs[this.focusedTab].hasAttribute("disabled")&&this.tabs[this.focusedTab].getAttribute("disabled")!=="false"){return this.navigateThroughTabs(t)}this.tabs[this.focusedTab].focus();this.scrollToTab(this.tabs[this.focusedTab])};t.prototype.onTabFocusOut=function(t){var i;if(!this.tabs.some((function(i){return i.contains(t.relatedTarget)}))){this.tabs[(i=this.selectedTab)!==null&&i!==void 0?i:0].tabIndex=0;this.focusedTab=undefined}};t.prototype.connectedCallback=function(){var t=this;this.resizeObserver=new ResizeObserver((function(){return t.checkScrollVisible()}))};t.prototype.componentDidLoad=function(){var t;this.tabs.forEach((function(t){t.setAttribute("role","tab");t.tabIndex=-1}));var i=(t=this.selectedTab)!==null&&t!==void 0?t:this.tabs.findIndex((function(t){return t.ariaSelected==="true"}));if(i!==-1){this.selectedTab=i;this.tabs[i].tabIndex=0;this.onTabSelected()}else{this.tabs[0].tabIndex=0}this.resizeObserver.observe(this.nav)};t.prototype.disconnectedCallback=function(){var t;(t=this.resizeObserver)===null||t===void 0?void 0:t.disconnect()};t.prototype.render=function(){var t=this;return a(e,{key:"0dfbe739542add5d05e82462f9ca115734f75ab7",class:{"interactive-2":this.size===r.SMALL,"interactive-1":this.size!==r.SMALL},scrollable:this.canNavigate},a("button",{key:"a679c4104ef79c5245a205e634872992ad6b7702",class:"navigation-button",onClick:this.navigateBackwards.bind(this),tabIndex:-1,disabled:!this.canNavigatePrev,"aria-label":"Mostra elementi precedenti",hidden:!this.canNavigate},a("z-icon",{key:"13b64410e78d66d28b9a2a870535a393b5361f06",name:this.orientation===s.HORIZONTAL?"chevron-left":"chevron-up",width:16,height:16})),a("nav",{key:"ae01aa47ea6620209017d612b3b6e1b0664efcba",role:"tablist","aria-label":this.ariaLabel,ref:function(i){return t.nav=i!==null&&i!==void 0?i:t.nav},onScroll:this.checkScrollEnabled.bind(this),"aria-orientation":this.orientation},a("slot",{key:"bd1f92fef8fde67a415964efd61b89d9895192a7"})),a("button",{key:"0b7a9b4ecf5773f576f25468a8f64118b57c4480",class:"navigation-button",onClick:this.navigateForward.bind(this),tabIndex:-1,disabled:!this.canNavigateNext,"aria-label":"Mostra elementi successivi",hidden:!this.canNavigate},a("z-icon",{key:"91686040ca32ff9136c6a96ce70ed3ca20a6b753",name:this.orientation===s.HORIZONTAL?"chevron-right":"chevron-down",width:16,height:16})))};Object.defineProperty(t.prototype,"host",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{canNavigate:["checkScrollEnabled"],selectedTab:["onTabSelected"]}},enumerable:false,configurable:true});return t}());v.style=h}}}));
2
+ //# sourceMappingURL=p-23975a98.system.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["stylesCss","ZNavigationTabsStyle0","ZNavigationTabs","exports","this","focusedTab","undefined","NavigationTabsOrientation","HORIZONTAL","NavigationTabsSize","BIG","Object","defineProperty","class_1","prototype","orientation","Array","from","nav","children","scrollToTab","tabElement","scrollOptions","block","inline","scrollIntoView","assign","behavior","navigateBackwards","scrollBy","_b","direction","toLowerCase","concat","dimension","navigateForward","isArrowNavigation","e","values","NavigationTabsKeyboardEvents","includes","key","checkScrollVisible","canNavigate","checkScrollEnabled","canNavigateNext","canNavigatePrev","onTabSelected","_this","tabs","forEach","tab","i","zicon","querySelector","strokeIcon","getAttribute","replace","selectedTab","setAttribute","tabIndex","selected","emit","handleTabClick","event","clickedTab","target","closest","some","child","contains","indexOf","onTabFocusIn","focused","findIndex","navigateThroughTabs","preventDefault","RIGHT","DOWN","VERTICAL","length","LEFT","UP","hasAttribute","focus","onTabFocusOut","relatedTarget","_a","connectedCallback","resizeObserver","ResizeObserver","componentDidLoad","preselectedTab","ariaSelected","observe","disconnectedCallback","disconnect","render","h","Host","class","size","SMALL","scrollable","onClick","bind","disabled","hidden","name","width","height","role","ariaLabel","ref","el","onScroll"],"sources":["src/components/z-navigation-tabs/styles.css?tag=z-navigation-tabs","src/components/z-navigation-tabs/index.tsx"],"sourcesContent":["z-navigation-tabs {\n --z-navigation-tabs-nav-buttons-bg: ;\n --z-navigation-tabs-nav-buttons-fg: ;\n\n position: relative;\n z-index: 0;\n display: flex;\n overflow: hidden;\n flex-direction: row;\n font-family: var(--font-family-sans);\n font-weight: var(--font-rg);\n}\n\nz-navigation-tabs,\nz-navigation-tabs * {\n box-sizing: border-box;\n}\n\nz-navigation-tabs > nav::-webkit-scrollbar {\n display: none;\n}\n\nz-navigation-tabs .navigation-button {\n position: absolute;\n z-index: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n margin: 0;\n background-color: var(--z-navigation-tabs-nav-buttons-bg, var(--color-surface01));\n border-radius: var(--border-no-radius);\n box-shadow: 0 0 4px 1px var(--shadow-color-base);\n cursor: pointer;\n fill: var(--z-navigation-tabs-nav-buttons-fg, var(--color-primary01));\n outline: none;\n}\n\nz-navigation-tabs .navigation-button:disabled {\n display: none;\n}\n\nz-navigation-tabs > nav {\n z-index: 0;\n display: flex;\n overflow: auto;\n align-items: center;\n justify-content: flex-start;\n scroll-behavior: smooth;\n\n /* hide scrollbar in Firefox */\n scrollbar-width: none;\n}\n\nz-navigation-tabs[orientation=\"horizontal\"] > nav {\n width: 100%;\n}\n\nz-navigation-tabs[orientation=\"horizontal\"] .navigation-button {\n top: 0;\n width: calc(var(--space-unit) * 4);\n height: 100%;\n}\n\nz-navigation-tabs[orientation=\"horizontal\"] .navigation-button:first-child {\n left: 0;\n}\n\nz-navigation-tabs[orientation=\"horizontal\"] .navigation-button:last-child {\n right: 0;\n}\n\n/* Orientation vertical */\nz-navigation-tabs[orientation=\"vertical\"] {\n width: fit-content;\n flex-direction: column;\n}\n\nz-navigation-tabs[orientation=\"vertical\"] > nav {\n height: 100%;\n flex-direction: column;\n align-items: stretch;\n}\n\nz-navigation-tabs[orientation=\"vertical\"] .navigation-button {\n left: 0;\n width: 100%;\n height: calc(var(--space-unit) * 4);\n}\n\nz-navigation-tabs[orientation=\"vertical\"] .navigation-button:first-child {\n top: 0;\n}\n\nz-navigation-tabs[orientation=\"vertical\"] .navigation-button:last-child {\n bottom: 0;\n}\n\nz-navigation-tabs[size=\"small\"][orientation=\"vertical\"] .navigation-button {\n height: calc(var(--space-unit) * 4);\n}\n\n/* Style for the tabs */\n\nz-navigation-tabs > nav > * {\n position: relative;\n z-index: 0;\n display: inline-flex;\n width: auto;\n align-items: center;\n justify-content: center;\n padding: calc(var(--space-unit) * 2) calc(var(--space-unit) * 5);\n border: none;\n margin: 0;\n background-color: unset;\n border-radius: var(--border-no-radius);\n color: var(--color-primary01);\n cursor: pointer;\n fill: currentcolor;\n font-family: var(--font-family-sans);\n font-size: inherit;\n gap: var(--space-unit);\n letter-spacing: inherit;\n line-height: inherit;\n outline: none;\n text-align: center;\n white-space: nowrap;\n}\n\nz-navigation-tabs > nav > a {\n text-decoration: none;\n}\n\nz-navigation-tabs > nav > *:focus:focus-visible {\n z-index: 1;\n box-shadow: inset 0 0 4px 3px var(--blue800);\n}\n\nz-navigation-tabs > nav > :not([disabled]):hover {\n background-color: var(--color-surface02);\n}\n\nz-navigation-tabs > nav > button[disabled] {\n color: var(--color-disabled03);\n cursor: not-allowed;\n fill: currentcolor;\n pointer-events: all;\n}\n\nz-navigation-tabs > nav > :not([disabled]):hover,\nnav > [aria-selected=\"true\"] {\n color: var(--color-hover-secondary);\n fill: currentcolor;\n}\n\nz-navigation-tabs > nav > :not([disabled]):hover::after,\nnav > [aria-selected=\"true\"]::after {\n position: absolute;\n background-color: var(--color-hover-secondary);\n content: \"\";\n}\n\nz-navigation-tabs[orientation=\"horizontal\"] > nav > :not([disabled]):hover::after,\nz-navigation-tabs[orientation=\"horizontal\"] > nav > [aria-selected=\"true\"]::after {\n bottom: 0;\n left: 0;\n width: 100%;\n height: var(--border-size-large);\n}\n\nz-navigation-tabs > nav > * z-icon {\n --z-icon-width: calc(var(--space-unit) * 2);\n --z-icon-height: calc(var(--space-unit) * 2);\n\n display: flex;\n margin: 0;\n}\n\n/* `small` size (only available for horizontal orientation) */\n\nz-navigation-tabs[size=\"small\"][orientation=\"horizontal\"] > nav > * {\n padding: var(--space-unit) calc(var(--space-unit) * 2);\n}\n\nz-navigation-tabs[size=\"small\"][orientation=\"horizontal\"] > nav > :not([disabled]):hover::after,\nz-navigation-tabs[size=\"small\"][orientation=\"horizontal\"] > nav > [aria-selected=\"true\"]::after {\n height: var(--border-size-medium);\n}\n\nz-navigation-tabs[size=\"small\"]:not([orientation=\"vertical\"]) > nav > * z-icon {\n --z-icon-width: 14px;\n --z-icon-height: 14px;\n}\n\n/* Orientation Vertical */\n\nz-navigation-tabs[orientation=\"vertical\"] > nav > * {\n padding: calc(var(--space-unit) * 3) calc(var(--space-unit) * 2);\n}\n\nz-navigation-tabs[orientation=\"vertical\"] > nav > * > :not(z-icon) {\n display: none;\n}\n\nz-navigation-tabs[orientation=\"vertical\"] > nav > :not([disabled]):hover::after,\nz-navigation-tabs[orientation=\"vertical\"] > nav > [aria-selected=\"true\"]::after {\n top: 0;\n right: 0;\n width: var(--border-size-large);\n height: 100%;\n}\n","import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {NavigationTabsKeyboardEvents, NavigationTabsOrientation, NavigationTabsSize} from \"../../beans\";\n\n/**\n * Navigation tabs component.\n * To select a specific tab programmatically, set the `aria-selected` attribute to `true` on the desired tab.\n * @slot - Main slot. Use `<button>` or `<a>` tags as children.\n * @cssprop --z-navigation-tabs-nav-buttons-bg - Navigation buttons background color.\n * @cssprop --z-navigation-tabs-nav-buttons-fg - Navigation buttons foreground color.\n */\n@Component({\n tag: \"z-navigation-tabs\",\n styleUrl: \"styles.css\",\n})\nexport class ZNavigationTabs {\n /**\n * Set `aria-label` attribute to the internal `<nav>` element with `tablist` role.\n */\n @Prop()\n ariaLabel = \"\";\n\n /**\n * Navigation tabs orientation.\n */\n @Prop({reflect: true})\n orientation? = NavigationTabsOrientation.HORIZONTAL;\n\n /**\n * Navigation tabs size.\n */\n @Prop({reflect: true})\n size? = NavigationTabsSize.BIG;\n\n /**\n * Index of the selected tab.\n * Useful to programmatically select a tab.\n * The tab can also be selected by setting the `aria-selected` attribute to `true` on the desired tab.\n */\n @Prop({mutable: true})\n selectedTab: number = undefined;\n\n /**\n * Emitted when the selected tab changes.\n * Contains the index of the new selected tab in the `detail` of the event.\n */\n @Event()\n selected: EventEmitter<number>;\n\n /**\n * Whether to show navigation buttons.\n */\n @State()\n canNavigate: boolean;\n\n /**\n * Whether backwards navigation is allowed.\n */\n @State()\n canNavigatePrev: boolean;\n\n /**\n * Whether forward navigation is allowed.\n */\n @State()\n canNavigateNext: boolean;\n\n @Element() host: HTMLZNavigationTabsElement;\n\n /**\n * Index of the last tab that held focus.\n */\n private focusedTab = undefined;\n\n /**\n * Reference to the `<nav>` element\n */\n private nav: HTMLElement;\n\n /**\n * Getter for the direction to check based on current orientation.\n */\n get direction(): string {\n return this.orientation == NavigationTabsOrientation.HORIZONTAL ? \"Left\" : \"Top\";\n }\n\n /**\n * Getter for the dimension to check based on current orientation.\n */\n get dimension(): string {\n return this.orientation == NavigationTabsOrientation.HORIZONTAL ? \"Width\" : \"Height\";\n }\n\n get tabs(): HTMLElement[] {\n return Array.from(this.nav.children) as HTMLElement[];\n }\n\n private resizeObserver: ResizeObserver;\n\n /**\n * Scroll into view to center the tab.\n */\n private scrollToTab(tabElement: HTMLElement): void {\n const scrollOptions = (\n this.orientation === NavigationTabsOrientation.HORIZONTAL\n ? {block: \"nearest\", inline: \"center\"}\n : {block: \"center\", inline: \"nearest\"}\n ) as ScrollIntoViewOptions;\n\n tabElement.scrollIntoView({\n behavior: \"smooth\",\n ...scrollOptions,\n });\n }\n\n /**\n * Scroll the navigation bar half of its size backward.\n */\n private navigateBackwards(): void {\n this.nav.scrollBy({\n [this.direction.toLowerCase()]: 0 - this.nav[`client${this.dimension}`] / 2,\n behavior: \"smooth\",\n });\n }\n\n /**\n * Scroll the navigation bar half of its size forward.\n */\n private navigateForward(): void {\n this.nav.scrollBy({\n [this.direction.toLowerCase()]: this.nav[`scroll${this.direction}`] + this.nav[`client${this.dimension}`] / 2,\n behavior: \"smooth\",\n });\n }\n\n /**\n * Check if a keyboard event was triggered by an arrow key.\n */\n private isArrowNavigation(e: KeyboardEvent): boolean {\n return Object.values(NavigationTabsKeyboardEvents).includes(e.key as NavigationTabsKeyboardEvents);\n }\n\n /**\n * Check if the navigation buttons are needed.\n */\n private checkScrollVisible(): void {\n if (!this.nav) {\n return;\n }\n\n this.canNavigate = this.nav[`scroll${this.dimension}`] > this.nav[`client${this.dimension}`];\n }\n\n /**\n * Check if navigation buttons can be enabled for each direction.\n */\n @Watch(\"canNavigate\")\n checkScrollEnabled(): void {\n if (!this.nav) {\n return;\n }\n\n this.canNavigateNext =\n this.nav[`scroll${this.direction}`] + this.nav[`client${this.dimension}`] < this.nav[`scroll${this.dimension}`];\n this.canNavigatePrev = this.nav[`scroll${this.direction}`] > 0;\n }\n\n /**\n * When the selected tab changes, update the `aria-selected` attribute on each tab and scroll to the selected tab.\n */\n @Watch(\"selectedTab\")\n onTabSelected(): void {\n this.tabs.forEach((tab, i) => {\n const zicon = tab.querySelector(\"z-icon\");\n const strokeIcon = zicon?.getAttribute(\"name\").replace(\"-filled\", \"\");\n if (i !== this.selectedTab) {\n tab.setAttribute(\"aria-selected\", \"false\");\n tab.tabIndex = -1;\n zicon?.setAttribute(\"name\", strokeIcon);\n\n return;\n }\n\n zicon?.setAttribute(\"name\", `${strokeIcon}-filled`);\n tab.setAttribute(\"aria-selected\", \"true\");\n });\n this.selected.emit(this.selectedTab);\n if (this.selectedTab !== undefined) {\n this.scrollToTab(this.tabs[this.selectedTab]);\n }\n }\n\n /**\n * Handle click on the tabs.\n * @param event `click` event triggered by a child tab\n */\n @Listen(\"click\")\n handleTabClick(event: MouseEvent): void {\n const clickedTab = (event.target as HTMLElement).closest<HTMLElement>(\"[role='tab']\");\n if (!this.tabs.some((child) => child.contains(clickedTab))) {\n return;\n }\n\n this.selectedTab = this.tabs.indexOf(clickedTab);\n }\n\n /**\n * When a tab is focused, temporarily set to -1 the `tabindex` of the selected tab (if any) and set the `focusedTab` to the index of the focused tab.\n */\n @Listen(\"focusin\")\n onTabFocusIn(event: FocusEvent): void {\n const focused = this.tabs.findIndex((tab) => tab.contains(event.target as HTMLElement));\n if (focused === -1) {\n return;\n }\n\n if (this.selectedTab !== undefined) {\n this.tabs[this.selectedTab].tabIndex = -1;\n }\n this.focusedTab = focused;\n this.tabs[this.focusedTab].tabIndex = -1;\n this.scrollToTab(this.tabs[this.focusedTab]);\n }\n\n /**\n * Handle keyboard navigation through tabs with arrow keys.\n */\n @Listen(\"keydown\")\n navigateThroughTabs(event: KeyboardEvent): void | boolean {\n if (!this.tabs.some((tab) => tab.contains(event.target as HTMLElement)) || !this.isArrowNavigation(event)) {\n return true;\n }\n\n event.preventDefault();\n if (\n (event.key === NavigationTabsKeyboardEvents.RIGHT && this.orientation == NavigationTabsOrientation.HORIZONTAL) ||\n (event.key === NavigationTabsKeyboardEvents.DOWN && this.orientation == NavigationTabsOrientation.VERTICAL)\n ) {\n // Move forward\n this.focusedTab++;\n if (this.focusedTab >= this.tabs.length) {\n this.focusedTab = 0;\n }\n } else if (\n (event.key === NavigationTabsKeyboardEvents.LEFT && this.orientation == NavigationTabsOrientation.HORIZONTAL) ||\n (event.key === NavigationTabsKeyboardEvents.UP && this.orientation == NavigationTabsOrientation.VERTICAL)\n ) {\n // Move backward\n this.focusedTab--;\n if (this.focusedTab < 0) {\n this.focusedTab = this.tabs.length - 1;\n }\n }\n // Ignore disabled tabs\n if (\n this.tabs[this.focusedTab].hasAttribute(\"disabled\") &&\n this.tabs[this.focusedTab].getAttribute(\"disabled\") !== \"false\"\n ) {\n return this.navigateThroughTabs(event);\n }\n\n this.tabs[this.focusedTab].focus();\n this.scrollToTab(this.tabs[this.focusedTab]);\n }\n\n /**\n * If the focus is not going on a tab (`relatedTarget` is the new focused element), set to 0 the `tabindex` of the selected tab or the one of the first tab, then unset the `focusedTab`.\n */\n @Listen(\"focusout\")\n onTabFocusOut(event: FocusEvent): void {\n if (!this.tabs.some((tab) => tab.contains(event.relatedTarget as HTMLElement))) {\n this.tabs[this.selectedTab ?? 0].tabIndex = 0;\n this.focusedTab = undefined;\n }\n }\n\n connectedCallback(): void {\n this.resizeObserver = new ResizeObserver(() => this.checkScrollVisible());\n }\n\n componentDidLoad(): void {\n // Set role and tabindex to each slotted tab\n this.tabs.forEach((tab) => {\n tab.setAttribute(\"role\", \"tab\");\n tab.tabIndex = -1;\n });\n\n const preselectedTab = this.selectedTab ?? this.tabs.findIndex((tab) => tab.ariaSelected === \"true\");\n if (preselectedTab !== -1) {\n this.selectedTab = preselectedTab;\n this.tabs[preselectedTab].tabIndex = 0;\n this.onTabSelected();\n } else {\n this.tabs[0].tabIndex = 0;\n }\n\n this.resizeObserver.observe(this.nav);\n }\n\n disconnectedCallback(): void {\n this.resizeObserver?.disconnect();\n }\n\n render(): HTMLZNavigationTabsElement {\n return (\n <Host\n class={{\n \"interactive-2\": this.size === NavigationTabsSize.SMALL,\n \"interactive-1\": this.size !== NavigationTabsSize.SMALL,\n }}\n scrollable={this.canNavigate}\n >\n <button\n class=\"navigation-button\"\n onClick={this.navigateBackwards.bind(this)}\n tabIndex={-1}\n disabled={!this.canNavigatePrev}\n aria-label=\"Mostra elementi precedenti\"\n hidden={!this.canNavigate}\n >\n <z-icon\n name={this.orientation === NavigationTabsOrientation.HORIZONTAL ? \"chevron-left\" : \"chevron-up\"}\n width={16}\n height={16}\n />\n </button>\n\n <nav\n role=\"tablist\"\n aria-label={this.ariaLabel}\n ref={(el) => (this.nav = el ?? this.nav)}\n onScroll={this.checkScrollEnabled.bind(this)}\n aria-orientation={this.orientation}\n >\n <slot></slot>\n </nav>\n\n <button\n class=\"navigation-button\"\n onClick={this.navigateForward.bind(this)}\n tabIndex={-1}\n disabled={!this.canNavigateNext}\n aria-label=\"Mostra elementi successivi\"\n hidden={!this.canNavigate}\n >\n <z-icon\n name={this.orientation === NavigationTabsOrientation.HORIZONTAL ? \"chevron-right\" : \"chevron-down\"}\n width={16}\n height={16}\n />\n </button>\n </Host>\n );\n }\n}\n"],"mappings":"gOAAA,IAAMA,EAAY,ujJAClB,IAAAC,EAAeD,E,ICaFE,EAAeC,EAAA,+B,2DAyDlBC,KAAAC,WAAaC,U,eApDT,G,iBAMGC,EAA0BC,W,UAMjCC,EAAmBC,I,iBAQLJ,U,yFA0CtBK,OAAAC,eAAIC,EAAAC,UAAA,YAAS,C,IAAb,WACE,OAAOV,KAAKW,aAAeR,EAA0BC,WAAa,OAAS,K,uCAM7EG,OAAAC,eAAIC,EAAAC,UAAA,YAAS,C,IAAb,WACE,OAAOV,KAAKW,aAAeR,EAA0BC,WAAa,QAAU,Q,uCAG9EG,OAAAC,eAAIC,EAAAC,UAAA,OAAI,C,IAAR,WACE,OAAOE,MAAMC,KAAKb,KAAKc,IAAIC,S,uCAQrBN,EAAAC,UAAAM,YAAA,SAAYC,GAClB,IAAMC,EACJlB,KAAKW,cAAgBR,EAA0BC,WAC3C,CAACe,MAAO,UAAWC,OAAQ,UAC3B,CAACD,MAAO,SAAUC,OAAQ,WAGhCH,EAAWI,eAAcd,OAAAe,OAAA,CACvBC,SAAU,UACPL,G,EAOCT,EAAAC,UAAAc,kBAAA,W,MACNxB,KAAKc,IAAIW,UAAQC,EAAA,GACfA,EAAC1B,KAAK2B,UAAUC,eAAgB,EAAI5B,KAAKc,IAAI,SAAAe,OAAS7B,KAAK8B,YAAe,EAC1EJ,EAAAH,SAAU,S,KAONd,EAAAC,UAAAqB,gBAAA,W,MACN/B,KAAKc,IAAIW,UAAQC,EAAA,GACfA,EAAC1B,KAAK2B,UAAUC,eAAgB5B,KAAKc,IA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AAmF,OAAA,eAAAjD,EAAA5C,KACE,OACE8F,EAACC,EAAI,CAAA1D,IAAA,2CACH2D,MAAO,CACL,gBAAiBhG,KAAKiG,OAAS5F,EAAmB6F,MAClD,gBAAiBlG,KAAKiG,OAAS5F,EAAmB6F,OAEpDC,WAAYnG,KAAKuC,aAEjBuD,EAAA,UAAAzD,IAAA,2CACE2D,MAAM,oBACNI,QAASpG,KAAKwB,kBAAkB6E,KAAKrG,MACrCwD,UAAW,EACX8C,UAAWtG,KAAK0C,gBAAe,aACpB,6BACX6D,QAASvG,KAAKuC,aAEduD,EAAA,UAAAzD,IAAA,2CACEmE,KAAMxG,KAAKW,cAAgBR,EAA0BC,WAAa,eAAiB,aACnFqG,MAAO,GACPC,OAAQ,MAIZZ,EAAA,OAAAzD,IAAA,2CACEsE,KAAK,UAAS,aACF3G,KAAK4G,UACjBC,IAAK,SAACC,GAAE,OAAMlE,EAAK9B,IAAMgG,IAAE,MAAFA,SAAE,EAAFA,EAAMlE,EAAK9B,GAA5B,EACRiG,SAAU/G,KAAKwC,mBAAmB6D,KAAKrG,MAAK,mBAC1BA,KAAKW,aAEvBmF,EAAA,QAAAzD,IAAA,8CAGFyD,EAAA,UAAAzD,IAAA,2CACE2D,MAAM,oBACNI,QAASpG,KAAK+B,gBAAgBsE,KAAKrG,MACnCwD,UAAW,EACX8C,UAAWtG,KAAKyC,gBAAe,aACpB,6BACX8D,QAASvG,KAAKuC,aAEduD,EAAA,UAAAzD,IAAA,2CACEmE,KAAMxG,KAAKW,cAAgBR,EAA0BC,WAAa,gBAAkB,eACpFqG,MAAO,GACPC,OAAQ,M,2RA7UQ,I","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ System.register(["./p-d8fcaf1f.system.js"],(function(t){"use strict";var e,o,i,n;return{setters:[function(t){e=t.r;o=t.c;i=t.h;n=t.a}],execute:function(){var s=':host{--z-notification--top-offset:0;display:-ms-flexbox;display:flex;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-align:start;align-items:flex-start;padding:calc(var(--space-unit) * 2);border-bottom:var(--border-size-medium) solid var(--color-surface03);font-family:var(--font-family-sans);outline:none}:host[sticky]{position:-webkit-sticky;position:sticky;top:var(--z-notification--top-offset)}:host[sticky],:host([showshadow]){-webkit-box-shadow:var(--shadow-3);box-shadow:var(--shadow-3)}:host([type="success"]){background:var(--color-success-inverse)}:host([type="warning"]){background:var(--color-warning-inverse)}:host([type="error"]){background:var(--color-error-inverse)}.status-icon,.close-button{display:-ms-flexbox;display:flex;height:20px;-ms-flex-align:center;align-items:center}:host([type="success"]) .status-icon{fill:var(--color-success01)}:host([type="warning"]) .status-icon{fill:var(--color-warning02)}:host([type="error"]) .status-icon{fill:var(--color-error01)}:host>button,.content-container>button{padding:0;border:none;margin:0;background:transparent;cursor:pointer;font-family:inherit}.status-icon+.content-container{margin-left:var(--space-unit)}.content-container{display:-ms-flexbox;display:flex;-ms-flex:1 auto;flex:1 auto;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:baseline;align-items:baseline;-ms-flex-pack:justify;justify-content:space-between;row-gap:calc(var(--space-unit) * 2)}.content-text{max-width:800px;color:var(--color-default-text);font-size:var(--font-size-2);font-weight:var(--font-rg);letter-spacing:0.16px;line-height:20px}.action-button{color:var(--color-primary01);font-size:var(--font-size-1);font-weight:var(--font-sb);letter-spacing:0.32px;line-height:16px}.action-button:focus{-webkit-box-shadow:var(--shadow-focus-primary);box-shadow:var(--shadow-focus-primary);outline:none !important}.content-container+.close-button{margin-left:calc(var(--space-unit) * 2)}.close-button z-icon{fill:var(--color-primary01)}@media only screen and (min-width: 768px){.content-container{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.content-text+.action-button{margin-left:calc(var(--space-unit) * 5)}}';var a=s;var c=t("z_notification",function(){function t(t){e(this,t);this.notificationAction=o(this,"notificationAction",7);this.notificationClose=o(this,"notificationClose",7);this.contenticonname=undefined;this.actiontext=undefined;this.type=undefined;this.showclose=false;this.showshadow=false;this.sticky=false;this.handleActionButtonClick=this.handleActionButtonClick.bind(this);this.handleCloseButtonClick=this.handleCloseButtonClick.bind(this)}t.prototype.handleActionButtonClick=function(t){t.preventDefault();this.notificationAction.emit()};t.prototype.handleCloseButtonClick=function(t){t.preventDefault();this.notificationClose.emit()};t.prototype.render=function(){var t;return i(n,{key:"49e877c8628f367adc596b40d5f12d5e66f78ed0"},this.contenticonname&&i("z-icon",{key:"56257c6011f6b5b17c8bbd6250ec99b8d1e41ee2",class:"status-icon",name:this.contenticonname,width:16,height:16}),i("div",{key:"dc56b45ea4f7d52bb193f8d3c22bb5910be9eeea",class:"content-container"},i("div",{key:"2637553cf2f72a948014110e96559d15c45513fa",class:"content-text"},i("slot",{key:"1e60cbb429a9620b88d7cb90df90874d3e454f48"})),!!((t=this.actiontext)===null||t===void 0?void 0:t.trim())&&i("button",{key:"844e0ba5cef8b13f9d91d5c09472893de5127cc4",class:"action-button",type:"button",onClick:this.handleActionButtonClick},this.actiontext)),this.showclose&&i("button",{key:"8761fc65bd1b44b38a219e80d8f12b10a898cefe",class:"close-button",type:"button",onClick:this.handleCloseButtonClick},i("z-icon",{key:"7bd949a2c0abf7431765f28542443c9110097ab3",name:"multiply-circle",width:16,height:16})))};return t}());c.style=a}}}));
2
+ //# sourceMappingURL=p-25872e04.system.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["stylesCss","ZNotificationStyle0","ZNotification","exports","class_1","hostRef","this","handleActionButtonClick","bind","handleCloseButtonClick","prototype","e","preventDefault","notificationAction","emit","notificationClose","render","h","Host","key","contenticonname","class","name","width","height","_a","actiontext","trim","type","onClick","showclose"],"sources":["src/components/z-notification/styles.css?tag=z-notification&encapsulation=shadow","src/components/z-notification/index.tsx"],"sourcesContent":[":host {\n --z-notification--top-offset: 0;\n\n display: flex;\n width: 100%;\n box-sizing: border-box;\n align-items: flex-start;\n padding: calc(var(--space-unit) * 2);\n border-bottom: var(--border-size-medium) solid var(--color-surface03);\n font-family: var(--font-family-sans);\n outline: none;\n}\n\n:host[sticky] {\n position: sticky;\n top: var(--z-notification--top-offset);\n}\n\n:host[sticky],\n:host([showshadow]) {\n box-shadow: var(--shadow-3);\n}\n\n:host([type=\"success\"]) {\n background: var(--color-success-inverse);\n}\n\n:host([type=\"warning\"]) {\n background: var(--color-warning-inverse);\n}\n\n:host([type=\"error\"]) {\n background: var(--color-error-inverse);\n}\n\n.status-icon,\n.close-button {\n /* simulate the line-height of the text\n to make the icon look correctly aligned with it. */\n display: flex;\n height: 20px;\n align-items: center;\n}\n\n:host([type=\"success\"]) .status-icon {\n fill: var(--color-success01);\n}\n\n:host([type=\"warning\"]) .status-icon {\n fill: var(--color-warning02);\n}\n\n:host([type=\"error\"]) .status-icon {\n fill: var(--color-error01);\n}\n\n:host > button,\n.content-container > button {\n padding: 0;\n border: none;\n margin: 0;\n background: transparent;\n cursor: pointer;\n font-family: inherit;\n}\n\n.status-icon + .content-container {\n margin-left: var(--space-unit);\n}\n\n.content-container {\n display: flex;\n flex: 1 auto;\n flex-wrap: wrap;\n align-items: baseline;\n justify-content: space-between;\n row-gap: calc(var(--space-unit) * 2);\n}\n\n.content-text {\n max-width: 800px;\n color: var(--color-default-text);\n font-size: var(--font-size-2);\n font-weight: var(--font-rg);\n letter-spacing: 0.16px;\n line-height: 20px;\n}\n\n.action-button {\n color: var(--color-primary01);\n font-size: var(--font-size-1);\n font-weight: var(--font-sb);\n letter-spacing: 0.32px;\n line-height: 16px;\n}\n\n.action-button:focus {\n box-shadow: var(--shadow-focus-primary);\n outline: none !important;\n}\n\n.content-container + .close-button {\n margin-left: calc(var(--space-unit) * 2);\n}\n\n.close-button z-icon {\n fill: var(--color-primary01);\n}\n\n/* Tablet breakpoint */\n@media only screen and (min-width: 768px) {\n .content-container {\n flex-wrap: nowrap;\n }\n\n .content-text + .action-button {\n margin-left: calc(var(--space-unit) * 5);\n }\n}\n","import {Component, Event, EventEmitter, Host, Prop, h} from \"@stencil/core\";\nimport {NotificationType} from \"../../beans\";\n\n/**\n * Notification bar component.\n * @slot - The text of the notification.\n * @cssprop --z-notification--top-offset - The top offset of the notification. Use it when `sticky` prop is set to `true` and you need the notification to stay under other sticky elements. Default: 0px.\n */\n@Component({\n tag: \"z-notification\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZNotification {\n /** Name of the icon on the left of the content */\n @Prop()\n contenticonname?: string;\n\n /** Action button text */\n @Prop()\n actiontext?: string;\n\n /** Alert variant type */\n @Prop({reflect: true})\n type: NotificationType;\n\n /** Enable close icon */\n @Prop()\n showclose?: boolean = false;\n\n /**\n * Enable shadow.\n * @deprecated shadow is available only for the `sticky` version of the notification.\n */\n @Prop({reflect: true})\n showshadow?: boolean = false;\n\n /** Enable sticky notification bar. */\n @Prop({reflect: true})\n sticky?: boolean = false;\n\n /** Call to action clicked */\n @Event()\n notificationAction: EventEmitter;\n\n private handleActionButtonClick(e: MouseEvent): void {\n e.preventDefault();\n this.notificationAction.emit();\n }\n\n /** Close button clicked */\n @Event()\n notificationClose: EventEmitter;\n\n private handleCloseButtonClick(e: MouseEvent): void {\n e.preventDefault();\n this.notificationClose.emit();\n }\n\n constructor() {\n this.handleActionButtonClick = this.handleActionButtonClick.bind(this);\n this.handleCloseButtonClick = this.handleCloseButtonClick.bind(this);\n }\n\n render(): HTMLZNotificationElement {\n return (\n <Host>\n {this.contenticonname && (\n <z-icon\n class=\"status-icon\"\n name={this.contenticonname}\n width={16}\n height={16}\n />\n )}\n <div class=\"content-container\">\n <div class=\"content-text\">\n <slot></slot>\n </div>\n {!!this.actiontext?.trim() && (\n <button\n class=\"action-button\"\n type=\"button\"\n onClick={this.handleActionButtonClick}\n >\n {this.actiontext}\n </button>\n )}\n </div>\n {this.showclose && (\n <button\n class=\"close-button\"\n type=\"button\"\n onClick={this.handleCloseButtonClick}\n >\n <z-icon\n name=\"multiply-circle\"\n width={16}\n height={16}\n />\n </button>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"0JAAA,IAAMA,EAAY,ynEAClB,IAAAC,EAAeD,E,ICYFE,EAAaC,EAAA,4BA8CxB,SAAAC,EAAAC,G,kNA/BsB,M,gBAOC,M,YAIJ,MAqBjBC,KAAKC,wBAA0BD,KAAKC,wBAAwBC,KAAKF,MACjEA,KAAKG,uBAAyBH,KAAKG,uBAAuBD,KAAKF,K,CAhBzDF,EAAAM,UAAAH,wBAAA,SAAwBI,GAC9BA,EAAEC,iBACFN,KAAKO,mBAAmBC,M,EAOlBV,EAAAM,UAAAD,uBAAA,SAAuBE,GAC7BA,EAAEC,iBACFN,KAAKS,kBAAkBD,M,EAQzBV,EAAAM,UAAAM,OAAA,W,MACE,OACEC,EAACC,EAAI,CAAAC,IAAA,4CACFb,KAAKc,iBACJH,EAAA,UAAAE,IAAA,2CACEE,MAAM,cACNC,KAAMhB,KAAKc,gBACXG,MAAO,GACPC,OAAQ,KAGZP,EAAA,OAAAE,IAAA,2CAAKE,MAAM,qBACTJ,EAAA,OAAAE,IAAA,2CAAKE,MAAM,gBACTJ,EAAA,QAAAE,IAAA,kDAECM,EAAAnB,KAAKoB,cAAU,MAAAD,SAAA,SAAAA,EAAEE,SAClBV,EAAA,UAAAE,IAAA,2CACEE,MAAM,gBACNO,KAAK,SACLC,QAASvB,KAAKC,yBAEbD,KAAKoB,aAIXpB,KAAKwB,WACJb,EAAA,UAAAE,IAAA,2CACEE,MAAM,eACNO,KAAK,SACLC,QAASvB,KAAKG,wBAEdQ,EAAA,UAAAE,IAAA,2CACEG,KAAK,kBACLC,MAAO,GACPC,OAAQ,M,WArFI,I","ignoreList":[]}