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