@nova-design-system/nova-webcomponents 3.0.0-beta.42 → 3.0.0-beta.44

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 (334) hide show
  1. package/dist/blazor-docs.json +2149 -261
  2. package/dist/cjs/index.cjs.js +472 -2
  3. package/dist/cjs/index.cjs.js.map +1 -1
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/native.cjs.js +1 -1
  6. package/dist/cjs/nv-badge_2.cjs.entry.js +4 -5
  7. package/dist/cjs/nv-badge_2.cjs.entry.js.map +1 -1
  8. package/dist/cjs/nv-base.cjs.entry.js +1 -1
  9. package/dist/cjs/nv-breadcrumb.cjs.entry.js +1 -1
  10. package/dist/cjs/nv-breadcrumbs.cjs.entry.js +1 -1
  11. package/dist/cjs/nv-button.cjs.entry.js +1 -1
  12. package/dist/cjs/nv-calendar.cjs.entry.js +5 -5
  13. package/dist/cjs/nv-calendar.cjs.entry.js.map +1 -1
  14. package/dist/cjs/nv-col.cjs.entry.js +1 -1
  15. package/dist/cjs/nv-datagrid.cjs.entry.js +3 -3
  16. package/dist/cjs/nv-datagrid.cjs.entry.js.map +1 -1
  17. package/dist/cjs/nv-datagridcolumn.cjs.entry.js +1 -1
  18. package/dist/cjs/nv-dialog.cjs.entry.js +1 -1
  19. package/dist/cjs/nv-dialog.cjs.entry.js.map +1 -1
  20. package/dist/cjs/nv-dialogfooter_2.cjs.entry.js +6 -6
  21. package/dist/cjs/nv-dialogfooter_2.cjs.entry.js.map +1 -1
  22. package/dist/cjs/nv-fieldcheckbox.cjs.entry.js +4 -4
  23. package/dist/cjs/nv-fielddate.cjs.entry.js +5 -5
  24. package/dist/cjs/nv-fielddaterange.cjs.entry.js +4 -4
  25. package/dist/cjs/nv-fielddropdown.cjs.entry.js +44 -74
  26. package/dist/cjs/nv-fielddropdown.cjs.entry.js.map +1 -1
  27. package/dist/cjs/nv-fielddropdownitem.cjs.entry.js +6 -8
  28. package/dist/cjs/nv-fielddropdownitem.cjs.entry.js.map +1 -1
  29. package/dist/cjs/nv-fieldnumber.cjs.entry.js +3 -3
  30. package/dist/cjs/nv-fieldpassword.cjs.entry.js +3 -3
  31. package/dist/cjs/nv-fieldradio.cjs.entry.js +3 -3
  32. package/dist/cjs/nv-fieldselect.cjs.entry.js +5 -5
  33. package/dist/cjs/nv-fieldtext.cjs.entry.js +3 -3
  34. package/dist/cjs/nv-fieldtextarea.cjs.entry.js +3 -3
  35. package/dist/cjs/nv-fieldtime.cjs.entry.js +9 -9
  36. package/dist/cjs/nv-icon.cjs.entry.js +2 -2
  37. package/dist/cjs/nv-icon.cjs.entry.js.map +1 -1
  38. package/dist/cjs/nv-iconbutton_2.cjs.entry.js +2 -2
  39. package/dist/cjs/nv-menu.cjs.entry.js +1 -1
  40. package/dist/cjs/nv-menuitem.cjs.entry.js +1 -1
  41. package/dist/cjs/nv-popover.cjs.entry.js +1 -1
  42. package/dist/cjs/nv-popover.cjs.entry.js.map +1 -1
  43. package/dist/cjs/nv-row.cjs.entry.js +1 -1
  44. package/dist/cjs/nv-stack.cjs.entry.js +1 -1
  45. package/dist/cjs/nv-table.cjs.entry.js +3 -3
  46. package/dist/cjs/nv-table.cjs.entry.js.map +1 -1
  47. package/dist/cjs/nv-toggle.cjs.entry.js +2 -2
  48. package/dist/cjs/nv-tooltip.cjs.entry.js +1 -1
  49. package/dist/cjs/nv-tooltip.cjs.entry.js.map +1 -1
  50. package/dist/collection/components/nv-badge/nv-badge.css +16 -0
  51. package/dist/collection/components/nv-badge/nv-badge.js +3 -3
  52. package/dist/collection/components/nv-badge/nv-badge.js.map +1 -1
  53. package/dist/collection/components/nv-base/nv-base.js +1 -1
  54. package/dist/collection/components/nv-breadcrumb/nv-breadcrumb.js +1 -1
  55. package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.js +1 -1
  56. package/dist/collection/components/nv-button/nv-button.js +1 -1
  57. package/dist/collection/components/nv-calendar/nv-calendar.css +129 -77
  58. package/dist/collection/components/nv-calendar/nv-calendar.js +4 -4
  59. package/dist/collection/components/nv-calendar/nv-calendar.js.map +1 -1
  60. package/dist/collection/components/nv-col/nv-col.js +1 -1
  61. package/dist/collection/components/nv-datagrid/nv-datagrid.css +4 -4
  62. package/dist/collection/components/nv-datagrid/nv-datagrid.js +2 -2
  63. package/dist/collection/components/nv-datagrid/nv-datagrid.js.map +1 -1
  64. package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js +1 -1
  65. package/dist/collection/components/nv-dialog/nv-dialog.js +1 -1
  66. package/dist/collection/components/nv-dialog/nv-dialog.js.map +1 -1
  67. package/dist/collection/components/nv-dialogfooter/nv-dialogfooter.js +7 -7
  68. package/dist/collection/components/nv-dialogfooter/nv-dialogfooter.js.map +1 -1
  69. package/dist/collection/components/nv-dialogheader/nv-dialogheader.js +1 -1
  70. package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.js +4 -4
  71. package/dist/collection/components/nv-fielddate/nv-fielddate.js +5 -5
  72. package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js +4 -4
  73. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js +44 -74
  74. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js.map +1 -1
  75. package/dist/collection/components/nv-fielddropdown/styles/nv-fielddropdown.css +3 -0
  76. package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.js +9 -11
  77. package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.js.map +1 -1
  78. package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.js +1 -1
  79. package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js +3 -3
  80. package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js +3 -3
  81. package/dist/collection/components/nv-fieldradio/nv-fieldradio.js +3 -3
  82. package/dist/collection/components/nv-fieldselect/nv-fieldselect.js +5 -5
  83. package/dist/collection/components/nv-fieldtext/nv-fieldtext.js +3 -3
  84. package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js +3 -3
  85. package/dist/collection/components/nv-fieldtime/nv-fieldtime.js +9 -9
  86. package/dist/collection/components/nv-icon/nv-icon.js +1 -1
  87. package/dist/collection/components/nv-icon/nv-icons.js +472 -2
  88. package/dist/collection/components/nv-icon/nv-icons.js.map +1 -1
  89. package/dist/collection/components/nv-iconbutton/nv-iconbutton.js +1 -1
  90. package/dist/collection/components/nv-loader/nv-loader.js +1 -1
  91. package/dist/collection/components/nv-menu/nv-menu.js +1 -1
  92. package/dist/collection/components/nv-menuitem/nv-menuitem.js +2 -2
  93. package/dist/collection/components/nv-popover/nv-popover.js +1 -1
  94. package/dist/collection/components/nv-popover/nv-popover.js.map +1 -1
  95. package/dist/collection/components/nv-row/nv-row.js +1 -1
  96. package/dist/collection/components/nv-stack/nv-stack.js +1 -1
  97. package/dist/collection/components/nv-table/nv-table.css +4 -4
  98. package/dist/collection/components/nv-table/nv-table.js +2 -2
  99. package/dist/collection/components/nv-toggle/nv-toggle.js +2 -2
  100. package/dist/collection/components/nv-tooltip/nv-tooltip.js +1 -1
  101. package/dist/collection/components/nv-tooltip/nv-tooltip.js.map +1 -1
  102. package/dist/components/index.js +472 -2
  103. package/dist/components/index.js.map +1 -1
  104. package/dist/components/nv-alert.js +1 -1
  105. package/dist/components/nv-avatar.js +1 -1
  106. package/dist/components/nv-badge.js +1 -1
  107. package/dist/components/nv-base.js +1 -1
  108. package/dist/components/nv-breadcrumb.js +3 -3
  109. package/dist/components/nv-breadcrumbs.js +1 -1
  110. package/dist/components/nv-button.js +1 -1
  111. package/dist/components/nv-calendar.js +1 -1
  112. package/dist/components/nv-col.js +1 -1
  113. package/dist/components/nv-datagrid.js +3 -3
  114. package/dist/components/nv-datagrid.js.map +1 -1
  115. package/dist/components/nv-datagridcolumn.js +1 -1
  116. package/dist/components/nv-dialog.js +6 -6
  117. package/dist/components/nv-dialog.js.map +1 -1
  118. package/dist/components/nv-dialogfooter.js +1 -1
  119. package/dist/components/nv-dialogheader.js +1 -1
  120. package/dist/components/nv-fieldcheckbox.js +1 -1
  121. package/dist/components/nv-fielddate.js +12 -12
  122. package/dist/components/nv-fielddaterange.js +11 -11
  123. package/dist/components/nv-fielddropdown.js +49 -79
  124. package/dist/components/nv-fielddropdown.js.map +1 -1
  125. package/dist/components/nv-fielddropdownitem.js +1 -1
  126. package/dist/components/nv-fielddropdownitemcheck.js +1 -1
  127. package/dist/components/nv-fieldmultiselect.js +7 -7
  128. package/dist/components/nv-fieldnumber.js +6 -6
  129. package/dist/components/nv-fieldpassword.js +6 -6
  130. package/dist/components/nv-fieldradio.js +3 -3
  131. package/dist/components/nv-fieldselect.js +8 -8
  132. package/dist/components/nv-fieldtext.js +4 -4
  133. package/dist/components/nv-fieldtextarea.js +3 -3
  134. package/dist/components/nv-fieldtime.js +13 -13
  135. package/dist/components/nv-icon.js +1 -1
  136. package/dist/components/nv-iconbutton.js +1 -1
  137. package/dist/components/nv-loader.js +1 -1
  138. package/dist/components/nv-menu.js +4 -4
  139. package/dist/components/nv-menuitem.js +1 -1
  140. package/dist/components/nv-popover.js +1 -1
  141. package/dist/components/nv-row.js +1 -1
  142. package/dist/components/nv-stack.js +1 -1
  143. package/dist/components/nv-table.js +3 -3
  144. package/dist/components/nv-table.js.map +1 -1
  145. package/dist/components/nv-toggle.js +2 -2
  146. package/dist/components/nv-tooltip.js +1 -1
  147. package/dist/components/{p-3aa6f6dc.js → p-016dbae8.js} +10 -10
  148. package/dist/components/p-016dbae8.js.map +1 -0
  149. package/dist/components/{p-1a4f9c97.js → p-0631d152.js} +3 -3
  150. package/dist/components/{p-1a4f9c97.js.map → p-0631d152.js.map} +1 -1
  151. package/dist/components/p-23b6b33b.js +88 -0
  152. package/dist/components/p-23b6b33b.js.map +1 -0
  153. package/dist/components/{p-a8b5969f.js → p-293e1a5c.js} +3 -3
  154. package/dist/components/{p-a8b5969f.js.map → p-293e1a5c.js.map} +1 -1
  155. package/dist/components/{p-1e095bba.js → p-3a74719c.js} +4 -4
  156. package/dist/components/{p-1e095bba.js.map → p-3a74719c.js.map} +1 -1
  157. package/dist/components/{p-56716b97.js → p-3a990da7.js} +9 -9
  158. package/dist/components/p-3a990da7.js.map +1 -0
  159. package/dist/components/{p-4c6d8df7.js → p-543082ff.js} +2 -2
  160. package/dist/components/{p-4c6d8df7.js.map → p-543082ff.js.map} +1 -1
  161. package/dist/components/{p-057ae4f2.js → p-62f6da8a.js} +2 -2
  162. package/dist/components/{p-057ae4f2.js.map → p-62f6da8a.js.map} +1 -1
  163. package/dist/components/{p-3a3ba5b1.js → p-6726f512.js} +2 -2
  164. package/dist/components/{p-3a3ba5b1.js.map → p-6726f512.js.map} +1 -1
  165. package/dist/components/{p-1fad2529.js → p-b2d2fd35.js} +3 -3
  166. package/dist/components/{p-1fad2529.js.map → p-b2d2fd35.js.map} +1 -1
  167. package/dist/components/p-cd083aba.js +176 -0
  168. package/dist/components/p-cd083aba.js.map +1 -0
  169. package/dist/components/{p-55202370.js → p-d552352b.js} +5 -5
  170. package/dist/components/{p-55202370.js.map → p-d552352b.js.map} +1 -1
  171. package/dist/components/{p-89fb308b.js → p-e40363fd.js} +2 -2
  172. package/dist/components/{p-89fb308b.js.map → p-e40363fd.js.map} +1 -1
  173. package/dist/components/{p-4c6ba63c.js → p-e66d6274.js} +3 -3
  174. package/dist/components/{p-4c6ba63c.js.map → p-e66d6274.js.map} +1 -1
  175. package/dist/components/{p-9476354d.js → p-e7f21fe7.js} +9 -11
  176. package/dist/components/p-e7f21fe7.js.map +1 -0
  177. package/dist/docs.json +2048 -160
  178. package/dist/esm/index.js +472 -2
  179. package/dist/esm/index.js.map +1 -1
  180. package/dist/esm/loader.js +1 -1
  181. package/dist/esm/native.js +1 -1
  182. package/dist/esm/nv-badge_2.entry.js +4 -5
  183. package/dist/esm/nv-badge_2.entry.js.map +1 -1
  184. package/dist/esm/nv-base.entry.js +1 -1
  185. package/dist/esm/nv-breadcrumb.entry.js +1 -1
  186. package/dist/esm/nv-breadcrumbs.entry.js +1 -1
  187. package/dist/esm/nv-button.entry.js +1 -1
  188. package/dist/esm/nv-calendar.entry.js +5 -5
  189. package/dist/esm/nv-calendar.entry.js.map +1 -1
  190. package/dist/esm/nv-col.entry.js +1 -1
  191. package/dist/esm/nv-datagrid.entry.js +3 -3
  192. package/dist/esm/nv-datagrid.entry.js.map +1 -1
  193. package/dist/esm/nv-datagridcolumn.entry.js +1 -1
  194. package/dist/esm/nv-dialog.entry.js +1 -1
  195. package/dist/esm/nv-dialog.entry.js.map +1 -1
  196. package/dist/esm/nv-dialogfooter_2.entry.js +6 -6
  197. package/dist/esm/nv-dialogfooter_2.entry.js.map +1 -1
  198. package/dist/esm/nv-fieldcheckbox.entry.js +4 -4
  199. package/dist/esm/nv-fielddate.entry.js +5 -5
  200. package/dist/esm/nv-fielddaterange.entry.js +4 -4
  201. package/dist/esm/nv-fielddropdown.entry.js +44 -74
  202. package/dist/esm/nv-fielddropdown.entry.js.map +1 -1
  203. package/dist/esm/nv-fielddropdownitem.entry.js +6 -8
  204. package/dist/esm/nv-fielddropdownitem.entry.js.map +1 -1
  205. package/dist/esm/nv-fieldnumber.entry.js +3 -3
  206. package/dist/esm/nv-fieldpassword.entry.js +3 -3
  207. package/dist/esm/nv-fieldradio.entry.js +3 -3
  208. package/dist/esm/nv-fieldselect.entry.js +5 -5
  209. package/dist/esm/nv-fieldtext.entry.js +3 -3
  210. package/dist/esm/nv-fieldtextarea.entry.js +3 -3
  211. package/dist/esm/nv-fieldtime.entry.js +9 -9
  212. package/dist/esm/nv-icon.entry.js +2 -2
  213. package/dist/esm/nv-icon.entry.js.map +1 -1
  214. package/dist/esm/nv-iconbutton_2.entry.js +2 -2
  215. package/dist/esm/nv-menu.entry.js +1 -1
  216. package/dist/esm/nv-menuitem.entry.js +1 -1
  217. package/dist/esm/nv-popover.entry.js +1 -1
  218. package/dist/esm/nv-popover.entry.js.map +1 -1
  219. package/dist/esm/nv-row.entry.js +1 -1
  220. package/dist/esm/nv-stack.entry.js +1 -1
  221. package/dist/esm/nv-table.entry.js +3 -3
  222. package/dist/esm/nv-table.entry.js.map +1 -1
  223. package/dist/esm/nv-toggle.entry.js +2 -2
  224. package/dist/esm/nv-tooltip.entry.js +1 -1
  225. package/dist/esm/nv-tooltip.entry.js.map +1 -1
  226. package/dist/native/index.esm.js +1 -1
  227. package/dist/native/index.esm.js.map +1 -1
  228. package/dist/native/native.css +1 -1
  229. package/dist/native/native.esm.js +1 -1
  230. package/dist/native/native.esm.js.map +1 -1
  231. package/dist/native/p-16b38dc2.entry.js +2 -0
  232. package/dist/native/p-16b38dc2.entry.js.map +1 -0
  233. package/dist/native/p-1d5b6c6d.entry.js +2 -0
  234. package/dist/native/{p-7fade532.entry.js → p-2b584e35.entry.js} +2 -2
  235. package/dist/native/{p-514101d6.entry.js → p-39fd54e3.entry.js} +2 -2
  236. package/dist/native/p-3a47035f.entry.js +2 -0
  237. package/dist/native/p-3a47035f.entry.js.map +1 -0
  238. package/dist/native/p-4b6d3739.entry.js +2 -0
  239. package/dist/native/{p-45577c7f.entry.js.map → p-4b6d3739.entry.js.map} +1 -1
  240. package/dist/native/{p-31184fdd.entry.js → p-4c88e8be.entry.js} +2 -2
  241. package/dist/native/p-4c96b614.entry.js +2 -0
  242. package/dist/native/{p-2281d5ef.entry.js → p-4d2adf8c.entry.js} +2 -2
  243. package/dist/native/{p-942f8e92.entry.js → p-4eb132d3.entry.js} +2 -2
  244. package/dist/native/{p-c10e5113.entry.js → p-552ca13e.entry.js} +2 -2
  245. package/dist/native/p-569e9663.entry.js +2 -0
  246. package/dist/native/p-569e9663.entry.js.map +1 -0
  247. package/dist/native/{p-be4fc827.entry.js → p-5e04b50f.entry.js} +2 -2
  248. package/dist/native/p-5e04b50f.entry.js.map +1 -0
  249. package/dist/native/{p-ecc28398.entry.js → p-657a0b8a.entry.js} +2 -2
  250. package/dist/native/{p-464ef88f.entry.js → p-794b7820.entry.js} +2 -2
  251. package/dist/native/{p-f5e0d5c5.entry.js → p-870d5a5c.entry.js} +2 -2
  252. package/dist/native/p-8ae27c0a.entry.js +2 -0
  253. package/dist/native/p-8ae27c0a.entry.js.map +1 -0
  254. package/dist/native/p-9fe6a9b7.entry.js +2 -0
  255. package/dist/native/p-9fe6a9b7.entry.js.map +1 -0
  256. package/dist/native/{p-332c5d6c.entry.js → p-a3ea7b59.entry.js} +2 -2
  257. package/dist/native/{p-56e98443.entry.js → p-a6834c17.entry.js} +2 -2
  258. package/dist/native/{p-56e98443.entry.js.map → p-a6834c17.entry.js.map} +1 -1
  259. package/dist/native/{p-442f04f9.entry.js → p-ac72abfc.entry.js} +2 -2
  260. package/dist/native/p-adf0f628.entry.js +2 -0
  261. package/dist/native/p-adf0f628.entry.js.map +1 -0
  262. package/dist/native/{p-048486e0.entry.js → p-c84eb11f.entry.js} +2 -2
  263. package/dist/native/p-c84eb11f.entry.js.map +1 -0
  264. package/dist/native/p-ca1eff59.entry.js +2 -0
  265. package/dist/native/p-ca1eff59.entry.js.map +1 -0
  266. package/dist/native/{p-ab84ff42.entry.js → p-cce90f27.entry.js} +2 -2
  267. package/dist/native/p-d3d664c7.entry.js +2 -0
  268. package/dist/native/{p-62df7dd4.entry.js → p-d7b5ab6e.entry.js} +2 -2
  269. package/dist/native/{p-314d2b34.entry.js → p-d987271c.entry.js} +2 -2
  270. package/dist/native/{p-3af5bcc1.entry.js → p-dcfef507.entry.js} +2 -2
  271. package/dist/native/{p-b052f1cb.entry.js → p-ddb4fcc3.entry.js} +2 -2
  272. package/dist/native/{p-2ed540e3.entry.js → p-ede0c391.entry.js} +2 -2
  273. package/dist/native/p-efb52057.entry.js +2 -0
  274. package/dist/native/{p-04c6048a.entry.js → p-ffcf8271.entry.js} +2 -2
  275. package/dist/native/{p-04c6048a.entry.js.map → p-ffcf8271.entry.js.map} +1 -1
  276. package/dist/types/components/nv-badge/nv-badge.d.ts +1 -0
  277. package/dist/types/components/nv-dialogfooter/nv-dialogfooter.d.ts +2 -2
  278. package/dist/types/components/nv-fielddropdown/nv-fielddropdown.d.ts +1 -7
  279. package/dist/types/components/nv-fielddropdownitem/nv-fielddropdownitem.d.ts +1 -6
  280. package/dist/types/components/nv-icon/nv-icons.d.ts +1 -1
  281. package/dist/types/components.d.ts +4 -12
  282. package/dist/vscode-data.json +1557 -147
  283. package/hydrate/index.js +134 -166
  284. package/hydrate/index.mjs +134 -166
  285. package/package.json +3 -3
  286. package/dist/components/p-3aa6f6dc.js.map +0 -1
  287. package/dist/components/p-56716b97.js.map +0 -1
  288. package/dist/components/p-7f142767.js +0 -177
  289. package/dist/components/p-7f142767.js.map +0 -1
  290. package/dist/components/p-9476354d.js.map +0 -1
  291. package/dist/components/p-ebf24fd0.js +0 -88
  292. package/dist/components/p-ebf24fd0.js.map +0 -1
  293. package/dist/native/p-048486e0.entry.js.map +0 -1
  294. package/dist/native/p-1a46cb52.entry.js +0 -2
  295. package/dist/native/p-22a45102.entry.js +0 -2
  296. package/dist/native/p-22a45102.entry.js.map +0 -1
  297. package/dist/native/p-45577c7f.entry.js +0 -2
  298. package/dist/native/p-46aa1136.entry.js +0 -2
  299. package/dist/native/p-665db087.entry.js +0 -2
  300. package/dist/native/p-68b5a92c.entry.js +0 -2
  301. package/dist/native/p-68b5a92c.entry.js.map +0 -1
  302. package/dist/native/p-6a629671.entry.js +0 -2
  303. package/dist/native/p-6a629671.entry.js.map +0 -1
  304. package/dist/native/p-913907fb.entry.js +0 -2
  305. package/dist/native/p-913907fb.entry.js.map +0 -1
  306. package/dist/native/p-9f5e4dfc.entry.js +0 -2
  307. package/dist/native/p-9f5e4dfc.entry.js.map +0 -1
  308. package/dist/native/p-bdabd495.entry.js +0 -2
  309. package/dist/native/p-bdabd495.entry.js.map +0 -1
  310. package/dist/native/p-be4fc827.entry.js.map +0 -1
  311. package/dist/native/p-db2902d6.entry.js +0 -2
  312. package/dist/native/p-db2902d6.entry.js.map +0 -1
  313. package/dist/native/p-f89b7d06.entry.js +0 -2
  314. /package/dist/native/{p-665db087.entry.js.map → p-1d5b6c6d.entry.js.map} +0 -0
  315. /package/dist/native/{p-7fade532.entry.js.map → p-2b584e35.entry.js.map} +0 -0
  316. /package/dist/native/{p-514101d6.entry.js.map → p-39fd54e3.entry.js.map} +0 -0
  317. /package/dist/native/{p-31184fdd.entry.js.map → p-4c88e8be.entry.js.map} +0 -0
  318. /package/dist/native/{p-46aa1136.entry.js.map → p-4c96b614.entry.js.map} +0 -0
  319. /package/dist/native/{p-2281d5ef.entry.js.map → p-4d2adf8c.entry.js.map} +0 -0
  320. /package/dist/native/{p-942f8e92.entry.js.map → p-4eb132d3.entry.js.map} +0 -0
  321. /package/dist/native/{p-c10e5113.entry.js.map → p-552ca13e.entry.js.map} +0 -0
  322. /package/dist/native/{p-ecc28398.entry.js.map → p-657a0b8a.entry.js.map} +0 -0
  323. /package/dist/native/{p-464ef88f.entry.js.map → p-794b7820.entry.js.map} +0 -0
  324. /package/dist/native/{p-f5e0d5c5.entry.js.map → p-870d5a5c.entry.js.map} +0 -0
  325. /package/dist/native/{p-332c5d6c.entry.js.map → p-a3ea7b59.entry.js.map} +0 -0
  326. /package/dist/native/{p-442f04f9.entry.js.map → p-ac72abfc.entry.js.map} +0 -0
  327. /package/dist/native/{p-ab84ff42.entry.js.map → p-cce90f27.entry.js.map} +0 -0
  328. /package/dist/native/{p-f89b7d06.entry.js.map → p-d3d664c7.entry.js.map} +0 -0
  329. /package/dist/native/{p-62df7dd4.entry.js.map → p-d7b5ab6e.entry.js.map} +0 -0
  330. /package/dist/native/{p-314d2b34.entry.js.map → p-d987271c.entry.js.map} +0 -0
  331. /package/dist/native/{p-3af5bcc1.entry.js.map → p-dcfef507.entry.js.map} +0 -0
  332. /package/dist/native/{p-b052f1cb.entry.js.map → p-ddb4fcc3.entry.js.map} +0 -0
  333. /package/dist/native/{p-2ed540e3.entry.js.map → p-ede0c391.entry.js.map} +0 -0
  334. /package/dist/native/{p-1a46cb52.entry.js.map → p-efb52057.entry.js.map} +0 -0
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-9bda5507.js');
6
6
  const v4 = require('./v4-7014b8b0.js');
