@adyen/bento-vue3 1.91.0 → 1.92.1

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 (226) hide show
  1. package/dist/@types/index.d.ts +128 -137
  2. package/dist/action-bar.js +1 -1
  3. package/dist/ai-tag.js +1 -1
  4. package/dist/alert.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/card.css +1 -1
  10. package/dist/assets/checkbox-group.css +1 -1
  11. package/dist/assets/checkbox.css +1 -1
  12. package/dist/assets/data-grid.css +1 -1
  13. package/dist/assets/date-range-picker.css +1 -1
  14. package/dist/assets/dialog-page.css +1 -1
  15. package/dist/assets/dropdown-tag.css +1 -1
  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/input-field-password.css +1 -1
  20. package/dist/assets/input-field-phone-number.css +1 -1
  21. package/dist/assets/input-field.css +1 -1
  22. package/dist/assets/inspector.css +1 -1
  23. package/dist/assets/modal-fullscreen.css +1 -1
  24. package/dist/assets/secondary-nav.css +1 -1
  25. package/dist/assets/sidepanel.css +1 -1
  26. package/dist/assets/textarea.css +1 -1
  27. package/dist/assets/toggle.css +1 -1
  28. package/dist/assets/use-cached-selected-values.css +1 -1
  29. package/dist/button.js +1 -1
  30. package/dist/card.js +1 -1
  31. package/dist/checkbox.js +2 -2
  32. package/dist/chunks/{action-bar.BPS3wPde.js → action-bar.BxyRAZn1.js} +3 -3
  33. package/dist/chunks/{action-bar.BPS3wPde.js.map → action-bar.BxyRAZn1.js.map} +1 -1
  34. package/dist/chunks/{ai-tag.D7shWB_x.js → ai-tag.CpeZm2Yf.js} +2 -2
  35. package/dist/chunks/{ai-tag.D7shWB_x.js.map → ai-tag.CpeZm2Yf.js.map} +1 -1
  36. package/dist/chunks/{alert.CFWN2E0b.js → alert.RD0qOLhx.js} +91 -69
  37. package/dist/chunks/alert.RD0qOLhx.js.map +1 -0
  38. package/dist/chunks/{base-modal.BxcS7Pao.js → base-modal.C8Rsc2oO.js} +3 -3
  39. package/dist/chunks/base-modal.C8Rsc2oO.js.map +1 -0
  40. package/dist/chunks/{button-actions-with-menu.BKdNXYgU.js → button-actions-with-menu.KaWdHibo.js} +2 -2
  41. package/dist/chunks/{button-actions-with-menu.BKdNXYgU.js.map → button-actions-with-menu.KaWdHibo.js.map} +1 -1
  42. package/dist/chunks/{button-actions.DLiM8KZL.js → button-actions.7Oi2Ra4p.js} +87 -93
  43. package/dist/chunks/button-actions.7Oi2Ra4p.js.map +1 -0
  44. package/dist/chunks/button-actions.types.BptAXjD8.js.map +1 -1
  45. package/dist/chunks/button.DWF7FSIw.js.map +1 -1
  46. package/dist/chunks/{calendar.qm-kFNQv.js → calendar.DfMwuOIR.js} +516 -456
  47. package/dist/chunks/calendar.DfMwuOIR.js.map +1 -0
  48. package/dist/chunks/{card.BEChcEqg.js → card.7q8tTfjG.js} +2 -2
  49. package/dist/chunks/card.7q8tTfjG.js.map +1 -0
  50. package/dist/chunks/{checkbox-group.i3W8WO-7.js → checkbox-group.CgrmMYbN.js} +4 -4
  51. package/dist/chunks/checkbox-group.CgrmMYbN.js.map +1 -0
  52. package/dist/chunks/{checkbox.BPrymcRl.js → checkbox.CdkqCAAL.js} +3 -5
  53. package/dist/chunks/checkbox.CdkqCAAL.js.map +1 -0
  54. package/dist/chunks/{code-snippet.BG5ZmCrb.js → code-snippet.KKUb5A6A.js} +3 -3
  55. package/dist/chunks/code-snippet.KKUb5A6A.js.map +1 -0
  56. package/dist/chunks/constructNow.DyOJDyZZ.js +8 -0
  57. package/dist/chunks/{constructNow.D9uRk678.js.map → constructNow.DyOJDyZZ.js.map} +1 -1
  58. package/dist/chunks/country.types.6a7xxZIR.js.map +1 -1
  59. package/dist/chunks/{dashboard-section.C7mfUXOl.js → dashboard-section.kwKlujP-.js} +2 -2
  60. package/dist/chunks/{dashboard-section.C7mfUXOl.js.map → dashboard-section.kwKlujP-.js.map} +1 -1
  61. package/dist/chunks/{dashed-underline.B50DIXjK.js → dashed-underline.ADDEdamG.js} +2 -2
  62. package/dist/chunks/{dashed-underline.B50DIXjK.js.map → dashed-underline.ADDEdamG.js.map} +1 -1
  63. package/dist/chunks/{data-grid-template.CKdZb6EN.js → data-grid-template.C69yN3ZR.js} +2 -2
  64. package/dist/chunks/{data-grid-template.CKdZb6EN.js.map → data-grid-template.C69yN3ZR.js.map} +1 -1
  65. package/dist/chunks/{data-grid.DvMe72LK.js → data-grid.BL4DPi_-.js} +464 -465
  66. package/dist/chunks/data-grid.BL4DPi_-.js.map +1 -0
  67. package/dist/chunks/{date-picker.CidHad1p.js → date-picker.Cgr0Sbo0.js} +16 -16
  68. package/dist/chunks/{date-picker.CidHad1p.js.map → date-picker.Cgr0Sbo0.js.map} +1 -1
  69. package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -1
  70. package/dist/chunks/date-range-picker.Cpw7J4d1.js +1038 -0
  71. package/dist/chunks/date-range-picker.Cpw7J4d1.js.map +1 -0
  72. package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -1
  73. package/dist/chunks/{de.DXrHnkLX.js → de.ctR_lBqr.js} +2 -2
  74. package/dist/chunks/{de.DXrHnkLX.js.map → de.ctR_lBqr.js.map} +1 -1
  75. package/dist/chunks/{differenceInMonths.s_znQQpw.js → differenceInMonths.yz4Dfe-b.js} +13 -12
  76. package/dist/chunks/{differenceInMonths.s_znQQpw.js.map → differenceInMonths.yz4Dfe-b.js.map} +1 -1
  77. package/dist/chunks/{draggable-handle.CySRx1tb.js → draggable-handle.BWHOlabB.js} +2 -2
  78. package/dist/chunks/{draggable-handle.CySRx1tb.js.map → draggable-handle.BWHOlabB.js.map} +1 -1
  79. package/dist/chunks/{dropdown-tag.wcJ6Mgqe.js → dropdown-tag.DqhjcJXf.js} +6 -6
  80. package/dist/chunks/dropdown-tag.DqhjcJXf.js.map +1 -0
  81. package/dist/chunks/{dropdown.DHoL50gV.js → dropdown.C323NUqq.js} +411 -407
  82. package/dist/chunks/dropdown.C323NUqq.js.map +1 -0
  83. package/dist/chunks/{en-GB.CBpvhDYV.js → en-GB.BsQNm5GT.js} +2 -2
  84. package/dist/chunks/{en-GB.CBpvhDYV.js.map → en-GB.BsQNm5GT.js.map} +1 -1
  85. package/dist/chunks/{en-US.CCazFVNP.js → en-US.BR6y7foR.js} +5 -5
  86. package/dist/chunks/{en-US.CCazFVNP.js.map → en-US.BR6y7foR.js.map} +1 -1
  87. package/dist/chunks/{es.CoF2PB8b.js → es.DxqH-QhP.js} +2 -2
  88. package/dist/chunks/{es.CoF2PB8b.js.map → es.DxqH-QhP.js.map} +1 -1
  89. package/dist/chunks/{file-uploader.Dbg3vfZ_.js → file-uploader.B5_l2uQO.js} +4 -5
  90. package/dist/chunks/{file-uploader.Dbg3vfZ_.js.map → file-uploader.B5_l2uQO.js.map} +1 -1
  91. package/dist/chunks/{filter-bar.Dt-cU3zy.js → filter-bar.CuZruHzo.js} +18 -18
  92. package/dist/chunks/filter-bar.CuZruHzo.js.map +1 -0
  93. package/dist/chunks/{footer-actions.CYBdKDPo.js → footer-actions.4Qj_I3cd.js} +2 -2
  94. package/dist/chunks/{footer-actions.CYBdKDPo.js.map → footer-actions.4Qj_I3cd.js.map} +1 -1
  95. package/dist/chunks/{form-layout-title.B3ePK3yi.js → form-layout-title.B712PesH.js} +2 -2
  96. package/dist/chunks/{form-layout-title.B3ePK3yi.js.map → form-layout-title.B712PesH.js.map} +1 -1
  97. package/dist/chunks/{fr.CJXL-Ief.js → fr.DJtn8ron.js} +2 -2
  98. package/dist/chunks/{fr.CJXL-Ief.js.map → fr.DJtn8ron.js.map} +1 -1
  99. package/dist/chunks/{header-meta.COak4D8-.js → header-meta.BJjFOcxY.js} +14 -14
  100. package/dist/chunks/{header-meta.COak4D8-.js.map → header-meta.BJjFOcxY.js.map} +1 -1
  101. package/dist/chunks/{header-with-views.DqioajcO.js → header-with-views.BI6uh8o0.js} +8 -8
  102. package/dist/chunks/{header-with-views.DqioajcO.js.map → header-with-views.BI6uh8o0.js.map} +1 -1
  103. package/dist/chunks/{header.C21yzWrk.js → header.5RQulwlL.js} +3 -3
  104. package/dist/chunks/header.5RQulwlL.js.map +1 -0
  105. package/dist/chunks/{input-field-password.DyUphhxB.js → input-field-password.CbDeLcL2.js} +5 -5
  106. package/dist/chunks/input-field-password.CbDeLcL2.js.map +1 -0
  107. package/dist/chunks/{input-field-phone-number.BXVaC5ra.js → input-field-phone-number.DzruT8x5.js} +4 -4
  108. package/dist/chunks/{input-field-phone-number.BXVaC5ra.js.map → input-field-phone-number.DzruT8x5.js.map} +1 -1
  109. package/dist/chunks/{input-field.DkUFvIWt.js → input-field.zwUuajnC.js} +122 -114
  110. package/dist/chunks/input-field.zwUuajnC.js.map +1 -0
  111. package/dist/chunks/{input-time.WI_qdwJc.js → input-time.RUecHW9h.js} +4 -4
  112. package/dist/chunks/{input-time.WI_qdwJc.js.map → input-time.RUecHW9h.js.map} +1 -1
  113. package/dist/chunks/isSameWeek.CieN9XgL.js +14 -0
  114. package/dist/chunks/{isSameWeek.Dj6luS8h.js.map → isSameWeek.CieN9XgL.js.map} +1 -1
  115. package/dist/chunks/{it.20Y7h-bF.js → it.keS7oN5l.js} +3 -3
  116. package/dist/chunks/{it.20Y7h-bF.js.map → it.keS7oN5l.js.map} +1 -1
  117. package/dist/chunks/{ja.DXlq0H98.js → ja.cLwacUE6.js} +2 -2
  118. package/dist/chunks/{ja.DXlq0H98.js.map → ja.cLwacUE6.js.map} +1 -1
  119. package/dist/chunks/link.D6D6YGsN.js.map +1 -1
  120. package/dist/chunks/{modal-fullscreen.c6QphYQo.js → modal-fullscreen.CepaWyoi.js} +2 -2
  121. package/dist/chunks/{modal-fullscreen.c6QphYQo.js.map → modal-fullscreen.CepaWyoi.js.map} +1 -1
  122. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.ImqHKH-g.js → modal.vue_vue_type_script_setup_true_lang.BW9Ff59H.js} +49 -47
  123. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.ImqHKH-g.js.map → modal.vue_vue_type_script_setup_true_lang.BW9Ff59H.js.map} +1 -1
  124. package/dist/chunks/{pagination.Cu85Lqms.js → pagination.BJtoP8At.js} +2 -2
  125. package/dist/chunks/{pagination.Cu85Lqms.js.map → pagination.BJtoP8At.js.map} +1 -1
  126. package/dist/chunks/payment-method.types.BqtH7RM2.js.map +1 -1
  127. package/dist/chunks/popover.types.D8tHtFl3.js.map +1 -1
  128. package/dist/chunks/popper-container.DMN8n5iC.js.map +1 -1
  129. package/dist/chunks/promo-banner.-H4r_cwj.js.map +1 -1
  130. package/dist/chunks/{pt-BR.DmhmCzxE.js → pt-BR.ChPOra5s.js} +2 -2
  131. package/dist/chunks/{pt-BR.DmhmCzxE.js.map → pt-BR.ChPOra5s.js.map} +1 -1
  132. package/dist/chunks/radio-group.CfMr1fmW.js.map +1 -1
  133. package/dist/chunks/{rich-text-editor.Bf9EWzNk.js → rich-text-editor.CSvPpLth.js} +3 -3
  134. package/dist/chunks/{rich-text-editor.Bf9EWzNk.js.map → rich-text-editor.CSvPpLth.js.map} +1 -1
  135. package/dist/chunks/{search-bar.p6kHCCvT.js → search-bar.CGXKk-gv.js} +4 -4
  136. package/dist/chunks/{search-bar.p6kHCCvT.js.map → search-bar.CGXKk-gv.js.map} +1 -1
  137. package/dist/chunks/{secondary-nav.CaxiyVaO.js → secondary-nav.DkcoRjfJ.js} +2 -2
  138. package/dist/chunks/{secondary-nav.CaxiyVaO.js.map → secondary-nav.DkcoRjfJ.js.map} +1 -1
  139. package/dist/chunks/segmented-control.types.BHRLV8KU.js.map +1 -1
  140. package/dist/chunks/{sidepanel.CAVhSs-O.js → sidepanel.S037xghX.js} +3 -3
  141. package/dist/chunks/{sidepanel.CAVhSs-O.js.map → sidepanel.S037xghX.js.map} +1 -1
  142. package/dist/chunks/{startOfWeek.Cvmo-f5J.js → startOfWeek.muMEhS7U.js} +2 -2
  143. package/dist/chunks/{startOfWeek.Cvmo-f5J.js.map → startOfWeek.muMEhS7U.js.map} +1 -1
  144. package/dist/chunks/status.types.Dx8MDhEH.js.map +1 -1
  145. package/dist/chunks/{summary-grid.types.CDithi8M.js → summary-grid.types.D1JQ_jtv.js} +2 -2
  146. package/dist/chunks/{summary-grid.types.CDithi8M.js.map → summary-grid.types.D1JQ_jtv.js.map} +1 -1
  147. package/dist/chunks/tag.YN2r-Pp3.js.map +1 -1
  148. package/dist/chunks/{textarea.JGXAlpx9.js → textarea.-6FHesSp.js} +2 -2
  149. package/dist/chunks/textarea.-6FHesSp.js.map +1 -0
  150. package/dist/chunks/{timeline-item.BNFPpQz1.js → timeline-item.BJaFr2_Y.js} +5 -5
  151. package/dist/chunks/timeline-item.BJaFr2_Y.js.map +1 -0
  152. package/dist/chunks/{toggle.BQoprdX-.js → toggle.BdcgY15I.js} +3 -5
  153. package/dist/chunks/toggle.BdcgY15I.js.map +1 -0
  154. package/dist/chunks/tooltip.DHfG2aRt.js.map +1 -1
  155. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.C1cF-adv.js → tutorial.vue_vue_type_script_setup_true_lang.D_Z1zKam.js} +2 -2
  156. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.C1cF-adv.js.map → tutorial.vue_vue_type_script_setup_true_lang.D_Z1zKam.js.map} +1 -1
  157. package/dist/chunks/typography.B3J6_tYk.js.map +1 -1
  158. package/dist/chunks/use-cached-selected-values.DUWGSMvO.js +1740 -0
  159. package/dist/chunks/use-cached-selected-values.DUWGSMvO.js.map +1 -0
  160. package/dist/chunks/{use-date-input-formatter.BOuXpRb-.js → use-date-input-formatter.BH4hdEJW.js} +4 -4
  161. package/dist/chunks/{use-date-input-formatter.BOuXpRb-.js.map → use-date-input-formatter.BH4hdEJW.js.map} +1 -1
  162. package/dist/chunks/{zh-CN.Ce34mXsX.js → zh-CN.ZG6obniO.js} +3 -3
  163. package/dist/chunks/{zh-CN.Ce34mXsX.js.map → zh-CN.ZG6obniO.js.map} +1 -1
  164. package/dist/code-snippet.js +1 -1
  165. package/dist/dashboard-template.js +1 -1
  166. package/dist/dashed-underline.js +1 -1
  167. package/dist/data-grid-template.js +1 -1
  168. package/dist/data-grid.js +1 -1
  169. package/dist/date-picker.js +2 -2
  170. package/dist/date-range-picker.js +2 -2
  171. package/dist/draggable.js +1 -1
  172. package/dist/dropdown.js +3 -3
  173. package/dist/file-uploader.js +1 -1
  174. package/dist/filter-bar.js +1 -1
  175. package/dist/form-layout.js +1 -1
  176. package/dist/header-with-views.js +1 -1
  177. package/dist/header.js +1 -1
  178. package/dist/index.js +248 -248
  179. package/dist/index.js.map +1 -1
  180. package/dist/input-field-password.js +1 -1
  181. package/dist/input-field-phone-number.js +1 -1
  182. package/dist/input-field.js +1 -1
  183. package/dist/input-time.js +1 -1
  184. package/dist/internal.js +5 -5
  185. package/dist/menu.js +1 -1
  186. package/dist/modal-fullscreen.js +1 -1
  187. package/dist/modal.js +2 -2
  188. package/dist/pagination.js +1 -1
  189. package/dist/popover.js +1 -1
  190. package/dist/rich-text-editor.js +1 -1
  191. package/dist/search-bar.js +2 -2
  192. package/dist/secondary-nav.js +1 -1
  193. package/dist/sidepanel.js +1 -1
  194. package/dist/summary-grid.js +1 -1
  195. package/dist/textarea.js +1 -1
  196. package/dist/timeline.js +1 -1
  197. package/dist/toggle.js +1 -1
  198. package/dist/tutorial.js +1 -1
  199. package/dist/web-types.json +1 -1
  200. package/package.json +5 -5
  201. package/dist/chunks/alert.CFWN2E0b.js.map +0 -1
  202. package/dist/chunks/base-modal.BxcS7Pao.js.map +0 -1
  203. package/dist/chunks/button-actions.DLiM8KZL.js.map +0 -1
  204. package/dist/chunks/calendar.qm-kFNQv.js.map +0 -1
  205. package/dist/chunks/card.BEChcEqg.js.map +0 -1
  206. package/dist/chunks/checkbox-group.i3W8WO-7.js.map +0 -1
  207. package/dist/chunks/checkbox.BPrymcRl.js.map +0 -1
  208. package/dist/chunks/code-snippet.BG5ZmCrb.js.map +0 -1
  209. package/dist/chunks/constructNow.D9uRk678.js +0 -8
  210. package/dist/chunks/data-grid.DvMe72LK.js.map +0 -1
  211. package/dist/chunks/date-range-picker.c5OwESTS.js +0 -1027
  212. package/dist/chunks/date-range-picker.c5OwESTS.js.map +0 -1
  213. package/dist/chunks/dropdown-tag.wcJ6Mgqe.js.map +0 -1
  214. package/dist/chunks/dropdown.DHoL50gV.js.map +0 -1
  215. package/dist/chunks/filter-bar.Dt-cU3zy.js.map +0 -1
  216. package/dist/chunks/header.C21yzWrk.js.map +0 -1
  217. package/dist/chunks/input-field-password.DyUphhxB.js.map +0 -1
  218. package/dist/chunks/input-field.DkUFvIWt.js.map +0 -1
  219. package/dist/chunks/isSameWeek.Dj6luS8h.js +0 -14
  220. package/dist/chunks/textarea.JGXAlpx9.js.map +0 -1
  221. package/dist/chunks/timeline-item.BNFPpQz1.js.map +0 -1
  222. package/dist/chunks/toggle.BQoprdX-.js.map +0 -1
  223. package/dist/chunks/use-cached-selected-values.Bx8uuky9.js +0 -1657
  224. package/dist/chunks/use-cached-selected-values.Bx8uuky9.js.map +0 -1
  225. package/dist/chunks/warning-filled.BzyK_mMj.js +0 -29
  226. package/dist/chunks/warning-filled.BzyK_mMj.js.map +0 -1
