@adyen/bento-vue3 1.55.1 → 1.56.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 (227) hide show
  1. package/dist/@types/index.d.ts +844 -289
  2. package/dist/accordion.js +1 -1
  3. package/dist/action-bar.js +1 -1
  4. package/dist/alert.js +1 -1
  5. package/dist/assets/accordion-item.css +1 -1
  6. package/dist/assets/action-bar.css +1 -1
  7. package/dist/assets/base-modal.css +1 -1
  8. package/dist/assets/button.css +1 -1
  9. package/dist/assets/card.css +1 -1
  10. package/dist/assets/code-snippet.css +1 -1
  11. package/dist/assets/dashed-underline.css +1 -1
  12. package/dist/assets/data-grid-template.css +1 -1
  13. package/dist/assets/data-grid.css +1 -1
  14. package/dist/assets/dialog-page.css +1 -1
  15. package/dist/assets/file-uploader.css +1 -1
  16. package/dist/assets/filter-bar.css +1 -1
  17. package/dist/assets/input-field-password.css +1 -1
  18. package/dist/assets/inspector.css +1 -1
  19. package/dist/assets/menu.css +1 -1
  20. package/dist/assets/modal-fullscreen.css +1 -1
  21. package/dist/assets/popover.css +1 -1
  22. package/dist/assets/sidepanel.css +1 -1
  23. package/dist/assets/summary-grid.css +1 -1
  24. package/dist/assets/tabs.css +1 -1
  25. package/dist/assets/teleport.css +1 -1
  26. package/dist/assets/timeline-item.css +1 -1
  27. package/dist/button.js +3 -3
  28. package/dist/card.js +1 -1
  29. package/dist/checkbox.js +2 -2
  30. package/dist/chip.js +1 -1
  31. package/dist/chunks/{accordion-item.DLyCF015.js → accordion-item.CihL7JaZ.js} +2 -2
  32. package/dist/chunks/{accordion-item.DLyCF015.js.map → accordion-item.CihL7JaZ.js.map} +1 -1
  33. package/dist/chunks/{action-bar.CDOaDenE.js → action-bar.CD5FQjE9.js} +6 -6
  34. package/dist/chunks/{action-bar.CDOaDenE.js.map → action-bar.CD5FQjE9.js.map} +1 -1
  35. package/dist/chunks/{alert.4SefwHLO.js → alert.CFb4Sejw.js} +3 -3
  36. package/dist/chunks/{alert.4SefwHLO.js.map → alert.CFb4Sejw.js.map} +1 -1
  37. package/dist/chunks/{base-modal.DZy1WuJs.js → base-modal.qhldLovE.js} +5 -5
  38. package/dist/chunks/{base-modal.DZy1WuJs.js.map → base-modal.qhldLovE.js.map} +1 -1
  39. package/dist/chunks/{button-actions-with-menu.DQRTu42W.js → button-actions-with-menu.CxB1fVvx.js} +4 -4
  40. package/dist/chunks/{button-actions-with-menu.DQRTu42W.js.map → button-actions-with-menu.CxB1fVvx.js.map} +1 -1
  41. package/dist/chunks/{button-actions.N99QthUv.js → button-actions.ODJKaCW7.js} +3 -3
  42. package/dist/chunks/{button-actions.N99QthUv.js.map → button-actions.ODJKaCW7.js.map} +1 -1
  43. package/dist/chunks/{button.DEVuqLVT.js → button.BHZgsGkp.js} +43 -41
  44. package/dist/chunks/button.BHZgsGkp.js.map +1 -0
  45. package/dist/chunks/{calendar.CNt90BvO.js → calendar.Dymq4e0Y.js} +4 -4
  46. package/dist/chunks/{calendar.CNt90BvO.js.map → calendar.Dymq4e0Y.js.map} +1 -1
  47. package/dist/chunks/{card.E2xhS_6Z.js → card.DQ6g6hqK.js} +3 -3
  48. package/dist/chunks/{card.E2xhS_6Z.js.map → card.DQ6g6hqK.js.map} +1 -1
  49. package/dist/chunks/{checkbox-group.BMzsgOeI.js → checkbox-group.DFmUrvgx.js} +4 -4
  50. package/dist/chunks/{checkbox-group.BMzsgOeI.js.map → checkbox-group.DFmUrvgx.js.map} +1 -1
  51. package/dist/chunks/{checkbox.BIaD03Bg.js → checkbox.Bti_jnp2.js} +17 -17
  52. package/dist/chunks/{checkbox.BIaD03Bg.js.map → checkbox.Bti_jnp2.js.map} +1 -1
  53. package/dist/chunks/{chip.3T0x6FuI.js → chip.DbhxDQiT.js} +2 -2
  54. package/dist/chunks/{chip.3T0x6FuI.js.map → chip.DbhxDQiT.js.map} +1 -1
  55. package/dist/chunks/code-snippet.Df5XwyWD.js +334 -0
  56. package/dist/chunks/code-snippet.Df5XwyWD.js.map +1 -0
  57. package/dist/chunks/{controls-group.DJqvAWte.js → controls-group.DgrzEh4C.js} +2 -2
  58. package/dist/chunks/{controls-group.DJqvAWte.js.map → controls-group.DgrzEh4C.js.map} +1 -1
  59. package/dist/chunks/{copy.MId-I684.js → copy.CfFh4b_c.js} +3 -3
  60. package/dist/chunks/{copy.MId-I684.js.map → copy.CfFh4b_c.js.map} +1 -1
  61. package/dist/chunks/{country.D0WFfaql.js → country.BhAcCmRx.js} +2 -2
  62. package/dist/chunks/{country.D0WFfaql.js.map → country.BhAcCmRx.js.map} +1 -1
  63. package/dist/chunks/{dashboard-section.CrbSjoA8.js → dashboard-section.tza4iYcv.js} +3 -3
  64. package/dist/chunks/{dashboard-section.CrbSjoA8.js.map → dashboard-section.tza4iYcv.js.map} +1 -1
  65. package/dist/chunks/dashed-underline.B2cIJkg_.js +98 -0
  66. package/dist/chunks/dashed-underline.B2cIJkg_.js.map +1 -0
  67. package/dist/chunks/data-grid-template.PGPytWvk.js +111 -0
  68. package/dist/chunks/data-grid-template.PGPytWvk.js.map +1 -0
  69. package/dist/chunks/{data-grid.CsyayKK3.js → data-grid.DsZQ-F9m.js} +1328 -1299
  70. package/dist/chunks/data-grid.DsZQ-F9m.js.map +1 -0
  71. package/dist/chunks/{date-picker.CjwoOQ3B.js → date-picker.8jgg3MJm.js} +7 -7
  72. package/dist/chunks/{date-picker.CjwoOQ3B.js.map → date-picker.8jgg3MJm.js.map} +1 -1
  73. package/dist/chunks/{date-range-picker.DGY91Rwc.js → date-range-picker.uGwtO7SA.js} +10 -10
  74. package/dist/chunks/{date-range-picker.DGY91Rwc.js.map → date-range-picker.uGwtO7SA.js.map} +1 -1
  75. package/dist/chunks/{date.DoJuTLhO.js → date.CKXySBQv.js} +2 -2
  76. package/dist/chunks/{date.DoJuTLhO.js.map → date.CKXySBQv.js.map} +1 -1
  77. package/dist/chunks/{dialog-page.BRlAYf5w.js → dialog-page.MLFdqTcL.js} +3 -3
  78. package/dist/chunks/{dialog-page.BRlAYf5w.js.map → dialog-page.MLFdqTcL.js.map} +1 -1
  79. package/dist/chunks/{dropdown-default-textbox.CTyt2klK.js → dropdown-default-textbox.BNhy-QDH.js} +2 -2
  80. package/dist/chunks/{dropdown-default-textbox.CTyt2klK.js.map → dropdown-default-textbox.BNhy-QDH.js.map} +1 -1
  81. package/dist/chunks/{dropdown-tag.CJtSH5cZ.js → dropdown-tag.DEAOevYN.js} +3 -3
  82. package/dist/chunks/{dropdown-tag.CJtSH5cZ.js.map → dropdown-tag.DEAOevYN.js.map} +1 -1
  83. package/dist/chunks/{dropdown.CQvyjn6d.js → dropdown.CVa4_qCe.js} +6 -6
  84. package/dist/chunks/{dropdown.CQvyjn6d.js.map → dropdown.CVa4_qCe.js.map} +1 -1
  85. package/dist/chunks/{empty-state.m0U14LVw.js → empty-state.DiXLZmQJ.js} +2 -2
  86. package/dist/chunks/{empty-state.m0U14LVw.js.map → empty-state.DiXLZmQJ.js.map} +1 -1
  87. package/dist/chunks/{error-message.CMgsMDny.js → error-message.CPw3y44N.js} +2 -2
  88. package/dist/chunks/{error-message.CMgsMDny.js.map → error-message.CPw3y44N.js.map} +1 -1
  89. package/dist/chunks/es6.BtaxuP0b.js.map +1 -1
  90. package/dist/chunks/{file-uploader.D3KUe-MO.js → file-uploader.Dv4sh1IO.js} +477 -452
  91. package/dist/chunks/file-uploader.Dv4sh1IO.js.map +1 -0
  92. package/dist/chunks/filter-bar.DfIcZ5dX.js +2886 -0
  93. package/dist/chunks/filter-bar.DfIcZ5dX.js.map +1 -0
  94. package/dist/chunks/{fixed-scroller.BNP4SR5J.js → fixed-scroller.DsTyshyt.js} +3 -3
  95. package/dist/chunks/{fixed-scroller.BNP4SR5J.js.map → fixed-scroller.DsTyshyt.js.map} +1 -1
  96. package/dist/chunks/{footer-actions.DmGDpPBW.js → footer-actions.C00o4tuW.js} +3 -3
  97. package/dist/chunks/{footer-actions.DmGDpPBW.js.map → footer-actions.C00o4tuW.js.map} +1 -1
  98. package/dist/chunks/{form-layout-title.P5ajTo4C.js → form-layout-title.dcT8eXwc.js} +2 -2
  99. package/dist/chunks/{form-layout-title.P5ajTo4C.js.map → form-layout-title.dcT8eXwc.js.map} +1 -1
  100. package/dist/chunks/{header-with-views.BJIQZVAq.js → header-with-views.DEn9HFkT.js} +14 -14
  101. package/dist/chunks/{header-with-views.BJIQZVAq.js.map → header-with-views.DEn9HFkT.js.map} +1 -1
  102. package/dist/chunks/{header.vHSsdURt.js → header.hDkWwQuQ.js} +5 -5
  103. package/dist/chunks/{header.vHSsdURt.js.map → header.hDkWwQuQ.js.map} +1 -1
  104. package/dist/chunks/{i18n.D9azDLPe.js → i18n.B6g5VX0q.js} +1050 -1020
  105. package/dist/chunks/i18n.B6g5VX0q.js.map +1 -0
  106. package/dist/chunks/{info-icon-with-popover.CXaaxjeT.js → info-icon-with-popover.COJrCw_o.js} +3 -3
  107. package/dist/chunks/{info-icon-with-popover.CXaaxjeT.js.map → info-icon-with-popover.COJrCw_o.js.map} +1 -1
  108. package/dist/chunks/{input-field-password.CWr26esx.js → input-field-password._CliYJ7N.js} +86 -81
  109. package/dist/chunks/{input-field-password.CWr26esx.js.map → input-field-password._CliYJ7N.js.map} +1 -1
  110. package/dist/chunks/{input-field-phone-number.zf8WxBCn.js → input-field-phone-number.WPcQbE3z.js} +4 -4
  111. package/dist/chunks/{input-field-phone-number.zf8WxBCn.js.map → input-field-phone-number.WPcQbE3z.js.map} +1 -1
  112. package/dist/chunks/{input-field.CR262X1w.js → input-field.Cr1r2STY.js} +4 -4
  113. package/dist/chunks/{input-field.CR262X1w.js.map → input-field.Cr1r2STY.js.map} +1 -1
  114. package/dist/chunks/{inspector.types.YK45k4D_.js → inspector.types.D5QBC3-G.js} +3 -3
  115. package/dist/chunks/{inspector.types.YK45k4D_.js.map → inspector.types.D5QBC3-G.js.map} +1 -1
  116. package/dist/chunks/{menu.CVMSGvtb.js → menu.B0q9q97N.js} +17 -16
  117. package/dist/chunks/{menu.CVMSGvtb.js.map → menu.B0q9q97N.js.map} +1 -1
  118. package/dist/chunks/{modal-fullscreen.Cqlf6PWo.js → modal-fullscreen.BgqNc9jE.js} +5 -5
  119. package/dist/chunks/{modal-fullscreen.Cqlf6PWo.js.map → modal-fullscreen.BgqNc9jE.js.map} +1 -1
  120. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.dXxru4S9.js → modal.vue_vue_type_script_setup_true_lang.Dr847POU.js} +6 -6
  121. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.dXxru4S9.js.map → modal.vue_vue_type_script_setup_true_lang.Dr847POU.js.map} +1 -1
  122. package/dist/chunks/{pagination.C65tc-nX.js → pagination.Bi5BwIWq.js} +4 -4
  123. package/dist/chunks/{pagination.C65tc-nX.js.map → pagination.Bi5BwIWq.js.map} +1 -1
  124. package/dist/chunks/{popover.DjbACET6.js → popover.R5OM_tFu.js} +3 -3
  125. package/dist/chunks/{popover.DjbACET6.js.map → popover.R5OM_tFu.js.map} +1 -1
  126. package/dist/chunks/{promo-banner.ZCfJQh-S.js → promo-banner.DFt2dVxk.js} +3 -3
  127. package/dist/chunks/{promo-banner.ZCfJQh-S.js.map → promo-banner.DFt2dVxk.js.map} +1 -1
  128. package/dist/chunks/{radio-group.Tgf3BF5X.js → radio-group.muZVaVEm.js} +3 -3
  129. package/dist/chunks/{radio-group.Tgf3BF5X.js.map → radio-group.muZVaVEm.js.map} +1 -1
  130. package/dist/chunks/{search-bar.CTn5DIQZ.js → search-bar.DlVK3bBQ.js} +4 -4
  131. package/dist/chunks/{search-bar.CTn5DIQZ.js.map → search-bar.DlVK3bBQ.js.map} +1 -1
  132. package/dist/chunks/{secondary-nav.CnE-aV2P.js → secondary-nav.CIEVFTYS.js} +3 -3
  133. package/dist/chunks/{secondary-nav.CnE-aV2P.js.map → secondary-nav.CIEVFTYS.js.map} +1 -1
  134. package/dist/chunks/{selection-card-group.C2OFZgKd.js → selection-card-group.BgANSy3b.js} +11 -11
  135. package/dist/chunks/{selection-card-group.C2OFZgKd.js.map → selection-card-group.BgANSy3b.js.map} +1 -1
  136. package/dist/chunks/{sidepanel.Drn-lKR3.js → sidepanel.BjR0Ab22.js} +5 -5
  137. package/dist/chunks/{sidepanel.Drn-lKR3.js.map → sidepanel.BjR0Ab22.js.map} +1 -1
  138. package/dist/chunks/{step.BGFaHGFO.js → step.7l-t-eN9.js} +2 -2
  139. package/dist/chunks/{step.BGFaHGFO.js.map → step.7l-t-eN9.js.map} +1 -1
  140. package/dist/chunks/{structured-list-item.CWiwoP5F.js → structured-list-item.BMsATRrU.js} +4 -4
  141. package/dist/chunks/{structured-list-item.CWiwoP5F.js.map → structured-list-item.BMsATRrU.js.map} +1 -1
  142. package/dist/chunks/{summary-grid.types.DOYW579A.js → summary-grid.types.lGX16F4w.js} +126 -114
  143. package/dist/chunks/summary-grid.types.lGX16F4w.js.map +1 -0
  144. package/dist/chunks/{tabs.DZk78MLK.js → tabs.BVuOvNxx.js} +17 -17
  145. package/dist/chunks/{tabs.DZk78MLK.js.map → tabs.BVuOvNxx.js.map} +1 -1
  146. package/dist/chunks/{teleport.zSiKZmRE.js → teleport.CfGWjxe2.js} +17 -26
  147. package/dist/chunks/teleport.CfGWjxe2.js.map +1 -0
  148. package/dist/chunks/{textarea.CR7su54i.js → textarea.CAc_VYFm.js} +4 -4
  149. package/dist/chunks/{textarea.CR7su54i.js.map → textarea.CAc_VYFm.js.map} +1 -1
  150. package/dist/chunks/timeline-item.BQ4qiBii.js +567 -0
  151. package/dist/chunks/timeline-item.BQ4qiBii.js.map +1 -0
  152. package/dist/chunks/{toast.DxVfamh-.js → toast.BOpWHAfu.js} +3 -3
  153. package/dist/chunks/{toast.DxVfamh-.js.map → toast.BOpWHAfu.js.map} +1 -1
  154. package/dist/chunks/{toggle-button.D-9TFTy8.js → toggle-button.E0VQtyEX.js} +2 -2
  155. package/dist/chunks/{toggle-button.D-9TFTy8.js.map → toggle-button.E0VQtyEX.js.map} +1 -1
  156. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.ENhKvQLv.js → tutorial.vue_vue_type_script_setup_true_lang.CTx9Z9xB.js} +5 -5
  157. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.ENhKvQLv.js.map → tutorial.vue_vue_type_script_setup_true_lang.CTx9Z9xB.js.map} +1 -1
  158. package/dist/chunks/{use-cached-selected-values.CQKeFUJd.js → use-cached-selected-values.DHUa2Emx.js} +6 -6
  159. package/dist/chunks/{use-cached-selected-values.CQKeFUJd.js.map → use-cached-selected-values.DHUa2Emx.js.map} +1 -1
  160. package/dist/chunks/use-click-outside.BnhTgpSt.js +14 -0
  161. package/dist/chunks/use-click-outside.BnhTgpSt.js.map +1 -0
  162. package/dist/chunks/{use-country-items.BMhCqIWd.js → use-country-items.4kZgVg_l.js} +2 -2
  163. package/dist/chunks/{use-country-items.BMhCqIWd.js.map → use-country-items.4kZgVg_l.js.map} +1 -1
  164. package/dist/code-snippet.js +1 -1
  165. package/dist/country.js +1 -1
  166. package/dist/dashboard-template.js +1 -1
  167. package/dist/dashed-underline.js +1 -1
  168. package/dist/data-grid-template.js +1 -1
  169. package/dist/data-grid.js +1 -1
  170. package/dist/date-picker.js +2 -2
  171. package/dist/date-range-picker.js +2 -2
  172. package/dist/date.js +1 -1
  173. package/dist/dropdown.js +4 -4
  174. package/dist/empty-state.js +1 -1
  175. package/dist/file-uploader.js +1 -1
  176. package/dist/filter-bar.js +1 -1
  177. package/dist/form-layout.js +1 -1
  178. package/dist/header-with-views.js +1 -1
  179. package/dist/header.js +1 -1
  180. package/dist/index.js +55 -55
  181. package/dist/input-field-password.js +1 -1
  182. package/dist/input-field-phone-number.js +1 -1
  183. package/dist/input-field.js +1 -1
  184. package/dist/inspector.js +1 -1
  185. package/dist/internal.js +11 -11
  186. package/dist/menu.js +1 -1
  187. package/dist/modal-fullscreen.js +1 -1
  188. package/dist/modal.js +2 -2
  189. package/dist/pagination.js +1 -1
  190. package/dist/popover.js +1 -1
  191. package/dist/promo-banner.js +1 -1
  192. package/dist/radio-group.js +1 -1
  193. package/dist/search-bar.js +2 -2
  194. package/dist/secondary-nav.js +1 -1
  195. package/dist/selection-card.js +1 -1
  196. package/dist/sidepanel.js +1 -1
  197. package/dist/stepper.js +1 -1
  198. package/dist/structured-list.js +1 -1
  199. package/dist/styles/bento-dark.css +13 -2
  200. package/dist/styles/bento-light.css +13 -2
  201. package/dist/styles/bento.css +13 -2
  202. package/dist/styles/legacy.css +14 -4
  203. package/dist/styles/styleguide.css +13 -2
  204. package/dist/summary-grid.js +1 -1
  205. package/dist/tabs.js +1 -1
  206. package/dist/textarea.js +1 -1
  207. package/dist/timeline.js +1 -1
  208. package/dist/toast.js +1 -1
  209. package/dist/tutorial.js +1 -1
  210. package/dist/web-types.json +1 -1
  211. package/package.json +5 -5
  212. package/dist/chunks/button.DEVuqLVT.js.map +0 -1
  213. package/dist/chunks/code-snippet.DJgiqDzZ.js +0 -422
  214. package/dist/chunks/code-snippet.DJgiqDzZ.js.map +0 -1
  215. package/dist/chunks/dashed-underline.DWhGZIhS.js +0 -80
  216. package/dist/chunks/dashed-underline.DWhGZIhS.js.map +0 -1
  217. package/dist/chunks/data-grid-template.LlK-7o84.js +0 -93
  218. package/dist/chunks/data-grid-template.LlK-7o84.js.map +0 -1
  219. package/dist/chunks/data-grid.CsyayKK3.js.map +0 -1
  220. package/dist/chunks/file-uploader.D3KUe-MO.js.map +0 -1
  221. package/dist/chunks/filter-bar.cRJmUX-v.js +0 -2771
  222. package/dist/chunks/filter-bar.cRJmUX-v.js.map +0 -1
  223. package/dist/chunks/i18n.D9azDLPe.js.map +0 -1
  224. package/dist/chunks/summary-grid.types.DOYW579A.js.map +0 -1
  225. package/dist/chunks/teleport.zSiKZmRE.js.map +0 -1
  226. package/dist/chunks/timeline-item.BhQp0ICP.js +0 -560
  227. package/dist/chunks/timeline-item.BhQp0ICP.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as P, ref as n, createElementBlock as u, openBlock as c, createVNode as m, createBlock as b, createCommentVNode as d, unref as e, withCtx as v, renderSlot as h, toDisplayString as x } from "vue";