7
7
 
8
- const nvFielddropdownCss = "nv-fielddropdown{--nv-field-border-default:var(--components-form-field-border-default);--nv-field-border-hover:var(--components-form-field-border-hover);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--components-form-field-border-default);--nv-field-border-readonly:var(--components-form-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-brand);--nv-field-background:var(--components-form-field-background-default);display:flex;flex-direction:column;align-items:flex-start;gap:var(--form-gap-y);box-sizing:border-box}nv-fielddropdown[readonly]:not([readonly=false]){--nv-field-border-default:var(--components-form-field-border-readonly);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-background:var(--components-form-field-background-readonly)}nv-fielddropdown[error]:not([error=false]){--nv-field-border-default:var(--components-form-field-border-error);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-destructive)}nv-fielddropdown[required]:not([required=false]) label::after{content:\"*\";color:var(--components-form-text-required);font-weight:700}nv-fielddropdown label{display:flex;align-items:center;gap:var(--form-label-gap);align-self:stretch;color:var(--components-form-text-label-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:500;line-height:var(--form-label-line-height)}nv-fielddropdown nv-popover{width:100%;display:block}nv-fielddropdown nv-popover [data-scope=popover]{width:100%;padding:var(--list-dropdown-padding);border-radius:var(--list-dropdown-radius);background-color:var(--components-list-dropdown-background);border:1px solid var(--components-list-dropdown-border)}nv-fielddropdown nv-popover [slot=content]{gap:var(--list-dropdown-gap-y);display:flex;flex-direction:column}nv-fielddropdown nv-popover hr{color:var(--components-list-dropdown-separator)}nv-fielddropdown .input-wrapper{display:flex;flex-wrap:wrap;gap:var(--form-gap-x);align-items:stretch;align-self:stretch;width:100%}nv-fielddropdown .input-container{display:flex;flex-grow:1;justify-content:center;align-items:center;align-self:stretch;border-radius:var(--form-field-radius);border-width:1px;border-style:solid;border-color:var(--nv-field-border-default);opacity:var(--components-form-opacity-default, 1);background:var(--nv-field-background);transition:all 150ms ease-out;position:relative;width:100%;min-height:40px}nv-fielddropdown .input-container:hover{border-color:var(--nv-field-border-hover)}nv-fielddropdown .input-container:focus-within,nv-fielddropdown .input-container:focus-within:hover,nv-fielddropdown .input-container:focus,nv-fielddropdown .input-container:focus:hover{border-color:var(--nv-field-border-focus);box-shadow:0px 0px 0px var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}nv-fielddropdown .input-container:has(input:read-only){opacity:0.5;background-color:var(--components-form-field-background-readonly);border-color:var(--nv-field-border-readonly)}nv-fielddropdown .input-container:has(input:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fielddropdown .input-container input[type=search]::-webkit-search-decoration,nv-fielddropdown .input-container input[type=search]::-webkit-search-cancel-button,nv-fielddropdown .input-container input[type=search]::-webkit-search-results-button,nv-fielddropdown .input-container input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none}nv-fielddropdown .input-container input,nv-fielddropdown .input-container p.non-filterable-text{display:flex;align-items:center;flex:1 0 0;overflow:hidden;background-color:transparent;color:var(--components-form-field-content-text);padding:var(--form-field-padding-y) var(--form-field-padding-x);font-size:var(--form-field-font-size);font-style:normal;font-weight:500;line-height:var(--form-field-line-height)}nv-fielddropdown .input-container input:focus,nv-fielddropdown .input-container p.non-filterable-text:focus{outline:none}nv-fielddropdown .input-container input::placeholder,nv-fielddropdown .input-container p.non-filterable-text::placeholder{overflow:hidden;color:var(--components-form-field-content-placeholder);text-overflow:ellipsis;font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-field-font-size);font-style:normal;font-weight:400;line-height:var(--form-field-line-height)}nv-fielddropdown .input-container>nv-iconbutton{border:0px;border-radius:0px}nv-fielddropdown .input-container>nv-iconbutton:focus-visible{border-radius:var(--button-md-border-radius);outline-offset:-3px}nv-fielddropdown .input-container nv-icon.validation{color:var(--nv-field-border-default)}nv-fielddropdown .non-filterable-text{display:block;border-radius:var(--form-field-radius);background-color:var(--nv-field-background);color:var(--components-form-field-content-text);font-size:var(--form-field-font-size);font-weight:500;line-height:var(--form-field-line-height);box-sizing:border-box;cursor:pointer;height:100%;min-height:40px}nv-fielddropdown .non-filterable-text span{display:inline-block;width:100%;overflow:hidden;text-overflow:ellipsis}nv-fielddropdown .description{align-self:stretch;color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height)}nv-fielddropdown .error-description{align-self:stretch;color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height);color:var(--components-form-text-description-error)}";
8
+ const nvFielddropdownCss = "nv-fielddropdown{--nv-field-border-default:var(--components-form-field-border-default);--nv-field-border-hover:var(--components-form-field-border-hover);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--components-form-field-border-default);--nv-field-border-readonly:var(--components-form-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-brand);--nv-field-background:var(--components-form-field-background-default);display:flex;flex-direction:column;align-items:flex-start;gap:var(--form-gap-y);box-sizing:border-box}nv-fielddropdown[readonly]:not([readonly=false]){--nv-field-border-default:var(--components-form-field-border-readonly);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-background:var(--components-form-field-background-readonly)}nv-fielddropdown[error]:not([error=false]){--nv-field-border-default:var(--components-form-field-border-error);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-destructive)}nv-fielddropdown[required]:not([required=false]) label::after{content:\"*\";color:var(--components-form-text-required);font-weight:700}nv-fielddropdown[hidden]:not([hidden=false]) label{display:none}nv-fielddropdown label{display:flex;align-items:center;gap:var(--form-label-gap);align-self:stretch;color:var(--components-form-text-label-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:500;line-height:var(--form-label-line-height)}nv-fielddropdown nv-popover{width:100%;display:block}nv-fielddropdown nv-popover [data-scope=popover]{width:100%;padding:var(--list-dropdown-padding);border-radius:var(--list-dropdown-radius);background-color:var(--components-list-dropdown-background);border:1px solid var(--components-list-dropdown-border)}nv-fielddropdown nv-popover [slot=content]{gap:var(--list-dropdown-gap-y);display:flex;flex-direction:column}nv-fielddropdown nv-popover hr{color:var(--components-list-dropdown-separator)}nv-fielddropdown .input-wrapper{display:flex;flex-wrap:wrap;gap:var(--form-gap-x);align-items:stretch;align-self:stretch;width:100%}nv-fielddropdown .input-container{display:flex;flex-grow:1;justify-content:center;align-items:center;align-self:stretch;border-radius:var(--form-field-radius);border-width:1px;border-style:solid;border-color:var(--nv-field-border-default);opacity:var(--components-form-opacity-default, 1);background:var(--nv-field-background);transition:all 150ms ease-out;position:relative;width:100%;min-height:40px}nv-fielddropdown .input-container:hover{border-color:var(--nv-field-border-hover)}nv-fielddropdown .input-container:focus-within,nv-fielddropdown .input-container:focus-within:hover,nv-fielddropdown .input-container:focus,nv-fielddropdown .input-container:focus:hover{border-color:var(--nv-field-border-focus);box-shadow:0px 0px 0px var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}nv-fielddropdown .input-container:has(input:read-only){opacity:0.5;background-color:var(--components-form-field-background-readonly);border-color:var(--nv-field-border-readonly)}nv-fielddropdown .input-container:has(input:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fielddropdown .input-container input[type=search]::-webkit-search-decoration,nv-fielddropdown .input-container input[type=search]::-webkit-search-cancel-button,nv-fielddropdown .input-container input[type=search]::-webkit-search-results-button,nv-fielddropdown .input-container input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none}nv-fielddropdown .input-container input,nv-fielddropdown .input-container p.non-filterable-text{display:flex;align-items:center;flex:1 0 0;overflow:hidden;background-color:transparent;color:var(--components-form-field-content-text);padding:var(--form-field-padding-y) var(--form-field-padding-x);font-size:var(--form-field-font-size);font-style:normal;font-weight:500;line-height:var(--form-field-line-height)}nv-fielddropdown .input-container input:focus,nv-fielddropdown .input-container p.non-filterable-text:focus{outline:none}nv-fielddropdown .input-container input::placeholder,nv-fielddropdown .input-container p.non-filterable-text::placeholder{overflow:hidden;color:var(--components-form-field-content-placeholder);text-overflow:ellipsis;font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-field-font-size);font-style:normal;font-weight:400;line-height:var(--form-field-line-height)}nv-fielddropdown .input-container>nv-iconbutton{border:0px;border-radius:0px}nv-fielddropdown .input-container>nv-iconbutton:focus-visible{border-radius:var(--button-md-border-radius);outline-offset:-3px}nv-fielddropdown .input-container nv-icon.validation{color:var(--nv-field-border-default)}nv-fielddropdown .non-filterable-text{display:block;border-radius:var(--form-field-radius);background-color:var(--nv-field-background);color:var(--components-form-field-content-text);font-size:var(--form-field-font-size);font-weight:500;line-height:var(--form-field-line-height);box-sizing:border-box;cursor:pointer;height:100%;min-height:40px}nv-fielddropdown .non-filterable-text span{display:inline-block;width:100%;overflow:hidden;text-overflow:ellipsis}nv-fielddropdown .description{align-self:stretch;color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height)}nv-fielddropdown .error-description{align-self:stretch;color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height);color:var(--components-form-text-description-error)}";
9
9
  const NvFielddropdownStyle0 = nvFielddropdownCss;
