@nova-design-system/nova-react 3.0.0-beta.44 → 3.0.0-beta.45

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 (346) hide show
  1. package/dist/cjs/{index-CIcUUomJ.js → index-S09Gr7Tw.js} +113 -119
  2. package/dist/cjs/index.js +1 -1
  3. package/dist/cjs/{nv-alert.entry-BVY_rxey.js → nv-alert.entry-DH8Qd2s2.js} +1 -1
  4. package/dist/cjs/{nv-avatar.entry-CFgnor0-.js → nv-avatar.entry-B3-elLZC.js} +1 -1
  5. package/dist/cjs/{nv-badge_2.entry-Drgx-565.js → nv-badge_2.entry-D15EDzX0.js} +2 -2
  6. package/dist/cjs/{nv-base.entry-DwtTXK_n.js → nv-base.entry-D-_RUZTX.js} +1 -1
  7. package/dist/cjs/{nv-breadcrumb.entry-B0hIeE83.js → nv-breadcrumb.entry-DG49Nj1L.js} +2 -2
  8. package/dist/cjs/{nv-breadcrumbs.entry-Cq0LsIFs.js → nv-breadcrumbs.entry-BqJO5pbN.js} +1 -1
  9. package/dist/cjs/{nv-button.entry-B3rEQuGV.js → nv-button.entry-CN9kB98T.js} +6 -4
  10. package/dist/cjs/{nv-calendar.entry-NU1TumeS.js → nv-calendar.entry-CMEgSU64.js} +1 -1
  11. package/dist/cjs/{nv-col.entry-B5nCHhbO.js → nv-col.entry-wcZ9HHAb.js} +1 -1
  12. package/dist/cjs/{nv-datagrid.entry-5VIvkJGL.js → nv-datagrid.entry-GCLeN2qT.js} +31 -4
  13. package/dist/cjs/{nv-datagridcolumn.entry-BeGXaBUe.js → nv-datagridcolumn.entry-lgIz71UU.js} +1 -1
  14. package/dist/cjs/{nv-dialog.entry-BgHknrOx.js → nv-dialog.entry-DfY0TaYp.js} +17 -13
  15. package/dist/cjs/{nv-dialogfooter_2.entry-Ck6adFfd.js → nv-dialogfooter_2.entry-OByWsulH.js} +1 -1
  16. package/dist/cjs/{nv-fieldcheckbox.entry-dBYg7CBU.js → nv-fieldcheckbox.entry-Bqpe9BK3.js} +2 -2
  17. package/dist/cjs/{nv-fielddate.entry-DRX2mfZL.js → nv-fielddate.entry-DJePv6tR.js} +1 -1
  18. package/dist/cjs/{nv-fielddaterange.entry-DTLKVIqg.js → nv-fielddaterange.entry--YC750sX.js} +1 -1
  19. package/dist/cjs/{nv-fielddropdown.entry-akfp1Bcy.js → nv-fielddropdown.entry-BPlTlc_S.js} +1 -1
  20. package/dist/cjs/{nv-fielddropdownitem.entry-BscNyhXz.js → nv-fielddropdownitem.entry-zwoGySum.js} +1 -1
  21. package/dist/cjs/{nv-fieldmultiselect.entry-BGzYCJuF.js → nv-fieldmultiselect.entry-Bg_v0LUF.js} +7 -49
  22. package/dist/cjs/{nv-fieldnumber.entry-_UiieYov.js → nv-fieldnumber.entry-BLNaq7yr.js} +1 -1
  23. package/dist/cjs/{nv-fieldpassword.entry-D4a8SnGr.js → nv-fieldpassword.entry-iSEdS5R8.js} +1 -1
  24. package/dist/cjs/{nv-fieldradio.entry-aRAaLwpK.js → nv-fieldradio.entry-Dov4vZkh.js} +1 -1
  25. package/dist/cjs/{nv-fieldselect.entry-sTbv_flF.js → nv-fieldselect.entry-NmpesarX.js} +1 -1
  26. package/dist/cjs/{nv-fieldtext.entry-B1TlZWjU.js → nv-fieldtext.entry-r6oQajRS.js} +1 -1
  27. package/dist/cjs/{nv-fieldtextarea.entry-BwJCUiVW.js → nv-fieldtextarea.entry-CJ2yQkfi.js} +1 -1
  28. package/dist/cjs/{nv-fieldtime.entry-uU-IET2k.js → nv-fieldtime.entry-Bxoj6N53.js} +1 -1
  29. package/dist/cjs/{nv-icon.entry-BfRAl2b6.js → nv-icon.entry-CWKRt8F0.js} +1 -1
  30. package/dist/cjs/{nv-iconbutton_2.entry-D8MI5uzP.js → nv-iconbutton_2.entry-CnbscpNn.js} +1 -1
  31. package/dist/cjs/{nv-menu.entry-D3qvf_0H.js → nv-menu.entry-wC7oSruP.js} +1 -1
  32. package/dist/cjs/{nv-menuitem.entry-DkIG5z-x.js → nv-menuitem.entry-BVSa1vrS.js} +1 -1
  33. package/dist/cjs/{nv-popover.entry-C57rfYUn.js → nv-popover.entry-ChP1we3l.js} +12 -10
  34. package/dist/cjs/{nv-row.entry-Bwzlub3i.js → nv-row.entry-D6FeFpzG.js} +1 -1
  35. package/dist/cjs/{nv-stack.entry-bhess4lQ.js → nv-stack.entry-zjJmztkO.js} +1 -1
  36. package/dist/cjs/{nv-table.entry-mEtRfake.js → nv-table.entry-CGX0jsR3.js} +1 -1
  37. package/dist/cjs/{nv-tablecolumn.entry-BDCw_45v.js → nv-tablecolumn.entry-Cwdmo_RY.js} +1 -1
  38. package/dist/cjs/{nv-toggle.entry-DXpNGkbz.js → nv-toggle.entry-BvToMkI2.js} +2 -2
  39. package/dist/cjs/{nv-tooltip.entry-BuSwME_F.js → nv-tooltip.entry-DZ7_lB-p.js} +1 -1
  40. package/dist/generated/components.js +1 -1
  41. package/dist/types/generated/components.d.ts +1 -1
  42. package/package.json +1 -1
  43. package/dist/cjs/index-BZCQTWfv.js +0 -26372
  44. package/dist/cjs/index-B_VOAJzk.js +0 -26373
  45. package/dist/cjs/index-C8UfzrMI.js +0 -26405
  46. package/dist/cjs/index-CDe7nrrW.js +0 -26373
  47. package/dist/cjs/index-CEWbQ5nh.js +0 -26373
  48. package/dist/cjs/index-CinzsZ8D.js +0 -26405
  49. package/dist/cjs/index-CtI3SivD.js +0 -26373
  50. package/dist/cjs/index-wDACGzKb.js +0 -26373
  51. package/dist/cjs/nv-alert.entry-8esWDUyU.js +0 -173
  52. package/dist/cjs/nv-alert.entry-B-P-Fgdo.js +0 -173
  53. package/dist/cjs/nv-alert.entry-B3NpZh1C.js +0 -173
  54. package/dist/cjs/nv-alert.entry-BU86GY-d.js +0 -173
  55. package/dist/cjs/nv-alert.entry-CwZcD170.js +0 -173
  56. package/dist/cjs/nv-alert.entry-CxSN1zpW.js +0 -173
  57. package/dist/cjs/nv-alert.entry-DsoqN5tQ.js +0 -173
  58. package/dist/cjs/nv-alert.entry-xuY-Lvuj.js +0 -173
  59. package/dist/cjs/nv-avatar.entry-CO6bt4k6.js +0 -67
  60. package/dist/cjs/nv-avatar.entry-DJkpupVT.js +0 -67
  61. package/dist/cjs/nv-avatar.entry-DKXMQPOz.js +0 -67
  62. package/dist/cjs/nv-avatar.entry-DWOADxdQ.js +0 -67
  63. package/dist/cjs/nv-avatar.entry-DjyiGt07.js +0 -67
  64. package/dist/cjs/nv-avatar.entry-DuN1d3Vy.js +0 -67
  65. package/dist/cjs/nv-avatar.entry-pREKtiv2.js +0 -67
  66. package/dist/cjs/nv-avatar.entry-yyLQEqI7.js +0 -67
  67. package/dist/cjs/nv-badge_2.entry-BFURAuBQ.js +0 -195
  68. package/dist/cjs/nv-badge_2.entry-BQXL0ZhP.js +0 -195
  69. package/dist/cjs/nv-badge_2.entry-CJQWS2xG.js +0 -195
  70. package/dist/cjs/nv-badge_2.entry-D0jeqYIQ.js +0 -195
  71. package/dist/cjs/nv-badge_2.entry-DKGHx4c8.js +0 -194
  72. package/dist/cjs/nv-badge_2.entry-im1VnU5f.js +0 -195
  73. package/dist/cjs/nv-badge_2.entry-wDuiCwys.js +0 -195
  74. package/dist/cjs/nv-badge_2.entry-xfXsesV0.js +0 -195
  75. package/dist/cjs/nv-base.entry-9HF044Di.js +0 -71
  76. package/dist/cjs/nv-base.entry-BO-6krwg.js +0 -71
  77. package/dist/cjs/nv-base.entry-BmY-1Lne.js +0 -71
  78. package/dist/cjs/nv-base.entry-BuxI7QmU.js +0 -71
  79. package/dist/cjs/nv-base.entry-CcaAXjnO.js +0 -71
  80. package/dist/cjs/nv-base.entry-Ch8ncPl0.js +0 -71
  81. package/dist/cjs/nv-base.entry-D7gUvPIG.js +0 -71
  82. package/dist/cjs/nv-base.entry-c723sI4Y.js +0 -71
  83. package/dist/cjs/nv-breadcrumb.entry-B9rOxsg_.js +0 -45
  84. package/dist/cjs/nv-breadcrumb.entry-BtM_AHRC.js +0 -45
  85. package/dist/cjs/nv-breadcrumb.entry-C-xHbSJw.js +0 -45
  86. package/dist/cjs/nv-breadcrumb.entry-CL9l0Wkr.js +0 -45
  87. package/dist/cjs/nv-breadcrumb.entry-CxGReUqZ.js +0 -45
  88. package/dist/cjs/nv-breadcrumb.entry-DTwjCmMI.js +0 -45
  89. package/dist/cjs/nv-breadcrumb.entry-LYt0sALP.js +0 -45
  90. package/dist/cjs/nv-breadcrumb.entry-wy-P2BMg.js +0 -45
  91. package/dist/cjs/nv-breadcrumbs.entry-9LlUycIv.js +0 -20
  92. package/dist/cjs/nv-breadcrumbs.entry-B7CaTbBe.js +0 -20
  93. package/dist/cjs/nv-breadcrumbs.entry-BA-TnreZ.js +0 -20
  94. package/dist/cjs/nv-breadcrumbs.entry-CEmZ3yFi.js +0 -20
  95. package/dist/cjs/nv-breadcrumbs.entry-De5lsjQf.js +0 -20
  96. package/dist/cjs/nv-breadcrumbs.entry-_w38BddR.js +0 -20
  97. package/dist/cjs/nv-breadcrumbs.entry-jn5hRjpQ.js +0 -20
  98. package/dist/cjs/nv-breadcrumbs.entry-ubxLcEUH.js +0 -20
  99. package/dist/cjs/nv-button.entry-B5-Wf9hh.js +0 -162
  100. package/dist/cjs/nv-button.entry-CBNfIn-r.js +0 -162
  101. package/dist/cjs/nv-button.entry-D-DPQDNM.js +0 -162
  102. package/dist/cjs/nv-button.entry-DHZX7KH4.js +0 -162
  103. package/dist/cjs/nv-button.entry-DLoECCSK.js +0 -162
  104. package/dist/cjs/nv-button.entry-DaSGnB1L.js +0 -162
  105. package/dist/cjs/nv-button.entry-Dk6DqHG2.js +0 -162
  106. package/dist/cjs/nv-button.entry-DxzA6-My.js +0 -162
  107. package/dist/cjs/nv-calendar.entry-BC6NDsVl.js +0 -1036
  108. package/dist/cjs/nv-calendar.entry-BeCCaAVE.js +0 -1036
  109. package/dist/cjs/nv-calendar.entry-DKz-iBnp.js +0 -1036
  110. package/dist/cjs/nv-calendar.entry-DNyH8T5e.js +0 -1036
  111. package/dist/cjs/nv-calendar.entry-DSWhDnEC.js +0 -1036
  112. package/dist/cjs/nv-calendar.entry-DUHckAh3.js +0 -1036
  113. package/dist/cjs/nv-calendar.entry-UUE6v4YC.js +0 -1036
  114. package/dist/cjs/nv-calendar.entry-ZtfR2qOV.js +0 -1036
  115. package/dist/cjs/nv-col.entry-Bx1VZSMw.js +0 -37
  116. package/dist/cjs/nv-col.entry-C400BeEE.js +0 -37
  117. package/dist/cjs/nv-col.entry-CYjFAVMF.js +0 -37
  118. package/dist/cjs/nv-col.entry-DDEtfCv-.js +0 -37
  119. package/dist/cjs/nv-col.entry-DNUY559i.js +0 -37
  120. package/dist/cjs/nv-col.entry-DqzImLSJ.js +0 -37
  121. package/dist/cjs/nv-col.entry-DtYBQEJz.js +0 -37
  122. package/dist/cjs/nv-col.entry-X7jkNThH.js +0 -37
  123. package/dist/cjs/nv-datagrid.entry-Ba9sfMQp.js +0 -3671
  124. package/dist/cjs/nv-datagrid.entry-Beehe_Sq.js +0 -3671
  125. package/dist/cjs/nv-datagrid.entry-CkD_jV75.js +0 -3671
  126. package/dist/cjs/nv-datagrid.entry-Cp8RCSEv.js +0 -3671
  127. package/dist/cjs/nv-datagrid.entry-D6p67Pa6.js +0 -3671
  128. package/dist/cjs/nv-datagrid.entry-DKqScS8N.js +0 -3671
  129. package/dist/cjs/nv-datagrid.entry-DL-Fyo4l.js +0 -3671
  130. package/dist/cjs/nv-datagrid.entry-ee865R4b.js +0 -3671
  131. package/dist/cjs/nv-datagridcolumn.entry-BodICzof.js +0 -18
  132. package/dist/cjs/nv-datagridcolumn.entry-CR9_1fsZ.js +0 -18
  133. package/dist/cjs/nv-datagridcolumn.entry-C_FtSltZ.js +0 -18
  134. package/dist/cjs/nv-datagridcolumn.entry-CyTG5E7M.js +0 -18
  135. package/dist/cjs/nv-datagridcolumn.entry-D1cyTR_G.js +0 -18
  136. package/dist/cjs/nv-datagridcolumn.entry-DRE7BDkk.js +0 -18
  137. package/dist/cjs/nv-datagridcolumn.entry-Du6-7fjr.js +0 -18
  138. package/dist/cjs/nv-datagridcolumn.entry-N70Aen6Q.js +0 -18
  139. package/dist/cjs/nv-dialog.entry-BjTJ5FFL.js +0 -784
  140. package/dist/cjs/nv-dialog.entry-C1hg-EG1.js +0 -784
  141. package/dist/cjs/nv-dialog.entry-COv2do_O.js +0 -784
  142. package/dist/cjs/nv-dialog.entry-Ck2hU43g.js +0 -784
  143. package/dist/cjs/nv-dialog.entry-Cl8iLrCo.js +0 -784
  144. package/dist/cjs/nv-dialog.entry-Cy71tlWz.js +0 -784
  145. package/dist/cjs/nv-dialog.entry-DdAHZGzm.js +0 -784
  146. package/dist/cjs/nv-dialog.entry-Do_uALC6.js +0 -784
  147. package/dist/cjs/nv-dialogfooter_2.entry-CXvA0O-2.js +0 -134
  148. package/dist/cjs/nv-dialogfooter_2.entry-DHa0SYhR.js +0 -134
  149. package/dist/cjs/nv-dialogfooter_2.entry-DJ8qS9q6.js +0 -134
  150. package/dist/cjs/nv-dialogfooter_2.entry-DJkKzEgO.js +0 -134
  151. package/dist/cjs/nv-dialogfooter_2.entry-DKvzkpt3.js +0 -134
  152. package/dist/cjs/nv-dialogfooter_2.entry-D_VuofBe.js +0 -134
  153. package/dist/cjs/nv-dialogfooter_2.entry-L5tHIb_T.js +0 -134
  154. package/dist/cjs/nv-dialogfooter_2.entry-kEa1K0n5.js +0 -134
  155. package/dist/cjs/nv-fieldcheckbox.entry-B4We4zG2.js +0 -137
  156. package/dist/cjs/nv-fieldcheckbox.entry-BmYyNV4r.js +0 -137
  157. package/dist/cjs/nv-fieldcheckbox.entry-C0DmeqXD.js +0 -137
  158. package/dist/cjs/nv-fieldcheckbox.entry-CBsQsbIA.js +0 -137
  159. package/dist/cjs/nv-fieldcheckbox.entry-DTIebeJR.js +0 -137
  160. package/dist/cjs/nv-fieldcheckbox.entry-DoGQX-5D.js +0 -137
  161. package/dist/cjs/nv-fieldcheckbox.entry-P--9IAJF.js +0 -137
  162. package/dist/cjs/nv-fieldcheckbox.entry-dxhUZiEg.js +0 -137
  163. package/dist/cjs/nv-fielddate.entry-B53E-JaI.js +0 -278
  164. package/dist/cjs/nv-fielddate.entry-Bofdd2rE.js +0 -278
  165. package/dist/cjs/nv-fielddate.entry-CIo_61Dc.js +0 -278
  166. package/dist/cjs/nv-fielddate.entry-CekIFTA0.js +0 -278
  167. package/dist/cjs/nv-fielddate.entry-D-PjbYaA.js +0 -278
  168. package/dist/cjs/nv-fielddate.entry-DgS0X1wI.js +0 -278
  169. package/dist/cjs/nv-fielddate.entry-Do69eqHA.js +0 -278
  170. package/dist/cjs/nv-fielddate.entry-NJ6RAqlG.js +0 -278
  171. package/dist/cjs/nv-fielddaterange.entry-BrC5jKLp.js +0 -355
  172. package/dist/cjs/nv-fielddaterange.entry-BtPwfRw-.js +0 -355
  173. package/dist/cjs/nv-fielddaterange.entry-CxaBrZAX.js +0 -355
  174. package/dist/cjs/nv-fielddaterange.entry-D-6LjhjB.js +0 -355
  175. package/dist/cjs/nv-fielddaterange.entry-D0fq5KFb.js +0 -355
  176. package/dist/cjs/nv-fielddaterange.entry-D2dzD3rW.js +0 -355
  177. package/dist/cjs/nv-fielddaterange.entry-ka3JiDvT.js +0 -355
  178. package/dist/cjs/nv-fielddaterange.entry-w8WXPDuX.js +0 -355
  179. package/dist/cjs/nv-fielddropdown.entry-BAaPyGtB.js +0 -361
  180. package/dist/cjs/nv-fielddropdown.entry-C5kMWmPP.js +0 -361
  181. package/dist/cjs/nv-fielddropdown.entry-CX2Ycn2i.js +0 -361
  182. package/dist/cjs/nv-fielddropdown.entry-CZxQlRNa.js +0 -361
  183. package/dist/cjs/nv-fielddropdown.entry-DUAKFYgw.js +0 -391
  184. package/dist/cjs/nv-fielddropdown.entry-DVl_Uy5A.js +0 -361
  185. package/dist/cjs/nv-fielddropdown.entry-MsUR1kVe.js +0 -391
  186. package/dist/cjs/nv-fielddropdown.entry-hHh_RDC4.js +0 -361
  187. package/dist/cjs/nv-fielddropdownitem.entry-BsbvJERH.js +0 -70
  188. package/dist/cjs/nv-fielddropdownitem.entry-CMWgXP_Z.js +0 -68
  189. package/dist/cjs/nv-fielddropdownitem.entry-CS1Ejbc9.js +0 -68
  190. package/dist/cjs/nv-fielddropdownitem.entry-CW4WMmSZ.js +0 -68
  191. package/dist/cjs/nv-fielddropdownitem.entry-CuQqsz4f.js +0 -68
  192. package/dist/cjs/nv-fielddropdownitem.entry-DRM-Zljt.js +0 -70
  193. package/dist/cjs/nv-fielddropdownitem.entry-Dn2HJc1t.js +0 -68
  194. package/dist/cjs/nv-fielddropdownitem.entry-HK2I5pUG.js +0 -68
  195. package/dist/cjs/nv-fieldmultiselect.entry-5jdK36m6.js +0 -1060
  196. package/dist/cjs/nv-fieldmultiselect.entry-6o1yhNI5.js +0 -1060
  197. package/dist/cjs/nv-fieldmultiselect.entry-BN1ObPi8.js +0 -1060
  198. package/dist/cjs/nv-fieldmultiselect.entry-CuVEYN0v.js +0 -1060
  199. package/dist/cjs/nv-fieldmultiselect.entry-DFr-ZICs.js +0 -1060
  200. package/dist/cjs/nv-fieldmultiselect.entry-DHXJErt4.js +0 -1060
  201. package/dist/cjs/nv-fieldmultiselect.entry-Dr8FfT_W.js +0 -1060
  202. package/dist/cjs/nv-fieldmultiselect.entry-DycRd14V.js +0 -1060
  203. package/dist/cjs/nv-fieldnumber.entry-BHhIsjLK.js +0 -126
  204. package/dist/cjs/nv-fieldnumber.entry-BklKxOFA.js +0 -126
  205. package/dist/cjs/nv-fieldnumber.entry-C8zJkL24.js +0 -126
  206. package/dist/cjs/nv-fieldnumber.entry-C9rKWY_M.js +0 -126
  207. package/dist/cjs/nv-fieldnumber.entry-CEmPQK-3.js +0 -126
  208. package/dist/cjs/nv-fieldnumber.entry-CLhjFlCj.js +0 -126
  209. package/dist/cjs/nv-fieldnumber.entry-DZsM1vmO.js +0 -126
  210. package/dist/cjs/nv-fieldnumber.entry-ezdDvJh_.js +0 -126
  211. package/dist/cjs/nv-fieldpassword.entry-7lS0Msfg.js +0 -115
  212. package/dist/cjs/nv-fieldpassword.entry-B9-QFEsB.js +0 -115
  213. package/dist/cjs/nv-fieldpassword.entry-BIIoIKH4.js +0 -115
  214. package/dist/cjs/nv-fieldpassword.entry-BPhQxjsj.js +0 -115
  215. package/dist/cjs/nv-fieldpassword.entry-Biw__M2W.js +0 -115
  216. package/dist/cjs/nv-fieldpassword.entry-C5vG4jlh.js +0 -115
  217. package/dist/cjs/nv-fieldpassword.entry-C_jsHFJI.js +0 -115
  218. package/dist/cjs/nv-fieldpassword.entry-DZkGQwM8.js +0 -115
  219. package/dist/cjs/nv-fieldradio.entry-BgpmbG9E.js +0 -102
  220. package/dist/cjs/nv-fieldradio.entry-CXR4k3wf.js +0 -102
  221. package/dist/cjs/nv-fieldradio.entry-CnasQlEx.js +0 -102
  222. package/dist/cjs/nv-fieldradio.entry-Co7WX2vI.js +0 -102
  223. package/dist/cjs/nv-fieldradio.entry-DUDPigQb.js +0 -102
  224. package/dist/cjs/nv-fieldradio.entry-DiD7Luxv.js +0 -102
  225. package/dist/cjs/nv-fieldradio.entry-Ili2RVKl.js +0 -102
  226. package/dist/cjs/nv-fieldradio.entry-ZL7KgEZ7.js +0 -102
  227. package/dist/cjs/nv-fieldselect.entry-B94QXSEk.js +0 -365
  228. package/dist/cjs/nv-fieldselect.entry-BwtEjL08.js +0 -365
  229. package/dist/cjs/nv-fieldselect.entry-CFDqeR-D.js +0 -365
  230. package/dist/cjs/nv-fieldselect.entry-CJSu63o5.js +0 -365
  231. package/dist/cjs/nv-fieldselect.entry-CmN1R9ij.js +0 -365
  232. package/dist/cjs/nv-fieldselect.entry-CoDfr4ie.js +0 -365
  233. package/dist/cjs/nv-fieldselect.entry-D6eRsM9T.js +0 -365
  234. package/dist/cjs/nv-fieldselect.entry-DgmnHnOR.js +0 -365
  235. package/dist/cjs/nv-fieldtext.entry-BfQrX8ft.js +0 -119
  236. package/dist/cjs/nv-fieldtext.entry-BrUQu4OD.js +0 -119
  237. package/dist/cjs/nv-fieldtext.entry-CW6P-R-Q.js +0 -119
  238. package/dist/cjs/nv-fieldtext.entry-CyLJxDw6.js +0 -119
  239. package/dist/cjs/nv-fieldtext.entry-DDqDSJp3.js +0 -119
  240. package/dist/cjs/nv-fieldtext.entry-DKdxC2cG.js +0 -119
  241. package/dist/cjs/nv-fieldtext.entry-DRPCH6Sf.js +0 -119
  242. package/dist/cjs/nv-fieldtext.entry-IeIHa3jf.js +0 -119
  243. package/dist/cjs/nv-fieldtextarea.entry-D86SKGIN.js +0 -194
  244. package/dist/cjs/nv-fieldtextarea.entry-Dc_TGlmI.js +0 -194
  245. package/dist/cjs/nv-fieldtextarea.entry-DlFdCv_d.js +0 -194
  246. package/dist/cjs/nv-fieldtextarea.entry-DqzeITCG.js +0 -194
  247. package/dist/cjs/nv-fieldtextarea.entry-TI-bucN-.js +0 -194
  248. package/dist/cjs/nv-fieldtextarea.entry-qMX2O8cX.js +0 -194
  249. package/dist/cjs/nv-fieldtextarea.entry-tTnWQgE4.js +0 -194
  250. package/dist/cjs/nv-fieldtextarea.entry-v6VpnEuH.js +0 -194
  251. package/dist/cjs/nv-fieldtime.entry-CPyLyQfR.js +0 -1011
  252. package/dist/cjs/nv-fieldtime.entry-CXRtpWt1.js +0 -1011
  253. package/dist/cjs/nv-fieldtime.entry-CYmcHY1D.js +0 -1011
  254. package/dist/cjs/nv-fieldtime.entry-DGP1X4wF.js +0 -1011
  255. package/dist/cjs/nv-fieldtime.entry-DLSuRrlr.js +0 -1011
  256. package/dist/cjs/nv-fieldtime.entry-Zbjbmm7_.js +0 -1011
  257. package/dist/cjs/nv-fieldtime.entry-eDVRT6te.js +0 -1011
  258. package/dist/cjs/nv-fieldtime.entry-j-Fliiqj.js +0 -1011
  259. package/dist/cjs/nv-icon.entry-B0Y3rgBQ.js +0 -79
  260. package/dist/cjs/nv-icon.entry-B_wtREWb.js +0 -79
  261. package/dist/cjs/nv-icon.entry-CrKTCqY_.js +0 -79
  262. package/dist/cjs/nv-icon.entry-DRRmcXzh.js +0 -79
  263. package/dist/cjs/nv-icon.entry-Dlj1ko2i.js +0 -79
  264. package/dist/cjs/nv-icon.entry-S7WlK_lO.js +0 -79
  265. package/dist/cjs/nv-icon.entry-iipuvT3D.js +0 -79
  266. package/dist/cjs/nv-icon.entry-xltjoSa2.js +0 -79
  267. package/dist/cjs/nv-iconbutton_2.entry-B02iDUid.js +0 -163
  268. package/dist/cjs/nv-iconbutton_2.entry-BsXvYbCi.js +0 -163
  269. package/dist/cjs/nv-iconbutton_2.entry-C1Legk9t.js +0 -163
  270. package/dist/cjs/nv-iconbutton_2.entry-CUiW6MtK.js +0 -163
  271. package/dist/cjs/nv-iconbutton_2.entry-ClcvupMe.js +0 -163
  272. package/dist/cjs/nv-iconbutton_2.entry-D8hZ51H-.js +0 -163
  273. package/dist/cjs/nv-iconbutton_2.entry-Dx4usGkY.js +0 -163
  274. package/dist/cjs/nv-iconbutton_2.entry-QwaiOoYl.js +0 -163
  275. package/dist/cjs/nv-menu.entry-BfmYkdYY.js +0 -227
  276. package/dist/cjs/nv-menu.entry-CT98WIRF.js +0 -227
  277. package/dist/cjs/nv-menu.entry-CfERF478.js +0 -227
  278. package/dist/cjs/nv-menu.entry-Ci3I7PDt.js +0 -227
  279. package/dist/cjs/nv-menu.entry-DFEYw_KZ.js +0 -227
  280. package/dist/cjs/nv-menu.entry-DtLnsQW-.js +0 -227
  281. package/dist/cjs/nv-menu.entry-Kz5kGi2w.js +0 -227
  282. package/dist/cjs/nv-menu.entry-XdjjbAL6.js +0 -227
  283. package/dist/cjs/nv-menuitem.entry-3t6TixM7.js +0 -58
  284. package/dist/cjs/nv-menuitem.entry-BeTXOtir.js +0 -58
  285. package/dist/cjs/nv-menuitem.entry-C8nXPwP0.js +0 -58
  286. package/dist/cjs/nv-menuitem.entry-C9dsQqqN.js +0 -58
  287. package/dist/cjs/nv-menuitem.entry-Cedg0TCQ.js +0 -58
  288. package/dist/cjs/nv-menuitem.entry-CxCLeNsY.js +0 -58
  289. package/dist/cjs/nv-menuitem.entry-bPnSDq_9.js +0 -58
  290. package/dist/cjs/nv-menuitem.entry-sRx1fD0O.js +0 -58
  291. package/dist/cjs/nv-popover.entry-BGXEOQM6.js +0 -1960
  292. package/dist/cjs/nv-popover.entry-Bv6kuTK_.js +0 -1960
  293. package/dist/cjs/nv-popover.entry-C6HFJJ-m.js +0 -1960
  294. package/dist/cjs/nv-popover.entry-CiGCCbn9.js +0 -1960
  295. package/dist/cjs/nv-popover.entry-CjTPZYkq.js +0 -1960
  296. package/dist/cjs/nv-popover.entry-CtO6pR6l.js +0 -1960
  297. package/dist/cjs/nv-popover.entry-Mo3DNUH6.js +0 -1960
  298. package/dist/cjs/nv-popover.entry-Zt25YeAv.js +0 -1960
  299. package/dist/cjs/nv-row.entry-BEgyuDR-.js +0 -21
  300. package/dist/cjs/nv-row.entry-BM_EcSp4.js +0 -21
  301. package/dist/cjs/nv-row.entry-BPK1Li7w.js +0 -21
  302. package/dist/cjs/nv-row.entry-B_7PiJA7.js +0 -21
  303. package/dist/cjs/nv-row.entry-Ca7LiDAy.js +0 -21
  304. package/dist/cjs/nv-row.entry-Cy9vd2iY.js +0 -21
  305. package/dist/cjs/nv-row.entry-DKoNhAcX.js +0 -21
  306. package/dist/cjs/nv-row.entry-OYGKTXhV.js +0 -21
  307. package/dist/cjs/nv-stack.entry-BNyPxECg.js +0 -30
  308. package/dist/cjs/nv-stack.entry-ByaO-0TJ.js +0 -30
  309. package/dist/cjs/nv-stack.entry-C8ZFDaKn.js +0 -30
  310. package/dist/cjs/nv-stack.entry-CLMAAbkw.js +0 -30
  311. package/dist/cjs/nv-stack.entry-DfRRFeEo.js +0 -30
  312. package/dist/cjs/nv-stack.entry-DiXvhuSS.js +0 -30
  313. package/dist/cjs/nv-stack.entry-lwhqS230.js +0 -30
  314. package/dist/cjs/nv-stack.entry-u3NjC31-.js +0 -30
  315. package/dist/cjs/nv-table.entry-BNy2ALll.js +0 -338
  316. package/dist/cjs/nv-table.entry-BPazUUGA.js +0 -338
  317. package/dist/cjs/nv-table.entry-C7Hd57Iq.js +0 -338
  318. package/dist/cjs/nv-table.entry-COwgRxqz.js +0 -338
  319. package/dist/cjs/nv-table.entry-CTo8cqCN.js +0 -338
  320. package/dist/cjs/nv-table.entry-D3U4dFcw.js +0 -338
  321. package/dist/cjs/nv-table.entry-DzOGLNUx.js +0 -338
  322. package/dist/cjs/nv-table.entry-o525Lfea.js +0 -338
  323. package/dist/cjs/nv-tablecolumn.entry-BESdQMDh.js +0 -18
  324. package/dist/cjs/nv-tablecolumn.entry-BzwWPlLf.js +0 -18
  325. package/dist/cjs/nv-tablecolumn.entry-CuEt5Wgn.js +0 -18
  326. package/dist/cjs/nv-tablecolumn.entry-D3I1dB1X.js +0 -18
  327. package/dist/cjs/nv-tablecolumn.entry-DvJF_QTE.js +0 -18
  328. package/dist/cjs/nv-tablecolumn.entry-DvO0JxdY.js +0 -18
  329. package/dist/cjs/nv-tablecolumn.entry-L4KLlHFu.js +0 -18
  330. package/dist/cjs/nv-tablecolumn.entry-vrmt1Y0L.js +0 -18
  331. package/dist/cjs/nv-toggle.entry-BIclNIeq.js +0 -79
  332. package/dist/cjs/nv-toggle.entry-BTqGH_H0.js +0 -79
  333. package/dist/cjs/nv-toggle.entry-Bv0DrF-x.js +0 -79
  334. package/dist/cjs/nv-toggle.entry-BxKZDHdI.js +0 -79
  335. package/dist/cjs/nv-toggle.entry-DYhnFucd.js +0 -79
  336. package/dist/cjs/nv-toggle.entry-PRWy57Ro.js +0 -79
  337. package/dist/cjs/nv-toggle.entry-fDIAyeVX.js +0 -79
  338. package/dist/cjs/nv-toggle.entry-yqg7e7Qc.js +0 -79
  339. package/dist/cjs/nv-tooltip.entry--TVfBopp.js +0 -44
  340. package/dist/cjs/nv-tooltip.entry-58RCazbO.js +0 -44
  341. package/dist/cjs/nv-tooltip.entry-BBJNnZmj.js +0 -44
  342. package/dist/cjs/nv-tooltip.entry-BDZfrLHv.js +0 -44
  343. package/dist/cjs/nv-tooltip.entry-Bnu7xEl6.js +0 -44
  344. package/dist/cjs/nv-tooltip.entry-BrrSQyMx.js +0 -44
  345. package/dist/cjs/nv-tooltip.entry-ChQpdQn_.js +0 -44
  346. package/dist/cjs/nv-tooltip.entry-CvCZZV88.js +0 -44
