@adyen/bento-vue2 1.97.0 → 1.98.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 (229) hide show
  1. package/dist/@types/index.d.ts +66 -1
  2. package/dist/action-bar.js +1 -1
  3. package/dist/ai-tag.js +1 -1
  4. package/dist/anchor-scroller.js +1 -1
  5. package/dist/assets/accordion-item.css +1 -1
  6. package/dist/assets/action-bar.css +1 -1
  7. package/dist/assets/base-modal.css +1 -1
  8. package/dist/assets/button-actions.css +1 -1
  9. package/dist/assets/calendar.css +1 -1
  10. package/dist/assets/card.css +1 -1
  11. package/dist/assets/data-grid.css +1 -1
  12. package/dist/assets/date.css +1 -1
  13. package/dist/assets/dialog-page.css +1 -1
  14. package/dist/assets/draggable-handle.css +1 -1
  15. package/dist/assets/draggable.css +1 -0
  16. package/dist/assets/dropdown.css +1 -1
  17. package/dist/assets/file-uploader.css +1 -1
  18. package/dist/assets/filter-bar.css +1 -1
  19. package/dist/assets/header-meta.css +1 -1
  20. package/dist/assets/inspector.css +1 -1
  21. package/dist/assets/list-item.css +1 -1
  22. package/dist/assets/modal-fullscreen.css +1 -1
  23. package/dist/assets/navigation-menu-group.css +1 -1
  24. package/dist/assets/secondary-nav.css +1 -1
  25. package/dist/assets/sidepanel.css +1 -1
  26. package/dist/button.js +1 -1
  27. package/dist/card.js +1 -1
  28. package/dist/checkbox.js +2 -2
  29. package/dist/chunks/{action-bar.B890LCTe.js → action-bar.X-dXuOcv.js} +4 -4
  30. package/dist/chunks/{action-bar.B890LCTe.js.map → action-bar.X-dXuOcv.js.map} +1 -1
  31. package/dist/chunks/{ai-tag.C8RxACNj.js → ai-tag.Cdn4JK1m.js} +2 -2
  32. package/dist/chunks/{ai-tag.C8RxACNj.js.map → ai-tag.Cdn4JK1m.js.map} +1 -1
  33. package/dist/chunks/{anchor-scroller.B8VXotik.js → anchor-scroller.Bu7GtOqH.js} +5 -5
  34. package/dist/chunks/{anchor-scroller.B8VXotik.js.map → anchor-scroller.Bu7GtOqH.js.map} +1 -1
  35. package/dist/chunks/{base-modal.CDMoF3b_.js → base-modal.DgMSsQf3.js} +5 -5
  36. package/dist/chunks/{base-modal.CDMoF3b_.js.map → base-modal.DgMSsQf3.js.map} +1 -1
  37. package/dist/chunks/{button-actions-with-menu.DqDQ_gVX.js → button-actions-with-menu.BV5aDUCD.js} +3 -3
  38. package/dist/chunks/{button-actions-with-menu.DqDQ_gVX.js.map → button-actions-with-menu.BV5aDUCD.js.map} +1 -1
  39. package/dist/chunks/{button-actions.DKc63aCb.js → button-actions.BD4Dyp4U.js} +2 -2
  40. package/dist/chunks/{button-actions.DKc63aCb.js.map → button-actions.BD4Dyp4U.js.map} +1 -1
  41. package/dist/chunks/{calendar.BckAv9N_.js → calendar.B0GnBaAW.js} +154 -153
  42. package/dist/chunks/calendar.B0GnBaAW.js.map +1 -0
  43. package/dist/chunks/{card.ChBURa5R.js → card.Bm7JEsCC.js} +2 -2
  44. package/dist/chunks/{card.ChBURa5R.js.map → card.Bm7JEsCC.js.map} +1 -1
  45. package/dist/chunks/{checkbox-group.BAjvgXlc.js → checkbox-group.mgC7eJkE.js} +3 -3
  46. package/dist/chunks/{checkbox-group.BAjvgXlc.js.map → checkbox-group.mgC7eJkE.js.map} +1 -1
  47. package/dist/chunks/{checkbox.BAQDBNL6.js → checkbox.CBawZCc6.js} +2 -2
  48. package/dist/chunks/{checkbox.BAQDBNL6.js.map → checkbox.CBawZCc6.js.map} +1 -1
  49. package/dist/chunks/{code-snippet.nUo9bjhC.js → code-snippet.CpHbw0xj.js} +4 -4
  50. package/dist/chunks/{code-snippet.nUo9bjhC.js.map → code-snippet.CpHbw0xj.js.map} +1 -1
  51. package/dist/chunks/{controls-group.Bzpsrtcx.js → controls-group.BWzCb_GU.js} +2 -2
  52. package/dist/chunks/{controls-group.Bzpsrtcx.js.map → controls-group.BWzCb_GU.js.map} +1 -1
  53. package/dist/chunks/{copy.DVB6pQC8.js → copy.CWKdfVcd.js} +3 -3
  54. package/dist/chunks/{copy.DVB6pQC8.js.map → copy.CWKdfVcd.js.map} +1 -1
  55. package/dist/chunks/{dashboard-section.BDDVJpxY.js → dashboard-section.CRn7tlX_.js} +4 -4
  56. package/dist/chunks/{dashboard-section.BDDVJpxY.js.map → dashboard-section.CRn7tlX_.js.map} +1 -1
  57. package/dist/chunks/{dashed-underline.CfEmbgOv.js → dashed-underline.BoHt4iGu.js} +4 -4
  58. package/dist/chunks/{dashed-underline.CfEmbgOv.js.map → dashed-underline.BoHt4iGu.js.map} +1 -1
  59. package/dist/chunks/{data-grid-template.BUlLHTYe.js → data-grid-template.BYMLOzkm.js} +4 -4
  60. package/dist/chunks/{data-grid-template.BUlLHTYe.js.map → data-grid-template.BYMLOzkm.js.map} +1 -1
  61. package/dist/chunks/{data-grid.0OiCQjFc.js → data-grid.BRziyZ43.js} +19 -19
  62. package/dist/chunks/{data-grid.0OiCQjFc.js.map → data-grid.BRziyZ43.js.map} +1 -1
  63. package/dist/chunks/{date-picker.CsFSskqf.js → date-picker.CCJtLnE4.js} +7 -7
  64. package/dist/chunks/{date-picker.CsFSskqf.js.map → date-picker.CCJtLnE4.js.map} +1 -1
  65. package/dist/chunks/{date-range-picker.Bczgdu5X.js → date-range-picker.B2u5vm8m.js} +10 -10
  66. package/dist/chunks/{date-range-picker.Bczgdu5X.js.map → date-range-picker.B2u5vm8m.js.map} +1 -1
  67. package/dist/chunks/{date-time-picker.DT54TiG4.js → date-time-picker.CP-IrUwY.js} +5 -5
  68. package/dist/chunks/{date-time-picker.DT54TiG4.js.map → date-time-picker.CP-IrUwY.js.map} +1 -1
  69. package/dist/chunks/{date.B0m0sFP6.js → date.C1HnIyOv.js} +27 -25
  70. package/dist/chunks/date.C1HnIyOv.js.map +1 -0
  71. package/dist/chunks/{dialog-page.DYWnKdnP.js → dialog-page.BendBRv6.js} +10 -10
  72. package/dist/chunks/{dialog-page.DYWnKdnP.js.map → dialog-page.BendBRv6.js.map} +1 -1
  73. package/dist/chunks/draggable-handle.BnRkhlee.js +1611 -0
  74. package/dist/chunks/draggable-handle.BnRkhlee.js.map +1 -0
  75. package/dist/chunks/draggable.D5WFD5eX.js +193 -0
  76. package/dist/chunks/draggable.D5WFD5eX.js.map +1 -0
  77. package/dist/chunks/{drawer.WW7G9cSC.js → drawer.BuCNjIKQ.js} +2 -2
  78. package/dist/chunks/{drawer.WW7G9cSC.js.map → drawer.BuCNjIKQ.js.map} +1 -1
  79. package/dist/chunks/{dropdown-tag.BqSrkuwj.js → dropdown-tag.LIt7SdwS.js} +3 -3
  80. package/dist/chunks/{dropdown-tag.BqSrkuwj.js.map → dropdown-tag.LIt7SdwS.js.map} +1 -1
  81. package/dist/chunks/{dropdown.CIEm6MBB.js → dropdown.NTGSuWAw.js} +847 -822
  82. package/dist/chunks/dropdown.NTGSuWAw.js.map +1 -0
  83. package/dist/chunks/{field-label.CdVbAfK-.js → field-label.CkMM3cXO.js} +2 -2
  84. package/dist/chunks/{field-label.CdVbAfK-.js.map → field-label.CkMM3cXO.js.map} +1 -1
  85. package/dist/chunks/{file-uploader.DOvQMUHC.js → file-uploader.BLoJVqZQ.js} +3 -3
  86. package/dist/chunks/{file-uploader.DOvQMUHC.js.map → file-uploader.BLoJVqZQ.js.map} +1 -1
  87. package/dist/chunks/{filter-bar.DVRPM9tf.js → filter-bar.CftgpM7Z.js} +20 -20
  88. package/dist/chunks/filter-bar.CftgpM7Z.js.map +1 -0
  89. package/dist/chunks/{focus-trap.CBIb3SyN.js → focus-trap.CUZQ1kQD.js} +2 -2
  90. package/dist/chunks/{focus-trap.CBIb3SyN.js.map → focus-trap.CUZQ1kQD.js.map} +1 -1
  91. package/dist/chunks/{footer-actions.C1sXd7ti.js → footer-actions.C89dbDV4.js} +2 -2
  92. package/dist/chunks/{footer-actions.C1sXd7ti.js.map → footer-actions.C89dbDV4.js.map} +1 -1
  93. package/dist/chunks/generate-uid.NJ8tVoha.js.map +1 -1
  94. package/dist/chunks/{header-meta.D1eb37QJ.js → header-meta.Cpk3Z8c2.js} +56 -51
  95. package/dist/chunks/{header-meta.D1eb37QJ.js.map → header-meta.Cpk3Z8c2.js.map} +1 -1
  96. package/dist/chunks/{header-with-views.Bk6ly102.js → header-with-views.UmWf3dQd.js} +10 -10
  97. package/dist/chunks/{header-with-views.Bk6ly102.js.map → header-with-views.UmWf3dQd.js.map} +1 -1
  98. package/dist/chunks/{header.CszOmM16.js → header.BRBY9Ilh.js} +3 -3
  99. package/dist/chunks/{header.CszOmM16.js.map → header.BRBY9Ilh.js.map} +1 -1
  100. package/dist/chunks/{index.CJYgd0QI.js → index.BPUMyryR.js} +14 -14
  101. package/dist/chunks/{index.CJYgd0QI.js.map → index.BPUMyryR.js.map} +1 -1
  102. package/dist/chunks/{info-icon.9Nt7zg3D.js → info-icon.ZVQsMymB.js} +3 -3
  103. package/dist/chunks/{info-icon.9Nt7zg3D.js.map → info-icon.ZVQsMymB.js.map} +1 -1
  104. package/dist/chunks/{input-field-password.C4Wxsl16.js → input-field-password.bhLfqs6p.js} +5 -5
  105. package/dist/chunks/{input-field-password.C4Wxsl16.js.map → input-field-password.bhLfqs6p.js.map} +1 -1
  106. package/dist/chunks/{input-field-phone-number.BhYTU628.js → input-field-phone-number.cAROnxRW.js} +2 -2
  107. package/dist/chunks/{input-field-phone-number.BhYTU628.js.map → input-field-phone-number.cAROnxRW.js.map} +1 -1
  108. package/dist/chunks/{input-field.3tzX7t2y.js → input-field.BgVjWpiF.js} +3 -3
  109. package/dist/chunks/{input-field.3tzX7t2y.js.map → input-field.BgVjWpiF.js.map} +1 -1
  110. package/dist/chunks/{input-time.Bf-ZrCPX.js → input-time.C5qQ6S8d.js} +3 -3
  111. package/dist/chunks/{input-time.Bf-ZrCPX.js.map → input-time.C5qQ6S8d.js.map} +1 -1
  112. package/dist/chunks/{inspector.BY3SoX-l.js → inspector.8QKfd0HF.js} +3 -3
  113. package/dist/chunks/{inspector.BY3SoX-l.js.map → inspector.8QKfd0HF.js.map} +1 -1
  114. package/dist/chunks/{layout-row.BI9ZJa-9.js → layout-row.CTBhpBUq.js} +9 -9
  115. package/dist/chunks/{layout-row.BI9ZJa-9.js.map → layout-row.CTBhpBUq.js.map} +1 -1
  116. package/dist/chunks/list-item.BxQkbnLZ.js +193 -0
  117. package/dist/chunks/list-item.BxQkbnLZ.js.map +1 -0
  118. package/dist/chunks/{listbox-option-tag.Ddyl2vuc.js → listbox-option-tag.BFW39wpD.js} +2 -2
  119. package/dist/chunks/{listbox-option-tag.Ddyl2vuc.js.map → listbox-option-tag.BFW39wpD.js.map} +1 -1
  120. package/dist/chunks/{modal-fullscreen.Dg1Hi3jB.js → modal-fullscreen.CH2wwAtk.js} +4 -4
  121. package/dist/chunks/{modal-fullscreen.Dg1Hi3jB.js.map → modal-fullscreen.CH2wwAtk.js.map} +1 -1
  122. package/dist/chunks/{modal.DZTEFM_E.js → modal.e1Ym209E.js} +4 -4
  123. package/dist/chunks/{modal.DZTEFM_E.js.map → modal.e1Ym209E.js.map} +1 -1
  124. package/dist/chunks/{navigation-menu-group.Dv2_ZRRq.js → navigation-menu-group.E1Oam9-n.js} +3 -3
  125. package/dist/chunks/{navigation-menu-group.Dv2_ZRRq.js.map → navigation-menu-group.E1Oam9-n.js.map} +1 -1
  126. package/dist/chunks/{pagination.C6HIPq58.js → pagination.BzLKzijQ.js} +2 -2
  127. package/dist/chunks/{pagination.C6HIPq58.js.map → pagination.BzLKzijQ.js.map} +1 -1
  128. package/dist/chunks/popover.types.ZXsQ9bA6.js +6 -0
  129. package/dist/chunks/{popover.types.B9TXaqAt.js.map → popover.types.ZXsQ9bA6.js.map} +1 -1
  130. package/dist/chunks/{popper-container.CFYFCz6u.js → popper-container.dxpRn9a5.js} +2 -2
  131. package/dist/chunks/{popper-container.CFYFCz6u.js.map → popper-container.dxpRn9a5.js.map} +1 -1
  132. package/dist/chunks/{promo-banner.tljKS80K.js → promo-banner.BVBt9w4u.js} +2 -2
  133. package/dist/chunks/{promo-banner.tljKS80K.js.map → promo-banner.BVBt9w4u.js.map} +1 -1
  134. package/dist/chunks/{radio-group.cn4lZb8R.js → radio-group.D5fpHqkP.js} +3 -3
  135. package/dist/chunks/{radio-group.cn4lZb8R.js.map → radio-group.D5fpHqkP.js.map} +1 -1
  136. package/dist/chunks/{rich-text-editor.-B96ibAd.js → rich-text-editor.VWCBSRmM.js} +4 -4
  137. package/dist/chunks/{rich-text-editor.-B96ibAd.js.map → rich-text-editor.VWCBSRmM.js.map} +1 -1
  138. package/dist/chunks/{search-bar.DunTxVmZ.js → search-bar.Be3RlmLA.js} +3 -3
  139. package/dist/chunks/{search-bar.DunTxVmZ.js.map → search-bar.Be3RlmLA.js.map} +1 -1
  140. package/dist/chunks/{secondary-nav.CGGPkYpc.js → secondary-nav.Cy4ap53E.js} +4 -4
  141. package/dist/chunks/{secondary-nav.CGGPkYpc.js.map → secondary-nav.Cy4ap53E.js.map} +1 -1
  142. package/dist/chunks/{segmented-control.C0JtDa4q.js → segmented-control.BOyYIUEp.js} +2 -2
  143. package/dist/chunks/{segmented-control.C0JtDa4q.js.map → segmented-control.BOyYIUEp.js.map} +1 -1
  144. package/dist/chunks/{selection-card-group.ZZ_qF1L1.js → selection-card-group.lNZ8z318.js} +3 -3
  145. package/dist/chunks/{selection-card-group.ZZ_qF1L1.js.map → selection-card-group.lNZ8z318.js.map} +1 -1
  146. package/dist/chunks/{sidepanel.ChuW63J7.js → sidepanel.CN_u-b5X.js} +5 -5
  147. package/dist/chunks/{sidepanel.ChuW63J7.js.map → sidepanel.CN_u-b5X.js.map} +1 -1
  148. package/dist/chunks/{structured-list-item.DE0L0kvs.js → structured-list-item.CL1jhdTX.js} +4 -4
  149. package/dist/chunks/{structured-list-item.DE0L0kvs.js.map → structured-list-item.CL1jhdTX.js.map} +1 -1
  150. package/dist/chunks/{summary-grid.types.BnEhhDQz.js → summary-grid.types.Cjrwg4vd.js} +5 -5
  151. package/dist/chunks/{summary-grid.types.BnEhhDQz.js.map → summary-grid.types.Cjrwg4vd.js.map} +1 -1
  152. package/dist/chunks/{tab.QEKU5Udp.js → tab.B2qRfTqx.js} +2 -2
  153. package/dist/chunks/{tab.QEKU5Udp.js.map → tab.B2qRfTqx.js.map} +1 -1
  154. package/dist/chunks/{tag.CbNFG45Y.js → tag.XeZzHnx_.js} +2 -2
  155. package/dist/chunks/{tag.CbNFG45Y.js.map → tag.XeZzHnx_.js.map} +1 -1
  156. package/dist/chunks/{textarea.DJ7095b6.js → textarea.CbCrtcQ2.js} +2 -2
  157. package/dist/chunks/{textarea.DJ7095b6.js.map → textarea.CbCrtcQ2.js.map} +1 -1
  158. package/dist/chunks/{timeline-item.DzMh520x.js → timeline-item.BVOztUi9.js} +7 -7
  159. package/dist/chunks/{timeline-item.DzMh520x.js.map → timeline-item.BVOztUi9.js.map} +1 -1
  160. package/dist/chunks/{tooltip.CnkqMpOA.js → tooltip.CGeGVHyl.js} +3 -3
  161. package/dist/chunks/{tooltip.CnkqMpOA.js.map → tooltip.CGeGVHyl.js.map} +1 -1
  162. package/dist/chunks/{tutorial.CkeL_7Je.js → tutorial.WeP9PjhU.js} +4 -4
  163. package/dist/chunks/{tutorial.CkeL_7Je.js.map → tutorial.WeP9PjhU.js.map} +1 -1
  164. package/dist/chunks/{use-bento-delayed-hover.D4rfUUOr.js → use-bento-delayed-hover.CxJOLxok.js} +2 -2
  165. package/dist/chunks/{use-bento-delayed-hover.D4rfUUOr.js.map → use-bento-delayed-hover.CxJOLxok.js.map} +1 -1
  166. package/dist/chunks/{use-date-input-formatter.Dq9C0nc9.js → use-date-input-formatter.BMciZYTp.js} +2 -2
  167. package/dist/chunks/{use-date-input-formatter.Dq9C0nc9.js.map → use-date-input-formatter.BMciZYTp.js.map} +1 -1
  168. package/dist/code-snippet.js +1 -1
  169. package/dist/dashboard-template.js +1 -1
  170. package/dist/dashed-underline.js +1 -1
  171. package/dist/data-grid-template.js +1 -1
  172. package/dist/data-grid.js +1 -1
  173. package/dist/date-picker.js +2 -2
  174. package/dist/date-range-picker.js +2 -2
  175. package/dist/date-time-picker.js +1 -1
  176. package/dist/date.js +1 -1
  177. package/dist/draggable.js +4 -3
  178. package/dist/draggable.js.map +1 -1
  179. package/dist/drawer.js +1 -1
  180. package/dist/dropdown.js +2 -2
  181. package/dist/file-uploader.js +1 -1
  182. package/dist/filter-bar.js +1 -1
  183. package/dist/focus-trap.js +1 -1
  184. package/dist/header-with-views.js +1 -1
  185. package/dist/header.js +1 -1
  186. package/dist/index.js +264 -263
  187. package/dist/index.js.map +1 -1
  188. package/dist/info-icon.js +1 -1
  189. package/dist/input-field-password.js +1 -1
  190. package/dist/input-field-phone-number.js +1 -1
  191. package/dist/input-field.js +1 -1
  192. package/dist/input-time.js +1 -1
  193. package/dist/inspector.js +1 -1
  194. package/dist/internal.js +11 -11
  195. package/dist/layout.js +1 -1
  196. package/dist/list.js +1 -1
  197. package/dist/menu.js +1 -1
  198. package/dist/modal-fullscreen.js +1 -1
  199. package/dist/modal.js +2 -2
  200. package/dist/navigation-menu.js +1 -1
  201. package/dist/pagination.js +1 -1
  202. package/dist/popover.js +2 -2
  203. package/dist/popper-container.js +1 -1
  204. package/dist/promo-banner.js +1 -1
  205. package/dist/radio-group.js +1 -1
  206. package/dist/rich-text-editor.js +1 -1
  207. package/dist/search-bar.js +2 -2
  208. package/dist/secondary-nav.js +1 -1
  209. package/dist/segmented-control.js +1 -1
  210. package/dist/selection-card.js +1 -1
  211. package/dist/sidepanel.js +1 -1
  212. package/dist/structured-list.js +1 -1
  213. package/dist/summary-grid.js +1 -1
  214. package/dist/tabs.js +1 -1
  215. package/dist/tag.js +1 -1
  216. package/dist/textarea.js +1 -1
  217. package/dist/timeline.js +1 -1
  218. package/dist/tutorial.js +1 -1
  219. package/dist/web-types.json +61 -1
  220. package/package.json +8 -8
  221. package/dist/chunks/calendar.BckAv9N_.js.map +0 -1
  222. package/dist/chunks/date.B0m0sFP6.js.map +0 -1
  223. package/dist/chunks/draggable-handle.DwJBaf5y.js +0 -1747
  224. package/dist/chunks/draggable-handle.DwJBaf5y.js.map +0 -1
  225. package/dist/chunks/dropdown.CIEm6MBB.js.map +0 -1
  226. package/dist/chunks/filter-bar.DVRPM9tf.js.map +0 -1
  227. package/dist/chunks/list-item.D2ZLiS_D.js +0 -76
  228. package/dist/chunks/list-item.D2ZLiS_D.js.map +0 -1
  229. package/dist/chunks/popover.types.B9TXaqAt.js +0 -6
