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