@adyen/bento-vue2 2.0.1 → 2.1.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/README.md +2 -2
- package/dist/@types/index.d.ts +114 -82
- package/dist/accordion.js +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/ai-tag.js +1 -1
- package/dist/alert.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/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/chip.css +1 -1
- package/dist/assets/currency.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/draggable.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/header-with-views.css +1 -1
- package/dist/assets/input-field.css +1 -1
- package/dist/assets/input-time.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/pagination.css +1 -1
- package/dist/assets/rich-text-editor.css +1 -1
- package/dist/assets/search-bar.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/selection-card-group.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/step.css +1 -1
- package/dist/assets/structured-list-item.css +1 -1
- package/dist/assets/tab.css +1 -1
- package/dist/assets/textarea.css +1 -1
- package/dist/assets/toggle.css +1 -1
- package/dist/assets/typography.css +1 -1
- package/dist/avatar.js +1 -1
- package/dist/button.js +3 -3
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chip.js +1 -1
- package/dist/chunks/{accordion-item.B7lteJBu.js → accordion-item.C158YxId.js} +5 -5
- package/dist/chunks/{accordion-item.B7lteJBu.js.map → accordion-item.C158YxId.js.map} +1 -1
- package/dist/chunks/{action-bar.BsXW7BI2.js → action-bar.D29UQHoA.js} +15 -15
- package/dist/chunks/{action-bar.BsXW7BI2.js.map → action-bar.D29UQHoA.js.map} +1 -1
- package/dist/chunks/{ai-button.BnFk5CzK.js → ai-button.qEaHYybv.js} +3 -3
- package/dist/chunks/{ai-button.BnFk5CzK.js.map → ai-button.qEaHYybv.js.map} +1 -1
- package/dist/chunks/{ai-tag.D2Q0xhFK.js → ai-tag.BLi-Xoh_.js} +3 -3
- package/dist/chunks/{ai-tag.D2Q0xhFK.js.map → ai-tag.BLi-Xoh_.js.map} +1 -1
- package/dist/chunks/{alert.DJDHwVeR.js → alert.BddJPWMN.js} +3 -3
- package/dist/chunks/{alert.DJDHwVeR.js.map → alert.BddJPWMN.js.map} +1 -1
- package/dist/chunks/{anchor-scroller.BbvghQxZ.js → anchor-scroller.Clb_9RNz.js} +5 -5
- package/dist/chunks/{anchor-scroller.BbvghQxZ.js.map → anchor-scroller.Clb_9RNz.js.map} +1 -1
- package/dist/chunks/{avatar.CxPKc8Gy.js → avatar.BN4MI-42.js} +2 -2
- package/dist/chunks/{avatar.CxPKc8Gy.js.map → avatar.BN4MI-42.js.map} +1 -1
- package/dist/chunks/{base-button.DOhHyU7x.js → base-button.DYroENBg.js} +3 -3
- package/dist/chunks/{base-button.DOhHyU7x.js.map → base-button.DYroENBg.js.map} +1 -1
- package/dist/chunks/{base-modal.CcmoTJdc.js → base-modal._-Cc6jfi.js} +6 -6
- package/dist/chunks/{base-modal.CcmoTJdc.js.map → base-modal._-Cc6jfi.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.BY394ars.js → button-actions-with-menu.1vZJWN1K.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.BY394ars.js.map → button-actions-with-menu.1vZJWN1K.js.map} +1 -1
- package/dist/chunks/{button-actions.bkcLUE1G.js → button-actions.CdetBz3J.js} +8 -8
- package/dist/chunks/button-actions.CdetBz3J.js.map +1 -0
- package/dist/chunks/button-actions.types.BptAXjD8.js.map +1 -1
- package/dist/chunks/{button.DII5Ifwa.js → button.tsTeQRcP.js} +3 -3
- package/dist/chunks/{button.DII5Ifwa.js.map → button.tsTeQRcP.js.map} +1 -1
- package/dist/chunks/{calendar.CXdLEeN4.js → calendar.BalfhApP.js} +293 -290
- package/dist/chunks/calendar.BalfhApP.js.map +1 -0
- package/dist/chunks/{card.BmpB0VbL.js → card.BhhC01dV.js} +7 -7
- package/dist/chunks/{card.BmpB0VbL.js.map → card.BhhC01dV.js.map} +1 -1
- package/dist/chunks/{checkbox-group.D1uyc3z3.js → checkbox-group.C-1v4X3c.js} +4 -4
- package/dist/chunks/{checkbox-group.D1uyc3z3.js.map → checkbox-group.C-1v4X3c.js.map} +1 -1
- package/dist/chunks/{checkbox.D5xZ5Nnh.js → checkbox.CnuIUi4-.js} +6 -6
- package/dist/chunks/{checkbox.D5xZ5Nnh.js.map → checkbox.CnuIUi4-.js.map} +1 -1
- package/dist/chunks/{chip.DRsJylWl.js → chip.Cc4f2vws.js} +14 -12
- package/dist/chunks/{chip.DRsJylWl.js.map → chip.Cc4f2vws.js.map} +1 -1
- package/dist/chunks/{code-snippet.CnThWqVb.js → code-snippet.Bkd8R0vf.js} +6 -6
- package/dist/chunks/{code-snippet.CnThWqVb.js.map → code-snippet.Bkd8R0vf.js.map} +1 -1
- package/dist/chunks/{controls-group.fdGc6epa.js → controls-group.Bku83Fm_.js} +3 -3
- package/dist/chunks/{controls-group.fdGc6epa.js.map → controls-group.Bku83Fm_.js.map} +1 -1
- package/dist/chunks/{copy.CSk1rCRo.js → copy.B12-P_8A.js} +3 -3
- package/dist/chunks/{copy.CSk1rCRo.js.map → copy.B12-P_8A.js.map} +1 -1
- package/dist/chunks/{country.UZbwr635.js → country._NpkT-91.js} +2 -2
- package/dist/chunks/{country.UZbwr635.js.map → country._NpkT-91.js.map} +1 -1
- package/dist/chunks/country.types.BCOrkmVK.js.map +1 -1
- package/dist/chunks/{currency.POwX-Trj.js → currency.BXsSGoWa.js} +4 -4
- package/dist/chunks/{currency.POwX-Trj.js.map → currency.BXsSGoWa.js.map} +1 -1
- package/dist/chunks/{dashboard-section.CYEoNH9Q.js → dashboard-section.yS2FNoIV.js} +3 -3
- package/dist/chunks/{dashboard-section.CYEoNH9Q.js.map → dashboard-section.yS2FNoIV.js.map} +1 -1
- package/dist/chunks/{dashed-underline.CzKc-fJW.js → dashed-underline.RcRbre03.js} +4 -4
- package/dist/chunks/{dashed-underline.CzKc-fJW.js.map → dashed-underline.RcRbre03.js.map} +1 -1
- package/dist/chunks/{data-grid-template.DCwzh2G7.js → data-grid-template.B5A9whlD.js} +4 -4
- package/dist/chunks/{data-grid-template.DCwzh2G7.js.map → data-grid-template.B5A9whlD.js.map} +1 -1
- package/dist/chunks/{data-grid.CMxQpfrY.js → data-grid.Pg5iM8CJ.js} +25 -25
- package/dist/chunks/{data-grid.CMxQpfrY.js.map → data-grid.Pg5iM8CJ.js.map} +1 -1
- package/dist/chunks/{date-picker.gDsw8bn1.js → date-picker.RFus1MVJ.js} +9 -9
- package/dist/chunks/{date-picker.gDsw8bn1.js.map → date-picker.RFus1MVJ.js.map} +1 -1
- package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -1
- package/dist/chunks/{date-range-picker.CqixIJxG.js → date-range-picker.B2B4hO6R.js} +411 -370
- package/dist/chunks/date-range-picker.B2B4hO6R.js.map +1 -0
- package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -1
- package/dist/chunks/{date-time-picker.Bktntun4.js → date-time-picker.DJxDa81N.js} +6 -6
- package/dist/chunks/{date-time-picker.Bktntun4.js.map → date-time-picker.DJxDa81N.js.map} +1 -1
- package/dist/chunks/{date.CPo8t1n9.js → date.P3Xx7JdV.js} +2 -2
- package/dist/chunks/{date.CPo8t1n9.js.map → date.P3Xx7JdV.js.map} +1 -1
- package/dist/chunks/{dialog-page.Bct3zOQO.js → dialog-page.DORdXmEm.js} +3 -3
- package/dist/chunks/{dialog-page.Bct3zOQO.js.map → dialog-page.DORdXmEm.js.map} +1 -1
- package/dist/chunks/{draggable-handle.DgVdGC1V.js → draggable-handle.BM07OVdH.js} +2 -2
- package/dist/chunks/{draggable-handle.DgVdGC1V.js.map → draggable-handle.BM07OVdH.js.map} +1 -1
- package/dist/chunks/{draggable.DYKdXdbj.js → draggable.BczXedk7.js} +59 -56
- package/dist/chunks/draggable.BczXedk7.js.map +1 -0
- package/dist/chunks/{dropdown-tag.Dk7SooVv.js → dropdown-tag.BmUNKoNw.js} +7 -7
- package/dist/chunks/{dropdown-tag.Dk7SooVv.js.map → dropdown-tag.BmUNKoNw.js.map} +1 -1
- package/dist/chunks/{dropdown.Bnq4kP7k.js → dropdown.CpZQYisR.js} +9 -9
- package/dist/chunks/{dropdown.Bnq4kP7k.js.map → dropdown.CpZQYisR.js.map} +1 -1
- package/dist/chunks/{empty-state.C2wjdE3y.js → empty-state.L3DTfiY7.js} +4 -4
- package/dist/chunks/{empty-state.C2wjdE3y.js.map → empty-state.L3DTfiY7.js.map} +1 -1
- package/dist/chunks/{error-message.DKnoUezI.js → error-message.B-n8wzFo.js} +2 -2
- package/dist/chunks/{error-message.DKnoUezI.js.map → error-message.B-n8wzFo.js.map} +1 -1
- package/dist/chunks/es6.yPcTMnSH.js.map +1 -1
- package/dist/chunks/{field-label.C7BCsofY.js → field-label.BQaDr37D.js} +3 -3
- package/dist/chunks/{field-label.C7BCsofY.js.map → field-label.BQaDr37D.js.map} +1 -1
- package/dist/chunks/{file-uploader.DllKBmP8.js → file-uploader.Bo17jWtf.js} +11 -11
- package/dist/chunks/{file-uploader.DllKBmP8.js.map → file-uploader.Bo17jWtf.js.map} +1 -1
- package/dist/chunks/{filter-bar.D7Lk7wlq.js → filter-bar.Bio9nf9V.js} +28 -27
- package/dist/chunks/filter-bar.Bio9nf9V.js.map +1 -0
- package/dist/chunks/{fixed-scroller.YC4bZifw.js → fixed-scroller.CHmrgoTQ.js} +2 -2
- package/dist/chunks/{fixed-scroller.YC4bZifw.js.map → fixed-scroller.CHmrgoTQ.js.map} +1 -1
- package/dist/chunks/{footer-actions.C9STwwcv.js → footer-actions.B8f-gEQV.js} +4 -4
- package/dist/chunks/{footer-actions.C9STwwcv.js.map → footer-actions.B8f-gEQV.js.map} +1 -1
- package/dist/chunks/{form-layout-group.D4T0Z5xk.js → form-layout-group.BSC2esG8.js} +2 -2
- package/dist/chunks/{form-layout-group.D4T0Z5xk.js.map → form-layout-group.BSC2esG8.js.map} +1 -1
- package/dist/chunks/{form-layout-title.C0lwzPZz.js → form-layout-title.b2BMYjnl.js} +3 -3
- package/dist/chunks/{form-layout-title.C0lwzPZz.js.map → form-layout-title.b2BMYjnl.js.map} +1 -1
- package/dist/chunks/{header-with-views.BqobE7IF.js → header-with-views.BJCjvhem.js} +16 -16
- package/dist/chunks/{header-with-views.BqobE7IF.js.map → header-with-views.BJCjvhem.js.map} +1 -1
- package/dist/chunks/{header.CmyqVXuG.js → header.CDiold9n.js} +5 -5
- package/dist/chunks/{header.CmyqVXuG.js.map → header.CDiold9n.js.map} +1 -1
- package/dist/chunks/{info-icon-with-popover.BvYyGm4D.js → info-icon-with-popover.BzGVcMqy.js} +3 -3
- package/dist/chunks/{info-icon-with-popover.BvYyGm4D.js.map → info-icon-with-popover.BzGVcMqy.js.map} +1 -1
- package/dist/chunks/{info-icon.B-FAeceD.js → info-icon.D11usblr.js} +2 -2
- package/dist/chunks/{info-icon.B-FAeceD.js.map → info-icon.D11usblr.js.map} +1 -1
- package/dist/chunks/{input-field-password.9bWhLud0.js → input-field-password.D4Jn2yCi.js} +6 -6
- package/dist/chunks/{input-field-password.9bWhLud0.js.map → input-field-password.D4Jn2yCi.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.CCn1N9St.js → input-field-phone-number.lV7yePoJ.js} +3 -3
- package/dist/chunks/{input-field-phone-number.CCn1N9St.js.map → input-field-phone-number.lV7yePoJ.js.map} +1 -1
- package/dist/chunks/{input-field.D912rZS_.js → input-field.90DWNO1a.js} +7 -7
- package/dist/chunks/{input-field.D912rZS_.js.map → input-field.90DWNO1a.js.map} +1 -1
- package/dist/chunks/input-time.D7IsprlH.js +157 -0
- package/dist/chunks/input-time.D7IsprlH.js.map +1 -0
- package/dist/chunks/{inspector-page.BRC_7uro.js → inspector-page.IoC9naSV.js} +4 -4
- package/dist/chunks/{inspector-page.BRC_7uro.js.map → inspector-page.IoC9naSV.js.map} +1 -1
- package/dist/chunks/{inspector.IOtNex1r.js → inspector.BwtV4rE9.js} +5 -5
- package/dist/chunks/{inspector.IOtNex1r.js.map → inspector.BwtV4rE9.js.map} +1 -1
- package/dist/chunks/{layout-row.LBn6aJv4.js → layout-row.DYx7F4cb.js} +2 -2
- package/dist/chunks/{layout-row.LBn6aJv4.js.map → layout-row.DYx7F4cb.js.map} +1 -1
- package/dist/chunks/{link.Cls8XShm.js → link.iNnolG9W.js} +2 -2
- package/dist/chunks/{link.Cls8XShm.js.map → link.iNnolG9W.js.map} +1 -1
- package/dist/chunks/{list-item.HjabBEb8.js → list-item.ByyA5h1d.js} +5 -5
- package/dist/chunks/{list-item.HjabBEb8.js.map → list-item.ByyA5h1d.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.DhNxvqRO.js → listbox-option-tag.Cp_W_p4z.js} +3 -3
- package/dist/chunks/{listbox-option-tag.DhNxvqRO.js.map → listbox-option-tag.Cp_W_p4z.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.Bi1bQs4Z.js → modal-fullscreen.DG8Q-jHL.js} +9 -9
- package/dist/chunks/modal-fullscreen.DG8Q-jHL.js.map +1 -0
- package/dist/chunks/{modal.B3-pmL5s.js → modal.UkzON4bz.js} +7 -7
- package/dist/chunks/{modal.B3-pmL5s.js.map → modal.UkzON4bz.js.map} +1 -1
- package/dist/chunks/{navigation-menu-group.BnHdXODQ.js → navigation-menu-group.BzKRuhrd.js} +8 -8
- package/dist/chunks/navigation-menu-group.BzKRuhrd.js.map +1 -0
- package/dist/chunks/{pagination.cI_pc6oE.js → pagination.DZEVT-CA.js} +8 -7
- package/dist/chunks/{pagination.cI_pc6oE.js.map → pagination.DZEVT-CA.js.map} +1 -1
- package/dist/chunks/{payment-method.DcAITDcK.js → payment-method.meF6XN_X.js} +2 -2
- package/dist/chunks/{payment-method.DcAITDcK.js.map → payment-method.meF6XN_X.js.map} +1 -1
- package/dist/chunks/payment-method.types.BqtH7RM2.js.map +1 -1
- package/dist/chunks/popover.types.DvIwSAAp.js.map +1 -1
- package/dist/chunks/popper-container.Cj3AWXSd.js.map +1 -1
- package/dist/chunks/{progress-bar.RlF3a0Gb.js → progress-bar.CaurNYsc.js} +4 -4
- package/dist/chunks/{progress-bar.RlF3a0Gb.js.map → progress-bar.CaurNYsc.js.map} +1 -1
- package/dist/chunks/{promo-banner.B5szTysj.js → promo-banner.CcYpFY9b.js} +3 -3
- package/dist/chunks/{promo-banner.B5szTysj.js.map → promo-banner.CcYpFY9b.js.map} +1 -1
- package/dist/chunks/{radio-group.CvsQDlHi.js → radio-group.CLbYlzD7.js} +5 -5
- package/dist/chunks/{radio-group.CvsQDlHi.js.map → radio-group.CLbYlzD7.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.rXoS7KGY.js → rich-text-editor.5SMm2BbC.js} +11 -11
- package/dist/chunks/{rich-text-editor.rXoS7KGY.js.map → rich-text-editor.5SMm2BbC.js.map} +1 -1
- package/dist/chunks/{scroll-to-section.DhW8SFy0.js → scroll-to-section.CzeBpNj4.js} +2 -2
- package/dist/chunks/{scroll-to-section.DhW8SFy0.js.map → scroll-to-section.CzeBpNj4.js.map} +1 -1
- package/dist/chunks/{search-bar.--4KVNkf.js → search-bar.DrIwlAQj.js} +8 -8
- package/dist/chunks/{search-bar.--4KVNkf.js.map → search-bar.DrIwlAQj.js.map} +1 -1
- package/dist/chunks/{secondary-nav.CgdV0QwZ.js → secondary-nav.DRs5yAve.js} +16 -16
- package/dist/chunks/{secondary-nav.CgdV0QwZ.js.map → secondary-nav.DRs5yAve.js.map} +1 -1
- package/dist/chunks/{segmented-control.nYpRQTGc.js → segmented-control.CcQoBTfT.js} +3 -3
- package/dist/chunks/{segmented-control.nYpRQTGc.js.map → segmented-control.CcQoBTfT.js.map} +1 -1
- package/dist/chunks/segmented-control.types.BHRLV8KU.js.map +1 -1
- package/dist/chunks/{selection-card-group.CmDuj1c7.js → selection-card-group.BYBAG8ig.js} +49 -48
- package/dist/chunks/{selection-card-group.CmDuj1c7.js.map → selection-card-group.BYBAG8ig.js.map} +1 -1
- package/dist/chunks/{sidepanel.CntIcmx-.js → sidepanel.CLbVkH7v.js} +14 -14
- package/dist/chunks/{sidepanel.CntIcmx-.js.map → sidepanel.CLbVkH7v.js.map} +1 -1
- package/dist/chunks/{status.DJ1Dfh5s.js → status.BdWYs5MK.js} +2 -2
- package/dist/chunks/{status.DJ1Dfh5s.js.map → status.BdWYs5MK.js.map} +1 -1
- package/dist/chunks/status.types.Dx8MDhEH.js.map +1 -1
- package/dist/chunks/{step.BCa9IOWB.js → step.SkRHgSxN.js} +5 -5
- package/dist/chunks/step.SkRHgSxN.js.map +1 -0
- package/dist/chunks/{structured-list-item.Bhe0CH1M.js → structured-list-item.BgcR0XlO.js} +10 -9
- package/dist/chunks/structured-list-item.BgcR0XlO.js.map +1 -0
- package/dist/chunks/{summary-grid.types.C70ED6WD.js → summary-grid.types.Do2PZQGm.js} +6 -6
- package/dist/chunks/{summary-grid.types.C70ED6WD.js.map → summary-grid.types.Do2PZQGm.js.map} +1 -1
- package/dist/chunks/{tab.BK1sIJAJ.js → tab.zeRxc-3T.js} +49 -48
- package/dist/chunks/tab.zeRxc-3T.js.map +1 -0
- package/dist/chunks/{table-of-contents.BTy95Rrs.js → table-of-contents.D4sF13f8.js} +3 -3
- package/dist/chunks/{table-of-contents.BTy95Rrs.js.map → table-of-contents.D4sF13f8.js.map} +1 -1
- package/dist/chunks/{tag.Dz1FQSZb.js → tag.CgsX8v2m.js} +3 -3
- package/dist/chunks/{tag.Dz1FQSZb.js.map → tag.CgsX8v2m.js.map} +1 -1
- package/dist/chunks/{textarea.CcV9U3I7.js → textarea.DMBnJaB1.js} +7 -7
- package/dist/chunks/textarea.DMBnJaB1.js.map +1 -0
- package/dist/chunks/{timeline-item.BG2by0xf.js → timeline-item.CS7TCdoU.js} +10 -10
- package/dist/chunks/{timeline-item.BG2by0xf.js.map → timeline-item.CS7TCdoU.js.map} +1 -1
- package/dist/chunks/{title-details.ChwPP7C5.js → title-details.BhR2nis-.js} +4 -4
- package/dist/chunks/{title-details.ChwPP7C5.js.map → title-details.BhR2nis-.js.map} +1 -1
- package/dist/chunks/{toast.CO6ByH3n.js → toast.CjDkuh2x.js} +4 -4
- package/dist/chunks/{toast.CO6ByH3n.js.map → toast.CjDkuh2x.js.map} +1 -1
- package/dist/chunks/{toggle.Dgh7aw1D.js → toggle.BL_w2xUm.js} +4 -4
- package/dist/chunks/{toggle.Dgh7aw1D.js.map → toggle.BL_w2xUm.js.map} +1 -1
- package/dist/chunks/{tooltip.DFYc5NKM.js → tooltip.BOe7LOfD.js} +2 -2
- package/dist/chunks/{tooltip.DFYc5NKM.js.map → tooltip.BOe7LOfD.js.map} +1 -1
- package/dist/chunks/{tutorial.K0aOQWIg.js → tutorial.DSbBx_2h.js} +3 -3
- package/dist/chunks/{tutorial.K0aOQWIg.js.map → tutorial.DSbBx_2h.js.map} +1 -1
- package/dist/chunks/{typography.D1OZJbEa.js → typography.Cd386LC_.js} +5 -5
- package/dist/chunks/{typography.D1OZJbEa.js.map → typography.Cd386LC_.js.map} +1 -1
- package/dist/chunks/{use-bento-toast-controller.A5xraVqa.js → use-bento-toast-controller.DMA9d_oD.js} +2 -2
- package/dist/chunks/{use-bento-toast-controller.A5xraVqa.js.map → use-bento-toast-controller.DMA9d_oD.js.map} +1 -1
- package/dist/chunks/{use-date-input-formatter.MgbFwUqJ.js → use-date-input-formatter.CouOE5tF.js} +2 -2
- package/dist/chunks/{use-date-input-formatter.MgbFwUqJ.js.map → use-date-input-formatter.CouOE5tF.js.map} +1 -1
- package/dist/chunks/{use-dynamic-date-fns-locale.Bpb2DeYR.js → use-dynamic-date-fns-locale.DGqfz_nF.js} +2 -2
- package/dist/chunks/{use-dynamic-date-fns-locale.Bpb2DeYR.js.map → use-dynamic-date-fns-locale.DGqfz_nF.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/country.js +1 -1
- package/dist/currency.js +1 -1
- 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/date.js +1 -1
- package/dist/draggable.js +2 -2
- package/dist/dropdown.js +2 -2
- package/dist/empty-state.js +1 -1
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/form-layout.js +2 -2
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +177 -152
- 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 +2 -2
- package/dist/internal.js +14 -14
- package/dist/layout.js +1 -1
- package/dist/link.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/payment-method.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/progress-bar.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/status.js +1 -1
- package/dist/stepper.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/styles/bento-dark.css +3 -0
- package/dist/styles/bento-light.css +3 -0
- package/dist/styles/bento.css +3 -0
- package/dist/styles/legacy.css +3 -0
- package/dist/styles/styleguide.css +3 -0
- package/dist/styles/utility.css +9 -0
- package/dist/summary-grid.js +1 -1
- package/dist/table-of-contents.js +1 -1
- 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/toast.js +1 -1
- package/dist/toggle.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/typography.js +1 -1
- package/dist/web-types.json +1278 -46
- package/package.json +9 -9
- package/dist/chunks/button-actions.bkcLUE1G.js.map +0 -1
- package/dist/chunks/calendar.CXdLEeN4.js.map +0 -1
- package/dist/chunks/date-range-picker.CqixIJxG.js.map +0 -1
- package/dist/chunks/draggable.DYKdXdbj.js.map +0 -1
- package/dist/chunks/filter-bar.D7Lk7wlq.js.map +0 -1
- package/dist/chunks/input-time.CXMuvF9N.js +0 -105
- package/dist/chunks/input-time.CXMuvF9N.js.map +0 -1
- package/dist/chunks/modal-fullscreen.Bi1bQs4Z.js.map +0 -1
- package/dist/chunks/navigation-menu-group.BnHdXODQ.js.map +0 -1
- package/dist/chunks/step.BCa9IOWB.js.map +0 -1
- package/dist/chunks/structured-list-item.Bhe0CH1M.js.map +0 -1
- package/dist/chunks/tab.BK1sIJAJ.js.map +0 -1
- package/dist/chunks/textarea.CcV9U3I7.js.map +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { ref as v, computed as o, defineComponent as re, toRef as B, watch as E, nextTick as ne } from "vue";
|
|
2
|
-
import { g as oe, f as q, b as ie, h as se, i as de, p as ce } from "./calendar.
|
|
3
|
-
import { h as ue } from "./button-actions.
|
|
4
|
-
import { B as pe } from "./typography.
|
|
5
|
-
import { D as me, g as ve } from "./dropdown.
|
|
6
|
-
import { B as fe } from "./input-field.
|
|
2
|
+
import { g as oe, f as q, b as ie, h as se, i as de, p as ce } from "./calendar.BalfhApP.js";
|
|
3
|
+
import { h as ue } from "./button-actions.CdetBz3J.js";
|
|
4
|
+
import { B as pe } from "./typography.Cd386LC_.js";
|
|
5
|
+
import { D as me, g as ve } from "./dropdown.CpZQYisR.js";
|
|
6
|
+
import { B as fe } from "./input-field.90DWNO1a.js";
|
|
7
7
|
import { g as D } from "./generate-uid.DBWe4g6T.js";
|
|
8
8
|
import { u as W } from "./index.CPOlyau9.js";
|
|
9
9
|
import { u as De } from "./form-field.B60VsF8d.js";
|
|
10
|
-
import { u as K, a as be } from "./use-date-input-formatter.
|
|
10
|
+
import { u as K, a as be } from "./use-date-input-formatter.CouOE5tF.js";
|
|
11
11
|
import { u as ye } from "./use-form-layout-loading.CWbjZiwP.js";
|
|
12
12
|
import "./index.Cl4_42j5.js";
|
|
13
13
|
import { u as ke } from "./use-touch-device.DTqFAbXh.js";
|
|
14
14
|
import { B as ge } from "./directive.D1-d-C2K.js";
|
|
15
|
-
import { F as he } from "./field-label.
|
|
16
|
-
import { E as Ie } from "./error-message.
|
|
15
|
+
import { F as he } from "./field-label.BQaDr37D.js";
|
|
16
|
+
import { E as Ie } from "./error-message.B-n8wzFo.js";
|
|
17
17
|
import { n as _e } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
18
18
|
import "../assets/date-picker.css";
|
|
19
19
|
const Se = {
|
|
@@ -173,4 +173,4 @@ const He = Re.exports;
|
|
|
173
173
|
export {
|
|
174
174
|
He as B
|
|
175
175
|
};
|
|
176
|
-
//# sourceMappingURL=date-picker.
|
|
176
|
+
//# sourceMappingURL=date-picker.RFus1MVJ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.gDsw8bn1.js","sources":["../../src/components/date-picker/composables/use-date-picker-single-calendar-text.ts","../../src/components/date-picker/date-picker.vue"],"sourcesContent":["import { computed, ref } from 'vue';\nimport { useI18n } from '@/utils/ts/i18n';\nimport { type UseDateDisplayText } from './use-date-picker-single-calendar-text.types';\nimport { startOfMonth } from 'date-fns/startOfMonth';\nimport { getDateTimeFormatter } from '@/utils/ts/format-date/format-date';\nimport { useDateInputFormatter } from '@/composables/use-date-input-formatter/use-date-input-formatter';\nimport messages from '../messages.json';\n\ntype MessageSchema = (typeof messages)['en-US'];\n\n/**\n * Composable that sets and formats the date to be displayed in the input box of a Single Date Picker\n * @param option.datePickerValue Ref to the datePickerValue set in the DatePicker component\n * @param option.dateError The i18n message key for the current error, or null if valid\n * @param option.isMonthVariant Indicates if the date picker has variant \"month\"\n */\nexport const useDatePickerSingleCalendarText: UseDateDisplayText<Date> = ({\n datePickerValue,\n dateError,\n isMonthVariant,\n placeholder,\n}) => {\n const { locale, t } = useI18n<{ message: MessageSchema }>({ messages });\n const { formatDate } = useDateInputFormatter();\n\n const textInputValue = ref(datePickerValue.value?.toDateString());\n\n const dateDisplayValue = computed(() => {\n // Display incorrect date when there's an error with the input\n if (dateError.value) {\n return textInputValue.value;\n }\n\n // Display \"Select a date\" when there's no date selected or input\n if (!datePickerValue.value) {\n return placeholder?.value || (t('selectDate') as string);\n }\n\n // Display the date in format \"dd MMM, yyyy (25 Jun, 2023)\" or \"MMMM yyyy (June 2023)\"\n // if there's a valid date selected\n const dateFormatOptions: Intl.DateTimeFormatOptions = isMonthVariant?.value\n ? { month: 'long', year: 'numeric' }\n : { day: 'numeric', month: 'short', year: 'numeric' };\n\n return getDateTimeFormatter(locale.value, dateFormatOptions).format(datePickerValue.value);\n });\n\n /**\n * Formats the \"dateToFormat\" date value with the current format and sets it as \"formatTextInputDisplayValue\" value\n * @param dateToFormat - Date to be assigned and formatted\n */\n const formatTextInputDisplayValue = (dateToFormat: Date = datePickerValue.value) => {\n // If date is incorrect, leave the textInputValue intact\n if (dateError.value) {\n return;\n }\n\n if (!dateToFormat) {\n textInputValue.value = '';\n return;\n }\n\n const date = isMonthVariant?.value ? startOfMonth(dateToFormat) : dateToFormat;\n textInputValue.value = formatDate(date);\n };\n\n return {\n // Values\n dateDisplayValue,\n textInputValue,\n\n // Methods\n formatTextInputDisplayValue,\n };\n};\n","<!-- TODO: Remove aria props as these are part of JSX elements /vue/types/jsx.d.ts -->\n<!-- eslint-disable vue/attribute-hyphenation -->\n<template>\n <div\n v-bento-click-outside-directive=\"closeDatePicker\"\n class=\"b-date-picker\"\n @keydown.space.capture=\"onSpaceBarOrEnter\"\n @keydown.enter.capture=\"onSpaceBarOrEnter\"\n >\n <!-- Label -->\n <field-label\n v-if=\"label\"\n :id=\"labelId\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n\n <!-- Input -->\n <div>\n <bento-input-field\n v-if=\"isTouchDevice\"\n ref=\"inputContainerRef\"\n :type=\"isMonthVariant ? 'month' : 'date'\"\n :aria-labelledby=\"label ? labelId : $attrs?.['aria-labelledby']\"\n :aria-label=\"label || $attrs?.['aria-labelledby'] ? null : popoverAriaLabel\"\n :aria-describedby=\"ariaDescribedBy\"\n :aria-required=\"required\"\n :disabled=\"disabled\"\n :error-message=\"inputErrorMessage\"\n :model-value=\"nativeValue\"\n :readonly=\"isReadOnly\"\n :min=\"formattedMin\"\n :max=\"formattedMax\"\n @update:model-value=\"onNativeDateInput\"\n />\n <dropdown-input-default\n v-else\n ref=\"inputContainerRef\"\n always-combobox-is-input\n :ariaControls=\"datePickerContainerId\"\n :ariaExpanded=\"isDatePickerOpen\"\n :aria-labelledby=\"label ? labelId : $attrs?.['aria-labelledby']\"\n :aria-label=\"label ? null : popoverAriaLabel\"\n :aria-describedby=\"ariaDescribedBy\"\n :aria-required=\"required\"\n :disabled=\"disabled\"\n dynamic-filtering\n :is-invalid=\"!!errorMessage || !!dateErrorText\"\n :open=\"isDatePickerOpen\"\n :value=\"textInputValue\"\n :display-value=\"dateDisplayValue\"\n :debounce-time=\"0\"\n :readonly=\"isReadOnly\"\n @input=\"onDateInputChange\"\n @open=\"openDatePicker\"\n @keydown=\"onDateKeyDown\"\n @clear=\"clearDatePickerValue\"\n @close=\"closeDatePicker\"\n />\n </div>\n\n <!-- Error Messages -->\n <error-message\n v-if=\"!isTouchDevice && dateErrorText && !errorMessage\"\n :id=\"dateErrorId\"\n :error-message=\"dateErrorText\"\n class=\"b-date-picker__error-message\"\n />\n <error-message\n v-if=\"!isTouchDevice && errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-date-picker__error-message\"\n />\n\n <!-- Description -->\n <bento-typography\n v-if=\"description\"\n class=\"b-date-picker__description\"\n :class=\"descriptionConditionalClasses\"\n el=\"span\"\n >\n {{ description }}\n </bento-typography>\n\n <!-- Calendar container -->\n <bento-popover\n v-if=\"inputContainerRef && !isTouchDevice\"\n :id=\"datePickerContainerId\"\n class=\"b-date-picker__container\"\n role=\"dialog\"\n :open=\"isDatePickerOpen\"\n :target-element=\"inputContainerRef\"\n :aria-label=\"popoverAriaLabel\"\n :aria-modal=\"true\"\n position=\"bottom-start\"\n fallback-strategy=\"initialPlacement\"\n fit-content\n trap-all\n overflow-visible\n :trap-all-options=\"computedTrapAllOptions\"\n @keydown.esc.native=\"closeDatePicker\"\n >\n <calendar\n ref=\"calendarContainerRef\"\n :default-display-month=\"defaultDisplayMonth\"\n :first-day-of-week=\"resolvedFirstDayOfWeek\"\n :is-date-disabled=\"isDateDisabled\"\n :number-of-months=\"1\"\n :value=\"internalModelValue\"\n :min=\"min\"\n :max=\"max\"\n :variant=\"variant\"\n :year-range=\"yearRange\"\n @input=\"onDateSelected\"\n />\n </bento-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, ref, toRef, watch } from 'vue';\n import { startOfMonth } from 'date-fns/startOfMonth';\n\n // Components\n import { BentoPopover } from '@/components/popover';\n import { BentoTypography } from '../typography';\n import { Calendar, type CalendarSingleDateValue, ErrorMessage, FieldLabel } from '@/internal';\n import { DropdownInputDefault } from '@/components/dropdown/components';\n import { BentoInputField } from '@/components/input-field';\n\n // Utils\n import { debounce } from '@/utils/ts/debounce';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useI18n } from '@/utils/ts/i18n';\n import { dateToNativeDateString, dateToNativeMonthString, parseNativeDateString } from '@/utils/ts/format-date';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n\n // Composables\n import { useDatePickerSingleCalendarText } from './composables/use-date-picker-single-calendar-text';\n import { useDateInputFormatter, useFirstDayOfWeek, useFormLayoutFieldLoading, useTouchDevice } from '@/composables';\n\n // Directive\n import { BentoClickOutsideDirective as vBentoClickOutsideDirective } from '@/directives';\n\n // Types\n import { type BentoDatePickerEmits, type BentoDatePickerProps } from './date-picker.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n const DEBOUNCE_TIME = 1000;\n\n const props = defineProps({\n description: { default: undefined },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\n label: { default: undefined },\n optional: { type: Boolean, default: false },\n placeholder: { default: null },\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n tooltipText: { default: null },\n defaultDisplayMonth: { default: null },\n firstDayOfWeek: { default: undefined },\n isDateDisabled: { default: undefined },\n min: { default: null },\n max: { default: null },\n modelValue: { default: null },\n yearRange: { default: undefined },\n variant: { default: undefined }\n});\n\n const emit = defineEmits([\"update:model-value\"]);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const datePickerContainerId = generateUid('bento-date-picker-container');\n const labelId = generateUid('bento-date-picker-label');\n const descriptionId = generateUid('bento-date-picker-description');\n const errorId = generateUid('bento-date-picker-error');\n const dateErrorId = generateUid('bento-date-picker-date-error');\n const popoverAriaLabel = computed(() => props.label || t('datePicker', { name: datePickerContainerId }));\n\n // Refs\n const calendarContainerRef = ref(null);\n const inputContainerRef = ref(null);\n\n // Values\n const dateError = ref<keyof MessageSchema | null>(null);\n const isDatePickerOpen = ref(false);\n const initialFocusOnDatePickerOpen = ref(undefined);\n const internalModelValue = ref<CalendarSingleDateValue | null>(props.modelValue);\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n const { emitValue } = useFormFieldEmits<CalendarSingleDateValue>(emit);\n const { resolvedFirstDayOfWeek } = useFirstDayOfWeek(toRef(props, 'firstDayOfWeek'));\n const { isFormatValid, parseDate, onKeyDown, autoFormat } = useDateInputFormatter();\n const { isTouchDevice } = useTouchDevice();\n\n const computedTrapAllOptions = computed(() => ({\n initialFocus: initialFocusOnDatePickerOpen.value,\n additionalContainers: [inputContainerRef.value.$el],\n }));\n\n watch(\n () => props.disabled,\n disabled => {\n // Close date picker popover if it's opened when it's disabled\n if (disabled && isDatePickerOpen.value) {\n isDatePickerOpen.value = false;\n }\n }\n );\n\n watch(\n () => props.modelValue,\n newModelValue => (internalModelValue.value = newModelValue),\n { immediate: true }\n );\n\n const isMonthVariant = computed(() => props.variant === 'month');\n\n const { dateDisplayValue, textInputValue, formatTextInputDisplayValue } = useDatePickerSingleCalendarText({\n datePickerValue: internalModelValue,\n dateError,\n isMonthVariant,\n placeholder: toRef(props, 'placeholder'),\n });\n\n const formatNativeDate = (date: Date): string => {\n if (!date) {\n return '';\n }\n return isMonthVariant.value ? dateToNativeMonthString(date) : dateToNativeDateString(date);\n };\n\n const nativeValue = computed(() => formatNativeDate(internalModelValue.value));\n\n const onNativeDateInput = (value: string) => {\n if (!value) {\n dateError.value = null;\n emitValue(null);\n return;\n }\n\n const date = parseNativeDateString(value, isMonthVariant.value ? 'month' : 'date');\n dateError.value = getDateErrorReason(date);\n\n if (dateError.value) {\n // Emit null to match the non-touch validation behavior.\n // Note: on repeated invalid selections, the native input may still display\n // the selected date because Vue skips re-rendering when the model stays null.\n emitValue(null);\n return;\n }\n\n emitValue(date);\n };\n\n const formattedMin = computed(() => formatNativeDate(props.min));\n const formattedMax = computed(() => formatNativeDate(props.max));\n\n const getDateErrorReason = (date: Date | null): keyof MessageSchema | null => {\n if (!date || isNaN(date.getTime())) {\n return 'invalidDateFormat';\n }\n\n // Check if date is between min/max bounds, if there are any (inclusive)\n if ((props.min && date < props.min) || (props.max && date > props.max)) {\n return 'invalidDateFormat';\n }\n\n // Check if function is set, otherwise all dates are enabled\n if (props.isDateDisabled && props.isDateDisabled(date)) {\n return 'selectedDateIsNotAvailable';\n }\n\n return null;\n };\n\n const dateErrorText = computed(() => (dateError.value ? t(dateError.value) : null));\n const inputErrorMessage = computed(() => props.errorMessage || dateErrorText.value);\n\n watch(\n [isDatePickerOpen, textInputValue, () => props.isDateDisabled, () => props.min, () => props.max],\n ([isOpen, textValue]) => {\n // Re-validate the current input when the picker closes, validation props change or text input change\n if (!isOpen && textValue && isFormatValid(textValue)) {\n dateError.value = getDateErrorReason(parseDate(textValue));\n }\n }\n );\n\n const descriptionConditionalClasses = computed(() => ({\n 'b-date-picker__description--error': props.errorMessage || dateErrorText.value,\n }));\n\n const ariaDescribedBy = computed(\n () =>\n `${props.description ? descriptionId : ''} ${props.errorMessage ? errorId : ''} ${\n dateErrorText.value ? dateErrorId : ''\n }`.trim() || null\n );\n\n const closeDatePicker = () => {\n isDatePickerOpen.value = false;\n };\n\n const openDatePicker = () => {\n isDatePickerOpen.value = true;\n\n formatTextInputDisplayValue();\n };\n\n const onDateSelected = (selectedDate: Date) => {\n // Reset the error state when a valid date is selected\n dateError.value = null;\n\n closeDatePicker();\n emitValue(selectedDate);\n };\n\n const clearDatePickerValue = async () => {\n if (dateError.value) {\n dateError.value = null;\n textInputValue.value = null;\n }\n emitValue(null);\n };\n\n const onDateKeyDown = (event: KeyboardEvent) => {\n onKeyDown(event);\n };\n\n const validateDate = (stringDate: string) => {\n // Validate only if the date is complete\n if (stringDate.length < 10) {\n return;\n }\n\n const parsedDate = isFormatValid(stringDate) ? parseDate(stringDate) : null;\n const errorKey = getDateErrorReason(parsedDate);\n\n if (!errorKey && parsedDate) {\n dateError.value = null;\n emitValue(parsedDate);\n } else if (stringDate) {\n dateError.value = errorKey || 'invalidDateFormat';\n emitValue(null);\n }\n };\n\n const validateDateDebounced = debounce(validateDate, DEBOUNCE_TIME);\n\n const onDateInputChange = (stringDate: string) => {\n dateError.value = null;\n textInputValue.value = autoFormat(stringDate);\n // If we are closing the date picker, we should validate (and emit date inputs) immediately so the user doesn't have to wait for the debounce time.\n // On touch devices with native input, we also want immediate feedback.\n if (isDatePickerOpen.value || isTouchDevice.value) {\n validateDate(textInputValue.value);\n } else {\n validateDateDebounced(textInputValue.value);\n }\n };\n\n /**\n * Space bar and Enter keyDown event handler.\n *\n * * Opens the date picker dialog on the first keydown.\n * * Move focus to selected date, i.e., the date displayed in the date input text field. If no date has been selected, places focus on the current date.\n * @param {KeyboardEvent} event Event being triggered\n */\n const onSpaceBarOrEnter = async (event: KeyboardEvent) => {\n if (isDatePickerOpen.value) {\n return;\n }\n event.preventDefault();\n\n openDatePicker();\n\n // Wait for the date picker dialog to open\n await nextTick();\n\n // Set current date (today) if no date is selected\n if (!internalModelValue.value) {\n // Format the opened date picker date to YYYY-MM-DD\n formatTextInputDisplayValue(new Date());\n emitValue(new Date());\n }\n\n // Set initial focus\n initialFocusOnDatePickerOpen.value =\n calendarContainerRef.value?.$refs.calendarRef[0].focusOnDate(\n props.variant === 'month' ? startOfMonth(internalModelValue.value) : internalModelValue.value,\n true\n ) ?? undefined;\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Date picker selector.\n *\n * @example\n * import { BentoDatePicker } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDatePicker },\n * template: `\n * <bento-date-picker\n * label=\"Label\"\n * description=\"Supporting text\"\n * required\n * optional\n * disabled\n * v-model=\"selectedDate\"\n * />\n * `,\n * setup() {\n * const selectedDate = ref(new Date()); // reactive({ startDate: new Date(), endDate: new Date() })\n * return {\n * selectedDate,\n * }\n * }\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-date-picker',\n model: { prop: 'modelValue', event: 'update:model-value' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./date-picker.scss\" />\n"],"names":["useDatePickerSingleCalendarText","datePickerValue","dateError","isMonthVariant","placeholder","locale","t","useI18n","formatDate","useDateInputFormatter","textInputValue","ref","computed","dateFormatOptions","getDateTimeFormatter","dateToFormat","date","startOfMonth","__default__","messages","DEBOUNCE_TIME","datePickerContainerId","generateUid","labelId","descriptionId","errorId","dateErrorId","popoverAriaLabel","props","calendarContainerRef","inputContainerRef","isDatePickerOpen","initialFocusOnDatePickerOpen","internalModelValue","isReadOnly","useFormLayoutFieldLoading","toRef","emitValue","useFormFieldEmits","emit","resolvedFirstDayOfWeek","useFirstDayOfWeek","isFormatValid","parseDate","onKeyDown","autoFormat","isTouchDevice","useTouchDevice","computedTrapAllOptions","watch","disabled","newModelValue","dateDisplayValue","formatTextInputDisplayValue","formatNativeDate","dateToNativeMonthString","dateToNativeDateString","nativeValue","onNativeDateInput","value","parseNativeDateString","getDateErrorReason","formattedMin","formattedMax","dateErrorText","inputErrorMessage","isOpen","textValue","descriptionConditionalClasses","ariaDescribedBy","closeDatePicker","openDatePicker","onDateSelected","selectedDate","clearDatePickerValue","onDateKeyDown","event","validateDate","stringDate","parsedDate","errorKey","validateDateDebounced","debounce","nextTick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgBOA,KAAA,CAAA;AAAA,EAAmE,iBAAAC;AAAA,EACtE,WAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,aAAAC;AAEJ,MAAA;AACI,QAAA,EAAA,QAAAC,GAAA,GAAAC,EAAA,IAAAC,EAAA,GACA,EAAA,YAAAC,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAAV,EAAA,OAAA,aAAA,CAAA;AAyCA,SAAA;AAAA;AAAA,IAAO,kBAvCPW,EAAA,MAAA;AAEI,UAAAV,EAAA;AACI,eAAAQ,EAAA;AAIJ,UAAA,CAAAT,EAAA;AACI,eAAAG,GAAA,SAAAE,EAAA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AsB,GAG1BC,KAAA,YAAA;AACI,MAAAxE,EAAA,UACIA,EAAA,QAAA,MACAQ,EAAA,QAAA,OAEJ2B,EAAA,IAAA;AAAA,IAAc,GAGlBsC,KAAA,CAAAC,MAAA;AACI,MAAAhC,EAAAgC,CAAA;AAAA,IAAe,GAGnBC,IAAA,CAAAC,MAAA;AAEI,UAAAA,EAAA,SAAA;AACI;AAGJ,YAAAC,IAAArC,EAAAoC,CAAA,IAAAnC,EAAAmC,CAAA,IAAA,MACAE,IAAAnB,EAAAkB,CAAA;AAEA,MAAA,CAAAC,KAAAD,KACI7E,EAAA,QAAA,MACAmC,EAAA0C,CAAA,KAAoBD,MAEpB5E,EAAA,QAAA8E,KAAA,qBACA3C,EAAA,IAAA;AAAA,IACJ,GAGJ4C,IAAAC,GAAAL,GAAAzD,CAAA;46BAEA,CAAA0D,MAAA;AACI,MAAA5E,EAAA,QAAA,MACAQ,EAAA,QAAAmC,EAAAiC,CAAA,GAGA/C,EAAA,SAAAe,EAAA,QACI+B,EAAAnE,EAAA,KAAA,IAEAuE,EAAAvE,EAAA,KAAA;AAAA,IACJ,sBAUJ,OAAAkE,MAAA;AACI,MAAA7C,EAAA,UAGA6C,EAAA,eAAA,GAEAL,EAAA,GAGA,MAAAY,GAAA,GAGAlD,EAAA,UAEIoB,EAAA,oBAAA,KAAA,CAAA,GACAhB,EAAA,oBAAA,KAAA,CAAA,IAIJL,EAAA,QAAAH,EAAA,OAAA,MAAA,YAAA,CAAA,EAAA;AAAA,QACqDD,EAAA,YAAA,UAAAX,EAAAgB,EAAA,KAAA,IAAAA,EAAA;AAAA,QAC2C;AAAA,MACxF,KAAA;AAAA,IACC;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"date-picker.RFus1MVJ.js","sources":["../../src/components/date-picker/composables/use-date-picker-single-calendar-text.ts","../../src/components/date-picker/date-picker.vue"],"sourcesContent":["import { computed, ref } from 'vue';\nimport { useI18n } from '@/utils/ts/i18n';\nimport { type UseDateDisplayText } from './use-date-picker-single-calendar-text.types';\nimport { startOfMonth } from 'date-fns/startOfMonth';\nimport { getDateTimeFormatter } from '@/utils/ts/format-date/format-date';\nimport { useDateInputFormatter } from '@/composables/use-date-input-formatter/use-date-input-formatter';\nimport messages from '../messages.json';\n\ntype MessageSchema = (typeof messages)['en-US'];\n\n/**\n * Composable that sets and formats the date to be displayed in the input box of a Single Date Picker\n * @param option.datePickerValue Ref to the datePickerValue set in the DatePicker component\n * @param option.dateError The i18n message key for the current error, or null if valid\n * @param option.isMonthVariant Indicates if the date picker has variant \"month\"\n */\nexport const useDatePickerSingleCalendarText: UseDateDisplayText<Date> = ({\n datePickerValue,\n dateError,\n isMonthVariant,\n placeholder,\n}) => {\n const { locale, t } = useI18n<{ message: MessageSchema }>({ messages });\n const { formatDate } = useDateInputFormatter();\n\n const textInputValue = ref(datePickerValue.value?.toDateString());\n\n const dateDisplayValue = computed(() => {\n // Display incorrect date when there's an error with the input\n if (dateError.value) {\n return textInputValue.value;\n }\n\n // Display \"Select a date\" when there's no date selected or input\n if (!datePickerValue.value) {\n return placeholder?.value || (t('selectDate') as string);\n }\n\n // Display the date in format \"dd MMM, yyyy (25 Jun, 2023)\" or \"MMMM yyyy (June 2023)\"\n // if there's a valid date selected\n const dateFormatOptions: Intl.DateTimeFormatOptions = isMonthVariant?.value\n ? { month: 'long', year: 'numeric' }\n : { day: 'numeric', month: 'short', year: 'numeric' };\n\n return getDateTimeFormatter(locale.value, dateFormatOptions).format(datePickerValue.value);\n });\n\n /**\n * Formats the \"dateToFormat\" date value with the current format and sets it as \"formatTextInputDisplayValue\" value\n * @param dateToFormat - Date to be assigned and formatted\n */\n const formatTextInputDisplayValue = (dateToFormat: Date = datePickerValue.value) => {\n // If date is incorrect, leave the textInputValue intact\n if (dateError.value) {\n return;\n }\n\n if (!dateToFormat) {\n textInputValue.value = '';\n return;\n }\n\n const date = isMonthVariant?.value ? startOfMonth(dateToFormat) : dateToFormat;\n textInputValue.value = formatDate(date);\n };\n\n return {\n // Values\n dateDisplayValue,\n textInputValue,\n\n // Methods\n formatTextInputDisplayValue,\n };\n};\n","<!-- TODO: Remove aria props as these are part of JSX elements /vue/types/jsx.d.ts -->\n<!-- eslint-disable vue/attribute-hyphenation -->\n<template>\n <div\n v-bento-click-outside-directive=\"closeDatePicker\"\n class=\"b-date-picker\"\n @keydown.space.capture=\"onSpaceBarOrEnter\"\n @keydown.enter.capture=\"onSpaceBarOrEnter\"\n >\n <!-- Label -->\n <field-label\n v-if=\"label\"\n :id=\"labelId\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n\n <!-- Input -->\n <div>\n <bento-input-field\n v-if=\"isTouchDevice\"\n ref=\"inputContainerRef\"\n :type=\"isMonthVariant ? 'month' : 'date'\"\n :aria-labelledby=\"label ? labelId : $attrs?.['aria-labelledby']\"\n :aria-label=\"label || $attrs?.['aria-labelledby'] ? null : popoverAriaLabel\"\n :aria-describedby=\"ariaDescribedBy\"\n :aria-required=\"required\"\n :disabled=\"disabled\"\n :error-message=\"inputErrorMessage\"\n :model-value=\"nativeValue\"\n :readonly=\"isReadOnly\"\n :min=\"formattedMin\"\n :max=\"formattedMax\"\n @update:model-value=\"onNativeDateInput\"\n />\n <dropdown-input-default\n v-else\n ref=\"inputContainerRef\"\n always-combobox-is-input\n :ariaControls=\"datePickerContainerId\"\n :ariaExpanded=\"isDatePickerOpen\"\n :aria-labelledby=\"label ? labelId : $attrs?.['aria-labelledby']\"\n :aria-label=\"label ? null : popoverAriaLabel\"\n :aria-describedby=\"ariaDescribedBy\"\n :aria-required=\"required\"\n :disabled=\"disabled\"\n dynamic-filtering\n :is-invalid=\"!!errorMessage || !!dateErrorText\"\n :open=\"isDatePickerOpen\"\n :value=\"textInputValue\"\n :display-value=\"dateDisplayValue\"\n :debounce-time=\"0\"\n :readonly=\"isReadOnly\"\n @input=\"onDateInputChange\"\n @open=\"openDatePicker\"\n @keydown=\"onDateKeyDown\"\n @clear=\"clearDatePickerValue\"\n @close=\"closeDatePicker\"\n />\n </div>\n\n <!-- Error Messages -->\n <error-message\n v-if=\"!isTouchDevice && dateErrorText && !errorMessage\"\n :id=\"dateErrorId\"\n :error-message=\"dateErrorText\"\n class=\"b-date-picker__error-message\"\n />\n <error-message\n v-if=\"!isTouchDevice && errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-date-picker__error-message\"\n />\n\n <!-- Description -->\n <bento-typography\n v-if=\"description\"\n class=\"b-date-picker__description\"\n :class=\"descriptionConditionalClasses\"\n el=\"span\"\n >\n {{ description }}\n </bento-typography>\n\n <!-- Calendar container -->\n <bento-popover\n v-if=\"inputContainerRef && !isTouchDevice\"\n :id=\"datePickerContainerId\"\n class=\"b-date-picker__container\"\n role=\"dialog\"\n :open=\"isDatePickerOpen\"\n :target-element=\"inputContainerRef\"\n :aria-label=\"popoverAriaLabel\"\n :aria-modal=\"true\"\n position=\"bottom-start\"\n fallback-strategy=\"initialPlacement\"\n fit-content\n trap-all\n overflow-visible\n :trap-all-options=\"computedTrapAllOptions\"\n @keydown.esc.native=\"closeDatePicker\"\n >\n <calendar\n ref=\"calendarContainerRef\"\n :default-display-month=\"defaultDisplayMonth\"\n :first-day-of-week=\"resolvedFirstDayOfWeek\"\n :is-date-disabled=\"isDateDisabled\"\n :number-of-months=\"1\"\n :value=\"internalModelValue\"\n :min=\"min\"\n :max=\"max\"\n :variant=\"variant\"\n :year-range=\"yearRange\"\n @input=\"onDateSelected\"\n />\n </bento-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, ref, toRef, watch } from 'vue';\n import { startOfMonth } from 'date-fns/startOfMonth';\n\n // Components\n import { BentoPopover } from '@/components/popover';\n import { BentoTypography } from '../typography';\n import { Calendar, type CalendarSingleDateValue, ErrorMessage, FieldLabel } from '@/internal';\n import { DropdownInputDefault } from '@/components/dropdown/components';\n import { BentoInputField } from '@/components/input-field';\n\n // Utils\n import { debounce } from '@/utils/ts/debounce';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useI18n } from '@/utils/ts/i18n';\n import { dateToNativeDateString, dateToNativeMonthString, parseNativeDateString } from '@/utils/ts/format-date';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n\n // Composables\n import { useDatePickerSingleCalendarText } from './composables/use-date-picker-single-calendar-text';\n import { useDateInputFormatter, useFirstDayOfWeek, useFormLayoutFieldLoading, useTouchDevice } from '@/composables';\n\n // Directive\n import { BentoClickOutsideDirective as vBentoClickOutsideDirective } from '@/directives';\n\n // Types\n import { type BentoDatePickerEmits, type BentoDatePickerProps } from './date-picker.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n const DEBOUNCE_TIME = 1000;\n\n const props = defineProps({\n description: { default: undefined },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\n label: { default: undefined },\n optional: { type: Boolean, default: false },\n placeholder: { default: null },\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n tooltipText: { default: null },\n defaultDisplayMonth: { default: null },\n firstDayOfWeek: { default: undefined },\n isDateDisabled: { default: undefined },\n min: { default: null },\n max: { default: null },\n modelValue: { default: null },\n yearRange: { default: undefined },\n variant: { default: undefined }\n});\n\n const emit = defineEmits([\"update:model-value\"]);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const datePickerContainerId = generateUid('bento-date-picker-container');\n const labelId = generateUid('bento-date-picker-label');\n const descriptionId = generateUid('bento-date-picker-description');\n const errorId = generateUid('bento-date-picker-error');\n const dateErrorId = generateUid('bento-date-picker-date-error');\n const popoverAriaLabel = computed(() => props.label || t('datePicker', { name: datePickerContainerId }));\n\n // Refs\n const calendarContainerRef = ref(null);\n const inputContainerRef = ref(null);\n\n // Values\n const dateError = ref<keyof MessageSchema | null>(null);\n const isDatePickerOpen = ref(false);\n const initialFocusOnDatePickerOpen = ref(undefined);\n const internalModelValue = ref<CalendarSingleDateValue | null>(props.modelValue);\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n const { emitValue } = useFormFieldEmits<CalendarSingleDateValue>(emit);\n const { resolvedFirstDayOfWeek } = useFirstDayOfWeek(toRef(props, 'firstDayOfWeek'));\n const { isFormatValid, parseDate, onKeyDown, autoFormat } = useDateInputFormatter();\n const { isTouchDevice } = useTouchDevice();\n\n const computedTrapAllOptions = computed(() => ({\n initialFocus: initialFocusOnDatePickerOpen.value,\n additionalContainers: [inputContainerRef.value.$el],\n }));\n\n watch(\n () => props.disabled,\n disabled => {\n // Close date picker popover if it's opened when it's disabled\n if (disabled && isDatePickerOpen.value) {\n isDatePickerOpen.value = false;\n }\n }\n );\n\n watch(\n () => props.modelValue,\n newModelValue => (internalModelValue.value = newModelValue),\n { immediate: true }\n );\n\n const isMonthVariant = computed(() => props.variant === 'month');\n\n const { dateDisplayValue, textInputValue, formatTextInputDisplayValue } = useDatePickerSingleCalendarText({\n datePickerValue: internalModelValue,\n dateError,\n isMonthVariant,\n placeholder: toRef(props, 'placeholder'),\n });\n\n const formatNativeDate = (date: Date): string => {\n if (!date) {\n return '';\n }\n return isMonthVariant.value ? dateToNativeMonthString(date) : dateToNativeDateString(date);\n };\n\n const nativeValue = computed(() => formatNativeDate(internalModelValue.value));\n\n const onNativeDateInput = (value: string) => {\n if (!value) {\n dateError.value = null;\n emitValue(null);\n return;\n }\n\n const date = parseNativeDateString(value, isMonthVariant.value ? 'month' : 'date');\n dateError.value = getDateErrorReason(date);\n\n if (dateError.value) {\n // Emit null to match the non-touch validation behavior.\n // Note: on repeated invalid selections, the native input may still display\n // the selected date because Vue skips re-rendering when the model stays null.\n emitValue(null);\n return;\n }\n\n emitValue(date);\n };\n\n const formattedMin = computed(() => formatNativeDate(props.min));\n const formattedMax = computed(() => formatNativeDate(props.max));\n\n const getDateErrorReason = (date: Date | null): keyof MessageSchema | null => {\n if (!date || isNaN(date.getTime())) {\n return 'invalidDateFormat';\n }\n\n // Check if date is between min/max bounds, if there are any (inclusive)\n if ((props.min && date < props.min) || (props.max && date > props.max)) {\n return 'invalidDateFormat';\n }\n\n // Check if function is set, otherwise all dates are enabled\n if (props.isDateDisabled && props.isDateDisabled(date)) {\n return 'selectedDateIsNotAvailable';\n }\n\n return null;\n };\n\n const dateErrorText = computed(() => (dateError.value ? t(dateError.value) : null));\n const inputErrorMessage = computed(() => props.errorMessage || dateErrorText.value);\n\n watch(\n [isDatePickerOpen, textInputValue, () => props.isDateDisabled, () => props.min, () => props.max],\n ([isOpen, textValue]) => {\n // Re-validate the current input when the picker closes, validation props change or text input change\n if (!isOpen && textValue && isFormatValid(textValue)) {\n dateError.value = getDateErrorReason(parseDate(textValue));\n }\n }\n );\n\n const descriptionConditionalClasses = computed(() => ({\n 'b-date-picker__description--error': props.errorMessage || dateErrorText.value,\n }));\n\n const ariaDescribedBy = computed(\n () =>\n `${props.description ? descriptionId : ''} ${props.errorMessage ? errorId : ''} ${\n dateErrorText.value ? dateErrorId : ''\n }`.trim() || null\n );\n\n const closeDatePicker = () => {\n isDatePickerOpen.value = false;\n };\n\n const openDatePicker = () => {\n isDatePickerOpen.value = true;\n\n formatTextInputDisplayValue();\n };\n\n const onDateSelected = (selectedDate: Date) => {\n // Reset the error state when a valid date is selected\n dateError.value = null;\n\n closeDatePicker();\n emitValue(selectedDate);\n };\n\n const clearDatePickerValue = async () => {\n if (dateError.value) {\n dateError.value = null;\n textInputValue.value = null;\n }\n emitValue(null);\n };\n\n const onDateKeyDown = (event: KeyboardEvent) => {\n onKeyDown(event);\n };\n\n const validateDate = (stringDate: string) => {\n // Validate only if the date is complete\n if (stringDate.length < 10) {\n return;\n }\n\n const parsedDate = isFormatValid(stringDate) ? parseDate(stringDate) : null;\n const errorKey = getDateErrorReason(parsedDate);\n\n if (!errorKey && parsedDate) {\n dateError.value = null;\n emitValue(parsedDate);\n } else if (stringDate) {\n dateError.value = errorKey || 'invalidDateFormat';\n emitValue(null);\n }\n };\n\n const validateDateDebounced = debounce(validateDate, DEBOUNCE_TIME);\n\n const onDateInputChange = (stringDate: string) => {\n dateError.value = null;\n textInputValue.value = autoFormat(stringDate);\n // If we are closing the date picker, we should validate (and emit date inputs) immediately so the user doesn't have to wait for the debounce time.\n // On touch devices with native input, we also want immediate feedback.\n if (isDatePickerOpen.value || isTouchDevice.value) {\n validateDate(textInputValue.value);\n } else {\n validateDateDebounced(textInputValue.value);\n }\n };\n\n /**\n * Space bar and Enter keyDown event handler.\n *\n * * Opens the date picker dialog on the first keydown.\n * * Move focus to selected date, i.e., the date displayed in the date input text field. If no date has been selected, places focus on the current date.\n * @param {KeyboardEvent} event Event being triggered\n */\n const onSpaceBarOrEnter = async (event: KeyboardEvent) => {\n if (isDatePickerOpen.value) {\n return;\n }\n event.preventDefault();\n\n openDatePicker();\n\n // Wait for the date picker dialog to open\n await nextTick();\n\n // Set current date (today) if no date is selected\n if (!internalModelValue.value) {\n // Format the opened date picker date to YYYY-MM-DD\n formatTextInputDisplayValue(new Date());\n emitValue(new Date());\n }\n\n // Set initial focus\n initialFocusOnDatePickerOpen.value =\n calendarContainerRef.value?.$refs.calendarRef[0].focusOnDate(\n props.variant === 'month' ? startOfMonth(internalModelValue.value) : internalModelValue.value,\n true\n ) ?? undefined;\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Date picker selector.\n *\n * @example\n * import { BentoDatePicker } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDatePicker },\n * template: `\n * <bento-date-picker\n * label=\"Label\"\n * description=\"Supporting text\"\n * required\n * optional\n * disabled\n * v-model=\"selectedDate\"\n * />\n * `,\n * setup() {\n * const selectedDate = ref(new Date()); // reactive({ startDate: new Date(), endDate: new Date() })\n * return {\n * selectedDate,\n * }\n * }\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-date-picker',\n model: { prop: 'modelValue', event: 'update:model-value' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./date-picker.scss\" />\n"],"names":["useDatePickerSingleCalendarText","datePickerValue","dateError","isMonthVariant","placeholder","locale","t","useI18n","formatDate","useDateInputFormatter","textInputValue","ref","computed","dateFormatOptions","getDateTimeFormatter","dateToFormat","date","startOfMonth","__default__","messages","DEBOUNCE_TIME","datePickerContainerId","generateUid","labelId","descriptionId","errorId","dateErrorId","popoverAriaLabel","props","calendarContainerRef","inputContainerRef","isDatePickerOpen","initialFocusOnDatePickerOpen","internalModelValue","isReadOnly","useFormLayoutFieldLoading","toRef","emitValue","useFormFieldEmits","emit","resolvedFirstDayOfWeek","useFirstDayOfWeek","isFormatValid","parseDate","onKeyDown","autoFormat","isTouchDevice","useTouchDevice","computedTrapAllOptions","watch","disabled","newModelValue","dateDisplayValue","formatTextInputDisplayValue","formatNativeDate","dateToNativeMonthString","dateToNativeDateString","nativeValue","onNativeDateInput","value","parseNativeDateString","getDateErrorReason","formattedMin","formattedMax","dateErrorText","inputErrorMessage","isOpen","textValue","descriptionConditionalClasses","ariaDescribedBy","closeDatePicker","openDatePicker","onDateSelected","selectedDate","clearDatePickerValue","onDateKeyDown","event","validateDate","stringDate","parsedDate","errorKey","validateDateDebounced","debounce","nextTick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgBOA,KAAA,CAAA;AAAA,EAAmE,iBAAAC;AAAA,EACtE,WAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,aAAAC;AAEJ,MAAA;AACI,QAAA,EAAA,QAAAC,GAAA,GAAAC,EAAA,IAAAC,EAAA,GACA,EAAA,YAAAC,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAAV,EAAA,OAAA,aAAA,CAAA;AAyCA,SAAA;AAAA;AAAA,IAAO,kBAvCPW,EAAA,MAAA;AAEI,UAAAV,EAAA;AACI,eAAAQ,EAAA;AAIJ,UAAA,CAAAT,EAAA;AACI,eAAAG,GAAA,SAAAE,EAAA,YAAA;AAKJ,YAAAO,IAAAV,GAAA,QAAA,EAAA,OAAA,QAAA,MAAA,UAAA,IAAA,EAAA,KAAA,WAAA,OAAA,SAAA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AA,IAAc,GAGlBsC,KAAA,CAAAC,MAAA;AACI,MAAAhC,EAAAgC,CAAA;AAAA,IAAe,GAGnBC,IAAA,CAAAC,MAAA;AAEI,UAAAA,EAAA,SAAA;AACI;AAGJ,YAAAC,IAAArC,EAAAoC,CAAA,IAAAnC,EAAAmC,CAAA,IAAA,MACAE,IAAAnB,EAAAkB,CAAA;AAEA,MAAA,CAAAC,KAAAD,KACI7E,EAAA,QAAA,MACAmC,EAAA0C,CAAA,KAAoBD,MAEpB5E,EAAA,QAAA8E,KAAA,qBACA3C,EAAA,IAAA;AAAA,IACJ,GAGJ4C,IAAAC,GAAAL,GAAAzD,CAAA;46BAEA,CAAA0D,MAAA;AACI,MAAA5E,EAAA,QAAA,MACAQ,EAAA,QAAAmC,EAAAiC,CAAA,GAGA/C,EAAA,SAAAe,EAAA,QACI+B,EAAAnE,EAAA,KAAA,IAEAuE,EAAAvE,EAAA,KAAA;AAAA,IACJ,sBAUJ,OAAAkE,MAAA;AACI,MAAA7C,EAAA,UAGA6C,EAAA,eAAA,GAEAL,EAAA,GAGA,MAAAY,GAAA,GAGAlD,EAAA,UAEIoB,EAAA,oBAAA,KAAA,CAAA,GACAhB,EAAA,oBAAA,KAAA,CAAA,IAIJL,EAAA,QAAAH,EAAA,OAAA,MAAA,YAAA,CAAA,EAAA;AAAA,QACqDD,EAAA,YAAA,UAAAX,EAAAgB,EAAA,KAAA,IAAAA,EAAA;AAAA,QAC2C;AAAA,MACxF,KAAA;AAAA,IACC;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.types.Ckt7zxGy.js","sources":["../../src/components/date-picker/date-picker.types.ts"],"sourcesContent":["import type { FormField, FormFieldEmits } from '../../types/form-field';\nimport {\n CalendarFirstDayOfWeek as BentoDatePickerFirstDayOfWeek,\n type CalendarIsDateDisabled as BentoDatePickerIsDateDisabled,\n type CalendarSingleDateValue as BentoDatePickerValue,\n CalendarVariant as BentoDatePickerVariant,\n type CalendarYearRange,\n} from '@/internal';\n\nexport {\n BentoDatePickerFirstDayOfWeek,\n type BentoDatePickerIsDateDisabled,\n type BentoDatePickerValue,\n BentoDatePickerVariant,\n};\n\n/**\n * @deprecated Since
|
|
1
|
+
{"version":3,"file":"date-picker.types.Ckt7zxGy.js","sources":["../../src/components/date-picker/date-picker.types.ts"],"sourcesContent":["import type { FormField, FormFieldEmits } from '../../types/form-field';\nimport {\n CalendarFirstDayOfWeek as BentoDatePickerFirstDayOfWeek,\n type CalendarIsDateDisabled as BentoDatePickerIsDateDisabled,\n type CalendarSingleDateValue as BentoDatePickerValue,\n CalendarVariant as BentoDatePickerVariant,\n type CalendarYearRange,\n} from '@/internal';\n\nexport {\n BentoDatePickerFirstDayOfWeek,\n type BentoDatePickerIsDateDisabled,\n type BentoDatePickerValue,\n BentoDatePickerVariant,\n};\n\n/**\n * @deprecated Since v3.0.0. Use string literal instead.\n */\nexport enum BentoDatePickerEvent {\n INPUT = 'input',\n}\n\nexport type BentoDatePickerEmits = FormFieldEmits<BentoDatePickerValue>;\n\nexport type BentoDatePickerYearRange = CalendarYearRange;\n\nexport interface BentoDatePickerProps extends FormField {\n /**\n * Default start date for the calendar pane.\n * Expected format: YYYY-MM-DD\n * @default null\n */\n defaultDisplayMonth?: string | null;\n\n /**\n * Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday\n * @default undefined\n */\n firstDayOfWeek?: BentoDatePickerFirstDayOfWeek;\n\n /**\n * Indicate if a date should be disabled or not\n */\n isDateDisabled?: BentoDatePickerIsDateDisabled;\n\n /**\n * Sets a minimum limit for selectable dates - dates before `min` will not be selectable\n * @default null\n */\n min?: Date | null;\n\n /**\n * Sets a maximum limit for selectable dates - dates after `max` will not be selectable\n * @default null\n */\n max?: Date | null;\n\n /**\n * Selected date\n *\n * @default null\n */\n modelValue?: BentoDatePickerValue | null;\n\n /**\n * Range of years to be selectable from the year dropdown\n */\n yearRange?: BentoDatePickerYearRange;\n\n /**\n * The type of calendar to display. Defaults to showing days.\n */\n variant?: `${BentoDatePickerVariant}`;\n}\n"],"names":["BentoDatePickerEvent"],"mappings":"AAmBO,IAAKA,sBAAAA,OACRA,EAAA,QAAQ,SADAA,IAAAA,KAAA,CAAA,CAAA;"}
|