@lazycatcloud/lzc-toolkit 0.0.26 → 0.0.28
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 +268 -261
- package/dist/index.umd.js +1 -1
- package/dist/types/scroll-bar/use/type.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
import { unref as
|
|
1
|
+
import { unref as w, getCurrentScope as He, onScopeDispose as Ie, getCurrentInstance as Te, onMounted as X, nextTick as se, ref as y, watch as B, shallowRef as Ce, computed as g, onUnmounted as ue, inject as x, provide as O, defineComponent as K, openBlock as I, createBlock as ce, Transition as de, withCtx as ve, createElementBlock as R, createElementVNode as T, withModifiers as Re, normalizeClass as Be, renderSlot as Z, createCommentVNode as Pe, render as Ae, h as q, normalizeStyle as ee, useSlots as $e, withDirectives as Fe, vShow as Le, pushScopeId as De, popScopeId as ke, toRef as Ve, mergeProps as Ke, normalizeProps as te, guardReactiveProps as le, Fragment as je, renderList as ze } from "vue";
|
|
2
2
|
var ne;
|
|
3
|
-
const
|
|
4
|
-
|
|
3
|
+
const P = typeof window < "u";
|
|
4
|
+
P && ((ne = window?.navigator) == null ? void 0 : ne.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
5
5
|
function Y(e) {
|
|
6
|
-
return typeof e == "function" ? e() :
|
|
6
|
+
return typeof e == "function" ? e() : w(e);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function Me(e, t) {
|
|
9
9
|
function l(...n) {
|
|
10
10
|
e(() => t.apply(this, n), { fn: t, thisArg: this, args: n });
|
|
11
11
|
}
|
|
12
12
|
return l;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function Ne(e, t = {}) {
|
|
15
15
|
let l, n;
|
|
16
|
-
return (
|
|
17
|
-
const o = Y(e),
|
|
18
|
-
if (l && clearTimeout(l), o <= 0 ||
|
|
19
|
-
return n && (clearTimeout(n), n = null),
|
|
20
|
-
|
|
21
|
-
l && clearTimeout(l), n = null,
|
|
22
|
-
},
|
|
23
|
-
n && clearTimeout(n), n = null,
|
|
16
|
+
return (i) => {
|
|
17
|
+
const o = Y(e), d = Y(t.maxWait);
|
|
18
|
+
if (l && clearTimeout(l), o <= 0 || d !== void 0 && d <= 0)
|
|
19
|
+
return n && (clearTimeout(n), n = null), i();
|
|
20
|
+
d && !n && (n = setTimeout(() => {
|
|
21
|
+
l && clearTimeout(l), n = null, i();
|
|
22
|
+
}, d)), l = setTimeout(() => {
|
|
23
|
+
n && clearTimeout(n), n = null, i();
|
|
24
24
|
}, o);
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function Qe(e) {
|
|
28
28
|
return e;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
return
|
|
30
|
+
function We(e) {
|
|
31
|
+
return He() ? (Ie(e), !0) : !1;
|
|
32
32
|
}
|
|
33
33
|
function fe(e, t = 200, l = {}) {
|
|
34
|
-
return
|
|
34
|
+
return Me(Ne(t, l), e);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
|
|
36
|
+
function Ue(e, t = !0) {
|
|
37
|
+
Te() ? X(e) : t ? e() : se(e);
|
|
38
38
|
}
|
|
39
39
|
function pe(e) {
|
|
40
40
|
var t;
|
|
41
41
|
const l = Y(e);
|
|
42
42
|
return (t = l?.$el) != null ? t : l;
|
|
43
43
|
}
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
function
|
|
49
|
-
const l =
|
|
50
|
-
return n(),
|
|
44
|
+
const qe = P ? window : void 0;
|
|
45
|
+
P && window.document;
|
|
46
|
+
P && window.navigator;
|
|
47
|
+
P && window.location;
|
|
48
|
+
function Ye(e, t = !1) {
|
|
49
|
+
const l = y(), n = () => l.value = Boolean(e());
|
|
50
|
+
return n(), Ue(n, t), l;
|
|
51
51
|
}
|
|
52
52
|
const G = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, J = "__vueuse_ssr_handlers__";
|
|
53
53
|
G[J] = G[J] || {};
|
|
54
54
|
G[J];
|
|
55
|
-
var oe = Object.getOwnPropertySymbols,
|
|
55
|
+
var oe = Object.getOwnPropertySymbols, Ge = Object.prototype.hasOwnProperty, Je = Object.prototype.propertyIsEnumerable, Xe = (e, t) => {
|
|
56
56
|
var l = {};
|
|
57
57
|
for (var n in e)
|
|
58
|
-
|
|
58
|
+
Ge.call(e, n) && t.indexOf(n) < 0 && (l[n] = e[n]);
|
|
59
59
|
if (e != null && oe)
|
|
60
60
|
for (var n of oe(e))
|
|
61
|
-
t.indexOf(n) < 0 &&
|
|
61
|
+
t.indexOf(n) < 0 && Je.call(e, n) && (l[n] = e[n]);
|
|
62
62
|
return l;
|
|
63
63
|
};
|
|
64
|
-
function
|
|
65
|
-
const n = l, { window: r =
|
|
64
|
+
function Ze(e, t, l = {}) {
|
|
65
|
+
const n = l, { window: r = qe } = n, i = Xe(n, ["window"]);
|
|
66
66
|
let o;
|
|
67
|
-
const
|
|
67
|
+
const d = Ye(() => r && "ResizeObserver" in r), m = () => {
|
|
68
68
|
o && (o.disconnect(), o = void 0);
|
|
69
|
-
}, f =
|
|
70
|
-
|
|
71
|
-
}, { immediate: !0, flush: "post" }),
|
|
72
|
-
|
|
69
|
+
}, f = B(() => pe(e), (p) => {
|
|
70
|
+
m(), d.value && r && p && (o = new ResizeObserver(t), o.observe(p, i));
|
|
71
|
+
}, { immediate: !0, flush: "post" }), v = () => {
|
|
72
|
+
m(), f();
|
|
73
73
|
};
|
|
74
|
-
return
|
|
75
|
-
isSupported:
|
|
76
|
-
stop:
|
|
74
|
+
return We(v), {
|
|
75
|
+
isSupported: d,
|
|
76
|
+
stop: v
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
const { box: n = "content-box" } = l, r =
|
|
81
|
-
return
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
}, l),
|
|
85
|
-
r.value = o ? t.width : 0,
|
|
79
|
+
function et(e, t = { width: 0, height: 0 }, l = {}) {
|
|
80
|
+
const { box: n = "content-box" } = l, r = y(t.width), i = y(t.height);
|
|
81
|
+
return Ze(e, ([o]) => {
|
|
82
|
+
const d = n === "border-box" ? o.borderBoxSize : n === "content-box" ? o.contentBoxSize : o.devicePixelContentBoxSize;
|
|
83
|
+
d ? (r.value = d.reduce((m, { inlineSize: f }) => m + f, 0), i.value = d.reduce((m, { blockSize: f }) => m + f, 0)) : (r.value = o.contentRect.width, i.value = o.contentRect.height);
|
|
84
|
+
}, l), B(() => pe(e), (o) => {
|
|
85
|
+
r.value = o ? t.width : 0, i.value = o ? t.height : 0;
|
|
86
86
|
}), {
|
|
87
87
|
width: r,
|
|
88
|
-
height:
|
|
88
|
+
height: i
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
var re;
|
|
92
92
|
(function(e) {
|
|
93
93
|
e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
|
|
94
94
|
})(re || (re = {}));
|
|
95
|
-
var
|
|
95
|
+
var tt = Object.defineProperty, ae = Object.getOwnPropertySymbols, lt = Object.prototype.hasOwnProperty, nt = Object.prototype.propertyIsEnumerable, ie = (e, t, l) => t in e ? tt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[t] = l, ot = (e, t) => {
|
|
96
96
|
for (var l in t || (t = {}))
|
|
97
|
-
|
|
97
|
+
lt.call(t, l) && ie(e, l, t[l]);
|
|
98
98
|
if (ae)
|
|
99
99
|
for (var l of ae(t))
|
|
100
|
-
|
|
100
|
+
nt.call(t, l) && ie(e, l, t[l]);
|
|
101
101
|
return e;
|
|
102
102
|
};
|
|
103
|
-
const
|
|
103
|
+
const rt = {
|
|
104
104
|
easeInSine: [0.12, 0, 0.39, 0],
|
|
105
105
|
easeOutSine: [0.61, 1, 0.88, 1],
|
|
106
106
|
easeInOutSine: [0.37, 0, 0.63, 1],
|
|
@@ -126,149 +126,150 @@ const ot = {
|
|
|
126
126
|
easeOutBack: [0.34, 1.56, 0.64, 1],
|
|
127
127
|
easeInOutBack: [0.68, -0.6, 0.32, 1.6]
|
|
128
128
|
};
|
|
129
|
-
|
|
130
|
-
linear:
|
|
131
|
-
},
|
|
132
|
-
function
|
|
133
|
-
const { scrollEndHook: l, itemHeight: n, overscan: r = 5 } = t,
|
|
129
|
+
ot({
|
|
130
|
+
linear: Qe
|
|
131
|
+
}, rt);
|
|
132
|
+
function at(e, t) {
|
|
133
|
+
const { scrollEndHook: l, itemHeight: n, overscan: r = 5 } = t, i = y(), o = et(i), d = y(!0), m = fe(z, 100);
|
|
134
134
|
let f;
|
|
135
|
-
const
|
|
136
|
-
let
|
|
137
|
-
const
|
|
138
|
-
let { sum:
|
|
139
|
-
return
|
|
140
|
-
}),
|
|
141
|
-
let
|
|
142
|
-
return
|
|
135
|
+
const v = Ce(e), p = y(0), s = y({ start: 0, end: 10 });
|
|
136
|
+
let u = 0;
|
|
137
|
+
const E = y([]), _ = g(() => {
|
|
138
|
+
let { sum: a, height: c } = { sum: 0, height: 0 };
|
|
139
|
+
return v.value.map((S, b) => (typeof n == "number" ? c = n : c = n(b), a += c, { height: c, sum: a }));
|
|
140
|
+
}), j = g(() => D(s.value.start)), H = g(() => typeof n == "number" ? _.value.length * n : _.value[_.value.length - 1]?.sum || 0), A = g(() => {
|
|
141
|
+
let a = E.value.length - r, c = Math.max(a - u, 0);
|
|
142
|
+
return E.value.slice(c, a);
|
|
143
143
|
});
|
|
144
144
|
X(() => {
|
|
145
|
-
}), ue(() => cancelAnimationFrame(f)),
|
|
146
|
-
[o.width, o.height,
|
|
147
|
-
([
|
|
148
|
-
(
|
|
145
|
+
}), ue(() => cancelAnimationFrame(f)), B(
|
|
146
|
+
[o.width, o.height, v],
|
|
147
|
+
([a, c]) => {
|
|
148
|
+
(a || c) && F();
|
|
149
149
|
},
|
|
150
150
|
{ deep: !0 }
|
|
151
|
-
),
|
|
152
|
-
|
|
151
|
+
), B(p, () => {
|
|
152
|
+
$(), m();
|
|
153
153
|
});
|
|
154
|
-
function z() {
|
|
155
|
-
c.value = !1;
|
|
156
|
-
}
|
|
157
|
-
function M() {
|
|
158
|
-
c.value = !0, l?.();
|
|
159
|
-
}
|
|
160
154
|
function $() {
|
|
161
|
-
|
|
155
|
+
d.value = !1;
|
|
156
|
+
}
|
|
157
|
+
function z() {
|
|
158
|
+
d.value = !0, l?.();
|
|
162
159
|
}
|
|
163
160
|
function F() {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
161
|
+
cancelAnimationFrame(f), f = requestAnimationFrame(L);
|
|
162
|
+
}
|
|
163
|
+
function L() {
|
|
164
|
+
if (i.value) {
|
|
165
|
+
p.value = i.value.scrollTop, u = C();
|
|
166
|
+
let a = M(p.value), c = a + u + r;
|
|
167
|
+
a = a - r, a = a < 0 ? 0 : a, c = c > v.value.length ? v.value.length : c, s.value = { start: a, end: c }, E.value = v.value.slice(a, c).map((S, b) => ({
|
|
168
|
+
data: S,
|
|
169
|
+
index: b + a
|
|
170
170
|
}));
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
let
|
|
175
|
-
for (let
|
|
176
|
-
if (
|
|
177
|
-
|
|
173
|
+
function M(a) {
|
|
174
|
+
let c = Math.floor(_.value.length / 16), S = -1, b = -1;
|
|
175
|
+
for (let h = 0; h < 16; h++) {
|
|
176
|
+
if (_.value[c * h].sum >= a) {
|
|
177
|
+
S = Math.max(0, h - 1);
|
|
178
178
|
break;
|
|
179
179
|
}
|
|
180
|
-
|
|
180
|
+
h === 15 && (S = h);
|
|
181
181
|
}
|
|
182
|
-
|
|
183
|
-
for (let
|
|
184
|
-
if (
|
|
185
|
-
|
|
182
|
+
S *= c;
|
|
183
|
+
for (let h = S; h < _.value.length; h++)
|
|
184
|
+
if (_.value[h].sum >= a) {
|
|
185
|
+
b = h;
|
|
186
186
|
break;
|
|
187
187
|
}
|
|
188
|
-
return Math.max(0,
|
|
188
|
+
return Math.max(0, b);
|
|
189
189
|
}
|
|
190
|
-
function
|
|
191
|
-
let
|
|
192
|
-
for (let
|
|
190
|
+
function C() {
|
|
191
|
+
let a = 0, c = 0, S = N();
|
|
192
|
+
for (let b = S; b < _.value.length && (a++, c += _.value[b].height, !(c >= o.height.value)); b++)
|
|
193
193
|
;
|
|
194
|
-
return
|
|
194
|
+
return a;
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function D(a) {
|
|
197
197
|
if (typeof n == "number")
|
|
198
|
-
return
|
|
199
|
-
let
|
|
200
|
-
return
|
|
198
|
+
return a * n;
|
|
199
|
+
let c = _.value[a];
|
|
200
|
+
return c ? c.sum - c.height : 0;
|
|
201
201
|
}
|
|
202
|
-
function
|
|
203
|
-
return
|
|
202
|
+
function k(a) {
|
|
203
|
+
return _.value[a] || { sum: 0, height: 0 };
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
let
|
|
207
|
-
return
|
|
205
|
+
function N() {
|
|
206
|
+
let a = s.value.start;
|
|
207
|
+
return a >= r && (a += r), a;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
if (
|
|
211
|
-
const
|
|
212
|
-
|
|
209
|
+
function Q(a) {
|
|
210
|
+
if (i.value) {
|
|
211
|
+
const c = k(a);
|
|
212
|
+
i.value.scrollTop = c.sum - c.height, L();
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
const
|
|
215
|
+
const W = g(() => ({
|
|
216
216
|
style: {
|
|
217
217
|
width: "100%",
|
|
218
|
-
height: `${
|
|
218
|
+
height: `${H.value}px`,
|
|
219
|
+
pointerEvents: d.value ? void 0 : "none"
|
|
219
220
|
}
|
|
220
|
-
})),
|
|
221
|
+
})), V = g(() => ({
|
|
221
222
|
style: {
|
|
222
|
-
transform: `translate3d(0, ${
|
|
223
|
+
transform: `translate3d(0, ${j.value}px, 0)`,
|
|
223
224
|
"will-change": "transform"
|
|
224
225
|
}
|
|
225
|
-
})),
|
|
226
|
+
})), U = {
|
|
226
227
|
overflowY: "auto"
|
|
227
228
|
};
|
|
228
229
|
return {
|
|
229
|
-
list:
|
|
230
|
-
visiableList:
|
|
231
|
-
getItemHeightData:
|
|
232
|
-
totalHeight:
|
|
230
|
+
list: E,
|
|
231
|
+
visiableList: A,
|
|
232
|
+
getItemHeightData: k,
|
|
233
|
+
totalHeight: H,
|
|
233
234
|
clientHeight: o.height,
|
|
234
|
-
scrollTo:
|
|
235
|
-
scrollTop:
|
|
236
|
-
isScrollEnd:
|
|
235
|
+
scrollTo: Q,
|
|
236
|
+
scrollTop: p,
|
|
237
|
+
isScrollEnd: d,
|
|
237
238
|
containerProps: {
|
|
238
|
-
ref:
|
|
239
|
+
ref: i,
|
|
239
240
|
onScroll: () => {
|
|
240
|
-
|
|
241
|
+
F();
|
|
241
242
|
},
|
|
242
|
-
style:
|
|
243
|
+
style: U
|
|
243
244
|
},
|
|
244
|
-
wrapperProps:
|
|
245
|
-
innerProps:
|
|
245
|
+
wrapperProps: W,
|
|
246
|
+
innerProps: V
|
|
246
247
|
};
|
|
247
248
|
}
|
|
248
249
|
const he = Symbol(), ge = Symbol(), me = Symbol(), be = Symbol(), _e = Symbol(), ye = Symbol(), we = Symbol(), Se = Symbol(), Oe = Symbol();
|
|
249
|
-
function
|
|
250
|
+
function bt() {
|
|
250
251
|
const { voidFn: e, boolFn: t, boolRef: l, arrayRef: n } = {
|
|
251
|
-
voidFn: (
|
|
252
|
+
voidFn: (u) => {
|
|
252
253
|
},
|
|
253
|
-
boolFn: (
|
|
254
|
-
boolRef:
|
|
255
|
-
arrayRef:
|
|
256
|
-
}, r =
|
|
254
|
+
boolFn: (u) => !1,
|
|
255
|
+
boolRef: g(() => !1),
|
|
256
|
+
arrayRef: g(() => [])
|
|
257
|
+
}, r = x(be, n), i = x(me, t), o = x(Se, l), d = x(ge, e), m = x(he, e), f = x(_e, e), v = x(ye, e), p = x(we, e), s = x(Oe, e);
|
|
257
258
|
return {
|
|
258
259
|
selected: r,
|
|
259
|
-
isSelected:
|
|
260
|
+
isSelected: i,
|
|
260
261
|
isAllSelected: o,
|
|
261
|
-
toggle:
|
|
262
|
-
toggleAll:
|
|
262
|
+
toggle: d,
|
|
263
|
+
toggleAll: m,
|
|
263
264
|
select: f,
|
|
264
|
-
selectAll:
|
|
265
|
-
unselect:
|
|
265
|
+
selectAll: v,
|
|
266
|
+
unselect: p,
|
|
266
267
|
unselectAll: s
|
|
267
268
|
};
|
|
268
269
|
}
|
|
269
|
-
function
|
|
270
|
-
const l =
|
|
271
|
-
function
|
|
270
|
+
function _t(e, t) {
|
|
271
|
+
const l = y({}), n = g(() => e.value.filter((s) => l.value[s[t]])), r = g(() => n.value.length != 0 && Object.keys(l.value).length == e.value.length);
|
|
272
|
+
function i() {
|
|
272
273
|
e.value.forEach((s) => {
|
|
273
274
|
l.value[s[t]] = !0;
|
|
274
275
|
});
|
|
@@ -276,40 +277,40 @@ function bt(e, t) {
|
|
|
276
277
|
function o() {
|
|
277
278
|
l.value = {};
|
|
278
279
|
}
|
|
279
|
-
function
|
|
280
|
-
s.forEach((
|
|
281
|
-
l.value[
|
|
280
|
+
function d(s) {
|
|
281
|
+
s.forEach((u) => {
|
|
282
|
+
l.value[u[t]] || (l.value[u[t]] = !0);
|
|
282
283
|
});
|
|
283
284
|
}
|
|
284
|
-
function
|
|
285
|
-
s.forEach((
|
|
286
|
-
l.value[
|
|
285
|
+
function m(s) {
|
|
286
|
+
s.forEach((u) => {
|
|
287
|
+
l.value[u[t]] && delete l.value[u[t]];
|
|
287
288
|
});
|
|
288
289
|
}
|
|
289
290
|
function f(s) {
|
|
290
291
|
return !!l.value[s[t]];
|
|
291
292
|
}
|
|
292
|
-
function
|
|
293
|
-
s.forEach((
|
|
294
|
-
f(
|
|
293
|
+
function v(s) {
|
|
294
|
+
s.forEach((u) => {
|
|
295
|
+
f(u) ? delete l.value[u[t]] : l.value[u[t]] = !0;
|
|
295
296
|
});
|
|
296
297
|
}
|
|
297
|
-
function
|
|
298
|
-
r.value ? o() :
|
|
298
|
+
function p() {
|
|
299
|
+
r.value ? o() : i();
|
|
299
300
|
}
|
|
300
|
-
return O(he,
|
|
301
|
+
return O(he, p), O(ge, v), O(me, f), O(be, n), O(_e, d), O(ye, i), O(we, m), O(Se, r), O(Oe, o), {
|
|
301
302
|
selected: n,
|
|
302
|
-
select:
|
|
303
|
-
selectAll:
|
|
304
|
-
unselect:
|
|
303
|
+
select: d,
|
|
304
|
+
selectAll: i,
|
|
305
|
+
unselect: m,
|
|
305
306
|
unselectAll: o,
|
|
306
|
-
toggle:
|
|
307
|
-
toggleAll:
|
|
307
|
+
toggle: v,
|
|
308
|
+
toggleAll: p,
|
|
308
309
|
isSelected: f,
|
|
309
310
|
isAllSelected: r
|
|
310
311
|
};
|
|
311
312
|
}
|
|
312
|
-
const
|
|
313
|
+
const it = Symbol(), st = /* @__PURE__ */ K({
|
|
313
314
|
__name: "Dialog",
|
|
314
315
|
props: {
|
|
315
316
|
visiable: { type: Boolean, default: !1 },
|
|
@@ -321,15 +322,15 @@ const at = Symbol(), st = /* @__PURE__ */ K({
|
|
|
321
322
|
const l = e, n = () => {
|
|
322
323
|
l.closeOnClickOverlay && t("update:visiable", !1);
|
|
323
324
|
};
|
|
324
|
-
return O(
|
|
325
|
+
return O(it, () => t("update:visiable", !1)), (r, i) => (I(), ce(de, { name: "modal" }, {
|
|
325
326
|
default: ve(() => [
|
|
326
|
-
e.visiable ? (
|
|
327
|
+
e.visiable ? (I(), R("div", {
|
|
327
328
|
key: 0,
|
|
328
329
|
onClick: n,
|
|
329
330
|
class: "modal absolute inset-0 bottom-0 z-50 flex bg-stone-900 bg-opacity-50"
|
|
330
331
|
}, [
|
|
331
|
-
|
|
332
|
-
onClick:
|
|
332
|
+
T("div", {
|
|
333
|
+
onClick: i[0] || (i[0] = Re(() => {
|
|
333
334
|
}, ["stop"])),
|
|
334
335
|
class: Be(["dialog m-auto flex flex-col", e.dialogClass])
|
|
335
336
|
}, [
|
|
@@ -341,9 +342,9 @@ const at = Symbol(), st = /* @__PURE__ */ K({
|
|
|
341
342
|
}));
|
|
342
343
|
}
|
|
343
344
|
});
|
|
344
|
-
function
|
|
345
|
+
function yt(e) {
|
|
345
346
|
function t(l, n) {
|
|
346
|
-
const r = document.createElement("div"),
|
|
347
|
+
const r = document.createElement("div"), i = {
|
|
347
348
|
setup() {
|
|
348
349
|
return () => q(
|
|
349
350
|
st,
|
|
@@ -360,7 +361,7 @@ function _t(e) {
|
|
|
360
361
|
);
|
|
361
362
|
}
|
|
362
363
|
};
|
|
363
|
-
return document.body.appendChild(r),
|
|
364
|
+
return document.body.appendChild(r), Ae(q(i), r), {
|
|
364
365
|
close: () => r?.remove()
|
|
365
366
|
};
|
|
366
367
|
}
|
|
@@ -368,7 +369,7 @@ function _t(e) {
|
|
|
368
369
|
create: t
|
|
369
370
|
};
|
|
370
371
|
}
|
|
371
|
-
const
|
|
372
|
+
const ut = ["xlink:href", "fill", "color"], wt = /* @__PURE__ */ K({
|
|
372
373
|
__name: "SvgIcon",
|
|
373
374
|
props: {
|
|
374
375
|
name: null,
|
|
@@ -378,110 +379,116 @@ const it = ["xlink:href", "fill", "color"], yt = /* @__PURE__ */ K({
|
|
|
378
379
|
height: null
|
|
379
380
|
},
|
|
380
381
|
setup(e) {
|
|
381
|
-
const t = e, l =
|
|
382
|
+
const t = e, l = g(() => `#${t.prefix}-${t.name}`), n = g(() => ({
|
|
382
383
|
width: t.width,
|
|
383
384
|
height: t.height,
|
|
384
385
|
aspectRatio: t.width && t.height ? void 0 : "1/1"
|
|
385
386
|
}));
|
|
386
|
-
return (r,
|
|
387
|
+
return (r, i) => (I(), R("svg", {
|
|
387
388
|
"aria-hidden": "",
|
|
388
|
-
style: ee(
|
|
389
|
+
style: ee(w(n))
|
|
389
390
|
}, [
|
|
390
|
-
|
|
391
|
-
"xlink:href":
|
|
391
|
+
T("use", {
|
|
392
|
+
"xlink:href": w(l),
|
|
392
393
|
fill: e.color,
|
|
393
394
|
color: e.color
|
|
394
|
-
}, null, 8,
|
|
395
|
+
}, null, 8, ut)
|
|
395
396
|
], 4));
|
|
396
397
|
}
|
|
397
398
|
});
|
|
398
|
-
function
|
|
399
|
-
const {
|
|
400
|
-
|
|
401
|
-
|
|
399
|
+
function ct(e) {
|
|
400
|
+
const {
|
|
401
|
+
containerEl: t,
|
|
402
|
+
sliderEl: l,
|
|
403
|
+
autoHeight: n,
|
|
404
|
+
performance: r = {},
|
|
405
|
+
maxHeightRatio: i = 0.9
|
|
406
|
+
} = e, o = y(!0), d = fe(D, 100);
|
|
407
|
+
let m, f = "";
|
|
408
|
+
const v = y(0), p = y(0), s = y(0), u = y({
|
|
402
409
|
top: 0,
|
|
403
410
|
scrollTop: 0,
|
|
404
411
|
scrollHeight: 0,
|
|
405
412
|
clientHeight: 0
|
|
406
|
-
}),
|
|
413
|
+
}), E = y({
|
|
407
414
|
clientHeight: 0
|
|
408
|
-
}),
|
|
409
|
-
|
|
415
|
+
}), _ = g(() => !!p.value), j = g(() => u.value.scrollHeight > u.value.clientHeight), H = g(() => u.value.clientHeight - E.value.clientHeight), A = g(() => u.value.scrollHeight - u.value.clientHeight), $ = g(() => Math.max(
|
|
416
|
+
u.value.clientHeight / u.value.scrollHeight,
|
|
410
417
|
0.05
|
|
411
|
-
)), z =
|
|
418
|
+
)), z = g(() => $.value > i ? 0 : $.value * u.value.clientHeight), F = g(() => ({
|
|
412
419
|
willChange: "transform",
|
|
413
|
-
transform: `translate3d(0,${
|
|
420
|
+
transform: `translate3d(0,${s.value}px,0)`,
|
|
414
421
|
height: n ? `${z.value}px` : void 0
|
|
415
422
|
}));
|
|
416
|
-
function
|
|
417
|
-
|
|
423
|
+
function L(b) {
|
|
424
|
+
C(), p.value = b.clientY - l.value.getBoundingClientRect().top || 1, f = getComputedStyle(t.value).scrollBehavior, f === "smooth" && (t.value.style.scrollBehavior = "unset");
|
|
418
425
|
}
|
|
419
|
-
function
|
|
420
|
-
t.value.style.scrollBehavior =
|
|
426
|
+
function M() {
|
|
427
|
+
t.value.style.scrollBehavior = f, p.value = 0, d();
|
|
421
428
|
}
|
|
422
|
-
function
|
|
423
|
-
|
|
429
|
+
function C() {
|
|
430
|
+
o.value = !1;
|
|
424
431
|
}
|
|
425
|
-
function
|
|
426
|
-
|
|
432
|
+
function D() {
|
|
433
|
+
_.value || (o.value = !0);
|
|
427
434
|
}
|
|
428
|
-
function
|
|
429
|
-
if (!
|
|
435
|
+
function k(b) {
|
|
436
|
+
if (!_.value)
|
|
430
437
|
return;
|
|
431
|
-
let
|
|
432
|
-
|
|
433
|
-
top:
|
|
438
|
+
let h = b.clientY - u.value.top - p.value;
|
|
439
|
+
h < 0 ? s.value = 0 : h >= H.value ? s.value = H.value : s.value = h, t.value.scrollTo({
|
|
440
|
+
top: s.value / H.value * A.value
|
|
434
441
|
});
|
|
435
442
|
}
|
|
436
|
-
function
|
|
437
|
-
|
|
443
|
+
function N() {
|
|
444
|
+
_.value || Q();
|
|
438
445
|
}
|
|
439
446
|
function Q() {
|
|
440
|
-
cancelAnimationFrame(
|
|
447
|
+
cancelAnimationFrame(m), m = requestAnimationFrame(W);
|
|
441
448
|
}
|
|
442
449
|
function W() {
|
|
443
|
-
t.value && (
|
|
450
|
+
t.value && (v.value = r.scrollTop?.value ?? t.value.scrollTop, s.value = v.value / A.value * H.value);
|
|
444
451
|
}
|
|
445
|
-
function
|
|
446
|
-
let
|
|
447
|
-
b === "add" ?
|
|
452
|
+
function V(b) {
|
|
453
|
+
let h = "addEventListener";
|
|
454
|
+
b === "add" ? h = "addEventListener" : h = "removeEventListener", l.value?.[h]("pointerdown", L, {
|
|
448
455
|
passive: !0
|
|
449
|
-
}), window[
|
|
456
|
+
}), window[h]("pointermove", k, { passive: !0 }), window[h]("pointerup", M, { passive: !0 });
|
|
450
457
|
}
|
|
451
458
|
const U = new MutationObserver((b) => {
|
|
452
|
-
b.map((
|
|
459
|
+
b.map((Ee) => Ee.oldValue).join().includes("height") && a();
|
|
453
460
|
});
|
|
454
|
-
function
|
|
455
|
-
|
|
461
|
+
function a() {
|
|
462
|
+
u.value.top = t.value?.getBoundingClientRect().top ?? 0, u.value.scrollHeight = t.value?.scrollHeight ?? 0, u.value.clientHeight = t.value?.clientHeight ?? 0;
|
|
456
463
|
}
|
|
457
|
-
function
|
|
458
|
-
|
|
459
|
-
|
|
464
|
+
function c() {
|
|
465
|
+
C(), setTimeout(() => {
|
|
466
|
+
E.value.clientHeight = l.value?.clientHeight ?? 0, D();
|
|
460
467
|
}, 150);
|
|
461
468
|
}
|
|
462
|
-
function
|
|
463
|
-
t.value && l.value ? (t.value.addEventListener("scroll",
|
|
469
|
+
function S() {
|
|
470
|
+
t.value && l.value ? (t.value.addEventListener("scroll", N, {
|
|
464
471
|
passive: !0
|
|
465
|
-
}),
|
|
472
|
+
}), V("add"), U.observe(t.value, {
|
|
466
473
|
subtree: !0,
|
|
467
474
|
attributeOldValue: !0,
|
|
468
475
|
attributeFilter: ["style"]
|
|
469
476
|
}), setTimeout(() => {
|
|
470
|
-
|
|
471
|
-
}, 100),
|
|
477
|
+
a();
|
|
478
|
+
}, 100), c()) : console.error("useScrollBar:", "\u521D\u59CB\u5316\u5931\u8D25!", { containerEl: t, sliderEl: l });
|
|
472
479
|
}
|
|
473
|
-
return
|
|
474
|
-
|
|
480
|
+
return B(v, () => {
|
|
481
|
+
C(), d();
|
|
475
482
|
}), {
|
|
476
|
-
isScrollEnd:
|
|
477
|
-
isDragSlider:
|
|
478
|
-
scrollable:
|
|
479
|
-
sliderPos:
|
|
480
|
-
init:
|
|
481
|
-
modifySliderEventListener:
|
|
483
|
+
isScrollEnd: o,
|
|
484
|
+
isDragSlider: _,
|
|
485
|
+
scrollable: j,
|
|
486
|
+
sliderPos: F,
|
|
487
|
+
init: S,
|
|
488
|
+
modifySliderEventListener: V
|
|
482
489
|
};
|
|
483
490
|
}
|
|
484
|
-
const
|
|
491
|
+
const dt = (e) => (De("data-v-e4f66100"), e = e(), ke(), e), vt = /* @__PURE__ */ dt(() => /* @__PURE__ */ T("div", { class: "default-slider" }, null, -1)), ft = /* @__PURE__ */ K({
|
|
485
492
|
__name: "ScrollBar",
|
|
486
493
|
props: {
|
|
487
494
|
containerEl: null,
|
|
@@ -490,31 +497,31 @@ const ct = (e) => (Le("data-v-e4f66100"), e = e(), De(), e), dt = /* @__PURE__ *
|
|
|
490
497
|
performance: null
|
|
491
498
|
},
|
|
492
499
|
setup(e, { expose: t }) {
|
|
493
|
-
const l = e, n =
|
|
494
|
-
containerEl:
|
|
500
|
+
const l = e, n = !!$e().default, r = y(null), i = g(() => l.containerEl), o = ct({
|
|
501
|
+
containerEl: i,
|
|
495
502
|
sliderEl: r,
|
|
496
503
|
autoHeight: n ? l.autoHeight : !0,
|
|
497
504
|
performance: l.performance
|
|
498
|
-
}), { scrollable:
|
|
505
|
+
}), { scrollable: d, isScrollEnd: m, sliderPos: f } = o, v = l.autoHide ? g(() => !m.value) : g(() => d.value);
|
|
499
506
|
return X(() => {
|
|
500
|
-
|
|
507
|
+
se(() => {
|
|
501
508
|
o.init();
|
|
502
509
|
});
|
|
503
510
|
}), ue(() => {
|
|
504
511
|
o.modifySliderEventListener("remove");
|
|
505
|
-
}), t({ uScrollBarReturn: o }), (
|
|
512
|
+
}), t({ uScrollBarReturn: o }), (p, s) => (I(), ce(de, null, {
|
|
506
513
|
default: ve(() => [
|
|
507
|
-
|
|
514
|
+
Fe(T("div", {
|
|
508
515
|
ref_key: "sliderRef",
|
|
509
516
|
ref: r,
|
|
510
517
|
class: "slider-wrapper",
|
|
511
|
-
style: ee(
|
|
518
|
+
style: ee(w(f))
|
|
512
519
|
}, [
|
|
513
|
-
Z(
|
|
514
|
-
|
|
520
|
+
Z(p.$slots, "default", {}, () => [
|
|
521
|
+
vt
|
|
515
522
|
], !0)
|
|
516
523
|
], 4), [
|
|
517
|
-
[
|
|
524
|
+
[Le, w(v)]
|
|
518
525
|
])
|
|
519
526
|
]),
|
|
520
527
|
_: 3
|
|
@@ -526,10 +533,10 @@ const xe = (e, t) => {
|
|
|
526
533
|
for (const [n, r] of t)
|
|
527
534
|
l[n] = r;
|
|
528
535
|
return l;
|
|
529
|
-
},
|
|
536
|
+
}, St = /* @__PURE__ */ xe(ft, [["__scopeId", "data-v-e4f66100"]]), pt = { class: "virtualListWrapper" }, ht = {
|
|
530
537
|
inheritAttrs: !1
|
|
531
|
-
},
|
|
532
|
-
...
|
|
538
|
+
}, gt = /* @__PURE__ */ K({
|
|
539
|
+
...ht,
|
|
533
540
|
__name: "VirtualList",
|
|
534
541
|
props: {
|
|
535
542
|
data: null,
|
|
@@ -538,32 +545,32 @@ const xe = (e, t) => {
|
|
|
538
545
|
},
|
|
539
546
|
emits: ["scrollEnd"],
|
|
540
547
|
setup(e, { expose: t, emit: l }) {
|
|
541
|
-
const n = e, r =
|
|
542
|
-
itemHeight: (
|
|
548
|
+
const n = e, r = at(Ve(n, "data"), {
|
|
549
|
+
itemHeight: (v) => n.itemHeight(n.data[v]),
|
|
543
550
|
overscan: n.overscan,
|
|
544
551
|
scrollEndHook: () => {
|
|
545
552
|
l("scrollEnd");
|
|
546
553
|
}
|
|
547
|
-
}), { list:
|
|
554
|
+
}), { list: i, containerProps: o, wrapperProps: d, innerProps: m, getItemHeightData: f } = r;
|
|
548
555
|
return t({
|
|
549
556
|
vListReturn: r
|
|
550
|
-
}), (
|
|
551
|
-
|
|
552
|
-
onScrollPassive:
|
|
553
|
-
ref:
|
|
557
|
+
}), (v, p) => (I(), R("div", pt, [
|
|
558
|
+
T("div", Ke({
|
|
559
|
+
onScrollPassive: p[0] || (p[0] = (...s) => w(o).onScroll && w(o).onScroll(...s)),
|
|
560
|
+
ref: w(o).ref,
|
|
554
561
|
class: "virtualList"
|
|
555
|
-
},
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
(
|
|
562
|
+
}, v.$attrs), [
|
|
563
|
+
T("div", te(le(w(d))), [
|
|
564
|
+
T("div", te(le(w(m))), [
|
|
565
|
+
(I(!0), R(je, null, ze(w(i), ({ index: s, data: u }) => (I(), R("div", {
|
|
559
566
|
key: s,
|
|
560
567
|
style: ee({
|
|
561
|
-
height: `${
|
|
568
|
+
height: `${w(f)(s).height}px`,
|
|
562
569
|
display: "flex"
|
|
563
570
|
})
|
|
564
571
|
}, [
|
|
565
|
-
Z(
|
|
566
|
-
data:
|
|
572
|
+
Z(v.$slots, "default", {
|
|
573
|
+
data: u,
|
|
567
574
|
index: s
|
|
568
575
|
}, void 0, !0)
|
|
569
576
|
], 4))), 128))
|
|
@@ -573,14 +580,14 @@ const xe = (e, t) => {
|
|
|
573
580
|
]));
|
|
574
581
|
}
|
|
575
582
|
});
|
|
576
|
-
const
|
|
583
|
+
const Ot = /* @__PURE__ */ xe(gt, [["__scopeId", "data-v-b228d073"]]);
|
|
577
584
|
export {
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
585
|
+
St as ScrollBar,
|
|
586
|
+
wt as SvgIcon,
|
|
587
|
+
Ot as VirtualList,
|
|
581
588
|
be as allSelectedKey,
|
|
582
|
-
|
|
583
|
-
|
|
589
|
+
it as closeDialogKey,
|
|
590
|
+
yt as dialogController,
|
|
584
591
|
Se as isAllSelectedKey,
|
|
585
592
|
me as isSelectedKey,
|
|
586
593
|
ye as selectAllKey,
|
|
@@ -589,7 +596,7 @@ export {
|
|
|
589
596
|
ge as toggleKey,
|
|
590
597
|
Oe as unselectAllKey,
|
|
591
598
|
we as unselectKey,
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
599
|
+
_t as useSelectable,
|
|
600
|
+
bt as useSelectableInjectors,
|
|
601
|
+
at as useVirtualList
|
|
595
602
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(h,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(h=typeof globalThis<"u"?globalThis:h||self,e(h.ui={},h.Vue))})(this,function(h,e){"use strict";var X;const E=typeof window<"u";E&&((X=window?.navigator)==null?void 0:X.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function A(t){return typeof t=="function"?t():e.unref(t)}function se(t,l){function n(...o){t(()=>l.apply(this,o),{fn:l,thisArg:this,args:o})}return n}function ce(t,l={}){let n,o;return a=>{const r=A(t),d=A(l.maxWait);if(n&&clearTimeout(n),r<=0||d!==void 0&&d<=0)return o&&(clearTimeout(o),o=null),a();d&&!o&&(o=setTimeout(()=>{n&&clearTimeout(n),o=null,a()},d)),n=setTimeout(()=>{o&&clearTimeout(o),o=null,a()},r)}}function ue(t){return t}function de(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function Z(t,l=200,n={}){return se(ce(l,n),t)}function fe(t,l=!0){e.getCurrentInstance()?e.onMounted(t):l?t():e.nextTick(t)}function ee(t){var l;const n=A(t);return(l=n?.$el)!=null?l:n}const pe=E?window:void 0;E&&window.document,E&&window.navigator,E&&window.location;function he(t,l=!1){const n=e.ref(),o=()=>n.value=Boolean(t());return o(),fe(o,l),n}const k=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},j="__vueuse_ssr_handlers__";k[j]=k[j]||{},k[j];var te=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable,ve=(t,l)=>{var n={};for(var o in t)me.call(t,o)&&l.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&te)for(var o of te(t))l.indexOf(o)<0&&ge.call(t,o)&&(n[o]=t[o]);return n};function ye(t,l,n={}){const o=n,{window:i=pe}=o,a=ve(o,["window"]);let r;const d=he(()=>i&&"ResizeObserver"in i),g=()=>{r&&(r.disconnect(),r=void 0)},m=e.watch(()=>ee(t),p=>{g(),d.value&&i&&p&&(r=new ResizeObserver(l),r.observe(p,a))},{immediate:!0,flush:"post"}),f=()=>{g(),m()};return de(f),{isSupported:d,stop:f}}function be(t,l={width:0,height:0},n={}){const{box:o="content-box"}=n,i=e.ref(l.width),a=e.ref(l.height);return ye(t,([r])=>{const d=o==="border-box"?r.borderBoxSize:o==="content-box"?r.contentBoxSize:r.devicePixelContentBoxSize;d?(i.value=d.reduce((g,{inlineSize:m})=>g+m,0),a.value=d.reduce((g,{blockSize:m})=>g+m,0)):(i.value=r.contentRect.width,a.value=r.contentRect.height)},n),e.watch(()=>ee(t),r=>{i.value=r?l.width:0,a.value=r?l.height:0}),{width:i,height:a}}var le;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})(le||(le={}));var _e=Object.defineProperty,ne=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable,oe=(t,l,n)=>l in t?_e(t,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[l]=n,Oe=(t,l)=>{for(var n in l||(l={}))Se.call(l,n)&&oe(t,n,l[n]);if(ne)for(var n of ne(l))we.call(l,n)&&oe(t,n,l[n]);return t};Oe({linear:ue},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});function re(t,l){const{scrollEndHook:n,itemHeight:o,overscan:i=5}=l,a=e.ref(),r=be(a),d=e.ref(!0),g=Z(W,100);let m;const f=e.shallowRef(t),p=e.ref(0),s=e.ref({start:0,end:10});let y=0;const w=e.ref([]),_=e.computed(()=>{let{sum:c,height:u}={sum:0,height:0};return f.value.map((b,v)=>(typeof o=="number"?u=o:u=o(v),c+=u,{height:u,sum:c}))}),O=e.computed(()=>q(s.value.start)),I=e.computed(()=>typeof o=="number"?_.value.length*o:_.value[_.value.length-1]?.sum||0),Q=e.computed(()=>{let c=w.value.length-i,u=Math.max(c-y,0);return w.value.slice(u,c)});e.onMounted(()=>{}),e.onUnmounted(()=>cancelAnimationFrame(m)),e.watch([r.width,r.height,f],([c,u])=>{(c||u)&&H()},{deep:!0}),e.watch(p,()=>{U(),g()});function U(){d.value=!1}function W(){d.value=!0,n?.()}function H(){cancelAnimationFrame(m),m=requestAnimationFrame(T)}function T(){if(a.value){p.value=a.value.scrollTop,y=C();let c=B(p.value),u=c+y+i;c=c-i,c=c<0?0:c,u=u>f.value.length?f.value.length:u,s.value={start:c,end:u},w.value=f.value.slice(c,u).map((b,v)=>({data:b,index:v+c}))}}function B(c){let u=Math.floor(_.value.length/16),b=-1,v=-1;for(let S=0;S<16;S++){if(_.value[u*S].sum>=c){b=Math.max(0,S-1);break}S===15&&(b=S)}b*=u;for(let S=b;S<_.value.length;S++)if(_.value[S].sum>=c){v=S;break}return Math.max(0,v)}function C(){let c=0,u=0,b=Y();for(let v=b;v<_.value.length&&(c++,u+=_.value[v].height,!(u>=r.height.value));v++);return c}function q(c){if(typeof o=="number")return c*o;let u=_.value[c];return u.sum-u.height}function P(c){return _.value[c]||{sum:0,height:0}}function Y(){let c=s.value.start;return c>=i&&(c+=i),c}function G(c){if(a.value){const u=P(c);a.value.scrollTop=u.sum-u.height,T()}}const R=e.computed(()=>({style:{width:"100%",height:`${I.value}px`}})),J=e.computed(()=>({style:{transform:`translate3d(0, ${O.value}px, 0)`,"will-change":"transform"}})),x={overflowY:"auto"};return{list:w,visiableList:Q,getItemHeightData:P,totalHeight:I,clientHeight:r.height,scrollTo:G,scrollTop:p,isScrollEnd:d,containerProps:{ref:a,onScroll:()=>{H()},style:x},wrapperProps:R,innerProps:J}}const K=Symbol(),L=Symbol(),V=Symbol(),$=Symbol(),F=Symbol(),D=Symbol(),N=Symbol(),M=Symbol(),z=Symbol();function Ee(){const{voidFn:t,boolFn:l,boolRef:n,arrayRef:o}={voidFn:y=>{},boolFn:y=>!1,boolRef:e.computed(()=>!1),arrayRef:e.computed(()=>[])},i=e.inject($,o),a=e.inject(V,l),r=e.inject(M,n),d=e.inject(L,t),g=e.inject(K,t),m=e.inject(F,t),f=e.inject(D,t),p=e.inject(N,t),s=e.inject(z,t);return{selected:i,isSelected:a,isAllSelected:r,toggle:d,toggleAll:g,select:m,selectAll:f,unselect:p,unselectAll:s}}function Ie(t,l){const n=e.ref({}),o=e.computed(()=>t.value.filter(s=>n.value[s[l]])),i=e.computed(()=>o.value.length!=0&&Object.keys(n.value).length==t.value.length);function a(){t.value.forEach(s=>{n.value[s[l]]=!0})}function r(){n.value={}}function d(s){s.forEach(y=>{n.value[y[l]]||(n.value[y[l]]=!0)})}function g(s){s.forEach(y=>{n.value[y[l]]&&delete n.value[y[l]]})}function m(s){return!!n.value[s[l]]}function f(s){s.forEach(y=>{m(y)?delete n.value[y[l]]:n.value[y[l]]=!0})}function p(){i.value?r():a()}return e.provide(K,p),e.provide(L,f),e.provide(V,m),e.provide($,o),e.provide(F,d),e.provide(D,a),e.provide(N,g),e.provide(M,i),e.provide(z,r),{selected:o,select:d,selectAll:a,unselect:g,unselectAll:r,toggle:f,toggleAll:p,isSelected:m,isAllSelected:i}}const ie=Symbol(),Be=e.defineComponent({__name:"Dialog",props:{visiable:{type:Boolean,default:!1},closeOnClickOverlay:{type:Boolean,default:!0},dialogClass:{default:""}},emits:["update:visiable"],setup(t,{emit:l}){const n=t,o=()=>{n.closeOnClickOverlay&&l("update:visiable",!1)};return e.provide(ie,()=>l("update:visiable",!1)),(i,a)=>(e.openBlock(),e.createBlock(e.Transition,{name:"modal"},{default:e.withCtx(()=>[t.visiable?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:o,class:"modal absolute inset-0 bottom-0 z-50 flex bg-stone-900 bg-opacity-50"},[e.createElementVNode("div",{onClick:a[0]||(a[0]=e.withModifiers(()=>{},["stop"])),class:e.normalizeClass(["dialog m-auto flex flex-col",t.dialogClass])},[e.renderSlot(i.$slots,"default")],2)])):e.createCommentVNode("",!0)]),_:3}))}});function He(t){function l(n,o){const i=document.createElement("div"),a={setup(){return()=>e.h(Be,{visiable:!0,"onUpdate:visiable":()=>{i?.remove()},...t},{default:()=>e.h(n,o)})}};return document.body.appendChild(i),e.render(e.h(a),i),{close:()=>i?.remove()}}return{create:l}}const Te=["xlink:href","fill","color"],Ce=e.defineComponent({__name:"SvgIcon",props:{name:null,prefix:{default:"icon"},color:{default:"#FFF"},width:null,height:null},setup(t){const l=t,n=e.computed(()=>`#${l.prefix}-${l.name}`),o=e.computed(()=>({width:l.width,height:l.height,aspectRatio:l.width&&l.height?void 0:"1/1"}));return(i,a)=>(e.openBlock(),e.createElementBlock("svg",{"aria-hidden":"",style:e.normalizeStyle(e.unref(o))},[e.createElementVNode("use",{"xlink:href":e.unref(n),fill:t.color,color:t.color},null,8,Te)],4))}});function Pe(t){const{containerEl:l,sliderEl:n,autoHeight:o,performance:i={}}=t,a=e.ref(!0),r=Z(C,100);let d,g="";const m=e.ref(0),f=e.ref(0),p=e.ref(0),s=e.ref({top:0,scrollTop:0,scrollHeight:0,clientHeight:0}),y=e.ref({clientHeight:0}),w=e.computed(()=>!!f.value),_=e.computed(()=>s.value.scrollHeight>s.value.clientHeight),O=e.computed(()=>s.value.clientHeight-y.value.clientHeight),I=e.computed(()=>s.value.scrollHeight-s.value.clientHeight),Q=e.computed(()=>Math.max(s.value.clientHeight/s.value.scrollHeight,.05)),U=e.computed(()=>Q.value*s.value.clientHeight),W=e.computed(()=>({willChange:"transform",transform:`translate3d(0,${p.value}px,0)`,height:o?`${U.value}px`:void 0}));function H(b){B(),f.value=b.clientY-n.value.getBoundingClientRect().top||1,g=getComputedStyle(l.value).scrollBehavior,g==="smooth"&&(l.value.style.scrollBehavior="unset")}function T(){l.value.style.scrollBehavior=g,f.value=0,r()}function B(){a.value=!1}function C(){w.value||(a.value=!0)}function q(b){if(!w.value)return;let v=b.clientY-s.value.top-f.value;v<0?p.value=0:v>=O.value?p.value=O.value:p.value=v,l.value.scrollTo({top:p.value/O.value*I.value})}function P(){w.value||Y()}function Y(){cancelAnimationFrame(d),d=requestAnimationFrame(G)}function G(){l.value&&(m.value=i.scrollTop?.value??l.value.scrollTop,p.value=m.value/I.value*O.value)}function R(b){let v="addEventListener";b==="add"?v="addEventListener":v="removeEventListener",n.value?.[v]("pointerdown",H,{passive:!0}),window[v]("pointermove",q,{passive:!0}),window[v]("pointerup",T,{passive:!0})}const J=new MutationObserver(b=>{b.map(S=>S.oldValue).join().includes("height")&&x()});function x(){s.value.top=l.value?.getBoundingClientRect().top??0,s.value.scrollHeight=l.value?.scrollHeight??0,s.value.clientHeight=l.value?.clientHeight??0}function c(){B(),setTimeout(()=>{y.value.clientHeight=n.value?.clientHeight??0,C()},150)}function u(){l.value&&n.value?(l.value.addEventListener("scroll",P,{passive:!0}),R("add"),J.observe(l.value,{subtree:!0,attributeOldValue:!0,attributeFilter:["style"]}),setTimeout(()=>{x()},100),c()):console.error("useScrollBar:","\u521D\u59CB\u5316\u5931\u8D25!",{containerEl:l,sliderEl:n})}return e.watch(m,()=>{B(),r()}),{isScrollEnd:a,isDragSlider:w,scrollable:_,sliderPos:W,init:u,modifySliderEventListener:R}}const Re=(t=>(e.pushScopeId("data-v-e4f66100"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("div",{class:"default-slider"},null,-1)),xe=e.defineComponent({__name:"ScrollBar",props:{containerEl:null,autoHide:{type:Boolean},autoHeight:{type:Boolean},performance:null},setup(t,{expose:l}){const n=t,o=!!e.useSlots().default,i=e.ref(null),a=e.computed(()=>n.containerEl),r=Pe({containerEl:a,sliderEl:i,autoHeight:o?n.autoHeight:!0,performance:n.performance}),{scrollable:d,isScrollEnd:g,sliderPos:m}=r,f=n.autoHide?e.computed(()=>!g.value):e.computed(()=>d.value);return e.onMounted(()=>{e.nextTick(()=>{r.init()})}),e.onUnmounted(()=>{r.modifySliderEventListener("remove")}),l({uScrollBarReturn:r}),(p,s)=>(e.openBlock(),e.createBlock(e.Transition,null,{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"sliderRef",ref:i,class:"slider-wrapper",style:e.normalizeStyle(e.unref(m))},[e.renderSlot(p.$slots,"default",{},()=>[Re],!0)],4),[[e.vShow,e.unref(f)]])]),_:3}))}}),Fe="",ae=(t,l)=>{const n=t.__vccOpts||t;for(const[o,i]of l)n[o]=i;return n},Ae=ae(xe,[["__scopeId","data-v-e4f66100"]]),ke={class:"virtualListWrapper"},je={inheritAttrs:!1},Ke=e.defineComponent({...je,__name:"VirtualList",props:{data:null,itemHeight:null,overscan:{default:10}},emits:["scrollEnd"],setup(t,{expose:l,emit:n}){const o=t,i=re(e.toRef(o,"data"),{itemHeight:f=>o.itemHeight(o.data[f]),overscan:o.overscan,scrollEndHook:()=>{n("scrollEnd")}}),{list:a,containerProps:r,wrapperProps:d,innerProps:g,getItemHeightData:m}=i;return l({vListReturn:i}),(f,p)=>(e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",e.mergeProps({onScrollPassive:p[0]||(p[0]=(...s)=>e.unref(r).onScroll&&e.unref(r).onScroll(...s)),ref:e.unref(r).ref,class:"virtualList"},f.$attrs),[e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(e.unref(d))),[e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(e.unref(g))),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),({index:s,data:y})=>(e.openBlock(),e.createElementBlock("div",{key:s,style:e.normalizeStyle({height:`${e.unref(m)(s).height}px`,display:"flex"})},[e.renderSlot(f.$slots,"default",{data:y,index:s},void 0,!0)],4))),128))],16)],16)],16)]))}}),De="",Le=ae(Ke,[["__scopeId","data-v-b228d073"]]);h.ScrollBar=Ae,h.SvgIcon=Ce,h.VirtualList=Le,h.allSelectedKey=$,h.closeDialogKey=ie,h.dialogController=He,h.isAllSelectedKey=M,h.isSelectedKey=V,h.selectAllKey=D,h.selectKey=F,h.toggleAllKey=K,h.toggleKey=L,h.unselectAllKey=z,h.unselectKey=N,h.useSelectable=Ie,h.useSelectableInjectors=Ee,h.useVirtualList=re,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(h,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(h=typeof globalThis<"u"?globalThis:h||self,e(h.ui={},h.Vue))})(this,function(h,e){"use strict";var X;const E=typeof window<"u";E&&((X=window?.navigator)==null?void 0:X.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function A(t){return typeof t=="function"?t():e.unref(t)}function se(t,l){function n(...o){t(()=>l.apply(this,o),{fn:l,thisArg:this,args:o})}return n}function ce(t,l={}){let n,o;return s=>{const r=A(t),f=A(l.maxWait);if(n&&clearTimeout(n),r<=0||f!==void 0&&f<=0)return o&&(clearTimeout(o),o=null),s();f&&!o&&(o=setTimeout(()=>{n&&clearTimeout(n),o=null,s()},f)),n=setTimeout(()=>{o&&clearTimeout(o),o=null,s()},r)}}function ue(t){return t}function de(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function Z(t,l=200,n={}){return se(ce(l,n),t)}function fe(t,l=!0){e.getCurrentInstance()?e.onMounted(t):l?t():e.nextTick(t)}function ee(t){var l;const n=A(t);return(l=n?.$el)!=null?l:n}const pe=E?window:void 0;E&&window.document,E&&window.navigator,E&&window.location;function he(t,l=!1){const n=e.ref(),o=()=>n.value=Boolean(t());return o(),fe(o,l),n}const k=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},j="__vueuse_ssr_handlers__";k[j]=k[j]||{},k[j];var te=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable,ve=(t,l)=>{var n={};for(var o in t)me.call(t,o)&&l.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&te)for(var o of te(t))l.indexOf(o)<0&&ge.call(t,o)&&(n[o]=t[o]);return n};function ye(t,l,n={}){const o=n,{window:i=pe}=o,s=ve(o,["window"]);let r;const f=he(()=>i&&"ResizeObserver"in i),y=()=>{r&&(r.disconnect(),r=void 0)},m=e.watch(()=>ee(t),g=>{y(),f.value&&i&&g&&(r=new ResizeObserver(l),r.observe(g,s))},{immediate:!0,flush:"post"}),p=()=>{y(),m()};return de(p),{isSupported:f,stop:p}}function be(t,l={width:0,height:0},n={}){const{box:o="content-box"}=n,i=e.ref(l.width),s=e.ref(l.height);return ye(t,([r])=>{const f=o==="border-box"?r.borderBoxSize:o==="content-box"?r.contentBoxSize:r.devicePixelContentBoxSize;f?(i.value=f.reduce((y,{inlineSize:m})=>y+m,0),s.value=f.reduce((y,{blockSize:m})=>y+m,0)):(i.value=r.contentRect.width,s.value=r.contentRect.height)},n),e.watch(()=>ee(t),r=>{i.value=r?l.width:0,s.value=r?l.height:0}),{width:i,height:s}}var le;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})(le||(le={}));var _e=Object.defineProperty,ne=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable,oe=(t,l,n)=>l in t?_e(t,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[l]=n,Oe=(t,l)=>{for(var n in l||(l={}))Se.call(l,n)&&oe(t,n,l[n]);if(ne)for(var n of ne(l))we.call(l,n)&&oe(t,n,l[n]);return t};Oe({linear:ue},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});function re(t,l){const{scrollEndHook:n,itemHeight:o,overscan:i=5}=l,s=e.ref(),r=be(s),f=e.ref(!0),y=Z(U,100);let m;const p=e.shallowRef(t),g=e.ref(0),c=e.ref({start:0,end:10});let u=0;const w=e.ref([]),_=e.computed(()=>{let{sum:a,height:d}={sum:0,height:0};return p.value.map((S,b)=>(typeof o=="number"?d=o:d=o(b),a+=d,{height:d,sum:a}))}),Q=e.computed(()=>P(c.value.start)),O=e.computed(()=>typeof o=="number"?_.value.length*o:_.value[_.value.length-1]?.sum||0),B=e.computed(()=>{let a=w.value.length-i,d=Math.max(a-u,0);return w.value.slice(d,a)});e.onMounted(()=>{}),e.onUnmounted(()=>cancelAnimationFrame(m)),e.watch([r.width,r.height,p],([a,d])=>{(a||d)&&T()},{deep:!0}),e.watch(g,()=>{H(),y()});function H(){f.value=!1}function U(){f.value=!0,n?.()}function T(){cancelAnimationFrame(m),m=requestAnimationFrame(C)}function C(){if(s.value){g.value=s.value.scrollTop,u=I();let a=W(g.value),d=a+u+i;a=a-i,a=a<0?0:a,d=d>p.value.length?p.value.length:d,c.value={start:a,end:d},w.value=p.value.slice(a,d).map((S,b)=>({data:S,index:b+a}))}}function W(a){let d=Math.floor(_.value.length/16),S=-1,b=-1;for(let v=0;v<16;v++){if(_.value[d*v].sum>=a){S=Math.max(0,v-1);break}v===15&&(S=v)}S*=d;for(let v=S;v<_.value.length;v++)if(_.value[v].sum>=a){b=v;break}return Math.max(0,b)}function I(){let a=0,d=0,S=q();for(let b=S;b<_.value.length&&(a++,d+=_.value[b].height,!(d>=r.height.value));b++);return a}function P(a){if(typeof o=="number")return a*o;let d=_.value[a];return d?d.sum-d.height:0}function R(a){return _.value[a]||{sum:0,height:0}}function q(){let a=c.value.start;return a>=i&&(a+=i),a}function Y(a){if(s.value){const d=R(a);s.value.scrollTop=d.sum-d.height,C()}}const G=e.computed(()=>({style:{width:"100%",height:`${O.value}px`,pointerEvents:f.value?void 0:"none"}})),x=e.computed(()=>({style:{transform:`translate3d(0, ${Q.value}px, 0)`,"will-change":"transform"}})),J={overflowY:"auto"};return{list:w,visiableList:B,getItemHeightData:R,totalHeight:O,clientHeight:r.height,scrollTo:Y,scrollTop:g,isScrollEnd:f,containerProps:{ref:s,onScroll:()=>{T()},style:J},wrapperProps:G,innerProps:x}}const K=Symbol(),L=Symbol(),V=Symbol(),$=Symbol(),F=Symbol(),D=Symbol(),N=Symbol(),M=Symbol(),z=Symbol();function Ee(){const{voidFn:t,boolFn:l,boolRef:n,arrayRef:o}={voidFn:u=>{},boolFn:u=>!1,boolRef:e.computed(()=>!1),arrayRef:e.computed(()=>[])},i=e.inject($,o),s=e.inject(V,l),r=e.inject(M,n),f=e.inject(L,t),y=e.inject(K,t),m=e.inject(F,t),p=e.inject(D,t),g=e.inject(N,t),c=e.inject(z,t);return{selected:i,isSelected:s,isAllSelected:r,toggle:f,toggleAll:y,select:m,selectAll:p,unselect:g,unselectAll:c}}function Ie(t,l){const n=e.ref({}),o=e.computed(()=>t.value.filter(c=>n.value[c[l]])),i=e.computed(()=>o.value.length!=0&&Object.keys(n.value).length==t.value.length);function s(){t.value.forEach(c=>{n.value[c[l]]=!0})}function r(){n.value={}}function f(c){c.forEach(u=>{n.value[u[l]]||(n.value[u[l]]=!0)})}function y(c){c.forEach(u=>{n.value[u[l]]&&delete n.value[u[l]]})}function m(c){return!!n.value[c[l]]}function p(c){c.forEach(u=>{m(u)?delete n.value[u[l]]:n.value[u[l]]=!0})}function g(){i.value?r():s()}return e.provide(K,g),e.provide(L,p),e.provide(V,m),e.provide($,o),e.provide(F,f),e.provide(D,s),e.provide(N,y),e.provide(M,i),e.provide(z,r),{selected:o,select:f,selectAll:s,unselect:y,unselectAll:r,toggle:p,toggleAll:g,isSelected:m,isAllSelected:i}}const ie=Symbol(),Be=e.defineComponent({__name:"Dialog",props:{visiable:{type:Boolean,default:!1},closeOnClickOverlay:{type:Boolean,default:!0},dialogClass:{default:""}},emits:["update:visiable"],setup(t,{emit:l}){const n=t,o=()=>{n.closeOnClickOverlay&&l("update:visiable",!1)};return e.provide(ie,()=>l("update:visiable",!1)),(i,s)=>(e.openBlock(),e.createBlock(e.Transition,{name:"modal"},{default:e.withCtx(()=>[t.visiable?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:o,class:"modal absolute inset-0 bottom-0 z-50 flex bg-stone-900 bg-opacity-50"},[e.createElementVNode("div",{onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"])),class:e.normalizeClass(["dialog m-auto flex flex-col",t.dialogClass])},[e.renderSlot(i.$slots,"default")],2)])):e.createCommentVNode("",!0)]),_:3}))}});function He(t){function l(n,o){const i=document.createElement("div"),s={setup(){return()=>e.h(Be,{visiable:!0,"onUpdate:visiable":()=>{i?.remove()},...t},{default:()=>e.h(n,o)})}};return document.body.appendChild(i),e.render(e.h(s),i),{close:()=>i?.remove()}}return{create:l}}const Te=["xlink:href","fill","color"],Ce=e.defineComponent({__name:"SvgIcon",props:{name:null,prefix:{default:"icon"},color:{default:"#FFF"},width:null,height:null},setup(t){const l=t,n=e.computed(()=>`#${l.prefix}-${l.name}`),o=e.computed(()=>({width:l.width,height:l.height,aspectRatio:l.width&&l.height?void 0:"1/1"}));return(i,s)=>(e.openBlock(),e.createElementBlock("svg",{"aria-hidden":"",style:e.normalizeStyle(e.unref(o))},[e.createElementVNode("use",{"xlink:href":e.unref(n),fill:t.color,color:t.color},null,8,Te)],4))}});function Pe(t){const{containerEl:l,sliderEl:n,autoHeight:o,performance:i={},maxHeightRatio:s=.9}=t,r=e.ref(!0),f=Z(P,100);let y,m="";const p=e.ref(0),g=e.ref(0),c=e.ref(0),u=e.ref({top:0,scrollTop:0,scrollHeight:0,clientHeight:0}),w=e.ref({clientHeight:0}),_=e.computed(()=>!!g.value),Q=e.computed(()=>u.value.scrollHeight>u.value.clientHeight),O=e.computed(()=>u.value.clientHeight-w.value.clientHeight),B=e.computed(()=>u.value.scrollHeight-u.value.clientHeight),H=e.computed(()=>Math.max(u.value.clientHeight/u.value.scrollHeight,.05)),U=e.computed(()=>H.value>s?0:H.value*u.value.clientHeight),T=e.computed(()=>({willChange:"transform",transform:`translate3d(0,${c.value}px,0)`,height:o?`${U.value}px`:void 0}));function C(b){I(),g.value=b.clientY-n.value.getBoundingClientRect().top||1,m=getComputedStyle(l.value).scrollBehavior,m==="smooth"&&(l.value.style.scrollBehavior="unset")}function W(){l.value.style.scrollBehavior=m,g.value=0,f()}function I(){r.value=!1}function P(){_.value||(r.value=!0)}function R(b){if(!_.value)return;let v=b.clientY-u.value.top-g.value;v<0?c.value=0:v>=O.value?c.value=O.value:c.value=v,l.value.scrollTo({top:c.value/O.value*B.value})}function q(){_.value||Y()}function Y(){cancelAnimationFrame(y),y=requestAnimationFrame(G)}function G(){l.value&&(p.value=i.scrollTop?.value??l.value.scrollTop,c.value=p.value/B.value*O.value)}function x(b){let v="addEventListener";b==="add"?v="addEventListener":v="removeEventListener",n.value?.[v]("pointerdown",C,{passive:!0}),window[v]("pointermove",R,{passive:!0}),window[v]("pointerup",W,{passive:!0})}const J=new MutationObserver(b=>{b.map(Ve=>Ve.oldValue).join().includes("height")&&a()});function a(){u.value.top=l.value?.getBoundingClientRect().top??0,u.value.scrollHeight=l.value?.scrollHeight??0,u.value.clientHeight=l.value?.clientHeight??0}function d(){I(),setTimeout(()=>{w.value.clientHeight=n.value?.clientHeight??0,P()},150)}function S(){l.value&&n.value?(l.value.addEventListener("scroll",q,{passive:!0}),x("add"),J.observe(l.value,{subtree:!0,attributeOldValue:!0,attributeFilter:["style"]}),setTimeout(()=>{a()},100),d()):console.error("useScrollBar:","\u521D\u59CB\u5316\u5931\u8D25!",{containerEl:l,sliderEl:n})}return e.watch(p,()=>{I(),f()}),{isScrollEnd:r,isDragSlider:_,scrollable:Q,sliderPos:T,init:S,modifySliderEventListener:x}}const Re=(t=>(e.pushScopeId("data-v-e4f66100"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("div",{class:"default-slider"},null,-1)),xe=e.defineComponent({__name:"ScrollBar",props:{containerEl:null,autoHide:{type:Boolean},autoHeight:{type:Boolean},performance:null},setup(t,{expose:l}){const n=t,o=!!e.useSlots().default,i=e.ref(null),s=e.computed(()=>n.containerEl),r=Pe({containerEl:s,sliderEl:i,autoHeight:o?n.autoHeight:!0,performance:n.performance}),{scrollable:f,isScrollEnd:y,sliderPos:m}=r,p=n.autoHide?e.computed(()=>!y.value):e.computed(()=>f.value);return e.onMounted(()=>{e.nextTick(()=>{r.init()})}),e.onUnmounted(()=>{r.modifySliderEventListener("remove")}),l({uScrollBarReturn:r}),(g,c)=>(e.openBlock(),e.createBlock(e.Transition,null,{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"sliderRef",ref:i,class:"slider-wrapper",style:e.normalizeStyle(e.unref(m))},[e.renderSlot(g.$slots,"default",{},()=>[Re],!0)],4),[[e.vShow,e.unref(p)]])]),_:3}))}}),De="",ae=(t,l)=>{const n=t.__vccOpts||t;for(const[o,i]of l)n[o]=i;return n},Ae=ae(xe,[["__scopeId","data-v-e4f66100"]]),ke={class:"virtualListWrapper"},je={inheritAttrs:!1},Ke=e.defineComponent({...je,__name:"VirtualList",props:{data:null,itemHeight:null,overscan:{default:10}},emits:["scrollEnd"],setup(t,{expose:l,emit:n}){const o=t,i=re(e.toRef(o,"data"),{itemHeight:p=>o.itemHeight(o.data[p]),overscan:o.overscan,scrollEndHook:()=>{n("scrollEnd")}}),{list:s,containerProps:r,wrapperProps:f,innerProps:y,getItemHeightData:m}=i;return l({vListReturn:i}),(p,g)=>(e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",e.mergeProps({onScrollPassive:g[0]||(g[0]=(...c)=>e.unref(r).onScroll&&e.unref(r).onScroll(...c)),ref:e.unref(r).ref,class:"virtualList"},p.$attrs),[e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(e.unref(f))),[e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(e.unref(y))),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),({index:c,data:u})=>(e.openBlock(),e.createElementBlock("div",{key:c,style:e.normalizeStyle({height:`${e.unref(m)(c).height}px`,display:"flex"})},[e.renderSlot(p.$slots,"default",{data:u,index:c},void 0,!0)],4))),128))],16)],16)],16)]))}}),Ne="",Le=ae(Ke,[["__scopeId","data-v-b228d073"]]);h.ScrollBar=Ae,h.SvgIcon=Ce,h.VirtualList=Le,h.allSelectedKey=$,h.closeDialogKey=ie,h.dialogController=He,h.isAllSelectedKey=M,h.isSelectedKey=V,h.selectAllKey=D,h.selectKey=F,h.toggleAllKey=K,h.toggleKey=L,h.unselectAllKey=z,h.unselectKey=N,h.useSelectable=Ie,h.useSelectableInjectors=Ee,h.useVirtualList=re,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|