2
- import { B as r } from "./popover.DjbACET6.js";
2
+ import { B as r } from "./popover.R5OM_tFu.js";
3
3
  import { B as T } from "./typography.DN5eC5ch.js";
4
- import { u as B } from "./i18n.D9azDLPe.js";
4
+ import { u as B } from "./i18n.B6g5VX0q.js";
5
5
  import { g as E } from "./generate-uid.NJ8tVoha.js";
6
6
  import { I as S } from "./info.HK3R7Drc.js";
7
7
  import { _ as k } from "./_plugin-vue_export-helper.CHgC5LLL.js";
@@ -94,4 +94,4 @@ const _ = {
94
94
  export {
95
95
  Y as I
96
96
  };
97
- //# sourceMappingURL=info-icon-with-popover.CXaaxjeT.js.map
97
+ //# sourceMappingURL=info-icon-with-popover.COJrCw_o.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"info-icon-with-popover.CXaaxjeT.js","sources":["../../../vue2/src/components/internal/info-icon-with-popover/info-icon-with-popover.vue"],"sourcesContent":["<template>\n <div\n ref=\"infoIconRef\"\n class=\"b-info-icon-with-popover\"\n tabindex=\"0\"\n data-testid=\"info-icon-with-popover\"\n @mouseenter=\"openPopover\"\n @mouseleave=\"closePopover\"\n @focus=\"infoIconOnFocus\"\n @focusout=\"infoIconOnFocusOut\"\n >\n <info-icon\n ref=\"targetElement\"\n class=\"b-info-icon-with-popover__svg\"\n :aria-expanded=\"isOpen\"\n :aria-describedby=\"popoverId\"\n :svg-title=\"t('moreInformation')\"\n />\n <bento-popover\n v-if=\"targetElement\"\n :open=\"isOpen\"\n :target-element=\"targetElement\"\n :position=\"popoverPosition\"\n role=\"tooltip\"\n fit-content\n disable-focus-trap\n >\n <bento-typography>\n <slot>\n <div v-if=\"popoverText\">\n {{ popoverText }}\n </div>\n </slot>\n </bento-typography>\n </bento-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { ref } from 'vue';\n import { BentoPopover } from '@/components/popover';\n import { BentoTypography } from '@/components/typography';\n import { useI18n } from '@/utils/ts/i18n';\n import { generateUid } from '@/core/utils/ts';\n import InfoIcon from '@adyen/ui-assets-icons-16/vue/info';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const CLOSING_POPOVER_DELAY_MS = 200;\n\n defineProps({\n /**\n * Text showed in the popover on hover\n */\n popoverText: { type: String, default: null },\n\n /**\n * Position the popover should take if space is available\n */\n popoverPosition: {\n type: BentoPopover.props.position.type,\n default: BentoPopover.props.position.default,\n validator: BentoPopover.props.position.validator,\n },\n });\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const infoIconRef = ref<HTMLDivElement>();\n const targetElement = ref(null);\n const popoverId = generateUid('bento-info-icon-with-popover');\n const isOpen = ref();\n const closingTimeOutId = ref();\n\n const openPopover = () => {\n isOpen.value = true;\n if (closingTimeOutId.value) {\n clearTimeout(closingTimeOutId.value);\n }\n };\n const closePopover = () => {\n // We want to delay closing for a couple of seconds so\n // it doesn't flicker if a user hovers over the icon and then inside the popover.\n const timeOutId = setTimeout(() => {\n isOpen.value = false;\n }, CLOSING_POPOVER_DELAY_MS);\n closingTimeOutId.value = timeOutId;\n };\n\n const infoIconOnFocus = () => {\n openPopover();\n };\n\n /**\n * Only close popover on blur if the newly focus element is not a child of this element\n * @param e - the event that contains the newly focused element\n */\n const infoIconOnFocusOut = (e: FocusEvent) => {\n if (\n !infoIconRef.value ||\n !(e?.relatedTarget instanceof Element) ||\n !infoIconRef.value.contains(e.relatedTarget)\n ) {\n closePopover();\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Internal component to be used whenever an info icon needs to be rendered with a popover instead of a tooltip.\n *\n * @example\n * import { BentoInfoIconWithPopover } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoInfoIconWithPopover },\n * template: `\n * <info-icon-with-popover popover-text=\"Content can be passed as a string like\" :popover-position=\"position\">\n * Content can also be rendered as a slot\n * </info-icon-with-popover>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./info-icon-with-popover.scss\" />\n"],"names":["__default__","messages","t","useI18n","infoIconRef","ref","targetElement","popoverId","generateUid","isOpen","closingTimeOutId","openPopover","closePopover","timeOutId","infoIconOnFocus","infoIconOnFocusOut","e"],"mappings":";;;;;;;;;;;;;;;;;;mBA6HIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;AA5DA,UAAA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAF,EAAA,CAAA,GAEAG,IAAAC,EAAA,GACAC,IAAAD,EAAA,IAAA,GACAE,IAAAC,EAAA,8BAAA,GACAC,IAAAJ,EAAA,GACAK,IAAAL,EAAA,GAEAM,IAAA,MAAA;AACI,MAAAF,EAAA,QAAA,IACAC,EAAA,SACI,aAAAA,EAAA,KAAA;AAAA,IACJ,GAEJE,IAAA,MAAA;AAGI,YAAAC,IAAA,WAAA,MAAA;AACI,QAAAJ,EAAA,QAAA;AAAA,MAAe,GAAA,GAAA;AAEnB,MAAAC,EAAA,QAAAG;AAAA,IAAyB,GAG7BC,IAAA,MAAA;AACI,MAAAH,EAAA;AAAA,IAAY,GAOhBI,IAAA,CAAAC,MAAA;AACI,OAAA,CAAAZ,EAAA,SAAA,GAAAY,KAAA,gBAAAA,EAAA,0BAAA,YAAA,CAAAZ,EAAA,MAAA,SAAAY,EAAA,aAAA,MAKIJ,EAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"info-icon-with-popover.COJrCw_o.js","sources":["../../../vue2/src/components/internal/info-icon-with-popover/info-icon-with-popover.vue"],"sourcesContent":["<template>\n <div\n ref=\"infoIconRef\"\n class=\"b-info-icon-with-popover\"\n tabindex=\"0\"\n data-testid=\"info-icon-with-popover\"\n @mouseenter=\"openPopover\"\n @mouseleave=\"closePopover\"\n @focus=\"infoIconOnFocus\"\n @focusout=\"infoIconOnFocusOut\"\n >\n <info-icon\n ref=\"targetElement\"\n class=\"b-info-icon-with-popover__svg\"\n :aria-expanded=\"isOpen\"\n :aria-describedby=\"popoverId\"\n :svg-title=\"t('moreInformation')\"\n />\n <bento-popover\n v-if=\"targetElement\"\n :open=\"isOpen\"\n :target-element=\"targetElement\"\n :position=\"popoverPosition\"\n role=\"tooltip\"\n fit-content\n disable-focus-trap\n >\n <bento-typography>\n <slot>\n <div v-if=\"popoverText\">\n {{ popoverText }}\n </div>\n </slot>\n </bento-typography>\n </bento-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { ref } from 'vue';\n import { BentoPopover } from '@/components/popover';\n import { BentoTypography } from '@/components/typography';\n import { useI18n } from '@/utils/ts/i18n';\n import { generateUid } from '@/core/utils/ts';\n import InfoIcon from '@adyen/ui-assets-icons-16/vue/info';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const CLOSING_POPOVER_DELAY_MS = 200;\n\n defineProps({\n /**\n * Text showed in the popover on hover\n */\n popoverText: { type: String, default: null },\n\n /**\n * Position the popover should take if space is available\n */\n popoverPosition: {\n type: BentoPopover.props.position.type,\n default: BentoPopover.props.position.default,\n validator: BentoPopover.props.position.validator,\n },\n });\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const infoIconRef = ref<HTMLDivElement>();\n const targetElement = ref(null);\n const popoverId = generateUid('bento-info-icon-with-popover');\n const isOpen = ref();\n const closingTimeOutId = ref();\n\n const openPopover = () => {\n isOpen.value = true;\n if (closingTimeOutId.value) {\n clearTimeout(closingTimeOutId.value);\n }\n };\n const closePopover = () => {\n // We want to delay closing for a couple of seconds so\n // it doesn't flicker if a user hovers over the icon and then inside the popover.\n const timeOutId = setTimeout(() => {\n isOpen.value = false;\n }, CLOSING_POPOVER_DELAY_MS);\n closingTimeOutId.value = timeOutId;\n };\n\n const infoIconOnFocus = () => {\n openPopover();\n };\n\n /**\n * Only close popover on blur if the newly focus element is not a child of this element\n * @param e - the event that contains the newly focused element\n */\n const infoIconOnFocusOut = (e: FocusEvent) => {\n if (\n !infoIconRef.value ||\n !(e?.relatedTarget instanceof Element) ||\n !infoIconRef.value.contains(e.relatedTarget)\n ) {\n closePopover();\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Internal component to be used whenever an info icon needs to be rendered with a popover instead of a tooltip.\n *\n * @example\n * import { BentoInfoIconWithPopover } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoInfoIconWithPopover },\n * template: `\n * <info-icon-with-popover popover-text=\"Content can be passed as a string like\" :popover-position=\"position\">\n * Content can also be rendered as a slot\n * </info-icon-with-popover>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./info-icon-with-popover.scss\" />\n"],"names":["__default__","messages","t","useI18n","infoIconRef","ref","targetElement","popoverId","generateUid","isOpen","closingTimeOutId","openPopover","closePopover","timeOutId","infoIconOnFocus","infoIconOnFocusOut","e"],"mappings":";;;;;;;;;;;;;;;;;;mBA6HIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;AA5DA,UAAA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAF,EAAA,CAAA,GAEAG,IAAAC,EAAA,GACAC,IAAAD,EAAA,IAAA,GACAE,IAAAC,EAAA,8BAAA,GACAC,IAAAJ,EAAA,GACAK,IAAAL,EAAA,GAEAM,IAAA,MAAA;AACI,MAAAF,EAAA,QAAA,IACAC,EAAA,SACI,aAAAA,EAAA,KAAA;AAAA,IACJ,GAEJE,IAAA,MAAA;AAGI,YAAAC,IAAA,WAAA,MAAA;AACI,QAAAJ,EAAA,QAAA;AAAA,MAAe,GAAA,GAAA;AAEnB,MAAAC,EAAA,QAAAG;AAAA,IAAyB,GAG7BC,IAAA,MAAA;AACI,MAAAH,EAAA;AAAA,IAAY,GAOhBI,IAAA,CAAAC,MAAA;AACI,OAAA,CAAAZ,EAAA,SAAA,GAAAY,KAAA,gBAAAA,EAAA,0BAAA,YAAA,CAAAZ,EAAA,MAAA,SAAAY,EAAA,aAAA,MAKIJ,EAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,38 +1,38 @@
1
- import { defineComponent as de, useAttrs as ce, ref as o, provide as ue, computed as c, watch as K, createElementBlock as C, openBlock as s, createVNode as R, createBlock as u, createCommentVNode as v, unref as i, mergeProps as pe, createSlots as ve, withCtx as p, createTextVNode as L, toDisplayString as h, createElementVNode as T, normalizeClass as j, Fragment as fe, renderList as me } from "vue";
2
- import { B as _e } from "./button.DEVuqLVT.js";
1
+ import { defineComponent as de, useAttrs as ce, ref as o, provide as ue, computed as c, watch as O, createElementBlock as C, openBlock as s, createVNode as R, createBlock as u, createCommentVNode as v, unref as i, mergeProps as pe, createSlots as ve, withCtx as p, createTextVNode as L, toDisplayString as h, createElementVNode as T, normalizeClass as j, Fragment as fe, renderList as me } from "vue";
2
+ import { B as _e } from "./button.BHZgsGkp.js";
3
3
  import { _ as ge } from "./image.vue_vue_type_script_setup_true_lang.DQT2oNEF.js";
4
- import { B as he } from "./input-field.CR262X1w.js";
5
- import { B as Ee } from "./popover.DjbACET6.js";
6
- import { B as O } from "./typography.DN5eC5ch.js";
7
- import { C as be } from "./checkmark-circle-fill.jicbqe7k.js";
8
- import { D as ke } from "./dot.BW-xtyjC.js";
4
+ import { B as he } from "./input-field.Cr1r2STY.js";
5
+ import { B as Ee } from "./popover.R5OM_tFu.js";
6
+ import { B } from "./typography.DN5eC5ch.js";
7
+ import { C as ke } from "./checkmark-circle-fill.jicbqe7k.js";
8
+ import { D as be } from "./dot.BW-xtyjC.js";
9
9
  import { S as we, H as ye } from "./show.ByWWaogc.js";
10
10
  import { d as Ce, w as Re } from "./index.BzJQl-2M.js";
11
- import { u as Le } from "./i18n.D9azDLPe.js";
11
+ import { u as Le } from "./i18n.B6g5VX0q.js";
12
12
  import { g as G } from "./generate-uid.NJ8tVoha.js";
13
- import { b as Te } from "./dropdown.CQvyjn6d.js";
13
+ import { b as Te } from "./dropdown.CVa4_qCe.js";
14
14
  import { T as Ie } from "./tooltip.BkBDReK0.js";
15
15
  import { _ as Ue } from "./_plugin-vue_export-helper.CHgC5LLL.js";
16
16
  import "../assets/input-field-password.css";
17
- var E = /* @__PURE__ */ ((e) => (e.TEXT = "text", e.PASSWORD = "password", e))(E || {}), b = /* @__PURE__ */ ((e) => (e.MIN_LENGTH = "minLength", e.REQUIRE_LOWERCASE = "requireLowercase", e.REQUIRE_NUMERIC = "requireNumeric", e.REQUIRE_SPECIAL_CHARACTER = "requireSpecialCharacter", e.REQUIRE_UPPERCASE = "requireUppercase", e))(b || {});
17
+ var E = /* @__PURE__ */ ((a) => (a.TEXT = "text", a.PASSWORD = "password", a))(E || {}), k = /* @__PURE__ */ ((a) => (a.MIN_LENGTH = "minLength", a.REQUIRE_LOWERCASE = "requireLowercase", a.REQUIRE_NUMERIC = "requireNumeric", a.REQUIRE_SPECIAL_CHARACTER = "requireSpecialCharacter", a.REQUIRE_UPPERCASE = "requireUppercase", a))(k || {});
18
18
  const Se = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='capslock'%3e%3cg%20id='Union'%3e%3cpath%20d='M13.75%205.63952L8%201.03952L2.25%205.63952V7.74999H4.75V11.75H11.25V7.74999H13.75V5.63952ZM6.25%206.24999H3.88809L8%202.96046L12.1119%206.24999H9.75V10.25H6.25V6.24999Z'%20fill='%2300112C'/%3e%3cpath%20d='M11.25%2014.75V13.25H4.75V14.75H11.25Z'%20fill='%2300112C'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
19
- function k(e) {
20
- return (e == null ? void 0 : e.toString()) ?? "";
19
+ function b(a) {
20
+ return (a == null ? void 0 : a.toString()) ?? "";
21
21
  }
22
- function Pe(e, I = 12) {
23
- return k(e).length >= I;
22
+ function Pe(a, I = 12) {
23
+ return b(a).length >= I;
24
24
  }
25
- function Ve(e) {
26
- return /[a-z]/.test(k(e));
25
+ function Ve(a) {
26
+ return /[a-z]/.test(b(a));
27
27
  }
28
- function Ae(e) {
29
- return /[A-Z]/.test(k(e));
28
+ function Ae(a) {
29
+ return /[A-Z]/.test(b(a));
30
30
  }
31
- function Ne(e) {
32
- return /\d/.test(k(e));
31
+ function Ne(a) {
32
+ return /\d/.test(b(a));
33
33
  }
34
- function Me(e) {
35
- return /[^a-zA-Z0-9]/.test(k(e));
34
+ function Me(a) {
35
+ return /[^a-zA-Z0-9]/.test(b(a));
36
36
  }
37
37
  const J = {
38
38
  "en-US": {
@@ -96,18 +96,18 @@ const J = {
96
96
  withHint: { type: Boolean, default: !0 }
97
97
  },
98
98
  emits: ["input:valid", "input:error", "input"],
99
- setup(e, { emit: I }) {
100
- const { t } = Le({ messages: J }), l = e, U = I, $ = ce(), w = o(E.PASSWORD), g = o(l.value), B = o(!1), H = o(!1), y = o([]), D = o({}), f = o(null), m = o(!1), x = o(null), S = o(null), P = o(null), V = o(!1);
99
+ setup(a, { emit: I }) {
100
+ const { t } = Le({ messages: J }), l = a, U = I, $ = ce(), w = o(E.PASSWORD), f = o(l.value), H = o(!1), D = o(!1), y = o([]), x = o({}), m = o(null), _ = o(!1), W = o(null), S = o(null), P = o(null), V = o(!1);
101
101
  ue(Te, "bento-input-field-password");
102
- const { focused: Y } = Ce(x), W = G("validationListId"), F = G("validationPopoverId"), A = c(() => w.value === E.TEXT), ee = c(() => {
103
- const a = H.value && N.value, d = l.disableValidation && l.errorMessage;
104
- return a || d ? l.errorMessage : "";
102
+ const { focused: Y } = Ce(W), F = G("validationListId"), Z = G("validationPopoverId"), A = c(() => w.value === E.TEXT), ee = c(() => {
103
+ const e = D.value && N.value, d = l.disableValidation && l.errorMessage;
104
+ return e || d ? l.errorMessage : "";
105
105
  }), ae = c(
106
106
  () => y.value.map(
107
- (a) => a ? "b-input-field-password__validation-list--valid" : "b-input-field-password__validation-list--invalid"
107
+ (e) => e ? "b-input-field-password__validation-list--valid" : "b-input-field-password__validation-list--invalid"
108
108
  )
109
109
  ), ie = c(
110
- () => f.value ? "b-input-field-password__input-tooltip--timed" : ""
110
+ () => m.value ? "b-input-field-password__input-tooltip--timed" : ""
111
111
  ), te = c(() => ({
112
112
  ariaHidden: !1,
113
113
  condensed: l.condensed,
@@ -116,9 +116,9 @@ const J = {
116
116
  placeholder: l.placeholder,
117
117
  readonly: l.readonly,
118
118
  type: w.value,
119
- value: g.value,
119
+ value: f.value,
120
120
  "aria-haspopup": M.value ? "dialog" : !1,
121
- "aria-describedby": M.value ? F : "",
121
+ "aria-describedby": M.value ? Z : "",
122
122
  ...$
123
123
  })), r = c(
124
124
  () => l.validation === void 0 ? {
@@ -127,22 +127,22 @@ const J = {
127
127
  list: [
128
128
  {
129
129
  label: t("validationMinLength"),
130
- key: b.MIN_LENGTH,
130
+ key: k.MIN_LENGTH,
131
131
  validate: Pe
132
132
  },
133
133
  {
134
134
  label: t("validationRequireLowercase"),
135
- key: b.REQUIRE_LOWERCASE,
135
+ key: k.REQUIRE_LOWERCASE,
136
136
  validate: Ve
137
137
  },
138
138
  {
139
139
  label: t("validationRequireUppercase"),
140
- key: b.REQUIRE_UPPERCASE,
140
+ key: k.REQUIRE_UPPERCASE,
141
141
  validate: Ae
142
142
  },
143
143
  {
144
144
  label: t("validationRequireNumeric"),
145
- key: b.REQUIRE_NUMERIC,
145
+ key: k.REQUIRE_NUMERIC,
146
146
  validate: Ne
147
147
  },
148
148
  {
@@ -152,53 +152,58 @@ const J = {
152
152
  }
153
153
  ]
154
154
  } : l.validation
155
- ), N = c(() => y.value.some((a) => !a)), M = c(
155
+ ), N = c(() => y.value.some((e) => !e)), M = c(
156
156
  () => {
157
- var a, d;
158
- return S.value && ((d = (a = r.value) == null ? void 0 : a.list) == null ? void 0 : d.length) > 0;
157
+ var e, d;
158
+ return S.value && ((d = (e = r.value) == null ? void 0 : e.list) == null ? void 0 : d.length) > 0;
159
159
  }
160
- ), Z = (a) => {
161
- typeof a.getModifierState == "function" && (V.value = a.getModifierState("CapsLock"));
160
+ ), Q = (e) => {
161
+ typeof e.getModifierState == "function" && (V.value = e.getModifierState("CapsLock"));
162
162
  }, le = () => {
163
163
  A.value ? w.value = E.PASSWORD : w.value = E.TEXT;
164
- }, oe = (a) => {
165
- l.disabled || (g.value = a, U("input", g.value));
166
- }, Q = (a) => {
167
- var _, z;
168
- const d = (z = (_ = r.value) == null ? void 0 : _.list) == null ? void 0 : z.map((n) => ({
164
+ }, oe = (e) => {
165
+ l.disabled || (f.value = e, U("input", f.value));
166
+ }, z = (e) => {
167
+ var g, X;
168
+ const d = (X = (g = r.value) == null ? void 0 : g.list) == null ? void 0 : X.map((n) => ({
169
169
  key: n.key,
170
170
  label: n.label,
171
- isValid: n.validate(a, n.additionalArgs)
171
+ isValid: n.validate(e, n.additionalArgs)
172
172
  }));
173
173
  let q = 1;
174
- y.value = d.map((n) => n.isValid), D.value = d.filter((n) => !n.isValid).reduce((n, X) => {
175
- const re = X.key ?? `custom-rule-${q++}`;
174
+ y.value = d.map((n) => n.isValid), x.value = d.filter((n) => !n.isValid).reduce((n, K) => {
175
+ const re = K.key ?? `custom-rule-${q++}`;
176
176
  return {
177
177
  ...n,
178
- [re]: X.label
178
+ [re]: K.label
179
179
  };
180
180
  }, {});
181
181
  }, se = () => {
182
- m.value = !1, f.value = null;
182
+ _.value = !1, m.value = null;
183
183
  }, ne = () => {
184
- m.value = !0;
184
+ _.value = !0;
185
185
  };
186
- return K(Y, (a) => {
187
- a || (H.value = !0), l.disableValidation || (l.withHint && (B.value = a), Q(g.value));
188
- }), K(V, (a) => {
189
- a ? (m.value = !0, f.value = setTimeout(() => {
190
- f.value = null, m.value = !1;
191
- }, 2e3)) : (clearTimeout(f.value), f.value = null, m.value = !1);
186
+ return O(
187
+ () => l.value,
188
+ (e) => {
189
+ f.value = e;
190
+ }
191
+ ), O(Y, (e) => {
192
+ e || (D.value = !0), l.disableValidation || (l.withHint && (H.value = e), z(f.value));
193
+ }), O(V, (e) => {
194
+ e ? (_.value = !0, m.value = setTimeout(() => {
195
+ m.value = null, _.value = !1;
196
+ }, 2e3)) : (clearTimeout(m.value), m.value = null, _.value = !1);
192
197
  }), Re(
193
- g,
194
- (a) => {
195
- Q(a), N.value ? U("input:error", D.value) : U("input:valid");
198
+ f,
199
+ (e) => {
200
+ z(e), N.value ? U("input:error", x.value) : U("input:valid");
196
201
  },
197
202
  // wait for 0.5s before checking validity OR 2s of continuous typing
198
203
  { debounce: 500, maxWait: 2e3 }
199
- ), (a, d) => (s(), C("div", {
204
+ ), (e, d) => (s(), C("div", {
200
205
  ref_key: "inputFieldPasswordRef",
201
- ref: x
206
+ ref: W
202
207
  }, [
203
208
  R(i(he), pe({
204
209
  ref_key: "inputFieldPasswordInputRef",
@@ -207,11 +212,11 @@ const J = {
207
212
  class: "b-input-field-password__input",
208
213
  spellcheck: "false",
209
214
  onInput: oe,
210
- onKeydown: Z,
211
- onKeyup: Z
215
+ onKeydown: Q,
216
+ onKeyup: Q
212
217
  }), ve({
213
218
  default: p(() => [
214
- L(h(a.label), 1)
219
+ L(h(e.label), 1)
215
220
  ]),
216
221
  _: 2
217
222
  }, [
@@ -236,13 +241,13 @@ const J = {
236
241
  content: i(t)("capsLockEnabled"),
237
242
  "disabled-focus-trap": !0,
238
243
  "fallback-position": ["top", "bottom"],
239
- "is-shown": m.value,
244
+ "is-shown": _.value,
240
245
  "target-element": P.value
241
246
  }, null, 8, ["class", "content", "is-shown", "target-element"])) : v("", !0)
242
247
  ]),
243
248
  key: "0"
244
249
  } : void 0,
245
- a.disabled ? void 0 : {
250
+ e.disabled ? void 0 : {
246
251
  name: "iconAfter",
247
252
  fn: p(() => [
248
253
  R(i(_e), {
@@ -267,16 +272,16 @@ const J = {
267
272
  ]), 1040),
268
273
  M.value ? (s(), u(i(Ee), {
269
274
  key: 0,
270
- open: B.value,
275
+ open: H.value,
271
276
  "target-element": S.value,
272
277
  "disable-focus-trap": !0,
273
278
  "aria-label": r.value.title,
274
- "aria-describedby": i(W),
279
+ "aria-describedby": i(F),
275
280
  position: "right-start"
276
281
  }, {
277
282
  default: p(() => [
278
- T("div", { id: i(F) }, [
279
- r.value.title ? (s(), u(i(O), {
283
+ T("div", { id: i(Z) }, [
284
+ r.value.title ? (s(), u(i(B), {
280
285
  key: 0,
281
286
  class: "b-input-field-password__validation-title"
282
287
  }, {
@@ -287,25 +292,25 @@ const J = {
287
292
  })) : v("", !0),
288
293
  N.value ? v("", !0) : (s(), C("p", Oe, h(i(t)("validationValid")), 1)),
289
294
  T("ul", {
290
- id: i(W),
295
+ id: i(F),
291
296
  class: "b-input-field-password__validation-list"
292
297
  }, [
293
- (s(!0), C(fe, null, me(r.value.list, (q, _) => (s(), C("li", {
294
- key: _,
295
- class: j(ae.value[_]),
298
+ (s(!0), C(fe, null, me(r.value.list, (q, g) => (s(), C("li", {
299
+ key: g,
300
+ class: j(ae.value[g]),
296
301
  "aria-live": "polite",
297
302
  "aria-atomic": "true"
298
303
  }, [
299
304
  T("span", He, [
300
- y.value[_] ? (s(), u(i(be), {
305
+ y.value[g] ? (s(), u(i(ke), {
301
306
  key: 0,
302
307
  "svg-title": i(t)("validationChecked")
303
- }, null, 8, ["svg-title"])) : (s(), u(i(ke), {
308
+ }, null, 8, ["svg-title"])) : (s(), u(i(be), {
304
309
  key: 1,
305
310
  "svg-title": i(t)("validationUnchecked")
306
311
  }, null, 8, ["svg-title"]))
307
312
  ]),
308
- R(i(O), {
313
+ R(i(B), {
309
314
  class: "b-input-field-password__validation-list-text",
310
315
  el: "span"
311
316
  }, {
@@ -316,7 +321,7 @@ const J = {
316
321
  }, 1024)
317
322
  ], 2))), 128))
318
323
  ], 8, Be),
319
- r.value.suggestion ? (s(), u(i(O), {
324
+ r.value.suggestion ? (s(), u(i(B), {
320
325
  key: 2,
321
326
  class: "b-input-field-password__validation-suggestion"
322
327
  }, {
@@ -331,7 +336,7 @@ const J = {
331
336
  }, 8, ["open", "target-element", "aria-label", "aria-describedby"])) : v("", !0)
332
337
  ], 512));
333
338
  }
334
- }), sa = /* @__PURE__ */ Ue(xe, [["__scopeId", "data-v-509b4d53"]]);
339
+ }), sa = /* @__PURE__ */ Ue(xe, [["__scopeId", "data-v-d694a769"]]);
335
340
  export {
336
341
  Ae as a,
337
342
  Ne as b,
@@ -340,4 +345,4 @@ export {
340
345
  Pe as m,
341
346
  Ve as r
342
347
  };
343
- //# sourceMappingURL=input-field-password.CWr26esx.js.map
348
+ //# sourceMappingURL=input-field-password._CliYJ7N.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-field-password.CWr26esx.js","sources":["../../../vue2/src/components/input-field-password/input-field-password.types.ts","../../../vue2/src/components/input-field-password/assets/capslock.svg","../../../vue2/src/components/input-field-password/utilities/input-field-password.validation.ts","../../../vue2/src/components/input-field-password/input-field-password.vue"],"sourcesContent":["import type { BentoInputFieldProps, BentoInputFieldValue } from '@/components/input-field/input-field.types';\n\n/**\n * Public\n */\n\nexport interface BentoInputFieldPasswordValidationListItem {\n label: string;\n key?: BentoInputFieldPasswordDefaultRuleKeys | string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n validate: (value: BentoInputFieldValue, ...args: any[]) => boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additionalArgs?: any[];\n}\n\nexport type BentoInputFieldPasswordDefaultRuleKeys =\n | 'minLength'\n | 'requireLowercase'\n | 'requireNumeric'\n | 'requireSpecialCharacter'\n | 'requireUppercase';\n\nexport type BentoInputFieldPasswordErrorsList = Record<BentoInputFieldPasswordDefaultRuleKeys | string, string>;\n\nexport interface BentoInputFieldPasswordValidation {\n title?: string;\n suggestion?: string;\n list: BentoInputFieldPasswordValidationListItem[];\n}\n\nexport interface BentoInputFieldPasswordProps {\n /**\n * Reduces height of the input\n */\n condensed?: BentoInputFieldProps['condensed'];\n\n /**\n * Disables the possibility of changing value in the input-field\n */\n disabled?: BentoInputFieldProps['disabled'];\n\n /**\n * Performs real-time validations over the input value. Default: `false`.\n * Disabling the option (set to `true`) will not run pre-defined validations or custom validations defined in the `validation` field.\n */\n disableValidation?: boolean;\n\n /**\n * Renders input-field with an error state and the error message beneath the input box\n */\n errorMessage?: BentoInputFieldProps['errorMessage'];\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder?: BentoInputFieldProps['placeholder'];\n\n /**\n * Setting this property to true will set the input field to read only state.\n */\n readonly?: BentoInputFieldProps['readonly'];\n\n /**\n * Text displayed as the value of the input-field\n */\n value?: BentoInputFieldProps['value'];\n\n /**\n * Label to be shown with the input field\n */\n label?: string;\n\n /**\n * Configuration object for password field validation.\n *\n * This object defines the validation criteria and associated messages for a password field.\n * It includes the following properties:\n *\n * - `title`: The title displayed at the top of the validation hint.\n * - `suggestion`: The message displayed at the bottom of the validation hint, providing additional guidance.\n * - `list`: An array of callback functions to be executed on the value after each user input, validating the password against the specified rules.\n *\n * By default, the validation checks that:\n *\n * - The value has a minimum length of 12 characters.\n * - The value contains at least one lowercase letter.\n * - The value contains at least one uppercase letter.\n * - The value contains at least one numeric digit.\n * - The value contains at least one special character.\n *\n *\n */\n validation?: BentoInputFieldPasswordValidation;\n\n /**\n * Whether the password validation hint is displayed when the input field is activated via focus or input\n */\n withHint?: boolean;\n}\n\n/**\n * Private\n */\n\nexport enum BentoInputFieldPasswordType {\n TEXT = 'text',\n PASSWORD = 'password',\n}\n\nexport enum BentoInputFieldPasswordDefaultRule {\n MIN_LENGTH = 'minLength',\n REQUIRE_LOWERCASE = 'requireLowercase',\n REQUIRE_NUMERIC = 'requireNumeric',\n REQUIRE_SPECIAL_CHARACTER = 'requireSpecialCharacter',\n REQUIRE_UPPERCASE = 'requireUppercase',\n}\n","export default \"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='capslock'%3e%3cg%20id='Union'%3e%3cpath%20d='M13.75%205.63952L8%201.03952L2.25%205.63952V7.74999H4.75V11.75H11.25V7.74999H13.75V5.63952ZM6.25%206.24999H3.88809L8%202.96046L12.1119%206.24999H9.75V10.25H6.25V6.24999Z'%20fill='%2300112C'/%3e%3cpath%20d='M11.25%2014.75V13.25H4.75V14.75H11.25Z'%20fill='%2300112C'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e\"","import { BentoInputFieldValue } from '@/components/input-field';\n\nfunction stringifyValue(value: BentoInputFieldValue): string {\n return value?.toString() ?? '';\n}\n\n/**\n * Validates if the length of the provided value is greater than or equal to the specified length.\n *\n * @param value - The input value to check.\n * @param length - The minimum required length of the value. Defaults to 12.\n * @returns `true` if the length of the value is greater than or equal to the specified length, `false` otherwise.\n */\nexport function minLength(value: BentoInputFieldValue, length = 12): boolean {\n return stringifyValue(value).length >= length;\n}\n\n/**\n * Validates if the provided value contains at least one lowercase letter.\n *\n * @param value - The input value to check.\n * @returns `true` if the value contains at least one lowercase letter, `false` otherwise.\n */\nexport function requireLowercase(value: BentoInputFieldValue): boolean {\n return /[a-z]/.test(stringifyValue(value));\n}\n\n/**\n * Validates if the provided value contains at least one uppercase letter.\n *\n * @param value - The input value to check.\n * @returns `true` if the value contains at least one uppercase letter, `false` otherwise.\n */\nexport function requireUppercase(value: BentoInputFieldValue): boolean {\n return /[A-Z]/.test(stringifyValue(value));\n}\n\n/**\n * Validates if the provided value contains at least one numerical digit.\n *\n * @param value - The input value to check.\n * @returns `true` if the value contains at least one numerical digit, `false` otherwise.\n */\nexport function requireNumeric(value: BentoInputFieldValue): boolean {\n return /\\d/.test(stringifyValue(value));\n}\n\n/**\n * Validates if the provided value contains at least one special character (non-alphanumeric).\n *\n * @param value - The input value to check.\n * @returns `true` if the value contains at least one special character, `false` otherwise.\n */\nexport function requireSpecialCharacter(value: BentoInputFieldValue): boolean {\n return /[^a-zA-Z0-9]/.test(stringifyValue(value));\n}\n","<template>\n <div ref=\"inputFieldPasswordRef\">\n <bento-input-field\n ref=\"inputFieldPasswordInputRef\"\n v-bind=\"inputFieldArgs\"\n class=\"b-input-field-password__input\"\n spellcheck=\"false\"\n @input=\"onInput\"\n @keydown=\"checkCapsLock\"\n @keyup=\"checkCapsLock\"\n >\n <template #default>{{ label }}</template>\n\n <template v-if=\"isCapsLockOn\" #iconBefore>\n <div\n class=\"b-input-field-password__caps-lock-indicator\"\n @mouseenter=\"handleCapsLockMouseEnter\"\n @mouseleave=\"handleCapsLockMouseLeave\"\n >\n <bento-image\n ref=\"inputFieldPasswordCapsLockIconRef\"\n :src=\"CapsLockIcon\"\n :alt=\"t('capsLockEnabled')\"\n ></bento-image>\n </div>\n\n <tooltip\n v-if=\"inputFieldPasswordCapsLockIconRef\"\n :class=\"tooltipConditionalClass\"\n :content=\"t('capsLockEnabled')\"\n :disabled-focus-trap=\"true\"\n :fallback-position=\"['top', 'bottom']\"\n :is-shown=\"isTooltipDisplayed\"\n :target-element=\"inputFieldPasswordCapsLockIconRef\"\n ></tooltip>\n </template>\n\n <template v-if=\"!disabled\" #iconAfter>\n <bento-button variant=\"tertiary\" @click=\"toggleInputType\">\n <template #iconLeft>\n <show-icon v-if=\"!isPasswordReadable\" :svg-title=\"t('showPassword')\" />\n\n <hide-icon v-if=\"isPasswordReadable\" :svg-title=\"t('hidePassword')\" />\n </template>\n </bento-button>\n </template>\n </bento-input-field>\n\n <bento-popover\n v-if=\"hasValidations\"\n :open=\"isHintDisplayed\"\n :target-element=\"inputFieldPasswordInputRef\"\n :disable-focus-trap=\"true\"\n :aria-label=\"computedValidations.title\"\n :aria-describedby=\"validationListId\"\n position=\"right-start\"\n >\n <div :id=\"validationPopoverId\">\n <bento-typography v-if=\"computedValidations.title\" class=\"b-input-field-password__validation-title\">\n {{ computedValidations.title }}\n </bento-typography>\n\n <p v-if=\"!hasErrors\" class=\"b-input-field-password__validation-status--valid\" role=\"alert\">\n {{ t('validationValid') }}\n </p>\n\n <ul :id=\"validationListId\" class=\"b-input-field-password__validation-list\">\n <li\n v-for=\"(validation, index) in computedValidations.list\"\n :key=\"index\"\n :class=\"passwordValidityConditionalClass[index]\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n <span class=\"b-input-field-password__validation-list-icon\">\n <checkmark-circle-fill-icon\n v-if=\"passwordValidity[index]\"\n :svg-title=\"t('validationChecked')\"\n />\n\n <dot-icon v-else :svg-title=\"t('validationUnchecked')\" />\n </span>\n\n <bento-typography class=\"b-input-field-password__validation-list-text\" el=\"span\">\n {{ validation.label }}\n </bento-typography>\n </li>\n </ul>\n\n <bento-typography\n v-if=\"computedValidations.suggestion\"\n class=\"b-input-field-password__validation-suggestion\"\n >\n {{ computedValidations.suggestion }}\n </bento-typography>\n </div>\n </bento-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoButton } from '@/components/button';\n import { BentoImage } from '@/components/image';\n import { BentoInputField } from '@/components/input-field';\n import { BentoPopover } from '@/components/popover';\n import { BentoTypography } from '@/components/typography';\n import { Tooltip } from '@/internal';\n import type { BentoInputFieldProps } from '@/components/input-field/input-field.types';\n import {\n BentoInputFieldPasswordDefaultRule,\n BentoInputFieldPasswordErrorsList,\n type BentoInputFieldPasswordProps,\n BentoInputFieldPasswordType,\n BentoInputFieldPasswordValidation,\n } from './input-field-password.types';\n import CheckmarkCircleFillIcon from '@adyen/ui-assets-icons-16/vue/checkmark-circle-fill';\n import DotIcon from '@adyen/ui-assets-icons-16/vue/dot';\n import HideIcon from '@adyen/ui-assets-icons-16/vue/hide';\n import ShowIcon from '@adyen/ui-assets-icons-16/vue/show';\n import CapsLockIcon from './assets/capslock.svg';\n\n import { useFocusWithin, watchDebounced } from '@vueuse/core';\n import { computed, provide, ref, SetupContext, useAttrs, watch } from 'vue';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import {\n minLength,\n requireLowercase,\n requireNumeric,\n requireSpecialCharacter,\n requireUppercase,\n } from '@/components/input-field-password/utilities/input-field-password.validation';\n import { generateUid } from '@/core/utils/ts';\n import messages from './messages.json';\n import { INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY } from '@/components/input-field/input-field.keys';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const DEBOUNCE_DURATION = 500;\n const DEBOUNCE_MAX_WAIT = 2000;\n const TOOLTIP_TIMEOUT = 2000;\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = withDefaults(defineProps<BentoInputFieldPasswordProps>(), {\n condensed: false,\n disabled: false,\n disableValidation: false,\n label: null,\n errorMessage: null,\n placeholder: '',\n readonly: false,\n validation: undefined,\n value: undefined,\n withHint: true,\n });\n\n const emit = defineEmits<{\n /**\n * Emits an `input:valid` event when the value is validated against the provided validations.\n * This emit has a debounce and is emitted after an `input` event.\n */\n (e: 'input:valid'): void;\n\n /**\n * Emits an `input:error` event when the value fails the validation.\n * This emit has a debounce and is emitted after an `input` event.\n */\n (e: 'input:error', errors: BentoInputFieldPasswordErrorsList): void;\n\n /**\n * Emits an `input` event whenever the value in the input is changed.\n */\n (e: 'input', value: BentoInputFieldPasswordProps['value']): void;\n }>();\n\n const attrs = useAttrs();\n\n const inputType = ref(BentoInputFieldPasswordType.PASSWORD);\n const inputValue = ref(props.value);\n const isHintDisplayed = ref(false);\n const isTouched = ref(false);\n const passwordValidity = ref<boolean[]>([]);\n const errorsList = ref<BentoInputFieldPasswordErrorsList>({});\n const capsLockTooltipTimeoutID = ref<ReturnType<typeof setTimeout>>(null);\n const isTooltipDisplayed = ref(false);\n const inputFieldPasswordRef = ref(null);\n const inputFieldPasswordInputRef = ref(null);\n const inputFieldPasswordCapsLockIconRef = ref(null);\n const isCapsLockOn = ref(false);\n\n provide(INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY, 'bento-input-field-password');\n\n const { focused } = useFocusWithin(inputFieldPasswordRef);\n\n const validationListId = generateUid('validationListId');\n const validationPopoverId = generateUid('validationPopoverId');\n\n const isPasswordReadable = computed(() => inputType.value === BentoInputFieldPasswordType.TEXT);\n const computedErrorMessage = computed(() => {\n const hasRealTimeValidationErrors = isTouched.value && hasErrors.value;\n const hasAsyncValidationErrors = props.disableValidation && props.errorMessage;\n\n return hasRealTimeValidationErrors || hasAsyncValidationErrors ? props.errorMessage : '';\n });\n\n const passwordValidityConditionalClass = computed(() =>\n passwordValidity.value.map(validity =>\n validity\n ? 'b-input-field-password__validation-list--valid'\n : 'b-input-field-password__validation-list--invalid'\n )\n );\n\n const tooltipConditionalClass = computed(() =>\n capsLockTooltipTimeoutID.value ? 'b-input-field-password__input-tooltip--timed' : ''\n );\n\n const inputFieldArgs = computed<BentoInputFieldProps & SetupContext['attrs']>(() => ({\n ariaHidden: false,\n condensed: props.condensed,\n disabled: props.disabled,\n errorMessage: computedErrorMessage.value,\n placeholder: props.placeholder,\n readonly: props.readonly,\n type: inputType.value,\n value: inputValue.value,\n\n 'aria-haspopup': hasValidations.value ? 'dialog' : false,\n 'aria-describedby': hasValidations.value ? validationPopoverId : '',\n\n ...attrs,\n }));\n\n const computedValidations = computed<BentoInputFieldPasswordValidation>(() =>\n props.validation === undefined\n ? {\n title: t('validationTitle'),\n suggestion: t('validationSuggestion'),\n list: [\n {\n label: t('validationMinLength'),\n key: BentoInputFieldPasswordDefaultRule.MIN_LENGTH,\n validate: minLength,\n },\n {\n label: t('validationRequireLowercase'),\n key: BentoInputFieldPasswordDefaultRule.REQUIRE_LOWERCASE,\n validate: requireLowercase,\n },\n {\n label: t('validationRequireUppercase'),\n key: BentoInputFieldPasswordDefaultRule.REQUIRE_UPPERCASE,\n validate: requireUppercase,\n },\n {\n label: t('validationRequireNumeric'),\n key: BentoInputFieldPasswordDefaultRule.REQUIRE_NUMERIC,\n validate: requireNumeric,\n },\n {\n label: t('validationRequireSpecialCharacter'),\n key: 'requireSpecialCharacter',\n validate: requireSpecialCharacter,\n },\n ],\n }\n : props.validation\n );\n\n const hasErrors = computed(() => passwordValidity.value.some(validation => !validation));\n const hasValidations = computed(\n () => inputFieldPasswordInputRef.value && computedValidations.value?.list?.length > 0\n );\n\n const checkCapsLock = (e: KeyboardEvent) => {\n // Check if getModifierState exists and is a function in case the user's browser is autofilling\n if (typeof e.getModifierState === 'function') {\n isCapsLockOn.value = e.getModifierState('CapsLock');\n }\n };\n\n const toggleInputType = () => {\n if (isPasswordReadable.value) {\n inputType.value = BentoInputFieldPasswordType.PASSWORD;\n } else {\n inputType.value = BentoInputFieldPasswordType.TEXT;\n }\n };\n\n const onInput = (value: string) => {\n if (props.disabled) {\n return;\n }\n\n inputValue.value = value;\n\n emit('input', inputValue.value);\n };\n\n const checkValidity = (value: BentoInputFieldPasswordProps['value']) => {\n const rulesValidityObj = computedValidations.value?.list?.map(validationItem => ({\n key: validationItem.key,\n label: validationItem.label,\n isValid: validationItem.validate(value, validationItem.additionalArgs),\n }));\n let customRuleIndex = 1;\n\n passwordValidity.value = rulesValidityObj.map(error => error.isValid);\n\n errorsList.value = rulesValidityObj\n .filter(rule => !rule.isValid)\n .reduce((errorsObject, error) => {\n const key = error.key ?? `custom-rule-${customRuleIndex++}`;\n return {\n ...errorsObject,\n [key]: error.label,\n };\n }, {});\n };\n\n const handleCapsLockMouseLeave = () => {\n isTooltipDisplayed.value = false;\n capsLockTooltipTimeoutID.value = null;\n };\n\n const handleCapsLockMouseEnter = () => {\n isTooltipDisplayed.value = true;\n };\n\n watch(focused, focused => {\n // Always set dirty to true when blur occurs\n if (!focused) {\n isTouched.value = true;\n }\n\n // Disable validations & hint if \"disableValidation\" is \"true\"\n if (!props.disableValidation) {\n if (props.withHint) {\n isHintDisplayed.value = focused;\n }\n checkValidity(inputValue.value);\n }\n });\n\n watch(isCapsLockOn, isCapsLockOn => {\n if (!isCapsLockOn) {\n clearTimeout(capsLockTooltipTimeoutID.value);\n\n capsLockTooltipTimeoutID.value = null;\n isTooltipDisplayed.value = false;\n } else {\n isTooltipDisplayed.value = true;\n\n capsLockTooltipTimeoutID.value = setTimeout(() => {\n capsLockTooltipTimeoutID.value = null;\n isTooltipDisplayed.value = false;\n }, TOOLTIP_TIMEOUT);\n }\n });\n\n watchDebounced(\n inputValue,\n inputValue => {\n checkValidity(inputValue);\n\n if (!hasErrors.value) {\n emit('input:valid');\n } else {\n emit('input:error', errorsList.value);\n }\n },\n // wait for 0.5s before checking validity OR 2s of continuous typing\n { debounce: DEBOUNCE_DURATION, maxWait: DEBOUNCE_MAX_WAIT }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * The input field password is a component designed to support users' preference for entering values securely.\n * This is an extension of the `bento-input-field` component.\n *\n * @example\n * import { BentoInputFieldPassword } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoInputFieldPassword },\n * template: `\n * <bento-input-field-password\n * label=\"Label\"\n * error-message=\"Error\"\n * :validation=\"{\n * title: 'Password must contain at least:',\n * suggestion: 'Avoid using currency symbols or accented letters.',\n * list: [\n * { label: '12 characters', key: 'minLength', validate: minLength, additionalArgs: [12] },\n * { label: '1 lowercase (a-z)', key: 'requireLowercase', validate: requireLowercase },\n * { label: '1 uppercase (A-Z)', key: 'requireUppercase', validate: requireUppercase },\n * { label: '1 numerical (0-9)', key: 'requireNumeric', validate: requireNumeric },\n * { label: '1 special character', key: 'requireSpecialCharacter', validate: requireSpecialCharacter },\n * {\n * label: 'Always true',\n * key: 'alwaysTrue',\n * validate: () => {\n * const example = 'Example';\n *\n * return () => example.length > 1;\n * },\n * },\n * ],\n * }\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-input-field-password',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field-password.scss\" />\n"],"names":["BentoInputFieldPasswordType","BentoInputFieldPasswordType2","BentoInputFieldPasswordDefaultRule","BentoInputFieldPasswordDefaultRule2","CapsLockIcon","stringifyValue","value","minLength","length","requireLowercase","requireUppercase","requireNumeric","requireSpecialCharacter","__default__","messages","useI18n","props","__props","emit","__emit","attrs","useAttrs","inputType","ref","inputValue","isHintDisplayed","isTouched","passwordValidity","errorsList","capsLockTooltipTimeoutID","isTooltipDisplayed","inputFieldPasswordRef","inputFieldPasswordInputRef","inputFieldPasswordCapsLockIconRef","isCapsLockOn","provide","INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY","focused","useFocusWithin","validationListId","generateUid","validationPopoverId","isPasswordReadable","computed","computedErrorMessage","hasRealTimeValidationErrors","hasErrors","hasAsyncValidationErrors","passwordValidityConditionalClass","validity","tooltipConditionalClass","inputFieldArgs","hasValidations","computedValidations","validation","_b","_a","checkCapsLock","e","toggleInputType","onInput","checkValidity","rulesValidityObj","validationItem","customRuleIndex","error","rule","errorsObject","key","handleCapsLockMouseLeave","handleCapsLockMouseEnter","watch","focused2","isCapsLockOn2","watchDebounced","inputValue2"],"mappings":";;;;;;;;;;;;;;;;AAwGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAAA,kBAAAC,OACRA,EAAA,aAAA,aACAA,EAAA,oBAAA,oBACAA,EAAA,kBAAA,kBACAA,EAAA,4BAAA,2BACAA,EAAA,oBAAA,oBALQA,IAAAD,KAAA,CAAA,CAAA;AC7GZ,MAAAE,KAAA;ACEA,SAAAC,EAAAC,GAAA;AACI,UAAAA,KAAA,gBAAAA,EAAA,eAAA;AACJ;AASgB,SAAAC,GAAAD,GAAAE,IAAA,IAAA;AACZ,SAAAH,EAAAC,CAAA,EAAA,UAAAE;AACJ;AAQO,SAAAC,GAAAH,GAAA;AACH,SAAA,QAAA,KAAAD,EAAAC,CAAA,CAAA;AACJ;AAQO,SAAAI,GAAAJ,GAAA;AACH,SAAA,QAAA,KAAAD,EAAAC,CAAA,CAAA;AACJ;AAQO,SAAAK,GAAAL,GAAA;AACH,SAAA,KAAA,KAAAD,EAAAC,CAAA,CAAA;AACJ;AAQO,SAAAM,GAAAN,GAAA;AACH,SAAA,eAAA,KAAAD,EAAAC,CAAA,CAAA;AACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gFCyWI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;AAAA,MAA2B,GAAA,GAAA,MAT/B,aAAAD,EAAA,KAAA,GAEAA,EAAA,QAAA,MACAC,EAAA,QAAA;AAAA,IAQJ,CAAA,GAGJ4C;AAAA,MAAAlD;AAAA,MACI,CAAAmD,MAAA;AAEI,QAAAd,EAAAc,CAAA,GAEA7B,EAAA,QAGI5B,EAAA,eAAAU,EAAA,KAAA,IAFAV,EAAA,aAAA;AAAA,MAGJ;AAAA;AAAA,MACJ,EAAA,UAAA,KAAA,SAAA,IAAA;AAAA,IAE0D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"input-field-password._CliYJ7N.js","sources":["../../../vue2/src/components/input-field-password/input-field-password.types.ts","../../../vue2/src/components/input-field-password/assets/capslock.svg","../../../vue2/src/components/input-field-password/utilities/input-field-password.validation.ts","../../../vue2/src/components/input-field-password/input-field-password.vue"],"sourcesContent":["import type { BentoInputFieldProps, BentoInputFieldValue } from '@/components/input-field/input-field.types';\n\n/**\n * Public\n */\n\nexport interface BentoInputFieldPasswordValidationListItem {\n label: string;\n key?: BentoInputFieldPasswordDefaultRuleKeys | string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n validate: (value: BentoInputFieldValue, ...args: any[]) => boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additionalArgs?: any[];\n}\n\nexport type BentoInputFieldPasswordDefaultRuleKeys =\n | 'minLength'\n | 'requireLowercase'\n | 'requireNumeric'\n | 'requireSpecialCharacter'\n | 'requireUppercase';\n\nexport type BentoInputFieldPasswordErrorsList = Record<BentoInputFieldPasswordDefaultRuleKeys | string, string>;\n\nexport interface BentoInputFieldPasswordValidation {\n title?: string;\n suggestion?: string;\n list: BentoInputFieldPasswordValidationListItem[];\n}\n\nexport interface BentoInputFieldPasswordProps {\n /**\n * Reduces height of the input\n */\n condensed?: BentoInputFieldProps['condensed'];\n\n /**\n * Disables the possibility of changing value in the input-field\n */\n disabled?: BentoInputFieldProps['disabled'];\n\n /**\n * Performs real-time validations over the input value. Default: `false`.\n * Disabling the option (set to `true`) will not run pre-defined validations or custom validations defined in the `validation` field.\n */\n disableValidation?: boolean;\n\n /**\n * Renders input-field with an error state and the error message beneath the input box\n */\n errorMessage?: BentoInputFieldProps['errorMessage'];\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder?: BentoInputFieldProps['placeholder'];\n\n /**\n * Setting this property to true will set the input field to read only state.\n */\n readonly?: BentoInputFieldProps['readonly'];\n\n /**\n * Text displayed as the value of the input-field\n */\n value?: BentoInputFieldProps['value'];\n\n /**\n * Label to be shown with the input field\n */\n label?: string;\n\n /**\n * Configuration object for password field validation.\n *\n * This object defines the validation criteria and associated messages for a password field.\n * It includes the following properties:\n *\n * - `title`: The title displayed at the top of the validation hint.\n * - `suggestion`: The message displayed at the bottom of the validation hint, providing additional guidance.\n * - `list`: An array of callback functions to be executed on the value after each user input, validating the password against the specified rules.\n *\n * By default, the validation checks that:\n *\n * - The value has a minimum length of 12 characters.\n * - The value contains at least one lowercase letter.\n * - The value contains at least one uppercase letter.\n * - The value contains at least one numeric digit.\n * - The value contains at least one special character.\n *\n *\n */\n validation?: BentoInputFieldPasswordValidation;\n\n /**\n * Whether the password validation hint is displayed when the input field is activated via focus or input\n */\n withHint?: boolean;\n}\n\n/**\n * Private\n */\n\nexport enum BentoInputFieldPasswordType {\n TEXT = 'text',\n PASSWORD = 'password',\n}\n\nexport enum BentoInputFieldPasswordDefaultRule {\n MIN_LENGTH = 'minLength',\n REQUIRE_LOWERCASE = 'requireLowercase',\n REQUIRE_NUMERIC = 'requireNumeric',\n REQUIRE_SPECIAL_CHARACTER = 'requireSpecialCharacter',\n REQUIRE_UPPERCASE = 'requireUppercase',\n}\n","export default \"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='capslock'%3e%3cg%20id='Union'%3e%3cpath%20d='M13.75%205.63952L8%201.03952L2.25%205.63952V7.74999H4.75V11.75H11.25V7.74999H13.75V5.63952ZM6.25%206.24999H3.88809L8%202.96046L12.1119%206.24999H9.75V10.25H6.25V6.24999Z'%20fill='%2300112C'/%3e%3cpath%20d='M11.25%2014.75V13.25H4.75V14.75H11.25Z'%20fill='%2300112C'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e\"","import { BentoInputFieldValue } from '@/components/input-field';\n\nfunction stringifyValue(value: BentoInputFieldValue): string {\n return value?.toString() ?? '';\n}\n\n/**\n * Validates if the length of the provided value is greater than or equal to the specified length.\n *\n * @param value - The input value to check.\n * @param length - The minimum required length of the value. Defaults to 12.\n * @returns `true` if the length of the value is greater than or equal to the specified length, `false` otherwise.\n */\nexport function minLength(value: BentoInputFieldValue, length = 12): boolean {\n return stringifyValue(value).length >= length;\n}\n\n/**\n * Validates if the provided value contains at least one lowercase letter.\n *\n * @param value - The input value to check.\n * @returns `true` if the value contains at least one lowercase letter, `false` otherwise.\n */\nexport function requireLowercase(value: BentoInputFieldValue): boolean {\n return /[a-z]/.test(stringifyValue(value));\n}\n\n/**\n * Validates if the provided value contains at least one uppercase letter.\n *\n * @param value - The input value to check.\n * @returns `true` if the value contains at least one uppercase letter, `false` otherwise.\n */\nexport function requireUppercase(value: BentoInputFieldValue): boolean {\n return /[A-Z]/.test(stringifyValue(value));\n}\n\n/**\n * Validates if the provided value contains at least one numerical digit.\n *\n * @param value - The input value to check.\n * @returns `true` if the value contains at least one numerical digit, `false` otherwise.\n */\nexport function requireNumeric(value: BentoInputFieldValue): boolean {\n return /\\d/.test(stringifyValue(value));\n}\n\n/**\n * Validates if the provided value contains at least one special character (non-alphanumeric).\n *\n * @param value - The input value to check.\n * @returns `true` if the value contains at least one special character, `false` otherwise.\n */\nexport function requireSpecialCharacter(value: BentoInputFieldValue): boolean {\n return /[^a-zA-Z0-9]/.test(stringifyValue(value));\n}\n","<template>\n <div ref=\"inputFieldPasswordRef\">\n <bento-input-field\n ref=\"inputFieldPasswordInputRef\"\n v-bind=\"inputFieldArgs\"\n class=\"b-input-field-password__input\"\n spellcheck=\"false\"\n @input=\"onInput\"\n @keydown=\"checkCapsLock\"\n @keyup=\"checkCapsLock\"\n >\n <template #default>{{ label }}</template>\n\n <template v-if=\"isCapsLockOn\" #iconBefore>\n <div\n class=\"b-input-field-password__caps-lock-indicator\"\n @mouseenter=\"handleCapsLockMouseEnter\"\n @mouseleave=\"handleCapsLockMouseLeave\"\n >\n <bento-image\n ref=\"inputFieldPasswordCapsLockIconRef\"\n :src=\"CapsLockIcon\"\n :alt=\"t('capsLockEnabled')\"\n ></bento-image>\n </div>\n\n <tooltip\n v-if=\"inputFieldPasswordCapsLockIconRef\"\n :class=\"tooltipConditionalClass\"\n :content=\"t('capsLockEnabled')\"\n :disabled-focus-trap=\"true\"\n :fallback-position=\"['top', 'bottom']\"\n :is-shown=\"isTooltipDisplayed\"\n :target-element=\"inputFieldPasswordCapsLockIconRef\"\n ></tooltip>\n </template>\n\n <template v-if=\"!disabled\" #iconAfter>\n <bento-button variant=\"tertiary\" @click=\"toggleInputType\">\n <template #iconLeft>\n <show-icon v-if=\"!isPasswordReadable\" :svg-title=\"t('showPassword')\" />\n\n <hide-icon v-if=\"isPasswordReadable\" :svg-title=\"t('hidePassword')\" />\n </template>\n </bento-button>\n </template>\n </bento-input-field>\n\n <bento-popover\n v-if=\"hasValidations\"\n :open=\"isHintDisplayed\"\n :target-element=\"inputFieldPasswordInputRef\"\n :disable-focus-trap=\"true\"\n :aria-label=\"computedValidations.title\"\n :aria-describedby=\"validationListId\"\n position=\"right-start\"\n >\n <div :id=\"validationPopoverId\">\n <bento-typography v-if=\"computedValidations.title\" class=\"b-input-field-password__validation-title\">\n {{ computedValidations.title }}\n </bento-typography>\n\n <p v-if=\"!hasErrors\" class=\"b-input-field-password__validation-status--valid\" role=\"alert\">\n {{ t('validationValid') }}\n </p>\n\n <ul :id=\"validationListId\" class=\"b-input-field-password__validation-list\">\n <li\n v-for=\"(validation, index) in computedValidations.list\"\n :key=\"index\"\n :class=\"passwordValidityConditionalClass[index]\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n <span class=\"b-input-field-password__validation-list-icon\">\n <checkmark-circle-fill-icon\n v-if=\"passwordValidity[index]\"\n :svg-title=\"t('validationChecked')\"\n />\n\n <dot-icon v-else :svg-title=\"t('validationUnchecked')\" />\n </span>\n\n <bento-typography class=\"b-input-field-password__validation-list-text\" el=\"span\">\n {{ validation.label }}\n </bento-typography>\n </li>\n </ul>\n\n <bento-typography\n v-if=\"computedValidations.suggestion\"\n class=\"b-input-field-password__validation-suggestion\"\n >\n {{ computedValidations.suggestion }}\n </bento-typography>\n </div>\n </bento-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoButton } from '@/components/button';\n import { BentoImage } from '@/components/image';\n import { BentoInputField } from '@/components/input-field';\n import { BentoPopover } from '@/components/popover';\n import { BentoTypography } from '@/components/typography';\n import { Tooltip } from '@/internal';\n import type { BentoInputFieldProps } from '@/components/input-field/input-field.types';\n import {\n BentoInputFieldPasswordDefaultRule,\n BentoInputFieldPasswordErrorsList,\n type BentoInputFieldPasswordProps,\n BentoInputFieldPasswordType,\n BentoInputFieldPasswordValidation,\n } from './input-field-password.types';\n import CheckmarkCircleFillIcon from '@adyen/ui-assets-icons-16/vue/checkmark-circle-fill';\n import DotIcon from '@adyen/ui-assets-icons-16/vue/dot';\n import HideIcon from '@adyen/ui-assets-icons-16/vue/hide';\n import ShowIcon from '@adyen/ui-assets-icons-16/vue/show';\n import CapsLockIcon from './assets/capslock.svg';\n\n import { useFocusWithin, watchDebounced } from '@vueuse/core';\n import { computed, provide, ref, SetupContext, useAttrs, watch } from 'vue';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import {\n minLength,\n requireLowercase,\n requireNumeric,\n requireSpecialCharacter,\n requireUppercase,\n } from '@/components/input-field-password/utilities/input-field-password.validation';\n import { generateUid } from '@/core/utils/ts';\n import messages from './messages.json';\n import { INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY } from '@/components/input-field/input-field.keys';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const DEBOUNCE_DURATION = 500;\n const DEBOUNCE_MAX_WAIT = 2000;\n const TOOLTIP_TIMEOUT = 2000;\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = withDefaults(defineProps<BentoInputFieldPasswordProps>(), {\n condensed: false,\n disabled: false,\n disableValidation: false,\n label: null,\n errorMessage: null,\n placeholder: '',\n readonly: false,\n validation: undefined,\n value: undefined,\n withHint: true,\n });\n\n const emit = defineEmits<{\n /**\n * Emits an `input:valid` event when the value is validated against the provided validations.\n * This emit has a debounce and is emitted after an `input` event.\n */\n (e: 'input:valid'): void;\n\n /**\n * Emits an `input:error` event when the value fails the validation.\n * This emit has a debounce and is emitted after an `input` event.\n */\n (e: 'input:error', errors: BentoInputFieldPasswordErrorsList): void;\n\n /**\n * Emits an `input` event whenever the value in the input is changed.\n */\n (e: 'input', value: BentoInputFieldPasswordProps['value']): void;\n }>();\n\n const attrs = useAttrs();\n\n const inputType = ref(BentoInputFieldPasswordType.PASSWORD);\n const inputValue = ref(props.value);\n const isHintDisplayed = ref(false);\n const isTouched = ref(false);\n const passwordValidity = ref<boolean[]>([]);\n const errorsList = ref<BentoInputFieldPasswordErrorsList>({});\n const capsLockTooltipTimeoutID = ref<ReturnType<typeof setTimeout>>(null);\n const isTooltipDisplayed = ref(false);\n const inputFieldPasswordRef = ref(null);\n const inputFieldPasswordInputRef = ref(null);\n const inputFieldPasswordCapsLockIconRef = ref(null);\n const isCapsLockOn = ref(false);\n\n provide(INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY, 'bento-input-field-password');\n\n const { focused } = useFocusWithin(inputFieldPasswordRef);\n\n const validationListId = generateUid('validationListId');\n const validationPopoverId = generateUid('validationPopoverId');\n\n const isPasswordReadable = computed(() => inputType.value === BentoInputFieldPasswordType.TEXT);\n const computedErrorMessage = computed(() => {\n const hasRealTimeValidationErrors = isTouched.value && hasErrors.value;\n const hasAsyncValidationErrors = props.disableValidation && props.errorMessage;\n\n return hasRealTimeValidationErrors || hasAsyncValidationErrors ? props.errorMessage : '';\n });\n\n const passwordValidityConditionalClass = computed(() =>\n passwordValidity.value.map(validity =>\n validity\n ? 'b-input-field-password__validation-list--valid'\n : 'b-input-field-password__validation-list--invalid'\n )\n );\n\n const tooltipConditionalClass = computed(() =>\n capsLockTooltipTimeoutID.value ? 'b-input-field-password__input-tooltip--timed' : ''\n );\n\n const inputFieldArgs = computed<BentoInputFieldProps & SetupContext['attrs']>(() => ({\n ariaHidden: false,\n condensed: props.condensed,\n disabled: props.disabled,\n errorMessage: computedErrorMessage.value,\n placeholder: props.placeholder,\n readonly: props.readonly,\n type: inputType.value,\n value: inputValue.value,\n\n 'aria-haspopup': hasValidations.value ? 'dialog' : false,\n 'aria-describedby': hasValidations.value ? validationPopoverId : '',\n\n ...attrs,\n }));\n\n const computedValidations = computed<BentoInputFieldPasswordValidation>(() =>\n props.validation === undefined\n ? {\n title: t('validationTitle'),\n suggestion: t('validationSuggestion'),\n list: [\n {\n label: t('validationMinLength'),\n key: BentoInputFieldPasswordDefaultRule.MIN_LENGTH,\n validate: minLength,\n },\n {\n label: t('validationRequireLowercase'),\n key: BentoInputFieldPasswordDefaultRule.REQUIRE_LOWERCASE,\n validate: requireLowercase,\n },\n {\n label: t('validationRequireUppercase'),\n key: BentoInputFieldPasswordDefaultRule.REQUIRE_UPPERCASE,\n validate: requireUppercase,\n },\n {\n label: t('validationRequireNumeric'),\n key: BentoInputFieldPasswordDefaultRule.REQUIRE_NUMERIC,\n validate: requireNumeric,\n },\n {\n label: t('validationRequireSpecialCharacter'),\n key: 'requireSpecialCharacter',\n validate: requireSpecialCharacter,\n },\n ],\n }\n : props.validation\n );\n\n const hasErrors = computed(() => passwordValidity.value.some(validation => !validation));\n const hasValidations = computed(\n () => inputFieldPasswordInputRef.value && computedValidations.value?.list?.length > 0\n );\n\n const checkCapsLock = (e: KeyboardEvent) => {\n // Check if getModifierState exists and is a function in case the user's browser is autofilling\n if (typeof e.getModifierState === 'function') {\n isCapsLockOn.value = e.getModifierState('CapsLock');\n }\n };\n\n const toggleInputType = () => {\n if (isPasswordReadable.value) {\n inputType.value = BentoInputFieldPasswordType.PASSWORD;\n } else {\n inputType.value = BentoInputFieldPasswordType.TEXT;\n }\n };\n\n const onInput = (value: string) => {\n if (props.disabled) {\n return;\n }\n\n inputValue.value = value;\n\n emit('input', inputValue.value);\n };\n\n const checkValidity = (value: BentoInputFieldPasswordProps['value']) => {\n const rulesValidityObj = computedValidations.value?.list?.map(validationItem => ({\n key: validationItem.key,\n label: validationItem.label,\n isValid: validationItem.validate(value, validationItem.additionalArgs),\n }));\n let customRuleIndex = 1;\n\n passwordValidity.value = rulesValidityObj.map(error => error.isValid);\n\n errorsList.value = rulesValidityObj\n .filter(rule => !rule.isValid)\n .reduce((errorsObject, error) => {\n const key = error.key ?? `custom-rule-${customRuleIndex++}`;\n return {\n ...errorsObject,\n [key]: error.label,\n };\n }, {});\n };\n\n const handleCapsLockMouseLeave = () => {\n isTooltipDisplayed.value = false;\n capsLockTooltipTimeoutID.value = null;\n };\n\n const handleCapsLockMouseEnter = () => {\n isTooltipDisplayed.value = true;\n };\n\n watch(\n () => props.value,\n newValue => {\n inputValue.value = newValue;\n }\n );\n\n watch(focused, focused => {\n // Always set dirty to true when blur occurs\n if (!focused) {\n isTouched.value = true;\n }\n\n // Disable validations & hint if \"disableValidation\" is \"true\"\n if (!props.disableValidation) {\n if (props.withHint) {\n isHintDisplayed.value = focused;\n }\n checkValidity(inputValue.value);\n }\n });\n\n watch(isCapsLockOn, isCapsLockOn => {\n if (!isCapsLockOn) {\n clearTimeout(capsLockTooltipTimeoutID.value);\n\n capsLockTooltipTimeoutID.value = null;\n isTooltipDisplayed.value = false;\n } else {\n isTooltipDisplayed.value = true;\n\n capsLockTooltipTimeoutID.value = setTimeout(() => {\n capsLockTooltipTimeoutID.value = null;\n isTooltipDisplayed.value = false;\n }, TOOLTIP_TIMEOUT);\n }\n });\n\n watchDebounced(\n inputValue,\n inputValue => {\n checkValidity(inputValue);\n\n if (!hasErrors.value) {\n emit('input:valid');\n } else {\n emit('input:error', errorsList.value);\n }\n },\n // wait for 0.5s before checking validity OR 2s of continuous typing\n { debounce: DEBOUNCE_DURATION, maxWait: DEBOUNCE_MAX_WAIT }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * The input field password is a component designed to support users' preference for entering values securely.\n * This is an extension of the `bento-input-field` component.\n *\n * @example\n * import { BentoInputFieldPassword } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoInputFieldPassword },\n * template: `\n * <bento-input-field-password\n * label=\"Label\"\n * error-message=\"Error\"\n * :validation=\"{\n * title: 'Password must contain at least:',\n * suggestion: 'Avoid using currency symbols or accented letters.',\n * list: [\n * { label: '12 characters', key: 'minLength', validate: minLength, additionalArgs: [12] },\n * { label: '1 lowercase (a-z)', key: 'requireLowercase', validate: requireLowercase },\n * { label: '1 uppercase (A-Z)', key: 'requireUppercase', validate: requireUppercase },\n * { label: '1 numerical (0-9)', key: 'requireNumeric', validate: requireNumeric },\n * { label: '1 special character', key: 'requireSpecialCharacter', validate: requireSpecialCharacter },\n * {\n * label: 'Always true',\n * key: 'alwaysTrue',\n * validate: () => {\n * const example = 'Example';\n *\n * return () => example.length > 1;\n * },\n * },\n * ],\n * }\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-input-field-password',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field-password.scss\" />\n"],"names":["BentoInputFieldPasswordType","BentoInputFieldPasswordType2","BentoInputFieldPasswordDefaultRule","BentoInputFieldPasswordDefaultRule2","CapsLockIcon","stringifyValue","value","minLength","length","requireLowercase","requireUppercase","requireNumeric","requireSpecialCharacter","__default__","messages","useI18n","props","__props","emit","__emit","attrs","useAttrs","inputType","ref","inputValue","isHintDisplayed","isTouched","passwordValidity","errorsList","capsLockTooltipTimeoutID","isTooltipDisplayed","inputFieldPasswordRef","inputFieldPasswordInputRef","inputFieldPasswordCapsLockIconRef","isCapsLockOn","provide","INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY","focused","useFocusWithin","validationListId","generateUid","validationPopoverId","isPasswordReadable","computed","computedErrorMessage","hasRealTimeValidationErrors","hasErrors","hasAsyncValidationErrors","passwordValidityConditionalClass","validity","tooltipConditionalClass","inputFieldArgs","hasValidations","computedValidations","validation","_b","_a","checkCapsLock","toggleInputType","onInput","checkValidity","rulesValidityObj","validationItem","customRuleIndex","error","rule","errorsObject","key","handleCapsLockMouseLeave","handleCapsLockMouseEnter","watch","newValue","focused2","isCapsLockOn2","watchDebounced","inputValue2"],"mappings":";;;;;;;;;;;;;;;;AAwGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAAA,kBAAAC,OACRA,EAAA,aAAA,aACAA,EAAA,oBAAA,oBACAA,EAAA,kBAAA,kBACAA,EAAA,4BAAA,2BACAA,EAAA,oBAAA,oBALQA,IAAAD,KAAA,CAAA,CAAA;AC7GZ,MAAAE,KAAA;ACEA,SAAAC,EAAAC,GAAA;AACI,UAAAA,KAAA,gBAAAA,EAAA,eAAA;AACJ;AASgB,SAAAC,GAAAD,GAAAE,IAAA,IAAA;AACZ,SAAAH,EAAAC,CAAA,EAAA,UAAAE;AACJ;AAQO,SAAAC,GAAAH,GAAA;AACH,SAAA,QAAA,KAAAD,EAAAC,CAAA,CAAA;AACJ;AAQO,SAAAI,GAAAJ,GAAA;AACH,SAAA,QAAA,KAAAD,EAAAC,CAAA,CAAA;AACJ;AAQO,SAAAK,GAAAL,GAAA;AACH,SAAA,KAAA,KAAAD,EAAAC,CAAA,CAA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MACI9C,EAAA,QAAA,KAIJV,EAAA,sBACIA,EAAA,aACIS,EAAA,QAAA+C,IAEJZ,EAAApC,EAAA,KAAA;AAAA,IACJ,CAAA,GAGJ8C,EAAApC,GAAA,CAAAuC,MAAA;AACI,MAAAA,KAMI3C,EAAA,QAAA,IAEAD,EAAA,QAAA,WAAA,MAAA;AACI,QAAAA,EAAA,QAAA,MACAC,EAAA,QAAA;AAAA,MAA2B,GAAA,GAAA,MAT/B,aAAAD,EAAA,KAAA,GAEAA,EAAA,QAAA,MACAC,EAAA,QAAA;AAAA,IAQJ,CAAA,GAGJ4C;AAAA,MAAAlD;AAAA,MACI,CAAAmD,MAAA;AAEI,QAAAf,EAAAe,CAAA,GAEA7B,EAAA,QAGI5B,EAAA,eAAAU,EAAA,KAAA,IAFAV,EAAA,aAAA;AAAA,MAGJ;AAAA;AAAA,MACJ,EAAA,UAAA,KAAA,SAAA,IAAA;AAAA,IAE0D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as fe, ref as B, provide as ce, computed as U, onMounted as he, createBlock as ge, openBlock as $t, unref as me, mergeProps as ye, withCtx as ut, createElementBlock as ve, renderSlot as lt, Fragment as Ne, createTextVNode as pe, toDisplayString as Ce, nextTick as be } from "vue";
2
- import { B as Pe } from "./input-field.CR262X1w.js";
3
- import { u as Se } from "./i18n.D9azDLPe.js";
4
- import { b as Ee } from "./dropdown.CQvyjn6d.js";
2
+ import { B as Pe } from "./input-field.Cr1r2STY.js";
3
+ import { u as Se } from "./i18n.B6g5VX0q.js";
4
+ import { b as Ee } from "./dropdown.CVa4_qCe.js";
5
5
  import { p as Ae } from "./typography.DN5eC5ch.js";
6
6
  import { a as Kt, u as xe } from "./use-country-phon-code.DVgE19zT.js";
7
7
  import { _ as Ie } from "./_plugin-vue_export-helper.CHgC5LLL.js";
@@ -3103,4 +3103,4 @@ const Od = ["-", "(", ")", "/", "[", "]", ".", "~"], wd = (e, r, t) => {
3103
3103
  export {
3104
3104
  Kd as i
3105
3105
  };
3106
- //# sourceMappingURL=input-field-phone-number.zf8WxBCn.js.map
3106
+ //# sourceMappingURL=input-field-phone-number.WPcQbE3z.js.map