@adyen/bento-vue3 2.1.0 → 2.2.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 (258) hide show
  1. package/dist/@types/bento-translation-keys.generated.d.ts +10 -0
  2. package/dist/@types/index.d.ts +67 -10
  3. package/dist/action-bar.js +1 -1
  4. package/dist/ai-tag.js +1 -1
  5. package/dist/alert.js +1 -1
  6. package/dist/anchor-scroller.js +1 -1
  7. package/dist/assets/accordion-item.css +1 -1
  8. package/dist/assets/action-bar.css +1 -1
  9. package/dist/assets/alert.css +1 -1
  10. package/dist/assets/base-modal.css +1 -1
  11. package/dist/assets/button-actions.css +1 -1
  12. package/dist/assets/button.css +1 -1
  13. package/dist/assets/card.css +1 -1
  14. package/dist/assets/checkbox-input.css +1 -1
  15. package/dist/assets/dashboard-section.css +1 -1
  16. package/dist/assets/data-grid.css +1 -1
  17. package/dist/assets/date-filter.css +1 -0
  18. package/dist/assets/date-range-filter.css +1 -0
  19. package/dist/assets/dialog-page.css +1 -1
  20. package/dist/assets/draggable-handle.css +1 -1
  21. package/dist/assets/dropdown.css +1 -1
  22. package/dist/assets/file-uploader.css +1 -1
  23. package/dist/assets/filter-bar.css +1 -1
  24. package/dist/assets/fixed-scroller.css +1 -1
  25. package/dist/assets/form-layout-title.css +1 -1
  26. package/dist/assets/grid-layout.css +1 -1
  27. package/dist/assets/input-field.css +1 -1
  28. package/dist/assets/input-with-dropdown-filter.css +1 -0
  29. package/dist/assets/inspector.css +1 -1
  30. package/dist/assets/modal-fullscreen.css +1 -1
  31. package/dist/assets/navigation-menu-group.css +1 -1
  32. package/dist/assets/pagination.css +1 -1
  33. package/dist/assets/secondary-nav.css +1 -1
  34. package/dist/assets/sidepanel.css +1 -1
  35. package/dist/assets/table-of-contents.css +1 -1
  36. package/dist/assets/textarea.css +1 -1
  37. package/dist/assets/timeline-item.css +1 -1
  38. package/dist/assets/toggle.css +1 -1
  39. package/dist/button.js +1 -1
  40. package/dist/card.js +1 -1
  41. package/dist/checkbox.js +2 -2
  42. package/dist/chunks/{action-bar.C6XFuiE0.js → action-bar.BIidNGlt.js} +3 -3
  43. package/dist/chunks/{action-bar.C6XFuiE0.js.map → action-bar.BIidNGlt.js.map} +1 -1
  44. package/dist/chunks/{ai-tag.BLDTP7fs.js → ai-tag.B1YHMfAh.js} +2 -2
  45. package/dist/chunks/{ai-tag.BLDTP7fs.js.map → ai-tag.B1YHMfAh.js.map} +1 -1
  46. package/dist/chunks/{alert.BYmn1ewo.js → alert.PGzfyHZI.js} +80 -98
  47. package/dist/chunks/alert.PGzfyHZI.js.map +1 -0
  48. package/dist/chunks/{anchor-scroller.B35-JMuH.js → anchor-scroller.CSOg3htL.js} +2 -2
  49. package/dist/chunks/{anchor-scroller.B35-JMuH.js.map → anchor-scroller.CSOg3htL.js.map} +1 -1
  50. package/dist/chunks/{base-modal.CulokESn.js → base-modal.A52tojyk.js} +5 -5
  51. package/dist/chunks/{base-modal.CulokESn.js.map → base-modal.A52tojyk.js.map} +1 -1
  52. package/dist/chunks/{button-actions-with-menu.BsCmJeKU.js → button-actions-with-menu.DkPSfKO9.js} +2 -2
  53. package/dist/chunks/{button-actions-with-menu.BsCmJeKU.js.map → button-actions-with-menu.DkPSfKO9.js.map} +1 -1
  54. package/dist/chunks/{button-actions.DvuGEQxM.js → button-actions.BYoctIth.js} +2 -2
  55. package/dist/chunks/button-actions.BYoctIth.js.map +1 -0
  56. package/dist/chunks/{calendar.EuBZ9HoM.js → calendar.BhoyTBN1.js} +18 -18
  57. package/dist/chunks/{calendar.EuBZ9HoM.js.map → calendar.BhoyTBN1.js.map} +1 -1
  58. package/dist/chunks/{card.OErI_R47.js → card.DL3-xIH9.js} +3 -3
  59. package/dist/chunks/{card.OErI_R47.js.map → card.DL3-xIH9.js.map} +1 -1
  60. package/dist/chunks/{checkbox-group.Deb5pHjj.js → checkbox-group.993HE54c.js} +3 -3
  61. package/dist/chunks/{checkbox-group.Deb5pHjj.js.map → checkbox-group.993HE54c.js.map} +1 -1
  62. package/dist/chunks/{checkbox.YBhv3GCJ.js → checkbox.DpT4DfSl.js} +2 -2
  63. package/dist/chunks/{checkbox.YBhv3GCJ.js.map → checkbox.DpT4DfSl.js.map} +1 -1
  64. package/dist/chunks/{code-snippet.DNDXr7t6.js → code-snippet.8XinCILe.js} +4 -4
  65. package/dist/chunks/{code-snippet.DNDXr7t6.js.map → code-snippet.8XinCILe.js.map} +1 -1
  66. package/dist/chunks/{controls-group.CC3yZiTT.js → controls-group.BcbFbqr-.js} +2 -2
  67. package/dist/chunks/{controls-group.CC3yZiTT.js.map → controls-group.BcbFbqr-.js.map} +1 -1
  68. package/dist/chunks/{copy.YBeE8V9S.js → copy.DrHbwkFX.js} +3 -3
  69. package/dist/chunks/{copy.YBeE8V9S.js.map → copy.DrHbwkFX.js.map} +1 -1
  70. package/dist/chunks/{dashboard-section.CjC3fVU6.js → dashboard-section.CVDLs9xL.js} +4 -4
  71. package/dist/chunks/dashboard-section.CVDLs9xL.js.map +1 -0
  72. package/dist/chunks/{dashed-underline.DAtZOaad.js → dashed-underline.BH4vfrBh.js} +3 -3
  73. package/dist/chunks/{dashed-underline.DAtZOaad.js.map → dashed-underline.BH4vfrBh.js.map} +1 -1
  74. package/dist/chunks/{data-grid-template.bPjGSga2.js → data-grid-template.5keqokzt.js} +4 -4
  75. package/dist/chunks/{data-grid-template.bPjGSga2.js.map → data-grid-template.5keqokzt.js.map} +1 -1
  76. package/dist/chunks/{data-grid.o5MQdWnJ.js → data-grid.DP4VPyjR.js} +20 -20
  77. package/dist/chunks/{data-grid.o5MQdWnJ.js.map → data-grid.DP4VPyjR.js.map} +1 -1
  78. package/dist/chunks/date-filter.EysjbedJ.js +156 -0
  79. package/dist/chunks/date-filter.EysjbedJ.js.map +1 -0
  80. package/dist/chunks/{date-picker.DyB8XkiY.js → date-picker.CQ3eoDIo.js} +10 -10
  81. package/dist/chunks/{date-picker.DyB8XkiY.js.map → date-picker.CQ3eoDIo.js.map} +1 -1
  82. package/dist/chunks/date-range-filter.DwNzkqTo.js +949 -0
  83. package/dist/chunks/date-range-filter.DwNzkqTo.js.map +1 -0
  84. package/dist/chunks/{date-range-picker.BcQUUVcW.js → date-range-picker.BYGk8uh-.js} +60 -60
  85. package/dist/chunks/{date-range-picker.BcQUUVcW.js.map → date-range-picker.BYGk8uh-.js.map} +1 -1
  86. package/dist/chunks/{draggable-handle.CKkSJP0K.js → draggable-handle.D6rFbf1V.js} +2 -2
  87. package/dist/chunks/{draggable-handle.CKkSJP0K.js.map → draggable-handle.D6rFbf1V.js.map} +1 -1
  88. package/dist/chunks/{draggable.jzTSFcM7.js → draggable.DH-Wc8GI.js} +2 -2
  89. package/dist/chunks/{draggable.jzTSFcM7.js.map → draggable.DH-Wc8GI.js.map} +1 -1
  90. package/dist/chunks/{dropdown-tag.BvXqllkv.js → dropdown-tag.DQ_BcUK7.js} +3 -3
  91. package/dist/chunks/{dropdown-tag.BvXqllkv.js.map → dropdown-tag.DQ_BcUK7.js.map} +1 -1
  92. package/dist/chunks/{dropdown.BoSI-Rre.js → dropdown.BJ0cJ9Ea.js} +1471 -1384
  93. package/dist/chunks/dropdown.BJ0cJ9Ea.js.map +1 -0
  94. package/dist/chunks/{empty-state.BuK12EGe.js → empty-state.CECdMida.js} +2 -2
  95. package/dist/chunks/{empty-state.BuK12EGe.js.map → empty-state.CECdMida.js.map} +1 -1
  96. package/dist/chunks/{field-label.vrUwhoOg.js → field-label.Dm9I8IDI.js} +2 -2
  97. package/dist/chunks/{field-label.vrUwhoOg.js.map → field-label.Dm9I8IDI.js.map} +1 -1
  98. package/dist/chunks/{file-uploader.Cv8sm0Jd.js → file-uploader.B8c3MlBD.js} +7 -6
  99. package/dist/chunks/{file-uploader.Cv8sm0Jd.js.map → file-uploader.B8c3MlBD.js.map} +1 -1
  100. package/dist/chunks/filter-bar.BPPxuT_w.js +2552 -0
  101. package/dist/chunks/filter-bar.BPPxuT_w.js.map +1 -0
  102. package/dist/chunks/{fixed-scroller.C0nVzRBU.js → fixed-scroller.nECGGyOp.js} +15 -15
  103. package/dist/chunks/{fixed-scroller.C0nVzRBU.js.map → fixed-scroller.nECGGyOp.js.map} +1 -1
  104. package/dist/chunks/{focus-trap.Co-S6goa.js → focus-trap.BgyHTR_3.js} +1 -2
  105. package/dist/chunks/{focus-trap.Co-S6goa.js.map → focus-trap.BgyHTR_3.js.map} +1 -1
  106. package/dist/chunks/{footer-actions.BJif4sIk.js → footer-actions.B2dxp-b_.js} +2 -2
  107. package/dist/chunks/{footer-actions.BJif4sIk.js.map → footer-actions.B2dxp-b_.js.map} +1 -1
  108. package/dist/chunks/{form-layout-title.C7f1ByNh.js → form-layout-title.h-7dMAq7.js} +2 -2
  109. package/dist/chunks/{form-layout-title.C7f1ByNh.js.map → form-layout-title.h-7dMAq7.js.map} +1 -1
  110. package/dist/chunks/grid-layout.BuhsC4WZ.js +115 -0
  111. package/dist/chunks/grid-layout.BuhsC4WZ.js.map +1 -0
  112. package/dist/chunks/{header-with-views.Dl6bfk_7.js → header-with-views.Bux_-bM4.js} +308 -308
  113. package/dist/chunks/{header-with-views.Dl6bfk_7.js.map → header-with-views.Bux_-bM4.js.map} +1 -1
  114. package/dist/chunks/{header.E-KFjIG7.js → header.BEnZbxIA.js} +4 -4
  115. package/dist/chunks/{header.E-KFjIG7.js.map → header.BEnZbxIA.js.map} +1 -1
  116. package/dist/chunks/{info-icon-with-popover.DqnQnwMI.js → info-icon-with-popover.BRl6sC0B.js} +3 -3
  117. package/dist/chunks/{info-icon-with-popover.DqnQnwMI.js.map → info-icon-with-popover.BRl6sC0B.js.map} +1 -1
  118. package/dist/chunks/{info-icon.D_zu5SYT.js → info-icon.CcM7z-CY.js} +3 -3
  119. package/dist/chunks/{info-icon.D_zu5SYT.js.map → info-icon.CcM7z-CY.js.map} +1 -1
  120. package/dist/chunks/{input-field-password.BXptrVTT.js → input-field-password.0W7vePC4.js} +4 -4
  121. package/dist/chunks/{input-field-password.BXptrVTT.js.map → input-field-password.0W7vePC4.js.map} +1 -1
  122. package/dist/chunks/{input-field-phone-number.Crxi8Wm7.js → input-field-phone-number.RblgK9OP.js} +2 -2
  123. package/dist/chunks/{input-field-phone-number.Crxi8Wm7.js.map → input-field-phone-number.RblgK9OP.js.map} +1 -1
  124. package/dist/chunks/{input-field._keU91LW.js → input-field.B-Nta-en.js} +3 -3
  125. package/dist/chunks/{input-field._keU91LW.js.map → input-field.B-Nta-en.js.map} +1 -1
  126. package/dist/chunks/{input-time.D7UW_ww_.js → input-time.CMKTGRcV.js} +3 -3
  127. package/dist/chunks/{input-time.D7UW_ww_.js.map → input-time.CMKTGRcV.js.map} +1 -1
  128. package/dist/chunks/input-with-dropdown-filter.DXnJOBf6.js +100 -0
  129. package/dist/chunks/input-with-dropdown-filter.DXnJOBf6.js.map +1 -0
  130. package/dist/chunks/{inspector-page.DNsc0lK1.js → inspector-page.Bd39LxR2.js} +2 -2
  131. package/dist/chunks/{inspector-page.DNsc0lK1.js.map → inspector-page.Bd39LxR2.js.map} +1 -1
  132. package/dist/chunks/{inspector.BLAqbhmV.js → inspector.SmoWfjqp.js} +2 -2
  133. package/dist/chunks/{inspector.BLAqbhmV.js.map → inspector.SmoWfjqp.js.map} +1 -1
  134. package/dist/chunks/{list-item.RuGQ8Y4T.js → list-item.CoDag_QY.js} +3 -3
  135. package/dist/chunks/{list-item.RuGQ8Y4T.js.map → list-item.CoDag_QY.js.map} +1 -1
  136. package/dist/chunks/{listbox-option-tag.71rmQvG8.js → listbox-option-tag.Bhyu9LpW.js} +2 -2
  137. package/dist/chunks/{listbox-option-tag.71rmQvG8.js.map → listbox-option-tag.Bhyu9LpW.js.map} +1 -1
  138. package/dist/chunks/{modal-fullscreen.jXJnaueu.js → modal-fullscreen.D-ws4648.js} +3 -3
  139. package/dist/chunks/{modal-fullscreen.jXJnaueu.js.map → modal-fullscreen.D-ws4648.js.map} +1 -1
  140. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.BwmYlzFm.js → modal.vue_vue_type_script_setup_true_lang.DkjMGIP8.js} +4 -4
  141. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.BwmYlzFm.js.map → modal.vue_vue_type_script_setup_true_lang.DkjMGIP8.js.map} +1 -1
  142. package/dist/chunks/{navigation-menu-group.BnS0isK8.js → navigation-menu-group.BlkhBGX3.js} +2 -2
  143. package/dist/chunks/{navigation-menu-group.BnS0isK8.js.map → navigation-menu-group.BlkhBGX3.js.map} +1 -1
  144. package/dist/chunks/{pagination.C-kvJ-XK.js → pagination.CyqfmV_-.js} +4 -4
  145. package/dist/chunks/{pagination.C-kvJ-XK.js.map → pagination.CyqfmV_-.js.map} +1 -1
  146. package/dist/chunks/popover.types.CXIAfp1m.js +6 -0
  147. package/dist/chunks/{popover.types.dhllh3NP.js.map → popover.types.CXIAfp1m.js.map} +1 -1
  148. package/dist/chunks/{popper-container.Rfj8UdMD.js → popper-container.lfk_dyZi.js} +2 -2
  149. package/dist/chunks/{popper-container.Rfj8UdMD.js.map → popper-container.lfk_dyZi.js.map} +1 -1
  150. package/dist/chunks/promo-banner.3d1DHWas.js.map +1 -1
  151. package/dist/chunks/{radio-group.BTI_2U11.js → radio-group.DGwM-ijw.js} +3 -3
  152. package/dist/chunks/{radio-group.BTI_2U11.js.map → radio-group.DGwM-ijw.js.map} +1 -1
  153. package/dist/chunks/{rich-text-editor.ClUU1zPM.js → rich-text-editor.7qlWY3xz.js} +5 -5
  154. package/dist/chunks/{rich-text-editor.ClUU1zPM.js.map → rich-text-editor.7qlWY3xz.js.map} +1 -1
  155. package/dist/chunks/{search-bar.D1Jz7hdd.js → search-bar.BRMyMzkF.js} +3 -3
  156. package/dist/chunks/{search-bar.D1Jz7hdd.js.map → search-bar.BRMyMzkF.js.map} +1 -1
  157. package/dist/chunks/{secondary-nav.D32VFDTi.js → secondary-nav.BbBhe7QI.js} +3 -3
  158. package/dist/chunks/{secondary-nav.D32VFDTi.js.map → secondary-nav.BbBhe7QI.js.map} +1 -1
  159. package/dist/chunks/{segmented-control.CarI0i3p.js → segmented-control.BTILFbBW.js} +2 -2
  160. package/dist/chunks/{segmented-control.CarI0i3p.js.map → segmented-control.BTILFbBW.js.map} +1 -1
  161. package/dist/chunks/select-avatar-filter.DdOdBb0C.js +55 -0
  162. package/dist/chunks/select-avatar-filter.DdOdBb0C.js.map +1 -0
  163. package/dist/chunks/select-country-filter.D-zpTtKe.js +56 -0
  164. package/dist/chunks/select-country-filter.D-zpTtKe.js.map +1 -0
  165. package/dist/chunks/select-currency-filter.BitX4BCE.js +91 -0
  166. package/dist/chunks/select-currency-filter.BitX4BCE.js.map +1 -0
  167. package/dist/chunks/select-payment-method-filter.BiZuCZOa.js +55 -0
  168. package/dist/chunks/select-payment-method-filter.BiZuCZOa.js.map +1 -0
  169. package/dist/chunks/select-tag-filter.BUIIqK0l.js +63 -0
  170. package/dist/chunks/select-tag-filter.BUIIqK0l.js.map +1 -0
  171. package/dist/chunks/{selection-card-group.CQsS8-H9.js → selection-card-group.mCAfzxrB.js} +3 -3
  172. package/dist/chunks/{selection-card-group.CQsS8-H9.js.map → selection-card-group.mCAfzxrB.js.map} +1 -1
  173. package/dist/chunks/{sidepanel.CYWPV9dE.js → sidepanel.amz6_quV.js} +12 -12
  174. package/dist/chunks/sidepanel.amz6_quV.js.map +1 -0
  175. package/dist/chunks/{structured-list-item.C6SAUS9a.js → structured-list-item.Br6cAwZk.js} +4 -4
  176. package/dist/chunks/{structured-list-item.C6SAUS9a.js.map → structured-list-item.Br6cAwZk.js.map} +1 -1
  177. package/dist/chunks/{summary-grid.types.FTWeUNFh.js → summary-grid.types.DUEiCht4.js} +6 -6
  178. package/dist/chunks/{summary-grid.types.FTWeUNFh.js.map → summary-grid.types.DUEiCht4.js.map} +1 -1
  179. package/dist/chunks/{tab.CwXAsp9E.js → tab.Df1c3HPX.js} +3 -3
  180. package/dist/chunks/{tab.CwXAsp9E.js.map → tab.Df1c3HPX.js.map} +1 -1
  181. package/dist/chunks/{tag.BYxa556o.js → tag.Cg3joxK_.js} +2 -2
  182. package/dist/chunks/{tag.BYxa556o.js.map → tag.Cg3joxK_.js.map} +1 -1
  183. package/dist/chunks/{textarea.D4aMdmDx.js → textarea.ClWTwdJT.js} +2 -2
  184. package/dist/chunks/{textarea.D4aMdmDx.js.map → textarea.ClWTwdJT.js.map} +1 -1
  185. package/dist/chunks/{timeline-item.De8HCoYw.js → timeline-item.CdOFw-Jn.js} +144 -132
  186. package/dist/chunks/timeline-item.CdOFw-Jn.js.map +1 -0
  187. package/dist/chunks/{title-details.8cyCeaLf.js → title-details.Ccs_ltkI.js} +2 -2
  188. package/dist/chunks/{title-details.8cyCeaLf.js.map → title-details.Ccs_ltkI.js.map} +1 -1
  189. package/dist/chunks/{tooltip.0QqJo2sa.js → tooltip.B8LTTssT.js} +3 -3
  190. package/dist/chunks/{tooltip.0QqJo2sa.js.map → tooltip.B8LTTssT.js.map} +1 -1
  191. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.Dn4toWHY.js → tutorial.vue_vue_type_script_setup_true_lang.CpzGxsmy.js} +4 -4
  192. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.Dn4toWHY.js.map → tutorial.vue_vue_type_script_setup_true_lang.CpzGxsmy.js.map} +1 -1
  193. package/dist/chunks/typography.B6elnWpr.js.map +1 -1
  194. package/dist/chunks/{use-date-input-formatter.BIVkaB1k.js → use-date-input-formatter.COZBxMaZ.js} +2 -2
  195. package/dist/chunks/{use-date-input-formatter.BIVkaB1k.js.map → use-date-input-formatter.COZBxMaZ.js.map} +1 -1
  196. package/dist/chunks/warning-filled.Bzh3ib0x.js +25 -0
  197. package/dist/chunks/warning-filled.Bzh3ib0x.js.map +1 -0
  198. package/dist/code-snippet.js +1 -1
  199. package/dist/dashboard-template.js +1 -1
  200. package/dist/dashed-underline.js +1 -1
  201. package/dist/data-grid-template.js +1 -1
  202. package/dist/data-grid.js +1 -1
  203. package/dist/date-picker.js +2 -2
  204. package/dist/date-range-picker.js +2 -2
  205. package/dist/date-time-picker.js +4 -4
  206. package/dist/draggable.js +2 -2
  207. package/dist/dropdown.js +2 -2
  208. package/dist/empty-state.js +1 -1
  209. package/dist/file-uploader.js +1 -1
  210. package/dist/filter-bar.js +1 -1
  211. package/dist/focus-trap.js +1 -1
  212. package/dist/form-layout.js +1 -1
  213. package/dist/header-with-views.js +1 -1
  214. package/dist/header.js +1 -1
  215. package/dist/index.js +257 -257
  216. package/dist/info-icon.js +1 -1
  217. package/dist/input-field-password.js +1 -1
  218. package/dist/input-field-phone-number.js +1 -1
  219. package/dist/input-field.js +1 -1
  220. package/dist/input-time.js +1 -1
  221. package/dist/inspector.js +2 -2
  222. package/dist/internal.js +13 -13
  223. package/dist/list.js +1 -1
  224. package/dist/menu.js +1 -1
  225. package/dist/modal-fullscreen.js +1 -1
  226. package/dist/modal.js +2 -2
  227. package/dist/navigation-menu.js +1 -1
  228. package/dist/pagination.js +1 -1
  229. package/dist/popover.js +2 -2
  230. package/dist/popper-container.js +1 -1
  231. package/dist/progress-bar.js +1 -1
  232. package/dist/radio-group.js +1 -1
  233. package/dist/rich-text-editor.js +1 -1
  234. package/dist/search-bar.js +2 -2
  235. package/dist/secondary-nav.js +1 -1
  236. package/dist/segmented-control.js +1 -1
  237. package/dist/selection-card.js +1 -1
  238. package/dist/sidepanel.js +1 -1
  239. package/dist/structured-list.js +1 -1
  240. package/dist/summary-grid.js +1 -1
  241. package/dist/tabs.js +1 -1
  242. package/dist/tag.js +1 -1
  243. package/dist/textarea.js +1 -1
  244. package/dist/timeline.js +1 -1
  245. package/dist/tutorial.js +1 -1
  246. package/dist/web-types.json +1 -1
  247. package/package.json +4 -4
  248. package/dist/chunks/alert.BYmn1ewo.js.map +0 -1
  249. package/dist/chunks/button-actions.DvuGEQxM.js.map +0 -1
  250. package/dist/chunks/dashboard-section.CjC3fVU6.js.map +0 -1
  251. package/dist/chunks/dropdown.BoSI-Rre.js.map +0 -1
  252. package/dist/chunks/filter-bar.6ElVHgFA.js +0 -3974
  253. package/dist/chunks/filter-bar.6ElVHgFA.js.map +0 -1
  254. package/dist/chunks/grid-layout.CCWNscU_.js +0 -113
  255. package/dist/chunks/grid-layout.CCWNscU_.js.map +0 -1
  256. package/dist/chunks/popover.types.dhllh3NP.js +0 -6
  257. package/dist/chunks/sidepanel.CYWPV9dE.js.map +0 -1
  258. package/dist/chunks/timeline-item.De8HCoYw.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as we, useSlots as ke, ref as g, provide as Le, inject as j, toRef as Ee, computed as l, openBlock as n, createBlock as u, unref as o, mergeProps as F, withCtx as m, renderSlot as p, createCommentVNode as d, createElementVNode as R, createElementBlock as c, withModifiers as K, withKeys as he, createTextVNode as J, toDisplayString as X, createVNode as _e } from "vue";
