@kiva/kv-components 6.46.0 → 6.47.1

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.
@@ -1,28 +1,11 @@
1
- function a(o) {
2
- return (t, r) => {
3
- if (typeof t == "object" && typeof r == "object" && o)
4
- return t[o].localeCompare(r[o]);
5
- if (typeof t == "string" && typeof r == "string")
6
- return t.localeCompare(r);
7
- };
8
- }
9
- function b(o, t) {
10
- const r = o.toLowerCase();
11
- return (e, n) => {
12
- const s = typeof e == "object", u = typeof n == "object", c = (s && t ? e[t] : e).toLowerCase(), i = (u && t ? n[t] : n).toLowerCase(), p = c.indexOf(r), f = i.indexOf(r);
13
- return p === 0 ? f === 0 ? a()(c, i) : -1 : f === 0 ? 1 : a()(c, i);
14
- };
15
- }
16
- function j(o, t) {
17
- if (!Array.isArray(o))
1
+ function i(r, n) {
2
+ if (!Array.isArray(r))
18
3
  throw new TypeError("list must be an array");
19
- return (r, e) => {
20
- const n = r[t], s = e[t];
21
- return o.indexOf(n) < o.indexOf(s) ? -1 : 1;
4
+ return (e, t) => {
5
+ const a = e[n], o = t[n];
6
+ return r.indexOf(a) < r.indexOf(o) ? -1 : 1;
22
7
  };
23
8
  }
24
9
  export {
25
- a as abc,
26
- j as indexIn,
27
- b as startsWith
10
+ i as indexIn
28
11
  };
@@ -1,11 +1,11 @@
1
- import { toRefs as A, ref as v, computed as d, onMounted as F, resolveComponent as U, openBlock as n, createElementBlock as o, normalizeClass as r, createElementVNode as s, createBlock as p, normalizeStyle as H, createCommentVNode as y, withDirectives as b, vShow as B, toDisplayString as I } from "vue";
2
- import { isLegacyPlaceholderAvatar as P, randomizedUserAvatarClass as D } from "../utils/imageUtils.js";
3
- import M from "./KvLoadingPlaceholder.js";
4
- import N from "../_virtual/_plugin-vue_export-helper.js";
5
- const V = {
1
+ import { toRefs as F, ref as d, computed as u, onMounted as U, resolveComponent as p, openBlock as n, createElementBlock as o, normalizeClass as r, createElementVNode as s, createBlock as H, normalizeStyle as b, createCommentVNode as y, withDirectives as B, vShow as I, toDisplayString as P } from "vue";
2
+ import { isLegacyPlaceholderAvatar as D, randomizedUserAvatarClass as M } from "../utils/imageUtils.js";
3
+ import N from "./KvLoadingPlaceholder.js";
4
+ import V from "../_virtual/_plugin-vue_export-helper.js";
5
+ const j = {
6
6
  name: "KvUserAvatar",
7
7
  components: {
8
- KvLoadingPlaceholder: M
8
+ KvLoadingPlaceholder: N
9
9
  },
10
10
  props: {
11
11
  /**
@@ -30,50 +30,52 @@ const V = {
30
30
  default: !1
31
31
  }
32
32
  },
33
- setup(u) {
33
+ setup(f) {
34
34
  const {
35
35
  lenderName: a,
36
36
  lenderImageUrl: t,
37
37
  isSmall: e
38
- } = A(u), i = v(!0), m = v(null), c = d(() => a.value === "" && t.value === "" || a.value === "Anonymous"), f = () => {
38
+ } = F(f), i = d(!0), m = d(null), c = d(null), v = u(() => a.value === "" && t.value === "" || a.value === "Anonymous"), S = () => {
39
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 `${D(a.value)} ${l}`;
41
- }, S = d(() => {
40
+ return `${M(a.value)} ${l}`;
41
+ }, _ = u(() => {
42
42
  var l;
43
43
  return ((l = t == null ? void 0 : t.value) == null ? void 0 : l.split("/").pop()) ?? "";
44
- }), _ = d(() => {
44
+ }), C = u(() => {
45
45
  var l;
46
46
  return (l = a == null ? void 0 : a.value) == null ? void 0 : l.substring(0, 1).toUpperCase();
47
47
  }), g = () => {
48
48
  i.value = !1;
49
- }, C = (l, w = 1e4) => new Promise((L, k) => {
50
- const x = Date.now() + w, h = () => {
51
- !l || l.complete ? L(l) : Date.now() > x ? k(new Error(`Timeout: ${l.src}`)) : setTimeout(h, 50);
49
+ }, L = (l, w = 1e4) => new Promise((k, x) => {
50
+ const A = Date.now() + w, h = () => {
51
+ !l || l.complete ? k(l) : Date.now() > A ? x(new Error(`Timeout: ${l.src}`)) : setTimeout(h, 50);
52
52
  };
53
53
  h();
54
54
  });
55
- return F(async () => {
55
+ return U(async () => {
56
56
  const l = m.value;
57
57
  try {
58
- await C(l), g();
58
+ await L(l), g();
59
59
  } catch (w) {
60
60
  console.log(w.message);
61
61
  }
62
62
  }), {
63
- isAnonymousUser: c,
64
- avatarClass: f,
65
- imageFilename: S,
66
- lenderNameFirstLetter: _,
67
- isLegacyPlaceholderAvatar: P,
63
+ isAnonymousUser: v,
64
+ avatarClass: S,
65
+ imageFilename: _,
66
+ lenderNameFirstLetter: C,
67
+ isLegacyPlaceholderAvatar: D,
68
68
  isLoading: i,
69
69
  onImgLoad: g,
70
- imageRef: m
70
+ imageRef: m,
71
+ userAvatar: c
71
72
  };
72
73
  }
73
- }, j = { key: 1 }, z = ["src"], E = { class: "tw-self-center" };
74
- function K(u, a, t, e, i, m) {
75
- const c = U("kv-loading-placeholder");
74
+ }, z = { key: 1 }, E = ["src"], K = { class: "tw-self-center" };
75
+ function R(f, a, t, e, i, m) {
76
+ const c = p("kv-loading-placeholder");
76
77
  return n(), o("div", {
78
+ ref: "userAvatar",
77
79
  class: r(["data-hj-suppress tw-flex", { "tw-w-3": t.isSmall, "tw-w-6": !t.isSmall }])
78
80
  }, [
79
81
  e.isAnonymousUser ? (n(), o("div", {
@@ -101,33 +103,33 @@ function K(u, a, t, e, i, m) {
101
103
  fill: "white"
102
104
  }, null, -1)
103
105
  ]), 2))
104
- ], 2)) : !e.isLegacyPlaceholderAvatar(e.imageFilename) && e.imageFilename ? (n(), o("div", j, [
105
- e.isLoading ? (n(), p(c, {
106
+ ], 2)) : !e.isLegacyPlaceholderAvatar(e.imageFilename) && e.imageFilename ? (n(), o("div", z, [
107
+ e.isLoading ? (n(), H(c, {
106
108
  key: 0,
107
- style: H({
109
+ style: b({
108
110
  width: t.isSmall ? "1.5rem" : "3rem",
109
111
  height: t.isSmall ? "1.5rem" : "3rem"
110
112
  }),
111
113
  class: "!tw-rounded-full"
112
114
  }, null, 8, ["style"])) : y("", !0),
113
- b(s("img", {
115
+ B(s("img", {
114
116
  ref: "imageRef",
115
117
  src: t.lenderImageUrl,
116
118
  alt: "Image of lender",
117
119
  class: r(["tw-rounded-full tw-inline-block", { "tw-w-3 tw-h-3": t.isSmall, "tw-w-6 tw-h-6": !t.isSmall }]),
118
- onLoad: a[0] || (a[0] = (f) => e.onImgLoad())
119
- }, null, 42, z), [
120
- [B, !e.isLoading]
120
+ onLoad: a[0] || (a[0] = (v) => e.onImgLoad())
121
+ }, null, 42, E), [
122
+ [I, !e.isLoading]
121
123
  ])
122
124
  ])) : e.isLegacyPlaceholderAvatar(e.imageFilename) || !e.imageFilename ? (n(), o("div", {
123
125
  key: 2,
124
126
  class: r(["tw-rounded-full tw-inline-flex tw-align-center tw-justify-center", e.avatarClass()])
125
127
  }, [
126
- s("span", E, I(e.lenderNameFirstLetter), 1)
128
+ s("span", K, P(e.lenderNameFirstLetter), 1)
127
129
  ], 2)) : y("", !0)
128
130
  ], 2);
129
131
  }
130
- const G = /* @__PURE__ */ N(V, [["render", K]]);
132
+ const J = /* @__PURE__ */ V(j, [["render", R]]);
131
133
  export {
132
- G as default
134
+ J as default
133
135
  };
@@ -0,0 +1,89 @@
1
+ import s from "./KvHeaderMenuLink.js";
2
+ import { resolveComponent as l, resolveDirective as p, openBlock as t, createElementBlock as f, withDirectives as n, createBlock as i, withCtx as u, createTextVNode as a } from "vue";
3
+ import d from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const k = {
5
+ components: {
6
+ KvHeaderMenuLink: s
7
+ }
8
+ }, m = { class: "tw--mt-0.5 tw-pb-0.5 tw-flex tw-flex-col tw-items-start tw-font-medium" };
9
+ function v(w, e, c, b, N, T) {
10
+ const o = l("kv-header-menu-link"), r = p("kv-track-event");
11
+ return t(), f("nav", m, [
12
+ n((t(), i(o, { href: "/about" }, {
13
+ default: u(() => e[0] || (e[0] = [
14
+ a(" About us ")
15
+ ])),
16
+ _: 1
17
+ })), [
18
+ [r, ["TopNav", "click-menu-about-us"]]
19
+ ]),
20
+ n((t(), i(o, { href: "/about/partner-with-us" }, {
21
+ default: u(() => e[1] || (e[1] = [
22
+ a(" Partner with us ")
23
+ ])),
24
+ _: 1
25
+ })), [
26
+ [r, ["TopNav", "click-menu-partner-with-us"]]
27
+ ]),
28
+ n((t(), i(o, { href: "/about/how" }, {
29
+ default: u(() => e[2] || (e[2] = [
30
+ a(" How Kiva works ")
31
+ ])),
32
+ _: 1
33
+ })), [
34
+ [r, ["TopNav", "click-menu-how-kiva-works"]]
35
+ ]),
36
+ n((t(), i(o, { href: "/about/where-kiva-works" }, {
37
+ default: u(() => e[3] || (e[3] = [
38
+ a(" Where Kiva works ")
39
+ ])),
40
+ _: 1
41
+ })), [
42
+ [r, ["TopNav", "click-menu-where-kiva-works"]]
43
+ ]),
44
+ n((t(), i(o, { href: "/impact" }, {
45
+ default: u(() => e[4] || (e[4] = [
46
+ a(" Impact ")
47
+ ])),
48
+ _: 1
49
+ })), [
50
+ [r, ["TopNav", "click-menu-impact"]]
51
+ ]),
52
+ n((t(), i(o, { href: "/about/leadership" }, {
53
+ default: u(() => e[5] || (e[5] = [
54
+ a(" Leadership ")
55
+ ])),
56
+ _: 1
57
+ })), [
58
+ [r, ["TopNav", "click-menu-leadership"]]
59
+ ]),
60
+ n((t(), i(o, { href: "/about/finances" }, {
61
+ default: u(() => e[6] || (e[6] = [
62
+ a(" Finances ")
63
+ ])),
64
+ _: 1
65
+ })), [
66
+ [r, ["TopNav", "click-menu-finances"]]
67
+ ]),
68
+ n((t(), i(o, { href: "/about/press-center" }, {
69
+ default: u(() => e[7] || (e[7] = [
70
+ a(" Press ")
71
+ ])),
72
+ _: 1
73
+ })), [
74
+ [r, ["TopNav", "click-menu-press"]]
75
+ ]),
76
+ n((t(), i(o, { href: "/about/due-diligence" }, {
77
+ default: u(() => e[8] || (e[8] = [
78
+ a(" Due diligence ")
79
+ ])),
80
+ _: 1
81
+ })), [
82
+ [r, ["TopNav", "click-menu-due-diligence"]]
83
+ ])
84
+ ]);
85
+ }
86
+ const K = /* @__PURE__ */ d(k, [["render", v]]);
87
+ export {
88
+ K as default
89
+ };
@@ -0,0 +1,83 @@
1
+ import { getCurrentInstance as i, computed as u, resolveComponent as m, openBlock as c, createElementBlock as f, normalizeClass as l, renderSlot as w, createVNode as p } from "vue";
2
+ import v from "../KvMaterialIcon.js";
3
+ import M from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const h = {
5
+ components: { KvMaterialIcon: v },
6
+ props: {
7
+ refName: {
8
+ type: String,
9
+ default: ""
10
+ },
11
+ href: {
12
+ type: String,
13
+ default: void 0
14
+ },
15
+ menuComponent: {
16
+ type: Object,
17
+ default: () => ({})
18
+ },
19
+ openMenuItem: {
20
+ type: Object,
21
+ default: () => ({})
22
+ },
23
+ dropdownIcon: {
24
+ type: String,
25
+ default: ""
26
+ },
27
+ baseClass: {
28
+ type: String,
29
+ default: ""
30
+ },
31
+ sendLinkPosition: {
32
+ type: Boolean,
33
+ default: !1
34
+ }
35
+ },
36
+ emits: [
37
+ "on-hover"
38
+ ],
39
+ setup(e, { emit: o }) {
40
+ const { proxy: n } = i();
41
+ return {
42
+ computedClass: u(() => [
43
+ e.baseClass,
44
+ { "tw-text-tertiary": e.openMenuItem && e.openMenuItem !== e.menuComponent }
45
+ ]),
46
+ handleMouseOver: () => {
47
+ let s = null;
48
+ if (e.sendLinkPosition) {
49
+ const a = n.$refs[e.refName];
50
+ if (a) {
51
+ const t = a.getBoundingClientRect();
52
+ s = {
53
+ left: `${(t == null ? void 0 : t.left) + (t == null ? void 0 : t.width) / 2}px`,
54
+ transform: "translateX(-50%)",
55
+ borderRadius: "0px 0px 8px 8px"
56
+ };
57
+ }
58
+ }
59
+ o("on-hover", e.refName, e.menuComponent, s);
60
+ }
61
+ };
62
+ }
63
+ }, x = ["href"];
64
+ function C(e, o, n, r, d, s) {
65
+ const a = m("KvMaterialIcon");
66
+ return c(), f("a", {
67
+ ref: n.refName,
68
+ class: l(["tw-px-1.5 tw-py-1 tw-mx-1 tw-no-underline hover:tw-no-underline tw-text-primary hover:tw-text-action tw-items-center tw-rounded tw-cursor-pointer", r.computedClass]),
69
+ href: n.href,
70
+ onMouseover: o[0] || (o[0] = (...t) => r.handleMouseOver && r.handleMouseOver(...t)),
71
+ onMouseout: o[1] || (o[1] = (...t) => r.handleMouseOver && r.handleMouseOver(...t))
72
+ }, [
73
+ w(e.$slots, "default"),
74
+ p(a, {
75
+ class: l(["tw-inline tw-w-3 tw-ml-0.5 tw-transition-transform tw-duration-300", { "tw-rotate-180": n.openMenuItem === n.menuComponent }]),
76
+ icon: n.dropdownIcon
77
+ }, null, 8, ["class", "icon"])
78
+ ], 42, x);
79
+ }
80
+ const _ = /* @__PURE__ */ M(h, [["render", C]]);
81
+ export {
82
+ _ as default
83
+ };
@@ -1 +1 @@
1
- .header-link[data-v-ed7c52d8]{cursor:pointer;padding:1rem .5rem;--tw-text-opacity: 1;color:rgba(var(--text-primary),var(--tw-text-opacity, 1));text-decoration-line:none}.header-link[data-v-ed7c52d8]:hover{--tw-text-opacity: 1;color:rgba(var(--text-action),var(--tw-text-opacity, 1));text-decoration-line:none}@media (min-width: 64rem){.header-link[data-v-ed7c52d8]{padding-left:1.25rem;padding-right:1.25rem}}
1
+ .header-link[data-v-1ecf0a38]{cursor:pointer;padding:1rem .5rem;--tw-text-opacity: 1;color:rgba(var(--text-primary),var(--tw-text-opacity, 1));text-decoration-line:none}.header-link[data-v-1ecf0a38]:hover{--tw-text-opacity: 1;color:rgba(var(--text-action),var(--tw-text-opacity, 1));text-decoration-line:none}@media (min-width: 64rem){.header-link[data-v-1ecf0a38]{padding-left:1.25rem;padding-right:1.25rem}}