react-spring-carousel 3.0.0-beta090.31 → 3.0.0-beta090.33
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/index.cjs.js +6 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +189 -189
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -10,7 +10,7 @@ var A = {}, Cr = {
|
|
|
10
10
|
set exports(n) {
|
|
11
11
|
A = n;
|
|
12
12
|
}
|
|
13
|
-
},
|
|
13
|
+
}, Ue = {};
|
|
14
14
|
/**
|
|
15
15
|
* @license React
|
|
16
16
|
* react-jsx-runtime.production.min.js
|
|
@@ -23,7 +23,7 @@ var A = {}, Cr = {
|
|
|
23
23
|
var cr;
|
|
24
24
|
function Ir() {
|
|
25
25
|
if (cr)
|
|
26
|
-
return
|
|
26
|
+
return Ue;
|
|
27
27
|
cr = 1;
|
|
28
28
|
var n = lr, p = Symbol.for("react.element"), y = Symbol.for("react.fragment"), D = Object.prototype.hasOwnProperty, Y = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
29
29
|
function T(l, f, d) {
|
|
@@ -36,7 +36,7 @@ function Ir() {
|
|
|
36
36
|
q[W] === void 0 && (q[W] = f[W]);
|
|
37
37
|
return { $$typeof: p, type: l, key: _, ref: u, props: q, _owner: Y.current };
|
|
38
38
|
}
|
|
39
|
-
return
|
|
39
|
+
return Ue.Fragment = y, Ue.jsx = T, Ue.jsxs = T, Ue;
|
|
40
40
|
}
|
|
41
41
|
var qe = {};
|
|
42
42
|
/**
|
|
@@ -51,11 +51,11 @@ var qe = {};
|
|
|
51
51
|
var sr;
|
|
52
52
|
function Pr() {
|
|
53
53
|
return sr || (sr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
54
|
-
var n = lr, p = Symbol.for("react.element"), y = Symbol.for("react.portal"), D = Symbol.for("react.fragment"), Y = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), T = Symbol.for("react.provider"), l = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), W = Symbol.for("react.suspense_list"), q = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), u = Symbol.for("react.offscreen"),
|
|
55
|
-
function
|
|
54
|
+
var n = lr, p = Symbol.for("react.element"), y = Symbol.for("react.portal"), D = Symbol.for("react.fragment"), Y = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), T = Symbol.for("react.provider"), l = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), W = Symbol.for("react.suspense_list"), q = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), u = Symbol.for("react.offscreen"), B = Symbol.iterator, x = "@@iterator";
|
|
55
|
+
function oe(e) {
|
|
56
56
|
if (e === null || typeof e != "object")
|
|
57
57
|
return null;
|
|
58
|
-
var t =
|
|
58
|
+
var t = B && e[B] || e[x];
|
|
59
59
|
return typeof t == "function" ? t : null;
|
|
60
60
|
}
|
|
61
61
|
var j = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
@@ -76,16 +76,16 @@ function Pr() {
|
|
|
76
76
|
w.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, w);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
var re = !1, J = !1, Z = !1,
|
|
79
|
+
var re = !1, J = !1, Z = !1, ae = !1, z = !1, ve;
|
|
80
80
|
ve = Symbol.for("react.module.reference");
|
|
81
81
|
function we(e) {
|
|
82
|
-
return !!(typeof e == "string" || typeof e == "function" || e === D || e === v || z || e === Y || e === d || e === W ||
|
|
82
|
+
return !!(typeof e == "string" || typeof e == "function" || e === D || e === v || z || e === Y || e === d || e === W || ae || e === u || re || J || Z || typeof e == "object" && e !== null && (e.$$typeof === _ || e.$$typeof === q || e.$$typeof === T || e.$$typeof === l || e.$$typeof === f || // This needs to include all possible module reference object
|
|
83
83
|
// types supported by any Flight configuration anywhere since
|
|
84
84
|
// we don't know which Flight build this will end up being used
|
|
85
85
|
// with.
|
|
86
86
|
e.$$typeof === ve || e.getModuleId !== void 0));
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function N(e, t, i) {
|
|
89
89
|
var s = e.displayName;
|
|
90
90
|
if (s)
|
|
91
91
|
return s;
|
|
@@ -125,7 +125,7 @@ function Pr() {
|
|
|
125
125
|
var i = e;
|
|
126
126
|
return I(i._context) + ".Provider";
|
|
127
127
|
case f:
|
|
128
|
-
return
|
|
128
|
+
return N(e, e.render, "ForwardRef");
|
|
129
129
|
case q:
|
|
130
130
|
var s = e.displayName || null;
|
|
131
131
|
return s !== null ? s : g(e.type) || "Memo";
|
|
@@ -202,7 +202,7 @@ function Pr() {
|
|
|
202
202
|
P < 0 && O("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
var
|
|
205
|
+
var U = j.ReactCurrentDispatcher, me;
|
|
206
206
|
function ce(e, t, i) {
|
|
207
207
|
{
|
|
208
208
|
if (me === void 0)
|
|
@@ -234,7 +234,7 @@ function Pr() {
|
|
|
234
234
|
var b = Error.prepareStackTrace;
|
|
235
235
|
Error.prepareStackTrace = void 0;
|
|
236
236
|
var w;
|
|
237
|
-
w =
|
|
237
|
+
w = U.current, U.current = null, Pe();
|
|
238
238
|
try {
|
|
239
239
|
if (t) {
|
|
240
240
|
var m = function() {
|
|
@@ -271,23 +271,23 @@ function Pr() {
|
|
|
271
271
|
if (fe && s && typeof fe.stack == "string") {
|
|
272
272
|
for (var h = fe.stack.split(`
|
|
273
273
|
`), H = s.stack.split(`
|
|
274
|
-
`),
|
|
275
|
-
|
|
276
|
-
for (;
|
|
277
|
-
if (h[
|
|
278
|
-
if (
|
|
274
|
+
`), S = h.length - 1, V = H.length - 1; S >= 1 && V >= 0 && h[S] !== H[V]; )
|
|
275
|
+
V--;
|
|
276
|
+
for (; S >= 1 && V >= 0; S--, V--)
|
|
277
|
+
if (h[S] !== H[V]) {
|
|
278
|
+
if (S !== 1 || V !== 1)
|
|
279
279
|
do
|
|
280
|
-
if (
|
|
280
|
+
if (S--, V--, V < 0 || h[S] !== H[V]) {
|
|
281
281
|
var Q = `
|
|
282
|
-
` + h[
|
|
282
|
+
` + h[S].replace(" at new ", " at ");
|
|
283
283
|
return e.displayName && Q.includes("<anonymous>") && (Q = Q.replace("<anonymous>", e.displayName)), typeof e == "function" && ke.set(e, Q), Q;
|
|
284
284
|
}
|
|
285
|
-
while (
|
|
285
|
+
while (S >= 1 && V >= 0);
|
|
286
286
|
break;
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
289
|
} finally {
|
|
290
|
-
We = !1,
|
|
290
|
+
We = !1, U.current = w, ue(), Error.prepareStackTrace = b;
|
|
291
291
|
}
|
|
292
292
|
var je = e ? e.displayName || e.name : "", ur = je ? ce(je) : "";
|
|
293
293
|
return typeof e == "function" && ke.set(e, ur), ur;
|
|
@@ -348,8 +348,8 @@ function Pr() {
|
|
|
348
348
|
throw H.name = "Invariant Violation", H;
|
|
349
349
|
}
|
|
350
350
|
h = e[m](t, m, s, i, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
351
|
-
} catch (
|
|
352
|
-
h =
|
|
351
|
+
} catch (S) {
|
|
352
|
+
h = S;
|
|
353
353
|
}
|
|
354
354
|
h && !(h instanceof Error) && (ne(b), O("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", s || "React class", i, m, typeof h), ne(null)), h instanceof Error && !(h.message in M) && (M[h.message] = !0, ne(b), O("Failed %s type: %s", i, h.message), ne(null));
|
|
355
355
|
}
|
|
@@ -402,13 +402,13 @@ function Pr() {
|
|
|
402
402
|
}
|
|
403
403
|
return e.key !== void 0;
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function Se(e, t) {
|
|
406
406
|
if (typeof e.ref == "string" && ye.current && t && ye.current.stateNode !== t) {
|
|
407
407
|
var i = g(ye.current.type);
|
|
408
408
|
be[i] || (O('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', g(ye.current.type), e.ref), be[i] = !0);
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function Ve(e, t) {
|
|
412
412
|
{
|
|
413
413
|
var i = function() {
|
|
414
414
|
ze || (ze = !0, O("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
|
|
@@ -430,7 +430,7 @@ function Pr() {
|
|
|
430
430
|
});
|
|
431
431
|
}
|
|
432
432
|
}
|
|
433
|
-
var
|
|
433
|
+
var Be = function(e, t, i, s, b, w, m) {
|
|
434
434
|
var h = {
|
|
435
435
|
// This tag allows us to uniquely identify this as a React Element
|
|
436
436
|
$$typeof: p,
|
|
@@ -462,19 +462,19 @@ function Pr() {
|
|
|
462
462
|
function er(e, t, i, s, b) {
|
|
463
463
|
{
|
|
464
464
|
var w, m = {}, h = null, H = null;
|
|
465
|
-
i !== void 0 && (Je(i), h = "" + i), xe(t) && (Je(t.key), h = "" + t.key), Ge(t) && (H = t.ref,
|
|
465
|
+
i !== void 0 && (Je(i), h = "" + i), xe(t) && (Je(t.key), h = "" + t.key), Ge(t) && (H = t.ref, Se(t, b));
|
|
466
466
|
for (w in t)
|
|
467
467
|
G.call(t, w) && !ir.hasOwnProperty(w) && (m[w] = t[w]);
|
|
468
468
|
if (e && e.defaultProps) {
|
|
469
|
-
var
|
|
470
|
-
for (w in
|
|
471
|
-
m[w] === void 0 && (m[w] =
|
|
469
|
+
var S = e.defaultProps;
|
|
470
|
+
for (w in S)
|
|
471
|
+
m[w] === void 0 && (m[w] = S[w]);
|
|
472
472
|
}
|
|
473
473
|
if (h || H) {
|
|
474
|
-
var
|
|
475
|
-
h &&
|
|
474
|
+
var V = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
475
|
+
h && Ve(m, V), H && Ye(m, V);
|
|
476
476
|
}
|
|
477
|
-
return
|
|
477
|
+
return Be(e, h, H, b, s, ye.current, m);
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
480
|
var Ie = j.ReactCurrentOwner, Ke = j.ReactDebugCurrentFrame;
|
|
@@ -487,10 +487,10 @@ function Pr() {
|
|
|
487
487
|
}
|
|
488
488
|
var r;
|
|
489
489
|
r = !1;
|
|
490
|
-
function
|
|
490
|
+
function a(e) {
|
|
491
491
|
return typeof e == "object" && e !== null && e.$$typeof === p;
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function o() {
|
|
494
494
|
{
|
|
495
495
|
if (Ie.current) {
|
|
496
496
|
var e = g(Ie.current.type);
|
|
@@ -516,7 +516,7 @@ Check your code at ` + t + ":" + i + ".";
|
|
|
516
516
|
var K = {};
|
|
517
517
|
function Te(e) {
|
|
518
518
|
{
|
|
519
|
-
var t =
|
|
519
|
+
var t = o();
|
|
520
520
|
if (!t) {
|
|
521
521
|
var i = typeof e == "string" ? e : e.displayName || e.name;
|
|
522
522
|
i && (t = `
|
|
@@ -546,15 +546,15 @@ Check the top-level render call using <` + i + ">.");
|
|
|
546
546
|
if (X(e))
|
|
547
547
|
for (var i = 0; i < e.length; i++) {
|
|
548
548
|
var s = e[i];
|
|
549
|
-
|
|
549
|
+
a(s) && le(s, t);
|
|
550
550
|
}
|
|
551
|
-
else if (
|
|
551
|
+
else if (a(e))
|
|
552
552
|
e._store && (e._store.validated = !0);
|
|
553
553
|
else if (e) {
|
|
554
|
-
var b =
|
|
554
|
+
var b = oe(e);
|
|
555
555
|
if (typeof b == "function" && b !== e.entries)
|
|
556
556
|
for (var w = b.call(e), m; !(m = w.next()).done; )
|
|
557
|
-
|
|
557
|
+
a(m.value) && le(m.value, t);
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
}
|
|
@@ -583,7 +583,7 @@ Check the top-level render call using <` + i + ">.");
|
|
|
583
583
|
typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && O("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
|
-
function
|
|
586
|
+
function or(e) {
|
|
587
587
|
{
|
|
588
588
|
for (var t = Object.keys(e.props), i = 0; i < t.length; i++) {
|
|
589
589
|
var s = t[i];
|
|
@@ -595,20 +595,20 @@ Check the top-level render call using <` + i + ">.");
|
|
|
595
595
|
e.ref !== null && (Ee(e), O("Invalid attribute `ref` supplied to `React.Fragment`."), Ee(null));
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
|
-
function
|
|
598
|
+
function ar(e, t, i, s, b, w) {
|
|
599
599
|
{
|
|
600
600
|
var m = we(e);
|
|
601
601
|
if (!m) {
|
|
602
602
|
var h = "";
|
|
603
603
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (h += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
604
604
|
var H = k(b);
|
|
605
|
-
H ? h += H : h +=
|
|
606
|
-
var
|
|
607
|
-
e === null ?
|
|
605
|
+
H ? h += H : h += o();
|
|
606
|
+
var S;
|
|
607
|
+
e === null ? S = "null" : X(e) ? S = "array" : e !== void 0 && e.$$typeof === p ? (S = "<" + (g(e.type) || "Unknown") + " />", h = " Did you accidentally export a JSX literal instead of a component?") : S = typeof e, O("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", S, h);
|
|
608
608
|
}
|
|
609
|
-
var
|
|
610
|
-
if (
|
|
611
|
-
return
|
|
609
|
+
var V = er(e, t, i, b, w);
|
|
610
|
+
if (V == null)
|
|
611
|
+
return V;
|
|
612
612
|
if (m) {
|
|
613
613
|
var Q = t.children;
|
|
614
614
|
if (Q !== void 0)
|
|
@@ -622,14 +622,14 @@ Check the top-level render call using <` + i + ">.");
|
|
|
622
622
|
else
|
|
623
623
|
Ze(Q, e);
|
|
624
624
|
}
|
|
625
|
-
return e === D ?
|
|
625
|
+
return e === D ? or(V) : ie(V), V;
|
|
626
626
|
}
|
|
627
627
|
}
|
|
628
628
|
function pr(e, t, i) {
|
|
629
|
-
return
|
|
629
|
+
return ar(e, t, i, !0);
|
|
630
630
|
}
|
|
631
631
|
function yr(e, t, i) {
|
|
632
|
-
return
|
|
632
|
+
return ar(e, t, i, !1);
|
|
633
633
|
}
|
|
634
634
|
var br = yr, xr = pr;
|
|
635
635
|
qe.Fragment = D, qe.jsx = br, qe.jsxs = xr;
|
|
@@ -727,9 +727,9 @@ function mr({
|
|
|
727
727
|
`#thumb-item-${D[_].id}`
|
|
728
728
|
) : null;
|
|
729
729
|
}
|
|
730
|
-
const
|
|
731
|
-
if (
|
|
732
|
-
const
|
|
730
|
+
const B = u();
|
|
731
|
+
if (B && v.current && !Fr(B)) {
|
|
732
|
+
const oe = B.offsetLeft, j = oe > f() ? f() : oe;
|
|
733
733
|
l.start({
|
|
734
734
|
from: {
|
|
735
735
|
val: ((x = v.current) == null ? void 0 : x[n === "x" ? "scrollLeft" : "scrollTop"]) ?? 0
|
|
@@ -747,9 +747,9 @@ function mr({
|
|
|
747
747
|
}
|
|
748
748
|
function W() {
|
|
749
749
|
function _(u) {
|
|
750
|
-
return u.map((
|
|
751
|
-
id:
|
|
752
|
-
renderThumb:
|
|
750
|
+
return u.map((B) => ({
|
|
751
|
+
id: B.id,
|
|
752
|
+
renderThumb: B.renderThumb
|
|
753
753
|
}));
|
|
754
754
|
}
|
|
755
755
|
return y ? y(_(D)) : _(D);
|
|
@@ -774,8 +774,8 @@ function mr({
|
|
|
774
774
|
}
|
|
775
775
|
},
|
|
776
776
|
children: W().map(({ id: _, renderThumb: u }) => {
|
|
777
|
-
const
|
|
778
|
-
return /* @__PURE__ */ A.jsx("div", { id:
|
|
777
|
+
const B = `thumb-item-${_}`;
|
|
778
|
+
return /* @__PURE__ */ A.jsx("div", { id: B, className: "thumb-item", children: typeof u == "function" ? u(Y) : u }, B);
|
|
779
779
|
})
|
|
780
780
|
}
|
|
781
781
|
) : null,
|
|
@@ -797,15 +797,15 @@ function Wr({
|
|
|
797
797
|
draggingSlideTreshold: q,
|
|
798
798
|
slideWhenThresholdIsReached: _ = !1,
|
|
799
799
|
freeScroll: u,
|
|
800
|
-
enableFreeScrollDrag:
|
|
800
|
+
enableFreeScrollDrag: B,
|
|
801
801
|
initialStartingPosition: x,
|
|
802
|
-
prepareThumbsData:
|
|
802
|
+
prepareThumbsData: oe,
|
|
803
803
|
initialActiveItem: j = 0,
|
|
804
804
|
animateWhenActiveItemChange: O = !0,
|
|
805
805
|
slideGroupOfItems: ee = !1,
|
|
806
806
|
slideAmount: re
|
|
807
807
|
}) {
|
|
808
|
-
const J = Y > n.length ? n.length : Y, Z = $(!1),
|
|
808
|
+
const J = Y > n.length ? n.length : Y, Z = $(!1), ae = $(q ?? 0), z = $("initial"), ve = $("initial"), we = $("initial"), N = $(j), I = $(j === 0), g = $(v === "fixed" && j === n.length - 1), E = $(null), P = $(null), he = $(0), ge = $(0), c = $(0), R = $(l), F = $(v), te = $(u), L = $(!1), Pe = Oe(() => l ? [
|
|
809
809
|
...n.map((r) => ({
|
|
810
810
|
...r,
|
|
811
811
|
id: `prev-repeated-item-${r.id}`
|
|
@@ -815,25 +815,25 @@ function Wr({
|
|
|
815
815
|
...r,
|
|
816
816
|
id: `next-repeated-item-${r.id}`
|
|
817
817
|
}))
|
|
818
|
-
] : [...n], [n, l])(), [ue,
|
|
818
|
+
] : [...n], [n, l])(), [ue, U] = vr(
|
|
819
819
|
() => ({
|
|
820
820
|
val: 0,
|
|
821
821
|
pause: !p,
|
|
822
822
|
onChange: ({ value: r }) => {
|
|
823
|
-
u && E.current ? (d === "x" ? E.current.scrollLeft = Math.abs(r.val) : E.current.scrollTop = Math.abs(r.val), be()) : P.current && (d === "x" ? P.current.style.transform = `translate3d(${r.val}px, 0px,0px)` : P.current.style.transform = `translate3d(0px,${r.val}px,0px)`);
|
|
823
|
+
console.log({ value: r }), u && E.current ? (d === "x" ? E.current.scrollLeft = Math.abs(r.val) : E.current.scrollTop = Math.abs(r.val), be()) : P.current && (d === "x" ? P.current.style.transform = `translate3d(${r.val}px, 0px,0px)` : P.current.style.transform = `translate3d(0px,${r.val}px,0px)`);
|
|
824
824
|
}
|
|
825
825
|
}),
|
|
826
826
|
[u]
|
|
827
827
|
), { emitEvent: me, useListenToCustomEvent: ce } = gr(), { thumbsFragment: We, handleScroll: ke } = mr({
|
|
828
828
|
withThumbs: !!y,
|
|
829
829
|
thumbsSlideAxis: D,
|
|
830
|
-
prepareThumbsData:
|
|
830
|
+
prepareThumbsData: oe,
|
|
831
831
|
items: n,
|
|
832
832
|
renderThumbFnProps: {
|
|
833
|
-
getIsActiveItem:
|
|
833
|
+
getIsActiveItem: Be,
|
|
834
834
|
getIsPrevItem: Ye,
|
|
835
835
|
useListenToCustomEvent: ce,
|
|
836
|
-
getIsNextItem:
|
|
836
|
+
getIsNextItem: Ve
|
|
837
837
|
}
|
|
838
838
|
}), { enterFullscreen: Le, exitFullscreen: Ne, getIsFullscreen: He } = kr({
|
|
839
839
|
mainCarouselWrapperRef: E,
|
|
@@ -854,14 +854,14 @@ function Wr({
|
|
|
854
854
|
};
|
|
855
855
|
}
|
|
856
856
|
const C = Oe(() => {
|
|
857
|
-
var
|
|
857
|
+
var o;
|
|
858
858
|
if (typeof re == "number" && re > 0 && (v === "fluid" || u))
|
|
859
859
|
return re;
|
|
860
|
-
const r = ee ? E.current : (
|
|
860
|
+
const r = ee ? E.current : (o = E.current) == null ? void 0 : o.querySelector(".use-spring-carousel-item");
|
|
861
861
|
if (!r)
|
|
862
862
|
throw Error("No carousel items available!");
|
|
863
|
-
let
|
|
864
|
-
return ee || (
|
|
863
|
+
let a = r.getBoundingClientRect()[d === "x" ? "width" : "height"];
|
|
864
|
+
return ee || (a += T), ee && (a += T - f * 2), a;
|
|
865
865
|
}, [
|
|
866
866
|
d,
|
|
867
867
|
u,
|
|
@@ -871,24 +871,24 @@ function Wr({
|
|
|
871
871
|
v,
|
|
872
872
|
f
|
|
873
873
|
]);
|
|
874
|
-
function G({ from: r, to:
|
|
875
|
-
ve.current = K, typeof
|
|
874
|
+
function G({ from: r, to: a, nextActiveItem: o, immediate: k = !1, slideMode: K }) {
|
|
875
|
+
ve.current = K, typeof o == "number" && (u || (N.current = o), me({
|
|
876
876
|
eventName: "onSlideStartChange",
|
|
877
877
|
slideActionType: z.current,
|
|
878
878
|
slideMode: ve.current,
|
|
879
879
|
nextItem: {
|
|
880
880
|
startReached: I.current,
|
|
881
881
|
endReached: g.current,
|
|
882
|
-
index: u ? -1 :
|
|
883
|
-
id: u ? "" : n[
|
|
882
|
+
index: u ? -1 : N.current,
|
|
883
|
+
id: u ? "" : n[N.current].id
|
|
884
884
|
}
|
|
885
|
-
})), c.current =
|
|
885
|
+
})), c.current = a, console.log("SET SPRING DB", { activeItem: N.current }), U.start({
|
|
886
886
|
immediate: k,
|
|
887
887
|
from: {
|
|
888
888
|
val: r
|
|
889
889
|
},
|
|
890
890
|
to: {
|
|
891
|
-
val:
|
|
891
|
+
val: a
|
|
892
892
|
},
|
|
893
893
|
config: {
|
|
894
894
|
...De.default,
|
|
@@ -902,12 +902,12 @@ function Wr({
|
|
|
902
902
|
currentItem: {
|
|
903
903
|
startReached: I.current,
|
|
904
904
|
endReached: g.current,
|
|
905
|
-
index: u ? -1 :
|
|
906
|
-
id: u ? "" : n[
|
|
905
|
+
index: u ? -1 : N.current,
|
|
906
|
+
id: u ? "" : n[N.current].id
|
|
907
907
|
}
|
|
908
908
|
});
|
|
909
909
|
}
|
|
910
|
-
}), y && !k && ke(
|
|
910
|
+
}), y && !k && ke(N.current);
|
|
911
911
|
}
|
|
912
912
|
const M = Oe(() => {
|
|
913
913
|
var r;
|
|
@@ -925,15 +925,15 @@ function Wr({
|
|
|
925
925
|
};
|
|
926
926
|
}
|
|
927
927
|
const ne = Oe(() => {
|
|
928
|
-
var
|
|
929
|
-
const r = (
|
|
928
|
+
var a;
|
|
929
|
+
const r = (a = P.current) == null ? void 0 : a.querySelector(".use-spring-carousel-item");
|
|
930
930
|
if (!r)
|
|
931
931
|
throw Error("No carousel items available!");
|
|
932
932
|
return r.getBoundingClientRect()[d === "x" ? "width" : "height"] + T;
|
|
933
933
|
}, [d, T]), _e = Oe(
|
|
934
934
|
(r) => {
|
|
935
|
-
const
|
|
936
|
-
|
|
935
|
+
const a = d === "x" ? "left" : "top", o = P.current;
|
|
936
|
+
o && (l ? (o.style.top = "0px", o.style.left = "0px", o.style[a] = `-${r - f}px`, I.current = !1, g.current = !1) : (o.style.left = "0px", o.style.top = "0px"));
|
|
937
937
|
},
|
|
938
938
|
[d, f, l]
|
|
939
939
|
), Fe = Oe(
|
|
@@ -942,37 +942,37 @@ function Wr({
|
|
|
942
942
|
x === "center" ? ne() * n.length - C() * Math.round((J - 1) / 2) : x === "end" ? ne() * n.length - C() * Math.round(J - 1) : ne() * n.length
|
|
943
943
|
), v === "fluid") {
|
|
944
944
|
if (_e(ne() * n.length), g.current && M() !== Math.abs(c.current) && !l) {
|
|
945
|
-
const
|
|
946
|
-
c.current =
|
|
945
|
+
const a = -M();
|
|
946
|
+
c.current = a, U.start({
|
|
947
947
|
immediate: !0,
|
|
948
948
|
val: c.current
|
|
949
949
|
});
|
|
950
950
|
return;
|
|
951
951
|
}
|
|
952
952
|
if (Math.abs(c.current) > 0 && M() !== Math.abs(c.current) && !l && !u && we.current === "backward") {
|
|
953
|
-
const
|
|
954
|
-
return
|
|
953
|
+
const a = he.current - M(), o = c.current + a;
|
|
954
|
+
return U.start({
|
|
955
955
|
immediate: !0,
|
|
956
|
-
val:
|
|
956
|
+
val: o
|
|
957
957
|
}), () => {
|
|
958
|
-
c.current =
|
|
958
|
+
c.current = o;
|
|
959
959
|
};
|
|
960
960
|
}
|
|
961
961
|
console.log("here");
|
|
962
962
|
return;
|
|
963
963
|
}
|
|
964
964
|
if (!u && v === "fixed") {
|
|
965
|
-
const
|
|
966
|
-
if (Math.abs(
|
|
967
|
-
const
|
|
968
|
-
g.current = !0, c.current =
|
|
965
|
+
const a = -(C() * N.current);
|
|
966
|
+
if (Math.abs(a) > M() && !l) {
|
|
967
|
+
const o = -M();
|
|
968
|
+
g.current = !0, c.current = o, U.start({
|
|
969
969
|
immediate: !0,
|
|
970
970
|
val: c.current
|
|
971
971
|
});
|
|
972
972
|
} else
|
|
973
|
-
c.current =
|
|
973
|
+
c.current = a, U.start({
|
|
974
974
|
immediate: !0,
|
|
975
|
-
val:
|
|
975
|
+
val: a
|
|
976
976
|
});
|
|
977
977
|
setTimeout(() => {
|
|
978
978
|
Z.current = !1;
|
|
@@ -988,7 +988,7 @@ function Wr({
|
|
|
988
988
|
n.length,
|
|
989
989
|
J,
|
|
990
990
|
_e,
|
|
991
|
-
|
|
991
|
+
U,
|
|
992
992
|
v,
|
|
993
993
|
l
|
|
994
994
|
]
|
|
@@ -996,24 +996,24 @@ function Wr({
|
|
|
996
996
|
function X() {
|
|
997
997
|
return u && E.current ? E.current[d === "x" ? "scrollLeft" : "scrollTop"] : ue.val.get();
|
|
998
998
|
}
|
|
999
|
-
function Ce(r,
|
|
999
|
+
function Ce(r, a) {
|
|
1000
1000
|
if (u && r === "next") {
|
|
1001
|
-
const
|
|
1002
|
-
return
|
|
1001
|
+
const o = c.current + C();
|
|
1002
|
+
return o > M() ? M() : o;
|
|
1003
1003
|
}
|
|
1004
1004
|
if (u && r === "prev") {
|
|
1005
|
-
const
|
|
1006
|
-
return
|
|
1005
|
+
const o = c.current - C();
|
|
1006
|
+
return o < 0 ? 0 : o;
|
|
1007
1007
|
}
|
|
1008
|
-
return r === "next" ? typeof
|
|
1008
|
+
return r === "next" ? typeof a == "number" ? -(a * C()) : c.current - C() : typeof a == "number" ? -(a * C()) : c.current + C();
|
|
1009
1009
|
}
|
|
1010
|
-
function pe({ type: r, index:
|
|
1010
|
+
function pe({ type: r, index: a, immediate: o }) {
|
|
1011
1011
|
if (!p || L.current || I.current && !l)
|
|
1012
1012
|
return;
|
|
1013
1013
|
g.current && (we.current = "backward"), z.current = "prev", g.current = !1;
|
|
1014
|
-
const k = typeof
|
|
1014
|
+
const k = typeof a == "number" ? a : N.current - 1;
|
|
1015
1015
|
if (u && be(), !l) {
|
|
1016
|
-
const K = u ? Ce("prev",
|
|
1016
|
+
const K = u ? Ce("prev", a) - C() / 3 < 0 : Ce("prev", a) + C() / 3 > 0;
|
|
1017
1017
|
if (I.current)
|
|
1018
1018
|
return;
|
|
1019
1019
|
if (K) {
|
|
@@ -1022,7 +1022,7 @@ function Wr({
|
|
|
1022
1022
|
from: X(),
|
|
1023
1023
|
to: 0,
|
|
1024
1024
|
nextActiveItem: 0,
|
|
1025
|
-
immediate:
|
|
1025
|
+
immediate: o
|
|
1026
1026
|
});
|
|
1027
1027
|
return;
|
|
1028
1028
|
}
|
|
@@ -1033,26 +1033,26 @@ function Wr({
|
|
|
1033
1033
|
from: X() - C() * n.length,
|
|
1034
1034
|
to: -(C() * n.length) + C(),
|
|
1035
1035
|
nextActiveItem: n.length - 1,
|
|
1036
|
-
immediate:
|
|
1036
|
+
immediate: o
|
|
1037
1037
|
});
|
|
1038
1038
|
return;
|
|
1039
1039
|
}
|
|
1040
1040
|
k === 0 && (I.current = !0), (k === n.length - 1 || k === -1) && (g.current = !0), G({
|
|
1041
1041
|
slideMode: r,
|
|
1042
1042
|
from: X(),
|
|
1043
|
-
to: Ce("prev",
|
|
1043
|
+
to: Ce("prev", a),
|
|
1044
1044
|
nextActiveItem: k,
|
|
1045
|
-
immediate:
|
|
1045
|
+
immediate: o
|
|
1046
1046
|
});
|
|
1047
1047
|
}
|
|
1048
|
-
function se({ type: r, index:
|
|
1048
|
+
function se({ type: r, index: a, immediate: o }) {
|
|
1049
1049
|
if (console.log("here1"), !p || L.current || g.current && !l)
|
|
1050
1050
|
return;
|
|
1051
1051
|
console.log("2"), I.current && (we.current = "forward"), z.current = "next", I.current = !1;
|
|
1052
|
-
const k =
|
|
1052
|
+
const k = a || N.current + 1;
|
|
1053
1053
|
if (u && be(), !l) {
|
|
1054
1054
|
console.log("3");
|
|
1055
|
-
const K = Math.abs(Ce("next",
|
|
1055
|
+
const K = Math.abs(Ce("next", a)) > M() - C() / 3;
|
|
1056
1056
|
if (g.current)
|
|
1057
1057
|
return;
|
|
1058
1058
|
if (K) {
|
|
@@ -1061,7 +1061,7 @@ function Wr({
|
|
|
1061
1061
|
from: X(),
|
|
1062
1062
|
to: u ? M() : -M(),
|
|
1063
1063
|
nextActiveItem: k,
|
|
1064
|
-
immediate:
|
|
1064
|
+
immediate: o
|
|
1065
1065
|
});
|
|
1066
1066
|
return;
|
|
1067
1067
|
}
|
|
@@ -1072,35 +1072,35 @@ function Wr({
|
|
|
1072
1072
|
from: X() + C() * n.length,
|
|
1073
1073
|
to: 0,
|
|
1074
1074
|
nextActiveItem: 0,
|
|
1075
|
-
immediate:
|
|
1075
|
+
immediate: o
|
|
1076
1076
|
});
|
|
1077
1077
|
return;
|
|
1078
1078
|
}
|
|
1079
1079
|
k === 0 && (I.current = !0), k === n.length - 1 && (g.current = !0), G({
|
|
1080
1080
|
slideMode: r,
|
|
1081
1081
|
from: X(),
|
|
1082
|
-
to: Ce("next",
|
|
1082
|
+
to: Ce("next", a),
|
|
1083
1083
|
nextActiveItem: k,
|
|
1084
|
-
immediate:
|
|
1084
|
+
immediate: o
|
|
1085
1085
|
});
|
|
1086
1086
|
}
|
|
1087
1087
|
function Je() {
|
|
1088
|
-
q ?
|
|
1088
|
+
q ? ae.current = q : ae.current = Math.floor(C() / 2 / 2);
|
|
1089
1089
|
}
|
|
1090
1090
|
function ye() {
|
|
1091
|
-
P.current && (he.current = M(), R.current = l, F.current = v, te.current = u, ge.current = window.innerWidth, c.current = 0,
|
|
1091
|
+
P.current && (he.current = M(), R.current = l, F.current = v, te.current = u, ge.current = window.innerWidth, c.current = 0, Se({ id: 0, immediate: !0, shouldReset: !0 }), Je(), Fe());
|
|
1092
1092
|
}
|
|
1093
1093
|
const ze = hr(
|
|
1094
1094
|
(r) => {
|
|
1095
|
-
const
|
|
1096
|
-
if (
|
|
1095
|
+
const a = r.dragging, o = r.offset[d === "x" ? 0 : 1], k = r.movement[d === "x" ? 0 : 1], K = r.direction[d === "x" ? 0 : 1], Te = k > ae.current, le = k < -ae.current, Ze = M(), ie = r.velocity;
|
|
1096
|
+
if (a) {
|
|
1097
1097
|
if (K > 0 ? z.current = "prev" : z.current = "next", me({
|
|
1098
1098
|
...r,
|
|
1099
1099
|
eventName: "onDrag",
|
|
1100
1100
|
slideActionType: z.current
|
|
1101
1101
|
}), u) {
|
|
1102
|
-
if (
|
|
1103
|
-
|
|
1102
|
+
if (o > 0) {
|
|
1103
|
+
U.start({
|
|
1104
1104
|
from: {
|
|
1105
1105
|
val: X()
|
|
1106
1106
|
},
|
|
@@ -1115,12 +1115,12 @@ function Wr({
|
|
|
1115
1115
|
}), r.cancel();
|
|
1116
1116
|
return;
|
|
1117
1117
|
}
|
|
1118
|
-
|
|
1118
|
+
U.start({
|
|
1119
1119
|
from: {
|
|
1120
1120
|
val: X()
|
|
1121
1121
|
},
|
|
1122
1122
|
to: {
|
|
1123
|
-
val: -
|
|
1123
|
+
val: -o
|
|
1124
1124
|
},
|
|
1125
1125
|
config: {
|
|
1126
1126
|
velocity: ie,
|
|
@@ -1130,18 +1130,18 @@ function Wr({
|
|
|
1130
1130
|
});
|
|
1131
1131
|
return;
|
|
1132
1132
|
}
|
|
1133
|
-
|
|
1134
|
-
val:
|
|
1133
|
+
U.start({
|
|
1134
|
+
val: o,
|
|
1135
1135
|
config: {
|
|
1136
1136
|
velocity: ie,
|
|
1137
1137
|
friction: 50,
|
|
1138
1138
|
tension: 1e3
|
|
1139
1139
|
}
|
|
1140
|
-
}), _ && le ? (se({ type: "drag" }), r.cancel()) : _ && Te && (pe({ type: "drag" }), r.cancel()), Ze - Math.abs(
|
|
1140
|
+
}), _ && le ? (se({ type: "drag" }), r.cancel()) : _ && Te && (pe({ type: "drag" }), r.cancel()), Ze - Math.abs(o) < -(C() * 2) && r.cancel();
|
|
1141
1141
|
return;
|
|
1142
1142
|
}
|
|
1143
|
-
if (r.last && u &&
|
|
1144
|
-
|
|
1143
|
+
if (r.last && u && o > 0) {
|
|
1144
|
+
U.start({
|
|
1145
1145
|
from: {
|
|
1146
1146
|
val: X()
|
|
1147
1147
|
},
|
|
@@ -1156,25 +1156,25 @@ function Wr({
|
|
|
1156
1156
|
});
|
|
1157
1157
|
return;
|
|
1158
1158
|
}
|
|
1159
|
-
r.last && !r.canceled && u && (z.current === "prev" && pe({ type: "drag" }), z.current === "next" && se({ type: "drag" })), r.last && !r.canceled && !u && (le ? !l && g.current ?
|
|
1159
|
+
r.last && !r.canceled && u && (z.current === "prev" && pe({ type: "drag" }), z.current === "next" && se({ type: "drag" })), r.last && !r.canceled && !u && (le ? !l && g.current ? U.start({
|
|
1160
1160
|
val: -M(),
|
|
1161
1161
|
config: {
|
|
1162
1162
|
...De.default,
|
|
1163
1163
|
velocity: ie
|
|
1164
1164
|
}
|
|
1165
|
-
}) : se({ type: "drag" }) : Te ? !l && I.current ?
|
|
1165
|
+
}) : se({ type: "drag" }) : Te ? !l && I.current ? U.start({
|
|
1166
1166
|
val: 0,
|
|
1167
1167
|
config: {
|
|
1168
1168
|
...De.default,
|
|
1169
1169
|
velocity: ie
|
|
1170
1170
|
}
|
|
1171
|
-
}) : pe({ type: "drag" }) :
|
|
1171
|
+
}) : pe({ type: "drag" }) : U.start({
|
|
1172
1172
|
val: c.current,
|
|
1173
1173
|
config: {
|
|
1174
1174
|
...De.default,
|
|
1175
1175
|
velocity: ie
|
|
1176
1176
|
}
|
|
1177
|
-
})), r.last && r.canceled &&
|
|
1177
|
+
})), r.last && r.canceled && U.start({
|
|
1178
1178
|
val: c.current,
|
|
1179
1179
|
config: {
|
|
1180
1180
|
...De.default,
|
|
@@ -1183,7 +1183,7 @@ function Wr({
|
|
|
1183
1183
|
});
|
|
1184
1184
|
},
|
|
1185
1185
|
{
|
|
1186
|
-
enabled: p && !W && !u || !!u && !!
|
|
1186
|
+
enabled: p && !W && !u || !!u && !!B,
|
|
1187
1187
|
axis: d,
|
|
1188
1188
|
from: () => u && E.current ? [
|
|
1189
1189
|
-E.current.scrollLeft,
|
|
@@ -1208,16 +1208,16 @@ function Wr({
|
|
|
1208
1208
|
}
|
|
1209
1209
|
} : {};
|
|
1210
1210
|
}
|
|
1211
|
-
function xe(r,
|
|
1212
|
-
let
|
|
1213
|
-
if (typeof r == "string" ?
|
|
1214
|
-
if (
|
|
1215
|
-
throw new Error(
|
|
1216
|
-
console.error(`The item doesn't exist; check that the id provided - ${r} - is correct.`),
|
|
1217
|
-
}
|
|
1218
|
-
return
|
|
1211
|
+
function xe(r, a) {
|
|
1212
|
+
let o = 0;
|
|
1213
|
+
if (typeof r == "string" ? o = n.findIndex((k) => k.id === r) : o = r, o < 0 || o >= n.length) {
|
|
1214
|
+
if (a)
|
|
1215
|
+
throw new Error(a);
|
|
1216
|
+
console.error(`The item doesn't exist; check that the id provided - ${r} - is correct.`), o = -1;
|
|
1217
|
+
}
|
|
1218
|
+
return o;
|
|
1219
1219
|
}
|
|
1220
|
-
function
|
|
1220
|
+
function Se({ id: r, immediate: a, shouldReset: o, type: k }) {
|
|
1221
1221
|
if (!p || L.current)
|
|
1222
1222
|
return;
|
|
1223
1223
|
I.current = !1, g.current = !1;
|
|
@@ -1225,29 +1225,29 @@ function Wr({
|
|
|
1225
1225
|
r,
|
|
1226
1226
|
"The item you want to slide to doesn't exist; check the provided id."
|
|
1227
1227
|
);
|
|
1228
|
-
if (K ===
|
|
1228
|
+
if (K === N.current && !o)
|
|
1229
1229
|
return;
|
|
1230
|
-
const Te = xe(n[
|
|
1230
|
+
const Te = xe(n[N.current].id), le = xe(n[K].id);
|
|
1231
1231
|
le > Te ? se({
|
|
1232
|
-
type: k ||
|
|
1232
|
+
type: k || o ? "initial" : "click",
|
|
1233
1233
|
index: le,
|
|
1234
|
-
immediate:
|
|
1234
|
+
immediate: a
|
|
1235
1235
|
}) : pe({
|
|
1236
|
-
type: k ||
|
|
1236
|
+
type: k || o ? "initial" : "click",
|
|
1237
1237
|
index: le,
|
|
1238
|
-
immediate:
|
|
1238
|
+
immediate: a
|
|
1239
1239
|
});
|
|
1240
1240
|
}
|
|
1241
|
-
function
|
|
1242
|
-
const
|
|
1243
|
-
return l &&
|
|
1241
|
+
function Ve(r) {
|
|
1242
|
+
const a = xe(r, "The item doesn't exist; check the provided id."), o = N.current;
|
|
1243
|
+
return l && o === n.length - 1 ? a === 0 : a === o + 1;
|
|
1244
1244
|
}
|
|
1245
1245
|
function Ye(r) {
|
|
1246
|
-
const
|
|
1247
|
-
return l &&
|
|
1246
|
+
const a = xe(r, "The item doesn't exist; check the provided id."), o = N.current;
|
|
1247
|
+
return l && o === 0 ? a === n.length - 1 : a === o - 1;
|
|
1248
1248
|
}
|
|
1249
|
-
function
|
|
1250
|
-
return xe(r, "The item you want to check doesn't exist; check the provided id.") ===
|
|
1249
|
+
function Be(r) {
|
|
1250
|
+
return xe(r, "The item you want to check doesn't exist; check the provided id.") === N.current;
|
|
1251
1251
|
}
|
|
1252
1252
|
function er() {
|
|
1253
1253
|
return W ? "unset" : d === "x" ? "pan-y" : "pan-x";
|
|
@@ -1286,17 +1286,17 @@ function Wr({
|
|
|
1286
1286
|
immediate: !r
|
|
1287
1287
|
});
|
|
1288
1288
|
},
|
|
1289
|
-
slideToItem: (r,
|
|
1290
|
-
|
|
1289
|
+
slideToItem: (r, a = !0) => {
|
|
1290
|
+
Se({ id: r, immediate: !a });
|
|
1291
1291
|
},
|
|
1292
|
-
getIsNextItem:
|
|
1292
|
+
getIsNextItem: Ve,
|
|
1293
1293
|
getIsPrevItem: Ye,
|
|
1294
|
-
getIsActiveItem:
|
|
1294
|
+
getIsActiveItem: Be
|
|
1295
1295
|
};
|
|
1296
1296
|
Tr(() => {
|
|
1297
1297
|
P.current && p && (Z.current = !0, ye());
|
|
1298
1298
|
}, [p]), de(() => {
|
|
1299
|
-
|
|
1299
|
+
N.current !== j && (Z.current = !0, Se({
|
|
1300
1300
|
id: j,
|
|
1301
1301
|
immediate: !O
|
|
1302
1302
|
}));
|
|
@@ -1318,7 +1318,7 @@ function Wr({
|
|
|
1318
1318
|
throw new Error("`withLoop` and `freeScroll` can't be used together.");
|
|
1319
1319
|
if (u && v === "fixed")
|
|
1320
1320
|
throw new Error("`freeScroll` can't be used when `scrollType: fixed`.");
|
|
1321
|
-
if (
|
|
1321
|
+
if (B && (v !== "fluid" || !u))
|
|
1322
1322
|
throw new Error(
|
|
1323
1323
|
"`enableFreeScrollDrag` must be used with `slideType: fluid` and `freeScroll=true`"
|
|
1324
1324
|
);
|
|
@@ -1337,7 +1337,7 @@ function Wr({
|
|
|
1337
1337
|
l,
|
|
1338
1338
|
v,
|
|
1339
1339
|
u,
|
|
1340
|
-
|
|
1340
|
+
B,
|
|
1341
1341
|
ee
|
|
1342
1342
|
]), de(() => {
|
|
1343
1343
|
if (!p)
|
|
@@ -1351,17 +1351,17 @@ function Wr({
|
|
|
1351
1351
|
}, [p]), de(() => {
|
|
1352
1352
|
if (E.current) {
|
|
1353
1353
|
let r;
|
|
1354
|
-
const
|
|
1354
|
+
const a = new _r(() => {
|
|
1355
1355
|
if (!L.current && !Z.current) {
|
|
1356
1356
|
ge.current = window.innerWidth;
|
|
1357
|
-
const
|
|
1357
|
+
const o = Fe();
|
|
1358
1358
|
window.clearTimeout(r), r = setTimeout(() => {
|
|
1359
|
-
he.current = M(), typeof
|
|
1359
|
+
he.current = M(), typeof o == "function" && o();
|
|
1360
1360
|
}, 100);
|
|
1361
1361
|
}
|
|
1362
1362
|
});
|
|
1363
|
-
return
|
|
1364
|
-
|
|
1363
|
+
return a.observe(E.current), () => {
|
|
1364
|
+
a.disconnect();
|
|
1365
1365
|
};
|
|
1366
1366
|
}
|
|
1367
1367
|
}, [Fe, M]);
|
|
@@ -1401,7 +1401,7 @@ function Wr({
|
|
|
1401
1401
|
}
|
|
1402
1402
|
}
|
|
1403
1403
|
) : null,
|
|
1404
|
-
Pe.map((r,
|
|
1404
|
+
Pe.map((r, a) => /* @__PURE__ */ A.jsx(
|
|
1405
1405
|
"div",
|
|
1406
1406
|
{
|
|
1407
1407
|
className: "use-spring-carousel-item",
|
|
@@ -1411,19 +1411,19 @@ function Wr({
|
|
|
1411
1411
|
position: "relative",
|
|
1412
1412
|
...v === "fixed" ? { flex: "1" } : {},
|
|
1413
1413
|
...Qe(
|
|
1414
|
-
|
|
1415
|
-
(
|
|
1414
|
+
a === Pe.findIndex(
|
|
1415
|
+
(o) => o.id === Pe[Pe.length - 1].id
|
|
1416
1416
|
)
|
|
1417
1417
|
)
|
|
1418
1418
|
},
|
|
1419
1419
|
children: typeof r.renderItem == "function" ? r.renderItem({
|
|
1420
|
-
getIsActiveItem:
|
|
1421
|
-
getIsNextItem:
|
|
1420
|
+
getIsActiveItem: Be,
|
|
1421
|
+
getIsNextItem: Ve,
|
|
1422
1422
|
getIsPrevItem: Ye,
|
|
1423
1423
|
useListenToCustomEvent: ce
|
|
1424
1424
|
}) : r.renderItem
|
|
1425
1425
|
},
|
|
1426
|
-
`${r.id}-${
|
|
1426
|
+
`${r.id}-${a}`
|
|
1427
1427
|
)),
|
|
1428
1428
|
(u || !l) && f ? /* @__PURE__ */ A.jsx(
|
|
1429
1429
|
"div",
|
|
@@ -1466,7 +1466,7 @@ const $e = {
|
|
|
1466
1466
|
position: "absolute"
|
|
1467
1467
|
}
|
|
1468
1468
|
};
|
|
1469
|
-
function
|
|
1469
|
+
function Sr({
|
|
1470
1470
|
init: n = !0,
|
|
1471
1471
|
disableGestures: p = !1,
|
|
1472
1472
|
items: y,
|
|
@@ -1480,7 +1480,7 @@ function Vr({
|
|
|
1480
1480
|
draggingSlideTreshold: W = 50,
|
|
1481
1481
|
thumbsSlideAxis: q = "x"
|
|
1482
1482
|
}) {
|
|
1483
|
-
const _ = $("next"), u = $("initial"),
|
|
1483
|
+
const _ = $("next"), u = $("initial"), B = $(null), [x, oe] = Er(l ?? 0), { emitEvent: j, useListenToCustomEvent: O } = gr(), { handleScroll: ee, thumbsFragment: re } = mr({
|
|
1484
1484
|
thumbsSlideAxis: q,
|
|
1485
1485
|
items: y,
|
|
1486
1486
|
renderThumbFnProps: {
|
|
@@ -1536,7 +1536,7 @@ function Vr({
|
|
|
1536
1536
|
};
|
|
1537
1537
|
}
|
|
1538
1538
|
de(() => {
|
|
1539
|
-
typeof l == "number" && l !== x &&
|
|
1539
|
+
typeof l == "number" && l !== x && oe(l);
|
|
1540
1540
|
}, [l]);
|
|
1541
1541
|
function Z({ to: c, slideType: R, slideMode: F }) {
|
|
1542
1542
|
_.current = R, u.current = F, j({
|
|
@@ -1549,9 +1549,9 @@ function Vr({
|
|
|
1549
1549
|
startReached: c === 0,
|
|
1550
1550
|
endReached: c === y.length - 1
|
|
1551
1551
|
}
|
|
1552
|
-
}),
|
|
1552
|
+
}), oe(c), ee(x);
|
|
1553
1553
|
}
|
|
1554
|
-
function
|
|
1554
|
+
function ae(c) {
|
|
1555
1555
|
if (!n)
|
|
1556
1556
|
return;
|
|
1557
1557
|
const R = x === 0;
|
|
@@ -1613,7 +1613,7 @@ function Vr({
|
|
|
1613
1613
|
return;
|
|
1614
1614
|
j({
|
|
1615
1615
|
eventName: "onRightSwipe"
|
|
1616
|
-
}),
|
|
1616
|
+
}), ae("swipe");
|
|
1617
1617
|
}
|
|
1618
1618
|
}
|
|
1619
1619
|
},
|
|
@@ -1621,7 +1621,7 @@ function Vr({
|
|
|
1621
1621
|
enabled: !p
|
|
1622
1622
|
}
|
|
1623
1623
|
);
|
|
1624
|
-
function
|
|
1624
|
+
function N(c, R) {
|
|
1625
1625
|
let F = 0;
|
|
1626
1626
|
if (typeof c == "string" ? F = y.findIndex((te) => te.id === c) : F = c, F < 0 || F >= y.length) {
|
|
1627
1627
|
if (R)
|
|
@@ -1631,11 +1631,11 @@ function Vr({
|
|
|
1631
1631
|
return F;
|
|
1632
1632
|
}
|
|
1633
1633
|
function I(c) {
|
|
1634
|
-
const R =
|
|
1634
|
+
const R = N(c, "The item doesn't exist; check the provided id."), F = x;
|
|
1635
1635
|
return T && F === y.length - 1 ? R === 0 : R === F + 1;
|
|
1636
1636
|
}
|
|
1637
1637
|
function g(c) {
|
|
1638
|
-
const R =
|
|
1638
|
+
const R = N(c, "The item doesn't exist; check the provided id."), F = x;
|
|
1639
1639
|
return T && F === 0 ? R === y.length - 1 : R === F - 1;
|
|
1640
1640
|
}
|
|
1641
1641
|
const E = ve((c, R, F, te) => {
|
|
@@ -1664,12 +1664,12 @@ function Vr({
|
|
|
1664
1664
|
);
|
|
1665
1665
|
}), P = {
|
|
1666
1666
|
useListenToCustomEvent: O,
|
|
1667
|
-
slideToPrevItem: () =>
|
|
1667
|
+
slideToPrevItem: () => ae("click"),
|
|
1668
1668
|
slideToNextItem: () => z("click")
|
|
1669
1669
|
}, he = /* @__PURE__ */ A.jsx(nr.Provider, { value: P, children: re }), ge = /* @__PURE__ */ A.jsx(nr.Provider, { value: P, children: /* @__PURE__ */ A.jsx(
|
|
1670
1670
|
"div",
|
|
1671
1671
|
{
|
|
1672
|
-
ref:
|
|
1672
|
+
ref: B,
|
|
1673
1673
|
...we(),
|
|
1674
1674
|
style: {
|
|
1675
1675
|
display: "flex",
|
|
@@ -1688,7 +1688,7 @@ function Vr({
|
|
|
1688
1688
|
};
|
|
1689
1689
|
}
|
|
1690
1690
|
const nr = fr(void 0);
|
|
1691
|
-
function
|
|
1691
|
+
function Vr() {
|
|
1692
1692
|
const n = dr(nr);
|
|
1693
1693
|
if (!n)
|
|
1694
1694
|
throw new Error("useTransitionCarouselContext must be used within the carousel.");
|
|
@@ -1697,7 +1697,7 @@ function Sr() {
|
|
|
1697
1697
|
export {
|
|
1698
1698
|
Wr as useSpringCarousel,
|
|
1699
1699
|
Nr as useSpringCarouselContext,
|
|
1700
|
-
|
|
1701
|
-
|
|
1700
|
+
Sr as useTransitionCarousel,
|
|
1701
|
+
Vr as useTransitionCarouselContext
|
|
1702
1702
|
};
|
|
1703
1703
|
//# sourceMappingURL=index.es.js.map
|