@adyen/bento-vue2 1.83.1 → 1.84.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/README.md +5 -5
- package/dist/@types/index.d.ts +56 -5
- package/dist/action-bar.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/ai-button.css +1 -1
- package/dist/assets/alert.css +1 -1
- package/dist/assets/avatar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions-with-menu.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/checkbox-group.css +1 -1
- package/dist/assets/checkbox-input.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/chip.css +1 -1
- package/dist/assets/code-snippet.css +1 -1
- package/dist/assets/controls-group.css +1 -1
- package/dist/assets/country.css +1 -1
- package/dist/assets/currency.css +1 -1
- package/dist/assets/dashboard-section.css +1 -1
- package/dist/assets/dashed-underline.css +1 -1
- package/dist/assets/data-grid-template.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-picker.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/date.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/divider.css +1 -1
- package/dist/assets/dropdown-default-textbox.css +1 -1
- package/dist/assets/dropdown-tag.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/empty-state.css +1 -1
- package/dist/assets/field-label.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/fixed-scroller.css +1 -1
- package/dist/assets/footer-actions.css +1 -1
- package/dist/assets/form-layout-title.css +1 -1
- package/dist/assets/grid-layout.css +1 -1
- package/dist/assets/header-meta.css +1 -1
- package/dist/assets/header-with-views.css +1 -1
- package/dist/assets/header.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/info-icon.css +1 -1
- package/dist/assets/input-field-password.css +1 -1
- package/dist/assets/input-field.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/layout-row.css +1 -1
- package/dist/assets/link.css +1 -1
- package/dist/assets/listbox-option-tag.css +1 -1
- package/dist/assets/loading-indicator.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/pagination.css +1 -1
- package/dist/assets/payment-method.css +1 -1
- package/dist/assets/popper-container.css +1 -1
- package/dist/assets/promo-banner.css +1 -1
- package/dist/assets/radio-group.css +1 -1
- package/dist/assets/radio-input.css +1 -1
- package/dist/assets/rich-text-editor.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/segmented-control.css +1 -1
- package/dist/assets/selection-card-group.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/status.css +1 -1
- package/dist/assets/step.css +1 -1
- package/dist/assets/structured-list-item.css +1 -1
- package/dist/assets/summary-grid.css +1 -1
- package/dist/assets/tab.css +1 -1
- package/dist/assets/tag.css +1 -1
- package/dist/assets/textarea.css +1 -1
- package/dist/assets/timeline-item.css +1 -1
- package/dist/assets/toast.css +1 -1
- package/dist/assets/toggle.css +1 -1
- package/dist/assets/tooltip.css +1 -1
- package/dist/assets/tutorial.css +1 -1
- package/dist/assets/use-cached-selected-values.css +1 -1
- package/dist/button.js +3 -3
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{action-bar.C2GnRugW.js → action-bar.y4tcdk7R.js} +8 -6
- package/dist/chunks/{action-bar.C2GnRugW.js.map → action-bar.y4tcdk7R.js.map} +1 -1
- package/dist/chunks/{ai-button.C9Uc6vBY.js → ai-button.BEy4Gly-.js} +2 -2
- package/dist/chunks/{ai-button.C9Uc6vBY.js.map → ai-button.BEy4Gly-.js.map} +1 -1
- package/dist/chunks/{alert.BlJBrD8c.js → alert.B3Pdp02a.js} +29 -21
- package/dist/chunks/{alert.BlJBrD8c.js.map → alert.B3Pdp02a.js.map} +1 -1
- package/dist/chunks/{base-modal.L39wmqVD.js → base-modal.KYkLKswF.js} +20 -18
- package/dist/chunks/{base-modal.L39wmqVD.js.map → base-modal.KYkLKswF.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.CQlsQa_f.js → button-actions-with-menu.B5mKwc-F.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.CQlsQa_f.js.map → button-actions-with-menu.B5mKwc-F.js.map} +1 -1
- package/dist/chunks/{button-actions.BWVq6OZQ.js → button-actions.D9n7MxWe.js} +270 -239
- package/dist/chunks/{button-actions.BWVq6OZQ.js.map → button-actions.D9n7MxWe.js.map} +1 -1
- package/dist/chunks/{button.C5GvPqe5.js → button.DIU6m9wD.js} +2 -2
- package/dist/chunks/{button.C5GvPqe5.js.map → button.DIU6m9wD.js.map} +1 -1
- package/dist/chunks/calendar.C8DpZ4Sr.js +1101 -0
- package/dist/chunks/calendar.C8DpZ4Sr.js.map +1 -0
- package/dist/chunks/{card.CktheSva.js → card.CLX0RGG6.js} +2 -2
- package/dist/chunks/{card.CktheSva.js.map → card.CLX0RGG6.js.map} +1 -1
- package/dist/chunks/{checkbox-group.BUXnMhO8.js → checkbox-group.BCnhjQie.js} +4 -4
- package/dist/chunks/{checkbox-group.BUXnMhO8.js.map → checkbox-group.BCnhjQie.js.map} +1 -1
- package/dist/chunks/{checkbox-input.B0NsfSNR.js → checkbox-input.08E9BNeF.js} +45 -40
- package/dist/chunks/checkbox-input.08E9BNeF.js.map +1 -0
- package/dist/chunks/{checkbox.DgPVHJnT.js → checkbox.CU5ierOq.js} +9 -9
- package/dist/chunks/{checkbox.DgPVHJnT.js.map → checkbox.CU5ierOq.js.map} +1 -1
- package/dist/chunks/{code-snippet.1_edHDaZ.js → code-snippet.9MwDHp50.js} +62 -60
- package/dist/chunks/code-snippet.9MwDHp50.js.map +1 -0
- package/dist/chunks/constructNow.DuaJst0D.js +8 -0
- package/dist/chunks/{constructNow.BhymNmy5.js.map → constructNow.DuaJst0D.js.map} +1 -1
- package/dist/chunks/{controls-group.BqPxnEl3.js → controls-group.D4eW9DtP.js} +2 -2
- package/dist/chunks/{controls-group.BqPxnEl3.js.map → controls-group.D4eW9DtP.js.map} +1 -1
- package/dist/chunks/{copy.I2GvwCvt.js → copy.C0q7xgXs.js} +19 -17
- package/dist/chunks/{copy.I2GvwCvt.js.map → copy.C0q7xgXs.js.map} +1 -1
- package/dist/chunks/{country.BPrh4fXO.js → country.DyrDj95W.js} +2 -2
- package/dist/chunks/{country.BPrh4fXO.js.map → country.DyrDj95W.js.map} +1 -1
- package/dist/chunks/country.types.DaVCMxk-.js +773 -0
- package/dist/chunks/{country.types.C0Q_hhgJ.js.map → country.types.DaVCMxk-.js.map} +1 -1
- package/dist/chunks/{dashboard-section.B4bHrFIl.js → dashboard-section.B83FdC0Z.js} +3 -3
- package/dist/chunks/{dashboard-section.B4bHrFIl.js.map → dashboard-section.B83FdC0Z.js.map} +1 -1
- package/dist/chunks/{dashed-underline.ByK3QxFJ.js → dashed-underline.DQGVy5T2.js} +2 -2
- package/dist/chunks/{dashed-underline.ByK3QxFJ.js.map → dashed-underline.DQGVy5T2.js.map} +1 -1
- package/dist/chunks/{data-grid-template.CvZbOkih.js → data-grid-template.BTEFoEwf.js} +4 -4
- package/dist/chunks/{data-grid-template.CvZbOkih.js.map → data-grid-template.BTEFoEwf.js.map} +1 -1
- package/dist/chunks/{data-grid.CsVqTwy0.js → data-grid.BPG1GPIl.js} +482 -398
- package/dist/chunks/{data-grid.CsVqTwy0.js.map → data-grid.BPG1GPIl.js.map} +1 -1
- package/dist/chunks/date-input.BbZqj10S.js +15 -0
- package/dist/chunks/date-input.BbZqj10S.js.map +1 -0
- package/dist/chunks/{date-picker.-a_TXwjx.js → date-picker.CnsC_UMG.js} +78 -74
- package/dist/chunks/date-picker.CnsC_UMG.js.map +1 -0
- package/dist/chunks/date-range-picker.B6GSRjjK.js +1693 -0
- package/dist/chunks/date-range-picker.B6GSRjjK.js.map +1 -0
- package/dist/chunks/de.DvtL0g75.js +478 -0
- package/dist/chunks/de.DvtL0g75.js.map +1 -0
- package/dist/chunks/{dialog-page.Dn-WbcxU.js → dialog-page.QpRiNPyx.js} +29 -23
- package/dist/chunks/{dialog-page.Dn-WbcxU.js.map → dialog-page.QpRiNPyx.js.map} +1 -1
- package/dist/chunks/differenceInMonths.DcFDl4eH.js +43 -0
- package/dist/chunks/differenceInMonths.DcFDl4eH.js.map +1 -0
- package/dist/chunks/{dropdown-tag.AYIB0ec5.js → dropdown-tag.HBM0wrEV.js} +4 -4
- package/dist/chunks/{dropdown-tag.AYIB0ec5.js.map → dropdown-tag.HBM0wrEV.js.map} +1 -1
- package/dist/chunks/{dropdown.Dt0_ZUBn.js → dropdown.C2pXf8Li.js} +85 -81
- package/dist/chunks/{dropdown.Dt0_ZUBn.js.map → dropdown.C2pXf8Li.js.map} +1 -1
- package/dist/chunks/{empty-state.jVTWhJW7.js → empty-state.DpBnqAxu.js} +2 -2
- package/dist/chunks/{empty-state.jVTWhJW7.js.map → empty-state.DpBnqAxu.js.map} +1 -1
- package/dist/chunks/en-GB.DCGuCmAv.js +46 -0
- package/dist/chunks/en-GB.DCGuCmAv.js.map +1 -0
- package/dist/chunks/{getTimezoneOffsetInMilliseconds.B7sxiukN.js → en-US.BZii9jNW.js} +160 -196
- package/dist/chunks/en-US.BZii9jNW.js.map +1 -0
- package/dist/chunks/es.bz0mzkMq.js +374 -0
- package/dist/chunks/es.bz0mzkMq.js.map +1 -0
- package/dist/chunks/es6.C1DXQV6f.js +12 -0
- package/dist/chunks/es6.C1DXQV6f.js.map +1 -0
- package/dist/chunks/{field-label.BpeaR4Qc.js → field-label.CEkJnsiL.js} +5 -5
- package/dist/chunks/{field-label.BpeaR4Qc.js.map → field-label.CEkJnsiL.js.map} +1 -1
- package/dist/chunks/{file-uploader.G6mr6RuA.js → file-uploader.CnOqfuI-.js} +299 -253
- package/dist/chunks/{file-uploader.G6mr6RuA.js.map → file-uploader.CnOqfuI-.js.map} +1 -1
- package/dist/chunks/filter-bar.CnJAxz9B.js +2559 -0
- package/dist/chunks/filter-bar.CnJAxz9B.js.map +1 -0
- package/dist/chunks/fixed-scroller.Bp4-iO80.js +114 -0
- package/dist/chunks/{fixed-scroller.Ca1ujamx.js.map → fixed-scroller.Bp4-iO80.js.map} +1 -1
- package/dist/chunks/{footer-actions.3JdT8b0p.js → footer-actions.BOiN47Xd.js} +3 -3
- package/dist/chunks/{footer-actions.3JdT8b0p.js.map → footer-actions.BOiN47Xd.js.map} +1 -1
- package/dist/chunks/{form-layout-title.D9GJQfF9.js → form-layout-title.CdC1T4gs.js} +2 -2
- package/dist/chunks/{form-layout-title.D9GJQfF9.js.map → form-layout-title.CdC1T4gs.js.map} +1 -1
- package/dist/chunks/fr-CA.B1aPU8fp.js +48 -0
- package/dist/chunks/fr-CA.B1aPU8fp.js.map +1 -0
- package/dist/chunks/fr.Dj7wEToe.js +47 -0
- package/dist/chunks/fr.Dj7wEToe.js.map +1 -0
- package/dist/chunks/getTimezoneOffsetInMilliseconds.C-aIpRfB.js +51 -0
- package/dist/chunks/getTimezoneOffsetInMilliseconds.C-aIpRfB.js.map +1 -0
- package/dist/chunks/header-meta.D_oAu2S9.js +212 -0
- package/dist/chunks/header-meta.D_oAu2S9.js.map +1 -0
- package/dist/chunks/{header-with-views.lzT3kGpo.js → header-with-views.Dc9LUYNY.js} +379 -315
- package/dist/chunks/{header-with-views.lzT3kGpo.js.map → header-with-views.Dc9LUYNY.js.map} +1 -1
- package/dist/chunks/{header.D76MKCdS.js → header.BmtlQmPs.js} +3 -3
- package/dist/chunks/{header.D76MKCdS.js.map → header.BmtlQmPs.js.map} +1 -1
- package/dist/chunks/{input-field-password.C7zjyp7f.js → input-field-password.D23H_RvO.js} +48 -42
- package/dist/chunks/{input-field-password.C7zjyp7f.js.map → input-field-password.D23H_RvO.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.DwuTziSU.js → input-field-phone-number.Bvk2Pvec.js} +9 -3
- package/dist/chunks/{input-field-phone-number.DwuTziSU.js.map → input-field-phone-number.Bvk2Pvec.js.map} +1 -1
- package/dist/chunks/{input-field.DsT4AWXC.js → input-field.hf0_ALq0.js} +37 -29
- package/dist/chunks/{input-field.DsT4AWXC.js.map → input-field.hf0_ALq0.js.map} +1 -1
- package/dist/chunks/{inspector.2A5vWUou.js → inspector.C0iAxxoz.js} +40 -34
- package/dist/chunks/{inspector.2A5vWUou.js.map → inspector.C0iAxxoz.js.map} +1 -1
- package/dist/chunks/isSameWeek.CUD7czUN.js +14 -0
- package/dist/chunks/isSameWeek.CUD7czUN.js.map +1 -0
- package/dist/chunks/it.Oaj6BklL.js +392 -0
- package/dist/chunks/it.Oaj6BklL.js.map +1 -0
- package/dist/chunks/ja.Cm9tJMi2.js +367 -0
- package/dist/chunks/ja.Cm9tJMi2.js.map +1 -0
- package/dist/chunks/ko.Ceaof6EP.js +348 -0
- package/dist/chunks/ko.Ceaof6EP.js.map +1 -0
- package/dist/chunks/{link.BoDUCYmM.js → link.PsTSQjK3.js} +27 -21
- package/dist/chunks/{link.BoDUCYmM.js.map → link.PsTSQjK3.js.map} +1 -1
- package/dist/chunks/match.CMBZxEs9.js +302 -0
- package/dist/chunks/match.CMBZxEs9.js.map +1 -0
- package/dist/chunks/{modal-fullscreen.CcvZBUoF.js → modal-fullscreen.B1gltlxA.js} +5 -5
- package/dist/chunks/{modal-fullscreen.CcvZBUoF.js.map → modal-fullscreen.B1gltlxA.js.map} +1 -1
- package/dist/chunks/{modal.6hFEbnZM.js → modal.e3EQ6Kex.js} +5 -5
- package/dist/chunks/{modal.6hFEbnZM.js.map → modal.e3EQ6Kex.js.map} +1 -1
- package/dist/chunks/nl.B6vCf2B9.js +327 -0
- package/dist/chunks/nl.B6vCf2B9.js.map +1 -0
- package/dist/chunks/{pagination.BSyshRGH.js → pagination.BcFt2FqK.js} +6 -6
- package/dist/chunks/{pagination.BSyshRGH.js.map → pagination.BcFt2FqK.js.map} +1 -1
- package/dist/chunks/{promo-banner.D3aG5wnp.js → promo-banner.yfBorKj7.js} +2 -2
- package/dist/chunks/{promo-banner.D3aG5wnp.js.map → promo-banner.yfBorKj7.js.map} +1 -1
- package/dist/chunks/pt-BR.CiGdfP45.js +380 -0
- package/dist/chunks/pt-BR.CiGdfP45.js.map +1 -0
- package/dist/chunks/{radio-group.DTZwsfwW.js → radio-group.CtTnfkYg.js} +3 -3
- package/dist/chunks/{radio-group.DTZwsfwW.js.map → radio-group.CtTnfkYg.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.B0ivi3UG.js → rich-text-editor.Dq2CFGOu.js} +5 -5
- package/dist/chunks/{rich-text-editor.B0ivi3UG.js.map → rich-text-editor.Dq2CFGOu.js.map} +1 -1
- package/dist/chunks/{search-bar.Bpk-PuYT.js → search-bar.B0SdQBnY.js} +3 -3
- package/dist/chunks/{search-bar.Bpk-PuYT.js.map → search-bar.B0SdQBnY.js.map} +1 -1
- package/dist/chunks/{secondary-nav.BGOYJrsB.js → secondary-nav.BPGpxd0p.js} +35 -29
- package/dist/chunks/{secondary-nav.BGOYJrsB.js.map → secondary-nav.BPGpxd0p.js.map} +1 -1
- package/dist/chunks/{selection-card-group.CLqWoLSN.js → selection-card-group.BryV14qP.js} +5 -5
- package/dist/chunks/{selection-card-group.CLqWoLSN.js.map → selection-card-group.BryV14qP.js.map} +1 -1
- package/dist/chunks/{sidepanel.C5SvJNMR.js → sidepanel.NFyZGE57.js} +5 -5
- package/dist/chunks/{sidepanel.C5SvJNMR.js.map → sidepanel.NFyZGE57.js.map} +1 -1
- package/dist/chunks/startOfWeek.Dxw2MhGp.js +10 -0
- package/dist/chunks/startOfWeek.Dxw2MhGp.js.map +1 -0
- package/dist/chunks/step.BLFXvHL6.js +223 -0
- package/dist/chunks/step.BLFXvHL6.js.map +1 -0
- package/dist/chunks/{structured-list-item.CbXDKwsF.js → structured-list-item.CptOCpHP.js} +3 -3
- package/dist/chunks/{structured-list-item.CbXDKwsF.js.map → structured-list-item.CptOCpHP.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.haWi7oaf.js → summary-grid.types.B1T8_k1m.js} +3 -3
- package/dist/chunks/{summary-grid.types.haWi7oaf.js.map → summary-grid.types.B1T8_k1m.js.map} +1 -1
- package/dist/chunks/sv.f8EfZjMZ.js +377 -0
- package/dist/chunks/sv.f8EfZjMZ.js.map +1 -0
- package/dist/chunks/{tab.ZQfGp_FP.js → tab.FUMpPsBP.js} +2 -2
- package/dist/chunks/{tab.ZQfGp_FP.js.map → tab.FUMpPsBP.js.map} +1 -1
- package/dist/chunks/{textarea.DfR2o1lz.js → textarea.riUt0BiI.js} +31 -31
- package/dist/chunks/textarea.riUt0BiI.js.map +1 -0
- package/dist/chunks/{timeline-item.rLqeBsyz.js → timeline-item.CFfW1DoD.js} +16 -15
- package/dist/chunks/{timeline-item.rLqeBsyz.js.map → timeline-item.CFfW1DoD.js.map} +1 -1
- package/dist/chunks/{toast.C7lu_NsX.js → toast.Csv6tMyT.js} +2 -2
- package/dist/chunks/{toast.C7lu_NsX.js.map → toast.Csv6tMyT.js.map} +1 -1
- package/dist/chunks/{tutorial.DA775wec.js → tutorial.D18LwXVy.js} +2 -2
- package/dist/chunks/{tutorial.DA775wec.js.map → tutorial.D18LwXVy.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.DIKJ8yNE.js → use-cached-selected-values.gDWGi5Nk.js} +240 -231
- package/dist/chunks/{use-cached-selected-values.DIKJ8yNE.js.map → use-cached-selected-values.gDWGi5Nk.js.map} +1 -1
- package/dist/chunks/{use-country-items.B3Cd3Tdo.js → use-country-items.ClS_So5N.js} +2 -2
- package/dist/chunks/{use-country-items.B3Cd3Tdo.js.map → use-country-items.ClS_So5N.js.map} +1 -1
- package/dist/chunks/zh-CN.BzH0fIXr.js +389 -0
- package/dist/chunks/zh-CN.BzH0fIXr.js.map +1 -0
- package/dist/code-snippet.js +1 -1
- package/dist/country.js +2 -2
- 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/dropdown.js +3 -3
- package/dist/empty-state.js +1 -1
- 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 +250 -251
- package/dist/index.js.map +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 +10 -10
- package/dist/link.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/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/stepper.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/styles/bento-dark.css +0 -1829
- package/dist/styles/bento-light.css +0 -1829
- package/dist/styles/bento.css +0 -1829
- package/dist/styles/legacy.css +0 -1829
- package/dist/styles/styleguide.css +0 -1829
- package/dist/summary-grid.js +1 -1
- package/dist/tabs.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/package.json +14 -25
- package/dist/@types/components.d.ts +0 -196
- package/dist/@types/use-form-v4.d.ts +0 -86
- package/dist/chunks/calendar.DCLyThOl.js +0 -1832
- package/dist/chunks/calendar.DCLyThOl.js.map +0 -1
- package/dist/chunks/checkbox-input.B0NsfSNR.js.map +0 -1
- package/dist/chunks/code-snippet.1_edHDaZ.js.map +0 -1
- package/dist/chunks/constructNow.BhymNmy5.js +0 -8
- package/dist/chunks/country.types.C0Q_hhgJ.js +0 -269
- package/dist/chunks/date-format.B8RU7D42.js +0 -17
- package/dist/chunks/date-format.B8RU7D42.js.map +0 -1
- package/dist/chunks/date-picker.-a_TXwjx.js.map +0 -1
- package/dist/chunks/date-range-picker.Bw1yPTu-.js +0 -906
- package/dist/chunks/date-range-picker.Bw1yPTu-.js.map +0 -1
- package/dist/chunks/differenceInMonths.Cab3nOsb.js +0 -1590
- package/dist/chunks/differenceInMonths.Cab3nOsb.js.map +0 -1
- package/dist/chunks/es6.MoTTyETW.js +0 -12
- package/dist/chunks/es6.MoTTyETW.js.map +0 -1
- package/dist/chunks/filter-bar.DNA9QblV.js +0 -2472
- package/dist/chunks/filter-bar.DNA9QblV.js.map +0 -1
- package/dist/chunks/fixed-scroller.Ca1ujamx.js +0 -106
- package/dist/chunks/getTimezoneOffsetInMilliseconds.B7sxiukN.js.map +0 -1
- package/dist/chunks/header-meta.C8_W0j_p.js +0 -170
- package/dist/chunks/header-meta.C8_W0j_p.js.map +0 -1
- package/dist/chunks/step.mqn8E6dm.js +0 -217
- package/dist/chunks/step.mqn8E6dm.js.map +0 -1
- package/dist/chunks/textarea.DfR2o1lz.js.map +0 -1
- package/dist/web-types.json +0 -17280
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import { defineComponent as L, ref as p, computed as o, watch as R, provide as D, readonly as W, useSlots as z, inject as U, onMounted as Z, onBeforeUnmount as j } from "vue";
|
|
2
|
-
import { B as k } from "./typography.Bq-EGj9y.js";
|
|
3
|
-
import { u as G } from "./index.B6WW_F-J.js";
|
|
4
|
-
import { B as N, a as M } from "./keyboard-navigation.DWmhelVv.js";
|
|
5
|
-
import { n as P } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
6
|
-
import { B as q } from "./base-button.IN4bpcds.js";
|
|
7
|
-
import { C as J } from "./checkmark-small.DVDtD4HQ.js";
|
|
8
|
-
import { D as Q } from "./dot.BW9SneIk.js";
|
|
9
|
-
import "../assets/step.css";
|
|
10
|
-
const X = (a) => {
|
|
11
|
-
function n(u) {
|
|
12
|
-
return ({ detail: c }) => {
|
|
13
|
-
var t;
|
|
14
|
-
c.preventDefault();
|
|
15
|
-
const r = a.value.indexOf(document.activeElement);
|
|
16
|
-
r < 0 || (t = a.value[r + u]) == null || t.focus();
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
const s = n(-1), e = n(1);
|
|
20
|
-
return {
|
|
21
|
-
[N.ARROW_DOWN]: e,
|
|
22
|
-
[N.ARROW_RIGHT]: e,
|
|
23
|
-
[N.ARROW_UP]: s,
|
|
24
|
-
[N.ARROW_LEFT]: s
|
|
25
|
-
};
|
|
26
|
-
}, Y = (a) => {
|
|
27
|
-
const n = a.buttonElement.value.parentElement, s = n.parentElement;
|
|
28
|
-
return Array.from(s.children).indexOf(n);
|
|
29
|
-
}, $ = (a) => ({ registerStep: (e) => {
|
|
30
|
-
const u = Y(e);
|
|
31
|
-
a.value.splice(u, 0, {
|
|
32
|
-
stepContent: e.stepContent,
|
|
33
|
-
buttonElement: e.buttonElement,
|
|
34
|
-
substeps: e.substeps
|
|
35
|
-
});
|
|
36
|
-
}, removeStep: (e) => {
|
|
37
|
-
a.value.splice(
|
|
38
|
-
a.value.findIndex((u) => u.buttonElement === e.buttonElement.value),
|
|
39
|
-
1
|
|
40
|
-
);
|
|
41
|
-
} }), T = /* @__PURE__ */ Symbol("stepper state");
|
|
42
|
-
var O = /* @__PURE__ */ ((a) => (a.LINEAR = "linear", a.NON_LINEAR = "non-linear", a))(O || {}), V = /* @__PURE__ */ ((a) => (a.HORIZONTAL = "horizontal", a.VERTICAL = "vertical", a))(V || {});
|
|
43
|
-
const ee = {
|
|
44
|
-
"en-US": {
|
|
45
|
-
step: "Step {currentIndex}/{totalSteps} {content}"
|
|
46
|
-
}
|
|
47
|
-
}, te = {
|
|
48
|
-
i18n: { messages: ee },
|
|
49
|
-
name: "stepper"
|
|
50
|
-
}, se = /* @__PURE__ */ L({
|
|
51
|
-
...te,
|
|
52
|
-
props: {
|
|
53
|
-
/**
|
|
54
|
-
* Type of stepper; defines how the stepper should behave. Default: linear
|
|
55
|
-
* @values linear, non-linear
|
|
56
|
-
*/
|
|
57
|
-
type: {
|
|
58
|
-
type: String,
|
|
59
|
-
default: "linear"
|
|
60
|
-
},
|
|
61
|
-
/**
|
|
62
|
-
* Stepper variant; defines how the stepper should be displayed. Default: vertical
|
|
63
|
-
* @values vertical, horizontal
|
|
64
|
-
*/
|
|
65
|
-
variant: {
|
|
66
|
-
type: String,
|
|
67
|
-
default: "vertical"
|
|
68
|
-
},
|
|
69
|
-
/**
|
|
70
|
-
* Active step index
|
|
71
|
-
*/
|
|
72
|
-
index: {
|
|
73
|
-
type: Number,
|
|
74
|
-
default: 0
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
emits: ["update:index"],
|
|
78
|
-
setup(a, { emit: n }) {
|
|
79
|
-
const s = a, { t: e, n: u } = G(), c = p([]), r = p(s.index), t = p(r.value), d = (i) => {
|
|
80
|
-
i > t.value && (t.value = i), r.value = i;
|
|
81
|
-
}, b = o(() => {
|
|
82
|
-
var i;
|
|
83
|
-
return (i = c.value[r.value]) == null ? void 0 : i.stepContent;
|
|
84
|
-
}), y = o(() => c.value.length), x = o(() => c.value.map(({ buttonElement: i }) => i)), v = o(() => s.variant === V.HORIZONTAL), m = o(
|
|
85
|
-
() => c.value.map(({ buttonElement: i, substeps: S }, h) => {
|
|
86
|
-
const E = r.value === h;
|
|
87
|
-
return !v.value && E ? [i].concat(S.map((B) => B.buttonElement)) : [i];
|
|
88
|
-
}).flat()
|
|
89
|
-
), { registerStep: _, removeStep: C } = $(c), g = p({
|
|
90
|
-
activeStepIndex: r,
|
|
91
|
-
latestActiveStep: t,
|
|
92
|
-
steps: x,
|
|
93
|
-
type: s.type,
|
|
94
|
-
variant: s.variant,
|
|
95
|
-
navigateToStep: d,
|
|
96
|
-
registerStep: _,
|
|
97
|
-
removeStep: C
|
|
98
|
-
}), I = o(() => ({
|
|
99
|
-
"b-stepper__list--horizontal": v.value
|
|
100
|
-
}));
|
|
101
|
-
R(() => s.index, d), R(r, (i) => {
|
|
102
|
-
n("update:index", i);
|
|
103
|
-
});
|
|
104
|
-
const f = X(m);
|
|
105
|
-
return D(T, W(g)), { __sfc: !0, props: s, emit: n, t: e, n: u, childrenSteps: c, activeStepIndex: r, latestActiveStep: t, navigateToStep: d, currentStepContent: b, stepsAmount: y, childrenStepsElements: x, isHorizontalVariant: v, allVisibleStepsElements: m, registerStep: _, removeStep: C, stepperState: g, conditionalClasses: I, keyboardNavigationListeners: f, BentoTypography: k, vBentoKeyboardNavigationDirective: M };
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
var ne = function() {
|
|
109
|
-
var n = this, s = n._self._c, e = n._self._setupProxy;
|
|
110
|
-
return s("nav", { staticClass: "b-stepper" }, [s("ol", n._g({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], staticClass: "b-stepper__list", class: e.conditionalClasses }, e.keyboardNavigationListeners), [n._t("default")], 2), s(e.BentoTypography, { staticClass: "b-stepper__text-stepper", attrs: { el: "span", variant: "body", stronger: "" } }, [n._v(n._s(e.t("step", { currentIndex: e.n(e.activeStepIndex + 1), totalSteps: e.n(e.stepsAmount), content: e.currentStepContent })) + " ")])], 1);
|
|
111
|
-
}, ae = [], oe = /* @__PURE__ */ P(
|
|
112
|
-
se,
|
|
113
|
-
ne,
|
|
114
|
-
ae,
|
|
115
|
-
!1,
|
|
116
|
-
null,
|
|
117
|
-
"8c4b1051"
|
|
118
|
-
);
|
|
119
|
-
const ye = oe.exports, re = {
|
|
120
|
-
name: "step"
|
|
121
|
-
}, ie = /* @__PURE__ */ L({
|
|
122
|
-
...re,
|
|
123
|
-
props: {
|
|
124
|
-
/**
|
|
125
|
-
* Completed status. Used on non-linear steppers to indicate if the step is completed.
|
|
126
|
-
*/
|
|
127
|
-
completed: {
|
|
128
|
-
type: Boolean,
|
|
129
|
-
default: !1
|
|
130
|
-
},
|
|
131
|
-
/**
|
|
132
|
-
* Active substep index
|
|
133
|
-
*/
|
|
134
|
-
substepIndex: {
|
|
135
|
-
type: Number,
|
|
136
|
-
default: 0
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
emits: ["update:substep-index"],
|
|
140
|
-
setup(a, { emit: n }) {
|
|
141
|
-
const s = a, e = z(), u = p(null), c = p(null), r = p([]), t = U(T), d = o(() => {
|
|
142
|
-
var l;
|
|
143
|
-
return (l = u.value) == null ? void 0 : l.$el;
|
|
144
|
-
}), b = o(() => t == null ? void 0 : t.value.steps.indexOf(d.value)), y = o(() => {
|
|
145
|
-
var l;
|
|
146
|
-
return (l = c.value) == null ? void 0 : l.$el.textContent;
|
|
147
|
-
}), x = o(() => r.value.map(({ buttonElement: l }) => l)), v = p(s.substepIndex), m = p(v.value), _ = (l) => {
|
|
148
|
-
l > m.value && (m.value = l), v.value = l;
|
|
149
|
-
}, { registerStep: C, removeStep: g } = $(r), I = p({
|
|
150
|
-
activeStepIndex: v,
|
|
151
|
-
latestActiveStep: m,
|
|
152
|
-
type: t.value.type,
|
|
153
|
-
variant: t.value.variant,
|
|
154
|
-
steps: x,
|
|
155
|
-
isParentStep: !0,
|
|
156
|
-
navigateToStep: _,
|
|
157
|
-
registerStep: C,
|
|
158
|
-
removeStep: g
|
|
159
|
-
});
|
|
160
|
-
D(T, I), R(() => s.substepIndex, _), R(v, (l) => {
|
|
161
|
-
n("update:substep-index", l);
|
|
162
|
-
}), Z(() => {
|
|
163
|
-
if (!t)
|
|
164
|
-
throw new Error(
|
|
165
|
-
"BentoStep components should only be used inside BentoStepper or other BentoStep components."
|
|
166
|
-
);
|
|
167
|
-
t.value.registerStep({
|
|
168
|
-
buttonElement: d,
|
|
169
|
-
stepContent: y,
|
|
170
|
-
substeps: r
|
|
171
|
-
});
|
|
172
|
-
}), j(() => {
|
|
173
|
-
t.value.removeStep({
|
|
174
|
-
buttonElement: d,
|
|
175
|
-
stepContent: y,
|
|
176
|
-
substeps: r
|
|
177
|
-
});
|
|
178
|
-
});
|
|
179
|
-
const f = o(() => t.value.isParentStep), i = p(!1), S = o(() => (t == null ? void 0 : t.value.activeStepIndex) === b.value), h = o(
|
|
180
|
-
() => S.value && t.value.variant !== V.HORIZONTAL && !f.value && e.substeps
|
|
181
|
-
), E = o(() => (t == null ? void 0 : t.value.type) === O.NON_LINEAR ? s.completed : (t == null ? void 0 : t.value.latestActiveStep) > b.value), A = o(
|
|
182
|
-
() => (t == null ? void 0 : t.value.type) === O.LINEAR && b.value > (t == null ? void 0 : t.value.latestActiveStep)
|
|
183
|
-
), B = () => {
|
|
184
|
-
A.value || t.value.navigateToStep(b.value);
|
|
185
|
-
}, w = o(() => S.value ? "step" : "false"), F = o(() => A.value.toString()), H = o(() => i.value || b.value === 0 && !f.value ? "0" : "-1"), K = o(() => ({
|
|
186
|
-
"b-step--active": S.value,
|
|
187
|
-
"b-step--completed": E.value,
|
|
188
|
-
"b-step--substep": f.value
|
|
189
|
-
}));
|
|
190
|
-
return { __sfc: !0, slots: e, props: s, emit: n, buttonComponent: u, stepContent: c, substeps: r, stepper: t, buttonElement: d, index: b, stepContentValue: y, substepsButtonElements: x, activeSubStepIndex: v, latestActiveSubStepIndex: m, navigateToSubstep: _, registerStep: C, removeStep: g, stepState: I, isSubstep: f, isFocused: i, isActive: S, isSubstepsVisible: h, isCompleted: E, isDisabled: A, navigateToStep: B, ariaCurrentValue: w, ariaDisabledValue: F, tabIndexValue: H, conditionalClasses: K, BaseButton: q, BentoTypography: k, CheckmarkSmallIcon: J, DotIcon: Q };
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
var le = function() {
|
|
194
|
-
var n = this, s = n._self._c, e = n._self._setupProxy;
|
|
195
|
-
return s("li", { staticClass: "b-step", class: e.conditionalClasses }, [s(e.BaseButton, { ref: "buttonComponent", staticClass: "b-step__button", attrs: { "aria-current": e.ariaCurrentValue, "aria-disabled": e.ariaDisabledValue, type: "button", tabindex: e.tabIndexValue, disabled: e.isDisabled }, on: { click: e.navigateToStep, focus: function(u) {
|
|
196
|
-
e.isFocused = !0;
|
|
197
|
-
}, blur: function(u) {
|
|
198
|
-
e.isFocused = !1;
|
|
199
|
-
} }, scopedSlots: n._u([{ key: "iconLeft", fn: function() {
|
|
200
|
-
return [s(e.BentoTypography, { staticClass: "b-step__index", attrs: { el: "span", variant: "body", stronger: "", "aria-hidden": "true" } }, [e.isCompleted ? s(e.CheckmarkSmallIcon) : e.isSubstep ? s(e.DotIcon) : [n._v(n._s(e.index + 1))]], 2)];
|
|
201
|
-
}, proxy: !0 }]) }, [s(e.BentoTypography, { ref: "stepContent", staticClass: "b-step__content", attrs: { el: "span", variant: "body", stronger: e.isActive } }, [n._t("default")], 2)], 1), s("ul", { directives: [{ name: "show", rawName: "v-show", value: e.isSubstepsVisible, expression: "isSubstepsVisible" }], ref: "substepList", staticClass: "b-step__substep-list" }, [n._t("substeps")], 2)], 1);
|
|
202
|
-
}, ue = [], ce = /* @__PURE__ */ P(
|
|
203
|
-
ie,
|
|
204
|
-
le,
|
|
205
|
-
ue,
|
|
206
|
-
!1,
|
|
207
|
-
null,
|
|
208
|
-
"ffe615bc"
|
|
209
|
-
);
|
|
210
|
-
const xe = ce.exports;
|
|
211
|
-
export {
|
|
212
|
-
O as B,
|
|
213
|
-
xe as a,
|
|
214
|
-
V as b,
|
|
215
|
-
ye as s
|
|
216
|
-
};
|
|
217
|
-
//# sourceMappingURL=step.mqn8E6dm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"step.mqn8E6dm.js","sources":["../../src/components/stepper/composables/use-keyboard-navigation/use-keyboard-navigation.ts","../../src/components/stepper/composables/use-step-register/use-step-register.ts","../../src/components/stepper/stepper.keys.ts","../../src/components/stepper/stepper.types.ts","../../src/components/stepper/stepper.vue","../../src/components/stepper/components/step/step.vue"],"sourcesContent":["import { type Ref, type UnwrapRef } from 'vue';\n\nimport { BentoKeyboardNavigationKeyDownEvent } from '@/types/keyboard-navigation';\n\n/**\n * Returns keyboard navigation's event handlers to navigate through the steps\n *\n * @param steps the list of bento-steps DOM elements to focus on the navigation\n * @returns\n */\nexport const useKeyboardNavigation = (steps: Ref<UnwrapRef<Array<HTMLButtonElement>>>) => {\n // Returns the event handler that moves the focus on a given step offset\n function focusOnStep(indexOffset: number) {\n return ({ detail: event }) => {\n event.preventDefault();\n\n const currentIndex = steps.value.indexOf(document.activeElement as HTMLButtonElement);\n if (currentIndex < 0) {\n return;\n }\n\n steps.value[currentIndex + indexOffset]?.focus();\n };\n }\n\n const focusOnPreviousStep = focusOnStep(-1);\n const focusOnNextStep = focusOnStep(1);\n\n return {\n [BentoKeyboardNavigationKeyDownEvent.ARROW_DOWN]: focusOnNextStep,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_RIGHT]: focusOnNextStep,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_UP]: focusOnPreviousStep,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_LEFT]: focusOnPreviousStep,\n };\n};\n","import type { Ref, UnwrapRef } from 'vue';\nimport type { BentoStepperStepExposeState } from '../../stepper.types';\n\n/**\n * Gets the position of a `bento-step` element within its `bento-stepper` parent.\n * @param stepState The `bento-step` state.\n * @returns The index of the element.\n */\nconst getStepPosition = (stepState: BentoStepperStepExposeState) => {\n // Button is wrapped by <li> element\n const listItemElement = (stepState.buttonElement as Ref<UnwrapRef<HTMLButtonElement>>).value.parentElement;\n const listElement = listItemElement.parentElement;\n return Array.from(listElement.children).indexOf(listItemElement);\n};\n\n/**\n * Provides methods to register/unregister `bento-step` elements to/from the `bento-stepper` step state.\n * These methods allow for tracking the child step elements, including their position in the DOM tree.\n * @param childrenSteps The `bento-stepper` (or `bento-step` if substeps) step state.\n */\nexport const useStepRegister = (childrenSteps: Ref<Array<BentoStepperStepExposeState>>) => {\n /**\n * Registers a step's HTML element in the stepper state.\n * Should be called by a `bento-step` when it is mounted.\n * @param stepState The `bento-step` state.\n */\n const registerStep = (stepState: BentoStepperStepExposeState) => {\n const position = getStepPosition(stepState);\n childrenSteps.value.splice(position, 0, {\n stepContent: stepState.stepContent as string,\n buttonElement: stepState.buttonElement as HTMLButtonElement,\n substeps: stepState.substeps as Array<BentoStepperStepExposeState>,\n });\n };\n\n /**\n * Unregisters a step's HTML element in the stepper state.\n * Should be called by a `bento-step` before it is unmounted.\n * @param stepState The `bento-step` state.\n */\n const removeStep = (stepState: BentoStepperStepExposeState) => {\n childrenSteps.value.splice(\n childrenSteps.value.findIndex(step => step.buttonElement === stepState.buttonElement.value),\n 1\n );\n };\n\n return { registerStep, removeStep };\n};\n","export const STEPPER_STATE = Symbol('stepper state');\n","import type { ComputedRef, Ref, UnwrapRef } from 'vue';\n\nexport enum BentoStepperTypeOption {\n LINEAR = 'linear',\n NON_LINEAR = 'non-linear',\n}\n\nexport enum BentoStepperVariantOption {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport interface BentoStepperStepExposeState {\n buttonElement: HTMLButtonElement | Ref<UnwrapRef<HTMLButtonElement>>;\n substeps: Array<BentoStepperStepExposeState> | Ref<Array<BentoStepperStepExposeState>>;\n stepContent: string | ComputedRef<string>;\n}\n\nexport type BentoStepperState = Ref<{\n activeStepIndex: number;\n latestActiveStep: number;\n type: `${BentoStepperTypeOption}`;\n variant: `${BentoStepperVariantOption}`;\n steps: Array<HTMLElement>;\n isParentStep?: boolean;\n navigateToStep: (index: number) => void;\n registerStep: (stepState: BentoStepperStepExposeState) => void;\n removeStep: (stepState: BentoStepperStepExposeState) => void;\n}>;\n","<template>\n <nav class=\"b-stepper\">\n <ol\n v-bento-keyboard-navigation-directive\n class=\"b-stepper__list\"\n :class=\"conditionalClasses\"\n v-on=\"keyboardNavigationListeners\"\n >\n <slot></slot>\n </ol>\n\n <bento-typography el=\"span\" variant=\"body\" stronger class=\"b-stepper__text-stepper\"\n >{{\n t('step', {\n currentIndex: n(activeStepIndex + 1),\n totalSteps: n(stepsAmount),\n content: currentStepContent,\n })\n }}\n </bento-typography>\n </nav>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTypography } from '@/components/typography';\n\n import { computed, type DeepReadonly, type PropType, provide, readonly, ref, watch } from 'vue';\n import { BentoKeyboardNavigationDirective as vBentoKeyboardNavigationDirective } from '@/directives';\n\n import { useKeyboardNavigation, useStepRegister } from './composables';\n import { useI18n } from '@/utils/ts/i18n';\n\n import { STEPPER_STATE } from './stepper.keys';\n import {\n type BentoStepperState,\n type BentoStepperStepExposeState,\n type BentoStepperTypeOption,\n BentoStepperVariantOption,\n } from './stepper.types';\n\n import messages from './messages.json';\n\n const props = defineProps({\n /**\n * Type of stepper; defines how the stepper should behave. Default: linear\n * @values linear, non-linear\n */\n type: {\n type: String as PropType<`${BentoStepperTypeOption}`>,\n default: 'linear',\n },\n /**\n * Stepper variant; defines how the stepper should be displayed. Default: vertical\n * @values vertical, horizontal\n */\n variant: {\n type: String as PropType<`${BentoStepperVariantOption}`>,\n default: 'vertical',\n },\n /**\n * Active step index\n */\n index: {\n type: Number,\n default: 0,\n },\n });\n\n const emit = defineEmits([\"update:index\"]);\n\n type MessageSchema = (typeof messages)['en-US'];\n const { t, n } = useI18n<{ message: MessageSchema }>({ messages });\n\n const childrenSteps = ref<Array<BentoStepperStepExposeState>>([]);\n const activeStepIndex = ref(props.index);\n const latestActiveStep = ref(activeStepIndex.value);\n\n const navigateToStep = (index: number) => {\n // Stores latest active step index so users can navigate backwards and forwards on linear stepper\n if (index > latestActiveStep.value) {\n latestActiveStep.value = index;\n }\n activeStepIndex.value = index;\n };\n\n const currentStepContent = computed(() => childrenSteps.value[activeStepIndex.value]?.stepContent);\n const stepsAmount = computed(() => childrenSteps.value.length);\n const childrenStepsElements = computed(() => childrenSteps.value.map(({ buttonElement }) => buttonElement));\n const isHorizontalVariant = computed(() => props.variant === BentoStepperVariantOption.HORIZONTAL);\n\n // List of all visible steps nested on the stepper, including the substeps of the children steps\n // Flattening the steps on a single list makes the keyboard navigation easier to be handled\n const allVisibleStepsElements = computed(() =>\n childrenSteps.value\n .map(({ buttonElement, substeps }, index) => {\n const isStepActive = activeStepIndex.value === index;\n const isSubstepsVisible = !isHorizontalVariant.value && isStepActive;\n\n if (!isSubstepsVisible) {\n return [buttonElement];\n }\n\n return [buttonElement].concat(substeps.map(step => step.buttonElement));\n })\n .flat()\n );\n\n const { registerStep, removeStep } = useStepRegister(childrenSteps);\n\n const stepperState: BentoStepperState = ref({\n activeStepIndex,\n latestActiveStep,\n steps: childrenStepsElements,\n type: props.type,\n variant: props.variant,\n navigateToStep,\n registerStep,\n removeStep,\n });\n\n const conditionalClasses = computed(() => ({\n 'b-stepper__list--horizontal': isHorizontalVariant.value,\n }));\n\n watch(() => props.index, navigateToStep);\n watch(activeStepIndex, index => {\n emit('update:index', index);\n });\n\n const keyboardNavigationListeners = useKeyboardNavigation(allVisibleStepsElements);\n\n // Provides stepper state to BentoStep children components\n provide<DeepReadonly<BentoStepperState>>(STEPPER_STATE, readonly(stepperState));\n</script>\n\n<script lang=\"ts\">\n /**\n * Steppers break down complex processes into manageable steps to guide users through a sequential or multi-step process.\n *\n * @example\n * import { BentoStep, BentoStepper } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStep, BentoStepper },\n * template: `\n * <bento-stepper :index=\"1\">\n * <bento-step>Step 1</bento-step>\n * <bento-step>Step 2</bento-step>\n * <bento-step>Step 3</bento-step>\n * </bento-stepper>\n * `\n * }\n */\n\n export default {\n i18n: { messages },\n name: 'stepper',\n };\n</script>\n\n<style scoped src=\"./stepper.scss\" />\n","<template>\n <li :class=\"conditionalClasses\" class=\"b-step\">\n <base-button\n ref=\"buttonComponent\"\n :aria-current=\"ariaCurrentValue\"\n :aria-disabled=\"ariaDisabledValue\"\n class=\"b-step__button\"\n type=\"button\"\n :tabindex=\"tabIndexValue\"\n :disabled=\"isDisabled\"\n @click=\"navigateToStep\"\n @focus=\"isFocused = true\"\n @blur=\"isFocused = false\"\n >\n <template #iconLeft>\n <bento-typography el=\"span\" variant=\"body\" stronger class=\"b-step__index\" aria-hidden=\"true\">\n <checkmark-small-icon v-if=\"isCompleted\" />\n <template v-else-if=\"!isSubstep\">{{ index + 1 }}</template>\n <dot-icon v-else />\n </bento-typography>\n </template>\n\n <bento-typography ref=\"stepContent\" el=\"span\" variant=\"body\" :stronger=\"isActive\" class=\"b-step__content\">\n <slot></slot>\n </bento-typography>\n </base-button>\n\n <ul v-show=\"isSubstepsVisible\" ref=\"substepList\" class=\"b-step__substep-list\">\n <slot name=\"substeps\"></slot>\n </ul>\n </li>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, onBeforeUnmount, onMounted, provide, ref, useSlots, watch } from 'vue';\n import { BaseButton } from '@/components/internal/base-button';\n import { BentoTypography } from '@/components/typography';\n import CheckmarkSmallIcon from '@adyen/ui-assets-icons-16/vue/checkmark-small';\n import DotIcon from '@adyen/ui-assets-icons-16/vue/dot';\n\n import { useStepRegister } from '../../composables';\n import { STEPPER_STATE } from '../../stepper.keys';\n import {\n type BentoStepperState,\n type BentoStepperStepExposeState,\n BentoStepperTypeOption,\n BentoStepperVariantOption,\n } from '../../stepper.types';\n import { type Booleanish } from '@/types/prop-types';\n\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * Completed status. Used on non-linear steppers to indicate if the step is completed.\n */\n completed: {\n type: Boolean,\n default: false,\n },\n /**\n * Active substep index\n */\n substepIndex: {\n type: Number,\n default: 0,\n },\n });\n\n const emit = defineEmits([\"update:substep-index\"]);\n\n // Element refs\n const buttonComponent = ref<InstanceType<typeof BaseButton> | null>(null);\n const stepContent = ref<InstanceType<typeof BentoTypography> | null>(null);\n const substeps = ref<Array<BentoStepperStepExposeState>>([]);\n\n // Injects parent BentoStepper state data\n const stepper = inject<BentoStepperState>(STEPPER_STATE);\n\n const buttonElement = computed(() => buttonComponent.value?.$el as HTMLButtonElement);\n const index = computed(() => stepper?.value.steps.indexOf(buttonElement.value));\n\n const stepContentValue = computed(() => stepContent.value?.$el.textContent);\n\n // Substep logic\n const substepsButtonElements = computed(() => substeps.value.map(({ buttonElement }) => buttonElement));\n\n const activeSubStepIndex = ref(props.substepIndex);\n const latestActiveSubStepIndex = ref(activeSubStepIndex.value);\n\n const navigateToSubstep = (value: number) => {\n if (value > latestActiveSubStepIndex.value) {\n latestActiveSubStepIndex.value = value;\n }\n\n activeSubStepIndex.value = value;\n };\n\n const { registerStep, removeStep } = useStepRegister(substeps);\n\n const stepState: BentoStepperState = ref({\n activeStepIndex: activeSubStepIndex,\n latestActiveStep: latestActiveSubStepIndex,\n type: stepper.value.type,\n variant: stepper.value.variant,\n steps: substepsButtonElements,\n isParentStep: true,\n navigateToStep: navigateToSubstep,\n registerStep,\n removeStep,\n });\n\n provide(STEPPER_STATE, stepState);\n\n watch(() => props.substepIndex, navigateToSubstep);\n watch(activeSubStepIndex, value => {\n emit('update:substep-index', value);\n });\n\n onMounted(() => {\n if (!stepper) {\n throw new Error(\n 'BentoStep components should only be used inside BentoStepper or other BentoStep components.'\n );\n }\n\n stepper.value.registerStep({\n buttonElement,\n stepContent: stepContentValue,\n substeps,\n });\n });\n\n onBeforeUnmount(() => {\n stepper.value.removeStep({\n buttonElement,\n stepContent: stepContentValue,\n substeps,\n });\n });\n\n // Step states\n const isSubstep = computed(() => stepper.value.isParentStep);\n const isFocused = ref(false);\n const isActive = computed(() => stepper?.value.activeStepIndex === index.value);\n const isSubstepsVisible = computed(\n () =>\n isActive.value &&\n stepper.value.variant !== BentoStepperVariantOption.HORIZONTAL &&\n !isSubstep.value &&\n slots.substeps\n );\n const isCompleted = computed(() => {\n if (stepper?.value.type === BentoStepperTypeOption.NON_LINEAR) {\n return props.completed;\n }\n\n return stepper?.value.latestActiveStep > index.value;\n });\n const isDisabled = computed(\n () => stepper?.value.type === BentoStepperTypeOption.LINEAR && index.value > stepper?.value.latestActiveStep\n );\n\n const navigateToStep = () => {\n if (isDisabled.value) {\n return;\n }\n\n stepper.value.navigateToStep(index.value);\n };\n\n // Styling and a11y\n const ariaCurrentValue = computed(() => (isActive.value ? 'step' : ('false' as Booleanish)));\n const ariaDisabledValue = computed(() => isDisabled.value.toString() as Booleanish);\n const tabIndexValue = computed(() => (isFocused.value || (index.value === 0 && !isSubstep.value) ? '0' : '-1'));\n\n const conditionalClasses = computed(() => ({\n 'b-step--active': isActive.value,\n 'b-step--completed': isCompleted.value,\n 'b-step--substep': isSubstep.value,\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * Steps are components placed inside BentoSteppers to break down complex processes\n *\n * @example\n * import { BentoStep } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStep },\n * template: `\n * <bento-stepper>\n * <bento-step>Step 1</bento-step>\n * <bento-step>\n * Step 2\n * <template #substeps>\n * <bento-step>Substep 1</bento-step>\n * <bento-step>Substep 2</bento-step>\n * </template>\n * </bento-step>\n * </bento-stepper>\n * `\n * }\n */\n\n export default {\n name: 'step',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./step.scss\" />\n"],"names":["useKeyboardNavigation","steps","focusOnStep","indexOffset","event","currentIndex","_a","focusOnPreviousStep","focusOnNextStep","BentoKeyboardNavigationKeyDownEvent","getStepPosition","stepState","listItemElement","listElement","useStepRegister","childrenSteps","position","step","STEPPER_STATE","BentoStepperTypeOption","BentoStepperTypeOption2","BentoStepperVariantOption","BentoStepperVariantOption2","__default__$1","messages","t","n","useI18n","ref","activeStepIndex","props","latestActiveStep","navigateToStep","index","currentStepContent","computed","stepsAmount","childrenStepsElements","buttonElement","isHorizontalVariant","allVisibleStepsElements","substeps","isStepActive","registerStep","removeStep","stepperState","conditionalClasses","watch","emit","keyboardNavigationListeners","provide","readonly","__default__","slots","useSlots","buttonComponent","stepContent","stepper","inject","stepContentValue","substepsButtonElements","buttonElement2","activeSubStepIndex","latestActiveSubStepIndex","navigateToSubstep","value","onMounted","onBeforeUnmount","isSubstep","isFocused","isActive","isSubstepsVisible","isCompleted","isDisabled","ariaCurrentValue","ariaDisabledValue","tabIndexValue"],"mappings":";;;;;;;;;AAUa,MAAAA,IAAA,CAAAC,MAAA;AAET,WAAAC,EAAAC,GAAA;AACI,WAAA,CAAA,EAAA,QAAAC,EAAA,MAAA;;AACI,MAAAA,EAAA,eAAA;AAEA,YAAAC,IAAAJ,EAAA,MAAA,QAAA,SAAA,aAAA;AACA,MAAAI,IAAA,MAIAC,IAAAL,EAAA,MAAAI,IAAAF,CAAA,MAAA,QAAAG,EAAA;AAAA,IAA+C;AAAA,EACnD;AAGJ,QAAAC,IAAAL,EAAA,EAAA,GACAM,IAAAN,EAAA,CAAA;AAEA,SAAA;AAAA,IAAO,CAAAO,EAAA,UAAA,GAAAD;AAAA,IAC+C,CAAAC,EAAA,WAAA,GAAAD;AAAA,IACC,CAAAC,EAAA,QAAA,GAAAF;AAAA,IACH,CAAAE,EAAA,UAAA,GAAAF;AAAA,EACE;AAE1D,GC1BAG,IAAA,CAAAC,MAAA;AAEI,QAAAC,IAAAD,EAAA,cAAA,MAAA,eACAE,IAAAD,EAAA;AACA,SAAA,MAAA,KAAAC,EAAA,QAAA,EAAA,QAAAD,CAAA;AACJ,GAOaE,IAAA,CAAAC,OA2BT,EAAA,cArBA,CAAAJ,MAAA;AACI,QAAAK,IAAAN,EAAAC,CAAA;AACA,EAAAI,EAAA,MAAA,OAAAC,GAAA,GAAA;AAAA,IAAwC,aAAAL,EAAA;AAAA,IACb,eAAAA,EAAA;AAAA,IACE,UAAAA,EAAA;AAAA,EACL,CAAA;AACvB,GAeL,YAPA,CAAAA,MAAA;AACI,EAAAI,EAAA,MAAA;AAAA,IAAoBA,EAAA,MAAA,UAAA,CAAAE,MAAAA,EAAA,kBAAAN,EAAA,cAAA,KAAA;AAAA,IAC0E;AAAA,EAC1F;AACJ,EAGJ,IC/CSO,IAAA,uBAAA,eAAA;ACED,IAAAC,IAAA,kBAAAC,OAC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,KAA+C,GAEnDwC,IAAAtC;AAAA,MAAmB,OAAAsB,KAAA,gBAAAA,EAAA,MAAA,UAAAtC,EAAA,UAAAc,EAAA,SAAAwB,KAAA,gBAAAA,EAAA,MAAA;AAAA,IAC6E,GAGhGzB,IAAA,MAAA;AACI,MAAAyC,EAAA,SAIAhB,EAAA,MAAA,eAAAxB,EAAA,KAAA;AAAA,IAAwC,GAI5CyC,IAAAvC,EAAA,MAAAmC,EAAA,QAAA,SAAA,OAAA,GACAK,IAAAxC,EAAA,MAAAsC,EAAA,MAAA,SAAA,CAAA,GACAG,IAAAzC,EAAA,MAAAkC,EAAA,SAAApC,EAAA,UAAA,KAAA,CAAAmC,EAAA,QAAA,MAAA,IAAA,GAEAtB,IAAAX,EAAA,OAAA;AAAA,MAA2C,kBAAAmC,EAAA;AAAA,MACZ,qBAAAE,EAAA;AAAA,MACM,mBAAAJ,EAAA;AAAA,IACJ,EAAA;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.DfR2o1lz.js","sources":["../../src/components/textarea/textarea.types.ts","../../src/components/textarea/textarea.vue"],"sourcesContent":["import type { FormField } from '../../types/form-field';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoTextareaResizeOption {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n BOTH = 'both',\n NONE = 'none',\n}\n\nexport enum BentoTextareaStateClass {\n CLEARABLE = 'clearable',\n DISABLED = 'disabled',\n ERROR = 'error',\n READONLY = 'readonly',\n}\n\nexport enum BentoTextareaEvent {\n BLUR = 'blur',\n CHANGE = 'change',\n CLEAR = 'clear',\n ESCAPE_PRESSED = 'escape-pressed',\n FOCUS = 'focus',\n INPUT = 'input',\n UPDATE_MODEL_VALUE = 'update:model-value',\n KEYDOWN = 'keydown',\n KEYUP = 'keyup',\n}\n\nexport interface BentoTextareaProps extends FormField {\n /**\n * Text that labels the input element\n * @default undefined\n */\n ariaLabel?: string;\n\n /**\n * Text that shows number of characters in textarea\n * @default undefined\n */\n characterLimit?: number;\n\n /**\n * If set to true, shows a button to clear all the text\n * @default false\n */\n clearable?: boolean;\n\n /**\n * Sets the height of the textarea, e.g 200px OR 20vh\n * @default null\n */\n height?: string | null;\n\n /**\n * Indicates the possibility of resize the textarea.\n * Accepts the Enum or the string literal version.\n * @default BentoTextareaResizeOption.BOTH\n */\n resizable?: BentoTextareaResizeOption | `${BentoTextareaResizeOption}`;\n\n /**\n * Text displayed as the value of the textarea\n * @deprecated for usage with properties since version 2.0. Use `v-model` or `model-value` instead.\n */\n value?: string;\n\n /**\n * Text displayed as the value of the textarea\n */\n modelValue?: string;\n}\n","<template>\n <div ref=\"textareaComponent\" class=\"b-textarea\" :class=\"conditionalClasses\">\n <div :style=\"{ width: textareaWrapperWidth }\">\n <div class=\"b-textarea__label-box\" :class=\"conditionalClassesLabelBox\">\n <field-label\n v-if=\"label\"\n :for=\"textareaId\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n <bento-typography\n v-if=\"characterLimit\"\n el=\"span\"\n class=\"b-textarea__label-item\"\n :class=\"conditionalClassesLabelItem\"\n >\n {{ counter }}\n </bento-typography>\n </div>\n <bento-typography el=\"div\" class=\"b-textarea__input-box\" :aria-disabled=\"disabled\">\n <textarea\n :id=\"textareaId\"\n ref=\"textareaElement\"\n :value=\"textareaValue\"\n class=\"b-textarea__input\"\n :class=\"conditionalClassesInput\"\n :aria-label=\"computedAriaLabel\"\n :aria-invalid=\"invalidInput\"\n :readonly=\"isReadOnly\"\n :required=\"required\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :style=\"{ resize: resizable, height: textareaHeight }\"\n @blur=\"onBlur\"\n @change=\"onChange\"\n @focus=\"onFocus\"\n @input=\"onInput\"\n @keydown.esc=\"onPressEscape\"\n @keydown=\"onKeyDown\"\n @keyup=\"onKeyUp\"\n @mousedown=\"onMouseDown\"\n @mouseup=\"onMouseUp\"\n >\n </textarea>\n\n <div v-if=\"showClearButton\" class=\"b-textarea__clear-button\">\n <bento-button\n variant=\"tertiary\"\n :disabled=\"disabled\"\n @click=\"onClear\"\n @keypress.enter=\"onClear\"\n @keyup.space=\"onClear\"\n >\n <template #iconLeft>\n <cross-circle-fill-small-icon :svg-title=\"t('clearText')\" />\n </template>\n </bento-button>\n </div>\n </bento-typography>\n\n <error-message v-if=\"isOverCharacterLimit\" :error-message=\"counterErrorText\" />\n\n <error-message v-if=\"errorMessage\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"description\" class=\"b-textarea__description\" el=\"span\">\n {{ description }}\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, onMounted, onUnmounted, ref, toRef, toRefs, useAttrs, watch } from 'vue';\n\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n import CrossCircleFillSmallIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill-small';\n\n // Utils\n import { generateUid } from '@/core/utils/ts';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n\n // Composables\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n // Constants\n import { BTextareaInputFocusBorderWidth } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n\n // Types\n import { BentoTextareaEvent, type BentoTextareaProps, BentoTextareaStateClass } from './textarea.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n\n const props = defineProps({\n description: { default: '' },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: '' },\n label: { default: '' },\n optional: { type: Boolean, default: false },\n placeholder: { default: '' },\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n tooltipText: { default: null },\n ariaLabel: { default: undefined },\n characterLimit: { default: undefined },\n clearable: { type: Boolean, default: false },\n height: { default: null },\n resizable: { default: 'both' },\n value: { default: '' },\n modelValue: { default: '' }\n});\n\n const emit = defineEmits([]);\n\n const { height } = toRefs(props);\n\n const textareaId = generateUid('textarea');\n const textareaElement = ref<HTMLTextAreaElement>(null);\n const textareaComponent = ref<HTMLDivElement>(null);\n const textareaValue = ref(props.modelValue || props.value);\n const defaultTextareaHeight = 44;\n const textareaHeight = ref(props.height || `${defaultTextareaHeight}px`);\n const userSetHeight = ref<number>(0);\n const textareaWrapperWidth = ref('100%'); // The width set to the wrapper of the label, textarea and description\n const isUserResizing = ref(false);\n let textareaElementObserver: ResizeObserver | null = null;\n let textareaComponentObserver: ResizeObserver | null = null;\n\n const { t, n } = useI18n<{ message: MessageSchema }>({ messages });\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const { emitValue } = useFormFieldEmits<string>(emit);\n\n const counter = computed(() => `${n(textareaValue?.value?.length ?? 0)} / ${n(props.characterLimit)}`);\n const isDynamicHeight = computed(() => !height.value);\n const isOverCharacterLimit = computed(\n () => props.characterLimit && textareaValue.value.length > props.characterLimit\n );\n\n /**\n * Calculates and sets the height of the textarea.\n * The height is determined by the maximum of the following values:\n *\n * 1. The content's scroll height (with a minimum of `defaultTextareaHeight`) + the border width.\n * 2. The height set by the user manually resizing the textarea (`userSetHeight`).\n * 3. The default minimum height (`defaultTextareaHeight`).\n *\n * This ensures the textarea grows with content, shrinks when content is removed,\n * but never goes below the manually set height or the default height.\n */\n const calculateHeight = () => {\n if (textareaElement.value) {\n const newHeight = Math.max(\n textareaElement.value.scrollHeight <= defaultTextareaHeight\n ? defaultTextareaHeight\n : textareaElement.value.scrollHeight + TEXTAREA_BORDER_WIDTH * 2,\n userSetHeight.value,\n defaultTextareaHeight\n );\n textareaHeight.value = `${newHeight}px`;\n }\n };\n\n watch(height, () => {\n if (isDynamicHeight.value) {\n calculateHeight();\n } else {\n textareaHeight.value = height.value;\n }\n });\n\n watch(\n () => [props.value, props.modelValue],\n () => {\n textareaValue.value = props.modelValue || props.value;\n },\n { immediate: true }\n );\n\n watch(\n () => textareaValue.value,\n async () => {\n if (isDynamicHeight.value) {\n // Hack to make the textarea calculate its height properly\n // Set the textarea back to the original value before calculating the height\n textareaHeight.value = `${defaultTextareaHeight}px`;\n if (!textareaValue.value) {\n return;\n }\n\n await nextTick();\n calculateHeight();\n }\n },\n { immediate: true }\n );\n\n const invalidInput = computed(() => !!props.errorMessage || isOverCharacterLimit.value);\n\n const conditionalClasses = computed(() => ({\n [`b-textarea--${BentoTextareaStateClass.DISABLED}`]: props.disabled,\n }));\n\n const conditionalClassesInput = computed(() => ({\n [`b-textarea__input--${BentoTextareaStateClass.CLEARABLE}`]: props.clearable,\n [`b-textarea__input--${BentoTextareaStateClass.READONLY}`]: isReadOnly.value,\n [`b-textarea__input--${BentoTextareaStateClass.ERROR}`]: invalidInput.value,\n [`b-textarea__input--dynamic-height`]: isDynamicHeight.value,\n }));\n\n const conditionalClassesLabelBox = computed(() => ({\n [`b-textarea__label-box--no-label`]: !props.label,\n }));\n\n const conditionalClassesLabelItem = computed(() => ({\n [`b-textarea__label-item--${BentoTextareaStateClass.ERROR}`]: isOverCharacterLimit.value,\n }));\n\n const counterErrorText = computed(() => t('yourTextCanBenAtMost', { characterLimit: props.characterLimit }));\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel, label } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: label,\n });\n\n const showClearButton = computed(\n () => props.clearable && textareaValue.value && !props.disabled && !isReadOnly.value\n );\n\n const onClear = () => {\n textareaValue.value = '';\n emit(BentoTextareaEvent.CLEAR);\n emitValue('');\n };\n\n const onInput = (event: InputEvent) => {\n event.stopImmediatePropagation();\n\n if (!props.disabled && !isReadOnly.value) {\n textareaValue.value = (event.target as HTMLInputElement).value;\n /**\n * Triggered when input value is changed\n *\n * @event input\n * @property {String} inputValue - the updated textarea value\n */\n emitValue(textareaValue.value);\n }\n };\n\n const onBlur = () => {\n textareaElement.value.scrollTop = 0;\n emit(BentoTextareaEvent.BLUR);\n };\n\n const onFocus = () => {\n textareaElement.value.focus();\n emit(BentoTextareaEvent.FOCUS);\n };\n\n const onChange = () => {\n emit(BentoTextareaEvent.CHANGE);\n };\n\n const onPressEscape = () => {\n emit(BentoTextareaEvent.ESCAPE_PRESSED);\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n event.stopPropagation();\n emit(BentoTextareaEvent.KEYDOWN, event);\n };\n\n const onKeyUp = (event: KeyboardEvent) => {\n event.stopPropagation();\n emit(BentoTextareaEvent.KEYUP, event);\n };\n\n const onMouseDown = () => {\n isUserResizing.value = true;\n };\n\n const onMouseUp = () => {\n isUserResizing.value = false;\n };\n\n /**\n * Updates the textarea width depending if the container or the user update its size.\n * @param isTextareaElement - sets to true if the element being observed is the textarea HTML element.\n */\n const resizeTextareaWrapper = (isTextareaElement = false) => {\n // Width assigned by the browser whenever the textarea is manually resized. String of the format `<value>px`.\n const textareaStyleWidth = textareaElement.value.style.width;\n\n // Make sure the tracked textareaHeight is always in sync with the height size in case we manually resize the textarea\n if (textareaElement.value.style.height) {\n if (isUserResizing.value) {\n userSetHeight.value = parseInt(textareaElement.value.style.height, 10);\n }\n textareaHeight.value = textareaElement.value.style.height;\n }\n\n // If the textarea element observer is being triggered, but there's no textareaStyleWidth, we want to ignore it, as no manual resize as happened yet\n // The component wrapper will handle the resizing logic instead\n if (isTextareaElement && !textareaStyleWidth) {\n return;\n }\n\n // Width of the whole bento-textarea component\n const textareaComponentWidth = textareaComponent?.value?.offsetWidth;\n\n // If there is no textareaStyleWidth or the textareaStyleWidth is larger than the component container, the wrapper should be 100% of the container\n if (!textareaStyleWidth || parseInt(textareaStyleWidth, 10) > textareaComponentWidth) {\n textareaWrapperWidth.value = '100%';\n } else {\n // Else the wrapper should always be as wide as the textarea element itself\n textareaWrapperWidth.value = textareaStyleWidth;\n }\n };\n\n const focus = () => {\n textareaElement.value.focus();\n };\n\n defineExpose({\n focus,\n });\n\n onMounted(() => {\n textareaElementObserver = observeSizeOfElement(textareaElement.value, () => {\n resizeTextareaWrapper(true);\n });\n\n textareaComponentObserver = observeSizeOfElement(textareaComponent.value, () => {\n resizeTextareaWrapper();\n });\n\n if (isDynamicHeight.value) {\n calculateHeight();\n }\n\n if (props.value) {\n deprecate(\n 'BentoTextarea \"value\" property',\n `The use of \"value\" prop in \"BentoTextarea\" is no longer supported.\n Use the \"v-model\" or \"model-value\" property instead.`,\n '2.0.0'\n );\n }\n });\n\n onUnmounted(() => {\n textareaElementObserver?.disconnect();\n textareaComponentObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n const TEXTAREA_BORDER_WIDTH = parseFloat(BTextareaInputFocusBorderWidth);\n\n export default {\n i18n: { messages },\n name: 'bento-textarea',\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./textarea.scss\" />\n"],"names":["BentoTextareaStateClass","BentoTextareaStateClass2","BentoTextareaEvent","BentoTextareaEvent2","TEXTAREA_BORDER_WIDTH","BTextareaInputFocusBorderWidth","__default__","messages","attrs","useAttrs","height","toRefs","props","textareaId","generateUid","textareaElement","ref","textareaComponent","textareaValue","defaultTextareaHeight","textareaHeight","userSetHeight","textareaWrapperWidth","isUserResizing","textareaElementObserver","textareaComponentObserver","t","n","useI18n","isReadOnly","useFormLayoutFieldLoading","toRef","emitValue","useFormFieldEmits","emit","counter","computed","_a","isDynamicHeight","isOverCharacterLimit","calculateHeight","newHeight","watch","nextTick","invalidInput","conditionalClasses","conditionalClassesInput","conditionalClassesLabelBox","conditionalClassesLabelItem","counterErrorText","ariaLabelAttribute","ariaLabel","label","computedAriaLabel","useAriaLabel","showClearButton","onClear","onInput","event","onBlur","onFocus","onChange","onPressEscape","onKeyDown","onKeyUp","onMouseDown","onMouseUp","resizeTextareaWrapper","isTextareaElement","textareaStyleWidth","textareaComponentWidth","focus","expose","onMounted","observeSizeOfElement","deprecate","onUnmounted"],"mappings":";;;;;;;;;;;;;;AAYY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,SAAA,UACAA,EAAA,QAAA,SACAA,EAAA,iBAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,QAAA,SACAA,EAAA,qBAAA,sBACAA,EAAA,UAAA,WACAA,EAAA,QAAA,SATQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;GCoWRE,IAAA,WAAAC,EAAA,GAEAC,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,GAAA;AAAA,EACM,MAAA;AAAA,EACX,OAAA,EAAA,MAAA,aAAA;AAEV;;;;;;;;;;;;;;;;;;;;;;iBAtRAC,IAAAC,GAAA,GAuBA,EAAA,QAAAC,EAAA,IAAAC,EAAAC,CAAA,GAEAC,IAAAC,GAAA,UAAA,GACAC,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,IAAA,GACAE,IAAAF,EAAAJ,EAAA,cAAAA,EAAA,KAAA,GACAO,IAAA,IACAC,IAAAJ,EAAAJ,EAAA,UAAA,GAAAO,CAAA,IAAA,GACAE,IAAAL,EAAA,CAAA,GACAM,IAAAN,EAAA,MAAA,GACAO,IAAAP,EAAA,EAAA;AACA,QAAAQ,IAAA,MACAC,IAAA;AAEA,UAAA,EAAA,GAAAC,GAAA,GAAAC,EAAA,IAAAC,GAAA,GAEA,EAAA,YAAAC,EAAA,IAAAC,GAAAC,GAAAnB,GAAA,UAAA,CAAA,GAEA,EAAA,WAAAoB,EA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