@adyen/bento-vue2 1.65.0 → 1.67.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 +473 -253
- 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-with-menu.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/copy.css +1 -1
- package/dist/assets/data-grid-template.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/date.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown-default-textbox.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/footer-actions.css +1 -1
- package/dist/assets/header-with-views.css +1 -1
- package/dist/assets/header.css +1 -1
- package/dist/assets/info-icon.css +1 -1
- package/dist/assets/input-field-password.css +1 -1
- package/dist/assets/input-field.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/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/sidepanel.css +1 -1
- package/dist/assets/step.css +1 -1
- package/dist/assets/summary-grid.css +1 -1
- package/dist/assets/tab.css +1 -0
- 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.DHdrZtmW.js → action-bar.BxX3I27_.js} +31 -31
- package/dist/chunks/action-bar.BxX3I27_.js.map +1 -0
- package/dist/chunks/{base-modal.3OptY7u_.js → base-modal.QGDM_kjG.js} +2 -2
- package/dist/chunks/{base-modal.3OptY7u_.js.map → base-modal.QGDM_kjG.js.map} +1 -1
- package/dist/chunks/button-actions-with-menu.itkbcqzk.js +83 -0
- package/dist/chunks/button-actions-with-menu.itkbcqzk.js.map +1 -0
- package/dist/chunks/{button-actions._OIvTdKt.js → button-actions.BKdI_ooV.js} +2 -2
- package/dist/chunks/button-actions.BKdI_ooV.js.map +1 -0
- package/dist/chunks/calendar.DvIQEYwN.js +2086 -0
- package/dist/chunks/calendar.DvIQEYwN.js.map +1 -0
- package/dist/chunks/{card.CypgT0Ji.js → card.BktfAMv5.js} +2 -2
- package/dist/chunks/{card.CypgT0Ji.js.map → card.BktfAMv5.js.map} +1 -1
- package/dist/chunks/{checkbox-group.DVX0GFm9.js → checkbox-group.BVMGnokj.js} +4 -4
- package/dist/chunks/{checkbox-group.DVX0GFm9.js.map → checkbox-group.BVMGnokj.js.map} +1 -1
- package/dist/chunks/{checkbox.nHrvoKfp.js → checkbox.Bg5FM5Oa.js} +2 -2
- package/dist/chunks/{checkbox.nHrvoKfp.js.map → checkbox.Bg5FM5Oa.js.map} +1 -1
- package/dist/chunks/{code-snippet.W8Zp0zQP.js → code-snippet.DDiQ9R3o.js} +4 -4
- package/dist/chunks/{code-snippet.W8Zp0zQP.js.map → code-snippet.DDiQ9R3o.js.map} +1 -1
- package/dist/chunks/{controls-group.BWAmz7Tg.js → controls-group.CccuLkgP.js} +2 -2
- package/dist/chunks/{controls-group.BWAmz7Tg.js.map → controls-group.CccuLkgP.js.map} +1 -1
- package/dist/chunks/copy.CF8Fzu2Y.js +96 -0
- package/dist/chunks/copy.CF8Fzu2Y.js.map +1 -0
- package/dist/chunks/{dashboard-section.Bz54Z6Hh.js → dashboard-section.Beep1lY8.js} +3 -3
- package/dist/chunks/{dashboard-section.Bz54Z6Hh.js.map → dashboard-section.Beep1lY8.js.map} +1 -1
- package/dist/chunks/{dashed-underline.CEaAmjDa.js → dashed-underline.BQwLgzz6.js} +2 -2
- package/dist/chunks/{dashed-underline.CEaAmjDa.js.map → dashed-underline.BQwLgzz6.js.map} +1 -1
- package/dist/chunks/{data-grid-template.DtFRjaR8.js → data-grid-template.nkx0pCMA.js} +16 -14
- package/dist/chunks/data-grid-template.nkx0pCMA.js.map +1 -0
- package/dist/chunks/{data-grid.D4oeTUhn.js → data-grid.CkwZVy3a.js} +190 -188
- package/dist/chunks/data-grid.CkwZVy3a.js.map +1 -0
- package/dist/chunks/{date-picker.k0g6anfy.js → date-picker.BLBXaDHv.js} +8 -9
- package/dist/chunks/{date-picker.k0g6anfy.js.map → date-picker.BLBXaDHv.js.map} +1 -1
- package/dist/chunks/{date-range-picker.D9lyIoO-.js → date-range-picker.am63DgMj.js} +409 -393
- package/dist/chunks/date-range-picker.am63DgMj.js.map +1 -0
- package/dist/chunks/date.BfyWX2PY.js +160 -0
- package/dist/chunks/date.BfyWX2PY.js.map +1 -0
- package/dist/chunks/{dropdown-default-textbox.BNuuA4ES.js → dropdown-default-textbox.94q6opSD.js} +3 -3
- package/dist/chunks/dropdown-default-textbox.94q6opSD.js.map +1 -0
- package/dist/chunks/{dropdown-tag.DKhxBV52.js → dropdown-tag.DYIkCBa6.js} +2 -2
- package/dist/chunks/{dropdown-tag.DKhxBV52.js.map → dropdown-tag.DYIkCBa6.js.map} +1 -1
- package/dist/chunks/{dropdown.DV7uhHNP.js → dropdown.HA6ISg2h.js} +265 -270
- package/dist/chunks/{dropdown.DV7uhHNP.js.map → dropdown.HA6ISg2h.js.map} +1 -1
- package/dist/chunks/{error-message.1Em7Lis3.js → error-message.BgxnwPLF.js} +2 -2
- package/dist/chunks/{error-message.1Em7Lis3.js.map → error-message.BgxnwPLF.js.map} +1 -1
- package/dist/chunks/es6.n1ewaW31.js.map +1 -1
- package/dist/chunks/{file-uploader.DyjdNLOa.js → file-uploader.BPslxGI8.js} +323 -323
- package/dist/chunks/file-uploader.BPslxGI8.js.map +1 -0
- package/dist/chunks/{filter-bar.BxDEplt3.js → filter-bar.DbqsoAI1.js} +667 -652
- package/dist/chunks/{filter-bar.BxDEplt3.js.map → filter-bar.DbqsoAI1.js.map} +1 -1
- package/dist/chunks/{footer-actions.DyuSTjC5.js → footer-actions.BUfQFz7J.js} +2 -2
- package/dist/chunks/{footer-actions.DyuSTjC5.js.map → footer-actions.BUfQFz7J.js.map} +1 -1
- package/dist/chunks/{get-date-locale.BN8xEjY0.js → get-date-locale.CAyOIbcp.js} +288 -649
- package/dist/chunks/get-date-locale.CAyOIbcp.js.map +1 -0
- package/dist/chunks/{header-with-views.Ds9mcwmp.js → header-with-views.JllLR2nW.js} +341 -327
- package/dist/chunks/header-with-views.JllLR2nW.js.map +1 -0
- package/dist/chunks/{header.Cb644uAi.js → header.04Y0unpy.js} +27 -26
- package/dist/chunks/{header.Cb644uAi.js.map → header.04Y0unpy.js.map} +1 -1
- package/dist/chunks/index.BrH1t1iu.js +407 -0
- package/dist/chunks/index.BrH1t1iu.js.map +1 -0
- package/dist/chunks/{info-icon-with-popover.COq40yTq.js → info-icon-with-popover.B1DnkW4B.js} +2 -2
- package/dist/chunks/{info-icon-with-popover.COq40yTq.js.map → info-icon-with-popover.B1DnkW4B.js.map} +1 -1
- package/dist/chunks/info-icon.CYOXx8CL.js +37 -0
- package/dist/chunks/info-icon.CYOXx8CL.js.map +1 -0
- package/dist/chunks/{input-field-password.Bloa-rqx.js → input-field-password.BtOdV0gF.js} +124 -123
- package/dist/chunks/input-field-password.BtOdV0gF.js.map +1 -0
- package/dist/chunks/{input-field-phone-number.B3qzZKuP.js → input-field-phone-number.Dq-LnGag.js} +3 -3
- package/dist/chunks/{input-field-phone-number.B3qzZKuP.js.map → input-field-phone-number.Dq-LnGag.js.map} +1 -1
- package/dist/chunks/input-field.Bg77qHT2.js +157 -0
- package/dist/chunks/input-field.Bg77qHT2.js.map +1 -0
- package/dist/chunks/{menu.BCD4FW54.js → menu.EgYjFAku.js} +2 -2
- package/dist/chunks/{menu.BCD4FW54.js.map → menu.EgYjFAku.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.1OdCgyca.js → modal-fullscreen.BNTUOC7o.js} +2 -2
- package/dist/chunks/{modal-fullscreen.1OdCgyca.js.map → modal-fullscreen.BNTUOC7o.js.map} +1 -1
- package/dist/chunks/{modal.xY5aFhAO.js → modal.OvB4kEGR.js} +4 -4
- package/dist/chunks/{modal.xY5aFhAO.js.map → modal.OvB4kEGR.js.map} +1 -1
- package/dist/chunks/{pagination.Cl7SzoId.js → pagination.Dw153NzQ.js} +115 -115
- package/dist/chunks/pagination.Dw153NzQ.js.map +1 -0
- package/dist/chunks/{popover.B05xkQ4e.js → popover.BGHbPUOr.js} +2 -2
- package/dist/chunks/{popover.B05xkQ4e.js.map → popover.BGHbPUOr.js.map} +1 -1
- package/dist/chunks/promo-banner.Bbc2U3S3.js.map +1 -1
- package/dist/chunks/{radio-group.CtPG_iiI.js → radio-group.4_KKjvAm.js} +3 -3
- package/dist/chunks/{radio-group.CtPG_iiI.js.map → radio-group.4_KKjvAm.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.CLxVaskq.js → rich-text-editor.CRJRvfJn.js} +5 -7
- package/dist/chunks/{rich-text-editor.CLxVaskq.js.map → rich-text-editor.CRJRvfJn.js.map} +1 -1
- package/dist/chunks/{search-bar.CadVBoj0.js → search-bar.BTZSePJh.js} +3 -3
- package/dist/chunks/{search-bar.CadVBoj0.js.map → search-bar.BTZSePJh.js.map} +1 -1
- package/dist/chunks/{secondary-nav.OwimHNCb.js → secondary-nav.BBhSBNn7.js} +2 -2
- package/dist/chunks/{secondary-nav.OwimHNCb.js.map → secondary-nav.BBhSBNn7.js.map} +1 -1
- package/dist/chunks/{selection-card-group.CoqBRUT8.js → selection-card-group.0o5T4tab.js} +3 -3
- package/dist/chunks/{selection-card-group.CoqBRUT8.js.map → selection-card-group.0o5T4tab.js.map} +1 -1
- package/dist/chunks/{sidepanel.CI8fu1Q3.js → sidepanel.Dt-BnFzN.js} +2 -2
- package/dist/chunks/{sidepanel.CI8fu1Q3.js.map → sidepanel.Dt-BnFzN.js.map} +1 -1
- package/dist/chunks/step.DMMofD4B.js +217 -0
- package/dist/chunks/step.DMMofD4B.js.map +1 -0
- package/dist/chunks/{structured-list-item.tox2Kcb6.js → structured-list-item.Bnn6-Z3q.js} +3 -3
- package/dist/chunks/{structured-list-item.tox2Kcb6.js.map → structured-list-item.Bnn6-Z3q.js.map} +1 -1
- package/dist/chunks/summary-grid.types.DsvtLg3D.js +337 -0
- package/dist/chunks/summary-grid.types.DsvtLg3D.js.map +1 -0
- package/dist/chunks/tab.BhWPBxcB.js +192 -0
- package/dist/chunks/tab.BhWPBxcB.js.map +1 -0
- package/dist/chunks/{tabs.keys.Bc2pSKRw.js → tabs.keys.Cb4Vw5Jh.js} +3 -3
- package/dist/chunks/{tabs.keys.Bc2pSKRw.js.map → tabs.keys.Cb4Vw5Jh.js.map} +1 -1
- package/dist/chunks/{textarea.BPeDUAPL.js → textarea.RAU710Uw.js} +83 -80
- package/dist/chunks/textarea.RAU710Uw.js.map +1 -0
- package/dist/chunks/{timeline-item.CS9ZDOsm.js → timeline-item.Dz66luo5.js} +11 -12
- package/dist/chunks/timeline-item.Dz66luo5.js.map +1 -0
- package/dist/chunks/{tutorial.DJ_Cwp9i.js → tutorial.DAKO-fKz.js} +4 -4
- package/dist/chunks/{tutorial.DJ_Cwp9i.js.map → tutorial.DAKO-fKz.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.DNOmzQVy.js → use-cached-selected-values.DQPABFfG.js} +538 -498
- package/dist/chunks/use-cached-selected-values.DQPABFfG.js.map +1 -0
- 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/date.js +1 -1
- package/dist/dropdown.js +4 -4
- package/dist/file-uploader.js +1 -1
- 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 +45 -45
- 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/internal.js +8 -8
- 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/radio-group.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/stepper.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/styles/bento-dark.css +1 -0
- package/dist/styles/bento-light.css +1 -0
- package/dist/styles/bento.css +1 -0
- package/dist/styles/legacy.css +1 -0
- package/dist/styles/styleguide.css +1 -0
- package/dist/summary-grid.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +261 -81
- package/package.json +6 -6
- package/dist/assets/tabs.css +0 -1
- package/dist/chunks/action-bar.DHdrZtmW.js.map +0 -1
- package/dist/chunks/button-actions-with-menu.CYkEoiee.js +0 -166
- package/dist/chunks/button-actions-with-menu.CYkEoiee.js.map +0 -1
- package/dist/chunks/button-actions._OIvTdKt.js.map +0 -1
- package/dist/chunks/calendar.DbTC35rM.js +0 -1167
- package/dist/chunks/calendar.DbTC35rM.js.map +0 -1
- package/dist/chunks/copy.CXeLbvUP.js +0 -129
- package/dist/chunks/copy.CXeLbvUP.js.map +0 -1
- package/dist/chunks/data-grid-template.DtFRjaR8.js.map +0 -1
- package/dist/chunks/data-grid.D4oeTUhn.js.map +0 -1
- package/dist/chunks/date-range-picker.D9lyIoO-.js.map +0 -1
- package/dist/chunks/date.dYFFEunA.js +0 -987
- package/dist/chunks/date.dYFFEunA.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.BNuuA4ES.js.map +0 -1
- package/dist/chunks/file-uploader.DyjdNLOa.js.map +0 -1
- package/dist/chunks/get-date-locale.BN8xEjY0.js.map +0 -1
- package/dist/chunks/header-with-views.Ds9mcwmp.js.map +0 -1
- package/dist/chunks/index.BDuTpjD8.js +0 -40
- package/dist/chunks/index.BDuTpjD8.js.map +0 -1
- package/dist/chunks/index.DD7TppDb.js +0 -10
- package/dist/chunks/index.DD7TppDb.js.map +0 -1
- package/dist/chunks/info-icon.B9aTl1nU.js +0 -41
- package/dist/chunks/info-icon.B9aTl1nU.js.map +0 -1
- package/dist/chunks/input-field-password.Bloa-rqx.js.map +0 -1
- package/dist/chunks/input-field.B_3nZFYz.js +0 -152
- package/dist/chunks/input-field.B_3nZFYz.js.map +0 -1
- package/dist/chunks/pagination.Cl7SzoId.js.map +0 -1
- package/dist/chunks/step.dNTg2rtW.js +0 -217
- package/dist/chunks/step.dNTg2rtW.js.map +0 -1
- package/dist/chunks/summary-grid.types.CkUIw703.js +0 -301
- package/dist/chunks/summary-grid.types.CkUIw703.js.map +0 -1
- package/dist/chunks/tabs.Dx6teJGW.js +0 -205
- package/dist/chunks/tabs.Dx6teJGW.js.map +0 -1
- package/dist/chunks/textarea.BPeDUAPL.js.map +0 -1
- package/dist/chunks/timeline-item.CS9ZDOsm.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.DNOmzQVy.js.map +0 -1
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { defineComponent as d, useSlots as p, onMounted as I, provide as h, toRef as k, toRefs as z, inject as P, ref as D, computed as a } from "vue";
|
|
2
|
+
import { u as m } from "./use-has-slot.C9lQZ6nz.js";
|
|
3
|
+
import { S as B, a as x } from "./summary-grid.keys.CxTf_FOc.js";
|
|
4
|
+
import { G as M } from "./grid-layout.HvTAa4to.js";
|
|
5
|
+
import { n as f } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
6
|
+
import { u as R } from "./i18n.BQkEbtPM.js";
|
|
7
|
+
import { B as G } from "./dashed-underline.BQwLgzz6.js";
|
|
8
|
+
import { B as w } from "./info-icon.CYOXx8CL.js";
|
|
9
|
+
import { B as L } from "./typography.J1v_SPG3.js";
|
|
10
|
+
import { B as E } from "./tag.CGkclKVL.js";
|
|
11
|
+
import { C as N } from "./copy.CF8Fzu2Y.js";
|
|
12
|
+
import "../assets/summary-grid.css";
|
|
13
|
+
const A = {}, F = /* @__PURE__ */ d({
|
|
14
|
+
...A,
|
|
15
|
+
__name: "summary-grid",
|
|
16
|
+
props: {
|
|
17
|
+
columnWidth: { default: null },
|
|
18
|
+
slashedZero: { type: Boolean, default: !1 }
|
|
19
|
+
},
|
|
20
|
+
setup(r) {
|
|
21
|
+
var u, s;
|
|
22
|
+
const e = r, o = p(), t = m(o);
|
|
23
|
+
let n = 1;
|
|
24
|
+
if (o) {
|
|
25
|
+
const _ = (s = (u = Object.keys(o)) == null ? void 0 : u.filter((c) => c.includes("cell-"))) == null ? void 0 : s.map((c) => {
|
|
26
|
+
var l;
|
|
27
|
+
return parseInt((l = c.split("-")) == null ? void 0 : l[1], 10);
|
|
28
|
+
});
|
|
29
|
+
n = Math.max(..._);
|
|
30
|
+
}
|
|
31
|
+
I(() => {
|
|
32
|
+
if (n > 3)
|
|
33
|
+
throw new Error(
|
|
34
|
+
"BentoSummaryGrid must only have a maximum of 3 rows. Read the documentation for more information."
|
|
35
|
+
);
|
|
36
|
+
});
|
|
37
|
+
const i = () => ({ isSummaryGridLayout: !0 });
|
|
38
|
+
return h(B, i), h(x, k(e, "slashedZero")), { __sfc: !0, props: e, slots: o, hasSlot: t, numberOfRows: n, registerComponentsInSummaryGrid: i, GridLayout: M };
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
var U = function() {
|
|
42
|
+
var e = this, o = e._self._c, t = e._self._setupProxy;
|
|
43
|
+
return o("div", { staticClass: "b-summary-grid" }, e._l(t.numberOfRows, function(n) {
|
|
44
|
+
var i;
|
|
45
|
+
return o(t.GridLayout, { key: `summary-grid-row-${n}`, attrs: { "data-testid": `summary-grid-row-${n}`, "column-width": (i = e.columnWidth) == null ? void 0 : i[`row${n}`] }, scopedSlots: e._u([t.hasSlot(`cell-${n}-1`) ? { key: "col-1", fn: function() {
|
|
46
|
+
return [e._t(`cell-${n}-1`)];
|
|
47
|
+
}, proxy: !0 } : null, t.hasSlot(`cell-${n}-2`) ? { key: "col-2", fn: function() {
|
|
48
|
+
return [e._t(`cell-${n}-2`)];
|
|
49
|
+
}, proxy: !0 } : null, t.hasSlot(`cell-${n}-3`) ? { key: "col-3", fn: function() {
|
|
50
|
+
return [e._t(`cell-${n}-3`)];
|
|
51
|
+
}, proxy: !0 } : null, t.hasSlot(`cell-${n}-4`) ? { key: "col-4", fn: function() {
|
|
52
|
+
return [e._t(`cell-${n}-4`)];
|
|
53
|
+
}, proxy: !0 } : null, t.hasSlot(`cell-${n}-5`) ? { key: "col-5", fn: function() {
|
|
54
|
+
return [e._t(`cell-${n}-5`)];
|
|
55
|
+
}, proxy: !0 } : null, t.hasSlot(`cell-${n}-6`) ? { key: "col-6", fn: function() {
|
|
56
|
+
return [e._t(`cell-${n}-6`)];
|
|
57
|
+
}, proxy: !0 } : null], null, !0) });
|
|
58
|
+
}), 1);
|
|
59
|
+
}, O = [], V = /* @__PURE__ */ f(
|
|
60
|
+
F,
|
|
61
|
+
U,
|
|
62
|
+
O,
|
|
63
|
+
!1,
|
|
64
|
+
null,
|
|
65
|
+
"397e4d9c"
|
|
66
|
+
);
|
|
67
|
+
const Re = V.exports, Y = {}, Z = /* @__PURE__ */ d({
|
|
68
|
+
...Y,
|
|
69
|
+
__name: "summary-grid-item",
|
|
70
|
+
props: {
|
|
71
|
+
copy: { default: void 0 },
|
|
72
|
+
fitContent: { type: Boolean, default: !1 },
|
|
73
|
+
infoIconTooltipText: { default: null },
|
|
74
|
+
size: { default: "small" },
|
|
75
|
+
title: null,
|
|
76
|
+
trend: { default: null },
|
|
77
|
+
trendDirection: { default: "positive" },
|
|
78
|
+
secondaryTrend: { default: null },
|
|
79
|
+
secondaryTrendDirection: { default: "positive" },
|
|
80
|
+
underlinePopoverSize: { default: "fit-content" },
|
|
81
|
+
underlineTooltipText: { default: null },
|
|
82
|
+
itemType: { default: "custom" }
|
|
83
|
+
},
|
|
84
|
+
emits: ["copy-click", "info-icon-mouseenter"],
|
|
85
|
+
setup(r) {
|
|
86
|
+
const e = r, { trendDirection: o, secondaryTrendDirection: t, itemType: n, size: i } = z(e), u = P(x, D(!1)), s = (C) => {
|
|
87
|
+
switch (C) {
|
|
88
|
+
case "positive":
|
|
89
|
+
return "green";
|
|
90
|
+
case "negative":
|
|
91
|
+
return "red";
|
|
92
|
+
default:
|
|
93
|
+
return "blue";
|
|
94
|
+
}
|
|
95
|
+
}, _ = a(() => s(o.value)), c = a(() => s(t.value)), l = a(() => i.value === "small" ? "body" : n.value !== "text" ? "title" : null), g = a(() => ({
|
|
96
|
+
medium: i.value === "large",
|
|
97
|
+
strongest: i.value === "small",
|
|
98
|
+
wide: i.value === "small",
|
|
99
|
+
variant: l.value
|
|
100
|
+
})), S = a(() => e.fitContent ? { width: "fit-content" } : {}), $ = a(() => ({ "b-summary-grid-item--slashed-zero": u.value })), v = p(), T = m(v), b = a(() => e.underlineTooltipText || T("dashed-underline"));
|
|
101
|
+
return { __sfc: !0, props: e, trendDirection: o, secondaryTrendDirection: t, itemType: n, size: i, hasSlashedZero: u, tagVariantColor: s, trendVariant: _, secondaryTrendVariant: c, typographyContentElement: l, typographyProps: g, computedStyles: S, conditionalClasses: $, slots: v, hasSlot: T, withUnderline: b, BentoDashedUnderline: G, BentoInfoIcon: w, BentoTypography: L, BentoTag: E, Copy: N };
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
var j = function() {
|
|
105
|
+
var e = this, o = e._self._c, t = e._self._setupProxy;
|
|
106
|
+
return o("div", { staticClass: "b-summary-grid-item", class: t.conditionalClasses, style: t.computedStyles }, [o("div", { staticClass: "b-summary-grid-item__header" }, [o(t.BentoTypography, { staticClass: "b-summary-grid-item__title", attrs: { el: "span", variant: "body" } }, [t.withUnderline ? o(t.BentoDashedUnderline, { attrs: { "tooltip-text": e.underlineTooltipText, "popover-size": e.underlinePopoverSize }, scopedSlots: e._u([t.hasSlot("dashed-underline") ? { key: "popover-content", fn: function() {
|
|
107
|
+
return [e._t("dashed-underline")];
|
|
108
|
+
}, proxy: !0 } : null], null, !0) }, [e._v(" " + e._s(e.title) + " ")]) : [e._v(" " + e._s(e.title) + " ")]], 2), o("div", { staticClass: "b-summary-grid-item__title-icons" }, [e.copy ? o(t.Copy, { staticClass: "b-structured-list__icon", attrs: { text: e.copy }, on: { click: function(n) {
|
|
109
|
+
return e.$emit("copy-click", n);
|
|
110
|
+
} } }) : e._e(), e.infoIconTooltipText ? o(t.BentoInfoIcon, { staticClass: "b-summary-grid-item__title-tooltip", attrs: { "tooltip-text": e.infoIconTooltipText, "tooltip-position": "top" }, on: { mouseenter: function(n) {
|
|
111
|
+
return e.$emit("info-icon-mouseenter", n);
|
|
112
|
+
} } }) : e._e()], 1)], 1), o(t.BentoTypography, e._b({ staticClass: "b-summary-grid-item__title", attrs: { "data-testid": "summary-grid-item-content-typography", el: "span" } }, "bento-typography", t.typographyProps, !1), [e._t("default"), e.trend && t.itemType !== "text" ? o(t.BentoTag, { staticClass: "b-summary-grid-item__content-trend", attrs: { variant: t.trendVariant, label: e.trend } }) : e._e()], 2), t.hasSlot("secondary") ? o(t.BentoTypography, { staticClass: "b-summary-grid-item__title", attrs: { "data-testid": "summary-grid-item-secondary-metric-typography", el: "span", variant: "caption", stronger: "" } }, [e._t("secondary"), e.secondaryTrend ? o(t.BentoTag, { staticClass: "b-summary-grid-item__content-trend", attrs: { variant: t.secondaryTrendVariant, label: e.secondaryTrend } }) : e._e()], 2) : e._e()], 1);
|
|
113
|
+
}, H = [], W = /* @__PURE__ */ f(
|
|
114
|
+
Z,
|
|
115
|
+
j,
|
|
116
|
+
H,
|
|
117
|
+
!1,
|
|
118
|
+
null,
|
|
119
|
+
"01431a71"
|
|
120
|
+
);
|
|
121
|
+
const y = W.exports, J = {}, K = /* @__PURE__ */ d({
|
|
122
|
+
...J,
|
|
123
|
+
__name: "summary-grid-item-amount",
|
|
124
|
+
props: {
|
|
125
|
+
copy: { default: void 0 },
|
|
126
|
+
fitContent: { type: Boolean, default: !1 },
|
|
127
|
+
infoIconTooltipText: { default: null },
|
|
128
|
+
size: { default: "small" },
|
|
129
|
+
title: null,
|
|
130
|
+
trend: { default: null },
|
|
131
|
+
trendDirection: { default: "positive" },
|
|
132
|
+
secondaryTrend: { default: null },
|
|
133
|
+
secondaryTrendDirection: { default: "positive" },
|
|
134
|
+
underlinePopoverSize: { default: "fit-content" },
|
|
135
|
+
underlineTooltipText: { default: null },
|
|
136
|
+
label: null,
|
|
137
|
+
secondaryLabel: { default: null },
|
|
138
|
+
secondaryMetric: { default: null }
|
|
139
|
+
},
|
|
140
|
+
emits: ["copy-click", "info-icon-mouseenter"],
|
|
141
|
+
setup(r) {
|
|
142
|
+
const e = p(), o = m(e);
|
|
143
|
+
return { __sfc: !0, slots: e, hasSlot: o, SummaryGridItem: y };
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
var q = function() {
|
|
147
|
+
var e = this, o = e._self._c, t = e._self._setupProxy;
|
|
148
|
+
return o(t.SummaryGridItem, { staticClass: "b-summary-grid-item-amount", attrs: { "item-type": "amount", "info-icon-tooltip-text": e.infoIconTooltipText, title: e.title, copy: e.copy, "fit-content": e.fitContent, size: e.size, trend: e.trend, "trend-direction": e.trendDirection, "secondary-trend": e.secondaryTrend, "secondary-trend-direction": e.secondaryTrendDirection, "underline-popover-size": e.underlinePopoverSize, "underline-tooltip-text": e.underlineTooltipText }, on: { "copy-click": function(n) {
|
|
149
|
+
return e.$emit("copy-click", n);
|
|
150
|
+
}, "info-icon-mouseenter": function(n) {
|
|
151
|
+
return e.$emit("info-icon-mouseenter", n);
|
|
152
|
+
} }, scopedSlots: e._u([t.hasSlot("dashed-underline") ? { key: "dashed-underline", fn: function() {
|
|
153
|
+
return [e._t("dashed-underline")];
|
|
154
|
+
}, proxy: !0 } : null, e.secondaryMetric ? { key: "secondary", fn: function() {
|
|
155
|
+
return [e._v(" " + e._s(e.secondaryMetric) + " ")];
|
|
156
|
+
}, proxy: !0 } : null], null, !0) }, [o("div", { staticClass: "b-summary-grid-item-amount__content" }, [o("div", [e._v(e._s(e.label))]), e.secondaryLabel ? o("div", { staticClass: "b-summary-grid-item-amount__secondary-label" }, [e._v(e._s(e.secondaryLabel))]) : e._e()])]);
|
|
157
|
+
}, Q = [], X = /* @__PURE__ */ f(
|
|
158
|
+
K,
|
|
159
|
+
q,
|
|
160
|
+
Q,
|
|
161
|
+
!1,
|
|
162
|
+
null,
|
|
163
|
+
"49c31a1c"
|
|
164
|
+
);
|
|
165
|
+
const Ge = X.exports, ee = {}, te = /* @__PURE__ */ d({
|
|
166
|
+
...ee,
|
|
167
|
+
__name: "summary-grid-item-numeric",
|
|
168
|
+
props: {
|
|
169
|
+
copy: { default: void 0 },
|
|
170
|
+
fitContent: { type: Boolean, default: !1 },
|
|
171
|
+
infoIconTooltipText: { default: null },
|
|
172
|
+
size: { default: "small" },
|
|
173
|
+
title: null,
|
|
174
|
+
trend: { default: null },
|
|
175
|
+
trendDirection: { default: "positive" },
|
|
176
|
+
secondaryTrend: { default: null },
|
|
177
|
+
secondaryTrendDirection: { default: "positive" },
|
|
178
|
+
underlinePopoverSize: { default: "fit-content" },
|
|
179
|
+
underlineTooltipText: { default: null },
|
|
180
|
+
label: null,
|
|
181
|
+
secondaryMetric: { default: null }
|
|
182
|
+
},
|
|
183
|
+
emits: ["copy-click", "info-icon-mouseenter"],
|
|
184
|
+
setup(r) {
|
|
185
|
+
const e = p(), o = m(e);
|
|
186
|
+
return { __sfc: !0, slots: e, hasSlot: o, SummaryGridItem: y };
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
var ne = function() {
|
|
190
|
+
var e = this, o = e._self._c, t = e._self._setupProxy;
|
|
191
|
+
return o(t.SummaryGridItem, { staticClass: "b-summary-grid-item-numeric", attrs: { "item-type": "numeric", "info-icon-tooltip-text": e.infoIconTooltipText, title: e.title, copy: e.copy, "fit-content": e.fitContent, size: e.size, trend: e.trend, "trend-direction": e.trendDirection, "secondary-trend": e.secondaryTrend, "secondary-trend-direction": e.secondaryTrendDirection, "underline-popover-size": e.underlinePopoverSize, "underline-tooltip-text": e.underlineTooltipText }, on: { "copy-click": function(n) {
|
|
192
|
+
return e.$emit("copy-click", n);
|
|
193
|
+
}, "info-icon-mouseenter": function(n) {
|
|
194
|
+
return e.$emit("info-icon-mouseenter", n);
|
|
195
|
+
} }, scopedSlots: e._u([t.hasSlot("dashed-underline") ? { key: "dashed-underline", fn: function() {
|
|
196
|
+
return [e._t("dashed-underline")];
|
|
197
|
+
}, proxy: !0 } : null, e.secondaryMetric ? { key: "secondary", fn: function() {
|
|
198
|
+
return [e._v(" " + e._s(e.secondaryMetric) + " ")];
|
|
199
|
+
}, proxy: !0 } : null], null, !0) }, [e._v(" " + e._s(e.label) + " ")]);
|
|
200
|
+
}, oe = [], re = /* @__PURE__ */ f(
|
|
201
|
+
te,
|
|
202
|
+
ne,
|
|
203
|
+
oe,
|
|
204
|
+
!1,
|
|
205
|
+
null,
|
|
206
|
+
null
|
|
207
|
+
);
|
|
208
|
+
const we = re.exports, ie = {
|
|
209
|
+
i18n: {}
|
|
210
|
+
}, le = /* @__PURE__ */ d({
|
|
211
|
+
...ie,
|
|
212
|
+
__name: "summary-grid-item-percentage",
|
|
213
|
+
props: {
|
|
214
|
+
copy: { default: void 0 },
|
|
215
|
+
fitContent: { type: Boolean, default: !1 },
|
|
216
|
+
infoIconTooltipText: { default: null },
|
|
217
|
+
size: { default: "small" },
|
|
218
|
+
title: null,
|
|
219
|
+
trend: { default: null },
|
|
220
|
+
trendDirection: { default: "positive" },
|
|
221
|
+
secondaryTrend: { default: null },
|
|
222
|
+
secondaryTrendDirection: { default: "positive" },
|
|
223
|
+
underlinePopoverSize: { default: "fit-content" },
|
|
224
|
+
underlineTooltipText: { default: null },
|
|
225
|
+
label: null,
|
|
226
|
+
secondaryMetric: { default: null }
|
|
227
|
+
},
|
|
228
|
+
emits: ["copy-click", "info-icon-mouseenter"],
|
|
229
|
+
setup(r) {
|
|
230
|
+
const e = r, { locale: o } = R(), t = p(), n = m(t), i = {
|
|
231
|
+
style: "percent",
|
|
232
|
+
maximumFractionDigits: 2
|
|
233
|
+
}, u = (l) => l != null && l !== "" && !isNaN(Number(l)), s = (l) => l && u(l) ? new Intl.NumberFormat(o.value, i).format(Number(l) / 100) : l, _ = a(() => s(e.label)), c = a(() => s(e.secondaryMetric));
|
|
234
|
+
return { __sfc: !0, locale: o, props: e, slots: t, hasSlot: n, percentageArgs: i, isNumeric: u, convertToPercentIfNumber: s, computedLabelPercentage: _, computedSecondaryMetricPercentage: c, SummaryGridItem: y };
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
var se = function() {
|
|
238
|
+
var e = this, o = e._self._c, t = e._self._setupProxy;
|
|
239
|
+
return o(t.SummaryGridItem, { staticClass: "b-summary-grid-item-percentage", attrs: { "item-type": "percentage", "info-icon-tooltip-text": e.infoIconTooltipText, title: e.title, copy: e.copy, "fit-content": e.fitContent, size: e.size, trend: e.trend, "trend-direction": e.trendDirection, "secondary-trend": e.secondaryTrend, "secondary-trend-direction": e.secondaryTrendDirection, "underline-popover-size": e.underlinePopoverSize, "underline-tooltip-text": e.underlineTooltipText }, on: { "copy-click": function(n) {
|
|
240
|
+
return e.$emit("copy-click", n);
|
|
241
|
+
}, "info-icon-mouseenter": function(n) {
|
|
242
|
+
return e.$emit("info-icon-mouseenter", n);
|
|
243
|
+
} }, scopedSlots: e._u([t.hasSlot("dashed-underline") ? { key: "dashed-underline", fn: function() {
|
|
244
|
+
return [e._t("dashed-underline")];
|
|
245
|
+
}, proxy: !0 } : null, e.secondaryMetric ? { key: "secondary", fn: function() {
|
|
246
|
+
return [e._v(" " + e._s(t.computedSecondaryMetricPercentage) + " ")];
|
|
247
|
+
}, proxy: !0 } : null], null, !0) }, [e._v(" " + e._s(t.computedLabelPercentage) + " ")]);
|
|
248
|
+
}, ae = [], ue = /* @__PURE__ */ f(
|
|
249
|
+
le,
|
|
250
|
+
se,
|
|
251
|
+
ae,
|
|
252
|
+
!1,
|
|
253
|
+
null,
|
|
254
|
+
null
|
|
255
|
+
);
|
|
256
|
+
const Le = ue.exports, ce = {}, de = /* @__PURE__ */ d({
|
|
257
|
+
...ce,
|
|
258
|
+
__name: "summary-grid-item-text",
|
|
259
|
+
props: {
|
|
260
|
+
copy: { default: void 0 },
|
|
261
|
+
fitContent: { type: Boolean, default: !1 },
|
|
262
|
+
infoIconTooltipText: { default: null },
|
|
263
|
+
label: null,
|
|
264
|
+
title: null,
|
|
265
|
+
underlinePopoverSize: { default: "fit-content" },
|
|
266
|
+
underlineTooltipText: { default: null }
|
|
267
|
+
},
|
|
268
|
+
emits: ["copy-click", "info-icon-mouseenter"],
|
|
269
|
+
setup(r) {
|
|
270
|
+
const e = p(), o = m(e);
|
|
271
|
+
return { __sfc: !0, slots: e, hasSlot: o, SummaryGridItem: y };
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
var pe = function() {
|
|
275
|
+
var e = this, o = e._self._c, t = e._self._setupProxy;
|
|
276
|
+
return o(t.SummaryGridItem, { staticClass: "b-summary-grid-item-text", attrs: { "item-type": "text", "info-icon-tooltip-text": e.infoIconTooltipText, title: e.title, copy: e.copy, "fit-content": e.fitContent, "underline-popover-size": e.underlinePopoverSize, "underline-tooltip-text": e.underlineTooltipText }, on: { "copy-click": function(n) {
|
|
277
|
+
return e.$emit("copy-click", n);
|
|
278
|
+
}, "info-icon-mouseenter": function(n) {
|
|
279
|
+
return e.$emit("info-icon-mouseenter", n);
|
|
280
|
+
} }, scopedSlots: e._u([t.hasSlot("dashed-underline") ? { key: "dashed-underline", fn: function() {
|
|
281
|
+
return [e._t("dashed-underline")];
|
|
282
|
+
}, proxy: !0 } : null], null, !0) }, [e._v(" " + e._s(e.label) + " ")]);
|
|
283
|
+
}, me = [], fe = /* @__PURE__ */ f(
|
|
284
|
+
de,
|
|
285
|
+
pe,
|
|
286
|
+
me,
|
|
287
|
+
!1,
|
|
288
|
+
null,
|
|
289
|
+
null
|
|
290
|
+
);
|
|
291
|
+
const Ee = fe.exports, _e = {}, ye = /* @__PURE__ */ d({
|
|
292
|
+
..._e,
|
|
293
|
+
__name: "summary-grid-item-custom",
|
|
294
|
+
props: {
|
|
295
|
+
copy: { default: void 0 },
|
|
296
|
+
infoIconTooltipText: { default: null },
|
|
297
|
+
title: null,
|
|
298
|
+
fitContent: { type: Boolean, default: !1 },
|
|
299
|
+
underlinePopoverSize: { default: "fit-content" },
|
|
300
|
+
underlineTooltipText: { default: null }
|
|
301
|
+
},
|
|
302
|
+
emits: ["copy-click", "info-icon-mouseenter"],
|
|
303
|
+
setup(r) {
|
|
304
|
+
const e = p(), o = m(e);
|
|
305
|
+
return { __sfc: !0, slots: e, hasSlot: o, SummaryGridItem: y };
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
var ve = function() {
|
|
309
|
+
var e = this, o = e._self._c, t = e._self._setupProxy;
|
|
310
|
+
return o(t.SummaryGridItem, { attrs: { title: e.title, "info-icon-tooltip-text": e.infoIconTooltipText, copy: e.copy, "fit-content": e.fitContent, "underline-popover-size": e.underlinePopoverSize, "underline-tooltip-text": e.underlineTooltipText }, on: { "copy-click": function(n) {
|
|
311
|
+
return e.$emit("copy-click", n);
|
|
312
|
+
}, "info-icon-mouseenter": function(n) {
|
|
313
|
+
return e.$emit("info-icon-mouseenter", n);
|
|
314
|
+
} }, scopedSlots: e._u([t.hasSlot("dashed-underline") ? { key: "dashed-underline", fn: function() {
|
|
315
|
+
return [e._t("dashed-underline")];
|
|
316
|
+
}, proxy: !0 } : null], null, !0) }, [e._t("default")], 2);
|
|
317
|
+
}, Te = [], he = /* @__PURE__ */ f(
|
|
318
|
+
ye,
|
|
319
|
+
ve,
|
|
320
|
+
Te,
|
|
321
|
+
!1,
|
|
322
|
+
null,
|
|
323
|
+
null
|
|
324
|
+
);
|
|
325
|
+
const Ne = he.exports;
|
|
326
|
+
var xe = /* @__PURE__ */ ((r) => (r.SMALL = "small", r.MEDIUM = "medium", r.LARGE = "large", r))(xe || {}), ge = /* @__PURE__ */ ((r) => (r.POSITIVE = "positive", r.NEGATIVE = "negative", r.NEUTRAL = "neutral", r))(ge || {});
|
|
327
|
+
export {
|
|
328
|
+
xe as B,
|
|
329
|
+
Ge as a,
|
|
330
|
+
we as b,
|
|
331
|
+
Le as c,
|
|
332
|
+
Ee as d,
|
|
333
|
+
Ne as e,
|
|
334
|
+
ge as f,
|
|
335
|
+
Re as s
|
|
336
|
+
};
|
|
337
|
+
//# sourceMappingURL=summary-grid.types.DsvtLg3D.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary-grid.types.DsvtLg3D.js","sources":["../../src/components/summary-grid/summary-grid.vue","../../src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue","../../src/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue","../../src/components/summary-grid/components/summary-grid-item-numeric/summary-grid-item-numeric.vue","../../src/components/summary-grid/components/summary-grid-item-percentage/summary-grid-item-percentage.vue","../../src/components/summary-grid/components/summary-grid-item-text/summary-grid-item-text.vue","../../src/components/summary-grid/components/summary-grid-item-custom/summary-grid-item-custom.vue","../../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 = defineProps({\n columnWidth: { default: null },\n slashedZero: { type: Boolean, default: 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([\"copy-click\", \"info-icon-mouseenter\"]);\n\n const props = defineProps({\n copy: { default: undefined },\n fitContent: { type: Boolean, default: false },\n infoIconTooltipText: { default: null },\n size: { default: 'small' },\n title: null,\n trend: { default: null },\n trendDirection: { default: 'positive' },\n secondaryTrend: { default: null },\n secondaryTrendDirection: { default: 'positive' },\n underlinePopoverSize: { default: 'fit-content' },\n underlineTooltipText: { default: null },\n itemType: { default: 'custom' }\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([\"copy-click\", \"info-icon-mouseenter\"]);\n\n defineProps({\n copy: { default: undefined },\n fitContent: { type: Boolean, default: false },\n infoIconTooltipText: { default: null },\n size: { default: 'small' },\n title: null,\n trend: { default: null },\n trendDirection: { default: 'positive' },\n secondaryTrend: { default: null },\n secondaryTrendDirection: { default: 'positive' },\n underlinePopoverSize: { default: 'fit-content' },\n underlineTooltipText: { default: null },\n label: null,\n secondaryLabel: { default: null },\n secondaryMetric: { default: 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([\"copy-click\", \"info-icon-mouseenter\"]);\n\n defineProps({\n copy: { default: undefined },\n fitContent: { type: Boolean, default: false },\n infoIconTooltipText: { default: null },\n size: { default: 'small' },\n title: null,\n trend: { default: null },\n trendDirection: { default: 'positive' },\n secondaryTrend: { default: null },\n secondaryTrendDirection: { default: 'positive' },\n underlinePopoverSize: { default: 'fit-content' },\n underlineTooltipText: { default: null },\n label: null,\n secondaryMetric: { default: 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([\"copy-click\", \"info-icon-mouseenter\"]);\n\n const props = defineProps({\n copy: { default: undefined },\n fitContent: { type: Boolean, default: false },\n infoIconTooltipText: { default: null },\n size: { default: 'small' },\n title: null,\n trend: { default: null },\n trendDirection: { default: 'positive' },\n secondaryTrend: { default: null },\n secondaryTrendDirection: { default: 'positive' },\n underlinePopoverSize: { default: 'fit-content' },\n underlineTooltipText: { default: null },\n label: null,\n secondaryMetric: { default: 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([\"copy-click\", \"info-icon-mouseenter\"]);\n\n defineProps({\n copy: { default: undefined },\n fitContent: { type: Boolean, default: false },\n infoIconTooltipText: { default: null },\n label: null,\n title: null,\n underlinePopoverSize: { default: 'fit-content' },\n underlineTooltipText: { default: 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([\"copy-click\", \"info-icon-mouseenter\"]);\n\n defineProps({\n copy: { default: undefined },\n infoIconTooltipText: { default: null },\n title: null,\n fitContent: { type: Boolean, default: false },\n underlinePopoverSize: { default: 'fit-content' },\n underlineTooltipText: { default: 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","slots","useSlots","hasSlot","useHasSlot","numberOfRows","slotRows","_b","_a","slotName","onMounted","registerComponentsInSummaryGrid","provide","SUMMARY_GRID_LAYOUT_INJECTION_KEY","SUMMARY_GRID_SLASHED_ZERO","toRef","props","__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":";;;;;;;;;;;;AAgGI,MAAAA,IAAA,CAAA;;;;;;;;;iBAnDAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA;AAEA,QAAAI,IAAA;AACA,QAAAJ,GAAA;AACI,YAAAK,KAAAC,KAAAC,IAAA,OAAA,KAAAP,CAAA,MAAA,gBAAAO,EAAA,OAAA,CAAAC,MAAAA,EAAA,SAAA,OAAA,OAAA,gBAAAF,EAAA,IAAA,CAAAE,MAAA;;AAAA,yBAAAD,IAAAC,EAAA,MAAA,GAAA,MAAA,gBAAAD,EAAA,IAAA,EAAA;AAAA;AAGA,MAAAH,IAAA,KAAA,IAAA,GAAAC,CAAA;AAAA,IAAmC;AAGvC,IAAAI,EAAA,MAAA;AACI,UAAAL,IAAA;AACI,cAAA,IAAA;AAAA,UAAU;AAAA,QACN;AAAA,IAER,CAAA;AAGJ,UAAAM,IAAA,OAEI,EAAA,wBAAA;AAGJ,WAAAC,EAAAC,GAAAF,CAAA,GACAC,EAAAE,GAAAC,EAAAC,GAAA,aAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBCyFAC,IAAA,CAAA;;;;;;;;;;;;;;;;;;;iBA7DA,EAAA,gBAAAC,GAAA,yBAAAC,GAAA,UAAAC,GAAA,MAAAC,EAAA,IAAAC,EAAAN,CAAA,GACAO,IAAAC,EAAAV,GAAAW,EAAA,EAAA,CAAA,GAEAC,IAAA,CAAAC,MAAA;AACI,cAAAA,GAAA;AAAA,QAAmB,KAAA;AAEX,iBAAA;AAAA,QAAO,KAAA;AAEP,iBAAA;AAAA,QAAO;AAEP,iBAAA;AAAA,MAAO;AAAA,IACf,GAIJC,IAAAC,EAAA,MAAAH,EAAAR,EAAA,KAAA,CAAA,GACAY,IAAAD,EAAA,MAAAH,EAAAP,EAAA,KAAA,CAAA,GAEAY,IAAAF,EAAA,MACIR,EAAA,UAAA,UACI,SAEJD,EAAA,UAAA,SACI,UAGJ,IAAO,GAGXY,IAAAH,EAAA,OAAA;AAAA,MAAwC,QAAAR,EAAA,UAAA;AAAA,MACb,WAAAA,EAAA,UAAA;AAAA,MACG,MAAAA,EAAA,UAAA;AAAA,MACL,SAAAU,EAAA;AAAA,IACa,EAAA,GAGtCE,IAAAJ,EAAA,MAAAb,EAAA,aAAA,EAAA,OAAA,cAAA,IAAA,CAAA,CAAA,GAEAkB,IAAAL,EAAA,OAAA,EAAA,qCAAAN,EAAA,MAAA,EAAA,GAEAtB,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GACAkC,IAAAN,EAAA,MAAAb,EAAA,wBAAAb,EAAA,kBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;qBC1DAiC,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;AA1BA,UAAAnC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA;;;;;;;;;;;;;;;;;;;;;;;sBCoBAoC,KAAA,CAAA;;;;;;;;;;;;;;;;;;;;AAzBA,UAAApC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA;;;;;;;;;;;;;;;;;;;;;;;uBC0CAqC,KAAA;AAAA,EAAe,MAAA,CAAA;AAEf;;;;;;;;;;;;;;;;;;;;iBA/DA,EAAA,QAAAC,EAAA,IAAAC,EAAA,GAoBAvC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAwC,IAAA;AAAA,MAA4C,OAAA;AAAA,MACjC,uBAAA;AAAA,IACgB,GAG3BC,IAAA,CAAAC,MAAAA,KAAA,QAAAA,MAAA,MAAA,CAAA,MAAA,OAAAA,CAAA,CAAA,GACAC,IAAA,CAAAD,MACIA,KAAAD,EAAAC,CAAA,IACI,IAAA,KAAA,aAAAJ,EAAA,OAAAE,CAAA,EAAA,OAAA,OAAAE,CAAA,IAAA,GAAA,IAEJA,GAGJE,IAAAhB,EAAA,MAAAe,EAAA5B,EAAA,KAAA,CAAA,GACA8B,IAAAjB,EAAA,MAAAe,EAAA5B,EAAA,eAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;uBCVA+B,KAAA,CAAA;;;;;;;;;;;;;;AAtBA,UAAA9C,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA;;;;;;;;;;;;;;;;;;;;;uBCeA+C,KAAA,CAAA;;;;;;;;;;;;;AApBA,UAAA/C,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA;;;;;;;;;;;;;;;;;;;;;;AC/BQ,IAAAgD,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;"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { defineComponent as A, ref as v, provide as w, watch as g, nextTick as k, computed as f, unref as W, onUnmounted as N, toRefs as X, inject as E } from "vue";
|
|
2
|
+
import { B as Y } from "./typography.J1v_SPG3.js";
|
|
3
|
+
import { g as $ } from "./generate-uid.NJ8tVoha.js";
|
|
4
|
+
import { T as B, a as O, E as j } from "./tabs.keys.Cb4Vw5Jh.js";
|
|
5
|
+
import { F as G } from "./fixed-scroller.XN-jvWqb.js";
|
|
6
|
+
import { n as R } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
7
|
+
import "../assets/tab.css";
|
|
8
|
+
const S = (s, t) => {
|
|
9
|
+
const e = s === 0 ? t.length - 1 : s - 1, n = t[e];
|
|
10
|
+
return n.disabled || n.hidden ? S(e, t) : e;
|
|
11
|
+
}, D = (s, t) => {
|
|
12
|
+
const e = s === t.length - 1 ? 0 : s + 1, n = t[e];
|
|
13
|
+
return n.disabled || n.hidden ? D(e, t) : e;
|
|
14
|
+
};
|
|
15
|
+
var C = /* @__PURE__ */ ((s) => (s.ACTIVE_TAB_INDEX = "update:active-tab-index", s))(C || {});
|
|
16
|
+
const J = A({
|
|
17
|
+
components: {
|
|
18
|
+
BentoTypography: Y,
|
|
19
|
+
FixedScroller: G
|
|
20
|
+
},
|
|
21
|
+
props: {
|
|
22
|
+
/**
|
|
23
|
+
* Sets the active tab by its index (0 being the first tab item).
|
|
24
|
+
*/
|
|
25
|
+
activeTabIndex: { type: Number, default: 0 },
|
|
26
|
+
/*
|
|
27
|
+
* Renders the tab with a sticky positioning.
|
|
28
|
+
*/
|
|
29
|
+
sticky: { type: Boolean, default: !1 },
|
|
30
|
+
/**
|
|
31
|
+
* Additional configurable options for tabs rendered with a sticky positioning.
|
|
32
|
+
* It must be an object of type {@see BentoStickyTabsOption}
|
|
33
|
+
* @property {Ref<number>} stickyOptions.top - Top position the tabs should take up when rendered as sticky.
|
|
34
|
+
*/
|
|
35
|
+
stickyOptions: { type: Object, default: null }
|
|
36
|
+
},
|
|
37
|
+
emits: [C.ACTIVE_TAB_INDEX],
|
|
38
|
+
setup(s, { emit: t }) {
|
|
39
|
+
const e = v([]), n = v(null), b = v(), l = v(""), i = v(!1);
|
|
40
|
+
let c;
|
|
41
|
+
w(B, l);
|
|
42
|
+
const u = (a) => () => {
|
|
43
|
+
var r;
|
|
44
|
+
e.value = (r = e.value) == null ? void 0 : r.filter(({ id: o }) => o !== a);
|
|
45
|
+
};
|
|
46
|
+
w(O, ({
|
|
47
|
+
title: a,
|
|
48
|
+
disabled: r,
|
|
49
|
+
withNotificationIndicator: o,
|
|
50
|
+
counter: _,
|
|
51
|
+
hidden: I
|
|
52
|
+
}) => {
|
|
53
|
+
const h = $("b-tab");
|
|
54
|
+
return e.value.push({ counter: _, disabled: r, hidden: I, id: h, title: a, withNotificationIndicator: o }), { id: h, unregisterTab: u(h) };
|
|
55
|
+
});
|
|
56
|
+
const y = (a) => {
|
|
57
|
+
if (a.code === "ArrowLeft" || a.code === "ArrowRight") {
|
|
58
|
+
const r = e.value.find((_) => document.activeElement.id === _.id);
|
|
59
|
+
let o = e.value.indexOf(r);
|
|
60
|
+
a.code === "ArrowLeft" ? o = S(o, e.value) : a.code === "ArrowRight" && (o = D(o, e.value)), n.value.children[o].focus();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
g(
|
|
64
|
+
[() => s.activeTabIndex, e],
|
|
65
|
+
([a, r]) => {
|
|
66
|
+
k(() => {
|
|
67
|
+
var _;
|
|
68
|
+
const o = r[a];
|
|
69
|
+
l.value = o && !o.disabled ? o.id : (_ = e.value.find(({ disabled: I }) => !I)) == null ? void 0 : _.id;
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
{ immediate: !0 }
|
|
73
|
+
);
|
|
74
|
+
const m = (a) => {
|
|
75
|
+
l.value = a;
|
|
76
|
+
const r = e.value.findIndex(({ id: o }) => o === l.value);
|
|
77
|
+
t(C.ACTIVE_TAB_INDEX, r);
|
|
78
|
+
}, T = (a) => a ? "disabled" : !1, p = f(() => {
|
|
79
|
+
var a;
|
|
80
|
+
return (a = s.stickyOptions) != null && a.top ? W(s.stickyOptions.top) : 0;
|
|
81
|
+
}), K = f(() => s.sticky && p.value > 0 ? !0 : i.value), x = () => {
|
|
82
|
+
c && (c.disconnect(), c = null), i.value = !1;
|
|
83
|
+
}, P = (a) => {
|
|
84
|
+
s.sticky && p.value === 0 && (c = new IntersectionObserver(
|
|
85
|
+
([r]) => {
|
|
86
|
+
i.value = r.intersectionRatio < 1;
|
|
87
|
+
},
|
|
88
|
+
{ threshold: [1] }
|
|
89
|
+
), c.observe(a));
|
|
90
|
+
};
|
|
91
|
+
g(
|
|
92
|
+
[() => s.sticky, b, p],
|
|
93
|
+
([a, r]) => {
|
|
94
|
+
x(), a && r && k(() => P(r));
|
|
95
|
+
},
|
|
96
|
+
{ immediate: !0 }
|
|
97
|
+
), N(() => {
|
|
98
|
+
x();
|
|
99
|
+
});
|
|
100
|
+
const F = f(() => ({
|
|
101
|
+
"b-tabs__tab-list-wrapper--sticky": s.sticky,
|
|
102
|
+
"b-tabs__tab-list-wrapper--pinned": K.value
|
|
103
|
+
})), L = f(
|
|
104
|
+
() => {
|
|
105
|
+
var a;
|
|
106
|
+
return (
|
|
107
|
+
// This helps us detect when the tabs are pinned without calculations on the tabs positions because it makes the tabs intersect by 1 pixel with the element on top of it, which is getting aught by the intersection observer.
|
|
108
|
+
// Followed this example: https://css-tricks.com/how-to-detect-when-a-sticky-element-gets-pinned/
|
|
109
|
+
s.sticky ? {
|
|
110
|
+
top: `${(((a = s.stickyOptions) == null ? void 0 : a.top) ?? 0) - 1}px`
|
|
111
|
+
} : {}
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
return {
|
|
116
|
+
tabs: e,
|
|
117
|
+
tablist: n,
|
|
118
|
+
tablistwrapper: b,
|
|
119
|
+
activeTabId: l,
|
|
120
|
+
tablistWrapperConditionalClasses: F,
|
|
121
|
+
tablistWrapperStyles: L,
|
|
122
|
+
onKeydownTabsNavigation: y,
|
|
123
|
+
handleTabChange: m,
|
|
124
|
+
isDisabled: T
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
var U = function() {
|
|
129
|
+
var t = this, e = t._self._c;
|
|
130
|
+
return t._self._setupProxy, e("div", { staticClass: "b-tabs" }, [e("div", { ref: "tablistwrapper", staticClass: "b-tabs__tab-list-wrapper", class: t.tablistWrapperConditionalClasses, style: t.tablistWrapperStyles }, [e("fixed-scroller", { attrs: { condensed: "", "extra-padding-top": 2 } }, [e("div", { ref: "tablist", staticClass: "b-tabs__tab-list", attrs: { role: "tablist" }, on: { keydown: t.onKeydownTabsNavigation } }, t._l(t.tabs, function({ counter: n, disabled: b, hidden: l, id: i, title: c, withNotificationIndicator: u }) {
|
|
131
|
+
return e("button", { directives: [{ name: "show", rawName: "v-show", value: !l, expression: "!hidden" }], key: i, staticClass: "b-tabs__tab", class: {
|
|
132
|
+
"b-tabs__tab--active": t.activeTabId === i,
|
|
133
|
+
"b-tabs__tab--disabled": b
|
|
134
|
+
}, attrs: { id: i, role: "tab", type: "button", "aria-controls": `${i}-tabpanel`, "aria-hidden": l ? "true" : "false", "aria-selected": t.activeTabId === i ? "true" : "false", tabindex: t.activeTabId === i && !b.value ? null : -1, disabled: t.isDisabled(b) }, on: { click: function(d) {
|
|
135
|
+
return t.handleTabChange(i);
|
|
136
|
+
}, keydown: function(d) {
|
|
137
|
+
return !d.type.indexOf("key") && t._k(d.keyCode, "enter", 13, d.key, "Enter") && t._k(d.keyCode, "space", 32, d.key, [" ", "Spacebar"]) ? null : t.handleTabChange(i);
|
|
138
|
+
} } }, [e("span", { staticClass: "b-tabs__tab-text" }, [e("bento-typography", { staticClass: "b-tabs__tab-title", attrs: { el: "span", variant: "body", stronger: "" } }, [t._v(" " + t._s(c) + " ")]), n != null ? e("bento-typography", { staticClass: "b-tabs__tab-counter", class: {
|
|
139
|
+
"b-tabs__tab-counter--active": t.activeTabId === i
|
|
140
|
+
}, attrs: { el: "span", variant: "body", stronger: "" } }, [t._v(" " + t._s(n) + " ")]) : t._e(), u ? e("span", { staticClass: "b-tabs__tab-notification-dot", attrs: { "aria-hidden": "true" } }) : t._e()], 1), e("span", { directives: [{ name: "show", rawName: "v-show", value: t.activeTabId === i, expression: "activeTabId === id" }], staticClass: "b-tabs__tab-underline", attrs: { "aria-hidden": "true" } })]);
|
|
141
|
+
}), 0)])], 1), t._t("default")], 2);
|
|
142
|
+
}, z = [], q = /* @__PURE__ */ R(
|
|
143
|
+
J,
|
|
144
|
+
U,
|
|
145
|
+
z,
|
|
146
|
+
!1,
|
|
147
|
+
null,
|
|
148
|
+
"76156ba2"
|
|
149
|
+
);
|
|
150
|
+
const rt = q.exports, H = {
|
|
151
|
+
name: "bento-tab"
|
|
152
|
+
}, M = /* @__PURE__ */ A({
|
|
153
|
+
...H,
|
|
154
|
+
props: {
|
|
155
|
+
counter: { default: null },
|
|
156
|
+
disabled: { type: Boolean, default: !1 },
|
|
157
|
+
hidden: { type: Boolean, default: !1 },
|
|
158
|
+
title: null,
|
|
159
|
+
withNotificationIndicator: { type: Boolean, default: !1 }
|
|
160
|
+
},
|
|
161
|
+
setup(s) {
|
|
162
|
+
const t = s, { counter: e, disabled: n, hidden: b, withNotificationIndicator: l } = X(t), i = v(), c = (p) => {
|
|
163
|
+
i.value = p;
|
|
164
|
+
};
|
|
165
|
+
w(j, c);
|
|
166
|
+
const u = f(() => i.value ?? t.title), d = E(O), y = E(B), { id: m, unregisterTab: T } = d({
|
|
167
|
+
counter: e,
|
|
168
|
+
disabled: n,
|
|
169
|
+
hidden: b,
|
|
170
|
+
title: u,
|
|
171
|
+
withNotificationIndicator: l
|
|
172
|
+
});
|
|
173
|
+
return N(() => T()), { __sfc: !0, props: t, counter: e, disabled: n, hidden: b, withNotificationIndicator: l, componentTitle: i, setTitle: c, computedTitle: u, registerTab: d, activeTabId: y, id: m, unregisterTab: T };
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
var Q = function() {
|
|
177
|
+
var t = this, e = t._self._c, n = t._self._setupProxy;
|
|
178
|
+
return e("div", { directives: [{ name: "show", rawName: "v-show", value: n.activeTabId === n.id, expression: "activeTabId === id" }], staticClass: "b-tab", attrs: { id: `${n.id}-tabpanel`, role: "tabpanel", "aria-labelledby": n.id } }, [n.activeTabId === n.id ? [t._t("default")] : t._e()], 2);
|
|
179
|
+
}, V = [], Z = /* @__PURE__ */ R(
|
|
180
|
+
M,
|
|
181
|
+
Q,
|
|
182
|
+
V,
|
|
183
|
+
!1,
|
|
184
|
+
null,
|
|
185
|
+
"3b3a75e0"
|
|
186
|
+
);
|
|
187
|
+
const ot = Z.exports;
|
|
188
|
+
export {
|
|
189
|
+
rt as B,
|
|
190
|
+
ot as a
|
|
191
|
+
};
|
|
192
|
+
//# sourceMappingURL=tab.BhWPBxcB.js.map
|