@seresweb/website-component 2.0.2 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/cjs/horizontal-viewer.cjs +1 -1
  2. package/dist/cjs/image-indicator.cjs +1 -1
  3. package/dist/cjs/index.cjs +1 -1
  4. package/dist/cjs/swiper-normal.cjs +1 -1
  5. package/dist/cjs/swiper-showcase.cjs +1 -0
  6. package/dist/cjs/swiper-vehicle.cjs +1 -1
  7. package/dist/css/horizontal-viewer.css +1 -1
  8. package/dist/css/swiper-showcase.css +1 -0
  9. package/dist/css/swiper-vehicle.css +1 -1
  10. package/dist/css/video.css +1 -1
  11. package/dist/es/horizontal-viewer.mjs +1 -1
  12. package/dist/es/image-indicator.mjs +1 -1
  13. package/dist/es/index.mjs +18 -16
  14. package/dist/es/swiper-normal.mjs +1 -1
  15. package/dist/es/swiper-showcase.mjs +263 -0
  16. package/dist/es/swiper-vehicle.mjs +158 -2
  17. package/dist/global.d.ts +1 -0
  18. package/dist/index-C_05OlSq.cjs +1 -0
  19. package/dist/index-DfK8Ib64.js +563 -0
  20. package/dist/index.css +1 -1
  21. package/dist/scss/horizontal-viewer.scss +16 -1
  22. package/dist/scss/index.scss +1 -0
  23. package/dist/scss/swiper-showcase.scss +128 -0
  24. package/dist/scss/swiper-vehicle.scss +2 -2
  25. package/dist/scss/video.scss +5 -0
  26. package/dist/{index-BrggpRcU.js → swiper-bundle-DTJcHqdp.js} +1109 -1266
  27. package/dist/swiper-bundle-l31DJOK1.cjs +5 -0
  28. package/dist/types/components/horizontal-viewer/pc-viewer.vue.d.ts +6 -1
  29. package/dist/types/components/horizontal-viewer/type.d.ts +2 -0
  30. package/dist/types/components/image-indicator/type.d.ts +1 -0
  31. package/dist/types/components/index.d.ts +1 -0
  32. package/dist/types/components/swiper-showcase/index.d.ts +6 -0
  33. package/dist/types/components/swiper-showcase/swiper-showcase.vue.d.ts +10 -0
  34. package/dist/types/components/swiper-showcase/type.d.ts +33 -0
  35. package/package.json +1 -1
  36. package/dist/index-CM1T0AYM.js +0 -536
  37. package/dist/index-DL7IXrBi.cjs +0 -1
  38. package/dist/index-DrnEpWXW.cjs +0 -5
