@zanichelli/albe-web-components 3.2.1 → 4.0.1

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 (273) hide show
  1. package/CHANGELOG.md +28 -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 +12 -14
  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 +4 -4
  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-button/index.js +12 -15
  58. package/dist/collection/components/buttons/z-button/styles.css +27 -31
  59. package/dist/collection/components/buttons/z-toggle-switch/index.js +6 -6
  60. package/dist/collection/components/file-upload/z-dragdrop-area/index.js +0 -1
  61. package/dist/collection/components/file-upload/z-file/index.js +0 -1
  62. package/dist/collection/components/inputs/z-combobox/index.js +4 -4
  63. package/dist/collection/components/inputs/z-input/index.js +58 -234
  64. package/dist/collection/components/inputs/z-input/styles.css +61 -34
  65. package/dist/collection/components/inputs/z-input-message/index.js +1 -1
  66. package/dist/collection/components/inputs/z-select/index.js +69 -134
  67. package/dist/collection/components/inputs/z-select/styles.css +16 -58
  68. package/dist/collection/components/modal/z-modal-login/index.js +1 -1
  69. package/dist/collection/components/navigation/z-menu-dropdown/index.js +4 -4
  70. package/dist/collection/components/z-date-picker/index.js +1 -1
  71. package/dist/collection/components/z-pagination/index.js +2 -2
  72. package/dist/collection/components/z-skip-to-content/index.js +1 -1
  73. package/dist/collection/components/z-skip-to-content/styles.css +1 -1
  74. package/dist/collection/deprecated/z-input-deprecated/index.js +824 -0
  75. package/dist/collection/deprecated/z-input-deprecated/styles.css +296 -0
  76. package/dist/collection/{components/inputs → deprecated}/z-input-label/index.js +0 -0
  77. package/dist/collection/{components/inputs → deprecated}/z-input-label/styles.css +0 -0
  78. package/dist/collection/snowflakes/myz/z-otp/index.js +1 -1
  79. package/dist/collection/utils/utils.js +27 -2
  80. package/dist/esm/{index-7424c64c.js → index-46ca649a.js} +28 -30
  81. package/dist/esm/index.js +2 -2
  82. package/dist/esm/loader.js +1 -1
  83. package/dist/esm/{utils-93d2b922.js → utils-5d5963ef.js} +28 -3
  84. package/dist/esm/web-components-library.js +1 -1
  85. package/dist/esm/z-app-switcher_12.entry.js +12 -14
  86. package/dist/esm/z-aria-alert.entry.js +1 -1
  87. package/dist/esm/z-avatar.entry.js +1 -1
  88. package/dist/esm/z-button-filter.entry.js +45 -0
  89. package/dist/esm/z-chip.entry.js +2 -2
  90. package/dist/esm/z-combobox.entry.js +5 -5
  91. package/dist/esm/z-contextual-menu.entry.js +1 -1
  92. package/dist/esm/z-cookiebar.entry.js +1 -1
  93. package/dist/esm/z-date-picker.entry.js +2 -2
  94. package/dist/esm/z-dragdrop-area_2.entry.js +0 -1
  95. package/dist/esm/z-file-upload.entry.js +2 -2
  96. package/dist/esm/z-file.entry.js +1 -2
  97. package/dist/esm/z-footer.entry.js +1 -1
  98. package/dist/esm/z-input-deprecated.entry.js +267 -0
  99. package/dist/esm/z-input-label_2.entry.js +267 -0
  100. package/dist/esm/z-input_2.entry.js +223 -0
  101. package/dist/esm/z-list-group.entry.js +50 -0
  102. package/dist/esm/z-list_2.entry.js +174 -0
  103. package/dist/esm/z-menu-dropdown_2.entry.js +4 -4
  104. package/dist/esm/z-messages-pocket.entry.js +1 -1
  105. package/dist/esm/z-modal-login.entry.js +1 -1
  106. package/dist/esm/z-myz-card-alert.entry.js +1 -1
  107. package/dist/esm/z-myz-card-dictionary.entry.js +1 -1
  108. package/dist/esm/z-myz-card-footer.entry.js +1 -1
  109. package/dist/esm/z-myz-card-info.entry.js +2 -2
  110. package/dist/esm/z-myz-card_4.entry.js +1 -1
  111. package/dist/esm/z-myz-list-item.entry.js +2 -2
  112. package/dist/esm/z-myz-topbar.entry.js +1 -1
  113. package/dist/esm/z-navigation-tab-link.entry.js +1 -1
  114. package/dist/esm/z-navigation-tab.entry.js +1 -1
  115. package/dist/esm/z-navigation-tabs.entry.js +1 -1
  116. package/dist/esm/z-otp.entry.js +1 -1
  117. package/dist/esm/z-pagination-bar.entry.js +2 -2
  118. package/dist/esm/z-pagination.entry.js +2 -2
  119. package/dist/esm/z-pocket_3.entry.js +2 -2
  120. package/dist/esm/z-popover.entry.js +2 -2
  121. package/dist/esm/z-section-title.entry.js +1 -1
  122. package/dist/esm/z-skip-to-content.entry.js +4 -4
  123. package/dist/esm/z-slideshow.entry.js +2 -2
  124. package/dist/esm/z-status-tag.entry.js +1 -1
  125. package/dist/esm/z-table-cell.entry.js +1 -1
  126. package/dist/esm/z-table-header.entry.js +2 -2
  127. package/dist/esm/z-table-row.entry.js +1 -1
  128. package/dist/esm/z-table.entry.js +1 -1
  129. package/dist/esm/z-toast-notification-list.entry.js +1 -1
  130. package/dist/esm/z-toast-notification.entry.js +1 -1
  131. package/dist/esm/z-toggle-switch.entry.js +3 -3
  132. package/dist/esm/z-tooltip.entry.js +1 -1
  133. package/dist/types/beans/index.d.ts +6 -7
  134. package/dist/types/components/buttons/z-button/index.d.ts +6 -4
  135. package/dist/types/components/buttons/z-toggle-switch/index.d.ts +2 -2
  136. package/dist/types/components/inputs/z-input/index.d.ts +16 -29
  137. package/dist/types/components/inputs/z-select/index.d.ts +11 -17
  138. package/dist/types/components.d.ts +193 -32
  139. package/dist/types/deprecated/z-input-deprecated/index.d.ts +102 -0
  140. package/dist/types/{components/inputs → deprecated}/z-input-label/index.d.ts +0 -0
  141. package/dist/types/utils/utils.d.ts +5 -0
  142. package/dist/web-components-library/index.esm.js +1 -1
  143. package/{www/build/p-e9b90127.entry.js → dist/web-components-library/p-02ea7e49.entry.js} +1 -1
  144. package/{www/build/p-e4b4b2e4.entry.js → dist/web-components-library/p-0a0aee35.entry.js} +1 -1
  145. package/dist/web-components-library/{p-2e510e79.entry.js → p-0d29d851.entry.js} +1 -1
  146. package/dist/web-components-library/{p-b0ea8c0e.entry.js → p-0ef6c549.entry.js} +1 -1
  147. package/dist/web-components-library/{p-4c282f06.entry.js → p-0f17db30.entry.js} +1 -1
  148. package/dist/web-components-library/{p-a391566a.entry.js → p-12af8652.entry.js} +1 -1
  149. package/dist/web-components-library/{p-3184d969.entry.js → p-1727c1c8.entry.js} +1 -1
  150. package/dist/web-components-library/{p-e7aadd3d.entry.js → p-20d62443.entry.js} +1 -1
  151. package/dist/web-components-library/{p-cd2ca92b.entry.js → p-3252be36.entry.js} +1 -1
  152. package/dist/web-components-library/{p-1b973c72.entry.js → p-3c111c2a.entry.js} +1 -1
  153. package/dist/web-components-library/{p-9721e132.entry.js → p-43329b81.entry.js} +1 -1
  154. package/dist/web-components-library/{p-9935973a.entry.js → p-4af112a7.entry.js} +1 -1
  155. package/dist/web-components-library/{p-03de95f1.entry.js → p-51cdabeb.entry.js} +1 -1
  156. package/dist/web-components-library/p-562e2d52.entry.js +1 -0
  157. package/dist/web-components-library/{p-709ab23c.entry.js → p-57d1acdc.entry.js} +1 -1
  158. package/dist/web-components-library/{p-0398165f.entry.js → p-5be162d5.entry.js} +1 -1
  159. package/{www/build/p-7e71d9b0.entry.js → dist/web-components-library/p-5eacbfc7.entry.js} +1 -1
  160. package/dist/web-components-library/{p-223bec2f.entry.js → p-63ccb013.entry.js} +1 -1
  161. package/dist/web-components-library/p-69ef6ddc.entry.js +1 -0
  162. package/dist/web-components-library/p-71accd8e.entry.js +1 -0
  163. package/dist/web-components-library/{p-56437e20.entry.js → p-7c6d4440.entry.js} +1 -1
  164. package/dist/web-components-library/p-99d7ab2f.entry.js +1 -0
  165. package/dist/web-components-library/{p-2ff952a3.entry.js → p-9aa5d36c.entry.js} +1 -1
  166. package/dist/web-components-library/p-9f5d707a.js +1 -0
  167. package/dist/web-components-library/{p-2711bc32.entry.js → p-9f9e4266.entry.js} +1 -1
  168. package/dist/web-components-library/{p-cce20009.entry.js → p-a851af81.entry.js} +1 -1
  169. package/dist/web-components-library/{p-d9d9d834.entry.js → p-a8875b97.entry.js} +2 -2
  170. package/dist/web-components-library/{p-adad78fc.entry.js → p-ae60bbdf.entry.js} +1 -1
  171. package/dist/web-components-library/p-b15efba3.entry.js +1 -0
  172. package/dist/web-components-library/p-b574d5f6.entry.js +1 -0
  173. package/dist/web-components-library/p-b9da171f.js +1 -0
  174. package/dist/web-components-library/{p-aae632ef.entry.js → p-ba29bc12.entry.js} +1 -1
  175. package/dist/web-components-library/p-bd886dd5.entry.js +1 -0
  176. package/dist/web-components-library/{p-542b3702.entry.js → p-bfe5693d.entry.js} +1 -1
  177. package/dist/web-components-library/{p-2b8975b1.entry.js → p-c9cdf4ee.entry.js} +1 -1
  178. package/dist/web-components-library/{p-dfc18671.entry.js → p-ccdebe3f.entry.js} +1 -1
  179. package/dist/web-components-library/p-cd8950d2.entry.js +1 -0
  180. package/dist/web-components-library/{p-c787ea21.entry.js → p-d33fea26.entry.js} +1 -1
  181. package/dist/web-components-library/p-d8069dab.entry.js +1 -0
  182. package/dist/web-components-library/{p-f3080685.entry.js → p-d97a2db9.entry.js} +1 -1
  183. package/dist/web-components-library/{p-1eef76bb.entry.js → p-d995d9dc.entry.js} +1 -1
  184. package/dist/web-components-library/{p-895f636e.entry.js → p-de25c7f0.entry.js} +1 -1
  185. package/dist/web-components-library/{p-66fbe5b8.entry.js → p-df4e963b.entry.js} +1 -1
  186. package/dist/web-components-library/p-e2102da3.entry.js +1 -0
  187. package/dist/web-components-library/{p-459dab30.entry.js → p-e84d6807.entry.js} +1 -1
  188. package/dist/web-components-library/p-edb8d2ab.entry.js +1 -0
  189. package/dist/web-components-library/{p-0b590426.entry.js → p-f322c5f0.entry.js} +1 -1
  190. package/dist/web-components-library/{p-da7760a3.entry.js → p-f7c3e9c3.entry.js} +1 -1
  191. package/{www/build/p-dcf4d1b6.entry.js → dist/web-components-library/p-fa925198.entry.js} +1 -1
  192. package/dist/web-components-library/{p-2c823f4c.entry.js → p-fe927bf4.entry.js} +1 -1
  193. package/dist/web-components-library/web-components-library.esm.js +1 -1
  194. package/package.json +1 -1
  195. package/react/components.d.ts +1 -0
  196. package/react/components.js +4 -3
  197. package/react/components.js.map +1 -1
  198. package/www/build/index.esm.js +1 -1
  199. package/{dist/web-components-library/p-e9b90127.entry.js → www/build/p-02ea7e49.entry.js} +1 -1
  200. package/{dist/web-components-library/p-e4b4b2e4.entry.js → www/build/p-0a0aee35.entry.js} +1 -1
  201. package/www/build/{p-2e510e79.entry.js → p-0d29d851.entry.js} +1 -1
  202. package/www/build/{p-b0ea8c0e.entry.js → p-0ef6c549.entry.js} +1 -1
  203. package/www/build/{p-4c282f06.entry.js → p-0f17db30.entry.js} +1 -1
  204. package/www/build/{p-a391566a.entry.js → p-12af8652.entry.js} +1 -1
  205. package/www/build/{p-3184d969.entry.js → p-1727c1c8.entry.js} +1 -1
  206. package/www/build/{p-e7aadd3d.entry.js → p-20d62443.entry.js} +1 -1
  207. package/www/build/{p-cd2ca92b.entry.js → p-3252be36.entry.js} +1 -1
  208. package/www/build/{p-1b973c72.entry.js → p-3c111c2a.entry.js} +1 -1
  209. package/www/build/{p-9721e132.entry.js → p-43329b81.entry.js} +1 -1
  210. package/www/build/{p-9935973a.entry.js → p-4af112a7.entry.js} +1 -1
  211. package/www/build/{p-03de95f1.entry.js → p-51cdabeb.entry.js} +1 -1
  212. package/www/build/p-562e2d52.entry.js +1 -0
  213. package/www/build/{p-709ab23c.entry.js → p-57d1acdc.entry.js} +1 -1
  214. package/www/build/{p-0398165f.entry.js → p-5be162d5.entry.js} +1 -1
  215. package/{dist/web-components-library/p-7e71d9b0.entry.js → www/build/p-5eacbfc7.entry.js} +1 -1
  216. package/www/build/{p-223bec2f.entry.js → p-63ccb013.entry.js} +1 -1
  217. package/www/build/p-69ef6ddc.entry.js +1 -0
  218. package/www/build/p-71accd8e.entry.js +1 -0
  219. package/www/build/{p-56437e20.entry.js → p-7c6d4440.entry.js} +1 -1
  220. package/www/build/p-99d7ab2f.entry.js +1 -0
  221. package/www/build/{p-2ff952a3.entry.js → p-9aa5d36c.entry.js} +1 -1
  222. package/www/build/p-9f5d707a.js +1 -0
  223. package/www/build/{p-2711bc32.entry.js → p-9f9e4266.entry.js} +1 -1
  224. package/www/build/{p-cce20009.entry.js → p-a851af81.entry.js} +1 -1
  225. package/www/build/{p-d9d9d834.entry.js → p-a8875b97.entry.js} +2 -2
  226. package/www/build/{p-adad78fc.entry.js → p-ae60bbdf.entry.js} +1 -1
  227. package/www/build/p-b15efba3.entry.js +1 -0
  228. package/www/build/p-b574d5f6.entry.js +1 -0
  229. package/www/build/p-b6035e27.js +129 -0
  230. package/www/build/p-b9da171f.js +1 -0
  231. package/www/build/{p-aae632ef.entry.js → p-ba29bc12.entry.js} +1 -1
  232. package/www/build/p-bd886dd5.entry.js +1 -0
  233. package/www/build/{p-542b3702.entry.js → p-bfe5693d.entry.js} +1 -1
  234. package/www/build/{p-2b8975b1.entry.js → p-c9cdf4ee.entry.js} +1 -1
  235. package/www/build/{p-dfc18671.entry.js → p-ccdebe3f.entry.js} +1 -1
  236. package/www/build/p-cd8950d2.entry.js +1 -0
  237. package/www/build/{p-c787ea21.entry.js → p-d33fea26.entry.js} +1 -1
  238. package/www/build/p-d8069dab.entry.js +1 -0
  239. package/www/build/{p-f3080685.entry.js → p-d97a2db9.entry.js} +1 -1
  240. package/www/build/{p-1eef76bb.entry.js → p-d995d9dc.entry.js} +1 -1
  241. package/www/build/{p-895f636e.entry.js → p-de25c7f0.entry.js} +1 -1
  242. package/www/build/{p-66fbe5b8.entry.js → p-df4e963b.entry.js} +1 -1
  243. package/www/build/p-e2102da3.entry.js +1 -0
  244. package/www/build/{p-459dab30.entry.js → p-e84d6807.entry.js} +1 -1
  245. package/www/build/p-edb8d2ab.entry.js +1 -0
  246. package/www/build/{p-0b590426.entry.js → p-f322c5f0.entry.js} +1 -1
  247. package/www/build/{p-da7760a3.entry.js → p-f7c3e9c3.entry.js} +1 -1
  248. package/{dist/web-components-library/p-dcf4d1b6.entry.js → www/build/p-fa925198.entry.js} +1 -1
  249. package/www/build/{p-2c823f4c.entry.js → p-fe927bf4.entry.js} +1 -1
  250. package/www/build/web-components-library.esm.js +1 -1
  251. package/www/index.html +1 -1
  252. package/dist/cjs/z-button-filter_5.cjs.entry.js +0 -620
  253. package/dist/esm/z-button-filter_5.entry.js +0 -612
  254. package/dist/esm/z-list_3.entry.js +0 -220
  255. package/dist/web-components-library/p-14c9344f.entry.js +0 -1
  256. package/dist/web-components-library/p-21b9a94f.entry.js +0 -1
  257. package/dist/web-components-library/p-57270965.entry.js +0 -1
  258. package/dist/web-components-library/p-70be81b6.entry.js +0 -1
  259. package/dist/web-components-library/p-80369bb8.entry.js +0 -1
  260. package/dist/web-components-library/p-80a3e18a.js +0 -1
  261. package/dist/web-components-library/p-a785ff38.entry.js +0 -1
  262. package/dist/web-components-library/p-d3723aa7.entry.js +0 -1
  263. package/dist/web-components-library/p-fea5b98f.js +0 -1
  264. package/www/build/p-14c9344f.entry.js +0 -1
  265. package/www/build/p-21b9a94f.entry.js +0 -1
  266. package/www/build/p-57270965.entry.js +0 -1
  267. package/www/build/p-70be81b6.entry.js +0 -1
  268. package/www/build/p-80369bb8.entry.js +0 -1
  269. package/www/build/p-80a3e18a.js +0 -1
  270. package/www/build/p-a785ff38.entry.js +0 -1
  271. package/www/build/p-d3723aa7.entry.js +0 -1
  272. package/www/build/p-fa024b02.js +0 -129
  273. package/www/build/p-fea5b98f.js +0 -1
