@adyen/bento-vue2 1.83.0 → 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 +1299 -1235
- 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/1-generic-use.CZhwP2Yc.js.map +1 -1
- package/dist/chunks/1-generic-use.R6x8PEGA.js.map +1 -1
- package/dist/chunks/2-generic-use.CNKjB4B7.js.map +1 -1
- package/dist/chunks/2-generic-use.w0fUhovx.js.map +1 -1
- package/dist/chunks/3-generic-use.BLEzR04g.js.map +1 -1
- package/dist/chunks/3-generic-use.D3NFHgI4.js.map +1 -1
- package/dist/chunks/4-generic-use.CULEpvgj.js.map +1 -1
- package/dist/chunks/4-generic-use.D82y3n39.js.map +1 -1
- package/dist/chunks/accordion-item.DeV8s0oW.js.map +1 -1
- 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/adding-payment-methods.BJZLPxtM.js.map +1 -1
- package/dist/chunks/adding-payment-methods.Dle8zt43.js.map +1 -1
- package/dist/chunks/adyen-giving.Ffw_DlJK.js.map +1 -1
- package/dist/chunks/adyen-giving.LiKHj_jY.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/aria-label.CaUURpnB.js.map +1 -1
- package/dist/chunks/avatar.CUCH3CTc.js.map +1 -1
- package/dist/chunks/base-button.IN4bpcds.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-actions.types.BptAXjD8.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.DKkaWwMI.js → checkbox-group.BCnhjQie.js} +4 -4
- package/dist/chunks/{checkbox-group.DKkaWwMI.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.B_W1TGP2.js → checkbox.CU5ierOq.js} +16 -16
- package/dist/chunks/{checkbox.B_W1TGP2.js.map → checkbox.CU5ierOq.js.map} +1 -1
- package/dist/chunks/click-outside.C1Ud8AA2.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/codemirror.Cy7iSLbd.js.map +1 -1
- 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/currency.DYZr_RDk.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-template.keys.VezYtHtM.js.map +1 -1
- package/dist/chunks/{data-grid.CVjZ1tKw.js → data-grid.BPG1GPIl.js} +922 -838
- package/dist/chunks/{data-grid.CVjZ1tKw.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-picker.types.Ckt7zxGy.js.map +1 -1
- package/dist/chunks/date-range-picker.B6GSRjjK.js +1693 -0
- package/dist/chunks/date-range-picker.B6GSRjjK.js.map +1 -0
- package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -1
- package/dist/chunks/date.DBWzp0So.js.map +1 -1
- package/dist/chunks/de.DvtL0g75.js +478 -0
- package/dist/chunks/de.DvtL0g75.js.map +1 -0
- package/dist/chunks/debounce.DUTu11PS.js.map +1 -1
- package/dist/chunks/delight.CDBAFnwC.js.map +1 -1
- package/dist/chunks/delight.xKDCvvaS.js.map +1 -1
- 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/directive.Cbdox5VL.js.map +1 -1
- package/dist/chunks/divider.DX5gwN7p.js.map +1 -1
- package/dist/chunks/dropdown-default-textbox.Cq68tN9F.js.map +1 -1
- 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/events.BQOQSSb7.js.map +1 -1
- 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/focus-trap.CNIU5jOz.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-field.D_2g7vaP.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/form-layout.types.bZW9iR6_.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/generate-uid.NJ8tVoha.js.map +1 -1
- package/dist/chunks/getRoundingMethod.C3eaeGLR.js.map +1 -1
- package/dist/chunks/getTimezoneOffsetInMilliseconds.C-aIpRfB.js +51 -0
- package/dist/chunks/getTimezoneOffsetInMilliseconds.C-aIpRfB.js.map +1 -0
- package/dist/chunks/grid-layout.1aIiz2N_.js.map +1 -1
- 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.3fF_V6F9.js → header-with-views.Dc9LUYNY.js} +379 -315
- package/dist/chunks/{header-with-views.3fF_V6F9.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/image.C2D2hKat.js.map +1 -1
- package/dist/chunks/index.B6WW_F-J.js.map +1 -1
- package/dist/chunks/index.BDK4hwK_.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/inspector.types.DyHwE18g.js.map +1 -1
- package/dist/chunks/internal-error.BLZodVBE.js.map +1 -1
- package/dist/chunks/internal-error.BmrwJFpR.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/keyboard-navigation.DWmhelVv.js.map +1 -1
- package/dist/chunks/ko.Ceaof6EP.js +348 -0
- package/dist/chunks/ko.Ceaof6EP.js.map +1 -0
- package/dist/chunks/layout-row.BPX00mio.js.map +1 -1
- 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/loading-indicator.PxbRzshH.js.map +1 -1
- package/dist/chunks/match.CMBZxEs9.js +302 -0
- package/dist/chunks/match.CMBZxEs9.js.map +1 -0
- package/dist/chunks/minus-small.DJacLGTw.js.map +1 -1
- 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/no-results-found.Bg_ZcEid.js.map +1 -1
- package/dist/chunks/no-results-found.BqvYsBR6.js.map +1 -1
- package/dist/chunks/notifications-cleared.BMZk37uf.js.map +1 -1
- package/dist/chunks/notifications-cleared.C7W9ZXY7.js.map +1 -1
- package/dist/chunks/on-click-outside.D9aY9g8G.js.map +1 -1
- package/dist/chunks/page-not-found.COJLPVaU.js.map +1 -1
- package/dist/chunks/page-not-found.DWW6W-PZ.js.map +1 -1
- 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/payment-method.BKXLPDC9.js.map +1 -1
- package/dist/chunks/payment-method.types.BqtH7RM2.js.map +1 -1
- package/dist/chunks/planned-maintenance.C61sWB9h.js.map +1 -1
- package/dist/chunks/planned-maintenance.jmWYTdet.js.map +1 -1
- package/dist/chunks/popover.types.WDh5ggr3.js.map +1 -1
- package/dist/chunks/popper-container.Cdokz_NE.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/radio-input.kzb4gxLW.js.map +1 -1
- package/dist/chunks/referrals.BvtT-kQS.js.map +1 -1
- package/dist/chunks/referrals.aX8WZigH.js.map +1 -1
- package/dist/chunks/resize.Bqks3WUm.js.map +1 -1
- package/dist/chunks/{rich-text-editor.BbvfrqHl.js → rich-text-editor.Dq2CFGOu.js} +5 -5
- package/dist/chunks/{rich-text-editor.BbvfrqHl.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/segmented-control.types.BHRLV8KU.js.map +1 -1
- package/dist/chunks/{selection-card-group.BWLjFcea.js → selection-card-group.BryV14qP.js} +13 -13
- package/dist/chunks/{selection-card-group.BWLjFcea.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/status.types.Cv5XN4zL.js.map +1 -1
- 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/success.DhioLvPD.js.map +1 -1
- package/dist/chunks/success.nNwxJRBS.js.map +1 -1
- package/dist/chunks/summary-grid.keys.Xx-W5a2w.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/tabs.keys.B4qGhjp2.js.map +1 -1
- package/dist/chunks/tag.B1Ywhgvc.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/toggle.227XgEc7.js.map +1 -1
- package/dist/chunks/tooltip.C6YCavPw.js.map +1 -1
- package/dist/chunks/truncate.BfIl_-71.js.map +1 -1
- package/dist/chunks/{tutorial.DdRGxTC5.js → tutorial.D18LwXVy.js} +5 -5
- package/dist/chunks/{tutorial.DdRGxTC5.js.map → tutorial.D18LwXVy.js.map} +1 -1
- package/dist/chunks/typography.Bq-EGj9y.js.map +1 -1
- package/dist/chunks/upload-files.5wQwbfkp.js.map +1 -1
- package/dist/chunks/upload-files.jTQY6y2X.js.map +1 -1
- package/dist/chunks/use-bento-toast-controller.MmyZXtME.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/use-country-phon-code.Bui3zD6W.js.map +1 -1
- package/dist/chunks/use-default-slot-validator.BDn0wkYP.js.map +1 -1
- package/dist/chunks/use-expandable-content-height.GkjjbmPy.js.map +1 -1
- package/dist/chunks/use-form-layout-loading.CWbjZiwP.js.map +1 -1
- package/dist/chunks/wrong-environment.BOsyKdRI.js.map +1 -1
- package/dist/chunks/wrong-environment.BiHTPtbJ.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/dist/use-form-v4.js.map +1 -1
- package/package.json +15 -26
- 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.CgJA4tIt.js +0 -2472
- package/dist/chunks/filter-bar.CgJA4tIt.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,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { C as
|
|
1
|
+
import { defineComponent as A, useAttrs as D, ref as g, computed as o, toRefs as I } from "vue";
|
|
2
|
+
import { C as c, N as R, a as _ } from "./minus-small.DJacLGTw.js";
|
|
3
3
|
import { C as S } from "./checkmark-small.DVDtD4HQ.js";
|
|
4
4
|
import "./index.Cl4_42j5.js";
|
|
5
|
-
import { n as
|
|
5
|
+
import { n as B } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
6
6
|
import "../assets/checkbox-input.css";
|
|
7
|
-
const
|
|
7
|
+
const L = {
|
|
8
8
|
name: "checkbox-input",
|
|
9
9
|
inheritAttrs: !1
|
|
10
|
-
},
|
|
11
|
-
...
|
|
10
|
+
}, N = /* @__PURE__ */ A({
|
|
11
|
+
...L,
|
|
12
12
|
props: {
|
|
13
13
|
/**
|
|
14
14
|
* The aria label associated to the input checkbox.
|
|
@@ -61,57 +61,62 @@ const B = {
|
|
|
61
61
|
value: { type: [String, Number], default: null }
|
|
62
62
|
},
|
|
63
63
|
emits: ["update:model-value"],
|
|
64
|
-
setup(
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
64
|
+
setup(k, { emit: a }) {
|
|
65
|
+
const t = k, e = D(), n = g(null), i = o(() => e), { disabled: h, indeterminate: C, modelValue: s, readonly: m, value: u } = I(t), y = o(() => {
|
|
66
|
+
var d;
|
|
67
|
+
const l = (d = e.class) == null ? void 0 : d.split(" ").reduce((r, p) => (r[p] = !0, r), {});
|
|
68
|
+
return {
|
|
69
|
+
[`b-checkbox-input--${c.DISABLED}`]: t.disabled,
|
|
70
|
+
[`b-checkbox-input--${c.READONLY}`]: t.readonly,
|
|
71
|
+
...l
|
|
72
|
+
};
|
|
73
|
+
}), v = o(() => ({
|
|
74
|
+
[`b-checkbox-input__outline--${c.UNCHECKED}`]: !b.value && !t.indeterminate,
|
|
75
|
+
[`b-checkbox-input__outline--${c.ERROR}`]: t.hasError,
|
|
76
|
+
[`b-checkbox-input__outline--${c.READONLY}`]: t.readonly
|
|
77
|
+
})), f = o(() => Array.isArray(s.value)), b = o(() => f.value ? s.value.some((l) => l === u.value) : s.value), x = o(
|
|
78
|
+
() => t.indeterminate ? "mixed" : `${!!b.value}`
|
|
79
|
+
), E = o(
|
|
80
|
+
() => t.hasError && !t.disabled && !t.readonly
|
|
76
81
|
);
|
|
77
|
-
return { __sfc: !0, props:
|
|
78
|
-
if (
|
|
79
|
-
|
|
82
|
+
return { __sfc: !0, attrs: e, props: t, emit: a, inputRef: n, computedAttrs: i, disabled: h, indeterminate: C, modelValue: s, readonly: m, value: u, conditionalClasses: y, outlineConditionalClasses: v, isCheckboxGroup: f, isChecked: b, ariaChecked: x, ariaInvalid: E, onClick: (l) => {
|
|
83
|
+
if (m.value) {
|
|
84
|
+
l.preventDefault();
|
|
80
85
|
return;
|
|
81
86
|
}
|
|
82
|
-
}, onChange: (
|
|
83
|
-
if (
|
|
87
|
+
}, onChange: (l) => {
|
|
88
|
+
if (h.value)
|
|
84
89
|
return;
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
const
|
|
88
|
-
|
|
90
|
+
const d = l.target.checked;
|
|
91
|
+
if (f.value) {
|
|
92
|
+
const r = [...s.value], p = r.indexOf(u.value);
|
|
93
|
+
p === -1 ? r.push(u.value) : r.splice(p, 1), a(_.UPDATE, r);
|
|
89
94
|
} else
|
|
90
|
-
|
|
95
|
+
a(_.UPDATE, d);
|
|
91
96
|
}, CheckmarkSmallIcon: S, MinusSmallIcon: R };
|
|
92
97
|
}
|
|
93
98
|
});
|
|
94
|
-
var
|
|
95
|
-
var
|
|
96
|
-
return
|
|
99
|
+
var O = function() {
|
|
100
|
+
var a = this, t = a._self._c, e = a._self._setupProxy;
|
|
101
|
+
return t("div", { staticClass: "b-checkbox-input", class: e.conditionalClasses }, [e.indeterminate ? t(e.MinusSmallIcon, { staticClass: "b-checkbox-input__icon", attrs: { "svg-title": "", "aria-hidden": "true" } }) : e.isChecked ? t(e.CheckmarkSmallIcon, { staticClass: "b-checkbox-input__icon", attrs: { "svg-title": "", "aria-hidden": "true" } }) : a._e(), t("input", a._b({ ref: "inputRef", staticClass: "b-checkbox-input__outline", class: e.outlineConditionalClasses, attrs: { id: a.id, type: "checkbox", "aria-label": a.ariaLabel, "aria-checked": e.ariaChecked, "aria-describedby": a.ariaDescribedby, "aria-invalid": e.ariaInvalid, disabled: e.disabled, "aria-readonly": e.readonly }, domProps: { checked: e.isChecked, indeterminate: e.indeterminate, value: e.value }, on: { click: e.onClick, change: e.onChange, keydown: [function(n) {
|
|
97
102
|
var i;
|
|
98
|
-
if (!n.type.indexOf("key") &&
|
|
103
|
+
if (!n.type.indexOf("key") && a._k(n.keyCode, "space", 32, n.key, [" ", "Spacebar"])) return null;
|
|
99
104
|
n.preventDefault(), (i = e.inputRef) == null || i.click();
|
|
100
105
|
}, function(n) {
|
|
101
106
|
var i;
|
|
102
|
-
if (!n.type.indexOf("key") &&
|
|
107
|
+
if (!n.type.indexOf("key") && a._k(n.keyCode, "enter", 13, n.key, "Enter")) return null;
|
|
103
108
|
n.preventDefault(), (i = e.inputRef) == null || i.click();
|
|
104
|
-
}] } }, "input", e.
|
|
105
|
-
},
|
|
106
|
-
L,
|
|
109
|
+
}] } }, "input", e.computedAttrs, !1))], 1);
|
|
110
|
+
}, P = [], V = /* @__PURE__ */ B(
|
|
107
111
|
N,
|
|
108
112
|
O,
|
|
113
|
+
P,
|
|
109
114
|
!1,
|
|
110
115
|
null,
|
|
111
|
-
"
|
|
116
|
+
"e335b97b"
|
|
112
117
|
);
|
|
113
|
-
const
|
|
118
|
+
const G = V.exports;
|
|
114
119
|
export {
|
|
115
|
-
|
|
120
|
+
G as C
|
|
116
121
|
};
|
|
117
|
-
//# sourceMappingURL=checkbox-input.
|
|
122
|
+
//# sourceMappingURL=checkbox-input.08E9BNeF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox-input.08E9BNeF.js","sources":["../../src/components/internal/checkbox-input/checkbox-input.vue"],"sourcesContent":["<template>\n <div class=\"b-checkbox-input\" :class=\"conditionalClasses\">\n <!-- Don't change order because it matters for CSS. Icons first -->\n <minus-small-icon v-if=\"indeterminate\" class=\"b-checkbox-input__icon\" svg-title=\"\" aria-hidden=\"true\" />\n <checkmark-small-icon v-else-if=\"isChecked\" class=\"b-checkbox-input__icon\" svg-title=\"\" aria-hidden=\"true\" />\n <input\n :id=\"id\"\n ref=\"inputRef\"\n v-bind=\"computedAttrs\"\n type=\"checkbox\"\n class=\"b-checkbox-input__outline\"\n :class=\"outlineConditionalClasses\"\n :aria-label=\"ariaLabel\"\n :aria-checked=\"ariaChecked\"\n :aria-describedby=\"ariaDescribedby\"\n :aria-invalid=\"ariaInvalid\"\n :checked=\"isChecked\"\n :disabled=\"disabled\"\n :indeterminate.prop=\"indeterminate\"\n :value=\"value\"\n :aria-readonly=\"readonly\"\n @click=\"onClick\"\n @change=\"onChange\"\n @keydown.space.prevent=\"inputRef?.click()\"\n @keydown.enter.prevent=\"inputRef?.click()\"\n />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, type HTMLAttributes, type PropType, ref, toRefs, useAttrs } from 'vue';\n import {\n CheckboxInputEvent,\n type CheckboxInputGroupItems,\n CheckboxInputState,\n type CheckboxInputType,\n type MultiCheckboxInputType,\n } from '@/internal/checkbox-input/checkbox-input.types';\n import CheckmarkSmallIcon from '@adyen/ui-assets-icons-16/vue/checkmark-small';\n import MinusSmallIcon from '@adyen/ui-assets-icons-16/vue/minus-small';\n import { isVue3 } from 'vue-demi';\n\n const attrs = useAttrs();\n const props = defineProps({\n /**\n * The aria label associated to the input checkbox.\n */\n ariaLabel: { type: String, default: '' },\n\n /**\n * An additional string that serves as description for the input checkbox (useful if the component shows a description).\n */\n ariaDescribedby: { type: String, default: '' },\n\n /**\n * Setting this property to true will disable the checkbox in your form.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will show the checkbox in error state.\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * Sets the id of the checkbox. Required for accessibility purposes\n */\n id: { type: String, default: null },\n\n /**\n * The :indeterminate CSS pseudo-class represents any form element\n * whose state is indeterminate, such as checkboxes which have their HTML indeterminate attribute\n * set to true, radio buttons which are members of a group in which all radio buttons are unchecked,\n * and indeterminate <progress> elements. https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate\n * This property lets you control the input.indeterminate native property.\n */\n indeterminate: { type: Boolean, default: false },\n\n /**\n * When handling a single checkbox with a singular state, use a boolean.\n *\n * When handling multiple checkboxes, use an array of keys.\n * These keys exist as a set \"value\" prop for each checkbox.\n */\n modelValue: {\n type: [Boolean, Array] as PropType<CheckboxInputType | CheckboxInputGroupItems>,\n default: false,\n },\n\n /**\n * Setting this property to true will set the checkbox to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * The value of the component. The DOM API casts this to a string.\n * The browser uses \"on\" as the default value.\n *\n * In the case of multiple checkboxes this value is used as a unique key.\n */\n value: { type: [String, Number], default: null },\n });\n\n const emit = defineEmits([\"update:model-value\"]);\n\n const inputRef = ref<HTMLInputElement | null>(null);\n\n // filter out style classes because in vue3 they are also part of attrs\n const computedAttrs = computed(() => {\n if (isVue3) {\n const { class: _class, style: _style, ...rest } = attrs;\n return rest;\n } else {\n return attrs;\n }\n });\n\n const { disabled, indeterminate, modelValue, readonly, value } = toRefs(props);\n\n const conditionalClasses = computed(() => {\n // Append classes set from parent to first element\n const inheritClasses = (attrs.class as string)?.split(' ').reduce((acc, className) => {\n acc[className] = true;\n return acc;\n }, {});\n\n return {\n [`b-checkbox-input--${CheckboxInputState.DISABLED}`]: props.disabled,\n [`b-checkbox-input--${CheckboxInputState.READONLY}`]: props.readonly,\n ...inheritClasses,\n };\n });\n\n const outlineConditionalClasses = computed(() => ({\n [`b-checkbox-input__outline--${CheckboxInputState.UNCHECKED}`]: !isChecked.value && !props.indeterminate,\n [`b-checkbox-input__outline--${CheckboxInputState.ERROR}`]: props.hasError,\n [`b-checkbox-input__outline--${CheckboxInputState.READONLY}`]: props.readonly,\n }));\n\n const isCheckboxGroup = computed(() => Array.isArray(modelValue.value));\n\n const isChecked = computed(() => {\n if (!isCheckboxGroup.value) {\n return modelValue.value as boolean;\n }\n\n return (modelValue.value as MultiCheckboxInputType).some(item => item === value.value);\n });\n\n // ARIA fields\n const ariaChecked = computed<HTMLAttributes['aria-checked']>(() =>\n props.indeterminate ? 'mixed' : `${!!isChecked.value}`\n );\n const ariaInvalid = computed<HTMLAttributes['aria-invalid']>(\n () => props.hasError && !props.disabled && !props.readonly\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 (readonly.value) {\n event.preventDefault();\n return;\n }\n };\n const onChange = (event: Event) => {\n if (disabled.value) {\n return;\n }\n\n const newValue: boolean = (event.target as HTMLInputElement).checked;\n\n if (isCheckboxGroup.value) {\n const newCheckedList = [...(modelValue.value as MultiCheckboxInputType)];\n const index = newCheckedList.indexOf(value.value);\n\n if (index === -1) {\n newCheckedList.push(value.value);\n } else {\n newCheckedList.splice(index, 1);\n }\n emit(CheckboxInputEvent.UPDATE, newCheckedList);\n } else {\n emit(CheckboxInputEvent.UPDATE, newValue);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Internal component that renders a checkbox input (without label)\n *\n * @example\n * import { BentoCheckboxInput } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCheckboxInput },\n * template: `\n * <label for=\"checkbox-id\">Your label</label>\n * <span id=\"description-id\">Description</span>\n * <bento-checkbox-input id=\"checkbox-id\" aria=label=\"Your label\" aria-describedby=\"description-id\" />\n * `\n * }\n */\n export default {\n name: 'checkbox-input',\n inheritAttrs: false,\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./checkbox-input.scss\" />\n"],"names":["__default__","attrs","useAttrs","inputRef","ref","computedAttrs","computed","disabled","indeterminate","modelValue","readonly","value","toRefs","props","conditionalClasses","inheritClasses","_a","acc","className","CheckboxInputState","outlineConditionalClasses","isChecked","isCheckboxGroup","item","ariaChecked","ariaInvalid","event","newValue","newCheckedList","index","emit","CheckboxInputEvent"],"mappings":";;;;;;AA2MI,MAAAA,IAAA;AAAA,EAAe,MAAA;AAAA,EACL,cAAA;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBApKAC,IAAAC,EAAA,GA+DAC,IAAAC,EAAA,IAAA,GAGAC,IAAAC,EAAA,MAKQL,CACJ,GAGJ,EAAA,UAAAM,GAAA,eAAAC,GAAA,YAAAC,GAAA,UAAAC,GAAA,OAAAC,EAAA,IAAAC,EAAAC,CAAA,GAEAC,IAAAR,EAAA,MAAA;;AAEI,YAAAS,KAAAC,IAAAf,EAAA,UAAA,gBAAAe,EAAA,MAA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,GAEJC,EAAAC,EAAA,QAAAH,CAAA;AAAA,MAA8C;AAE9C,QAAAE,EAAAC,EAAA,QAAAJ,CAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { defineComponent as R, toRefs as k, computed as o, ref as A, onMounted as H, useAttrs as j } from "vue";
|
|
2
2
|
import { B as F } from "./typography.Bq-EGj9y.js";
|
|
3
|
+
import { C as O } from "./checkbox-input.08E9BNeF.js";
|
|
4
|
+
import { C } from "./minus-small.DJacLGTw.js";
|
|
3
5
|
import { u as z } from "./use-default-slot-validator.BDn0wkYP.js";
|
|
4
6
|
import { u as J } from "./use-has-slot.C9lQZ6nz.js";
|
|
5
|
-
import { g as
|
|
7
|
+
import { g as B } from "./generate-uid.NJ8tVoha.js";
|
|
6
8
|
import { g as f } from "./get-slot-text.Bjb9dTSV.js";
|
|
7
|
-
import { u as
|
|
8
|
-
import { u as
|
|
9
|
-
import { B as
|
|
10
|
-
import { E as
|
|
11
|
-
import { C as W } from "./checkbox-input.B0NsfSNR.js";
|
|
12
|
-
import { C as B } from "./minus-small.DJacLGTw.js";
|
|
9
|
+
import { u as Y } from "./index.B6WW_F-J.js";
|
|
10
|
+
import { u as K } from "./aria-label.CaUURpnB.js";
|
|
11
|
+
import { B as Q } from "./tag.B1Ywhgvc.js";
|
|
12
|
+
import { E as W } from "./field-label.CEkJnsiL.js";
|
|
13
13
|
import { n as X } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
14
14
|
import "../assets/checkbox.css";
|
|
15
15
|
var s = /* @__PURE__ */ ((a) => (a.UPDATE = "update:model-value", a.INPUT = "input", a))(s || {});
|
|
@@ -26,17 +26,17 @@ const Z = {
|
|
|
26
26
|
},
|
|
27
27
|
"pt-BR": {
|
|
28
28
|
checkbox: "Caixa de seleção",
|
|
29
|
-
optional: "
|
|
29
|
+
optional: "Opcional",
|
|
30
30
|
required: "obrigatório"
|
|
31
31
|
}
|
|
32
32
|
}, G = R({
|
|
33
33
|
name: "bento-checkbox",
|
|
34
34
|
i18n: { messages: Z },
|
|
35
35
|
components: {
|
|
36
|
-
BentoTag:
|
|
36
|
+
BentoTag: Q,
|
|
37
37
|
BentoTypography: F,
|
|
38
|
-
CheckboxInput:
|
|
39
|
-
ErrorMessage:
|
|
38
|
+
CheckboxInput: O,
|
|
39
|
+
ErrorMessage: W
|
|
40
40
|
},
|
|
41
41
|
inheritAttrs: !1,
|
|
42
42
|
model: { prop: "modelValue" },
|
|
@@ -105,7 +105,7 @@ const Z = {
|
|
|
105
105
|
},
|
|
106
106
|
emits: [s.UPDATE, s.INPUT],
|
|
107
107
|
setup(a, { attrs: e, emit: t, slots: l }) {
|
|
108
|
-
const { t: m } =
|
|
108
|
+
const { t: m } = Y(), h = B("description"), _ = B("error"), d = J(l), { disabled: y, indeterminate: E, modelValue: u, readonly: I, value: T } = k(a), v = f(l)("default"), g = f(l)("description");
|
|
109
109
|
z("bento-checkbox", l.default, l.description);
|
|
110
110
|
const n = o(() => Array.isArray(u.value)), b = o(() => n.value ? u.value.some((r) => r === T.value) : u.value), i = o(() => E.value), q = o(
|
|
111
111
|
() => !a.disabled && !a.readonly && (a.hasError || !!a.errorMessage)
|
|
@@ -118,7 +118,7 @@ const Z = {
|
|
|
118
118
|
S.value = m("checkbox");
|
|
119
119
|
});
|
|
120
120
|
const U = o(
|
|
121
|
-
() =>
|
|
121
|
+
() => K({
|
|
122
122
|
ariaLabel: M.value,
|
|
123
123
|
// TODO: take this line away when the aria-label props is removed
|
|
124
124
|
label: P,
|
|
@@ -131,8 +131,8 @@ const Z = {
|
|
|
131
131
|
style: r
|
|
132
132
|
};
|
|
133
133
|
}), N = o(() => ({
|
|
134
|
-
[`b-checkbox--${
|
|
135
|
-
[`b-checkbox--${
|
|
134
|
+
[`b-checkbox--${C.DISABLED}`]: y.value,
|
|
135
|
+
[`b-checkbox--${C.READONLY}`]: I.value
|
|
136
136
|
}));
|
|
137
137
|
return {
|
|
138
138
|
// Values
|
|
@@ -175,4 +175,4 @@ export {
|
|
|
175
175
|
_e as B,
|
|
176
176
|
s as a
|
|
177
177
|
};
|
|
178
|
-
//# sourceMappingURL=checkbox.
|
|
178
|
+
//# sourceMappingURL=checkbox.CU5ierOq.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.B_W1TGP2.js","sources":["../../src/components/checkbox/checkbox.types.ts","../../src/components/checkbox/checkbox.vue"],"sourcesContent":["import type { BentoTagProps } from '../tag/tag.types';\nimport {\n CheckboxInputState as BentoCheckboxState,\n type CheckboxInputType as BentoCheckboxType,\n type MultiCheckboxInputType as BentoMultiCheckboxType,\n} from '@/internal/checkbox-input/checkbox-input.types';\n\nexport { BentoCheckboxState, BentoCheckboxType, BentoMultiCheckboxType };\n\nexport enum BentoCheckboxEvent {\n UPDATE = 'update:model-value',\n INPUT = 'input',\n}\n\nexport type BentoCheckboxTag = BentoTagProps;\n","<template>\n <label class=\"b-checkbox\" :class=\"conditionalClass\" v-bind=\"styleAttrs\" :aria-hidden=\"getAriaHidden($attrs)\">\n <checkbox-input\n v-bind=\"$attrs\"\n ref=\"input\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"ariaDescribedBy\"\n :disabled=\"disabled\"\n :has-error=\"shouldShowError\"\n :indeterminate=\"isIndeterminate\"\n :value=\"value\"\n :model-value=\"modelValue\"\n :readonly=\"readonly\"\n @update:model-value=\"onChange\"\n />\n <span v-if=\"hasSlot('default') || shouldShowErrorMessage\" class=\"b-checkbox__text\">\n <bento-typography v-if=\"hasSlot('default')\" class=\"b-checkbox__label\" el=\"span\" variant=\"body\">\n <span><slot /></span>\n <bento-typography v-if=\"optional\" class=\"b-checkbox__label-requirement\" el=\"span\"\n >({{ t('optional') }})</bento-typography\n >\n <bento-typography v-else-if=\"required\" class=\"b-checkbox__label-requirement\" el=\"span\"\n >({{ t('required') }})</bento-typography\n >\n <bento-tag v-if=\"tag\" class=\"b-checkbox__label-tag\" v-bind=\"tag\" />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n class=\"b-checkbox__description\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n <error-message v-if=\"shouldShowErrorMessage\" :id=\"errorId\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"contentSlotAvailable\" class=\"b-checkbox__content\" el=\"span\" variant=\"body\">\n <slot name=\"content\"></slot>\n </bento-typography>\n </span>\n </label>\n</template>\n\n<script lang=\"ts\">\n import {\n computed,\n defineComponent,\n type HTMLAttributes,\n onMounted,\n type PropType,\n ref,\n toRefs,\n useAttrs,\n } from 'vue';\n import {\n BentoCheckboxEvent,\n BentoCheckboxState,\n type BentoCheckboxTag,\n type BentoCheckboxType,\n type BentoMultiCheckboxType,\n } from './checkbox.types';\n import { BentoTypography } from '@/components/typography';\n import { CheckboxInput } from '@/components/internal/checkbox-input';\n import { ErrorMessage } from '@/components/internal/error-message';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { generateUid } from '@/core/utils/ts';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useI18n } from '@/utils/ts/i18n';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { BentoTag } from '@/components/tag';\n import { type BentoCheckboxGroupItems } from './components/checkbox-group/checkbox-group.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * Checkboxes are used to make a binary choice about an option.\n * The label tag area is also clickable.\n *\n * @usage\n * import { BentoCheckbox } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCheckbox },\n * template: `\n * <bento-checkbox>\n * Label text\n * <template #description>Sub label text</template>\n * </bento-checkbox>\n * `,\n * }\n */\n export default defineComponent({\n name: 'bento-checkbox',\n i18n: { messages },\n components: {\n BentoTag,\n BentoTypography,\n CheckboxInput,\n ErrorMessage,\n },\n inheritAttrs: false,\n model: { prop: 'modelValue' },\n props: {\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Accessible name for the radio button component. It is strongly recommended to pas this value in case this component is used without a label.\n */\n ariaLabel: { type: String, default: null },\n\n /**\n * Setting this property to true will disable the checkbox in your form.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders the checkbox in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Setting this property to true will show the checkbox in error state.\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * The :indeterminate CSS pseudo-class represents any form element\n * whose state is indeterminate, such as checkboxes which have their HTML indeterminate attribute\n * set to true, radio buttons which are members of a group in which all radio buttons are unchecked,\n * and indeterminate <progress> elements. https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate\n * This property lets you control the input.indeterminate native property.\n */\n indeterminate: { type: Boolean, default: false },\n\n /**\n * When handling a single checkbox with a singular state, use a boolean.\n *\n * When handling multiple checkboxes, use an array of keys.\n * These keys exist as a set \"value\" prop for each checkbox.\n */\n modelValue: {\n type: [Boolean, Array] as PropType<BentoCheckboxType | BentoCheckboxGroupItems>,\n default: false,\n },\n\n /**\n * Highlights the checkbox is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the checkbox to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Highlights the checkbox is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Sets the properties of the BentoTag component that is placed next to the label.\n * {@see BentoTag}\n */\n tag: { type: Object as PropType<BentoCheckboxTag>, default: undefined },\n\n /**\n * The value of the component. The DOM API casts this to a string.\n * The browser uses \"on\" as the default value.\n *\n * In the case of multiple checkboxes this value is used as a unique key.\n */\n value: { type: [String, Number], default: null },\n },\n emits: [BentoCheckboxEvent.UPDATE, BentoCheckboxEvent.INPUT],\n setup(props, { attrs, emit, slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const descriptionId = generateUid('description');\n const errorId = generateUid('error');\n const hasSlot = useHasSlot(slots);\n\n const { disabled, indeterminate, modelValue, readonly, value } = toRefs(props);\n\n const defaultSlotValue = getSlotText(slots)('default');\n const descriptionSlotValue = getSlotText(slots)('description');\n\n useDefaultSlotValidator('bento-checkbox', slots.default, slots.description);\n\n const isCheckboxGroup = computed(() => Array.isArray(modelValue.value));\n const isChecked = computed(() => {\n if (!isCheckboxGroup.value) {\n return modelValue.value as boolean;\n }\n\n return (modelValue.value as BentoMultiCheckboxType).some(item => item === value.value);\n });\n const isIndeterminate = computed(() => indeterminate.value);\n\n const shouldShowError = computed(\n () => !props.disabled && !props.readonly && (props.hasError || !!props.errorMessage)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n // Content slot logic\n const hasContentSlot = computed(() => hasSlot('content'));\n const isCheckedOrIntermediate = computed(() => isIndeterminate?.value || isChecked?.value);\n const contentSlotAvailable = computed(\n () => hasContentSlot?.value && isCheckboxGroup?.value && isCheckedOrIntermediate?.value\n );\n\n // ARIA fields\n const ariaDescribedBy = computed<HTMLAttributes['aria-describedby']>(\n () =>\n `${shouldShowErrorMessage.value ? errorId : ''} ${\n defaultSlotValue && descriptionSlotValue ? descriptionId : ''\n }`.trim() || null\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const checkboxTranslation = ref();\n // Translations used in the script tag need to be inside onMounted otherwise they fail in Vue 3\n onMounted(() => {\n checkboxTranslation.value = t('checkbox');\n });\n // Only add aria-label if no label slot is present\n const computedAriaLabel = computed(\n () =>\n 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: hasSlot('default')\n ? (getSlotText(slots)('default') as string)\n : checkboxTranslation.value,\n }).value\n );\n const getAriaHidden = (attributes: HTMLAttributes) => attributes?.['aria-hidden'];\n\n const styleAttrs = computed(() => {\n const { style, class: cls } = useAttrs();\n return {\n class: cls as HTMLAttributes['class'],\n style: style as HTMLAttributes['style'],\n };\n });\n\n const conditionalClass = computed(() => ({\n [`b-checkbox--${BentoCheckboxState.DISABLED}`]: disabled.value,\n [`b-checkbox--${BentoCheckboxState.READONLY}`]: readonly.value,\n }));\n\n const onChange = (newValue: BentoCheckboxType | BentoCheckboxGroupItems) => {\n if (disabled.value) {\n return;\n }\n emit(BentoCheckboxEvent.UPDATE, newValue);\n emit(BentoCheckboxEvent.INPUT, newValue);\n };\n\n return {\n // Values\n descriptionId,\n errorId,\n ariaDescribedBy,\n computedAriaLabel,\n conditionalClass,\n defaultSlotValue,\n descriptionSlotValue,\n isIndeterminate,\n shouldShowError,\n shouldShowErrorMessage,\n contentSlotAvailable,\n hasContentSlot,\n styleAttrs,\n\n // Methods\n hasSlot,\n onChange,\n getAriaHidden,\n\n t,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./checkbox.scss\" />\n"],"names":["BentoCheckboxEvent","BentoCheckboxEvent2","_sfc_main","defineComponent","messages","BentoTag","BentoTypography","CheckboxInput","ErrorMessage","props","attrs","emit","slots","t","useI18n","descriptionId","generateUid","errorId","hasSlot","useHasSlot","disabled","indeterminate","modelValue","readonly","value","toRefs","defaultSlotValue","getSlotText","descriptionSlotValue","useDefaultSlotValidator","isCheckboxGroup","computed","isChecked","item","isIndeterminate","shouldShowError","shouldShowErrorMessage","hasContentSlot","isCheckedOrIntermediate","contentSlotAvailable","ariaDescribedBy","ariaLabelAttribute","ref","ariaLabel","checkboxTranslation","onMounted","computedAriaLabel","useAriaLabel","getAriaHidden","attributes","styleAttrs","style","cls","useAttrs","conditionalClass","CheckboxInputState","newValue"],"mappings":";;;;;;;;;;;;;;AASO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,SAAA,sBACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;GCoFZE,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,MAAA,EAAA,UAAAC,EAAA;AAAA,EACA,YAA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ox/checkbox.vue"],"sourcesContent":["import type { BentoTagProps } from '../tag/tag.types';\nimport {\n CheckboxInputState as BentoCheckboxState,\n type CheckboxInputType as BentoCheckboxType,\n type MultiCheckboxInputType as BentoMultiCheckboxType,\n} from '@/internal/checkbox-input/checkbox-input.types';\n\nexport { BentoCheckboxState, BentoCheckboxType, BentoMultiCheckboxType };\n\nexport enum BentoCheckboxEvent {\n UPDATE = 'update:model-value',\n INPUT = 'input',\n}\n\nexport type BentoCheckboxTag = BentoTagProps;\n","<template>\n <label class=\"b-checkbox\" :class=\"conditionalClass\" v-bind=\"styleAttrs\" :aria-hidden=\"getAriaHidden($attrs)\">\n <checkbox-input\n v-bind=\"$attrs\"\n ref=\"input\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"ariaDescribedBy\"\n :disabled=\"disabled\"\n :has-error=\"shouldShowError\"\n :indeterminate=\"isIndeterminate\"\n :value=\"value\"\n :model-value=\"modelValue\"\n :readonly=\"readonly\"\n @update:model-value=\"onChange\"\n />\n <span v-if=\"hasSlot('default') || shouldShowErrorMessage\" class=\"b-checkbox__text\">\n <bento-typography v-if=\"hasSlot('default')\" class=\"b-checkbox__label\" el=\"span\" variant=\"body\">\n <span><slot /></span>\n <bento-typography v-if=\"optional\" class=\"b-checkbox__label-requirement\" el=\"span\"\n >({{ t('optional') }})</bento-typography\n >\n <bento-typography v-else-if=\"required\" class=\"b-checkbox__label-requirement\" el=\"span\"\n >({{ t('required') }})</bento-typography\n >\n <bento-tag v-if=\"tag\" class=\"b-checkbox__label-tag\" v-bind=\"tag\" />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n class=\"b-checkbox__description\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n <error-message v-if=\"shouldShowErrorMessage\" :id=\"errorId\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"contentSlotAvailable\" class=\"b-checkbox__content\" el=\"span\" variant=\"body\">\n <slot name=\"content\"></slot>\n </bento-typography>\n </span>\n </label>\n</template>\n\n<script lang=\"ts\">\n import {\n computed,\n defineComponent,\n type HTMLAttributes,\n onMounted,\n type PropType,\n ref,\n toRefs,\n useAttrs,\n } from 'vue';\n import {\n BentoCheckboxEvent,\n BentoCheckboxState,\n type BentoCheckboxTag,\n type BentoCheckboxType,\n type BentoMultiCheckboxType,\n } from './checkbox.types';\n import { BentoTypography } from '@/components/typography';\n import { CheckboxInput } from '@/components/internal/checkbox-input';\n import { ErrorMessage } from '@/components/internal/error-message';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { generateUid } from '@/core/utils/ts';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useI18n } from '@/utils/ts/i18n';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { BentoTag } from '@/components/tag';\n import { type BentoCheckboxGroupItems } from './components/checkbox-group/checkbox-group.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * Checkboxes are used to make a binary choice about an option.\n * The label tag area is also clickable.\n *\n * @usage\n * import { BentoCheckbox } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCheckbox },\n * template: `\n * <bento-checkbox>\n * Label text\n * <template #description>Sub label text</template>\n * </bento-checkbox>\n * `,\n * }\n */\n export default defineComponent({\n name: 'bento-checkbox',\n i18n: { messages },\n components: {\n BentoTag,\n BentoTypography,\n CheckboxInput,\n ErrorMessage,\n },\n inheritAttrs: false,\n model: { prop: 'modelValue' },\n props: {\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Accessible name for the radio button component. It is strongly recommended to pas this value in case this component is used without a label.\n */\n ariaLabel: { type: String, default: null },\n\n /**\n * Setting this property to true will disable the checkbox in your form.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders the checkbox in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Setting this property to true will show the checkbox in error state.\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * The :indeterminate CSS pseudo-class represents any form element\n * whose state is indeterminate, such as checkboxes which have their HTML indeterminate attribute\n * set to true, radio buttons which are members of a group in which all radio buttons are unchecked,\n * and indeterminate <progress> elements. https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate\n * This property lets you control the input.indeterminate native property.\n */\n indeterminate: { type: Boolean, default: false },\n\n /**\n * When handling a single checkbox with a singular state, use a boolean.\n *\n * When handling multiple checkboxes, use an array of keys.\n * These keys exist as a set \"value\" prop for each checkbox.\n */\n modelValue: {\n type: [Boolean, Array] as PropType<BentoCheckboxType | BentoCheckboxGroupItems>,\n default: false,\n },\n\n /**\n * Highlights the checkbox is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the checkbox to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Highlights the checkbox is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Sets the properties of the BentoTag component that is placed next to the label.\n * {@see BentoTag}\n */\n tag: { type: Object as PropType<BentoCheckboxTag>, default: undefined },\n\n /**\n * The value of the component. The DOM API casts this to a string.\n * The browser uses \"on\" as the default value.\n *\n * In the case of multiple checkboxes this value is used as a unique key.\n */\n value: { type: [String, Number], default: null },\n },\n emits: [BentoCheckboxEvent.UPDATE, BentoCheckboxEvent.INPUT],\n setup(props, { attrs, emit, slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const descriptionId = generateUid('description');\n const errorId = generateUid('error');\n const hasSlot = useHasSlot(slots);\n\n const { disabled, indeterminate, modelValue, readonly, value } = toRefs(props);\n\n const defaultSlotValue = getSlotText(slots)('default');\n const descriptionSlotValue = getSlotText(slots)('description');\n\n useDefaultSlotValidator('bento-checkbox', slots.default, slots.description);\n\n const isCheckboxGroup = computed(() => Array.isArray(modelValue.value));\n const isChecked = computed(() => {\n if (!isCheckboxGroup.value) {\n return modelValue.value as boolean;\n }\n\n return (modelValue.value as BentoMultiCheckboxType).some(item => item === value.value);\n });\n const isIndeterminate = computed(() => indeterminate.value);\n\n const shouldShowError = computed(\n () => !props.disabled && !props.readonly && (props.hasError || !!props.errorMessage)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n // Content slot logic\n const hasContentSlot = computed(() => hasSlot('content'));\n const isCheckedOrIntermediate = computed(() => isIndeterminate?.value || isChecked?.value);\n const contentSlotAvailable = computed(\n () => hasContentSlot?.value && isCheckboxGroup?.value && isCheckedOrIntermediate?.value\n );\n\n // ARIA fields\n const ariaDescribedBy = computed<HTMLAttributes['aria-describedby']>(\n () =>\n `${shouldShowErrorMessage.value ? errorId : ''} ${\n defaultSlotValue && descriptionSlotValue ? descriptionId : ''\n }`.trim() || null\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const checkboxTranslation = ref();\n // Translations used in the script tag need to be inside onMounted otherwise they fail in Vue 3\n onMounted(() => {\n checkboxTranslation.value = t('checkbox');\n });\n // Only add aria-label if no label slot is present\n const computedAriaLabel = computed(\n () =>\n 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: hasSlot('default')\n ? (getSlotText(slots)('default') as string)\n : checkboxTranslation.value,\n }).value\n );\n const getAriaHidden = (attributes: HTMLAttributes) => attributes?.['aria-hidden'];\n\n const styleAttrs = computed(() => {\n const { style, class: cls } = useAttrs();\n return {\n class: cls as HTMLAttributes['class'],\n style: style as HTMLAttributes['style'],\n };\n });\n\n const conditionalClass = computed(() => ({\n [`b-checkbox--${BentoCheckboxState.DISABLED}`]: disabled.value,\n [`b-checkbox--${BentoCheckboxState.READONLY}`]: readonly.value,\n }));\n\n const onChange = (newValue: BentoCheckboxType | BentoCheckboxGroupItems) => {\n if (disabled.value) {\n return;\n }\n emit(BentoCheckboxEvent.UPDATE, newValue);\n emit(BentoCheckboxEvent.INPUT, newValue);\n };\n\n return {\n // Values\n descriptionId,\n errorId,\n ariaDescribedBy,\n computedAriaLabel,\n conditionalClass,\n defaultSlotValue,\n descriptionSlotValue,\n isIndeterminate,\n shouldShowError,\n shouldShowErrorMessage,\n contentSlotAvailable,\n hasContentSlot,\n styleAttrs,\n\n // Methods\n hasSlot,\n onChange,\n getAriaHidden,\n\n t,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./checkbox.scss\" />\n"],"names":["BentoCheckboxEvent","BentoCheckboxEvent2","_sfc_main","defineComponent","messages","BentoTag","BentoTypography","CheckboxInput","ErrorMessage","props","attrs","emit","slots","t","useI18n","descriptionId","generateUid","errorId","hasSlot","useHasSlot","disabled","indeterminate","modelValue","readonly","value","toRefs","defaultSlotValue","getSlotText","descriptionSlotValue","useDefaultSlotValidator","isCheckboxGroup","computed","isChecked","item","isIndeterminate","shouldShowError","shouldShowErrorMessage","hasContentSlot","isCheckedOrIntermediate","contentSlotAvailable","ariaDescribedBy","ariaLabelAttribute","ref","ariaLabel","checkboxTranslation","onMounted","computedAriaLabel","useAriaLabel","getAriaHidden","attributes","styleAttrs","style","cls","useAttrs","conditionalClass","CheckboxInputState","newValue"],"mappings":";;;;;;;;;;;;;;AASY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,SAAA,sBACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;GCoFZE,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,MAAA,EAAA,UAAAC,EAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,cAAAC;AAAA,EACA;AAAA,EACA,cAAA;AAAA,EACA,OAAA,EAAA,MAAA,aAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IACA,WAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAOA,UAAA,EAAA,MA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KAAA,gBAAAA,EAAA,gBAEAC,IAAAnB,EAAA,MAAA;AACA,YAAA,EAAA,OAAAoB,GAAA,OAAAC,EAAA,IAAAC,EAAA;AACA,aAAA;AAAA,QAAA,OAAAD;AAAA,QACA,OAAAD;AAAA,MACA;AAAA,IACA,CAAA,GAGAG,IAAAvB,EAAA,OAAA;AAAA,MAAA,CAAA,eAAAwB,EAAA,QAAA,EAAA,GAAAnC,EAAA;AAAA,MACA,CAAA,eAAAmC,EAAA,QAAA,EAAA,GAAAhC,EAAA;AAAA,IACA,EAAA;AAWA,WAAA;AAAA;AAAA,MAAA,eAAAR;AAAA,MAEA,SAAAE;AAAA,MACA,iBAAAuB;AAAA,MACA,mBAAAM;AAAA,MACA,kBAAAQ;AAAA,MACA,kBAAA5B;AAAA,MACA,sBAAAE;AAAA,MACA,iBAAAM;AAAA,MACA,iBAAAC;AAAA,MACA,wBAAAC;AAAA,MACA,sBAAAG;AAAA,MACA,gBAAAF;AAAA,MACA,YAAAa;AAAA;AAAA,MACA,SAAAhC;AAAA,MAGA,UAzBA,CAAAsC,MAAA;AACA,QAAApC,EAAA,UAGAT,EAAAX,EAAA,QAAAwD,CAAA,GACA7C,EAAAX,EAAA,OAAAwD,CAAA;AAAA,MAAA;AAAA,MAqBA,eAAAR;AAAA,MACA,GAAAnC;AAAA,IAEA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"click-outside.C1Ud8AA2.js","sources":["../../src/components/click-outside/click-outside.ts"],"sourcesContent":["import { defineComponent, h, ref } from 'vue';\nimport { onClickOutside } from '@/directives/click-outside/on-click-outside';\n\nexport const BentoClickOutside = /* #__PURE__ */ defineComponent({\n name: 'bento-click-outside',\n props: {\n /**\n * Sets the HTML DOM element.\n */\n el: { type: String, default: 'div' },\n },\n emits: ['handler'],\n setup(props, { emit, slots }) {\n const target = ref(null);\n\n onClickOutside(target, event => emit('handler', event));\n\n return () => h(props.el, { ref: target }, slots.default?.());\n },\n});\n"],"names":["BentoClickOutside","defineComponent","props","emit","slots","target","ref","onClickOutside","event","h","_a"],"mappings":";;AAGO,MAAMA,
|
|
1
|
+
{"version":3,"file":"click-outside.C1Ud8AA2.js","sources":["../../src/components/click-outside/click-outside.ts"],"sourcesContent":["import { defineComponent, h, ref } from 'vue';\nimport { onClickOutside } from '@/directives/click-outside/on-click-outside';\n\nexport const BentoClickOutside = /* #__PURE__ */ defineComponent({\n name: 'bento-click-outside',\n props: {\n /**\n * Sets the HTML DOM element.\n */\n el: { type: String, default: 'div' },\n },\n emits: ['handler'],\n setup(props, { emit, slots }) {\n const target = ref(null);\n\n onClickOutside(target, event => emit('handler', event));\n\n return () => h(props.el, { ref: target }, slots.default?.());\n },\n});\n"],"names":["BentoClickOutside","defineComponent","props","emit","slots","target","ref","onClickOutside","event","h","_a"],"mappings":";;AAGO,MAAMA,IAAoD,gBAAAC,EAAA;AAAA,EAC7D,MAAM;AAAA,EACN,OAAO;AAAA;AAAA;AAAA;AAAA,IAIH,IAAI,EAAE,MAAM,QAAQ,SAAS,MAAM;AAAA,EACvC;AAAA,EACA,OAAO,CAAC,SAAS;AAAA,EACjB,MAAMC,GAAO,EAAE,MAAAC,GAAM,OAAAC,KAAS;AACpB,UAAAC,IAASC,EAAI,IAAI;AAEvB,WAAAC,EAAeF,GAAQ,CAAAG,MAASL,EAAK,WAAWK,CAAK,CAAC,GAE/C,MAAM;;AAAA,aAAAC,EAAEP,EAAM,IAAI,EAAE,KAAKG,EAAO,IAAGK,IAAAN,EAAM,YAAN,gBAAAM,EAAA,KAAAN,EAAiB;AAAA;AAAA,EAAA;AAEnE,CAAC;"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { defineComponent as Y, useAttrs as
|
|
2
|
-
import { s as
|
|
3
|
-
import { c as
|
|
4
|
-
import { B as pe } from "./dropdown.
|
|
5
|
-
import { B as ue } from "./button.
|
|
1
|
+
import { defineComponent as Y, useAttrs as V, ref as g, computed as l, shallowRef as P, onMounted as W, watch as D, watchEffect as Z } from "vue";
|
|
2
|
+
import { s as H, H as j, t as e, L as J, a as U, b as z, c as G, p as F, j as X, d as K, x as q, e as ee, E as te, h as ne, k as ae, C as f, f as _, i as oe, g as k, l as se, m as re } from "./codemirror.Cy7iSLbd.js";
|
|
3
|
+
import { c as ie, d as le, e as ce, f as de } from "./es6.C1DXQV6f.js";
|
|
4
|
+
import { B as pe } from "./dropdown.C2pXf8Li.js";
|
|
5
|
+
import { B as ue } from "./button.DIU6m9wD.js";
|
|
6
6
|
import { B as ge } from "./typography.Bq-EGj9y.js";
|
|
7
7
|
import { B as fe } from "./loading-indicator.PxbRzshH.js";
|
|
8
|
-
import { u as
|
|
9
|
-
import { E as
|
|
10
|
-
import { h as be } from "./base-modal.
|
|
11
|
-
import { C as _e } from "./copy.
|
|
8
|
+
import { u as me } from "./index.B6WW_F-J.js";
|
|
9
|
+
import { E as he } from "./expand.Bbielaja.js";
|
|
10
|
+
import { h as be } from "./base-modal.KYkLKswF.js";
|
|
11
|
+
import { C as _e } from "./copy.C0q7xgXs.js";
|
|
12
12
|
import { n as Oe } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
13
13
|
import "../assets/code-snippet.css";
|
|
14
14
|
const ve = {
|
|
15
|
-
red:
|
|
15
|
+
red: ie,
|
|
16
16
|
orange: de,
|
|
17
17
|
green: le,
|
|
18
18
|
blue: ce,
|
|
19
19
|
invalid: "#ffffff"
|
|
20
|
-
}, Ce = (t, n) =>
|
|
20
|
+
}, Ce = (t, n) => j.define([
|
|
21
21
|
{
|
|
22
22
|
tag: e.keyword,
|
|
23
23
|
color: t.red
|
|
@@ -84,9 +84,9 @@ const ve = {
|
|
|
84
84
|
tag: e.invalid,
|
|
85
85
|
color: t.invalid
|
|
86
86
|
}
|
|
87
|
-
]), ye = (t) =>
|
|
88
|
-
var O = /* @__PURE__ */ ((t) => (t.INLINE = "inline", t.SINGLELINE = "singleline", t.MULTILINE = "multiline", t))(O || {}),
|
|
89
|
-
const
|
|
87
|
+
]), ye = (t) => H(Ce(ve, t));
|
|
88
|
+
var O = /* @__PURE__ */ ((t) => (t.INLINE = "inline", t.SINGLELINE = "singleline", t.MULTILINE = "multiline", t))(O || {}), r = /* @__PURE__ */ ((t) => (t.JSON = "json", t.XML = "xml", t.JAVA = "java", t.JAVASCRIPT = "javascript", t.PYTHON = "python", t.CSV = "csv", t))(r || {}), c = /* @__PURE__ */ ((t) => (t.ACTION = "action", t.CHANGE = "change", t))(c || {});
|
|
89
|
+
const Le = z.deserialize({
|
|
90
90
|
version: 14,
|
|
91
91
|
states: "nQVQPOOOOQO'#Ce'#CeOOQO'#Ca'#CaQVQPOOOOQO-E6_-E6_",
|
|
92
92
|
stateData: "g~OWOS~OQPORPOSPO~OQRSR~",
|
|
@@ -99,10 +99,10 @@ const Se = G.deserialize({
|
|
|
99
99
|
tokenizers: [0],
|
|
100
100
|
topRules: { Program: [0, 1] },
|
|
101
101
|
tokenPrec: 18
|
|
102
|
-
}),
|
|
103
|
-
parser:
|
|
102
|
+
}), Se = U.define({
|
|
103
|
+
parser: Le.configure({
|
|
104
104
|
props: [
|
|
105
|
-
|
|
105
|
+
G({
|
|
106
106
|
Separator: e.separator,
|
|
107
107
|
Value: e.string,
|
|
108
108
|
String: e.string,
|
|
@@ -113,19 +113,19 @@ const Se = G.deserialize({
|
|
|
113
113
|
})
|
|
114
114
|
});
|
|
115
115
|
function xe() {
|
|
116
|
-
return new
|
|
116
|
+
return new J(Se);
|
|
117
117
|
}
|
|
118
118
|
const Te = {
|
|
119
|
-
[
|
|
120
|
-
[
|
|
121
|
-
[
|
|
122
|
-
[
|
|
123
|
-
[
|
|
124
|
-
[
|
|
119
|
+
[r.JSON]: ee,
|
|
120
|
+
[r.XML]: q,
|
|
121
|
+
[r.JAVASCRIPT]: K,
|
|
122
|
+
[r.JAVA]: X,
|
|
123
|
+
[r.PYTHON]: F,
|
|
124
|
+
[r.CSV]: xe
|
|
125
125
|
}, Ne = (t) => async () => Te[t], Pe = (t, n) => {
|
|
126
126
|
const a = t.doc.lineAt(n.from), o = /^\s*/.exec(a.text);
|
|
127
127
|
return o ? o[0] : "";
|
|
128
|
-
},
|
|
128
|
+
}, ke = {
|
|
129
129
|
key: "Enter",
|
|
130
130
|
run: ({ state: t, dispatch: n }) => {
|
|
131
131
|
const a = t.changeByRange((o) => {
|
|
@@ -148,49 +148,51 @@ ${Pe(t, o)}`;
|
|
|
148
148
|
"ja-JP": {
|
|
149
149
|
codeSnippet: "コードスニペット",
|
|
150
150
|
expand: "展開",
|
|
151
|
-
nothingToDisplay: "表示するものがありません"
|
|
151
|
+
nothingToDisplay: "表示するものがありません",
|
|
152
|
+
run: "実行"
|
|
152
153
|
},
|
|
153
154
|
"pt-BR": {
|
|
154
155
|
codeSnippet: "Trecho de código",
|
|
155
156
|
expand: "Expandir",
|
|
156
|
-
nothingToDisplay: "Nada para exibir"
|
|
157
|
+
nothingToDisplay: "Nada para exibir",
|
|
158
|
+
run: "Executar"
|
|
157
159
|
}
|
|
158
|
-
},
|
|
160
|
+
}, Be = {
|
|
159
161
|
i18n: { messages: Ee },
|
|
160
162
|
name: "bento-code-snippet"
|
|
161
|
-
},
|
|
162
|
-
...
|
|
163
|
+
}, Ie = /* @__PURE__ */ Y({
|
|
164
|
+
...Be,
|
|
163
165
|
props: {
|
|
164
166
|
actionable: { type: Boolean, default: !1 },
|
|
165
167
|
actionableText: { default: null },
|
|
166
168
|
content: { default: "" },
|
|
167
169
|
expandable: { type: Boolean, default: !1 },
|
|
168
170
|
editable: { type: Boolean, default: !1 },
|
|
169
|
-
lang: { default:
|
|
171
|
+
lang: { default: r.JSON },
|
|
170
172
|
langLabel: { default: null },
|
|
171
173
|
loading: { type: Boolean, default: !1 },
|
|
172
174
|
variant: { default: O.MULTILINE }
|
|
173
175
|
},
|
|
174
176
|
emits: [c.ACTION, c.CHANGE],
|
|
175
177
|
setup(t, { emit: n }) {
|
|
176
|
-
const a = t, o =
|
|
177
|
-
},
|
|
178
|
+
const a = t, o = V(), { t: s } = me(), d = g(null), E = [], B = () => {
|
|
179
|
+
}, I = l(() => a.langLabel ?? a.lang.toUpperCase()), p = l(() => a.variant === O.INLINE), A = l(() => ({
|
|
178
180
|
"b-code-snippet--inline": p.value,
|
|
179
181
|
"b-code-snippet--scrollable": !p.value
|
|
180
182
|
})), w = l(() => ({
|
|
181
183
|
"b-code-snippet__code-area-content--editable": a.editable
|
|
182
|
-
})), v = Ne(a.lang), C = P(),
|
|
183
|
-
|
|
184
|
-
const
|
|
185
|
-
|
|
184
|
+
})), v = Ne(a.lang), C = P(), m = P(), y = new f(), L = new f(), S = new f(), x = new f(), i = g(null), u = g(0), R = l(() => a.actionableText || s("run"));
|
|
185
|
+
W(async () => {
|
|
186
|
+
const h = await v();
|
|
187
|
+
i.value = a.content;
|
|
186
188
|
const Q = ({ state: b }) => {
|
|
187
|
-
|
|
189
|
+
i.value = b.doc.toString();
|
|
188
190
|
}, T = [
|
|
189
191
|
ne(),
|
|
190
|
-
ae.of([oe,
|
|
191
|
-
y.of(
|
|
192
|
-
|
|
193
|
-
|
|
192
|
+
ae.of([oe, ke]),
|
|
193
|
+
y.of(h()),
|
|
194
|
+
L.of(ye(a.lang)),
|
|
195
|
+
S.of(k.readOnly.of(!a.editable)),
|
|
194
196
|
x.of(
|
|
195
197
|
_.contentAttributes.of({
|
|
196
198
|
"aria-label": o["aria-label"] ?? s("codeSnippet"),
|
|
@@ -199,41 +201,41 @@ ${Pe(t, o)}`;
|
|
|
199
201
|
),
|
|
200
202
|
_.updateListener.of((b) => Q(b))
|
|
201
203
|
];
|
|
202
|
-
a.variant === "multiline" && T.push([se(),
|
|
203
|
-
const N =
|
|
204
|
+
a.variant === "multiline" && T.push([se(), re()]);
|
|
205
|
+
const N = k.create({
|
|
204
206
|
doc: a.content,
|
|
205
207
|
extensions: [...T]
|
|
206
208
|
});
|
|
207
|
-
u.value = N.doc.length,
|
|
209
|
+
u.value = N.doc.length, m.value = new _({
|
|
208
210
|
state: N,
|
|
209
211
|
parent: C.value
|
|
210
212
|
});
|
|
211
213
|
}), D(
|
|
212
214
|
() => a.content,
|
|
213
215
|
() => {
|
|
214
|
-
if (a.content !==
|
|
215
|
-
const
|
|
216
|
-
|
|
216
|
+
if (a.content !== i.value) {
|
|
217
|
+
const h = a.content.length;
|
|
218
|
+
m.value.dispatch({
|
|
217
219
|
changes: {
|
|
218
220
|
from: 0,
|
|
219
221
|
to: u.value,
|
|
220
222
|
insert: a.content
|
|
221
223
|
}
|
|
222
|
-
}), u.value =
|
|
224
|
+
}), u.value = h;
|
|
223
225
|
}
|
|
224
226
|
}
|
|
225
227
|
);
|
|
226
228
|
const $ = () => {
|
|
227
|
-
n(c.ACTION,
|
|
229
|
+
n(c.ACTION, i.value);
|
|
228
230
|
};
|
|
229
231
|
Z(() => {
|
|
230
|
-
|
|
232
|
+
i.value !== null && n(c.CHANGE, i.value);
|
|
231
233
|
});
|
|
232
234
|
const M = g(!1);
|
|
233
|
-
return { __sfc: !0, props: a, emit: n, attrs: o, t: s, selectedLanguage: d, availableLanguages: E, handleChangeLanguage:
|
|
235
|
+
return { __sfc: !0, props: a, emit: n, attrs: o, t: s, selectedLanguage: d, availableLanguages: E, handleChangeLanguage: B, displayedLang: I, isInlineVariant: p, conditionalClasses: A, codeAreaContentConditionalClasses: w, loadLang: v, container: C, editor: m, languageConf: y, editorTheme: L, editorReadOnly: S, editorAttributes: x, currentContents: i, contentLength: u, runText: R, onActionClicked: $, showModal: M, BentoDropdown: pe, BentoButton: ue, BentoTypography: ge, BentoLoadingIndicator: fe, Copy: _e, ExpandIcon: he, BaseModal: be };
|
|
234
236
|
}
|
|
235
237
|
});
|
|
236
|
-
var
|
|
238
|
+
var Ae = function() {
|
|
237
239
|
var n = this, a = n._self._c, o = n._self._setupProxy;
|
|
238
240
|
return a("div", { staticClass: "b-code-snippet", class: o.conditionalClasses }, [o.isInlineVariant ? n._e() : a("section", { staticClass: "b-code-snippet__action-bar" }, [a("div", { staticClass: "b-code-snippet__action-bar--start" }, [o.availableLanguages.length > 0 ? a(o.BentoDropdown, n._b({ staticClass: "b-code-snippet__language-picker", attrs: { disabled: o.availableLanguages.length === 1, items: o.availableLanguages }, on: { input: o.handleChangeLanguage }, model: { value: o.selectedLanguage, callback: function(s) {
|
|
239
241
|
o.selectedLanguage = s;
|
|
@@ -250,19 +252,19 @@ var Re = function() {
|
|
|
250
252
|
} }, scopedSlots: n._u([{ key: "content", fn: function() {
|
|
251
253
|
return [a("bento-code-snippet", n._b({}, "bento-code-snippet", { ...n.$props, expandable: !1 }, !1))];
|
|
252
254
|
}, proxy: !0 }], null, !1, 3343589027) }) : n._e()], 1);
|
|
253
|
-
}, we = [],
|
|
254
|
-
|
|
255
|
-
|
|
255
|
+
}, we = [], Re = /* @__PURE__ */ Oe(
|
|
256
|
+
Ie,
|
|
257
|
+
Ae,
|
|
256
258
|
we,
|
|
257
259
|
!1,
|
|
258
260
|
null,
|
|
259
261
|
"3d4802ff"
|
|
260
262
|
);
|
|
261
|
-
const
|
|
263
|
+
const ze = Re.exports;
|
|
262
264
|
export {
|
|
263
265
|
O as B,
|
|
264
|
-
|
|
266
|
+
r as a,
|
|
265
267
|
c as b,
|
|
266
|
-
|
|
268
|
+
ze as c
|
|
267
269
|
};
|
|
268
|
-
//# sourceMappingURL=code-snippet.
|
|
270
|
+
//# sourceMappingURL=code-snippet.9MwDHp50.js.map
|