@adyen/bento-vue2 1.102.0 → 1.103.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (399) hide show
  1. package/dist/@types/index.d.ts +20 -3
  2. package/dist/accordion.js +1 -1
  3. package/dist/action-bar.js +1 -1
  4. package/dist/ai-tag.js +1 -1
  5. package/dist/alert.js +1 -1
  6. package/dist/anchor-scroller.js +1 -1
  7. package/dist/assets/accordion-item.css +1 -1
  8. package/dist/assets/action-bar.css +1 -1
  9. package/dist/assets/ai-button.css +1 -1
  10. package/dist/assets/anchor-scroller.css +1 -1
  11. package/dist/assets/base-modal.css +1 -1
  12. package/dist/assets/button-actions.css +1 -1
  13. package/dist/assets/button.css +1 -1
  14. package/dist/assets/card.css +1 -1
  15. package/dist/assets/checkbox-input.css +1 -1
  16. package/dist/assets/data-grid.css +1 -1
  17. package/dist/assets/dialog-page.css +1 -1
  18. package/dist/assets/dropdown.css +1 -1
  19. package/dist/assets/empty-state.css +1 -1
  20. package/dist/assets/file-uploader.css +1 -1
  21. package/dist/assets/filter-bar.css +1 -1
  22. package/dist/assets/index.css +1 -1
  23. package/dist/assets/input-field-password.css +1 -1
  24. package/dist/assets/inspector.css +1 -1
  25. package/dist/assets/modal-fullscreen.css +1 -1
  26. package/dist/assets/navigation-menu-group.css +1 -1
  27. package/dist/assets/pagination.css +1 -1
  28. package/dist/assets/radio-input.css +1 -1
  29. package/dist/assets/secondary-nav.css +1 -1
  30. package/dist/assets/selection-card-group.css +1 -1
  31. package/dist/assets/sidepanel.css +1 -1
  32. package/dist/assets/table-of-contents.css +1 -1
  33. package/dist/assets/typography.css +1 -1
  34. package/dist/avatar.js +1 -1
  35. package/dist/button.js +3 -3
  36. package/dist/card.js +1 -1
  37. package/dist/checkbox.js +2 -2
  38. package/dist/chip.js +1 -1
  39. package/dist/chunks/{accordion-item.C0va5Mbv.js → accordion-item.CrVVFIHa.js} +16 -49
  40. package/dist/chunks/{accordion-item.C0va5Mbv.js.map → accordion-item.CrVVFIHa.js.map} +1 -1
  41. package/dist/chunks/{action-bar.-kzjjAuX.js → action-bar.BC1fWyHX.js} +18 -150
  42. package/dist/chunks/{action-bar.-kzjjAuX.js.map → action-bar.BC1fWyHX.js.map} +1 -1
  43. package/dist/chunks/{ai-button.ChLXOu7p.js → ai-button.CP6Bu7PB.js} +3 -3
  44. package/dist/chunks/{ai-button.ChLXOu7p.js.map → ai-button.CP6Bu7PB.js.map} +1 -1
  45. package/dist/chunks/{ai-tag.DhBjifex.js → ai-tag.wYWc7yOx.js} +16 -49
  46. package/dist/chunks/{ai-tag.DhBjifex.js.map → ai-tag.wYWc7yOx.js.map} +1 -1
  47. package/dist/chunks/{alert.CDP-LTh5.js → alert.Dj57zB88.js} +15 -81
  48. package/dist/chunks/{alert.CDP-LTh5.js.map → alert.Dj57zB88.js.map} +1 -1
  49. package/dist/chunks/anchor-scroller.Bhgy748g.js +120 -0
  50. package/dist/chunks/anchor-scroller.Bhgy748g.js.map +1 -0
  51. package/dist/chunks/{avatar.rwWPYJnt.js → avatar.D__jLgjI.js} +2 -2
  52. package/dist/chunks/{avatar.rwWPYJnt.js.map → avatar.D__jLgjI.js.map} +1 -1
  53. package/dist/chunks/{base-button.BPRPrO0p.js → base-button.D5C9VIYP.js} +20 -23
  54. package/dist/chunks/{base-button.BPRPrO0p.js.map → base-button.D5C9VIYP.js.map} +1 -1
  55. package/dist/chunks/{base-modal.BagJ8weI.js → base-modal.DlD_Lj4Y.js} +100 -141
  56. package/dist/chunks/{base-modal.BagJ8weI.js.map → base-modal.DlD_Lj4Y.js.map} +1 -1
  57. package/dist/chunks/button-actions-with-menu.CTgggEw2.js +77 -0
  58. package/dist/chunks/{button-actions-with-menu.DNYoFmV4.js.map → button-actions-with-menu.CTgggEw2.js.map} +1 -1
  59. package/dist/chunks/{button-actions.Dpbx0xf3.js → button-actions.CxX7lK7z.js} +362 -442
  60. package/dist/chunks/{button-actions.Dpbx0xf3.js.map → button-actions.CxX7lK7z.js.map} +1 -1
  61. package/dist/chunks/{button.CKS_V3p5.js → button.C4kKejsg.js} +34 -37
  62. package/dist/chunks/{button.CKS_V3p5.js.map → button.C4kKejsg.js.map} +1 -1
  63. package/dist/chunks/calendar.BoFWdxN7.js +1143 -0
  64. package/dist/chunks/{calendar.CvHJ3Geq.js.map → calendar.BoFWdxN7.js.map} +1 -1
  65. package/dist/chunks/{card.DqMECGcj.js → card.B70qRHOi.js} +34 -70
  66. package/dist/chunks/{card.DqMECGcj.js.map → card.B70qRHOi.js.map} +1 -1
  67. package/dist/chunks/{checkbox-group.YnXz1Hl2.js → checkbox-group.D1zzKsdi.js} +6 -6
  68. package/dist/chunks/{checkbox-group.YnXz1Hl2.js.map → checkbox-group.D1zzKsdi.js.map} +1 -1
  69. package/dist/chunks/{checkbox-input.08E9BNeF.js → checkbox-input.kfxcyjfd.js} +28 -31
  70. package/dist/chunks/{checkbox-input.08E9BNeF.js.map → checkbox-input.kfxcyjfd.js.map} +1 -1
  71. package/dist/chunks/{checkbox.BUc2332d.js → checkbox.Ca0mu2lE.js} +58 -91
  72. package/dist/chunks/{checkbox.BUc2332d.js.map → checkbox.Ca0mu2lE.js.map} +1 -1
  73. package/dist/chunks/{chip.DHmRHsL2.js → chip.wgEnbEPw.js} +16 -38
  74. package/dist/chunks/{chip.DHmRHsL2.js.map → chip.wgEnbEPw.js.map} +1 -1
  75. package/dist/chunks/click-outside.B0whuTUU.js +20 -0
  76. package/dist/chunks/{click-outside.BG01Sm0A.js.map → click-outside.B0whuTUU.js.map} +1 -1
  77. package/dist/chunks/{code-snippet.Cha3wHUL.js → code-snippet.BglbQWRB.js} +19 -74
  78. package/dist/chunks/{code-snippet.Cha3wHUL.js.map → code-snippet.BglbQWRB.js.map} +1 -1
  79. package/dist/chunks/{codemirror.D2BAltnu.js → codemirror.Bzus_EPG.js} +15 -15
  80. package/dist/chunks/{codemirror.D2BAltnu.js.map → codemirror.Bzus_EPG.js.map} +1 -1
  81. package/dist/chunks/constructNow.DyOJDyZZ.js +8 -0
  82. package/dist/chunks/{constructNow.CK0ryPil.js.map → constructNow.DyOJDyZZ.js.map} +1 -1
  83. package/dist/chunks/{controls-group.BomXFNvi.js → controls-group.DPLAJjbv.js} +3 -3
  84. package/dist/chunks/{controls-group.BomXFNvi.js.map → controls-group.DPLAJjbv.js.map} +1 -1
  85. package/dist/chunks/{copy.BlyhTDSU.js → copy.CsKQJlen.js} +16 -60
  86. package/dist/chunks/{copy.BlyhTDSU.js.map → copy.CsKQJlen.js.map} +1 -1
  87. package/dist/chunks/{country.DySY9sbA.js → country.D8ncVjcm.js} +5 -5
  88. package/dist/chunks/{country.DySY9sbA.js.map → country.D8ncVjcm.js.map} +1 -1
  89. package/dist/chunks/country.types.BUW49nQx.js +27 -0
  90. package/dist/chunks/country.types.BUW49nQx.js.map +1 -0
  91. package/dist/chunks/currency.POwX-Trj.js +124 -0
  92. package/dist/chunks/{currency.Dvy9Qjjf.js.map → currency.POwX-Trj.js.map} +1 -1
  93. package/dist/chunks/dashboard-section.Bmu65OHg.js +98 -0
  94. package/dist/chunks/{dashboard-section.D2yqhERq.js.map → dashboard-section.Bmu65OHg.js.map} +1 -1
  95. package/dist/chunks/{dashed-underline.ByPcIHNe.js → dashed-underline.CbzCYKrk.js} +11 -12
  96. package/dist/chunks/{dashed-underline.ByPcIHNe.js.map → dashed-underline.CbzCYKrk.js.map} +1 -1
  97. package/dist/chunks/data-grid-template.BvBHJ0sH.js +102 -0
  98. package/dist/chunks/{data-grid-template.Ifn423Ot.js.map → data-grid-template.BvBHJ0sH.js.map} +1 -1
  99. package/dist/chunks/data-grid.DPh8BSnM.js +3266 -0
  100. package/dist/chunks/{data-grid.BDXQ_kKQ.js.map → data-grid.DPh8BSnM.js.map} +1 -1
  101. package/dist/chunks/date-picker.DutUBQbH.js +183 -0
  102. package/dist/chunks/{date-picker.CXZfCxwP.js.map → date-picker.DutUBQbH.js.map} +1 -1
  103. package/dist/chunks/date-range-picker.5bvgs49h.js +924 -0
  104. package/dist/chunks/{date-range-picker.BzVQsYk4.js.map → date-range-picker.5bvgs49h.js.map} +1 -1
  105. package/dist/chunks/date-time-picker.DUWWGlOX.js +127 -0
  106. package/dist/chunks/{date-time-picker.DaLATfJp.js.map → date-time-picker.DUWWGlOX.js.map} +1 -1
  107. package/dist/chunks/{date.C1HnIyOv.js → date.CPo8t1n9.js} +25 -25
  108. package/dist/chunks/{date.C1HnIyOv.js.map → date.CPo8t1n9.js.map} +1 -1
  109. package/dist/chunks/{de.pvjpUJ1o.js → de.ctR_lBqr.js} +18 -18
  110. package/dist/chunks/{de.pvjpUJ1o.js.map → de.ctR_lBqr.js.map} +1 -1
  111. package/dist/chunks/{dialog-page.B_LwIWgK.js → dialog-page.CPorblJc.js} +16 -38
  112. package/dist/chunks/{dialog-page.B_LwIWgK.js.map → dialog-page.CPorblJc.js.map} +1 -1
  113. package/dist/chunks/differenceInMonths.yz4Dfe-b.js +44 -0
  114. package/dist/chunks/{differenceInMonths.CpwVtHZX.js.map → differenceInMonths.yz4Dfe-b.js.map} +1 -1
  115. package/dist/chunks/{directive.BBWhsNtO.js → directive.D1-d-C2K.js} +2 -2
  116. package/dist/chunks/{directive.BBWhsNtO.js.map → directive.D1-d-C2K.js.map} +1 -1
  117. package/dist/chunks/{draggable-handle.kBP4prVO.js → draggable-handle.g2BFN3G1.js} +18 -114
  118. package/dist/chunks/{draggable-handle.kBP4prVO.js.map → draggable-handle.g2BFN3G1.js.map} +1 -1
  119. package/dist/chunks/draggable.iIsQLiOa.js +168 -0
  120. package/dist/chunks/{draggable.rTa1jcHI.js.map → draggable.iIsQLiOa.js.map} +1 -1
  121. package/dist/chunks/{drawer.DVJxDGw3.js → drawer.CnxX1zZ6.js} +14 -36
  122. package/dist/chunks/{drawer.DVJxDGw3.js.map → drawer.CnxX1zZ6.js.map} +1 -1
  123. package/dist/chunks/{dropdown-tag.CaLA2NLd.js → dropdown-tag.BFnfCah8.js} +77 -81
  124. package/dist/chunks/{dropdown-tag.CaLA2NLd.js.map → dropdown-tag.BFnfCah8.js.map} +1 -1
  125. package/dist/chunks/{dropdown.DIqgVVXB.js → dropdown.Ce2P9MZ-.js} +1131 -1466
  126. package/dist/chunks/{dropdown.DIqgVVXB.js.map → dropdown.Ce2P9MZ-.js.map} +1 -1
  127. package/dist/chunks/empty-state.fziM-yAC.js +102 -0
  128. package/dist/chunks/empty-state.fziM-yAC.js.map +1 -0
  129. package/dist/chunks/{en-GB.-Q7Oq-nY.js → en-GB.BsQNm5GT.js} +2 -2
  130. package/dist/chunks/{en-GB.-Q7Oq-nY.js.map → en-GB.BsQNm5GT.js.map} +1 -1
  131. package/dist/chunks/{en-US.BK5uiAND.js → en-US.BR6y7foR.js} +30 -30
  132. package/dist/chunks/{en-US.BK5uiAND.js.map → en-US.BR6y7foR.js.map} +1 -1
  133. package/dist/chunks/{error-message.Hqp_VvD3.js → error-message.BEHBfjmn.js} +14 -36
  134. package/dist/chunks/{error-message.Hqp_VvD3.js.map → error-message.BEHBfjmn.js.map} +1 -1
  135. package/dist/chunks/{es.2H4LvTyV.js → es.DxqH-QhP.js} +14 -14
  136. package/dist/chunks/{es.2H4LvTyV.js.map → es.DxqH-QhP.js.map} +1 -1
  137. package/dist/chunks/{field-label.DjJ7wdFi.js → field-label.CgdTst2l.js} +15 -37
  138. package/dist/chunks/{field-label.DjJ7wdFi.js.map → field-label.CgdTst2l.js.map} +1 -1
  139. package/dist/chunks/{file-uploader.2rIfQ2jb.js → file-uploader.BG89SLkG.js} +317 -630
  140. package/dist/chunks/{file-uploader.2rIfQ2jb.js.map → file-uploader.BG89SLkG.js.map} +1 -1
  141. package/dist/chunks/filter-bar.BMO8wTzb.js +3087 -0
  142. package/dist/chunks/{filter-bar.qlViDZPY.js.map → filter-bar.BMO8wTzb.js.map} +1 -1
  143. package/dist/chunks/fixed-scroller.oObE3f7m.js +117 -0
  144. package/dist/chunks/{fixed-scroller.04EUUgD_.js.map → fixed-scroller.oObE3f7m.js.map} +1 -1
  145. package/dist/chunks/{focus-trap.oRKjDFzf.js → focus-trap.l-wwtCHi.js} +69 -85
  146. package/dist/chunks/{focus-trap.oRKjDFzf.js.map → focus-trap.l-wwtCHi.js.map} +1 -1
  147. package/dist/chunks/{footer-actions.DXyJtVip.js → footer-actions.Dn9KYoqB.js} +4 -4
  148. package/dist/chunks/{footer-actions.DXyJtVip.js.map → footer-actions.Dn9KYoqB.js.map} +1 -1
  149. package/dist/chunks/{form-layout-group.DnjoLZZM.js → form-layout-group.C_0b8u-g.js} +2 -2
  150. package/dist/chunks/{form-layout-group.DnjoLZZM.js.map → form-layout-group.C_0b8u-g.js.map} +1 -1
  151. package/dist/chunks/{form-layout-title.Bt5bP9r3.js → form-layout-title.YhZCVtoc.js} +15 -37
  152. package/dist/chunks/{form-layout-title.Bt5bP9r3.js.map → form-layout-title.YhZCVtoc.js.map} +1 -1
  153. package/dist/chunks/{fr.Cu0IIfBP.js → fr.DJtn8ron.js} +16 -16
  154. package/dist/chunks/{fr.Cu0IIfBP.js.map → fr.DJtn8ron.js.map} +1 -1
  155. package/dist/chunks/{generate-uid.NJ8tVoha.js → generate-uid.DBWe4g6T.js} +15 -16
  156. package/dist/chunks/{generate-uid.NJ8tVoha.js.map → generate-uid.DBWe4g6T.js.map} +1 -1
  157. package/dist/chunks/get-slot-text.DM_NdrUC.js +6 -0
  158. package/dist/chunks/{get-slot-text.Bjb9dTSV.js.map → get-slot-text.DM_NdrUC.js.map} +1 -1
  159. package/dist/chunks/{grid-layout.1aIiz2N_.js → grid-layout.BeCrjPgT.js} +16 -17
  160. package/dist/chunks/{grid-layout.1aIiz2N_.js.map → grid-layout.BeCrjPgT.js.map} +1 -1
  161. package/dist/chunks/header-meta.mDdMmFUA.js +206 -0
  162. package/dist/chunks/{header-meta.CCQVPDU8.js.map → header-meta.mDdMmFUA.js.map} +1 -1
  163. package/dist/chunks/{header-with-views.CEU6WrV9.js → header-with-views.Dp6SyiPu.js} +791 -1270
  164. package/dist/chunks/{header-with-views.CEU6WrV9.js.map → header-with-views.Dp6SyiPu.js.map} +1 -1
  165. package/dist/chunks/{header.BoNOTATn.js → header.DUAxdw_d.js} +4 -4
  166. package/dist/chunks/{header.BoNOTATn.js.map → header.DUAxdw_d.js.map} +1 -1
  167. package/dist/chunks/{index.C7m7gI5w.js → index.CL3TXc0a.js} +154 -160
  168. package/dist/chunks/{index.C7m7gI5w.js.map → index.CL3TXc0a.js.map} +1 -1
  169. package/dist/chunks/{index.B6WW_F-J.js → index.CPOlyau9.js} +5 -5
  170. package/dist/chunks/index.CPOlyau9.js.map +1 -0
  171. package/dist/chunks/{info-icon.BnLYUTzI.js → info-icon.BRnbXunj.js} +3 -3
  172. package/dist/chunks/{info-icon.BnLYUTzI.js.map → info-icon.BRnbXunj.js.map} +1 -1
  173. package/dist/chunks/input-field-password.C9_o6Kg2.js +230 -0
  174. package/dist/chunks/input-field-password.C9_o6Kg2.js.map +1 -0
  175. package/dist/chunks/{input-field-phone-number.CPjH0EVF.js → input-field-phone-number.zRjd8HPi.js} +724 -756
  176. package/dist/chunks/{input-field-phone-number.CPjH0EVF.js.map → input-field-phone-number.zRjd8HPi.js.map} +1 -1
  177. package/dist/chunks/{input-field.BEV5lhwO.js → input-field.BTt1ORWU.js} +22 -58
  178. package/dist/chunks/{input-field.BEV5lhwO.js.map → input-field.BTt1ORWU.js.map} +1 -1
  179. package/dist/chunks/{input-time.En4O4DRD.js → input-time.BfJIDgaH.js} +15 -48
  180. package/dist/chunks/{input-time.En4O4DRD.js.map → input-time.BfJIDgaH.js.map} +1 -1
  181. package/dist/chunks/{inspector-page.OKPf0I4k.js → inspector-page.i8bVjo9U.js} +4 -4
  182. package/dist/chunks/{inspector-page.OKPf0I4k.js.map → inspector-page.i8bVjo9U.js.map} +1 -1
  183. package/dist/chunks/{inspector.DoQPHzCc.js → inspector.Aet0jTC2.js} +39 -106
  184. package/dist/chunks/{inspector.DoQPHzCc.js.map → inspector.Aet0jTC2.js.map} +1 -1
  185. package/dist/chunks/isSameWeek.CieN9XgL.js +14 -0
  186. package/dist/chunks/{isSameWeek.TrpUOIn5.js.map → isSameWeek.CieN9XgL.js.map} +1 -1
  187. package/dist/chunks/{it.B65snrJA.js → it.keS7oN5l.js} +8 -8
  188. package/dist/chunks/{it.B65snrJA.js.map → it.keS7oN5l.js.map} +1 -1
  189. package/dist/chunks/{ja.xGVfFSzL.js → ja.cLwacUE6.js} +27 -27
  190. package/dist/chunks/{ja.xGVfFSzL.js.map → ja.cLwacUE6.js.map} +1 -1
  191. package/dist/chunks/{layout-row.CPFK9Bg7.js → layout-row.HslYnPgn.js} +34 -35
  192. package/dist/chunks/{layout-row.CPFK9Bg7.js.map → layout-row.HslYnPgn.js.map} +1 -1
  193. package/dist/chunks/{link.Cejg8jB6.js → link.CscSbaXa.js} +15 -37
  194. package/dist/chunks/{link.Cejg8jB6.js.map → link.CscSbaXa.js.map} +1 -1
  195. package/dist/chunks/list-item.Cngxa9qN.js +166 -0
  196. package/dist/chunks/{list-item.BiJMHR7b.js.map → list-item.Cngxa9qN.js.map} +1 -1
  197. package/dist/chunks/{listbox-option-tag.DnvECZQC.js → listbox-option-tag.BaoiH-Ku.js} +3 -3
  198. package/dist/chunks/{listbox-option-tag.DnvECZQC.js.map → listbox-option-tag.BaoiH-Ku.js.map} +1 -1
  199. package/dist/chunks/{modal-fullscreen.Bn8MzG6Z.js → modal-fullscreen.Cg1Q6ERf.js} +64 -93
  200. package/dist/chunks/{modal-fullscreen.Bn8MzG6Z.js.map → modal-fullscreen.Cg1Q6ERf.js.map} +1 -1
  201. package/dist/chunks/{modal.CClQItuJ.js → modal.u-t1CvBr.js} +81 -105
  202. package/dist/chunks/{modal.CClQItuJ.js.map → modal.u-t1CvBr.js.map} +1 -1
  203. package/dist/chunks/{navigation-menu-group.p1-x06nS.js → navigation-menu-group.gNMP4tW4.js} +80 -129
  204. package/dist/chunks/{navigation-menu-group.p1-x06nS.js.map → navigation-menu-group.gNMP4tW4.js.map} +1 -1
  205. package/dist/chunks/{on-click-outside.Cy1eFULD.js → on-click-outside.BgIzQ2G1.js} +32 -33
  206. package/dist/chunks/{on-click-outside.Cy1eFULD.js.map → on-click-outside.BgIzQ2G1.js.map} +1 -1
  207. package/dist/chunks/{pagination.CZVdaeqE.js → pagination.D81XgMQ7.js} +73 -192
  208. package/dist/chunks/pagination.D81XgMQ7.js.map +1 -0
  209. package/dist/chunks/{payment-method.B3CkgsAY.js → payment-method.Clm5dEYh.js} +2 -2
  210. package/dist/chunks/{payment-method.B3CkgsAY.js.map → payment-method.Clm5dEYh.js.map} +1 -1
  211. package/dist/chunks/popover.types.H5Y0rC1r.js +6 -0
  212. package/dist/chunks/{popover.types.BfnJIpII.js.map → popover.types.H5Y0rC1r.js.map} +1 -1
  213. package/dist/chunks/{popper-container.Cb9wuFId.js → popper-container.D08eTt4B.js} +245 -252
  214. package/dist/chunks/{popper-container.Cb9wuFId.js.map → popper-container.D08eTt4B.js.map} +1 -1
  215. package/dist/chunks/{promo-banner.DZ0gerRx.js → promo-banner.BX47zMKh.js} +17 -39
  216. package/dist/chunks/{promo-banner.DZ0gerRx.js.map → promo-banner.BX47zMKh.js.map} +1 -1
  217. package/dist/chunks/{pt-BR.D9FuAQZm.js → pt-BR.ChPOra5s.js} +14 -14
  218. package/dist/chunks/{pt-BR.D9FuAQZm.js.map → pt-BR.ChPOra5s.js.map} +1 -1
  219. package/dist/chunks/{radio-group.DUW2dya4.js → radio-group.Dtx5hOkQ.js} +23 -23
  220. package/dist/chunks/{radio-group.DUW2dya4.js.map → radio-group.Dtx5hOkQ.js.map} +1 -1
  221. package/dist/chunks/{rich-text-editor.CuCPLzUh.js → rich-text-editor.CmVsFJjh.js} +1364 -1416
  222. package/dist/chunks/{rich-text-editor.CuCPLzUh.js.map → rich-text-editor.CmVsFJjh.js.map} +1 -1
  223. package/dist/chunks/scroll-to-section.DhW8SFy0.js +101 -0
  224. package/dist/chunks/scroll-to-section.DhW8SFy0.js.map +1 -0
  225. package/dist/chunks/{search-bar.8iDkgmjw.js → search-bar.CRfYCmkl.js} +15 -48
  226. package/dist/chunks/{search-bar.8iDkgmjw.js.map → search-bar.CRfYCmkl.js.map} +1 -1
  227. package/dist/chunks/secondary-nav.B1Tj7MAA.js +192 -0
  228. package/dist/chunks/{secondary-nav.CmvSHxvS.js.map → secondary-nav.B1Tj7MAA.js.map} +1 -1
  229. package/dist/chunks/{segmented-control.Bkp2Y95s.js → segmented-control.CBc-wx0m.js} +44 -48
  230. package/dist/chunks/{segmented-control.Bkp2Y95s.js.map → segmented-control.CBc-wx0m.js.map} +1 -1
  231. package/dist/chunks/{selection-card-group.EGigQJOW.js → selection-card-group.BaK3Rt4K.js} +91 -96
  232. package/dist/chunks/{selection-card-group.EGigQJOW.js.map → selection-card-group.BaK3Rt4K.js.map} +1 -1
  233. package/dist/chunks/set-time-in-date.BVfkl8K8.js +27 -0
  234. package/dist/chunks/{set-time-in-date.CU7HeZLY.js.map → set-time-in-date.BVfkl8K8.js.map} +1 -1
  235. package/dist/chunks/{sidepanel.yB7YuzVt.js → sidepanel.DeIREn9l.js} +55 -78
  236. package/dist/chunks/{sidepanel.yB7YuzVt.js.map → sidepanel.DeIREn9l.js.map} +1 -1
  237. package/dist/chunks/startOfWeek.muMEhS7U.js +9 -0
  238. package/dist/chunks/{startOfWeek.Br5KM4z_.js.map → startOfWeek.muMEhS7U.js.map} +1 -1
  239. package/dist/chunks/{status.CKb07vxI.js → status.DJ1Dfh5s.js} +2 -2
  240. package/dist/chunks/{status.CKb07vxI.js.map → status.DJ1Dfh5s.js.map} +1 -1
  241. package/dist/chunks/step.DfI11Din.js +221 -0
  242. package/dist/chunks/{step.CIfxl8Wm.js.map → step.DfI11Din.js.map} +1 -1
  243. package/dist/chunks/{structured-list-item.Cnv4Pw5n.js → structured-list-item._7YG2L3a.js} +18 -40
  244. package/dist/chunks/{structured-list-item.Cnv4Pw5n.js.map → structured-list-item._7YG2L3a.js.map} +1 -1
  245. package/dist/chunks/{summary-grid.types.BcIlkfVO.js → summary-grid.types.B_gUEQ0c.js} +45 -50
  246. package/dist/chunks/{summary-grid.types.BcIlkfVO.js.map → summary-grid.types.B_gUEQ0c.js.map} +1 -1
  247. package/dist/chunks/tab.DFk4K9cq.js +229 -0
  248. package/dist/chunks/{tab.N0xGWsfO.js.map → tab.DFk4K9cq.js.map} +1 -1
  249. package/dist/chunks/table-of-contents.CoEnQ9g7.js +104 -0
  250. package/dist/chunks/{table-of-contents.Cf-IrdZl.js.map → table-of-contents.CoEnQ9g7.js.map} +1 -1
  251. package/dist/chunks/{tag.BAyLm485.js → tag.BC7FFENr.js} +4 -4
  252. package/dist/chunks/{tag.BAyLm485.js.map → tag.BC7FFENr.js.map} +1 -1
  253. package/dist/chunks/textarea.Z-VYFZVq.js +176 -0
  254. package/dist/chunks/{textarea.BDRR1zE0.js.map → textarea.Z-VYFZVq.js.map} +1 -1
  255. package/dist/chunks/{timeline-item.QEEIwYMy.js → timeline-item.BGHi_lOY.js} +114 -193
  256. package/dist/chunks/{timeline-item.QEEIwYMy.js.map → timeline-item.BGHi_lOY.js.map} +1 -1
  257. package/dist/chunks/{toast.XPG0vaQB.js → toast.D-jat1Xw.js} +64 -86
  258. package/dist/chunks/{toast.XPG0vaQB.js.map → toast.D-jat1Xw.js.map} +1 -1
  259. package/dist/chunks/{toggle.Ca-MM3dt.js → toggle.BqHWIhqD.js} +4 -4
  260. package/dist/chunks/{toggle.Ca-MM3dt.js.map → toggle.BqHWIhqD.js.map} +1 -1
  261. package/dist/chunks/{tooltip.7ct8WxCl.js → tooltip.D_XsoD_u.js} +68 -70
  262. package/dist/chunks/{tooltip.7ct8WxCl.js.map → tooltip.D_XsoD_u.js.map} +1 -1
  263. package/dist/chunks/truncate.DmCXQmeb.js +8 -0
  264. package/dist/chunks/{truncate.BfIl_-71.js.map → truncate.DmCXQmeb.js.map} +1 -1
  265. package/dist/chunks/{tutorial.bROv3HSx.js → tutorial.BtxKW4ac.js} +80 -173
  266. package/dist/chunks/{tutorial.bROv3HSx.js.map → tutorial.BtxKW4ac.js.map} +1 -1
  267. package/dist/chunks/typography.D1OZJbEa.js +90 -0
  268. package/dist/chunks/typography.D1OZJbEa.js.map +1 -0
  269. package/dist/chunks/{use-bento-delayed-hover.Bz_8EabW.js → use-bento-delayed-hover.D6QjSugc.js} +2 -2
  270. package/dist/chunks/{use-bento-delayed-hover.Bz_8EabW.js.map → use-bento-delayed-hover.D6QjSugc.js.map} +1 -1
  271. package/dist/chunks/{use-bento-toast-controller.CB6Qbf3R.js → use-bento-toast-controller.A5xraVqa.js} +14 -15
  272. package/dist/chunks/{use-bento-toast-controller.CB6Qbf3R.js.map → use-bento-toast-controller.A5xraVqa.js.map} +1 -1
  273. package/dist/chunks/use-country-items.B1KhLbqM.js +30 -0
  274. package/dist/chunks/{use-country-items.CmCRY7QX.js.map → use-country-items.B1KhLbqM.js.map} +1 -1
  275. package/dist/chunks/use-country-phon-code.Cv5YgCOo.js +291 -0
  276. package/dist/chunks/use-country-phon-code.Cv5YgCOo.js.map +1 -0
  277. package/dist/chunks/use-date-input-formatter.DXwvH7B0.js +1629 -0
  278. package/dist/chunks/{use-date-input-formatter.DfQk8_Dw.js.map → use-date-input-formatter.DXwvH7B0.js.map} +1 -1
  279. package/dist/chunks/use-expandable-content-height.Bdd9hQwq.js +34 -0
  280. package/dist/chunks/{use-expandable-content-height.2WJLCL-R.js.map → use-expandable-content-height.Bdd9hQwq.js.map} +1 -1
  281. package/dist/chunks/utils.DWmc2mUI.js +19 -0
  282. package/dist/chunks/{utils.BzUwtTXc.js.map → utils.DWmc2mUI.js.map} +1 -1
  283. package/dist/chunks/{zh-CN.Be4pa3-g.js → zh-CN.ZG6obniO.js} +28 -28
  284. package/dist/chunks/{zh-CN.Be4pa3-g.js.map → zh-CN.ZG6obniO.js.map} +1 -1
  285. package/dist/click-outside.js +1 -1
  286. package/dist/code-snippet.js +1 -1
  287. package/dist/country.js +3 -3
  288. package/dist/currency.js +1 -1
  289. package/dist/dashboard-template.js +1 -1
  290. package/dist/dashed-underline.js +1 -1
  291. package/dist/data-grid-template.js +1 -1
  292. package/dist/data-grid.js +1 -1
  293. package/dist/date-picker.js +2 -2
  294. package/dist/date-range-picker.js +2 -2
  295. package/dist/date-time-picker.js +1 -1
  296. package/dist/date.js +1 -1
  297. package/dist/draggable.js +2 -2
  298. package/dist/drawer.js +1 -1
  299. package/dist/dropdown.js +2 -2
  300. package/dist/empty-state.js +1 -1
  301. package/dist/file-uploader.js +1 -1
  302. package/dist/filter-bar.js +1 -1
  303. package/dist/focus-trap.js +1 -1
  304. package/dist/form-layout.js +2 -2
  305. package/dist/header-with-views.js +1 -1
  306. package/dist/header.js +1 -1
  307. package/dist/index.js +144 -149
  308. package/dist/index.js.map +1 -1
  309. package/dist/info-icon.js +1 -1
  310. package/dist/input-field-password.js +1 -1
  311. package/dist/input-field-phone-number.js +1 -1
  312. package/dist/input-field.js +1 -1
  313. package/dist/input-time.js +1 -1
  314. package/dist/inspector.js +2 -2
  315. package/dist/internal.js +14 -14
  316. package/dist/layout.js +1 -1
  317. package/dist/link.js +1 -1
  318. package/dist/list.js +1 -1
  319. package/dist/menu.js +1 -1
  320. package/dist/modal-fullscreen.js +1 -1
  321. package/dist/modal.js +2 -2
  322. package/dist/navigation-menu.js +1 -1
  323. package/dist/pagination.js +1 -1
  324. package/dist/payment-method.js +1 -1
  325. package/dist/popover.js +2 -2
  326. package/dist/popper-container.js +1 -1
  327. package/dist/promo-banner.js +1 -1
  328. package/dist/radio-group.js +1 -1
  329. package/dist/rich-text-editor.js +1 -1
  330. package/dist/search-bar.js +2 -2
  331. package/dist/secondary-nav.js +1 -1
  332. package/dist/segmented-control.js +1 -1
  333. package/dist/selection-card.js +1 -1
  334. package/dist/sidepanel.js +1 -1
  335. package/dist/status.js +1 -1
  336. package/dist/stepper.js +1 -1
  337. package/dist/structured-list.js +1 -1
  338. package/dist/summary-grid.js +1 -1
  339. package/dist/table-of-contents.js +1 -1
  340. package/dist/tabs.js +1 -1
  341. package/dist/tag.js +1 -1
  342. package/dist/textarea.js +1 -1
  343. package/dist/timeline.js +1 -1
  344. package/dist/toast.js +1 -1
  345. package/dist/toggle.js +1 -1
  346. package/dist/tutorial.js +1 -1
  347. package/dist/typography.js +1 -1
  348. package/dist/use-form-v4.js +331 -341
  349. package/dist/use-form-v4.js.map +1 -1
  350. package/dist/web-types.json +32 -2
  351. package/package.json +11 -11
  352. package/dist/chunks/anchor-scroller.DgC74yeM.js +0 -141
  353. package/dist/chunks/anchor-scroller.DgC74yeM.js.map +0 -1
  354. package/dist/chunks/button-actions-with-menu.DNYoFmV4.js +0 -85
  355. package/dist/chunks/calendar.CvHJ3Geq.js +0 -1247
  356. package/dist/chunks/click-outside.BG01Sm0A.js +0 -23
  357. package/dist/chunks/constructNow.CK0ryPil.js +0 -8
  358. package/dist/chunks/country.types.8GCHsdGN.js +0 -2789
  359. package/dist/chunks/country.types.8GCHsdGN.js.map +0 -1
  360. package/dist/chunks/currency.Dvy9Qjjf.js +0 -126
  361. package/dist/chunks/dashboard-section.D2yqhERq.js +0 -102
  362. package/dist/chunks/data-grid-template.Ifn423Ot.js +0 -111
  363. package/dist/chunks/data-grid.BDXQ_kKQ.js +0 -4121
  364. package/dist/chunks/date-picker.CXZfCxwP.js +0 -252
  365. package/dist/chunks/date-range-picker.BzVQsYk4.js +0 -1295
  366. package/dist/chunks/date-time-picker.DaLATfJp.js +0 -202
  367. package/dist/chunks/differenceInMonths.CpwVtHZX.js +0 -44
  368. package/dist/chunks/draggable.rTa1jcHI.js +0 -196
  369. package/dist/chunks/empty-state.DSVU1vU8.js +0 -106
  370. package/dist/chunks/empty-state.DSVU1vU8.js.map +0 -1
  371. package/dist/chunks/filter-bar.qlViDZPY.js +0 -3754
  372. package/dist/chunks/fixed-scroller.04EUUgD_.js +0 -152
  373. package/dist/chunks/get-slot-text.Bjb9dTSV.js +0 -12
  374. package/dist/chunks/header-meta.CCQVPDU8.js +0 -250
  375. package/dist/chunks/index.B6WW_F-J.js.map +0 -1
  376. package/dist/chunks/input-field-password.Bri9q5EV.js +0 -395
  377. package/dist/chunks/input-field-password.Bri9q5EV.js.map +0 -1
  378. package/dist/chunks/isSameWeek.TrpUOIn5.js +0 -14
  379. package/dist/chunks/list-item.BiJMHR7b.js +0 -226
  380. package/dist/chunks/pagination.CZVdaeqE.js.map +0 -1
  381. package/dist/chunks/popover.types.BfnJIpII.js +0 -6
  382. package/dist/chunks/scroll-to-section.CC5g-HBX.js +0 -111
  383. package/dist/chunks/scroll-to-section.CC5g-HBX.js.map +0 -1
  384. package/dist/chunks/secondary-nav.CmvSHxvS.js +0 -266
  385. package/dist/chunks/set-time-in-date.CU7HeZLY.js +0 -27
  386. package/dist/chunks/startOfWeek.Br5KM4z_.js +0 -10
  387. package/dist/chunks/step.CIfxl8Wm.js +0 -253
  388. package/dist/chunks/tab.N0xGWsfO.js +0 -259
  389. package/dist/chunks/table-of-contents.Cf-IrdZl.js +0 -129
  390. package/dist/chunks/textarea.BDRR1zE0.js +0 -224
  391. package/dist/chunks/truncate.BfIl_-71.js +0 -8
  392. package/dist/chunks/typography.C8lPlsbD.js +0 -87
  393. package/dist/chunks/typography.C8lPlsbD.js.map +0 -1
  394. package/dist/chunks/use-country-items.CmCRY7QX.js +0 -30
  395. package/dist/chunks/use-country-phon-code.BWkb546s.js +0 -6641
  396. package/dist/chunks/use-country-phon-code.BWkb546s.js.map +0 -1
  397. package/dist/chunks/use-date-input-formatter.DfQk8_Dw.js +0 -1732
  398. package/dist/chunks/use-expandable-content-height.2WJLCL-R.js +0 -35
  399. package/dist/chunks/utils.BzUwtTXc.js +0 -21
