@kiva/kv-components 6.69.3 → 7.1.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/KvActivityRow.js +5 -4
- package/dist/vue/KvCarousel.css +1 -1
- package/dist/vue/KvCarousel.js +107 -88
- package/dist/vue/KvCommentsAdd.css +1 -1
- package/dist/vue/KvCommentsAdd.js +7 -6
- package/dist/vue/KvCommentsListItem.js +7 -6
- package/dist/vue/KvIconBag.js +19 -16
- package/dist/vue/KvInlineActivityCard.js +19 -20
- package/dist/vue/KvUserAvatar.js +106 -91
- package/dist/vue/KvWwwHeader/KvHeaderLinkBar.css +1 -1
- package/dist/vue/KvWwwHeader/KvHeaderLinkBar.js +198 -164
- package/dist/vue/KvWwwHeader.css +1 -1
- package/dist/vue/KvWwwHeader.js +48 -38
- package/package.json +2 -2
- package/dist/vue/KvInlineActivityCard.css +0 -1
- package/dist/vue/KvUserAvatar.css +0 -1
package/dist/vue/KvUserAvatar.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { toRefs as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import "
|
|
5
|
-
|
|
6
|
-
const V = {
|
|
1
|
+
import { toRefs as B, ref as m, computed as a, onMounted as P, resolveComponent as V, openBlock as i, createElementBlock as c, normalizeClass as b, createElementVNode as r, createCommentVNode as f, withDirectives as N, createVNode as z, vShow as D, normalizeStyle as y, toDisplayString as F } from "vue";
|
|
2
|
+
import { randomizedUserAvatarClass as M, isLegacyPlaceholderAvatar as p } from "../utils/imageUtils.js";
|
|
3
|
+
import S from "./KvLoadingPlaceholder.js";
|
|
4
|
+
import E from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const K = {
|
|
7
6
|
name: "KvUserAvatar",
|
|
8
7
|
components: {
|
|
9
|
-
KvLoadingPlaceholder:
|
|
8
|
+
KvLoadingPlaceholder: S
|
|
10
9
|
},
|
|
11
10
|
props: {
|
|
12
11
|
/**
|
|
@@ -24,115 +23,131 @@ const V = {
|
|
|
24
23
|
default: ""
|
|
25
24
|
},
|
|
26
25
|
/**
|
|
27
|
-
*
|
|
26
|
+
* Whether to render a smaller avatar
|
|
28
27
|
*/
|
|
29
28
|
isSmall: {
|
|
30
29
|
type: Boolean,
|
|
31
30
|
default: !1
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* Whether to use a css variable for the avatar url before data is loaded
|
|
34
|
+
*/
|
|
35
|
+
showCssPlaceholder: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: !1
|
|
32
38
|
}
|
|
33
39
|
},
|
|
34
|
-
setup(
|
|
40
|
+
setup(w) {
|
|
35
41
|
const {
|
|
36
|
-
lenderName:
|
|
37
|
-
lenderImageUrl:
|
|
38
|
-
isSmall:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
lenderName: t,
|
|
43
|
+
lenderImageUrl: s,
|
|
44
|
+
isSmall: e,
|
|
45
|
+
showCssPlaceholder: d
|
|
46
|
+
} = B(w), u = m(!0), l = m(null), v = m(null), C = a(() => !d.value && t.value === "" && s.value === "" || t.value === "Anonymous"), _ = a(() => {
|
|
47
|
+
const o = e != null && e.value ? "tw-font-sans tw-font-normal" : "tw-font-serif";
|
|
48
|
+
return `${M(t.value)} ${o}`;
|
|
49
|
+
}), A = a(() => e != null && e.value ? "0 0 27 27" : "0 0 27.5 27.5"), x = a(() => {
|
|
50
|
+
var n;
|
|
51
|
+
if (d.value)
|
|
52
|
+
return !0;
|
|
53
|
+
const o = ((n = s == null ? void 0 : s.value) == null ? void 0 : n.split("/").pop()) ?? "";
|
|
54
|
+
return o && !p(o);
|
|
55
|
+
}), I = a(() => {
|
|
56
|
+
var o;
|
|
57
|
+
return (o = t == null ? void 0 : t.value) == null ? void 0 : o.substring(0, 1).toUpperCase();
|
|
48
58
|
}), g = () => {
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
const
|
|
52
|
-
!
|
|
59
|
+
u.value = !1;
|
|
60
|
+
}, U = (o, n = 1e4) => new Promise((k, H) => {
|
|
61
|
+
const L = Date.now() + n, h = () => {
|
|
62
|
+
!o || o.complete ? k(o) : Date.now() > L ? H(new Error(`Timeout: ${o.src}`)) : setTimeout(h, 50);
|
|
53
63
|
};
|
|
54
64
|
h();
|
|
55
65
|
});
|
|
56
|
-
return
|
|
57
|
-
const
|
|
66
|
+
return P(async () => {
|
|
67
|
+
const o = l.value;
|
|
58
68
|
try {
|
|
59
|
-
await
|
|
60
|
-
} catch (
|
|
61
|
-
console.log(
|
|
69
|
+
await U(o), g();
|
|
70
|
+
} catch (n) {
|
|
71
|
+
console.log(n.message);
|
|
62
72
|
}
|
|
63
73
|
}), {
|
|
64
|
-
isAnonymousUser:
|
|
65
|
-
avatarClass:
|
|
66
|
-
|
|
67
|
-
lenderNameFirstLetter:
|
|
68
|
-
|
|
69
|
-
|
|
74
|
+
isAnonymousUser: C,
|
|
75
|
+
avatarClass: _,
|
|
76
|
+
userHasImage: x,
|
|
77
|
+
lenderNameFirstLetter: I,
|
|
78
|
+
letterViewBox: A,
|
|
79
|
+
isLegacyPlaceholderAvatar: p,
|
|
80
|
+
isImageLoading: u,
|
|
70
81
|
onImgLoad: g,
|
|
71
|
-
imageRef:
|
|
72
|
-
userAvatar:
|
|
82
|
+
imageRef: l,
|
|
83
|
+
userAvatar: v
|
|
73
84
|
};
|
|
74
85
|
}
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
86
|
+
}, R = {
|
|
87
|
+
key: 0,
|
|
88
|
+
class: "tw-h-3/4",
|
|
89
|
+
viewBox: "0 0 25 37",
|
|
90
|
+
fill: "none",
|
|
91
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
92
|
+
}, T = ["src"], Z = ["viewBox"], j = {
|
|
93
|
+
x: "50%",
|
|
94
|
+
y: "55%",
|
|
95
|
+
"dominant-baseline": "middle",
|
|
96
|
+
"text-anchor": "middle"
|
|
97
|
+
};
|
|
98
|
+
function q(w, t, s, e, d, u) {
|
|
99
|
+
const l = V("kv-loading-placeholder");
|
|
100
|
+
return i(), c("div", {
|
|
79
101
|
ref: "userAvatar",
|
|
80
|
-
class:
|
|
102
|
+
class: b(["data-hj-suppress tw-flex tw-items-center tw-justify-center tw-rounded-full tw-overflow-hidden", {
|
|
103
|
+
"tw-bg-brand": e.isAnonymousUser,
|
|
104
|
+
[e.avatarClass]: !e.isAnonymousUser
|
|
105
|
+
}])
|
|
81
106
|
}, [
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
107
|
+
e.isAnonymousUser ? (i(), c("svg", R, t[1] || (t[1] = [
|
|
108
|
+
r("path", {
|
|
109
|
+
d: "M8.22861 0.875H0.857178V36.3125H8.22861V0.875Z",
|
|
110
|
+
fill: "white"
|
|
111
|
+
}, null, -1),
|
|
112
|
+
r("path", {
|
|
113
|
+
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",
|
|
114
|
+
fill: "white"
|
|
115
|
+
}, null, -1),
|
|
116
|
+
r("path", {
|
|
117
|
+
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",
|
|
118
|
+
fill: "white"
|
|
119
|
+
}, null, -1)
|
|
120
|
+
]))) : f("", !0),
|
|
121
|
+
N(z(l, null, null, 512), [
|
|
122
|
+
[D, !e.isAnonymousUser && e.userHasImage && e.isImageLoading]
|
|
123
|
+
]),
|
|
124
|
+
!e.isAnonymousUser && e.userHasImage ? (i(), c("div", {
|
|
125
|
+
key: 1,
|
|
126
|
+
class: "tw-w-full tw-h-full",
|
|
127
|
+
style: y(s.showCssPlaceholder ? { display: "var(--user-avatar-display, block)" } : {
|
|
128
|
+
display: e.isImageLoading ? "none" : "block"
|
|
129
|
+
})
|
|
85
130
|
}, [
|
|
86
|
-
(
|
|
87
|
-
class: r(["tw-h-full tw-text-brand", { "tw-w-3 tw-h-3": e.isSmall }]),
|
|
88
|
-
width: "25",
|
|
89
|
-
height: "37",
|
|
90
|
-
viewBox: "0 0 25 37",
|
|
91
|
-
fill: "none",
|
|
92
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
93
|
-
}, a[1] || (a[1] = [
|
|
94
|
-
s("path", {
|
|
95
|
-
d: "M8.22861 0.875H0.857178V36.3125H8.22861V0.875Z",
|
|
96
|
-
fill: "white"
|
|
97
|
-
}, null, -1),
|
|
98
|
-
s("path", {
|
|
99
|
-
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",
|
|
100
|
-
fill: "white"
|
|
101
|
-
}, null, -1),
|
|
102
|
-
s("path", {
|
|
103
|
-
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",
|
|
104
|
-
fill: "white"
|
|
105
|
-
}, null, -1)
|
|
106
|
-
]), 2))
|
|
107
|
-
], 2)) : !t.isLegacyPlaceholderAvatar(t.imageFilename) && t.imageFilename ? (n(), o("div", z, [
|
|
108
|
-
t.isLoading ? (n(), H(m, {
|
|
109
|
-
key: 0,
|
|
110
|
-
style: I({
|
|
111
|
-
width: e.isSmall ? "1.5rem" : "3rem",
|
|
112
|
-
height: e.isSmall ? "1.5rem" : "3rem"
|
|
113
|
-
}),
|
|
114
|
-
class: "!tw-rounded-full"
|
|
115
|
-
}, null, 8, ["style"])) : y("", !0),
|
|
116
|
-
b(s("img", {
|
|
131
|
+
r("img", {
|
|
117
132
|
ref: "imageRef",
|
|
118
|
-
src:
|
|
133
|
+
src: s.lenderImageUrl,
|
|
119
134
|
alt: "Image of lender",
|
|
120
|
-
class:
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
135
|
+
class: "tw-w-full",
|
|
136
|
+
style: y(s.showCssPlaceholder ? { content: "var(--user-avatar)" } : {}),
|
|
137
|
+
onLoad: t[0] || (t[0] = (v) => e.onImgLoad())
|
|
138
|
+
}, null, 44, T)
|
|
139
|
+
], 4)) : f("", !0),
|
|
140
|
+
!e.isAnonymousUser && !e.userHasImage ? (i(), c("svg", {
|
|
126
141
|
key: 2,
|
|
127
|
-
class:
|
|
142
|
+
class: "tw-w-full tw-h-full",
|
|
143
|
+
fill: "currentColor",
|
|
144
|
+
viewBox: e.letterViewBox
|
|
128
145
|
}, [
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}, P(t.lenderNameFirstLetter), 3)
|
|
132
|
-
], 2)) : y("", !0)
|
|
146
|
+
r("text", j, F(e.lenderNameFirstLetter), 1)
|
|
147
|
+
], 8, Z)) : f("", !0)
|
|
133
148
|
], 2);
|
|
134
149
|
}
|
|
135
|
-
const
|
|
150
|
+
const W = /* @__PURE__ */ E(K, [["render", q]]);
|
|
136
151
|
export {
|
|
137
|
-
|
|
152
|
+
W as default
|
|
138
153
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.header-link[data-v-
|
|
1
|
+
.header-link[data-v-c31f1fca]{cursor:pointer;padding-top:1rem;padding-bottom:1rem;--tw-text-opacity: 1;color:rgba(var(--text-primary),var(--tw-text-opacity, 1));text-decoration-line:none}.header-link[data-v-c31f1fca]:hover{--tw-text-opacity: 1;color:rgba(var(--text-action),var(--tw-text-opacity, 1));text-decoration-line:none}
|