@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,1960 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-CEWbQ5nh.js');
4
- var fade_animation2a077983 = require('./fade.animation-2a077983-aKN0EDTo.js');
5
- var events_utilsFe1d907f = require('./events.utils-fe1d907f-01N__3wY.js');
6
- require('react');
7
-
8
- const useGrow = (node, { duration = 200, amount = 0.8, hasFade = true } = {}) => {
9
- const nodeStyler = fade_animation2a077983.index(node);
10
- /**
11
- * Will animate the scale and optionally the opacity to make the element grow and fade in,
12
- * and removes the scale and opacity style attributes once complete.
13
- */
14
- function growIn() {
15
- return new Promise(resolve => {
16
- fade_animation2a077983.animate({
17
- from: { opacity: hasFade ? 0 : 1, scale: amount },
18
- to: { opacity: 1, scale: 1 },
19
- duration,
20
- onUpdate(latest) {
21
- const updates = {
22
- scale: latest.scale,
23
- };
24
- if (hasFade) {
25
- updates['opacity'] = latest.opacity;
26
- }
27
- nodeStyler.set(updates);
28
- },
29
- onComplete() {
30
- resolve();
31
- if (hasFade) {
32
- node.style.removeProperty('opacity');
33
- }
34
- node.style.removeProperty('transform');
35
- },
36
- });
37
- });
38
- }
39
- /**
40
- * Applies the growOut styles without animating, useful when the initial
41
- * state is hidden.
42
- */
43
- function setGrowOut() {
44
- node.style.transform = `scale(${amount})`;
45
- if (hasFade) {
46
- node.style.opacity = '0';
47
- }
48
- }
49
- /**
50
- * Applies the growIn styles without animating, useful when the initial
51
- * state is visible.
52
- */
53
- function setGrowIn() {
54
- node.style.transform = `scale(1)`;
55
- if (hasFade) {
56
- node.style.opacity = '1';
57
- }
58
- }
59
- /**
60
- * Will animate the scale and optionally the opacity to make the element shrink and fade out,
61
- * leaving the scale and opacity styles on the element.
62
- */
63
- function growOut() {
64
- return new Promise(resolve => {
65
- fade_animation2a077983.animate({
66
- from: { opacity: 1, scale: 1 },
67
- to: { opacity: hasFade ? 0 : 1, scale: amount },
68
- duration,
69
- onUpdate(latest) {
70
- const updates = {
71
- scale: latest.scale,
72
- };
73
- if (hasFade) {
74
- updates['opacity'] = latest.opacity;
75
- }
76
- nodeStyler.set(updates);
77
- },
78
- onComplete() {
79
- resolve();
80
- },
81
- });
82
- });
83
- }
84
- return {
85
- growIn,
86
- growOut,
87
- setGrowOut,
88
- setGrowIn,
89
- };
90
- };
91
-
92
- const min = Math.min;
93
- const max = Math.max;
94
- const round = Math.round;
95
- const createCoords = v => ({
96
- x: v,
97
- y: v
98
- });
99
- const oppositeSideMap = {
100
- left: 'right',
101
- right: 'left',
102
- bottom: 'top',
103
- top: 'bottom'
104
- };
105
- const oppositeAlignmentMap = {
106
- start: 'end',
107
- end: 'start'
108
- };
109
- function clamp(start, value, end) {
110
- return max(start, min(value, end));
111
- }
112
- function evaluate(value, param) {
113
- return typeof value === 'function' ? value(param) : value;
114
- }
115
- function getSide(placement) {
116
- return placement.split('-')[0];
117
- }
118
- function getAlignment(placement) {
119
- return placement.split('-')[1];
120
- }
121
- function getOppositeAxis(axis) {
122
- return axis === 'x' ? 'y' : 'x';
123
- }
124
- function getAxisLength(axis) {
125
- return axis === 'y' ? 'height' : 'width';
126
- }
127
- function getSideAxis(placement) {
128
- return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
129
- }
130
- function getAlignmentAxis(placement) {
131
- return getOppositeAxis(getSideAxis(placement));
132
- }
133
- function getAlignmentSides(placement, rects, rtl) {
134
- if (rtl === void 0) {
135
- rtl = false;
136
- }
137
- const alignment = getAlignment(placement);
138
- const alignmentAxis = getAlignmentAxis(placement);
139
- const length = getAxisLength(alignmentAxis);
140
- let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
141
- if (rects.reference[length] > rects.floating[length]) {
142
- mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
143
- }
144
- return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
145
- }
146
- function getExpandedPlacements(placement) {
147
- const oppositePlacement = getOppositePlacement(placement);
148
- return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
149
- }
150
- function getOppositeAlignmentPlacement(placement) {
151
- return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
152
- }
153
- function getSideList(side, isStart, rtl) {
154
- const lr = ['left', 'right'];
155
- const rl = ['right', 'left'];
156
- const tb = ['top', 'bottom'];
157
- const bt = ['bottom', 'top'];
158
- switch (side) {
159
- case 'top':
160
- case 'bottom':
161
- if (rtl) return isStart ? rl : lr;
162
- return isStart ? lr : rl;
163
- case 'left':
164
- case 'right':
165
- return isStart ? tb : bt;
166
- default:
167
- return [];
168
- }
169
- }
170
- function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
171
- const alignment = getAlignment(placement);
172
- let list = getSideList(getSide(placement), direction === 'start', rtl);
173
- if (alignment) {
174
- list = list.map(side => side + "-" + alignment);
175
- if (flipAlignment) {
176
- list = list.concat(list.map(getOppositeAlignmentPlacement));
177
- }
178
- }
179
- return list;
180
- }
181
- function getOppositePlacement(placement) {
182
- return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
183
- }
184
- function expandPaddingObject(padding) {
185
- return {
186
- top: 0,
187
- right: 0,
188
- bottom: 0,
189
- left: 0,
190
- ...padding
191
- };
192
- }
193
- function getPaddingObject(padding) {
194
- return typeof padding !== 'number' ? expandPaddingObject(padding) : {
195
- top: padding,
196
- right: padding,
197
- bottom: padding,
198
- left: padding
199
- };
200
- }
201
- function rectToClientRect(rect) {
202
- const {
203
- x,
204
- y,
205
- width,
206
- height
207
- } = rect;
208
- return {
209
- width,
210
- height,
211
- top: y,
212
- left: x,
213
- right: x + width,
214
- bottom: y + height,
215
- x,
216
- y
217
- };
218
- }
219
-
220
- function computeCoordsFromPlacement(_ref, placement, rtl) {
221
- let {
222
- reference,
223
- floating
224
- } = _ref;
225
- const sideAxis = getSideAxis(placement);
226
- const alignmentAxis = getAlignmentAxis(placement);
227
- const alignLength = getAxisLength(alignmentAxis);
228
- const side = getSide(placement);
229
- const isVertical = sideAxis === 'y';
230
- const commonX = reference.x + reference.width / 2 - floating.width / 2;
231
- const commonY = reference.y + reference.height / 2 - floating.height / 2;
232
- const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
233
- let coords;
234
- switch (side) {
235
- case 'top':
236
- coords = {
237
- x: commonX,
238
- y: reference.y - floating.height
239
- };
240
- break;
241
- case 'bottom':
242
- coords = {
243
- x: commonX,
244
- y: reference.y + reference.height
245
- };
246
- break;
247
- case 'right':
248
- coords = {
249
- x: reference.x + reference.width,
250
- y: commonY
251
- };
252
- break;
253
- case 'left':
254
- coords = {
255
- x: reference.x - floating.width,
256
- y: commonY
257
- };
258
- break;
259
- default:
260
- coords = {
261
- x: reference.x,
262
- y: reference.y
263
- };
264
- }
265
- switch (getAlignment(placement)) {
266
- case 'start':
267
- coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
268
- break;
269
- case 'end':
270
- coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
271
- break;
272
- }
273
- return coords;
274
- }
275
-
276
- /**
277
- * Computes the `x` and `y` coordinates that will place the floating element
278
- * next to a given reference element.
279
- *
280
- * This export does not have any `platform` interface logic. You will need to
281
- * write one for the platform you are using Floating UI with.
282
- */
283
- const computePosition$1 = async (reference, floating, config) => {
284
- const {
285
- placement = 'bottom',
286
- strategy = 'absolute',
287
- middleware = [],
288
- platform
289
- } = config;
290
- const validMiddleware = middleware.filter(Boolean);
291
- const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
292
- let rects = await platform.getElementRects({
293
- reference,
294
- floating,
295
- strategy
296
- });
297
- let {
298
- x,
299
- y
300
- } = computeCoordsFromPlacement(rects, placement, rtl);
301
- let statefulPlacement = placement;
302
- let middlewareData = {};
303
- let resetCount = 0;
304
- for (let i = 0; i < validMiddleware.length; i++) {
305
- const {
306
- name,
307
- fn
308
- } = validMiddleware[i];
309
- const {
310
- x: nextX,
311
- y: nextY,
312
- data,
313
- reset
314
- } = await fn({
315
- x,
316
- y,
317
- initialPlacement: placement,
318
- placement: statefulPlacement,
319
- strategy,
320
- middlewareData,
321
- rects,
322
- platform,
323
- elements: {
324
- reference,
325
- floating
326
- }
327
- });
328
- x = nextX != null ? nextX : x;
329
- y = nextY != null ? nextY : y;
330
- middlewareData = {
331
- ...middlewareData,
332
- [name]: {
333
- ...middlewareData[name],
334
- ...data
335
- }
336
- };
337
- if (reset && resetCount <= 50) {
338
- resetCount++;
339
- if (typeof reset === 'object') {
340
- if (reset.placement) {
341
- statefulPlacement = reset.placement;
342
- }
343
- if (reset.rects) {
344
- rects = reset.rects === true ? await platform.getElementRects({
345
- reference,
346
- floating,
347
- strategy
348
- }) : reset.rects;
349
- }
350
- ({
351
- x,
352
- y
353
- } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
354
- }
355
- i = -1;
356
- }
357
- }
358
- return {
359
- x,
360
- y,
361
- placement: statefulPlacement,
362
- strategy,
363
- middlewareData
364
- };
365
- };
366
-
367
- /**
368
- * Resolves with an object of overflow side offsets that determine how much the
369
- * element is overflowing a given clipping boundary on each side.
370
- * - positive = overflowing the boundary by that number of pixels
371
- * - negative = how many pixels left before it will overflow
372
- * - 0 = lies flush with the boundary
373
- * @see https://floating-ui.com/docs/detectOverflow
374
- */
375
- async function detectOverflow(state, options) {
376
- var _await$platform$isEle;
377
- if (options === void 0) {
378
- options = {};
379
- }
380
- const {
381
- x,
382
- y,
383
- platform,
384
- rects,
385
- elements,
386
- strategy
387
- } = state;
388
- const {
389
- boundary = 'clippingAncestors',
390
- rootBoundary = 'viewport',
391
- elementContext = 'floating',
392
- altBoundary = false,
393
- padding = 0
394
- } = evaluate(options, state);
395
- const paddingObject = getPaddingObject(padding);
396
- const altContext = elementContext === 'floating' ? 'reference' : 'floating';
397
- const element = elements[altBoundary ? altContext : elementContext];
398
- const clippingClientRect = rectToClientRect(await platform.getClippingRect({
399
- element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
400
- boundary,
401
- rootBoundary,
402
- strategy
403
- }));
404
- const rect = elementContext === 'floating' ? {
405
- x,
406
- y,
407
- width: rects.floating.width,
408
- height: rects.floating.height
409
- } : rects.reference;
410
- const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
411
- const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
412
- x: 1,
413
- y: 1
414
- } : {
415
- x: 1,
416
- y: 1
417
- };
418
- const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
419
- elements,
420
- rect,
421
- offsetParent,
422
- strategy
423
- }) : rect);
424
- return {
425
- top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
426
- bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
427
- left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
428
- right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
429
- };
430
- }
431
-
432
- /**
433
- * Provides data to position an inner element of the floating element so that it
434
- * appears centered to the reference element.
435
- * @see https://floating-ui.com/docs/arrow
436
- */
437
- const arrow$1 = options => ({
438
- name: 'arrow',
439
- options,
440
- async fn(state) {
441
- const {
442
- x,
443
- y,
444
- placement,
445
- rects,
446
- platform,
447
- elements,
448
- middlewareData
449
- } = state;
450
- // Since `element` is required, we don't Partial<> the type.
451
- const {
452
- element,
453
- padding = 0
454
- } = evaluate(options, state) || {};
455
- if (element == null) {
456
- return {};
457
- }
458
- const paddingObject = getPaddingObject(padding);
459
- const coords = {
460
- x,
461
- y
462
- };
463
- const axis = getAlignmentAxis(placement);
464
- const length = getAxisLength(axis);
465
- const arrowDimensions = await platform.getDimensions(element);
466
- const isYAxis = axis === 'y';
467
- const minProp = isYAxis ? 'top' : 'left';
468
- const maxProp = isYAxis ? 'bottom' : 'right';
469
- const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
470
- const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
471
- const startDiff = coords[axis] - rects.reference[axis];
472
- const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
473
- let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
474
-
475
- // DOM platform can return `window` as the `offsetParent`.
476
- if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
477
- clientSize = elements.floating[clientProp] || rects.floating[length];
478
- }
479
- const centerToReference = endDiff / 2 - startDiff / 2;
480
-
481
- // If the padding is large enough that it causes the arrow to no longer be
482
- // centered, modify the padding so that it is centered.
483
- const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
484
- const minPadding = min(paddingObject[minProp], largestPossiblePadding);
485
- const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
486
-
487
- // Make sure the arrow doesn't overflow the floating element if the center
488
- // point is outside the floating element's bounds.
489
- const min$1 = minPadding;
490
- const max = clientSize - arrowDimensions[length] - maxPadding;
491
- const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
492
- const offset = clamp(min$1, center, max);
493
-
494
- // If the reference is small enough that the arrow's padding causes it to
495
- // to point to nothing for an aligned placement, adjust the offset of the
496
- // floating element itself. To ensure `shift()` continues to take action,
497
- // a single reset is performed when this is true.
498
- const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
499
- const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
500
- return {
501
- [axis]: coords[axis] + alignmentOffset,
502
- data: {
503
- [axis]: offset,
504
- centerOffset: center - offset - alignmentOffset,
505
- ...(shouldAddOffset && {
506
- alignmentOffset
507
- })
508
- },
509
- reset: shouldAddOffset
510
- };
511
- }
512
- });
513
-
514
- /**
515
- * Optimizes the visibility of the floating element by flipping the `placement`
516
- * in order to keep it in view when the preferred placement(s) will overflow the
517
- * clipping boundary. Alternative to `autoPlacement`.
518
- * @see https://floating-ui.com/docs/flip
519
- */
520
- const flip$1 = function (options) {
521
- if (options === void 0) {
522
- options = {};
523
- }
524
- return {
525
- name: 'flip',
526
- options,
527
- async fn(state) {
528
- var _middlewareData$arrow, _middlewareData$flip;
529
- const {
530
- placement,
531
- middlewareData,
532
- rects,
533
- initialPlacement,
534
- platform,
535
- elements
536
- } = state;
537
- const {
538
- mainAxis: checkMainAxis = true,
539
- crossAxis: checkCrossAxis = true,
540
- fallbackPlacements: specifiedFallbackPlacements,
541
- fallbackStrategy = 'bestFit',
542
- fallbackAxisSideDirection = 'none',
543
- flipAlignment = true,
544
- ...detectOverflowOptions
545
- } = evaluate(options, state);
546
-
547
- // If a reset by the arrow was caused due to an alignment offset being
548
- // added, we should skip any logic now since `flip()` has already done its
549
- // work.
550
- // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
551
- if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
552
- return {};
553
- }
554
- const side = getSide(placement);
555
- const isBasePlacement = getSide(initialPlacement) === initialPlacement;
556
- const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
557
- const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
558
- if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
559
- fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
560
- }
561
- const placements = [initialPlacement, ...fallbackPlacements];
562
- const overflow = await detectOverflow(state, detectOverflowOptions);
563
- const overflows = [];
564
- let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
565
- if (checkMainAxis) {
566
- overflows.push(overflow[side]);
567
- }
568
- if (checkCrossAxis) {
569
- const sides = getAlignmentSides(placement, rects, rtl);
570
- overflows.push(overflow[sides[0]], overflow[sides[1]]);
571
- }
572
- overflowsData = [...overflowsData, {
573
- placement,
574
- overflows
575
- }];
576
-
577
- // One or more sides is overflowing.
578
- if (!overflows.every(side => side <= 0)) {
579
- var _middlewareData$flip2, _overflowsData$filter;
580
- const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
581
- const nextPlacement = placements[nextIndex];
582
- if (nextPlacement) {
583
- // Try next placement and re-run the lifecycle.
584
- return {
585
- data: {
586
- index: nextIndex,
587
- overflows: overflowsData
588
- },
589
- reset: {
590
- placement: nextPlacement
591
- }
592
- };
593
- }
594
-
595
- // First, find the candidates that fit on the mainAxis side of overflow,
596
- // then find the placement that fits the best on the main crossAxis side.
597
- let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
598
-
599
- // Otherwise fallback.
600
- if (!resetPlacement) {
601
- switch (fallbackStrategy) {
602
- case 'bestFit':
603
- {
604
- var _overflowsData$map$so;
605
- const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
606
- if (placement) {
607
- resetPlacement = placement;
608
- }
609
- break;
610
- }
611
- case 'initialPlacement':
612
- resetPlacement = initialPlacement;
613
- break;
614
- }
615
- }
616
- if (placement !== resetPlacement) {
617
- return {
618
- reset: {
619
- placement: resetPlacement
620
- }
621
- };
622
- }
623
- }
624
- return {};
625
- }
626
- };
627
- };
628
-
629
- // For type backwards-compatibility, the `OffsetOptions` type was also
630
- // Derivable.
631
-
632
- async function convertValueToCoords(state, options) {
633
- const {
634
- placement,
635
- platform,
636
- elements
637
- } = state;
638
- const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
639
- const side = getSide(placement);
640
- const alignment = getAlignment(placement);
641
- const isVertical = getSideAxis(placement) === 'y';
642
- const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
643
- const crossAxisMulti = rtl && isVertical ? -1 : 1;
644
- const rawValue = evaluate(options, state);
645
-
646
- // eslint-disable-next-line prefer-const
647
- let {
648
- mainAxis,
649
- crossAxis,
650
- alignmentAxis
651
- } = typeof rawValue === 'number' ? {
652
- mainAxis: rawValue,
653
- crossAxis: 0,
654
- alignmentAxis: null
655
- } : {
656
- mainAxis: 0,
657
- crossAxis: 0,
658
- alignmentAxis: null,
659
- ...rawValue
660
- };
661
- if (alignment && typeof alignmentAxis === 'number') {
662
- crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
663
- }
664
- return isVertical ? {
665
- x: crossAxis * crossAxisMulti,
666
- y: mainAxis * mainAxisMulti
667
- } : {
668
- x: mainAxis * mainAxisMulti,
669
- y: crossAxis * crossAxisMulti
670
- };
671
- }
672
-
673
- /**
674
- * Modifies the placement by translating the floating element along the
675
- * specified axes.
676
- * A number (shorthand for `mainAxis` or distance), or an axes configuration
677
- * object may be passed.
678
- * @see https://floating-ui.com/docs/offset
679
- */
680
- const offset$1 = function (options) {
681
- if (options === void 0) {
682
- options = 0;
683
- }
684
- return {
685
- name: 'offset',
686
- options,
687
- async fn(state) {
688
- var _middlewareData$offse, _middlewareData$arrow;
689
- const {
690
- x,
691
- y,
692
- placement,
693
- middlewareData
694
- } = state;
695
- const diffCoords = await convertValueToCoords(state, options);
696
-
697
- // If the placement is the same and the arrow caused an alignment offset
698
- // then we don't need to change the positioning coordinates.
699
- if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
700
- return {};
701
- }
702
- return {
703
- x: x + diffCoords.x,
704
- y: y + diffCoords.y,
705
- data: {
706
- ...diffCoords,
707
- placement
708
- }
709
- };
710
- }
711
- };
712
- };
713
-
714
- /**
715
- * Optimizes the visibility of the floating element by shifting it in order to
716
- * keep it in view when it will overflow the clipping boundary.
717
- * @see https://floating-ui.com/docs/shift
718
- */
719
- const shift$1 = function (options) {
720
- if (options === void 0) {
721
- options = {};
722
- }
723
- return {
724
- name: 'shift',
725
- options,
726
- async fn(state) {
727
- const {
728
- x,
729
- y,
730
- placement
731
- } = state;
732
- const {
733
- mainAxis: checkMainAxis = true,
734
- crossAxis: checkCrossAxis = false,
735
- limiter = {
736
- fn: _ref => {
737
- let {
738
- x,
739
- y
740
- } = _ref;
741
- return {
742
- x,
743
- y
744
- };
745
- }
746
- },
747
- ...detectOverflowOptions
748
- } = evaluate(options, state);
749
- const coords = {
750
- x,
751
- y
752
- };
753
- const overflow = await detectOverflow(state, detectOverflowOptions);
754
- const crossAxis = getSideAxis(getSide(placement));
755
- const mainAxis = getOppositeAxis(crossAxis);
756
- let mainAxisCoord = coords[mainAxis];
757
- let crossAxisCoord = coords[crossAxis];
758
- if (checkMainAxis) {
759
- const minSide = mainAxis === 'y' ? 'top' : 'left';
760
- const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
761
- const min = mainAxisCoord + overflow[minSide];
762
- const max = mainAxisCoord - overflow[maxSide];
763
- mainAxisCoord = clamp(min, mainAxisCoord, max);
764
- }
765
- if (checkCrossAxis) {
766
- const minSide = crossAxis === 'y' ? 'top' : 'left';
767
- const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
768
- const min = crossAxisCoord + overflow[minSide];
769
- const max = crossAxisCoord - overflow[maxSide];
770
- crossAxisCoord = clamp(min, crossAxisCoord, max);
771
- }
772
- const limitedCoords = limiter.fn({
773
- ...state,
774
- [mainAxis]: mainAxisCoord,
775
- [crossAxis]: crossAxisCoord
776
- });
777
- return {
778
- ...limitedCoords,
779
- data: {
780
- x: limitedCoords.x - x,
781
- y: limitedCoords.y - y
782
- }
783
- };
784
- }
785
- };
786
- };
787
-
788
- function hasWindow() {
789
- return typeof window !== 'undefined';
790
- }
791
- function getNodeName(node) {
792
- if (isNode(node)) {
793
- return (node.nodeName || '').toLowerCase();
794
- }
795
- // Mocked nodes in testing environments may not be instances of Node. By
796
- // returning `#document` an infinite loop won't occur.
797
- // https://github.com/floating-ui/floating-ui/issues/2317
798
- return '#document';
799
- }
800
- function getWindow(node) {
801
- var _node$ownerDocument;
802
- return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
803
- }
804
- function getDocumentElement(node) {
805
- var _ref;
806
- return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
807
- }
808
- function isNode(value) {
809
- if (!hasWindow()) {
810
- return false;
811
- }
812
- return value instanceof Node || value instanceof getWindow(value).Node;
813
- }
814
- function isElement(value) {
815
- if (!hasWindow()) {
816
- return false;
817
- }
818
- return value instanceof Element || value instanceof getWindow(value).Element;
819
- }
820
- function isHTMLElement(value) {
821
- if (!hasWindow()) {
822
- return false;
823
- }
824
- return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
825
- }
826
- function isShadowRoot(value) {
827
- if (!hasWindow() || typeof ShadowRoot === 'undefined') {
828
- return false;
829
- }
830
- return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
831
- }
832
- function isOverflowElement(element) {
833
- const {
834
- overflow,
835
- overflowX,
836
- overflowY,
837
- display
838
- } = getComputedStyle(element);
839
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
840
- }
841
- function isTableElement(element) {
842
- return ['table', 'td', 'th'].includes(getNodeName(element));
843
- }
844
- function isTopLayer(element) {
845
- return [':popover-open', ':modal'].some(selector => {
846
- try {
847
- return element.matches(selector);
848
- } catch (e) {
849
- return false;
850
- }
851
- });
852
- }
853
- function isContainingBlock(elementOrCss) {
854
- const webkit = isWebKit();
855
- const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
856
-
857
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
858
- return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
859
- }
860
- function getContainingBlock(element) {
861
- let currentNode = getParentNode(element);
862
- while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
863
- if (isContainingBlock(currentNode)) {
864
- return currentNode;
865
- } else if (isTopLayer(currentNode)) {
866
- return null;
867
- }
868
- currentNode = getParentNode(currentNode);
869
- }
870
- return null;
871
- }
872
- function isWebKit() {
873
- if (typeof CSS === 'undefined' || !CSS.supports) return false;
874
- return CSS.supports('-webkit-backdrop-filter', 'none');
875
- }
876
- function isLastTraversableNode(node) {
877
- return ['html', 'body', '#document'].includes(getNodeName(node));
878
- }
879
- function getComputedStyle(element) {
880
- return getWindow(element).getComputedStyle(element);
881
- }
882
- function getNodeScroll(element) {
883
- if (isElement(element)) {
884
- return {
885
- scrollLeft: element.scrollLeft,
886
- scrollTop: element.scrollTop
887
- };
888
- }
889
- return {
890
- scrollLeft: element.scrollX,
891
- scrollTop: element.scrollY
892
- };
893
- }
894
- function getParentNode(node) {
895
- if (getNodeName(node) === 'html') {
896
- return node;
897
- }
898
- const result =
899
- // Step into the shadow DOM of the parent of a slotted node.
900
- node.assignedSlot ||
901
- // DOM Element detected.
902
- node.parentNode ||
903
- // ShadowRoot detected.
904
- isShadowRoot(node) && node.host ||
905
- // Fallback.
906
- getDocumentElement(node);
907
- return isShadowRoot(result) ? result.host : result;
908
- }
909
- function getNearestOverflowAncestor(node) {
910
- const parentNode = getParentNode(node);
911
- if (isLastTraversableNode(parentNode)) {
912
- return node.ownerDocument ? node.ownerDocument.body : node.body;
913
- }
914
- if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
915
- return parentNode;
916
- }
917
- return getNearestOverflowAncestor(parentNode);
918
- }
919
- function getOverflowAncestors(node, list, traverseIframes) {
920
- var _node$ownerDocument2;
921
- if (list === void 0) {
922
- list = [];
923
- }
924
- const scrollableAncestor = getNearestOverflowAncestor(node);
925
- const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
926
- const win = getWindow(scrollableAncestor);
927
- if (isBody) {
928
- getFrameElement(win);
929
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], []);
930
- }
931
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, []));
932
- }
933
- function getFrameElement(win) {
934
- return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
935
- }
936
-
937
- function getCssDimensions(element) {
938
- const css = getComputedStyle(element);
939
- // In testing environments, the `width` and `height` properties are empty
940
- // strings for SVG elements, returning NaN. Fallback to `0` in this case.
941
- let width = parseFloat(css.width) || 0;
942
- let height = parseFloat(css.height) || 0;
943
- const hasOffset = isHTMLElement(element);
944
- const offsetWidth = hasOffset ? element.offsetWidth : width;
945
- const offsetHeight = hasOffset ? element.offsetHeight : height;
946
- const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
947
- if (shouldFallback) {
948
- width = offsetWidth;
949
- height = offsetHeight;
950
- }
951
- return {
952
- width,
953
- height,
954
- $: shouldFallback
955
- };
956
- }
957
-
958
- function unwrapElement(element) {
959
- return !isElement(element) ? element.contextElement : element;
960
- }
961
-
962
- function getScale(element) {
963
- const domElement = unwrapElement(element);
964
- if (!isHTMLElement(domElement)) {
965
- return createCoords(1);
966
- }
967
- const rect = domElement.getBoundingClientRect();
968
- const {
969
- width,
970
- height,
971
- $
972
- } = getCssDimensions(domElement);
973
- let x = ($ ? round(rect.width) : rect.width) / width;
974
- let y = ($ ? round(rect.height) : rect.height) / height;
975
-
976
- // 0, NaN, or Infinity should always fallback to 1.
977
-
978
- if (!x || !Number.isFinite(x)) {
979
- x = 1;
980
- }
981
- if (!y || !Number.isFinite(y)) {
982
- y = 1;
983
- }
984
- return {
985
- x,
986
- y
987
- };
988
- }
989
-
990
- const noOffsets = /*#__PURE__*/createCoords(0);
991
- function getVisualOffsets(element) {
992
- const win = getWindow(element);
993
- if (!isWebKit() || !win.visualViewport) {
994
- return noOffsets;
995
- }
996
- return {
997
- x: win.visualViewport.offsetLeft,
998
- y: win.visualViewport.offsetTop
999
- };
1000
- }
1001
- function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
1002
- if (isFixed === void 0) {
1003
- isFixed = false;
1004
- }
1005
- if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
1006
- return false;
1007
- }
1008
- return isFixed;
1009
- }
1010
-
1011
- function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
1012
- if (includeScale === void 0) {
1013
- includeScale = false;
1014
- }
1015
- if (isFixedStrategy === void 0) {
1016
- isFixedStrategy = false;
1017
- }
1018
- const clientRect = element.getBoundingClientRect();
1019
- const domElement = unwrapElement(element);
1020
- let scale = createCoords(1);
1021
- if (includeScale) {
1022
- if (offsetParent) {
1023
- if (isElement(offsetParent)) {
1024
- scale = getScale(offsetParent);
1025
- }
1026
- } else {
1027
- scale = getScale(element);
1028
- }
1029
- }
1030
- const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
1031
- let x = (clientRect.left + visualOffsets.x) / scale.x;
1032
- let y = (clientRect.top + visualOffsets.y) / scale.y;
1033
- let width = clientRect.width / scale.x;
1034
- let height = clientRect.height / scale.y;
1035
- if (domElement) {
1036
- const win = getWindow(domElement);
1037
- const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
1038
- let currentWin = win;
1039
- let currentIFrame = getFrameElement(currentWin);
1040
- while (currentIFrame && offsetParent && offsetWin !== currentWin) {
1041
- const iframeScale = getScale(currentIFrame);
1042
- const iframeRect = currentIFrame.getBoundingClientRect();
1043
- const css = getComputedStyle(currentIFrame);
1044
- const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
1045
- const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
1046
- x *= iframeScale.x;
1047
- y *= iframeScale.y;
1048
- width *= iframeScale.x;
1049
- height *= iframeScale.y;
1050
- x += left;
1051
- y += top;
1052
- currentWin = getWindow(currentIFrame);
1053
- currentIFrame = getFrameElement(currentWin);
1054
- }
1055
- }
1056
- return rectToClientRect({
1057
- width,
1058
- height,
1059
- x,
1060
- y
1061
- });
1062
- }
1063
-
1064
- function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
1065
- let {
1066
- elements,
1067
- rect,
1068
- offsetParent,
1069
- strategy
1070
- } = _ref;
1071
- const isFixed = strategy === 'fixed';
1072
- const documentElement = getDocumentElement(offsetParent);
1073
- const topLayer = elements ? isTopLayer(elements.floating) : false;
1074
- if (offsetParent === documentElement || topLayer && isFixed) {
1075
- return rect;
1076
- }
1077
- let scroll = {
1078
- scrollLeft: 0,
1079
- scrollTop: 0
1080
- };
1081
- let scale = createCoords(1);
1082
- const offsets = createCoords(0);
1083
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
1084
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1085
- if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
1086
- scroll = getNodeScroll(offsetParent);
1087
- }
1088
- if (isHTMLElement(offsetParent)) {
1089
- const offsetRect = getBoundingClientRect(offsetParent);
1090
- scale = getScale(offsetParent);
1091
- offsets.x = offsetRect.x + offsetParent.clientLeft;
1092
- offsets.y = offsetRect.y + offsetParent.clientTop;
1093
- }
1094
- }
1095
- return {
1096
- width: rect.width * scale.x,
1097
- height: rect.height * scale.y,
1098
- x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
1099
- y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
1100
- };
1101
- }
1102
-
1103
- function getClientRects(element) {
1104
- return Array.from(element.getClientRects());
1105
- }
1106
-
1107
- // If <html> has a CSS width greater than the viewport, then this will be
1108
- // incorrect for RTL.
1109
- function getWindowScrollBarX(element, rect) {
1110
- const leftScroll = getNodeScroll(element).scrollLeft;
1111
- if (!rect) {
1112
- return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
1113
- }
1114
- return rect.left + leftScroll;
1115
- }
1116
-
1117
- // Gets the entire size of the scrollable document area, even extending outside
1118
- // of the `<html>` and `<body>` rect bounds if horizontally scrollable.
1119
- function getDocumentRect(element) {
1120
- const html = getDocumentElement(element);
1121
- const scroll = getNodeScroll(element);
1122
- const body = element.ownerDocument.body;
1123
- const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
1124
- const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
1125
- let x = -scroll.scrollLeft + getWindowScrollBarX(element);
1126
- const y = -scroll.scrollTop;
1127
- if (getComputedStyle(body).direction === 'rtl') {
1128
- x += max(html.clientWidth, body.clientWidth) - width;
1129
- }
1130
- return {
1131
- width,
1132
- height,
1133
- x,
1134
- y
1135
- };
1136
- }
1137
-
1138
- function getViewportRect(element, strategy) {
1139
- const win = getWindow(element);
1140
- const html = getDocumentElement(element);
1141
- const visualViewport = win.visualViewport;
1142
- let width = html.clientWidth;
1143
- let height = html.clientHeight;
1144
- let x = 0;
1145
- let y = 0;
1146
- if (visualViewport) {
1147
- width = visualViewport.width;
1148
- height = visualViewport.height;
1149
- const visualViewportBased = isWebKit();
1150
- if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
1151
- x = visualViewport.offsetLeft;
1152
- y = visualViewport.offsetTop;
1153
- }
1154
- }
1155
- return {
1156
- width,
1157
- height,
1158
- x,
1159
- y
1160
- };
1161
- }
1162
-
1163
- // Returns the inner client rect, subtracting scrollbars if present.
1164
- function getInnerBoundingClientRect(element, strategy) {
1165
- const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
1166
- const top = clientRect.top + element.clientTop;
1167
- const left = clientRect.left + element.clientLeft;
1168
- const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
1169
- const width = element.clientWidth * scale.x;
1170
- const height = element.clientHeight * scale.y;
1171
- const x = left * scale.x;
1172
- const y = top * scale.y;
1173
- return {
1174
- width,
1175
- height,
1176
- x,
1177
- y
1178
- };
1179
- }
1180
- function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
1181
- let rect;
1182
- if (clippingAncestor === 'viewport') {
1183
- rect = getViewportRect(element, strategy);
1184
- } else if (clippingAncestor === 'document') {
1185
- rect = getDocumentRect(getDocumentElement(element));
1186
- } else if (isElement(clippingAncestor)) {
1187
- rect = getInnerBoundingClientRect(clippingAncestor, strategy);
1188
- } else {
1189
- const visualOffsets = getVisualOffsets(element);
1190
- rect = {
1191
- ...clippingAncestor,
1192
- x: clippingAncestor.x - visualOffsets.x,
1193
- y: clippingAncestor.y - visualOffsets.y
1194
- };
1195
- }
1196
- return rectToClientRect(rect);
1197
- }
1198
- function hasFixedPositionAncestor(element, stopNode) {
1199
- const parentNode = getParentNode(element);
1200
- if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
1201
- return false;
1202
- }
1203
- return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
1204
- }
1205
-
1206
- // A "clipping ancestor" is an `overflow` element with the characteristic of
1207
- // clipping (or hiding) child elements. This returns all clipping ancestors
1208
- // of the given element up the tree.
1209
- function getClippingElementAncestors(element, cache) {
1210
- const cachedResult = cache.get(element);
1211
- if (cachedResult) {
1212
- return cachedResult;
1213
- }
1214
- let result = getOverflowAncestors(element, []).filter(el => isElement(el) && getNodeName(el) !== 'body');
1215
- let currentContainingBlockComputedStyle = null;
1216
- const elementIsFixed = getComputedStyle(element).position === 'fixed';
1217
- let currentNode = elementIsFixed ? getParentNode(element) : element;
1218
-
1219
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
1220
- while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
1221
- const computedStyle = getComputedStyle(currentNode);
1222
- const currentNodeIsContaining = isContainingBlock(currentNode);
1223
- if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
1224
- currentContainingBlockComputedStyle = null;
1225
- }
1226
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
1227
- if (shouldDropCurrentNode) {
1228
- // Drop non-containing blocks.
1229
- result = result.filter(ancestor => ancestor !== currentNode);
1230
- } else {
1231
- // Record last containing block for next iteration.
1232
- currentContainingBlockComputedStyle = computedStyle;
1233
- }
1234
- currentNode = getParentNode(currentNode);
1235
- }
1236
- cache.set(element, result);
1237
- return result;
1238
- }
1239
-
1240
- // Gets the maximum area that the element is visible in due to any number of
1241
- // clipping ancestors.
1242
- function getClippingRect(_ref) {
1243
- let {
1244
- element,
1245
- boundary,
1246
- rootBoundary,
1247
- strategy
1248
- } = _ref;
1249
- const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
1250
- const clippingAncestors = [...elementClippingAncestors, rootBoundary];
1251
- const firstClippingAncestor = clippingAncestors[0];
1252
- const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
1253
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
1254
- accRect.top = max(rect.top, accRect.top);
1255
- accRect.right = min(rect.right, accRect.right);
1256
- accRect.bottom = min(rect.bottom, accRect.bottom);
1257
- accRect.left = max(rect.left, accRect.left);
1258
- return accRect;
1259
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
1260
- return {
1261
- width: clippingRect.right - clippingRect.left,
1262
- height: clippingRect.bottom - clippingRect.top,
1263
- x: clippingRect.left,
1264
- y: clippingRect.top
1265
- };
1266
- }
1267
-
1268
- function getDimensions(element) {
1269
- const {
1270
- width,
1271
- height
1272
- } = getCssDimensions(element);
1273
- return {
1274
- width,
1275
- height
1276
- };
1277
- }
1278
-
1279
- function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
1280
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
1281
- const documentElement = getDocumentElement(offsetParent);
1282
- const isFixed = strategy === 'fixed';
1283
- const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
1284
- let scroll = {
1285
- scrollLeft: 0,
1286
- scrollTop: 0
1287
- };
1288
- const offsets = createCoords(0);
1289
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1290
- if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
1291
- scroll = getNodeScroll(offsetParent);
1292
- }
1293
- if (isOffsetParentAnElement) {
1294
- const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
1295
- offsets.x = offsetRect.x + offsetParent.clientLeft;
1296
- offsets.y = offsetRect.y + offsetParent.clientTop;
1297
- } else if (documentElement) {
1298
- // If the <body> scrollbar appears on the left (e.g. RTL systems). Use
1299
- // Firefox with layout.scrollbar.side = 3 in about:config to test this.
1300
- offsets.x = getWindowScrollBarX(documentElement);
1301
- }
1302
- }
1303
- let htmlX = 0;
1304
- let htmlY = 0;
1305
- if (documentElement && !isOffsetParentAnElement && !isFixed) {
1306
- const htmlRect = documentElement.getBoundingClientRect();
1307
- htmlY = htmlRect.top + scroll.scrollTop;
1308
- htmlX = htmlRect.left + scroll.scrollLeft -
1309
- // RTL <body> scrollbar.
1310
- getWindowScrollBarX(documentElement, htmlRect);
1311
- }
1312
- const x = rect.left + scroll.scrollLeft - offsets.x - htmlX;
1313
- const y = rect.top + scroll.scrollTop - offsets.y - htmlY;
1314
- return {
1315
- x,
1316
- y,
1317
- width: rect.width,
1318
- height: rect.height
1319
- };
1320
- }
1321
-
1322
- function isStaticPositioned(element) {
1323
- return getComputedStyle(element).position === 'static';
1324
- }
1325
-
1326
- function getTrueOffsetParent(element, polyfill) {
1327
- if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
1328
- return null;
1329
- }
1330
- if (polyfill) {
1331
- return polyfill(element);
1332
- }
1333
- let rawOffsetParent = element.offsetParent;
1334
-
1335
- // Firefox returns the <html> element as the offsetParent if it's non-static,
1336
- // while Chrome and Safari return the <body> element. The <body> element must
1337
- // be used to perform the correct calculations even if the <html> element is
1338
- // non-static.
1339
- if (getDocumentElement(element) === rawOffsetParent) {
1340
- rawOffsetParent = rawOffsetParent.ownerDocument.body;
1341
- }
1342
- return rawOffsetParent;
1343
- }
1344
-
1345
- // Gets the closest ancestor positioned element. Handles some edge cases,
1346
- // such as table ancestors and cross browser bugs.
1347
- function getOffsetParent(element, polyfill) {
1348
- const win = getWindow(element);
1349
- if (isTopLayer(element)) {
1350
- return win;
1351
- }
1352
- if (!isHTMLElement(element)) {
1353
- let svgOffsetParent = getParentNode(element);
1354
- while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
1355
- if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
1356
- return svgOffsetParent;
1357
- }
1358
- svgOffsetParent = getParentNode(svgOffsetParent);
1359
- }
1360
- return win;
1361
- }
1362
- let offsetParent = getTrueOffsetParent(element, polyfill);
1363
- while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
1364
- offsetParent = getTrueOffsetParent(offsetParent, polyfill);
1365
- }
1366
- if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
1367
- return win;
1368
- }
1369
- return offsetParent || getContainingBlock(element) || win;
1370
- }
1371
-
1372
- const getElementRects = async function (data) {
1373
- const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
1374
- const getDimensionsFn = this.getDimensions;
1375
- const floatingDimensions = await getDimensionsFn(data.floating);
1376
- return {
1377
- reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
1378
- floating: {
1379
- x: 0,
1380
- y: 0,
1381
- width: floatingDimensions.width,
1382
- height: floatingDimensions.height
1383
- }
1384
- };
1385
- };
1386
-
1387
- function isRTL(element) {
1388
- return getComputedStyle(element).direction === 'rtl';
1389
- }
1390
-
1391
- const platform = {
1392
- convertOffsetParentRelativeRectToViewportRelativeRect,
1393
- getDocumentElement,
1394
- getClippingRect,
1395
- getOffsetParent,
1396
- getElementRects,
1397
- getClientRects,
1398
- getDimensions,
1399
- getScale,
1400
- isElement,
1401
- isRTL
1402
- };
1403
-
1404
- /**
1405
- * Modifies the placement by translating the floating element along the
1406
- * specified axes.
1407
- * A number (shorthand for `mainAxis` or distance), or an axes configuration
1408
- * object may be passed.
1409
- * @see https://floating-ui.com/docs/offset
1410
- */
1411
- const offset = offset$1;
1412
-
1413
- /**
1414
- * Optimizes the visibility of the floating element by shifting it in order to
1415
- * keep it in view when it will overflow the clipping boundary.
1416
- * @see https://floating-ui.com/docs/shift
1417
- */
1418
- const shift = shift$1;
1419
-
1420
- /**
1421
- * Optimizes the visibility of the floating element by flipping the `placement`
1422
- * in order to keep it in view when the preferred placement(s) will overflow the
1423
- * clipping boundary. Alternative to `autoPlacement`.
1424
- * @see https://floating-ui.com/docs/flip
1425
- */
1426
- const flip = flip$1;
1427
-
1428
- /**
1429
- * Provides data to position an inner element of the floating element so that it
1430
- * appears centered to the reference element.
1431
- * @see https://floating-ui.com/docs/arrow
1432
- */
1433
- const arrow = arrow$1;
1434
-
1435
- /**
1436
- * Computes the `x` and `y` coordinates that will place the floating element
1437
- * next to a given reference element.
1438
- */
1439
- const computePosition = (reference, floating, options) => {
1440
- // This caches the expensive `getClippingElementAncestors` function so that
1441
- // multiple lifecycle resets re-use the same result. It only lives for a
1442
- // single call. If other functions become expensive, we can add them as well.
1443
- const cache = new Map();
1444
- const mergedOptions = {
1445
- platform,
1446
- ...options
1447
- };
1448
- const platformWithCache = {
1449
- ...mergedOptions.platform,
1450
- _c: cache
1451
- };
1452
- return computePosition$1(reference, floating, {
1453
- ...mergedOptions,
1454
- platform: platformWithCache
1455
- });
1456
- };
1457
-
1458
- const appendToMap = (map, propName, value) => {
1459
- const items = map.get(propName);
1460
- if (!items) {
1461
- map.set(propName, [value]);
1462
- }
1463
- else if (!items.includes(value)) {
1464
- items.push(value);
1465
- }
1466
- };
1467
- const debounce = (fn, ms) => {
1468
- let timeoutId;
1469
- return (...args) => {
1470
- if (timeoutId) {
1471
- clearTimeout(timeoutId);
1472
- }
1473
- timeoutId = setTimeout(() => {
1474
- timeoutId = 0;
1475
- fn(...args);
1476
- }, ms);
1477
- };
1478
- };
1479
-
1480
- /**
1481
- * Check if a possible element isConnected.
1482
- * The property might not be there, so we check for it.
1483
- *
1484
- * We want it to return true if isConnected is not a property,
1485
- * otherwise we would remove these elements and would not update.
1486
- *
1487
- * Better leak in Edge than to be useless.
1488
- */
1489
- const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
1490
- const cleanupElements = debounce((map) => {
1491
- for (let key of map.keys()) {
1492
- map.set(key, map.get(key).filter(isConnected));
1493
- }
1494
- }, 2000);
1495
- const stencilSubscription = () => {
1496
- if (typeof index.getRenderingRef !== 'function') {
1497
- // If we are not in a stencil project, we do nothing.
1498
- // This function is not really exported by @stencil/core.
1499
- return {};
1500
- }
1501
- const elmsToUpdate = new Map();
1502
- return {
1503
- dispose: () => elmsToUpdate.clear(),
1504
- get: (propName) => {
1505
- const elm = index.getRenderingRef();
1506
- if (elm) {
1507
- appendToMap(elmsToUpdate, propName, elm);
1508
- }
1509
- },
1510
- set: (propName) => {
1511
- const elements = elmsToUpdate.get(propName);
1512
- if (elements) {
1513
- elmsToUpdate.set(propName, elements.filter(index.forceUpdate));
1514
- }
1515
- cleanupElements(elmsToUpdate);
1516
- },
1517
- reset: () => {
1518
- elmsToUpdate.forEach((elms) => elms.forEach(index.forceUpdate));
1519
- cleanupElements(elmsToUpdate);
1520
- },
1521
- };
1522
- };
1523
-
1524
- const unwrap = (val) => (typeof val === 'function' ? val() : val);
1525
- const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
1526
- const unwrappedState = unwrap(defaultState);
1527
- let states = new Map(Object.entries(unwrappedState !== null && unwrappedState !== void 0 ? unwrappedState : {}));
1528
- const handlers = {
1529
- dispose: [],
1530
- get: [],
1531
- set: [],
1532
- reset: [],
1533
- };
1534
- const reset = () => {
1535
- var _a;
1536
- // When resetting the state, the default state may be a function - unwrap it to invoke it.
1537
- // otherwise, the state won't be properly reset
1538
- states = new Map(Object.entries((_a = unwrap(defaultState)) !== null && _a !== void 0 ? _a : {}));
1539
- handlers.reset.forEach((cb) => cb());
1540
- };
1541
- const dispose = () => {
1542
- // Call first dispose as resetting the state would
1543
- // cause less updates ;)
1544
- handlers.dispose.forEach((cb) => cb());
1545
- reset();
1546
- };
1547
- const get = (propName) => {
1548
- handlers.get.forEach((cb) => cb(propName));
1549
- return states.get(propName);
1550
- };
1551
- const set = (propName, value) => {
1552
- const oldValue = states.get(propName);
1553
- if (shouldUpdate(value, oldValue, propName)) {
1554
- states.set(propName, value);
1555
- handlers.set.forEach((cb) => cb(propName, value, oldValue));
1556
- }
1557
- };
1558
- const state = (typeof Proxy === 'undefined'
1559
- ? {}
1560
- : new Proxy(unwrappedState, {
1561
- get(_, propName) {
1562
- return get(propName);
1563
- },
1564
- ownKeys(_) {
1565
- return Array.from(states.keys());
1566
- },
1567
- getOwnPropertyDescriptor() {
1568
- return {
1569
- enumerable: true,
1570
- configurable: true,
1571
- };
1572
- },
1573
- has(_, propName) {
1574
- return states.has(propName);
1575
- },
1576
- set(_, propName, value) {
1577
- set(propName, value);
1578
- return true;
1579
- },
1580
- }));
1581
- const on = (eventName, callback) => {
1582
- handlers[eventName].push(callback);
1583
- return () => {
1584
- removeFromArray(handlers[eventName], callback);
1585
- };
1586
- };
1587
- const onChange = (propName, cb) => {
1588
- const unSet = on('set', (key, newValue) => {
1589
- if (key === propName) {
1590
- cb(newValue);
1591
- }
1592
- });
1593
- // We need to unwrap the defaultState because it might be a function.
1594
- // Otherwise we might not be sending the right reset value.
1595
- const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));
1596
- return () => {
1597
- unSet();
1598
- unReset();
1599
- };
1600
- };
1601
- const use = (...subscriptions) => {
1602
- const unsubs = subscriptions.reduce((unsubs, subscription) => {
1603
- if (subscription.set) {
1604
- unsubs.push(on('set', subscription.set));
1605
- }
1606
- if (subscription.get) {
1607
- unsubs.push(on('get', subscription.get));
1608
- }
1609
- if (subscription.reset) {
1610
- unsubs.push(on('reset', subscription.reset));
1611
- }
1612
- if (subscription.dispose) {
1613
- unsubs.push(on('dispose', subscription.dispose));
1614
- }
1615
- return unsubs;
1616
- }, []);
1617
- return () => unsubs.forEach((unsub) => unsub());
1618
- };
1619
- const forceUpdate = (key) => {
1620
- const oldValue = states.get(key);
1621
- handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
1622
- };
1623
- return {
1624
- state,
1625
- get,
1626
- set,
1627
- on,
1628
- onChange,
1629
- use,
1630
- dispose,
1631
- reset,
1632
- forceUpdate,
1633
- };
1634
- };
1635
- const removeFromArray = (array, item) => {
1636
- const index = array.indexOf(item);
1637
- if (index >= 0) {
1638
- array[index] = array[array.length - 1];
1639
- array.length--;
1640
- }
1641
- };
1642
-
1643
- const createStore = (defaultState, shouldUpdate) => {
1644
- const map = createObservableMap(defaultState, shouldUpdate);
1645
- map.use(stencilSubscription());
1646
- return map;
1647
- };
1648
-
1649
- const nvPopoverCss = "nv-popover{display:inline-block;position:relative}nv-popover:has([fluid]:not([fluid=false])){display:block}nv-popover>[data-scope=popover]{width:max-content;background-color:var(--components-popover-background);border-color:var(--components-popover-border);font-weight:var(--font-weight-medium-emphasis);border-width:1px;border-style:solid;border-radius:var(--popover-radius);padding:var(--popover-padding-y) var(--popover-padding-x);position:absolute;top:0;left:0;z-index:1;box-shadow:var(--popover-shadow-1-x) var(--popover-shadow-1-y) var(--popover-shadow-1-blur) -2px var(--popover-shadow-1-opacity), var(--popover-shadow-2-x) var(--popover-shadow-2-y) var(--popover-shadow-2-blur) var(--shadow-spread-lg-2) var(--popover-shadow-2-opacity)}nv-popover>[data-scope=popover][hidden]:not([hidden=false]){display:none}nv-popover>[data-scope=popover]>[data-scope=arrow]{background-color:var(--components-popover-background);position:absolute;border-color:var(--components-popover-border);border-width:1px;border-style:solid;border-bottom-color:transparent;border-right-color:transparent;width:8px;height:8px;transform:rotate(45deg);border-radius:1px}nv-popover>[data-scope=popover]>[slot=content]{position:relative;z-index:1}nv-popover>slot-fb{display:none}";
1650
- const NvPopoverStyle0 = nvPopoverCss;
1651
-
1652
- const { state } = createStore({
1653
- groups: new Map(),
1654
- });
1655
- const NvPopover = class {
1656
- constructor(hostRef) {
1657
- index.registerInstance(this, hostRef);
1658
- this.openChanged = index.createEvent(this, "openChanged");
1659
- this.eventsAttached = false;
1660
- /**
1661
- * Use this prop to toggle the visibility of the popover. Set to true to show
1662
- * the popover and false to hide it.
1663
- */
1664
- this.open = false;
1665
- /**
1666
- * Sets the interaction mode for triggering the popover. Options include:
1667
- * - `hover`: The popover is shown on trigger hover.
1668
- * - `click`: The popover toggles on trigger click.
1669
- * - `controlled`: The visibility is managed manually through methods or the
1670
- * open prop.
1671
- */
1672
- this.triggerMode = 'click';
1673
- /**
1674
- * Defines where the popover appears relative to the trigger.
1675
- */
1676
- this.placement = 'bottom';
1677
- /**
1678
- * Adjust the gap between the popover and its trigger element by setting how
1679
- * many pixels they should be apart.
1680
- */
1681
- this.offset = 6;
1682
- /**
1683
- * Use this to decide if the popover should include a small arrow pointing to
1684
- * the trigger element, making the connection between them more clear.
1685
- */
1686
- this.hasArrow = false;
1687
- /**
1688
- * Disables the automatic flipping of the popover when the trigger element is
1689
- * out of the viewport. The popover will flip automatically by default.
1690
- */
1691
- this.disableFlip = false;
1692
- /**
1693
- * Sets how many pixels the popover should stay from the edge of the viewport.
1694
- */
1695
- this.shiftPadding = 16;
1696
- /**
1697
- * Use this to set a delay before the popover appears on hover. If the mouse
1698
- * leaves before this time, the popover won't show. This only works when the
1699
- * trigger mode is set to `hover`.
1700
- */
1701
- this.enterDelay = 0;
1702
- /**
1703
- * Use this to set the popover to be nested inside another popover. This will
1704
- * prevent the parent popover from closing when the child popover is opened.
1705
- */
1706
- this.nested = false;
1707
- /**
1708
- * Handles the click outside event.
1709
- * @param {MouseEvent | TouchEvent} event - The event object.
1710
- */
1711
- this.handleClickOutside = (event) => {
1712
- var _a;
1713
- // This popover should close when the user clicks outside of it.
1714
- if (this.el.contains(event.target))
1715
- return;
1716
- if ((_a = this.triggerElement) === null || _a === void 0 ? void 0 : _a.contains(event.target))
1717
- return;
1718
- this.hide();
1719
- };
1720
- this.clickEvents = [['click', this.toggle]];
1721
- this.outsideClickEvents = [
1722
- ['click', this.handleClickOutside],
1723
- ['touchstart', this.handleClickOutside],
1724
- ];
1725
- this.hoverEvents = [
1726
- [
1727
- 'focus',
1728
- () => {
1729
- clearTimeout(this.hideTimeout);
1730
- this.showTimeout = setTimeout(() => this.show(), this.enterDelay);
1731
- },
1732
- ],
1733
- [
1734
- 'blur',
1735
- () => {
1736
- clearTimeout(this.showTimeout);
1737
- this.hideTimeout = setTimeout(() => this.hide(), 50);
1738
- },
1739
- ],
1740
- [
1741
- 'mouseenter',
1742
- () => {
1743
- clearTimeout(this.hideTimeout);
1744
- this.showTimeout = setTimeout(() => this.show(), this.enterDelay);
1745
- },
1746
- ],
1747
- [
1748
- 'mouseleave',
1749
- () => {
1750
- clearTimeout(this.showTimeout);
1751
- this.hideTimeout = setTimeout(() => this.hide(), 100);
1752
- },
1753
- ],
1754
- ];
1755
- this.closeEvents = [
1756
- [
1757
- 'keydown',
1758
- (e) => {
1759
- if (e.key === 'Escape') {
1760
- this.hide();
1761
- }
1762
- },
1763
- ],
1764
- ];
1765
- //#endregion EVENTS
1766
- /****************************************************************************/
1767
- //#region WATCHERS
1768
- this.isAnimating = false;
1769
- }
1770
- //#endregion PROPERTIES
1771
- /****************************************************************************/
1772
- //#region METHODS
1773
- /**
1774
- * Call this method to show the popover, making it visible on the screen.
1775
- */
1776
- async show() {
1777
- this.open = true;
1778
- }
1779
- /**
1780
- * Use this method to hide the popover, making it disappear from view.
1781
- */
1782
- async hide() {
1783
- this.open = false;
1784
- }
1785
- /**
1786
- * Call this method to toggle between showing and hiding the popover, based on
1787
- * its current state.
1788
- */
1789
- async toggle() {
1790
- this.open = !this.open;
1791
- }
1792
- /**
1793
- * Attaches event listeners to the trigger element, and makes sure this only
1794
- * happens once.
1795
- */
1796
- attachEventListeners() {
1797
- if (this.triggerElement && !this.eventsAttached) {
1798
- events_utilsFe1d907f.addEventListeners(this.closeEvents, document, this);
1799
- if (this.triggerMode === 'click') {
1800
- events_utilsFe1d907f.addEventListeners(this.clickEvents, this.triggerElement, this);
1801
- // Add document click and touch listeners
1802
- events_utilsFe1d907f.addEventListeners(this.outsideClickEvents, document, this);
1803
- }
1804
- if (this.triggerMode === 'hover') {
1805
- events_utilsFe1d907f.addEventListeners(this.hoverEvents, this.triggerElement, this);
1806
- }
1807
- this.eventsAttached = true;
1808
- }
1809
- }
1810
- /**
1811
- * Calculates the position of the popover relative to the trigger.
1812
- * @docs https://floating-ui.com/docs/computePosition
1813
- */
1814
- positionPopover() {
1815
- if (!this.triggerElement)
1816
- return;
1817
- computePosition(this.triggerElement, this.popoverElement, {
1818
- placement: this.placement,
1819
- middleware: [
1820
- offset(this.offset),
1821
- !this.disableFlip &&
1822
- flip({
1823
- fallbackStrategy: 'bestFit',
1824
- crossAxis: true,
1825
- fallbackPlacements: ['bottom'],
1826
- }),
1827
- shift({ padding: this.shiftPadding }),
1828
- this.hasArrow && arrow({ element: this.arrowElement }),
1829
- ],
1830
- }).then(({ x, y, placement, middlewareData }) => {
1831
- Object.assign(this.popoverElement.style, {
1832
- left: `${x}px`,
1833
- top: `${y}px`,
1834
- });
1835
- if (this.hasArrow) {
1836
- const staticSide = {
1837
- top: 'bottom',
1838
- right: 'left',
1839
- bottom: 'top',
1840
- left: 'right',
1841
- }[placement.split('-')[0]];
1842
- const transform = {
1843
- top: 'rotate(225deg)',
1844
- right: 'rotate(315deg)',
1845
- bottom: 'rotate(45deg)',
1846
- left: 'rotate(135deg)',
1847
- }[placement.split('-')[0]];
1848
- const { x: arrowX, y: arrowY } = middlewareData.arrow;
1849
- Object.assign(this.arrowElement.style, {
1850
- left: arrowX != null ? `${arrowX}px` : '',
1851
- top: arrowY != null ? `${arrowY}px` : '',
1852
- right: '',
1853
- bottom: '',
1854
- transform,
1855
- [staticSide]: '-4px',
1856
- });
1857
- }
1858
- });
1859
- }
1860
- handleOpenChanged(event) {
1861
- var _a;
1862
- if (this.triggerMode === 'controlled')
1863
- return;
1864
- if (this.nested)
1865
- return;
1866
- if ((_a = event.target) === null || _a === void 0 ? void 0 : _a.hasAttribute('nested'))
1867
- return;
1868
- // This popover should close when another one is opened.
1869
- if (event.target !== this.el && event.detail === true)
1870
- this.hide();
1871
- }
1872
- async handleOpenChange(open) {
1873
- // Prevent multiple animations from running at the same time.
1874
- while (this.isAnimating) {
1875
- await new Promise(resolve => setTimeout(resolve, 50));
1876
- }
1877
- this.isAnimating = true;
1878
- const group = state.groups.get(this.groupName);
1879
- const isOtherMemberOpen = group && group.openedBy !== this.el;
1880
- const isThisMemberOpen = group && group.openedBy === this.el;
1881
- if (open)
1882
- this.popoverElement.style.removeProperty('display');
1883
- if (isThisMemberOpen && !open)
1884
- state.groups.delete(this.groupName);
1885
- if (this.groupName && open)
1886
- state.groups.set(this.groupName, { openedBy: this.el });
1887
- const { growIn } = useGrow(this.popoverElement, {
1888
- duration: isOtherMemberOpen ? 0 : 100,
1889
- amount: 0.85,
1890
- });
1891
- const { fadeOut } = fade_animation2a077983.useFade(this.popoverElement, {
1892
- duration: isOtherMemberOpen ? 0 : 100,
1893
- });
1894
- if (open === true) {
1895
- this.popoverElement.removeAttribute('hidden');
1896
- this.positionPopover();
1897
- await growIn();
1898
- }
1899
- if (open === false) {
1900
- await fadeOut();
1901
- this.popoverElement.setAttribute('hidden', '');
1902
- }
1903
- this.isAnimating = false;
1904
- this.openChanged.emit(open);
1905
- }
1906
- //#endregion WATCHERS
1907
- /****************************************************************************/
1908
- //#region LIFECYCLE
1909
- componentWillLoad() {
1910
- if (!this.triggerElement)
1911
- this.triggerElement = Array.from(this.el.children).find(child => child.getAttribute('slot') === 'trigger');
1912
- }
1913
- componentWillUpdate() {
1914
- this.attachEventListeners();
1915
- }
1916
- componentDidLoad() {
1917
- // Initial inline style setup
1918
- if (!this.open) {
1919
- const { setGrowOut } = useGrow(this.popoverElement);
1920
- setGrowOut();
1921
- }
1922
- else {
1923
- const { setFadeIn } = fade_animation2a077983.useFade(this.popoverElement);
1924
- setFadeIn();
1925
- this.popoverElement.removeAttribute('hidden');
1926
- }
1927
- this.positionPopover();
1928
- this.attachEventListeners();
1929
- }
1930
- disconnectedCallback() {
1931
- events_utilsFe1d907f.removeEventListeners(this.closeEvents, document, this);
1932
- if (this.triggerMode === 'click') {
1933
- events_utilsFe1d907f.removeEventListeners(this.clickEvents, this.triggerElement, this);
1934
- // Remove document listeners
1935
- events_utilsFe1d907f.removeEventListeners(this.outsideClickEvents, document, this);
1936
- }
1937
- if (this.triggerMode === 'hover')
1938
- events_utilsFe1d907f.removeEventListeners(this.hoverEvents, this.triggerElement, this);
1939
- // Reset flag so events can be reattached if component is reconnected
1940
- this.eventsAttached = false;
1941
- // Clean up any pending timeouts
1942
- if (this.hideTimeout)
1943
- clearTimeout(this.hideTimeout);
1944
- if (this.showTimeout)
1945
- clearTimeout(this.showTimeout);
1946
- }
1947
- //#endregion LIFECYCLE
1948
- /****************************************************************************/
1949
- //#region RENDER
1950
- render() {
1951
- return (index.h(index.Host, { key: '72f8e8145e8379d3384187e830d53c0ab6f85f77' }, index.h("slot", { key: '27a89a1f7a1d0d671bcd7734e46a799591ce5f2b', name: "trigger" }), index.h("div", { key: 'ccdfc3b883475b2d1ee0469247ef83d2519955a4', "data-scope": "popover", hidden: true, ref: el => (this.popoverElement = el) }, this.hasArrow && (index.h("div", { key: 'df9370ccdc02285b41b05eed226345f23eadbea5', "data-scope": "arrow", ref: el => (this.arrowElement = el) })), index.h("slot", { key: 'd737a2294c6e19b0f78532fb6389baa6ecd4c8e4', name: "content" }))));
1952
- }
1953
- get el() { return index.getElement(this); }
1954
- static get watchers() { return {
1955
- "open": ["handleOpenChange"]
1956
- }; }
1957
- };
1958
- NvPopover.style = NvPopoverStyle0;
1959
-
1960
- exports.nv_popover = NvPopover;