@adyen/bento-vue3 1.94.0 → 1.96.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/components.d.ts +2 -0
- package/dist/@types/index.d.ts +83 -9
- package/dist/action-bar.js +1 -1
- package/dist/ai-tag.js +1 -1
- package/dist/anchor-scroller.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/dashed-underline.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-picker.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/date-time-picker.css +1 -0
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/draggable-handle.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/field-label.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/form-layout-group.css +1 -0
- package/dist/assets/form-layout-title.css +1 -1
- package/dist/assets/header-meta.css +1 -1
- package/dist/assets/input-field-password.css +1 -1
- package/dist/assets/input-field.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/{action-bar.jhGXgcQl.js → action-bar.CIVprT2U.js} +4 -4
- package/dist/chunks/{action-bar.jhGXgcQl.js.map → action-bar.CIVprT2U.js.map} +1 -1
- package/dist/chunks/{ai-tag.DIdhvkaT.js → ai-tag.DkTlRY__.js} +2 -2
- package/dist/chunks/{ai-tag.DIdhvkaT.js.map → ai-tag.DkTlRY__.js.map} +1 -1
- package/dist/chunks/{anchor-scroller.BhppCt1n.js → anchor-scroller.J2mkf0uu.js} +5 -5
- package/dist/chunks/{anchor-scroller.BhppCt1n.js.map → anchor-scroller.J2mkf0uu.js.map} +1 -1
- package/dist/chunks/{base-modal.DxjZyGlG.js → base-modal.BKtpH-qh.js} +6 -6
- package/dist/chunks/{base-modal.DxjZyGlG.js.map → base-modal.BKtpH-qh.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.DJzCF9ja.js → button-actions-with-menu.cMAAF47d.js} +3 -3
- package/dist/chunks/{button-actions-with-menu.DJzCF9ja.js.map → button-actions-with-menu.cMAAF47d.js.map} +1 -1
- package/dist/chunks/{button-actions.uco5ptf5.js → button-actions.CxTxPprd.js} +2 -2
- package/dist/chunks/{button-actions.uco5ptf5.js.map → button-actions.CxTxPprd.js.map} +1 -1
- package/dist/chunks/{calendar.D8CM3XkW.js → calendar.iQyNwQBL.js} +81 -75
- package/dist/chunks/calendar.iQyNwQBL.js.map +1 -0
- package/dist/chunks/{card.CWzJewQv.js → card.CQlyqa5-.js} +2 -2
- package/dist/chunks/{card.CWzJewQv.js.map → card.CQlyqa5-.js.map} +1 -1
- package/dist/chunks/{checkbox-group.Bq6PsVI_.js → checkbox-group.BcDIXL27.js} +3 -3
- package/dist/chunks/{checkbox-group.Bq6PsVI_.js.map → checkbox-group.BcDIXL27.js.map} +1 -1
- package/dist/chunks/{checkbox.DreTXMg0.js → checkbox.LTRqb-pE.js} +2 -2
- package/dist/chunks/{checkbox.DreTXMg0.js.map → checkbox.LTRqb-pE.js.map} +1 -1
- package/dist/chunks/{code-snippet.CGOmdPc-.js → code-snippet.DHzB-8JJ.js} +4 -4
- package/dist/chunks/{code-snippet.CGOmdPc-.js.map → code-snippet.DHzB-8JJ.js.map} +1 -1
- package/dist/chunks/{controls-group.D4MEP6GO.js → controls-group.B-wIl-I7.js} +2 -2
- package/dist/chunks/{controls-group.D4MEP6GO.js.map → controls-group.B-wIl-I7.js.map} +1 -1
- package/dist/chunks/{copy.Dxqx884r.js → copy.XM_7RiIR.js} +3 -3
- package/dist/chunks/{copy.Dxqx884r.js.map → copy.XM_7RiIR.js.map} +1 -1
- package/dist/chunks/{dashboard-section.NWMwtxVX.js → dashboard-section.Da6ZFGtm.js} +4 -4
- package/dist/chunks/{dashboard-section.NWMwtxVX.js.map → dashboard-section.Da6ZFGtm.js.map} +1 -1
- package/dist/chunks/dashed-underline.DJmMXcdt.js +85 -0
- package/dist/chunks/dashed-underline.DJmMXcdt.js.map +1 -0
- package/dist/chunks/{data-grid-template.Bf-VZS0u.js → data-grid-template.-MuGcJp1.js} +4 -4
- package/dist/chunks/{data-grid-template.Bf-VZS0u.js.map → data-grid-template.-MuGcJp1.js.map} +1 -1
- package/dist/chunks/{data-grid.D_TrebJz.js → data-grid.CNIXkdCJ.js} +885 -882
- package/dist/chunks/{data-grid.D_TrebJz.js.map → data-grid.CNIXkdCJ.js.map} +1 -1
- package/dist/chunks/date-picker.DyImOUH4.js +277 -0
- package/dist/chunks/date-picker.DyImOUH4.js.map +1 -0
- package/dist/chunks/{date-range-picker.C5CSReZ5.js → date-range-picker.BigC6wm2.js} +418 -437
- package/dist/chunks/date-range-picker.BigC6wm2.js.map +1 -0
- package/dist/chunks/{dialog-page.CZN5-Ohm.js → dialog-page.BOwnhJze.js} +2 -2
- package/dist/chunks/{dialog-page.CZN5-Ohm.js.map → dialog-page.BOwnhJze.js.map} +1 -1
- package/dist/chunks/directive.D1-d-C2K.js +28 -0
- package/dist/chunks/directive.D1-d-C2K.js.map +1 -0
- package/dist/chunks/draggable-handle.C1dudqKz.js +1649 -0
- package/dist/chunks/{draggable-handle.B_E-T3BS.js.map → draggable-handle.C1dudqKz.js.map} +1 -1
- package/dist/chunks/drawer.BQoyUVOW.js +64 -0
- package/dist/chunks/{drawer.GXqb2HPx.js.map → drawer.BQoyUVOW.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.DUDW-Be6.js → dropdown-tag.C1ei1SyR.js} +3 -3
- package/dist/chunks/{dropdown-tag.DUDW-Be6.js.map → dropdown-tag.C1ei1SyR.js.map} +1 -1
- package/dist/chunks/{dropdown.Bsic3Nll.js → dropdown.C5um1anU.js} +523 -508
- package/dist/chunks/dropdown.C5um1anU.js.map +1 -0
- package/dist/chunks/{field-label.DFtyMriH.js → field-label.CLV3nSzz.js} +2 -2
- package/dist/chunks/{field-label.DFtyMriH.js.map → field-label.CLV3nSzz.js.map} +1 -1
- package/dist/chunks/{file-uploader.CKo27YzT.js → file-uploader.C9YOBRQg.js} +39 -38
- package/dist/chunks/{file-uploader.CKo27YzT.js.map → file-uploader.C9YOBRQg.js.map} +1 -1
- package/dist/chunks/{filter-bar.Dhghqmhb.js → filter-bar.CvZnM3hM.js} +282 -279
- package/dist/chunks/{filter-bar.Dhghqmhb.js.map → filter-bar.CvZnM3hM.js.map} +1 -1
- package/dist/chunks/{focus-trap.DcxrXRKl.js → focus-trap.Dl_rHbwH.js} +2 -2
- package/dist/chunks/{focus-trap.DcxrXRKl.js.map → focus-trap.Dl_rHbwH.js.map} +1 -1
- package/dist/chunks/{footer-actions.Dyi8PTyI.js → footer-actions.zlKq74F1.js} +2 -2
- package/dist/chunks/{footer-actions.Dyi8PTyI.js.map → footer-actions.zlKq74F1.js.map} +1 -1
- package/dist/chunks/form-layout-group.08QuvVmC.js +81 -0
- package/dist/chunks/form-layout-group.08QuvVmC.js.map +1 -0
- package/dist/chunks/form-layout-title.Kwve4xv2.js +179 -0
- package/dist/chunks/form-layout-title.Kwve4xv2.js.map +1 -0
- package/dist/chunks/header-meta.NFZo1ACP.js +243 -0
- package/dist/chunks/{header-meta.I2Tztkls.js.map → header-meta.NFZo1ACP.js.map} +1 -1
- package/dist/chunks/{header-with-views.MPJPxTzT.js → header-with-views.ubPTyW9A.js} +10 -10
- package/dist/chunks/{header-with-views.MPJPxTzT.js.map → header-with-views.ubPTyW9A.js.map} +1 -1
- package/dist/chunks/{header.CBzF5Ap9.js → header.Ds0sFKBB.js} +3 -3
- package/dist/chunks/{header.CBzF5Ap9.js.map → header.Ds0sFKBB.js.map} +1 -1
- package/dist/chunks/{index.Cqv1XuTj.js → index.oOAkh64h.js} +248 -225
- package/dist/chunks/{index.Cqv1XuTj.js.map → index.oOAkh64h.js.map} +1 -1
- package/dist/chunks/{info-icon.C_ZkQb1d.js → info-icon.1FtkyuYH.js} +3 -3
- package/dist/chunks/{info-icon.C_ZkQb1d.js.map → info-icon.1FtkyuYH.js.map} +1 -1
- package/dist/chunks/{input-field-password.CA16O5Gv.js → input-field-password.CZ-NTpZF.js} +26 -25
- package/dist/chunks/input-field-password.CZ-NTpZF.js.map +1 -0
- package/dist/chunks/{input-field-phone-number.CTeDyk0e.js → input-field-phone-number.DOHk6gSp.js} +13 -14
- package/dist/chunks/{input-field-phone-number.CTeDyk0e.js.map → input-field-phone-number.DOHk6gSp.js.map} +1 -1
- package/dist/chunks/{input-field.DlEEFday.js → input-field.DBlTGgAD.js} +104 -101
- package/dist/chunks/input-field.DBlTGgAD.js.map +1 -0
- package/dist/chunks/{input-time.CIdcQBgS.js → input-time.CHIjCO74.js} +7 -8
- package/dist/chunks/{input-time.CIdcQBgS.js.map → input-time.CHIjCO74.js.map} +1 -1
- package/dist/chunks/{inspector.BdPLtQ1t.js → inspector.BvBC1ABK.js} +3 -3
- package/dist/chunks/{inspector.BdPLtQ1t.js.map → inspector.BvBC1ABK.js.map} +1 -1
- package/dist/chunks/{layout-row.PGFh3qzc.js → layout-row.BsGdHl3d.js} +8 -8
- package/dist/chunks/{layout-row.PGFh3qzc.js.map → layout-row.BsGdHl3d.js.map} +1 -1
- package/dist/chunks/{list-item.D34osEIh.js → list-item.E1o7yuEB.js} +2 -2
- package/dist/chunks/{list-item.D34osEIh.js.map → list-item.E1o7yuEB.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.12duL_ZH.js → listbox-option-tag.yF6p9iQw.js} +2 -2
- package/dist/chunks/{listbox-option-tag.12duL_ZH.js.map → listbox-option-tag.yF6p9iQw.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.BGpyGUGB.js → modal-fullscreen.DmruiE3n.js} +4 -4
- package/dist/chunks/{modal-fullscreen.BGpyGUGB.js.map → modal-fullscreen.DmruiE3n.js.map} +1 -1
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.B_CD-6Sn.js → modal.vue_vue_type_script_setup_true_lang.CrJQWuzb.js} +4 -4
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.B_CD-6Sn.js.map → modal.vue_vue_type_script_setup_true_lang.CrJQWuzb.js.map} +1 -1
- package/dist/chunks/navigation-menu-group.CQ6ImGsJ.js +336 -0
- package/dist/chunks/navigation-menu-group.CQ6ImGsJ.js.map +1 -0
- package/dist/chunks/{pagination.CbGLdXSQ.js → pagination.DbpHH_53.js} +2 -2
- package/dist/chunks/{pagination.CbGLdXSQ.js.map → pagination.DbpHH_53.js.map} +1 -1
- package/dist/chunks/popover.types.DATOPtuh.js +6 -0
- package/dist/chunks/{popover.types.63w2RF7Y.js.map → popover.types.DATOPtuh.js.map} +1 -1
- package/dist/chunks/{popper-container.WR8Hb24e.js → popper-container.BH4WxeUj.js} +2 -2
- package/dist/chunks/{popper-container.WR8Hb24e.js.map → popper-container.BH4WxeUj.js.map} +1 -1
- package/dist/chunks/{promo-banner.DS8jlFES.js → promo-banner.DvV9eXs4.js} +2 -2
- package/dist/chunks/{promo-banner.DS8jlFES.js.map → promo-banner.DvV9eXs4.js.map} +1 -1
- package/dist/chunks/{radio-group.DpLQ_Wnj.js → radio-group.Cg67ZU0c.js} +3 -3
- package/dist/chunks/{radio-group.DpLQ_Wnj.js.map → radio-group.Cg67ZU0c.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.CRa59ETT.js → rich-text-editor.u-V4fNWK.js} +4 -4
- package/dist/chunks/{rich-text-editor.CRa59ETT.js.map → rich-text-editor.u-V4fNWK.js.map} +1 -1
- package/dist/chunks/{search-bar.tmX9JctT.js → search-bar.TKgi1KLs.js} +5 -6
- package/dist/chunks/{search-bar.tmX9JctT.js.map → search-bar.TKgi1KLs.js.map} +1 -1
- package/dist/chunks/secondary-nav.0OsJiAWI.js +315 -0
- package/dist/chunks/{secondary-nav.KIu9A7pb.js.map → secondary-nav.0OsJiAWI.js.map} +1 -1
- package/dist/chunks/{segmented-control.Dxfpt98K.js → segmented-control.D6Yvxxpc.js} +2 -2
- package/dist/chunks/{segmented-control.Dxfpt98K.js.map → segmented-control.D6Yvxxpc.js.map} +1 -1
- package/dist/chunks/{selection-card-group.BVxESHZH.js → selection-card-group.C59ZIrVm.js} +3 -3
- package/dist/chunks/{selection-card-group.BVxESHZH.js.map → selection-card-group.C59ZIrVm.js.map} +1 -1
- package/dist/chunks/set-time-in-date.9-8WOiMT.js +27 -0
- package/dist/chunks/set-time-in-date.9-8WOiMT.js.map +1 -0
- package/dist/chunks/{sidepanel.BwesEWP_.js → sidepanel.BVQt6Tac.js} +6 -6
- package/dist/chunks/{sidepanel.BwesEWP_.js.map → sidepanel.BVQt6Tac.js.map} +1 -1
- package/dist/chunks/{structured-list-item.DUWQ4ggz.js → structured-list-item.BhYtSw2f.js} +4 -4
- package/dist/chunks/{structured-list-item.DUWQ4ggz.js.map → structured-list-item.BhYtSw2f.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.BvZUfgwA.js → summary-grid.types.9sUs0LS0.js} +5 -5
- package/dist/chunks/{summary-grid.types.BvZUfgwA.js.map → summary-grid.types.9sUs0LS0.js.map} +1 -1
- package/dist/chunks/{tab.DKVHFvuI.js → tab.ByjWuWQz.js} +108 -99
- package/dist/chunks/{tab.DKVHFvuI.js.map → tab.ByjWuWQz.js.map} +1 -1
- package/dist/chunks/{tag.DyNHhsGt.js → tag.Uu-6AQys.js} +2 -2
- package/dist/chunks/{tag.DyNHhsGt.js.map → tag.Uu-6AQys.js.map} +1 -1
- package/dist/chunks/{textarea.DNeZr2IZ.js → textarea.QgSLPL7S.js} +2 -2
- package/dist/chunks/{textarea.DNeZr2IZ.js.map → textarea.QgSLPL7S.js.map} +1 -1
- package/dist/chunks/{timeline-item.CfA1E0zq.js → timeline-item.DfwOm5do.js} +6 -6
- package/dist/chunks/{timeline-item.CfA1E0zq.js.map → timeline-item.DfwOm5do.js.map} +1 -1
- package/dist/chunks/{tooltip.CuwiX213.js → tooltip.Djn54E1O.js} +3 -3
- package/dist/chunks/{tooltip.CuwiX213.js.map → tooltip.Djn54E1O.js.map} +1 -1
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.4vdcgS4f.js → tutorial.vue_vue_type_script_setup_true_lang.B5-sWGlz.js} +4 -4
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.4vdcgS4f.js.map → tutorial.vue_vue_type_script_setup_true_lang.B5-sWGlz.js.map} +1 -1
- package/dist/chunks/use-bento-delayed-hover.Csc3nIWt.js +30 -0
- package/dist/chunks/use-bento-delayed-hover.Csc3nIWt.js.map +1 -0
- package/dist/chunks/{use-cached-selected-values.C2nbQ4g-.js → use-cached-selected-values.DOw5IKdU.js} +3 -3
- package/dist/chunks/{use-cached-selected-values.C2nbQ4g-.js.map → use-cached-selected-values.DOw5IKdU.js.map} +1 -1
- package/dist/chunks/{use-date-input-formatter.DaBZd09a.js → use-date-input-formatter.x285YiSd.js} +2 -2
- package/dist/chunks/{use-date-input-formatter.DaBZd09a.js.map → use-date-input-formatter.x285YiSd.js.map} +1 -1
- 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 +123 -0
- package/dist/date-time-picker.js.map +1 -0
- package/dist/draggable.js +1 -1
- package/dist/drawer.js +1 -1
- package/dist/dropdown.js +3 -3
- 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 +5 -4
- package/dist/form-layout.js.map +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +217 -216
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/input-time.js +1 -1
- package/dist/inspector.js +1 -1
- package/dist/internal.js +11 -11
- package/dist/layout.js +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/navigation-menu.js +1 -1
- package/dist/pagination.js +1 -1
- package/dist/popover.js +2 -2
- package/dist/popper-container.js +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +1 -1
- package/dist/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 -1
- package/package.json +6 -6
- package/dist/chunks/calendar.D8CM3XkW.js.map +0 -1
- package/dist/chunks/dashed-underline.DojqhvAa.js +0 -108
- package/dist/chunks/dashed-underline.DojqhvAa.js.map +0 -1
- package/dist/chunks/date-picker.DUUGSbot.js +0 -269
- package/dist/chunks/date-picker.DUUGSbot.js.map +0 -1
- package/dist/chunks/date-range-picker.C5CSReZ5.js.map +0 -1
- package/dist/chunks/directive.C8kY-ZW-.js +0 -23
- package/dist/chunks/directive.C8kY-ZW-.js.map +0 -1
- package/dist/chunks/draggable-handle.B_E-T3BS.js +0 -1639
- package/dist/chunks/drawer.GXqb2HPx.js +0 -55
- package/dist/chunks/dropdown.Bsic3Nll.js.map +0 -1
- package/dist/chunks/form-layout-title.B712PesH.js +0 -253
- package/dist/chunks/form-layout-title.B712PesH.js.map +0 -1
- package/dist/chunks/header-meta.I2Tztkls.js +0 -259
- package/dist/chunks/input-field-password.CA16O5Gv.js.map +0 -1
- package/dist/chunks/input-field.DlEEFday.js.map +0 -1
- package/dist/chunks/navigation-menu-group.D5HMMAuh.js +0 -320
- package/dist/chunks/navigation-menu-group.D5HMMAuh.js.map +0 -1
- package/dist/chunks/popover.types.63w2RF7Y.js +0 -6
- package/dist/chunks/secondary-nav.KIu9A7pb.js +0 -306
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { ref as m, computed as n, defineComponent as ve, toRef as E, watch as T, withDirectives as fe, openBlock as u, createElementBlock as De, withKeys as w, createBlock as p, unref as t, createCommentVNode as g, createElementVNode as be, normalizeClass as ye, withCtx as x, createTextVNode as ke, toDisplayString as ge, createVNode as he, nextTick as Ae } from "vue";
|
|
2
|
+
import { g as Ie, f as X, b as Me, h as Se, i as Fe, p as Ce } from "./calendar.iQyNwQBL.js";
|
|
3
|
+
import { h as Ne } from "./button-actions.CxTxPprd.js";
|
|
4
|
+
import { d as Be, B as Pe } from "./typography.B3J6_tYk.js";
|
|
5
|
+
import { D as Re } from "./dropdown.C5um1anU.js";
|
|
6
|
+
import { B as Ee } from "./input-field.DBlTGgAD.js";
|
|
7
|
+
import { d as Te } from "./use-cached-selected-values.DOw5IKdU.js";
|
|
8
|
+
import { g as h } from "./generate-uid.DBWe4g6T.js";
|
|
9
|
+
import { u as H } from "./index.B875RXHM.js";
|
|
10
|
+
import { u as we } from "./form-field.D_2g7vaP.js";
|
|
11
|
+
import { u as Q, a as Oe } from "./use-date-input-formatter.x285YiSd.js";
|
|
12
|
+
import { u as Ve } from "./use-form-layout-loading.CWbjZiwP.js";
|
|
13
|
+
import { u as Ye } from "./use-touch-device.DTqFAbXh.js";
|
|
14
|
+
import { B as qe } from "./directive.D1-d-C2K.js";
|
|
15
|
+
import { F as ze } from "./field-label.CLV3nSzz.js";
|
|
16
|
+
import { E as j } from "./error-message.Dyvrw6ZB.js";
|
|
17
|
+
import { _ as Le } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
18
|
+
import "../assets/date-picker.css";
|
|
19
|
+
const O = {
|
|
20
|
+
"de-DE": { datePicker: "Datumsauswahl", provideDateInAFormat: "Geben Sie das Datum im Format YYYY-MM-DD an", selectDate: "Wählen Sie ein Datum", selectDateRange: "Wählen Sie einen Datumsbereich aus", selectedDateIsNotAvailable: "Ausgewähltes Datum ist nicht verfügbar" },
|
|
21
|
+
"en-GB": { datePicker: "Date picker", provideDateInAFormat: "Enter date in YYYY-MM-DD format", selectDate: "Select a date", selectDateRange: "Select a date range", selectedDateIsNotAvailable: "Selected date is not available" },
|
|
22
|
+
"en-US": { datePicker: "Date picker", provideDateInAFormat: "Provide date in a YYYY-MM-DD format", selectDate: "Select a date", selectDateRange: "Select a date range", selectedDateIsNotAvailable: "Selected date is not available" },
|
|
23
|
+
"es-ES": { datePicker: "Selector de fecha", provideDateInAFormat: "Proporciona la fecha en formato AAAA-MM-DD", selectDate: "Selecciona una fecha", selectDateRange: "Selecciona un rango de fechas", selectedDateIsNotAvailable: "La fecha seleccionada no está disponible" },
|
|
24
|
+
"es-MX": { datePicker: "Selector de fecha", provideDateInAFormat: "Proporciona la fecha en formato AAAA-MM-DD", selectDate: "Selecciona una fecha", selectDateRange: "Selecciona un rango de fechas", selectedDateIsNotAvailable: "La fecha seleccionada no está disponible" },
|
|
25
|
+
"fr-FR": { datePicker: "Sélecteur de date", provideDateInAFormat: "Fournissez la date au format AAAA-MM-JJ", selectDate: "Sélectionnez une date", selectDateRange: "Sélectionnez une plage de dates", selectedDateIsNotAvailable: "La date sélectionnée n’est pas disponible" },
|
|
26
|
+
"it-IT": { datePicker: "Selezionatore di date", provideDateInAFormat: "Inserisci la data nel formato AAAA-MM-GG", selectDate: "Seleziona una data", selectDateRange: "Seleziona un intervallo di date", selectedDateIsNotAvailable: "La data selezionata non è disponibile" },
|
|
27
|
+
"ja-JP": { datePicker: "日付ピッカー", provideDateInAFormat: "YYYY-MM-DD形式で日付を入力してください", selectDate: "日付を選択", selectDateRange: "日付範囲を選択", selectedDateIsNotAvailable: "選択した日付は利用できません" },
|
|
28
|
+
"pt-BR": { datePicker: "Seletor de data", provideDateInAFormat: "Inclua a data no formato AAAA-MM-DD", selectDate: "Selecione uma data", selectDateRange: "Selecione um intervalo de datas", selectedDateIsNotAvailable: "A data selecionada não está disponível" },
|
|
29
|
+
"zh-CN": { datePicker: "日期选择器", provideDateInAFormat: "提供年-月-日格式的日期", selectDate: "选择日期", selectDateRange: "选择日期范围", selectedDateIsNotAvailable: "所选日期不可用" }
|
|
30
|
+
}, $e = ({
|
|
31
|
+
datePickerValue: v,
|
|
32
|
+
dateError: A,
|
|
33
|
+
isMonthVariant: F,
|
|
34
|
+
placeholder: a
|
|
35
|
+
}) => {
|
|
36
|
+
const { locale: C, t: I } = H({ messages: O }), { formatDate: b } = Q(), i = m(v.value?.toDateString());
|
|
37
|
+
return {
|
|
38
|
+
// Values
|
|
39
|
+
dateDisplayValue: n(() => {
|
|
40
|
+
if (A.value)
|
|
41
|
+
return i.value;
|
|
42
|
+
if (!v.value)
|
|
43
|
+
return a?.value || I("selectDate");
|
|
44
|
+
const s = F?.value ? { month: "long", year: "numeric" } : { day: "numeric", month: "short", year: "numeric" };
|
|
45
|
+
return Ie(C.value, s).format(v.value);
|
|
46
|
+
}),
|
|
47
|
+
textInputValue: i,
|
|
48
|
+
// Methods
|
|
49
|
+
formatTextInputDisplayValue: (s = v.value) => {
|
|
50
|
+
if (A.value)
|
|
51
|
+
return;
|
|
52
|
+
if (!s) {
|
|
53
|
+
i.value = "";
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const y = F?.value ? X(s) : s;
|
|
57
|
+
i.value = b(y);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}, Ke = {
|
|
61
|
+
i18n: { messages: O },
|
|
62
|
+
name: "bento-date-picker",
|
|
63
|
+
model: { prop: "modelValue" }
|
|
64
|
+
}, Ue = /* @__PURE__ */ ve({
|
|
65
|
+
...Ke,
|
|
66
|
+
props: {
|
|
67
|
+
defaultDisplayMonth: { default: null },
|
|
68
|
+
firstDayOfWeek: { default: void 0 },
|
|
69
|
+
isDateDisabled: { type: Function, default: void 0 },
|
|
70
|
+
min: { default: null },
|
|
71
|
+
max: { default: null },
|
|
72
|
+
modelValue: { default: null },
|
|
73
|
+
value: { default: null },
|
|
74
|
+
variant: { default: void 0 },
|
|
75
|
+
description: { default: void 0 },
|
|
76
|
+
disabled: { type: Boolean, default: !1 },
|
|
77
|
+
errorMessage: { default: null },
|
|
78
|
+
label: { default: void 0 },
|
|
79
|
+
optional: { type: Boolean, default: !1 },
|
|
80
|
+
placeholder: { default: null },
|
|
81
|
+
readonly: { type: Boolean, default: !1 },
|
|
82
|
+
required: { type: Boolean, default: !1 },
|
|
83
|
+
tooltipText: { default: null }
|
|
84
|
+
},
|
|
85
|
+
emits: ["update:model-value", "input"],
|
|
86
|
+
setup(v, { emit: A }) {
|
|
87
|
+
const a = v, C = A, { t: I } = H({ messages: O }), b = h("bento-date-picker-container"), i = h("bento-date-picker-label"), V = h("bento-date-picker-description"), N = h("bento-date-picker-error"), s = h("bento-date-picker-date-error"), y = n(() => a.label || I("datePicker", { name: b })), Y = m(null), k = m(null), r = m(null), o = m(!1), q = m(void 0), c = m(a.modelValue), { isReadOnly: z } = Ve(E(a, "readonly")), { emitValue: d } = we(C), { resolvedFirstDayOfWeek: Z } = Oe(E(a, "firstDayOfWeek")), { isFormatValid: L, parseDate: $, onKeyDown: ee, autoFormat: ae } = Q(), { isTouchDevice: B } = Ye(), te = n(() => ({
|
|
88
|
+
initialFocus: q.value,
|
|
89
|
+
additionalContainers: [k.value.$el]
|
|
90
|
+
}));
|
|
91
|
+
T(
|
|
92
|
+
() => a.disabled,
|
|
93
|
+
(e) => {
|
|
94
|
+
e && o.value && (o.value = !1);
|
|
95
|
+
}
|
|
96
|
+
), T(
|
|
97
|
+
[() => a.value, () => a.modelValue],
|
|
98
|
+
([e, l]) => {
|
|
99
|
+
e && Be(
|
|
100
|
+
'BentoDatePicker "value" property',
|
|
101
|
+
'The use of "value" prop in "BentoDatePicker" is no longer supported. Use the "v-model" or "model-value" property instead.',
|
|
102
|
+
"2.0.0"
|
|
103
|
+
), c.value = l ?? e;
|
|
104
|
+
},
|
|
105
|
+
{ immediate: !0 }
|
|
106
|
+
);
|
|
107
|
+
const M = n(() => a.variant === "month"), { dateDisplayValue: le, textInputValue: f, formatTextInputDisplayValue: K } = $e({
|
|
108
|
+
datePickerValue: c,
|
|
109
|
+
dateError: r,
|
|
110
|
+
isMonthVariant: M,
|
|
111
|
+
placeholder: E(a, "placeholder")
|
|
112
|
+
}), P = (e) => e ? M.value ? Se(e) : Fe(e) : "", re = n(() => P(c.value)), oe = (e) => {
|
|
113
|
+
if (!e) {
|
|
114
|
+
r.value = null, d(null);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const l = Ce(e, M.value ? "month" : "date");
|
|
118
|
+
if (r.value = R(l), r.value) {
|
|
119
|
+
d(null);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
d(l);
|
|
123
|
+
}, ne = n(() => P(a.min)), ie = n(() => P(a.max)), R = (e) => !e || isNaN(e.getTime()) || a.min && e < a.min || a.max && e > a.max ? "provideDateInAFormat" : a.isDateDisabled && a.isDateDisabled(e) ? "selectedDateIsNotAvailable" : null, D = n(() => r.value ? I(r.value) : null);
|
|
124
|
+
T(
|
|
125
|
+
[o, f, () => a.isDateDisabled, () => a.min, () => a.max],
|
|
126
|
+
([e, l]) => {
|
|
127
|
+
!e && l && L(l) && (r.value = R($(l)));
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
const se = n(() => ({
|
|
131
|
+
"b-date-picker__description--error": a.errorMessage || D.value
|
|
132
|
+
})), U = n(
|
|
133
|
+
() => `${a.description ? V : ""} ${a.errorMessage ? N : ""} ${D.value ? s : ""}`.trim() || null
|
|
134
|
+
), S = () => {
|
|
135
|
+
o.value = !1;
|
|
136
|
+
}, W = () => {
|
|
137
|
+
o.value = !0, K();
|
|
138
|
+
}, de = (e) => {
|
|
139
|
+
r.value = null, S(), d(e);
|
|
140
|
+
}, ue = async () => {
|
|
141
|
+
r.value && (r.value = null, f.value = null), d(null);
|
|
142
|
+
}, ce = (e) => {
|
|
143
|
+
ee(e);
|
|
144
|
+
}, G = (e) => {
|
|
145
|
+
if (e.length < 10)
|
|
146
|
+
return;
|
|
147
|
+
const l = L(e) ? $(e) : null, _ = R(l);
|
|
148
|
+
!_ && l ? (r.value = null, d(l)) : e && (r.value = _ || "provideDateInAFormat", d(null));
|
|
149
|
+
}, pe = Te(G, 1e3), me = (e) => {
|
|
150
|
+
f.value = ae(e), o.value || B.value ? G(f.value) : pe(f.value);
|
|
151
|
+
}, J = async (e) => {
|
|
152
|
+
o.value || (e.preventDefault(), W(), await Ae(), c.value || (K(/* @__PURE__ */ new Date()), d(/* @__PURE__ */ new Date())), q.value = Y.value?.$refs.calendarRef[0].focusOnDate(
|
|
153
|
+
a.variant === "month" ? X(c.value) : c.value,
|
|
154
|
+
!0
|
|
155
|
+
) ?? void 0);
|
|
156
|
+
};
|
|
157
|
+
return (e, l) => fe((u(), De("div", {
|
|
158
|
+
class: "b-date-picker",
|
|
159
|
+
onKeydownCapture: [
|
|
160
|
+
w(J, ["space"]),
|
|
161
|
+
w(J, ["enter"])
|
|
162
|
+
]
|
|
163
|
+
}, [
|
|
164
|
+
e.label ? (u(), p(t(ze), {
|
|
165
|
+
key: 0,
|
|
166
|
+
id: t(i),
|
|
167
|
+
label: e.label,
|
|
168
|
+
"tooltip-text": e.tooltipText,
|
|
169
|
+
optional: e.optional,
|
|
170
|
+
required: e.required
|
|
171
|
+
}, null, 8, ["id", "label", "tooltip-text", "optional", "required"])) : g("", !0),
|
|
172
|
+
be("div", null, [
|
|
173
|
+
t(B) ? (u(), p(t(Ee), {
|
|
174
|
+
key: 0,
|
|
175
|
+
ref_key: "inputContainerRef",
|
|
176
|
+
ref: k,
|
|
177
|
+
type: M.value ? "month" : "date",
|
|
178
|
+
"aria-labelledby": e.label ? t(i) : e.$attrs?.["aria-labelledby"],
|
|
179
|
+
"aria-label": e.label || e.$attrs?.["aria-labelledby"] ? null : y.value,
|
|
180
|
+
"aria-describedby": U.value,
|
|
181
|
+
"aria-required": e.required,
|
|
182
|
+
disabled: e.disabled,
|
|
183
|
+
error: !!e.errorMessage || !!D.value,
|
|
184
|
+
"model-value": re.value,
|
|
185
|
+
readonly: t(z),
|
|
186
|
+
min: ne.value,
|
|
187
|
+
max: ie.value,
|
|
188
|
+
"onUpdate:modelValue": oe
|
|
189
|
+
}, null, 8, ["type", "aria-labelledby", "aria-label", "aria-describedby", "aria-required", "disabled", "error", "model-value", "readonly", "min", "max"])) : (u(), p(t(Re), {
|
|
190
|
+
key: 1,
|
|
191
|
+
ref_key: "inputContainerRef",
|
|
192
|
+
ref: k,
|
|
193
|
+
"always-combobox-is-input": "",
|
|
194
|
+
ariaControls: t(b),
|
|
195
|
+
ariaExpanded: o.value,
|
|
196
|
+
"aria-labelledby": e.label ? t(i) : e.$attrs?.["aria-labelledby"],
|
|
197
|
+
"aria-label": e.label ? null : y.value,
|
|
198
|
+
"aria-describedby": U.value,
|
|
199
|
+
"aria-required": e.required,
|
|
200
|
+
disabled: e.disabled,
|
|
201
|
+
"dynamic-filtering": "",
|
|
202
|
+
"is-invalid": !!e.errorMessage || !!D.value,
|
|
203
|
+
open: o.value,
|
|
204
|
+
value: t(f),
|
|
205
|
+
"display-value": t(le),
|
|
206
|
+
"debounce-time": 0,
|
|
207
|
+
readonly: t(z),
|
|
208
|
+
onInput: me,
|
|
209
|
+
onOpen: W,
|
|
210
|
+
onKeydown: ce,
|
|
211
|
+
onClear: ue,
|
|
212
|
+
onClose: S
|
|
213
|
+
}, null, 8, ["ariaControls", "ariaExpanded", "aria-labelledby", "aria-label", "aria-describedby", "aria-required", "disabled", "is-invalid", "open", "value", "display-value", "readonly"]))
|
|
214
|
+
]),
|
|
215
|
+
D.value ? (u(), p(t(j), {
|
|
216
|
+
key: 1,
|
|
217
|
+
id: t(s),
|
|
218
|
+
"error-message": D.value,
|
|
219
|
+
class: "b-date-picker__error-message"
|
|
220
|
+
}, null, 8, ["id", "error-message"])) : g("", !0),
|
|
221
|
+
e.errorMessage ? (u(), p(t(j), {
|
|
222
|
+
key: 2,
|
|
223
|
+
id: t(N),
|
|
224
|
+
"error-message": e.errorMessage,
|
|
225
|
+
class: "b-date-picker__error-message"
|
|
226
|
+
}, null, 8, ["id", "error-message"])) : g("", !0),
|
|
227
|
+
e.description ? (u(), p(t(Pe), {
|
|
228
|
+
key: 3,
|
|
229
|
+
class: ye(["b-date-picker__description", se.value]),
|
|
230
|
+
el: "span"
|
|
231
|
+
}, {
|
|
232
|
+
default: x(() => [
|
|
233
|
+
ke(ge(e.description), 1)
|
|
234
|
+
]),
|
|
235
|
+
_: 1
|
|
236
|
+
}, 8, ["class"])) : g("", !0),
|
|
237
|
+
k.value && !t(B) ? (u(), p(t(Ne), {
|
|
238
|
+
key: 4,
|
|
239
|
+
id: t(b),
|
|
240
|
+
class: "b-date-picker__container",
|
|
241
|
+
role: "dialog",
|
|
242
|
+
open: o.value,
|
|
243
|
+
"target-element": k.value,
|
|
244
|
+
"aria-label": y.value,
|
|
245
|
+
"aria-modal": !0,
|
|
246
|
+
position: "bottom-start",
|
|
247
|
+
"fit-content": "",
|
|
248
|
+
"trap-all": "",
|
|
249
|
+
"trap-all-options": te.value,
|
|
250
|
+
onKeydown: w(S, ["esc", "native"])
|
|
251
|
+
}, {
|
|
252
|
+
default: x(() => [
|
|
253
|
+
he(t(Me), {
|
|
254
|
+
ref_key: "calendarContainerRef",
|
|
255
|
+
ref: Y,
|
|
256
|
+
"default-display-month": e.defaultDisplayMonth,
|
|
257
|
+
"first-day-of-week": t(Z),
|
|
258
|
+
"is-date-disabled": e.isDateDisabled,
|
|
259
|
+
"number-of-months": 1,
|
|
260
|
+
value: c.value,
|
|
261
|
+
min: e.min,
|
|
262
|
+
max: e.max,
|
|
263
|
+
variant: e.variant,
|
|
264
|
+
onInput: de
|
|
265
|
+
}, null, 8, ["default-display-month", "first-day-of-week", "is-date-disabled", "value", "min", "max", "variant"])
|
|
266
|
+
]),
|
|
267
|
+
_: 1
|
|
268
|
+
}, 8, ["id", "open", "target-element", "aria-label", "trap-all-options"])) : g("", !0)
|
|
269
|
+
], 32)), [
|
|
270
|
+
[t(qe), S]
|
|
271
|
+
]);
|
|
272
|
+
}
|
|
273
|
+
}), ia = /* @__PURE__ */ Le(Ue, [["__scopeId", "data-v-2e36527d"]]);
|
|
274
|
+
export {
|
|
275
|
+
ia as B
|
|
276
|
+
};
|
|
277
|
+
//# sourceMappingURL=date-picker.DyImOUH4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-picker.DyImOUH4.js","sources":["../../../vue2/src/components/date-picker/composables/use-date-picker-single-calendar-text.ts","../../../vue2/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=\"!!errorMessage || !!dateErrorText\"\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=\"dateErrorText\"\n :id=\"dateErrorId\"\n :error-message=\"dateErrorText\"\n class=\"b-date-picker__error-message\"\n />\n <error-message\n v-if=\"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 fit-content\n trap-all\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 @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 '@/core/utils/ts';\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 import { deprecate } from '@/utils/ts/deprecate';\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 = withDefaults(defineProps<BentoDatePickerProps>(), {\n defaultDisplayMonth: null,\n description: undefined,\n disabled: false,\n errorMessage: null,\n firstDayOfWeek: undefined,\n isDateDisabled: undefined,\n label: undefined,\n max: null,\n min: null,\n modelValue: null,\n optional: false,\n placeholder: null,\n readonly: false,\n required: false,\n tooltipText: null,\n value: null,\n variant: undefined, // Default will be set by @/internal/calendar\n });\n\n const emit = defineEmits<BentoDatePickerEmits>();\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); // to be removed when `props.value` is removed\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.value, () => props.modelValue],\n ([newValue, newModelValue]) => {\n if (newValue) {\n deprecate(\n 'BentoDatePicker \"value\" property',\n `The use of \"value\" prop in \"BentoDatePicker\" is no longer supported. Use the \"v-model\" or \"model-value\" property instead.`,\n '2.0.0'\n );\n }\n\n internalModelValue.value = newModelValue ?? newValue;\n },\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 'provideDateInAFormat';\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 'provideDateInAFormat';\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\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 || 'provideDateInAFormat';\n emitValue(null);\n }\n };\n\n const validateDateDebounced = debounce(validateDate, DEBOUNCE_TIME);\n\n const onDateInputChange = (stringDate: string) => {\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 * @input=\"onDateChanged\"\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' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./date-picker.scss\" />\n"],"names":["useDatePickerSingleCalendarText","datePickerValue","dateError","isMonthVariant","placeholder","locale","t","useI18n","messages","formatDate","useDateInputFormatter","textInputValue","ref","computed","dateFormatOptions","getDateTimeFormatter","dateToFormat","date","startOfMonth","__default__","props","__props","emit","__emit","datePickerContainerId","generateUid","labelId","descriptionId","errorId","dateErrorId","popoverAriaLabel","calendarContainerRef","inputContainerRef","isDatePickerOpen","initialFocusOnDatePickerOpen","internalModelValue","isReadOnly","useFormLayoutFieldLoading","toRef","emitValue","useFormFieldEmits","resolvedFirstDayOfWeek","useFirstDayOfWeek","isFormatValid","parseDate","onKeyDown","autoFormat","isTouchDevice","useTouchDevice","computedTrapAllOptions","watch","disabled","newValue","newModelValue","deprecate","dateDisplayValue","formatTextInputDisplayValue","formatNativeDate","dateToNativeMonthString","dateToNativeDateString","nativeValue","onNativeDateInput","value","parseNativeDateString","getDateErrorReason","formattedMin","formattedMax","dateErrorText","isOpen","textValue","descriptionConditionalClasses","ariaDescribedBy","closeDatePicker","openDatePicker","onDateSelected","selectedDate","clearDatePickerValue","onDateKeyDown","event","validateDate","stringDate","parsedDate","errorKey","validateDateDebounced","debounce","onDateInputChange","onSpaceBarOrEnter","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,EAAA,UAAAC,EAAA,CAAA,GACA,EAAA,YAAAC,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAAX,EAAA,OAAA,aAAA,CAAA;AAyCA,SAAA;AAAA;AAAA,IAAO,kBAvCPY,EAAA,MAAA;AAEI,UAAAX,EAAA;AACI,eAAAS,EAAA;AAIJ,UAAA,CAAAV,EAAA;AACI,eAAAG,GAAA,SAAAE,EAAA,YAAA;AAKJ,YAAAQ,IAAAX,GAAA,QAAA,EAAA,OAAA,QAAA,MAAA,UAAA,IAAA,EAAA,KAAA,WAAA,OAAA,SAAA,MAAA,UAAA;AAIA,aAAAY,GAAAV,EAAA,OAAAS,CAAA,EAAA,OAAAb,EAAA,KAAA;AAAA,IAAyF,CAAA;AAAA,IAwBzF,gBAAAU;AAAA;AAAA,IACA,6BAlBJ,CAAAK,IAAAf,EAAA,UAAA;AAEI,UAAAC,EAAA;AACI;AAGJ,UAAA,CAAAc,GAAA;AACI,QAAAL,EAAA,QAAA;AACA;AAAA,MAAA;AAGJ,YAAAM,IAAAd,GAAA,QAAAe,EAAAF,CAAA,IAAAA;AACA,MAAAL,EAAA,QAAAF,EAAAQ,CAAA;AAAA,IAAsC;AAAA,EAStC;AAER,GCyWIE,KAAA;AAAA,EAAe,MAAA,EAAA,U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