@adyen/bento-vue3 1.56.2 → 1.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/index.d.ts +20 -1
- 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/base-modal.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/checkbox-input.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/error-message.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/link.css +1 -1
- package/dist/assets/menu.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/pagination.css +1 -1
- package/dist/assets/popover.css +1 -1
- package/dist/assets/rich-text-editor.css +1 -0
- package/dist/assets/sidepanel.css +1 -1
- package/dist/button.js +3 -3
- package/dist/card.js +1 -1
- package/dist/checkbox.js +3 -3
- package/dist/chunks/_commonjsHelpers.C6fGbg64.js +7 -0
- package/dist/chunks/_commonjsHelpers.C6fGbg64.js.map +1 -0
- package/dist/chunks/{action-bar.CD5FQjE9.js → action-bar.BOCrfaHz.js} +6 -6
- package/dist/chunks/{action-bar.CD5FQjE9.js.map → action-bar.BOCrfaHz.js.map} +1 -1
- package/dist/chunks/{alert.CFb4Sejw.js → alert.CjegN2iG.js} +2 -2
- package/dist/chunks/{alert.CFb4Sejw.js.map → alert.CjegN2iG.js.map} +1 -1
- package/dist/chunks/{base-modal.qhldLovE.js → base-modal.DhzWPnD5.js} +29 -30
- package/dist/chunks/base-modal.DhzWPnD5.js.map +1 -0
- package/dist/chunks/{button-actions-with-menu.CxB1fVvx.js → button-actions-with-menu.CkyIwzNi.js} +5 -5
- package/dist/chunks/{button-actions-with-menu.CxB1fVvx.js.map → button-actions-with-menu.CkyIwzNi.js.map} +1 -1
- package/dist/chunks/{button-actions.ODJKaCW7.js → button-actions.DWGBFisz.js} +2 -2
- package/dist/chunks/{button-actions.ODJKaCW7.js.map → button-actions.DWGBFisz.js.map} +1 -1
- package/dist/chunks/{button.BHZgsGkp.js → button.CVZJTZv0.js} +2 -2
- package/dist/chunks/{button.BHZgsGkp.js.map → button.CVZJTZv0.js.map} +1 -1
- package/dist/chunks/{calendar.Dymq4e0Y.js → calendar.D61aBwg1.js} +87 -90
- package/dist/chunks/{calendar.Dymq4e0Y.js.map → calendar.D61aBwg1.js.map} +1 -1
- package/dist/chunks/{card.DQ6g6hqK.js → card.DguoAMcm.js} +2 -2
- package/dist/chunks/{card.DQ6g6hqK.js.map → card.DguoAMcm.js.map} +1 -1
- package/dist/chunks/{checkbox-group.CiYObaZV.js → checkbox-group.CZ-J707C.js} +4 -4
- package/dist/chunks/{checkbox-group.CiYObaZV.js.map → checkbox-group.CZ-J707C.js.map} +1 -1
- package/dist/chunks/checkbox-input.DVayucaL.js +168 -0
- package/dist/chunks/checkbox-input.DVayucaL.js.map +1 -0
- package/dist/chunks/{checkbox.CWfZNdfT.js → checkbox.CMuObeL7.js} +4 -4
- package/dist/chunks/{checkbox.CWfZNdfT.js.map → checkbox.CMuObeL7.js.map} +1 -1
- package/dist/chunks/{code-snippet.CG00Tb5k.js → code-snippet.WgKhySvn.js} +5 -5
- package/dist/chunks/{code-snippet.CG00Tb5k.js.map → code-snippet.WgKhySvn.js.map} +1 -1
- package/dist/chunks/{controls-group.DgrzEh4C.js → controls-group.DsGEDyTw.js} +2 -2
- package/dist/chunks/{controls-group.DgrzEh4C.js.map → controls-group.DsGEDyTw.js.map} +1 -1
- package/dist/chunks/{copy.CfFh4b_c.js → copy.QuF9bDfT.js} +3 -3
- package/dist/chunks/{copy.CfFh4b_c.js.map → copy.QuF9bDfT.js.map} +1 -1
- package/dist/chunks/{dashboard-section.tza4iYcv.js → dashboard-section.fZiEAres.js} +4 -4
- package/dist/chunks/{dashboard-section.tza4iYcv.js.map → dashboard-section.fZiEAres.js.map} +1 -1
- package/dist/chunks/{dashed-underline.B2cIJkg_.js → dashed-underline.BZ_oZeHs.js} +3 -3
- package/dist/chunks/{dashed-underline.B2cIJkg_.js.map → dashed-underline.BZ_oZeHs.js.map} +1 -1
- package/dist/chunks/{data-grid-template.PGPytWvk.js → data-grid-template.Cw-0-al0.js} +3 -3
- package/dist/chunks/{data-grid-template.PGPytWvk.js.map → data-grid-template.Cw-0-al0.js.map} +1 -1
- package/dist/chunks/{data-grid.DW_9jlLU.js → data-grid.BVcmZ1X_.js} +19 -19
- package/dist/chunks/{data-grid.DW_9jlLU.js.map → data-grid.BVcmZ1X_.js.map} +1 -1
- package/dist/chunks/{date-picker.8jgg3MJm.js → date-picker.CWGFy7Hb.js} +17 -17
- package/dist/chunks/{date-picker.8jgg3MJm.js.map → date-picker.CWGFy7Hb.js.map} +1 -1
- package/dist/chunks/{date-range-picker.BxmkXpEh.js → date-range-picker.RzinIKLS.js} +26 -26
- package/dist/chunks/{date-range-picker.BxmkXpEh.js.map → date-range-picker.RzinIKLS.js.map} +1 -1
- package/dist/chunks/dialog-page.C72BX6So.js +175 -0
- package/dist/chunks/dialog-page.C72BX6So.js.map +1 -0
- package/dist/chunks/{dropdown-tag.Bv1togfI.js → dropdown-tag.DCat3Pd2.js} +3 -3
- package/dist/chunks/{dropdown-tag.Bv1togfI.js.map → dropdown-tag.DCat3Pd2.js.map} +1 -1
- package/dist/chunks/{dropdown.CDNzhFMK.js → dropdown.D4lL2ytb.js} +30 -30
- package/dist/chunks/{dropdown.CDNzhFMK.js.map → dropdown.D4lL2ytb.js.map} +1 -1
- package/dist/chunks/{empty-state.DiXLZmQJ.js → empty-state.BGWjUH6G.js} +2 -2
- package/dist/chunks/{empty-state.DiXLZmQJ.js.map → empty-state.BGWjUH6G.js.map} +1 -1
- package/dist/chunks/{error-message.CPw3y44N.js → error-message.CjdvgIAh.js} +3 -3
- package/dist/chunks/error-message.CjdvgIAh.js.map +1 -0
- package/dist/chunks/es6.BtaxuP0b.js.map +1 -1
- package/dist/chunks/{file-uploader.Dv4sh1IO.js → file-uploader.faOTOytJ.js} +6 -6
- package/dist/chunks/{file-uploader.Dv4sh1IO.js.map → file-uploader.faOTOytJ.js.map} +1 -1
- package/dist/chunks/{filter-bar.D1tyv0cU.js → filter-bar.BbLKMSsn.js} +18 -18
- package/dist/chunks/{filter-bar.D1tyv0cU.js.map → filter-bar.BbLKMSsn.js.map} +1 -1
- package/dist/chunks/{fixed-scroller.DsTyshyt.js → fixed-scroller.BjxA_R63.js} +2 -2
- package/dist/chunks/{fixed-scroller.DsTyshyt.js.map → fixed-scroller.BjxA_R63.js.map} +1 -1
- package/dist/chunks/{focus-trap.D9cfQpl7.js → focus-trap.DY5E-2JV.js} +2 -2
- package/dist/chunks/{focus-trap.D9cfQpl7.js.map → focus-trap.DY5E-2JV.js.map} +1 -1
- package/dist/chunks/{footer-actions.C00o4tuW.js → footer-actions.CQARYj4Q.js} +3 -3
- package/dist/chunks/{footer-actions.C00o4tuW.js.map → footer-actions.CQARYj4Q.js.map} +1 -1
- package/dist/chunks/{form-layout-title.dcT8eXwc.js → form-layout-title.CsmjzAje.js} +2 -2
- package/dist/chunks/{form-layout-title.dcT8eXwc.js.map → form-layout-title.CsmjzAje.js.map} +1 -1
- package/dist/chunks/{header-with-views.DNAQIhC5.js → header-with-views.WANsHlGK.js} +13 -13
- package/dist/chunks/{header-with-views.DNAQIhC5.js.map → header-with-views.WANsHlGK.js.map} +1 -1
- package/dist/chunks/{header.hDkWwQuQ.js → header.DAuIurUM.js} +4 -4
- package/dist/chunks/{header.hDkWwQuQ.js.map → header.DAuIurUM.js.map} +1 -1
- package/dist/chunks/index.CVpo3mlK.js +528 -0
- package/dist/chunks/{index.BzJQl-2M.js.map → index.CVpo3mlK.js.map} +1 -1
- package/dist/chunks/{info-icon-with-popover.COJrCw_o.js → info-icon-with-popover.J10ERGQ2.js} +2 -2
- package/dist/chunks/{info-icon-with-popover.COJrCw_o.js.map → info-icon-with-popover.J10ERGQ2.js.map} +1 -1
- package/dist/chunks/{info-icon.7uhGVIn5.js → info-icon.71yYfuEc.js} +2 -2
- package/dist/chunks/{info-icon.7uhGVIn5.js.map → info-icon.71yYfuEc.js.map} +1 -1
- package/dist/chunks/{input-field-password.DqbZ7U6j.js → input-field-password.Bv_0ulNg.js} +7 -7
- package/dist/chunks/{input-field-password.DqbZ7U6j.js.map → input-field-password.Bv_0ulNg.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.gKckf5Oi.js → input-field-phone-number.DPNOepAt.js} +3 -3
- package/dist/chunks/{input-field-phone-number.gKckf5Oi.js.map → input-field-phone-number.DPNOepAt.js.map} +1 -1
- package/dist/chunks/{input-field.DM-gguGX.js → input-field.CtV60WoD.js} +3 -3
- package/dist/chunks/{input-field.DM-gguGX.js.map → input-field.CtV60WoD.js.map} +1 -1
- package/dist/chunks/inspector.types.Df-LngxJ.js +187 -0
- package/dist/chunks/inspector.types.Df-LngxJ.js.map +1 -0
- package/dist/chunks/{layout-row.BC3Z1mQx.js → layout-row.CRRLYA03.js} +2 -2
- package/dist/chunks/{layout-row.BC3Z1mQx.js.map → layout-row.CRRLYA03.js.map} +1 -1
- package/dist/chunks/link.CTH1xj0i.js +116 -0
- package/dist/chunks/link.CTH1xj0i.js.map +1 -0
- package/dist/chunks/{listbox-option-tag.BJh2kEN1.js → listbox-option-tag.DsnH9Q9j.js} +2 -2
- package/dist/chunks/{listbox-option-tag.BJh2kEN1.js.map → listbox-option-tag.DsnH9Q9j.js.map} +1 -1
- package/dist/chunks/{menu.B0q9q97N.js → menu.BOj630ue.js} +3 -3
- package/dist/chunks/{menu.B0q9q97N.js.map → menu.BOj630ue.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.BgqNc9jE.js → modal-fullscreen.D1hncuS7.js} +5 -5
- package/dist/chunks/{modal-fullscreen.BgqNc9jE.js.map → modal-fullscreen.D1hncuS7.js.map} +1 -1
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.Dr847POU.js → modal.vue_vue_type_script_setup_true_lang.y7pMBxB0.js} +5 -5
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.Dr847POU.js.map → modal.vue_vue_type_script_setup_true_lang.y7pMBxB0.js.map} +1 -1
- package/dist/chunks/pagination.fwhC8tEq.js +445 -0
- package/dist/chunks/pagination.fwhC8tEq.js.map +1 -0
- package/dist/chunks/{popover.R5OM_tFu.js → popover.BzzdIK19.js} +4 -4
- package/dist/chunks/{popover.R5OM_tFu.js.map → popover.BzzdIK19.js.map} +1 -1
- package/dist/chunks/{popper-container.CDsbQiOS.js → popper-container.B_sb3SNK.js} +2 -2
- package/dist/chunks/{popper-container.CDsbQiOS.js.map → popper-container.B_sb3SNK.js.map} +1 -1
- package/dist/chunks/{promo-banner.DFt2dVxk.js → promo-banner.CoB1tBCC.js} +3 -3
- package/dist/chunks/{promo-banner.DFt2dVxk.js.map → promo-banner.CoB1tBCC.js.map} +1 -1
- package/dist/chunks/{radio-group.muZVaVEm.js → radio-group.seLW9WC9.js} +4 -4
- package/dist/chunks/{radio-group.muZVaVEm.js.map → radio-group.seLW9WC9.js.map} +1 -1
- package/dist/chunks/{search-bar.BOFC4r8H.js → search-bar.DgDUdcot.js} +3 -3
- package/dist/chunks/{search-bar.BOFC4r8H.js.map → search-bar.DgDUdcot.js.map} +1 -1
- package/dist/chunks/{secondary-nav.DLHeCwuz.js → secondary-nav.C3TEPrCq.js} +3 -3
- package/dist/chunks/{secondary-nav.DLHeCwuz.js.map → secondary-nav.C3TEPrCq.js.map} +1 -1
- package/dist/chunks/{segmented-control.Dg_ktsiS.js → segmented-control.B2cS73wG.js} +2 -2
- package/dist/chunks/{segmented-control.Dg_ktsiS.js.map → segmented-control.B2cS73wG.js.map} +1 -1
- package/dist/chunks/{selection-card-group.DGv7fjPp.js → selection-card-group.gd66OMqI.js} +5 -5
- package/dist/chunks/{selection-card-group.DGv7fjPp.js.map → selection-card-group.gd66OMqI.js.map} +1 -1
- package/dist/chunks/{sidepanel.BjR0Ab22.js → sidepanel.9wJbIvIS.js} +5 -5
- package/dist/chunks/{sidepanel.BjR0Ab22.js.map → sidepanel.9wJbIvIS.js.map} +1 -1
- package/dist/chunks/{structured-list-item.BMsATRrU.js → structured-list-item.CzzWSj5s.js} +5 -5
- package/dist/chunks/{structured-list-item.BMsATRrU.js.map → structured-list-item.CzzWSj5s.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.lGX16F4w.js → summary-grid.types.IZdK-Mvh.js} +5 -5
- package/dist/chunks/{summary-grid.types.lGX16F4w.js.map → summary-grid.types.IZdK-Mvh.js.map} +1 -1
- package/dist/chunks/{tabs.BVuOvNxx.js → tabs.Bn4YIjoy.js} +2 -2
- package/dist/chunks/{tabs.BVuOvNxx.js.map → tabs.Bn4YIjoy.js.map} +1 -1
- package/dist/chunks/{tag.CmYkknFj.js → tag.iiCQSgG9.js} +2 -2
- package/dist/chunks/{tag.CmYkknFj.js.map → tag.iiCQSgG9.js.map} +1 -1
- package/dist/chunks/{textarea.CAc_VYFm.js → textarea.DY0kNx0r.js} +3 -3
- package/dist/chunks/{textarea.CAc_VYFm.js.map → textarea.DY0kNx0r.js.map} +1 -1
- package/dist/chunks/{timeline-item.BQ4qiBii.js → timeline-item.dleRa6Yu.js} +7 -7
- package/dist/chunks/{timeline-item.BQ4qiBii.js.map → timeline-item.dleRa6Yu.js.map} +1 -1
- package/dist/chunks/{toast.BOpWHAfu.js → toast.Ae5ZoWHb.js} +2 -2
- package/dist/chunks/{toast.BOpWHAfu.js.map → toast.Ae5ZoWHb.js.map} +1 -1
- package/dist/chunks/{toggle-button.E0VQtyEX.js → toggle-button.Dv1t15yj.js} +2 -2
- package/dist/chunks/{toggle-button.E0VQtyEX.js.map → toggle-button.Dv1t15yj.js.map} +1 -1
- package/dist/chunks/{tooltip.BkBDReK0.js → tooltip.Di6i0aTd.js} +35 -33
- package/dist/chunks/{tooltip.BkBDReK0.js.map → tooltip.Di6i0aTd.js.map} +1 -1
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.CTx9Z9xB.js → tutorial.vue_vue_type_script_setup_true_lang.A0Wcwr8f.js} +5 -5
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.CTx9Z9xB.js.map → tutorial.vue_vue_type_script_setup_true_lang.A0Wcwr8f.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.BTVoaWFj.js → use-cached-selected-values.BgoZ5uGq.js} +4 -4
- package/dist/chunks/{use-cached-selected-values.BTVoaWFj.js.map → use-cached-selected-values.BgoZ5uGq.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/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/focus-trap.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +55 -55
- package/dist/info-icon.js +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/inspector.js +1 -1
- package/dist/internal.js +12 -12
- package/dist/layout.js +1 -1
- 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/popper-container.js +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/rich-text-editor.js +6221 -0
- package/dist/rich-text-editor.js.map +1 -0
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/styles/bento-dark.css +22 -1
- package/dist/styles/bento-light.css +22 -1
- package/dist/styles/bento.css +22 -1
- package/dist/styles/legacy.css +22 -1
- package/dist/styles/styleguide.css +22 -1
- package/dist/summary-grid.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tag.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +10 -5
- package/dist/chunks/base-modal.qhldLovE.js.map +0 -1
- package/dist/chunks/checkbox-input.CgbJsFXD.js +0 -157
- package/dist/chunks/checkbox-input.CgbJsFXD.js.map +0 -1
- package/dist/chunks/dialog-page.MLFdqTcL.js +0 -173
- package/dist/chunks/dialog-page.MLFdqTcL.js.map +0 -1
- package/dist/chunks/error-message.CPw3y44N.js.map +0 -1
- package/dist/chunks/index.BzJQl-2M.js +0 -386
- package/dist/chunks/inspector.types.D5QBC3-G.js +0 -188
- package/dist/chunks/inspector.types.D5QBC3-G.js.map +0 -1
- package/dist/chunks/link.D3Fq5tt_.js +0 -109
- package/dist/chunks/link.D3Fq5tt_.js.map +0 -1
- package/dist/chunks/pagination.Ca8itKj2.js +0 -470
- package/dist/chunks/pagination.Ca8itKj2.js.map +0 -1
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { createElementBlock as r, openBlock as i, mergeProps as Q, createCommentVNode as c, createElementVNode as W, toDisplayString as X, defineComponent as ee, useSlots as te, ref as T, computed as s, inject as A, watch as E, nextTick as b, onUnmounted as ae, createBlock as oe, Transition as se, unref as n, withCtx as N, normalizeClass as B, renderSlot as y, normalizeStyle as ne, createVNode as C } from "vue";
|
|
2
|
+
import { B as ie } from "./button.CVZJTZv0.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { _ as O } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
5
|
+
import { u as le } from "./use-has-slot.B7eQSabc.js";
|
|
6
|
+
import { u as re } from "./i18n.B6g5VX0q.js";
|
|
7
|
+
import { i as ue } from "./typography.DN5eC5ch.js";
|
|
8
|
+
import { c as ce } from "./index.CVpo3mlK.js";
|
|
9
|
+
import "../assets/dialog-page.css";
|
|
10
|
+
let $ = 0;
|
|
11
|
+
const de = {
|
|
12
|
+
beforeCreate() {
|
|
13
|
+
this.uuid = $.toString(), $ += 1;
|
|
14
|
+
}
|
|
15
|
+
}, ve = { key: 0 };
|
|
16
|
+
function ge(e, v, l, I, L, g) {
|
|
17
|
+
return i(), r("svg", Q({ role: "img" }, e.$attrs, {
|
|
18
|
+
class: "ui-assets-icons-16",
|
|
19
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
20
|
+
width: "16",
|
|
21
|
+
height: "16",
|
|
22
|
+
fill: "none"
|
|
23
|
+
}), [
|
|
24
|
+
e.$attrs["svg-title"] ? (i(), r("title", ve, X(e.$attrs["svg-title"]), 1)) : c("", !0),
|
|
25
|
+
v[0] || (v[0] = W("path", {
|
|
26
|
+
fill: "#00112C",
|
|
27
|
+
d: "M3.80655 7.25434L8.06077 3.00011L7.00011 1.93945L0.939453 8.00011L7.00011 14.0608L8.06077 13.0001L3.81499 8.75433L14.7508 8.74316L14.7492 7.24316L3.80655 7.25434Z"
|
|
28
|
+
}, null, -1))
|
|
29
|
+
], 16);
|
|
30
|
+
}
|
|
31
|
+
const pe = /* @__PURE__ */ O(de, [["render", ge]]);
|
|
32
|
+
var S = /* @__PURE__ */ ((e) => (e.TRANSITION_LEVEL_DEEPER = "b-dialog-page__animation--level-deeper", e.TRANSITION_LEVEL_UPPER = "b-dialog-page__animation--level-upper", e))(S || {});
|
|
33
|
+
const me = Symbol("dialog registerPage injection key"), fe = Symbol("dialog page config data injection key"), R = {
|
|
34
|
+
"en-US": {
|
|
35
|
+
goToPreviousPage: "Go to previous page"
|
|
36
|
+
}
|
|
37
|
+
}, _e = {
|
|
38
|
+
key: 0,
|
|
39
|
+
class: "b-dialog-page"
|
|
40
|
+
}, he = ["tabindex"], Pe = {
|
|
41
|
+
i18n: { messages: R }
|
|
42
|
+
}, Ee = /* @__PURE__ */ ee({
|
|
43
|
+
...Pe,
|
|
44
|
+
__name: "dialog-page",
|
|
45
|
+
props: {
|
|
46
|
+
/**
|
|
47
|
+
* Identifier of the page, used with activePage prop to handle navigation
|
|
48
|
+
*/
|
|
49
|
+
pageId: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: void 0
|
|
52
|
+
},
|
|
53
|
+
/**
|
|
54
|
+
* Show header and actions border
|
|
55
|
+
*/
|
|
56
|
+
alwaysShowBorder: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: !1
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* Pass custom styling to the back button to position it correctly with the header slot
|
|
62
|
+
*/
|
|
63
|
+
backButtonStyling: { type: Object, default: null },
|
|
64
|
+
/**
|
|
65
|
+
* ID of the page for the back button to navigate to. Only use it to overwrite the default back behavior
|
|
66
|
+
* Used when the back button should not take the user to the natural previous page
|
|
67
|
+
* Set to `null` to hide back button in the page
|
|
68
|
+
*/
|
|
69
|
+
previousPage: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: void 0
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
emits: ["animationend"],
|
|
75
|
+
setup(e, { emit: v }) {
|
|
76
|
+
const l = e, I = v, L = te(), g = le(L), { t: G } = re({ messages: R }), u = T(null), f = T(!1), { arrivedState: p } = ce(u), _ = s(() => o.value ? o.value === l.pageId : !0), V = s(() => ({
|
|
77
|
+
"b-dialog-page__header--with-border": l.alwaysShowBorder || f.value && !p.top
|
|
78
|
+
})), D = s(() => ({
|
|
79
|
+
"b-dialog-page__footer--with-border": l.alwaysShowBorder || f.value && !p.bottom
|
|
80
|
+
})), x = s(() => !(p.bottom && p.top)), j = () => {
|
|
81
|
+
u.value;
|
|
82
|
+
}, w = async (t) => {
|
|
83
|
+
t && (await b(), f.value = u.value && u.value.scrollHeight > u.value.clientHeight);
|
|
84
|
+
}, { activePage: o, animation: h, isAnimationActive: m, isOpen: P, pages: U, previousPages: a, updatePage: H } = A(fe);
|
|
85
|
+
E(() => P.value, w, { immediate: !0 }), E(() => _.value, w, { immediate: !0 });
|
|
86
|
+
const z = s(() => l.previousPage ? !0 : l.previousPage === null ? !1 : Y.value && _.value), J = () => {
|
|
87
|
+
h.value = S.TRANSITION_LEVEL_DEEPER, m && (m.value = !1), I("animationend");
|
|
88
|
+
}, K = () => {
|
|
89
|
+
m && (m.value = !0);
|
|
90
|
+
}, Y = s(() => a.value.length > 1), k = s(() => a.value[a.value.length - 1]), F = s(() => U.value.some((t) => t === o.value)), M = async (t) => {
|
|
91
|
+
if (t) {
|
|
92
|
+
const d = a.value.indexOf(t);
|
|
93
|
+
d !== -1 ? a.value = a.value.slice(0, d + 1) : a.value = [t];
|
|
94
|
+
} else
|
|
95
|
+
a.value.pop();
|
|
96
|
+
h.value = S.TRANSITION_LEVEL_UPPER, await b(), H(k.value);
|
|
97
|
+
};
|
|
98
|
+
E(
|
|
99
|
+
() => o.value,
|
|
100
|
+
async () => {
|
|
101
|
+
if (await b(), !!P.value) {
|
|
102
|
+
if (o.value && !F.value && ue) {
|
|
103
|
+
console.error(
|
|
104
|
+
`The activePage passed "${o.value}" does not match the id of any of the pages`
|
|
105
|
+
);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
o.value !== k.value && a.value.push(o.value);
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{ immediate: !0 }
|
|
112
|
+
);
|
|
113
|
+
const Z = A(me), { unregisterPage: q } = Z(l.pageId);
|
|
114
|
+
return ae(() => q()), (t, d) => (i(), oe(se, {
|
|
115
|
+
name: n(h),
|
|
116
|
+
mode: "out-in",
|
|
117
|
+
onAfterLeave: J,
|
|
118
|
+
onLeave: K
|
|
119
|
+
}, {
|
|
120
|
+
default: N(() => [
|
|
121
|
+
n(P) && _.value ? (i(), r("div", _e, [
|
|
122
|
+
n(g)("header") ? (i(), r("div", {
|
|
123
|
+
key: 0,
|
|
124
|
+
class: B(["b-dialog-page__header", V.value])
|
|
125
|
+
}, [
|
|
126
|
+
z.value ? (i(), r("div", {
|
|
127
|
+
key: 0,
|
|
128
|
+
class: "b-dialog-page__back-button",
|
|
129
|
+
style: ne(e.backButtonStyling),
|
|
130
|
+
"data-testid": "back-button"
|
|
131
|
+
}, [
|
|
132
|
+
C(n(ie), {
|
|
133
|
+
variant: "tertiary",
|
|
134
|
+
onClick: d[0] || (d[0] = (be) => M(e.previousPage))
|
|
135
|
+
}, {
|
|
136
|
+
default: N(() => [
|
|
137
|
+
C(n(pe), {
|
|
138
|
+
"svg-title": n(G)("goToPreviousPage")
|
|
139
|
+
}, null, 8, ["svg-title"])
|
|
140
|
+
]),
|
|
141
|
+
_: 1
|
|
142
|
+
})
|
|
143
|
+
], 4)) : c("", !0),
|
|
144
|
+
y(t.$slots, "header", {}, void 0, !0)
|
|
145
|
+
], 2)) : c("", !0),
|
|
146
|
+
n(g)("content") ? (i(), r("div", {
|
|
147
|
+
key: 1,
|
|
148
|
+
ref_key: "contentElement",
|
|
149
|
+
ref: u,
|
|
150
|
+
class: "b-dialog-page__content",
|
|
151
|
+
tabindex: x.value ? 0 : null,
|
|
152
|
+
onScroll: j
|
|
153
|
+
}, [
|
|
154
|
+
y(t.$slots, "content", {}, void 0, !0)
|
|
155
|
+
], 40, he)) : c("", !0),
|
|
156
|
+
n(g)("footer") ? (i(), r("div", {
|
|
157
|
+
key: 2,
|
|
158
|
+
class: B(["b-dialog-page__footer", D.value])
|
|
159
|
+
}, [
|
|
160
|
+
y(t.$slots, "footer", {}, void 0, !0)
|
|
161
|
+
], 2)) : c("", !0)
|
|
162
|
+
])) : c("", !0)
|
|
163
|
+
]),
|
|
164
|
+
_: 3
|
|
165
|
+
}, 8, ["name"]));
|
|
166
|
+
}
|
|
167
|
+
}), Ne = /* @__PURE__ */ O(Ee, [["__scopeId", "data-v-e8bbc7e3"]]);
|
|
168
|
+
export {
|
|
169
|
+
pe as A,
|
|
170
|
+
S as B,
|
|
171
|
+
Ne as D,
|
|
172
|
+
me as a,
|
|
173
|
+
fe as b
|
|
174
|
+
};
|
|
175
|
+
//# sourceMappingURL=dialog-page.C72BX6So.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog-page.C72BX6So.js","sources":["../../../ui-assets/icons-16/dist/vue/arrow-left.vue","../../../vue2/src/components/internal/dialog-page/dialog-page.types.ts","../../../vue2/src/components/internal/dialog-page/dialog-page.keys.ts","../../../vue2/src/components/internal/dialog-page/dialog-page.vue"],"sourcesContent":["\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#00112C\" d=\"M3.80655 7.25434L8.06077 3.00011L7.00011 1.93945L0.939453 8.00011L7.00011 14.0608L8.06077 13.0001L3.81499 8.75433L14.7508 8.74316L14.7492 7.24316L3.80655 7.25434Z\"/></svg>\n</template>\n<script>\n import '../css/main.css';\n\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n","import { Ref } from 'vue';\n\nexport enum BentoDialogPageAnimation {\n TRANSITION_LEVEL_DEEPER = 'b-dialog-page__animation--level-deeper',\n TRANSITION_LEVEL_UPPER = 'b-dialog-page__animation--level-upper',\n}\n\nexport interface BentoDialogPageConfigData {\n activePage: Ref<string>;\n animation: Ref<string>;\n isAnimationActive?: Ref<boolean>;\n isOpen: Ref<boolean>;\n pages: Ref<string[]>;\n previousPages: Ref<string[]>;\n updatePage: (page: string) => void;\n}\n\nexport type BentoDialogPageRegisterPage = (pageId: string) => { unregisterPage: () => void };\n","export const DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY = Symbol('dialog registerPage injection key');\nexport const DIALOG_PAGE_CONFIG_INJECTION_KEY = Symbol('dialog page config data injection key');\n","<template>\n <Transition :name=\"animation\" mode=\"out-in\" @after-leave=\"updateAnimation\" @leave=\"startAnimation\">\n <div v-if=\"isOpen && showPage\" class=\"b-dialog-page\">\n <div v-if=\"hasSlot('header')\" class=\"b-dialog-page__header\" :class=\"headerConditionalClasses\">\n <div\n v-if=\"showBackButton\"\n class=\"b-dialog-page__back-button\"\n :style=\"backButtonStyling\"\n data-testid=\"back-button\"\n >\n <bento-button variant=\"tertiary\" @click=\"goToPreviousPage(previousPage)\">\n <arrow-left-icon :svg-title=\"t('goToPreviousPage')\" />\n </bento-button>\n </div>\n <slot name=\"header\"></slot>\n </div>\n <div\n v-if=\"hasSlot('content')\"\n ref=\"contentElement\"\n class=\"b-dialog-page__content\"\n :tabindex=\"isScrollable ? 0 : null\"\n @scroll=\"onScroll\"\n >\n <slot name=\"content\" />\n </div>\n <div v-if=\"hasSlot('footer')\" class=\"b-dialog-page__footer\" :class=\"footerConditionalClasses\">\n <slot name=\"footer\" />\n </div>\n </div>\n </Transition>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, nextTick, onUnmounted, PropType, ref, useSlots, watch } from 'vue';\n\n import { BentoButton } from '@/components/button';\n import ArrowLeftIcon from '@adyen/ui-assets-icons-16/vue/arrow-left';\n\n import { useHasSlot } from '@/composables/use-has-slot/use-has-slot';\n import { useI18n } from '@/utils/ts/i18n';\n import { isDevelopmentEnviroment } from '@/utils/ts/dev-environment';\n\n import {\n BentoDialogPageAnimation,\n BentoDialogPageConfigData,\n BentoDialogPageRegisterPage,\n } from './dialog-page.types';\n import type { CSSProperties } from 'vue/types/jsx.d.ts';\n\n import { DIALOG_PAGE_CONFIG_INJECTION_KEY, DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY } from './dialog-page.keys';\n\n import messages from './messages.json';\n import { useScroll } from '@vueuse/core';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * Identifier of the page, used with activePage prop to handle navigation\n */\n pageId: {\n type: String,\n default: undefined,\n },\n\n /**\n * Show header and actions border\n */\n alwaysShowBorder: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Pass custom styling to the back button to position it correctly with the header slot\n */\n backButtonStyling: { type: Object as PropType<CSSProperties>, default: null },\n\n /**\n * ID of the page for the back button to navigate to. Only use it to overwrite the default back behavior\n * Used when the back button should not take the user to the natural previous page\n * Set to `null` to hide back button in the page\n */\n previousPage: {\n type: String,\n default: undefined,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Fires when the animation ends\n */\n (e: 'animationend'): void;\n }>();\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n // Refs\n const contentElement = ref<HTMLDivElement>(null);\n const hasScroll = ref(false);\n\n const { arrivedState } = useScroll(contentElement);\n\n // Logic to choose which page is active/shown\n const showPage = computed(() => (activePage.value ? activePage.value === props.pageId : true));\n\n // Scrolling styling logic\n const headerConditionalClasses = computed(() => ({\n 'b-dialog-page__header--with-border': props.alwaysShowBorder || (hasScroll.value && !arrivedState.top),\n }));\n\n const footerConditionalClasses = computed(() => ({\n 'b-dialog-page__footer--with-border': props.alwaysShowBorder || (hasScroll.value && !arrivedState.bottom),\n }));\n\n const isScrollable = computed(() => !(arrivedState.bottom && arrivedState.top));\n\n const onScroll = () => {\n if (!contentElement.value) {\n return;\n }\n };\n\n const calculateScroll = async watchedValue => {\n if (!watchedValue) {\n return;\n }\n // Wait for content to be rendered to be able to calculate the height\n await nextTick();\n hasScroll.value = contentElement.value && contentElement.value.scrollHeight > contentElement.value.clientHeight;\n };\n\n const { activePage, animation, isAnimationActive, isOpen, pages, previousPages, updatePage } =\n inject<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY);\n\n watch(() => isOpen.value, calculateScroll, { immediate: true });\n watch(() => showPage.value, calculateScroll, { immediate: true });\n\n // Logic to determine whether the back button should be shown on the page\n const showBackButton = computed(() => {\n if (props.previousPage) {\n return true;\n }\n if (props.previousPage === null) {\n return false;\n }\n return hasPreviousPages.value && showPage.value;\n });\n\n // Animation\n const updateAnimation = () => {\n animation.value = BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER;\n if (isAnimationActive) {\n isAnimationActive.value = false;\n }\n\n emit('animationend');\n };\n\n const startAnimation = () => {\n if (isAnimationActive) {\n isAnimationActive.value = true;\n }\n };\n\n // Previous page logic\n const hasPreviousPages = computed(() => previousPages.value.length > 1);\n const lastPage = computed(() => previousPages.value[previousPages.value.length - 1]);\n const isActivePageValid = computed(() => pages.value.some(page => page === activePage.value));\n\n const goToPreviousPage = async (page: string) => {\n if (page) {\n const index = previousPages.value.indexOf(page);\n if (index !== -1) {\n previousPages.value = previousPages.value.slice(0, index + 1);\n } else {\n previousPages.value = [page];\n }\n } else {\n previousPages.value.pop();\n }\n\n animation.value = BentoDialogPageAnimation.TRANSITION_LEVEL_UPPER;\n await nextTick();\n updatePage(lastPage.value);\n };\n\n // Add new page to the previousPage array to keep track of user navigation\n watch(\n () => activePage.value,\n async () => {\n await nextTick();\n if (!isOpen.value) {\n return;\n }\n\n if (!!activePage.value && !isActivePageValid.value) {\n if (isDevelopmentEnviroment) {\n // eslint-disable-next-line no-console\n console.error(\n `The activePage passed \"${activePage.value}\" does not match the id of any of the pages`\n );\n return;\n }\n }\n\n if (activePage.value !== lastPage.value) {\n previousPages.value.push(activePage.value);\n }\n },\n { immediate: true }\n );\n\n // Register page to parent component and inject data from parent component\n const registerPage = inject<BentoDialogPageRegisterPage>(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY);\n const { unregisterPage } = registerPage(props.pageId);\n\n // Unregister page on unmounting the page\n onUnmounted(() => unregisterPage());\n</script>\n\n<script lang=\"ts\">\n /**\n * DialogPage is an internal component used to render different pages of dialog components (Modal, ModalFullscreen and Sidepanel)\n *\n * @example\n * import { DialogPage } from '@/internal';\n *\n * export default {\n * components: { DialogPage },\n * template: `\n * <dialog-page pageId='step1' always-show-border>\n * <template #header>Header</template>\n * <template #content>Content</template>\n * <template #footer>Footer</template>\n * </dialog-page>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./dialog-page.scss\" />\n"],"names":["uuid","openBlock","createElementBlock","mergeProps","_ctx","createCommentVNode","BentoDialogPageAnimation","BentoDialogPageAnimation2","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY","DIALOG_PAGE_CONFIG_INJECTION_KEY","__default__","messages","props","__props","emit","__emit","slots","useSlots","hasSlot","useHasSlot","t","useI18n","contentElement","ref","hasScroll","arrivedState","useScroll","showPage","computed","activePage","headerConditionalClasses","footerConditionalClasses","isScrollable","onScroll","calculateScroll","watchedValue","nextTick","animation","isAnimationActive","isOpen","pages","previousPages","updatePage","inject","watch","showBackButton","hasPreviousPages","updateAnimation","startAnimation","lastPage","isActivePageValid","page","goToPreviousPage","index","isDevelopmentEnviroment","registerPage","unregisterPage","onUnmounted"],"mappings":";;;;;;;;;AAOI,IAAAA,IAAA;;EAGI,eAAA;8BAEIA,KAAA;AAAA;;;AAVR,SAAAC,EAAA,GAAAC,EAAA,OAAAC,EAAA,EAAA,MAAA,MAAA,GAAAC,EAAA,QAAA;AAAA,IAAgC,OAAA;AAAA,IAA2B,OAAA;AAAA,IAAmC,OAAA;AAAA,IAAW,QAAA;AAAA,IAAY,MAAA;AAAA;iFAFzHC,EAAA,IAAA,EAAA;AAAA;MAE8M,MAAA;AAAA,MAAe,GAAA;AAAA;;;;ACAjN,IAAAC,IAAA,kBAAAC,OACRA,EAAA,0BAAA,0CACAA,EAAA,yBAAA,yCAFQA,IAAAD,KAAA,CAAA,CAAA;ACFC,MAAAE,KAAA,OAAA,mCAAA,GACAC,KAAA,OAAA,uCAAA;;;;;;;sBCiPTC,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA5LA,UAAAC,IAAAC,GAiCAC,IAAAC,GAOAC,IAAAC,GAAA,GACAC,IAAAC,GAAAH,CAAA,GACA,EAAA,GAAAI,EAAA,IAAAC,GAAA,EAAA,UAAAV,EAAA,CAAA,GAGAW,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,EAAA,GAEA,EAAA,cAAAE,EAAA,IAAAC,GAAAJ,CAAA,GAGAK,IAAAC,EAAA,MAAAC,EAAA,QAAAA,EAAA,UAAAjB,EAAA,SAAA,EAAA,GAGAkB,IAAAF,EAAA,OAAA;AAAA,MAAiD,sCAAAhB,EAAA,oBAAAY,EAAA,SAAA,CAAAC,EAAA;AAAA,IACqD,EAAA,GAGtGM,IAAAH,EAAA,OAAA;AAAA,MAAiD,sCAAAhB,EAAA,oBAAAY,EAAA,SAAA,CAAAC,EAAA;AAAA,IACqD,EAAA,GAGtGO,IAAAJ,EAAA,MAAA,EAAAH,EAAA,UAAAA,EAAA,IAAA,GAEAQ,IAAA,MAAA;AACI,MAAAX,EAAA;AAAA,IAEA,GAGJY,IAAA,OAAAC,MAAA;AACI,MAAAA,MAIA,MAAAC,EAAA,GACAZ,EAAA,QAAAF,EAAA,SAAAA,EAAA,MAAA,eAAAA,EAAA,MAAA;AAAA,IAAmG,GAGvG,EAAA,YAAAO,GAAA,WAAAQ,GAAA,mBAAAC,GAAA,QAAAC,GAAA,OAAAC,GAAA,eAAAC,GAAA,YAAAC,EAAA,IAAAC,EAAAlC,EAAA;AAGA,IAAAmC,EAAA,MAAAL,EAAA,OAAAL,GAAA,EAAA,WAAA,GAAA,CAAA,GACAU,EAAA,MAAAjB,EAAA,OAAAO,GAAA,EAAA,WAAA,GAAA,CAAA;AAGA,UAAAW,IAAAjB,EAAA,MACIhB,EAAA,eACI,KAEJA,EAAA,iBAAA,OACI,KAEJkC,EAAA,SAAAnB,EAAA,KAA0C,GAI9CoB,IAAA,MAAA;AACI,MAAAV,EAAA,QAAA/B,EAAA,yBACAgC,MACIA,EAAA,QAAA,KAGJxB,EAAA,cAAA;AAAA,IAAmB,GAGvBkC,IAAA,MAAA;AACI,MAAAV,MACIA,EAAA,QAAA;AAAA,IACJ,GAIJQ,IAAAlB,EAAA,MAAAa,EAAA,MAAA,SAAA,CAAA,GACAQ,IAAArB,EAAA,MAAAa,EAAA,MAAAA,EAAA,MAAA,SAAA,CAAA,CAAA,GACAS,IAAAtB,EAAA,MAAAY,EAAA,MAAA,KAAA,CAAAW,MAAAA,MAAAtB,EAAA,KAAA,CAAA,GAEAuB,IAAA,OAAAD,MAAA;AACI,UAAAA,GAAA;AACI,cAAAE,IAAAZ,EAAA,MAAA,QAAAU,CAAA;AACA,QAAAE,MAAA,KACIZ,EAAA,QAAAA,EAAA,MAAA,MAAA,GAAAY,IAAA,CAAA,IAEAZ,EAAA,QAAA,CAAAU,CAAA;AAAA,MACJ;AAEA,QAAAV,EAAA,MAAA,IAAA;AAGJ,MAAAJ,EAAA,QAAA/B,EAAA,wBACA,MAAA8B,EAAA,GACAM,EAAAO,EAAA,KAAA;AAAA,IAAyB;AAI7B,IAAAL;AAAA,MAAA,MAAAf,EAAA;AAAA,MACqB,YAAA;AAGb,YADA,MAAAO,EAAA,GACA,EAAAG,EAAA,OAIA;AAAA,cAAAV,EAAA,SAAA,CAAAqB,EAAA,SACII,IAAA;AAEI,oBAAA;AAAA,cAAQ,0BAAAzB,EAAA,KAAA;AAAA,YACsC;AAE9C;AAAA,UAAA;AAIR,UAAAA,EAAA,UAAAoB,EAAA,SACIR,EAAA,MAAA,KAAAZ,EAAA,KAAA;AAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB;AAItB,UAAA0B,IAAAZ,EAAAnC,EAAA,GACA,EAAA,gBAAAgD,EAAA,IAAAD,EAAA3C,EAAA,MAAA;AAGA,WAAA6C,GAAA,MAAAD,EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent as s, computed as b, createElementBlock as v, openBlock as f, createVNode as c, mergeProps as y, withCtx as d, unref as _, toRefs as I, createTextVNode as g, toDisplayString as C, createBlock as w } from "vue";
|
|
2
2
|
import { B as A } from "./avatar.B0-9jC6H.js";
|
|
3
|
-
import { B as n } from "./dropdown.
|
|
3
|
+
import { B as n } from "./dropdown.D4lL2ytb.js";
|
|
4
4
|
import { d as x, B as D } from "./typography.DN5eC5ch.js";
|
|
5
5
|
import { u as T } from "./use-country-items.4kZgVg_l.js";
|
|
6
6
|
import { B } from "./country.types.C0Q_hhgJ.js";
|
|
7
|
-
import { L as $ } from "./listbox-option-tag.
|
|
7
|
+
import { L as $ } from "./listbox-option-tag.DsnH9Q9j.js";
|
|
8
8
|
import { B as k } from "./payment-method.eazefwm6.js";
|
|
9
9
|
import { _ as O } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
10
10
|
import "../assets/dropdown-tag.css";
|
|
@@ -199,4 +199,4 @@ export {
|
|
|
199
199
|
W as c,
|
|
200
200
|
X as d
|
|
201
201
|
};
|
|
202
|
-
//# sourceMappingURL=dropdown-tag.
|
|
202
|
+
//# sourceMappingURL=dropdown-tag.DCat3Pd2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-tag.Bv1togfI.js","sources":["../../../vue2/src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.vue","../../../vue2/src/components/dropdown/components/variants/dropdown-country/dropdown-country.vue","../../../vue2/src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.vue","../../../vue2/src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.vue","../../../vue2/src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.vue"],"sourcesContent":["<template>\n <div>\n <bento-dropdown v-slot=\"{ label, data }\" v-bind=\"$props\" :items=\"dropdownItems\" @input=\"onInput\">\n <bento-avatar :username=\"label\" :src=\"data\" />\n </bento-dropdown>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoListboxSelectedValue } from '@/types';\n import { BentoAvatarListboxOptions } from './dropdown-avatar.types';\n import { BentoAvatar } from '@/components/avatar';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n\n const props = defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the avatar dropdown with.\n * It must be an array of {@see BentoAvatarListboxOptions }\n * * @property {string} value.label - Text to be displayed in the option.\n * * @property {string,number} value.value - Value of the option.\n * * @property {string} value.src - Image source of the avatar image.\n */\n items: {\n type: Array as PropType<BentoAvatarListboxOptions>,\n default: () => [],\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when an item is selected\n */\n (e: 'input', selectedValue: BentoListboxSelectedValue);\n }>();\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n\n const dropdownItems = computed(() => props.items.map(({ value, label, src }) => ({ value, label, data: src })));\n</script>\n\n<script lang=\"ts\">\n /**\n * A Avatar Dropdown showing a selectable list of countries.\n *\n * @example\n * import { BentoDropdownAvatar } from '@adyen/bento-vue2';\n * import type { BentoAvatarListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdownAvatar },\n * template: `\n * <bento-dropdown-avatar\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 2\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref('user-id-1') // Default value\n * const options: BentoAvatarListboxOptions = [\n * { label: 'User 1', value: 'user-id-1' },\n * { label: 'User 2', value: 'user-id-2', src: 'image-source.jpeg' },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'bento-dropdown-avatar',\n });\n</script>\n","<template>\n <div>\n <bento-dropdown v-slot=\"{ label }\" v-bind=\"$props\" :items=\"countryItems\" @input=\"onInput\">\n <bento-typography el=\"span\">{{ label }}</bento-typography>\n </bento-dropdown>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, PropType, toRefs } from 'vue';\n import { BentoCountryListboxOptions } from './dropdown-country.types';\n import { BentoListboxSelectedValue } from '@/types';\n import { BentoTypography } from '@/components/typography';\n import { useCountryItems } from './composables/use-country-items';\n import { deprecate } from '@/utils/ts/deprecate';\n import { BentoCountryVariant } from '@/components/country';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n\n const props = defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the country dropdown with.\n * It must be an array of {@see BentoCountryListboxOptions }\n * * @deprecated {string} value.label - Use BentoDropdown instead of custom labels\n * * @property {BentoCountryCode | string} value.value - Country code of the option\n */\n items: {\n type: Array as PropType<BentoCountryListboxOptions>,\n default: () => [],\n },\n\n /**\n * Which label variant to display.\n * @values iso, name, phone_code, capital\n */\n variant: {\n type: String as PropType<BentoCountryVariant | `${BentoCountryVariant}`>,\n default: BentoCountryVariant.CUSTOM,\n validator: (value: BentoCountryVariant) => Object.values(BentoCountryVariant).includes(value),\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when an item is selected\n */\n (e: 'input', selectedValue: BentoListboxSelectedValue);\n }>();\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n\n const { variant, items } = toRefs(props);\n const countryItems = useCountryItems(variant, items);\n\n if (variant.value === 'custom' || items.value.some(item => item.label)) {\n deprecate(\n 'BentoDropdownCountry \"custom\" variant and \"items\" prop \"label\" key',\n 'Use any of the other BentoDropdownCountry variants instead OR use BentoDropdown component for custom labels',\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * A Country Dropdown showing a selectable list of countries.\n *\n * @example\n * import { BentoDropdownCountry, BentoCountryCode } from '@adyen/bento-vue2';\n * import type { BentoCountryListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdown },\n * template: `\n * <bento-dropdown-country\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 2\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref(BentoCountryCode.NL) // Default value\n * const options: BentoCountryListboxOptions = [\n * { label: 'Option 1', value: BentoCountryCode.NL },\n * { label: 'Option 2', value: BentoCountryCode.BE },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'b-dropdown-country',\n });\n</script>\n","<template>\n <bento-dropdown v-slot=\"slotProps\" v-bind=\"$props\" @input=\"onInput\">\n <listbox-option-tag :option=\"slotProps\" />\n </bento-dropdown>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import type { BentoCurrencyListboxOptions } from './dropdown-currency.types';\n import type { BentoListboxSelectedValue } from '@/types';\n import { ListboxOptionTag } from '@/internal';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n\n defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the country dropdown with.\n * It must be an array of {@see BentoCurrencyListboxOptions }\n * * @property {string} value.label - Text to be displayed in the option\n * * @property {BentoCurrencyISOCode} value.code - Currency ISO code of the option\n */\n items: {\n type: Array as PropType<BentoCurrencyListboxOptions>,\n default: () => [],\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when an item is selected\n */\n (e: 'input', selectedValue: BentoListboxSelectedValue);\n }>();\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n</script>\n\n<script lang=\"ts\">\n /**\n * A Currency Dropdown showing a selectable list of currencies.\n *\n * @example\n * import { BentoDropdownCountry, BentoCountryCode } from '@adyen/bento-vue2';\n * import type { BentoCountryListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdown },\n * template: `\n * <bento-dropdown-currency\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 2\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref(BentoCountryCode.NL) // Default value\n * const options: BentoCountryListboxOptions = [\n * { label: 'Option 1', value: BentoCountryCode.NL },\n * { label: 'Option 2', value: BentoCountryCode.BE },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'b-dropdown-currency',\n });\n</script>\n","<template>\n <div>\n <bento-dropdown v-slot=\"{ value, label }\" v-bind=\"$props\" @input=\"onInput\">\n <bento-payment-method :type=\"value\" :label=\"label\" />\n </bento-dropdown>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import { BentoPaymentMethodListboxOptions } from './dropdown-payment-method.types';\n import { BentoListboxSelectedValue } from '@/types';\n import { BentoPaymentMethod } from '@/components/payment-method';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n\n defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the payment method dropdown with.\n * It must be an array of {@see BentoPaymentMethodListboxOptions }\n * * @property {string} value.label - Text to be displayed in the option\n * * @property {string} value.value - Payment type code that translates to a payment icon name {@see https://adyen-ui-assets.netlify.app/?path=/story/packages-ui-assets-payment-method-icons--icons}\n */\n items: {\n type: Array as PropType<BentoPaymentMethodListboxOptions>,\n default: () => [],\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when an item is selected\n */\n (e: 'input', selectedValue: BentoListboxSelectedValue);\n }>();\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n</script>\n\n<script lang=\"ts\">\n /**\n * A Payment method Dropdown showing a selectable list of countries.\n *\n * @example\n * import { BentoDropdownPaymentMethod } from '@adyen/bento-vue2';\n * import type { BentoPaymentMethodListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdownPaymentMethod },\n * template: `\n * <bento-dropdown-payment-method\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 'Visa'\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref('ideal') // Default value\n * const options: BentoPaymentMethodListboxOptions = [\n * { label: 'Option 1', value: 'ideal' },\n * { label: 'Option 2', value: 'visa' },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'bento-dropdown-payment-method',\n });\n</script>\n","<template>\n <bento-dropdown\n v-slot=\"{ label, data }\"\n v-bind=\"$props\"\n class=\"b-dropdown-tag\"\n :items=\"tagItems\"\n show-slot-content-in-multiple\n @input=\"onInput\"\n >\n <listbox-option-tag :option=\"{ value: label, data, label: '' }\" />\n </bento-dropdown>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import type { BentoTagListboxOptions } from './dropdown-tag.types';\n import type { BentoListboxSelectedValue } from '../../../../../types';\n import { ListboxOptionTag } from '../../../../internal';\n import BentoDropdown from '../../../dropdown.vue';\n\n const props = defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the tag dropdown with.\n * It must be an array of {@see BentoTagListboxOptions }\n * * @property {string} value.label - Text to be displayed in the option\n * * @property {string,number} value.value - Value of the option\n * * @property {string} value.variant - The BentTag variant shown for the option.\n */\n items: {\n type: Array as PropType<BentoTagListboxOptions>,\n default: () => [],\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when an item is selected\n */\n (e: 'input', selectedValue: BentoListboxSelectedValue);\n }>();\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n\n const tagItems = computed(() => props.items?.map(({ label, value, variant }) => ({ label, value, data: variant })));\n</script>\n\n<script lang=\"ts\">\n /**\n * A Tag Dropdown showing a selectable list of tags.\n *\n * @example\n * import { BentoDropdownTag } from '@adyen/bento-vue2';\n * import type { BentoTagListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdownTag },\n * template: `\n * <bento-dropdown-tag\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref('unique-id-1') // Default value\n * const options: BentoTagListboxOptions = [\n * { label: 'Offline', value: 'unique-id-1', variant: 'red' },\n * { label: 'Online', value: 'unique-id-2', variant: 'green' },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'bento-dropdown-tag',\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./dropdown-tag.scss\" />\n"],"names":["__default__$4","defineComponent","props","__props","emit","__emit","onInput","selectedValue","dropdownItems","computed","value","label","src","__default__$3","variant","items","toRefs","countryItems","useCountryItems","item","deprecate","__default__$2","__default__$1","__default__","tagItems","_a"],"mappings":";;;;;;;;;;AAuEI,MAAAA,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;;AA1DA,UAAAC,IAAAC,GAeAC,IAAAC,GAOAC,IAAA,CAAAC,MAAAH,EAAA,SAAAG,CAAA,GAEAC,IAAAC,EAAA,MAAAP,EAAA,MAAA,IAAA,CAAA,EAAA,OAAAQ,GAAA,OAAAC,GAAA,KAAAC,EAAA,OAAA,EAAA,OAAAF,GAAA,OAAAC,GAAA,MAAAC,EAAA,EAAA,CAAA;;;;;;;;;;;;;;;;ICqDAC,IAAAZ,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AA5EA,UAAAC,IAAAC,GAwBAC,IAAAC,GAOAC,IAAA,CAAAC,MAAAH,EAAA,SAAAG,CAAA,GAEA,EAAA,SAAAO,GAAA,OAAAC,EAAA,IAAAC,EAAAd,CAAA,GACAe,IAAAC,EAAAJ,GAAAC,CAAA;AAEA,YAAAD,EAAA,UAAA,YAAAC,EAAA,MAAA,KAAA,CAAAI,MAAAA,EAAA,KAAA,MACIC;AAAA,MAAA;AAAA,MACI;AAAA,MACA;AAAA,IACA;;;;;;;;;;;;;;;;;ICQRC,IAAApB,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;AAzCA,UAAAG,IAAAC,GAOAC,IAAA,CAAAC,MAAAH,EAAA,SAAAG,CAAA;;;;;;;;ICkCAe,IAAArB,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;AAzCA,UAAAG,IAAAC,GAOAC,IAAA,CAAAC,MAAAH,EAAA,SAAAG,CAAA;;;;;;;;;;;;;ICsCAgB,IAAAtB,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;;AAxDA,UAAAC,IAAAC,GAeAC,IAAAC,GAOAC,IAAA,CAAAC,MAAAH,EAAA,SAAAG,CAAA,GAEAiB,IAAAf,EAAA,MAAA;;AAAA,cAAAgB,IAAAvB,EAAA,UAAA,gBAAAuB,EAAA,IAAA,CAAA,EAAA,OAAAd,GAAA,OAAAD,GAAA,SAAAI,EAAA,OAAA,EAAA,OAAAH,GAAA,OAAAD,GAAA,MAAAI,EAAA;AAAA,KAAA;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"dropdown-tag.DCat3Pd2.js","sources":["../../../vue2/src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.vue","../../../vue2/src/components/dropdown/components/variants/dropdown-country/dropdown-country.vue","../../../vue2/src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.vue","../../../vue2/src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.vue","../../../vue2/src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.vue"],"sourcesContent":["<template>\n <div>\n <bento-dropdown v-slot=\"{ label, data }\" v-bind=\"$props\" :items=\"dropdownItems\" @input=\"onInput\">\n <bento-avatar :username=\"label\" :src=\"data\" />\n </bento-dropdown>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoListboxSelectedValue } from '@/types';\n import { BentoAvatarListboxOptions } from './dropdown-avatar.types';\n import { BentoAvatar } from '@/components/avatar';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n\n const props = defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the avatar dropdown with.\n * It must be an array of {@see BentoAvatarListboxOptions }\n * * @property {string} value.label - Text to be displayed in the option.\n * * @property {string,number} value.value - Value of the option.\n * * @property {string} value.src - Image source of the avatar image.\n */\n items: {\n type: Array as PropType<BentoAvatarListboxOptions>,\n default: () => [],\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when an item is selected\n */\n (e: 'input', selectedValue: BentoListboxSelectedValue);\n }>();\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n\n const dropdownItems = computed(() => props.items.map(({ value, label, src }) => ({ value, label, data: src })));\n</script>\n\n<script lang=\"ts\">\n /**\n * A Avatar Dropdown showing a selectable list of countries.\n *\n * @example\n * import { BentoDropdownAvatar } from '@adyen/bento-vue2';\n * import type { BentoAvatarListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdownAvatar },\n * template: `\n * <bento-dropdown-avatar\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 2\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref('user-id-1') // Default value\n * const options: BentoAvatarListboxOptions = [\n * { label: 'User 1', value: 'user-id-1' },\n * { label: 'User 2', value: 'user-id-2', src: 'image-source.jpeg' },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'bento-dropdown-avatar',\n });\n</script>\n","<template>\n <div>\n <bento-dropdown v-slot=\"{ label }\" v-bind=\"$props\" :items=\"countryItems\" @input=\"onInput\">\n <bento-typography el=\"span\">{{ label }}</bento-typography>\n </bento-dropdown>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, PropType, toRefs } from 'vue';\n import { BentoCountryListboxOptions } from './dropdown-country.types';\n import { BentoListboxSelectedValue } from '@/types';\n import { BentoTypography } from '@/components/typography';\n import { useCountryItems } from './composables/use-country-items';\n import { deprecate } from '@/utils/ts/deprecate';\n import { BentoCountryVariant } from '@/components/country';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n\n const props = defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the country dropdown with.\n * It must be an array of {@see BentoCountryListboxOptions }\n * * @deprecated {string} value.label - Use BentoDropdown instead of custom labels\n * * @property {BentoCountryCode | string} value.value - Country code of the option\n */\n items: {\n type: Array as PropType<BentoCountryListboxOptions>,\n default: () => [],\n },\n\n /**\n * Which label variant to display.\n * @values iso, name, phone_code, capital\n */\n variant: {\n type: String as PropType<BentoCountryVariant | `${BentoCountryVariant}`>,\n default: BentoCountryVariant.CUSTOM,\n validator: (value: BentoCountryVariant) => Object.values(BentoCountryVariant).includes(value),\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when an item is selected\n */\n (e: 'input', selectedValue: BentoListboxSelectedValue);\n }>();\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n\n const { variant, items } = toRefs(props);\n const countryItems = useCountryItems(variant, items);\n\n if (variant.value === 'custom' || items.value.some(item => item.label)) {\n deprecate(\n 'BentoDropdownCountry \"custom\" variant and \"items\" prop \"label\" key',\n 'Use any of the other BentoDropdownCountry variants instead OR use BentoDropdown component for custom labels',\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * A Country Dropdown showing a selectable list of countries.\n *\n * @example\n * import { BentoDropdownCountry, BentoCountryCode } from '@adyen/bento-vue2';\n * import type { BentoCountryListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdown },\n * template: `\n * <bento-dropdown-country\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 2\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref(BentoCountryCode.NL) // Default value\n * const options: BentoCountryListboxOptions = [\n * { label: 'Option 1', value: BentoCountryCode.NL },\n * { label: 'Option 2', value: BentoCountryCode.BE },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'b-dropdown-country',\n });\n</script>\n","<template>\n <bento-dropdown v-slot=\"slotProps\" v-bind=\"$props\" @input=\"onInput\">\n <listbox-option-tag :option=\"slotProps\" />\n </bento-dropdown>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import type { BentoCurrencyListboxOptions } from './dropdown-currency.types';\n import type { BentoListboxSelectedValue } from '@/types';\n import { ListboxOptionTag } from '@/internal';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n\n defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the country dropdown with.\n * It must be an array of {@see BentoCurrencyListboxOptions }\n * * @property {string} value.label - Text to be displayed in the option\n * * @property {BentoCurrencyISOCode} value.code - Currency ISO code of the option\n */\n items: {\n type: Array as PropType<BentoCurrencyListboxOptions>,\n default: () => [],\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when an item is selected\n */\n (e: 'input', selectedValue: BentoListboxSelectedValue);\n }>();\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n</script>\n\n<script lang=\"ts\">\n /**\n * A Currency Dropdown showing a selectable list of currencies.\n *\n * @example\n * import { BentoDropdownCountry, BentoCountryCode } from '@adyen/bento-vue2';\n * import type { BentoCountryListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdown },\n * template: `\n * <bento-dropdown-currency\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 2\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref(BentoCountryCode.NL) // Default value\n * const options: BentoCountryListboxOptions = [\n * { label: 'Option 1', value: BentoCountryCode.NL },\n * { label: 'Option 2', value: BentoCountryCode.BE },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'b-dropdown-currency',\n });\n</script>\n","<template>\n <div>\n <bento-dropdown v-slot=\"{ value, label }\" v-bind=\"$props\" @input=\"onInput\">\n <bento-payment-method :type=\"value\" :label=\"label\" />\n </bento-dropdown>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import { BentoPaymentMethodListboxOptions } from './dropdown-payment-method.types';\n import { BentoListboxSelectedValue } from '@/types';\n import { BentoPaymentMethod } from '@/components/payment-method';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n\n defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the payment method dropdown with.\n * It must be an array of {@see BentoPaymentMethodListboxOptions }\n * * @property {string} value.label - Text to be displayed in the option\n * * @property {string} value.value - Payment type code that translates to a payment icon name {@see https://adyen-ui-assets.netlify.app/?path=/story/packages-ui-assets-payment-method-icons--icons}\n */\n items: {\n type: Array as PropType<BentoPaymentMethodListboxOptions>,\n default: () => [],\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when an item is selected\n */\n (e: 'input', selectedValue: BentoListboxSelectedValue);\n }>();\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n</script>\n\n<script lang=\"ts\">\n /**\n * A Payment method Dropdown showing a selectable list of countries.\n *\n * @example\n * import { BentoDropdownPaymentMethod } from '@adyen/bento-vue2';\n * import type { BentoPaymentMethodListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdownPaymentMethod },\n * template: `\n * <bento-dropdown-payment-method\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 'Visa'\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref('ideal') // Default value\n * const options: BentoPaymentMethodListboxOptions = [\n * { label: 'Option 1', value: 'ideal' },\n * { label: 'Option 2', value: 'visa' },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'bento-dropdown-payment-method',\n });\n</script>\n","<template>\n <bento-dropdown\n v-slot=\"{ label, data }\"\n v-bind=\"$props\"\n class=\"b-dropdown-tag\"\n :items=\"tagItems\"\n show-slot-content-in-multiple\n @input=\"onInput\"\n >\n <listbox-option-tag :option=\"{ value: label, data, label: '' }\" />\n </bento-dropdown>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import type { BentoTagListboxOptions } from './dropdown-tag.types';\n import type { BentoListboxSelectedValue } from '../../../../../types';\n import { ListboxOptionTag } from '../../../../internal';\n import BentoDropdown from '../../../dropdown.vue';\n\n const props = defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the tag dropdown with.\n * It must be an array of {@see BentoTagListboxOptions }\n * * @property {string} value.label - Text to be displayed in the option\n * * @property {string,number} value.value - Value of the option\n * * @property {string} value.variant - The BentTag variant shown for the option.\n */\n items: {\n type: Array as PropType<BentoTagListboxOptions>,\n default: () => [],\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when an item is selected\n */\n (e: 'input', selectedValue: BentoListboxSelectedValue);\n }>();\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n\n const tagItems = computed(() => props.items?.map(({ label, value, variant }) => ({ label, value, data: variant })));\n</script>\n\n<script lang=\"ts\">\n /**\n * A Tag Dropdown showing a selectable list of tags.\n *\n * @example\n * import { BentoDropdownTag } from '@adyen/bento-vue2';\n * import type { BentoTagListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdownTag },\n * template: `\n * <bento-dropdown-tag\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref('unique-id-1') // Default value\n * const options: BentoTagListboxOptions = [\n * { label: 'Offline', value: 'unique-id-1', variant: 'red' },\n * { label: 'Online', value: 'unique-id-2', variant: 'green' },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'bento-dropdown-tag',\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./dropdown-tag.scss\" />\n"],"names":["__default__$4","defineComponent","props","__props","emit","__emit","onInput","selectedValue","dropdownItems","computed","value","label","src","__default__$3","variant","items","toRefs","countryItems","useCountryItems","item","deprecate","__default__$2","__default__$1","__default__","tagItems","_a"],"mappings":";;;;;;;;;;AAuEI,MAAAA,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;;AA1DA,UAAAC,IAAAC,GAeAC,IAAAC,GAOAC,IAAA,CAAAC,MAAAH,EAAA,SAAAG,CAAA,GAEAC,IAAAC,EAAA,MAAAP,EAAA,MAAA,IAAA,CAAA,EAAA,OAAAQ,GAAA,OAAAC,GAAA,KAAAC,EAAA,OAAA,EAAA,OAAAF,GAAA,OAAAC,GAAA,MAAAC,EAAA,EAAA,CAAA;;;;;;;;;;;;;;;;ICqDAC,IAAAZ,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AA5EA,UAAAC,IAAAC,GAwBAC,IAAAC,GAOAC,IAAA,CAAAC,MAAAH,EAAA,SAAAG,CAAA,GAEA,EAAA,SAAAO,GAAA,OAAAC,EAAA,IAAAC,EAAAd,CAAA,GACAe,IAAAC,EAAAJ,GAAAC,CAAA;AAEA,YAAAD,EAAA,UAAA,YAAAC,EAAA,MAAA,KAAA,CAAAI,MAAAA,EAAA,KAAA,MACIC;AAAA,MAAA;AAAA,MACI;AAAA,MACA;AAAA,IACA;;;;;;;;;;;;;;;;;ICQRC,IAAApB,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;AAzCA,UAAAG,IAAAC,GAOAC,IAAA,CAAAC,MAAAH,EAAA,SAAAG,CAAA;;;;;;;;ICkCAe,IAAArB,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;AAzCA,UAAAG,IAAAC,GAOAC,IAAA,CAAAC,MAAAH,EAAA,SAAAG,CAAA;;;;;;;;;;;;;ICsCAgB,IAAAtB,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;;AAxDA,UAAAC,IAAAC,GAeAC,IAAAC,GAOAC,IAAA,CAAAC,MAAAH,EAAA,SAAAG,CAAA,GAEAiB,IAAAf,EAAA,MAAA;;AAAA,cAAAgB,IAAAvB,EAAA,UAAA,gBAAAuB,EAAA,IAAA,CAAA,EAAA,OAAAd,GAAA,OAAAD,GAAA,SAAAI,EAAA,OAAA,EAAA,OAAAH,GAAA,OAAAD,GAAA,MAAAI,EAAA;AAAA,KAAA;;;;;;;;;;;;;;;;"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { ref as C, watch as Oe, computed as f, defineComponent as j, useSlots as Be, toRefs as De, createBlock as K, openBlock as L, resolveDynamicComponent as Ie, mergeProps as M, withCtx as z, createElementVNode as te, withKeys as _e, unref as n, createVNode as Q, toHandlers as G, createSlots as re, renderList as de, renderSlot as X, normalizeProps as ue, guardReactiveProps as ce, createElementBlock as P, createCommentVNode as F, toDisplayString as ve, normalizeClass as pe, withDirectives as ee, vShow as Le, nextTick as I, useAttrs as Ze, toRef as D, inject as Qe, createTextVNode as Xe } from "vue";
|
|
2
2
|
import { d as Ee, B as Ge } from "./typography.DN5eC5ch.js";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { _ } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
6
|
-
import { s as ie } from "./events.FNmSWp_P.js";
|
|
7
|
-
import { g as Y } from "./generate-uid.NJ8tVoha.js";
|
|
8
|
-
import { u as at } from "./aria-label.CaUURpnB.js";
|
|
3
|
+
import { g as V } from "./generate-uid.NJ8tVoha.js";
|
|
4
|
+
import { u as et } from "./aria-label.CaUURpnB.js";
|
|
9
5
|
import { u as ye } from "./i18n.B6g5VX0q.js";
|
|
10
|
-
import { u as
|
|
11
|
-
import { B as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
6
|
+
import { u as tt } from "./use-form-layout-loading.D3lALhtC.js";
|
|
7
|
+
import { B as at } from "./directive.Cbdox5VL.js";
|
|
8
|
+
import { s as se } from "./events.FNmSWp_P.js";
|
|
9
|
+
import { B as $, a as ot } from "./keyboard-navigation.CqgGzfZQ.js";
|
|
10
|
+
import { a as ie, b as J, c as lt, B as Y, D as nt } from "./dropdown-default-textbox.BNhy-QDH.js";
|
|
11
|
+
import { a as p, b as fe, B as me, c as st, u as it } from "./use-cached-selected-values.BgoZ5uGq.js";
|
|
14
12
|
import { u as rt } from "./use-has-slot.B7eQSabc.js";
|
|
15
|
-
import { F as dt, E as ut } from "./error-message.
|
|
16
|
-
import { P as we } from "./popper-container.
|
|
13
|
+
import { F as dt, E as ut } from "./error-message.CjdvgIAh.js";
|
|
14
|
+
import { P as we } from "./popper-container.B_sb3SNK.js";
|
|
17
15
|
import "./popper-container.types.BCZMbVFD.js";
|
|
18
|
-
import { B as ct } from "./popover.
|
|
16
|
+
import { B as ct } from "./popover.BzzdIK19.js";
|
|
17
|
+
import { _ } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
18
|
+
/* empty css */
|
|
19
19
|
import "../assets/dropdown.css";
|
|
20
20
|
const be = {
|
|
21
21
|
"en-US": {
|
|
@@ -211,7 +211,7 @@ const be = {
|
|
|
211
211
|
actions: O.value,
|
|
212
212
|
divider: !0,
|
|
213
213
|
fallbackPosition: ["top-start"],
|
|
214
|
-
id:
|
|
214
|
+
id: V(`dropdown-options-${o.id}`),
|
|
215
215
|
open: o.open,
|
|
216
216
|
position: "bottom-start",
|
|
217
217
|
style: {
|
|
@@ -386,19 +386,19 @@ const wt = /* @__PURE__ */ _(St, [["render", Et]]), Ct = { class: "b-dropdown-sm
|
|
|
386
386
|
emits: ["clear", "close", "input", "keydown", "open"],
|
|
387
387
|
setup(e, { expose: i, emit: s }) {
|
|
388
388
|
const a = s, l = e, o = C(null), t = f(() => ({
|
|
389
|
-
[`b-dropdown-small-textbox--${
|
|
390
|
-
[`b-dropdown-small-textbox--${
|
|
391
|
-
[`b-dropdown-small-textbox--${
|
|
389
|
+
[`b-dropdown-small-textbox--${ie.DISABLED}`]: l.disabled,
|
|
390
|
+
[`b-dropdown-small-textbox--${ie.READONLY}`]: l.readonly,
|
|
391
|
+
[`b-dropdown-small-textbox--${ie.OPENED}`]: l.open
|
|
392
392
|
})), c = f(() => l.open && !l.disabled && !l.readonly), m = (v) => {
|
|
393
393
|
a("input", v);
|
|
394
394
|
}, h = (v) => {
|
|
395
395
|
a("keydown", v);
|
|
396
396
|
}, r = (v) => {
|
|
397
|
-
|
|
397
|
+
se(v), a("open");
|
|
398
398
|
}, g = (v) => {
|
|
399
|
-
|
|
399
|
+
se(v), a("close");
|
|
400
400
|
}, u = (v) => {
|
|
401
|
-
|
|
401
|
+
se(v), a("clear");
|
|
402
402
|
}, x = {
|
|
403
403
|
[J.INPUT]: m,
|
|
404
404
|
[J.OPEN]: r,
|
|
@@ -413,12 +413,12 @@ const wt = /* @__PURE__ */ _(St, [["render", Et]]), Ct = { class: "b-dropdown-sm
|
|
|
413
413
|
}), (v, B) => (L(), P("div", {
|
|
414
414
|
class: pe(["b-dropdown-small-textbox", t.value])
|
|
415
415
|
}, [
|
|
416
|
-
Q(
|
|
416
|
+
Q(lt, M({
|
|
417
417
|
ref_key: "baseTextbox",
|
|
418
418
|
ref: o
|
|
419
419
|
}, { ...v.$attrs, ...v.$props }, {
|
|
420
420
|
class: "b-dropdown-small-textbox__textbox",
|
|
421
|
-
size: n(
|
|
421
|
+
size: n(Y).SMALL
|
|
422
422
|
}, G(x)), {
|
|
423
423
|
icon: z(() => [
|
|
424
424
|
te("div", Ct, [
|
|
@@ -563,7 +563,7 @@ const $e = {
|
|
|
563
563
|
i18n: { messages: $e },
|
|
564
564
|
name: "b-dropdown",
|
|
565
565
|
components: {
|
|
566
|
-
DropdownInputDefault:
|
|
566
|
+
DropdownInputDefault: nt,
|
|
567
567
|
DropdownInputSmall: Bt
|
|
568
568
|
}
|
|
569
569
|
}), Mt = /* @__PURE__ */ j({
|
|
@@ -699,7 +699,7 @@ const $e = {
|
|
|
699
699
|
size: {
|
|
700
700
|
type: String,
|
|
701
701
|
default: null,
|
|
702
|
-
validator: (e) => Object.values(
|
|
702
|
+
validator: (e) => Object.values(Y).includes(e)
|
|
703
703
|
},
|
|
704
704
|
/**
|
|
705
705
|
* If enabled, dropdown will display non-selectable, static categories
|
|
@@ -730,16 +730,16 @@ const $e = {
|
|
|
730
730
|
emits: ["input", "show-more"],
|
|
731
731
|
setup(e, { expose: i, emit: s }) {
|
|
732
732
|
var Se;
|
|
733
|
-
const a = Ze(), l = Be(), o = rt(l), t = e, c = s, { t: m } = ye({ messages: $e }), h = C(null), r = C(null), g = C(null), u = C(!1), x =
|
|
733
|
+
const a = Ze(), l = Be(), o = rt(l), t = e, c = s, { t: m } = ye({ messages: $e }), h = C(null), r = C(null), g = C(null), u = C(!1), x = V("bento-dropdown-options-container"), O = V("dropdown-label"), v = V("dropdown-description"), B = V("dropdown-error"), { isReadOnly: E } = tt(D(t, "readonly")), { cachedSelectedListboxOptions: S, cachedListboxSelectedValues: W, setCachedValues: q } = st(
|
|
734
734
|
D(t, "items"),
|
|
735
735
|
D(t, "value"),
|
|
736
736
|
D(t, "multiple")
|
|
737
|
-
), N = C(a["aria-label"]), { ariaLabel: d, label: y } = De(t), w =
|
|
737
|
+
), N = C(a["aria-label"]), { ariaLabel: d, label: y } = De(t), w = et({
|
|
738
738
|
// TODO: take ariaLabel ref away when aria-label prop is removed
|
|
739
739
|
ariaLabel: d.value || N,
|
|
740
740
|
label: y,
|
|
741
741
|
defaultFallback: m("ariaLabelFallback")
|
|
742
|
-
}), A = t.size ===
|
|
742
|
+
}), A = t.size === Y.SMALL || Qe(At, !1), Ne = f(() => A ? Y.SMALL : Y.DEFAULT), Ae = f(() => ({
|
|
743
743
|
"b-dropdown--condensed": t.condensed
|
|
744
744
|
})), Re = f(() => ({
|
|
745
745
|
"b-dropdown__description--error": !!t.errorMessage
|
|
@@ -869,7 +869,7 @@ const $e = {
|
|
|
869
869
|
}))
|
|
870
870
|
]), 1064, ["condensed", "value", "additional-items-selected", "ariaControls", "ariaExpanded", "aria-labelledby", "aria-describedby", "aria-label", "aria-readonly", "readonly", "disabled", "display-value", "dynamic-filtering", "is-invalid", "multiple", "open", "selected-value-item", "show-slot-content-in-multiple"]))
|
|
871
871
|
], 16)), [
|
|
872
|
-
[n(
|
|
872
|
+
[n(ot)]
|
|
873
873
|
]),
|
|
874
874
|
h.value ? (L(), K(n(vt), M({
|
|
875
875
|
key: 1,
|
|
@@ -921,7 +921,7 @@ const $e = {
|
|
|
921
921
|
_: 3
|
|
922
922
|
}, 8, ["id", "class"])) : F("", !0)
|
|
923
923
|
], 2)), [
|
|
924
|
-
[n(
|
|
924
|
+
[n(at), qe]
|
|
925
925
|
]);
|
|
926
926
|
};
|
|
927
927
|
}
|
|
@@ -933,4 +933,4 @@ export {
|
|
|
933
933
|
aa as b,
|
|
934
934
|
Nt as u
|
|
935
935
|
};
|
|
936
|
-
//# sourceMappingURL=dropdown.
|
|
936
|
+
//# sourceMappingURL=dropdown.D4lL2ytb.js.map
|