@adyen/bento-vue3 1.88.1 → 1.89.2
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 +4 -0
- package/dist/@types/index.d.ts +722 -524
- 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/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/card.css +1 -1
- package/dist/assets/checkbox-input.css +1 -1
- package/dist/assets/data-grid-template.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/list-item.css +1 -0
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/radio-input.css +1 -1
- package/dist/assets/selection-card-group.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/timeline-item.css +1 -1
- package/dist/assets/use-cached-selected-values.css +1 -1
- package/dist/button.js +3 -3
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chip.js +1 -1
- package/dist/chunks/{accordion-item.QQ06tTjt.js → accordion-item.BX1KrLMl.js} +6 -15
- package/dist/chunks/{accordion-item.QQ06tTjt.js.map → accordion-item.BX1KrLMl.js.map} +1 -1
- package/dist/chunks/{action-bar.BS2cJzG_.js → action-bar.DLMaIUWW.js} +8 -34
- package/dist/chunks/{action-bar.BS2cJzG_.js.map → action-bar.DLMaIUWW.js.map} +1 -1
- package/dist/chunks/{ai-button.XfeGC4-Q.js → ai-button.1YJdI-sw.js} +3 -3
- package/dist/chunks/{ai-button.XfeGC4-Q.js.map → ai-button.1YJdI-sw.js.map} +1 -1
- package/dist/chunks/{ai-tag.DVCW-_vD.js → ai-tag.DK63ExDc.js} +6 -15
- package/dist/chunks/{ai-tag.DVCW-_vD.js.map → ai-tag.DK63ExDc.js.map} +1 -1
- package/dist/chunks/{alert.CDWtu0Hu.js → alert.C_8-VNi_.js} +6 -24
- package/dist/chunks/{alert.CDWtu0Hu.js.map → alert.C_8-VNi_.js.map} +1 -1
- package/dist/chunks/anchor-scroller.NhjLDBZI.js +207 -0
- package/dist/chunks/{anchor-scroller.BctgW0se.js.map → anchor-scroller.NhjLDBZI.js.map} +1 -1
- package/dist/chunks/{base-button.CRYAiuzn.js → base-button.CvHl36Ue.js} +24 -27
- package/dist/chunks/{base-button.CRYAiuzn.js.map → base-button.CvHl36Ue.js.map} +1 -1
- package/dist/chunks/base-modal.C2-JyHC_.js +424 -0
- package/dist/chunks/{base-modal.gZAtk-xP.js.map → base-modal.C2-JyHC_.js.map} +1 -1
- package/dist/chunks/button-actions-with-menu.BQFAgAI2.js +85 -0
- package/dist/chunks/{button-actions-with-menu.Tba1ME79.js.map → button-actions-with-menu.BQFAgAI2.js.map} +1 -1
- package/dist/chunks/{button-actions.BYBpjNqy.js → button-actions.cMQWyZne.js} +511 -542
- package/dist/chunks/{button-actions.BYBpjNqy.js.map → button-actions.cMQWyZne.js.map} +1 -1
- package/dist/chunks/{button.C6t9_lzm.js → button.DWF7FSIw.js} +42 -45
- package/dist/chunks/{button.C6t9_lzm.js.map → button.DWF7FSIw.js.map} +1 -1
- package/dist/chunks/calendar.DcCqkSNJ.js +1201 -0
- package/dist/chunks/{calendar.vM3abC8y.js.map → calendar.DcCqkSNJ.js.map} +1 -1
- package/dist/chunks/{card.Cw63i7Ul.js → card.CoxQ_L0w.js} +9 -21
- package/dist/chunks/{card.Cw63i7Ul.js.map → card.CoxQ_L0w.js.map} +1 -1
- package/dist/chunks/{checkbox-group.ODQy-ICn.js → checkbox-group.96n9Cc3W.js} +5 -5
- package/dist/chunks/{checkbox-group.ODQy-ICn.js.map → checkbox-group.96n9Cc3W.js.map} +1 -1
- package/dist/chunks/{checkbox-input.BZjSoCQW.js → checkbox-input.CVFQCfZM.js} +44 -51
- package/dist/chunks/{checkbox-input.BZjSoCQW.js.map → checkbox-input.CVFQCfZM.js.map} +1 -1
- package/dist/chunks/{checkbox.C3Ewfygy.js → checkbox.C6ATh8f5.js} +85 -94
- package/dist/chunks/{checkbox.C3Ewfygy.js.map → checkbox.C6ATh8f5.js.map} +1 -1
- package/dist/chunks/chevron-right-small.BCinNiMt.js +29 -0
- package/dist/chunks/chevron-right-small.BCinNiMt.js.map +1 -0
- package/dist/chunks/{chip.CyW1V8RU.js → chip.CdgpQyXN.js} +6 -12
- package/dist/chunks/{chip.CyW1V8RU.js.map → chip.CdgpQyXN.js.map} +1 -1
- package/dist/chunks/click-outside.BPylIosK.js +20 -0
- package/dist/chunks/{click-outside.CDz_x8mN.js.map → click-outside.BPylIosK.js.map} +1 -1
- package/dist/chunks/{code-snippet.BaJU2I5_.js → code-snippet.DgAuuZF5.js} +9 -24
- package/dist/chunks/{code-snippet.BaJU2I5_.js.map → code-snippet.DgAuuZF5.js.map} +1 -1
- package/dist/chunks/{codemirror.D2BAltnu.js → codemirror.Bzus_EPG.js} +15 -15
- package/dist/chunks/{codemirror.D2BAltnu.js.map → codemirror.Bzus_EPG.js.map} +1 -1
- package/dist/chunks/constructNow.D9uRk678.js +8 -0
- package/dist/chunks/{constructNow.CIc7d13I.js.map → constructNow.D9uRk678.js.map} +1 -1
- package/dist/chunks/{controls-group.Bu5lNTyH.js → controls-group.C7hOE1F4.js} +3 -3
- package/dist/chunks/{controls-group.Bu5lNTyH.js.map → controls-group.C7hOE1F4.js.map} +1 -1
- package/dist/chunks/{copy.C_BCNHYQ.js → copy.C2kQ1PbI.js} +7 -19
- package/dist/chunks/{copy.C_BCNHYQ.js.map → copy.C2kQ1PbI.js.map} +1 -1
- package/dist/chunks/{country.DJts6kCv.js → country.CaGc08Ps.js} +3 -3
- package/dist/chunks/{country.DJts6kCv.js.map → country.CaGc08Ps.js.map} +1 -1
- package/dist/chunks/country.types.DjpMGz7a.js +19 -0
- package/dist/chunks/{country.types.BBQbWkTY.js.map → country.types.DjpMGz7a.js.map} +1 -1
- package/dist/chunks/{currency.Afx8MVdY.js → currency.DuTEzR_W.js} +40 -42
- package/dist/chunks/{currency.Afx8MVdY.js.map → currency.DuTEzR_W.js.map} +1 -1
- package/dist/chunks/dashboard-section.UafHRkMa.js +161 -0
- package/dist/chunks/{dashboard-section.CgoLquLP.js.map → dashboard-section.UafHRkMa.js.map} +1 -1
- package/dist/chunks/dashed-underline.CcDV2Aks.js +108 -0
- package/dist/chunks/{dashed-underline.wbRHATeE.js.map → dashed-underline.CcDV2Aks.js.map} +1 -1
- package/dist/chunks/data-grid-template.CnC4TQvk.js +135 -0
- package/dist/chunks/{data-grid-template.D40V1cmi.js.map → data-grid-template.CnC4TQvk.js.map} +1 -1
- package/dist/chunks/data-grid.BSIXLRm7.js +4014 -0
- package/dist/chunks/{data-grid.C2nCCbeC.js.map → data-grid.BSIXLRm7.js.map} +1 -1
- package/dist/chunks/date-picker.dlzZ_-5f.js +231 -0
- package/dist/chunks/{date-picker.D5B_SECc.js.map → date-picker.dlzZ_-5f.js.map} +1 -1
- package/dist/chunks/date-range-picker.DC6CK0As.js +995 -0
- package/dist/chunks/{date-range-picker.B0q7Z4df.js.map → date-range-picker.DC6CK0As.js.map} +1 -1
- package/dist/chunks/{date.BtB1HyWQ.js → date.R2Wz6o7J.js} +28 -28
- package/dist/chunks/{date.BtB1HyWQ.js.map → date.R2Wz6o7J.js.map} +1 -1
- package/dist/chunks/{de.BJvo6njq.js → de.DXrHnkLX.js} +18 -18
- package/dist/chunks/{de.BJvo6njq.js.map → de.DXrHnkLX.js.map} +1 -1
- package/dist/chunks/{dialog-page.C1KUI51V.js → dialog-page.COfKqjT-.js} +7 -13
- package/dist/chunks/{dialog-page.C1KUI51V.js.map → dialog-page.COfKqjT-.js.map} +1 -1
- package/dist/chunks/differenceInMonths.s_znQQpw.js +43 -0
- package/dist/chunks/{differenceInMonths.CIYECBxK.js.map → differenceInMonths.s_znQQpw.js.map} +1 -1
- package/dist/chunks/{directive.rXUeDb8p.js → directive.Dpivxq_t.js} +2 -2
- package/dist/chunks/{directive.rXUeDb8p.js.map → directive.Dpivxq_t.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.CskseEho.js → dropdown-default-textbox.bq9AlGzJ.js} +55 -64
- package/dist/chunks/{dropdown-default-textbox.CskseEho.js.map → dropdown-default-textbox.bq9AlGzJ.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.Zj-exiup.js → dropdown-tag.Ysrac5GN.js} +82 -86
- package/dist/chunks/{dropdown-tag.Zj-exiup.js.map → dropdown-tag.Ysrac5GN.js.map} +1 -1
- package/dist/chunks/dropdown.MhmX1P9o.js +799 -0
- package/dist/chunks/{dropdown.CxjzXI-k.js.map → dropdown.MhmX1P9o.js.map} +1 -1
- package/dist/chunks/{empty-state.DqdPzU-g.js → empty-state.DT4sFyjB.js} +7 -14
- package/dist/chunks/{empty-state.DqdPzU-g.js.map → empty-state.DT4sFyjB.js.map} +1 -1
- package/dist/chunks/{en-GB.C3-QUpva.js → en-GB.CBpvhDYV.js} +2 -2
- package/dist/chunks/{en-GB.C3-QUpva.js.map → en-GB.CBpvhDYV.js.map} +1 -1
- package/dist/chunks/{en-US.YeSsZuOc.js → en-US.CCazFVNP.js} +30 -30
- package/dist/chunks/{en-US.YeSsZuOc.js.map → en-US.CCazFVNP.js.map} +1 -1
- package/dist/chunks/{error-message.oGiefI2-.js → error-message.DCgo8q20.js} +8 -20
- package/dist/chunks/{error-message.oGiefI2-.js.map → error-message.DCgo8q20.js.map} +1 -1
- package/dist/chunks/{es.DyUjjSL8.js → es.CoF2PB8b.js} +14 -14
- package/dist/chunks/{es.DyUjjSL8.js.map → es.CoF2PB8b.js.map} +1 -1
- package/dist/chunks/{file-uploader.BnmNI1O7.js → file-uploader.Bfd1uUMe.js} +575 -680
- package/dist/chunks/{file-uploader.BnmNI1O7.js.map → file-uploader.Bfd1uUMe.js.map} +1 -1
- package/dist/chunks/filter-bar.CkAjLQol.js +3675 -0
- package/dist/chunks/filter-bar.CkAjLQol.js.map +1 -0
- package/dist/chunks/fixed-scroller.DtkaGyMD.js +150 -0
- package/dist/chunks/{fixed-scroller.i1tmEmst.js.map → fixed-scroller.DtkaGyMD.js.map} +1 -1
- package/dist/chunks/{focus-trap.BxCwzLqN.js → focus-trap.BAiM_ywb.js} +70 -86
- package/dist/chunks/{focus-trap.BxCwzLqN.js.map → focus-trap.BAiM_ywb.js.map} +1 -1
- package/dist/chunks/{footer-actions.Ck6UztD8.js → footer-actions.BcYSsoUg.js} +3 -3
- package/dist/chunks/{footer-actions.Ck6UztD8.js.map → footer-actions.BcYSsoUg.js.map} +1 -1
- package/dist/chunks/{form-layout-title.CQfeGyVw.js → form-layout-title.DW5Kg1rh.js} +4 -6
- package/dist/chunks/{form-layout-title.CQfeGyVw.js.map → form-layout-title.DW5Kg1rh.js.map} +1 -1
- package/dist/chunks/{fr.JD_4GwS8.js → fr.CJXL-Ief.js} +16 -16
- package/dist/chunks/{fr.JD_4GwS8.js.map → fr.CJXL-Ief.js.map} +1 -1
- package/dist/chunks/{generate-uid.NJ8tVoha.js → generate-uid.DBWe4g6T.js} +15 -16
- package/dist/chunks/{generate-uid.NJ8tVoha.js.map → generate-uid.DBWe4g6T.js.map} +1 -1
- package/dist/chunks/get-slot-text.8Fbl1GOr.js +6 -0
- package/dist/chunks/{get-slot-text.CQRAP2_q.js.map → get-slot-text.8Fbl1GOr.js.map} +1 -1
- package/dist/chunks/{grid-layout.Vhv1_zFs.js → grid-layout.CCWNscU_.js} +11 -12
- package/dist/chunks/{grid-layout.Vhv1_zFs.js.map → grid-layout.CCWNscU_.js.map} +1 -1
- package/dist/chunks/{header-meta.lGt3HsyH.js → header-meta.Bym9AlQm.js} +84 -96
- package/dist/chunks/{header-meta.lGt3HsyH.js.map → header-meta.Bym9AlQm.js.map} +1 -1
- package/dist/chunks/{header-with-views.D_sy4I2A.js → header-with-views.Djba6iol.js} +1013 -1156
- package/dist/chunks/{header-with-views.D_sy4I2A.js.map → header-with-views.Djba6iol.js.map} +1 -1
- package/dist/chunks/{header.oXqwf2xN.js → header.o-7SyHtU.js} +4 -4
- package/dist/chunks/{header.oXqwf2xN.js.map → header.o-7SyHtU.js.map} +1 -1
- package/dist/chunks/{index.Dppy4qHk.js → index.DDwcHPb6.js} +12 -12
- package/dist/chunks/{index.Dppy4qHk.js.map → index.DDwcHPb6.js.map} +1 -1
- package/dist/chunks/{info-icon.DyPOv7Pi.js → info-icon.BUala_wq.js} +3 -3
- package/dist/chunks/{info-icon.DyPOv7Pi.js.map → info-icon.BUala_wq.js.map} +1 -1
- package/dist/chunks/input-field-password.DZytmp_p.js +346 -0
- package/dist/chunks/{input-field-password.C_h61CMn.js.map → input-field-password.DZytmp_p.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.KctRYA9p.js → input-field-phone-number.CxblrmaU.js} +720 -736
- package/dist/chunks/{input-field-phone-number.KctRYA9p.js.map → input-field-phone-number.CxblrmaU.js.map} +1 -1
- package/dist/chunks/{input-field.DPElUS0U.js → input-field.CfU0ZKtL.js} +42 -54
- package/dist/chunks/{input-field.DPElUS0U.js.map → input-field.CfU0ZKtL.js.map} +1 -1
- package/dist/chunks/{inspector.BjLhY3bE.js → inspector.B9k4tJWe.js} +9 -27
- package/dist/chunks/{inspector.BjLhY3bE.js.map → inspector.B9k4tJWe.js.map} +1 -1
- package/dist/chunks/isSameWeek.Dj6luS8h.js +14 -0
- package/dist/chunks/{isSameWeek.CzBCmu7d.js.map → isSameWeek.Dj6luS8h.js.map} +1 -1
- package/dist/chunks/{it.BlUnV-yA.js → it.20Y7h-bF.js} +8 -8
- package/dist/chunks/{it.BlUnV-yA.js.map → it.20Y7h-bF.js.map} +1 -1
- package/dist/chunks/{ja.nUwDmVf2.js → ja.DXlq0H98.js} +27 -27
- package/dist/chunks/{ja.nUwDmVf2.js.map → ja.DXlq0H98.js.map} +1 -1
- package/dist/chunks/layout-row.B5VJGEQH.js +99 -0
- package/dist/chunks/{layout-row.Da8nkm9z.js.map → layout-row.B5VJGEQH.js.map} +1 -1
- package/dist/chunks/link.D6D6YGsN.js +113 -0
- package/dist/chunks/{link.DTCn2EtX.js.map → link.D6D6YGsN.js.map} +1 -1
- package/dist/chunks/list-item.DO5uULke.js +128 -0
- package/dist/chunks/list-item.DO5uULke.js.map +1 -0
- package/dist/chunks/{listbox-option-tag.CoBUYwFG.js → listbox-option-tag.Cvplth7d.js} +2 -2
- package/dist/chunks/{listbox-option-tag.CoBUYwFG.js.map → listbox-option-tag.Cvplth7d.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.9ZDR_S29.js → modal-fullscreen.CuKVyTWb.js} +100 -108
- package/dist/chunks/{modal-fullscreen.9ZDR_S29.js.map → modal-fullscreen.CuKVyTWb.js.map} +1 -1
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.B0IdwV0R.js → modal.vue_vue_type_script_setup_true_lang.DmPw0l5Y.js} +134 -143
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.B0IdwV0R.js.map → modal.vue_vue_type_script_setup_true_lang.DmPw0l5Y.js.map} +1 -1
- package/dist/chunks/on-click-outside.ZUMLlxE_.js +90 -0
- package/dist/chunks/{on-click-outside.BW4rkhzG.js.map → on-click-outside.ZUMLlxE_.js.map} +1 -1
- package/dist/chunks/pagination.dpVc6Yt0.js +401 -0
- package/dist/chunks/pagination.dpVc6Yt0.js.map +1 -0
- package/dist/chunks/popover.types.D8tHtFl3.js +6 -0
- package/dist/chunks/{popover.types.DhALnOLQ.js.map → popover.types.D8tHtFl3.js.map} +1 -1
- package/dist/chunks/{popper-container.DAK7c9uS.js → popper-container.DMN8n5iC.js} +79 -86
- package/dist/chunks/{popper-container.DAK7c9uS.js.map → popper-container.DMN8n5iC.js.map} +1 -1
- package/dist/chunks/{promo-banner.aNwH6uQx.js → promo-banner.BzveHNOI.js} +7 -13
- package/dist/chunks/{promo-banner.aNwH6uQx.js.map → promo-banner.BzveHNOI.js.map} +1 -1
- package/dist/chunks/{pt-BR.BCU2Hj36.js → pt-BR.DmhmCzxE.js} +14 -14
- package/dist/chunks/{pt-BR.BCU2Hj36.js.map → pt-BR.DmhmCzxE.js.map} +1 -1
- package/dist/chunks/{radio-group.DEYzF6o7.js → radio-group.Cuiq4mxy.js} +46 -46
- package/dist/chunks/{radio-group.DEYzF6o7.js.map → radio-group.Cuiq4mxy.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.DH1d5Zcp.js → rich-text-editor.DLMiT4f5.js} +1018 -1024
- package/dist/chunks/{rich-text-editor.DH1d5Zcp.js.map → rich-text-editor.DLMiT4f5.js.map} +1 -1
- package/dist/chunks/{search-bar.Dtzx88Pv.js → search-bar.CsFyP0_I.js} +6 -15
- package/dist/chunks/{search-bar.Dtzx88Pv.js.map → search-bar.CsFyP0_I.js.map} +1 -1
- package/dist/chunks/{secondary-nav.Zs7dBoJv.js → secondary-nav.CLBdq98c.js} +6 -12
- package/dist/chunks/{secondary-nav.Zs7dBoJv.js.map → secondary-nav.CLBdq98c.js.map} +1 -1
- package/dist/chunks/{segmented-control.Aqquod8g.js → segmented-control.KeQ5kuR1.js} +47 -51
- package/dist/chunks/{segmented-control.Aqquod8g.js.map → segmented-control.KeQ5kuR1.js.map} +1 -1
- package/dist/chunks/selection-card-group.XM11Kk-4.js +412 -0
- package/dist/chunks/{selection-card-group.C7IK2Vl5.js.map → selection-card-group.XM11Kk-4.js.map} +1 -1
- package/dist/chunks/{sidepanel.DaXPcTHm.js → sidepanel.b2QZ1Jsx.js} +64 -71
- package/dist/chunks/{sidepanel.DaXPcTHm.js.map → sidepanel.b2QZ1Jsx.js.map} +1 -1
- package/dist/chunks/startOfWeek.Cvmo-f5J.js +9 -0
- package/dist/chunks/{startOfWeek.CXhhX-R7.js.map → startOfWeek.Cvmo-f5J.js.map} +1 -1
- package/dist/chunks/status.H00BAmRx.js +42 -0
- package/dist/chunks/status.H00BAmRx.js.map +1 -0
- package/dist/chunks/status.types.Dx8MDhEH.js +5 -0
- package/dist/chunks/status.types.Dx8MDhEH.js.map +1 -0
- package/dist/chunks/{step.BV7MsrRF.js → step.BlwoLfdw.js} +56 -68
- package/dist/chunks/{step.BV7MsrRF.js.map → step.BlwoLfdw.js.map} +1 -1
- package/dist/chunks/{structured-list-item.DAIaUMCY.js → structured-list-item.e-8kRleh.js} +8 -14
- package/dist/chunks/{structured-list-item.DAIaUMCY.js.map → structured-list-item.e-8kRleh.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.BZcZS_dW.js → summary-grid.types.CcvOC03H.js} +172 -179
- package/dist/chunks/{summary-grid.types.BZcZS_dW.js.map → summary-grid.types.CcvOC03H.js.map} +1 -1
- package/dist/chunks/tab.mR5uUSdp.js +265 -0
- package/dist/chunks/{tab.DRrnMCxe.js.map → tab.mR5uUSdp.js.map} +1 -1
- package/dist/chunks/{tag.CqWg6C3H.js → tag.DujMVFh-.js} +3 -3
- package/dist/chunks/{tag.CqWg6C3H.js.map → tag.DujMVFh-.js.map} +1 -1
- package/dist/chunks/textarea.CHV6Z8nt.js +247 -0
- package/dist/chunks/{textarea.CvI2InIB.js.map → textarea.CHV6Z8nt.js.map} +1 -1
- package/dist/chunks/timeline-item.CaGcRZbt.js +419 -0
- package/dist/chunks/timeline-item.CaGcRZbt.js.map +1 -0
- package/dist/chunks/{toast.Bbtq3Icj.js → toast.C2oehk9P.js} +72 -78
- package/dist/chunks/{toast.Bbtq3Icj.js.map → toast.C2oehk9P.js.map} +1 -1
- package/dist/chunks/{toggle.BupEBkIG.js → toggle.BQoprdX-.js} +5 -5
- package/dist/chunks/{toggle.BupEBkIG.js.map → toggle.BQoprdX-.js.map} +1 -1
- package/dist/chunks/tooltip.CbADa_4p.js +199 -0
- package/dist/chunks/{tooltip.Lwtlhv3u.js.map → tooltip.CbADa_4p.js.map} +1 -1
- package/dist/chunks/truncate.DmCXQmeb.js +8 -0
- package/dist/chunks/{truncate.BfIl_-71.js.map → truncate.DmCXQmeb.js.map} +1 -1
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.BL2QTKmV.js → tutorial.vue_vue_type_script_setup_true_lang.BOruzlTt.js} +100 -124
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.BL2QTKmV.js.map → tutorial.vue_vue_type_script_setup_true_lang.BOruzlTt.js.map} +1 -1
- package/dist/chunks/{use-bento-toast-controller.BFctDoMg.js → use-bento-toast-controller.D_NSnBxi.js} +2 -2
- package/dist/chunks/{use-bento-toast-controller.BFctDoMg.js.map → use-bento-toast-controller.D_NSnBxi.js.map} +1 -1
- package/dist/chunks/use-cached-selected-values.ClEJRFAd.js +1631 -0
- package/dist/chunks/{use-cached-selected-values.C4_X3vVj.js.map → use-cached-selected-values.ClEJRFAd.js.map} +1 -1
- package/dist/chunks/use-country-items.D_3LBe2I.js +30 -0
- package/dist/chunks/{use-country-items.BTzByPdQ.js.map → use-country-items.D_3LBe2I.js.map} +1 -1
- package/dist/chunks/use-country-phon-code.DoqTGkNr.js +287 -0
- package/dist/chunks/use-country-phon-code.DoqTGkNr.js.map +1 -0
- package/dist/chunks/use-date-input-formatter.CDRzd-hW.js +1629 -0
- package/dist/chunks/{use-date-input-formatter.dtbK-CEy.js.map → use-date-input-formatter.CDRzd-hW.js.map} +1 -1
- package/dist/chunks/use-default-slot-validator.BzHcrgmy.js +12 -0
- package/dist/chunks/{use-default-slot-validator.O02rzsob.js.map → use-default-slot-validator.BzHcrgmy.js.map} +1 -1
- package/dist/chunks/use-expandable-content-height.B5jjRvCz.js +16 -0
- package/dist/chunks/{use-expandable-content-height.GkjjbmPy.js.map → use-expandable-content-height.B5jjRvCz.js.map} +1 -1
- package/dist/chunks/use-has-slot.CyMiImRQ.js +14 -0
- package/dist/chunks/{use-has-slot.B7eQSabc.js.map → use-has-slot.CyMiImRQ.js.map} +1 -1
- package/dist/chunks/utils.DWmc2mUI.js +19 -0
- package/dist/chunks/{utils.BzUwtTXc.js.map → utils.DWmc2mUI.js.map} +1 -1
- package/dist/chunks/{zh-CN.ChYkuQAR.js → zh-CN.Ce34mXsX.js} +28 -28
- package/dist/chunks/{zh-CN.ChYkuQAR.js.map → zh-CN.Ce34mXsX.js.map} +1 -1
- package/dist/click-outside.js +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/country.js +3 -3
- package/dist/currency.js +1 -1
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/draggable-handle.js +4 -28
- package/dist/draggable-handle.js.map +1 -1
- package/dist/dropdown.js +4 -4
- package/dist/empty-state.js +1 -1
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +241 -241
- 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/inspector.js +1 -1
- package/dist/internal.js +13 -13
- package/dist/layout.js +1 -1
- package/dist/link.js +1 -1
- package/dist/list.js +6 -0
- package/dist/list.js.map +1 -0
- 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 +2 -2
- package/dist/popper-container.js +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/status.js +4 -3
- package/dist/status.js.map +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/toggle.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/use-form-v4.js +331 -341
- package/dist/use-form-v4.js.map +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +7 -7
- package/dist/chunks/anchor-scroller.BctgW0se.js +0 -214
- package/dist/chunks/base-modal.gZAtk-xP.js +0 -443
- package/dist/chunks/button-actions-with-menu.Tba1ME79.js +0 -93
- package/dist/chunks/calendar.vM3abC8y.js +0 -1234
- package/dist/chunks/click-outside.CDz_x8mN.js +0 -23
- package/dist/chunks/constructNow.CIc7d13I.js +0 -8
- package/dist/chunks/country.types.BBQbWkTY.js +0 -773
- package/dist/chunks/dashboard-section.CgoLquLP.js +0 -165
- package/dist/chunks/dashed-underline.wbRHATeE.js +0 -114
- package/dist/chunks/data-grid-template.D40V1cmi.js +0 -144
- package/dist/chunks/data-grid.C2nCCbeC.js +0 -4368
- package/dist/chunks/date-picker.D5B_SECc.js +0 -251
- package/dist/chunks/date-range-picker.B0q7Z4df.js +0 -1084
- package/dist/chunks/differenceInMonths.CIYECBxK.js +0 -43
- package/dist/chunks/dropdown.CxjzXI-k.js +0 -837
- package/dist/chunks/filter-bar.DJ7O4zLX.js +0 -4036
- package/dist/chunks/filter-bar.DJ7O4zLX.js.map +0 -1
- package/dist/chunks/fixed-scroller.i1tmEmst.js +0 -161
- package/dist/chunks/get-slot-text.CQRAP2_q.js +0 -12
- package/dist/chunks/input-field-password.C_h61CMn.js +0 -402
- package/dist/chunks/isSameWeek.CzBCmu7d.js +0 -14
- package/dist/chunks/layout-row.Da8nkm9z.js +0 -100
- package/dist/chunks/link.DTCn2EtX.js +0 -116
- package/dist/chunks/on-click-outside.BW4rkhzG.js +0 -91
- package/dist/chunks/pagination.B32UgSoH.js +0 -488
- package/dist/chunks/pagination.B32UgSoH.js.map +0 -1
- package/dist/chunks/popover.types.DhALnOLQ.js +0 -6
- package/dist/chunks/selection-card-group.C7IK2Vl5.js +0 -417
- package/dist/chunks/startOfWeek.CXhhX-R7.js +0 -10
- package/dist/chunks/status.types.D3v3k-Q8.js +0 -44
- package/dist/chunks/status.types.D3v3k-Q8.js.map +0 -1
- package/dist/chunks/tab.DRrnMCxe.js +0 -273
- package/dist/chunks/textarea.CvI2InIB.js +0 -255
- package/dist/chunks/timeline-item.BooD99hL.js +0 -427
- package/dist/chunks/timeline-item.BooD99hL.js.map +0 -1
- package/dist/chunks/tooltip.Lwtlhv3u.js +0 -202
- package/dist/chunks/truncate.BfIl_-71.js +0 -8
- package/dist/chunks/use-cached-selected-values.C4_X3vVj.js +0 -1711
- package/dist/chunks/use-country-items.BTzByPdQ.js +0 -30
- package/dist/chunks/use-country-phon-code.Bui3zD6W.js +0 -5621
- package/dist/chunks/use-country-phon-code.Bui3zD6W.js.map +0 -1
- package/dist/chunks/use-date-input-formatter.dtbK-CEy.js +0 -1732
- package/dist/chunks/use-default-slot-validator.O02rzsob.js +0 -16
- package/dist/chunks/use-expandable-content-height.GkjjbmPy.js +0 -17
- package/dist/chunks/use-has-slot.B7eQSabc.js +0 -15
- package/dist/chunks/utils.BzUwtTXc.js +0 -21
|
@@ -1,26 +1,20 @@
|
|
|
1
|
-
import { defineComponent as L, openBlock as r, createElementBlock as $, createElementVNode as
|
|
2
|
-
import { u as
|
|
1
|
+
import { defineComponent as L, openBlock as r, createElementBlock as $, createElementVNode as j, createVNode as y, unref as k, withCtx as I, createTextVNode as H, toDisplayString as R, createBlock as b, createCommentVNode as B, ref as v, computed as _, watch as S, onMounted as G, nextTick as J, normalizeStyle as X, TransitionGroup as K, Fragment as Q, renderList as Z, mergeProps as tt } from "vue";
|
|
2
|
+
import { u as O } from "./use-bento-toast-controller.D_NSnBxi.js";
|
|
3
3
|
import { C as et } from "./cross-small.Bjq2Gqvh.js";
|
|
4
4
|
import { u as st } from "./index.B875RXHM.js";
|
|
5
|
-
import { B as Y } from "./button.
|
|
5
|
+
import { B as Y } from "./button.DWF7FSIw.js";
|
|
6
6
|
import { B as at } from "./typography.B3J6_tYk.js";
|
|
7
7
|
import { _ as M } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
8
8
|
import "../assets/toast.css";
|
|
9
|
-
const
|
|
10
|
-
"en-US": {
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
"ja-JP": {
|
|
14
|
-
dismiss: "却下"
|
|
15
|
-
},
|
|
16
|
-
"pt-BR": {
|
|
17
|
-
dismiss: "Descartar"
|
|
18
|
-
}
|
|
9
|
+
const P = {
|
|
10
|
+
"en-US": { dismiss: "Dismiss" },
|
|
11
|
+
"ja-JP": { dismiss: "却下" },
|
|
12
|
+
"pt-BR": { dismiss: "Descartar" }
|
|
19
13
|
}, ot = { class: "b-toast-item" }, nt = {
|
|
20
14
|
class: "b-toast-item__text",
|
|
21
15
|
role: "status"
|
|
22
16
|
}, it = {
|
|
23
|
-
i18n: { messages:
|
|
17
|
+
i18n: { messages: P }
|
|
24
18
|
}, rt = /* @__PURE__ */ L({
|
|
25
19
|
...it,
|
|
26
20
|
__name: "toast-item",
|
|
@@ -28,12 +22,12 @@ const U = {
|
|
|
28
22
|
toast: { type: Object, required: !0 }
|
|
29
23
|
},
|
|
30
24
|
setup(l) {
|
|
31
|
-
const n = l, { t: u } = st({ messages:
|
|
25
|
+
const n = l, { t: u } = st({ messages: P }), a = () => {
|
|
32
26
|
typeof n.toast.action.handler == "function" && n.toast.action.handler(), n.toast.dismiss();
|
|
33
27
|
};
|
|
34
28
|
return (c, i) => (r(), $("div", ot, [
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
j("output", nt, [
|
|
30
|
+
y(k(at), {
|
|
37
31
|
title: l.toast.text,
|
|
38
32
|
el: "span",
|
|
39
33
|
variant: "body",
|
|
@@ -45,7 +39,7 @@ const U = {
|
|
|
45
39
|
_: 1
|
|
46
40
|
}, 8, ["title"])
|
|
47
41
|
]),
|
|
48
|
-
l.toast.action ? (r(),
|
|
42
|
+
l.toast.action ? (r(), b(k(Y), {
|
|
49
43
|
key: 0,
|
|
50
44
|
class: "b-toast-item__btn",
|
|
51
45
|
variant: "tertiary",
|
|
@@ -57,15 +51,15 @@ const U = {
|
|
|
57
51
|
]),
|
|
58
52
|
_: 1
|
|
59
53
|
})) : B("", !0),
|
|
60
|
-
|
|
54
|
+
y(k(Y), {
|
|
61
55
|
class: "b-toast-item__btn",
|
|
62
56
|
variant: "tertiary",
|
|
63
57
|
"data-testid": "toast-item-close-btn",
|
|
64
58
|
onClick: i[0] || (i[0] = (m) => l.toast.dismiss())
|
|
65
59
|
}, {
|
|
66
60
|
iconLeft: I(() => [
|
|
67
|
-
|
|
68
|
-
"svg-title":
|
|
61
|
+
y(k(et), {
|
|
62
|
+
"svg-title": k(u)("dismiss")
|
|
69
63
|
}, null, 8, ["svg-title"])
|
|
70
64
|
]),
|
|
71
65
|
_: 1
|
|
@@ -76,47 +70,47 @@ const U = {
|
|
|
76
70
|
__name: "toast-shadow-stack",
|
|
77
71
|
emits: ["update"],
|
|
78
72
|
setup(l, { emit: n }) {
|
|
79
|
-
const { stack: u } =
|
|
80
|
-
await
|
|
81
|
-
const { top: f } = c.value.getBoundingClientRect(),
|
|
82
|
-
if (
|
|
73
|
+
const { stack: u } = O(), a = n, c = v(), i = v(), m = v(), p = v(), h = [i, m, p], d = _(() => u.value.slice(0, 3)), D = async () => {
|
|
74
|
+
await J();
|
|
75
|
+
const { top: f } = c.value.getBoundingClientRect(), T = u.value.map((o, g) => {
|
|
76
|
+
if (g > 2)
|
|
83
77
|
return { ...o, bottom: 0, height: 0 };
|
|
84
|
-
const { height: w, top: C } = h[
|
|
78
|
+
const { height: w, top: C } = h[g].value.$el.getBoundingClientRect();
|
|
85
79
|
return { ...o, height: w, bottom: C - f };
|
|
86
80
|
});
|
|
87
|
-
a("update",
|
|
81
|
+
a("update", T);
|
|
88
82
|
};
|
|
89
|
-
return S(u, D),
|
|
83
|
+
return S(u, D), G(() => {
|
|
90
84
|
u.value.length > 0 && D();
|
|
91
|
-
}), (f,
|
|
85
|
+
}), (f, T) => (r(), $("div", {
|
|
92
86
|
ref_key: "shadowStack",
|
|
93
87
|
ref: c,
|
|
94
88
|
class: "b-toast-shadow-stack"
|
|
95
89
|
}, [
|
|
96
|
-
|
|
90
|
+
d.value[0] ? (r(), b(x, {
|
|
97
91
|
key: 0,
|
|
98
92
|
ref_key: "toast0",
|
|
99
93
|
ref: i,
|
|
100
|
-
toast:
|
|
94
|
+
toast: d.value[0]
|
|
101
95
|
}, null, 8, ["toast"])) : B("", !0),
|
|
102
|
-
|
|
96
|
+
d.value[1] ? (r(), b(x, {
|
|
103
97
|
key: 1,
|
|
104
98
|
ref_key: "toast1",
|
|
105
99
|
ref: m,
|
|
106
|
-
toast:
|
|
100
|
+
toast: d.value[1]
|
|
107
101
|
}, null, 8, ["toast"])) : B("", !0),
|
|
108
|
-
|
|
102
|
+
d.value[2] ? (r(), b(x, {
|
|
109
103
|
key: 2,
|
|
110
104
|
ref_key: "toast2",
|
|
111
105
|
ref: p,
|
|
112
|
-
toast:
|
|
106
|
+
toast: d.value[2]
|
|
113
107
|
}, null, 8, ["toast"])) : B("", !0)
|
|
114
108
|
], 512));
|
|
115
109
|
}
|
|
116
|
-
}), ut = /* @__PURE__ */ M(lt, [["__scopeId", "data-v-81490a5e"]]), z = 5e3, E = 40,
|
|
110
|
+
}), ut = /* @__PURE__ */ M(lt, [["__scopeId", "data-v-81490a5e"]]), z = 5e3, E = 40, F = 10, ct = /* @__PURE__ */ L({
|
|
117
111
|
__name: "toast",
|
|
118
112
|
setup(l) {
|
|
119
|
-
const n =
|
|
113
|
+
const n = v(!1), { stack: u } = O();
|
|
120
114
|
S(
|
|
121
115
|
u,
|
|
122
116
|
(t) => {
|
|
@@ -124,89 +118,89 @@ const U = {
|
|
|
124
118
|
},
|
|
125
119
|
{ immediate: !0 }
|
|
126
120
|
);
|
|
127
|
-
const a =
|
|
121
|
+
const a = v(!1), c = v([]), i = _(() => c.value.length), m = _(() => Math.min(a.value ? 2 : 0, i.value - 1)), p = _(() => {
|
|
128
122
|
const t = c.value[m.value];
|
|
129
123
|
return t ? t.bottom + t.height : 0;
|
|
130
124
|
}), h = _(() => {
|
|
131
125
|
const t = p.value - E;
|
|
132
|
-
return c.value.map((
|
|
133
|
-
const V =
|
|
126
|
+
return c.value.map((s, e) => {
|
|
127
|
+
const V = e > m.value, A = !a.value && e > 1, q = V ? t + F * (A ? 2 : 1) : s.bottom;
|
|
134
128
|
return {
|
|
135
|
-
...
|
|
129
|
+
...s,
|
|
136
130
|
styles: {
|
|
137
|
-
height: `${V ? E :
|
|
131
|
+
height: `${V ? E : s.height}px`,
|
|
138
132
|
transform: V ? `translateY(${q * -1}px) scaleX(${A ? "0.8" : "0.9"})` : `translateY(${q * -1}px)`,
|
|
139
|
-
"z-index": i.value -
|
|
133
|
+
"z-index": i.value - e
|
|
140
134
|
},
|
|
141
135
|
// first toast has different animation, and toasts above index 2/3 are not visible so no need for a custom animation
|
|
142
|
-
dismissTransform:
|
|
143
|
-
isFirst:
|
|
144
|
-
isInert:
|
|
136
|
+
dismissTransform: e > 0 && e < (a.value ? 4 : 3) ? `translateY(${(q - s.height) * -1}px) scale(0.5, 0.1)` : null,
|
|
137
|
+
isFirst: e === 0,
|
|
138
|
+
isInert: e > (a.value ? 2 : 0)
|
|
145
139
|
};
|
|
146
140
|
});
|
|
147
|
-
}),
|
|
141
|
+
}), d = (t) => {
|
|
148
142
|
t.dataset.dismissTransform && (t.style.transform = t.dataset.dismissTransform);
|
|
149
143
|
}, D = _(() => {
|
|
150
144
|
let t = 0;
|
|
151
145
|
if (m.value >= 0) {
|
|
152
|
-
const
|
|
153
|
-
t = Math.min(p.value +
|
|
146
|
+
const s = F * Math.min(i.value - 1 - m.value, a.value ? 1 : 2);
|
|
147
|
+
t = Math.min(p.value + s, document.body.parentElement.clientHeight);
|
|
154
148
|
}
|
|
155
149
|
return `${t}px`;
|
|
156
150
|
});
|
|
157
|
-
let f = null,
|
|
158
|
-
const
|
|
159
|
-
|
|
151
|
+
let f = null, T = null, o = z;
|
|
152
|
+
const g = (t, s) => {
|
|
153
|
+
T = Date.now(), f = setTimeout(() => t.dismiss(), s);
|
|
160
154
|
}, w = (t) => {
|
|
161
|
-
clearTimeout(f), t ? (o = z, a.value ||
|
|
155
|
+
clearTimeout(f), t ? (o = z, a.value || g(t, o)) : o = 0;
|
|
162
156
|
};
|
|
163
157
|
S(
|
|
164
158
|
() => h.value[0],
|
|
165
|
-
(t,
|
|
166
|
-
|
|
159
|
+
(t, s) => {
|
|
160
|
+
t?.id !== s?.id && w(t);
|
|
167
161
|
},
|
|
168
162
|
{ immediate: !0 }
|
|
169
163
|
);
|
|
170
164
|
const C = () => {
|
|
171
|
-
o = o - Date.now() +
|
|
172
|
-
},
|
|
173
|
-
o > 0 &&
|
|
165
|
+
o = o - Date.now() + T, clearTimeout(f);
|
|
166
|
+
}, U = () => {
|
|
167
|
+
o > 0 && g(h.value[0], o);
|
|
174
168
|
};
|
|
175
169
|
S(a, (t) => {
|
|
176
|
-
t ? C() :
|
|
170
|
+
t ? C() : U();
|
|
177
171
|
});
|
|
178
|
-
const N =
|
|
172
|
+
const N = v(), W = () => setTimeout(() => {
|
|
179
173
|
a.value = a.value ? N.value.matches(":hover") : !1;
|
|
180
174
|
});
|
|
181
|
-
return (t,
|
|
175
|
+
return (t, s) => n.value ? (r(), $("div", {
|
|
182
176
|
key: 0,
|
|
183
177
|
ref_key: "root",
|
|
184
178
|
ref: N,
|
|
185
179
|
class: "b-toast",
|
|
186
180
|
"data-testid": "toast",
|
|
187
|
-
style:
|
|
188
|
-
onMouseenter:
|
|
189
|
-
onMouseleave:
|
|
181
|
+
style: X({ height: D.value }),
|
|
182
|
+
onMouseenter: s[1] || (s[1] = (e) => a.value = !0),
|
|
183
|
+
onMouseleave: s[2] || (s[2] = (e) => a.value = !1)
|
|
190
184
|
}, [
|
|
191
|
-
|
|
192
|
-
onUpdate:
|
|
185
|
+
y(ut, {
|
|
186
|
+
onUpdate: s[0] || (s[0] = (e) => c.value = e)
|
|
193
187
|
}),
|
|
194
|
-
|
|
188
|
+
y(K, {
|
|
195
189
|
name: "b-toast__queue",
|
|
196
190
|
tag: "div",
|
|
197
191
|
"aria-live": "polite",
|
|
198
192
|
"enter-class": "b-toast__queue--enter",
|
|
199
193
|
"leave-to-class": "b-toast__queue--leave-to",
|
|
200
|
-
onBeforeLeave:
|
|
201
|
-
onAfterLeave:
|
|
194
|
+
onBeforeLeave: d,
|
|
195
|
+
onAfterLeave: W
|
|
202
196
|
}, {
|
|
203
197
|
default: I(() => [
|
|
204
|
-
(r(!0), $(
|
|
205
|
-
key:
|
|
206
|
-
toast:
|
|
207
|
-
style:
|
|
208
|
-
class: [{ "b-toast__item--first":
|
|
209
|
-
inert:
|
|
198
|
+
(r(!0), $(Q, null, Z(h.value, (e) => (r(), b(x, tt({ ref_for: !0 }, { "data-dismiss-transform": e.dismissTransform }, {
|
|
199
|
+
key: e.id,
|
|
200
|
+
toast: e,
|
|
201
|
+
style: e.styles,
|
|
202
|
+
class: [{ "b-toast__item--first": e.isFirst }, "b-toast__item"],
|
|
203
|
+
inert: e.isInert,
|
|
210
204
|
"data-testid": "toast-item"
|
|
211
205
|
}), null, 16, ["toast", "style", "class", "inert"]))), 128))
|
|
212
206
|
]),
|
|
@@ -214,8 +208,8 @@ const U = {
|
|
|
214
208
|
})
|
|
215
209
|
], 36)) : B("", !0);
|
|
216
210
|
}
|
|
217
|
-
}),
|
|
211
|
+
}), Tt = /* @__PURE__ */ M(ct, [["__scopeId", "data-v-4487b91a"]]);
|
|
218
212
|
export {
|
|
219
|
-
|
|
213
|
+
Tt as B
|
|
220
214
|
};
|
|
221
|
-
//# sourceMappingURL=toast.
|
|
215
|
+
//# sourceMappingURL=toast.C2oehk9P.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.Bbtq3Icj.js","sources":["../../../vue2/src/components/toast/components/toast-item/toast-item.vue","../../../vue2/src/components/toast/components/toast-shadow-stack/toast-shadow-stack.vue","../../../vue2/src/components/toast/toast.vue"],"sourcesContent":["<template>\n <div class=\"b-toast-item\">\n <output class=\"b-toast-item__text\" role=\"status\">\n <bento-typography :title=\"toast.text\" el=\"span\" variant=\"body\" strongest>\n {{ toast.text }}\n </bento-typography>\n </output>\n <bento-button\n v-if=\"toast.action\"\n class=\"b-toast-item__btn\"\n variant=\"tertiary\"\n data-testid=\"toast-item-action-btn\"\n @click=\"onAction\"\n >\n {{ toast.action.text }}\n </bento-button>\n <bento-button\n class=\"b-toast-item__btn\"\n variant=\"tertiary\"\n data-testid=\"toast-item-close-btn\"\n @click=\"toast.dismiss()\"\n >\n <template #iconLeft>\n <cross-icon :svg-title=\"t('dismiss')\" />\n </template>\n </bento-button>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { type PropType } from 'vue';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross-small';\n import { useI18n } from '@/utils/ts/i18n';\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import type { BentoToastItem } from '@/composables';\n import messages from './messages.json';\n\n const props = defineProps({\n toast: { type: Object as PropType<BentoToastItem>, required: true },\n });\n\n type MessageSchema = (typeof messages)['en-US'];\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const onAction = () => {\n if (typeof props.toast.action.handler === 'function') {\n props.toast.action.handler();\n }\n props.toast.dismiss();\n };\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./toast-item.scss\" />\n","<template>\n <div ref=\"shadowStack\" class=\"b-toast-shadow-stack\">\n <!--\n since we only interested in the size of the last 3 toasts and order of the toast items\n is not guaranteed when we use ref with v-for (more info at the end of this section https://vuejs.org/guide/essentials/template-refs.html#refs-inside-v-for),\n toast items would be rendered independently with individual ref references.\n -->\n <toast-item v-if=\"toasts[0]\" ref=\"toast0\" :toast=\"toasts[0]\" />\n <toast-item v-if=\"toasts[1]\" ref=\"toast1\" :toast=\"toasts[1]\" />\n <toast-item v-if=\"toasts[2]\" ref=\"toast2\" :toast=\"toasts[2]\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n /**\n * This component will \"shadow-render\" ToastItems positioned relatively to each other,\n * would grab their positions and size and would emit augmented list of toasts with those\n * additional details. This would allow us to have perfect control over toasts positioning and animation\n * in the parent Toast component, where ToastItems would actually be visible.\n */\n import { computed, nextTick, onMounted, ref, watch } from 'vue';\n import { useBentoToastController } from '@/composables';\n import type { BentoToastItemWithDimensions } from './toast-shadow-stack.types';\n import ToastItem from '../toast-item/toast-item.vue';\n\n const { stack } = useBentoToastController();\n\n const emit = defineEmits<{\n /**\n *\n */\n (e: 'update', toasts: Array<BentoToastItemWithDimensions>): void;\n }>();\n\n const shadowStack = ref<HTMLElement>();\n const toast0 = ref<InstanceType<typeof ToastItem>>();\n const toast1 = ref<InstanceType<typeof ToastItem>>();\n const toast2 = ref<InstanceType<typeof ToastItem>>();\n const toastRefs = [toast0, toast1, toast2];\n\n // only get 3 last toast as only they would be rendered on the screen\n const toasts = computed(() => stack.value.slice(0, 3));\n\n const shareToastsWithDimensions = async () => {\n // Wait for all toasts to render, so we would be able to get their ClientRect\n await nextTick();\n\n // Parent container \"top\" value should be 0, but can be something else due to CSS. So have to account for it\n const { top: parentTop } = shadowStack.value.getBoundingClientRect();\n\n const toastsWithDimensions = stack.value.map((toast, index) => {\n if (index > 2) {\n return { ...toast, bottom: 0, height: 0 };\n }\n const { height, top } = toastRefs[index].value.$el.getBoundingClientRect();\n return { ...toast, height, bottom: top - parentTop };\n });\n emit('update', toastsWithDimensions);\n };\n\n watch(stack, shareToastsWithDimensions);\n\n onMounted(() => {\n // Refs would be null until component is mounted, so let's make sure we only do it after that\n if (stack.value.length > 0) {\n shareToastsWithDimensions();\n }\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./toast-shadow-stack.scss\" />\n","<template>\n <div\n v-if=\"renderToast\"\n ref=\"root\"\n class=\"b-toast\"\n data-testid=\"toast\"\n :style=\"{ height: stackHeight }\"\n @mouseenter=\"hovered = true\"\n @mouseleave=\"hovered = false\"\n >\n <toast-shadow-stack @update=\"toastsWithDimensions = $event\" />\n\n <transition-group\n name=\"b-toast__queue\"\n tag=\"div\"\n aria-live=\"polite\"\n enter-class=\"b-toast__queue--enter\"\n leave-to-class=\"b-toast__queue--leave-to\"\n @before-leave=\"onBeforeToastLeave\"\n @after-leave=\"checkHover\"\n >\n <toast-item\n v-for=\"toast in queue\"\n v-bind=\"{ 'data-dismiss-transform': toast.dismissTransform }\"\n :key=\"toast.id\"\n :toast=\"toast\"\n :style=\"toast.styles\"\n :class=\"{ 'b-toast__item--first': toast.isFirst }\"\n :inert=\"toast.isInert\"\n data-testid=\"toast-item\"\n class=\"b-toast__item\"\n />\n </transition-group>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref, watch } from 'vue';\n import ToastShadowStack from './components/toast-shadow-stack/toast-shadow-stack.vue';\n import ToastItem from './components/toast-item/toast-item.vue';\n import { useBentoToastController } from '@/composables/use-bento-toast-controller';\n import type { BentoToastItemWithDimensions } from './components/toast-shadow-stack/toast-shadow-stack.types';\n\n // By design, top-most toast should be visible for 5 seconds before auto-dismiss\n const TOAST_DISPLAY_DURATION = 5000;\n\n // Delay first render of the toast until we actually need it, to skip all the positioning calculation logic\n // until we actually have anything to render.\n const renderToast = ref(false);\n const { stack } = useBentoToastController();\n\n watch(\n stack,\n toastStack => {\n if (toastStack.length > 0 && !renderToast.value) {\n renderToast.value = true;\n }\n },\n { immediate: true }\n );\n\n const hovered = ref(false);\n const toastsWithDimensions = ref<Array<BentoToastItemWithDimensions>>([]);\n // In collapsed mode we need for toast to \"stick out\", but not overflow another toast in the forefront.\n // Random number that satisfies this condition (single-line toast is roughly 52px height)\n const collapsedToastHeight = 40;\n // How much pixels of the stacked toast will be \"sticking out\" from the visible toast\n const stackIndicatorHeight = 10;\n\n const queueSize = computed(() => toastsWithDimensions.value.length);\n const lastVisibleToastIndex = computed(() => Math.min(hovered.value ? 2 : 0, queueSize.value - 1));\n const lastVisibleToastBottom = computed(() => {\n const toast = toastsWithDimensions.value[lastVisibleToastIndex.value];\n return toast ? toast.bottom + toast.height : 0;\n });\n\n const queue = computed(() => {\n const translateBaseValue = lastVisibleToastBottom.value - collapsedToastHeight;\n return toastsWithDimensions.value.map((toast, index) => {\n const collapsed = index > lastVisibleToastIndex.value;\n const isSmallerStack = !hovered.value && index > 1;\n const translateY = collapsed\n ? translateBaseValue + stackIndicatorHeight * (isSmallerStack ? 2 : 1)\n : toast.bottom;\n\n return {\n ...toast,\n styles: {\n height: `${collapsed ? collapsedToastHeight : toast.height}px`,\n transform: collapsed\n ? `translateY(${translateY * -1}px) scaleX(${isSmallerStack ? '0.8' : '0.9'})`\n : `translateY(${translateY * -1}px)`,\n 'z-index': queueSize.value - index,\n },\n // first toast has different animation, and toasts above index 2/3 are not visible so no need for a custom animation\n dismissTransform:\n index > 0 && index < (hovered.value ? 4 : 3)\n ? `translateY(${(translateY - toast.height) * -1}px) scale(0.5, 0.1)`\n : null,\n isFirst: index === 0,\n isInert: index > (hovered.value ? 2 : 0),\n };\n });\n });\n\n const onBeforeToastLeave = (el: HTMLElement) => {\n // We have to swap transformation on the toast element that is about to be removed\n // Unfortunately we cannot do it via transition classes as transformation function is\n // unique per toast, and we cannot use reactivity because it won't be applied for a toast\n // that is removed. So direct DOM manipulation is the only way it seems.\n if (el.dataset.dismissTransform) {\n /* eslint-disable no-param-reassign -- explicitly manipulating with DOM properties, no way around it unfortunately */\n el.style.transform = el.dataset.dismissTransform;\n }\n };\n\n const stackHeight = computed(() => {\n // Track stack container height, so that hover over would work without glitches\n // (when mouse is over space between toasts)\n let height = 0;\n if (lastVisibleToastIndex.value >= 0) {\n const stackIndicator =\n stackIndicatorHeight *\n Math.min(queueSize.value - 1 - lastVisibleToastIndex.value, hovered.value ? 1 : 2);\n height = Math.min(lastVisibleToastBottom.value + stackIndicator, document.body.parentElement.clientHeight);\n }\n return `${height}px`;\n });\n\n let dismissTimout = null;\n let timeoutStart = null;\n let remainingTimeToDismiss = TOAST_DISPLAY_DURATION;\n\n const startTimer = (toast, duration) => {\n timeoutStart = Date.now();\n dismissTimout = setTimeout(() => toast.dismiss(), duration);\n };\n\n const startNewDismissTimer = toast => {\n // stop previous timeouts, if any\n clearTimeout(dismissTimout);\n if (toast) {\n remainingTimeToDismiss = TOAST_DISPLAY_DURATION;\n if (!hovered.value) {\n startTimer(toast, remainingTimeToDismiss);\n }\n } else {\n remainingTimeToDismiss = 0;\n }\n };\n\n watch(\n () => queue.value[0],\n (firstToast, oldFirstToast) => {\n if (firstToast?.id === oldFirstToast?.id) {\n return;\n }\n startNewDismissTimer(firstToast);\n },\n { immediate: true }\n );\n\n const pauseDismissTimer = () => {\n remainingTimeToDismiss = remainingTimeToDismiss - Date.now() + timeoutStart;\n clearTimeout(dismissTimout);\n };\n\n const resumeDismissTimer = () => {\n if (remainingTimeToDismiss > 0) {\n startTimer(queue.value[0], remainingTimeToDismiss);\n }\n };\n\n watch(hovered, isHovered => {\n if (isHovered) {\n pauseDismissTimer();\n } else {\n resumeDismissTimer();\n }\n });\n\n const root = ref<HTMLElement>();\n // \"mouseleave\" event would be emitted for the root element when the mouse moves out of the root element,\n // but browser wouldn't emit this event when root element shrinks to the point when mouse is not over element anymore.\n // This can happen when user clicks on dismiss button the top-most toast and doesn't move the mouse during animation,\n // after which browser would think that root element is still hovered. This workaround addresses this particular issue.\n const checkHover = () =>\n setTimeout(() => {\n hovered.value = hovered.value ? root.value.matches(':hover') : false;\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./toast.scss\" />\n"],"names":["__default__","messages","props","__props","t","useI18n","onAction","stack","useBentoToastController","emit","__emit","shadowStack","ref","toast0","toast1","toast2","toastRefs","toasts","computed","shareToastsWithDimensions","nextTick","parentTop","toastsWithDimensions","toast","index","height","top","watch","onMounted","TOAST_DISPLAY_DURATION","collapsedToastHeight","stackIndicatorHeight","renderToast","toastStack","hovered","queueSize","lastVisibleToastIndex","lastVisibleToastBottom","queue","translateBaseValue","collapsed","isSmallerStack","translateY","onBeforeToastLeave","el","stackHeight","stackIndicator","dismissTimout","timeoutStart","remainingTimeToDismiss","startTimer","duration","startNewDismissTimer","firstToast","oldFirstToast","pauseDismissTimer","resumeDismissTimer","isHovered","root","checkHover"],"mappings":";;;;;;;;;;;;;;;;;;;;;GAsDIA,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;AAlBA,UAAAC,IAAAC,GAKA,EAAA,GAAAC,EAAA,IAAAC,GAAA,EAAA,UAAAJ,EAAA,CAAA,GAEAK,IAAA,MAAA;AACI,MAAA,OAAAJ,EAAA,MAAA,OAAA,WAAA,cACIA,EAAA,MAAA,OAAA,QAAA,GAEJA,EAAA,MAAA,QAAA;AAAA,IAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxBxB,UAAA,EAAA,OAAAK,EAAA,IAAAC,EAAA,GAEAC,IAAAC,GAOAC,IAAAC,EAAA,GACAC,IAAAD,EAAA,GACAE,IAAAF,EAAA,GACAG,IAAAH,EAAA,GACAI,IAAA,CAAAH,GAAAC,GAAAC,CAAA,GAGAE,IAAAC,EAAA,MAAAX,EAAA,MAAA,MAAA,GAAA,CAAA,CAAA,GAEAY,IAAA,YAAA;AAEI,YAAAC,EAAA;AAGA,YAAA,EAAA,KAAAC,EAAA,IAAAV,EAAA,MAAA,sBAAA,GAEAW,IAAAf,EAAA,MAAA,IAAA,CAAAgB,GAAAC,MAAA;AACI,YAAAA,IAAA;AACI,iBAAA,EAAA,GAA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AAA;AAAA,IACJ;AAGJ,IAAAtB;AAAA,MAAA,MAAAW,EAAA,MAAA,CAAA;AAAA,MACuB,CAAAe,GAAAC,MAAA;AAEf,SAAAD,KAAA,gBAAAA,EAAA,SAAAC,KAAA,gBAAAA,EAAA,OAGAF,EAAAC,CAAA;AAAA,MAA+B;AAAA,MACnC,EAAA,WAAA,GAAA;AAAA,IACkB;AAGtB,UAAAE,IAAA,MAAA;AACI,MAAAN,IAAAA,IAAA,KAAA,IAAA,IAAAD,GACA,aAAAD,CAAA;AAAA,IAA0B,GAG9BS,IAAA,MAAA;AACI,MAAAP,IAAA,KACIC,EAAAZ,EAAA,MAAA,CAAA,GAAAW,CAAA;AAAA,IACJ;AAGJ,IAAAtB,EAAAO,GAAA,CAAAuB,MAAA;AACI,MAAAA,IACIF,EAAA,IAEAC,EAAA;AAAA,IACJ,CAAA;AAGJ,UAAAE,IAAA9C,EAAA,GAKA+C,IAAA,MAAA,WAAA,MAAA;AAEQ,MAAAzB,EAAA,QAAAA,EAAA,QAAAwB,EAAA,MAAA,QAAA,QAAA,IAAA;AAAA,IAA+D,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"toast.C2oehk9P.js","sources":["../../../vue2/src/components/toast/components/toast-item/toast-item.vue","../../../vue2/src/components/toast/components/toast-shadow-stack/toast-shadow-stack.vue","../../../vue2/src/components/toast/toast.vue"],"sourcesContent":["<template>\n <div class=\"b-toast-item\">\n <output class=\"b-toast-item__text\" role=\"status\">\n <bento-typography :title=\"toast.text\" el=\"span\" variant=\"body\" strongest>\n {{ toast.text }}\n </bento-typography>\n </output>\n <bento-button\n v-if=\"toast.action\"\n class=\"b-toast-item__btn\"\n variant=\"tertiary\"\n data-testid=\"toast-item-action-btn\"\n @click=\"onAction\"\n >\n {{ toast.action.text }}\n </bento-button>\n <bento-button\n class=\"b-toast-item__btn\"\n variant=\"tertiary\"\n data-testid=\"toast-item-close-btn\"\n @click=\"toast.dismiss()\"\n >\n <template #iconLeft>\n <cross-icon :svg-title=\"t('dismiss')\" />\n </template>\n </bento-button>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { type PropType } from 'vue';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross-small';\n import { useI18n } from '@/utils/ts/i18n';\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import type { BentoToastItem } from '@/composables';\n import messages from './messages.json';\n\n const props = defineProps({\n toast: { type: Object as PropType<BentoToastItem>, required: true },\n });\n\n type MessageSchema = (typeof messages)['en-US'];\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const onAction = () => {\n if (typeof props.toast.action.handler === 'function') {\n props.toast.action.handler();\n }\n props.toast.dismiss();\n };\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./toast-item.scss\" />\n","<template>\n <div ref=\"shadowStack\" class=\"b-toast-shadow-stack\">\n <!--\n since we only interested in the size of the last 3 toasts and order of the toast items\n is not guaranteed when we use ref with v-for (more info at the end of this section https://vuejs.org/guide/essentials/template-refs.html#refs-inside-v-for),\n toast items would be rendered independently with individual ref references.\n -->\n <toast-item v-if=\"toasts[0]\" ref=\"toast0\" :toast=\"toasts[0]\" />\n <toast-item v-if=\"toasts[1]\" ref=\"toast1\" :toast=\"toasts[1]\" />\n <toast-item v-if=\"toasts[2]\" ref=\"toast2\" :toast=\"toasts[2]\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n /**\n * This component will \"shadow-render\" ToastItems positioned relatively to each other,\n * would grab their positions and size and would emit augmented list of toasts with those\n * additional details. This would allow us to have perfect control over toasts positioning and animation\n * in the parent Toast component, where ToastItems would actually be visible.\n */\n import { computed, nextTick, onMounted, ref, watch } from 'vue';\n import { useBentoToastController } from '@/composables';\n import type { BentoToastItemWithDimensions } from './toast-shadow-stack.types';\n import ToastItem from '../toast-item/toast-item.vue';\n\n const { stack } = useBentoToastController();\n\n const emit = defineEmits<{\n /**\n *\n */\n (e: 'update', toasts: Array<BentoToastItemWithDimensions>): void;\n }>();\n\n const shadowStack = ref<HTMLElement>();\n const toast0 = ref<InstanceType<typeof ToastItem>>();\n const toast1 = ref<InstanceType<typeof ToastItem>>();\n const toast2 = ref<InstanceType<typeof ToastItem>>();\n const toastRefs = [toast0, toast1, toast2];\n\n // only get 3 last toast as only they would be rendered on the screen\n const toasts = computed(() => stack.value.slice(0, 3));\n\n const shareToastsWithDimensions = async () => {\n // Wait for all toasts to render, so we would be able to get their ClientRect\n await nextTick();\n\n // Parent container \"top\" value should be 0, but can be something else due to CSS. So have to account for it\n const { top: parentTop } = shadowStack.value.getBoundingClientRect();\n\n const toastsWithDimensions = stack.value.map((toast, index) => {\n if (index > 2) {\n return { ...toast, bottom: 0, height: 0 };\n }\n const { height, top } = toastRefs[index].value.$el.getBoundingClientRect();\n return { ...toast, height, bottom: top - parentTop };\n });\n emit('update', toastsWithDimensions);\n };\n\n watch(stack, shareToastsWithDimensions);\n\n onMounted(() => {\n // Refs would be null until component is mounted, so let's make sure we only do it after that\n if (stack.value.length > 0) {\n shareToastsWithDimensions();\n }\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./toast-shadow-stack.scss\" />\n","<template>\n <div\n v-if=\"renderToast\"\n ref=\"root\"\n class=\"b-toast\"\n data-testid=\"toast\"\n :style=\"{ height: stackHeight }\"\n @mouseenter=\"hovered = true\"\n @mouseleave=\"hovered = false\"\n >\n <toast-shadow-stack @update=\"toastsWithDimensions = $event\" />\n\n <transition-group\n name=\"b-toast__queue\"\n tag=\"div\"\n aria-live=\"polite\"\n enter-class=\"b-toast__queue--enter\"\n leave-to-class=\"b-toast__queue--leave-to\"\n @before-leave=\"onBeforeToastLeave\"\n @after-leave=\"checkHover\"\n >\n <toast-item\n v-for=\"toast in queue\"\n v-bind=\"{ 'data-dismiss-transform': toast.dismissTransform }\"\n :key=\"toast.id\"\n :toast=\"toast\"\n :style=\"toast.styles\"\n :class=\"{ 'b-toast__item--first': toast.isFirst }\"\n :inert=\"toast.isInert\"\n data-testid=\"toast-item\"\n class=\"b-toast__item\"\n />\n </transition-group>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref, watch } from 'vue';\n import ToastShadowStack from './components/toast-shadow-stack/toast-shadow-stack.vue';\n import ToastItem from './components/toast-item/toast-item.vue';\n import { useBentoToastController } from '@/composables/use-bento-toast-controller';\n import type { BentoToastItemWithDimensions } from './components/toast-shadow-stack/toast-shadow-stack.types';\n\n // By design, top-most toast should be visible for 5 seconds before auto-dismiss\n const TOAST_DISPLAY_DURATION = 5000;\n\n // Delay first render of the toast until we actually need it, to skip all the positioning calculation logic\n // until we actually have anything to render.\n const renderToast = ref(false);\n const { stack } = useBentoToastController();\n\n watch(\n stack,\n toastStack => {\n if (toastStack.length > 0 && !renderToast.value) {\n renderToast.value = true;\n }\n },\n { immediate: true }\n );\n\n const hovered = ref(false);\n const toastsWithDimensions = ref<Array<BentoToastItemWithDimensions>>([]);\n // In collapsed mode we need for toast to \"stick out\", but not overflow another toast in the forefront.\n // Random number that satisfies this condition (single-line toast is roughly 52px height)\n const collapsedToastHeight = 40;\n // How much pixels of the stacked toast will be \"sticking out\" from the visible toast\n const stackIndicatorHeight = 10;\n\n const queueSize = computed(() => toastsWithDimensions.value.length);\n const lastVisibleToastIndex = computed(() => Math.min(hovered.value ? 2 : 0, queueSize.value - 1));\n const lastVisibleToastBottom = computed(() => {\n const toast = toastsWithDimensions.value[lastVisibleToastIndex.value];\n return toast ? toast.bottom + toast.height : 0;\n });\n\n const queue = computed(() => {\n const translateBaseValue = lastVisibleToastBottom.value - collapsedToastHeight;\n return toastsWithDimensions.value.map((toast, index) => {\n const collapsed = index > lastVisibleToastIndex.value;\n const isSmallerStack = !hovered.value && index > 1;\n const translateY = collapsed\n ? translateBaseValue + stackIndicatorHeight * (isSmallerStack ? 2 : 1)\n : toast.bottom;\n\n return {\n ...toast,\n styles: {\n height: `${collapsed ? collapsedToastHeight : toast.height}px`,\n transform: collapsed\n ? `translateY(${translateY * -1}px) scaleX(${isSmallerStack ? '0.8' : '0.9'})`\n : `translateY(${translateY * -1}px)`,\n 'z-index': queueSize.value - index,\n },\n // first toast has different animation, and toasts above index 2/3 are not visible so no need for a custom animation\n dismissTransform:\n index > 0 && index < (hovered.value ? 4 : 3)\n ? `translateY(${(translateY - toast.height) * -1}px) scale(0.5, 0.1)`\n : null,\n isFirst: index === 0,\n isInert: index > (hovered.value ? 2 : 0),\n };\n });\n });\n\n const onBeforeToastLeave = (el: HTMLElement) => {\n // We have to swap transformation on the toast element that is about to be removed\n // Unfortunately we cannot do it via transition classes as transformation function is\n // unique per toast, and we cannot use reactivity because it won't be applied for a toast\n // that is removed. So direct DOM manipulation is the only way it seems.\n if (el.dataset.dismissTransform) {\n /* eslint-disable no-param-reassign -- explicitly manipulating with DOM properties, no way around it unfortunately */\n el.style.transform = el.dataset.dismissTransform;\n }\n };\n\n const stackHeight = computed(() => {\n // Track stack container height, so that hover over would work without glitches\n // (when mouse is over space between toasts)\n let height = 0;\n if (lastVisibleToastIndex.value >= 0) {\n const stackIndicator =\n stackIndicatorHeight *\n Math.min(queueSize.value - 1 - lastVisibleToastIndex.value, hovered.value ? 1 : 2);\n height = Math.min(lastVisibleToastBottom.value + stackIndicator, document.body.parentElement.clientHeight);\n }\n return `${height}px`;\n });\n\n let dismissTimout = null;\n let timeoutStart = null;\n let remainingTimeToDismiss = TOAST_DISPLAY_DURATION;\n\n const startTimer = (toast, duration) => {\n timeoutStart = Date.now();\n dismissTimout = setTimeout(() => toast.dismiss(), duration);\n };\n\n const startNewDismissTimer = toast => {\n // stop previous timeouts, if any\n clearTimeout(dismissTimout);\n if (toast) {\n remainingTimeToDismiss = TOAST_DISPLAY_DURATION;\n if (!hovered.value) {\n startTimer(toast, remainingTimeToDismiss);\n }\n } else {\n remainingTimeToDismiss = 0;\n }\n };\n\n watch(\n () => queue.value[0],\n (firstToast, oldFirstToast) => {\n if (firstToast?.id === oldFirstToast?.id) {\n return;\n }\n startNewDismissTimer(firstToast);\n },\n { immediate: true }\n );\n\n const pauseDismissTimer = () => {\n remainingTimeToDismiss = remainingTimeToDismiss - Date.now() + timeoutStart;\n clearTimeout(dismissTimout);\n };\n\n const resumeDismissTimer = () => {\n if (remainingTimeToDismiss > 0) {\n startTimer(queue.value[0], remainingTimeToDismiss);\n }\n };\n\n watch(hovered, isHovered => {\n if (isHovered) {\n pauseDismissTimer();\n } else {\n resumeDismissTimer();\n }\n });\n\n const root = ref<HTMLElement>();\n // \"mouseleave\" event would be emitted for the root element when the mouse moves out of the root element,\n // but browser wouldn't emit this event when root element shrinks to the point when mouse is not over element anymore.\n // This can happen when user clicks on dismiss button the top-most toast and doesn't move the mouse during animation,\n // after which browser would think that root element is still hovered. This workaround addresses this particular issue.\n const checkHover = () =>\n setTimeout(() => {\n hovered.value = hovered.value ? root.value.matches(':hover') : false;\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./toast.scss\" />\n"],"names":["__default__","messages","props","__props","t","useI18n","onAction","stack","useBentoToastController","emit","__emit","shadowStack","ref","toast0","toast1","toast2","toastRefs","toasts","computed","shareToastsWithDimensions","nextTick","parentTop","toastsWithDimensions","toast","index","height","top","watch","onMounted","TOAST_DISPLAY_DURATION","collapsedToastHeight","stackIndicatorHeight","renderToast","toastStack","hovered","queueSize","lastVisibleToastIndex","lastVisibleToastBottom","queue","translateBaseValue","collapsed","isSmallerStack","translateY","onBeforeToastLeave","el","stackHeight","stackIndicator","dismissTimout","timeoutStart","remainingTimeToDismiss","startTimer","duration","startNewDismissTimer","firstToast","oldFirstToast","pauseDismissTimer","resumeDismissTimer","isHovered","root","checkHover"],"mappings":";;;;;;;;;;;;;;;GAsDIA,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;AAlBA,UAAAC,IAAAC,GAKA,EAAA,GAAAC,EAAA,IAAAC,GAAA,EAAA,UAAAJ,EAAA,CAAA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EAAA,MAAA,QAAA,QAAA,IAAA;AAAA,IAA+D,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent as T, useSlots as w, useAttrs as D, ref as O, computed as d, toRefs as V, watch as $, openBlock as s, createElementBlock as m, normalizeClass as N, withDirectives as U, createElementVNode as p, unref as t, vModelCheckbox as j, createBlock as f, createCommentVNode as u, withCtx as _, renderSlot as v } from "vue";
|
|
2
2
|
import { C as z } from "./checkmark-small.CRuZauJc.js";
|
|
3
3
|
import { B as y } from "./typography.B3J6_tYk.js";
|
|
4
|
-
import { g as H } from "./generate-uid.
|
|
5
|
-
import { u as M } from "./use-default-slot-validator.
|
|
6
|
-
import { u as P } from "./use-has-slot.
|
|
7
|
-
import { g as q } from "./get-slot-text.
|
|
4
|
+
import { g as H } from "./generate-uid.DBWe4g6T.js";
|
|
5
|
+
import { u as M } from "./use-default-slot-validator.BzHcrgmy.js";
|
|
6
|
+
import { u as P } from "./use-has-slot.CyMiImRQ.js";
|
|
7
|
+
import { g as q } from "./get-slot-text.8Fbl1GOr.js";
|
|
8
8
|
import { u as G } from "./aria-label.CaUURpnB.js";
|
|
9
9
|
import { _ as J } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
10
10
|
import "../assets/toggle.css";
|
|
@@ -140,4 +140,4 @@ export {
|
|
|
140
140
|
c as a,
|
|
141
141
|
h as b
|
|
142
142
|
};
|
|
143
|
-
//# sourceMappingURL=toggle.
|
|
143
|
+
//# sourceMappingURL=toggle.BQoprdX-.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.
|
|
1
|
+
{"version":3,"file":"toggle.BQoprdX-.js","sources":["../../../vue2/src/components/toggle/toggle.types.ts","../../../vue2/src/components/toggle/toggle.vue"],"sourcesContent":["export enum BentoTogglePropClass {\n LABEL_FIRST = 'label-first',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoToggleLabelPosition {\n BEFORE = 'before',\n AFTER = 'after',\n}\n","<template>\n <label class=\"b-toggle\" :class=\"conditionalClasses\" data-testid=\"label\">\n <input\n v-model=\"toggleInput\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedDescription\"\n :disabled=\"disabled\"\n :aria-readonly=\"readonly\"\n role=\"switch\"\n class=\"b-toggle__input\"\n type=\"checkbox\"\n @change=\"$event => onChange($event)\"\n @click=\"onClick\"\n />\n <span class=\"b-toggle__track\" aria-hidden=\"true\">\n <span class=\"b-toggle__handle\">\n <checkmark-small v-if=\"toggleInput\" />\n </span>\n </span>\n <span v-if=\"hasSlot('default')\" class=\"b-toggle__label-container\">\n <bento-typography v-if=\"hasSlot('default')\" el=\"span\" variant=\"body\" data-testid=\"inner-label\">\n <slot></slot>\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n el=\"span\"\n variant=\"body\"\n class=\"b-toggle__description\"\n >\n <slot name=\"description\" />\n </bento-typography>\n </span>\n </label>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, type PropType, ref, toRefs, useAttrs, useSlots, watch } from 'vue';\n import CheckmarkSmall from '@adyen/ui-assets-icons-16/vue/checkmark-small';\n import { BentoToggleLabelPosition, BentoTogglePropClass } from './toggle.types';\n import { BentoTypography } from '@/components/typography';\n import { generateUid } from '@/core/utils/ts';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { getSlotText } from '@/utils/ts/get-slot-text/get-slot-text';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n\n const slots = useSlots();\n const attrs = useAttrs();\n const hasSlot = useHasSlot(slots);\n\n const props = defineProps({\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Accessible name for the toggle. It is strongly recommended to pass such value when the toggle is used without a label\n */\n ariaLabel: {\n type: String,\n default: undefined,\n },\n /**\n * Disable the toggle (optional)\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Position of the label relative to the toggle (optional)\n * @values before, after\n */\n labelPosition: {\n type: String as PropType<BentoToggleLabelPosition | `${BentoToggleLabelPosition}`>,\n default: BentoToggleLabelPosition.BEFORE,\n validator: (value: BentoToggleLabelPosition) => Object.values(BentoToggleLabelPosition).includes(value),\n },\n /**\n * Setting this property to true will set the toggle to read only state.\n */\n readonly: {\n type: Boolean,\n default: false,\n },\n /**\n * Indicates if the switch is \"on\" or \"off\"\n */\n value: {\n type: Boolean,\n default: false,\n },\n });\n\n const emit = defineEmits<{\n (e: 'input', value: boolean): void;\n }>();\n\n const toggleInput = ref(props.value);\n const descriptionId: string = generateUid('toggle-description');\n\n useDefaultSlotValidator('bento-toggle', slots.default, slots.description);\n\n const labelSlot = computed((): string | null => (hasSlot('default') ? getSlotText(slots)('default') : null));\n\n const ariaLabelAttribute = computed(() => attrs['aria-label'] as string);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: labelSlot,\n });\n\n const computedDescription = computed((): string | null => descriptionId ?? null);\n\n const conditionalClasses = computed((): { [key: string]: boolean } => ({\n [`b-toggle--${BentoTogglePropClass.LABEL_FIRST}`]: props.labelPosition === BentoToggleLabelPosition.BEFORE,\n 'b-toggle--disabled': props.disabled,\n 'b-toggle--readonly': props.readonly,\n }));\n\n const onChange = (event: Event) => {\n emit('input', (event.target as HTMLInputElement).checked);\n };\n\n // readonly attr doesn't work with checkbox, so we need to manually ignore the click instead\n const onClick = (event: Event) => {\n if (props.readonly) {\n event.preventDefault();\n }\n };\n\n watch(\n () => props.value,\n newValue => {\n toggleInput.value = newValue;\n }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * A wrapper around the bento toggle, providing checkbox functionality with a knob-like toggle\n *\n * @usage\n * import { BentoToggle, BentoLabelPosition } from '@adyen/adl-vue2';\n *\n * export default {\n * components: { BentoToggle },\n * template: `\n * <bento-toggle\n * :value=\"toggleValue\"`\n * label-position=\"LabelPosition.BEFORE\"\n * @input=\"optionalHandler($event)\"\n * >\n * Label Text\n * </bento-toggle>\n * `,\n * }\n */\n export default {\n name: 'bento-toggle',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./toggle.scss\" />\n"],"names":["BentoTogglePropClass","BentoTogglePropClass2","BentoToggleLabelPosition","BentoToggleLabelPosition2","__default__","slots","useSlots","attrs","useAttrs","hasSlot","useHasSlot","props","__props","emit","__emit","toggleInput","ref","descriptionId","generateUid","useDefaultSlotValidator","labelSlot","computed","getSlotText","ariaLabelAttribute","ariaLabel","toRefs","computedAriaLabel","useAriaLabel","computedDescription","conditionalClasses","onChange","event","onClick","watch","newValue"],"mappings":";;;;;;;;;;AAAO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,cAAA,eADQA,IAAAD,KAAA,CAAA,CAAA,GAOLE,IAAA,kBAAAC,OACHA,EAAA,SAAA,UACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;GCyJRE,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AApHA,UAAAC,IAAAC,EAAA,GACAC,IAAAC,EAAA,GACAC,IAAAC,EAAAL,CAAA,GAEAM,IAAAC,GA2CAC,IAAAC,GAIAC,IAAAC,EAAAL,EAAA,KAAA,GACAM,IAAAC,EAAA,oBAAA;AAEA,IAAAC,EAAA,gBAAAd,EAAA,SAAAA,EAAA,WAAA;AAEA,UAAAe,IAAAC,EAAA,MAAAZ,EAAA,SAAA,IAAAa,EAAAjB,CAAA,EAAA,SAAA,IAAA,IAAA,GAEAkB,IAAAF,EAAA,MAAAd,EAAA,YAAA,CAAA,GACA,EAAA,WAAAiB,EAAA,IAAAC,EAAAd,CAAA,GACAe,IAAAC,EAAA;AAAA,MAAuC,WAAAJ,EAAA;AAAA;AAAA,MACL,OAAAC;AAAA,MAEvB,iBAAAJ;AAAA,IACU,CAAA,GAGrBQ,IAAAP,EAAA,MAAAJ,KAAA,IAAA,GAEAY,IAAAR,EAAA,OAAA;AAAA,MAAuE,CAAA,aAAArB,EAAA,WAAA,EAAA,GAAAW,EAAA,kBAAAT,EAAA;AAAA,MACiC,sBAAAS,EAAA;AAAA,MACxE,sBAAAA,EAAA;AAAA,IACA,EAAA,GAGhCmB,IAAA,CAAAC,MAAA;AACI,MAAAlB,EAAA,SAAAkB,EAAA,OAAA,OAAA;AAAA,IAAwD,GAI5DC,IAAA,CAAAD,MAAA;AACI,MAAApB,EAAA,YACIoB,EAAA,eAAA;AAAA,IACJ;AAGJ,WAAAE;AAAA,MAAA,MAAAtB,EAAA;AAAA,MACgB,CAAAuB,MAAA;AAER,QAAAnB,EAAA,QAAAmB;AAAA,MAAoB;AAAA,IACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { defineComponent as R, computed as C, openBlock as I, createBlock as _, unref as p, normalizeClass as k, withCtx as T, createVNode as x, createTextVNode as U, toDisplayString as H, nextTick as W, createApp as $, h as q, reactive as L } from "vue";
|
|
2
|
+
import { l as r } from "./events.BQOQSSb7.js";
|
|
3
|
+
import { g as F } from "./generate-uid.DBWe4g6T.js";
|
|
4
|
+
import { c as w, P as G, a as j } from "./popper-container.DMN8n5iC.js";
|
|
5
|
+
import { B as M } from "./typography.B3J6_tYk.js";
|
|
6
|
+
import { _ as V } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
7
|
+
import "../assets/tooltip.css";
|
|
8
|
+
const g = { ...w };
|
|
9
|
+
var z = /* @__PURE__ */ ((t) => (t.HIDDEN = "hidden", t))(z || {}), P = /* @__PURE__ */ ((t) => (t.ESCAPE = "Escape", t.ENTER = "Enter", t.ARROW_LEFT = "ArrowLeft", t.ARROW_UP = "ArrowUp", t.ARROW_RIGHT = "ArrowRight", t.ARROW_DOWN = "ArrowDown", t.PAGE_UP = "PageUp", t.PAGE_DOWN = "PageDown", t.END = "End", t.HOME = "Home", t.TAB = "Tab", t))(P || {});
|
|
10
|
+
const b = { ...w };
|
|
11
|
+
var S = /* @__PURE__ */ ((t) => (t.HIDDEN = "hidden", t))(S || {});
|
|
12
|
+
const Y = {
|
|
13
|
+
name: "tooltip"
|
|
14
|
+
}, J = /* @__PURE__ */ R({
|
|
15
|
+
...Y,
|
|
16
|
+
props: {
|
|
17
|
+
/**
|
|
18
|
+
* The tooltip's id. Necessary for accessibility purposes.
|
|
19
|
+
*/
|
|
20
|
+
id: { type: String, default: null },
|
|
21
|
+
/**
|
|
22
|
+
* Tooltip's target reference to the DOM element or Vue component.
|
|
23
|
+
* The tooltip will position itself relatively to target element, in the specified position.
|
|
24
|
+
*/
|
|
25
|
+
targetElement: { type: [Element, Object], required: !0 },
|
|
26
|
+
/**
|
|
27
|
+
* Tooltip's position relative to the target element.
|
|
28
|
+
* Possible values are: 'top', 'bottom', 'left' and 'right'.
|
|
29
|
+
*/
|
|
30
|
+
position: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: b.TOP,
|
|
33
|
+
validator: (t) => Object.values(b).includes(t)
|
|
34
|
+
},
|
|
35
|
+
/**
|
|
36
|
+
* Tooltip's offset.
|
|
37
|
+
* If specified, the tooltip will have an offset in pixels between it and the target element
|
|
38
|
+
* in specified position.
|
|
39
|
+
*/
|
|
40
|
+
offset: { type: Number, default: 0 },
|
|
41
|
+
/**
|
|
42
|
+
* Tooltip's text content.
|
|
43
|
+
*/
|
|
44
|
+
content: { type: String, required: !0 },
|
|
45
|
+
/**
|
|
46
|
+
* Shows / Hides the Tooltip component
|
|
47
|
+
*/
|
|
48
|
+
isShown: { type: Boolean, default: !1 },
|
|
49
|
+
/**
|
|
50
|
+
* Allows to configure to fallback position to the one specified, it could be 'auto' or ['right', 'top', ...].
|
|
51
|
+
* Useful when not using auto as starting placement.
|
|
52
|
+
* @see {@link https://floating-ui.com/docs/flip#fallbackplacements}
|
|
53
|
+
*/
|
|
54
|
+
fallbackPosition: {
|
|
55
|
+
type: [Array, String],
|
|
56
|
+
default: () => ["top", "bottom", "right", "left"]
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* Disables focus-trap for tooltip.
|
|
60
|
+
* Useful for maintaining focus on the target element.
|
|
61
|
+
*/
|
|
62
|
+
disabledFocusTrap: { type: Boolean, default: !1 }
|
|
63
|
+
},
|
|
64
|
+
setup(t) {
|
|
65
|
+
const o = t, n = C(() => ({
|
|
66
|
+
[`b-tooltip--${S.HIDDEN}`]: !o.isShown
|
|
67
|
+
}));
|
|
68
|
+
return (i, E) => (I(), _(p(G), {
|
|
69
|
+
id: t.id,
|
|
70
|
+
"aria-role": p(j).TOOLTIP,
|
|
71
|
+
arrow: { classes: ["b-tooltip__arrow"] },
|
|
72
|
+
class: k([n.value, "b-tooltip"]),
|
|
73
|
+
"fallback-position": t.fallbackPosition,
|
|
74
|
+
"is-hidden": !t.isShown,
|
|
75
|
+
offset: [0, 4],
|
|
76
|
+
position: t.position,
|
|
77
|
+
"target-element": t.targetElement,
|
|
78
|
+
"disabled-focus-trap": t.disabledFocusTrap
|
|
79
|
+
}, {
|
|
80
|
+
default: T(() => [
|
|
81
|
+
x(p(M), {
|
|
82
|
+
el: "span",
|
|
83
|
+
variant: "caption"
|
|
84
|
+
}, {
|
|
85
|
+
default: T(() => [
|
|
86
|
+
U(H(t.content), 1)
|
|
87
|
+
]),
|
|
88
|
+
_: 1
|
|
89
|
+
})
|
|
90
|
+
]),
|
|
91
|
+
_: 1
|
|
92
|
+
}, 8, ["id", "aria-role", "class", "fallback-position", "is-hidden", "position", "target-element", "disabled-focus-trap"]));
|
|
93
|
+
}
|
|
94
|
+
}), A = /* @__PURE__ */ V(J, [["__scopeId", "data-v-72e03ce3"]]), s = [], O = "aria-describedby", D = F("tooltip");
|
|
95
|
+
let l, e, u = !1;
|
|
96
|
+
const a = L({
|
|
97
|
+
targetElement: null,
|
|
98
|
+
content: "START_MESSAGE",
|
|
99
|
+
id: D,
|
|
100
|
+
position: void 0,
|
|
101
|
+
isShown: !1
|
|
102
|
+
}), Q = (t) => {
|
|
103
|
+
t.setAttribute("tabindex", "0"), a.targetElement = t, e = $({
|
|
104
|
+
components: { Tooltip: A },
|
|
105
|
+
setup() {
|
|
106
|
+
return () => q(A, { ...a }, "");
|
|
107
|
+
}
|
|
108
|
+
}), l = document.createElement("div"), l.id = "tooltip-parent", document.body.appendChild(l), e.mount("#tooltip-parent");
|
|
109
|
+
}, X = () => {
|
|
110
|
+
e.unmount(), document.contains(l) && document.body.removeChild(l), e = void 0;
|
|
111
|
+
}, B = (t) => Object.values(g).includes(t.arg) ? t.arg : g.TOP, m = (t) => s.find(
|
|
112
|
+
(o) => (
|
|
113
|
+
// isEqualNode doesn't work correct for svg element, hence the second check here
|
|
114
|
+
o.target.isEqualNode(t) && o.target === t
|
|
115
|
+
)
|
|
116
|
+
), N = (t) => {
|
|
117
|
+
const o = m(t);
|
|
118
|
+
if (!o || !o.content || !t || !e)
|
|
119
|
+
return;
|
|
120
|
+
t && t.setAttribute(O, D);
|
|
121
|
+
let n = !1;
|
|
122
|
+
document.querySelectorAll("dialog").forEach((i) => {
|
|
123
|
+
n = i?.open || n;
|
|
124
|
+
}), n && (e?._instance?.vnode?.el && t.after(e?._instance?.vnode?.el), n = !1), u = !0, e.content = o.content, e.position = o.position, a.content = o.content, a.position = o.position, W(() => {
|
|
125
|
+
!u || !e || (e.targetElement = t, e.isShown = !0, a.targetElement = t, a.isShown = !0);
|
|
126
|
+
});
|
|
127
|
+
}, h = (t) => {
|
|
128
|
+
e?.$el?.parentElement?.tagName && e.$el.parentElement.tagName !== "BODY" && document.body.appendChild(e.$el), u = !1, e && (e.isShown = !1), a.isShown = !1, t && t.removeAttribute(O);
|
|
129
|
+
}, f = (t, o) => {
|
|
130
|
+
if (!o.hasOwnProperty("value") || o.value) {
|
|
131
|
+
s.length === 0 && Q(t);
|
|
132
|
+
const n = () => N(t), i = () => h(t), E = {
|
|
133
|
+
target: t,
|
|
134
|
+
content: o.value,
|
|
135
|
+
position: B(o),
|
|
136
|
+
removeListeners: [
|
|
137
|
+
r(t, "mouseenter", n),
|
|
138
|
+
r(t, "mouseleave", i),
|
|
139
|
+
r(t, "focus", () => {
|
|
140
|
+
t.matches(":focus-visible") && n();
|
|
141
|
+
}),
|
|
142
|
+
r(t, "blur", (c) => {
|
|
143
|
+
c.relatedTarget?.getAttribute("role") !== "tooltip" && i();
|
|
144
|
+
}),
|
|
145
|
+
r(t, "keydown", (c) => {
|
|
146
|
+
c.key === P.ESCAPE && i();
|
|
147
|
+
})
|
|
148
|
+
]
|
|
149
|
+
};
|
|
150
|
+
s.push(E);
|
|
151
|
+
}
|
|
152
|
+
}, d = (t, o) => {
|
|
153
|
+
const n = m(t);
|
|
154
|
+
if (n) {
|
|
155
|
+
if (n?.content !== o.value && (n.content = o.value, e.isShown && e.targetElement.isEqualNode(t) && (n.content ? e.content = o.value : e.isShown = !1, h(t), N(t))), n.position !== o.arg) {
|
|
156
|
+
const i = B(o);
|
|
157
|
+
n.position = i, e.position = i;
|
|
158
|
+
}
|
|
159
|
+
} else !n && o.value && f(t, o);
|
|
160
|
+
}, v = (t) => {
|
|
161
|
+
const o = m(t);
|
|
162
|
+
o && (o.removeListeners.forEach((n) => {
|
|
163
|
+
n();
|
|
164
|
+
}), h(), s.splice(s.indexOf(o), 1), s.length === 0 && X());
|
|
165
|
+
}, it = {
|
|
166
|
+
// Vue 2 Directive hooks
|
|
167
|
+
bind(t, o) {
|
|
168
|
+
f(t, o);
|
|
169
|
+
},
|
|
170
|
+
update(t, o) {
|
|
171
|
+
d(t, o);
|
|
172
|
+
},
|
|
173
|
+
unbind(t) {
|
|
174
|
+
v(t);
|
|
175
|
+
},
|
|
176
|
+
// Vue 3 Directive hooks
|
|
177
|
+
beforeMount(t, o) {
|
|
178
|
+
f(t, o);
|
|
179
|
+
},
|
|
180
|
+
mounted(t, o) {
|
|
181
|
+
d(t, o);
|
|
182
|
+
},
|
|
183
|
+
updated(t, o) {
|
|
184
|
+
d(t, o);
|
|
185
|
+
},
|
|
186
|
+
unmounted(t) {
|
|
187
|
+
v(t);
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
export {
|
|
191
|
+
b as B,
|
|
192
|
+
P as E,
|
|
193
|
+
A as T,
|
|
194
|
+
S as a,
|
|
195
|
+
it as b,
|
|
196
|
+
g as c,
|
|
197
|
+
z as d
|
|
198
|
+
};
|
|
199
|
+
//# sourceMappingURL=tooltip.CbADa_4p.js.map
|