@hbis-uni/components 2.0.6 → 2.6.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 +1158 -704
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +16 -6
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,
|
|
2
|
-
const _sfc_main$
|
|
1
|
+
import { defineComponent, createElementBlock, openBlock, normalizeClass, renderSlot, createTextVNode, toDisplayString, createElementVNode, createCommentVNode, computed, ref, onMounted, watch, Fragment, renderList, normalizeStyle, nextTick, onUnmounted, withModifiers, withDirectives, vModelText, useSlots, useCssVars, resolveComponent, createVNode, withCtx } from "vue";
|
|
2
|
+
const _sfc_main$9 = /* @__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(s) {
|
|
9
|
+
return (g, o) => (openBlock(), createElementBlock("div", {
|
|
10
|
+
class: normalizeClass(["c1-container", { "c1-primary": s.primary }])
|
|
11
11
|
}, [
|
|
12
12
|
renderSlot(g.$slots, "default", {}, () => [
|
|
13
|
-
createTextVNode(toDisplayString(
|
|
13
|
+
createTextVNode(toDisplayString(s.title), 1)
|
|
14
14
|
], !0)
|
|
15
15
|
], 2));
|
|
16
16
|
}
|
|
17
|
-
}), _export_sfc = (
|
|
18
|
-
const
|
|
17
|
+
}), _export_sfc = (s, g) => {
|
|
18
|
+
const o = s.__vccOpts || s;
|
|
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$9, [["__scopeId", "data-v-e2250793"]]), _hoisted_1$6 = { class: "c2-container" }, _hoisted_2$5 = { class: "c2-title" }, _hoisted_3$5 = { class: "c2-content" }, _sfc_main$8 = /* @__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(s, { 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, c) => (openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
35
|
+
createElementVNode("h2", _hoisted_2$5, toDisplayString(s.title), 1),
|
|
36
|
+
createElementVNode("div", _hoisted_3$5, [
|
|
37
37
|
renderSlot(r.$slots, "default", {}, void 0, !0)
|
|
38
38
|
]),
|
|
39
|
-
|
|
39
|
+
s.showButton ? (openBlock(), createElementBlock("button", {
|
|
40
40
|
key: 0,
|
|
41
41
|
class: "c2-button",
|
|
42
42
|
onClick: t
|
|
43
|
-
}, toDisplayString(
|
|
43
|
+
}, toDisplayString(s.buttonText), 1)) : createCommentVNode("", !0)
|
|
44
44
|
]));
|
|
45
45
|
}
|
|
46
|
-
}), C2 = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
46
|
+
}), C2 = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-ed1086ed"]]), _hoisted_1$5 = { key: 0 }, _hoisted_2$4 = { class: "hbis-date-strip__weekdays" }, _hoisted_3$4 = { 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$7 = /* @__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 s = /* @__PURE__ */ new Date();
|
|
56
|
+
return s.setDate(s.getDate() + 30), s;
|
|
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(s, { emit: g }) {
|
|
71
|
+
const o = s, 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 p = new Date(
|
|
82
|
-
if (p.setHours(0, 0, 0, 0), isNaN(
|
|
79
|
+
const l = new Date(o.startDate);
|
|
80
|
+
l.setHours(0, 0, 0, 0);
|
|
81
|
+
const p = new Date(o.endDate);
|
|
82
|
+
if (p.setHours(0, 0, 0, 0), isNaN(l.getTime()) || isNaN(p.getTime()))
|
|
83
83
|
return console.log("无效的日期对象,使用默认滚动行为"), !1;
|
|
84
|
-
const e = p.getTime() -
|
|
84
|
+
const e = p.getTime() - l.getTime(), x = Math.ceil(e / (1e3 * 60 * 60 * 24)), v = x + 1;
|
|
85
85
|
return console.log("日期范围天数计算:", {
|
|
86
|
-
start:
|
|
86
|
+
start: l.toLocaleDateString(),
|
|
87
87
|
end: p.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 (l) {
|
|
94
|
+
return console.error("计算日期范围时出错:", l), !1;
|
|
95
95
|
}
|
|
96
|
-
}),
|
|
96
|
+
}), c = [
|
|
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 p =
|
|
109
|
-
for (let
|
|
110
|
-
const
|
|
111
|
-
e.push(v
|
|
104
|
+
], u = computed(() => {
|
|
105
|
+
const l = a.value[0];
|
|
106
|
+
if (!l)
|
|
107
|
+
return c;
|
|
108
|
+
const p = l.weekday, e = [];
|
|
109
|
+
for (let x = 0; x < 7; x++) {
|
|
110
|
+
const v = (p + x) % 7;
|
|
111
|
+
e.push(c[v]);
|
|
112
112
|
}
|
|
113
113
|
return e;
|
|
114
114
|
});
|
|
115
115
|
ref((() => {
|
|
116
|
-
const
|
|
117
|
-
return
|
|
116
|
+
const l = o.startDate || /* @__PURE__ */ new Date(), p = l.getDay(), e = l.getDate() - (p === 0 ? 6 : p - 1), x = new Date(l);
|
|
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
|
+
(l) => {
|
|
123
|
+
console.log("highlightType changed:", l);
|
|
124
124
|
}
|
|
125
125
|
), watch(
|
|
126
|
-
() =>
|
|
127
|
-
(
|
|
128
|
-
console.log("modelValue changed:",
|
|
126
|
+
() => o.modelValue,
|
|
127
|
+
(l) => {
|
|
128
|
+
console.log("modelValue changed:", l);
|
|
129
129
|
}
|
|
130
130
|
);
|
|
131
|
-
const
|
|
132
|
-
const
|
|
131
|
+
const f = computed(() => {
|
|
132
|
+
const l = [];
|
|
133
133
|
try {
|
|
134
|
-
const p =
|
|
134
|
+
const p = o.startDate, e = o.endDate;
|
|
135
135
|
if (isNaN(p.getTime()) || isNaN(e.getTime()))
|
|
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:
|
|
136
|
+
return console.log("无效的日期对象,返回空数组"), l;
|
|
137
|
+
const x = Math.ceil((e.getTime() - p.getTime()) / (1e3 * 60 * 60 * 24)) + 1;
|
|
138
|
+
for (let v = 0; v < x; v++) {
|
|
139
|
+
const _ = new Date(p);
|
|
140
|
+
_.setDate(p.getDate() + v), isNaN(_.getTime()) || l.push({
|
|
141
|
+
date: _,
|
|
142
|
+
dateString: d(_),
|
|
143
|
+
day: _.getDate(),
|
|
144
|
+
month: _.getMonth() + 1,
|
|
145
|
+
year: _.getFullYear(),
|
|
146
|
+
isWeekend: _.getDay() === 0 || _.getDay() === 6,
|
|
147
|
+
weekday: _.getDay()
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
} catch (p) {
|
|
151
151
|
console.error("生成日期数组时出错:", p);
|
|
152
152
|
}
|
|
153
|
-
return
|
|
154
|
-
}),
|
|
155
|
-
const p =
|
|
156
|
-
return
|
|
157
|
-
},
|
|
158
|
-
const p =
|
|
159
|
-
return
|
|
160
|
-
},
|
|
161
|
-
const p =
|
|
162
|
-
return
|
|
163
|
-
},
|
|
153
|
+
return l;
|
|
154
|
+
}), a = computed(() => f.value.filter((l) => !!(l && l.date && l.dateString && !isNaN(l.date.getTime()) && typeof l.dateString == "string" && typeof l.day == "number"))), d = (l) => `${l.getFullYear()}-${String(l.getMonth() + 1).padStart(2, "0")}-${String(l.getDate()).padStart(2, "0")}`, i = (l) => {
|
|
155
|
+
const p = l.dateString;
|
|
156
|
+
return o.modelValue ? Array.isArray(o.modelValue) ? o.modelValue.some((e) => !e || isNaN(e.getTime()) ? !1 : d(e) === p) : isNaN(o.modelValue.getTime()) ? !1 : d(o.modelValue) === p : !1;
|
|
157
|
+
}, m = (l) => {
|
|
158
|
+
const p = d(/* @__PURE__ */ new Date());
|
|
159
|
+
return l.dateString === p;
|
|
160
|
+
}, h = (l) => {
|
|
161
|
+
const p = l.date;
|
|
162
|
+
return o.disablePast && p < new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0)) || o.disableFuture && p > new Date((/* @__PURE__ */ new Date()).setHours(23, 59, 59, 999)) ? !1 : p >= o.startDate && p <= o.endDate;
|
|
163
|
+
}, b = (l) => {
|
|
164
164
|
var p;
|
|
165
|
-
return ((p =
|
|
166
|
-
},
|
|
167
|
-
|
|
165
|
+
return ((p = c.find((e) => e.value === l)) == null ? void 0 : p.label) || "";
|
|
166
|
+
}, w = (l) => {
|
|
167
|
+
h(l) && (t("dateClick", l), t("update:modelValue", l.date));
|
|
168
168
|
};
|
|
169
|
-
return (
|
|
169
|
+
return (l, p) => (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": s.highlightType === "bg",
|
|
172
|
+
"hbis-date-strip--highlight-dot": s.highlightType === "dot",
|
|
173
|
+
"hbis-date-strip--highlight-round": s.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(a.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(a.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": m(e),
|
|
193
|
+
"hbis-date-strip__date--disabled": !h(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) ? s.selectedColor : s.normalColor,
|
|
198
|
+
backgroundColor: i(e) ? s.selectedBgColor : s.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(l.$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$5, [
|
|
210
|
+
createElementVNode("div", _hoisted_2$4, [
|
|
211
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(u.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$4, [
|
|
219
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(a.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": m(e),
|
|
224
|
+
"hbis-date-strip__date--disabled": !h(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) ? s.selectedColor : s.normalColor,
|
|
229
|
+
backgroundColor: i(e) ? s.selectedBgColor : s.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(l.$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$7, [["__scopeId", "data-v-f7fe6423"]]), _hoisted_1$4 = { class: "image-preview" }, _hoisted_2$3 = {
|
|
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$3 = { 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$6 = {
|
|
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: (s) => s.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(s, { emit: g }) {
|
|
282
|
+
const o = s, t = g, r = ref(o.initialIndex), c = ref(null), u = ref(!1), n = ref(!1), f = ref(0), a = ref(0), d = ref(0), i = ref(window.innerWidth), m = ref(window.innerHeight), h = 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), l = ref(0), p = ref(0), e = ref(0), x = computed(() => ({
|
|
290
|
+
transform: `translateX(${d.value}px)`,
|
|
291
|
+
transition: u.value ? "none" : "transform 0.3s ease"
|
|
292
|
+
})), v = computed(() => ({
|
|
293
293
|
width: `${i.value}px`,
|
|
294
|
-
height: `${
|
|
294
|
+
height: `${m.value}px`
|
|
295
295
|
}));
|
|
296
|
-
watch(() =>
|
|
297
|
-
|
|
296
|
+
watch(() => o.initialIndex, (y) => {
|
|
297
|
+
y !== r.value && (r.value = y, _());
|
|
298
298
|
}), onMounted(() => {
|
|
299
|
-
const
|
|
300
|
-
i.value = window.innerWidth,
|
|
299
|
+
const y = () => {
|
|
300
|
+
i.value = window.innerWidth, m.value = window.innerHeight, _();
|
|
301
301
|
};
|
|
302
|
-
return window.addEventListener("resize",
|
|
303
|
-
window.removeEventListener("resize",
|
|
302
|
+
return window.addEventListener("resize", y), y(), () => {
|
|
303
|
+
window.removeEventListener("resize", y);
|
|
304
304
|
};
|
|
305
305
|
});
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
},
|
|
309
|
-
r.value > 0 && (r.value--,
|
|
310
|
-
},
|
|
311
|
-
r.value <
|
|
312
|
-
},
|
|
313
|
-
|
|
314
|
-
...
|
|
306
|
+
const _ = () => {
|
|
307
|
+
d.value = -r.value * i.value;
|
|
308
|
+
}, E = () => {
|
|
309
|
+
r.value > 0 && (r.value--, _(), T(), t("change", r.value), t("update:initialIndex", r.value));
|
|
310
|
+
}, S = () => {
|
|
311
|
+
r.value < o.images.length - 1 && (r.value++, _(), T(), t("change", r.value), t("update:initialIndex", r.value));
|
|
312
|
+
}, T = () => {
|
|
313
|
+
h.value[r.value] = {
|
|
314
|
+
...h.value[r.value],
|
|
315
315
|
scale: 1,
|
|
316
316
|
translateX: 0,
|
|
317
317
|
translateY: 0
|
|
318
318
|
};
|
|
319
|
-
},
|
|
320
|
-
const
|
|
319
|
+
}, C = (y) => {
|
|
320
|
+
const k = h.value[y];
|
|
321
321
|
return {
|
|
322
|
-
transform: `scale(${
|
|
323
|
-
transition:
|
|
324
|
-
opacity:
|
|
322
|
+
transform: `scale(${k.scale}) translate(${k.translateX}px, ${k.translateY}px)`,
|
|
323
|
+
transition: n.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 = (y) => {
|
|
327
|
+
const k = event.target;
|
|
328
|
+
h.value[y] = {
|
|
329
|
+
...h.value[y],
|
|
330
|
+
naturalWidth: k.naturalWidth,
|
|
331
|
+
naturalHeight: k.naturalHeight,
|
|
332
332
|
isLoaded: !0
|
|
333
333
|
};
|
|
334
|
-
},
|
|
335
|
-
|
|
336
|
-
},
|
|
337
|
-
if (
|
|
338
|
-
const
|
|
339
|
-
|
|
340
|
-
...
|
|
341
|
-
translateX:
|
|
342
|
-
translateY:
|
|
334
|
+
}, B = (y) => {
|
|
335
|
+
y.target.tagName === "IMG" ? (n.value = !0, f.value = y.clientX - h.value[r.value].translateX, a.value = y.clientY - h.value[r.value].translateY) : (u.value = !0, f.value = y.clientX - d.value), y.preventDefault();
|
|
336
|
+
}, O = (y) => {
|
|
337
|
+
if (n.value) {
|
|
338
|
+
const k = y.clientX - f.value, A = y.clientY - a.value;
|
|
339
|
+
h.value[r.value] = {
|
|
340
|
+
...h.value[r.value],
|
|
341
|
+
translateX: k,
|
|
342
|
+
translateY: A
|
|
343
343
|
};
|
|
344
|
-
} else if (
|
|
345
|
-
const
|
|
346
|
-
|
|
344
|
+
} else if (u.value && o.enableSwipe) {
|
|
345
|
+
const k = y.clientX - f.value;
|
|
346
|
+
d.value = k;
|
|
347
347
|
}
|
|
348
|
-
},
|
|
349
|
-
if (
|
|
350
|
-
const
|
|
351
|
-
Math.abs(
|
|
348
|
+
}, j = () => {
|
|
349
|
+
if (u.value && o.enableSwipe) {
|
|
350
|
+
const y = i.value * 0.3;
|
|
351
|
+
Math.abs(d.value + r.value * i.value) > y ? d.value > 0 ? E() : S() : _();
|
|
352
352
|
}
|
|
353
|
-
|
|
354
|
-
},
|
|
355
|
-
const
|
|
356
|
-
|
|
357
|
-
},
|
|
358
|
-
const
|
|
359
|
-
p.value =
|
|
360
|
-
const
|
|
361
|
-
if (Math.abs(
|
|
362
|
-
|
|
363
|
-
else if (
|
|
364
|
-
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
...
|
|
368
|
-
translateX:
|
|
369
|
-
translateY:
|
|
353
|
+
u.value = !1, n.value = !1;
|
|
354
|
+
}, P = (y) => {
|
|
355
|
+
const k = y.touches[0];
|
|
356
|
+
b.value = k.clientX, w.value = k.clientY, l.value = Date.now();
|
|
357
|
+
}, R = (y) => {
|
|
358
|
+
const k = y.touches[0];
|
|
359
|
+
p.value = k.clientX, e.value = k.clientY;
|
|
360
|
+
const A = p.value - b.value, N = e.value - w.value;
|
|
361
|
+
if (Math.abs(A) > Math.abs(N))
|
|
362
|
+
y.preventDefault(), u.value = !0, d.value = -r.value * i.value + A;
|
|
363
|
+
else if (h.value[r.value].scale > 1) {
|
|
364
|
+
y.preventDefault(), n.value = !0;
|
|
365
|
+
const D = A + h.value[r.value].translateX, $ = N + h.value[r.value].translateY;
|
|
366
|
+
h.value[r.value] = {
|
|
367
|
+
...h.value[r.value],
|
|
368
|
+
translateX: D,
|
|
369
|
+
translateY: $
|
|
370
370
|
};
|
|
371
371
|
}
|
|
372
372
|
}, M = () => {
|
|
373
|
-
if (
|
|
374
|
-
const
|
|
375
|
-
Math.abs(
|
|
373
|
+
if (u.value) {
|
|
374
|
+
const y = p.value - b.value, k = Date.now() - l.value, A = i.value * 0.2, N = Math.abs(y) / k;
|
|
375
|
+
Math.abs(y) > A || N > 0.5 ? y > 0 ? E() : S() : _();
|
|
376
376
|
}
|
|
377
|
-
|
|
378
|
-
},
|
|
379
|
-
if (
|
|
380
|
-
|
|
381
|
-
const
|
|
382
|
-
W(
|
|
383
|
-
}, W = (
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
Math.min(
|
|
387
|
-
),
|
|
388
|
-
|
|
389
|
-
...
|
|
390
|
-
scale:
|
|
391
|
-
translateX:
|
|
392
|
-
translateY:
|
|
377
|
+
u.value = !1, n.value = !1;
|
|
378
|
+
}, F = (y, k) => {
|
|
379
|
+
if (k !== r.value) return;
|
|
380
|
+
y.preventDefault();
|
|
381
|
+
const A = y.deltaY > 0 ? -0.1 : 0.1, N = y.clientX, D = y.clientY;
|
|
382
|
+
W(N, D, A);
|
|
383
|
+
}, W = (y, k, A) => {
|
|
384
|
+
const N = h.value[r.value], D = Math.max(
|
|
385
|
+
o.minScale,
|
|
386
|
+
Math.min(o.maxScale, N.scale + A)
|
|
387
|
+
), $ = event.target.getBoundingClientRect(), L = y - $.left, V = k - $.top, z = D - N.scale, H = N.translateX + (L - N.translateX) * (z / N.scale), U = N.translateY + (V - N.translateY) * (z / N.scale);
|
|
388
|
+
h.value[r.value] = {
|
|
389
|
+
...N,
|
|
390
|
+
scale: D,
|
|
391
|
+
translateX: H,
|
|
392
|
+
translateY: U
|
|
393
393
|
};
|
|
394
394
|
};
|
|
395
|
-
return (
|
|
396
|
-
|
|
397
|
-
createElementVNode("span", _hoisted_3, toDisplayString(r.value + 1) + "/" + toDisplayString(
|
|
395
|
+
return (y, k) => (openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
396
|
+
s.images.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_2$3, [
|
|
397
|
+
createElementVNode("span", _hoisted_3$3, toDisplayString(r.value + 1) + "/" + toDisplayString(s.images.length), 1)
|
|
398
398
|
])) : createCommentVNode("", !0),
|
|
399
|
-
|
|
399
|
+
s.showCloseBtn ? (openBlock(), createElementBlock("button", {
|
|
400
400
|
key: 1,
|
|
401
401
|
class: "close-btn",
|
|
402
|
-
onClick:
|
|
403
|
-
}, [...
|
|
402
|
+
onClick: k[0] || (k[0] = (A) => 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:
|
|
433
|
-
onTouchmove:
|
|
430
|
+
ref: c,
|
|
431
|
+
style: normalizeStyle(x.value),
|
|
432
|
+
onTouchstart: P,
|
|
433
|
+
onTouchmove: R,
|
|
434
434
|
onTouchend: M,
|
|
435
|
-
onMousedown:
|
|
436
|
-
onMousemove:
|
|
437
|
-
onMouseup:
|
|
438
|
-
onMouseleave:
|
|
435
|
+
onMousedown: B,
|
|
436
|
+
onMousemove: O,
|
|
437
|
+
onMouseup: j,
|
|
438
|
+
onMouseleave: j
|
|
439
439
|
}, [
|
|
440
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
441
|
-
key:
|
|
440
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(s.images, (A, N) => (openBlock(), createElementBlock("div", {
|
|
441
|
+
key: N,
|
|
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, N)
|
|
448
448
|
}, [
|
|
449
449
|
createElementVNode("img", {
|
|
450
|
-
src:
|
|
450
|
+
src: A,
|
|
451
451
|
alt: "Preview image",
|
|
452
452
|
class: "preview-image",
|
|
453
|
-
style: normalizeStyle(
|
|
454
|
-
onLoad: (
|
|
453
|
+
style: normalizeStyle(C(N)),
|
|
454
|
+
onLoad: (D) => I(N),
|
|
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 === s.images.length - 1
|
|
481
|
+
}, [...k[3] || (k[3] = [
|
|
482
482
|
createElementVNode("svg", {
|
|
483
483
|
width: "24",
|
|
484
484
|
height: "24",
|
|
@@ -492,7 +492,592 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
492
492
|
])], 8, _hoisted_8)
|
|
493
493
|
]));
|
|
494
494
|
}
|
|
495
|
-
}
|
|
495
|
+
}, _sfc_main$5 = {
|
|
496
|
+
__name: "hbis-auto-scroll-list",
|
|
497
|
+
props: {
|
|
498
|
+
// 列表数据数组
|
|
499
|
+
data: {
|
|
500
|
+
type: Array,
|
|
501
|
+
default: () => []
|
|
502
|
+
},
|
|
503
|
+
// 滚动速度
|
|
504
|
+
speed: {
|
|
505
|
+
type: Number,
|
|
506
|
+
default: 1
|
|
507
|
+
},
|
|
508
|
+
// 滚动方向:vertical(垂直)或horizontal(水平)
|
|
509
|
+
direction: {
|
|
510
|
+
type: String,
|
|
511
|
+
default: "vertical",
|
|
512
|
+
validator: (s) => ["vertical", "horizontal"].includes(s)
|
|
513
|
+
},
|
|
514
|
+
// 鼠标悬停是否暂停
|
|
515
|
+
pauseOnHover: {
|
|
516
|
+
type: Boolean,
|
|
517
|
+
default: !0
|
|
518
|
+
},
|
|
519
|
+
// 列表项高度(垂直滚动时使用)
|
|
520
|
+
itemHeight: {
|
|
521
|
+
type: Number,
|
|
522
|
+
default: 40
|
|
523
|
+
},
|
|
524
|
+
// 列表项宽度(水平滚动时使用)
|
|
525
|
+
itemWidth: {
|
|
526
|
+
type: Number,
|
|
527
|
+
default: 200
|
|
528
|
+
},
|
|
529
|
+
// 容器高度
|
|
530
|
+
containerHeight: {
|
|
531
|
+
type: [Number, String],
|
|
532
|
+
default: 300
|
|
533
|
+
},
|
|
534
|
+
// 容器宽度
|
|
535
|
+
containerWidth: {
|
|
536
|
+
type: [Number, String],
|
|
537
|
+
default: "100%"
|
|
538
|
+
},
|
|
539
|
+
// 是否循环滚动
|
|
540
|
+
loop: {
|
|
541
|
+
type: Boolean,
|
|
542
|
+
default: !0
|
|
543
|
+
},
|
|
544
|
+
// 自定义列表项类名
|
|
545
|
+
customItemClass: {
|
|
546
|
+
type: String,
|
|
547
|
+
default: ""
|
|
548
|
+
},
|
|
549
|
+
// 自定义列表项样式
|
|
550
|
+
itemStyle: {
|
|
551
|
+
type: Object,
|
|
552
|
+
default: () => ({})
|
|
553
|
+
}
|
|
554
|
+
},
|
|
555
|
+
emits: ["scroll", "pause", "resume", "dragStart", "dragEnd"],
|
|
556
|
+
setup(s, { expose: g, emit: o }) {
|
|
557
|
+
const t = s, r = o, c = ref(null), u = ref(null), n = ref(!1), f = ref(null), a = ref(0), d = ref([]), i = ref(!1), m = ref(0), h = ref(0), b = ref(0), w = ref(!1), l = computed(() => ({
|
|
558
|
+
// 动态设置容器高度和宽度
|
|
559
|
+
height: typeof t.containerHeight == "number" ? `${t.containerHeight}px` : t.containerHeight,
|
|
560
|
+
width: typeof t.containerWidth == "number" ? `${t.containerWidth}px` : t.containerWidth,
|
|
561
|
+
overflow: "hidden",
|
|
562
|
+
// 隐藏超出部分
|
|
563
|
+
position: "relative"
|
|
564
|
+
// 相对定位,为绝对定位的内容容器提供参考
|
|
565
|
+
})), p = computed(() => {
|
|
566
|
+
const y = {
|
|
567
|
+
with: "100%",
|
|
568
|
+
position: "absolute",
|
|
569
|
+
// 绝对定位,实现自由移动
|
|
570
|
+
transition: "none",
|
|
571
|
+
// 禁用过渡,使用transform实现平滑滚动
|
|
572
|
+
willChange: "transform"
|
|
573
|
+
// 告诉浏览器将要变化的属性,优化性能
|
|
574
|
+
};
|
|
575
|
+
return t.direction === "vertical" ? y.transform = `translateY(${a.value}px)` : y.transform = `translateX(${a.value}px)`, y;
|
|
576
|
+
}), e = () => {
|
|
577
|
+
if (!t.data || t.data.length === 0) {
|
|
578
|
+
d.value = [];
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
t.loop ? d.value = [...t.data, ...t.data] : d.value = [...t.data];
|
|
582
|
+
}, x = () => {
|
|
583
|
+
if (n.value || i.value) {
|
|
584
|
+
f.value = requestAnimationFrame(x);
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
const y = c.value, k = u.value;
|
|
588
|
+
if (!y || !k) {
|
|
589
|
+
f.value = requestAnimationFrame(x);
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
const A = t.direction === "vertical" ? y.offsetHeight : y.offsetWidth, D = (t.direction === "vertical" ? t.itemHeight : t.itemWidth) * t.data.length;
|
|
593
|
+
if (a.value -= t.speed, t.loop)
|
|
594
|
+
Math.abs(a.value) >= D && (a.value = 0);
|
|
595
|
+
else {
|
|
596
|
+
const $ = -(D - A);
|
|
597
|
+
if (a.value <= $) {
|
|
598
|
+
a.value = $, n.value = !0, r("scroll", a.value);
|
|
599
|
+
return;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
r("scroll", a.value), f.value = requestAnimationFrame(x);
|
|
603
|
+
}, v = () => {
|
|
604
|
+
f.value && cancelAnimationFrame(f.value), f.value = requestAnimationFrame(x);
|
|
605
|
+
}, _ = () => {
|
|
606
|
+
f.value && (cancelAnimationFrame(f.value), f.value = null);
|
|
607
|
+
}, E = () => {
|
|
608
|
+
n.value = !0, r("pause");
|
|
609
|
+
}, S = () => {
|
|
610
|
+
n.value = !1, r("resume");
|
|
611
|
+
}, T = () => {
|
|
612
|
+
t.pauseOnHover && E();
|
|
613
|
+
}, C = () => {
|
|
614
|
+
t.pauseOnHover && !i.value && S();
|
|
615
|
+
}, I = (y) => {
|
|
616
|
+
i.value = !0, w.value = n.value, n.value = !0, m.value = t.direction === "vertical" ? y.clientY : y.clientX, h.value = m.value, b.value = a.value, r("dragStart"), document.addEventListener("mousemove", B), document.addEventListener("mouseup", O);
|
|
617
|
+
}, B = (y) => {
|
|
618
|
+
if (!i.value) return;
|
|
619
|
+
h.value = t.direction === "vertical" ? y.clientY : y.clientX;
|
|
620
|
+
const k = h.value - m.value;
|
|
621
|
+
a.value = b.value + k;
|
|
622
|
+
const A = c.value, N = u.value;
|
|
623
|
+
if (A && N) {
|
|
624
|
+
const D = t.direction === "vertical" ? A.offsetHeight : A.offsetWidth, L = (t.direction === "vertical" ? t.itemHeight : t.itemWidth) * t.data.length;
|
|
625
|
+
if (t.loop)
|
|
626
|
+
a.value > 0 ? a.value = 0 : Math.abs(a.value) > L && (a.value = -L);
|
|
627
|
+
else {
|
|
628
|
+
const V = -(L - D);
|
|
629
|
+
a.value > 0 ? a.value = 0 : a.value < V && (a.value = V);
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
r("scroll", a.value);
|
|
633
|
+
}, O = () => {
|
|
634
|
+
i.value && (i.value = !1, document.removeEventListener("mousemove", B), document.removeEventListener("mouseup", O), w.value || (n.value = !1), r("dragEnd"));
|
|
635
|
+
}, j = (y) => {
|
|
636
|
+
const k = y.touches[0];
|
|
637
|
+
i.value = !0, w.value = n.value, n.value = !0, m.value = t.direction === "vertical" ? k.clientY : k.clientX, h.value = m.value, b.value = a.value, r("dragStart");
|
|
638
|
+
}, P = (y) => {
|
|
639
|
+
if (!i.value) return;
|
|
640
|
+
y.preventDefault();
|
|
641
|
+
const k = y.touches[0];
|
|
642
|
+
h.value = t.direction === "vertical" ? k.clientY : k.clientX;
|
|
643
|
+
const A = h.value - m.value;
|
|
644
|
+
a.value = b.value + A;
|
|
645
|
+
const N = c.value, D = u.value;
|
|
646
|
+
if (N && D) {
|
|
647
|
+
const $ = t.direction === "vertical" ? N.offsetHeight : N.offsetWidth, V = (t.direction === "vertical" ? t.itemHeight : t.itemWidth) * t.data.length;
|
|
648
|
+
if (t.loop)
|
|
649
|
+
a.value > 0 ? a.value = 0 : Math.abs(a.value) > V && (a.value = -V);
|
|
650
|
+
else {
|
|
651
|
+
const z = -(V - $);
|
|
652
|
+
a.value > 0 ? a.value = 0 : a.value < z && (a.value = z);
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
r("scroll", a.value);
|
|
656
|
+
}, R = () => {
|
|
657
|
+
i.value && (i.value = !1, w.value || (n.value = !1), r("dragEnd"));
|
|
658
|
+
}, M = (y) => {
|
|
659
|
+
a.value = y;
|
|
660
|
+
}, F = () => {
|
|
661
|
+
a.value = 0;
|
|
662
|
+
}, W = () => {
|
|
663
|
+
const y = c.value;
|
|
664
|
+
if (y) {
|
|
665
|
+
const k = u.value;
|
|
666
|
+
if (k) {
|
|
667
|
+
const A = t.direction === "vertical" ? k.offsetHeight : k.offsetWidth;
|
|
668
|
+
a.value = -(A - y.offsetHeight);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
};
|
|
672
|
+
return watch(() => t.data, () => {
|
|
673
|
+
e(), a.value = 0;
|
|
674
|
+
}, { deep: !0 }), watch(() => t.speed, () => {
|
|
675
|
+
n.value || (_(), v());
|
|
676
|
+
}), onMounted(() => {
|
|
677
|
+
e(), nextTick(() => {
|
|
678
|
+
v();
|
|
679
|
+
const y = c.value;
|
|
680
|
+
y && (y.addEventListener("mouseenter", T), y.addEventListener("mouseleave", C));
|
|
681
|
+
});
|
|
682
|
+
}), onUnmounted(() => {
|
|
683
|
+
_();
|
|
684
|
+
const y = c.value;
|
|
685
|
+
y && (y.removeEventListener("mouseenter", T), y.removeEventListener("mouseleave", C)), document.removeEventListener("mousemove", B), document.removeEventListener("mouseup", O);
|
|
686
|
+
}), g({
|
|
687
|
+
pause: E,
|
|
688
|
+
// 暂停滚动
|
|
689
|
+
resume: S,
|
|
690
|
+
// 恢复滚动
|
|
691
|
+
scrollTo: M,
|
|
692
|
+
// 滚动到指定位置
|
|
693
|
+
scrollToTop: F,
|
|
694
|
+
// 滚动到顶部
|
|
695
|
+
scrollToBottom: W,
|
|
696
|
+
// 滚动到底部
|
|
697
|
+
isPaused: n,
|
|
698
|
+
// 是否暂停(响应式)
|
|
699
|
+
isDragging: i
|
|
700
|
+
// 是否正在拖拽(响应式)
|
|
701
|
+
}), (y, k) => (openBlock(), createElementBlock("div", {
|
|
702
|
+
class: "hbis-auto-scroll-list",
|
|
703
|
+
ref_key: "containerRef",
|
|
704
|
+
ref: c,
|
|
705
|
+
style: normalizeStyle(l.value),
|
|
706
|
+
onMousedown: I,
|
|
707
|
+
onTouchstart: j,
|
|
708
|
+
onTouchmove: P,
|
|
709
|
+
onTouchend: R
|
|
710
|
+
}, [
|
|
711
|
+
createElementVNode("div", {
|
|
712
|
+
class: "scroll-content",
|
|
713
|
+
ref_key: "contentRef",
|
|
714
|
+
ref: u,
|
|
715
|
+
style: normalizeStyle(p.value)
|
|
716
|
+
}, [
|
|
717
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(d.value, (A, N) => renderSlot(y.$slots, "item", {
|
|
718
|
+
item: A,
|
|
719
|
+
index: N
|
|
720
|
+
}, () => [
|
|
721
|
+
createElementVNode("div", {
|
|
722
|
+
class: "default-item",
|
|
723
|
+
style: normalizeStyle(s.itemStyle)
|
|
724
|
+
}, toDisplayString(A), 5)
|
|
725
|
+
], !0)), 256))
|
|
726
|
+
], 4)
|
|
727
|
+
], 36));
|
|
728
|
+
}
|
|
729
|
+
}, HbisAutoScrollList = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-d516a98e"]]), _hoisted_1$3 = {
|
|
730
|
+
key: 0,
|
|
731
|
+
class: "circular-spinner"
|
|
732
|
+
}, _hoisted_2$2 = {
|
|
733
|
+
key: 1,
|
|
734
|
+
class: "dots-spinner"
|
|
735
|
+
}, _hoisted_3$2 = {
|
|
736
|
+
key: 2,
|
|
737
|
+
class: "bars-spinner"
|
|
738
|
+
}, _sfc_main$4 = {
|
|
739
|
+
__name: "hbis-loading",
|
|
740
|
+
props: {
|
|
741
|
+
// 控制加载组件是否显示
|
|
742
|
+
visible: {
|
|
743
|
+
type: Boolean,
|
|
744
|
+
default: !1
|
|
745
|
+
},
|
|
746
|
+
// 是否允许触摸屏幕关闭加载
|
|
747
|
+
touchDismiss: {
|
|
748
|
+
type: Boolean,
|
|
749
|
+
default: !1
|
|
750
|
+
},
|
|
751
|
+
// 加载文字
|
|
752
|
+
text: {
|
|
753
|
+
type: String,
|
|
754
|
+
default: ""
|
|
755
|
+
},
|
|
756
|
+
// 加载动画类型:circular, dots, bars
|
|
757
|
+
spinnerType: {
|
|
758
|
+
type: String,
|
|
759
|
+
default: "circular"
|
|
760
|
+
},
|
|
761
|
+
// 自定义文字样式
|
|
762
|
+
textStyle: {
|
|
763
|
+
type: Object,
|
|
764
|
+
default: () => ({})
|
|
765
|
+
},
|
|
766
|
+
// 自定义容器样式
|
|
767
|
+
containerStyle: {
|
|
768
|
+
type: Object,
|
|
769
|
+
default: () => ({})
|
|
770
|
+
}
|
|
771
|
+
},
|
|
772
|
+
emits: ["update:visible", "close"],
|
|
773
|
+
setup(s, { expose: g, emit: o }) {
|
|
774
|
+
const t = s, r = o, c = () => {
|
|
775
|
+
t.touchDismiss && (r("update:visible", !1), r("close"));
|
|
776
|
+
};
|
|
777
|
+
return watch(() => t.visible, (u) => {
|
|
778
|
+
u ? document.body.style.overflow = "hidden" : document.body.style.overflow = "";
|
|
779
|
+
}), onUnmounted(() => {
|
|
780
|
+
document.body.style.overflow = "";
|
|
781
|
+
}), g({
|
|
782
|
+
show: () => r("update:visible", !0),
|
|
783
|
+
hide: () => {
|
|
784
|
+
r("update:visible", !1), r("close");
|
|
785
|
+
}
|
|
786
|
+
}), (u, n) => s.visible ? (openBlock(), createElementBlock("div", {
|
|
787
|
+
key: 0,
|
|
788
|
+
class: normalizeClass(["hbis-loading-container", { "touch-dismissible": s.touchDismiss }]),
|
|
789
|
+
onClick: c
|
|
790
|
+
}, [
|
|
791
|
+
createElementVNode("div", {
|
|
792
|
+
class: "hbis-loading-wrapper",
|
|
793
|
+
onClick: n[0] || (n[0] = withModifiers(() => {
|
|
794
|
+
}, ["stop"]))
|
|
795
|
+
}, [
|
|
796
|
+
renderSlot(u.$slots, "spinner", {}, () => [
|
|
797
|
+
createElementVNode("div", {
|
|
798
|
+
class: normalizeClass(["hbis-loading-spinner", s.spinnerType])
|
|
799
|
+
}, [
|
|
800
|
+
s.spinnerType === "circular" ? (openBlock(), createElementBlock("div", _hoisted_1$3, [...n[1] || (n[1] = [
|
|
801
|
+
createElementVNode("div", { class: "circle" }, null, -1)
|
|
802
|
+
])])) : s.spinnerType === "dots" ? (openBlock(), createElementBlock("div", _hoisted_2$2, [...n[2] || (n[2] = [
|
|
803
|
+
createElementVNode("div", { class: "dot" }, null, -1),
|
|
804
|
+
createElementVNode("div", { class: "dot" }, null, -1),
|
|
805
|
+
createElementVNode("div", { class: "dot" }, null, -1)
|
|
806
|
+
])])) : s.spinnerType === "bars" ? (openBlock(), createElementBlock("div", _hoisted_3$2, [...n[3] || (n[3] = [
|
|
807
|
+
createElementVNode("div", { class: "bar" }, null, -1),
|
|
808
|
+
createElementVNode("div", { class: "bar" }, null, -1),
|
|
809
|
+
createElementVNode("div", { class: "bar" }, null, -1)
|
|
810
|
+
])])) : createCommentVNode("", !0)
|
|
811
|
+
], 2)
|
|
812
|
+
], !0),
|
|
813
|
+
s.text ? (openBlock(), createElementBlock("div", {
|
|
814
|
+
key: 0,
|
|
815
|
+
class: "hbis-loading-text",
|
|
816
|
+
style: normalizeStyle(s.textStyle)
|
|
817
|
+
}, toDisplayString(s.text), 5)) : createCommentVNode("", !0)
|
|
818
|
+
])
|
|
819
|
+
], 2)) : createCommentVNode("", !0);
|
|
820
|
+
}
|
|
821
|
+
}, hbisLoading = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-61aef9bd"]]), _hoisted_1$2 = { class: "parent-view" }, _sfc_main$3 = {
|
|
822
|
+
__name: "hbis-sms-input",
|
|
823
|
+
props: {
|
|
824
|
+
/* 倒计时时间
|
|
825
|
+
*/
|
|
826
|
+
countDownTime: {
|
|
827
|
+
type: Number,
|
|
828
|
+
default: 60
|
|
829
|
+
},
|
|
830
|
+
/* 输入框提示输入文本
|
|
831
|
+
*/
|
|
832
|
+
inputPlacheHolder: {
|
|
833
|
+
type: String,
|
|
834
|
+
default: "请输入验证码"
|
|
835
|
+
},
|
|
836
|
+
/* 输入框背景色
|
|
837
|
+
*/
|
|
838
|
+
inputColor: {
|
|
839
|
+
type: String,
|
|
840
|
+
default: "#F1F7FA"
|
|
841
|
+
},
|
|
842
|
+
/* 输入框输入文本颜色
|
|
843
|
+
*/
|
|
844
|
+
inputTextColor: {
|
|
845
|
+
type: String,
|
|
846
|
+
default: "#000"
|
|
847
|
+
},
|
|
848
|
+
/* 输入框提示文本颜色
|
|
849
|
+
*/
|
|
850
|
+
inputPlacheHolderColor: {
|
|
851
|
+
type: String,
|
|
852
|
+
default: "#F00"
|
|
853
|
+
},
|
|
854
|
+
/* 倒计时后拼接字符
|
|
855
|
+
*/
|
|
856
|
+
smsCodeTimeText: {
|
|
857
|
+
type: String,
|
|
858
|
+
default: "s"
|
|
859
|
+
},
|
|
860
|
+
/* 发送验证码按钮文本
|
|
861
|
+
*/
|
|
862
|
+
smsCodeBtnText: {
|
|
863
|
+
type: String,
|
|
864
|
+
default: "发送"
|
|
865
|
+
},
|
|
866
|
+
/* 发送验证码按钮颜色
|
|
867
|
+
*/
|
|
868
|
+
smsCodeBtnColor: {
|
|
869
|
+
type: String,
|
|
870
|
+
default: "#FFF"
|
|
871
|
+
},
|
|
872
|
+
/* 发送验证码按钮文本颜色
|
|
873
|
+
*/
|
|
874
|
+
smsCodeBtnTextColor: {
|
|
875
|
+
type: String,
|
|
876
|
+
default: "#2E6DFF"
|
|
877
|
+
}
|
|
878
|
+
},
|
|
879
|
+
emits: ["custom-event"],
|
|
880
|
+
setup(s, { expose: g, emit: o }) {
|
|
881
|
+
const t = s, r = o, c = ref(!0), u = ref(""), n = ref(t.countDownTime), f = () => {
|
|
882
|
+
if (console.log("验证码isSendSMS:" + c.value), !c.value) {
|
|
883
|
+
console.log("请" + t.countDownTime + "秒后再重试。");
|
|
884
|
+
return;
|
|
885
|
+
}
|
|
886
|
+
r("custom-event");
|
|
887
|
+
};
|
|
888
|
+
return g({
|
|
889
|
+
countDown: () => {
|
|
890
|
+
n.value = t.countDownTime;
|
|
891
|
+
let d = setInterval(() => {
|
|
892
|
+
c.value = !1, n.value--, n.value === 0 && (c.value = !0, clearInterval(d));
|
|
893
|
+
}, 1e3);
|
|
894
|
+
},
|
|
895
|
+
smsCode: u
|
|
896
|
+
}), (d, i) => (openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
897
|
+
createElementVNode("div", {
|
|
898
|
+
class: "input_view_sms_code",
|
|
899
|
+
style: normalizeStyle({ background: s.inputColor })
|
|
900
|
+
}, [
|
|
901
|
+
withDirectives(createElementVNode("input", {
|
|
902
|
+
type: "text",
|
|
903
|
+
class: "view_sms_code",
|
|
904
|
+
"placeholder-style": "color:#999",
|
|
905
|
+
placeholder: "请输入验证码",
|
|
906
|
+
"onUpdate:modelValue": i[0] || (i[0] = (m) => u.value = m),
|
|
907
|
+
style: normalizeStyle({ color: s.inputTextColor })
|
|
908
|
+
}, null, 4), [
|
|
909
|
+
[vModelText, u.value]
|
|
910
|
+
]),
|
|
911
|
+
c.value ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", {
|
|
912
|
+
key: 0,
|
|
913
|
+
class: normalizeClass(["sms_code_btn", { disabled: !c.value }]),
|
|
914
|
+
style: normalizeStyle({ color: s.smsCodeBtnTextColor, background: s.smsCodeBtnColor }),
|
|
915
|
+
onClick: f
|
|
916
|
+
}, toDisplayString(n.value) + " " + toDisplayString(s.smsCodeTimeText), 7)),
|
|
917
|
+
c.value ? (openBlock(), createElementBlock("div", {
|
|
918
|
+
key: 1,
|
|
919
|
+
class: "sms_code_btn",
|
|
920
|
+
style: normalizeStyle({ color: s.smsCodeBtnTextColor, background: s.smsCodeBtnColor }),
|
|
921
|
+
onClick: f
|
|
922
|
+
}, toDisplayString(s.smsCodeBtnText), 5)) : createCommentVNode("", !0)
|
|
923
|
+
], 4)
|
|
924
|
+
]));
|
|
925
|
+
}
|
|
926
|
+
}, HbisSmsInput = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-ef42fb9a"]]), _hoisted_1$1 = { class: "waterfall-debug" }, _hoisted_2$1 = { class: "waterfall-container" }, _hoisted_3$1 = { class: "column-debug" }, _hoisted_4$1 = {
|
|
927
|
+
key: 0,
|
|
928
|
+
class: "waterfall-item-with-slot"
|
|
929
|
+
}, _hoisted_5$1 = ["src"], _hoisted_6 = { class: "waterfall-content" }, _hoisted_7 = ["src"], _sfc_main$2 = /* @__PURE__ */ Object.assign({
|
|
930
|
+
name: "HbisWaterfall"
|
|
931
|
+
}, {
|
|
932
|
+
__name: "hbis-waterfall",
|
|
933
|
+
props: {
|
|
934
|
+
/**
|
|
935
|
+
* 瀑布流数据
|
|
936
|
+
*/
|
|
937
|
+
data: {
|
|
938
|
+
type: Array,
|
|
939
|
+
default: () => []
|
|
940
|
+
},
|
|
941
|
+
/**
|
|
942
|
+
* 列数
|
|
943
|
+
*/
|
|
944
|
+
column: {
|
|
945
|
+
type: Number,
|
|
946
|
+
default: 2,
|
|
947
|
+
validator: (s) => s >= 2
|
|
948
|
+
},
|
|
949
|
+
/**
|
|
950
|
+
* 最大列数
|
|
951
|
+
*/
|
|
952
|
+
maxColumn: {
|
|
953
|
+
type: Number,
|
|
954
|
+
default: 5
|
|
955
|
+
},
|
|
956
|
+
/**
|
|
957
|
+
* 列间距
|
|
958
|
+
*/
|
|
959
|
+
columnGap: {
|
|
960
|
+
type: [Number, String],
|
|
961
|
+
default: 10
|
|
962
|
+
},
|
|
963
|
+
/**
|
|
964
|
+
* 行间距
|
|
965
|
+
*/
|
|
966
|
+
rowGap: {
|
|
967
|
+
type: [Number, String],
|
|
968
|
+
default: 10
|
|
969
|
+
},
|
|
970
|
+
/**
|
|
971
|
+
* 数据唯一键
|
|
972
|
+
*/
|
|
973
|
+
itemKey: {
|
|
974
|
+
type: String,
|
|
975
|
+
default: "id"
|
|
976
|
+
},
|
|
977
|
+
/**
|
|
978
|
+
* 图片字段名
|
|
979
|
+
*/
|
|
980
|
+
imageKey: {
|
|
981
|
+
type: String,
|
|
982
|
+
default: "url"
|
|
983
|
+
}
|
|
984
|
+
},
|
|
985
|
+
emits: ["load", "error"],
|
|
986
|
+
setup(s, { expose: g, emit: o }) {
|
|
987
|
+
const t = useSlots(), r = ref(null), c = s, u = o;
|
|
988
|
+
useCssVars(() => ({
|
|
989
|
+
columnGap: String(c.columnGap) + "px",
|
|
990
|
+
rowGap: String(c.rowGap) + "px"
|
|
991
|
+
}));
|
|
992
|
+
const n = ref([]), f = ref(2), a = computed(() => t.default !== void 0), d = (b) => (r.value && r.value.offsetWidth, Math.min(c.column, c.maxColumn), parseInt(c.columnGap), parseInt(c.rowGap), 200 + Math.floor(Math.random() * 100) + 20), i = () => {
|
|
993
|
+
console.log("开始分配数据,总数据量:", c.data.length);
|
|
994
|
+
const b = Math.min(c.column, c.maxColumn);
|
|
995
|
+
f.value = b;
|
|
996
|
+
const w = [];
|
|
997
|
+
for (let l = 0; l < b; l++)
|
|
998
|
+
w.push({
|
|
999
|
+
items: [],
|
|
1000
|
+
height: 0
|
|
1001
|
+
});
|
|
1002
|
+
n.value = w, c.data.forEach((l, p) => {
|
|
1003
|
+
const e = d();
|
|
1004
|
+
let x = 1 / 0, v = 0;
|
|
1005
|
+
for (let _ = 0; _ < b; _++)
|
|
1006
|
+
n.value[_].height < x && (x = n.value[_].height, v = _);
|
|
1007
|
+
n.value[v].items.push(l), n.value[v].height += e, console.log("分配数据到列:", { itemIndex: p, columnIndex: v, itemHeight: e, columnHeight: n.value[v].height });
|
|
1008
|
+
}), console.log("分配完成,各列数据量:", n.value.map((l, p) => `列${p + 1}: ${l.items.length}个`)), console.log("分配完成,各列高度:", n.value.map((l, p) => `列${p + 1}: ${l.height}px`));
|
|
1009
|
+
}, m = (b) => {
|
|
1010
|
+
u("load", b);
|
|
1011
|
+
}, h = (b) => {
|
|
1012
|
+
u("error", b);
|
|
1013
|
+
};
|
|
1014
|
+
return watch(() => c.data, () => {
|
|
1015
|
+
console.log("数据变化,重新分配数据"), i();
|
|
1016
|
+
}, { deep: !0 }), watch(() => [c.column, c.maxColumn], () => {
|
|
1017
|
+
console.log("列数变化,更新列数"), f.value = Math.min(c.column, c.maxColumn), i();
|
|
1018
|
+
}), watch(() => [c.columnGap, c.rowGap], () => {
|
|
1019
|
+
console.log("间距变化,重新计算高度和分配数据"), i();
|
|
1020
|
+
}), onMounted(() => {
|
|
1021
|
+
console.log("===== 组件挂载 ====="), console.log("组件挂载,初始化数据"), console.log("初始数据量:", c.data.length);
|
|
1022
|
+
try {
|
|
1023
|
+
i(), console.log("===== 组件挂载完成 =====");
|
|
1024
|
+
} catch (b) {
|
|
1025
|
+
console.error("refresh函数执行失败:", b), console.log("===== 组件挂载失败 =====");
|
|
1026
|
+
}
|
|
1027
|
+
}), g({
|
|
1028
|
+
refresh: i
|
|
1029
|
+
}), (b, w) => (openBlock(), createElementBlock("div", {
|
|
1030
|
+
ref_key: "waterfallRef",
|
|
1031
|
+
ref: r
|
|
1032
|
+
}, [
|
|
1033
|
+
createElementVNode("div", _hoisted_1$1, [
|
|
1034
|
+
createTextVNode(" 列数: " + toDisplayString(f.value) + " ", 1),
|
|
1035
|
+
w[1] || (w[1] = createElementVNode("br", null, null, -1)),
|
|
1036
|
+
createTextVNode(" 数据总量: " + toDisplayString(s.data.length) + " ", 1),
|
|
1037
|
+
w[2] || (w[2] = createElementVNode("br", null, null, -1)),
|
|
1038
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.value, (l, p) => (openBlock(), createElementBlock(Fragment, { key: p }, [
|
|
1039
|
+
createTextVNode(" 列" + toDisplayString(p + 1) + "数据量: " + toDisplayString(l.items.length), 1),
|
|
1040
|
+
w[0] || (w[0] = createElementVNode("br", null, null, -1))
|
|
1041
|
+
], 64))), 128))
|
|
1042
|
+
]),
|
|
1043
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
1044
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.value, (l, p) => (openBlock(), createElementBlock("div", {
|
|
1045
|
+
key: p,
|
|
1046
|
+
class: "waterfall-column"
|
|
1047
|
+
}, [
|
|
1048
|
+
createElementVNode("div", _hoisted_3$1, " 列" + toDisplayString(p + 1) + ": " + toDisplayString(l.items.length) + "个元素 ", 1),
|
|
1049
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(l.items, (e, x) => (openBlock(), createElementBlock("div", {
|
|
1050
|
+
key: e[s.itemKey] || `col${p}-${x}`,
|
|
1051
|
+
class: "waterfall-item"
|
|
1052
|
+
}, [
|
|
1053
|
+
a.value ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
|
|
1054
|
+
createElementVNode("img", {
|
|
1055
|
+
src: e[s.imageKey],
|
|
1056
|
+
class: "waterfall-image",
|
|
1057
|
+
style: normalizeStyle({ height: d() + "px" }),
|
|
1058
|
+
onLoad: m,
|
|
1059
|
+
onError: h
|
|
1060
|
+
}, null, 44, _hoisted_5$1),
|
|
1061
|
+
createElementVNode("div", _hoisted_6, [
|
|
1062
|
+
renderSlot(b.$slots, "default", {
|
|
1063
|
+
item: e,
|
|
1064
|
+
index: x
|
|
1065
|
+
}, void 0, !0)
|
|
1066
|
+
])
|
|
1067
|
+
])) : (openBlock(), createElementBlock("img", {
|
|
1068
|
+
key: 1,
|
|
1069
|
+
src: e[s.imageKey],
|
|
1070
|
+
class: "waterfall-image",
|
|
1071
|
+
style: normalizeStyle({ height: d() + "px" }),
|
|
1072
|
+
onLoad: m,
|
|
1073
|
+
onError: h
|
|
1074
|
+
}, null, 44, _hoisted_7))
|
|
1075
|
+
]))), 128))
|
|
1076
|
+
]))), 128))
|
|
1077
|
+
])
|
|
1078
|
+
], 512));
|
|
1079
|
+
}
|
|
1080
|
+
}), HbisWaterfall = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-cae450ae"]]);
|
|
496
1081
|
var svga_lite_min = { exports: {} };
|
|
497
1082
|
/*!
|
|
498
1083
|
* svga.lite
|
|
@@ -503,63 +1088,63 @@ var svga_lite_min = { exports: {} };
|
|
|
503
1088
|
* Released under the MIT License.
|
|
504
1089
|
*/
|
|
505
1090
|
(function(module, exports$1) {
|
|
506
|
-
(function(
|
|
1091
|
+
(function(s, g) {
|
|
507
1092
|
module.exports = g();
|
|
508
1093
|
})(window, function() {
|
|
509
|
-
return function(
|
|
1094
|
+
return function(s) {
|
|
510
1095
|
var g = {};
|
|
511
|
-
function
|
|
1096
|
+
function o(t) {
|
|
512
1097
|
if (g[t]) return g[t].exports;
|
|
513
1098
|
var r = g[t] = { i: t, l: !1, exports: {} };
|
|
514
|
-
return
|
|
1099
|
+
return s[t].call(r.exports, r, r.exports, o), r.l = !0, r.exports;
|
|
515
1100
|
}
|
|
516
|
-
return
|
|
517
|
-
|
|
518
|
-
},
|
|
1101
|
+
return o.m = s, o.c = g, o.d = function(t, r, c) {
|
|
1102
|
+
o.o(t, r) || Object.defineProperty(t, r, { enumerable: !0, get: c });
|
|
1103
|
+
}, o.r = function(t) {
|
|
519
1104
|
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
|
-
},
|
|
1105
|
+
}, o.t = function(t, r) {
|
|
1106
|
+
if (1 & r && (t = o(t)), 8 & r || 4 & r && typeof t == "object" && t && t.__esModule) return t;
|
|
1107
|
+
var c = /* @__PURE__ */ Object.create(null);
|
|
1108
|
+
if (o.r(c), Object.defineProperty(c, "default", { enumerable: !0, value: t }), 2 & r && typeof t != "string") for (var u in t) o.d(c, u, (function(n) {
|
|
1109
|
+
return t[n];
|
|
1110
|
+
}).bind(null, u));
|
|
1111
|
+
return c;
|
|
1112
|
+
}, o.n = function(t) {
|
|
528
1113
|
var r = t && t.__esModule ? function() {
|
|
529
1114
|
return t.default;
|
|
530
1115
|
} : function() {
|
|
531
1116
|
return t;
|
|
532
1117
|
};
|
|
533
|
-
return
|
|
534
|
-
},
|
|
1118
|
+
return o.d(r, "a", r), r;
|
|
1119
|
+
}, o.o = function(t, r) {
|
|
535
1120
|
return Object.prototype.hasOwnProperty.call(t, r);
|
|
536
|
-
},
|
|
537
|
-
}([function(
|
|
1121
|
+
}, o.p = "", o(o.s = 1);
|
|
1122
|
+
}([function(s, g, o) {
|
|
538
1123
|
Object.defineProperty(g, "__esModule", { value: !0 });
|
|
539
|
-
var t = function(r,
|
|
540
|
-
this._d = r, this._transform =
|
|
1124
|
+
var t = function(r, c, u) {
|
|
1125
|
+
this._d = r, this._transform = c, this._styles = u;
|
|
541
1126
|
};
|
|
542
1127
|
g.default = t;
|
|
543
|
-
}, function(
|
|
1128
|
+
}, function(s, g, o) {
|
|
544
1129
|
Object.defineProperty(g, "__esModule", { value: !0 });
|
|
545
|
-
var t =
|
|
546
|
-
g.default =
|
|
547
|
-
}, function(
|
|
1130
|
+
var t = o(2), r = o(3), c = o(4), u = { Downloader: t.default, Parser: r.default, Player: c.default };
|
|
1131
|
+
g.default = u;
|
|
1132
|
+
}, function(s, g, o) {
|
|
548
1133
|
Object.defineProperty(g, "__esModule", { value: !0 });
|
|
549
1134
|
var t = function() {
|
|
550
1135
|
function r() {
|
|
551
1136
|
this.request = null;
|
|
552
1137
|
}
|
|
553
|
-
return r.prototype.get = function(
|
|
554
|
-
var
|
|
555
|
-
if (!
|
|
556
|
-
return new Promise(function(
|
|
557
|
-
var
|
|
558
|
-
|
|
559
|
-
!
|
|
560
|
-
},
|
|
561
|
-
return
|
|
562
|
-
},
|
|
1138
|
+
return r.prototype.get = function(c) {
|
|
1139
|
+
var u = this;
|
|
1140
|
+
if (!c) throw new Error("download link undefined");
|
|
1141
|
+
return new Promise(function(n, f) {
|
|
1142
|
+
var a = new XMLHttpRequest();
|
|
1143
|
+
a.open("GET", c, !0), a.responseType = "arraybuffer", a.onloadend = function() {
|
|
1144
|
+
!a.response || a.status !== 200 && a.status !== 304 ? f(a) : n(a.response);
|
|
1145
|
+
}, a.onerror = function() {
|
|
1146
|
+
return f(a.response);
|
|
1147
|
+
}, a.send(), u.request = a;
|
|
563
1148
|
});
|
|
564
1149
|
}, r.prototype.cancel = function() {
|
|
565
1150
|
this.request && this.request.abort();
|
|
@@ -577,39 +1162,39 @@ var svga_lite_min = { exports: {} };
|
|
|
577
1162
|
var disableWorker = (_a === void 0 ? { disableWorker: !1 } : _a).disableWorker;
|
|
578
1163
|
disableWorker ? (eval(WORKER), this.worker = window.SVGAParserMockWorker) : this.worker = new Worker(window.URL.createObjectURL(new Blob([WORKER])));
|
|
579
1164
|
}
|
|
580
|
-
return Parser.prototype.do = function(
|
|
581
|
-
var g = this,
|
|
582
|
-
if (
|
|
583
|
-
if (!
|
|
1165
|
+
return Parser.prototype.do = function(s) {
|
|
1166
|
+
var g = this, o = new Uint8Array(s, 0, 4);
|
|
1167
|
+
if (o[0] == 80 && o[1] == 75 && o[2] == 3 && o[3] == 4) throw "this parser not support version@1.x of svga.";
|
|
1168
|
+
if (!s) throw new Error("Parser Data not found");
|
|
584
1169
|
if (!this.worker) throw new Error("Parser Worker not found");
|
|
585
1170
|
return new Promise(function(t, r) {
|
|
586
|
-
var
|
|
587
|
-
g.worker.disableWorker ? ((
|
|
588
|
-
t(
|
|
589
|
-
},
|
|
590
|
-
var
|
|
591
|
-
t(
|
|
1171
|
+
var c;
|
|
1172
|
+
g.worker.disableWorker ? ((c = g.worker).onmessageCallback = function(u) {
|
|
1173
|
+
t(u);
|
|
1174
|
+
}, c.onmessage({ data: s })) : ((c = g.worker).postMessage(s), c.onmessage = function(u) {
|
|
1175
|
+
var n = u.data;
|
|
1176
|
+
t(n);
|
|
592
1177
|
});
|
|
593
1178
|
});
|
|
594
1179
|
}, Parser.prototype.destroy = function() {
|
|
595
|
-
var
|
|
596
|
-
|
|
1180
|
+
var s = this.worker;
|
|
1181
|
+
s.terminate && s.terminate();
|
|
597
1182
|
}, Parser;
|
|
598
1183
|
}();
|
|
599
1184
|
exports$1.default = Parser;
|
|
600
|
-
}, function(
|
|
1185
|
+
}, function(s, g, o) {
|
|
601
1186
|
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 =
|
|
1187
|
+
var t, r, c, u = o(5), n = o(9);
|
|
1188
|
+
(function(d) {
|
|
1189
|
+
d.START = "start", d.RESUME = "resume", d.PROCESS = "process", d.PAUSE = "pause", d.STOP = "stop", d.END = "end", d.CLEAR = "clear";
|
|
1190
|
+
})(t || (t = {})), function(d) {
|
|
1191
|
+
d.FORWARDS = "forwards", d.BACKWARDS = "backwards";
|
|
1192
|
+
}(r || (r = {})), function(d) {
|
|
1193
|
+
d.FORWARDS = "forwards", d.FALLBACKS = "fallbacks";
|
|
1194
|
+
}(c || (c = {}));
|
|
1195
|
+
var f = typeof window < "u" && "IntersectionObserver" in window, a = function() {
|
|
1196
|
+
function d(i, m, h) {
|
|
1197
|
+
if (this.videoItem = m, this.loop = !0, this.fillMode = r.FORWARDS, this.playMode = c.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
1198
|
}, resume: function() {
|
|
614
1199
|
}, process: function() {
|
|
615
1200
|
}, pause: function() {
|
|
@@ -618,160 +1203,160 @@ var svga_lite_min = { exports: {} };
|
|
|
618
1203
|
}, clear: function() {
|
|
619
1204
|
} }, this.container = typeof i == "string" ? document.body.querySelector(i) : i, !this.container) throw new Error("container undefined.");
|
|
620
1205
|
if (!this.container.getContext) throw new Error("container should be HTMLCanvasElement.");
|
|
621
|
-
this._renderer = new
|
|
1206
|
+
this._renderer = new u.default(this), this._animator = new n.default(), this.videoItem && this.mount(m), h && this.set(h);
|
|
622
1207
|
}
|
|
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
|
-
|
|
1208
|
+
return d.prototype.set = function(i) {
|
|
1209
|
+
var m = this;
|
|
1210
|
+
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), f && this.intersectionObserverRender ? (this._intersectionObserver = new IntersectionObserver(function(h) {
|
|
1211
|
+
h[0].intersectionRatio <= 0 ? m.intersectionObserverRenderShow && (m.intersectionObserverRenderShow = !1) : !m.intersectionObserverRenderShow && (m.intersectionObserverRenderShow = !0);
|
|
627
1212
|
}, { 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
|
-
|
|
1213
|
+
}, d.prototype.mount = function(i) {
|
|
1214
|
+
var m = this;
|
|
1215
|
+
return new Promise(function(h, b) {
|
|
1216
|
+
m.currentFrame = 0, m.progress = 0, m.totalFramesCount = i.frames - 1, m.videoItem = i, m._renderer.prepare().then(h), m._renderer.clear(), m._setSize();
|
|
632
1217
|
});
|
|
633
|
-
},
|
|
1218
|
+
}, d.prototype.start = function() {
|
|
634
1219
|
if (!this.videoItem) throw new Error("video item undefined.");
|
|
635
1220
|
this._renderer.clear(), this._startAnimation(), this.$onEvent.start();
|
|
636
|
-
},
|
|
1221
|
+
}, d.prototype.resume = function() {
|
|
637
1222
|
if (!this.videoItem) throw new Error("video item undefined.");
|
|
638
1223
|
this._startAnimation(), this.$onEvent.resume();
|
|
639
|
-
},
|
|
1224
|
+
}, d.prototype.pause = function() {
|
|
640
1225
|
this._animator && this._animator.stop(), this.$onEvent.pause();
|
|
641
|
-
},
|
|
1226
|
+
}, d.prototype.stop = function() {
|
|
642
1227
|
this._animator && this._animator.stop(), this.currentFrame = 0, this._renderer.drawFrame(this.currentFrame), this.$onEvent.stop();
|
|
643
|
-
},
|
|
1228
|
+
}, d.prototype.clear = function() {
|
|
644
1229
|
this._animator && this._animator.stop(), this._renderer.clear(), this.$onEvent.clear();
|
|
645
|
-
},
|
|
1230
|
+
}, d.prototype.destroy = function() {
|
|
646
1231
|
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
|
|
1232
|
+
}, d.prototype.$on = function(i, m) {
|
|
1233
|
+
var h = this;
|
|
1234
|
+
return this.$onEvent[i] = m, i === "end" && (this._animator.onEnd = function() {
|
|
1235
|
+
return h.$onEvent.end();
|
|
651
1236
|
}), this;
|
|
652
|
-
},
|
|
653
|
-
var i = this,
|
|
654
|
-
this.currentFrame ===
|
|
1237
|
+
}, d.prototype._startAnimation = function() {
|
|
1238
|
+
var i = this, m = this, h = m.playMode, b = m.totalFramesCount, w = m.startFrame, l = m.endFrame, p = m.videoItem;
|
|
1239
|
+
this.currentFrame === b && (this.currentFrame = w || 0), this._animator.startValue = h === "fallbacks" ? l || b : w || 0, this._animator.endValue = h === "fallbacks" ? w || 0 : l || b;
|
|
655
1240
|
var e = p.frames;
|
|
656
|
-
|
|
657
|
-
|
|
1241
|
+
l > 0 && l > w ? e = l - w : l <= 0 && w > 0 && (e = p.frames - w), this._animator.duration = e * (1 / p.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) {
|
|
1242
|
+
x = Math.floor(x), i.currentFrame !== x && (i.currentFrame = x, i.progress = parseFloat((x + 1).toString()) / parseFloat(p.frames.toString()) * 100, i._renderer.drawFrame(i.currentFrame), i.$onEvent.process());
|
|
658
1243
|
}, this._animator.start(this.currentFrame);
|
|
659
|
-
},
|
|
1244
|
+
}, d.prototype._setSize = function() {
|
|
660
1245
|
var i = this.videoItem.videoSize;
|
|
661
1246
|
this.container.width = i.width, this.container.height = i.height;
|
|
662
|
-
},
|
|
1247
|
+
}, d;
|
|
663
1248
|
}();
|
|
664
|
-
g.default =
|
|
665
|
-
}, function(
|
|
1249
|
+
g.default = a;
|
|
1250
|
+
}, function(s, g, o) {
|
|
666
1251
|
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(
|
|
1252
|
+
var t = o(6), r = function() {
|
|
1253
|
+
function c(u) {
|
|
1254
|
+
this._bitmapCache = {}, this._dynamicElements = {}, this._frames = {}, this._player = u;
|
|
1255
|
+
var n = this._player.container;
|
|
1256
|
+
this._ofsCanvas = window.OffscreenCanvas ? new window.OffscreenCanvas(n.width, n.height) : document.createElement("canvas");
|
|
672
1257
|
}
|
|
673
|
-
return
|
|
674
|
-
var
|
|
675
|
-
return new Promise(function(
|
|
676
|
-
if (
|
|
677
|
-
|
|
678
|
-
var
|
|
679
|
-
for (var i in
|
|
680
|
-
var
|
|
681
|
-
if (typeof
|
|
1258
|
+
return c.prototype.prepare = function() {
|
|
1259
|
+
var u = this;
|
|
1260
|
+
return new Promise(function(n, f) {
|
|
1261
|
+
if (u._bitmapCache = {}, u._player.videoItem.images && Object.keys(u._player.videoItem.images).length != 0) {
|
|
1262
|
+
u._player.videoItem.dynamicElements && (u._dynamicElements = u._player.videoItem.dynamicElements);
|
|
1263
|
+
var a = 0, d = 0;
|
|
1264
|
+
for (var i in u._player.videoItem.images) {
|
|
1265
|
+
var m = u._player.videoItem.images[i];
|
|
1266
|
+
if (typeof m != "string" || m.indexOf("iVBO") !== 0 && m.indexOf("/9j/2w") !== 0) u._bitmapCache[i] = m;
|
|
682
1267
|
else {
|
|
683
|
-
|
|
684
|
-
var
|
|
685
|
-
|
|
686
|
-
++
|
|
1268
|
+
a++;
|
|
1269
|
+
var h = document.createElement("img");
|
|
1270
|
+
h.src = "data:image/png;base64," + m, u._bitmapCache[i] = h, h.onload = function() {
|
|
1271
|
+
++d === a && n();
|
|
687
1272
|
};
|
|
688
1273
|
}
|
|
689
1274
|
}
|
|
690
|
-
} else
|
|
1275
|
+
} else n();
|
|
691
1276
|
});
|
|
692
|
-
},
|
|
1277
|
+
}, c.prototype.clear = function() {
|
|
693
1278
|
this._player.container.width = this._player.container.width;
|
|
694
|
-
},
|
|
695
|
-
var
|
|
696
|
-
if (!
|
|
1279
|
+
}, c.prototype.drawFrame = function(u) {
|
|
1280
|
+
var n = this._player;
|
|
1281
|
+
if (!n.intersectionObserverRender || n.intersectionObserverRenderShow) {
|
|
697
1282
|
this.clear();
|
|
698
|
-
var
|
|
699
|
-
if (this._player.cacheFrames && this._frames[
|
|
700
|
-
var
|
|
701
|
-
|
|
1283
|
+
var f = n.container.getContext("2d");
|
|
1284
|
+
if (this._player.cacheFrames && this._frames[u]) {
|
|
1285
|
+
var a = this._frames[u];
|
|
1286
|
+
f.drawImage(a, 0, 0, a.width, a.height, 0, 0, a.width, a.height);
|
|
702
1287
|
} else {
|
|
703
|
-
var
|
|
704
|
-
if (
|
|
705
|
-
var i =
|
|
706
|
-
|
|
707
|
-
} else this._frames[
|
|
1288
|
+
var d = this._ofsCanvas;
|
|
1289
|
+
if (d.width = this._player.container.width, d.height = this._player.container.height, t.default(d, this._bitmapCache, this._dynamicElements, this._player.videoItem, this._player.currentFrame), f.drawImage(d, 0, 0, d.width, d.height, 0, 0, d.width, d.height), this._player.cacheFrames) if ("toDataURL" in d) {
|
|
1290
|
+
var i = d.toDataURL(), m = new Image();
|
|
1291
|
+
m.src = i, this._frames[u] = m;
|
|
1292
|
+
} else this._frames[u] = d.transferToImageBitmap();
|
|
708
1293
|
}
|
|
709
1294
|
}
|
|
710
|
-
},
|
|
1295
|
+
}, c;
|
|
711
1296
|
}();
|
|
712
1297
|
g.default = r;
|
|
713
|
-
}, function(
|
|
1298
|
+
}, function(s, g, o) {
|
|
714
1299
|
Object.defineProperty(g, "__esModule", { value: !0 }), g.default = void 0;
|
|
715
|
-
var t =
|
|
716
|
-
function
|
|
1300
|
+
var t = u(o(0)), r = u(o(7)), c = u(o(8));
|
|
1301
|
+
function u(i) {
|
|
717
1302
|
return i && i.__esModule ? i : { default: i };
|
|
718
1303
|
}
|
|
719
|
-
var
|
|
720
|
-
function
|
|
721
|
-
var
|
|
722
|
-
|
|
1304
|
+
var n = "MLHVCSQRZmlhvcsqrz";
|
|
1305
|
+
function f(i, m) {
|
|
1306
|
+
var h = m._styles;
|
|
1307
|
+
h !== void 0 && (h && h.stroke ? i.strokeStyle = "rgba(".concat(parseInt((255 * h.stroke[0]).toString()), ", ").concat(parseInt((255 * h.stroke[1]).toString()), ", ").concat(parseInt((255 * h.stroke[2]).toString()), ", ").concat(h.stroke[3], ")") : i.strokeStyle = "transparent", h && (i.lineWidth = h.strokeWidth || void 0, i.lineCap = h.lineCap || void 0, i.lineJoin = h.lineJoin || void 0, i.miterLimit = h.miterLimit || void 0), h && h.fill ? i.fillStyle = "rgba(".concat(parseInt((255 * h.fill[0]).toString()), ", ").concat(parseInt((255 * h.fill[1]).toString()), ", ").concat(parseInt((255 * h.fill[2]).toString()), ", ").concat(h.fill[3], ")") : i.fillStyle = "transparent", h && h.lineDash && i.setLineDash(h.lineDash));
|
|
723
1308
|
}
|
|
724
|
-
function
|
|
725
|
-
i.save(),
|
|
726
|
-
var
|
|
727
|
-
i.beginPath(),
|
|
728
|
-
if (
|
|
729
|
-
var
|
|
730
|
-
if (
|
|
731
|
-
var
|
|
732
|
-
(function(p, e,
|
|
733
|
-
switch (
|
|
1309
|
+
function a(i, m) {
|
|
1310
|
+
i.save(), f(i, m), m._transform !== void 0 && m._transform !== null && i.transform(m._transform.a || 1, m._transform.b || 0, m._transform.c || 0, m._transform.d || 1, m._transform.tx || 0, m._transform.ty || 0);
|
|
1311
|
+
var h = { x: 0, y: 0, x1: 0, y1: 0, x2: 0, y2: 0 };
|
|
1312
|
+
i.beginPath(), m._d.replace(/([a-zA-Z])/g, "|||$1 ").replace(/,/g, " ").split("|||").forEach(function(b) {
|
|
1313
|
+
if (b.length != 0) {
|
|
1314
|
+
var w = b.substr(0, 1);
|
|
1315
|
+
if (n.indexOf(w) >= 0) {
|
|
1316
|
+
var l = b.substr(1).trim().split(" ");
|
|
1317
|
+
(function(p, e, x, v) {
|
|
1318
|
+
switch (x) {
|
|
734
1319
|
case "M":
|
|
735
|
-
e.x = Number(
|
|
1320
|
+
e.x = Number(v[0]), e.y = Number(v[1]), p.moveTo(e.x, e.y);
|
|
736
1321
|
break;
|
|
737
1322
|
case "m":
|
|
738
|
-
e.x += Number(
|
|
1323
|
+
e.x += Number(v[0]), e.y += Number(v[1]), p.moveTo(e.x, e.y);
|
|
739
1324
|
break;
|
|
740
1325
|
case "L":
|
|
741
|
-
e.x = Number(
|
|
1326
|
+
e.x = Number(v[0]), e.y = Number(v[1]), p.lineTo(e.x, e.y);
|
|
742
1327
|
break;
|
|
743
1328
|
case "l":
|
|
744
|
-
e.x += Number(
|
|
1329
|
+
e.x += Number(v[0]), e.y += Number(v[1]), p.lineTo(e.x, e.y);
|
|
745
1330
|
break;
|
|
746
1331
|
case "H":
|
|
747
|
-
e.x = Number(
|
|
1332
|
+
e.x = Number(v[0]), p.lineTo(e.x, e.y);
|
|
748
1333
|
break;
|
|
749
1334
|
case "h":
|
|
750
|
-
e.x += Number(
|
|
1335
|
+
e.x += Number(v[0]), p.lineTo(e.x, e.y);
|
|
751
1336
|
break;
|
|
752
1337
|
case "V":
|
|
753
|
-
e.y = Number(
|
|
1338
|
+
e.y = Number(v[0]), p.lineTo(e.x, e.y);
|
|
754
1339
|
break;
|
|
755
1340
|
case "v":
|
|
756
|
-
e.y += Number(
|
|
1341
|
+
e.y += Number(v[0]), p.lineTo(e.x, e.y);
|
|
757
1342
|
break;
|
|
758
1343
|
case "C":
|
|
759
|
-
e.x1 = Number(
|
|
1344
|
+
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]), p.bezierCurveTo(e.x1, e.y1, e.x2, e.y2, e.x, e.y);
|
|
760
1345
|
break;
|
|
761
1346
|
case "c":
|
|
762
|
-
e.x1 = e.x + Number(
|
|
1347
|
+
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]), p.bezierCurveTo(e.x1, e.y1, e.x2, e.y2, e.x, e.y);
|
|
763
1348
|
break;
|
|
764
1349
|
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(
|
|
1350
|
+
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]), p.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]), p.quadraticCurveTo(e.x1, e.y1, e.x, e.y));
|
|
766
1351
|
break;
|
|
767
1352
|
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(
|
|
1353
|
+
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]), p.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]), p.quadraticCurveTo(e.x1, e.y1, e.x, e.y));
|
|
769
1354
|
break;
|
|
770
1355
|
case "Q":
|
|
771
|
-
e.x1 = Number(
|
|
1356
|
+
e.x1 = Number(v[0]), e.y1 = Number(v[1]), e.x = Number(v[2]), e.y = Number(v[3]), p.quadraticCurveTo(e.x1, e.y1, e.x, e.y);
|
|
772
1357
|
break;
|
|
773
1358
|
case "q":
|
|
774
|
-
e.x1 = e.x + Number(
|
|
1359
|
+
e.x1 = e.x + Number(v[0]), e.y1 = e.y + Number(v[1]), e.x += Number(v[2]), e.y += Number(v[3]), p.quadraticCurveTo(e.x1, e.y1, e.x, e.y);
|
|
775
1360
|
break;
|
|
776
1361
|
case "A":
|
|
777
1362
|
case "a":
|
|
@@ -780,80 +1365,80 @@ var svga_lite_min = { exports: {} };
|
|
|
780
1365
|
case "z":
|
|
781
1366
|
p.closePath();
|
|
782
1367
|
}
|
|
783
|
-
})(i,
|
|
1368
|
+
})(i, h, w, l);
|
|
784
1369
|
}
|
|
785
1370
|
}
|
|
786
|
-
}),
|
|
1371
|
+
}), m._styles && m._styles.fill ? i.fill() : m._styles && m._styles.stroke && i.stroke(), i.restore();
|
|
787
1372
|
}
|
|
788
|
-
var
|
|
789
|
-
var
|
|
790
|
-
return
|
|
791
|
-
var e = p.frames[
|
|
1373
|
+
var d = function(i, m, h, b, w) {
|
|
1374
|
+
var l = i.getContext("2d");
|
|
1375
|
+
return b.sprites.forEach(function(p) {
|
|
1376
|
+
var e = p.frames[w];
|
|
792
1377
|
if (!(e.alpha < 0.05)) {
|
|
793
|
-
|
|
794
|
-
var
|
|
795
|
-
|
|
796
|
-
var
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
var
|
|
801
|
-
|
|
802
|
-
}(
|
|
803
|
-
|
|
804
|
-
var
|
|
805
|
-
|
|
806
|
-
}(
|
|
807
|
-
}),
|
|
1378
|
+
l.save(), l.globalAlpha = e.alpha, l.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);
|
|
1379
|
+
var x = m[p.imageKey];
|
|
1380
|
+
x && (e.maskPath !== void 0 && e.maskPath !== null && (e.maskPath._styles = void 0, a(l, e.maskPath), l.clip()), l.drawImage(x, 0, 0));
|
|
1381
|
+
var v = h[p.imageKey];
|
|
1382
|
+
v && l.drawImage(v, (e.layout.width - v.width) / 2, (e.layout.height - v.height) / 2), e.shapes && e.shapes.forEach(function(_) {
|
|
1383
|
+
_.type === "shape" && _.pathArgs && _.pathArgs.d ? a(l, new t.default(_.pathArgs.d, _.transform, _.styles)) : _.type === "ellipse" && _.pathArgs ? function(E, S) {
|
|
1384
|
+
E.save(), f(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);
|
|
1385
|
+
var T = S._x - S._radiusX, C = S._y - S._radiusY, I = 2 * S._radiusX, B = 2 * S._radiusY, O = I / 2 * 0.5522848, j = B / 2 * 0.5522848, P = T + I, R = C + B, M = T + I / 2, F = C + B / 2;
|
|
1386
|
+
E.beginPath(), E.moveTo(T, F), E.bezierCurveTo(T, F - j, M - O, C, M, C), E.bezierCurveTo(M + O, C, P, F - j, P, F), E.bezierCurveTo(P, F + j, M + O, R, M, R), E.bezierCurveTo(M - O, R, T, F + j, T, F), S._styles && S._styles.fill ? E.fill() : S._styles && S._styles.stroke && E.stroke(), E.restore();
|
|
1387
|
+
}(l, 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) {
|
|
1388
|
+
E.save(), f(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);
|
|
1389
|
+
var T = S._x, C = S._y, I = S._width, B = S._height, O = S._cornerRadius;
|
|
1390
|
+
I < 2 * O && (O = I / 2), B < 2 * O && (O = B / 2), E.beginPath(), E.moveTo(T + O, C), E.arcTo(T + I, C, T + I, C + B, O), E.arcTo(T + I, C + B, T, C + B, O), E.arcTo(T, C + B, T, C, O), E.arcTo(T, C, T + I, C, O), E.closePath(), S._styles && S._styles.fill ? E.fill() : S._styles && S._styles.stroke && E.stroke(), E.restore();
|
|
1391
|
+
}(l, new c.default(parseFloat(_.pathArgs.x) || 0, parseFloat(_.pathArgs.y) || 0, parseFloat(_.pathArgs.width) || 0, parseFloat(_.pathArgs.height) || 0, parseFloat(_.pathArgs.cornerRadius) || 0, _.transform, _.styles));
|
|
1392
|
+
}), l.restore();
|
|
808
1393
|
}
|
|
809
1394
|
}), i;
|
|
810
1395
|
};
|
|
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 =
|
|
1396
|
+
g.default = d;
|
|
1397
|
+
}, function(s, g, o) {
|
|
1398
|
+
var t, r = (t = function(u, n) {
|
|
1399
|
+
return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(f, a) {
|
|
1400
|
+
f.__proto__ = a;
|
|
1401
|
+
} || function(f, a) {
|
|
1402
|
+
for (var d in a) Object.prototype.hasOwnProperty.call(a, d) && (f[d] = a[d]);
|
|
1403
|
+
})(u, n);
|
|
1404
|
+
}, function(u, n) {
|
|
1405
|
+
function f() {
|
|
1406
|
+
this.constructor = u;
|
|
822
1407
|
}
|
|
823
|
-
t(
|
|
1408
|
+
t(u, n), u.prototype = n === null ? Object.create(n) : (f.prototype = n.prototype, new f());
|
|
824
1409
|
});
|
|
825
1410
|
Object.defineProperty(g, "__esModule", { value: !0 });
|
|
826
|
-
var
|
|
827
|
-
function
|
|
828
|
-
var
|
|
829
|
-
return
|
|
1411
|
+
var c = function(u) {
|
|
1412
|
+
function n(f, a, d, i, m, h) {
|
|
1413
|
+
var b = u.call(this) || this;
|
|
1414
|
+
return b._x = f, b._y = a, b._radiusX = d, b._radiusY = i, b._transform = m, b._styles = h, b;
|
|
830
1415
|
}
|
|
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 =
|
|
1416
|
+
return r(n, u), n;
|
|
1417
|
+
}(o(0).default);
|
|
1418
|
+
g.default = c;
|
|
1419
|
+
}, function(s, g, o) {
|
|
1420
|
+
var t, r = (t = function(u, n) {
|
|
1421
|
+
return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(f, a) {
|
|
1422
|
+
f.__proto__ = a;
|
|
1423
|
+
} || function(f, a) {
|
|
1424
|
+
for (var d in a) Object.prototype.hasOwnProperty.call(a, d) && (f[d] = a[d]);
|
|
1425
|
+
})(u, n);
|
|
1426
|
+
}, function(u, n) {
|
|
1427
|
+
function f() {
|
|
1428
|
+
this.constructor = u;
|
|
844
1429
|
}
|
|
845
|
-
t(
|
|
1430
|
+
t(u, n), u.prototype = n === null ? Object.create(n) : (f.prototype = n.prototype, new f());
|
|
846
1431
|
});
|
|
847
1432
|
Object.defineProperty(g, "__esModule", { value: !0 });
|
|
848
|
-
var
|
|
849
|
-
function
|
|
850
|
-
var
|
|
851
|
-
return
|
|
1433
|
+
var c = function(u) {
|
|
1434
|
+
function n(f, a, d, i, m, h, b) {
|
|
1435
|
+
var w = u.call(this) || this;
|
|
1436
|
+
return w._x = f, w._y = a, w._width = d, w._height = i, w._cornerRadius = m, w._transform = h, w._styles = b, w;
|
|
852
1437
|
}
|
|
853
|
-
return r(
|
|
854
|
-
}(
|
|
855
|
-
g.default =
|
|
856
|
-
}, function(
|
|
1438
|
+
return r(n, u), n;
|
|
1439
|
+
}(o(0).default);
|
|
1440
|
+
g.default = c;
|
|
1441
|
+
}, function(s, g, o) {
|
|
857
1442
|
Object.defineProperty(g, "__esModule", { value: !0 });
|
|
858
1443
|
var t = function() {
|
|
859
1444
|
function r() {
|
|
@@ -864,22 +1449,22 @@ var svga_lite_min = { exports: {} };
|
|
|
864
1449
|
}, this.onEnd = function() {
|
|
865
1450
|
}, this._isRunning = !1, this._mStartTime = 0, this._currentFrication = 0, this._worker = null;
|
|
866
1451
|
}
|
|
867
|
-
return r.prototype.start = function(
|
|
868
|
-
this.doStart(
|
|
1452
|
+
return r.prototype.start = function(c) {
|
|
1453
|
+
this.doStart(c);
|
|
869
1454
|
}, r.prototype.stop = function() {
|
|
870
1455
|
this._doStop();
|
|
871
1456
|
}, Object.defineProperty(r.prototype, "animatedValue", { get: function() {
|
|
872
1457
|
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(),
|
|
1458
|
+
}, enumerable: !1, configurable: !0 }), r.prototype.doStart = function(c) {
|
|
1459
|
+
this._isRunning = !0, this._mStartTime = this._currentTimeMillsecond(), c && (this._mStartTime -= c / (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
1460
|
setTimeout(function() {postMessage(null)}, 1 / 60)
|
|
876
1461
|
}`])))), this.onStart(), this._doFrame();
|
|
877
1462
|
}, r.prototype._doStop = function() {
|
|
878
1463
|
this._isRunning = !1, this._worker !== null && (this._worker.terminate(), this._worker = null);
|
|
879
1464
|
}, r.prototype._doFrame = function() {
|
|
880
1465
|
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
|
-
|
|
1466
|
+
}, r.prototype._doDeltaTime = function(c) {
|
|
1467
|
+
c >= this.duration * this.loop ? (this._currentFrication = this.fillRule === 1 ? 0 : 1, this._isRunning = !1) : this._currentFrication = c % this.duration / this.duration, this.onUpdate(this.animatedValue), this._isRunning === !1 && (this._worker !== null && (this._worker.terminate(), this._worker = null), this.onEnd());
|
|
883
1468
|
}, r;
|
|
884
1469
|
}();
|
|
885
1470
|
g.default = t;
|
|
@@ -966,308 +1551,177 @@ const _sfc_main$1 = {
|
|
|
966
1551
|
*/
|
|
967
1552
|
"error"
|
|
968
1553
|
],
|
|
969
|
-
setup(
|
|
1554
|
+
setup(s, { expose: g, emit: o }) {
|
|
970
1555
|
useCssVars((e) => ({
|
|
971
|
-
|
|
972
|
-
|
|
1556
|
+
v404d30eb: s.width,
|
|
1557
|
+
a0ec1abc: s.height
|
|
973
1558
|
}));
|
|
974
|
-
const t =
|
|
975
|
-
let
|
|
976
|
-
const
|
|
1559
|
+
const t = s, r = o, c = ref(null), u = ref(null);
|
|
1560
|
+
let n = null, f = null, a = null;
|
|
1561
|
+
const d = async () => {
|
|
977
1562
|
try {
|
|
978
|
-
|
|
1563
|
+
n = new svga_lite_minExports.Parser(), a = await n.load(t.src), f = new svga_lite_minExports.Player(u.value), f.loop = t.loop, f.speed = t.speed, f.onStart = () => r("play"), f.onPause = () => r("pause"), f.onEnd = () => r("ended"), f.onFrame = () => r("progress", f.progress), await f.setAnimationData(a), t.progress > 0 && (f.progress = t.progress), t.autoplay && f.start(), r("loaded");
|
|
979
1564
|
} catch (e) {
|
|
980
1565
|
console.error("SVGA 加载失败:", e), r("error", e);
|
|
981
1566
|
}
|
|
982
1567
|
}, i = () => {
|
|
983
|
-
|
|
984
|
-
},
|
|
985
|
-
|
|
986
|
-
},
|
|
987
|
-
|
|
988
|
-
},
|
|
989
|
-
|
|
990
|
-
},
|
|
991
|
-
|
|
992
|
-
},
|
|
993
|
-
|
|
1568
|
+
f && f.start();
|
|
1569
|
+
}, m = () => {
|
|
1570
|
+
f && f.pause();
|
|
1571
|
+
}, h = () => {
|
|
1572
|
+
f && f.stop();
|
|
1573
|
+
}, b = () => {
|
|
1574
|
+
f && (f.stop(), f.start());
|
|
1575
|
+
}, w = (e) => {
|
|
1576
|
+
f && (f.progress = e);
|
|
1577
|
+
}, l = (e) => {
|
|
1578
|
+
f && (f.speed = e);
|
|
994
1579
|
}, p = (e) => {
|
|
995
|
-
|
|
1580
|
+
f && (f.loop = e);
|
|
996
1581
|
};
|
|
997
1582
|
return g({
|
|
998
1583
|
play: i,
|
|
999
|
-
pause:
|
|
1000
|
-
stop:
|
|
1001
|
-
restart:
|
|
1002
|
-
setProgress:
|
|
1003
|
-
setSpeed:
|
|
1584
|
+
pause: m,
|
|
1585
|
+
stop: h,
|
|
1586
|
+
restart: b,
|
|
1587
|
+
setProgress: w,
|
|
1588
|
+
setSpeed: l,
|
|
1004
1589
|
setLoop: p
|
|
1005
1590
|
}), watch(() => t.src, async (e) => {
|
|
1006
|
-
e && await
|
|
1591
|
+
e && await d();
|
|
1007
1592
|
}), watch(() => t.loop, (e) => {
|
|
1008
1593
|
p(e);
|
|
1009
1594
|
}), watch(() => t.speed, (e) => {
|
|
1010
|
-
|
|
1595
|
+
l(e);
|
|
1011
1596
|
}), watch(() => t.progress, (e) => {
|
|
1012
|
-
|
|
1597
|
+
w(e);
|
|
1013
1598
|
}), onMounted(async () => {
|
|
1014
|
-
await nextTick(), await
|
|
1599
|
+
await nextTick(), await d();
|
|
1015
1600
|
}), onUnmounted(() => {
|
|
1016
|
-
|
|
1017
|
-
}), (e,
|
|
1601
|
+
f && (f.stop(), f = null), n && (n = null), a = null;
|
|
1602
|
+
}), (e, x) => (openBlock(), createElementBlock("div", {
|
|
1018
1603
|
ref_key: "containerRef",
|
|
1019
|
-
ref:
|
|
1604
|
+
ref: c,
|
|
1020
1605
|
class: "svga-player-container"
|
|
1021
1606
|
}, [
|
|
1022
1607
|
createElementVNode("canvas", {
|
|
1023
1608
|
ref_key: "canvasRef",
|
|
1024
|
-
ref:
|
|
1609
|
+
ref: u,
|
|
1025
1610
|
class: "svga-player-canvas"
|
|
1026
1611
|
}, null, 512)
|
|
1027
1612
|
], 512));
|
|
1028
1613
|
}
|
|
1029
|
-
}, HbisSvgaPlayer = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
1030
|
-
|
|
1614
|
+
}, HbisSvgaPlayer = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-94c319f8"]]), _hoisted_1 = { class: "search-dropdown" }, _hoisted_2 = ["placeholder"], _hoisted_3 = {
|
|
1615
|
+
key: 0,
|
|
1616
|
+
class: "dropdown-list"
|
|
1617
|
+
}, _hoisted_4 = ["onClick"], _hoisted_5 = { class: "item-text" }, _sfc_main = {
|
|
1618
|
+
__name: "hbis-search-input",
|
|
1031
1619
|
props: {
|
|
1032
|
-
|
|
1033
|
-
data: {
|
|
1620
|
+
list: {
|
|
1034
1621
|
type: Array,
|
|
1035
1622
|
default: () => []
|
|
1036
1623
|
},
|
|
1037
|
-
|
|
1038
|
-
speed: {
|
|
1039
|
-
type: Number,
|
|
1040
|
-
default: 1
|
|
1041
|
-
},
|
|
1042
|
-
// 滚动方向:vertical(垂直)或horizontal(水平)
|
|
1043
|
-
direction: {
|
|
1624
|
+
placeholder: {
|
|
1044
1625
|
type: String,
|
|
1045
|
-
default: "
|
|
1046
|
-
validator: (y) => ["vertical", "horizontal"].includes(y)
|
|
1047
|
-
},
|
|
1048
|
-
// 鼠标悬停是否暂停
|
|
1049
|
-
pauseOnHover: {
|
|
1050
|
-
type: Boolean,
|
|
1051
|
-
default: !0
|
|
1626
|
+
default: "请输入关键词搜索"
|
|
1052
1627
|
},
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
default: 40
|
|
1628
|
+
defaultValue: {
|
|
1629
|
+
type: String,
|
|
1630
|
+
default: ""
|
|
1057
1631
|
},
|
|
1058
|
-
|
|
1059
|
-
itemWidth: {
|
|
1632
|
+
maxHeight: {
|
|
1060
1633
|
type: Number,
|
|
1061
|
-
default:
|
|
1062
|
-
},
|
|
1063
|
-
// 容器高度
|
|
1064
|
-
containerHeight: {
|
|
1065
|
-
type: [Number, String],
|
|
1066
|
-
default: 300
|
|
1067
|
-
},
|
|
1068
|
-
// 容器宽度
|
|
1069
|
-
containerWidth: {
|
|
1070
|
-
type: [Number, String],
|
|
1071
|
-
default: "100%"
|
|
1634
|
+
default: 400
|
|
1072
1635
|
},
|
|
1073
|
-
|
|
1074
|
-
loop: {
|
|
1636
|
+
showClear: {
|
|
1075
1637
|
type: Boolean,
|
|
1076
1638
|
default: !0
|
|
1077
|
-
},
|
|
1078
|
-
// 自定义列表项类名
|
|
1079
|
-
customItemClass: {
|
|
1080
|
-
type: String,
|
|
1081
|
-
default: ""
|
|
1082
|
-
},
|
|
1083
|
-
// 自定义列表项样式
|
|
1084
|
-
itemStyle: {
|
|
1085
|
-
type: Object,
|
|
1086
|
-
default: () => ({})
|
|
1087
1639
|
}
|
|
1088
1640
|
},
|
|
1089
|
-
emits: ["
|
|
1090
|
-
setup(
|
|
1091
|
-
const
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
if (O && E) {
|
|
1157
|
-
const B = t.direction === "vertical" ? O.offsetHeight : O.offsetWidth, $ = (t.direction === "vertical" ? t.itemHeight : t.itemWidth) * t.data.length;
|
|
1158
|
-
if (t.loop)
|
|
1159
|
-
s.value > 0 ? s.value = 0 : Math.abs(s.value) > $ && (s.value = -$);
|
|
1160
|
-
else {
|
|
1161
|
-
const R = -($ - B);
|
|
1162
|
-
s.value > 0 ? s.value = 0 : s.value < R && (s.value = R);
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
r("scroll", s.value);
|
|
1166
|
-
}, D = () => {
|
|
1167
|
-
i.value && (i.value = !1, document.removeEventListener("mousemove", C), document.removeEventListener("mouseup", D), k.value || (m.value = !1), r("dragEnd"));
|
|
1168
|
-
}, P = (c) => {
|
|
1169
|
-
const b = c.touches[0];
|
|
1170
|
-
i.value = !0, k.value = m.value, m.value = !0, f.value = t.direction === "vertical" ? b.clientY : b.clientX, u.value = f.value, S.value = s.value, r("dragStart");
|
|
1171
|
-
}, L = (c) => {
|
|
1172
|
-
if (!i.value) return;
|
|
1173
|
-
c.preventDefault();
|
|
1174
|
-
const b = c.touches[0];
|
|
1175
|
-
u.value = t.direction === "vertical" ? b.clientY : b.clientX;
|
|
1176
|
-
const O = u.value - f.value;
|
|
1177
|
-
s.value = S.value + O;
|
|
1178
|
-
const E = v.value, B = h.value;
|
|
1179
|
-
if (E && B) {
|
|
1180
|
-
const j = t.direction === "vertical" ? E.offsetHeight : E.offsetWidth, R = (t.direction === "vertical" ? t.itemHeight : t.itemWidth) * t.data.length;
|
|
1181
|
-
if (t.loop)
|
|
1182
|
-
s.value > 0 ? s.value = 0 : Math.abs(s.value) > R && (s.value = -R);
|
|
1183
|
-
else {
|
|
1184
|
-
const z = -(R - j);
|
|
1185
|
-
s.value > 0 ? s.value = 0 : s.value < z && (s.value = z);
|
|
1186
|
-
}
|
|
1187
|
-
}
|
|
1188
|
-
r("scroll", s.value);
|
|
1189
|
-
}, V = () => {
|
|
1190
|
-
i.value && (i.value = !1, k.value || (m.value = !1), r("dragEnd"));
|
|
1191
|
-
}, M = (c) => {
|
|
1192
|
-
s.value = c;
|
|
1193
|
-
}, I = () => {
|
|
1194
|
-
s.value = 0;
|
|
1195
|
-
}, W = () => {
|
|
1196
|
-
const c = v.value;
|
|
1197
|
-
if (c) {
|
|
1198
|
-
const b = h.value;
|
|
1199
|
-
if (b) {
|
|
1200
|
-
const O = t.direction === "vertical" ? b.offsetHeight : b.offsetWidth;
|
|
1201
|
-
s.value = -(O - c.offsetHeight);
|
|
1202
|
-
}
|
|
1203
|
-
}
|
|
1641
|
+
emits: ["clearIcon", "search", "select"],
|
|
1642
|
+
setup(s, { emit: g }) {
|
|
1643
|
+
const o = s, t = g, r = ref(o.defaultValue), c = ref(!1), u = ref(!1), n = ref([]);
|
|
1644
|
+
function f() {
|
|
1645
|
+
r.value = "", n.value = [], u.value = !1, t("clearIcon", "", []);
|
|
1646
|
+
}
|
|
1647
|
+
function a() {
|
|
1648
|
+
const h = r.value;
|
|
1649
|
+
n.value = o.list.filter(
|
|
1650
|
+
(b) => b.name && b.name.includes(h)
|
|
1651
|
+
), u.value = n.value.length > 0, t("search", h, n.value);
|
|
1652
|
+
}
|
|
1653
|
+
function d() {
|
|
1654
|
+
n.value = o.list.filter(
|
|
1655
|
+
(h) => h.name && h.name.includes(r.value)
|
|
1656
|
+
), c.value = !0, u.value = !0;
|
|
1657
|
+
}
|
|
1658
|
+
function i() {
|
|
1659
|
+
setTimeout(() => {
|
|
1660
|
+
c.value = !1, u.value = !1;
|
|
1661
|
+
}, 150);
|
|
1662
|
+
}
|
|
1663
|
+
function m(h) {
|
|
1664
|
+
r.value = h.name, u.value = !1, t("select", h);
|
|
1665
|
+
}
|
|
1666
|
+
return onMounted(() => {
|
|
1667
|
+
o.defaultValue && (r.value = o.defaultValue);
|
|
1668
|
+
}), (h, b) => {
|
|
1669
|
+
const w = resolveComponent("scroll-view");
|
|
1670
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
1671
|
+
createElementVNode("div", {
|
|
1672
|
+
class: normalizeClass(["input-wrapper", { focus: c.value }])
|
|
1673
|
+
}, [
|
|
1674
|
+
withDirectives(createElementVNode("input", {
|
|
1675
|
+
class: "search-input",
|
|
1676
|
+
placeholder: s.placeholder,
|
|
1677
|
+
"onUpdate:modelValue": b[0] || (b[0] = (l) => r.value = l),
|
|
1678
|
+
onInput: a,
|
|
1679
|
+
onFocus: d,
|
|
1680
|
+
onBlur: i
|
|
1681
|
+
}, null, 40, _hoisted_2), [
|
|
1682
|
+
[vModelText, r.value]
|
|
1683
|
+
]),
|
|
1684
|
+
r.value && s.showClear ? (openBlock(), createElementBlock("div", {
|
|
1685
|
+
key: 0,
|
|
1686
|
+
class: "clear-icon",
|
|
1687
|
+
onClick: f
|
|
1688
|
+
}, "×")) : createCommentVNode("", !0)
|
|
1689
|
+
], 2),
|
|
1690
|
+
u.value && n.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
1691
|
+
createVNode(w, {
|
|
1692
|
+
"scroll-y": "",
|
|
1693
|
+
style: normalizeStyle({ maxHeight: s.maxHeight + "px" })
|
|
1694
|
+
}, {
|
|
1695
|
+
default: withCtx(() => [
|
|
1696
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.value, (l, p) => (openBlock(), createElementBlock("div", {
|
|
1697
|
+
key: p,
|
|
1698
|
+
class: "dropdown-item",
|
|
1699
|
+
onClick: (e) => m(l)
|
|
1700
|
+
}, [
|
|
1701
|
+
createElementVNode("span", _hoisted_5, toDisplayString(l.name), 1)
|
|
1702
|
+
], 8, _hoisted_4))), 128))
|
|
1703
|
+
]),
|
|
1704
|
+
_: 1
|
|
1705
|
+
}, 8, ["style"])
|
|
1706
|
+
])) : createCommentVNode("", !0)
|
|
1707
|
+
]);
|
|
1204
1708
|
};
|
|
1205
|
-
return watch(() => t.data, () => {
|
|
1206
|
-
e(), s.value = 0;
|
|
1207
|
-
}, { deep: !0 }), watch(() => t.speed, () => {
|
|
1208
|
-
m.value || (w(), d());
|
|
1209
|
-
}), onMounted(() => {
|
|
1210
|
-
e(), nextTick(() => {
|
|
1211
|
-
d();
|
|
1212
|
-
const c = v.value;
|
|
1213
|
-
c && (c.addEventListener("mouseenter", N), c.addEventListener("mouseleave", T));
|
|
1214
|
-
});
|
|
1215
|
-
}), onUnmounted(() => {
|
|
1216
|
-
w();
|
|
1217
|
-
const c = v.value;
|
|
1218
|
-
c && (c.removeEventListener("mouseenter", N), c.removeEventListener("mouseleave", T)), document.removeEventListener("mousemove", C), document.removeEventListener("mouseup", D);
|
|
1219
|
-
}), g({
|
|
1220
|
-
pause: x,
|
|
1221
|
-
// 暂停滚动
|
|
1222
|
-
resume: _,
|
|
1223
|
-
// 恢复滚动
|
|
1224
|
-
scrollTo: M,
|
|
1225
|
-
// 滚动到指定位置
|
|
1226
|
-
scrollToTop: I,
|
|
1227
|
-
// 滚动到顶部
|
|
1228
|
-
scrollToBottom: W,
|
|
1229
|
-
// 滚动到底部
|
|
1230
|
-
isPaused: m,
|
|
1231
|
-
// 是否暂停(响应式)
|
|
1232
|
-
isDragging: i
|
|
1233
|
-
// 是否正在拖拽(响应式)
|
|
1234
|
-
}), (c, b) => (openBlock(), createElementBlock("div", {
|
|
1235
|
-
class: "hbis-auto-scroll-list",
|
|
1236
|
-
ref_key: "containerRef",
|
|
1237
|
-
ref: v,
|
|
1238
|
-
style: normalizeStyle(a.value),
|
|
1239
|
-
onMousedown: F,
|
|
1240
|
-
onTouchstart: P,
|
|
1241
|
-
onTouchmove: L,
|
|
1242
|
-
onTouchend: V
|
|
1243
|
-
}, [
|
|
1244
|
-
createElementVNode("div", {
|
|
1245
|
-
class: "scroll-content",
|
|
1246
|
-
ref_key: "contentRef",
|
|
1247
|
-
ref: h,
|
|
1248
|
-
style: normalizeStyle(p.value)
|
|
1249
|
-
}, [
|
|
1250
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(l.value, (O, E) => renderSlot(c.$slots, "item", {
|
|
1251
|
-
item: O,
|
|
1252
|
-
index: E
|
|
1253
|
-
}, () => [
|
|
1254
|
-
createElementVNode("div", {
|
|
1255
|
-
class: "default-item",
|
|
1256
|
-
style: normalizeStyle(y.itemStyle)
|
|
1257
|
-
}, toDisplayString(O), 5)
|
|
1258
|
-
], !0)), 256))
|
|
1259
|
-
], 4)
|
|
1260
|
-
], 36));
|
|
1261
1709
|
}
|
|
1262
|
-
}
|
|
1710
|
+
};
|
|
1263
1711
|
export {
|
|
1264
1712
|
C1,
|
|
1265
1713
|
C2,
|
|
1266
1714
|
HbisAutoScrollList,
|
|
1715
|
+
HbisSmsInput,
|
|
1267
1716
|
HbisSvgaPlayer,
|
|
1717
|
+
HbisWaterfall,
|
|
1268
1718
|
HbisAutoScrollList as hbisAutoScrollList,
|
|
1269
1719
|
hbisDateStrip,
|
|
1270
|
-
|
|
1271
|
-
|
|
1720
|
+
hbisLoading,
|
|
1721
|
+
_sfc_main$6 as hbisPreviewImage,
|
|
1722
|
+
_sfc_main as hbisSearchInput,
|
|
1723
|
+
HbisSmsInput as hbisSmsInput,
|
|
1724
|
+
HbisSvgaPlayer as hbisSvgaPlayer,
|
|
1725
|
+
HbisWaterfall as hbisWaterfall
|
|
1272
1726
|
};
|
|
1273
1727
|
//# sourceMappingURL=index.es.js.map
|