@adyen/bento-vue3 1.78.2 → 1.79.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/index.d.ts +79 -30
- package/dist/accordion.js +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/ai-button.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/checkbox-group.css +1 -1
- package/dist/assets/dashboard-section.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/form-layout-title.css +1 -1
- package/dist/assets/header-with-views.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/input-field-password.css +1 -1
- package/dist/assets/input-field-phone-number.css +1 -1
- package/dist/assets/input-field.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/layout-row.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/search-bar.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/step.css +1 -1
- package/dist/assets/structured-list-item.css +1 -1
- package/dist/assets/summary-grid.css +1 -1
- package/dist/assets/tab.css +1 -1
- package/dist/assets/teleport.css +1 -0
- package/dist/assets/toast.css +1 -1
- package/dist/assets/tooltip.css +1 -1
- package/dist/assets/tutorial.css +1 -1
- package/dist/assets/use-cached-selected-values.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.Bd3v6erb.js → accordion-item.DHyAfeAu.js} +2 -2
- package/dist/chunks/{accordion-item.Bd3v6erb.js.map → accordion-item.DHyAfeAu.js.map} +1 -1
- package/dist/chunks/{action-bar.BZ04Y7Yi.js → action-bar.QX16Mu4L.js} +3 -3
- package/dist/chunks/{action-bar.BZ04Y7Yi.js.map → action-bar.QX16Mu4L.js.map} +1 -1
- package/dist/chunks/{base-modal.UA93s_8c.js → base-modal.CHYvJ_xU.js} +17 -17
- package/dist/chunks/{base-modal.UA93s_8c.js.map → base-modal.CHYvJ_xU.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.BeQ-j1bv.js → button-actions-with-menu.B8qBBN82.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.BeQ-j1bv.js.map → button-actions-with-menu.B8qBBN82.js.map} +1 -1
- package/dist/chunks/button-actions.Bg38lywL.js +1234 -0
- package/dist/chunks/button-actions.Bg38lywL.js.map +1 -0
- package/dist/chunks/{calendar.Tm7Cvpwu.js → calendar.CyJXcMz2.js} +4 -43
- package/dist/chunks/{calendar.Tm7Cvpwu.js.map → calendar.CyJXcMz2.js.map} +1 -1
- package/dist/chunks/{card.GxkxfBoV.js → card.BqkufnQe.js} +2 -2
- package/dist/chunks/{card.GxkxfBoV.js.map → card.BqkufnQe.js.map} +1 -1
- package/dist/chunks/{checkbox-group.D56nUmre.js → checkbox-group.BRQiuU3y.js} +51 -50
- package/dist/chunks/checkbox-group.BRQiuU3y.js.map +1 -0
- package/dist/chunks/{checkbox.SffuKyNj.js → checkbox.BRTK_DHj.js} +3 -3
- package/dist/chunks/{checkbox.SffuKyNj.js.map → checkbox.BRTK_DHj.js.map} +1 -1
- package/dist/chunks/{code-snippet.B5NUDrZ-.js → code-snippet.YxZ3_4ye.js} +5 -5
- package/dist/chunks/{code-snippet.B5NUDrZ-.js.map → code-snippet.YxZ3_4ye.js.map} +1 -1
- package/dist/chunks/{codemirror.Zv80n3Z2.js → codemirror.Cy7iSLbd.js} +12 -12
- package/dist/chunks/{codemirror.Zv80n3Z2.js.map → codemirror.Cy7iSLbd.js.map} +1 -1
- package/dist/chunks/constructNow.BhymNmy5.js +8 -0
- package/dist/chunks/{constructNow.CHWWeLPc.js.map → constructNow.BhymNmy5.js.map} +1 -1
- package/dist/chunks/{controls-group.cbGiHr7n.js → controls-group.CJe5J84d.js} +2 -2
- package/dist/chunks/{controls-group.cbGiHr7n.js.map → controls-group.CJe5J84d.js.map} +1 -1
- package/dist/chunks/{copy.ClKnDjMI.js → copy.mq0o1Rag.js} +2 -2
- package/dist/chunks/{copy.ClKnDjMI.js.map → copy.mq0o1Rag.js.map} +1 -1
- package/dist/chunks/{country.DmnN9YIW.js → country.D484ezGU.js} +2 -2
- package/dist/chunks/{country.DmnN9YIW.js.map → country.D484ezGU.js.map} +1 -1
- package/dist/chunks/{dashboard-section.Cqi0PWeJ.js → dashboard-section.CNCqp74F.js} +4 -4
- package/dist/chunks/{dashboard-section.Cqi0PWeJ.js.map → dashboard-section.CNCqp74F.js.map} +1 -1
- package/dist/chunks/{dashed-underline.r62L_XBr.js → dashed-underline.CtTu1AOE.js} +26 -25
- package/dist/chunks/{dashed-underline.r62L_XBr.js.map → dashed-underline.CtTu1AOE.js.map} +1 -1
- package/dist/chunks/{data-grid-template.D7kB3S1u.js → data-grid-template.CLpaJvTj.js} +4 -4
- package/dist/chunks/{data-grid-template.D7kB3S1u.js.map → data-grid-template.CLpaJvTj.js.map} +1 -1
- package/dist/chunks/data-grid-template.keys.VezYtHtM.js +5 -0
- package/dist/chunks/{data-grid-template.keys.2_AkxuNT.js.map → data-grid-template.keys.VezYtHtM.js.map} +1 -1
- package/dist/chunks/{data-grid.jC1eKDzq.js → data-grid.CD3Nb4pg.js} +18 -18
- package/dist/chunks/{data-grid.jC1eKDzq.js.map → data-grid.CD3Nb4pg.js.map} +1 -1
- package/dist/chunks/{date-picker.x9GeC_UO.js → date-picker.C3BH0Bsr.js} +13 -13
- package/dist/chunks/{date-picker.x9GeC_UO.js.map → date-picker.C3BH0Bsr.js.map} +1 -1
- package/dist/chunks/date-range-picker.BPZE6r01.js +1108 -0
- package/dist/chunks/date-range-picker.BPZE6r01.js.map +1 -0
- package/dist/chunks/{dialog-page.zWrBSgBD.js → dialog-page.BY6T1jYZ.js} +2 -2
- package/dist/chunks/{dialog-page.zWrBSgBD.js.map → dialog-page.BY6T1jYZ.js.map} +1 -1
- package/dist/chunks/{differenceInMonths.C8FyCrav.js → differenceInMonths.Cab3nOsb.js} +2 -2
- package/dist/chunks/{differenceInMonths.C8FyCrav.js.map → differenceInMonths.Cab3nOsb.js.map} +1 -1
- package/dist/chunks/{divider.DnKNNyWB.js → divider.Dho4_hQ7.js} +2 -2
- package/dist/chunks/{divider.DnKNNyWB.js.map → divider.Dho4_hQ7.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox._KEBXjKT.js → dropdown-default-textbox.CNrsjXUU.js} +2 -2
- package/dist/chunks/{dropdown-default-textbox._KEBXjKT.js.map → dropdown-default-textbox.CNrsjXUU.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.DIlF7mOi.js → dropdown-tag.B0LtUuUk.js} +4 -4
- package/dist/chunks/{dropdown-tag.DIlF7mOi.js.map → dropdown-tag.B0LtUuUk.js.map} +1 -1
- package/dist/chunks/{dropdown.CdsjtT9_.js → dropdown.B5tPWVxg.js} +9 -9
- package/dist/chunks/{dropdown.CdsjtT9_.js.map → dropdown.B5tPWVxg.js.map} +1 -1
- package/dist/chunks/es6.MoTTyETW.js.map +1 -1
- package/dist/chunks/{events.CMzGybJJ.js → events.BQOQSSb7.js} +2 -5
- package/dist/chunks/{events.CMzGybJJ.js.map → events.BQOQSSb7.js.map} +1 -1
- package/dist/chunks/{field-label.C97CrBI_.js → field-label.B1rMWIWY.js} +2 -2
- package/dist/chunks/{field-label.C97CrBI_.js.map → field-label.B1rMWIWY.js.map} +1 -1
- package/dist/chunks/{file-uploader.R0NZXIsS.js → file-uploader.BwmQdkmz.js} +367 -350
- package/dist/chunks/file-uploader.BwmQdkmz.js.map +1 -0
- package/dist/chunks/{filter-bar.DAYxD7wi.js → filter-bar.B9yGivxl.js} +118 -122
- package/dist/chunks/filter-bar.B9yGivxl.js.map +1 -0
- package/dist/chunks/{footer-actions.BO52wpv-.js → footer-actions.pC1mxLQm.js} +2 -2
- package/dist/chunks/{footer-actions.BO52wpv-.js.map → footer-actions.pC1mxLQm.js.map} +1 -1
- package/dist/chunks/{form-layout-title.61ESsGAY.js → form-layout-title.sxPU_lB_.js} +2 -2
- package/dist/chunks/{form-layout-title.61ESsGAY.js.map → form-layout-title.sxPU_lB_.js.map} +1 -1
- package/dist/chunks/form-layout.types.bZW9iR6_.js +5 -0
- package/dist/chunks/{form-layout.types.D3EKzbE7.js.map → form-layout.types.bZW9iR6_.js.map} +1 -1
- package/dist/chunks/get-slot-text.CQRAP2_q.js.map +1 -1
- package/dist/chunks/{getTimezoneOffsetInMilliseconds.BW7U6PxE.js → getTimezoneOffsetInMilliseconds.B7sxiukN.js} +2 -2
- package/dist/chunks/{getTimezoneOffsetInMilliseconds.BW7U6PxE.js.map → getTimezoneOffsetInMilliseconds.B7sxiukN.js.map} +1 -1
- package/dist/chunks/{header-meta.BE6QfUNi.js → header-meta.DZ8Gx4XE.js} +17 -17
- package/dist/chunks/{header-meta.BE6QfUNi.js.map → header-meta.DZ8Gx4XE.js.map} +1 -1
- package/dist/chunks/{header-with-views.CzLcYeW5.js → header-with-views.b1gt2wud.js} +109 -109
- package/dist/chunks/{header-with-views.CzLcYeW5.js.map → header-with-views.b1gt2wud.js.map} +1 -1
- package/dist/chunks/{header.3It50Clh.js → header.BQAAmjUF.js} +3 -3
- package/dist/chunks/{header.3It50Clh.js.map → header.BQAAmjUF.js.map} +1 -1
- package/dist/chunks/{info-icon.BhOm72U4.js → info-icon.DB0MI-dH.js} +2 -2
- package/dist/chunks/{info-icon.BhOm72U4.js.map → info-icon.DB0MI-dH.js.map} +1 -1
- package/dist/chunks/{input-field-password.-xEY2VB8.js → input-field-password.noxsH61p.js} +154 -146
- package/dist/chunks/input-field-password.noxsH61p.js.map +1 -0
- package/dist/chunks/{input-field-phone-number.DcxhP_qK.js → input-field-phone-number.B_uFvUXP.js} +587 -585
- package/dist/chunks/{input-field-phone-number.DcxhP_qK.js.map → input-field-phone-number.B_uFvUXP.js.map} +1 -1
- package/dist/chunks/{input-field.B6nL7d8O.js → input-field.C9ABE4cI.js} +118 -110
- package/dist/chunks/input-field.C9ABE4cI.js.map +1 -0
- package/dist/chunks/{keyboard-navigation.pB8weElW.js → keyboard-navigation.DWmhelVv.js} +2 -2
- package/dist/chunks/{keyboard-navigation.pB8weElW.js.map → keyboard-navigation.DWmhelVv.js.map} +1 -1
- package/dist/chunks/{layout-row.DVf7wNSB.js → layout-row.BxP9SxrL.js} +2 -2
- package/dist/chunks/{layout-row.DVf7wNSB.js.map → layout-row.BxP9SxrL.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.Cwe9Bn-R.js → listbox-option-tag.C1cZs38g.js} +2 -2
- package/dist/chunks/{listbox-option-tag.Cwe9Bn-R.js.map → listbox-option-tag.C1cZs38g.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.DTT-5rQX.js → modal-fullscreen.B69QJ8D6.js} +23 -21
- package/dist/chunks/modal-fullscreen.B69QJ8D6.js.map +1 -0
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.c3Ma1oAL.js → modal.vue_vue_type_script_setup_true_lang.BYqbdsty.js} +4 -4
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.c3Ma1oAL.js.map → modal.vue_vue_type_script_setup_true_lang.BYqbdsty.js.map} +1 -1
- package/dist/chunks/{pagination.DCn_tenp.js → pagination.Dst8Y6DD.js} +2 -2
- package/dist/chunks/{pagination.DCn_tenp.js.map → pagination.Dst8Y6DD.js.map} +1 -1
- package/dist/chunks/{payment-method.D6PeTYWq.js → payment-method.CExDsirg.js} +2 -2
- package/dist/chunks/{payment-method.D6PeTYWq.js.map → payment-method.CExDsirg.js.map} +1 -1
- package/dist/chunks/promo-banner.B-TLTLEd.js.map +1 -1
- package/dist/chunks/{radio-group.Br-N309Y.js → radio-group.CVDDBCP4.js} +5 -5
- package/dist/chunks/{radio-group.Br-N309Y.js.map → radio-group.CVDDBCP4.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.B6Ftqv55.js → rich-text-editor.DyC-Nnc8.js} +12 -12
- package/dist/chunks/{rich-text-editor.B6Ftqv55.js.map → rich-text-editor.DyC-Nnc8.js.map} +1 -1
- package/dist/chunks/{search-bar.BmNEcy0L.js → search-bar.BwrFcw9L.js} +28 -28
- package/dist/chunks/search-bar.BwrFcw9L.js.map +1 -0
- package/dist/chunks/{secondary-nav.CPosCncv.js → secondary-nav.D7l9h0_t.js} +3 -3
- package/dist/chunks/{secondary-nav.CPosCncv.js.map → secondary-nav.D7l9h0_t.js.map} +1 -1
- package/dist/chunks/{segmented-control.BCHGDSrf.js → segmented-control.CwDOwDIu.js} +2 -2
- package/dist/chunks/{segmented-control.BCHGDSrf.js.map → segmented-control.CwDOwDIu.js.map} +1 -1
- package/dist/chunks/{selection-card-group.DBdwqWsH.js → selection-card-group.CZfusjo0.js} +4 -4
- package/dist/chunks/{selection-card-group.DBdwqWsH.js.map → selection-card-group.CZfusjo0.js.map} +1 -1
- package/dist/chunks/{sidepanel.CS9CfAWZ.js → sidepanel.BFz_7DKg.js} +4 -4
- package/dist/chunks/{sidepanel.CS9CfAWZ.js.map → sidepanel.BFz_7DKg.js.map} +1 -1
- package/dist/chunks/{step.CoSuGK16.js → step.CxnmaTMe.js} +3 -3
- package/dist/chunks/{step.CoSuGK16.js.map → step.CxnmaTMe.js.map} +1 -1
- package/dist/chunks/structured-list-item.DjbvVIwI.js +111 -0
- package/dist/chunks/{structured-list-item.BTPh7SPj.js.map → structured-list-item.DjbvVIwI.js.map} +1 -1
- package/dist/chunks/summary-grid.keys.Xx-W5a2w.js +6 -0
- package/dist/chunks/{summary-grid.keys.CxTf_FOc.js.map → summary-grid.keys.Xx-W5a2w.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.cE1fyLvC.js → summary-grid.types.KVqau_I-.js} +74 -68
- package/dist/chunks/summary-grid.types.KVqau_I-.js.map +1 -0
- package/dist/chunks/{tab.CD5Eu6ql.js → tab.BAwuVDsV.js} +2 -2
- package/dist/chunks/{tab.CD5Eu6ql.js.map → tab.BAwuVDsV.js.map} +1 -1
- package/dist/chunks/tabs.keys.B4qGhjp2.js +7 -0
- package/dist/chunks/{tabs.keys.Cb4Vw5Jh.js.map → tabs.keys.B4qGhjp2.js.map} +1 -1
- package/dist/chunks/{tag.CjaB9DxL.js → tag.BmMnGJMp.js} +2 -2
- package/dist/chunks/{tag.CjaB9DxL.js.map → tag.BmMnGJMp.js.map} +1 -1
- package/dist/chunks/teleport.CHhznja1.js +129 -0
- package/dist/chunks/teleport.CHhznja1.js.map +1 -0
- package/dist/chunks/{textarea.XRETLCSj.js → textarea.BZjnJf5q.js} +3 -3
- package/dist/chunks/{textarea.XRETLCSj.js.map → textarea.BZjnJf5q.js.map} +1 -1
- package/dist/chunks/{timeline-item.19zg_gBi.js → timeline-item.YjC_8BBB.js} +7 -7
- package/dist/chunks/{timeline-item.19zg_gBi.js.map → timeline-item.YjC_8BBB.js.map} +1 -1
- package/dist/chunks/toast.e1-BCZks.js +229 -0
- package/dist/chunks/toast.e1-BCZks.js.map +1 -0
- package/dist/chunks/{tooltip.Dp9_ESm_.js → tooltip.CeX5eGnw.js} +2 -2
- package/dist/chunks/{tooltip.Dp9_ESm_.js.map → tooltip.CeX5eGnw.js.map} +1 -1
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.KvlJ_dl9.js → tutorial.vue_vue_type_script_setup_true_lang.Cqimmacx.js} +2 -2
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.KvlJ_dl9.js.map → tutorial.vue_vue_type_script_setup_true_lang.Cqimmacx.js.map} +1 -1
- package/dist/chunks/{use-bento-toast-controller.Kri_h7jS.js → use-bento-toast-controller.DK1PV3YW.js} +2 -2
- package/dist/chunks/{use-bento-toast-controller.Kri_h7jS.js.map → use-bento-toast-controller.DK1PV3YW.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.8MdrR9wt.js → use-cached-selected-values.os3Yp7Tw.js} +3 -3
- package/dist/chunks/{use-cached-selected-values.8MdrR9wt.js.map → use-cached-selected-values.os3Yp7Tw.js.map} +1 -1
- package/dist/chunks/{use-form-layout-loading.D3lALhtC.js → use-form-layout-loading.CWbjZiwP.js} +2 -2
- package/dist/chunks/{use-form-layout-loading.D3lALhtC.js.map → use-form-layout-loading.CWbjZiwP.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/country.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/divider.js +1 -1
- package/dist/dropdown.js +4 -4
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.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 +288 -287
- 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/internal.js +27 -26
- package/dist/internal.js.map +1 -1
- package/dist/layout.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/pagination.js +1 -1
- package/dist/payment-method.js +1 -1
- package/dist/popover.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/stepper.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/styles/bento-dark.css +4 -1
- package/dist/styles/bento-light.css +4 -1
- package/dist/styles/bento.css +4 -1
- package/dist/styles/legacy.css +4 -1
- package/dist/styles/styleguide.css +4 -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/toast.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/use-form-v4.js +8 -8
- package/dist/use-form-v4.js.map +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +11 -10
- package/dist/chunks/button-actions.BQ3AFQqt.js +0 -1355
- package/dist/chunks/button-actions.BQ3AFQqt.js.map +0 -1
- package/dist/chunks/checkbox-group.D56nUmre.js.map +0 -1
- package/dist/chunks/constructNow.CHWWeLPc.js +0 -8
- package/dist/chunks/data-grid-template.keys.2_AkxuNT.js +0 -5
- package/dist/chunks/date-range-picker.CXeFdxAA.js +0 -1100
- package/dist/chunks/date-range-picker.CXeFdxAA.js.map +0 -1
- package/dist/chunks/file-uploader.R0NZXIsS.js.map +0 -1
- package/dist/chunks/filter-bar.DAYxD7wi.js.map +0 -1
- package/dist/chunks/form-layout.types.D3EKzbE7.js +0 -5
- package/dist/chunks/input-field-password.-xEY2VB8.js.map +0 -1
- package/dist/chunks/input-field.B6nL7d8O.js.map +0 -1
- package/dist/chunks/modal-fullscreen.DTT-5rQX.js.map +0 -1
- package/dist/chunks/search-bar.BmNEcy0L.js.map +0 -1
- package/dist/chunks/structured-list-item.BTPh7SPj.js +0 -111
- package/dist/chunks/summary-grid.keys.CxTf_FOc.js +0 -6
- package/dist/chunks/summary-grid.types.cE1fyLvC.js.map +0 -1
- package/dist/chunks/tabs.keys.Cb4Vw5Jh.js +0 -7
- package/dist/chunks/toast.6oJx7SNq.js +0 -221
- package/dist/chunks/toast.6oJx7SNq.js.map +0 -1
|
@@ -0,0 +1,1108 @@
|
|
|
1
|
+
import { reactive as ke, defineComponent as lt, useSlots as St, ref as U, computed as b, onMounted as ot, createElementBlock as he, openBlock as F, createElementVNode as ae, createCommentVNode as A, normalizeClass as _e, renderSlot as He, createBlock as V, unref as D, createVNode as z, withCtx as P, createTextVNode as ie, toRaw as Ce, watch as Me, toRef as Qe, withDirectives as ht, withKeys as Ge, toDisplayString as _t, createSlots as Mt } from "vue";
|
|
2
|
+
import { g as kt } from "./index.E60QniEu.js";
|
|
3
|
+
import { B as Ot } from "./divider.Dho4_hQ7.js";
|
|
4
|
+
import { g as wt, B as Ft } from "./button-actions.Bg38lywL.js";
|
|
5
|
+
import { B as Ue, d as We } from "./typography.yBEME_Gu.js";
|
|
6
|
+
import { D as Ct } from "./dropdown-default-textbox.CNrsjXUU.js";
|
|
7
|
+
import { e as L, a as Ke, g as Ae } from "./differenceInMonths.Cab3nOsb.js";
|
|
8
|
+
import { g as ve } from "./generate-uid.NJ8tVoha.js";
|
|
9
|
+
import { u as Ne } from "./index.pdBj0KQU.js";
|
|
10
|
+
import { e as N, g as it, h as Pe, i as x, j as Ut, k as Ve, l as At, s as ze, m as Nt, n as pe, o as Je, b as K, u as Bt, f as me } from "./calendar.CyJXcMz2.js";
|
|
11
|
+
import { f as Xe, v as xt, D as M } from "./date-format.B8RU7D42.js";
|
|
12
|
+
import { t as J, c as qt, n as $t } from "./getTimezoneOffsetInMilliseconds.B7sxiukN.js";
|
|
13
|
+
import { u as Yt } from "./use-form-layout-loading.CWbjZiwP.js";
|
|
14
|
+
import { B as Lt } from "./directive.Cbdox5VL.js";
|
|
15
|
+
import { u as jt } from "./form-field.D_2g7vaP.js";
|
|
16
|
+
import { B as Ee } from "./input-field.C9ABE4cI.js";
|
|
17
|
+
import { B as Ht } from "./dropdown.B5tPWVxg.js";
|
|
18
|
+
import { B as Qt } from "./segmented-control.CwDOwDIu.js";
|
|
19
|
+
import { d as Ie } from "./debounce.DUTu11PS.js";
|
|
20
|
+
import { u as Gt } from "./use-has-slot.B7eQSabc.js";
|
|
21
|
+
import { c as Wt } from "./constructNow.BhymNmy5.js";
|
|
22
|
+
import { _ as ut } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
23
|
+
import { F as Kt, E as Ze } from "./field-label.B1rMWIWY.js";
|
|
24
|
+
import { B as Pt } from "./button-actions.types.BptAXjD8.js";
|
|
25
|
+
import "../assets/date-range-picker.css";
|
|
26
|
+
function ue(a) {
|
|
27
|
+
if (a == null)
|
|
28
|
+
return N(/* @__PURE__ */ new Date());
|
|
29
|
+
const [o, u, s] = a.split("-").map((e) => parseInt(e, 10));
|
|
30
|
+
return new Date(o, u - 1, s);
|
|
31
|
+
}
|
|
32
|
+
function dt(a, o, u) {
|
|
33
|
+
return it(a, o * 3, u);
|
|
34
|
+
}
|
|
35
|
+
function Vt(a, o, u) {
|
|
36
|
+
return dt(a, -1, u);
|
|
37
|
+
}
|
|
38
|
+
const zt = ({
|
|
39
|
+
firstDayOfWeek: a,
|
|
40
|
+
min: o,
|
|
41
|
+
max: u
|
|
42
|
+
}) => ({ getGranularCalendarLimits: (e) => {
|
|
43
|
+
if (!o && !u)
|
|
44
|
+
return { min: null, max: null };
|
|
45
|
+
let d = o ? N(o) : null, f = u ? L(u) : null;
|
|
46
|
+
if ((e == null ? void 0 : e.type) === "weekly") {
|
|
47
|
+
if (e.earliest)
|
|
48
|
+
d = N(e.earliest);
|
|
49
|
+
else if (d) {
|
|
50
|
+
const y = Pe(d, { weekStartsOn: a });
|
|
51
|
+
x(d, y) || (d = N(Ut(Ve(d, { weekStartsOn: a }), 1)));
|
|
52
|
+
}
|
|
53
|
+
if (e.latest)
|
|
54
|
+
f = L(e.latest);
|
|
55
|
+
else if (f) {
|
|
56
|
+
const y = Ve(f, { weekStartsOn: a });
|
|
57
|
+
x(f, y) || (f = L(At(Pe(f, { weekStartsOn: a }), 1)));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if ((e == null ? void 0 : e.type) === "monthly") {
|
|
61
|
+
if (e.earliest)
|
|
62
|
+
d = N(e.earliest);
|
|
63
|
+
else if (d) {
|
|
64
|
+
const y = ze(d);
|
|
65
|
+
x(d, y) || (d = ze(it(d, 1)));
|
|
66
|
+
}
|
|
67
|
+
if (e.latest)
|
|
68
|
+
f = L(e.latest);
|
|
69
|
+
else if (f) {
|
|
70
|
+
const y = Ke(f);
|
|
71
|
+
x(f, y) || (f = Ke(Nt(f, 1)));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if ((e == null ? void 0 : e.type) === "quarterly") {
|
|
75
|
+
if (e.earliest)
|
|
76
|
+
d = pe(e.earliest);
|
|
77
|
+
else if (d) {
|
|
78
|
+
const y = pe(d);
|
|
79
|
+
x(d, y) || (d = pe(dt(d, 1)));
|
|
80
|
+
}
|
|
81
|
+
if (e.latest)
|
|
82
|
+
f = L(e.latest);
|
|
83
|
+
else if (f) {
|
|
84
|
+
const y = Je(f);
|
|
85
|
+
x(f, y) || (f = Je(Vt(f)));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return { min: d, max: f };
|
|
89
|
+
} }), Jt = () => {
|
|
90
|
+
const a = ke({
|
|
91
|
+
daily: null,
|
|
92
|
+
weekly: null,
|
|
93
|
+
monthly: null,
|
|
94
|
+
quarterly: null
|
|
95
|
+
});
|
|
96
|
+
return {
|
|
97
|
+
savedRanges: a,
|
|
98
|
+
saveRange: (s, e) => {
|
|
99
|
+
a[s] = e;
|
|
100
|
+
},
|
|
101
|
+
resetSavedRanges: () => {
|
|
102
|
+
a.daily = null, a.weekly = null, a.monthly = null, a.quarterly = null;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
var g = /* @__PURE__ */ ((a) => (a.CUSTOM_RANGE = "custom-range", a.INPUT = "input", a.ERROR = "error", a.FORM_DATE = "form-date", a.START_DATE_SELECTED = "start-date-selected", a))(g || {});
|
|
107
|
+
const Xt = /[\d]/, Zt = /^\d{2}$/, ea = /^\d{2}:\d{2}$/, ta = (a) => {
|
|
108
|
+
const { selectionStart: o } = a.target, u = ["Backspace", "Tab", "ArrowLeft", "ArrowRight"], s = Xt.test(a.key) || u.includes(a.key), e = [1, 2, 4, 5].includes(o) && a.key === ":";
|
|
109
|
+
!s && !e && a.preventDefault();
|
|
110
|
+
}, et = (a) => {
|
|
111
|
+
if (!a)
|
|
112
|
+
return a;
|
|
113
|
+
let o = a;
|
|
114
|
+
if (o.length === 1 && parseInt(a, 10) > 2)
|
|
115
|
+
return `0${o}:`;
|
|
116
|
+
const [u, s] = o.slice(-2);
|
|
117
|
+
return [2, 5].includes(o.length) && s === ":" && (o = `${o.slice(0, o.length - 2)}0${u}`), (Zt.test(o) || ea.test(o)) && (o += ":"), o;
|
|
118
|
+
};
|
|
119
|
+
function aa(a, o, u) {
|
|
120
|
+
const s = J(a, u == null ? void 0 : u.in);
|
|
121
|
+
return s.setHours(o), s;
|
|
122
|
+
}
|
|
123
|
+
function na(a, o, u) {
|
|
124
|
+
const s = J(a, u == null ? void 0 : u.in);
|
|
125
|
+
return s.setMinutes(o), s;
|
|
126
|
+
}
|
|
127
|
+
function ra(a, o, u) {
|
|
128
|
+
const s = J(a, u == null ? void 0 : u.in);
|
|
129
|
+
return s.setSeconds(o), s;
|
|
130
|
+
}
|
|
131
|
+
function tt(a, o) {
|
|
132
|
+
const u = J(a, o == null ? void 0 : o.in);
|
|
133
|
+
return u.setMilliseconds(0), u;
|
|
134
|
+
}
|
|
135
|
+
function at(a, o) {
|
|
136
|
+
return +tt(a) == +tt(o);
|
|
137
|
+
}
|
|
138
|
+
function Se(a, o) {
|
|
139
|
+
return +J(a) == +J(o);
|
|
140
|
+
}
|
|
141
|
+
function sa(a, o) {
|
|
142
|
+
return x(
|
|
143
|
+
qt(a, a),
|
|
144
|
+
Wt(a)
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
function nt(a, o, u) {
|
|
148
|
+
const s = J(a, u == null ? void 0 : u.in);
|
|
149
|
+
return s.setMilliseconds(o), s;
|
|
150
|
+
}
|
|
151
|
+
const ct = {
|
|
152
|
+
"en-US": {
|
|
153
|
+
customRange: "Custom range",
|
|
154
|
+
daily: "Daily",
|
|
155
|
+
dateFrom: "Date from",
|
|
156
|
+
dateTo: "Date to",
|
|
157
|
+
lastMonth: "Last month",
|
|
158
|
+
lastSevenDays: "Last 7 days",
|
|
159
|
+
lastThreeMonths: "Last three months",
|
|
160
|
+
monthly: "Monthly",
|
|
161
|
+
quarterly: "Quarterly",
|
|
162
|
+
timeFrom: "Time from",
|
|
163
|
+
timeTo: "Time to",
|
|
164
|
+
weekly: "Weekly"
|
|
165
|
+
},
|
|
166
|
+
"ja-JP": {
|
|
167
|
+
customRange: "カスタム範囲を選択",
|
|
168
|
+
daily: "毎日",
|
|
169
|
+
lastMonth: "先月",
|
|
170
|
+
lastSevenDays: "過去7日間",
|
|
171
|
+
monthly: "毎月",
|
|
172
|
+
weekly: "毎週"
|
|
173
|
+
},
|
|
174
|
+
"pt-BR": {
|
|
175
|
+
customRange: "Selecione um intervalo personalizado",
|
|
176
|
+
daily: "Diário",
|
|
177
|
+
lastMonth: "Último mês",
|
|
178
|
+
lastSevenDays: "Últimos 7 dias",
|
|
179
|
+
monthly: "Mensal",
|
|
180
|
+
weekly: "Semanal"
|
|
181
|
+
}
|
|
182
|
+
}, la = { class: "b-date-range-picker-calendar" }, oa = { class: "b-date-range-picker-calendar__form" }, ia = { key: 0 }, ua = {
|
|
183
|
+
key: 0,
|
|
184
|
+
class: "b-date-range-picker-calendar__calendars-container",
|
|
185
|
+
"data-testid": "date-range-picker-calendar-calendar-container"
|
|
186
|
+
}, da = {
|
|
187
|
+
name: "date-range-picker-calendar",
|
|
188
|
+
i18n: { messages: ct }
|
|
189
|
+
}, ca = /* @__PURE__ */ lt({
|
|
190
|
+
...da,
|
|
191
|
+
props: {
|
|
192
|
+
/**
|
|
193
|
+
* Allows user to enter time values in the form
|
|
194
|
+
*/
|
|
195
|
+
allowTimeInput: { type: Boolean, default: !1 },
|
|
196
|
+
/**
|
|
197
|
+
* Ranges form persistance data
|
|
198
|
+
*/
|
|
199
|
+
dateFormData: {
|
|
200
|
+
type: Object,
|
|
201
|
+
default: () => ({ startDate: void 0, endDate: void 0, startTime: void 0, endTime: void 0 })
|
|
202
|
+
},
|
|
203
|
+
/**
|
|
204
|
+
* Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday
|
|
205
|
+
*/
|
|
206
|
+
firstDayOfWeek: K.props.firstDayOfWeek,
|
|
207
|
+
/**
|
|
208
|
+
* A list of available granularities.
|
|
209
|
+
* If present, the date picker will display a segmented control to change granularity.
|
|
210
|
+
*/
|
|
211
|
+
granularities: {
|
|
212
|
+
type: Array,
|
|
213
|
+
default: null
|
|
214
|
+
},
|
|
215
|
+
/**
|
|
216
|
+
* Indicate if a date should be disabled or not
|
|
217
|
+
*/
|
|
218
|
+
isDateDisabled: K.props.isDateDisabled,
|
|
219
|
+
/**
|
|
220
|
+
* Set a maximum number of dates to be selectable by the range.
|
|
221
|
+
*/
|
|
222
|
+
maxRange: K.props.maxRange,
|
|
223
|
+
/**
|
|
224
|
+
* Sets a minimum limit for selectable dates - dates before `min` will not be selectable
|
|
225
|
+
*/
|
|
226
|
+
min: K.props.min,
|
|
227
|
+
/**
|
|
228
|
+
* Sets a maximum limit for selectable dates - dates after `max` will not be selectable
|
|
229
|
+
*/
|
|
230
|
+
max: K.props.max,
|
|
231
|
+
/**
|
|
232
|
+
* Number of months rendered on pane
|
|
233
|
+
*/
|
|
234
|
+
numberOfMonths: {
|
|
235
|
+
type: K.props.numberOfMonths.type,
|
|
236
|
+
default: K.props.numberOfMonths.default,
|
|
237
|
+
validator: (a) => a >= 0
|
|
238
|
+
},
|
|
239
|
+
/**
|
|
240
|
+
* Displays the end date's month when the calendar is opened. Defaults to false i.e. the start date's month is displayed.
|
|
241
|
+
*/
|
|
242
|
+
showEndDateOnOpen: { type: Boolean, default: !1 },
|
|
243
|
+
/**
|
|
244
|
+
* Enables the custom range selector.
|
|
245
|
+
* If provided, must be an array that sets the custom range dropdown items. Items are of the structure:
|
|
246
|
+
* `label` - label of custom range item.
|
|
247
|
+
* `value` - a unique key of the custom range item.
|
|
248
|
+
* `data` - an object `{ startDate: Date; endDate: Date }` to set the date picker range to upon selecting.
|
|
249
|
+
*/
|
|
250
|
+
quickSelectRanges: {
|
|
251
|
+
type: Array,
|
|
252
|
+
default: void 0
|
|
253
|
+
},
|
|
254
|
+
/**
|
|
255
|
+
* Selected date
|
|
256
|
+
*/
|
|
257
|
+
value: { type: Object, default: void 0 },
|
|
258
|
+
/**
|
|
259
|
+
* The type of calendar to display. Defaults to showing days.
|
|
260
|
+
*/
|
|
261
|
+
variant: K.props.variant
|
|
262
|
+
},
|
|
263
|
+
emits: [
|
|
264
|
+
g.CUSTOM_RANGE,
|
|
265
|
+
g.INPUT,
|
|
266
|
+
g.ERROR,
|
|
267
|
+
g.FORM_DATE,
|
|
268
|
+
g.START_DATE_SELECTED
|
|
269
|
+
],
|
|
270
|
+
setup(a, { emit: o }) {
|
|
271
|
+
var $e, Ye, Le, je;
|
|
272
|
+
const s = "customRange", e = a, d = o, f = St(), y = Gt(f), { locale: X, t: C } = Ne({ messages: ct }), k = Ae(), S = U({}), De = b(() => e.variant === "month" ? "monthly" : "daily"), fe = b(() => e.numberOfMonths === 0), n = ke({
|
|
273
|
+
startDate: ($e = e.value) == null ? void 0 : $e.startDate,
|
|
274
|
+
endDate: (Ye = e.value) == null ? void 0 : Ye.endDate,
|
|
275
|
+
range: (Le = e.value) == null ? void 0 : Le.range,
|
|
276
|
+
...e.granularities ? {
|
|
277
|
+
granularity: ((je = e.value) == null ? void 0 : je.granularity) || De.value
|
|
278
|
+
} : {}
|
|
279
|
+
});
|
|
280
|
+
function R(t) {
|
|
281
|
+
return t ? new Date(
|
|
282
|
+
t.getUTCFullYear(),
|
|
283
|
+
t.getUTCMonth(),
|
|
284
|
+
t.getUTCDate(),
|
|
285
|
+
t.getUTCHours(),
|
|
286
|
+
t.getUTCMinutes(),
|
|
287
|
+
t.getUTCSeconds()
|
|
288
|
+
) : null;
|
|
289
|
+
}
|
|
290
|
+
const v = b(() => {
|
|
291
|
+
var t, r;
|
|
292
|
+
return (
|
|
293
|
+
// eslint-disable-next-line consistent-return
|
|
294
|
+
((r = (t = e == null ? void 0 : e.quickSelectRanges) == null ? void 0 : t.find(({ value: m, data: c }) => {
|
|
295
|
+
var I;
|
|
296
|
+
if (!c.endDate) {
|
|
297
|
+
if (c.isRelativeToNow) {
|
|
298
|
+
const w = (I = S.value) == null ? void 0 : I[m];
|
|
299
|
+
return w ? Se(
|
|
300
|
+
R(w.startDate),
|
|
301
|
+
R(n.startDate)
|
|
302
|
+
) && Se(
|
|
303
|
+
R(w.endDate),
|
|
304
|
+
R(n.endDate)
|
|
305
|
+
) : (
|
|
306
|
+
// If not stored calculated dates, fall back to comparing the quick select item's value
|
|
307
|
+
// with the internal range's stored range identifier.
|
|
308
|
+
m === n.range
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
return Se(R(c.startDate), R(n.startDate)) && Se(
|
|
312
|
+
R(n.endDate),
|
|
313
|
+
R(L(n.endDate))
|
|
314
|
+
) && sa(R(n.endDate)) && (e.granularities ? c.granularity === n.granularity : !0);
|
|
315
|
+
}
|
|
316
|
+
if (e.allowTimeInput)
|
|
317
|
+
return at(R(c.startDate), R(n.startDate)) && at(R(c.endDate), R(n.endDate)) && (e.granularities ? c.granularity === n.granularity : !0);
|
|
318
|
+
if (c.endDate)
|
|
319
|
+
return x(c.startDate, n.startDate) && x(c.endDate, n.endDate) && (e.granularities ? c.granularity === n.granularity : !0);
|
|
320
|
+
})) == null ? void 0 : r.value) ?? s
|
|
321
|
+
);
|
|
322
|
+
}), Z = b(() => ({
|
|
323
|
+
"b-date-range-picker-calendar__form-input-wrapper": e.allowTimeInput
|
|
324
|
+
})), h = b(() => [
|
|
325
|
+
{ label: C("customRange"), value: s },
|
|
326
|
+
...e.quickSelectRanges ? e.quickSelectRanges : []
|
|
327
|
+
]), j = b(
|
|
328
|
+
() => {
|
|
329
|
+
var t;
|
|
330
|
+
return ((t = e.granularities) == null ? void 0 : t.find(({ type: r }) => r === n.granularity)) || null;
|
|
331
|
+
}
|
|
332
|
+
), ne = b(
|
|
333
|
+
() => {
|
|
334
|
+
var t;
|
|
335
|
+
return ((t = e.granularities) == null ? void 0 : t.map(({ type: r, disabled: m }) => ({
|
|
336
|
+
label: C(r),
|
|
337
|
+
value: r,
|
|
338
|
+
disabled: m
|
|
339
|
+
}))) ?? [];
|
|
340
|
+
}
|
|
341
|
+
), { getGranularCalendarLimits: de } = zt(e), T = b(
|
|
342
|
+
() => e.granularities ? de(j.value) : { min: e.min ? N(e.min) : null, max: e.max ? L(e.max) : null }
|
|
343
|
+
), {
|
|
344
|
+
adjustDateForQuarterly: ce,
|
|
345
|
+
adjustDateForMonthly: q,
|
|
346
|
+
adjustDateForWeekly: $,
|
|
347
|
+
adjustStartDateInputForWeekly: B,
|
|
348
|
+
adjustEndDateInputForWeekly: E,
|
|
349
|
+
adjustStartDateInputForMonthly: Oe,
|
|
350
|
+
adjustEndDateInputForMonthly: re,
|
|
351
|
+
adjustStartDateInputForQuarterly: we,
|
|
352
|
+
adjustEndDateInputForQuarterly: ye
|
|
353
|
+
} = Bt(e.firstDayOfWeek), { savedRanges: H, saveRange: ee, resetSavedRanges: se } = Jt(), O = (t) => {
|
|
354
|
+
var r;
|
|
355
|
+
return t ? me(t, M.NUMERIC_DATE_YEAR_FIRST, {
|
|
356
|
+
locale: k[(r = X.value) == null ? void 0 : r.substring(0, 2)] || k.enUS
|
|
357
|
+
}) : "";
|
|
358
|
+
}, te = (t) => {
|
|
359
|
+
var r;
|
|
360
|
+
return t ? me(t, M.HOUR_MINUTE_SECONDS, {
|
|
361
|
+
locale: k[(r = X.value) == null ? void 0 : r.substring(0, 2)] || k.enUS
|
|
362
|
+
}) : "";
|
|
363
|
+
}, le = U(!1), oe = U(!1), Q = U(!1), G = U(!1), i = ke({
|
|
364
|
+
startDate: e.dateFormData.startDate,
|
|
365
|
+
endDate: e.dateFormData.endDate,
|
|
366
|
+
startTime: e.dateFormData.startTime,
|
|
367
|
+
endTime: e.dateFormData.endTime
|
|
368
|
+
}), Te = (t, r) => {
|
|
369
|
+
let m = new Date(t);
|
|
370
|
+
const [c, I, w] = r.split(":");
|
|
371
|
+
return m = aa(m, parseInt(c, 10)), m = na(m, parseInt(I, 10)), m = ra(m, parseInt(w, 10)), m;
|
|
372
|
+
}, ge = (t) => /^(?:[01]\d|2[01234]):(?:[012345]\d):(?:[012345]\d)$/.test(t), l = (t, r) => {
|
|
373
|
+
const m = () => {
|
|
374
|
+
if (r && _(r)) {
|
|
375
|
+
const c = Te(new Date(r), t);
|
|
376
|
+
if (e.min && c < nt(e.min, 0) || e.max && c > nt(e.max, 0))
|
|
377
|
+
return !1;
|
|
378
|
+
}
|
|
379
|
+
return !0;
|
|
380
|
+
};
|
|
381
|
+
return ge(t) && m();
|
|
382
|
+
}, p = (t, r) => !r || !ge(r) || e.variant === "month" ? t : Te(new Date(t), r), Y = (t) => {
|
|
383
|
+
i.startTime = te(
|
|
384
|
+
e.min && e.allowTimeInput && x(e.min, t.startDate) ? e.min : N(t.startDate)
|
|
385
|
+
), i.endTime = te(
|
|
386
|
+
e.max && e.allowTimeInput && x(e.max, t.endDate) ? e.max : L(t.endDate)
|
|
387
|
+
), n.startDate = p(t.startDate, i.startTime), n.endDate = p(t.endDate, i.endTime), n.range = null, e.granularities && se(), d(g.INPUT, {
|
|
388
|
+
...n,
|
|
389
|
+
range: v.value
|
|
390
|
+
});
|
|
391
|
+
}, _ = (t) => {
|
|
392
|
+
const r = (c) => e.min && N(c) < N(e.min) || e.max && N(c) > N(e.max) ? !1 : e.isDateDisabled ? !e.isDateDisabled(N(c)) : !0;
|
|
393
|
+
return /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/.test(t) && r(new Date(t));
|
|
394
|
+
};
|
|
395
|
+
ot(() => {
|
|
396
|
+
le.value = !!(e.dateFormData.startDate && !_(e.dateFormData.startDate)), e.allowTimeInput ? Q.value = !!(e.dateFormData.startTime && !l(e.dateFormData.startTime, e.dateFormData.startDate)) : Q.value = !1, oe.value = !!(e.dateFormData.endDate && !_(e.dateFormData.endDate)), e.allowTimeInput ? G.value = !!(e.dateFormData.endTime && !l(e.dateFormData.endTime, e.dateFormData.endDate)) : G.value = !1;
|
|
397
|
+
});
|
|
398
|
+
const W = (t) => {
|
|
399
|
+
var r;
|
|
400
|
+
i.startDate = O(t), i.startTime ? Q.value && (i.startTime = (r = e.dateFormData) == null ? void 0 : r.startTime) : i.startTime = te(t), le.value = !1, Q.value = !1, d(g.START_DATE_SELECTED, t);
|
|
401
|
+
}, be = (t) => {
|
|
402
|
+
var r;
|
|
403
|
+
i.endDate = O(t), i.endTime ? G.value && (i.endTime = (r = e.dateFormData) == null ? void 0 : r.endTime) : i.endTime = te(L(t)), oe.value = !1, G.value = !1;
|
|
404
|
+
}, Fe = (t) => {
|
|
405
|
+
const r = e.value[t];
|
|
406
|
+
if (r)
|
|
407
|
+
return r;
|
|
408
|
+
if (e.dateFormData[t] && _(e.dateFormData[t]))
|
|
409
|
+
return new Date(e.dateFormData[t]);
|
|
410
|
+
}, mt = Ie((t) => {
|
|
411
|
+
var r;
|
|
412
|
+
if (_(t)) {
|
|
413
|
+
let m = t;
|
|
414
|
+
switch (le.value = !1, (r = j.value) == null ? void 0 : r.type) {
|
|
415
|
+
case "weekly":
|
|
416
|
+
m = B(
|
|
417
|
+
t,
|
|
418
|
+
O,
|
|
419
|
+
T.value.min,
|
|
420
|
+
T.value.max
|
|
421
|
+
), i.startDate = m;
|
|
422
|
+
break;
|
|
423
|
+
case "monthly":
|
|
424
|
+
m = Oe(
|
|
425
|
+
t,
|
|
426
|
+
O,
|
|
427
|
+
T.value.min,
|
|
428
|
+
T.value.max
|
|
429
|
+
), i.startDate = m;
|
|
430
|
+
break;
|
|
431
|
+
case "quarterly":
|
|
432
|
+
m = we(
|
|
433
|
+
t,
|
|
434
|
+
O,
|
|
435
|
+
T.value.min,
|
|
436
|
+
T.value.max
|
|
437
|
+
), i.startDate = m;
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
const c = ue(m);
|
|
441
|
+
n.startDate = p(c, i.startTime), n.endDate = p(
|
|
442
|
+
ue(i.endDate),
|
|
443
|
+
i.endTime
|
|
444
|
+
), _(i.endDate) && (n.endDate = p(
|
|
445
|
+
ue(i.endDate),
|
|
446
|
+
i.endTime
|
|
447
|
+
));
|
|
448
|
+
const I = Fe("endDate");
|
|
449
|
+
n.range = null, d(g.FORM_DATE, {
|
|
450
|
+
startDate: c,
|
|
451
|
+
endDate: I
|
|
452
|
+
}), d(g.INPUT, {
|
|
453
|
+
...n,
|
|
454
|
+
range: v.value
|
|
455
|
+
});
|
|
456
|
+
} else
|
|
457
|
+
le.value = !0, d(g.ERROR, { ...i });
|
|
458
|
+
}, 300), Dt = (t) => {
|
|
459
|
+
i.startDate = Xe(t), mt(i.startDate);
|
|
460
|
+
}, ft = Ie((t) => {
|
|
461
|
+
var r;
|
|
462
|
+
if (_(t)) {
|
|
463
|
+
let m = t;
|
|
464
|
+
switch (oe.value = !1, (r = j.value) == null ? void 0 : r.type) {
|
|
465
|
+
case "weekly":
|
|
466
|
+
m = E(
|
|
467
|
+
t,
|
|
468
|
+
O,
|
|
469
|
+
T.value.min,
|
|
470
|
+
T.value.max
|
|
471
|
+
), i.endDate = m;
|
|
472
|
+
break;
|
|
473
|
+
case "monthly":
|
|
474
|
+
m = re(
|
|
475
|
+
t,
|
|
476
|
+
O,
|
|
477
|
+
T.value.min,
|
|
478
|
+
T.value.max
|
|
479
|
+
), i.endDate = m;
|
|
480
|
+
break;
|
|
481
|
+
case "quarterly":
|
|
482
|
+
m = ye(
|
|
483
|
+
t,
|
|
484
|
+
O,
|
|
485
|
+
T.value.min,
|
|
486
|
+
T.value.max
|
|
487
|
+
), i.endDate = m;
|
|
488
|
+
break;
|
|
489
|
+
}
|
|
490
|
+
const c = ue(m);
|
|
491
|
+
n.endDate = p(c, i.endTime), _(i.startDate) && (n.startDate = p(
|
|
492
|
+
ue(i.startDate),
|
|
493
|
+
i.startTime
|
|
494
|
+
));
|
|
495
|
+
const I = Fe("startDate");
|
|
496
|
+
n.range = null, d(g.FORM_DATE, {
|
|
497
|
+
startDate: I,
|
|
498
|
+
endDate: c
|
|
499
|
+
}), d(g.INPUT, {
|
|
500
|
+
...n,
|
|
501
|
+
range: v.value
|
|
502
|
+
});
|
|
503
|
+
} else
|
|
504
|
+
oe.value = !0, d(g.ERROR, { ...i });
|
|
505
|
+
}, 300), vt = (t) => {
|
|
506
|
+
i.endDate = Xe(t), ft(i.endDate);
|
|
507
|
+
}, xe = (t) => {
|
|
508
|
+
xt(t);
|
|
509
|
+
}, pt = Ie((t) => {
|
|
510
|
+
if (l(t, e.dateFormData.startDate)) {
|
|
511
|
+
Q.value = !1, n.startDate = p(n.startDate, t);
|
|
512
|
+
const r = Fe("endDate");
|
|
513
|
+
d(g.FORM_DATE, {
|
|
514
|
+
startDate: n.startDate,
|
|
515
|
+
endDate: r,
|
|
516
|
+
startTime: t,
|
|
517
|
+
endTime: i.endTime ?? e.dateFormData.endTime
|
|
518
|
+
}), d(g.INPUT, {
|
|
519
|
+
...n,
|
|
520
|
+
range: v.value
|
|
521
|
+
});
|
|
522
|
+
} else
|
|
523
|
+
Q.value = !0, d(g.ERROR, { ...i });
|
|
524
|
+
}), yt = Ie((t) => {
|
|
525
|
+
l(t, e.dateFormData.endDate) ? (G.value = !1, n.endDate = p(n.endDate, t), d(g.FORM_DATE, {
|
|
526
|
+
startDate: n.startDate,
|
|
527
|
+
endDate: n.endDate,
|
|
528
|
+
startTime: i.startTime ?? e.dateFormData.startTime,
|
|
529
|
+
endTime: t
|
|
530
|
+
}), d(g.INPUT, {
|
|
531
|
+
...n,
|
|
532
|
+
range: v.value
|
|
533
|
+
})) : (G.value = !0, d(g.ERROR, { ...i }));
|
|
534
|
+
}), Tt = (t) => {
|
|
535
|
+
i.startTime = et(t), pt(i.startTime);
|
|
536
|
+
}, gt = (t) => {
|
|
537
|
+
i.endTime = et(t), yt(i.endTime);
|
|
538
|
+
}, qe = (t) => {
|
|
539
|
+
ta(t);
|
|
540
|
+
}, Re = (t, r, m, c) => {
|
|
541
|
+
n.startDate = t, n.endDate = r, m && (n.granularity = m), c && (n.range = c);
|
|
542
|
+
}, bt = (t) => {
|
|
543
|
+
var m;
|
|
544
|
+
const r = (m = e.quickSelectRanges) == null ? void 0 : m.find(({ value: c }) => c === t);
|
|
545
|
+
if (r) {
|
|
546
|
+
se();
|
|
547
|
+
const c = r.data, I = c.endDate || (c.isRelativeToNow ? new Date(Date.now()) : L(new Date(Date.now()))), w = c.isRelativeToNow && c.timeDifference ? new Date(I.getTime() - c.timeDifference) : c.startDate;
|
|
548
|
+
i.endDate = O(I), i.startDate = O(w), Re(w, I, null, t), e.granularities && (n.granularity = c.granularity || De.value), i.startTime = te(w), i.endTime = te(I), n.startDate = w, n.endDate = I, c.isRelativeToNow && (S.value = {
|
|
549
|
+
...S.value,
|
|
550
|
+
[t]: {
|
|
551
|
+
startDate: w,
|
|
552
|
+
endDate: I
|
|
553
|
+
}
|
|
554
|
+
}), d(g.CUSTOM_RANGE, {
|
|
555
|
+
...r.data,
|
|
556
|
+
startDate: w,
|
|
557
|
+
endDate: I,
|
|
558
|
+
range: r.value
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
}, Rt = {
|
|
562
|
+
weekly: $,
|
|
563
|
+
monthly: q,
|
|
564
|
+
quarterly: ce
|
|
565
|
+
}, Et = (t) => {
|
|
566
|
+
const r = n.granularity;
|
|
567
|
+
if (n.granularity = t, r && ee(r, structuredClone(Ce(n))), n.startDate && n.endDate) {
|
|
568
|
+
switch (t) {
|
|
569
|
+
case "quarterly":
|
|
570
|
+
case "monthly":
|
|
571
|
+
case "weekly": {
|
|
572
|
+
if (H[t]) {
|
|
573
|
+
Re(H[t].startDate, H[t].endDate, t);
|
|
574
|
+
break;
|
|
575
|
+
}
|
|
576
|
+
const { startDate: m, endDate: c } = Rt[t](
|
|
577
|
+
n.startDate,
|
|
578
|
+
n.endDate,
|
|
579
|
+
T.value.min,
|
|
580
|
+
T.value.max
|
|
581
|
+
);
|
|
582
|
+
Re(m, c, t);
|
|
583
|
+
break;
|
|
584
|
+
}
|
|
585
|
+
case "daily":
|
|
586
|
+
H.daily && Re(H.daily.startDate, H.daily.endDate, t);
|
|
587
|
+
break;
|
|
588
|
+
}
|
|
589
|
+
i.startDate = O(n.startDate), i.endDate = O(n.endDate), d(g.INPUT, {
|
|
590
|
+
...n,
|
|
591
|
+
range: v.value
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
}, It = b(() => ({
|
|
595
|
+
"b-date-range-picker-calendar__form-container--no-calendars": fe.value
|
|
596
|
+
}));
|
|
597
|
+
return (t, r) => (F(), he("div", la, [
|
|
598
|
+
ae("div", {
|
|
599
|
+
class: _e(["b-date-range-picker-calendar__form-container", It.value]),
|
|
600
|
+
"data-testid": "date-range-picker-calendar-form-container"
|
|
601
|
+
}, [
|
|
602
|
+
ae("div", oa, [
|
|
603
|
+
D(y)("title") ? He(t.$slots, "title", { key: 0 }, void 0, !0) : A("", !0),
|
|
604
|
+
a.quickSelectRanges ? (F(), V(Ht, {
|
|
605
|
+
key: 1,
|
|
606
|
+
"aria-label": D(C)("customRange"),
|
|
607
|
+
items: h.value,
|
|
608
|
+
"model-value": v.value,
|
|
609
|
+
"onUpdate:modelValue": bt
|
|
610
|
+
}, null, 8, ["aria-label", "items", "model-value"])) : A("", !0),
|
|
611
|
+
a.granularities ? (F(), V(D(Qt), {
|
|
612
|
+
key: 2,
|
|
613
|
+
items: ne.value,
|
|
614
|
+
"model-value": n.granularity,
|
|
615
|
+
"full-width": "",
|
|
616
|
+
"onUpdate:modelValue": Et
|
|
617
|
+
}, null, 8, ["items", "model-value"])) : A("", !0),
|
|
618
|
+
ae("div", null, [
|
|
619
|
+
z(D(Ue), {
|
|
620
|
+
stronger: "",
|
|
621
|
+
el: "span",
|
|
622
|
+
class: "b-date-range-picker-calendar__label"
|
|
623
|
+
}, {
|
|
624
|
+
default: P(() => r[0] || (r[0] = [
|
|
625
|
+
ie(" From ")
|
|
626
|
+
])),
|
|
627
|
+
_: 1
|
|
628
|
+
}),
|
|
629
|
+
ae("div", {
|
|
630
|
+
class: _e(Z.value)
|
|
631
|
+
}, [
|
|
632
|
+
z(D(Ee), {
|
|
633
|
+
"aria-label": D(C)("dateFrom"),
|
|
634
|
+
"model-value": i.startDate,
|
|
635
|
+
error: le.value,
|
|
636
|
+
class: "b-date-range-picker-calendar__form-input",
|
|
637
|
+
"onUpdate:modelValue": Dt,
|
|
638
|
+
onKeydown: xe
|
|
639
|
+
}, {
|
|
640
|
+
description: P(() => r[1] || (r[1] = [
|
|
641
|
+
ie("YYYY-MM-DD")
|
|
642
|
+
])),
|
|
643
|
+
_: 1
|
|
644
|
+
}, 8, ["aria-label", "model-value", "error"]),
|
|
645
|
+
a.allowTimeInput ? (F(), V(D(Ee), {
|
|
646
|
+
key: 0,
|
|
647
|
+
"aria-label": D(C)("timeFrom"),
|
|
648
|
+
"model-value": i.startTime,
|
|
649
|
+
error: Q.value,
|
|
650
|
+
class: "b-date-range-picker-calendar__form-input",
|
|
651
|
+
"onUpdate:modelValue": Tt,
|
|
652
|
+
onKeydown: qe
|
|
653
|
+
}, {
|
|
654
|
+
description: P(() => r[2] || (r[2] = [
|
|
655
|
+
ie("HH:MM:SS")
|
|
656
|
+
])),
|
|
657
|
+
_: 1
|
|
658
|
+
}, 8, ["aria-label", "model-value", "error"])) : A("", !0)
|
|
659
|
+
], 2)
|
|
660
|
+
]),
|
|
661
|
+
ae("div", null, [
|
|
662
|
+
z(D(Ue), {
|
|
663
|
+
stronger: "",
|
|
664
|
+
el: "span",
|
|
665
|
+
class: "b-date-range-picker-calendar__label"
|
|
666
|
+
}, {
|
|
667
|
+
default: P(() => r[3] || (r[3] = [
|
|
668
|
+
ie(" To ")
|
|
669
|
+
])),
|
|
670
|
+
_: 1
|
|
671
|
+
}),
|
|
672
|
+
ae("div", {
|
|
673
|
+
class: _e(Z.value)
|
|
674
|
+
}, [
|
|
675
|
+
z(D(Ee), {
|
|
676
|
+
class: "b-date-range-picker-calendar__form-input",
|
|
677
|
+
"aria-label": D(C)("dateTo"),
|
|
678
|
+
"model-value": i.endDate,
|
|
679
|
+
error: oe.value,
|
|
680
|
+
"onUpdate:modelValue": vt,
|
|
681
|
+
onKeydown: xe
|
|
682
|
+
}, {
|
|
683
|
+
description: P(() => r[4] || (r[4] = [
|
|
684
|
+
ie("YYYY-MM-DD")
|
|
685
|
+
])),
|
|
686
|
+
_: 1
|
|
687
|
+
}, 8, ["aria-label", "model-value", "error"]),
|
|
688
|
+
a.allowTimeInput ? (F(), V(D(Ee), {
|
|
689
|
+
key: 0,
|
|
690
|
+
"aria-label": D(C)("timeTo"),
|
|
691
|
+
"model-value": i.endTime,
|
|
692
|
+
error: G.value,
|
|
693
|
+
class: "b-date-range-picker-calendar__form-input",
|
|
694
|
+
"onUpdate:modelValue": gt,
|
|
695
|
+
onKeydown: qe
|
|
696
|
+
}, {
|
|
697
|
+
description: P(() => r[5] || (r[5] = [
|
|
698
|
+
ie("HH:MM:SS")
|
|
699
|
+
])),
|
|
700
|
+
_: 1
|
|
701
|
+
}, 8, ["aria-label", "model-value", "error"])) : A("", !0)
|
|
702
|
+
], 2)
|
|
703
|
+
])
|
|
704
|
+
]),
|
|
705
|
+
D(y)("actions") ? (F(), he("div", ia, [
|
|
706
|
+
He(t.$slots, "actions", {}, void 0, !0)
|
|
707
|
+
])) : A("", !0)
|
|
708
|
+
], 2),
|
|
709
|
+
fe.value ? A("", !0) : (F(), he("div", ua, [
|
|
710
|
+
z(D(K), {
|
|
711
|
+
value: n,
|
|
712
|
+
"first-day-of-week": a.firstDayOfWeek,
|
|
713
|
+
"is-date-disabled": a.isDateDisabled,
|
|
714
|
+
"max-range": a.maxRange,
|
|
715
|
+
min: T.value.min,
|
|
716
|
+
max: T.value.max,
|
|
717
|
+
"number-of-months": a.numberOfMonths,
|
|
718
|
+
"show-end-date-on-open": a.showEndDateOnOpen,
|
|
719
|
+
granularity: j.value,
|
|
720
|
+
variant: a.variant,
|
|
721
|
+
"is-range": "",
|
|
722
|
+
onInput: Y,
|
|
723
|
+
onStartDateSelected: W,
|
|
724
|
+
onEndDateSelected: be
|
|
725
|
+
}, null, 8, ["value", "first-day-of-week", "is-date-disabled", "max-range", "min", "max", "number-of-months", "show-end-date-on-open", "granularity", "variant"])
|
|
726
|
+
]))
|
|
727
|
+
]));
|
|
728
|
+
}
|
|
729
|
+
}), ma = /* @__PURE__ */ ut(ca, [["__scopeId", "data-v-b8e14e1c"]]);
|
|
730
|
+
function rt(a, o) {
|
|
731
|
+
const u = J(a, o == null ? void 0 : o.in);
|
|
732
|
+
return Math.trunc(u.getMonth() / 3) + 1;
|
|
733
|
+
}
|
|
734
|
+
function st(a, o) {
|
|
735
|
+
return J(a, o == null ? void 0 : o.in).getFullYear();
|
|
736
|
+
}
|
|
737
|
+
function Da(a, o, u) {
|
|
738
|
+
const [s, e] = $t(
|
|
739
|
+
u == null ? void 0 : u.in,
|
|
740
|
+
a,
|
|
741
|
+
o
|
|
742
|
+
);
|
|
743
|
+
return +pe(s) == +pe(e);
|
|
744
|
+
}
|
|
745
|
+
const Be = {
|
|
746
|
+
"en-US": {
|
|
747
|
+
apply: "Apply",
|
|
748
|
+
cancel: "Cancel",
|
|
749
|
+
dateRangePicker: "Date range picker {name}",
|
|
750
|
+
provideDateInAFormat: "Provide date in a YYYY-MM-DD format",
|
|
751
|
+
quarter: "Q{quarter} {year}",
|
|
752
|
+
selectDate: "Select a date",
|
|
753
|
+
selectDateRange: "Select a date range",
|
|
754
|
+
selectedDateIsNotAvailable: "Selected date is not available"
|
|
755
|
+
},
|
|
756
|
+
"ja-JP": {
|
|
757
|
+
apply: "適用",
|
|
758
|
+
cancel: "キャンセル",
|
|
759
|
+
selectDate: "日付を選択"
|
|
760
|
+
},
|
|
761
|
+
"pt-BR": {
|
|
762
|
+
apply: "Aplicar",
|
|
763
|
+
cancel: "Cancelar",
|
|
764
|
+
selectDate: "Selecione uma data"
|
|
765
|
+
}
|
|
766
|
+
}, fa = ({
|
|
767
|
+
datePickerValue: a,
|
|
768
|
+
isDateIncorrect: o,
|
|
769
|
+
quickSelectRanges: u,
|
|
770
|
+
isMonthVariant: s,
|
|
771
|
+
withTimeInput: e,
|
|
772
|
+
placeholder: d
|
|
773
|
+
}) => {
|
|
774
|
+
const { locale: f, t: y } = Ne({ messages: Be }), X = Ae(), C = (n) => !!n && !isNaN(n.getTime()), k = (n, R) => {
|
|
775
|
+
var v;
|
|
776
|
+
return C(n) ? me(n, R, {
|
|
777
|
+
locale: X[(v = f.value) == null ? void 0 : v.substring(0, 2)] || X.enUS
|
|
778
|
+
}) : void 0;
|
|
779
|
+
}, S = ke({
|
|
780
|
+
startDate: null,
|
|
781
|
+
endDate: null,
|
|
782
|
+
startTime: null,
|
|
783
|
+
endTime: null
|
|
784
|
+
});
|
|
785
|
+
return Me(
|
|
786
|
+
a,
|
|
787
|
+
(n) => {
|
|
788
|
+
S.startDate = k(
|
|
789
|
+
n == null ? void 0 : n.startDate,
|
|
790
|
+
M.NUMERIC_DATE_YEAR_FIRST
|
|
791
|
+
), S.endDate = k(n == null ? void 0 : n.endDate, M.NUMERIC_DATE_YEAR_FIRST), S.startTime = k(n == null ? void 0 : n.startDate, M.HOUR_MINUTE_SECONDS), S.endTime = k(n == null ? void 0 : n.endDate, M.HOUR_MINUTE_SECONDS);
|
|
792
|
+
},
|
|
793
|
+
{ immediate: !0 }
|
|
794
|
+
), {
|
|
795
|
+
// Values
|
|
796
|
+
dateDisplayValue: b(() => {
|
|
797
|
+
var ce;
|
|
798
|
+
if (o.value)
|
|
799
|
+
return `${S.startDate || ""} - ${S.endDate || ""}`;
|
|
800
|
+
if (!a.value || !a.value.startDate && !a.value.endDate)
|
|
801
|
+
return (d == null ? void 0 : d.value) || y("selectDateRange");
|
|
802
|
+
if ((ce = u.value) != null && ce.length) {
|
|
803
|
+
const q = u.value.find(({ value: $ }) => {
|
|
804
|
+
var B;
|
|
805
|
+
return $ === ((B = a.value) == null ? void 0 : B.range);
|
|
806
|
+
});
|
|
807
|
+
if (q)
|
|
808
|
+
return q.label;
|
|
809
|
+
}
|
|
810
|
+
if (a.value.granularity === "quarterly") {
|
|
811
|
+
const { startDate: q, endDate: $ } = a.value, B = y("quarter", { quarter: rt(q), year: st(q) });
|
|
812
|
+
if (Da(q, $))
|
|
813
|
+
return B;
|
|
814
|
+
const E = y("quarter", { quarter: rt($), year: st($) });
|
|
815
|
+
return `${B} - ${E}`;
|
|
816
|
+
}
|
|
817
|
+
const { startDate: n, endDate: R, startTime: v, endTime: Z } = S, h = s != null && s.value ? M.LONG_MONTH_YEAR : M.FULL_DATE_MONTH_FIRST, j = k(ue(n), h), ne = k(ue(R), h);
|
|
818
|
+
if (!e.value)
|
|
819
|
+
return `${j} - ${ne}`;
|
|
820
|
+
const de = [j, v].filter(Boolean).join(", "), T = [ne, Z].filter(Boolean).join(", ");
|
|
821
|
+
return `${de} - ${T}`;
|
|
822
|
+
}),
|
|
823
|
+
textInputDisplayValue: S,
|
|
824
|
+
// Methods
|
|
825
|
+
formatTextInputDisplayValue: () => ""
|
|
826
|
+
};
|
|
827
|
+
}, va = { class: "b-date-range-picker" }, pa = { class: "b-date-range-picker__footer" }, ya = {
|
|
828
|
+
i18n: { messages: Be },
|
|
829
|
+
name: "bento-date-range-picker",
|
|
830
|
+
model: { prop: "modelValue" }
|
|
831
|
+
}, Ta = /* @__PURE__ */ lt({
|
|
832
|
+
...ya,
|
|
833
|
+
props: {
|
|
834
|
+
allowTimeInput: { type: Boolean },
|
|
835
|
+
firstDayOfWeek: { default: 1 },
|
|
836
|
+
granularities: {},
|
|
837
|
+
isDateDisabled: { type: Function, default: void 0 },
|
|
838
|
+
showEndDateOnOpen: { type: Boolean, default: !1 },
|
|
839
|
+
quickSelectRanges: { default: void 0 },
|
|
840
|
+
maxRange: { default: null },
|
|
841
|
+
min: { default: null },
|
|
842
|
+
max: { default: null },
|
|
843
|
+
numberOfMonths: { default: void 0 },
|
|
844
|
+
modelValue: { default: null },
|
|
845
|
+
value: { default: null },
|
|
846
|
+
variant: { default: void 0 },
|
|
847
|
+
hasActions: { type: Boolean, default: !1 },
|
|
848
|
+
description: { default: void 0 },
|
|
849
|
+
disabled: { type: Boolean, default: !1 },
|
|
850
|
+
errorMessage: { default: null },
|
|
851
|
+
label: { default: void 0 },
|
|
852
|
+
optional: { type: Boolean, default: !1 },
|
|
853
|
+
placeholder: { default: null },
|
|
854
|
+
readonly: { type: Boolean, default: !1 },
|
|
855
|
+
required: { type: Boolean, default: !1 },
|
|
856
|
+
tooltipText: { default: null }
|
|
857
|
+
},
|
|
858
|
+
emits: ["update:model-value", "input"],
|
|
859
|
+
setup(a, { emit: o }) {
|
|
860
|
+
const u = o, s = a, { locale: e, t: d } = Ne({ messages: Be }), f = Ae(), y = ve("bento-date-range-picker-container"), X = ve("bento-date-range-picker-label"), C = ve("bento-date-range-picker-description"), k = ve("bento-date-range-picker-error"), S = ve("bento-date-range-picker-date-error"), De = b(() => s.label || d("dateRangePicker", { name: y })), fe = kt({
|
|
861
|
+
none: 0,
|
|
862
|
+
one: 710,
|
|
863
|
+
// width of date range picker with one panes
|
|
864
|
+
two: 1030,
|
|
865
|
+
// width of date range picker with two panes
|
|
866
|
+
three: 1290
|
|
867
|
+
// width of date range picker with three panes
|
|
868
|
+
}), n = b(() => {
|
|
869
|
+
const l = fe.active().value, p = {
|
|
870
|
+
none: 0,
|
|
871
|
+
one: 1,
|
|
872
|
+
two: 2
|
|
873
|
+
};
|
|
874
|
+
if (l in p) {
|
|
875
|
+
const Y = p[l];
|
|
876
|
+
return s.numberOfMonths === void 0 ? Y : Math.min(s.numberOfMonths, Y);
|
|
877
|
+
}
|
|
878
|
+
return s.numberOfMonths;
|
|
879
|
+
}), R = b(() => (s == null ? void 0 : s.quickSelectRanges) && s.quickSelectRanges.map((l) => {
|
|
880
|
+
const p = l.data.endDate ? void 0 : new Date(Date.now()).getTime() - l.data.startDate.getTime();
|
|
881
|
+
return {
|
|
882
|
+
...l,
|
|
883
|
+
data: {
|
|
884
|
+
...l.data,
|
|
885
|
+
// Adding timeDifference to calculate an up-to-date endDate on range selection
|
|
886
|
+
timeDifference: p
|
|
887
|
+
}
|
|
888
|
+
};
|
|
889
|
+
})), v = U(!1), Z = U(null), h = U(!1), { isReadOnly: j } = Yt(Qe(s, "readonly")), { emitValue: ne } = jt(u);
|
|
890
|
+
Me(
|
|
891
|
+
() => s.disabled,
|
|
892
|
+
() => {
|
|
893
|
+
s.disabled && h.value && (h.value = !1);
|
|
894
|
+
}
|
|
895
|
+
);
|
|
896
|
+
const de = b(() => s.modelValue || s.value), T = b(() => s.hasActions ? !se.value && v.value : v.value), ce = b(() => ({
|
|
897
|
+
"b-date-range-picker__description--error": !!s.errorMessage || T.value
|
|
898
|
+
})), q = b(() => s.variant === "month"), $ = b(() => s.allowTimeInput && s.variant !== "month"), { dateDisplayValue: B, textInputDisplayValue: E } = fa({
|
|
899
|
+
datePickerValue: de,
|
|
900
|
+
isDateIncorrect: v,
|
|
901
|
+
quickSelectRanges: R,
|
|
902
|
+
isMonthVariant: q,
|
|
903
|
+
withTimeInput: $,
|
|
904
|
+
placeholder: Qe(s, "placeholder")
|
|
905
|
+
}), Oe = b(
|
|
906
|
+
() => `${s.description ? C : ""} ${s.errorMessage ? k : ""} ${v.value ? S : ""}`.trim() || null
|
|
907
|
+
), re = () => {
|
|
908
|
+
h.value = !1;
|
|
909
|
+
}, we = () => {
|
|
910
|
+
h.value = !0;
|
|
911
|
+
}, ye = U(B.value), H = U(
|
|
912
|
+
// textInputDisplayValue is a reactive object
|
|
913
|
+
structuredClone(Ce(E))
|
|
914
|
+
), ee = U(s.modelValue ?? s.value), se = U(!0), O = b(
|
|
915
|
+
() => s.hasActions ? H.value : E
|
|
916
|
+
), te = b(
|
|
917
|
+
() => s.hasActions ? ye.value : B.value
|
|
918
|
+
);
|
|
919
|
+
ot(() => {
|
|
920
|
+
if (s.hasActions || We(
|
|
921
|
+
'BentoDateRangePicker "hasActions" property',
|
|
922
|
+
`Set the BentoDateRangePicker "hasActions" property true which will display the "Apply" and "Cancel" buttons.
|
|
923
|
+
This will be the default behavior in the v2 and "hasActions" will be removed.`,
|
|
924
|
+
"2.0.0"
|
|
925
|
+
), s.value && We(
|
|
926
|
+
'BentoDateRangePicker "value" property',
|
|
927
|
+
'The use of "value" prop in "BentoDateRangePicker" is no longer supported. Use the "v-model" or "model-value" property instead.',
|
|
928
|
+
"2.0.0"
|
|
929
|
+
), s.granularities && s.variant !== "month" && s.granularities.find(({ type: l }) => l === "quarterly"))
|
|
930
|
+
throw new Error('Quarterly granularity is only supported by BentoDateRangePicker with variant: "month"');
|
|
931
|
+
}), Me([() => s.value, () => s.modelValue], () => {
|
|
932
|
+
ye.value = B.value, H.value = structuredClone(Ce(E));
|
|
933
|
+
});
|
|
934
|
+
const le = b(() => [
|
|
935
|
+
{
|
|
936
|
+
title: d("apply"),
|
|
937
|
+
event: () => {
|
|
938
|
+
ne(ee.value), re(), se.value = !0;
|
|
939
|
+
},
|
|
940
|
+
disabled: se.value
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
title: d("cancel"),
|
|
944
|
+
event: re
|
|
945
|
+
}
|
|
946
|
+
]);
|
|
947
|
+
Me(ee, (l) => {
|
|
948
|
+
if (s.hasActions) {
|
|
949
|
+
se.value = v.value;
|
|
950
|
+
return;
|
|
951
|
+
}
|
|
952
|
+
ne(l);
|
|
953
|
+
});
|
|
954
|
+
const oe = (l) => {
|
|
955
|
+
v.value = !1;
|
|
956
|
+
const p = (Y, _) => {
|
|
957
|
+
var W;
|
|
958
|
+
return Y ? me(Y, _, {
|
|
959
|
+
locale: f[(W = e.value) == null ? void 0 : W.substring(0, 2)] || f.enUS
|
|
960
|
+
}) : void 0;
|
|
961
|
+
};
|
|
962
|
+
E.startDate = p(l.startDate, M.NUMERIC_DATE_YEAR_FIRST), E.endDate = p(l.endDate, M.NUMERIC_DATE_YEAR_FIRST), E.startTime = p(l.startDate, M.HOUR_MINUTE_SECONDS), E.endTime = p(l.endDate, M.HOUR_MINUTE_SECONDS), ee.value = l;
|
|
963
|
+
}, Q = async () => {
|
|
964
|
+
v.value && (v.value = !1), ee.value = null;
|
|
965
|
+
}, G = () => {
|
|
966
|
+
if (!h.value) {
|
|
967
|
+
h.value = !0;
|
|
968
|
+
return;
|
|
969
|
+
}
|
|
970
|
+
v.value || (h.value = !1);
|
|
971
|
+
}, i = (l) => {
|
|
972
|
+
v.value = !1, l.startTime && (E.startTime = l.startTime), l.endTime && (E.endTime = l.endTime);
|
|
973
|
+
}, Te = (l) => {
|
|
974
|
+
v.value = !0, E.startDate = l.startDate, E.endDate = l.endDate, ee.value = { startDate: null, endDate: null };
|
|
975
|
+
}, ge = (l) => {
|
|
976
|
+
if (l) {
|
|
977
|
+
const p = (_, W) => {
|
|
978
|
+
var be;
|
|
979
|
+
return _ ? me(_, W, {
|
|
980
|
+
locale: f[(be = e.value) == null ? void 0 : be.substring(0, 2)] || f.enUS
|
|
981
|
+
}) : void 0;
|
|
982
|
+
}, Y = (_) => {
|
|
983
|
+
var W;
|
|
984
|
+
return me(_, M.NUMERIC_DATE_YEAR_FIRST, {
|
|
985
|
+
locale: f[(W = e.value) == null ? void 0 : W.substring(0, 2)] || f.enUS
|
|
986
|
+
});
|
|
987
|
+
};
|
|
988
|
+
E.startDate = Y(l.startDate), E.endDate = Y(l.endDate), E.startTime = p(
|
|
989
|
+
l.startDate,
|
|
990
|
+
M.HOUR_MINUTE_SECONDS
|
|
991
|
+
), E.endTime = p(l.endDate, M.HOUR_MINUTE_SECONDS), ee.value = l;
|
|
992
|
+
}
|
|
993
|
+
};
|
|
994
|
+
return (l, p) => ht((F(), he("div", va, [
|
|
995
|
+
l.label ? (F(), V(D(Kt), {
|
|
996
|
+
key: 0,
|
|
997
|
+
id: D(X),
|
|
998
|
+
label: l.label,
|
|
999
|
+
"tooltip-text": l.tooltipText,
|
|
1000
|
+
optional: l.optional,
|
|
1001
|
+
required: l.required
|
|
1002
|
+
}, null, 8, ["id", "label", "tooltip-text", "optional", "required"])) : A("", !0),
|
|
1003
|
+
ae("div", {
|
|
1004
|
+
onKeydown: Ge(G, ["enter"])
|
|
1005
|
+
}, [
|
|
1006
|
+
z(D(Ct), {
|
|
1007
|
+
ref_key: "inputContainerRef",
|
|
1008
|
+
ref: Z,
|
|
1009
|
+
"always-combobox-is-input": "",
|
|
1010
|
+
ariaControls: D(y),
|
|
1011
|
+
ariaExpanded: h.value,
|
|
1012
|
+
"aria-labelledby": l.label ? D(X) : null,
|
|
1013
|
+
"aria-describedby": Oe.value,
|
|
1014
|
+
disabled: l.disabled,
|
|
1015
|
+
"is-invalid": !!l.errorMessage || T.value,
|
|
1016
|
+
open: h.value,
|
|
1017
|
+
"display-value": te.value,
|
|
1018
|
+
readonly: D(j),
|
|
1019
|
+
onOpen: we,
|
|
1020
|
+
onClear: Q,
|
|
1021
|
+
onClose: re
|
|
1022
|
+
}, null, 8, ["ariaControls", "ariaExpanded", "aria-labelledby", "aria-describedby", "disabled", "is-invalid", "open", "display-value", "readonly"])
|
|
1023
|
+
], 32),
|
|
1024
|
+
T.value ? (F(), V(D(Ze), {
|
|
1025
|
+
key: 1,
|
|
1026
|
+
id: D(S),
|
|
1027
|
+
"error-message": D(d)("provideDateInAFormat"),
|
|
1028
|
+
class: "b-date-range-picker__error-message"
|
|
1029
|
+
}, null, 8, ["id", "error-message"])) : A("", !0),
|
|
1030
|
+
l.errorMessage ? (F(), V(D(Ze), {
|
|
1031
|
+
key: 2,
|
|
1032
|
+
id: D(k),
|
|
1033
|
+
"error-message": l.errorMessage,
|
|
1034
|
+
class: "b-date-range-picker__error-message"
|
|
1035
|
+
}, null, 8, ["id", "error-message"])) : A("", !0),
|
|
1036
|
+
l.description ? (F(), V(D(Ue), {
|
|
1037
|
+
key: 3,
|
|
1038
|
+
id: D(C),
|
|
1039
|
+
class: _e(["b-date-range-picker__description", ce.value]),
|
|
1040
|
+
el: "span"
|
|
1041
|
+
}, {
|
|
1042
|
+
default: P(() => [
|
|
1043
|
+
ie(_t(l.description), 1)
|
|
1044
|
+
]),
|
|
1045
|
+
_: 1
|
|
1046
|
+
}, 8, ["id", "class"])) : A("", !0),
|
|
1047
|
+
Z.value ? (F(), V(D(wt), {
|
|
1048
|
+
key: 4,
|
|
1049
|
+
id: D(y),
|
|
1050
|
+
class: "b-date-range-picker__container",
|
|
1051
|
+
open: h.value,
|
|
1052
|
+
"target-element": Z.value,
|
|
1053
|
+
"aria-label": De.value,
|
|
1054
|
+
position: "bottom-start",
|
|
1055
|
+
"without-space": "",
|
|
1056
|
+
"fit-content": "",
|
|
1057
|
+
"trap-all": "",
|
|
1058
|
+
onKeydown: Ge(re, ["esc", "native"])
|
|
1059
|
+
}, {
|
|
1060
|
+
default: P(() => [
|
|
1061
|
+
z(D(ma), {
|
|
1062
|
+
"allow-time-input": $.value,
|
|
1063
|
+
"quick-select-ranges": R.value,
|
|
1064
|
+
value: de.value,
|
|
1065
|
+
"first-day-of-week": l.firstDayOfWeek,
|
|
1066
|
+
granularities: l.granularities,
|
|
1067
|
+
"is-date-disabled": l.isDateDisabled,
|
|
1068
|
+
"max-range": l.maxRange,
|
|
1069
|
+
min: l.min,
|
|
1070
|
+
max: l.max,
|
|
1071
|
+
"number-of-months": n.value,
|
|
1072
|
+
"show-end-date-on-open": l.showEndDateOnOpen,
|
|
1073
|
+
"date-form-data": O.value,
|
|
1074
|
+
variant: l.variant,
|
|
1075
|
+
onCustomRange: ge,
|
|
1076
|
+
onInput: oe,
|
|
1077
|
+
onError: Te,
|
|
1078
|
+
onFormDate: i
|
|
1079
|
+
}, Mt({ _: 2 }, [
|
|
1080
|
+
l.hasActions ? {
|
|
1081
|
+
name: "actions",
|
|
1082
|
+
fn: P(() => [
|
|
1083
|
+
z(D(Ot)),
|
|
1084
|
+
ae("div", pa, [
|
|
1085
|
+
z(D(Ft), {
|
|
1086
|
+
actions: le.value,
|
|
1087
|
+
layout: D(Pt).SPACE_BETWEEN
|
|
1088
|
+
}, null, 8, ["actions", "layout"])
|
|
1089
|
+
])
|
|
1090
|
+
]),
|
|
1091
|
+
key: "0"
|
|
1092
|
+
} : void 0
|
|
1093
|
+
]), 1032, ["allow-time-input", "quick-select-ranges", "value", "first-day-of-week", "granularities", "is-date-disabled", "max-range", "min", "max", "number-of-months", "show-end-date-on-open", "date-form-data", "variant"])
|
|
1094
|
+
]),
|
|
1095
|
+
_: 1
|
|
1096
|
+
}, 8, ["id", "open", "target-element", "aria-label"])) : A("", !0)
|
|
1097
|
+
])), [
|
|
1098
|
+
[D(Lt), re]
|
|
1099
|
+
]);
|
|
1100
|
+
}
|
|
1101
|
+
}), Ha = /* @__PURE__ */ ut(Ta, [["__scopeId", "data-v-c4bf2c5f"]]);
|
|
1102
|
+
export {
|
|
1103
|
+
Ha as B,
|
|
1104
|
+
ma as D,
|
|
1105
|
+
sa as a,
|
|
1106
|
+
Se as i
|
|
1107
|
+
};
|
|
1108
|
+
//# sourceMappingURL=date-range-picker.BPZE6r01.js.map
|