abl-ui 0.1.2 → 0.1.3
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/lib/abl-ui.es.js +1693 -530
- package/lib/abl-ui.umd.js +3 -3
- package/lib/style.css +1 -1
- package/package.json +14 -14
package/lib/abl-ui.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { openBlock as
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
for (const [o,
|
|
5
|
-
|
|
6
|
-
return
|
|
7
|
-
},
|
|
1
|
+
import { openBlock as d, createElementBlock as u, createElementVNode as r, normalizeClass as b, Fragment as E, renderList as W, normalizeStyle as y, toDisplayString as x, ref as _, provide as U, onMounted as ye, renderSlot as m, defineComponent as _e, toRefs as Y, computed as w, unref as re, pushScopeId as X, popScopeId as Z, inject as Q, createTextVNode as S, reactive as de, withDirectives as J, vShow as ce, createBlock as M, Transition as A, withCtx as I, createCommentVNode as g, render as le, createVNode as T, watchEffect as ue, Teleport as ee, withModifiers as L, watch as Te, normalizeProps as Oe, guardReactiveProps as Re, resolveDirective as He, mergeProps as he, nextTick as K, h as Ne } from "vue";
|
|
2
|
+
const z = (t, e) => {
|
|
3
|
+
const s = t.__vccOpts || t;
|
|
4
|
+
for (const [o, a] of e)
|
|
5
|
+
s[o] = a;
|
|
6
|
+
return s;
|
|
7
|
+
}, Me = { class: "abl-table" }, Pe = { class: "gridtable" }, De = { class: "table-thead" }, We = { class: "cell" }, je = { key: 0 }, Fe = { class: "cell" }, qe = { key: 1 }, Ge = ["colspan"], Ke = {
|
|
8
8
|
__name: "index",
|
|
9
9
|
props: {
|
|
10
10
|
name: "abl-table",
|
|
@@ -21,50 +21,50 @@ const C = (e, a) => {
|
|
|
21
21
|
default: !1
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
|
-
setup(
|
|
25
|
-
const
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}) : [...
|
|
30
|
-
|
|
24
|
+
setup(t, { emit: e }) {
|
|
25
|
+
const s = t, o = (a) => {
|
|
26
|
+
let n = document.getElementsByClassName("table-fixed-column--left");
|
|
27
|
+
a.target.scrollLeft > 0 ? [...n].forEach((i) => {
|
|
28
|
+
i.classList.add("box-shadow");
|
|
29
|
+
}) : [...n].forEach((i) => {
|
|
30
|
+
i.classList.remove("box-shadow");
|
|
31
31
|
});
|
|
32
32
|
};
|
|
33
|
-
return (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
class:
|
|
33
|
+
return (a, n) => (d(), u("section", null, [
|
|
34
|
+
r("div", Me, [
|
|
35
|
+
r("div", {
|
|
36
|
+
class: b(["table__inner-wrapper", t.border ? "has-table-border" : ""]),
|
|
37
37
|
onScroll: o,
|
|
38
38
|
id: "box"
|
|
39
39
|
}, [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
(
|
|
44
|
-
key:
|
|
45
|
-
style:
|
|
46
|
-
class:
|
|
40
|
+
r("table", Pe, [
|
|
41
|
+
r("thead", De, [
|
|
42
|
+
r("tr", null, [
|
|
43
|
+
(d(!0), u(E, null, W(s.columns, (i, h) => (d(), u("th", {
|
|
44
|
+
key: h,
|
|
45
|
+
style: y({ "text-align": i.align || "left" }),
|
|
46
|
+
class: b(i.fixed == "left" ? "table-fixed-column--left" : i.fixed == "right" ? "table-fixed-column--right" : "")
|
|
47
47
|
}, [
|
|
48
|
-
|
|
48
|
+
r("div", We, x(i.title), 1)
|
|
49
49
|
], 6))), 128))
|
|
50
50
|
])
|
|
51
51
|
]),
|
|
52
|
-
|
|
53
|
-
(
|
|
54
|
-
(
|
|
55
|
-
style:
|
|
56
|
-
key:
|
|
57
|
-
class:
|
|
52
|
+
s.data.length > 0 ? (d(), u("tbody", je, [
|
|
53
|
+
(d(!0), u(E, null, W(s.data, (i, h) => (d(), u("tr", { key: h }, [
|
|
54
|
+
(d(!0), u(E, null, W(t.columns, (l, p) => (d(), u("td", {
|
|
55
|
+
style: y({ "text-align": l.align || "left", width: l.width || "auto" }),
|
|
56
|
+
key: p,
|
|
57
|
+
class: b(l.fixed == "left" ? "table-fixed-column--left" : l.fixed == "right" ? "table-fixed-column--right" : "")
|
|
58
58
|
}, [
|
|
59
|
-
|
|
59
|
+
r("div", Fe, x(i[l.prop]), 1)
|
|
60
60
|
], 6))), 128))
|
|
61
61
|
]))), 128))
|
|
62
|
-
])) : (
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
])) : (d(), u("tbody", qe, [
|
|
63
|
+
r("tr", null, [
|
|
64
|
+
r("td", {
|
|
65
65
|
class: "no-data-td",
|
|
66
|
-
colspan:
|
|
67
|
-
}, "暂无数据", 8,
|
|
66
|
+
colspan: s.data.length + 2
|
|
67
|
+
}, "暂无数据", 8, Ge)
|
|
68
68
|
])
|
|
69
69
|
]))
|
|
70
70
|
])
|
|
@@ -72,8 +72,8 @@ const C = (e, a) => {
|
|
|
72
72
|
])
|
|
73
73
|
]));
|
|
74
74
|
}
|
|
75
|
-
},
|
|
76
|
-
const
|
|
75
|
+
}, Ue = /* @__PURE__ */ z(Ke, [["__scopeId", "data-v-4382ab0e"]]);
|
|
76
|
+
const Ye = { class: "abl-tabs" }, Xe = { class: "tabs-header" }, Ze = ["onClick"], Qe = {
|
|
77
77
|
__name: "index",
|
|
78
78
|
props: {
|
|
79
79
|
name: "abl-tabs",
|
|
@@ -83,46 +83,46 @@ const ue = { class: "abl-tabs" }, fe = { class: "tabs-header" }, be = ["onClick"
|
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
85
|
emits: ["tabClick"],
|
|
86
|
-
setup(
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
setup(t, { emit: e }) {
|
|
87
|
+
const s = e, o = t, a = _([]), n = _(), i = _();
|
|
88
|
+
U("active", i), ye(() => {
|
|
89
|
+
h();
|
|
90
90
|
});
|
|
91
|
-
function
|
|
92
|
-
let
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
function h() {
|
|
92
|
+
let p = [...n.value.children], v = [], c = "";
|
|
93
|
+
p.forEach((f) => {
|
|
94
|
+
v.push({
|
|
95
95
|
title: f.dataset.title,
|
|
96
96
|
value: f.attributes.value.value
|
|
97
|
-
}), o.modelValue == f.attributes.value.value && (
|
|
98
|
-
}),
|
|
97
|
+
}), o.modelValue == f.attributes.value.value && (c = f.attributes.value.value);
|
|
98
|
+
}), i.value = c || v[0].value, a.value = v;
|
|
99
99
|
}
|
|
100
|
-
const
|
|
101
|
-
|
|
100
|
+
const l = (p) => {
|
|
101
|
+
i.value = p, s("tabClick", p);
|
|
102
102
|
};
|
|
103
|
-
return (
|
|
104
|
-
|
|
105
|
-
(
|
|
106
|
-
key:
|
|
107
|
-
class:
|
|
108
|
-
onClick: (f) =>
|
|
109
|
-
},
|
|
103
|
+
return (p, v) => (d(), u("div", Ye, [
|
|
104
|
+
r("header", Xe, [
|
|
105
|
+
(d(!0), u(E, null, W(a.value, (c) => (d(), u("div", {
|
|
106
|
+
key: c.title,
|
|
107
|
+
class: b(`header-btn ${i.value === c.value ? "header-btn-active" : ""}`),
|
|
108
|
+
onClick: (f) => l(c.value)
|
|
109
|
+
}, x(c.title), 11, Ze))), 128))
|
|
110
110
|
]),
|
|
111
|
-
|
|
111
|
+
r("main", {
|
|
112
112
|
ref_key: "ref_main",
|
|
113
|
-
ref:
|
|
113
|
+
ref: n,
|
|
114
114
|
class: "tab-content"
|
|
115
115
|
}, [
|
|
116
|
-
p
|
|
116
|
+
m(p.$slots, "default", {}, void 0, !0)
|
|
117
117
|
], 512)
|
|
118
118
|
]));
|
|
119
119
|
}
|
|
120
|
-
},
|
|
121
|
-
|
|
122
|
-
],
|
|
120
|
+
}, fe = /* @__PURE__ */ z(Qe, [["__scopeId", "data-v-37029b31"]]), Je = (t) => (X("data-v-9ebed9dd"), t = t(), Z(), t), et = /* @__PURE__ */ Je(() => /* @__PURE__ */ r("span", { class: "abl-switch__core" }, null, -1)), tt = [
|
|
121
|
+
et
|
|
122
|
+
], st = {
|
|
123
123
|
name: "AblSwitch"
|
|
124
|
-
},
|
|
125
|
-
...
|
|
124
|
+
}, ot = /* @__PURE__ */ _e({
|
|
125
|
+
...st,
|
|
126
126
|
props: {
|
|
127
127
|
modelValue: {
|
|
128
128
|
type: Boolean,
|
|
@@ -146,25 +146,25 @@ const ue = { class: "abl-tabs" }, fe = { class: "tabs-header" }, be = ["onClick"
|
|
|
146
146
|
}
|
|
147
147
|
},
|
|
148
148
|
emits: ["update:modelValue", "change"],
|
|
149
|
-
setup(
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
}, { modelValue:
|
|
153
|
-
"abl-switch-checked":
|
|
154
|
-
"abl-switch-disabled":
|
|
155
|
-
[`abl-switch-${
|
|
149
|
+
setup(t, { emit: e }) {
|
|
150
|
+
const s = t, o = e, a = () => {
|
|
151
|
+
s.disabled || (o("update:modelValue", !s.modelValue), o("change", !s.modelValue));
|
|
152
|
+
}, { modelValue: n, disabled: i, size: h } = Y(s), l = w(() => ({
|
|
153
|
+
"abl-switch-checked": n.value,
|
|
154
|
+
"abl-switch-disabled": i.value,
|
|
155
|
+
[`abl-switch-${h.value}`]: h.value
|
|
156
156
|
}));
|
|
157
|
-
return (
|
|
158
|
-
class:
|
|
159
|
-
onClick:
|
|
160
|
-
style:
|
|
161
|
-
},
|
|
157
|
+
return (p, v) => (d(), u("div", {
|
|
158
|
+
class: b(["abl-switch", l.value]),
|
|
159
|
+
onClick: a,
|
|
160
|
+
style: y({ background: re(n) ? t.activeColor : t.inactiveColor })
|
|
161
|
+
}, tt, 6));
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
|
-
const
|
|
165
|
-
const
|
|
164
|
+
const at = /* @__PURE__ */ z(ot, [["__scopeId", "data-v-9ebed9dd"]]);
|
|
165
|
+
const lt = {
|
|
166
166
|
name: "AblRadio"
|
|
167
|
-
},
|
|
167
|
+
}, it = /* @__PURE__ */ Object.assign(lt, {
|
|
168
168
|
props: {
|
|
169
169
|
modelValue: {
|
|
170
170
|
type: [String, Number, Boolean],
|
|
@@ -184,42 +184,42 @@ const $e = {
|
|
|
184
184
|
}
|
|
185
185
|
},
|
|
186
186
|
emits: ["update:modelValue", "change"],
|
|
187
|
-
setup(
|
|
188
|
-
const
|
|
189
|
-
() =>
|
|
187
|
+
setup(t, { emit: e }) {
|
|
188
|
+
const s = t, o = e, a = Q("radioGroupKey", void 0), n = w(() => !!a), i = w(
|
|
189
|
+
() => n.value ? a.modelValue : s.modelValue
|
|
190
190
|
);
|
|
191
|
-
console.log("radioValue",
|
|
192
|
-
const
|
|
193
|
-
() =>
|
|
194
|
-
),
|
|
195
|
-
|
|
196
|
-
},
|
|
197
|
-
"is-checked":
|
|
198
|
-
"is-disabled":
|
|
199
|
-
[`abl-radio-${
|
|
191
|
+
console.log("radioValue", i);
|
|
192
|
+
const h = w(
|
|
193
|
+
() => s.disabled ? s.disabled : a == null ? void 0 : a.disabled
|
|
194
|
+
), l = w(() => s.size ? s.size : a == null ? void 0 : a.size), p = () => {
|
|
195
|
+
h.value || (n.value ? a.changeEvent(s.label) : (o("update:modelValue", s.label), o("change", s.label)));
|
|
196
|
+
}, v = w(() => ({
|
|
197
|
+
"is-checked": i.value === s.label,
|
|
198
|
+
"is-disabled": h.value,
|
|
199
|
+
[`abl-radio-${l.value}`]: l.value
|
|
200
200
|
}));
|
|
201
|
-
return (
|
|
202
|
-
class:
|
|
203
|
-
onClick:
|
|
201
|
+
return (c, f) => (d(), u("div", {
|
|
202
|
+
class: b(["abl-radio", v.value]),
|
|
203
|
+
onClick: p
|
|
204
204
|
}, [
|
|
205
|
-
|
|
206
|
-
class:
|
|
205
|
+
r("span", {
|
|
206
|
+
class: b(["abl-radio-input", v.value])
|
|
207
207
|
}, null, 2),
|
|
208
|
-
|
|
209
|
-
class:
|
|
208
|
+
r("span", {
|
|
209
|
+
class: b(["abl-radio-label", v.value])
|
|
210
210
|
}, [
|
|
211
|
-
|
|
212
|
-
x(
|
|
211
|
+
m(c.$slots, "default", {}, () => [
|
|
212
|
+
S(x(t.label), 1)
|
|
213
213
|
])
|
|
214
214
|
], 2)
|
|
215
215
|
], 2));
|
|
216
216
|
}
|
|
217
|
-
}),
|
|
217
|
+
}), nt = {
|
|
218
218
|
ref: "radioGroupRef",
|
|
219
219
|
class: "abl-radio-group"
|
|
220
|
-
},
|
|
220
|
+
}, rt = {
|
|
221
221
|
name: "AblRadioGroup"
|
|
222
|
-
},
|
|
222
|
+
}, dt = /* @__PURE__ */ Object.assign(rt, {
|
|
223
223
|
props: {
|
|
224
224
|
modelValue: {
|
|
225
225
|
type: [String, Number, Boolean],
|
|
@@ -235,21 +235,21 @@ const $e = {
|
|
|
235
235
|
}
|
|
236
236
|
},
|
|
237
237
|
emits: ["update:modelValue", "change"],
|
|
238
|
-
setup(
|
|
239
|
-
const
|
|
240
|
-
o("update:modelValue",
|
|
238
|
+
setup(t, { emit: e }) {
|
|
239
|
+
const s = t, o = e, a = (n) => {
|
|
240
|
+
o("update:modelValue", n), o("change", n);
|
|
241
241
|
};
|
|
242
|
-
return
|
|
242
|
+
return U(
|
|
243
243
|
"radioGroupKey",
|
|
244
|
-
|
|
245
|
-
...
|
|
246
|
-
changeEvent:
|
|
244
|
+
de({
|
|
245
|
+
...Y(s),
|
|
246
|
+
changeEvent: a
|
|
247
247
|
})
|
|
248
|
-
), (
|
|
249
|
-
|
|
248
|
+
), (n, i) => (d(), u("div", nt, [
|
|
249
|
+
m(n.$slots, "default")
|
|
250
250
|
], 512));
|
|
251
251
|
}
|
|
252
|
-
}),
|
|
252
|
+
}), ct = ["data-title", "value"], ut = {
|
|
253
253
|
__name: "pane",
|
|
254
254
|
props: {
|
|
255
255
|
title: {
|
|
@@ -261,22 +261,22 @@ const $e = {
|
|
|
261
261
|
default: ""
|
|
262
262
|
}
|
|
263
263
|
},
|
|
264
|
-
setup(
|
|
265
|
-
const
|
|
266
|
-
return (
|
|
267
|
-
"data-title":
|
|
268
|
-
value:
|
|
264
|
+
setup(t) {
|
|
265
|
+
const e = Q("active");
|
|
266
|
+
return (s, o) => J((d(), u("div", {
|
|
267
|
+
"data-title": t.title,
|
|
268
|
+
value: t.value
|
|
269
269
|
}, [
|
|
270
|
-
|
|
271
|
-
], 8,
|
|
272
|
-
[
|
|
270
|
+
m(s.$slots, "default")
|
|
271
|
+
], 8, ct)), [
|
|
272
|
+
[ce, re(e) === t.value]
|
|
273
273
|
]);
|
|
274
274
|
}
|
|
275
275
|
};
|
|
276
|
-
const
|
|
276
|
+
const ht = { class: "message-text" }, ft = {
|
|
277
277
|
key: 0,
|
|
278
278
|
class: "message-close"
|
|
279
|
-
},
|
|
279
|
+
}, pt = {
|
|
280
280
|
__name: "index",
|
|
281
281
|
props: {
|
|
282
282
|
name: "abl-message",
|
|
@@ -297,84 +297,84 @@ const Ve = { class: "message-text" }, Te = {
|
|
|
297
297
|
default: !1
|
|
298
298
|
}
|
|
299
299
|
},
|
|
300
|
-
setup(
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
|
|
300
|
+
setup(t) {
|
|
301
|
+
const e = t, s = _(!1);
|
|
302
|
+
ye(() => {
|
|
303
|
+
s.value = !0;
|
|
304
304
|
});
|
|
305
305
|
const o = () => {
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
},
|
|
306
|
+
const n = document.getElementById("abl-message-wrapper");
|
|
307
|
+
le(null, n);
|
|
308
|
+
}, a = {
|
|
309
309
|
warning: {
|
|
310
310
|
icon: "icon-abl-jinggao",
|
|
311
311
|
color: "#E6A23C",
|
|
312
312
|
backgroundColor: "rgb(253, 246, 236)",
|
|
313
313
|
borderColor: "rgb(250, 236, 216)",
|
|
314
|
-
top:
|
|
314
|
+
top: e.top + "px"
|
|
315
315
|
},
|
|
316
316
|
error: {
|
|
317
317
|
icon: "icon-abl-cuowu",
|
|
318
318
|
color: "#F56C6C",
|
|
319
319
|
backgroundColor: "rgb(254, 240, 240)",
|
|
320
320
|
borderColor: "rgb(253, 226, 226)",
|
|
321
|
-
top:
|
|
321
|
+
top: e.top + "px"
|
|
322
322
|
},
|
|
323
323
|
success: {
|
|
324
324
|
icon: "icon-abl-chenggong",
|
|
325
325
|
color: "#67C23A",
|
|
326
326
|
backgroundColor: "rgb(240, 249, 235)",
|
|
327
327
|
borderColor: "rgb(225, 243, 216)",
|
|
328
|
-
top:
|
|
328
|
+
top: e.top + "px"
|
|
329
329
|
},
|
|
330
330
|
info: {
|
|
331
331
|
icon: "icon-abl-jinggao",
|
|
332
332
|
color: "#999",
|
|
333
333
|
backgroundColor: "#f1f1f1",
|
|
334
334
|
borderColor: "#ccc",
|
|
335
|
-
top:
|
|
335
|
+
top: e.top + "px"
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
|
-
return (
|
|
339
|
-
default:
|
|
340
|
-
|
|
338
|
+
return (n, i) => (d(), M(A, null, {
|
|
339
|
+
default: I(() => [
|
|
340
|
+
s.value ? (d(), u("div", {
|
|
341
341
|
key: 0,
|
|
342
342
|
class: "abl-message",
|
|
343
|
-
style:
|
|
343
|
+
style: y(a[e.type])
|
|
344
344
|
}, [
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
class:
|
|
345
|
+
r("div", ht, [
|
|
346
|
+
r("i", {
|
|
347
|
+
class: b(["iconfont-abl", [a[e.type].icon]])
|
|
348
348
|
}, null, 2),
|
|
349
|
-
|
|
349
|
+
S(" " + x(t.text), 1)
|
|
350
350
|
]),
|
|
351
|
-
|
|
352
|
-
|
|
351
|
+
e.showClose ? (d(), u("div", ft, [
|
|
352
|
+
r("i", {
|
|
353
353
|
class: "iconfont-abl icon-abl-close",
|
|
354
354
|
onClick: o
|
|
355
355
|
})
|
|
356
|
-
])) :
|
|
357
|
-
], 4)) :
|
|
356
|
+
])) : g("", !0)
|
|
357
|
+
], 4)) : g("", !0)
|
|
358
358
|
]),
|
|
359
359
|
_: 1
|
|
360
360
|
}));
|
|
361
361
|
}
|
|
362
|
-
},
|
|
362
|
+
}, vt = /* @__PURE__ */ z(pt, [["__scopeId", "data-v-07a90ff7"]]);
|
|
363
363
|
if (document) {
|
|
364
|
-
const
|
|
365
|
-
|
|
364
|
+
const t = document.createElement("div");
|
|
365
|
+
t.setAttribute("class", "abl-message-wrapper"), t.setAttribute("id", "abl-message-wrapper"), document.body.appendChild(t);
|
|
366
366
|
}
|
|
367
|
-
let
|
|
368
|
-
const
|
|
369
|
-
const
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
},
|
|
367
|
+
let pe = null;
|
|
368
|
+
const we = ({ text: t, type: e, duration: s, top: o, showClose: a }) => {
|
|
369
|
+
const n = T(vt, { text: t, type: e, top: o, showClose: a });
|
|
370
|
+
le(n, div), clearTimeout(pe), pe = setTimeout(() => {
|
|
371
|
+
le(null, div);
|
|
372
|
+
}, s || 2e3);
|
|
373
373
|
};
|
|
374
|
-
const
|
|
374
|
+
const mt = { class: "abl-drawer-content" }, gt = { class: "abl-drawer-wrapper-body" }, bt = {
|
|
375
375
|
key: 0,
|
|
376
376
|
class: "abl-drawer-header"
|
|
377
|
-
},
|
|
377
|
+
}, yt = { class: "abl-drawer-header-title" }, _t = { class: "abl-drawer-title" }, wt = { class: "abl-drawer-body" }, $t = {
|
|
378
378
|
__name: "index",
|
|
379
379
|
props: {
|
|
380
380
|
modelValue: {
|
|
@@ -428,75 +428,79 @@ const Me = { class: "abl-drawer-content" }, Ae = { class: "abl-drawer-wrapper-bo
|
|
|
428
428
|
}
|
|
429
429
|
},
|
|
430
430
|
emits: ["update:modelValue", "close", "confirm"],
|
|
431
|
-
setup(
|
|
432
|
-
const
|
|
431
|
+
setup(t, { emit: e }) {
|
|
432
|
+
const s = e, o = t;
|
|
433
|
+
ue(() => {
|
|
434
|
+
typeof document < "u" && (o.modelValue ? (document.body.style.overflow = "hidden", document.body.style.touchAction = "none") : (document.body.style.overflow = "", document.body.style.touchAction = ""));
|
|
435
|
+
});
|
|
436
|
+
const a = w(() => [
|
|
433
437
|
o.direction == "left" ? { top: 0, left: 0, width: o.width, height: "100%" } : o.direction == "top" ? { top: 0, left: 0, width: "100%", height: o.height } : o.direction == "right" ? { top: 0, right: 0, width: o.width, height: "100%" } : o.direction == "bottom" ? { bottom: 0, left: 0, width: "100%", height: o.height } : {}
|
|
434
|
-
]),
|
|
435
|
-
o.maskClosable &&
|
|
436
|
-
},
|
|
437
|
-
typeof o.beforeClose == "function" ? o.beforeClose() : (
|
|
438
|
+
]), n = w(() => `slide-${o.direction}`), i = () => {
|
|
439
|
+
o.maskClosable && h();
|
|
440
|
+
}, h = () => {
|
|
441
|
+
typeof o.beforeClose == "function" ? o.beforeClose() : (s("update:modelValue", !1), s("close"));
|
|
438
442
|
};
|
|
439
|
-
return (
|
|
440
|
-
|
|
441
|
-
class:
|
|
443
|
+
return (l, p) => (d(), M(ee, { to: "body" }, [
|
|
444
|
+
r("div", {
|
|
445
|
+
class: b(["abl-drawer", t.customClass, `abl-drawer-${o.direction}`])
|
|
442
446
|
}, [
|
|
443
|
-
T(
|
|
444
|
-
default:
|
|
445
|
-
|
|
447
|
+
T(A, { name: "fade-popup" }, {
|
|
448
|
+
default: I(() => [
|
|
449
|
+
t.modelValue ? (d(), u("div", {
|
|
446
450
|
key: 0,
|
|
447
451
|
class: "abl-drawer-mask",
|
|
448
|
-
onClick:
|
|
449
|
-
})) :
|
|
452
|
+
onClick: i
|
|
453
|
+
})) : g("", !0)
|
|
450
454
|
]),
|
|
451
455
|
_: 1
|
|
452
456
|
}),
|
|
453
|
-
T(
|
|
454
|
-
default:
|
|
455
|
-
|
|
457
|
+
T(A, { name: n.value }, {
|
|
458
|
+
default: I(() => [
|
|
459
|
+
t.modelValue ? (d(), u("div", {
|
|
456
460
|
key: 0,
|
|
457
461
|
class: "abl-drawer-content-wrapper",
|
|
458
|
-
style:
|
|
462
|
+
style: y(a.value)
|
|
459
463
|
}, [
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
464
|
+
r("div", mt, [
|
|
465
|
+
r("div", gt, [
|
|
466
|
+
t.showHeader ? (d(), u("div", bt, [
|
|
467
|
+
m(l.$slots, "header", {}, () => [
|
|
468
|
+
r("div", yt, [
|
|
469
|
+
r("span", _t, x(t.title), 1)
|
|
466
470
|
]),
|
|
467
|
-
|
|
471
|
+
t.showClose ? (d(), u("i", {
|
|
468
472
|
key: 0,
|
|
469
473
|
class: "iconfont-abl icon-abl-close close-icon",
|
|
470
|
-
onClick:
|
|
471
|
-
})) :
|
|
474
|
+
onClick: h
|
|
475
|
+
})) : g("", !0)
|
|
472
476
|
], !0)
|
|
473
|
-
])) :
|
|
474
|
-
|
|
475
|
-
|
|
477
|
+
])) : g("", !0),
|
|
478
|
+
r("div", wt, [
|
|
479
|
+
m(l.$slots, "default", {}, void 0, !0)
|
|
476
480
|
]),
|
|
477
|
-
|
|
481
|
+
l.$slots.footer ? (d(), u("div", {
|
|
478
482
|
key: 1,
|
|
479
483
|
class: "abl-drawer-footer",
|
|
480
|
-
style:
|
|
484
|
+
style: y(t.footerStyle)
|
|
481
485
|
}, [
|
|
482
|
-
|
|
483
|
-
], 4)) :
|
|
486
|
+
m(l.$slots, "footer", {}, void 0, !0)
|
|
487
|
+
], 4)) : g("", !0)
|
|
484
488
|
])
|
|
485
489
|
])
|
|
486
|
-
], 4)) :
|
|
490
|
+
], 4)) : g("", !0)
|
|
487
491
|
]),
|
|
488
492
|
_: 3
|
|
489
493
|
}, 8, ["name"])
|
|
490
494
|
], 2)
|
|
491
495
|
]));
|
|
492
496
|
}
|
|
493
|
-
},
|
|
494
|
-
const
|
|
497
|
+
}, xt = /* @__PURE__ */ z($t, [["__scopeId", "data-v-cedded8f"]]);
|
|
498
|
+
const kt = {
|
|
495
499
|
key: 0,
|
|
496
500
|
class: "iconfont-abl icon-abl-loading2 abl-icon-loading"
|
|
497
|
-
},
|
|
501
|
+
}, Ct = {
|
|
498
502
|
name: "AblButton"
|
|
499
|
-
},
|
|
503
|
+
}, Lt = /* @__PURE__ */ Object.assign(Ct, {
|
|
500
504
|
props: {
|
|
501
505
|
type: {
|
|
502
506
|
type: String,
|
|
@@ -535,47 +539,47 @@ const Re = {
|
|
|
535
539
|
default: "loading..."
|
|
536
540
|
}
|
|
537
541
|
},
|
|
538
|
-
setup(
|
|
539
|
-
const
|
|
540
|
-
[`abl-button-${
|
|
541
|
-
"is-dashed":
|
|
542
|
-
"is-round":
|
|
543
|
-
"is-circle":
|
|
544
|
-
"is-disabled":
|
|
542
|
+
setup(t) {
|
|
543
|
+
const e = t, s = w(() => ({
|
|
544
|
+
[`abl-button-${e.type}`]: e.type,
|
|
545
|
+
"is-dashed": e.dashed,
|
|
546
|
+
"is-round": e.round,
|
|
547
|
+
"is-circle": e.circle,
|
|
548
|
+
"is-disabled": e.disabled
|
|
545
549
|
}));
|
|
546
|
-
return (o,
|
|
547
|
-
class:
|
|
550
|
+
return (o, a) => (d(), u("button", {
|
|
551
|
+
class: b(["abl-button", s.value])
|
|
548
552
|
}, [
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
], 64)) : (
|
|
553
|
-
|
|
554
|
-
|
|
553
|
+
t.loading ? (d(), u(E, { key: 0 }, [
|
|
554
|
+
t.loading ? (d(), u("i", kt)) : g("", !0),
|
|
555
|
+
r("span", null, x(t.loadingText), 1)
|
|
556
|
+
], 64)) : (d(), u(E, { key: 1 }, [
|
|
557
|
+
t.iconPosition === "left" ? m(o.$slots, "icon", { key: 0 }, () => [
|
|
558
|
+
t.icon ? (d(), u("i", {
|
|
555
559
|
key: 0,
|
|
556
|
-
class:
|
|
557
|
-
}, null, 2)) :
|
|
558
|
-
]) :
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
560
|
+
class: b(["iconfont-abl slot-icon-left", t.icon])
|
|
561
|
+
}, null, 2)) : g("", !0)
|
|
562
|
+
]) : g("", !0),
|
|
563
|
+
m(o.$slots, "default"),
|
|
564
|
+
t.iconPosition === "right" ? m(o.$slots, "icon", { key: 1 }, () => [
|
|
565
|
+
t.icon ? (d(), u("i", {
|
|
562
566
|
key: 0,
|
|
563
|
-
class:
|
|
564
|
-
}, null, 2)) :
|
|
565
|
-
]) :
|
|
567
|
+
class: b(["iconfont-abl slot-icon-right", t.icon])
|
|
568
|
+
}, null, 2)) : g("", !0)
|
|
569
|
+
]) : g("", !0)
|
|
566
570
|
], 64))
|
|
567
571
|
], 2));
|
|
568
572
|
}
|
|
569
573
|
});
|
|
570
|
-
const
|
|
574
|
+
const St = {
|
|
571
575
|
key: 0,
|
|
572
576
|
class: "iconfont-abl icon-abl-hengxian1"
|
|
573
|
-
},
|
|
577
|
+
}, zt = {
|
|
574
578
|
key: 1,
|
|
575
579
|
class: "iconfont-abl icon-abl-duihao"
|
|
576
|
-
},
|
|
580
|
+
}, Bt = {
|
|
577
581
|
name: "AblCheckbox"
|
|
578
|
-
},
|
|
582
|
+
}, Vt = /* @__PURE__ */ Object.assign(Bt, {
|
|
579
583
|
props: {
|
|
580
584
|
modelValue: {
|
|
581
585
|
type: Boolean,
|
|
@@ -595,46 +599,46 @@ const Fe = {
|
|
|
595
599
|
}
|
|
596
600
|
},
|
|
597
601
|
emits: ["update:modelValue", "change"],
|
|
598
|
-
setup(
|
|
599
|
-
const
|
|
600
|
-
() =>
|
|
601
|
-
),
|
|
602
|
-
() =>
|
|
603
|
-
),
|
|
604
|
-
"is-checked":
|
|
605
|
-
"is-disabled":
|
|
606
|
-
"is-indeterminate":
|
|
607
|
-
})),
|
|
608
|
-
if (!
|
|
609
|
-
let
|
|
610
|
-
if (
|
|
611
|
-
const f =
|
|
612
|
-
f > -1 ?
|
|
602
|
+
setup(t, { emit: e }) {
|
|
603
|
+
const s = t, o = e, a = Q("checkboxGroupKey", void 0), n = w(() => !!a), i = w(
|
|
604
|
+
() => n.value ? l.value.indexOf(s.label) > -1 && !s.indeterminate : l.value && !s.indeterminate
|
|
605
|
+
), h = w(() => s.disabled || (a == null ? void 0 : a.disabled)), l = w(
|
|
606
|
+
() => n.value ? a.modelValue : s.modelValue
|
|
607
|
+
), p = w(() => ({
|
|
608
|
+
"is-checked": i.value,
|
|
609
|
+
"is-disabled": h.value,
|
|
610
|
+
"is-indeterminate": s.indeterminate
|
|
611
|
+
})), v = () => {
|
|
612
|
+
if (!h.value) {
|
|
613
|
+
let c = l.value;
|
|
614
|
+
if (n.value) {
|
|
615
|
+
const f = c.indexOf(s.label);
|
|
616
|
+
f > -1 ? c.splice(f, 1) : c.push(s.label), c = [...c], console.log("checkboxValue.value", c), a.changeEvent(c);
|
|
613
617
|
} else
|
|
614
|
-
o("update:modelValue", !
|
|
618
|
+
o("update:modelValue", !c), o("change", !c);
|
|
615
619
|
}
|
|
616
620
|
};
|
|
617
|
-
return (
|
|
618
|
-
class:
|
|
619
|
-
onClick:
|
|
621
|
+
return (c, f) => (d(), u("div", {
|
|
622
|
+
class: b(["abl-checkbox", p.value]),
|
|
623
|
+
onClick: v
|
|
620
624
|
}, [
|
|
621
|
-
|
|
622
|
-
class:
|
|
625
|
+
r("span", {
|
|
626
|
+
class: b(["abl-checkbox-input", p.value])
|
|
623
627
|
}, [
|
|
624
|
-
|
|
628
|
+
t.indeterminate ? (d(), u("i", St)) : (d(), u("i", zt))
|
|
625
629
|
], 2),
|
|
626
|
-
|
|
627
|
-
class:
|
|
630
|
+
r("span", {
|
|
631
|
+
class: b(["abl-checkbox-label", p.value])
|
|
628
632
|
}, [
|
|
629
|
-
|
|
630
|
-
x(
|
|
633
|
+
m(c.$slots, "default", {}, () => [
|
|
634
|
+
S(x(t.label), 1)
|
|
631
635
|
], !0)
|
|
632
636
|
], 2)
|
|
633
637
|
], 2));
|
|
634
638
|
}
|
|
635
|
-
}),
|
|
639
|
+
}), Et = /* @__PURE__ */ z(Vt, [["__scopeId", "data-v-2f9df559"]]), At = { class: "abl-checkbox-group" }, It = {
|
|
636
640
|
name: "AblCheckboxGroup"
|
|
637
|
-
},
|
|
641
|
+
}, Tt = /* @__PURE__ */ Object.assign(It, {
|
|
638
642
|
props: {
|
|
639
643
|
modelValue: {
|
|
640
644
|
type: Array,
|
|
@@ -646,27 +650,27 @@ const Fe = {
|
|
|
646
650
|
}
|
|
647
651
|
},
|
|
648
652
|
emits: ["update:modelValue", "change"],
|
|
649
|
-
setup(
|
|
650
|
-
const
|
|
651
|
-
console.log(
|
|
653
|
+
setup(t, { emit: e }) {
|
|
654
|
+
const s = t, o = e, a = (n) => {
|
|
655
|
+
console.log(n, "value"), o("update:modelValue", n), o("change", n);
|
|
652
656
|
};
|
|
653
|
-
return
|
|
657
|
+
return U(
|
|
654
658
|
"checkboxGroupKey",
|
|
655
|
-
|
|
656
|
-
...
|
|
657
|
-
changeEvent:
|
|
659
|
+
de({
|
|
660
|
+
...Y(s),
|
|
661
|
+
changeEvent: a
|
|
658
662
|
})
|
|
659
|
-
), (
|
|
660
|
-
|
|
663
|
+
), (n, i) => (d(), u("label", At, [
|
|
664
|
+
m(n.$slots, "default")
|
|
661
665
|
]));
|
|
662
666
|
}
|
|
663
|
-
}),
|
|
667
|
+
}), Ot = { class: "abl-dialog__header" }, Rt = { class: "abl-dialog__title" }, Ht = { class: "abl-dialog__body" }, Nt = {
|
|
664
668
|
key: 0,
|
|
665
669
|
class: "abl-dialog__footer"
|
|
666
|
-
},
|
|
670
|
+
}, Mt = {
|
|
667
671
|
name: "AblDialog"
|
|
668
|
-
},
|
|
669
|
-
...
|
|
672
|
+
}, Pt = /* @__PURE__ */ _e({
|
|
673
|
+
...Mt,
|
|
670
674
|
props: {
|
|
671
675
|
modelValue: {
|
|
672
676
|
type: Boolean,
|
|
@@ -701,53 +705,59 @@ const Fe = {
|
|
|
701
705
|
}
|
|
702
706
|
},
|
|
703
707
|
emits: ["update:modelValue", "onOverlayClick", "close"],
|
|
704
|
-
setup(
|
|
705
|
-
const
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
"
|
|
708
|
+
setup(t, { emit: e }) {
|
|
709
|
+
const s = t;
|
|
710
|
+
ue(() => {
|
|
711
|
+
typeof document < "u" && (s.modelValue ? (document.body.style.overflow = "hidden", document.body.style.touchAction = "none") : (document.body.style.overflow = "", document.body.style.touchAction = ""));
|
|
712
|
+
});
|
|
713
|
+
const o = e, a = () => {
|
|
714
|
+
s.beforeClose || (o("update:modelValue", !1), o("close"));
|
|
715
|
+
}, n = () => {
|
|
716
|
+
s.maskClosable && a(), o("onOverlayClick");
|
|
717
|
+
}, i = w(() => ({
|
|
718
|
+
"is-align-center": s.alignCenter
|
|
711
719
|
}));
|
|
712
|
-
return (
|
|
713
|
-
T(
|
|
714
|
-
default:
|
|
715
|
-
|
|
720
|
+
return (h, l) => (d(), M(ee, { to: "body" }, [
|
|
721
|
+
T(A, { name: "dialog-fade" }, {
|
|
722
|
+
default: I(() => [
|
|
723
|
+
t.modelValue ? (d(), u("div", {
|
|
716
724
|
key: 0,
|
|
717
|
-
class:
|
|
718
|
-
onClick:
|
|
725
|
+
class: b(["abl-dialog-overlay", i.value]),
|
|
726
|
+
onClick: n
|
|
719
727
|
}, [
|
|
720
|
-
|
|
721
|
-
class:
|
|
722
|
-
onClick:
|
|
728
|
+
r("div", {
|
|
729
|
+
class: b(["abl-dialog", t.customClass, i.value]),
|
|
730
|
+
onClick: l[0] || (l[0] = L(() => {
|
|
723
731
|
}, ["stop"])),
|
|
724
|
-
style:
|
|
732
|
+
style: y({ width: t.width }),
|
|
733
|
+
onTouchmove: l[1] || (l[1] = L(() => {
|
|
734
|
+
}, ["prevent"]))
|
|
725
735
|
}, [
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
736
|
+
m(h.$slots, "header", {}, () => [
|
|
737
|
+
r("header", Ot, [
|
|
738
|
+
r("span", Rt, x(t.title), 1),
|
|
739
|
+
t.showClose ? (d(), u("i", {
|
|
730
740
|
key: 0,
|
|
731
741
|
class: "iconfont-abl icon-abl-close close-icon",
|
|
732
|
-
onClick:
|
|
733
|
-
})) :
|
|
742
|
+
onClick: a
|
|
743
|
+
})) : g("", !0)
|
|
734
744
|
])
|
|
735
745
|
]),
|
|
736
|
-
|
|
737
|
-
|
|
746
|
+
r("div", Ht, [
|
|
747
|
+
m(h.$slots, "default")
|
|
738
748
|
]),
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
])) :
|
|
742
|
-
],
|
|
743
|
-
], 2)) :
|
|
749
|
+
h.$slots.footer ? (d(), u("footer", Nt, [
|
|
750
|
+
m(h.$slots, "footer")
|
|
751
|
+
])) : g("", !0)
|
|
752
|
+
], 38)
|
|
753
|
+
], 2)) : g("", !0)
|
|
744
754
|
]),
|
|
745
755
|
_: 3
|
|
746
756
|
})
|
|
747
757
|
]));
|
|
748
758
|
}
|
|
749
759
|
});
|
|
750
|
-
const
|
|
760
|
+
const Dt = { class: "abl-tooltip" }, Wt = ["id"], jt = ["innerHTML"], Ft = {
|
|
751
761
|
__name: "index",
|
|
752
762
|
props: {
|
|
753
763
|
name: "abl-tooltip",
|
|
@@ -760,108 +770,108 @@ const lt = { class: "abl-tooltip" }, ot = ["id"], st = ["innerHTML"], nt = {
|
|
|
760
770
|
default: "top"
|
|
761
771
|
}
|
|
762
772
|
},
|
|
763
|
-
setup(
|
|
764
|
-
const
|
|
765
|
-
const
|
|
766
|
-
return
|
|
767
|
-
})(),
|
|
768
|
-
|
|
769
|
-
const
|
|
773
|
+
setup(t) {
|
|
774
|
+
const e = t, s = _(!1), o = _({}), a = _({}), i = (() => {
|
|
775
|
+
const v = Date.now() >>> 0, c = Math.random();
|
|
776
|
+
return v + c;
|
|
777
|
+
})(), h = (p) => {
|
|
778
|
+
s.value = !0;
|
|
779
|
+
const c = document.getElementById("tool-tip" + i).getBoundingClientRect();
|
|
770
780
|
setTimeout(() => {
|
|
771
781
|
const f = document.getElementById("tool-tip-box");
|
|
772
782
|
if (f)
|
|
773
|
-
switch (
|
|
783
|
+
switch (e.placement) {
|
|
774
784
|
case "top":
|
|
775
785
|
o.value = {
|
|
776
|
-
top:
|
|
777
|
-
left:
|
|
778
|
-
},
|
|
786
|
+
top: c.top - 10 - f.offsetHeight + "px",
|
|
787
|
+
left: c.left + "px"
|
|
788
|
+
}, a.value = {
|
|
779
789
|
bottom: "-12px"
|
|
780
790
|
};
|
|
781
791
|
break;
|
|
782
792
|
case "left":
|
|
783
793
|
o.value = {
|
|
784
|
-
top:
|
|
785
|
-
left:
|
|
786
|
-
},
|
|
794
|
+
top: c.top - 10 + "px",
|
|
795
|
+
left: c.left - f.offsetWidth - 10 + "px"
|
|
796
|
+
}, a.value = {
|
|
787
797
|
right: "-11px",
|
|
788
798
|
top: f.offsetHeight / 2 - 8 + "px"
|
|
789
799
|
};
|
|
790
800
|
break;
|
|
791
801
|
case "right":
|
|
792
802
|
o.value = {
|
|
793
|
-
top:
|
|
794
|
-
left:
|
|
795
|
-
},
|
|
803
|
+
top: c.top + "px",
|
|
804
|
+
left: c.right + 10 + "px"
|
|
805
|
+
}, a.value = {
|
|
796
806
|
left: "-11px",
|
|
797
807
|
top: f.offsetHeight / 2 - 8 + "px"
|
|
798
808
|
};
|
|
799
809
|
break;
|
|
800
810
|
case "bottom":
|
|
801
811
|
o.value = {
|
|
802
|
-
top:
|
|
803
|
-
left:
|
|
804
|
-
},
|
|
812
|
+
top: c.bottom + 10 + "px",
|
|
813
|
+
left: c.left + "px"
|
|
814
|
+
}, a.value = {
|
|
805
815
|
top: "-12px"
|
|
806
816
|
};
|
|
807
817
|
break;
|
|
808
818
|
default:
|
|
809
819
|
o.value = {
|
|
810
|
-
top:
|
|
811
|
-
left:
|
|
820
|
+
top: c.top - c.height - 10 + "px",
|
|
821
|
+
left: c.left + "px"
|
|
812
822
|
};
|
|
813
823
|
break;
|
|
814
824
|
}
|
|
815
825
|
}, 0);
|
|
816
|
-
},
|
|
817
|
-
|
|
826
|
+
}, l = () => {
|
|
827
|
+
s.value = !1;
|
|
818
828
|
};
|
|
819
|
-
return (
|
|
820
|
-
|
|
829
|
+
return (p, v) => (d(), u("div", Dt, [
|
|
830
|
+
r("div", {
|
|
821
831
|
class: "tool-tip",
|
|
822
|
-
id: "tool-tip" +
|
|
823
|
-
onMouseover:
|
|
824
|
-
onMouseleave:
|
|
832
|
+
id: "tool-tip" + re(i),
|
|
833
|
+
onMouseover: L(h, ["stop"]),
|
|
834
|
+
onMouseleave: L(l, ["stop"])
|
|
825
835
|
}, [
|
|
826
|
-
p
|
|
827
|
-
(
|
|
828
|
-
T(
|
|
829
|
-
default:
|
|
830
|
-
|
|
836
|
+
m(p.$slots, "default", {}, void 0, !0),
|
|
837
|
+
(d(), M(ee, { to: "body" }, [
|
|
838
|
+
T(A, null, {
|
|
839
|
+
default: I(() => [
|
|
840
|
+
s.value ? (d(), u("div", {
|
|
831
841
|
key: 0,
|
|
832
842
|
class: "tool-tip-content",
|
|
833
843
|
id: "tool-tip-box",
|
|
834
|
-
style:
|
|
844
|
+
style: y(o.value)
|
|
835
845
|
}, [
|
|
836
|
-
|
|
837
|
-
innerHTML:
|
|
838
|
-
}, null, 8,
|
|
839
|
-
|
|
846
|
+
r("div", {
|
|
847
|
+
innerHTML: e.content
|
|
848
|
+
}, null, 8, jt),
|
|
849
|
+
r("div", {
|
|
840
850
|
class: "tool-popper__arrow",
|
|
841
|
-
style:
|
|
851
|
+
style: y(a.value)
|
|
842
852
|
}, [
|
|
843
|
-
|
|
844
|
-
class:
|
|
853
|
+
r("i", {
|
|
854
|
+
class: b(["iconfont-abl", "icon-abl-" + t.placement])
|
|
845
855
|
}, null, 2)
|
|
846
856
|
], 4)
|
|
847
|
-
], 4)) :
|
|
857
|
+
], 4)) : g("", !0)
|
|
848
858
|
]),
|
|
849
859
|
_: 1
|
|
850
860
|
})
|
|
851
861
|
]))
|
|
852
|
-
], 40,
|
|
862
|
+
], 40, Wt)
|
|
853
863
|
]));
|
|
854
864
|
}
|
|
855
|
-
},
|
|
856
|
-
const
|
|
857
|
-
|
|
858
|
-
],
|
|
859
|
-
|
|
860
|
-
],
|
|
861
|
-
|
|
862
|
-
],
|
|
863
|
-
|
|
864
|
-
],
|
|
865
|
+
}, qt = /* @__PURE__ */ z(Ft, [["__scopeId", "data-v-cd01dd7b"]]);
|
|
866
|
+
const te = (t) => (X("data-v-bc247383"), t = t(), Z(), t), Gt = ["onClick"], Kt = ["onClick", "onMouseenter"], Ut = /* @__PURE__ */ te(() => /* @__PURE__ */ r("path", { d: "M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z" }, null, -1)), Yt = [
|
|
867
|
+
Ut
|
|
868
|
+
], Xt = /* @__PURE__ */ te(() => /* @__PURE__ */ r("path", { d: "M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z" }, null, -1)), Zt = [
|
|
869
|
+
Xt
|
|
870
|
+
], Qt = ["onClick", "onMouseenter"], Jt = /* @__PURE__ */ te(() => /* @__PURE__ */ r("path", { d: "M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z" }, null, -1)), es = [
|
|
871
|
+
Jt
|
|
872
|
+
], ts = /* @__PURE__ */ te(() => /* @__PURE__ */ r("path", { d: "M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z" }, null, -1)), ss = [
|
|
873
|
+
ts
|
|
874
|
+
], os = {
|
|
865
875
|
__name: "index",
|
|
866
876
|
props: {
|
|
867
877
|
modelValue: {
|
|
@@ -902,107 +912,107 @@ const P = (e) => (N("data-v-bc247383"), e = e(), O(), e), dt = ["onClick"], ct =
|
|
|
902
912
|
}
|
|
903
913
|
},
|
|
904
914
|
emits: ["update:modelValue", "change", "hoverChange"],
|
|
905
|
-
setup(
|
|
906
|
-
const
|
|
907
|
-
|
|
908
|
-
() =>
|
|
915
|
+
setup(t, { emit: e }) {
|
|
916
|
+
const s = t, o = _(s.modelValue), a = _();
|
|
917
|
+
Te(
|
|
918
|
+
() => s.modelValue,
|
|
909
919
|
(f) => {
|
|
910
920
|
o.value = f;
|
|
911
921
|
}
|
|
912
922
|
);
|
|
913
|
-
const
|
|
914
|
-
|
|
915
|
-
},
|
|
916
|
-
o.value = f,
|
|
917
|
-
},
|
|
918
|
-
o.value = f,
|
|
919
|
-
},
|
|
920
|
-
|
|
921
|
-
},
|
|
922
|
-
o.value =
|
|
923
|
-
},
|
|
923
|
+
const n = e, i = (f) => {
|
|
924
|
+
a.value = null, f !== s.modelValue ? (n("change", f), n("update:modelValue", f)) : s.allowClear ? (a.value = f, n("change", 0), n("update:modelValue", 0)) : n("change", f);
|
|
925
|
+
}, h = (f) => {
|
|
926
|
+
o.value = f, n("hoverChange", f);
|
|
927
|
+
}, l = (f) => {
|
|
928
|
+
o.value = f, n("hoverChange", f);
|
|
929
|
+
}, p = () => {
|
|
930
|
+
a.value = null;
|
|
931
|
+
}, v = () => {
|
|
932
|
+
o.value = s.modelValue;
|
|
933
|
+
}, c = (f) => {
|
|
924
934
|
f.preventDefault();
|
|
925
935
|
};
|
|
926
|
-
return (f,
|
|
927
|
-
class:
|
|
928
|
-
style:
|
|
929
|
-
onMouseleave:
|
|
936
|
+
return (f, P) => (d(), u("div", {
|
|
937
|
+
class: b(["abl-rate", { disabled: t.readonly }]),
|
|
938
|
+
style: y(`--color: ${t.color};`),
|
|
939
|
+
onMouseleave: v
|
|
930
940
|
}, [
|
|
931
|
-
(
|
|
932
|
-
class:
|
|
933
|
-
style:
|
|
934
|
-
onClick: (
|
|
941
|
+
(d(!0), u(E, null, W(t.count, (k) => (d(), u("div", {
|
|
942
|
+
class: b(["abl-rate-star", { "abl-rate-star-half": t.allowHalf && o.value >= k - 0.5 && o.value < k, "abl-rate-star-full": o.value >= k, "temp-gray": !t.allowHalf && a.value === k }]),
|
|
943
|
+
style: y(`margin-right: ${k !== t.count ? t.gap : 0}px;`),
|
|
944
|
+
onClick: (R) => t.allowHalf ? c(R) : i(k),
|
|
935
945
|
key: k
|
|
936
946
|
}, [
|
|
937
|
-
|
|
947
|
+
t.allowHalf ? (d(), u("div", {
|
|
938
948
|
key: 0,
|
|
939
|
-
class:
|
|
940
|
-
onClick:
|
|
941
|
-
onMouseenter: (
|
|
942
|
-
onMouseleave:
|
|
949
|
+
class: b(["abl-rate-star-first", { "temp-gray-first": a.value === k - 0.5 }]),
|
|
950
|
+
onClick: L((R) => i(k - 0.5), ["stop"]),
|
|
951
|
+
onMouseenter: (R) => h(k - 0.5),
|
|
952
|
+
onMouseleave: p
|
|
943
953
|
}, [
|
|
944
|
-
|
|
954
|
+
t.character === "star-filled" ? (d(), u("svg", {
|
|
945
955
|
key: 0,
|
|
946
956
|
class: "action-star",
|
|
947
|
-
style:
|
|
957
|
+
style: y(`width: ${t.size}px;`),
|
|
948
958
|
focusable: "false",
|
|
949
959
|
"data-icon": "star",
|
|
950
960
|
"aria-hidden": "true",
|
|
951
961
|
viewBox: "64 64 896 896"
|
|
952
|
-
},
|
|
962
|
+
}, Yt, 4)) : t.character === "star-outlined" ? (d(), u("svg", {
|
|
953
963
|
key: 1,
|
|
954
964
|
class: "action-star",
|
|
955
|
-
style:
|
|
965
|
+
style: y(`width: ${t.size}px;`),
|
|
956
966
|
focusable: "false",
|
|
957
967
|
"data-icon": "star",
|
|
958
968
|
"aria-hidden": "true",
|
|
959
969
|
viewBox: "64 64 896 896"
|
|
960
|
-
},
|
|
970
|
+
}, Zt, 4)) : (d(), u("span", {
|
|
961
971
|
key: 2,
|
|
962
972
|
class: "action-star",
|
|
963
|
-
style:
|
|
973
|
+
style: y(`font-size: ${0.66 * t.size}px; height: ${t.size}px;`)
|
|
964
974
|
}, [
|
|
965
|
-
|
|
966
|
-
x(
|
|
975
|
+
m(f.$slots, "character", {}, () => [
|
|
976
|
+
S(x(t.character), 1)
|
|
967
977
|
], !0)
|
|
968
978
|
], 4))
|
|
969
|
-
], 42,
|
|
970
|
-
|
|
971
|
-
class:
|
|
972
|
-
onClick:
|
|
973
|
-
onMouseenter: (
|
|
974
|
-
onMouseleave:
|
|
979
|
+
], 42, Kt)) : g("", !0),
|
|
980
|
+
r("div", {
|
|
981
|
+
class: b(["abl-rate-star-second", { "temp-gray-second": a.value === k }]),
|
|
982
|
+
onClick: L((R) => i(k), ["stop"]),
|
|
983
|
+
onMouseenter: (R) => l(k),
|
|
984
|
+
onMouseleave: p
|
|
975
985
|
}, [
|
|
976
|
-
|
|
986
|
+
t.character === "star-filled" ? (d(), u("svg", {
|
|
977
987
|
key: 0,
|
|
978
988
|
class: "action-star",
|
|
979
|
-
style:
|
|
989
|
+
style: y(`width: ${t.size}px;`),
|
|
980
990
|
focusable: "false",
|
|
981
991
|
"data-icon": "star",
|
|
982
992
|
"aria-hidden": "true",
|
|
983
993
|
viewBox: "64 64 896 896"
|
|
984
|
-
},
|
|
994
|
+
}, es, 4)) : t.character === "star-outlined" ? (d(), u("svg", {
|
|
985
995
|
key: 1,
|
|
986
996
|
class: "action-star",
|
|
987
|
-
style:
|
|
997
|
+
style: y(`width: ${t.size}px;`),
|
|
988
998
|
focusable: "false",
|
|
989
999
|
"data-icon": "star",
|
|
990
1000
|
"aria-hidden": "true",
|
|
991
1001
|
viewBox: "64 64 896 896"
|
|
992
|
-
},
|
|
1002
|
+
}, ss, 4)) : (d(), u("span", {
|
|
993
1003
|
key: 2,
|
|
994
1004
|
class: "action-star",
|
|
995
|
-
style:
|
|
1005
|
+
style: y(`font-size: ${0.66 * t.size}px; height: ${t.size}px;`)
|
|
996
1006
|
}, [
|
|
997
|
-
|
|
998
|
-
x(
|
|
1007
|
+
m(f.$slots, "character", {}, () => [
|
|
1008
|
+
S(x(t.character), 1)
|
|
999
1009
|
], !0)
|
|
1000
1010
|
], 4))
|
|
1001
|
-
], 42,
|
|
1002
|
-
], 14,
|
|
1011
|
+
], 42, Qt)
|
|
1012
|
+
], 14, Gt))), 128))
|
|
1003
1013
|
], 38));
|
|
1004
1014
|
}
|
|
1005
|
-
},
|
|
1015
|
+
}, as = /* @__PURE__ */ z(os, [["__scopeId", "data-v-bc247383"]]), ls = { class: "abl-collapse" }, is = {
|
|
1006
1016
|
__name: "index",
|
|
1007
1017
|
props: {
|
|
1008
1018
|
modelValue: {
|
|
@@ -1011,34 +1021,34 @@ const P = (e) => (N("data-v-bc247383"), e = e(), O(), e), dt = ["onClick"], ct =
|
|
|
1011
1021
|
}
|
|
1012
1022
|
},
|
|
1013
1023
|
emits: ["update:modelValue", "change"],
|
|
1014
|
-
setup(
|
|
1015
|
-
const
|
|
1016
|
-
o("update:modelValue",
|
|
1024
|
+
setup(t, { emit: e }) {
|
|
1025
|
+
const s = t, o = e, a = (n) => {
|
|
1026
|
+
o("update:modelValue", n), o("change", n);
|
|
1017
1027
|
};
|
|
1018
|
-
return
|
|
1028
|
+
return U(
|
|
1019
1029
|
"CollapseKey",
|
|
1020
|
-
|
|
1021
|
-
...
|
|
1022
|
-
changeEvent:
|
|
1030
|
+
de({
|
|
1031
|
+
...Y(s),
|
|
1032
|
+
changeEvent: a
|
|
1023
1033
|
})
|
|
1024
|
-
), (
|
|
1025
|
-
|
|
1034
|
+
), (n, i) => (d(), u("div", ls, [
|
|
1035
|
+
m(n.$slots, "default")
|
|
1026
1036
|
]));
|
|
1027
1037
|
}
|
|
1028
1038
|
};
|
|
1029
|
-
const
|
|
1039
|
+
const ns = (t) => (X("data-v-0789818d"), t = t(), Z(), t), rs = { class: "abl-title" }, ds = {
|
|
1030
1040
|
key: 0,
|
|
1031
1041
|
focusable: "false",
|
|
1032
1042
|
class: "abl-arrow",
|
|
1033
1043
|
"data-icon": "right",
|
|
1034
1044
|
"aria-hidden": "true",
|
|
1035
1045
|
viewBox: "64 64 896 896"
|
|
1036
|
-
},
|
|
1046
|
+
}, cs = /* @__PURE__ */ ns(() => /* @__PURE__ */ r("path", {
|
|
1037
1047
|
d: "M966.4 323.2c-9.6-9.6-25.6-9.6-35.2 0l-416 416-425.6-416c-9.6-9.6-25.6-9.6-35.2 0-9.6 9.6-9.6 25.6 0 35.2l441.6 432c9.6 9.6 25.6 9.6 35.2 0l435.2-432C976 345.6 976 332.8 966.4 323.2z",
|
|
1038
1048
|
"p-id": "6075"
|
|
1039
|
-
}, null, -1)),
|
|
1040
|
-
|
|
1041
|
-
],
|
|
1049
|
+
}, null, -1)), us = [
|
|
1050
|
+
cs
|
|
1051
|
+
], ve = "0.2s height ease-in-out", hs = {
|
|
1042
1052
|
__name: "CollapseItem",
|
|
1043
1053
|
props: {
|
|
1044
1054
|
showArrow: {
|
|
@@ -1054,72 +1064,72 @@ const xt = (e) => (N("data-v-be409018"), e = e(), O(), e), wt = { class: "abl-ti
|
|
|
1054
1064
|
default: ""
|
|
1055
1065
|
}
|
|
1056
1066
|
},
|
|
1057
|
-
setup(
|
|
1058
|
-
const
|
|
1059
|
-
|
|
1060
|
-
const o =
|
|
1061
|
-
function
|
|
1062
|
-
if (
|
|
1063
|
-
if (Array.isArray(
|
|
1064
|
-
const
|
|
1065
|
-
o.changeEvent(
|
|
1067
|
+
setup(t) {
|
|
1068
|
+
const e = t, s = _();
|
|
1069
|
+
_();
|
|
1070
|
+
const o = Q("CollapseKey", void 0), a = w(() => o.modelValue);
|
|
1071
|
+
function n() {
|
|
1072
|
+
if (i.value)
|
|
1073
|
+
if (Array.isArray(a.value)) {
|
|
1074
|
+
const l = a.value.filter((p) => p !== e.name);
|
|
1075
|
+
o.changeEvent(l);
|
|
1066
1076
|
} else
|
|
1067
1077
|
o.changeEvent(null);
|
|
1068
1078
|
else
|
|
1069
|
-
Array.isArray(
|
|
1079
|
+
Array.isArray(a.value) ? o.changeEvent([...a.value, e.name]) : o.changeEvent(e.name);
|
|
1070
1080
|
}
|
|
1071
|
-
const
|
|
1072
|
-
onBeforeEnter(
|
|
1073
|
-
|
|
1081
|
+
const i = w(() => Array.isArray(a.value) ? a.value.includes(e.name) : a.value === e.name), h = {
|
|
1082
|
+
onBeforeEnter(l) {
|
|
1083
|
+
l.style.transition = ve, l.dataset || (l.dataset = {}), l.dataset.oldPaddingTop = l.style.paddingTop, l.dataset.oldPaddingBottom = l.style.paddingBottom, l.style.height = 0, l.style.paddingTop = 0, l.style.paddingBottom = 0;
|
|
1074
1084
|
},
|
|
1075
|
-
onEnter(
|
|
1076
|
-
|
|
1085
|
+
onEnter(l) {
|
|
1086
|
+
l.dataset.oldOverflow = l.style.overflow, l.scrollHeight !== 0 ? (l.style.height = l.scrollHeight + "px", l.style.paddingTop = l.dataset.oldPaddingTop, l.style.paddingBottom = l.dataset.oldPaddingBottom) : (l.style.height = "", l.style.paddingTop = l.dataset.oldPaddingTop, l.style.paddingBottom = l.dataset.oldPaddingBottom), l.style.overflow = "hidden";
|
|
1077
1087
|
},
|
|
1078
|
-
onAfterEnter(
|
|
1079
|
-
|
|
1088
|
+
onAfterEnter(l) {
|
|
1089
|
+
l.style.transition = "", l.style.height = "", l.style.overflow = l.dataset.oldOverflow;
|
|
1080
1090
|
},
|
|
1081
|
-
onBeforeLeave(
|
|
1082
|
-
|
|
1091
|
+
onBeforeLeave(l) {
|
|
1092
|
+
l.dataset || (l.dataset = {}), l.dataset.oldPaddingTop = l.style.paddingTop, l.dataset.oldPaddingBottom = l.style.paddingBottom, l.dataset.oldOverflow = l.style.overflow, l.style.height = l.scrollHeight + "px", l.style.overflow = "hidden";
|
|
1083
1093
|
},
|
|
1084
|
-
onLeave(
|
|
1085
|
-
|
|
1094
|
+
onLeave(l) {
|
|
1095
|
+
l.scrollHeight !== 0 && (l.style.transition = ve, l.style.height = 0, l.style.paddingTop = 0, l.style.paddingBottom = 0);
|
|
1086
1096
|
},
|
|
1087
|
-
onAfterLeave(
|
|
1088
|
-
|
|
1097
|
+
onAfterLeave(l) {
|
|
1098
|
+
l.style.transition = "", l.style.height = "", l.style.overflow = l.dataset.oldOverflow, l.style.paddingTop = l.dataset.oldPaddingTop, l.style.paddingBottom = l.dataset.oldPaddingBottom;
|
|
1089
1099
|
}
|
|
1090
1100
|
};
|
|
1091
|
-
return (
|
|
1092
|
-
class:
|
|
1101
|
+
return (l, p) => (d(), u("div", {
|
|
1102
|
+
class: b(["abl-collapse-item", { "abl-collapse-item-active": i.value }])
|
|
1093
1103
|
}, [
|
|
1094
|
-
|
|
1104
|
+
r("div", {
|
|
1095
1105
|
class: "abl-collapse-header",
|
|
1096
|
-
onClick:
|
|
1106
|
+
onClick: L(n, ["stop"])
|
|
1097
1107
|
}, [
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
x(
|
|
1108
|
+
r("div", rs, [
|
|
1109
|
+
m(l.$slots, "title", {}, () => [
|
|
1110
|
+
S(x(t.title), 1)
|
|
1101
1111
|
], !0)
|
|
1102
1112
|
]),
|
|
1103
|
-
|
|
1113
|
+
t.showArrow ? (d(), u("svg", ds, us)) : g("", !0)
|
|
1104
1114
|
]),
|
|
1105
|
-
T(
|
|
1106
|
-
default:
|
|
1107
|
-
J(
|
|
1115
|
+
T(A, Oe(Re(h)), {
|
|
1116
|
+
default: I(() => [
|
|
1117
|
+
J(r("div", {
|
|
1108
1118
|
ref_key: "contentRef",
|
|
1109
|
-
ref:
|
|
1119
|
+
ref: s,
|
|
1110
1120
|
class: "abl-collapse-content"
|
|
1111
1121
|
}, [
|
|
1112
|
-
|
|
1122
|
+
m(l.$slots, "default", {}, void 0, !0)
|
|
1113
1123
|
], 512), [
|
|
1114
|
-
[
|
|
1124
|
+
[ce, i.value]
|
|
1115
1125
|
])
|
|
1116
1126
|
]),
|
|
1117
1127
|
_: 3
|
|
1118
1128
|
}, 16)
|
|
1119
1129
|
], 2));
|
|
1120
1130
|
}
|
|
1121
|
-
},
|
|
1122
|
-
const
|
|
1131
|
+
}, fs = /* @__PURE__ */ z(hs, [["__scopeId", "data-v-0789818d"]]);
|
|
1132
|
+
const ps = { class: "abl-progress-text" }, vs = {
|
|
1123
1133
|
__name: "index",
|
|
1124
1134
|
props: {
|
|
1125
1135
|
width: {
|
|
@@ -1144,7 +1154,7 @@ const zt = { class: "abl-progress-text" }, Lt = {
|
|
|
1144
1154
|
},
|
|
1145
1155
|
format: {
|
|
1146
1156
|
type: Function,
|
|
1147
|
-
default: (
|
|
1157
|
+
default: (t) => t + "%"
|
|
1148
1158
|
},
|
|
1149
1159
|
borderRadius: {
|
|
1150
1160
|
type: String,
|
|
@@ -1155,55 +1165,55 @@ const zt = { class: "abl-progress-text" }, Lt = {
|
|
|
1155
1165
|
default: !1
|
|
1156
1166
|
}
|
|
1157
1167
|
},
|
|
1158
|
-
setup(
|
|
1159
|
-
const
|
|
1160
|
-
return (
|
|
1168
|
+
setup(t) {
|
|
1169
|
+
const e = t, s = w(() => typeof e.width == "number" ? e.width + "px" : e.width), o = w(() => typeof e.strokeColor == "string" ? e.strokeColor : `linear-gradient(to ${e.strokeColor.direction || "right"}, ${e.strokeColor["0%"] || e.strokeColor.from}, ${e.strokeColor["100%"] || e.strokeColor.to})`), a = w(() => e.format(`${e.percent > 100 ? 100 : e.percent}`));
|
|
1170
|
+
return (n, i) => (d(), u("div", {
|
|
1161
1171
|
class: "abl-progress-line",
|
|
1162
|
-
style:
|
|
1163
|
-
height: ${
|
|
1172
|
+
style: y(`width: ${s.value};
|
|
1173
|
+
height: ${t.strokeWidth < 24 ? 24 : t.strokeWidth}px;`)
|
|
1164
1174
|
}, [
|
|
1165
|
-
|
|
1175
|
+
r("div", {
|
|
1166
1176
|
class: "abl-progress-inner",
|
|
1167
|
-
style:
|
|
1177
|
+
style: y(`border-radius: ${t.borderRadius}`)
|
|
1168
1178
|
}, [
|
|
1169
|
-
|
|
1170
|
-
class:
|
|
1171
|
-
style:
|
|
1172
|
-
width: ${
|
|
1179
|
+
r("div", {
|
|
1180
|
+
class: b(["abl-progress-bg", t.indeterminate && "abl-progress-bg-animate"]),
|
|
1181
|
+
style: y(`background: ${o.value};
|
|
1182
|
+
width: ${t.percent >= 100 ? 100 : t.percent}%; height: ${t.strokeWidth}px;border-radius: ${t.borderRadius}`)
|
|
1173
1183
|
}, null, 6)
|
|
1174
1184
|
], 4),
|
|
1175
|
-
|
|
1185
|
+
t.showInfo ? (d(), M(A, {
|
|
1176
1186
|
key: 0,
|
|
1177
1187
|
mode: "out-in"
|
|
1178
1188
|
}, {
|
|
1179
|
-
default:
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
x(
|
|
1189
|
+
default: I(() => [
|
|
1190
|
+
r("p", ps, [
|
|
1191
|
+
m(n.$slots, "format", { percent: t.percent }, () => [
|
|
1192
|
+
S(x(a.value), 1)
|
|
1183
1193
|
], !0)
|
|
1184
1194
|
])
|
|
1185
1195
|
]),
|
|
1186
1196
|
_: 3
|
|
1187
|
-
})) :
|
|
1197
|
+
})) : g("", !0)
|
|
1188
1198
|
], 4));
|
|
1189
1199
|
}
|
|
1190
|
-
},
|
|
1191
|
-
const
|
|
1200
|
+
}, ms = /* @__PURE__ */ z(vs, [["__scopeId", "data-v-4aef1725"]]);
|
|
1201
|
+
const gs = (t) => (X("data-v-ec690b7f"), t = t(), Z(), t), bs = { class: "abl-cell" }, ys = {
|
|
1192
1202
|
key: 0,
|
|
1193
1203
|
class: "abl-cell__title"
|
|
1194
|
-
},
|
|
1204
|
+
}, _s = {
|
|
1195
1205
|
key: 0,
|
|
1196
1206
|
class: "abl-cell__label"
|
|
1197
|
-
},
|
|
1207
|
+
}, ws = {
|
|
1198
1208
|
key: 1,
|
|
1199
1209
|
class: "abl-cell__value"
|
|
1200
|
-
},
|
|
1210
|
+
}, $s = {
|
|
1201
1211
|
key: 2,
|
|
1202
1212
|
class: "abl-cell__extra"
|
|
1203
|
-
},
|
|
1213
|
+
}, xs = {
|
|
1204
1214
|
key: 3,
|
|
1205
1215
|
class: "abl-cell__arrow"
|
|
1206
|
-
},
|
|
1216
|
+
}, ks = /* @__PURE__ */ gs(() => /* @__PURE__ */ r("i", { class: "iconfont-abl icon-abl-youjiantou" }, null, -1)), Cs = {
|
|
1207
1217
|
__name: "index",
|
|
1208
1218
|
props: {
|
|
1209
1219
|
isLink: {
|
|
@@ -1227,58 +1237,1211 @@ const At = (e) => (N("data-v-ec690b7f"), e = e(), O(), e), Et = { class: "abl-ce
|
|
|
1227
1237
|
default: ""
|
|
1228
1238
|
}
|
|
1229
1239
|
},
|
|
1230
|
-
setup(
|
|
1231
|
-
return (
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
x(
|
|
1240
|
+
setup(t) {
|
|
1241
|
+
return (e, s) => (d(), u("div", bs, [
|
|
1242
|
+
e.$slots.title || t.title ? (d(), u("div", ys, [
|
|
1243
|
+
m(e.$slots, "title", {}, () => [
|
|
1244
|
+
S(x(t.title), 1)
|
|
1235
1245
|
], !0),
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
x(
|
|
1246
|
+
e.$slots.label || t.label ? (d(), u("div", _s, [
|
|
1247
|
+
m(e.$slots, "label", {}, () => [
|
|
1248
|
+
S(x(t.label), 1)
|
|
1239
1249
|
], !0)
|
|
1240
|
-
])) :
|
|
1241
|
-
])) :
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
x(
|
|
1250
|
+
])) : g("", !0)
|
|
1251
|
+
])) : g("", !0),
|
|
1252
|
+
e.$slots.value || t.value ? (d(), u("div", ws, [
|
|
1253
|
+
m(e.$slots, "value", {}, () => [
|
|
1254
|
+
S(x(t.value), 1)
|
|
1245
1255
|
], !0)
|
|
1246
|
-
])) :
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
x(
|
|
1256
|
+
])) : g("", !0),
|
|
1257
|
+
e.$slots.extra || t.extra ? (d(), u("div", $s, [
|
|
1258
|
+
m(e.$slots, "extra", {}, () => [
|
|
1259
|
+
S(x(t.extra), 1)
|
|
1250
1260
|
], !0)
|
|
1251
|
-
])) :
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1261
|
+
])) : g("", !0),
|
|
1262
|
+
t.isLink ? (d(), u("div", xs, [
|
|
1263
|
+
m(e.$slots, "arrow", {}, () => [
|
|
1264
|
+
ks
|
|
1255
1265
|
], !0)
|
|
1256
|
-
])) :
|
|
1266
|
+
])) : g("", !0)
|
|
1267
|
+
]));
|
|
1268
|
+
}
|
|
1269
|
+
}, Ls = /* @__PURE__ */ z(Cs, [["__scopeId", "data-v-ec690b7f"]]);
|
|
1270
|
+
const Ss = /* @__PURE__ */ r("div", {
|
|
1271
|
+
class: "abl-image-preview-mask",
|
|
1272
|
+
appear: ""
|
|
1273
|
+
}, null, -1), zs = { class: "abl-image-preview-body" }, Bs = ["src", "onLoad"], Vs = {
|
|
1274
|
+
key: 0,
|
|
1275
|
+
class: "abl-image-preview__progress"
|
|
1276
|
+
}, Es = { class: "abl-image-preview__progress-text" }, As = /* @__PURE__ */ r("i", { class: "abl-icon" }, [
|
|
1277
|
+
/* @__PURE__ */ r("svg", {
|
|
1278
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1279
|
+
viewBox: "0 0 1024 1024"
|
|
1280
|
+
}, [
|
|
1281
|
+
/* @__PURE__ */ r("path", {
|
|
1282
|
+
fill: "currentColor",
|
|
1283
|
+
d: "M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"
|
|
1284
|
+
})
|
|
1285
|
+
])
|
|
1286
|
+
], -1), Is = [
|
|
1287
|
+
As
|
|
1288
|
+
], Ts = /* @__PURE__ */ r("i", { class: "abl-icon" }, [
|
|
1289
|
+
/* @__PURE__ */ r("svg", {
|
|
1290
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1291
|
+
viewBox: "0 0 1024 1024"
|
|
1292
|
+
}, [
|
|
1293
|
+
/* @__PURE__ */ r("path", {
|
|
1294
|
+
fill: "currentColor",
|
|
1295
|
+
d: "M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"
|
|
1296
|
+
})
|
|
1297
|
+
])
|
|
1298
|
+
], -1), Os = [
|
|
1299
|
+
Ts
|
|
1300
|
+
], Rs = /* @__PURE__ */ r("i", { class: "abl-icon" }, [
|
|
1301
|
+
/* @__PURE__ */ r("svg", {
|
|
1302
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1303
|
+
viewBox: "0 0 1024 1024"
|
|
1304
|
+
}, [
|
|
1305
|
+
/* @__PURE__ */ r("path", {
|
|
1306
|
+
fill: "currentColor",
|
|
1307
|
+
d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
|
|
1308
|
+
})
|
|
1309
|
+
])
|
|
1310
|
+
], -1), Hs = [
|
|
1311
|
+
Rs
|
|
1312
|
+
], Ns = { class: "abl-image-preview__btn abl-image-preview__actions" }, Ms = { class: "abl-image-preview__actions__inner" }, Ps = /* @__PURE__ */ r("svg", {
|
|
1313
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1314
|
+
viewBox: "0 0 1024 1024"
|
|
1315
|
+
}, [
|
|
1316
|
+
/* @__PURE__ */ r("path", {
|
|
1317
|
+
fill: "currentColor",
|
|
1318
|
+
d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"
|
|
1319
|
+
})
|
|
1320
|
+
], -1), Ds = [
|
|
1321
|
+
Ps
|
|
1322
|
+
], Ws = /* @__PURE__ */ r("svg", {
|
|
1323
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1324
|
+
viewBox: "0 0 1024 1024"
|
|
1325
|
+
}, [
|
|
1326
|
+
/* @__PURE__ */ r("path", {
|
|
1327
|
+
fill: "currentColor",
|
|
1328
|
+
d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"
|
|
1329
|
+
})
|
|
1330
|
+
], -1), js = [
|
|
1331
|
+
Ws
|
|
1332
|
+
], Fs = /* @__PURE__ */ r("svg", {
|
|
1333
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1334
|
+
viewBox: "0 0 1024 1024"
|
|
1335
|
+
}, [
|
|
1336
|
+
/* @__PURE__ */ r("path", {
|
|
1337
|
+
fill: "currentColor",
|
|
1338
|
+
d: "m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64l192-.192zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"
|
|
1339
|
+
})
|
|
1340
|
+
], -1), qs = [
|
|
1341
|
+
Fs
|
|
1342
|
+
], Gs = /* @__PURE__ */ r("svg", {
|
|
1343
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1344
|
+
viewBox: "0 0 1024 1024"
|
|
1345
|
+
}, [
|
|
1346
|
+
/* @__PURE__ */ r("path", {
|
|
1347
|
+
fill: "currentColor",
|
|
1348
|
+
d: "M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"
|
|
1349
|
+
})
|
|
1350
|
+
], -1), Ks = [
|
|
1351
|
+
Gs
|
|
1352
|
+
], Us = /* @__PURE__ */ r("svg", {
|
|
1353
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1354
|
+
viewBox: "0 0 1024 1024"
|
|
1355
|
+
}, [
|
|
1356
|
+
/* @__PURE__ */ r("path", {
|
|
1357
|
+
fill: "currentColor",
|
|
1358
|
+
d: "M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88z"
|
|
1359
|
+
})
|
|
1360
|
+
], -1), Ys = [
|
|
1361
|
+
Us
|
|
1362
|
+
], $e = {
|
|
1363
|
+
__name: "ImageView",
|
|
1364
|
+
props: {
|
|
1365
|
+
previewSrcList: {
|
|
1366
|
+
type: Array,
|
|
1367
|
+
default: []
|
|
1368
|
+
},
|
|
1369
|
+
initialIndex: {
|
|
1370
|
+
type: Number,
|
|
1371
|
+
default: 0
|
|
1372
|
+
},
|
|
1373
|
+
maxScale: {
|
|
1374
|
+
type: Number,
|
|
1375
|
+
default: 7
|
|
1376
|
+
},
|
|
1377
|
+
minScale: {
|
|
1378
|
+
type: Number,
|
|
1379
|
+
default: 0.2
|
|
1380
|
+
},
|
|
1381
|
+
zoomRate: {
|
|
1382
|
+
type: Number,
|
|
1383
|
+
default: 0.2
|
|
1384
|
+
},
|
|
1385
|
+
showProgress: {
|
|
1386
|
+
type: Boolean,
|
|
1387
|
+
default: !0
|
|
1388
|
+
}
|
|
1389
|
+
},
|
|
1390
|
+
emits: ["close"],
|
|
1391
|
+
setup(t, { emit: e }) {
|
|
1392
|
+
const s = t, o = w(() => s.previewSrcList.length), a = _(Array(o.value).fill(!1)), n = _(s.initialIndex), i = _(1), h = _(0), l = _(0), p = _(0), v = _(0), c = _(0), f = e, P = (C, $) => {
|
|
1393
|
+
let B, V;
|
|
1394
|
+
try {
|
|
1395
|
+
B = C.toString().split(".")[1].length;
|
|
1396
|
+
} catch {
|
|
1397
|
+
B = 0;
|
|
1398
|
+
}
|
|
1399
|
+
try {
|
|
1400
|
+
V = $.toString().split(".")[1].length;
|
|
1401
|
+
} catch {
|
|
1402
|
+
V = 0;
|
|
1403
|
+
}
|
|
1404
|
+
const H = Math.max(B, V), D = Math.pow(10, H);
|
|
1405
|
+
return C = Math.round(C * D), $ = Math.round($ * D), (C + $) / D;
|
|
1406
|
+
}, k = (C) => {
|
|
1407
|
+
a.value[C] = !0;
|
|
1408
|
+
}, R = (C) => {
|
|
1409
|
+
n.value = (n.value + 1) % o.value;
|
|
1410
|
+
}, Ce = (C) => {
|
|
1411
|
+
n.value = (n.value - 1 + o.value) % o.value;
|
|
1412
|
+
}, Le = () => {
|
|
1413
|
+
i.value + s.zoomRate > s.maxScale ? i.value = s.maxScale : i.value = P(i.value, s.zoomRate);
|
|
1414
|
+
}, Se = () => {
|
|
1415
|
+
i.value - s.zoomRate < s.minScale ? i.value = s.minScale : i.value = P(i.value, -s.zoomRate);
|
|
1416
|
+
}, ze = () => {
|
|
1417
|
+
c.value -= 90;
|
|
1418
|
+
}, Be = () => {
|
|
1419
|
+
c.value += 90;
|
|
1420
|
+
}, Ve = () => {
|
|
1421
|
+
c.value = 0, i.value = 1, p.value = 0, v.value = 0;
|
|
1422
|
+
}, Ee = (C) => {
|
|
1423
|
+
console.log("e====", C);
|
|
1424
|
+
const $ = C.target, { top: B, left: V, right: H, bottom: D } = $.getBoundingClientRect(), se = document.documentElement.clientWidth, G = document.documentElement.clientHeight;
|
|
1425
|
+
h.value = C.clientX, l.value = C.clientY;
|
|
1426
|
+
const j = p.value, F = v.value;
|
|
1427
|
+
document.onmousemove = (oe) => {
|
|
1428
|
+
p.value = j + oe.clientX - h.value, v.value = F + oe.clientY - l.value;
|
|
1429
|
+
}, document.onmouseup = (oe) => {
|
|
1430
|
+
p.value > j + se - H && (p.value = j + se - H), p.value < j - V && (p.value = j - V), v.value > F + G - D && (v.value = F + G - D), v.value < F - B && (v.value = F - B), document.onmousemove = null;
|
|
1431
|
+
};
|
|
1432
|
+
}, Ae = (C) => {
|
|
1433
|
+
const $ = C.deltaY * s.zoomRate * 0.1;
|
|
1434
|
+
i.value === s.minScale && $ > 0 || i.value === s.maxScale && $ < 0 || (i.value - $ < s.minScale ? i.value = s.minScale : i.value - $ > s.maxScale ? i.value = s.maxScale : i.value = P(i.value, -$));
|
|
1435
|
+
}, Ie = () => {
|
|
1436
|
+
f("close");
|
|
1437
|
+
};
|
|
1438
|
+
return ue(() => {
|
|
1439
|
+
typeof document < "u" && (s.modelValue ? (document.body.style.overflow = "hidden", document.body.style.touchAction = "none") : (document.body.style.overflow = "", document.body.style.touchAction = ""));
|
|
1440
|
+
}), (C, $) => (d(), M(ee, { to: "body" }, [
|
|
1441
|
+
T(A, { name: "mask" }, {
|
|
1442
|
+
default: I(() => [
|
|
1443
|
+
Ss
|
|
1444
|
+
]),
|
|
1445
|
+
_: 1
|
|
1446
|
+
}),
|
|
1447
|
+
T(A, {
|
|
1448
|
+
name: "preview",
|
|
1449
|
+
appear: ""
|
|
1450
|
+
}, {
|
|
1451
|
+
default: I(() => [
|
|
1452
|
+
r("div", {
|
|
1453
|
+
class: "abl-image-preview-wrap",
|
|
1454
|
+
onWheel: $[2] || ($[2] = L((B) => Ae(B), ["prevent"]))
|
|
1455
|
+
}, [
|
|
1456
|
+
r("div", zs, [
|
|
1457
|
+
r("div", {
|
|
1458
|
+
class: "abl-image-preview",
|
|
1459
|
+
style: y(`transform: translate3d(${p.value}px, ${v.value}px, 0px);`)
|
|
1460
|
+
}, [
|
|
1461
|
+
(d(!0), u(E, null, W(t.previewSrcList, (B, V) => J((d(), u("div", {
|
|
1462
|
+
key: V,
|
|
1463
|
+
class: "abl-image-preview__box"
|
|
1464
|
+
}, [
|
|
1465
|
+
r("img", {
|
|
1466
|
+
src: B,
|
|
1467
|
+
class: "abl-image-preview__img",
|
|
1468
|
+
style: y(`transform: scale3d(${i.value}, ${i.value}, 1) rotate(${c.value}deg);`),
|
|
1469
|
+
onLoad: (H) => k(V),
|
|
1470
|
+
onMousedown: $[0] || ($[0] = L((H) => Ee(H), ["prevent"])),
|
|
1471
|
+
onClick: $[1] || ($[1] = L(() => {
|
|
1472
|
+
}, ["stop"]))
|
|
1473
|
+
}, null, 44, Bs),
|
|
1474
|
+
m(C.$slots, "default"),
|
|
1475
|
+
t.showProgress ? (d(), u("div", Vs, [
|
|
1476
|
+
r("div", Es, x(`${n.value + 1}/${o.value}`), 1)
|
|
1477
|
+
])) : g("", !0)
|
|
1478
|
+
])), [
|
|
1479
|
+
[ce, n.value === V]
|
|
1480
|
+
])), 128))
|
|
1481
|
+
], 4),
|
|
1482
|
+
o.value > 1 ? (d(), u(E, { key: 0 }, [
|
|
1483
|
+
r("div", {
|
|
1484
|
+
class: "abl-image-preview__btn abl-image-preview__prev",
|
|
1485
|
+
onClick: L(Ce, ["stop"])
|
|
1486
|
+
}, Is),
|
|
1487
|
+
r("div", {
|
|
1488
|
+
class: "abl-image-preview__btn abl-image-preview__next",
|
|
1489
|
+
onClick: L(R, ["stop"])
|
|
1490
|
+
}, Os)
|
|
1491
|
+
], 64)) : g("", !0),
|
|
1492
|
+
r("div", {
|
|
1493
|
+
class: "abl-image-preview__btn abl-image-preview__close",
|
|
1494
|
+
onClick: Ie
|
|
1495
|
+
}, Hs),
|
|
1496
|
+
r("div", Ns, [
|
|
1497
|
+
r("div", Ms, [
|
|
1498
|
+
r("i", {
|
|
1499
|
+
class: "abl-icon",
|
|
1500
|
+
onClick: L(Se, ["stop"])
|
|
1501
|
+
}, Ds),
|
|
1502
|
+
r("i", {
|
|
1503
|
+
class: "abl-icon",
|
|
1504
|
+
onClick: L(Le, ["stop"])
|
|
1505
|
+
}, js),
|
|
1506
|
+
r("i", {
|
|
1507
|
+
class: "abl-icon",
|
|
1508
|
+
onClick: L(Ve, ["stop"])
|
|
1509
|
+
}, qs),
|
|
1510
|
+
r("i", {
|
|
1511
|
+
class: "abl-icon",
|
|
1512
|
+
onClick: ze
|
|
1513
|
+
}, Ks),
|
|
1514
|
+
r("i", {
|
|
1515
|
+
class: "abl-icon",
|
|
1516
|
+
onClick: Be
|
|
1517
|
+
}, Ys)
|
|
1518
|
+
])
|
|
1519
|
+
])
|
|
1520
|
+
])
|
|
1521
|
+
], 32)
|
|
1522
|
+
]),
|
|
1523
|
+
_: 3
|
|
1524
|
+
})
|
|
1257
1525
|
]));
|
|
1258
1526
|
}
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1527
|
+
};
|
|
1528
|
+
const Xs = { class: "abl-image-wrap" }, Zs = ["src"], Qs = {
|
|
1529
|
+
__name: "index",
|
|
1530
|
+
props: {
|
|
1531
|
+
src: {
|
|
1532
|
+
type: String,
|
|
1533
|
+
default: ""
|
|
1534
|
+
},
|
|
1535
|
+
fit: {
|
|
1536
|
+
type: String,
|
|
1537
|
+
default: "cover"
|
|
1538
|
+
},
|
|
1539
|
+
width: {
|
|
1540
|
+
type: String,
|
|
1541
|
+
default: "100%"
|
|
1542
|
+
},
|
|
1543
|
+
lazy: {
|
|
1544
|
+
type: Boolean,
|
|
1545
|
+
default: !1
|
|
1546
|
+
},
|
|
1547
|
+
previewSrcList: {
|
|
1548
|
+
type: Array,
|
|
1549
|
+
default: []
|
|
1550
|
+
},
|
|
1551
|
+
initialIndex: {
|
|
1552
|
+
type: Number,
|
|
1553
|
+
default: 0
|
|
1554
|
+
},
|
|
1555
|
+
maxScale: {
|
|
1556
|
+
type: Number,
|
|
1557
|
+
default: 7
|
|
1558
|
+
},
|
|
1559
|
+
minScale: {
|
|
1560
|
+
type: Number,
|
|
1561
|
+
default: 0.2
|
|
1562
|
+
},
|
|
1563
|
+
zoomRate: {
|
|
1564
|
+
type: Number,
|
|
1565
|
+
default: 0.2
|
|
1566
|
+
},
|
|
1567
|
+
showProgress: {
|
|
1568
|
+
type: Boolean,
|
|
1569
|
+
default: !0
|
|
1570
|
+
}
|
|
1571
|
+
},
|
|
1572
|
+
setup(t) {
|
|
1573
|
+
const e = t, s = _(!1), o = _(!1), a = _(null);
|
|
1574
|
+
_("");
|
|
1575
|
+
const n = () => {
|
|
1576
|
+
s.value = !0;
|
|
1577
|
+
}, i = () => {
|
|
1578
|
+
var v;
|
|
1579
|
+
((v = e.previewSrcList) == null ? void 0 : v.length) > 0 && (o.value = !0);
|
|
1580
|
+
}, h = w(() => {
|
|
1581
|
+
const { previewSrcList: v, initialIndex: c } = e;
|
|
1582
|
+
let f = c;
|
|
1583
|
+
return c > v.length - 1 && (f = 0), f;
|
|
1584
|
+
}), l = () => {
|
|
1585
|
+
o.value = !1;
|
|
1586
|
+
}, p = {
|
|
1587
|
+
class: "abl-image-img",
|
|
1588
|
+
style: {
|
|
1589
|
+
objectFit: e.fit,
|
|
1590
|
+
width: e.width
|
|
1591
|
+
}
|
|
1592
|
+
};
|
|
1593
|
+
return (v, c) => {
|
|
1594
|
+
const f = He("lazy");
|
|
1595
|
+
return d(), u("div", Xs, [
|
|
1596
|
+
r("div", {
|
|
1597
|
+
class: "abl-image",
|
|
1598
|
+
style: y(`width: ${t.width}`),
|
|
1599
|
+
onClick: i
|
|
1600
|
+
}, [
|
|
1601
|
+
e.lazy ? J((d(), u("img", he({
|
|
1602
|
+
key: 0,
|
|
1603
|
+
onLoad: n,
|
|
1604
|
+
ref_key: "imgRef",
|
|
1605
|
+
ref: a
|
|
1606
|
+
}, p), null, 16)), [
|
|
1607
|
+
[f, t.src]
|
|
1608
|
+
]) : (d(), u("img", he({
|
|
1609
|
+
key: 1,
|
|
1610
|
+
onLoad: n,
|
|
1611
|
+
ref_key: "imgRef",
|
|
1612
|
+
ref: a,
|
|
1613
|
+
src: t.src
|
|
1614
|
+
}, p), null, 16, Zs))
|
|
1615
|
+
], 4),
|
|
1616
|
+
o.value ? (d(), u(E, { key: 0 }, [
|
|
1617
|
+
o.value ? (d(), M($e, {
|
|
1618
|
+
key: 0,
|
|
1619
|
+
"initial-index": h.value,
|
|
1620
|
+
"zoom-rate": t.zoomRate,
|
|
1621
|
+
"min-scale": t.minScale,
|
|
1622
|
+
"max-scale": t.maxScale,
|
|
1623
|
+
"preview-src-list": t.previewSrcList,
|
|
1624
|
+
"show-progress": t.showProgress,
|
|
1625
|
+
onClose: l
|
|
1626
|
+
}, null, 8, ["initial-index", "zoom-rate", "min-scale", "max-scale", "preview-src-list", "show-progress"])) : g("", !0)
|
|
1627
|
+
], 64)) : g("", !0)
|
|
1628
|
+
]);
|
|
1629
|
+
};
|
|
1630
|
+
}
|
|
1631
|
+
}, O = typeof window < "u" && window !== null, me = O && "IntersectionObserver" in window && "IntersectionObserverEntry" in window && "intersectionRatio" in window.IntersectionObserverEntry.prototype, N = {
|
|
1632
|
+
event: "event",
|
|
1633
|
+
observer: "observer"
|
|
1634
|
+
};
|
|
1635
|
+
function q(t, e) {
|
|
1636
|
+
if (!t.length)
|
|
1637
|
+
return;
|
|
1638
|
+
const s = t.indexOf(e);
|
|
1639
|
+
if (s > -1)
|
|
1640
|
+
return t.splice(s, 1);
|
|
1641
|
+
}
|
|
1642
|
+
function ge(t, e) {
|
|
1643
|
+
if (t.tagName !== "IMG" || !t.getAttribute("data-srcset"))
|
|
1644
|
+
return;
|
|
1645
|
+
let s = t.getAttribute("data-srcset");
|
|
1646
|
+
const a = t.parentNode.offsetWidth * e;
|
|
1647
|
+
let n, i, h;
|
|
1648
|
+
s = s.trim().split(",");
|
|
1649
|
+
const l = s.map((c) => (c = c.trim(), n = c.lastIndexOf(" "), n === -1 ? (i = c, h = 999998) : (i = c.substr(0, n), h = parseInt(
|
|
1650
|
+
c.substr(n + 1, c.length - n - 2),
|
|
1651
|
+
10
|
|
1652
|
+
)), [h, i]));
|
|
1653
|
+
l.sort((c, f) => {
|
|
1654
|
+
if (c[0] < f[0])
|
|
1655
|
+
return 1;
|
|
1656
|
+
if (c[0] > f[0])
|
|
1657
|
+
return -1;
|
|
1658
|
+
if (c[0] === f[0]) {
|
|
1659
|
+
if (f[1].indexOf(".webp", f[1].length - 5) !== -1)
|
|
1660
|
+
return 1;
|
|
1661
|
+
if (c[1].indexOf(".webp", c[1].length - 5) !== -1)
|
|
1662
|
+
return -1;
|
|
1663
|
+
}
|
|
1664
|
+
return 0;
|
|
1665
|
+
});
|
|
1666
|
+
let p = "", v;
|
|
1667
|
+
for (let c = 0; c < l.length; c++) {
|
|
1668
|
+
v = l[c], p = v[1];
|
|
1669
|
+
const f = l[c + 1];
|
|
1670
|
+
if (f && f[0] < a) {
|
|
1671
|
+
p = v[1];
|
|
1672
|
+
break;
|
|
1673
|
+
} else if (!f) {
|
|
1674
|
+
p = v[1];
|
|
1675
|
+
break;
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
return p;
|
|
1679
|
+
}
|
|
1680
|
+
const Js = (t = 1) => O && window.devicePixelRatio || t;
|
|
1681
|
+
function eo() {
|
|
1682
|
+
if (!O)
|
|
1683
|
+
return !1;
|
|
1684
|
+
let t = !0;
|
|
1685
|
+
try {
|
|
1686
|
+
const e = document.createElement("canvas");
|
|
1687
|
+
e.getContext && e.getContext("2d") && (t = e.toDataURL("image/webp").indexOf("data:image/webp") === 0);
|
|
1688
|
+
} catch {
|
|
1689
|
+
t = !1;
|
|
1690
|
+
}
|
|
1691
|
+
return t;
|
|
1692
|
+
}
|
|
1693
|
+
function to(t, e) {
|
|
1694
|
+
let s = null, o = 0;
|
|
1695
|
+
return function(...a) {
|
|
1696
|
+
if (s)
|
|
1697
|
+
return;
|
|
1698
|
+
const n = Date.now() - o, i = () => {
|
|
1699
|
+
o = Date.now(), s = !1, t.apply(this, a);
|
|
1700
|
+
};
|
|
1701
|
+
n >= e ? i() : s = setTimeout(i, e);
|
|
1702
|
+
};
|
|
1703
|
+
}
|
|
1704
|
+
const ae = (t, e) => typeof getComputedStyle < "u" ? getComputedStyle(t, null).getPropertyValue(e) : t.style[e], so = (t) => ae(t, "overflow") + ae(t, "overflow-y") + ae(t, "overflow-x");
|
|
1705
|
+
function oo(t, e, s) {
|
|
1706
|
+
t.addEventListener(e, s, {
|
|
1707
|
+
capture: !1,
|
|
1708
|
+
passive: !0
|
|
1709
|
+
});
|
|
1710
|
+
}
|
|
1711
|
+
function ao(t, e, s) {
|
|
1712
|
+
t.removeEventListener(e, s, !1);
|
|
1713
|
+
}
|
|
1714
|
+
function xe() {
|
|
1715
|
+
}
|
|
1716
|
+
const ie = (t, e, s) => {
|
|
1717
|
+
const o = new Image();
|
|
1718
|
+
if (!t || !t.src)
|
|
1719
|
+
return s(new Error("image src is required"));
|
|
1720
|
+
o.src = t.src, t.cors && (o.crossOrigin = t.cors), o.onload = () => e({
|
|
1721
|
+
naturalHeight: o.naturalHeight,
|
|
1722
|
+
naturalWidth: o.naturalWidth,
|
|
1723
|
+
src: o.src
|
|
1724
|
+
}), o.onerror = (a) => s(a);
|
|
1725
|
+
}, lo = (t) => {
|
|
1726
|
+
if (!O)
|
|
1727
|
+
return;
|
|
1728
|
+
if (!(t instanceof HTMLElement))
|
|
1729
|
+
return window;
|
|
1730
|
+
let e = t;
|
|
1731
|
+
for (; e && !(e === document.body || e === document.documentElement || !e.parentNode); ) {
|
|
1732
|
+
if (/(scroll|auto)/.test(so(e)))
|
|
1733
|
+
return e;
|
|
1734
|
+
e = e.parentNode;
|
|
1735
|
+
}
|
|
1736
|
+
return window;
|
|
1737
|
+
};
|
|
1738
|
+
function io(t) {
|
|
1739
|
+
return t !== null && typeof t == "object";
|
|
1740
|
+
}
|
|
1741
|
+
function no(t) {
|
|
1742
|
+
if (!(t instanceof Object))
|
|
1743
|
+
return [];
|
|
1744
|
+
if (Object.keys)
|
|
1745
|
+
return Object.keys(t);
|
|
1746
|
+
{
|
|
1747
|
+
let e = [];
|
|
1748
|
+
for (let s in t)
|
|
1749
|
+
t.hasOwnProperty(s) && e.push(s);
|
|
1750
|
+
return e;
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
class ro {
|
|
1754
|
+
constructor({ max: e }) {
|
|
1755
|
+
this.options = {
|
|
1756
|
+
max: e || 100
|
|
1757
|
+
}, this.caches = [];
|
|
1758
|
+
}
|
|
1759
|
+
has(e) {
|
|
1760
|
+
return this.caches.indexOf(e) > -1;
|
|
1761
|
+
}
|
|
1762
|
+
add(e) {
|
|
1763
|
+
this.has(e) || (this.caches.push(e), this.caches.length > this.options.max && this.free());
|
|
1764
|
+
}
|
|
1765
|
+
free() {
|
|
1766
|
+
this.caches.shift();
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
class co {
|
|
1770
|
+
constructor({
|
|
1771
|
+
el: e,
|
|
1772
|
+
src: s,
|
|
1773
|
+
error: o,
|
|
1774
|
+
loading: a,
|
|
1775
|
+
bindType: n,
|
|
1776
|
+
$parent: i,
|
|
1777
|
+
options: h,
|
|
1778
|
+
cors: l,
|
|
1779
|
+
elRenderer: p,
|
|
1780
|
+
imageCache: v
|
|
1781
|
+
}) {
|
|
1782
|
+
this.el = e, this.src = s, this.error = o, this.loading = a, this.bindType = n, this.attempt = 0, this.cors = l, this.naturalHeight = 0, this.naturalWidth = 0, this.options = h, this.rect = null, this.$parent = i, this.elRenderer = p, this._imageCache = v, this.performanceData = {
|
|
1783
|
+
init: Date.now(),
|
|
1784
|
+
loadStart: 0,
|
|
1785
|
+
loadEnd: 0
|
|
1786
|
+
}, this.filter(), this.initState(), this.render("loading", !1);
|
|
1787
|
+
}
|
|
1788
|
+
/*
|
|
1789
|
+
* init listener state
|
|
1790
|
+
* @return
|
|
1791
|
+
*/
|
|
1792
|
+
initState() {
|
|
1793
|
+
"dataset" in this.el ? this.el.dataset.src = this.src : this.el.setAttribute("data-src", this.src), this.state = {
|
|
1794
|
+
loading: !1,
|
|
1795
|
+
error: !1,
|
|
1796
|
+
loaded: !1,
|
|
1797
|
+
rendered: !1
|
|
1798
|
+
};
|
|
1799
|
+
}
|
|
1800
|
+
/*
|
|
1801
|
+
* record performance
|
|
1802
|
+
* @return
|
|
1803
|
+
*/
|
|
1804
|
+
record(e) {
|
|
1805
|
+
this.performanceData[e] = Date.now();
|
|
1806
|
+
}
|
|
1807
|
+
/*
|
|
1808
|
+
* update image listener data
|
|
1809
|
+
* @param {String} image uri
|
|
1810
|
+
* @param {String} loading image uri
|
|
1811
|
+
* @param {String} error image uri
|
|
1812
|
+
* @return
|
|
1813
|
+
*/
|
|
1814
|
+
update({ src: e, loading: s, error: o }) {
|
|
1815
|
+
const a = this.src;
|
|
1816
|
+
this.src = e, this.loading = s, this.error = o, this.filter(), a !== this.src && (this.attempt = 0, this.initState());
|
|
1817
|
+
}
|
|
1818
|
+
/*
|
|
1819
|
+
* get el node rect
|
|
1820
|
+
* @return
|
|
1821
|
+
*/
|
|
1822
|
+
getRect() {
|
|
1823
|
+
this.rect = this.el.getBoundingClientRect();
|
|
1824
|
+
}
|
|
1825
|
+
/*
|
|
1826
|
+
* check el is in view
|
|
1827
|
+
* @return {Boolean} el is in view
|
|
1828
|
+
*/
|
|
1829
|
+
checkInView() {
|
|
1830
|
+
return this.getRect(), this.rect.top < window.innerHeight * this.options.preLoad && this.rect.bottom > this.options.preLoadTop && this.rect.left < window.innerWidth * this.options.preLoad && this.rect.right > 0;
|
|
1831
|
+
}
|
|
1832
|
+
/*
|
|
1833
|
+
* listener filter
|
|
1834
|
+
*/
|
|
1835
|
+
filter() {
|
|
1836
|
+
no(this.options.filter).map((e) => {
|
|
1837
|
+
this.options.filter[e](this, this.options);
|
|
1838
|
+
});
|
|
1839
|
+
}
|
|
1840
|
+
/*
|
|
1841
|
+
* render loading first
|
|
1842
|
+
* @params cb:Function
|
|
1843
|
+
* @return
|
|
1844
|
+
*/
|
|
1845
|
+
renderLoading(e) {
|
|
1846
|
+
this.state.loading = !0, ie(
|
|
1847
|
+
{
|
|
1848
|
+
src: this.loading,
|
|
1849
|
+
cors: this.cors
|
|
1850
|
+
},
|
|
1851
|
+
(s) => {
|
|
1852
|
+
this.render("loading", !1), this.state.loading = !1, e();
|
|
1853
|
+
},
|
|
1854
|
+
() => {
|
|
1855
|
+
e(), this.state.loading = !1, this.options.silent || console.warn(
|
|
1856
|
+
`VueLazyload log: load failed with loading image(${this.loading})`
|
|
1857
|
+
);
|
|
1858
|
+
}
|
|
1859
|
+
);
|
|
1860
|
+
}
|
|
1861
|
+
/*
|
|
1862
|
+
* try load image and render it
|
|
1863
|
+
* @return
|
|
1864
|
+
*/
|
|
1865
|
+
load(e = xe) {
|
|
1866
|
+
if (this.attempt > this.options.attempt - 1 && this.state.error) {
|
|
1867
|
+
this.options.silent || console.log(
|
|
1868
|
+
`VueLazyload log: ${this.src} tried too more than ${this.options.attempt} times`
|
|
1869
|
+
), e();
|
|
1870
|
+
return;
|
|
1871
|
+
}
|
|
1872
|
+
if (!(this.state.rendered && this.state.loaded)) {
|
|
1873
|
+
if (this._imageCache.has(this.src))
|
|
1874
|
+
return this.state.loaded = !0, this.render("loaded", !0), this.state.rendered = !0, e();
|
|
1875
|
+
this.renderLoading(() => {
|
|
1876
|
+
this.attempt++, this.options.adapter.beforeLoad && this.options.adapter.beforeLoad(this, this.options), this.record("loadStart"), ie(
|
|
1877
|
+
{
|
|
1878
|
+
src: this.src,
|
|
1879
|
+
cors: this.cors
|
|
1880
|
+
},
|
|
1881
|
+
(s) => {
|
|
1882
|
+
this.naturalHeight = s.naturalHeight, this.naturalWidth = s.naturalWidth, this.state.loaded = !0, this.state.error = !1, this.record("loadEnd"), this.render("loaded", !1), this.state.rendered = !0, this._imageCache.add(this.src), e();
|
|
1883
|
+
},
|
|
1884
|
+
(s) => {
|
|
1885
|
+
!this.options.silent && console.error(s), this.state.error = !0, this.state.loaded = !1, this.render("error", !1);
|
|
1886
|
+
}
|
|
1887
|
+
);
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
/*
|
|
1892
|
+
* render image
|
|
1893
|
+
* @param {String} state to render // ['loading', 'src', 'error']
|
|
1894
|
+
* @param {String} is form cache
|
|
1895
|
+
* @return
|
|
1896
|
+
*/
|
|
1897
|
+
render(e, s) {
|
|
1898
|
+
this.elRenderer(this, e, s);
|
|
1899
|
+
}
|
|
1900
|
+
/*
|
|
1901
|
+
* output performance data
|
|
1902
|
+
* @return {Object} performance data
|
|
1903
|
+
*/
|
|
1904
|
+
performance() {
|
|
1905
|
+
let e = "loading", s = 0;
|
|
1906
|
+
return this.state.loaded && (e = "loaded", s = (this.performanceData.loadEnd - this.performanceData.loadStart) / 1e3), this.state.error && (e = "error"), {
|
|
1907
|
+
src: this.src,
|
|
1908
|
+
state: e,
|
|
1909
|
+
time: s
|
|
1910
|
+
};
|
|
1911
|
+
}
|
|
1912
|
+
/*
|
|
1913
|
+
* $destroy
|
|
1914
|
+
* @return
|
|
1915
|
+
*/
|
|
1916
|
+
$destroy() {
|
|
1917
|
+
this.el = null, this.src = null, this.error = null, this.loading = null, this.bindType = null, this.attempt = 0;
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1920
|
+
const be = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", uo = [
|
|
1921
|
+
"scroll",
|
|
1922
|
+
"wheel",
|
|
1923
|
+
"mousewheel",
|
|
1924
|
+
"resize",
|
|
1925
|
+
"animationend",
|
|
1926
|
+
"transitionend",
|
|
1927
|
+
"touchmove"
|
|
1928
|
+
], ho = {
|
|
1929
|
+
rootMargin: "0px",
|
|
1930
|
+
threshold: 0
|
|
1931
|
+
};
|
|
1932
|
+
function ke() {
|
|
1933
|
+
return class {
|
|
1934
|
+
constructor({
|
|
1935
|
+
preLoad: e,
|
|
1936
|
+
error: s,
|
|
1937
|
+
throttleWait: o,
|
|
1938
|
+
preLoadTop: a,
|
|
1939
|
+
dispatchEvent: n,
|
|
1940
|
+
loading: i,
|
|
1941
|
+
attempt: h,
|
|
1942
|
+
silent: l = !0,
|
|
1943
|
+
scale: p,
|
|
1944
|
+
listenEvents: v,
|
|
1945
|
+
filter: c,
|
|
1946
|
+
adapter: f,
|
|
1947
|
+
observer: P,
|
|
1948
|
+
observerOptions: k
|
|
1949
|
+
}) {
|
|
1950
|
+
this.mode = N.event, this.listeners = [], this.targetIndex = 0, this.targets = [], this.options = {
|
|
1951
|
+
silent: l,
|
|
1952
|
+
dispatchEvent: !!n,
|
|
1953
|
+
throttleWait: o || 200,
|
|
1954
|
+
preLoad: e || 1.3,
|
|
1955
|
+
preLoadTop: a || 0,
|
|
1956
|
+
error: s || be,
|
|
1957
|
+
loading: i || be,
|
|
1958
|
+
attempt: h || 3,
|
|
1959
|
+
scale: p || Js(p),
|
|
1960
|
+
ListenEvents: v || uo,
|
|
1961
|
+
supportWebp: eo(),
|
|
1962
|
+
filter: c || {},
|
|
1963
|
+
adapter: f || {},
|
|
1964
|
+
observer: !!P,
|
|
1965
|
+
observerOptions: k || ho
|
|
1966
|
+
}, this.initEvent(), this.imageCache = new ro({ max: 200 }), this.lazyLoadHandler = to(
|
|
1967
|
+
this.lazyLoadHandler.bind(this),
|
|
1968
|
+
this.options.throttleWait
|
|
1969
|
+
), this.setMode(this.options.observer ? N.observer : N.event);
|
|
1970
|
+
}
|
|
1971
|
+
/**
|
|
1972
|
+
* update config
|
|
1973
|
+
* @param {Object} config params
|
|
1974
|
+
* @return
|
|
1975
|
+
*/
|
|
1976
|
+
config(e = {}) {
|
|
1977
|
+
Object.assign(this.options, e);
|
|
1978
|
+
}
|
|
1979
|
+
/**
|
|
1980
|
+
* output listener's load performance
|
|
1981
|
+
* @return {Array}
|
|
1982
|
+
*/
|
|
1983
|
+
performance() {
|
|
1984
|
+
return this.listeners.map((e) => e.performance());
|
|
1985
|
+
}
|
|
1986
|
+
/*
|
|
1987
|
+
* add lazy component to queue
|
|
1988
|
+
* @param {Vue} vm lazy component instance
|
|
1989
|
+
* @return
|
|
1990
|
+
*/
|
|
1991
|
+
addLazyBox(e) {
|
|
1992
|
+
this.listeners.push(e), O && (this.addListenerTarget(window), this.observer && this.observer.observe(e.el), e.$el && e.$el.parentNode && this.addListenerTarget(e.$el.parentNode));
|
|
1993
|
+
}
|
|
1994
|
+
/*
|
|
1995
|
+
* add image listener to queue
|
|
1996
|
+
* @param {DOM} el
|
|
1997
|
+
* @param {object} binding vue directive binding
|
|
1998
|
+
* @param {vnode} vnode vue directive vnode
|
|
1999
|
+
* @return
|
|
2000
|
+
*/
|
|
2001
|
+
add(e, s, o) {
|
|
2002
|
+
if (this.listeners.some((i) => i.el === e))
|
|
2003
|
+
return this.update(e, s), K(this.lazyLoadHandler);
|
|
2004
|
+
const a = this.valueFormatter(s.value);
|
|
2005
|
+
let { src: n } = a;
|
|
2006
|
+
K(() => {
|
|
2007
|
+
n = ge(e, this.options.scale) || n, this.observer && this.observer.observe(e);
|
|
2008
|
+
const i = Object.keys(s.modifiers)[0];
|
|
2009
|
+
let h;
|
|
2010
|
+
i && (h = o.context.$refs[i], h = h ? h.$el || h : document.getElementById(i)), h || (h = lo(e));
|
|
2011
|
+
const l = new co({
|
|
2012
|
+
bindType: s.arg,
|
|
2013
|
+
$parent: h,
|
|
2014
|
+
el: e,
|
|
2015
|
+
src: n,
|
|
2016
|
+
loading: a.loading,
|
|
2017
|
+
error: a.error,
|
|
2018
|
+
cors: a.cors,
|
|
2019
|
+
elRenderer: this.elRenderer.bind(this),
|
|
2020
|
+
options: this.options,
|
|
2021
|
+
imageCache: this.imageCache
|
|
2022
|
+
});
|
|
2023
|
+
this.listeners.push(l), O && (this.addListenerTarget(window), this.addListenerTarget(h)), this.lazyLoadHandler(), K(() => this.lazyLoadHandler());
|
|
2024
|
+
});
|
|
2025
|
+
}
|
|
2026
|
+
/**
|
|
2027
|
+
* update image src
|
|
2028
|
+
* @param {DOM} el
|
|
2029
|
+
* @param {object} vue directive binding
|
|
2030
|
+
* @return
|
|
2031
|
+
*/
|
|
2032
|
+
update(e, s, o) {
|
|
2033
|
+
const a = this.valueFormatter(s.value);
|
|
2034
|
+
let { src: n } = a;
|
|
2035
|
+
n = ge(e, this.options.scale) || n;
|
|
2036
|
+
const i = this.listeners.find((h) => h.el === e);
|
|
2037
|
+
i ? i.update({
|
|
2038
|
+
src: n,
|
|
2039
|
+
error: a.error,
|
|
2040
|
+
loading: a.loading
|
|
2041
|
+
}) : this.add(e, s, o), this.observer && (this.observer.unobserve(e), this.observer.observe(e)), this.lazyLoadHandler(), K(() => this.lazyLoadHandler());
|
|
2042
|
+
}
|
|
2043
|
+
/**
|
|
2044
|
+
* remove listener form list
|
|
2045
|
+
* @param {DOM} el
|
|
2046
|
+
* @return
|
|
2047
|
+
*/
|
|
2048
|
+
remove(e) {
|
|
2049
|
+
if (!e)
|
|
2050
|
+
return;
|
|
2051
|
+
this.observer && this.observer.unobserve(e);
|
|
2052
|
+
const s = this.listeners.find((o) => o.el === e);
|
|
2053
|
+
s && (this.removeListenerTarget(s.$parent), this.removeListenerTarget(window), q(this.listeners, s), s.$destroy());
|
|
2054
|
+
}
|
|
2055
|
+
/*
|
|
2056
|
+
* remove lazy components form list
|
|
2057
|
+
* @param {Vue} vm Vue instance
|
|
2058
|
+
* @return
|
|
2059
|
+
*/
|
|
2060
|
+
removeComponent(e) {
|
|
2061
|
+
e && (q(this.listeners, e), this.observer && this.observer.unobserve(e.el), e.$parent && e.$el.parentNode && this.removeListenerTarget(e.$el.parentNode), this.removeListenerTarget(window));
|
|
2062
|
+
}
|
|
2063
|
+
setMode(e) {
|
|
2064
|
+
!me && e === N.observer && (e = N.event), this.mode = e, e === N.event ? (this.observer && (this.listeners.forEach((s) => {
|
|
2065
|
+
this.observer.unobserve(s.el);
|
|
2066
|
+
}), this.observer = null), this.targets.forEach((s) => {
|
|
2067
|
+
this.initListen(s.el, !0);
|
|
2068
|
+
})) : (this.targets.forEach((s) => {
|
|
2069
|
+
this.initListen(s.el, !1);
|
|
2070
|
+
}), this.initIntersectionObserver());
|
|
2071
|
+
}
|
|
2072
|
+
/*
|
|
2073
|
+
*** Private functions ***
|
|
2074
|
+
*/
|
|
2075
|
+
/*
|
|
2076
|
+
* add listener target
|
|
2077
|
+
* @param {DOM} el listener target
|
|
2078
|
+
* @return
|
|
2079
|
+
*/
|
|
2080
|
+
addListenerTarget(e) {
|
|
2081
|
+
if (!e)
|
|
2082
|
+
return;
|
|
2083
|
+
let s = this.targets.find((o) => o.el === e);
|
|
2084
|
+
return s ? s.childrenCount++ : (s = {
|
|
2085
|
+
el: e,
|
|
2086
|
+
id: ++this.targetIndex,
|
|
2087
|
+
childrenCount: 1,
|
|
2088
|
+
listened: !0
|
|
2089
|
+
}, this.mode === N.event && this.initListen(s.el, !0), this.targets.push(s)), this.targetIndex;
|
|
2090
|
+
}
|
|
2091
|
+
/*
|
|
2092
|
+
* remove listener target or reduce target childrenCount
|
|
2093
|
+
* @param {DOM} el or window
|
|
2094
|
+
* @return
|
|
2095
|
+
*/
|
|
2096
|
+
removeListenerTarget(e) {
|
|
2097
|
+
this.targets.forEach((s, o) => {
|
|
2098
|
+
s.el === e && (s.childrenCount--, s.childrenCount || (this.initListen(s.el, !1), this.targets.splice(o, 1), s = null));
|
|
2099
|
+
});
|
|
2100
|
+
}
|
|
2101
|
+
/*
|
|
2102
|
+
* add or remove eventlistener
|
|
2103
|
+
* @param {DOM} el DOM or Window
|
|
2104
|
+
* @param {boolean} start flag
|
|
2105
|
+
* @return
|
|
2106
|
+
*/
|
|
2107
|
+
initListen(e, s) {
|
|
2108
|
+
this.options.ListenEvents.forEach(
|
|
2109
|
+
(o) => (s ? oo : ao)(e, o, this.lazyLoadHandler)
|
|
2110
|
+
);
|
|
2111
|
+
}
|
|
2112
|
+
initEvent() {
|
|
2113
|
+
this.Event = {
|
|
2114
|
+
listeners: {
|
|
2115
|
+
loading: [],
|
|
2116
|
+
loaded: [],
|
|
2117
|
+
error: []
|
|
2118
|
+
}
|
|
2119
|
+
}, this.$on = (e, s) => {
|
|
2120
|
+
this.Event.listeners[e] || (this.Event.listeners[e] = []), this.Event.listeners[e].push(s);
|
|
2121
|
+
}, this.$once = (e, s) => {
|
|
2122
|
+
const o = (...a) => {
|
|
2123
|
+
this.$off(e, o), s.apply(this, a);
|
|
2124
|
+
};
|
|
2125
|
+
this.$on(e, o);
|
|
2126
|
+
}, this.$off = (e, s) => {
|
|
2127
|
+
if (!s) {
|
|
2128
|
+
if (!this.Event.listeners[e])
|
|
2129
|
+
return;
|
|
2130
|
+
this.Event.listeners[e].length = 0;
|
|
2131
|
+
return;
|
|
2132
|
+
}
|
|
2133
|
+
q(this.Event.listeners[e], s);
|
|
2134
|
+
}, this.$emit = (e, s, o) => {
|
|
2135
|
+
this.Event.listeners[e] && this.Event.listeners[e].forEach((a) => a(s, o));
|
|
2136
|
+
};
|
|
2137
|
+
}
|
|
2138
|
+
/**
|
|
2139
|
+
* find nodes which in viewport and trigger load
|
|
2140
|
+
* @return
|
|
2141
|
+
*/
|
|
2142
|
+
lazyLoadHandler() {
|
|
2143
|
+
const e = [];
|
|
2144
|
+
this.listeners.forEach((s) => {
|
|
2145
|
+
(!s.el || !s.el.parentNode) && e.push(s), s.checkInView() && s.load();
|
|
2146
|
+
}), e.forEach((s) => {
|
|
2147
|
+
q(this.listeners, s), s.$destroy();
|
|
2148
|
+
});
|
|
2149
|
+
}
|
|
2150
|
+
/**
|
|
2151
|
+
* init IntersectionObserver
|
|
2152
|
+
* set mode to observer
|
|
2153
|
+
* @return
|
|
2154
|
+
*/
|
|
2155
|
+
initIntersectionObserver() {
|
|
2156
|
+
me && (this.observer = new IntersectionObserver(
|
|
2157
|
+
this.observerHandler.bind(this),
|
|
2158
|
+
this.options.observerOptions
|
|
2159
|
+
), this.listeners.length && this.listeners.forEach((e) => {
|
|
2160
|
+
this.observer.observe(e.el);
|
|
2161
|
+
}));
|
|
2162
|
+
}
|
|
2163
|
+
/**
|
|
2164
|
+
* init IntersectionObserver
|
|
2165
|
+
* @return
|
|
2166
|
+
*/
|
|
2167
|
+
observerHandler(e) {
|
|
2168
|
+
e.forEach((s) => {
|
|
2169
|
+
s.isIntersecting && this.listeners.forEach((o) => {
|
|
2170
|
+
if (o.el === s.target) {
|
|
2171
|
+
if (o.state.loaded)
|
|
2172
|
+
return this.observer.unobserve(o.el);
|
|
2173
|
+
o.load();
|
|
2174
|
+
}
|
|
2175
|
+
});
|
|
2176
|
+
});
|
|
2177
|
+
}
|
|
2178
|
+
/**
|
|
2179
|
+
* set element attribute with image'url and state
|
|
2180
|
+
* @param {object} lazyload listener object
|
|
2181
|
+
* @param {string} state will be rendered
|
|
2182
|
+
* @param {bool} inCache is rendered from cache
|
|
2183
|
+
* @return
|
|
2184
|
+
*/
|
|
2185
|
+
elRenderer(e, s, o) {
|
|
2186
|
+
if (!e.el)
|
|
2187
|
+
return;
|
|
2188
|
+
const { el: a, bindType: n } = e;
|
|
2189
|
+
let i;
|
|
2190
|
+
switch (s) {
|
|
2191
|
+
case "loading":
|
|
2192
|
+
i = e.loading;
|
|
2193
|
+
break;
|
|
2194
|
+
case "error":
|
|
2195
|
+
i = e.error;
|
|
2196
|
+
break;
|
|
2197
|
+
default:
|
|
2198
|
+
({ src: i } = e);
|
|
2199
|
+
break;
|
|
2200
|
+
}
|
|
2201
|
+
if (n ? a.style[n] = 'url("' + i + '")' : a.getAttribute("src") !== i && a.setAttribute("src", i), a.setAttribute("lazy", s), this.$emit(s, e, o), this.options.adapter[s] && this.options.adapter[s](e, this.options), this.options.dispatchEvent) {
|
|
2202
|
+
const h = new CustomEvent(s, {
|
|
2203
|
+
detail: e
|
|
2204
|
+
});
|
|
2205
|
+
a.dispatchEvent(h);
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
/**
|
|
2209
|
+
* generate loading loaded error image url
|
|
2210
|
+
* @param {string} image's src
|
|
2211
|
+
* @return {object} image's loading, loaded, error url
|
|
2212
|
+
*/
|
|
2213
|
+
valueFormatter(e) {
|
|
2214
|
+
let s = e, { loading: o, error: a } = this.options;
|
|
2215
|
+
return io(e) && ({}.NODE_ENV !== "production" && !e.src && !this.options.silent && console.error("[@vant/lazyload] miss src with " + e), { src: s } = e, o = e.loading || this.options.loading, a = e.error || this.options.error), {
|
|
2216
|
+
src: s,
|
|
2217
|
+
loading: o,
|
|
2218
|
+
error: a
|
|
2219
|
+
};
|
|
2220
|
+
}
|
|
2221
|
+
};
|
|
2222
|
+
}
|
|
2223
|
+
const fo = (t) => ({
|
|
2224
|
+
props: {
|
|
2225
|
+
tag: {
|
|
2226
|
+
type: String,
|
|
2227
|
+
default: "div"
|
|
2228
|
+
}
|
|
2229
|
+
},
|
|
2230
|
+
emits: ["show"],
|
|
2231
|
+
render() {
|
|
2232
|
+
return Ne(
|
|
2233
|
+
this.tag,
|
|
2234
|
+
this.show && this.$slots.default ? this.$slots.default() : null
|
|
2235
|
+
);
|
|
2236
|
+
},
|
|
2237
|
+
data() {
|
|
2238
|
+
return {
|
|
2239
|
+
el: null,
|
|
2240
|
+
state: {
|
|
2241
|
+
loaded: !1
|
|
2242
|
+
},
|
|
2243
|
+
show: !1
|
|
2244
|
+
};
|
|
2245
|
+
},
|
|
2246
|
+
mounted() {
|
|
2247
|
+
this.el = this.$el, t.addLazyBox(this), t.lazyLoadHandler();
|
|
2248
|
+
},
|
|
2249
|
+
beforeUnmount() {
|
|
2250
|
+
t.removeComponent(this);
|
|
2251
|
+
},
|
|
2252
|
+
methods: {
|
|
2253
|
+
checkInView() {
|
|
2254
|
+
const e = this.$el.getBoundingClientRect();
|
|
2255
|
+
return O && e.top < window.innerHeight * t.options.preLoad && e.bottom > 0 && e.left < window.innerWidth * t.options.preLoad && e.right > 0;
|
|
2256
|
+
},
|
|
2257
|
+
load() {
|
|
2258
|
+
this.show = !0, this.state.loaded = !0, this.$emit("show", this);
|
|
2259
|
+
},
|
|
2260
|
+
destroy() {
|
|
2261
|
+
return this.$destroy;
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
}), po = {
|
|
2265
|
+
selector: "img"
|
|
2266
|
+
};
|
|
2267
|
+
class vo {
|
|
2268
|
+
constructor({ el: e, binding: s, vnode: o, lazy: a }) {
|
|
2269
|
+
this.el = null, this.vnode = o, this.binding = s, this.options = {}, this.lazy = a, this.queue = [], this.update({ el: e, binding: s });
|
|
2270
|
+
}
|
|
2271
|
+
update({ el: e, binding: s }) {
|
|
2272
|
+
this.el = e, this.options = Object.assign({}, po, s.value), this.getImgs().forEach((a) => {
|
|
2273
|
+
this.lazy.add(
|
|
2274
|
+
a,
|
|
2275
|
+
Object.assign({}, this.binding, {
|
|
2276
|
+
value: {
|
|
2277
|
+
src: "dataset" in a ? a.dataset.src : a.getAttribute("data-src"),
|
|
2278
|
+
error: ("dataset" in a ? a.dataset.error : a.getAttribute("data-error")) || this.options.error,
|
|
2279
|
+
loading: ("dataset" in a ? a.dataset.loading : a.getAttribute("data-loading")) || this.options.loading
|
|
2280
|
+
}
|
|
2281
|
+
}),
|
|
2282
|
+
this.vnode
|
|
2283
|
+
);
|
|
2284
|
+
});
|
|
2285
|
+
}
|
|
2286
|
+
getImgs() {
|
|
2287
|
+
return Array.from(this.el.querySelectorAll(this.options.selector));
|
|
2288
|
+
}
|
|
2289
|
+
clear() {
|
|
2290
|
+
this.getImgs().forEach((s) => this.lazy.remove(s)), this.vnode = null, this.binding = null, this.lazy = null;
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
class mo {
|
|
2294
|
+
constructor({ lazy: e }) {
|
|
2295
|
+
this.lazy = e, this.queue = [];
|
|
2296
|
+
}
|
|
2297
|
+
bind(e, s, o) {
|
|
2298
|
+
const a = new vo({
|
|
2299
|
+
el: e,
|
|
2300
|
+
binding: s,
|
|
2301
|
+
vnode: o,
|
|
2302
|
+
lazy: this.lazy
|
|
2303
|
+
});
|
|
2304
|
+
this.queue.push(a);
|
|
2305
|
+
}
|
|
2306
|
+
update(e, s, o) {
|
|
2307
|
+
const a = this.queue.find((n) => n.el === e);
|
|
2308
|
+
a && a.update({ el: e, binding: s, vnode: o });
|
|
2309
|
+
}
|
|
2310
|
+
unbind(e) {
|
|
2311
|
+
const s = this.queue.find((o) => o.el === e);
|
|
2312
|
+
s && (s.clear(), q(this.queue, s));
|
|
2313
|
+
}
|
|
2314
|
+
}
|
|
2315
|
+
const ne = (t) => ({
|
|
2316
|
+
props: {
|
|
2317
|
+
src: [String, Object],
|
|
2318
|
+
tag: {
|
|
2319
|
+
type: String,
|
|
2320
|
+
default: "img"
|
|
2321
|
+
}
|
|
2322
|
+
},
|
|
2323
|
+
render(e) {
|
|
2324
|
+
return e(
|
|
2325
|
+
this.tag,
|
|
2326
|
+
{
|
|
2327
|
+
attrs: {
|
|
2328
|
+
src: this.renderSrc
|
|
2329
|
+
}
|
|
2330
|
+
},
|
|
2331
|
+
this.$slots.default
|
|
2332
|
+
);
|
|
2333
|
+
},
|
|
2334
|
+
data() {
|
|
2335
|
+
return {
|
|
2336
|
+
el: null,
|
|
2337
|
+
options: {
|
|
2338
|
+
src: "",
|
|
2339
|
+
error: "",
|
|
2340
|
+
loading: "",
|
|
2341
|
+
attempt: t.options.attempt
|
|
2342
|
+
},
|
|
2343
|
+
state: {
|
|
2344
|
+
loaded: !1,
|
|
2345
|
+
error: !1,
|
|
2346
|
+
attempt: 0
|
|
2347
|
+
},
|
|
2348
|
+
rect: {},
|
|
2349
|
+
renderSrc: ""
|
|
2350
|
+
};
|
|
2351
|
+
},
|
|
2352
|
+
watch: {
|
|
2353
|
+
src() {
|
|
2354
|
+
this.init(), t.addLazyBox(this), t.lazyLoadHandler();
|
|
2355
|
+
}
|
|
2356
|
+
},
|
|
2357
|
+
created() {
|
|
2358
|
+
this.init(), this.renderSrc = this.options.loading;
|
|
2359
|
+
},
|
|
2360
|
+
mounted() {
|
|
2361
|
+
this.el = this.$el, t.addLazyBox(this), t.lazyLoadHandler();
|
|
2362
|
+
},
|
|
2363
|
+
beforeDestroy() {
|
|
2364
|
+
t.removeComponent(this);
|
|
2365
|
+
},
|
|
2366
|
+
methods: {
|
|
2367
|
+
init() {
|
|
2368
|
+
const { src: e, loading: s, error: o } = t._valueFormatter(this.src);
|
|
2369
|
+
this.state.loaded = !1, this.options.src = e, this.options.error = o, this.options.loading = s, this.renderSrc = this.options.loading;
|
|
2370
|
+
},
|
|
2371
|
+
getRect() {
|
|
2372
|
+
this.rect = this.$el.getBoundingClientRect();
|
|
2373
|
+
},
|
|
2374
|
+
checkInView() {
|
|
2375
|
+
return this.getRect(), O && this.rect.top < window.innerHeight * t.options.preLoad && this.rect.bottom > 0 && this.rect.left < window.innerWidth * t.options.preLoad && this.rect.right > 0;
|
|
2376
|
+
},
|
|
2377
|
+
load(e = xe) {
|
|
2378
|
+
if (this.state.attempt > this.options.attempt - 1 && this.state.error) {
|
|
2379
|
+
t.options.silent || console.log(
|
|
2380
|
+
`VueLazyload log: ${this.options.src} tried too more than ${this.options.attempt} times`
|
|
2381
|
+
), e();
|
|
2382
|
+
return;
|
|
2383
|
+
}
|
|
2384
|
+
const s = this.options.src;
|
|
2385
|
+
ie(
|
|
2386
|
+
{ src: s },
|
|
2387
|
+
({ src: o }) => {
|
|
2388
|
+
this.renderSrc = o, this.state.loaded = !0;
|
|
2389
|
+
},
|
|
2390
|
+
(o) => {
|
|
2391
|
+
this.state.attempt++, this.renderSrc = this.options.error, this.state.error = !0;
|
|
2392
|
+
}
|
|
2393
|
+
);
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
});
|
|
2397
|
+
ne.install = (t, e = {}) => {
|
|
2398
|
+
const s = ke(), o = new s(e);
|
|
2399
|
+
t.component("lazy-image", ne(o));
|
|
2400
|
+
};
|
|
2401
|
+
const wo = {
|
|
2402
|
+
/*
|
|
2403
|
+
* install function
|
|
2404
|
+
* @param {App} app
|
|
2405
|
+
* @param {object} options lazyload options
|
|
2406
|
+
*/
|
|
2407
|
+
install(t, e = {}) {
|
|
2408
|
+
const s = ke(), o = new s(e), a = new mo({ lazy: o });
|
|
2409
|
+
t.config.globalProperties.$Lazyload = o, e.lazyComponent && t.component("LazyComponent", fo(o)), e.lazyImage && t.component("LazyImage", ne(o)), t.directive("lazy", {
|
|
2410
|
+
beforeMount: o.add.bind(o),
|
|
2411
|
+
updated: o.update.bind(o),
|
|
2412
|
+
unmounted: o.remove.bind(o)
|
|
2413
|
+
}), t.directive("lazy-container", {
|
|
2414
|
+
beforeMount: a.bind.bind(a),
|
|
2415
|
+
updated: a.update.bind(a),
|
|
2416
|
+
unmounted: a.unbind.bind(a)
|
|
2417
|
+
});
|
|
2418
|
+
}
|
|
2419
|
+
}, go = [Ue, fe, it, dt, fe, ut, at, we, xt, Lt, Et, Tt, Pt, qt, as, is, fs, ms, Ls, Qs, $e], bo = function(t, e) {
|
|
2420
|
+
go.forEach((s) => {
|
|
2421
|
+
t.component(s.name, s);
|
|
2422
|
+
}), Vue.prototype.$message = we;
|
|
2423
|
+
}, $o = { install: bo };
|
|
1264
2424
|
export {
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
2425
|
+
wo as Lazyload,
|
|
2426
|
+
we as Message,
|
|
2427
|
+
qt as Tooltip,
|
|
2428
|
+
Lt as ablButton,
|
|
2429
|
+
Ls as ablCell,
|
|
2430
|
+
Et as ablCheckbox,
|
|
2431
|
+
Tt as ablCheckboxGroup,
|
|
2432
|
+
is as ablCollapse,
|
|
2433
|
+
fs as ablCollapseItem,
|
|
2434
|
+
Pt as ablDialog,
|
|
2435
|
+
xt as ablDrawer,
|
|
2436
|
+
Qs as ablImage,
|
|
2437
|
+
$e as ablImageView,
|
|
2438
|
+
ut as ablPane,
|
|
2439
|
+
ms as ablProgress,
|
|
2440
|
+
it as ablRadio,
|
|
2441
|
+
dt as ablRadioGroup,
|
|
2442
|
+
as as ablRate,
|
|
2443
|
+
at as ablSwitch,
|
|
2444
|
+
Ue as ablTable,
|
|
2445
|
+
fe as ablTabs,
|
|
2446
|
+
$o as default
|
|
1284
2447
|
};
|