@@ -0,0 +1,124 @@
1
+ import { defineComponent as U, useSlots as E, computed as T, onMounted as _ } from "vue";
2
+ import { p as g, d as Y, B as H } from "./typography.D1OZJbEa.js";
3
+ import { u as Z } from "./index.CPOlyau9.js";
4
+ import { g as l } from "./get-slot-text.DM_NdrUC.js";
5
+ import { n as W } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
6
+ import "../assets/currency.css";
7
+ const v = [
8
+ {
9
+ exponent: 0,
10
+ currencies: [
11
+ "CVE",
12
+ "DJF",
13
+ "GNF",
14
+ "IDR",
15
+ "JPY",
16
+ "KMF",
17
+ "KRW",
18
+ "PYG",
19
+ "RWF",
20
+ "UGX",
21
+ "VND",
22
+ "VUV",
23
+ "XAF",
24
+ "XOF",
25
+ "XPF"
26
+ ]
27
+ },
28
+ {
29
+ exponent: 1,
30
+ currencies: ["MRO"]
31
+ },
32
+ {
33
+ exponent: 3,
34
+ currencies: ["BHD", "IQD", "JOD", "KWD", "LYD", "OMR", "TND"]
35
+ }
36
+ ], L = (s) => v.find((a) => a.currencies.includes(s));
37
+ function A(s) {
38
+ return L(s)?.exponent ?? 2;
39
+ }
40
+ const V = (s, a) => s / 10 ** A(a), b = "USD";
41
+ function X() {
42
+ const { n: s } = Z(), a = "standard", R = (N, i) => {
43
+ const P = i?.currency ?? b, M = Number(N) || 0;
44
+ isNaN(Number(N)) && g(
45
+ "The value provided is not a valid string with numbers or valid number. Falling back to 0."
46
+ );
47
+ const F = i?.majorUnits ? M : V(M, P), m = L(P)?.exponent ?? A(P), G = s(F, {
48
+ style: "currency",
49
+ currency: P,
50
+ currencySign: i?.currencySign ?? a,
51
+ currencyDisplay: "code",
52
+ minimumFractionDigits: m,
53
+ maximumFractionDigits: m
54
+ }), f = new RegExp(`\\s*${P}\\s*`);
55
+ return {
56
+ currencyNumber: G.replace(f, ""),
57
+ currencyCode: P
58
+ };
59
+ }, D = (N, i) => K(N, i).formattedCurrency, K = (N, i) => {
60
+ const { currencyNumber: P, currencyCode: M } = R(N, i);
61
+ return {
62
+ currencyNumber: P,
63
+ currencyCode: M,
64
+ formattedCurrency: `${P} ${M}`
65
+ };
66
+ };
67
+ return {
68
+ formatCurrency: D,
69
+ formatCurrencyParts: K
70
+ };
71
+ }
72
+ var p = /* @__PURE__ */ ((s) => (s.AED = "AED", s.AFA = "AFA", s.ALL = "ALL", s.AMD = "AMD", s.ANG = "ANG", s.AOA = "AOA", s.ARS = "ARS", s.AUD = "AUD", s.AWG = "AWG", s.AZN = "AZN", s.BAM = "BAM", s.BBD = "BBD", s.BDT = "BDT", s.BEF = "BEF", s.BGN = "BGN", s.BHD = "BHD", s.BIF = "BIF", s.BMD = "BMD", s.BND = "BND", s.BOB = "BOB", s.BRL = "BRL", s.BSD = "BSD", s.BTC = "BTC", s.BTN = "BTN", s.BWP = "BWP", s.BYR = "BYR", s.BZD = "BZD", s.CAD = "CAD", s.CDF = "CDF", s.CHF = "CHF", s.CLF = "CLF", s.CLP = "CLP", s.CNY = "CNY", s.COP = "COP", s.CRC = "CRC", s.CUC = "CUC", s.CVE = "CVE", s.CZK = "CZK", s.DEM = "DEM", s.DJF = "DJF", s.DKK = "DKK", s.DOP = "DOP", s.DZD = "DZD", s.EEK = "EEK", s.EGP = "EGP", s.ERN = "ERN", s.ETB = "ETB", s.EUR = "EUR", s.FJD = "FJD", s.FKP = "FKP", s.GBP = "GBP", s.GEL = "GEL", s.GHS = "GHS", s.GIP = "GIP", s.GMD = "GMD", s.GNF = "GNF", s.GRD = "GRD", s.GTQ = "GTQ", s.GYD = "GYD", s.HKD = "HKD", s.HNL = "HNL", s.HRK = "HRK", s.HTG = "HTG", s.HUF = "HUF", s.IDR = "IDR", s.ILS = "ILS", s.INR = "INR", s.IQD = "IQD", s.IRR = "IRR", s.ISK = "ISK", s.ITL = "ITL", s.JMD = "JMD", s.JOD = "JOD", s.JPY = "JPY", s.KES = "KES", s.KGS = "KGS", s.KHR = "KHR", s.KMF = "KMF", s.KPW = "KPW", s.KRW = "KRW", s.KWD = "KWD", s.KYD = "KYD", s.KZT = "KZT", s.LAK = "LAK", s.LBP = "LBP", s.LKR = "LKR", s.LRD = "LRD", s.LSL = "LSL", s.LTC = "LTC", s.LTL = "LTL", s.LVL = "LVL", s.LYD = "LYD", s.MAD = "MAD", s.MDL = "MDL", s.MGA = "MGA", s.MKD = "MKD", s.MMK = "MMK", s.MNT = "MNT", s.MOP = "MOP", s.MRO = "MRO", s.MRU = "MRU", s.MUR = "MUR", s.MVR = "MVR", s.MWK = "MWK", s.MXN = "MXN", s.MYR = "MYR", s.MZM = "MZM", s.NAD = "NAD", s.NGN = "NGN", s.NIO = "NIO", s.NOK = "NOK", s.NPR = "NPR", s.NZD = "NZD", s.OMR = "OMR", s.PAB = "PAB", s.PEN = "PEN", s.PGK = "PGK", s.PHP = "PHP", s.PKR = "PKR", s.PLN = "PLN", s.PYG = "PYG", s.QAR = "QAR", s.RON = "RON", s.RSD = "RSD", s.RUB = "RUB", s.RWF = "RWF", s.SAR = "SAR", s.SBD = "SBD", s.SCR = "SCR", s.SDG = "SDG", s.SEK = "SEK", s.SGD = "SGD", s.SHP = "SHP", s.SKK = "SKK", s.SLL = "SLL", s.SOS = "SOS", s.SRD = "SRD", s.SSP = "SSP", s.STD = "STD", s.SVC = "SVC", s.SYP = "SYP", s.SZL = "SZL", s.THB = "THB", s.TJS = "TJS", s.TMT = "TMT", s.TND = "TND", s.TOP = "TOP", s.TRY = "TRY", s.TTD = "TTD", s.TWD = "TWD", s.TZS = "TZS", s.UAH = "UAH", s.UGX = "UGX", s.USD = "USD", s.UYU = "UYU", s.UZS = "UZS", s.VEF = "VEF", s.VND = "VND", s.VUV = "VUV", s.WST = "WST", s.XAF = "XAF", s.XCD = "XCD", s.XDR = "XDR", s.XOF = "XOF", s.XPF = "XPF", s.YER = "YER", s.ZAR = "ZAR", s.ZMK = "ZMK", s.ZWL = "ZWL", s))(p || {});
73
+ const J = {
74
+ name: "bento-currency",
75
+ i18n: {}
76
+ // required to enable E2E to run as they do not have vue-i18n set up
77
+ }, x = /* @__PURE__ */ U({
78
+ ...J,
79
+ props: {
80
+ currency: { default: p.EUR },
81
+ disableTypography: { type: Boolean, default: !1 },
82
+ majorUnits: { type: Boolean, default: !1 },
83
+ value: { default: void 0 },
84
+ currencySign: { default: "standard" },
85
+ strongerAmount: { type: Boolean }
86
+ },
87
+ setup(s) {
88
+ const a = s, R = E(), { formatCurrencyParts: D } = X(), K = T(() => {
89
+ const i = a.value ?? l(R)("default");
90
+ return D(i, {
91
+ currency: a.currency,
92
+ currencySign: a.currencySign,
93
+ majorUnits: a.majorUnits
94
+ });
95
+ }), N = T(() => ` ${K.value.currencyCode}`);
96
+ return _(() => {
97
+ l(R)("default") && Y(
98
+ 'BentoCurrency "default" slot',
99
+ `The use of "default" slot in "BentoCurrency" is no longer supported as it causes issues with dynamic content.
100
+ Use the "value" property instead.
101
+ <bento-currency :value="12345.67" currency="USD" major-units="false" />`,
102
+ "2.0.0"
103
+ );
104
+ }), { __sfc: !0, slots: R, props: a, formatCurrencyParts: D, formattedCurrencyParts: K, formattedCurrencyCode: N, BentoTypography: H };
105
+ }
106
+ });
107
+ var t = function() {
108
+ var a = this, R = a._self._c, D = a._self._setupProxy;
109
+ return R("div", { staticClass: "b-currency", attrs: { "aria-label": D.formattedCurrencyParts.formattedCurrency } }, [a.disableTypography ? [a._v(a._s(D.formattedCurrencyParts.formattedCurrency))] : R(D.BentoTypography, { staticClass: "b-currency__amount", attrs: { el: "span", variant: "body", strong: "" } }, [R(D.BentoTypography, { attrs: { el: "span", strongest: a.strongerAmount } }, [a._v(a._s(D.formattedCurrencyParts.currencyNumber))]), R("span", [a._v(a._s(D.formattedCurrencyCode))])], 1)], 2);
110
+ }, h = [], Q = /* @__PURE__ */ W(
111
+ x,
112
+ t,
113
+ h,
114
+ !1,
115
+ null,
116
+ "ed641ecc"
117
+ );
118
+ const c = Q.exports;
119
+ export {
120
+ p as B,
121
+ c,
122
+ X as u
123
+ };
124
+ //# sourceMappingURL=currency.POwX-Trj.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"currency.Dvy9Qjjf.js","sources":["../../src/utils/ts/currency/currency-map.ts","../../src/utils/ts/currency/currency.ts","../../src/composables/use-bento-currency/use-bento-currency.ts","../../src/components/currency/currency.types.ts","../../src/components/currency/currency.vue"],"sourcesContent":["export interface CurrencyMap {\n exponent: number;\n currencies: Array<string>;\n}\n\n/**\n * Contains mapping configuration between currency code and exponent for amount in the corresponding currency.\n * https://docs.adyen.com/development-resources/currency-codes\n *\n * @internal\n */\nexport const currencyMap: Array<CurrencyMap> = [\n {\n exponent: 0,\n currencies: [\n 'CVE',\n 'DJF',\n 'GNF',\n 'IDR',\n 'JPY',\n 'KMF',\n 'KRW',\n 'PYG',\n 'RWF',\n 'UGX',\n 'VND',\n 'VUV',\n 'XAF',\n 'XOF',\n 'XPF',\n ],\n },\n {\n exponent: 1,\n currencies: ['MRO'],\n },\n {\n exponent: 3,\n currencies: ['BHD', 'IQD', 'JOD', 'KWD', 'LYD', 'OMR', 'TND'],\n },\n];\n","import { currencyMap, type CurrencyMap } from './currency-map';\nimport { type CurrencyAmount } from './currency.types';\n\n/**\n * Returns exponent for specified currency code that do not adhere to the ISO 4217 standard.\n */\nexport const getNonStandardCurrency = (currency: string): CurrencyMap =>\n currencyMap.find(item => item.currencies.includes(currency));\n\n/**\n * Returns the number of minor units (decimal places) for a given currency.\n * The function uses an internal map for currencies with non-standard decimal places and defaults to 2 for all others.\n *\n * @param currency - The three-letter ISO 4217 currency code (e.g., 'USD', 'JPY').\n * @returns The number of decimal places for the currency.\n *\n * @example\n * getMinorUnitDigits('USD'); // Returns 2\n * getMinorUnitDigits('JPY'); // Returns 0\n */\nexport function getMinorUnitDigits(currency: string): number {\n const exception = getNonStandardCurrency(currency);\n\n return exception?.exponent ?? 2;\n}\n\n/**\n * Converts a currency amount from minor units to major units.\n *\n * @param amount The amount in minor units (e.g., cents).\n * @param currency The three-letter ISO 4217 currency code.\n * @returns The amount in major units (e.g., dollars).\n */\nexport const getNormalizedAmount = (amount: CurrencyAmount['value'], currency: string) =>\n amount / 10 ** getMinorUnitDigits(currency);\n","import { getMinorUnitDigits, getNonStandardCurrency, getNormalizedAmount } from '@/utils/ts/currency';\nimport { useI18n } from '@/utils/ts/i18n';\nimport { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\nimport { type BentoCurrencyISOCode } from '../../components/currency/currency.types';\n\nexport interface UseBentoCurrencyFormatCurrencyOptions {\n currency?: `${BentoCurrencyISOCode}`;\n currencySign?: Intl.NumberFormatOptions['currencySign'];\n majorUnits?: boolean;\n}\n\nexport interface UseBentoCurrencyParts {\n /**\n * The localized number portion of the formatted currency.\n */\n currencyNumber: string;\n\n /**\n * The ISO currency code used for formatting.\n */\n currencyCode: string;\n\n /**\n * The complete formatted currency string.\n */\n formattedCurrency: string;\n}\n\nconst DEFAULT_CURRENCY = 'USD';\n\n/**\n * A composable that returns a fully formatted and localized currency string.\n * It enforces the format `[localized number][non-breaking space][ISO code]`.\n *\n * @remarks\n * The formatting process involves several steps:\n * 1. It safely resolves the input `value`, whether it's from a prop or a slot, into a valid number.\n *\n * 2. If `majorUnits` is false, it converts the amount from minor units to major units\n * (e.g., cents to dollars) by dividing by 10 to the power of the currency's\n * decimal places (the \"exponent\"). For example, `12345 / (10 ** 2)` becomes `123.45`.\n *\n * 3. It determines the correct number of decimal places, respecting any non-standard\n * currency exceptions.\n *\n * 4. It uses `vue-i18n` to format the number with the correct sign placement and decimal/thousand\n * separators for the current locale, then manually reconstructs the string to ensure\n * the ISO code is always at the end.\n *\n * @returns An object with a function to format the currency string.\n */\nexport function useBentoCurrency() {\n const { n } = useI18n();\n\n const DEFAULT_CURRENCY_SIGN = 'standard';\n\n /**\n * Resolves the shared formatting details used by currency string and currency parts formatters.\n *\n * @param amount The numeric value to be formatted. If `formatOptions.majorUnits` is `false` or undefined,\n * this value is treated as being in the currency's minor units (e.g., cents).\n * @param formatOptions An optional object containing options for currency formatting.\n *\n * @returns The localized number and ISO currency code.\n */\n const getCurrencyFormatDetails = (\n amount: string | number,\n formatOptions?: UseBentoCurrencyFormatCurrencyOptions\n ) => {\n const targetCurrency = formatOptions?.currency ?? DEFAULT_CURRENCY;\n\n // Parse and Fallback\n const parsedValue = Number(amount) || 0;\n\n if (isNaN(Number(amount))) {\n printDevelopmentWarning(\n 'The value provided is not a valid string with numbers or valid number. Falling back to 0.'\n );\n }\n\n // Normalize Amount\n const normalizedAmount = formatOptions?.majorUnits\n ? parsedValue\n : getNormalizedAmount(parsedValue, targetCurrency);\n\n // Determine Precision\n const fractionDigits = getNonStandardCurrency(targetCurrency)?.exponent ?? getMinorUnitDigits(targetCurrency);\n\n // Format with Locale\n const localizedCurrencyString = n(normalizedAmount, {\n style: 'currency',\n currency: targetCurrency,\n currencySign: formatOptions?.currencySign ?? DEFAULT_CURRENCY_SIGN,\n currencyDisplay: 'code',\n minimumFractionDigits: fractionDigits,\n maximumFractionDigits: fractionDigits,\n });\n\n // Enforce Standard Format: `[number][nbsp][code]`\n const isoCodeRegex = new RegExp(`\\\\s*${targetCurrency}\\\\s*`);\n const numberPart = localizedCurrencyString.replace(isoCodeRegex, '');\n\n return {\n currencyNumber: numberPart,\n currencyCode: targetCurrency,\n };\n };\n\n /**\n * Formats a given amount into a localized currency string with a specific structure.\n *\n * This function ensures that the output format is always `[localized number][non-breaking space][ISO code]`,\n * providing a consistent and predictable currency representation across different locales.\n *\n * @param amount The numeric value to be formatted. If `formatOptions.majorUnits` is `false` or undefined,\n * this value is treated as being in the currency's minor units (e.g., cents).\n * @param formatOptions An optional object containing options for currency formatting.\n * - `currency`: The 3-letter ISO currency code (e.g., `'USD'`, `'EUR'`). Defaults to `'USD'`.\n * - `currencySign`: The currency sign to use. Can be `'standard'` or `'accounting'`. Defaults to `'standard'`. In `accounting` mode, negative values are typically wrapped in parentheses.\n * - `majorUnits`: Set to `true` if the `amount` is already in major units (e.g., dollars instead of cents). Defaults to `false`.\n *\n * @returns A fully formatted and localized currency string (e.g., \"1,234.56 EUR\").\n */\n const formatCurrency = (amount: string | number, formatOptions?: UseBentoCurrencyFormatCurrencyOptions): string =>\n formatCurrencyParts(amount, formatOptions).formattedCurrency;\n /**\n * Formats a given amount into separate currency parts for consumers that need custom markup.\n *\n * This function reuses the shared currency formatting details to keep parsing, normalization, precision, locale formatting,\n * and final string construction aligned with the standard currency formatter.\n *\n * @param amount The numeric value to be formatted. If `formatOptions.majorUnits` is `false` or undefined,\n * this value is treated as being in the currency's minor units (e.g., cents).\n * @param formatOptions An optional object containing options for currency formatting.\n *\n * @returns The localized number, ISO currency code, and complete formatted currency string.\n */\n const formatCurrencyParts = (\n amount: string | number,\n formatOptions?: UseBentoCurrencyFormatCurrencyOptions\n ): UseBentoCurrencyParts => {\n const { currencyNumber, currencyCode } = getCurrencyFormatDetails(amount, formatOptions);\n\n return {\n currencyNumber,\n currencyCode,\n formattedCurrency: `${currencyNumber}\\u00A0${currencyCode}`,\n };\n };\n\n return {\n formatCurrency,\n formatCurrencyParts,\n };\n}\n","export interface BentoCurrencyProps {\n /**\n * Currency code based on the ISO 4217 standard\n */\n currency?: BentoCurrencyISOCode | `${BentoCurrencyISOCode}`;\n\n /**\n * Disable the default typography for the component. Only use this when the component is inside another typography component.\n */\n disableTypography?: boolean;\n\n /**\n * Accepts currency value in major units instead of minor ones\n */\n majorUnits?: boolean;\n\n /**\n * Currency value to be formatted\n */\n value?: number;\n\n /**\n * Determines how the currency symbol and negative values are displayed.\n * This is only applicable to certain countries such as `en-US`.\n *\n * - `'standard'`: Default format (e.g., `-1,234.56 USD`).\n * - `'accounting'`: Uses accounting conventions, such as wrapping negative numbers in parentheses (e.g., `(1,234.56) USD`).\n *\n * @default 'standard'\n */\n currencySign?: Intl.NumberFormatOptions['currencySign'];\n\n /**\n * Makes only the numeric part of the formatted currency bold.\n */\n strongerAmount?: boolean;\n}\n\nexport enum BentoCurrencyISOCode {\n AED = 'AED',\n AFA = 'AFA',\n ALL = 'ALL',\n AMD = 'AMD',\n ANG = 'ANG',\n AOA = 'AOA',\n ARS = 'ARS',\n AUD = 'AUD',\n AWG = 'AWG',\n AZN = 'AZN',\n BAM = 'BAM',\n BBD = 'BBD',\n BDT = 'BDT',\n BEF = 'BEF',\n BGN = 'BGN',\n BHD = 'BHD',\n BIF = 'BIF',\n BMD = 'BMD',\n BND = 'BND',\n BOB = 'BOB',\n BRL = 'BRL',\n BSD = 'BSD',\n BTC = 'BTC',\n BTN = 'BTN',\n BWP = 'BWP',\n BYR = 'BYR',\n BZD = 'BZD',\n CAD = 'CAD',\n CDF = 'CDF',\n CHF = 'CHF',\n CLF = 'CLF',\n CLP = 'CLP',\n CNY = 'CNY',\n COP = 'COP',\n CRC = 'CRC',\n CUC = 'CUC',\n CVE = 'CVE',\n CZK = 'CZK',\n DEM = 'DEM',\n DJF = 'DJF',\n DKK = 'DKK',\n DOP = 'DOP',\n DZD = 'DZD',\n EEK = 'EEK',\n EGP = 'EGP',\n ERN = 'ERN',\n ETB = 'ETB',\n EUR = 'EUR',\n FJD = 'FJD',\n FKP = 'FKP',\n GBP = 'GBP',\n GEL = 'GEL',\n GHS = 'GHS',\n GIP = 'GIP',\n GMD = 'GMD',\n GNF = 'GNF',\n GRD = 'GRD',\n GTQ = 'GTQ',\n GYD = 'GYD',\n HKD = 'HKD',\n HNL = 'HNL',\n HRK = 'HRK',\n HTG = 'HTG',\n HUF = 'HUF',\n IDR = 'IDR',\n ILS = 'ILS',\n INR = 'INR',\n IQD = 'IQD',\n IRR = 'IRR',\n ISK = 'ISK',\n ITL = 'ITL',\n JMD = 'JMD',\n JOD = 'JOD',\n JPY = 'JPY',\n KES = 'KES',\n KGS = 'KGS',\n KHR = 'KHR',\n KMF = 'KMF',\n KPW = 'KPW',\n KRW = 'KRW',\n KWD = 'KWD',\n KYD = 'KYD',\n KZT = 'KZT',\n LAK = 'LAK',\n LBP = 'LBP',\n LKR = 'LKR',\n LRD = 'LRD',\n LSL = 'LSL',\n LTC = 'LTC',\n LTL = 'LTL',\n LVL = 'LVL',\n LYD = 'LYD',\n MAD = 'MAD',\n MDL = 'MDL',\n MGA = 'MGA',\n MKD = 'MKD',\n MMK = 'MMK',\n MNT = 'MNT',\n MOP = 'MOP',\n MRO = 'MRO',\n MRU = 'MRU',\n MUR = 'MUR',\n MVR = 'MVR',\n MWK = 'MWK',\n MXN = 'MXN',\n MYR = 'MYR',\n MZM = 'MZM',\n NAD = 'NAD',\n NGN = 'NGN',\n NIO = 'NIO',\n NOK = 'NOK',\n NPR = 'NPR',\n NZD = 'NZD',\n OMR = 'OMR',\n PAB = 'PAB',\n PEN = 'PEN',\n PGK = 'PGK',\n PHP = 'PHP',\n PKR = 'PKR',\n PLN = 'PLN',\n PYG = 'PYG',\n QAR = 'QAR',\n RON = 'RON',\n RSD = 'RSD',\n RUB = 'RUB',\n RWF = 'RWF',\n SAR = 'SAR',\n SBD = 'SBD',\n SCR = 'SCR',\n SDG = 'SDG',\n SEK = 'SEK',\n SGD = 'SGD',\n SHP = 'SHP',\n SKK = 'SKK',\n SLL = 'SLL',\n SOS = 'SOS',\n SRD = 'SRD',\n SSP = 'SSP',\n STD = 'STD',\n SVC = 'SVC',\n SYP = 'SYP',\n SZL = 'SZL',\n THB = 'THB',\n TJS = 'TJS',\n TMT = 'TMT',\n TND = 'TND',\n TOP = 'TOP',\n TRY = 'TRY',\n TTD = 'TTD',\n TWD = 'TWD',\n TZS = 'TZS',\n UAH = 'UAH',\n UGX = 'UGX',\n USD = 'USD',\n UYU = 'UYU',\n UZS = 'UZS',\n VEF = 'VEF',\n VND = 'VND',\n VUV = 'VUV',\n WST = 'WST',\n XAF = 'XAF',\n XCD = 'XCD',\n XDR = 'XDR',\n XOF = 'XOF',\n XPF = 'XPF',\n YER = 'YER',\n ZAR = 'ZAR',\n ZMK = 'ZMK',\n ZWL = 'ZWL',\n}\n","<template>\n <div class=\"b-currency\" :aria-label=\"formattedCurrencyParts.formattedCurrency\">\n <bento-typography v-if=\"!disableTypography\" class=\"b-currency__amount\" el=\"span\" variant=\"body\" strong>\n <bento-typography el=\"span\" :strongest=\"strongerAmount\">{{\n formattedCurrencyParts.currencyNumber\n }}</bento-typography>\n <span>{{ formattedCurrencyCode }}</span>\n </bento-typography>\n\n <template v-else>{{ formattedCurrencyParts.formattedCurrency }}</template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, useSlots } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { useBentoCurrency } from '@/composables/use-bento-currency/use-bento-currency';\n import { deprecate } from '@/utils/ts/deprecate';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { BentoCurrencyISOCode, type BentoCurrencyProps } from './currency.types';\n\n const slots = useSlots();\n\n const props = defineProps({\n currency: { default: BentoCurrencyISOCode.EUR },\n disableTypography: { type: Boolean, default: false },\n majorUnits: { type: Boolean, default: false },\n value: { default: undefined },\n currencySign: { default: 'standard' },\n strongerAmount: { type: Boolean }\n});\n\n const { formatCurrencyParts } = useBentoCurrency();\n\n const formattedCurrencyParts = computed(() => {\n const rawCurrencyValue = props.value ?? getSlotText(slots)('default');\n\n return formatCurrencyParts(rawCurrencyValue, {\n currency: props.currency,\n currencySign: props.currencySign,\n majorUnits: props.majorUnits,\n });\n });\n const formattedCurrencyCode = computed(() => `\\u00A0${formattedCurrencyParts.value.currencyCode}`);\n\n onMounted(() => {\n if (getSlotText(slots)('default')) {\n deprecate(\n 'BentoCurrency \"default\" slot',\n `The use of \"default\" slot in \"BentoCurrency\" is no longer supported as it causes issues with dynamic content.\n Use the \"value\" property instead.\n <bento-currency :value=\"12345.67\" currency=\"USD\" major-units=\"false\" />`,\n '2.0.0'\n );\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * A Currency component is used to display a formatted currency value.\n *\n * @example\n * import { BentoCurrency, BentoCurrencyISOCode } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCurrency },\n * template: `\n * <bento-currency\n * :currency=\"BentoCurrencyISOCode.USD\"\n * :value=\"76.33\"\n * />\n * `\n * }\n */\n export default {\n name: 'bento-currency',\n i18n: {}, // required to enable E2E to run as they do not have vue-i18n set up\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./currency.scss\" />\n"],"names":["currencyMap","getNonStandardCurrency","currency","item","getMinorUnitDigits","exception","getNormalizedAmount","amount","DEFAULT_CURRENCY","useBentoCurrency","n","useI18n","DEFAULT_CURRENCY_SIGN","getCurrencyFormatDetails","formatOptions","targetCurrency","parsedValue","printDevelopmentWarning","normalizedAmount","fractionDigits","_a","localizedCurrencyString","isoCodeRegex","formatCurrency","formatCurrencyParts","currencyNumber","currencyCode","BentoCurrencyISOCode","BentoCurrencyISOCode2","__default__","slots","useSlots","formattedCurrencyParts","computed","rawCurrencyValue","props","getSlotText","formattedCurrencyCode","onMounted","deprecate"],"mappings":";;;;;;AAWO,MAAAA,IAAA;AAAA,EAAwC;AAAA,IAC3C,UAAA;AAAA,IACc,YAAA;AAAA,MACE;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACA;AAAA,EACJ;AAAA,EACJ;AAAA,IACA,UAAA;AAAA,IACc,YAAA,CAAA,KAAA;AAAA,EACQ;AAAA,EACtB;AAAA,IACA,UAAA;AAAA,IACc,YAAA,CAAA,OAAA,OAAA,OAAA,OAAA,OAAA,OAAA,KAAA;AAAA,EACkD;AAEpE,GClCOC,IAAA,CAAAC,MAAAF,EAAA,KAAA,CAAAG,MAAAA,EAAA,WAAA,SAAAD,CAAA,CAAA;AAcA,SAAAE,EAAAF,GAAA;AACH,QAAAG,IAAAJ,EAAAC,CAAA;AAEA,UAAAG,KAAA,gBAAAA,EAAA,aAAA;AACJ;AASO,MAAAC,IAAA,CAAAC,GAAAL,MAAAK,IAAA,MAAAH,EAAAF,CAAA,GCLPM,IAAA;AAuBO,SAAAC,IAAA;AACH,QAAA,EAAA,GAAAC,EAAA,IAAAC,EAAA,GAEAC,IAAA,YAWAC,IAAA,CAAAN,GAAAO,MAAA;;AAII,UAAAC,KAAAD,KAAA,gBAAAA,EAAA,aAAAN,GAGAQ,IAAA,OAAAT,CAAA,KAAA;AAEA,IAAA,MAAA,OAAAA,CAAA,CAAA,KACIU;AAAA,MAAA;AA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EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OAzKQA,IAAAD,KAAA,CAAA,CAAA;ACqCR,MAAAE,IAAA;AAAA,EAAe,MAAA;AAAA,EACL,MAAA,CAAA;AAAA;AAEV;;;;;;;;;;;iBAzDAC,IAAAC,EAAA,GAWA,EAAA,qBAAAP,EAAA,IAAAf,EAAA,GAEAuB,IAAAC,EAAA,MAAA;AACI,YAAAC,IAAAC,EAAA,SAAAC,EAAAN,CAAA,EAAA,SAAA;AAEA,aAAAN,EAAAU,GAAA;AAAA,QAA6C,UAAAC,EAAA;AAAA,QACzB,cAAAA,EAAA;AAAA,QACI,YAAAA,EAAA;AAAA,MACF,CAAA;AAAA,IACrB,CAAA,GAELE,IAAAJ,EAAA,MAAA,IAAAD,EAAA,MAAA,YAAA,EAAA;AAEA,WAAAM,EAAA,MAAA;AACI,MAAAF,EAAAN,CAAA,EAAA,SAAA,KACIS;AAAA,QAAA;AAAA,QACI;AAAA;AAAA;AAAA,QACA;AAAA,MAGA;AAAA,IAER,CAAA;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"currency.POwX-Trj.js","sources":["../../src/utils/ts/currency/currency-map.ts","../../src/utils/ts/currency/currency.ts","../../src/composables/use-bento-currency/use-bento-currency.ts","../../src/components/currency/currency.types.ts","../../src/components/currency/currency.vue"],"sourcesContent":["export interface CurrencyMap {\n exponent: number;\n currencies: Array<string>;\n}\n\n/**\n * Contains mapping configuration between currency code and exponent for amount in the corresponding currency.\n * https://docs.adyen.com/development-resources/currency-codes\n *\n * @internal\n */\nexport const currencyMap: Array<CurrencyMap> = [\n {\n exponent: 0,\n currencies: [\n 'CVE',\n 'DJF',\n 'GNF',\n 'IDR',\n 'JPY',\n 'KMF',\n 'KRW',\n 'PYG',\n 'RWF',\n 'UGX',\n 'VND',\n 'VUV',\n 'XAF',\n 'XOF',\n 'XPF',\n ],\n },\n {\n exponent: 1,\n currencies: ['MRO'],\n },\n {\n exponent: 3,\n currencies: ['BHD', 'IQD', 'JOD', 'KWD', 'LYD', 'OMR', 'TND'],\n },\n];\n","import { currencyMap, type CurrencyMap } from './currency-map';\nimport { type CurrencyAmount } from './currency.types';\n\n/**\n * Returns exponent for specified currency code that do not adhere to the ISO 4217 standard.\n */\nexport const getNonStandardCurrency = (currency: string): CurrencyMap =>\n currencyMap.find(item => item.currencies.includes(currency));\n\n/**\n * Returns the number of minor units (decimal places) for a given currency.\n * The function uses an internal map for currencies with non-standard decimal places and defaults to 2 for all others.\n *\n * @param currency - The three-letter ISO 4217 currency code (e.g., 'USD', 'JPY').\n * @returns The number of decimal places for the currency.\n *\n * @example\n * getMinorUnitDigits('USD'); // Returns 2\n * getMinorUnitDigits('JPY'); // Returns 0\n */\nexport function getMinorUnitDigits(currency: string): number {\n const exception = getNonStandardCurrency(currency);\n\n return exception?.exponent ?? 2;\n}\n\n/**\n * Converts a currency amount from minor units to major units.\n *\n * @param amount The amount in minor units (e.g., cents).\n * @param currency The three-letter ISO 4217 currency code.\n * @returns The amount in major units (e.g., dollars).\n */\nexport const getNormalizedAmount = (amount: CurrencyAmount['value'], currency: string) =>\n amount / 10 ** getMinorUnitDigits(currency);\n","import { getMinorUnitDigits, getNonStandardCurrency, getNormalizedAmount } from '@/utils/ts/currency';\nimport { useI18n } from '@/utils/ts/i18n';\nimport { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\nimport { type BentoCurrencyISOCode } from '../../components/currency/currency.types';\n\nexport interface UseBentoCurrencyFormatCurrencyOptions {\n currency?: `${BentoCurrencyISOCode}`;\n currencySign?: Intl.NumberFormatOptions['currencySign'];\n majorUnits?: boolean;\n}\n\nexport interface UseBentoCurrencyParts {\n /**\n * The localized number portion of the formatted currency.\n */\n currencyNumber: string;\n\n /**\n * The ISO currency code used for formatting.\n */\n currencyCode: string;\n\n /**\n * The complete formatted currency string.\n */\n formattedCurrency: string;\n}\n\nconst DEFAULT_CURRENCY = 'USD';\n\n/**\n * A composable that returns a fully formatted and localized currency string.\n * It enforces the format `[localized number][non-breaking space][ISO code]`.\n *\n * @remarks\n * The formatting process involves several steps:\n * 1. It safely resolves the input `value`, whether it's from a prop or a slot, into a valid number.\n *\n * 2. If `majorUnits` is false, it converts the amount from minor units to major units\n * (e.g., cents to dollars) by dividing by 10 to the power of the currency's\n * decimal places (the \"exponent\"). For example, `12345 / (10 ** 2)` becomes `123.45`.\n *\n * 3. It determines the correct number of decimal places, respecting any non-standard\n * currency exceptions.\n *\n * 4. It uses `vue-i18n` to format the number with the correct sign placement and decimal/thousand\n * separators for the current locale, then manually reconstructs the string to ensure\n * the ISO code is always at the end.\n *\n * @returns An object with a function to format the currency string.\n */\nexport function useBentoCurrency() {\n const { n } = useI18n();\n\n const DEFAULT_CURRENCY_SIGN = 'standard';\n\n /**\n * Resolves the shared formatting details used by currency string and currency parts formatters.\n *\n * @param amount The numeric value to be formatted. If `formatOptions.majorUnits` is `false` or undefined,\n * this value is treated as being in the currency's minor units (e.g., cents).\n * @param formatOptions An optional object containing options for currency formatting.\n *\n * @returns The localized number and ISO currency code.\n */\n const getCurrencyFormatDetails = (\n amount: string | number,\n formatOptions?: UseBentoCurrencyFormatCurrencyOptions\n ) => {\n const targetCurrency = formatOptions?.currency ?? DEFAULT_CURRENCY;\n\n // Parse and Fallback\n const parsedValue = Number(amount) || 0;\n\n if (isNaN(Number(amount))) {\n printDevelopmentWarning(\n 'The value provided is not a valid string with numbers or valid number. Falling back to 0.'\n );\n }\n\n // Normalize Amount\n const normalizedAmount = formatOptions?.majorUnits\n ? parsedValue\n : getNormalizedAmount(parsedValue, targetCurrency);\n\n // Determine Precision\n const fractionDigits = getNonStandardCurrency(targetCurrency)?.exponent ?? getMinorUnitDigits(targetCurrency);\n\n // Format with Locale\n const localizedCurrencyString = n(normalizedAmount, {\n style: 'currency',\n currency: targetCurrency,\n currencySign: formatOptions?.currencySign ?? DEFAULT_CURRENCY_SIGN,\n currencyDisplay: 'code',\n minimumFractionDigits: fractionDigits,\n maximumFractionDigits: fractionDigits,\n });\n\n // Enforce Standard Format: `[number][nbsp][code]`\n const isoCodeRegex = new RegExp(`\\\\s*${targetCurrency}\\\\s*`);\n const numberPart = localizedCurrencyString.replace(isoCodeRegex, '');\n\n return {\n currencyNumber: numberPart,\n currencyCode: targetCurrency,\n };\n };\n\n /**\n * Formats a given amount into a localized currency string with a specific structure.\n *\n * This function ensures that the output format is always `[localized number][non-breaking space][ISO code]`,\n * providing a consistent and predictable currency representation across different locales.\n *\n * @param amount The numeric value to be formatted. If `formatOptions.majorUnits` is `false` or undefined,\n * this value is treated as being in the currency's minor units (e.g., cents).\n * @param formatOptions An optional object containing options for currency formatting.\n * - `currency`: The 3-letter ISO currency code (e.g., `'USD'`, `'EUR'`). Defaults to `'USD'`.\n * - `currencySign`: The currency sign to use. Can be `'standard'` or `'accounting'`. Defaults to `'standard'`. In `accounting` mode, negative values are typically wrapped in parentheses.\n * - `majorUnits`: Set to `true` if the `amount` is already in major units (e.g., dollars instead of cents). Defaults to `false`.\n *\n * @returns A fully formatted and localized currency string (e.g., \"1,234.56 EUR\").\n */\n const formatCurrency = (amount: string | number, formatOptions?: UseBentoCurrencyFormatCurrencyOptions): string =>\n formatCurrencyParts(amount, formatOptions).formattedCurrency;\n /**\n * Formats a given amount into separate currency parts for consumers that need custom markup.\n *\n * This function reuses the shared currency formatting details to keep parsing, normalization, precision, locale formatting,\n * and final string construction aligned with the standard currency formatter.\n *\n * @param amount The numeric value to be formatted. If `formatOptions.majorUnits` is `false` or undefined,\n * this value is treated as being in the currency's minor units (e.g., cents).\n * @param formatOptions An optional object containing options for currency formatting.\n *\n * @returns The localized number, ISO currency code, and complete formatted currency string.\n */\n const formatCurrencyParts = (\n amount: string | number,\n formatOptions?: UseBentoCurrencyFormatCurrencyOptions\n ): UseBentoCurrencyParts => {\n const { currencyNumber, currencyCode } = getCurrencyFormatDetails(amount, formatOptions);\n\n return {\n currencyNumber,\n currencyCode,\n formattedCurrency: `${currencyNumber}\\u00A0${currencyCode}`,\n };\n };\n\n return {\n formatCurrency,\n formatCurrencyParts,\n };\n}\n","export interface BentoCurrencyProps {\n /**\n * Currency code based on the ISO 4217 standard\n */\n currency?: BentoCurrencyISOCode | `${BentoCurrencyISOCode}`;\n\n /**\n * Disable the default typography for the component. Only use this when the component is inside another typography component.\n */\n disableTypography?: boolean;\n\n /**\n * Accepts currency value in major units instead of minor ones\n */\n majorUnits?: boolean;\n\n /**\n * Currency value to be formatted\n */\n value?: number;\n\n /**\n * Determines how the currency symbol and negative values are displayed.\n * This is only applicable to certain countries such as `en-US`.\n *\n * - `'standard'`: Default format (e.g., `-1,234.56 USD`).\n * - `'accounting'`: Uses accounting conventions, such as wrapping negative numbers in parentheses (e.g., `(1,234.56) USD`).\n *\n * @default 'standard'\n */\n currencySign?: Intl.NumberFormatOptions['currencySign'];\n\n /**\n * Makes only the numeric part of the formatted currency bold.\n */\n strongerAmount?: boolean;\n}\n\nexport enum BentoCurrencyISOCode {\n AED = 'AED',\n AFA = 'AFA',\n ALL = 'ALL',\n AMD = 'AMD',\n ANG = 'ANG',\n AOA = 'AOA',\n ARS = 'ARS',\n AUD = 'AUD',\n AWG = 'AWG',\n AZN = 'AZN',\n BAM = 'BAM',\n BBD = 'BBD',\n BDT = 'BDT',\n BEF = 'BEF',\n BGN = 'BGN',\n BHD = 'BHD',\n BIF = 'BIF',\n BMD = 'BMD',\n BND = 'BND',\n BOB = 'BOB',\n BRL = 'BRL',\n BSD = 'BSD',\n BTC = 'BTC',\n BTN = 'BTN',\n BWP = 'BWP',\n BYR = 'BYR',\n BZD = 'BZD',\n CAD = 'CAD',\n CDF = 'CDF',\n CHF = 'CHF',\n CLF = 'CLF',\n CLP = 'CLP',\n CNY = 'CNY',\n COP = 'COP',\n CRC = 'CRC',\n CUC = 'CUC',\n CVE = 'CVE',\n CZK = 'CZK',\n DEM = 'DEM',\n DJF = 'DJF',\n DKK = 'DKK',\n DOP = 'DOP',\n DZD = 'DZD',\n EEK = 'EEK',\n EGP = 'EGP',\n ERN = 'ERN',\n ETB = 'ETB',\n EUR = 'EUR',\n FJD = 'FJD',\n FKP = 'FKP',\n GBP = 'GBP',\n GEL = 'GEL',\n GHS = 'GHS',\n GIP = 'GIP',\n GMD = 'GMD',\n GNF = 'GNF',\n GRD = 'GRD',\n GTQ = 'GTQ',\n GYD = 'GYD',\n HKD = 'HKD',\n HNL = 'HNL',\n HRK = 'HRK',\n HTG = 'HTG',\n HUF = 'HUF',\n IDR = 'IDR',\n ILS = 'ILS',\n INR = 'INR',\n IQD = 'IQD',\n IRR = 'IRR',\n ISK = 'ISK',\n ITL = 'ITL',\n JMD = 'JMD',\n JOD = 'JOD',\n JPY = 'JPY',\n KES = 'KES',\n KGS = 'KGS',\n KHR = 'KHR',\n KMF = 'KMF',\n KPW = 'KPW',\n KRW = 'KRW',\n KWD = 'KWD',\n KYD = 'KYD',\n KZT = 'KZT',\n LAK = 'LAK',\n LBP = 'LBP',\n LKR = 'LKR',\n LRD = 'LRD',\n LSL = 'LSL',\n LTC = 'LTC',\n LTL = 'LTL',\n LVL = 'LVL',\n LYD = 'LYD',\n MAD = 'MAD',\n MDL = 'MDL',\n MGA = 'MGA',\n MKD = 'MKD',\n MMK = 'MMK',\n MNT = 'MNT',\n MOP = 'MOP',\n MRO = 'MRO',\n MRU = 'MRU',\n MUR = 'MUR',\n MVR = 'MVR',\n MWK = 'MWK',\n MXN = 'MXN',\n MYR = 'MYR',\n MZM = 'MZM',\n NAD = 'NAD',\n NGN = 'NGN',\n NIO = 'NIO',\n NOK = 'NOK',\n NPR = 'NPR',\n NZD = 'NZD',\n OMR = 'OMR',\n PAB = 'PAB',\n PEN = 'PEN',\n PGK = 'PGK',\n PHP = 'PHP',\n PKR = 'PKR',\n PLN = 'PLN',\n PYG = 'PYG',\n QAR = 'QAR',\n RON = 'RON',\n RSD = 'RSD',\n RUB = 'RUB',\n RWF = 'RWF',\n SAR = 'SAR',\n SBD = 'SBD',\n SCR = 'SCR',\n SDG = 'SDG',\n SEK = 'SEK',\n SGD = 'SGD',\n SHP = 'SHP',\n SKK = 'SKK',\n SLL = 'SLL',\n SOS = 'SOS',\n SRD = 'SRD',\n SSP = 'SSP',\n STD = 'STD',\n SVC = 'SVC',\n SYP = 'SYP',\n SZL = 'SZL',\n THB = 'THB',\n TJS = 'TJS',\n TMT = 'TMT',\n TND = 'TND',\n TOP = 'TOP',\n TRY = 'TRY',\n TTD = 'TTD',\n TWD = 'TWD',\n TZS = 'TZS',\n UAH = 'UAH',\n UGX = 'UGX',\n USD = 'USD',\n UYU = 'UYU',\n UZS = 'UZS',\n VEF = 'VEF',\n VND = 'VND',\n VUV = 'VUV',\n WST = 'WST',\n XAF = 'XAF',\n XCD = 'XCD',\n XDR = 'XDR',\n XOF = 'XOF',\n XPF = 'XPF',\n YER = 'YER',\n ZAR = 'ZAR',\n ZMK = 'ZMK',\n ZWL = 'ZWL',\n}\n","<template>\n <div class=\"b-currency\" :aria-label=\"formattedCurrencyParts.formattedCurrency\">\n <bento-typography v-if=\"!disableTypography\" class=\"b-currency__amount\" el=\"span\" variant=\"body\" strong>\n <bento-typography el=\"span\" :strongest=\"strongerAmount\">{{\n formattedCurrencyParts.currencyNumber\n }}</bento-typography>\n <span>{{ formattedCurrencyCode }}</span>\n </bento-typography>\n\n <template v-else>{{ formattedCurrencyParts.formattedCurrency }}</template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, useSlots } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { useBentoCurrency } from '@/composables/use-bento-currency/use-bento-currency';\n import { deprecate } from '@/utils/ts/deprecate';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { BentoCurrencyISOCode, type BentoCurrencyProps } from './currency.types';\n\n const slots = useSlots();\n\n const props = defineProps({\n currency: { default: BentoCurrencyISOCode.EUR },\n disableTypography: { type: Boolean, default: false },\n majorUnits: { type: Boolean, default: false },\n value: { default: undefined },\n currencySign: { default: 'standard' },\n strongerAmount: { type: Boolean }\n});\n\n const { formatCurrencyParts } = useBentoCurrency();\n\n const formattedCurrencyParts = computed(() => {\n const rawCurrencyValue = props.value ?? getSlotText(slots)('default');\n\n return formatCurrencyParts(rawCurrencyValue, {\n currency: props.currency,\n currencySign: props.currencySign,\n majorUnits: props.majorUnits,\n });\n });\n const formattedCurrencyCode = computed(() => `\\u00A0${formattedCurrencyParts.value.currencyCode}`);\n\n onMounted(() => {\n if (getSlotText(slots)('default')) {\n deprecate(\n 'BentoCurrency \"default\" slot',\n `The use of \"default\" slot in \"BentoCurrency\" is no longer supported as it causes issues with dynamic content.\n Use the \"value\" property instead.\n <bento-currency :value=\"12345.67\" currency=\"USD\" major-units=\"false\" />`,\n '2.0.0'\n );\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * A Currency component is used to display a formatted currency value.\n *\n * @example\n * import { BentoCurrency, BentoCurrencyISOCode } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCurrency },\n * template: `\n * <bento-currency\n * :currency=\"BentoCurrencyISOCode.USD\"\n * :value=\"76.33\"\n * />\n * `\n * }\n */\n export default {\n name: 'bento-currency',\n i18n: {}, // required to enable E2E to run as they do not have vue-i18n set up\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./currency.scss\" />\n"],"names":["currencyMap","getNonStandardCurrency","currency","item","getMinorUnitDigits","getNormalizedAmount","amount","DEFAULT_CURRENCY","useBentoCurrency","n","useI18n","DEFAULT_CURRENCY_SIGN","getCurrencyFormatDetails","formatOptions","targetCurrency","parsedValue","printDevelopmentWarning","normalizedAmount","fractionDigits","localizedCurrencyString","isoCodeRegex","formatCurrency","formatCurrencyParts","currencyNumber","currencyCode","BentoCurrencyISOCode","BentoCurrencyISOCode2","__default__","slots","useSlots","formattedCurrencyParts","computed","rawCurrencyValue","props","getSlotText","formattedCurrencyCode","onMounted","deprecate"],"mappings":";;;;;;AAWO,MAAAA,IAAA;AAAA,EAAwC;AAAA,IAC3C,UAAA;AAAA,IACc,YAAA;AAAA,MACE;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACA;AAAA,EACJ;AAAA,EACJ;AAAA,IACA,UAAA;AAAA,IACc,YAAA,CAAA,KAAA;AAAA,EACQ;AAAA,EACtB;AAAA,IACA,UAAA;AAAA,IACc,YAAA,CAAA,OAAA,OAAA,OAAA,OAAA,OAAA,OAAA,KAAA;AAAA,EACkD;AAEpE,GClCOC,IAAA,CAAAC,MAAAF,EAAA,KAAA,CAAAG,MAAAA,EAAA,WAAA,SAAAD,CAAA,CAAA;AAcA,SAAAE,EAAAF,GAAA;AAGH,SAFAD,EAAAC,CAAA,GAEA,YAAA;AACJ;AASO,MAAAG,IAAA,CAAAC,GAAAJ,MAAAI,IAAA,MAAAF,EAAAF,CAAA,GCLPK,IAAA;AAuBO,SAAAC,IAAA;AACH,QAAA,EAAA,GAAAC,EAAA,IAAAC,EAAA,GAEAC,IAAA,YAWAC,IAAA,CAAAN,GAAAO,MAAA;AAII,UAAAC,IAAAD,GAAA,YAAAN,GAGAQ,IAAA,OAAAT,CAAA,KAAA;AAEA,IAAA,MAAA,OAAAA,CAAA,CAAA,KACIU;AAAA,MAAA;AAAA,IACI;AAKR,UAAAC,IAAAJ,GAAA,aAAAE,IAAAV,EAAAU,GAAAD,CAAA,GAKAI,IAAAjB,EAAAa,CAAA,GAAA,YAAAV,EAAAU,CAAA,GAGAK,IAAAV,EAAAQ,GAAA;AAAA,MAAoD,OAAA;AAAA,MACzC,UAAAH;AAAA,MACG,cAAAD,GAAA,gBA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,CAAA;ACqCR,MAAAE,IAAA;AAAA,EAAe,MAAA;AAAA,EACL,MAAA,CAAA;AAAA;AAEV;;;;;;;;;;;iBAzDAC,IAAAC,EAAA,GAWA,EAAA,qBAAAP,EAAA,IAAAd,EAAA,GAEAsB,IAAAC,EAAA,MAAA;AACI,YAAAC,IAAAC,EAAA,SAAAC,EAAAN,CAAA,EAAA,SAAA;AAEA,aAAAN,EAAAU,GAAA;AAAA,QAA6C,UAAAC,EAAA;AAAA,QACzB,cAAAA,EAAA;AAAA,QACI,YAAAA,EAAA;AAAA,MACF,CAAA;AAAA,IACrB,CAAA,GAELE,IAAAJ,EAAA,MAAA,IAAAD,EAAA,MAAA,YAAA,EAAA;AAEA,WAAAM,EAAA,MAAA;AACI,MAAAF,EAAAN,CAAA,EAAA,SAAA,KACIS;AAAA,QAAA;AAAA,QACI;AAAA;AAAA;AAAA,QACA;AAAA,MAGA;AAAA,IAER,CAAA;;;;;;;;;;;;;;;"}
@@ -0,0 +1,98 @@
1
+ import { defineComponent as h, useSlots as m, ref as _, computed as o, watch as p, onUnmounted as g, onMounted as w } from "vue";
2
+ import { B as v } from "./header.DUAxdw_d.js";
3
+ import { a as $, B as I } from "./tab.DFk4K9cq.js";
4
+ import { a as R } from "./index.CL3TXc0a.js";
5
+ import { o as x } from "./resize.Bqks3WUm.js";
6
+ import { u as C } from "./use-has-slot.C9lQZ6nz.js";
7
+ import { n as y } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
8
+ import { B as H } from "./divider.DX5gwN7p.js";
9
+ import "../assets/dashboard-section.css";
10
+ const O = {}, P = /* @__PURE__ */ h({
11
+ ...O,
12
+ __name: "dashboard-template",
13
+ props: {
14
+ header: null,
15
+ tabs: { default: void 0 },
16
+ stickyTabs: { type: Boolean, default: !1 },
17
+ stickyFilters: { type: Boolean, default: !1 }
18
+ },
19
+ setup(l) {
20
+ const t = l, e = m(), s = C(e), i = _(), a = _(null), b = _(!1);
21
+ let r = null;
22
+ const c = _(0), d = o(() => a.value && t.stickyFilters), f = o(() => i.value && t.stickyTabs), T = o(() => ({
23
+ "b-dashboard-template__filters--sticky": t.stickyFilters,
24
+ "b-dashboard-template__filters--show-border": d.value && !f.value && b.value
25
+ })), S = o(() => ({
26
+ "b-dashboard-template__top-section--sticky": t.stickyTabs || t.stickyFilters
27
+ })), k = o(() => Object.keys(e).filter((n) => n?.includes("tab-"))), B = (n) => t?.tabs.tabs?.[n]?.title ?? `Tab ${n + 1}`, F = o(() => c.value ? { top: c.value } : void 0), { y: u } = R();
28
+ return p(
29
+ () => a.value,
30
+ () => {
31
+ !r && a.value && (r = x(a.value, () => {
32
+ if (a.value && f.value) {
33
+ const n = a.value.offsetHeight;
34
+ c.value = d.value ? n : 0;
35
+ }
36
+ }));
37
+ }
38
+ ), p(
39
+ () => u.value,
40
+ () => {
41
+ d.value && (b.value = a.value?.getBoundingClientRect().top === 0);
42
+ }
43
+ ), g(() => {
44
+ r?.disconnect();
45
+ }), { __sfc: !0, props: t, slots: e, hasSlot: s, tabsRef: i, filtersRef: a, isFiltersPinned: b, filtersElementObserver: r, tabsPosition: c, hasStickyFilters: d, hasStickyTabs: f, dashboardFiltersConditionalClasses: T, dashboardTopSectionConditionalClasses: S, tabsSlots: k, getTabTitle: B, computedTabsOptions: F, y: u, BentoHeader: v, BentoTab: I, BentoTabs: $ };
46
+ }
47
+ });
48
+ var W = function() {
49
+ var t = this, e = t._self._c, s = t._self._setupProxy;
50
+ return e("main", { staticClass: "b-dashboard-template" }, [e(s.BentoHeader, t._b({ staticClass: "b-dashboard-template__header", attrs: { variant: "page" }, scopedSlots: t._u([s.hasSlot("infoIconTooltipContent") ? { key: "infoIconTooltipContent", fn: function() {
51
+ return [t._t("infoIconTooltipContent")];
52
+ }, proxy: !0 } : null], null, !0) }, "bento-header", t.header, !1)), e("div", { staticClass: "b-dashboard-template__top-section", class: s.dashboardTopSectionConditionalClasses }, [s.hasSlot("filters") ? e("div", { ref: "filtersRef", staticClass: "b-dashboard-template__filters", class: s.dashboardFiltersConditionalClasses, attrs: { "data-testid": "filters" } }, [t._t("filters")], 2) : t._e(), s.tabsSlots.length > 1 ? e(s.BentoTabs, { ref: "tabsRef", attrs: { "active-tab-index": t.tabs.activeTabIndex, sticky: t.stickyTabs, "sticky-options": s.computedTabsOptions, "data-testid": "tabs" } }, t._l(s.tabsSlots, function(i, a) {
53
+ return e(s.BentoTab, { key: `tab-${a}`, attrs: { title: s.getTabTitle(a) } }, [e("div", { staticClass: "b-dashboard-template__container b-dashboard-template__container--tabs" }, [t._t(`tab-${a + 1}`)], 2)]);
54
+ }), 1) : e("div", { staticClass: "b-dashboard-template__container" }, [t._t("default")], 2)], 1)], 1);
55
+ }, E = [], z = /* @__PURE__ */ y(
56
+ P,
57
+ W,
58
+ E,
59
+ !1,
60
+ null,
61
+ "075794ed"
62
+ );
63
+ const X = z.exports, D = {}, j = /* @__PURE__ */ h({
64
+ ...D,
65
+ __name: "dashboard-section",
66
+ props: {
67
+ header: null,
68
+ halfWidth: { type: Boolean, default: !1 }
69
+ },
70
+ setup(l) {
71
+ const t = l, e = m(), s = C(e), i = o(() => ({
72
+ "b-dashboard-section--half-width": t.halfWidth
73
+ }));
74
+ return w(() => {
75
+ if ((s("content-col-1") || s("content-col-2")) && t.halfWidth)
76
+ throw new Error("`content-col-1` and `content-col-2` cannot be used with half-width prop");
77
+ }), { __sfc: !0, props: t, slots: e, hasSlot: s, conditionalClasses: i, BentoHeader: v, BentoDivider: H };
78
+ }
79
+ });
80
+ var M = function() {
81
+ var t = this, e = t._self._c, s = t._self._setupProxy;
82
+ return e("div", { staticClass: "b-dashboard-section", class: s.conditionalClasses }, [e(s.BentoHeader, t._b({ staticClass: "b-dashboard-template__header", attrs: { variant: "component" }, scopedSlots: t._u([s.hasSlot("infoIconTooltipContent") ? { key: "infoIconTooltipContent", fn: function() {
83
+ return [t._t("infoIconTooltipContent")];
84
+ }, proxy: !0 } : null], null, !0) }, "bento-header", t.header, !1)), s.hasSlot("controls") ? e("div", { staticClass: "b-dashboard-section__controls" }, [t._t("controls")], 2) : t._e(), !s.hasSlot("content-col-1") && !s.hasSlot("content-col-2") ? e("div", { staticClass: "b-dashboard-section__content" }, [t._t("default")], 2) : e("div", { staticClass: "b-dashboard-section__columns" }, [e("div", { staticClass: "b-dashboard-section__content" }, [t._t("content-col-1")], 2), e("div", { staticClass: "b-dashboard-section__content" }, [t._t("content-col-2")], 2)]), e(s.BentoDivider, { staticClass: "b-dashboard-section__divider" })], 1);
85
+ }, U = [], q = /* @__PURE__ */ y(
86
+ j,
87
+ M,
88
+ U,
89
+ !1,
90
+ null,
91
+ "df6a2511"
92
+ );
93
+ const Y = q.exports;
94
+ export {
95
+ X as a,
96
+ Y as d
97
+ };
98
+ //# sourceMappingURL=dashboard-section.Bmu65OHg.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard-section.D2yqhERq.js","sources":["../../src/templates/dashboard-template/dashboard-template.vue","../../src/templates/dashboard-template/components/dashboard-section/dashboard-section.vue"],"sourcesContent":["<template>\n <main class=\"b-dashboard-template\">\n <bento-header v-bind=\"header\" variant=\"page\" class=\"b-dashboard-template__header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n <div class=\"b-dashboard-template__top-section\" :class=\"dashboardTopSectionConditionalClasses\">\n <div\n v-if=\"hasSlot('filters')\"\n ref=\"filtersRef\"\n class=\"b-dashboard-template__filters\"\n :class=\"dashboardFiltersConditionalClasses\"\n data-testid=\"filters\"\n >\n <slot name=\"filters\" />\n </div>\n\n <bento-tabs\n v-if=\"tabsSlots.length > 1\"\n ref=\"tabsRef\"\n :active-tab-index=\"tabs.activeTabIndex\"\n :sticky=\"stickyTabs\"\n :sticky-options=\"computedTabsOptions\"\n data-testid=\"tabs\"\n >\n <bento-tab v-for=\"(_item, index) in tabsSlots\" :key=\"`tab-${index}`\" :title=\"getTabTitle(index)\">\n <div class=\"b-dashboard-template__container b-dashboard-template__container--tabs\">\n <slot :name=\"`tab-${index + 1}`\" />\n </div>\n </bento-tab>\n </bento-tabs>\n <div v-else class=\"b-dashboard-template__container\">\n <slot />\n </div>\n </div>\n </main>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onUnmounted, ref, useSlots, watch } from 'vue';\n import { BentoHeader } from '@/components/header';\n import { BentoTab, BentoTabs } from '@/components/tabs';\n import { useWindowScroll } from '@vueuse/core';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useHasSlot } from '@/composables';\n import type { BentoDashboardTemplateHeader, BentoDashboardTemplateTabs } from './dashboard-template.types';\n\n const props = defineProps({\n header: null,\n tabs: { default: undefined },\n stickyTabs: { type: Boolean, default: false },\n stickyFilters: { type: Boolean, default: false }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const tabsRef = ref<InstanceType<typeof BentoTabs>>();\n const filtersRef = ref<HTMLDivElement>(null);\n const isFiltersPinned = ref(false);\n let filtersElementObserver: ResizeObserver | null = null;\n const tabsPosition = ref(0);\n\n const hasStickyFilters = computed(() => filtersRef.value && props.stickyFilters);\n const hasStickyTabs = computed(() => tabsRef.value && props.stickyTabs);\n\n const dashboardFiltersConditionalClasses = computed(() => ({\n 'b-dashboard-template__filters--sticky': props.stickyFilters,\n 'b-dashboard-template__filters--show-border':\n hasStickyFilters.value && !hasStickyTabs.value && isFiltersPinned.value,\n }));\n\n const dashboardTopSectionConditionalClasses = computed(() => ({\n 'b-dashboard-template__top-section--sticky': props.stickyTabs || props.stickyFilters,\n }));\n\n const tabsSlots = computed(() => Object.keys(slots).filter(el => el?.includes('tab-')));\n\n const getTabTitle = (index: number) => props?.tabs.tabs?.[index]?.title ?? `Tab ${index + 1}`;\n\n const computedTabsOptions = computed(() => (tabsPosition.value ? { top: tabsPosition.value } : undefined));\n\n const { y } = useWindowScroll();\n\n watch(\n () => filtersRef.value,\n () => {\n if (!filtersElementObserver && filtersRef.value) {\n filtersElementObserver = observeSizeOfElement(filtersRef.value, () => {\n if (filtersRef.value && hasStickyTabs.value) {\n const filtersHeight = filtersRef.value.offsetHeight;\n tabsPosition.value = hasStickyFilters.value ? filtersHeight : 0;\n }\n });\n }\n }\n );\n\n watch(\n () => y.value,\n () => {\n if (hasStickyFilters.value) {\n isFiltersPinned.value = filtersRef.value?.getBoundingClientRect().top === 0;\n }\n }\n );\n\n onUnmounted(() => {\n filtersElementObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Dashboard template is a full page template used to visualize data on pages such as data dashboards and reports.\n *\n * @example\n * import { BentoDashboardTemplate, BentoDashboardSection } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDashboardTemplate, BentoDashboardSection },\n * template: `\n * <bento-dashboard-template :header=\"{ title: 'Dashboard'}\" :tabs=\"tabs: [{ title: 'Tab 1' }, { title: 'Tab 2' }]\" sticky-tabs sticky-filters>\n * <template #tab-1>\n * <bento-dashboard-section :header=\"{ title: 'Section'}\">\n * <template #controls>\n * // Add your controls here\n * </template>\n * // Add your content here\n * </bento-dashboard-section>\n * </template>\n * <template #tab-2>\n * <bento-dashboard-section :header=\"{ title: 'Section'}\">\n * // Add your content here\n * </bento-dashboard-section>\n * </template>\n * </bento-dashboard-template>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./dashboard-template.scss\" />\n","<template>\n <div class=\"b-dashboard-section\" :class=\"conditionalClasses\">\n <bento-header v-bind=\"header\" variant=\"component\" class=\"b-dashboard-template__header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n <div v-if=\"hasSlot('controls')\" class=\"b-dashboard-section__controls\">\n <slot name=\"controls\"></slot>\n </div>\n <div v-if=\"!hasSlot('content-col-1') && !hasSlot('content-col-2')\" class=\"b-dashboard-section__content\">\n <slot name=\"default\"></slot>\n </div>\n <div v-else class=\"b-dashboard-section__columns\">\n <div class=\"b-dashboard-section__content\"><slot name=\"content-col-1\"></slot></div>\n <div class=\"b-dashboard-section__content\"><slot name=\"content-col-2\"></slot></div>\n </div>\n <bento-divider class=\"b-dashboard-section__divider\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, useSlots } from 'vue';\n import { BentoHeader } from '@/components/header';\n import { BentoDivider } from '@/components/divider';\n import { useHasSlot } from '@/composables';\n import type { BentoDashboardTemplateHeader } from '../../dashboard-template.types';\n\n const props = defineProps({\n header: null,\n halfWidth: { type: Boolean, default: false }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const conditionalClasses = computed(() => ({\n 'b-dashboard-section--half-width': props.halfWidth,\n }));\n\n onMounted(() => {\n if ((hasSlot('content-col-1') || hasSlot('content-col-2')) && props.halfWidth) {\n throw new Error('`content-col-1` and `content-col-2` cannot be used with half-width prop');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Dashboard section is subcomponent of Dashboard template meant to be used to create the different sections within the page.\n *\n * @example\n * import { BentoDashboardSection } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDashboardSection },\n * template: `\n * <bento-dashboard-section :header=\"{ title: 'Section' }\" half-width>\n * <template #controls>\n * // Add your controls here\n * </template>\n * // You can render content with two cols\n * <template #content-col-1>\n * // Add your content here\n * </template>\n * <template #content-col-2>\n * // Add your content here\n * </template>\n * // Or you can render full width content by using default slot\n * // Add your content here\n * </bento-dashboard-section>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./dashboard-section.scss\" />\n"],"names":["__default__$1","slots","useSlots","hasSlot","useHasSlot","tabsRef","ref","filtersRef","isFiltersPinned","filtersElementObserver","tabsPosition","hasStickyFilters","computed","props","hasStickyTabs","dashboardFiltersConditionalClasses","dashboardTopSectionConditionalClasses","tabsSlots","el","getTabTitle","index","_b","_a","computedTabsOptions","y","useWindowScroll","watch","observeSizeOfElement","filtersHeight","onUnmounted","__default__","conditionalClasses","on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IACJ,GAGJF;AAAA,MAAA,MAAAF,EAAA;AAAA,MACY,MAAA;;AAEJ,QAAAb,EAAA,UACIH,EAAA,UAAAc,IAAAf,EAAA,UAAA,gBAAAe,EAAA,wBAAA,SAAA;AAAA,MACJ;AAAA,IACJ,GAGJO,EAAA,MAAA;AACI,MAAApB,KAAA,QAAAA,EAAA;AAAA,IAAmC,CAAA;;;;;;;;;;;;;;;;;;qBCnCvCqB,IAAA,CAAA;;;;;;;;iBAzCA7B,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEA8B,IAAAnB,EAAA,OAAA;AAAA,MAA2C,mCAAAC,EAAA;AAAA,IACE,EAAA;AAG7C,WAAAmB,EAAA,MAAA;AACI,WAAA7B,EAAA,eAAA,KAAAA,EAAA,eAAA,MAAAU,EAAA;AACI,cAAA,IAAA,MAAA,yEAAA;AAAA,IACJ,CAAA;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"dashboard-section.Bmu65OHg.js","sources":["../../src/templates/dashboard-template/dashboard-template.vue","../../src/templates/dashboard-template/components/dashboard-section/dashboard-section.vue"],"sourcesContent":["<template>\n <main class=\"b-dashboard-template\">\n <bento-header v-bind=\"header\" variant=\"page\" class=\"b-dashboard-template__header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n <div class=\"b-dashboard-template__top-section\" :class=\"dashboardTopSectionConditionalClasses\">\n <div\n v-if=\"hasSlot('filters')\"\n ref=\"filtersRef\"\n class=\"b-dashboard-template__filters\"\n :class=\"dashboardFiltersConditionalClasses\"\n data-testid=\"filters\"\n >\n <slot name=\"filters\" />\n </div>\n\n <bento-tabs\n v-if=\"tabsSlots.length > 1\"\n ref=\"tabsRef\"\n :active-tab-index=\"tabs.activeTabIndex\"\n :sticky=\"stickyTabs\"\n :sticky-options=\"computedTabsOptions\"\n data-testid=\"tabs\"\n >\n <bento-tab v-for=\"(_item, index) in tabsSlots\" :key=\"`tab-${index}`\" :title=\"getTabTitle(index)\">\n <div class=\"b-dashboard-template__container b-dashboard-template__container--tabs\">\n <slot :name=\"`tab-${index + 1}`\" />\n </div>\n </bento-tab>\n </bento-tabs>\n <div v-else class=\"b-dashboard-template__container\">\n <slot />\n </div>\n </div>\n </main>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onUnmounted, ref, useSlots, watch } from 'vue';\n import { BentoHeader } from '@/components/header';\n import { BentoTab, BentoTabs } from '@/components/tabs';\n import { useWindowScroll } from '@vueuse/core';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useHasSlot } from '@/composables';\n import type { BentoDashboardTemplateHeader, BentoDashboardTemplateTabs } from './dashboard-template.types';\n\n const props = defineProps({\n header: null,\n tabs: { default: undefined },\n stickyTabs: { type: Boolean, default: false },\n stickyFilters: { type: Boolean, default: false }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const tabsRef = ref<InstanceType<typeof BentoTabs>>();\n const filtersRef = ref<HTMLDivElement>(null);\n const isFiltersPinned = ref(false);\n let filtersElementObserver: ResizeObserver | null = null;\n const tabsPosition = ref(0);\n\n const hasStickyFilters = computed(() => filtersRef.value && props.stickyFilters);\n const hasStickyTabs = computed(() => tabsRef.value && props.stickyTabs);\n\n const dashboardFiltersConditionalClasses = computed(() => ({\n 'b-dashboard-template__filters--sticky': props.stickyFilters,\n 'b-dashboard-template__filters--show-border':\n hasStickyFilters.value && !hasStickyTabs.value && isFiltersPinned.value,\n }));\n\n const dashboardTopSectionConditionalClasses = computed(() => ({\n 'b-dashboard-template__top-section--sticky': props.stickyTabs || props.stickyFilters,\n }));\n\n const tabsSlots = computed(() => Object.keys(slots).filter(el => el?.includes('tab-')));\n\n const getTabTitle = (index: number) => props?.tabs.tabs?.[index]?.title ?? `Tab ${index + 1}`;\n\n const computedTabsOptions = computed(() => (tabsPosition.value ? { top: tabsPosition.value } : undefined));\n\n const { y } = useWindowScroll();\n\n watch(\n () => filtersRef.value,\n () => {\n if (!filtersElementObserver && filtersRef.value) {\n filtersElementObserver = observeSizeOfElement(filtersRef.value, () => {\n if (filtersRef.value && hasStickyTabs.value) {\n const filtersHeight = filtersRef.value.offsetHeight;\n tabsPosition.value = hasStickyFilters.value ? filtersHeight : 0;\n }\n });\n }\n }\n );\n\n watch(\n () => y.value,\n () => {\n if (hasStickyFilters.value) {\n isFiltersPinned.value = filtersRef.value?.getBoundingClientRect().top === 0;\n }\n }\n );\n\n onUnmounted(() => {\n filtersElementObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Dashboard template is a full page template used to visualize data on pages such as data dashboards and reports.\n *\n * @example\n * import { BentoDashboardTemplate, BentoDashboardSection } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDashboardTemplate, BentoDashboardSection },\n * template: `\n * <bento-dashboard-template :header=\"{ title: 'Dashboard'}\" :tabs=\"tabs: [{ title: 'Tab 1' }, { title: 'Tab 2' }]\" sticky-tabs sticky-filters>\n * <template #tab-1>\n * <bento-dashboard-section :header=\"{ title: 'Section'}\">\n * <template #controls>\n * // Add your controls here\n * </template>\n * // Add your content here\n * </bento-dashboard-section>\n * </template>\n * <template #tab-2>\n * <bento-dashboard-section :header=\"{ title: 'Section'}\">\n * // Add your content here\n * </bento-dashboard-section>\n * </template>\n * </bento-dashboard-template>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./dashboard-template.scss\" />\n","<template>\n <div class=\"b-dashboard-section\" :class=\"conditionalClasses\">\n <bento-header v-bind=\"header\" variant=\"component\" class=\"b-dashboard-template__header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n <div v-if=\"hasSlot('controls')\" class=\"b-dashboard-section__controls\">\n <slot name=\"controls\"></slot>\n </div>\n <div v-if=\"!hasSlot('content-col-1') && !hasSlot('content-col-2')\" class=\"b-dashboard-section__content\">\n <slot name=\"default\"></slot>\n </div>\n <div v-else class=\"b-dashboard-section__columns\">\n <div class=\"b-dashboard-section__content\"><slot name=\"content-col-1\"></slot></div>\n <div class=\"b-dashboard-section__content\"><slot name=\"content-col-2\"></slot></div>\n </div>\n <bento-divider class=\"b-dashboard-section__divider\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, useSlots } from 'vue';\n import { BentoHeader } from '@/components/header';\n import { BentoDivider } from '@/components/divider';\n import { useHasSlot } from '@/composables';\n import type { BentoDashboardTemplateHeader } from '../../dashboard-template.types';\n\n const props = defineProps({\n header: null,\n halfWidth: { type: Boolean, default: false }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const conditionalClasses = computed(() => ({\n 'b-dashboard-section--half-width': props.halfWidth,\n }));\n\n onMounted(() => {\n if ((hasSlot('content-col-1') || hasSlot('content-col-2')) && props.halfWidth) {\n throw new Error('`content-col-1` and `content-col-2` cannot be used with half-width prop');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Dashboard section is subcomponent of Dashboard template meant to be used to create the different sections within the page.\n *\n * @example\n * import { BentoDashboardSection } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDashboardSection },\n * template: `\n * <bento-dashboard-section :header=\"{ title: 'Section' }\" half-width>\n * <template #controls>\n * // Add your controls here\n * </template>\n * // You can render content with two cols\n * <template #content-col-1>\n * // Add your content here\n * </template>\n * <template #content-col-2>\n * // Add your content here\n * </template>\n * // Or you can render full width content by using default slot\n * // Add your content here\n * </bento-dashboard-section>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./dashboard-section.scss\" />\n"],"names":["__default__$1","slots","useSlots","hasSlot","useHasSlot","tabsRef","ref","filtersRef","isFiltersPinned","filtersElementObserver","tabsPosition","hasStickyFilters","computed","props","hasStickyTabs","dashboardFiltersConditionalClasses","dashboardTopSectionConditionalClasses","tabsSlots","el","getTabTitle","index","computedTabsOptions","y","use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AA,MAAAF,EAAA;AAAA,MACY,MAAA;AAEJ,QAAAX,EAAA,UACIH,EAAA,QAAAD,EAAA,OAAA,sBAAA,EAAA,QAAA;AAAA,MACJ;AAAA,IACJ,GAGJoB,EAAA,MAAA;AACI,MAAAlB,GAAA,WAAA;AAAA,IAAmC,CAAA;;;;;;;;;;;;;;;;;;qBCnCvCmB,IAAA,CAAA;;;;;;;;iBAzCA3B,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEA4B,IAAAjB,EAAA,OAAA;AAAA,MAA2C,mCAAAC,EAAA;AAAA,IACE,EAAA;AAG7C,WAAAiB,EAAA,MAAA;AACI,WAAA3B,EAAA,eAAA,KAAAA,EAAA,eAAA,MAAAU,EAAA;AACI,cAAA,IAAA,MAAA,yEAAA;AAAA,IACJ,CAAA;;;;;;;;;;;;;;;;;"}
@@ -1,9 +1,9 @@
1
- import { defineComponent as v, useSlots as u, ref as c, computed as l, watch as f } from "vue";
2
- import { e as m, h as _ } from "./button-actions.Dpbx0xf3.js";
1
+ import { defineComponent as v, useSlots as u, ref as c, computed as i, watch as f } from "vue";
2
+ import { e as m, h as _ } from "./button-actions.CxX7lK7z.js";
3
3
  import { u as h } from "./use-has-slot.C9lQZ6nz.js";