@@ -1,10 +1,10 @@
1
1
  import { defineComponent as x, ref as d, computed as o, watch as E, nextTick as G } from "vue";
2
2
  import { s as B, a as h } from "./set-time-in-date.CU7HeZLY.js";
3
- import { e as I, s as S } from "./calendar.BckAv9N_.js";
4
- import { B as q } from "./date-picker.CsFSskqf.js";
5
- import { B as R, i as y } from "./input-time.Bf-ZrCPX.js";
3
+ import { e as I, s as S } from "./calendar.B0GnBaAW.js";
4
+ import { B as q } from "./date-picker.CCJtLnE4.js";
5
+ import { B as R, i as y } from "./input-time.C5qQ6S8d.js";
6
6
  import "./index.Cl4_42j5.js";
7
- import { u as j } from "./use-date-input-formatter.Dq9C0nc9.js";
7
+ import { u as j } from "./use-date-input-formatter.BMciZYTp.js";
8
8
  import { u as z } from "./use-touch-device.DTqFAbXh.js";
9
9
  import { u as L } from "./index.B6WW_F-J.js";
10
10
  import { B as O } from "./form-layout-group.zE6TNlzD.js";
@@ -174,4 +174,4 @@ const ue = Q.exports;
174
174
  export {
175
175
  ue as d
176
176
  };