@@ -1,18 +1,18 @@
1
- import { defineComponent as Ee, useAttrs as _e, useSlots as Te, computed as l, ref as k, provide as Ne, inject as J, toRef as Ae, toRefs as Fe, openBlock as d, createBlock as u, unref as t, mergeProps as O, withCtx as b, renderSlot as p, createCommentVNode as r, createElementVNode as R, createElementBlock as v, withModifiers as X, withKeys as ge, createTextVNode as z, toDisplayString as G, createVNode as Oe } from "vue";
2
- import { b as Ce, I as Ie, c as Re, B as Z } from "./dropdown.DHoL50gV.js";
3
- import { p as S, d as P, B as L } from "./typography.B3J6_tYk.js";
4
- import { u as Se } from "./form-field.D_2g7vaP.js";
1
+ import { defineComponent as _e, useAttrs as Te, useSlots as Ne, ref as k, provide as Ae, inject as J, toRef as Fe, computed as i, toRefs as ge, openBlock as d, createBlock as u, unref as t, mergeProps as g, withCtx as c, renderSlot as p, createCommentVNode as r, createElementVNode as C, createElementBlock as v, withModifiers as X, withKeys as Oe, createTextVNode as z, toDisplayString as G, createVNode as Ie } from "vue";
2
+ import { b as Ce, I as Re, c as Se, B as Z } from "./dropdown.C323NUqq.js";
3
+ import { p as R, d as S, B as L } from "./typography.B3J6_tYk.js";
4
+ import { u as Pe } from "./form-field.D_2g7vaP.js";
5
5
  import { g as h } from "./generate-uid.DBWe4g6T.js";
6
6
  import { g as Q } from "./get-slot-text.8Fbl1GOr.js";
7
- import { u as Pe } from "./aria-label.CaUURpnB.js";
8
- import { u as Be } from "./index.B875RXHM.js";
7
+ import { u as Be } from "./aria-label.CaUURpnB.js";
8
+ import { u as $e } from "./index.B875RXHM.js";
9
9
  import { u as Me } from "./use-form-layout-loading.CWbjZiwP.js";
10
10
  import { u as Ve } from "./use-has-slot.CyMiImRQ.js";