10
10
 
11
11
  const NvFielddropdown = class {
@@ -108,6 +108,7 @@ const NvFielddropdown = class {
108
108
  return;
109
109
  }
110
110
  const input = event.target;
111
+ this.open = true;
111
112
  this.filterText = input.value.toLowerCase();
112
113
  this.filterItems();
113
114
  };
@@ -120,21 +121,27 @@ const NvFielddropdown = class {
120
121
  if (this.disabled || this.readonly)
121
122
  return;
122
123
  this.open = !this.open;
123
- if (this.open && !this.filterable) {
124
- this.focusFirstItem();
125
- }
126
124
  };
127
125
  this.getSelectedLabel = () => {
128
- var _a, _b, _c;
126
+ var _a, _b, _c, _d, _e;
127
+ if (!this.value)
128
+ return '';
129
+ if (this.parsedOptions.length > 1) {
130
+ const matchingItem = this.parsedOptions.find(option => option.value === this.value);
131
+ return (_b = (_a = matchingItem === null || matchingItem === void 0 ? void 0 : matchingItem.label) !== null && _a !== void 0 ? _a : matchingItem === null || matchingItem === void 0 ? void 0 : matchingItem.value) !== null && _b !== void 0 ? _b : this.value;
132
+ }
129
133
  const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitem'));
130
- const matchingItem = items.find(item => item.getAttribute('value') === this.value);
131
- return matchingItem
132
- ? (_c = (_a = matchingItem.label) !== null && _a !== void 0 ? _a : (_b = matchingItem.textContent) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _c !== void 0 ? _c : matchingItem.value
134
+ const matchingItem = items.find(item => item.value === this.value);
135
+ const selectedLabel = matchingItem
136
+ ? (_e = (_c = matchingItem.label) !== null && _c !== void 0 ? _c : (_d = matchingItem.textContent) === null || _d === void 0 ? void 0 : _d.trim()) !== null && _e !== void 0 ? _e : matchingItem.value
133
137
  : '';
138
+ return selectedLabel;
134
139
  };
135
140
  this.clearFilter = () => {
141
+ if (!this.filterable)
142
+ return;
136
143
  this.filterText = '';
137
- this.inputElement.value = '';
144
+ this.inputElement.value = this.getSelectedLabel();
138
145
  this.inputElement.focus();
139
146
  this.filterItems();
140
147
  };
@@ -151,6 +158,7 @@ const NvFielddropdown = class {
151
158
  item.setAttribute('selected', 'true');
152
159
  }
153
160
  });
161
+ this.clearFilter();
154
162
  this.value = event.detail.value;
155
163
  this.open = false;
156
164
  }
@@ -162,23 +170,18 @@ const NvFielddropdown = class {
162
170
  this.filterable = newValue;
163
171
  }
164
172
  watchValueHandler(newValue) {
165
- if (newValue) {
166
- this.updateSelectedItem(newValue);
167
- }
168
173
  this.valueChanged.emit(newValue);
169
174
  }
