react-spring-carousel 3.0.0-beta090.42 → 3.0.0-beta090.43
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 +5 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +84 -84
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -27,13 +27,13 @@ function kr() {
|
|
|
27
27
|
cr = 1;
|
|
28
28
|
var n = lr, m = Symbol.for("react.element"), p = Symbol.for("react.fragment"), $ = Object.prototype.hasOwnProperty, B = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
29
29
|
function R(l, f, d) {
|
|
30
|
-
var
|
|
30
|
+
var N, A = {}, C = null, u = null;
|
|
31
31
|
d !== void 0 && (C = "" + d), f.key !== void 0 && (C = "" + f.key), f.ref !== void 0 && (u = f.ref);
|
|
32
|
-
for (
|
|
33
|
-
$.call(f,
|
|
32
|
+
for (N in f)
|
|
33
|
+
$.call(f, N) && !v.hasOwnProperty(N) && (A[N] = f[N]);
|
|
34
34
|
if (l && l.defaultProps)
|
|
35
|
-
for (
|
|
36
|
-
A[
|
|
35
|
+
for (N in f = l.defaultProps, f)
|
|
36
|
+
A[N] === void 0 && (A[N] = f[N]);
|
|
37
37
|
return { $$typeof: m, type: l, key: C, ref: u, props: A, _owner: B.current };
|
|
38
38
|
}
|
|
39
39
|
return He.Fragment = p, He.jsx = R, He.jsxs = R, He;
|
|
@@ -51,7 +51,7 @@ var Je = {};
|
|
|
51
51
|
var sr;
|
|
52
52
|
function Pr() {
|
|
53
53
|
return sr || (sr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
54
|
-
var n = lr, m = Symbol.for("react.element"), p = Symbol.for("react.portal"), $ = Symbol.for("react.fragment"), B = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), R = Symbol.for("react.provider"), l = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"),
|
|
54
|
+
var n = lr, m = Symbol.for("react.element"), p = Symbol.for("react.portal"), $ = Symbol.for("react.fragment"), B = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), R = Symbol.for("react.provider"), l = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), N = Symbol.for("react.suspense_list"), A = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), u = Symbol.for("react.offscreen"), q = Symbol.iterator, y = "@@iterator";
|
|
55
55
|
function ae(e) {
|
|
56
56
|
if (e === null || typeof e != "object")
|
|
57
57
|
return null;
|
|
@@ -79,7 +79,7 @@ function Pr() {
|
|
|
79
79
|
var Ne = !1, ne = !1, Y = !1, ie = !1, oe = !1, z;
|
|
80
80
|
z = Symbol.for("react.module.reference");
|
|
81
81
|
function Te(e) {
|
|
82
|
-
return !!(typeof e == "string" || typeof e == "function" || e === $ || e === v || oe || e === B || e === d || e ===
|
|
82
|
+
return !!(typeof e == "string" || typeof e == "function" || e === $ || e === v || oe || e === B || e === d || e === N || ie || e === u || Ne || ne || Y || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === A || e.$$typeof === R || 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.
|
|
@@ -92,7 +92,7 @@ function Pr() {
|
|
|
92
92
|
var E = t.displayName || t.name || "";
|
|
93
93
|
return E !== "" ? i + "(" + E + ")" : i;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function D(e) {
|
|
96
96
|
return e.displayName || "Context";
|
|
97
97
|
}
|
|
98
98
|
function x(e) {
|
|
@@ -113,17 +113,17 @@ function Pr() {
|
|
|
113
113
|
return "StrictMode";
|
|
114
114
|
case d:
|
|
115
115
|
return "Suspense";
|
|
116
|
-
case
|
|
116
|
+
case N:
|
|
117
117
|
return "SuspenseList";
|
|
118
118
|
}
|
|
119
119
|
if (typeof e == "object")
|
|
120
120
|
switch (e.$$typeof) {
|
|
121
121
|
case l:
|
|
122
122
|
var t = e;
|
|
123
|
-
return
|
|
123
|
+
return D(t) + ".Consumer";
|
|
124
124
|
case R:
|
|
125
125
|
var i = e;
|
|
126
|
-
return
|
|
126
|
+
return D(i._context) + ".Provider";
|
|
127
127
|
case f:
|
|
128
128
|
return Q(e, e.render, "ForwardRef");
|
|
129
129
|
case A:
|
|
@@ -140,14 +140,14 @@ function Pr() {
|
|
|
140
140
|
}
|
|
141
141
|
return null;
|
|
142
142
|
}
|
|
143
|
-
var b = Object.assign, w = 0,
|
|
143
|
+
var b = Object.assign, w = 0, M, me, pe, c, T, I, X;
|
|
144
144
|
function H() {
|
|
145
145
|
}
|
|
146
146
|
H.__reactDisabledLog = !0;
|
|
147
147
|
function ze() {
|
|
148
148
|
{
|
|
149
149
|
if (w === 0) {
|
|
150
|
-
|
|
150
|
+
M = console.log, me = console.info, pe = console.warn, c = console.error, T = console.group, I = console.groupCollapsed, X = console.groupEnd;
|
|
151
151
|
var e = {
|
|
152
152
|
configurable: !0,
|
|
153
153
|
enumerable: !0,
|
|
@@ -177,7 +177,7 @@ function Pr() {
|
|
|
177
177
|
};
|
|
178
178
|
Object.defineProperties(console, {
|
|
179
179
|
log: b({}, e, {
|
|
180
|
-
value:
|
|
180
|
+
value: M
|
|
181
181
|
}),
|
|
182
182
|
info: b({}, e, {
|
|
183
183
|
value: me
|
|
@@ -218,8 +218,8 @@ function Pr() {
|
|
|
218
218
|
}
|
|
219
219
|
var ge = !1, Pe;
|
|
220
220
|
{
|
|
221
|
-
var
|
|
222
|
-
Pe = new
|
|
221
|
+
var Qe = typeof WeakMap == "function" ? WeakMap : Map;
|
|
222
|
+
Pe = new Qe();
|
|
223
223
|
}
|
|
224
224
|
function Ve(e, t) {
|
|
225
225
|
if (!e || ge)
|
|
@@ -309,7 +309,7 @@ function Pr() {
|
|
|
309
309
|
switch (e) {
|
|
310
310
|
case d:
|
|
311
311
|
return ue("Suspense");
|
|
312
|
-
case
|
|
312
|
+
case N:
|
|
313
313
|
return ue("SuspenseList");
|
|
314
314
|
}
|
|
315
315
|
if (typeof e == "object")
|
|
@@ -328,13 +328,13 @@ function Pr() {
|
|
|
328
328
|
}
|
|
329
329
|
return "";
|
|
330
330
|
}
|
|
331
|
-
var k = Object.prototype.hasOwnProperty, ce = {},
|
|
331
|
+
var k = Object.prototype.hasOwnProperty, ce = {}, W = F.ReactDebugCurrentFrame;
|
|
332
332
|
function je(e) {
|
|
333
333
|
if (e) {
|
|
334
334
|
var t = e._owner, i = Fe(e.type, e._source, t ? t.type : null);
|
|
335
|
-
|
|
335
|
+
W.setExtraStackFrame(i);
|
|
336
336
|
} else
|
|
337
|
-
|
|
337
|
+
W.setExtraStackFrame(null);
|
|
338
338
|
}
|
|
339
339
|
function Re(e, t, i, s, E) {
|
|
340
340
|
{
|
|
@@ -379,12 +379,12 @@ function Pr() {
|
|
|
379
379
|
if (_e(e))
|
|
380
380
|
return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ee(e)), se(e);
|
|
381
381
|
}
|
|
382
|
-
var Ce = F.ReactCurrentOwner,
|
|
382
|
+
var Ce = F.ReactCurrentOwner, Ge = {
|
|
383
383
|
key: !0,
|
|
384
384
|
ref: !0,
|
|
385
385
|
__self: !0,
|
|
386
386
|
__source: !0
|
|
387
|
-
}, er,
|
|
387
|
+
}, er, Ze, Se;
|
|
388
388
|
Se = {};
|
|
389
389
|
function Oe(e) {
|
|
390
390
|
if (k.call(e, "ref")) {
|
|
@@ -422,7 +422,7 @@ function Pr() {
|
|
|
422
422
|
function Ue(e, t) {
|
|
423
423
|
{
|
|
424
424
|
var i = function() {
|
|
425
|
-
|
|
425
|
+
Ze || (Ze = !0, j("%s: `ref` 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));
|
|
426
426
|
};
|
|
427
427
|
i.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
428
428
|
get: i,
|
|
@@ -464,7 +464,7 @@ function Pr() {
|
|
|
464
464
|
var _, g = {}, h = null, J = null;
|
|
465
465
|
i !== void 0 && (le(i), h = "" + i), rr(t) && (le(t.key), h = "" + t.key), Oe(t) && (J = t.ref, xe(t, E));
|
|
466
466
|
for (_ in t)
|
|
467
|
-
k.call(t, _) && !
|
|
467
|
+
k.call(t, _) && !Ge.hasOwnProperty(_) && (g[_] = t[_]);
|
|
468
468
|
if (e && e.defaultProps) {
|
|
469
469
|
var V = e.defaultProps;
|
|
470
470
|
for (_ in V)
|
|
@@ -745,7 +745,7 @@ function pr({
|
|
|
745
745
|
});
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function N() {
|
|
749
749
|
function C(u) {
|
|
750
750
|
return u.map((q) => ({
|
|
751
751
|
id: q.id,
|
|
@@ -773,7 +773,7 @@ function pr({
|
|
|
773
773
|
maxHeight: "100%"
|
|
774
774
|
}
|
|
775
775
|
},
|
|
776
|
-
children:
|
|
776
|
+
children: N().map(({ id: C, renderThumb: u }) => {
|
|
777
777
|
const q = `thumb-item-${C}`;
|
|
778
778
|
return /* @__PURE__ */ L.jsx("div", { id: q, className: "thumb-item", children: typeof u == "function" ? u(B) : u }, q);
|
|
779
779
|
})
|
|
@@ -793,7 +793,7 @@ function Nr({
|
|
|
793
793
|
withLoop: l = !1,
|
|
794
794
|
startEndGutter: f = 0,
|
|
795
795
|
carouselSlideAxis: d = "x",
|
|
796
|
-
disableGestures:
|
|
796
|
+
disableGestures: N = !1,
|
|
797
797
|
draggingSlideTreshold: A,
|
|
798
798
|
slideWhenThresholdIsReached: C = !1,
|
|
799
799
|
freeScroll: u,
|
|
@@ -806,7 +806,7 @@ function Nr({
|
|
|
806
806
|
__unstable_stretch_tems__: Ne = !0,
|
|
807
807
|
slideAmount: ne
|
|
808
808
|
}) {
|
|
809
|
-
const Y = B, ie = O(!1), oe = O(A ?? 0), z = O("initial"), Te = O("initial"), Q = O("initial"),
|
|
809
|
+
const Y = B, ie = O(!1), oe = O(A ?? 0), z = O("initial"), Te = O("initial"), Q = O("initial"), D = O(F), x = O(F === 0), b = O(v === "fixed" && F === n.length - 1), w = O(null), M = O(null), me = O(0), pe = O(0), c = O(0), T = O(l), I = O(v), X = O(u), H = O(!1), ke = Me(() => l ? [
|
|
810
810
|
...n.map((r) => ({
|
|
811
811
|
...r,
|
|
812
812
|
id: `prev-repeated-item-${r.id}`
|
|
@@ -821,11 +821,11 @@ function Nr({
|
|
|
821
821
|
val: 0,
|
|
822
822
|
pause: !m,
|
|
823
823
|
onChange: ({ value: r }) => {
|
|
824
|
-
u && w.current ? (d === "x" ? w.current.scrollLeft = Math.abs(r.val) : w.current.scrollTop = Math.abs(r.val), Oe()) :
|
|
824
|
+
u && w.current ? (d === "x" ? w.current.scrollLeft = Math.abs(r.val) : w.current.scrollTop = Math.abs(r.val), Oe()) : M.current && (d === "x" ? M.current.style.transform = `translate3d(${r.val}px, 0px,0px)` : M.current.style.transform = `translate3d(0px,${r.val}px,0px)`);
|
|
825
825
|
}
|
|
826
826
|
}),
|
|
827
827
|
[u]
|
|
828
|
-
), { emitEvent: ue, useListenToCustomEvent: ge } = mr(), { thumbsFragment: Pe, handleScroll:
|
|
828
|
+
), { emitEvent: ue, useListenToCustomEvent: ge } = mr(), { thumbsFragment: Pe, handleScroll: Qe } = pr({
|
|
829
829
|
withThumbs: !!p,
|
|
830
830
|
thumbsSlideAxis: $,
|
|
831
831
|
prepareThumbsData: ae,
|
|
@@ -873,15 +873,15 @@ function Nr({
|
|
|
873
873
|
f
|
|
874
874
|
]);
|
|
875
875
|
function ce({ from: r, to: o, nextActiveItem: a, immediate: P = !1, slideMode: K }) {
|
|
876
|
-
Te.current = K, typeof a == "number" && (u || (
|
|
876
|
+
Te.current = K, typeof a == "number" && (u || (D.current = a), ue({
|
|
877
877
|
eventName: "onSlideStartChange",
|
|
878
878
|
slideActionType: z.current,
|
|
879
879
|
slideMode: Te.current,
|
|
880
880
|
nextItem: {
|
|
881
881
|
startReached: x.current,
|
|
882
882
|
endReached: b.current,
|
|
883
|
-
index: u ? -1 :
|
|
884
|
-
id: u ? "" : n[
|
|
883
|
+
index: u ? -1 : D.current,
|
|
884
|
+
id: u ? "" : n[D.current].id
|
|
885
885
|
}
|
|
886
886
|
})), c.current = o, U.start({
|
|
887
887
|
immediate: P,
|
|
@@ -903,19 +903,19 @@ function Nr({
|
|
|
903
903
|
currentItem: {
|
|
904
904
|
startReached: x.current,
|
|
905
905
|
endReached: b.current,
|
|
906
|
-
index: u ? -1 :
|
|
907
|
-
id: u ? "" : n[
|
|
906
|
+
index: u ? -1 : D.current,
|
|
907
|
+
id: u ? "" : n[D.current].id
|
|
908
908
|
}
|
|
909
909
|
});
|
|
910
910
|
}
|
|
911
|
-
}), p && !P &&
|
|
911
|
+
}), p && !P && Qe(D.current);
|
|
912
912
|
}
|
|
913
|
-
const
|
|
913
|
+
const W = Me(() => {
|
|
914
914
|
var r;
|
|
915
|
-
return
|
|
915
|
+
return M.current ? l ? k() * n.length : Math.round(
|
|
916
916
|
Number(
|
|
917
|
-
(r =
|
|
918
|
-
) -
|
|
917
|
+
(r = M.current) == null ? void 0 : r[d === "x" ? "scrollWidth" : "scrollHeight"]
|
|
918
|
+
) - M.current.getBoundingClientRect()[d === "x" ? "width" : "height"] - f * 2
|
|
919
919
|
) : 0;
|
|
920
920
|
}, [d, k, n.length, f, l]);
|
|
921
921
|
function je() {
|
|
@@ -927,31 +927,31 @@ function Nr({
|
|
|
927
927
|
}
|
|
928
928
|
const Re = Me(() => {
|
|
929
929
|
var o;
|
|
930
|
-
const r = (o =
|
|
930
|
+
const r = (o = M.current) == null ? void 0 : o.querySelector(".use-spring-carousel-item");
|
|
931
931
|
if (!r)
|
|
932
932
|
throw Error("No carousel items available!");
|
|
933
933
|
return r.getBoundingClientRect()[d === "x" ? "width" : "height"] + R;
|
|
934
934
|
}, [d, R]), we = Me(
|
|
935
935
|
(r) => {
|
|
936
|
-
const o = d === "x" ? "left" : "top", a =
|
|
936
|
+
const o = d === "x" ? "left" : "top", a = M.current;
|
|
937
937
|
a && (l ? (a.style.top = "0px", a.style.left = "0px", a.style[o] = `-${r - f}px`, x.current = !1, b.current = !1) : (a.style.left = "0px", a.style.top = "0px"));
|
|
938
938
|
},
|
|
939
939
|
[d, f, l]
|
|
940
940
|
), ye = Me(
|
|
941
941
|
(r = !1) => {
|
|
942
|
-
if (
|
|
942
|
+
if (M.current && r && (M.current.style.transform = "translate3d(0px, 0px,0px)", M.current.style.left = "0", M.current.style.top = "0"), v === "fixed" && we(
|
|
943
943
|
y === "center" ? Re() * n.length - k() * Math.round((Y - 1) / 2) : y === "end" ? Re() * n.length - k() * Math.round(Y - 1) : Re() * n.length
|
|
944
944
|
), v === "fluid") {
|
|
945
|
-
if (we(Re() * n.length), b.current &&
|
|
946
|
-
const o = -
|
|
945
|
+
if (we(Re() * n.length), b.current && W() !== Math.abs(c.current) && !l) {
|
|
946
|
+
const o = -W();
|
|
947
947
|
c.current = o, U.start({
|
|
948
948
|
immediate: !0,
|
|
949
949
|
val: c.current
|
|
950
950
|
});
|
|
951
951
|
return;
|
|
952
952
|
}
|
|
953
|
-
if (Math.abs(c.current) > 0 &&
|
|
954
|
-
const o = me.current -
|
|
953
|
+
if (Math.abs(c.current) > 0 && W() !== Math.abs(c.current) && !l && !u && Q.current === "backward") {
|
|
954
|
+
const o = me.current - W(), a = c.current + o;
|
|
955
955
|
return U.start({
|
|
956
956
|
immediate: !0,
|
|
957
957
|
val: a
|
|
@@ -962,9 +962,9 @@ function Nr({
|
|
|
962
962
|
return;
|
|
963
963
|
}
|
|
964
964
|
if (!u && v === "fixed") {
|
|
965
|
-
const o = -(k() *
|
|
966
|
-
if (Math.abs(o) >
|
|
967
|
-
const a = -
|
|
965
|
+
const o = -(k() * D.current);
|
|
966
|
+
if (Math.abs(o) > W() && !l) {
|
|
967
|
+
const a = -W();
|
|
968
968
|
b.current = !0, c.current = a, U.start({
|
|
969
969
|
immediate: !0,
|
|
970
970
|
val: c.current
|
|
@@ -983,7 +983,7 @@ function Nr({
|
|
|
983
983
|
u,
|
|
984
984
|
Re,
|
|
985
985
|
k,
|
|
986
|
-
|
|
986
|
+
W,
|
|
987
987
|
y,
|
|
988
988
|
n.length,
|
|
989
989
|
Y,
|
|
@@ -999,7 +999,7 @@ function Nr({
|
|
|
999
999
|
function _e(r, o) {
|
|
1000
1000
|
if (u && r === "next") {
|
|
1001
1001
|
const a = c.current + k();
|
|
1002
|
-
return a >
|
|
1002
|
+
return a > W() ? W() : a;
|
|
1003
1003
|
}
|
|
1004
1004
|
if (u && r === "prev") {
|
|
1005
1005
|
const a = c.current - k();
|
|
@@ -1011,7 +1011,7 @@ function Nr({
|
|
|
1011
1011
|
if (!m || H.current || x.current && !l)
|
|
1012
1012
|
return;
|
|
1013
1013
|
b.current && (Q.current = "backward"), z.current = "prev", b.current = !1;
|
|
1014
|
-
const P = typeof o == "number" ? o :
|
|
1014
|
+
const P = typeof o == "number" ? o : D.current - 1;
|
|
1015
1015
|
if (u && Oe(), !l) {
|
|
1016
1016
|
const K = u ? _e("prev", o) - k() / 3 < 0 : _e("prev", o) + k() / 3 > 0;
|
|
1017
1017
|
if (x.current)
|
|
@@ -1049,16 +1049,16 @@ function Nr({
|
|
|
1049
1049
|
if (!m || H.current || b.current && !l)
|
|
1050
1050
|
return;
|
|
1051
1051
|
x.current && (Q.current = "forward"), z.current = "next", x.current = !1;
|
|
1052
|
-
const P = o ||
|
|
1052
|
+
const P = o || D.current + 1;
|
|
1053
1053
|
if (u && Oe(), !l) {
|
|
1054
|
-
const K = Math.abs(_e("next", o)) >
|
|
1054
|
+
const K = Math.abs(_e("next", o)) > W() - k() / 3;
|
|
1055
1055
|
if (b.current)
|
|
1056
1056
|
return;
|
|
1057
1057
|
if (K) {
|
|
1058
1058
|
x.current = !1, b.current = !0, ce({
|
|
1059
1059
|
slideMode: r,
|
|
1060
1060
|
from: ee(),
|
|
1061
|
-
to: u ?
|
|
1061
|
+
to: u ? W() : -W(),
|
|
1062
1062
|
nextActiveItem: P,
|
|
1063
1063
|
immediate: a
|
|
1064
1064
|
});
|
|
@@ -1086,12 +1086,12 @@ function Nr({
|
|
|
1086
1086
|
function Ce() {
|
|
1087
1087
|
A ? oe.current = A : oe.current = Math.floor(k() / 2 / 2);
|
|
1088
1088
|
}
|
|
1089
|
-
function
|
|
1090
|
-
|
|
1089
|
+
function Ge() {
|
|
1090
|
+
M.current && (me.current = W(), T.current = l, I.current = v, X.current = u, pe.current = window.innerWidth, c.current = 0, Ye({ id: D.current, immediate: !0, shouldReset: !0 }), Ce(), ye());
|
|
1091
1091
|
}
|
|
1092
|
-
const
|
|
1092
|
+
const Ze = hr(
|
|
1093
1093
|
(r) => {
|
|
1094
|
-
const o = r.dragging, a = r.offset[d === "x" ? 0 : 1], P = r.movement[d === "x" ? 0 : 1], K = r.direction[d === "x" ? 0 : 1], fe = P > oe.current, de = P < -oe.current, tr =
|
|
1094
|
+
const o = r.dragging, a = r.offset[d === "x" ? 0 : 1], P = r.movement[d === "x" ? 0 : 1], K = r.direction[d === "x" ? 0 : 1], fe = P > oe.current, de = P < -oe.current, tr = W(), re = r.velocity;
|
|
1095
1095
|
if (o) {
|
|
1096
1096
|
if (K > 0 ? z.current = "prev" : z.current = "next", ue({
|
|
1097
1097
|
...r,
|
|
@@ -1162,7 +1162,7 @@ function Nr({
|
|
|
1162
1162
|
velocity: re
|
|
1163
1163
|
}
|
|
1164
1164
|
}) : de ? !l && b.current ? U.start({
|
|
1165
|
-
val: -
|
|
1165
|
+
val: -W(),
|
|
1166
1166
|
config: {
|
|
1167
1167
|
...Ie.default,
|
|
1168
1168
|
velocity: re
|
|
@@ -1188,7 +1188,7 @@ function Nr({
|
|
|
1188
1188
|
});
|
|
1189
1189
|
},
|
|
1190
1190
|
{
|
|
1191
|
-
enabled: m && !
|
|
1191
|
+
enabled: m && !N && !u || !!u && !!q,
|
|
1192
1192
|
axis: d,
|
|
1193
1193
|
from: () => u && w.current ? [
|
|
1194
1194
|
-w.current.scrollLeft,
|
|
@@ -1204,7 +1204,7 @@ function Nr({
|
|
|
1204
1204
|
} : {};
|
|
1205
1205
|
}
|
|
1206
1206
|
function Oe() {
|
|
1207
|
-
w.current && (c.current = w.current[d === "x" ? "scrollLeft" : "scrollTop"], w.current[d === "x" ? "scrollLeft" : "scrollTop"] === 0 && (x.current = !0, b.current = !1), w.current[d === "x" ? "scrollLeft" : "scrollTop"] > 0 && w.current[d === "x" ? "scrollLeft" : "scrollTop"] <
|
|
1207
|
+
w.current && (c.current = w.current[d === "x" ? "scrollLeft" : "scrollTop"], w.current[d === "x" ? "scrollLeft" : "scrollTop"] === 0 && (x.current = !0, b.current = !1), w.current[d === "x" ? "scrollLeft" : "scrollTop"] > 0 && w.current[d === "x" ? "scrollLeft" : "scrollTop"] < W() && (x.current = !1, b.current = !1), w.current[d === "x" ? "scrollLeft" : "scrollTop"] === W() && (x.current = !1, b.current = !0));
|
|
1208
1208
|
}
|
|
1209
1209
|
function rr() {
|
|
1210
1210
|
return u ? {
|
|
@@ -1230,9 +1230,9 @@ function Nr({
|
|
|
1230
1230
|
r,
|
|
1231
1231
|
"The item you want to slide to doesn't exist; check the provided id."
|
|
1232
1232
|
);
|
|
1233
|
-
if (K ===
|
|
1233
|
+
if (K === D.current && !a)
|
|
1234
1234
|
return;
|
|
1235
|
-
const fe = xe(n[
|
|
1235
|
+
const fe = xe(n[D.current].id), de = xe(n[K].id);
|
|
1236
1236
|
de > fe ? le({
|
|
1237
1237
|
type: P || a ? "initial" : "click",
|
|
1238
1238
|
index: de,
|
|
@@ -1244,18 +1244,18 @@ function Nr({
|
|
|
1244
1244
|
});
|
|
1245
1245
|
}
|
|
1246
1246
|
function Ue(r) {
|
|
1247
|
-
const o = xe(r, "The item doesn't exist; check the provided id."), a =
|
|
1247
|
+
const o = xe(r, "The item doesn't exist; check the provided id."), a = D.current;
|
|
1248
1248
|
return l && a === n.length - 1 ? o === 0 : o === a + 1;
|
|
1249
1249
|
}
|
|
1250
1250
|
function Be(r) {
|
|
1251
|
-
const o = xe(r, "The item doesn't exist; check the provided id."), a =
|
|
1251
|
+
const o = xe(r, "The item doesn't exist; check the provided id."), a = D.current;
|
|
1252
1252
|
return l && a === 0 ? o === n.length - 1 : o === a - 1;
|
|
1253
1253
|
}
|
|
1254
1254
|
function qe(r) {
|
|
1255
|
-
return xe(r, "The item you want to check doesn't exist; check the provided id.") ===
|
|
1255
|
+
return xe(r, "The item you want to check doesn't exist; check the provided id.") === D.current;
|
|
1256
1256
|
}
|
|
1257
1257
|
function Ae() {
|
|
1258
|
-
return
|
|
1258
|
+
return N ? "unset" : d === "x" ? "pan-y" : "pan-x";
|
|
1259
1259
|
}
|
|
1260
1260
|
const $e = u ? {
|
|
1261
1261
|
useListenToCustomEvent: ge,
|
|
@@ -1299,9 +1299,9 @@ function Nr({
|
|
|
1299
1299
|
getIsActiveItem: qe
|
|
1300
1300
|
};
|
|
1301
1301
|
Rr(() => {
|
|
1302
|
-
|
|
1302
|
+
M.current && m && (ie.current = !0, Ge());
|
|
1303
1303
|
}, [m]), he(() => {
|
|
1304
|
-
|
|
1304
|
+
D.current !== F && (ie.current = !0, Ye({
|
|
1305
1305
|
id: F,
|
|
1306
1306
|
immediate: !j
|
|
1307
1307
|
}));
|
|
@@ -1331,7 +1331,7 @@ function Nr({
|
|
|
1331
1331
|
throw new Error("`slideGroupOfItems` and `freeScroll` can't be used together.");
|
|
1332
1332
|
if (typeof ne == "number" && ne > 0 && v === "fixed")
|
|
1333
1333
|
throw new Error("`slideAmount` must be used with `slideType: fluid`");
|
|
1334
|
-
ie.current = !0
|
|
1334
|
+
ie.current = !0;
|
|
1335
1335
|
}
|
|
1336
1336
|
}, [
|
|
1337
1337
|
y,
|
|
@@ -1361,7 +1361,7 @@ function Nr({
|
|
|
1361
1361
|
pe.current = window.innerWidth;
|
|
1362
1362
|
const a = ye();
|
|
1363
1363
|
window.clearTimeout(r), r = setTimeout(() => {
|
|
1364
|
-
me.current =
|
|
1364
|
+
me.current = W(), typeof a == "function" && a();
|
|
1365
1365
|
}, 100);
|
|
1366
1366
|
}
|
|
1367
1367
|
});
|
|
@@ -1369,7 +1369,7 @@ function Nr({
|
|
|
1369
1369
|
o.disconnect();
|
|
1370
1370
|
};
|
|
1371
1371
|
}
|
|
1372
|
-
}, [ye,
|
|
1372
|
+
}, [ye, W]);
|
|
1373
1373
|
const be = /* @__PURE__ */ L.jsx(ar.Provider, { value: $e, children: Pe }), Le = /* @__PURE__ */ L.jsx(ar.Provider, { value: $e, children: /* @__PURE__ */ L.jsx(
|
|
1374
1374
|
"div",
|
|
1375
1375
|
{
|
|
@@ -1387,8 +1387,8 @@ function Nr({
|
|
|
1387
1387
|
"div",
|
|
1388
1388
|
{
|
|
1389
1389
|
className: "use-spring-carousel-track-wrapper",
|
|
1390
|
-
ref:
|
|
1391
|
-
...
|
|
1390
|
+
ref: M,
|
|
1391
|
+
...Ze(),
|
|
1392
1392
|
style: {
|
|
1393
1393
|
position: "relative",
|
|
1394
1394
|
display: "flex",
|
|
@@ -1481,14 +1481,14 @@ function Sr({
|
|
|
1481
1481
|
activeItem: l,
|
|
1482
1482
|
toPrevItemSpringProps: f = We,
|
|
1483
1483
|
toNextItemSpringProps: d = We,
|
|
1484
|
-
draggingSlideTreshold:
|
|
1484
|
+
draggingSlideTreshold: N = 50,
|
|
1485
1485
|
thumbsSlideAxis: A = "x"
|
|
1486
1486
|
}) {
|
|
1487
1487
|
const C = O("next"), u = O("initial"), q = O(null), [y, ae] = Tr(l ?? 0), { emitEvent: F, useListenToCustomEvent: j } = mr(), { handleScroll: te, thumbsFragment: Ne } = pr({
|
|
1488
1488
|
thumbsSlideAxis: A,
|
|
1489
1489
|
items: p,
|
|
1490
1490
|
renderThumbFnProps: {
|
|
1491
|
-
getIsNextItem:
|
|
1491
|
+
getIsNextItem: D,
|
|
1492
1492
|
getIsPrevItem: x,
|
|
1493
1493
|
useListenToCustomEvent: j,
|
|
1494
1494
|
activeItem: {
|
|
@@ -1605,7 +1605,7 @@ function Sr({
|
|
|
1605
1605
|
}), Te = hr(
|
|
1606
1606
|
({ last: c, movement: [T] }) => {
|
|
1607
1607
|
if (c) {
|
|
1608
|
-
const I = T >
|
|
1608
|
+
const I = T > N, X = T < -N, H = y === 0, ze = y === p.length - 1;
|
|
1609
1609
|
if (X) {
|
|
1610
1610
|
if (!R && ze)
|
|
1611
1611
|
return;
|
|
@@ -1634,7 +1634,7 @@ function Sr({
|
|
|
1634
1634
|
}
|
|
1635
1635
|
return I;
|
|
1636
1636
|
}
|
|
1637
|
-
function
|
|
1637
|
+
function D(c) {
|
|
1638
1638
|
const T = Q(c, "The item doesn't exist; check the provided id."), I = y;
|
|
1639
1639
|
return R && I === p.length - 1 ? T === 0 : T === I + 1;
|
|
1640
1640
|
}
|
|
@@ -1657,7 +1657,7 @@ function Sr({
|
|
|
1657
1657
|
},
|
|
1658
1658
|
children: typeof H == "function" ? H({
|
|
1659
1659
|
useListenToCustomEvent: j,
|
|
1660
|
-
getIsNextItem:
|
|
1660
|
+
getIsNextItem: D,
|
|
1661
1661
|
getIsPrevItem: x,
|
|
1662
1662
|
activeItem: {
|
|
1663
1663
|
index: y,
|
|
@@ -1670,7 +1670,7 @@ function Sr({
|
|
|
1670
1670
|
function w() {
|
|
1671
1671
|
return m ? "unset" : "pan-y";
|
|
1672
1672
|
}
|
|
1673
|
-
const
|
|
1673
|
+
const M = {
|
|
1674
1674
|
useListenToCustomEvent: j,
|
|
1675
1675
|
slideToPrevItem: () => ie("click"),
|
|
1676
1676
|
slideToNextItem: () => oe("click"),
|
|
@@ -1689,7 +1689,7 @@ function Sr({
|
|
|
1689
1689
|
slideMode: "click"
|
|
1690
1690
|
});
|
|
1691
1691
|
}
|
|
1692
|
-
}, me = /* @__PURE__ */ L.jsx(or.Provider, { value:
|
|
1692
|
+
}, me = /* @__PURE__ */ L.jsx(or.Provider, { value: M, children: Ne }), pe = /* @__PURE__ */ L.jsx(or.Provider, { value: M, children: /* @__PURE__ */ L.jsx(
|
|
1693
1693
|
"div",
|
|
1694
1694
|
{
|
|
1695
1695
|
className: "use-transition-carousel-wrapper",
|
|
@@ -1707,7 +1707,7 @@ function Sr({
|
|
|
1707
1707
|
}
|
|
1708
1708
|
) });
|
|
1709
1709
|
return {
|
|
1710
|
-
...
|
|
1710
|
+
...M,
|
|
1711
1711
|
carouselFragment: pe,
|
|
1712
1712
|
thumbsFragment: me
|
|
1713
1713
|
};
|