@zanichelli/albe-web-components 3.2.2 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/CHANGELOG.md +1692 -0
  2. package/dist/cjs/{index-b1289f95.js → index-6b6a3299.js} +27 -29
  3. package/dist/cjs/index.cjs.js +2 -2
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/{utils-33df2456.js → utils-8cc414c9.js} +28 -2
  6. package/dist/cjs/web-components-library.cjs.js +1 -1
  7. package/dist/cjs/z-app-switcher_12.cjs.entry.js +1 -1
  8. package/dist/cjs/z-aria-alert.cjs.entry.js +1 -1
  9. package/dist/cjs/z-avatar.cjs.entry.js +1 -1
  10. package/dist/cjs/z-button-filter.cjs.entry.js +49 -0
  11. package/dist/cjs/z-chip.cjs.entry.js +2 -2
  12. package/dist/cjs/z-combobox.cjs.entry.js +5 -5
  13. package/dist/cjs/z-contextual-menu.cjs.entry.js +1 -1
  14. package/dist/cjs/z-cookiebar.cjs.entry.js +1 -1
  15. package/dist/cjs/z-date-picker.cjs.entry.js +2 -2
  16. package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +0 -1
  17. package/dist/cjs/z-file-upload.cjs.entry.js +2 -2
  18. package/dist/cjs/z-file.cjs.entry.js +1 -2
  19. package/dist/cjs/z-footer.cjs.entry.js +1 -1
  20. package/dist/cjs/z-input-deprecated.cjs.entry.js +271 -0
  21. package/dist/cjs/z-input-label_2.cjs.entry.js +272 -0
  22. package/dist/cjs/z-input_2.cjs.entry.js +228 -0
  23. package/dist/cjs/z-list-group.cjs.entry.js +54 -0
  24. package/dist/cjs/{z-list_3.cjs.entry.js → z-list_2.cjs.entry.js} +5 -52
  25. package/dist/cjs/z-menu-dropdown_2.cjs.entry.js +4 -4
  26. package/dist/cjs/z-messages-pocket.cjs.entry.js +1 -1
  27. package/dist/cjs/z-modal-login.cjs.entry.js +1 -1
  28. package/dist/cjs/z-myz-card-alert.cjs.entry.js +1 -1
  29. package/dist/cjs/z-myz-card-dictionary.cjs.entry.js +1 -1
  30. package/dist/cjs/z-myz-card-footer.cjs.entry.js +1 -1
  31. package/dist/cjs/z-myz-card-info.cjs.entry.js +2 -2
  32. package/dist/cjs/z-myz-card_4.cjs.entry.js +1 -1
  33. package/dist/cjs/z-myz-list-item.cjs.entry.js +2 -2
  34. package/dist/cjs/z-myz-topbar.cjs.entry.js +1 -1
  35. package/dist/cjs/z-navigation-tab-link.cjs.entry.js +1 -1
  36. package/dist/cjs/z-navigation-tab.cjs.entry.js +1 -1
  37. package/dist/cjs/z-navigation-tabs.cjs.entry.js +1 -1
  38. package/dist/cjs/z-otp.cjs.entry.js +1 -1
  39. package/dist/cjs/z-pagination-bar.cjs.entry.js +2 -2
  40. package/dist/cjs/z-pagination.cjs.entry.js +2 -2
  41. package/dist/cjs/z-pocket_3.cjs.entry.js +2 -2
  42. package/dist/cjs/z-popover.cjs.entry.js +2 -2
  43. package/dist/cjs/z-section-title.cjs.entry.js +1 -1
  44. package/dist/cjs/z-skip-to-content.cjs.entry.js +2 -2
  45. package/dist/cjs/z-slideshow.cjs.entry.js +2 -2
  46. package/dist/cjs/z-status-tag.cjs.entry.js +1 -1
  47. package/dist/cjs/z-table-cell.cjs.entry.js +1 -1
  48. package/dist/cjs/z-table-header.cjs.entry.js +2 -2
  49. package/dist/cjs/z-table-row.cjs.entry.js +1 -1
  50. package/dist/cjs/z-table.cjs.entry.js +1 -1
  51. package/dist/cjs/z-toast-notification-list.cjs.entry.js +1 -1
  52. package/dist/cjs/z-toast-notification.cjs.entry.js +1 -1
  53. package/dist/cjs/z-toggle-switch.cjs.entry.js +3 -3
  54. package/dist/cjs/z-tooltip.cjs.entry.js +1 -1
  55. package/dist/collection/beans/index.js +27 -29
  56. package/dist/collection/collection-manifest.json +2 -1
  57. package/dist/collection/components/buttons/z-toggle-switch/index.js +6 -6
  58. package/dist/collection/components/file-upload/z-dragdrop-area/index.js +0 -1
  59. package/dist/collection/components/file-upload/z-file/index.js +0 -1
  60. package/dist/collection/components/inputs/z-combobox/index.js +4 -4
  61. package/dist/collection/components/inputs/z-input/index.js +58 -234
  62. package/dist/collection/components/inputs/z-input/styles.css +61 -34
  63. package/dist/collection/components/inputs/z-input-message/index.js +1 -1
  64. package/dist/collection/components/inputs/z-select/index.js +69 -134
  65. package/dist/collection/components/inputs/z-select/styles.css +16 -58
  66. package/dist/collection/components/modal/z-modal-login/index.js +1 -1
  67. package/dist/collection/components/navigation/z-menu-dropdown/index.js +4 -4
  68. package/dist/collection/components/z-date-picker/index.js +1 -1
  69. package/dist/collection/components/z-pagination/index.js +2 -2
  70. package/dist/collection/deprecated/z-input-deprecated/index.js +824 -0
  71. package/dist/collection/deprecated/z-input-deprecated/styles.css +296 -0
  72. package/dist/collection/{components/inputs → deprecated}/z-input-label/index.js +0 -0
  73. package/dist/collection/{components/inputs → deprecated}/z-input-label/styles.css +0 -0
  74. package/dist/collection/snowflakes/myz/z-otp/index.js +1 -1
  75. package/dist/collection/utils/utils.js +27 -2
  76. package/dist/esm/{index-7424c64c.js → index-46ca649a.js} +28 -30
  77. package/dist/esm/index.js +2 -2
  78. package/dist/esm/loader.js +1 -1
  79. package/dist/esm/{utils-93d2b922.js → utils-5d5963ef.js} +28 -3
  80. package/dist/esm/web-components-library.js +1 -1
  81. package/dist/esm/z-app-switcher_12.entry.js +1 -1
  82. package/dist/esm/z-aria-alert.entry.js +1 -1
  83. package/dist/esm/z-avatar.entry.js +1 -1
  84. package/dist/esm/z-button-filter.entry.js +45 -0
  85. package/dist/esm/z-chip.entry.js +2 -2
  86. package/dist/esm/z-combobox.entry.js +5 -5
  87. package/dist/esm/z-contextual-menu.entry.js +1 -1
  88. package/dist/esm/z-cookiebar.entry.js +1 -1
  89. package/dist/esm/z-date-picker.entry.js +2 -2
  90. package/dist/esm/z-dragdrop-area_2.entry.js +0 -1
  91. package/dist/esm/z-file-upload.entry.js +2 -2
  92. package/dist/esm/z-file.entry.js +1 -2
  93. package/dist/esm/z-footer.entry.js +1 -1
  94. package/dist/esm/z-input-deprecated.entry.js +267 -0
  95. package/dist/esm/z-input-label_2.entry.js +267 -0
  96. package/dist/esm/z-input_2.entry.js +223 -0
  97. package/dist/esm/z-list-group.entry.js +50 -0
  98. package/dist/esm/z-list_2.entry.js +174 -0
  99. package/dist/esm/z-menu-dropdown_2.entry.js +4 -4
  100. package/dist/esm/z-messages-pocket.entry.js +1 -1
  101. package/dist/esm/z-modal-login.entry.js +1 -1
  102. package/dist/esm/z-myz-card-alert.entry.js +1 -1
  103. package/dist/esm/z-myz-card-dictionary.entry.js +1 -1
  104. package/dist/esm/z-myz-card-footer.entry.js +1 -1
  105. package/dist/esm/z-myz-card-info.entry.js +2 -2
  106. package/dist/esm/z-myz-card_4.entry.js +1 -1
  107. package/dist/esm/z-myz-list-item.entry.js +2 -2
  108. package/dist/esm/z-myz-topbar.entry.js +1 -1
  109. package/dist/esm/z-navigation-tab-link.entry.js +1 -1
  110. package/dist/esm/z-navigation-tab.entry.js +1 -1
  111. package/dist/esm/z-navigation-tabs.entry.js +1 -1
  112. package/dist/esm/z-otp.entry.js +1 -1
  113. package/dist/esm/z-pagination-bar.entry.js +2 -2
  114. package/dist/esm/z-pagination.entry.js +2 -2
  115. package/dist/esm/z-pocket_3.entry.js +2 -2
  116. package/dist/esm/z-popover.entry.js +2 -2
  117. package/dist/esm/z-section-title.entry.js +1 -1
  118. package/dist/esm/z-skip-to-content.entry.js +2 -2
  119. package/dist/esm/z-slideshow.entry.js +2 -2
  120. package/dist/esm/z-status-tag.entry.js +1 -1
  121. package/dist/esm/z-table-cell.entry.js +1 -1
  122. package/dist/esm/z-table-header.entry.js +2 -2
  123. package/dist/esm/z-table-row.entry.js +1 -1
  124. package/dist/esm/z-table.entry.js +1 -1
  125. package/dist/esm/z-toast-notification-list.entry.js +1 -1
  126. package/dist/esm/z-toast-notification.entry.js +1 -1
  127. package/dist/esm/z-toggle-switch.entry.js +3 -3
  128. package/dist/esm/z-tooltip.entry.js +1 -1
  129. package/dist/types/beans/index.d.ts +6 -7
  130. package/dist/types/components/buttons/z-toggle-switch/index.d.ts +2 -2
  131. package/dist/types/components/inputs/z-input/index.d.ts +16 -29
  132. package/dist/types/components/inputs/z-select/index.d.ts +11 -17
  133. package/dist/types/components.d.ts +191 -30
  134. package/dist/types/deprecated/z-input-deprecated/index.d.ts +102 -0
  135. package/dist/types/{components/inputs → deprecated}/z-input-label/index.d.ts +0 -0
  136. package/dist/types/utils/utils.d.ts +5 -0
  137. package/dist/web-components-library/index.esm.js +1 -1
  138. package/{www/build/p-e9b90127.entry.js → dist/web-components-library/p-02ea7e49.entry.js} +1 -1
  139. package/dist/web-components-library/{p-21b9a94f.entry.js → p-08fa0a33.entry.js} +1 -1
  140. package/{www/build/p-e4b4b2e4.entry.js → dist/web-components-library/p-0a0aee35.entry.js} +1 -1
  141. package/dist/web-components-library/{p-2e510e79.entry.js → p-0d29d851.entry.js} +1 -1
  142. package/dist/web-components-library/{p-b0ea8c0e.entry.js → p-0ef6c549.entry.js} +1 -1
  143. package/dist/web-components-library/{p-4c282f06.entry.js → p-0f17db30.entry.js} +1 -1
  144. package/dist/web-components-library/{p-a391566a.entry.js → p-12af8652.entry.js} +1 -1
  145. package/dist/web-components-library/{p-3184d969.entry.js → p-1727c1c8.entry.js} +1 -1
  146. package/dist/web-components-library/{p-e7aadd3d.entry.js → p-20d62443.entry.js} +1 -1
  147. package/dist/web-components-library/{p-cd2ca92b.entry.js → p-3252be36.entry.js} +1 -1
  148. package/dist/web-components-library/{p-1b973c72.entry.js → p-3c111c2a.entry.js} +1 -1
  149. package/dist/web-components-library/{p-9721e132.entry.js → p-43329b81.entry.js} +1 -1
  150. package/dist/web-components-library/{p-9935973a.entry.js → p-4af112a7.entry.js} +1 -1
  151. package/dist/web-components-library/{p-03de95f1.entry.js → p-51cdabeb.entry.js} +1 -1
  152. package/dist/web-components-library/p-562e2d52.entry.js +1 -0
  153. package/dist/web-components-library/{p-709ab23c.entry.js → p-57d1acdc.entry.js} +1 -1
  154. package/dist/web-components-library/{p-0398165f.entry.js → p-5be162d5.entry.js} +1 -1
  155. package/{www/build/p-7e71d9b0.entry.js → dist/web-components-library/p-5eacbfc7.entry.js} +1 -1
  156. package/dist/web-components-library/{p-223bec2f.entry.js → p-63ccb013.entry.js} +1 -1
  157. package/dist/web-components-library/p-69ef6ddc.entry.js +1 -0
  158. package/dist/web-components-library/p-71accd8e.entry.js +1 -0
  159. package/dist/web-components-library/{p-56437e20.entry.js → p-7c6d4440.entry.js} +1 -1
  160. package/dist/web-components-library/p-99d7ab2f.entry.js +1 -0
  161. package/dist/web-components-library/{p-2ff952a3.entry.js → p-9aa5d36c.entry.js} +1 -1
  162. package/dist/web-components-library/p-9f5d707a.js +1 -0
  163. package/dist/web-components-library/{p-2711bc32.entry.js → p-9f9e4266.entry.js} +1 -1
  164. package/dist/web-components-library/{p-cce20009.entry.js → p-a851af81.entry.js} +1 -1
  165. package/dist/web-components-library/{p-d9d9d834.entry.js → p-a8875b97.entry.js} +2 -2
  166. package/dist/web-components-library/{p-adad78fc.entry.js → p-ae60bbdf.entry.js} +1 -1
  167. package/dist/web-components-library/p-b574d5f6.entry.js +1 -0
  168. package/dist/web-components-library/p-b9da171f.js +1 -0
  169. package/dist/web-components-library/{p-aae632ef.entry.js → p-ba29bc12.entry.js} +1 -1
  170. package/dist/web-components-library/p-bd886dd5.entry.js +1 -0
  171. package/dist/web-components-library/{p-542b3702.entry.js → p-bfe5693d.entry.js} +1 -1
  172. package/dist/web-components-library/{p-2b8975b1.entry.js → p-c9cdf4ee.entry.js} +1 -1
  173. package/dist/web-components-library/{p-dfc18671.entry.js → p-ccdebe3f.entry.js} +1 -1
  174. package/{www/build/p-8a637cae.entry.js → dist/web-components-library/p-cd8950d2.entry.js} +1 -1
  175. package/dist/web-components-library/{p-c787ea21.entry.js → p-d33fea26.entry.js} +1 -1
  176. package/dist/web-components-library/p-d8069dab.entry.js +1 -0
  177. package/dist/web-components-library/{p-f3080685.entry.js → p-d97a2db9.entry.js} +1 -1
  178. package/dist/web-components-library/{p-1eef76bb.entry.js → p-d995d9dc.entry.js} +1 -1
  179. package/dist/web-components-library/{p-895f636e.entry.js → p-de25c7f0.entry.js} +1 -1
  180. package/dist/web-components-library/{p-66fbe5b8.entry.js → p-df4e963b.entry.js} +1 -1
  181. package/dist/web-components-library/p-e2102da3.entry.js +1 -0
  182. package/dist/web-components-library/{p-459dab30.entry.js → p-e84d6807.entry.js} +1 -1
  183. package/dist/web-components-library/p-edb8d2ab.entry.js +1 -0
  184. package/dist/web-components-library/{p-0b590426.entry.js → p-f322c5f0.entry.js} +1 -1
  185. package/dist/web-components-library/{p-da7760a3.entry.js → p-f7c3e9c3.entry.js} +1 -1
  186. package/{www/build/p-dcf4d1b6.entry.js → dist/web-components-library/p-fa925198.entry.js} +1 -1
  187. package/dist/web-components-library/{p-2c823f4c.entry.js → p-fe927bf4.entry.js} +1 -1
  188. package/dist/web-components-library/web-components-library.esm.js +1 -1
  189. package/package.json +1 -1
  190. package/react/components.d.ts +1 -0
  191. package/react/components.js +4 -3
  192. package/react/components.js.map +1 -1
  193. package/src-react/index.ts +1 -0
  194. package/www/build/index.esm.js +1 -1
  195. package/{dist/web-components-library/p-e9b90127.entry.js → www/build/p-02ea7e49.entry.js} +1 -1
  196. package/www/build/{p-21b9a94f.entry.js → p-08fa0a33.entry.js} +1 -1
  197. package/{dist/web-components-library/p-e4b4b2e4.entry.js → www/build/p-0a0aee35.entry.js} +1 -1
  198. package/www/build/{p-2e510e79.entry.js → p-0d29d851.entry.js} +1 -1
  199. package/www/build/{p-b0ea8c0e.entry.js → p-0ef6c549.entry.js} +1 -1
  200. package/www/build/{p-4c282f06.entry.js → p-0f17db30.entry.js} +1 -1
  201. package/www/build/{p-a391566a.entry.js → p-12af8652.entry.js} +1 -1
  202. package/www/build/{p-3184d969.entry.js → p-1727c1c8.entry.js} +1 -1
  203. package/www/build/{p-e7aadd3d.entry.js → p-20d62443.entry.js} +1 -1
  204. package/www/build/{p-cd2ca92b.entry.js → p-3252be36.entry.js} +1 -1
  205. package/www/build/{p-1b973c72.entry.js → p-3c111c2a.entry.js} +1 -1
  206. package/www/build/{p-9721e132.entry.js → p-43329b81.entry.js} +1 -1
  207. package/www/build/{p-9935973a.entry.js → p-4af112a7.entry.js} +1 -1
  208. package/www/build/{p-03de95f1.entry.js → p-51cdabeb.entry.js} +1 -1
  209. package/www/build/p-562e2d52.entry.js +1 -0
  210. package/www/build/{p-709ab23c.entry.js → p-57d1acdc.entry.js} +1 -1
  211. package/www/build/{p-0398165f.entry.js → p-5be162d5.entry.js} +1 -1
  212. package/{dist/web-components-library/p-7e71d9b0.entry.js → www/build/p-5eacbfc7.entry.js} +1 -1
  213. package/www/build/{p-223bec2f.entry.js → p-63ccb013.entry.js} +1 -1
  214. package/www/build/p-69ef6ddc.entry.js +1 -0
  215. package/www/build/p-71accd8e.entry.js +1 -0
  216. package/www/build/{p-56437e20.entry.js → p-7c6d4440.entry.js} +1 -1
  217. package/www/build/p-99d7ab2f.entry.js +1 -0
  218. package/www/build/{p-2ff952a3.entry.js → p-9aa5d36c.entry.js} +1 -1
  219. package/www/build/p-9f5d707a.js +1 -0
  220. package/www/build/{p-2711bc32.entry.js → p-9f9e4266.entry.js} +1 -1
  221. package/www/build/{p-cce20009.entry.js → p-a851af81.entry.js} +1 -1
  222. package/www/build/{p-d9d9d834.entry.js → p-a8875b97.entry.js} +2 -2
  223. package/www/build/{p-adad78fc.entry.js → p-ae60bbdf.entry.js} +1 -1
  224. package/www/build/p-b574d5f6.entry.js +1 -0
  225. package/www/build/p-b9da171f.js +1 -0
  226. package/www/build/{p-aae632ef.entry.js → p-ba29bc12.entry.js} +1 -1
  227. package/www/build/p-bd886dd5.entry.js +1 -0
  228. package/www/build/{p-542b3702.entry.js → p-bfe5693d.entry.js} +1 -1
  229. package/www/build/{p-2b8975b1.entry.js → p-c9cdf4ee.entry.js} +1 -1
  230. package/www/build/{p-dfc18671.entry.js → p-ccdebe3f.entry.js} +1 -1
  231. package/{dist/web-components-library/p-8a637cae.entry.js → www/build/p-cd8950d2.entry.js} +1 -1
  232. package/www/build/{p-c787ea21.entry.js → p-d33fea26.entry.js} +1 -1
  233. package/www/build/p-d8069dab.entry.js +1 -0
  234. package/www/build/{p-f3080685.entry.js → p-d97a2db9.entry.js} +1 -1
  235. package/www/build/{p-1eef76bb.entry.js → p-d995d9dc.entry.js} +1 -1
  236. package/www/build/{p-895f636e.entry.js → p-de25c7f0.entry.js} +1 -1
  237. package/www/build/{p-66fbe5b8.entry.js → p-df4e963b.entry.js} +1 -1
  238. package/www/build/p-e2102da3.entry.js +1 -0
  239. package/www/build/p-e76afdbc.js +1 -0
  240. package/www/build/{p-459dab30.entry.js → p-e84d6807.entry.js} +1 -1
  241. package/www/build/p-edb8d2ab.entry.js +1 -0
  242. package/www/build/{p-0b590426.entry.js → p-f322c5f0.entry.js} +1 -1
  243. package/www/build/{p-da7760a3.entry.js → p-f7c3e9c3.entry.js} +1 -1
  244. package/{dist/web-components-library/p-dcf4d1b6.entry.js → www/build/p-fa925198.entry.js} +1 -1
  245. package/www/build/{p-2c823f4c.entry.js → p-fe927bf4.entry.js} +1 -1
  246. package/www/build/web-components-library.esm.js +1 -1
  247. package/www/index.html +1 -1
  248. package/dist/cjs/z-button-filter_5.cjs.entry.js +0 -620
  249. package/dist/esm/z-button-filter_5.entry.js +0 -612
  250. package/dist/esm/z-list_3.entry.js +0 -220
  251. package/dist/web-components-library/p-14c9344f.entry.js +0 -1
  252. package/dist/web-components-library/p-57270965.entry.js +0 -1
  253. package/dist/web-components-library/p-70be81b6.entry.js +0 -1
  254. package/dist/web-components-library/p-80369bb8.entry.js +0 -1
  255. package/dist/web-components-library/p-80a3e18a.js +0 -1
  256. package/dist/web-components-library/p-a785ff38.entry.js +0 -1
  257. package/dist/web-components-library/p-fea5b98f.js +0 -1
  258. package/www/build/p-14c9344f.entry.js +0 -1
  259. package/www/build/p-57270965.entry.js +0 -1
  260. package/www/build/p-70be81b6.entry.js +0 -1
  261. package/www/build/p-80369bb8.entry.js +0 -1
  262. package/www/build/p-80a3e18a.js +0 -1
  263. package/www/build/p-a785ff38.entry.js +0 -1
  264. package/www/build/p-b058084c.js +0 -1
  265. package/www/build/p-fea5b98f.js +0 -1