4
- import { B as T } from "./typography.C8lPlsbD.js";
5
- import { b as B } from "./tooltip.7ct8WxCl.js";
6
- import { u as b } from "./use-bento-delayed-hover.Bz_8EabW.js";
4
+ import { B as T } from "./typography.D1OZJbEa.js";
5
+ import { b as B } from "./tooltip.D_XsoD_u.js";
6
+ import { u as b } from "./use-bento-delayed-hover.D6QjSugc.js";
7
7
  import { n as x } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
8
8
  import "../assets/dashed-underline.css";
9
9
  const P = {}, g = /* @__PURE__ */ v({
@@ -20,10 +20,10 @@ const P = {}, g = /* @__PURE__ */ v({
20
20
  tooltipText: { default: null },
21
21
  tooltipPosition: { default: "top" }
22
22
  },
23
- setup(p) {
24
- const e = p, t = u(), o = h(t), r = c(null), { isOpen: n, hoverEvents: a } = b(), i = l(() => e.popoverText || o("popover-content")), s = l(() => !e.tooltipText && !i.value);
23
+ setup(r) {
24
+ const e = r, t = u(), o = h(t), s = c(null), { isOpen: l, hoverEvents: a } = b(), n = i(() => e.popoverText || o("popover-content")), p = i(() => !e.tooltipText && !n.value);
25
25
  return f(
26
- s,
26
+ p,
27
27
  (d) => {
28
28
  if (d)
29
29
  throw new Error(
@@ -31,13 +31,12 @@ const P = {}, g = /* @__PURE__ */ v({
31
31
  );
32
32
  },
33
33
  { immediate: !0 }
34
- ), { __sfc: !0, props: e, slots: t, hasSlot: o, element: r, isOpen: n, hoverEvents: a, hasPopover: i, shouldShowTooltipPopoverError: s, BentoPopover: _, vBentoTooltipDirective: B, BentoTypography: T, BentoTeleport: m };
34
+ ), { __sfc: !0, props: e, slots: t, hasSlot: o, element: s, isOpen: l, hoverEvents: a, hasPopover: n, shouldShowTooltipPopoverError: p, BentoPopover: _, vBentoTooltipDirective: B, BentoTypography: T, BentoTeleport: m };
35
35
  }
36
36
  });
37
37
  var S = function() {
38
- var r, n;
39
38
  var e = this, t = e._self._c, o = e._self._setupProxy;
40
- return t("span", e._g({ directives: [{ name: "bento-tooltip-directive", rawName: "v-bento-tooltip-directive:[tooltipPosition]", value: e.tooltipText, expression: "tooltipText", arg: e.tooltipPosition }], ref: "element", staticClass: "b-dashed-underline", attrs: { tabindex: "0" } }, o.hoverEvents), [t("span", { staticClass: "b-dashed-underline__content" }, [e._t("default")], 2), o.element && o.hasPopover ? t(o.BentoTeleport, { attrs: { disabled: (r = e.teleport) == null ? void 0 : r.disabled, to: (n = e.teleport) == null ? void 0 : n.to } }, [t("span", e._g({}, o.hoverEvents), [t(o.BentoPopover, { attrs: { open: o.isOpen, "target-element": o.element, position: e.popoverPosition, role: "tooltip", "fit-content": e.popoverSize === "fit-content" || void 0, large: e.popoverSize === "large" || void 0, small: e.popoverSize === "small" || void 0, title: e.popoverTitle, "disable-focus-trap": "" } }, [e._t("popover-content", function() {
39
+ return t("span", e._g({ directives: [{ name: "bento-tooltip-directive", rawName: "v-bento-tooltip-directive:[tooltipPosition]", value: e.tooltipText, expression: "tooltipText", arg: e.tooltipPosition }], ref: "element", staticClass: "b-dashed-underline", attrs: { tabindex: "0" } }, o.hoverEvents), [t("span", { staticClass: "b-dashed-underline__content" }, [e._t("default")], 2), o.element && o.hasPopover ? t(o.BentoTeleport, { attrs: { disabled: e.teleport?.disabled, to: e.teleport?.to } }, [t("span", e._g({}, o.hoverEvents), [t(o.BentoPopover, { attrs: { open: o.isOpen, "target-element": o.element, position: e.popoverPosition, role: "tooltip", "fit-content": e.popoverSize === "fit-content" || void 0, large: e.popoverSize === "large" || void 0, small: e.popoverSize === "small" || void 0, title: e.popoverTitle, "disable-focus-trap": "" } }, [e._t("popover-content", function() {
41
40
  return [t(o.BentoTypography, [e._v(" " + e._s(e.popoverText) + " ")])];
42
41
  })], 2)], 1)]) : e._e()], 1);
43
42
  }, y = [], w = /* @__PURE__ */ x(
@@ -52,4 +51,4 @@ const k = w.exports;
52
51
  export {
53
52
  k as B
54
53
  };
55
- //# sourceMappingURL=dashed-underline.ByPcIHNe.js.map
54
+ //# sourceMappingURL=dashed-underline.CbzCYKrk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dashed-underline.ByPcIHNe.js","sources":["../../src/components/dashed-underline/dashed-underline.vue"],"sourcesContent":["<template>\n <span\n ref=\"element\"\n v-bento-tooltip-directive:[tooltipPosition]=\"tooltipText\"\n class=\"b-dashed-underline\"\n tabindex=\"0\"\n v-on=\"hoverEvents\"\n >\n <span class=\"b-dashed-underline__content\">\n <slot></slot>\n </span>\n <bento-teleport v-if=\"element && hasPopover\" :disabled=\"teleport?.disabled\" :to=\"teleport?.to\">\n <span v-on=\"hoverEvents\">\n <bento-popover\n :open=\"isOpen\"\n :target-element=\"element\"\n :position=\"popoverPosition\"\n role=\"tooltip\"\n :fit-content=\"popoverSize === 'fit-content' || undefined\"\n :large=\"popoverSize === 'large' || undefined\"\n :small=\"popoverSize === 'small' || undefined\"\n :title=\"popoverTitle\"\n disable-focus-trap\n >\n <slot name=\"popover-content\">\n <bento-typography>\n {{ popoverText }}\n </bento-typography>\n </slot>\n </bento-popover>\n </span>\n </bento-teleport>\n </span>\n</template>\n\n<script lang=\"ts\" setup>\n import { computed, ref, useSlots, watch } from 'vue';\n import { BentoPopover } from '@/components/popover';\n import { useBentoDelayedHover } from '@/composables';\n import { BentoTooltipDirective as vBentoTooltipDirective } from '@/directives/tooltip/index';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import { BentoTeleport } from '@/internal';\n import { type BentoDashedUnderlineProps } from './dashed-underline.types';\n\n const props = defineProps({\n popoverText: { default: null },\n popoverTitle: { default: null },\n popoverPosition: { default: 'top' },\n popoverSize: { default: 'fit-content' },\n teleport: { default: () => ({\n disabled: true,\n }) },\n tooltipText: { default: null },\n tooltipPosition: { default: 'top' }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const element = ref<HTMLSpanElement>(null);\n\n const { isOpen, hoverEvents } = useBentoDelayedHover();\n\n const hasPopover = computed(() => props.popoverText || hasSlot('popover-content'));\n\n const shouldShowTooltipPopoverError = computed(() => !props.tooltipText && !hasPopover.value);\n\n watch(\n shouldShowTooltipPopoverError,\n value => {\n if (value) {\n throw new Error(\n 'BentoDashedUnderline requires either a tooltip or a popover to be configured. Check the docs for more info.'\n );\n }\n },\n { immediate: true }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * Provides a dashed underline to text, indicating that more information is available on\n * hover or focus. The additional information is displayed in a tooltip or a popover.\n *\n * @example\n * import { BentoDashedUnderline } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDashedUnderline },\n * template: `\n * <p>\n * This is some <bento-dashed-underline tooltip-text=\"A short explanation\">annotated text</bento-dashed-underline>.\n * </p>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./dashed-underline.scss\" />\n"],"names":["__default__","slots","useSlots","hasSlot","useHasSlot","element","ref","isOpen","hoverEvents","useBentoDelayedHover","hasPopover","computed","props","shouldShowTooltipPopoverError","watch","value"],"mappings":";;;;;;;;AAkGI,MAAAA,IAAA,CAAA;;;;;;;;;;;;;;;iBAzCAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAA,IAAA,GAEA,EAAA,QAAAC,GAAA,aAAAC,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAA,MAAAC,EAAA,eAAAT,EAAA,iBAAA,CAAA,GAEAU,IAAAF,EAAA,MAAA,CAAAC,EAAA,eAAA,CAAAF,EAAA,KAAA;AAEA,WAAAI;AAAA,MAAAD;AAAA,MACI,CAAAE,MAAA;AAEI,YAAAA;AACI,gBAAA,IAAA;AAAA,YAAU;AAAA,UACN;AAAA,MAER;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"dashed-underline.CbzCYKrk.js","sources":["../../src/components/dashed-underline/dashed-underline.vue"],"sourcesContent":["<template>\n <span\n ref=\"element\"\n v-bento-tooltip-directive:[tooltipPosition]=\"tooltipText\"\n class=\"b-dashed-underline\"\n tabindex=\"0\"\n v-on=\"hoverEvents\"\n >\n <span class=\"b-dashed-underline__content\">\n <slot></slot>\n </span>\n <bento-teleport v-if=\"element && hasPopover\" :disabled=\"teleport?.disabled\" :to=\"teleport?.to\">\n <span v-on=\"hoverEvents\">\n <bento-popover\n :open=\"isOpen\"\n :target-element=\"element\"\n :position=\"popoverPosition\"\n role=\"tooltip\"\n :fit-content=\"popoverSize === 'fit-content' || undefined\"\n :large=\"popoverSize === 'large' || undefined\"\n :small=\"popoverSize === 'small' || undefined\"\n :title=\"popoverTitle\"\n disable-focus-trap\n >\n <slot name=\"popover-content\">\n <bento-typography>\n {{ popoverText }}\n </bento-typography>\n </slot>\n </bento-popover>\n </span>\n </bento-teleport>\n </span>\n</template>\n\n<script lang=\"ts\" setup>\n import { computed, ref, useSlots, watch } from 'vue';\n import { BentoPopover } from '@/components/popover';\n import { useBentoDelayedHover } from '@/composables';\n import { BentoTooltipDirective as vBentoTooltipDirective } from '@/directives/tooltip/index';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import { BentoTeleport } from '@/internal';\n import { type BentoDashedUnderlineProps } from './dashed-underline.types';\n\n const props = defineProps({\n popoverText: { default: null },\n popoverTitle: { default: null },\n popoverPosition: { default: 'top' },\n popoverSize: { default: 'fit-content' },\n teleport: { default: () => ({\n disabled: true,\n }) },\n tooltipText: { default: null },\n tooltipPosition: { default: 'top' }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const element = ref<HTMLSpanElement>(null);\n\n const { isOpen, hoverEvents } = useBentoDelayedHover();\n\n const hasPopover = computed(() => props.popoverText || hasSlot('popover-content'));\n\n const shouldShowTooltipPopoverError = computed(() => !props.tooltipText && !hasPopover.value);\n\n watch(\n shouldShowTooltipPopoverError,\n value => {\n if (value) {\n throw new Error(\n 'BentoDashedUnderline requires either a tooltip or a popover to be configured. Check the docs for more info.'\n );\n }\n },\n { immediate: true }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * Provides a dashed underline to text, indicating that more information is available on\n * hover or focus. The additional information is displayed in a tooltip or a popover.\n *\n * @example\n * import { BentoDashedUnderline } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDashedUnderline },\n * template: `\n * <p>\n * This is some <bento-dashed-underline tooltip-text=\"A short explanation\">annotated text</bento-dashed-underline>.\n * </p>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./dashed-underline.scss\" />\n"],"names":["__default__","slots","useSlots","hasSlot","useHasSlot","element","ref","isOpen","hoverEvents","useBentoDelayedHover","hasPopover","computed","props","shouldShowTooltipPopoverError","watch","value"],"mappings":";;;;;;;;AAkGI,MAAAA,IAAA,CAAA;;;;;;;;;;;;;;;iBAzCAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAA,IAAA,GAEA,EAAA,QAAAC,GAAA,aAAAC,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAA,MAAAC,EAAA,eAAAT,EAAA,iBAAA,CAAA,GAEAU,IAAAF,EAAA,MAAA,CAAAC,EAAA,eAAA,CAAAF,EAAA,KAAA;AAEA,WAAAI;AAAA,MAAAD;AAAA,MACI,CAAAE,MAAA;AAEI,YAAAA;AACI,gBAAA,IAAA;AAAA,YAAU;AAAA,UACN;AAAA,MAER;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,102 @@
1
+ import { defineComponent as R, useSlots as S, ref as r, computed as s, provide as I, toRef as u } from "vue";
2
+ import { B as h } from "./header.DUAxdw_d.js";
3
+ import { B } from "./inspector.Aet0jTC2.js";
4
+ import { a as x, B as A } from "./tab.DFk4K9cq.js";
5
+ import { u as E } from "./use-has-slot.C9lQZ6nz.js";
6
+ import { D } from "./data-grid-template.keys.VezYtHtM.js";
7
+ import { n as G } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
8
+ import "../assets/data-grid-template.css";
9
+ const H = {}, O = /* @__PURE__ */ R({
10
+ ...H,
11
+ __name: "data-grid-template",
12
+ props: {
13
+ /**
14
+ * The header that goes to the top of the template
15
+ */
16
+ header: {
17
+ type: Object,
18
+ default: void 0
19
+ },
20
+ /**
21
+ * All the tab properties that can be set on the inner tab components.
22
+ * - tabs.activeTabIndex: the currenly active tab index.
23
+ * - tabs.tabs: an array of BentoTab props, the first item in the array will affect the `tab-1` slot and so on.
24
+ */
25
+ tabs: {
26
+ type: Object,
27
+ default: void 0
28
+ },
29
+ /**
30
+ * Renders the additional content slot with a sticky positioning
31
+ */
32
+ stickyAdditionalContent: {
33
+ type: Boolean,
34
+ default: !1
35
+ },
36
+ /**
37
+ * Renders the tabs with a sticky positioning
38
+ */
39
+ stickyTabs: {
40
+ type: Boolean,
41
+ default: !1
42
+ },
43
+ /**
44
+ * All the inspector properties that can be set on the inner inspector component.
45
+ */
46
+ inspector: {
47
+ type: Object,
48
+ default: void 0
49
+ }
50
+ },
51
+ emits: ["update:tabs", "update:is-open:inspector", "update:active-page:inspector", "expand:inspector"],
52
+ setup(c, { emit: t }) {
53
+ const n = c, e = S(), d = E(e), a = r(null), i = r(null), f = r(null), _ = s(() => ({
54
+ "b-data-grid-template__additional-content--sticky": n.stickyAdditionalContent
55
+ })), b = s(() => ({
56
+ title: "",
57
+ ...n.inspector
58
+ })), m = s(() => i?.value?.offsetHeight), l = s(() => a.value?.$refs?.tablistwrapper), T = s(() => Object.keys(e).filter((o) => o?.includes("tab-"))), y = s(() => ({
59
+ "update:is-open": (o) => t("update:is-open:inspector", o),
60
+ "update:active-page": (o) => t("update:active-page:inspector", o),
61
+ expand: (o) => t("expand:inspector", o)
62
+ })), C = (o) => {
63
+ t("update:tabs", { ...n.tabs, activeTabIndex: o });
64
+ }, v = (o) => n?.tabs.tabs?.[o]?.title ?? `Tab ${o + 1}`, p = () => {
65
+ const k = u(n, "stickyTabs"), g = u(n, "stickyAdditionalContent");
66
+ return {
67
+ isDataGridTemplate: !0,
68
+ stickyTabs: k,
69
+ tabsRef: l,
70
+ stickyAdditionalContent: g,
71
+ additionalContentSlotRef: i
72
+ };
73
+ };
74
+ return I(D, p), { __sfc: !0, props: n, slots: e, hasSlot: d, emit: t, tabsRef: a, additionalContentRef: i, inspectorRef: f, additionalContentConditionalClasses: _, computedInspectorProps: b, computedStickyAdditionalContentHeight: m, computedTabsRef: l, tabsSlots: T, inspectorEvents: y, emitTabs: C, getTabTitle: v, registerDatagridInDataGridTemplate: p, BentoHeader: h, BentoInspector: B, BentoTab: A, BentoTabs: x };
75
+ }
76
+ });
77
+ var j = function() {
78
+ var t = this, n = t._self._c, e = t._self._setupProxy;
79
+ return n("main", { staticClass: "b-data-grid-template" }, [n(e.BentoInspector, t._g(t._b({ ref: "inspectorRef", scopedSlots: t._u([{ key: "page", fn: function() {
80
+ return [n("div", { staticClass: "b-data-grid-template__header" }, [t._t("header", function() {
81
+ return [n(e.BentoHeader, t._b({ scopedSlots: t._u([e.hasSlot("infoIconTooltipContent") ? { key: "infoIconTooltipContent", fn: function() {
82
+ return [t._t("infoIconTooltipContent")];
83
+ }, proxy: !0 } : null], null, !0) }, "bento-header", t.header, !1))];
84
+ })], 2), e.hasSlot("additionalContent") ? n("div", { ref: "additionalContentRef", staticClass: "b-data-grid-template__additional-content", class: e.additionalContentConditionalClasses }, [t._t("additionalContent")], 2) : t._e(), e.tabsSlots.length > 1 ? n(e.BentoTabs, { ref: "tabsRef", attrs: { "active-tab-index": t.tabs.activeTabIndex, sticky: t.stickyTabs, "sticky-options": t.stickyAdditionalContent ? { top: e.computedStickyAdditionalContentHeight } : null }, on: { "update:active-tab-index": e.emitTabs } }, t._l(e.tabsSlots, function(d, a) {
85
+ return n(e.BentoTab, { key: `tab-${a}`, attrs: { title: e.getTabTitle(a) } }, [t._t(`tab-${a + 1}`)], 2);
86
+ }), 1) : t._t("default")];
87
+ }, proxy: !0 }, { key: "content", fn: function() {
88
+ return [t._t("inspector-content")];
89
+ }, proxy: !0 }], null, !0) }, "bento-inspector", e.computedInspectorProps, !1), e.inspectorEvents))], 1);
90
+ }, P = [], $ = /* @__PURE__ */ G(
91
+ O,
92
+ j,
93
+ P,
94
+ !1,
95
+ null,
96
+ "2ce69cd0"
97
+ );
98
+ const q = $.exports;
99
+ export {
100
+ q as d
101
+ };
102
+ //# sourceMappingURL=data-grid-template.BvBHJ0sH.js.map