@adyen/bento-vue2 1.89.2 → 1.90.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 (255) hide show
  1. package/dist/@types/components.d.ts +2 -0
  2. package/dist/@types/index.d.ts +198 -80
  3. package/dist/accordion.js +1 -1
  4. package/dist/action-bar.js +1 -1
  5. package/dist/ai-tag.js +1 -1
  6. package/dist/alert.js +1 -1
  7. package/dist/anchor-scroller.js +1 -1
  8. package/dist/assets/accordion-item.css +1 -1
  9. package/dist/assets/action-bar.css +1 -1
  10. package/dist/assets/base-modal.css +1 -1
  11. package/dist/assets/button-actions.css +1 -1
  12. package/dist/assets/card.css +1 -1
  13. package/dist/assets/data-grid.css +1 -1
  14. package/dist/assets/date-range-picker.css +1 -1
  15. package/dist/assets/dialog-page.css +1 -1
  16. package/dist/assets/file-uploader.css +1 -1
  17. package/dist/assets/input-time.css +1 -0
  18. package/dist/assets/inspector.css +1 -1
  19. package/dist/assets/modal-fullscreen.css +1 -1
  20. package/dist/assets/secondary-nav.css +1 -1
  21. package/dist/assets/sidepanel.css +1 -1
  22. package/dist/button.js +3 -3
  23. package/dist/card.js +1 -1
  24. package/dist/checkbox.js +2 -2
  25. package/dist/chip.js +1 -1
  26. package/dist/chunks/accordion-item.D0WVCLec.js +145 -0
  27. package/dist/chunks/{accordion-item.BZDSJamR.js.map → accordion-item.D0WVCLec.js.map} +1 -1
  28. package/dist/chunks/action-bar.B63qIiiH.js +334 -0
  29. package/dist/chunks/{action-bar.CYGUYI0V.js.map → action-bar.B63qIiiH.js.map} +1 -1
  30. package/dist/chunks/{ai-button.CR_ePQRR.js → ai-button.7L9bANlk.js} +2 -2
  31. package/dist/chunks/{ai-button.CR_ePQRR.js.map → ai-button.7L9bANlk.js.map} +1 -1
  32. package/dist/chunks/ai-tag.CCJCOdXu.js +110 -0
  33. package/dist/chunks/{ai-tag.Cjf38mjR.js.map → ai-tag.CCJCOdXu.js.map} +1 -1
  34. package/dist/chunks/alert.CXRb-Smf.js +160 -0
  35. package/dist/chunks/{alert.QVQ6Zjbm.js.map → alert.CXRb-Smf.js.map} +1 -1
  36. package/dist/chunks/{anchor-scroller.CjJ26PJS.js → anchor-scroller.DWaykZQj.js} +66 -39
  37. package/dist/chunks/{anchor-scroller.CjJ26PJS.js.map → anchor-scroller.DWaykZQj.js.map} +1 -1
  38. package/dist/chunks/{base-modal.DmWkavtf.js → base-modal.DpmeDmq-.js} +103 -66
  39. package/dist/chunks/{base-modal.DmWkavtf.js.map → base-modal.DpmeDmq-.js.map} +1 -1
  40. package/dist/chunks/{button-actions-with-menu.Bi_HXopk.js → button-actions-with-menu.ChTUOsZl.js} +2 -2
  41. package/dist/chunks/{button-actions-with-menu.Bi_HXopk.js.map → button-actions-with-menu.ChTUOsZl.js.map} +1 -1
  42. package/dist/chunks/{button-actions.BLk114As.js → button-actions.BmU1DngD.js} +221 -147
  43. package/dist/chunks/{button-actions.BLk114As.js.map → button-actions.BmU1DngD.js.map} +1 -1
  44. package/dist/chunks/{button.DxhJNOtr.js → button.C9b2AC9w.js} +2 -2
  45. package/dist/chunks/{button.DxhJNOtr.js.map → button.C9b2AC9w.js.map} +1 -1
  46. package/dist/chunks/{calendar.CXKhBF2f.js → calendar.uvIGF_jU.js} +283 -209
  47. package/dist/chunks/{calendar.CXKhBF2f.js.map → calendar.uvIGF_jU.js.map} +1 -1
  48. package/dist/chunks/card.WWUfBkqf.js +165 -0
  49. package/dist/chunks/{card.GjhsXOT0.js.map → card.WWUfBkqf.js.map} +1 -1
  50. package/dist/chunks/{checkbox-group.B2BjU3ZN.js → checkbox-group.CI0xDnql.js} +4 -4
  51. package/dist/chunks/{checkbox-group.B2BjU3ZN.js.map → checkbox-group.CI0xDnql.js.map} +1 -1
  52. package/dist/chunks/{checkbox.CIv8WgGp.js → checkbox.TsWA6O3Z.js} +93 -56
  53. package/dist/chunks/{checkbox.CIv8WgGp.js.map → checkbox.TsWA6O3Z.js.map} +1 -1
  54. package/dist/chunks/chip.BFY_-VCz.js +84 -0
  55. package/dist/chunks/{chip.DTpENaGC.js.map → chip.BFY_-VCz.js.map} +1 -1
  56. package/dist/chunks/{code-snippet.YIm2oO_o.js → code-snippet.4DX9iUV8.js} +133 -76
  57. package/dist/chunks/{code-snippet.YIm2oO_o.js.map → code-snippet.4DX9iUV8.js.map} +1 -1
  58. package/dist/chunks/{controls-group.CqotnNEF.js → controls-group.D_KE99mg.js} +2 -2
  59. package/dist/chunks/{controls-group.CqotnNEF.js.map → controls-group.D_KE99mg.js.map} +1 -1
  60. package/dist/chunks/copy.qqGYFbKJ.js +133 -0
  61. package/dist/chunks/{copy.BVGQcf22.js.map → copy.qqGYFbKJ.js.map} +1 -1
  62. package/dist/chunks/{country.D20NCLLG.js → country.BEwW8TQo.js} +3 -3
  63. package/dist/chunks/{country.D20NCLLG.js.map → country.BEwW8TQo.js.map} +1 -1
  64. package/dist/chunks/country.types.jjXwaoMl.js +2537 -0
  65. package/dist/chunks/country.types.jjXwaoMl.js.map +1 -0
  66. package/dist/chunks/{dashboard-section.BubZyu8i.js → dashboard-section.TWlLdQHG.js} +3 -3
  67. package/dist/chunks/{dashboard-section.BubZyu8i.js.map → dashboard-section.TWlLdQHG.js.map} +1 -1
  68. package/dist/chunks/{dashed-underline.pjYTS0m1.js → dashed-underline.CpDuQ3Fo.js} +3 -3
  69. package/dist/chunks/{dashed-underline.pjYTS0m1.js.map → dashed-underline.CpDuQ3Fo.js.map} +1 -1
  70. package/dist/chunks/{data-grid-template.D8RhngPj.js → data-grid-template.DZaE-kOS.js} +4 -4
  71. package/dist/chunks/{data-grid-template.D8RhngPj.js.map → data-grid-template.DZaE-kOS.js.map} +1 -1
  72. package/dist/chunks/data-grid.x6cEW0az.js +4069 -0
  73. package/dist/chunks/data-grid.x6cEW0az.js.map +1 -0
  74. package/dist/chunks/date-picker.Dln8ocL4.js +222 -0
  75. package/dist/chunks/{date-picker.CnazYcSX.js.map → date-picker.Dln8ocL4.js.map} +1 -1
  76. package/dist/chunks/date-range-picker.DPGy2h-9.js +1068 -0
  77. package/dist/chunks/date-range-picker.DPGy2h-9.js.map +1 -0
  78. package/dist/chunks/dialog-page.EdejG53a.js +143 -0
  79. package/dist/chunks/{dialog-page.oyG153fC.js.map → dialog-page.EdejG53a.js.map} +1 -1
  80. package/dist/chunks/{dropdown-default-textbox.Dvzg0StF.js → dropdown-default-textbox.CjhLIxVq.js} +63 -36
  81. package/dist/chunks/{dropdown-default-textbox.Dvzg0StF.js.map → dropdown-default-textbox.CjhLIxVq.js.map} +1 -1
  82. package/dist/chunks/{dropdown-tag.BRB-emd1.js → dropdown-tag.t3FlJUSy.js} +5 -5
  83. package/dist/chunks/{dropdown-tag.BRB-emd1.js.map → dropdown-tag.t3FlJUSy.js.map} +1 -1
  84. package/dist/chunks/{dropdown.Ct7uhPr6.js → dropdown.CvNI2V33.js} +329 -235
  85. package/dist/chunks/{dropdown.Ct7uhPr6.js.map → dropdown.CvNI2V33.js.map} +1 -1
  86. package/dist/chunks/{empty-state.D_Ac-XXH.js → empty-state.DMV23IZy.js} +2 -2
  87. package/dist/chunks/{empty-state.D_Ac-XXH.js.map → empty-state.DMV23IZy.js.map} +1 -1
  88. package/dist/chunks/error-message.BUNKRa_w.js +160 -0
  89. package/dist/chunks/{error-message.RxdStT3S.js.map → error-message.BUNKRa_w.js.map} +1 -1
  90. package/dist/chunks/{file-uploader.D5Rjsx4k.js → file-uploader.Cig5gDXT.js} +749 -468
  91. package/dist/chunks/{file-uploader.D5Rjsx4k.js.map → file-uploader.Cig5gDXT.js.map} +1 -1
  92. package/dist/chunks/{filter-bar.zD_ctViU.js → filter-bar.x445KK3y.js} +1301 -761
  93. package/dist/chunks/{filter-bar.zD_ctViU.js.map → filter-bar.x445KK3y.js.map} +1 -1
  94. package/dist/chunks/fixed-scroller.DR2E_No4.js +148 -0
  95. package/dist/chunks/{fixed-scroller.MerESbd_.js.map → fixed-scroller.DR2E_No4.js.map} +1 -1
  96. package/dist/chunks/{footer-actions.CiPj7hZG.js → footer-actions.CIkul1OD.js} +3 -3
  97. package/dist/chunks/{footer-actions.CiPj7hZG.js.map → footer-actions.CIkul1OD.js.map} +1 -1
  98. package/dist/chunks/{form-layout-title.Bw7VgOO5.js → form-layout-title.DR5M7GP3.js} +77 -48
  99. package/dist/chunks/{form-layout-title.Bw7VgOO5.js.map → form-layout-title.DR5M7GP3.js.map} +1 -1
  100. package/dist/chunks/{header-meta.Dq6TlNPw.js → header-meta.BC5fdpD1.js} +127 -73
  101. package/dist/chunks/{header-meta.Dq6TlNPw.js.map → header-meta.BC5fdpD1.js.map} +1 -1
  102. package/dist/chunks/{header-with-views.DaEhkSS8.js → header-with-views.-cvdi9-L.js} +1120 -679
  103. package/dist/chunks/{header-with-views.DaEhkSS8.js.map → header-with-views.-cvdi9-L.js.map} +1 -1
  104. package/dist/chunks/{header.DkC-KKWa.js → header.DtmZjxiU.js} +3 -3
  105. package/dist/chunks/{header.DkC-KKWa.js.map → header.DtmZjxiU.js.map} +1 -1
  106. package/dist/chunks/{info-icon.BF8KxU-k.js → info-icon.DCR42Kvm.js} +2 -2
  107. package/dist/chunks/{info-icon.BF8KxU-k.js.map → info-icon.DCR42Kvm.js.map} +1 -1
  108. package/dist/chunks/input-field-password.Bdlw4dzr.js +381 -0
  109. package/dist/chunks/{input-field-password.BKT1mYUw.js.map → input-field-password.Bdlw4dzr.js.map} +1 -1
  110. package/dist/chunks/{input-field-phone-number.BjRKjQOQ.js → input-field-phone-number.DPuWxBBz.js} +98 -71
  111. package/dist/chunks/{input-field-phone-number.BjRKjQOQ.js.map → input-field-phone-number.DPuWxBBz.js.map} +1 -1
  112. package/dist/chunks/input-field.DH25CU_G.js +207 -0
  113. package/dist/chunks/{input-field.m1PMwa4C.js.map → input-field.DH25CU_G.js.map} +1 -1
  114. package/dist/chunks/input-time.6eJ4-QdU.js +92 -0
  115. package/dist/chunks/input-time.6eJ4-QdU.js.map +1 -0
  116. package/dist/chunks/inspector.BzBPlz-5.js +172 -0
  117. package/dist/chunks/{inspector.Bnm0hl_D.js.map → inspector.BzBPlz-5.js.map} +1 -1
  118. package/dist/chunks/{link.MhoM3zQj.js → link.DB5g6d48.js} +56 -29
  119. package/dist/chunks/{link.MhoM3zQj.js.map → link.DB5g6d48.js.map} +1 -1
  120. package/dist/chunks/{list-item.BnzU1LIu.js → list-item.DqTHh8-Z.js} +2 -2
  121. package/dist/chunks/{list-item.BnzU1LIu.js.map → list-item.DqTHh8-Z.js.map} +1 -1
  122. package/dist/chunks/{listbox-option-tag.BhPVuAjJ.js → listbox-option-tag.CvbE-EuG.js} +2 -2
  123. package/dist/chunks/{listbox-option-tag.BhPVuAjJ.js.map → listbox-option-tag.CvbE-EuG.js.map} +1 -1
  124. package/dist/chunks/{modal-fullscreen.CXOq6_Cv.js → modal-fullscreen.CaxuXW-H.js} +63 -36
  125. package/dist/chunks/{modal-fullscreen.CXOq6_Cv.js.map → modal-fullscreen.CaxuXW-H.js.map} +1 -1
  126. package/dist/chunks/{modal.o0KddMiG.js → modal.Brif0vAy.js} +63 -36
  127. package/dist/chunks/{modal.o0KddMiG.js.map → modal.Brif0vAy.js.map} +1 -1
  128. package/dist/chunks/{pagination.ZISqB4M_.js → pagination.BmrU_sn_.js} +221 -99
  129. package/dist/chunks/{pagination.ZISqB4M_.js.map → pagination.BmrU_sn_.js.map} +1 -1
  130. package/dist/chunks/promo-banner.Dc_kK1x9.js +91 -0
  131. package/dist/chunks/{promo-banner.Db2kh2qK.js.map → promo-banner.Dc_kK1x9.js.map} +1 -1
  132. package/dist/chunks/{radio-group.DnMy7brs.js → radio-group.5oS-AeYN.js} +4 -4
  133. package/dist/chunks/{radio-group.DnMy7brs.js.map → radio-group.5oS-AeYN.js.map} +1 -1
  134. package/dist/chunks/{rich-text-editor.Cbv1DxXn.js → rich-text-editor.DSGTe8Zt.js} +1781 -1731
  135. package/dist/chunks/{rich-text-editor.Cbv1DxXn.js.map → rich-text-editor.DSGTe8Zt.js.map} +1 -1
  136. package/dist/chunks/search-bar.CNfoeLLt.js +126 -0
  137. package/dist/chunks/{search-bar.DPjYDhja.js.map → search-bar.CNfoeLLt.js.map} +1 -1
  138. package/dist/chunks/secondary-nav.IF5CgeIP.js +226 -0
  139. package/dist/chunks/secondary-nav.IF5CgeIP.js.map +1 -0
  140. package/dist/chunks/{segmented-control.BqIiX9hv.js → segmented-control.DDtjX-V5.js} +2 -2
  141. package/dist/chunks/{segmented-control.BqIiX9hv.js.map → segmented-control.DDtjX-V5.js.map} +1 -1
  142. package/dist/chunks/{selection-card-group.IPiouuot.js → selection-card-group.DZjFeQKR.js} +10 -10
  143. package/dist/chunks/{selection-card-group.IPiouuot.js.map → selection-card-group.DZjFeQKR.js.map} +1 -1
  144. package/dist/chunks/{sidepanel.BGMjjB3F.js → sidepanel.DZDXuyzg.js} +66 -39
  145. package/dist/chunks/{sidepanel.BGMjjB3F.js.map → sidepanel.DZDXuyzg.js.map} +1 -1
  146. package/dist/chunks/{step.QFER3tSj.js → step.TDm_ts1S.js} +92 -63
  147. package/dist/chunks/{step.QFER3tSj.js.map → step.TDm_ts1S.js.map} +1 -1
  148. package/dist/chunks/{structured-list-item.BDJKRC_8.js → structured-list-item.BBBtie1s.js} +58 -31
  149. package/dist/chunks/{structured-list-item.BDJKRC_8.js.map → structured-list-item.BBBtie1s.js.map} +1 -1
  150. package/dist/chunks/{summary-grid.types.CIkArZf5.js → summary-grid.types.CrPNQbX0.js} +5 -5
  151. package/dist/chunks/{summary-grid.types.CIkArZf5.js.map → summary-grid.types.CrPNQbX0.js.map} +1 -1
  152. package/dist/chunks/{tab.CaXF0dho.js → tab.CNIZyfZt.js} +2 -2
  153. package/dist/chunks/{tab.CaXF0dho.js.map → tab.CNIZyfZt.js.map} +1 -1
  154. package/dist/chunks/{tag.CocLKztJ.js → tag.D2xagTJv.js} +2 -2
  155. package/dist/chunks/{tag.CocLKztJ.js.map → tag.D2xagTJv.js.map} +1 -1
  156. package/dist/chunks/textarea.Bi53QF5Q.js +218 -0
  157. package/dist/chunks/{textarea.D4X6Ss9q.js.map → textarea.Bi53QF5Q.js.map} +1 -1
  158. package/dist/chunks/timeline-item.C6Bi0eam.js +322 -0
  159. package/dist/chunks/{timeline-item.C8BxWdy1.js.map → timeline-item.C6Bi0eam.js.map} +1 -1
  160. package/dist/chunks/{toast.BRI3G7TL.js → toast.d8vg71CB.js} +81 -54
  161. package/dist/chunks/{toast.BRI3G7TL.js.map → toast.d8vg71CB.js.map} +1 -1
  162. package/dist/chunks/{tooltip.CbsNGnhw.js → tooltip.BxtnF3is.js} +38 -36
  163. package/dist/chunks/tooltip.BxtnF3is.js.map +1 -0
  164. package/dist/chunks/{tutorial.BzV6bHQJ.js → tutorial.BCiZMLJE.js} +190 -103
  165. package/dist/chunks/{tutorial.BzV6bHQJ.js.map → tutorial.BCiZMLJE.js.map} +1 -1
  166. package/dist/chunks/{use-cached-selected-values.DqX2qsMC.js → use-cached-selected-values.Bn3Y8Iuq.js} +490 -359
  167. package/dist/chunks/{use-cached-selected-values.DqX2qsMC.js.map → use-cached-selected-values.Bn3Y8Iuq.js.map} +1 -1
  168. package/dist/chunks/{use-country-items.CI8C7MLU.js → use-country-items.B4j8pAvW.js} +3 -3
  169. package/dist/chunks/{use-country-items.CI8C7MLU.js.map → use-country-items.B4j8pAvW.js.map} +1 -1
  170. package/dist/chunks/use-country-phon-code.ByqnuIni.js +6386 -0
  171. package/dist/chunks/use-country-phon-code.ByqnuIni.js.map +1 -0
  172. package/dist/chunks/{use-date-input-formatter.BYaTO3vz.js → use-date-input-formatter.DRMt9yR2.js} +2 -2
  173. package/dist/chunks/{use-date-input-formatter.BYaTO3vz.js.map → use-date-input-formatter.DRMt9yR2.js.map} +1 -1
  174. package/dist/code-snippet.js +1 -1
  175. package/dist/country.js +3 -3
  176. package/dist/dashboard-template.js +1 -1
  177. package/dist/dashed-underline.js +1 -1
  178. package/dist/data-grid-template.js +1 -1
  179. package/dist/data-grid.js +1 -1
  180. package/dist/date-picker.js +2 -2
  181. package/dist/date-range-picker.js +2 -2
  182. package/dist/draggable-handle.js +160 -73
  183. package/dist/draggable-handle.js.map +1 -1
  184. package/dist/dropdown.js +4 -4
  185. package/dist/empty-state.js +1 -1
  186. package/dist/file-uploader.js +1 -1
  187. package/dist/filter-bar.js +1 -1
  188. package/dist/form-layout.js +1 -1
  189. package/dist/header-with-views.js +1 -1
  190. package/dist/header.js +1 -1
  191. package/dist/index.js +215 -213
  192. package/dist/index.js.map +1 -1
  193. package/dist/info-icon.js +1 -1
  194. package/dist/input-field-password.js +1 -1
  195. package/dist/input-field-phone-number.js +1 -1
  196. package/dist/input-field.js +1 -1
  197. package/dist/input-time.js +5 -0
  198. package/dist/input-time.js.map +1 -0
  199. package/dist/inspector.js +1 -1
  200. package/dist/internal.js +12 -12
  201. package/dist/link.js +1 -1
  202. package/dist/list.js +1 -1
  203. package/dist/menu.js +1 -1
  204. package/dist/modal-fullscreen.js +1 -1
  205. package/dist/modal.js +2 -2
  206. package/dist/pagination.js +1 -1
  207. package/dist/popover.js +1 -1
  208. package/dist/promo-banner.js +1 -1
  209. package/dist/radio-group.js +1 -1
  210. package/dist/rich-text-editor.js +1 -1
  211. package/dist/search-bar.js +2 -2
  212. package/dist/secondary-nav.js +1 -1
  213. package/dist/segmented-control.js +1 -1
  214. package/dist/selection-card.js +1 -1
  215. package/dist/sidepanel.js +1 -1
  216. package/dist/stepper.js +1 -1
  217. package/dist/structured-list.js +1 -1
  218. package/dist/summary-grid.js +1 -1
  219. package/dist/tabs.js +1 -1
  220. package/dist/tag.js +1 -1
  221. package/dist/textarea.js +1 -1
  222. package/dist/timeline.js +1 -1
  223. package/dist/toast.js +1 -1
  224. package/dist/tutorial.js +1 -1
  225. package/dist/web-types.json +198 -1
  226. package/package.json +9 -9
  227. package/dist/chunks/accordion-item.BZDSJamR.js +0 -108
  228. package/dist/chunks/action-bar.CYGUYI0V.js +0 -207
  229. package/dist/chunks/ai-tag.Cjf38mjR.js +0 -73
  230. package/dist/chunks/alert.QVQ6Zjbm.js +0 -93
  231. package/dist/chunks/card.GjhsXOT0.js +0 -128
  232. package/dist/chunks/chip.DTpENaGC.js +0 -57
  233. package/dist/chunks/copy.BVGQcf22.js +0 -86
  234. package/dist/chunks/country.types.DxKjyd0S.js +0 -20
  235. package/dist/chunks/country.types.DxKjyd0S.js.map +0 -1
  236. package/dist/chunks/data-grid.DJG8Ty0A.js +0 -3194
  237. package/dist/chunks/data-grid.DJG8Ty0A.js.map +0 -1
  238. package/dist/chunks/date-picker.CnazYcSX.js +0 -155
  239. package/dist/chunks/date-range-picker.Bf9pRNL7.js +0 -811
  240. package/dist/chunks/date-range-picker.Bf9pRNL7.js.map +0 -1
  241. package/dist/chunks/dialog-page.oyG153fC.js +0 -116
  242. package/dist/chunks/error-message.RxdStT3S.js +0 -106
  243. package/dist/chunks/fixed-scroller.MerESbd_.js +0 -111
  244. package/dist/chunks/input-field-password.BKT1mYUw.js +0 -234
  245. package/dist/chunks/input-field.m1PMwa4C.js +0 -170
  246. package/dist/chunks/inspector.Bnm0hl_D.js +0 -105
  247. package/dist/chunks/promo-banner.Db2kh2qK.js +0 -64
  248. package/dist/chunks/search-bar.DPjYDhja.js +0 -89
  249. package/dist/chunks/secondary-nav.CwJjkJkj.js +0 -112
  250. package/dist/chunks/secondary-nav.CwJjkJkj.js.map +0 -1
  251. package/dist/chunks/textarea.D4X6Ss9q.js +0 -169
  252. package/dist/chunks/timeline-item.C8BxWdy1.js +0 -238
  253. package/dist/chunks/tooltip.CbsNGnhw.js.map +0 -1
  254. package/dist/chunks/use-country-phon-code.C6orQNnM.js +0 -291
  255. package/dist/chunks/use-country-phon-code.C6orQNnM.js.map +0 -1
