@adyen/bento-vue2 2.0.1-rc.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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/card.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.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/button.js +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{accordion-item.DOj7vqeL.js → accordion-item.B7lteJBu.js} +2 -2
- package/dist/chunks/{accordion-item.DOj7vqeL.js.map → accordion-item.B7lteJBu.js.map} +1 -1
- package/dist/chunks/{action-bar.KJSfr89B.js → action-bar.BsXW7BI2.js} +3 -3
- package/dist/chunks/{action-bar.KJSfr89B.js.map → action-bar.BsXW7BI2.js.map} +1 -1
- package/dist/chunks/{ai-tag.TLrUno9t.js → ai-tag.D2Q0xhFK.js} +2 -2
- package/dist/chunks/{ai-tag.TLrUno9t.js.map → ai-tag.D2Q0xhFK.js.map} +1 -1
- package/dist/chunks/{alert.DT6T5Uxb.js → alert.DJDHwVeR.js} +70 -52
- package/dist/chunks/alert.DJDHwVeR.js.map +1 -0
- package/dist/chunks/{base-modal.CGHkdr9t.js → base-modal.CcmoTJdc.js} +4 -4
- package/dist/chunks/{base-modal.CGHkdr9t.js.map → base-modal.CcmoTJdc.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.CjTaZoYW.js → button-actions-with-menu.BY394ars.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.CjTaZoYW.js.map → button-actions-with-menu.BY394ars.js.map} +1 -1
- package/dist/chunks/{button-actions.sLmpjWGK.js → button-actions.bkcLUE1G.js} +2 -2
- package/dist/chunks/{button-actions.sLmpjWGK.js.map → button-actions.bkcLUE1G.js.map} +1 -1
- package/dist/chunks/{calendar.BNRImpE_.js → calendar.CXdLEeN4.js} +18 -18
- package/dist/chunks/{calendar.BNRImpE_.js.map → calendar.CXdLEeN4.js.map} +1 -1
- package/dist/chunks/{card.DmnYYMmv.js → card.BmpB0VbL.js} +4 -4
- package/dist/chunks/{card.DmnYYMmv.js.map → card.BmpB0VbL.js.map} +1 -1
- package/dist/chunks/{checkbox-group.D1SE-hz6.js → checkbox-group.D1uyc3z3.js} +3 -3
- package/dist/chunks/{checkbox-group.D1SE-hz6.js.map → checkbox-group.D1uyc3z3.js.map} +1 -1
- package/dist/chunks/{checkbox.CyGdeEdp.js → checkbox.D5xZ5Nnh.js} +2 -2
- package/dist/chunks/{checkbox.CyGdeEdp.js.map → checkbox.D5xZ5Nnh.js.map} +1 -1
- package/dist/chunks/{code-snippet.BwswvtkY.js → code-snippet.CnThWqVb.js} +4 -4
- package/dist/chunks/{code-snippet.BwswvtkY.js.map → code-snippet.CnThWqVb.js.map} +1 -1
- package/dist/chunks/{controls-group.DUNvd6DZ.js → controls-group.fdGc6epa.js} +2 -2
- package/dist/chunks/{controls-group.DUNvd6DZ.js.map → controls-group.fdGc6epa.js.map} +1 -1
- package/dist/chunks/{copy.DSnfQU_F.js → copy.CSk1rCRo.js} +3 -3
- package/dist/chunks/{copy.DSnfQU_F.js.map → copy.CSk1rCRo.js.map} +1 -1
- package/dist/chunks/{dashboard-section.CowwqnVA.js → dashboard-section.CYEoNH9Q.js} +3 -3
- package/dist/chunks/{dashboard-section.CowwqnVA.js.map → dashboard-section.CYEoNH9Q.js.map} +1 -1
- package/dist/chunks/{dashed-underline.dNu0qaf7.js → dashed-underline.CzKc-fJW.js} +3 -3
- package/dist/chunks/{dashed-underline.dNu0qaf7.js.map → dashed-underline.CzKc-fJW.js.map} +1 -1
- package/dist/chunks/{data-grid-template.D5699UWb.js → data-grid-template.DCwzh2G7.js} +4 -4
- package/dist/chunks/{data-grid-template.D5699UWb.js.map → data-grid-template.DCwzh2G7.js.map} +1 -1
- package/dist/chunks/{data-grid.CN25cWaQ.js → data-grid.CMxQpfrY.js} +19 -19
- package/dist/chunks/{data-grid.CN25cWaQ.js.map → data-grid.CMxQpfrY.js.map} +1 -1
- package/dist/chunks/{date-picker.DhIMx1wH.js → date-picker.gDsw8bn1.js} +7 -7
- package/dist/chunks/{date-picker.DhIMx1wH.js.map → date-picker.gDsw8bn1.js.map} +1 -1
- package/dist/chunks/{date-range-picker.Cz6ijJAa.js → date-range-picker.CqixIJxG.js} +39 -39
- package/dist/chunks/{date-range-picker.Cz6ijJAa.js.map → date-range-picker.CqixIJxG.js.map} +1 -1
- package/dist/chunks/{date-time-picker.CHELyYSN.js → date-time-picker.Bktntun4.js} +5 -5
- package/dist/chunks/{date-time-picker.CHELyYSN.js.map → date-time-picker.Bktntun4.js.map} +1 -1
- package/dist/chunks/{draggable-handle.C75v14oN.js → draggable-handle.DgVdGC1V.js} +2 -2
- package/dist/chunks/{draggable-handle.C75v14oN.js.map → draggable-handle.DgVdGC1V.js.map} +1 -1
- package/dist/chunks/{draggable.COHEAPF5.js → draggable.DYKdXdbj.js} +2 -2
- package/dist/chunks/{draggable.COHEAPF5.js.map → draggable.DYKdXdbj.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.DKGloEzh.js → dropdown-tag.Dk7SooVv.js} +3 -3
- package/dist/chunks/{dropdown-tag.DKGloEzh.js.map → dropdown-tag.Dk7SooVv.js.map} +1 -1
- package/dist/chunks/{dropdown.QLkWJ9zk.js → dropdown.Bnq4kP7k.js} +5 -5
- package/dist/chunks/{dropdown.QLkWJ9zk.js.map → dropdown.Bnq4kP7k.js.map} +1 -1
- package/dist/chunks/{empty-state.CRdHhJLl.js → empty-state.C2wjdE3y.js} +2 -2
- package/dist/chunks/{empty-state.CRdHhJLl.js.map → empty-state.C2wjdE3y.js.map} +1 -1
- package/dist/chunks/{field-label.CEp7WMYe.js → field-label.C7BCsofY.js} +2 -2
- package/dist/chunks/{field-label.CEp7WMYe.js.map → field-label.C7BCsofY.js.map} +1 -1
- package/dist/chunks/{file-uploader.2MeaNIlv.js → file-uploader.DllKBmP8.js} +6 -7
- package/dist/chunks/{file-uploader.2MeaNIlv.js.map → file-uploader.DllKBmP8.js.map} +1 -1
- package/dist/chunks/filter-bar.D7Lk7wlq.js +3131 -0
- package/dist/chunks/filter-bar.D7Lk7wlq.js.map +1 -0
- package/dist/chunks/{focus-trap.BDpcWIxI.js → focus-trap.fd6_d2EW.js} +2 -1
- package/dist/chunks/{focus-trap.BDpcWIxI.js.map → focus-trap.fd6_d2EW.js.map} +1 -1
- package/dist/chunks/{footer-actions.B5YZ95jM.js → footer-actions.C9STwwcv.js} +2 -2
- package/dist/chunks/{footer-actions.B5YZ95jM.js.map → footer-actions.C9STwwcv.js.map} +1 -1
- package/dist/chunks/{form-layout-title.BStxZj9d.js → form-layout-title.C0lwzPZz.js} +2 -2
- package/dist/chunks/{form-layout-title.BStxZj9d.js.map → form-layout-title.C0lwzPZz.js.map} +1 -1
- package/dist/chunks/{header-with-views.DQh7mz0T.js → header-with-views.BqobE7IF.js} +10 -10
- package/dist/chunks/{header-with-views.DQh7mz0T.js.map → header-with-views.BqobE7IF.js.map} +1 -1
- package/dist/chunks/{header.DeRBttdY.js → header.CmyqVXuG.js} +4 -4
- package/dist/chunks/{header.DeRBttdY.js.map → header.CmyqVXuG.js.map} +1 -1
- package/dist/chunks/{info-icon-with-popover.8pL3B3m3.js → info-icon-with-popover.BvYyGm4D.js} +3 -3
- package/dist/chunks/{info-icon-with-popover.8pL3B3m3.js.map → info-icon-with-popover.BvYyGm4D.js.map} +1 -1
- package/dist/chunks/{info-icon.CmWiZXvc.js → info-icon.B-FAeceD.js} +3 -3
- package/dist/chunks/{info-icon.CmWiZXvc.js.map → info-icon.B-FAeceD.js.map} +1 -1
- package/dist/chunks/{input-field-password.BiPMXS1j.js → input-field-password.9bWhLud0.js} +4 -4
- package/dist/chunks/{input-field-password.BiPMXS1j.js.map → input-field-password.9bWhLud0.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.GK1UAt7-.js → input-field-phone-number.CCn1N9St.js} +2 -2
- package/dist/chunks/{input-field-phone-number.GK1UAt7-.js.map → input-field-phone-number.CCn1N9St.js.map} +1 -1
- package/dist/chunks/{input-field.BT5tx_DM.js → input-field.D912rZS_.js} +3 -3
- package/dist/chunks/{input-field.BT5tx_DM.js.map → input-field.D912rZS_.js.map} +1 -1
- package/dist/chunks/{input-time.DGaMMWxj.js → input-time.CXMuvF9N.js} +3 -3
- package/dist/chunks/{input-time.DGaMMWxj.js.map → input-time.CXMuvF9N.js.map} +1 -1
- package/dist/chunks/{inspector-page.C5VCiyLD.js → inspector-page.BRC_7uro.js} +2 -2
- package/dist/chunks/{inspector-page.C5VCiyLD.js.map → inspector-page.BRC_7uro.js.map} +1 -1
- package/dist/chunks/{inspector.BoZBD8_z.js → inspector.IOtNex1r.js} +2 -2
- package/dist/chunks/{inspector.BoZBD8_z.js.map → inspector.IOtNex1r.js.map} +1 -1
- package/dist/chunks/{list-item.Bh5Z1f0K.js → list-item.HjabBEb8.js} +3 -3
- package/dist/chunks/{list-item.Bh5Z1f0K.js.map → list-item.HjabBEb8.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.BY6i9YgP.js → listbox-option-tag.DhNxvqRO.js} +2 -2
- package/dist/chunks/{listbox-option-tag.BY6i9YgP.js.map → listbox-option-tag.DhNxvqRO.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.Bteroyik.js → modal-fullscreen.Bi1bQs4Z.js} +3 -3
- package/dist/chunks/{modal-fullscreen.Bteroyik.js.map → modal-fullscreen.Bi1bQs4Z.js.map} +1 -1
- package/dist/chunks/{modal.C6OJMJ_D.js → modal.B3-pmL5s.js} +4 -4
- package/dist/chunks/{modal.C6OJMJ_D.js.map → modal.B3-pmL5s.js.map} +1 -1
- package/dist/chunks/{navigation-menu-group.uqIv5yZG.js → navigation-menu-group.BnHdXODQ.js} +3 -3
- package/dist/chunks/{navigation-menu-group.uqIv5yZG.js.map → navigation-menu-group.BnHdXODQ.js.map} +1 -1
- package/dist/chunks/{pagination.CGiu-kog.js → pagination.cI_pc6oE.js} +2 -2
- package/dist/chunks/{pagination.CGiu-kog.js.map → pagination.cI_pc6oE.js.map} +1 -1
- package/dist/chunks/popover.types.DvIwSAAp.js +6 -0
- package/dist/chunks/{popover.types.CoDfZgDc.js.map → popover.types.DvIwSAAp.js.map} +1 -1
- package/dist/chunks/{popper-container.Co4j6qME.js → popper-container.Cj3AWXSd.js} +2 -2
- package/dist/chunks/{popper-container.Co4j6qME.js.map → popper-container.Cj3AWXSd.js.map} +1 -1
- package/dist/chunks/{progress-bar.CJ6j8lIr.js → progress-bar.RlF3a0Gb.js} +2 -2
- package/dist/chunks/{progress-bar.CJ6j8lIr.js.map → progress-bar.RlF3a0Gb.js.map} +1 -1
- package/dist/chunks/{radio-group.CQfxWRbM.js → radio-group.CvsQDlHi.js} +3 -3
- package/dist/chunks/{radio-group.CQfxWRbM.js.map → radio-group.CvsQDlHi.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.CDrX-0g1.js → rich-text-editor.rXoS7KGY.js} +5 -5
- package/dist/chunks/{rich-text-editor.CDrX-0g1.js.map → rich-text-editor.rXoS7KGY.js.map} +1 -1
- package/dist/chunks/{search-bar.CFscAHEn.js → search-bar.--4KVNkf.js} +3 -3
- package/dist/chunks/{search-bar.CFscAHEn.js.map → search-bar.--4KVNkf.js.map} +1 -1
- package/dist/chunks/{secondary-nav.Ba7pNe_-.js → secondary-nav.CgdV0QwZ.js} +4 -4
- package/dist/chunks/{secondary-nav.Ba7pNe_-.js.map → secondary-nav.CgdV0QwZ.js.map} +1 -1
- package/dist/chunks/{segmented-control.Dp7Xd5Oa.js → segmented-control.nYpRQTGc.js} +2 -2
- package/dist/chunks/{segmented-control.Dp7Xd5Oa.js.map → segmented-control.nYpRQTGc.js.map} +1 -1
- package/dist/chunks/{selection-card-group.B2IEfuke.js → selection-card-group.CmDuj1c7.js} +2 -2
- package/dist/chunks/{selection-card-group.B2IEfuke.js.map → selection-card-group.CmDuj1c7.js.map} +1 -1
- package/dist/chunks/{sidepanel.B9QGoXGV.js → sidepanel.CntIcmx-.js} +4 -4
- package/dist/chunks/{sidepanel.B9QGoXGV.js.map → sidepanel.CntIcmx-.js.map} +1 -1
- package/dist/chunks/{structured-list-item.Cp1OuRJJ.js → structured-list-item.Bhe0CH1M.js} +4 -4
- package/dist/chunks/{structured-list-item.Cp1OuRJJ.js.map → structured-list-item.Bhe0CH1M.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.Ddf7FShu.js → summary-grid.types.C70ED6WD.js} +5 -5
- package/dist/chunks/{summary-grid.types.Ddf7FShu.js.map → summary-grid.types.C70ED6WD.js.map} +1 -1
- package/dist/chunks/{tab.DavwEprr.js → tab.BK1sIJAJ.js} +2 -2
- package/dist/chunks/{tab.DavwEprr.js.map → tab.BK1sIJAJ.js.map} +1 -1
- package/dist/chunks/{tag.HGmLa47S.js → tag.Dz1FQSZb.js} +2 -2
- package/dist/chunks/{tag.HGmLa47S.js.map → tag.Dz1FQSZb.js.map} +1 -1
- package/dist/chunks/{textarea.CFCNYWVT.js → textarea.CcV9U3I7.js} +2 -2
- package/dist/chunks/{textarea.CFCNYWVT.js.map → textarea.CcV9U3I7.js.map} +1 -1
- package/dist/chunks/{timeline-item.BIDEQCUw.js → timeline-item.BG2by0xf.js} +6 -6
- package/dist/chunks/{timeline-item.BIDEQCUw.js.map → timeline-item.BG2by0xf.js.map} +1 -1
- package/dist/chunks/{title-details.kDWlIY1W.js → title-details.ChwPP7C5.js} +2 -2
- package/dist/chunks/{title-details.kDWlIY1W.js.map → title-details.ChwPP7C5.js.map} +1 -1
- package/dist/chunks/{tooltip.D9Nqxoyp.js → tooltip.DFYc5NKM.js} +3 -3
- package/dist/chunks/{tooltip.D9Nqxoyp.js.map → tooltip.DFYc5NKM.js.map} +1 -1
- package/dist/chunks/{tutorial.dS_oywbu.js → tutorial.K0aOQWIg.js} +4 -4
- package/dist/chunks/{tutorial.dS_oywbu.js.map → tutorial.K0aOQWIg.js.map} +1 -1
- package/dist/chunks/{use-date-input-formatter.5r7srQZU.js → use-date-input-formatter.MgbFwUqJ.js} +2 -2
- package/dist/chunks/{use-date-input-formatter.5r7srQZU.js.map → use-date-input-formatter.MgbFwUqJ.js.map} +1 -1
- package/dist/chunks/use-expandable-content-height.DmFeas9-.js +36 -0
- package/dist/chunks/use-expandable-content-height.DmFeas9-.js.map +1 -0
- package/dist/code-snippet.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/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/focus-trap.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +57 -57
- 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 +11 -11
- 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/progress-bar.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/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 +1 -9
- package/package.json +6 -6
- package/dist/assets/date-filter.css +0 -1
- package/dist/assets/date-range-filter.css +0 -1
- package/dist/assets/input-with-dropdown-filter.css +0 -1
- package/dist/chunks/alert.DT6T5Uxb.js.map +0 -1
- package/dist/chunks/date-filter.BZVe74cH.js +0 -117
- package/dist/chunks/date-filter.BZVe74cH.js.map +0 -1
- package/dist/chunks/date-range-filter.CDrrP22U.js +0 -868
- package/dist/chunks/date-range-filter.CDrrP22U.js.map +0 -1
- package/dist/chunks/filter-bar.DUw139BE.js +0 -1867
- package/dist/chunks/filter-bar.DUw139BE.js.map +0 -1
- package/dist/chunks/input-with-dropdown-filter.axFutymM.js +0 -80
- package/dist/chunks/input-with-dropdown-filter.axFutymM.js.map +0 -1
- package/dist/chunks/popover.types.CoDfZgDc.js +0 -6
- package/dist/chunks/select-avatar-filter.EG4IpfbR.js +0 -51
- package/dist/chunks/select-avatar-filter.EG4IpfbR.js.map +0 -1
- package/dist/chunks/select-country-filter.BtUlbnFP.js +0 -55
- package/dist/chunks/select-country-filter.BtUlbnFP.js.map +0 -1
- package/dist/chunks/select-currency-filter.B__ByL7N.js +0 -89
- package/dist/chunks/select-currency-filter.B__ByL7N.js.map +0 -1
- package/dist/chunks/select-payment-method-filter.DndRc65T.js +0 -51
- package/dist/chunks/select-payment-method-filter.DndRc65T.js.map +0 -1
- package/dist/chunks/select-tag-filter.DiWow_m7.js +0 -59
- package/dist/chunks/select-tag-filter.DiWow_m7.js.map +0 -1
- package/dist/chunks/use-expandable-content-height.Bdd9hQwq.js +0 -34
- package/dist/chunks/use-expandable-content-height.Bdd9hQwq.js.map +0 -1
- package/dist/chunks/warning-filled.DI6aB6vH.js +0 -26
- package/dist/chunks/warning-filled.DI6aB6vH.js.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
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.
|
|
2
|
+
import { g as oe, f as q, b as ie, h as se, i as de, p as ce } from "./calendar.CXdLEeN4.js";
|
|
3
|
+
import { h as ue } from "./button-actions.bkcLUE1G.js";
|
|
4
4
|
import { B as pe } from "./typography.D1OZJbEa.js";
|
|
5
|
-
import { D as me, g as ve } from "./dropdown.
|
|
6
|
-
import { B as fe } from "./input-field.
|
|
5
|
+
import { D as me, g as ve } from "./dropdown.Bnq4kP7k.js";
|
|
6
|
+
import { B as fe } from "./input-field.D912rZS_.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.MgbFwUqJ.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.
|
|
15
|
+
import { F as he } from "./field-label.C7BCsofY.js";
|
|
16
16
|
import { E as Ie } from "./error-message.DKnoUezI.js";
|
|
17
17
|
import { n as _e } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
18
18
|
import "../assets/date-picker.css";
|
|
@@ -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.gDsw8bn1.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.DhIMx1wH.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,g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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.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,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xF,KAAA;AAAA,IACC;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { defineComponent as be, computed as c, reactive as ve, useSlots as ua, ref as I, onMounted as je, toRaw as Ye, watch as pe, useAttrs as da, toRef as Re } from "vue";
|
|
2
2
|
import { d as ca, h as ma } from "./index.CL3TXc0a.js";
|
|
3
3
|
import { B as Da } from "./divider.KxXy6nzJ.js";
|
|
4
|
-
import { h as pa, B as va } from "./button-actions.
|
|
4
|
+
import { h as pa, B as va } from "./button-actions.bkcLUE1G.js";
|
|
5
5
|
import { B as Je } from "./typography.D1OZJbEa.js";
|
|
6
|
-
import { B as fa } from "./alert.
|
|
7
|
-
import { B as ga, g as qe, D as Ma } from "./dropdown.
|
|
8
|
-
import { B as ya } from "./segmented-control.
|
|
6
|
+
import { B as fa } from "./alert.DJDHwVeR.js";
|
|
7
|
+
import { B as ga, g as qe, D as Ma } from "./dropdown.Bnq4kP7k.js";
|
|
8
|
+
import { B as ya } from "./segmented-control.nYpRQTGc.js";
|
|
9
9
|
import { u as Ae } from "./index.CPOlyau9.js";
|
|
10
10
|
import { u as ha } from "./use-has-slot.C9lQZ6nz.js";
|
|
11
|
-
import { u as
|
|
11
|
+
import { u as ke, a as Ra } from "./use-date-input-formatter.MgbFwUqJ.js";
|
|
12
12
|
import { u as Ta } from "./use-touch-device.DTqFAbXh.js";
|
|
13
|
-
import {
|
|
13
|
+
import { j as re, k as P, s as b, l as Ya, m as Ce, n as ba, f as Be, o as Aa, q as ka, r as _a, t as Ne, u as Ia, b as C, v as Sa, h as Ea, i as Fa, e as S, w as ze, x as Ve, g as xa } from "./calendar.CXdLEeN4.js";
|
|
14
14
|
import { e as B, a as Le } from "./differenceInMonths.CPDkGea3.js";
|
|
15
15
|
import { s as We } from "./startOfWeek.CzdYFzXX.js";
|
|
16
16
|
import { t as fe, n as Pa, c as wa } from "./en-US.C412g-7U.js";
|
|
17
17
|
import { c as Oa } from "./constructNow.Dl44Mvpp.js";
|
|
18
18
|
import { s as De, a as Qe } from "./set-time-in-date.B3K4C7CB.js";
|
|
19
|
-
import { B as qa, i as Ge } from "./input-time.
|
|
20
|
-
import { B as Ca } from "./input-field.
|
|
19
|
+
import { B as qa, i as Ge } from "./input-time.CXMuvF9N.js";
|
|
20
|
+
import { B as Ca } from "./input-field.D912rZS_.js";
|
|
21
21
|
import { B as Ba } from "./form-layout-group.D4T0Z5xk.js";
|
|
22
|
-
import { n as
|
|
22
|
+
import { n as _e } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
23
23
|
import { g as te } from "./generate-uid.DBWe4g6T.js";
|
|
24
24
|
import { u as Na } from "./use-form-layout-loading.CWbjZiwP.js";
|
|
25
25
|
import "./index.Cl4_42j5.js";
|
|
26
26
|
import { u as za } from "./form-field.B60VsF8d.js";
|
|
27
27
|
import { B as Va } from "./directive.D1-d-C2K.js";
|
|
28
|
-
import { F as La } from "./field-label.
|
|
28
|
+
import { F as La } from "./field-label.C7BCsofY.js";
|
|
29
29
|
import { E as Wa } from "./error-message.DKnoUezI.js";
|
|
30
30
|
import { B as Qa } from "./button-actions.types.BptAXjD8.js";
|
|
31
31
|
import "../assets/date-range-picker.css";
|
|
@@ -93,7 +93,7 @@ var Ja = function() {
|
|
|
93
93
|
}, "input:valid": function(i) {
|
|
94
94
|
return t.$emit("time:valid");
|
|
95
95
|
} } }, "bento-input-time", a.resolvedTimeProps, !1)) : t._e()], 1);
|
|
96
|
-
}, Ha = [], Ka = /* @__PURE__ */
|
|
96
|
+
}, Ha = [], Ka = /* @__PURE__ */ _e(
|
|
97
97
|
ja,
|
|
98
98
|
Ja,
|
|
99
99
|
Ha,
|
|
@@ -134,7 +134,7 @@ const Xa = Ka.exports, Za = ({
|
|
|
134
134
|
p = B(i.latest);
|
|
135
135
|
else if (p) {
|
|
136
136
|
const y = Le(p);
|
|
137
|
-
P(p, y) || (p = Le(
|
|
137
|
+
P(p, y) || (p = Le(ka(p, 1)));
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
if (i?.type === "quarterly") {
|
|
@@ -142,7 +142,7 @@ const Xa = Ka.exports, Za = ({
|
|
|
142
142
|
m = re(i.earliest);
|
|
143
143
|
else if (m) {
|
|
144
144
|
const y = re(m);
|
|
145
|
-
P(m, y) || (m = re(
|
|
145
|
+
P(m, y) || (m = re(_a(m, 1)));
|
|
146
146
|
}
|
|
147
147
|
if (i.latest)
|
|
148
148
|
p = B(i.latest);
|
|
@@ -281,9 +281,9 @@ const at = {
|
|
|
281
281
|
isFormatValid: H,
|
|
282
282
|
parseDate: v,
|
|
283
283
|
onKeyDown: A,
|
|
284
|
-
autoFormat:
|
|
284
|
+
autoFormat: k,
|
|
285
285
|
formatDate: z
|
|
286
|
-
} =
|
|
286
|
+
} = ke(), R = I({}), K = c(() => e.variant === "month" ? "monthly" : "daily"), X = c(() => e.numberOfMonths === 0), r = ve({
|
|
287
287
|
startDate: e.value?.startDate,
|
|
288
288
|
endDate: e.value?.endDate,
|
|
289
289
|
range: e.value?.range,
|
|
@@ -341,7 +341,7 @@ const at = {
|
|
|
341
341
|
), w = c(() => g.value === "invalidDateFormat" ? null : ee.value), T = (n, l, u, M) => {
|
|
342
342
|
if (!n || !H(n))
|
|
343
343
|
return "invalidDateFormat";
|
|
344
|
-
const
|
|
344
|
+
const _ = v(n), q = b(_);
|
|
345
345
|
if (e.min && q < b(e.min) || e.max && q > b(e.max) || e.isDateDisabled && e.isDateDisabled(q))
|
|
346
346
|
return "selectedDateIsNotAvailable";
|
|
347
347
|
if (l) {
|
|
@@ -397,9 +397,9 @@ const at = {
|
|
|
397
397
|
b(v(s.endDate)),
|
|
398
398
|
s.endTime
|
|
399
399
|
));
|
|
400
|
-
const
|
|
400
|
+
const _ = de("endDate"), q = T(
|
|
401
401
|
u,
|
|
402
|
-
e.allowTimeInput ? r.endDate :
|
|
402
|
+
e.allowTimeInput ? r.endDate : _,
|
|
403
403
|
"start",
|
|
404
404
|
e.allowTimeInput ? r.startDate : void 0
|
|
405
405
|
);
|
|
@@ -417,7 +417,7 @@ const at = {
|
|
|
417
417
|
} else
|
|
418
418
|
h.value = T(n), t(D.ERROR, { ...s });
|
|
419
419
|
}, xe = qe(ce, a), He = (n) => {
|
|
420
|
-
s.startDate = f.value && x.value ? n :
|
|
420
|
+
s.startDate = f.value && x.value ? n : k(n), f.value ? x.value && n ? ce(Y(ze(n)), !0) : s.startDate ? ce(s.startDate) : h.value = null : xe(s.startDate);
|
|
421
421
|
}, me = (n, l = !1) => {
|
|
422
422
|
if (d(n)) {
|
|
423
423
|
const u = n;
|
|
@@ -427,9 +427,9 @@ const at = {
|
|
|
427
427
|
b(v(s.startDate)),
|
|
428
428
|
s.startTime
|
|
429
429
|
));
|
|
430
|
-
const
|
|
430
|
+
const _ = de("startDate"), q = T(
|
|
431
431
|
u,
|
|
432
|
-
e.allowTimeInput ? r.startDate :
|
|
432
|
+
e.allowTimeInput ? r.startDate : _,
|
|
433
433
|
"end",
|
|
434
434
|
e.allowTimeInput ? r.endDate : void 0
|
|
435
435
|
);
|
|
@@ -447,7 +447,7 @@ const at = {
|
|
|
447
447
|
} else
|
|
448
448
|
g.value = T(n), t(D.ERROR, { ...s });
|
|
449
449
|
}, Pe = qe(me, a), Ke = (n) => {
|
|
450
|
-
s.endDate = f.value && x.value ? n :
|
|
450
|
+
s.endDate = f.value && x.value ? n : k(n), f.value ? x.value && n ? me(Y(ze(n)), !0) : s.endDate ? me(s.endDate) : g.value = null : Pe(s.endDate);
|
|
451
451
|
}, Xe = (n) => {
|
|
452
452
|
A(n);
|
|
453
453
|
}, Ze = () => {
|
|
@@ -520,16 +520,16 @@ const at = {
|
|
|
520
520
|
const l = e.quickSelectRanges?.find(({ value: u }) => u === n);
|
|
521
521
|
if (l) {
|
|
522
522
|
Q();
|
|
523
|
-
const u = l.data, M = u.endDate || (u.isRelativeToNow ? new Date(Date.now()) : B(new Date(Date.now()))),
|
|
524
|
-
s.endDate = Y(M), s.startDate = Y(
|
|
523
|
+
const u = l.data, M = u.endDate || (u.isRelativeToNow ? new Date(Date.now()) : B(new Date(Date.now()))), _ = u.isRelativeToNow && u.timeDifference ? new Date(M.getTime() - u.timeDifference) : u.startDate;
|
|
524
|
+
s.endDate = Y(M), s.startDate = Y(_), he(_, M, null, n), e.granularities && (r.granularity = u.granularity || K.value), s.startTime = S(_), s.endTime = S(M), r.startDate = _, r.endDate = M, u.isRelativeToNow && (R.value = {
|
|
525
525
|
...R.value,
|
|
526
526
|
[n]: {
|
|
527
|
-
startDate:
|
|
527
|
+
startDate: _,
|
|
528
528
|
endDate: M
|
|
529
529
|
}
|
|
530
530
|
}), t(D.CUSTOM_RANGE, {
|
|
531
531
|
...l.data,
|
|
532
|
-
startDate:
|
|
532
|
+
startDate: _,
|
|
533
533
|
endDate: M,
|
|
534
534
|
range: l.value
|
|
535
535
|
});
|
|
@@ -549,7 +549,7 @@ const at = {
|
|
|
549
549
|
const u = m[n?.type ?? "daily"];
|
|
550
550
|
return N(u, l, { count: l });
|
|
551
551
|
});
|
|
552
|
-
return { __sfc: !0, FORM_INPUT_DEBOUNCE_TIME: a, RANGE_SELECTOR_CUSTOM_RANGE_KEY: i, maxRangeMessageKeyMap: m, props: e, emit: t, slots: p, hasSlot: y, t: E, tc: N, isTouchDevice: f, dateFormat: se, isFormatValid: H, parseDate: v, onKeyDown: A, autoFormat:
|
|
552
|
+
return { __sfc: !0, FORM_INPUT_DEBOUNCE_TIME: a, RANGE_SELECTOR_CUSTOM_RANGE_KEY: i, maxRangeMessageKeyMap: m, props: e, emit: t, slots: p, hasSlot: y, t: E, tc: N, isTouchDevice: f, dateFormat: se, isFormatValid: H, parseDate: v, onKeyDown: A, autoFormat: k, formatDateUtil: z, calculatedIsRelativeToNowQuickSelectRanges: R, defaultGranularity: K, hasNoCalendars: X, internalRangeDate: r, selectedRangeSelectorValue: F, quickSelectRangeDefaultItems: ge, selectedGranularity: V, granularityItems: Me, getGranularCalendarLimits: L, computedMinMax: G, normalizeRange: oe, savedRanges: W, saveRange: Z, resetSavedRanges: Q, formatDate: Y, normalizeInternalRange: U, startDateError: h, endDateError: g, startDateErrorText: le, endDateErrorText: ee, startSharedError: $, endSharedError: w, getDateErrorMessage: T, dateTextInput: s, isValidTime: ae, isMonthVariant: x, formatNativeDate: j, nativeStartDate: ie, nativeEndDate: ye, dateInputType: Ie, startDateValue: Se, endDateValue: Ee, setTimeInDateRef: O, onDateInput: Fe, isValidDate: d, onStartDateSelected: J, onEndDateSelected: ue, getDate: de, validateStartDate: ce, validateStartDateDebounced: xe, onStartDateInput: He, validateEndDate: me, validateEndDateDebounced: Pe, onEndDateInput: Ke, onDateInputKeyDown: Xe, onStartTimeError: Ze, onStartTimeValid: ea, onEndTimeError: aa, onEndTimeValid: ta, onStartTimeInput: na, onEndTimeInput: ra, setInternalRange: he, onRangeSelectorInput: sa, onGranularityInput: oa, computedFormContainerClasses: la, maxRangeMessage: ia, Calendar: C, DateTimeInput: Xa, BentoAlert: fa, BentoTypography: Je, BentoDropdown: ga, BentoSegmentedControl: ya };
|
|
553
553
|
}
|
|
554
554
|
});
|
|
555
555
|
var rt = function() {
|
|
@@ -573,7 +573,7 @@ var rt = function() {
|
|
|
573
573
|
"aria-label": a.t("timeTo"),
|
|
574
574
|
errorMessage: a.endSharedError
|
|
575
575
|
} }, on: { "update:date-model-value": a.onEndDateInput, "date:keydown": a.onDateInputKeyDown, "update:time-model-value": a.onEndTimeInput, "time:error": a.onEndTimeError, "time:valid": a.onEndTimeValid } })], 1)], 2), a.hasSlot("actions") ? e("div", [t._t("actions")], 2) : t._e()]), !a.hasNoCalendars && !a.isTouchDevice ? e("div", { staticClass: "b-date-range-picker-calendar__calendars-container", attrs: { "data-testid": "date-range-picker-calendar-calendar-container" } }, [e(a.Calendar, { attrs: { value: a.internalRangeDate, "first-day-of-week": t.firstDayOfWeek, "is-date-disabled": t.isDateDisabled, "max-range": t.maxRange, min: a.computedMinMax.min, max: a.computedMinMax.max, "number-of-months": t.numberOfMonths, "show-end-date-on-open": t.showEndDateOnOpen, granularity: a.selectedGranularity, variant: t.variant, "year-range": t.yearRange, "is-range": "" }, on: { input: a.onDateInput, "start-date-selected": a.onStartDateSelected, "end-date-selected": a.onEndDateSelected } })], 1) : t._e()]);
|
|
576
|
-
}, st = [], ot = /* @__PURE__ */
|
|
576
|
+
}, st = [], ot = /* @__PURE__ */ _e(
|
|
577
577
|
nt,
|
|
578
578
|
rt,
|
|
579
579
|
st,
|
|
@@ -601,7 +601,7 @@ const lt = ot.exports, it = {
|
|
|
601
601
|
withTimeInput: i,
|
|
602
602
|
placeholder: m
|
|
603
603
|
}) => {
|
|
604
|
-
const { locale: p, t: y } = Ae(), { dateToInputDateString: E } =
|
|
604
|
+
const { locale: p, t: y } = Ae(), { dateToInputDateString: E } = ke(), N = (v) => !!v && !isNaN(v.getTime()), f = ve({
|
|
605
605
|
startDate: null,
|
|
606
606
|
endDate: null,
|
|
607
607
|
startTime: null,
|
|
@@ -621,15 +621,15 @@ const lt = ot.exports, it = {
|
|
|
621
621
|
if (!o.value || !o.value.startDate && !o.value.endDate)
|
|
622
622
|
return m?.value || y("selectDateRange");
|
|
623
623
|
if (e.value?.length) {
|
|
624
|
-
const A = e.value.find(({ value:
|
|
624
|
+
const A = e.value.find(({ value: k }) => k === o.value?.range);
|
|
625
625
|
if (A)
|
|
626
626
|
return A.label;
|
|
627
627
|
}
|
|
628
628
|
if (o.value.granularity === "quarterly") {
|
|
629
|
-
const { startDate: A, endDate:
|
|
630
|
-
if (Ga(A,
|
|
629
|
+
const { startDate: A, endDate: k } = o.value, z = y("quarter", { quarter: Ve(A), year: Ue(A) });
|
|
630
|
+
if (Ga(A, k))
|
|
631
631
|
return z;
|
|
632
|
-
const R = y("quarter", { quarter: Ve(
|
|
632
|
+
const R = y("quarter", { quarter: Ve(k), year: Ue(k) });
|
|
633
633
|
return `${z} - ${R}`;
|
|
634
634
|
}
|
|
635
635
|
if (!N(o.value.startDate) || !N(o.value.endDate))
|
|
@@ -682,7 +682,7 @@ const lt = ot.exports, it = {
|
|
|
682
682
|
},
|
|
683
683
|
emits: ["update:model-value"],
|
|
684
684
|
setup(o, { emit: t }) {
|
|
685
|
-
const e = o, a = da(), { t: i } = Ae(), { dateToInputDateString: m } =
|
|
685
|
+
const e = o, a = da(), { t: i } = Ae(), { dateToInputDateString: m } = ke(), p = te("bento-date-range-picker-container"), y = te("bento-date-range-picker-label"), E = te("bento-date-range-picker-description"), N = te("bento-date-range-picker-error"), f = te("bento-date-range-picker-date-error"), se = c(() => e.label || i("dateRangePicker", { name: p })), { resolvedFirstDayOfWeek: H } = Ra(Re(e, "firstDayOfWeek")), v = ca({
|
|
686
686
|
none: 0,
|
|
687
687
|
one: 710,
|
|
688
688
|
// width of date range picker with one panes
|
|
@@ -701,7 +701,7 @@ const lt = ot.exports, it = {
|
|
|
701
701
|
return e.numberOfMonths === void 0 ? ue : Math.min(e.numberOfMonths, ue);
|
|
702
702
|
}
|
|
703
703
|
return e.numberOfMonths;
|
|
704
|
-
}),
|
|
704
|
+
}), k = c(() => e?.quickSelectRanges && e.quickSelectRanges.map((d) => {
|
|
705
705
|
const J = d.data.endDate ? void 0 : new Date(Date.now()).getTime() - d.data.startDate.getTime();
|
|
706
706
|
return {
|
|
707
707
|
...d,
|
|
@@ -726,7 +726,7 @@ const lt = ot.exports, it = {
|
|
|
726
726
|
})), W = c(() => e.variant === "month"), Z = c(() => e.allowTimeInput && e.variant !== "month"), { dateDisplayValue: Q, textInputDisplayValue: Y, formatTextInputDisplayValue: U } = ut({
|
|
727
727
|
datePickerValue: L,
|
|
728
728
|
isDateIncorrect: R,
|
|
729
|
-
quickSelectRanges:
|
|
729
|
+
quickSelectRanges: k,
|
|
730
730
|
isMonthVariant: W,
|
|
731
731
|
withTimeInput: Z,
|
|
732
732
|
placeholder: Re(e, "placeholder")
|
|
@@ -772,7 +772,7 @@ const lt = ot.exports, it = {
|
|
|
772
772
|
]);
|
|
773
773
|
return pe(w, (d) => {
|
|
774
774
|
T.value = R.value || d === L.value;
|
|
775
|
-
}), { __sfc: !0, emit: t, props: e, attrs: a, t: i, dateToInputDateString: m, datePickerContainerId: p, labelId: y, descriptionId: E, errorId: N, dateErrorId: f, popoverAriaLabel: se, resolvedFirstDayOfWeek: H, breakpoints: v, computedNumberOfMonths: A, adjustedQuickSelectRanges:
|
|
775
|
+
}), { __sfc: !0, emit: t, props: e, attrs: a, t: i, dateToInputDateString: m, datePickerContainerId: p, labelId: y, descriptionId: E, errorId: N, dateErrorId: f, popoverAriaLabel: se, resolvedFirstDayOfWeek: H, breakpoints: v, computedNumberOfMonths: A, adjustedQuickSelectRanges: k, dropdownInputAriaLabelledBy: z, isDateIncorrect: R, inputContainerRef: K, inputWrapperRef: X, isDateRangePickerOpen: r, inputWrapperWidth: F, isReadOnly: ge, emitValue: V, shouldMatchPopoverWidth: Me, internalModelValue: L, shouldDisplayError: G, descriptionConditionalClasses: oe, isMonthVariant: W, withTimeInput: Z, dateDisplayValue: Q, textInputDisplayValue: Y, formatTextInputDisplayValue: U, ariaDescribedBy: h, closeDateRangePicker: g, openDateRangePicker: le, localDateDisplayValue: ee, localTextInputDisplayValue: $, selectedDate: w, isApplyDisabled: T, displayedTextInputValue: s, trapAllOptions: ae, syncLocalDisplayStateFromCommittedValue: x, cancelDateRangePicker: j, rangePickerButtonActions: ie, onDateRangePickerInput: (d) => {
|
|
776
776
|
R.value = !1, s.value.startDate = m(d.startDate), s.value.endDate = m(d.endDate), s.value.startTime = S(d.startDate), s.value.endTime = S(d.endDate), w.value = d;
|
|
777
777
|
}, clearDateRangePickerValue: async () => {
|
|
778
778
|
R.value && (R.value = !1), w.value = null;
|
|
@@ -800,7 +800,7 @@ var mt = function() {
|
|
|
800
800
|
} } }, [e(a.DateRangePickerCalendar, { attrs: { "allow-time-input": a.withTimeInput, "quick-select-ranges": a.adjustedQuickSelectRanges, value: a.selectedDate, "first-day-of-week": a.resolvedFirstDayOfWeek, granularities: t.granularities, "is-date-disabled": t.isDateDisabled, "max-range": t.maxRange, min: t.min, max: t.max, "number-of-months": a.computedNumberOfMonths, "show-end-date-on-open": t.showEndDateOnOpen, "date-form-data": a.displayedTextInputValue, variant: t.variant, "year-range": t.yearRange }, on: { "custom-range": a.onRangeSelectorInput, input: a.onDateRangePickerInput, error: a.onDateRangePickerError, "form-date": a.onDateRangePickerFormDateInputUpdate }, scopedSlots: t._u([{ key: "actions", fn: function() {
|
|
801
801
|
return [e(a.BentoDivider), e("div", { staticClass: "b-date-range-picker__footer" }, [e(a.BentoButtonActions, { attrs: { actions: a.rangePickerButtonActions, layout: a.BentoButtonActionsLayout.SPACE_BETWEEN } })], 1)];
|
|
802
802
|
}, proxy: !0 }], null, !1, 600066749) })], 1) : t._e()], 1);
|
|
803
|
-
}, Dt = [], pt = /* @__PURE__ */
|
|
803
|
+
}, Dt = [], pt = /* @__PURE__ */ _e(
|
|
804
804
|
ct,
|
|
805
805
|
mt,
|
|
806
806
|
Dt,
|
|
@@ -815,4 +815,4 @@ export {
|
|
|
815
815
|
Ua as a,
|
|
816
816
|
ne as i
|
|
817
817
|
};
|
|
818
|
-
//# sourceMappingURL=date-range-picker.
|
|
818
|
+
//# sourceMappingURL=date-range-picker.CqixIJxG.js.map
|