177
- //# sourceMappingURL=date-time-picker.DT54TiG4.js.map
177
+ //# sourceMappingURL=date-time-picker.CP-IrUwY.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-time-picker.DT54TiG4.js","sources":["../../src/components/date-time-picker/date-time-picker.vue"],"sourcesContent":["<template>\n <div class=\"b-date-time-picker\">\n <bento-form-layout-group class=\"b-date-time-picker__inputs\" layout=\"50-50\" :error-message=\"props.errorMessage\">\n <bento-date-picker\n class=\"b-date-time-picker__date-input\"\n v-bind=\"resolvedDateProps\"\n :model-value=\"dateValue\"\n @update:model-value=\"onDateChanged\"\n />\n <bento-input-time\n class=\"b-date-time-picker__time-input\"\n v-bind=\"resolvedTimeProps\"\n :model-value=\"timeValue\"\n @update:model-value=\"onTimeChanged\"\n />\n </bento-form-layout-group>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, ref, watch } from 'vue';\n import { setMilliseconds } from 'date-fns/setMilliseconds';\n import { startOfDay } from 'date-fns/startOfDay';\n\n // Components\n import { BentoDatePicker } from '@/components/date-picker';\n import { BentoFormLayoutGroup } from '@/components/form-layout';\n import { BentoInputTime } from '@/components/input-time';\n\n // Utils\n import { useDateInputFormatter, useTouchDevice } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import { dateToTimeInputString, setTimeInDateObject } from '@/utils/ts/format-date';\n import { isValidTimeString } from '@/utils/ts/time-input';\n\n // Types\n import type {\n BentoDateTimePickerEmits,\n BentoDateTimePickerProps,\n BentoDateTimePickerValue,\n } from './date-time-picker.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n modelValue: { default: null },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\n isDateDisabled: { default: undefined },\n max: { default: null },\n min: { default: null },\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n dateProps: { default: () => ({}) },\n timeProps: { default: () => ({}) }\n});\n\n const emit = defineEmits([\"update:model-value\", \"input:valid\", \"input:error\"]);\n const currentDate = ref<Date | null>(null);\n const currentTimeText = ref('');\n const dateError = ref<keyof MessageSchema | null>(null);\n const timeError = ref<keyof MessageSchema | null>(null);\n const { dateFormat } = useDateInputFormatter();\n const { isTouchDevice } = useTouchDevice();\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const dateValue = computed(() => currentDate.value);\n const timeValue = computed(() => currentTimeText.value);\n const resolvedIsDateDisabled = computed(() => props.dateProps?.isDateDisabled ?? props.isDateDisabled);\n const dateDescription = computed(() => {\n if (isTouchDevice.value) {\n return props.dateProps?.description;\n } else {\n return props.dateProps?.description\n ? `${props.dateProps.description} ${t(dateFormat.value)}`\n : t(dateFormat.value);\n }\n });\n\n const isMergedDateInBounds = (date: Date) => {\n if (resolvedIsDateDisabled.value?.(startOfDay(date))) {\n return false;\n }\n\n if (props.min && date < setMilliseconds(props.min, 0)) {\n return false;\n }\n\n if (props.max && date > setMilliseconds(props.max, 0)) {\n return false;\n }\n\n return true;\n };\n\n const resolvedDateProps = computed(() => ({\n disabled: props.disabled,\n isDateDisabled: props.isDateDisabled,\n max: props.max,\n min: props.min,\n readonly: props.readonly,\n required: props.required,\n errorMessage: dateErrorMessage.value,\n ...props.dateProps,\n description: dateDescription.value,\n }));\n\n const resolvedTimeProps = computed(() => ({\n disabled: props.disabled,\n errorMessage: timeErrorMessage.value,\n readonly: props.readonly,\n required: props.required,\n ...props.timeProps,\n }));\n\n const dateErrorMessage = computed(() => {\n if (props.errorMessage) {\n return props.errorMessage;\n }\n return dateError.value ? t(dateError.value) : null;\n });\n\n const timeErrorMessage = computed(() => {\n if (props.errorMessage) {\n return props.errorMessage;\n }\n return timeError.value ? t(timeError.value) : null;\n });\n\n const clearErrors = () => {\n dateError.value = null;\n timeError.value = null;\n };\n\n /**\n * Guards the modelValue watcher from clearing user input when the null was emitted\n * by our own validation logic (e.g. partial/invalid input). Without this flag,\n * the parent's v-model round-trip would trigger the watcher and wipe the fields.\n * Reset on nextTick so that genuine external resets (e.g. a form clear button)\n * still clear the UI.\n */\n const isSelfEmittedUpdate = ref(false);\n\n watch(\n () => props.modelValue,\n newValue => {\n if (isSelfEmittedUpdate.value) {\n return;\n }\n\n if (newValue) {\n // Sync internal state when a valid Date is set (e.g. programmatic update from parent)\n currentDate.value = newValue;\n currentTimeText.value = dateToTimeInputString(newValue);\n } else {\n // External reset (e.g. parent sets modelValue to null via a form clear button):\n // clear all internal state so the UI resets fully.\n currentDate.value = null;\n currentTimeText.value = '';\n clearErrors();\n }\n },\n { immediate: true }\n );\n\n const validateBounds = (value: BentoDateTimePickerValue) => !value || isMergedDateInBounds(value);\n\n const emitValidationState = (isValid: boolean) => {\n if (isValid) {\n emit('input:valid');\n } else {\n emit('input:error');\n }\n };\n\n const emitModelValue = (value: BentoDateTimePickerValue) => {\n isSelfEmittedUpdate.value = true;\n emit('update:model-value', value);\n nextTick(() => {\n isSelfEmittedUpdate.value = false;\n });\n };\n\n const emitValidatedValue = (value: BentoDateTimePickerValue) => {\n emitModelValue(value);\n emitValidationState(validateBounds(value));\n };\n\n const emitInvalidModelValue = (value: BentoDateTimePickerValue) => {\n emitModelValue(value);\n emitValidationState(false);\n };\n\n const onDateChanged = (date: Date | null) => {\n currentDate.value = date;\n\n // Date invalid/cleared: error if time is populated, valid if both empty\n if (!date) {\n if (currentTimeText.value) {\n dateError.value = 'invalidDateFormat';\n emitInvalidModelValue(null);\n } else {\n clearErrors();\n emitValidatedValue(null);\n }\n return;\n }\n\n clearErrors();\n\n // Prefill time with midnight when empty so the user sees a value\n if (!currentTimeText.value) {\n currentTimeText.value = '00:00:00';\n }\n\n const time = currentTimeText.value;\n\n // Date valid but time invalid: preserve date, signal error\n if (!isValidTimeString(time)) {\n emitInvalidModelValue(null);\n return;\n }\n\n // Both valid: merge and emit\n emitValidatedValue(setTimeInDateObject(date, time));\n };\n\n const onTimeChanged = (time: string) => {\n currentTimeText.value = time;\n\n // Time cleared: error if date is set (time is required once prefilled), valid-null if both empty\n if (!time) {\n if (currentDate.value) {\n timeError.value = 'enterTimeForDate';\n emitInvalidModelValue(null);\n } else {\n clearErrors();\n emitValidatedValue(null);\n }\n return;\n }\n\n timeError.value = null;\n\n // Time invalid: preserve date, signal error\n if (!isValidTimeString(time)) {\n emitInvalidModelValue(null);\n return;\n }\n\n // Time valid but no date: signal error\n if (!currentDate.value) {\n dateError.value = 'invalidDateFormat';\n emitInvalidModelValue(null);\n return;\n }\n\n // Both valid: merge and emit\n emitValidatedValue(setTimeInDateObject(currentDate.value, time));\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Date time picker that combines a date picker (single date) with a time input.\n *\n * @example\n * import { BentoDateTimePicker } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDateTimePicker },\n * template: `\n * <bento-date-time-picker\n * :date-props=\"{ label: 'Date' }\"\n * :time-props=\"{ label: 'Time' }\"\n * required\n * :model-value=\"dateTimeValue\"\n * @update:model-value=\"newValue => dateTimeValue = newValue\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-date-time-picker',\n inheritAttrs: false,\n model: { prop: 'modelValue', event: 'update:model-value' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./date-time-picker.scss\" />\n"],"names":["__default__","messages","currentDate","ref","currentTimeText","dateError","timeError","dateFormat","useDateInputFormatter","isTouchDevice","useTouchDevice","t","useI18n","dateValue","computed","timeValue","resolvedIsDateDisabled","_a","props","dateDescription","_b","isMergedDateInBounds","date","startOfDay","setMilliseconds","resolvedDateProps","dateErrorMessage","resolvedTimeProps","timeErrorMessage","clearErrors","isSelfEmittedUpdate","watch","newValue","dateToTimeInputString","validateBounds","value","emitValidationState","isValid","emit","emitModelValue","nextTick","emitValidatedValue","emitInvalidModelValue","time","isValidTimeString","setTimeInDateObject"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2RIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAAA,EACM,MAAA;AAAA,EACX,cAAA;AAAA,EACQ,OAAA,EAAA,MAAA,cAAA,OAAA,qBAAA;AAElB;;;;;;;;;;;;;;;;iBArOAC,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,EAAA,GACAE,IAAAF,EAAA,IAAA,GACAG,IAAAH,EAAA,IAAA,GACA,EAAA,YAAAI,EAAA,IAAAC,EAAA,GACA,EAAA,eAAAC,EAAA,IAAAC,EAAA,GACA,EAAA,GAAAC,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAA,MAAAZ,EAA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,CAAA;AAAA,IAAkD,kBAGtD,CAAAA,MAAA;AAII,UAHAvC,EAAA,QAAAuC,GAGA,CAAAA,GAAA;AACI,QAAAzC,EAAA,SACII,EAAA,QAAA,oBACAoC,EAAA,IAAA,MAEAb,EAAA,GACAY,EAAA,IAAA;AAEJ;AAAA,MAAA;AAMJ,UAHAnC,EAAA,QAAA,MAGA,CAAAsC,EAAAD,CAAA,GAAA;AACI,QAAAD,EAAA,IAAA;AACA;AAAA,MAAA;AAIJ,UAAA,CAAAxC,EAAA,OAAA;AACI,QAAAG,EAAA,QAAA,qBACAqC,EAAA,IAAA;AACA;AAAA,MAAA;AAIJ,MAAAD,EAAAI,EAAA3C,EAAA,OAAAyC,CAAA,CAAA;AAAA,IAA+D;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"date-time-picker.CP-IrUwY.js","sources":["../../src/components/date-time-picker/date-time-picker.vue"],"sourcesContent":["<template>\n <div class=\"b-date-time-picker\">\n <bento-form-layout-group class=\"b-date-time-picker__inputs\" layout=\"50-50\" :error-message=\"props.errorMessage\">\n <bento-date-picker\n class=\"b-date-time-picker__date-input\"\n v-bind=\"resolvedDateProps\"\n :model-value=\"dateValue\"\n @update:model-value=\"onDateChanged\"\n />\n <bento-input-time\n class=\"b-date-time-picker__time-input\"\n v-bind=\"resolvedTimeProps\"\n :model-value=\"timeValue\"\n @update:model-value=\"onTimeChanged\"\n />\n </bento-form-layout-group>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, ref, watch } from 'vue';\n import { setMilliseconds } from 'date-fns/setMilliseconds';\n import { startOfDay } from 'date-fns/startOfDay';\n\n // Components\n import { BentoDatePicker } from '@/components/date-picker';\n import { BentoFormLayoutGroup } from '@/components/form-layout';\n import { BentoInputTime } from '@/components/input-time';\n\n // Utils\n import { useDateInputFormatter, useTouchDevice } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import { dateToTimeInputString, setTimeInDateObject } from '@/utils/ts/format-date';\n import { isValidTimeString } from '@/utils/ts/time-input';\n\n // Types\n import type {\n BentoDateTimePickerEmits,\n BentoDateTimePickerProps,\n BentoDateTimePickerValue,\n } from './date-time-picker.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n modelValue: { default: null },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\n isDateDisabled: { default: undefined },\n max: { default: null },\n min: { default: null },\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n dateProps: { default: () => ({}) },\n timeProps: { default: () => ({}) }\n});\n\n const emit = defineEmits([\"update:model-value\", \"input:valid\", \"input:error\"]);\n const currentDate = ref<Date | null>(null);\n const currentTimeText = ref('');\n const dateError = ref<keyof MessageSchema | null>(null);\n const timeError = ref<keyof MessageSchema | null>(null);\n const { dateFormat } = useDateInputFormatter();\n const { isTouchDevice } = useTouchDevice();\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const dateValue = computed(() => currentDate.value);\n const timeValue = computed(() => currentTimeText.value);\n const resolvedIsDateDisabled = computed(() => props.dateProps?.isDateDisabled ?? props.isDateDisabled);\n const dateDescription = computed(() => {\n if (isTouchDevice.value) {\n return props.dateProps?.description;\n } else {\n return props.dateProps?.description\n ? `${props.dateProps.description} ${t(dateFormat.value)}`\n : t(dateFormat.value);\n }\n });\n\n const isMergedDateInBounds = (date: Date) => {\n if (resolvedIsDateDisabled.value?.(startOfDay(date))) {\n return false;\n }\n\n if (props.min && date < setMilliseconds(props.min, 0)) {\n return false;\n }\n\n if (props.max && date > setMilliseconds(props.max, 0)) {\n return false;\n }\n\n return true;\n };\n\n const resolvedDateProps = computed(() => ({\n disabled: props.disabled,\n isDateDisabled: props.isDateDisabled,\n max: props.max,\n min: props.min,\n readonly: props.readonly,\n required: props.required,\n errorMessage: dateErrorMessage.value,\n ...props.dateProps,\n description: dateDescription.value,\n }));\n\n const resolvedTimeProps = computed(() => ({\n disabled: props.disabled,\n errorMessage: timeErrorMessage.value,\n readonly: props.readonly,\n required: props.required,\n ...props.timeProps,\n }));\n\n const dateErrorMessage = computed(() => {\n if (props.errorMessage) {\n return props.errorMessage;\n }\n return dateError.value ? t(dateError.value) : null;\n });\n\n const timeErrorMessage = computed(() => {\n if (props.errorMessage) {\n return props.errorMessage;\n }\n return timeError.value ? t(timeError.value) : null;\n });\n\n const clearErrors = () => {\n dateError.value = null;\n timeError.value = null;\n };\n\n /**\n * Guards the modelValue watcher from clearing user input when the null was emitted\n * by our own validation logic (e.g. partial/invalid input). Without this flag,\n * the parent's v-model round-trip would trigger the watcher and wipe the fields.\n * Reset on nextTick so that genuine external resets (e.g. a form clear button)\n * still clear the UI.\n */\n const isSelfEmittedUpdate = ref(false);\n\n watch(\n () => props.modelValue,\n newValue => {\n if (isSelfEmittedUpdate.value) {\n return;\n }\n\n if (newValue) {\n // Sync internal state when a valid Date is set (e.g. programmatic update from parent)\n currentDate.value = newValue;\n currentTimeText.value = dateToTimeInputString(newValue);\n } else {\n // External reset (e.g. parent sets modelValue to null via a form clear button):\n // clear all internal state so the UI resets fully.\n currentDate.value = null;\n currentTimeText.value = '';\n clearErrors();\n }\n },\n { immediate: true }\n );\n\n const validateBounds = (value: BentoDateTimePickerValue) => !value || isMergedDateInBounds(value);\n\n const emitValidationState = (isValid: boolean) => {\n if (isValid) {\n emit('input:valid');\n } else {\n emit('input:error');\n }\n };\n\n const emitModelValue = (value: BentoDateTimePickerValue) => {\n isSelfEmittedUpdate.value = true;\n emit('update:model-value', value);\n nextTick(() => {\n isSelfEmittedUpdate.value = false;\n });\n };\n\n const emitValidatedValue = (value: BentoDateTimePickerValue) => {\n emitModelValue(value);\n emitValidationState(validateBounds(value));\n };\n\n const emitInvalidModelValue = (value: BentoDateTimePickerValue) => {\n emitModelValue(value);\n emitValidationState(false);\n };\n\n const onDateChanged = (date: Date | null) => {\n currentDate.value = date;\n\n // Date invalid/cleared: error if time is populated, valid if both empty\n if (!date) {\n if (currentTimeText.value) {\n dateError.value = 'invalidDateFormat';\n emitInvalidModelValue(null);\n } else {\n clearErrors();\n emitValidatedValue(null);\n }\n return;\n }\n\n clearErrors();\n\n // Prefill time with midnight when empty so the user sees a value\n if (!currentTimeText.value) {\n currentTimeText.value = '00:00:00';\n }\n\n const time = currentTimeText.value;\n\n // Date valid but time invalid: preserve date, signal error\n if (!isValidTimeString(time)) {\n emitInvalidModelValue(null);\n return;\n }\n\n // Both valid: merge and emit\n emitValidatedValue(setTimeInDateObject(date, time));\n };\n\n const onTimeChanged = (time: string) => {\n currentTimeText.value = time;\n\n // Time cleared: error if date is set (time is required once prefilled), valid-null if both empty\n if (!time) {\n if (currentDate.value) {\n timeError.value = 'enterTimeForDate';\n emitInvalidModelValue(null);\n } else {\n clearErrors();\n emitValidatedValue(null);\n }\n return;\n }\n\n timeError.value = null;\n\n // Time invalid: preserve date, signal error\n if (!isValidTimeString(time)) {\n emitInvalidModelValue(null);\n return;\n }\n\n // Time valid but no date: signal error\n if (!currentDate.value) {\n dateError.value = 'invalidDateFormat';\n emitInvalidModelValue(null);\n return;\n }\n\n // Both valid: merge and emit\n emitValidatedValue(setTimeInDateObject(currentDate.value, time));\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Date time picker that combines a date picker (single date) with a time input.\n *\n * @example\n * import { BentoDateTimePicker } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDateTimePicker },\n * template: `\n * <bento-date-time-picker\n * :date-props=\"{ label: 'Date' }\"\n * :time-props=\"{ label: 'Time' }\"\n * required\n * :model-value=\"dateTimeValue\"\n * @update:model-value=\"newValue => dateTimeValue = newValue\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-date-time-picker',\n inheritAttrs: false,\n model: { prop: 'modelValue', event: 'update:model-value' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./date-time-picker.scss\" />\n"],"names":["__default__","messages","currentDate","ref","currentTimeText","dateError","timeError","dateFormat","useDateInputFormatter","isTouchDevice","useTouchDevice","t","useI18n","dateValue","computed","timeValue","resolvedIsDateDisabled","_a","props","dateDescription","_b","isMergedDateInBounds","date","startOfDay","setMilliseconds","resolvedDateProps","dateErrorMessage","resolvedTimeProps","timeErrorMessage","clearErrors","isSelfEmittedUpdate","watch","newValue","dateToTimeInputString","validateBounds","value","emitValidationState","isValid","emit","emitModelValue","nextTick","emitValidatedValue","emitInvalidModelValue","time","isValidTimeString","setTimeInDateObject"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2RIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAAA,EACM,MAAA;AAAA,EACX,cAAA;AAAA,EACQ,OAAA,EAAA,MAAA,cAAA,OAAA,qBAAA;AAElB;;;;;;;;;;;;;;;;iBArOAC,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,EAAA,GACAE,IAAAF,EAAA,IAAA,GACAG,IAAAH,EAAA,IAAA,GACA,EAAA,YAAAI,EAAA,IAAAC,EAAA,GACA,EAAA,eAAAC,EAAA,IAAAC,EAAA,GACA,EAAA,GAAAC,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAA,MAAAZ,EAAA,KAAA,GACAa,IAAAD,EAAA,MAAAV,EAAA,KAAA,GACAY,IAAAF,EAAA,MAAA;;AAAA,eAAAG,IAAAC,EAAA,cAAA,gBAAAD,EAAA,mBAAAC,EAAA;AAAA,KAAA,GACAC,IAAAL,EAAA,MAAA;;AACI,aAAAL,EAAA,SACIQ,IAAAC,EAAA,cAAA,gBAAAD,EAAA,eAEAG,IAAAF,EAAA,cAAA,QAAAE,EAAA,cAAA,GAAAF,EAAA,UAAA,WAAA,IAAAP,EAAAJ,EAAA,KAAA,CAAA,KAAAI,EAAAJ,EAAA,KAAA;AAAA,IAGJ,CAAA,GAGJc,IAAA,CAAAC,MAAA;;AASI,aARA,GAAAL,IAAAD,EAAA,UAAA,QAAAC,EAAA,KAAAD,GAAAO,EAAAD,CAAA,M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,10 +1,10 @@
1
- import { defineComponent as o, computed as s } from "vue";
2
- import { u as t } from "./index.B6WW_F-J.js";
3
- import { B as c } from "./typography.C8lPlsbD.js";
1
+ import { defineComponent as a, computed as i } from "vue";
2
+ import { u as c } from "./index.B6WW_F-J.js";
3
+ import { B as d } from "./typography.C8lPlsbD.js";
4
4
  import { n as y } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