@@ -0,0 +1,267 @@
1
+ import { r as registerInstance, h, c as createEvent, g as getElement } from './index-90e18641.js';
2
+ import { K as KeyboardCodeEnum, v as ListDividerType } from './index-46ca649a.js';
3
+ import { r as randomId, d as boolean, a as getElementTree, h as handleKeyboardSubmit, e as getClickedElement } from './utils-5d5963ef.js';
4
+ import './breakpoints-c386984e.js';
5
+
6
+ const stylesCss$1 = "label{display:block;margin:var(--space-unit) 0;color:var(--color-text02);font-family:var(--font-family-sans);font-size:var(--font-size-1);font-weight:var(--font-sb);line-height:1.33;letter-spacing:0.32px;text-transform:uppercase;text-align:left}label.disabled{color:var(--color-disabled02)}";
7
+
8
+ const ZInputLabel = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ /** the label is disabled */
12
+ this.disabled = false;
13
+ }
14
+ render() {
15
+ return h("label", { htmlFor: this.htmlfor, class: { disabled: this.disabled } }, this.value);
16
+ }
17
+ };
18
+ ZInputLabel.style = stylesCss$1;
19
+
20
+ const stylesCss = ".sc-z-select-h{display:inline-block;width:inherit;font-family:var(--font-family-sans);font-weight:var(--font-rg);font-size:var(--font-size-3);color:var(--color-text02)}.selectWrapper.sc-z-select>z-input.sc-z-select{width:100%}.selectWrapper.sc-z-select>div.sc-z-select{position:relative}.selectWrapper.sc-z-select>div.closed.sc-z-select{height:0;overflow:hidden}.selectWrapper.sc-z-select .ulScrollWrapper.sc-z-select{background:var(--color-surface01);position:absolute;padding:calc(var(--space-unit) * 0.5) var(--space-unit);border:var(--border-size-small) solid var(--gray200);border-top:none;width:100%;box-sizing:border-box;outline:none}.selectWrapper.sc-z-select .closed.sc-z-select .ulScrollWrapper.sc-z-select{z-index:10}.selectWrapper.sc-z-select .open.sc-z-select .ulScrollWrapper.sc-z-select{z-index:20}.selectWrapper.sc-z-select .ulScrollWrapper.sc-z-select>z-list.sc-z-select{position:relative;padding:calc(var(--space-unit) * 0.5);max-height:240px;overflow:auto;outline:none;scrollbar-color:var(--color-primary01) transparent}.selectWrapper.sc-z-select .ulScrollWrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar{background:linear-gradient(\n to right,\n transparent 0 3px,\n var(--gray200) 3px 7px,\n transparent 7px 10px\n );width:10px;border-radius:var(--border-radius)}.selectWrapper.sc-z-select .ulScrollWrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-track{background-color:transparent}.selectWrapper.sc-z-select .ulScrollWrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}.selectWrapper.sc-z-select .ulScrollWrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.selectWrapper.sc-z-select .ulScrollWrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select span.sc-z-select{display:block;padding:0 calc(var(--space-unit) * 1.5)}.selectWrapper.sc-z-select .ulScrollWrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select span.selected.sc-z-select{font-weight:bold}.selectWrapper.sc-z-select .ulScrollWrapper.sc-z-select .noResults.sc-z-select z-icon.sc-z-select{margin-right:var(--space-unit)}";
21
+
22
+ const ZSelect = class {
23
+ constructor(hostRef) {
24
+ registerInstance(this, hostRef);
25
+ this.optionSelect = createEvent(this, "optionSelect", 7);
26
+ /** the id of the input element */
27
+ this.htmlid = `id-${randomId()}`;
28
+ /** the input is disabled */
29
+ this.disabled = false;
30
+ /** the input is readonly */
31
+ this.readonly = false;
32
+ /** input helper message (optional) - if set to `false` message won't be displayed */
33
+ this.message = true;
34
+ /** the input has autocomplete option */
35
+ this.autocomplete = false;
36
+ /** no result text message */
37
+ this.noresultslabel = "Nessun risultato";
38
+ this.isOpen = false;
39
+ this.selectedItem = null;
40
+ this.itemsList = [];
41
+ this.toggleSelectUl = this.toggleSelectUl.bind(this);
42
+ this.selectItem = this.selectItem.bind(this);
43
+ this.handleSelectFocus = this.handleSelectFocus.bind(this);
44
+ }
45
+ watchItems() {
46
+ this.itemsList = this.getInitialItemsArray();
47
+ this.selectedItem = this.itemsList.find((item) => item.selected);
48
+ }
49
+ /** get the input selected options */
50
+ async getSelectedItem() {
51
+ return this.selectedItem;
52
+ }
53
+ /** get the input value */
54
+ async getValue() {
55
+ return this.getSelectedValue();
56
+ }
57
+ /** set the input value */
58
+ async setValue(value) {
59
+ let values = [];
60
+ if (typeof value === "string") {
61
+ values.push(value);
62
+ }
63
+ else {
64
+ values = value;
65
+ }
66
+ this.selectedItem = this.itemsList.find((item) => values.includes(item.id));
67
+ }
68
+ emitOptionSelect() {
69
+ this.optionSelect.emit({
70
+ id: this.htmlid,
71
+ selected: this.getSelectedValue(),
72
+ });
73
+ }
74
+ componentWillLoad() {
75
+ this.watchItems();
76
+ }
77
+ componentWillRender() {
78
+ this.filterItems(this.searchString);
79
+ }
80
+ getInitialItemsArray() {
81
+ return typeof this.items === "string" ? JSON.parse(this.items) : this.items;
82
+ }
83
+ mapSelectedItemToItemsArray() {
84
+ const initialItemsList = this.getInitialItemsArray();
85
+ return initialItemsList.map((item) => {
86
+ var _a;
87
+ item.selected = item.id === ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.id);
88
+ return item;
89
+ });
90
+ }
91
+ getSelectedValue() {
92
+ var _a;
93
+ return (_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.id;
94
+ }
95
+ filterItems(searchString) {
96
+ const prevList = this.mapSelectedItemToItemsArray();
97
+ if (!(searchString === null || searchString === void 0 ? void 0 : searchString.length)) {
98
+ this.itemsList = prevList;
99
+ }
100
+ else {
101
+ this.itemsList = prevList
102
+ .filter((item) => {
103
+ return item.name.toUpperCase().includes(searchString.toUpperCase());
104
+ })
105
+ .map((item) => {
106
+ const start = item.name
107
+ .toUpperCase()
108
+ .indexOf(searchString.toUpperCase());
109
+ const end = start + searchString.length;
110
+ const newName = item.name.substring(0, start) +
111
+ `<strong>${item.name.substring(start, end)}</strong>` +
112
+ item.name.substring(end, item.name.length);
113
+ item.name = newName;
114
+ return item;
115
+ });
116
+ }
117
+ }
118
+ hasAutocomplete() {
119
+ return boolean(this.autocomplete) === true;
120
+ }
121
+ handleInputChange(e) {
122
+ this.searchString = e.detail.value;
123
+ if (!this.isOpen)
124
+ this.toggleSelectUl();
125
+ }
126
+ selectItem(item, selected) {
127
+ if (item && item.disabled)
128
+ return;
129
+ this.itemsList = this.mapSelectedItemToItemsArray();
130
+ this.itemsList = this.itemsList.map((i) => {
131
+ i.selected = false;
132
+ if (i.id === (item ? item.id : null))
133
+ i.selected = selected;
134
+ return i;
135
+ });
136
+ this.selectedItem = this.itemsList.find((item) => item.selected);
137
+ this.emitOptionSelect();
138
+ if (this.searchString)
139
+ this.searchString = null;
140
+ }
141
+ arrowsSelectNav(e, key) {
142
+ const arrows = [KeyboardCodeEnum.ARROW_DOWN, KeyboardCodeEnum.ARROW_UP];
143
+ if (!arrows.includes(e.key))
144
+ return;
145
+ e.preventDefault();
146
+ e.stopPropagation();
147
+ if (!this.isOpen)
148
+ this.toggleSelectUl();
149
+ let index;
150
+ if (e.key === KeyboardCodeEnum.ARROW_DOWN) {
151
+ index = key + 1 === this.itemsList.length ? 0 : key + 1;
152
+ }
153
+ else if (e.key === KeyboardCodeEnum.ARROW_UP) {
154
+ index = key <= 0 ? this.itemsList.length - 1 : key - 1;
155
+ }
156
+ this.focusSelectItem(index);
157
+ }
158
+ focusSelectItem(index) {
159
+ const focusElem = this.element.querySelector(`#${this.htmlid}_${index}`);
160
+ if (focusElem)
161
+ focusElem.focus();
162
+ }
163
+ toggleSelectUl(selfFocusOnClose = false) {
164
+ if (this.disabled || this.readonly)
165
+ return;
166
+ if (!this.isOpen) {
167
+ document.addEventListener("click", this.handleSelectFocus);
168
+ document.addEventListener("keyup", this.handleSelectFocus);
169
+ }
170
+ else {
171
+ document.removeEventListener("click", this.handleSelectFocus);
172
+ document.removeEventListener("keyup", this.handleSelectFocus);
173
+ if (selfFocusOnClose) {
174
+ this.element.querySelector(`#${this.htmlid}_input`).focus();
175
+ }
176
+ }
177
+ this.isOpen = !this.isOpen;
178
+ }
179
+ handleInputClick(e) {
180
+ const cp = e.composedPath();
181
+ const clearIcon = cp.find((item) => item.classList && item.classList.contains("resetIcon"));
182
+ if (clearIcon) {
183
+ e.stopPropagation();
184
+ return;
185
+ }
186
+ this.toggleSelectUl();
187
+ }
188
+ handleSelectFocus(e) {
189
+ if (e instanceof KeyboardEvent && e.key === KeyboardCodeEnum.ESC) {
190
+ e.stopPropagation();
191
+ return this.toggleSelectUl(true);
192
+ }
193
+ if (e instanceof KeyboardEvent &&
194
+ e.key !== KeyboardCodeEnum.TAB &&
195
+ e.key !== KeyboardCodeEnum.ENTER) {
196
+ return;
197
+ }
198
+ const tree = getElementTree(getClickedElement());
199
+ const parent = tree.find((elem) => {
200
+ return (elem.nodeName.toLowerCase() === "z-input" &&
201
+ elem.id === `${this.htmlid}_input`);
202
+ });
203
+ if (!parent) {
204
+ this.toggleSelectUl(e instanceof MouseEvent ? true : false);
205
+ }
206
+ }
207
+ scrollToLetter(letter) {
208
+ const foundItem = this.itemsList.find((item) => item.name.charAt(0) === letter);
209
+ if (foundItem)
210
+ this.focusSelectItem(this.itemsList.indexOf(foundItem));
211
+ }
212
+ renderInput() {
213
+ return (h("z-input", { id: `${this.htmlid}_input`, htmlid: `${this.htmlid}_input`, placeholder: this.placeholder, value: !this.isOpen && this.selectedItem
214
+ ? this.selectedItem.name.replace(/<[^>]+>/g, "")
215
+ : null, label: this.label, "aria-label": this.ariaLabel, icon: this.isOpen ? "caret-up" : "caret-down", hasclearicon: this.hasAutocomplete(), message: false, disabled: this.disabled, readonly: this.readonly || (!this.hasAutocomplete() && this.isOpen), status: this.isOpen ? undefined : this.status, onClick: (e) => {
216
+ this.handleInputClick(e);
217
+ }, onKeyUp: (e) => {
218
+ if (e.keyCode !== 13)
219
+ e.preventDefault();
220
+ handleKeyboardSubmit(e, this.toggleSelectUl);
221
+ }, onKeyDown: (e) => {
222
+ return this.arrowsSelectNav(e, this.selectedItem ? this.itemsList.indexOf(this.selectedItem) : -1);
223
+ }, onInputChange: (e) => {
224
+ this.handleInputChange(e);
225
+ }, onKeyPress: (e) => {
226
+ if (!this.hasAutocomplete()) {
227
+ e.preventDefault();
228
+ this.scrollToLetter(String.fromCharCode(e.keyCode));
229
+ }
230
+ } }));
231
+ }
232
+ renderSelectUl() {
233
+ var _a;
234
+ return (h("div", { class: this.isOpen ? "open" : "closed", tabindex: "-1" }, h("div", { class: "ulScrollWrapper", tabindex: "-1" }, h("z-list", { role: "listbox", tabindex: this.disabled || this.readonly || !this.isOpen ? -1 : 0, id: this.htmlid, "aria-activedescendant": (_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.id, "aria-multiselectable": false, class: {
235
+ disabled: this.disabled,
236
+ readonly: this.readonly,
237
+ filled: !!this.selectedItem,
238
+ [`input_${this.status}`]: !this.isOpen && !!this.status,
239
+ input_default: this.isOpen || !this.status,
240
+ } }, this.renderSelectUlItems()))));
241
+ }
242
+ renderSelectUlItems() {
243
+ if (!this.itemsList.length)
244
+ return this.renderNoSearchResults();
245
+ return this.itemsList.map((item, key) => {
246
+ return (h("z-list-element", { clickable: !item.disabled, disabled: item.disabled, dividerType: ListDividerType.element, role: "option", tabindex: item.disabled || !this.isOpen ? -1 : 0, "aria-selected": !!item.selected, id: `${this.htmlid}_${key}`, onClickItem: () => this.selectItem(item, true), onKeyDown: (e) => this.arrowsSelectNav(e, key) }, h("span", { class: { selected: !!item.selected }, innerHTML: item.name })));
247
+ });
248
+ }
249
+ renderNoSearchResults() {
250
+ return (h("z-list-element", { color: "blue500", class: "noResults" }, h("z-icon", { name: "multiply-circle", fill: "blue500" }), this.noresultslabel));
251
+ }
252
+ renderMessage() {
253
+ if (boolean(this.message) === false)
254
+ return;
255
+ return (h("z-input-message", { message: boolean(this.message) === true ? undefined : this.message, status: this.status }));
256
+ }
257
+ render() {
258
+ return (h("div", { class: "selectWrapper" }, this.renderInput(), this.renderSelectUl(), this.renderMessage()));
259
+ }
260
+ get element() { return getElement(this); }
261
+ static get watchers() { return {
262
+ "items": ["watchItems"]
263
+ }; }
264
+ };
265
+ ZSelect.style = stylesCss;
266
+
267
+ export { ZInputLabel as z_input_label, ZSelect as z_select };
@@ -0,0 +1,223 @@
1
+ import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-90e18641.js';
2
+ import { u as LabelPositions, I as InputTypeEnum } from './index-46ca649a.js';
3
+ import { r as randomId, d as boolean } from './utils-5d5963ef.js';
4
+ import './breakpoints-c386984e.js';
5
+
6
+ const stylesCss$1 = ".sc-z-input-h{display:inline-block;width:inherit}input.sc-z-input::-ms-clear,input.sc-z-input::-ms-reveal{display:none}.sc-z-input-h input.sc-z-input::-ms-clear,.sc-z-input-h input.sc-z-input::-ms-reveal{display:none}input.sc-z-input,textarea.sc-z-input,.textareaWrapper.sc-z-input{background:var(--color-input-field01);border-radius:var(--border-radius-small);border:var(--border-size-small) solid var(--color-surface04);box-sizing:border-box;color:var(--color-text02);fill:var(--color-icon02);font-family:var(--font-family-sans);font-weight:var(--font-rg);font-size:var(--font-size-3);outline:none}input.sc-z-input:focus:focus-visible,.textareaWrapper.sc-z-input:focus-within{box-shadow:var(--shadow-focus-primary)}input.sc-z-input:focus:focus-visible,textarea.sc-z-input:focus:focus-visible{color:var(--color-primary01)}.filled.sc-z-input{border-color:var(--color-surface05)}.input_success.sc-z-input{background:var(--color-success-inverse);border-color:var(--color-success01);fill:var(--color-success01)}.input_error.sc-z-input{background:var(--color-error-inverse);border-color:var(--color-error01);fill:var(--color-error01)}.input_warning.sc-z-input{background:var(--color-warning-inverse);border-color:var(--color-warning01);fill:var(--color-warning01)}input.sc-z-input:hover,.textareaWrapper.sc-z-input:hover{border-width:var(--border-size-medium)}input[readonly].sc-z-input,.readonly.sc-z-input{border-color:var(--color-disabled01);fill:var(--color-disabled01);pointer-events:none}[disabled].sc-z-input-h:not([disabled=\"false\"]) input.sc-z-input,[disabled].sc-z-input-h:not([disabled=\"false\"]) .textareaWrapper.sc-z-input,[disabled].sc-z-input-h:not([disabled=\"false\"]) z-icon.sc-z-input{border-color:var(--color-disabled01);color:var(--color-disabled02);fill:var(--color-disabled01);pointer-events:none;box-shadow:none}[disabled].sc-z-input-h:not([disabled=\"false\"]) input.sc-z-input:hover{border-width:var(--border-size-small)}input.sc-z-input::placeholder,textarea.sc-z-input::placeholder{color:var(--color-text05)}.sc-z-input::-webkit-input-placeholder,.sc-z-input::-webkit-textarea-placeholder{color:var(--color-text05)}.sc-z-input:-ms-input-placeholder,.sc-z-input:-ms-textarea-placeholder{color:var(--color-text05)}.sc-z-input::-moz-placeholder{color:var(--color-text05)}.sc-z-input:-moz-placeholder{color:var(--color-text05)}label.inputLabel.sc-z-input{display:block;margin-bottom:var(--space-unit);color:var(--color-text02);font-family:var(--font-family-sans);text-transform:uppercase;text-align:left}[disabled].sc-z-input-h:not([disabled=\"false\"]) label.inputLabel.sc-z-input{color:var(--color-disabled02)}.textWrapper.sc-z-input>div.sc-z-input{fill:var(--color-icon02)}.textWrapper.sc-z-input>div.sc-z-input>input.sc-z-input{width:100%;height:calc(var(--space-unit) * 5.5);margin:0;padding:0 calc(var(--space-unit) * 1.5);box-sizing:border-box}.textWrapper.sc-z-input>div.sc-z-input>input.hasIcon.sc-z-input,.textWrapper.sc-z-input>div.sc-z-input>input.hasClearIcon.sc-z-input{padding-right:calc(var(--space-unit) * 5.25)}.textWrapper.sc-z-input>div.sc-z-input>input.hasIcon.hasClearIcon.sc-z-input{padding-right:calc(var(--space-unit) * 8)}.textWrapper.sc-z-input>div.sc-z-input{position:relative;z-index:1}.textWrapper.sc-z-input .iconsWrapper.sc-z-input{position:absolute;right:calc(var(--space-unit) * 1.5);top:50%;transform:translateY(-50%);display:flex;z-index:2;pointer-events:none}.textWrapper.sc-z-input .iconsWrapper.sc-z-input>button.iconButton.sc-z-input{background:none;color:inherit;border:0;padding:0;font:inherit;pointer-events:initial}.textWrapper.sc-z-input .iconsWrapper.sc-z-input>button.iconButton.sc-z-input+button.iconButton.sc-z-input{margin-left:calc(var(--space-unit) * 0.5)}.textWrapper.sc-z-input .iconsWrapper.sc-z-input>button.iconButton.resetIcon.sc-z-input,.textWrapper.sc-z-input .iconsWrapper.sc-z-input>button.iconButton.showHidePasswordIcon.sc-z-input{cursor:pointer}.textWrapper.sc-z-input .iconsWrapper.sc-z-input>button.iconButton.sc-z-input>z-icon.sc-z-input{--z-icon-width:18px;--z-icon-height:18px;display:block}.textWrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill,.textWrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill:hover,.textWrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill:focus,.textWrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill:active{-webkit-background-clip:text !important}.textareaWrapper.sc-z-input{padding:calc(var(--space-unit) * 1.5);scrollbar-color:var(--color-primary01) transparent}textarea.sc-z-input::-webkit-scrollbar{background:linear-gradient(\n to right,\n transparent 0 3px,\n var(--gray200) 3px 7px,\n transparent 7px 10px\n );width:10px;border-radius:var(--border-radius)}textarea.sc-z-input::-webkit-scrollbar-track{background-color:transparent}textarea.sc-z-input::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}textarea.sc-z-input::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}textarea.sc-z-input{min-height:132px;width:100%;margin:0;padding:0;border:none;resize:none}.radioWrapper.sc-z-input,.checkboxWrapper.sc-z-input{display:inline-flex;flex-direction:row;align-items:center;font-family:var(--font-family-sans);position:relative;color:var(--color-text01);fill:var(--color-primary01)}.radioWrapper.sc-z-input:hover,.checkboxWrapper.sc-z-input:hover{color:var(--color-hover-primary);fill:currentColor}.radioWrapper.sc-z-input>input.sc-z-input,.checkboxWrapper.sc-z-input>input.sc-z-input{position:absolute;opacity:0;z-index:-1;pointer-events:none}.radioWrapper.sc-z-input .radioLabel.sc-z-input,.checkboxWrapper.sc-z-input .checkboxLabel.sc-z-input{display:inline-flex;align-items:center;margin:0;line-height:1;color:inherit;font-family:inherit;font-weight:inherit;font-size:inherit;text-transform:inherit}.radioWrapper.sc-z-input input.sc-z-input:not(:disabled)+.radioLabel.sc-z-input,.checkboxWrapper.sc-z-input input.sc-z-input:not(:disabled)+.checkboxLabel.sc-z-input{cursor:pointer}.radioWrapper.sc-z-input .radioLabel.sc-z-input z-icon.sc-z-input,.checkboxWrapper.sc-z-input .checkboxLabel.sc-z-input z-icon.sc-z-input{fill:inherit;cursor:pointer}.radioWrapper.sc-z-input .radioLabel.after.sc-z-input,.checkboxWrapper.sc-z-input .checkboxLabel.after.sc-z-input{flex-direction:row}.radioWrapper.sc-z-input .radioLabel.before.sc-z-input,.checkboxWrapper.sc-z-input .checkboxLabel.before.sc-z-input{flex-direction:row-reverse}.radioWrapper.sc-z-input .radioLabel.after.sc-z-input>span.sc-z-input,.checkboxWrapper.sc-z-input .checkboxLabel.after.sc-z-input>span.sc-z-input{margin-left:var(--space-unit)}.radioWrapper.sc-z-input .radioLabel.before.sc-z-input>span.sc-z-input,.checkboxWrapper.sc-z-input .checkboxLabel.before.sc-z-input>span.sc-z-input{margin-right:var(--space-unit)}.radioWrapper.sc-z-input>input.sc-z-input:focus:focus-visible+.radioLabel.sc-z-input>z-icon.sc-z-input,.checkboxWrapper.sc-z-input>input.sc-z-input:focus:focus-visible+.checkboxLabel.sc-z-input>z-icon.sc-z-input{box-shadow:var(--shadow-focus-primary);border-radius:var(--border-radius-small)}.radioWrapper.sc-z-input>input.sc-z-input:disabled+.radioLabel.sc-z-input,.checkboxWrapper.sc-z-input>input.sc-z-input:disabled+.checkboxLabel.sc-z-input{color:var(--color-disabled02)}.radioWrapper.sc-z-input>input.sc-z-input:disabled+.radioLabel.sc-z-input>z-icon.sc-z-input,.checkboxWrapper.sc-z-input>input.sc-z-input:disabled+.checkboxLabel.sc-z-input>z-icon.sc-z-input{fill:var(--color-disabled01);cursor:default}";
7
+
8
+ const ZInput = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ this.inputChange = createEvent(this, "inputChange", 7);
12
+ this.startTyping = createEvent(this, "startTyping", 7);
13
+ this.stopTyping = createEvent(this, "stopTyping", 7);
14
+ this.inputCheck = createEvent(this, "inputCheck", 7);
15
+ /** the id of the input element */
16
+ this.htmlid = `id-${randomId()}`;
17
+ /** the input is disabled */
18
+ this.disabled = false;
19
+ /** the input is readonly */
20
+ this.readonly = false;
21
+ /** the input is required (optional): available for text, password, number, email, textarea, checkbox */
22
+ this.required = false;
23
+ /** checked: available for checkbox, radio */
24
+ this.checked = false;
25
+ /** input helper message (optional): available for text, password, number, email, textarea - if set to `false` message won't be displayed */
26
+ this.message = true;
27
+ /** the input label position: available for checkbox, radio */
28
+ this.labelPosition = LabelPositions.right;
29
+ /** render clear icon when typing (optional): available for text */
30
+ this.hasclearicon = true;
31
+ this.isTyping = false;
32
+ this.passwordHidden = true;
33
+ this.typingtimeout = 300;
34
+ }
35
+ inputCheckListener(e) {
36
+ const data = e.detail;
37
+ switch (this.type) {
38
+ case InputTypeEnum.radio:
39
+ if (data.type === InputTypeEnum.radio &&
40
+ data.name === this.name &&
41
+ data.id !== this.htmlid) {
42
+ this.checked = false;
43
+ }
44
+ default:
45
+ return;
46
+ }
47
+ }
48
+ /** get checked status */
49
+ async isChecked() {
50
+ switch (this.type) {
51
+ case InputTypeEnum.checkbox:
52
+ case InputTypeEnum.radio:
53
+ return this.checked;
54
+ default:
55
+ console.warn("`isChecked` method is only available for type `checkbox` and `radio`");
56
+ return false;
57
+ }
58
+ }
59
+ emitInputChange(value) {
60
+ if (!this.isTyping)
61
+ this.emitStartTyping();
62
+ let validity = {};
63
+ if (this.type === InputTypeEnum.textarea) {
64
+ validity = this.getValidity("textarea");
65
+ }
66
+ else {
67
+ validity = this.getValidity("input");
68
+ }
69
+ this.value = value;
70
+ this.inputChange.emit({ value, validity });
71
+ clearTimeout(this.timer);
72
+ this.timer = setTimeout(() => {
73
+ this.emitStopTyping(this.value, validity);
74
+ }, this.typingtimeout);
75
+ }
76
+ emitStartTyping() {
77
+ this.isTyping = true;
78
+ this.startTyping.emit();
79
+ }
80
+ emitStopTyping(value, validity) {
81
+ this.isTyping = false;
82
+ this.stopTyping.emit({
83
+ value: value,
84
+ validity: validity,
85
+ });
86
+ }
87
+ emitInputCheck(checked) {
88
+ this.inputCheck.emit({
89
+ id: this.htmlid,
90
+ checked: checked,
91
+ type: this.type,
92
+ name: this.name,
93
+ value: this.value,
94
+ validity: this.getValidity("input"),
95
+ });
96
+ }
97
+ getValidity(type) {
98
+ const input = this.hostElement.querySelector(type);
99
+ return input.validity;
100
+ }
101
+ /* START text/password/email/number */
102
+ getTextAttributes() {
103
+ return {
104
+ id: this.htmlid,
105
+ name: this.name,
106
+ placeholder: this.placeholder,
107
+ value: this.value,
108
+ disabled: this.disabled,
109
+ readonly: this.readonly,
110
+ required: this.required,
111
+ title: this.htmltitle,
112
+ class: {
113
+ [`input_${this.status || "default"}`]: true,
114
+ filled: !!this.value,
115
+ },
116
+ autocomplete: this.autocomplete,
117
+ onInput: (e) => this.emitInputChange(e.target.value),
118
+ };
119
+ }
120
+ renderInputText(type = InputTypeEnum.text) {
121
+ const attr = this.getTextAttributes();
122
+ if (this.icon || type === InputTypeEnum.password) {
123
+ attr.class = Object.assign(Object.assign({}, attr.class), { hasIcon: true });
124
+ }
125
+ if (this.hasclearicon) {
126
+ attr.class = Object.assign(Object.assign({}, attr.class), { hasClearIcon: true });
127
+ }
128
+ return (h("div", { class: "textWrapper" }, this.renderLabel(), h("div", null, h("input", Object.assign({ type: type === InputTypeEnum.password && !this.passwordHidden
129
+ ? InputTypeEnum.text
130
+ : type }, attr, { "aria-label": this.ariaLabel || this.label })), this.renderIcons()), this.renderMessage()));
131
+ }
132
+ renderLabel() {
133
+ if (!this.label)
134
+ return;
135
+ return (h("label", { class: "inputLabel body-5-sb", id: `${this.htmlid}_label`, htmlFor: this.htmlid, "aria-label": this.label }, this.label));
136
+ }
137
+ renderIcons() {
138
+ return (h("span", { class: "iconsWrapper" }, this.renderResetIcon(), this.renderIcon()));
139
+ }
140
+ renderIcon() {
141
+ if (this.type === InputTypeEnum.password) {
142
+ return this.renderShowHidePassword();
143
+ }
144
+ if (!this.icon)
145
+ return;
146
+ return (h("button", { class: "iconButton inputIcon", tabIndex: -1 }, h("z-icon", { name: this.icon })));
147
+ }
148
+ renderResetIcon() {
149
+ if (!this.hasclearicon || !this.value || this.disabled || this.readonly)
150
+ return;
151
+ return (h("button", { class: "iconButton resetIcon", "aria-label": "cancella il contenuto dell'input", onClick: () => this.emitInputChange("") }, h("z-icon", { name: "multiply" })));
152
+ }
153
+ renderShowHidePassword() {
154
+ return (h("button", { class: "iconButton showHidePasswordIcon", disabled: this.disabled, "aria-label": this.passwordHidden ? "mostra password" : "nascondi password", onClick: () => (this.passwordHidden = !this.passwordHidden) }, h("z-icon", { name: this.passwordHidden ? "view-filled" : "view-off-filled" })));
155
+ }
156
+ renderMessage() {
157
+ if (boolean(this.message) === false)
158
+ return;
159
+ return (h("z-input-message", { message: boolean(this.message) === true ? undefined : this.message, status: this.status }));
160
+ }
161
+ /* END text/password/email/number */
162
+ /* START textarea */
163
+ renderTextarea() {
164
+ const attributes = this.getTextAttributes();
165
+ return (h("div", { class: "textWrapper" }, this.renderLabel(), h("div", { class: Object.assign(Object.assign({}, attributes.class), { textareaWrapper: true, readonly: attributes.readonly }) }, h("textarea", Object.assign({}, attributes, { "aria-label": this.ariaLabel || this.label }))), this.renderMessage()));
166
+ }
167
+ /* END textarea */
168
+ handleCheck(ev) {
169
+ this.checked = ev.target.checked;
170
+ this.emitInputCheck(this.checked);
171
+ }
172
+ /* START checkbox */
173
+ renderCheckbox() {
174
+ return (h("div", { class: "checkboxWrapper" }, h("input", { id: this.htmlid, type: "checkbox", name: this.name, checked: this.checked, disabled: this.disabled, readonly: this.readonly, required: this.required, onChange: this.handleCheck.bind(this), value: this.value }), h("label", { htmlFor: this.htmlid, class: {
175
+ checkboxLabel: true,
176
+ after: this.labelPosition === LabelPositions.right,
177
+ before: this.labelPosition === LabelPositions.left,
178
+ } }, h("z-icon", { name: this.checked ? "checkbox-checked" : "checkbox", "aria-hidden": "true" }), this.label && h("span", { innerHTML: this.label }))));
179
+ }
180
+ /* END checkbox */
181
+ /* START radio */
182
+ renderRadio() {
183
+ return (h("div", { class: "radioWrapper" }, h("input", { id: this.htmlid, type: "radio", name: this.name, checked: this.checked, disabled: this.disabled, readonly: this.readonly, onChange: this.handleCheck.bind(this), value: this.value }), h("label", { htmlFor: this.htmlid, class: {
184
+ radioLabel: true,
185
+ after: this.labelPosition === LabelPositions.right,
186
+ before: this.labelPosition === LabelPositions.left,
187
+ } }, h("z-icon", { name: this.checked ? "radio-button-checked" : "radio-button", "aria-hidden": "true" }), this.label && h("span", { innerHTML: this.label }))));
188
+ }
189
+ /* END radio */
190
+ render() {
191
+ switch (this.type) {
192
+ case InputTypeEnum.textarea:
193
+ return this.renderTextarea();
194
+ case InputTypeEnum.checkbox:
195
+ return this.renderCheckbox();
196
+ case InputTypeEnum.radio:
197
+ return this.renderRadio();
198
+ default:
199
+ return this.renderInputText(this.type);
200
+ }
201
+ }
202
+ get hostElement() { return getElement(this); }
203
+ };
204
+ ZInput.style = stylesCss$1;
205
+
206
+ const stylesCss = ":host{display:flex;align-items:start;min-height:calc(var(--space-unit) * 2);margin-top:var(--space-unit);color:var(--color-text05);fill:currentColor;font-family:var(--font-family-sans);font-size:var(--font-size-2);letter-spacing:0.16px}:host([status='success']){color:var(--color-text-success)}:host([status='error']){color:var(--color-text-error)}:host([status='warning']){color:var(--color-warning02)}:host(:focus){outline:none}:host>z-icon{--z-icon-width:calc(var(--space-unit) * 2);--z-icon-height:calc(var(--space-unit) * 2);margin:calc(var(--space-unit) / 3) var(--space-unit) 0 0}";
207
+
208
+ const ZInputMessage = class {
209
+ constructor(hostRef) {
210
+ registerInstance(this, hostRef);
211
+ this.statusIcons = {
212
+ success: "checkmark-circle",
213
+ error: "multiply-circled",
214
+ warning: "exclamation-circle",
215
+ };
216
+ }
217
+ render() {
218
+ return (h(Host, { role: "alert", "aria-label": this.message, tabindex: this.message ? 0 : -1 }, this.statusIcons[this.status] && this.message && (h("z-icon", { name: this.statusIcons[this.status] })), h("span", { innerHTML: this.message })));
219
+ }
220
+ };
221
+ ZInputMessage.style = stylesCss;
222
+
223
+ export { ZInput as z_input, ZInputMessage as z_input_message };
@@ -0,0 +1,50 @@
1
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-90e18641.js';
2
+ import { w as ListSize, v as ListDividerType, d as DividerSize } from './index-46ca649a.js';
3
+
4
+ const stylesCss = ":host{font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>.z-list-group-header-container{color:var(--gray700);font-size:var(--font-size-2);font-weight:var(--font-sb) !important;line-height:1.4;letter-spacing:0.16px}:host>.z-list-group-header-container.has-header{padding-top:var(--space-unit);padding-bottom:var(--space-unit)}:host>.z-list-group-header-container.has-header>z-divider{margin-top:var(--space-unit)}";
5
+
6
+ const ZListGroup = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ /**
10
+ * [optional] Sets size of inside elements.
11
+ */
12
+ this.size = ListSize.medium;
13
+ /**
14
+ * [optional] Sets the position where to insert the divider.
15
+ */
16
+ this.dividerType = ListDividerType.none;
17
+ /**
18
+ * [optional] Sets the divider size.
19
+ */
20
+ this.dividerSize = DividerSize.small;
21
+ /**
22
+ * [optional] Sets the divider color.
23
+ */
24
+ this.dividerColor = "gray200";
25
+ }
26
+ componentDidLoad() {
27
+ const children = this.host.children;
28
+ for (let i = 0; i < children.length; i++) {
29
+ if (children.length - 1 > i) {
30
+ children[i].setAttribute("divider-type", this.dividerType);
31
+ children[i].setAttribute("divider-size", this.dividerSize);
32
+ children[i].setAttribute("divider-color", this.dividerColor);
33
+ }
34
+ children[i].setAttribute("size", this.size);
35
+ }
36
+ }
37
+ componentWillLoad() {
38
+ this.hasHeader = !!this.host.querySelector('[slot="header-title"]');
39
+ }
40
+ render() {
41
+ return (h(Host, { role: "group" }, h("div", { class: {
42
+ "z-list-group-header-container": true,
43
+ "has-header": this.hasHeader,
44
+ } }, h("slot", { name: "header-title" }), this.dividerType === ListDividerType.header && (h("z-divider", { color: this.dividerColor, size: this.dividerSize }))), h("slot", null)));
45
+ }
46
+ get host() { return getElement(this); }
47
+ };
48
+ ZListGroup.style = stylesCss;
49
+
50
+ export { ZListGroup as z_list_group };