@smwb/ui-solid 0.2.1 → 0.2.2
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 +153 -139
- package/dist/components/dataDisplay/carousel/carousel.js.map +1 -1
- package/dist/headless/components/dataDisplay/carousel/carousel.js +158 -144
- package/dist/headless/components/dataDisplay/carousel/carousel.js.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,15 +1,15 @@
|
|
|
1
|
-
import { addEventListener as k, use as
|
|
1
|
+
import { addEventListener as k, use as Y, insert as g, createComponent as v, effect as I, setAttribute as V, style as oe, className as D, setStyleProperty as L, template as P, delegateEvents as Fe } from "solid-js/web";
|
|
2
2
|
import '../../../assets/styles/less/components/carousel/carousel.entry.css';/* empty css */
|
|
3
|
-
import { mergeProps as
|
|
3
|
+
import { mergeProps as Me, splitProps as ze, children as De, createSignal as b, createUniqueId as Le, createEffect as A, createMemo as le, onCleanup as ae, Show as y, For as W } from "solid-js";
|
|
4
4
|
import p from "clsx";
|
|
5
|
-
import { toCssLength as
|
|
6
|
-
import { mergeRefs as
|
|
5
|
+
import { toCssLength as K, toCssNumber as Ae, dragPrevent as ie, getSlideStyle as He, getStartSlide as Ne, getSlidesToShow as Re, clamp as Oe, getSlideIndexForMultipleParts as ce, coordX as q, coordY as ue, getSlideWidth as Ye, isMouseEvent as de, isTouchEvent as Ve } from "./utils.js";
|
|
6
|
+
import { mergeRefs as We } from "../../../primitives/mergeRefs.js";
|
|
7
7
|
import { Icon as T } from "../../base/icon/icon.js";
|
|
8
|
-
import { Modal as
|
|
9
|
-
var
|
|
10
|
-
const
|
|
11
|
-
function
|
|
12
|
-
const
|
|
8
|
+
import { Modal as Ke } from "../../feedBack/modal/modal.js";
|
|
9
|
+
var fe = /* @__PURE__ */ P("<div>"), qe = /* @__PURE__ */ P("<div class=smwb-carousel__fullscreen-content><div class=smwb-carousel__fullscreen-stage><div class=smwb-carousel__fullscreen-track>"), Be = /* @__PURE__ */ P("<div data-testid=carousel role=region aria-roledescription=carousel><div class=smwb-carousel__inner><div class=smwb-carousel__track><div class=smwb-carousel__layer>"), Ge = /* @__PURE__ */ P("<div class=smwb-carousel__slide><div>"), Ue = /* @__PURE__ */ P("<div class=smwb-carousel__fullscreen-slide>");
|
|
10
|
+
const me = 8, je = 0.4, B = () => typeof performance < "u" ? performance.now() : Date.now();
|
|
11
|
+
function ot(he) {
|
|
12
|
+
const ve = Me({
|
|
13
13
|
slidesToShow: 3,
|
|
14
14
|
startSlide: 0,
|
|
15
15
|
showNavigation: !0,
|
|
@@ -19,9 +19,9 @@ function Ze(fe) {
|
|
|
19
19
|
autoplayInterval: 4e3,
|
|
20
20
|
pauseOnHover: !0,
|
|
21
21
|
enableFullscreen: !1
|
|
22
|
-
},
|
|
23
|
-
let
|
|
24
|
-
const
|
|
22
|
+
}, he), [s] = ze(ve, ["slidesToShow", "startSlide", "children", "class", "showNavigation", "showArrows", "arrowsSize", "navigationClassName", "onSlideChange", "navigationDotRenderer", "aria-label", "autoplay", "autoplayInterval", "pauseOnHover", "cellHeight", "aspectRatio", "gap", "maxWidth", "enableFullscreen", "ref"]), ge = De(() => s.children), H = () => ge.toArray(), o = () => H().length, d = () => Re(s.slidesToShow, o()), G = () => Ne(s.startSlide, o()), U = () => !!s.showArrows && o() > 1, F = () => Math.max(0, o() - d()), [w, j] = b(G()), [N, R] = b(void 0), [we, J] = b(!1), [_e, Q] = b(0), [be, Z] = b(!1), [x, M] = b(null), [pe, ee] = b(0), [xe, te] = b(!1);
|
|
23
|
+
let z, _;
|
|
24
|
+
const i = {
|
|
25
25
|
isPressed: !1,
|
|
26
26
|
startX: 0,
|
|
27
27
|
startY: 0,
|
|
@@ -30,128 +30,128 @@ function Ze(fe) {
|
|
|
30
30
|
axis: null,
|
|
31
31
|
dragged: !1
|
|
32
32
|
};
|
|
33
|
-
let
|
|
34
|
-
const
|
|
33
|
+
let S = null;
|
|
34
|
+
const Se = Le();
|
|
35
35
|
A(() => {
|
|
36
|
-
d(),
|
|
36
|
+
d(), R(!1);
|
|
37
37
|
}), A(() => {
|
|
38
|
-
const e =
|
|
39
|
-
|
|
38
|
+
const e = G();
|
|
39
|
+
j(e), s.onSlideChange?.(e), N() !== void 0 && R(!0);
|
|
40
40
|
});
|
|
41
|
-
const
|
|
42
|
-
const t =
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
if (!
|
|
48
|
-
if (
|
|
49
|
-
|
|
41
|
+
const $ = (e) => {
|
|
42
|
+
const t = Oe(e, 0, F());
|
|
43
|
+
j(t), R(!0), s.onSlideChange?.(t);
|
|
44
|
+
}, $e = (e) => {
|
|
45
|
+
_ && (_.removeEventListener(e ? "mousemove" : "touchmove", re), _.removeEventListener(e ? "mouseup" : "touchend", C), e && _.removeEventListener("mouseleave", C));
|
|
46
|
+
}, re = (e) => {
|
|
47
|
+
if (!z || !i.isPressed) return;
|
|
48
|
+
if (Ve(e) && e.touches.length > 1) {
|
|
49
|
+
C(e);
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
|
-
const t =
|
|
53
|
-
if (
|
|
54
|
-
if (Math.abs(
|
|
55
|
-
if (
|
|
56
|
-
|
|
52
|
+
const t = q(e), a = ue(e), c = t - i.startX, u = a - i.startY;
|
|
53
|
+
if (i.axis === null) {
|
|
54
|
+
if (Math.abs(c) < me && Math.abs(u) < me) return;
|
|
55
|
+
if (i.axis = Math.abs(c) >= Math.abs(u) ? "x" : "y", i.dragged = !0, i.axis === "y") {
|
|
56
|
+
C(e);
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
o() > 1 &&
|
|
59
|
+
o() > 1 && Z(!0);
|
|
60
60
|
}
|
|
61
|
-
if (
|
|
61
|
+
if (i.axis === "x") {
|
|
62
62
|
if (e.preventDefault(), e.stopPropagation(), o() > 1) {
|
|
63
|
-
const r =
|
|
64
|
-
|
|
63
|
+
const r = w() <= 0, n = w() >= F(), l = r && c > 0 || n && c < 0 ? c * 0.35 : c;
|
|
64
|
+
Q(l);
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
i.lastX = t, i.lastT = B();
|
|
67
67
|
}
|
|
68
|
-
},
|
|
69
|
-
if (!
|
|
70
|
-
const t =
|
|
71
|
-
|
|
68
|
+
}, C = (e) => {
|
|
69
|
+
if (!i.isPressed) return;
|
|
70
|
+
const t = de(e);
|
|
71
|
+
$e(t);
|
|
72
72
|
const {
|
|
73
73
|
axis: a,
|
|
74
|
-
dragged:
|
|
75
|
-
startX:
|
|
74
|
+
dragged: c,
|
|
75
|
+
startX: u,
|
|
76
76
|
lastX: r,
|
|
77
77
|
lastT: n
|
|
78
|
-
} =
|
|
79
|
-
if (
|
|
80
|
-
const
|
|
81
|
-
let
|
|
82
|
-
|
|
78
|
+
} = i;
|
|
79
|
+
if (i.isPressed = !1, Z(!1), a === "x" && c && o() > 1 && z) {
|
|
80
|
+
const l = q(e), m = l - u, f = z.offsetWidth / d(), h = n ? (l - r) / Math.max(1, B() - n) : 0;
|
|
81
|
+
let X = f > 0 ? Math.round(-m / f) : 0;
|
|
82
|
+
X === 0 && Math.abs(h) > je && (X = h < 0 ? 1 : -1), $(w() + X);
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
if (!
|
|
87
|
-
const t =
|
|
88
|
-
t && e.button !== 0 || (e.stopPropagation(),
|
|
84
|
+
Q(0);
|
|
85
|
+
}, se = (e) => {
|
|
86
|
+
if (!_) return;
|
|
87
|
+
const t = de(e);
|
|
88
|
+
t && e.button !== 0 || (e.stopPropagation(), i.isPressed = !0, i.startX = q(e), i.startY = ue(e), i.lastX = i.startX, i.lastT = B(), i.axis = null, i.dragged = !1, _.addEventListener(t ? "mousemove" : "touchmove", re, {
|
|
89
89
|
passive: !1
|
|
90
|
-
}),
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
},
|
|
94
|
-
const t = d() === 1, a = t ? o() : Math.ceil(o() / d()),
|
|
90
|
+
}), _.addEventListener(t ? "mouseup" : "touchend", C), t && _.addEventListener("mouseleave", C));
|
|
91
|
+
}, Ce = (e) => {
|
|
92
|
+
i.dragged || s.enableFullscreen && M(e);
|
|
93
|
+
}, O = (e) => {
|
|
94
|
+
const t = d() === 1, a = t ? o() : Math.ceil(o() / d()), c = w() + d(), u = o() - d() <= w(), n = (ce(c, d(), o(), u) + e + a) % a;
|
|
95
95
|
return t ? n : n * d();
|
|
96
|
-
},
|
|
97
|
-
const e = o() - d() <=
|
|
98
|
-
for (let
|
|
99
|
-
let r =
|
|
96
|
+
}, Ie = () => {
|
|
97
|
+
const e = o() - d() <= w(), t = d() === 1, a = t ? o() : Math.ceil(o() / d()), c = [];
|
|
98
|
+
for (let u = 0; u < a; u++) {
|
|
99
|
+
let r = u, n = w();
|
|
100
100
|
if (!t) {
|
|
101
|
-
const
|
|
102
|
-
r =
|
|
101
|
+
const l = u === a - 1, m = w() + d();
|
|
102
|
+
r = l ? o() - d() : u * d(), n = ce(m, d(), o(), e);
|
|
103
103
|
}
|
|
104
|
-
|
|
105
|
-
index:
|
|
104
|
+
c.push({
|
|
105
|
+
index: u,
|
|
106
106
|
nextIndex: r,
|
|
107
|
-
isActive: n ===
|
|
107
|
+
isActive: n === u
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
|
-
return
|
|
111
|
-
},
|
|
112
|
-
const e =
|
|
113
|
-
return
|
|
114
|
-
},
|
|
115
|
-
const e = {}, t =
|
|
116
|
-
return t && (e["--smwb-carousel-cell-height"] = t), a && (e["--smwb-carousel-aspect-ratio"] = a),
|
|
117
|
-
}),
|
|
118
|
-
const t =
|
|
119
|
-
t !== null &&
|
|
120
|
-
},
|
|
121
|
-
const e = y();
|
|
122
|
-
if (e === null) return null;
|
|
123
|
-
const t = N()[e];
|
|
124
|
-
return t instanceof Node ? t.cloneNode(!0) : t == null ? "" : String(t);
|
|
125
|
-
});
|
|
110
|
+
return c;
|
|
111
|
+
}, ye = () => {
|
|
112
|
+
const e = w() > F() ? F() : w();
|
|
113
|
+
return Ye(d()) * e;
|
|
114
|
+
}, Ee = le(() => {
|
|
115
|
+
const e = {}, t = K(s.cellHeight), a = Ae(s.aspectRatio), c = K(s.gap), u = K(s.maxWidth);
|
|
116
|
+
return t && (e["--smwb-carousel-cell-height"] = t), a && (e["--smwb-carousel-aspect-ratio"] = a), c && (e["--smwb-carousel-gap"] = c), u && (e["--smwb-carousel-max-width"] = u), e;
|
|
117
|
+
}), E = (e) => {
|
|
118
|
+
const t = x();
|
|
119
|
+
t !== null && M((t + e + o()) % o());
|
|
120
|
+
}, Xe = le(() => H().map((e) => e instanceof Node ? e.cloneNode(!0) : e == null ? "" : String(e)));
|
|
126
121
|
A(() => {
|
|
127
|
-
if (!s.autoplay || o() <= 1 || s.pauseOnHover &&
|
|
122
|
+
if (!s.autoplay || o() <= 1 || s.pauseOnHover && we() || x() !== null)
|
|
128
123
|
return;
|
|
129
|
-
const e = window.setInterval(() =>
|
|
130
|
-
|
|
124
|
+
const e = window.setInterval(() => $(O(1)), s.autoplayInterval);
|
|
125
|
+
ae(() => window.clearInterval(e));
|
|
131
126
|
}), A(() => {
|
|
132
|
-
if (
|
|
127
|
+
if (x() === null || o() <= 1) return;
|
|
133
128
|
const e = (t) => {
|
|
134
|
-
t.key === "ArrowLeft" ?
|
|
129
|
+
t.key === "ArrowLeft" ? E(-1) : t.key === "ArrowRight" && E(1);
|
|
135
130
|
};
|
|
136
|
-
document.addEventListener("keydown", e),
|
|
131
|
+
document.addEventListener("keydown", e), ae(() => document.removeEventListener("keydown", e));
|
|
137
132
|
});
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
},
|
|
141
|
-
if (
|
|
142
|
-
const t = (e.
|
|
143
|
-
|
|
133
|
+
const ke = (e) => {
|
|
134
|
+
S = e.touches[0]?.clientX ?? null;
|
|
135
|
+
}, Te = (e) => {
|
|
136
|
+
if (S === null || o() <= 1) return;
|
|
137
|
+
const t = (e.touches[0]?.clientX ?? S) - S;
|
|
138
|
+
te(!0), ee(t);
|
|
139
|
+
}, Pe = (e) => {
|
|
140
|
+
const t = S;
|
|
141
|
+
if (S = null, te(!1), ee(0), t === null || o() <= 1) return;
|
|
142
|
+
const a = (e.changedTouches[0]?.clientX ?? t) - t;
|
|
143
|
+
Math.abs(a) > 40 && E(a < 0 ? 1 : -1);
|
|
144
144
|
};
|
|
145
145
|
return (() => {
|
|
146
|
-
var e =
|
|
147
|
-
k(e, "mouseleave", s.pauseOnHover ? () =>
|
|
148
|
-
var
|
|
149
|
-
return typeof
|
|
146
|
+
var e = Be(), t = e.firstChild, a = t.firstChild, c = a.firstChild;
|
|
147
|
+
k(e, "mouseleave", s.pauseOnHover ? () => J(!1) : void 0), k(e, "mouseenter", s.pauseOnHover ? () => J(!0) : void 0);
|
|
148
|
+
var u = We(s.ref);
|
|
149
|
+
return typeof u == "function" && Y(u, e), Y((r) => z = r, t), g(t, v(y, {
|
|
150
150
|
get when() {
|
|
151
|
-
return
|
|
151
|
+
return U();
|
|
152
152
|
},
|
|
153
153
|
get children() {
|
|
154
|
-
return
|
|
154
|
+
return v(T, {
|
|
155
155
|
name: "chevron_left",
|
|
156
156
|
get size() {
|
|
157
157
|
return s.arrowsSize;
|
|
@@ -165,30 +165,30 @@ function Ze(fe) {
|
|
|
165
165
|
left: `${-s.arrowsSize / 2}px`
|
|
166
166
|
};
|
|
167
167
|
},
|
|
168
|
-
onClick: () =>
|
|
168
|
+
onClick: () => $(O(-1))
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
|
-
}), a), k(a, "dragend",
|
|
171
|
+
}), a), k(a, "dragend", ie), k(a, "dragstart", ie), a.$$touchstart = se, a.$$mousedown = se, Y((r) => _ = r, a), g(c, v(W, {
|
|
172
172
|
get each() {
|
|
173
|
-
return
|
|
173
|
+
return H();
|
|
174
174
|
},
|
|
175
175
|
children: (r, n) => (() => {
|
|
176
|
-
var
|
|
177
|
-
return k(
|
|
178
|
-
var
|
|
179
|
-
return
|
|
176
|
+
var l = Ge(), m = l.firstChild;
|
|
177
|
+
return k(m, "click", s.enableFullscreen ? () => Ce(n()) : void 0, !0), g(m, r), I((f) => {
|
|
178
|
+
var h = `${Se}${n()}`, X = He(d()), ne = p("smwb-carousel__slide-inner", s.enableFullscreen && "smwb-carousel__slide-inner_clickable");
|
|
179
|
+
return h !== f.e && V(l, "id", f.e = h), f.t = oe(l, X, f.t), ne !== f.a && D(m, f.a = ne), f;
|
|
180
180
|
}, {
|
|
181
181
|
e: void 0,
|
|
182
182
|
t: void 0,
|
|
183
183
|
a: void 0
|
|
184
|
-
}),
|
|
184
|
+
}), l;
|
|
185
185
|
})()
|
|
186
|
-
})),
|
|
186
|
+
})), g(t, v(y, {
|
|
187
187
|
get when() {
|
|
188
|
-
return
|
|
188
|
+
return U();
|
|
189
189
|
},
|
|
190
190
|
get children() {
|
|
191
|
-
return
|
|
191
|
+
return v(T, {
|
|
192
192
|
name: "chevron_right",
|
|
193
193
|
get size() {
|
|
194
194
|
return s.arrowsSize;
|
|
@@ -202,81 +202,95 @@ function Ze(fe) {
|
|
|
202
202
|
right: `${-s.arrowsSize / 2}px`
|
|
203
203
|
};
|
|
204
204
|
},
|
|
205
|
-
onClick: () =>
|
|
205
|
+
onClick: () => $(O(1))
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
}), null),
|
|
208
|
+
}), null), g(e, v(y, {
|
|
209
209
|
get when() {
|
|
210
210
|
return s.showNavigation;
|
|
211
211
|
},
|
|
212
212
|
get children() {
|
|
213
|
-
var r =
|
|
214
|
-
return
|
|
213
|
+
var r = fe();
|
|
214
|
+
return g(r, v(W, {
|
|
215
215
|
get each() {
|
|
216
|
-
return
|
|
216
|
+
return Ie();
|
|
217
217
|
},
|
|
218
|
-
children: (n) => s.navigationDotRenderer ? s.navigationDotRenderer(n.index, n.isActive, (
|
|
219
|
-
var
|
|
220
|
-
return
|
|
218
|
+
children: (n) => s.navigationDotRenderer ? s.navigationDotRenderer(n.index, n.isActive, (l) => $(l)) : (() => {
|
|
219
|
+
var l = fe();
|
|
220
|
+
return l.$$click = () => $(n.nextIndex), I(() => D(l, p("smwb-carousel__navigation__dot", n.isActive && "current"))), l;
|
|
221
221
|
})()
|
|
222
|
-
})),
|
|
222
|
+
})), I(() => D(r, p("smwb-carousel__navigation", s.navigationClassName))), r;
|
|
223
223
|
}
|
|
224
|
-
}), null),
|
|
224
|
+
}), null), g(e, v(y, {
|
|
225
225
|
get when() {
|
|
226
226
|
return s.enableFullscreen;
|
|
227
227
|
},
|
|
228
228
|
get children() {
|
|
229
|
-
return
|
|
229
|
+
return v(Ke, {
|
|
230
230
|
get open() {
|
|
231
|
-
return
|
|
231
|
+
return x() !== null;
|
|
232
232
|
},
|
|
233
233
|
size: "fullscreen",
|
|
234
234
|
backdrop: "darkBlured",
|
|
235
235
|
class: "smwb-carousel__fullscreen",
|
|
236
|
-
onClose: () =>
|
|
236
|
+
onClose: () => M(null),
|
|
237
237
|
"aria-label": "Image viewer",
|
|
238
238
|
get children() {
|
|
239
|
-
var r =
|
|
240
|
-
return
|
|
239
|
+
var r = qe(), n = r.firstChild, l = n.firstChild;
|
|
240
|
+
return g(r, v(y, {
|
|
241
241
|
get when() {
|
|
242
242
|
return o() > 1;
|
|
243
243
|
},
|
|
244
244
|
get children() {
|
|
245
|
-
return
|
|
245
|
+
return v(T, {
|
|
246
246
|
name: "chevron_left",
|
|
247
247
|
size: 40,
|
|
248
248
|
get class() {
|
|
249
249
|
return p("smwb-carousel__fullscreen-arrow", "smwb-carousel__fullscreen-arrow_prev");
|
|
250
250
|
},
|
|
251
|
-
onClick: () =>
|
|
251
|
+
onClick: () => E(-1)
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
|
-
}), n), n.$$touchend =
|
|
254
|
+
}), n), n.$$touchend = Pe, n.$$touchmove = Te, n.$$touchstart = ke, g(l, v(W, {
|
|
255
|
+
get each() {
|
|
256
|
+
return Xe();
|
|
257
|
+
},
|
|
258
|
+
children: (m, f) => (() => {
|
|
259
|
+
var h = Ue();
|
|
260
|
+
return g(h, m), I(() => V(h, "aria-hidden", f() !== x())), h;
|
|
261
|
+
})()
|
|
262
|
+
})), g(r, v(y, {
|
|
255
263
|
get when() {
|
|
256
264
|
return o() > 1;
|
|
257
265
|
},
|
|
258
266
|
get children() {
|
|
259
|
-
return
|
|
267
|
+
return v(T, {
|
|
260
268
|
name: "chevron_right",
|
|
261
269
|
size: 40,
|
|
262
270
|
get class() {
|
|
263
271
|
return p("smwb-carousel__fullscreen-arrow", "smwb-carousel__fullscreen-arrow_next");
|
|
264
272
|
},
|
|
265
|
-
onClick: () =>
|
|
273
|
+
onClick: () => E(1)
|
|
266
274
|
});
|
|
267
275
|
}
|
|
268
|
-
}), null),
|
|
276
|
+
}), null), g(r, v(T, {
|
|
269
277
|
name: "close",
|
|
270
278
|
size: 32,
|
|
271
279
|
class: "smwb-carousel__fullscreen-close",
|
|
272
|
-
onClick: () =>
|
|
273
|
-
}), null),
|
|
280
|
+
onClick: () => M(null)
|
|
281
|
+
}), null), I((m) => {
|
|
282
|
+
var f = `translateX(calc(-${(x() ?? 0) * 100}% + ${pe()}px))`, h = xe() ? "none" : "transform 350ms cubic-bezier(.22, .61, .36, 1)";
|
|
283
|
+
return f !== m.e && L(l, "transform", m.e = f), h !== m.t && L(l, "transition", m.t = h), m;
|
|
284
|
+
}, {
|
|
285
|
+
e: void 0,
|
|
286
|
+
t: void 0
|
|
287
|
+
}), r;
|
|
274
288
|
}
|
|
275
289
|
});
|
|
276
290
|
}
|
|
277
|
-
}), null),
|
|
278
|
-
var n = p("smwb-carousel", s.class),
|
|
279
|
-
return n !== r.e &&
|
|
291
|
+
}), null), I((r) => {
|
|
292
|
+
var n = p("smwb-carousel", s.class), l = s["aria-label"], m = Ee(), f = `translateX(calc(-${ye()}% + ${_e()}px))`, h = be() || N() === void 0 ? "none" : N() ? "transform 500ms cubic-bezier(.1, 0, .25, 1)" : "none";
|
|
293
|
+
return n !== r.e && D(e, r.e = n), l !== r.t && V(e, "aria-label", r.t = l), r.a = oe(e, m, r.a), f !== r.o && L(c, "transform", r.o = f), h !== r.i && L(c, "transition", r.i = h), r;
|
|
280
294
|
}, {
|
|
281
295
|
e: void 0,
|
|
282
296
|
t: void 0,
|
|
@@ -286,8 +300,8 @@ function Ze(fe) {
|
|
|
286
300
|
}), e;
|
|
287
301
|
})();
|
|
288
302
|
}
|
|
289
|
-
|
|
303
|
+
Fe(["mousedown", "touchstart", "touchmove", "touchend", "click"]);
|
|
290
304
|
export {
|
|
291
|
-
|
|
305
|
+
ot as Carousel
|
|
292
306
|
};
|
|
293
307
|
//# sourceMappingURL=carousel.js.map
|