170
175
  handleOptionsChange(newValue) {
176
+ var _a;
171
177
  if (newValue) {
172
178
  try {
173
179
  const parsedOpts = JSON.parse(newValue);
174
180
  this.parsedOptions = [...parsedOpts];
175
- const selectedOption = this.parsedOptions.find(opt => opt.selected);
176
- if (selectedOption) {
177
- this.value = selectedOption.value;
178
- requestAnimationFrame(() => {
179
- // Wait for items to be rendered
180
- this.updateSelectedItem(selectedOption.value);
181
- });
181
+ if (!this.value) {
182
+ const defaultValue = parsedOpts.find(option => option.selected);
183
+ this.value = (_a = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value) !== null && _a !== void 0 ? _a : '';
184
+ this.updateSelectedItem(this.value);
182
185
  }
183
186
  }
184
187
  catch (error) {
@@ -194,26 +197,27 @@ const NvFielddropdown = class {
194
197
  const target = event.relatedTarget;
195
198
  if (!(target instanceof Node) || !this.el.contains(target)) {
196
199
  this.open = false;
200
+ if (this.inputElement) {
201
+ this.filterText = '';
202
+ this.inputElement.value = this.getSelectedLabel();
203
+ setTimeout(() => {
204
+ this.filterItems();
205
+ }, 200);
206
+ }
197
207
  }
198
208
  }
199
209
  handleKeyDown(event) {
210
+ if (!this.el)
211
+ return;
200
212
  if (!this.open) {
201
213
  if (event.key === 'ArrowDown') {
202
214
  this.open = true;
203
- if (!this.filterable) {
204
- // Focus on the first item if it is not filterable
205
- this.focusFirstItem();
206
- }
207
215
  event.preventDefault();
208
216
  return;
209
217
  }
210
218
  return;
211
219
  }
212
- const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitem:not([data-empty])'));
213
- if (items.length === 0) {
214
- console.warn('No dropdown items found to navigate');
215
- return;
216
- }
220
+ const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitem:not([disabled]):not([hidden])'));
217
221
  let currentIndex = items.findIndex(item => item.classList.contains('highlighted'));
218
222
  if (event.key === 'ArrowDown') {
219
223
  event.preventDefault();
@@ -240,31 +244,6 @@ const NvFielddropdown = class {
240
244
  async getFilterText() {
241
245
  return this.filterText;
242
246
  }
243
- /**
244
- * Set the initial selection based on the current value and update the
245
- * inputElement value.
246
- */
247
- setInitialSelection() {
248
- if (!this.value)
249
- return;
250
- const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitem'));
251
- const selectedItem = items.find(item => item.getAttribute('value') === this.value);
252
- items.forEach(item => {
253
- item.removeAttribute('selected');
254
- item.classList.remove('selected');
255
- });
256
- if (selectedItem) {
257
- selectedItem.setAttribute('selected', 'true');
258
- selectedItem.classList.add('selected');
259
- this.value = selectedItem.getAttribute('value');
260
- if (this.inputElement) {
261
- this.inputElement.value = this.value;
262
- }
263
- }
264
- else {
265
- console.warn('No matching item found for value:', this.value);
266
- }
267
- }
268
247
  /**
269
248
  * Filter dropdown items based on the text entered by the user.
270
249
  * If no items are found, display a message indicating no results.
@@ -286,7 +265,10 @@ const NvFielddropdown = class {
286
265
  // Check if the filtered text is present either in the value or in the textual content
287
266
  const shouldShow = value.includes(this.filterText) ||
288
267
  textContent.includes(this.filterText);
289
- item.style.display = shouldShow ? '' : 'none'; // Hide or show the item
268
+ if (shouldShow)
269
+ item.removeAttribute('hidden');
270
+ else
271
+ item.setAttribute('hidden', '');
290
272
  if (shouldShow) {
291
273
  hasVisibleItems = true;
292
274
  }
@@ -319,17 +301,9 @@ const NvFielddropdown = class {
319
301
  }
320
302
  });
321
303
  }
322
- focusFirstItem() {
323
- const firstItem = this.el.querySelector('nv-fielddropdownitem');
324
- if (firstItem) {
325
- firstItem.focus();
326
- this.updateHighlightedItem(Array.from(this.el.querySelectorAll('nv-fielddropdownitem')), 0);
327
- }
328
- else {
329
- console.warn('nv-fielddropdown: no first item found to focus');
330
- }
331
- }
332
304
  updateSelectedItem(value) {
305
+ if (!value)
306
+ return;
333
307
  const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitem'));
334
308
  const matchingItem = items.find(item => {
335
309
  var _a;
@@ -346,38 +320,34 @@ const NvFielddropdown = class {
346
320
  item.removeAttribute('selected');
347
321
  }
348
322
  });
349
- if (matchingItem && this.inputElement) {
350
- this.inputElement.value = value;
351
- }
352
323
  }
353
324
  //#endregion METHODS
354
325
  /****************************************************************************/
355
326
  //#region LIFECYCLE
356
327
  componentWillLoad() {
357
328
  this.resetFilter();
358
- this.setInitialSelection();
359
329
  if (this.filterable && this.filterText) {
360
330
  this.filterItems();
361
331
  }
362
332
  if (this.options) {
363
333
  this.handleOptionsChange(this.options);
364
334
  }
365
- if (this.value) {
366
- this.updateSelectedItem(this.value);
367
- }
368
335
  }
369
336
  componentDidLoad() {
370
337
  if (this.value) {
371
338
  this.updateSelectedItem(this.value);
372
339
  }
340
+ if (this.inputElement) {
341
+ this.inputElement.value = this.getSelectedLabel();
342
+ }
373
343
  }
374
344
  //#endregion LIFECYCLE
375
345
  /****************************************************************************/
376
346
  //#region RENDER
377
347
  render() {
378
- return (index.h(index.Host, { key: '189f41e526d7245f4d5fae078d2bea1528a9a8d1' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '91d5c635c4d37f5d6d3fef0e6dd3212009d1be35', htmlFor: this.inputId }, index.h("slot", { key: 'e749e641f077753464eaa21289ebf71c0b6f673b', name: "label" }, this.label))), index.h("nv-popover", { key: 'c3c0456e9937745b4784c7b858b9cfadcf4e7240', ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open }, index.h("div", { key: '1ad04f70880de711e371267859950d272f78902f', class: "input-wrapper", slot: "trigger" }, index.h("slot", { key: '99ff9d306c69aba7e5eb033feae1a05f7dcb01f6', name: "before-input" }), index.h("div", { key: '7afb87ecb3eacaf7510abd5b6b02645ba355f719', class: "input-container", onClick: this.handleInputContainerClick }, index.h("slot", { key: 'fe3749cdf9f25f0b7fd52949c955b1804fd65630', name: "leading-input" }), this.isFilterable || this.disabled || this.readonly ? (index.h("input", { id: this.inputId, type: "search", ref: e => (this.inputElement = e), autofocus: this.autofocus, autocomplete: this.autocomplete, placeholder: this.placeholder, name: this.name, value: this.getSelectedLabel(), required: this.required, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInput, onFocus: this.handleInputFocus, onKeyDown: this.handleKeyDown })) : (index.h("p", { id: this.inputId, class: "non-filterable-text", onClick: this.handleInputContainerClick, tabIndex: this.disabled ? -1 : 0, onKeyDown: this.handleKeyDown, onFocus: this.handleInputFocus }, index.h("span", null, this.getSelectedLabel() || this.value || this.placeholder))), this.isFilterable && this.filterText && this.open && (index.h("nv-iconbutton", { key: '9806da726e4dce22f0a73664b482a405cb7cc071', name: "x", size: "md", emphasis: "lower", class: "clear-button", onClick: this.clearFilter, "aria-label": "Clear input" })), this.error && (index.h("nv-icon", { key: '781fb90765533615737da8c294ce497f22dbd9c6', name: "alert-circle", class: "validation", size: "md" })), index.h("nv-iconbutton", { key: '1060f3a91606d26c3368299623b0d8211df5f6ec', "data-scope": "toggle-dropdown", name: this.open ? 'chevron-top' : 'chevron-down', size: "md", emphasis: "lower", "aria-label": this.open ? 'Hide dropdown' : 'Show dropdown', "aria-pressed": this.open.toString(), onClick: this.togglePopover, tabIndex: this.disabled ? -1 : 0 })), index.h("slot", { key: 'b123b91bb2c09f77010bef649d11a27bf16cb3ab', name: "after-input" })), index.h("div", { key: '94234acfe1881c11b3e6fadda0f234d036ea47ef', slot: "content" }, this.parsedOptions.length > 0 ? (index.h("ul", null, this.parsedOptions.map(option => (index.h("nv-fielddropdownitem", { label: option.label, value: option.value, disabled: option.disabled, selected: option.value === this.value }))))) : (index.h("slot", { name: "content" })))), (this.description ||
379
- this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '26de437b142f81e21145ac4f6a15c7e6aecfbfa7', class: "description" }, index.h("slot", { key: '6c95582790d276567ad9e1619a949419a72f54c1', name: "description" }, this.description))), (this.errorDescription ||
380
- this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '6ac20b9462e708a456e61c8e3721a585b03e696e', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '1def9c4e17495a831ea9702ae121c64e812df9b6', name: "error-description" }, this.errorDescription)))));
348
+ return (index.h(index.Host, { key: 'fd9c415beb138bf85bdd914c6143b50a2f2330bf', role: "combobox", "aria-expanded": this.open.toString(), "aria-haspopup": "listbox", "aria-label": this.label }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '3bd9ea3ac7f1202882511ab6bf0d187975eaaaf6', htmlFor: this.inputId }, index.h("slot", { key: '0e33a34af113e622401e5d23843fc67afce8c7a0', name: "label" }, this.label))), index.h("nv-popover", { key: 'cf41abb986f71b746f7b83828eb69244e502626a', ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open }, index.h("div", { key: 'c030054877c24d5091bc9ea91f8b90182a5150b9', class: "input-wrapper", slot: "trigger" }, index.h("slot", { key: '974aa8736caa3112d2e17a6e6fc33d0271315303', name: "before-input" }), index.h("div", { key: '7b657cf2dd489e8e22ecd52403a9eba8193c1728', class: "input-container", onClick: this.handleInputContainerClick }, index.h("slot", { key: '26d55cabf26329cde6f7ac93464def081533dd7d', name: "leading-input" }), this.isFilterable || this.disabled || this.readonly ? (index.h("input", { "data-scope": "focusable", id: this.inputId, type: "search", ref: e => (this.inputElement = e), autofocus: this.autofocus, autocomplete: this.autocomplete, placeholder: this.placeholder, name: this.name, value: this.getSelectedLabel(), required: this.required, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInput, onFocus: this.handleInputFocus, onClick: this.handleInputFocus, onKeyDown: this.handleKeyDown })) : (index.h("p", { "data-scope": "focusable", id: this.inputId, class: "non-filterable-text", onClick: this.handleInputContainerClick, tabIndex: this.disabled ? -1 : 0, onKeyDown: this.handleKeyDown, onFocus: this.handleInputFocus }, this.getSelectedLabel() || this.value || this.placeholder)), this.isFilterable && this.filterText && this.open && (index.h("nv-iconbutton", { key: '4dab0dd29d016a68b94681893bd0367c2f2bbccb', name: "x", size: "md", emphasis: "lower", class: "clear-button", onClick: this.clearFilter, "aria-label": "Clear input" })), this.error && (index.h("nv-icon", { key: '94555a8f663a45ce5e744a2c4f42442ee725556f', name: "alert-circle", class: "validation", size: "md" })), index.h("nv-iconbutton", { key: 'c52dcc16864b6093cc7c1417d98506c9b4739f4b', "data-scope": "toggle-dropdown", name: this.open ? 'chevron-top' : 'chevron-down', size: "md", emphasis: "lower", "aria-label": this.open ? 'Hide dropdown' : 'Show dropdown', "aria-pressed": this.open.toString(), onClick: this.togglePopover, tabIndex: this.disabled ? -1 : 0 })), index.h("slot", { key: 'a78197668881b8fc5fd7522a3b2ebcb4e4d6c1cc', name: "after-input" })), index.h("div", { key: '161678718ea939874d27b800052f3ff2df94a07d', slot: "content" }, this.parsedOptions.length > 0 ? (index.h("ul", null, this.parsedOptions.map(option => (index.h("nv-fielddropdownitem", { label: option.label, value: option.value, disabled: option.disabled, selected: option.value === this.value }))))) : (index.h("slot", { name: "content" })))), (this.description ||
349
+ this.el.querySelector('[slot="description"]')) && (index.h("div", { key: 'b4ea5b9e6d12307201847c8b9979e7c77442c0a9', class: "description" }, index.h("slot", { key: '7162553aadfbeae787683a1fcf4ac7a1ca4788da', name: "description" }, this.description))), (this.errorDescription ||
350
+ this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: 'c96506582bd9c604490ce0d9c4a398ff70b7e814', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '9069e068a0e1624344b248d68799ecf07f10c649', name: "error-description" }, this.errorDescription)))));
381
351
  }
382
352
  static get formAssociated() { return true; }
383
353
  get el() { return index.getElement(this); }
