@smwb/ui-react 2.1.2 → 2.2.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/assets/styles/less/components/carousel/carousel.entry.css +1 -1
- package/dist/components/dataDisplay/carousel/carousel.js +169 -150
- package/dist/components/dataDisplay/carousel/carousel.js.map +1 -1
- package/dist/components/dataDisplay/chat/useChatStickToBottom.js +8 -7
- package/dist/components/dataDisplay/chat/useChatStickToBottom.js.map +1 -1
- package/dist/headless/components/dataDisplay/carousel/carousel.js +169 -150
- package/dist/headless/components/dataDisplay/carousel/carousel.js.map +1 -1
- package/dist/headless/components/dataDisplay/chat/useChatStickToBottom.js +8 -7
- package/dist/headless/components/dataDisplay/chat/useChatStickToBottom.js.map +1 -1
- package/dist/headless/hooks/useEventCallback.js +8 -7
- package/dist/headless/hooks/useEventCallback.js.map +1 -1
- package/dist/headless/hooks/useTheme.js +16 -15
- package/dist/headless/hooks/useTheme.js.map +1 -1
- package/dist/hooks/useEventCallback.js +8 -7
- package/dist/hooks/useEventCallback.js.map +1 -1
- package/dist/hooks/useTheme.js +16 -15
- package/dist/hooks/useTheme.js.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
.smwb-carousel{max-width:var(--smwb-carousel-max-width, 412px)}.smwb-carousel__inner{position:relative}.smwb-carousel__track{text-align:center;overflow:hidden;cursor:pointer;margin-left:calc(-1 * var(--smwb-carousel-gap, 4px));margin-right:calc(-1 * var(--smwb-carousel-gap, 4px));touch-action:pan-y}.smwb-carousel__layer{width:100%;height:100%;display:flex;will-change:transform}.smwb-carousel__slide{flex-shrink:0;padding-left:var(--smwb-carousel-gap, 4px);padding-right:var(--smwb-carousel-gap, 4px)}.smwb-carousel__slide-inner{border-radius:28px;overflow:hidden;will-change:width}.smwb-carousel__slide-inner_clickable{cursor:zoom-in}.smwb-carousel__slide-inner img{height:var(--smwb-carousel-cell-height, 205px);aspect-ratio:var(--smwb-carousel-aspect-ratio, .9);object-fit:cover;width:100%;user-select:none;-webkit-user-drag:none}.smwb-carousel__navigation{display:flex;justify-content:center}.smwb-carousel__navigation .current{background-color:var(--smui-onPrimaryContainerActive)}.smwb-carousel__navigation__dot{margin:3px;width:10px;height:10px;border-radius:50%;border:1px solid var(--smui-onPrimaryContainer)}.smwb-carousel__arrow{cursor:pointer;position:absolute;background:var(--smui-onPrimaryContainerActive);color:var(--smui-onPrimaryContainer);border-radius:50%;z-index:1;display:flex;align-items:center;justify-content:center}.smwb-carousel__fullscreen-content{position:relative;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.smwb-carousel__fullscreen-stage{display:flex;align-items:center;justify-content:center
|
|
1
|
+
.smwb-carousel{max-width:var(--smwb-carousel-max-width, 412px)}.smwb-carousel__inner{position:relative}.smwb-carousel__track{text-align:center;overflow:hidden;cursor:pointer;margin-left:calc(-1 * var(--smwb-carousel-gap, 4px));margin-right:calc(-1 * var(--smwb-carousel-gap, 4px));touch-action:pan-y}.smwb-carousel__layer{width:100%;height:100%;display:flex;will-change:transform}.smwb-carousel__slide{flex-shrink:0;padding-left:var(--smwb-carousel-gap, 4px);padding-right:var(--smwb-carousel-gap, 4px)}.smwb-carousel__slide-inner{border-radius:28px;overflow:hidden;will-change:width}.smwb-carousel__slide-inner_clickable{cursor:zoom-in}.smwb-carousel__slide-inner img{height:var(--smwb-carousel-cell-height, 205px);aspect-ratio:var(--smwb-carousel-aspect-ratio, .9);object-fit:cover;width:100%;user-select:none;-webkit-user-drag:none}.smwb-carousel__navigation{display:flex;justify-content:center}.smwb-carousel__navigation .current{background-color:var(--smui-onPrimaryContainerActive)}.smwb-carousel__navigation__dot{margin:3px;width:10px;height:10px;border-radius:50%;border:1px solid var(--smui-onPrimaryContainer)}.smwb-carousel__arrow{cursor:pointer;position:absolute;background:var(--smui-onPrimaryContainerActive);color:var(--smui-onPrimaryContainer);border-radius:50%;z-index:1;display:flex;align-items:center;justify-content:center}.smwb-carousel__fullscreen-content{position:relative;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.smwb-carousel__fullscreen-stage{position:relative;width:100%;height:100%;overflow:hidden;touch-action:pan-y}.smwb-carousel__fullscreen-track{display:flex;width:100%;height:100%;will-change:transform}.smwb-carousel__fullscreen-slide{flex:0 0 100%;display:flex;align-items:center;justify-content:center}.smwb-carousel__fullscreen-slide img{max-width:96vw;max-height:92vh;width:auto;height:auto;object-fit:contain;user-select:none;-webkit-user-drag:none}.smwb-carousel__fullscreen-arrow,.smwb-carousel__fullscreen-close{position:absolute;z-index:1;cursor:pointer;color:#fff;filter:drop-shadow(0 1px 2px rgba(0,0,0,.6))}.smwb-carousel__fullscreen-arrow{top:50%;transform:translateY(-50%)}.smwb-carousel__fullscreen-arrow_prev{left:16px}.smwb-carousel__fullscreen-arrow_next{right:16px}.smwb-carousel__fullscreen-close{top:16px;right:16px}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as a, Fragment as
|
|
1
|
+
import { jsx as a, Fragment as de, jsxs as j } from "react/jsx-runtime";
|
|
2
2
|
import '../../../assets/styles/less/components/carousel/carousel.entry.css';/* empty css */
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { useForkRef as
|
|
6
|
-
import { dragPrevent as
|
|
7
|
-
import { useSafeLayoutEffect as
|
|
3
|
+
import z, { forwardRef as qe, useState as _, useRef as N, useId as Je, useEffect as fe } from "react";
|
|
4
|
+
import h from "clsx";
|
|
5
|
+
import { useForkRef as Qe } from "../../../hooks/useForkRef.js";
|
|
6
|
+
import { dragPrevent as me, getStartSlide as Ue, getSlidesToShow as Ze, isMouseEvent as he, coordX as O, coordY as _e, getSlideStyle as et, isTouchEvent as tt, getSlideWidth as st, clamp as rt, toCssLength as B, toCssNumber as nt, getSlideIndexForMultipleParts as we } from "./utils.js";
|
|
7
|
+
import { useSafeLayoutEffect as ge } from "../../../hooks/useSafeLayoutEffect.js";
|
|
8
8
|
import { useEventCallback as H } from "../../../hooks/useEventCallback.js";
|
|
9
|
-
import { Icon as
|
|
10
|
-
import { Modal as
|
|
11
|
-
const
|
|
9
|
+
import { Icon as M } from "../../base/icon/icon.js";
|
|
10
|
+
import { Modal as ot } from "../../feedBack/modal/modal.js";
|
|
11
|
+
const ct = {
|
|
12
12
|
isPressed: !1,
|
|
13
13
|
startX: 0,
|
|
14
14
|
startY: 0,
|
|
@@ -16,272 +16,291 @@ const et = {
|
|
|
16
16
|
lastT: 0,
|
|
17
17
|
axis: null,
|
|
18
18
|
dragged: !1
|
|
19
|
-
},
|
|
20
|
-
slidesToShow:
|
|
21
|
-
startSlide:
|
|
22
|
-
children:
|
|
23
|
-
className:
|
|
24
|
-
showNavigation:
|
|
25
|
-
showArrows:
|
|
19
|
+
}, ve = 8, at = 0.4, xt = qe(function({
|
|
20
|
+
slidesToShow: be = 3,
|
|
21
|
+
startSlide: xe = 0,
|
|
22
|
+
children: g,
|
|
23
|
+
className: pe,
|
|
24
|
+
showNavigation: Se = !0,
|
|
25
|
+
showArrows: ye,
|
|
26
26
|
arrowsSize: v = 30,
|
|
27
|
-
navigationClassName:
|
|
28
|
-
onSlideChange:
|
|
27
|
+
navigationClassName: Ie,
|
|
28
|
+
onSlideChange: b,
|
|
29
29
|
navigationDotRenderer: K,
|
|
30
|
-
"aria-label":
|
|
30
|
+
"aria-label": Te = "Carousel",
|
|
31
31
|
autoplay: G = !1,
|
|
32
32
|
autoplayInterval: q = 4e3,
|
|
33
|
-
pauseOnHover:
|
|
34
|
-
cellHeight:
|
|
35
|
-
aspectRatio:
|
|
36
|
-
gap:
|
|
33
|
+
pauseOnHover: k = !0,
|
|
34
|
+
cellHeight: Ne,
|
|
35
|
+
aspectRatio: Me,
|
|
36
|
+
gap: ke,
|
|
37
37
|
maxWidth: Ee,
|
|
38
|
-
enableFullscreen:
|
|
39
|
-
},
|
|
40
|
-
const s =
|
|
38
|
+
enableFullscreen: E = !1
|
|
39
|
+
}, Xe) {
|
|
40
|
+
const s = z.Children.count(g), o = Ze(be, s), X = Ue(xe, s), J = ye && s > 1, L = Math.max(0, s - o), [l, Q] = _(X), [F, Y] = _({
|
|
41
41
|
animation: void 0
|
|
42
|
-
}), [
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
}), [Le, U] = _(0), [Pe, Z] = _(!1), [u, P] = _(null), [De, ee] = _(0), [Ae, te] = _(!1), D = N(null), Ce = N(null), Re = Qe(Xe, Ce), m = N(null), [se, re] = _(!1), i = N({ ...ct });
|
|
43
|
+
ge(() => {
|
|
44
|
+
Y((e) => ({
|
|
45
45
|
...e,
|
|
46
46
|
animation: !1
|
|
47
47
|
}));
|
|
48
|
-
}, [
|
|
49
|
-
Q(
|
|
48
|
+
}, [o]), ge(() => {
|
|
49
|
+
Q(X), b == null || b(X), F.animation !== void 0 && Y((e) => ({
|
|
50
50
|
...e,
|
|
51
51
|
animation: !0
|
|
52
52
|
}));
|
|
53
|
-
}, [
|
|
54
|
-
const
|
|
53
|
+
}, [X]);
|
|
54
|
+
const $ = (e) => {
|
|
55
55
|
Object.assign(i.current, e);
|
|
56
|
-
}, V = () => typeof performance != "undefined" ? performance.now() : Date.now(),
|
|
57
|
-
const t =
|
|
58
|
-
Q(t),
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
},
|
|
64
|
-
if (!
|
|
56
|
+
}, V = () => typeof performance != "undefined" ? performance.now() : Date.now(), ne = (e) => {
|
|
57
|
+
const t = rt(e, 0, L);
|
|
58
|
+
Q(t), Y((r) => ({ ...r, animation: !0 })), b == null || b(t);
|
|
59
|
+
}, S = (e) => {
|
|
60
|
+
P((t) => t === null ? t : (t + e + s) % s);
|
|
61
|
+
}, x = N(null), Fe = (e) => {
|
|
62
|
+
m.current && (m.current.removeEventListener(e ? "mousemove" : "touchmove", ce), m.current.removeEventListener(e ? "mouseup" : "touchend", p), e && m.current.removeEventListener("mouseleave", p));
|
|
63
|
+
}, oe = H((e) => {
|
|
64
|
+
if (!m.current)
|
|
65
65
|
return;
|
|
66
|
-
const t =
|
|
66
|
+
const t = he(e);
|
|
67
67
|
if (t && e.button !== 0)
|
|
68
68
|
return;
|
|
69
69
|
e.stopPropagation();
|
|
70
|
-
const r =
|
|
71
|
-
|
|
70
|
+
const r = O(e), n = _e(e);
|
|
71
|
+
$({
|
|
72
72
|
isPressed: !0,
|
|
73
73
|
startX: r,
|
|
74
|
-
startY:
|
|
74
|
+
startY: n,
|
|
75
75
|
lastX: r,
|
|
76
76
|
lastT: V(),
|
|
77
77
|
axis: null,
|
|
78
78
|
dragged: !1
|
|
79
|
-
}),
|
|
80
|
-
}),
|
|
81
|
-
if (!
|
|
79
|
+
}), m.current.addEventListener(t ? "mousemove" : "touchmove", ce, { passive: !1 }), m.current.addEventListener(t ? "mouseup" : "touchend", p), t && m.current.addEventListener("mouseleave", p);
|
|
80
|
+
}), ce = H((e) => {
|
|
81
|
+
if (!D.current || !i.current.isPressed)
|
|
82
82
|
return;
|
|
83
|
-
if (
|
|
84
|
-
return
|
|
85
|
-
const t =
|
|
83
|
+
if (tt(e) && e.touches.length > 1)
|
|
84
|
+
return p(e);
|
|
85
|
+
const t = O(e), r = _e(e), n = t - i.current.startX, c = r - i.current.startY;
|
|
86
86
|
if (i.current.axis === null) {
|
|
87
|
-
if (Math.abs(
|
|
87
|
+
if (Math.abs(n) < ve && Math.abs(c) < ve)
|
|
88
88
|
return;
|
|
89
|
-
const
|
|
90
|
-
if (
|
|
91
|
-
return
|
|
89
|
+
const d = Math.abs(n) >= Math.abs(c) ? "x" : "y";
|
|
90
|
+
if ($({ axis: d, dragged: !0 }), d === "y")
|
|
91
|
+
return p(e);
|
|
92
92
|
s > 1 && Z(!0);
|
|
93
93
|
}
|
|
94
94
|
if (i.current.axis === "x") {
|
|
95
95
|
if (e.preventDefault(), e.stopPropagation(), s > 1) {
|
|
96
|
-
const
|
|
97
|
-
U(
|
|
96
|
+
const d = l <= 0, f = l >= L, w = d && n > 0 || f && n < 0 ? n * 0.35 : n;
|
|
97
|
+
U(w);
|
|
98
98
|
}
|
|
99
99
|
i.current.lastX = t, i.current.lastT = V();
|
|
100
100
|
}
|
|
101
|
-
}),
|
|
101
|
+
}), p = H((e) => {
|
|
102
102
|
if (!i.current.isPressed)
|
|
103
103
|
return;
|
|
104
|
-
const t =
|
|
105
|
-
|
|
106
|
-
const { axis: r, dragged:
|
|
107
|
-
if (
|
|
108
|
-
const
|
|
109
|
-
let
|
|
110
|
-
|
|
104
|
+
const t = he(e);
|
|
105
|
+
Fe(t);
|
|
106
|
+
const { axis: r, dragged: n, startX: c, lastX: d, lastT: f } = i.current;
|
|
107
|
+
if ($({ isPressed: !1 }), Z(!1), r === "x" && n && s > 1 && D.current) {
|
|
108
|
+
const w = O(e), C = w - c, I = D.current.offsetWidth / o, R = f ? (w - d) / Math.max(1, V() - f) : 0;
|
|
109
|
+
let T = I > 0 ? Math.round(-C / I) : 0;
|
|
110
|
+
T === 0 && Math.abs(R) > at && (T = R < 0 ? 1 : -1), ne(l + T);
|
|
111
111
|
}
|
|
112
112
|
U(0);
|
|
113
|
-
}),
|
|
114
|
-
i.current.dragged ||
|
|
115
|
-
},
|
|
116
|
-
const t =
|
|
117
|
-
return t ?
|
|
118
|
-
},
|
|
119
|
-
if (!
|
|
120
|
-
return /* @__PURE__ */ a(
|
|
121
|
-
const e = s -
|
|
113
|
+
}), Ye = (e) => () => {
|
|
114
|
+
i.current.dragged || E && P(e);
|
|
115
|
+
}, A = (e) => () => ne(e), W = (e) => {
|
|
116
|
+
const t = o === 1, r = t ? s : Math.ceil(s / o), n = l + o, c = s - o <= l, f = (we(n, o, s, c) + e + r) % r;
|
|
117
|
+
return t ? f : f * o;
|
|
118
|
+
}, $e = () => {
|
|
119
|
+
if (!Se)
|
|
120
|
+
return /* @__PURE__ */ a(de, {});
|
|
121
|
+
const e = s - o <= l, t = o === 1, r = t ? s : Math.ceil(s / o), n = [];
|
|
122
122
|
for (let c = 0; c < r; c++) {
|
|
123
|
-
let
|
|
123
|
+
let d = c, f = l;
|
|
124
124
|
if (!t) {
|
|
125
|
-
const R = c === r - 1,
|
|
126
|
-
|
|
125
|
+
const R = c === r - 1, T = l + o;
|
|
126
|
+
d = R ? s - o : c * o, f = we(T, o, s, e);
|
|
127
127
|
}
|
|
128
|
-
const
|
|
129
|
-
let
|
|
130
|
-
K && (
|
|
128
|
+
const w = f === c, C = A(d);
|
|
129
|
+
let I = /* @__PURE__ */ a("div", { className: h("smwb-carousel__navigation__dot", w && "current"), onClick: C }, c);
|
|
130
|
+
K && (I = K(c, w, C)), n.push(I);
|
|
131
131
|
}
|
|
132
|
-
return /* @__PURE__ */ a("div", { className:
|
|
133
|
-
},
|
|
134
|
-
const e = l >
|
|
135
|
-
return
|
|
136
|
-
},
|
|
137
|
-
transform: `translateX(calc(-${
|
|
138
|
-
transition:
|
|
139
|
-
},
|
|
140
|
-
if (
|
|
141
|
-
Array.isArray(
|
|
142
|
-
}, [
|
|
143
|
-
if (!G || s <= 1 ||
|
|
132
|
+
return /* @__PURE__ */ a("div", { className: h("smwb-carousel__navigation", Ie), children: n });
|
|
133
|
+
}, Ve = () => {
|
|
134
|
+
const e = l > L ? L : l;
|
|
135
|
+
return st(o) * e;
|
|
136
|
+
}, We = Je(), je = et(o), ze = {
|
|
137
|
+
transform: `translateX(calc(-${Ve()}% + ${Le}px))`,
|
|
138
|
+
transition: Pe || F.animation === void 0 ? "none" : F.animation ? "transform 500ms cubic-bezier(.1, 0, .25, 1)" : "none"
|
|
139
|
+
}, y = {}, ae = B(Ne), le = nt(Me), ie = B(ke), ue = B(Ee);
|
|
140
|
+
if (ae && (y["--smwb-carousel-cell-height"] = ae), le && (y["--smwb-carousel-aspect-ratio"] = le), ie && (y["--smwb-carousel-gap"] = ie), ue && (y["--smwb-carousel-max-width"] = ue), z.useEffect(() => {
|
|
141
|
+
Array.isArray(g) || console.error("SMWB Material: The `children` prop was passed invalidly. It should contain an array of elements.");
|
|
142
|
+
}, [g]), fe(() => {
|
|
143
|
+
if (!G || s <= 1 || k && se || u !== null)
|
|
144
144
|
return;
|
|
145
145
|
const e = window.setInterval(() => {
|
|
146
|
-
|
|
146
|
+
A(W(1))();
|
|
147
147
|
}, q);
|
|
148
148
|
return () => window.clearInterval(e);
|
|
149
149
|
}, [
|
|
150
150
|
G,
|
|
151
151
|
q,
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
k,
|
|
153
|
+
se,
|
|
154
154
|
s,
|
|
155
155
|
l,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
]),
|
|
159
|
-
if (
|
|
156
|
+
o,
|
|
157
|
+
u
|
|
158
|
+
]), fe(() => {
|
|
159
|
+
if (u === null || s <= 1)
|
|
160
160
|
return;
|
|
161
161
|
const e = (t) => {
|
|
162
|
-
t.key === "ArrowLeft" ?
|
|
162
|
+
t.key === "ArrowLeft" ? S(-1) : t.key === "ArrowRight" && S(1);
|
|
163
163
|
};
|
|
164
164
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
165
|
-
}, [
|
|
166
|
-
return /* @__PURE__ */ a(
|
|
167
|
-
const
|
|
165
|
+
}, [u, s]), !Array.isArray(g))
|
|
166
|
+
return /* @__PURE__ */ a(de, {});
|
|
167
|
+
const Oe = g, Be = (e) => {
|
|
168
168
|
var t, r;
|
|
169
|
-
|
|
170
|
-
},
|
|
171
|
-
var r,
|
|
172
|
-
if (
|
|
169
|
+
x.current = (r = (t = e.touches[0]) == null ? void 0 : t.clientX) != null ? r : null;
|
|
170
|
+
}, He = (e) => {
|
|
171
|
+
var r, n;
|
|
172
|
+
if (x.current === null || s <= 1)
|
|
173
173
|
return;
|
|
174
|
-
const t = ((
|
|
175
|
-
|
|
174
|
+
const t = ((n = (r = e.touches[0]) == null ? void 0 : r.clientX) != null ? n : x.current) - x.current;
|
|
175
|
+
te(!0), ee(t);
|
|
176
|
+
}, Ke = (e) => {
|
|
177
|
+
var n, c;
|
|
178
|
+
const t = x.current;
|
|
179
|
+
if (x.current = null, te(!1), ee(0), t === null || s <= 1)
|
|
180
|
+
return;
|
|
181
|
+
const r = ((c = (n = e.changedTouches[0]) == null ? void 0 : n.clientX) != null ? c : t) - t;
|
|
182
|
+
Math.abs(r) > 40 && S(r < 0 ? 1 : -1);
|
|
183
|
+
}, Ge = {
|
|
184
|
+
transform: `translateX(calc(-${(u != null ? u : 0) * 100}% + ${De}px))`,
|
|
185
|
+
transition: Ae ? "none" : "transform 350ms cubic-bezier(.22, .61, .36, 1)"
|
|
176
186
|
};
|
|
177
187
|
return /* @__PURE__ */ j(
|
|
178
188
|
"div",
|
|
179
189
|
{
|
|
180
|
-
className:
|
|
190
|
+
className: h("smwb-carousel", pe),
|
|
181
191
|
"data-testid": "carousel",
|
|
182
|
-
ref:
|
|
192
|
+
ref: Re,
|
|
183
193
|
role: "region",
|
|
184
194
|
"aria-roledescription": "carousel",
|
|
185
|
-
"aria-label":
|
|
186
|
-
style:
|
|
187
|
-
onMouseEnter:
|
|
188
|
-
onMouseLeave:
|
|
195
|
+
"aria-label": Te,
|
|
196
|
+
style: y,
|
|
197
|
+
onMouseEnter: k ? () => re(!0) : void 0,
|
|
198
|
+
onMouseLeave: k ? () => re(!1) : void 0,
|
|
189
199
|
children: [
|
|
190
|
-
/* @__PURE__ */ j("div", { className:
|
|
200
|
+
/* @__PURE__ */ j("div", { className: h("smwb-carousel__inner"), ref: D, children: [
|
|
191
201
|
J && /* @__PURE__ */ a(
|
|
192
|
-
|
|
202
|
+
M,
|
|
193
203
|
{
|
|
194
204
|
name: "chevron_left",
|
|
195
205
|
size: v,
|
|
196
|
-
className:
|
|
206
|
+
className: h("smwb-carousel__arrow", "smwb-carousel__arrow_prev"),
|
|
197
207
|
style: {
|
|
198
208
|
top: `calc(50% - ${v / 2}px)`,
|
|
199
209
|
left: -v / 2
|
|
200
210
|
},
|
|
201
|
-
onClick: () =>
|
|
211
|
+
onClick: () => A(W(-1))()
|
|
202
212
|
}
|
|
203
213
|
),
|
|
204
214
|
/* @__PURE__ */ a(
|
|
205
215
|
"div",
|
|
206
216
|
{
|
|
207
|
-
ref:
|
|
217
|
+
ref: m,
|
|
208
218
|
className: "smwb-carousel__track",
|
|
209
|
-
onMouseDown:
|
|
210
|
-
onTouchStart:
|
|
211
|
-
onDragStart:
|
|
212
|
-
onDragEnd:
|
|
213
|
-
children: /* @__PURE__ */ a("div", { className: "smwb-carousel__layer", style:
|
|
219
|
+
onMouseDown: oe,
|
|
220
|
+
onTouchStart: oe,
|
|
221
|
+
onDragStart: me,
|
|
222
|
+
onDragEnd: me,
|
|
223
|
+
children: /* @__PURE__ */ a("div", { className: "smwb-carousel__layer", style: ze, children: z.Children.map(g, (e, t) => /* @__PURE__ */ a("div", { id: `${We}${t}`, className: "smwb-carousel__slide", style: je, children: /* @__PURE__ */ a(
|
|
214
224
|
"div",
|
|
215
225
|
{
|
|
216
|
-
className:
|
|
226
|
+
className: h(
|
|
217
227
|
"smwb-carousel__slide-inner",
|
|
218
|
-
|
|
228
|
+
E && "smwb-carousel__slide-inner_clickable"
|
|
219
229
|
),
|
|
220
|
-
onClick:
|
|
230
|
+
onClick: E ? Ye(t) : void 0,
|
|
221
231
|
children: e
|
|
222
232
|
}
|
|
223
233
|
) }, t)) })
|
|
224
234
|
}
|
|
225
235
|
),
|
|
226
236
|
J && /* @__PURE__ */ a(
|
|
227
|
-
|
|
237
|
+
M,
|
|
228
238
|
{
|
|
229
239
|
name: "chevron_right",
|
|
230
240
|
size: v,
|
|
231
|
-
className:
|
|
241
|
+
className: h("smwb-carousel__arrow", "smwb-carousel__arrow_next"),
|
|
232
242
|
style: {
|
|
233
243
|
top: `calc(50% - ${v / 2}px)`,
|
|
234
244
|
right: -v / 2
|
|
235
245
|
},
|
|
236
|
-
onClick: () =>
|
|
246
|
+
onClick: () => A(W(1))()
|
|
237
247
|
}
|
|
238
248
|
)
|
|
239
249
|
] }),
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
250
|
+
$e(),
|
|
251
|
+
E && /* @__PURE__ */ a(
|
|
252
|
+
ot,
|
|
243
253
|
{
|
|
244
|
-
open:
|
|
254
|
+
open: u !== null,
|
|
245
255
|
size: "fullscreen",
|
|
246
256
|
backdrop: "darkBlured",
|
|
247
257
|
className: "smwb-carousel__fullscreen",
|
|
248
|
-
onClose: () =>
|
|
258
|
+
onClose: () => P(null),
|
|
249
259
|
"aria-label": "Image viewer",
|
|
250
|
-
children:
|
|
260
|
+
children: u !== null && /* @__PURE__ */ j("div", { className: "smwb-carousel__fullscreen-content", children: [
|
|
251
261
|
s > 1 && /* @__PURE__ */ a(
|
|
252
|
-
|
|
262
|
+
M,
|
|
253
263
|
{
|
|
254
264
|
name: "chevron_left",
|
|
255
265
|
size: 40,
|
|
256
|
-
className:
|
|
257
|
-
onClick: () =>
|
|
266
|
+
className: h("smwb-carousel__fullscreen-arrow", "smwb-carousel__fullscreen-arrow_prev"),
|
|
267
|
+
onClick: () => S(-1)
|
|
258
268
|
}
|
|
259
269
|
),
|
|
260
270
|
/* @__PURE__ */ a(
|
|
261
271
|
"div",
|
|
262
272
|
{
|
|
263
273
|
className: "smwb-carousel__fullscreen-stage",
|
|
264
|
-
onTouchStart:
|
|
265
|
-
|
|
266
|
-
|
|
274
|
+
onTouchStart: Be,
|
|
275
|
+
onTouchMove: He,
|
|
276
|
+
onTouchEnd: Ke,
|
|
277
|
+
children: /* @__PURE__ */ a("div", { className: "smwb-carousel__fullscreen-track", style: Ge, children: Oe.map((e, t) => /* @__PURE__ */ a(
|
|
278
|
+
"div",
|
|
279
|
+
{
|
|
280
|
+
className: "smwb-carousel__fullscreen-slide",
|
|
281
|
+
"aria-hidden": t !== u,
|
|
282
|
+
children: e
|
|
283
|
+
},
|
|
284
|
+
t
|
|
285
|
+
)) })
|
|
267
286
|
}
|
|
268
287
|
),
|
|
269
288
|
s > 1 && /* @__PURE__ */ a(
|
|
270
|
-
|
|
289
|
+
M,
|
|
271
290
|
{
|
|
272
291
|
name: "chevron_right",
|
|
273
292
|
size: 40,
|
|
274
|
-
className:
|
|
275
|
-
onClick: () =>
|
|
293
|
+
className: h("smwb-carousel__fullscreen-arrow", "smwb-carousel__fullscreen-arrow_next"),
|
|
294
|
+
onClick: () => S(1)
|
|
276
295
|
}
|
|
277
296
|
),
|
|
278
297
|
/* @__PURE__ */ a(
|
|
279
|
-
|
|
298
|
+
M,
|
|
280
299
|
{
|
|
281
300
|
name: "close",
|
|
282
301
|
size: 32,
|
|
283
302
|
className: "smwb-carousel__fullscreen-close",
|
|
284
|
-
onClick: () =>
|
|
303
|
+
onClick: () => P(null)
|
|
285
304
|
}
|
|
286
305
|
)
|
|
287
306
|
] })
|
|
@@ -292,6 +311,6 @@ const et = {
|
|
|
292
311
|
);
|
|
293
312
|
});
|
|
294
313
|
export {
|
|
295
|
-
|
|
314
|
+
xt as Carousel
|
|
296
315
|
};
|
|
297
316
|
//# sourceMappingURL=carousel.js.map
|