2
- import { h as Te, B as Z } from "./dropdown.BoSI-Rre.js";
2
+ import { h as Te, B as Z } from "./dropdown.BJ0cJ9Ea.js";
3
3
  import { p as $, d as Ne, B as L } from "./typography.B6elnWpr.js";
4
4
  import { u as Ae } from "./form-field.B60VsF8d.js";
5
5
  import { g as E } from "./generate-uid.DBWe4g6T.js";
@@ -7,7 +7,7 @@ import { g as z } from "./get-slot-text.8Fbl1GOr.js";
7
7
  import { u as ge } from "./index.CGBfMQdv.js";
8
8
  import { u as Fe } from "./use-form-layout-loading.CWbjZiwP.js";
9
9
  import { u as Se } from "./use-has-slot.CyMiImRQ.js";
10
- import { F as Oe } from "./field-label.vrUwhoOg.js";
10
+ import { F as Oe } from "./field-label.Dm9I8IDI.js";
11
11
  import { E as Ce } from "./error-message.DJ5l0EUH.js";
12
12
  import { _ as Re } from "./_plugin-vue_export-helper.CHgC5LLL.js";
13
13
  import "../assets/input-field.css";
@@ -323,4 +323,4 @@ export {
323
323
  v as e,
324
324
  Ie as f
325
325
  };
