@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.
@@ -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;max-width:100%;max-height:100%}.smwb-carousel__fullscreen-stage 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
+ .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 O, insert as h, createComponent as f, effect as P, setAttribute as ee, style as te, className as z, setStyleProperty as re, template as F, delegateEvents as Ee } from "solid-js/web";
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 ke, splitProps as Te, children as Xe, createSignal as S, createUniqueId as Le, createEffect as A, createMemo as se, onCleanup as ne, Show as I, For as oe } from "solid-js";
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 Y, toCssNumber as Me, dragPrevent as le, getSlideStyle as Pe, getStartSlide as ze, getSlidesToShow as Ae, clamp as Fe, getSlideIndexForMultipleParts as ae, coordX as V, coordY as ie, getSlideWidth as Ne, isMouseEvent as ce, isTouchEvent as De } from "./utils.js";
6
- import { mergeRefs as He } from "../../../primitives/mergeRefs.js";
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 Re } from "../../feedBack/modal/modal.js";
9
- var ue = /* @__PURE__ */ F("<div>"), Oe = /* @__PURE__ */ F("<div class=smwb-carousel__fullscreen-content><div class=smwb-carousel__fullscreen-stage>"), Ye = /* @__PURE__ */ F("<div data-testid=carousel role=region aria-roledescription=carousel><div class=smwb-carousel__inner><div class=smwb-carousel__track><div class=smwb-carousel__layer>"), Ve = /* @__PURE__ */ F("<div class=smwb-carousel__slide><div>");
10
- const de = 8, We = 0.4, W = () => typeof performance < "u" ? performance.now() : Date.now();
11
- function Ze(fe) {
12
- const me = ke({
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
- }, fe), [s] = Te(me, ["slidesToShow", "startSlide", "children", "class", "showNavigation", "showArrows", "arrowsSize", "navigationClassName", "onSlideChange", "navigationDotRenderer", "aria-label", "autoplay", "autoplayInterval", "pauseOnHover", "cellHeight", "aspectRatio", "gap", "maxWidth", "enableFullscreen", "ref"]), he = Xe(() => s.children), N = () => he.toArray(), o = () => N().length, d = () => Ae(s.slidesToShow, o()), K = () => ze(s.startSlide, o()), q = () => !!s.showArrows && o() > 1, X = () => Math.max(0, o() - d()), [g, B] = S(K()), [D, H] = S(void 0), [ge, G] = S(!1), [ve, U] = S(0), [we, j] = S(!1), [y, L] = S(null);
23
- let M, v;
24
- const l = {
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 C = null;
34
- const _e = Le();
33
+ let S = null;
34
+ const Se = Le();
35
35
  A(() => {
36
- d(), H(!1);
36
+ d(), R(!1);
37
37
  }), A(() => {
38
- const e = K();
39
- B(e), s.onSlideChange?.(e), D() !== void 0 && H(!0);
38
+ const e = G();
39
+ j(e), s.onSlideChange?.(e), N() !== void 0 && R(!0);
40
40
  });
41
- const b = (e) => {
42
- const t = Fe(e, 0, X());
43
- B(t), H(!0), s.onSlideChange?.(t);
44
- }, pe = (e) => {
45
- v && (v.removeEventListener(e ? "mousemove" : "touchmove", J), v.removeEventListener(e ? "mouseup" : "touchend", x), e && v.removeEventListener("mouseleave", x));
46
- }, J = (e) => {
47
- if (!M || !l.isPressed) return;
48
- if (De(e) && e.touches.length > 1) {
49
- x(e);
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 = V(e), a = ie(e), i = t - l.startX, c = a - l.startY;
53
- if (l.axis === null) {
54
- if (Math.abs(i) < de && Math.abs(c) < de) return;
55
- if (l.axis = Math.abs(i) >= Math.abs(c) ? "x" : "y", l.dragged = !0, l.axis === "y") {
56
- x(e);
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 && j(!0);
59
+ o() > 1 && Z(!0);
60
60
  }
61
- if (l.axis === "x") {
61
+ if (i.axis === "x") {
62
62
  if (e.preventDefault(), e.stopPropagation(), o() > 1) {
63
- const r = g() <= 0, n = g() >= X(), u = r && i > 0 || n && i < 0 ? i * 0.35 : i;
64
- U(u);
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
- l.lastX = t, l.lastT = W();
66
+ i.lastX = t, i.lastT = B();
67
67
  }
68
- }, x = (e) => {
69
- if (!l.isPressed) return;
70
- const t = ce(e);
71
- pe(t);
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: i,
75
- startX: c,
74
+ dragged: c,
75
+ startX: u,
76
76
  lastX: r,
77
77
  lastT: n
78
- } = l;
79
- if (l.isPressed = !1, j(!1), a === "x" && i && o() > 1 && M) {
80
- const u = V(e), w = u - c, m = M.offsetWidth / d(), _ = n ? (u - r) / Math.max(1, W() - n) : 0;
81
- let E = m > 0 ? Math.round(-w / m) : 0;
82
- E === 0 && Math.abs(_) > We && (E = _ < 0 ? 1 : -1), b(g() + E);
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
- U(0);
85
- }, Q = (e) => {
86
- if (!v) return;
87
- const t = ce(e);
88
- t && e.button !== 0 || (e.stopPropagation(), l.isPressed = !0, l.startX = V(e), l.startY = ie(e), l.lastX = l.startX, l.lastT = W(), l.axis = null, l.dragged = !1, v.addEventListener(t ? "mousemove" : "touchmove", J, {
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
- }), v.addEventListener(t ? "mouseup" : "touchend", x), t && v.addEventListener("mouseleave", x));
91
- }, be = (e) => {
92
- l.dragged || s.enableFullscreen && L(e);
93
- }, R = (e) => {
94
- const t = d() === 1, a = t ? o() : Math.ceil(o() / d()), i = g() + d(), c = o() - d() <= g(), n = (ae(i, d(), o(), c) + e + a) % a;
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
- }, xe = () => {
97
- const e = o() - d() <= g(), t = d() === 1, a = t ? o() : Math.ceil(o() / d()), i = [];
98
- for (let c = 0; c < a; c++) {
99
- let r = c, n = g();
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 u = c === a - 1, w = g() + d();
102
- r = u ? o() - d() : c * d(), n = ae(w, d(), o(), e);
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
- i.push({
105
- index: c,
104
+ c.push({
105
+ index: u,
106
106
  nextIndex: r,
107
- isActive: n === c
107
+ isActive: n === u
108
108
  });
109
109
  }
110
- return i;
111
- }, Se = () => {
112
- const e = g() > X() ? X() : g();
113
- return Ne(d()) * e;
114
- }, Ie = se(() => {
115
- const e = {}, t = Y(s.cellHeight), a = Me(s.aspectRatio), i = Y(s.gap), c = Y(s.maxWidth);
116
- return t && (e["--smwb-carousel-cell-height"] = t), a && (e["--smwb-carousel-aspect-ratio"] = a), i && (e["--smwb-carousel-gap"] = i), c && (e["--smwb-carousel-max-width"] = c), e;
117
- }), $ = (e) => {
118
- const t = y();
119
- t !== null && L((t + e + o()) % o());
120
- }, ye = se(() => {
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 && ge() || y() !== null)
122
+ if (!s.autoplay || o() <= 1 || s.pauseOnHover && we() || x() !== null)
128
123
  return;
129
- const e = window.setInterval(() => b(R(1)), s.autoplayInterval);
130
- ne(() => window.clearInterval(e));
124
+ const e = window.setInterval(() => $(O(1)), s.autoplayInterval);
125
+ ae(() => window.clearInterval(e));
131
126
  }), A(() => {
132
- if (y() === null || o() <= 1) return;
127
+ if (x() === null || o() <= 1) return;
133
128
  const e = (t) => {
134
- t.key === "ArrowLeft" ? $(-1) : t.key === "ArrowRight" && $(1);
129
+ t.key === "ArrowLeft" ? E(-1) : t.key === "ArrowRight" && E(1);
135
130
  };
136
- document.addEventListener("keydown", e), ne(() => document.removeEventListener("keydown", e));
131
+ document.addEventListener("keydown", e), ae(() => document.removeEventListener("keydown", e));
137
132
  });
138
- const Ce = (e) => {
139
- C = e.touches[0]?.clientX ?? null;
140
- }, $e = (e) => {
141
- if (C === null || o() <= 1) return;
142
- const t = (e.changedTouches[0]?.clientX ?? C) - C;
143
- C = null, Math.abs(t) > 40 && $(t < 0 ? 1 : -1);
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 = Ye(), t = e.firstChild, a = t.firstChild, i = a.firstChild;
147
- k(e, "mouseleave", s.pauseOnHover ? () => G(!1) : void 0), k(e, "mouseenter", s.pauseOnHover ? () => G(!0) : void 0);
148
- var c = He(s.ref);
149
- return typeof c == "function" && O(c, e), O((r) => M = r, t), h(t, f(I, {
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 q();
151
+ return U();
152
152
  },
153
153
  get children() {
154
- return f(T, {
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: () => b(R(-1))
168
+ onClick: () => $(O(-1))
169
169
  });
170
170
  }
171
- }), a), k(a, "dragend", le), k(a, "dragstart", le), a.$$touchstart = Q, a.$$mousedown = Q, O((r) => v = r, a), h(i, f(oe, {
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 N();
173
+ return H();
174
174
  },
175
175
  children: (r, n) => (() => {
176
- var u = Ve(), w = u.firstChild;
177
- return k(w, "click", s.enableFullscreen ? () => be(n()) : void 0, !0), h(w, r), P((m) => {
178
- var _ = `${_e}${n()}`, E = Pe(d()), Z = p("smwb-carousel__slide-inner", s.enableFullscreen && "smwb-carousel__slide-inner_clickable");
179
- return _ !== m.e && ee(u, "id", m.e = _), m.t = te(u, E, m.t), Z !== m.a && z(w, m.a = Z), m;
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
- }), u;
184
+ }), l;
185
185
  })()
186
- })), h(t, f(I, {
186
+ })), g(t, v(y, {
187
187
  get when() {
188
- return q();
188
+ return U();
189
189
  },
190
190
  get children() {
191
- return f(T, {
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: () => b(R(1))
205
+ onClick: () => $(O(1))
206
206
  });
207
207
  }
208
- }), null), h(e, f(I, {
208
+ }), null), g(e, v(y, {
209
209
  get when() {
210
210
  return s.showNavigation;
211
211
  },
212
212
  get children() {
213
- var r = ue();
214
- return h(r, f(oe, {
213
+ var r = fe();
214
+ return g(r, v(W, {
215
215
  get each() {
216
- return xe();
216
+ return Ie();
217
217
  },
218
- children: (n) => s.navigationDotRenderer ? s.navigationDotRenderer(n.index, n.isActive, (u) => b(u)) : (() => {
219
- var u = ue();
220
- return u.$$click = () => b(n.nextIndex), P(() => z(u, p("smwb-carousel__navigation__dot", n.isActive && "current"))), u;
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
- })), P(() => z(r, p("smwb-carousel__navigation", s.navigationClassName))), r;
222
+ })), I(() => D(r, p("smwb-carousel__navigation", s.navigationClassName))), r;
223
223
  }
224
- }), null), h(e, f(I, {
224
+ }), null), g(e, v(y, {
225
225
  get when() {
226
226
  return s.enableFullscreen;
227
227
  },
228
228
  get children() {
229
- return f(Re, {
229
+ return v(Ke, {
230
230
  get open() {
231
- return y() !== null;
231
+ return x() !== null;
232
232
  },
233
233
  size: "fullscreen",
234
234
  backdrop: "darkBlured",
235
235
  class: "smwb-carousel__fullscreen",
236
- onClose: () => L(null),
236
+ onClose: () => M(null),
237
237
  "aria-label": "Image viewer",
238
238
  get children() {
239
- var r = Oe(), n = r.firstChild;
240
- return h(r, f(I, {
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 f(T, {
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: () => $(-1)
251
+ onClick: () => E(-1)
252
252
  });
253
253
  }
254
- }), n), n.$$touchend = $e, n.$$touchstart = Ce, h(n, () => ye()), h(r, f(I, {
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 f(T, {
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: () => $(1)
273
+ onClick: () => E(1)
266
274
  });
267
275
  }
268
- }), null), h(r, f(T, {
276
+ }), null), g(r, v(T, {
269
277
  name: "close",
270
278
  size: 32,
271
279
  class: "smwb-carousel__fullscreen-close",
272
- onClick: () => L(null)
273
- }), null), r;
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), P((r) => {
278
- var n = p("smwb-carousel", s.class), u = s["aria-label"], w = Ie(), m = `translateX(calc(-${Se()}% + ${ve()}px))`, _ = we() || D() === void 0 ? "none" : D() ? "transform 500ms cubic-bezier(.1, 0, .25, 1)" : "none";
279
- return n !== r.e && z(e, r.e = n), u !== r.t && ee(e, "aria-label", r.t = u), r.a = te(e, w, r.a), m !== r.o && re(i, "transform", r.o = m), _ !== r.i && re(i, "transition", r.i = _), r;
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
- Ee(["mousedown", "touchstart", "touchend", "click"]);
303
+ Fe(["mousedown", "touchstart", "touchmove", "touchend", "click"]);
290
304
  export {
291
- Ze as Carousel
305
+ ot as Carousel
292
306
  };
293
307
  //# sourceMappingURL=carousel.js.map