@@ -0,0 +1,563 @@
1
+ import { defineComponent as P, ref as y, reactive as te, watch as Z, onMounted as j, onBeforeUnmount as q, createElementBlock as s, openBlock as o, normalizeStyle as E, normalizeClass as l, unref as t, createElementVNode as w, createCommentVNode as I, Fragment as R, renderList as N, createBlock as S, createVNode as G, mergeProps as W, normalizeProps as Y, computed as C, createStaticVNode as oe } from "vue";
2
+ import { S as ne } from "./swiper-bundle-DTJcHqdp.js";
3
+ import { P as i } from "./_vars-BV4QQF-p.js";
4
+ import "./es/accordion-info-panel.mjs";
5
+ import "./es/animated-number.mjs";
6
+ import "./es/drawer.mjs";
7
+ import "./es/dropdown.mjs";
8
+ import "./es/gradual-highlight.mjs";
9
+ import { getRootOffset as re } from "@vavt/util";
10
+ import "./es/input.mjs";
11
+ import { ScLayzImage as A } from "./es/layz-image.mjs";
12
+ import "./es/parameter-box.mjs";
13
+ import "./es/radio.mjs";
14
+ import "./es/swiper-showcase.mjs";
15
+ import "./es/swiper-vehicle.mjs";
16
+ import { ScTabIndicator as ie } from "./es/tab-indicator.mjs";
17
+ import { ScVideo as J } from "./es/video.mjs";
18
+ const ae = ["innerHTML"], le = ["innerHTML"], se = ["innerHTML"], ce = ["innerHTML"], de = /* @__PURE__ */ P({
19
+ __name: "pc-viewer",
20
+ props: {
21
+ title: {},
22
+ desc: {},
23
+ dataList: {},
24
+ extraTopSpacing: { default: 0 },
25
+ extraBottomSpacing: { default: 0 }
26
+ },
27
+ setup(c) {
28
+ const v = c, a = y(), _ = y(), n = y(), f = y(), g = y(), d = y(), L = te({
29
+ container: "",
30
+ root: "",
31
+ item: ""
32
+ }), m = (r) => typeof r != "number" || Number.isNaN(r) ? 0 : r, b = (r, u, p) => {
33
+ const T = Math.min(Math.max(r, 0), p), M = Math.min(Math.max(u, 0), Math.max(p - T, 0));
34
+ return { safeTop: T, safeBottom: M };
35
+ }, k = () => {
36
+ var X;
37
+ if (!n.value)
38
+ return;
39
+ const r = n.value.offsetHeight, u = window.innerHeight, p = ((X = d.value) == null ? void 0 : X.offsetHeight) || 0, T = h(d.value), M = m(v.extraTopSpacing), x = m(v.extraBottomSpacing), { safeTop: H, safeBottom: z } = b(M, x, u), O = Math.max(u - H - z, 0), V = Math.max((O - p - r - T) / 2, 0), K = H + V, Q = z + V;
40
+ L.container = `padding-top: ${K}px; padding-bottom: ${Q}px; min-height: ${u}px;`;
41
+ const ee = n.value.scrollWidth;
42
+ L.root = `height: ${Math.max(ee, u)}px`;
43
+ }, e = () => {
44
+ const r = document.documentElement.getAttribute("dir") || "ltr", u = r === "rtl" ? "right" : "left";
45
+ if (!a.value || !n.value || !f.value || !g.value) return;
46
+ const T = a.value.clientHeight - window.innerHeight, { offsetTop: M } = re(a.value), x = document.documentElement.scrollTop - M;
47
+ if (x < 0) {
48
+ n.value.scrollTo({ left: 0 }), g.value.style[u] = "0px";
49
+ return;
50
+ }
51
+ if (x > T) {
52
+ const V = n.value.scrollWidth - window.innerWidth;
53
+ n.value.scrollTo({ left: r === "rtl" ? -V : V }), g.value.style[u] = f.value.clientWidth - g.value.clientWidth + "px";
54
+ return;
55
+ }
56
+ const H = x / T, z = H * (n.value.scrollWidth - window.innerWidth), O = H * (f.value.clientWidth * 2 / 3);
57
+ n.value.scrollTo({ left: r === "rtl" ? -z : z }), g.value.style[u] = `${O}px`;
58
+ }, $ = () => {
59
+ L.container = "", k();
60
+ }, h = (r) => {
61
+ if (!(r instanceof HTMLElement))
62
+ return 0;
63
+ const u = window.getComputedStyle(r), p = parseFloat(u.marginTop) || 0, T = parseFloat(u.marginBottom) || 0;
64
+ return p + T;
65
+ };
66
+ let B;
67
+ return Z(
68
+ () => [v.extraTopSpacing, v.extraBottomSpacing],
69
+ () => {
70
+ L.container = "", k();
71
+ }
72
+ ), j(() => {
73
+ B = new IntersectionObserver(
74
+ (r) => {
75
+ r.forEach((u) => {
76
+ u.isIntersecting && (L.container = "", k());
77
+ });
78
+ },
79
+ {
80
+ root: null,
81
+ // 相对于 viewport
82
+ rootMargin: "200px 0px 200px 0px",
83
+ // 提前100px触发
84
+ threshold: 0
85
+ }
86
+ ), window.addEventListener("scroll", e), window.addEventListener("resize", $), a.value && B.observe(a.value);
87
+ }), q(() => {
88
+ window.removeEventListener("scroll", e), window.removeEventListener("resize", $), B && B.disconnect();
89
+ }), (r, u) => (o(), s(
90
+ "div",
91
+ {
92
+ ref_key: "rootRef",
93
+ ref: a,
94
+ class: l(`${t(i)}-horizontal-viewer`),
95
+ style: E(L.root)
96
+ },
97
+ [
98
+ w(
99
+ "div",
100
+ {
101
+ ref_key: "containerRef",
102
+ ref: _,
103
+ class: l([`${t(i)}-horizontal-viewer__container`, (r.title || r.desc) && "has-header"]),
104
+ style: E(L.container)
105
+ },
106
+ [
107
+ r.title || r.desc ? (o(), s(
108
+ "div",
109
+ {
110
+ key: 0,
111
+ class: l(`${t(i)}-horizontal-viewer__header`),
112
+ ref_key: "headerRef",
113
+ ref: d
114
+ },
115
+ [
116
+ r.title ? (o(), s("p", {
117
+ key: 0,
118
+ innerHTML: r.title
119
+ }, null, 8, ae)) : I("v-if", !0),
120
+ r.desc ? (o(), s("p", {
121
+ key: 1,
122
+ innerHTML: r.desc
123
+ }, null, 8, le)) : I("v-if", !0)
124
+ ],
125
+ 2
126
+ /* CLASS */
127
+ )) : I("v-if", !0),
128
+ w(
129
+ "div",
130
+ {
131
+ ref_key: "scrollerRef",
132
+ ref: n,
133
+ class: l(`${t(i)}-horizontal-viewer__scroller`)
134
+ },
135
+ [
136
+ w(
137
+ "div",
138
+ {
139
+ class: l(`${t(i)}-horizontal-viewer__content`)
140
+ },
141
+ [
142
+ (o(!0), s(
143
+ R,
144
+ null,
145
+ N(r.dataList, (p) => (o(), s(
146
+ "div",
147
+ {
148
+ key: p.title,
149
+ class: l(`${t(i)}-horizontal-viewer__content-item`)
150
+ },
151
+ [
152
+ p.type === "img" ? (o(), S(t(A), {
153
+ key: 0,
154
+ src: p.url,
155
+ alt: p.alt
156
+ }, null, 8, ["src", "alt"])) : (o(), S(t(J), {
157
+ key: 1,
158
+ url: p.url,
159
+ poster: p.poster,
160
+ "auto-play": !1
161
+ }, null, 8, ["url", "poster"])),
162
+ w(
163
+ "div",
164
+ {
165
+ class: l(`${t(i)}-horizontal-viewer__content-item-footer`)
166
+ },
167
+ [
168
+ w("p", {
169
+ innerHTML: p.title
170
+ }, null, 8, se),
171
+ w("p", {
172
+ innerHTML: p.desc
173
+ }, null, 8, ce)
174
+ ],
175
+ 2
176
+ /* CLASS */
177
+ )
178
+ ],
179
+ 2
180
+ /* CLASS */
181
+ ))),
182
+ 128
183
+ /* KEYED_FRAGMENT */
184
+ ))
185
+ ],
186
+ 2
187
+ /* CLASS */
188
+ )
189
+ ],
190
+ 2
191
+ /* CLASS */
192
+ ),
193
+ w(
194
+ "div",
195
+ {
196
+ ref_key: "paginationRef",
197
+ ref: f,
198
+ class: l(`${t(i)}-horizontal-viewer__pagination`)
199
+ },
200
+ [
201
+ w(
202
+ "div",
203
+ {
204
+ class: l(`${t(i)}-horizontal-viewer__scrollbar`)
205
+ },
206
+ [
207
+ w(
208
+ "div",
209
+ {
210
+ ref_key: "scrollbarDragRef",
211
+ ref: g,
212
+ class: l(`${t(i)}-horizontal-viewer__scrollbar-drag`)
213
+ },
214
+ null,
215
+ 2
216
+ /* CLASS */
217
+ )
218
+ ],
219
+ 2
220
+ /* CLASS */
221
+ )
222
+ ],
223
+ 2
224
+ /* CLASS */
225
+ )
226
+ ],
227
+ 6
228
+ /* CLASS, STYLE */
229
+ )
230
+ ],
231
+ 6
232
+ /* CLASS, STYLE */
233
+ ));
234
+ }
235
+ }), ue = /* @__PURE__ */ P({
236
+ __name: "mb-viewer",
237
+ props: {
238
+ title: {},
239
+ desc: {},
240
+ isMobile: { type: Boolean },
241
+ extraTopSpacing: {},
242
+ extraBottomSpacing: {},
243
+ modelValue: {},
244
+ dataList: {},
245
+ swiperOptions: {},
246
+ effect: {},
247
+ showIntro: { type: Boolean },
248
+ videoProps: {},
249
+ indicatorClass: {},
250
+ tabIndicatorBottom: {},
251
+ widthType: {},
252
+ indicatorType: {},
253
+ showIndicator: { type: Boolean },
254
+ indicatorPosition: {}
255
+ },
256
+ setup(c) {
257
+ const v = c, a = y();
258
+ return (_, n) => (o(), s(
259
+ "div",
260
+ {
261
+ ref_key: "rootRef",
262
+ ref: a,
263
+ class: l(`${t(i)}-horizontal-viewer-mb`)
264
+ },
265
+ [
266
+ G(
267
+ t(ge),
268
+ W(v, { indicatorType: "image" }),
269
+ null,
270
+ 16
271
+ /* FULL_PROPS */
272
+ )
273
+ ],
274
+ 2
275
+ /* CLASS */
276
+ ));
277
+ }
278
+ }), F = /* @__PURE__ */ P({
279
+ __name: "horizontal-viewer",
280
+ props: {
281
+ title: {},
282
+ desc: {},
283
+ isMobile: { type: Boolean },
284
+ extraTopSpacing: {},
285
+ extraBottomSpacing: {},
286
+ modelValue: {},
287
+ dataList: {},
288
+ swiperOptions: {},
289
+ effect: {},
290
+ showIntro: { type: Boolean },
291
+ videoProps: {},
292
+ indicatorClass: {},
293
+ tabIndicatorBottom: {},
294
+ widthType: {},
295
+ indicatorType: {},
296
+ showIndicator: { type: Boolean, default: !0 },
297
+ indicatorPosition: {}
298
+ },
299
+ setup(c) {
300
+ const v = c;
301
+ return (a, _) => a.isMobile ? (o(), S(
302
+ ue,
303
+ Y(W({ key: 0 }, v)),
304
+ null,
305
+ 16
306
+ /* FULL_PROPS */
307
+ )) : (o(), S(
308
+ de,
309
+ Y(W({ key: 1 }, v)),
310
+ null,
311
+ 16
312
+ /* FULL_PROPS */
313
+ ));
314
+ }
315
+ });
316
+ F.install = (c) => (c.component("ScHorizontalViewer", F), c);
317
+ const Pe = F, pe = ["onClick"], fe = ["innerHTML"], me = ["innerHTML"], D = /* @__PURE__ */ P({
318
+ __name: "image-indicator",
319
+ props: {
320
+ dataList: {},
321
+ showIntro: { type: Boolean, default: !0 }
322
+ },
323
+ emits: ["change"],
324
+ setup(c, { emit: v }) {
325
+ const a = v, _ = y(0), n = y([]), f = C(() => {
326
+ const d = n.value[_.value];
327
+ return {
328
+ height: `${d == null ? void 0 : d.offsetHeight}px`
329
+ };
330
+ }), g = (d) => {
331
+ _.value = d, a("change", d);
332
+ };
333
+ return (d, L) => (o(), s(
334
+ "div",
335
+ {
336
+ class: l(`${t(i)}-image-indicator`)
337
+ },
338
+ [
339
+ w(
340
+ "div",
341
+ {
342
+ class: l(`${t(i)}-image-indicator__list`)
343
+ },
344
+ [
345
+ (o(!0), s(
346
+ R,
347
+ null,
348
+ N(d.dataList, (m, b) => (o(), s("div", {
349
+ key: m.url,
350
+ class: l([
351
+ `${t(i)}-image-indicator__list-item`,
352
+ _.value === b ? `${t(i)}-image-indicator__active` : ""
353
+ ]),
354
+ onClick: (k) => g(b)
355
+ }, [
356
+ G(t(A), {
357
+ src: m.url,
358
+ alt: m.alt
359
+ }, null, 8, ["src", "alt"])
360
+ ], 10, pe))),
361
+ 128
362
+ /* KEYED_FRAGMENT */
363
+ ))
364
+ ],
365
+ 2
366
+ /* CLASS */
367
+ ),
368
+ d.showIntro ? (o(), s(
369
+ "div",
370
+ {
371
+ key: 0,
372
+ class: l(`${t(i)}-image-indicator__intro`),
373
+ style: E(f.value)
374
+ },
375
+ [
376
+ (o(!0), s(
377
+ R,
378
+ null,
379
+ N(d.dataList, (m, b) => (o(), s(
380
+ "div",
381
+ {
382
+ key: m.url,
383
+ ref_for: !0,
384
+ ref_key: "introItemRef",
385
+ ref: n,
386
+ class: l([`${t(i)}-image-indicator__intro-item`, _.value === b && `${t(i)}-image-indicator__active`])
387
+ },
388
+ [
389
+ m.title ? (o(), s("p", {
390
+ key: 0,
391
+ class: l(`${t(i)}-image-indicator__intro-title`),
392
+ innerHTML: m.title
393
+ }, null, 10, fe)) : I("v-if", !0),
394
+ m.desc ? (o(), s("p", {
395
+ key: 1,
396
+ class: l(`${t(i)}-image-indicator__intro-desc`),
397
+ innerHTML: m.desc
398
+ }, null, 10, me)) : I("v-if", !0)
399
+ ],
400
+ 2
401
+ /* CLASS */
402
+ ))),
403
+ 128
404
+ /* KEYED_FRAGMENT */
405
+ ))
406
+ ],
407
+ 6
408
+ /* CLASS, STYLE */
409
+ )) : I("v-if", !0)
410
+ ],
411
+ 2
412
+ /* CLASS */
413
+ ));
414
+ }
415
+ });
416
+ D.install = (c) => (c.component("ScImageIndicator", D), c);
417
+ const ve = D, he = { class: "swiper-wrapper" }, U = /* @__PURE__ */ P({
418
+ __name: "swiper-normal",
419
+ props: {
420
+ modelValue: { default: 0 },
421
+ dataList: {},
422
+ swiperOptions: { default: () => ({}) },
423
+ effect: {},
424
+ showIntro: { type: Boolean, default: !0 },
425
+ videoProps: {},
426
+ indicatorClass: {},
427
+ tabIndicatorBottom: {},
428
+ widthType: { default: "full" },
429
+ indicatorType: { default: "tab" },
430
+ showIndicator: { type: Boolean, default: !0 },
431
+ indicatorPosition: { default: "relative" }
432
+ },
433
+ emits: ["change", "update:modelValue"],
434
+ setup(c, { emit: v }) {
435
+ const a = c, _ = v;
436
+ let n = null;
437
+ const f = y(a.modelValue), g = y(), d = C(() => {
438
+ const e = [`${i}-swiper-main`];
439
+ return a.widthType === "middle" ? e.push(`${i}-swiper-main__middle`) : e.push(`${i}-swiper-main__full`), e;
440
+ }), L = C(() => {
441
+ const e = {};
442
+ return a.tabIndicatorBottom && (e.position = "absolute", e.zIndex = 1, e.bottom = typeof a.tabIndicatorBottom == "number" ? `${a.tabIndicatorBottom}px` : a.tabIndicatorBottom), e;
443
+ });
444
+ Z(
445
+ () => a.modelValue,
446
+ () => {
447
+ f.value = a.modelValue, b(f.value);
448
+ }
449
+ );
450
+ const m = C(() => a.dataList.map((e) => ({
451
+ ...e,
452
+ url: e.type === "img" ? e.url || "" : e.poster || ""
453
+ }))), b = (e) => {
454
+ n == null || n.slideTo(e);
455
+ }, k = () => {
456
+ n == null || n.destroy(), g.value && (n = new ne(g.value, {
457
+ slidesPerView: 1,
458
+ allowTouchMove: !1,
459
+ effect: a.effect,
460
+ navigation: {
461
+ nextEl: ".swiper-button-next",
462
+ prevEl: ".swiper-button-prev"
463
+ },
464
+ ...a.swiperOptions
465
+ }), n.on("slideChange", (e) => {
466
+ f.value = e.activeIndex, _("change", e.activeIndex), _("update:modelValue", e.activeIndex);
467
+ }));
468
+ };
469
+ return j(() => {
470
+ k(), window.addEventListener("resize", k);
471
+ }), q(() => {
472
+ n == null || n.destroy(), window.removeEventListener("resize", k);
473
+ }), (e, $) => (o(), s(
474
+ "div",
475
+ {
476
+ class: l(`${t(i)}-swiper`)
477
+ },
478
+ [
479
+ w(
480
+ "div",
481
+ {
482
+ ref_key: "swiperRef",
483
+ ref: g,
484
+ class: l(d.value)
485
+ },
486
+ [
487
+ w("div", he, [
488
+ (o(!0), s(
489
+ R,
490
+ null,
491
+ N(e.dataList, (h, B) => (o(), s("div", {
492
+ key: h.title,
493
+ class: "swiper-slide"
494
+ }, [
495
+ h.type === "img" ? (o(), S(t(A), {
496
+ key: 0,
497
+ src: h.url,
498
+ alt: h.alt
499
+ }, null, 8, ["src", "alt"])) : (o(), S(t(J), W({
500
+ key: 1,
501
+ ref_for: !0
502
+ }, e.videoProps, {
503
+ url: h.url,
504
+ poster: h.poster,
505
+ playable: f.value === B
506
+ }), null, 16, ["url", "poster", "playable"])),
507
+ h.mask ? (o(), s(
508
+ "div",
509
+ {
510
+ key: 2,
511
+ class: l(`${t(i)}-swiper-mask`)
512
+ },
513
+ null,
514
+ 2
515
+ /* CLASS */
516
+ )) : I("v-if", !0)
517
+ ]))),
518
+ 128
519
+ /* KEYED_FRAGMENT */
520
+ ))
521
+ ]),
522
+ $[2] || ($[2] = oe('<div class="swiper-button-next"><svg xmlns="http://www.w3.org/2000/svg" width="25" height="24" viewBox="0 0 25 24" fill="none"><path d="M9.64299 3.12871L9.51887 5.83301L15.6859 12L9.51887 18.167L9.64299 20.8713L18.5143 12L9.64299 3.12871Z" fill="white"></path></svg></div><div class="swiper-button-prev"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M15.1289 3.12871L15.2531 5.83301L9.08609 12L15.2531 18.167L15.1289 20.8713L6.25766 12L15.1289 3.12871Z" fill="white"></path></svg></div>', 2))
523
+ ],
524
+ 2
525
+ /* CLASS */
526
+ ),
527
+ e.showIndicator ? (o(), s(
528
+ R,
529
+ { key: 0 },
530
+ [
531
+ e.indicatorType === "tab" ? (o(), S(t(ie), {
532
+ key: 0,
533
+ modelValue: f.value,
534
+ "onUpdate:modelValue": $[0] || ($[0] = (h) => f.value = h),
535
+ class: l([e.indicatorClass, e.indicatorPosition === "absolute" && `${t(i)}-swiper-indicator-absolute`]),
536
+ dataList: e.dataList,
537
+ "show-intro": e.showIntro,
538
+ style: E(L.value),
539
+ onChange: b
540
+ }, null, 8, ["modelValue", "class", "dataList", "show-intro", "style"])) : (o(), S(t(ve), {
541
+ key: 1,
542
+ modelValue: f.value,
543
+ "onUpdate:modelValue": $[1] || ($[1] = (h) => f.value = h),
544
+ dataList: m.value,
545
+ onChange: b
546
+ }, null, 8, ["modelValue", "dataList"]))
547
+ ],
548
+ 64
549
+ /* STABLE_FRAGMENT */
550
+ )) : I("v-if", !0)
551
+ ],
552
+ 2
553
+ /* CLASS */
554
+ ));
555
+ }
556
+ });
557
+ U.install = (c) => (c.component("ScSwiperNormal", U), c);
558
+ const ge = U;
559
+ export {
560
+ Pe as S,
561
+ ve as a,
562
+ ge as b
563
+ };