@@ -1,1060 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-B_VOAJzk.js');
4
- var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
5
- require('react');
6
-
7
- const nvFieldmultiselectCss = "nv-fieldmultiselect{--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-fieldmultiselect[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-fieldmultiselect[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-fieldmultiselect[required]:not([required=false])>label::after{content:\"*\";color:var(--components-form-text-required);font-weight:700}nv-fieldmultiselect 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-fieldmultiselect nv-popover{width:100%;display:block}nv-fieldmultiselect 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-fieldmultiselect nv-popover [slot=content]{gap:var(--list-dropdown-gap-y);display:flex;flex-direction:column}nv-fieldmultiselect nv-popover hr{color:var(--components-list-dropdown-separator)}nv-fieldmultiselect .input-wrapper-multiselect{display:flex;flex-wrap:wrap;gap:var(--form-gap-x);align-items:stretch;align-self:stretch;width:100%}nv-fieldmultiselect .input-container-multiselect{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-fieldmultiselect .input-container-multiselect:hover{border-color:var(--nv-field-border-hover)}nv-fieldmultiselect .input-container-multiselect:focus-within,nv-fieldmultiselect .input-container-multiselect:focus-within:hover,nv-fieldmultiselect .input-container-multiselect:focus,nv-fieldmultiselect .input-container-multiselect: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-fieldmultiselect .input-container-multiselect:has(input:read-only){opacity:0.5;background-color:var(--components-form-field-background-readonly);border-color:var(--nv-field-border-readonly)}nv-fieldmultiselect .input-container-multiselect:has(input:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fieldmultiselect .input-container-multiselect>nv-badge{margin-left:var(--form-field-padding-x)}nv-fieldmultiselect .input-container-multiselect input,nv-fieldmultiselect .input-container-multiselect 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);width:100%;flex-grow:1;margin:0;min-height:100%;box-sizing:border-box}nv-fieldmultiselect .input-container-multiselect input:focus,nv-fieldmultiselect .input-container-multiselect p.non-filterable-text:focus{outline:none}nv-fieldmultiselect .input-container-multiselect input::placeholder,nv-fieldmultiselect .input-container-multiselect 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-fieldmultiselect .input-container-multiselect>nv-iconbutton{border:0px;border-radius:0px}nv-fieldmultiselect .input-container-multiselect>nv-iconbutton:focus-visible{border-radius:var(--button-md-border-radius);outline-offset:-3px}nv-fieldmultiselect .input-container-multiselect nv-icon.validation{color:var(--nv-field-border-default)}nv-fieldmultiselect .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-fieldmultiselect .non-filterable-text span{display:inline-block;width:100%;overflow:hidden;text-overflow:ellipsis}nv-fieldmultiselect .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-fieldmultiselect .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)}.no-results-message{text-align:center;padding:10px;color:var(--components-form-text-description-error)}.multiselect-divider{display:block;width:100%;height:1px;background-color:var(--components-list-dropdown-separator);margin:var(--list-dropdown-item-padding-y) 0;border:0}";
8
- const NvFieldmultiselectStyle0 = nvFieldmultiselectCss;
9
-
10
- const NvFieldmultiselect = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- this.valueChanged = index.createEvent(this, "valueChanged");
14
- this.multiselectChange = index.createEvent(this, "multiselectChange");
15
- /****************************************************************************/
16
- //#region PROPERTIES
17
- /**
18
- * Sets the ID for the input element and the for attribute of the associated
19
- * label. If no ID is provided, a random one will be automatically generated
20
- * to ensure unique identification, facilitating proper label association and
21
- * accessibility.
22
- */
23
- this.inputId = v4A79185f4.v4();
24
- /**
25
- * Defines the maximum height of the multiselect list when open.
26
- */
27
- this.maxHeight = '200px';
28
- /**
29
- * Text for the badge showing the number of selected items.
30
- */
31
- this.badgeLabel = '';
32
- /**
33
- * The text to display when no items match the filter.
34
- */
35
- this.emptyResult = 'No results found';
36
- /**
37
- * Marks the input field as required.
38
- */
39
- this.required = false;
40
- /**
41
- * Alters the input field's appearance to indicate an error, helping users
42
- * identify fields that need correction.
43
- * @validator error
44
- */
45
- this.error = false;
46
- /**
47
- * Display the input field's content without allowing users to change it.
48
- */
49
- this.readonly = false;
50
- /**
51
- * Disables the input field.
52
- */
53
- this.disabled = false;
54
- /**
55
- * The autocomplete prop for faster input filling.
56
- */
57
- this.autocomplete = 'off';
58
- /**
59
- * Enables or disables the filtering feature for the multiselect items.
60
- */
61
- this.filterable = false;
62
- /**
63
- * State of the multiselect popover.
64
- */
65
- this.open = false;
66
- /**
67
- * Options configuration for the multiselect items.
68
- */
69
- this.parsedOptions = [];
70
- /**
71
- * List of selected values in the multiselect.
72
- */
73
- this.selectedValues = [];
74
- /**
75
- * Sorted options for display.
76
- */
77
- this.sortedOptions = [];
78
- /**
79
- * The text entered by the user for filtering multiselect items.
80
- */
81
- this.filterText = '';
82
- /**
83
- * Determines whether the multiselect is filterable.
84
- */
85
- this.isFilterable = this.filterable;
86
- /**
87
- * Delay in milliseconds before the search is triggered when typing in the filter input.
88
- * @default 300
89
- */
90
- this.debounceDelay = 300;
91
- /**
92
- * State for the mode of the multiselect.
93
- * @type {'options' | 'slots'}
94
- * @default 'options'
95
- */
96
- this.modeState = 'options'; // Default value
97
- this.isHandlingEscape = false;
98
- /**
99
- * Applies focus to the input field as soon as the component is mounted. This
100
- * is equivalent to setting the native autofocus attribute on an <input>
101
- * element.
102
- */
103
- this.autofocus = false;
104
- /**x
105
- * Handle badge close for options mode.
106
- */
107
- this.handleBadgeCloseOptions = () => {
108
- this.selectedValues = [];
109
- this.multiselectChange.emit(this.selectedValues);
110
- // Uncheck all elements
111
- const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck'));
112
- items.forEach(item => {
113
- item.checked = false;
114
- item.style.display = '';
115
- });
116
- // Reorder options without the divider since there are no selected elements
117
- this.parsedOptions = this.parsedOptions.filter(option => !option.isDivider);
118
- // Reorder options without the divider since there are no selected elements
119
- this.reorderOptionsContent();
120
- };
121
- /**
122
- * Handle badge close for slots mode.
123
- */
124
- this.handleBadgeCloseSlots = () => {
125
- this.selectedValues = [];
126
- this.multiselectChange.emit(this.selectedValues);
127
- // Uncheck all elements
128
- const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck'));
129
- items.forEach(item => {
130
- item.checked = false;
131
- item.style.display = '';
132
- });
133
- // Reorder slot content
134
- this.reorderSlotContent();
135
- };
136
- /**
137
- * Handle popover close
138
- */
139
- this.handlePopoverClose = () => {
140
- // If we are handling Escape, ignore this event
141
- if (this.isHandlingEscape) {
142
- return;
143
- }
144
- this.open = false;
145
- this.filterText = '';
146
- // Only reorder based on the mode
147
- if (this.modeState === 'options') {
148
- this.reorderOptionsContent();
149
- }
150
- else {
151
- this.reorderSlotContent();
152
- }
153
- // Reset filter if needed
154
- if (this.filterable) {
155
- this.resetFilter();
156
- }
157
- };
158
- /**
159
- * Handle input blur for options mode.
160
- */
161
- this.handleInputBlurOptions = () => {
162
- setTimeout(() => {
163
- if (!this.el.contains(document.activeElement)) {
164
- // Close the popover without affecting the divider
165
- this.open = false;
166
- this.popoverElement.hide();
167
- // Reset filter if needed
168
- if (this.filterable) {
169
- this.filterText = '';
170
- this.resetFilter();
171
- }
172
- }
173
- }, 150);
174
- };
175
- /**
176
- * Handle click on the input container for options mode.
177
- * @param {MouseEvent} event - The click event.
178
- */
179
- this.handleInputContainerClickOptions = (event) => {
180
- if (this.disabled || this.readonly) {
181
- return;
182
- }
183
- const target = event.target;
184
- if (target.tagName === 'P' || target.tagName === 'SPAN') {
185
- this.open = true;
186
- this.popoverElement.show();
187
- const inputContainer = this.el.querySelector('.input-container');
188
- if (inputContainer) {
189
- inputContainer.classList.add('focus-within');
190
- const removeFocusWithin = () => {
191
- inputContainer.classList.remove('focus-within');
192
- };
193
- this.popoverElement.addEventListener('hide', removeFocusWithin);
194
- }
195
- }
196
- };
197
- /**
198
- * Handle click on the input container for slots mode.
199
- * @param {MouseEvent} event - The click event.
200
- */
201
- this.handleInputContainerClickSlots = (event) => {
202
- if (this.disabled || this.readonly) {
203
- return;
204
- }
205
- const target = event.target;
206
- if (target.tagName === 'P' || target.tagName === 'SPAN') {
207
- this.open = true;
208
- this.popoverElement.show();
209
- const inputContainer = this.el.querySelector('.input-container');
210
- if (inputContainer) {
211
- inputContainer.classList.add('focus-within');
212
- const removeFocusWithin = () => {
213
- inputContainer.classList.remove('focus-within');
214
- };
215
- this.popoverElement.addEventListener('hide', removeFocusWithin);
216
- }
217
- }
218
- };
219
- /**
220
- * Handle input change for options mode.
221
- * @param {Event} event - The input event.
222
- */
223
- this.handleInputOptions = (event) => {
224
- if (!this.filterable)
225
- return;
226
- if (this.disabled || this.readonly) {
227
- return;
228
- }
229
- const input = event.target;
230
- this.value = input.value;
231
- this.valueChanged.emit(this.value);
232
- // Clear any existing timer
233
- if (this.debounceTimer) {
234
- window.clearTimeout(this.debounceTimer);
235
- }
236
- // Set a new timer for filtering
237
- this.debounceTimer = window.setTimeout(() => {
238
- this.filterText = input.value.toLowerCase();
239
- this.filterItemsOption();
240
- }, this.debounceDelay);
241
- };
242
- /**
243
- * Handle input change for slots mode
244
- * @param {Event} event - The input event.
245
- */
246
- this.handleInputSlots = (event) => {
247
- if (!this.filterable)
248
- return;
249
- if (this.disabled || this.readonly)
250
- return;
251
- const input = event.target;
252
- this.value = input.value;
253
- this.valueChanged.emit(this.value);
254
- // Clear any existing timer
255
- if (this.debounceTimer) {
256
- window.clearTimeout(this.debounceTimer);
257
- }
258
- // Set a new timer for filtering
259
- this.debounceTimer = window.setTimeout(() => {
260
- this.filterText = input.value.toLowerCase();
261
- this.filterSlotsItems();
262
- }, this.debounceDelay);
263
- };
264
- /**
265
- * Handle input focus for options mode.
266
- */
267
- this.handleInputFocusOptions = () => {
268
- if (this.disabled || this.readonly) {
269
- return;
270
- }
271
- this.open = true;
272
- };
273
- /**
274
- * Handle input focus for slots mode.
275
- */
276
- this.handleInputFocusSlots = () => {
277
- if (this.disabled || this.readonly) {
278
- return;
279
- }
280
- this.open = true;
281
- };
282
- /**
283
- * Handle input blur for slots mode.
284
- */
285
- this.handleInputBlurSlots = () => {
286
- setTimeout(() => {
287
- if (!this.el.contains(document.activeElement)) {
288
- // Close the popover without affecting the divider
289
- this.open = false;
290
- this.popoverElement.hide();
291
- // Reset filter if needed
292
- if (this.filterable) {
293
- this.filterText = '';
294
- this.resetFilter();
295
- }
296
- }
297
- }, 150);
298
- };
299
- /**
300
- * Toggle the multiselect popover for options mode.
301
- */
302
- this.togglePopoverOptions = () => {
303
- if (this.disabled || this.readonly) {
304
- return;
305
- }
306
- if (this.open) {
307
- this.handlePopoverClose();
308
- }
309
- else {
310
- this.open = true;
311
- this.popoverElement.show();
312
- if (!this.filterable) {
313
- this.focusFirstItem();
314
- }
315
- }
316
- };
317
- /**
318
- * Toggle the multiselect popover for slots mode.
319
- */
320
- this.togglePopoverSlots = () => {
321
- if (this.disabled || this.readonly) {
322
- return;
323
- }
324
- if (this.open) {
325
- this.handlePopoverClose();
326
- }
327
- else {
328
- this.open = true;
329
- this.popoverElement.show();
330
- if (!this.filterable) {
331
- this.focusFirstItem();
332
- }
333
- }
334
- };
335
- //#endregion METHODS
336
- /****************************************************************************/
337
- //#region RENDER
338
- /**
339
- * Renders the component in options mode
340
- * @returns {any} The JSX for options mode
341
- */
342
- this.renderOptionsMode = () => {
343
- return (index.h(index.Host, null, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { htmlFor: this.inputId }, index.h("slot", { name: "label" }, this.label))), index.h("nv-popover", { ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open }, index.h("div", { class: "input-wrapper-multiselect", slot: "trigger" }, index.h("slot", { name: "before-input" }), index.h("div", { class: "input-container-multiselect" }, index.h("slot", { name: "leading-input" }), index.h("nv-badge", { slot: "leading-input", "prevent-auto-close": true, color: "10", dismissible: this.selectedValues.length > 0, hidden: this.selectedValues.length <= 0, label: `${this.selectedValues.length} ${this.badgeLabel}`, "aria-label": `Clear all ${this.selectedValues.length} ${this.badgeLabel} items`, onCloseClicked: this.handleBadgeCloseOptions }), this.isFilterable || this.disabled || this.readonly ? (index.h("input", { type: "text", id: this.inputId, ref: e => (this.inputElement = e), autofocus: this.autofocus, autocomplete: this.autocomplete, placeholder: this.placeholder, name: this.name, value: this.value, required: this.required, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInputOptions, onFocus: this.handleInputFocusOptions, onBlur: this.handleInputBlurOptions, onKeyDown: this.handleKeyDown })) : (index.h("p", { id: this.inputId, class: "non-filterable-text", onClick: this.handleInputContainerClickOptions, tabIndex: 0, onKeyDown: this.handleKeyDown, onFocus: this.handleInputFocusOptions, role: "combobox", "aria-expanded": this.open }, index.h("span", null, this.value || this.placeholder))), this.error && (index.h("nv-icon", { name: "alert-circle", class: "validation", size: "md" })), index.h("nv-iconbutton", { "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.togglePopoverOptions })), index.h("slot", { name: "after-input" })), index.h("div", { slot: "content", role: "listbox", "aria-multiselectable": "true", style: { 'max-height': this.maxHeight, 'overflow-y': 'auto' } }, index.h("ul", { role: "content" }, this.parsedOptions.map(option => (index.h("nv-fielddropdownitemcheck", { label: option.label, description: option.description, value: option.value, checked: this.selectedValues.includes(option.value), disabled: option.disabled }))), index.h("hr", { class: "multiselect-divider", style: { display: 'none' } })))), this.renderDescriptions()));
344
- };
345
- /**
346
- * Renders the component in slots mode
347
- * @returns {any} The JSX for slots mode
348
- */
349
- this.renderSlotsMode = () => {
350
- return (index.h(index.Host, null, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { htmlFor: this.inputId }, index.h("slot", { name: "label" }, this.label))), index.h("nv-popover", { ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open }, index.h("div", { class: "input-wrapper-multiselect", slot: "trigger" }, index.h("slot", { name: "before-input" }), index.h("div", { class: "input-container-multiselect", onClick: this.handleInputContainerClickSlots }, index.h("slot", { name: "leading-input" }), index.h("nv-badge", { slot: "leading-input", "prevent-auto-close": true, color: "10", dismissible: this.selectedValues.length > 0, hidden: this.selectedValues.length <= 0, label: `${this.selectedValues.length} ${this.badgeLabel}`, "aria-label": `Clear all ${this.selectedValues.length} ${this.badgeLabel} items`, onCloseClicked: this.handleBadgeCloseSlots }), this.isFilterable || this.disabled || this.readonly ? (index.h("input", { id: this.inputId, ref: e => (this.inputElement = e), autocomplete: this.autocomplete, placeholder: this.placeholder, name: this.name, value: this.value, required: this.required, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInputSlots, onFocus: this.handleInputFocusSlots, onBlur: this.handleInputBlurSlots, onKeyDown: this.handleKeyDown })) : (index.h("p", { id: this.inputId, class: "non-filterable-text", onClick: this.handleInputContainerClickSlots, tabIndex: 0, onKeyDown: this.handleKeyDown, onFocus: this.handleInputFocusSlots, role: "combobox", "aria-expanded": this.open }, index.h("span", null, this.value || this.placeholder))), this.error && (index.h("nv-icon", { name: "alert-circle", class: "validation", size: "md" })), index.h("nv-iconbutton", { "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.togglePopoverSlots })), index.h("slot", { name: "after-input" })), index.h("div", { slot: "content", role: "listbox", "aria-multiselectable": "true", style: { 'max-height': this.maxHeight, 'overflow-y': 'auto' } }, index.h("slot", { name: "content" }))), this.renderDescriptions()));
351
- };
352
- }
353
- //#endregion PROPERTIES
354
- /****************************************************************************/
355
- //#region LIFECYCLE
356
- /**
357
- * Subscribe to click outside event.
358
- */
359
- connectedCallback() {
360
- document.addEventListener('click', this.handleClickOutside.bind(this));
361
- }
362
- /**
363
- * Set the mode state and handle options change.
364
- */
365
- componentWillLoad() {
366
- this.modeState = this.options ? 'options' : 'slots';
367
- // Don't call handleOptionsChange if we are in slots mode
368
- if (this.modeState === 'options') {
369
- this.handleOptionsChange(this.options);
370
- }
371
- // Add the listener for the hide event
372
- requestAnimationFrame(() => {
373
- if (this.popoverElement) {
374
- this.popoverElement.addEventListener('hide', () => {
375
- this.handlePopoverClose();
376
- });
377
- }
378
- });
379
- // Specific initialization for slots mode
380
- if (this.modeState === 'slots') {
381
- Promise.resolve().then(() => {
382
- const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck'));
383
- // Initialize selectedValues with checked items
384
- this.selectedValues = items
385
- .filter(item => item.hasAttribute('checked'))
386
- .map(item => item.getAttribute('value') || '');
387
- // Force a reorder after initialization
388
- requestAnimationFrame(() => {
389
- this.reorderSlotContent();
390
- });
391
- });
392
- }
393
- // Initialize the sorted options array with the parsed options for initial rendering
394
- if (this.modeState === 'options') {
395
- this.sortedOptions = [...this.parsedOptions];
396
- }
397
- // Apply filtering if the multiselect is filterable and there is a value
398
- if (this.filterable && this.value) {
399
- this.filterText = String(this.value).toLocaleLowerCase();
400
- this.filterItems();
401
- }
402
- else {
403
- // Reset visibility state of all dropdown items
404
- this.resetFilter();
405
- }
406
- }
407
- /**
408
- * Force reorder if options mode in componentDidLoad because of the initial render not trigger @watch
409
- */
410
- componentDidLoad() {
411
- if (this.modeState === 'options') {
412
- requestAnimationFrame(() => {
413
- this.reorderOptionsContent();
414
- });
415
- }
416
- }
417
- /**
418
- * Unsubscribe from click outside event.
419
- */
420
- disconnectedCallback() {
421
- document.removeEventListener('click', this.handleClickOutside.bind(this));
422
- // Remove the listener for the hide event
423
- if (this.popoverElement) {
424
- this.popoverElement.removeEventListener('hide', () => {
425
- this.handlePopoverClose();
426
- });
427
- }
428
- }
429
- /**
430
- * Emitted when the input loses focus.
431
- * @param {CustomEvent<boolean>} event - The event object containing the focus state.
432
- */
433
- handleOpenChanged(event) {
434
- // Update the open state of popover
435
- this.open = event.detail;
436
- if (this.open) {
437
- if (this.filterText) {
438
- this.filterItems();
439
- }
440
- }
441
- else if (this.modeState === 'options') {
442
- this.reorderOptionsContent();
443
- }
444
- else {
445
- this.reorderSlotContent();
446
- }
447
- }
448
- /**
449
- * Listen for the `itemChecked` event emitted by child items.
450
- * @param {CustomEvent} event - The event object containing the selected value and its checked state.
451
- */
452
- handleItemChecked(event) {
453
- if (this.disabled || this.readonly) {
454
- return;
455
- }
456
- const { value, checked } = event.detail;
457
- if (value !== undefined && value !== null) {
458
- const newSelectedValues = [...this.selectedValues];
459
- const valueIndex = newSelectedValues.indexOf(value);
460
- if (checked && valueIndex === -1) {
461
- newSelectedValues.push(value);
462
- }
463
- else if (!checked && valueIndex > -1) {
464
- newSelectedValues.splice(valueIndex, 1);
465
- }
466
- // Update the state and emit the event only if the selection has changed
467
- if (JSON.stringify(this.selectedValues) !==
468
- JSON.stringify(newSelectedValues)) {
469
- this.selectedValues = newSelectedValues;
470
- // Use requestAnimationFrame to ensure the state is updated before emitting the event
471
- requestAnimationFrame(() => {
472
- this.multiselectChange.emit(this.selectedValues);
473
- });
474
- }
475
- }
476
- else {
477
- console.warn('Received itemChecked event with undefined or null value'); // Warning log
478
- }
479
- }
480
- /**
481
- * Emitted when the options change.
482
- * @param {string | Array<{label: string, value: string, isDivider?: boolean, disabled?: boolean, description?: string, checked?: boolean}>} newValue - The new value of the options.
483
- */
484
- handleOptionsChange(newValue) {
485
- if (typeof newValue === 'string') {
486
- try {
487
- const parsedOpts = JSON.parse(newValue);
488
- this.selectedValues = parsedOpts
489
- .filter(option => option.checked)
490
- .map(option => option.value);
491
- this.parsedOptions = [...parsedOpts];
492
- }
493
- catch (error) {
494
- console.error('Error parsing options:', error);
495
- this.parsedOptions = [];
496
- }
497
- }
498
- else if (Array.isArray(newValue)) {
499
- this.selectedValues = newValue
500
- .filter(option => option.checked)
501
- .map(option => option.value);
502
- this.parsedOptions = [...newValue];
503
- }
504
- else {
505
- this.parsedOptions = [];
506
- }
507
- // Wait for the options to be fully loaded
508
- Promise.resolve().then(() => {
509
- requestAnimationFrame(() => {
510
- if (this.modeState === 'options') {
511
- this.reorderOptionsContent();
512
- }
513
- });
514
- });
515
- }
516
- /**
517
- * Emitted when the value changes.
518
- */
519
- watchValueHandler() {
520
- // Handle value change and update the corresponding multiselect item if it exists
521
- this.setInitialSelection();
522
- }
523
- /**
524
- * Emitted when the filterable property changes.
525
- * @param {boolean} newValue - The new value of the filterable property.
526
- */
527
- watchFilterableHandler(newValue) {
528
- this.isFilterable = newValue;
529
- this.filterable = newValue;
530
- }
531
- // Add a listener for the slot content
532
- handleSlotChange(event) {
533
- // Check: we only want to reorder if it's the "content" slot
534
- const slot = event.target;
535
- if (slot && slot.name === 'content') {
536
- // To give other platforms (VueJS, React, etc.) time to insert all their items,
537
- // we place the reorder in a requestAnimationFrame
538
- requestAnimationFrame(() => {
539
- this.reorderSlotContent();
540
- });
541
- }
542
- }
543
- //#endregion EVENTS
544
- /****************************************************************************/
545
- //#region METHODS
546
- /**
547
- * Retrieves the current filter text entered by the user.
548
- * @returns {string} The filter text.
549
- */
550
- async getFilterText() {
551
- return this.filterText;
552
- }
553
- /**
554
- * Set the initial selection based on the current value and update the inputElement value.
555
- */
556
- setInitialSelection() {
557
- var _a;
558
- const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitem'));
559
- const selectedItem = items.find(item => {
560
- var _a;
561
- return item.getAttribute('label') === this.value ||
562
- item.getAttribute('value') === this.value ||
563
- ((_a = item.textContent) === null || _a === void 0 ? void 0 : _a.trim()) === this.value;
564
- });
565
- // Remove 'selected' from all items first to reset the state
566
- items.forEach(item => {
567
- item.removeAttribute('selected');
568
- item.classList.remove('selected');
569
- });
570
- if (selectedItem) {
571
- // Add the `selected` attribute and `selected` class for visual styling
572
- selectedItem.setAttribute('selected', 'true');
573
- selectedItem.classList.add('selected');
574
- // Update the value and inputElement value to reflect the pre-selected item
575
- this.value =
576
- selectedItem.getAttribute('label') ||
577
- selectedItem.getAttribute('value') ||
578
- ((_a = selectedItem.textContent) === null || _a === void 0 ? void 0 : _a.trim()) ||
579
- '';
580
- if (this.inputElement) {
581
- this.inputElement.value = this.value;
582
- }
583
- }
584
- }
585
- /**
586
- * Reset the filter and make all items visible.
587
- */
588
- async resetFilter() {
589
- const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck'));
590
- // Reset visibility state of all dropdown items
591
- items.forEach(item => {
592
- item.style.display = '';
593
- });
594
- // Clean up filter-related UI elements
595
- const ul = this.el.querySelector('ul');
596
- if (ul) {
597
- const emptyMessage = ul.querySelector('[data-empty]');
598
- if (emptyMessage)
599
- emptyMessage.remove();
600
- // Reorder with divider if needed
601
- const selectedItems = items.filter(item => this.selectedValues.includes(item.getAttribute('value') || ''));
602
- const unselectedItems = items.filter(item => !this.selectedValues.includes(item.getAttribute('value') || ''));
603
- if (selectedItems.length > 0) {
604
- this.manageDivider(ul, selectedItems, unselectedItems);
605
- }
606
- }
607
- }
608
- /**
609
- * Returns the list of selected values.
610
- * @returns {string[]} The selected values.
611
- */
612
- async getSelectedValues() {
613
- return this.selectedValues;
614
- }
615
- /**
616
- * Reorder the content of the slot.
617
- */
618
- reorderSlotContent() {
619
- if (this.modeState === 'options')
620
- return;
621
- const ul = this.el.querySelector('ul');
622
- if (!ul)
623
- return;
624
- // Remove all existing <hr class="multiselect-divider">
625
- ul.querySelectorAll('hr.multiselect-divider').forEach(divider => divider.remove());
626
- // Retrieve all items (not hidden)
627
- const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck')).filter(item => item.style.display !== 'none');
628
- // If you possibly have a "No results" message:
629
- const hasEmptyMessage = ul.querySelector('[data-empty]');
630
- if (hasEmptyMessage) {
631
- // if there is a "No results found" message, do not reorder
632
- return;
633
- }
634
- // Separate checked vs unchecked
635
- const selectedItems = items.filter(item => this.selectedValues.includes(item.getAttribute('value') || ''));
636
- const unselectedItems = items.filter(item => !this.selectedValues.includes(item.getAttribute('value') || ''));
637
- // Reinsert CHECKED items FIRST
638
- // appendChild() moves the element without recreating it
639
- // this is not trigger a re-rendering of the component in the platforms
640
- selectedItems.forEach(item => {
641
- ul.appendChild(item); // <-- The <li> (or <nv-fielddropdownitemcheck>) is just "moved" to the end of the list
642
- });
643
- // Add a divider if needed
644
- if (selectedItems.length > 0 && unselectedItems.length > 0) {
645
- const divider = document.createElement('hr');
646
- divider.className = 'multiselect-divider';
647
- ul.appendChild(divider);
648
- }
649
- // Reinsert UNCHECKED items at the end
650
- unselectedItems.forEach(item => {
651
- ul.appendChild(item);
652
- });
653
- }
654
- /**
655
- * Reorder the content for options mode with async handling
656
- */
657
- reorderOptionsContent() {
658
- const ul = this.el.querySelector('ul[role="content"]');
659
- if (!ul)
660
- return;
661
- const items = Array.from(ul.querySelectorAll('nv-fielddropdownitemcheck')).filter(item => item.style.display !== 'none');
662
- const selectedItems = items.filter(item => this.selectedValues.includes(item.getAttribute('value') || ''));
663
- const unselectedItems = items.filter(item => !this.selectedValues.includes(item.getAttribute('value') || ''));
664
- // Reorder the elements
665
- selectedItems.forEach(item => ul.appendChild(item));
666
- unselectedItems.forEach(item => ul.appendChild(item));
667
- // Manage the divider after the reordering
668
- this.manageDivider(ul, selectedItems, unselectedItems);
669
- }
670
- /**
671
- * Filter multiselect items based on the text entered by the user.
672
- */
673
- filterItems() {
674
- const ul = this.el.querySelector('ul');
675
- if (!ul)
676
- return;
677
- // Remove existing empty message if any
678
- const existingEmptyMessage = ul.querySelector('[data-empty]');
679
- if (existingEmptyMessage) {
680
- existingEmptyMessage.remove();
681
- }
682
- if (!this.filterText.trim()) {
683
- if (this.parsedOptions && this.parsedOptions.length > 0) {
684
- // Reset options display
685
- const items = Array.from(ul.querySelectorAll('nv-fielddropdownitemcheck'));
686
- items.forEach(item => {
687
- item.style.display = '';
688
- });
689
- }
690
- else {
691
- // Reset slot items display
692
- const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck'));
693
- items.forEach(item => {
694
- item.style.display = '';
695
- });
696
- }
697
- // Reorder with divider
698
- const items = Array.from(ul.querySelectorAll('nv-fielddropdownitemcheck'));
699
- const selectedItems = items.filter(item => this.selectedValues.includes(item.getAttribute('value') || ''));
700
- const unselectedItems = items.filter(item => !this.selectedValues.includes(item.getAttribute('value') || ''));
701
- this.manageDivider(ul, selectedItems, unselectedItems);
702
- return;
703
- }
704
- const normalizedFilter = this.normalizeText(this.filterText);
705
- let hasVisibleItems = false;
706
- if (this.parsedOptions && this.parsedOptions.length > 0) {
707
- // Filter options mode
708
- const items = Array.from(ul.querySelectorAll('nv-fielddropdownitemcheck'));
709
- items.forEach(item => {
710
- const option = this.parsedOptions.find(opt => opt.value === item.getAttribute('value'));
711
- if (option && !option.isDivider) {
712
- const matchesFilter = this.normalizeText(option.label).includes(normalizedFilter) ||
713
- this.normalizeText(option.value).includes(normalizedFilter);
714
- item.style.display = matchesFilter ? '' : 'none';
715
- if (matchesFilter)
716
- hasVisibleItems = true;
717
- }
718
- });
719
- // Manage the divider with the visible items
720
- const visibleItems = items.filter(item => item.style.display !== 'none');
721
- const visibleSelected = visibleItems.filter(item => this.selectedValues.includes(item.getAttribute('value') || ''));
722
- const visibleUnselected = visibleItems.filter(item => !this.selectedValues.includes(item.getAttribute('value') || ''));
723
- this.manageDivider(ul, visibleSelected, visibleUnselected);
724
- }
725
- else {
726
- // Filter slot items mode
727
- const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck'));
728
- items.forEach(item => {
729
- const label = item.getAttribute('label') || '';
730
- const value = item.getAttribute('value') || '';
731
- const textContent = item.textContent || '';
732
- const matchesFilter = this.normalizeText(label).includes(normalizedFilter) ||
733
- this.normalizeText(value).includes(normalizedFilter) ||
734
- this.normalizeText(textContent).includes(normalizedFilter);
735
- item.style.display = matchesFilter ? '' : 'none';
736
- if (matchesFilter)
737
- hasVisibleItems = true;
738
- });
739
- }
740
- // Add empty message if no items match the filter
741
- if (!hasVisibleItems) {
742
- const emptyMessage = document.createElement('li');
743
- emptyMessage.setAttribute('data-empty', 'true');
744
- emptyMessage.textContent = this.emptyResult;
745
- emptyMessage.classList.add('no-results-message');
746
- ul.appendChild(emptyMessage);
747
- }
748
- this.reorderSlotContent();
749
- }
750
- /**
751
- * Filter multiselect items in options mode.
752
- */
753
- filterItemsOption() {
754
- const ul = this.el.querySelector('ul');
755
- if (!ul)
756
- return;
757
- const normalizedFilter = this.normalizeText(this.filterText);
758
- let hasVisibleItems = false;
759
- const items = Array.from(ul.querySelectorAll('nv-fielddropdownitemcheck'));
760
- // Reset items if the filter text is empty
761
- if (!this.filterText.trim()) {
762
- // Remove the empty message if it exists
763
- this.removeEmptyMessageOption(ul);
764
- items.forEach(item => (item.style.display = ''));
765
- this.reorderOptionsContent(); // Reorder after reset
766
- return;
767
- }
768
- // Filter the items
769
- items.forEach(item => {
770
- const label = item.getAttribute('label') || '';
771
- const value = item.getAttribute('value') || '';
772
- const matchesFilter = this.normalizeText(label).includes(normalizedFilter) ||
773
- this.normalizeText(value).includes(normalizedFilter);
774
- item.style.display = matchesFilter ? '' : 'none';
775
- if (matchesFilter)
776
- hasVisibleItems = true;
777
- });
778
- // Manage the divider with the visible items
779
- const visibleItems = items.filter(item => item.style.display !== 'none');
780
- const visibleSelected = visibleItems.filter(item => this.selectedValues.includes(item.getAttribute('value') || ''));
781
- const visibleUnselected = visibleItems.filter(item => !this.selectedValues.includes(item.getAttribute('value') || ''));
782
- this.manageDivider(ul, visibleSelected, visibleUnselected);
783
- // Add or remove the empty message based on the case
784
- if (!hasVisibleItems) {
785
- this.addEmptyMessageOption(ul);
786
- }
787
- else {
788
- this.removeEmptyMessageOption(ul);
789
- }
790
- }
791
- /**
792
- * Filter multiselect items in slots mode
793
- */
794
- filterSlotsItems() {
795
- if (this.modeState === 'options')
796
- return;
797
- const ul = this.el.querySelector('ul');
798
- if (!ul)
799
- return;
800
- // Remove existing empty message if any
801
- const existingEmptyMessage = ul.querySelector('[data-empty]');
802
- if (existingEmptyMessage) {
803
- existingEmptyMessage.remove();
804
- }
805
- // If filter text is empty, reset all items visibility
806
- if (!this.filterText.trim()) {
807
- this.resetFilter();
808
- return;
809
- }
810
- const normalizedFilter = this.normalizeText(this.filterText);
811
- let hasVisibleItems = false;
812
- // Get all items and preserve them in the DOM
813
- const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck'));
814
- // Instead of removing/reordering, just hide/show items
815
- items.forEach(item => {
816
- var _a;
817
- const label = item.getAttribute('label') || '';
818
- const value = item.getAttribute('value') || '';
819
- const textContent = ((_a = item.textContent) === null || _a === void 0 ? void 0 : _a.trim()) || '';
820
- const matchesFilter = this.normalizeText(label).includes(normalizedFilter) ||
821
- this.normalizeText(value).includes(normalizedFilter) ||
822
- this.normalizeText(textContent).includes(normalizedFilter);
823
- item.style.display = matchesFilter ? '' : 'none';
824
- if (matchesFilter)
825
- hasVisibleItems = true;
826
- });
827
- // Get visible items after filtering
828
- const visibleItems = items.filter(item => item.style.display !== 'none');
829
- const visibleSelectedItems = visibleItems.filter(item => this.selectedValues.includes(item.getAttribute('value') || ''));
830
- this.manageDivider(ul, visibleSelectedItems, visibleItems.filter(item => !this.selectedValues.includes(item.getAttribute('value') || '')));
831
- // Add empty message if no items match the filter
832
- if (!hasVisibleItems) {
833
- const emptyMessage = document.createElement('li');
834
- emptyMessage.setAttribute('data-empty', 'true');
835
- emptyMessage.textContent = this.emptyResult;
836
- emptyMessage.classList.add('no-results-message');
837
- ul.appendChild(emptyMessage);
838
- }
839
- }
840
- /**
841
- * Normalizes text by removing accents and converting to lowercase
842
- * @param {string} text - The text to normalize
843
- * @returns {string} The normalized text
844
- *
845
- * @example
846
- * normalizeText("Café Latte") => "cafe latte"
847
- *
848
- * @description
849
- * This function performs text normalization in three steps:
850
- * 1. Decomposes characters into their base form and combining characters (NFD)
851
- * 2. Removes all diacritical marks (accents, umlauts, etc.)
852
- * 3. Converts to lowercase and trims whitespace
853
- *
854
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize} - MDN documentation on String.normalize()
855
- * @see {@link https://en.wikipedia.org/wiki/Unicode_equivalence#Normal_forms} - More info about Unicode normalization forms
856
- */
857
- normalizeText(text) {
858
- return text
859
- .normalize('NFD') // Decompose characters into base + combining characters (e.g., é => e + ´)
860
- .replace(/[\u0300-\u036f]/g, '') // Remove all diacritical marks (Unicode range for combining characters)
861
- .toLowerCase() // Convert to lowercase
862
- .trim(); // Remove leading and trailing whitespace
863
- }
864
- handleClickOutside(event) {
865
- if (this.el.contains(event.target) ||
866
- (this.inputElement && this.inputElement.contains(event.target))) {
867
- return;
868
- }
869
- // Use handlePopoverClose for all cases
870
- this.handlePopoverClose();
871
- }
872
- /**
873
- * Handle keyboard events & arrow key navigation.
874
- * If the multiselect is not open, opens it and focuses on the first item if the list is not filterable.
875
- * If the multiselect is open, handles arrow key navigation and closes it if the focus is outside the component.
876
- * @param {KeyboardEvent} event - The keyboard event.
877
- */
878
- async handleKeyDown(event) {
879
- if (!this.open) {
880
- if (event.key === 'ArrowDown') {
881
- this.open = true;
882
- this.popoverElement.show();
883
- // Focus on the first item if the list is not filterable
884
- if (!this.filterable) {
885
- requestAnimationFrame(() => {
886
- this.focusFirstItem();
887
- });
888
- }
889
- event.preventDefault();
890
- return;
891
- }
892
- return;
893
- }
894
- const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck:not([style*="display: none"])'));
895
- if (items.length === 0) {
896
- console.warn('No visible items found to navigate');
897
- return;
898
- }
899
- let currentIndex = items.findIndex(item => item.classList.contains('highlighted'));
900
- if (event.key === 'ArrowDown') {
901
- event.preventDefault();
902
- currentIndex =
903
- currentIndex === -1 ? 0 : (currentIndex + 1) % items.length;
904
- this.updateHighlightedItem(items, currentIndex);
905
- }
906
- else if (event.key === 'ArrowUp') {
907
- event.preventDefault();
908
- currentIndex =
909
- currentIndex === -1
910
- ? items.length - 1
911
- : (currentIndex - 1 + items.length) % items.length;
912
- this.updateHighlightedItem(items, currentIndex);
913
- }
914
- else if (event.key === 'Enter' && currentIndex >= 0) {
915
- event.preventDefault();
916
- const selectedItem = items[currentIndex];
917
- // Toggle the checked state
918
- const isCurrentlyChecked = selectedItem.hasAttribute('checked');
919
- selectedItem.checked = !isCurrentlyChecked;
920
- // Trigger a click event to ensure proper event handling
921
- selectedItem.dispatchEvent(new MouseEvent('click', {
922
- view: window,
923
- bubbles: true,
924
- cancelable: true,
925
- }));
926
- }
927
- else if (event.key === 'Escape') {
928
- event.preventDefault();
929
- event.stopPropagation(); // Prevent the event from propagating to the popover
930
- // Do the reorder and wait a bit before closing
931
- const handleEscape = async () => {
932
- this.isHandlingEscape = true; // Disable the hide listener
933
- if (this.modeState === 'options') {
934
- this.reorderOptionsContent();
935
- }
936
- else {
937
- this.reorderSlotContent();
938
- }
939
- // Wait for the reorder to be applied
940
- await new Promise(resolve => setTimeout(resolve, 100));
941
- // Reactivate the hide listener after a short delay
942
- setTimeout(() => {
943
- this.isHandlingEscape = false;
944
- this.open = false;
945
- this.popoverElement.hide();
946
- }, 150);
947
- if (this.inputElement) {
948
- this.inputElement.blur();
949
- }
950
- };
951
- await handleEscape();
952
- }
953
- }
954
- /**
955
- * Updates the highlighted item in the dropdown list.
956
- *
957
- * @param {(HTMLNvFielddropdownitemElement | HTMLNvFielddropdownitemcheckElement)[]} items - The items to update.
958
- * @param {number} index - The index of the item to highlight.
959
- */
960
- updateHighlightedItem(items, index) {
961
- items.forEach((item, i) => {
962
- if (i === index) {
963
- item.classList.add('highlighted');
964
- item.setAttribute('tabindex', '0');
965
- item.scrollIntoView({ block: 'nearest' });
966
- // Focus on the nv-fieldcheckbox inside
967
- const checkbox = item.querySelector('nv-fieldcheckbox');
968
- if (checkbox) {
969
- checkbox.focus();
970
- }
971
- }
972
- else {
973
- item.classList.remove('highlighted');
974
- item.setAttribute('tabindex', '-1');
975
- }
976
- });
977
- }
978
- /**
979
- * Focus on the first item in the dropdown list.
980
- */
981
- focusFirstItem() {
982
- const firstItem = this.el.querySelector('nv-fielddropdownitemcheck:not([style*="display: none"])');
983
- if (firstItem) {
984
- firstItem.setAttribute('tabindex', '0');
985
- firstItem.classList.add('highlighted');
986
- firstItem.scrollIntoView({ block: 'nearest' });
987
- // Focus on the nv-fieldcheckbox inside
988
- const checkbox = firstItem.querySelector('nv-fieldcheckbox');
989
- if (checkbox) {
990
- checkbox.focus();
991
- }
992
- }
993
- else {
994
- console.warn('No visible first item found to focus');
995
- }
996
- }
997
- addEmptyMessageOption(ul) {
998
- const existingMessage = ul.querySelector('[data-empty]');
999
- if (existingMessage)
1000
- return;
1001
- const emptyMessage = document.createElement('li');
1002
- emptyMessage.setAttribute('data-empty', 'true');
1003
- emptyMessage.textContent = this.emptyResult;
1004
- emptyMessage.classList.add('no-results-message');
1005
- ul.appendChild(emptyMessage);
1006
- }
1007
- removeEmptyMessageOption(ul) {
1008
- const existingMessage = ul.querySelector('[data-empty]');
1009
- if (existingMessage)
1010
- existingMessage.remove();
1011
- }
1012
- manageDivider(ul, selectedItems, unselectedItems) {
1013
- let divider = ul.querySelector('hr.multiselect-divider');
1014
- if (!divider) {
1015
- divider = document.createElement('hr');
1016
- divider.className = 'multiselect-divider';
1017
- ul.appendChild(divider);
1018
- }
1019
- const shouldShowDivider = selectedItems.length > 0 && unselectedItems.length > 0;
1020
- if (shouldShowDivider) {
1021
- // Place the divider after the last selected item
1022
- const lastSelectedItem = selectedItems[selectedItems.length - 1];
1023
- lastSelectedItem.after(divider);
1024
- divider.style.display = '';
1025
- }
1026
- else {
1027
- divider.style.display = 'none';
1028
- }
1029
- }
1030
- /**
1031
- * Renders description and error description sections
1032
- * @returns {any} The JSX for descriptions
1033
- */
1034
- renderDescriptions() {
1035
- return [
1036
- (this.description || this.el.querySelector('[slot="description"]')) && (index.h("div", { class: "description" }, index.h("slot", { name: "description" }, this.description))),
1037
- (this.errorDescription ||
1038
- this.el.querySelector('[slot="error-description"]')) && (index.h("div", { hidden: !this.error, class: "error-description" }, index.h("slot", { name: "error-description" }, this.errorDescription))),
1039
- ];
1040
- }
1041
- /**
1042
- * Main render method that decides which mode to render
1043
- * @returns {any} The JSX for the component
1044
- */
1045
- render() {
1046
- return this.modeState === 'options'
1047
- ? this.renderOptionsMode()
1048
- : this.renderSlotsMode();
1049
- }
1050
- static get formAssociated() { return true; }
1051
- get el() { return index.getElement(this); }
1052
- static get watchers() { return {
1053
- "options": ["handleOptionsChange"],
1054
- "value": ["watchValueHandler"],
1055
- "filterable": ["watchFilterableHandler"]
1056
- }; }
1057
- };
1058
- NvFieldmultiselect.style = NvFieldmultiselectStyle0;
1059
-
1060
- exports.nv_fieldmultiselect = NvFieldmultiselect;