@kiva/kv-components 6.4.0 → 6.4.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.
- package/dist/vue/KvCartModal.css +1 -1
- package/dist/vue/KvCartModal.js +79 -77
- package/dist/vue/KvCartPill.js +30 -15
- package/package.json +2 -2
package/dist/vue/KvCartModal.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.screen[data-v-
|
|
1
|
+
.screen[data-v-b40bef0e]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1400;background-color:#0003}.modal[data-v-b40bef0e]{width:100%;border-bottom-right-radius:.875rem;border-bottom-left-radius:.875rem;--tw-bg-opacity: 1;background-color:rgba(var(--bg-primary),var(--tw-bg-opacity, 1))}@media (min-width: 45.875rem){.modal[data-v-b40bef0e]{position:absolute;right:0}}.modal[data-v-b40bef0e]{max-height:90%}.container[data-v-b40bef0e]{position:absolute;top:0;right:0;bottom:0;left:0}@media (min-width: 45.875rem){.modal[data-v-b40bef0e]{max-width:24.5rem}}
|
package/dist/vue/KvCartModal.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { toRefs as
|
|
2
|
-
import { mdiClose as
|
|
3
|
-
import { useFocusTrap as
|
|
4
|
-
import { hideOthers as
|
|
5
|
-
import { unlockScroll as
|
|
6
|
-
import { unlockPrintSingleEl as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
1
|
+
import { toRefs as I, ref as w, computed as b, watch as K, onMounted as F, onBeforeUnmount as P, resolveComponent as x, openBlock as k, createBlock as R, Transition as j, withCtx as h, withDirectives as D, createElementVNode as o, withModifiers as C, renderSlot as g, createVNode as y, createElementBlock as S, createCommentVNode as M, createTextVNode as L, toDisplayString as O, vShow as U, nextTick as q } from "vue";
|
|
2
|
+
import { mdiClose as z, mdiCheckCircle as G } from "@mdi/js";
|
|
3
|
+
import { useFocusTrap as H } from "@vueuse/integrations/useFocusTrap";
|
|
4
|
+
import { hideOthers as J } from "../vendor/aria-hidden/dist/es2015/index.js";
|
|
5
|
+
import { unlockScroll as Q, lockScroll as W } from "../utils/scrollLock.js";
|
|
6
|
+
import { unlockPrintSingleEl as X, lockPrintSingleEl as Y } from "../utils/printing.js";
|
|
7
|
+
import Z from "./KvButton.js";
|
|
8
|
+
import $ from "./KvMaterialIcon.js";
|
|
9
9
|
import "./KvCartModal.css";
|
|
10
|
-
import
|
|
11
|
-
const
|
|
10
|
+
import tt from "../_virtual/_plugin-vue_export-helper.js";
|
|
11
|
+
const et = {
|
|
12
12
|
components: {
|
|
13
|
-
KvMaterialIcon:
|
|
14
|
-
KvButton:
|
|
13
|
+
KvMaterialIcon: $,
|
|
14
|
+
KvButton: Z
|
|
15
15
|
},
|
|
16
16
|
props: {
|
|
17
17
|
/**
|
|
@@ -40,70 +40,72 @@ const $ = {
|
|
|
40
40
|
emits: [
|
|
41
41
|
"cart-modal-closed"
|
|
42
42
|
],
|
|
43
|
-
setup(
|
|
43
|
+
setup(d, { emit: t, slots: i }) {
|
|
44
44
|
const {
|
|
45
|
-
visible:
|
|
46
|
-
preventClose:
|
|
47
|
-
} =
|
|
48
|
-
|
|
45
|
+
visible: e,
|
|
46
|
+
preventClose: r
|
|
47
|
+
} = I(d), c = w(null), l = w(null), m = w(null), n = w(), _ = b(() => [
|
|
48
|
+
c.value
|
|
49
49
|
// This cart modal
|
|
50
|
-
]), {
|
|
51
|
-
activate:
|
|
52
|
-
deactivate:
|
|
53
|
-
} =
|
|
50
|
+
]), B = b(() => !!i.content), {
|
|
51
|
+
activate: T,
|
|
52
|
+
deactivate: E
|
|
53
|
+
} = H(_, {
|
|
54
54
|
allowOutsideClick: !0
|
|
55
55
|
// allow clicking outside the cart modal to close it
|
|
56
56
|
});
|
|
57
|
-
let
|
|
58
|
-
const
|
|
59
|
-
|
|
57
|
+
let u = null, v = null;
|
|
58
|
+
const a = (s = "") => {
|
|
59
|
+
c.value && l.value && (E(), l.value.scrollTop = 0, X(l.value)), Q(), u && (u(), u = null), document.removeEventListener("keyup", v), t("cart-modal-closed", { type: s });
|
|
60
60
|
};
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
v = (s) => {
|
|
62
|
+
s && s.key === "Escape" && !r.value && a();
|
|
63
63
|
};
|
|
64
|
-
const
|
|
65
|
-
|
|
64
|
+
const A = () => {
|
|
65
|
+
r.value || a("background");
|
|
66
66
|
}, f = () => {
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
e.value && (document.addEventListener("keyup", v), q(() => {
|
|
68
|
+
c.value && l.value && (T(), u = J(c.value), Y(l.value)), W();
|
|
69
69
|
}));
|
|
70
|
-
},
|
|
71
|
-
s
|
|
70
|
+
}, N = (s) => {
|
|
71
|
+
a(s);
|
|
72
72
|
}, p = () => {
|
|
73
|
-
|
|
73
|
+
r.value || (n.value = setTimeout(() => {
|
|
74
74
|
t("cart-modal-closed", { type: "time" });
|
|
75
75
|
}, 1e4));
|
|
76
|
-
},
|
|
77
|
-
|
|
76
|
+
}, V = () => {
|
|
77
|
+
r.value || clearTimeout(n.value);
|
|
78
78
|
};
|
|
79
|
-
return
|
|
80
|
-
|
|
81
|
-
}),
|
|
82
|
-
|
|
83
|
-
}),
|
|
84
|
-
mdiClose:
|
|
85
|
-
mdiCheckCircle:
|
|
86
|
-
onKeyUp:
|
|
87
|
-
onScreenClick:
|
|
88
|
-
hide:
|
|
79
|
+
return K(e, () => {
|
|
80
|
+
e.value ? (f(), p()) : a();
|
|
81
|
+
}), F(() => {
|
|
82
|
+
e.value && (f(), p());
|
|
83
|
+
}), P(() => a()), {
|
|
84
|
+
mdiClose: z,
|
|
85
|
+
mdiCheckCircle: G,
|
|
86
|
+
onKeyUp: v,
|
|
87
|
+
onScreenClick: A,
|
|
88
|
+
hide: a,
|
|
89
89
|
show: f,
|
|
90
|
-
controlsRef:
|
|
91
|
-
handleClick:
|
|
92
|
-
clearAutomaticClose:
|
|
93
|
-
setAutomaticClose: p
|
|
90
|
+
controlsRef: m,
|
|
91
|
+
handleClick: N,
|
|
92
|
+
clearAutomaticClose: V,
|
|
93
|
+
setAutomaticClose: p,
|
|
94
|
+
showContentSlot: B
|
|
94
95
|
};
|
|
95
96
|
}
|
|
96
|
-
},
|
|
97
|
+
}, ot = { class: "container" }, lt = { class: "tw-flex tw-pt-2 tw-px-2.5" }, nt = { class: "tw-flex tw-flex-grow tw-gap-1 tw-items-center tw-pb-2" }, at = {
|
|
98
|
+
key: 0,
|
|
97
99
|
id: "kvCartModalBody",
|
|
98
100
|
ref: "kvCartModalBody",
|
|
99
|
-
class: "
|
|
100
|
-
},
|
|
101
|
+
class: "tw-flex tw-gap-2 tw-mx-2.5 tw-border-t tw-border-tertiary tw-py-2"
|
|
102
|
+
}, st = {
|
|
101
103
|
ref: "controlsRef",
|
|
102
104
|
class: "tw-flex-shrink-0 tw-flex tw-justify-end tw-gap-x-2.5 tw-px-2.5 tw-pb-2 tw-flex-col tw-gap-1"
|
|
103
105
|
};
|
|
104
|
-
function
|
|
105
|
-
const
|
|
106
|
-
return
|
|
106
|
+
function it(d, t, i, e, r, c) {
|
|
107
|
+
const l = x("kv-material-icon"), m = x("kv-button");
|
|
108
|
+
return k(), R(j, {
|
|
107
109
|
"enter-active-class": "tw-transition-opacity tw-duration-300",
|
|
108
110
|
"leave-active-class": "tw-transition-opacity tw-duration-300",
|
|
109
111
|
"enter-class": "tw-opacity-0",
|
|
@@ -111,13 +113,13 @@ function at(c, t, l, e, r, a) {
|
|
|
111
113
|
"leave-class": "tw-opacity-full",
|
|
112
114
|
"leave-to-class": "tw-opacity-0"
|
|
113
115
|
}, {
|
|
114
|
-
default:
|
|
115
|
-
|
|
116
|
+
default: h(() => [
|
|
117
|
+
D(o("div", {
|
|
116
118
|
class: "screen",
|
|
117
|
-
onClick: t[5] || (t[5] =
|
|
119
|
+
onClick: t[5] || (t[5] = C((...n) => e.onScreenClick && e.onScreenClick(...n), ["stop", "prevent"]))
|
|
118
120
|
}, [
|
|
119
121
|
o("div", null, [
|
|
120
|
-
o("div",
|
|
122
|
+
o("div", ot, [
|
|
121
123
|
o("div", {
|
|
122
124
|
ref: "kvCartModal",
|
|
123
125
|
tabindex: "-1",
|
|
@@ -125,26 +127,26 @@ function at(c, t, l, e, r, a) {
|
|
|
125
127
|
class: "modal",
|
|
126
128
|
"aria-modal": "true",
|
|
127
129
|
"aria-label": "Added to basket",
|
|
128
|
-
onClick: t[2] || (t[2] =
|
|
130
|
+
onClick: t[2] || (t[2] = C(() => {
|
|
129
131
|
}, ["stop"])),
|
|
130
132
|
onMouseenter: t[3] || (t[3] = (n) => e.clearAutomaticClose()),
|
|
131
133
|
onMouseleave: t[4] || (t[4] = (n) => e.setAutomaticClose())
|
|
132
134
|
}, [
|
|
133
|
-
o("div",
|
|
134
|
-
o("div",
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
o("div", lt, [
|
|
136
|
+
o("div", nt, [
|
|
137
|
+
g(d.$slots, "header", {}, () => [
|
|
138
|
+
y(l, {
|
|
137
139
|
class: "tw-w-3.5 tw-h-3.5 tw-text-brand",
|
|
138
140
|
icon: e.mdiCheckCircle
|
|
139
141
|
}, null, 8, ["icon"]),
|
|
140
142
|
t[6] || (t[6] = o("p", { class: "tw-flex-1 tw-font-medium tw-text-center" }, " Added to basket ", -1))
|
|
141
143
|
], !0),
|
|
142
|
-
|
|
144
|
+
i.preventClose ? M("", !0) : (k(), S("button", {
|
|
143
145
|
key: 0,
|
|
144
146
|
class: "tw-grid tw-content-center tw-justify-center tw-ml-auto tw-w-6 tw-h-6 tw--m-2 hover:tw-text-action-highlight",
|
|
145
|
-
onClick: t[0] || (t[0] =
|
|
147
|
+
onClick: t[0] || (t[0] = C((n) => e.hide("x-button"), ["stop"]))
|
|
146
148
|
}, [
|
|
147
|
-
|
|
149
|
+
y(l, {
|
|
148
150
|
class: "tw-w-3.5 tw-h-3.5",
|
|
149
151
|
icon: e.mdiClose
|
|
150
152
|
}, null, 8, ["icon"]),
|
|
@@ -152,16 +154,16 @@ function at(c, t, l, e, r, a) {
|
|
|
152
154
|
]))
|
|
153
155
|
])
|
|
154
156
|
]),
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
], 512),
|
|
158
|
-
o("div",
|
|
159
|
-
|
|
157
|
+
e.showContentSlot ? (k(), S("div", at, [
|
|
158
|
+
g(d.$slots, "content", {}, void 0, !0)
|
|
159
|
+
], 512)) : M("", !0),
|
|
160
|
+
o("div", st, [
|
|
161
|
+
y(m, {
|
|
160
162
|
class: "tw-w-full",
|
|
161
163
|
onClick: t[1] || (t[1] = (n) => e.handleClick("view-basket"))
|
|
162
164
|
}, {
|
|
163
|
-
default:
|
|
164
|
-
|
|
165
|
+
default: h(() => [
|
|
166
|
+
L(" View basket (" + O(i.basketCount) + ") ", 1)
|
|
165
167
|
]),
|
|
166
168
|
_: 1
|
|
167
169
|
})
|
|
@@ -170,13 +172,13 @@ function at(c, t, l, e, r, a) {
|
|
|
170
172
|
])
|
|
171
173
|
])
|
|
172
174
|
], 512), [
|
|
173
|
-
[
|
|
175
|
+
[U, i.visible]
|
|
174
176
|
])
|
|
175
177
|
]),
|
|
176
178
|
_: 3
|
|
177
179
|
});
|
|
178
180
|
}
|
|
179
|
-
const
|
|
181
|
+
const Ct = /* @__PURE__ */ tt(et, [["render", it], ["__scopeId", "data-v-b40bef0e"]]);
|
|
180
182
|
export {
|
|
181
|
-
|
|
183
|
+
Ct as default
|
|
182
184
|
};
|
package/dist/vue/KvCartPill.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { toRefs as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { toRefs as n, computed as a, openBlock as i, createElementBlock as p, normalizeClass as u, renderSlot as c, createElementVNode as m, toDisplayString as f } from "vue";
|
|
2
|
+
import w from "../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
const d = {
|
|
4
4
|
props: {
|
|
5
5
|
borrowerName: {
|
|
6
6
|
type: String,
|
|
@@ -9,28 +9,43 @@ const u = {
|
|
|
9
9
|
showBg: {
|
|
10
10
|
type: Boolean,
|
|
11
11
|
default: !1
|
|
12
|
+
},
|
|
13
|
+
milestonesNumber: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: 1
|
|
16
|
+
},
|
|
17
|
+
isCloseNextMilestone: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: !1
|
|
12
20
|
}
|
|
13
21
|
},
|
|
14
22
|
setup(t) {
|
|
15
23
|
const {
|
|
16
|
-
borrowerName:
|
|
17
|
-
|
|
24
|
+
borrowerName: o,
|
|
25
|
+
milestonesNumber: e,
|
|
26
|
+
isCloseNextMilestone: l
|
|
27
|
+
} = n(t);
|
|
18
28
|
return {
|
|
19
|
-
pillCopy:
|
|
29
|
+
pillCopy: a(() => {
|
|
30
|
+
if (l.value)
|
|
31
|
+
return "You’re close to your next milestone!";
|
|
32
|
+
const s = e.value > 1 ? `${e.value} of your milestones` : "your next milestone";
|
|
33
|
+
return o.value ? `Supporting ${o.value} will hit ${s}!` : "Supporting this loan achieves a milestone!";
|
|
34
|
+
})
|
|
20
35
|
};
|
|
21
36
|
}
|
|
22
|
-
},
|
|
23
|
-
function
|
|
24
|
-
return
|
|
25
|
-
class:
|
|
26
|
-
"tw-text-small tw-bg-secondary":
|
|
37
|
+
}, y = { class: "tw-text-wrap" };
|
|
38
|
+
function x(t, o, e, l, r, s) {
|
|
39
|
+
return i(), p("div", {
|
|
40
|
+
class: u(["tw-w-max tw-flex tw-items-center tw-gap-1 tw-px-1 tw-py-0.5 tw-rounded", {
|
|
41
|
+
"tw-text-small tw-bg-secondary": e.showBg
|
|
27
42
|
}])
|
|
28
43
|
}, [
|
|
29
|
-
|
|
30
|
-
|
|
44
|
+
c(t.$slots, "icon"),
|
|
45
|
+
m("p", y, f(l.pillCopy), 1)
|
|
31
46
|
], 2);
|
|
32
47
|
}
|
|
33
|
-
const
|
|
48
|
+
const v = /* @__PURE__ */ w(d, [["render", x]]);
|
|
34
49
|
export {
|
|
35
|
-
|
|
50
|
+
v as default
|
|
36
51
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.1",
|
|
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": "c48711e01a00c355cafbf20f47114c3d2716d2d0"
|
|
111
111
|
}
|