@@ -1 +1 @@
1
- {"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AC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAC,mBAAmB,IACjDA,mEAAM,IAAI,EAAC,mBAAmB,IAAE,IAAI,CAAC,gBAAgB,CAAQ,CACzD,CACP,CACI,EACP;KACH;;;;;;;;;;;;;","names":["uuidv4","h","Host"],"sources":["src/components/nv-fielddropdown/styles/nv-fielddropdown.scss?tag=nv-fielddropdown","src/components/nv-fielddropdown/nv-fielddropdown.tsx"],"sourcesContent":["@use \"./mixins\" as *;\n@import '../../../styles/form-field';\n\nnv-fielddropdown {\n @include form-field-variables();\n @include form-field-root();\n\n &[readonly]:not([readonly='false']) {\n @include form-field-readonly-variables();\n }\n\n &[error]:not([error='false']) {\n @include form-field-error-variables();\n }\n\n &[required]:not([required='false']) label {\n @include form-field-label-required();\n }\n\n label {\n @include form-field-label();\n }\n\n nv-popover {\n @include form-field-popover();\n }\n\n .input-wrapper {\n @include form-field-input-wrapper();\n @include input-wrapper-styles();\n }\n\n .input-container {\n @include form-field-input-container();\n @include input-container-styles();\n\n input[type=\"search\"]::-webkit-search-decoration,\n input[type=\"search\"]::-webkit-search-cancel-button,\n input[type=\"search\"]::-webkit-search-results-button,\n input[type=\"search\"]::-webkit-search-results-decoration {\n -webkit-appearance:none;\n }\n\n input,\n p.non-filterable-text {\n @include form-field-input();\n }\n\n > nv-iconbutton {\n @include form-field-action();\n }\n\n nv-icon.validation {\n @include form-field-icon();\n }\n }\n\n .non-filterable-text {\n @include non-filterable-text-styles();\n }\n\n .description {\n @include form-field-description();\n }\n\n .error-description {\n @include form-field-error-description();\n }\n}\n","import {\n Component,\n Host,\n h,\n Element,\n Prop,\n State,\n Listen,\n Event,\n EventEmitter,\n Watch,\n Method,\n} from '@stencil/core';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { TextInputAutocomplete } from '../../utils/constants';\n\n/**\n * @slot content - Use a <ul></ul> tag for the slot, and place <nv-dropdownitem> elements inside.\n * @slot leading-input - Content to be placed before the input text, within the input container.\n * @slot before-input - Content to be placed before the input text, outside the input container.\n * @slot after-input - Content to be placed after the input text, outside the input container.\n * @slot label - Content to be placed as the label, will override the label prop.\n * @slot description - Content to be placed as the description, will override the description prop.\n * @slot error-description - Content to be placed as the error description, will override the errorDescription prop.\n */\n@Component({\n tag: 'nv-fielddropdown',\n styleUrl: 'styles/nv-fielddropdown.scss',\n shadow: false,\n formAssociated: true,\n})\nexport class NvFielddropdown {\n @Element() el: HTMLNvFielddropdownElement;\n private inputElement!: HTMLInputElement;\n private popoverElement!: HTMLNvPopoverElement;\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the input element and the for attribute of the associated\n * label. If no ID is provided, a random one will be automatically generated\n * to ensure unique identification, facilitating proper label association and\n * accessibility.\n */\n @Prop({ reflect: true })\n readonly inputId: string = uuidv4();\n\n /**\n * Lets you define the text that explains what users should enter in the text\n * input field. It's a crucial element for making forms clear and\n * user-friendly.\n */\n @Prop({ reflect: true })\n readonly label: string;\n\n /**\n * Add helpful hints or extra information under the text input field. This is\n * where you can clarify what users should enter or provide additional\n * instructions, making the form easier to fill out correctly.\n */\n @Prop({ reflect: true })\n readonly description: string;\n\n /**\n * Display temporary text inside the input field to give users a hint about\n * what to type. It's a great way to provide examples or suggestions directly\n * in the field before they start typing.\n * The placeholder is displayed only when the filterable option is enabled.\n */\n @Prop({ reflect: true })\n readonly placeholder: string;\n\n /**\n * Defines the name attribute of the input field, which is crucial for form\n * submission. This value is used as the key in the key-value pair sent to\n * the server, representing the input's data in form submissions. It should be\n * unique within the form to avoid conflicts.\n */\n @Prop({ reflect: true })\n readonly name: string;\n\n /**\n * State of the dropdown popover.\n */\n @Prop({ reflect: true, mutable: true })\n open: boolean = false;\n\n /**\n * The autocomplete prop helps users fill out the input field faster by\n * suggesting entries they've used before, like their email or address.\n * You can turn it on to make forms more convenient or off to ensure users\n * always type in fresh data.\n */\n @Prop({ reflect: true })\n readonly autocomplete: `${TextInputAutocomplete}` = 'off';\n\n /**\n * Specifies the value of the input field, which determines the text displayed\n * within the field. This prop is typically used in controlled components\n * where the input's value is managed by the component's state.\n */\n @Prop({ reflect: true, mutable: true })\n value: string;\n\n /**\n * Marks the input field as required, ensuring that the user must fill it out\n * before submitting the form.\n */\n @Prop({ reflect: true })\n readonly required: boolean = false;\n\n /**\n * Alters the input field's appearance to indicate an error, helping users\n * identify fields that need correction.\n * @validator error\n */\n @Prop({ reflect: true })\n readonly error: boolean = false;\n\n /**\n * A description that appears when there is an error related to the dropdown\n * field.\n * @validator message\n */\n @Prop({ reflect: true })\n readonly errorDescription: string;\n\n /**\n * Display the input field's content without allowing users to change it.\n * Users can still click on it, select, and copy the text, but they won't be\n * able to type or delete anything.\n */\n @Prop({ reflect: true })\n readonly readonly: boolean = false;\n\n /**\n * The disabled prop lets you turn off the input field so that users can't\n * type in it. When disabled, the field is grayed out and won't respond to\n * clicks or touches.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * The text to display when no items match the filter.\n */\n @Prop({ reflect: true })\n readonly emptyResult: string = 'No results found';\n\n /**\n * Enables or disables the filtering feature for the dropdown items.\n */\n @Prop({ reflect: true, mutable: true })\n filterable: boolean = false;\n\n /**\n * List of options available in the dropdown. The options are passed as a JSON\n * string.\n *\n * @example\n * options=[{\n * \"label\": \"Option 1\",\n * \"value\": \"option1\",\n * \"selected\": true\n * },\n * {\n * \"label\": \"Option 2\",\n * \"value\": \"option2\"\n * }]\n */\n @Prop({ reflect: true })\n readonly options?: string;\n\n /**\n * Applies focus to the input field as soon as the component is mounted. This\n * is equivalent to setting the native autofocus attribute on an <input>\n * element.\n */\n @Prop({ reflect: true })\n // eslint-disable-next-line @stencil-community/reserved-member-names\n readonly autofocus: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region STATE\n\n /** The text entered by the user for filtering dropdown items. */\n @State()\n filterText: string = '';\n\n @State()\n isFilterable: boolean = this.filterable;\n\n @State()\n selectedValues: Set<string> = new Set();\n\n /**\n * Options configuration for the dropdown items.\n */\n @State()\n parsedOptions: Array<{\n /** Label to display for the option */\n label: string;\n /** Value associated with the option */\n value: string;\n /** Whether this option is disabled */\n disabled?: boolean;\n /** Whether this option is pre-selected */\n selected?: boolean;\n }> = [];\n\n //#endregion STATE\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the input value changes.\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<string>;\n\n /**\n * Event emitted when an item is clicked.\n */\n @Event()\n dropdownItemSelected: EventEmitter<\n HTMLNvFielddropdownitemElementEventMap['dropdownItemSelected']\n >;\n\n @Listen('dropdownItemSelected')\n handleDropdownItemSelected(\n event: CustomEvent<\n HTMLNvFielddropdownitemElementEventMap['dropdownItemSelected']\n >,\n ) {\n if (this.disabled || this.readonly) return;\n\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n items.forEach(item => {\n if (item !== event.target) {\n item.removeAttribute('selected');\n } else {\n item.setAttribute('selected', 'true');\n }\n });\n\n this.value = event.detail.value;\n this.open = false;\n }\n\n @Listen('openChanged')\n handleOpenChanged(event: CustomEvent<boolean>) {\n this.open = event.detail; // Update `open` based on the popover state\n }\n\n @Watch('filterable')\n watchFilterableHandler(newValue: boolean) {\n this.isFilterable = newValue;\n this.filterable = newValue;\n }\n\n @Watch('value')\n watchValueHandler(newValue: string) {\n if (newValue) {\n this.updateSelectedItem(newValue);\n }\n this.valueChanged.emit(newValue);\n }\n\n @Watch('options')\n handleOptionsChange(newValue: string) {\n if (newValue) {\n try {\n const parsedOpts = JSON.parse(newValue);\n this.parsedOptions = [...parsedOpts];\n const selectedOption = this.parsedOptions.find(opt => opt.selected);\n\n if (selectedOption) {\n this.value = selectedOption.value;\n requestAnimationFrame(() => {\n // Wait for items to be rendered\n this.updateSelectedItem(selectedOption.value);\n });\n }\n } catch (error) {\n console.error('nv-fielddropdown: error parsing options:', error);\n this.parsedOptions = [];\n }\n } else {\n this.parsedOptions = [];\n }\n }\n\n @Listen('blur', { capture: true })\n handleBlur(event: FocusEvent) {\n const target = event.relatedTarget;\n\n if (!(target instanceof Node) || !this.el.contains(target)) {\n this.open = false;\n }\n }\n\n @Listen('keydown', { passive: false })\n handleKeyDown(event: KeyboardEvent) {\n if (!this.open) {\n if (event.key === 'ArrowDown') {\n this.open = true;\n\n if (!this.filterable) {\n // Focus on the first item if it is not filterable\n this.focusFirstItem();\n }\n\n event.preventDefault();\n return;\n }\n return;\n }\n\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem:not([data-empty])'),\n ) as HTMLNvFielddropdownitemElement[];\n\n if (items.length === 0) {\n console.warn('No dropdown items found to navigate');\n return;\n }\n\n let currentIndex = items.findIndex(item =>\n item.classList.contains('highlighted'),\n );\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n currentIndex = (currentIndex + 1) % items.length;\n this.updateHighlightedItem(items, currentIndex);\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n currentIndex = (currentIndex - 1 + items.length) % items.length;\n this.updateHighlightedItem(items, currentIndex);\n } else if (event.key === 'Escape') {\n event.preventDefault();\n this.open = false;\n }\n }\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Retrieves the current filter text entered by the user.\n * @returns {string} The filter text.\n */\n @Method()\n async getFilterText(): Promise<string> {\n return this.filterText;\n }\n\n /**\n * Set the initial selection based on the current value and update the\n * inputElement value.\n */\n private setInitialSelection() {\n if (!this.value) return;\n\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n const selectedItem = items.find(\n item => item.getAttribute('value') === this.value,\n );\n\n items.forEach(item => {\n item.removeAttribute('selected');\n item.classList.remove('selected');\n });\n\n if (selectedItem) {\n selectedItem.setAttribute('selected', 'true');\n selectedItem.classList.add('selected');\n this.value = selectedItem.getAttribute('value');\n if (this.inputElement) {\n this.inputElement.value = this.value;\n }\n } else {\n console.warn('No matching item found for value:', this.value);\n }\n }\n\n private handleInputContainerClick = (event: MouseEvent) => {\n if (this.disabled || this.readonly) {\n return;\n }\n\n const target = event.target as HTMLElement;\n\n if (target.tagName === 'P' || target.tagName === 'SPAN') {\n this.open = true;\n\n // Simulate focus to trigger \"focus-within\" style\n const inputContainer = this.el.querySelector(\n '.input-container',\n ) as HTMLElement;\n if (inputContainer) {\n inputContainer.classList.add('focus-within');\n\n // Remove the \"focus-within\" class after a delay or when the popover is closed\n const removeFocusWithin = () => {\n inputContainer.classList.remove('focus-within');\n };\n\n // Or remove the class when the popover is closed\n this.popoverElement.addEventListener('hide', removeFocusWithin);\n }\n }\n };\n\n private handleInput = (event: Event) => {\n if (!this.filterable) return;\n if (this.disabled || this.readonly) {\n return;\n }\n\n const input = event.target as HTMLInputElement;\n this.filterText = input.value.toLowerCase();\n this.filterItems();\n };\n\n /**\n * Filter dropdown items based on the text entered by the user.\n * If no items are found, display a message indicating no results.\n */\n private filterItems() {\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n // Remove the \"no results found\" item if it exists\n const existingEmptyItem = this.el.querySelector(\n 'nv-fielddropdownitem[data-empty]',\n );\n if (existingEmptyItem) {\n existingEmptyItem.remove();\n }\n\n let hasVisibleItems = false;\n\n // Iterate over all items and adjust their visibility\n items.forEach(item => {\n const textContent = item.textContent?.toLowerCase() || ''; // Get the textual content of the slot\n const value = item.value?.toLowerCase() || ''; // Get the value of the `value` attribute\n\n // Check if the filtered text is present either in the value or in the textual content\n const shouldShow =\n value.includes(this.filterText) ||\n textContent.includes(this.filterText);\n\n item.style.display = shouldShow ? '' : 'none'; // Hide or show the item\n\n if (shouldShow) {\n hasVisibleItems = true;\n }\n });\n\n // If no items are visible, add the \"no results found\" item\n if (!hasVisibleItems) {\n const emptyItem = document.createElement('nv-fielddropdownitem');\n emptyItem.setAttribute('data-empty', 'true');\n emptyItem.setAttribute('disabled', 'true');\n emptyItem.textContent = this.emptyResult;\n this.el.querySelector('ul[slot=\"content\"]')?.appendChild(emptyItem);\n }\n }\n\n /** Reset the filter and make all items visible. */\n private resetFilter() {\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n items.forEach(item => {\n item.style.display = '';\n });\n }\n\n private handleInputFocus = () => {\n if (this.disabled || this.readonly) return;\n\n this.open = true;\n };\n\n private togglePopover = () => {\n if (this.disabled || this.readonly) return;\n\n this.open = !this.open;\n\n if (this.open && !this.filterable) {\n this.focusFirstItem();\n }\n };\n\n private updateHighlightedItem(\n items: HTMLNvFielddropdownitemElement[],\n index: number,\n ) {\n items.forEach((item, i) => {\n if (i === index) {\n item.classList.add('highlighted');\n item.focus();\n item.scrollIntoView({ block: 'nearest' });\n } else {\n item.classList.remove('highlighted');\n }\n });\n }\n\n private focusFirstItem() {\n const firstItem = this.el.querySelector('nv-fielddropdownitem');\n if (firstItem) {\n (firstItem as HTMLElement).focus();\n this.updateHighlightedItem(\n Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[],\n 0,\n );\n } else {\n console.warn('nv-fielddropdown: no first item found to focus');\n }\n }\n\n private updateSelectedItem(value: string) {\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n const matchingItem = items.find(item => {\n const itemLabel = item.getAttribute('label');\n const itemValue = item.getAttribute('value');\n const itemText = item.textContent?.trim();\n\n return itemLabel === value || itemValue === value || itemText === value;\n });\n\n items.forEach(item => {\n if (item === matchingItem) {\n item.setAttribute('selected', '');\n } else {\n item.removeAttribute('selected');\n }\n });\n\n if (matchingItem && this.inputElement) {\n this.inputElement.value = value;\n }\n }\n\n private getSelectedLabel = (): string => {\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n const matchingItem = items.find(\n item => item.getAttribute('value') === this.value,\n );\n return matchingItem\n ? matchingItem.label ??\n matchingItem.textContent?.trim() ??\n matchingItem.value\n : '';\n };\n\n private clearFilter = () => {\n this.filterText = '';\n this.inputElement.value = '';\n this.inputElement.focus();\n this.filterItems();\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillLoad() {\n this.resetFilter();\n this.setInitialSelection();\n\n if (this.filterable && this.filterText) {\n this.filterItems();\n }\n if (this.options) {\n this.handleOptionsChange(this.options);\n }\n if (this.value) {\n this.updateSelectedItem(this.value);\n }\n }\n\n componentDidLoad() {\n if (this.value) {\n this.updateSelectedItem(this.value);\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host>\n {(this.label || this.el.querySelector('[slot=\"label\"]')) && (\n <label htmlFor={this.inputId}>\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\n\n <nv-popover\n ref={el => (this.popoverElement = el as HTMLNvPopoverElement)}\n triggerMode=\"controlled\"\n placement=\"bottom-start\"\n open={this.open}\n >\n <div class=\"input-wrapper\" slot=\"trigger\">\n <slot name=\"before-input\"></slot>\n\n <div\n class=\"input-container\"\n onClick={this.handleInputContainerClick}\n >\n <slot name=\"leading-input\"></slot>\n\n {this.isFilterable || this.disabled || this.readonly ? (\n <input\n id={this.inputId}\n type=\"search\"\n ref={e => (this.inputElement = e)}\n autofocus={this.autofocus}\n autocomplete={this.autocomplete}\n placeholder={this.placeholder}\n name={this.name}\n value={this.getSelectedLabel()}\n required={this.required}\n disabled={this.disabled}\n readOnly={this.readonly}\n onInput={this.handleInput}\n onFocus={this.handleInputFocus}\n onKeyDown={this.handleKeyDown}\n />\n ) : (\n <p\n id={this.inputId}\n class=\"non-filterable-text\"\n onClick={this.handleInputContainerClick}\n tabIndex={this.disabled ? -1 : 0}\n onKeyDown={this.handleKeyDown}\n onFocus={this.handleInputFocus}\n >\n <span>\n {this.getSelectedLabel() || this.value || this.placeholder}\n </span>\n </p>\n )}\n\n {this.isFilterable && this.filterText && this.open && (\n <nv-iconbutton\n name=\"x\"\n size=\"md\"\n emphasis=\"lower\"\n class=\"clear-button\"\n onClick={this.clearFilter}\n aria-label=\"Clear input\"\n />\n )}\n\n {this.error && (\n <nv-icon name=\"alert-circle\" class=\"validation\" size=\"md\" />\n )}\n\n <nv-iconbutton\n data-scope=\"toggle-dropdown\"\n name={this.open ? 'chevron-top' : 'chevron-down'}\n size=\"md\"\n emphasis=\"lower\"\n aria-label={this.open ? 'Hide dropdown' : 'Show dropdown'}\n aria-pressed={this.open.toString()}\n onClick={this.togglePopover}\n tabIndex={this.disabled ? -1 : 0}\n />\n </div>\n\n <slot name=\"after-input\"></slot>\n </div>\n\n <div slot=\"content\">\n {this.parsedOptions.length > 0 ? (\n <ul>\n {this.parsedOptions.map(option => (\n <nv-fielddropdownitem\n label={option.label}\n value={option.value}\n disabled={option.disabled}\n selected={option.value === this.value}\n />\n ))}\n </ul>\n ) : (\n <slot name=\"content\"></slot>\n )}\n </div>\n </nv-popover>\n\n {(this.description ||\n this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\">\n <slot name=\"description\">{this.description}</slot>\n </div>\n )}\n\n {(this.errorDescription ||\n this.el.querySelector('[slot=\"error-description\"]')) && (\n <div hidden={!this.error} class=\"error-description\">\n <slot name=\"error-description\">{this.errorDescription}</slot>\n </div>\n )}\n </Host>\n );\n }\n //#endregion RENDER\n}\n"],"version":3}
1
+ {"file":"nv-fielddropdown.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,kBAAkB,GAAG,8nMAA8nM,CAAC;AAC1pM,8BAAe,kBAAkB;;MC+BpB,eAAe;IAN5B;;;;;;;;;;;;QAqBW,YAAO,GAAWA,KAAM,EAAE,CAAC;;;;QAwCpC,SAAI,GAAY,KAAK,CAAC;;;;;;;QASb,iBAAY,GAA+B,KAAK,CAAC;;;;;QAejD,aAAQ,GAAY,KAAK,CAAC;;;;;;QAQ1B,UAAK,GAAY,KAAK,CAAC;;;;;;QAgBvB,a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7CA,kEAAK,KAAK,EAAC,aAAa,IACtBA,mEAAM,IAAI,EAAC,aAAa,IAAE,IAAI,CAAC,WAAW,CAAQ,CAC9C,CACP,EAEA,CAAC,IAAI,CAAC,gBAAgB;YACrB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,4BAA4B,CAAC,MACnDA,kEAAK,MAAM,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAC,mBAAmB,IACjDA,mEAAM,IAAI,EAAC,mBAAmB,IAAE,IAAI,CAAC,gBAAgB,CAAQ,CACzD,CACP,CACI,EACP;KACH;;;;;;;;;;;;;","names":["uuidv4","h","Host"],"sources":["src/components/nv-fielddropdown/styles/nv-fielddropdown.scss?tag=nv-fielddropdown","src/components/nv-fielddropdown/nv-fielddropdown.tsx"],"sourcesContent":["@use \"./mixins\" as *;\n@import '../../../styles/form-field';\n\nnv-fielddropdown {\n @include form-field-variables();\n @include form-field-root();\n\n &[readonly]:not([readonly='false']) {\n @include form-field-readonly-variables();\n }\n\n &[error]:not([error='false']) {\n @include form-field-error-variables();\n }\n\n &[required]:not([required='false']) label {\n @include form-field-label-required();\n }\n\n &[hidden]:not([hidden='false']) label {\n display: none;\n }\n\n label {\n @include form-field-label();\n }\n\n nv-popover {\n @include form-field-popover();\n }\n\n .input-wrapper {\n @include form-field-input-wrapper();\n @include input-wrapper-styles();\n }\n\n .input-container {\n @include form-field-input-container();\n @include input-container-styles();\n\n input[type=\"search\"]::-webkit-search-decoration,\n input[type=\"search\"]::-webkit-search-cancel-button,\n input[type=\"search\"]::-webkit-search-results-button,\n input[type=\"search\"]::-webkit-search-results-decoration {\n -webkit-appearance:none;\n }\n\n input,\n p.non-filterable-text {\n @include form-field-input();\n }\n\n > nv-iconbutton {\n @include form-field-action();\n }\n\n nv-icon.validation {\n @include form-field-icon();\n }\n }\n\n .non-filterable-text {\n @include non-filterable-text-styles();\n }\n\n .description {\n @include form-field-description();\n }\n\n .error-description {\n @include form-field-error-description();\n }\n}\n","import {\n Component,\n Host,\n h,\n Element,\n Prop,\n State,\n Listen,\n Event,\n EventEmitter,\n Watch,\n Method,\n} from '@stencil/core';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { TextInputAutocomplete } from '../../utils/constants';\n\n/**\n * @slot content - Use a <ul></ul> tag for the slot, and place <nv-dropdownitem> elements inside.\n * @slot leading-input - Content to be placed before the input text, within the input container.\n * @slot before-input - Content to be placed before the input text, outside the input container.\n * @slot after-input - Content to be placed after the input text, outside the input container.\n * @slot label - Content to be placed as the label, will override the label prop.\n * @slot description - Content to be placed as the description, will override the description prop.\n * @slot error-description - Content to be placed as the error description, will override the errorDescription prop.\n */\n@Component({\n tag: 'nv-fielddropdown',\n styleUrl: 'styles/nv-fielddropdown.scss',\n shadow: false,\n formAssociated: true,\n})\nexport class NvFielddropdown {\n @Element() el: HTMLNvFielddropdownElement;\n private inputElement: HTMLInputElement;\n private popoverElement!: HTMLNvPopoverElement;\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the input element and the for attribute of the associated\n * label. If no ID is provided, a random one will be automatically generated\n * to ensure unique identification, facilitating proper label association and\n * accessibility.\n */\n @Prop({ reflect: true })\n readonly inputId: string = uuidv4();\n\n /**\n * Lets you define the text that explains what users should enter in the text\n * input field. It's a crucial element for making forms clear and\n * user-friendly.\n */\n @Prop({ reflect: true })\n readonly label: string;\n\n /**\n * Add helpful hints or extra information under the text input field. This is\n * where you can clarify what users should enter or provide additional\n * instructions, making the form easier to fill out correctly.\n */\n @Prop({ reflect: true })\n readonly description: string;\n\n /**\n * Display temporary text inside the input field to give users a hint about\n * what to type. It's a great way to provide examples or suggestions directly\n * in the field before they start typing.\n * The placeholder is displayed only when the filterable option is enabled.\n */\n @Prop({ reflect: true })\n readonly placeholder: string;\n\n /**\n * Defines the name attribute of the input field, which is crucial for form\n * submission. This value is used as the key in the key-value pair sent to\n * the server, representing the input's data in form submissions. It should be\n * unique within the form to avoid conflicts.\n */\n @Prop({ reflect: true })\n readonly name: string;\n\n /**\n * State of the dropdown popover.\n */\n @Prop({ reflect: true, mutable: true })\n open: boolean = false;\n\n /**\n * The autocomplete prop helps users fill out the input field faster by\n * suggesting entries they've used before, like their email or address.\n * You can turn it on to make forms more convenient or off to ensure users\n * always type in fresh data.\n */\n @Prop({ reflect: true })\n readonly autocomplete: `${TextInputAutocomplete}` = 'off';\n\n /**\n * Specifies the value of the input field, which determines the text displayed\n * within the field. This prop is typically used in controlled components\n * where the input's value is managed by the component's state.\n */\n @Prop({ reflect: true, mutable: true })\n value: string;\n\n /**\n * Marks the input field as required, ensuring that the user must fill it out\n * before submitting the form.\n */\n @Prop({ reflect: true })\n readonly required: boolean = false;\n\n /**\n * Alters the input field's appearance to indicate an error, helping users\n * identify fields that need correction.\n * @validator error\n */\n @Prop({ reflect: true })\n readonly error: boolean = false;\n\n /**\n * A description that appears when there is an error related to the dropdown\n * field.\n * @validator message\n */\n @Prop({ reflect: true })\n readonly errorDescription: string;\n\n /**\n * Display the input field's content without allowing users to change it.\n * Users can still click on it, select, and copy the text, but they won't be\n * able to type or delete anything.\n */\n @Prop({ reflect: true })\n readonly readonly: boolean = false;\n\n /**\n * The disabled prop lets you turn off the input field so that users can't\n * type in it. When disabled, the field is grayed out and won't respond to\n * clicks or touches.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * The text to display when no items match the filter.\n */\n @Prop({ reflect: true })\n readonly emptyResult: string = 'No results found';\n\n /**\n * Enables or disables the filtering feature for the dropdown items.\n */\n @Prop({ reflect: true, mutable: true })\n filterable: boolean = false;\n\n /**\n * List of options available in the dropdown. The options are passed as a JSON\n * string.\n *\n * @example\n * options=[{\n * \"label\": \"Option 1\",\n * \"value\": \"option1\",\n * \"selected\": true\n * },\n * {\n * \"label\": \"Option 2\",\n * \"value\": \"option2\"\n * }]\n */\n @Prop({ reflect: true })\n readonly options?: string;\n\n /**\n * Applies focus to the input field as soon as the component is mounted. This\n * is equivalent to setting the native autofocus attribute on an <input>\n * element.\n */\n @Prop({ reflect: true })\n // eslint-disable-next-line @stencil-community/reserved-member-names\n readonly autofocus: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region STATE\n\n /** The text entered by the user for filtering dropdown items. */\n @State()\n filterText: string = '';\n\n @State()\n isFilterable: boolean = this.filterable;\n\n @State()\n selectedValues: Set<string> = new Set();\n\n /**\n * Options configuration for the dropdown items.\n */\n @State()\n parsedOptions: Array<{\n /** Label to display for the option */\n label: string;\n /** Value associated with the option */\n value: string;\n /** Whether this option is disabled */\n disabled?: boolean;\n /** Whether this option is pre-selected */\n selected?: boolean;\n }> = [];\n\n //#endregion STATE\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the input value changes.\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<string>;\n\n /**\n * Event emitted when an item is clicked.\n */\n @Event()\n dropdownItemSelected: EventEmitter<\n HTMLNvFielddropdownitemElementEventMap['dropdownItemSelected']\n >;\n\n @Listen('dropdownItemSelected')\n handleDropdownItemSelected(\n event: CustomEvent<\n HTMLNvFielddropdownitemElementEventMap['dropdownItemSelected']\n >,\n ) {\n if (this.disabled || this.readonly) return;\n\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n items.forEach(item => {\n if (item !== event.target) {\n item.removeAttribute('selected');\n } else {\n item.setAttribute('selected', 'true');\n }\n });\n\n this.clearFilter();\n this.value = event.detail.value;\n this.open = false;\n }\n\n @Listen('openChanged')\n handleOpenChanged(event: CustomEvent<boolean>) {\n this.open = event.detail; // Update `open` based on the popover state\n }\n\n @Watch('filterable')\n watchFilterableHandler(newValue: boolean) {\n this.isFilterable = newValue;\n this.filterable = newValue;\n }\n\n @Watch('value')\n watchValueHandler(newValue: string) {\n this.valueChanged.emit(newValue);\n }\n\n @Watch('options')\n handleOptionsChange(newValue: string) {\n if (newValue) {\n try {\n const parsedOpts = JSON.parse(newValue);\n this.parsedOptions = [...parsedOpts];\n if (!this.value) {\n const defaultValue = parsedOpts.find(option => option.selected);\n this.value = defaultValue?.value ?? '';\n this.updateSelectedItem(this.value);\n }\n } catch (error) {\n console.error('nv-fielddropdown: error parsing options:', error);\n this.parsedOptions = [];\n }\n } else {\n this.parsedOptions = [];\n }\n }\n\n @Listen('blur', { capture: true })\n handleBlur(event: FocusEvent) {\n const target = event.relatedTarget;\n if (!(target instanceof Node) || !this.el.contains(target)) {\n this.open = false;\n\n if (this.inputElement) {\n this.filterText = '';\n this.inputElement.value = this.getSelectedLabel();\n setTimeout(() => {\n this.filterItems();\n }, 200);\n }\n }\n }\n\n @Listen('keydown', { passive: false })\n handleKeyDown(event: KeyboardEvent) {\n if (!this.el) return;\n if (!this.open) {\n if (event.key === 'ArrowDown') {\n this.open = true;\n\n event.preventDefault();\n return;\n }\n return;\n }\n\n const items = Array.from(\n this.el.querySelectorAll(\n 'nv-fielddropdownitem:not([disabled]):not([hidden])',\n ),\n ) as HTMLNvFielddropdownitemElement[];\n\n let currentIndex = items.findIndex(item =>\n item.classList.contains('highlighted'),\n );\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n currentIndex = (currentIndex + 1) % items.length;\n this.updateHighlightedItem(items, currentIndex);\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n currentIndex = (currentIndex - 1 + items.length) % items.length;\n this.updateHighlightedItem(items, currentIndex);\n } else if (event.key === 'Escape') {\n event.preventDefault();\n this.open = false;\n }\n }\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Retrieves the current filter text entered by the user.\n * @returns {string} The filter text.\n */\n @Method()\n async getFilterText(): Promise<string> {\n return this.filterText;\n }\n\n private handleInputContainerClick = (event: MouseEvent) => {\n if (this.disabled || this.readonly) {\n return;\n }\n\n const target = event.target as HTMLElement;\n\n if (target.tagName === 'P' || target.tagName === 'SPAN') {\n this.open = true;\n\n // Simulate focus to trigger \"focus-within\" style\n const inputContainer = this.el.querySelector(\n '.input-container',\n ) as HTMLElement;\n if (inputContainer) {\n inputContainer.classList.add('focus-within');\n\n // Remove the \"focus-within\" class after a delay or when the popover is closed\n const removeFocusWithin = () => {\n inputContainer.classList.remove('focus-within');\n };\n\n // Or remove the class when the popover is closed\n this.popoverElement.addEventListener('hide', removeFocusWithin);\n }\n }\n };\n\n private handleInput = (event: Event) => {\n if (!this.filterable) return;\n if (this.disabled || this.readonly) {\n return;\n }\n\n const input = event.target as HTMLInputElement;\n this.open = true;\n this.filterText = input.value.toLowerCase();\n this.filterItems();\n };\n\n /**\n * Filter dropdown items based on the text entered by the user.\n * If no items are found, display a message indicating no results.\n */\n private filterItems() {\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n // Remove the \"no results found\" item if it exists\n const existingEmptyItem = this.el.querySelector(\n 'nv-fielddropdownitem[data-empty]',\n );\n if (existingEmptyItem) {\n existingEmptyItem.remove();\n }\n\n let hasVisibleItems = false;\n\n // Iterate over all items and adjust their visibility\n items.forEach(item => {\n const textContent = item.textContent?.toLowerCase() || ''; // Get the textual content of the slot\n const value = item.value?.toLowerCase() || ''; // Get the value of the `value` attribute\n\n // Check if the filtered text is present either in the value or in the textual content\n const shouldShow =\n value.includes(this.filterText) ||\n textContent.includes(this.filterText);\n\n if (shouldShow) item.removeAttribute('hidden');\n else item.setAttribute('hidden', '');\n\n if (shouldShow) {\n hasVisibleItems = true;\n }\n });\n\n // If no items are visible, add the \"no results found\" item\n if (!hasVisibleItems) {\n const emptyItem = document.createElement('nv-fielddropdownitem');\n emptyItem.setAttribute('data-empty', 'true');\n emptyItem.setAttribute('disabled', 'true');\n emptyItem.textContent = this.emptyResult;\n this.el.querySelector('ul[slot=\"content\"]')?.appendChild(emptyItem);\n }\n }\n\n /** Reset the filter and make all items visible. */\n private resetFilter() {\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n items.forEach(item => {\n item.style.display = '';\n });\n }\n\n private handleInputFocus = () => {\n if (this.disabled || this.readonly) return;\n this.open = true;\n };\n\n private togglePopover = () => {\n if (this.disabled || this.readonly) return;\n this.open = !this.open;\n };\n\n private updateHighlightedItem(\n items: HTMLNvFielddropdownitemElement[],\n index: number,\n ) {\n items.forEach((item, i) => {\n if (i === index) {\n item.classList.add('highlighted');\n item.focus();\n item.scrollIntoView({ block: 'nearest' });\n } else {\n item.classList.remove('highlighted');\n }\n });\n }\n\n private getSelectedLabel = (): string => {\n if (!this.value) return '';\n\n if (this.parsedOptions.length > 1) {\n const matchingItem = this.parsedOptions.find(\n option => option.value === this.value,\n );\n return matchingItem?.label ?? matchingItem?.value ?? this.value;\n }\n\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n const matchingItem = items.find(item => item.value === this.value);\n\n const selectedLabel = matchingItem\n ? matchingItem.label ??\n matchingItem.textContent?.trim() ??\n matchingItem.value\n : '';\n\n return selectedLabel;\n };\n\n private clearFilter = () => {\n if (!this.filterable) return;\n\n this.filterText = '';\n this.inputElement.value = this.getSelectedLabel();\n this.inputElement.focus();\n this.filterItems();\n };\n\n private updateSelectedItem(value: string) {\n if (!value) return;\n\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n const matchingItem = items.find(item => {\n const itemLabel = item.getAttribute('label');\n const itemValue = item.getAttribute('value');\n const itemText = item.textContent?.trim();\n return itemLabel === value || itemValue === value || itemText === value;\n });\n\n items.forEach(item => {\n if (item === matchingItem) {\n item.setAttribute('selected', '');\n } else {\n item.removeAttribute('selected');\n }\n });\n }\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillLoad() {\n this.resetFilter();\n\n if (this.filterable && this.filterText) {\n this.filterItems();\n }\n if (this.options) {\n this.handleOptionsChange(this.options);\n }\n }\n\n componentDidLoad() {\n if (this.value) {\n this.updateSelectedItem(this.value);\n }\n if (this.inputElement) {\n this.inputElement.value = this.getSelectedLabel();\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host\n role=\"combobox\"\n aria-expanded={this.open.toString()}\n aria-haspopup=\"listbox\"\n aria-label={this.label}\n >\n {(this.label || this.el.querySelector('[slot=\"label\"]')) && (\n <label htmlFor={this.inputId}>\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\n <nv-popover\n ref={el => (this.popoverElement = el as HTMLNvPopoverElement)}\n triggerMode=\"controlled\"\n placement=\"bottom-start\"\n open={this.open}\n >\n <div class=\"input-wrapper\" slot=\"trigger\">\n <slot name=\"before-input\"></slot>\n\n <div\n class=\"input-container\"\n onClick={this.handleInputContainerClick}\n >\n <slot name=\"leading-input\"></slot>\n\n {this.isFilterable || this.disabled || this.readonly ? (\n <input\n data-scope=\"focusable\"\n id={this.inputId}\n type=\"search\"\n ref={e => (this.inputElement = e)}\n autofocus={this.autofocus}\n autocomplete={this.autocomplete}\n placeholder={this.placeholder}\n name={this.name}\n value={this.getSelectedLabel()}\n required={this.required}\n disabled={this.disabled}\n readOnly={this.readonly}\n onInput={this.handleInput}\n onFocus={this.handleInputFocus}\n onClick={this.handleInputFocus}\n onKeyDown={this.handleKeyDown}\n />\n ) : (\n <p\n data-scope=\"focusable\"\n id={this.inputId}\n class=\"non-filterable-text\"\n onClick={this.handleInputContainerClick}\n tabIndex={this.disabled ? -1 : 0}\n onKeyDown={this.handleKeyDown}\n onFocus={this.handleInputFocus}\n >\n {this.getSelectedLabel() || this.value || this.placeholder}\n </p>\n )}\n\n {this.isFilterable && this.filterText && this.open && (\n <nv-iconbutton\n name=\"x\"\n size=\"md\"\n emphasis=\"lower\"\n class=\"clear-button\"\n onClick={this.clearFilter}\n aria-label=\"Clear input\"\n />\n )}\n\n {this.error && (\n <nv-icon name=\"alert-circle\" class=\"validation\" size=\"md\" />\n )}\n\n <nv-iconbutton\n data-scope=\"toggle-dropdown\"\n name={this.open ? 'chevron-top' : 'chevron-down'}\n size=\"md\"\n emphasis=\"lower\"\n aria-label={this.open ? 'Hide dropdown' : 'Show dropdown'}\n aria-pressed={this.open.toString()}\n onClick={this.togglePopover}\n tabIndex={this.disabled ? -1 : 0}\n />\n </div>\n\n <slot name=\"after-input\"></slot>\n </div>\n\n <div slot=\"content\">\n {this.parsedOptions.length > 0 ? (\n <ul>\n {this.parsedOptions.map(option => (\n <nv-fielddropdownitem\n label={option.label}\n value={option.value}\n disabled={option.disabled}\n selected={option.value === this.value}\n />\n ))}\n </ul>\n ) : (\n <slot name=\"content\"></slot>\n )}\n </div>\n </nv-popover>\n\n {(this.description ||\n this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\">\n <slot name=\"description\">{this.description}</slot>\n </div>\n )}\n\n {(this.errorDescription ||\n this.el.querySelector('[slot=\"error-description\"]')) && (\n <div hidden={!this.error} class=\"error-description\">\n <slot name=\"error-description\">{this.errorDescription}</slot>\n </div>\n )}\n </Host>\n );\n }\n //#endregion RENDER\n}\n"],"version":3}
@@ -26,33 +26,31 @@ const NvFielddropdownitem = class {
26
26
  /****************************************************************************/
27
27
  //#region METHODS
28
28
  this.handleSelected = () => {
29
- if (this.disabled || this.selected)
29
+ if (this.disabled)
30
30
  return;
31
- this.selected = true;
32
31
  this.dropdownItemSelected.emit({
33
32
  label: this.label,
34
33
  value: this.value,
35
- selected: this.selected,
36
- disabled: this.disabled,
37
34
  });
38
35
  };
39
36
  }
