@seresweb/website-component 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/horizontal-viewer.cjs +1 -1
- package/dist/cjs/image-indicator.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/{Input.cjs → input.cjs} +1 -1
- package/dist/cjs/swiper-normal.cjs +1 -1
- package/dist/cjs/video.cjs +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 +17 -17
- package/dist/es/{Input.mjs → input.mjs} +1 -1
- package/dist/es/swiper-normal.mjs +1 -1
- package/dist/es/video.mjs +221 -194
- package/dist/global.d.ts +1 -1
- package/dist/{index-BgNMAlW8.js → index-CM1T0AYM.js} +1 -1
- package/dist/index-DL7IXrBi.cjs +1 -0
- package/dist/index.css +1 -1
- package/dist/scss/video.scss +6 -0
- package/dist/types/components/drawer/drawer.vue.d.ts +1 -1
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/components/{Input → input}/index.d.ts +1 -1
- package/dist/types/components/video/type.d.ts +10 -1
- package/dist/types/components/video/video-wrapper.vue.d.ts +6 -6
- package/dist/types/components/video/video.vue.d.ts +186 -34
- package/package.json +1 -1
- package/dist/index-LswhGmG3.cjs +0 -1
- /package/dist/types/components/{Input/Input.vue.d.ts → input/input.vue.d.ts} +0 -0
- /package/dist/types/components/{Input → input}/type.d.ts +0 -0
package/dist/es/video.mjs
CHANGED
|
@@ -1,246 +1,273 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { P as
|
|
3
|
-
import { ScLayzImage as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as L, ref as d, watch as A, nextTick as E, onMounted as O, onBeforeUnmount as M, createElementBlock as h, openBlock as r, normalizeClass as f, createElementVNode as y, createCommentVNode as _, renderSlot as V, onUnmounted as U, Fragment as S, createBlock as $, mergeProps as T, normalizeStyle as H, unref as N, toDisplayString as X, Teleport as F, createVNode as Y } from "vue";
|
|
2
|
+
import { P as u } from "../_vars-BV4QQF-p.js";
|
|
3
|
+
import { ScLayzImage as j } from "./layz-image.mjs";
|
|
4
|
+
const D = ["controls", "poster", "src"], z = /* @__PURE__ */ L({
|
|
5
5
|
__name: "video-wrapper",
|
|
6
6
|
props: {
|
|
7
|
-
class: {
|
|
8
|
-
style: {
|
|
9
|
-
playerButtonClass: {
|
|
7
|
+
class: {},
|
|
8
|
+
style: {},
|
|
9
|
+
playerButtonClass: {},
|
|
10
10
|
playerButtonText: { default: "PLAY" },
|
|
11
|
-
poster: {
|
|
12
|
-
url: {
|
|
11
|
+
poster: {},
|
|
12
|
+
url: {},
|
|
13
13
|
autoPlay: { type: Boolean, default: !0 },
|
|
14
|
-
playable: { type: Boolean, default: !0 }
|
|
14
|
+
playable: { type: Boolean, default: !0 },
|
|
15
|
+
multiple: { type: Boolean },
|
|
16
|
+
urlSmall: {}
|
|
15
17
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
emits: ["paused"],
|
|
19
|
+
setup(m, { expose: e, emit: C }) {
|
|
20
|
+
const l = m, k = C, g = /xiaomi|miui/i, x = `${u}-player-wrapper`, w = `${u}-player-is-fullscreen`, B = `${u}-player-close-btn`, b = `${u}-player-icon`, t = d(), s = d(!0), p = d(g.test(navigator.userAgent) ? void 0 : l.url);
|
|
21
|
+
let n = null;
|
|
22
|
+
const o = (a) => {
|
|
23
|
+
var c, i;
|
|
24
|
+
a.target !== t.value && ((c = t.value) == null || c.pause(), s.value = !!((i = t.value) != null && i.paused), k("paused"));
|
|
25
|
+
}, v = (a) => {
|
|
26
|
+
const c = a[0], i = t.value;
|
|
27
|
+
!i || !l.playable || (c.isIntersecting && l.autoPlay && i.paused ? (i.play().catch(console.warn), s.value = !1) : !c.isIntersecting && !i.paused && (i.pause(), s.value = !0));
|
|
28
|
+
}, P = () => {
|
|
29
|
+
l.autoPlay && l.playable && t.value && (n = new IntersectionObserver(v, {
|
|
27
30
|
threshold: 0.25
|
|
28
31
|
// 可根据需求调整可见区域百分比
|
|
29
|
-
}),
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
+
}), n.observe(t.value));
|
|
33
|
+
}, I = () => {
|
|
34
|
+
n == null || n.disconnect(), n = null;
|
|
32
35
|
};
|
|
33
|
-
return
|
|
34
|
-
() =>
|
|
36
|
+
return A(
|
|
37
|
+
() => l.playable,
|
|
35
38
|
() => {
|
|
36
|
-
|
|
39
|
+
I(), E(() => P());
|
|
37
40
|
}
|
|
38
|
-
),
|
|
41
|
+
), e({
|
|
39
42
|
play() {
|
|
40
|
-
|
|
43
|
+
t.value.play(), s.value = t.value.paused;
|
|
44
|
+
},
|
|
45
|
+
pause() {
|
|
46
|
+
t.value.pause(), s.value = t.value.paused;
|
|
41
47
|
}
|
|
42
|
-
}),
|
|
43
|
-
|
|
44
|
-
if (!
|
|
45
|
-
throw new Error(`HTTP error! status: ${
|
|
46
|
-
return
|
|
47
|
-
}).then((
|
|
48
|
-
|
|
49
|
-
}).catch((
|
|
50
|
-
console.error("获取视频失败:",
|
|
51
|
-
}),
|
|
52
|
-
}),
|
|
53
|
-
|
|
54
|
-
}), (
|
|
48
|
+
}), O(() => {
|
|
49
|
+
g.test(navigator.userAgent) && fetch(l.url).then((a) => {
|
|
50
|
+
if (!a.ok)
|
|
51
|
+
throw new Error(`HTTP error! status: ${a.status}`);
|
|
52
|
+
return a.blob();
|
|
53
|
+
}).then((a) => {
|
|
54
|
+
p.value = URL.createObjectURL(a);
|
|
55
|
+
}).catch((a) => {
|
|
56
|
+
console.error("获取视频失败:", a);
|
|
57
|
+
}), P();
|
|
58
|
+
}), M(() => {
|
|
59
|
+
I();
|
|
60
|
+
}), (a, c) => (r(), h(
|
|
55
61
|
"div",
|
|
56
62
|
{
|
|
57
|
-
class:
|
|
63
|
+
class: f([x, l.class, !s.value && !l.autoPlay && w])
|
|
58
64
|
},
|
|
59
65
|
[
|
|
60
|
-
|
|
66
|
+
y("video", {
|
|
61
67
|
ref_key: "videoRef",
|
|
62
|
-
ref:
|
|
68
|
+
ref: t,
|
|
63
69
|
muted: "",
|
|
64
70
|
loop: "",
|
|
65
71
|
playsinline: "",
|
|
66
72
|
"webkit-playsinline": "",
|
|
67
73
|
"x5-video-player-type": "h5",
|
|
68
|
-
controls: !s.value && !
|
|
69
|
-
poster:
|
|
70
|
-
src:
|
|
71
|
-
}, null, 8,
|
|
72
|
-
!s.value && !
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
74
|
+
controls: !s.value && !l.autoPlay,
|
|
75
|
+
poster: l.poster,
|
|
76
|
+
src: p.value
|
|
77
|
+
}, null, 8, D),
|
|
78
|
+
!s.value && !l.autoPlay ? (r(), h(
|
|
79
|
+
"button",
|
|
80
|
+
{
|
|
81
|
+
key: 0,
|
|
82
|
+
class: f([B, l.playerButtonClass]),
|
|
83
|
+
onClick: o
|
|
84
|
+
},
|
|
85
|
+
[
|
|
86
|
+
V(a.$slots, "close", {}, () => [
|
|
87
|
+
(r(), h("svg", {
|
|
88
|
+
class: f(b),
|
|
89
|
+
viewBox: "0 0 1121 1024",
|
|
90
|
+
version: "1.1",
|
|
91
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
92
|
+
width: "200",
|
|
93
|
+
height: "200"
|
|
94
|
+
}, [...c[0] || (c[0] = [
|
|
95
|
+
y(
|
|
96
|
+
"path",
|
|
97
|
+
{
|
|
98
|
+
d: "M1040.725333 49.005714l-965.485714 965.436953-48.420571-48.469334L992.256 0.487619l48.469333 48.518095z",
|
|
99
|
+
fill: "#ffffff"
|
|
100
|
+
},
|
|
101
|
+
null,
|
|
102
|
+
-1
|
|
103
|
+
/* CACHED */
|
|
104
|
+
),
|
|
105
|
+
y(
|
|
106
|
+
"path",
|
|
107
|
+
{
|
|
108
|
+
d: "M1040.725333 1014.442667l-965.485714-965.485715 48.518095-48.420571L1089.194667 965.973333l-48.469334 48.469334z",
|
|
109
|
+
fill: "#ffffff"
|
|
110
|
+
},
|
|
111
|
+
null,
|
|
112
|
+
-1
|
|
113
|
+
/* CACHED */
|
|
114
|
+
)
|
|
115
|
+
])]))
|
|
116
|
+
])
|
|
117
|
+
],
|
|
118
|
+
2
|
|
119
|
+
/* CLASS */
|
|
120
|
+
)) : _("v-if", !0)
|
|
109
121
|
],
|
|
110
122
|
2
|
|
111
123
|
/* CLASS */
|
|
112
124
|
));
|
|
113
125
|
}
|
|
114
|
-
}),
|
|
126
|
+
}), R = /* @__PURE__ */ L({
|
|
115
127
|
__name: "video",
|
|
116
128
|
props: {
|
|
117
|
-
class: {
|
|
118
|
-
style: {
|
|
119
|
-
playerButtonClass: {
|
|
129
|
+
class: {},
|
|
130
|
+
style: {},
|
|
131
|
+
playerButtonClass: {},
|
|
120
132
|
playerButtonText: { default: "PLAY" },
|
|
121
133
|
poster: { default: "" },
|
|
122
|
-
url: {
|
|
134
|
+
url: {},
|
|
123
135
|
autoPlay: { type: Boolean, default: !0 },
|
|
124
|
-
playable: { type: Boolean, default: !0 }
|
|
136
|
+
playable: { type: Boolean, default: !0 },
|
|
137
|
+
multiple: { type: Boolean },
|
|
138
|
+
urlSmall: {}
|
|
125
139
|
},
|
|
126
|
-
setup(
|
|
127
|
-
const
|
|
128
|
-
var
|
|
129
|
-
|
|
140
|
+
setup(m) {
|
|
141
|
+
const e = m, C = `${u}-player-wrapper`, l = `${u}-player-poster`, k = `${u}-player-btn`, g = `${u}-player-btn-text`, x = `${u}-player-icon`, w = d(), B = d(), b = d(), t = (o) => {
|
|
142
|
+
var v, P;
|
|
143
|
+
o.stopPropagation(), (v = b.value) == null || v.pause(), (P = B.value) == null || P.play();
|
|
144
|
+
}, s = () => {
|
|
145
|
+
var o;
|
|
146
|
+
(o = b.value) == null || o.play();
|
|
130
147
|
};
|
|
131
|
-
let
|
|
132
|
-
const
|
|
133
|
-
return
|
|
134
|
-
|
|
135
|
-
([
|
|
136
|
-
|
|
148
|
+
let p = null;
|
|
149
|
+
const n = d(!1);
|
|
150
|
+
return O(() => {
|
|
151
|
+
p = new IntersectionObserver(
|
|
152
|
+
([o]) => {
|
|
153
|
+
o.isIntersecting && (n.value = !0);
|
|
137
154
|
},
|
|
138
155
|
{ threshold: 0.1 }
|
|
139
|
-
), w.value &&
|
|
140
|
-
}),
|
|
141
|
-
|
|
142
|
-
}), (
|
|
143
|
-
|
|
144
|
-
S($({ key: 0 }, a)),
|
|
156
|
+
), w.value && p.observe(w.value);
|
|
157
|
+
}), U(() => {
|
|
158
|
+
p == null || p.disconnect();
|
|
159
|
+
}), (o, v) => (r(), h(
|
|
160
|
+
S,
|
|
145
161
|
null,
|
|
146
|
-
16
|
|
147
|
-
/* FULL_PROPS */
|
|
148
|
-
)) : (y(), h(
|
|
149
|
-
U,
|
|
150
|
-
{ key: 1 },
|
|
151
162
|
[
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
163
|
+
e.autoPlay || e.multiple ? (r(), $(z, T({ key: 0 }, e, {
|
|
164
|
+
url: e.multiple && e.urlSmall || e.url,
|
|
165
|
+
ref_key: "autoPlayRef",
|
|
166
|
+
ref: b
|
|
167
|
+
}), null, 16, ["url"])) : _("v-if", !0),
|
|
168
|
+
!e.autoPlay || e.multiple ? (r(), h(
|
|
169
|
+
S,
|
|
170
|
+
{ key: 1 },
|
|
158
171
|
[
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
src: a.poster,
|
|
162
|
-
alt: "AITO"
|
|
163
|
-
}, null, 8, ["src"]),
|
|
164
|
-
i(
|
|
165
|
-
"button",
|
|
172
|
+
y(
|
|
173
|
+
"div",
|
|
166
174
|
{
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
class: p([g, a.playerButtonClass]),
|
|
170
|
-
onClick: s
|
|
175
|
+
class: f([C, e.class, { "is-multiple": e.multiple }]),
|
|
176
|
+
style: H(e.style)
|
|
171
177
|
},
|
|
172
178
|
[
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
179
|
+
e.poster ? (r(), $(N(j), {
|
|
180
|
+
key: 0,
|
|
181
|
+
class: f(l),
|
|
182
|
+
src: e.poster,
|
|
183
|
+
alt: "AITO"
|
|
184
|
+
}, null, 8, ["src"])) : _("v-if", !0),
|
|
185
|
+
y(
|
|
186
|
+
"button",
|
|
187
|
+
{
|
|
188
|
+
ref_key: "btnRef",
|
|
189
|
+
ref: w,
|
|
190
|
+
class: f([k, e.playerButtonClass]),
|
|
191
|
+
onClick: t
|
|
192
|
+
},
|
|
193
|
+
[
|
|
194
|
+
V(o.$slots, "play", {}, () => [
|
|
195
|
+
(r(), h("svg", {
|
|
196
|
+
class: f(x),
|
|
197
|
+
viewBox: "0 0 1024 1024",
|
|
198
|
+
version: "1.1",
|
|
199
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
200
|
+
width: "200",
|
|
201
|
+
height: "200"
|
|
202
|
+
}, [...v[0] || (v[0] = [
|
|
203
|
+
y(
|
|
204
|
+
"path",
|
|
205
|
+
{
|
|
206
|
+
d: "M671.744 495.616c20.48 12.288 20.48 36.864 0 49.152l-217.088 126.976c-20.48 12.288-45.056-4.096-45.056-24.576V393.216c0-20.48 24.576-36.864 45.056-24.576l217.088 126.976z",
|
|
207
|
+
fill: "#ffffff"
|
|
208
|
+
},
|
|
209
|
+
null,
|
|
210
|
+
-1
|
|
211
|
+
/* CACHED */
|
|
212
|
+
),
|
|
213
|
+
y(
|
|
214
|
+
"path",
|
|
215
|
+
{
|
|
216
|
+
d: "M512 1011.712C237.568 1011.712 12.288 786.432 12.288 512 12.288 237.568 237.568 12.288 512 12.288c274.432 0 499.712 225.28 499.712 499.712 0 274.432-225.28 499.712-499.712 499.712z m0-958.464c-253.952 0-458.752 204.8-458.752 458.752s204.8 458.752 458.752 458.752 458.752-204.8 458.752-458.752-204.8-458.752-458.752-458.752z",
|
|
217
|
+
fill: "#ffffff"
|
|
218
|
+
},
|
|
219
|
+
null,
|
|
220
|
+
-1
|
|
221
|
+
/* CACHED */
|
|
222
|
+
)
|
|
223
|
+
])])),
|
|
224
|
+
y(
|
|
225
|
+
"span",
|
|
226
|
+
{
|
|
227
|
+
class: f(g)
|
|
228
|
+
},
|
|
229
|
+
X(e.playerButtonText),
|
|
230
|
+
1
|
|
231
|
+
/* TEXT */
|
|
232
|
+
)
|
|
233
|
+
])
|
|
234
|
+
],
|
|
235
|
+
2
|
|
236
|
+
/* CLASS */
|
|
237
|
+
)
|
|
213
238
|
],
|
|
214
|
-
|
|
215
|
-
/* CLASS */
|
|
216
|
-
)
|
|
239
|
+
6
|
|
240
|
+
/* CLASS, STYLE */
|
|
241
|
+
),
|
|
242
|
+
n.value ? (r(), $(F, {
|
|
243
|
+
key: 0,
|
|
244
|
+
to: "body"
|
|
245
|
+
}, [
|
|
246
|
+
Y(
|
|
247
|
+
z,
|
|
248
|
+
T(e, {
|
|
249
|
+
autoPlay: !1,
|
|
250
|
+
ref_key: "vwRef",
|
|
251
|
+
ref: B,
|
|
252
|
+
onPaused: s
|
|
253
|
+
}),
|
|
254
|
+
null,
|
|
255
|
+
16
|
|
256
|
+
/* FULL_PROPS */
|
|
257
|
+
)
|
|
258
|
+
])) : _("v-if", !0)
|
|
217
259
|
],
|
|
218
|
-
|
|
219
|
-
/*
|
|
220
|
-
),
|
|
221
|
-
o.value ? (y(), x(F, {
|
|
222
|
-
key: 0,
|
|
223
|
-
to: "body"
|
|
224
|
-
}, [
|
|
225
|
-
I(
|
|
226
|
-
R,
|
|
227
|
-
$(a, {
|
|
228
|
-
ref_key: "vwRef",
|
|
229
|
-
ref: l
|
|
230
|
-
}),
|
|
231
|
-
null,
|
|
232
|
-
16
|
|
233
|
-
/* FULL_PROPS */
|
|
234
|
-
)
|
|
235
|
-
])) : L("v-if", !0)
|
|
260
|
+
64
|
|
261
|
+
/* STABLE_FRAGMENT */
|
|
262
|
+
)) : _("v-if", !0)
|
|
236
263
|
],
|
|
237
264
|
64
|
|
238
265
|
/* STABLE_FRAGMENT */
|
|
239
266
|
));
|
|
240
267
|
}
|
|
241
268
|
});
|
|
242
|
-
|
|
243
|
-
const
|
|
269
|
+
R.install = (m) => (m.component("ScVideo", R), m);
|
|
270
|
+
const J = R;
|
|
244
271
|
export {
|
|
245
|
-
|
|
272
|
+
J as ScVideo
|
|
246
273
|
};
|
package/dist/global.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ declare module 'vue' {
|
|
|
8
8
|
ScRadio: typeof import("@seresweb/website-component")["ScRadio"];
|
|
9
9
|
ScParameterBox: typeof import("@seresweb/website-component")["ScParameterBox"];
|
|
10
10
|
ScLayzImage: typeof import("@seresweb/website-component")["ScLayzImage"];
|
|
11
|
+
ScInput: typeof import("@seresweb/website-component")["ScInput"];
|
|
11
12
|
ScImageIndicator: typeof import("@seresweb/website-component")["ScImageIndicator"];
|
|
12
13
|
ScHorizontalViewer: typeof import("@seresweb/website-component")["ScHorizontalViewer"];
|
|
13
14
|
ScGradualHighlight: typeof import("@seresweb/website-component")["ScGradualHighlight"];
|
|
@@ -15,7 +16,6 @@ declare module 'vue' {
|
|
|
15
16
|
ScDrawer: typeof import("@seresweb/website-component")["ScDrawer"];
|
|
16
17
|
ScAnimatedNumber: typeof import("@seresweb/website-component")["ScAnimatedNumber"];
|
|
17
18
|
ScAccordionInfoPanel: typeof import("@seresweb/website-component")["ScAccordionInfoPanel"];
|
|
18
|
-
ScInput: typeof import("@seresweb/website-component")["ScInput"];
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
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
2
|
import { a as q } from "./index-BrggpRcU.js";
|
|
3
3
|
import { P as i } from "./_vars-BV4QQF-p.js";
|
|
4
|
-
import "./es/Input.mjs";
|
|
5
4
|
import "./es/accordion-info-panel.mjs";
|
|
6
5
|
import "./es/animated-number.mjs";
|
|
7
6
|
import "./es/drawer.mjs";
|
|
8
7
|
import "./es/dropdown.mjs";
|
|
9
8
|
import "./es/gradual-highlight.mjs";
|
|
10
9
|
import { getRootOffset as G } from "@vavt/util";
|
|
10
|
+
import "./es/input.mjs";
|
|
11
11
|
import { ScLayzImage as W } from "./es/layz-image.mjs";
|
|
12
12
|
import "./es/parameter-box.mjs";
|
|
13
13
|
import "./es/radio.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
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;
|