326
- //# sourceMappingURL=input-field._keU91LW.js.map
326
+ //# sourceMappingURL=input-field.B-Nta-en.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-field._keU91LW.js","sources":["../../../vue2/src/components/input-field/input-field.keys.ts","../../../vue2/src/components/input-field/input-field.types.ts","../../../vue2/src/components/input-field/input-field.vue"],"sourcesContent":["export const INPUT_FIELD_HINT_INJECTION_KEY = Symbol('input field hint injection key');\nexport const INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY = Symbol('input field parent component injection key');\n","import { type BentoDropdownProps } from '../dropdown/dropdown.types';\nimport { type FormField } from '../../types/form-field';\n\n/**\n * @deprecated Since v3.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 v3.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 v3.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\nexport interface BentoInputDropdownProps {\n /**\n * Text that labels the dropdown element\n */\n 'aria-label'?: string;\n /**\n * Indicates that dropdown items are loading (shows a loading skeleton)\n */\n componentLoading?: BentoDropdownProps['componentLoading'];\n /**\n * Enables dynamic filtering\n */\n dynamicFiltering?: BentoDropdownProps['dynamicFiltering'];\n /**\n * Empty state displayed when no search results are found\n */\n emptyState?: BentoDropdownProps['emptyState'];\n /**\n * Enables value/label pair handling for selected values\n */\n enableValueLabelPair?: BentoDropdownProps['enableValueLabelPair'];\n /**\n * Indicates whether there are more items to load\n */\n hasMoreItems?: BentoDropdownProps['hasMoreItems'];\n /**\n * Function that determines which options are disabled from interaction\n */\n isOptionDisabled?: BentoDropdownProps['isOptionDisabled'];\n /**\n * List of available items\n */\n items: BentoDropdownProps['items'];\n /**\n * The type of lazy load: \"automatic\" for infinite scrolling, \"button\" for a show-more button\n */\n lazyLoadType?: BentoDropdownProps['lazyLoadType'];\n /**\n * Indicates if new options are lazy loading\n */\n loading?: BentoDropdownProps['loading'];\n /**\n * Selected value of the dropdown\n */\n modelValue?: BentoDropdownProps['modelValue'];\n /**\n * Sets the dropdown in read-only mode\n */\n readonly?: BentoDropdownProps['readonly'];\n /**\n * Dropdown search options including debounce time and placeholder\n */\n search?: BentoDropdownProps['search'];\n /**\n * Displays non-selectable, static categories in the dropdown\n */\n staticCategories?: BentoDropdownProps['staticCategories'];\n /**\n * Enables virtual scrolling for large lists of items\n */\n virtualScroll?: BentoDropdownProps['virtualScroll'];\n}\n\n/**\n * @deprecated Since v3.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 * Reduces height of the input\n */\n condensed?: boolean;\n\n /**\n * Dropdown props for the single-select dropdown menu embedded in the input field.\n * Only a subset of `BentoDropdownProps` is supported (multi-select is not available).\n *\n * @see {@link BentoInputDropdownProps}\n */\n dropdown?: BentoInputDropdownProps;\n\n /**\n * Position of the dropdown before or after input value\n */\n dropdownPosition?: BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`;\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 * 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=\"getInputFieldDropdownProps($attrs)\"\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=\"getAriaLabel($attrs)\"\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\"\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 v-if=\"hint && isFocused && modelValue\" el=\"span\" class=\"b-input-field__hint\">\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=\"getInputFieldDropdownProps($attrs)\"\n :disabled=\"disabled\"\n :readonly=\"isDropdownReadOnly\"\n @update:model-value=\"onDropdownInput\"\n />\n </div>\n </div>\n\n <div\n v-if=\"(shouldShowError && !!errorMessage) || hasSlot('description') || description\"\n class=\"b-input-field__footer\"\n >\n <error-message v-if=\"shouldShowError && !!errorMessage\" :id=\"errorId\" :error-message=\"errorMessage\" />\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 </div>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, provide, type Ref, ref, toRef, useSlots } from 'vue';\n\n // Components\n import { BentoDropdown } from '@/components/dropdown';\n import { DROPDOWN_SMALL_SIZE_INJECTION_KEY } from '@/components/dropdown/dropdown.keys';\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 '@/utils/ts/generate-uid';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useI18n } from '@/utils/ts/i18n';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import {\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 slots = useSlots();\n\n const props = withDefaults(defineProps<BentoInputFieldProps>(), {\n ariaHidden: true,\n condensed: false,\n description: '',\n disabled: false,\n dropdown: undefined,\n dropdownPosition: BentoInputFieldElementPosition.START,\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 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 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<HTMLInputElement>(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 DROPDOWN_SMALL_SIZE_INJECTION_KEY as true, to set the input only dropdown size variant in the BentoDropdown comp\n provide(DROPDOWN_SMALL_SIZE_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(() => !props.disabled && !isReadOnly.value && !!props.errorMessage);\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(() => t('ariaLabelFallback'));\n const getAriaLabel = (attributes: Record<string, unknown>) =>\n (attributes['aria-label'] as string | undefined) ??\n (attributes['aria-labelledby'] ? undefined : computedLabel.value || computedAriaLabelFallbackMessage.value);\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 getInputFieldDropdownProps = (attributes: Record<string, unknown>) => ({\n 'aria-label': t('ariaLabelDropdownFallback', { inputLabel: getAriaLabel(attributes) }),\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, modelValue: 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 focus methods for parent components in Vue 3.\n defineExpose({\n /**\n * Focuses the input field.\n */\n focusInput,\n\n /**\n * Focuses the dropdown when using the dropdown variant; otherwise focuses the input field.\n */\n focus,\n\n /**\n * Reference to the native input element.\n */\n inputFieldElement,\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 (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 '3.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', event: 'update:model-value' },\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field.scss\" />\n"],"names":["INPUT_FIELD_HINT_INJECTION_KEY","INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY","BentoInputFieldVariant","BentoInputFieldVariant2","BentoInputFieldElementPosition","BentoInputFieldElementPosition2","BentoInputFieldStateClass","BentoInputFieldStateClass2","BentoInputFieldType","BentoInputFieldType2","BentoInputFieldEvent","BentoInputFieldEvent2","__default__","messages","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","DROPDOWN_SMALL_SIZE_INJECTION_KEY","hint","inject","onFocus","onBlur","isReadOnly","useFormLayoutFieldLoading","toRef","isDropdownReadOnly","computed","shouldShowStaticValue","isDefaultVariant","isPaymentMethodVariant","shouldDisplayStaticValueAtStart","shouldDisplayStaticValueAtEnd","shouldShowDropdown","shouldDisplayDropdownAtStart","shouldDisplayDropdownAtEnd","shouldShowError","computedLabel","getSlotText","computedDescription","computedAriaOwns","computedAriaLabelFallbackMessage","getAriaLabel","computedAriaDescribedBy","inputFieldConditionalClasses","getInputFieldDropdownProps","onInput","event","inputValue","onDropdownInput","selectedValue","focusInput","__expose","inputFieldParentComponent","printDevelopmentWarning","deprecate"],"mappings":";;;;;;;;;;;;;AAAO,MAAAA,KAAA,uBAAA,gCAAA,GACAC,KAAA,uBAAA,4CAAA;ACKA,IAAAC,IAAA,kB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field/input-field.keys.ts","../../../vue2/src/components/input-field/input-field.types.ts","../../../vue2/src/components/input-field/input-field.vue"],"sourcesContent":["export const INPUT_FIELD_HINT_INJECTION_KEY = Symbol('input field hint injection key');\nexport const INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY = Symbol('input field parent component injection key');\n","import { type BentoDropdownProps } from '../dropdown/dropdown.types';\nimport { type FormField } from '../../types/form-field';\n\n/**\n * @deprecated Since v3.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 v3.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 v3.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\nexport interface BentoInputDropdownProps {\n /**\n * Text that labels the dropdown element\n */\n 'aria-label'?: string;\n /**\n * Indicates that dropdown items are loading (shows a loading skeleton)\n */\n componentLoading?: BentoDropdownProps['componentLoading'];\n /**\n * Enables dynamic filtering\n */\n dynamicFiltering?: BentoDropdownProps['dynamicFiltering'];\n /**\n * Empty state displayed when no search results are found\n */\n emptyState?: BentoDropdownProps['emptyState'];\n /**\n * Enables value/label pair handling for selected values\n */\n enableValueLabelPair?: BentoDropdownProps['enableValueLabelPair'];\n /**\n * Indicates whether there are more items to load\n */\n hasMoreItems?: BentoDropdownProps['hasMoreItems'];\n /**\n * Function that determines which options are disabled from interaction\n */\n isOptionDisabled?: BentoDropdownProps['isOptionDisabled'];\n /**\n * List of available items\n */\n items: BentoDropdownProps['items'];\n /**\n * The type of lazy load: \"automatic\" for infinite scrolling, \"button\" for a show-more button\n */\n lazyLoadType?: BentoDropdownProps['lazyLoadType'];\n /**\n * Indicates if new options are lazy loading\n */\n loading?: BentoDropdownProps['loading'];\n /**\n * Selected value of the dropdown\n */\n modelValue?: BentoDropdownProps['modelValue'];\n /**\n * Sets the dropdown in read-only mode\n */\n readonly?: BentoDropdownProps['readonly'];\n /**\n * Dropdown search options including debounce time and placeholder\n */\n search?: BentoDropdownProps['search'];\n /**\n * Displays non-selectable, static categories in the dropdown\n */\n staticCategories?: BentoDropdownProps['staticCategories'];\n /**\n * Enables virtual scrolling for large lists of items\n */\n virtualScroll?: BentoDropdownProps['virtualScroll'];\n}\n\n/**\n * @deprecated Since v3.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 * Reduces height of the input\n */\n condensed?: boolean;\n\n /**\n * Dropdown props for the single-select dropdown menu embedded in the input field.\n * Only a subset of `BentoDropdownProps` is supported (multi-select is not available).\n *\n * @see {@link BentoInputDropdownProps}\n */\n dropdown?: BentoInputDropdownProps;\n\n /**\n * Position of the dropdown before or after input value\n */\n dropdownPosition?: BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`;\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 * 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=\"getInputFieldDropdownProps($attrs)\"\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=\"getAriaLabel($attrs)\"\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\"\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 v-if=\"hint && isFocused && modelValue\" el=\"span\" class=\"b-input-field__hint\">\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=\"getInputFieldDropdownProps($attrs)\"\n :disabled=\"disabled\"\n :readonly=\"isDropdownReadOnly\"\n @update:model-value=\"onDropdownInput\"\n />\n </div>\n </div>\n\n <div\n v-if=\"(shouldShowError && !!errorMessage) || hasSlot('description') || description\"\n class=\"b-input-field__footer\"\n >\n <error-message v-if=\"shouldShowError && !!errorMessage\" :id=\"errorId\" :error-message=\"errorMessage\" />\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 </div>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, provide, type Ref, ref, toRef, useSlots } from 'vue';\n\n // Components\n import { BentoDropdown } from '@/components/dropdown';\n import { DROPDOWN_SMALL_SIZE_INJECTION_KEY } from '@/components/dropdown/dropdown.keys';\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 '@/utils/ts/generate-uid';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useI18n } from '@/utils/ts/i18n';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import {\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 slots = useSlots();\n\n const props = withDefaults(defineProps<BentoInputFieldProps>(), {\n ariaHidden: true,\n condensed: false,\n description: '',\n disabled: false,\n dropdown: undefined,\n dropdownPosition: BentoInputFieldElementPosition.START,\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 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 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<HTMLInputElement>(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 DROPDOWN_SMALL_SIZE_INJECTION_KEY as true, to set the input only dropdown size variant in the BentoDropdown comp\n provide(DROPDOWN_SMALL_SIZE_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(() => !props.disabled && !isReadOnly.value && !!props.errorMessage);\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(() => t('ariaLabelFallback'));\n const getAriaLabel = (attributes: Record<string, unknown>) =>\n (attributes['aria-label'] as string | undefined) ??\n (attributes['aria-labelledby'] ? undefined : computedLabel.value || computedAriaLabelFallbackMessage.value);\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 getInputFieldDropdownProps = (attributes: Record<string, unknown>) => ({\n 'aria-label': t('ariaLabelDropdownFallback', { inputLabel: getAriaLabel(attributes) }),\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, modelValue: 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 focus methods for parent components in Vue 3.\n defineExpose({\n /**\n * Focuses the input field.\n */\n focusInput,\n\n /**\n * Focuses the dropdown when using the dropdown variant; otherwise focuses the input field.\n */\n focus,\n\n /**\n * Reference to the native input element.\n */\n inputFieldElement,\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 (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 '3.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', event: 'update:model-value' },\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field.scss\" />\n"],"names":["INPUT_FIELD_HINT_INJECTION_KEY","INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY","BentoInputFieldVariant","BentoInputFieldVariant2","BentoInputFieldElementPosition","BentoInputFieldElementPosition2","BentoInputFieldStateClass","BentoInputFieldStateClass2","BentoInputFieldType","BentoInputFieldType2","BentoInputFieldEvent","BentoInputFieldEvent2","__default__","messages","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","DROPDOWN_SMALL_SIZE_INJECTION_KEY","hint","inject","onFocus","onBlur","isReadOnly","useFormLayoutFieldLoading","toRef","isDropdownReadOnly","computed","shouldShowStaticValue","isDefaultVariant","isPaymentMethodVariant","shouldDisplayStaticValueAtStart","shouldDisplayStaticValueAtEnd","shouldShowDropdown","shouldDisplayDropdownAtStart","shouldDisplayDropdownAtEnd","shouldShowError","computedLabel","getSlotText","computedDescription","computedAriaOwns","computedAriaLabelFallbackMessage","getAriaLabel","computedAriaDescribedBy","inputFieldConditionalClasses","getInputFieldDropdownProps","onInput","event","inputValue","onDropdownInput","selectedValue","focusInput","__expose","inputFieldParentComponent","printDevelopmentWarning","deprecate"],"mappings":";;;;;;;;;;;;;AAAO,MAAAA,KAAA,uBAAA,gCAAA,GACAC,KAAA,uBAAA,4CAAA;ACKA,IAAAC,IAAA,kBAAAC,OACHA,EAAA,UA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as D, createBlock as b, unref as f, mergeProps as H, withCtx as g, renderSlot as M, createTextVNode as _, toDisplayString as E, createSlots as J } from "vue";
2
- import { B as W, g as X } from "./dropdown.BoSI-Rre.js";
3
- import { f as Y, B as j } from "./input-field._keU91LW.js";
2
+ import { B as W, g as X } from "./dropdown.BJ0cJ9Ea.js";
3
+ import { f as Y, B as j } from "./input-field.B-Nta-en.js";
4
4
  import { u as z } from "./index.CGBfMQdv.js";
5
5
  import { p as Z } from "./typography.B6elnWpr.js";
6
6
  import { u as Q } from "./use-has-slot.CyMiImRQ.js";
@@ -190,4 +190,4 @@ export {
190
190
  I as i,
191
191
  ye as s
192
192
  };