11
- import { F as $e } from "./field-label.DZYFjFgr.js";
12
- import { E as Ue } from "./error-message.Dyvrw6ZB.js";
13
- import { _ as He } from "./_plugin-vue_export-helper.CHgC5LLL.js";
11
+ import { F as Ue } from "./field-label.DZYFjFgr.js";
12
+ import { E as He } from "./error-message.Dyvrw6ZB.js";
13
+ import { _ as qe } from "./_plugin-vue_export-helper.CHgC5LLL.js";
14
14
  import "../assets/input-field.css";
15
- var m = /* @__PURE__ */ ((o) => (o.DEFAULT = "default", o.PAYMENT_METHOD = "payment-method", o.STATIC_VALUE = "static-value", o.DROPDOWN = "dropdown", o))(m || {}), f = /* @__PURE__ */ ((o) => (o.START = "start", o.END = "end", o))(f || {}), E = /* @__PURE__ */ ((o) => (o.CONDENSED = "condensed", o.DISABLED = "disabled", o.READONLY = "readonly", o.ERROR = "error", o))(E || {}), B = /* @__PURE__ */ ((o) => (o.SEARCH = "search", o.TEXT = "text", o.NUMBER = "number", o))(B || {}), qe = /* @__PURE__ */ ((o) => (o.INPUT = "input", o.ESCAPE_PRESSED = "escape-pressed", o.UPDATE_DROPDOWN = "update:dropdown", o.DROPDOWN_INPUT = "dropdown-input", o.FOCUS = "focus", o.CHANGE = "change", o.BLUR = "blur", o.KEYDOWN = "keydown", o))(qe || {});
15
+ var m = /* @__PURE__ */ ((o) => (o.DEFAULT = "default", o.PAYMENT_METHOD = "payment-method", o.STATIC_VALUE = "static-value", o.DROPDOWN = "dropdown", o))(m || {}), b = /* @__PURE__ */ ((o) => (o.START = "start", o.END = "end", o))(b || {}), E = /* @__PURE__ */ ((o) => (o.CONDENSED = "condensed", o.DISABLED = "disabled", o.READONLY = "readonly", o.ERROR = "error", o))(E || {}), P = /* @__PURE__ */ ((o) => (o.SEARCH = "search", o.TEXT = "text", o.NUMBER = "number", o))(P || {}), Ye = /* @__PURE__ */ ((o) => (o.INPUT = "input", o.ESCAPE_PRESSED = "escape-pressed", o.UPDATE_DROPDOWN = "update:dropdown", o.DROPDOWN_INPUT = "dropdown-input", o.FOCUS = "focus", o.CHANGE = "change", o.BLUR = "blur", o.KEYDOWN = "keydown", o))(Ye || {});
16
16
  const x = {
17
17
  "de-DE": { ariaLabelDropdownFallback: "{inputLabel} Dropdown", ariaLabelFallback: "Eingabefeld" },
18
18
  "en-GB": { ariaLabelDropdownFallback: "{inputLabel} Drop-down", ariaLabelFallback: "Input field" },
@@ -24,25 +24,25 @@ const x = {
24
24
  "ja-JP": { ariaLabelDropdownFallback: "{inputLabel}ドロップダウン", ariaLabelFallback: "入力フィールド" },
25
25
  "pt-BR": { ariaLabelDropdownFallback: "Menu suspenso {inputLabel}", ariaLabelFallback: "Campo de entrada" },
26
26
  "zh-CN": { ariaLabelDropdownFallback: "{inputLabel} 下拉菜单", ariaLabelFallback: "输入字段" }
27
- }, Ye = ["aria-disabled"], Ke = ["aria-hidden"], We = ["aria-hidden"], je = ["id"], Je = { class: "b-input-field__input-container" }, Xe = ["id", "aria-label", "aria-describedby", "aria-owns", "aria-invalid", "placeholder", "required", "aria-required", "type", "value", "disabled", "readonly"], ze = ["aria-hidden"], Ge = ["id"], Ze = ["id"], Qe = {
27
+ }, Ke = ["aria-disabled"], We = ["aria-hidden"], je = ["aria-hidden"], Je = ["id"], Xe = { class: "b-input-field__input-container" }, ze = ["id", "aria-label", "aria-describedby", "aria-owns", "aria-invalid", "placeholder", "required", "aria-required", "type", "value", "disabled", "readonly"], Ge = ["aria-hidden"], Ze = ["id"], Qe = ["id"], xe = {
28
28
  name: "bento-input-field",
29
29
  inheritAttrs: !1,
30
30
  model: { prop: "modelValue" },
31
31
  i18n: { messages: x }
32
- }, xe = /* @__PURE__ */ Ee({
33
- ...Qe,
32
+ }, ea = /* @__PURE__ */ _e({
33
+ ...xe,
34
34
  props: {
35
35
  ariaHidden: { type: Boolean, default: !0 },
36
36
  ariaLabel: { default: void 0 },
37
37
  condensed: { type: Boolean, default: !1 },
38
38
  dropdown: { default: void 0 },
39
- dropdownPosition: { default: f.START },
39
+ dropdownPosition: { default: b.START },
40
40
  error: { type: Boolean, default: !1 },
41
41
  modelValue: { default: void 0 },
42
42
  slashedZero: { type: Boolean, default: !1 },
43
43
  staticValue: { default: "" },
44
- staticValuePosition: { default: f.START },
45
- type: { default: B.TEXT },
44
+ staticValuePosition: { default: b.START },
45
+ type: { default: P.TEXT },
46
46
  value: { default: void 0 },
47
47
  variant: { default: m.DEFAULT },
48
48
  description: { default: "" },
@@ -57,72 +57,80 @@ const x = {
57
57
  },
58
58
  emits: ["blur", "click", "change", "dropdown-input", "escape-pressed", "focus", "keydown", "keyup", "input", "update:dropdown", "update:model-value"],
59
59
  setup(o, { expose: ee, emit: ae }) {
60
- const _ = _e(), T = Te(), a = o, n = ae, { emitValue: oe } = Se(n), te = l(() => Object.fromEntries(Object.entries(_).filter(([e]) => !e.startsWith("aria-")))), { t: M } = Be({ messages: x }), s = Ve(T), V = k(null), C = k(null), $ = h("input"), y = h("input-dropdown"), N = h("input-static-value"), U = h("input-description"), H = h("input-error"), I = k(!1);
61
- Ne(Ce, !0);
62
- const q = J(Ie, k(void 0)), le = () => {
60
+ const B = Te(), _ = Ne(), a = o, n = ae, { emitValue: oe } = Pe(n), { t: $ } = $e({ messages: x }), s = Ve(_), M = k(null), O = k(null), V = h("input"), y = h("input-dropdown"), T = h("input-static-value"), U = h("input-description"), H = h("input-error"), I = k(!1);
61
+ function te(e) {
62
+ return e["data-testid"] ?? "input-text-container";
63
+ }
64
+ function le(e) {
65
+ return Object.fromEntries(
66
+ Object.entries(e).filter(([l]) => !l.startsWith("aria-") && l !== "data-testid")
67
+ );
68
+ }
69
+ Ae(Ce, !0);
70
+ const q = J(Re, k(void 0)), ie = () => {
63
71
  I.value = !0, n("focus");
64
- }, ie = () => {
72
+ }, re = () => {
65
73
  I.value = !1, n("blur");
66
- }, { isReadOnly: w } = Me(Ae(a, "readonly")), Y = l(
74
+ }, { isReadOnly: w } = Me(Fe(a, "readonly")), Y = i(
67
75
  () => w.value || a.dropdown?.readonly
68
- ), A = l(
69
- () => a.variant === m.STATIC_VALUE && !!T.staticValue
70
- ), re = l(() => a.variant === m.DEFAULT), de = l(() => a.variant === m.PAYMENT_METHOD), ne = l(
71
- () => A.value && a.staticValuePosition === f.START
72
- ), se = l(
73
- () => A.value && a.staticValuePosition === f.END
74
- ), F = l(() => a.variant === m.DROPDOWN && !!a.dropdown), ue = l(
75
- () => F.value && a.dropdownPosition === f.START
76
- ), pe = l(
77
- () => F.value && a.dropdownPosition === f.END
78
- ), g = l(
76
+ ), N = i(
77
+ () => a.variant === m.STATIC_VALUE && !!_.staticValue
78
+ ), de = i(() => a.variant === m.DEFAULT), ne = i(() => a.variant === m.PAYMENT_METHOD), se = i(
79
+ () => N.value && a.staticValuePosition === b.START
80
+ ), ue = i(
81
+ () => N.value && a.staticValuePosition === b.END
82
+ ), A = i(() => a.variant === m.DROPDOWN && !!a.dropdown), pe = i(
83
+ () => A.value && a.dropdownPosition === b.START
84
+ ), fe = i(
85
+ () => A.value && a.dropdownPosition === b.END
86
+ ), F = i(
79
87
  () => !a.disabled && !w.value && (!!a.errorMessage || a.error)
80
- ), ce = l(() => Q(T)("default") || a.label), fe = l(() => Q(T)("description") || a.description), be = l(() => F.value === !0 && A.value === !0 ? `${N} ${y}` : F.value === !0 ? `${y}` : A.value === !0 ? `${N}` : null), ve = l(
81
- () => _?.["aria-labelledby"] ? void 0 : M("ariaLabelFallback")
82
- ), me = l(
83
- () => M("ariaLabelDropdownFallback", { inputLabel: K.value })
84
- ), ye = k(_["aria-label"]), { ariaLabel: we } = Fe(a), K = Pe({
85
- ariaLabel: ye.value,
88
+ ), be = i(() => Q(_)("default") || a.label), ce = i(() => Q(_)("description") || a.description), ve = i(() => A.value === !0 && N.value === !0 ? `${T} ${y}` : A.value === !0 ? `${y}` : N.value === !0 ? `${T}` : null), me = i(
89
+ () => B?.["aria-labelledby"] ? void 0 : $("ariaLabelFallback")
90
+ ), ye = i(
91
+ () => $("ariaLabelDropdownFallback", { inputLabel: K.value })
92
+ ), we = k(B["aria-label"]), { ariaLabel: De } = ge(a), K = Be({
93
+ ariaLabel: we.value,
86
94
  // TODO: take this line away when the aria-label props is removed
87
- label: we,
88
- defaultFallback: ce.value || ve
89
- }), De = l(
90
- () => `${fe.value ? U : ""} ${g.value && a.errorMessage ? H : ""}`
91
- ), ke = l(() => ({
95
+ label: De,
96
+ defaultFallback: be.value || me
97
+ }), ke = i(
98
+ () => `${ce.value ? U : ""} ${F.value && a.errorMessage ? H : ""}`
99
+ ), Le = i(() => ({
92
100
  [`b-input-field--${E.CONDENSED}`]: a.condensed,
93
101
  [`b-input-field--${E.DISABLED}`]: a.disabled,
94
102
  [`b-input-field--${E.READONLY}`]: w.value,
95
- [`b-input-field--${E.ERROR}`]: g.value,
103
+ [`b-input-field--${E.ERROR}`]: F.value,
96
104
  "b-input-field--slashed-zero": a.slashedZero
97
- })), W = l(() => ({
98
- "aria-label": me.value,
105
+ })), W = i(() => ({
106
+ "aria-label": ye.value,
99
107
  ...a.dropdown
100
- })), Le = (e) => {
101
- const i = e.target.value;
102
- !a.disabled && !w.value && oe(i);
108
+ })), he = (e) => {
109
+ const l = e.target.value;
110
+ !a.disabled && !w.value && oe(l);
103
111
  }, j = (e) => {
104
112
  n("dropdown-input", e), n("update:dropdown", { ...a?.dropdown, value: e });
105
113
  }, D = () => {
106
- V.value.focus();
114
+ M.value.focus();
107
115
  };
108
116
  ee({
109
117
  focusInput: D,
110
118
  focus: () => {
111
- a.variant === "dropdown" ? C.value.focus() : D();
119
+ a.variant === "dropdown" ? O.value.focus() : D();
112
120
  }
113
121
  });
114
- const he = J(Re, "");
115
- return !Object.values(B).includes(a.type) && !he && (a.type === "tel" ? S(
122
+ const Ee = J(Se, "");
123
+ return !Object.values(P).includes(a.type) && !Ee && (a.type === "tel" ? R(
116
124
  `"bento-input-field" dropdown does not support the type '${a.type}', use "bento-input-field-phone-number" instead.`
117
- ) : a.type === "password" ? S(
125
+ ) : a.type === "password" ? R(
118
126
  `"bento-input-field" dropdown does not support the type '${a.type}', use "bento-input-field-password" instead.`
119
- ) : S(`"bento-input-field" dropdown does not support the type '${a.type}'`)), a.error && P(
127
+ ) : R(`"bento-input-field" dropdown does not support the type '${a.type}'`)), a.error && S(
120
128
  'BentoInputField "error" property',
121
129
  `Use the BentoInputField "errorMessage" property instead to indicate that there is a modifier error.
122
130
  Having the field as "undefined" will hide/remove the error.
123
131
  <bento-dropdown errorMessage="Error message text" />`,
124
132
  "2.0.0"
125
- ), s("defaultIconBefore") && P(
133
+ ), s("defaultIconBefore") && S(
126
134
  'BentoInputField "defaultIconBefore" slot',
127
135
  `Use the BentoInputField "iconBefore" slot instead to add an icon at the left side of the input field
128
136
  <bento-input-field>
@@ -131,21 +139,21 @@ const x = {
131
139
  </template>
132
140
  </bento-input-field>`,
133
141
  "2.0.0"
134
- ), a.value && P(
142
+ ), a.value && S(
135
143
  'BentoInputField "value" property',
136
144
  `The use of "value" prop in "BentoInputField" is no longer supported.
137
145
  Use the "v-model" or "model-value" property instead.`,
138
146
  "2.0.0"
139
- ), (e, i) => (d(), u(t(L), O({ class: "b-input-field" }, te.value, {
140
- "data-testid": "input-text-container",
141
- class: ke.value,
147
+ ), (e, l) => (d(), u(t(L), g({ class: "b-input-field" }, le(e.$attrs), {
148
+ "data-testid": te(e.$attrs),
149
+ class: Le.value,
142
150
  el: "div",
143
151
  variant: "body"
144
152
  }), {
145
- default: b(() => [
146
- t(s)("default") || e.label ? (d(), u(t($e), {
153
+ default: c(() => [
154
+ t(s)("default") || e.label ? (d(), u(t(Ue), {
147
155
  key: 0,
148
- for: t($),
156
+ for: t(V),
149
157
  "data-testid": "input-field-label",
150
158
  "tooltip-text": e.tooltipText,
151
159
  optional: e.optional,
@@ -153,70 +161,70 @@ const x = {
153
161
  label: e.label,
154
162
  onClick: D
155
163
  }, {
156
- default: b(() => [
164
+ default: c(() => [
157
165
  p(e.$slots, "default", {}, void 0, !0)
158
166
  ]),
159
167
  _: 3
160
168
  }, 8, ["for", "tooltip-text", "optional", "required", "label"])) : r("", !0),
161
- R("div", {
169
+ C("div", {
162
170
  class: "b-input-field__input-box",
163
171
  "data-testid": "input-box",
164
172
  "aria-disabled": e.disabled,
165
173
  onClick: D
166
174
  }, [
167
- re.value && (t(s)("defaultIconBefore") || t(s)("iconBefore")) ? (d(), v("span", {
175
+ de.value && (t(s)("defaultIconBefore") || t(s)("iconBefore")) ? (d(), v("span", {
168
176
  key: 0,
169
177
  "aria-hidden": e.ariaHidden ? "true" : void 0,
170
178
  class: "b-input-field__icon-before"
171
179
  }, [
172
180
  t(s)("iconBefore") ? p(e.$slots, "iconBefore", { key: 0 }, void 0, !0) : r("", !0),
173
181
  t(s)("defaultIconBefore") && !t(s)("iconBefore") ? p(e.$slots, "defaultIconBefore", { key: 1 }, void 0, !0) : r("", !0)
174
- ], 8, Ke)) : r("", !0),
175
- de.value && t(s)("paymentMethod") ? (d(), v("span", {
182
+ ], 8, We)) : r("", !0),
183
+ ne.value && t(s)("paymentMethod") ? (d(), v("span", {
176
184
  key: 1,
177
185
  "aria-hidden": e.ariaHidden ? "true" : void 0,
178
186
  class: "b-input-field__payment-method"
179
187
  }, [
180
188
  p(e.$slots, "paymentMethod", {}, void 0, !0)
181
- ], 8, We)) : r("", !0),
182
- ue.value ? (d(), v("div", {
189
+ ], 8, je)) : r("", !0),
190
+ pe.value ? (d(), v("div", {
183
191
  key: 2,
184
192
  id: t(y),
185
193
  class: "b-input-field__dropdown b-input-field__dropdown--start",
186
- onClick: i[0] || (i[0] = X(() => {
194
+ onClick: l[0] || (l[0] = X(() => {
187
195
  }, ["stop"]))
188
196
  }, [
189
- e.dropdown ? (d(), u(t(Z), O({
197
+ e.dropdown ? (d(), u(t(Z), g({
190
198
  key: 0,
191
199
  ref_key: "inputDropdownElement",
192
- ref: C
200
+ ref: O
193
201
  }, W.value, {
194
202
  disabled: e.disabled,
195
203
  readonly: Y.value,
196
204
  "onUpdate:modelValue": j
197
205
  }), null, 16, ["disabled", "readonly"])) : r("", !0)
198
- ], 8, je)) : r("", !0),
199
- ne.value ? (d(), u(t(L), {
206
+ ], 8, Je)) : r("", !0),
207
+ se.value ? (d(), u(t(L), {
200
208
  key: 3,
201
- id: t(N),
209
+ id: t(T),
202
210
  class: "b-input-field__static-value b-input-field__static-value--start",
203
211
  el: "span",
204
212
  variant: "body"
205
213
  }, {
206
- default: b(() => [
214
+ default: c(() => [
207
215
  p(e.$slots, "staticValue", {}, void 0, !0)
208
216
  ]),
209
217
  _: 3
210
218
  }, 8, ["id"])) : r("", !0),
211
- R("div", Je, [
212
- R("input", O({ id: t($) }, t(_), {
219
+ C("div", Xe, [
220
+ C("input", g({ id: t(V) }, e.$attrs, {
213
221
  ref_key: "inputFieldElement",
214
- ref: V,
222
+ ref: M,
215
223
  class: "b-input-field__input",
216
224
  "aria-label": t(K),
217
- "aria-describedby": De.value,
218
- "aria-owns": be.value,
219
- "aria-invalid": g.value,
225
+ "aria-describedby": ke.value,
226
+ "aria-owns": ve.value,
227
+ "aria-invalid": F.value,
220
228
  placeholder: e.placeholder,
221
229
  required: e.required,
222
230
  "aria-required": e.required,
@@ -224,23 +232,23 @@ const x = {
224
232
  value: e.modelValue ?? e.value,
225
233
  disabled: e.disabled,
226
234
  readonly: t(w),
227
- onInput: Le,
228
- onChange: i[1] || (i[1] = (c) => n("change")),
229
- onFocus: le,
230
- onBlur: ie,
235
+ onInput: he,
236
+ onChange: l[1] || (l[1] = (f) => n("change")),
237
+ onFocus: ie,
238
+ onBlur: re,
231
239
  onKeydown: [
232
- i[2] || (i[2] = (c) => n("keydown", c)),
233
- i[4] || (i[4] = ge((c) => n("escape-pressed"), ["esc"]))
240
+ l[2] || (l[2] = (f) => n("keydown", f)),
241
+ l[4] || (l[4] = Oe((f) => n("escape-pressed"), ["esc"]))
234
242
  ],
235
- onKeyup: i[3] || (i[3] = (c) => n("keyup", c)),
236
- onClick: i[5] || (i[5] = (c) => n("click", c))
237
- }), null, 16, Xe),
243
+ onKeyup: l[3] || (l[3] = (f) => n("keyup", f)),
244
+ onClick: l[5] || (l[5] = (f) => n("click", f))
245
+ }), null, 16, ze),
238
246
  t(q) && I.value && (e.modelValue || e.value) ? (d(), u(t(L), {
239
247
  key: 0,
240
248
  el: "span",
241
249
  class: "b-input-field__hint"
242
250
  }, {
243
- default: b(() => [
251
+ default: c(() => [
244
252
  z(G(t(q)), 1)
245
253
  ]),
246
254
  _: 1
@@ -253,40 +261,40 @@ const x = {
253
261
  "data-testid": "input-text__icon-after"
254
262
  }, [
255
263
  p(e.$slots, "iconAfter", {}, void 0, !0)
256
- ], 8, ze)) : r("", !0),
257
- se.value ? (d(), u(t(L), {
264
+ ], 8, Ge)) : r("", !0),
265
+ ue.value ? (d(), u(t(L), {
258
266
  key: 5,
259
- id: t(N),
267
+ id: t(T),
260
268
  class: "b-input-field__static-value b-input-field__static-value--end",
261
269
  el: "span",
262
270
  variant: "body"
263
271
  }, {
264
- default: b(() => [
272
+ default: c(() => [
265
273
  p(e.$slots, "staticValue", {}, void 0, !0)
266
274
  ]),
267
275
  _: 3
268
276
  }, 8, ["id"])) : r("", !0),
269
- pe.value ? (d(), v("div", {
277
+ fe.value ? (d(), v("div", {
270
278
  key: 6,
271
279
  id: t(y),
272
280
  "data-testid": "input-field-dropdown-container-end",
273
281
  class: "b-input-field__dropdown b-input-field__dropdown--end",
274
- onClick: i[6] || (i[6] = X(() => {
282
+ onClick: l[6] || (l[6] = X(() => {
275
283
  }, ["stop"]))
276
284
  }, [
277
- e.dropdown ? (d(), u(t(Z), O({
285
+ e.dropdown ? (d(), u(t(Z), g({
278
286
  key: 0,
279
287
  id: t(y),
280
288
  ref_key: "inputDropdownElement",
281
- ref: C
289
+ ref: O
282
290
  }, W.value, {
283
291
  disabled: e.disabled,
284
292
  readonly: Y.value,
285
293
  "onUpdate:modelValue": j
286
294
  }), null, 16, ["id", "disabled", "readonly"])) : r("", !0)
287
- ], 8, Ge)) : r("", !0)
288
- ], 8, Ye),
289
- g.value && e.errorMessage ? (d(), u(t(Ue), {
295
+ ], 8, Ze)) : r("", !0)
296
+ ], 8, Ke),
297
+ F.value && e.errorMessage ? (d(), u(t(He), {
290
298
  key: 1,
291
299
  id: t(H),
292
300
  "error-message": e.errorMessage,
@@ -298,29 +306,29 @@ const x = {
298
306
  class: "b-input-field__description",
299
307
  onClick: D
300
308
  }, [
301
- Oe(t(L), {
309
+ Ie(t(L), {
302
310
  el: "span",
303
311
  variant: "body"
304
312
  }, {
305
- default: b(() => [
313
+ default: c(() => [
306
314
  p(e.$slots, "description", { id: "description" }, () => [
307
315
  z(G(e.description), 1)
308
316
  ], !0)
309
317
  ]),
310
318
  _: 3
311
319
  })
312
- ], 8, Ze)) : r("", !0)
320
+ ], 8, Qe)) : r("", !0)
313
321
  ]),
314
322
  _: 3
315
- }, 16, ["class"]));
323
+ }, 16, ["data-testid", "class"]));
316
324
  }
317
- }), ba = /* @__PURE__ */ He(xe, [["__scopeId", "data-v-1849e737"]]);
325
+ }), va = /* @__PURE__ */ qe(ea, [["__scopeId", "data-v-069114be"]]);
318
326
  export {
319
- ba as B,
320
- f as a,
321
- qe as b,
327
+ va as B,
328
+ b as a,
329
+ Ye as b,
322
330
  E as c,
323
- B as d,
331
+ P as d,
324
332
  m as e
325
333
  };
326
- //# sourceMappingURL=input-field.DkUFvIWt.js.map
334
+ //# sourceMappingURL=input-field.zwUuajnC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-field.zwUuajnC.js","sources":["../../../vue2/src/components/input-field/input-field.types.ts","../../../vue2/src/components/input-field/input-field.vue"],"sourcesContent":["import { type BentoDropdownProps } from '../dropdown/dropdown.types';\nimport { type FormField } from '../../types/form-field';\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoInputFieldVariant {\n DEFAULT = 'default',\n PAYMENT_METHOD = 'payment-method',\n STATIC_VALUE = 'static-value',\n DROPDOWN = 'dropdown',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoInputFieldElementPosition {\n START = 'start',\n END = 'end',\n}\n\nexport enum BentoInputFieldStateClass {\n CONDENSED = 'condensed',\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoInputFieldType {\n SEARCH = 'search',\n TEXT = 'text',\n NUMBER = 'number',\n}\n\nexport type BentoInputFieldValue = string | number;\n\ntype DropdownProps = BentoDropdownProps;\nexport interface BentoInputDropdownProps {\n /**\n * Text that labels the dropdown element\n */\n 'aria-label'?: string;\n /**\n * Enables dynamic filtering\n */\n dynamicFiltering?: DropdownProps['dynamicFiltering'];\n /**\n * List of available items\n */\n items: DropdownProps['items'];\n /**\n * Sets the dropdown in read-only mode\n */\n readonly?: DropdownProps['readonly'];\n /**\n * Selected value of the dropdown\n * @deprecated Since v2.0.0. Use `model-value` instead.\n */\n value?: DropdownProps['value'];\n /**\n * Selected value of the dropdown\n */\n modelValue?: DropdownProps['modelValue'];\n}\n\n/**\n * @deprecated Since v2.0.0. Use `@<emit name>` instead.\n */\nexport enum BentoInputFieldEvent {\n INPUT = 'input',\n ESCAPE_PRESSED = 'escape-pressed',\n UPDATE_DROPDOWN = 'update:dropdown',\n DROPDOWN_INPUT = 'dropdown-input',\n FOCUS = 'focus',\n CHANGE = 'change',\n BLUR = 'blur',\n KEYDOWN = 'keydown',\n}\n\nexport interface BentoInputFieldProps extends FormField {\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n ariaHidden?: boolean;\n\n /**\n * Text that labels an the input element\n *\n * @deprecated Since v2.0.0. Use `aria-label` instead.\n */\n ariaLabel?: string;\n\n /**\n * Reduces height of the input\n */\n condensed?: boolean;\n\n /**\n * Dropdown props for the small selectable dropdown menu.\n * Properties supported:\n *\n * - `aria-label`: Text that labels the dropdown element\n * - `dynamicFiltering`: Enables dynamic filtering\n * - `items`: List of available items\n * - `readonly`: Sets the dropdown in read-only mode\n * - `value`: Selected value of the dropdown\n */\n dropdown?: BentoInputDropdownProps;\n\n /**\n * Position of the dropdown before or after input value\n */\n dropdownPosition?: BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`;\n\n /**\n * Adds error validation class for outlining input-field.\n *\n * @deprecated Since v2.0.0. Use `errorMessage` instead.\n */\n error?: boolean;\n\n /**\n * Text displayed as the value of the input-field\n */\n modelValue?: BentoInputFieldValue;\n\n /**\n * Renders a font numeric style with slashed zeros instead of normal ones.\n */\n slashedZero?: boolean;\n\n /**\n * Static text that displayed before or after input value\n * Applicable to the Static Value variant\n */\n staticValue?: string;\n\n /**\n * Position of Static Value before or after input value\n */\n staticValuePosition?: BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`;\n\n /**\n * A string specifying the type of control to render.\n * All `input` types are available but only `search`, `text` and `number` are fully supported.\n *\n * If `type` is `search`, use `bento-search-bar` instead.\n */\n type?: BentoInputFieldType | `${BentoInputFieldType}` | HTMLInputElement['type'];\n\n /**\n * Text displayed as the value of the input-field\n * @deprecated Since v2.0.0. Use `v-model` or `model-value` instead.\n */\n value?: BentoInputFieldValue;\n\n /**\n * Describes the different variants for the input element\n */\n variant?: BentoInputFieldVariant | `${BentoInputFieldVariant}`;\n}\n","<template>\n <bento-typography\n class=\"b-input-field\"\n v-bind=\"getRootAttributes($attrs)\"\n :data-testid=\"getDataTestId($attrs)\"\n :class=\"inputFieldConditionalClasses\"\n el=\"div\"\n variant=\"body\"\n >\n <field-label\n v-if=\"hasSlot('default') || label\"\n :for=\"inputFieldId\"\n data-testid=\"input-field-label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n :label=\"label\"\n @click=\"focusInput\"\n >\n <slot></slot>\n </field-label>\n\n <div class=\"b-input-field__input-box\" data-testid=\"input-box\" :aria-disabled=\"disabled\" @click=\"focusInput\">\n <!-- Optional Icon for Default text variant -->\n <span\n v-if=\"isDefaultVariant && (hasSlot('defaultIconBefore') || hasSlot('iconBefore'))\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-before\"\n >\n <slot v-if=\"hasSlot('iconBefore')\" name=\"iconBefore\" />\n <slot v-if=\"hasSlot('defaultIconBefore') && !hasSlot('iconBefore')\" name=\"defaultIconBefore\" />\n </span>\n\n <!-- Mandatory Icon for Payment Method variant -->\n <span\n v-if=\"isPaymentMethodVariant && hasSlot('paymentMethod')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__payment-method\"\n >\n <slot name=\"paymentMethod\" />\n </span>\n\n <!-- Dropdown at start -->\n <div\n v-if=\"shouldDisplayDropdownAtStart\"\n :id=\"dropdownId\"\n class=\"b-input-field__dropdown b-input-field__dropdown--start\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n ref=\"inputDropdownElement\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isDropdownReadOnly\"\n @update:model-value=\"onDropdownInput\"\n />\n </div>\n\n <!-- Static Value at start -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtStart\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--start\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n <div class=\"b-input-field__input-container\">\n <input\n :id=\"inputFieldId\"\n v-bind=\"$attrs\"\n ref=\"inputFieldElement\"\n class=\"b-input-field__input\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedAriaDescribedBy\"\n :aria-owns=\"computedAriaOwns\"\n :aria-invalid=\"shouldShowError\"\n :placeholder=\"placeholder\"\n :required=\"required\"\n :aria-required=\"required\"\n :type=\"type\"\n :value=\"modelValue ?? value\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onInput\"\n @change=\"emit('change')\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n @keydown=\"emit('keydown', $event)\"\n @keyup=\"emit('keyup', $event)\"\n @keydown.esc=\"emit('escape-pressed')\"\n @click=\"emit('click', $event)\"\n />\n\n <!-- Hint at the end -->\n <bento-typography\n v-if=\"hint && isFocused && (modelValue || value)\"\n el=\"span\"\n class=\"b-input-field__hint\"\n >\n {{ hint }}\n </bento-typography>\n </div>\n\n <span\n v-if=\"hasSlot('iconAfter')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-after\"\n data-testid=\"input-text__icon-after\"\n >\n <slot name=\"iconAfter\" />\n </span>\n\n <!-- Static Value at the end -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtEnd\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--end\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <!-- Dropdown at end -->\n <div\n v-if=\"shouldDisplayDropdownAtEnd\"\n :id=\"dropdownId\"\n data-testid=\"input-field-dropdown-container-end\"\n class=\"b-input-field__dropdown b-input-field__dropdown--end\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n :id=\"dropdownId\"\n ref=\"inputDropdownElement\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isDropdownReadOnly\"\n @update:model-value=\"onDropdownInput\"\n />\n </div>\n </div>\n\n <error-message\n v-if=\"shouldShowError && !!errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-input-field__error-message\"\n />\n\n <span\n v-if=\"hasSlot('description') || description\"\n :id=\"descriptionId\"\n class=\"b-input-field__description\"\n @click=\"focusInput\"\n >\n <bento-typography el=\"span\" variant=\"body\">\n <slot id=\"description\" name=\"description\">\n {{ description }}\n </slot>\n </bento-typography>\n </span>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, provide, type Ref, ref, toRef, toRefs, useAttrs, useSlots } from 'vue';\n\n // Components\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n\n // Utils\n import { deprecate } from '@/utils/ts/deprecate';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n import { generateUid } from '@/core/utils/ts';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import {\n INPUT_FIELD_COMPONENT_INJECTION_KEY,\n INPUT_FIELD_HINT_INJECTION_KEY,\n INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY,\n } from '@/components/input-field/input-field.keys';\n import { type BentoListboxSelectedValue } from '@/types/listbox';\n\n // Composables\n import { useFormLayoutFieldLoading, useHasSlot } from '@/composables';\n\n // Types\n import {\n type BentoInputDropdownProps,\n BentoInputFieldElementPosition,\n type BentoInputFieldProps,\n BentoInputFieldStateClass,\n BentoInputFieldType,\n type BentoInputFieldValue,\n BentoInputFieldVariant,\n } from './input-field.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n const slots = useSlots();\n\n const props = withDefaults(defineProps<BentoInputFieldProps>(), {\n ariaHidden: true,\n ariaLabel: undefined,\n condensed: false,\n description: '',\n disabled: false,\n dropdown: undefined,\n dropdownPosition: BentoInputFieldElementPosition.START,\n error: false,\n errorMessage: null,\n label: '',\n modelValue: undefined,\n optional: false,\n placeholder: '',\n required: false,\n readonly: false,\n slashedZero: false,\n staticValue: '',\n staticValuePosition: BentoInputFieldElementPosition.START,\n tooltipText: null,\n type: BentoInputFieldType.TEXT,\n value: undefined,\n variant: BentoInputFieldVariant.DEFAULT,\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the element has lost focus\n */\n (e: 'blur'): void;\n\n /**\n * Emitted when the input is clicked\n */\n (e: 'click', event: MouseEvent);\n\n /**\n * Emitted when the user modifies the element's value. Unlike the 'input' event, the change event is not necessarily fired for each alteration to an element's value\n */\n (e: 'change'): void;\n\n /**\n * Emitted when the Input Field's internal dropdown changes it's value\n */\n (e: 'dropdown-input', selectedValue: BentoListboxSelectedValue): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: 'escape-pressed'): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: 'focus'): void;\n\n /**\n * Emitted when a key is pressed down\n */\n (e: 'keydown', event: KeyboardEvent): void;\n\n /**\n * Emitted when a key is pressed and lifted up\n */\n (e: 'keyup', event: KeyboardEvent): void;\n\n /**\n * Emitted when the component's model changes\n * @deprecated Since v2.0.0. Use `v-model` or `update:model-value` instead.\n */\n (e: 'input', inputValue: string): void;\n\n /**\n * Emitted when the Input Field's internal dropdown changes it's value. Contains every dropdown prop passed with the updated selected value as 'value'\n */\n (e: 'update:dropdown', updatedDropdownProps: BentoInputDropdownProps): void;\n\n /**\n * Emitted when the component's model changes\n */\n (e: 'update:model-value', inputValue: BentoInputFieldValue): void;\n }>();\n\n const { emitValue } = useFormFieldEmits<BentoInputFieldValue>(emit);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const inputFieldElement = ref(null);\n const inputDropdownElement = ref(null);\n const inputFieldId = generateUid('input');\n const dropdownId = generateUid('input-dropdown');\n const staticValueId = generateUid('input-static-value');\n const descriptionId = generateUid('input-description');\n const errorId = generateUid('input-error');\n const isFocused = ref(false);\n\n /**\n * Gets the overriden or the default data-testid attribute\n * @param attributes - the live attributes object\n */\n function getDataTestId(attributes: Record<string, unknown>) {\n return (attributes['data-testid'] as string) ?? 'input-text-container';\n }\n /**\n * Filters out all aria attributes for the root element.\n * @param attributes - the live attributes object\n */\n function getRootAttributes(attributes: Record<string, unknown>) {\n return Object.fromEntries(\n Object.entries(attributes).filter(([key]) => !key.startsWith('aria-') && key !== 'data-testid')\n );\n }\n\n // Provide INPUT_FIELD_COMPONENT_INJECTION_KEY as true, to set the input only dropdown size variant in the BentoDropdown comp\n provide(INPUT_FIELD_COMPONENT_INJECTION_KEY, true);\n // Renders the input with a hint if a string is provided\n const hint = inject<Ref<string | undefined>>(INPUT_FIELD_HINT_INJECTION_KEY, ref(undefined));\n\n const onFocus = () => {\n isFocused.value = true;\n emit('focus');\n };\n\n const onBlur = () => {\n isFocused.value = false;\n emit('blur');\n };\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n const isDropdownReadOnly = computed<BentoInputDropdownProps['readonly']>(\n () => isReadOnly.value || props.dropdown?.readonly\n );\n\n const shouldShowStaticValue = computed(\n () => props.variant === BentoInputFieldVariant.STATIC_VALUE && !!slots.staticValue\n );\n\n const isDefaultVariant = computed(() => props.variant === BentoInputFieldVariant.DEFAULT);\n\n const isPaymentMethodVariant = computed(() => props.variant === BentoInputFieldVariant.PAYMENT_METHOD);\n\n const shouldDisplayStaticValueAtStart = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayStaticValueAtEnd = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowDropdown = computed(() => props.variant === BentoInputFieldVariant.DROPDOWN && !!props.dropdown);\n const shouldDisplayDropdownAtStart = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayDropdownAtEnd = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.error)\n );\n\n const computedLabel = computed(() => (getSlotText(slots)('default') as string) || props.label);\n const computedDescription = computed(() => (getSlotText(slots)('description') as string) || props.description);\n\n const computedAriaOwns = computed(() => {\n if (shouldShowDropdown.value === true && shouldShowStaticValue.value === true) {\n return `${staticValueId} ${dropdownId}`;\n }\n if (shouldShowDropdown.value === true) {\n return `${dropdownId}`;\n }\n if (shouldShowStaticValue.value === true) {\n return `${staticValueId}`;\n }\n return null;\n });\n\n // vue-i18n issue with t() used in script - direct usage in template works\n // requires either createI18n({ legacy: false }) or to be wrapped in computed()\n const computedAriaLabelFallbackMessage = computed(() =>\n attrs?.['aria-labelledby'] ? undefined : t('ariaLabelFallback')\n );\n const computedAriaLabelDropdowFallback = computed(() =>\n t('ariaLabelDropdownFallback', { inputLabel: computedAriaLabel.value })\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: computedLabel.value || computedAriaLabelFallbackMessage,\n });\n\n const computedAriaDescribedBy = computed(\n () =>\n `${computedDescription.value ? descriptionId : ''} ${\n shouldShowError.value && !!props.errorMessage ? errorId : ''\n }`\n );\n\n const inputFieldConditionalClasses = computed(() => ({\n [`b-input-field--${BentoInputFieldStateClass.CONDENSED}`]: props.condensed,\n [`b-input-field--${BentoInputFieldStateClass.DISABLED}`]: props.disabled,\n [`b-input-field--${BentoInputFieldStateClass.READONLY}`]: isReadOnly.value,\n [`b-input-field--${BentoInputFieldStateClass.ERROR}`]: shouldShowError.value,\n [`b-input-field--slashed-zero`]: props.slashedZero,\n }));\n\n const inputFieldDropdownProps = computed(() => ({\n 'aria-label': computedAriaLabelDropdowFallback.value,\n ...props.dropdown,\n }));\n\n const onInput = (event: Event) => {\n const inputValue = (event.target as HTMLInputElement).value;\n if (!props.disabled && !isReadOnly.value) {\n emitValue(inputValue);\n }\n };\n\n const onDropdownInput = (selectedValue: BentoListboxSelectedValue) => {\n emit('dropdown-input', selectedValue);\n emit('update:dropdown', { ...props?.dropdown, value: selectedValue });\n };\n\n const focusInput = () => {\n inputFieldElement.value.focus();\n };\n\n const focus = () => {\n if (props.variant === 'dropdown') {\n inputDropdownElement.value.focus();\n } else {\n focusInput();\n }\n };\n\n // Expose method so that other components can focus on it in Vue3\n defineExpose({\n focusInput,\n focus,\n });\n\n const inputFieldParentComponent = inject(INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY, '');\n\n if (!Object.values(BentoInputFieldType).includes(props.type as BentoInputFieldType) && !inputFieldParentComponent) {\n if (props.type === 'tel') {\n printDevelopmentWarning(\n `\"bento-input-field\" dropdown does not support the type '${props.type}', use \"bento-input-field-phone-number\" instead.`\n );\n } else if (props.type === 'password') {\n printDevelopmentWarning(\n `\"bento-input-field\" dropdown does not support the type '${props.type}', use \"bento-input-field-password\" instead.`\n );\n } else {\n printDevelopmentWarning(`\"bento-input-field\" dropdown does not support the type '${props.type}'`);\n }\n }\n\n /**\n * Deprecations\n */\n if (props.error) {\n deprecate(\n 'BentoInputField \"error\" property',\n `Use the BentoInputField \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-dropdown errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n if (hasSlot('defaultIconBefore')) {\n deprecate(\n 'BentoInputField \"defaultIconBefore\" slot',\n `Use the BentoInputField \"iconBefore\" slot instead to add an icon at the left side of the input field\n <bento-input-field>\n \\t<template #iconBefore>\n \\t\\t<my-icon-goes-here />\n \\t</template>\n </bento-input-field>`,\n '2.0.0'\n );\n }\n\n if (props.value) {\n deprecate(\n 'BentoInputField \"value\" property',\n `The use of \"value\" prop in \"BentoInputField\" is no longer supported.\n Use the \"v-model\" or \"model-value\" property instead.`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Input field component is used to create interactive controls for web-based\n * forms in order to accept data from the user.\n *\n * @example\n * import { BentoInputField } from '@adyen/bento-vue2'\n *\n * const inputValue = ref('');\n *\n * export default {\n * components: { BentoInputField },\n * tempate: `\n * <bento-input-field\n * :model-value=\"inputValue\"\n * :@update:model-value=\"newValue => inputValue.value = newValue\"\n * >\n * }\n */\n export default {\n name: 'bento-input-field',\n inheritAttrs: false,\n model: { prop: 'modelValue' },\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field.scss\" />\n"],"names":["BentoInputFieldVariant","BentoInputFieldVariant2","BentoInputFieldElementPosition","BentoInputFieldElementPosition2","BentoInputFieldStateClass","BentoInputFieldStateClass2","BentoInputFieldType","BentoInputFieldType2","BentoInputFieldEvent","BentoInputFieldEvent2","__default__","messages","attrs","useAttrs","slots","useSlots","props","__props","emit","__emit","emitValue","useFormFieldEmits","t","useI18n","hasSlot","useHasSlot","inputFieldElement","ref","inputDropdownElement","inputFieldId","generateUid","dropdownId","staticValueId","descriptionId","errorId","isFocused","getDataTestId","attributes","getRootAttributes","key","provide","INPUT_FIELD_COMPONENT_INJECTION_KEY","hint","inject","INPUT_FIELD_HINT_INJECTION_KEY","onFocus","onBlur","isReadOnly","useFormLayoutFieldLoading","toRef","isDropdownReadOnly","computed","shouldShowStaticValue","isDefaultVariant","isPaymentMethodVariant","shouldDisplayStaticValueAtStart","shouldDisplayStaticValueAtEnd","shouldShowDropdown","shouldDisplayDropdownAtStart","shouldDisplayDropdownAtEnd","shouldShowError","computedLabel","getSlotText","computedDescription","computedAriaOwns","computedAriaLabelFallbackMessage","computedAriaLabelDropdowFallback","computedAriaLabel","ariaLabelAttribute","ariaLabel","toRefs","useAriaLabel","computedAriaDescribedBy","inputFieldConditionalClasses","inputFieldDropdownProps","onInput","event","inputValue","onDropdownInput","selectedValue","focusInput","__expose","inputFieldParentComponent","INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY","printDevelopmentWarning","deprecate"],"mappings":";;;;;;;;;;;;;;AAMO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,UAAA,WACAA,EAAA,iBAAA,kBACAA,EAAA,eAAA,gBACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAULE,IAAA,kBAAAC,OACHA,EAAA,QAAA,SACAA,EAAA,MAAA,OAFQA,IAAAD,KAAA,CAAA,CAAA,GAKLE,IAAA,kBAAAC,OACHA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAJQA,IAAAD,KAAA,CAAA,CAAA,GAULE,IAAA,kBAAAC,OACHA,EAAA,SAAA,UACAA,EAAA,OAAA,QACAA,EAAA,SAAA,UAHQA,IAAAD,KAAA,CAAA,CAAA,GAwCLE,KAAA,kBAAAC,OACHA,EAAA,QAAA,SACAA,EAAA,iBAAA,kBACAA,EAAA,kBAAA,mBACAA,EAAA,iBAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,SAAA,UACAA,EAAA,OAAA,QACAA,EAAA,UAAA,WARQA,IAAAD,MAAA,CAAA,CAAA;;;;;;;;;;;;uVCucRE,KAAA;AAAA,EAAe,MAAA;AAAA,EACL,cAAA;AAAA,EACQ,OAAA,EAAA,MAAA,aAAA;AAAA,EACc,MAAA,EAAA,UAAAC,EAAA;AAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAlUA,UAAAC,IAAAC,GAAA,GACAC,IAAAC,GAAA,GAEA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DAAApE,EAAA,IAAA;AAAA,IACyE,IACzEA,EAAA,SAAA,aAEAoE;AAAA,MAAA,2DAAApE,EAAA,IAAA;AAAA,IACyE,IAGzEoE,EAAA,2DAAApE,EAAA,IAAA,GAAA,IAORA,EAAA,SACIqE;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA,MACA;AAAA,IAGA,GAIR7D,EAAA,mBAAA,KACI6D;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MACA;AAAA,IAMA,GAIRrE,EAAA,SACIqE;AAAA,MAAA;AAAA,MACI;AAAA;AAAA,MACA;AAAA,IAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as _, provide as b, useSlots as B, ref as E, computed as d, watch as V, openBlock as N, createBlock as $, unref as l, mergeProps as k, createSlots as w, withCtx as f, renderSlot as v, createTextVNode as x, toDisplayString as A } from "vue";
2
- import { B as C } from "./input-field.DkUFvIWt.js";
3
- import { c as O } from "./dropdown.DHoL50gV.js";
4
- import { d as R } from "./use-cached-selected-values.Bx8uuky9.js";
2
+ import { B as C } from "./input-field.zwUuajnC.js";
3
+ import { c as O } from "./dropdown.C323NUqq.js";
4
+ import { d as R } from "./use-cached-selected-values.DUWGSMvO.js";
5
5
  import { u as P } from "./index.B875RXHM.js";
6
6
  import { u as U } from "./use-has-slot.CyMiImRQ.js";
7
7
  import { u as K } from "./use-touch-device.DTqFAbXh.js";
@@ -119,4 +119,4 @@ export {
119
119
  ne as B,
120
120
  T as i
121
121
  };
122
- //# sourceMappingURL=input-time.WI_qdwJc.js.map
122
+ //# sourceMappingURL=input-time.RUecHW9h.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-time.WI_qdwJc.js","sources":["../../../vue2/src/utils/ts/time-input.ts","../../../vue2/src/components/input-time/input-time.vue"],"sourcesContent":["const validDigitRegex = /[\\d]/;\n\nconst hourRegex = /^\\d{2}$/;\nconst minuteRegex = /^\\d{2}:\\d{2}$/;\n\n/**\n * Validates a complete time string in HH:MM:SS format.\n * Hours: 00-24, Minutes: 00-59, Seconds: 00-59\n * @param timeText The time string to validate\n * @returns True if the time string is valid, false otherwise\n */\nexport const isValidTimeString = (timeText: string): boolean =>\n /^(?:[01]\\d|2[0-4]):(?:[0-5]\\d):(?:[0-5]\\d)$/.test(timeText);\n\nexport const validateTimeInput = (event: KeyboardEvent) => {\n const { selectionStart } = event.target as HTMLInputElement;\n\n const allowedKeys = ['Backspace', 'Tab', 'ArrowLeft', 'ArrowRight'];\n const isValidKey = validDigitRegex.test(event.key) || allowedKeys.includes(event.key);\n const isValidColon = [1, 2, 4, 5].includes(selectionStart) && event.key === ':';\n\n if (!isValidKey && !isValidColon) {\n event.preventDefault();\n }\n};\n\nexport const formatTimeInputValue = (value: string) => {\n if (!value) {\n return value;\n }\n\n let formattedValue = value;\n\n // Format if the first value is bigger than 2, because it can't be bigger than 24 hours\n if (formattedValue.length === 1 && parseInt(value, 10) > 2) {\n return `0${formattedValue}:`;\n }\n\n const [secondToLastDigit, lastDigit] = formattedValue.slice(-2);\n if ([2, 5].includes(formattedValue.length) && lastDigit === ':') {\n formattedValue = `${formattedValue.slice(0, formattedValue.length - 2)}0${secondToLastDigit}`;\n }\n\n // Add `:` after hour/minute\n if (hourRegex.test(formattedValue) || minuteRegex.test(formattedValue)) {\n formattedValue += ':';\n }\n return formattedValue;\n};\n","<template>\n <bento-input-field\n class=\"b-input-time\"\n :type=\"inputType\"\n :step=\"isTouchDevice ? 1 : undefined\"\n :condensed=\"props.condensed\"\n :disabled=\"props.disabled\"\n :error-message=\"inputErrorMessage\"\n :label=\"props.label\"\n :model-value=\"inputModelValue\"\n :optional=\"props.optional\"\n :placeholder=\"computedPlaceholder\"\n :readonly=\"props.readonly\"\n :required=\"props.required\"\n :tooltip-text=\"props.tooltipText\"\n v-bind=\"$attrs\"\n @update:model-value=\"onInput\"\n @keydown=\"onKeyDown\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot name=\"default\"></slot>\n </template>\n <template v-if=\"!isTouchDevice\" #description>\n <slot name=\"description\">{{\n props.description ? `${props.description} ${t('timeFormatDescription')}` : t('timeFormatDescription')\n }}</slot>\n </template>\n </bento-input-field>\n</template>\n\n<script setup lang=\"ts\">\n // Components\n import { BentoInputField } from '@/components/input-field';\n import { INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY } from '@/components/input-field/input-field.keys';\n\n // Utils\n import { debounce } from '@/utils/ts/debounce';\n import { useI18n } from '@/utils/ts/i18n';\n import { formatTimeInputValue, isValidTimeString, validateTimeInput } from '@/utils/ts/time-input';\n\n // Types\n import type { BentoInputFieldValue } from '@/components/input-field/input-field.types';\n import { type BentoInputTimeProps } from './input-time.types';\n\n // Localization\n import messages from './messages.json';\n\n import { computed, provide, ref, useSlots, watch } from 'vue';\n import { useHasSlot, useTouchDevice } from '@/composables';\n\n const VALIDATION_DEBOUNCE_TIME = 300;\n\n provide(INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY, 'bento-input-time');\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const { isTouchDevice } = useTouchDevice();\n\n type MessageSchema = (typeof messages)['en-US'];\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = withDefaults(defineProps<BentoInputTimeProps>(), {\n condensed: false,\n description: undefined,\n disabled: false,\n errorMessage: null,\n label: '',\n modelValue: undefined,\n optional: false,\n placeholder: '',\n readonly: false,\n required: false,\n tooltipText: null,\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the component's model changes\n */\n (e: 'update:model-value', value: BentoInputFieldValue): void;\n\n /**\n * Emitted when a key is pressed down\n */\n (e: 'keydown', event: KeyboardEvent): void;\n\n /**\n * Emitted when the time value passes validation (complete HH:MM:SS format)\n */\n (e: 'input:valid'): void;\n\n /**\n * Emitted when the time value fails validation\n */\n (e: 'input:error'): void;\n }>();\n\n const internalError = ref(false);\n const computedErrorMessage = computed(() => {\n if (props.errorMessage) {\n return props.errorMessage;\n }\n return internalError.value ? t('invalidTimeFormat') : null;\n });\n const inputErrorMessage = computed(() => (isTouchDevice.value ? props.errorMessage : computedErrorMessage.value));\n const inputType = computed(() => (isTouchDevice.value ? 'time' : undefined));\n const inputModelValue = computed(() => props.modelValue);\n const computedPlaceholder = computed(() => (isTouchDevice ? undefined : props.placeholder));\n\n const validateTime = (timeText: string) => {\n if (!timeText) {\n internalError.value = false;\n return;\n }\n\n const isValid = isValidTimeString(timeText);\n internalError.value = !isValid;\n\n if (isValid) {\n emit('input:valid');\n } else {\n emit('input:error');\n }\n };\n const validateTimeWithDebounce = debounce(validateTime, VALIDATION_DEBOUNCE_TIME);\n\n // Watch for external modelValue changes (e.g., when parent resets the value)\n watch(\n () => props.modelValue,\n newValue => {\n const timeText = String(newValue ?? '');\n // Clear the error only when the new value is a complete, valid time string\n if (timeText.length === 8 && isValidTimeString(timeText)) {\n internalError.value = false;\n }\n }\n );\n\n const onInput = (value: BentoInputFieldValue) => {\n if (props.disabled || props.readonly) {\n return;\n }\n\n if (isTouchDevice.value) {\n emit('update:model-value', String(value ?? ''));\n emit('input:valid');\n } else {\n const formatted = formatTimeInputValue(String(value ?? ''));\n emit('update:model-value', formatted);\n validateTimeWithDebounce(formatted);\n }\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (!isTouchDevice.value) {\n validateTimeInput(event);\n }\n emit('keydown', event);\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Input time component for entering time values in HH:MM:SS format.\n * This is an extension of the `bento-input-field` component with built-in\n * time formatting and validation logic.\n *\n * @usage\n * import { BentoInputTime } from '@adyen/bento-vue2';\n *\n * const timeValue = ref('');\n *\n * export default {\n * components: { BentoInputTime },\n * template: `\n * <bento-input-time\n * label=\"Start time\"\n * :model-value=\"timeValue\"\n * @update:model-value=\"newValue => timeValue.value = newValue\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-input-time',\n inheritAttrs: false,\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-time.scss\" />\n"],"names":["validDigitRegex","hourRegex","minuteRegex","isValidTimeString","timeText","validateTimeInput","event","selectionStart","allowedKeys","isValidKey","isValidColon","formatTimeInputValue","value","formattedValue","secondToLastDigit","lastDigit","__default__","messages","provide","INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY","slots","useSlots","hasSlot","useHasSlot","isTouchDevice","useTouchDevice","t","useI18n","props","__props","emit","__emit","internalError","ref","computedErrorMessage","computed","inputErrorMessage","inputType","inputModelValue","computedPlaceholder","validateTimeWithDebounce","debounce","isValid","watch","newValue","onInput","formatted","onKeyDown"],"mappings":";;;;;;;;;AAAA,MAAAA,IAAA,QAEAC,IAAA,WACAC,IAAA,iBAQOC,IAAA,CAAAC,MAAA,8CAAA,KAAAA,CAAA,GAGAC,IAAA,CAAAC,MAAA;AACH,QAAA,EAAA,gBAAAC,EAAA,IAAAD,EAAA,QAEAE,IAAA,CAAA,aAAA,OAAA,aAAA,YAAA,GACAC,IAAAT,EAAA,KAAAM,EAAA,GAAA,KAAAE,EAAA,SAAAF,EAAA,GAAA,GACAI,IAAA,CAAA,GAAA,GAAA,GAAA,CAAA,EAAA,SAAAH,CAAA,KAAAD,EAAA,QAAA;AAEA,EAAA,CAAAG,KAAA,CAAAC,KACIJ,EAAA,eAAA;AAER,GAEOK,IAAA,CAAAC,MAAA;AACH,MAAA,CAAAA;AACI,WAAAA;AAGJ,MAAAC,IAAAD;AAGA,MAAAC,EAAA,WAAA,KAAA,SAAAD,GAAA,EAAA,IAAA;AACI,WAAA,IAAAC,CAAA;AAGJ,QAAA,CAAAC,GAAAC,CAAA,IAAAF,EAAA,M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ER,cAAAxC,IAAA,OAAAwC,KAAA,EAAA;AAEA,QAAAxC,EAAA,WAAA,KAAAD,EAAAC,CAAA,MACI4B,EAAA,QAAA;AAAA,MACJ;AAAA,IACJ;AAGJ,UAAAa,IAAA,CAAAjC,MAAA;AACI,UAAA,EAAAgB,EAAA,YAAAA,EAAA;AAIA,YAAAJ,EAAA;AACI,UAAAM,EAAA,sBAAA,OAAAlB,KAAA,EAAA,CAAA,GACAkB,EAAA,aAAA;AAAA,aAAkB;AAElB,gBAAAgB,IAAAnC,EAAA,OAAAC,KAAA,EAAA,CAAA;AACA,UAAAkB,EAAA,sBAAAgB,CAAA,GACAN,EAAAM,CAAA;AAAA,QAAkC;AAAA,IACtC,GAGJC,IAAA,CAAAzC,MAAA;AACI,MAAAkB,EAAA,SACInB,EAAAC,CAAA,GAEJwB,EAAA,WAAAxB,CAAA;AAAA,IAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"input-time.RUecHW9h.js","sources":["../../../vue2/src/utils/ts/time-input.ts","../../../vue2/src/components/input-time/input-time.vue"],"sourcesContent":["const validDigitRegex = /[\\d]/;\n\nconst hourRegex = /^\\d{2}$/;\nconst minuteRegex = /^\\d{2}:\\d{2}$/;\n\n/**\n * Validates a complete time string in HH:MM:SS format.\n * Hours: 00-24, Minutes: 00-59, Seconds: 00-59\n * @param timeText The time string to validate\n * @returns True if the time string is valid, false otherwise\n */\nexport const isValidTimeString = (timeText: string): boolean =>\n /^(?:[01]\\d|2[0-4]):(?:[0-5]\\d):(?:[0-5]\\d)$/.test(timeText);\n\nexport const validateTimeInput = (event: KeyboardEvent) => {\n const { selectionStart } = event.target as HTMLInputElement;\n\n const allowedKeys = ['Backspace', 'Tab', 'ArrowLeft', 'ArrowRight'];\n const isValidKey = validDigitRegex.test(event.key) || allowedKeys.includes(event.key);\n const isValidColon = [1, 2, 4, 5].includes(selectionStart) && event.key === ':';\n\n if (!isValidKey && !isValidColon) {\n event.preventDefault();\n }\n};\n\nexport const formatTimeInputValue = (value: string) => {\n if (!value) {\n return value;\n }\n\n let formattedValue = value;\n\n // Format if the first value is bigger than 2, because it can't be bigger than 24 hours\n if (formattedValue.length === 1 && parseInt(value, 10) > 2) {\n return `0${formattedValue}:`;\n }\n\n const [secondToLastDigit, lastDigit] = formattedValue.slice(-2);\n if ([2, 5].includes(formattedValue.length) && lastDigit === ':') {\n formattedValue = `${formattedValue.slice(0, formattedValue.length - 2)}0${secondToLastDigit}`;\n }\n\n // Add `:` after hour/minute\n if (hourRegex.test(formattedValue) || minuteRegex.test(formattedValue)) {\n formattedValue += ':';\n }\n return formattedValue;\n};\n","<template>\n <bento-input-field\n class=\"b-input-time\"\n :type=\"inputType\"\n :step=\"isTouchDevice ? 1 : undefined\"\n :condensed=\"props.condensed\"\n :disabled=\"props.disabled\"\n :error-message=\"inputErrorMessage\"\n :label=\"props.label\"\n :model-value=\"inputModelValue\"\n :optional=\"props.optional\"\n :placeholder=\"computedPlaceholder\"\n :readonly=\"props.readonly\"\n :required=\"props.required\"\n :tooltip-text=\"props.tooltipText\"\n v-bind=\"$attrs\"\n @update:model-value=\"onInput\"\n @keydown=\"onKeyDown\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot name=\"default\"></slot>\n </template>\n <template v-if=\"!isTouchDevice\" #description>\n <slot name=\"description\">{{\n props.description ? `${props.description} ${t('timeFormatDescription')}` : t('timeFormatDescription')\n }}</slot>\n </template>\n </bento-input-field>\n</template>\n\n<script setup lang=\"ts\">\n // Components\n import { BentoInputField } from '@/components/input-field';\n import { INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY } from '@/components/input-field/input-field.keys';\n\n // Utils\n import { debounce } from '@/utils/ts/debounce';\n import { useI18n } from '@/utils/ts/i18n';\n import { formatTimeInputValue, isValidTimeString, validateTimeInput } from '@/utils/ts/time-input';\n\n // Types\n import type { BentoInputFieldValue } from '@/components/input-field/input-field.types';\n import { type BentoInputTimeProps } from './input-time.types';\n\n // Localization\n import messages from './messages.json';\n\n import { computed, provide, ref, useSlots, watch } from 'vue';\n import { useHasSlot, useTouchDevice } from '@/composables';\n\n const VALIDATION_DEBOUNCE_TIME = 300;\n\n provide(INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY, 'bento-input-time');\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const { isTouchDevice } = useTouchDevice();\n\n type MessageSchema = (typeof messages)['en-US'];\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = withDefaults(defineProps<BentoInputTimeProps>(), {\n condensed: false,\n description: undefined,\n disabled: false,\n errorMessage: null,\n label: '',\n modelValue: undefined,\n optional: false,\n placeholder: '',\n readonly: false,\n required: false,\n tooltipText: null,\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the component's model changes\n */\n (e: 'update:model-value', value: BentoInputFieldValue): void;\n\n /**\n * Emitted when a key is pressed down\n */\n (e: 'keydown', event: KeyboardEvent): void;\n\n /**\n * Emitted when the time value passes validation (complete HH:MM:SS format)\n */\n (e: 'input:valid'): void;\n\n /**\n * Emitted when the time value fails validation\n */\n (e: 'input:error'): void;\n }>();\n\n const internalError = ref(false);\n const computedErrorMessage = computed(() => {\n if (props.errorMessage) {\n return props.errorMessage;\n }\n return internalError.value ? t('invalidTimeFormat') : null;\n });\n const inputErrorMessage = computed(() => (isTouchDevice.value ? props.errorMessage : computedErrorMessage.value));\n const inputType = computed(() => (isTouchDevice.value ? 'time' : undefined));\n const inputModelValue = computed(() => props.modelValue);\n const computedPlaceholder = computed(() => (isTouchDevice ? undefined : props.placeholder));\n\n const validateTime = (timeText: string) => {\n if (!timeText) {\n internalError.value = false;\n return;\n }\n\n const isValid = isValidTimeString(timeText);\n internalError.value = !isValid;\n\n if (isValid) {\n emit('input:valid');\n } else {\n emit('input:error');\n }\n };\n const validateTimeWithDebounce = debounce(validateTime, VALIDATION_DEBOUNCE_TIME);\n\n // Watch for external modelValue changes (e.g., when parent resets the value)\n watch(\n () => props.modelValue,\n newValue => {\n const timeText = String(newValue ?? '');\n // Clear the error only when the new value is a complete, valid time string\n if (timeText.length === 8 && isValidTimeString(timeText)) {\n internalError.value = false;\n }\n }\n );\n\n const onInput = (value: BentoInputFieldValue) => {\n if (props.disabled || props.readonly) {\n return;\n }\n\n if (isTouchDevice.value) {\n emit('update:model-value', String(value ?? ''));\n emit('input:valid');\n } else {\n const formatted = formatTimeInputValue(String(value ?? ''));\n emit('update:model-value', formatted);\n validateTimeWithDebounce(formatted);\n }\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (!isTouchDevice.value) {\n validateTimeInput(event);\n }\n emit('keydown', event);\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Input time component for entering time values in HH:MM:SS format.\n * This is an extension of the `bento-input-field` component with built-in\n * time formatting and validation logic.\n *\n * @usage\n * import { BentoInputTime } from '@adyen/bento-vue2';\n *\n * const timeValue = ref('');\n *\n * export default {\n * components: { BentoInputTime },\n * template: `\n * <bento-input-time\n * label=\"Start time\"\n * :model-value=\"timeValue\"\n * @update:model-value=\"newValue => timeValue.value = newValue\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-input-time',\n inheritAttrs: false,\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-time.scss\" />\n"],"names":["validDigitRegex","hourRegex","minuteRegex","isValidTimeString","timeText","validateTimeInput","event","selectionStart","allowedKeys","isValidKey","isValidColon","formatTimeInputValue","value","formattedValue","secondToLastDigit","lastDigit","__default__","messages","provide","INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY","slots","useSlots","hasSlot","useHasSlot","isTouchDevice","useTouchDevice","t","useI18n","props","__props","emit","__emit","internalError","ref","computedErrorMessage","computed","inputErrorMessage","inputType","inputModelValue","computedPlaceholder","validateTimeWithDebounce","debounce","isValid","watch","newValue","onInput","formatted","onKeyDown"],"mappings":";;;;;;;;;AAAA,MAAAA,IAAA,QAEAC,IAAA,WACAC,IAA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+ import { s as r } from "./startOfWeek.muMEhS7U.js";
3
+ function o(a, t, e) {
4
+ const [i, m] = s(
5
+ e?.in,
6
+ a,
7
+ t
8
+ );
9
+ return +r(i, e) == +r(m, e);
10
+ }
11
+ export {
12
+ o as i
13
+ };
14
+ //# sourceMappingURL=isSameWeek.CieN9XgL.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isSameWeek.Dj6luS8h.js","sources":["../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameWeek.js"],"sourcesContent":["import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link isSameWeek} function options.\n */\n\n/**\n * @name isSameWeek\n * @category Week Helpers\n * @summary Are the given dates in the same week (and month and year)?\n *\n * @description\n * Are the given dates in the same week (and month and year)?\n *\n * @param laterDate - The first date to check\n * @param earlierDate - The second date to check\n * @param options - An object with options\n *\n * @returns The dates are in the same week (and month and year)\n *\n * @example\n * // Are 31 August 2014 and 4 September 2014 in the same week?\n * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4))\n * //=> true\n *\n * @example\n * // If week starts with Monday,\n * // are 31 August 2014 and 4 September 2014 in the same week?\n * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4), {\n * weekStartsOn: 1\n * })\n * //=> false\n *\n * @example\n * // Are 1 January 2014 and 1 January 2015 in the same week?\n * const result = isSameWeek(new Date(2014, 0, 1), new Date(2015, 0, 1))\n * //=> false\n */\nexport function isSameWeek(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n return (\n +startOfWeek(laterDate_, options) === +startOfWeek(earlierDate_, options)\n );\n}\n\n// Fallback for modularized imports:\nexport default isSameWeek;\n"],"names":["isSameWeek","laterDate","earlierDate","options","laterDate_","earlierDate_","normalizeDates","startOfWeek"],"mappings":";;AAuCO,SAASA,EAAWC,GAAWC,GAAaC,GAAS;AAC1D,QAAM,CAACC,GAAYC,CAAY,IAAIC;AAAA,IACjCH,GAAS;AAAA,IACTF;AAAA,IACAC;AAAA,EACJ;AACE,SACE,CAACK,EAAYH,GAAYD,CAAO,KAAM,CAACI,EAAYF,GAAcF,CAAO;AAE5E;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"isSameWeek.CieN9XgL.js","sources":["../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameWeek.js"],"sourcesContent":["import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link isSameWeek} function options.\n */\n\n/**\n * @name isSameWeek\n * @category Week Helpers\n * @summary Are the given dates in the same week (and month and year)?\n *\n * @description\n * Are the given dates in the same week (and month and year)?\n *\n * @param laterDate - The first date to check\n * @param earlierDate - The second date to check\n * @param options - An object with options\n *\n * @returns The dates are in the same week (and month and year)\n *\n * @example\n * // Are 31 August 2014 and 4 September 2014 in the same week?\n * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4))\n * //=> true\n *\n * @example\n * // If week starts with Monday,\n * // are 31 August 2014 and 4 September 2014 in the same week?\n * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4), {\n * weekStartsOn: 1\n * })\n * //=> false\n *\n * @example\n * // Are 1 January 2014 and 1 January 2015 in the same week?\n * const result = isSameWeek(new Date(2014, 0, 1), new Date(2015, 0, 1))\n * //=> false\n */\nexport function isSameWeek(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n return (\n +startOfWeek(laterDate_, options) === +startOfWeek(earlierDate_, options)\n );\n}\n\n// Fallback for modularized imports:\nexport default isSameWeek;\n"],"names":["isSameWeek","laterDate","earlierDate","options","laterDate_","earlierDate_","normalizeDates","startOfWeek"],"mappings":";;AAuCO,SAASA,EAAWC,GAAWC,GAAaC,GAAS;AAC1D,QAAM,CAACC,GAAYC,CAAY,IAAIC;AAAA,IACjCH,GAAS;AAAA,IACTF;AAAA,IACAC;AAAA,EACJ;AACE,SACE,CAACK,EAAYH,GAAYD,CAAO,KAAM,CAACI,EAAYF,GAAcF,CAAO;AAE5E;","x_google_ignoreList":[0]}