@lazycatcloud/lzc-toolkit 0.0.53 → 0.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +337 -331
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/dialog/Dialog.vue.d.ts +10 -10
- package/dist/types/dialog/index.d.ts +1 -1
- package/dist/types/scroll-bar/ScrollBar.vue.d.ts +10 -10
- package/dist/types/scroll-bar/use/type.d.ts +1 -1
- package/dist/types/svgIcon/SvgIcon.vue.d.ts +3 -3
- package/dist/types/toast/Toast.vue.d.ts +2 -2
- package/dist/types/useDragSelect/index.d.ts +1 -1
- package/dist/types/useVirtualList/VirtualList.vue.d.ts +10 -10
- package/dist/types/useVirtualList/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { unref as B, getCurrentScope as Ke, onScopeDispose as Qe, getCurrentInstance as Ue, onMounted as
|
|
1
|
+
import { unref as B, getCurrentScope as Ke, onScopeDispose as Qe, getCurrentInstance as Ue, onMounted as fe, nextTick as pe, ref as E, watch as ne, shallowRef as qe, computed as S, onUnmounted as Oe, inject as P, provide as H, defineComponent as Z, h as K, render as ae, openBlock as W, createBlock as De, Transition as Re, withCtx as Ce, createElementBlock as J, createElementVNode as F, withModifiers as Ye, normalizeClass as Ge, renderSlot as he, createCommentVNode as Xe, normalizeStyle as le, toDisplayString as Je, useSlots as Ze, withDirectives as et, vShow as tt, pushScopeId as nt, popScopeId as lt, toRef as ot, mergeProps as rt, normalizeProps as ge, guardReactiveProps as ye, Fragment as at, renderList as st } from "vue";
|
|
2
2
|
var be;
|
|
3
3
|
const Be = typeof window < "u";
|
|
4
4
|
Be && ((be = window?.navigator) == null ? void 0 : be.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
@@ -29,13 +29,13 @@ function it(t, e = !0, n = !0) {
|
|
|
29
29
|
const r = () => {
|
|
30
30
|
o && (clearTimeout(o), o = void 0);
|
|
31
31
|
};
|
|
32
|
-
return (
|
|
33
|
-
const
|
|
34
|
-
if (r(),
|
|
35
|
-
return l = Date.now(),
|
|
36
|
-
d >
|
|
37
|
-
l = Date.now(), a = !0, r(),
|
|
38
|
-
},
|
|
32
|
+
return (g) => {
|
|
33
|
+
const f = se(t), d = Date.now() - l;
|
|
34
|
+
if (r(), f <= 0)
|
|
35
|
+
return l = Date.now(), g();
|
|
36
|
+
d > f && (n || !a) ? (l = Date.now(), g()) : e && (o = setTimeout(() => {
|
|
37
|
+
l = Date.now(), a = !0, r(), g();
|
|
38
|
+
}, f)), !n && !o && (o = setTimeout(() => a = !0, f)), a = !1;
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
function ct(t) {
|
|
@@ -51,7 +51,7 @@ function Se(t, e = 200, n = !1, l = !0) {
|
|
|
51
51
|
return Ie(it(e, n, l), t);
|
|
52
52
|
}
|
|
53
53
|
function dt(t, e = !0) {
|
|
54
|
-
Ue() ?
|
|
54
|
+
Ue() ? fe(t) : e ? t() : pe(t);
|
|
55
55
|
}
|
|
56
56
|
function He(t) {
|
|
57
57
|
var e;
|
|
@@ -59,31 +59,31 @@ function He(t) {
|
|
|
59
59
|
return (e = n?.$el) != null ? e : n;
|
|
60
60
|
}
|
|
61
61
|
const ft = Be ? window : void 0;
|
|
62
|
-
function
|
|
63
|
-
const n =
|
|
62
|
+
function pt(t, e = !1) {
|
|
63
|
+
const n = E(), l = () => n.value = Boolean(t());
|
|
64
64
|
return l(), dt(l, e), n;
|
|
65
65
|
}
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
var
|
|
66
|
+
const ve = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, de = "__vueuse_ssr_handlers__";
|
|
67
|
+
ve[de] = ve[de] || {};
|
|
68
|
+
ve[de];
|
|
69
|
+
var _e = Object.getOwnPropertySymbols, ht = Object.prototype.hasOwnProperty, mt = Object.prototype.propertyIsEnumerable, gt = (t, e) => {
|
|
70
70
|
var n = {};
|
|
71
71
|
for (var l in t)
|
|
72
|
-
|
|
73
|
-
if (t != null &&
|
|
74
|
-
for (var l of
|
|
72
|
+
ht.call(t, l) && e.indexOf(l) < 0 && (n[l] = t[l]);
|
|
73
|
+
if (t != null && _e)
|
|
74
|
+
for (var l of _e(t))
|
|
75
75
|
e.indexOf(l) < 0 && mt.call(t, l) && (n[l] = t[l]);
|
|
76
76
|
return n;
|
|
77
77
|
};
|
|
78
78
|
function yt(t, e, n = {}) {
|
|
79
79
|
const l = n, { window: o = ft } = l, a = gt(l, ["window"]);
|
|
80
80
|
let r;
|
|
81
|
-
const i =
|
|
81
|
+
const i = pt(() => o && "ResizeObserver" in o), g = () => {
|
|
82
82
|
r && (r.disconnect(), r = void 0);
|
|
83
|
-
},
|
|
84
|
-
|
|
83
|
+
}, f = ne(() => He(t), (c) => {
|
|
84
|
+
g(), i.value && o && c && (r = new ResizeObserver(e), r.observe(c, a));
|
|
85
85
|
}, { immediate: !0, flush: "post" }), d = () => {
|
|
86
|
-
|
|
86
|
+
g(), f();
|
|
87
87
|
};
|
|
88
88
|
return vt(d), {
|
|
89
89
|
isSupported: i,
|
|
@@ -91,10 +91,10 @@ function yt(t, e, n = {}) {
|
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
function bt(t, e = { width: 0, height: 0 }, n = {}) {
|
|
94
|
-
const { box: l = "content-box" } = n, o =
|
|
94
|
+
const { box: l = "content-box" } = n, o = E(e.width), a = E(e.height);
|
|
95
95
|
return yt(t, ([r]) => {
|
|
96
96
|
const i = l === "border-box" ? r.borderBoxSize : l === "content-box" ? r.contentBoxSize : r.devicePixelContentBoxSize;
|
|
97
|
-
i ? (o.value = i.reduce((
|
|
97
|
+
i ? (o.value = i.reduce((g, { inlineSize: f }) => g + f, 0), a.value = i.reduce((g, { blockSize: f }) => g + f, 0)) : (o.value = r.contentRect.width, a.value = r.contentRect.height);
|
|
98
98
|
}, n), ne(() => He(t), (r) => {
|
|
99
99
|
o.value = r ? e.width : 0, a.value = r ? e.height : 0;
|
|
100
100
|
}), {
|
|
@@ -102,16 +102,16 @@ function bt(t, e = { width: 0, height: 0 }, n = {}) {
|
|
|
102
102
|
height: a
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
-
var
|
|
105
|
+
var Ee;
|
|
106
106
|
(function(t) {
|
|
107
107
|
t.UP = "UP", t.RIGHT = "RIGHT", t.DOWN = "DOWN", t.LEFT = "LEFT", t.NONE = "NONE";
|
|
108
|
-
})(
|
|
109
|
-
var St = Object.defineProperty,
|
|
108
|
+
})(Ee || (Ee = {}));
|
|
109
|
+
var St = Object.defineProperty, we = Object.getOwnPropertySymbols, _t = Object.prototype.hasOwnProperty, Et = Object.prototype.propertyIsEnumerable, xe = (t, e, n) => e in t ? St(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, wt = (t, e) => {
|
|
110
110
|
for (var n in e || (e = {}))
|
|
111
|
-
|
|
112
|
-
if (
|
|
113
|
-
for (var n of
|
|
114
|
-
|
|
111
|
+
_t.call(e, n) && xe(t, n, e[n]);
|
|
112
|
+
if (we)
|
|
113
|
+
for (var n of we(e))
|
|
114
|
+
Et.call(e, n) && xe(t, n, e[n]);
|
|
115
115
|
return t;
|
|
116
116
|
};
|
|
117
117
|
const xt = {
|
|
@@ -140,103 +140,103 @@ const xt = {
|
|
|
140
140
|
easeOutBack: [0.34, 1.56, 0.64, 1],
|
|
141
141
|
easeInOutBack: [0.68, -0.6, 0.32, 1.6]
|
|
142
142
|
};
|
|
143
|
-
|
|
143
|
+
wt({
|
|
144
144
|
linear: ct
|
|
145
145
|
}, xt);
|
|
146
146
|
function Tt(t, e) {
|
|
147
|
-
const { scrollEndHook: n, itemHeight: l, overscan: o = 5 } = e, a =
|
|
148
|
-
let
|
|
149
|
-
const d = qe(t), c =
|
|
150
|
-
let
|
|
151
|
-
const
|
|
152
|
-
let { sum:
|
|
153
|
-
return d.value.map((I, C) => (typeof l == "number" ?
|
|
154
|
-
}),
|
|
155
|
-
let
|
|
156
|
-
return
|
|
147
|
+
const { scrollEndHook: n, itemHeight: l, overscan: o = 5 } = e, a = E(null), r = bt(a), i = E(!0), g = Le(ee, 100);
|
|
148
|
+
let f;
|
|
149
|
+
const d = qe(t), c = E(0), u = E({ start: 0, end: 10 });
|
|
150
|
+
let s = 0;
|
|
151
|
+
const _ = E([]), w = S(() => {
|
|
152
|
+
let { sum: p, height: b } = { sum: 0, height: 0 };
|
|
153
|
+
return d.value.map((I, C) => (typeof l == "number" ? b = l : b = l(C), p += b, { height: b, sum: p }));
|
|
154
|
+
}), m = S(() => N(u.value.start)), y = S(() => typeof l == "number" ? w.value.length * l : w.value[w.value.length - 1]?.sum || 0), R = S(() => {
|
|
155
|
+
let p = _.value.length - o, b = Math.max(p - s, 0);
|
|
156
|
+
return _.value.slice(b, p);
|
|
157
157
|
});
|
|
158
|
-
|
|
159
|
-
}), Oe(() => cancelAnimationFrame(
|
|
158
|
+
fe(() => {
|
|
159
|
+
}), Oe(() => cancelAnimationFrame(f)), ne(
|
|
160
160
|
[r.width, r.height, d],
|
|
161
|
-
([
|
|
162
|
-
(
|
|
161
|
+
([p, b]) => {
|
|
162
|
+
(p || b) && U();
|
|
163
163
|
},
|
|
164
164
|
{ deep: !0 }
|
|
165
165
|
), ne(c, () => {
|
|
166
|
-
|
|
166
|
+
Q(), g();
|
|
167
167
|
});
|
|
168
|
-
function
|
|
168
|
+
function Q() {
|
|
169
169
|
i.value = !1;
|
|
170
170
|
}
|
|
171
171
|
function ee() {
|
|
172
172
|
i.value = !0, n?.();
|
|
173
173
|
}
|
|
174
174
|
function U() {
|
|
175
|
-
cancelAnimationFrame(
|
|
175
|
+
cancelAnimationFrame(f), f = requestAnimationFrame(k);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function k() {
|
|
178
178
|
if (a.value) {
|
|
179
|
-
c.value = a.value.scrollTop,
|
|
180
|
-
let
|
|
181
|
-
|
|
179
|
+
c.value = a.value.scrollTop, s = M();
|
|
180
|
+
let p = $(c.value), b = p + s + o;
|
|
181
|
+
p = p - o, p = p < 0 ? 0 : p, b = b > d.value.length ? d.value.length : b, u.value = { start: p, end: b }, _.value = d.value.slice(p, b).map((I, C) => ({
|
|
182
182
|
data: I,
|
|
183
|
-
index: C +
|
|
183
|
+
index: C + p
|
|
184
184
|
}));
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
function
|
|
188
|
-
let
|
|
189
|
-
for (;
|
|
190
|
-
const O = Math.floor((
|
|
191
|
-
|
|
187
|
+
function $(p) {
|
|
188
|
+
let b = 0, I = w.value.length - 1, C = -1;
|
|
189
|
+
for (; b <= I; ) {
|
|
190
|
+
const O = Math.floor((b + I) / 2);
|
|
191
|
+
w.value[O].sum >= p ? (C = O, I = O - 1) : b = O + 1;
|
|
192
192
|
}
|
|
193
193
|
return Math.max(0, C);
|
|
194
194
|
}
|
|
195
|
-
function
|
|
196
|
-
let
|
|
197
|
-
for (let C = I; C <
|
|
195
|
+
function M() {
|
|
196
|
+
let p = 0, b = 0, I = L();
|
|
197
|
+
for (let C = I; C < w.value.length && (p++, b += w.value[C].height, !(b >= r.height.value)); C++)
|
|
198
198
|
;
|
|
199
|
-
return
|
|
199
|
+
return p;
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function N(p) {
|
|
202
202
|
if (typeof l == "number")
|
|
203
|
-
return
|
|
204
|
-
let
|
|
205
|
-
return
|
|
203
|
+
return p * l;
|
|
204
|
+
let b = w.value[p];
|
|
205
|
+
return b ? b.sum - b.height : 0;
|
|
206
206
|
}
|
|
207
|
-
function
|
|
208
|
-
return
|
|
207
|
+
function V(p) {
|
|
208
|
+
return w.value[p] || { sum: 0, height: 0 };
|
|
209
209
|
}
|
|
210
|
-
function
|
|
211
|
-
let
|
|
212
|
-
return
|
|
210
|
+
function L() {
|
|
211
|
+
let p = u.value.start;
|
|
212
|
+
return p >= o && (p += o), p;
|
|
213
213
|
}
|
|
214
|
-
function q(
|
|
214
|
+
function q(p) {
|
|
215
215
|
if (a.value) {
|
|
216
|
-
const
|
|
217
|
-
a.value.scrollTop =
|
|
216
|
+
const b = V(p);
|
|
217
|
+
a.value.scrollTop = b.sum - b.height, k();
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
const te = S(() => ({
|
|
221
221
|
style: {
|
|
222
222
|
width: "100%",
|
|
223
|
-
height: `${
|
|
223
|
+
height: `${y.value}px`,
|
|
224
224
|
pointerEvents: i.value ? void 0 : "none"
|
|
225
225
|
}
|
|
226
|
-
})),
|
|
226
|
+
})), j = S(() => ({
|
|
227
227
|
style: {
|
|
228
|
-
transform: `translate3d(0, ${
|
|
228
|
+
transform: `translate3d(0, ${m.value}px, 0)`,
|
|
229
229
|
"will-change": "transform"
|
|
230
230
|
}
|
|
231
231
|
})), Y = {
|
|
232
232
|
overflowY: "auto"
|
|
233
233
|
};
|
|
234
234
|
return {
|
|
235
|
-
list:
|
|
236
|
-
visiableList:
|
|
237
|
-
getItemHeightData:
|
|
238
|
-
getoffsetTopIndex:
|
|
239
|
-
totalHeight:
|
|
235
|
+
list: _,
|
|
236
|
+
visiableList: R,
|
|
237
|
+
getItemHeightData: V,
|
|
238
|
+
getoffsetTopIndex: $,
|
|
239
|
+
totalHeight: y,
|
|
240
240
|
clientHeight: r.height,
|
|
241
241
|
scrollTo: q,
|
|
242
242
|
scrollTop: c,
|
|
@@ -249,74 +249,74 @@ function Tt(t, e) {
|
|
|
249
249
|
style: Y
|
|
250
250
|
},
|
|
251
251
|
wrapperProps: te,
|
|
252
|
-
innerProps:
|
|
252
|
+
innerProps: j
|
|
253
253
|
};
|
|
254
254
|
}
|
|
255
|
-
const $e = Symbol(), Ae = Symbol(), Pe = Symbol(), Fe = Symbol(), Me = Symbol(),
|
|
255
|
+
const $e = Symbol(), Ae = Symbol(), Pe = Symbol(), Fe = Symbol(), Me = Symbol(), ze = Symbol(), We = Symbol(), ke = Symbol(), Ne = Symbol();
|
|
256
256
|
function Wt() {
|
|
257
257
|
const { voidFn: t, boolFn: e, boolRef: n, arrayRef: l } = {
|
|
258
|
-
voidFn: (
|
|
258
|
+
voidFn: (s) => {
|
|
259
259
|
},
|
|
260
|
-
boolFn: (
|
|
260
|
+
boolFn: (s) => !1,
|
|
261
261
|
boolRef: S(() => !1),
|
|
262
262
|
arrayRef: S(() => [])
|
|
263
|
-
}, o =
|
|
263
|
+
}, o = P(Fe, l), a = P(Pe, e), r = P(ke, n), i = P(Ae, t), g = P($e, t), f = P(Me, t), d = P(ze, t), c = P(We, t), u = P(Ne, t);
|
|
264
264
|
return {
|
|
265
265
|
selected: o,
|
|
266
266
|
isSelected: a,
|
|
267
267
|
isAllSelected: r,
|
|
268
268
|
toggle: i,
|
|
269
|
-
toggleAll:
|
|
270
|
-
select:
|
|
269
|
+
toggleAll: g,
|
|
270
|
+
select: f,
|
|
271
271
|
selectAll: d,
|
|
272
272
|
unselect: c,
|
|
273
|
-
unselectAll:
|
|
273
|
+
unselectAll: u
|
|
274
274
|
};
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
const n =
|
|
276
|
+
function kt(t, e) {
|
|
277
|
+
const n = E({}), l = S(() => t.value.filter((u) => n.value[u[e]])), o = S(() => l.value.length != 0 && Object.keys(n.value).length == t.value.length);
|
|
278
278
|
function a() {
|
|
279
|
-
t.value.forEach((
|
|
280
|
-
n.value[
|
|
279
|
+
t.value.forEach((u) => {
|
|
280
|
+
n.value[u[e]] = !0;
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
283
|
function r() {
|
|
284
284
|
n.value = {};
|
|
285
285
|
}
|
|
286
|
-
function i(
|
|
287
|
-
|
|
288
|
-
n.value[
|
|
286
|
+
function i(u) {
|
|
287
|
+
u.forEach((s) => {
|
|
288
|
+
n.value[s[e]] || (n.value[s[e]] = !0);
|
|
289
289
|
});
|
|
290
290
|
}
|
|
291
|
-
function
|
|
292
|
-
|
|
293
|
-
n.value[
|
|
291
|
+
function g(u) {
|
|
292
|
+
u.forEach((s) => {
|
|
293
|
+
n.value[s[e]] && delete n.value[s[e]];
|
|
294
294
|
});
|
|
295
295
|
}
|
|
296
|
-
function
|
|
297
|
-
return !!n.value[
|
|
296
|
+
function f(u) {
|
|
297
|
+
return !!n.value[u[e]];
|
|
298
298
|
}
|
|
299
|
-
function d(
|
|
300
|
-
|
|
301
|
-
|
|
299
|
+
function d(u) {
|
|
300
|
+
u.forEach((s) => {
|
|
301
|
+
f(s) ? delete n.value[s[e]] : n.value[s[e]] = !0;
|
|
302
302
|
});
|
|
303
303
|
}
|
|
304
304
|
function c() {
|
|
305
305
|
o.value ? r() : a();
|
|
306
306
|
}
|
|
307
|
-
return
|
|
307
|
+
return H($e, c), H(Ae, d), H(Pe, f), H(Fe, l), H(Me, i), H(ze, a), H(We, g), H(ke, o), H(Ne, r), {
|
|
308
308
|
selected: l,
|
|
309
309
|
select: i,
|
|
310
310
|
selectAll: a,
|
|
311
|
-
unselect:
|
|
311
|
+
unselect: g,
|
|
312
312
|
unselectAll: r,
|
|
313
313
|
toggle: d,
|
|
314
314
|
toggleAll: c,
|
|
315
|
-
isSelected:
|
|
315
|
+
isSelected: f,
|
|
316
316
|
isAllSelected: o
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function ce(t) {
|
|
320
320
|
return () => {
|
|
321
321
|
console.debug(`\u9ED8\u8BA4${t}\u65B9\u6CD5,\u9700\u8981\u81EA\u5B9A\u4E49\u751F\u6548`);
|
|
322
322
|
};
|
|
@@ -328,96 +328,96 @@ function Ve({
|
|
|
328
328
|
getSelectMap: l = () => ({})
|
|
329
329
|
}) {
|
|
330
330
|
const {
|
|
331
|
-
select: o =
|
|
332
|
-
unselect: a =
|
|
333
|
-
unselectAll: r =
|
|
331
|
+
select: o = ce("\u9009\u62E9"),
|
|
332
|
+
unselect: a = ce("\u53D6\u6D88\u9009\u62E9"),
|
|
333
|
+
unselectAll: r = ce("\u53D6\u6D88\u5168\u9009")
|
|
334
334
|
} = l();
|
|
335
335
|
let i = {};
|
|
336
|
-
const
|
|
336
|
+
const g = S(
|
|
337
337
|
() => Se(e === "colum" ? z : oe, 50)
|
|
338
|
-
),
|
|
339
|
-
(v) =>
|
|
340
|
-
),
|
|
338
|
+
), f = /* @__PURE__ */ new Set(), d = E(!0), c = E(), u = E(!1), s = E({ x: 0, y: 0 }), _ = E({ x: 0, y: 0, scrollTop: 0 }), w = new ResizeObserver(
|
|
339
|
+
(v) => m.value = v[0].target.getBoundingClientRect()
|
|
340
|
+
), m = E({}), y = E({
|
|
341
341
|
top: 0,
|
|
342
342
|
height: 0,
|
|
343
343
|
sync(v = !1) {
|
|
344
|
-
|
|
344
|
+
y.value.top = c.value?.scrollTop || 0, v && (y.value.height = c.value?.scrollHeight || 0);
|
|
345
345
|
}
|
|
346
|
-
}),
|
|
347
|
-
left: Math.min(
|
|
348
|
-
top: Math.min(
|
|
349
|
-
width: Math.abs(
|
|
350
|
-
height: Math.abs(
|
|
351
|
-
} : { left: 0, top: 0, width: 0, height: 0 }), { margin:
|
|
352
|
-
let
|
|
353
|
-
const
|
|
354
|
-
let
|
|
346
|
+
}), R = S(() => u.value ? {
|
|
347
|
+
left: Math.min(s.value.x, _.value.x) - m.value.left,
|
|
348
|
+
top: Math.min(s.value.y, _.value.y) - m.value.top,
|
|
349
|
+
width: Math.abs(s.value.x - _.value.x),
|
|
350
|
+
height: Math.abs(s.value.y - _.value.y)
|
|
351
|
+
} : { left: 0, top: 0, width: 0, height: 0 }), { margin: Q = 50, startSpeed: ee = 30, maxSpeed: U = 30 } = n;
|
|
352
|
+
let k;
|
|
353
|
+
const $ = Q, M = ee, N = U, V = (v) => v ** 1;
|
|
354
|
+
let L = 0;
|
|
355
355
|
function q(v) {
|
|
356
|
-
if (cancelAnimationFrame(
|
|
357
|
-
Math.min(
|
|
358
|
-
-
|
|
359
|
-
),
|
|
356
|
+
if (cancelAnimationFrame(k), L = te(v), L = Math.max(
|
|
357
|
+
Math.min(L, N),
|
|
358
|
+
-N
|
|
359
|
+
), L !== 0) {
|
|
360
360
|
const h = c.value;
|
|
361
|
-
if (!h || !
|
|
361
|
+
if (!h || !u.value)
|
|
362
362
|
return;
|
|
363
|
-
const
|
|
364
|
-
let x =
|
|
365
|
-
x = Math.min(Math.max(0, x),
|
|
363
|
+
const D = y.value.height - m.value.height;
|
|
364
|
+
let x = y.value.top + Number(L);
|
|
365
|
+
x = Math.min(Math.max(0, x), D), h.scrollTop = x, Y(), k = requestAnimationFrame(() => q(v));
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
function te(v) {
|
|
369
369
|
if (c.value) {
|
|
370
|
-
const
|
|
371
|
-
if (x <
|
|
372
|
-
return
|
|
373
|
-
const
|
|
374
|
-
if (
|
|
375
|
-
return -
|
|
370
|
+
const D = m.value, x = D.bottom - v;
|
|
371
|
+
if (x < $)
|
|
372
|
+
return M * V(1 - x / $);
|
|
373
|
+
const A = v - D.top;
|
|
374
|
+
if (A < $)
|
|
375
|
+
return -M * V(1 - A / $);
|
|
376
376
|
}
|
|
377
377
|
return 0;
|
|
378
378
|
}
|
|
379
|
-
function
|
|
380
|
-
const h = { ...
|
|
381
|
-
return h.left +=
|
|
379
|
+
function j(v) {
|
|
380
|
+
const h = { ...R.value, right: 0, bottom: 0 };
|
|
381
|
+
return h.left += m.value.left, h.top += m.value.top - y.value.top, h.right = h.width + h.left, h.bottom = h.height + h.top, h.left < v.right && h.right > v.left && h.top < v.bottom && h.bottom > v.top;
|
|
382
382
|
}
|
|
383
383
|
function Y() {
|
|
384
|
-
|
|
385
|
-
const { top: v, height: h } =
|
|
386
|
-
|
|
387
|
-
h +
|
|
388
|
-
|
|
389
|
-
),
|
|
390
|
-
}
|
|
391
|
-
function
|
|
392
|
-
let x = document.getElementById(
|
|
393
|
-
x || (x = document.createElement("style"), x.id =
|
|
394
|
-
const
|
|
395
|
-
for (let
|
|
396
|
-
const me =
|
|
384
|
+
y.value.sync();
|
|
385
|
+
const { top: v, height: h } = y.value;
|
|
386
|
+
_.value.y = Math.min(
|
|
387
|
+
h + m.value.top,
|
|
388
|
+
_.value.y + v - _.value.scrollTop
|
|
389
|
+
), _.value.scrollTop = v;
|
|
390
|
+
}
|
|
391
|
+
function p(v, h, D = "dynamic-styles") {
|
|
392
|
+
let x = document.getElementById(D);
|
|
393
|
+
x || (x = document.createElement("style"), x.id = D, document.head.appendChild(x));
|
|
394
|
+
const A = x.sheet.cssRules, X = A.length, je = `${v} { ${h} }`;
|
|
395
|
+
for (let ie = 0; ie < X; ie++) {
|
|
396
|
+
const me = A[ie];
|
|
397
397
|
if (me.selectorText === v && me.style.cssText === h)
|
|
398
398
|
return;
|
|
399
399
|
}
|
|
400
400
|
x.sheet.insertRule(je, X);
|
|
401
401
|
}
|
|
402
|
-
function
|
|
403
|
-
d.value = !0,
|
|
402
|
+
function b(v, h) {
|
|
403
|
+
d.value = !0, u.value = !0, y.value.height ? y.value.sync() : y.value.sync(!0), s.value.x = v, s.value.y = h + y.value.top, _.value.x = s.value.x, _.value.y = s.value.y, c.value?.classList.add("disable-scroll-behavior"), f.clear();
|
|
404
404
|
}
|
|
405
|
-
function I(v, h,
|
|
406
|
-
!
|
|
407
|
-
h +
|
|
408
|
-
|
|
409
|
-
),
|
|
405
|
+
function I(v, h, D) {
|
|
406
|
+
!u.value || (d.value && e === "colum" && !T() && (r(), d.value = !1), D?.(), q(h), _.value.x = Math.max(v, m.value.left), _.value.y = Math.min(
|
|
407
|
+
h + y.value.top,
|
|
408
|
+
y.value.height + m.value.top
|
|
409
|
+
), _.value.scrollTop = y.value.top, g.value());
|
|
410
410
|
}
|
|
411
411
|
function C() {
|
|
412
|
-
|
|
412
|
+
u.value = !1, c.value?.classList.remove("disable-scroll-behavior");
|
|
413
413
|
}
|
|
414
414
|
function O() {
|
|
415
|
-
!
|
|
415
|
+
!u.value || (L || Y(), g.value());
|
|
416
416
|
}
|
|
417
417
|
function T() {
|
|
418
|
-
if (!
|
|
418
|
+
if (!u.value)
|
|
419
419
|
return !1;
|
|
420
|
-
const { width: v, height: h } =
|
|
420
|
+
const { width: v, height: h } = R.value;
|
|
421
421
|
return !(Math.max(v, h) > 5);
|
|
422
422
|
}
|
|
423
423
|
function G() {
|
|
@@ -425,87 +425,87 @@ function Ve({
|
|
|
425
425
|
}
|
|
426
426
|
function z() {
|
|
427
427
|
T() || c.value?.querySelectorAll(`[${t}]`).forEach((v) => {
|
|
428
|
-
i[`${t}`] = v.getAttribute(`${t}`),
|
|
428
|
+
i[`${t}`] = v.getAttribute(`${t}`), j(v.getBoundingClientRect()) ? o([i]) : a([i]);
|
|
429
429
|
});
|
|
430
430
|
}
|
|
431
431
|
function oe() {
|
|
432
432
|
const v = [];
|
|
433
|
-
let h = null,
|
|
434
|
-
c.value?.querySelectorAll(`[${t}]`).forEach((x,
|
|
433
|
+
let h = null, D = 0;
|
|
434
|
+
c.value?.querySelectorAll(`[${t}]`).forEach((x, A) => {
|
|
435
435
|
const X = x.getAttribute(`${t}`);
|
|
436
|
-
v.push(X),
|
|
436
|
+
v.push(X), j(x.getBoundingClientRect()) ? (h === null && (h = A), h = Math.min(h, A), D = Math.max(D, A)) : (i[`${t}`] = X, f.has(X) && a([i]));
|
|
437
437
|
});
|
|
438
|
-
for (let x = h; x <
|
|
439
|
-
i[`${t}`] = v[x], o([i]),
|
|
438
|
+
for (let x = h; x < D + 1; x++)
|
|
439
|
+
i[`${t}`] = v[x], o([i]), f.add(v[x]);
|
|
440
440
|
}
|
|
441
441
|
function re(v) {
|
|
442
|
-
return !v?.value || (c.value = v.value, !c?.value) ? !1 : (
|
|
442
|
+
return !v?.value || (c.value = v.value, !c?.value) ? !1 : (w.observe(c.value), p(
|
|
443
443
|
".disable-scroll-behavior",
|
|
444
444
|
"scroll-behavior: unset !important;"
|
|
445
445
|
), !0);
|
|
446
446
|
}
|
|
447
447
|
return {
|
|
448
448
|
init: re,
|
|
449
|
-
dragStart:
|
|
449
|
+
dragStart: b,
|
|
450
450
|
dragMove: I,
|
|
451
451
|
dragEnd: C,
|
|
452
452
|
onScroll: O,
|
|
453
453
|
isSingleClick: T,
|
|
454
454
|
cancelSelectAllBySingleClick: G,
|
|
455
|
-
selectFn:
|
|
456
|
-
selectRange:
|
|
457
|
-
isPressing:
|
|
455
|
+
selectFn: g,
|
|
456
|
+
selectRange: R,
|
|
457
|
+
isPressing: u,
|
|
458
458
|
containerEl: c,
|
|
459
|
-
observer:
|
|
459
|
+
observer: w
|
|
460
460
|
};
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function Nt(t) {
|
|
463
463
|
const e = Ve(t), { observer: n, selectRange: l } = e, {
|
|
464
464
|
onScroll: o,
|
|
465
465
|
dragStart: a,
|
|
466
466
|
dragMove: r,
|
|
467
467
|
dragEnd: i,
|
|
468
|
-
cancelSelectAllBySingleClick:
|
|
469
|
-
} = e,
|
|
468
|
+
cancelSelectAllBySingleClick: g
|
|
469
|
+
} = e, f = S(() => ({
|
|
470
470
|
left: `${l.value.left}px`,
|
|
471
471
|
top: `${l.value.top}px`,
|
|
472
472
|
width: `${l.value.width}px`,
|
|
473
473
|
height: `${l.value.height}px`
|
|
474
474
|
})), d = Z({
|
|
475
475
|
render() {
|
|
476
|
-
return
|
|
476
|
+
return K("div", {
|
|
477
477
|
id: "selectBoxEl",
|
|
478
478
|
class: "absolute z-50 bg-blue-200 opacity-50",
|
|
479
|
-
style:
|
|
479
|
+
style: f.value
|
|
480
480
|
});
|
|
481
481
|
}
|
|
482
482
|
});
|
|
483
|
-
function c(
|
|
484
|
-
|
|
483
|
+
function c(m) {
|
|
484
|
+
m.button === 0 && a(m.x, m.y);
|
|
485
485
|
}
|
|
486
|
-
function
|
|
487
|
-
r(
|
|
486
|
+
function u(m) {
|
|
487
|
+
r(m.x, m.y);
|
|
488
488
|
}
|
|
489
|
-
function
|
|
490
|
-
|
|
489
|
+
function s(m) {
|
|
490
|
+
m.composedPath().some((R) => R?.getAttribute?.(t.attribute)) || g(), i();
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function _(m) {
|
|
493
493
|
try {
|
|
494
|
-
if (!e.init(
|
|
494
|
+
if (!e.init(m))
|
|
495
495
|
throw "\u521D\u59CB\u5316\u5931\u8D25,Ref\u5143\u7D20\u4E0D\u6B63\u786E";
|
|
496
496
|
if (!e.containerEl?.value)
|
|
497
497
|
return !1;
|
|
498
|
-
ae(
|
|
499
|
-
} catch (
|
|
500
|
-
console.error("\u62D6\u9009\u529F\u80FD\u521D\u59CB\u5316\u5931\u8D25",
|
|
498
|
+
ae(K(d), e.containerEl.value), e.containerEl.value?.addEventListener("scroll", o), e.containerEl.value?.addEventListener("mousedown", c), window.addEventListener("mousemove", u), window.addEventListener("mouseup", s);
|
|
499
|
+
} catch (y) {
|
|
500
|
+
console.error("\u62D6\u9009\u529F\u80FD\u521D\u59CB\u5316\u5931\u8D25", y);
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
|
-
function
|
|
504
|
-
n.disconnect(), e.containerEl.value?.removeEventListener("scroll", o), e.containerEl.value?.removeEventListener("mousedown", c), window.removeEventListener("mousemove",
|
|
503
|
+
function w() {
|
|
504
|
+
n.disconnect(), e.containerEl.value?.removeEventListener("scroll", o), e.containerEl.value?.removeEventListener("mousedown", c), window.removeEventListener("mousemove", u), window.removeEventListener("mouseup", s);
|
|
505
505
|
}
|
|
506
|
-
return { init:
|
|
506
|
+
return { init: _, unMount: w };
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function Vt(t, e, n = 600) {
|
|
509
509
|
const l = Ve({
|
|
510
510
|
...t,
|
|
511
511
|
selectWay: "row",
|
|
@@ -513,40 +513,40 @@ function Nt(t, e, n = 600) {
|
|
|
513
513
|
startSpeed: 5,
|
|
514
514
|
maxSpeed: 5
|
|
515
515
|
}
|
|
516
|
-
}), { observer: o } = l, { onScroll: a, dragStart: r, dragMove: i, dragEnd:
|
|
517
|
-
let
|
|
518
|
-
function
|
|
519
|
-
clearTimeout(
|
|
520
|
-
}
|
|
521
|
-
function
|
|
522
|
-
|
|
523
|
-
const { clientX:
|
|
524
|
-
r(
|
|
516
|
+
}), { observer: o } = l, { onScroll: a, dragStart: r, dragMove: i, dragEnd: g } = l;
|
|
517
|
+
let f;
|
|
518
|
+
function d() {
|
|
519
|
+
clearTimeout(f);
|
|
520
|
+
}
|
|
521
|
+
function c(m) {
|
|
522
|
+
d(), f = setTimeout(() => {
|
|
523
|
+
const { clientX: y, clientY: R } = m.targetTouches[0];
|
|
524
|
+
r(y, R), e?.(), i(y, R, () => m.preventDefault()), m.preventDefault();
|
|
525
525
|
}, n);
|
|
526
526
|
}
|
|
527
|
-
function u(
|
|
528
|
-
|
|
529
|
-
const { clientX:
|
|
530
|
-
i(
|
|
527
|
+
function u(m) {
|
|
528
|
+
d();
|
|
529
|
+
const { clientX: y, clientY: R } = m.targetTouches[0];
|
|
530
|
+
i(y, R, () => m.preventDefault());
|
|
531
531
|
}
|
|
532
|
-
function
|
|
533
|
-
|
|
532
|
+
function s() {
|
|
533
|
+
d(), g();
|
|
534
534
|
}
|
|
535
|
-
function _(
|
|
535
|
+
function _(m) {
|
|
536
536
|
try {
|
|
537
|
-
if (!l.init(
|
|
537
|
+
if (!l.init(m))
|
|
538
538
|
throw "\u521D\u59CB\u5316\u5931\u8D25,Ref\u5143\u7D20\u4E0D\u6B63\u786E";
|
|
539
539
|
if (!l.containerEl?.value)
|
|
540
540
|
return !1;
|
|
541
|
-
l.containerEl.value?.addEventListener("scroll", a), l.containerEl.value?.addEventListener("touchstart",
|
|
542
|
-
} catch (
|
|
543
|
-
console.error("\u62D6\u9009\u529F\u80FD\u521D\u59CB\u5316\u5931\u8D25",
|
|
541
|
+
l.containerEl.value?.addEventListener("scroll", a), l.containerEl.value?.addEventListener("touchstart", c), l.containerEl.value?.addEventListener("touchmove", u), window.addEventListener("touchcancel", s), window.addEventListener("touchend", s);
|
|
542
|
+
} catch (y) {
|
|
543
|
+
console.error("\u62D6\u9009\u529F\u80FD\u521D\u59CB\u5316\u5931\u8D25", y);
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
|
-
function
|
|
547
|
-
o.disconnect(), l.containerEl.value?.removeEventListener("scroll", a), l.containerEl.value?.removeEventListener("touchstart",
|
|
546
|
+
function w() {
|
|
547
|
+
o.disconnect(), l.containerEl.value?.removeEventListener("scroll", a), l.containerEl.value?.removeEventListener("touchstart", c), l.containerEl.value?.removeEventListener("touchmove", u), window.removeEventListener("touchcancel", s), window.removeEventListener("touchEnd", s);
|
|
548
548
|
}
|
|
549
|
-
return { init: _, unMount:
|
|
549
|
+
return { init: _, unMount: w };
|
|
550
550
|
}
|
|
551
551
|
const Ot = Symbol(), Dt = /* @__PURE__ */ Z({
|
|
552
552
|
__name: "Dialog",
|
|
@@ -560,14 +560,14 @@ const Ot = Symbol(), Dt = /* @__PURE__ */ Z({
|
|
|
560
560
|
const n = t, l = () => {
|
|
561
561
|
n.closeOnClickOverlay && e("update:visiable", !1);
|
|
562
562
|
};
|
|
563
|
-
return
|
|
563
|
+
return H(Ot, () => e("update:visiable", !1)), (o, a) => (W(), De(Re, { name: "modal" }, {
|
|
564
564
|
default: Ce(() => [
|
|
565
|
-
t.visiable ? (
|
|
565
|
+
t.visiable ? (W(), J("div", {
|
|
566
566
|
key: 0,
|
|
567
567
|
onClick: l,
|
|
568
568
|
class: "modal"
|
|
569
569
|
}, [
|
|
570
|
-
|
|
570
|
+
F("div", {
|
|
571
571
|
onClick: a[0] || (a[0] = Ye(() => {
|
|
572
572
|
}, ["stop"])),
|
|
573
573
|
class: Ge(["dialog", t.dialogClass])
|
|
@@ -580,17 +580,17 @@ const Ot = Symbol(), Dt = /* @__PURE__ */ Z({
|
|
|
580
580
|
}));
|
|
581
581
|
}
|
|
582
582
|
});
|
|
583
|
-
const
|
|
583
|
+
const ue = (t, e) => {
|
|
584
584
|
const n = t.__vccOpts || t;
|
|
585
585
|
for (const [l, o] of e)
|
|
586
586
|
n[l] = o;
|
|
587
587
|
return n;
|
|
588
|
-
}, Rt = /* @__PURE__ */
|
|
589
|
-
function
|
|
588
|
+
}, Rt = /* @__PURE__ */ ue(Dt, [["__scopeId", "data-v-415900d3"]]);
|
|
589
|
+
function jt(t) {
|
|
590
590
|
function e(n, l) {
|
|
591
591
|
const o = document.createElement("div"), a = {
|
|
592
592
|
setup() {
|
|
593
|
-
return () =>
|
|
593
|
+
return () => K(
|
|
594
594
|
Rt,
|
|
595
595
|
{
|
|
596
596
|
visiable: !0,
|
|
@@ -600,12 +600,12 @@ function Vt(t) {
|
|
|
600
600
|
...t
|
|
601
601
|
},
|
|
602
602
|
{
|
|
603
|
-
default: () =>
|
|
603
|
+
default: () => K(n, l)
|
|
604
604
|
}
|
|
605
605
|
);
|
|
606
606
|
}
|
|
607
607
|
};
|
|
608
|
-
return document.body.appendChild(o), ae(
|
|
608
|
+
return document.body.appendChild(o), ae(K(a), o), {
|
|
609
609
|
close: () => o?.remove()
|
|
610
610
|
};
|
|
611
611
|
}
|
|
@@ -620,7 +620,7 @@ const Ct = /* @__PURE__ */ Z({
|
|
|
620
620
|
position: null
|
|
621
621
|
},
|
|
622
622
|
setup(t) {
|
|
623
|
-
const e = t, n =
|
|
623
|
+
const e = t, n = E(), l = E(), o = E(), a = S(() => {
|
|
624
624
|
switch (e.position) {
|
|
625
625
|
case "top":
|
|
626
626
|
return 10;
|
|
@@ -644,35 +644,36 @@ const Ct = /* @__PURE__ */ Z({
|
|
|
644
644
|
color: "white",
|
|
645
645
|
fontSize: "14px"
|
|
646
646
|
}));
|
|
647
|
-
return
|
|
647
|
+
return pe(() => {
|
|
648
648
|
l.value = n.value.offsetWidth / 2, o.value = n.value.offsetHeight / 2;
|
|
649
|
-
}), (
|
|
649
|
+
}), (g, f) => (W(), J("div", {
|
|
650
650
|
id: "toastWrapper",
|
|
651
651
|
ref_key: "toastWrapper",
|
|
652
652
|
ref: n,
|
|
653
653
|
class: "toastWrapper",
|
|
654
654
|
style: le([B(r), { zIndex: 9999 }])
|
|
655
655
|
}, [
|
|
656
|
-
|
|
656
|
+
F("div", {
|
|
657
657
|
style: le(B(i))
|
|
658
658
|
}, [
|
|
659
|
-
|
|
659
|
+
F("span", null, Je(t.message), 1)
|
|
660
660
|
], 4)
|
|
661
661
|
], 4));
|
|
662
662
|
}
|
|
663
|
-
})
|
|
663
|
+
});
|
|
664
|
+
const Bt = /* @__PURE__ */ ue(Ct, [["__scopeId", "data-v-15ab4094"]]), Te = {
|
|
664
665
|
message: "\u61D2\u732B\u4E91 Yes!!!",
|
|
665
666
|
position: "middle",
|
|
666
667
|
duration: 1500
|
|
667
668
|
};
|
|
668
|
-
class
|
|
669
|
+
class Kt {
|
|
669
670
|
options;
|
|
670
671
|
container;
|
|
671
672
|
constructor(e) {
|
|
672
673
|
this.options = e, this.container = document.createElement("div");
|
|
673
674
|
}
|
|
674
675
|
present() {
|
|
675
|
-
const e =
|
|
676
|
+
const e = K(K(Bt), { ...Te, ...this.options });
|
|
676
677
|
ae(e, this.container), document.body.insertBefore(this.container, document.body.firstChild);
|
|
677
678
|
const n = this.options.duration || Te.duration;
|
|
678
679
|
setTimeout(() => {
|
|
@@ -680,12 +681,17 @@ class jt {
|
|
|
680
681
|
}, n);
|
|
681
682
|
}
|
|
682
683
|
dismiss() {
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
684
|
+
if (this.container) {
|
|
685
|
+
const e = this.container.querySelector(
|
|
686
|
+
"#toastWrapper"
|
|
687
|
+
);
|
|
688
|
+
e.style.opacity = "0", e.style.transition = "opacity 0.4s ease-in", setTimeout(() => {
|
|
689
|
+
this.container && (ae(null, this.container), document.body.removeChild(this.container));
|
|
690
|
+
}, 500);
|
|
691
|
+
}
|
|
686
692
|
}
|
|
687
693
|
}
|
|
688
|
-
const
|
|
694
|
+
const It = ["xlink:href", "fill", "color"], Qt = /* @__PURE__ */ Z({
|
|
689
695
|
__name: "SvgIcon",
|
|
690
696
|
props: {
|
|
691
697
|
name: null,
|
|
@@ -700,86 +706,86 @@ const Bt = ["xlink:href", "fill", "color"], Kt = /* @__PURE__ */ Z({
|
|
|
700
706
|
height: `${e.height ?? e.width}px`,
|
|
701
707
|
aspectRatio: e.width && e.height ? void 0 : "1/1"
|
|
702
708
|
}));
|
|
703
|
-
return (o, a) => (
|
|
709
|
+
return (o, a) => (W(), J("svg", {
|
|
704
710
|
"aria-hidden": "",
|
|
705
711
|
style: le(B(l))
|
|
706
712
|
}, [
|
|
707
|
-
|
|
713
|
+
F("use", {
|
|
708
714
|
"xlink:href": B(n),
|
|
709
715
|
fill: t.color,
|
|
710
716
|
color: t.color
|
|
711
|
-
}, null, 8,
|
|
717
|
+
}, null, 8, It)
|
|
712
718
|
], 4));
|
|
713
719
|
}
|
|
714
720
|
});
|
|
715
|
-
function
|
|
721
|
+
function Lt(t) {
|
|
716
722
|
const {
|
|
717
723
|
containerEl: e,
|
|
718
724
|
sliderEl: n,
|
|
719
725
|
autoHeight: l,
|
|
720
726
|
performance: o = {},
|
|
721
727
|
maxHeightRatio: a = 0.9
|
|
722
|
-
} = t, r =
|
|
723
|
-
let
|
|
724
|
-
const d =
|
|
728
|
+
} = t, r = E(!0), i = Le(N, 100);
|
|
729
|
+
let g, f = "";
|
|
730
|
+
const d = E(0), c = E(0), u = E(0), s = E({
|
|
725
731
|
top: 0,
|
|
726
732
|
scrollTop: 0,
|
|
727
733
|
scrollHeight: 0,
|
|
728
734
|
clientHeight: 0
|
|
729
|
-
}),
|
|
735
|
+
}), _ = E({
|
|
730
736
|
clientHeight: 0
|
|
731
|
-
}),
|
|
732
|
-
|
|
737
|
+
}), w = S(() => !!c.value), m = S(() => s.value.scrollHeight > s.value.clientHeight), y = S(() => s.value.clientHeight - _.value.clientHeight), R = S(() => s.value.scrollHeight - s.value.clientHeight), Q = S(() => Math.max(
|
|
738
|
+
s.value.clientHeight / s.value.scrollHeight,
|
|
733
739
|
0.05
|
|
734
|
-
)), ee = S(() =>
|
|
740
|
+
)), ee = S(() => Q.value > a ? 0 : Q.value * s.value.clientHeight), U = S(() => ({
|
|
735
741
|
willChange: "transform",
|
|
736
|
-
transform: `translate3d(0,${
|
|
742
|
+
transform: `translate3d(0,${u.value}px,0)`,
|
|
737
743
|
height: l ? `${ee.value}px` : void 0
|
|
738
744
|
}));
|
|
739
|
-
function
|
|
740
|
-
|
|
745
|
+
function k(O) {
|
|
746
|
+
M(), c.value = O.clientY - n.value.getBoundingClientRect().top || 1, f = getComputedStyle(e.value).scrollBehavior, f === "smooth" && (e.value.style.scrollBehavior = "unset");
|
|
741
747
|
}
|
|
742
|
-
function
|
|
743
|
-
e.value.style.scrollBehavior =
|
|
748
|
+
function $() {
|
|
749
|
+
e.value.style.scrollBehavior = f, c.value = 0, i();
|
|
744
750
|
}
|
|
745
|
-
function
|
|
751
|
+
function M() {
|
|
746
752
|
r.value = !1;
|
|
747
753
|
}
|
|
748
|
-
function
|
|
749
|
-
|
|
754
|
+
function N() {
|
|
755
|
+
w.value || (r.value = !0);
|
|
750
756
|
}
|
|
751
|
-
function
|
|
752
|
-
if (!
|
|
757
|
+
function V(O) {
|
|
758
|
+
if (!w.value)
|
|
753
759
|
return;
|
|
754
|
-
let T = O.clientY -
|
|
755
|
-
T < 0 ?
|
|
756
|
-
top:
|
|
760
|
+
let T = O.clientY - s.value.top - c.value;
|
|
761
|
+
T < 0 ? u.value = 0 : T >= y.value ? u.value = y.value : u.value = T, e.value.scrollTo({
|
|
762
|
+
top: u.value / y.value * R.value
|
|
757
763
|
});
|
|
758
764
|
}
|
|
759
|
-
function
|
|
760
|
-
|
|
765
|
+
function L() {
|
|
766
|
+
w.value || q();
|
|
761
767
|
}
|
|
762
768
|
function q() {
|
|
763
|
-
cancelAnimationFrame(
|
|
769
|
+
cancelAnimationFrame(g), g = requestAnimationFrame(te);
|
|
764
770
|
}
|
|
765
771
|
function te() {
|
|
766
|
-
e.value && (d.value = o.scrollTop?.value ?? e.value.scrollTop,
|
|
772
|
+
e.value && (d.value = o.scrollTop?.value ?? e.value.scrollTop, u.value = d.value / R.value * y.value);
|
|
767
773
|
}
|
|
768
|
-
function
|
|
774
|
+
function j(O) {
|
|
769
775
|
let T = "addEventListener";
|
|
770
|
-
O === "add" ? T = "addEventListener" : T = "removeEventListener", n.value?.[T]("pointerdown",
|
|
776
|
+
O === "add" ? T = "addEventListener" : T = "removeEventListener", n.value?.[T]("pointerdown", k, {
|
|
771
777
|
passive: !0
|
|
772
|
-
}), window[T]("pointermove",
|
|
778
|
+
}), window[T]("pointermove", V, { passive: !0 }), window[T]("pointerup", $, { passive: !0 });
|
|
773
779
|
}
|
|
774
780
|
const Y = new MutationObserver((O) => {
|
|
775
|
-
O.map((G) => G.oldValue).join().includes("height") &&
|
|
781
|
+
O.map((G) => G.oldValue).join().includes("height") && p();
|
|
776
782
|
});
|
|
777
|
-
function
|
|
778
|
-
|
|
783
|
+
function p() {
|
|
784
|
+
s.value.top = e.value?.getBoundingClientRect().top ?? 0, s.value.scrollHeight = e.value?.scrollHeight ?? 0, s.value.clientHeight = e.value?.clientHeight ?? 0;
|
|
779
785
|
}
|
|
780
|
-
function
|
|
781
|
-
|
|
782
|
-
|
|
786
|
+
function b() {
|
|
787
|
+
M(), setTimeout(() => {
|
|
788
|
+
_.value.clientHeight = n.value?.clientHeight ?? 0, N();
|
|
783
789
|
}, 150);
|
|
784
790
|
}
|
|
785
791
|
function I(O, T, G = "dynamic-styles") {
|
|
@@ -787,8 +793,8 @@ function It(t) {
|
|
|
787
793
|
z || (z = document.createElement("style"), z.id = G, document.head.appendChild(z));
|
|
788
794
|
const oe = z.sheet.cssRules, re = oe.length, v = `${O} { ${T} }`;
|
|
789
795
|
for (let h = 0; h < re; h++) {
|
|
790
|
-
const
|
|
791
|
-
if (
|
|
796
|
+
const D = oe[h];
|
|
797
|
+
if (D.selectorText === O && D.style.cssText === T)
|
|
792
798
|
return;
|
|
793
799
|
}
|
|
794
800
|
z.sheet.insertRule(v, re);
|
|
@@ -797,30 +803,30 @@ function It(t) {
|
|
|
797
803
|
e.value && n.value ? (I(
|
|
798
804
|
".hide-scrollbar",
|
|
799
805
|
"scrollbar-width: none; -ms-overflow-style: none;"
|
|
800
|
-
), I(".hide-scrollbar::-webkit-scrollbar", "display: none"), e.value.addEventListener("scroll",
|
|
806
|
+
), I(".hide-scrollbar::-webkit-scrollbar", "display: none"), e.value.addEventListener("scroll", L, {
|
|
801
807
|
passive: !0
|
|
802
|
-
}),
|
|
808
|
+
}), j("add"), Y.observe(e.value, {
|
|
803
809
|
subtree: !0,
|
|
804
810
|
attributeOldValue: !0,
|
|
805
811
|
attributeFilter: ["style"]
|
|
806
812
|
}), setTimeout(() => {
|
|
807
|
-
|
|
808
|
-
}, 100),
|
|
813
|
+
p();
|
|
814
|
+
}, 100), b()) : console.error("useScrollBar:", "\u521D\u59CB\u5316\u5931\u8D25!", { containerEl: e, sliderEl: n });
|
|
809
815
|
}
|
|
810
816
|
return ne(d, () => {
|
|
811
|
-
|
|
817
|
+
M(), i();
|
|
812
818
|
}), {
|
|
813
819
|
isScrollEnd: r,
|
|
814
|
-
isDragSlider:
|
|
815
|
-
offsetTop:
|
|
820
|
+
isDragSlider: w,
|
|
821
|
+
offsetTop: u,
|
|
816
822
|
scrollTop: d,
|
|
817
|
-
scrollable:
|
|
823
|
+
scrollable: m,
|
|
818
824
|
sliderPos: U,
|
|
819
825
|
init: C,
|
|
820
|
-
modifySliderEventListener:
|
|
826
|
+
modifySliderEventListener: j
|
|
821
827
|
};
|
|
822
828
|
}
|
|
823
|
-
const
|
|
829
|
+
const Ht = (t) => (nt("data-v-edec7292"), t = t(), lt(), t), $t = /* @__PURE__ */ Ht(() => /* @__PURE__ */ F("div", { class: "default-slider" }, null, -1)), At = /* @__PURE__ */ Z({
|
|
824
830
|
__name: "ScrollBar",
|
|
825
831
|
props: {
|
|
826
832
|
containerEl: null,
|
|
@@ -829,37 +835,37 @@ const Lt = (t) => (nt("data-v-edec7292"), t = t(), lt(), t), Ht = /* @__PURE__ *
|
|
|
829
835
|
performance: null
|
|
830
836
|
},
|
|
831
837
|
setup(t, { expose: e }) {
|
|
832
|
-
const n = t, l = !!Ze().default, o =
|
|
838
|
+
const n = t, l = !!Ze().default, o = E(null), a = S(() => n.containerEl), r = Lt({
|
|
833
839
|
containerEl: a,
|
|
834
840
|
sliderEl: o,
|
|
835
841
|
autoHeight: l ? n.autoHeight : !0,
|
|
836
842
|
performance: n.performance
|
|
837
|
-
}), { scrollable: i, isScrollEnd:
|
|
838
|
-
|
|
839
|
-
|
|
843
|
+
}), { scrollable: i, isScrollEnd: g, sliderPos: f } = r, d = E(!1), c = n.autoHide ? S(() => d.value || !g.value) : S(() => i.value);
|
|
844
|
+
fe(() => {
|
|
845
|
+
pe(() => {
|
|
840
846
|
r.init();
|
|
841
847
|
});
|
|
842
848
|
}), Oe(() => {
|
|
843
849
|
r.modifySliderEventListener("remove");
|
|
844
850
|
});
|
|
845
|
-
function
|
|
851
|
+
function u() {
|
|
846
852
|
d.value = !0;
|
|
847
853
|
}
|
|
848
|
-
function
|
|
854
|
+
function s() {
|
|
849
855
|
d.value = !1;
|
|
850
856
|
}
|
|
851
|
-
return e({ uScrollBarReturn: r }), (
|
|
857
|
+
return e({ uScrollBarReturn: r }), (_, w) => (W(), De(Re, null, {
|
|
852
858
|
default: Ce(() => [
|
|
853
|
-
et(
|
|
859
|
+
et(F("div", {
|
|
854
860
|
ref_key: "sliderRef",
|
|
855
861
|
ref: o,
|
|
856
862
|
class: "slider-wrapper",
|
|
857
|
-
onMouseenter:
|
|
858
|
-
onMouseleave:
|
|
859
|
-
style: le(B(
|
|
863
|
+
onMouseenter: u,
|
|
864
|
+
onMouseleave: s,
|
|
865
|
+
style: le(B(f))
|
|
860
866
|
}, [
|
|
861
|
-
he(
|
|
862
|
-
|
|
867
|
+
he(_.$slots, "default", {}, () => [
|
|
868
|
+
$t
|
|
863
869
|
], !0)
|
|
864
870
|
], 36), [
|
|
865
871
|
[tt, B(c)]
|
|
@@ -869,10 +875,10 @@ const Lt = (t) => (nt("data-v-edec7292"), t = t(), lt(), t), Ht = /* @__PURE__ *
|
|
|
869
875
|
}));
|
|
870
876
|
}
|
|
871
877
|
});
|
|
872
|
-
const
|
|
878
|
+
const Ut = /* @__PURE__ */ ue(At, [["__scopeId", "data-v-edec7292"]]), Pt = { class: "virtualListWrapper" }, Ft = {
|
|
873
879
|
inheritAttrs: !1
|
|
874
|
-
},
|
|
875
|
-
...
|
|
880
|
+
}, Mt = /* @__PURE__ */ Z({
|
|
881
|
+
...Ft,
|
|
876
882
|
__name: "VirtualList",
|
|
877
883
|
props: {
|
|
878
884
|
data: null,
|
|
@@ -887,27 +893,27 @@ const Qt = /* @__PURE__ */ pe($t, [["__scopeId", "data-v-edec7292"]]), At = { cl
|
|
|
887
893
|
scrollEndHook: () => {
|
|
888
894
|
n("scrollEnd");
|
|
889
895
|
}
|
|
890
|
-
}), { list: a, containerProps: r, wrapperProps: i, innerProps:
|
|
896
|
+
}), { list: a, containerProps: r, wrapperProps: i, innerProps: g, getItemHeightData: f } = o;
|
|
891
897
|
return e({
|
|
892
898
|
vListReturn: o
|
|
893
|
-
}), (d, c) => (
|
|
894
|
-
|
|
895
|
-
onScrollPassive: c[0] || (c[0] = (...
|
|
899
|
+
}), (d, c) => (W(), J("div", Pt, [
|
|
900
|
+
F("div", rt({
|
|
901
|
+
onScrollPassive: c[0] || (c[0] = (...u) => B(r).onScroll && B(r).onScroll(...u)),
|
|
896
902
|
ref: B(r).ref,
|
|
897
903
|
class: "virtualList"
|
|
898
904
|
}, d.$attrs), [
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
(
|
|
902
|
-
key:
|
|
905
|
+
F("div", ge(ye(B(i))), [
|
|
906
|
+
F("div", ge(ye(B(g))), [
|
|
907
|
+
(W(!0), J(at, null, st(B(a), ({ index: u, data: s }) => (W(), J("div", {
|
|
908
|
+
key: u,
|
|
903
909
|
style: le({
|
|
904
|
-
height: `${B(
|
|
910
|
+
height: `${B(f)(u).height}px`,
|
|
905
911
|
display: "flex"
|
|
906
912
|
})
|
|
907
913
|
}, [
|
|
908
914
|
he(d.$slots, "default", {
|
|
909
|
-
data:
|
|
910
|
-
index:
|
|
915
|
+
data: s,
|
|
916
|
+
index: u
|
|
911
917
|
}, void 0, !0)
|
|
912
918
|
], 4))), 128))
|
|
913
919
|
], 16)
|
|
@@ -916,27 +922,27 @@ const Qt = /* @__PURE__ */ pe($t, [["__scopeId", "data-v-edec7292"]]), At = { cl
|
|
|
916
922
|
]));
|
|
917
923
|
}
|
|
918
924
|
});
|
|
919
|
-
const
|
|
925
|
+
const qt = /* @__PURE__ */ ue(Mt, [["__scopeId", "data-v-4ba97cce"]]);
|
|
920
926
|
export {
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
927
|
+
Ut as ScrollBar,
|
|
928
|
+
Qt as SvgIcon,
|
|
929
|
+
Kt as ToastCreator,
|
|
930
|
+
qt as VirtualList,
|
|
925
931
|
Fe as allSelectedKey,
|
|
926
932
|
Ot as closeDialogKey,
|
|
927
|
-
|
|
933
|
+
jt as dialogController,
|
|
928
934
|
ke as isAllSelectedKey,
|
|
929
935
|
Pe as isSelectedKey,
|
|
930
|
-
|
|
936
|
+
ze as selectAllKey,
|
|
931
937
|
Me as selectKey,
|
|
932
938
|
$e as toggleAllKey,
|
|
933
939
|
Ae as toggleKey,
|
|
934
940
|
Ne as unselectAllKey,
|
|
935
|
-
|
|
941
|
+
We as unselectKey,
|
|
936
942
|
Ve as useDragSelect,
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
943
|
+
Vt as useDragSelectByMobile,
|
|
944
|
+
Nt as useDragSelectByPc,
|
|
945
|
+
kt as useSelectable,
|
|
940
946
|
Wt as useSelectableInjectors,
|
|
941
947
|
Tt as useVirtualList
|
|
942
948
|
};
|