@hbis-uni/components 2.0.5 → 2.5.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/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +844 -591
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -5
package/dist/index.es.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { defineComponent, createElementBlock, openBlock, normalizeClass, renderSlot, createTextVNode, toDisplayString, createElementVNode, createCommentVNode, computed, ref, onMounted, watch, Fragment, renderList, normalizeStyle, useCssVars, nextTick, onUnmounted } from "vue";
|
|
2
|
-
const _sfc_main$
|
|
1
|
+
import { defineComponent, createElementBlock, openBlock, normalizeClass, renderSlot, createTextVNode, toDisplayString, createElementVNode, createCommentVNode, computed, ref, onMounted, watch, Fragment, renderList, normalizeStyle, useCssVars, nextTick, onUnmounted, useSlots, resolveComponent, withDirectives, vModelText, createVNode, withCtx } from "vue";
|
|
2
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
3
3
|
__name: "C1",
|
|
4
4
|
props: {
|
|
5
5
|
title: { default: "C1 Component" },
|
|
6
6
|
primary: { type: Boolean, default: !1 }
|
|
7
7
|
},
|
|
8
|
-
setup(
|
|
9
|
-
return (g,
|
|
10
|
-
class: normalizeClass(["c1-container", { "c1-primary":
|
|
8
|
+
setup(p) {
|
|
9
|
+
return (g, o) => (openBlock(), createElementBlock("div", {
|
|
10
|
+
class: normalizeClass(["c1-container", { "c1-primary": p.primary }])
|
|
11
11
|
}, [
|
|
12
12
|
renderSlot(g.$slots, "default", {}, () => [
|
|
13
|
-
createTextVNode(toDisplayString(
|
|
13
|
+
createTextVNode(toDisplayString(p.title), 1)
|
|
14
14
|
], !0)
|
|
15
15
|
], 2));
|
|
16
16
|
}
|
|
17
|
-
}), _export_sfc = (
|
|
18
|
-
const
|
|
17
|
+
}), _export_sfc = (p, g) => {
|
|
18
|
+
const o = p.__vccOpts || p;
|
|
19
19
|
for (const [t, r] of g)
|
|
20
|
-
|
|
21
|
-
return
|
|
22
|
-
}, C1 = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
20
|
+
o[t] = r;
|
|
21
|
+
return o;
|
|
22
|
+
}, C1 = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-e2028f64"]]), _hoisted_1$4 = { class: "c2-container" }, _hoisted_2$4 = { class: "c2-title" }, _hoisted_3$4 = { class: "c2-content" }, _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
23
23
|
__name: "C2",
|
|
24
24
|
props: {
|
|
25
25
|
title: { default: "C2 Component" },
|
|
@@ -27,33 +27,33 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
27
27
|
buttonText: { default: "Click Me" }
|
|
28
28
|
},
|
|
29
29
|
emits: ["click"],
|
|
30
|
-
setup(
|
|
31
|
-
const
|
|
32
|
-
|
|
30
|
+
setup(p, { emit: g }) {
|
|
31
|
+
const o = g, t = (r) => {
|
|
32
|
+
o("click", r);
|
|
33
33
|
};
|
|
34
|
-
return (r,
|
|
35
|
-
createElementVNode("h2", _hoisted_2$
|
|
36
|
-
createElementVNode("div", _hoisted_3$
|
|
34
|
+
return (r, h) => (openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
35
|
+
createElementVNode("h2", _hoisted_2$4, toDisplayString(p.title), 1),
|
|
36
|
+
createElementVNode("div", _hoisted_3$4, [
|
|
37
37
|
renderSlot(r.$slots, "default", {}, void 0, !0)
|
|
38
38
|
]),
|
|
39
|
-
|
|
39
|
+
p.showButton ? (openBlock(), createElementBlock("button", {
|
|
40
40
|
key: 0,
|
|
41
41
|
class: "c2-button",
|
|
42
42
|
onClick: t
|
|
43
|
-
}, toDisplayString(
|
|
43
|
+
}, toDisplayString(p.buttonText), 1)) : createCommentVNode("", !0)
|
|
44
44
|
]));
|
|
45
45
|
}
|
|
46
|
-
}), C2 = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
46
|
+
}), C2 = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-b1d573ae"]]), _hoisted_1$3 = { key: 0 }, _hoisted_2$3 = { class: "hbis-date-strip__weekdays" }, _hoisted_3$3 = { class: "hbis-date-strip__dates" }, _hoisted_4$3 = ["onClick"], _hoisted_5$3 = { class: "hbis-date-strip__date-number" }, _hoisted_6$2 = { class: "hbis-date-strip__date-slot" }, _hoisted_7$2 = {
|
|
47
47
|
key: 1,
|
|
48
48
|
class: "hbis-date-strip__scroll-wrapper"
|
|
49
|
-
}, _hoisted_8$1 = { class: "hbis-date-strip__scroll-container" }, _hoisted_9 = { class: "hbis-date-strip__weekdays" }, _hoisted_10 = { class: "hbis-date-strip__dates" }, _hoisted_11 = ["onClick"], _hoisted_12 = { class: "hbis-date-strip__date-number" }, _hoisted_13 = { class: "hbis-date-strip__date-slot" }, _sfc_main$
|
|
49
|
+
}, _hoisted_8$1 = { class: "hbis-date-strip__scroll-container" }, _hoisted_9 = { class: "hbis-date-strip__weekdays" }, _hoisted_10 = { class: "hbis-date-strip__dates" }, _hoisted_11 = ["onClick"], _hoisted_12 = { class: "hbis-date-strip__date-number" }, _hoisted_13 = { class: "hbis-date-strip__date-slot" }, _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
50
50
|
__name: "hbis-dateStrip",
|
|
51
51
|
props: {
|
|
52
52
|
modelValue: { default: () => /* @__PURE__ */ new Date() },
|
|
53
53
|
startDate: { default: () => /* @__PURE__ */ new Date() },
|
|
54
54
|
endDate: { default: () => {
|
|
55
|
-
const
|
|
56
|
-
return
|
|
55
|
+
const p = /* @__PURE__ */ new Date();
|
|
56
|
+
return p.setDate(p.getDate() + 30), p;
|
|
57
57
|
} },
|
|
58
58
|
highlightType: { default: "bg" },
|
|
59
59
|
showToday: { type: Boolean, default: !0 },
|
|
@@ -67,33 +67,33 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
67
67
|
visibleDays: { default: 7 }
|
|
68
68
|
},
|
|
69
69
|
emits: ["update:modelValue", "dateClick"],
|
|
70
|
-
setup(
|
|
71
|
-
const
|
|
70
|
+
setup(p, { emit: g }) {
|
|
71
|
+
const o = p, t = g, r = computed(() => {
|
|
72
72
|
if (console.log("props:", {
|
|
73
|
-
startDate:
|
|
74
|
-
endDate:
|
|
75
|
-
scrollable:
|
|
76
|
-
}),
|
|
73
|
+
startDate: o.startDate,
|
|
74
|
+
endDate: o.endDate,
|
|
75
|
+
scrollable: o.scrollable
|
|
76
|
+
}), o.scrollable)
|
|
77
77
|
return console.log("显式设置了scrollable为true,允许滚动"), !0;
|
|
78
78
|
try {
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
79
|
+
const s = new Date(o.startDate);
|
|
80
|
+
s.setHours(0, 0, 0, 0);
|
|
81
|
+
const d = new Date(o.endDate);
|
|
82
|
+
if (d.setHours(0, 0, 0, 0), isNaN(s.getTime()) || isNaN(d.getTime()))
|
|
83
83
|
return console.log("无效的日期对象,使用默认滚动行为"), !1;
|
|
84
|
-
const e =
|
|
84
|
+
const e = d.getTime() - s.getTime(), x = Math.ceil(e / (1e3 * 60 * 60 * 24)), v = x + 1;
|
|
85
85
|
return console.log("日期范围天数计算:", {
|
|
86
|
-
start:
|
|
87
|
-
end:
|
|
86
|
+
start: s.toLocaleDateString(),
|
|
87
|
+
end: d.toLocaleDateString(),
|
|
88
88
|
diffTime: e,
|
|
89
|
-
diffDays:
|
|
90
|
-
totalDays:
|
|
91
|
-
shouldScroll:
|
|
92
|
-
}),
|
|
93
|
-
} catch (
|
|
94
|
-
return console.error("计算日期范围时出错:",
|
|
89
|
+
diffDays: x,
|
|
90
|
+
totalDays: v,
|
|
91
|
+
shouldScroll: v > 7
|
|
92
|
+
}), v > 7;
|
|
93
|
+
} catch (s) {
|
|
94
|
+
return console.error("计算日期范围时出错:", s), !1;
|
|
95
95
|
}
|
|
96
|
-
}),
|
|
96
|
+
}), h = [
|
|
97
97
|
{ value: 0, label: "日", isWeekend: !0 },
|
|
98
98
|
{ value: 1, label: "一", isWeekend: !1 },
|
|
99
99
|
{ value: 2, label: "二", isWeekend: !1 },
|
|
@@ -101,155 +101,155 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
101
101
|
{ value: 4, label: "四", isWeekend: !1 },
|
|
102
102
|
{ value: 5, label: "五", isWeekend: !1 },
|
|
103
103
|
{ value: 6, label: "六", isWeekend: !0 }
|
|
104
|
-
],
|
|
105
|
-
const
|
|
106
|
-
if (!
|
|
107
|
-
return
|
|
108
|
-
const
|
|
109
|
-
for (let
|
|
110
|
-
const
|
|
111
|
-
e.push(v
|
|
104
|
+
], l = computed(() => {
|
|
105
|
+
const s = n.value[0];
|
|
106
|
+
if (!s)
|
|
107
|
+
return h;
|
|
108
|
+
const d = s.weekday, e = [];
|
|
109
|
+
for (let x = 0; x < 7; x++) {
|
|
110
|
+
const v = (d + x) % 7;
|
|
111
|
+
e.push(h[v]);
|
|
112
112
|
}
|
|
113
113
|
return e;
|
|
114
114
|
});
|
|
115
115
|
ref((() => {
|
|
116
|
-
const
|
|
117
|
-
return
|
|
116
|
+
const s = o.startDate || /* @__PURE__ */ new Date(), d = s.getDay(), e = s.getDate() - (d === 0 ? 6 : d - 1), x = new Date(s);
|
|
117
|
+
return x.setDate(e), x;
|
|
118
118
|
})()), onMounted(() => {
|
|
119
|
-
console.log("props:",
|
|
119
|
+
console.log("props:", o), console.log("highlightType:", o.highlightType);
|
|
120
120
|
}), watch(
|
|
121
|
-
() =>
|
|
122
|
-
(
|
|
123
|
-
console.log("highlightType changed:",
|
|
121
|
+
() => o.highlightType,
|
|
122
|
+
(s) => {
|
|
123
|
+
console.log("highlightType changed:", s);
|
|
124
124
|
}
|
|
125
125
|
), watch(
|
|
126
|
-
() =>
|
|
127
|
-
(
|
|
128
|
-
console.log("modelValue changed:",
|
|
126
|
+
() => o.modelValue,
|
|
127
|
+
(s) => {
|
|
128
|
+
console.log("modelValue changed:", s);
|
|
129
129
|
}
|
|
130
130
|
);
|
|
131
|
-
const
|
|
132
|
-
const
|
|
131
|
+
const c = computed(() => {
|
|
132
|
+
const s = [];
|
|
133
133
|
try {
|
|
134
|
-
const
|
|
135
|
-
if (isNaN(
|
|
136
|
-
return console.log("无效的日期对象,返回空数组"),
|
|
137
|
-
const
|
|
138
|
-
for (let
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
date:
|
|
142
|
-
dateString:
|
|
143
|
-
day:
|
|
144
|
-
month:
|
|
145
|
-
year:
|
|
146
|
-
isWeekend:
|
|
147
|
-
weekday:
|
|
134
|
+
const d = o.startDate, e = o.endDate;
|
|
135
|
+
if (isNaN(d.getTime()) || isNaN(e.getTime()))
|
|
136
|
+
return console.log("无效的日期对象,返回空数组"), s;
|
|
137
|
+
const x = Math.ceil((e.getTime() - d.getTime()) / (1e3 * 60 * 60 * 24)) + 1;
|
|
138
|
+
for (let v = 0; v < x; v++) {
|
|
139
|
+
const _ = new Date(d);
|
|
140
|
+
_.setDate(d.getDate() + v), isNaN(_.getTime()) || s.push({
|
|
141
|
+
date: _,
|
|
142
|
+
dateString: f(_),
|
|
143
|
+
day: _.getDate(),
|
|
144
|
+
month: _.getMonth() + 1,
|
|
145
|
+
year: _.getFullYear(),
|
|
146
|
+
isWeekend: _.getDay() === 0 || _.getDay() === 6,
|
|
147
|
+
weekday: _.getDay()
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
|
-
} catch (
|
|
151
|
-
console.error("生成日期数组时出错:",
|
|
150
|
+
} catch (d) {
|
|
151
|
+
console.error("生成日期数组时出错:", d);
|
|
152
152
|
}
|
|
153
|
-
return
|
|
154
|
-
}),
|
|
155
|
-
const
|
|
156
|
-
return
|
|
157
|
-
},
|
|
158
|
-
const
|
|
159
|
-
return
|
|
160
|
-
},
|
|
161
|
-
const
|
|
162
|
-
return
|
|
163
|
-
},
|
|
164
|
-
var
|
|
165
|
-
return ((
|
|
166
|
-
},
|
|
167
|
-
|
|
153
|
+
return s;
|
|
154
|
+
}), n = computed(() => c.value.filter((s) => !!(s && s.date && s.dateString && !isNaN(s.date.getTime()) && typeof s.dateString == "string" && typeof s.day == "number"))), f = (s) => `${s.getFullYear()}-${String(s.getMonth() + 1).padStart(2, "0")}-${String(s.getDate()).padStart(2, "0")}`, i = (s) => {
|
|
155
|
+
const d = s.dateString;
|
|
156
|
+
return o.modelValue ? Array.isArray(o.modelValue) ? o.modelValue.some((e) => !e || isNaN(e.getTime()) ? !1 : f(e) === d) : isNaN(o.modelValue.getTime()) ? !1 : f(o.modelValue) === d : !1;
|
|
157
|
+
}, y = (s) => {
|
|
158
|
+
const d = f(/* @__PURE__ */ new Date());
|
|
159
|
+
return s.dateString === d;
|
|
160
|
+
}, a = (s) => {
|
|
161
|
+
const d = s.date;
|
|
162
|
+
return o.disablePast && d < new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0)) || o.disableFuture && d > new Date((/* @__PURE__ */ new Date()).setHours(23, 59, 59, 999)) ? !1 : d >= o.startDate && d <= o.endDate;
|
|
163
|
+
}, b = (s) => {
|
|
164
|
+
var d;
|
|
165
|
+
return ((d = h.find((e) => e.value === s)) == null ? void 0 : d.label) || "";
|
|
166
|
+
}, w = (s) => {
|
|
167
|
+
a(s) && (t("dateClick", s), t("update:modelValue", s.date));
|
|
168
168
|
};
|
|
169
|
-
return (
|
|
169
|
+
return (s, d) => (openBlock(), createElementBlock("div", {
|
|
170
170
|
class: normalizeClass(["hbis-date-strip", {
|
|
171
|
-
"hbis-date-strip--highlight-bg":
|
|
172
|
-
"hbis-date-strip--highlight-dot":
|
|
173
|
-
"hbis-date-strip--highlight-round":
|
|
171
|
+
"hbis-date-strip--highlight-bg": p.highlightType === "bg",
|
|
172
|
+
"hbis-date-strip--highlight-dot": p.highlightType === "dot",
|
|
173
|
+
"hbis-date-strip--highlight-round": p.highlightType === "round",
|
|
174
174
|
"hbis-date-strip--scrollable": r.value
|
|
175
175
|
}])
|
|
176
176
|
}, [
|
|
177
|
-
r.value ? (openBlock(), createElementBlock("div", _hoisted_7$
|
|
177
|
+
r.value ? (openBlock(), createElementBlock("div", _hoisted_7$2, [
|
|
178
178
|
createElementVNode("div", _hoisted_8$1, [
|
|
179
179
|
createElementVNode("div", _hoisted_9, [
|
|
180
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
180
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.value, (e) => (openBlock(), createElementBlock("div", {
|
|
181
181
|
key: e.dateString + "-weekday",
|
|
182
182
|
class: normalizeClass(["hbis-date-strip__weekday", {
|
|
183
183
|
"hbis-date-strip__weekday--weekend": e.isWeekend
|
|
184
184
|
}])
|
|
185
|
-
}, toDisplayString(
|
|
185
|
+
}, toDisplayString(b(e.weekday)), 3))), 128))
|
|
186
186
|
]),
|
|
187
187
|
createElementVNode("div", _hoisted_10, [
|
|
188
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
188
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.value, (e) => (openBlock(), createElementBlock("div", {
|
|
189
189
|
key: e.dateString,
|
|
190
190
|
class: normalizeClass(["hbis-date-strip__date", {
|
|
191
191
|
"hbis-date-strip__date--selected": i(e),
|
|
192
|
-
"hbis-date-strip__date--today":
|
|
193
|
-
"hbis-date-strip__date--disabled": !
|
|
192
|
+
"hbis-date-strip__date--today": y(e),
|
|
193
|
+
"hbis-date-strip__date--disabled": !a(e),
|
|
194
194
|
"hbis-date-strip__date--weekend": e.isWeekend
|
|
195
195
|
}]),
|
|
196
196
|
style: normalizeStyle({
|
|
197
|
-
color: i(e) ?
|
|
198
|
-
backgroundColor: i(e) ?
|
|
197
|
+
color: i(e) ? p.selectedColor : p.normalColor,
|
|
198
|
+
backgroundColor: i(e) ? p.selectedBgColor : p.normalBgColor
|
|
199
199
|
}),
|
|
200
|
-
onClick: (
|
|
200
|
+
onClick: (x) => w(e)
|
|
201
201
|
}, [
|
|
202
202
|
createElementVNode("div", _hoisted_12, toDisplayString(e.day), 1),
|
|
203
203
|
createElementVNode("div", _hoisted_13, [
|
|
204
|
-
renderSlot(
|
|
204
|
+
renderSlot(s.$slots, "default", { date: e }, void 0, !0)
|
|
205
205
|
])
|
|
206
206
|
], 14, _hoisted_11))), 128))
|
|
207
207
|
])
|
|
208
208
|
])
|
|
209
|
-
])) : (openBlock(), createElementBlock("div", _hoisted_1$
|
|
210
|
-
createElementVNode("div", _hoisted_2$
|
|
211
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
209
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
210
|
+
createElementVNode("div", _hoisted_2$3, [
|
|
211
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(l.value, (e) => (openBlock(), createElementBlock("div", {
|
|
212
212
|
key: e.value,
|
|
213
213
|
class: normalizeClass(["hbis-date-strip__weekday", {
|
|
214
214
|
"hbis-date-strip__weekday--weekend": e.isWeekend
|
|
215
215
|
}])
|
|
216
216
|
}, toDisplayString(e.label), 3))), 128))
|
|
217
217
|
]),
|
|
218
|
-
createElementVNode("div", _hoisted_3$
|
|
219
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
218
|
+
createElementVNode("div", _hoisted_3$3, [
|
|
219
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.value, (e) => (openBlock(), createElementBlock("div", {
|
|
220
220
|
key: e.dateString,
|
|
221
221
|
class: normalizeClass(["hbis-date-strip__date", {
|
|
222
222
|
"hbis-date-strip__date--selected": i(e),
|
|
223
|
-
"hbis-date-strip__date--today":
|
|
224
|
-
"hbis-date-strip__date--disabled": !
|
|
223
|
+
"hbis-date-strip__date--today": y(e),
|
|
224
|
+
"hbis-date-strip__date--disabled": !a(e),
|
|
225
225
|
"hbis-date-strip__date--weekend": e.isWeekend
|
|
226
226
|
}]),
|
|
227
227
|
style: normalizeStyle({
|
|
228
|
-
color: i(e) ?
|
|
229
|
-
backgroundColor: i(e) ?
|
|
228
|
+
color: i(e) ? p.selectedColor : p.normalColor,
|
|
229
|
+
backgroundColor: i(e) ? p.selectedBgColor : p.normalBgColor
|
|
230
230
|
}),
|
|
231
|
-
onClick: (
|
|
231
|
+
onClick: (x) => w(e)
|
|
232
232
|
}, [
|
|
233
|
-
createElementVNode("div", _hoisted_5$
|
|
234
|
-
createElementVNode("div", _hoisted_6$
|
|
235
|
-
renderSlot(
|
|
233
|
+
createElementVNode("div", _hoisted_5$3, toDisplayString(e.day), 1),
|
|
234
|
+
createElementVNode("div", _hoisted_6$2, [
|
|
235
|
+
renderSlot(s.$slots, "default", { date: e }, void 0, !0)
|
|
236
236
|
])
|
|
237
|
-
], 14, _hoisted_4$
|
|
237
|
+
], 14, _hoisted_4$3))), 128))
|
|
238
238
|
])
|
|
239
239
|
]))
|
|
240
240
|
], 2));
|
|
241
241
|
}
|
|
242
|
-
}), hbisDateStrip = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
242
|
+
}), hbisDateStrip = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-2e8258eb"]]), _hoisted_1$2 = { class: "image-preview" }, _hoisted_2$2 = {
|
|
243
243
|
key: 0,
|
|
244
244
|
class: "counter"
|
|
245
|
-
}, _hoisted_3 = { class: "counter-text" }, _hoisted_4 = { class: "swiper-container" }, _hoisted_5 = ["onWheel"], _hoisted_6 = ["src", "onLoad"], _hoisted_7 = ["disabled"], _hoisted_8 = ["disabled"], _sfc_main$
|
|
245
|
+
}, _hoisted_3$2 = { class: "counter-text" }, _hoisted_4$2 = { class: "swiper-container" }, _hoisted_5$2 = ["onWheel"], _hoisted_6$1 = ["src", "onLoad"], _hoisted_7$1 = ["disabled"], _hoisted_8 = ["disabled"], _sfc_main$4 = {
|
|
246
246
|
__name: "hbis-previewImage",
|
|
247
247
|
props: {
|
|
248
248
|
// 图片集合
|
|
249
249
|
images: {
|
|
250
250
|
type: Array,
|
|
251
251
|
required: !0,
|
|
252
|
-
validator: (
|
|
252
|
+
validator: (p) => p.every((g) => typeof g == "string")
|
|
253
253
|
},
|
|
254
254
|
// 当前显示的图片索引
|
|
255
255
|
initialIndex: {
|
|
@@ -278,129 +278,129 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
278
278
|
}
|
|
279
279
|
},
|
|
280
280
|
emits: ["close", "change", "update:initialIndex"],
|
|
281
|
-
setup(
|
|
282
|
-
const
|
|
281
|
+
setup(p, { emit: g }) {
|
|
282
|
+
const o = p, t = g, r = ref(o.initialIndex), h = ref(null), l = ref(!1), u = ref(!1), c = ref(0), n = ref(0), f = ref(0), i = ref(window.innerWidth), y = ref(window.innerHeight), a = ref(o.images.map(() => ({
|
|
283
283
|
scale: 1,
|
|
284
284
|
translateX: 0,
|
|
285
285
|
translateY: 0,
|
|
286
286
|
naturalWidth: 0,
|
|
287
287
|
naturalHeight: 0,
|
|
288
288
|
isLoaded: !1
|
|
289
|
-
}))),
|
|
290
|
-
transform: `translateX(${
|
|
291
|
-
transition:
|
|
292
|
-
})),
|
|
289
|
+
}))), b = ref(0), w = ref(0), s = ref(0), d = ref(0), e = ref(0), x = computed(() => ({
|
|
290
|
+
transform: `translateX(${f.value}px)`,
|
|
291
|
+
transition: l.value ? "none" : "transform 0.3s ease"
|
|
292
|
+
})), v = computed(() => ({
|
|
293
293
|
width: `${i.value}px`,
|
|
294
|
-
height: `${
|
|
294
|
+
height: `${y.value}px`
|
|
295
295
|
}));
|
|
296
|
-
watch(() =>
|
|
297
|
-
|
|
296
|
+
watch(() => o.initialIndex, (m) => {
|
|
297
|
+
m !== r.value && (r.value = m, _());
|
|
298
298
|
}), onMounted(() => {
|
|
299
|
-
const
|
|
300
|
-
i.value = window.innerWidth,
|
|
299
|
+
const m = () => {
|
|
300
|
+
i.value = window.innerWidth, y.value = window.innerHeight, _();
|
|
301
301
|
};
|
|
302
|
-
return window.addEventListener("resize",
|
|
303
|
-
window.removeEventListener("resize",
|
|
302
|
+
return window.addEventListener("resize", m), m(), () => {
|
|
303
|
+
window.removeEventListener("resize", m);
|
|
304
304
|
};
|
|
305
305
|
});
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
},
|
|
309
|
-
r.value > 0 && (r.value--,
|
|
310
|
-
},
|
|
311
|
-
r.value <
|
|
312
|
-
},
|
|
313
|
-
|
|
314
|
-
...
|
|
306
|
+
const _ = () => {
|
|
307
|
+
f.value = -r.value * i.value;
|
|
308
|
+
}, E = () => {
|
|
309
|
+
r.value > 0 && (r.value--, _(), O(), t("change", r.value), t("update:initialIndex", r.value));
|
|
310
|
+
}, S = () => {
|
|
311
|
+
r.value < o.images.length - 1 && (r.value++, _(), O(), t("change", r.value), t("update:initialIndex", r.value));
|
|
312
|
+
}, O = () => {
|
|
313
|
+
a.value[r.value] = {
|
|
314
|
+
...a.value[r.value],
|
|
315
315
|
scale: 1,
|
|
316
316
|
translateX: 0,
|
|
317
317
|
translateY: 0
|
|
318
318
|
};
|
|
319
|
-
}, T = (
|
|
320
|
-
const
|
|
319
|
+
}, T = (m) => {
|
|
320
|
+
const k = a.value[m];
|
|
321
321
|
return {
|
|
322
|
-
transform: `scale(${
|
|
323
|
-
transition:
|
|
324
|
-
opacity:
|
|
322
|
+
transform: `scale(${k.scale}) translate(${k.translateX}px, ${k.translateY}px)`,
|
|
323
|
+
transition: u.value ? "none" : "transform 0.1s ease",
|
|
324
|
+
opacity: k.isLoaded ? 1 : 0
|
|
325
325
|
};
|
|
326
|
-
},
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
...
|
|
330
|
-
naturalWidth:
|
|
331
|
-
naturalHeight:
|
|
326
|
+
}, I = (m) => {
|
|
327
|
+
const k = event.target;
|
|
328
|
+
a.value[m] = {
|
|
329
|
+
...a.value[m],
|
|
330
|
+
naturalWidth: k.naturalWidth,
|
|
331
|
+
naturalHeight: k.naturalHeight,
|
|
332
332
|
isLoaded: !0
|
|
333
333
|
};
|
|
334
|
-
}, C = (
|
|
335
|
-
|
|
336
|
-
},
|
|
337
|
-
if (
|
|
338
|
-
const
|
|
339
|
-
|
|
340
|
-
...
|
|
341
|
-
translateX:
|
|
342
|
-
translateY:
|
|
334
|
+
}, C = (m) => {
|
|
335
|
+
m.target.tagName === "IMG" ? (u.value = !0, c.value = m.clientX - a.value[r.value].translateX, n.value = m.clientY - a.value[r.value].translateY) : (l.value = !0, c.value = m.clientX - f.value), m.preventDefault();
|
|
336
|
+
}, B = (m) => {
|
|
337
|
+
if (u.value) {
|
|
338
|
+
const k = m.clientX - c.value, N = m.clientY - n.value;
|
|
339
|
+
a.value[r.value] = {
|
|
340
|
+
...a.value[r.value],
|
|
341
|
+
translateX: k,
|
|
342
|
+
translateY: N
|
|
343
343
|
};
|
|
344
|
-
} else if (
|
|
345
|
-
const
|
|
346
|
-
|
|
344
|
+
} else if (l.value && o.enableSwipe) {
|
|
345
|
+
const k = m.clientX - c.value;
|
|
346
|
+
f.value = k;
|
|
347
347
|
}
|
|
348
|
-
},
|
|
349
|
-
if (
|
|
350
|
-
const
|
|
351
|
-
Math.abs(
|
|
348
|
+
}, $ = () => {
|
|
349
|
+
if (l.value && o.enableSwipe) {
|
|
350
|
+
const m = i.value * 0.3;
|
|
351
|
+
Math.abs(f.value + r.value * i.value) > m ? f.value > 0 ? E() : S() : _();
|
|
352
352
|
}
|
|
353
|
-
|
|
354
|
-
},
|
|
355
|
-
const
|
|
356
|
-
|
|
357
|
-
}, V = (
|
|
358
|
-
const
|
|
359
|
-
|
|
360
|
-
const
|
|
361
|
-
if (Math.abs(
|
|
362
|
-
|
|
363
|
-
else if (
|
|
364
|
-
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
...
|
|
368
|
-
translateX:
|
|
353
|
+
l.value = !1, u.value = !1;
|
|
354
|
+
}, R = (m) => {
|
|
355
|
+
const k = m.touches[0];
|
|
356
|
+
b.value = k.clientX, w.value = k.clientY, s.value = Date.now();
|
|
357
|
+
}, V = (m) => {
|
|
358
|
+
const k = m.touches[0];
|
|
359
|
+
d.value = k.clientX, e.value = k.clientY;
|
|
360
|
+
const N = d.value - b.value, A = e.value - w.value;
|
|
361
|
+
if (Math.abs(N) > Math.abs(A))
|
|
362
|
+
m.preventDefault(), l.value = !0, f.value = -r.value * i.value + N;
|
|
363
|
+
else if (a.value[r.value].scale > 1) {
|
|
364
|
+
m.preventDefault(), u.value = !0;
|
|
365
|
+
const D = N + a.value[r.value].translateX, j = A + a.value[r.value].translateY;
|
|
366
|
+
a.value[r.value] = {
|
|
367
|
+
...a.value[r.value],
|
|
368
|
+
translateX: D,
|
|
369
369
|
translateY: j
|
|
370
370
|
};
|
|
371
371
|
}
|
|
372
372
|
}, M = () => {
|
|
373
|
-
if (
|
|
374
|
-
const
|
|
375
|
-
Math.abs(
|
|
373
|
+
if (l.value) {
|
|
374
|
+
const m = d.value - b.value, k = Date.now() - s.value, N = i.value * 0.2, A = Math.abs(m) / k;
|
|
375
|
+
Math.abs(m) > N || A > 0.5 ? m > 0 ? E() : S() : _();
|
|
376
376
|
}
|
|
377
|
-
|
|
378
|
-
},
|
|
379
|
-
if (
|
|
380
|
-
|
|
381
|
-
const
|
|
382
|
-
W(
|
|
383
|
-
}, W = (
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
Math.min(
|
|
387
|
-
), j = event.target.getBoundingClientRect(),
|
|
388
|
-
|
|
389
|
-
...
|
|
390
|
-
scale:
|
|
377
|
+
l.value = !1, u.value = !1;
|
|
378
|
+
}, F = (m, k) => {
|
|
379
|
+
if (k !== r.value) return;
|
|
380
|
+
m.preventDefault();
|
|
381
|
+
const N = m.deltaY > 0 ? -0.1 : 0.1, A = m.clientX, D = m.clientY;
|
|
382
|
+
W(A, D, N);
|
|
383
|
+
}, W = (m, k, N) => {
|
|
384
|
+
const A = a.value[r.value], D = Math.max(
|
|
385
|
+
o.minScale,
|
|
386
|
+
Math.min(o.maxScale, A.scale + N)
|
|
387
|
+
), j = event.target.getBoundingClientRect(), L = m - j.left, P = k - j.top, z = D - A.scale, U = A.translateX + (L - A.translateX) * (z / A.scale), H = A.translateY + (P - A.translateY) * (z / A.scale);
|
|
388
|
+
a.value[r.value] = {
|
|
389
|
+
...A,
|
|
390
|
+
scale: D,
|
|
391
391
|
translateX: U,
|
|
392
|
-
translateY:
|
|
392
|
+
translateY: H
|
|
393
393
|
};
|
|
394
394
|
};
|
|
395
|
-
return (
|
|
396
|
-
|
|
397
|
-
createElementVNode("span", _hoisted_3, toDisplayString(r.value + 1) + "/" + toDisplayString(
|
|
395
|
+
return (m, k) => (openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
396
|
+
p.images.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
|
|
397
|
+
createElementVNode("span", _hoisted_3$2, toDisplayString(r.value + 1) + "/" + toDisplayString(p.images.length), 1)
|
|
398
398
|
])) : createCommentVNode("", !0),
|
|
399
|
-
|
|
399
|
+
p.showCloseBtn ? (openBlock(), createElementBlock("button", {
|
|
400
400
|
key: 1,
|
|
401
401
|
class: "close-btn",
|
|
402
|
-
onClick:
|
|
403
|
-
}, [...
|
|
402
|
+
onClick: k[0] || (k[0] = (N) => t("close"))
|
|
403
|
+
}, [...k[1] || (k[1] = [
|
|
404
404
|
createElementVNode("svg", {
|
|
405
405
|
width: "24",
|
|
406
406
|
height: "24",
|
|
@@ -423,46 +423,46 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
423
423
|
})
|
|
424
424
|
], -1)
|
|
425
425
|
])])) : createCommentVNode("", !0),
|
|
426
|
-
createElementVNode("div", _hoisted_4, [
|
|
426
|
+
createElementVNode("div", _hoisted_4$2, [
|
|
427
427
|
createElementVNode("div", {
|
|
428
428
|
class: "swiper-wrapper",
|
|
429
429
|
ref_key: "swiperWrapper",
|
|
430
|
-
ref:
|
|
431
|
-
style: normalizeStyle(
|
|
432
|
-
onTouchstart:
|
|
430
|
+
ref: h,
|
|
431
|
+
style: normalizeStyle(x.value),
|
|
432
|
+
onTouchstart: R,
|
|
433
433
|
onTouchmove: V,
|
|
434
434
|
onTouchend: M,
|
|
435
435
|
onMousedown: C,
|
|
436
|
-
onMousemove:
|
|
437
|
-
onMouseup:
|
|
438
|
-
onMouseleave:
|
|
436
|
+
onMousemove: B,
|
|
437
|
+
onMouseup: $,
|
|
438
|
+
onMouseleave: $
|
|
439
439
|
}, [
|
|
440
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
441
|
-
key:
|
|
440
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(p.images, (N, A) => (openBlock(), createElementBlock("div", {
|
|
441
|
+
key: A,
|
|
442
442
|
class: "swiper-slide",
|
|
443
|
-
style: normalizeStyle(
|
|
443
|
+
style: normalizeStyle(v.value)
|
|
444
444
|
}, [
|
|
445
445
|
createElementVNode("div", {
|
|
446
446
|
class: "image-container",
|
|
447
|
-
onWheel: (
|
|
447
|
+
onWheel: (D) => F(D, A)
|
|
448
448
|
}, [
|
|
449
449
|
createElementVNode("img", {
|
|
450
|
-
src:
|
|
450
|
+
src: N,
|
|
451
451
|
alt: "Preview image",
|
|
452
452
|
class: "preview-image",
|
|
453
|
-
style: normalizeStyle(T(
|
|
454
|
-
onLoad: (
|
|
453
|
+
style: normalizeStyle(T(A)),
|
|
454
|
+
onLoad: (D) => I(A),
|
|
455
455
|
loading: "lazy"
|
|
456
|
-
}, null, 44, _hoisted_6)
|
|
457
|
-
], 40, _hoisted_5)
|
|
456
|
+
}, null, 44, _hoisted_6$1)
|
|
457
|
+
], 40, _hoisted_5$2)
|
|
458
458
|
], 4))), 128))
|
|
459
459
|
], 36)
|
|
460
460
|
]),
|
|
461
461
|
createElementVNode("button", {
|
|
462
462
|
class: "nav-btn prev-btn",
|
|
463
|
-
onClick:
|
|
463
|
+
onClick: E,
|
|
464
464
|
disabled: r.value === 0
|
|
465
|
-
}, [...
|
|
465
|
+
}, [...k[2] || (k[2] = [
|
|
466
466
|
createElementVNode("svg", {
|
|
467
467
|
width: "24",
|
|
468
468
|
height: "24",
|
|
@@ -473,12 +473,12 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
473
473
|
}, [
|
|
474
474
|
createElementVNode("polyline", { points: "15 18 9 12 15 6" })
|
|
475
475
|
], -1)
|
|
476
|
-
])], 8, _hoisted_7),
|
|
476
|
+
])], 8, _hoisted_7$1),
|
|
477
477
|
createElementVNode("button", {
|
|
478
478
|
class: "nav-btn next-btn",
|
|
479
|
-
onClick:
|
|
480
|
-
disabled: r.value ===
|
|
481
|
-
}, [...
|
|
479
|
+
onClick: S,
|
|
480
|
+
disabled: r.value === p.images.length - 1
|
|
481
|
+
}, [...k[3] || (k[3] = [
|
|
482
482
|
createElementVNode("svg", {
|
|
483
483
|
width: "24",
|
|
484
484
|
height: "24",
|
|
@@ -503,63 +503,63 @@ var svga_lite_min = { exports: {} };
|
|
|
503
503
|
* Released under the MIT License.
|
|
504
504
|
*/
|
|
505
505
|
(function(module, exports$1) {
|
|
506
|
-
(function(
|
|
506
|
+
(function(p, g) {
|
|
507
507
|
module.exports = g();
|
|
508
508
|
})(window, function() {
|
|
509
|
-
return function(
|
|
509
|
+
return function(p) {
|
|
510
510
|
var g = {};
|
|
511
|
-
function
|
|
511
|
+
function o(t) {
|
|
512
512
|
if (g[t]) return g[t].exports;
|
|
513
513
|
var r = g[t] = { i: t, l: !1, exports: {} };
|
|
514
|
-
return
|
|
514
|
+
return p[t].call(r.exports, r, r.exports, o), r.l = !0, r.exports;
|
|
515
515
|
}
|
|
516
|
-
return
|
|
517
|
-
|
|
518
|
-
},
|
|
516
|
+
return o.m = p, o.c = g, o.d = function(t, r, h) {
|
|
517
|
+
o.o(t, r) || Object.defineProperty(t, r, { enumerable: !0, get: h });
|
|
518
|
+
}, o.r = function(t) {
|
|
519
519
|
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 });
|
|
520
|
-
},
|
|
521
|
-
if (1 & r && (t =
|
|
522
|
-
var
|
|
523
|
-
if (
|
|
524
|
-
return t[
|
|
525
|
-
}).bind(null,
|
|
526
|
-
return
|
|
527
|
-
},
|
|
520
|
+
}, o.t = function(t, r) {
|
|
521
|
+
if (1 & r && (t = o(t)), 8 & r || 4 & r && typeof t == "object" && t && t.__esModule) return t;
|
|
522
|
+
var h = /* @__PURE__ */ Object.create(null);
|
|
523
|
+
if (o.r(h), Object.defineProperty(h, "default", { enumerable: !0, value: t }), 2 & r && typeof t != "string") for (var l in t) o.d(h, l, (function(u) {
|
|
524
|
+
return t[u];
|
|
525
|
+
}).bind(null, l));
|
|
526
|
+
return h;
|
|
527
|
+
}, o.n = function(t) {
|
|
528
528
|
var r = t && t.__esModule ? function() {
|
|
529
529
|
return t.default;
|
|
530
530
|
} : function() {
|
|
531
531
|
return t;
|
|
532
532
|
};
|
|
533
|
-
return
|
|
534
|
-
},
|
|
533
|
+
return o.d(r, "a", r), r;
|
|
534
|
+
}, o.o = function(t, r) {
|
|
535
535
|
return Object.prototype.hasOwnProperty.call(t, r);
|
|
536
|
-
},
|
|
537
|
-
}([function(
|
|
536
|
+
}, o.p = "", o(o.s = 1);
|
|
537
|
+
}([function(p, g, o) {
|
|
538
538
|
Object.defineProperty(g, "__esModule", { value: !0 });
|
|
539
|
-
var t = function(r,
|
|
540
|
-
this._d = r, this._transform =
|
|
539
|
+
var t = function(r, h, l) {
|
|
540
|
+
this._d = r, this._transform = h, this._styles = l;
|
|
541
541
|
};
|
|
542
542
|
g.default = t;
|
|
543
|
-
}, function(
|
|
543
|
+
}, function(p, g, o) {
|
|
544
544
|
Object.defineProperty(g, "__esModule", { value: !0 });
|
|
545
|
-
var t =
|
|
546
|
-
g.default =
|
|
547
|
-
}, function(
|
|
545
|
+
var t = o(2), r = o(3), h = o(4), l = { Downloader: t.default, Parser: r.default, Player: h.default };
|
|
546
|
+
g.default = l;
|
|
547
|
+
}, function(p, g, o) {
|
|
548
548
|
Object.defineProperty(g, "__esModule", { value: !0 });
|
|
549
549
|
var t = function() {
|
|
550
550
|
function r() {
|
|
551
551
|
this.request = null;
|
|
552
552
|
}
|
|
553
|
-
return r.prototype.get = function(
|
|
554
|
-
var
|
|
555
|
-
if (!
|
|
556
|
-
return new Promise(function(
|
|
557
|
-
var
|
|
558
|
-
|
|
559
|
-
!
|
|
560
|
-
},
|
|
561
|
-
return
|
|
562
|
-
},
|
|
553
|
+
return r.prototype.get = function(h) {
|
|
554
|
+
var l = this;
|
|
555
|
+
if (!h) throw new Error("download link undefined");
|
|
556
|
+
return new Promise(function(u, c) {
|
|
557
|
+
var n = new XMLHttpRequest();
|
|
558
|
+
n.open("GET", h, !0), n.responseType = "arraybuffer", n.onloadend = function() {
|
|
559
|
+
!n.response || n.status !== 200 && n.status !== 304 ? c(n) : u(n.response);
|
|
560
|
+
}, n.onerror = function() {
|
|
561
|
+
return c(n.response);
|
|
562
|
+
}, n.send(), l.request = n;
|
|
563
563
|
});
|
|
564
564
|
}, r.prototype.cancel = function() {
|
|
565
565
|
this.request && this.request.abort();
|
|
@@ -577,39 +577,39 @@ var svga_lite_min = { exports: {} };
|
|
|
577
577
|
var disableWorker = (_a === void 0 ? { disableWorker: !1 } : _a).disableWorker;
|
|
578
578
|
disableWorker ? (eval(WORKER), this.worker = window.SVGAParserMockWorker) : this.worker = new Worker(window.URL.createObjectURL(new Blob([WORKER])));
|
|
579
579
|
}
|
|
580
|
-
return Parser.prototype.do = function(
|
|
581
|
-
var g = this,
|
|
582
|
-
if (
|
|
583
|
-
if (!
|
|
580
|
+
return Parser.prototype.do = function(p) {
|
|
581
|
+
var g = this, o = new Uint8Array(p, 0, 4);
|
|
582
|
+
if (o[0] == 80 && o[1] == 75 && o[2] == 3 && o[3] == 4) throw "this parser not support version@1.x of svga.";
|
|
583
|
+
if (!p) throw new Error("Parser Data not found");
|
|
584
584
|
if (!this.worker) throw new Error("Parser Worker not found");
|
|
585
585
|
return new Promise(function(t, r) {
|
|
586
|
-
var
|
|
587
|
-
g.worker.disableWorker ? ((
|
|
588
|
-
t(
|
|
589
|
-
},
|
|
590
|
-
var
|
|
591
|
-
t(
|
|
586
|
+
var h;
|
|
587
|
+
g.worker.disableWorker ? ((h = g.worker).onmessageCallback = function(l) {
|
|
588
|
+
t(l);
|
|
589
|
+
}, h.onmessage({ data: p })) : ((h = g.worker).postMessage(p), h.onmessage = function(l) {
|
|
590
|
+
var u = l.data;
|
|
591
|
+
t(u);
|
|
592
592
|
});
|
|
593
593
|
});
|
|
594
594
|
}, Parser.prototype.destroy = function() {
|
|
595
|
-
var
|
|
596
|
-
|
|
595
|
+
var p = this.worker;
|
|
596
|
+
p.terminate && p.terminate();
|
|
597
597
|
}, Parser;
|
|
598
598
|
}();
|
|
599
599
|
exports$1.default = Parser;
|
|
600
|
-
}, function(
|
|
600
|
+
}, function(p, g, o) {
|
|
601
601
|
Object.defineProperty(g, "__esModule", { value: !0 });
|
|
602
|
-
var t, r,
|
|
603
|
-
(function(
|
|
604
|
-
|
|
605
|
-
})(t || (t = {})), function(
|
|
606
|
-
|
|
607
|
-
}(r || (r = {})), function(
|
|
608
|
-
|
|
609
|
-
}(
|
|
610
|
-
var
|
|
611
|
-
function
|
|
612
|
-
if (this.videoItem =
|
|
602
|
+
var t, r, h, l = o(5), u = o(9);
|
|
603
|
+
(function(f) {
|
|
604
|
+
f.START = "start", f.RESUME = "resume", f.PROCESS = "process", f.PAUSE = "pause", f.STOP = "stop", f.END = "end", f.CLEAR = "clear";
|
|
605
|
+
})(t || (t = {})), function(f) {
|
|
606
|
+
f.FORWARDS = "forwards", f.BACKWARDS = "backwards";
|
|
607
|
+
}(r || (r = {})), function(f) {
|
|
608
|
+
f.FORWARDS = "forwards", f.FALLBACKS = "fallbacks";
|
|
609
|
+
}(h || (h = {}));
|
|
610
|
+
var c = typeof window < "u" && "IntersectionObserver" in window, n = function() {
|
|
611
|
+
function f(i, y, a) {
|
|
612
|
+
if (this.videoItem = y, this.loop = !0, this.fillMode = r.FORWARDS, this.playMode = h.FORWARDS, this.progress = 0, this.currentFrame = 0, this.totalFramesCount = 0, this.startFrame = 0, this.endFrame = 0, this.cacheFrames = !1, this.intersectionObserverRender = !1, this.intersectionObserverRenderShow = !0, this._intersectionObserver = null, this.$onEvent = { start: function() {
|
|
613
613
|
}, resume: function() {
|
|
614
614
|
}, process: function() {
|
|
615
615
|
}, pause: function() {
|
|
@@ -618,242 +618,242 @@ var svga_lite_min = { exports: {} };
|
|
|
618
618
|
}, clear: function() {
|
|
619
619
|
} }, this.container = typeof i == "string" ? document.body.querySelector(i) : i, !this.container) throw new Error("container undefined.");
|
|
620
620
|
if (!this.container.getContext) throw new Error("container should be HTMLCanvasElement.");
|
|
621
|
-
this._renderer = new
|
|
621
|
+
this._renderer = new l.default(this), this._animator = new u.default(), this.videoItem && this.mount(y), a && this.set(a);
|
|
622
622
|
}
|
|
623
|
-
return
|
|
624
|
-
var
|
|
625
|
-
i.loop !== void 0 && (this.loop = i.loop), i.fillMode && (this.fillMode = i.fillMode), i.playMode && (this.playMode = i.playMode), i.cacheFrames !== void 0 && (this.cacheFrames = i.cacheFrames), this.startFrame = i.startFrame ? i.startFrame : this.startFrame, this.endFrame = i.endFrame ? i.endFrame : this.endFrame, i.intersectionObserverRender !== void 0 && (this.intersectionObserverRender = i.intersectionObserverRender),
|
|
626
|
-
|
|
623
|
+
return f.prototype.set = function(i) {
|
|
624
|
+
var y = this;
|
|
625
|
+
i.loop !== void 0 && (this.loop = i.loop), i.fillMode && (this.fillMode = i.fillMode), i.playMode && (this.playMode = i.playMode), i.cacheFrames !== void 0 && (this.cacheFrames = i.cacheFrames), this.startFrame = i.startFrame ? i.startFrame : this.startFrame, this.endFrame = i.endFrame ? i.endFrame : this.endFrame, i.intersectionObserverRender !== void 0 && (this.intersectionObserverRender = i.intersectionObserverRender), c && this.intersectionObserverRender ? (this._intersectionObserver = new IntersectionObserver(function(a) {
|
|
626
|
+
a[0].intersectionRatio <= 0 ? y.intersectionObserverRenderShow && (y.intersectionObserverRenderShow = !1) : !y.intersectionObserverRenderShow && (y.intersectionObserverRenderShow = !0);
|
|
627
627
|
}, { rootMargin: "0px", threshold: [0, 0.5, 1] }), this._intersectionObserver.observe(this.container)) : (this._intersectionObserver && this._intersectionObserver.disconnect(), this.intersectionObserverRender = !1, this.intersectionObserverRenderShow = !0), this._animator.noExecutionDelay = i.noExecutionDelay;
|
|
628
|
-
},
|
|
629
|
-
var
|
|
630
|
-
return new Promise(function(
|
|
631
|
-
|
|
628
|
+
}, f.prototype.mount = function(i) {
|
|
629
|
+
var y = this;
|
|
630
|
+
return new Promise(function(a, b) {
|
|
631
|
+
y.currentFrame = 0, y.progress = 0, y.totalFramesCount = i.frames - 1, y.videoItem = i, y._renderer.prepare().then(a), y._renderer.clear(), y._setSize();
|
|
632
632
|
});
|
|
633
|
-
},
|
|
633
|
+
}, f.prototype.start = function() {
|
|
634
634
|
if (!this.videoItem) throw new Error("video item undefined.");
|
|
635
635
|
this._renderer.clear(), this._startAnimation(), this.$onEvent.start();
|
|
636
|
-
},
|
|
636
|
+
}, f.prototype.resume = function() {
|
|
637
637
|
if (!this.videoItem) throw new Error("video item undefined.");
|
|
638
638
|
this._startAnimation(), this.$onEvent.resume();
|
|
639
|
-
},
|
|
639
|
+
}, f.prototype.pause = function() {
|
|
640
640
|
this._animator && this._animator.stop(), this.$onEvent.pause();
|
|
641
|
-
},
|
|
641
|
+
}, f.prototype.stop = function() {
|
|
642
642
|
this._animator && this._animator.stop(), this.currentFrame = 0, this._renderer.drawFrame(this.currentFrame), this.$onEvent.stop();
|
|
643
|
-
},
|
|
643
|
+
}, f.prototype.clear = function() {
|
|
644
644
|
this._animator && this._animator.stop(), this._renderer.clear(), this.$onEvent.clear();
|
|
645
|
-
},
|
|
645
|
+
}, f.prototype.destroy = function() {
|
|
646
646
|
this._animator && this._animator.stop(), this._renderer.clear(), this._animator = null, this._renderer = null, this.videoItem = null;
|
|
647
|
-
},
|
|
648
|
-
var
|
|
649
|
-
return this.$onEvent[i] =
|
|
650
|
-
return
|
|
647
|
+
}, f.prototype.$on = function(i, y) {
|
|
648
|
+
var a = this;
|
|
649
|
+
return this.$onEvent[i] = y, i === "end" && (this._animator.onEnd = function() {
|
|
650
|
+
return a.$onEvent.end();
|
|
651
651
|
}), this;
|
|
652
|
-
},
|
|
653
|
-
var i = this,
|
|
654
|
-
this.currentFrame ===
|
|
655
|
-
var e =
|
|
656
|
-
|
|
657
|
-
|
|
652
|
+
}, f.prototype._startAnimation = function() {
|
|
653
|
+
var i = this, y = this, a = y.playMode, b = y.totalFramesCount, w = y.startFrame, s = y.endFrame, d = y.videoItem;
|
|
654
|
+
this.currentFrame === b && (this.currentFrame = w || 0), this._animator.startValue = a === "fallbacks" ? s || b : w || 0, this._animator.endValue = a === "fallbacks" ? w || 0 : s || b;
|
|
655
|
+
var e = d.frames;
|
|
656
|
+
s > 0 && s > w ? e = s - w : s <= 0 && w > 0 && (e = d.frames - w), this._animator.duration = e * (1 / d.FPS) * 1e3, this._animator.loop = this.loop === !0 || this.loop <= 0 ? 1 / 0 : this.loop === !1 ? 1 : this.loop, this._animator.fillRule = this.fillMode === "backwards" ? 1 : 0, this._animator.onUpdate = function(x) {
|
|
657
|
+
x = Math.floor(x), i.currentFrame !== x && (i.currentFrame = x, i.progress = parseFloat((x + 1).toString()) / parseFloat(d.frames.toString()) * 100, i._renderer.drawFrame(i.currentFrame), i.$onEvent.process());
|
|
658
658
|
}, this._animator.start(this.currentFrame);
|
|
659
|
-
},
|
|
659
|
+
}, f.prototype._setSize = function() {
|
|
660
660
|
var i = this.videoItem.videoSize;
|
|
661
661
|
this.container.width = i.width, this.container.height = i.height;
|
|
662
|
-
},
|
|
662
|
+
}, f;
|
|
663
663
|
}();
|
|
664
|
-
g.default =
|
|
665
|
-
}, function(
|
|
664
|
+
g.default = n;
|
|
665
|
+
}, function(p, g, o) {
|
|
666
666
|
Object.defineProperty(g, "__esModule", { value: !0 });
|
|
667
|
-
var t =
|
|
668
|
-
function
|
|
669
|
-
this._bitmapCache = {}, this._dynamicElements = {}, this._frames = {}, this._player =
|
|
670
|
-
var
|
|
671
|
-
this._ofsCanvas = window.OffscreenCanvas ? new window.OffscreenCanvas(
|
|
667
|
+
var t = o(6), r = function() {
|
|
668
|
+
function h(l) {
|
|
669
|
+
this._bitmapCache = {}, this._dynamicElements = {}, this._frames = {}, this._player = l;
|
|
670
|
+
var u = this._player.container;
|
|
671
|
+
this._ofsCanvas = window.OffscreenCanvas ? new window.OffscreenCanvas(u.width, u.height) : document.createElement("canvas");
|
|
672
672
|
}
|
|
673
|
-
return
|
|
674
|
-
var
|
|
675
|
-
return new Promise(function(
|
|
676
|
-
if (
|
|
677
|
-
|
|
678
|
-
var
|
|
679
|
-
for (var i in
|
|
680
|
-
var
|
|
681
|
-
if (typeof
|
|
673
|
+
return h.prototype.prepare = function() {
|
|
674
|
+
var l = this;
|
|
675
|
+
return new Promise(function(u, c) {
|
|
676
|
+
if (l._bitmapCache = {}, l._player.videoItem.images && Object.keys(l._player.videoItem.images).length != 0) {
|
|
677
|
+
l._player.videoItem.dynamicElements && (l._dynamicElements = l._player.videoItem.dynamicElements);
|
|
678
|
+
var n = 0, f = 0;
|
|
679
|
+
for (var i in l._player.videoItem.images) {
|
|
680
|
+
var y = l._player.videoItem.images[i];
|
|
681
|
+
if (typeof y != "string" || y.indexOf("iVBO") !== 0 && y.indexOf("/9j/2w") !== 0) l._bitmapCache[i] = y;
|
|
682
682
|
else {
|
|
683
|
-
|
|
684
|
-
var
|
|
685
|
-
|
|
686
|
-
++
|
|
683
|
+
n++;
|
|
684
|
+
var a = document.createElement("img");
|
|
685
|
+
a.src = "data:image/png;base64," + y, l._bitmapCache[i] = a, a.onload = function() {
|
|
686
|
+
++f === n && u();
|
|
687
687
|
};
|
|
688
688
|
}
|
|
689
689
|
}
|
|
690
|
-
} else
|
|
690
|
+
} else u();
|
|
691
691
|
});
|
|
692
|
-
},
|
|
692
|
+
}, h.prototype.clear = function() {
|
|
693
693
|
this._player.container.width = this._player.container.width;
|
|
694
|
-
},
|
|
695
|
-
var
|
|
696
|
-
if (!
|
|
694
|
+
}, h.prototype.drawFrame = function(l) {
|
|
695
|
+
var u = this._player;
|
|
696
|
+
if (!u.intersectionObserverRender || u.intersectionObserverRenderShow) {
|
|
697
697
|
this.clear();
|
|
698
|
-
var
|
|
699
|
-
if (this._player.cacheFrames && this._frames[
|
|
700
|
-
var
|
|
701
|
-
|
|
698
|
+
var c = u.container.getContext("2d");
|
|
699
|
+
if (this._player.cacheFrames && this._frames[l]) {
|
|
700
|
+
var n = this._frames[l];
|
|
701
|
+
c.drawImage(n, 0, 0, n.width, n.height, 0, 0, n.width, n.height);
|
|
702
702
|
} else {
|
|
703
|
-
var
|
|
704
|
-
if (
|
|
705
|
-
var i =
|
|
706
|
-
|
|
707
|
-
} else this._frames[
|
|
703
|
+
var f = this._ofsCanvas;
|
|
704
|
+
if (f.width = this._player.container.width, f.height = this._player.container.height, t.default(f, this._bitmapCache, this._dynamicElements, this._player.videoItem, this._player.currentFrame), c.drawImage(f, 0, 0, f.width, f.height, 0, 0, f.width, f.height), this._player.cacheFrames) if ("toDataURL" in f) {
|
|
705
|
+
var i = f.toDataURL(), y = new Image();
|
|
706
|
+
y.src = i, this._frames[l] = y;
|
|
707
|
+
} else this._frames[l] = f.transferToImageBitmap();
|
|
708
708
|
}
|
|
709
709
|
}
|
|
710
|
-
},
|
|
710
|
+
}, h;
|
|
711
711
|
}();
|
|
712
712
|
g.default = r;
|
|
713
|
-
}, function(
|
|
713
|
+
}, function(p, g, o) {
|
|
714
714
|
Object.defineProperty(g, "__esModule", { value: !0 }), g.default = void 0;
|
|
715
|
-
var t =
|
|
716
|
-
function
|
|
715
|
+
var t = l(o(0)), r = l(o(7)), h = l(o(8));
|
|
716
|
+
function l(i) {
|
|
717
717
|
return i && i.__esModule ? i : { default: i };
|
|
718
718
|
}
|
|
719
|
-
var
|
|
720
|
-
function
|
|
721
|
-
var
|
|
722
|
-
|
|
719
|
+
var u = "MLHVCSQRZmlhvcsqrz";
|
|
720
|
+
function c(i, y) {
|
|
721
|
+
var a = y._styles;
|
|
722
|
+
a !== void 0 && (a && a.stroke ? i.strokeStyle = "rgba(".concat(parseInt((255 * a.stroke[0]).toString()), ", ").concat(parseInt((255 * a.stroke[1]).toString()), ", ").concat(parseInt((255 * a.stroke[2]).toString()), ", ").concat(a.stroke[3], ")") : i.strokeStyle = "transparent", a && (i.lineWidth = a.strokeWidth || void 0, i.lineCap = a.lineCap || void 0, i.lineJoin = a.lineJoin || void 0, i.miterLimit = a.miterLimit || void 0), a && a.fill ? i.fillStyle = "rgba(".concat(parseInt((255 * a.fill[0]).toString()), ", ").concat(parseInt((255 * a.fill[1]).toString()), ", ").concat(parseInt((255 * a.fill[2]).toString()), ", ").concat(a.fill[3], ")") : i.fillStyle = "transparent", a && a.lineDash && i.setLineDash(a.lineDash));
|
|
723
723
|
}
|
|
724
|
-
function
|
|
725
|
-
i.save(),
|
|
726
|
-
var
|
|
727
|
-
i.beginPath(),
|
|
728
|
-
if (
|
|
729
|
-
var
|
|
730
|
-
if (
|
|
731
|
-
var
|
|
732
|
-
(function(
|
|
733
|
-
switch (
|
|
724
|
+
function n(i, y) {
|
|
725
|
+
i.save(), c(i, y), y._transform !== void 0 && y._transform !== null && i.transform(y._transform.a || 1, y._transform.b || 0, y._transform.c || 0, y._transform.d || 1, y._transform.tx || 0, y._transform.ty || 0);
|
|
726
|
+
var a = { x: 0, y: 0, x1: 0, y1: 0, x2: 0, y2: 0 };
|
|
727
|
+
i.beginPath(), y._d.replace(/([a-zA-Z])/g, "|||$1 ").replace(/,/g, " ").split("|||").forEach(function(b) {
|
|
728
|
+
if (b.length != 0) {
|
|
729
|
+
var w = b.substr(0, 1);
|
|
730
|
+
if (u.indexOf(w) >= 0) {
|
|
731
|
+
var s = b.substr(1).trim().split(" ");
|
|
732
|
+
(function(d, e, x, v) {
|
|
733
|
+
switch (x) {
|
|
734
734
|
case "M":
|
|
735
|
-
e.x = Number(
|
|
735
|
+
e.x = Number(v[0]), e.y = Number(v[1]), d.moveTo(e.x, e.y);
|
|
736
736
|
break;
|
|
737
737
|
case "m":
|
|
738
|
-
e.x += Number(
|
|
738
|
+
e.x += Number(v[0]), e.y += Number(v[1]), d.moveTo(e.x, e.y);
|
|
739
739
|
break;
|
|
740
740
|
case "L":
|
|
741
|
-
e.x = Number(
|
|
741
|
+
e.x = Number(v[0]), e.y = Number(v[1]), d.lineTo(e.x, e.y);
|
|
742
742
|
break;
|
|
743
743
|
case "l":
|
|
744
|
-
e.x += Number(
|
|
744
|
+
e.x += Number(v[0]), e.y += Number(v[1]), d.lineTo(e.x, e.y);
|
|
745
745
|
break;
|
|
746
746
|
case "H":
|
|
747
|
-
e.x = Number(
|
|
747
|
+
e.x = Number(v[0]), d.lineTo(e.x, e.y);
|
|
748
748
|
break;
|
|
749
749
|
case "h":
|
|
750
|
-
e.x += Number(
|
|
750
|
+
e.x += Number(v[0]), d.lineTo(e.x, e.y);
|
|
751
751
|
break;
|
|
752
752
|
case "V":
|
|
753
|
-
e.y = Number(
|
|
753
|
+
e.y = Number(v[0]), d.lineTo(e.x, e.y);
|
|
754
754
|
break;
|
|
755
755
|
case "v":
|
|
756
|
-
e.y += Number(
|
|
756
|
+
e.y += Number(v[0]), d.lineTo(e.x, e.y);
|
|
757
757
|
break;
|
|
758
758
|
case "C":
|
|
759
|
-
e.x1 = Number(
|
|
759
|
+
e.x1 = Number(v[0]), e.y1 = Number(v[1]), e.x2 = Number(v[2]), e.y2 = Number(v[3]), e.x = Number(v[4]), e.y = Number(v[5]), d.bezierCurveTo(e.x1, e.y1, e.x2, e.y2, e.x, e.y);
|
|
760
760
|
break;
|
|
761
761
|
case "c":
|
|
762
|
-
e.x1 = e.x + Number(
|
|
762
|
+
e.x1 = e.x + Number(v[0]), e.y1 = e.y + Number(v[1]), e.x2 = e.x + Number(v[2]), e.y2 = e.y + Number(v[3]), e.x += Number(v[4]), e.y += Number(v[5]), d.bezierCurveTo(e.x1, e.y1, e.x2, e.y2, e.x, e.y);
|
|
763
763
|
break;
|
|
764
764
|
case "S":
|
|
765
|
-
e.x1 && e.y1 && e.x2 && e.y2 ? (e.x1 = e.x - e.x2 + e.x, e.y1 = e.y - e.y2 + e.y, e.x2 = Number(
|
|
765
|
+
e.x1 && e.y1 && e.x2 && e.y2 ? (e.x1 = e.x - e.x2 + e.x, e.y1 = e.y - e.y2 + e.y, e.x2 = Number(v[0]), e.y2 = Number(v[1]), e.x = Number(v[2]), e.y = Number(v[3]), d.bezierCurveTo(e.x1, e.y1, e.x2, e.y2, e.x, e.y)) : (e.x1 = Number(v[0]), e.y1 = Number(v[1]), e.x = Number(v[2]), e.y = Number(v[3]), d.quadraticCurveTo(e.x1, e.y1, e.x, e.y));
|
|
766
766
|
break;
|
|
767
767
|
case "s":
|
|
768
|
-
e.x1 && e.y1 && e.x2 && e.y2 ? (e.x1 = e.x - e.x2 + e.x, e.y1 = e.y - e.y2 + e.y, e.x2 = e.x + Number(
|
|
768
|
+
e.x1 && e.y1 && e.x2 && e.y2 ? (e.x1 = e.x - e.x2 + e.x, e.y1 = e.y - e.y2 + e.y, e.x2 = e.x + Number(v[0]), e.y2 = e.y + Number(v[1]), e.x += Number(v[2]), e.y += Number(v[3]), d.bezierCurveTo(e.x1, e.y1, e.x2, e.y2, e.x, e.y)) : (e.x1 = e.x + Number(v[0]), e.y1 = e.y + Number(v[1]), e.x += Number(v[2]), e.y += Number(v[3]), d.quadraticCurveTo(e.x1, e.y1, e.x, e.y));
|
|
769
769
|
break;
|
|
770
770
|
case "Q":
|
|
771
|
-
e.x1 = Number(
|
|
771
|
+
e.x1 = Number(v[0]), e.y1 = Number(v[1]), e.x = Number(v[2]), e.y = Number(v[3]), d.quadraticCurveTo(e.x1, e.y1, e.x, e.y);
|
|
772
772
|
break;
|
|
773
773
|
case "q":
|
|
774
|
-
e.x1 = e.x + Number(
|
|
774
|
+
e.x1 = e.x + Number(v[0]), e.y1 = e.y + Number(v[1]), e.x += Number(v[2]), e.y += Number(v[3]), d.quadraticCurveTo(e.x1, e.y1, e.x, e.y);
|
|
775
775
|
break;
|
|
776
776
|
case "A":
|
|
777
777
|
case "a":
|
|
778
778
|
break;
|
|
779
779
|
case "Z":
|
|
780
780
|
case "z":
|
|
781
|
-
|
|
781
|
+
d.closePath();
|
|
782
782
|
}
|
|
783
|
-
})(i,
|
|
783
|
+
})(i, a, w, s);
|
|
784
784
|
}
|
|
785
785
|
}
|
|
786
|
-
}),
|
|
786
|
+
}), y._styles && y._styles.fill ? i.fill() : y._styles && y._styles.stroke && i.stroke(), i.restore();
|
|
787
787
|
}
|
|
788
|
-
var
|
|
789
|
-
var
|
|
790
|
-
return
|
|
791
|
-
var e =
|
|
788
|
+
var f = function(i, y, a, b, w) {
|
|
789
|
+
var s = i.getContext("2d");
|
|
790
|
+
return b.sprites.forEach(function(d) {
|
|
791
|
+
var e = d.frames[w];
|
|
792
792
|
if (!(e.alpha < 0.05)) {
|
|
793
|
-
|
|
794
|
-
var
|
|
795
|
-
|
|
796
|
-
var
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
var
|
|
801
|
-
|
|
802
|
-
}(
|
|
803
|
-
|
|
804
|
-
var
|
|
805
|
-
|
|
806
|
-
}(
|
|
807
|
-
}),
|
|
793
|
+
s.save(), s.globalAlpha = e.alpha, s.transform(e.transform.a || 1, e.transform.b || 0, e.transform.c || 0, e.transform.d || 1, e.transform.tx || 0, e.transform.ty || 0);
|
|
794
|
+
var x = y[d.imageKey];
|
|
795
|
+
x && (e.maskPath !== void 0 && e.maskPath !== null && (e.maskPath._styles = void 0, n(s, e.maskPath), s.clip()), s.drawImage(x, 0, 0));
|
|
796
|
+
var v = a[d.imageKey];
|
|
797
|
+
v && s.drawImage(v, (e.layout.width - v.width) / 2, (e.layout.height - v.height) / 2), e.shapes && e.shapes.forEach(function(_) {
|
|
798
|
+
_.type === "shape" && _.pathArgs && _.pathArgs.d ? n(s, new t.default(_.pathArgs.d, _.transform, _.styles)) : _.type === "ellipse" && _.pathArgs ? function(E, S) {
|
|
799
|
+
E.save(), c(E, S), S._transform !== void 0 && S._transform !== null && E.transform(S._transform.a || 1, S._transform.b || 0, S._transform.c || 0, S._transform.d || 1, S._transform.tx || 0, S._transform.ty || 0);
|
|
800
|
+
var O = S._x - S._radiusX, T = S._y - S._radiusY, I = 2 * S._radiusX, C = 2 * S._radiusY, B = I / 2 * 0.5522848, $ = C / 2 * 0.5522848, R = O + I, V = T + C, M = O + I / 2, F = T + C / 2;
|
|
801
|
+
E.beginPath(), E.moveTo(O, F), E.bezierCurveTo(O, F - $, M - B, T, M, T), E.bezierCurveTo(M + B, T, R, F - $, R, F), E.bezierCurveTo(R, F + $, M + B, V, M, V), E.bezierCurveTo(M - B, V, O, F + $, O, F), S._styles && S._styles.fill ? E.fill() : S._styles && S._styles.stroke && E.stroke(), E.restore();
|
|
802
|
+
}(s, new r.default(parseFloat(_.pathArgs.x) || 0, parseFloat(_.pathArgs.y) || 0, parseFloat(_.pathArgs.radiusX) || 0, parseFloat(_.pathArgs.radiusY) || 0, _.transform, _.styles)) : _.type === "rect" && _.pathArgs && function(E, S) {
|
|
803
|
+
E.save(), c(E, S), S._transform !== void 0 && S._transform !== null && E.transform(S._transform.a || 1, S._transform.b || 0, S._transform.c || 0, S._transform.d || 1, S._transform.tx || 0, S._transform.ty || 0);
|
|
804
|
+
var O = S._x, T = S._y, I = S._width, C = S._height, B = S._cornerRadius;
|
|
805
|
+
I < 2 * B && (B = I / 2), C < 2 * B && (B = C / 2), E.beginPath(), E.moveTo(O + B, T), E.arcTo(O + I, T, O + I, T + C, B), E.arcTo(O + I, T + C, O, T + C, B), E.arcTo(O, T + C, O, T, B), E.arcTo(O, T, O + I, T, B), E.closePath(), S._styles && S._styles.fill ? E.fill() : S._styles && S._styles.stroke && E.stroke(), E.restore();
|
|
806
|
+
}(s, new h.default(parseFloat(_.pathArgs.x) || 0, parseFloat(_.pathArgs.y) || 0, parseFloat(_.pathArgs.width) || 0, parseFloat(_.pathArgs.height) || 0, parseFloat(_.pathArgs.cornerRadius) || 0, _.transform, _.styles));
|
|
807
|
+
}), s.restore();
|
|
808
808
|
}
|
|
809
809
|
}), i;
|
|
810
810
|
};
|
|
811
|
-
g.default =
|
|
812
|
-
}, function(
|
|
813
|
-
var t, r = (t = function(
|
|
814
|
-
return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(
|
|
815
|
-
|
|
816
|
-
} || function(
|
|
817
|
-
for (var
|
|
818
|
-
})(
|
|
819
|
-
}, function(
|
|
820
|
-
function
|
|
821
|
-
this.constructor =
|
|
811
|
+
g.default = f;
|
|
812
|
+
}, function(p, g, o) {
|
|
813
|
+
var t, r = (t = function(l, u) {
|
|
814
|
+
return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(c, n) {
|
|
815
|
+
c.__proto__ = n;
|
|
816
|
+
} || function(c, n) {
|
|
817
|
+
for (var f in n) Object.prototype.hasOwnProperty.call(n, f) && (c[f] = n[f]);
|
|
818
|
+
})(l, u);
|
|
819
|
+
}, function(l, u) {
|
|
820
|
+
function c() {
|
|
821
|
+
this.constructor = l;
|
|
822
822
|
}
|
|
823
|
-
t(
|
|
823
|
+
t(l, u), l.prototype = u === null ? Object.create(u) : (c.prototype = u.prototype, new c());
|
|
824
824
|
});
|
|
825
825
|
Object.defineProperty(g, "__esModule", { value: !0 });
|
|
826
|
-
var
|
|
827
|
-
function
|
|
828
|
-
var
|
|
829
|
-
return
|
|
826
|
+
var h = function(l) {
|
|
827
|
+
function u(c, n, f, i, y, a) {
|
|
828
|
+
var b = l.call(this) || this;
|
|
829
|
+
return b._x = c, b._y = n, b._radiusX = f, b._radiusY = i, b._transform = y, b._styles = a, b;
|
|
830
830
|
}
|
|
831
|
-
return r(
|
|
832
|
-
}(
|
|
833
|
-
g.default =
|
|
834
|
-
}, function(
|
|
835
|
-
var t, r = (t = function(
|
|
836
|
-
return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(
|
|
837
|
-
|
|
838
|
-
} || function(
|
|
839
|
-
for (var
|
|
840
|
-
})(
|
|
841
|
-
}, function(
|
|
842
|
-
function
|
|
843
|
-
this.constructor =
|
|
831
|
+
return r(u, l), u;
|
|
832
|
+
}(o(0).default);
|
|
833
|
+
g.default = h;
|
|
834
|
+
}, function(p, g, o) {
|
|
835
|
+
var t, r = (t = function(l, u) {
|
|
836
|
+
return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(c, n) {
|
|
837
|
+
c.__proto__ = n;
|
|
838
|
+
} || function(c, n) {
|
|
839
|
+
for (var f in n) Object.prototype.hasOwnProperty.call(n, f) && (c[f] = n[f]);
|
|
840
|
+
})(l, u);
|
|
841
|
+
}, function(l, u) {
|
|
842
|
+
function c() {
|
|
843
|
+
this.constructor = l;
|
|
844
844
|
}
|
|
845
|
-
t(
|
|
845
|
+
t(l, u), l.prototype = u === null ? Object.create(u) : (c.prototype = u.prototype, new c());
|
|
846
846
|
});
|
|
847
847
|
Object.defineProperty(g, "__esModule", { value: !0 });
|
|
848
|
-
var
|
|
849
|
-
function
|
|
850
|
-
var
|
|
851
|
-
return
|
|
848
|
+
var h = function(l) {
|
|
849
|
+
function u(c, n, f, i, y, a, b) {
|
|
850
|
+
var w = l.call(this) || this;
|
|
851
|
+
return w._x = c, w._y = n, w._width = f, w._height = i, w._cornerRadius = y, w._transform = a, w._styles = b, w;
|
|
852
852
|
}
|
|
853
|
-
return r(
|
|
854
|
-
}(
|
|
855
|
-
g.default =
|
|
856
|
-
}, function(
|
|
853
|
+
return r(u, l), u;
|
|
854
|
+
}(o(0).default);
|
|
855
|
+
g.default = h;
|
|
856
|
+
}, function(p, g, o) {
|
|
857
857
|
Object.defineProperty(g, "__esModule", { value: !0 });
|
|
858
858
|
var t = function() {
|
|
859
859
|
function r() {
|
|
@@ -864,22 +864,22 @@ var svga_lite_min = { exports: {} };
|
|
|
864
864
|
}, this.onEnd = function() {
|
|
865
865
|
}, this._isRunning = !1, this._mStartTime = 0, this._currentFrication = 0, this._worker = null;
|
|
866
866
|
}
|
|
867
|
-
return r.prototype.start = function(
|
|
868
|
-
this.doStart(
|
|
867
|
+
return r.prototype.start = function(h) {
|
|
868
|
+
this.doStart(h);
|
|
869
869
|
}, r.prototype.stop = function() {
|
|
870
870
|
this._doStop();
|
|
871
871
|
}, Object.defineProperty(r.prototype, "animatedValue", { get: function() {
|
|
872
872
|
return (this.endValue - this.startValue) * this._currentFrication + this.startValue;
|
|
873
|
-
}, enumerable: !1, configurable: !0 }), r.prototype.doStart = function(
|
|
874
|
-
this._isRunning = !0, this._mStartTime = this._currentTimeMillsecond(),
|
|
873
|
+
}, enumerable: !1, configurable: !0 }), r.prototype.doStart = function(h) {
|
|
874
|
+
this._isRunning = !0, this._mStartTime = this._currentTimeMillsecond(), h && (this._mStartTime -= h / (this.endValue - this.startValue) * this.duration), this._currentFrication = 0, this.noExecutionDelay && this._worker === null && (this._worker = new Worker(window.URL.createObjectURL(new Blob([`onmessage = function () {
|
|
875
875
|
setTimeout(function() {postMessage(null)}, 1 / 60)
|
|
876
876
|
}`])))), this.onStart(), this._doFrame();
|
|
877
877
|
}, r.prototype._doStop = function() {
|
|
878
878
|
this._isRunning = !1, this._worker !== null && (this._worker.terminate(), this._worker = null);
|
|
879
879
|
}, r.prototype._doFrame = function() {
|
|
880
880
|
this._isRunning && (this._doDeltaTime(this._currentTimeMillsecond() - this._mStartTime), this._isRunning && (this._worker ? (this._worker.onmessage = this._doFrame.bind(this), this._worker.postMessage(null)) : window.requestAnimationFrame(this._doFrame.bind(this))));
|
|
881
|
-
}, r.prototype._doDeltaTime = function(
|
|
882
|
-
|
|
881
|
+
}, r.prototype._doDeltaTime = function(h) {
|
|
882
|
+
h >= this.duration * this.loop ? (this._currentFrication = this.fillRule === 1 ? 0 : 1, this._isRunning = !1) : this._currentFrication = h % this.duration / this.duration, this.onUpdate(this.animatedValue), this._isRunning === !1 && (this._worker !== null && (this._worker.terminate(), this._worker = null), this.onEnd());
|
|
883
883
|
}, r;
|
|
884
884
|
}();
|
|
885
885
|
g.default = t;
|
|
@@ -887,7 +887,7 @@ var svga_lite_min = { exports: {} };
|
|
|
887
887
|
});
|
|
888
888
|
})(svga_lite_min);
|
|
889
889
|
var svga_lite_minExports = svga_lite_min.exports;
|
|
890
|
-
const _sfc_main$
|
|
890
|
+
const _sfc_main$3 = {
|
|
891
891
|
__name: "hbis-svgaPlayer",
|
|
892
892
|
props: {
|
|
893
893
|
/**
|
|
@@ -966,67 +966,221 @@ const _sfc_main$1 = {
|
|
|
966
966
|
*/
|
|
967
967
|
"error"
|
|
968
968
|
],
|
|
969
|
-
setup(
|
|
969
|
+
setup(p, { expose: g, emit: o }) {
|
|
970
970
|
useCssVars((e) => ({
|
|
971
|
-
v5ce75b7f:
|
|
972
|
-
v26351a8e:
|
|
971
|
+
v5ce75b7f: p.width,
|
|
972
|
+
v26351a8e: p.height
|
|
973
973
|
}));
|
|
974
|
-
const t =
|
|
975
|
-
let
|
|
976
|
-
const
|
|
974
|
+
const t = p, r = o, h = ref(null), l = ref(null);
|
|
975
|
+
let u = null, c = null, n = null;
|
|
976
|
+
const f = async () => {
|
|
977
977
|
try {
|
|
978
|
-
|
|
978
|
+
u = new svga_lite_minExports.Parser(), n = await u.load(t.src), c = new svga_lite_minExports.Player(l.value), c.loop = t.loop, c.speed = t.speed, c.onStart = () => r("play"), c.onPause = () => r("pause"), c.onEnd = () => r("ended"), c.onFrame = () => r("progress", c.progress), await c.setAnimationData(n), t.progress > 0 && (c.progress = t.progress), t.autoplay && c.start(), r("loaded");
|
|
979
979
|
} catch (e) {
|
|
980
980
|
console.error("SVGA 加载失败:", e), r("error", e);
|
|
981
981
|
}
|
|
982
982
|
}, i = () => {
|
|
983
|
-
|
|
984
|
-
},
|
|
985
|
-
|
|
986
|
-
},
|
|
987
|
-
|
|
988
|
-
},
|
|
989
|
-
|
|
990
|
-
},
|
|
991
|
-
|
|
992
|
-
},
|
|
993
|
-
|
|
994
|
-
},
|
|
995
|
-
|
|
983
|
+
c && c.start();
|
|
984
|
+
}, y = () => {
|
|
985
|
+
c && c.pause();
|
|
986
|
+
}, a = () => {
|
|
987
|
+
c && c.stop();
|
|
988
|
+
}, b = () => {
|
|
989
|
+
c && (c.stop(), c.start());
|
|
990
|
+
}, w = (e) => {
|
|
991
|
+
c && (c.progress = e);
|
|
992
|
+
}, s = (e) => {
|
|
993
|
+
c && (c.speed = e);
|
|
994
|
+
}, d = (e) => {
|
|
995
|
+
c && (c.loop = e);
|
|
996
996
|
};
|
|
997
997
|
return g({
|
|
998
998
|
play: i,
|
|
999
|
-
pause:
|
|
1000
|
-
stop:
|
|
1001
|
-
restart:
|
|
1002
|
-
setProgress:
|
|
1003
|
-
setSpeed:
|
|
1004
|
-
setLoop:
|
|
999
|
+
pause: y,
|
|
1000
|
+
stop: a,
|
|
1001
|
+
restart: b,
|
|
1002
|
+
setProgress: w,
|
|
1003
|
+
setSpeed: s,
|
|
1004
|
+
setLoop: d
|
|
1005
1005
|
}), watch(() => t.src, async (e) => {
|
|
1006
|
-
e && await
|
|
1006
|
+
e && await f();
|
|
1007
1007
|
}), watch(() => t.loop, (e) => {
|
|
1008
|
-
|
|
1008
|
+
d(e);
|
|
1009
1009
|
}), watch(() => t.speed, (e) => {
|
|
1010
|
-
|
|
1010
|
+
s(e);
|
|
1011
1011
|
}), watch(() => t.progress, (e) => {
|
|
1012
|
-
|
|
1012
|
+
w(e);
|
|
1013
1013
|
}), onMounted(async () => {
|
|
1014
|
-
await nextTick(), await
|
|
1014
|
+
await nextTick(), await f();
|
|
1015
1015
|
}), onUnmounted(() => {
|
|
1016
|
-
|
|
1017
|
-
}), (e,
|
|
1016
|
+
c && (c.stop(), c = null), u && (u = null), n = null;
|
|
1017
|
+
}), (e, x) => (openBlock(), createElementBlock("div", {
|
|
1018
1018
|
ref_key: "containerRef",
|
|
1019
|
-
ref:
|
|
1019
|
+
ref: h,
|
|
1020
1020
|
class: "svga-player-container"
|
|
1021
1021
|
}, [
|
|
1022
1022
|
createElementVNode("canvas", {
|
|
1023
1023
|
ref_key: "canvasRef",
|
|
1024
|
-
ref:
|
|
1024
|
+
ref: l,
|
|
1025
1025
|
class: "svga-player-canvas"
|
|
1026
1026
|
}, null, 512)
|
|
1027
1027
|
], 512));
|
|
1028
1028
|
}
|
|
1029
|
-
}, HbisSvgaPlayer = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1029
|
+
}, HbisSvgaPlayer = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-6b83dcf1"]]), _hoisted_1$1 = { class: "waterfall-debug" }, _hoisted_2$1 = { class: "waterfall-container" }, _hoisted_3$1 = { class: "column-debug" }, _hoisted_4$1 = {
|
|
1030
|
+
key: 0,
|
|
1031
|
+
class: "waterfall-item-with-slot"
|
|
1032
|
+
}, _hoisted_5$1 = ["src"], _hoisted_6 = { class: "waterfall-content" }, _hoisted_7 = ["src"], _sfc_main$2 = /* @__PURE__ */ Object.assign({
|
|
1033
|
+
name: "HbisWaterfall"
|
|
1034
|
+
}, {
|
|
1035
|
+
__name: "hbis-waterfall",
|
|
1036
|
+
props: {
|
|
1037
|
+
/**
|
|
1038
|
+
* 瀑布流数据
|
|
1039
|
+
*/
|
|
1040
|
+
data: {
|
|
1041
|
+
type: Array,
|
|
1042
|
+
default: () => []
|
|
1043
|
+
},
|
|
1044
|
+
/**
|
|
1045
|
+
* 列数
|
|
1046
|
+
*/
|
|
1047
|
+
column: {
|
|
1048
|
+
type: Number,
|
|
1049
|
+
default: 2,
|
|
1050
|
+
validator: (p) => p >= 2
|
|
1051
|
+
},
|
|
1052
|
+
/**
|
|
1053
|
+
* 最大列数
|
|
1054
|
+
*/
|
|
1055
|
+
maxColumn: {
|
|
1056
|
+
type: Number,
|
|
1057
|
+
default: 5
|
|
1058
|
+
},
|
|
1059
|
+
/**
|
|
1060
|
+
* 列间距
|
|
1061
|
+
*/
|
|
1062
|
+
columnGap: {
|
|
1063
|
+
type: [Number, String],
|
|
1064
|
+
default: 10
|
|
1065
|
+
},
|
|
1066
|
+
/**
|
|
1067
|
+
* 行间距
|
|
1068
|
+
*/
|
|
1069
|
+
rowGap: {
|
|
1070
|
+
type: [Number, String],
|
|
1071
|
+
default: 10
|
|
1072
|
+
},
|
|
1073
|
+
/**
|
|
1074
|
+
* 数据唯一键
|
|
1075
|
+
*/
|
|
1076
|
+
itemKey: {
|
|
1077
|
+
type: String,
|
|
1078
|
+
default: "id"
|
|
1079
|
+
},
|
|
1080
|
+
/**
|
|
1081
|
+
* 图片字段名
|
|
1082
|
+
*/
|
|
1083
|
+
imageKey: {
|
|
1084
|
+
type: String,
|
|
1085
|
+
default: "url"
|
|
1086
|
+
}
|
|
1087
|
+
},
|
|
1088
|
+
emits: ["load", "error"],
|
|
1089
|
+
setup(p, { expose: g, emit: o }) {
|
|
1090
|
+
const t = useSlots(), r = ref(null), h = p, l = o;
|
|
1091
|
+
useCssVars(() => ({
|
|
1092
|
+
columnGap: String(h.columnGap) + "px",
|
|
1093
|
+
rowGap: String(h.rowGap) + "px"
|
|
1094
|
+
}));
|
|
1095
|
+
const u = ref([]), c = ref(2), n = computed(() => t.default !== void 0), f = (b) => (r.value && r.value.offsetWidth, Math.min(h.column, h.maxColumn), parseInt(h.columnGap), parseInt(h.rowGap), 200 + Math.floor(Math.random() * 100) + 20), i = () => {
|
|
1096
|
+
console.log("开始分配数据,总数据量:", h.data.length);
|
|
1097
|
+
const b = Math.min(h.column, h.maxColumn);
|
|
1098
|
+
c.value = b;
|
|
1099
|
+
const w = [];
|
|
1100
|
+
for (let s = 0; s < b; s++)
|
|
1101
|
+
w.push({
|
|
1102
|
+
items: [],
|
|
1103
|
+
height: 0
|
|
1104
|
+
});
|
|
1105
|
+
u.value = w, h.data.forEach((s, d) => {
|
|
1106
|
+
const e = f();
|
|
1107
|
+
let x = 1 / 0, v = 0;
|
|
1108
|
+
for (let _ = 0; _ < b; _++)
|
|
1109
|
+
u.value[_].height < x && (x = u.value[_].height, v = _);
|
|
1110
|
+
u.value[v].items.push(s), u.value[v].height += e, console.log("分配数据到列:", { itemIndex: d, columnIndex: v, itemHeight: e, columnHeight: u.value[v].height });
|
|
1111
|
+
}), console.log("分配完成,各列数据量:", u.value.map((s, d) => `列${d + 1}: ${s.items.length}个`)), console.log("分配完成,各列高度:", u.value.map((s, d) => `列${d + 1}: ${s.height}px`));
|
|
1112
|
+
}, y = (b) => {
|
|
1113
|
+
l("load", b);
|
|
1114
|
+
}, a = (b) => {
|
|
1115
|
+
l("error", b);
|
|
1116
|
+
};
|
|
1117
|
+
return watch(() => h.data, () => {
|
|
1118
|
+
console.log("数据变化,重新分配数据"), i();
|
|
1119
|
+
}, { deep: !0 }), watch(() => [h.column, h.maxColumn], () => {
|
|
1120
|
+
console.log("列数变化,更新列数"), c.value = Math.min(h.column, h.maxColumn), i();
|
|
1121
|
+
}), watch(() => [h.columnGap, h.rowGap], () => {
|
|
1122
|
+
console.log("间距变化,重新计算高度和分配数据"), i();
|
|
1123
|
+
}), onMounted(() => {
|
|
1124
|
+
console.log("===== 组件挂载 ====="), console.log("组件挂载,初始化数据"), console.log("初始数据量:", h.data.length);
|
|
1125
|
+
try {
|
|
1126
|
+
i(), console.log("===== 组件挂载完成 =====");
|
|
1127
|
+
} catch (b) {
|
|
1128
|
+
console.error("refresh函数执行失败:", b), console.log("===== 组件挂载失败 =====");
|
|
1129
|
+
}
|
|
1130
|
+
}), g({
|
|
1131
|
+
refresh: i
|
|
1132
|
+
}), (b, w) => (openBlock(), createElementBlock("div", {
|
|
1133
|
+
ref_key: "waterfallRef",
|
|
1134
|
+
ref: r
|
|
1135
|
+
}, [
|
|
1136
|
+
createElementVNode("div", _hoisted_1$1, [
|
|
1137
|
+
createTextVNode(" 列数: " + toDisplayString(c.value) + " ", 1),
|
|
1138
|
+
w[1] || (w[1] = createElementVNode("br", null, null, -1)),
|
|
1139
|
+
createTextVNode(" 数据总量: " + toDisplayString(p.data.length) + " ", 1),
|
|
1140
|
+
w[2] || (w[2] = createElementVNode("br", null, null, -1)),
|
|
1141
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(u.value, (s, d) => (openBlock(), createElementBlock(Fragment, { key: d }, [
|
|
1142
|
+
createTextVNode(" 列" + toDisplayString(d + 1) + "数据量: " + toDisplayString(s.items.length), 1),
|
|
1143
|
+
w[0] || (w[0] = createElementVNode("br", null, null, -1))
|
|
1144
|
+
], 64))), 128))
|
|
1145
|
+
]),
|
|
1146
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
1147
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(u.value, (s, d) => (openBlock(), createElementBlock("div", {
|
|
1148
|
+
key: d,
|
|
1149
|
+
class: "waterfall-column"
|
|
1150
|
+
}, [
|
|
1151
|
+
createElementVNode("div", _hoisted_3$1, " 列" + toDisplayString(d + 1) + ": " + toDisplayString(s.items.length) + "个元素 ", 1),
|
|
1152
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(s.items, (e, x) => (openBlock(), createElementBlock("div", {
|
|
1153
|
+
key: e[p.itemKey] || `col${d}-${x}`,
|
|
1154
|
+
class: "waterfall-item"
|
|
1155
|
+
}, [
|
|
1156
|
+
n.value ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
|
|
1157
|
+
createElementVNode("img", {
|
|
1158
|
+
src: e[p.imageKey],
|
|
1159
|
+
class: "waterfall-image",
|
|
1160
|
+
style: normalizeStyle({ height: f() + "px" }),
|
|
1161
|
+
onLoad: y,
|
|
1162
|
+
onError: a
|
|
1163
|
+
}, null, 44, _hoisted_5$1),
|
|
1164
|
+
createElementVNode("div", _hoisted_6, [
|
|
1165
|
+
renderSlot(b.$slots, "default", {
|
|
1166
|
+
item: e,
|
|
1167
|
+
index: x
|
|
1168
|
+
}, void 0, !0)
|
|
1169
|
+
])
|
|
1170
|
+
])) : (openBlock(), createElementBlock("img", {
|
|
1171
|
+
key: 1,
|
|
1172
|
+
src: e[p.imageKey],
|
|
1173
|
+
class: "waterfall-image",
|
|
1174
|
+
style: normalizeStyle({ height: f() + "px" }),
|
|
1175
|
+
onLoad: y,
|
|
1176
|
+
onError: a
|
|
1177
|
+
}, null, 44, _hoisted_7))
|
|
1178
|
+
]))), 128))
|
|
1179
|
+
]))), 128))
|
|
1180
|
+
])
|
|
1181
|
+
], 512));
|
|
1182
|
+
}
|
|
1183
|
+
}), HbisWaterfall = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-20459ccd"]]), _sfc_main$1 = {
|
|
1030
1184
|
__name: "hbis-auto-scroll-list",
|
|
1031
1185
|
props: {
|
|
1032
1186
|
// 列表数据数组
|
|
@@ -1043,7 +1197,7 @@ const _sfc_main$1 = {
|
|
|
1043
1197
|
direction: {
|
|
1044
1198
|
type: String,
|
|
1045
1199
|
default: "vertical",
|
|
1046
|
-
validator: (
|
|
1200
|
+
validator: (p) => ["vertical", "horizontal"].includes(p)
|
|
1047
1201
|
},
|
|
1048
1202
|
// 鼠标悬停是否暂停
|
|
1049
1203
|
pauseOnHover: {
|
|
@@ -1087,8 +1241,8 @@ const _sfc_main$1 = {
|
|
|
1087
1241
|
}
|
|
1088
1242
|
},
|
|
1089
1243
|
emits: ["scroll", "pause", "resume", "dragStart", "dragEnd"],
|
|
1090
|
-
setup(
|
|
1091
|
-
const t =
|
|
1244
|
+
setup(p, { expose: g, emit: o }) {
|
|
1245
|
+
const t = p, r = o, h = ref(null), l = ref(null), u = ref(!1), c = ref(null), n = ref(0), f = ref([]), i = ref(!1), y = ref(0), a = ref(0), b = ref(0), w = ref(!1), s = computed(() => ({
|
|
1092
1246
|
// 动态设置容器高度和宽度
|
|
1093
1247
|
height: typeof t.containerHeight == "number" ? `${t.containerHeight}px` : t.containerHeight,
|
|
1094
1248
|
width: typeof t.containerWidth == "number" ? `${t.containerWidth}px` : t.containerWidth,
|
|
@@ -1096,8 +1250,8 @@ const _sfc_main$1 = {
|
|
|
1096
1250
|
// 隐藏超出部分
|
|
1097
1251
|
position: "relative"
|
|
1098
1252
|
// 相对定位,为绝对定位的内容容器提供参考
|
|
1099
|
-
})),
|
|
1100
|
-
const
|
|
1253
|
+
})), d = computed(() => {
|
|
1254
|
+
const m = {
|
|
1101
1255
|
position: "absolute",
|
|
1102
1256
|
// 绝对定位,实现自由移动
|
|
1103
1257
|
transition: "none",
|
|
@@ -1105,169 +1259,268 @@ const _sfc_main$1 = {
|
|
|
1105
1259
|
willChange: "transform"
|
|
1106
1260
|
// 告诉浏览器将要变化的属性,优化性能
|
|
1107
1261
|
};
|
|
1108
|
-
return t.direction === "vertical" ?
|
|
1262
|
+
return t.direction === "vertical" ? m.transform = `translateY(${n.value}px)` : m.transform = `translateX(${n.value}px)`, m;
|
|
1109
1263
|
}), e = () => {
|
|
1110
1264
|
if (!t.data || t.data.length === 0) {
|
|
1111
|
-
|
|
1265
|
+
f.value = [];
|
|
1112
1266
|
return;
|
|
1113
1267
|
}
|
|
1114
|
-
t.loop ?
|
|
1115
|
-
},
|
|
1116
|
-
if (
|
|
1117
|
-
|
|
1268
|
+
t.loop ? f.value = [...t.data, ...t.data] : f.value = [...t.data];
|
|
1269
|
+
}, x = () => {
|
|
1270
|
+
if (u.value || i.value) {
|
|
1271
|
+
c.value = requestAnimationFrame(x);
|
|
1118
1272
|
return;
|
|
1119
1273
|
}
|
|
1120
|
-
const
|
|
1121
|
-
if (!
|
|
1122
|
-
|
|
1274
|
+
const m = h.value, k = l.value;
|
|
1275
|
+
if (!m || !k) {
|
|
1276
|
+
c.value = requestAnimationFrame(x);
|
|
1123
1277
|
return;
|
|
1124
1278
|
}
|
|
1125
|
-
const
|
|
1126
|
-
if (
|
|
1127
|
-
Math.abs(
|
|
1279
|
+
const N = t.direction === "vertical" ? m.offsetHeight : m.offsetWidth, D = (t.direction === "vertical" ? t.itemHeight : t.itemWidth) * t.data.length;
|
|
1280
|
+
if (n.value -= t.speed, t.loop)
|
|
1281
|
+
Math.abs(n.value) >= D && (n.value = 0);
|
|
1128
1282
|
else {
|
|
1129
|
-
const j = -(
|
|
1130
|
-
if (
|
|
1131
|
-
|
|
1283
|
+
const j = -(D - N);
|
|
1284
|
+
if (n.value <= j) {
|
|
1285
|
+
n.value = j, u.value = !0, r("scroll", n.value);
|
|
1132
1286
|
return;
|
|
1133
1287
|
}
|
|
1134
1288
|
}
|
|
1135
|
-
r("scroll",
|
|
1136
|
-
},
|
|
1137
|
-
|
|
1138
|
-
}, w = () => {
|
|
1139
|
-
o.value && (cancelAnimationFrame(o.value), o.value = null);
|
|
1140
|
-
}, x = () => {
|
|
1141
|
-
m.value = !0, r("pause");
|
|
1289
|
+
r("scroll", n.value), c.value = requestAnimationFrame(x);
|
|
1290
|
+
}, v = () => {
|
|
1291
|
+
c.value && cancelAnimationFrame(c.value), c.value = requestAnimationFrame(x);
|
|
1142
1292
|
}, _ = () => {
|
|
1143
|
-
|
|
1144
|
-
},
|
|
1145
|
-
|
|
1293
|
+
c.value && (cancelAnimationFrame(c.value), c.value = null);
|
|
1294
|
+
}, E = () => {
|
|
1295
|
+
u.value = !0, r("pause");
|
|
1296
|
+
}, S = () => {
|
|
1297
|
+
u.value = !1, r("resume");
|
|
1298
|
+
}, O = () => {
|
|
1299
|
+
t.pauseOnHover && E();
|
|
1146
1300
|
}, T = () => {
|
|
1147
|
-
t.pauseOnHover && !i.value &&
|
|
1148
|
-
},
|
|
1149
|
-
i.value = !0,
|
|
1150
|
-
}, C = (
|
|
1301
|
+
t.pauseOnHover && !i.value && S();
|
|
1302
|
+
}, I = (m) => {
|
|
1303
|
+
i.value = !0, w.value = u.value, u.value = !0, y.value = t.direction === "vertical" ? m.clientY : m.clientX, a.value = y.value, b.value = n.value, r("dragStart"), document.addEventListener("mousemove", C), document.addEventListener("mouseup", B);
|
|
1304
|
+
}, C = (m) => {
|
|
1151
1305
|
if (!i.value) return;
|
|
1152
|
-
|
|
1153
|
-
const
|
|
1154
|
-
|
|
1155
|
-
const
|
|
1156
|
-
if (
|
|
1157
|
-
const
|
|
1306
|
+
a.value = t.direction === "vertical" ? m.clientY : m.clientX;
|
|
1307
|
+
const k = a.value - y.value;
|
|
1308
|
+
n.value = b.value + k;
|
|
1309
|
+
const N = h.value, A = l.value;
|
|
1310
|
+
if (N && A) {
|
|
1311
|
+
const D = t.direction === "vertical" ? N.offsetHeight : N.offsetWidth, L = (t.direction === "vertical" ? t.itemHeight : t.itemWidth) * t.data.length;
|
|
1158
1312
|
if (t.loop)
|
|
1159
|
-
|
|
1313
|
+
n.value > 0 ? n.value = 0 : Math.abs(n.value) > L && (n.value = -L);
|
|
1160
1314
|
else {
|
|
1161
|
-
const
|
|
1162
|
-
|
|
1315
|
+
const P = -(L - D);
|
|
1316
|
+
n.value > 0 ? n.value = 0 : n.value < P && (n.value = P);
|
|
1163
1317
|
}
|
|
1164
1318
|
}
|
|
1165
|
-
r("scroll",
|
|
1166
|
-
},
|
|
1167
|
-
i.value && (i.value = !1, document.removeEventListener("mousemove", C), document.removeEventListener("mouseup",
|
|
1168
|
-
},
|
|
1169
|
-
const
|
|
1170
|
-
i.value = !0,
|
|
1171
|
-
},
|
|
1319
|
+
r("scroll", n.value);
|
|
1320
|
+
}, B = () => {
|
|
1321
|
+
i.value && (i.value = !1, document.removeEventListener("mousemove", C), document.removeEventListener("mouseup", B), w.value || (u.value = !1), r("dragEnd"));
|
|
1322
|
+
}, $ = (m) => {
|
|
1323
|
+
const k = m.touches[0];
|
|
1324
|
+
i.value = !0, w.value = u.value, u.value = !0, y.value = t.direction === "vertical" ? k.clientY : k.clientX, a.value = y.value, b.value = n.value, r("dragStart");
|
|
1325
|
+
}, R = (m) => {
|
|
1172
1326
|
if (!i.value) return;
|
|
1173
|
-
|
|
1174
|
-
const
|
|
1175
|
-
|
|
1176
|
-
const
|
|
1177
|
-
|
|
1178
|
-
const
|
|
1179
|
-
if (
|
|
1180
|
-
const j = t.direction === "vertical" ?
|
|
1327
|
+
m.preventDefault();
|
|
1328
|
+
const k = m.touches[0];
|
|
1329
|
+
a.value = t.direction === "vertical" ? k.clientY : k.clientX;
|
|
1330
|
+
const N = a.value - y.value;
|
|
1331
|
+
n.value = b.value + N;
|
|
1332
|
+
const A = h.value, D = l.value;
|
|
1333
|
+
if (A && D) {
|
|
1334
|
+
const j = t.direction === "vertical" ? A.offsetHeight : A.offsetWidth, P = (t.direction === "vertical" ? t.itemHeight : t.itemWidth) * t.data.length;
|
|
1181
1335
|
if (t.loop)
|
|
1182
|
-
|
|
1336
|
+
n.value > 0 ? n.value = 0 : Math.abs(n.value) > P && (n.value = -P);
|
|
1183
1337
|
else {
|
|
1184
|
-
const z = -(
|
|
1185
|
-
|
|
1338
|
+
const z = -(P - j);
|
|
1339
|
+
n.value > 0 ? n.value = 0 : n.value < z && (n.value = z);
|
|
1186
1340
|
}
|
|
1187
1341
|
}
|
|
1188
|
-
r("scroll",
|
|
1342
|
+
r("scroll", n.value);
|
|
1189
1343
|
}, V = () => {
|
|
1190
|
-
i.value && (i.value = !1,
|
|
1191
|
-
}, M = (
|
|
1192
|
-
|
|
1193
|
-
},
|
|
1194
|
-
|
|
1344
|
+
i.value && (i.value = !1, w.value || (u.value = !1), r("dragEnd"));
|
|
1345
|
+
}, M = (m) => {
|
|
1346
|
+
n.value = m;
|
|
1347
|
+
}, F = () => {
|
|
1348
|
+
n.value = 0;
|
|
1195
1349
|
}, W = () => {
|
|
1196
|
-
const
|
|
1197
|
-
if (
|
|
1198
|
-
const
|
|
1199
|
-
if (
|
|
1200
|
-
const
|
|
1201
|
-
|
|
1350
|
+
const m = h.value;
|
|
1351
|
+
if (m) {
|
|
1352
|
+
const k = l.value;
|
|
1353
|
+
if (k) {
|
|
1354
|
+
const N = t.direction === "vertical" ? k.offsetHeight : k.offsetWidth;
|
|
1355
|
+
n.value = -(N - m.offsetHeight);
|
|
1202
1356
|
}
|
|
1203
1357
|
}
|
|
1204
1358
|
};
|
|
1205
1359
|
return watch(() => t.data, () => {
|
|
1206
|
-
e(),
|
|
1360
|
+
e(), n.value = 0;
|
|
1207
1361
|
}, { deep: !0 }), watch(() => t.speed, () => {
|
|
1208
|
-
|
|
1362
|
+
u.value || (_(), v());
|
|
1209
1363
|
}), onMounted(() => {
|
|
1210
1364
|
e(), nextTick(() => {
|
|
1211
|
-
|
|
1212
|
-
const
|
|
1213
|
-
|
|
1365
|
+
v();
|
|
1366
|
+
const m = h.value;
|
|
1367
|
+
m && (m.addEventListener("mouseenter", O), m.addEventListener("mouseleave", T));
|
|
1214
1368
|
});
|
|
1215
1369
|
}), onUnmounted(() => {
|
|
1216
|
-
|
|
1217
|
-
const
|
|
1218
|
-
|
|
1370
|
+
_();
|
|
1371
|
+
const m = h.value;
|
|
1372
|
+
m && (m.removeEventListener("mouseenter", O), m.removeEventListener("mouseleave", T)), document.removeEventListener("mousemove", C), document.removeEventListener("mouseup", B);
|
|
1219
1373
|
}), g({
|
|
1220
|
-
pause:
|
|
1374
|
+
pause: E,
|
|
1221
1375
|
// 暂停滚动
|
|
1222
|
-
resume:
|
|
1376
|
+
resume: S,
|
|
1223
1377
|
// 恢复滚动
|
|
1224
1378
|
scrollTo: M,
|
|
1225
1379
|
// 滚动到指定位置
|
|
1226
|
-
scrollToTop:
|
|
1380
|
+
scrollToTop: F,
|
|
1227
1381
|
// 滚动到顶部
|
|
1228
1382
|
scrollToBottom: W,
|
|
1229
1383
|
// 滚动到底部
|
|
1230
|
-
isPaused:
|
|
1384
|
+
isPaused: u,
|
|
1231
1385
|
// 是否暂停(响应式)
|
|
1232
1386
|
isDragging: i
|
|
1233
1387
|
// 是否正在拖拽(响应式)
|
|
1234
|
-
}), (
|
|
1388
|
+
}), (m, k) => (openBlock(), createElementBlock("div", {
|
|
1235
1389
|
class: "hbis-auto-scroll-list",
|
|
1236
1390
|
ref_key: "containerRef",
|
|
1237
|
-
ref:
|
|
1238
|
-
style: normalizeStyle(
|
|
1239
|
-
onMousedown:
|
|
1240
|
-
onTouchstart:
|
|
1241
|
-
onTouchmove:
|
|
1391
|
+
ref: h,
|
|
1392
|
+
style: normalizeStyle(s.value),
|
|
1393
|
+
onMousedown: I,
|
|
1394
|
+
onTouchstart: $,
|
|
1395
|
+
onTouchmove: R,
|
|
1242
1396
|
onTouchend: V
|
|
1243
1397
|
}, [
|
|
1244
1398
|
createElementVNode("div", {
|
|
1245
1399
|
class: "scroll-content",
|
|
1246
1400
|
ref_key: "contentRef",
|
|
1247
|
-
ref:
|
|
1248
|
-
style: normalizeStyle(
|
|
1401
|
+
ref: l,
|
|
1402
|
+
style: normalizeStyle(d.value)
|
|
1249
1403
|
}, [
|
|
1250
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
1251
|
-
item:
|
|
1252
|
-
index:
|
|
1404
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(f.value, (N, A) => renderSlot(m.$slots, "item", {
|
|
1405
|
+
item: N,
|
|
1406
|
+
index: A
|
|
1253
1407
|
}, () => [
|
|
1254
1408
|
createElementVNode("div", {
|
|
1255
1409
|
class: "default-item",
|
|
1256
|
-
style: normalizeStyle(
|
|
1257
|
-
}, toDisplayString(
|
|
1410
|
+
style: normalizeStyle(p.itemStyle)
|
|
1411
|
+
}, toDisplayString(N), 5)
|
|
1258
1412
|
], !0)), 256))
|
|
1259
1413
|
], 4)
|
|
1260
1414
|
], 36));
|
|
1261
1415
|
}
|
|
1262
|
-
}, HbisAutoScrollList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d23f102b"]])
|
|
1416
|
+
}, HbisAutoScrollList = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-d23f102b"]]), _hoisted_1 = { class: "search-dropdown" }, _hoisted_2 = ["placeholder"], _hoisted_3 = {
|
|
1417
|
+
key: 0,
|
|
1418
|
+
class: "dropdown-list"
|
|
1419
|
+
}, _hoisted_4 = ["onClick"], _hoisted_5 = { class: "item-text" }, _sfc_main = {
|
|
1420
|
+
__name: "hbis-search-input",
|
|
1421
|
+
props: {
|
|
1422
|
+
list: {
|
|
1423
|
+
type: Array,
|
|
1424
|
+
default: () => []
|
|
1425
|
+
},
|
|
1426
|
+
placeholder: {
|
|
1427
|
+
type: String,
|
|
1428
|
+
default: "请输入关键词搜索"
|
|
1429
|
+
},
|
|
1430
|
+
defaultValue: {
|
|
1431
|
+
type: String,
|
|
1432
|
+
default: ""
|
|
1433
|
+
},
|
|
1434
|
+
maxHeight: {
|
|
1435
|
+
type: Number,
|
|
1436
|
+
default: 400
|
|
1437
|
+
},
|
|
1438
|
+
showClear: {
|
|
1439
|
+
type: Boolean,
|
|
1440
|
+
default: !0
|
|
1441
|
+
}
|
|
1442
|
+
},
|
|
1443
|
+
emits: ["clearIcon", "search", "select"],
|
|
1444
|
+
setup(p, { emit: g }) {
|
|
1445
|
+
const o = p, t = g, r = ref(o.defaultValue), h = ref(!1), l = ref(!1), u = ref([]);
|
|
1446
|
+
function c() {
|
|
1447
|
+
r.value = "", u.value = [], l.value = !1, t("clearIcon", "", []);
|
|
1448
|
+
}
|
|
1449
|
+
function n() {
|
|
1450
|
+
const a = r.value;
|
|
1451
|
+
u.value = o.list.filter(
|
|
1452
|
+
(b) => b.name && b.name.includes(a)
|
|
1453
|
+
), l.value = u.value.length > 0, t("search", a, u.value);
|
|
1454
|
+
}
|
|
1455
|
+
function f() {
|
|
1456
|
+
u.value = o.list.filter(
|
|
1457
|
+
(a) => a.name && a.name.includes(r.value)
|
|
1458
|
+
), h.value = !0, l.value = !0;
|
|
1459
|
+
}
|
|
1460
|
+
function i() {
|
|
1461
|
+
setTimeout(() => {
|
|
1462
|
+
h.value = !1, l.value = !1;
|
|
1463
|
+
}, 150);
|
|
1464
|
+
}
|
|
1465
|
+
function y(a) {
|
|
1466
|
+
r.value = a.name, l.value = !1, t("select", a);
|
|
1467
|
+
}
|
|
1468
|
+
return onMounted(() => {
|
|
1469
|
+
o.defaultValue && (r.value = o.defaultValue);
|
|
1470
|
+
}), (a, b) => {
|
|
1471
|
+
const w = resolveComponent("scroll-view");
|
|
1472
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
1473
|
+
createElementVNode("div", {
|
|
1474
|
+
class: normalizeClass(["input-wrapper", { focus: h.value }])
|
|
1475
|
+
}, [
|
|
1476
|
+
withDirectives(createElementVNode("input", {
|
|
1477
|
+
class: "search-input",
|
|
1478
|
+
placeholder: p.placeholder,
|
|
1479
|
+
"onUpdate:modelValue": b[0] || (b[0] = (s) => r.value = s),
|
|
1480
|
+
onInput: n,
|
|
1481
|
+
onFocus: f,
|
|
1482
|
+
onBlur: i
|
|
1483
|
+
}, null, 40, _hoisted_2), [
|
|
1484
|
+
[vModelText, r.value]
|
|
1485
|
+
]),
|
|
1486
|
+
r.value && p.showClear ? (openBlock(), createElementBlock("div", {
|
|
1487
|
+
key: 0,
|
|
1488
|
+
class: "clear-icon",
|
|
1489
|
+
onClick: c
|
|
1490
|
+
}, "×")) : createCommentVNode("", !0)
|
|
1491
|
+
], 2),
|
|
1492
|
+
l.value && u.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
1493
|
+
createVNode(w, {
|
|
1494
|
+
"scroll-y": "",
|
|
1495
|
+
style: normalizeStyle({ maxHeight: p.maxHeight + "px" })
|
|
1496
|
+
}, {
|
|
1497
|
+
default: withCtx(() => [
|
|
1498
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(u.value, (s, d) => (openBlock(), createElementBlock("div", {
|
|
1499
|
+
key: d,
|
|
1500
|
+
class: "dropdown-item",
|
|
1501
|
+
onClick: (e) => y(s)
|
|
1502
|
+
}, [
|
|
1503
|
+
createElementVNode("span", _hoisted_5, toDisplayString(s.name), 1)
|
|
1504
|
+
], 8, _hoisted_4))), 128))
|
|
1505
|
+
]),
|
|
1506
|
+
_: 1
|
|
1507
|
+
}, 8, ["style"])
|
|
1508
|
+
])) : createCommentVNode("", !0)
|
|
1509
|
+
]);
|
|
1510
|
+
};
|
|
1511
|
+
}
|
|
1512
|
+
};
|
|
1263
1513
|
export {
|
|
1264
1514
|
C1,
|
|
1265
1515
|
C2,
|
|
1266
1516
|
HbisAutoScrollList,
|
|
1267
1517
|
HbisSvgaPlayer,
|
|
1518
|
+
HbisWaterfall,
|
|
1268
1519
|
HbisAutoScrollList as hbisAutoScrollList,
|
|
1269
1520
|
hbisDateStrip,
|
|
1270
|
-
_sfc_main$
|
|
1271
|
-
|
|
1521
|
+
_sfc_main$4 as hbisPreviewImage,
|
|
1522
|
+
_sfc_main as hbisSearchInput,
|
|
1523
|
+
HbisSvgaPlayer as hbisSvgaPlayer,
|
|
1524
|
+
HbisWaterfall as hbisWaterfall
|
|
1272
1525
|
};
|
|
1273
1526
|
//# sourceMappingURL=index.es.js.map
|