@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
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/file-upload/z-file-upload/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAC,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAC,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAO/C,MAAM,OAAO,WAAW;;QA+Ed,oBAAe,GAAG;YACxB,IAAI,EAAE,MAAM;YACZ,EAAE,EAAE,WAAW;YACf,QAAQ,EAAE,IAAI;SACf,CAAC;oBAhFsB,eAAe,CAAC,OAAO;;;;;;qBAwB/B,EAAE;8BAIQ,QAAQ;gCAIN,+CAA+C;;sCAQzC,QAAQ;6BAIjB,6BAA6B;+BAI3B,uBAAuB;;kCAQpB,sBAAsB;8BAIzB,IAAI;;;IAsB/B,yDAAyD;IAEzD,kBAAkB,CAAC,CAAc;QAC/B,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,mEAAmE;IAEnE,mBAAmB,CAAC,CAAc;QAChC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QAC5B,IAAI,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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\n tabIndex={0}\n class={`container ${this.getType()}`}\n >\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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/file-upload/z-file-upload/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAC,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAC,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAO/C,MAAM,OAAO,WAAW;;QA+Ed,oBAAe,GAAG;YACxB,IAAI,EAAE,MAAM;YACZ,EAAE,EAAE,WAAW;YACf,QAAQ,EAAE,IAAI;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GAAG,CAAC,EACrC,UAAU,EAAE,IAAI,CAAC,eAAe,EAChC,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,EAAoB,CAAC,EACrE,sBAAsB,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,EAAoB,CAAC,IAE9E,IAAI,CAAC,uBAAuB,EAAE,CACvB,CACX,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
@@ -15,7 +15,7 @@ describe("Suite test ZFileUpload", () => {
15
15
  expect(page.root).toEqualHtml(`
16
16
  <z-file-upload accepted-format=".pdf, .doc, .tiff, .png, .jpg, .jpeg" description="Vuoi allegare un file per chiarire meglio la tua richiesta?" file-max-size="50" main-title="Allega un file" type="default" variant="primary">
17
17
  <mock:shadow-root>
18
- <div class="container default" tabindex="0">
18
+ <div class="container default">
19
19
  <span id="title">
20
20
  Allega un file
21
21
  </span>
@@ -56,7 +56,7 @@ describe("Suite test ZFileUpload", () => {
56
56
  expect(page.root)
57
57
  .toEqualHtml(` <z-file-upload accepted-format=".pdf, .doc, .tiff, .png, .jpg, .jpeg" description="Vuoi allegare un file per chiarire meglio la tua richiesta?" file-max-size="50" main-title="Allega un file" type="dragdrop">
58
58
  <mock:shadow-root>
59
- <div class="container dragdrop" tabindex="0">
59
+ <div class="container dragdrop">
60
60
  <span id="title">
61
61
  Allega un file
62
62
  </span>
@@ -106,7 +106,7 @@ describe("Suite test ZFileUpload", () => {
106
106
  expect(page.root).toEqualHtml(`
107
107
  <z-file-upload accepted-format=".pdf, .doc, .tiff, .png, .jpg, .jpeg" description="Vuoi allegare un file per chiarire meglio la tua richiesta?" file-max-size="50" upload-btn-label="testo custom" drag-and-drop-label="drag and drop custom label" type="default" variant="primary">
108
108
  <mock:shadow-root>
109
- <div class="container default" tabindex="0">
109
+ <div class="container default">
110
110
  <span class="body-3-sb">
111
111
  Vuoi allegare un file per chiarire meglio la tua richiesta?
112
112
  </span>
@@ -1 +1 @@
1
- {"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../../../src/components/file-upload/z-file-upload/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AAEpC,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,EAAE,CAAC,iCAAiC,EAAE,KAAK,IAAI,EAAE;QAC/C,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,WAAW,CAAC;YACzB,IAAI,EAAE;;;;;;8BAMkB;SACzB,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA6Bb,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kCAAkC,EAAE,KAAK,IAAI,EAAE;QAChD,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,WAAW,CAAC;YACzB,IAAI,EAAE;;;;;8BAKkB;SACzB,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;aACd,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAmCI,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8DAA8D,EAAE,KAAK,IAAI,EAAE;QAC5E,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,WAAW,CAAC;YACzB,IAAI,EAAE;;;;;;;8BAOkB;SACzB,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;qBA0Bb,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import {newSpecPage} from \"@stencil/core/testing\";\n\nimport {ZFileUpload} from \"./index\";\n\ndescribe(\"Suite test ZFileUpload\", () => {\n it(\"Test render ZFileUpload default\", async () => {\n const page = await newSpecPage({\n components: [ZFileUpload],\n html: `<z-file-upload type=\"default\"\n variant=\"primary\"\n main-title=\"Allega un file\"\n description=\"Vuoi allegare un file per chiarire meglio la tua richiesta?\"\n accepted-format= \".pdf, .doc, .tiff, .png, .jpg, .jpeg\"\n file-max-size=\"50\">>\n </z-file-upload>`,\n });\n expect(page.root).toEqualHtml(`\n <z-file-upload accepted-format=\".pdf, .doc, .tiff, .png, .jpg, .jpeg\" description=\"Vuoi allegare un file per chiarire meglio la tua richiesta?\" file-max-size=\"50\" main-title=\"Allega un file\" type=\"default\" variant=\"primary\">\n <mock:shadow-root>\n <div class=\"container default\" tabindex=\"0\">\n <span id=\"title\">\n Allega un file\n </span>\n <span class=\"body-3-sb\">\n Vuoi allegare un file per chiarire meglio la tua richiesta?\n </span>\n <span class=\"body-3\">\n Puoi allegare file nei formati PDF, DOC, TIFF, PNG, JPG, JPEG per un massimo di 50MB di peso.\n </span>\n <section class=\"files-container hidden\">\n <span class=\"heading-4-sb\">\n File appena caricati\n </span>\n <div class=\"files-wrapper\">\n <slot name=\"files\"></slot>\n </div>\n <z-divider size=\"medium\"></z-divider>\n </section>\n <input accept=\".pdf, .doc, .tiff, .png, .jpg, .jpeg\" id=\"file-elem\" multiple=\"\" type=\"file\">\n <z-button icon=\"upload\" id=\"fileSelect\">\n allega\n </z-button>\n </div>\n </mock:shadow-root>\n &gt;\n </z-file-upload>`);\n });\n\n it(\"Test render ZFileUpload dragdrop\", async () => {\n const page = await newSpecPage({\n components: [ZFileUpload],\n html: `<z-file-upload type=\"dragdrop\"\n main-title=\"Allega un file\"\n description=\"Vuoi allegare un file per chiarire meglio la tua richiesta?\"\n accepted-format= \".pdf, .doc, .tiff, .png, .jpg, .jpeg\"\n file-max-size=\"50\">>\n </z-file-upload>`,\n });\n expect(page.root)\n .toEqualHtml(` <z-file-upload accepted-format=\".pdf, .doc, .tiff, .png, .jpg, .jpeg\" description=\"Vuoi allegare un file per chiarire meglio la tua richiesta?\" file-max-size=\"50\" main-title=\"Allega un file\" type=\"dragdrop\">\n <mock:shadow-root>\n <div class=\"container dragdrop\" tabindex=\"0\">\n <span id=\"title\">\n Allega un file\n </span>\n <section class=\"files-container hidden\">\n <span class=\"heading-4-sb\">\n File appena caricati\n </span>\n <div class=\"files-wrapper\">\n <slot name=\"files\"></slot>\n </div>\n <z-divider size=\"medium\"></z-divider>\n </section>\n <z-dragdrop-area drag-and-drop-label=\"Rilascia i file in questa area per allegarli.\">\n <div class=\"text-container\">\n <span class=\"body-1\">\n Vuoi allegare un file per chiarire meglio la tua richiesta?\n </span>\n <input accept=\".pdf, .doc, .tiff, .png, .jpg, .jpeg\" id=\"file-elem\" multiple=\"\" type=\"file\">\n <span class=\"body-1 upload-link-text\">\n <span class=\"body-1-sb upload-link\" tabindex=\"0\">\n Carica\n </span>\n o trascina dal tuo computer\n </span>\n <span class=\"body-3\">\n Puoi allegare file nei formati PDF, DOC, TIFF, PNG, JPG, JPEG per un massimo di 50MB di peso.\n </span>\n </div>\n </z-dragdrop-area>\n </div>\n </mock:shadow-root>\n &gt;\n </z-file-upload>`);\n });\n\n it(\"Test render ZFileUpload with custom label and not main-title\", async () => {\n const page = await newSpecPage({\n components: [ZFileUpload],\n html: `<z-file-upload type=\"default\"\n variant=\"primary\"\n description=\"Vuoi allegare un file per chiarire meglio la tua richiesta?\"\n accepted-format=\".pdf, .doc, .tiff, .png, .jpg, .jpeg\"\n upload-btn-label=\"testo custom\"\n drag-and-drop-label=\"drag and drop custom label\"\n file-max-size=\"50\">>\n </z-file-upload>`,\n });\n expect(page.root).toEqualHtml(`\n <z-file-upload accepted-format=\".pdf, .doc, .tiff, .png, .jpg, .jpeg\" description=\"Vuoi allegare un file per chiarire meglio la tua richiesta?\" file-max-size=\"50\" upload-btn-label=\"testo custom\" drag-and-drop-label=\"drag and drop custom label\" type=\"default\" variant=\"primary\">\n <mock:shadow-root>\n <div class=\"container default\" tabindex=\"0\">\n <span class=\"body-3-sb\">\n Vuoi allegare un file per chiarire meglio la tua richiesta?\n </span>\n <span class=\"body-3\">\n Puoi allegare file nei formati PDF, DOC, TIFF, PNG, JPG, JPEG per un massimo di 50MB di peso.\n </span>\n <section class=\"files-container hidden\">\n <span class=\"heading-4-sb\">\n File appena caricati\n </span>\n <div class=\"files-wrapper\">\n <slot name=\"files\"></slot>\n </div>\n <z-divider size=\"medium\"></z-divider>\n </section>\n <input accept=\".pdf, .doc, .tiff, .png, .jpg, .jpeg\" id=\"file-elem\" multiple=\"\" type=\"file\">\n <z-button icon=\"upload\" id=\"fileSelect\">\n testo custom\n </z-button>\n </div>\n </mock:shadow-root>\n &gt;\n </z-file-upload>`);\n });\n});\n"]}
1
+ {"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../../../src/components/file-upload/z-file-upload/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AAEpC,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,EAAE,CAAC,iCAAiC,EAAE,KAAK,IAAI,EAAE;QAC/C,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,WAAW,CAAC;YACzB,IAAI,EAAE;;;;;;8BAMkB;SACzB,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA6Bb,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kCAAkC,EAAE,KAAK,IAAI,EAAE;QAChD,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,WAAW,CAAC;YACzB,IAAI,EAAE;;;;;8BAKkB;SACzB,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;aACd,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAmCI,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8DAA8D,EAAE,KAAK,IAAI,EAAE;QAC5E,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,WAAW,CAAC;YACzB,IAAI,EAAE;;;;;;;8BAOkB;SACzB,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;qBA0Bb,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import {newSpecPage} from \"@stencil/core/testing\";\n\nimport {ZFileUpload} from \"./index\";\n\ndescribe(\"Suite test ZFileUpload\", () => {\n it(\"Test render ZFileUpload default\", async () => {\n const page = await newSpecPage({\n components: [ZFileUpload],\n html: `<z-file-upload type=\"default\"\n variant=\"primary\"\n main-title=\"Allega un file\"\n description=\"Vuoi allegare un file per chiarire meglio la tua richiesta?\"\n accepted-format= \".pdf, .doc, .tiff, .png, .jpg, .jpeg\"\n file-max-size=\"50\">>\n </z-file-upload>`,\n });\n expect(page.root).toEqualHtml(`\n <z-file-upload accepted-format=\".pdf, .doc, .tiff, .png, .jpg, .jpeg\" description=\"Vuoi allegare un file per chiarire meglio la tua richiesta?\" file-max-size=\"50\" main-title=\"Allega un file\" type=\"default\" variant=\"primary\">\n <mock:shadow-root>\n <div class=\"container default\">\n <span id=\"title\">\n Allega un file\n </span>\n <span class=\"body-3-sb\">\n Vuoi allegare un file per chiarire meglio la tua richiesta?\n </span>\n <span class=\"body-3\">\n Puoi allegare file nei formati PDF, DOC, TIFF, PNG, JPG, JPEG per un massimo di 50MB di peso.\n </span>\n <section class=\"files-container hidden\">\n <span class=\"heading-4-sb\">\n File appena caricati\n </span>\n <div class=\"files-wrapper\">\n <slot name=\"files\"></slot>\n </div>\n <z-divider size=\"medium\"></z-divider>\n </section>\n <input accept=\".pdf, .doc, .tiff, .png, .jpg, .jpeg\" id=\"file-elem\" multiple=\"\" type=\"file\">\n <z-button icon=\"upload\" id=\"fileSelect\">\n allega\n </z-button>\n </div>\n </mock:shadow-root>\n &gt;\n </z-file-upload>`);\n });\n\n it(\"Test render ZFileUpload dragdrop\", async () => {\n const page = await newSpecPage({\n components: [ZFileUpload],\n html: `<z-file-upload type=\"dragdrop\"\n main-title=\"Allega un file\"\n description=\"Vuoi allegare un file per chiarire meglio la tua richiesta?\"\n accepted-format= \".pdf, .doc, .tiff, .png, .jpg, .jpeg\"\n file-max-size=\"50\">>\n </z-file-upload>`,\n });\n expect(page.root)\n .toEqualHtml(` <z-file-upload accepted-format=\".pdf, .doc, .tiff, .png, .jpg, .jpeg\" description=\"Vuoi allegare un file per chiarire meglio la tua richiesta?\" file-max-size=\"50\" main-title=\"Allega un file\" type=\"dragdrop\">\n <mock:shadow-root>\n <div class=\"container dragdrop\">\n <span id=\"title\">\n Allega un file\n </span>\n <section class=\"files-container hidden\">\n <span class=\"heading-4-sb\">\n File appena caricati\n </span>\n <div class=\"files-wrapper\">\n <slot name=\"files\"></slot>\n </div>\n <z-divider size=\"medium\"></z-divider>\n </section>\n <z-dragdrop-area drag-and-drop-label=\"Rilascia i file in questa area per allegarli.\">\n <div class=\"text-container\">\n <span class=\"body-1\">\n Vuoi allegare un file per chiarire meglio la tua richiesta?\n </span>\n <input accept=\".pdf, .doc, .tiff, .png, .jpg, .jpeg\" id=\"file-elem\" multiple=\"\" type=\"file\">\n <span class=\"body-1 upload-link-text\">\n <span class=\"body-1-sb upload-link\" tabindex=\"0\">\n Carica\n </span>\n o trascina dal tuo computer\n </span>\n <span class=\"body-3\">\n Puoi allegare file nei formati PDF, DOC, TIFF, PNG, JPG, JPEG per un massimo di 50MB di peso.\n </span>\n </div>\n </z-dragdrop-area>\n </div>\n </mock:shadow-root>\n &gt;\n </z-file-upload>`);\n });\n\n it(\"Test render ZFileUpload with custom label and not main-title\", async () => {\n const page = await newSpecPage({\n components: [ZFileUpload],\n html: `<z-file-upload type=\"default\"\n variant=\"primary\"\n description=\"Vuoi allegare un file per chiarire meglio la tua richiesta?\"\n accepted-format=\".pdf, .doc, .tiff, .png, .jpg, .jpeg\"\n upload-btn-label=\"testo custom\"\n drag-and-drop-label=\"drag and drop custom label\"\n file-max-size=\"50\">>\n </z-file-upload>`,\n });\n expect(page.root).toEqualHtml(`\n <z-file-upload accepted-format=\".pdf, .doc, .tiff, .png, .jpg, .jpeg\" description=\"Vuoi allegare un file per chiarire meglio la tua richiesta?\" file-max-size=\"50\" upload-btn-label=\"testo custom\" drag-and-drop-label=\"drag and drop custom label\" type=\"default\" variant=\"primary\">\n <mock:shadow-root>\n <div class=\"container default\">\n <span class=\"body-3-sb\">\n Vuoi allegare un file per chiarire meglio la tua richiesta?\n </span>\n <span class=\"body-3\">\n Puoi allegare file nei formati PDF, DOC, TIFF, PNG, JPG, JPEG per un massimo di 50MB di peso.\n </span>\n <section class=\"files-container hidden\">\n <span class=\"heading-4-sb\">\n File appena caricati\n </span>\n <div class=\"files-wrapper\">\n <slot name=\"files\"></slot>\n </div>\n <z-divider size=\"medium\"></z-divider>\n </section>\n <input accept=\".pdf, .doc, .tiff, .png, .jpg, .jpeg\" id=\"file-elem\" multiple=\"\" type=\"file\">\n <z-button icon=\"upload\" id=\"fileSelect\">\n testo custom\n </z-button>\n </div>\n </mock:shadow-root>\n &gt;\n </z-file-upload>`);\n });\n});\n"]}
@@ -1,3 +1,8 @@
1
+ *:focus {
2
+ box-shadow: var(--shadow-focus-primary);
3
+ outline: none !important;
4
+ }
5
+
1
6
  :host {
2
7
  color: var(--color-default-text);
3
8
  font-family: var(--font-family-sans);
@@ -240,6 +240,11 @@ z-searchbar {
240
240
  cursor: pointer;
241
241
  }
242
242
 
243
+ .drawer-trigger:focus-visible {
244
+ box-shadow: var(--shadow-focus-primary);
245
+ outline: none !important;
246
+ }
247
+
243
248
  .drawer-trigger z-icon {
244
249
  --z-icon-width: var(--app-header-drawer-trigger-size);
245
250
  --z-icon-height: var(--app-header-drawer-trigger-size);
@@ -64,6 +64,11 @@
64
64
  cursor: pointer;
65
65
  }
66
66
 
67
+ :host > article div.cover .ribbon.interactive:focus {
68
+ box-shadow: var(--shadow-focus-primary);
69
+ outline: none !important;
70
+ }
71
+
67
72
  :host > article div.cover .ribbon span {
68
73
  overflow: hidden;
69
74
  text-overflow: ellipsis;
@@ -157,6 +162,11 @@
157
162
  fill: var(--color-primary01-icon);
158
163
  }
159
164
 
165
+ :host > article ::slotted([slot="header-cta"]:focus) {
166
+ box-shadow: var(--shadow-focus-primary);
167
+ outline: none !important;
168
+ }
169
+
160
170
  /* EXPANDED STYLES */
161
171
 
162
172
  :host > article.expanded {
@@ -23,6 +23,11 @@ respecting the grid indications of the design. */
23
23
  box-sizing: border-box;
24
24
  }
25
25
 
26
+ *:focus {
27
+ box-shadow: var(--shadow-focus-primary);
28
+ outline: none !important;
29
+ }
30
+
26
31
  :host(:not([variant="overlay"])) .cover-container {
27
32
  position: relative;
28
33
  width: 100%;
@@ -112,6 +117,11 @@ Unfortunately the `aspect-ratio` property is still experimental */
112
117
  text-decoration: none;
113
118
  }
114
119
 
120
+ ::slotted([slot="title"]:focus) {
121
+ box-shadow: var(--shadow-focus-primary);
122
+ outline: none !important;
123
+ }
124
+
115
125
  ::slotted([slot="text"]) {
116
126
  margin: 0;
117
127
  -webkit-line-clamp: 3;
@@ -129,6 +139,11 @@ Unfortunately the `aspect-ratio` property is still experimental */
129
139
  margin-right: calc(var(--space-unit) * 2);
130
140
  }
131
141
 
142
+ ::slotted([slot="action"]:focus) {
143
+ box-shadow: var(--shadow-focus-primary);
144
+ outline: none !important;
145
+ }
146
+
132
147
  :host([clickable]) ::slotted([slot="title"]:focus:focus-visible)::before {
133
148
  box-shadow: var(--shadow-focus-primary);
134
149
  }
@@ -104,9 +104,16 @@
104
104
  }
105
105
 
106
106
  /* focus */
107
- .radio-wrapper > input:focus:focus-visible + .radio-label > z-icon,
107
+ .radio-wrapper > input:focus:focus-visible + .radio-label > z-icon {
108
+ border-radius: 50%;
109
+ }
110
+
108
111
  .checkbox-wrapper > input:focus:focus-visible + .checkbox-label > z-icon {
109
112
  border-radius: var(--border-radius-small);
113
+ }
114
+
115
+ .radio-wrapper > input:focus:focus-visible + .radio-label > z-icon,
116
+ .checkbox-wrapper > input:focus:focus-visible + .checkbox-label > z-icon {
110
117
  box-shadow: var(--shadow-focus-primary);
111
118
  }
112
119
 
@@ -44,7 +44,7 @@ textarea,
44
44
 
45
45
  /* FOCUS */
46
46
  :host:not(.active-select) input:focus:focus-visible,
47
- :host([readonly="false"]) .textarea-wrapper:focus-within {
47
+ :host:not([readonly="true"]) .textarea-wrapper:focus-within {
48
48
  box-shadow: var(--shadow-focus-primary);
49
49
  }
50
50
 
@@ -74,6 +74,11 @@
74
74
  --z-icon-height: 16px;
75
75
  }
76
76
 
77
+ .text-wrapper .icons-wrapper > button.icon-button:focus {
78
+ box-shadow: var(--shadow-focus-primary);
79
+ outline: none !important;
80
+ }
81
+
77
82
  /* stylelint-disable property-no-vendor-prefix */
78
83
  .text-wrapper > div > input:-webkit-autofill {
79
84
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
@@ -1,6 +1,7 @@
1
1
  import { h } from "@stencil/core";
2
2
  import dialogPolyfill from "dialog-polyfill";
3
3
  import { KeyboardCode } from "../../beans";
4
+ import { mobileBreakpoint } from "../../constants/breakpoints";
4
5
  const FOCUSABLE_ELEMENTS_SELECTOR = ':is(button, input, select, textarea, [contenteditable=""], [contenteditable="true"], a[href], [tabindex], summary):not([disabled], [disabled=""], [tabindex="-1"], [aria-hidden="true"], [hidden])';
5
6
  /**
6
7
  * @slot modalCloseButton - accept custom close button
@@ -29,6 +30,10 @@ export class ZModal {
29
30
  this.modalBackgroundClick.emit({ modalid: this.modalid });
30
31
  }
31
32
  }
33
+ handlePageOverflow() {
34
+ const mobileMediaQuery = window.matchMedia(`(max-width: ${mobileBreakpoint}px)`);
35
+ document.body.style["overflow-y"] = mobileMediaQuery.matches ? "hidden" : "";
36
+ }
32
37
  componentDidLoad() {
33
38
  if (typeof window.HTMLDialogElement !== "function") {
34
39
  /* workaround to fix `registerDialog` in test environment:
@@ -43,6 +48,7 @@ export class ZModal {
43
48
  else {
44
49
  this.open();
45
50
  }
51
+ this.handlePageOverflow();
46
52
  }
47
53
  /** open modal */
48
54
  async open() {
@@ -70,6 +76,9 @@ export class ZModal {
70
76
  ].filter((element) => getComputedStyle(element).display !== "none");
71
77
  }
72
78
  handleKeyDown(e) {
79
+ if (e.code === KeyboardCode.ESC && !this.closable) {
80
+ e.preventDefault();
81
+ }
73
82
  if (e.code !== KeyboardCode.TAB) {
74
83
  return;
75
84
  }
@@ -101,16 +110,16 @@ export class ZModal {
101
110
  e.preventDefault();
102
111
  }
103
112
  render() {
104
- return (h("dialog", { key: '502c0fd42f37a498ef3ec2b2b174ac4950287883', class: {
113
+ return (h("dialog", { key: '50df4e07a74c86679fd2243e6795da0eeaae9c2c', class: {
105
114
  "modal-dialog": !this.scrollInside,
106
- }, "aria-labelledby": "modal-title", "aria-describedby": "modal-content", role: this.alertdialog ? "alertdialog" : undefined, ref: (el) => (this.dialog = el), onClose: () => this.emitModalClose(), onCancel: (e) => this.handleEscape(e) }, h("div", { key: '0dd9496ca11660307bcb8d751e8793659aa30741', class: {
115
+ }, "aria-labelledby": "modal-title", "aria-describedby": "modal-content", role: this.alertdialog ? "alertdialog" : undefined, ref: (el) => (this.dialog = el), onClose: () => this.emitModalClose(), onCancel: (e) => this.handleEscape(e) }, h("div", { key: '035ad0b71a6726e43c1fb52dae69257afd054525', class: {
107
116
  "modal-container": true,
108
117
  "modal-container-scroll-inside": this.scrollInside,
109
118
  "modal-container-scroll-outside": !this.scrollInside,
110
- }, id: this.modalid }, h("header", { key: '6952365a4a1d64e1ce23a9454f11cd4ae76e37ca', onClick: this.emitModalHeaderActive.bind(this) }, h("div", { key: 'fe219a40167ad9984255885bb189d9a9a0509cd5' }, this.modaltitle && h("h1", { key: '2991d4e6c254160dfe33e3558dc5db4d4dbf0abf', id: "modal-title" }, this.modaltitle), this.closeButtonSlot()), this.modalsubtitle && (h("div", { key: '5a612bc3eb027b488a37918794c4f24e1991a38d', class: "subtitle", id: "modal-subtitle" }, this.modalsubtitle))), h("div", { key: '34008ade3d0f05c701b4d94df647086a8de3cd27', class: {
119
+ }, id: this.modalid }, h("header", { key: '8f9e92a6c41e4dbff647c4140a1efc42adf258a9', onClick: this.emitModalHeaderActive.bind(this) }, h("div", { key: '3521275e24a100ba06c2f259ef239a361a6841e5' }, this.modaltitle && h("h1", { key: '3c345754f355fbe4cb7c0515404b01a3ff647b26', id: "modal-title" }, this.modaltitle), this.closeButtonSlot()), this.modalsubtitle && (h("div", { key: '5307334b7aca04ae351a0a69cbdaa6ec0ee32654', class: "subtitle", id: "modal-subtitle" }, this.modalsubtitle))), h("div", { key: 'fe5a158f3a0f0d6a06e83ce4cf32fb50ea5bf79f', class: {
111
120
  "modal-content-scroll-inside": this.scrollInside,
112
121
  "modal-content-scroll-outside": !this.scrollInside,
113
- }, id: "modal-content" }, h("slot", { key: '7ce631a687090f9b69bafa8de5dbe76d21d2c554', name: "modalContent" }))), h("div", { key: '8fc40e271bec8219fbbbf208bbba900a74ebdec8', class: {
122
+ }, id: "modal-content" }, h("slot", { key: 'c2e5855dc48026fda519ad69bf5a7f9c3c1a2773', name: "modalContent" }))), h("div", { key: 'd7f80d8206c262bf5166ee1231d78eb0e55e4bb5', class: {
114
123
  "modal-background": true,
115
124
  "modal-background-scroll-outside": !this.scrollInside,
116
125
  }, "data-action": "modalBackground", "data-modal": this.modalid, onClick: () => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/z-modal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAC/F,OAAO,cAAc,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAEzC,MAAM,2BAA2B,GAC/B,oMAAoM,CAAC;AAEvM;;;GAGG;AAMH,MAAM,OAAO,MAAM;;;;;gCAeE,eAAe;2BAIV,KAAK;wBAIR,IAAI;4BAIA,IAAI;;IAUrB,cAAc;QACpB,IAAI,IAAI,CAAC,QAAQ,EAAE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I,CAAC,eAAe,EAAE,CACnB;oBACL,IAAI,CAAC,aAAa,IAAI,CACrB,4DACE,KAAK,EAAC,UAAU,EAChB,EAAE,EAAC,gBAAgB,IAElB,IAAI,CAAC,aAAa,CACf,CACP,CACM;gBAET,4DACE,KAAK,EAAE;wBACL,6BAA6B,EAAE,IAAI,CAAC,YAAY;wBAChD,8BAA8B,EAAE,CAAC,IAAI,CAAC,YAAY;qBACnD,EACD,EAAE,EAAC,eAAe;oBAElB,6DAAM,IAAI,EAAC,cAAc,GAAQ,CAC7B,CACF;YACN,4DACE,KAAK,EAAE;oBACL,kBAAkB,EAAE,IAAI;oBACxB,iCAAiC,EAAE,CAAC,IAAI,CAAC,YAAY;iBACtD,iBACW,iBAAiB,gBACjB,IAAI,CAAC,OAAO,EACxB,OAAO,EAAE,GAAG,EAAE;oBACZ,IAAI,CAAC,mBAAmB,EAAE,CAAC;oBAC3B,IAAI,CAAC,KAAK,EAAE,CAAC;gBACf,CAAC,GACI,CACA,CACV,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Event, EventEmitter, Listen, Method, Prop, h} from \"@stencil/core\";\nimport dialogPolyfill from \"dialog-polyfill\";\nimport {KeyboardCode} from \"../../beans\";\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 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\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.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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/z-modal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAC/F,OAAO,cAAc,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AACzC,OAAO,EAAC,gBAAgB,EAAC,MAAM,6BAA6B,CAAC;AAE7D,MAAM,2BAA2B,GAC/B,oMAAoM,CAAC;AAEvM;;;GAGG;AAMH,MAAM,OAAO,MAAM;;;;;gCAeE,eAAe;2BAIV,KAAK;wBAIR,IAAI;4BAIA,IAAI;;IAUrB,cAAc;QACpB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
@@ -1,3 +1,9 @@
1
+ *:focus {
2
+ border-radius: 50%;
3
+ box-shadow: var(--shadow-focus-primary);
4
+ outline: none !important;
5
+ }
6
+
1
7
  :host {
2
8
  font-family: var(--font-family-sans);
3
9
  font-weight: var(--font-rg);
@@ -49,7 +55,8 @@
49
55
  }
50
56
 
51
57
  .modal-container > header {
52
- padding: calc(var(--space-unit) * 2 - 2px) calc(var(--space-unit) * 2);
58
+ padding: calc(var(--space-unit) * 1.75) calc(var(--space-unit) * 2) calc(var(--space-unit) * 1.75)
59
+ calc(var(--space-unit) * 2);
53
60
  background: var(--color-surface02);
54
61
  }
55
62
 
@@ -63,8 +70,8 @@
63
70
  }
64
71
 
65
72
  .modal-container > header z-icon {
66
- --z-icon-width: calc(var(--space-unit) * 2.5);
67
- --z-icon-height: calc(var(--space-unit) * 2.5);
73
+ --z-icon-width: calc(var(--space-unit) * 2.25);
74
+ --z-icon-height: calc(var(--space-unit) * 2.25);
68
75
 
69
76
  display: flex;
70
77
  fill: var(--color-primary01-icon);
@@ -73,7 +80,7 @@
73
80
  .modal-container > header > div {
74
81
  display: flex;
75
82
  width: 100%;
76
- align-items: center;
83
+ align-items: baseline;
77
84
  margin-right: calc(var(--space-unit) * 2);
78
85
  }
79
86
 
@@ -82,7 +89,7 @@
82
89
  padding: 0;
83
90
  margin: 0;
84
91
  color: var(--color-default-text);
85
- font-weight: var(--font-rg);
92
+ font-weight: var(--font-sb);
86
93
  }
87
94
 
88
95
  .modal-container > header h1 {
@@ -93,6 +100,7 @@
93
100
 
94
101
  .modal-container > header .subtitle {
95
102
  font-size: var(--font-size-3);
103
+ font-weight: var(--font-rg);
96
104
  letter-spacing: 0;
97
105
  line-height: 1.5;
98
106
  }
@@ -213,34 +221,25 @@
213
221
  .modal-dialog::-webkit-scrollbar {
214
222
  display: none;
215
223
  }
216
-
217
- .modal-container > header z-icon {
218
- --z-icon-width: calc(var(--space-unit) * 3);
219
- --z-icon-height: calc(var(--space-unit) * 3);
220
- }
221
- }
222
-
223
- /* Tablet */
224
- @media only screen and (min-width: 768px) and (max-width: 1151px) {
225
- .modal-container > header {
226
- padding: calc(var(--space-unit) * 3 - 2px) calc(var(--space-unit) * 3);
227
- }
228
224
  }
229
225
 
230
226
  /* Desktop */
231
227
  @media only screen and (min-width: 1152px) {
232
228
  .modal-container > header {
233
- padding: calc(var(--space-unit) * 4 - 4px) calc(var(--space-unit) * 4);
229
+ padding-top: calc(var(--space-unit) * 1.5);
230
+ padding-bottom: calc(var(--space-unit) * 1.5);
234
231
  }
235
232
 
236
233
  .modal-container > header h1 {
237
234
  font-size: var(--font-size-6);
235
+ font-weight: var(--font-sb);
238
236
  letter-spacing: 0;
239
- line-height: 1.33;
237
+ line-height: 1.333;
240
238
  }
241
239
 
242
240
  .modal-container > header .subtitle {
243
241
  font-size: var(--font-size-4);
242
+ font-weight: var(--font-rg);
244
243
  letter-spacing: 0;
245
244
  line-height: 1.5;
246
245
  }
@@ -134,7 +134,7 @@ z-navigation-tabs > nav > a {
134
134
 
135
135
  z-navigation-tabs > nav > *:focus:focus-visible {
136
136
  z-index: 1;
137
- box-shadow: inset 0 0 4px 3px var(--color-highlight);
137
+ box-shadow: inset 0 0 4px 3px var(--blue800);
138
138
  }
139
139
 
140
140
  z-navigation-tabs > nav > :not([disabled]):hover {
@@ -94,6 +94,11 @@
94
94
  line-height: 16px;
95
95
  }
96
96
 
97
+ .action-button:focus {
98
+ box-shadow: var(--shadow-focus-primary);
99
+ outline: none !important;
100
+ }
101
+
97
102
  .content-container + .close-button {
98
103
  margin-left: calc(var(--space-unit) * 2);
99
104
  }
@@ -103,7 +108,7 @@
103
108
  }
104
109
 
105
110
  /* Tablet breakpoint */
106
- @media and (min-width: 768px) {
111
+ @media only screen and (min-width: 768px) {
107
112
  .content-container {
108
113
  flex-wrap: nowrap;
109
114
  }
@@ -14,6 +14,11 @@
14
14
  box-sizing: border-box;
15
15
  }
16
16
 
17
+ *:focus {
18
+ box-shadow: var(--shadow-focus-primary);
19
+ outline: none !important;
20
+ }
21
+
17
22
  .input-container {
18
23
  position: relative;
19
24
  display: flex;
@@ -1,10 +1,10 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  /**
3
- * @slot - slot for `z-stepper-item`s
3
+ * @slot - slot for `z-stepper-item`
4
4
  */
5
5
  export class ZStepper {
6
6
  render() {
7
- return (h(Host, { key: 'c1069a6d199240aa1e8eb9fe30be9a75b2dabecb', role: "list" }, h("slot", { key: '283f1f42d5f73259b7c04e965bf592e4ba543fc8' })));
7
+ return (h(Host, { key: '80b89caa35e9adb82ad413783b16eae491a26f48', role: "list" }, h("slot", { key: '140e35a55637873b1eee70d5a7a8c2b03af3eed7' })));
8
8
  }
9
9
  static get is() { return "z-stepper"; }
10
10
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/z-stepper/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAEjD;;GAEG;AAMH,MAAM,OAAO,QAAQ;IACnB,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,IAAI,EAAC,MAAM;YACf,8DAAQ,CACH,CACR,CAAC;IACJ,CAAC;;;;;;;;;CACF","sourcesContent":["import {Component, Host, h} from \"@stencil/core\";\n\n/**\n * @slot - slot for `z-stepper-item`s\n */\n@Component({\n tag: \"z-stepper\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZStepper {\n render(): HTMLSlotElement {\n return (\n <Host role=\"list\">\n <slot />\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/z-stepper/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAEjD;;GAEG;AAMH,MAAM,OAAO,QAAQ;IACnB,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,IAAI,EAAC,MAAM;YACf,8DAAQ,CACH,CACR,CAAC;IACJ,CAAC;;;;;;;;;CACF","sourcesContent":["import {Component, Host, h} from \"@stencil/core\";\n\n/**\n * @slot - slot for `z-stepper-item`\n */\n@Component({\n tag: \"z-stepper\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZStepper {\n render(): HTMLSlotElement {\n return (\n <Host role=\"list\">\n <slot />\n </Host>\n );\n }\n}\n"]}