193
- //# sourceMappingURL=input-time.D7UW_ww_.js.map
193
+ //# sourceMappingURL=input-time.CMKTGRcV.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-time.D7UW_ww_.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\nconst MAX_TIME_INPUT_LENGTH = 8;\n\nconst MINUTES_IN_A_DAY = 24 * 60;\nconst MIN_TIME_INTERVAL = 5;\n\nconst minutesToTimeString = (minutes: number): string => {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return `${String(hours).padStart(2, '0')}:${String(remainingMinutes).padStart(2, '0')}:00`;\n};\n\nconst timeStringToSeconds = (timeText: string): number => {\n const [hours, minutes, seconds] = timeText.split(':');\n return parseInt(hours, 10) * 3600 + parseInt(minutes, 10) * 60 + parseInt(seconds, 10);\n};\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\n/**\n * Validates a time interval expressed in minutes.\n * An interval must be a whole number of at least 5 minutes that divides a full day,\n * so the generated options are evenly spread from midnight onwards.\n * @param interval The interval in minutes\n * @returns True if the interval can be used to generate time options, false otherwise\n */\nexport const isValidTimeInterval = (interval: number): boolean =>\n Number.isInteger(interval) &&\n interval >= MIN_TIME_INTERVAL &&\n interval <= MINUTES_IN_A_DAY &&\n MINUTES_IN_A_DAY % interval === 0;\n\n/**\n * Generates the list of selectable times for a given interval, starting at midnight.\n * Seconds are always `00`, e.g. an interval of 60 generates `00:00:00` up to `23:00:00`.\n * @param interval The interval in minutes\n * @returns A list of time strings in HH:MM:SS format, or an empty list for an invalid interval\n */\nexport const generateTimeOptions = (interval: number): Array<string> => {\n if (!isValidTimeInterval(interval)) {\n return [];\n }\n\n const options: Array<string> = [];\n for (let minutes = 0; minutes < MINUTES_IN_A_DAY; minutes += interval) {\n options.push(minutesToTimeString(minutes));\n }\n\n return options;\n};\n\n/**\n * Snaps a time to the closest selectable time of the given interval.\n * Rounding `up` is clamped to the last selectable time, so `23:59:59` with an\n * interval of 60 resolves to `23:00:00` instead of overflowing into the next day.\n * @param timeText The time string in HH:MM:SS format\n * @param interval The interval in minutes\n * @param direction Whether to round the time down or up\n * @returns The snapped time string, or the given time when it cannot be snapped\n */\nexport const snapTimeToInterval = (timeText: string, interval: number, direction: 'down' | 'up'): string => {\n if (!timeText || !isValidTimeString(timeText) || !isValidTimeInterval(interval)) {\n return timeText;\n }\n\n const intervalInSeconds = interval * 60;\n const lastOptionInSeconds = MINUTES_IN_A_DAY * 60 - intervalInSeconds;\n const totalSeconds = timeStringToSeconds(timeText);\n\n if (totalSeconds <= lastOptionInSeconds && totalSeconds % intervalInSeconds === 0) {\n return timeText;\n }\n\n const roundedSeconds =\n direction === 'down'\n ? Math.floor(totalSeconds / intervalInSeconds) * intervalInSeconds\n : Math.ceil(totalSeconds / intervalInSeconds) * intervalInSeconds;\n\n return minutesToTimeString(Math.min(roundedSeconds, lastOptionInSeconds) / 60);\n};\n\nexport const validateTimeInput = (event: KeyboardEvent) => {\n const { selectionStart, value = '' } = event.target as HTMLInputElement;\n\n const allowedKeys = ['Backspace', 'Tab', 'ArrowLeft', 'ArrowRight'];\n const isAllowedKey = allowedKeys.includes(event.key);\n const isValidKey = validDigitRegex.test(event.key) || isAllowedKey;\n const isValidColon = [1, 2, 4, 5].includes(selectionStart) && event.key === ':';\n const isAtMaxLength = value.length >= MAX_TIME_INPUT_LENGTH;\n\n if ((!isValidKey && !isValidColon) || (isAtMaxLength && !isAllowedKey)) {\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-dropdown\n v-if=\"isTimeDropdown\"\n class=\"b-input-time\"\n dynamic-filtering\n :condensed=\"props.condensed\"\n :disabled=\"props.disabled\"\n :error-message=\"computedErrorMessage\"\n :items=\"timeItems\"\n :label=\"props.label\"\n :model-value=\"props.modelValue ?? ''\"\n :optional=\"props.optional\"\n :placeholder=\"props.placeholder\"\n :readonly=\"props.readonly\"\n :required=\"props.required\"\n :tooltip-text=\"props.tooltipText\"\n v-bind=\"$attrs\"\n @click.native=\"emit('click', $event)\"\n @update:model-value=\"onTimeSelected\"\n >\n <template #description>\n <slot name=\"description\">{{ timeDescription }}</slot>\n </template>\n </bento-dropdown>\n <bento-input-field\n v-else\n class=\"b-input-time\"\n :type=\"inputType\"\n :step=\"nativeStep\"\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 @click=\"emit('click', $event)\"\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\">{{ timeDescription }}</slot>\n </template>\n </bento-input-field>\n</template>\n\n<script setup lang=\"ts\">\n // Components\n import { BentoDropdown } from '@/components/dropdown';\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 { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import {\n formatTimeInputValue,\n generateTimeOptions,\n isValidTimeInterval,\n isValidTimeString,\n validateTimeInput,\n } 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 interval: undefined,\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 input is clicked\n */\n (e: 'click', event: MouseEvent): void;\n\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 const timeDescription = computed(() =>\n props.description ? `${props.description} ${t('timeFormatDescription')}` : t('timeFormatDescription')\n );\n\n const hasTimeInterval = computed(() => isValidTimeInterval(props.interval));\n // On touch devices the native time input already restricts the selectable times through `step`\n const isTimeDropdown = computed(() => hasTimeInterval.value && !isTouchDevice.value);\n const timeItems = computed(() =>\n generateTimeOptions(props.interval).map(timeOption => ({ label: timeOption, value: timeOption }))\n );\n const nativeStep = computed(() => {\n if (!isTouchDevice.value) {\n return undefined;\n }\n\n return hasTimeInterval.value ? props.interval * 60 : 1;\n });\n\n watch(\n () => props.interval,\n interval => {\n if (interval != null && !isValidTimeInterval(interval)) {\n printDevelopmentWarning(\n `[bento-input-time] The \"interval\" prop must be a whole number of minutes of at least 5 that divides a full day, e.g. 5, 15, 30 or 60. Received \"${interval}\", falling back to a free text time input.`\n );\n }\n },\n { immediate: true }\n );\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 // A `step` of whole minutes hides the seconds in the native input, so they are added back\n const nativeValue = String(value ?? '');\n const shouldAppendSeconds = hasTimeInterval.value && nativeValue.length === 5;\n\n emit('update:model-value', shouldAppendSeconds ? `${nativeValue}:00` : nativeValue);\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\n const onTimeSelected = (value: BentoInputFieldValue) => {\n if (props.disabled || props.readonly) {\n return;\n }\n\n internalError.value = false;\n emit('update:model-value', String(value ?? ''));\n emit('input:valid');\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","MAX_TIME_INPUT_LENGTH","MINUTES_IN_A_DAY","MIN_TIME_INTERVAL","minutesToTimeString","minutes","hours","remainingMinutes","timeStringToSeconds","timeText","seconds","isValidTimeString","isValidTimeInterval","interval","generateTimeOptions","options","snapTimeToInterval","direction","intervalInSeconds","lastOptionInSeconds","totalSeconds","roundedSeconds","validateTimeInput","event","selectionStart","value","isAllowedKey","isValidKey","isValidColon","isAtMaxLength","formatTimeInputValue","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","timeDescription","hasTimeInterval","isTimeDropdown","timeItems","timeOption","nativeStep","watch","printDevelopmentWarning","validateTimeWithDebounce","debounce","isValid","newValue","onInput","nativeValue","shouldAppendSeconds","formatted","onKeyDown","onTimeSelected"],"mappings":";;;;;;;;;AAAA,MAAAA,KAAA,QAEAC,KAAA,WACAC,KAAA,iBAEAC,KAAA,GAEAC,IAAA,MACAC,KAAA,GAEAC,IAAA,CAAAC,MAAA;AACI,QAAAC,IAAA,KAAA,MAAAD,IAAA,EAAA,GACAE,IAAAF,IAAA;AACA,SAAA,GAAA,OAAAC,CAAA,EAAA,SAAA,GAAA,GAAA,CAAA,IAAA,OAAAC,CAAA,EAAA,SAAA,GAAA,GAAA,CAAA;AACJ,GAEAC,KAAA,CAAAC,MAAA;AACI,QAAA,CAAAH,GAAAD,GAAAK,CAAA,IAAAD,EAAA,MAAA,GAAA;AACA,SAAA,SAAAH,GAAA,EAAA,IAAA,OAAA,SAAAD,GAAA,EAAA,IAAA,KAAA,SAAAK,GAAA,EAAA;AACJ,GAQOC,IAAA,CAAAF,MAAA,8CAAA,KAAAA,C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AAAA,QAAkB,OAAA;AAElB,gBAAAyB,IAAA3C,GAAA,OAAAL,KAAA,EAAA,CAAA;AACA,UAAAuB,EAAA,sBAAAyB,CAAA,GACAP,EAAAO,CAAA;AAAA,QAAkC;AAAA,IACtC,GAGJC,IAAA,CAAAnD,MAAA;AACI,MAAAmB,EAAA,SACIpB,GAAAC,CAAA,GAEJyB,EAAA,WAAAzB,CAAA;AAAA,IAAqB,GAGzBoD,IAAA,CAAAlD,MAAA;AACI,MAAAqB,EAAA,YAAAA,EAAA,aAIAI,EAAA,QAAA,IACAF,EAAA,sBAAA,OAAAvB,KAAA,EAAA,CAAA,GACAuB,EAAA,aAAA;AAAA,IAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"input-time.CMKTGRcV.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\nconst MAX_TIME_INPUT_LENGTH = 8;\n\nconst MINUTES_IN_A_DAY = 24 * 60;\nconst MIN_TIME_INTERVAL = 5;\n\nconst minutesToTimeString = (minutes: number): string => {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return `${String(hours).padStart(2, '0')}:${String(remainingMinutes).padStart(2, '0')}:00`;\n};\n\nconst timeStringToSeconds = (timeText: string): number => {\n const [hours, minutes, seconds] = timeText.split(':');\n return parseInt(hours, 10) * 3600 + parseInt(minutes, 10) * 60 + parseInt(seconds, 10);\n};\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\n/**\n * Validates a time interval expressed in minutes.\n * An interval must be a whole number of at least 5 minutes that divides a full day,\n * so the generated options are evenly spread from midnight onwards.\n * @param interval The interval in minutes\n * @returns True if the interval can be used to generate time options, false otherwise\n */\nexport const isValidTimeInterval = (interval: number): boolean =>\n Number.isInteger(interval) &&\n interval >= MIN_TIME_INTERVAL &&\n interval <= MINUTES_IN_A_DAY &&\n MINUTES_IN_A_DAY % interval === 0;\n\n/**\n * Generates the list of selectable times for a given interval, starting at midnight.\n * Seconds are always `00`, e.g. an interval of 60 generates `00:00:00` up to `23:00:00`.\n * @param interval The interval in minutes\n * @returns A list of time strings in HH:MM:SS format, or an empty list for an invalid interval\n */\nexport const generateTimeOptions = (interval: number): Array<string> => {\n if (!isValidTimeInterval(interval)) {\n return [];\n }\n\n const options: Array<string> = [];\n for (let minutes = 0; minutes < MINUTES_IN_A_DAY; minutes += interval) {\n options.push(minutesToTimeString(minutes));\n }\n\n return options;\n};\n\n/**\n * Snaps a time to the closest selectable time of the given interval.\n * Rounding `up` is clamped to the last selectable time, so `23:59:59` with an\n * interval of 60 resolves to `23:00:00` instead of overflowing into the next day.\n * @param timeText The time string in HH:MM:SS format\n * @param interval The interval in minutes\n * @param direction Whether to round the time down or up\n * @returns The snapped time string, or the given time when it cannot be snapped\n */\nexport const snapTimeToInterval = (timeText: string, interval: number, direction: 'down' | 'up'): string => {\n if (!timeText || !isValidTimeString(timeText) || !isValidTimeInterval(interval)) {\n return timeText;\n }\n\n const intervalInSeconds = interval * 60;\n const lastOptionInSeconds = MINUTES_IN_A_DAY * 60 - intervalInSeconds;\n const totalSeconds = timeStringToSeconds(timeText);\n\n if (totalSeconds <= lastOptionInSeconds && totalSeconds % intervalInSeconds === 0) {\n return timeText;\n }\n\n const roundedSeconds =\n direction === 'down'\n ? Math.floor(totalSeconds / intervalInSeconds) * intervalInSeconds\n : Math.ceil(totalSeconds / intervalInSeconds) * intervalInSeconds;\n\n return minutesToTimeString(Math.min(roundedSeconds, lastOptionInSeconds) / 60);\n};\n\nexport const validateTimeInput = (event: KeyboardEvent) => {\n const { selectionStart, value = '' } = event.target as HTMLInputElement;\n\n const allowedKeys = ['Backspace', 'Tab', 'ArrowLeft', 'ArrowRight'];\n const isAllowedKey = allowedKeys.includes(event.key);\n const isValidKey = validDigitRegex.test(event.key) || isAllowedKey;\n const isValidColon = [1, 2, 4, 5].includes(selectionStart) && event.key === ':';\n const isAtMaxLength = value.length >= MAX_TIME_INPUT_LENGTH;\n\n if ((!isValidKey && !isValidColon) || (isAtMaxLength && !isAllowedKey)) {\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-dropdown\n v-if=\"isTimeDropdown\"\n class=\"b-input-time\"\n dynamic-filtering\n :condensed=\"props.condensed\"\n :disabled=\"props.disabled\"\n :error-message=\"computedErrorMessage\"\n :items=\"timeItems\"\n :label=\"props.label\"\n :model-value=\"props.modelValue ?? ''\"\n :optional=\"props.optional\"\n :placeholder=\"props.placeholder\"\n :readonly=\"props.readonly\"\n :required=\"props.required\"\n :tooltip-text=\"props.tooltipText\"\n v-bind=\"$attrs\"\n @click.native=\"emit('click', $event)\"\n @update:model-value=\"onTimeSelected\"\n >\n <template #description>\n <slot name=\"description\">{{ timeDescription }}</slot>\n </template>\n </bento-dropdown>\n <bento-input-field\n v-else\n class=\"b-input-time\"\n :type=\"inputType\"\n :step=\"nativeStep\"\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 @click=\"emit('click', $event)\"\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\">{{ timeDescription }}</slot>\n </template>\n </bento-input-field>\n</template>\n\n<script setup lang=\"ts\">\n // Components\n import { BentoDropdown } from '@/components/dropdown';\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 { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import {\n formatTimeInputValue,\n generateTimeOptions,\n isValidTimeInterval,\n isValidTimeString,\n validateTimeInput,\n } 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 interval: undefined,\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 input is clicked\n */\n (e: 'click', event: MouseEvent): void;\n\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 const timeDescription = computed(() =>\n props.description ? `${props.description} ${t('timeFormatDescription')}` : t('timeFormatDescription')\n );\n\n const hasTimeInterval = computed(() => isValidTimeInterval(props.interval));\n // On touch devices the native time input already restricts the selectable times through `step`\n const isTimeDropdown = computed(() => hasTimeInterval.value && !isTouchDevice.value);\n const timeItems = computed(() =>\n generateTimeOptions(props.interval).map(timeOption => ({ label: timeOption, value: timeOption }))\n );\n const nativeStep = computed(() => {\n if (!isTouchDevice.value) {\n return undefined;\n }\n\n return hasTimeInterval.value ? props.interval * 60 : 1;\n });\n\n watch(\n () => props.interval,\n interval => {\n if (interval != null && !isValidTimeInterval(interval)) {\n printDevelopmentWarning(\n `[bento-input-time] The \"interval\" prop must be a whole number of minutes of at least 5 that divides a full day, e.g. 5, 15, 30 or 60. Received \"${interval}\", falling back to a free text time input.`\n );\n }\n },\n { immediate: true }\n );\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 // A `step` of whole minutes hides the seconds in the native input, so they are added back\n const nativeValue = String(value ?? '');\n const shouldAppendSeconds = hasTimeInterval.value && nativeValue.length === 5;\n\n emit('update:model-value', shouldAppendSeconds ? `${nativeValue}:00` : nativeValue);\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\n const onTimeSelected = (value: BentoInputFieldValue) => {\n if (props.disabled || props.readonly) {\n return;\n }\n\n internalError.value = false;\n emit('update:model-value', String(value ?? ''));\n emit('input:valid');\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","MAX_TIME_INPUT_LENGTH","MINUTES_IN_A_DAY","MIN_TIME_INTERVAL","minutesToTimeString","minutes","hours","remainingMinutes","timeStringToSeconds","timeText","seconds","isValidTimeString","isValidTimeInterval","interval","generateTimeOptions","options","snapTimeToInterval","direction","intervalInSeconds","lastOptionInSeconds","totalSeconds","roundedSeconds","validateTimeInput","event","selectionStart","value","isAllowedKey","isValidKey","isValidColon","isAtMaxLength","formatTimeInputValue","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","timeDescription","hasTimeInterval","isTimeDropdown","timeItems","timeOption","nativeStep","watch","printDevelopmentWarning","validateTimeWithDebounce","debounce","isValid","newValue","onInput","nativeValue","shouldAppendSeconds","formatted","onKeyDown","onTimeSelected"],"mappings":";;;;;;;;;AAAA,MAAAA,KAAA,QAEAC,KAAA,WACAC,KAAA,iBAEAC,KAAA,GAEAC,IAAA,MACAC,KAAA,GAEAC,IAAA,CAAAC,MAAA;AACI,QAAAC,IAAA,KAAA,MAAAD,IAAA,EAAA,GACAE,IAAAF,IAAA;AACA,SAAA,GAAA,OAAAC,CAAA,EAAA,SAAA,GAAA,GAAA,CAAA,IAAA,OAAAC,CAAA,EAAA,SAAA,GAAA,GAAA,CAAA;AACJ,GAEAC,KAAA,CAAAC,MAAA;AACI,QAAA,CAAAH,GAAAD,GAAAK,CAAA,IAAAD,EAAA,MAAA,GAAA;AACA,SAAA,SAAAH,GAAA,EAAA,IAAA,OAAA,SAAAD,GAAA,EAAA,IAAA,KAAA,SAAAK,GAAA,EAAA;AACJ,GAQOC,IAAA,CAAAF,MAAA,8CAAA,K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,aAAA;AAAA,QAAkB,OAAA;AAElB,gBAAAyB,IAAA3C,GAAA,OAAAL,KAAA,EAAA,CAAA;AACA,UAAAuB,EAAA,sBAAAyB,CAAA,GACAP,EAAAO,CAAA;AAAA,QAAkC;AAAA,IACtC,GAGJC,IAAA,CAAAnD,MAAA;AACI,MAAAmB,EAAA,SACIpB,GAAAC,CAAA,GAEJyB,EAAA,WAAAzB,CAAA;AAAA,IAAqB,GAGzBoD,IAAA,CAAAlD,MAAA;AACI,MAAAqB,EAAA,YAAAA,EAAA,aAIAI,EAAA,QAAA,IACAF,EAAA,sBAAA,OAAAvB,KAAA,EAAA,CAAA,GACAuB,EAAA,aAAA;AAAA,IAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,100 @@
1
+ import { defineComponent as N, ref as S, toRef as c, computed as l, onBeforeUpdate as U, watch as O, provide as R, openBlock as C, createBlock as L, unref as a, mergeProps as k, withCtx as x, createElementVNode as K, withKeys as W, normalizeClass as g, createVNode as z } from "vue";
2
+ import { c as n, u as H, B as J } from "./filter-bar.BPPxuT_w.js";
3
+ import { B as Y } from "./input-field.B-Nta-en.js";
4
+ import { t as v } from "./truncate.DmCXQmeb.js";
5
+ import { I as $ } from "./button-actions.BYoctIth.js";
6
+ import { _ as j } from "./_plugin-vue_export-helper.CHgC5LLL.js";
7
+ import "../assets/input-with-dropdown-filter.css";
8
+ const q = {
9
+ name: "bento-input-with-dropdown-filter"
10
+ }, G = /* @__PURE__ */ N({
11
+ ...q,
12
+ props: {
13
+ disabled: { type: Boolean },
14
+ defaultValue: { default: void 0 },
15
+ field: {},
16
+ label: {},
17
+ onlySlot: { type: Boolean, default: !1 },
18
+ options: { default: void 0 },
19
+ value: { default: void 0 }
20
+ },
21
+ emits: [n.INPUT, n.UPDATE],
22
+ setup(f, { emit: b }) {
23
+ const e = f, u = b, i = S(null), { internalFilterValue: o, isSecondaryButtonDisabled: m, isApplyButtonDisabled: w } = H(c(e, "value"), c(e, "defaultValue")), V = l(() => {
24
+ const t = e.value?.dropdownValue ?? e.options?.dropdown?.modelValue;
25
+ if (!r.value || t === void 0 || t === null || !e.options?.dropdown?.items)
26
+ return null;
27
+ const s = e.options.dropdown.items.find((A) => A.value === t)?.label;
28
+ return s ? v(s, 12) : null;
29
+ }), y = l(() => e.label), r = l(
30
+ () => e.value?.inputValue ? v(e.value.inputValue, 12) : void 0
31
+ ), d = l(
32
+ () => o.value?.dropdownValue ?? e.options?.dropdown?.modelValue
33
+ ), _ = l(() => ({
34
+ ...e.options?.dropdown || {},
35
+ modelValue: d.value
36
+ })), B = l(() => ({
37
+ "b-input-with-dropdown-filter--only-slot": e.onlySlot
38
+ })), F = l(() => !(!!o.value?.inputValue && !!d.value) || w.value);
39
+ U(() => {
40
+ o.value?.inputValue === "" && (o.value = { ...o.value, inputValue: void 0 });
41
+ }), O(i, () => {
42
+ i.value?.focusInput();
43
+ });
44
+ const I = () => {
45
+ o.value = e.value;
46
+ }, p = () => {
47
+ !o.value?.inputValue && e.defaultValue !== null && (o.value = { ...e.defaultValue }), u(n.UPDATE, {
48
+ ...e,
49
+ value: o.value
50
+ });
51
+ }, P = () => u(n.UPDATE, { ...e, value: e.defaultValue }), T = () => {
52
+ o.value = null, p();
53
+ }, D = () => {
54
+ u(n.INPUT, { ...e, value: o.value });
55
+ }, h = (t) => {
56
+ o.value = { dropdownValue: d.value, inputValue: t };
57
+ }, E = (t) => {
58
+ o.value = { ...o.value, dropdownValue: t };
59
+ };
60
+ return R($, !0), (t, s) => (C(), L(a(J), k(t.$props, {
61
+ "applied-filters-count": V.value,
62
+ "button-label": y.value,
63
+ "button-secondary-label": r.value,
64
+ "disable-apply-button": F.value,
65
+ "disable-secondary-button": a(m),
66
+ "only-slot": t.onlySlot,
67
+ "tooltip-position": t.options?.tooltipPosition,
68
+ "tooltip-text": t.options?.tooltipText,
69
+ onApply: p,
70
+ onClear: T,
71
+ onOpen: I,
72
+ onReset: P
73
+ }), {
74
+ default: x(() => [
75
+ K("div", {
76
+ class: g(["b-input-with-dropdown-filter", B.value]),
77
+ onKeydown: W(p, ["enter"]),
78
+ onInput: D
79
+ }, [
80
+ z(a(Y), {
81
+ ref_key: "inputTextRef",
82
+ ref: i,
83
+ dropdown: _.value,
84
+ "dropdown-position": t.options?.dropdownPosition,
85
+ variant: "dropdown",
86
+ "model-value": a(o)?.inputValue,
87
+ disabled: t.disabled,
88
+ "onUpdate:modelValue": h,
89
+ onDropdownInput: E
90
+ }, null, 8, ["dropdown", "dropdown-position", "model-value", "disabled"])
91
+ ], 34)
92
+ ]),
93
+ _: 1
94
+ }, 16, ["applied-filters-count", "button-label", "button-secondary-label", "disable-apply-button", "disable-secondary-button", "only-slot", "tooltip-position", "tooltip-text"]));
95
+ }
96
+ }), te = /* @__PURE__ */ j(G, [["__scopeId", "data-v-ab9eca8c"]]);
97
+ export {
98
+ te as default
99
+ };
100
+ //# sourceMappingURL=input-with-dropdown-filter.DXnJOBf6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-with-dropdown-filter.DXnJOBf6.js","sources":["../../../vue2/src/components/filter-bar/components/input-with-dropdown-filter/input-with-dropdown-filter.vue"],"sourcesContent":["<template>\n <bento-base-filter\n v-bind=\"$props\"\n :applied-filters-count=\"selectedDropdownLabel\"\n :button-label=\"buttonLabel\"\n :button-secondary-label=\"buttonSecondaryLabel\"\n :disable-apply-button=\"shouldDisableApply\"\n :disable-secondary-button=\"isSecondaryButtonDisabled\"\n :only-slot=\"onlySlot\"\n :tooltip-position=\"options?.tooltipPosition\"\n :tooltip-text=\"options?.tooltipText\"\n @apply=\"updateFilter\"\n @clear=\"clearFilter\"\n @open=\"openFilter\"\n @reset=\"resetFilter\"\n >\n <div\n class=\"b-input-with-dropdown-filter\"\n :class=\"conditionalClasses\"\n @keydown.enter=\"updateFilter\"\n @input=\"onInput\"\n >\n <bento-input-field\n ref=\"inputTextRef\"\n :dropdown=\"dropdownOptions\"\n :dropdown-position=\"options?.dropdownPosition\"\n variant=\"dropdown\"\n :model-value=\"internalFilterValue?.inputValue\"\n :disabled=\"disabled\"\n @update:model-value=\"setInternalFilterValue\"\n @dropdown-input=\"onDropdownInput\"\n />\n </div>\n </bento-base-filter>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onBeforeUpdate, provide, ref, toRef, watch } from 'vue';\n import { BentoBaseFilter, useBaseFilter } from '../base-filter';\n import {\n BentoFilterEvent,\n type BentoInputWithDropdownFilterOptions,\n type BentoInpuWithDropdowntFilterValue,\n } from '../../filter-bar.types';\n import { type BentoInputDropdownProps, BentoInputField } from '@/components/input-field';\n import { truncate } from '@/utils/ts/truncate';\n import { type BentoListboxSelectedValue } from '@/types/listbox';\n import { INPUT_FILTER_WITH_DROPDOWN_POPOVER_INJECTION_KEY } from '@/components/filter-bar/components/input-with-dropdown-filter/input-with-dropdown-filter.keys';\n\n const props = withDefaults(\n defineProps<{\n /**\n * Disables the filter from being interacted with.\n */\n disabled?: boolean;\n\n /**\n * Default value of the filter to reset to.\n */\n defaultValue?: BentoInpuWithDropdowntFilterValue;\n\n /**\n * Filter name/key referencing the actual property name in the data set.\n * Should be unique per filter bar.\n */\n field: string;\n\n /**\n * Label text to be displayed\n */\n label: string;\n\n /**\n * Renders the base filter's slot content only - leaving out the button and the popover.\n * Used for the allFiltersModal component.\n */\n onlySlot?: boolean;\n\n /**\n * List of options that are needed to setup the filter\n * Available options:\n * - dropdown: all the dropdown properties that can be set in the inner dropdown of the input field. @see BentoDropdown for more info.\n * - dropdownPosition: allow the user to set the dropdown on the left or right side. Accepts the `start` or `end` values.\n * - tooltipPosition: The position of the tooltip attached to the filter button\n * - tooltipText: The content of the tooltip attached to the filter button\n */\n options?: BentoInputWithDropdownFilterOptions;\n\n /**\n * Current value of the filter.\n * If the options.variant is equal to 'dropdown', the value should be of type should be `{ inputValue: string | null; dropdownValue?: string }`.\n */\n value?: BentoInpuWithDropdowntFilterValue;\n }>(),\n {\n defaultValue: undefined,\n onlySlot: false,\n options: undefined,\n value: undefined,\n }\n );\n\n const emit = defineEmits([BentoFilterEvent.INPUT, BentoFilterEvent.UPDATE]);\n\n const inputTextRef = ref(null);\n const { internalFilterValue, isSecondaryButtonDisabled, isApplyButtonDisabled } =\n useBaseFilter<BentoInpuWithDropdowntFilterValue>(toRef(props, 'value'), toRef(props, 'defaultValue'));\n\n const selectedDropdownLabel = computed(() => {\n const selectedValue = props.value?.dropdownValue ?? props.options?.dropdown?.modelValue;\n\n if (\n !buttonSecondaryLabel.value ||\n selectedValue === undefined ||\n selectedValue === null ||\n !props.options?.dropdown?.items\n ) {\n return null;\n }\n\n const label = props.options.dropdown.items.find(item => item.value === selectedValue)?.label;\n\n return label ? truncate(label, 12) : null;\n });\n\n const buttonLabel = computed(() => props.label);\n\n const buttonSecondaryLabel = computed(() =>\n props.value?.inputValue ? truncate(props.value.inputValue, 12) : undefined\n );\n\n const dropdownSelection = computed(\n () => internalFilterValue.value?.dropdownValue ?? props.options?.dropdown?.modelValue\n );\n\n const dropdownOptions = computed<BentoInputDropdownProps>(() => ({\n ...((props.options?.dropdown || {}) as BentoInputDropdownProps),\n modelValue: dropdownSelection.value,\n }));\n\n const conditionalClasses = computed(() => ({\n [`b-input-with-dropdown-filter--only-slot`]: props.onlySlot,\n }));\n\n const shouldDisableApply = computed(() => {\n const allFieldsAreSet = !!internalFilterValue.value?.inputValue && !!dropdownSelection.value;\n return !allFieldsAreSet || isApplyButtonDisabled.value;\n });\n\n onBeforeUpdate(() => {\n // Set value to null when the string is empty\n if (internalFilterValue.value?.inputValue === '') {\n internalFilterValue.value = { ...internalFilterValue.value, inputValue: undefined };\n }\n });\n\n watch(inputTextRef, () => {\n // Focus on the input when it's opened\n inputTextRef.value?.focusInput();\n });\n\n const openFilter = () => {\n internalFilterValue.value = props.value;\n };\n\n const updateFilter = () => {\n if (!internalFilterValue.value?.inputValue && props.defaultValue !== null) {\n // If value set to empty, reset back to default value\n internalFilterValue.value = { ...props.defaultValue };\n }\n\n emit(BentoFilterEvent.UPDATE, {\n ...props,\n value: internalFilterValue.value,\n });\n };\n\n const resetFilter = () => emit(BentoFilterEvent.UPDATE, { ...props, value: props.defaultValue });\n\n const clearFilter = () => {\n internalFilterValue.value = null;\n updateFilter();\n };\n\n const onInput = () => {\n emit(BentoFilterEvent.INPUT, { ...props, value: internalFilterValue.value });\n };\n\n const setInternalFilterValue = (event: string) => {\n internalFilterValue.value = { dropdownValue: dropdownSelection.value, inputValue: event };\n };\n\n const onDropdownInput = (selectedValue: BentoListboxSelectedValue) => {\n internalFilterValue.value = { ...internalFilterValue.value, dropdownValue: selectedValue };\n };\n\n // We need to change the base filter's popover to have overflow visible so the dropdown options is\n // not hidden inside the filter when opened.\n provide(INPUT_FILTER_WITH_DROPDOWN_POPOVER_INJECTION_KEY, true);\n</script>\n\n<script lang=\"ts\">\n /**\n *\n */\n export default {\n name: 'bento-input-with-dropdown-filter',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-with-dropdown-filter.scss\" />\n"],"names":["__default__","props","__props","emit","__emit","inputTextRef","ref","internalFilterValue","isSecondaryButtonDisabled","isApplyButtonDisabled","useBaseFilter","toRef","selectedDropdownLabel","computed","selectedValue","buttonSecondaryLabel","label","item","truncate","buttonLabel","dropdownSelection","dropdownOptions","conditionalClasses","shouldDisableApply","onBeforeUpdate","watch","openFilter","updateFilter","BentoFilterEvent","resetFilter","clearFilter","onInput","setInternalFilterValue","event","onDropdownInput","provide","INPUT_FILTER_WITH_DROPDOWN_POPOVER_INJECTION_KEY"],"mappings":";;;;;;;AA6MI,MAAAA,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;AA9JA,UAAAC,IAAAC,GAqDAC,IAAAC,GAEAC,IAAAC,EAAA,IAAA,GACA,EAAA,qBAAAC,GAAA,2BAAAC,GAAA,uBAAAC,EAAA,IAAAC,EAAAC,EAAAV,GAAA,OAAA,GAAAU,EAAAV,GAAA,cAAA,CAA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IM,EAAA,QAAA,EAAA,GAAAN,EAAA,aAAA,IAGJE,EAAAyB,EAAA,QAAA;AAAA,QAA8B,GAAA3B;AAAA,QACvB,OAAAM,EAAA;AAAA,MACwB,CAAA;AAAA,IAC9B,GAGLsB,IAAA,MAAA1B,EAAAyB,EAAA,QAAA,EAAA,GAAA3B,GAAA,OAAAA,EAAA,aAAA,CAAA,GAEA6B,IAAA,MAAA;AACI,MAAAvB,EAAA,QAAA,MACAoB,EAAA;AAAA,IAAa,GAGjBI,IAAA,MAAA;AACI,MAAA5B,EAAAyB,EAAA,OAAA,EAAA,GAAA3B,GAAA,OAAAM,EAAA,MAAA,CAAA;AAAA,IAA2E,GAG/EyB,IAAA,CAAAC,MAAA;AACI,MAAA1B,EAAA,QAAA,EAAA,eAAAa,EAAA,OAAA,YAAAa,EAAA;AAAA,IAAwF,GAG5FC,IAAA,CAAApB,MAAA;AACI,MAAAP,EAAA,QAAA,EAAA,GAAAA,EAAA,OAAA,eAAAO,EAAA;AAAA,IAAyF;AAK7F,WAAAqB,EAAAC,GAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as n, openBlock as r, createBlock as p, unref as t, createSlots as c, withCtx as o, createElementVNode as a, createVNode as s, renderSlot as l, createTextVNode as d, toDisplayString as _ } from "vue";
2
2
  import { B as i } from "./typography.B6elnWpr.js";