5
5
  import "../assets/date.css";
6
- var i = /* @__PURE__ */ ((_) => (_.SHORT_MONTH = "LLL", _.DAY_OF_MONTH = "d", _.LONG_WEEKDAY = "EEEE", _.SHORT_TIME_WITH_PERIOD = "h:mm aa", _.SHORT_TIME_WITHOUT_PERIOD = "H:mm", _.EXACT_TIME_WITH_PERIOD = "h:mm:ss aa", _.EXACT_TIME_WITHOUT_PERIOD = "H:mm:ss", _.LONG_DATE = "LLLL dd, yyyy", _.SHORT_DATE = "LLL dd, yyyy", _.FULL_DATE_EXACT_TIME_WITH_PERIOD = "LLL dd, yyyy, h:mm:ss aa", _.FULL_DATE_EXACT_TIME_WITHOUT_PERIOD = "LLL dd, yyyy, H:mm:ss", _.FULL_DATE_EXACT_TIME_WITH_TIMEZONE_AND_PERIOD = "LLL dd, yyyy, h:mm:ss aa O", _.FULL_DATE_EXACT_TIME_WITH_TIMEZONE_AND_WITHOUT_PERIOD = "LLL dd, yyyy, H:mm:ss O", _.FULL_DATE_TIME_WITH_PERIOD = "LLL dd, yyyy, h:mm aa", _.FULL_DATE_TIME_WITH_TIMEZONE_AND_PERIOD = "LLL dd, yyyy, h:mm aa O", _.FULL_DATE_TIME_WITHOUT_PERIOD = "LLL dd, yyyy, H:mm", _.FULL_DATE_TIME_WITH_TIMEZONE_AND_WITHOUT_PERIOD = "LLL dd, yyyy, H:mm O", _))(i || {});
7
- const T = {
6
+ var t = /* @__PURE__ */ ((_) => (_.SHORT_MONTH = "LLL", _.DAY_OF_MONTH = "d", _.LONG_WEEKDAY = "EEEE", _.SHORT_TIME_WITH_PERIOD = "h:mm aa", _.SHORT_TIME_WITHOUT_PERIOD = "H:mm", _.EXACT_TIME_WITH_PERIOD = "h:mm:ss aa", _.EXACT_TIME_WITHOUT_PERIOD = "H:mm:ss", _.LONG_DATE = "LLLL dd, yyyy", _.SHORT_DATE = "LLL dd, yyyy", _.FULL_DATE_EXACT_TIME_WITH_PERIOD = "LLL dd, yyyy, h:mm:ss aa", _.FULL_DATE_EXACT_TIME_WITHOUT_PERIOD = "LLL dd, yyyy, H:mm:ss", _.FULL_DATE_EXACT_TIME_WITH_TIMEZONE_AND_PERIOD = "LLL dd, yyyy, h:mm:ss aa O", _.FULL_DATE_EXACT_TIME_WITH_TIMEZONE_AND_WITHOUT_PERIOD = "LLL dd, yyyy, H:mm:ss O", _.FULL_DATE_TIME_WITH_PERIOD = "LLL dd, yyyy, h:mm aa", _.FULL_DATE_TIME_WITH_TIMEZONE_AND_PERIOD = "LLL dd, yyyy, h:mm aa O", _.FULL_DATE_TIME_WITHOUT_PERIOD = "LLL dd, yyyy, H:mm", _.FULL_DATE_TIME_WITH_TIMEZONE_AND_WITHOUT_PERIOD = "LLL dd, yyyy, H:mm O", _))(t || {});
7
+ const m = {
8
8
  SHORT_MONTH: {
9
9
  month: "short"
10
10
  },
@@ -120,41 +120,43 @@ const T = {
120
120
  }
121
121
  }, L = {
122
122
  name: "bento-date"
123
- }, d = /* @__PURE__ */ o({
123
+ }, O = /* @__PURE__ */ a({
124
124
  ...L,
125
125
  props: {
126
126
  date: { default: null },
127
- format: { default: i.FULL_DATE_EXACT_TIME_WITHOUT_PERIOD },
127
+ format: { default: t.FULL_DATE_EXACT_TIME_WITHOUT_PERIOD },
128
128
  disableTypography: { type: Boolean, default: !1 }
129
129
  },
130
130
  setup(_) {
131
- const r = _, { locale: n } = t(void 0, !0), e = Object.entries(i).reduce(
132
- (m, [u, E]) => (m[E.toString()] = u, m),
131
+ const e = _, { locale: T } = c(void 0, !0), r = Object.entries(t).reduce(
132
+ (n, [E, o]) => (n[o.toString()] = E, n),
133
133
  {}
134
- ), I = s(() => {
135
- if (!r.date)
134
+ ), u = i(() => e.date ? e.date instanceof Date ? e.date : new Date(e.date) : null), I = i(
135
+ () => u.value && !Number.isNaN(u.value.getTime()) ? u.value.toISOString() : void 0
136
+ ), s = i(() => {
137
+ if (!u.value || Number.isNaN(u.value.getTime()))
136
138
  return "";
137
- const m = typeof r.date == "string" ? new Date(r.date) : r.date, u = e == null ? void 0 : e[r.format];
139
+ const n = r == null ? void 0 : r[e.format];
138
140
  let E;
139
- return u && (T != null && T[u]) && (E = T == null ? void 0 : T[u]), new Intl.DateTimeFormat(n.value, E).format(m);
141
+ return n && (m != null && m[n]) && (E = m == null ? void 0 : m[n]), new Intl.DateTimeFormat(T.value, E).format(u.value);
140
142
  });
141
- return { __sfc: !0, BentoDateFormatPresets: T, props: r, locale: n, bentoDateFormatKeyValuePairs: e, formattedDate: I, BentoTypography: c };
143
+ return { __sfc: !0, BentoDateFormatPresets: m, props: e, locale: T, bentoDateFormatKeyValuePairs: r, datePropAsDateObject: u, dateTime: I, formattedDate: s, BentoTypography: d };
142
144
  }
143
145
  });
144
- var O = function() {
145
- var r = this, n = r._self._c, e = r._self._setupProxy;
146
- return n("div", { staticClass: "b-date" }, [r.disableTypography ? [r._v(r._s(e.formattedDate))] : n(e.BentoTypography, { staticClass: "b-date__label", attrs: { el: "span", variant: "body", strong: "" } }, [r._v(" " + r._s(e.formattedDate) + " ")])], 2);
147
- }, a = [], h = /* @__PURE__ */ y(
148
- d,
146
+ var h = function() {
147
+ var e = this, T = e._self._c, r = e._self._setupProxy;
148
+ return T("div", { staticClass: "b-date" }, [e.disableTypography ? T("time", { attrs: { datetime: r.dateTime } }, [e._v(e._s(r.formattedDate))]) : T(r.BentoTypography, { staticClass: "b-date__label", attrs: { el: "span", variant: "body", strong: "" } }, [T("time", { attrs: { datetime: r.dateTime } }, [e._v(e._s(r.formattedDate))])])], 1);
149
+ }, A = [], H = /* @__PURE__ */ y(
149
150
  O,
150
- a,
151
+ h,
152
+ A,
151
153
  !1,
152
154
  null,
153
- "02030534"
155
+ "94029391"
154
156
  );
155
- const f = h.exports;
157
+ const N = H.exports;
156
158
  export {
157
- f as B,
158
- i as a
159
+ N as B,
160
+ t as a
159
161
  };
160
- //# sourceMappingURL=date.B0m0sFP6.js.map
162
+ //# sourceMappingURL=date.C1HnIyOv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.C1HnIyOv.js","sources":["../../src/components/date/date.types.ts","../../src/components/date/date.vue"],"sourcesContent":["export enum BentoDateFormat {\n // MONTH\n SHORT_MONTH = 'LLL', // Jun\n\n // DAY\n DAY_OF_MONTH = 'd', // 1, 2, ..., 31,\n LONG_WEEKDAY = 'EEEE', // Friday\n\n // TIME\n SHORT_TIME_WITH_PERIOD = `h:mm aa`, // 2:44 PM\n SHORT_TIME_WITHOUT_PERIOD = 'H:mm', // 14:45\n EXACT_TIME_WITH_PERIOD = 'h:mm:ss aa', // 2:05:11 PM\n EXACT_TIME_WITHOUT_PERIOD = 'H:mm:ss', // 14:05:11\n\n // DATE\n LONG_DATE = 'LLLL dd, yyyy', // June 30, 2023\n SHORT_DATE = 'LLL dd, yyyy', // Jun 30, 2023\n FULL_DATE_EXACT_TIME_WITH_PERIOD = `${SHORT_DATE}, h:mm:ss aa`, // June 30, 2023, 2:54:10 PM\n FULL_DATE_EXACT_TIME_WITHOUT_PERIOD = `${SHORT_DATE}, H:mm:ss`, // June 30, 2023, 14:54:42\n FULL_DATE_EXACT_TIME_WITH_TIMEZONE_AND_PERIOD = `${SHORT_DATE}, h:mm:ss aa O`, // June 30, 2023, 2:56:07 PM GMT+2\n FULL_DATE_EXACT_TIME_WITH_TIMEZONE_AND_WITHOUT_PERIOD = `${SHORT_DATE}, H:mm:ss O`, // June 30, 2023, 14:56:28 GMT+2\n FULL_DATE_TIME_WITH_PERIOD = `${SHORT_DATE}, h:mm aa`, // Jun 30, 2023, 2:48 PM\n FULL_DATE_TIME_WITH_TIMEZONE_AND_PERIOD = `${SHORT_DATE}, h:mm aa O`, // Jun 30, 2023, 2:44 PM GMT+2\n FULL_DATE_TIME_WITHOUT_PERIOD = `${SHORT_DATE}, H:mm`, // Jun 30, 2023, 14:48\n FULL_DATE_TIME_WITH_TIMEZONE_AND_WITHOUT_PERIOD = `${SHORT_DATE}, H:mm O`, // Jun 30, 2023, 14:43 GMT+2\n}\n\nexport interface BentoDateProps {\n /**\n * The date to format. The data can be supplied as:\n * - a Date object.\n * - a number of milliseconds elapsed since the epoch.\n * - a date string e.g. '2023-07-31T10:55:22+02:00'.\n */\n date?: Date | number | string | null;\n /**\n * The string format of the date to be displayed\n */\n format?: BentoDateFormat | `${BentoDateFormat}`;\n /**\n * Disable the default typography for the component. Only use this when the component is inside another typography\n */\n disableTypography?: boolean;\n}\n","<template>\n <div class=\"b-date\">\n <bento-typography v-if=\"!disableTypography\" class=\"b-date__label\" el=\"span\" variant=\"body\" strong>\n <time :datetime=\"dateTime\">{{ formattedDate }}</time>\n </bento-typography>\n <time v-else :datetime=\"dateTime\">{{ formattedDate }}</time>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed } from 'vue';\n import { BentoDateFormat, type BentoDateProps } from './date.types';\n import { useI18n } from '@/utils/ts/i18n';\n import { BentoTypography } from '@/components/typography';\n\n const props = defineProps({\n date: { default: null },\n format: { default: BentoDateFormat.FULL_DATE_EXACT_TIME_WITHOUT_PERIOD },\n disableTypography: { type: Boolean, default: false }\n});\n\n const { locale } = useI18n(undefined, true);\n\n /**\n * This is a reverse mapping of the BentoDateFormat enum.\n * It allows us to get the key of the enum by its value, which is then used to look up the\n * corresponding formatting options in `BentoDateFormatPresets`.\n */\n const bentoDateFormatKeyValuePairs = Object.entries(BentoDateFormat).reduce<\n Record<BentoDateFormat, keyof typeof BentoDateFormat>\n >(\n (acc, [key, value]) => {\n acc[value.toString()] = key;\n return acc;\n },\n {} as Record<BentoDateFormat, keyof typeof BentoDateFormat>\n );\n\n const datePropAsDateObject = computed(() => {\n if (!props.date) {\n return null;\n }\n\n return props.date instanceof Date ? props.date : new Date(props.date);\n });\n\n const dateTime = computed(() =>\n datePropAsDateObject.value && !Number.isNaN(datePropAsDateObject.value.getTime())\n ? datePropAsDateObject.value.toISOString()\n : undefined\n );\n\n const formattedDate = computed(() => {\n if (!datePropAsDateObject.value || Number.isNaN(datePropAsDateObject.value.getTime())) {\n return '';\n }\n\n const formatKeyEntry = bentoDateFormatKeyValuePairs?.[props.format];\n\n let dateFormat: Intl.DateTimeFormatOptions | undefined = undefined;\n // Translate the key of the enum to the Intl.DateTimeFormatOptions configuration object\n if (formatKeyEntry && BentoDateFormatPresets?.[formatKeyEntry]) {\n dateFormat = BentoDateFormatPresets?.[formatKeyEntry];\n }\n return new Intl.DateTimeFormat(locale.value, dateFormat).format(datePropAsDateObject.value);\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * The format presets to use when being supplied with a key name in BentoDateFormat.\n * They translate to configuration options that are used in the Intl.DateTimeFormat function\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options\n */\n const BentoDateFormatPresets: { [key in keyof typeof BentoDateFormat]: Intl.DateTimeFormatOptions } = {\n SHORT_MONTH: {\n month: 'short',\n },\n DAY_OF_MONTH: {\n day: 'numeric',\n },\n LONG_WEEKDAY: {\n weekday: 'long',\n },\n SHORT_TIME_WITH_PERIOD: {\n hour: 'numeric',\n minute: 'numeric',\n hour12: true,\n },\n SHORT_TIME_WITHOUT_PERIOD: {\n hour: 'numeric',\n minute: 'numeric',\n hour12: false,\n },\n EXACT_TIME_WITH_PERIOD: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n hour12: true,\n },\n EXACT_TIME_WITHOUT_PERIOD: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n hour12: false,\n },\n LONG_DATE: {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n },\n SHORT_DATE: {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n },\n FULL_DATE_TIME_WITH_PERIOD: {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n hour12: true,\n },\n FULL_DATE_TIME_WITHOUT_PERIOD: {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n hour12: false,\n },\n FULL_DATE_EXACT_TIME_WITH_PERIOD: {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n hour12: true,\n },\n FULL_DATE_EXACT_TIME_WITHOUT_PERIOD: {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n hour12: false,\n },\n FULL_DATE_TIME_WITH_TIMEZONE_AND_PERIOD: {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n hour12: true,\n timeZoneName: 'short',\n },\n FULL_DATE_TIME_WITH_TIMEZONE_AND_WITHOUT_PERIOD: {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n hour12: false,\n timeZoneName: 'short',\n },\n FULL_DATE_EXACT_TIME_WITH_TIMEZONE_AND_PERIOD: {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n hour12: true,\n timeZoneName: 'short',\n },\n FULL_DATE_EXACT_TIME_WITH_TIMEZONE_AND_WITHOUT_PERIOD: {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n hour12: false,\n timeZoneName: 'short',\n },\n };\n\n /**\n * A Date component is used to display a formatted date value.\n *\n * @example\n * import { BentoDate } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDate },\n * template: `\n * <bento-date :date=\"dateObject\" :format=\"BentoDateFormat.LONG_DATE\"/>\n * `\n * }\n */\n export default {\n name: 'bento-date',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./date.scss\" />\n"],"names":["BentoDateFormat","BentoDateFormat2","BentoDateFormatPresets","__default__","locale","useI18n","bentoDateFormatKeyValuePairs","acc","key","value","datePropAsDateObject","computed","props","dateTime","formattedDate","formatKeyEntry","dateFormat"],"mappings":";;;;;AAAO,IAAAA,IAAA,kBAAAC,OAEHA,EAAA,cAAA,OAGAA,EAAA,eAAA,KACAA,EAAA,eAAA,QAGAA,EAAA,yBAAA,WACAA,EAAA,4BAAA,QACAA,EAAA,yBAAA,cACAA,EAAA,4BAAA,WAGAA,EAAA,YAAA,iBACAA,EAAA,aAAA,gBACAA,EAAA,mCAAA,4BACAA,EAAA,sCAAA,yBACAA,EAAA,gDAAA,8BACAA,EAAA,wDAAA,2BACAA,EAAA,6BAAA,yBACAA,EAAA,0CAAA,2BACAA,EAAA,gCAAA,sBACAA,EAAA,kDAAA,wBAxBQA,IAAAD,KAAA,CAAA,CAAA;AC2ER,MAAAE,IAAA;AAAA,EAAsG,aAAA;AAAA,IACrF,OAAA;AAAA,EACF;AAAA,EACX,cAAA;AAAA,IACc,KAAA;AAAA,EACL;AAAA,EACT,cAAA;AAAA,IACc,SAAA;AAAA,EACD;AAAA,EACb,wBAAA;AAAA,IACwB,MAAA;AAAA,IACd,QAAA;AAAA,IACE,QAAA;AAAA,EACA;AAAA,EACZ,2BAAA;AAAA,IAC2B,MAAA;AAAA,IACjB,QAAA;AAAA,IACE,QAAA;AAAA,EACA;AAAA,EACZ,wBAAA;AAAA,IACwB,MAAA;AAAA,IACd,QAAA;AAAA,IACE,QAAA;AAAA,IACA,QAAA;AAAA,EACA;AAAA,EACZ,2BAAA;AAAA,IAC2B,MAAA;AAAA,IACjB,QAAA;AAAA,IACE,QAAA;AAAA,IACA,QAAA;AAAA,EACA;AAAA,EACZ,WAAA;AAAA,IACW,MAAA;AAAA,IACD,OAAA;AAAA,IACC,KAAA;AAAA,EACF;AAAA,EACT,YAAA;AAAA,IACY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;AAAA,IACA,cAAA;AAAA,EACM;AAEtB,GAeAC,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;iBAzLA,EAAA,QAAAC,EAAA,IAAAC,EAAA,QAAA,EAAA,GAOAC,IAAA,OAAA,QAAAN,CAAA,EAAA;AAAA,MAAqE,CAAAO,GAAA,CAAAC,GAAAC,CAAA,OAI7DF,EAAAE,EAAA,SAAA,CAAA,IAAAD,GACAD;AAAA,MACJ,CAAA;AAAA,IACC,GAGLG,IAAAC,EAAA,MACIC,EAAA,OAIAA,EAAA,gBAAA,OAAAA,EAAA,OAAA,IAAA,KAAAA,EAAA,IAAA,IAHI,IAGgE,GAGxEC,IAAAF;AAAA,MAAiB,MAAAD,EAAA,SAAA,CAAA,OAAA,MAAAA,EAAA,MAAA,QAAA,CAAA,IAAAA,EAAA,MAAA,YAAA,IAAA;AAAA,IAGP,GAGVI,IAAAH,EAAA,MAAA;AACI,UAAA,CAAAD,EAAA,SAAA,OAAA,MAAAA,EAAA,MAAA,QAAA,CAAA;AACI,eAAA;AAGJ,YAAAK,IAAAT,KAAA,gBAAAA,EAAAM,EAAA;AAEA,UAAAI;AAEA,aAAAD,MAAAb,KAAA,QAAAA,EAAAa,QACIC,IAAAd,KAAA,gBAAAA,EAAAa,KAEJ,IAAA,KAAA,eAAAX,EAAA,OAAAY,CAAA,EAAA,OAAAN,EAAA,KAAA;AAAA,IAA0F,CAAA;;;;;;;;;;;;;;;;"}
@@ -4,7 +4,7 @@ import { A as z } from "./arrow-left.CRREfabP.js";
4
4
  import { u as K } from "./use-has-slot.C9lQZ6nz.js";
5
5
  import { u as Y } from "./index.B6WW_F-J.js";
6
6
  import { i as $ } from "./typography.C8lPlsbD.js";
7
- import { e as X } from "./index.CJYgd0QI.js";
7
+ import { g as X } from "./index.BPUMyryR.js";
8
8
  import { n as Z } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
9
9
  import "../assets/dialog-page.css";
10
10
  var E = /* @__PURE__ */ ((r) => (r.TRANSITION_LEVEL_DEEPER = "b-dialog-page__animation--level-deeper", r.TRANSITION_LEVEL_UPPER = "b-dialog-page__animation--level-upper", r))(E || {});
@@ -75,20 +75,20 @@ const q = /* @__PURE__ */ Symbol("dialog registerPage injection key"), Q = /* @_
75
75
  },
76
76
  emits: ["animationend"],
77
77
  setup(r, { emit: t }) {
78
- const a = r, e = F(), T = K(e), { t: O } = Y(), l = P(null), g = P(!1), u = P(!1), { arrivedState: c } = X(l), d = n(() => s.value ? s.value === a.pageId : !0), R = n(() => ({
79
- "b-dialog-page__header--with-border": a.alwaysShowBorder || g.value && !c.top
78
+ const a = r, e = F(), T = K(e), { t: O } = Y(), l = P(null), v = P(!1), u = P(!1), { arrivedState: c } = X(l), d = n(() => s.value ? s.value === a.pageId : !0), R = n(() => ({
79
+ "b-dialog-page__header--with-border": a.alwaysShowBorder || v.value && !c.top
80
80
  })), L = n(() => ({
81
- "b-dialog-page__footer--with-border": a.alwaysShowBorder || g.value && !c.bottom
81
+ "b-dialog-page__footer--with-border": a.alwaysShowBorder || v.value && !c.bottom
82
82
  })), k = n(() => !(c.bottom && c.top)), G = () => {
83
83
  l.value;
84
84
  }, p = async (i) => {
85
- i && (await S(), u.value && (g.value = l.value && l.value.scrollHeight > l.value.clientHeight));
86
- }, { activePage: s, animation: _, isAnimationActive: v, isOpen: f, pages: b, previousPages: o, updatePage: I } = N(Q);
85
+ i && (await S(), u.value && (v.value = l.value && l.value.scrollHeight > l.value.clientHeight));
86
+ }, { activePage: s, animation: _, isAnimationActive: g, isOpen: f, pages: b, previousPages: o, updatePage: I } = N(Q);
87
87
  h(() => f.value, p, { immediate: !0 }), h(() => d.value, p, { immediate: !0 });
88
88
  const x = n(() => a.previousPage ? !0 : a.previousPage === null ? !1 : y.value && d.value), D = () => {
89
- _.value = E.TRANSITION_LEVEL_DEEPER, v && (v.value = !1), t("animationend");
89
+ _.value = E.TRANSITION_LEVEL_DEEPER, g && (g.value = !1), t("animationend");
90
90
  }, V = () => {
91
- v && (v.value = !0);
91
+ g && (g.value = !0);
92
92
  }, y = n(() => o.value.length > 1), m = n(() => o.value[o.value.length - 1]), A = n(() => b.value.some((i) => i === s.value)), j = async (i) => {
93
93
  if (i) {
94
94
  const B = o.value.indexOf(i);
@@ -117,7 +117,7 @@ const q = /* @__PURE__ */ Symbol("dialog registerPage injection key"), Q = /* @_
117
117
  u.value = !0;
118
118
  }), J(() => {
119
119
  u.value = !1, w();
120
- }), { __sfc: !0, props: a, emit: t, slots: e, hasSlot: T, t: O, contentElement: l, hasScroll: g, isMounted: u, arrivedState: c, showPage: d, headerConditionalClasses: R, footerConditionalClasses: L, isScrollable: k, onScroll: G, calculateScroll: p, activePage: s, animation: _, isAnimationActive: v, isOpen: f, pages: b, previousPages: o, updatePage: I, showBackButton: x, updateAnimation: D, startAnimation: V, hasPreviousPages: y, lastPage: m, isActivePageValid: A, goToPreviousPage: j, registerPage: C, unregisterPage: w, BentoButton: M, ArrowLeftIcon: z };
120
+ }), { __sfc: !0, props: a, emit: t, slots: e, hasSlot: T, t: O, contentElement: l, hasScroll: v, isMounted: u, arrivedState: c, showPage: d, headerConditionalClasses: R, footerConditionalClasses: L, isScrollable: k, onScroll: G, calculateScroll: p, activePage: s, animation: _, isAnimationActive: g, isOpen: f, pages: b, previousPages: o, updatePage: I, showBackButton: x, updateAnimation: D, startAnimation: V, hasPreviousPages: y, lastPage: m, isActivePageValid: A, goToPreviousPage: j, registerPage: C, unregisterPage: w, BentoButton: M, ArrowLeftIcon: z };
121
121
  }
122
122
  });
123
123
  var te = function() {
@@ -140,4 +140,4 @@ export {
140
140
  q as a,
141
141
  de as b
142
142
  };
143
- //# sourceMappingURL=dialog-page.DYWnKdnP.js.map
143
+ //# sourceMappingURL=dialog-page.BendBRv6.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialog-page.DYWnKdnP.js","sources":["../../src/components/internal/dialog-page/dialog-page.types.ts","../../src/components/internal/dialog-page/dialog-page.keys.ts","../../src/components/internal/dialog-page/dialog-page.vue"],"sourcesContent":["import { type Ref } from 'vue';\n\nexport enum BentoDialogPageAnimation {\n TRANSITION_LEVEL_DEEPER = 'b-dialog-page__animation--level-deeper',\n TRANSITION_LEVEL_UPPER = 'b-dialog-page__animation--level-upper',\n}\n\nexport interface BentoDialogPageConfigData {\n activePage: Ref<string>;\n animation: Ref<string>;\n isAnimationActive?: Ref<boolean>;\n isOpen: Ref<boolean>;\n pages: Ref<Array<string>>;\n previousPages: Ref<Array<string>>;\n updatePage: (page: string) => void;\n}\n\nexport type BentoDialogPageRegisterPage = (pageId: string) => { unregisterPage: () => void };\n","export const DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY = Symbol('dialog registerPage injection key');\nexport const DIALOG_PAGE_CONFIG_INJECTION_KEY = Symbol('dialog page config data injection key');\n","<template>\n <Transition :name=\"animation\" mode=\"out-in\" @after-leave=\"updateAnimation\" @leave=\"startAnimation\">\n <div v-if=\"isOpen && showPage\" class=\"b-dialog-page\">\n <div v-if=\"hasSlot('header')\" class=\"b-dialog-page__header\" :class=\"headerConditionalClasses\">\n <div\n v-if=\"showBackButton\"\n class=\"b-dialog-page__back-button\"\n :style=\"backButtonStyling\"\n data-testid=\"back-button\"\n >\n <bento-button variant=\"tertiary\" @click=\"goToPreviousPage(previousPage)\">\n <arrow-left-icon :svg-title=\"t('goToPreviousPage')\" />\n </bento-button>\n </div>\n <slot name=\"header\"></slot>\n </div>\n <div\n v-if=\"hasSlot('content')\"\n ref=\"contentElement\"\n class=\"b-dialog-page__content\"\n :tabindex=\"isScrollable ? 0 : null\"\n @scroll=\"onScroll\"\n >\n <slot name=\"content\" />\n </div>\n <div v-if=\"hasSlot('footer')\" class=\"b-dialog-page__footer\" :class=\"footerConditionalClasses\">\n <slot name=\"footer\" />\n </div>\n </div>\n </Transition>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, nextTick, onMounted, onUnmounted, type PropType, ref, useSlots, watch } from 'vue';\n\n import { BentoButton } from '@/components/button';\n import ArrowLeftIcon from '@adyen/ui-assets-icons-16/vue/arrow-left';\n\n import { useHasSlot } from '@/composables/use-has-slot/use-has-slot';\n import { useI18n } from '@/utils/ts/i18n';\n import { isDevelopmentEnviroment } from '@/utils/ts/dev-environment';\n\n import {\n BentoDialogPageAnimation,\n type BentoDialogPageConfigData,\n type BentoDialogPageRegisterPage,\n } from './dialog-page.types';\n import type { CSSProperties } from 'vue/types/jsx.d.ts';\n\n import { DIALOG_PAGE_CONFIG_INJECTION_KEY, DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY } from './dialog-page.keys';\n\n import messages from './messages.json';\n import { useScroll } from '@vueuse/core';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * Identifier of the page, used with activePage prop to handle navigation\n */\n pageId: {\n type: String,\n default: undefined,\n },\n\n /**\n * Show header and actions border\n */\n alwaysShowBorder: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Pass custom styling to the back button to position it correctly with the header slot\n */\n backButtonStyling: { type: Object as PropType<CSSProperties>, default: null },\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 const emit = defineEmits([\"animationend\"]);\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n // Refs\n const contentElement = ref<HTMLDivElement>(null);\n const hasScroll = ref(false);\n const isMounted = ref(false);\n\n const { arrivedState } = useScroll(contentElement);\n\n // Logic to choose which page is active/shown\n const showPage = computed(() => (activePage.value ? activePage.value === props.pageId : true));\n\n // Scrolling styling logic\n const headerConditionalClasses = computed(() => ({\n 'b-dialog-page__header--with-border': props.alwaysShowBorder || (hasScroll.value && !arrivedState.top),\n }));\n\n const footerConditionalClasses = computed(() => ({\n 'b-dialog-page__footer--with-border': props.alwaysShowBorder || (hasScroll.value && !arrivedState.bottom),\n }));\n\n const isScrollable = computed(() => !(arrivedState.bottom && arrivedState.top));\n\n const onScroll = () => {\n if (!contentElement.value) {\n return;\n }\n };\n\n const calculateScroll = async watchedValue => {\n if (!watchedValue) {\n return;\n }\n // Wait for content to be rendered to be able to calculate the height\n await nextTick();\n if (!isMounted.value) {\n return;\n }\n hasScroll.value = contentElement.value && contentElement.value.scrollHeight > contentElement.value.clientHeight;\n };\n\n const { activePage, animation, isAnimationActive, isOpen, pages, previousPages, updatePage } =\n inject<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY);\n\n watch(() => isOpen.value, calculateScroll, { immediate: true });\n watch(() => showPage.value, calculateScroll, { immediate: true });\n\n // Logic to determine whether the back button should be shown on the page\n const showBackButton = computed(() => {\n if (props.previousPage) {\n return true;\n }\n if (props.previousPage === null) {\n return false;\n }\n return hasPreviousPages.value && showPage.value;\n });\n\n // Animation\n const updateAnimation = () => {\n animation.value = BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER;\n if (isAnimationActive) {\n isAnimationActive.value = false;\n }\n\n emit('animationend');\n };\n\n const startAnimation = () => {\n if (isAnimationActive) {\n isAnimationActive.value = true;\n }\n };\n\n // Previous page logic\n const hasPreviousPages = computed(() => previousPages.value.length > 1);\n const lastPage = computed(() => previousPages.value[previousPages.value.length - 1]);\n const isActivePageValid = computed(() => pages.value.some(page => page === activePage.value));\n\n const goToPreviousPage = async (page: string) => {\n if (page) {\n const index = previousPages.value.indexOf(page);\n if (index !== -1) {\n previousPages.value = previousPages.value.slice(0, index + 1);\n } else {\n previousPages.value = [page];\n }\n } else {\n previousPages.value.pop();\n }\n\n animation.value = BentoDialogPageAnimation.TRANSITION_LEVEL_UPPER;\n await nextTick();\n if (!isMounted.value) {\n return;\n }\n updatePage(lastPage.value);\n };\n\n // Add new page to the previousPage array to keep track of user navigation\n watch(\n () => activePage.value,\n async () => {\n await nextTick();\n if (!isMounted.value || !isOpen.value) {\n return;\n }\n\n if (!!activePage.value && !isActivePageValid.value) {\n if (isDevelopmentEnviroment) {\n // eslint-disable-next-line no-console\n console.error(\n `The activePage passed \"${activePage.value}\" does not match the id of any of the pages`\n );\n return;\n }\n }\n\n if (activePage.value !== lastPage.value) {\n previousPages.value.push(activePage.value);\n }\n },\n { immediate: true }\n );\n\n // Register page to parent component and inject data from parent component\n const registerPage = inject<BentoDialogPageRegisterPage>(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY);\n const { unregisterPage } = registerPage(props.pageId);\n\n onMounted(() => {\n isMounted.value = true;\n });\n\n // Unregister page on unmounting the page\n onUnmounted(() => {\n isMounted.value = false;\n unregisterPage();\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * DialogPage is an internal component used to render different pages of dialog components (Modal, ModalFullscreen and Sidepanel)\n *\n * @example\n * import { DialogPage } from '@/internal';\n *\n * export default {\n * components: { DialogPage },\n * template: `\n * <dialog-page pageId='step1' always-show-border>\n * <template #header>Header</template>\n * <template #content>Content</template>\n * <template #footer>Footer</template>\n * </dialog-page>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./dialog-page.scss\" />\n"],"names":["BentoDialogPageAnimation","BentoDialogPageAnimation2","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY","DIALOG_PAGE_CONFIG_INJECTION_KEY","__default__","messages","slots","useSlots","hasSlot","useHasSlot","t","useI18n","contentElement","ref","hasScroll","isMounted","arrivedState","useScroll","showPage","computed","activePage","props","headerConditionalClasses","footerConditionalClasses","isScrollable","onScroll","calculateScroll","watchedValue","nextTick","animation","isAnimationActive","isOpen","pages","previousPages","updatePage","inject","watch","showBackButton","hasPreviousPages","updateAnimation","emit","startAnimation","lastPage","isActivePageValid","page","goToPreviousPage","index","isDevelopmentEnviroment","registerPage","unregisterPage","onMounted","onUnmounted"],"mappings":";;;;;;;;;AAEO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,0BAAA,0CACAA,EAAA,yBAAA,yCAFQA,IAAAD,KAA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ItB,UAAA4B,IAAAb,EAAAjC,CAAA,GACA,EAAA,gBAAA+C,EAAA,IAAAD,EAAA3B,EAAA,MAAA;AAEA,WAAA6B,EAAA,MAAA;AACI,MAAAnC,EAAA,QAAA;AAAA,IAAkB,CAAA,GAItBoC,EAAA,MAAA;AACI,MAAApC,EAAA,QAAA,IACAkC,EAAA;AAAA,IAAe,CAAA;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"dialog-page.BendBRv6.js","sources":["../../src/components/internal/dialog-page/dialog-page.types.ts","../../src/components/internal/dialog-page/dialog-page.keys.ts","../../src/components/internal/dialog-page/dialog-page.vue"],"sourcesContent":["import { type Ref } from 'vue';\n\nexport enum BentoDialogPageAnimation {\n TRANSITION_LEVEL_DEEPER = 'b-dialog-page__animation--level-deeper',\n TRANSITION_LEVEL_UPPER = 'b-dialog-page__animation--level-upper',\n}\n\nexport interface BentoDialogPageConfigData {\n activePage: Ref<string>;\n animation: Ref<string>;\n isAnimationActive?: Ref<boolean>;\n isOpen: Ref<boolean>;\n pages: Ref<Array<string>>;\n previousPages: Ref<Array<string>>;\n updatePage: (page: string) => void;\n}\n\nexport type BentoDialogPageRegisterPage = (pageId: string) => { unregisterPage: () => void };\n","export const DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY = Symbol('dialog registerPage injection key');\nexport const DIALOG_PAGE_CONFIG_INJECTION_KEY = Symbol('dialog page config data injection key');\n","<template>\n <Transition :name=\"animation\" mode=\"out-in\" @after-leave=\"updateAnimation\" @leave=\"startAnimation\">\n <div v-if=\"isOpen && showPage\" class=\"b-dialog-page\">\n <div v-if=\"hasSlot('header')\" class=\"b-dialog-page__header\" :class=\"headerConditionalClasses\">\n <div\n v-if=\"showBackButton\"\n class=\"b-dialog-page__back-button\"\n :style=\"backButtonStyling\"\n data-testid=\"back-button\"\n >\n <bento-button variant=\"tertiary\" @click=\"goToPreviousPage(previousPage)\">\n <arrow-left-icon :svg-title=\"t('goToPreviousPage')\" />\n </bento-button>\n </div>\n <slot name=\"header\"></slot>\n </div>\n <div\n v-if=\"hasSlot('content')\"\n ref=\"contentElement\"\n class=\"b-dialog-page__content\"\n :tabindex=\"isScrollable ? 0 : null\"\n @scroll=\"onScroll\"\n >\n <slot name=\"content\" />\n </div>\n <div v-if=\"hasSlot('footer')\" class=\"b-dialog-page__footer\" :class=\"footerConditionalClasses\">\n <slot name=\"footer\" />\n </div>\n </div>\n </Transition>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, nextTick, onMounted, onUnmounted, type PropType, ref, useSlots, watch } from 'vue';\n\n import { BentoButton } from '@/components/button';\n import ArrowLeftIcon from '@adyen/ui-assets-icons-16/vue/arrow-left';\n\n import { useHasSlot } from '@/composables/use-has-slot/use-has-slot';\n import { useI18n } from '@/utils/ts/i18n';\n import { isDevelopmentEnviroment } from '@/utils/ts/dev-environment';\n\n import {\n BentoDialogPageAnimation,\n type BentoDialogPageConfigData,\n type BentoDialogPageRegisterPage,\n } from './dialog-page.types';\n import type { CSSProperties } from 'vue/types/jsx.d.ts';\n\n import { DIALOG_PAGE_CONFIG_INJECTION_KEY, DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY } from './dialog-page.keys';\n\n import messages from './messages.json';\n import { useScroll } from '@vueuse/core';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * Identifier of the page, used with activePage prop to handle navigation\n */\n pageId: {\n type: String,\n default: undefined,\n },\n\n /**\n * Show header and actions border\n */\n alwaysShowBorder: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Pass custom styling to the back button to position it correctly with the header slot\n */\n backButtonStyling: { type: Object as PropType<CSSProperties>, default: null },\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 const emit = defineEmits([\"animationend\"]);\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n // Refs\n const contentElement = ref<HTMLDivElement>(null);\n const hasScroll = ref(false);\n const isMounted = ref(false);\n\n const { arrivedState } = useScroll(contentElement);\n\n // Logic to choose which page is active/shown\n const showPage = computed(() => (activePage.value ? activePage.value === props.pageId : true));\n\n // Scrolling styling logic\n const headerConditionalClasses = computed(() => ({\n 'b-dialog-page__header--with-border': props.alwaysShowBorder || (hasScroll.value && !arrivedState.top),\n }));\n\n const footerConditionalClasses = computed(() => ({\n 'b-dialog-page__footer--with-border': props.alwaysShowBorder || (hasScroll.value && !arrivedState.bottom),\n }));\n\n const isScrollable = computed(() => !(arrivedState.bottom && arrivedState.top));\n\n const onScroll = () => {\n if (!contentElement.value) {\n return;\n }\n };\n\n const calculateScroll = async watchedValue => {\n if (!watchedValue) {\n return;\n }\n // Wait for content to be rendered to be able to calculate the height\n await nextTick();\n if (!isMounted.value) {\n return;\n }\n hasScroll.value = contentElement.value && contentElement.value.scrollHeight > contentElement.value.clientHeight;\n };\n\n const { activePage, animation, isAnimationActive, isOpen, pages, previousPages, updatePage } =\n inject<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY);\n\n watch(() => isOpen.value, calculateScroll, { immediate: true });\n watch(() => showPage.value, calculateScroll, { immediate: true });\n\n // Logic to determine whether the back button should be shown on the page\n const showBackButton = computed(() => {\n if (props.previousPage) {\n return true;\n }\n if (props.previousPage === null) {\n return false;\n }\n return hasPreviousPages.value && showPage.value;\n });\n\n // Animation\n const updateAnimation = () => {\n animation.value = BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER;\n if (isAnimationActive) {\n isAnimationActive.value = false;\n }\n\n emit('animationend');\n };\n\n const startAnimation = () => {\n if (isAnimationActive) {\n isAnimationActive.value = true;\n }\n };\n\n // Previous page logic\n const hasPreviousPages = computed(() => previousPages.value.length > 1);\n const lastPage = computed(() => previousPages.value[previousPages.value.length - 1]);\n const isActivePageValid = computed(() => pages.value.some(page => page === activePage.value));\n\n const goToPreviousPage = async (page: string) => {\n if (page) {\n const index = previousPages.value.indexOf(page);\n if (index !== -1) {\n previousPages.value = previousPages.value.slice(0, index + 1);\n } else {\n previousPages.value = [page];\n }\n } else {\n previousPages.value.pop();\n }\n\n animation.value = BentoDialogPageAnimation.TRANSITION_LEVEL_UPPER;\n await nextTick();\n if (!isMounted.value) {\n return;\n }\n updatePage(lastPage.value);\n };\n\n // Add new page to the previousPage array to keep track of user navigation\n watch(\n () => activePage.value,\n async () => {\n await nextTick();\n if (!isMounted.value || !isOpen.value) {\n return;\n }\n\n if (!!activePage.value && !isActivePageValid.value) {\n if (isDevelopmentEnviroment) {\n // eslint-disable-next-line no-console\n console.error(\n `The activePage passed \"${activePage.value}\" does not match the id of any of the pages`\n );\n return;\n }\n }\n\n if (activePage.value !== lastPage.value) {\n previousPages.value.push(activePage.value);\n }\n },\n { immediate: true }\n );\n\n // Register page to parent component and inject data from parent component\n const registerPage = inject<BentoDialogPageRegisterPage>(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY);\n const { unregisterPage } = registerPage(props.pageId);\n\n onMounted(() => {\n isMounted.value = true;\n });\n\n // Unregister page on unmounting the page\n onUnmounted(() => {\n isMounted.value = false;\n unregisterPage();\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * DialogPage is an internal component used to render different pages of dialog components (Modal, ModalFullscreen and Sidepanel)\n *\n * @example\n * import { DialogPage } from '@/internal';\n *\n * export default {\n * components: { DialogPage },\n * template: `\n * <dialog-page pageId='step1' always-show-border>\n * <template #header>Header</template>\n * <template #content>Content</template>\n * <template #footer>Footer</template>\n * </dialog-page>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./dialog-page.scss\" />\n"],"names":["BentoDialogPageAnimation","BentoDialogPageAnimation2","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY","DIALOG_PAGE_CONFIG_INJECTION_KEY","__default__","messages","slots","useSlots","hasSlot","useHasSlot","t","useI18n","contentElement","ref","hasScroll","isMounted","arrivedState","useScroll","showPage","computed","activePage","props","headerConditionalClasses","footerConditionalClasses","isScrollable","onScroll","calculateScroll","watchedValue","nextTick","animation","isAnimationActive","isOpen","pages","previousPages","updatePage","inject","watch","showBackButton","hasPreviousPages","updateAnimation","emit","startAnimation","lastPage","isActivePageValid","page","goToPreviousPage","index","isDevelopmentEnviroment","registerPage","unregisterPage","onMounted","onUnmounted"],"mappings":";;;;;;;;;AAEO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,0BAAA,0CACAA,EAAA,yBAAA,yCAFQA,IAAAD,KAAA,CAAA,CAAA;ACFL,MAAAE,IAAA,uBAAA,mCAAA,GACAC,IAAA,uBAAA,uCAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GC0PHC,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAlKAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GACA,EAAA,GAAAI,EAAA,IAAAC,EAAA,GAGAC,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,EAAA,GACAE,IAAAF,EAAA,EAAA,GAEA,EAAA,cAAAG,EAAA,IAAAC,EAAAL,CAAA,GAGAM,IAAAC,EAAA,MAAAC,EAAA,QAAAA,EAAA,UAAAC,EAAA,SAAA,EAAA,GAGAC,IAAAH,EAAA,OAAA;AAAA,MAAiD,sCAAAE,EAAA,oBAAAP,EAAA,SAAA,CAAAE,EAAA;AAAA,IACqD,EAAA,GAGtGO,IAAAJ,EAAA,OAAA;AAAA,MAAiD,sCAAAE,EAAA,oBAAAP,EAAA,SAAA,CAAAE,EAAA;AAAA,IACqD,EAAA,GAGtGQ,IAAAL,EAAA,MAAA,EAAAH,EAAA,UAAAA,EAAA,IAAA,GAEAS,IAAA,MAAA;AACI,MAAAb,EAAA;AAAA,IAEA,GAGJc,IAAA,OAAAC,MAAA;AACI,MA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