@adyen/bento-vue3 1.89.2 → 1.90.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 +403 -298
- package/dist/accordion.js +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/ai-tag.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/anchor-scroller.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/input-time.css +1 -0
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.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/chip.js +1 -1
- package/dist/chunks/accordion-item.CZIxxSsH.js +141 -0
- package/dist/chunks/{accordion-item.BX1KrLMl.js.map → accordion-item.CZIxxSsH.js.map} +1 -1
- package/dist/chunks/action-bar.Pe_hvtja.js +336 -0
- package/dist/chunks/{action-bar.DLMaIUWW.js.map → action-bar.Pe_hvtja.js.map} +1 -1
- package/dist/chunks/ai-tag.BSlc78DU.js +137 -0
- package/dist/chunks/{ai-tag.DK63ExDc.js.map → ai-tag.BSlc78DU.js.map} +1 -1
- package/dist/chunks/{alert.C_8-VNi_.js → alert.CFWN2E0b.js} +86 -79
- package/dist/chunks/{alert.C_8-VNi_.js.map → alert.CFWN2E0b.js.map} +1 -1
- package/dist/chunks/anchor-scroller.DSfXK6vK.js +214 -0
- package/dist/chunks/{anchor-scroller.NhjLDBZI.js.map → anchor-scroller.DSfXK6vK.js.map} +1 -1
- package/dist/chunks/{base-modal.C2-JyHC_.js → base-modal.BjjDrx0z.js} +132 -125
- package/dist/chunks/{base-modal.C2-JyHC_.js.map → base-modal.BjjDrx0z.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.BQFAgAI2.js → button-actions-with-menu.DvkS16ur.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.BQFAgAI2.js.map → button-actions-with-menu.DvkS16ur.js.map} +1 -1
- package/dist/chunks/{button-actions.cMQWyZne.js → button-actions.Bh_PZ_fV.js} +202 -188
- package/dist/chunks/{button-actions.cMQWyZne.js.map → button-actions.Bh_PZ_fV.js.map} +1 -1
- package/dist/chunks/{calendar.DcCqkSNJ.js → calendar.CH-1Vgeb.js} +343 -329
- package/dist/chunks/{calendar.DcCqkSNJ.js.map → calendar.CH-1Vgeb.js.map} +1 -1
- package/dist/chunks/card.BzCGCCzH.js +223 -0
- package/dist/chunks/{card.CoxQ_L0w.js.map → card.BzCGCCzH.js.map} +1 -1
- package/dist/chunks/{checkbox-group.96n9Cc3W.js → checkbox-group.D_fN6Glu.js} +4 -4
- package/dist/chunks/{checkbox-group.96n9Cc3W.js.map → checkbox-group.D_fN6Glu.js.map} +1 -1
- package/dist/chunks/{checkbox.C6ATh8f5.js → checkbox.BlAhQl9N.js} +78 -71
- package/dist/chunks/{checkbox.C6ATh8f5.js.map → checkbox.BlAhQl9N.js.map} +1 -1
- package/dist/chunks/chip.DFldnqfz.js +72 -0
- package/dist/chunks/{chip.CdgpQyXN.js.map → chip.DFldnqfz.js.map} +1 -1
- package/dist/chunks/{code-snippet.DgAuuZF5.js → code-snippet.BePxxR3q.js} +113 -106
- package/dist/chunks/{code-snippet.DgAuuZF5.js.map → code-snippet.BePxxR3q.js.map} +1 -1
- package/dist/chunks/{controls-group.C7hOE1F4.js → controls-group.Cxk-0fCy.js} +2 -2
- package/dist/chunks/{controls-group.C7hOE1F4.js.map → controls-group.Cxk-0fCy.js.map} +1 -1
- package/dist/chunks/copy.CL893i9-.js +114 -0
- package/dist/chunks/{copy.C2kQ1PbI.js.map → copy.CL893i9-.js.map} +1 -1
- package/dist/chunks/{country.CaGc08Ps.js → country.15m_ATbO.js} +3 -3
- package/dist/chunks/{country.CaGc08Ps.js.map → country.15m_ATbO.js.map} +1 -1
- package/dist/chunks/country.types.6a7xxZIR.js +26 -0
- package/dist/chunks/{country.types.DjpMGz7a.js.map → country.types.6a7xxZIR.js.map} +1 -1
- package/dist/chunks/{dashboard-section.UafHRkMa.js → dashboard-section.CiNDItU2.js} +3 -3
- package/dist/chunks/{dashboard-section.UafHRkMa.js.map → dashboard-section.CiNDItU2.js.map} +1 -1
- package/dist/chunks/{dashed-underline.CcDV2Aks.js → dashed-underline.CwdpUz76.js} +3 -3
- package/dist/chunks/{dashed-underline.CcDV2Aks.js.map → dashed-underline.CwdpUz76.js.map} +1 -1
- package/dist/chunks/{data-grid-template.CnC4TQvk.js → data-grid-template.nXn1dLCw.js} +4 -4
- package/dist/chunks/{data-grid-template.CnC4TQvk.js.map → data-grid-template.nXn1dLCw.js.map} +1 -1
- package/dist/chunks/data-grid.CXWaoqzi.js +4242 -0
- package/dist/chunks/data-grid.CXWaoqzi.js.map +1 -0
- package/dist/chunks/date-picker.DPjCROIP.js +238 -0
- package/dist/chunks/{date-picker.dlzZ_-5f.js.map → date-picker.DPjCROIP.js.map} +1 -1
- package/dist/chunks/date-range-picker.fyrfFd04.js +998 -0
- package/dist/chunks/date-range-picker.fyrfFd04.js.map +1 -0
- package/dist/chunks/dialog-page.Bh-7RAwX.js +163 -0
- package/dist/chunks/{dialog-page.COfKqjT-.js.map → dialog-page.Bh-7RAwX.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.bq9AlGzJ.js → dropdown-default-textbox.aYsTZDZ7.js} +69 -62
- package/dist/chunks/{dropdown-default-textbox.bq9AlGzJ.js.map → dropdown-default-textbox.aYsTZDZ7.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.Ysrac5GN.js → dropdown-tag.B7OA_Yv9.js} +5 -5
- package/dist/chunks/{dropdown-tag.Ysrac5GN.js.map → dropdown-tag.B7OA_Yv9.js.map} +1 -1
- package/dist/chunks/{dropdown.MhmX1P9o.js → dropdown.Do-mZiI6.js} +285 -271
- package/dist/chunks/{dropdown.MhmX1P9o.js.map → dropdown.Do-mZiI6.js.map} +1 -1
- package/dist/chunks/error-message.849uzpkq.js +157 -0
- package/dist/chunks/{error-message.DCgo8q20.js.map → error-message.849uzpkq.js.map} +1 -1
- package/dist/chunks/{file-uploader.Bfd1uUMe.js → file-uploader.BUvDU_cn.js} +604 -583
- package/dist/chunks/{file-uploader.Bfd1uUMe.js.map → file-uploader.BUvDU_cn.js.map} +1 -1
- package/dist/chunks/{filter-bar.CkAjLQol.js → filter-bar.fowl40RS.js} +998 -928
- package/dist/chunks/{filter-bar.CkAjLQol.js.map → filter-bar.fowl40RS.js.map} +1 -1
- package/dist/chunks/fixed-scroller.yVsaQzy5.js +157 -0
- package/dist/chunks/{fixed-scroller.DtkaGyMD.js.map → fixed-scroller.yVsaQzy5.js.map} +1 -1
- package/dist/chunks/{footer-actions.BcYSsoUg.js → footer-actions.uoNbOGAQ.js} +2 -2
- package/dist/chunks/{footer-actions.BcYSsoUg.js.map → footer-actions.uoNbOGAQ.js.map} +1 -1
- package/dist/chunks/form-layout-title.Cr3wdpK_.js +239 -0
- package/dist/chunks/{form-layout-title.DW5Kg1rh.js.map → form-layout-title.Cr3wdpK_.js.map} +1 -1
- package/dist/chunks/{header-meta.Bym9AlQm.js → header-meta.CmH6SnjE.js} +98 -84
- package/dist/chunks/{header-meta.Bym9AlQm.js.map → header-meta.CmH6SnjE.js.map} +1 -1
- package/dist/chunks/{header-with-views.Djba6iol.js → header-with-views.B2pPBcTf.js} +1091 -1070
- package/dist/chunks/{header-with-views.Djba6iol.js.map → header-with-views.B2pPBcTf.js.map} +1 -1
- package/dist/chunks/{header.o-7SyHtU.js → header.BVM8Usdi.js} +3 -3
- package/dist/chunks/{header.o-7SyHtU.js.map → header.BVM8Usdi.js.map} +1 -1
- package/dist/chunks/{info-icon.BUala_wq.js → info-icon.B3MDsjMu.js} +2 -2
- package/dist/chunks/{info-icon.BUala_wq.js.map → info-icon.B3MDsjMu.js.map} +1 -1
- package/dist/chunks/input-field-password.CHb2Ros_.js +353 -0
- package/dist/chunks/{input-field-password.DZytmp_p.js.map → input-field-password.CHb2Ros_.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.CxblrmaU.js → input-field-phone-number.DM2rmZkQ.js} +12 -5
- package/dist/chunks/{input-field-phone-number.CxblrmaU.js.map → input-field-phone-number.DM2rmZkQ.js.map} +1 -1
- package/dist/chunks/{input-field.CfU0ZKtL.js → input-field.DnYjM6yy.js} +118 -111
- package/dist/chunks/{input-field.CfU0ZKtL.js.map → input-field.DnYjM6yy.js.map} +1 -1
- package/dist/chunks/input-time.DeJ8lDio.js +103 -0
- package/dist/chunks/input-time.DeJ8lDio.js.map +1 -0
- package/dist/chunks/{inspector.B9k4tJWe.js → inspector.DMhKNW1K.js} +70 -63
- package/dist/chunks/{inspector.B9k4tJWe.js.map → inspector.DMhKNW1K.js.map} +1 -1
- package/dist/chunks/{list-item.DO5uULke.js → list-item.BHvXpqaS.js} +2 -2
- package/dist/chunks/{list-item.DO5uULke.js.map → list-item.BHvXpqaS.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.Cvplth7d.js → listbox-option-tag.CVxaZqbc.js} +2 -2
- package/dist/chunks/{listbox-option-tag.Cvplth7d.js.map → listbox-option-tag.CVxaZqbc.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.CuKVyTWb.js → modal-fullscreen.9CSTqFQc.js} +54 -47
- package/dist/chunks/{modal-fullscreen.CuKVyTWb.js.map → modal-fullscreen.9CSTqFQc.js.map} +1 -1
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.DmPw0l5Y.js → modal.vue_vue_type_script_setup_true_lang.BAxTkaQM.js} +48 -41
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.DmPw0l5Y.js.map → modal.vue_vue_type_script_setup_true_lang.BAxTkaQM.js.map} +1 -1
- package/dist/chunks/pagination.DL-h8OLF.js +413 -0
- package/dist/chunks/{pagination.dpVc6Yt0.js.map → pagination.DL-h8OLF.js.map} +1 -1
- package/dist/chunks/{promo-banner.BzveHNOI.js → promo-banner.-H4r_cwj.js} +39 -32
- package/dist/chunks/{promo-banner.BzveHNOI.js.map → promo-banner.-H4r_cwj.js.map} +1 -1
- package/dist/chunks/{radio-group.Cuiq4mxy.js → radio-group.DzhQgXv9.js} +4 -4
- package/dist/chunks/{radio-group.Cuiq4mxy.js.map → radio-group.DzhQgXv9.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.DLMiT4f5.js → rich-text-editor.Ij2t4pyI.js} +418 -411
- package/dist/chunks/{rich-text-editor.DLMiT4f5.js.map → rich-text-editor.Ij2t4pyI.js.map} +1 -1
- package/dist/chunks/search-bar.DfNwnjes.js +114 -0
- package/dist/chunks/{search-bar.CsFyP0_I.js.map → search-bar.DfNwnjes.js.map} +1 -1
- package/dist/chunks/secondary-nav.CvipTDRh.js +285 -0
- package/dist/chunks/secondary-nav.CvipTDRh.js.map +1 -0
- package/dist/chunks/{segmented-control.KeQ5kuR1.js → segmented-control.CQWOO1-J.js} +2 -2
- package/dist/chunks/{segmented-control.KeQ5kuR1.js.map → segmented-control.CQWOO1-J.js.map} +1 -1
- package/dist/chunks/{selection-card-group.XM11Kk-4.js → selection-card-group.CcOWQAUC.js} +11 -11
- package/dist/chunks/{selection-card-group.XM11Kk-4.js.map → selection-card-group.CcOWQAUC.js.map} +1 -1
- package/dist/chunks/{sidepanel.b2QZ1Jsx.js → sidepanel.BObSv8UU.js} +56 -49
- package/dist/chunks/{sidepanel.b2QZ1Jsx.js.map → sidepanel.BObSv8UU.js.map} +1 -1
- package/dist/chunks/step.AsX2jAeL.js +268 -0
- package/dist/chunks/{step.BlwoLfdw.js.map → step.AsX2jAeL.js.map} +1 -1
- package/dist/chunks/structured-list-item.CgJR_ufh.js +112 -0
- package/dist/chunks/{structured-list-item.e-8kRleh.js.map → structured-list-item.CgJR_ufh.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.CcvOC03H.js → summary-grid.types.DKPhtHw3.js} +5 -5
- package/dist/chunks/{summary-grid.types.CcvOC03H.js.map → summary-grid.types.DKPhtHw3.js.map} +1 -1
- package/dist/chunks/{tab.mR5uUSdp.js → tab.9nyNZiGw.js} +2 -2
- package/dist/chunks/{tab.mR5uUSdp.js.map → tab.9nyNZiGw.js.map} +1 -1
- package/dist/chunks/{tag.DujMVFh-.js → tag.YN2r-Pp3.js} +2 -2
- package/dist/chunks/{tag.DujMVFh-.js.map → tag.YN2r-Pp3.js.map} +1 -1
- package/dist/chunks/textarea.C-sBemuo.js +256 -0
- package/dist/chunks/{textarea.CHV6Z8nt.js.map → textarea.C-sBemuo.js.map} +1 -1
- package/dist/chunks/timeline-item.CHk8wXeT.js +433 -0
- package/dist/chunks/{timeline-item.CaGcRZbt.js.map → timeline-item.CHk8wXeT.js.map} +1 -1
- package/dist/chunks/{toast.C2oehk9P.js → toast.De4MTkiH.js} +64 -57
- package/dist/chunks/{toast.C2oehk9P.js.map → toast.De4MTkiH.js.map} +1 -1
- package/dist/chunks/{tooltip.CbADa_4p.js → tooltip.DHfG2aRt.js} +40 -38
- package/dist/chunks/tooltip.DHfG2aRt.js.map +1 -0
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.BOruzlTt.js → tutorial.vue_vue_type_script_setup_true_lang.CUDeriBU.js} +120 -113
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.BOruzlTt.js.map → tutorial.vue_vue_type_script_setup_true_lang.CUDeriBU.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.ClEJRFAd.js → use-cached-selected-values.DIbfa5F1.js} +381 -360
- package/dist/chunks/{use-cached-selected-values.ClEJRFAd.js.map → use-cached-selected-values.DIbfa5F1.js.map} +1 -1
- package/dist/chunks/{use-country-items.D_3LBe2I.js → use-country-items.Dp7X1r2e.js} +3 -3
- package/dist/chunks/{use-country-items.D_3LBe2I.js.map → use-country-items.Dp7X1r2e.js.map} +1 -1
- package/dist/chunks/{use-country-phon-code.DoqTGkNr.js → use-country-phon-code.BzcawGpE.js} +107 -104
- package/dist/chunks/{use-country-phon-code.DoqTGkNr.js.map → use-country-phon-code.BzcawGpE.js.map} +1 -1
- package/dist/chunks/{use-date-input-formatter.CDRzd-hW.js → use-date-input-formatter.BiIraXZZ.js} +2 -2
- package/dist/chunks/{use-date-input-formatter.CDRzd-hW.js.map → use-date-input-formatter.BiIraXZZ.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/country.js +3 -3
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/draggable-handle.js +51 -44
- package/dist/draggable-handle.js.map +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 +205 -203
- 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 +5 -0
- package/dist/input-time.js.map +1 -0
- package/dist/inspector.js +1 -1
- package/dist/internal.js +12 -12
- 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/pagination.js +1 -1
- package/dist/popover.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/stepper.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/toast.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +4 -4
- package/dist/chunks/accordion-item.BX1KrLMl.js +0 -134
- package/dist/chunks/action-bar.DLMaIUWW.js +0 -329
- package/dist/chunks/ai-tag.DK63ExDc.js +0 -130
- package/dist/chunks/anchor-scroller.NhjLDBZI.js +0 -207
- package/dist/chunks/card.CoxQ_L0w.js +0 -216
- package/dist/chunks/chip.CdgpQyXN.js +0 -65
- package/dist/chunks/copy.C2kQ1PbI.js +0 -107
- package/dist/chunks/country.types.DjpMGz7a.js +0 -19
- package/dist/chunks/data-grid.BSIXLRm7.js +0 -4014
- package/dist/chunks/data-grid.BSIXLRm7.js.map +0 -1
- package/dist/chunks/date-picker.dlzZ_-5f.js +0 -231
- package/dist/chunks/date-range-picker.DC6CK0As.js +0 -995
- package/dist/chunks/date-range-picker.DC6CK0As.js.map +0 -1
- package/dist/chunks/dialog-page.COfKqjT-.js +0 -156
- package/dist/chunks/error-message.DCgo8q20.js +0 -143
- package/dist/chunks/fixed-scroller.DtkaGyMD.js +0 -150
- package/dist/chunks/form-layout-title.DW5Kg1rh.js +0 -230
- package/dist/chunks/input-field-password.DZytmp_p.js +0 -346
- package/dist/chunks/pagination.dpVc6Yt0.js +0 -401
- package/dist/chunks/search-bar.CsFyP0_I.js +0 -107
- package/dist/chunks/secondary-nav.CLBdq98c.js +0 -138
- package/dist/chunks/secondary-nav.CLBdq98c.js.map +0 -1
- package/dist/chunks/step.BlwoLfdw.js +0 -259
- package/dist/chunks/structured-list-item.e-8kRleh.js +0 -105
- package/dist/chunks/textarea.CHV6Z8nt.js +0 -247
- package/dist/chunks/timeline-item.CaGcRZbt.js +0 -419
- package/dist/chunks/tooltip.CbADa_4p.js.map +0 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { defineComponent as I, useSlots as _, ref as b, computed as B, watch as D, openBlock as V, createBlock as S, unref as d, mergeProps as $, createSlots as k, withCtx as p, renderSlot as m, createTextVNode as w, toDisplayString as x } from "vue";
|
|
2
|
+
import { B as E } from "./input-field.DnYjM6yy.js";
|
|
3
|
+
import { d as M } from "./debounce.DUTu11PS.js";
|
|
4
|
+
import { u as A } from "./index.B875RXHM.js";
|
|
5
|
+
import { u as F } from "./use-has-slot.CyMiImRQ.js";
|
|
6
|
+
import { _ as C } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
7
|
+
import "../assets/input-time.css";
|
|
8
|
+
const N = /[\d]/, q = /^\d{2}$/, K = /^\d{2}:\d{2}$/, f = (o) => /^(?:[01]\d|2[0-4]):(?:[0-5]\d):(?:[0-5]\d)$/.test(o), L = (o) => {
|
|
9
|
+
const { selectionStart: t } = o.target, n = ["Backspace", "Tab", "ArrowLeft", "ArrowRight"], i = N.test(o.key) || n.includes(o.key), u = [1, 2, 4, 5].includes(t) && o.key === ":";
|
|
10
|
+
!i && !u && o.preventDefault();
|
|
11
|
+
}, O = (o) => {
|
|
12
|
+
if (!o)
|
|
13
|
+
return o;
|
|
14
|
+
let t = o;
|
|
15
|
+
if (t.length === 1 && parseInt(o, 10) > 2)
|
|
16
|
+
return `0${t}:`;
|
|
17
|
+
const [n, i] = t.slice(-2);
|
|
18
|
+
return [2, 5].includes(t.length) && i === ":" && (t = `${t.slice(0, t.length - 2)}0${n}`), (q.test(t) || K.test(t)) && (t += ":"), t;
|
|
19
|
+
}, g = {
|
|
20
|
+
"en-US": { invalidTimeFormat: "Invalid time format", timeFormatDescription: "HH:MM:SS" }
|
|
21
|
+
}, R = {
|
|
22
|
+
i18n: { messages: g },
|
|
23
|
+
name: "bento-input-time",
|
|
24
|
+
inheritAttrs: !1,
|
|
25
|
+
model: { prop: "modelValue" }
|
|
26
|
+
}, U = /* @__PURE__ */ I({
|
|
27
|
+
...R,
|
|
28
|
+
props: {
|
|
29
|
+
condensed: { type: Boolean, default: !1 },
|
|
30
|
+
modelValue: { default: void 0 },
|
|
31
|
+
description: { default: void 0 },
|
|
32
|
+
disabled: { type: Boolean, default: !1 },
|
|
33
|
+
errorMessage: { default: null },
|
|
34
|
+
label: { default: "" },
|
|
35
|
+
optional: { type: Boolean, default: !1 },
|
|
36
|
+
placeholder: { default: "" },
|
|
37
|
+
readonly: { type: Boolean, default: !1 },
|
|
38
|
+
required: { type: Boolean, default: !1 },
|
|
39
|
+
tooltipText: { default: null }
|
|
40
|
+
},
|
|
41
|
+
emits: ["update:model-value", "keydown", "input:valid", "input:error"],
|
|
42
|
+
setup(o, { emit: t }) {
|
|
43
|
+
const i = _(), u = F(i), { t: c } = A({ messages: g }), e = o, r = t, s = b(!1), y = B(() => e.errorMessage ? e.errorMessage : s.value ? c("invalidTimeFormat") : null), T = M((l) => {
|
|
44
|
+
if (!l) {
|
|
45
|
+
s.value = !1;
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const a = f(l);
|
|
49
|
+
s.value = !a, r(a ? "input:valid" : "input:error");
|
|
50
|
+
}, 300);
|
|
51
|
+
D(
|
|
52
|
+
() => e.modelValue,
|
|
53
|
+
(l) => {
|
|
54
|
+
const a = String(l ?? "");
|
|
55
|
+
a.length === 8 && f(a) && (s.value = !1);
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
const v = (l) => {
|
|
59
|
+
if (e.disabled || e.readonly)
|
|
60
|
+
return;
|
|
61
|
+
const a = O(String(l ?? ""));
|
|
62
|
+
r("update:model-value", a), T(a);
|
|
63
|
+
}, h = (l) => {
|
|
64
|
+
L(l), r("keydown", l);
|
|
65
|
+
};
|
|
66
|
+
return (l, a) => (V(), S(d(E), $({
|
|
67
|
+
class: "b-input-time",
|
|
68
|
+
condensed: e.condensed,
|
|
69
|
+
disabled: e.disabled,
|
|
70
|
+
"error-message": y.value,
|
|
71
|
+
label: e.label,
|
|
72
|
+
"model-value": e.modelValue,
|
|
73
|
+
optional: e.optional,
|
|
74
|
+
placeholder: e.placeholder,
|
|
75
|
+
readonly: e.readonly,
|
|
76
|
+
required: e.required,
|
|
77
|
+
"tooltip-text": e.tooltipText
|
|
78
|
+
}, l.$attrs, {
|
|
79
|
+
"onUpdate:modelValue": v,
|
|
80
|
+
onKeydown: h
|
|
81
|
+
}), k({
|
|
82
|
+
description: p(() => [
|
|
83
|
+
m(l.$slots, "description", {}, () => [
|
|
84
|
+
w(x(e.description ? `${e.description} ${d(c)("timeFormatDescription")}` : d(c)("timeFormatDescription")), 1)
|
|
85
|
+
], !0)
|
|
86
|
+
]),
|
|
87
|
+
_: 2
|
|
88
|
+
}, [
|
|
89
|
+
d(u)("default") ? {
|
|
90
|
+
name: "default",
|
|
91
|
+
fn: p(() => [
|
|
92
|
+
m(l.$slots, "default", {}, void 0, !0)
|
|
93
|
+
]),
|
|
94
|
+
key: "0"
|
|
95
|
+
} : void 0
|
|
96
|
+
]), 1040, ["condensed", "disabled", "error-message", "label", "model-value", "optional", "placeholder", "readonly", "required", "tooltip-text"]));
|
|
97
|
+
}
|
|
98
|
+
}), Q = /* @__PURE__ */ C(U, [["__scopeId", "data-v-250fa173"]]);
|
|
99
|
+
export {
|
|
100
|
+
Q as B,
|
|
101
|
+
f as i
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=input-time.DeJ8lDio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-time.DeJ8lDio.js","sources":["../../../vue2/src/utils/ts/time-input.ts","../../../vue2/src/components/input-time/input-time.vue"],"sourcesContent":["const validDigitRegex = /[\\d]/;\n\nconst hourRegex = /^\\d{2}$/;\nconst minuteRegex = /^\\d{2}:\\d{2}$/;\n\n/**\n * Validates a complete time string in HH:MM:SS format.\n * Hours: 00-24, Minutes: 00-59, Seconds: 00-59\n * @param timeText The time string to validate\n * @returns True if the time string is valid, false otherwise\n */\nexport const isValidTimeString = (timeText: string): boolean =>\n /^(?:[01]\\d|2[0-4]):(?:[0-5]\\d):(?:[0-5]\\d)$/.test(timeText);\n\nexport const validateTimeInput = (event: KeyboardEvent) => {\n const { selectionStart } = event.target as HTMLInputElement;\n\n const allowedKeys = ['Backspace', 'Tab', 'ArrowLeft', 'ArrowRight'];\n const isValidKey = validDigitRegex.test(event.key) || allowedKeys.includes(event.key);\n const isValidColon = [1, 2, 4, 5].includes(selectionStart) && event.key === ':';\n\n if (!isValidKey && !isValidColon) {\n event.preventDefault();\n }\n};\n\nexport const formatTimeInputValue = (value: string) => {\n if (!value) {\n return value;\n }\n\n let formattedValue = value;\n\n // Format if the first value is bigger than 2, because it can't be bigger than 24 hours\n if (formattedValue.length === 1 && parseInt(value, 10) > 2) {\n return `0${formattedValue}:`;\n }\n\n const [secondToLastDigit, lastDigit] = formattedValue.slice(-2);\n if ([2, 5].includes(formattedValue.length) && lastDigit === ':') {\n formattedValue = `${formattedValue.slice(0, formattedValue.length - 2)}0${secondToLastDigit}`;\n }\n\n // Add `:` after hour/minute\n if (hourRegex.test(formattedValue) || minuteRegex.test(formattedValue)) {\n formattedValue += ':';\n }\n return formattedValue;\n};\n","<template>\n <bento-input-field\n class=\"b-input-time\"\n :condensed=\"props.condensed\"\n :disabled=\"props.disabled\"\n :error-message=\"computedErrorMessage\"\n :label=\"props.label\"\n :model-value=\"props.modelValue\"\n :optional=\"props.optional\"\n :placeholder=\"props.placeholder\"\n :readonly=\"props.readonly\"\n :required=\"props.required\"\n :tooltip-text=\"props.tooltipText\"\n v-bind=\"$attrs\"\n @update:model-value=\"onInput\"\n @keydown=\"onKeyDown\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot name=\"default\"></slot>\n </template>\n <template #description>\n <slot name=\"description\">{{\n props.description ? `${props.description} ${t('timeFormatDescription')}` : t('timeFormatDescription')\n }}</slot>\n </template>\n </bento-input-field>\n</template>\n\n<script setup lang=\"ts\">\n // Components\n import { BentoInputField } from '@/components/input-field';\n\n // Utils\n import { debounce } from '@/utils/ts/debounce';\n import { useI18n } from '@/utils/ts/i18n';\n import { formatTimeInputValue, isValidTimeString, validateTimeInput } from '@/utils/ts/time-input';\n\n // Types\n import type { BentoInputFieldValue } from '@/components/input-field/input-field.types';\n import { type BentoInputTimeProps } from './input-time.types';\n\n // Localization\n import messages from './messages.json';\n\n import { computed, ref, useSlots, watch } from 'vue';\n import { useHasSlot } from '@/composables';\n\n const VALIDATION_DEBOUNCE_TIME = 300;\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n type MessageSchema = (typeof messages)['en-US'];\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = withDefaults(defineProps<BentoInputTimeProps>(), {\n condensed: false,\n description: undefined,\n disabled: false,\n errorMessage: null,\n label: '',\n modelValue: undefined,\n optional: false,\n placeholder: '',\n readonly: false,\n required: false,\n tooltipText: null,\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the component's model changes\n */\n (e: 'update:model-value', value: BentoInputFieldValue): void;\n\n /**\n * Emitted when a key is pressed down\n */\n (e: 'keydown', event: KeyboardEvent): void;\n\n /**\n * Emitted when the time value passes validation (complete HH:MM:SS format)\n */\n (e: 'input:valid'): void;\n\n /**\n * Emitted when the time value fails validation\n */\n (e: 'input:error'): void;\n }>();\n\n const internalError = ref(false);\n\n const computedErrorMessage = computed(() => {\n if (props.errorMessage) {\n return props.errorMessage;\n }\n return internalError.value ? t('invalidTimeFormat') : null;\n });\n\n const validateTime = (timeText: string) => {\n if (!timeText) {\n internalError.value = false;\n return;\n }\n\n const isValid = isValidTimeString(timeText);\n internalError.value = !isValid;\n\n if (isValid) {\n emit('input:valid');\n } else {\n emit('input:error');\n }\n };\n\n const validateTimeWithDebounce = debounce(validateTime, VALIDATION_DEBOUNCE_TIME);\n\n // Watch for external modelValue changes (e.g., when parent resets the value)\n watch(\n () => props.modelValue,\n newValue => {\n const timeText = String(newValue ?? '');\n // Clear the error only when the new value is a complete, valid time string\n if (timeText.length === 8 && isValidTimeString(timeText)) {\n internalError.value = false;\n }\n }\n );\n\n const onInput = (value: BentoInputFieldValue) => {\n if (props.disabled || props.readonly) {\n return;\n }\n const formatted = formatTimeInputValue(String(value ?? ''));\n emit('update:model-value', formatted);\n validateTimeWithDebounce(formatted);\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n validateTimeInput(event);\n emit('keydown', event);\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Input time component for entering time values in HH:MM:SS format.\n * This is an extension of the `bento-input-field` component with built-in\n * time formatting and validation logic.\n *\n * @usage\n * import { BentoInputTime } from '@adyen/bento-vue2';\n *\n * const timeValue = ref('');\n *\n * export default {\n * components: { BentoInputTime },\n * template: `\n * <bento-input-time\n * label=\"Start time\"\n * :model-value=\"timeValue\"\n * @update:model-value=\"newValue => timeValue.value = newValue\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-input-time',\n inheritAttrs: false,\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-time.scss\" />\n"],"names":["validDigitRegex","hourRegex","minuteRegex","isValidTimeString","timeText","validateTimeInput","event","selectionStart","allowedKeys","isValidKey","isValidColon","formatTimeInputValue","value","formattedValue","secondToLastDigit","lastDigit","__default__","messages","slots","useSlots","hasSlot","useHasSlot","t","useI18n","props","__props","emit","__emit","internalError","ref","computedErrorMessage","computed","validateTimeWithDebounce","debounce","isValid","watch","newValue","onInput","formatted","onKeyDown"],"mappings":";;;;;;;AAAA,MAAAA,IAAA,QAEAC,IAAA,WACAC,IAAA,iBAQOC,IAAA,CAAAC,MAAA,8CAAA,KAAAA,CAAA,GAGAC,IAAA,CAAAC,MAAA;AACH,QAAA,EAAA,gBAAAC,EAAA,IAAAD,EAAA,QAEAE,IAAA,CAAA,aAAA,OAAA,aAAA,YAAA,GACAC,IAAAT,EAAA,KAAAM,EAAA,GAAA,KAAAE,EAAA,SAAAF,EAAA,GAAA,GACAI,IAAA,CAAA,GAAA,GAAA,GAAA,CAAA,EAAA,SAAAH,CAAA,KAAAD,EAAA,QAAA;AAEA,EAAA,CAAAG,KAAA,CAAAC,KACIJ,EAAA,eAAA;AAER,GAEOK,IAAA,CAAAC,MAAA;AACH,MAAA,CAAAA;AACI,WAAAA;AAGJ,MAAAC,IAAAD;AAGA,MAAAC,EAAA,WAAA,KAAA,SAAAD,GAAA,EAAA,IAAA;AACI,WAAA,IAAAC,CAAA;AAGJ,QAAA,CAAAC,GAAAC,CAAA,IAAAF,EAAA,MAAA,EAAA;AACA,SAAA,CAAA,GAAA,CAAA,EAAA,SAAAA,EAAA,MAAA,KAAAE,MAAA,QACIF,IAAA,GAAAA,EAAA,MAAA,GAAAA,EAAA,SAAA,CAAA,CAAA,IAAAC,CAAA,MAIJb,EAAA,KAAAY,CAAA,KAAAX,EAAA,KAAAW,CAAA,OACIA,KAAA,MAEJA;AACJ;;GCuHIG,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAAA,EACM,MAAA;AAAA,EACX,cAAA;AAAA,EACQ,OAAA,EAAA,MAAA,aAAA;AAElB;;;;;;;;;;;;;;;;;AA3HA,UAAAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAGA,EAAA,GAAAI,EAAA,IAAAC,EAAA,EAAA,UAAAN,EAAA,CAAA,GAEAO,IAAAC,GAcAC,IAAAC,GAsBAC,IAAAC,EAAA,EAAA,GAEAC,IAAAC,EAAA,MACIP,EAAA,eACIA,EAAA,eAEJI,EAAA,QAAAN,EAAA,mBAAA,IAAA,IAAsD,GAmB1DU,IAAAC,EAhBA,CAAA7B,MAAA;AACI,UAAA,CAAAA,GAAA;AACI,QAAAwB,EAAA,QAAA;AACA;AAAA,MAAA;AAGJ,YAAAM,IAAA/B,EAAAC,CAAA;AACA,MAAAwB,EAAA,QAAA,CAAAM,GAGIR,EADJQ,IACI,gBAEA,aAFA;AAAA,IAGJ,GAGJ,GAAA;AAGA,IAAAC;AAAA,MAAA,MAAAX,EAAA;AAAA,MACgB,CAAAY,MAAA;AAER,cAAAhC,IAAA,OAAAgC,KAAA,EAAA;AAEA,QAAAhC,EAAA,WAAA,KAAAD,EAAAC,CAAA,MACIwB,EAAA,QAAA;AAAA,MACJ;AAAA,IACJ;AAGJ,UAAAS,IAAA,CAAAzB,MAAA;AACI,UAAAY,EAAA,YAAAA,EAAA;AACI;AAEJ,YAAAc,IAAA3B,EAAA,OAAAC,KAAA,EAAA,CAAA;AACA,MAAAc,EAAA,sBAAAY,CAAA,GACAN,EAAAM,CAAA;AAAA,IAAkC,GAGtCC,IAAA,CAAAjC,MAAA;AACI,MAAAD,EAAAC,CAAA,GACAoB,EAAA,WAAApB,CAAA;AAAA,IAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ref as v, watch as
|
|
1
|
+
import { ref as v, watch as w, defineComponent as z, computed as S, openBlock as f, createElementBlock as b, normalizeClass as N, createElementVNode as i, renderSlot as L, createVNode as r, Transition as $, withCtx as l, withKeys as K, unref as n, Fragment as G, createTextVNode as A, toDisplayString as M, createCommentVNode as y, createBlock as F, nextTick as Y } from "vue";
|
|
2
2
|
import { d as U, B as X } from "./typography.B3J6_tYk.js";
|
|
3
|
-
import { B as
|
|
3
|
+
import { B as E } from "./button.DWF7FSIw.js";
|
|
4
4
|
import { B as j } from "./loading-indicator.BPol9I84.js";
|
|
5
|
-
import { B as q, s as J, g as W, a as
|
|
5
|
+
import { B as q, s as J, g as W, a as Z, f as Q } from "./focus-trap.BAiM_ywb.js";
|
|
6
6
|
import { E as ee } from "./expand.BrywY9jl.js";
|
|
7
7
|
import { C as te } from "./cross.CCHdi6v3.js";
|
|
8
8
|
import { g as ne } from "./generate-uid.DBWe4g6T.js";
|
|
9
9
|
import { u as oe } from "./index.B875RXHM.js";
|
|
10
|
-
import { a as ae, b as
|
|
11
|
-
import { _ as
|
|
10
|
+
import { a as ae, b as ie } from "./index.DDwcHPb6.js";
|
|
11
|
+
import { _ as re } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
12
12
|
import "../assets/inspector.css";
|
|
13
|
-
function
|
|
14
|
-
const t = v([]),
|
|
15
|
-
return
|
|
16
|
-
!
|
|
13
|
+
function se(C) {
|
|
14
|
+
const t = v([]), s = ae();
|
|
15
|
+
return w(s, (o) => {
|
|
16
|
+
!C.value || !o || !C.value.contains(o) || (t.value.unshift(o), t.value.length > 3 && t.value.pop());
|
|
17
17
|
}), {
|
|
18
18
|
findValidFocusFallback: () => {
|
|
19
19
|
for (const o of t.value)
|
|
@@ -23,12 +23,19 @@ function re(_) {
|
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
const
|
|
26
|
+
const H = {
|
|
27
|
+
"de-DE": { close: "Schließen", expand: "Anzeigen", inspector: "Inspektor", returnToMainContent: "Zurück zum Hauptinhalt (Strg+Shift+S)", returnToMainContentDescription: "Mit der Tastenkombination Strg + Umschalt + S können Sie zwischen dem Inspektor und den Seitenbereichen navigieren." },
|
|
28
|
+
"en-GB": { close: "Close", expand: "Expand", inspector: "Inspector", returnToMainContent: "Return to main content (Ctrl+Shift+S)", returnToMainContentDescription: "You can use Ctrl + Shift + S to navigate between the inspector and page sections." },
|
|
27
29
|
"en-US": { close: "Close", expand: "Expand", inspector: "Inspector", returnToMainContent: "Return to main content (Ctrl+Shift+S)", returnToMainContentDescription: "You can use Ctrl + Shift + S to navigate between the inspector and page sections." },
|
|
30
|
+
"es-ES": { close: "Cerrar", expand: "Ampliar", inspector: "Inspector", returnToMainContent: "Volver al contenido principal (Ctrl+Shift+S)", returnToMainContentDescription: "Puedes usar Ctrl + Shift + S para navegar entre las secciones del inspector y de la página." },
|
|
31
|
+
"es-MX": { close: "Cerrar", expand: "Ampliar", inspector: "Inspector", returnToMainContent: "Volver al contenido principal (Ctrl+Shift+S)", returnToMainContentDescription: "Puedes usar Ctrl + Shift + S para navegar entre las secciones del inspector y de la página." },
|
|
32
|
+
"fr-FR": { close: "Fermer", expand: "Développer", inspector: "Inspecteur", returnToMainContent: "Retour au contenu principal (Ctrl+Maj+S)", returnToMainContentDescription: "Vous pouvez utiliser Ctrl + Shift + S pour naviguer entre les sections de l'inspecteur et de la page." },
|
|
33
|
+
"it-IT": { close: "Chiudi", expand: "Espandi", inspector: "Ispettore", returnToMainContent: "Torna al contenuto principale (Ctrl+Shift+S)", returnToMainContentDescription: "Puoi usare Ctrl + Shift + S per navigare tra le sezioni ispettore e pagina." },
|
|
28
34
|
"ja-JP": { close: "閉じる", expand: "展開", inspector: "インスペクター", returnToMainContent: "メインコンテンツに戻る(Ctrl+Shift+S)", returnToMainContentDescription: "Ctrl + Shift + S を使用して、インスペクターとページセクション間を移動できます。" },
|
|
29
|
-
"pt-BR": { close: "Fechar", expand: "Expandir", inspector: "Inspetor", returnToMainContent: "Voltar ao conteúdo principal (Ctrl+Shift+S)", returnToMainContentDescription: "Você pode usar Ctrl + Shift + S para navegar entre as seções do inspetor e da página." }
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
"pt-BR": { close: "Fechar", expand: "Expandir", inspector: "Inspetor", returnToMainContent: "Voltar ao conteúdo principal (Ctrl+Shift+S)", returnToMainContentDescription: "Você pode usar Ctrl + Shift + S para navegar entre as seções do inspetor e da página." },
|
|
36
|
+
"zh-CN": { close: "关闭", expand: "展开", inspector: "检查器", returnToMainContent: "返回主内容(Ctrl+Shift+S)", returnToMainContentDescription: "您可以使用 Ctrl + Shift + S 在检查器和页面分区之间导航。" }
|
|
37
|
+
}, ce = { class: "b-inspector__page" }, le = ["aria-label"], pe = { class: "b-inspector__container" }, ue = { class: "b-inspector__header" }, de = ["id"], fe = { class: "b-inspector__icons" }, ve = { class: "b-inspector__content" }, Ce = { i18n: { messages: H } }, me = /* @__PURE__ */ z({
|
|
38
|
+
...Ce,
|
|
32
39
|
__name: "inspector",
|
|
33
40
|
props: {
|
|
34
41
|
activePage: { default: "" },
|
|
@@ -41,122 +48,122 @@ const I = {
|
|
|
41
48
|
pageFocusAnchor: { default: null }
|
|
42
49
|
},
|
|
43
50
|
emits: ["update:is-open", "update:active-page", "expand"],
|
|
44
|
-
setup(
|
|
45
|
-
const t =
|
|
51
|
+
setup(C, { emit: k }) {
|
|
52
|
+
const t = C, s = k, { t: c } = oe({ messages: H }), o = ne("returnToMainContentDescription"), B = v(null), m = v(null), x = v(null), g = v(null), { width: D } = ie(B), p = S(() => {
|
|
46
53
|
const d = t.size === "small" ? 740 : 915;
|
|
47
|
-
return
|
|
48
|
-
}),
|
|
54
|
+
return D.value > 0 && D.value < d;
|
|
55
|
+
}), _ = S(() => t.pageFocusAnchor), O = S(() => ({
|
|
49
56
|
[`b-inspector--${t.size}`]: !0,
|
|
50
57
|
[`b-inspector--${t.relativeLayout}`]: !0,
|
|
51
58
|
"b-inspector--is-compact": p.value
|
|
52
|
-
})), P =
|
|
53
|
-
t.isOpen ? (await Y(), J(m.value,
|
|
59
|
+
})), P = S(() => `${c("inspector")}, ${t.title}`), { findValidFocusFallback: h } = se(x), T = async () => {
|
|
60
|
+
t.isOpen ? (await Y(), J(m.value, _.value)) : u(_.value ?? h());
|
|
54
61
|
}, R = (e) => {
|
|
55
62
|
if (p.value)
|
|
56
63
|
return;
|
|
57
64
|
const a = e.shiftKey ? -1 : 1, d = W(a, m.value);
|
|
58
|
-
|
|
65
|
+
Z() === d && (e.preventDefault(), g.value = document.activeElement, u(_.value ?? h()), s("update:active-page", void 0));
|
|
59
66
|
}, V = (e) => {
|
|
60
67
|
const a = e.shiftKey && e.ctrlKey && e.key === "S";
|
|
61
|
-
t.isOpen && !p.value && a &&
|
|
62
|
-
},
|
|
63
|
-
|
|
68
|
+
t.isOpen && !p.value && a && I();
|
|
69
|
+
}, I = () => {
|
|
70
|
+
Q(m.value) ? (g.value = document.activeElement, u(_.value ?? h()), s("update:active-page", void 0)) : u(g.value);
|
|
64
71
|
}, u = (e) => {
|
|
65
72
|
e && (e?.focus(), document.activeElement !== e && u(e.parentElement));
|
|
66
73
|
};
|
|
67
|
-
return
|
|
74
|
+
return w(
|
|
68
75
|
() => t.activePage,
|
|
69
76
|
() => {
|
|
70
|
-
t.activePage &&
|
|
77
|
+
t.activePage && T();
|
|
71
78
|
}
|
|
72
79
|
), t.activePage || U(
|
|
73
80
|
'BentoInspector "active-page" as optional',
|
|
74
81
|
`Make sure to set the "active-page" prop and keep it in sync with "update:active-page".
|
|
75
82
|
"active-page" prop will be required in the next version`,
|
|
76
83
|
"2.0.0"
|
|
77
|
-
), (e, a) => (f(),
|
|
84
|
+
), (e, a) => (f(), b("div", {
|
|
78
85
|
ref_key: "wrapper",
|
|
79
|
-
ref:
|
|
80
|
-
class: N(["b-inspector",
|
|
86
|
+
ref: B,
|
|
87
|
+
class: N(["b-inspector", O.value]),
|
|
81
88
|
onKeydown: V
|
|
82
89
|
}, [
|
|
83
|
-
|
|
90
|
+
i("div", {
|
|
84
91
|
ref_key: "page",
|
|
85
|
-
ref:
|
|
92
|
+
ref: x,
|
|
86
93
|
class: "b-inspector__page-wrapper"
|
|
87
94
|
}, [
|
|
88
|
-
|
|
89
|
-
|
|
95
|
+
i("div", ce, [
|
|
96
|
+
L(e.$slots, "page", {}, void 0, !0)
|
|
90
97
|
])
|
|
91
98
|
], 512),
|
|
92
|
-
|
|
99
|
+
r($, {
|
|
93
100
|
name: "b-inspector__animation",
|
|
94
101
|
mode: "out-in",
|
|
95
|
-
onBeforeEnter:
|
|
96
|
-
onAfterLeave:
|
|
102
|
+
onBeforeEnter: T,
|
|
103
|
+
onAfterLeave: T
|
|
97
104
|
}, {
|
|
98
105
|
default: l(() => [
|
|
99
|
-
e.isOpen ? (f(),
|
|
106
|
+
e.isOpen ? (f(), b("aside", {
|
|
100
107
|
key: 0,
|
|
101
108
|
ref_key: "inspector",
|
|
102
109
|
ref: m,
|
|
103
110
|
class: "b-inspector__container-wrapper",
|
|
104
111
|
"aria-label": P.value,
|
|
105
|
-
onKeydown:
|
|
112
|
+
onKeydown: K(R, ["tab"])
|
|
106
113
|
}, [
|
|
107
|
-
|
|
114
|
+
r(n(q), {
|
|
108
115
|
disabled: !p.value
|
|
109
116
|
}, {
|
|
110
117
|
default: l(() => [
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
p.value ?
|
|
114
|
-
|
|
118
|
+
i("div", pe, [
|
|
119
|
+
i("div", ue, [
|
|
120
|
+
p.value ? y("", !0) : (f(), b(G, { key: 0 }, [
|
|
121
|
+
r(n(E), {
|
|
115
122
|
class: "b-inspector__return-content",
|
|
116
123
|
variant: "secondary",
|
|
117
124
|
condensed: "",
|
|
118
125
|
"aria-describedby": n(o),
|
|
119
|
-
onClick:
|
|
126
|
+
onClick: I
|
|
120
127
|
}, {
|
|
121
128
|
default: l(() => [
|
|
122
|
-
|
|
129
|
+
A(M(n(c)("returnToMainContent")), 1)
|
|
123
130
|
]),
|
|
124
131
|
_: 1
|
|
125
132
|
}, 8, ["aria-describedby"]),
|
|
126
|
-
|
|
133
|
+
i("span", {
|
|
127
134
|
id: n(o),
|
|
128
135
|
class: "b-inspector__return-content-description"
|
|
129
|
-
},
|
|
136
|
+
}, M(n(c)("returnToMainContentDescription")), 9, de)
|
|
130
137
|
], 64)),
|
|
131
|
-
|
|
138
|
+
r(n(X), {
|
|
132
139
|
el: "h2",
|
|
133
140
|
variant: "title",
|
|
134
141
|
class: "b-inspector__title"
|
|
135
142
|
}, {
|
|
136
143
|
default: l(() => [
|
|
137
|
-
|
|
144
|
+
A(M(e.title), 1)
|
|
138
145
|
]),
|
|
139
146
|
_: 1
|
|
140
147
|
}),
|
|
141
|
-
|
|
142
|
-
e.expandable ? (f(),
|
|
148
|
+
i("div", fe, [
|
|
149
|
+
e.expandable ? (f(), F(n(E), {
|
|
143
150
|
key: 0,
|
|
144
151
|
variant: "tertiary",
|
|
145
|
-
onClick: a[0] || (a[0] = (d) =>
|
|
152
|
+
onClick: a[0] || (a[0] = (d) => s("expand"))
|
|
146
153
|
}, {
|
|
147
154
|
iconLeft: l(() => [
|
|
148
|
-
|
|
155
|
+
r(n(ee), {
|
|
149
156
|
"svg-title": n(c)("expand")
|
|
150
157
|
}, null, 8, ["svg-title"])
|
|
151
158
|
]),
|
|
152
159
|
_: 1
|
|
153
|
-
})) :
|
|
154
|
-
|
|
160
|
+
})) : y("", !0),
|
|
161
|
+
r(n(E), {
|
|
155
162
|
variant: "tertiary",
|
|
156
|
-
onClick: a[1] || (a[1] = (d) =>
|
|
163
|
+
onClick: a[1] || (a[1] = (d) => s("update:is-open", !1))
|
|
157
164
|
}, {
|
|
158
165
|
iconLeft: l(() => [
|
|
159
|
-
|
|
166
|
+
r(n(te), {
|
|
160
167
|
"svg-title": n(c)("close")
|
|
161
168
|
}, null, 8, ["svg-title"])
|
|
162
169
|
]),
|
|
@@ -164,25 +171,25 @@ const I = {
|
|
|
164
171
|
})
|
|
165
172
|
])
|
|
166
173
|
]),
|
|
167
|
-
|
|
168
|
-
e.loading ? (f(),
|
|
174
|
+
i("div", ve, [
|
|
175
|
+
e.loading ? (f(), F(n(j), {
|
|
169
176
|
key: 0,
|
|
170
177
|
large: "",
|
|
171
178
|
class: "b-inspector__loading-indicator"
|
|
172
|
-
})) :
|
|
179
|
+
})) : L(e.$slots, "content", { key: 1 }, void 0, !0)
|
|
173
180
|
])
|
|
174
181
|
])
|
|
175
182
|
]),
|
|
176
183
|
_: 3
|
|
177
184
|
}, 8, ["disabled"])
|
|
178
|
-
], 40, le)) :
|
|
185
|
+
], 40, le)) : y("", !0)
|
|
179
186
|
]),
|
|
180
187
|
_: 3
|
|
181
188
|
})
|
|
182
189
|
], 34));
|
|
183
190
|
}
|
|
184
|
-
}),
|
|
191
|
+
}), xe = /* @__PURE__ */ re(me, [["__scopeId", "data-v-7df4c2ca"]]);
|
|
185
192
|
export {
|
|
186
|
-
|
|
193
|
+
xe as B
|
|
187
194
|
};
|
|
188
|
-
//# sourceMappingURL=inspector.
|
|
195
|
+
//# sourceMappingURL=inspector.DMhKNW1K.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspector.B9k4tJWe.js","sources":["../../../vue2/src/components/inspector/composables/use-focus-history/use-focus-history.ts","../../../vue2/src/components/inspector/inspector.vue"],"sourcesContent":["import { ref, type Ref } from 'vue';\nimport { useActiveElement } from '@vueuse/core';\nimport { watch } from 'vue';\n\n/**\n * A composable to track the focus history within a target element.\n * @param targetEl The stable parent element to monitor for focus changes.\n */\nexport function useFocusHistory(targetEl: Ref<HTMLElement | null>) {\n const MAX_HISTORY_LENGTH = 3;\n\n const focusHistory = ref<Array<Element>>([]);\n\n const currentActiveElement = useActiveElement();\n\n // Edge case 1:\n // While the inspector is opened, if user tabs through the data-grid to the inspector, and closes it,\n // it returns to the last element on the data grid regardless if it is a data-grid-cell.\n //\n // Edge case 2:\n // Buttons or actions teleported out of the data-grid may have the focus shifted into a different context.\n watch(currentActiveElement, newlyFocusedElement => {\n // Check if the newly focused element is a child of our target container.\n if (!targetEl.value || !newlyFocusedElement || !targetEl.value.contains(newlyFocusedElement)) {\n return;\n }\n\n // Add the focused element to the history\n focusHistory.value.unshift(newlyFocusedElement);\n\n if (focusHistory.value.length > MAX_HISTORY_LENGTH) {\n focusHistory.value.pop();\n }\n });\n\n /**\n * Iterates through the focus history to find the first valid element\n * that is still present in the DOM.\n * @returns The first valid historical element, or null if none are found.\n */\n const findValidFocusFallback = (): HTMLElement | null => {\n for (const el of focusHistory.value) {\n if (el && document.body.contains(el as Node)) {\n return el as HTMLElement;\n }\n }\n\n return null; // No valid fallback found\n };\n\n return {\n findValidFocusFallback,\n };\n}\n","<template>\n <div ref=\"wrapper\" class=\"b-inspector\" :class=\"conditionalClass\" @keydown=\"handleSectionFocus\">\n <div ref=\"page\" class=\"b-inspector__page-wrapper\">\n <div class=\"b-inspector__page\">\n <slot name=\"page\" />\n </div>\n </div>\n <Transition name=\"b-inspector__animation\" mode=\"out-in\" @before-enter=\"setFocus\" @after-leave=\"setFocus\">\n <aside\n v-if=\"isOpen\"\n ref=\"inspector\"\n class=\"b-inspector__container-wrapper\"\n :aria-label=\"inspectorAriaLabel\"\n @keydown.tab=\"handleTabNavigation\"\n >\n <bento-focus-trap :disabled=\"!isCompact\">\n <div class=\"b-inspector__container\">\n <div class=\"b-inspector__header\">\n <template v-if=\"!isCompact\">\n <bento-button\n class=\"b-inspector__return-content\"\n variant=\"secondary\"\n condensed\n :aria-describedby=\"returnToMainContentDescriptionId\"\n @click=\"moveFocusBetweenSections\"\n >\n {{ t('returnToMainContent') }}\n </bento-button>\n <span\n :id=\"returnToMainContentDescriptionId\"\n class=\"b-inspector__return-content-description\"\n >{{ t('returnToMainContentDescription') }}</span\n >\n </template>\n <bento-typography el=\"h2\" variant=\"title\" class=\"b-inspector__title\">\n {{ title }}\n </bento-typography>\n <div class=\"b-inspector__icons\">\n <bento-button v-if=\"expandable\" variant=\"tertiary\" @click=\"emit('expand')\">\n <template #iconLeft><expand-icon :svg-title=\"t('expand')\"></expand-icon></template>\n </bento-button>\n <bento-button variant=\"tertiary\" @click=\"emit('update:is-open', false)\">\n <template #iconLeft><cross-icon :svg-title=\"t('close')\"></cross-icon></template>\n </bento-button>\n </div>\n </div>\n <div class=\"b-inspector__content\">\n <bento-loading-indicator v-if=\"loading\" large class=\"b-inspector__loading-indicator\" />\n <slot v-else name=\"content\" />\n </div>\n </div>\n </bento-focus-trap>\n </aside>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, ref, watch } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoButton } from '@/components/button';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import ExpandIcon from '@adyen/ui-assets-icons-16/vue/expand';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { generateUid } from '@/core/utils/ts';\n import { useI18n } from '@/utils/ts/i18n';\n import { deprecate } from '@/utils/ts/deprecate';\n import { getNextFocusableElement } from '@/utils/ts/focus-trap.utils';\n import { useElementSize } from '@vueuse/core';\n import moveFocusInside, { focusInside, getActiveElement } from 'focus-lock';\n\n import { type BentoInspectorProps } from './inspector.types';\n import { useFocusHistory } from './composables/use-focus-history/use-focus-history';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(defineProps<BentoInspectorProps>(), {\n activePage: '',\n expandable: false,\n isOpen: false,\n loading: false,\n size: 'small',\n relativeLayout: 'push-content',\n pageFocusAnchor: null,\n });\n\n const emit = defineEmits<{\n /**\n * Emits update to keep isOpen prop in sync\n */\n (e: 'update:is-open', value: boolean): void;\n /**\n * Emits update to keep activePage prop in sync\n */\n (e: 'update:active-page', value: string): void;\n /**\n * Emits event when user click expand button\n */\n (e: 'expand'): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const returnToMainContentDescriptionId = generateUid('returnToMainContentDescription');\n const wrapper = ref<HTMLElement>(null);\n const inspector = ref<HTMLElement>(null);\n const page = ref<HTMLElement>(null);\n const inspectorLastFocusedElement = ref<HTMLElement>(null);\n\n const { width: wrapperWidth } = useElementSize(wrapper);\n\n const isCompact = computed(() => {\n const COMPACT_THRESHOLD_SMALL = 740;\n const COMPACT_THRESHOLD_LARGE = 915;\n\n // small inspector to occupy full screen if < 740px\n // large inspector to occupy full screen if < 915px\n const threshold = props.size === 'small' ? COMPACT_THRESHOLD_SMALL : COMPACT_THRESHOLD_LARGE;\n\n return wrapperWidth.value > 0 && wrapperWidth.value < threshold;\n });\n\n const computedPageLastFocusedElement = computed(() => props.pageFocusAnchor);\n\n const conditionalClass = computed(() => ({\n [`b-inspector--${props.size}`]: true,\n [`b-inspector--${props.relativeLayout}`]: true,\n [`b-inspector--is-compact`]: isCompact.value,\n }));\n\n const inspectorAriaLabel = computed(() => `${t('inspector')}, ${props.title}`);\n\n const { findValidFocusFallback } = useFocusHistory(page);\n\n const setFocus = async () => {\n if (props.isOpen) {\n await nextTick();\n moveFocusInside(inspector.value, computedPageLastFocusedElement.value);\n } else {\n // This doesn't work with data grid cell actions, as the button gets destroyed once is not being hovered.\n // To be reviewed after LevelAccess revision\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n }\n };\n\n const handleTabNavigation = event => {\n if (isCompact.value) {\n return;\n }\n const direction = event.shiftKey ? -1 : 1;\n const focusableEl = getNextFocusableElement(direction, inspector.value);\n // If the nextfocusableEl is the same as the activeElement that means it's the last focusable element\n // inside the inspector, so the focus is moved back to the last focused element on the page\n if (getActiveElement() === focusableEl) {\n event.preventDefault();\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n }\n };\n\n const handleSectionFocus = event => {\n const sectionShortcut = event.shiftKey && event.ctrlKey && event.key === 'S';\n if (props.isOpen && !isCompact.value && sectionShortcut) {\n moveFocusBetweenSections();\n }\n };\n\n const moveFocusBetweenSections = () => {\n if (focusInside(inspector.value)) {\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n } else {\n focusElement(inspectorLastFocusedElement.value);\n }\n };\n\n const focusElement = (element: HTMLElement) => {\n if (!element) {\n return;\n }\n element?.focus();\n if (document.activeElement !== element) {\n focusElement(element.parentElement);\n }\n };\n\n watch(\n () => props.activePage,\n () => {\n if (props.activePage) {\n setFocus();\n }\n }\n );\n\n if (!props.activePage) {\n deprecate(\n 'BentoInspector \"active-page\" as optional',\n `Make sure to set the \"active-page\" prop and keep it in sync with \"update:active-page\".\n \"active-page\" prop will be required in the next version`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Inspector allows users to access additional information or details of an object/item. The inspector opens adjacent to the main content, pushing it aside to maintain visibility and accessibility to both the main content and inspector.\n *\n * @example\n * import { BentoInspector } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoInspector },\n * template: `\n * <bento-inspector\n * title=\"Inspector\"\n * size=\"large\"\n * :is-open=\"isOpen\"\n * :active-page=\"activePage\"\n * expandable\n * @update:is-open=\"isOpen = $event\"\n * @update:active-page=\"activePage = $event\"\n * >\n * <template #page>Content of the page</template>\n * <template #content>Content of the inspector</template>\n * </bento-inspector>\n * `\n * }\n */\n export default { i18n: { messages } };\n</script>\n\n<style lang=\"scss\" scoped src=\"./inspector.scss\" />\n"],"names":["useFocusHistory","targetEl","focusHistory","ref","currentActiveElement","useActiveElement","watch","newlyFocusedElement","el","__default__","messages","props","__props","emit","__emit","t","useI18n","returnToMainContentDescriptionId","generateUid","wrapper","inspector","page","inspectorLastFocusedElement","wrapperWidth","useElementSize","isCompact","computed","threshold","computedPageLastFocusedElement","conditionalClass","inspectorAriaLabel","findValidFocusFallback","setFocus$1","nextTick","setFocus","focusElement","handleTabNavigation","event","direction","focusableEl","getNextFocusableElement","getActiveElement","handleSectionFocus","sectionShortcut","moveFocusBetweenSections","focusInside","element","deprecate"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"inspector.DMhKNW1K.js","sources":["../../../vue2/src/components/inspector/composables/use-focus-history/use-focus-history.ts","../../../vue2/src/components/inspector/inspector.vue"],"sourcesContent":["import { ref, type Ref } from 'vue';\nimport { useActiveElement } from '@vueuse/core';\nimport { watch } from 'vue';\n\n/**\n * A composable to track the focus history within a target element.\n * @param targetEl The stable parent element to monitor for focus changes.\n */\nexport function useFocusHistory(targetEl: Ref<HTMLElement | null>) {\n const MAX_HISTORY_LENGTH = 3;\n\n const focusHistory = ref<Array<Element>>([]);\n\n const currentActiveElement = useActiveElement();\n\n // Edge case 1:\n // While the inspector is opened, if user tabs through the data-grid to the inspector, and closes it,\n // it returns to the last element on the data grid regardless if it is a data-grid-cell.\n //\n // Edge case 2:\n // Buttons or actions teleported out of the data-grid may have the focus shifted into a different context.\n watch(currentActiveElement, newlyFocusedElement => {\n // Check if the newly focused element is a child of our target container.\n if (!targetEl.value || !newlyFocusedElement || !targetEl.value.contains(newlyFocusedElement)) {\n return;\n }\n\n // Add the focused element to the history\n focusHistory.value.unshift(newlyFocusedElement);\n\n if (focusHistory.value.length > MAX_HISTORY_LENGTH) {\n focusHistory.value.pop();\n }\n });\n\n /**\n * Iterates through the focus history to find the first valid element\n * that is still present in the DOM.\n * @returns The first valid historical element, or null if none are found.\n */\n const findValidFocusFallback = (): HTMLElement | null => {\n for (const el of focusHistory.value) {\n if (el && document.body.contains(el as Node)) {\n return el as HTMLElement;\n }\n }\n\n return null; // No valid fallback found\n };\n\n return {\n findValidFocusFallback,\n };\n}\n","<template>\n <div ref=\"wrapper\" class=\"b-inspector\" :class=\"conditionalClass\" @keydown=\"handleSectionFocus\">\n <div ref=\"page\" class=\"b-inspector__page-wrapper\">\n <div class=\"b-inspector__page\">\n <slot name=\"page\" />\n </div>\n </div>\n <Transition name=\"b-inspector__animation\" mode=\"out-in\" @before-enter=\"setFocus\" @after-leave=\"setFocus\">\n <aside\n v-if=\"isOpen\"\n ref=\"inspector\"\n class=\"b-inspector__container-wrapper\"\n :aria-label=\"inspectorAriaLabel\"\n @keydown.tab=\"handleTabNavigation\"\n >\n <bento-focus-trap :disabled=\"!isCompact\">\n <div class=\"b-inspector__container\">\n <div class=\"b-inspector__header\">\n <template v-if=\"!isCompact\">\n <bento-button\n class=\"b-inspector__return-content\"\n variant=\"secondary\"\n condensed\n :aria-describedby=\"returnToMainContentDescriptionId\"\n @click=\"moveFocusBetweenSections\"\n >\n {{ t('returnToMainContent') }}\n </bento-button>\n <span\n :id=\"returnToMainContentDescriptionId\"\n class=\"b-inspector__return-content-description\"\n >{{ t('returnToMainContentDescription') }}</span\n >\n </template>\n <bento-typography el=\"h2\" variant=\"title\" class=\"b-inspector__title\">\n {{ title }}\n </bento-typography>\n <div class=\"b-inspector__icons\">\n <bento-button v-if=\"expandable\" variant=\"tertiary\" @click=\"emit('expand')\">\n <template #iconLeft><expand-icon :svg-title=\"t('expand')\"></expand-icon></template>\n </bento-button>\n <bento-button variant=\"tertiary\" @click=\"emit('update:is-open', false)\">\n <template #iconLeft><cross-icon :svg-title=\"t('close')\"></cross-icon></template>\n </bento-button>\n </div>\n </div>\n <div class=\"b-inspector__content\">\n <bento-loading-indicator v-if=\"loading\" large class=\"b-inspector__loading-indicator\" />\n <slot v-else name=\"content\" />\n </div>\n </div>\n </bento-focus-trap>\n </aside>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, ref, watch } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoButton } from '@/components/button';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import ExpandIcon from '@adyen/ui-assets-icons-16/vue/expand';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { generateUid } from '@/core/utils/ts';\n import { useI18n } from '@/utils/ts/i18n';\n import { deprecate } from '@/utils/ts/deprecate';\n import { getNextFocusableElement } from '@/utils/ts/focus-trap.utils';\n import { useElementSize } from '@vueuse/core';\n import moveFocusInside, { focusInside, getActiveElement } from 'focus-lock';\n\n import { type BentoInspectorProps } from './inspector.types';\n import { useFocusHistory } from './composables/use-focus-history/use-focus-history';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(defineProps<BentoInspectorProps>(), {\n activePage: '',\n expandable: false,\n isOpen: false,\n loading: false,\n size: 'small',\n relativeLayout: 'push-content',\n pageFocusAnchor: null,\n });\n\n const emit = defineEmits<{\n /**\n * Emits update to keep isOpen prop in sync\n */\n (e: 'update:is-open', value: boolean): void;\n /**\n * Emits update to keep activePage prop in sync\n */\n (e: 'update:active-page', value: string): void;\n /**\n * Emits event when user click expand button\n */\n (e: 'expand'): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const returnToMainContentDescriptionId = generateUid('returnToMainContentDescription');\n const wrapper = ref<HTMLElement>(null);\n const inspector = ref<HTMLElement>(null);\n const page = ref<HTMLElement>(null);\n const inspectorLastFocusedElement = ref<HTMLElement>(null);\n\n const { width: wrapperWidth } = useElementSize(wrapper);\n\n const isCompact = computed(() => {\n const COMPACT_THRESHOLD_SMALL = 740;\n const COMPACT_THRESHOLD_LARGE = 915;\n\n // small inspector to occupy full screen if < 740px\n // large inspector to occupy full screen if < 915px\n const threshold = props.size === 'small' ? COMPACT_THRESHOLD_SMALL : COMPACT_THRESHOLD_LARGE;\n\n return wrapperWidth.value > 0 && wrapperWidth.value < threshold;\n });\n\n const computedPageLastFocusedElement = computed(() => props.pageFocusAnchor);\n\n const conditionalClass = computed(() => ({\n [`b-inspector--${props.size}`]: true,\n [`b-inspector--${props.relativeLayout}`]: true,\n [`b-inspector--is-compact`]: isCompact.value,\n }));\n\n const inspectorAriaLabel = computed(() => `${t('inspector')}, ${props.title}`);\n\n const { findValidFocusFallback } = useFocusHistory(page);\n\n const setFocus = async () => {\n if (props.isOpen) {\n await nextTick();\n moveFocusInside(inspector.value, computedPageLastFocusedElement.value);\n } else {\n // This doesn't work with data grid cell actions, as the button gets destroyed once is not being hovered.\n // To be reviewed after LevelAccess revision\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n }\n };\n\n const handleTabNavigation = event => {\n if (isCompact.value) {\n return;\n }\n const direction = event.shiftKey ? -1 : 1;\n const focusableEl = getNextFocusableElement(direction, inspector.value);\n // If the nextfocusableEl is the same as the activeElement that means it's the last focusable element\n // inside the inspector, so the focus is moved back to the last focused element on the page\n if (getActiveElement() === focusableEl) {\n event.preventDefault();\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n }\n };\n\n const handleSectionFocus = event => {\n const sectionShortcut = event.shiftKey && event.ctrlKey && event.key === 'S';\n if (props.isOpen && !isCompact.value && sectionShortcut) {\n moveFocusBetweenSections();\n }\n };\n\n const moveFocusBetweenSections = () => {\n if (focusInside(inspector.value)) {\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n } else {\n focusElement(inspectorLastFocusedElement.value);\n }\n };\n\n const focusElement = (element: HTMLElement) => {\n if (!element) {\n return;\n }\n element?.focus();\n if (document.activeElement !== element) {\n focusElement(element.parentElement);\n }\n };\n\n watch(\n () => props.activePage,\n () => {\n if (props.activePage) {\n setFocus();\n }\n }\n );\n\n if (!props.activePage) {\n deprecate(\n 'BentoInspector \"active-page\" as optional',\n `Make sure to set the \"active-page\" prop and keep it in sync with \"update:active-page\".\n \"active-page\" prop will be required in the next version`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Inspector allows users to access additional information or details of an object/item. The inspector opens adjacent to the main content, pushing it aside to maintain visibility and accessibility to both the main content and inspector.\n *\n * @example\n * import { BentoInspector } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoInspector },\n * template: `\n * <bento-inspector\n * title=\"Inspector\"\n * size=\"large\"\n * :is-open=\"isOpen\"\n * :active-page=\"activePage\"\n * expandable\n * @update:is-open=\"isOpen = $event\"\n * @update:active-page=\"activePage = $event\"\n * >\n * <template #page>Content of the page</template>\n * <template #content>Content of the inspector</template>\n * </bento-inspector>\n * `\n * }\n */\n export default { i18n: { messages } };\n</script>\n\n<style lang=\"scss\" scoped src=\"./inspector.scss\" />\n"],"names":["useFocusHistory","targetEl","focusHistory","ref","currentActiveElement","useActiveElement","watch","newlyFocusedElement","el","__default__","messages","props","__props","emit","__emit","t","useI18n","returnToMainContentDescriptionId","generateUid","wrapper","inspector","page","inspectorLastFocusedElement","wrapperWidth","useElementSize","isCompact","computed","threshold","computedPageLastFocusedElement","conditionalClass","inspectorAriaLabel","findValidFocusFallback","setFocus$1","nextTick","setFocus","focusElement","handleTabNavigation","event","direction","focusableEl","getNextFocusableElement","getActiveElement","handleSectionFocus","sectionShortcut","moveFocusBetweenSections","focusInside","element","deprecate"],"mappings":"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"}
|
|
@@ -2,7 +2,7 @@ import { defineComponent as f, computed as b, openBlock as e, createBlock as n,
|
|
|
2
2
|
import { _ as y } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
3
3
|
import { C as E } from "./chevron-right-small.BCinNiMt.js";
|
|
4
4
|
import { B as N } from "./status.H00BAmRx.js";
|
|
5
|
-
import { B as V } from "./tag.
|
|
5
|
+
import { B as V } from "./tag.YN2r-Pp3.js";
|
|
6
6
|
import { B as v } from "./typography.B3J6_tYk.js";
|
|
7
7
|
import { u as x } from "./use-has-slot.CyMiImRQ.js";
|
|
8
8
|
import "../assets/list-item.css";
|
|
@@ -125,4 +125,4 @@ export {
|
|
|
125
125
|
tt as a,
|
|
126
126
|
Z as l
|
|
127
127
|
};
|
|
128
|
-
//# sourceMappingURL=list-item.
|
|
128
|
+
//# sourceMappingURL=list-item.BHvXpqaS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item.
|
|
1
|
+
{"version":3,"file":"list-item.BHvXpqaS.js","sources":["../../../vue2/src/components/list/list.vue","../../../vue2/src/components/list/components/list-item/list-item.vue"],"sourcesContent":["<template>\n <component :is=\"listElement\" class=\"b-list\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed } from 'vue';\n import type { BentoListProps } from './list.types';\n\n const props = withDefaults(defineProps<BentoListProps>(), {\n type: 'unordered',\n });\n\n const listElement = computed(() => (props.type === 'ordered' ? 'ol' : 'ul'));\n</script>\n\n<script lang=\"ts\">\n /**\n * `BentoList` renders an ordered or unordered list container for `BentoListItem` rows.\n *\n * @example\n * import { BentoList, BentoListItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoList, BentoListItem },\n * template: `\n * <bento-list>\n * <bento-list-item\n * label=\"Payment details\"\n * description=\"Updated 2 hours ago\"\n * :tag=\"{ label: 'Live', variant: 'green' }\"\n * show-bottom-divider\n * />\n * <bento-list-item\n * label=\"Risk configuration\"\n * description=\"Updated yesterday\"\n * :tag=\"{ label: 'Review', variant: 'orange' }\"\n * />\n * </bento-list>\n * `\n * }\n */\n export default {\n name: 'bento-list',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./list.scss\" />\n","<template>\n <li class=\"b-list-item\" @click=\"onItemClick\" @keydown=\"onItemKeydown\">\n <bento-typography\n class=\"b-list-item__inner\"\n :class=\"conditionalClasses\"\n el=\"div\"\n :role=\"props.withChevron ? 'button' : undefined\"\n :tabindex=\"props.withChevron ? 0 : undefined\"\n >\n <div v-if=\"hasSlot('image')\" class=\"b-list-item__image\">\n <slot name=\"image\" />\n </div>\n\n <div v-if=\"hasSlot('start')\" class=\"b-list-item__start\">\n <slot name=\"start\" />\n </div>\n\n <div class=\"b-list-item__content\">\n <div v-if=\"hasSlot('content')\" class=\"b-list-item__label\">\n <slot name=\"content\" />\n </div>\n\n <template v-else>\n <div class=\"b-list-item__header\">\n <bento-typography v-if=\"props.label\" class=\"b-list-item__label\" el=\"span\" stronger>\n {{ props.label }}\n </bento-typography>\n <bento-status\n v-if=\"props.showStatus\"\n class=\"b-list-item__status\"\n :variant=\"props.statusColor\"\n aria-hidden=\"true\"\n />\n <bento-tag v-if=\"props.tag\" v-bind=\"props.tag\" class=\"b-list-item__tag\" />\n </div>\n <span v-if=\"props.description\" class=\"b-list-item__description\">\n {{ props.description }}\n </span>\n </template>\n </div>\n\n <div v-if=\"hasSlot('end')\" class=\"b-list-item__end\">\n <slot name=\"end\" />\n </div>\n\n <chevron-right-icon v-if=\"props.withChevron\" class=\"b-list-item__chevron\" aria-hidden=\"true\" />\n </bento-typography>\n </li>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useSlots } from 'vue';\n import ChevronRightIcon from '@adyen/ui-assets-icons-16/vue/chevron-right-small';\n import { BentoStatus } from '@/components/status';\n import { BentoTag } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import type { BentoListItemProps } from './list-item.types';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const props = withDefaults(defineProps<BentoListItemProps>(), {\n showStatus: false,\n statusColor: 'blue',\n tag: undefined,\n withChevron: false,\n showTopDivider: false,\n showBottomDivider: false,\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when a clickable list item is triggered.\n */\n (e: 'click'): void;\n }>();\n\n const onItemClick = (): void => {\n if (!props.withChevron) {\n return;\n }\n emit('click');\n };\n\n const onItemKeydown = (event: KeyboardEvent): void => {\n if (!props.withChevron) {\n return;\n }\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n emit('click');\n }\n };\n\n const conditionalClasses = computed(() => ({\n 'b-list-item__inner--clickable': props.withChevron,\n 'b-list-item__inner--top-divider': props.showTopDivider,\n 'b-list-item__inner--bottom-divider': props.showBottomDivider,\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * `BentoListItem` renders an item to be used inside `BentoList`.\n *\n * @example\n * import { BentoList, BentoListItem, BentoButton, BentoToggle } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoList, BentoListItem, BentoButton, BentoToggle },\n * template: `\n * <bento-list>\n * <bento-list-item\n * label=\"Payment details\"\n * description=\"Updated 2 hours ago\"\n * :tag=\"{ label: 'Live', variant: 'green' }\"\n * show-bottom-divider\n * >\n * <template #start>\n * <bento-toggle />\n * </template>\n * <template #end>\n * <bento-button variant=\"secondary\">Edit</bento-button>\n * </template>\n * </bento-list-item>\n * </bento-list>\n * `\n * }\n */\n\n export default {\n name: 'bento-list-item',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./list-item.scss\" />\n"],"names":["__default__$1","props","__props","listElement","computed","__default__","slots","useSlots","hasSlot","useHasSlot","emit","__emit","onItemClick","onItemKeydown","event","conditionalClasses"],"mappings":";;;;;;;;AA2CI,MAAAA,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;AAnCA,UAAAC,IAAAC,GAIAC,IAAAC,EAAA,MAAAH,EAAA,SAAA,YAAA,OAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;GCqHAI,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;AA1EA,UAAAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAL,IAAAC,GASAQ,IAAAC,GAOAC,IAAA,MAAA;AACI,MAAAX,EAAA,eAGAS,EAAA,OAAA;AAAA,IAAY,GAGhBG,IAAA,CAAAC,MAAA;AACI,MAAAb,EAAA,gBAGAa,EAAA,QAAA,WAAAA,EAAA,QAAA,SACIA,EAAA,eAAA,GACAJ,EAAA,OAAA;AAAA,IACJ,GAGJK,IAAAX,EAAA,OAAA;AAAA,MAA2C,iCAAAH,EAAA;AAAA,MACA,mCAAAA,EAAA;AAAA,MACE,sCAAAA,EAAA;AAAA,IACG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as r, computed as i, resolveComponent as t, openBlock as e, createElementBlock as s, createElementVNode as l, createVNode as c, createBlock as m, withCtx as _, createTextVNode as b, toDisplayString as d, createCommentVNode as g } from "vue";
|
|
2
|
-
import { B as f } from "./tag.
|
|
2
|
+
import { B as f } from "./tag.YN2r-Pp3.js";
|
|
3
3
|
import { B as u } from "./typography.B3J6_tYk.js";
|
|
4
4
|
import { _ as h } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
5
5
|
import "../assets/listbox-option-tag.css";
|
|
@@ -54,4 +54,4 @@ const O = /* @__PURE__ */ h(y, [["render", x], ["__scopeId", "data-v-f55ef3b1"]]
|
|
|
54
54
|
export {
|
|
55
55
|
O as L
|
|
56
56
|
};
|
|
57
|
-
//# sourceMappingURL=listbox-option-tag.
|
|
57
|
+
//# sourceMappingURL=listbox-option-tag.CVxaZqbc.js.map
|
package/dist/chunks/{listbox-option-tag.Cvplth7d.js.map → listbox-option-tag.CVxaZqbc.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listbox-option-tag.
|
|
1
|
+
{"version":3,"file":"listbox-option-tag.CVxaZqbc.js","sources":["../../../vue2/src/components/internal/listbox/components/listbox-option-tag/listbox-option-tag.vue"],"sourcesContent":["<template>\n <span class=\"b-listbox-tag-option\">\n <span :aria-hidden=\"!!option.label\">\n <bento-tag class=\"b-listbox-tag-option__tag\" :label=\"option.value.toString()\" :variant=\"variant\" />\n </span>\n <bento-typography v-if=\"option.label\" el=\"span\" class=\"b-listbox-tag-option__label\">\n {{ option.label }}\n </bento-typography>\n </span>\n</template>\n<script lang=\"ts\">\n import { computed, defineComponent, type PropType } from 'vue';\n import type { BentoListboxOptionItem } from '@/types/listbox';\n import { BentoTag, type BentoTagVariant } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n\n /**\n * A Tag Dropdown option item used in the Dropdown and Filter components.\n */\n export default defineComponent({\n name: 'listbox-tag-option',\n components: {\n BentoTag,\n BentoTypography,\n },\n props: {\n /**\n * The option item that contains all the option item's data.\n * @type {BentoListboxOptionItem}\n */\n option: {\n type: Object as PropType<BentoListboxOptionItem>,\n required: true,\n },\n },\n setup(props) {\n const variant = computed(() => props.option.data as BentoTagVariant);\n\n return {\n // Values\n variant,\n };\n },\n });\n</script>\n<style lang=\"scss\" scoped src=\"./listbox-option-tag.scss\" />\n"],"names":["_sfc_main","defineComponent","BentoTag","BentoTypography","props","computed","openBlock","createElementBlock","_hoisted_1","createElementVNode","_ctx","_hoisted_2","createTextVNode","toDisplayString","createCommentVNode"],"mappings":";;;;;AAmBI,MAAAA,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAAA,EACrB,YAAA;AAAA,IACM,UAAAC;AAAA,IACR,iBAAAC;AAAA,EACA;AAAA,EACJ,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IACO,QAAA;AAAA,MAKK,MAAA;AAAA,MACE,UAAA;AAAA,IACI;AAAA,EACd;AAAA,EACJ,MAAAC,GAAA;AAII,WAAA;AAAA;AAAA,MAAO,SAFPC,EAAA,MAAAD,EAAA,OAAA,IAAA;AAAA,IAII;AAAA,EACJ;AAER,CAAA;;;AAzCW,SAAAE,EAAA,GAAAC,EAAA,QAAAC,GAAA;AAAA,IAA2BC,EAAA,QAAA;AAAA;IACqE,GAAA;AAAA;QAAzB,OAAA;AAAA,QAAY,OAAAC,EAAA,OAAA,MAAA,SAAA;AAAA,QAHlG,SAAAA,EAAA;AAAA,MAAA,GAAA,MAAA,GAAA,CAAA,SAAA,SAAA,CAAA;AAAA,IAK4C,GAAA,GAAAC,CAAA;AAAA;MAAW,KAAA;AAAA,MAAM,IAAA;AAAA,MAL7D,OAAA;AAAA,IAAA,GAAA;AAAA;QAAAC,EAAAC,EAAAH,EAAA,OAAA,KAAA,GAAA,CAAA;AAAA,MAAA,CAAA;AAAA,MAAA,GAAA;AAAA,IAAA,CAAA,KAAAI,EAAA,IAAA,EAAA;AAAA;;;"}
|