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