40
37
  handleKeyDown(event) {
38
+ var _a, _b;
41
39
  if (event.target !== this.el)
42
40
  return;
43
41
  if (event.key === 'Enter' || event.key === ' ') {
44
42
  event.preventDefault();
45
43
  this.handleSelected();
44
+ (_b = (_a = this.el
45
+ .closest('nv-fielddropdown')) === null || _a === void 0 ? void 0 : _a.querySelector("[data-scope='focusable']")) === null || _b === void 0 ? void 0 : _b.focus();
46
46
  }
47
47
  }
48
48
  //#endregion METHODS
49
49
  /****************************************************************************/
50
50
  //#region LIFECYCLE
51
51
  componentWillLoad() {
52
- this.composed = Boolean(this.el.children.length);
53
- }
54
- componentDidLoad() {
55
52
  var _a;
53
+ this.composed = Boolean(this.el.children.length);
56
54
  if (!this.value) {
57
55
  const fallback = (_a = this.label) !== null && _a !== void 0 ? _a : this.el.textContent;
58
56
  this.value = fallback.replace(/\W+/g, ''); // Remove non-word characters
@@ -62,7 +60,7 @@ const NvFielddropdownitem = class {
62
60
  /****************************************************************************/
63
61
  //#region RENDER
64
62
  render() {
65
- return (index.h(index.Host, { key: '00b69c6a38cf852643a7e239bf07d7a123c84dc7', role: "menuitem", tabindex: '-1', onClick: this.handleSelected }, index.h("slot", { key: '4bd9cc35162030b57de567de4b824728c6d3c031' }), !this.composed && (index.h("div", { key: '17fde413045c683a09467037a4513649deda8eeb', class: "text-wrapper" }, index.h("span", { key: 'e4ae14322a14725d142ce57da45e50edff416935', "data-scope": "text" }, this.label))), this.selected && (index.h("nv-icon", { key: '95536cced4b7abeca334eee13e38870cd642ebc5', name: "check", "aria-hidden": "true", "data-scope": "selected" }))));
63
+ return (index.h(index.Host, { key: 'acee05b9d46a503b8ca19acf9f96577f83686c38', role: "menuitem", tabindex: '-1', onClick: this.handleSelected }, index.h("slot", { key: '07eb6931adeb42c1bd9d83b58ef43d07eb0fd4df' }), !this.composed && (index.h("div", { key: '4a1c9d51f6d7e2ea3680ddd2294bc5a88c6a354b', class: "text-wrapper" }, index.h("span", { key: '6f13add04158044d4b3cd00b386ed0ed5cde87fc', "data-scope": "text" }, this.label))), this.selected && (index.h("nv-icon", { key: '88bfab2accd9b3bb8a2bb8fbbc6bafab8712432e', name: "check", "aria-hidden": "true", "data-scope": "selected" }))));
66
64
  }
67
65
  get el() { return index.getElement(this); }
68
66
  };
@@ -1 +1 @@
1
- {"file":"nv-fielddropdownitem.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,sBAAsB,GAAG,utCAAutC,CAAC;AACvvC,kCAAe,sBAAsB;;MCkBxB,mBA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AAI,CAAC,cAAc,IAChED,oEAAQ,EAEP,CAAC,IAAI,CAAC,QAAQ,KACbA,kEAAK,KAAK,EAAC,cAAc,IACvBA,iFAAiB,MAAM,IAAE,IAAI,CAAC,KAAK,CAAQ,CACvC,CACP,EAEA,IAAI,CAAC,QAAQ,KACZA,sEAAS,IAAI,EAAC,OAAO,iBAAa,MAAM,gBAAY,UAAU,GAAG,CAClE,CACI,EACP;KACH;;;;;;;","names":["h","Host"],"sources":["src/components/nv-fielddropdownitem/styles/nv-fielddropdownitem.scss?tag=nv-fielddropdownitem","src/components/nv-fielddropdownitem/nv-fielddropdownitem.tsx"],"sourcesContent":["@use \"./mixins\" as *;\n\nnv-fielddropdownitem {\n @include root-styles();\n\n &[disabled]:not([disabled='false']) {\n @include disabled-styles();\n }\n\n .text-wrapper {\n @include text-wrapper-styles();\n }\n\n [data-scope='text'] {\n @include text-styles();\n }\n\n nv-icon[data-scope='selected'] {\n @include selected-icon-styles();\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Event,\n EventEmitter,\n Element,\n Listen,\n} from '@stencil/core';\n\n/**\n * @slot default - The content to be displayed inside the dropdown item.\n */\n@Component({\n tag: 'nv-fielddropdownitem',\n styleUrl: 'styles/nv-fielddropdownitem.scss',\n shadow: false,\n})\nexport class NvFielddropdownitem {\n @Element() el: HTMLNvFielddropdownitemElement;\n private composed = false;\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Disables the item, preventing any user interaction.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Indicates if the item is selected.\n */\n @Prop({ reflect: true, mutable: true })\n selected: boolean = false;\n\n /**\n * Value associated with the item. This is recommended and required for proper\n * form management.\n */\n @Prop({ reflect: true, mutable: true })\n value?: string;\n\n /**\n * Specifies the text label for the dropdown item.\n *\n * When no default slot is provided, this label is rendered as the item's\n * visible text. If the default slot is supplied, the label isn’t directly\n * displayed but is used as the selected text (on the dropdown trigger). If\n * no label is explicitly set, the component will automatically derive the\n * label from the text content of the default slot.\n */\n @Prop({ reflect: true })\n readonly label?: string;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Event emitted when the dropdown item is selected.\n */\n @Event()\n dropdownItemSelected: EventEmitter<{\n /** The value associated with the item. */\n label?: string;\n /** The value associated with the item. */\n value: string;\n /** Indicates if the item is selected. */\n selected: boolean;\n /** Disables the item, preventing any user interaction. */\n disabled: boolean;\n }>;\n\n @Listen('keydown', { passive: false })\n handleKeyDown(event: KeyboardEvent) {\n if (event.target !== this.el) return;\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.handleSelected();\n }\n }\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region METHODS\n\n private handleSelected = () => {\n if (this.disabled || this.selected) return;\n\n this.selected = true;\n this.dropdownItemSelected.emit({\n label: this.label,\n value: this.value,\n selected: this.selected,\n disabled: this.disabled,\n });\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillLoad() {\n this.composed = Boolean(this.el.children.length);\n }\n\n componentDidLoad() {\n if (!this.value) {\n const fallback = this.label ?? this.el.textContent;\n this.value = fallback.replace(/\\W+/g, ''); // Remove non-word characters\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host role=\"menuitem\" tabindex={'-1'} onClick={this.handleSelected}>\n <slot />\n\n {!this.composed && (\n <div class=\"text-wrapper\">\n <span data-scope=\"text\">{this.label}</span>\n </div>\n )}\n\n {this.selected && (\n <nv-icon name=\"check\" aria-hidden=\"true\" data-scope=\"selected\" />\n )}\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"],"version":3}
1
+ {"file":"nv-fielddropdownitem.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,sBAAsB,GAAG,utCAAutC,CAAC;AACvvC,kCAAe,sBAAsB;;MCkBxB,mBAAmB;IALhC;;;QAOU,aAAQ,GAAG,KAAK,CAAC;;;;;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AC,cAAc,IACvBA,iFAAiB,MAAM,IAAE,IAAI,CAAC,KAAK,CAAQ,CACvC,CACP,EAEA,IAAI,CAAC,QAAQ,KACZA,sEAAS,IAAI,EAAC,OAAO,iBAAa,MAAM,gBAAY,UAAU,GAAG,CAClE,CACI,EACP;KACH;;;;;;;","names":["h","Host"],"sources":["src/components/nv-fielddropdownitem/styles/nv-fielddropdownitem.scss?tag=nv-fielddropdownitem","src/components/nv-fielddropdownitem/nv-fielddropdownitem.tsx"],"sourcesContent":["@use \"./mixins\" as *;\n\nnv-fielddropdownitem {\n @include root-styles();\n\n &[disabled]:not([disabled='false']) {\n @include disabled-styles();\n }\n\n .text-wrapper {\n @include text-wrapper-styles();\n }\n\n [data-scope='text'] {\n @include text-styles();\n }\n\n nv-icon[data-scope='selected'] {\n @include selected-icon-styles();\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Event,\n EventEmitter,\n Element,\n Listen,\n} from '@stencil/core';\n\n/**\n * @slot default - The content to be displayed inside the dropdown item.\n */\n@Component({\n tag: 'nv-fielddropdownitem',\n styleUrl: 'styles/nv-fielddropdownitem.scss',\n shadow: false,\n})\nexport class NvFielddropdownitem {\n @Element() el: HTMLNvFielddropdownitemElement;\n private composed = false;\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Disables the item, preventing any user interaction.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Indicates if the item is selected.\n */\n @Prop({ reflect: true })\n readonly selected: boolean = false;\n\n /**\n * Value associated with the item. This is recommended and required for proper\n * form management.\n */\n @Prop({ reflect: true, mutable: true })\n value?: string;\n\n /**\n * Specifies the text label for the dropdown item.\n *\n * When no default slot is provided, this label is rendered as the item's\n * visible text. If the default slot is supplied, the label isn’t directly\n * displayed but is used as the selected text (on the dropdown trigger). If\n * no label is explicitly set, the component will automatically derive the\n * label from the text content of the default slot.\n */\n @Prop({ reflect: true })\n readonly label?: string;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Event emitted when the dropdown item is selected.\n */\n @Event()\n dropdownItemSelected: EventEmitter<{\n /** The value associated with the item. */\n label?: string;\n /** The value associated with the item. */\n value: string;\n }>;\n\n @Listen('keydown', { passive: false })\n handleKeyDown(event: KeyboardEvent) {\n if (event.target !== this.el) return;\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.handleSelected();\n\n this.el\n .closest('nv-fielddropdown')\n ?.querySelector<HTMLElement>(\"[data-scope='focusable']\")\n ?.focus();\n }\n }\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region METHODS\n\n private handleSelected = () => {\n if (this.disabled) return;\n\n this.dropdownItemSelected.emit({\n label: this.label,\n value: this.value,\n });\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillLoad() {\n this.composed = Boolean(this.el.children.length);\n if (!this.value) {\n const fallback = this.label ?? this.el.textContent;\n this.value = fallback.replace(/\\W+/g, ''); // Remove non-word characters\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host role=\"menuitem\" tabindex={'-1'} onClick={this.handleSelected}>\n <slot />\n\n {!this.composed && (\n <div class=\"text-wrapper\">\n <span data-scope=\"text\">{this.label}</span>\n </div>\n )}\n\n {this.selected && (\n <nv-icon name=\"check\" aria-hidden=\"true\" data-scope=\"selected\" />\n )}\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"],"version":3}
@@ -112,9 +112,9 @@ const NvFieldnumber = class {
112
112
  /****************************************************************************/
113
113
  //#region RENDER
114
114
  render() {
115
- return (index.h(index.Host, { key: '14de76d6ddda9977fa3ad28d6e9d2acf613565fa' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '22131a183df8f9612d7d1fc4c7904f7e9e3fba71', htmlFor: this.inputId }, index.h("slot", { key: '48cca38b15579499662018d593bd9e73129565da', name: "label" }, this.label))), index.h("div", { key: '9a0a40a370f879f0685a62fb7360419db1245738', class: "input-wrapper" }, index.h("slot", { key: '05bcbc8bd7311f3e6ae467b40af269e373e7ef26', name: "before-input" }), index.h("div", { key: '81861b40c527dde0b7629914e70f7ee1b3389f06', class: "input-container", onClick: this.handleInputContainerClick }, index.h("slot", { key: 'dc64fe00dd75120daedfdc51fc2d5d955f3e3348', name: "leading-input" }), index.h("input", { key: '01593dfe3c0331acec3ec765cb1673d6a0536f1f', id: this.inputId, ref: e => (this.inputElement = e), placeholder: this.placeholder, name: this.name, type: "number", autofocus: this.autofocus, required: this.required, max: this.max, min: this.min, step: this.step, value: this.value, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInput }), this.error && (index.h("nv-icon", { key: 'f253f726e6ad61e0b49389f38d1b6c519bd7ade6', name: "alert-circle", class: "validation", size: "md" })), this.success && (index.h("nv-icon", { key: '11968ad93087be6813e99e2b781fa8d3d7f7b772', name: "circle-check", class: "validation", size: "md" })), index.h("div", { key: '900d860455ced0a97dbdad044c83578f680e2d1c', class: "stepper" }, index.h("nv-iconbutton", { key: '1c6f95596b862dad92ca2006e983fbf4b45fa9ee', size: "md", name: "minus", emphasis: "lower", onClick: this.handleMinus, disabled: this.isMinValueReached(), onMouseDown: this.preventSelection, tabIndex: -1 }), index.h("nv-iconbutton", { key: '2f08e682805b4c9cf6f09b71c885460ca697de5f', size: "md", name: "plus", emphasis: "lower", onClick: this.handlePlus, disabled: this.isMaxValueReached(), onMouseDown: this.preventSelection, tabIndex: -1 }))), index.h("slot", { key: 'b63dbbaeb358b73105f552de15a0226906f5e547', name: "after-input" })), (this.description ||
116
- this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '43c3f1bd58a36095e69283151ac4d7edcd0eef4a', class: "description" }, index.h("slot", { key: '0c91c8198be73d7285065d86c1ca1340d3517e0d', name: "description" }, this.description))), (this.errorDescription ||
117
- this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: 'ecb9e02f67241294215ee3e570006dcf98539537', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '763ddc2a238b85022d72e046d9665fbb433f8476', name: "error-description" }, this.errorDescription)))));
115
+ return (index.h(index.Host, { key: 'd4a702bbb94585da82e6c40ac83d0f3508564a7b' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '11cfc66c6796aae236796fb5a637aa72ef6c2340', htmlFor: this.inputId }, index.h("slot", { key: 'bce23d0b1a283ec2d1c1ce0cc6d2c61a6d2cf6e9', name: "label" }, this.label))), index.h("div", { key: 'c62aa0a4d69fd0235912ef16c89a4d511348aa48', class: "input-wrapper" }, index.h("slot", { key: '2f7a66f50f7256b7ef5dcc90d112da47a4cac511', name: "before-input" }), index.h("div", { key: 'b00c8348136289513a1c3d5ef68a08a581fa4d9c', class: "input-container", onClick: this.handleInputContainerClick }, index.h("slot", { key: '9d4cce93ff07c710db6cafb3d5c644fad480a397', name: "leading-input" }), index.h("input", { key: '44ef9c168f0e6e1ce9166cc896127f79d0794392', id: this.inputId, ref: e => (this.inputElement = e), placeholder: this.placeholder, name: this.name, type: "number", autofocus: this.autofocus, required: this.required, max: this.max, min: this.min, step: this.step, value: this.value, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInput }), this.error && (index.h("nv-icon", { key: 'b2335c490f6ff69c3019731e309d450c94f0a881', name: "alert-circle", class: "validation", size: "md" })), this.success && (index.h("nv-icon", { key: '5b259e0b4fce9444d6bd4019a5a9c01b66cb8b67', name: "circle-check", class: "validation", size: "md" })), index.h("div", { key: 'a22e29f5af849084331ddda2d63339b3517cb0cf', class: "stepper" }, index.h("nv-iconbutton", { key: '97b7a1646b20fb0804daa5c830c70be05bc6673f', size: "md", name: "minus", emphasis: "lower", onClick: this.handleMinus, disabled: this.isMinValueReached(), onMouseDown: this.preventSelection, tabIndex: -1 }), index.h("nv-iconbutton", { key: '2a9cfde9dfa60a3a565a4673a3696f2907e67845', size: "md", name: "plus", emphasis: "lower", onClick: this.handlePlus, disabled: this.isMaxValueReached(), onMouseDown: this.preventSelection, tabIndex: -1 }))), index.h("slot", { key: '85b9df5f03f45486dec27961d9c98eafa90e008a', name: "after-input" })), (this.description ||
116
+ this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '1bab44c8766935832acf883732f059333426bd61', class: "description" }, index.h("slot", { key: 'f148c139053ce336f342a93e6bc9b8ac11872909', name: "description" }, this.description))), (this.errorDescription ||
117
+ this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: 'a47082dd9ae82156fde1dd4948e31dcfec804a64', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '9537d8157e4acd4a2c502e271b9b2640c0cc71a6', name: "error-description" }, this.errorDescription)))));
118
118
  }
