@kiva/kv-components 6.6.0 → 6.8.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/KvUserAvatar.js +61 -41
- package/package.json +2 -2
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 _, ref as h, computed as d, onMounted as S, resolveComponent as C, openBlock as n, createElementBlock as s, normalizeClass as o, createElementVNode as i, createBlock as L, createCommentVNode as v, withDirectives as x, vShow as k, toDisplayString as A } from "vue";
|
|
2
|
+
import { isLegacyPlaceholderAvatar as F, randomizedUserAvatarClass as U } from "../utils/imageUtils.js";
|
|
3
|
+
import H from "./KvLoadingPlaceholder.js";
|
|
4
|
+
import b from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const p = {
|
|
5
6
|
name: "KvUserAvatar",
|
|
7
|
+
components: {
|
|
8
|
+
KvLoadingPlaceholder: H
|
|
9
|
+
},
|
|
6
10
|
props: {
|
|
7
11
|
/**
|
|
8
12
|
* The name of the lender
|
|
@@ -26,46 +30,54 @@ const x = {
|
|
|
26
30
|
default: !1
|
|
27
31
|
}
|
|
28
32
|
},
|
|
29
|
-
setup(
|
|
33
|
+
setup(c) {
|
|
30
34
|
const {
|
|
31
|
-
lenderName:
|
|
32
|
-
lenderImageUrl:
|
|
33
|
-
isSmall:
|
|
34
|
-
} =
|
|
35
|
-
const
|
|
36
|
-
return `${
|
|
37
|
-
},
|
|
38
|
-
var
|
|
39
|
-
return ((
|
|
40
|
-
}),
|
|
41
|
-
var
|
|
42
|
-
return (
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
35
|
+
lenderName: a,
|
|
36
|
+
lenderImageUrl: t,
|
|
37
|
+
isSmall: e
|
|
38
|
+
} = _(c), r = h(!0), m = h(null), w = d(() => a.value === "" && t.value === "" || a.value === "Anonymous"), u = () => {
|
|
39
|
+
const l = e != null && e.value ? "tw-w-3 tw-h-3 tw-text-h4" : "tw-w-6 tw-h-6 tw-text-h2";
|
|
40
|
+
return `${U()} ${l}`;
|
|
41
|
+
}, g = d(() => {
|
|
42
|
+
var l;
|
|
43
|
+
return ((l = t == null ? void 0 : t.value) == null ? void 0 : l.split("/").pop()) ?? "";
|
|
44
|
+
}), y = d(() => {
|
|
45
|
+
var l;
|
|
46
|
+
return (l = a == null ? void 0 : a.value) == null ? void 0 : l.substring(0, 1).toUpperCase();
|
|
47
|
+
}), f = () => {
|
|
48
|
+
r.value = !1;
|
|
49
|
+
};
|
|
50
|
+
return S(() => {
|
|
51
|
+
const l = m.value;
|
|
52
|
+
l && (l != null && l.complete) && !(l != null && l.naturalWidth) && f();
|
|
53
|
+
}), {
|
|
54
|
+
isAnonymousUser: w,
|
|
55
|
+
avatarClass: u,
|
|
56
|
+
imageFilename: g,
|
|
57
|
+
lenderNameFirstLetter: y,
|
|
58
|
+
isLegacyPlaceholderAvatar: F,
|
|
59
|
+
isLoading: r,
|
|
60
|
+
onImgLoad: f
|
|
50
61
|
};
|
|
51
62
|
}
|
|
52
|
-
},
|
|
53
|
-
function
|
|
63
|
+
}, B = { key: 1 }, I = ["src"], M = { class: "tw-self-center" };
|
|
64
|
+
function N(c, a, t, e, r, m) {
|
|
65
|
+
const w = C("kv-loading-placeholder");
|
|
54
66
|
return n(), s("div", {
|
|
55
|
-
class:
|
|
67
|
+
class: o(["data-hj-suppress tw-flex", { "tw-w-3": t.isSmall, "tw-w-6": !t.isSmall }])
|
|
56
68
|
}, [
|
|
57
|
-
|
|
69
|
+
e.isAnonymousUser ? (n(), s("div", {
|
|
58
70
|
key: 0,
|
|
59
|
-
class:
|
|
71
|
+
class: o(["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
72
|
}, [
|
|
61
73
|
(n(), s("svg", {
|
|
62
|
-
class:
|
|
74
|
+
class: o(["tw-h-full tw-text-brand", { "tw-w-3 tw-h-3": t.isSmall }]),
|
|
63
75
|
width: "25",
|
|
64
76
|
height: "37",
|
|
65
77
|
viewBox: "0 0 25 37",
|
|
66
78
|
fill: "none",
|
|
67
79
|
xmlns: "http://www.w3.org/2000/svg"
|
|
68
|
-
},
|
|
80
|
+
}, a[1] || (a[1] = [
|
|
69
81
|
i("path", {
|
|
70
82
|
d: "M8.22861 0.875H0.857178V36.3125H8.22861V0.875Z",
|
|
71
83
|
fill: "white"
|
|
@@ -79,21 +91,29 @@ function F(w, l, e, t, m, c) {
|
|
|
79
91
|
fill: "white"
|
|
80
92
|
}, null, -1)
|
|
81
93
|
]), 2))
|
|
82
|
-
], 2)) : !
|
|
83
|
-
|
|
84
|
-
|
|
94
|
+
], 2)) : !e.isLegacyPlaceholderAvatar(e.imageFilename) && e.imageFilename ? (n(), s("div", B, [
|
|
95
|
+
e.isLoading ? (n(), L(w, {
|
|
96
|
+
key: 0,
|
|
97
|
+
class: o(["!tw-rounded-full", { "!tw-w-3 !tw-h-3": t.isSmall, "!tw-w-6 !tw-h-6": !t.isSmall }])
|
|
98
|
+
}, null, 8, ["class"])) : v("", !0),
|
|
99
|
+
x(i("img", {
|
|
100
|
+
ref: "imageRef",
|
|
101
|
+
src: t.lenderImageUrl,
|
|
85
102
|
alt: "Image of lender",
|
|
86
|
-
class:
|
|
87
|
-
|
|
88
|
-
|
|
103
|
+
class: o(["tw-rounded-full tw-inline-block", { "tw-w-3 tw-h-3": t.isSmall, "tw-w-6 tw-h-6": !t.isSmall }]),
|
|
104
|
+
onLoad: a[0] || (a[0] = (u) => e.onImgLoad())
|
|
105
|
+
}, null, 42, I), [
|
|
106
|
+
[k, !e.isLoading]
|
|
107
|
+
])
|
|
108
|
+
])) : e.isLegacyPlaceholderAvatar(e.imageFilename) || !e.imageFilename ? (n(), s("div", {
|
|
89
109
|
key: 2,
|
|
90
|
-
class:
|
|
110
|
+
class: o(["tw-rounded-full tw-inline-flex tw-align-center tw-justify-center", e.avatarClass()])
|
|
91
111
|
}, [
|
|
92
|
-
i("span",
|
|
112
|
+
i("span", M, A(e.lenderNameFirstLetter), 1)
|
|
93
113
|
], 2)) : v("", !0)
|
|
94
114
|
], 2);
|
|
95
115
|
}
|
|
96
|
-
const
|
|
116
|
+
const R = /* @__PURE__ */ b(p, [["render", N]]);
|
|
97
117
|
export {
|
|
98
|
-
|
|
118
|
+
R as default
|
|
99
119
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.8.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": "f3c26f5415ac8b9bd051eb8624aec077a7b89440"
|
|
111
111
|
}
|