@zanichelli/albe-web-components 3.2.2 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/CHANGELOG.md +1692 -0
  2. package/dist/cjs/{index-b1289f95.js → index-6b6a3299.js} +27 -29
  3. package/dist/cjs/index.cjs.js +2 -2
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/{utils-33df2456.js → utils-8cc414c9.js} +28 -2
  6. package/dist/cjs/web-components-library.cjs.js +1 -1
  7. package/dist/cjs/z-app-switcher_12.cjs.entry.js +1 -1
  8. package/dist/cjs/z-aria-alert.cjs.entry.js +1 -1
  9. package/dist/cjs/z-avatar.cjs.entry.js +1 -1
  10. package/dist/cjs/z-button-filter.cjs.entry.js +49 -0
  11. package/dist/cjs/z-chip.cjs.entry.js +2 -2
  12. package/dist/cjs/z-combobox.cjs.entry.js +5 -5
  13. package/dist/cjs/z-contextual-menu.cjs.entry.js +1 -1
  14. package/dist/cjs/z-cookiebar.cjs.entry.js +1 -1
  15. package/dist/cjs/z-date-picker.cjs.entry.js +2 -2
  16. package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +0 -1
  17. package/dist/cjs/z-file-upload.cjs.entry.js +2 -2
  18. package/dist/cjs/z-file.cjs.entry.js +1 -2
  19. package/dist/cjs/z-footer.cjs.entry.js +1 -1
  20. package/dist/cjs/z-input-deprecated.cjs.entry.js +271 -0
  21. package/dist/cjs/z-input-label_2.cjs.entry.js +272 -0
  22. package/dist/cjs/z-input_2.cjs.entry.js +228 -0
  23. package/dist/cjs/z-list-group.cjs.entry.js +54 -0
  24. package/dist/cjs/{z-list_3.cjs.entry.js → z-list_2.cjs.entry.js} +5 -52
  25. package/dist/cjs/z-menu-dropdown_2.cjs.entry.js +4 -4
  26. package/dist/cjs/z-messages-pocket.cjs.entry.js +1 -1
  27. package/dist/cjs/z-modal-login.cjs.entry.js +1 -1
  28. package/dist/cjs/z-myz-card-alert.cjs.entry.js +1 -1
  29. package/dist/cjs/z-myz-card-dictionary.cjs.entry.js +1 -1
  30. package/dist/cjs/z-myz-card-footer.cjs.entry.js +1 -1
  31. package/dist/cjs/z-myz-card-info.cjs.entry.js +2 -2
  32. package/dist/cjs/z-myz-card_4.cjs.entry.js +1 -1
  33. package/dist/cjs/z-myz-list-item.cjs.entry.js +2 -2
  34. package/dist/cjs/z-myz-topbar.cjs.entry.js +1 -1
  35. package/dist/cjs/z-navigation-tab-link.cjs.entry.js +1 -1
  36. package/dist/cjs/z-navigation-tab.cjs.entry.js +1 -1
  37. package/dist/cjs/z-navigation-tabs.cjs.entry.js +1 -1
  38. package/dist/cjs/z-otp.cjs.entry.js +1 -1
  39. package/dist/cjs/z-pagination-bar.cjs.entry.js +2 -2
  40. package/dist/cjs/z-pagination.cjs.entry.js +2 -2
  41. package/dist/cjs/z-pocket_3.cjs.entry.js +2 -2
  42. package/dist/cjs/z-popover.cjs.entry.js +2 -2
  43. package/dist/cjs/z-section-title.cjs.entry.js +1 -1
  44. package/dist/cjs/z-skip-to-content.cjs.entry.js +2 -2
  45. package/dist/cjs/z-slideshow.cjs.entry.js +2 -2
  46. package/dist/cjs/z-status-tag.cjs.entry.js +1 -1
  47. package/dist/cjs/z-table-cell.cjs.entry.js +1 -1
  48. package/dist/cjs/z-table-header.cjs.entry.js +2 -2
  49. package/dist/cjs/z-table-row.cjs.entry.js +1 -1
  50. package/dist/cjs/z-table.cjs.entry.js +1 -1
  51. package/dist/cjs/z-toast-notification-list.cjs.entry.js +1 -1
  52. package/dist/cjs/z-toast-notification.cjs.entry.js +1 -1
  53. package/dist/cjs/z-toggle-switch.cjs.entry.js +3 -3
  54. package/dist/cjs/z-tooltip.cjs.entry.js +1 -1
  55. package/dist/collection/beans/index.js +27 -29
  56. package/dist/collection/collection-manifest.json +2 -1
  57. package/dist/collection/components/buttons/z-toggle-switch/index.js +6 -6
  58. package/dist/collection/components/file-upload/z-dragdrop-area/index.js +0 -1
  59. package/dist/collection/components/file-upload/z-file/index.js +0 -1
  60. package/dist/collection/components/inputs/z-combobox/index.js +4 -4
  61. package/dist/collection/components/inputs/z-input/index.js +58 -234
  62. package/dist/collection/components/inputs/z-input/styles.css +61 -34
  63. package/dist/collection/components/inputs/z-input-message/index.js +1 -1
  64. package/dist/collection/components/inputs/z-select/index.js +69 -134
  65. package/dist/collection/components/inputs/z-select/styles.css +16 -58
  66. package/dist/collection/components/modal/z-modal-login/index.js +1 -1
  67. package/dist/collection/components/navigation/z-menu-dropdown/index.js +4 -4
  68. package/dist/collection/components/z-date-picker/index.js +1 -1
  69. package/dist/collection/components/z-pagination/index.js +2 -2
  70. package/dist/collection/deprecated/z-input-deprecated/index.js +824 -0
  71. package/dist/collection/deprecated/z-input-deprecated/styles.css +296 -0
  72. package/dist/collection/{components/inputs → deprecated}/z-input-label/index.js +0 -0
  73. package/dist/collection/{components/inputs → deprecated}/z-input-label/styles.css +0 -0
  74. package/dist/collection/snowflakes/myz/z-otp/index.js +1 -1
  75. package/dist/collection/utils/utils.js +27 -2
  76. package/dist/esm/{index-7424c64c.js → index-46ca649a.js} +28 -30
  77. package/dist/esm/index.js +2 -2
  78. package/dist/esm/loader.js +1 -1
  79. package/dist/esm/{utils-93d2b922.js → utils-5d5963ef.js} +28 -3
  80. package/dist/esm/web-components-library.js +1 -1
  81. package/dist/esm/z-app-switcher_12.entry.js +1 -1
  82. package/dist/esm/z-aria-alert.entry.js +1 -1
  83. package/dist/esm/z-avatar.entry.js +1 -1
  84. package/dist/esm/z-button-filter.entry.js +45 -0
  85. package/dist/esm/z-chip.entry.js +2 -2
  86. package/dist/esm/z-combobox.entry.js +5 -5
  87. package/dist/esm/z-contextual-menu.entry.js +1 -1
  88. package/dist/esm/z-cookiebar.entry.js +1 -1
  89. package/dist/esm/z-date-picker.entry.js +2 -2
  90. package/dist/esm/z-dragdrop-area_2.entry.js +0 -1
  91. package/dist/esm/z-file-upload.entry.js +2 -2
  92. package/dist/esm/z-file.entry.js +1 -2
  93. package/dist/esm/z-footer.entry.js +1 -1
  94. package/dist/esm/z-input-deprecated.entry.js +267 -0
  95. package/dist/esm/z-input-label_2.entry.js +267 -0
  96. package/dist/esm/z-input_2.entry.js +223 -0
  97. package/dist/esm/z-list-group.entry.js +50 -0
  98. package/dist/esm/z-list_2.entry.js +174 -0
  99. package/dist/esm/z-menu-dropdown_2.entry.js +4 -4
  100. package/dist/esm/z-messages-pocket.entry.js +1 -1
  101. package/dist/esm/z-modal-login.entry.js +1 -1
  102. package/dist/esm/z-myz-card-alert.entry.js +1 -1
  103. package/dist/esm/z-myz-card-dictionary.entry.js +1 -1
  104. package/dist/esm/z-myz-card-footer.entry.js +1 -1
  105. package/dist/esm/z-myz-card-info.entry.js +2 -2
  106. package/dist/esm/z-myz-card_4.entry.js +1 -1
  107. package/dist/esm/z-myz-list-item.entry.js +2 -2
  108. package/dist/esm/z-myz-topbar.entry.js +1 -1
  109. package/dist/esm/z-navigation-tab-link.entry.js +1 -1
  110. package/dist/esm/z-navigation-tab.entry.js +1 -1
  111. package/dist/esm/z-navigation-tabs.entry.js +1 -1
  112. package/dist/esm/z-otp.entry.js +1 -1
  113. package/dist/esm/z-pagination-bar.entry.js +2 -2
  114. package/dist/esm/z-pagination.entry.js +2 -2
  115. package/dist/esm/z-pocket_3.entry.js +2 -2
  116. package/dist/esm/z-popover.entry.js +2 -2
  117. package/dist/esm/z-section-title.entry.js +1 -1
  118. package/dist/esm/z-skip-to-content.entry.js +2 -2
  119. package/dist/esm/z-slideshow.entry.js +2 -2
  120. package/dist/esm/z-status-tag.entry.js +1 -1
  121. package/dist/esm/z-table-cell.entry.js +1 -1
  122. package/dist/esm/z-table-header.entry.js +2 -2
  123. package/dist/esm/z-table-row.entry.js +1 -1
  124. package/dist/esm/z-table.entry.js +1 -1
  125. package/dist/esm/z-toast-notification-list.entry.js +1 -1
  126. package/dist/esm/z-toast-notification.entry.js +1 -1
  127. package/dist/esm/z-toggle-switch.entry.js +3 -3
  128. package/dist/esm/z-tooltip.entry.js +1 -1
  129. package/dist/types/beans/index.d.ts +6 -7
  130. package/dist/types/components/buttons/z-toggle-switch/index.d.ts +2 -2
  131. package/dist/types/components/inputs/z-input/index.d.ts +16 -29
  132. package/dist/types/components/inputs/z-select/index.d.ts +11 -17
  133. package/dist/types/components.d.ts +191 -30
  134. package/dist/types/deprecated/z-input-deprecated/index.d.ts +102 -0
  135. package/dist/types/{components/inputs → deprecated}/z-input-label/index.d.ts +0 -0
  136. package/dist/types/utils/utils.d.ts +5 -0
  137. package/dist/web-components-library/index.esm.js +1 -1
  138. package/{www/build/p-e9b90127.entry.js → dist/web-components-library/p-02ea7e49.entry.js} +1 -1
  139. package/dist/web-components-library/{p-21b9a94f.entry.js → p-08fa0a33.entry.js} +1 -1
  140. package/{www/build/p-e4b4b2e4.entry.js → dist/web-components-library/p-0a0aee35.entry.js} +1 -1
  141. package/dist/web-components-library/{p-2e510e79.entry.js → p-0d29d851.entry.js} +1 -1
  142. package/dist/web-components-library/{p-b0ea8c0e.entry.js → p-0ef6c549.entry.js} +1 -1
  143. package/dist/web-components-library/{p-4c282f06.entry.js → p-0f17db30.entry.js} +1 -1
  144. package/dist/web-components-library/{p-a391566a.entry.js → p-12af8652.entry.js} +1 -1
  145. package/dist/web-components-library/{p-3184d969.entry.js → p-1727c1c8.entry.js} +1 -1
  146. package/dist/web-components-library/{p-e7aadd3d.entry.js → p-20d62443.entry.js} +1 -1
  147. package/dist/web-components-library/{p-cd2ca92b.entry.js → p-3252be36.entry.js} +1 -1
  148. package/dist/web-components-library/{p-1b973c72.entry.js → p-3c111c2a.entry.js} +1 -1
  149. package/dist/web-components-library/{p-9721e132.entry.js → p-43329b81.entry.js} +1 -1
  150. package/dist/web-components-library/{p-9935973a.entry.js → p-4af112a7.entry.js} +1 -1
  151. package/dist/web-components-library/{p-03de95f1.entry.js → p-51cdabeb.entry.js} +1 -1
  152. package/dist/web-components-library/p-562e2d52.entry.js +1 -0
  153. package/dist/web-components-library/{p-709ab23c.entry.js → p-57d1acdc.entry.js} +1 -1
  154. package/dist/web-components-library/{p-0398165f.entry.js → p-5be162d5.entry.js} +1 -1
  155. package/{www/build/p-7e71d9b0.entry.js → dist/web-components-library/p-5eacbfc7.entry.js} +1 -1
  156. package/dist/web-components-library/{p-223bec2f.entry.js → p-63ccb013.entry.js} +1 -1
  157. package/dist/web-components-library/p-69ef6ddc.entry.js +1 -0
  158. package/dist/web-components-library/p-71accd8e.entry.js +1 -0
  159. package/dist/web-components-library/{p-56437e20.entry.js → p-7c6d4440.entry.js} +1 -1
  160. package/dist/web-components-library/p-99d7ab2f.entry.js +1 -0
  161. package/dist/web-components-library/{p-2ff952a3.entry.js → p-9aa5d36c.entry.js} +1 -1
  162. package/dist/web-components-library/p-9f5d707a.js +1 -0
  163. package/dist/web-components-library/{p-2711bc32.entry.js → p-9f9e4266.entry.js} +1 -1
  164. package/dist/web-components-library/{p-cce20009.entry.js → p-a851af81.entry.js} +1 -1
  165. package/dist/web-components-library/{p-d9d9d834.entry.js → p-a8875b97.entry.js} +2 -2
  166. package/dist/web-components-library/{p-adad78fc.entry.js → p-ae60bbdf.entry.js} +1 -1
  167. package/dist/web-components-library/p-b574d5f6.entry.js +1 -0
  168. package/dist/web-components-library/p-b9da171f.js +1 -0
  169. package/dist/web-components-library/{p-aae632ef.entry.js → p-ba29bc12.entry.js} +1 -1
  170. package/dist/web-components-library/p-bd886dd5.entry.js +1 -0
  171. package/dist/web-components-library/{p-542b3702.entry.js → p-bfe5693d.entry.js} +1 -1
  172. package/dist/web-components-library/{p-2b8975b1.entry.js → p-c9cdf4ee.entry.js} +1 -1
  173. package/dist/web-components-library/{p-dfc18671.entry.js → p-ccdebe3f.entry.js} +1 -1
  174. package/{www/build/p-8a637cae.entry.js → dist/web-components-library/p-cd8950d2.entry.js} +1 -1
  175. package/dist/web-components-library/{p-c787ea21.entry.js → p-d33fea26.entry.js} +1 -1
  176. package/dist/web-components-library/p-d8069dab.entry.js +1 -0
  177. package/dist/web-components-library/{p-f3080685.entry.js → p-d97a2db9.entry.js} +1 -1
  178. package/dist/web-components-library/{p-1eef76bb.entry.js → p-d995d9dc.entry.js} +1 -1
  179. package/dist/web-components-library/{p-895f636e.entry.js → p-de25c7f0.entry.js} +1 -1
  180. package/dist/web-components-library/{p-66fbe5b8.entry.js → p-df4e963b.entry.js} +1 -1
  181. package/dist/web-components-library/p-e2102da3.entry.js +1 -0
  182. package/dist/web-components-library/{p-459dab30.entry.js → p-e84d6807.entry.js} +1 -1
  183. package/dist/web-components-library/p-edb8d2ab.entry.js +1 -0
  184. package/dist/web-components-library/{p-0b590426.entry.js → p-f322c5f0.entry.js} +1 -1
  185. package/dist/web-components-library/{p-da7760a3.entry.js → p-f7c3e9c3.entry.js} +1 -1
  186. package/{www/build/p-dcf4d1b6.entry.js → dist/web-components-library/p-fa925198.entry.js} +1 -1
  187. package/dist/web-components-library/{p-2c823f4c.entry.js → p-fe927bf4.entry.js} +1 -1
  188. package/dist/web-components-library/web-components-library.esm.js +1 -1
  189. package/package.json +1 -1
  190. package/react/components.d.ts +1 -0
  191. package/react/components.js +4 -3
  192. package/react/components.js.map +1 -1
  193. package/src-react/index.ts +1 -0
  194. package/www/build/index.esm.js +1 -1
  195. package/{dist/web-components-library/p-e9b90127.entry.js → www/build/p-02ea7e49.entry.js} +1 -1
  196. package/www/build/{p-21b9a94f.entry.js → p-08fa0a33.entry.js} +1 -1
  197. package/{dist/web-components-library/p-e4b4b2e4.entry.js → www/build/p-0a0aee35.entry.js} +1 -1
  198. package/www/build/{p-2e510e79.entry.js → p-0d29d851.entry.js} +1 -1
  199. package/www/build/{p-b0ea8c0e.entry.js → p-0ef6c549.entry.js} +1 -1
  200. package/www/build/{p-4c282f06.entry.js → p-0f17db30.entry.js} +1 -1
  201. package/www/build/{p-a391566a.entry.js → p-12af8652.entry.js} +1 -1
  202. package/www/build/{p-3184d969.entry.js → p-1727c1c8.entry.js} +1 -1
  203. package/www/build/{p-e7aadd3d.entry.js → p-20d62443.entry.js} +1 -1
  204. package/www/build/{p-cd2ca92b.entry.js → p-3252be36.entry.js} +1 -1
  205. package/www/build/{p-1b973c72.entry.js → p-3c111c2a.entry.js} +1 -1
  206. package/www/build/{p-9721e132.entry.js → p-43329b81.entry.js} +1 -1
  207. package/www/build/{p-9935973a.entry.js → p-4af112a7.entry.js} +1 -1
  208. package/www/build/{p-03de95f1.entry.js → p-51cdabeb.entry.js} +1 -1
  209. package/www/build/p-562e2d52.entry.js +1 -0
  210. package/www/build/{p-709ab23c.entry.js → p-57d1acdc.entry.js} +1 -1
  211. package/www/build/{p-0398165f.entry.js → p-5be162d5.entry.js} +1 -1
  212. package/{dist/web-components-library/p-7e71d9b0.entry.js → www/build/p-5eacbfc7.entry.js} +1 -1
  213. package/www/build/{p-223bec2f.entry.js → p-63ccb013.entry.js} +1 -1
  214. package/www/build/p-69ef6ddc.entry.js +1 -0
  215. package/www/build/p-71accd8e.entry.js +1 -0
  216. package/www/build/{p-56437e20.entry.js → p-7c6d4440.entry.js} +1 -1
  217. package/www/build/p-99d7ab2f.entry.js +1 -0
  218. package/www/build/{p-2ff952a3.entry.js → p-9aa5d36c.entry.js} +1 -1
  219. package/www/build/p-9f5d707a.js +1 -0
  220. package/www/build/{p-2711bc32.entry.js → p-9f9e4266.entry.js} +1 -1
  221. package/www/build/{p-cce20009.entry.js → p-a851af81.entry.js} +1 -1
  222. package/www/build/{p-d9d9d834.entry.js → p-a8875b97.entry.js} +2 -2
  223. package/www/build/{p-adad78fc.entry.js → p-ae60bbdf.entry.js} +1 -1
  224. package/www/build/p-b574d5f6.entry.js +1 -0
  225. package/www/build/p-b9da171f.js +1 -0
  226. package/www/build/{p-aae632ef.entry.js → p-ba29bc12.entry.js} +1 -1
  227. package/www/build/p-bd886dd5.entry.js +1 -0
  228. package/www/build/{p-542b3702.entry.js → p-bfe5693d.entry.js} +1 -1
  229. package/www/build/{p-2b8975b1.entry.js → p-c9cdf4ee.entry.js} +1 -1
  230. package/www/build/{p-dfc18671.entry.js → p-ccdebe3f.entry.js} +1 -1
  231. package/{dist/web-components-library/p-8a637cae.entry.js → www/build/p-cd8950d2.entry.js} +1 -1
  232. package/www/build/{p-c787ea21.entry.js → p-d33fea26.entry.js} +1 -1
  233. package/www/build/p-d8069dab.entry.js +1 -0
  234. package/www/build/{p-f3080685.entry.js → p-d97a2db9.entry.js} +1 -1
  235. package/www/build/{p-1eef76bb.entry.js → p-d995d9dc.entry.js} +1 -1
  236. package/www/build/{p-895f636e.entry.js → p-de25c7f0.entry.js} +1 -1
  237. package/www/build/{p-66fbe5b8.entry.js → p-df4e963b.entry.js} +1 -1
  238. package/www/build/p-e2102da3.entry.js +1 -0
  239. package/www/build/p-e76afdbc.js +1 -0
  240. package/www/build/{p-459dab30.entry.js → p-e84d6807.entry.js} +1 -1
  241. package/www/build/p-edb8d2ab.entry.js +1 -0
  242. package/www/build/{p-0b590426.entry.js → p-f322c5f0.entry.js} +1 -1
  243. package/www/build/{p-da7760a3.entry.js → p-f7c3e9c3.entry.js} +1 -1
  244. package/{dist/web-components-library/p-dcf4d1b6.entry.js → www/build/p-fa925198.entry.js} +1 -1
  245. package/www/build/{p-2c823f4c.entry.js → p-fe927bf4.entry.js} +1 -1
  246. package/www/build/web-components-library.esm.js +1 -1
  247. package/www/index.html +1 -1
  248. package/dist/cjs/z-button-filter_5.cjs.entry.js +0 -620
  249. package/dist/esm/z-button-filter_5.entry.js +0 -612
  250. package/dist/esm/z-list_3.entry.js +0 -220
  251. package/dist/web-components-library/p-14c9344f.entry.js +0 -1
  252. package/dist/web-components-library/p-57270965.entry.js +0 -1
  253. package/dist/web-components-library/p-70be81b6.entry.js +0 -1
  254. package/dist/web-components-library/p-80369bb8.entry.js +0 -1
  255. package/dist/web-components-library/p-80a3e18a.js +0 -1
  256. package/dist/web-components-library/p-a785ff38.entry.js +0 -1
  257. package/dist/web-components-library/p-fea5b98f.js +0 -1
  258. package/www/build/p-14c9344f.entry.js +0 -1
  259. package/www/build/p-57270965.entry.js +0 -1
  260. package/www/build/p-70be81b6.entry.js +0 -1
  261. package/www/build/p-80369bb8.entry.js +0 -1
  262. package/www/build/p-80a3e18a.js +0 -1
  263. package/www/build/p-a785ff38.entry.js +0 -1
  264. package/www/build/p-b058084c.js +0 -1
  265. package/www/build/p-fea5b98f.js +0 -1