3
- import { F as g } from "./footer-actions.BJif4sIk.js";
3
+ import { F as g } from "./footer-actions.B2dxp-b_.js";
4
4
  import { D as f } from "./dialog-page.CHpFuDd9.js";
5
5
  import { _ as m } from "./_plugin-vue_export-helper.CHgC5LLL.js";
6
6
  import "../assets/inspector-page.css";
@@ -64,4 +64,4 @@ export {
64
64
  N as B,
65
65
  V as i
66
66
  };
67
- //# sourceMappingURL=inspector-page.DNsc0lK1.js.map
67
+ //# sourceMappingURL=inspector-page.Bd39LxR2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"inspector-page.DNsc0lK1.js","sources":["../../../vue2/src/components/inspector/inspector.types.ts"],"sourcesContent":["export const BentoInspectorSizeOptions = ['small', 'large'] as const;\n\nexport type BentoInspectorRelativeLayout = 'push-content' | 'overlay-content';\n\nexport type BentoInspectorSize = (typeof BentoInspectorSizeOptions)[number];\n\nexport interface BentoInspectorProps {\n /**\n * ID of the current active inspector page\n */\n activePage?: string;\n\n /**\n * Shows the Expand icon in the inspector\n */\n expandable?: boolean;\n\n /**\n * Opens and closes the inspector\n */\n isOpen?: boolean;\n\n /**\n * Shows loading indicator for the content\n */\n loading?: boolean;\n\n /**\n * Determines the size of the inspector\n */\n size?: BentoInspectorSize;\n\n /**\n * The title of the component.\n * Used for accessibility and the single page inspector.\n * When using `bento-inspector-page` this title is only used for accessibility purposes\n */\n title: string;\n\n /**\n * The appearance of the inspector relative to the main content. Defaults to `push-content`.\n *\n * - `push-content`: The inspector pushes the main content to the side, resizing it to fit.\n * - `overlay-content`: The inspector opens on top of the main content, without affecting its layout.\n */\n relativeLayout?: BentoInspectorRelativeLayout;\n\n /**\n * An optional HTMLElement to focus on when returning focus from the inspector\n * to the main page content (e.g. via the `Ctrl+Shift+S` keyboard shortcut).\n *\n * By default, the inspector attempts to return focus to the element that was active before it opened.\n * However, if that trigger element is removed from the DOM (e.g., via a `v-if`), focus cannot be returned.\n *\n * Providing a `pageFocusAnchor` (e.g. role=\"gridcell\") ensures that the\n * focus context is preserved for accessibility.\n */\n pageFocusAnchor?: HTMLElement;\n}\n"],"names":["BentoInspectorSizeOptions"],"mappings":";;;;;;AAAO,MAAAA,IAAA,CAAA,SAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"inspector-page.Bd39LxR2.js","sources":["../../../vue2/src/components/inspector/inspector.types.ts"],"sourcesContent":["export const BentoInspectorSizeOptions = ['small', 'large'] as const;\n\nexport type BentoInspectorRelativeLayout = 'push-content' | 'overlay-content';\n\nexport type BentoInspectorSize = (typeof BentoInspectorSizeOptions)[number];\n\nexport interface BentoInspectorProps {\n /**\n * ID of the current active inspector page\n */\n activePage?: string;\n\n /**\n * Shows the Expand icon in the inspector\n */\n expandable?: boolean;\n\n /**\n * Opens and closes the inspector\n */\n isOpen?: boolean;\n\n /**\n * Shows loading indicator for the content\n */\n loading?: boolean;\n\n /**\n * Determines the size of the inspector\n */\n size?: BentoInspectorSize;\n\n /**\n * The title of the component.\n * Used for accessibility and the single page inspector.\n * When using `bento-inspector-page` this title is only used for accessibility purposes\n */\n title: string;\n\n /**\n * The appearance of the inspector relative to the main content. Defaults to `push-content`.\n *\n * - `push-content`: The inspector pushes the main content to the side, resizing it to fit.\n * - `overlay-content`: The inspector opens on top of the main content, without affecting its layout.\n */\n relativeLayout?: BentoInspectorRelativeLayout;\n\n /**\n * An optional HTMLElement to focus on when returning focus from the inspector\n * to the main page content (e.g. via the `Ctrl+Shift+S` keyboard shortcut).\n *\n * By default, the inspector attempts to return focus to the element that was active before it opened.\n * However, if that trigger element is removed from the DOM (e.g., via a `v-if`), focus cannot be returned.\n *\n * Providing a `pageFocusAnchor` (e.g. role=\"gridcell\") ensures that the\n * focus context is preserved for accessibility.\n */\n pageFocusAnchor?: HTMLElement;\n}\n"],"names":["BentoInspectorSizeOptions"],"mappings":";;;;;;AAAO,MAAAA,IAAA,CAAA,SAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import { ref as r, watch as K, defineComponent as oe, computed as g, provide as
2
2
  import { d as le, B as pe } from "./typography.B6elnWpr.js";