@@ -1,612 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-90e18641.js';
2
- import { I as InputTypeEnum, f as keybordKeyCodeEnum, o as InputStatusEnum } from './index-7424c64c.js';
3
- import { r as randomId, a as getElementTree, h as handleKeyboardSubmit, d as getClickedElement } from './utils-93d2b922.js';
4
- import './breakpoints-c386984e.js';
5
-
6
- const stylesCss$4 = "button.container{min-height:32px;line-height:32px;border:var(--border-size-small) solid var(--bg-grey-200);border-radius:16px;box-shadow:0px 2px 5px 0px var(--bg-neutral-300);-webkit-box-shadow:0px 2px 5px 0px var(--bg-neutral-300);-moz-box-shadow:0px 2px 5px 0px var(--bg-neutral-300);text-align:center;padding:0 calc(var(--space-unit) * 2);cursor:pointer;letter-spacing:0.17px;font-family:var(--dashboard-font);font-size:12px;font-weight:var(--font-sb);opacity:1;transition:all 200ms linear}button.container.small{min-height:24px;line-height:24px}button.container:focus{outline:0}button.container::-moz-focus-inner{border:0}.text-container{margin-left:4px}button.container,button.container:focus,button.container:hover{background-color:var(--bg-white);color:var(--text-grey-700);fill:var(--text-grey-700)}button.container.isactive{background-color:var(--bg-white);color:var(--myz-blue);fill:var(--myz-blue)}button.container.isactive:hover{color:var(--myz-blue-dark);fill:var(--myz-blue-dark)}button.container.isactive:focus{background-color:var(--myz-blue-dark);border-color:var(--myz-blue-dark);box-shadow:0px 0px 4px 0px var(--text-grey-800);color:var(--bg-white);fill:var(--bg-white)}button z-icon{display:inline-block}";
7
-
8
- const ZButtonFilter = class {
9
- constructor(hostRef) {
10
- registerInstance(this, hostRef);
11
- this.removefilter = createEvent(this, "removefilter", 7);
12
- /** disable action on button */
13
- this.isfixed = false;
14
- /** add icon to button */
15
- this.hasicon = true;
16
- /** reduce button size (optional) */
17
- this.issmall = false;
18
- this.handleRemovingFilterClick = this.handleRemovingFilterClick.bind(this);
19
- }
20
- handleRemovingFilterClick() {
21
- this.removefilter.emit({
22
- filterid: this.filterid,
23
- });
24
- }
25
- renderFixedPillow(filtername) {
26
- return (h("button", { class: `container ${this.issmall ? "small" : ""}` }, this.renderIcon(), this.renderContent(filtername)));
27
- }
28
- renderDynamicPillow(filtername) {
29
- return (h("button", { class: `container isactive ${this.issmall ? "small" : ""}`, onClick: this.handleRemovingFilterClick }, this.renderIcon(), this.renderContent(filtername)));
30
- }
31
- renderIcon() {
32
- if (!this.hasicon)
33
- return null;
34
- return (h("z-icon", { class: "close-icon-container", name: "multiply", height: 12, width: 12 }));
35
- }
36
- renderContent(filtername) {
37
- return h("span", { class: "text-container" }, filtername);
38
- }
39
- render() {
40
- if (this.isfixed) {
41
- return this.renderFixedPillow(this.filtername);
42
- }
43
- return this.renderDynamicPillow(this.filtername);
44
- }
45
- };
46
- ZButtonFilter.style = stylesCss$4;
47
-
48
- const stylesCss$3 = ".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,ul[role=\"listbox\"].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,li[role=\"option\"].sc-z-input:focus:focus-visible,.focus.sc-z-input{box-shadow:var(--shadow-focus-primary)}.filled.sc-z-input{border-color:var(--color-surface05)}.istyping.sc-z-input,.focus.istyping.sc-z-input,.input_selecting.sc-z-input{border-color:var(--color-primary01);color:var(--color-primary01)}.input_success.sc-z-input,.input_success.sc-z-input:hover,.input_success.hover.sc-z-input{background:var(--color-success-inverse);border-color:var(--color-success01);fill:var(--color-success01)}.input_error.sc-z-input,.input_error.sc-z-input:hover,.input_error.hover.sc-z-input{background:var(--color-error-inverse);border-color:var(--color-error01);fill:var(--color-error01)}.input_warning.sc-z-input,.input_warning.sc-z-input:hover,.input_warning.hover.sc-z-input{background:var(--color-warning-inverse);border-color:var(--color-warning01);fill:var(--color-warning01)}input[readonly].sc-z-input,.readonly.sc-z-input{border-color:var(--color-disabled01);fill:var(--color-disabled01);pointer-events:none}input.sc-z-input:disabled,.disabled.sc-z-input,.filled.sc-z-input:disabled{border-color:var(--color-disabled01);color:var(--color-disabled02);fill:var(--color-disabled01);pointer-events:none;box-shadow:none}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)}.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) * 4.5) 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) * 4)}.textWrapper.sc-z-input>div.sc-z-input>input.hasIcon.hasClearIcon.sc-z-input{padding-right:calc(var(--space-unit) * 7)}.textWrapper.sc-z-input>div.sc-z-input{position:relative;z-index:1}.textWrapper.sc-z-input .iconsWrapper.sc-z-input{position:absolute;bottom:calc(var(--space-unit) * 1.5);right:calc(var(--space-unit) * 1.5);display:flex;z-index:2}.textWrapper.sc-z-input .iconsWrapper.sc-z-input>z-icon.sc-z-input{--z-icon-width:18px;--z-icon-height:18px;display:block;margin-left:calc(var(--space-unit) * 0.5)}.textWrapper.sc-z-input .iconsWrapper.sc-z-input>z-icon.resetIcon.sc-z-input,.textWrapper.sc-z-input .iconsWrapper.sc-z-input>z-icon.showHidePasswordIcon.sc-z-input{cursor:pointer}.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}";
49
-
50
- const ZInput = class {
51
- constructor(hostRef) {
52
- registerInstance(this, hostRef);
53
- this.inputChange = createEvent(this, "inputChange", 7);
54
- this.startTyping = createEvent(this, "startTyping", 7);
55
- this.stopTyping = createEvent(this, "stopTyping", 7);
56
- this.inputCheck = createEvent(this, "inputCheck", 7);
57
- this.optionSelect = createEvent(this, "optionSelect", 7);
58
- /** the id of the input element */
59
- this.htmlid = `id-${randomId()}`;
60
- /** the input is disabled */
61
- this.disabled = false;
62
- /** the input is readonly */
63
- this.readonly = false;
64
- /** the input is required (optional): available for text, password, number, email, textarea, checkbox */
65
- this.required = false;
66
- /** checked: available for checkbox, radio */
67
- this.checked = false;
68
- /** show input helper message (optional): available for text, password, number, email, textarea, select */
69
- this.hasmessage = true;
70
- /** the input label position: available for checkbox, radio */
71
- this.labelafter = true;
72
- /** timeout setting before trigger `inputChange` event (optional): available for text, textarea */
73
- this.typingtimeout = 300;
74
- /** multiple options can be selected (optional): available for select */
75
- this.multiple = false;
76
- /** render clear icon when typing (optional): available for text */
77
- this.hasclearicon = true;
78
- this.isTyping = false;
79
- this.textareaWrapperHover = "";
80
- this.textareaWrapperFocus = "";
81
- this.passwordHidden = true;
82
- }
83
- inputCheckListener(e) {
84
- const data = e.detail;
85
- switch (this.type) {
86
- case InputTypeEnum.radio:
87
- if (data.type === InputTypeEnum.radio &&
88
- data.name === this.name &&
89
- data.id !== this.htmlid) {
90
- this.checked = false;
91
- }
92
- default:
93
- return;
94
- }
95
- }
96
- /** get the input value */
97
- async getValue() {
98
- switch (this.type) {
99
- case InputTypeEnum.select:
100
- return this.selectElem.getValue();
101
- default:
102
- return this.value;
103
- }
104
- }
105
- /** set the input value */
106
- async setValue(value) {
107
- switch (this.type) {
108
- case InputTypeEnum.select:
109
- this.selectElem.setValue(value);
110
- break;
111
- default:
112
- if (typeof value === "string")
113
- this.value = value;
114
- break;
115
- }
116
- }
117
- /** get checked status */
118
- async isChecked() {
119
- switch (this.type) {
120
- case InputTypeEnum.checkbox:
121
- case InputTypeEnum.radio:
122
- return this.checked;
123
- default:
124
- return false;
125
- }
126
- }
127
- emitInputChange(value, keycode) {
128
- if (!this.isTyping) {
129
- this.emitStartTyping();
130
- }
131
- let validity = {};
132
- if (this.type === InputTypeEnum.textarea) {
133
- validity = this.getValidity("textarea");
134
- }
135
- else {
136
- validity = this.getValidity("input");
137
- }
138
- this.value = value;
139
- this.inputChange.emit({ value, keycode, validity });
140
- clearTimeout(this.timer);
141
- this.timer = setTimeout(() => {
142
- this.emitStopTyping(this.value, validity);
143
- }, this.typingtimeout);
144
- }
145
- emitStartTyping() {
146
- this.isTyping = true;
147
- this.startTyping.emit();
148
- }
149
- emitStopTyping(value, validity) {
150
- this.isTyping = false;
151
- this.stopTyping.emit({
152
- value: value,
153
- validity: validity,
154
- });
155
- }
156
- emitInputCheck(checked) {
157
- this.inputCheck.emit({
158
- id: this.htmlid,
159
- checked: checked,
160
- type: this.type,
161
- name: this.name,
162
- value: this.value,
163
- validity: this.getValidity("input"),
164
- });
165
- }
166
- getValidity(type) {
167
- const input = this.hostElement.querySelector(type);
168
- return input.validity;
169
- }
170
- /* START text/password/email/number */
171
- getTextAttributes() {
172
- const attr = {
173
- id: this.htmlid,
174
- name: this.name,
175
- placeholder: this.placeholder,
176
- value: this.value,
177
- disabled: this.disabled,
178
- readonly: this.readonly,
179
- required: this.required,
180
- title: this.htmltitle,
181
- class: [
182
- `input_${this.status || "default"}`,
183
- this.isTyping && "istyping",
184
- !this.isTyping && this.value && "filled",
185
- ]
186
- .filter(Boolean)
187
- .join(" "),
188
- onInput: (e) => this.emitInputChange(e.target.value, e.keyCode),
189
- };
190
- if (this.autocomplete) {
191
- attr["autocomplete"] = this.autocomplete;
192
- }
193
- return attr;
194
- }
195
- renderInputText(type = InputTypeEnum.text) {
196
- const attr = this.getTextAttributes();
197
- if (this.icon || type === InputTypeEnum.password) {
198
- attr.class += " hasIcon";
199
- }
200
- if (this.hasclearicon) {
201
- attr.class += " hasClearIcon";
202
- }
203
- return (h("div", { class: "textWrapper" }, this.renderLabel(), h("div", null, h("input", Object.assign({ type: type === InputTypeEnum.password && !this.passwordHidden
204
- ? InputTypeEnum.text
205
- : type }, attr, { "aria-label": this.ariaLabel || this.label })), this.renderIcons()), this.renderMessage()));
206
- }
207
- renderLabel() {
208
- if (!this.label)
209
- return;
210
- return (h("z-input-label", { htmlfor: this.htmlid, value: this.label, disabled: this.disabled, "aria-label": this.label, id: `${this.htmlid}_label` }));
211
- }
212
- renderIcons() {
213
- return (h("span", { class: {
214
- iconsWrapper: true,
215
- disabled: this.disabled,
216
- } }, this.renderResetIcon(), this.renderIcon()));
217
- }
218
- renderIcon() {
219
- if (this.type === InputTypeEnum.password) {
220
- return this.renderShowHidePassword();
221
- }
222
- if (!this.icon)
223
- return;
224
- return h("z-icon", { class: "inputIcon", name: this.icon });
225
- }
226
- renderResetIcon() {
227
- if (!this.hasclearicon || !this.value || this.disabled || this.readonly)
228
- return;
229
- return (h("z-icon", { class: "resetIcon", name: "multiply", onClick: (e) => this.emitInputChange("", e.keyCode) }));
230
- }
231
- renderShowHidePassword() {
232
- return (h("z-icon", { class: "showHidePasswordIcon", name: this.passwordHidden ? "view-filled" : "view-off-filled", onClick: () => (this.passwordHidden = !this.passwordHidden) }));
233
- }
234
- renderMessage() {
235
- if (!this.hasmessage)
236
- return;
237
- return h("z-input-message", { message: this.message, status: this.status });
238
- }
239
- /* END text/password/email/number */
240
- /* START textarea */
241
- renderTextarea() {
242
- const attributes = this.getTextAttributes();
243
- return (h("div", { class: "textWrapper" }, this.renderLabel(), h("div", { class: [
244
- "textareaWrapper",
245
- attributes.class,
246
- attributes.disabled && "disabled",
247
- attributes.readonly && "readonly",
248
- this.isTyping && "istyping",
249
- this.textareaWrapperFocus,
250
- this.textareaWrapperHover,
251
- ]
252
- .filter(Boolean)
253
- .join(" ") }, h("textarea", Object.assign({}, attributes, { onFocus: () => (this.textareaWrapperFocus = "focus"), onBlur: () => (this.textareaWrapperFocus = ""), onMouseOver: () => (this.textareaWrapperHover = "hover"), onMouseOut: () => (this.textareaWrapperHover = ""), "aria-label": this.ariaLabel || this.label }))), this.renderMessage()));
254
- }
255
- /* END textarea */
256
- handleCheck(ev) {
257
- this.checked = ev.target.checked;
258
- this.emitInputCheck(this.checked);
259
- }
260
- /* START checkbox */
261
- renderCheckbox() {
262
- 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: {
263
- checkboxLabel: true,
264
- after: this.labelafter,
265
- before: !this.labelafter,
266
- } }, h("z-icon", { name: this.checked ? "checkbox-checked" : "checkbox", "aria-hidden": "true" }), this.label && h("span", { innerHTML: this.label }))));
267
- }
268
- /* END checkbox */
269
- /* START radio */
270
- renderRadio() {
271
- 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: {
272
- radioLabel: true,
273
- after: this.labelafter,
274
- before: !this.labelafter,
275
- } }, h("z-icon", { name: this.checked ? "radio-button-checked" : "radio-button", "aria-hidden": "true" }), this.label && h("span", { innerHTML: this.label }))));
276
- }
277
- /* END radio */
278
- /* START select */
279
- renderSelect() {
280
- return (h("z-select", { htmlid: this.htmlid, items: this.items, name: this.name, label: this.label, "aria-label": this.ariaLabel, disabled: this.disabled, readonly: this.readonly, placeholder: this.placeholder, htmltitle: this.htmltitle, status: this.status, hasmessage: this.hasmessage, message: this.message, autocomplete: this.autocomplete, multiple: this.multiple, ref: (el) => (this.selectElem = el) }));
281
- }
282
- /* END select */
283
- render() {
284
- switch (this.type) {
285
- case InputTypeEnum.text:
286
- case InputTypeEnum.password:
287
- case InputTypeEnum.number:
288
- case InputTypeEnum.email:
289
- return this.renderInputText(this.type);
290
- case InputTypeEnum.textarea:
291
- return this.renderTextarea();
292
- case InputTypeEnum.checkbox:
293
- return this.renderCheckbox();
294
- case InputTypeEnum.radio:
295
- return this.renderRadio();
296
- case InputTypeEnum.select:
297
- return this.renderSelect();
298
- default:
299
- return this.renderInputText();
300
- }
301
- }
302
- get hostElement() { return getElement(this); }
303
- };
304
- ZInput.style = stylesCss$3;
305
-
306
- const stylesCss$2 = "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)}";
307
-
308
- const ZInputLabel = class {
309
- constructor(hostRef) {
310
- registerInstance(this, hostRef);
311
- /** the label is disabled */
312
- this.disabled = false;
313
- }
314
- render() {
315
- return h("label", { htmlFor: this.htmlfor, class: { disabled: this.disabled } }, this.value);
316
- }
317
- };
318
- ZInputLabel.style = stylesCss$2;
319
-
320
- const stylesCss$1 = ":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}";
321
-
322
- const ZInputMessage = class {
323
- constructor(hostRef) {
324
- registerInstance(this, hostRef);
325
- this.statusIcons = {
326
- success: "checkmark-circle",
327
- error: "multiply-circled",
328
- warning: "exclamation-circle",
329
- };
330
- }
331
- render() {
332
- 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 })));
333
- }
334
- };
335
- ZInputMessage.style = stylesCss$1;
336
-
337
- const stylesCss = ".sc-z-select-h{display:inline-block;width:inherit}li[role=\"option\"].sc-z-select:focus:focus-visible{border-color:transparent;box-shadow:var(--shadow-focus-primary);outline:none}.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) * .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>ul.sc-z-select{position:relative;margin:0;padding:0;list-style:none;border:0;max-height:240px;overflow:auto;outline:none;scrollbar-color:var(--color-primary01) transparent}.selectWrapper.sc-z-select .ulScrollWrapper.sc-z-select>ul.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>ul.sc-z-select::-webkit-scrollbar-track{background-color:transparent}.selectWrapper.sc-z-select .ulScrollWrapper.sc-z-select>ul.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>ul.sc-z-select::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.selectWrapper.sc-z-select .ulScrollWrapper.sc-z-select ul.sc-z-select li.sc-z-select{display:flex;align-items:center;min-height:calc(var(--space-unit) * 5.5);padding:calc(var(--space-unit) * 1.5);box-sizing:border-box;border-bottom:var(--border-size-small) solid var(--gray200);text-align:left;cursor:pointer}.selectWrapper.sc-z-select .ulScrollWrapper.sc-z-select ul.sc-z-select li.sc-z-select:hover{color:var(--color-hover-primary);background:var(--color-surface02)}.selectWrapper.sc-z-select .ulScrollWrapper.sc-z-select ul.sc-z-select li.sc-z-select:focus:focus-visible{margin:2px}.selectWrapper.sc-z-select .ulScrollWrapper.sc-z-select ul.sc-z-select li[aria-selected=\"\"].sc-z-select{font-weight:var(--font-sb)}.selectWrapper.sc-z-select .ulScrollWrapper.sc-z-select ul.sc-z-select li.disabled.sc-z-select{color:var(--color-disabled02);cursor:default;pointer-events:none}.selectWrapper.sc-z-select .ulScrollWrapper.sc-z-select ul.sc-z-select li.noResults.sc-z-select{color:var(--color-primary01);fill:currentColor;border:none}.selectWrapper.sc-z-select .ulScrollWrapper.sc-z-select .noResults.sc-z-select z-icon.sc-z-select{margin-right:var(--space-unit)}.selectWrapper.sc-z-select .chipsWrapper.sc-z-select{padding-bottom:var(--space-unit)}.selectWrapper.sc-z-select .chipsWrapper.sc-z-select z-button-filter.sc-z-select{display:inline-block;margin:calc(var(--space-unit) * 0.5)}";
338
-
339
- const ZSelect = class {
340
- constructor(hostRef) {
341
- registerInstance(this, hostRef);
342
- this.optionSelect = createEvent(this, "optionSelect", 7);
343
- /** the id of the input element */
344
- this.htmlid = `id-${randomId()}`;
345
- /** the input is disabled */
346
- this.disabled = false;
347
- /** the input is readonly */
348
- this.readonly = false;
349
- /** show input helper message (optional): available for text, password, number, email, textarea, select */
350
- this.hasmessage = true;
351
- /** the input has autocomplete option */
352
- this.autocomplete = false;
353
- /** multiple options can be selected */
354
- this.multiple = false;
355
- /** no result text message */
356
- this.noresultslabel = "Nessun risultato";
357
- this.isOpen = false;
358
- this.itemsList = [];
359
- this.toggleSelectUl = this.toggleSelectUl.bind(this);
360
- this.selectItem = this.selectItem.bind(this);
361
- this.handleSelectFocus = this.handleSelectFocus.bind(this);
362
- }
363
- watchItems() {
364
- this.itemsList = this.getInitialItemsArray();
365
- this.selectedItems = this.itemsList.filter((item) => item.selected);
366
- }
367
- /** get the input selected options */
368
- async getSelectedItems() {
369
- return this.selectedItems;
370
- }
371
- /** get the input value */
372
- async getValue() {
373
- return this.getSelectedValues();
374
- }
375
- /** set the input value */
376
- async setValue(value) {
377
- let values = [];
378
- if (typeof value === "string") {
379
- values.push(value);
380
- }
381
- else {
382
- values = value;
383
- }
384
- this.selectedItems = this.itemsList.filter((item) => values.includes(item.id));
385
- }
386
- emitOptionSelect() {
387
- this.optionSelect.emit({
388
- id: this.htmlid,
389
- selected: this.getSelectedValues(),
390
- });
391
- }
392
- componentWillLoad() {
393
- this.watchItems();
394
- }
395
- componentWillRender() {
396
- this.filterItems(this.searchString);
397
- }
398
- getInitialItemsArray() {
399
- return typeof this.items === "string" ? JSON.parse(this.items) : this.items;
400
- }
401
- mapSelectedItemsToItemsArray() {
402
- const initialItemsList = this.getInitialItemsArray();
403
- return initialItemsList.map((item) => {
404
- const found = this.selectedItems.find((selected) => selected.id === item.id);
405
- item.selected = !!found;
406
- return item;
407
- });
408
- }
409
- getSelectedValues() {
410
- if (this.multiple) {
411
- return this.selectedItems.map((item) => item.id);
412
- }
413
- if (!this.multiple && this.selectedItems.length) {
414
- return this.selectedItems[0].id;
415
- }
416
- return null;
417
- }
418
- filterItems(searchString) {
419
- const prevList = this.mapSelectedItemsToItemsArray();
420
- if (!(searchString === null || searchString === void 0 ? void 0 : searchString.length)) {
421
- this.itemsList = prevList;
422
- }
423
- else {
424
- this.itemsList = prevList
425
- .filter((item) => {
426
- return item.name.toUpperCase().includes(searchString.toUpperCase());
427
- })
428
- .map((item) => {
429
- const start = item.name
430
- .toUpperCase()
431
- .indexOf(searchString.toUpperCase());
432
- const end = start + searchString.length;
433
- const newName = item.name.substring(0, start) +
434
- item.name.substring(start, end).bold() +
435
- item.name.substring(end, item.name.length);
436
- item.name = newName;
437
- return item;
438
- });
439
- }
440
- }
441
- hasAutcomplete() {
442
- return (this.autocomplete === true ||
443
- this.autocomplete === "true" ||
444
- this.autocomplete === "on");
445
- }
446
- handleInputChange(e) {
447
- this.searchString = e.detail.value;
448
- if (!this.isOpen)
449
- this.toggleSelectUl();
450
- }
451
- selectItem(item, selected) {
452
- if (item && item.disabled)
453
- return;
454
- this.itemsList = this.mapSelectedItemsToItemsArray();
455
- this.itemsList = this.itemsList.map((i) => {
456
- if (!this.multiple)
457
- i.selected = false;
458
- if (i.id === (item ? item.id : null))
459
- i.selected = selected;
460
- return i;
461
- });
462
- this.selectedItems = this.itemsList.filter((item) => item.selected);
463
- this.emitOptionSelect();
464
- if (this.searchString)
465
- this.searchString = null;
466
- }
467
- arrowsSelectNav(e, key) {
468
- const arrows = [keybordKeyCodeEnum.ARROW_DOWN, keybordKeyCodeEnum.ARROW_UP];
469
- if (!arrows.includes(e.keyCode))
470
- return;
471
- e.preventDefault();
472
- e.stopPropagation();
473
- if (!this.isOpen)
474
- this.toggleSelectUl();
475
- let index;
476
- if (e.keyCode === keybordKeyCodeEnum.ARROW_DOWN) {
477
- index = key + 1 === this.itemsList.length ? 0 : key + 1;
478
- }
479
- else if (e.keyCode === keybordKeyCodeEnum.ARROW_UP) {
480
- index = key <= 0 ? this.itemsList.length - 1 : key - 1;
481
- }
482
- this.focusSelectItem(index);
483
- }
484
- focusSelectItem(index) {
485
- const focusElem = this.element.querySelector(`#${this.htmlid}_${index}`);
486
- if (focusElem)
487
- focusElem.focus();
488
- }
489
- toggleSelectUl(selfFocusOnClose = false) {
490
- if (this.disabled || this.readonly)
491
- return;
492
- if (!this.isOpen) {
493
- document.addEventListener("click", this.handleSelectFocus);
494
- document.addEventListener("keyup", this.handleSelectFocus);
495
- }
496
- else {
497
- document.removeEventListener("click", this.handleSelectFocus);
498
- document.removeEventListener("keyup", this.handleSelectFocus);
499
- if (selfFocusOnClose) {
500
- this.element
501
- .querySelector(`#${this.htmlid}_input`)
502
- .focus();
503
- }
504
- }
505
- this.isOpen = !this.isOpen;
506
- }
507
- handleInputClick(e) {
508
- const cp = e.composedPath();
509
- const clearIcon = cp.find((item) => item.classList && item.classList.contains("resetIcon"));
510
- if (clearIcon) {
511
- e.stopPropagation();
512
- return;
513
- }
514
- this.toggleSelectUl();
515
- }
516
- handleSelectFocus(e) {
517
- if (e instanceof KeyboardEvent && e.keyCode === keybordKeyCodeEnum.ESC) {
518
- e.stopPropagation();
519
- return this.toggleSelectUl(true);
520
- }
521
- if (e instanceof KeyboardEvent &&
522
- e.keyCode !== keybordKeyCodeEnum.TAB &&
523
- e.keyCode !== keybordKeyCodeEnum.ENTER) {
524
- return;
525
- }
526
- const tree = getElementTree(getClickedElement());
527
- const parent = tree.find((elem) => {
528
- return ((elem.nodeName.toLowerCase() === "z-input" &&
529
- elem.id === `${this.htmlid}_input`) ||
530
- (this.multiple &&
531
- elem.nodeName.toLowerCase() === "ul" &&
532
- elem.id === this.htmlid));
533
- });
534
- if (!parent) {
535
- this.toggleSelectUl(e instanceof MouseEvent ? true : false);
536
- }
537
- }
538
- scrollToLetter(letter) {
539
- const foundItem = this.itemsList.find((item) => item.name.charAt(0) === letter);
540
- if (foundItem)
541
- this.focusSelectItem(this.itemsList.indexOf(foundItem));
542
- }
543
- renderLabel() {
544
- if (!this.label)
545
- return;
546
- return (h("z-input-label", { htmlfor: this.htmlid, value: this.label, disabled: this.disabled, "aria-label": this.label, id: `${this.htmlid}_input_label` }));
547
- }
548
- renderInput() {
549
- return (h("z-input", { id: `${this.htmlid}_input`, htmlid: `${this.htmlid}_input`, placeholder: this.placeholder, value: !this.isOpen && !this.multiple && this.selectedItems.length
550
- ? this.selectedItems[0].name.replace(/<[^>]+>/g, "")
551
- : null, "aria-label": this.ariaLabel, icon: this.isOpen ? "caret-up" : "caret-down", hasclearicon: this.hasAutcomplete(), hasmessage: false, disabled: this.disabled, readonly: this.readonly || (!this.hasAutcomplete() && this.isOpen), status: this.isOpen ? InputStatusEnum.selecting : this.status, onClick: (e) => {
552
- this.handleInputClick(e);
553
- }, onKeyUp: (e) => {
554
- if (e.keyCode !== 13)
555
- e.preventDefault();
556
- handleKeyboardSubmit(e, this.toggleSelectUl);
557
- }, onKeyDown: (e) => {
558
- return this.arrowsSelectNav(e, this.selectedItems.length
559
- ? this.itemsList.indexOf(this.selectedItems[0])
560
- : -1);
561
- }, onInputChange: (e) => {
562
- this.handleInputChange(e);
563
- }, onKeyPress: (e) => {
564
- if (!this.hasAutcomplete()) {
565
- e.preventDefault();
566
- this.scrollToLetter(String.fromCharCode(e.keyCode));
567
- }
568
- } }));
569
- }
570
- renderChips() {
571
- if (!this.multiple || !this.selectedItems.length)
572
- return;
573
- return (h("div", { class: `chipsWrapper ${this.isOpen ? "open" : ""}` }, this.selectedItems.map((item) => (h("z-button-filter", { filterid: item.id, filtername: item.name.replace(/<[^>]+>/g, ""), issmall: true, onRemovefilter: () => this.selectItem(item, false) })))));
574
- }
575
- renderSelectUl() {
576
- return (h("div", { class: this.isOpen ? "open" : "closed", tabindex: "-1" }, h("div", { class: "ulScrollWrapper", tabindex: "-1" }, h("ul", { role: "listbox", tabindex: this.disabled || this.readonly || !this.isOpen ? -1 : 0, id: this.htmlid, "aria-activedescendant": !this.multiple && this.selectedItems.length
577
- ? this.selectedItems[0].id
578
- : null, "aria-multiselectable": !!this.multiple, class: `
579
- ${this.disabled ? " disabled" : ""}
580
- ${this.readonly ? " readonly" : ""}
581
- ${!this.isOpen && this.status
582
- ? " input_" + this.status
583
- : " input_default"}
584
- ${this.selectedItems.length ? " filled" : ""}
585
- ` }, this.renderSelectUlItems()))));
586
- }
587
- renderSelectUlItems() {
588
- if (!this.itemsList.length)
589
- return this.renderNoSearchResults();
590
- return this.itemsList.map((item, key) => {
591
- return (h("li", { role: "option", tabindex: item.disabled || !this.isOpen ? -1 : 0, "aria-selected": !!item.selected, class: item.disabled && "disabled", id: `${this.htmlid}_${key}`, onClick: () => this.selectItem(item, true), onKeyUp: (e) => handleKeyboardSubmit(e, this.selectItem, item, true), onKeyDown: (e) => this.arrowsSelectNav(e, key) }, h("span", { innerHTML: item.name })));
592
- });
593
- }
594
- renderNoSearchResults() {
595
- return (h("li", { class: "noResults" }, h("z-icon", { name: "multiply-circle" }), this.noresultslabel));
596
- }
597
- renderMessage() {
598
- if (!this.hasmessage)
599
- return;
600
- return h("z-input-message", { message: this.message, status: this.status });
601
- }
602
- render() {
603
- return (h("div", { class: "selectWrapper" }, this.renderLabel(), this.renderChips(), this.renderInput(), this.renderSelectUl(), this.renderMessage()));
604
- }
605
- get element() { return getElement(this); }
606
- static get watchers() { return {
607
- "items": ["watchItems"]
608
- }; }
609
- };
610
- ZSelect.style = stylesCss;
611
-
612
- export { ZButtonFilter as z_button_filter, ZInput as z_input, ZInputLabel as z_input_label, ZInputMessage as z_input_message, ZSelect as z_select };