@kiva/kv-components 6.22.1 → 6.23.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/KvLendCta.css +1 -1
- package/dist/vue/KvLendCta.js +23 -22
- package/dist/vue/KvSideSheet.js +134 -168
- package/package.json +2 -2
package/dist/vue/KvLendCta.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.amountDropdownWrapper[data-v-
|
|
1
|
+
.amountDropdownWrapper[data-v-3b66ed0d] select{border-radius:14px 0 0 14px}.lend-again[data-v-3b66ed0d] span{padding-left:0;padding-right:0;padding-left:.5rem;padding-right:.5rem}.lendButtonWrapper[data-v-3b66ed0d] span:first-child{border-radius:0 14px 14px 0}.filtered-dropdown[data-v-3b66ed0d] select{cursor:pointer;border-radius:.875rem;border-width:2px;font-weight:500}.unselected-dropdown[data-v-3b66ed0d] select{--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.preset-option[data-v-3b66ed0d] span.tw-w-full:first-child{border-width:2px;--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.selected-dropdown[data-v-3b66ed0d] select,.selected-option[data-v-3b66ed0d] span.tw-w-full:first-child{--tw-border-opacity: 1;border-color:rgba(var(--border-action),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--bg-secondary),var(--tw-bg-opacity, 1))}.button-ellipsis[data-v-3b66ed0d] span>span{min-width:0;overflow:hidden;text-overflow:ellipsis}
|
package/dist/vue/KvLendCta.js
CHANGED
|
@@ -6,7 +6,7 @@ import S from "./KvSelect.js";
|
|
|
6
6
|
import F from "./KvButton.js";
|
|
7
7
|
import I from "./KvMaterialIcon.js";
|
|
8
8
|
import N from "./KvCartPill.js";
|
|
9
|
-
import { resolveComponent as A, openBlock as i, createElementBlock as
|
|
9
|
+
import { resolveComponent as A, openBlock as i, createElementBlock as l, createBlock as a, withCtx as r, createElementVNode as u, createCommentVNode as d, normalizeClass as h, createTextVNode as f, toDisplayString as w, createVNode as V, withModifiers as p, Fragment as L, renderList as g } from "vue";
|
|
10
10
|
import "./KvLendCta.css";
|
|
11
11
|
import O from "../_virtual/_plugin-vue_export-helper.js";
|
|
12
12
|
const k = "Other", ot = C`
|
|
@@ -358,13 +358,13 @@ const k = "Other", ot = C`
|
|
|
358
358
|
}, z = ["value"];
|
|
359
359
|
function q(t, n, s, y, c, e) {
|
|
360
360
|
const b = A("kv-cart-pill"), m = A("kv-ui-button"), x = A("kv-material-icon"), v = A("kv-ui-select"), T = A("kv-lend-amount-button");
|
|
361
|
-
return i(),
|
|
361
|
+
return i(), l("div", H, [
|
|
362
362
|
s.showPill && s.showPresetAmounts ? (i(), a(b, {
|
|
363
363
|
key: 0,
|
|
364
364
|
"borrower-name": e.loanName,
|
|
365
365
|
class: "!tw-w-full tw-justify-center tw-pb-2"
|
|
366
366
|
}, {
|
|
367
|
-
icon:
|
|
367
|
+
icon: r(() => n[5] || (n[5] = [
|
|
368
368
|
u("svg", {
|
|
369
369
|
xmlns: "http://www.w3.org/2000/svg",
|
|
370
370
|
width: "25",
|
|
@@ -408,7 +408,7 @@ function q(t, n, s, y, c, e) {
|
|
|
408
408
|
href: s.externalLinks ? "/basket" : void 0,
|
|
409
409
|
onClick: n[0] || (n[0] = (o) => e.clickSecondaryButton(o))
|
|
410
410
|
}, {
|
|
411
|
-
default:
|
|
411
|
+
default: r(() => [
|
|
412
412
|
f(w(e.loanInBasketButtonText), 1)
|
|
413
413
|
]),
|
|
414
414
|
_: 1
|
|
@@ -416,11 +416,11 @@ function q(t, n, s, y, c, e) {
|
|
|
416
416
|
key: 2,
|
|
417
417
|
class: "tw-inline-flex tw-flex-1"
|
|
418
418
|
}, {
|
|
419
|
-
default:
|
|
419
|
+
default: r(() => [
|
|
420
420
|
f(w(e.ctaButtonText), 1)
|
|
421
421
|
]),
|
|
422
422
|
_: 1
|
|
423
|
-
})) : e.isFunded ? (i(),
|
|
423
|
+
})) : e.isFunded ? (i(), l("div", K, " This loan was just funded! 🎉 ")) : s.showViewLoan ? (i(), a(m, {
|
|
424
424
|
key: 4,
|
|
425
425
|
state: `${e.allSharesReserved ? "disabled" : ""}`,
|
|
426
426
|
to: s.externalLinks ? void 0 : e.readMorePath,
|
|
@@ -428,7 +428,7 @@ function q(t, n, s, y, c, e) {
|
|
|
428
428
|
class: "tw-mb-0",
|
|
429
429
|
onClick: n[1] || (n[1] = (o) => t.$emit("show-loan-details", o))
|
|
430
430
|
}, {
|
|
431
|
-
default:
|
|
431
|
+
default: r(() => [
|
|
432
432
|
u("span", R, [
|
|
433
433
|
n[6] || (n[6] = f(" View loan ")),
|
|
434
434
|
V(x, {
|
|
@@ -438,31 +438,31 @@ function q(t, n, s, y, c, e) {
|
|
|
438
438
|
])
|
|
439
439
|
]),
|
|
440
440
|
_: 1
|
|
441
|
-
}, 8, ["state", "to", "href"])) : e.useFormSubmit ? (i(),
|
|
441
|
+
}, 8, ["state", "to", "href"])) : e.useFormSubmit ? (i(), l("form", {
|
|
442
442
|
key: 5,
|
|
443
443
|
class: "tw-w-full tw-flex",
|
|
444
444
|
onSubmit: n[4] || (n[4] = p((...o) => e.addToBasket && e.addToBasket(...o), ["prevent"]))
|
|
445
445
|
}, [
|
|
446
446
|
u("fieldset", {
|
|
447
447
|
class: h(["tw-w-full tw-flex", {
|
|
448
|
-
"tw-flex-col md:tw-flex-row md:tw-justify-between": s.showPresetAmounts,
|
|
448
|
+
"tw-flex-col md:tw-flex-row md:tw-justify-between tw-min-w-0": s.showPresetAmounts,
|
|
449
449
|
"tw-gap-1.5": s.showPresetAmounts && !e.isLendAmountButton
|
|
450
450
|
}]),
|
|
451
451
|
disabled: s.isAdding,
|
|
452
452
|
"data-testid": "bp-lend-cta-select-and-button"
|
|
453
453
|
}, [
|
|
454
|
-
s.showPresetAmounts && !s.isAdding ? (i(),
|
|
454
|
+
s.showPresetAmounts && !s.isAdding ? (i(), l("div", {
|
|
455
455
|
key: 0,
|
|
456
456
|
class: h(["tw-flex tw-gap-1 lg:tw-gap-2", { "tw-flex-wrap md:tw-flex-nowrap": s.enableHugeAmount }])
|
|
457
457
|
}, [
|
|
458
|
-
e.isLendAmountButton ? d("", !0) : (i(!0),
|
|
458
|
+
e.isLendAmountButton ? d("", !0) : (i(!0), l(L, { key: 0 }, g(e.presetButtonsPrices, (o) => (i(), a(m, {
|
|
459
459
|
key: o,
|
|
460
460
|
variant: "secondary",
|
|
461
461
|
class: h(["tw-inline-flex tw-flex-1 preset-option tw-w-8", { "selected-option": c.selectedOption == o }]),
|
|
462
462
|
"data-testid": "bp-lend-cta-lend-button",
|
|
463
463
|
onClick: (Z) => e.clickPresetButton(o)
|
|
464
464
|
}, {
|
|
465
|
-
default:
|
|
465
|
+
default: r(() => [
|
|
466
466
|
f(" $" + w(o), 1)
|
|
467
467
|
]),
|
|
468
468
|
_: 2
|
|
@@ -483,15 +483,15 @@ function q(t, n, s, y, c, e) {
|
|
|
483
483
|
"aria-label": "Lend amount",
|
|
484
484
|
onClick: p(e.clickDropdown, ["stop"])
|
|
485
485
|
}, {
|
|
486
|
-
default:
|
|
487
|
-
(i(!0),
|
|
486
|
+
default: r(() => [
|
|
487
|
+
(i(!0), l(L, null, g(e.presetDropdownPrices, (o) => (i(), l("option", {
|
|
488
488
|
key: o,
|
|
489
489
|
value: o
|
|
490
490
|
}, w(o !== c.OTHER_OPTION ? `$${o}` : o), 9, E))), 128))
|
|
491
491
|
]),
|
|
492
492
|
_: 1
|
|
493
493
|
}, 8, ["id", "modelValue", "class", "onUpdate:modelValue", "onClick"])) : d("", !0)
|
|
494
|
-
], 2)) : s.showPresetAmounts ? d("", !0) : (i(),
|
|
494
|
+
], 2)) : s.showPresetAmounts ? d("", !0) : (i(), l("div", j, [
|
|
495
495
|
e.hideShowLendDropdown && !e.isLessThan25 ? (i(), a(v, {
|
|
496
496
|
key: 0,
|
|
497
497
|
id: `LoanAmountDropdown_${e.loanId}`,
|
|
@@ -505,8 +505,8 @@ function q(t, n, s, y, c, e) {
|
|
|
505
505
|
"aria-label": "Lend amount",
|
|
506
506
|
onClick: p(e.clickDropdown, ["stop"])
|
|
507
507
|
}, {
|
|
508
|
-
default:
|
|
509
|
-
(i(!0),
|
|
508
|
+
default: r(() => [
|
|
509
|
+
(i(!0), l(L, null, g(e.prices, (o) => (i(), l("option", {
|
|
510
510
|
key: o,
|
|
511
511
|
value: o
|
|
512
512
|
}, " $" + w(o), 9, z))), 128))
|
|
@@ -516,17 +516,18 @@ function q(t, n, s, y, c, e) {
|
|
|
516
516
|
])),
|
|
517
517
|
u("div", {
|
|
518
518
|
class: h({
|
|
519
|
+
"tw-min-w-0": s.showPresetAmounts,
|
|
519
520
|
lendButtonWrapper: e.hideShowLendDropdown && !s.showPresetAmounts,
|
|
520
521
|
"tw-hidden": e.hideLendButton
|
|
521
522
|
})
|
|
522
523
|
}, [
|
|
523
524
|
e.lendButtonVisibility && !e.isLessThan25 ? (i(), a(m, {
|
|
524
525
|
key: "lendButton",
|
|
525
|
-
class: h(["tw-inline-flex tw-flex-1", { "tw-w-full": s.showPresetAmounts }]),
|
|
526
|
+
class: h(["tw-inline-flex tw-flex-1", { "button-ellipsis tw-w-full": s.showPresetAmounts }]),
|
|
526
527
|
"data-testid": "bp-lend-cta-lend-button",
|
|
527
528
|
type: "submit"
|
|
528
529
|
}, {
|
|
529
|
-
default:
|
|
530
|
+
default: r(() => [
|
|
530
531
|
f(w(e.ctaButtonText), 1)
|
|
531
532
|
]),
|
|
532
533
|
_: 1
|
|
@@ -536,7 +537,7 @@ function q(t, n, s, y, c, e) {
|
|
|
536
537
|
"data-testid": "bp-lend-cta-lend-again-button",
|
|
537
538
|
type: "submit"
|
|
538
539
|
}, {
|
|
539
|
-
default:
|
|
540
|
+
default: r(() => [
|
|
540
541
|
f(w(s.primaryButtonText || "Lend") + " again ", 1)
|
|
541
542
|
]),
|
|
542
543
|
_: 1
|
|
@@ -555,7 +556,7 @@ function q(t, n, s, y, c, e) {
|
|
|
555
556
|
key: 3,
|
|
556
557
|
class: "tw-inline-flex tw-flex-1"
|
|
557
558
|
}, {
|
|
558
|
-
default:
|
|
559
|
+
default: r(() => n[7] || (n[7] = [
|
|
559
560
|
f(" Adding to basket ")
|
|
560
561
|
])),
|
|
561
562
|
_: 1
|
|
@@ -564,7 +565,7 @@ function q(t, n, s, y, c, e) {
|
|
|
564
565
|
], 32)) : d("", !0)
|
|
565
566
|
]);
|
|
566
567
|
}
|
|
567
|
-
const at = /* @__PURE__ */ O(M, [["render", q], ["__scopeId", "data-v-
|
|
568
|
+
const at = /* @__PURE__ */ O(M, [["render", q], ["__scopeId", "data-v-3b66ed0d"]]);
|
|
568
569
|
export {
|
|
569
570
|
ot as KV_LEND_CTA_FRAGMENT,
|
|
570
571
|
it as KV_LEND_CTA_USER_FRAGMENT,
|
package/dist/vue/KvSideSheet.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { toRefs as
|
|
2
|
-
import { mdiArrowLeft as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { toRefs as q, ref as w, reactive as J, computed as L, onMounted as P, onUnmounted as B, watch as y, resolveComponent as Q, openBlock as g, createElementBlock as p, normalizeClass as k, withModifiers as X, createElementVNode as c, normalizeStyle as j, createVNode as O, createCommentVNode as b, toDisplayString as Y, renderSlot as F, nextTick as Z } from "vue";
|
|
2
|
+
import { mdiArrowLeft as $, mdiClose as ee, mdiExportVariant as te } from "@mdi/js";
|
|
3
|
+
import oe from "./KvMaterialIcon.js";
|
|
4
|
+
import ne from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const ie = {
|
|
6
6
|
name: "KvSideSheet",
|
|
7
7
|
components: {
|
|
8
|
-
KvMaterialIcon:
|
|
8
|
+
KvMaterialIcon: oe
|
|
9
9
|
},
|
|
10
10
|
props: {
|
|
11
11
|
/**
|
|
@@ -50,13 +50,6 @@ const ae = {
|
|
|
50
50
|
type: String,
|
|
51
51
|
default: ""
|
|
52
52
|
},
|
|
53
|
-
/**
|
|
54
|
-
* Source element position for expand animation
|
|
55
|
-
* */
|
|
56
|
-
animationSourceElement: {
|
|
57
|
-
type: Object,
|
|
58
|
-
default: () => ({})
|
|
59
|
-
},
|
|
60
53
|
/**
|
|
61
54
|
* The headline of the side sheet
|
|
62
55
|
* */
|
|
@@ -72,275 +65,248 @@ const ae = {
|
|
|
72
65
|
widthDimensions: {
|
|
73
66
|
type: [String, Object],
|
|
74
67
|
default: () => ({ default: "100%", md: "50%" }),
|
|
75
|
-
validator: (
|
|
68
|
+
validator: (i) => typeof i == "string" ? /^(\d+px|[\d.]+%|auto|inherit|initial)$/.test(i) : typeof i == "object" ? Object.keys(i).every((l) => ["default", "sm", "md", "lg", "xl", "2xl"].includes(l) && /^(\d+px|[\d.]+%|auto|inherit|initial)$/.test(i[l])) : !1
|
|
76
69
|
}
|
|
77
70
|
},
|
|
78
71
|
emits: ["side-sheet-closed", "go-to-link"],
|
|
79
|
-
setup(
|
|
72
|
+
setup(i, { emit: l, slots: s }) {
|
|
80
73
|
const {
|
|
81
74
|
visible: t,
|
|
82
|
-
kvTrackFunction:
|
|
83
|
-
trackEventCategory:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
} = J(l), u = w(!1), B = w({}), s = w({}), L = w(null), m = w(null), y = w(null), M = w(window.innerHeight), D = w(window.innerWidth), v = P({
|
|
75
|
+
kvTrackFunction: H,
|
|
76
|
+
trackEventCategory: z,
|
|
77
|
+
widthDimensions: a
|
|
78
|
+
} = q(i), o = w(!1), r = w({}), C = w(null), v = w(null), m = w(null), W = w(window.innerHeight), _ = w(window.innerWidth), f = J({
|
|
87
79
|
headline: 0,
|
|
88
80
|
controls: 0
|
|
89
|
-
}),
|
|
90
|
-
const e =
|
|
81
|
+
}), I = L(() => {
|
|
82
|
+
const e = W.value - f.headline - f.controls;
|
|
91
83
|
return Math.max(e, 0);
|
|
92
|
-
}),
|
|
93
|
-
if (typeof
|
|
94
|
-
return
|
|
84
|
+
}), V = L(() => {
|
|
85
|
+
if (typeof a.value == "string")
|
|
86
|
+
return a.value;
|
|
95
87
|
const e = {
|
|
96
88
|
sm: 640,
|
|
97
89
|
md: 768,
|
|
98
90
|
lg: 1024,
|
|
99
91
|
xl: 1280,
|
|
100
92
|
"2xl": 1536
|
|
101
|
-
}, n =
|
|
102
|
-
return
|
|
103
|
-
}),
|
|
104
|
-
let
|
|
93
|
+
}, n = _.value || window.innerWidth, u = Object.keys(a.value).filter((d) => d !== "default").sort((d, R) => e[R] - e[d]).find((d) => n >= e[d]);
|
|
94
|
+
return u ? a.value[u] : a.value.default || "100%";
|
|
95
|
+
}), N = (e, n) => {
|
|
96
|
+
let u;
|
|
105
97
|
return (...d) => {
|
|
106
|
-
clearTimeout(
|
|
98
|
+
clearTimeout(u), u = setTimeout(() => e(...d), n);
|
|
107
99
|
};
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
|
|
100
|
+
}, x = () => {
|
|
101
|
+
W.value = window.innerHeight, _.value = window.innerWidth, setTimeout(() => {
|
|
102
|
+
Z(() => {
|
|
111
103
|
var e;
|
|
112
|
-
if (
|
|
113
|
-
const n = y.value.getBoundingClientRect();
|
|
114
|
-
v.headline = n.height;
|
|
115
|
-
} else
|
|
116
|
-
v.headline = 0;
|
|
117
|
-
if ((e = r.controls) != null && e.call(r) && m.value) {
|
|
104
|
+
if (m.value) {
|
|
118
105
|
const n = m.value.getBoundingClientRect();
|
|
119
|
-
|
|
106
|
+
f.headline = n.height;
|
|
107
|
+
} else
|
|
108
|
+
f.headline = 0;
|
|
109
|
+
if ((e = s.controls) != null && e.call(s) && v.value) {
|
|
110
|
+
const n = v.value.getBoundingClientRect();
|
|
111
|
+
f.controls = n.height;
|
|
120
112
|
} else
|
|
121
|
-
|
|
113
|
+
f.controls = 0;
|
|
122
114
|
});
|
|
123
115
|
}, 300);
|
|
124
|
-
},
|
|
116
|
+
}, S = N(x, 100), E = () => {
|
|
125
117
|
const e = "tw-overflow-hidden";
|
|
126
|
-
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}, 300), document.removeEventListener("keyup",
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
(e == null ? void 0 : e.key) === "Escape" &&
|
|
118
|
+
o.value ? document.body.classList.add(e) : document.body.classList.remove(e);
|
|
119
|
+
}, K = () => {
|
|
120
|
+
o.value = !1, E(), H.value(z.value, "click", "side-sheet-closed"), setTimeout(() => {
|
|
121
|
+
l("side-sheet-closed");
|
|
122
|
+
}, 300), document.removeEventListener("keyup", T);
|
|
123
|
+
}, U = () => {
|
|
124
|
+
l("go-to-link");
|
|
125
|
+
}, T = (e) => {
|
|
126
|
+
(e == null ? void 0 : e.key) === "Escape" && K();
|
|
135
127
|
};
|
|
136
|
-
|
|
128
|
+
P(() => {
|
|
137
129
|
if (setTimeout(() => {
|
|
138
|
-
|
|
139
|
-
}, 100),
|
|
140
|
-
const e = new ResizeObserver(
|
|
141
|
-
e.observe(
|
|
130
|
+
x();
|
|
131
|
+
}, 100), v.value) {
|
|
132
|
+
const e = new ResizeObserver(S);
|
|
133
|
+
e.observe(v.value), B(() => e.disconnect());
|
|
142
134
|
}
|
|
143
|
-
if (
|
|
144
|
-
const e = new ResizeObserver(
|
|
145
|
-
e.observe(
|
|
135
|
+
if (m.value) {
|
|
136
|
+
const e = new ResizeObserver(S);
|
|
137
|
+
e.observe(m.value), B(() => e.disconnect());
|
|
146
138
|
}
|
|
147
|
-
window.addEventListener("resize",
|
|
148
|
-
}),
|
|
139
|
+
window.addEventListener("resize", S), B(() => window.removeEventListener("resize", S));
|
|
140
|
+
}), y(() => {
|
|
149
141
|
var e;
|
|
150
|
-
return (e =
|
|
142
|
+
return (e = s.controls) == null ? void 0 : e.call(s);
|
|
151
143
|
}, () => {
|
|
152
144
|
setTimeout(() => {
|
|
153
|
-
|
|
145
|
+
x();
|
|
154
146
|
}, 100);
|
|
155
147
|
}, { deep: !0, immediate: !0 });
|
|
156
|
-
const
|
|
157
|
-
width:
|
|
148
|
+
const A = L(() => ({
|
|
149
|
+
width: V.value
|
|
158
150
|
}));
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
o && (d || g || c || R) && (B.value = {
|
|
167
|
-
position: "fixed",
|
|
168
|
-
top: `${d}px`,
|
|
169
|
-
width: `${c}px`,
|
|
170
|
-
height: `${R}px`,
|
|
171
|
-
transform: `translateX(${C.value})`
|
|
172
|
-
}, s.value = {
|
|
173
|
-
...B.value,
|
|
174
|
-
transition: "none"
|
|
175
|
-
}, setTimeout(() => {
|
|
176
|
-
s.value = {
|
|
177
|
-
top: "0",
|
|
178
|
-
width: C.value,
|
|
179
|
-
height: "100%",
|
|
180
|
-
transform: "translateX(0)",
|
|
181
|
-
transition: "all 0.3s ease-in-out"
|
|
182
|
-
};
|
|
183
|
-
}, 10));
|
|
184
|
-
} else
|
|
185
|
-
u.value = !1, O(), document.removeEventListener("keyup", H), f.value && Object.keys(B.value).length > 0 ? s.value = {
|
|
186
|
-
...B.value,
|
|
187
|
-
transition: "all 0.3s ease-in-out"
|
|
188
|
-
} : s.value = {};
|
|
189
|
-
}, { immediate: !0 }), p(C, (e) => {
|
|
190
|
-
u.value && t.value && s.value && Object.keys(s.value).length > 0 && (s.value = {
|
|
191
|
-
...s.value,
|
|
151
|
+
y(t, (e) => {
|
|
152
|
+
e ? (document.addEventListener("keyup", T), r.value = {}, setTimeout(() => {
|
|
153
|
+
o.value = !0, E(), x();
|
|
154
|
+
}, 10)) : (o.value = !1, E(), document.removeEventListener("keyup", T), r.value = {});
|
|
155
|
+
}, { immediate: !0 }), y(V, (e) => {
|
|
156
|
+
o.value && t.value && r.value && Object.keys(r.value).length > 0 && (r.value = {
|
|
157
|
+
...r.value,
|
|
192
158
|
width: e,
|
|
193
159
|
transition: "none"
|
|
194
160
|
// No animation for resize
|
|
195
161
|
}, setTimeout(() => {
|
|
196
|
-
|
|
197
|
-
...
|
|
162
|
+
r.value && Object.keys(r.value).length > 0 && (r.value = {
|
|
163
|
+
...r.value,
|
|
198
164
|
transition: "all 0.3s ease-in-out"
|
|
199
165
|
});
|
|
200
166
|
}, 50));
|
|
201
167
|
});
|
|
202
|
-
const
|
|
203
|
-
if (typeof
|
|
168
|
+
const M = () => {
|
|
169
|
+
if (typeof a.value == "object" && C.value) {
|
|
204
170
|
const e = "side-sheet-styles";
|
|
205
171
|
let n = document.getElementById(e);
|
|
206
172
|
n || (n = document.createElement("style"), n.id = e, document.head.appendChild(n));
|
|
207
|
-
const
|
|
173
|
+
const u = {
|
|
208
174
|
sm: "640px",
|
|
209
175
|
md: "768px",
|
|
210
176
|
lg: "1024px",
|
|
211
177
|
xl: "1280px",
|
|
212
178
|
"2xl": "1536px"
|
|
213
|
-
},
|
|
214
|
-
const
|
|
215
|
-
return
|
|
216
|
-
}).map((
|
|
217
|
-
@media (min-width: ${
|
|
218
|
-
#side-sheet-${
|
|
219
|
-
width: ${
|
|
179
|
+
}, R = Object.keys(a.value).filter((h) => h !== "default").sort((h, G) => {
|
|
180
|
+
const D = ["sm", "md", "lg", "xl", "2xl"];
|
|
181
|
+
return D.indexOf(h) - D.indexOf(G);
|
|
182
|
+
}).map((h) => `
|
|
183
|
+
@media (min-width: ${u[h]}) {
|
|
184
|
+
#side-sheet-${i.trackEventCategory || "default"} {
|
|
185
|
+
width: ${a.value[h]} !important;
|
|
220
186
|
}
|
|
221
187
|
}
|
|
222
188
|
`).join("");
|
|
223
|
-
n.textContent =
|
|
189
|
+
n.textContent = R, C.value.id = `side-sheet-${i.trackEventCategory || "default"}`, B(() => {
|
|
224
190
|
n && n.remove();
|
|
225
191
|
});
|
|
226
192
|
}
|
|
227
193
|
};
|
|
228
|
-
return
|
|
229
|
-
|
|
230
|
-
}, { immediate: !0 }),
|
|
231
|
-
e &&
|
|
194
|
+
return y(a, () => {
|
|
195
|
+
o.value && M();
|
|
196
|
+
}, { immediate: !0 }), y(o, (e) => {
|
|
197
|
+
e && M();
|
|
232
198
|
}), {
|
|
233
|
-
closeSideSheet:
|
|
234
|
-
contentHeight:
|
|
235
|
-
controlsRef:
|
|
236
|
-
headlineRef:
|
|
237
|
-
sideSheetRef:
|
|
238
|
-
sideSheetStyles:
|
|
239
|
-
goToLink:
|
|
240
|
-
mdiArrowLeft:
|
|
241
|
-
mdiClose:
|
|
242
|
-
mdiExportVariant:
|
|
243
|
-
modalStyles:
|
|
244
|
-
open:
|
|
199
|
+
closeSideSheet: K,
|
|
200
|
+
contentHeight: I,
|
|
201
|
+
controlsRef: v,
|
|
202
|
+
headlineRef: m,
|
|
203
|
+
sideSheetRef: C,
|
|
204
|
+
sideSheetStyles: A,
|
|
205
|
+
goToLink: U,
|
|
206
|
+
mdiArrowLeft: $,
|
|
207
|
+
mdiClose: ee,
|
|
208
|
+
mdiExportVariant: te,
|
|
209
|
+
modalStyles: r,
|
|
210
|
+
open: o
|
|
245
211
|
};
|
|
246
212
|
}
|
|
247
|
-
},
|
|
248
|
-
function
|
|
249
|
-
const
|
|
250
|
-
return
|
|
213
|
+
}, le = { class: "tw-flex tw-gap-1.5" }, se = { key: 1 }, ae = { class: "tw-flex tw-gap-1.5" };
|
|
214
|
+
function re(i, l, s, t, H, z) {
|
|
215
|
+
const a = Q("kv-material-icon");
|
|
216
|
+
return s.visible ? (g(), p("div", {
|
|
251
217
|
key: 0,
|
|
252
|
-
class:
|
|
218
|
+
class: k(["tw-block lg:tw-mt-0 tw-fixed tw-inset-0 tw-bg-black tw-transition-all md:tw-duration-150 tw-z-modal", {
|
|
253
219
|
"tw-bg-opacity-0 tw-delay-300": !t.open,
|
|
254
220
|
"tw-bg-opacity-low": t.open
|
|
255
221
|
}]),
|
|
256
|
-
onClick:
|
|
222
|
+
onClick: l[3] || (l[3] = X((...o) => t.closeSideSheet && t.closeSideSheet(...o), ["self"]))
|
|
257
223
|
}, [
|
|
258
|
-
|
|
224
|
+
c("div", {
|
|
259
225
|
ref: "sideSheetRef",
|
|
260
|
-
class:
|
|
226
|
+
class: k(["tw-fixed tw-right-0 tw-transition-all tw-duration-300 tw-bg-white tw-overflow-y-auto", {
|
|
261
227
|
"tw-translate-x-full": !t.open,
|
|
262
228
|
"tw-translate-x-0": t.open,
|
|
263
|
-
"tw-h-full":
|
|
229
|
+
"tw-h-full": i.$slots.controls
|
|
264
230
|
}]),
|
|
265
|
-
style:
|
|
231
|
+
style: j(t.sideSheetStyles)
|
|
266
232
|
}, [
|
|
267
|
-
|
|
233
|
+
c("div", {
|
|
268
234
|
class: "tw-flex tw-flex-col tw-h-full",
|
|
269
|
-
style:
|
|
235
|
+
style: j(t.modalStyles)
|
|
270
236
|
}, [
|
|
271
|
-
|
|
237
|
+
c("div", {
|
|
272
238
|
ref: "headlineRef",
|
|
273
|
-
class:
|
|
239
|
+
class: k(["tw-flex tw-justify-between tw-transition-opacity tw-duration-200 tw-px-3 tw-py-2 tw-border-tertiary", {
|
|
274
240
|
"tw-opacity-0": !t.open,
|
|
275
241
|
"tw-opacity-full": t.open,
|
|
276
|
-
"tw-border-b":
|
|
242
|
+
"tw-border-b": s.showHeadlineBorder
|
|
277
243
|
}])
|
|
278
244
|
}, [
|
|
279
|
-
|
|
280
|
-
|
|
245
|
+
c("div", le, [
|
|
246
|
+
s.showBackButton ? (g(), p("button", {
|
|
281
247
|
key: 0,
|
|
282
248
|
class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
|
|
283
|
-
onClick:
|
|
249
|
+
onClick: l[0] || (l[0] = (...o) => t.closeSideSheet && t.closeSideSheet(...o))
|
|
284
250
|
}, [
|
|
285
|
-
|
|
251
|
+
O(a, {
|
|
286
252
|
class: "tw-w-3 tw-h-3",
|
|
287
253
|
icon: t.mdiArrowLeft
|
|
288
254
|
}, null, 8, ["icon"])
|
|
289
|
-
])) :
|
|
290
|
-
|
|
255
|
+
])) : b("", !0),
|
|
256
|
+
s.headline ? (g(), p("h2", se, Y(s.headline), 1)) : b("", !0)
|
|
291
257
|
]),
|
|
292
|
-
|
|
293
|
-
|
|
258
|
+
c("div", ae, [
|
|
259
|
+
s.showGoToLink ? (g(), p("button", {
|
|
294
260
|
key: 0,
|
|
295
261
|
class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
|
|
296
|
-
onClick:
|
|
262
|
+
onClick: l[1] || (l[1] = (...o) => t.goToLink && t.goToLink(...o))
|
|
297
263
|
}, [
|
|
298
|
-
|
|
264
|
+
O(a, {
|
|
299
265
|
class: "tw-w-3 tw-h-3",
|
|
300
266
|
icon: t.mdiExportVariant
|
|
301
267
|
}, null, 8, ["icon"])
|
|
302
|
-
])) :
|
|
303
|
-
|
|
268
|
+
])) : b("", !0),
|
|
269
|
+
c("button", {
|
|
304
270
|
class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
|
|
305
|
-
onClick:
|
|
271
|
+
onClick: l[2] || (l[2] = (...o) => t.closeSideSheet && t.closeSideSheet(...o))
|
|
306
272
|
}, [
|
|
307
|
-
|
|
273
|
+
O(a, {
|
|
308
274
|
class: "tw-w-3 tw-h-3",
|
|
309
275
|
icon: t.mdiClose
|
|
310
276
|
}, null, 8, ["icon"])
|
|
311
277
|
])
|
|
312
278
|
])
|
|
313
279
|
], 2),
|
|
314
|
-
|
|
280
|
+
c("div", {
|
|
315
281
|
id: "sidesheet-content",
|
|
316
282
|
class: "tw-overflow-y-auto tw-overscroll-y-contain",
|
|
317
|
-
style:
|
|
283
|
+
style: j({ height: t.contentHeight + "px" })
|
|
318
284
|
}, [
|
|
319
|
-
|
|
320
|
-
class:
|
|
285
|
+
c("div", {
|
|
286
|
+
class: k(["tw-p-2 tw-transition-opacity tw-duration-200", {
|
|
321
287
|
"tw-opacity-0": !t.open,
|
|
322
288
|
"tw-opacity-full": t.open
|
|
323
289
|
}])
|
|
324
290
|
}, [
|
|
325
|
-
|
|
291
|
+
F(i.$slots, "default")
|
|
326
292
|
], 2)
|
|
327
293
|
], 4),
|
|
328
|
-
|
|
294
|
+
i.$slots.controls ? (g(), p("div", {
|
|
329
295
|
key: 0,
|
|
330
296
|
ref: "controlsRef",
|
|
331
|
-
class:
|
|
297
|
+
class: k(["tw-absolute tw-bottom-0 tw-w-full tw-border-t tw-border-tertiary tw-bg-white tw-transition-opacity tw-duration-200", {
|
|
332
298
|
"tw-opacity-0": !t.open,
|
|
333
299
|
"tw-opacity-full": t.open
|
|
334
300
|
}]),
|
|
335
301
|
style: { "z-index": "999" }
|
|
336
302
|
}, [
|
|
337
|
-
|
|
338
|
-
], 2)) :
|
|
303
|
+
F(i.$slots, "controls")
|
|
304
|
+
], 2)) : b("", !0)
|
|
339
305
|
], 4)
|
|
340
306
|
], 6)
|
|
341
|
-
], 2)) :
|
|
307
|
+
], 2)) : b("", !0);
|
|
342
308
|
}
|
|
343
|
-
const
|
|
309
|
+
const fe = /* @__PURE__ */ ne(ie, [["render", re]]);
|
|
344
310
|
export {
|
|
345
|
-
|
|
311
|
+
fe as default
|
|
346
312
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.23.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
"embla-carousel-fade",
|
|
112
112
|
"popper.js"
|
|
113
113
|
],
|
|
114
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "05289fba22aebf122d62677fa7a9e762be9ecffc"
|
|
115
115
|
}
|