@kiva/kv-components 6.5.0 → 6.7.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/vue/KvCartPill.js +23 -17
- package/dist/vue/KvUserAvatar.js +57 -41
- package/package.json +2 -2
package/dist/vue/KvCartPill.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { toRefs as n, computed as a, openBlock as i, createElementBlock as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { toRefs as n, computed as a, openBlock as i, createElementBlock as u, normalizeClass as p, renderSlot as c, createElementVNode as m, toDisplayString as f } from "vue";
|
|
2
|
+
import d from "../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
const w = {
|
|
4
4
|
props: {
|
|
5
5
|
borrowerName: {
|
|
6
6
|
type: String,
|
|
@@ -17,35 +17,41 @@ const d = {
|
|
|
17
17
|
isCloseNextMilestone: {
|
|
18
18
|
type: Boolean,
|
|
19
19
|
default: !1
|
|
20
|
+
},
|
|
21
|
+
customMessage: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: ""
|
|
20
24
|
}
|
|
21
25
|
},
|
|
22
|
-
setup(
|
|
26
|
+
setup(e) {
|
|
23
27
|
const {
|
|
24
28
|
borrowerName: o,
|
|
25
|
-
milestonesNumber:
|
|
26
|
-
isCloseNextMilestone:
|
|
27
|
-
} = n(
|
|
29
|
+
milestonesNumber: t,
|
|
30
|
+
isCloseNextMilestone: s
|
|
31
|
+
} = n(e);
|
|
28
32
|
return {
|
|
29
33
|
pillCopy: a(() => {
|
|
30
|
-
if (
|
|
34
|
+
if (e.customMessage)
|
|
35
|
+
return e.customMessage;
|
|
36
|
+
if (s.value)
|
|
31
37
|
return "You’re close to your next milestone!";
|
|
32
|
-
const
|
|
33
|
-
return o.value ? `Supporting ${o.value} will hit ${
|
|
38
|
+
const l = t.value > 1 ? `${t.value} of your milestones` : "your next milestone";
|
|
39
|
+
return o.value ? `Supporting ${o.value} will hit ${l}!` : "Supporting this loan achieves a milestone!";
|
|
34
40
|
})
|
|
35
41
|
};
|
|
36
42
|
}
|
|
37
43
|
}, y = { class: "tw-text-wrap" };
|
|
38
|
-
function
|
|
39
|
-
return i(),
|
|
40
|
-
class:
|
|
41
|
-
"tw-text-small tw-bg-secondary":
|
|
44
|
+
function g(e, o, t, s, r, l) {
|
|
45
|
+
return i(), u("div", {
|
|
46
|
+
class: p(["tw-w-max tw-flex tw-items-center tw-gap-1 tw-px-1 tw-py-0.5 tw-rounded", {
|
|
47
|
+
"tw-text-small tw-bg-secondary": t.showBg
|
|
42
48
|
}])
|
|
43
49
|
}, [
|
|
44
|
-
c(
|
|
45
|
-
m("p", y, f(
|
|
50
|
+
c(e.$slots, "icon"),
|
|
51
|
+
m("p", y, f(s.pillCopy), 1)
|
|
46
52
|
], 2);
|
|
47
53
|
}
|
|
48
|
-
const v = /* @__PURE__ */ w
|
|
54
|
+
const v = /* @__PURE__ */ d(w, [["render", g]]);
|
|
49
55
|
export {
|
|
50
56
|
v as default
|
|
51
57
|
};
|
package/dist/vue/KvUserAvatar.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { toRefs as
|
|
2
|
-
import { isLegacyPlaceholderAvatar as
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { toRefs as h, ref as v, computed as d, resolveComponent as y, openBlock as n, createElementBlock as o, normalizeClass as i, createElementVNode as s, createBlock as _, createCommentVNode as f, withDirectives as L, vShow as S, toDisplayString as C } from "vue";
|
|
2
|
+
import { isLegacyPlaceholderAvatar as x, randomizedUserAvatarClass as k } from "../utils/imageUtils.js";
|
|
3
|
+
import A from "./KvLoadingPlaceholder.js";
|
|
4
|
+
import F from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const U = {
|
|
5
6
|
name: "KvUserAvatar",
|
|
7
|
+
components: {
|
|
8
|
+
KvLoadingPlaceholder: A
|
|
9
|
+
},
|
|
6
10
|
props: {
|
|
7
11
|
/**
|
|
8
12
|
* The name of the lender
|
|
@@ -26,74 +30,86 @@ const x = {
|
|
|
26
30
|
default: !1
|
|
27
31
|
}
|
|
28
32
|
},
|
|
29
|
-
setup(
|
|
33
|
+
setup(m) {
|
|
30
34
|
const {
|
|
31
35
|
lenderName: l,
|
|
32
|
-
lenderImageUrl:
|
|
33
|
-
isSmall:
|
|
34
|
-
} =
|
|
35
|
-
const a =
|
|
36
|
-
return `${
|
|
37
|
-
},
|
|
36
|
+
lenderImageUrl: t,
|
|
37
|
+
isSmall: e
|
|
38
|
+
} = h(m), r = v(!0), c = d(() => l.value === "" && t.value === "" || l.value === "Anonymous"), w = () => {
|
|
39
|
+
const a = e != null && e.value ? "tw-w-3 tw-h-3 tw-text-h4" : "tw-w-6 tw-h-6 tw-text-h2";
|
|
40
|
+
return `${k()} ${a}`;
|
|
41
|
+
}, u = d(() => {
|
|
38
42
|
var a;
|
|
39
|
-
return ((a =
|
|
40
|
-
}),
|
|
43
|
+
return ((a = t == null ? void 0 : t.value) == null ? void 0 : a.split("/").pop()) ?? "";
|
|
44
|
+
}), g = d(() => {
|
|
41
45
|
var a;
|
|
42
46
|
return (a = l == null ? void 0 : l.value) == null ? void 0 : a.substring(0, 1).toUpperCase();
|
|
43
47
|
});
|
|
44
48
|
return {
|
|
45
|
-
isAnonymousUser:
|
|
46
|
-
avatarClass:
|
|
47
|
-
imageFilename:
|
|
48
|
-
lenderNameFirstLetter:
|
|
49
|
-
isLegacyPlaceholderAvatar:
|
|
49
|
+
isAnonymousUser: c,
|
|
50
|
+
avatarClass: w,
|
|
51
|
+
imageFilename: u,
|
|
52
|
+
lenderNameFirstLetter: g,
|
|
53
|
+
isLegacyPlaceholderAvatar: x,
|
|
54
|
+
isLoading: r,
|
|
55
|
+
onImgLoad: () => {
|
|
56
|
+
r.value = !1;
|
|
57
|
+
}
|
|
50
58
|
};
|
|
51
59
|
}
|
|
52
|
-
},
|
|
53
|
-
function
|
|
54
|
-
|
|
55
|
-
|
|
60
|
+
}, H = { key: 1 }, b = ["src"], B = { class: "tw-self-center" };
|
|
61
|
+
function I(m, l, t, e, r, c) {
|
|
62
|
+
const w = y("kv-loading-placeholder");
|
|
63
|
+
return n(), o("div", {
|
|
64
|
+
class: i(["data-hj-suppress tw-flex", { "tw-w-3": t.isSmall, "tw-w-6": !t.isSmall }])
|
|
56
65
|
}, [
|
|
57
|
-
|
|
66
|
+
e.isAnonymousUser ? (n(), o("div", {
|
|
58
67
|
key: 0,
|
|
59
|
-
class:
|
|
68
|
+
class: i(["tw-rounded-full tw-bg-brand tw-inline-flex tw-align-center tw-justify-center", { "tw-w-3 tw-h-3": t.isSmall, "tw-w-6 tw-h-6": !t.isSmall }])
|
|
60
69
|
}, [
|
|
61
|
-
(n(),
|
|
62
|
-
class:
|
|
70
|
+
(n(), o("svg", {
|
|
71
|
+
class: i(["tw-h-full tw-text-brand", { "tw-w-3 tw-h-3": t.isSmall }]),
|
|
63
72
|
width: "25",
|
|
64
73
|
height: "37",
|
|
65
74
|
viewBox: "0 0 25 37",
|
|
66
75
|
fill: "none",
|
|
67
76
|
xmlns: "http://www.w3.org/2000/svg"
|
|
68
|
-
}, l[
|
|
69
|
-
|
|
77
|
+
}, l[1] || (l[1] = [
|
|
78
|
+
s("path", {
|
|
70
79
|
d: "M8.22861 0.875H0.857178V36.3125H8.22861V0.875Z",
|
|
71
80
|
fill: "white"
|
|
72
81
|
}, null, -1),
|
|
73
|
-
|
|
82
|
+
s("path", {
|
|
74
83
|
d: "M10.1143 23.2751C21.9428 23.2751 24.6857 13.2126 24.6857 11.4626H23.6571C11.8286 11.4626 9.08569 21.5251 9.08569 23.2751H10.1143Z",
|
|
75
84
|
fill: "white"
|
|
76
85
|
}, null, -1),
|
|
77
|
-
|
|
86
|
+
s("path", {
|
|
78
87
|
d: "M9.08569 24.2376C9.08569 26.0751 11.1428 36.3126 23.8285 36.3126H24.8571C24.8571 34.4751 22.8 24.2376 10.1143 24.2376H9.08569Z",
|
|
79
88
|
fill: "white"
|
|
80
89
|
}, null, -1)
|
|
81
90
|
]), 2))
|
|
82
|
-
], 2)) : !
|
|
83
|
-
|
|
84
|
-
|
|
91
|
+
], 2)) : !e.isLegacyPlaceholderAvatar(e.imageFilename) && e.imageFilename ? (n(), o("div", H, [
|
|
92
|
+
e.isLoading ? (n(), _(w, {
|
|
93
|
+
key: 0,
|
|
94
|
+
class: i(["!tw-rounded-full", { "!tw-w-3 !tw-h-3": t.isSmall, "!tw-w-6 !tw-h-6": !t.isSmall }])
|
|
95
|
+
}, null, 8, ["class"])) : f("", !0),
|
|
96
|
+
L(s("img", {
|
|
97
|
+
src: t.lenderImageUrl,
|
|
85
98
|
alt: "Image of lender",
|
|
86
|
-
class:
|
|
87
|
-
|
|
88
|
-
|
|
99
|
+
class: i(["tw-rounded-full tw-inline-block", { "tw-w-3 tw-h-3": t.isSmall, "tw-w-6 tw-h-6": !t.isSmall }]),
|
|
100
|
+
onLoad: l[0] || (l[0] = (u) => e.onImgLoad())
|
|
101
|
+
}, null, 42, b), [
|
|
102
|
+
[S, !e.isLoading]
|
|
103
|
+
])
|
|
104
|
+
])) : e.isLegacyPlaceholderAvatar(e.imageFilename) || !e.imageFilename ? (n(), o("div", {
|
|
89
105
|
key: 2,
|
|
90
|
-
class:
|
|
106
|
+
class: i(["tw-rounded-full tw-inline-flex tw-align-center tw-justify-center", e.avatarClass()])
|
|
91
107
|
}, [
|
|
92
|
-
|
|
93
|
-
], 2)) :
|
|
108
|
+
s("span", B, C(e.lenderNameFirstLetter), 1)
|
|
109
|
+
], 2)) : f("", !0)
|
|
94
110
|
], 2);
|
|
95
111
|
}
|
|
96
|
-
const
|
|
112
|
+
const K = /* @__PURE__ */ F(U, [["render", I]]);
|
|
97
113
|
export {
|
|
98
|
-
|
|
114
|
+
K as default
|
|
99
115
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"embla-carousel-fade",
|
|
108
108
|
"popper.js"
|
|
109
109
|
],
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "cd2c1146ba70de5cde2dd547181a3e4489c627d3"
|
|
111
111
|
}
|