@adyen/bento-vue3 1.67.0 → 1.68.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 +1956 -2181
- package/dist/action-bar.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/header-meta.css +1 -0
- package/dist/assets/header-with-views.css +1 -1
- package/dist/assets/header.css +1 -1
- package/dist/assets/input-field-phone-number.css +1 -1
- package/dist/assets/input-field.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/menu.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/popover.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/summary-grid.css +1 -1
- package/dist/assets/textarea.css +1 -1
- package/dist/assets/use-cached-selected-values.css +1 -1
- package/dist/button.js +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{action-bar.ComuZPet.js → action-bar.C93kgr7l.js} +4 -4
- package/dist/chunks/{action-bar.ComuZPet.js.map → action-bar.C93kgr7l.js.map} +1 -1
- package/dist/chunks/{base-modal.DzJrvis_.js → base-modal.C3_r3rmc.js} +120 -183
- package/dist/chunks/base-modal.C3_r3rmc.js.map +1 -0
- package/dist/chunks/{button-actions-with-menu.B0nWCTwZ.js → button-actions-with-menu.DUccmaB2.js} +3 -3
- package/dist/chunks/{button-actions-with-menu.B0nWCTwZ.js.map → button-actions-with-menu.DUccmaB2.js.map} +1 -1
- package/dist/chunks/{button-actions.BwpznQ6c.js → button-actions.CZdO9YOk.js} +7 -7
- package/dist/chunks/button-actions.CZdO9YOk.js.map +1 -0
- package/dist/chunks/{card.JBOvn2BO.js → card.CS34Mi_G.js} +2 -2
- package/dist/chunks/{card.JBOvn2BO.js.map → card.CS34Mi_G.js.map} +1 -1
- package/dist/chunks/{checkbox-group.Dc5Olq0c.js → checkbox-group.JRo6xNpe.js} +2 -2
- package/dist/chunks/{checkbox-group.Dc5Olq0c.js.map → checkbox-group.JRo6xNpe.js.map} +1 -1
- package/dist/chunks/{checkbox.fkPJvdUo.js → checkbox.DGrG3GN1.js} +70 -67
- package/dist/chunks/checkbox.DGrG3GN1.js.map +1 -0
- package/dist/chunks/{code-snippet.vrlSqi9k.js → code-snippet.aucmPbLw.js} +3 -3
- package/dist/chunks/{code-snippet.vrlSqi9k.js.map → code-snippet.aucmPbLw.js.map} +1 -1
- package/dist/chunks/{country.BhAcCmRx.js → country.Q95voxeL.js} +2 -2
- package/dist/chunks/{country.BhAcCmRx.js.map → country.Q95voxeL.js.map} +1 -1
- package/dist/chunks/{dashboard-section.Bg0dfNs-.js → dashboard-section.CUcq2ahu.js} +2 -2
- package/dist/chunks/{dashboard-section.Bg0dfNs-.js.map → dashboard-section.CUcq2ahu.js.map} +1 -1
- package/dist/chunks/{dashed-underline.DgE-UB-x.js → dashed-underline.DkzQkpaf.js} +2 -2
- package/dist/chunks/{dashed-underline.DgE-UB-x.js.map → dashed-underline.DkzQkpaf.js.map} +1 -1
- package/dist/chunks/{data-grid-template.Df7j2oxe.js → data-grid-template.CDsV2GFG.js} +2 -2
- package/dist/chunks/{data-grid-template.Df7j2oxe.js.map → data-grid-template.CDsV2GFG.js.map} +1 -1
- package/dist/chunks/data-grid.BJHcfrTG.js +3861 -0
- package/dist/chunks/data-grid.BJHcfrTG.js.map +1 -0
- package/dist/chunks/{date-picker.CZ6zU-NJ.js → date-picker.DgpMAGYp.js} +15 -15
- package/dist/chunks/{date-picker.CZ6zU-NJ.js.map → date-picker.DgpMAGYp.js.map} +1 -1
- package/dist/chunks/{date-range-picker.Dw4R9bIs.js → date-range-picker.Bxa_f6Q0.js} +24 -24
- package/dist/chunks/{date-range-picker.Dw4R9bIs.js.map → date-range-picker.Bxa_f6Q0.js.map} +1 -1
- package/dist/chunks/dropdown-default-textbox.Ce5D3ipi.js.map +1 -1
- package/dist/chunks/dropdown-tag.AV8Pi1SS.js +230 -0
- package/dist/chunks/dropdown-tag.AV8Pi1SS.js.map +1 -0
- package/dist/chunks/dropdown.CJBk1euy.js +814 -0
- package/dist/chunks/dropdown.CJBk1euy.js.map +1 -0
- package/dist/chunks/es6.n1ewaW31.js.map +1 -1
- package/dist/chunks/{filter-bar.XonJn7ao.js → filter-bar.6D-9UEng.js} +848 -833
- package/dist/chunks/filter-bar.6D-9UEng.js.map +1 -0
- package/dist/chunks/{footer-actions.CdJLLWNR.js → footer-actions.Bje-DDqw.js} +2 -2
- package/dist/chunks/{footer-actions.CdJLLWNR.js.map → footer-actions.Bje-DDqw.js.map} +1 -1
- package/dist/chunks/header-meta.Yt43-cUI.js +234 -0
- package/dist/chunks/header-meta.Yt43-cUI.js.map +1 -0
- package/dist/chunks/{header-with-views.CHbH1_1V.js → header-with-views.DbBUHvvE.js} +697 -678
- package/dist/chunks/header-with-views.DbBUHvvE.js.map +1 -0
- package/dist/chunks/header.wiq0wlgm.js +141 -0
- package/dist/chunks/header.wiq0wlgm.js.map +1 -0
- package/dist/chunks/{input-field-password.DWZAf1Oh.js → input-field-password.Cr3A_4n0.js} +4 -4
- package/dist/chunks/{input-field-password.DWZAf1Oh.js.map → input-field-password.Cr3A_4n0.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.CbpRItYf.js → input-field-phone-number.DZp5IzU3.js} +548 -532
- package/dist/chunks/{input-field-phone-number.CbpRItYf.js.map → input-field-phone-number.DZp5IzU3.js.map} +1 -1
- package/dist/chunks/{input-field.DExw_Cow.js → input-field.CmV2d_Zc.js} +30 -29
- package/dist/chunks/input-field.CmV2d_Zc.js.map +1 -0
- package/dist/chunks/{menu.CeLJ1gIz.js → menu.C-3obPGl.js} +182 -180
- package/dist/chunks/{menu.CeLJ1gIz.js.map → menu.C-3obPGl.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.CZnLS-fQ.js → modal-fullscreen.DBTnoSX9.js} +90 -77
- package/dist/chunks/modal-fullscreen.DBTnoSX9.js.map +1 -0
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.CP7dV1Yy.js → modal.vue_vue_type_script_setup_true_lang.Cd-mQUJ8.js} +10 -10
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.CP7dV1Yy.js.map → modal.vue_vue_type_script_setup_true_lang.Cd-mQUJ8.js.map} +1 -1
- package/dist/chunks/{pagination.DL9LmFMJ.js → pagination.DLYrWpKr.js} +2 -2
- package/dist/chunks/{pagination.DL9LmFMJ.js.map → pagination.DLYrWpKr.js.map} +1 -1
- package/dist/chunks/popover.DYgCCUCJ.js +200 -0
- package/dist/chunks/popover.DYgCCUCJ.js.map +1 -0
- package/dist/chunks/popover.types.V8old-GW.js +6 -0
- package/dist/chunks/popover.types.V8old-GW.js.map +1 -0
- package/dist/chunks/{rich-text-editor.Dl9PsYbk.js → rich-text-editor.Dx78coVL.js} +2 -2
- package/dist/chunks/{rich-text-editor.Dl9PsYbk.js.map → rich-text-editor.Dx78coVL.js.map} +1 -1
- package/dist/chunks/{search-bar.a-jzP1UA.js → search-bar.CpQ_MEVj.js} +3 -3
- package/dist/chunks/{search-bar.a-jzP1UA.js.map → search-bar.CpQ_MEVj.js.map} +1 -1
- package/dist/chunks/{secondary-nav.UrmIAVGD.js → secondary-nav.RTBLEukC.js} +2 -2
- package/dist/chunks/{secondary-nav.UrmIAVGD.js.map → secondary-nav.RTBLEukC.js.map} +1 -1
- package/dist/chunks/{sidepanel.BuNmgmpj.js → sidepanel.DPN__L3Q.js} +2 -2
- package/dist/chunks/{sidepanel.BuNmgmpj.js.map → sidepanel.DPN__L3Q.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.CoSCUI1V.js → summary-grid.types.CjbbSZBJ.js} +4 -4
- package/dist/chunks/summary-grid.types.CjbbSZBJ.js.map +1 -0
- package/dist/chunks/{textarea.DXSe9MHH.js → textarea.BBhN67-I.js} +41 -40
- package/dist/chunks/textarea.BBhN67-I.js.map +1 -0
- package/dist/chunks/{timeline-item.BRHwCA1F.js → timeline-item.CuCII37W.js} +3 -3
- package/dist/chunks/{timeline-item.BRHwCA1F.js.map → timeline-item.CuCII37W.js.map} +1 -1
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.CAf69UYO.js → tutorial.vue_vue_type_script_setup_true_lang.nYHtTHqy.js} +28 -27
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.CAf69UYO.js.map → tutorial.vue_vue_type_script_setup_true_lang.nYHtTHqy.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.D7dOPJSO.js → use-cached-selected-values.Dyoz6cUK.js} +579 -563
- package/dist/chunks/use-cached-selected-values.Dyoz6cUK.js.map +1 -0
- package/dist/chunks/{use-country-items.4kZgVg_l.js → use-country-items.Duh4bMqW.js} +2 -2
- package/dist/chunks/{use-country-items.4kZgVg_l.js.map → use-country-items.Duh4bMqW.js.map} +1 -1
- package/dist/chunks/{use-country-phon-code.DVgE19zT.js → use-country-phon-code.BOaJ9PDl.js} +507 -498
- package/dist/chunks/{use-country-phon-code.DVgE19zT.js.map → use-country-phon-code.BOaJ9PDl.js.map} +1 -1
- 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 +1 -1
- package/dist/date-range-picker.js +1 -1
- package/dist/dropdown.js +3 -3
- package/dist/filter-bar.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +156 -155
- 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/internal.js +15 -14
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +11 -11
- package/dist/pagination.js +1 -1
- package/dist/popover.js +3 -2
- package/dist/popover.js.map +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/sidepanel.js +1 -1
- package/dist/styles/bento-dark.css +10 -2
- package/dist/styles/bento-light.css +10 -2
- package/dist/styles/bento.css +10 -2
- package/dist/styles/legacy.css +10 -2
- package/dist/styles/styleguide.css +10 -2
- package/dist/summary-grid.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +24 -7
- package/dist/assets/info-icon-with-popover.css +0 -1
- package/dist/chunks/base-modal.DzJrvis_.js.map +0 -1
- package/dist/chunks/button-actions.BwpznQ6c.js.map +0 -1
- package/dist/chunks/checkbox.fkPJvdUo.js.map +0 -1
- package/dist/chunks/data-grid.rDZadZwc.js +0 -3781
- package/dist/chunks/data-grid.rDZadZwc.js.map +0 -1
- package/dist/chunks/dropdown-tag.BlHovDol.js +0 -202
- package/dist/chunks/dropdown-tag.BlHovDol.js.map +0 -1
- package/dist/chunks/dropdown.B5ZaFDn_.js +0 -957
- package/dist/chunks/dropdown.B5ZaFDn_.js.map +0 -1
- package/dist/chunks/filter-bar.XonJn7ao.js.map +0 -1
- package/dist/chunks/header-with-views.CHbH1_1V.js.map +0 -1
- package/dist/chunks/header.CJJWPB5Z.js +0 -254
- package/dist/chunks/header.CJJWPB5Z.js.map +0 -1
- package/dist/chunks/info-icon-with-popover.DVH46dPy.js +0 -97
- package/dist/chunks/info-icon-with-popover.DVH46dPy.js.map +0 -1
- package/dist/chunks/input-field.DExw_Cow.js.map +0 -1
- package/dist/chunks/modal-fullscreen.CZnLS-fQ.js.map +0 -1
- package/dist/chunks/popover.VI3TrUkL.js +0 -350
- package/dist/chunks/popover.VI3TrUkL.js.map +0 -1
- package/dist/chunks/summary-grid.types.CoSCUI1V.js.map +0 -1
- package/dist/chunks/textarea.DXSe9MHH.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.D7dOPJSO.js.map +0 -1
|
@@ -1,350 +0,0 @@
|
|
|
1
|
-
import { defineComponent as C, computed as p, resolveComponent as T, createBlock as m, openBlock as a, withCtx as b, createTextVNode as Y, toDisplayString as J, normalizeClass as P, createVNode as d, useSlots as K, useAttrs as x, inject as g, ref as H, toRefs as W, Transition as q, createCommentVNode as n, unref as o, createElementBlock as r, renderSlot as B, createElementVNode as z } from "vue";
|
|
2
|
-
import { P as O } from "./popper-container.b5h4zYgT.js";
|
|
3
|
-
import { c as M, b as G } from "./popper-container.types.BCZMbVFD.js";
|
|
4
|
-
import { B as Q, a as h } from "./typography.DN5eC5ch.js";
|
|
5
|
-
import { _ as E } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
6
|
-
import { B as X } from "./button.AB0SOQMn.js";
|
|
7
|
-
import { C as Z } from "./cross.B92GxFTY.js";
|
|
8
|
-
import { u as ee } from "./use-has-slot.B7eQSabc.js";
|
|
9
|
-
import { u as te } from "./aria-label.CaUURpnB.js";
|
|
10
|
-
import { c as $, B as oe } from "./button-actions.BwpznQ6c.js";
|
|
11
|
-
import "../assets/popover.css";
|
|
12
|
-
const ae = C({
|
|
13
|
-
components: { BentoTypography: Q },
|
|
14
|
-
props: {
|
|
15
|
-
/**
|
|
16
|
-
* Indicates if the popover contains an image.
|
|
17
|
-
*/
|
|
18
|
-
isImageTitle: { type: Boolean, default: !1 },
|
|
19
|
-
/**
|
|
20
|
-
* Indicates the title you want to give the popover.
|
|
21
|
-
*/
|
|
22
|
-
title: { type: String, default: null }
|
|
23
|
-
},
|
|
24
|
-
setup(e) {
|
|
25
|
-
const i = p(() => !e.isImageTitle), u = p(
|
|
26
|
-
() => e.isImageTitle ? h.SUBTITLE : h.BODY
|
|
27
|
-
);
|
|
28
|
-
return {
|
|
29
|
-
// Values
|
|
30
|
-
isStrongest: i,
|
|
31
|
-
titleVariant: u
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
function se(e, i, u, t, v, y) {
|
|
36
|
-
const s = T("bento-typography");
|
|
37
|
-
return a(), m(s, {
|
|
38
|
-
strongest: e.isStrongest,
|
|
39
|
-
variant: e.titleVariant,
|
|
40
|
-
el: "span"
|
|
41
|
-
}, {
|
|
42
|
-
default: b(() => [
|
|
43
|
-
Y(J(e.title), 1)
|
|
44
|
-
]),
|
|
45
|
-
_: 1
|
|
46
|
-
}, 8, ["strongest", "variant"]);
|
|
47
|
-
}
|
|
48
|
-
const ie = /* @__PURE__ */ E(ae, [["render", se]]), ne = C({
|
|
49
|
-
name: "bento-popover-dismiss-button",
|
|
50
|
-
components: { BentoButton: X, CrossIcon: Z },
|
|
51
|
-
props: {
|
|
52
|
-
onImage: {
|
|
53
|
-
type: Boolean,
|
|
54
|
-
default: !1
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
setup(e) {
|
|
58
|
-
return {
|
|
59
|
-
// Values
|
|
60
|
-
conditionalClass: p(() => ({ "b-popover-dismiss-button--on-image": e.onImage }))
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
function le(e, i, u, t, v, y) {
|
|
65
|
-
const s = T("cross-icon"), f = T("bento-button");
|
|
66
|
-
return a(), m(f, {
|
|
67
|
-
class: P(e.conditionalClass),
|
|
68
|
-
variant: "tertiary",
|
|
69
|
-
onClick: i[0] || (i[0] = (S) => e.$emit("click"))
|
|
70
|
-
}, {
|
|
71
|
-
iconLeft: b(() => [
|
|
72
|
-
d(s, { "svg-title": "dismiss" })
|
|
73
|
-
]),
|
|
74
|
-
_: 1
|
|
75
|
-
}, 8, ["class"]);
|
|
76
|
-
}
|
|
77
|
-
const L = /* @__PURE__ */ E(ne, [["render", le], ["__scopeId", "data-v-df01cfb8"]]), N = { ...M }, re = Symbol("popover offset injection key"), pe = Symbol("input field popover injection key"), ce = Symbol("input field popover injection key"), de = {
|
|
78
|
-
key: 0,
|
|
79
|
-
class: "b-popover__image"
|
|
80
|
-
}, ue = {
|
|
81
|
-
key: 0,
|
|
82
|
-
class: "b-popover__image-dismiss-button"
|
|
83
|
-
}, fe = {
|
|
84
|
-
key: 1,
|
|
85
|
-
class: "b-popover__header"
|
|
86
|
-
}, me = { class: "b-popover__header-title" }, be = { key: 0 }, ve = {
|
|
87
|
-
key: 3,
|
|
88
|
-
class: "b-popover__footer"
|
|
89
|
-
}, ye = {};
|
|
90
|
-
var A;
|
|
91
|
-
const _e = /* @__PURE__ */ C({
|
|
92
|
-
...ye,
|
|
93
|
-
__name: "popover",
|
|
94
|
-
props: {
|
|
95
|
-
/**
|
|
96
|
-
* List of actions that will be used to render the buttons.
|
|
97
|
-
* First element in the list will be rendered as "primary".
|
|
98
|
-
* All elements after the first will be rendered as "secondary".
|
|
99
|
-
*
|
|
100
|
-
* Each object in the list should have a `title`, an `event` and
|
|
101
|
-
* (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.
|
|
102
|
-
*
|
|
103
|
-
* `title`: Button's text.
|
|
104
|
-
*
|
|
105
|
-
* `event`: Event triggered when clicking the Button.
|
|
106
|
-
*
|
|
107
|
-
* `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.
|
|
108
|
-
*
|
|
109
|
-
* ```
|
|
110
|
-
* [{
|
|
111
|
-
* title: 'Primary',
|
|
112
|
-
* event: () => { ... },
|
|
113
|
-
* icon: FourPeopleIcon
|
|
114
|
-
* }, {
|
|
115
|
-
* title: 'Secondary',
|
|
116
|
-
* event: () => { ... }
|
|
117
|
-
* }]
|
|
118
|
-
* ```
|
|
119
|
-
*/
|
|
120
|
-
actions: {
|
|
121
|
-
type: Array,
|
|
122
|
-
default: null
|
|
123
|
-
},
|
|
124
|
-
/**
|
|
125
|
-
* Defines the layout in which the button actions is presented.
|
|
126
|
-
* It can be one of:
|
|
127
|
-
*
|
|
128
|
-
* @values BUTTONS_END
|
|
129
|
-
* @values FILL_CONTAINER
|
|
130
|
-
* @values SPACE_BETWEEN
|
|
131
|
-
* @values VERTICAL_STACK
|
|
132
|
-
*/
|
|
133
|
-
actionsLayout: {
|
|
134
|
-
type: String,
|
|
135
|
-
default: $.BUTTONS_END,
|
|
136
|
-
validator: (e) => Object.values($).includes(e)
|
|
137
|
-
},
|
|
138
|
-
/**
|
|
139
|
-
* @deprecated from version 2.0.0. Use the aria-label attribute instead.
|
|
140
|
-
*/
|
|
141
|
-
/**
|
|
142
|
-
* Defines a string value that provides an accessible name for the popover.
|
|
143
|
-
*/
|
|
144
|
-
ariaLabel: {
|
|
145
|
-
type: String,
|
|
146
|
-
default: null
|
|
147
|
-
},
|
|
148
|
-
/**
|
|
149
|
-
* Adds a divider line to the actions section, reduces the top/bottom paddings and removes all padding in the "default" slot.
|
|
150
|
-
*/
|
|
151
|
-
divider: {
|
|
152
|
-
type: Boolean,
|
|
153
|
-
default: !1
|
|
154
|
-
},
|
|
155
|
-
/**
|
|
156
|
-
* Supports disabling focus trap functionality to avoid scroll into view behavior when we don't need it.
|
|
157
|
-
* */
|
|
158
|
-
disableFocusTrap: {
|
|
159
|
-
type: Boolean,
|
|
160
|
-
default: !1
|
|
161
|
-
},
|
|
162
|
-
/**
|
|
163
|
-
* Adds a "dismiss" icon that triggers the "dismiss" event. Requires the `title` prop to be set.
|
|
164
|
-
*/
|
|
165
|
-
dismissible: {
|
|
166
|
-
type: Boolean,
|
|
167
|
-
default: !1
|
|
168
|
-
},
|
|
169
|
-
/**
|
|
170
|
-
* Allows to configure to fallback position to the one specified, it could be ['right', 'top', ...].
|
|
171
|
-
* Useful when not using auto as starting placement.
|
|
172
|
-
* https://floating-ui.com/docs/flip#fallbackplacements
|
|
173
|
-
*/
|
|
174
|
-
fallbackPosition: {
|
|
175
|
-
type: Array,
|
|
176
|
-
default: () => ["bottom-start", "right-start", "top-start", "left-start"]
|
|
177
|
-
},
|
|
178
|
-
/**
|
|
179
|
-
* Sets the size of the container to fit its content
|
|
180
|
-
*/
|
|
181
|
-
fitContent: { type: Boolean, default: !1 },
|
|
182
|
-
/**
|
|
183
|
-
* Instructs popover to be visible outside of the containing container.
|
|
184
|
-
* Useful when component would be used in limited containers like Modal, Side panel, etc.
|
|
185
|
-
* @see {@link https://floating-ui.com/docs/usefloating#strategy}
|
|
186
|
-
*/
|
|
187
|
-
fixedPositioning: {
|
|
188
|
-
type: Boolean,
|
|
189
|
-
default: !1
|
|
190
|
-
},
|
|
191
|
-
/**
|
|
192
|
-
* Toggles the popover open and closed
|
|
193
|
-
*/
|
|
194
|
-
open: {
|
|
195
|
-
type: Boolean,
|
|
196
|
-
default: !1
|
|
197
|
-
},
|
|
198
|
-
/**
|
|
199
|
-
* Displays the popover in a large size.
|
|
200
|
-
*/
|
|
201
|
-
large: {
|
|
202
|
-
type: Boolean,
|
|
203
|
-
default: !1
|
|
204
|
-
},
|
|
205
|
-
/**
|
|
206
|
-
* @deprecated
|
|
207
|
-
* NOTE: This property no longer functions since moving to the floating-ui framework.
|
|
208
|
-
*/
|
|
209
|
-
modifiers: { type: Array, default: null },
|
|
210
|
-
/**
|
|
211
|
-
* Popover's position relative to the target element.
|
|
212
|
-
* Possible values are:
|
|
213
|
-
* 'auto', 'auto-start', 'auto-end',
|
|
214
|
-
* 'top', 'top-start', 'top-end'
|
|
215
|
-
* 'right', 'right-start', 'right-end'
|
|
216
|
-
* 'bottom', 'bottom-start', 'bottom-end'
|
|
217
|
-
* 'left', 'left-start', 'left-end'
|
|
218
|
-
*/
|
|
219
|
-
position: {
|
|
220
|
-
type: String,
|
|
221
|
-
default: N.BOTTOM_START,
|
|
222
|
-
validator: (e) => Object.values(N).includes(e)
|
|
223
|
-
},
|
|
224
|
-
/**
|
|
225
|
-
* Displays the popover in a small size.
|
|
226
|
-
*/
|
|
227
|
-
small: {
|
|
228
|
-
type: Boolean,
|
|
229
|
-
default: !1
|
|
230
|
-
},
|
|
231
|
-
/**
|
|
232
|
-
* Indicates the title you want to give the popover.
|
|
233
|
-
*/
|
|
234
|
-
title: {
|
|
235
|
-
type: String,
|
|
236
|
-
default: null
|
|
237
|
-
},
|
|
238
|
-
/**
|
|
239
|
-
* Popover's target element.
|
|
240
|
-
* The popover will position itself relatively to target element, in specified position.
|
|
241
|
-
*/
|
|
242
|
-
targetElement: {
|
|
243
|
-
type: (A = O.props) == null ? void 0 : A.targetElement.type,
|
|
244
|
-
required: !0
|
|
245
|
-
},
|
|
246
|
-
/**
|
|
247
|
-
* Displays the popover without padding.
|
|
248
|
-
*/
|
|
249
|
-
withoutSpace: {
|
|
250
|
-
type: Boolean,
|
|
251
|
-
default: !1
|
|
252
|
-
},
|
|
253
|
-
/**
|
|
254
|
-
* Allows content to appear outside of the popover. Used when there are nested popovers.
|
|
255
|
-
*/
|
|
256
|
-
overflowVisible: {
|
|
257
|
-
type: Boolean,
|
|
258
|
-
default: !1
|
|
259
|
-
}
|
|
260
|
-
},
|
|
261
|
-
emits: ["dismiss", "placement"],
|
|
262
|
-
setup(e, { emit: i }) {
|
|
263
|
-
const t = e, v = i, y = K(), s = x(), f = p(() => {
|
|
264
|
-
var l;
|
|
265
|
-
return {
|
|
266
|
-
id: (l = s.id) == null ? void 0 : l.toString(),
|
|
267
|
-
role: (s == null ? void 0 : s.role) === null ? void 0 : G.POPOVER
|
|
268
|
-
};
|
|
269
|
-
}), S = g(re, 2), V = H(s["aria-label"]), { ariaLabel: F, title: _ } = W(t), w = te({
|
|
270
|
-
ariaLabel: V.value,
|
|
271
|
-
// TODO: take this line away when the aria-label props is removed
|
|
272
|
-
label: F,
|
|
273
|
-
defaultFallback: _
|
|
274
|
-
}), R = g(ce, !1) || g(pe, !1), D = p(() => ({
|
|
275
|
-
"b-popover--small": t.small && !t.large,
|
|
276
|
-
"b-popover--with-divider": !!t.divider,
|
|
277
|
-
"b-popover--large": t.large && !t.small,
|
|
278
|
-
"b-popover--fit-content": t.fitContent,
|
|
279
|
-
"b-popover--without-space": t.withoutSpace,
|
|
280
|
-
"b-popover--overflow-visible": t.overflowVisible || R
|
|
281
|
-
})), j = p(() => ({
|
|
282
|
-
"b-popover__content--with-title": !!t.title
|
|
283
|
-
})), k = () => v("dismiss"), c = ee(y);
|
|
284
|
-
return (l, I) => (a(), m(q, { name: "b-popover__animation" }, {
|
|
285
|
-
default: b(() => [
|
|
286
|
-
e.open ? (a(), m(o(O), {
|
|
287
|
-
key: 0,
|
|
288
|
-
id: f.value.id,
|
|
289
|
-
"aria-role": f.value.role,
|
|
290
|
-
"aria-label": o(w),
|
|
291
|
-
arrow: { classes: ["b-popover__arrow"] },
|
|
292
|
-
"disabled-focus-trap": e.disableFocusTrap,
|
|
293
|
-
class: P([D.value, "b-popover"]),
|
|
294
|
-
"fallback-position": e.fallbackPosition,
|
|
295
|
-
"fixed-positioning": e.fixedPositioning,
|
|
296
|
-
offset: [0, o(S)],
|
|
297
|
-
position: e.position,
|
|
298
|
-
"target-element": e.targetElement,
|
|
299
|
-
onPlacement: I[0] || (I[0] = (U) => l.$emit("placement", U))
|
|
300
|
-
}, {
|
|
301
|
-
default: b(() => [
|
|
302
|
-
o(c)("image") ? (a(), r("div", de, [
|
|
303
|
-
e.dismissible ? (a(), r("div", ue, [
|
|
304
|
-
d(L, {
|
|
305
|
-
"on-image": "",
|
|
306
|
-
onClick: k
|
|
307
|
-
})
|
|
308
|
-
])) : n("", !0),
|
|
309
|
-
B(l.$slots, "image", {}, void 0, !0)
|
|
310
|
-
])) : n("", !0),
|
|
311
|
-
o(_) ? (a(), r("div", fe, [
|
|
312
|
-
z("div", me, [
|
|
313
|
-
o(c)("headerIcon") ? B(l.$slots, "headerIcon", { key: 0 }, void 0, !0) : n("", !0),
|
|
314
|
-
d(ie, {
|
|
315
|
-
title: o(_),
|
|
316
|
-
"is-image-title": !!o(c)("image")
|
|
317
|
-
}, null, 8, ["title", "is-image-title"])
|
|
318
|
-
]),
|
|
319
|
-
e.dismissible && !o(c)("image") ? (a(), r("div", be, [
|
|
320
|
-
d(L, { onClick: k })
|
|
321
|
-
])) : n("", !0)
|
|
322
|
-
])) : n("", !0),
|
|
323
|
-
o(c)("default") ? (a(), r("div", {
|
|
324
|
-
key: 2,
|
|
325
|
-
class: P(["b-popover__content", j.value])
|
|
326
|
-
}, [
|
|
327
|
-
B(l.$slots, "default", {}, void 0, !0)
|
|
328
|
-
], 2)) : n("", !0),
|
|
329
|
-
e.actions ? (a(), r("div", ve, [
|
|
330
|
-
d(o(oe), {
|
|
331
|
-
actions: e.actions,
|
|
332
|
-
layout: e.actionsLayout
|
|
333
|
-
}, null, 8, ["actions", "layout"])
|
|
334
|
-
])) : n("", !0)
|
|
335
|
-
]),
|
|
336
|
-
_: 3
|
|
337
|
-
}, 8, ["id", "aria-role", "aria-label", "disabled-focus-trap", "class", "fallback-position", "fixed-positioning", "offset", "position", "target-element"])) : n("", !0)
|
|
338
|
-
]),
|
|
339
|
-
_: 3
|
|
340
|
-
}));
|
|
341
|
-
}
|
|
342
|
-
}), he = /* @__PURE__ */ E(_e, [["__scopeId", "data-v-288d33c3"]]);
|
|
343
|
-
export {
|
|
344
|
-
he as B,
|
|
345
|
-
pe as I,
|
|
346
|
-
re as P,
|
|
347
|
-
N as a,
|
|
348
|
-
ce as b
|
|
349
|
-
};
|
|
350
|
-
//# sourceMappingURL=popover.VI3TrUkL.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"popover.VI3TrUkL.js","sources":["../../../vue2/src/components/popover/components/popover-title/popover-title.vue","../../../vue2/src/components/popover/components/popover-dismiss-button/popover-dismiss-button.vue","../../../vue2/src/components/popover/popover.types.ts","../../../vue2/src/components/popover/popover.keys.ts","../../../vue2/src/components/filter-bar/components/input-filter/input-filter.keys.ts","../../../vue2/src/components/filter-bar/components/input-with-dropdown-filter/input-with-dropdown-filter.keys.ts","../../../vue2/src/components/popover/popover.vue"],"sourcesContent":["<template>\n <bento-typography :strongest=\"isStrongest\" :variant=\"titleVariant\" el=\"span\">\n {{ title }}\n </bento-typography>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent } from 'vue';\n import { BentoTypography, BentoTypographyVariant } from '@/components/typography';\n\n export default defineComponent({\n components: { BentoTypography },\n props: {\n /**\n * Indicates if the popover contains an image.\n */\n isImageTitle: { type: Boolean, default: false },\n\n /**\n * Indicates the title you want to give the popover.\n */\n title: { type: String, default: null },\n },\n setup(props) {\n // Use strongest only when it has no image\n const isStrongest = computed(() => !props.isImageTitle);\n\n // If an image is present, change the variant from BODY to SUBTITLE and remove the \"strongest\" property of the title\n const titleVariant = computed(() =>\n props.isImageTitle ? BentoTypographyVariant.SUBTITLE : BentoTypographyVariant.BODY\n );\n\n return {\n // Values\n isStrongest,\n titleVariant,\n };\n },\n });\n</script>\n","<template>\n <bento-button :class=\"conditionalClass\" variant=\"tertiary\" @click=\"$emit('click')\">\n <template #iconLeft>\n <cross-icon svg-title=\"dismiss\" />\n </template>\n </bento-button>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent } from 'vue';\n import { BentoButton } from '@/components/button';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n export default defineComponent({\n name: 'bento-popover-dismiss-button',\n components: { BentoButton, CrossIcon },\n props: {\n onImage: {\n type: Boolean,\n default: false,\n },\n },\n setup(props) {\n const conditionalClass = computed(() => ({ 'b-popover-dismiss-button--on-image': props.onImage }));\n\n return {\n // Values\n conditionalClass,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./popover-dismiss-button.scss\" />\n","import { PopperContainerPosition } from '../popper-container';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport const BentoPopoverPositions = { ...PopperContainerPosition };\nexport type BentoPopoverPositions = PopperContainerPosition;\n","export const POPOVER_OFFSET_INJECTION_KEY = Symbol('popover offset injection key');\n","/**\n * @deprecated from version 2.0.0. Use BentoFilterItemType.INPUT_DROPDOWN and INPUT_FILTER_WITH_DROPDOWN_POPOVER_INJECTION_KEY instead.\n */\nexport const INPUT_FILTER_POPOVER_INJECTION_KEY = Symbol('input field popover injection key');\n","export const INPUT_FILTER_WITH_DROPDOWN_POPOVER_INJECTION_KEY = Symbol('input field popover injection key');\n","<template>\n <Transition name=\"b-popover__animation\">\n <popper-container\n v-if=\"open\"\n :id=\"computedAttributes['id']\"\n :aria-role=\"computedAttributes.role\"\n :aria-label=\"computedAriaLabel\"\n :arrow=\"{ classes: ['b-popover__arrow'] }\"\n :disabled-focus-trap=\"disableFocusTrap\"\n :class=\"conditionalClasses\"\n :fallback-position=\"fallbackPosition\"\n :fixed-positioning=\"fixedPositioning\"\n :offset=\"[0, offset]\"\n :position=\"position\"\n :target-element=\"targetElement\"\n class=\"b-popover\"\n @placement=\"$emit('placement', $event)\"\n >\n <div v-if=\"hasSlot('image')\" class=\"b-popover__image\">\n <div v-if=\"dismissible\" class=\"b-popover__image-dismiss-button\">\n <bento-popover-dismiss-button on-image @click=\"dismissPopover\" />\n </div>\n <slot name=\"image\"></slot>\n </div>\n <div v-if=\"title\" class=\"b-popover__header\">\n <div class=\"b-popover__header-title\">\n <slot v-if=\"hasSlot('headerIcon')\" name=\"headerIcon\"></slot>\n <bento-popover-title :title=\"title\" :is-image-title=\"!!hasSlot('image')\" />\n </div>\n <div v-if=\"dismissible && !hasSlot('image')\">\n <bento-popover-dismiss-button @click=\"dismissPopover\" />\n </div>\n </div>\n\n <div v-if=\"hasSlot('default')\" class=\"b-popover__content\" :class=\"contentConditionalClasses\">\n <slot></slot>\n </div>\n\n <div v-if=\"actions\" class=\"b-popover__footer\">\n <bento-button-actions :actions=\"actions\" :layout=\"actionsLayout\"></bento-button-actions>\n </div>\n </popper-container>\n </Transition>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, PropType, ref, toRefs, useAttrs, useSlots } from 'vue';\n\n import { BentoButtonActions, BentoButtonActionsLayout, BentoButtonActionsList } from '@/components/button';\n import { PopperContainer, PopperContainerAriaRole } from '@/components/popper-container';\n import BentoPopoverTitle from './components/popover-title/popover-title.vue';\n import BentoPopoverDismissButton from './components/popover-dismiss-button/popover-dismiss-button.vue';\n\n import { BentoPopoverPositions } from './popover.types';\n import { Placement } from '@floating-ui/vue';\n\n import { useHasSlot } from '@/composables';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n\n import { POPOVER_OFFSET_INJECTION_KEY } from './popover.keys';\n import { INPUT_FILTER_POPOVER_INJECTION_KEY } from '@/components/filter-bar/components/input-filter/input-filter.keys';\n import { INPUT_FILTER_WITH_DROPDOWN_POPOVER_INJECTION_KEY } from '@/components/filter-bar/components/input-with-dropdown-filter/input-with-dropdown-filter.keys';\n\n const DEFAULT_OFFSET = 2;\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * Defines the layout in which the button actions is presented.\n * It can be one of:\n *\n * @values BUTTONS_END\n * @values FILL_CONTAINER\n * @values SPACE_BETWEEN\n * @values VERTICAL_STACK\n */\n actionsLayout: {\n type: String as PropType<BentoButtonActionsLayout | `${BentoButtonActionsLayout}`>,\n default: BentoButtonActionsLayout.BUTTONS_END,\n validator: (value: BentoButtonActionsLayout) => Object.values(BentoButtonActionsLayout).includes(value),\n },\n\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Defines a string value that provides an accessible name for the popover.\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Adds a divider line to the actions section, reduces the top/bottom paddings and removes all padding in the \"default\" slot.\n */\n divider: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Supports disabling focus trap functionality to avoid scroll into view behavior when we don't need it.\n * */\n disableFocusTrap: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Adds a \"dismiss\" icon that triggers the \"dismiss\" event. Requires the `title` prop to be set.\n */\n dismissible: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Allows to configure to fallback position to the one specified, it could be ['right', 'top', ...].\n * Useful when not using auto as starting placement.\n * https://floating-ui.com/docs/flip#fallbackplacements\n */\n fallbackPosition: {\n type: Array as PropType<Placement[]>,\n default: () => ['bottom-start', 'right-start', 'top-start', 'left-start'],\n },\n\n /**\n * Sets the size of the container to fit its content\n */\n fitContent: { type: Boolean, default: false },\n\n /**\n * Instructs popover to be visible outside of the containing container.\n * Useful when component would be used in limited containers like Modal, Side panel, etc.\n * @see {@link https://floating-ui.com/docs/usefloating#strategy}\n */\n fixedPositioning: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Toggles the popover open and closed\n */\n open: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Displays the popover in a large size.\n */\n large: {\n type: Boolean,\n default: false,\n },\n\n /**\n * @deprecated\n * NOTE: This property no longer functions since moving to the floating-ui framework.\n */\n modifiers: { type: Array, default: null },\n\n /**\n * Popover's position relative to the target element.\n * Possible values are:\n * 'auto', 'auto-start', 'auto-end',\n * 'top', 'top-start', 'top-end'\n * 'right', 'right-start', 'right-end'\n * 'bottom', 'bottom-start', 'bottom-end'\n * 'left', 'left-start', 'left-end'\n */\n position: {\n type: String as PropType<BentoPopoverPositions | `${BentoPopoverPositions}`>,\n default: BentoPopoverPositions.BOTTOM_START,\n validator: (value: BentoPopoverPositions) => Object.values(BentoPopoverPositions).includes(value),\n },\n\n /**\n * Displays the popover in a small size.\n */\n small: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Indicates the title you want to give the popover.\n */\n title: {\n type: String,\n default: null,\n },\n\n /**\n * Popover's target element.\n * The popover will position itself relatively to target element, in specified position.\n */\n targetElement: {\n type: PopperContainer.props?.targetElement.type,\n required: true,\n },\n /**\n * Displays the popover without padding.\n */\n withoutSpace: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Allows content to appear outside of the popover. Used when there are nested popovers.\n */\n overflowVisible: {\n type: Boolean,\n default: false,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Triggered when the `dismiss` button is clicked\n */\n (e: 'dismiss'): void;\n /**\n * Triggered when the popover `placement` changes\n */\n (e: 'placement', placement: Placement): void;\n }>();\n\n const slots = useSlots();\n const attrs = useAttrs();\n\n const computedAttributes = computed(() => ({\n id: attrs.id?.toString() as string,\n role: attrs?.['role'] === null ? undefined : PopperContainerAriaRole.POPOVER,\n }));\n\n const offset = inject<number>(POPOVER_OFFSET_INJECTION_KEY, DEFAULT_OFFSET);\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel, title } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: title,\n });\n\n const isOverflowVisible =\n inject(INPUT_FILTER_WITH_DROPDOWN_POPOVER_INJECTION_KEY, false) ||\n inject(INPUT_FILTER_POPOVER_INJECTION_KEY, false);\n\n const conditionalClasses = computed(() => ({\n 'b-popover--small': props.small && !props.large,\n 'b-popover--with-divider': !!props.divider,\n 'b-popover--large': props.large && !props.small,\n 'b-popover--fit-content': props.fitContent,\n 'b-popover--without-space': props.withoutSpace,\n 'b-popover--overflow-visible': props.overflowVisible || isOverflowVisible,\n }));\n\n const contentConditionalClasses = computed(() => ({\n 'b-popover__content--with-title': !!props.title,\n }));\n\n const dismissPopover = () => emit('dismiss');\n\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Example description of the component...\n *\n * @example\n * import { BentoPopover } from '@adyen/adl-vue2';\n *\n * export default {\n * components: { BentoPopover },\n * template: `\n * <bento-popover id=\"your-popover-id\">\n * ...Example code of the component\n * </bento-popover>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./popover.scss\" />\n"],"names":["_sfc_main$2","defineComponent","BentoTypography","props","isStrongest","computed","titleVariant","BentoTypographyVariant","_component_bento_typography","resolveComponent","openBlock","createBlock","_ctx","createTextVNode","toDisplayString","_sfc_main$1","BentoButton","CrossIcon","_component_bento_button","normalizeClass","_cache","$event","createVNode","_component_cross_icon","BentoPopoverPositions","PopperContainerPosition","POPOVER_OFFSET_INJECTION_KEY","INPUT_FILTER_POPOVER_INJECTION_KEY","INPUT_FILTER_WITH_DROPDOWN_POPOVER_INJECTION_KEY","__default__","__props","emit","__emit","slots","useSlots","attrs","useAttrs","computedAttributes","_a","PopperContainerAriaRole","offset","inject","ariaLabelAttribute","ref","ariaLabel","title","toRefs","computedAriaLabel","useAriaLabel","isOverflowVisible","conditionalClasses","contentConditionalClasses","dismissPopover","hasSlot","useHasSlot"],"mappings":";;;;;;;;;;;AAUI,MAAAA,KAAAC,EAAA;AAAA,EAA+B,YAAA,EAAA,iBAAAC,EAAA;AAAA,EACG,OAAA;AAAA;AAAA;AAAA;AAAA,IACvB,cAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAI2C,OAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA,EAKT;AAAA,EACzC,MAAAC,GAAA;AAGI,UAAAC,IAAAC,EAAA,MAAA,CAAAF,EAAA,YAAA,GAGAG,IAAAD;AAAA,MAAqB,MAAAF,EAAA,eAAAI,EAAA,WAAAA,EAAA;AAAA,IAC6D;AAGlF,WAAA;AAAA;AAAA,MAAO,aAAAH;AAAA,MAEH,cAAAE;AAAA,IACA;AAAA,EACJ;AAER,CAAA;;AAnCmB,QAAAE,IAAAC,EAA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AC,IAAAC,EAAA,GACAC,IAAAC,EAAA,GAEAC,IAAAhC,EAAA,MAAA;;AAAA;AAAA,QAA2C,KAAAiC,IAAAH,EAAA,OAAA,gBAAAG,EAAA;AAAA,QAChB,OAAAH,KAAA,gBAAAA,EAAA,UAAA,OAAA,SAAAI,EAAA;AAAA,MAC8C;AAAA,KAAA,GAGzEC,IAAAC,EAAAf,IAAA,CAAA,GAEAgB,IAAAC,EAAAR,EAAA,YAAA,CAAA,GACA,EAAA,WAAAS,GAAA,OAAAC,EAAA,IAAAC,EAAA3C,CAAA,GACA4C,IAAAC,GAAA;AAAA,MAAuC,WAAAN,EAAA;AAAA;AAAA,MACL,OAAAE;AAAA,MAEvB,iBAAAC;AAAA,IACU,CAAA,GAGrBI,IAAAR,EAAAb,IAAA,EAAA,KAAAa,EAAAd,IAAA,EAAA,GAIAuB,IAAA7C,EAAA,OAAA;AAAA,MAA2C,oBAAAF,EAAA,SAAA,CAAAA,EAAA;AAAA,MACG,2BAAA,CAAA,CAAAA,EAAA;AAAA,MACP,oBAAAA,EAAA,SAAA,CAAAA,EAAA;AAAA,MACO,0BAAAA,EAAA;AAAA,MACV,4BAAAA,EAAA;AAAA,MACE,+BAAAA,EAAA,mBAAA8C;AAAA,IACsB,EAAA,GAG5DE,IAAA9C,EAAA,OAAA;AAAA,MAAkD,kCAAA,CAAA,CAAAF,EAAA;AAAA,IACJ,EAAA,GAG9CiD,IAAA,MAAArB,EAAA,SAAA,GAEAsB,IAAAC,GAAArB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"summary-grid.types.CoSCUI1V.js","sources":["../../../vue2/src/components/summary-grid/summary-grid.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-numeric/summary-grid-item-numeric.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-percentage/summary-grid-item-percentage.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-text/summary-grid-item-text.vue","../../../vue2/src/components/summary-grid/components/summary-grid-item-custom/summary-grid-item-custom.vue","../../../vue2/src/components/summary-grid/summary-grid.types.ts"],"sourcesContent":["<template>\n <div class=\"b-summary-grid\">\n <grid-layout\n v-for=\"index in numberOfRows\"\n :key=\"`summary-grid-row-${index}`\"\n :data-testid=\"`summary-grid-row-${index}`\"\n :column-width=\"columnWidth?.[`row${index}`]\"\n >\n <template v-if=\"hasSlot(`cell-${index}-1`)\" #col-1>\n <slot :name=\"`cell-${index}-1`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-2`)\" #col-2>\n <slot :name=\"`cell-${index}-2`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-3`)\" #col-3>\n <slot :name=\"`cell-${index}-3`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-4`)\" #col-4>\n <slot :name=\"`cell-${index}-4`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-5`)\" #col-5>\n <slot :name=\"`cell-${index}-5`\" />\n </template>\n <template v-if=\"hasSlot(`cell-${index}-6`)\" #col-6>\n <slot :name=\"`cell-${index}-6`\" />\n </template>\n </grid-layout>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { onMounted, provide, toRef, useSlots } from 'vue';\n import type { BentoSummaryGridLayout, BentoSummaryGridProps } from './summary-grid.types';\n import { GridLayout } from '@/components/internal';\n import { useHasSlot } from '@/composables';\n import {\n SUMMARY_GRID_LAYOUT_INJECTION_KEY,\n SUMMARY_GRID_SLASHED_ZERO,\n } from '@/components/summary-grid/summary-grid.keys';\n\n const props = withDefaults(defineProps<BentoSummaryGridProps>(), {\n columnWidth: null,\n slashedZero: false,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n let numberOfRows = 1;\n if (slots) {\n const slotRows = Object.keys(slots)\n ?.filter(slotName => slotName.includes('cell-'))\n ?.map(slotName => parseInt(slotName.split('-')?.[1], 10));\n numberOfRows = Math.max(...slotRows);\n }\n\n onMounted(() => {\n if (numberOfRows > 3) {\n throw new Error(\n 'BentoSummaryGrid must only have a maximum of 3 rows. Read the documentation for more information.'\n );\n }\n });\n\n const registerComponentsInSummaryGrid: BentoSummaryGridLayout = () => {\n const isSummaryGridLayout = true;\n return { isSummaryGridLayout };\n };\n\n provide(SUMMARY_GRID_LAYOUT_INJECTION_KEY, registerComponentsInSummaryGrid);\n provide(SUMMARY_GRID_SLASHED_ZERO, toRef(props, 'slashedZero'));\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary grid component that displays a collection items.\n *\n * @example\n * import { BentoSummaryGrid, BentoSummaryGridItemAmount } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGrid, BentoSummaryGridItemAmount },\n * template: `\n * <bento-summary-grid>\n * <template #cell-2-2>\n * <bento-summary-grid-item-amount\n * title=\"Text Item\"\n * label=\"14\"\n * info-icon-tooltip-text=\"text for icon\"\n * copy=\"copy this to clipboard\"\n * />\n * </template>\n * </bento-summary-grid>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid.scss\" />\n","<template>\n <div class=\"b-summary-grid-item\" :class=\"conditionalClasses\" :style=\"computedStyles\">\n <div class=\"b-summary-grid-item__header\">\n <bento-typography class=\"b-summary-grid-item__title\" el=\"span\" variant=\"body\">\n <bento-dashed-underline\n v-if=\"withUnderline\"\n :tooltip-text=\"underlineTooltipText\"\n :popover-size=\"underlinePopoverSize\"\n >\n {{ title }}\n <template v-if=\"hasSlot('dashed-underline')\" #popover-content>\n <slot name=\"dashed-underline\"></slot>\n </template>\n </bento-dashed-underline>\n <template v-else>\n {{ title }}\n </template>\n </bento-typography>\n <div class=\"b-summary-grid-item__title-icons\">\n <copy v-if=\"copy\" class=\"b-structured-list__icon\" :text=\"copy\" @click=\"$emit('copy-click', $event)\" />\n\n <bento-info-icon\n v-if=\"infoIconTooltipText\"\n :tooltip-text=\"infoIconTooltipText\"\n tooltip-position=\"top\"\n class=\"b-summary-grid-item__title-tooltip\"\n @mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n />\n </div>\n </div>\n <bento-typography\n data-testid=\"summary-grid-item-content-typography\"\n class=\"b-summary-grid-item__title\"\n v-bind=\"typographyProps\"\n el=\"span\"\n >\n <slot />\n <bento-tag\n v-if=\"trend && itemType !== 'text'\"\n :variant=\"trendVariant\"\n :label=\"trend\"\n class=\"b-summary-grid-item__content-trend\"\n />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('secondary')\"\n class=\"b-summary-grid-item__title\"\n data-testid=\"summary-grid-item-secondary-metric-typography\"\n el=\"span\"\n variant=\"caption\"\n stronger\n >\n <slot name=\"secondary\" />\n <bento-tag\n v-if=\"secondaryTrend\"\n :variant=\"secondaryTrendVariant\"\n :label=\"secondaryTrend\"\n class=\"b-summary-grid-item__content-trend\"\n />\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, ref, toRefs, useSlots } from 'vue';\n\n // Components\n import { BentoDashedUnderline } from '@/components/dashed-underline';\n import { BentoInfoIcon } from '@/components/info-icon';\n import { BentoTypography, type BentoTypographyVariant } from '@/components/typography';\n import { BentoTag, type BentoTagVariant } from '@/components/tag';\n import { Copy } from '@/internal';\n\n // Utils\n import { useHasSlot } from '@/composables';\n\n // Types\n import { SUMMARY_GRID_SLASHED_ZERO } from '@/components/summary-grid/summary-grid.keys';\n import type { BentoSummaryGridItemTrendDirection } from '@/components/summary-grid/summary-grid.types';\n import type { BentoSummaryGridItemEvents, BentoSummaryGridItemProps } from './summary-grid-item.types';\n\n defineEmits<BentoSummaryGridItemEvents>();\n\n const props = withDefaults(defineProps<BentoSummaryGridItemProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n itemType: 'custom',\n secondaryTrend: null,\n secondaryTrendDirection: 'positive',\n size: 'small',\n trend: null,\n trendDirection: 'positive',\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const { trendDirection, secondaryTrendDirection, itemType, size } = toRefs(props);\n const hasSlashedZero = inject(SUMMARY_GRID_SLASHED_ZERO, ref(false));\n\n const tagVariantColor = (direction: `${BentoSummaryGridItemTrendDirection}`): `${BentoTagVariant}` => {\n switch (direction) {\n case 'positive':\n return 'green';\n case 'negative':\n return 'red';\n default:\n return 'blue';\n }\n };\n\n // TODO implement plus or minus symbol logic\n const trendVariant = computed(() => tagVariantColor(trendDirection.value));\n const secondaryTrendVariant = computed(() => tagVariantColor(secondaryTrendDirection.value));\n\n const typographyContentElement = computed<`${BentoTypographyVariant}`>(() => {\n if (size.value === 'small') {\n return 'body';\n }\n if (itemType.value !== 'text') {\n return 'title';\n }\n\n return null;\n });\n\n const typographyProps = computed(() => ({\n medium: size.value === 'large',\n strongest: size.value === 'small',\n wide: size.value === 'small',\n variant: typographyContentElement.value,\n }));\n\n const computedStyles = computed(() => (props.fitContent ? { width: 'fit-content' } : {}));\n\n const conditionalClasses = computed(() => ({ 'b-summary-grid-item--slashed-zero': hasSlashedZero.value }));\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const withUnderline = computed(() => props.underlineTooltipText || hasSlot('dashed-underline'));\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary bar item is a piece of information to be displayed in `bento-summary-bar` component\n *\n * @example\n * import { SummaryBarItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { SummaryBarItem },\n * template: `\n * <summary-grid-item :title=\"textVariable\">\n * Content of the item\n * </summary-grid-item>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid-item.scss\" />\n","<template>\n <summary-grid-item\n item-type=\"amount\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-amount\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n <div class=\"b-summary-grid-item-amount__content\">\n <div>{{ label }}</div>\n <div v-if=\"secondaryLabel\" class=\"b-summary-grid-item-amount__secondary-label\">{{ secondaryLabel }}</div>\n </div>\n <template v-if=\"secondaryMetric\" #secondary>\n {{ secondaryMetric }}\n </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { BentoSummaryGridItemEvents, SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemAmountProps } from './summary-grid-item-amount.types';\n\n defineEmits<BentoSummaryGridItemEvents>();\n\n withDefaults(defineProps<BentoSummaryGridItemAmountProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n secondaryLabel: null,\n secondaryMetric: null,\n secondaryTrend: null,\n secondaryTrendDirection: 'positive',\n size: 'small',\n trend: null,\n trendDirection: 'positive',\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display financial data, such as currency values and monetary amounts\n *\n * @example\n * import { BentoSummaryGridItemAmount } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemAmount },\n * template: `\n * <bento-summary-grid-item-amount\n * title=\"Your title\"\n * label=\"200.00 EUR\"\n * secondary-label=\"/ day\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./summary-grid-item-amount.scss\" />\n","<template>\n <summary-grid-item\n item-type=\"numeric\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-numeric\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ label }}\n <template v-if=\"secondaryMetric\" #secondary>\n {{ secondaryMetric }}\n </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { BentoSummaryGridItemEvents, SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemNumericProps } from './summary-grid-item-numeric.types';\n\n defineEmits<BentoSummaryGridItemEvents>();\n\n withDefaults(defineProps<BentoSummaryGridItemNumericProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n secondaryMetric: null,\n secondaryTrend: null,\n secondaryTrendDirection: 'positive',\n size: 'small',\n trend: null,\n trendDirection: 'positive',\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display any numeric information\n *\n * @example\n * import { BentoSummaryGridItemNumeric } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemNumeric },\n * template: `\n * <bento-summary-grid-item-numeric\n * title=\"Your title\"\n * label=\"123\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n","<template>\n <summary-grid-item\n item-type=\"percentage\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :size=\"size\"\n :trend=\"trend\"\n :trend-direction=\"trendDirection\"\n :secondary-trend=\"secondaryTrend\"\n :secondary-trend-direction=\"secondaryTrendDirection\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-percentage\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ computedLabelPercentage }}\n <template v-if=\"secondaryMetric\" #secondary> {{ computedSecondaryMetricPercentage }} </template>\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useSlots } from 'vue';\n import { BentoSummaryGridItemEvents, SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import type { BentoSummaryGridItemPercentageProps } from './summary-grid-item-percentage.types';\n import type { NumberFormatOptions } from 'vue-i18n';\n\n const { locale } = useI18n();\n\n defineEmits<BentoSummaryGridItemEvents>();\n\n const props = withDefaults(defineProps<BentoSummaryGridItemPercentageProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n secondaryMetric: null,\n secondaryTrend: null,\n secondaryTrendDirection: 'positive',\n size: 'small',\n trend: null,\n trendDirection: 'positive',\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const percentageArgs: NumberFormatOptions = {\n style: 'percent',\n maximumFractionDigits: 2,\n };\n\n const isNumeric = (value: string | number) => value != null && value !== '' && !isNaN(Number(value));\n const convertToPercentIfNumber = (value: string | number) => {\n if (value && isNumeric(value)) {\n return new Intl.NumberFormat(locale.value, percentageArgs).format(Number(value) / 100);\n }\n return value;\n };\n\n const computedLabelPercentage = computed(() => convertToPercentIfNumber(props.label));\n const computedSecondaryMetricPercentage = computed(() => convertToPercentIfNumber(props.secondaryMetric));\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display any percentage information\n *\n * @example\n * import { BentoSummaryGridItemPercentage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemPercentage },\n * template: `\n * <bento-summary-grid-item-percentage\n * title=\"Your title\"\n * label=\"123\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * trend=\"+12%\"\n * trend-direction=\"neutral\"\n * size=\"medium\"\n * />\n * `\n * }\n */\n export default {\n i18n: {},\n };\n</script>\n","<template>\n <summary-grid-item\n item-type=\"text\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :title=\"title\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n class=\"b-summary-grid-item-text\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n {{ label }}\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { BentoSummaryGridItemEvents, SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n\n import type { BentoSummaryGridItemTextProps } from './summary-grid-item-text.types';\n\n defineEmits<BentoSummaryGridItemEvents>();\n\n withDefaults(defineProps<BentoSummaryGridItemTextProps>(), {\n copy: undefined,\n fitContent: false,\n infoIconTooltipText: null,\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * Summary grid item component used to display text only. Can be used for references, IDs or any other text data.\n *\n * @example\n * import { BentoSummaryGridItemText } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSummaryGridItemText },\n * template: `\n * <bento-summary-grid-item-text\n * title=\"Your title\"\n * label=\"Your text here\"\n * info-icon-tooltip-text=\"Your tooltip text here will be toggled by the info icon\"\n * />\n * `\n * }\n */\n export default {};\n</script>\n","<template>\n <summary-grid-item\n :title=\"title\"\n :info-icon-tooltip-text=\"infoIconTooltipText\"\n :copy=\"copy\"\n :fit-content=\"fitContent\"\n :underline-popover-size=\"underlinePopoverSize\"\n :underline-tooltip-text=\"underlineTooltipText\"\n @copy-click=\"$emit('copy-click', $event)\"\n @info-icon-mouseenter=\"$emit('info-icon-mouseenter', $event)\"\n >\n <template v-if=\"hasSlot('dashed-underline')\" #dashed-underline>\n <slot name=\"dashed-underline\" />\n </template>\n <slot />\n </summary-grid-item>\n</template>\n\n<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n import { BentoSummaryGridItemEvents, SummaryGridItem } from '../summary-grid-item';\n import { useHasSlot } from '@/composables';\n import type { BentoSummaryGridItemCustomProps } from './summary-grid-item-custom.types';\n\n defineEmits<BentoSummaryGridItemEvents>();\n\n withDefaults(defineProps<BentoSummaryGridItemCustomProps>(), {\n copy: undefined,\n infoIconTooltipText: null,\n fitContent: false,\n underlinePopoverSize: 'fit-content',\n underlineTooltipText: null,\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n</script>\n\n<script lang=\"ts\">\n /**\n * A summary bar item is a piece of information to be displayed in `bento-summary-bar` component\n *\n * @example\n * import { SummaryBarItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { SummaryBarItem },\n * template: `\n * <summary-grid-item :title=\"textVariable\">\n * Content of the item\n * </summary-grid-item>\n * `\n * }\n */\n export default {};\n</script>\n","import { GridLayoutColumnWidths } from '@/components/internal/grid-layout/grid-layout.types';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoSummaryGridItemSize {\n SMALL = 'small',\n MEDIUM = 'medium',\n LARGE = 'large',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoSummaryGridItemTrendDirection {\n POSITIVE = 'positive',\n NEGATIVE = 'negative',\n NEUTRAL = 'neutral',\n}\n\nexport interface BentoSummaryGridColumnWidth {\n row1: GridLayoutColumnWidths;\n row2?: GridLayoutColumnWidths;\n row3?: GridLayoutColumnWidths;\n}\n\nexport type BentoSummaryGridLayout = () => {\n isSummaryGridLayout: boolean;\n};\n\nexport interface BentoSummaryGridProps {\n /**\n * Sets the responsive columns widths values for 1 of the 3 rows.\n */\n columnWidth?: BentoSummaryGridColumnWidth;\n\n /**\n * Renders a font numeric style with slashed zeros instead of normal ones.\n */\n slashedZero?: boolean;\n}\n"],"names":["__default__$6","props","__props","slots","useSlots","hasSlot","useHasSlot","numberOfRows","slotRows","_b","_a","slotName","onMounted","provide","SUMMARY_GRID_LAYOUT_INJECTION_KEY","SUMMARY_GRID_SLASHED_ZERO","toRef","__default__$5","trendDirection","secondaryTrendDirection","itemType","size","toRefs","hasSlashedZero","inject","ref","tagVariantColor","direction","trendVariant","computed","secondaryTrendVariant","typographyContentElement","typographyProps","computedStyles","conditionalClasses","withUnderline","__default__$4","__default__$3","__default__$2","locale","useI18n","percentageArgs","isNumeric","value","convertToPercentIfNumber","computedLabelPercentage","computedSecondaryMetricPercentage","__default__$1","__default__","BentoSummaryGridItemSize","BentoSummaryGridItemSize2","BentoSummaryGridItemTrendDirection","BentoSummaryGridItemTrendDirection2"],"mappings":";;;;;;;;;;;;wCAgGIA,KAAA,CAAA;;;;;;;;;AAxDA,UAAAC,IAAAC,GAKAC,IAAAC,EAAA,G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EAAA,KAAA,CAAA,GACA6C,IAAAjB,EAAA,MAAAe,EAAA3C,EAAA,eAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICVA8C,KAAA,CAAA;;;;;;;;;;;;;;AAtBA,UAAA5C,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;ICgBA6C,KAAA,CAAA;;;;;;;;;;;;;AApBA,UAAA7C,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AC9BQ,IAAA8C,KAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,SAAA,UACAA,EAAA,QAAA,SAHQA,IAAAD,MAAA,CAAA,CAAA,GASAE,KAAA,kBAAAC,OACRA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,UAAA,WAHQA,IAAAD,MAAA,CAAA,CAAA;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.DXSe9MHH.js","sources":["../../../vue2/src/components/textarea/textarea.types.ts","../../../vue2/src/components/textarea/textarea.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoTextareaResizeOption {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n BOTH = 'both',\n NONE = 'none',\n}\n\nexport enum BentoTextareaStateClass {\n CLEARABLE = 'clearable',\n DISABLED = 'disabled',\n ERROR = 'error',\n READONLY = 'readonly',\n}\n\nexport enum BentoTextareaEvent {\n BLUR = 'blur',\n CHANGE = 'change',\n CLEAR = 'clear',\n ESCAPE_PRESSED = 'escape-pressed',\n FOCUS = 'focus',\n INPUT = 'input',\n KEYDOWN = 'keydown',\n KEYUP = 'keyup',\n}\n","<template>\n <div ref=\"textareaComponent\" class=\"b-textarea\" :class=\"conditionalClasses\">\n <div :style=\"{ width: textareaWrapperWidth }\">\n <div class=\"b-textarea__label-box\" :class=\"conditionalClassesLabelBox\">\n <field-label\n v-if=\"label\"\n :for=\"textareaId\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n <bento-typography\n v-if=\"characterLimit\"\n el=\"span\"\n class=\"b-textarea__label-item\"\n :class=\"conditionalClassesLabelItem\"\n >\n {{ counter }}\n </bento-typography>\n </div>\n <bento-typography el=\"div\" class=\"b-textarea__input-box\" :aria-disabled=\"disabled\">\n <textarea\n :id=\"textareaId\"\n ref=\"textareaElement\"\n :value=\"textareaValue\"\n class=\"b-textarea__input\"\n :class=\"conditionalClassesInput\"\n :aria-label=\"computedAriaLabel\"\n :aria-invalid=\"invalidInput\"\n :readonly=\"isReadOnly\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :style=\"{ resize: resizable, height: textareaHeight }\"\n @blur=\"onBlur\"\n @change=\"onChange\"\n @focus=\"onFocus\"\n @input=\"onInput\"\n @keydown.esc=\"onPressEscape\"\n @keydown=\"onKeyDown\"\n @keyup=\"onKeyUp\"\n >\n </textarea>\n\n <div v-if=\"showClearButton\" class=\"b-textarea__clear-button\">\n <bento-button\n variant=\"tertiary\"\n :disabled=\"disabled\"\n @click=\"onClear\"\n @keypress.enter=\"onClear\"\n @keyup.space=\"onClear\"\n >\n <template #iconLeft>\n <cross-circle-fill-small-icon :svg-title=\"t('clearText')\" />\n </template>\n </bento-button>\n </div>\n </bento-typography>\n\n <error-message v-if=\"isOverCharacterLimit\" :error-message=\"counterErrorText\" />\n\n <error-message v-if=\"errorMessage\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"description\" class=\"b-textarea__description\" el=\"span\">\n {{ description }}\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, onMounted, onUnmounted, PropType, ref, toRef, toRefs, useAttrs, watch } from 'vue';\n\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n import CrossCircleFillSmallIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill-small';\n\n // Utils\n import { generateUid } from '@/core/utils/ts';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n\n // Composables\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n // Types\n import { BentoTextareaEvent, BentoTextareaResizeOption, BentoTextareaStateClass } from './textarea.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n\n const props = defineProps({\n /**\n * Text that labels an the input element\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Text that shows number of characters in textarea\n */\n characterLimit: { type: Number, default: undefined },\n\n /**\n * Text displayed as the help text of the textarea\n */\n description: { type: String, default: '' },\n\n /**\n * Disables the possibility of changing value in the textarea\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * If set to true, shows a button to clear all the text\n */\n clearable: { type: Boolean, default: false },\n\n /**\n * Adds error text\n */\n errorMessage: { type: String, default: '' },\n\n /**\n * Sets the height of the textarea, e.g 200px OR 20vh\n */\n height: { type: String, default: null },\n\n /**\n * Text displayed as the label of the textarea\n */\n label: { type: String, default: '' },\n\n /**\n * Highlights the textarea is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text displayed as the placeholder of the textarea\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Set the textarea to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the possibility of resize the textarea\n */\n resizable: {\n type: String as PropType<BentoTextareaResizeOption | `${BentoTextareaResizeOption}`>,\n default: BentoTextareaResizeOption.BOTH,\n validator: (value: BentoTextareaResizeOption) => Object.values(BentoTextareaResizeOption).includes(value),\n },\n\n /**\n * Highlights the textarea is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Adds a info icon next to the label to display the passed tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * Text displayed as the value of the textarea\n */\n value: { type: String, default: '' },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the element has lost focus\n */\n (e: BentoTextareaEvent.BLUR): void;\n\n /**\n * Emitted when the user modifies the element's value. Unlike the 'input' event, the change event is not necessarily fired for each alteration to an element's value\n */\n (e: BentoTextareaEvent.CHANGE): void;\n\n /**\n * Emitted when the \"Clear\" button was clicked\n */\n (e: BentoTextareaEvent.CLEAR): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: BentoTextareaEvent.ESCAPE_PRESSED): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: BentoTextareaEvent.FOCUS): void;\n\n /**\n * Emitted when the component's model changes\n */\n (e: BentoTextareaEvent.INPUT, value: string): void;\n\n /**\n * Emitted when the text area keydown event is fired\n */\n (e: BentoTextareaEvent.KEYDOWN, event: KeyboardEvent): void;\n\n /**\n * Emitted when the text area keyup event is fired\n */\n (e: BentoTextareaEvent.KEYUP, event: KeyboardEvent): void;\n }>();\n\n const { height } = toRefs(props);\n\n const textareaId = generateUid('textarea');\n const textareaElement = ref<HTMLTextAreaElement>(null);\n const textareaComponent = ref<HTMLDivElement>(null);\n const textareaValue = ref(props.value);\n const defaultTextareaHeight = 44;\n const textareaHeight = ref(props.height || `${defaultTextareaHeight}px`);\n const textareaWrapperWidth = ref('100%'); // The width set to the wrapper of the label, textarea and description\n let textareaElementObserver: ResizeObserver | null = null;\n let textareaComponentObserver: ResizeObserver | null = null;\n\n const { t, n } = useI18n<{ message: MessageSchema }>({ messages });\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const counter = computed(() => `${n(textareaValue?.value?.length ?? 0)} / ${n(props.characterLimit)}`);\n const isOverCharacterLimit = computed(\n () => props.characterLimit && textareaValue.value.length > props.characterLimit\n );\n\n const calculateHeight = () => {\n const borderWidth = 3;\n if (textareaElement.value && textareaElement.value.scrollHeight > defaultTextareaHeight) {\n textareaHeight.value = `${textareaElement.value.scrollHeight + borderWidth}px`;\n }\n };\n\n watch(height, () => {\n if (!height.value) {\n calculateHeight();\n } else {\n textareaHeight.value = height.value;\n }\n });\n\n watch(\n () => props.value,\n () => {\n textareaValue.value = props.value;\n },\n { immediate: true }\n );\n\n watch(\n () => textareaValue.value,\n async () => {\n // Auto-adjust height if the text area is overflowing\n if (\n !height.value &&\n (!textareaElement.value || textareaElement.value?.scrollHeight > textareaElement.value?.clientHeight)\n ) {\n // Hack to make the textarea calculate its height properly\n // Set the textarea back to the original value before calculating the height\n textareaHeight.value = `${defaultTextareaHeight}px`;\n if (!textareaValue.value) {\n return;\n }\n\n await nextTick();\n calculateHeight();\n }\n },\n { immediate: true }\n );\n\n const invalidInput = computed(() => !!props.errorMessage || isOverCharacterLimit.value);\n\n const conditionalClasses = computed(() => ({\n [`b-textarea--${BentoTextareaStateClass.DISABLED}`]: props.disabled,\n }));\n\n const conditionalClassesInput = computed(() => ({\n [`b-textarea__input--${BentoTextareaStateClass.CLEARABLE}`]: props.clearable,\n [`b-textarea__input--${BentoTextareaStateClass.READONLY}`]: isReadOnly.value,\n [`b-textarea__input--${BentoTextareaStateClass.ERROR}`]: invalidInput.value,\n [`b-textarea__input--dynamic-height`]: !height.value,\n }));\n\n const conditionalClassesLabelBox = computed(() => ({\n [`b-textarea__label-box--no-label`]: !props.label,\n }));\n\n const conditionalClassesLabelItem = computed(() => ({\n [`b-textarea__label-item--${BentoTextareaStateClass.ERROR}`]: isOverCharacterLimit.value,\n }));\n\n const counterErrorText = computed(() => t('yourTextCanBenAtMost', { characterLimit: props.characterLimit }));\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel, label } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: label,\n });\n\n const showClearButton = computed(\n () => props.clearable && textareaValue.value && !props.disabled && !isReadOnly.value\n );\n\n const onClear = () => {\n textareaValue.value = '';\n emit(BentoTextareaEvent.CLEAR);\n emit(BentoTextareaEvent.INPUT, '');\n };\n\n const onInput = (event: InputEvent) => {\n event.stopImmediatePropagation();\n\n if (!props.disabled && !isReadOnly.value) {\n textareaValue.value = (event.target as HTMLInputElement).value;\n /**\n * Triggered when input value is changed\n *\n * @event input\n * @property {String} inputValue - the updated textarea value\n */\n emit(BentoTextareaEvent.INPUT, textareaValue.value);\n }\n };\n\n const onBlur = () => {\n textareaElement.value.scrollTop = 0;\n emit(BentoTextareaEvent.BLUR);\n };\n\n const onFocus = () => {\n textareaElement.value.focus();\n emit(BentoTextareaEvent.FOCUS);\n };\n\n const onChange = () => {\n emit(BentoTextareaEvent.CHANGE);\n };\n\n const onPressEscape = () => {\n emit(BentoTextareaEvent.ESCAPE_PRESSED);\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n event.stopPropagation();\n emit(BentoTextareaEvent.KEYDOWN, event);\n };\n\n const onKeyUp = (event: KeyboardEvent) => {\n event.stopPropagation();\n emit(BentoTextareaEvent.KEYUP, event);\n };\n\n /**\n * Updates the textarea width depending if the container or the user update its size.\n * @param isTextareaElement - sets to true if the element being observed is the textarea HTML element.\n */\n const resizeTextareaWrapper = (isTextareaElement = false) => {\n // Width assigned by the browser whenever the textarea is manually resized. String of the format `<value>px`.\n const textareaStyleWidth = textareaElement.value.style.width;\n\n // Make sure the tracked textareaHeight is always in sync with the height size in case we manually resize the textarea\n if (textareaElement.value.style.height) {\n textareaHeight.value = textareaElement.value.style.height;\n }\n\n // If the textarea element observer is being triggered, but there's no textareaStyleWidth, we want to ignore it, as no manual resize as happened yet\n // The component wrapper will handle the resizing logic instead\n if (isTextareaElement && !textareaStyleWidth) {\n return;\n }\n\n // Width of the whole bento-textarea component\n const textareaComponentWidth = textareaComponent?.value?.offsetWidth;\n\n // If there is no textareaStyleWidth or the textareaStyleWidth is larger than the component container, the wrapper should be 100% of the container\n if (!textareaStyleWidth || parseInt(textareaStyleWidth, 10) > textareaComponentWidth) {\n textareaWrapperWidth.value = '100%';\n } else {\n // Else the wrapper should always be as wide as the textarea element itself\n textareaWrapperWidth.value = textareaStyleWidth;\n }\n };\n\n const focus = () => {\n textareaElement.value.focus();\n };\n\n defineExpose({\n focus,\n });\n\n onMounted(() => {\n textareaElementObserver = observeSizeOfElement(textareaElement.value, () => {\n resizeTextareaWrapper(true);\n });\n\n textareaComponentObserver = observeSizeOfElement(textareaComponent.value, () => {\n resizeTextareaWrapper();\n });\n\n if (!height.value) {\n calculateHeight();\n }\n });\n\n onUnmounted(() => {\n textareaElementObserver?.disconnect();\n textareaComponentObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n name: 'bento-textarea',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./textarea.scss\" />\n"],"names":["BentoTextareaResizeOption","BentoTextareaResizeOption2","BentoTextareaStateClass","BentoTextareaStateClass2","BentoTextareaEvent","BentoTextareaEvent2","__default__","messages","attrs","useAttrs","props","__props","emit","__emit","height","toRefs","textareaId","generateUid","textareaElement","ref","textareaComponent","textareaValue","defaultTextareaHeight","textareaHeight","textareaWrapperWidth","textareaElementObserver","textareaComponentObserver","t","n","useI18n","isReadOnly","useFormLayoutFieldLoading","toRef","counter","computed","_a","isOverCharacterLimit","calculateHeight","watch","_b","nextTick","invalidInput","conditionalClasses","conditionalClassesInput","conditionalClassesLabelBox","conditionalClassesLabelItem","counterErrorText","ariaLabelAttribute","ariaLabel","label","computedAriaLabel","useAriaLabel","showClearButton","onClear","onInput","event","onBlur","onFocus","onChange","onPressEscape","onKeyDown","onKeyUp","resizeTextareaWrapper","isTextareaElement","textareaStyleWidth","textareaComponentWidth","__expose","onMounted","observeSizeOfElement","onUnmounted"],"mappings":";;;;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YACAA,EAAA,OAAA,QACAA,EAAA,OAAA,QAJQA,IAAAD,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