@kiva/kv-components 8.26.1 → 8.28.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/KvPieChartV2.css +1 -1
- package/dist/vue/KvPieChartV2.js +26 -25
- package/dist/vue/KvPieChartV2.vue.d.ts +9 -0
- package/dist/vue/KvPieChartV22.js +55 -45
- package/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic.css +1 -1
- package/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic.js +19 -18
- package/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic2.js +5 -5
- package/dist/vue/KvWwwHeaderBasic/LinkBar.css +1 -1
- package/dist/vue/KvWwwHeaderBasic/LinkBar.js +1 -1
- package/dist/vue/KvWwwHeaderBasic/LinkBar.vue.d.ts +3 -2
- package/dist/vue/KvWwwHeaderBasic/LinkBar2.js +10 -10
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
.segment-circle[data-v-
|
|
1
|
+
.segment-circle[data-v-9afd557d]{transition:stroke-dashoffset var(--segment-grow-duration, .5s) ease-in-out}.skeleton-ring[data-v-9afd557d]{opacity:1;transition:opacity .5s ease-in-out}.skeleton-ring--loading[data-v-9afd557d]{animation:skeleton-ring-pulse-9afd557d 1.4s ease-in-out infinite;transform-origin:center}.legend-dot[data-v-9afd557d]{transition:background-color .5s ease-in-out}@keyframes skeleton-ring-pulse-9afd557d{0%,to{opacity:.45}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.skeleton-ring--loading[data-v-9afd557d]{animation:none}}
|
package/dist/vue/KvPieChartV2.js
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import y from "./KvPieChartV22.js";
|
|
2
|
-
import { resolveComponent as x, openBlock as l, createElementBlock as o, createElementVNode as r, normalizeClass as k, createCommentVNode as n, Fragment as d, renderList as c,
|
|
2
|
+
import { resolveComponent as x, openBlock as l, createElementBlock as o, normalizeStyle as s, createElementVNode as r, normalizeClass as k, createCommentVNode as n, Fragment as d, renderList as c, toDisplayString as w, createBlock as _, withCtx as b } from "vue";
|
|
3
3
|
import "./KvPieChartV2.css";
|
|
4
4
|
import u from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const v = {
|
|
6
|
-
class: "kv-pie-chart-v2 tw-flex tw-flex-col tw-items-center tw-gap-1",
|
|
7
|
-
"aria-label": "Pie chart"
|
|
8
|
-
}, C = { class: "tw-px-2" }, D = {
|
|
5
|
+
const v = { class: "tw-px-2" }, C = {
|
|
9
6
|
viewBox: "0 0 262 262",
|
|
10
7
|
fill: "none",
|
|
11
8
|
class: "tw-w-full",
|
|
12
9
|
role: "img",
|
|
13
10
|
"aria-hidden": "true"
|
|
14
|
-
},
|
|
11
|
+
}, D = ["cx", "cy", "r", "stroke", "stroke-width"], S = ["cx", "cy", "r", "stroke", "stroke-width", "stroke-dasharray", "transform"], L = ["cx", "cy", "r", "stroke", "stroke-width", "stroke-dasharray", "transform"], O = {
|
|
15
12
|
key: 0,
|
|
16
13
|
class: "tw-flex tw-flex-wrap tw-justify-center tw-gap-0.5 tw-w-full tw-pt-0.5"
|
|
17
|
-
},
|
|
14
|
+
}, V = { class: "tw-flex tw-gap-0.5 tw-items-center tw-min-w-0 tw-overflow-hidden" }, W = { class: "tw-font-medium tw-text-small tw-text-primary tw-whitespace-nowrap tw-truncate" }, B = { class: "tw-flex tw-gap-0.5 tw-items-center tw-shrink-0" }, E = { class: "tw-grid tw-grid-cols-2 tw-grid-flow-row tw-gap-0.5" }, I = { class: "tw-flex tw-gap-0.5 tw-items-center tw-shrink-0 tw-overflow-hidden" }, X = { class: "tw-font-medium tw-text-small tw-text-primary tw-whitespace-nowrap tw-truncate" }, Y = {
|
|
18
15
|
class: "tw-font-light tw-text-small tw-text-primary tw-text-right tw-shrink-0 tw-tabular-nums",
|
|
19
16
|
style: { "min-width": "2.8ch" }
|
|
20
17
|
};
|
|
21
|
-
function G(N, i, a, t,
|
|
18
|
+
function G(N, i, a, t, p, M) {
|
|
22
19
|
var h, m;
|
|
23
|
-
const
|
|
24
|
-
return l(), o("figure",
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
const g = x("kv-lightbox");
|
|
21
|
+
return l(), o("figure", {
|
|
22
|
+
class: "kv-pie-chart-v2 tw-flex tw-flex-col tw-items-center tw-gap-1",
|
|
23
|
+
style: s({ "--segment-grow-duration": `${a.growDuration}ms` }),
|
|
24
|
+
"aria-label": "Pie chart"
|
|
25
|
+
}, [
|
|
26
|
+
r("div", v, [
|
|
27
|
+
(l(), o("svg", C, [
|
|
27
28
|
a.loading || !t.hasData ? (l(), o("circle", {
|
|
28
29
|
key: 0,
|
|
29
30
|
cx: t.CX,
|
|
@@ -33,7 +34,7 @@ function G(N, i, a, t, M, R) {
|
|
|
33
34
|
"stroke-width": a.strokeWidth,
|
|
34
35
|
fill: "none",
|
|
35
36
|
class: k(["skeleton-ring", { "skeleton-ring--loading": a.loading }])
|
|
36
|
-
}, null, 10,
|
|
37
|
+
}, null, 10, D)) : n("", !0),
|
|
37
38
|
(l(!0), o(d, null, c(t.visibleSegments, (e) => (l(), o("circle", {
|
|
38
39
|
key: e.label,
|
|
39
40
|
cx: t.CX,
|
|
@@ -49,7 +50,7 @@ function G(N, i, a, t, M, R) {
|
|
|
49
50
|
strokeDashoffset: e.isVisible ? 0 : e.dashLength,
|
|
50
51
|
transitionDelay: `${e.delay}ms`
|
|
51
52
|
})
|
|
52
|
-
}, null, 12,
|
|
53
|
+
}, null, 12, S))), 128)),
|
|
53
54
|
t.otherSegment ? (l(), o("circle", {
|
|
54
55
|
key: 1,
|
|
55
56
|
cx: t.CX,
|
|
@@ -65,15 +66,15 @@ function G(N, i, a, t, M, R) {
|
|
|
65
66
|
strokeDashoffset: t.otherSegment.isVisible ? 0 : t.otherSegment.dashLength,
|
|
66
67
|
transitionDelay: `${t.otherSegment.delay}ms`
|
|
67
68
|
})
|
|
68
|
-
}, null, 12,
|
|
69
|
+
}, null, 12, L)) : n("", !0)
|
|
69
70
|
]))
|
|
70
71
|
]),
|
|
71
|
-
t.hasData && !a.loading ? (l(), o("div",
|
|
72
|
-
(l(!0), o(d, null, c(t.visibleSegments, (e,
|
|
72
|
+
t.hasData && !a.loading ? (l(), o("div", O, [
|
|
73
|
+
(l(!0), o(d, null, c(t.visibleSegments, (e, f) => (l(), o("div", {
|
|
73
74
|
key: e.label,
|
|
74
75
|
class: "tw-bg-gray-100 tw-flex tw-gap-0.5 tw-items-center tw-px-1 tw-py-0.5 tw-rounded-xs"
|
|
75
76
|
}, [
|
|
76
|
-
r("div",
|
|
77
|
+
r("div", V, [
|
|
77
78
|
r("span", {
|
|
78
79
|
class: "tw-shrink-0 tw-w-1 tw-h-1 tw-rounded-full legend-dot",
|
|
79
80
|
style: s({
|
|
@@ -81,12 +82,12 @@ function G(N, i, a, t, M, R) {
|
|
|
81
82
|
transitionDelay: `${e.delay}ms`
|
|
82
83
|
})
|
|
83
84
|
}, null, 4),
|
|
84
|
-
r("span",
|
|
85
|
+
r("span", W, w(e.label), 1)
|
|
85
86
|
]),
|
|
86
87
|
r("span", {
|
|
87
88
|
class: "tw-font-light tw-text-small tw-text-primary tw-text-right tw-shrink-0 tw-tabular-nums",
|
|
88
89
|
style: s({ minWidth: t.valueMinWidth })
|
|
89
|
-
}, w(t.formatDisplayValue(
|
|
90
|
+
}, w(t.formatDisplayValue(f)), 5)
|
|
90
91
|
]))), 128)),
|
|
91
92
|
t.otherItems.length > 0 ? (l(), o("button", {
|
|
92
93
|
key: 0,
|
|
@@ -94,7 +95,7 @@ function G(N, i, a, t, M, R) {
|
|
|
94
95
|
type: "button",
|
|
95
96
|
onClick: i[0] || (i[0] = (e) => t.showOtherLightbox = !0)
|
|
96
97
|
}, [
|
|
97
|
-
r("div",
|
|
98
|
+
r("div", B, [
|
|
98
99
|
r("span", {
|
|
99
100
|
class: "tw-shrink-0 tw-w-1 tw-h-1 tw-rounded-full legend-dot",
|
|
100
101
|
style: s({
|
|
@@ -110,7 +111,7 @@ function G(N, i, a, t, M, R) {
|
|
|
110
111
|
}, w(t.formatOtherDisplayValue()), 5)
|
|
111
112
|
])) : n("", !0)
|
|
112
113
|
])) : n("", !0),
|
|
113
|
-
t.hasData && !a.loading ? (l(), _(
|
|
114
|
+
t.hasData && !a.loading ? (l(), _(g, {
|
|
114
115
|
key: 1,
|
|
115
116
|
visible: t.showOtherLightbox,
|
|
116
117
|
title: "Other",
|
|
@@ -135,9 +136,9 @@ function G(N, i, a, t, M, R) {
|
|
|
135
136
|
]),
|
|
136
137
|
_: 1
|
|
137
138
|
}, 8, ["visible"])) : n("", !0)
|
|
138
|
-
]);
|
|
139
|
+
], 4);
|
|
139
140
|
}
|
|
140
|
-
const
|
|
141
|
+
const T = /* @__PURE__ */ u(y, [["render", G], ["__scopeId", "data-v-9afd557d"]]);
|
|
141
142
|
export {
|
|
142
|
-
|
|
143
|
+
T as default
|
|
143
144
|
};
|
|
@@ -45,6 +45,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
45
45
|
type: NumberConstructor;
|
|
46
46
|
default: number;
|
|
47
47
|
};
|
|
48
|
+
growDuration: {
|
|
49
|
+
type: NumberConstructor;
|
|
50
|
+
default: number;
|
|
51
|
+
};
|
|
48
52
|
animateOut: {
|
|
49
53
|
type: BooleanConstructor;
|
|
50
54
|
default: boolean;
|
|
@@ -108,6 +112,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
108
112
|
type: NumberConstructor;
|
|
109
113
|
default: number;
|
|
110
114
|
};
|
|
115
|
+
growDuration: {
|
|
116
|
+
type: NumberConstructor;
|
|
117
|
+
default: number;
|
|
118
|
+
};
|
|
111
119
|
animateOut: {
|
|
112
120
|
type: BooleanConstructor;
|
|
113
121
|
default: boolean;
|
|
@@ -120,6 +128,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
120
128
|
unit: PieChartUnit;
|
|
121
129
|
shownSegments: number;
|
|
122
130
|
segmentGap: number;
|
|
131
|
+
growDuration: number;
|
|
123
132
|
animateOut: boolean;
|
|
124
133
|
}, {}, {
|
|
125
134
|
KvLightbox: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { toRefs as z, ref as I, computed as u, onMounted as J, watch as U, onUnmounted as Q } from "vue";
|
|
2
|
-
import { getPieChartColor as
|
|
2
|
+
import { getPieChartColor as D, OTHER_SEGMENT_BG_COLOR as Z, LOADING_BG_COLOR as ee } from "../utils/pieChartColors.js";
|
|
3
3
|
import { easeInOutCubic as te } from "../utils/useCountUp.js";
|
|
4
4
|
import ae from "./KvLightbox.js";
|
|
5
|
-
const E = 262, le = E / 2, ne = E / 2,
|
|
5
|
+
const E = 262, le = E / 2, ne = E / 2, ce = {
|
|
6
6
|
name: "KvPieChartV2",
|
|
7
7
|
components: {
|
|
8
8
|
KvLightbox: ae
|
|
@@ -62,6 +62,15 @@ const E = 262, le = E / 2, ne = E / 2, W = 500, ue = 500, ve = {
|
|
|
62
62
|
type: Number,
|
|
63
63
|
default: 1e3
|
|
64
64
|
},
|
|
65
|
+
/**
|
|
66
|
+
* Duration in milliseconds of each segment's grow animation. The stagger between
|
|
67
|
+
* segments and the count-up pacing use this same value, so lowering it speeds up
|
|
68
|
+
* the whole ring — draw and numbers — in sync. Default keeps the original timing.
|
|
69
|
+
*/
|
|
70
|
+
growDuration: {
|
|
71
|
+
type: Number,
|
|
72
|
+
default: 500
|
|
73
|
+
},
|
|
65
74
|
/**
|
|
66
75
|
* When changed from false to true, plays the reverse sweep-out animation.
|
|
67
76
|
*/
|
|
@@ -72,61 +81,62 @@ const E = 262, le = E / 2, ne = E / 2, W = 500, ue = 500, ve = {
|
|
|
72
81
|
},
|
|
73
82
|
setup(g) {
|
|
74
83
|
const {
|
|
75
|
-
values:
|
|
84
|
+
values: M,
|
|
76
85
|
unit: m,
|
|
77
|
-
loading:
|
|
86
|
+
loading: w,
|
|
78
87
|
shownSegments: d,
|
|
79
|
-
strokeWidth:
|
|
80
|
-
segmentGap:
|
|
81
|
-
initialDelay:
|
|
82
|
-
|
|
83
|
-
|
|
88
|
+
strokeWidth: W,
|
|
89
|
+
segmentGap: A,
|
|
90
|
+
initialDelay: T,
|
|
91
|
+
growDuration: y,
|
|
92
|
+
animateOut: b
|
|
93
|
+
} = z(g), k = I(!1), c = I(!1), V = u(() => Math.max((E - W.value) / 2, 1)), C = u(() => 2 * Math.PI * V.value), h = u(() => [...M.value].sort((e, t) => t.value - e.value)), o = u(() => h.value.reduce((e, t) => e + t.value, 0)), L = u(() => M.value.length > 0), S = u(() => h.value.slice(0, d.value)), O = u(() => h.value.slice(d.value).map((t, n) => ({
|
|
84
94
|
...t,
|
|
85
|
-
color:
|
|
95
|
+
color: D(d.value + n, t.color)
|
|
86
96
|
}))), q = u(() => h.value.map((e, t) => ({
|
|
87
97
|
...e,
|
|
88
|
-
color:
|
|
89
|
-
}))),
|
|
98
|
+
color: D(t, e.color)
|
|
99
|
+
}))), x = u(() => O.value.reduce((e, t) => e + t.value, 0)), N = u(() => o.value > 0 ? x.value / o.value : 0), f = u(() => {
|
|
90
100
|
let e = 0;
|
|
91
101
|
return S.value.map((t, n) => {
|
|
92
|
-
const a = o.value > 0 ? t.value / o.value : 0, l = Math.max(a *
|
|
102
|
+
const a = o.value > 0 ? t.value / o.value : 0, l = Math.max(a * C.value - A.value, 0), s = e * 360 - 90;
|
|
93
103
|
return e += a, {
|
|
94
104
|
label: t.label,
|
|
95
105
|
value: t.value,
|
|
96
106
|
percent: a,
|
|
97
|
-
color:
|
|
107
|
+
color: D(n, t.color),
|
|
98
108
|
dashLength: l,
|
|
99
109
|
startDeg: s,
|
|
100
|
-
delay:
|
|
101
|
-
isVisible: c.value && !
|
|
110
|
+
delay: T.value + n * y.value,
|
|
111
|
+
isVisible: c.value && !b.value
|
|
102
112
|
};
|
|
103
113
|
});
|
|
104
114
|
}), v = u(() => {
|
|
105
|
-
if (
|
|
115
|
+
if (O.value.length === 0) return null;
|
|
106
116
|
let e = 0;
|
|
107
117
|
S.value.forEach((l) => {
|
|
108
118
|
e += o.value > 0 ? l.value / o.value : 0;
|
|
109
119
|
});
|
|
110
|
-
const t = Math.max(
|
|
120
|
+
const t = Math.max(N.value * C.value - A.value, 0), n = e * 360 - 90, a = S.value.length;
|
|
111
121
|
return {
|
|
112
122
|
label: "Other",
|
|
113
|
-
value:
|
|
114
|
-
percent:
|
|
123
|
+
value: x.value,
|
|
124
|
+
percent: N.value,
|
|
115
125
|
color: "#C4C4C4",
|
|
116
126
|
dashLength: t,
|
|
117
127
|
startDeg: n,
|
|
118
|
-
delay:
|
|
119
|
-
isVisible: c.value && !
|
|
128
|
+
delay: T.value + a * y.value,
|
|
129
|
+
isVisible: c.value && !b.value
|
|
120
130
|
};
|
|
121
|
-
}), r = I([]), p = [], i = [],
|
|
131
|
+
}), r = I([]), p = [], i = [], _ = (e) => m.value === "percent" ? Math.round(e.percent * 100) : e.value, F = (e, t, n) => {
|
|
122
132
|
let a = null;
|
|
123
133
|
function l(s) {
|
|
124
134
|
a === null && (a = s);
|
|
125
|
-
const
|
|
126
|
-
r.value[e] = j,
|
|
135
|
+
const $ = s - a, R = Math.min($ / y.value, 1), Y = te(R), j = Math.round(t + (n - t) * Y);
|
|
136
|
+
r.value[e] = j, R < 1 && (i[e] = requestAnimationFrame(l));
|
|
127
137
|
}
|
|
128
138
|
i[e] = requestAnimationFrame(l);
|
|
129
|
-
},
|
|
139
|
+
}, G = (e = !1) => {
|
|
130
140
|
p.forEach(clearTimeout), p.length = 0, i.forEach(cancelAnimationFrame), i.length = 0;
|
|
131
141
|
const t = [
|
|
132
142
|
...f.value,
|
|
@@ -135,12 +145,12 @@ const E = 262, le = E / 2, ne = E / 2, W = 500, ue = 500, ve = {
|
|
|
135
145
|
for (; r.value.length < t.length; )
|
|
136
146
|
r.value.push(0);
|
|
137
147
|
t.forEach((n, a) => {
|
|
138
|
-
const l =
|
|
139
|
-
e ?
|
|
148
|
+
const l = _(n), { delay: s } = n, $ = setTimeout(() => {
|
|
149
|
+
e ? F(a, r.value[a], 0) : F(a, 0, l);
|
|
140
150
|
}, s);
|
|
141
|
-
p.push(
|
|
151
|
+
p.push($);
|
|
142
152
|
});
|
|
143
|
-
},
|
|
153
|
+
}, P = (e) => {
|
|
144
154
|
const t = r.value[e] ?? 0;
|
|
145
155
|
switch (m.value) {
|
|
146
156
|
case "percent":
|
|
@@ -164,7 +174,7 @@ const E = 262, le = E / 2, ne = E / 2, W = 500, ue = 500, ve = {
|
|
|
164
174
|
}
|
|
165
175
|
}, X = () => {
|
|
166
176
|
const e = f.value.length;
|
|
167
|
-
return
|
|
177
|
+
return P(e);
|
|
168
178
|
}, H = u(() => {
|
|
169
179
|
const e = [
|
|
170
180
|
...f.value,
|
|
@@ -172,7 +182,7 @@ const E = 262, le = E / 2, ne = E / 2, W = 500, ue = 500, ve = {
|
|
|
172
182
|
];
|
|
173
183
|
let t = 0;
|
|
174
184
|
return e.forEach((n) => {
|
|
175
|
-
const a =
|
|
185
|
+
const a = _(n);
|
|
176
186
|
let l;
|
|
177
187
|
switch (m.value) {
|
|
178
188
|
case "percent":
|
|
@@ -186,27 +196,27 @@ const E = 262, le = E / 2, ne = E / 2, W = 500, ue = 500, ve = {
|
|
|
186
196
|
}
|
|
187
197
|
l.length > t && (t = l.length);
|
|
188
198
|
}), `${t}ch`;
|
|
189
|
-
}),
|
|
199
|
+
}), B = () => {
|
|
190
200
|
requestAnimationFrame(() => {
|
|
191
201
|
requestAnimationFrame(() => {
|
|
192
|
-
c.value = !0,
|
|
202
|
+
c.value = !0, G(!1);
|
|
193
203
|
});
|
|
194
204
|
});
|
|
195
205
|
};
|
|
196
206
|
return J(() => {
|
|
197
|
-
!
|
|
198
|
-
}), U(
|
|
199
|
-
!e &&
|
|
200
|
-
}), U(
|
|
201
|
-
e && (c.value = !1,
|
|
207
|
+
!w.value && L.value && B();
|
|
208
|
+
}), U(w, (e) => {
|
|
209
|
+
!e && L.value && B();
|
|
210
|
+
}), U(b, (e) => {
|
|
211
|
+
e && (c.value = !1, G(!0));
|
|
202
212
|
}), Q(() => {
|
|
203
213
|
p.forEach(clearTimeout), i.forEach(cancelAnimationFrame);
|
|
204
214
|
}), {
|
|
205
215
|
// Constants
|
|
206
216
|
CX: le,
|
|
207
217
|
CY: ne,
|
|
208
|
-
radius:
|
|
209
|
-
circumference:
|
|
218
|
+
radius: V,
|
|
219
|
+
circumference: C,
|
|
210
220
|
LOADING_BG_COLOR: ee,
|
|
211
221
|
OTHER_SEGMENT_BG_COLOR: Z,
|
|
212
222
|
// State
|
|
@@ -214,19 +224,19 @@ const E = 262, le = E / 2, ne = E / 2, W = 500, ue = 500, ve = {
|
|
|
214
224
|
animatedIn: c,
|
|
215
225
|
displayValues: r,
|
|
216
226
|
// Computed
|
|
217
|
-
hasData:
|
|
227
|
+
hasData: L,
|
|
218
228
|
visibleSegments: f,
|
|
219
229
|
otherSegment: v,
|
|
220
|
-
otherItems:
|
|
230
|
+
otherItems: O,
|
|
221
231
|
allItemsWithColors: q,
|
|
222
232
|
valueMinWidth: H,
|
|
223
233
|
// Methods
|
|
224
|
-
formatDisplayValue:
|
|
234
|
+
formatDisplayValue: P,
|
|
225
235
|
formatItemValue: K,
|
|
226
236
|
formatOtherDisplayValue: X
|
|
227
237
|
};
|
|
228
238
|
}
|
|
229
239
|
};
|
|
230
240
|
export {
|
|
231
|
-
|
|
241
|
+
ce as default
|
|
232
242
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.header-fade-enter-active[data-v-
|
|
1
|
+
.header-fade-enter-active[data-v-5fc51700]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.header-fade-leave-active[data-v-5fc51700]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.1s}.header-fade-enter[data-v-5fc51700],.header-fade-leave-to[data-v-5fc51700]{opacity:0}.header-fade-leave[data-v-5fc51700],.header-fade-enter-to[data-v-5fc51700]{opacity:1}.bg-opacity-50[data-v-5fc51700]{background-color:rgba(var(--bg-action-highlight),.5)}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as
|
|
1
|
+
import k from "./KvWwwHeaderBasic2.js";
|
|
2
|
+
import { resolveComponent as a, openBlock as m, createBlock as u, withCtx as r, createElementVNode as s, normalizeStyle as d, createVNode as l, Transition as g, withDirectives as b, vShow as v, normalizeClass as h, resolveDynamicComponent as y, withModifiers as M } from "vue";
|
|
3
3
|
import "./KvWwwHeaderBasic.css";
|
|
4
4
|
import I from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
5
|
function L(t, o, n, e, C, D) {
|
|
6
|
-
const w =
|
|
7
|
-
return m(), u(
|
|
6
|
+
const w = a("link-bar"), f = a("kv-page-container"), c = a("kv-theme-provider");
|
|
7
|
+
return m(), u(c, {
|
|
8
8
|
tag: "div",
|
|
9
9
|
class: "tw-bg-primary"
|
|
10
10
|
}, {
|
|
@@ -14,11 +14,11 @@ function L(t, o, n, e, C, D) {
|
|
|
14
14
|
class: "tw-font-medium tw-relative",
|
|
15
15
|
style: d({ minHeight: e.MIN_HEADER_HEIGHT })
|
|
16
16
|
}, [
|
|
17
|
-
|
|
17
|
+
l(f, null, {
|
|
18
18
|
default: r(() => [
|
|
19
|
-
|
|
19
|
+
l(g, { name: "header-fade" }, {
|
|
20
20
|
default: r(() => [
|
|
21
|
-
b(
|
|
21
|
+
b(l(w, {
|
|
22
22
|
"logged-in": n.loggedIn,
|
|
23
23
|
"basket-count": n.basketCount,
|
|
24
24
|
balance: n.balance,
|
|
@@ -39,7 +39,8 @@ function L(t, o, n, e, C, D) {
|
|
|
39
39
|
"open-menu-item": e.menuComponent,
|
|
40
40
|
onItemHover: e.onItemHover,
|
|
41
41
|
onLoadSearchData: o[0] || (o[0] = (i) => t.$emit("load-search-data")),
|
|
42
|
-
onSearchSubmit: o[1] || (o[1] = (i) => t.$emit("search-submit", i))
|
|
42
|
+
onSearchSubmit: o[1] || (o[1] = (i) => t.$emit("search-submit", i)),
|
|
43
|
+
onLoginClick: o[2] || (o[2] = (i) => t.$emit("login-click", i))
|
|
43
44
|
}, null, 8, ["logged-in", "basket-count", "balance", "user-id", "is-borrower", "is-trustee", "lender-name", "lender-image-url", "is-user-data-loading", "is-basket-data-loading", "show-m-g-upsell-link", "login-url", "my-dashboard-url", "countries-not-lent-to-url", "app-origin", "search-suggestions", "is-mobile", "open-menu-item", "onItemHover"]), [
|
|
44
45
|
[v, e.linksVisible]
|
|
45
46
|
])
|
|
@@ -50,22 +51,22 @@ function L(t, o, n, e, C, D) {
|
|
|
50
51
|
_: 1
|
|
51
52
|
})
|
|
52
53
|
], 4),
|
|
53
|
-
|
|
54
|
+
l(g, { name: "header-fade" }, {
|
|
54
55
|
default: r(() => [
|
|
55
56
|
b(s("div", {
|
|
56
57
|
class: "tw-absolute tw-z-modal tw-h-full tw-inset-x-0 tw-bg-eco-green-4 bg-opacity-50 tw-min-h-screen",
|
|
57
58
|
style: d({ top: e.navHeight }),
|
|
58
|
-
onTouchstart: o[
|
|
59
|
+
onTouchstart: o[9] || (o[9] = (...i) => e.handleOverlayClick && e.handleOverlayClick(...i))
|
|
59
60
|
}, [
|
|
60
61
|
s("div", {
|
|
61
62
|
ref: "menuPanelRef",
|
|
62
|
-
class:
|
|
63
|
+
class: h(["tw-bg-primary tw-overflow-y-auto", e.menuPanelClass]),
|
|
63
64
|
style: d({
|
|
64
65
|
...e.menuPosition,
|
|
65
66
|
maxHeight: e.isMobileMenuActive ? "auto" : `calc(100dvh - ${e.navHeight})`
|
|
66
67
|
}),
|
|
67
|
-
onMouseenter: o[
|
|
68
|
-
onMouseleave: o[
|
|
68
|
+
onMouseenter: o[7] || (o[7] = (i) => e.setMenu(e.menuItem, e.menuComponent)),
|
|
69
|
+
onMouseleave: o[8] || (o[8] = (i) => e.setMenu())
|
|
69
70
|
}, [
|
|
70
71
|
(m(), u(y(e.menuComponent), {
|
|
71
72
|
ref: "menuComponentInstance",
|
|
@@ -84,10 +85,10 @@ function L(t, o, n, e, C, D) {
|
|
|
84
85
|
"app-origin": e.resolvedAppOrigin,
|
|
85
86
|
"search-suggestions": e.effectiveSuggestions,
|
|
86
87
|
onLoadLendMenuData: e.emitLendMenuEvent,
|
|
87
|
-
onLoadSearchData: o[
|
|
88
|
-
onSearchSubmit: o[
|
|
89
|
-
onClosingMenu: o[
|
|
90
|
-
onTouchstart: o[
|
|
88
|
+
onLoadSearchData: o[3] || (o[3] = (i) => t.$emit("load-search-data")),
|
|
89
|
+
onSearchSubmit: o[4] || (o[4] = (i) => t.$emit("search-submit", i)),
|
|
90
|
+
onClosingMenu: o[5] || (o[5] = (i) => e.setMenu()),
|
|
91
|
+
onTouchstart: o[6] || (o[6] = M(() => {
|
|
91
92
|
}, ["stop"]))
|
|
92
93
|
}, null, 40, ["logged-in", "login-url", "user-id", "is-borrower", "is-trustee", "trustee-id", "most-recent-borrowed-loan-id", "my-dashboard-url", "show-m-g-upsell-link", "is-mobile", "countries-not-lent-to-url", "app-origin", "search-suggestions", "onLoadLendMenuData"]))
|
|
93
94
|
], 38)
|
|
@@ -101,7 +102,7 @@ function L(t, o, n, e, C, D) {
|
|
|
101
102
|
_: 1
|
|
102
103
|
});
|
|
103
104
|
}
|
|
104
|
-
const B = /* @__PURE__ */ I(
|
|
105
|
+
const B = /* @__PURE__ */ I(k, [["render", L], ["__scopeId", "data-v-5fc51700"]]);
|
|
105
106
|
export {
|
|
106
107
|
B as default
|
|
107
108
|
};
|
|
@@ -42,10 +42,10 @@ const S = "4rem", Y = G`
|
|
|
42
42
|
trusteeId: { type: Number, default: null },
|
|
43
43
|
mostRecentBorrowedLoanId: { type: Number, default: null }
|
|
44
44
|
},
|
|
45
|
-
emits: ["load-lend-menu-data", "load-search-data", "search-submit"],
|
|
45
|
+
emits: ["load-lend-menu-data", "load-search-data", "search-submit", "login-click"],
|
|
46
46
|
setup(d, { emit: M }) {
|
|
47
|
-
const { isMobile: B, checkIsMobile:
|
|
48
|
-
menuOpen:
|
|
47
|
+
const { isMobile: B, checkIsMobile: k } = Q(), {
|
|
48
|
+
menuOpen: I,
|
|
49
49
|
menuComponent: A,
|
|
50
50
|
menuItem: N,
|
|
51
51
|
menuPosition: v,
|
|
@@ -102,7 +102,7 @@ const S = "4rem", Y = G`
|
|
|
102
102
|
g.value || f();
|
|
103
103
|
}
|
|
104
104
|
return K(() => {
|
|
105
|
-
!d.appOrigin && typeof window < "u" && (b.value = window.location.origin),
|
|
105
|
+
!d.appOrigin && typeof window < "u" && (b.value = window.location.origin), k(), O(), r.value && typeof ResizeObserver < "u" && (u = new ResizeObserver(() => {
|
|
106
106
|
r.value && (y.value = `${r.value.offsetHeight}px`);
|
|
107
107
|
}), u.observe(r.value));
|
|
108
108
|
}), $(() => {
|
|
@@ -115,7 +115,7 @@ const S = "4rem", Y = G`
|
|
|
115
115
|
resolvedAppOrigin: b,
|
|
116
116
|
effectiveSuggestions: U,
|
|
117
117
|
isMobile: B,
|
|
118
|
-
menuOpen:
|
|
118
|
+
menuOpen: I,
|
|
119
119
|
menuComponent: A,
|
|
120
120
|
menuItem: N,
|
|
121
121
|
menuPosition: v,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.link-bar[data-v-
|
|
1
|
+
.link-bar[data-v-2fd75227]{display:flex;align-items:center;gap:.5rem}.link-bar__logo[data-v-2fd75227]{position:absolute;top:50%;left:50%;--tw-translate-x: -50%;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}@media(min-width:45.875rem){.link-bar[data-v-2fd75227]{display:grid;-moz-column-gap:1rem;column-gap:1rem;grid-template-areas:"logo lend right" "search search search";grid-template-columns:1fr auto auto;grid-template-rows:4rem auto;row-gap:.5rem}.link-bar__logo[data-v-2fd75227]{position:static;--tw-translate-x: 0;--tw-translate-y: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));grid-area:logo;justify-self:start}.link-bar__lend[data-v-2fd75227]{grid-area:lend}.link-bar__search[data-v-2fd75227]{grid-area:search;margin-bottom:.5rem}.link-bar__right[data-v-2fd75227]{grid-area:right}}@media(min-width:64rem){.link-bar[data-v-2fd75227]{-moz-column-gap:1.25rem;column-gap:1.25rem;grid-template-areas:"logo lend search right";grid-template-columns:auto auto 1fr auto;grid-template-rows:4rem}.link-bar__search[data-v-2fd75227]{margin-bottom:0}}.header-link[data-v-2fd75227]{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-2fd75227]:hover{--tw-text-opacity: 1;color:rgba(var(--text-action),var(--tw-text-opacity, 1));text-decoration-line:none}
|
|
@@ -155,7 +155,7 @@ function V(k, n, o, e, j, X) {
|
|
|
155
155
|
])
|
|
156
156
|
], 32);
|
|
157
157
|
}
|
|
158
|
-
const Q = /* @__PURE__ */ O(M, [["render", V], ["__scopeId", "data-v-
|
|
158
|
+
const Q = /* @__PURE__ */ O(M, [["render", V], ["__scopeId", "data-v-2fd75227"]]);
|
|
159
159
|
export {
|
|
160
160
|
Q as default
|
|
161
161
|
};
|
|
@@ -257,11 +257,11 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
257
257
|
handleTouchStart: (item: string, menu: unknown, position?: unknown, triggerCenterX?: number | null) => void;
|
|
258
258
|
handleEmptySpaceClick: (event: Event) => void;
|
|
259
259
|
onPrimaryClick: (link: NavLink) => void;
|
|
260
|
-
onLoginClick: () => void;
|
|
260
|
+
onLoginClick: (event: MouseEvent) => void;
|
|
261
261
|
onBasketClick: () => void;
|
|
262
262
|
onSupportKivaClick: () => void;
|
|
263
263
|
onLogoClick: () => void;
|
|
264
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("load-search-data" | "search-submit" | "item-hover")[], "load-search-data" | "search-submit" | "item-hover", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
264
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("load-search-data" | "search-submit" | "item-hover" | "login-click")[], "load-search-data" | "search-submit" | "item-hover" | "login-click", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
265
265
|
loggedIn: {
|
|
266
266
|
type: BooleanConstructor;
|
|
267
267
|
default: boolean;
|
|
@@ -338,6 +338,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
338
338
|
"onLoad-search-data"?: (...args: any[]) => any;
|
|
339
339
|
"onSearch-submit"?: (...args: any[]) => any;
|
|
340
340
|
"onItem-hover"?: (...args: any[]) => any;
|
|
341
|
+
"onLogin-click"?: (...args: any[]) => any;
|
|
341
342
|
}>, {
|
|
342
343
|
lenderName: string;
|
|
343
344
|
lenderImageUrl: string;
|
|
@@ -9,7 +9,7 @@ import F from "../KvWwwHeader/KvHeaderLogo.js";
|
|
|
9
9
|
import G from "../KvWwwHeader/KvHeaderDropdownLink.js";
|
|
10
10
|
import { PRIMARY_LINKS as W } from "../../utils/headerNavLinks.js";
|
|
11
11
|
import X from "./SearchBar.js";
|
|
12
|
-
const v = r(() => import("../KvWwwHeader/LendMenu/KvLendMenu.js")),
|
|
12
|
+
const v = r(() => import("../KvWwwHeader/LendMenu/KvLendMenu.js")), g = r(() => import("./AboutMenu.js")), Y = r(() => import("./MyKivaMenu.js")), q = r(() => import("./MobileMenu.js")), ie = {
|
|
13
13
|
name: "LinkBar",
|
|
14
14
|
components: {
|
|
15
15
|
KvMaterialIcon: E,
|
|
@@ -40,11 +40,11 @@ const v = r(() => import("../KvWwwHeader/LendMenu/KvLendMenu.js")), p = r(() =>
|
|
|
40
40
|
isMobile: { type: Boolean, default: !1 },
|
|
41
41
|
openMenuItem: { type: [Object, Function], default: null }
|
|
42
42
|
},
|
|
43
|
-
emits: ["item-hover", "load-search-data", "search-submit"],
|
|
43
|
+
emits: ["item-hover", "load-search-data", "search-submit", "login-click"],
|
|
44
44
|
setup(t, { emit: l }) {
|
|
45
45
|
const o = P("$kvTrackEvent", () => {
|
|
46
46
|
}), a = d(null), u = d(null);
|
|
47
|
-
function
|
|
47
|
+
function p() {
|
|
48
48
|
const e = u.value, n = e == null ? void 0 : e.getBoundingClientRect();
|
|
49
49
|
return n ? t.isMobile ? { right: "0" } : { right: `${window.innerWidth - n.right}px` } : null;
|
|
50
50
|
}
|
|
@@ -53,7 +53,7 @@ const v = r(() => import("../KvWwwHeader/LendMenu/KvLendMenu.js")), p = r(() =>
|
|
|
53
53
|
const e = u.value, n = e == null ? void 0 : e.getBoundingClientRect();
|
|
54
54
|
return n ? n.left + n.width / 2 : null;
|
|
55
55
|
}
|
|
56
|
-
const
|
|
56
|
+
const k = i(() => W.filter((e) => e.visibility === "visitor" ? !t.loggedIn : e.visibility === "loggedIn" ? t.loggedIn : !0)), h = i(() => t.isMobile ? void 0 : "/lend-by-category"), y = i(() => $(Math.floor(t.balance)).format("$0")), M = i(() => t.openMenuItem === v ? t.openMenuItem : null), B = i(() => t.openMenuItem === g ? t.openMenuItem : null), L = {
|
|
57
57
|
menuButton: { action: "hover-Mobile-menu", label: "Mobile" },
|
|
58
58
|
lendButton: { action: "hover-Lend-menu", label: "Lend" },
|
|
59
59
|
aboutLink: { action: "hover-About-menu", label: "About" },
|
|
@@ -84,8 +84,8 @@ const v = r(() => import("../KvWwwHeader/LendMenu/KvLendMenu.js")), p = r(() =>
|
|
|
84
84
|
function K(e) {
|
|
85
85
|
o(e.track[0], e.track[1]);
|
|
86
86
|
}
|
|
87
|
-
function U() {
|
|
88
|
-
o("TopNav", "click-Log-in");
|
|
87
|
+
function U(e) {
|
|
88
|
+
o("TopNav", "click-Log-in"), l("login-click", e);
|
|
89
89
|
}
|
|
90
90
|
function A() {
|
|
91
91
|
o("TopNav", "click-Basket");
|
|
@@ -101,14 +101,14 @@ const v = r(() => import("../KvWwwHeader/LendMenu/KvLendMenu.js")), p = r(() =>
|
|
|
101
101
|
mdiChevronDown: x,
|
|
102
102
|
mdiBriefcase: D,
|
|
103
103
|
KvLendMenu: v,
|
|
104
|
-
AboutMenu:
|
|
104
|
+
AboutMenu: g,
|
|
105
105
|
MyKivaMenu: Y,
|
|
106
106
|
MobileMenu: q,
|
|
107
107
|
avatarMenu: u,
|
|
108
|
-
getAvatarMenuPosition:
|
|
108
|
+
getAvatarMenuPosition: p,
|
|
109
109
|
getAvatarTriggerCenterX: b,
|
|
110
|
-
visiblePrimaryLinks:
|
|
111
|
-
lendUrl:
|
|
110
|
+
visiblePrimaryLinks: k,
|
|
111
|
+
lendUrl: h,
|
|
112
112
|
formattedBalance: y,
|
|
113
113
|
lendOpenItem: M,
|
|
114
114
|
aboutOpenItem: B,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.28.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"dependencies": {
|
|
114
114
|
"fuse.js": "^7.1.0"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "88c9f72fd0eacc5c167b9697bda2527c073d7356"
|
|
117
117
|
}
|