@@ -1,24 +1,51 @@
1
- import { defineComponent as x, useSlots as A, inject as S, onMounted as T, useListeners as y, getCurrentInstance as P, toRefs as J, ref as d, computed as U, onUnmounted as K, watch as Y, provide as f } from "vue";
1
+ import { defineComponent as T, useSlots as x, inject as L, onMounted as A, useListeners as h, getCurrentInstance as P, toRefs as J, ref as d, computed as U, onUnmounted as K, watch as Y, provide as f } from "vue";
2
2
  import "./index.Cl4_42j5.js";
3
- import { B as j } from "./toast.BRI3G7TL.js";
3
+ import { B as j } from "./toast.d8vg71CB.js";
4
4
  import { B as $ } from "./focus-trap.DRqjHzt6.js";
5
- import { B as z } from "./button.DxhJNOtr.js";
5
+ import { B as z } from "./button.C9b2AC9w.js";
6
6
  import { B as H } from "./typography.C8lPlsbD.js";
7
7
  import { u as N } from "./use-has-slot.C9lQZ6nz.js";
8
- import { u as q } from "./index.B6WW_F-J.js";
9
- import { i as F, j as D, B as Q, k as W } from "./button-actions.BLk114As.js";
10
- import { C as X } from "./cross.CC_B-vG-.js";
11
- import { b as Z, B as V, D as ee, a as te } from "./dialog-page.oyG153fC.js";
8
+ import { u as X } from "./index.B6WW_F-J.js";
9
+ import { i as F, j as D, B as q, k as Q } from "./button-actions.BmU1DngD.js";
10
+ import { C as W } from "./cross.CC_B-vG-.js";
11
+ import { b as Z, B as V, D as ee, a as te } from "./dialog-page.EdejG53a.js";
12
12
  import { n as k } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
13
13
  import { g as O } from "./generate-uid.NJ8tVoha.js";
14
14
  import "../assets/modal-fullscreen.css";
