@zanichelli/albe-web-components 3.2.2 → 4.0.2

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