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