119
119
  static get formAssociated() { return true; }
120
120
  get el() { return index.getElement(this); }
@@ -101,9 +101,9 @@ const NvFieldpassword = class {
101
101
  /****************************************************************************/
102
102
  //#region RENDER
103
103
  render() {
104
- return (index.h(index.Host, { key: 'a41ed0f04b926fc622c76487c3108d7ee43209bc' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '3550a9382c0a5ca66251a364e05b75f0ed6f42ef', htmlFor: this.inputId }, index.h("slot", { key: 'cb5970e496815804ebdc3ed2cb56a5a8b6b4cb7a', name: "label" }, this.label))), index.h("div", { key: 'a84fa1d8b7d42a2c3bdd0a4b9baef0a62cb6ff10', class: "input-wrapper" }, index.h("slot", { key: '18a93e01e9ae700c4bc634cc75dc15b48f1467de', name: "before-input" }), index.h("div", { key: '902ecacf5d73e9014bffbb3cab058317142d73bc', class: "input-container", onClick: this.handleInputContainerClick }, index.h("slot", { key: '65bacd0ae1d74bf24492961707338b42de8db414', name: "leading-input" }), index.h("input", { key: '0ee6c86114923f170bd4733d966901c4eaec096a', id: this.inputId, ref: e => (this.inputElement = e), autofocus: this.autofocus, autocomplete: this.autocomplete, placeholder: this.placeholder, name: this.name, type: this.showPasswordState ? 'text' : 'password', inputMode: this.mode, value: this.value, required: this.required, maxlength: this.maxlength, minlength: this.minlength, pattern: this.pattern, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInput }), (this.success || this.error) && (index.h("nv-icon", { key: '366cd1b889f59207bf6d4969a993b259281e8155', name: this.success ? 'circle-check' : 'alert-circle', class: "validation", size: "md" })), !this.hidePasswordIcon && (index.h("nv-iconbutton", { key: '6f1d513c9320436d7f362a6323591925817ec7b1', name: this.showPasswordState ? 'eye' : 'eye-off', size: "md", emphasis: "lower", onClick: this.togglePasswordVisibility, "aria-label": this.showPasswordState ? 'Hide password' : 'Show password', "aria-pressed": this.showPasswordState.toString() }))), index.h("slot", { key: 'a427f1476ffc5070de6e6ce6158d7d50ce08ab59', name: "after-input" })), (this.description ||
105
- this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '069e32d0137aef7aa8ccb6a56d26aceb1d9f91d6', class: "description" }, index.h("slot", { key: 'e2cef4e7859979f807b05bdedc0324563313c962', name: "description" }, this.description))), (this.errorDescription ||
106
- this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: 'e38bba2cd6d438544b883c4e51149039f099faa9', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '1c972064f301444e5774bce210b8868ed01c320b', name: "error-description" }, this.errorDescription)))));
104
+ return (index.h(index.Host, { key: '38452ffde2d780abd369e0a4a395736c99ba3698' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: 'aba6b414793d44094dee6c80ee5f08ee8a6ff563', htmlFor: this.inputId }, index.h("slot", { key: 'd69148906088a40b1f43b3734870d45e279af814', name: "label" }, this.label))), index.h("div", { key: '9f23cf52be9502bbeae61b7c288c0232d64c4503', class: "input-wrapper" }, index.h("slot", { key: '75317dbe9b44d2cc83745c12b1d856d0f3a70559', name: "before-input" }), index.h("div", { key: 'c522f4b7b8346a34a345f9027b06090e596da5db', class: "input-container", onClick: this.handleInputContainerClick }, index.h("slot", { key: 'd816df16413183ab21887d90527dd66b6f36e922', name: "leading-input" }), index.h("input", { key: '02d98198a48492e70738177651d69d606ea5a350', id: this.inputId, ref: e => (this.inputElement = e), autofocus: this.autofocus, autocomplete: this.autocomplete, placeholder: this.placeholder, name: this.name, type: this.showPasswordState ? 'text' : 'password', inputMode: this.mode, value: this.value, required: this.required, maxlength: this.maxlength, minlength: this.minlength, pattern: this.pattern, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInput }), (this.success || this.error) && (index.h("nv-icon", { key: '796e8f87c15ae450b79973f66478491c53d43c54', name: this.success ? 'circle-check' : 'alert-circle', class: "validation", size: "md" })), !this.hidePasswordIcon && (index.h("nv-iconbutton", { key: 'c8b3c5605caad59c387f7211137de382692a6155', name: this.showPasswordState ? 'eye' : 'eye-off', size: "md", emphasis: "lower", onClick: this.togglePasswordVisibility, "aria-label": this.showPasswordState ? 'Hide password' : 'Show password', "aria-pressed": this.showPasswordState.toString() }))), index.h("slot", { key: '5f78d51ab2a4f095d136bb912b8d8c98f10bb297', name: "after-input" })), (this.description ||
105
+ this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '87a876d189f8f66cbbf9d558316f8962bf8ef2db', class: "description" }, index.h("slot", { key: 'e387e44b850db2cd0aebecadffe1395312049454', name: "description" }, this.description))), (this.errorDescription ||
106
+ this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '4b723b9d4a68f3536565e1cb4b701ef2c0aaad4c', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '896c7c76f4eb9ed88914a37edd1c832cf94e8b46', name: "error-description" }, this.errorDescription)))));
107
107
  }
