@slidejs/runner-swiper 0.1.1 → 0.1.3
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/.turbo/turbo-build.log +15 -15
- package/LICENSE +22 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +401 -382
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -13
- package/src/adapter.ts +8 -10
- package/src/env.d.ts +17 -0
- package/src/index.ts +3 -0
- package/src/runner.ts +39 -2
- package/src/style.css +154 -0
- package/tsconfig.json +1 -1
- package/vite.config.ts +12 -0
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Swiper as F } from "swiper";
|
|
2
|
-
import { parseSlideDSL as
|
|
3
|
-
import { SlideRunner as
|
|
4
|
-
function
|
|
2
|
+
import { parseSlideDSL as U, compile as V } from "@slidejs/dsl";
|
|
3
|
+
import { SlideRunner as K } from "@slidejs/runner";
|
|
4
|
+
function T(s) {
|
|
5
5
|
return s !== null && typeof s == "object" && "constructor" in s && s.constructor === Object;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function G(s, e) {
|
|
8
8
|
s === void 0 && (s = {}), e === void 0 && (e = {});
|
|
9
|
-
const
|
|
10
|
-
Object.keys(e).filter((
|
|
11
|
-
typeof s[
|
|
9
|
+
const n = ["__proto__", "constructor", "prototype"];
|
|
10
|
+
Object.keys(e).filter((i) => n.indexOf(i) < 0).forEach((i) => {
|
|
11
|
+
typeof s[i] > "u" ? s[i] = e[i] : T(e[i]) && T(s[i]) && Object.keys(e[i]).length > 0 && G(s[i], e[i]);
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
const
|
|
14
|
+
const $ = {
|
|
15
15
|
body: {},
|
|
16
16
|
addEventListener() {
|
|
17
17
|
},
|
|
@@ -66,12 +66,12 @@ const V = {
|
|
|
66
66
|
search: ""
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
function
|
|
69
|
+
function W() {
|
|
70
70
|
const s = typeof document < "u" ? document : {};
|
|
71
|
-
return
|
|
71
|
+
return G(s, $), s;
|
|
72
72
|
}
|
|
73
73
|
const J = {
|
|
74
|
-
document:
|
|
74
|
+
document: $,
|
|
75
75
|
navigator: {
|
|
76
76
|
userAgent: ""
|
|
77
77
|
},
|
|
@@ -128,135 +128,135 @@ const J = {
|
|
|
128
128
|
typeof setTimeout > "u" || clearTimeout(s);
|
|
129
129
|
}
|
|
130
130
|
};
|
|
131
|
-
function
|
|
131
|
+
function H() {
|
|
132
132
|
const s = typeof window < "u" ? window : {};
|
|
133
|
-
return
|
|
133
|
+
return G(s, J), s;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function X(s) {
|
|
136
136
|
return s === void 0 && (s = ""), s.trim().split(" ").filter((e) => !!e.trim());
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function _(s, e) {
|
|
139
139
|
e === void 0 && (e = "");
|
|
140
|
-
const
|
|
141
|
-
return
|
|
140
|
+
const n = H(), i = [...s.children];
|
|
141
|
+
return n.HTMLSlotElement && s instanceof HTMLSlotElement && i.push(...s.assignedElements()), e ? i.filter((l) => l.matches(e)) : i;
|
|
142
142
|
}
|
|
143
143
|
function ee(s, e) {
|
|
144
144
|
e === void 0 && (e = []);
|
|
145
|
-
const
|
|
146
|
-
return
|
|
145
|
+
const n = document.createElement(s);
|
|
146
|
+
return n.classList.add(...Array.isArray(e) ? e : X(e)), n;
|
|
147
147
|
}
|
|
148
148
|
function te(s) {
|
|
149
|
-
const e =
|
|
149
|
+
const e = H(), n = W(), i = s.getBoundingClientRect(), l = n.body, a = s.clientTop || l.clientTop || 0, m = s.clientLeft || l.clientLeft || 0, w = s === e ? e.scrollY : s.scrollTop, f = s === e ? e.scrollX : s.scrollLeft;
|
|
150
150
|
return {
|
|
151
|
-
top:
|
|
152
|
-
left:
|
|
151
|
+
top: i.top + w - a,
|
|
152
|
+
left: i.left + f - m
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
|
-
function
|
|
156
|
-
let e = s,
|
|
155
|
+
function I(s) {
|
|
156
|
+
let e = s, n;
|
|
157
157
|
if (e) {
|
|
158
|
-
for (
|
|
159
|
-
e.nodeType === 1 && (
|
|
160
|
-
return
|
|
158
|
+
for (n = 0; (e = e.previousSibling) !== null; )
|
|
159
|
+
e.nodeType === 1 && (n += 1);
|
|
160
|
+
return n;
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
function N(s, e) {
|
|
164
|
-
const
|
|
165
|
-
let
|
|
166
|
-
for (;
|
|
167
|
-
e ?
|
|
168
|
-
return
|
|
164
|
+
const n = [];
|
|
165
|
+
let i = s.parentElement;
|
|
166
|
+
for (; i; )
|
|
167
|
+
e ? i.matches(e) && n.push(i) : n.push(i), i = i.parentElement;
|
|
168
|
+
return n;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
const
|
|
172
|
-
return s[e === "width" ? "offsetWidth" : "offsetHeight"] + parseFloat(
|
|
170
|
+
function ie(s, e, n) {
|
|
171
|
+
const i = H();
|
|
172
|
+
return s[e === "width" ? "offsetWidth" : "offsetHeight"] + parseFloat(i.getComputedStyle(s, null).getPropertyValue(e === "width" ? "margin-right" : "margin-top")) + parseFloat(i.getComputedStyle(s, null).getPropertyValue(e === "width" ? "margin-left" : "margin-bottom"));
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function x(s) {
|
|
175
175
|
return (Array.isArray(s) ? s : [s]).filter((e) => !!e);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function O(s, e) {
|
|
178
178
|
e === void 0 && (e = ""), typeof trustedTypes < "u" ? s.innerHTML = trustedTypes.createPolicy("html", {
|
|
179
|
-
createHTML: (
|
|
179
|
+
createHTML: (n) => n
|
|
180
180
|
}).createHTML(e) : s.innerHTML = e;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function Q(s) {
|
|
183
183
|
let {
|
|
184
184
|
swiper: e,
|
|
185
|
-
extendParams:
|
|
186
|
-
on:
|
|
187
|
-
emit:
|
|
185
|
+
extendParams: n,
|
|
186
|
+
on: i,
|
|
187
|
+
emit: l
|
|
188
188
|
} = s;
|
|
189
|
-
const
|
|
189
|
+
const a = W(), m = H();
|
|
190
190
|
e.keyboard = {
|
|
191
191
|
enabled: !1
|
|
192
|
-
},
|
|
192
|
+
}, n({
|
|
193
193
|
keyboard: {
|
|
194
194
|
enabled: !1,
|
|
195
195
|
onlyInViewport: !0,
|
|
196
196
|
pageUpDown: !0
|
|
197
197
|
}
|
|
198
198
|
});
|
|
199
|
-
function
|
|
199
|
+
function w(M) {
|
|
200
200
|
if (!e.enabled) return;
|
|
201
201
|
const {
|
|
202
|
-
rtlTranslate:
|
|
202
|
+
rtlTranslate: v
|
|
203
203
|
} = e;
|
|
204
|
-
let
|
|
205
|
-
|
|
206
|
-
const
|
|
207
|
-
if (!e.allowSlideNext && (e.isHorizontal() && t || e.isVertical() &&
|
|
204
|
+
let A = M;
|
|
205
|
+
A.originalEvent && (A = A.originalEvent);
|
|
206
|
+
const B = A.keyCode || A.charCode, d = e.params.keyboard.pageUpDown, p = d && B === 33, u = d && B === 34, g = B === 37, t = B === 39, r = B === 38, o = B === 40;
|
|
207
|
+
if (!e.allowSlideNext && (e.isHorizontal() && t || e.isVertical() && o || u) || !e.allowSlidePrev && (e.isHorizontal() && g || e.isVertical() && r || p))
|
|
208
208
|
return !1;
|
|
209
|
-
if (!(
|
|
210
|
-
if (e.params.keyboard.onlyInViewport && (
|
|
211
|
-
let
|
|
209
|
+
if (!(A.shiftKey || A.altKey || A.ctrlKey || A.metaKey) && !(a.activeElement && (a.activeElement.isContentEditable || a.activeElement.nodeName && (a.activeElement.nodeName.toLowerCase() === "input" || a.activeElement.nodeName.toLowerCase() === "textarea")))) {
|
|
210
|
+
if (e.params.keyboard.onlyInViewport && (p || u || g || t || r || o)) {
|
|
211
|
+
let c = !1;
|
|
212
212
|
if (N(e.el, `.${e.params.slideClass}, swiper-slide`).length > 0 && N(e.el, `.${e.params.slideActiveClass}`).length === 0)
|
|
213
213
|
return;
|
|
214
|
-
const E = e.el,
|
|
215
|
-
|
|
216
|
-
const D = [[
|
|
214
|
+
const E = e.el, z = E.clientWidth, Y = E.clientHeight, b = m.innerWidth, S = m.innerHeight, h = te(E);
|
|
215
|
+
v && (h.left -= E.scrollLeft);
|
|
216
|
+
const D = [[h.left, h.top], [h.left + z, h.top], [h.left, h.top + Y], [h.left + z, h.top + Y]];
|
|
217
217
|
for (let C = 0; C < D.length; C += 1) {
|
|
218
218
|
const y = D[C];
|
|
219
|
-
if (y[0] >= 0 && y[0] <=
|
|
219
|
+
if (y[0] >= 0 && y[0] <= b && y[1] >= 0 && y[1] <= S) {
|
|
220
220
|
if (y[0] === 0 && y[1] === 0) continue;
|
|
221
|
-
|
|
221
|
+
c = !0;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
if (!
|
|
224
|
+
if (!c) return;
|
|
225
225
|
}
|
|
226
|
-
e.isHorizontal() ? ((
|
|
226
|
+
e.isHorizontal() ? ((p || u || g || t) && (A.preventDefault ? A.preventDefault() : A.returnValue = !1), ((u || t) && !v || (p || g) && v) && e.slideNext(), ((p || g) && !v || (u || t) && v) && e.slidePrev()) : ((p || u || r || o) && (A.preventDefault ? A.preventDefault() : A.returnValue = !1), (u || o) && e.slideNext(), (p || r) && e.slidePrev()), l("keyPress", B);
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
e.keyboard.enabled || (
|
|
229
|
+
function f() {
|
|
230
|
+
e.keyboard.enabled || (a.addEventListener("keydown", w), e.keyboard.enabled = !0);
|
|
231
231
|
}
|
|
232
232
|
function k() {
|
|
233
|
-
e.keyboard.enabled && (
|
|
233
|
+
e.keyboard.enabled && (a.removeEventListener("keydown", w), e.keyboard.enabled = !1);
|
|
234
234
|
}
|
|
235
|
-
|
|
236
|
-
e.params.keyboard.enabled &&
|
|
237
|
-
}),
|
|
235
|
+
i("init", () => {
|
|
236
|
+
e.params.keyboard.enabled && f();
|
|
237
|
+
}), i("destroy", () => {
|
|
238
238
|
e.keyboard.enabled && k();
|
|
239
239
|
}), Object.assign(e.keyboard, {
|
|
240
|
-
enable:
|
|
240
|
+
enable: f,
|
|
241
241
|
disable: k
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
|
-
function
|
|
245
|
-
return s.params.createElements && Object.keys(
|
|
246
|
-
if (!
|
|
247
|
-
let
|
|
248
|
-
|
|
244
|
+
function q(s, e, n, i) {
|
|
245
|
+
return s.params.createElements && Object.keys(i).forEach((l) => {
|
|
246
|
+
if (!n[l] && n.auto === !0) {
|
|
247
|
+
let a = _(s.el, `.${i[l]}`)[0];
|
|
248
|
+
a || (a = ee("div", i[l]), a.className = i[l], s.el.append(a)), n[l] = a, e[l] = a;
|
|
249
249
|
}
|
|
250
|
-
}),
|
|
250
|
+
}), n;
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function R(s) {
|
|
253
253
|
let {
|
|
254
254
|
swiper: e,
|
|
255
|
-
extendParams:
|
|
256
|
-
on:
|
|
257
|
-
emit:
|
|
255
|
+
extendParams: n,
|
|
256
|
+
on: i,
|
|
257
|
+
emit: l
|
|
258
258
|
} = s;
|
|
259
|
-
|
|
259
|
+
n({
|
|
260
260
|
navigation: {
|
|
261
261
|
nextEl: null,
|
|
262
262
|
prevEl: null,
|
|
@@ -270,119 +270,119 @@ function U(s) {
|
|
|
270
270
|
nextEl: null,
|
|
271
271
|
prevEl: null
|
|
272
272
|
};
|
|
273
|
-
function
|
|
274
|
-
let
|
|
275
|
-
return d && typeof d == "string" && e.isElement && (
|
|
276
|
-
}
|
|
277
|
-
function
|
|
278
|
-
const
|
|
279
|
-
d =
|
|
280
|
-
|
|
273
|
+
function a(d) {
|
|
274
|
+
let p;
|
|
275
|
+
return d && typeof d == "string" && e.isElement && (p = e.el.querySelector(d) || e.hostEl.querySelector(d), p) ? p : (d && (typeof d == "string" && (p = [...document.querySelectorAll(d)]), e.params.uniqueNavElements && typeof d == "string" && p && p.length > 1 && e.el.querySelectorAll(d).length === 1 ? p = e.el.querySelector(d) : p && p.length === 1 && (p = p[0])), d && !p ? d : p);
|
|
276
|
+
}
|
|
277
|
+
function m(d, p) {
|
|
278
|
+
const u = e.params.navigation;
|
|
279
|
+
d = x(d), d.forEach((g) => {
|
|
280
|
+
g && (g.classList[p ? "add" : "remove"](...u.disabledClass.split(" ")), g.tagName === "BUTTON" && (g.disabled = p), e.params.watchOverflow && e.enabled && g.classList[e.isLocked ? "add" : "remove"](u.lockClass));
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function w() {
|
|
284
284
|
const {
|
|
285
285
|
nextEl: d,
|
|
286
|
-
prevEl:
|
|
286
|
+
prevEl: p
|
|
287
287
|
} = e.navigation;
|
|
288
288
|
if (e.params.loop) {
|
|
289
|
-
|
|
289
|
+
m(p, !1), m(d, !1);
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
|
|
292
|
+
m(p, e.isBeginning && !e.params.rewind), m(d, e.isEnd && !e.params.rewind);
|
|
293
293
|
}
|
|
294
|
-
function
|
|
295
|
-
d.preventDefault(), !(e.isBeginning && !e.params.loop && !e.params.rewind) && (e.slidePrev(),
|
|
294
|
+
function f(d) {
|
|
295
|
+
d.preventDefault(), !(e.isBeginning && !e.params.loop && !e.params.rewind) && (e.slidePrev(), l("navigationPrev"));
|
|
296
296
|
}
|
|
297
297
|
function k(d) {
|
|
298
|
-
d.preventDefault(), !(e.isEnd && !e.params.loop && !e.params.rewind) && (e.slideNext(),
|
|
298
|
+
d.preventDefault(), !(e.isEnd && !e.params.loop && !e.params.rewind) && (e.slideNext(), l("navigationNext"));
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function M() {
|
|
301
301
|
const d = e.params.navigation;
|
|
302
|
-
if (e.params.navigation =
|
|
302
|
+
if (e.params.navigation = q(e, e.originalParams.navigation, e.params.navigation, {
|
|
303
303
|
nextEl: "swiper-button-next",
|
|
304
304
|
prevEl: "swiper-button-prev"
|
|
305
305
|
}), !(d.nextEl || d.prevEl)) return;
|
|
306
|
-
let
|
|
306
|
+
let p = a(d.nextEl), u = a(d.prevEl);
|
|
307
307
|
Object.assign(e.navigation, {
|
|
308
|
-
nextEl:
|
|
309
|
-
prevEl:
|
|
310
|
-
}),
|
|
311
|
-
const
|
|
312
|
-
t && t.addEventListener("click",
|
|
308
|
+
nextEl: p,
|
|
309
|
+
prevEl: u
|
|
310
|
+
}), p = x(p), u = x(u);
|
|
311
|
+
const g = (t, r) => {
|
|
312
|
+
t && t.addEventListener("click", r === "next" ? k : f), !e.enabled && t && t.classList.add(...d.lockClass.split(" "));
|
|
313
313
|
};
|
|
314
|
-
|
|
314
|
+
p.forEach((t) => g(t, "next")), u.forEach((t) => g(t, "prev"));
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function v() {
|
|
317
317
|
let {
|
|
318
318
|
nextEl: d,
|
|
319
|
-
prevEl:
|
|
319
|
+
prevEl: p
|
|
320
320
|
} = e.navigation;
|
|
321
|
-
d =
|
|
322
|
-
const
|
|
323
|
-
|
|
321
|
+
d = x(d), p = x(p);
|
|
322
|
+
const u = (g, t) => {
|
|
323
|
+
g.removeEventListener("click", t === "next" ? k : f), g.classList.remove(...e.params.navigation.disabledClass.split(" "));
|
|
324
324
|
};
|
|
325
|
-
d.forEach((
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
e.params.navigation.enabled === !1 ?
|
|
329
|
-
}),
|
|
330
|
-
|
|
331
|
-
}),
|
|
332
|
-
|
|
333
|
-
}),
|
|
325
|
+
d.forEach((g) => u(g, "next")), p.forEach((g) => u(g, "prev"));
|
|
326
|
+
}
|
|
327
|
+
i("init", () => {
|
|
328
|
+
e.params.navigation.enabled === !1 ? B() : (M(), w());
|
|
329
|
+
}), i("toEdge fromEdge lock unlock", () => {
|
|
330
|
+
w();
|
|
331
|
+
}), i("destroy", () => {
|
|
332
|
+
v();
|
|
333
|
+
}), i("enable disable", () => {
|
|
334
334
|
let {
|
|
335
335
|
nextEl: d,
|
|
336
|
-
prevEl:
|
|
336
|
+
prevEl: p
|
|
337
337
|
} = e.navigation;
|
|
338
|
-
if (d =
|
|
339
|
-
|
|
338
|
+
if (d = x(d), p = x(p), e.enabled) {
|
|
339
|
+
w();
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
|
-
[...d, ...
|
|
343
|
-
}),
|
|
342
|
+
[...d, ...p].filter((u) => !!u).forEach((u) => u.classList.add(e.params.navigation.lockClass));
|
|
343
|
+
}), i("click", (d, p) => {
|
|
344
344
|
let {
|
|
345
|
-
nextEl:
|
|
346
|
-
prevEl:
|
|
345
|
+
nextEl: u,
|
|
346
|
+
prevEl: g
|
|
347
347
|
} = e.navigation;
|
|
348
|
-
|
|
349
|
-
const t =
|
|
350
|
-
let
|
|
351
|
-
if (e.isElement && !
|
|
352
|
-
const
|
|
353
|
-
|
|
348
|
+
u = x(u), g = x(g);
|
|
349
|
+
const t = p.target;
|
|
350
|
+
let r = g.includes(t) || u.includes(t);
|
|
351
|
+
if (e.isElement && !r) {
|
|
352
|
+
const o = p.path || p.composedPath && p.composedPath();
|
|
353
|
+
o && (r = o.find((c) => u.includes(c) || g.includes(c)));
|
|
354
354
|
}
|
|
355
|
-
if (e.params.navigation.hideOnClick && !
|
|
355
|
+
if (e.params.navigation.hideOnClick && !r) {
|
|
356
356
|
if (e.pagination && e.params.pagination && e.params.pagination.clickable && (e.pagination.el === t || e.pagination.el.contains(t))) return;
|
|
357
|
-
let
|
|
358
|
-
|
|
357
|
+
let o;
|
|
358
|
+
u.length ? o = u[0].classList.contains(e.params.navigation.hiddenClass) : g.length && (o = g[0].classList.contains(e.params.navigation.hiddenClass)), l(o === !0 ? "navigationShow" : "navigationHide"), [...u, ...g].filter((c) => !!c).forEach((c) => c.classList.toggle(e.params.navigation.hiddenClass));
|
|
359
359
|
}
|
|
360
360
|
});
|
|
361
|
-
const
|
|
362
|
-
e.el.classList.remove(...e.params.navigation.navigationDisabledClass.split(" ")),
|
|
363
|
-
},
|
|
364
|
-
e.el.classList.add(...e.params.navigation.navigationDisabledClass.split(" ")),
|
|
361
|
+
const A = () => {
|
|
362
|
+
e.el.classList.remove(...e.params.navigation.navigationDisabledClass.split(" ")), M(), w();
|
|
363
|
+
}, B = () => {
|
|
364
|
+
e.el.classList.add(...e.params.navigation.navigationDisabledClass.split(" ")), v();
|
|
365
365
|
};
|
|
366
366
|
Object.assign(e.navigation, {
|
|
367
|
-
enable:
|
|
368
|
-
disable:
|
|
369
|
-
update:
|
|
370
|
-
init:
|
|
371
|
-
destroy:
|
|
367
|
+
enable: A,
|
|
368
|
+
disable: B,
|
|
369
|
+
update: w,
|
|
370
|
+
init: M,
|
|
371
|
+
destroy: v
|
|
372
372
|
});
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function j(s) {
|
|
375
375
|
return s === void 0 && (s = ""), `.${s.trim().replace(/([\.:!+\/()[\]])/g, "\\$1").replace(/ /g, ".")}`;
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function Z(s) {
|
|
378
378
|
let {
|
|
379
379
|
swiper: e,
|
|
380
|
-
extendParams:
|
|
381
|
-
on:
|
|
382
|
-
emit:
|
|
380
|
+
extendParams: n,
|
|
381
|
+
on: i,
|
|
382
|
+
emit: l
|
|
383
383
|
} = s;
|
|
384
|
-
const
|
|
385
|
-
|
|
384
|
+
const a = "swiper-pagination";
|
|
385
|
+
n({
|
|
386
386
|
pagination: {
|
|
387
387
|
el: null,
|
|
388
388
|
bulletElement: "span",
|
|
@@ -399,204 +399,204 @@ function _(s) {
|
|
|
399
399
|
dynamicMainBullets: 1,
|
|
400
400
|
formatFractionCurrent: (t) => t,
|
|
401
401
|
formatFractionTotal: (t) => t,
|
|
402
|
-
bulletClass: `${
|
|
403
|
-
bulletActiveClass: `${
|
|
404
|
-
modifierClass: `${
|
|
405
|
-
currentClass: `${
|
|
406
|
-
totalClass: `${
|
|
407
|
-
hiddenClass: `${
|
|
408
|
-
progressbarFillClass: `${
|
|
409
|
-
progressbarOppositeClass: `${
|
|
410
|
-
clickableClass: `${
|
|
411
|
-
lockClass: `${
|
|
412
|
-
horizontalClass: `${
|
|
413
|
-
verticalClass: `${
|
|
414
|
-
paginationDisabledClass: `${
|
|
402
|
+
bulletClass: `${a}-bullet`,
|
|
403
|
+
bulletActiveClass: `${a}-bullet-active`,
|
|
404
|
+
modifierClass: `${a}-`,
|
|
405
|
+
currentClass: `${a}-current`,
|
|
406
|
+
totalClass: `${a}-total`,
|
|
407
|
+
hiddenClass: `${a}-hidden`,
|
|
408
|
+
progressbarFillClass: `${a}-progressbar-fill`,
|
|
409
|
+
progressbarOppositeClass: `${a}-progressbar-opposite`,
|
|
410
|
+
clickableClass: `${a}-clickable`,
|
|
411
|
+
lockClass: `${a}-lock`,
|
|
412
|
+
horizontalClass: `${a}-horizontal`,
|
|
413
|
+
verticalClass: `${a}-vertical`,
|
|
414
|
+
paginationDisabledClass: `${a}-disabled`
|
|
415
415
|
}
|
|
416
416
|
}), e.pagination = {
|
|
417
417
|
el: null,
|
|
418
418
|
bullets: []
|
|
419
419
|
};
|
|
420
|
-
let
|
|
421
|
-
function
|
|
420
|
+
let m, w = 0;
|
|
421
|
+
function f() {
|
|
422
422
|
return !e.params.pagination.el || !e.pagination.el || Array.isArray(e.pagination.el) && e.pagination.el.length === 0;
|
|
423
423
|
}
|
|
424
|
-
function k(t,
|
|
424
|
+
function k(t, r) {
|
|
425
425
|
const {
|
|
426
|
-
bulletActiveClass:
|
|
426
|
+
bulletActiveClass: o
|
|
427
427
|
} = e.params.pagination;
|
|
428
|
-
t && (t = t[`${
|
|
428
|
+
t && (t = t[`${r === "prev" ? "previous" : "next"}ElementSibling`], t && (t.classList.add(`${o}-${r}`), t = t[`${r === "prev" ? "previous" : "next"}ElementSibling`], t && t.classList.add(`${o}-${r}-${r}`)));
|
|
429
429
|
}
|
|
430
|
-
function
|
|
431
|
-
if (t = t %
|
|
430
|
+
function M(t, r, o) {
|
|
431
|
+
if (t = t % o, r = r % o, r === t + 1)
|
|
432
432
|
return "next";
|
|
433
|
-
if (
|
|
433
|
+
if (r === t - 1)
|
|
434
434
|
return "previous";
|
|
435
435
|
}
|
|
436
|
-
function
|
|
437
|
-
const
|
|
438
|
-
if (!
|
|
436
|
+
function v(t) {
|
|
437
|
+
const r = t.target.closest(j(e.params.pagination.bulletClass));
|
|
438
|
+
if (!r)
|
|
439
439
|
return;
|
|
440
440
|
t.preventDefault();
|
|
441
|
-
const
|
|
441
|
+
const o = I(r) * e.params.slidesPerGroup;
|
|
442
442
|
if (e.params.loop) {
|
|
443
|
-
if (e.realIndex ===
|
|
444
|
-
const
|
|
445
|
-
|
|
443
|
+
if (e.realIndex === o) return;
|
|
444
|
+
const c = M(e.realIndex, o, e.slides.length);
|
|
445
|
+
c === "next" ? e.slideNext() : c === "previous" ? e.slidePrev() : e.slideToLoop(o);
|
|
446
446
|
} else
|
|
447
|
-
e.slideTo(
|
|
448
|
-
}
|
|
449
|
-
function
|
|
450
|
-
const t = e.rtl,
|
|
451
|
-
if (
|
|
452
|
-
let
|
|
453
|
-
|
|
454
|
-
let
|
|
455
|
-
const
|
|
456
|
-
if (e.params.loop ? (E = e.previousRealIndex || 0,
|
|
457
|
-
const
|
|
458
|
-
let
|
|
459
|
-
if (
|
|
460
|
-
C.style[e.isHorizontal() ? "width" : "height"] = `${
|
|
461
|
-
}),
|
|
462
|
-
const y = [...["", "-next", "-next-next", "-prev", "-prev-prev", "-main"].map((
|
|
447
|
+
e.slideTo(o);
|
|
448
|
+
}
|
|
449
|
+
function A() {
|
|
450
|
+
const t = e.rtl, r = e.params.pagination;
|
|
451
|
+
if (f()) return;
|
|
452
|
+
let o = e.pagination.el;
|
|
453
|
+
o = x(o);
|
|
454
|
+
let c, E;
|
|
455
|
+
const z = e.virtual && e.params.virtual.enabled ? e.virtual.slides.length : e.slides.length, Y = e.params.loop ? Math.ceil(z / e.params.slidesPerGroup) : e.snapGrid.length;
|
|
456
|
+
if (e.params.loop ? (E = e.previousRealIndex || 0, c = e.params.slidesPerGroup > 1 ? Math.floor(e.realIndex / e.params.slidesPerGroup) : e.realIndex) : typeof e.snapIndex < "u" ? (c = e.snapIndex, E = e.previousSnapIndex) : (E = e.previousIndex || 0, c = e.activeIndex || 0), r.type === "bullets" && e.pagination.bullets && e.pagination.bullets.length > 0) {
|
|
457
|
+
const b = e.pagination.bullets;
|
|
458
|
+
let S, h, D;
|
|
459
|
+
if (r.dynamicBullets && (m = ie(b[0], e.isHorizontal() ? "width" : "height"), o.forEach((C) => {
|
|
460
|
+
C.style[e.isHorizontal() ? "width" : "height"] = `${m * (r.dynamicMainBullets + 4)}px`;
|
|
461
|
+
}), r.dynamicMainBullets > 1 && E !== void 0 && (w += c - (E || 0), w > r.dynamicMainBullets - 1 ? w = r.dynamicMainBullets - 1 : w < 0 && (w = 0)), S = Math.max(c - w, 0), h = S + (Math.min(b.length, r.dynamicMainBullets) - 1), D = (h + S) / 2), b.forEach((C) => {
|
|
462
|
+
const y = [...["", "-next", "-next-next", "-prev", "-prev-prev", "-main"].map((L) => `${r.bulletActiveClass}${L}`)].map((L) => typeof L == "string" && L.includes(" ") ? L.split(" ") : L).flat();
|
|
463
463
|
C.classList.remove(...y);
|
|
464
|
-
}),
|
|
465
|
-
|
|
466
|
-
const y =
|
|
467
|
-
y ===
|
|
464
|
+
}), o.length > 1)
|
|
465
|
+
b.forEach((C) => {
|
|
466
|
+
const y = I(C);
|
|
467
|
+
y === c ? C.classList.add(...r.bulletActiveClass.split(" ")) : e.isElement && C.setAttribute("part", "bullet"), r.dynamicBullets && (y >= S && y <= h && C.classList.add(...`${r.bulletActiveClass}-main`.split(" ")), y === S && k(C, "prev"), y === h && k(C, "next"));
|
|
468
468
|
});
|
|
469
469
|
else {
|
|
470
|
-
const C =
|
|
471
|
-
if (C && C.classList.add(...
|
|
472
|
-
y.setAttribute("part",
|
|
473
|
-
}),
|
|
474
|
-
const y =
|
|
475
|
-
for (let
|
|
476
|
-
|
|
477
|
-
k(y, "prev"), k(
|
|
470
|
+
const C = b[c];
|
|
471
|
+
if (C && C.classList.add(...r.bulletActiveClass.split(" ")), e.isElement && b.forEach((y, L) => {
|
|
472
|
+
y.setAttribute("part", L === c ? "bullet-active" : "bullet");
|
|
473
|
+
}), r.dynamicBullets) {
|
|
474
|
+
const y = b[S], L = b[h];
|
|
475
|
+
for (let P = S; P <= h; P += 1)
|
|
476
|
+
b[P] && b[P].classList.add(...`${r.bulletActiveClass}-main`.split(" "));
|
|
477
|
+
k(y, "prev"), k(L, "next");
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
if (
|
|
481
|
-
const C = Math.min(
|
|
482
|
-
|
|
483
|
-
|
|
480
|
+
if (r.dynamicBullets) {
|
|
481
|
+
const C = Math.min(b.length, r.dynamicMainBullets + 4), y = (m * C - m) / 2 - D * m, L = t ? "right" : "left";
|
|
482
|
+
b.forEach((P) => {
|
|
483
|
+
P.style[e.isHorizontal() ? L : "top"] = `${y}px`;
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
|
-
|
|
488
|
-
if (
|
|
489
|
-
|
|
490
|
-
}),
|
|
491
|
-
|
|
492
|
-
})),
|
|
493
|
-
let
|
|
494
|
-
|
|
495
|
-
const D = (
|
|
487
|
+
o.forEach((b, S) => {
|
|
488
|
+
if (r.type === "fraction" && (b.querySelectorAll(j(r.currentClass)).forEach((h) => {
|
|
489
|
+
h.textContent = r.formatFractionCurrent(c + 1);
|
|
490
|
+
}), b.querySelectorAll(j(r.totalClass)).forEach((h) => {
|
|
491
|
+
h.textContent = r.formatFractionTotal(Y);
|
|
492
|
+
})), r.type === "progressbar") {
|
|
493
|
+
let h;
|
|
494
|
+
r.progressbarOpposite ? h = e.isHorizontal() ? "vertical" : "horizontal" : h = e.isHorizontal() ? "horizontal" : "vertical";
|
|
495
|
+
const D = (c + 1) / Y;
|
|
496
496
|
let C = 1, y = 1;
|
|
497
|
-
|
|
498
|
-
|
|
497
|
+
h === "horizontal" ? C = D : y = D, b.querySelectorAll(j(r.progressbarFillClass)).forEach((L) => {
|
|
498
|
+
L.style.transform = `translate3d(0,0,0) scaleX(${C}) scaleY(${y})`, L.style.transitionDuration = `${e.params.speed}ms`;
|
|
499
499
|
});
|
|
500
500
|
}
|
|
501
|
-
|
|
501
|
+
r.type === "custom" && r.renderCustom ? (O(b, r.renderCustom(e, c + 1, Y)), S === 0 && l("paginationRender", b)) : (S === 0 && l("paginationRender", b), l("paginationUpdate", b)), e.params.watchOverflow && e.enabled && b.classList[e.isLocked ? "add" : "remove"](r.lockClass);
|
|
502
502
|
});
|
|
503
503
|
}
|
|
504
|
-
function
|
|
504
|
+
function B() {
|
|
505
505
|
const t = e.params.pagination;
|
|
506
|
-
if (
|
|
507
|
-
const
|
|
508
|
-
let
|
|
509
|
-
|
|
510
|
-
let
|
|
506
|
+
if (f()) return;
|
|
507
|
+
const r = e.virtual && e.params.virtual.enabled ? e.virtual.slides.length : e.grid && e.params.grid.rows > 1 ? e.slides.length / Math.ceil(e.params.grid.rows) : e.slides.length;
|
|
508
|
+
let o = e.pagination.el;
|
|
509
|
+
o = x(o);
|
|
510
|
+
let c = "";
|
|
511
511
|
if (t.type === "bullets") {
|
|
512
|
-
let E = e.params.loop ? Math.ceil(
|
|
513
|
-
e.params.freeMode && e.params.freeMode.enabled && E >
|
|
514
|
-
for (let
|
|
515
|
-
t.renderBullet ?
|
|
512
|
+
let E = e.params.loop ? Math.ceil(r / e.params.slidesPerGroup) : e.snapGrid.length;
|
|
513
|
+
e.params.freeMode && e.params.freeMode.enabled && E > r && (E = r);
|
|
514
|
+
for (let z = 0; z < E; z += 1)
|
|
515
|
+
t.renderBullet ? c += t.renderBullet.call(e, z, t.bulletClass) : c += `<${t.bulletElement} ${e.isElement ? 'part="bullet"' : ""} class="${t.bulletClass}"></${t.bulletElement}>`;
|
|
516
516
|
}
|
|
517
|
-
t.type === "fraction" && (t.renderFraction ?
|
|
518
|
-
t.type !== "custom" &&
|
|
519
|
-
}), t.type !== "custom" &&
|
|
517
|
+
t.type === "fraction" && (t.renderFraction ? c = t.renderFraction.call(e, t.currentClass, t.totalClass) : c = `<span class="${t.currentClass}"></span> / <span class="${t.totalClass}"></span>`), t.type === "progressbar" && (t.renderProgressbar ? c = t.renderProgressbar.call(e, t.progressbarFillClass) : c = `<span class="${t.progressbarFillClass}"></span>`), e.pagination.bullets = [], o.forEach((E) => {
|
|
518
|
+
t.type !== "custom" && O(E, c || ""), t.type === "bullets" && e.pagination.bullets.push(...E.querySelectorAll(j(t.bulletClass)));
|
|
519
|
+
}), t.type !== "custom" && l("paginationRender", o[0]);
|
|
520
520
|
}
|
|
521
521
|
function d() {
|
|
522
|
-
e.params.pagination =
|
|
522
|
+
e.params.pagination = q(e, e.originalParams.pagination, e.params.pagination, {
|
|
523
523
|
el: "swiper-pagination"
|
|
524
524
|
});
|
|
525
525
|
const t = e.params.pagination;
|
|
526
526
|
if (!t.el) return;
|
|
527
|
-
let
|
|
528
|
-
typeof t.el == "string" && e.isElement && (
|
|
529
|
-
el:
|
|
530
|
-
}),
|
|
531
|
-
t.type === "bullets" && t.clickable &&
|
|
527
|
+
let r;
|
|
528
|
+
typeof t.el == "string" && e.isElement && (r = e.el.querySelector(t.el)), !r && typeof t.el == "string" && (r = [...document.querySelectorAll(t.el)]), r || (r = t.el), !(!r || r.length === 0) && (e.params.uniqueNavElements && typeof t.el == "string" && Array.isArray(r) && r.length > 1 && (r = [...e.el.querySelectorAll(t.el)], r.length > 1 && (r = r.find((o) => N(o, ".swiper")[0] === e.el))), Array.isArray(r) && r.length === 1 && (r = r[0]), Object.assign(e.pagination, {
|
|
529
|
+
el: r
|
|
530
|
+
}), r = x(r), r.forEach((o) => {
|
|
531
|
+
t.type === "bullets" && t.clickable && o.classList.add(...(t.clickableClass || "").split(" ")), o.classList.add(t.modifierClass + t.type), o.classList.add(e.isHorizontal() ? t.horizontalClass : t.verticalClass), t.type === "bullets" && t.dynamicBullets && (o.classList.add(`${t.modifierClass}${t.type}-dynamic`), w = 0, t.dynamicMainBullets < 1 && (t.dynamicMainBullets = 1)), t.type === "progressbar" && t.progressbarOpposite && o.classList.add(t.progressbarOppositeClass), t.clickable && o.addEventListener("click", v), e.enabled || o.classList.add(t.lockClass);
|
|
532
532
|
}));
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function p() {
|
|
535
535
|
const t = e.params.pagination;
|
|
536
|
-
if (
|
|
537
|
-
let
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
})), e.pagination.bullets && e.pagination.bullets.forEach((
|
|
536
|
+
if (f()) return;
|
|
537
|
+
let r = e.pagination.el;
|
|
538
|
+
r && (r = x(r), r.forEach((o) => {
|
|
539
|
+
o.classList.remove(t.hiddenClass), o.classList.remove(t.modifierClass + t.type), o.classList.remove(e.isHorizontal() ? t.horizontalClass : t.verticalClass), t.clickable && (o.classList.remove(...(t.clickableClass || "").split(" ")), o.removeEventListener("click", v));
|
|
540
|
+
})), e.pagination.bullets && e.pagination.bullets.forEach((o) => o.classList.remove(...t.bulletActiveClass.split(" ")));
|
|
541
541
|
}
|
|
542
|
-
|
|
542
|
+
i("changeDirection", () => {
|
|
543
543
|
if (!e.pagination || !e.pagination.el) return;
|
|
544
544
|
const t = e.params.pagination;
|
|
545
545
|
let {
|
|
546
|
-
el:
|
|
546
|
+
el: r
|
|
547
547
|
} = e.pagination;
|
|
548
|
-
|
|
549
|
-
|
|
548
|
+
r = x(r), r.forEach((o) => {
|
|
549
|
+
o.classList.remove(t.horizontalClass, t.verticalClass), o.classList.add(e.isHorizontal() ? t.horizontalClass : t.verticalClass);
|
|
550
550
|
});
|
|
551
|
-
}),
|
|
552
|
-
e.params.pagination.enabled === !1 ?
|
|
553
|
-
}),
|
|
554
|
-
typeof e.snapIndex > "u" &&
|
|
555
|
-
}),
|
|
556
|
-
|
|
557
|
-
}),
|
|
558
|
-
|
|
559
|
-
}),
|
|
560
|
-
|
|
561
|
-
}),
|
|
551
|
+
}), i("init", () => {
|
|
552
|
+
e.params.pagination.enabled === !1 ? g() : (d(), B(), A());
|
|
553
|
+
}), i("activeIndexChange", () => {
|
|
554
|
+
typeof e.snapIndex > "u" && A();
|
|
555
|
+
}), i("snapIndexChange", () => {
|
|
556
|
+
A();
|
|
557
|
+
}), i("snapGridLengthChange", () => {
|
|
558
|
+
B(), A();
|
|
559
|
+
}), i("destroy", () => {
|
|
560
|
+
p();
|
|
561
|
+
}), i("enable disable", () => {
|
|
562
562
|
let {
|
|
563
563
|
el: t
|
|
564
564
|
} = e.pagination;
|
|
565
|
-
t && (t =
|
|
566
|
-
}),
|
|
567
|
-
|
|
568
|
-
}),
|
|
569
|
-
const
|
|
570
|
-
if (e.params.pagination.el && e.params.pagination.hideOnClick &&
|
|
571
|
-
if (e.navigation && (e.navigation.nextEl &&
|
|
572
|
-
const E =
|
|
573
|
-
|
|
565
|
+
t && (t = x(t), t.forEach((r) => r.classList[e.enabled ? "remove" : "add"](e.params.pagination.lockClass)));
|
|
566
|
+
}), i("lock unlock", () => {
|
|
567
|
+
A();
|
|
568
|
+
}), i("click", (t, r) => {
|
|
569
|
+
const o = r.target, c = x(e.pagination.el);
|
|
570
|
+
if (e.params.pagination.el && e.params.pagination.hideOnClick && c && c.length > 0 && !o.classList.contains(e.params.pagination.bulletClass)) {
|
|
571
|
+
if (e.navigation && (e.navigation.nextEl && o === e.navigation.nextEl || e.navigation.prevEl && o === e.navigation.prevEl)) return;
|
|
572
|
+
const E = c[0].classList.contains(e.params.pagination.hiddenClass);
|
|
573
|
+
l(E === !0 ? "paginationShow" : "paginationHide"), c.forEach((z) => z.classList.toggle(e.params.pagination.hiddenClass));
|
|
574
574
|
}
|
|
575
575
|
});
|
|
576
|
-
const
|
|
576
|
+
const u = () => {
|
|
577
577
|
e.el.classList.remove(e.params.pagination.paginationDisabledClass);
|
|
578
578
|
let {
|
|
579
579
|
el: t
|
|
580
580
|
} = e.pagination;
|
|
581
|
-
t && (t =
|
|
582
|
-
},
|
|
581
|
+
t && (t = x(t), t.forEach((r) => r.classList.remove(e.params.pagination.paginationDisabledClass))), d(), B(), A();
|
|
582
|
+
}, g = () => {
|
|
583
583
|
e.el.classList.add(e.params.pagination.paginationDisabledClass);
|
|
584
584
|
let {
|
|
585
585
|
el: t
|
|
586
586
|
} = e.pagination;
|
|
587
|
-
t && (t =
|
|
587
|
+
t && (t = x(t), t.forEach((r) => r.classList.add(e.params.pagination.paginationDisabledClass))), p();
|
|
588
588
|
};
|
|
589
589
|
Object.assign(e.pagination, {
|
|
590
|
-
enable:
|
|
591
|
-
disable:
|
|
592
|
-
render:
|
|
593
|
-
update:
|
|
590
|
+
enable: u,
|
|
591
|
+
disable: g,
|
|
592
|
+
render: B,
|
|
593
|
+
update: A,
|
|
594
594
|
init: d,
|
|
595
|
-
destroy:
|
|
595
|
+
destroy: p
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
|
-
F.use([
|
|
599
|
-
class
|
|
598
|
+
F.use([R, Z, Q]);
|
|
599
|
+
class re {
|
|
600
600
|
constructor() {
|
|
601
601
|
this.name = "swiper", this.eventHandlers = /* @__PURE__ */ new Map();
|
|
602
602
|
}
|
|
@@ -606,11 +606,11 @@ class ie {
|
|
|
606
606
|
* @param container - 容器元素
|
|
607
607
|
* @param options - Swiper 选项
|
|
608
608
|
*/
|
|
609
|
-
async initialize(e,
|
|
609
|
+
async initialize(e, n) {
|
|
610
610
|
try {
|
|
611
611
|
if (this.createSwiperStructure(e), !this.swiperContainer || !this.swiperWrapper)
|
|
612
612
|
throw new Error("Swiper container not created");
|
|
613
|
-
const
|
|
613
|
+
const i = {
|
|
614
614
|
// 默认配置
|
|
615
615
|
direction: "horizontal",
|
|
616
616
|
loop: !1,
|
|
@@ -618,7 +618,7 @@ class ie {
|
|
|
618
618
|
spaceBetween: 30,
|
|
619
619
|
slidesPerView: 1,
|
|
620
620
|
// 注册模块
|
|
621
|
-
modules: [
|
|
621
|
+
modules: [R, Z, Q],
|
|
622
622
|
// 导航配置
|
|
623
623
|
navigation: {
|
|
624
624
|
nextEl: ".swiper-button-next",
|
|
@@ -634,16 +634,16 @@ class ie {
|
|
|
634
634
|
enabled: !0,
|
|
635
635
|
onlyInViewport: !0
|
|
636
636
|
},
|
|
637
|
-
...
|
|
637
|
+
...n?.swiperConfig
|
|
638
638
|
};
|
|
639
|
-
this.swiper = new F(this.swiperContainer,
|
|
639
|
+
this.swiper = new F(this.swiperContainer, i), await new Promise((l) => {
|
|
640
640
|
requestAnimationFrame(() => {
|
|
641
|
-
|
|
641
|
+
l();
|
|
642
642
|
});
|
|
643
643
|
}), this.setupEventListeners(), this.emit("ready");
|
|
644
|
-
} catch (
|
|
645
|
-
const
|
|
646
|
-
throw this.emit("error", { message:
|
|
644
|
+
} catch (i) {
|
|
645
|
+
const l = i instanceof Error ? i.message : String(i);
|
|
646
|
+
throw this.emit("error", { message: l }), new Error(`Failed to initialize SwiperAdapter: ${l}`);
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
649
|
/**
|
|
@@ -656,14 +656,14 @@ class ie {
|
|
|
656
656
|
throw new Error("SwiperAdapter not initialized");
|
|
657
657
|
try {
|
|
658
658
|
this.swiperWrapper.innerHTML = "";
|
|
659
|
-
for (const
|
|
660
|
-
const
|
|
661
|
-
this.swiperWrapper.appendChild(
|
|
659
|
+
for (const n of e) {
|
|
660
|
+
const i = await this.renderSlide(n);
|
|
661
|
+
this.swiperWrapper.appendChild(i);
|
|
662
662
|
}
|
|
663
663
|
this.swiper.update(), this.emit("slideRendered", { totalSlides: e.length });
|
|
664
|
-
} catch (
|
|
665
|
-
const
|
|
666
|
-
throw this.emit("error", { message:
|
|
664
|
+
} catch (n) {
|
|
665
|
+
const i = n instanceof Error ? n.message : String(n);
|
|
666
|
+
throw this.emit("error", { message: i }), new Error(`Failed to render slides: ${i}`);
|
|
667
667
|
}
|
|
668
668
|
}
|
|
669
669
|
/**
|
|
@@ -700,18 +700,18 @@ class ie {
|
|
|
700
700
|
* @param index - 幻灯片索引
|
|
701
701
|
* @param slide - 新的幻灯片定义
|
|
702
702
|
*/
|
|
703
|
-
async updateSlide(e,
|
|
703
|
+
async updateSlide(e, n) {
|
|
704
704
|
if (!this.swiperWrapper || !this.swiper)
|
|
705
705
|
throw new Error("SwiperAdapter not initialized");
|
|
706
706
|
try {
|
|
707
|
-
const
|
|
708
|
-
if (!
|
|
707
|
+
const l = this.swiperWrapper.querySelectorAll(".swiper-slide")[e];
|
|
708
|
+
if (!l)
|
|
709
709
|
throw new Error(`Slide at index ${e} not found`);
|
|
710
|
-
const
|
|
711
|
-
|
|
712
|
-
} catch (
|
|
713
|
-
const
|
|
714
|
-
throw this.emit("error", { message:
|
|
710
|
+
const a = await this.renderSlide(n);
|
|
711
|
+
l.replaceWith(a), this.swiper.update();
|
|
712
|
+
} catch (i) {
|
|
713
|
+
const l = i instanceof Error ? i.message : String(i);
|
|
714
|
+
throw this.emit("error", { message: l }), new Error(`Failed to update slide: ${l}`);
|
|
715
715
|
}
|
|
716
716
|
}
|
|
717
717
|
/**
|
|
@@ -720,8 +720,8 @@ class ie {
|
|
|
720
720
|
* @param event - 事件类型
|
|
721
721
|
* @param handler - 事件处理器
|
|
722
722
|
*/
|
|
723
|
-
on(e,
|
|
724
|
-
this.eventHandlers.has(e) || this.eventHandlers.set(e, /* @__PURE__ */ new Set()), this.eventHandlers.get(e).add(
|
|
723
|
+
on(e, n) {
|
|
724
|
+
this.eventHandlers.has(e) || this.eventHandlers.set(e, /* @__PURE__ */ new Set()), this.eventHandlers.get(e).add(n);
|
|
725
725
|
}
|
|
726
726
|
/**
|
|
727
727
|
* 移除事件监听器
|
|
@@ -729,37 +729,36 @@ class ie {
|
|
|
729
729
|
* @param event - 事件类型
|
|
730
730
|
* @param handler - 事件处理器
|
|
731
731
|
*/
|
|
732
|
-
off(e,
|
|
733
|
-
const
|
|
734
|
-
|
|
732
|
+
off(e, n) {
|
|
733
|
+
const i = this.eventHandlers.get(e);
|
|
734
|
+
i && i.delete(n);
|
|
735
735
|
}
|
|
736
736
|
/**
|
|
737
737
|
* 创建 Swiper DOM 结构
|
|
738
738
|
*
|
|
739
|
-
* @param container -
|
|
739
|
+
* @param container - 容器元素(这是 runner.ts 创建的独立 div,Swiper 会接管它)
|
|
740
740
|
*/
|
|
741
741
|
createSwiperStructure(e) {
|
|
742
|
-
|
|
743
|
-
a.className = "swiper";
|
|
742
|
+
e.className = "swiper";
|
|
744
743
|
const n = document.createElement("div");
|
|
745
744
|
n.className = "swiper-wrapper";
|
|
746
|
-
const
|
|
747
|
-
|
|
748
|
-
const
|
|
749
|
-
|
|
750
|
-
const
|
|
751
|
-
|
|
745
|
+
const i = document.createElement("div");
|
|
746
|
+
i.className = "swiper-button-prev";
|
|
747
|
+
const l = document.createElement("div");
|
|
748
|
+
l.className = "swiper-button-next";
|
|
749
|
+
const a = document.createElement("div");
|
|
750
|
+
a.className = "swiper-pagination", e.appendChild(n), e.appendChild(i), e.appendChild(l), e.appendChild(a), this.swiperContainer = e, this.swiperWrapper = n;
|
|
752
751
|
}
|
|
753
752
|
/**
|
|
754
753
|
* 设置 Swiper 事件监听
|
|
755
754
|
*/
|
|
756
755
|
setupEventListeners() {
|
|
757
756
|
this.swiper && this.swiper.on("slideChange", () => {
|
|
758
|
-
const e = this.swiper.activeIndex,
|
|
757
|
+
const e = this.swiper.activeIndex, n = this.swiper.previousIndex;
|
|
759
758
|
this.emit("slideChanged", {
|
|
760
759
|
index: e,
|
|
761
|
-
previousIndex:
|
|
762
|
-
from:
|
|
760
|
+
previousIndex: n,
|
|
761
|
+
from: n,
|
|
763
762
|
to: e
|
|
764
763
|
});
|
|
765
764
|
});
|
|
@@ -771,20 +770,19 @@ class ie {
|
|
|
771
770
|
* @returns slide 元素
|
|
772
771
|
*/
|
|
773
772
|
async renderSlide(e) {
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
o && a.classList.add(`slide-transition-${o}`);
|
|
773
|
+
const n = document.createElement("div");
|
|
774
|
+
if (n.className = "swiper-slide", e.behavior?.transition) {
|
|
775
|
+
const i = this.mapTransition(e.behavior.transition.type);
|
|
776
|
+
i && n.classList.add(`slide-transition-${i}`);
|
|
779
777
|
}
|
|
780
778
|
if (e.content.type === "dynamic") {
|
|
781
|
-
const
|
|
782
|
-
|
|
779
|
+
const i = await this.renderDynamicContent(e.content.component, e.content.props);
|
|
780
|
+
n.appendChild(i);
|
|
783
781
|
} else {
|
|
784
|
-
const
|
|
785
|
-
|
|
782
|
+
const i = this.renderTextContent(e.content.lines);
|
|
783
|
+
n.appendChild(i);
|
|
786
784
|
}
|
|
787
|
-
return
|
|
785
|
+
return n;
|
|
788
786
|
}
|
|
789
787
|
/**
|
|
790
788
|
* 渲染动态内容(Web Component)
|
|
@@ -798,11 +796,11 @@ class ie {
|
|
|
798
796
|
* @param props - 组件属性
|
|
799
797
|
* @returns 组件元素
|
|
800
798
|
*/
|
|
801
|
-
async renderDynamicContent(e,
|
|
802
|
-
const
|
|
803
|
-
for (const [
|
|
804
|
-
typeof
|
|
805
|
-
return
|
|
799
|
+
async renderDynamicContent(e, n) {
|
|
800
|
+
const i = document.createElement(e);
|
|
801
|
+
for (const [l, a] of Object.entries(n))
|
|
802
|
+
typeof a == "string" || typeof a == "number" ? i.setAttribute(l, String(a)) : typeof a == "boolean" ? a && i.setAttribute(l, "") : i[l] = a;
|
|
803
|
+
return i;
|
|
806
804
|
}
|
|
807
805
|
/**
|
|
808
806
|
* 渲染文本内容
|
|
@@ -819,51 +817,51 @@ class ie {
|
|
|
819
817
|
* @returns 内容容器元素
|
|
820
818
|
*/
|
|
821
819
|
renderTextContent(e) {
|
|
822
|
-
const
|
|
823
|
-
|
|
824
|
-
let
|
|
825
|
-
for (const
|
|
826
|
-
const
|
|
827
|
-
if (!
|
|
828
|
-
|
|
820
|
+
const n = document.createElement("div");
|
|
821
|
+
n.className = "slide-content";
|
|
822
|
+
let i = null;
|
|
823
|
+
for (const l of e) {
|
|
824
|
+
const a = l.trim();
|
|
825
|
+
if (!a) {
|
|
826
|
+
i = null;
|
|
829
827
|
continue;
|
|
830
828
|
}
|
|
831
|
-
if (
|
|
832
|
-
|
|
833
|
-
const
|
|
834
|
-
|
|
829
|
+
if (a.startsWith("# ")) {
|
|
830
|
+
i = null;
|
|
831
|
+
const f = document.createElement("h1");
|
|
832
|
+
f.textContent = a.substring(2), n.appendChild(f);
|
|
835
833
|
continue;
|
|
836
834
|
}
|
|
837
|
-
if (
|
|
838
|
-
|
|
839
|
-
const
|
|
840
|
-
|
|
835
|
+
if (a.startsWith("## ")) {
|
|
836
|
+
i = null;
|
|
837
|
+
const f = document.createElement("h2");
|
|
838
|
+
f.textContent = a.substring(3), n.appendChild(f);
|
|
841
839
|
continue;
|
|
842
840
|
}
|
|
843
|
-
if (
|
|
844
|
-
|
|
845
|
-
const
|
|
846
|
-
|
|
841
|
+
if (a.startsWith("### ")) {
|
|
842
|
+
i = null;
|
|
843
|
+
const f = document.createElement("h3");
|
|
844
|
+
f.textContent = a.substring(4), n.appendChild(f);
|
|
847
845
|
continue;
|
|
848
846
|
}
|
|
849
|
-
const
|
|
850
|
-
if (
|
|
851
|
-
|
|
852
|
-
const
|
|
853
|
-
|
|
847
|
+
const m = a.match(/^!\[(.*?)\]\((.*?)\)$/);
|
|
848
|
+
if (m) {
|
|
849
|
+
i = null;
|
|
850
|
+
const f = document.createElement("img");
|
|
851
|
+
f.alt = m[1], f.src = m[2], f.style.maxWidth = "80%", f.style.maxHeight = "500px", n.appendChild(f);
|
|
854
852
|
continue;
|
|
855
853
|
}
|
|
856
|
-
if (
|
|
857
|
-
|
|
858
|
-
const
|
|
859
|
-
|
|
854
|
+
if (a.startsWith("- ")) {
|
|
855
|
+
i || (i = document.createElement("ul"), n.appendChild(i));
|
|
856
|
+
const f = document.createElement("li");
|
|
857
|
+
f.textContent = a.substring(2), i.appendChild(f);
|
|
860
858
|
continue;
|
|
861
859
|
}
|
|
862
|
-
|
|
863
|
-
const
|
|
864
|
-
|
|
860
|
+
i = null;
|
|
861
|
+
const w = document.createElement("p");
|
|
862
|
+
w.textContent = a, n.appendChild(w);
|
|
865
863
|
}
|
|
866
|
-
return
|
|
864
|
+
return n;
|
|
867
865
|
}
|
|
868
866
|
/**
|
|
869
867
|
* 映射 Slide DSL 过渡效果到 Swiper 过渡效果
|
|
@@ -880,29 +878,50 @@ class ie {
|
|
|
880
878
|
* @param event - 事件类型
|
|
881
879
|
* @param data - 事件数据
|
|
882
880
|
*/
|
|
883
|
-
emit(e,
|
|
884
|
-
const
|
|
885
|
-
if (
|
|
886
|
-
for (const
|
|
881
|
+
emit(e, n) {
|
|
882
|
+
const i = this.eventHandlers.get(e);
|
|
883
|
+
if (i)
|
|
884
|
+
for (const l of i)
|
|
887
885
|
try {
|
|
888
|
-
|
|
889
|
-
} catch (
|
|
890
|
-
console.error(`Error in ${e} handler:`,
|
|
886
|
+
l(n);
|
|
887
|
+
} catch (a) {
|
|
888
|
+
console.error(`Error in ${e} handler:`, a);
|
|
891
889
|
}
|
|
892
890
|
}
|
|
893
891
|
}
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
892
|
+
const ne = '@font-face{font-family:swiper-icons;src:url(data:application/font-woff;charset=utf-8;base64,\\ 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);font-weight:400;font-style:normal}:root{--swiper-theme-color: #007aff}:host{position:relative;display:block;margin-left:auto;margin-right:auto;z-index:1}.swiper{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1;display:block}.swiper-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:flex;transition-property:transform;transition-timing-function:var(--swiper-wrapper-transition-timing-function, initial);box-sizing:content-box}.swiper-android .swiper-slide,.swiper-ios .swiper-slide,.swiper-wrapper{transform:translateZ(0)}.swiper-horizontal{touch-action:pan-y}.swiper-vertical{touch-action:pan-x}.swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform;display:block}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{align-items:flex-start;transition-property:transform,height}.swiper-backface-hidden .swiper-slide{transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-3d.swiper-css-mode .swiper-wrapper{perspective:1200px}.swiper-3d .swiper-wrapper{transform-style:preserve-3d}.swiper-3d{perspective:1200px}.swiper-3d .swiper-slide,.swiper-3d .swiper-cube-shadow{transform-style:preserve-3d}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-css-mode.swiper-horizontal>.swiper-wrapper{scroll-snap-type:x mandatory}.swiper-css-mode.swiper-vertical>.swiper-wrapper{scroll-snap-type:y mandatory}.swiper-css-mode.swiper-free-mode>.swiper-wrapper{scroll-snap-type:none}.swiper-css-mode.swiper-free-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:none}.swiper-css-mode.swiper-centered>.swiper-wrapper:before{content:"";flex-shrink:0;order:9999}.swiper-css-mode.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center;scroll-snap-stop:always}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper:before{height:100%;min-height:1px;width:var(--swiper-centered-offset-after)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper:before{width:100%;min-width:1px;height:var(--swiper-centered-offset-after)}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow{background:#00000026}.swiper-3d .swiper-slide-shadow-left{background-image:linear-gradient(to left,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-right{background-image:linear-gradient(to right,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-top{background-image:linear-gradient(to top,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-bottom{background-image:linear-gradient(to bottom,#00000080,#0000)}.swiper-lazy-preloader{width:42px;height:42px;position:absolute;left:50%;top:50%;margin-left:-21px;margin-top:-21px;z-index:10;transform-origin:50%;box-sizing:border-box;border:4px solid var(--swiper-preloader-color, var(--swiper-theme-color));border-radius:50%;border-top-color:transparent}.swiper:not(.swiper-watch-progress) .swiper-lazy-preloader,.swiper-watch-progress .swiper-slide-visible .swiper-lazy-preloader{animation:swiper-preloader-spin 1s infinite linear}.swiper-lazy-preloader-white{--swiper-preloader-color: #fff}.swiper-lazy-preloader-black{--swiper-preloader-color: #000}@keyframes swiper-preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}', se = ".swiper{width:100%;height:100%;--slidejs-swiper-navigation-color: var(--slidejs-navigation-color, #007aff);--slidejs-swiper-pagination-color: var(--slidejs-pagination-color, #007aff);--slidejs-swiper-pagination-bullet-active-color: var(--slidejs-pagination-active-color, #007aff);--slidejs-swiper-scrollbar-bg: var(--slidejs-scrollbar-bg, rgba(0, 0, 0, .1));--slidejs-swiper-scrollbar-drag-bg: var(--slidejs-scrollbar-drag-bg, rgba(0, 0, 0, .5));--swiper-navigation-color: var(--slidejs-navigation-color, #007aff);--swiper-pagination-color: var(--slidejs-pagination-color, #007aff);--swiper-pagination-bullet-active-color: var(--slidejs-pagination-active-color, #007aff);--swiper-theme-color: var(--slidejs-navigation-color, #007aff)}.swiper .swiper-button-next,.swiper .swiper-button-prev{color:var(--swiper-navigation-color, var(--slidejs-swiper-navigation-color, #007aff))!important}.swiper .swiper-pagination-bullet{background-color:var( --swiper-pagination-color, var(--slidejs-swiper-pagination-color, #007aff) )!important}.swiper .swiper-pagination-bullet-active{background-color:var( --swiper-pagination-bullet-active-color, var(--slidejs-swiper-pagination-bullet-active-color, #007aff) )!important}.swiper .swiper-scrollbar{background:var(--slidejs-swiper-scrollbar-bg, rgba(0, 0, 0, .1))!important}.swiper .swiper-scrollbar-drag{background:var(--slidejs-swiper-scrollbar-drag-bg, rgba(0, 0, 0, .5))!important}.swiper-slide{display:flex;align-items:center;justify-content:center;width:100%;height:100%;background:var(--slidejs-background-color, #fff);padding:2rem;box-sizing:border-box}.slide-content{width:100%;text-align:center}.slide-content h1{font-size:3rem;margin-bottom:1rem;color:var(--slidejs-heading-color, #333)}.slide-content h2{font-size:2rem;margin-bottom:1rem;color:var(--slidejs-heading-color, #666)}.slide-content h3{font-size:1.5rem;margin-bottom:.5rem;color:var(--slidejs-heading-color, #666)}.slide-content p{font-size:1.2rem;line-height:1.6;color:var(--slidejs-text-color, #555);margin-bottom:1rem}.slide-content ul{text-align:left;display:inline-block;font-size:1.2rem;line-height:1.8;color:var(--slidejs-text-color, #555)}.slide-content li{margin-bottom:.5rem}.slide-content img{border-radius:8px;box-shadow:0 4px 12px #0000001a}.swiper-button-next:after,.swiper-button-prev:after{font-size:24px}.swiper-pagination-bullet{opacity:.5}.swiper-pagination-bullet-active{opacity:1}";
|
|
893
|
+
async function pe(s, e, n) {
|
|
894
|
+
const i = await U(s), l = V(i);
|
|
895
|
+
if (!document.head.querySelector("#swiper-styles")) {
|
|
896
|
+
const v = document.createElement("style");
|
|
897
|
+
v.id = "swiper-styles", v.textContent = ne, document.head.appendChild(v);
|
|
898
|
+
}
|
|
899
|
+
let m;
|
|
900
|
+
if (typeof n.container == "string") {
|
|
901
|
+
const v = document.querySelector(n.container);
|
|
902
|
+
if (!v)
|
|
903
|
+
throw new Error(`Container not found: ${n.container}`);
|
|
904
|
+
m = v;
|
|
905
|
+
} else
|
|
906
|
+
m = n.container;
|
|
907
|
+
const w = "slidejs-runner-swiper-styles";
|
|
908
|
+
if (!m.querySelector(`#${w}`)) {
|
|
909
|
+
const v = document.createElement("style");
|
|
910
|
+
v.id = w, v.textContent = se, m.appendChild(v);
|
|
911
|
+
}
|
|
912
|
+
const f = document.createElement("div");
|
|
913
|
+
m.appendChild(f);
|
|
914
|
+
const k = new re(), M = new K({
|
|
915
|
+
container: f,
|
|
916
|
+
adapter: k,
|
|
898
917
|
adapterOptions: {
|
|
899
|
-
swiperConfig:
|
|
918
|
+
swiperConfig: n.swiperOptions
|
|
900
919
|
}
|
|
901
920
|
});
|
|
902
|
-
return await
|
|
921
|
+
return await M.run(l, e), M;
|
|
903
922
|
}
|
|
904
923
|
export {
|
|
905
|
-
|
|
906
|
-
|
|
924
|
+
re as SwiperAdapter,
|
|
925
|
+
pe as createSlideRunner
|
|
907
926
|
};
|
|
908
927
|
//# sourceMappingURL=index.mjs.map
|