15
15
  const ae = {
16
- "en-US": { close: "Close" },
17
- "ja-JP": { close: "閉じる" },
18
- "pt-BR": { close: "Fechar" }
16
+ "de-DE": {
17
+ close: "Schließen"
18
+ },
19
+ "en-GB": {
20
+ close: "Close"
21
+ },
22
+ "en-US": {
23
+ close: "Close"
24
+ },
25
+ "es-ES": {
26
+ close: "Cerrar"
27
+ },
28
+ "es-MX": {
29
+ close: "Cerrar"
30
+ },
31
+ "fr-FR": {
32
+ close: "Fermer"
33
+ },
34
+ "it-IT": {
35
+ close: "Chiudi"
36
+ },
37
+ "ja-JP": {
38
+ close: "閉じる"
39
+ },
40
+ "pt-BR": {
41
+ close: "Fechar"
42
+ },
43
+ "zh-CN": {
44
+ close: "关闭"
45
+ }
19
46
  }, se = {
20
47
  i18n: { messages: ae }
21
- }, le = /* @__PURE__ */ x({
48
+ }, le = /* @__PURE__ */ T({
22
49
  ...se,
23
50
  __name: "modal-fullscreen-page",
24
51
  props: {
@@ -76,13 +103,13 @@ const ae = {
76
103
  },
77
104
  emits: ["close"],
78
105
  setup(o, { emit: e }) {
79
- const a = o, { t } = q(), s = A(), n = N(s), r = S(F, void 0), m = a.titleId ?? r, i = S(D, void 0), p = () => {
106
+ const a = o, { t } = X(), s = x(), n = N(s), r = L(F, void 0), m = a.titleId ?? r, i = L(D, void 0), p = () => {
80
107
  e("close"), i == null || i();
81
108
  };
82
- return T(() => {
109
+ return A(() => {
83
110
  if (a.actions && a.actions.length > 2)
84
111
  throw new Error("Not more than 2 action buttons may be provided in Bento Modal Fullscreen");
85
- }), { __sfc: !0, t, props: a, emit: e, slots: s, hasSlot: n, injectedTitleId: r, computedTitleId: m, closeModal: i, handleClose: p, BentoButton: z, BentoButtonActions: Q, BentoTypography: H, DialogPage: Z, CrossIcon: X };
112
+ }), { __sfc: !0, t, props: a, emit: e, slots: s, hasSlot: n, injectedTitleId: r, computedTitleId: m, closeModal: i, handleClose: p, BentoButton: z, BentoButtonActions: q, BentoTypography: H, DialogPage: Z, CrossIcon: W };
86
113
  }
87
114
  });
88
115
  var oe = function() {
@@ -103,17 +130,17 @@ var oe = function() {
103
130
  "50f40dc1"
104
131
  );
105
132
  const ie = re.exports;
106
- function ue() {
133
+ function ce() {
107
134
  var e;
108
- if (!window || !y && !P)
135
+ if (!window || !h && !P)
109
136
  return {};
110
- if (y)
111
- return y();
137
+ if (h)
138
+ return h();
112
139
  const o = P();
113
140
  return ((e = o == null ? void 0 : o.proxy) == null ? void 0 : e.$listeners) || {};
114
141
  }
115
- const ce = {}, de = /* @__PURE__ */ x({
116
- ...ce,
142
+ const ue = {}, de = /* @__PURE__ */ T({
143
+ ...ue,
117
144
  __name: "modal-fullscreen",
118
145
  props: {
119
146
  /**
@@ -162,13 +189,13 @@ const ce = {}, de = /* @__PURE__ */ x({
162
189
  },
163
190
  emits: ["before-close", "update:active-page", "update:is-open"],
164
191
  setup(o, { emit: e }) {
165
- const a = o, { activePage: t, isOpen: s } = J(a), n = d(null), r = d(!1), m = O("modal-fullscreen"), i = O("modal-fullscreen-title"), p = d(!1), g = d(!1), h = ue(), b = A(), M = N(b), R = U(() => ({
192
+ const a = o, { activePage: t, isOpen: s } = J(a), n = d(null), r = d(!1), m = O("modal-fullscreen"), i = O("modal-fullscreen-title"), p = d(!1), g = d(!1), y = ce(), C = x(), M = N(C), R = U(() => ({
166
193
  "b-modal-fullscreen--hide": r.value
167
194
  })), G = () => {
168
- r.value && n.value && (n.value.close(), u.value[0] && e("update:active-page", u.value[0]), u.value = [], r.value = !1, p.value = !1, e("update:is-open", !1));
195
+ r.value && n.value && (n.value.close(), c.value[0] && e("update:active-page", c.value[0]), c.value = [], r.value = !1, p.value = !1, e("update:is-open", !1));
169
196
  };
170
- function C() {
171
- if (h["before-close"]) {
197
+ function I() {
198
+ if (y["before-close"]) {
172
199
  e("before-close");
173
200
  return;
174
201
  }
@@ -177,31 +204,31 @@ const ce = {}, de = /* @__PURE__ */ x({
177
204
  const v = () => {
178
205
  !n.value || !n.value.open || (r.value = !0);
179
206
  };
180
- T(() => {
207
+ A(() => {
181
208
  g.value = !0;
182
209
  }), K(() => {
183
210
  g.value = !1;
184
211
  }), Y(
185
212
  [() => s.value, n],
186
- ([l, c]) => {
187
- !g.value || !c || (l ? (p.value = !0, c.open || c.showModal(), u.value.length || u.value.push(t.value)) : c.open && v());
213
+ ([l, u]) => {
214
+ !g.value || !u || (l ? (p.value = !0, u.open || u.showModal(), c.value.length || c.value.push(t.value)) : u.open && v());
188
215
  },
189
216
  { immediate: !0, flush: "post" }
190
- ), f(W, m), f(F, i), f(D, C);
191
- const I = d(V.TRANSITION_LEVEL_DEEPER), _ = d([]), u = d([]), E = (l) => e("update:active-page", l);
217
+ ), f(Q, m), f(F, i), f(D, I);
218
+ const b = d(V.TRANSITION_LEVEL_DEEPER), _ = d([]), c = d([]), E = (l) => e("update:active-page", l);
192
219
  f(ee, {
193
220
  activePage: t,
194
- animation: I,
221
+ animation: b,
195
222
  isOpen: p,
196
223
  pages: _,
197
- previousPages: u,
224
+ previousPages: c,
198
225
  updatePage: E
199
226
  });
200
227
  const B = (l) => () => {
201
- var c;
202
- _.value = (c = _.value) == null ? void 0 : c.filter((w) => w !== l);
203
- }, L = (l) => (l && _.value.push(l), { unregisterPage: B(l) });
204
- return f(te, L), { __sfc: !0, props: a, emit: e, activePage: t, isOpen: s, modal: n, isClosing: r, modalFullscreenId: m, titleId: i, internalIsOpen: p, isMounted: g, listeners: h, slots: b, hasSlot: M, conditionalClasses: R, closeModalAfterAnimation: G, closeModal: C, startCloseModalAnimation: v, animation: I, pages: _, previousPages: u, updatePage: E, unregisterPage: B, registerPage: L, BentoToast: j, BentoFocusTrap: $, BentoModalFullscreenPage: ie };
228
+ var u;
229
+ _.value = (u = _.value) == null ? void 0 : u.filter((w) => w !== l);
230
+ }, S = (l) => (l && _.value.push(l), { unregisterPage: B(l) });
231
+ return f(te, S), { __sfc: !0, props: a, emit: e, activePage: t, isOpen: s, modal: n, isClosing: r, modalFullscreenId: m, titleId: i, internalIsOpen: p, isMounted: g, listeners: y, slots: C, hasSlot: M, conditionalClasses: R, closeModalAfterAnimation: G, closeModal: I, startCloseModalAnimation: v, animation: b, pages: _, previousPages: c, updatePage: E, unregisterPage: B, registerPage: S, BentoToast: j, BentoFocusTrap: $, BentoModalFullscreenPage: ie };
205
232
  }
206
233
  });
207
234
  var pe = function() {
@@ -226,4 +253,4 @@ export {
226
253
  ie as B,
227
254
  Oe as m
228
255
  };
229
- //# sourceMappingURL=modal-fullscreen.CXOq6_Cv.js.map
256
+ //# sourceMappingURL=modal-fullscreen.CaxuXW-H.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"modal-fullscreen.CXOq6_Cv.js","sources":["../../src/components/modal-fullscreen/components/modal-fullscreen-page.vue","../../src/composables/use-listeners/use-listener.ts","../../src/components/modal-fullscreen/modal-fullscreen.vue"],"sourcesContent":["<template>\n <dialog-page class=\"b-modal-fullscreen-page\" :page-id=\"pageId\" :previous-page=\"previousPage\" always-show-border>\n <template #header>\n <div class=\"b-modal-fullscreen-page__header\">\n <div class=\"b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--title\">\n <bento-typography\n v-if=\"title\"\n :id=\"computedTitleId\"\n el=\"h2\"\n variant=\"title\"\n class=\"b-modal-fullscreen-page__title\"\n :title=\"title\"\n >{{ title }}</bento-typography\n >\n </div>\n <div\n v-if=\"hasSlot('header')\"\n class=\"b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--slot\"\n >\n <slot name=\"header\" />\n </div>\n <div class=\"b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--actions\">\n <bento-typography\n v-if=\"contextualLabel\"\n class=\"b-modal-fullscreen-page__contextual-label\"\n el=\"span\"\n :title=\"contextualLabel\"\n >{{ contextualLabel }}</bento-typography\n >\n <bento-button-actions v-if=\"actions\" class=\"b-modal-fullscreen-page__actions\" :actions=\"actions\" />\n\n <div class=\"b-modal-fullscreen-page__separator\"></div>\n <div class=\"b-modal-fullscreen-page__close-button\">\n <bento-button variant=\"tertiary\" :aria-label=\"t('close')\" @click=\"handleClose\">\n <template #iconLeft><cross-icon :aria-hidden=\"true\" /></template>\n </bento-button>\n </div>\n </div>\n </div>\n </template>\n <template #content>\n <slot />\n </template>\n </dialog-page>\n</template>\n\n<script setup lang=\"ts\">\n import { inject, onMounted, type PropType, useSlots } from 'vue';\n\n import { BentoButton, BentoButtonActions, type BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { DialogPage } from '@/internal';\n\n import { useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import {\n MODAL_FULLSCREEN_CLOSE_INJECTION_KEY,\n MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY,\n } from '@/components/modal-fullscreen/modal-fullscreen.keys';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * Label shown next to the modal actions\n */\n contextualLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Identifier of the page, used with activePage prop to handle sidepanel navigation\n */\n pageId: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID of the page for the back button to navigate to. Only use it to overwrite the default back behavior\n * Used when the back button should not take the user to the natural previous page\n * Set to `null` to hide back button in the page\n */\n previousPage: {\n type: String,\n default: undefined,\n },\n\n /**\n * Title of the modal\n */\n title: {\n type: String,\n default: null,\n },\n\n /**\n * ID to be applied to the title to be used with aria-labelledby\n */\n titleId: {\n type: String,\n default: undefined,\n },\n });\n const emit = defineEmits([\"close\"]);\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const injectedTitleId = inject(MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY, undefined);\n const computedTitleId = props.titleId ?? injectedTitleId;\n\n const closeModal = inject(MODAL_FULLSCREEN_CLOSE_INJECTION_KEY, undefined);\n\n const handleClose = () => {\n emit('close');\n closeModal?.();\n };\n\n onMounted(() => {\n if (props.actions && props.actions.length > 2) {\n throw new Error('Not more than 2 action buttons may be provided in Bento Modal Fullscreen');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * ModalFullscreenPage is used to render different pages of ModalFullscreen component\n *\n * @example\n * import { BentoModalFullscreen, BentoModalFullscreenPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModalFullscreen, BentoModalFullscreenPage },\n * template: `\n * <bento-modal-fullscreen active-page='page1' is-open='true'>\n * <bento-modal-fullscreen-page\n * title='Page 1'\n * pageId='page1'\n * contextual-label='Move to next page'\n * :actions=\"[\n * {\n * title: 'Next page',\n * event: () => {\n * activePage.value = 'page2';\n * },\n * }]\">\n * Page 1 info\n * </bento-modal-fullscreen-page>\n * <bento-modal-fullscreen-page\n * title='Page 2'\n * pageId='page2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Page 2 info\n * </bento-modal-fullscreen-page>\n * </bento-modal-fullscreen>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./modal-fullscreen-page.scss\" />\n","import { getCurrentInstance, useListeners as vueUseListeners } from 'vue';\n\n/**\n * A composable that provides access to the Vue2 component's listeners (see Vue3 implementation in packages/vue3/composables).\n * The listeners are kebab-case and the colons are removed (e.g. \"click\", \"update-value\").\n *\n * In environments where the Composition API is not available (e.g. during testing),\n * it falls back to using the component's non-reactive `$listeners` object.\n *\n * @returns The component's listeners.\n */\nexport function useListeners() {\n // Return nothing so tests don't require a mock of this function\n if (!window || (!vueUseListeners && !getCurrentInstance)) {\n return {};\n }\n\n if (vueUseListeners) {\n return vueUseListeners() as any;\n }\n\n const instance = getCurrentInstance();\n return instance?.proxy?.$listeners || {};\n}\n","<template>\n <dialog\n :id=\"modalFullscreenId\"\n ref=\"modal\"\n class=\"b-modal-fullscreen\"\n :class=\"conditionalClasses\"\n data-dialog-element=\"modal-fullscreen\"\n :aria-labelledby=\"titleId\"\n @animationend=\"closeModalAfterAnimation\"\n @keydown.esc.prevent=\"closeModal\"\n >\n <bento-focus-trap v-if=\"internalIsOpen\" class=\"b-modal-fullscreen__wrapper\">\n <template v-if=\"props.activePage\">\n <slot />\n </template>\n <bento-modal-fullscreen-page\n v-else\n :actions=\"actions\"\n :contextual-label=\"contextualLabel\"\n :title=\"title\"\n :title-id=\"titleId\"\n @close=\"closeModal\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot name=\"default\"></slot>\n </template>\n <template v-if=\"hasSlot('header')\" #header>\n <slot name=\"header\"></slot>\n </template>\n </bento-modal-fullscreen-page>\n </bento-focus-trap>\n\n <!-- Enable the toast inside the fullscreen-modal -->\n <template v-if=\"isOpen\">\n <bento-toast />\n </template>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, onUnmounted, type PropType, provide, ref, toRefs, useSlots, watch } from 'vue';\n import { isVue2 } from 'vue-demi';\n\n import { BentoToast } from '@/components/toast';\n import { type BentoButtonActionsList } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import BentoModalFullscreenPage from './components/modal-fullscreen-page.vue';\n\n import { generateUid } from '@/core/utils/ts';\n import { useHasSlot } from '@/composables';\n import { useListeners } from '@/composables/use-listeners';\n import {\n MODAL_FULLSCREEN_CLOSE_INJECTION_KEY,\n MODAL_FULLSCREEN_DIALOG_ID_INJECTION_KEY,\n MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY,\n } from '@/components/modal-fullscreen/modal-fullscreen.keys';\n\n import {\n BentoDialogPageAnimation,\n type BentoDialogPageConfigData,\n type BentoDialogPageRegisterPage,\n DIALOG_PAGE_CONFIG_INJECTION_KEY,\n DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY,\n } from '@/internal';\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * The id of the current active page\n * Should be the same as the pageId of the BentoModalFullscreenPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * Label shown next to the modal actions\n */\n contextualLabel: {\n type: String,\n default: null,\n },\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: {\n type: Boolean,\n default: null,\n },\n /**\n * Title of the modal\n */\n title: {\n type: String,\n default: null,\n },\n });\n\n const emit = defineEmits([\"before-close\", \"update:active-page\", \"update:is-open\"]);\n\n // Refs\n const { activePage, isOpen } = toRefs(props);\n const modal = ref(null);\n const isClosing = ref(false);\n const modalFullscreenId = generateUid('modal-fullscreen');\n const titleId = generateUid('modal-fullscreen-title');\n const internalIsOpen = ref(false);\n const isMounted = ref(false);\n\n const listeners = useListeners();\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n // Animation styling\n const conditionalClasses = computed(() => ({\n 'b-modal-fullscreen--hide': isClosing.value,\n }));\n\n // Handle closing and closing animation for dialog element\n const closeModalAfterAnimation = () => {\n if (isClosing.value && modal.value) {\n modal.value.close();\n if (previousPages.value[0]) {\n emit('update:active-page', previousPages.value[0]);\n }\n previousPages.value = [];\n isClosing.value = false;\n internalIsOpen.value = false;\n emit('update:is-open', false);\n }\n };\n\n /**\n * Emits the `beforeClose` event, if it is being listened to,\n * before closing the modal and omits the closing animation.\n * The animation will be triggered by the change of the `isOpen` prop instead.\n *\n * If no listener for the `before-close`, then the animation will be triggered,\n * which will close the modal and emit the `update:is-open` event instead, after it was closed.\n */\n function closeModal() {\n /**\n * Vue3 appends the prefix \"on\" and changes to camelCase\n */\n const eventName = isVue2 ? 'before-close' : 'onBeforeClose';\n if (listeners[eventName]) {\n emit('before-close');\n return;\n }\n startCloseModalAnimation();\n }\n\n const startCloseModalAnimation = () => {\n if (!modal.value || !modal.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n onMounted(() => {\n isMounted.value = true;\n });\n\n onUnmounted(() => {\n isMounted.value = false;\n });\n\n // Watching isOpen prop to toggle open/close the dialog element\n watch(\n [() => isOpen.value, modal],\n ([newIsOpen, newModalValue]) => {\n if (!isMounted.value || !newModalValue) {\n return;\n }\n\n if (newIsOpen) {\n internalIsOpen.value = true;\n if (!newModalValue.open) {\n newModalValue.showModal();\n }\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (newModalValue.open) {\n startCloseModalAnimation();\n }\n },\n { immediate: true, flush: 'post' }\n );\n\n // lets children components know they are inside a Modal (dialog element)\n provide(MODAL_FULLSCREEN_DIALOG_ID_INJECTION_KEY, modalFullscreenId);\n provide(MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY, titleId);\n provide(MODAL_FULLSCREEN_CLOSE_INJECTION_KEY, closeModal);\n\n // Pages\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n const pages = ref<Array<string>>([]);\n const previousPages = ref([]);\n const updatePage = page => emit('update:active-page', page);\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n isOpen: internalIsOpen,\n pages,\n previousPages,\n updatePage,\n });\n\n // unregister page if removed / destroyed\n const unregisterPage = (pageIdToRemove: string) => () => {\n pages.value = pages.value?.filter(pageId => pageId !== pageIdToRemove);\n };\n\n // Provide data and function to register page to subcomponent\n const registerPage: BentoDialogPageRegisterPage = pageId => {\n if (pageId) {\n pages.value.push(pageId);\n }\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n</script>\n\n<script lang=\"ts\">\n /**\n * Fullscreen modal takes full available space (no content underneath is visible) and focuses the user's attention exclusively on one complex task or piece of complex information.\n *\n * @example\n * import { BentoModalFullscreen } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModalFullscreen },\n * template: `\n * <bento-modal-fullscreen\n * :is-open=\"isOpen\"\n * @update:is-open=\"isOpen = $event\"\n * title='Fullscreen modal title'\n * contextual-label='Contextual label'\n * :actions=\"[{ title: 'Action', event: () => {}]\"\n * >\n * <template #header>{{ header slot }}</template>\n * {{ content }}\n * </bento-modal-fullscreen>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./modal-fullscreen.scss\" />\n"],"names":["__default__$1","messages","useI18n","slots","useSlots","hasSlot","useHasSlot","injectedTitleId","inject","MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY","computedTitleId","props","closeModal","MODAL_FULLSCREEN_CLOSE_INJECTION_KEY","handleClose","emit","onMounted","useListeners","useListeners$1","getCurrentInstance","instance","_a","__default__","activePage","isOpen","toRefs","modal","ref","isClosing","modalFullscreenId","generateUid","titleId","internalIsOpen","isMounted","listeners","conditionalClasses","computed","closeModalAfterAnimation","previousPages","startCloseModalAnimation","onUnmounted","watch","newIsOpen","newModalValue","provide","MODAL_FULLSCREEN_DIALOG_ID_INJECTION_KEY","animation","BentoDialogPageAnimation","pages","updatePage","page","DIALOG_PAGE_CONFIG_INJECTION_KEY","unregisterPage","pageIdToRemove","pageId","registerPage","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY"],"mappings":";;;;;;;;;;;;;;;;;;GAuLIA,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,GAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAzHA,EAAA,EAAA,IAAAC,EAAA,GA6DAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAAC,GAAA,MAAA,GACAC,IAAAC,EAAA,WAAAJ,GAEAK,IAAAJ,EAAAK,GAAA,MAAA,GAEAC,IAAA,MAAA;AACI,MAAAC,EAAA,OAAA,GACAH,KAAA,QAAAA;AAAA,IAAa;AAGjB,WAAAI,EAAA,MAAA;AACI,UAAAL,EAAA,WAAAA,EAAA,QAAA,SAAA;AACI,cAAA,IAAA,MAAA,0EAAA;AAAA,IACJ,CAAA;;;;;;;;;;;;;;;;;;;;;AClID,SAAAM,KAAA;;AAEH,MAAA,CAAA,UAAA,CAAAC,KAAA,CAAAC;AACI,WA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MAAAjB,EAAA,OAAAE,CAAA;AAAA,MAC8B,CAAA,CAAAgB,GAAAC,CAAA,MAAA;AAEtB,QAAA,CAAAV,EAAA,SAAA,CAAAU,MAIAD,KACIV,EAAA,QAAA,IACAW,EAAA,QACIA,EAAA,UAAA,GAEJL,EAAA,MAAA,UACIA,EAAA,MAAA,KAAAf,EAAA,KAAA,KACJoB,EAAA,QAEAJ,EAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,IAAA,OAAA,OAAA;AAAA,IACiC,GAIrCK,EAAAC,GAAAhB,CAAA,GACAe,EAAAnC,GAAAsB,CAAA,GACAa,EAAA/B,GAAAD,CAAA;AAGA,UAAAkC,IAAAnB,EAAAoB,EAAA,uBAAA,GACAC,IAAArB,EAAA,CAAA,CAAA,GACAW,IAAAX,EAAA,CAAA,CAAA,GACAsB,IAAA,CAAAC,MAAAnC,EAAA,sBAAAmC,CAAA;AAEA,IAAAN,EAAAO,IAAA;AAAA,MAAqE,YAAA5B;AAAA,MACjE,WAAAuB;AAAA,MACA,QAAAd;AAAA,MACQ,OAAAgB;AAAA,MACR,eAAAV;AAAA,MACA,YAAAW;AAAA,IACA,CAAA;AAIJ,UAAAG,IAAA,CAAAC,MAAA,MAAA;;AACI,MAAAL,EAAA,SAAA3B,IAAA2B,EAAA,UAAA,gBAAA3B,EAAA,OAAA,CAAAiC,MAAAA,MAAAD;AAAA,IAAqE,GAIzEE,IAAA,CAAAD,OACIA,KACIN,EAAA,MAAA,KAAAM,CAAA,GAGJ,EAAA,gBAAAF,EAAAE,CAAA,EAAA;AAGJ,WAAAV,EAAAY,IAAAD,CAAA;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"modal-fullscreen.CaxuXW-H.js","sources":["../../src/components/modal-fullscreen/components/modal-fullscreen-page.vue","../../src/composables/use-listeners/use-listener.ts","../../src/components/modal-fullscreen/modal-fullscreen.vue"],"sourcesContent":["<template>\n <dialog-page class=\"b-modal-fullscreen-page\" :page-id=\"pageId\" :previous-page=\"previousPage\" always-show-border>\n <template #header>\n <div class=\"b-modal-fullscreen-page__header\">\n <div class=\"b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--title\">\n <bento-typography\n v-if=\"title\"\n :id=\"computedTitleId\"\n el=\"h2\"\n variant=\"title\"\n class=\"b-modal-fullscreen-page__title\"\n :title=\"title\"\n >{{ title }}</bento-typography\n >\n </div>\n <div\n v-if=\"hasSlot('header')\"\n class=\"b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--slot\"\n >\n <slot name=\"header\" />\n </div>\n <div class=\"b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--actions\">\n <bento-typography\n v-if=\"contextualLabel\"\n class=\"b-modal-fullscreen-page__contextual-label\"\n el=\"span\"\n :title=\"contextualLabel\"\n >{{ contextualLabel }}</bento-typography\n >\n <bento-button-actions v-if=\"actions\" class=\"b-modal-fullscreen-page__actions\" :actions=\"actions\" />\n\n <div class=\"b-modal-fullscreen-page__separator\"></div>\n <div class=\"b-modal-fullscreen-page__close-button\">\n <bento-button variant=\"tertiary\" :aria-label=\"t('close')\" @click=\"handleClose\">\n <template #iconLeft><cross-icon :aria-hidden=\"true\" /></template>\n </bento-button>\n </div>\n </div>\n </div>\n </template>\n <template #content>\n <slot />\n </template>\n </dialog-page>\n</template>\n\n<script setup lang=\"ts\">\n import { inject, onMounted, type PropType, useSlots } from 'vue';\n\n import { BentoButton, BentoButtonActions, type BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { DialogPage } from '@/internal';\n\n import { useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import {\n MODAL_FULLSCREEN_CLOSE_INJECTION_KEY,\n MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY,\n } from '@/components/modal-fullscreen/modal-fullscreen.keys';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * Label shown next to the modal actions\n */\n contextualLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Identifier of the page, used with activePage prop to handle sidepanel navigation\n */\n pageId: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID of the page for the back button to navigate to. Only use it to overwrite the default back behavior\n * Used when the back button should not take the user to the natural previous page\n * Set to `null` to hide back button in the page\n */\n previousPage: {\n type: String,\n default: undefined,\n },\n\n /**\n * Title of the modal\n */\n title: {\n type: String,\n default: null,\n },\n\n /**\n * ID to be applied to the title to be used with aria-labelledby\n */\n titleId: {\n type: String,\n default: undefined,\n },\n });\n const emit = defineEmits([\"close\"]);\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const injectedTitleId = inject(MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY, undefined);\n const computedTitleId = props.titleId ?? injectedTitleId;\n\n const closeModal = inject(MODAL_FULLSCREEN_CLOSE_INJECTION_KEY, undefined);\n\n const handleClose = () => {\n emit('close');\n closeModal?.();\n };\n\n onMounted(() => {\n if (props.actions && props.actions.length > 2) {\n throw new Error('Not more than 2 action buttons may be provided in Bento Modal Fullscreen');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * ModalFullscreenPage is used to render different pages of ModalFullscreen component\n *\n * @example\n * import { BentoModalFullscreen, BentoModalFullscreenPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModalFullscreen, BentoModalFullscreenPage },\n * template: `\n * <bento-modal-fullscreen active-page='page1' is-open='true'>\n * <bento-modal-fullscreen-page\n * title='Page 1'\n * pageId='page1'\n * contextual-label='Move to next page'\n * :actions=\"[\n * {\n * title: 'Next page',\n * event: () => {\n * activePage.value = 'page2';\n * },\n * }]\">\n * Page 1 info\n * </bento-modal-fullscreen-page>\n * <bento-modal-fullscreen-page\n * title='Page 2'\n * pageId='page2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Page 2 info\n * </bento-modal-fullscreen-page>\n * </bento-modal-fullscreen>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./modal-fullscreen-page.scss\" />\n","import { getCurrentInstance, useListeners as vueUseListeners } from 'vue';\n\n/**\n * A composable that provides access to the Vue2 component's listeners (see Vue3 implementation in packages/vue3/composables).\n * The listeners are kebab-case and the colons are removed (e.g. \"click\", \"update-value\").\n *\n * In environments where the Composition API is not available (e.g. during testing),\n * it falls back to using the component's non-reactive `$listeners` object.\n *\n * @returns The component's listeners.\n */\nexport function useListeners() {\n // Return nothing so tests don't require a mock of this function\n if (!window || (!vueUseListeners && !getCurrentInstance)) {\n return {};\n }\n\n if (vueUseListeners) {\n return vueUseListeners() as any;\n }\n\n const instance = getCurrentInstance();\n return instance?.proxy?.$listeners || {};\n}\n","<template>\n <dialog\n :id=\"modalFullscreenId\"\n ref=\"modal\"\n class=\"b-modal-fullscreen\"\n :class=\"conditionalClasses\"\n data-dialog-element=\"modal-fullscreen\"\n :aria-labelledby=\"titleId\"\n @animationend=\"closeModalAfterAnimation\"\n @keydown.esc.prevent=\"closeModal\"\n >\n <bento-focus-trap v-if=\"internalIsOpen\" class=\"b-modal-fullscreen__wrapper\">\n <template v-if=\"props.activePage\">\n <slot />\n </template>\n <bento-modal-fullscreen-page\n v-else\n :actions=\"actions\"\n :contextual-label=\"contextualLabel\"\n :title=\"title\"\n :title-id=\"titleId\"\n @close=\"closeModal\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot name=\"default\"></slot>\n </template>\n <template v-if=\"hasSlot('header')\" #header>\n <slot name=\"header\"></slot>\n </template>\n </bento-modal-fullscreen-page>\n </bento-focus-trap>\n\n <!-- Enable the toast inside the fullscreen-modal -->\n <template v-if=\"isOpen\">\n <bento-toast />\n </template>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, onUnmounted, type PropType, provide, ref, toRefs, useSlots, watch } from 'vue';\n import { isVue2 } from 'vue-demi';\n\n import { BentoToast } from '@/components/toast';\n import { type BentoButtonActionsList } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import BentoModalFullscreenPage from './components/modal-fullscreen-page.vue';\n\n import { generateUid } from '@/core/utils/ts';\n import { useHasSlot } from '@/composables';\n import { useListeners } from '@/composables/use-listeners';\n import {\n MODAL_FULLSCREEN_CLOSE_INJECTION_KEY,\n MODAL_FULLSCREEN_DIALOG_ID_INJECTION_KEY,\n MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY,\n } from '@/components/modal-fullscreen/modal-fullscreen.keys';\n\n import {\n BentoDialogPageAnimation,\n type BentoDialogPageConfigData,\n type BentoDialogPageRegisterPage,\n DIALOG_PAGE_CONFIG_INJECTION_KEY,\n DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY,\n } from '@/internal';\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * The id of the current active page\n * Should be the same as the pageId of the BentoModalFullscreenPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * Label shown next to the modal actions\n */\n contextualLabel: {\n type: String,\n default: null,\n },\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: {\n type: Boolean,\n default: null,\n },\n /**\n * Title of the modal\n */\n title: {\n type: String,\n default: null,\n },\n });\n\n const emit = defineEmits([\"before-close\", \"update:active-page\", \"update:is-open\"]);\n\n // Refs\n const { activePage, isOpen } = toRefs(props);\n const modal = ref(null);\n const isClosing = ref(false);\n const modalFullscreenId = generateUid('modal-fullscreen');\n const titleId = generateUid('modal-fullscreen-title');\n const internalIsOpen = ref(false);\n const isMounted = ref(false);\n\n const listeners = useListeners();\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n // Animation styling\n const conditionalClasses = computed(() => ({\n 'b-modal-fullscreen--hide': isClosing.value,\n }));\n\n // Handle closing and closing animation for dialog element\n const closeModalAfterAnimation = () => {\n if (isClosing.value && modal.value) {\n modal.value.close();\n if (previousPages.value[0]) {\n emit('update:active-page', previousPages.value[0]);\n }\n previousPages.value = [];\n isClosing.value = false;\n internalIsOpen.value = false;\n emit('update:is-open', false);\n }\n };\n\n /**\n * Emits the `beforeClose` event, if it is being listened to,\n * before closing the modal and omits the closing animation.\n * The animation will be triggered by the change of the `isOpen` prop instead.\n *\n * If no listener for the `before-close`, then the animation will be triggered,\n * which will close the modal and emit the `update:is-open` event instead, after it was closed.\n */\n function closeModal() {\n /**\n * Vue3 appends the prefix \"on\" and changes to camelCase\n */\n const eventName = isVue2 ? 'before-close' : 'onBeforeClose';\n if (listeners[eventName]) {\n emit('before-close');\n return;\n }\n startCloseModalAnimation();\n }\n\n const startCloseModalAnimation = () => {\n if (!modal.value || !modal.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n onMounted(() => {\n isMounted.value = true;\n });\n\n onUnmounted(() => {\n isMounted.value = false;\n });\n\n // Watching isOpen prop to toggle open/close the dialog element\n watch(\n [() => isOpen.value, modal],\n ([newIsOpen, newModalValue]) => {\n if (!isMounted.value || !newModalValue) {\n return;\n }\n\n if (newIsOpen) {\n internalIsOpen.value = true;\n if (!newModalValue.open) {\n newModalValue.showModal();\n }\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (newModalValue.open) {\n startCloseModalAnimation();\n }\n },\n { immediate: true, flush: 'post' }\n );\n\n // lets children components know they are inside a Modal (dialog element)\n provide(MODAL_FULLSCREEN_DIALOG_ID_INJECTION_KEY, modalFullscreenId);\n provide(MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY, titleId);\n provide(MODAL_FULLSCREEN_CLOSE_INJECTION_KEY, closeModal);\n\n // Pages\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n const pages = ref<Array<string>>([]);\n const previousPages = ref([]);\n const updatePage = page => emit('update:active-page', page);\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n isOpen: internalIsOpen,\n pages,\n previousPages,\n updatePage,\n });\n\n // unregister page if removed / destroyed\n const unregisterPage = (pageIdToRemove: string) => () => {\n pages.value = pages.value?.filter(pageId => pageId !== pageIdToRemove);\n };\n\n // Provide data and function to register page to subcomponent\n const registerPage: BentoDialogPageRegisterPage = pageId => {\n if (pageId) {\n pages.value.push(pageId);\n }\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n</script>\n\n<script lang=\"ts\">\n /**\n * Fullscreen modal takes full available space (no content underneath is visible) and focuses the user's attention exclusively on one complex task or piece of complex information.\n *\n * @example\n * import { BentoModalFullscreen } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModalFullscreen },\n * template: `\n * <bento-modal-fullscreen\n * :is-open=\"isOpen\"\n * @update:is-open=\"isOpen = $event\"\n * title='Fullscreen modal title'\n * contextual-label='Contextual label'\n * :actions=\"[{ title: 'Action', event: () => {}]\"\n * >\n * <template #header>{{ header slot }}</template>\n * {{ content }}\n * </bento-modal-fullscreen>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./modal-fullscreen.scss\" />\n"],"names":["__default__$1","messages","useI18n","slots","useSlots","hasSlot","useHasSlot","injectedTitleId","inject","MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY","computedTitleId","props","closeModal","MODAL_FULLSCREEN_CLOSE_INJECTION_KEY","handleClose","emit","onMounted","useListeners","useListeners$1","getCurrentInstance","instance","_a","__default__","activePage","isOpen","toRefs","modal","ref","isClosing","modalFullscreenId","generateUid","titleId","internalIsOpen","isMounted","listeners","conditionalClasses","computed","closeModalAfterAnimation","previousPages","startCloseModalAnimation","onUnmounted","watch","newIsOpen","newModalValue","provide","MODAL_FULLSCREEN_DIALOG_ID_INJECTION_KEY","animation","BentoDialogPageAnimation","pages","updatePage","page","DIALOG_PAGE_CONFIG_INJECTION_KEY","unregisterPage","pageIdToRemove","pageId","registerPage","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuLIA,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,GAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAzHA,EAAA,EAAA,IAAAC,EAAA,GA6DAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAAC,GAAA,MAAA,GACAC,IAAAC,EAAA,WAAAJ,GAEAK,IAAAJ,EAAAK,GAAA,MAAA,GAEAC,IAAA,MAAA;AACI,MAAAC,EAAA,OAAA,GACAH,KAAA,QAAAA;AAAA,IAAa;AAGjB,WAAAI,EAAA,MAAA;AACI,UAAAL,EAAA,WAAAA,EAAA,QAAA,SAAA;AACI,cAAA,IAAA,MAAA,0EAAA;AAAA,IACJ,CAAA;;;;;;;;;;;;;;;;;;;;;AClID,SAAAM,KAAA;;AAEH,MAAA,CAAA,UAAA,CAAAC,KAAA,CAAAC;AACI,WAAA,CAAA;AAGJ,MAAAD;AACI,WAAAA,EAAA;AAGJ,QAAAE,IAAAD,EAAA;AACA,WAAAE,IAAA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,CAAAV,EAAA,SAAA,CAAAU,MAIAD,KACIV,EAAA,QAAA,IACAW,EAAA,QACIA,EAAA,UAAA,GAEJL,EAAA,MAAA,UACIA,EAAA,MAAA,KAAAf,EAAA,KAAA,KACJoB,EAAA,QAEAJ,EAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,IAAA,OAAA,OAAA;AAAA,IACiC,GAIrCK,EAAAC,GAAAhB,CAAA,GACAe,EAAAnC,GAAAsB,CAAA,GACAa,EAAA/B,GAAAD,CAAA;AAGA,UAAAkC,IAAAnB,EAAAoB,EAAA,uBAAA,GACAC,IAAArB,EAAA,CAAA,CAAA,GACAW,IAAAX,EAAA,CAAA,CAAA,GACAsB,IAAA,CAAAC,MAAAnC,EAAA,sBAAAmC,CAAA;AAEA,IAAAN,EAAAO,IAAA;AAAA,MAAqE,YAAA5B;AAAA,MACjE,WAAAuB;AAAA,MACA,QAAAd;AAAA,MACQ,OAAAgB;AAAA,MACR,eAAAV;AAAA,MACA,YAAAW;AAAA,IACA,CAAA;AAIJ,UAAAG,IAAA,CAAAC,MAAA,MAAA;;AACI,MAAAL,EAAA,SAAA3B,IAAA2B,EAAA,UAAA,gBAAA3B,EAAA,OAAA,CAAAiC,MAAAA,MAAAD;AAAA,IAAqE,GAIzEE,IAAA,CAAAD,OACIA,KACIN,EAAA,MAAA,KAAAM,CAAA,GAGJ,EAAA,gBAAAF,EAAAE,CAAA,EAAA;AAGJ,WAAAV,EAAAY,IAAAD,CAAA;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,16 +1,16 @@
1
- import { defineComponent as p, useSlots as B, onMounted as A, toRefs as E, ref as L, computed as f, useAttrs as P, watch as k } from "vue";
2
- import { B as g, h as O, a as d, d as x, e as C, g as v, f as T } from "./base-modal.DmWkavtf.js";
3
- import { u as b } from "./use-has-slot.C9lQZ6nz.js";
4
- import { F as R } from "./footer-actions.CiPj7hZG.js";
5
- import { n as S } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
6
- import { b as M } from "./button.DxhJNOtr.js";
1
+ import { defineComponent as p, useSlots as B, onMounted as O, toRefs as E, ref as k, computed as f, useAttrs as L, watch as P } from "vue";
2
+ import { B as g, h as A, a as d, d as x, e as C, g as v, f as T } from "./base-modal.DpmeDmq-.js";
3
+ import { u as S } from "./use-has-slot.C9lQZ6nz.js";
4
+ import { F as R } from "./footer-actions.CIkul1OD.js";
5
+ import { n as b } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
6
+ import { b as M } from "./button.C9b2AC9w.js";
7
7
  import { u as z } from "./index.B6WW_F-J.js";
8
- import { B as N } from "./button-actions.BLk114As.js";
8
+ import { B as N } from "./button-actions.BmU1DngD.js";
9
9
  import { d as $ } from "./typography.C8lPlsbD.js";
10
- const F = p({
10
+ const K = p({
11
11
  name: "bento-modal-default"
12
- }), j = /* @__PURE__ */ p({
13
- ...F,
12
+ }), F = /* @__PURE__ */ p({
13
+ ...K,
14
14
  props: {
15
15
  /**
16
16
  * List of actions that will be used to render the buttons.
@@ -101,16 +101,16 @@ const F = p({
101
101
  },
102
102
  emits: ["update:active-page", "close-modal"],
103
103
  setup(a, { emit: t }) {
104
- const o = a, e = B(), l = b(e), i = () => {
104
+ const o = a, e = B(), l = S(e), i = () => {
105
105
  t("close-modal");
106
106
  };
107
- return A(() => {
107
+ return O(() => {
108
108
  if (!(l("content") || l("content-col-1") && l("content-col-2")) && !o.activePage)
109
109
  throw new Error("Bento Modal default variant requires content slot or column slots");
110
- }), { __sfc: !0, slots: e, hasSlot: l, emit: t, props: o, onCloseModal: i, FooterActions: R, BaseModal: O };
110
+ }), { __sfc: !0, slots: e, hasSlot: l, emit: t, props: o, onCloseModal: i, FooterActions: R, BaseModal: A };
111
111
  }
112
112
  });
113
- var q = function() {
113
+ var j = function() {
114
114
  var t = this, o = t._self._c, e = t._self._setupProxy;
115
115
  return o(e.BaseModal, t._b({ staticClass: "b-modal-default", attrs: { actions: t.actions, "active-page": t.activePage, size: t.size, "hide-close-button": t.hideCloseButton, "columns-size": t.columnsSize, "custom-padding": t.customPadding, "is-dismissible": t.isDismissible, "is-open": t.isOpen, "with-column-layout": t.withColumnLayout, "initially-open": t.initiallyOpen }, on: { "update:active-page": function(l) {
116
116
  return e.emit("update:active-page", l);
@@ -127,23 +127,50 @@ var q = function() {
127
127
  return [o(e.FooterActions, { attrs: { actions: t.actions, "actions-label": t.actionsLabel, "destructive-actions": t.destructiveActions } })];
128
128
  })];
129
129
  }, proxy: !0 } : null], null, !0) }, "base-modal", t.$attrs, !1));
130
- }, I = [], V = /* @__PURE__ */ S(
130
+ }, q = [], I = /* @__PURE__ */ b(
131
+ F,
131
132
  j,
132
133
  q,
133
- I,
134
134
  !1,
135
135
  null,
136
136
  null
137
137
  );
138
- const K = V.exports, U = {
139
- "en-US": { ok: "OK" },
140
- "ja-JP": { ok: "OK" },
141
- "pt-BR": { ok: "OK" }
142
- }, G = p({
143
- i18n: { messages: U },
138
+ const V = I.exports, G = {
139
+ "de-DE": {
140
+ ok: "OK"
141
+ },
142
+ "en-GB": {
143
+ ok: "OK"
144
+ },
145
+ "en-US": {
146
+ ok: "OK"
147
+ },
148
+ "es-ES": {
149
+ ok: "OK"
150
+ },
151
+ "es-MX": {
152
+ ok: "OK"
153
+ },
154
+ "fr-FR": {
155
+ ok: "OK"
156
+ },
157
+ "it-IT": {
158
+ ok: "OK"
159
+ },
160
+ "ja-JP": {
161
+ ok: "OK"
162
+ },
163
+ "pt-BR": {
164
+ ok: "OK"
165
+ },
166
+ "zh-CN": {
167
+ ok: "确定"
168
+ }
169
+ }, U = p({
170
+ i18n: { messages: G },
144
171
  name: "bento-modal-dialog"
145
172
  }), W = /* @__PURE__ */ p({
146
- ...G,
173
+ ...U,
147
174
  props: {
148
175
  /**
149
176
  * List of actions that will be used to render the buttons.
@@ -204,7 +231,7 @@ const K = V.exports, U = {
204
231
  },
205
232
  emits: ["close-modal"],
206
233
  setup(a, { emit: t }) {
207
- const o = a, { t: e } = z(), l = B(), i = b(l), { actions: n, dialogType: s } = E(o), m = L(null), y = () => {
234
+ const o = a, { t: e } = z(), l = B(), i = S(l), { actions: n, dialogType: s } = E(o), m = k(null), y = () => {
208
235
  t("close-modal");
209
236
  }, r = (u) => {
210
237
  m.value.internalModalActionClose(u);
@@ -214,17 +241,17 @@ const K = V.exports, U = {
214
241
  event: r,
215
242
  variant: M.SECONDARY
216
243
  }
217
- ]), w = f(() => {
244
+ ]), D = f(() => {
218
245
  var h;
219
246
  const u = {
220
247
  title: "Cancel",
221
248
  event: r
222
249
  }, c = (h = n == null ? void 0 : n.value) == null ? void 0 : h[0];
223
250
  return s.value === d.DESTRUCTIVE ? c.critical = !0 : s.value === d.INFO && (c.variant = M.SECONDARY), [c, u];
224
- }), D = f(() => ({
251
+ }), w = f(() => ({
225
252
  [`b-modal-dialog--${s.value}`]: s.value
226
253
  }));
227
- return A(() => {
254
+ return O(() => {
228
255
  var u, c;
229
256
  if (o.activePage)
230
257
  throw new Error(
@@ -238,7 +265,7 @@ const K = V.exports, U = {
238
265
  throw new Error("Modal Dialog, except ACKNOWLEDGEMENT type, always has to contain one action button");
239
266
  if (s.value === d.ACKNOWLEDGEMENT && ((c = n == null ? void 0 : n.value) != null && c.length))
240
267
  throw new Error("Acknowledgement Modal Dialog does not accept action buttons");
241
- }), { __sfc: !0, emit: t, props: o, t: e, slots: l, hasSlot: i, actions: n, dialogType: s, modalRef: m, onCloseModal: y, onCloseActionButton: r, acknowledgementDialogActions: _, dialogActions: w, modalDialogConditionalClasses: D, BentoModalRole: x, BentoButtonActions: N, BaseModal: O };
268
+ }), { __sfc: !0, emit: t, props: o, t: e, slots: l, hasSlot: i, actions: n, dialogType: s, modalRef: m, onCloseModal: y, onCloseActionButton: r, acknowledgementDialogActions: _, dialogActions: D, modalDialogConditionalClasses: w, BentoModalRole: x, BentoButtonActions: N, BaseModal: A };
242
269
  }
243
270
  });
244
271
  var Y = function() {
@@ -250,7 +277,7 @@ var Y = function() {
250
277
  }, proxy: !0 }, { key: "actions", fn: function() {
251
278
  return [e.dialogType === "acknowledgement" ? o(e.BentoButtonActions, { attrs: { actions: e.acknowledgementDialogActions, layout: "buttons-end" } }) : o(e.BentoButtonActions, { attrs: { actions: e.dialogActions, layout: "buttons-end" } })];
252
279
  }, proxy: !0 }], null, !0) }, "base-modal", t.$attrs, !1));
253
- }, H = [], J = /* @__PURE__ */ S(
280
+ }, H = [], J = /* @__PURE__ */ b(
254
281
  W,
255
282
  Y,
256
283
  H,
@@ -258,10 +285,10 @@ var Y = function() {
258
285
  null,
259
286
  null
260
287
  );
261
- const Q = J.exports, X = p({
262
- components: { BentoModalDefault: K, BentoModalDialog: Q }
288
+ const X = J.exports, Q = p({
289
+ components: { BentoModalDefault: V, BentoModalDialog: X }
263
290
  }), Z = /* @__PURE__ */ p({
264
- ...X,
291
+ ...Q,
265
292
  __name: "modal",
266
293
  props: {
267
294
  /**
@@ -375,7 +402,7 @@ const Q = J.exports, X = p({
375
402
  },
376
403
  emits: ["update:active-page", "close-modal"],
377
404
  setup(a, { emit: t }) {
378
- const o = a, e = 500, l = B(), i = b(l), n = P(), s = f(() => Object.values(v).includes(o.variant) ? o.variant : v[o.variant.toUpperCase()]), m = f(
405
+ const o = a, e = 500, l = B(), i = S(l), n = L(), s = f(() => Object.values(v).includes(o.variant) ? o.variant : v[o.variant.toUpperCase()]), m = f(
379
406
  () => s.value === v.DEFAULT ? {
380
407
  activePage: o.activePage,
381
408
  hideCloseButton: o.hideCloseButton,
@@ -397,7 +424,7 @@ const Q = J.exports, X = p({
397
424
  ), y = () => {
398
425
  t("close-modal");
399
426
  };
400
- return k(
427
+ return P(
401
428
  () => o.actions,
402
429
  () => {
403
430
  var r, _;
@@ -424,7 +451,7 @@ var tt = function() {
424
451
  }, proxy: !0 } : null, e.hasSlot("content") ? { key: "content", fn: function() {
425
452
  return [t._t("content")];
426
453
  }, proxy: !0 } : null], null, !0) }, "component", e.customProps, !1));
427
- }, et = [], ot = /* @__PURE__ */ S(
454
+ }, et = [], ot = /* @__PURE__ */ b(
428
455
  Z,
429
456
  tt,
430
457
  et,
@@ -436,4 +463,4 @@ const pt = ot.exports;
436
463
  export {
437
464
  pt as B
438
465
  };
439
- //# sourceMappingURL=modal.o0KddMiG.js.map
466
+ //# sourceMappingURL=modal.Brif0vAy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"modal.o0KddMiG.js","sources":["../../src/components/modal/components/modal-default/modal-default.vue","../../src/components/modal/components/modal-dialog/modal-dialog.vue","../../src/components/modal/modal.vue"],"sourcesContent":["<template>\n <base-modal\n class=\"b-modal-default\"\n v-bind=\"$attrs\"\n :actions=\"actions\"\n :active-page=\"activePage\"\n :size=\"size\"\n :hide-close-button=\"hideCloseButton\"\n :columns-size=\"columnsSize\"\n :custom-padding=\"customPadding\"\n :is-dismissible=\"isDismissible\"\n :is-open=\"isOpen\"\n :with-column-layout=\"withColumnLayout\"\n :initially-open=\"initiallyOpen\"\n @update:active-page=\"emit('update:active-page', $event)\"\n @close-modal=\"onCloseModal\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot></slot>\n </template>\n <template v-if=\"hasSlot('content-col-1')\" #content-col-1><slot name=\"content-col-1\"></slot></template>\n <template v-if=\"hasSlot('content-col-2')\" #content-col-2><slot name=\"content-col-2\"></slot></template>\n <template v-if=\"hasSlot('content')\" #content><slot name=\"content\"></slot></template>\n\n <template v-if=\"actions && actions.length > 0\" #actions>\n <slot name=\"actions\">\n <footer-actions\n :actions=\"actions\"\n :actions-label=\"actionsLabel\"\n :destructive-actions=\"destructiveActions\"\n />\n </slot>\n </template>\n </base-modal>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, onMounted, type PropType, useSlots } from 'vue';\n import { BentoModalColumnLayoutVariant, type BentoModalSize } from '@/components/modal/modal.types';\n import { useHasSlot } from '@/composables';\n import { type BentoButtonActionsList } from '@/components/button';\n import { FooterActions } from '@/components/internal/footer-actions';\n import BaseModal from '@/components/modal/components/base-modal/base-modal.vue';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const emit = defineEmits([\"update:active-page\", \"close-modal\"]);\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n * But you may change the color of 1-st action to red with 'critial' key\n * Not more than 3 action buttons can be provided\n * Or 2 action buttons and 1 Label for them\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',2\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * Text label that is displayed left to the action buttons\n */\n actionsLabel: { type: String, default: null },\n\n /**\n * The id of the current active page\n * Should be the same id as the BentoModalPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * If provided, manages the padding of the whole modal container\n */\n customPadding: { type: String, default: null },\n\n /**\n * If a column layout is provided, it renders the respective left column width variant. This can be smaller than the second column, the same size as the second column or bigger than the second column.\n */\n columnsSize: {\n type: String as PropType<BentoModalColumnLayoutVariant>,\n default: BentoModalColumnLayoutVariant.SMALLER,\n },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: { type: Boolean, default: false },\n\n /**\n * Hides a cross icon on the right side of the title\n */\n hideCloseButton: { type: Boolean, default: false },\n\n /**\n * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.\n */\n initiallyOpen: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed by clicking outside of it\n */\n isDismissible: { type: Boolean, required: true },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: { type: Boolean, required: true },\n\n /**\n * Sets the width of the modal\n */\n size: {\n type: String as PropType<BentoModalSize | `${BentoModalSize}`>,\n required: true,\n },\n\n /**\n * If provided, renders the modal's content in a two-column layout an wth dividers separating its content\n */\n withColumnLayout: { type: Boolean, default: false },\n });\n\n const onCloseModal = () => {\n emit('close-modal');\n };\n\n onMounted(() => {\n if (!(hasSlot('content') || (hasSlot('content-col-1') && hasSlot('content-col-2'))) && !props.activePage) {\n throw new Error('Bento Modal default variant requires content slot or column slots');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Creates a Modal based off the `base-modal` component.\n * It allows two column modals as well as content modals.\n *\n * @example\n * import { BentoModalDefault } from '@/components/modal/components';\n *\n * export default {\n * components: { BentoModalDefault },\n * template: `\n * <bento-modal-default\n * :is-dismissible=\"false\"\n * :is-open=\"isOpen\"\n * @close-modal=\"isOpen = false\"\n * >\n * <template #content-col-1>\n * // Content on the left side column\n * </template>\n *\n * <template #content-col-2>\n * // Content on the right side column\n * </template>\n *\n * <template v-if=\"actions\" #actions>\n * <footer-actions :actions=\"actions\" />\n * </template>\n * </bento-modal-default>\n * `,\n * setup() {\n * const isOpen = ref(true)\n * const footerActions = [{\n * title: 'Primary action',\n * event: () => { ... }\n * }]\n * }\n * }\n */\n export default defineComponent({\n name: 'bento-modal-default',\n });\n</script>\n","<template>\n <base-modal\n ref=\"modalRef\"\n class=\"b-modal-dialog\"\n :actions=\"actions\"\n :active-page=\"activePage\"\n :class=\"modalDialogConditionalClasses\"\n :hide-close-button=\"true\"\n size=\"small\"\n :is-dismissible=\"isDismissible\"\n :is-open=\"isOpen\"\n :modal-role=\"BentoModalRole.ALERT_DIALOG\"\n :initially-open=\"initiallyOpen\"\n v-bind=\"$attrs\"\n @close-modal=\"onCloseModal\"\n >\n <template #default>\n <slot></slot>\n </template>\n <template #content>\n {{ content }}\n </template>\n\n <template #actions>\n <bento-button-actions\n v-if=\"dialogType === 'acknowledgement'\"\n :actions=\"acknowledgementDialogActions\"\n layout=\"buttons-end\"\n />\n\n <bento-button-actions v-else :actions=\"dialogActions\" layout=\"buttons-end\" />\n </template>\n </base-modal>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, onMounted, type PropType, type Ref, ref, toRefs, useSlots } from 'vue';\n import { BentoModalDialogType, BentoModalRole } from '@/components/modal/modal.types';\n import { useHasSlot } from '@/composables';\n import {\n type BentoButtonActionObject,\n BentoButtonActions,\n type BentoButtonActionsList,\n BentoButtonVariant,\n } from '@/components/button';\n import { useI18n } from '@/utils/ts/i18n';\n import BaseModal from '@/components/modal/components/base-modal/base-modal.vue';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const emit = defineEmits([\"close-modal\"]);\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * Only 1 action button is allowed for Modal Dialog\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',2\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * The id of the current active page\n * Should be the same id as the BentoModalPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * Text that is displayed in the content section of modal\n */\n content: { type: String, required: true },\n\n /**\n * Sets different action buttons styling and appearance\n */\n dialogType: {\n type: String as PropType<BentoModalDialogType | `${BentoModalDialogType}`>,\n required: true,\n },\n\n /**\n * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.\n */\n initiallyOpen: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed by clicking outside of it\n */\n isDismissible: { type: Boolean, required: true },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: { type: Boolean, required: true },\n });\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const { actions, dialogType } = toRefs(props);\n const modalRef: Ref<InstanceType<typeof BaseModal>> = ref(null);\n\n const onCloseModal = () => {\n emit('close-modal');\n };\n\n const onCloseActionButton = (event: Event) => {\n // Calls \"base-modal\" internal function to initialize the\n // \"close\" animation and trigger the \"close\" event.\n // This follows the same \"dialog\" pattern of calling \"dialog.close()\"\n modalRef.value.internalModalActionClose(event);\n };\n\n const acknowledgementDialogActions = computed(() => [\n {\n title: t('ok') as string,\n event: onCloseActionButton,\n variant: BentoButtonVariant.SECONDARY,\n },\n ]);\n\n const dialogActions = computed(() => {\n const mandatoryCancelActionButton: BentoButtonActionObject = {\n title: 'Cancel',\n event: onCloseActionButton,\n };\n const updatedPassedActionsObject: BentoButtonActionObject = actions?.value?.[0];\n\n if (dialogType.value === BentoModalDialogType.DESTRUCTIVE) {\n updatedPassedActionsObject.critical = true;\n } else if (dialogType.value === BentoModalDialogType.INFO) {\n updatedPassedActionsObject.variant = BentoButtonVariant.SECONDARY;\n }\n\n return [updatedPassedActionsObject, mandatoryCancelActionButton];\n });\n\n const modalDialogConditionalClasses = computed(() => ({\n [`b-modal-dialog--${dialogType.value}`]: dialogType.value,\n }));\n\n onMounted(() => {\n if (props.activePage) {\n throw new Error(\n 'Bento Modal Dialog cannot contain multiple pages. Use Bento Modal default variant instead.'\n );\n }\n\n if (!hasSlot('default') || (!props.content && !hasSlot('content'))) {\n throw new Error('Bento Modal Dialog requires header title and content');\n }\n\n if (actions?.value?.length > 1) {\n throw new Error('Not more than 1 action button may be provided to Modal Dialog');\n }\n\n if (dialogType.value !== BentoModalDialogType.ACKNOWLEDGEMENT && !actions?.value) {\n throw new Error('Modal Dialog, except ACKNOWLEDGEMENT type, always has to contain one action button');\n }\n\n if (dialogType.value === BentoModalDialogType.ACKNOWLEDGEMENT && actions?.value?.length) {\n throw new Error('Acknowledgement Modal Dialog does not accept action buttons');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Creates a \"dialog\" type of modal.\n * These are are modals that require a deliberate user action or acknowledgement\n * (confirmations or destructive actions).\n *\n * It’s not customizable and consists of title, description label and one action.\n *\n * @example\n * import { BentoModalDialog } from '@/components/modal/components';\n *\n * export default {\n * components: { BentoModalDialog },\n * template: `\n * <bento-modal-dialog\n * dialog-type=\"destructive\"\n * :is-dismissible=\"false\"\n * :is-open=\"isOpen\"\n * @close-modal=\"isOpen = false\"\n * >\n * Dialog content\n * </bento-modal-dialog>\n * `,\n * setup() {\n * const isOpen = ref(true)\n * }\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-modal-dialog',\n });\n</script>\n","<template>\n <component\n :is=\"computedVariant\"\n class=\"b-modal\"\n :is-open=\"isOpen\"\n :actions=\"actions\"\n :initially-open=\"initiallyOpen\"\n v-bind=\"customProps\"\n @close-modal=\"onCloseModal\"\n @update:active-page=\"emit('update:active-page', $event)\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot></slot>\n </template>\n <template v-if=\"hasSlot('content-col-1')\" #content-col-1><slot name=\"content-col-1\"></slot></template>\n <template v-if=\"hasSlot('content-col-2')\" #content-col-2><slot name=\"content-col-2\"></slot></template>\n <template v-if=\"hasSlot('content')\" #content><slot name=\"content\"></slot></template>\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, type PropType, useAttrs, useSlots, watch } from 'vue';\n import {\n BentoModalColumnLayoutVariant,\n BentoModalDialogType,\n BentoModalSize,\n BentoModalVariant,\n BentoModalVariantMapping,\n } from './modal.types';\n import { BentoModalDefault, BentoModalDialog } from '@/components/modal/components';\n import { useHasSlot } from '@/composables';\n import { type BentoButtonActionsList } from '@/components/button';\n import { deprecate } from '@/utils/ts/deprecate';\n\n const LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME = 500;\n\n type BentoModalVariantProp = BentoModalVariant | `${BentoModalVariant}` | `${BentoModalVariantMapping}`;\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const attrs = useAttrs();\n const emit = defineEmits([\"update:active-page\", \"close-modal\"]);\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',2\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * The id of the current active page\n * Should be the same id as the BentoModalPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * Text label that is displayed left to the action buttons\n */\n actionsLabel: { type: String, default: null },\n\n /**\n * Text that will be displayed in the content section of Modal\n */\n content: { type: String, default: null },\n\n /**\n * If a column layout is provided, it renders the respective left column width variant. This can be smaller than the second column, the same size as the second column or bigger than the second column.\n */\n columnsSize: {\n type: String as PropType<BentoModalColumnLayoutVariant | `${BentoModalColumnLayoutVariant}`>,\n default: BentoModalColumnLayoutVariant.SMALLER,\n validator: (value: BentoModalColumnLayoutVariant) =>\n Object.values(BentoModalColumnLayoutVariant).includes(value),\n },\n\n /**\n * If provided, manages the padding of the whole modal container\n */\n customPadding: { type: String, default: null },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: { type: Boolean, default: false },\n\n /**\n * Changes the visual styling of action buttons\n */\n dialogType: {\n type: String as PropType<BentoModalDialogType | `${BentoModalDialogType}`>,\n default: BentoModalDialogType.CONFIRMATION,\n validator: (value: BentoModalDialogType) => Object.values(BentoModalDialogType).includes(value),\n },\n\n /**\n * Hides a cross icon on the right side of the title\n */\n hideCloseButton: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed without performing an action\n */\n isDismissible: { type: Boolean, default: null },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.\n */\n initiallyOpen: { type: Boolean, default: false },\n\n /**\n * Sets the width of the modal\n */\n size: {\n type: String as PropType<BentoModalSize | `${BentoModalSize}`>,\n default: BentoModalSize.SMALL,\n validator: (value: BentoModalSize) => Object.values(BentoModalSize).includes(value),\n },\n\n /**\n * Choose between default or dialog versions of modal\n */\n variant: {\n type: String as PropType<BentoModalVariantProp>,\n default: 'default',\n validator: (value: BentoModalVariantProp) =>\n Object.values<BentoModalVariantProp>(BentoModalVariant).includes(value) ||\n Object.values<BentoModalVariantProp>(BentoModalVariantMapping).includes(value),\n },\n\n /**\n * If provided, renders the modal's content in a two-column layout an wth dividers separating its content\n */\n withColumnLayout: { type: Boolean, default: false },\n });\n\n const computedVariant = computed(() => {\n if (Object.values<BentoModalVariantProp>(BentoModalVariantMapping).includes(props.variant)) {\n return props.variant;\n }\n return BentoModalVariantMapping[props.variant.toUpperCase()];\n });\n\n const customProps = computed(() =>\n computedVariant.value === BentoModalVariantMapping.DEFAULT\n ? {\n activePage: props.activePage,\n hideCloseButton: props.hideCloseButton,\n size: props.size,\n customPadding: props.customPadding,\n actionsLabel: props.actionsLabel,\n destructiveActions: props.destructiveActions,\n isDismissible: props.isDismissible ?? true,\n withColumnLayout: props.withColumnLayout,\n columnsSize: props.columnsSize,\n ...attrs,\n }\n : {\n activePage: props.activePage,\n dialogType: props.dialogType,\n content: props.content,\n isDismissible: props.isDismissible ?? false,\n ...attrs,\n }\n );\n\n const onCloseModal = () => {\n emit('close-modal');\n };\n\n // If the first button is a loading button then close the modal have 0.5 seconds\n // if the state is changed to 'success'.\n watch(\n () => props.actions,\n () => {\n if (props.actions?.[0]?.state === 'success') {\n setTimeout(onCloseModal, LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME);\n }\n }\n );\n\n if (Object.keys(attrs).includes('overflow-visible')) {\n deprecate(\n 'BentoModal \"overflow-visible\" property',\n `\"overflow-visible\" property was made redundant. BentoModal can work correctly without the need to pass the propery.\n Remove the \"overflow-visible\" prop from BentoModal to remove this error.`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Modal is a window that appear over any other page content\n * and focus user attention exclusively on one task or piece of\n * information at the moment.\n *\n * @example\n * import { BentoModal } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModal },\n * template: `\n * <bento-modal :isOpen=\"true\">\n * Title of the Modal\n * <template #content>\n * Mandatory content slot\n * </template>\n * </bento-modal>\n * `\n * };\n */\n export default defineComponent({\n components: { BentoModalDefault, BentoModalDialog },\n });\n</script>\n"],"names":["__default__","defineComponent","slots","useSlots","hasSlot","useHasSlot","onCloseModal","emit","onMounted","props","messages","t","useI18n","actions","dialogType","toRefs","modalRef","ref","onCloseActionButton","event","acknowledgementDialogActions","computed","BentoButtonVariant","dialogActions","mandatoryCancelActionButton","updatedPassedActionsObject","_a","BentoModalDialogType","modalDialogConditionalClasses","_b","BentoModalDefault","BentoModalDialog","LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME","attrs","useAttrs","computedVariant","BentoModalVariantMapping","customProps","watch","deprecate"],"mappings":";;;;;;;;;AAqMI,MAAAA,IAAeC,EAAgB;AAAA,EAC3B,MAAM;AACV,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA3JKC,IAAQC,EAAA,GACRC,IAAUC,EAAWH,CAAK,GAuG1BI,IAAe,MAAM;AACvB,MAAAC,EAAK,aAAa;AAAA,IACtB;AAEA,WAAAC,EAAU,MAAM;AACZ,UAAI,EAAEJ,EAAQ,SAAS,KAAMA,EAAQ,eAAe,KAAKA,EAAQ,eAAe,MAAO,C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A,EAAM;AAAA,QACnB,GAAGwB;AAAA,MAAA,IAEP;AAAA,QACI,YAAYxB,EAAM;AAAA,QAClB,YAAYA,EAAM;AAAA,QAClB,SAASA,EAAM;AAAA,QACf,eAAeA,EAAM,iBAAiB;AAAA,QACtC,GAAGwB;AAAA,MAAA;AAAA,IACP,GAGJ3B,IAAe,MAAM;AACvB,MAAAC,EAAK,aAAa;AAAA,IACtB;AAIA,WAAA+B;AAAA,MACI,MAAM7B,EAAM;AAAA,MACZ,MAAM;;AACF,UAAIoB,KAAAH,IAAAjB,EAAM,YAAN,gBAAAiB,EAAgB,OAAhB,gBAAAG,EAAoB,WAAU,aAC9B,WAAWvB,GAAc0B,CAA0C;AAAA,MAE3E;AAAA,IAAA,GAGA,OAAO,KAAKC,CAAK,EAAE,SAAS,kBAAkB,KAC9CM;AAAA,MACI;AAAA,MACA;AAAA;AAAA,MAEA;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"modal.Brif0vAy.js","sources":["../../src/components/modal/components/modal-default/modal-default.vue","../../src/components/modal/components/modal-dialog/modal-dialog.vue","../../src/components/modal/modal.vue"],"sourcesContent":["<template>\n <base-modal\n class=\"b-modal-default\"\n v-bind=\"$attrs\"\n :actions=\"actions\"\n :active-page=\"activePage\"\n :size=\"size\"\n :hide-close-button=\"hideCloseButton\"\n :columns-size=\"columnsSize\"\n :custom-padding=\"customPadding\"\n :is-dismissible=\"isDismissible\"\n :is-open=\"isOpen\"\n :with-column-layout=\"withColumnLayout\"\n :initially-open=\"initiallyOpen\"\n @update:active-page=\"emit('update:active-page', $event)\"\n @close-modal=\"onCloseModal\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot></slot>\n </template>\n <template v-if=\"hasSlot('content-col-1')\" #content-col-1><slot name=\"content-col-1\"></slot></template>\n <template v-if=\"hasSlot('content-col-2')\" #content-col-2><slot name=\"content-col-2\"></slot></template>\n <template v-if=\"hasSlot('content')\" #content><slot name=\"content\"></slot></template>\n\n <template v-if=\"actions && actions.length > 0\" #actions>\n <slot name=\"actions\">\n <footer-actions\n :actions=\"actions\"\n :actions-label=\"actionsLabel\"\n :destructive-actions=\"destructiveActions\"\n />\n </slot>\n </template>\n </base-modal>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, onMounted, type PropType, useSlots } from 'vue';\n import { BentoModalColumnLayoutVariant, type BentoModalSize } from '@/components/modal/modal.types';\n import { useHasSlot } from '@/composables';\n import { type BentoButtonActionsList } from '@/components/button';\n import { FooterActions } from '@/components/internal/footer-actions';\n import BaseModal from '@/components/modal/components/base-modal/base-modal.vue';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const emit = defineEmits([\"update:active-page\", \"close-modal\"]);\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n * But you may change the color of 1-st action to red with 'critial' key\n * Not more than 3 action buttons can be provided\n * Or 2 action buttons and 1 Label for them\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',2\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * Text label that is displayed left to the action buttons\n */\n actionsLabel: { type: String, default: null },\n\n /**\n * The id of the current active page\n * Should be the same id as the BentoModalPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * If provided, manages the padding of the whole modal container\n */\n customPadding: { type: String, default: null },\n\n /**\n * If a column layout is provided, it renders the respective left column width variant. This can be smaller than the second column, the same size as the second column or bigger than the second column.\n */\n columnsSize: {\n type: String as PropType<BentoModalColumnLayoutVariant>,\n default: BentoModalColumnLayoutVariant.SMALLER,\n },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: { type: Boolean, default: false },\n\n /**\n * Hides a cross icon on the right side of the title\n */\n hideCloseButton: { type: Boolean, default: false },\n\n /**\n * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.\n */\n initiallyOpen: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed by clicking outside of it\n */\n isDismissible: { type: Boolean, required: true },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: { type: Boolean, required: true },\n\n /**\n * Sets the width of the modal\n */\n size: {\n type: String as PropType<BentoModalSize | `${BentoModalSize}`>,\n required: true,\n },\n\n /**\n * If provided, renders the modal's content in a two-column layout an wth dividers separating its content\n */\n withColumnLayout: { type: Boolean, default: false },\n });\n\n const onCloseModal = () => {\n emit('close-modal');\n };\n\n onMounted(() => {\n if (!(hasSlot('content') || (hasSlot('content-col-1') && hasSlot('content-col-2'))) && !props.activePage) {\n throw new Error('Bento Modal default variant requires content slot or column slots');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Creates a Modal based off the `base-modal` component.\n * It allows two column modals as well as content modals.\n *\n * @example\n * import { BentoModalDefault } from '@/components/modal/components';\n *\n * export default {\n * components: { BentoModalDefault },\n * template: `\n * <bento-modal-default\n * :is-dismissible=\"false\"\n * :is-open=\"isOpen\"\n * @close-modal=\"isOpen = false\"\n * >\n * <template #content-col-1>\n * // Content on the left side column\n * </template>\n *\n * <template #content-col-2>\n * // Content on the right side column\n * </template>\n *\n * <template v-if=\"actions\" #actions>\n * <footer-actions :actions=\"actions\" />\n * </template>\n * </bento-modal-default>\n * `,\n * setup() {\n * const isOpen = ref(true)\n * const footerActions = [{\n * title: 'Primary action',\n * event: () => { ... }\n * }]\n * }\n * }\n */\n export default defineComponent({\n name: 'bento-modal-default',\n });\n</script>\n","<template>\n <base-modal\n ref=\"modalRef\"\n class=\"b-modal-dialog\"\n :actions=\"actions\"\n :active-page=\"activePage\"\n :class=\"modalDialogConditionalClasses\"\n :hide-close-button=\"true\"\n size=\"small\"\n :is-dismissible=\"isDismissible\"\n :is-open=\"isOpen\"\n :modal-role=\"BentoModalRole.ALERT_DIALOG\"\n :initially-open=\"initiallyOpen\"\n v-bind=\"$attrs\"\n @close-modal=\"onCloseModal\"\n >\n <template #default>\n <slot></slot>\n </template>\n <template #content>\n {{ content }}\n </template>\n\n <template #actions>\n <bento-button-actions\n v-if=\"dialogType === 'acknowledgement'\"\n :actions=\"acknowledgementDialogActions\"\n layout=\"buttons-end\"\n />\n\n <bento-button-actions v-else :actions=\"dialogActions\" layout=\"buttons-end\" />\n </template>\n </base-modal>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, onMounted, type PropType, type Ref, ref, toRefs, useSlots } from 'vue';\n import { BentoModalDialogType, BentoModalRole } from '@/components/modal/modal.types';\n import { useHasSlot } from '@/composables';\n import {\n type BentoButtonActionObject,\n BentoButtonActions,\n type BentoButtonActionsList,\n BentoButtonVariant,\n } from '@/components/button';\n import { useI18n } from '@/utils/ts/i18n';\n import BaseModal from '@/components/modal/components/base-modal/base-modal.vue';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const emit = defineEmits([\"close-modal\"]);\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * Only 1 action button is allowed for Modal Dialog\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',2\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * The id of the current active page\n * Should be the same id as the BentoModalPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * Text that is displayed in the content section of modal\n */\n content: { type: String, required: true },\n\n /**\n * Sets different action buttons styling and appearance\n */\n dialogType: {\n type: String as PropType<BentoModalDialogType | `${BentoModalDialogType}`>,\n required: true,\n },\n\n /**\n * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.\n */\n initiallyOpen: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed by clicking outside of it\n */\n isDismissible: { type: Boolean, required: true },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: { type: Boolean, required: true },\n });\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const { actions, dialogType } = toRefs(props);\n const modalRef: Ref<InstanceType<typeof BaseModal>> = ref(null);\n\n const onCloseModal = () => {\n emit('close-modal');\n };\n\n const onCloseActionButton = (event: Event) => {\n // Calls \"base-modal\" internal function to initialize the\n // \"close\" animation and trigger the \"close\" event.\n // This follows the same \"dialog\" pattern of calling \"dialog.close()\"\n modalRef.value.internalModalActionClose(event);\n };\n\n const acknowledgementDialogActions = computed(() => [\n {\n title: t('ok') as string,\n event: onCloseActionButton,\n variant: BentoButtonVariant.SECONDARY,\n },\n ]);\n\n const dialogActions = computed(() => {\n const mandatoryCancelActionButton: BentoButtonActionObject = {\n title: 'Cancel',\n event: onCloseActionButton,\n };\n const updatedPassedActionsObject: BentoButtonActionObject = actions?.value?.[0];\n\n if (dialogType.value === BentoModalDialogType.DESTRUCTIVE) {\n updatedPassedActionsObject.critical = true;\n } else if (dialogType.value === BentoModalDialogType.INFO) {\n updatedPassedActionsObject.variant = BentoButtonVariant.SECONDARY;\n }\n\n return [updatedPassedActionsObject, mandatoryCancelActionButton];\n });\n\n const modalDialogConditionalClasses = computed(() => ({\n [`b-modal-dialog--${dialogType.value}`]: dialogType.value,\n }));\n\n onMounted(() => {\n if (props.activePage) {\n throw new Error(\n 'Bento Modal Dialog cannot contain multiple pages. Use Bento Modal default variant instead.'\n );\n }\n\n if (!hasSlot('default') || (!props.content && !hasSlot('content'))) {\n throw new Error('Bento Modal Dialog requires header title and content');\n }\n\n if (actions?.value?.length > 1) {\n throw new Error('Not more than 1 action button may be provided to Modal Dialog');\n }\n\n if (dialogType.value !== BentoModalDialogType.ACKNOWLEDGEMENT && !actions?.value) {\n throw new Error('Modal Dialog, except ACKNOWLEDGEMENT type, always has to contain one action button');\n }\n\n if (dialogType.value === BentoModalDialogType.ACKNOWLEDGEMENT && actions?.value?.length) {\n throw new Error('Acknowledgement Modal Dialog does not accept action buttons');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Creates a \"dialog\" type of modal.\n * These are are modals that require a deliberate user action or acknowledgement\n * (confirmations or destructive actions).\n *\n * It’s not customizable and consists of title, description label and one action.\n *\n * @example\n * import { BentoModalDialog } from '@/components/modal/components';\n *\n * export default {\n * components: { BentoModalDialog },\n * template: `\n * <bento-modal-dialog\n * dialog-type=\"destructive\"\n * :is-dismissible=\"false\"\n * :is-open=\"isOpen\"\n * @close-modal=\"isOpen = false\"\n * >\n * Dialog content\n * </bento-modal-dialog>\n * `,\n * setup() {\n * const isOpen = ref(true)\n * }\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-modal-dialog',\n });\n</script>\n","<template>\n <component\n :is=\"computedVariant\"\n class=\"b-modal\"\n :is-open=\"isOpen\"\n :actions=\"actions\"\n :initially-open=\"initiallyOpen\"\n v-bind=\"customProps\"\n @close-modal=\"onCloseModal\"\n @update:active-page=\"emit('update:active-page', $event)\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot></slot>\n </template>\n <template v-if=\"hasSlot('content-col-1')\" #content-col-1><slot name=\"content-col-1\"></slot></template>\n <template v-if=\"hasSlot('content-col-2')\" #content-col-2><slot name=\"content-col-2\"></slot></template>\n <template v-if=\"hasSlot('content')\" #content><slot name=\"content\"></slot></template>\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, type PropType, useAttrs, useSlots, watch } from 'vue';\n import {\n BentoModalColumnLayoutVariant,\n BentoModalDialogType,\n BentoModalSize,\n BentoModalVariant,\n BentoModalVariantMapping,\n } from './modal.types';\n import { BentoModalDefault, BentoModalDialog } from '@/components/modal/components';\n import { useHasSlot } from '@/composables';\n import { type BentoButtonActionsList } from '@/components/button';\n import { deprecate } from '@/utils/ts/deprecate';\n\n const LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME = 500;\n\n type BentoModalVariantProp = BentoModalVariant | `${BentoModalVariant}` | `${BentoModalVariantMapping}`;\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const attrs = useAttrs();\n const emit = defineEmits([\"update:active-page\", \"close-modal\"]);\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',2\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * The id of the current active page\n * Should be the same id as the BentoModalPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * Text label that is displayed left to the action buttons\n */\n actionsLabel: { type: String, default: null },\n\n /**\n * Text that will be displayed in the content section of Modal\n */\n content: { type: String, default: null },\n\n /**\n * If a column layout is provided, it renders the respective left column width variant. This can be smaller than the second column, the same size as the second column or bigger than the second column.\n */\n columnsSize: {\n type: String as PropType<BentoModalColumnLayoutVariant | `${BentoModalColumnLayoutVariant}`>,\n default: BentoModalColumnLayoutVariant.SMALLER,\n validator: (value: BentoModalColumnLayoutVariant) =>\n Object.values(BentoModalColumnLayoutVariant).includes(value),\n },\n\n /**\n * If provided, manages the padding of the whole modal container\n */\n customPadding: { type: String, default: null },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: { type: Boolean, default: false },\n\n /**\n * Changes the visual styling of action buttons\n */\n dialogType: {\n type: String as PropType<BentoModalDialogType | `${BentoModalDialogType}`>,\n default: BentoModalDialogType.CONFIRMATION,\n validator: (value: BentoModalDialogType) => Object.values(BentoModalDialogType).includes(value),\n },\n\n /**\n * Hides a cross icon on the right side of the title\n */\n hideCloseButton: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed without performing an action\n */\n isDismissible: { type: Boolean, default: null },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.\n */\n initiallyOpen: { type: Boolean, default: false },\n\n /**\n * Sets the width of the modal\n */\n size: {\n type: String as PropType<BentoModalSize | `${BentoModalSize}`>,\n default: BentoModalSize.SMALL,\n validator: (value: BentoModalSize) => Object.values(BentoModalSize).includes(value),\n },\n\n /**\n * Choose between default or dialog versions of modal\n */\n variant: {\n type: String as PropType<BentoModalVariantProp>,\n default: 'default',\n validator: (value: BentoModalVariantProp) =>\n Object.values<BentoModalVariantProp>(BentoModalVariant).includes(value) ||\n Object.values<BentoModalVariantProp>(BentoModalVariantMapping).includes(value),\n },\n\n /**\n * If provided, renders the modal's content in a two-column layout an wth dividers separating its content\n */\n withColumnLayout: { type: Boolean, default: false },\n });\n\n const computedVariant = computed(() => {\n if (Object.values<BentoModalVariantProp>(BentoModalVariantMapping).includes(props.variant)) {\n return props.variant;\n }\n return BentoModalVariantMapping[props.variant.toUpperCase()];\n });\n\n const customProps = computed(() =>\n computedVariant.value === BentoModalVariantMapping.DEFAULT\n ? {\n activePage: props.activePage,\n hideCloseButton: props.hideCloseButton,\n size: props.size,\n customPadding: props.customPadding,\n actionsLabel: props.actionsLabel,\n destructiveActions: props.destructiveActions,\n isDismissible: props.isDismissible ?? true,\n withColumnLayout: props.withColumnLayout,\n columnsSize: props.columnsSize,\n ...attrs,\n }\n : {\n activePage: props.activePage,\n dialogType: props.dialogType,\n content: props.content,\n isDismissible: props.isDismissible ?? false,\n ...attrs,\n }\n );\n\n const onCloseModal = () => {\n emit('close-modal');\n };\n\n // If the first button is a loading button then close the modal have 0.5 seconds\n // if the state is changed to 'success'.\n watch(\n () => props.actions,\n () => {\n if (props.actions?.[0]?.state === 'success') {\n setTimeout(onCloseModal, LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME);\n }\n }\n );\n\n if (Object.keys(attrs).includes('overflow-visible')) {\n deprecate(\n 'BentoModal \"overflow-visible\" property',\n `\"overflow-visible\" property was made redundant. BentoModal can work correctly without the need to pass the propery.\n Remove the \"overflow-visible\" prop from BentoModal to remove this error.`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Modal is a window that appear over any other page content\n * and focus user attention exclusively on one task or piece of\n * information at the moment.\n *\n * @example\n * import { BentoModal } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModal },\n * template: `\n * <bento-modal :isOpen=\"true\">\n * Title of the Modal\n * <template #content>\n * Mandatory content slot\n * </template>\n * </bento-modal>\n * `\n * };\n */\n export default defineComponent({\n components: { BentoModalDefault, BentoModalDialog },\n });\n</script>\n"],"names":["__default__","defineComponent","slots","useSlots","hasSlot","useHasSlot","onCloseModal","emit","onMounted","props","messages","t","useI18n","actions","dialogType","toRefs","modalRef","ref","onCloseActionButton","event","acknowledgementDialogActions","computed","BentoButtonVariant","dialogActions","mandatoryCancelActionButton","updatedPassedActionsObject","_a","BentoModalDialogType","modalDialogConditionalClasses","_b","BentoModalDefault","BentoModalDialog","LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME","attrs","useAttrs","computedVariant","BentoModalVariantMapping","customProps","watch","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