108
108
  static get formAssociated() { return true; }
109
109
  get el() { return index.getElement(this); }
@@ -88,9 +88,9 @@ const NvFieldradio = class {
88
88
  /****************************************************************************/
89
89
  //#region RENDER
90
90
  render() {
91
- return (index.h(index.Host, { key: 'cab4d25a83792d8f0d3f5de48073a621f8b1823e', class: clsx.clsx(this.labelPlacement === 'before' && 'label-placement-before', this.error && 'error') }, index.h("input", { key: 'a923e6ad8e76b90c5e00ae17a353614b8f7390b1', type: "radio", id: this.inputId, name: this.name, autofocus: this.autofocus, autocomplete: "off", value: this.value, checked: this.checked, disabled: this.disabled }), index.h("div", { key: '585cc5389b0190e2291447d188637e8325d937aa', class: "text-container" }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '7e16f9cd7078e11661685a141afbd46472683e0f', htmlFor: this.inputId }, index.h("slot", { key: '3e9aab3f47e1a0c96a6e3b6f2495428bce324962', name: "label" }, this.label))), (this.description ||
92
- this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '0c2b8b8e49dd877131c37bb23d450e254c58fcdc', class: "description" }, index.h("slot", { key: 'fd3d99a005667b46260dde7d84f4c6b82e4e4853', name: "description" }, this.description))), (this.errorDescription ||
93
- this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: 'd524f91210f3e28627e68f380484d1c28ab962d9', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '416222f3b3db021de57b35697a64270582f6bad7', name: "error-description" }, this.errorDescription))))));
91
+ return (index.h(index.Host, { key: 'c600a157513b8401903807773cbd269008b35197', class: clsx.clsx(this.labelPlacement === 'before' && 'label-placement-before', this.error && 'error') }, index.h("input", { key: '7861b2a7e9f6b5b4bef5f74781401eb4fb3c746d', type: "radio", id: this.inputId, name: this.name, autofocus: this.autofocus, autocomplete: "off", value: this.value, checked: this.checked, disabled: this.disabled }), index.h("div", { key: '3612e5a6667d8bb1800a724386f84debe33cc0f4', class: "text-container" }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: 'e9caab357d06e25dab7b7b72020f56029d89f373', htmlFor: this.inputId }, index.h("slot", { key: '04441ea9acb42628cf0618c566e9d7be159d962d', name: "label" }, this.label))), (this.description ||
92
+ this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '190427a3db123787a85f2abb72e47192a06586b4', class: "description" }, index.h("slot", { key: '6799968f7ebbc302890c4544fe16f5928ac2a0e8', name: "description" }, this.description))), (this.errorDescription ||
93
+ this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: 'b37bd97668df39b1160c581f0b62a5140ada9b59', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '7a715e8cc5dd5f41173d3b4d5d7cc229a787e2f9', name: "error-description" }, this.errorDescription))))));
94
94
  }
95
95
  static get formAssociated() { return true; }
96
96
  get el() { return index.getElement(this); }