@@ -0,0 +1,824 @@
1
+ import { Component, Prop, State, h, Method, Event, Element, Listen, } from "@stencil/core";
2
+ import { InputTypeEnum, } from "../../beans";
3
+ import { randomId } from "../../utils/utils";
4
+ export class ZInputDeprecated {
5
+ constructor() {
6
+ /** the id of the input element */
7
+ this.htmlid = `id-${randomId()}`;
8
+ /** the input is disabled */
9
+ this.disabled = false;
10
+ /** the input is readonly */
11
+ this.readonly = false;
12
+ /** the input is required (optional): available for text, password, number, email, textarea, checkbox */
13
+ this.required = false;
14
+ /** checked: available for checkbox, radio */
15
+ this.checked = false;
16
+ /** show input helper message (optional): available for text, password, number, email, textarea, select */
17
+ this.hasmessage = true;
18
+ /** the input label position: available for checkbox, radio */
19
+ this.labelafter = true;
20
+ /** timeout setting before trigger `inputChange` event (optional): available for text, textarea */
21
+ this.typingtimeout = 300;
22
+ /** multiple options can be selected (optional): available for select */
23
+ this.multiple = false;
24
+ /** render clear icon when typing (optional): available for text */
25
+ this.hasclearicon = true;
26
+ this.isTyping = false;
27
+ this.textareaWrapperHover = "";
28
+ this.textareaWrapperFocus = "";
29
+ this.passwordHidden = true;
30
+ }
31
+ inputCheckListener(e) {
32
+ const data = e.detail;
33
+ switch (this.type) {
34
+ case InputTypeEnum.radio:
35
+ if (data.type === InputTypeEnum.radio &&
36
+ data.name === this.name &&
37
+ data.id !== this.htmlid) {
38
+ this.checked = false;
39
+ }
40
+ default:
41
+ return;
42
+ }
43
+ }
44
+ /** get the input value */
45
+ async getValue() {
46
+ switch (this.type) {
47
+ // @ts-ignore
48
+ case "select":
49
+ return this.selectElem.getValue();
50
+ default:
51
+ return this.value;
52
+ }
53
+ }
54
+ /** set the input value */
55
+ async setValue(value) {
56
+ switch (this.type) {
57
+ // @ts-ignore
58
+ case "select":
59
+ this.selectElem.setValue(value);
60
+ break;
61
+ default:
62
+ if (typeof value === "string")
63
+ this.value = value;
64
+ break;
65
+ }
66
+ }
67
+ /** get checked status */
68
+ async isChecked() {
69
+ switch (this.type) {
70
+ case InputTypeEnum.checkbox:
71
+ case InputTypeEnum.radio:
72
+ return this.checked;
73
+ default:
74
+ return false;
75
+ }
76
+ }
77
+ emitInputChange(value, keycode) {
78
+ if (!this.isTyping) {
79
+ this.emitStartTyping();
80
+ }
81
+ let validity = {};
82
+ if (this.type === InputTypeEnum.textarea) {
83
+ validity = this.getValidity("textarea");
84
+ }
85
+ else {
86
+ validity = this.getValidity("input");
87
+ }
88
+ this.value = value;
89
+ this.inputChange.emit({ value, keycode, validity });
90
+ clearTimeout(this.timer);
91
+ this.timer = setTimeout(() => {
92
+ this.emitStopTyping(this.value, validity);
93
+ }, this.typingtimeout);
94
+ }
95
+ emitStartTyping() {
96
+ this.isTyping = true;
97
+ this.startTyping.emit();
98
+ }
99
+ emitStopTyping(value, validity) {
100
+ this.isTyping = false;
101
+ this.stopTyping.emit({
102
+ value: value,
103
+ validity: validity,
104
+ });
105
+ }
106
+ emitInputCheck(checked) {
107
+ this.inputCheck.emit({
108
+ id: this.htmlid,
109
+ checked: checked,
110
+ type: this.type,
111
+ name: this.name,
112
+ value: this.value,
113
+ validity: this.getValidity("input"),
114
+ });
115
+ }
116
+ getValidity(type) {
117
+ const input = this.hostElement.querySelector(type);
118
+ return input.validity;
119
+ }
120
+ /* START text/password/email/number */
121
+ getTextAttributes() {
122
+ const attr = {
123
+ id: this.htmlid,
124
+ name: this.name,
125
+ placeholder: this.placeholder,
126
+ value: this.value,
127
+ disabled: this.disabled,
128
+ readonly: this.readonly,
129
+ required: this.required,
130
+ title: this.htmltitle,
131
+ class: [
132
+ `input_${this.status || "default"}`,
133
+ this.isTyping && "istyping",
134
+ !this.isTyping && this.value && "filled",
135
+ ]
136
+ .filter(Boolean)
137
+ .join(" "),
138
+ onInput: (e) => this.emitInputChange(e.target.value, e.keyCode),
139
+ };
140
+ if (this.autocomplete) {
141
+ attr["autocomplete"] = this.autocomplete;
142
+ }
143
+ return attr;
144
+ }
145
+ renderInputText(type = InputTypeEnum.text) {
146
+ const attr = this.getTextAttributes();
147
+ if (this.icon || type === InputTypeEnum.password) {
148
+ attr.class += " hasIcon";
149
+ }
150
+ if (this.hasclearicon) {
151
+ attr.class += " hasClearIcon";
152
+ }
153
+ return (h("div", { class: "textWrapper" },
154
+ this.renderLabel(),
155
+ h("div", null,
156
+ h("input", Object.assign({ type: type === InputTypeEnum.password && !this.passwordHidden
157
+ ? InputTypeEnum.text
158
+ : type }, attr, { "aria-label": this.ariaLabel || this.label })),
159
+ this.renderIcons()),
160
+ this.renderMessage()));
161
+ }
162
+ renderLabel() {
163
+ if (!this.label)
164
+ return;
165
+ return (h("z-input-label", { htmlfor: this.htmlid, value: this.label, disabled: this.disabled, "aria-label": this.label, id: `${this.htmlid}_label` }));
166
+ }
167
+ renderIcons() {
168
+ return (h("span", { class: {
169
+ iconsWrapper: true,
170
+ disabled: this.disabled,
171
+ } },
172
+ this.renderResetIcon(),
173
+ this.renderIcon()));
174
+ }
175
+ renderIcon() {
176
+ if (this.type === InputTypeEnum.password) {
177
+ return this.renderShowHidePassword();
178
+ }
179
+ if (!this.icon)
180
+ return;
181
+ return h("z-icon", { class: "inputIcon", name: this.icon });
182
+ }
183
+ renderResetIcon() {
184
+ if (!this.hasclearicon || !this.value || this.disabled || this.readonly)
185
+ return;
186
+ return (h("z-icon", { class: "resetIcon", name: "multiply", onClick: (e) => this.emitInputChange("", e.keyCode) }));
187
+ }
188
+ renderShowHidePassword() {
189
+ return (h("z-icon", { class: "showHidePasswordIcon", name: this.passwordHidden ? "view-filled" : "view-off-filled", onClick: () => (this.passwordHidden = !this.passwordHidden) }));
190
+ }
191
+ renderMessage() {
192
+ if (!this.hasmessage)
193
+ return;
194
+ return h("z-input-message", { message: this.message, status: this.status });
195
+ }
196
+ /* END text/password/email/number */
197
+ /* START textarea */
198
+ renderTextarea() {
199
+ const attributes = this.getTextAttributes();
200
+ return (h("div", { class: "textWrapper" },
201
+ this.renderLabel(),
202
+ h("div", { class: [
203
+ "textareaWrapper",
204
+ attributes.class,
205
+ attributes.disabled && "disabled",
206
+ attributes.readonly && "readonly",
207
+ this.isTyping && "istyping",
208
+ this.textareaWrapperFocus,
209
+ this.textareaWrapperHover,
210
+ ]
211
+ .filter(Boolean)
212
+ .join(" ") },
213
+ 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 }))),
214
+ this.renderMessage()));
215
+ }
216
+ /* END textarea */
217
+ handleCheck(ev) {
218
+ this.checked = ev.target.checked;
219
+ this.emitInputCheck(this.checked);
220
+ }
221
+ /* START checkbox */
222
+ renderCheckbox() {
223
+ return (h("div", { class: "checkboxWrapper" },
224
+ 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 }),
225
+ h("label", { htmlFor: this.htmlid, class: {
226
+ checkboxLabel: true,
227
+ after: this.labelafter,
228
+ before: !this.labelafter,
229
+ } },
230
+ h("z-icon", { name: this.checked ? "checkbox-checked" : "checkbox", "aria-hidden": "true" }),
231
+ this.label && h("span", { innerHTML: this.label }))));
232
+ }
233
+ /* END checkbox */
234
+ /* START radio */
235
+ renderRadio() {
236
+ return (h("div", { class: "radioWrapper" },
237
+ 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 }),
238
+ h("label", { htmlFor: this.htmlid, class: {
239
+ radioLabel: true,
240
+ after: this.labelafter,
241
+ before: !this.labelafter,
242
+ } },
243
+ h("z-icon", { name: this.checked ? "radio-button-checked" : "radio-button", "aria-hidden": "true" }),
244
+ this.label && h("span", { innerHTML: this.label }))));
245
+ }
246
+ /* END radio */
247
+ /* START select */
248
+ renderSelect() {
249
+ 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, message: !this.hasmessage ? false : this.message, autocomplete: this.autocomplete, ref: (el) => (this.selectElem = el) }));
250
+ }
251
+ /* END select */
252
+ render() {
253
+ switch (this.type) {
254
+ case InputTypeEnum.text:
255
+ case InputTypeEnum.password:
256
+ case InputTypeEnum.number:
257
+ case InputTypeEnum.email:
258
+ return this.renderInputText(this.type);
259
+ case InputTypeEnum.textarea:
260
+ return this.renderTextarea();
261
+ case InputTypeEnum.checkbox:
262
+ return this.renderCheckbox();
263
+ case InputTypeEnum.radio:
264
+ return this.renderRadio();
265
+ // @ts-ignore
266
+ case "select":
267
+ return this.renderSelect();
268
+ default:
269
+ return this.renderInputText();
270
+ }
271
+ }
272
+ static get is() { return "z-input-deprecated"; }
273
+ static get encapsulation() { return "scoped"; }
274
+ static get originalStyleUrls() { return {
275
+ "$": ["styles.css"]
276
+ }; }
277
+ static get styleUrls() { return {
278
+ "$": ["styles.css"]
279
+ }; }
280
+ static get properties() { return {
281
+ "htmlid": {
282
+ "type": "string",
283
+ "mutable": false,
284
+ "complexType": {
285
+ "original": "string",
286
+ "resolved": "string",
287
+ "references": {}
288
+ },
289
+ "required": false,
290
+ "optional": false,
291
+ "docs": {
292
+ "tags": [],
293
+ "text": "the id of the input element"
294
+ },
295
+ "attribute": "htmlid",
296
+ "reflect": false,
297
+ "defaultValue": "`id-${randomId()}`"
298
+ },
299
+ "type": {
300
+ "type": "string",
301
+ "mutable": false,
302
+ "complexType": {
303
+ "original": "InputTypeBean",
304
+ "resolved": "\"checkbox\" | \"email\" | \"number\" | \"password\" | \"radio\" | \"text\" | \"textarea\"",
305
+ "references": {
306
+ "InputTypeBean": {
307
+ "location": "import",
308
+ "path": "../../beans"
309
+ }
310
+ }
311
+ },
312
+ "required": false,
313
+ "optional": false,
314
+ "docs": {
315
+ "tags": [],
316
+ "text": "input types"
317
+ },
318
+ "attribute": "type",
319
+ "reflect": false
320
+ },
321
+ "name": {
322
+ "type": "string",
323
+ "mutable": false,
324
+ "complexType": {
325
+ "original": "string",
326
+ "resolved": "string",
327
+ "references": {}
328
+ },
329
+ "required": false,
330
+ "optional": true,
331
+ "docs": {
332
+ "tags": [],
333
+ "text": "the input name"
334
+ },
335
+ "attribute": "name",
336
+ "reflect": false
337
+ },
338
+ "label": {
339
+ "type": "string",
340
+ "mutable": false,
341
+ "complexType": {
342
+ "original": "string",
343
+ "resolved": "string",
344
+ "references": {}
345
+ },
346
+ "required": false,
347
+ "optional": true,
348
+ "docs": {
349
+ "tags": [],
350
+ "text": "the input label"
351
+ },
352
+ "attribute": "label",
353
+ "reflect": false
354
+ },
355
+ "ariaLabel": {
356
+ "type": "string",
357
+ "mutable": false,
358
+ "complexType": {
359
+ "original": "string",
360
+ "resolved": "string",
361
+ "references": {}
362
+ },
363
+ "required": false,
364
+ "optional": true,
365
+ "docs": {
366
+ "tags": [],
367
+ "text": "the input aria-label"
368
+ },
369
+ "attribute": "aria-label",
370
+ "reflect": false
371
+ },
372
+ "value": {
373
+ "type": "string",
374
+ "mutable": true,
375
+ "complexType": {
376
+ "original": "string",
377
+ "resolved": "string",
378
+ "references": {}
379
+ },
380
+ "required": false,
381
+ "optional": true,
382
+ "docs": {
383
+ "tags": [],
384
+ "text": "the input value"
385
+ },
386
+ "attribute": "value",
387
+ "reflect": false
388
+ },
389
+ "disabled": {
390
+ "type": "boolean",
391
+ "mutable": false,
392
+ "complexType": {
393
+ "original": "boolean",
394
+ "resolved": "boolean",
395
+ "references": {}
396
+ },
397
+ "required": false,
398
+ "optional": true,
399
+ "docs": {
400
+ "tags": [],
401
+ "text": "the input is disabled"
402
+ },
403
+ "attribute": "disabled",
404
+ "reflect": false,
405
+ "defaultValue": "false"
406
+ },
407
+ "readonly": {
408
+ "type": "boolean",
409
+ "mutable": false,
410
+ "complexType": {
411
+ "original": "boolean",
412
+ "resolved": "boolean",
413
+ "references": {}
414
+ },
415
+ "required": false,
416
+ "optional": true,
417
+ "docs": {
418
+ "tags": [],
419
+ "text": "the input is readonly"
420
+ },
421
+ "attribute": "readonly",
422
+ "reflect": false,
423
+ "defaultValue": "false"
424
+ },
425
+ "required": {
426
+ "type": "boolean",
427
+ "mutable": false,
428
+ "complexType": {
429
+ "original": "boolean",
430
+ "resolved": "boolean",
431
+ "references": {}
432
+ },
433
+ "required": false,
434
+ "optional": true,
435
+ "docs": {
436
+ "tags": [],
437
+ "text": "the input is required (optional): available for text, password, number, email, textarea, checkbox"
438
+ },
439
+ "attribute": "required",
440
+ "reflect": false,
441
+ "defaultValue": "false"
442
+ },
443
+ "checked": {
444
+ "type": "boolean",
445
+ "mutable": true,
446
+ "complexType": {
447
+ "original": "boolean",
448
+ "resolved": "boolean",
449
+ "references": {}
450
+ },
451
+ "required": false,
452
+ "optional": true,
453
+ "docs": {
454
+ "tags": [],
455
+ "text": "checked: available for checkbox, radio"
456
+ },
457
+ "attribute": "checked",
458
+ "reflect": false,
459
+ "defaultValue": "false"
460
+ },
461
+ "placeholder": {
462
+ "type": "string",
463
+ "mutable": false,
464
+ "complexType": {
465
+ "original": "string",
466
+ "resolved": "string",
467
+ "references": {}
468
+ },
469
+ "required": false,
470
+ "optional": true,
471
+ "docs": {
472
+ "tags": [],
473
+ "text": "the input placeholder (optional)"
474
+ },
475
+ "attribute": "placeholder",
476
+ "reflect": false
477
+ },
478
+ "htmltitle": {
479
+ "type": "string",
480
+ "mutable": false,
481
+ "complexType": {
482
+ "original": "string",
483
+ "resolved": "string",
484
+ "references": {}
485
+ },
486
+ "required": false,
487
+ "optional": true,
488
+ "docs": {
489
+ "tags": [],
490
+ "text": "the input html title (optional)"
491
+ },
492
+ "attribute": "htmltitle",
493
+ "reflect": false
494
+ },
495
+ "status": {
496
+ "type": "string",
497
+ "mutable": false,
498
+ "complexType": {
499
+ "original": "InputStatusBean",
500
+ "resolved": "\"error\" | \"success\" | \"warning\"",
501
+ "references": {
502
+ "InputStatusBean": {
503
+ "location": "import",
504
+ "path": "../../beans"
505
+ }
506
+ }
507
+ },
508
+ "required": false,
509
+ "optional": true,
510
+ "docs": {
511
+ "tags": [],
512
+ "text": "the input status (optional): available for text, password, number, email, textarea, select"
513
+ },
514
+ "attribute": "status",
515
+ "reflect": false
516
+ },
517
+ "hasmessage": {
518
+ "type": "boolean",
519
+ "mutable": false,
520
+ "complexType": {
521
+ "original": "boolean",
522
+ "resolved": "boolean",
523
+ "references": {}
524
+ },
525
+ "required": false,
526
+ "optional": true,
527
+ "docs": {
528
+ "tags": [],
529
+ "text": "show input helper message (optional): available for text, password, number, email, textarea, select"
530
+ },
531
+ "attribute": "hasmessage",
532
+ "reflect": false,
533
+ "defaultValue": "true"
534
+ },
535
+ "message": {
536
+ "type": "string",
537
+ "mutable": false,
538
+ "complexType": {
539
+ "original": "string",
540
+ "resolved": "string",
541
+ "references": {}
542
+ },
543
+ "required": false,
544
+ "optional": true,
545
+ "docs": {
546
+ "tags": [],
547
+ "text": "input helper message (optional): available for text, password, number, email, textarea, select"
548
+ },
549
+ "attribute": "message",
550
+ "reflect": false
551
+ },
552
+ "labelafter": {
553
+ "type": "boolean",
554
+ "mutable": false,
555
+ "complexType": {
556
+ "original": "boolean",
557
+ "resolved": "boolean",
558
+ "references": {}
559
+ },
560
+ "required": false,
561
+ "optional": true,
562
+ "docs": {
563
+ "tags": [],
564
+ "text": "the input label position: available for checkbox, radio"
565
+ },
566
+ "attribute": "labelafter",
567
+ "reflect": false,
568
+ "defaultValue": "true"
569
+ },
570
+ "typingtimeout": {
571
+ "type": "number",
572
+ "mutable": false,
573
+ "complexType": {
574
+ "original": "number",
575
+ "resolved": "number",
576
+ "references": {}
577
+ },
578
+ "required": false,
579
+ "optional": true,
580
+ "docs": {
581
+ "tags": [],
582
+ "text": "timeout setting before trigger `inputChange` event (optional): available for text, textarea"
583
+ },
584
+ "attribute": "typingtimeout",
585
+ "reflect": false,
586
+ "defaultValue": "300"
587
+ },
588
+ "items": {
589
+ "type": "string",
590
+ "mutable": false,
591
+ "complexType": {
592
+ "original": "SelectItemBean[] | string",
593
+ "resolved": "SelectItemBean[] | string",
594
+ "references": {
595
+ "SelectItemBean": {
596
+ "location": "import",
597
+ "path": "../../beans"
598
+ }
599
+ }
600
+ },
601
+ "required": false,
602
+ "optional": true,
603
+ "docs": {
604
+ "tags": [],
605
+ "text": "items (optional): available for select"
606
+ },
607
+ "attribute": "items",
608
+ "reflect": false
609
+ },
610
+ "autocomplete": {
611
+ "type": "any",
612
+ "mutable": false,
613
+ "complexType": {
614
+ "original": "boolean | string",
615
+ "resolved": "boolean | string",
616
+ "references": {}
617
+ },
618
+ "required": false,
619
+ "optional": true,
620
+ "docs": {
621
+ "tags": [],
622
+ "text": "the input has autocomplete option (optional): available for select, input"
623
+ },
624
+ "attribute": "autocomplete",
625
+ "reflect": false
626
+ },
627
+ "multiple": {
628
+ "type": "boolean",
629
+ "mutable": false,
630
+ "complexType": {
631
+ "original": "boolean",
632
+ "resolved": "boolean",
633
+ "references": {}
634
+ },
635
+ "required": false,
636
+ "optional": true,
637
+ "docs": {
638
+ "tags": [],
639
+ "text": "multiple options can be selected (optional): available for select"
640
+ },
641
+ "attribute": "multiple",
642
+ "reflect": false,
643
+ "defaultValue": "false"
644
+ },
645
+ "hasclearicon": {
646
+ "type": "boolean",
647
+ "mutable": false,
648
+ "complexType": {
649
+ "original": "boolean",
650
+ "resolved": "boolean",
651
+ "references": {}
652
+ },
653
+ "required": false,
654
+ "optional": true,
655
+ "docs": {
656
+ "tags": [],
657
+ "text": "render clear icon when typing (optional): available for text"
658
+ },
659
+ "attribute": "hasclearicon",
660
+ "reflect": false,
661
+ "defaultValue": "true"
662
+ },
663
+ "icon": {
664
+ "type": "string",
665
+ "mutable": false,
666
+ "complexType": {
667
+ "original": "string",
668
+ "resolved": "string",
669
+ "references": {}
670
+ },
671
+ "required": false,
672
+ "optional": true,
673
+ "docs": {
674
+ "tags": [],
675
+ "text": "render icon (optional): available for text, select"
676
+ },
677
+ "attribute": "icon",
678
+ "reflect": false
679
+ }
680
+ }; }
681
+ static get states() { return {
682
+ "isTyping": {},
683
+ "textareaWrapperHover": {},
684
+ "textareaWrapperFocus": {},
685
+ "passwordHidden": {}
686
+ }; }
687
+ static get events() { return [{
688
+ "method": "inputChange",
689
+ "name": "inputChange",
690
+ "bubbles": true,
691
+ "cancelable": true,
692
+ "composed": true,
693
+ "docs": {
694
+ "tags": [],
695
+ "text": "Emitted on input value change, returns value, keycode, validity"
696
+ },
697
+ "complexType": {
698
+ "original": "any",
699
+ "resolved": "any",
700
+ "references": {}
701
+ }
702
+ }, {
703
+ "method": "startTyping",
704
+ "name": "startTyping",
705
+ "bubbles": true,
706
+ "cancelable": true,
707
+ "composed": true,
708
+ "docs": {
709
+ "tags": [],
710
+ "text": "Emitted when user starts typing"
711
+ },
712
+ "complexType": {
713
+ "original": "any",
714
+ "resolved": "any",
715
+ "references": {}
716
+ }
717
+ }, {
718
+ "method": "stopTyping",
719
+ "name": "stopTyping",
720
+ "bubbles": true,
721
+ "cancelable": true,
722
+ "composed": true,
723
+ "docs": {
724
+ "tags": [],
725
+ "text": "Emitted when user stops typing, returns value, validity"
726
+ },
727
+ "complexType": {
728
+ "original": "any",
729
+ "resolved": "any",
730
+ "references": {}
731
+ }
732
+ }, {
733
+ "method": "inputCheck",
734
+ "name": "inputCheck",
735
+ "bubbles": true,
736
+ "cancelable": true,
737
+ "composed": true,
738
+ "docs": {
739
+ "tags": [],
740
+ "text": "Emitted on checkbox check/uncheck, returns id, checked, type, name, value, validity"
741
+ },
742
+ "complexType": {
743
+ "original": "any",
744
+ "resolved": "any",
745
+ "references": {}
746
+ }
747
+ }, {
748
+ "method": "optionSelect",
749
+ "name": "optionSelect",
750
+ "bubbles": true,
751
+ "cancelable": true,
752
+ "composed": true,
753
+ "docs": {
754
+ "tags": [],
755
+ "text": "Emitted on select option selection, returns select id, selected item id (or array of selected items ids if multiple)"
756
+ },
757
+ "complexType": {
758
+ "original": "any",
759
+ "resolved": "any",
760
+ "references": {}
761
+ }
762
+ }]; }
763
+ static get methods() { return {
764
+ "getValue": {
765
+ "complexType": {
766
+ "signature": "() => Promise<string | string[]>",
767
+ "parameters": [],
768
+ "references": {
769
+ "Promise": {
770
+ "location": "global"
771
+ }
772
+ },
773
+ "return": "Promise<string | string[]>"
774
+ },
775
+ "docs": {
776
+ "text": "get the input value",
777
+ "tags": []
778
+ }
779
+ },
780
+ "setValue": {
781
+ "complexType": {
782
+ "signature": "(value: string | string[]) => Promise<void>",
783
+ "parameters": [{
784
+ "tags": [],
785
+ "text": ""
786
+ }],
787
+ "references": {
788
+ "Promise": {
789
+ "location": "global"
790
+ }
791
+ },
792
+ "return": "Promise<void>"
793
+ },
794
+ "docs": {
795
+ "text": "set the input value",
796
+ "tags": []
797
+ }
798
+ },
799
+ "isChecked": {
800
+ "complexType": {
801
+ "signature": "() => Promise<boolean>",
802
+ "parameters": [],
803
+ "references": {
804
+ "Promise": {
805
+ "location": "global"
806
+ }
807
+ },
808
+ "return": "Promise<boolean>"
809
+ },
810
+ "docs": {
811
+ "text": "get checked status",
812
+ "tags": []
813
+ }
814
+ }
815
+ }; }
816
+ static get elementRef() { return "hostElement"; }
817
+ static get listeners() { return [{
818
+ "name": "inputCheck",
819
+ "method": "inputCheckListener",
820
+ "target": "document",
821
+ "capture": false,
822
+ "passive": false
823
+ }]; }
824
+ }