3
3
  import { B as I } from "./button.DAcwNdtP.js";
4
4
  import { B as ue } from "./loading-indicator.BPol9I84.js";
5
- import { B as de, s as fe, g as ve, f as _e, a as ge } from "./focus-trap.Co-S6goa.js";
5
+ import { B as de, s as fe, g as ve, f as _e, a as ge } from "./focus-trap.BgyHTR_3.js";
6
6
  import { _ as me } from "./expand.DLj-Pjwb.js";
7
7
  import { _ as Ce } from "./cross.Daa8LxjC.js";
8
8
  import { g as he } from "./generate-uid.DBWe4g6T.js";
@@ -232,4 +232,4 @@ const Y = {
232
232
  export {
233
233
  je as B
234
234
  };
235
- //# sourceMappingURL=inspector.BLAqbhmV.js.map
235
+ //# sourceMappingURL=inspector.SmoWfjqp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"inspector.BLAqbhmV.js","sources":["../../../vue2/src/components/inspector/composables/use-focus-history/use-focus-history.ts","../../../vue2/src/components/inspector/inspector.vue"],"sourcesContent":["import { ref, type Ref } from 'vue';\nimport { useActiveElement } from '@vueuse/core';\nimport { watch } from 'vue';\n\n/**\n * A composable to track the focus history within a target element.\n * @param targetEl The stable parent element to monitor for focus changes.\n */\nexport function useFocusHistory(targetEl: Ref<HTMLElement | null>) {\n const MAX_HISTORY_LENGTH = 3;\n\n const focusHistory = ref<Array<Element>>([]);\n\n const currentActiveElement = useActiveElement();\n\n // Edge case 1:\n // While the inspector is opened, if user tabs through the data-grid to the inspector, and closes it,\n // it returns to the last element on the data grid regardless if it is a data-grid-cell.\n //\n // Edge case 2:\n // Buttons or actions teleported out of the data-grid may have the focus shifted into a different context.\n watch(currentActiveElement, newlyFocusedElement => {\n // Check if the newly focused element is a child of our target container.\n if (!targetEl.value || !newlyFocusedElement || !targetEl.value.contains(newlyFocusedElement)) {\n return;\n }\n\n // Add the focused element to the history\n focusHistory.value.unshift(newlyFocusedElement);\n\n if (focusHistory.value.length > MAX_HISTORY_LENGTH) {\n focusHistory.value.pop();\n }\n });\n\n /**\n * Iterates through the focus history to find the first valid element\n * that is still present in the DOM.\n * @returns The first valid historical element, or null if none are found.\n */\n const findValidFocusFallback = (): HTMLElement | null => {\n for (const el of focusHistory.value) {\n if (el && document.body.contains(el as Node)) {\n return el as HTMLElement;\n }\n }\n\n return null; // No valid fallback found\n };\n\n return {\n findValidFocusFallback,\n };\n}\n","<template>\n <div ref=\"wrapper\" class=\"b-inspector\" :class=\"conditionalClass\" @keydown=\"handleSectionFocus\">\n <div ref=\"page\" class=\"b-inspector__page-wrapper\">\n <div class=\"b-inspector__page\">\n <slot name=\"page\"></slot>\n </div>\n </div>\n <Transition name=\"b-inspector__animation\" mode=\"out-in\" @before-enter=\"setFocus\" @after-leave=\"setFocus\">\n <aside\n v-if=\"isOpen\"\n ref=\"inspector\"\n class=\"b-inspector__container-wrapper\"\n :aria-label=\"inspectorAriaLabel\"\n @keydown.tab=\"handleTabNavigation\"\n >\n <bento-focus-trap :disabled=\"!isCompact\" class=\"b-inspector__focus-trap\">\n <div class=\"b-inspector__container\" :class=\"computedContainerClasses\">\n <template v-if=\"!isCompact\">\n <bento-button\n ref=\"returnContentButton\"\n class=\"b-inspector__return-content\"\n variant=\"secondary\"\n condensed\n :aria-describedby=\"returnToMainContentDescriptionId\"\n @click=\"moveFocusBetweenSections\"\n >\n {{ t('returnToMainContent') }}\n </bento-button>\n <span\n :id=\"returnToMainContentDescriptionId\"\n class=\"b-inspector__return-content-description\"\n >\n {{ t('returnToMainContentDescription') }}\n </span>\n </template>\n <div v-if=\"pages.length === 0\" class=\"b-inspector__header\">\n <bento-typography el=\"h2\" variant=\"title\" class=\"b-inspector__title\">\n {{ title }}\n </bento-typography>\n </div>\n <div class=\"b-inspector__content\">\n <bento-loading-indicator v-if=\"loading\" large class=\"b-inspector__loading-indicator\" />\n <slot v-else name=\"content\"></slot>\n </div>\n <div class=\"b-inspector__icons\">\n <bento-button\n v-if=\"expandable\"\n ref=\"expandButton\"\n variant=\"tertiary\"\n :aria-label=\"t('expand')\"\n @click=\"emit('expand')\"\n >\n <template #iconLeft>\n <expand-icon aria-hidden=\"true\" />\n </template>\n </bento-button>\n <bento-button\n ref=\"closeButton\"\n :aria-label=\"t('close')\"\n variant=\"tertiary\"\n @click=\"emit('update:is-open', false)\"\n >\n <template #iconLeft>\n <cross-icon aria-hidden=\"true\" />\n </template>\n </bento-button>\n </div>\n </div>\n </bento-focus-trap>\n </aside>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, provide, ref, toRef, watch } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoButton } from '@/components/button';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import ExpandIcon from '@adyen/ui-assets-icons-16/vue/expand';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useI18n } from '@/utils/ts/i18n';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useElementSize } from '@vueuse/core';\n import moveFocusInside, { focusInside, getActiveElement, getFocusableIn } from 'focus-lock';\n\n import { type BentoInspectorProps } from './inspector.types';\n import { useFocusHistory } from './composables/use-focus-history/use-focus-history';\n import {\n DIALOG_PAGE_CONFIG_INJECTION_KEY,\n DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY,\n } from '@/internal/dialog-page/dialog-page.keys';\n import {\n BentoDialogPageAnimation,\n type BentoDialogPageConfigData,\n type BentoDialogPageRegisterPage,\n } from '@/internal/dialog-page/dialog-page.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(defineProps<BentoInspectorProps>(), {\n activePage: '',\n expandable: false,\n isOpen: false,\n loading: false,\n size: 'small',\n relativeLayout: 'push-content',\n pageFocusAnchor: null,\n });\n\n const emit = defineEmits<{\n /**\n * Emits update to keep isOpen prop in sync\n */\n (e: 'update:is-open', value: boolean): void;\n /**\n * Emits update to keep activePage prop in sync\n */\n (e: 'update:active-page', value: string): void;\n /**\n * Emits event when user click expand button\n */\n (e: 'expand'): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const returnToMainContentDescriptionId = generateUid('returnToMainContentDescription');\n const wrapper = ref<HTMLElement>(null);\n const inspector = ref<HTMLElement>(null);\n const page = ref<HTMLElement>(null);\n // These refs allow keyboard navigation to follow the intended order independently of the DOM order.\n const returnContentButton = ref(null);\n const expandButton = ref(null);\n const closeButton = ref(null);\n const inspectorLastFocusedElement = ref<HTMLElement>(null);\n const internalActivePage = ref(props.activePage);\n\n // Multiple page navigation\n const pages = ref<Array<string>>([]);\n const previousPages = ref([]);\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n const isAnimationActive = ref(false);\n\n const { width: wrapperWidth } = useElementSize(wrapper);\n const computedContainerClasses = computed(() => {\n return {\n 'b-inspector__container--padded': pages.value.length === 0, // No pages are registered\n };\n });\n\n const isCompact = computed(() => {\n const COMPACT_THRESHOLD_SMALL = 740;\n const COMPACT_THRESHOLD_LARGE = 915;\n\n // small inspector to occupy full screen if < 740px\n // large inspector to occupy full screen if < 915px\n const threshold = props.size === 'small' ? COMPACT_THRESHOLD_SMALL : COMPACT_THRESHOLD_LARGE;\n\n return wrapperWidth.value > 0 && wrapperWidth.value < threshold;\n });\n\n const computedPageLastFocusedElement = computed(() => props.pageFocusAnchor);\n\n const conditionalClass = computed(() => ({\n [`b-inspector--${props.size}`]: true,\n [`b-inspector--${props.relativeLayout}`]: true,\n [`b-inspector--is-compact`]: isCompact.value,\n [`b-inspector--multi-paged`]: pages.value.length,\n }));\n\n const inspectorAriaLabel = computed(() => `${t('inspector')}, ${props.title}`);\n\n const { findValidFocusFallback } = useFocusHistory(page);\n\n /**\n * Returns the Inspector's intended tab order.\n *\n * The content must remain before the icon buttons in the DOM for the Inspector animations,\n * so the keyboard order is managed separately. The return button is omitted automatically in compact mode.\n */\n const getOrderedFocusableElements = () => {\n const navigationButtons = [\n returnContentButton.value?.$el,\n expandButton.value?.$el,\n closeButton.value?.$el,\n ].filter(Boolean) as Array<HTMLElement>;\n const contentFocusableElements = getFocusableIn(inspector.value)\n .map(({ node }) => node)\n .filter(element => !navigationButtons.includes(element));\n\n return [...navigationButtons, ...contentFocusableElements];\n };\n\n const setFocus = async () => {\n if (props.isOpen) {\n await nextTick();\n if (isCompact.value) {\n // The compact focus trap uses DOM order when it initially moves focus.\n // Explicitly focus the first ordered control so content does not skip the icon buttons.\n focusElement(getOrderedFocusableElements()[0]);\n } else {\n moveFocusInside(inspector.value, computedPageLastFocusedElement.value);\n }\n } else {\n // This doesn't work with data grid cell actions, as the button gets destroyed once is not being hovered.\n // To be reviewed after LevelAccess revision\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n }\n };\n\n const handleTabNavigation = (event: KeyboardEvent) => {\n // Prevent the browser's DOM-based tab order and use the Inspector-specific order instead.\n const direction = event.shiftKey ? -1 : 1;\n const focusableElements = getOrderedFocusableElements();\n const currentIndex = focusableElements.indexOf(getActiveElement());\n const nextIndex = currentIndex + direction;\n\n // Compact inspectors trap focus, so navigation should wrap around instead of returning focus to the page.\n if (isCompact.value && focusableElements.length > 0) {\n event.preventDefault();\n focusableElements[(nextIndex + focusableElements.length) % focusableElements.length].focus();\n return;\n }\n\n const focusableEl = focusableElements[nextIndex];\n\n // At either end of the Inspector, return focus to the page.\n if (!focusableEl) {\n event.preventDefault();\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n return;\n }\n\n event.preventDefault();\n focusableEl.focus();\n };\n\n const handleSectionFocus = event => {\n const sectionShortcut = event.shiftKey && event.ctrlKey && event.key === 'S';\n if (props.isOpen && !isCompact.value && sectionShortcut) {\n moveFocusBetweenSections();\n }\n };\n\n const moveFocusBetweenSections = () => {\n if (focusInside(inspector.value)) {\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n } else {\n focusElement(inspectorLastFocusedElement.value);\n }\n };\n\n const focusElement = (element: HTMLElement) => {\n if (!element) {\n return;\n }\n element?.focus();\n if (document.activeElement !== element) {\n focusElement(element.parentElement);\n }\n };\n\n /**\n * Multiple page navigation and page registration\n */\n\n const updatePage = page => emit('update:active-page', page);\n\n // unregister page if removed / destroyed\n const unregisterPage = (pageIdToRemove: string) => () => {\n pages.value = pages.value?.filter(pageId => pageId !== pageIdToRemove);\n };\n\n const registerPage: BentoDialogPageRegisterPage = pageId => {\n pages.value.push(pageId);\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage: internalActivePage,\n animation,\n isAnimationActive,\n isOpen: toRef(props, 'isOpen'),\n pages,\n previousPages,\n updatePage,\n });\n\n provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n\n watch(\n () => props.activePage,\n () => {\n if (props.activePage) {\n internalActivePage.value = props.activePage;\n setFocus();\n }\n }\n );\n\n if (!props.activePage) {\n deprecate(\n 'BentoInspector \"active-page\" as optional',\n `Make sure to set the \"active-page\" prop and keep it in sync with \"update:active-page\".\n \"active-page\" prop will be required in the next version`,\n '3.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Inspector allows users to access additional information or details of an object/item. The inspector opens adjacent to the main content, pushing it aside to maintain visibility and accessibility to both the main content and inspector.\n *\n * @example\n * import { BentoInspector } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoInspector },\n * template: `\n * <bento-inspector\n * title=\"Inspector\"\n * size=\"large\"\n * :is-open=\"isOpen\"\n * :active-page=\"activePage\"\n * expandable\n * @update:is-open=\"isOpen = $event\"\n * @update:active-page=\"activePage = $event\"\n * >\n * <template #page>Content of the page</template>\n * <template #content>Content of the inspector</template>\n * </bento-inspector>\n * `\n * }\n */\n export default { i18n: { messages } };\n</script>\n\n<style lang=\"scss\" scoped src=\"./inspector.scss\" />\n"],"names":["useFocusHistory","targetEl","focusHistory","ref","currentActiveElement","useActiveElement","watch","newlyFocusedElement","el","__default__","messages","props","__props","emit","__emit","t","useI18n","returnToMainContentDescriptionId","generateUid","wrapper","inspector","page","returnContentButton","expandButton","closeButton","inspectorLastFocusedElement","internalActivePage","pages","previousPages","animation","BentoDialogPageAnimation","isAnimationActive","wrapperWidth","useElementSize","computedContainerClasses","computed","isCompact","threshold","computedPageLastFocusedElement","conditionalClass","inspectorAriaLabel","findValidFocusFallback","getOrderedFocusableElements","navigationButtons","contentFocusableElements","getFocusableIn","node","element","setFocus$1","nextTick","focusElement","setFocus","handleTabNavigation","event","direction","focusableElements","nextIndex","getActiveElement","focusableEl","handleSectionFocus","sectionShortcut","moveFocusBetweenSections","focusInside","updatePage","page2","unregisterPage","pageIdToRemove","pageId","registerPage","provide","DIALOG_PAGE_CONFIG_INJECTION_KEY","toRef","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY","deprecate"],"mappings":";;;;;;;;;;;;;AAQO,SAAAA,GAAAC,GAAA;AAGH,QAAAC,IAAAC,EAAA,CAAA,CAAA,GAEAC,IAAAC,GAAA;AAQA,SAAAC,EAAAF,GAAA,CAAAG,MAAA;AAEI,IAAA,CAAAN,EAAA,SAAA,CAAAM,KAAA,CAAAN,EAAA,MAAA,SAAAM,CAAA,MAKAL,EAAA,MAAA,QAAAK,CAAA,GAEAL,EAAA,MAAA,SAAA,KACIA,EAAA,MAAA,IAAA;AAAA,EACJ,CAAA,GAkBJ;AAAA,IAAO,wBAVP,MAAA;AACI,iBAAAM,KAAAN,EAAA;AACI,YAAAM,KAAA,SAAA,KAAA,SAAAA,CAAA;AACI,iBAAAA;AAIR,aAAA;AAAA,IAAO;AAAA,EAIP;AAER;;;;;;;;;;;;;;;;iFCsSIC,KAAA,EAAA,MAAA,EAAA,UAAAC,EAAA,EAAA;;;;;;;;;;;;;;;AAlPA,UAAAC,IAAAC,GAUAC,IAAAC,GAeA,EAAA,GAAAC,EAAA,IAAAC,GAAA,EAAA,UAAAN,EAAA,CAAA,GACAO,IAAAC,GAAA,gCAAA,GACAC,IAAAhB,EAAA,IAAA,GACAiB,IAAAjB,EAAA,IAAA,GACAkB,IAAAlB,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aAAA;AAAA,IACJ,GAOJgB,KAAA,CAAAC,MAAAnD,EAAA,sBAAAmD,CAAA,GAGAC,KAAA,CAAAC,MAAA,MAAA;AACI,MAAAvC,EAAA,QAAAA,EAAA,OAAA,OAAA,CAAAwC,MAAAA,MAAAD,CAAA;AAAA,IAAqE,GAGzEE,KAAA,CAAAD,OACIxC,EAAA,MAAA,KAAAwC,CAAA,GAEA,EAAA,gBAAAF,GAAAE,CAAA,EAAA;AAGJ,WAAAE,EAAAC,IAAA;AAAA,MAAqE,YAAA5C;AAAA,MACrD,WAAAG;AAAA,MACZ,mBAAAE;AAAA,MACA,QAAAwC,GAAA5D,GAAA,QAAA;AAAA,MAC6B,OAAAgB;AAAA,MAC7B,eAAAC;AAAA,MACA,YAAAmC;AAAA,IACA,CAAA,GAGJM,EAAAG,IAAAJ,EAAA,GAEA9D;AAAA,MAAA,MAAAK,EAAA;AAAA,MACgB,MAAA;AAER,QAAAA,EAAA,eACIe,EAAA,QAAAf,EAAA,YACAqC,EAAA;AAAA,MACJ;AAAA,IACJ,GAGJrC,EAAA,cACI8D;AAAA,MAAA;AAAA,MACI;AAAA;AAAA,MACA;AAAA,IAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"inspector.SmoWfjqp.js","sources":["../../../vue2/src/components/inspector/composables/use-focus-history/use-focus-history.ts","../../../vue2/src/components/inspector/inspector.vue"],"sourcesContent":["import { ref, type Ref } from 'vue';\nimport { useActiveElement } from '@vueuse/core';\nimport { watch } from 'vue';\n\n/**\n * A composable to track the focus history within a target element.\n * @param targetEl The stable parent element to monitor for focus changes.\n */\nexport function useFocusHistory(targetEl: Ref<HTMLElement | null>) {\n const MAX_HISTORY_LENGTH = 3;\n\n const focusHistory = ref<Array<Element>>([]);\n\n const currentActiveElement = useActiveElement();\n\n // Edge case 1:\n // While the inspector is opened, if user tabs through the data-grid to the inspector, and closes it,\n // it returns to the last element on the data grid regardless if it is a data-grid-cell.\n //\n // Edge case 2:\n // Buttons or actions teleported out of the data-grid may have the focus shifted into a different context.\n watch(currentActiveElement, newlyFocusedElement => {\n // Check if the newly focused element is a child of our target container.\n if (!targetEl.value || !newlyFocusedElement || !targetEl.value.contains(newlyFocusedElement)) {\n return;\n }\n\n // Add the focused element to the history\n focusHistory.value.unshift(newlyFocusedElement);\n\n if (focusHistory.value.length > MAX_HISTORY_LENGTH) {\n focusHistory.value.pop();\n }\n });\n\n /**\n * Iterates through the focus history to find the first valid element\n * that is still present in the DOM.\n * @returns The first valid historical element, or null if none are found.\n */\n const findValidFocusFallback = (): HTMLElement | null => {\n for (const el of focusHistory.value) {\n if (el && document.body.contains(el as Node)) {\n return el as HTMLElement;\n }\n }\n\n return null; // No valid fallback found\n };\n\n return {\n findValidFocusFallback,\n };\n}\n","<template>\n <div ref=\"wrapper\" class=\"b-inspector\" :class=\"conditionalClass\" @keydown=\"handleSectionFocus\">\n <div ref=\"page\" class=\"b-inspector__page-wrapper\">\n <div class=\"b-inspector__page\">\n <slot name=\"page\"></slot>\n </div>\n </div>\n <Transition name=\"b-inspector__animation\" mode=\"out-in\" @before-enter=\"setFocus\" @after-leave=\"setFocus\">\n <aside\n v-if=\"isOpen\"\n ref=\"inspector\"\n class=\"b-inspector__container-wrapper\"\n :aria-label=\"inspectorAriaLabel\"\n @keydown.tab=\"handleTabNavigation\"\n >\n <bento-focus-trap :disabled=\"!isCompact\" class=\"b-inspector__focus-trap\">\n <div class=\"b-inspector__container\" :class=\"computedContainerClasses\">\n <template v-if=\"!isCompact\">\n <bento-button\n ref=\"returnContentButton\"\n class=\"b-inspector__return-content\"\n variant=\"secondary\"\n condensed\n :aria-describedby=\"returnToMainContentDescriptionId\"\n @click=\"moveFocusBetweenSections\"\n >\n {{ t('returnToMainContent') }}\n </bento-button>\n <span\n :id=\"returnToMainContentDescriptionId\"\n class=\"b-inspector__return-content-description\"\n >\n {{ t('returnToMainContentDescription') }}\n </span>\n </template>\n <div v-if=\"pages.length === 0\" class=\"b-inspector__header\">\n <bento-typography el=\"h2\" variant=\"title\" class=\"b-inspector__title\">\n {{ title }}\n </bento-typography>\n </div>\n <div class=\"b-inspector__content\">\n <bento-loading-indicator v-if=\"loading\" large class=\"b-inspector__loading-indicator\" />\n <slot v-else name=\"content\"></slot>\n </div>\n <div class=\"b-inspector__icons\">\n <bento-button\n v-if=\"expandable\"\n ref=\"expandButton\"\n variant=\"tertiary\"\n :aria-label=\"t('expand')\"\n @click=\"emit('expand')\"\n >\n <template #iconLeft>\n <expand-icon aria-hidden=\"true\" />\n </template>\n </bento-button>\n <bento-button\n ref=\"closeButton\"\n :aria-label=\"t('close')\"\n variant=\"tertiary\"\n @click=\"emit('update:is-open', false)\"\n >\n <template #iconLeft>\n <cross-icon aria-hidden=\"true\" />\n </template>\n </bento-button>\n </div>\n </div>\n </bento-focus-trap>\n </aside>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, provide, ref, toRef, watch } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoButton } from '@/components/button';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import ExpandIcon from '@adyen/ui-assets-icons-16/vue/expand';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useI18n } from '@/utils/ts/i18n';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useElementSize } from '@vueuse/core';\n import moveFocusInside, { focusInside, getActiveElement, getFocusableIn } from 'focus-lock';\n\n import { type BentoInspectorProps } from './inspector.types';\n import { useFocusHistory } from './composables/use-focus-history/use-focus-history';\n import {\n DIALOG_PAGE_CONFIG_INJECTION_KEY,\n DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY,\n } from '@/internal/dialog-page/dialog-page.keys';\n import {\n BentoDialogPageAnimation,\n type BentoDialogPageConfigData,\n type BentoDialogPageRegisterPage,\n } from '@/internal/dialog-page/dialog-page.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(defineProps<BentoInspectorProps>(), {\n activePage: '',\n expandable: false,\n isOpen: false,\n loading: false,\n size: 'small',\n relativeLayout: 'push-content',\n pageFocusAnchor: null,\n });\n\n const emit = defineEmits<{\n /**\n * Emits update to keep isOpen prop in sync\n */\n (e: 'update:is-open', value: boolean): void;\n /**\n * Emits update to keep activePage prop in sync\n */\n (e: 'update:active-page', value: string): void;\n /**\n * Emits event when user click expand button\n */\n (e: 'expand'): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const returnToMainContentDescriptionId = generateUid('returnToMainContentDescription');\n const wrapper = ref<HTMLElement>(null);\n const inspector = ref<HTMLElement>(null);\n const page = ref<HTMLElement>(null);\n // These refs allow keyboard navigation to follow the intended order independently of the DOM order.\n const returnContentButton = ref(null);\n const expandButton = ref(null);\n const closeButton = ref(null);\n const inspectorLastFocusedElement = ref<HTMLElement>(null);\n const internalActivePage = ref(props.activePage);\n\n // Multiple page navigation\n const pages = ref<Array<string>>([]);\n const previousPages = ref([]);\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n const isAnimationActive = ref(false);\n\n const { width: wrapperWidth } = useElementSize(wrapper);\n const computedContainerClasses = computed(() => {\n return {\n 'b-inspector__container--padded': pages.value.length === 0, // No pages are registered\n };\n });\n\n const isCompact = computed(() => {\n const COMPACT_THRESHOLD_SMALL = 740;\n const COMPACT_THRESHOLD_LARGE = 915;\n\n // small inspector to occupy full screen if < 740px\n // large inspector to occupy full screen if < 915px\n const threshold = props.size === 'small' ? COMPACT_THRESHOLD_SMALL : COMPACT_THRESHOLD_LARGE;\n\n return wrapperWidth.value > 0 && wrapperWidth.value < threshold;\n });\n\n const computedPageLastFocusedElement = computed(() => props.pageFocusAnchor);\n\n const conditionalClass = computed(() => ({\n [`b-inspector--${props.size}`]: true,\n [`b-inspector--${props.relativeLayout}`]: true,\n [`b-inspector--is-compact`]: isCompact.value,\n [`b-inspector--multi-paged`]: pages.value.length,\n }));\n\n const inspectorAriaLabel = computed(() => `${t('inspector')}, ${props.title}`);\n\n const { findValidFocusFallback } = useFocusHistory(page);\n\n /**\n * Returns the Inspector's intended tab order.\n *\n * The content must remain before the icon buttons in the DOM for the Inspector animations,\n * so the keyboard order is managed separately. The return button is omitted automatically in compact mode.\n */\n const getOrderedFocusableElements = () => {\n const navigationButtons = [\n returnContentButton.value?.$el,\n expandButton.value?.$el,\n closeButton.value?.$el,\n ].filter(Boolean) as Array<HTMLElement>;\n const contentFocusableElements = getFocusableIn(inspector.value)\n .map(({ node }) => node)\n .filter(element => !navigationButtons.includes(element));\n\n return [...navigationButtons, ...contentFocusableElements];\n };\n\n const setFocus = async () => {\n if (props.isOpen) {\n await nextTick();\n if (isCompact.value) {\n // The compact focus trap uses DOM order when it initially moves focus.\n // Explicitly focus the first ordered control so content does not skip the icon buttons.\n focusElement(getOrderedFocusableElements()[0]);\n } else {\n moveFocusInside(inspector.value, computedPageLastFocusedElement.value);\n }\n } else {\n // This doesn't work with data grid cell actions, as the button gets destroyed once is not being hovered.\n // To be reviewed after LevelAccess revision\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n }\n };\n\n const handleTabNavigation = (event: KeyboardEvent) => {\n // Prevent the browser's DOM-based tab order and use the Inspector-specific order instead.\n const direction = event.shiftKey ? -1 : 1;\n const focusableElements = getOrderedFocusableElements();\n const currentIndex = focusableElements.indexOf(getActiveElement());\n const nextIndex = currentIndex + direction;\n\n // Compact inspectors trap focus, so navigation should wrap around instead of returning focus to the page.\n if (isCompact.value && focusableElements.length > 0) {\n event.preventDefault();\n focusableElements[(nextIndex + focusableElements.length) % focusableElements.length].focus();\n return;\n }\n\n const focusableEl = focusableElements[nextIndex];\n\n // At either end of the Inspector, return focus to the page.\n if (!focusableEl) {\n event.preventDefault();\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n return;\n }\n\n event.preventDefault();\n focusableEl.focus();\n };\n\n const handleSectionFocus = event => {\n const sectionShortcut = event.shiftKey && event.ctrlKey && event.key === 'S';\n if (props.isOpen && !isCompact.value && sectionShortcut) {\n moveFocusBetweenSections();\n }\n };\n\n const moveFocusBetweenSections = () => {\n if (focusInside(inspector.value)) {\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n } else {\n focusElement(inspectorLastFocusedElement.value);\n }\n };\n\n const focusElement = (element: HTMLElement) => {\n if (!element) {\n return;\n }\n element?.focus();\n if (document.activeElement !== element) {\n focusElement(element.parentElement);\n }\n };\n\n /**\n * Multiple page navigation and page registration\n */\n\n const updatePage = page => emit('update:active-page', page);\n\n // unregister page if removed / destroyed\n const unregisterPage = (pageIdToRemove: string) => () => {\n pages.value = pages.value?.filter(pageId => pageId !== pageIdToRemove);\n };\n\n const registerPage: BentoDialogPageRegisterPage = pageId => {\n pages.value.push(pageId);\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage: internalActivePage,\n animation,\n isAnimationActive,\n isOpen: toRef(props, 'isOpen'),\n pages,\n previousPages,\n updatePage,\n });\n\n provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n\n watch(\n () => props.activePage,\n () => {\n if (props.activePage) {\n internalActivePage.value = props.activePage;\n setFocus();\n }\n }\n );\n\n if (!props.activePage) {\n deprecate(\n 'BentoInspector \"active-page\" as optional',\n `Make sure to set the \"active-page\" prop and keep it in sync with \"update:active-page\".\n \"active-page\" prop will be required in the next version`,\n '3.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Inspector allows users to access additional information or details of an object/item. The inspector opens adjacent to the main content, pushing it aside to maintain visibility and accessibility to both the main content and inspector.\n *\n * @example\n * import { BentoInspector } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoInspector },\n * template: `\n * <bento-inspector\n * title=\"Inspector\"\n * size=\"large\"\n * :is-open=\"isOpen\"\n * :active-page=\"activePage\"\n * expandable\n * @update:is-open=\"isOpen = $event\"\n * @update:active-page=\"activePage = $event\"\n * >\n * <template #page>Content of the page</template>\n * <template #content>Content of the inspector</template>\n * </bento-inspector>\n * `\n * }\n */\n export default { i18n: { messages } };\n</script>\n\n<style lang=\"scss\" scoped src=\"./inspector.scss\" />\n"],"names":["useFocusHistory","targetEl","focusHistory","ref","currentActiveElement","useActiveElement","watch","newlyFocusedElement","el","__default__","messages","props","__props","emit","__emit","t","useI18n","returnToMainContentDescriptionId","generateUid","wrapper","inspector","page","returnContentButton","expandButton","closeButton","inspectorLastFocusedElement","internalActivePage","pages","previousPages","animation","BentoDialogPageAnimation","isAnimationActive","wrapperWidth","useElementSize","computedContainerClasses","computed","isCompact","threshold","computedPageLastFocusedElement","conditionalClass","inspectorAriaLabel","findValidFocusFallback","getOrderedFocusableElements","navigationButtons","contentFocusableElements","getFocusableIn","node","element","setFocus$1","nextTick","focusElement","setFocus","handleTabNavigation","event","direction","focusableElements","nextIndex","getActiveElement","focusableEl","handleSectionFocus","sectionShortcut","moveFocusBetweenSections","focusInside","updatePage","page2","unregisterPage","pageIdToRemove","pageId","registerPage","provide","DIALOG_PAGE_CONFIG_INJECTION_KEY","toRef","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY","deprecate"],"mappings":";;;;;;;;;;;;;AAQO,SAAAA,GAAAC,GAAA;AAGH,QAAAC,IAAAC,EAAA,CAAA,CAAA,GAEAC,IAAAC,GAAA;AAQA,SAAAC,EAAAF,GAAA,CAAAG,MAAA;A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