@adyen/bento-vue2 1.100.0 → 1.101.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.
- package/dist/@types/components.d.ts +2 -0
- package/dist/@types/index.d.ts +145 -15
- package/dist/action-bar.js +1 -1
- package/dist/ai-tag.js +1 -1
- package/dist/anchor-scroller.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/anchor-scroller.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/navigation-menu-group.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/table-of-contents.css +1 -0
- package/dist/button.js +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{action-bar.DxZchfve.js → action-bar.C2ybt5w2.js} +32 -19
- package/dist/chunks/{action-bar.DxZchfve.js.map → action-bar.C2ybt5w2.js.map} +1 -1
- package/dist/chunks/{ai-tag.CD1eQnr_.js → ai-tag.DcQ6Gb-K.js} +15 -11
- package/dist/chunks/{ai-tag.CD1eQnr_.js.map → ai-tag.DcQ6Gb-K.js.map} +1 -1
- package/dist/chunks/anchor-scroller.BjagnSrr.js +138 -0
- package/dist/chunks/anchor-scroller.BjagnSrr.js.map +1 -0
- package/dist/chunks/{base-modal.BbMTTAi5.js → base-modal.DVE-ERAq.js} +5 -5
- package/dist/chunks/{base-modal.BbMTTAi5.js.map → base-modal.DVE-ERAq.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.CpqyoKG5.js → button-actions-with-menu.D0gfA7NK.js} +8 -8
- package/dist/chunks/{button-actions-with-menu.CpqyoKG5.js.map → button-actions-with-menu.D0gfA7NK.js.map} +1 -1
- package/dist/chunks/{button-actions.Dxez8SNL.js → button-actions.IzFrNFdl.js} +2 -2
- package/dist/chunks/{button-actions.Dxez8SNL.js.map → button-actions.IzFrNFdl.js.map} +1 -1
- package/dist/chunks/{calendar.BKddGc3j.js → calendar.C1er_WEQ.js} +3 -3
- package/dist/chunks/{calendar.BKddGc3j.js.map → calendar.C1er_WEQ.js.map} +1 -1
- package/dist/chunks/{card.BzDmgKjO.js → card.CrlT9cUZ.js} +2 -2
- package/dist/chunks/{card.BzDmgKjO.js.map → card.CrlT9cUZ.js.map} +1 -1
- package/dist/chunks/{checkbox-group.mgC7eJkE.js → checkbox-group.DB_jfkk7.js} +3 -3
- package/dist/chunks/{checkbox-group.mgC7eJkE.js.map → checkbox-group.DB_jfkk7.js.map} +1 -1
- package/dist/chunks/{checkbox.CBawZCc6.js → checkbox.h0N7IHm8.js} +2 -2
- package/dist/chunks/{checkbox.CBawZCc6.js.map → checkbox.h0N7IHm8.js.map} +1 -1
- package/dist/chunks/{code-snippet.CY_C6Xyz.js → code-snippet.kMt5cWoQ.js} +4 -4
- package/dist/chunks/{code-snippet.CY_C6Xyz.js.map → code-snippet.kMt5cWoQ.js.map} +1 -1
- package/dist/chunks/{controls-group.BWzCb_GU.js → controls-group.CY_OeZWj.js} +2 -2
- package/dist/chunks/{controls-group.BWzCb_GU.js.map → controls-group.CY_OeZWj.js.map} +1 -1
- package/dist/chunks/{copy.DSFXER-x.js → copy.BZsYGReo.js} +3 -3
- package/dist/chunks/{copy.DSFXER-x.js.map → copy.BZsYGReo.js.map} +1 -1
- package/dist/chunks/{country.nGZJwp_A.js → country.DySY9sbA.js} +3 -3
- package/dist/chunks/{country.nGZJwp_A.js.map → country.DySY9sbA.js.map} +1 -1
- package/dist/chunks/{country.types.jjXwaoMl.js → country.types.8GCHsdGN.js} +264 -12
- package/dist/chunks/{country.types.jjXwaoMl.js.map → country.types.8GCHsdGN.js.map} +1 -1
- package/dist/chunks/{dashboard-section.BtqE_6Zy.js → dashboard-section.C0am_Mg0.js} +4 -4
- package/dist/chunks/{dashboard-section.BtqE_6Zy.js.map → dashboard-section.C0am_Mg0.js.map} +1 -1
- package/dist/chunks/{dashed-underline.Cl158pHL.js → dashed-underline.DsLL0ngM.js} +4 -4
- package/dist/chunks/{dashed-underline.Cl158pHL.js.map → dashed-underline.DsLL0ngM.js.map} +1 -1
- package/dist/chunks/{data-grid-template.yOSdF4nN.js → data-grid-template.CdUOgyY7.js} +4 -4
- package/dist/chunks/{data-grid-template.yOSdF4nN.js.map → data-grid-template.CdUOgyY7.js.map} +1 -1
- package/dist/chunks/{data-grid.D26rPQcn.js → data-grid.Bf6zUdyX.js} +457 -397
- package/dist/chunks/{data-grid.D26rPQcn.js.map → data-grid.Bf6zUdyX.js.map} +1 -1
- package/dist/chunks/{date-picker.nNtLItmg.js → date-picker.BBepKUgO.js} +21 -14
- package/dist/chunks/{date-picker.nNtLItmg.js.map → date-picker.BBepKUgO.js.map} +1 -1
- package/dist/chunks/{date-range-picker.DL-oePHl.js → date-range-picker.D0uLCflx.js} +333 -299
- package/dist/chunks/{date-range-picker.DL-oePHl.js.map → date-range-picker.D0uLCflx.js.map} +1 -1
- package/dist/chunks/{date-time-picker.D89IemgM.js → date-time-picker.BhN_QfHz.js} +33 -26
- package/dist/chunks/{date-time-picker.D89IemgM.js.map → date-time-picker.BhN_QfHz.js.map} +1 -1
- package/dist/chunks/{dialog-page.D_m11exR.js → dialog-page.DmFgW2fj.js} +10 -10
- package/dist/chunks/{dialog-page.D_m11exR.js.map → dialog-page.DmFgW2fj.js.map} +1 -1
- package/dist/chunks/{draggable-handle.BDUQTWrd.js → draggable-handle.CDqrZT_S.js} +455 -446
- package/dist/chunks/{draggable-handle.BDUQTWrd.js.map → draggable-handle.CDqrZT_S.js.map} +1 -1
- package/dist/chunks/{draggable.Jqy1iXq_.js → draggable.Nb5vnT8m.js} +10 -10
- package/dist/chunks/{draggable.Jqy1iXq_.js.map → draggable.Nb5vnT8m.js.map} +1 -1
- package/dist/chunks/{drawer.BuCNjIKQ.js → drawer.BNNqjUfa.js} +5 -5
- package/dist/chunks/{drawer.BuCNjIKQ.js.map → drawer.BNNqjUfa.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.CCItycfH.js → dropdown-tag.kif6bX9j.js} +5 -5
- package/dist/chunks/{dropdown-tag.CCItycfH.js.map → dropdown-tag.kif6bX9j.js.map} +1 -1
- package/dist/chunks/{dropdown.CLHXtH0r.js → dropdown.CNeiCIX1.js} +1168 -981
- package/dist/chunks/dropdown.CNeiCIX1.js.map +1 -0
- package/dist/chunks/{field-label.CkMM3cXO.js → field-label.BK492U-5.js} +2 -2
- package/dist/chunks/{field-label.CkMM3cXO.js.map → field-label.BK492U-5.js.map} +1 -1
- package/dist/chunks/{file-uploader.C1GuWVEI.js → file-uploader.BfYeFveb.js} +178 -149
- package/dist/chunks/{file-uploader.C1GuWVEI.js.map → file-uploader.BfYeFveb.js.map} +1 -1
- package/dist/chunks/{filter-bar.Dq3fo3rZ.js → filter-bar.8e-FTGtC.js} +34 -17
- package/dist/chunks/{filter-bar.Dq3fo3rZ.js.map → filter-bar.8e-FTGtC.js.map} +1 -1
- package/dist/chunks/{focus-trap.CUZQ1kQD.js → focus-trap.Bu-ikp7k.js} +22 -22
- package/dist/chunks/{focus-trap.CUZQ1kQD.js.map → focus-trap.Bu-ikp7k.js.map} +1 -1
- package/dist/chunks/{footer-actions.BB94G3iB.js → footer-actions.Dd7P41be.js} +2 -2
- package/dist/chunks/{footer-actions.BB94G3iB.js.map → footer-actions.Dd7P41be.js.map} +1 -1
- package/dist/chunks/{header-meta.Bq8moJ6A.js → header-meta.fpJBnhvY.js} +4 -4
- package/dist/chunks/{header-meta.Bq8moJ6A.js.map → header-meta.fpJBnhvY.js.map} +1 -1
- package/dist/chunks/{header-with-views.yjk4GuOn.js → header-with-views.CK2y86LY.js} +312 -267
- package/dist/chunks/{header-with-views.yjk4GuOn.js.map → header-with-views.CK2y86LY.js.map} +1 -1
- package/dist/chunks/{header.C8dI-yo1.js → header.BX5Tzbwf.js} +3 -3
- package/dist/chunks/{header.C8dI-yo1.js.map → header.BX5Tzbwf.js.map} +1 -1
- package/dist/chunks/index.v5OGTDYQ.js +685 -0
- package/dist/chunks/{index.BPUMyryR.js.map → index.v5OGTDYQ.js.map} +1 -1
- package/dist/chunks/{info-icon.ZVQsMymB.js → info-icon.W_lLmt4_.js} +3 -3
- package/dist/chunks/{info-icon.ZVQsMymB.js.map → info-icon.W_lLmt4_.js.map} +1 -1
- package/dist/chunks/{input-field-password.Dkty2s5M.js → input-field-password.Bd0EP9aP.js} +67 -52
- package/dist/chunks/{input-field-password.Dkty2s5M.js.map → input-field-password.Bd0EP9aP.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.CdT4hLCR.js → input-field-phone-number.DU6PcBhh.js} +3 -3
- package/dist/chunks/{input-field-phone-number.CdT4hLCR.js.map → input-field-phone-number.DU6PcBhh.js.map} +1 -1
- package/dist/chunks/{input-field.3BC9gdvi.js → input-field.da7JJxbN.js} +3 -3
- package/dist/chunks/{input-field.3BC9gdvi.js.map → input-field.da7JJxbN.js.map} +1 -1
- package/dist/chunks/{input-time.OTVaDCFj.js → input-time.DRgOtk85.js} +3 -3
- package/dist/chunks/{input-time.OTVaDCFj.js.map → input-time.DRgOtk85.js.map} +1 -1
- package/dist/chunks/{inspector.Cas-Z-VC.js → inspector.Cp6Er3Ms.js} +19 -12
- package/dist/chunks/{inspector.Cas-Z-VC.js.map → inspector.Cp6Er3Ms.js.map} +1 -1
- package/dist/chunks/{layout-row.CTBhpBUq.js → layout-row.BJauMQF5.js} +2 -2
- package/dist/chunks/{layout-row.CTBhpBUq.js.map → layout-row.BJauMQF5.js.map} +1 -1
- package/dist/chunks/{list-item.Cf3IFDnG.js → list-item.ueytfaOM.js} +28 -28
- package/dist/chunks/{list-item.Cf3IFDnG.js.map → list-item.ueytfaOM.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.BFW39wpD.js → listbox-option-tag.1fFyp2M_.js} +2 -2
- package/dist/chunks/{listbox-option-tag.BFW39wpD.js.map → listbox-option-tag.1fFyp2M_.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.B1iYD7lc.js → modal-fullscreen.p_FV_vXG.js} +4 -4
- package/dist/chunks/{modal-fullscreen.B1iYD7lc.js.map → modal-fullscreen.p_FV_vXG.js.map} +1 -1
- package/dist/chunks/{modal.Cp2cNQbD.js → modal.DgeYMVDb.js} +4 -4
- package/dist/chunks/{modal.Cp2cNQbD.js.map → modal.DgeYMVDb.js.map} +1 -1
- package/dist/chunks/{navigation-menu-group.Dvs0wWHC.js → navigation-menu-group.BCYHB3Mu.js} +3 -3
- package/dist/chunks/{navigation-menu-group.Dvs0wWHC.js.map → navigation-menu-group.BCYHB3Mu.js.map} +1 -1
- package/dist/chunks/{pagination.9fxG-UWo.js → pagination.CdI10wgA.js} +2 -2
- package/dist/chunks/{pagination.9fxG-UWo.js.map → pagination.CdI10wgA.js.map} +1 -1
- package/dist/chunks/popover.types.BlDGQMDh.js +6 -0
- package/dist/chunks/{popover.types.ZXsQ9bA6.js.map → popover.types.BlDGQMDh.js.map} +1 -1
- package/dist/chunks/{popper-container.dxpRn9a5.js → popper-container.CupcVcH4.js} +2 -2
- package/dist/chunks/{popper-container.dxpRn9a5.js.map → popper-container.CupcVcH4.js.map} +1 -1
- package/dist/chunks/{promo-banner.eVbU1xqj.js → promo-banner.BSM_p36y.js} +2 -2
- package/dist/chunks/{promo-banner.eVbU1xqj.js.map → promo-banner.BSM_p36y.js.map} +1 -1
- package/dist/chunks/{radio-group.D5fpHqkP.js → radio-group.Pt5G8AsM.js} +3 -3
- package/dist/chunks/{radio-group.D5fpHqkP.js.map → radio-group.Pt5G8AsM.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.DYfdUHI6.js → rich-text-editor.DAV5dgA-.js} +115 -109
- package/dist/chunks/{rich-text-editor.DYfdUHI6.js.map → rich-text-editor.DAV5dgA-.js.map} +1 -1
- package/dist/chunks/scroll-to-section.MPzOkzfL.js +111 -0
- package/dist/chunks/scroll-to-section.MPzOkzfL.js.map +1 -0
- package/dist/chunks/{search-bar.d8qlBngk.js → search-bar.B_fGqmSD.js} +3 -3
- package/dist/chunks/{search-bar.d8qlBngk.js.map → search-bar.B_fGqmSD.js.map} +1 -1
- package/dist/chunks/{secondary-nav.BQ6DM8_b.js → secondary-nav.Bi1KX8SE.js} +4 -4
- package/dist/chunks/{secondary-nav.BQ6DM8_b.js.map → secondary-nav.Bi1KX8SE.js.map} +1 -1
- package/dist/chunks/{segmented-control.BOyYIUEp.js → segmented-control.DbsLdnFw.js} +2 -2
- package/dist/chunks/{segmented-control.BOyYIUEp.js.map → segmented-control.DbsLdnFw.js.map} +1 -1
- package/dist/chunks/{selection-card-group.lNZ8z318.js → selection-card-group.CLK_QWBz.js} +3 -3
- package/dist/chunks/{selection-card-group.lNZ8z318.js.map → selection-card-group.CLK_QWBz.js.map} +1 -1
- package/dist/chunks/{sidepanel.CUqjE_-9.js → sidepanel.BMqSdvei.js} +5 -5
- package/dist/chunks/{sidepanel.CUqjE_-9.js.map → sidepanel.BMqSdvei.js.map} +1 -1
- package/dist/chunks/{structured-list-item.jO4KtMuc.js → structured-list-item.BGJkRWzZ.js} +4 -4
- package/dist/chunks/{structured-list-item.jO4KtMuc.js.map → structured-list-item.BGJkRWzZ.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.BsjF5xAH.js → summary-grid.types.DoqqC0Oh.js} +5 -5
- package/dist/chunks/{summary-grid.types.BsjF5xAH.js.map → summary-grid.types.DoqqC0Oh.js.map} +1 -1
- package/dist/chunks/{tab.qhcMgSD1.js → tab.Czc7MNHi.js} +2 -2
- package/dist/chunks/{tab.qhcMgSD1.js.map → tab.Czc7MNHi.js.map} +1 -1
- package/dist/chunks/table-of-contents.qdVwRFSZ.js +102 -0
- package/dist/chunks/table-of-contents.qdVwRFSZ.js.map +1 -0
- package/dist/chunks/{tag.XeZzHnx_.js → tag.iASz63QF.js} +2 -2
- package/dist/chunks/{tag.XeZzHnx_.js.map → tag.iASz63QF.js.map} +1 -1
- package/dist/chunks/{textarea.BOQbOPm4.js → textarea.CF6TlSCO.js} +2 -2
- package/dist/chunks/{textarea.BOQbOPm4.js.map → textarea.CF6TlSCO.js.map} +1 -1
- package/dist/chunks/{timeline-item.DXhpupK_.js → timeline-item.B20jb5oD.js} +6 -6
- package/dist/chunks/{timeline-item.DXhpupK_.js.map → timeline-item.B20jb5oD.js.map} +1 -1
- package/dist/chunks/{tooltip.CGeGVHyl.js → tooltip.BSKGP8TU.js} +3 -3
- package/dist/chunks/{tooltip.CGeGVHyl.js.map → tooltip.BSKGP8TU.js.map} +1 -1
- package/dist/chunks/{tutorial.CAcBuXib.js → tutorial.vDtiRIXg.js} +4 -4
- package/dist/chunks/{tutorial.CAcBuXib.js.map → tutorial.vDtiRIXg.js.map} +1 -1
- package/dist/chunks/{use-bento-delayed-hover.CxJOLxok.js → use-bento-delayed-hover.4geX83Rn.js} +2 -2
- package/dist/chunks/{use-bento-delayed-hover.CxJOLxok.js.map → use-bento-delayed-hover.4geX83Rn.js.map} +1 -1
- package/dist/chunks/{use-country-items.B4j8pAvW.js → use-country-items.CmCRY7QX.js} +3 -3
- package/dist/chunks/{use-country-items.B4j8pAvW.js.map → use-country-items.CmCRY7QX.js.map} +1 -1
- package/dist/chunks/{use-country-phon-code.ByqnuIni.js → use-country-phon-code.BWkb546s.js} +513 -258
- package/dist/chunks/{use-country-phon-code.ByqnuIni.js.map → use-country-phon-code.BWkb546s.js.map} +1 -1
- package/dist/chunks/{use-date-input-formatter.BR_O2GeY.js → use-date-input-formatter.CXmBPNf1.js} +2 -2
- package/dist/chunks/{use-date-input-formatter.BR_O2GeY.js.map → use-date-input-formatter.CXmBPNf1.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/country.js +3 -3
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/date-time-picker.js +1 -1
- package/dist/draggable.js +2 -2
- package/dist/drawer.js +1 -1
- package/dist/dropdown.js +2 -2
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +139 -137
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/input-time.js +1 -1
- package/dist/inspector.js +1 -1
- package/dist/internal.js +11 -11
- package/dist/layout.js +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/navigation-menu.js +1 -1
- package/dist/pagination.js +1 -1
- package/dist/popover.js +2 -2
- package/dist/popper-container.js +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +1 -1
- package/dist/table-of-contents.js +5 -0
- package/dist/table-of-contents.js.map +1 -0
- package/dist/tabs.js +1 -1
- package/dist/tag.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +226 -1
- package/package.json +4 -4
- package/dist/chunks/anchor-scroller.BiHtyUJz.js +0 -198
- package/dist/chunks/anchor-scroller.BiHtyUJz.js.map +0 -1
- package/dist/chunks/dropdown.CLHXtH0r.js.map +0 -1
- package/dist/chunks/index.BPUMyryR.js +0 -729
- package/dist/chunks/popover.types.ZXsQ9bA6.js +0 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as r } from "vue";
|
|
2
|
-
import { b as s } from "./popper-container.
|
|
2
|
+
import { b as s } from "./popper-container.CupcVcH4.js";
|
|
3
3
|
import { I as p } from "./info.CcMZ4aGg.js";
|
|
4
|
-
import { b as a } from "./tooltip.
|
|
4
|
+
import { b as a } from "./tooltip.BSKGP8TU.js";
|
|
5
5
|
import { n as l } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
6
6
|
import "../assets/info-icon.css";
|
|
7
7
|
const _ = {
|
|
@@ -34,4 +34,4 @@ const I = u.exports;
|
|
|
34
34
|
export {
|
|
35
35
|
I as B
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=info-icon.
|
|
37
|
+
//# sourceMappingURL=info-icon.W_lLmt4_.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info-icon.
|
|
1
|
+
{"version":3,"file":"info-icon.W_lLmt4_.js","sources":["../../src/components/info-icon/info-icon.vue"],"sourcesContent":["<template>\n <span\n v-bento-tooltip-directive:[tooltipPosition]=\"tooltipText\"\n :aria-label=\"tooltipText\"\n class=\"b-info-icon\"\n @mouseenter=\"emit('mouseenter', $event)\"\n >\n <info-icon :svg-title=\"tooltipText\" class=\"b-info-icon__svg\" />\n </span>\n</template>\n\n<script setup lang=\"ts\">\n import { PopperContainerPosition } from '@/components/popper-container';\n import { BentoTooltipDirective as vBentoTooltipDirective } from '@/directives';\n import { type BentoInfoIconProps } from './info-icon.types';\n import InfoIcon from '@adyen/ui-assets-icons-16/vue/info';\n\n defineProps({\n tooltipText: null,\n tooltipPosition: { default: PopperContainerPosition.AUTO }\n});\n\n const emit = defineEmits([\"mouseenter\"]);\n</script>\n\n<script lang=\"ts\">\n /**\n * @example\n * <template>\n * <bento-info-icon tooltip-text=\"Text on hover\" />\n * </template>\n *\n * <script setup lang=\"ts\">\n * import { BentoInfoIcon } from '@adyen/bento-vue2';\n * </scrip>\n */\n export default {\n name: 'bento-info-icon',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./info-icon.scss\" />\n"],"names":["__default__"],"mappings":";;;;;;AAoCI,MAAAA,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import { defineComponent as ce, useAttrs as ue, ref as l, provide as pe, computed as c, watch as V } from "vue";
|
|
2
2
|
import { B as ve } from "./button.Df_UH5wZ.js";
|
|
3
3
|
import { B as me } from "./image.C2D2hKat.js";
|
|
4
|
-
import { f as fe, B as he } from "./input-field.
|
|
5
|
-
import { h as be } from "./button-actions.
|
|
4
|
+
import { f as fe, B as he } from "./input-field.da7JJxbN.js";
|
|
5
|
+
import { h as be } from "./button-actions.IzFrNFdl.js";
|
|
6
6
|
import { d as Ce, B as ge } from "./typography.C8lPlsbD.js";
|
|
7
7
|
import { C as we } from "./checkmark-circle-fill.BttTCjrM.js";
|
|
8
8
|
import { D as ke } from "./dot.BW9SneIk.js";
|
|
9
|
-
import { S as Le, H as
|
|
10
|
-
import {
|
|
9
|
+
import { S as Le, H as Re } from "./show.B_mKPF6I.js";
|
|
10
|
+
import { j as _e, k as Oe } from "./index.v5OGTDYQ.js";
|
|
11
11
|
import { u as ye } from "./index.B6WW_F-J.js";
|
|
12
|
-
import { g as
|
|
12
|
+
import { g as D } from "./generate-uid.NJ8tVoha.js";
|
|
13
13
|
import { u as Ee } from "./form-field.D_2g7vaP.js";
|
|
14
|
-
import { T as qe } from "./tooltip.
|
|
14
|
+
import { T as qe } from "./tooltip.BSKGP8TU.js";
|
|
15
15
|
import { n as Pe } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
16
16
|
import "../assets/input-field-password.css";
|
|
17
|
-
var w = /* @__PURE__ */ ((
|
|
17
|
+
var w = /* @__PURE__ */ ((n) => (n.TEXT = "text", n.PASSWORD = "password", n))(w || {}), h = /* @__PURE__ */ ((n) => (n.MIN_LENGTH = "minLength", n.REQUIRE_LOWERCASE = "requireLowercase", n.REQUIRE_NUMERIC = "requireNumeric", n.REQUIRE_SPECIAL_CHARACTER = "requireSpecialCharacter", n.REQUIRE_UPPERCASE = "requireUppercase", n))(h || {});
|
|
18
18
|
const Ve = "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(
|
|
20
|
-
return (
|
|
19
|
+
function k(n) {
|
|
20
|
+
return (n == null ? void 0 : n.toString()) ?? "";
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
return k(
|
|
22
|
+
function Se(n, i = 12) {
|
|
23
|
+
return k(n).length >= i;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
return /[a-z]/.test(k(
|
|
25
|
+
function Te(n) {
|
|
26
|
+
return /[a-z]/.test(k(n));
|
|
27
27
|
}
|
|
28
|
-
function Ie(
|
|
29
|
-
return /[A-Z]/.test(k(
|
|
28
|
+
function Ie(n) {
|
|
29
|
+
return /[A-Z]/.test(k(n));
|
|
30
30
|
}
|
|
31
|
-
function Ue(
|
|
32
|
-
return /\d/.test(k(
|
|
31
|
+
function Ue(n) {
|
|
32
|
+
return /\d/.test(k(n));
|
|
33
33
|
}
|
|
34
|
-
function Ae(
|
|
35
|
-
return /[^a-zA-Z0-9]/.test(k(
|
|
34
|
+
function Ae(n) {
|
|
35
|
+
return /[^a-zA-Z0-9]/.test(k(n));
|
|
36
36
|
}
|
|
37
37
|
const Me = {
|
|
38
38
|
"de-DE": {
|
|
@@ -80,6 +80,21 @@ const Me = {
|
|
|
80
80
|
validationUnchecked: "Unchecked",
|
|
81
81
|
validationValid: "Input is valid"
|
|
82
82
|
},
|
|
83
|
+
"es-419": {
|
|
84
|
+
capsLockEnabled: "Bloqueo de mayúsculas",
|
|
85
|
+
hidePassword: "Ocultar",
|
|
86
|
+
showPassword: "Mostrar",
|
|
87
|
+
validationChecked: "Verificado",
|
|
88
|
+
validationMinLength: "{numberOfCharacters} caracteres",
|
|
89
|
+
validationRequireLowercase: "{numberOne} minúsculas (a-z)",
|
|
90
|
+
validationRequireNumeric: "{numberOne} numérico (0-9)",
|
|
91
|
+
validationRequireSpecialCharacter: "{numberOne} carácter especial",
|
|
92
|
+
validationRequireUppercase: "{numberOne} mayúsculas (A-Z)",
|
|
93
|
+
validationSuggestion: "Evita usar símbolos de moneda o letras acentuadas.",
|
|
94
|
+
validationTitle: "La contraseña debe contener al menos:",
|
|
95
|
+
validationUnchecked: "No verificado",
|
|
96
|
+
validationValid: "La entrada es válida"
|
|
97
|
+
},
|
|
83
98
|
"es-ES": {
|
|
84
99
|
capsLockEnabled: "Bloqueo de mayúsculas",
|
|
85
100
|
hidePassword: "Ocultar",
|
|
@@ -210,16 +225,16 @@ const Me = {
|
|
|
210
225
|
withHint: { type: Boolean, default: !0 }
|
|
211
226
|
},
|
|
212
227
|
emits: ["blur", "focus", "input:valid", "input:error", "input", "update:model-value"],
|
|
213
|
-
setup(
|
|
214
|
-
const a =
|
|
228
|
+
setup(n, { emit: i }) {
|
|
229
|
+
const a = n, { t: e, n: d } = ye(), v = ue(), b = l(w.PASSWORD), u = l(a.modelValue ?? a.value), S = l(!1), T = l(!1), L = l([]), _ = l({}), p = l(null), m = l(!1), I = l(null), U = l(null), J = l(null), O = l(!1);
|
|
215
230
|
pe(fe, "bento-input-field-password");
|
|
216
|
-
const { focused: A } =
|
|
231
|
+
const { focused: A } = _e(I), { emitValue: M } = Ee(i), K = D("validationListId"), N = D("validationPopoverId"), B = c(() => b.value === w.TEXT), j = c(
|
|
217
232
|
() => L.value.map(
|
|
218
233
|
(t) => t ? "b-input-field-password__validation-list--valid" : "b-input-field-password__validation-list--invalid"
|
|
219
234
|
)
|
|
220
|
-
),
|
|
235
|
+
), Y = c(
|
|
221
236
|
() => p.value ? "b-input-field-password__input-tooltip--timed" : ""
|
|
222
|
-
),
|
|
237
|
+
), $ = c(() => ({
|
|
223
238
|
ariaHidden: !1,
|
|
224
239
|
condensed: a.condensed,
|
|
225
240
|
disabled: a.disabled,
|
|
@@ -235,19 +250,19 @@ const Me = {
|
|
|
235
250
|
"aria-describedby": E.value ? N : "",
|
|
236
251
|
...v
|
|
237
252
|
})), y = c(() => {
|
|
238
|
-
var f, C, s, g,
|
|
253
|
+
var f, C, s, g, R, z;
|
|
239
254
|
if (a.validation && !a.validation.extendDefaultValidation)
|
|
240
255
|
return a.validation;
|
|
241
256
|
const t = [
|
|
242
257
|
{
|
|
243
258
|
label: e("validationMinLength", { numberOfCharacters: d(W) }),
|
|
244
259
|
key: h.MIN_LENGTH,
|
|
245
|
-
validate:
|
|
260
|
+
validate: Se
|
|
246
261
|
},
|
|
247
262
|
{
|
|
248
263
|
label: e("validationRequireLowercase", { numberOne: d(1) }),
|
|
249
264
|
key: h.REQUIRE_LOWERCASE,
|
|
250
|
-
validate:
|
|
265
|
+
validate: Te
|
|
251
266
|
},
|
|
252
267
|
{
|
|
253
268
|
label: e("validationRequireUppercase", { numberOne: d(1) }),
|
|
@@ -265,29 +280,29 @@ const Me = {
|
|
|
265
280
|
validate: Ae
|
|
266
281
|
}
|
|
267
282
|
];
|
|
268
|
-
let
|
|
283
|
+
let o = t;
|
|
269
284
|
if (a.validation) {
|
|
270
285
|
const le = t.map((r) => r.key), P = (C = (f = a.validation) == null ? void 0 : f.list) == null ? void 0 : C.map((r) => r.key), re = ((g = (s = a.validation) == null ? void 0 : s.list) == null ? void 0 : g.filter((r) => !le.includes(r.key))) ?? [];
|
|
271
|
-
|
|
272
|
-
var
|
|
273
|
-
return P != null && P.includes(r.key) ? (
|
|
286
|
+
o = [...t.map((r) => {
|
|
287
|
+
var Z, x;
|
|
288
|
+
return P != null && P.includes(r.key) ? (x = (Z = a.validation) == null ? void 0 : Z.list) == null ? void 0 : x.find((de) => de.key === r.key) : r;
|
|
274
289
|
}), ...re];
|
|
275
290
|
}
|
|
276
291
|
return {
|
|
277
|
-
title: ((
|
|
292
|
+
title: ((R = a.validation) == null ? void 0 : R.title) ?? e("validationTitle"),
|
|
278
293
|
suggestion: ((z = a.validation) == null ? void 0 : z.suggestion) ?? e("validationSuggestion"),
|
|
279
|
-
list:
|
|
294
|
+
list: o
|
|
280
295
|
};
|
|
281
296
|
}), F = c(() => {
|
|
282
|
-
var t,
|
|
283
|
-
return (
|
|
297
|
+
var t, o;
|
|
298
|
+
return (o = (t = y.value) == null ? void 0 : t.list) == null ? void 0 : o.filter((f) => !f.disabled);
|
|
284
299
|
}), H = c(() => {
|
|
285
300
|
var t;
|
|
286
|
-
return (t = L.value) == null ? void 0 : t.some((
|
|
301
|
+
return (t = L.value) == null ? void 0 : t.some((o) => !o);
|
|
287
302
|
}), E = c(
|
|
288
303
|
() => {
|
|
289
|
-
var t,
|
|
290
|
-
return U.value && ((
|
|
304
|
+
var t, o;
|
|
305
|
+
return U.value && ((o = (t = y.value) == null ? void 0 : t.list) == null ? void 0 : o.length) > 0;
|
|
291
306
|
}
|
|
292
307
|
), ee = (t) => {
|
|
293
308
|
typeof t.getModifierState == "function" && (O.value = t.getModifierState("CapsLock"));
|
|
@@ -297,24 +312,24 @@ const Me = {
|
|
|
297
312
|
a.disabled || (u.value = t, M(u.value));
|
|
298
313
|
}, te = () => {
|
|
299
314
|
i("focus");
|
|
300
|
-
},
|
|
315
|
+
}, ne = () => {
|
|
301
316
|
i("blur");
|
|
302
317
|
}, q = (t) => {
|
|
303
318
|
var C;
|
|
304
|
-
const
|
|
319
|
+
const o = (C = F.value) == null ? void 0 : C.map((s) => ({
|
|
305
320
|
key: s.key,
|
|
306
321
|
label: s.label,
|
|
307
322
|
isValid: s.validate(t, ...s.additionalArgs ?? [])
|
|
308
323
|
}));
|
|
309
324
|
let f = 1;
|
|
310
|
-
L.value =
|
|
311
|
-
const
|
|
325
|
+
L.value = o == null ? void 0 : o.map((s) => s.isValid), _.value = o == null ? void 0 : o.filter((s) => !s.isValid).reduce((s, g) => {
|
|
326
|
+
const R = g.key ?? `custom-rule-${f++}`;
|
|
312
327
|
return {
|
|
313
328
|
...s,
|
|
314
|
-
[
|
|
329
|
+
[R]: g.label
|
|
315
330
|
};
|
|
316
331
|
}, {});
|
|
317
|
-
},
|
|
332
|
+
}, oe = () => {
|
|
318
333
|
m.value = !1, p.value = null;
|
|
319
334
|
}, se = () => {
|
|
320
335
|
m.value = !0;
|
|
@@ -325,7 +340,7 @@ const Me = {
|
|
|
325
340
|
u.value = a.modelValue ?? a.value;
|
|
326
341
|
}
|
|
327
342
|
), V(A, (t) => {
|
|
328
|
-
t || (
|
|
343
|
+
t || (T.value = !0), a.disableValidation || (a.withHint && (S.value = t), q(u.value));
|
|
329
344
|
}), V(O, (t) => {
|
|
330
345
|
t ? (m.value = !0, p.value = setTimeout(() => {
|
|
331
346
|
p.value = null, m.value = !1;
|
|
@@ -333,7 +348,7 @@ const Me = {
|
|
|
333
348
|
}), Oe(
|
|
334
349
|
u,
|
|
335
350
|
(t) => {
|
|
336
|
-
q(t), H.value ? i("input:error",
|
|
351
|
+
q(t), H.value ? i("input:error", _.value) : i("input:valid");
|
|
337
352
|
},
|
|
338
353
|
// wait for 0.5s before checking validity OR 2s of continuous typing
|
|
339
354
|
{ debounce: a.debounceTime, maxWait: G }
|
|
@@ -342,7 +357,7 @@ const Me = {
|
|
|
342
357
|
`The use of "value" prop in "BentoInputFieldPassword" is no longer supported.
|
|
343
358
|
Use the "v-model" or "model-value" property instead.`,
|
|
344
359
|
"2.0.0"
|
|
345
|
-
), { __sfc: !0, MIN_PASSWORD_LENGTH: W, DEBOUNCE_DURATION: Q, DEBOUNCE_MAX_WAIT: G, TOOLTIP_TIMEOUT: X, t: e, n: d, props: a, emit: i, attrs: v, inputType: b, inputValue: u, isHintDisplayed:
|
|
360
|
+
), { __sfc: !0, MIN_PASSWORD_LENGTH: W, DEBOUNCE_DURATION: Q, DEBOUNCE_MAX_WAIT: G, TOOLTIP_TIMEOUT: X, t: e, n: d, props: a, emit: i, attrs: v, inputType: b, inputValue: u, isHintDisplayed: S, isTouched: T, passwordValidity: L, errorsList: _, capsLockTooltipTimeoutID: p, isTooltipDisplayed: m, inputFieldPasswordRef: I, inputFieldPasswordInputRef: U, inputFieldPasswordCapsLockIconRef: J, isCapsLockOn: O, focused: A, emitValue: M, validationListId: K, validationPopoverId: N, isPasswordReadable: B, passwordValidityConditionalClass: j, tooltipConditionalClass: Y, inputFieldArgs: $, computedValidations: y, computedValidationList: F, hasErrors: H, hasValidations: E, checkCapsLock: ee, toggleInputType: ae, onUpdateModelValue: ie, onFocus: te, onBlur: ne, checkValidity: q, handleCapsLockMouseLeave: oe, handleCapsLockMouseEnter: se, BentoButton: ve, BentoImage: me, BentoInputField: he, BentoPopover: be, BentoTypography: ge, Tooltip: qe, CheckmarkCircleFillIcon: we, DotIcon: ke, HideIcon: Re, ShowIcon: Le, CapsLockIcon: Ve };
|
|
346
361
|
}
|
|
347
362
|
});
|
|
348
363
|
var Fe = function() {
|
|
@@ -368,13 +383,13 @@ var Fe = function() {
|
|
|
368
383
|
null,
|
|
369
384
|
"7a9947ad"
|
|
370
385
|
);
|
|
371
|
-
const
|
|
386
|
+
const oa = ze.exports;
|
|
372
387
|
export {
|
|
373
388
|
Ue as a,
|
|
374
389
|
Ae as b,
|
|
375
390
|
Ie as c,
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
391
|
+
oa as i,
|
|
392
|
+
Se as m,
|
|
393
|
+
Te as r
|
|
379
394
|
};
|
|
380
|
-
//# sourceMappingURL=input-field-password.
|
|
395
|
+
//# sourceMappingURL=input-field-password.Bd0EP9aP.js.map
|
package/dist/chunks/{input-field-password.Dkty2s5M.js.map → input-field-password.Bd0EP9aP.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-field-password.Dkty2s5M.js","sources":["../../src/components/input-field-password/input-field-password.types.ts","../../src/components/input-field-password/assets/capslock.svg","../../src/components/input-field-password/utilities/input-field-password.validation.ts","../../src/components/input-field-password/input-field-password.vue"],"sourcesContent":["import type { BentoInputFieldProps, BentoInputFieldValue } from '@/components/input-field/input-field.types';\nimport { type FormField } from '../../types/form-field';\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: Array<any>) => boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additionalArgs?: Array<any>;\n disabled?: boolean;\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 extendDefaultValidation?: boolean;\n list: Array<BentoInputFieldPasswordValidationListItem>;\n}\n\nexport interface BentoInputFieldPasswordProps extends FormField {\n /**\n * Reduces height of the input\n */\n condensed?: BentoInputFieldProps['condensed'];\n\n /**\n * The debounce time in milliseconds for running validation and emitting the `input` event after the user has stopped typing.\n * This helps to avoid excessive validation checks on every keystroke. Defaults to `500`.\n */\n debounceTime?: number;\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 * Text displayed as the value of the input-field\n * @deprecated Since v2.0.0. Use `v-model` or `model-value` instead.\n */\n value?: BentoInputFieldProps['value'];\n\n /**\n * Text displayed as the value of the input-field\n */\n modelValue?: BentoInputFieldProps['modelValue'];\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 * - `extendDefaultValidation`: Set to true if you want to add your custom rules to the default validation instead of overriding the list.\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 { type 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 autocapitalize=\"none\"\n autocorrect=\"off\"\n spellcheck=\"false\"\n @blur=\"onBlur\"\n @focus=\"onFocus\"\n @update:model-value=\"onUpdateModelValue\"\n @keydown=\"checkCapsLock\"\n @keyup=\"checkCapsLock\"\n >\n <template v-if=\"label\">{{ label }}</template>\n <template v-else><slot /></template>\n <template v-if=\"description\" #description>\n <slot name=\"description\">{{ description }}</slot>\n </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 />\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 />\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 <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=\"(rule, index) in computedValidationList\"\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 {{ rule.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 type BentoInputFieldPasswordErrorsList,\n type BentoInputFieldPasswordProps,\n BentoInputFieldPasswordType,\n type BentoInputFieldPasswordValidation,\n type BentoInputFieldPasswordValidationListItem,\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, type 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 { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n import { deprecate } from '@/utils/ts/deprecate';\n\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 { t, n } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n description: { default: null },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\n label: { default: null },\n optional: { type: Boolean, default: false },\n placeholder: { default: '' },\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n tooltipText: { default: null },\n condensed: { default: false },\n debounceTime: { default: DEBOUNCE_DURATION },\n disableValidation: { type: Boolean, default: false },\n value: { default: undefined },\n modelValue: { default: undefined },\n validation: { default: undefined },\n withHint: { type: Boolean, default: true }\n});\n\n const emit = defineEmits([\"blur\", \"focus\", \"input:valid\", \"input:error\", \"input\", \"update:model-value\"]);\n\n const attrs = useAttrs();\n\n const inputType = ref(BentoInputFieldPasswordType.PASSWORD);\n const inputValue = ref(props.modelValue ?? props.value);\n const isHintDisplayed = ref(false);\n const isTouched = ref(false);\n const passwordValidity = ref<Array<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 { emitValue } = useFormFieldEmits<BentoInputFieldPasswordProps['modelValue']>(emit);\n\n const validationListId = generateUid('validationListId');\n const validationPopoverId = generateUid('validationPopoverId');\n\n const isPasswordReadable = computed(() => inputType.value === BentoInputFieldPasswordType.TEXT);\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: props.errorMessage,\n optional: props.optional,\n placeholder: props.placeholder,\n readonly: props.readonly,\n required: props.required,\n tooltipText: props.tooltipText,\n type: inputType.value,\n modelValue: 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 if (props.validation && !props.validation.extendDefaultValidation) {\n return props.validation;\n }\n\n const defaultValidationList = [\n {\n label: t('validationMinLength', { numberOfCharacters: n(MIN_PASSWORD_LENGTH) }),\n key: BentoInputFieldPasswordDefaultRule.MIN_LENGTH,\n validate: minLength,\n },\n {\n label: t('validationRequireLowercase', { numberOne: n(1) }),\n key: BentoInputFieldPasswordDefaultRule.REQUIRE_LOWERCASE,\n validate: requireLowercase,\n },\n {\n label: t('validationRequireUppercase', { numberOne: n(1) }),\n key: BentoInputFieldPasswordDefaultRule.REQUIRE_UPPERCASE,\n validate: requireUppercase,\n },\n {\n label: t('validationRequireNumeric', { numberOne: n(1) }),\n key: BentoInputFieldPasswordDefaultRule.REQUIRE_NUMERIC,\n validate: requireNumeric,\n },\n {\n label: t('validationRequireSpecialCharacter', { numberOne: n(1) }),\n key: BentoInputFieldPasswordDefaultRule.REQUIRE_SPECIAL_CHARACTER,\n validate: requireSpecialCharacter,\n },\n ];\n\n let validationList: Array<BentoInputFieldPasswordValidationListItem> = defaultValidationList;\n\n if (props.validation) {\n const defaultValidationKeys: Array<string> = defaultValidationList.map(rule => rule.key);\n const customRuleKeys = props.validation?.list?.map(rule => rule.key);\n // remove from the custom list any rules with default keys (rules that are overriding existent rules)\n const customValidationList =\n props.validation?.list?.filter(rule => !defaultValidationKeys.includes(rule.key)) ?? [];\n\n // loop through the default list and replace default rule with the custom rule if it exists\n const validationListWithOverrides = defaultValidationList.map(rule => {\n if (customRuleKeys?.includes(rule.key)) {\n const customRule = props.validation?.list?.find(customRule => customRule.key === rule.key);\n return customRule;\n } else {\n return rule;\n }\n });\n validationList = [...validationListWithOverrides, ...customValidationList];\n }\n\n return {\n title: props.validation?.title ?? t('validationTitle'),\n suggestion: props.validation?.suggestion ?? t('validationSuggestion'),\n list: validationList,\n };\n });\n\n const computedValidationList = computed(() => computedValidations.value?.list?.filter(rule => !rule.disabled));\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 onUpdateModelValue = (value: string) => {\n if (props.disabled) {\n return;\n }\n\n inputValue.value = value;\n\n emitValue(inputValue.value);\n };\n\n const onFocus = () => {\n emit('focus');\n };\n\n const onBlur = () => {\n emit('blur');\n };\n\n const checkValidity = (value: BentoInputFieldPasswordProps['value']) => {\n const rulesValidityObj = computedValidationList.value?.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, props.modelValue],\n () => {\n inputValue.value = props.modelValue ?? props.value;\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: props.debounceTime, maxWait: DEBOUNCE_MAX_WAIT }\n );\n\n if (props.value) {\n deprecate(\n 'BentoInputFieldPassword \"value\" property',\n `The use of \"value\" prop in \"BentoInputFieldPassword\" is no longer supported.\n Use the \"v-model\" or \"model-value\" property instead.`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n const MIN_PASSWORD_LENGTH = 12;\n const DEBOUNCE_DURATION = 500;\n const DEBOUNCE_MAX_WAIT = 2000;\n const TOOLTIP_TIMEOUT = 2000;\n\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 * extendDefaultValidation: true,\n * list: [\n * { label: '18 characters', key: 'minLength', validate: minLength, additionalArgs: [18] },\n * { label: 'Always true', key: 'alwaysTrue', validate: () => true },\n * { key: 'requireSpecialCharacter', disabled: true }\n * ],\n * }\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-input-field-password',\n model: { prop: 'modelValue' },\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","MIN_PASSWORD_LENGTH","DEBOUNCE_DURATION","DEBOUNCE_MAX_WAIT","TOOLTIP_TIMEOUT","__default__","messages","t","n","useI18n","attrs","useAttrs","inputType","ref","inputValue","props","isHintDisplayed","isTouched","passwordValidity","errorsList","capsLockTooltipTimeoutID","isTooltipDisplayed","inputFieldPasswordRef","inputFieldPasswordInputRef","inputFieldPasswordCapsLockIconRef","isCapsLockOn","provide","INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY","focused","useFocusWithin","emitValue","useFormFieldEmits","emit","validationListId","generateUid","validationPopoverId","isPasswordReadable","computed","passwordValidityConditionalClass","validity","tooltipConditionalClass","inputFieldArgs","hasValidations","computedValidations","defaultValidationList","validationList","defaultValidationKeys","rule","customRuleKeys","_b","_a","customValidationList","_d","_c","customRule2","_e","_f","computedValidationList","hasErrors","validation","checkCapsLock","e","toggleInputType","onUpdateModelValue","onFocus","onBlur","checkValidity","rulesValidityObj","validationItem","customRuleIndex","error","errorsObject","key","handleCapsLockMouseLeave","handleCapsLockMouseEnter","watch","focused2","isCapsLockOn2","watchDebounced","inputValue2","deprecate"],"mappings":";;;;;;;;;;;;;;;;AA+FO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,OAAA,QACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA,GAKLE,IAAA,kBAAAC,OACHA,EAAA,aAAA,aACAA,EAAA,oBAAA,oBACAA,EAAA,kBAAA,kBACAA,EAAA,4BAAA,2BACAA,EAAA,oBAAA,oBALQA,IAAAD,KAAA,CAAA,CAAA;ACpGZ,MAAAE,KAAA;ACEA,SAAAC,EAAAC,GAAA;AACI,UAAAA,KAAA,gBAAAA,EAAA,eAAA;AACJ;AASO,SAAAC,GAAAD,GAAAE,IAAA,IAAA;AACH,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GCkXIO,IAAA,IACAC,IAAA,KACAC,IAAA,KACAC,IAAA,KA2BAC,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,GAAA;AAAA,EACM,MAAA;AAAA,EACX,OAAA,EAAA,MAAA,aAAA;AAEV;;;;;;;;;;;;;;;;;;;;;;iBArTA,EAAA,GAAAC,G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A;AACI,QAAAA,EAAA,QAAA,MACAC,EAAA,QAAA;AAAA,MAA2B,GAAAjB,CAAA,MAT/B,aAAAgB,EAAA,KAAA,GAEAA,EAAA,QAAA,MACAC,EAAA,QAAA;AAAA,IAQJ,CAAA,GAGJyD;AAAA,MAAAhE;AAAA,MACI,CAAAiE,MAAA;AAEI,QAAAb,EAAAa,CAAA,GAEArB,EAAA,QAGI1B,EAAA,eAAAb,EAAA,KAAA,IAFAa,EAAA,aAAA;AAAA,MAGJ;AAAA;AAAA,MACJ,EAAA,UAAAjB,EAAA,cAAA,SAAAZ,EAAA;AAAA,IAE2D,GAG/DY,EAAA,SACIiE;AAAA,MAAA;AAAA,MACI;AAAA;AAAA,MACA;AAAA,IAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"input-field-password.Bd0EP9aP.js","sources":["../../src/components/input-field-password/input-field-password.types.ts","../../src/components/input-field-password/assets/capslock.svg","../../src/components/input-field-password/utilities/input-field-password.validation.ts","../../src/components/input-field-password/input-field-password.vue"],"sourcesContent":["import type { BentoInputFieldProps, BentoInputFieldValue } from '@/components/input-field/input-field.types';\nimport { type FormField } from '../../types/form-field';\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: Array<any>) => boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additionalArgs?: Array<any>;\n disabled?: boolean;\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 extendDefaultValidation?: boolean;\n list: Array<BentoInputFieldPasswordValidationListItem>;\n}\n\nexport interface BentoInputFieldPasswordProps extends FormField {\n /**\n * Reduces height of the input\n */\n condensed?: BentoInputFieldProps['condensed'];\n\n /**\n * The debounce time in milliseconds for running validation and emitting the `input` event after the user has stopped typing.\n * This helps to avoid excessive validation checks on every keystroke. Defaults to `500`.\n */\n debounceTime?: number;\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 * Text displayed as the value of the input-field\n * @deprecated Since v2.0.0. Use `v-model` or `model-value` instead.\n */\n value?: BentoInputFieldProps['value'];\n\n /**\n * Text displayed as the value of the input-field\n */\n modelValue?: BentoInputFieldProps['modelValue'];\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 * - `extendDefaultValidation`: Set to true if you want to add your custom rules to the default validation instead of overriding the list.\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 { type 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 autocapitalize=\"none\"\n autocorrect=\"off\"\n spellcheck=\"false\"\n @blur=\"onBlur\"\n @focus=\"onFocus\"\n @update:model-value=\"onUpdateModelValue\"\n @keydown=\"checkCapsLock\"\n @keyup=\"checkCapsLock\"\n >\n <template v-if=\"label\">{{ label }}</template>\n <template v-else><slot /></template>\n <template v-if=\"description\" #description>\n <slot name=\"description\">{{ description }}</slot>\n </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 />\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 />\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 <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=\"(rule, index) in computedValidationList\"\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 {{ rule.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 type BentoInputFieldPasswordErrorsList,\n type BentoInputFieldPasswordProps,\n BentoInputFieldPasswordType,\n type BentoInputFieldPasswordValidation,\n type BentoInputFieldPasswordValidationListItem,\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, type 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 { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n import { deprecate } from '@/utils/ts/deprecate';\n\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 { t, n } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n description: { default: null },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\n label: { default: null },\n optional: { type: Boolean, default: false },\n placeholder: { default: '' },\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n tooltipText: { default: null },\n condensed: { default: false },\n debounceTime: { default: DEBOUNCE_DURATION },\n disableValidation: { type: Boolean, default: false },\n value: { default: undefined },\n modelValue: { default: undefined },\n validation: { default: undefined },\n withHint: { type: Boolean, default: true }\n});\n\n const emit = defineEmits([\"blur\", \"focus\", \"input:valid\", \"input:error\", \"input\", \"update:model-value\"]);\n\n const attrs = useAttrs();\n\n const inputType = ref(BentoInputFieldPasswordType.PASSWORD);\n const inputValue = ref(props.modelValue ?? props.value);\n const isHintDisplayed = ref(false);\n const isTouched = ref(false);\n const passwordValidity = ref<Array<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 { emitValue } = useFormFieldEmits<BentoInputFieldPasswordProps['modelValue']>(emit);\n\n const validationListId = generateUid('validationListId');\n const validationPopoverId = generateUid('validationPopoverId');\n\n const isPasswordReadable = computed(() => inputType.value === BentoInputFieldPasswordType.TEXT);\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: props.errorMessage,\n optional: props.optional,\n placeholder: props.placeholder,\n readonly: props.readonly,\n required: props.required,\n tooltipText: props.tooltipText,\n type: inputType.value,\n modelValue: 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 if (props.validation && !props.validation.extendDefaultValidation) {\n return props.validation;\n }\n\n const defaultValidationList = [\n {\n label: t('validationMinLength', { numberOfCharacters: n(MIN_PASSWORD_LENGTH) }),\n key: BentoInputFieldPasswordDefaultRule.MIN_LENGTH,\n validate: minLength,\n },\n {\n label: t('validationRequireLowercase', { numberOne: n(1) }),\n key: BentoInputFieldPasswordDefaultRule.REQUIRE_LOWERCASE,\n validate: requireLowercase,\n },\n {\n label: t('validationRequireUppercase', { numberOne: n(1) }),\n key: BentoInputFieldPasswordDefaultRule.REQUIRE_UPPERCASE,\n validate: requireUppercase,\n },\n {\n label: t('validationRequireNumeric', { numberOne: n(1) }),\n key: BentoInputFieldPasswordDefaultRule.REQUIRE_NUMERIC,\n validate: requireNumeric,\n },\n {\n label: t('validationRequireSpecialCharacter', { numberOne: n(1) }),\n key: BentoInputFieldPasswordDefaultRule.REQUIRE_SPECIAL_CHARACTER,\n validate: requireSpecialCharacter,\n },\n ];\n\n let validationList: Array<BentoInputFieldPasswordValidationListItem> = defaultValidationList;\n\n if (props.validation) {\n const defaultValidationKeys: Array<string> = defaultValidationList.map(rule => rule.key);\n const customRuleKeys = props.validation?.list?.map(rule => rule.key);\n // remove from the custom list any rules with default keys (rules that are overriding existent rules)\n const customValidationList =\n props.validation?.list?.filter(rule => !defaultValidationKeys.includes(rule.key)) ?? [];\n\n // loop through the default list and replace default rule with the custom rule if it exists\n const validationListWithOverrides = defaultValidationList.map(rule => {\n if (customRuleKeys?.includes(rule.key)) {\n const customRule = props.validation?.list?.find(customRule => customRule.key === rule.key);\n return customRule;\n } else {\n return rule;\n }\n });\n validationList = [...validationListWithOverrides, ...customValidationList];\n }\n\n return {\n title: props.validation?.title ?? t('validationTitle'),\n suggestion: props.validation?.suggestion ?? t('validationSuggestion'),\n list: validationList,\n };\n });\n\n const computedValidationList = computed(() => computedValidations.value?.list?.filter(rule => !rule.disabled));\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 onUpdateModelValue = (value: string) => {\n if (props.disabled) {\n return;\n }\n\n inputValue.value = value;\n\n emitValue(inputValue.value);\n };\n\n const onFocus = () => {\n emit('focus');\n };\n\n const onBlur = () => {\n emit('blur');\n };\n\n const checkValidity = (value: BentoInputFieldPasswordProps['value']) => {\n const rulesValidityObj = computedValidationList.value?.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, props.modelValue],\n () => {\n inputValue.value = props.modelValue ?? props.value;\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: props.debounceTime, maxWait: DEBOUNCE_MAX_WAIT }\n );\n\n if (props.value) {\n deprecate(\n 'BentoInputFieldPassword \"value\" property',\n `The use of \"value\" prop in \"BentoInputFieldPassword\" is no longer supported.\n Use the \"v-model\" or \"model-value\" property instead.`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n const MIN_PASSWORD_LENGTH = 12;\n const DEBOUNCE_DURATION = 500;\n const DEBOUNCE_MAX_WAIT = 2000;\n const TOOLTIP_TIMEOUT = 2000;\n\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 * extendDefaultValidation: true,\n * list: [\n * { label: '18 characters', key: 'minLength', validate: minLength, additionalArgs: [18] },\n * { label: 'Always true', key: 'alwaysTrue', validate: () => true },\n * { key: 'requireSpecialCharacter', disabled: true }\n * ],\n * }\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-input-field-password',\n model: { prop: 'modelValue' },\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","MIN_PASSWORD_LENGTH","DEBOUNCE_DURATION","DEBOUNCE_MAX_WAIT","TOOLTIP_TIMEOUT","__default__","messages","t","n","useI18n","attrs","useAttrs","inputType","ref","inputValue","props","isHintDisplayed","isTouched","passwordValidity","errorsList","capsLockTooltipTimeoutID","isTooltipDisplayed","inputFieldPasswordRef","inputFieldPasswordInputRef","inputFieldPasswordCapsLockIconRef","isCapsLockOn","provide","INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY","focused","useFocusWithin","emitValue","useFormFieldEmits","emit","validationListId","generateUid","validationPopoverId","isPasswordReadable","computed","passwordValidityConditionalClass","validity","tooltipConditionalClass","inputFieldArgs","hasValidations","computedValidations","defaultValidationList","validationList","defaultValidationKeys","rule","customRuleKeys","_b","_a","customValidationList","_d","_c","customRule2","_e","_f","computedValidationList","hasErrors","validation","checkCapsLock","e","toggleInputType","onUpdateModelValue","onFocus","onBlur","checkValidity","rulesValidityObj","validationItem","customRuleIndex","error","errorsObject","key","handleCapsLockMouseLeave","handleCapsLockMouseEnter","watch","focused2","isCapsLockOn2","watchDebounced","inputValue2","deprecate"],"mappings":";;;;;;;;;;;;;;;;AA+FO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,OAAA,QACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA,GAKLE,IAAA,kBAAAC,OACHA,EAAA,aAAA,aACAA,EAAA,oBAAA,oBACAA,EAAA,kBAAA,kBACAA,EAAA,4BAAA,2BACAA,EAAA,oBAAA,oBALQA,IAAAD,KAAA,CAAA,CAAA;ACpGZ,MAAAE,KAAA;ACEA,SAAAC,EAAAC,GAAA;AACI,UAAAA,KAAA,gBAAAA,EAAA,eAAA;AACJ;AASO,SAAAC,GAAAD,GAAAE,IAAA,IAAA;AACH,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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