@kiva/kv-components 6.62.4 → 6.62.5
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/KvUserAvatar.css +1 -0
- package/dist/vue/KvUserAvatar.js +41 -38
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.adjust-vertical-spacing[data-v-c9339e78]{top:-.1rem;position:relative}
|
package/dist/vue/KvUserAvatar.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { toRefs as F, ref as d, computed as u, onMounted as
|
|
2
|
-
import { isLegacyPlaceholderAvatar as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { toRefs as F, ref as d, computed as u, onMounted as p, resolveComponent as U, openBlock as n, createElementBlock as o, normalizeClass as r, createElementVNode as s, createBlock as H, normalizeStyle as I, createCommentVNode as y, withDirectives as b, vShow as B, toDisplayString as P } from "vue";
|
|
2
|
+
import { isLegacyPlaceholderAvatar as j, randomizedUserAvatarClass as D } from "../utils/imageUtils.js";
|
|
3
|
+
import M from "./KvLoadingPlaceholder.js";
|
|
4
|
+
import "./KvUserAvatar.css";
|
|
5
|
+
import N from "../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const V = {
|
|
6
7
|
name: "KvUserAvatar",
|
|
7
8
|
components: {
|
|
8
|
-
KvLoadingPlaceholder:
|
|
9
|
+
KvLoadingPlaceholder: M
|
|
9
10
|
},
|
|
10
11
|
props: {
|
|
11
12
|
/**
|
|
@@ -33,14 +34,14 @@ const j = {
|
|
|
33
34
|
setup(f) {
|
|
34
35
|
const {
|
|
35
36
|
lenderName: a,
|
|
36
|
-
lenderImageUrl:
|
|
37
|
-
isSmall:
|
|
38
|
-
} = F(f), i = d(!0),
|
|
39
|
-
const l =
|
|
40
|
-
return `${
|
|
37
|
+
lenderImageUrl: e,
|
|
38
|
+
isSmall: t
|
|
39
|
+
} = F(f), i = d(!0), c = d(null), m = d(null), v = u(() => a.value === "" && e.value === "" || a.value === "Anonymous"), S = () => {
|
|
40
|
+
const l = t != null && t.value ? "tw-w-3 tw-h-3 tw-text-h4" : "tw-w-6 tw-h-6 tw-text-h2";
|
|
41
|
+
return `${D(a.value)} ${l}`;
|
|
41
42
|
}, _ = u(() => {
|
|
42
43
|
var l;
|
|
43
|
-
return ((l =
|
|
44
|
+
return ((l = e == null ? void 0 : e.value) == null ? void 0 : l.split("/").pop()) ?? "";
|
|
44
45
|
}), C = u(() => {
|
|
45
46
|
var l;
|
|
46
47
|
return (l = a == null ? void 0 : a.value) == null ? void 0 : l.substring(0, 1).toUpperCase();
|
|
@@ -52,8 +53,8 @@ const j = {
|
|
|
52
53
|
};
|
|
53
54
|
h();
|
|
54
55
|
});
|
|
55
|
-
return
|
|
56
|
-
const l =
|
|
56
|
+
return p(async () => {
|
|
57
|
+
const l = c.value;
|
|
57
58
|
try {
|
|
58
59
|
await L(l), g();
|
|
59
60
|
} catch (w) {
|
|
@@ -64,26 +65,26 @@ const j = {
|
|
|
64
65
|
avatarClass: S,
|
|
65
66
|
imageFilename: _,
|
|
66
67
|
lenderNameFirstLetter: C,
|
|
67
|
-
isLegacyPlaceholderAvatar:
|
|
68
|
+
isLegacyPlaceholderAvatar: j,
|
|
68
69
|
isLoading: i,
|
|
69
70
|
onImgLoad: g,
|
|
70
|
-
imageRef:
|
|
71
|
-
userAvatar:
|
|
71
|
+
imageRef: c,
|
|
72
|
+
userAvatar: m
|
|
72
73
|
};
|
|
73
74
|
}
|
|
74
|
-
}, z = { key: 1 }, E = ["src"]
|
|
75
|
-
function
|
|
76
|
-
const
|
|
75
|
+
}, z = { key: 1 }, E = ["src"];
|
|
76
|
+
function K(f, a, e, t, i, c) {
|
|
77
|
+
const m = U("kv-loading-placeholder");
|
|
77
78
|
return n(), o("div", {
|
|
78
79
|
ref: "userAvatar",
|
|
79
|
-
class: r(["data-hj-suppress tw-flex", { "tw-w-3":
|
|
80
|
+
class: r(["data-hj-suppress tw-flex", { "tw-w-3": e.isSmall, "tw-w-6": !e.isSmall }])
|
|
80
81
|
}, [
|
|
81
|
-
|
|
82
|
+
t.isAnonymousUser ? (n(), o("div", {
|
|
82
83
|
key: 0,
|
|
83
|
-
class: r(["tw-rounded-full tw-bg-brand tw-inline-flex tw-align-center tw-justify-center", { "tw-w-3 tw-h-3":
|
|
84
|
+
class: r(["tw-rounded-full tw-bg-brand tw-inline-flex tw-align-center tw-justify-center", { "tw-w-3 tw-h-3": e.isSmall, "tw-w-6 tw-h-6": !e.isSmall }])
|
|
84
85
|
}, [
|
|
85
86
|
(n(), o("svg", {
|
|
86
|
-
class: r(["tw-h-full tw-text-brand", { "tw-w-3 tw-h-3":
|
|
87
|
+
class: r(["tw-h-full tw-text-brand", { "tw-w-3 tw-h-3": e.isSmall }]),
|
|
87
88
|
width: "25",
|
|
88
89
|
height: "37",
|
|
89
90
|
viewBox: "0 0 25 37",
|
|
@@ -103,33 +104,35 @@ function R(f, a, t, e, i, m) {
|
|
|
103
104
|
fill: "white"
|
|
104
105
|
}, null, -1)
|
|
105
106
|
]), 2))
|
|
106
|
-
], 2)) : !
|
|
107
|
-
|
|
107
|
+
], 2)) : !t.isLegacyPlaceholderAvatar(t.imageFilename) && t.imageFilename ? (n(), o("div", z, [
|
|
108
|
+
t.isLoading ? (n(), H(m, {
|
|
108
109
|
key: 0,
|
|
109
|
-
style:
|
|
110
|
-
width:
|
|
111
|
-
height:
|
|
110
|
+
style: I({
|
|
111
|
+
width: e.isSmall ? "1.5rem" : "3rem",
|
|
112
|
+
height: e.isSmall ? "1.5rem" : "3rem"
|
|
112
113
|
}),
|
|
113
114
|
class: "!tw-rounded-full"
|
|
114
115
|
}, null, 8, ["style"])) : y("", !0),
|
|
115
|
-
|
|
116
|
+
b(s("img", {
|
|
116
117
|
ref: "imageRef",
|
|
117
|
-
src:
|
|
118
|
+
src: e.lenderImageUrl,
|
|
118
119
|
alt: "Image of lender",
|
|
119
|
-
class: r(["tw-rounded-full tw-inline-block", { "tw-w-3 tw-h-3":
|
|
120
|
-
onLoad: a[0] || (a[0] = (v) =>
|
|
120
|
+
class: r(["tw-rounded-full tw-inline-block", { "tw-w-3 tw-h-3": e.isSmall, "tw-w-6 tw-h-6": !e.isSmall }]),
|
|
121
|
+
onLoad: a[0] || (a[0] = (v) => t.onImgLoad())
|
|
121
122
|
}, null, 42, E), [
|
|
122
|
-
[
|
|
123
|
+
[B, !t.isLoading]
|
|
123
124
|
])
|
|
124
|
-
])) :
|
|
125
|
+
])) : t.isLegacyPlaceholderAvatar(t.imageFilename) || !t.imageFilename ? (n(), o("div", {
|
|
125
126
|
key: 2,
|
|
126
|
-
class: r(["tw-rounded-full tw-inline-flex tw-align-center tw-justify-center",
|
|
127
|
+
class: r(["tw-rounded-full tw-inline-flex tw-align-center tw-justify-center", t.avatarClass()])
|
|
127
128
|
}, [
|
|
128
|
-
s("span",
|
|
129
|
+
s("span", {
|
|
130
|
+
class: r(["tw-self-center", { "adjust-vertical-spacing": !e.isSmall }])
|
|
131
|
+
}, P(t.lenderNameFirstLetter), 3)
|
|
129
132
|
], 2)) : y("", !0)
|
|
130
133
|
], 2);
|
|
131
134
|
}
|
|
132
|
-
const J = /* @__PURE__ */ V
|
|
135
|
+
const J = /* @__PURE__ */ N(V, [["render", K], ["__scopeId", "data-v-c9339e78"]]);
|
|
133
136
|
export {
|
|
134
137
|
J as default
|
|
135
138
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "6.62.
|
|
3
|
+
"version": "6.62.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"embla-carousel-fade",
|
|
115
115
|
"popper.js"
|
|
116
116
|
],
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "d08a667dc9daf95910021aeac2b3f90666edd13e"
|
|
118
118
|
}
|