@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 I, getCurrentScope as je, onScopeDispose as Qe, getCurrentInstance as Ue, onMounted as ce, nextTick as we, ref as w, watch as te, shallowRef as qe, computed as E, onUnmounted as _e, inject as P, provide as A, defineComponent as le, h as Z, render as xe, openBlock as j, createBlock as Te, Transition as Oe, withCtx as Re, createElementBlock as ee, createElementVNode as Q, withModifiers as We, normalizeClass as Ye, renderSlot as ve, createCommentVNode as Ge, normalizeStyle as de, useSlots as Xe, withDirectives as Je, vShow as Ze, pushScopeId as et, popScopeId as tt, toRef as lt, mergeProps as nt, normalizeProps as he, guardReactiveProps as pe, Fragment as ot, renderList as rt } from "vue";
2
- var me;
3
- const De = typeof window < "u";
4
- De && ((me = window?.navigator) == null ? void 0 : me.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
5
- function re(e) {
6
- return typeof e == "function" ? e() : I(e);
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 Be(e, t) {
9
- function n(...l) {
10
- e(() => t.apply(this, l), { fn: t, thisArg: this, args: l });
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 ut(e, t = {}) {
15
- let n, l;
16
- return (u) => {
17
- const r = re(e), c = re(t.maxWait);
18
- if (n && clearTimeout(n), r <= 0 || c !== void 0 && c <= 0)
19
- return l && (clearTimeout(l), l = null), u();
20
- c && !l && (l = setTimeout(() => {
21
- n && clearTimeout(n), l = null, u();
22
- }, c)), n = setTimeout(() => {
23
- l && clearTimeout(l), l = null, u();
24
- }, r);
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 at(e, t = !0, n = !0) {
28
- let l = 0, o, u = !0;
29
- const r = () => {
30
- o && (clearTimeout(o), o = void 0);
31
- };
32
- return (g) => {
33
- const p = re(e), d = Date.now() - l;
34
- if (r(), p <= 0)
35
- return l = Date.now(), g();
36
- d > p && (n || !u) ? (l = Date.now(), g()) : t && (o = setTimeout(() => {
37
- l = Date.now(), u = !0, r(), g();
38
- }, p)), !n && !o && (o = setTimeout(() => u = !0, p)), u = !1;
39
- };
40
- }
41
- function st(e) {
42
- return e;
27
+ function qe(t) {
28
+ return t;
43
29
  }
44
- function it(e) {
45
- return je() ? (Qe(e), !0) : !1;
30
+ function Ye(t) {
31
+ return Ce() ? (Be(t), !0) : !1;
46
32
  }
47
- function Ce(e, t = 200, n = {}) {
48
- return Be(ut(t, n), e);
33
+ function me(t, e = 200, n = {}) {
34
+ return Qe(Ue(e, n), t);
49
35
  }
50
- function ge(e, t = 200, n = !1, l = !0) {
51
- return Be(at(t, n, l), e);
36
+ function Ge(t, e = !0) {
37
+ Pe() ? te(t) : e ? t() : ne(t);
52
38
  }
53
- function ct(e, t = !0) {
54
- Ue() ? ce(e) : t ? e() : we(e);
39
+ function ge(t) {
40
+ var e;
41
+ const n = X(t);
42
+ return (e = n?.$el) != null ? e : n;
55
43
  }
56
- function Ie(e) {
57
- var t;
58
- const n = re(e);
59
- return (t = n?.$el) != null ? t : n;
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 vt = De ? window : void 0;
62
- function dt(e, t = !1) {
63
- const n = w(), l = () => n.value = Boolean(e());
64
- return l(), ct(l, t), n;
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 l in e)
72
- ft.call(e, l) && t.indexOf(l) < 0 && (n[l] = e[l]);
73
- if (e != null && ye)
74
- for (var l of ye(e))
75
- t.indexOf(l) < 0 && ht.call(e, l) && (n[l] = e[l]);
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 mt(e, t, n = {}) {
79
- const l = n, { window: o = vt } = l, u = pt(l, ["window"]);
80
- let r;
81
- const c = dt(() => o && "ResizeObserver" in o), g = () => {
82
- r && (r.disconnect(), r = void 0);
83
- }, p = te(() => Ie(e), (i) => {
84
- g(), c.value && o && i && (r = new ResizeObserver(t), r.observe(i, u));
85
- }, { immediate: !0, flush: "post" }), d = () => {
86
- g(), p();
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 it(d), {
89
- isSupported: c,
90
- stop: d
74
+ return Ye(v), {
75
+ isSupported: d,
76
+ stop: v
91
77
  };
92
78
  }
93
- function gt(e, t = { width: 0, height: 0 }, n = {}) {
94
- const { box: l = "content-box" } = n, o = w(t.width), u = w(t.height);
95
- return mt(e, ([r]) => {
96
- const c = l === "border-box" ? r.borderBoxSize : l === "content-box" ? r.contentBoxSize : r.devicePixelContentBoxSize;
97
- c ? (o.value = c.reduce((g, { inlineSize: p }) => g + p, 0), u.value = c.reduce((g, { blockSize: p }) => g + p, 0)) : (o.value = r.contentRect.width, u.value = r.contentRect.height);
98
- }, n), te(() => Ie(e), (r) => {
99
- o.value = r ? t.width : 0, u.value = r ? t.height : 0;
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: o,
102
- height: u
87
+ width: s,
88
+ height: r
103
89
  };
104
90
  }
105
- var be;
106
- (function(e) {
107
- e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
108
- })(be || (be = {}));
109
- var yt = Object.defineProperty, Se = Object.getOwnPropertySymbols, bt = Object.prototype.hasOwnProperty, St = Object.prototype.propertyIsEnumerable, Ee = (e, t, n) => t in e ? yt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Et = (e, t) => {
110
- for (var n in t || (t = {}))
111
- bt.call(t, n) && Ee(e, n, t[n]);
112
- if (Se)
113
- for (var n of Se(t))
114
- St.call(t, n) && Ee(e, n, t[n]);
115
- return e;
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 wt = {
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
- Et({
144
- linear: st
145
- }, wt);
146
- function _t(e, t) {
147
- const { scrollEndHook: n, itemHeight: l, overscan: o = 5 } = t, u = w(null), r = gt(u), c = w(!0), g = Ce(X, 100);
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 d = qe(e), i = w(0), a = w({ start: 0, end: 10 });
150
- let s = 0;
151
- const b = w([]), _ = E(() => {
152
- let { sum: f, height: y } = { sum: 0, height: 0 };
153
- return d.value.map((C, B) => (typeof l == "number" ? y = l : y = l(B), f += y, { height: y, sum: f }));
154
- }), S = E(() => N(a.value.start)), m = E(() => typeof l == "number" ? _.value.length * l : _.value[_.value.length - 1]?.sum || 0), R = E(() => {
155
- let f = b.value.length - o, y = Math.max(f - s, 0);
156
- return b.value.slice(y, f);
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
- ce(() => {
159
- }), _e(() => cancelAnimationFrame(p)), te(
160
- [r.width, r.height, d],
161
- ([f, y]) => {
162
- (f || y) && U();
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
- ), te(i, () => {
166
- H(), g();
151
+ ), $(h, () => {
152
+ D(), m();
167
153
  });
168
- function H() {
169
- c.value = !1;
170
- }
171
- function X() {
172
- c.value = !0, n?.();
154
+ function D() {
155
+ d.value = !1;
173
156
  }
174
- function U() {
175
- cancelAnimationFrame(p), p = requestAnimationFrame(k);
157
+ function Q() {
158
+ d.value = !0, n?.();
176
159
  }
177
160
  function k() {
178
- if (u.value) {
179
- i.value = u.value.scrollTop, s = F();
180
- let f = $(i.value), y = f + s + o;
181
- f = f - o, f = f < 0 ? 0 : f, y = y > d.value.length ? d.value.length : y, a.value = { start: f, end: y }, b.value = d.value.slice(f, y).map((C, B) => ({
182
- data: C,
183
- index: B + f
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 $(f) {
188
- let y = 0, C = _.value.length - 1, B = -1;
189
- for (; y <= C; ) {
190
- const O = Math.floor((y + C) / 2);
191
- _.value[O].sum >= f ? (B = O, C = O - 1) : y = O + 1;
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, B);
179
+ return Math.max(0, y);
194
180
  }
195
- function F() {
196
- let f = 0, y = 0, C = L();
197
- for (let B = C; B < _.value.length && (f++, y += _.value[B].height, !(y >= r.height.value)); B++)
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 f;
185
+ return a;
200
186
  }
201
- function N(f) {
202
- if (typeof l == "number")
203
- return f * l;
204
- let y = _.value[f];
205
- return y ? y.sum - y.height : 0;
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 V(f) {
208
- return _.value[f] || { sum: 0, height: 0 };
193
+ function j(a) {
194
+ return b.value[a] || { sum: 0, height: 0 };
209
195
  }
210
- function L() {
211
- let f = a.value.start;
212
- return f >= o && (f += o), f;
196
+ function U() {
197
+ let a = i.value.start;
198
+ return a >= s && (a += s), a;
213
199
  }
214
- function q(f) {
215
- if (u.value) {
216
- const y = V(f);
217
- u.value.scrollTop = y.sum - y.height, k();
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 J = E(() => ({
206
+ const Y = f(() => ({
221
207
  style: {
222
208
  width: "100%",
223
- height: `${m.value}px`,
224
- pointerEvents: c.value ? void 0 : "none"
209
+ height: `${C.value}px`,
210
+ pointerEvents: d.value ? void 0 : "none"
225
211
  }
226
- })), K = E(() => ({
212
+ })), z = f(() => ({
227
213
  style: {
228
- transform: `translate3d(0, ${S.value}px, 0)`,
214
+ transform: `translate3d(0, ${N.value}px, 0)`,
229
215
  "will-change": "transform"
230
216
  }
231
- })), W = {
217
+ })), G = {
232
218
  overflowY: "auto"
233
219
  };
234
220
  return {
235
- list: b,
236
- visiableList: R,
237
- getItemHeightData: V,
238
- getoffsetTopIndex: $,
239
- totalHeight: m,
240
- clientHeight: r.height,
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: i,
243
- isScrollEnd: c,
228
+ scrollTop: h,
229
+ isScrollEnd: d,
244
230
  containerProps: {
245
- ref: u,
231
+ ref: r,
246
232
  onScroll: () => {
247
- U();
233
+ k();
248
234
  },
249
- style: W
235
+ style: G
250
236
  },
251
- wrapperProps: J,
252
- innerProps: K
237
+ wrapperProps: Y,
238
+ innerProps: z
253
239
  };
254
240
  }
255
- const He = Symbol(), Le = Symbol(), Ae = Symbol(), $e = Symbol(), Me = Symbol(), Pe = Symbol(), Fe = Symbol(), ze = Symbol(), ke = Symbol();
256
- function $t() {
257
- const { voidFn: e, boolFn: t, boolRef: n, arrayRef: l } = {
258
- voidFn: (s) => {
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: (s) => !1,
261
- boolRef: E(() => !1),
262
- arrayRef: E(() => [])
263
- }, o = P($e, l), u = P(Ae, t), r = P(ze, n), c = P(Le, e), g = P(He, e), p = P(Me, e), d = P(Pe, e), i = P(Fe, e), a = P(ke, e);
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: o,
266
- isSelected: u,
267
- isAllSelected: r,
268
- toggle: c,
269
- toggleAll: g,
251
+ selected: s,
252
+ isSelected: r,
253
+ isAllSelected: l,
254
+ toggle: d,
255
+ toggleAll: m,
270
256
  select: p,
271
- selectAll: d,
272
- unselect: i,
273
- unselectAll: a
257
+ selectAll: v,
258
+ unselect: h,
259
+ unselectAll: i
274
260
  };
275
261
  }
276
- function Mt(e, t) {
277
- const n = w({}), l = E(() => e.value.filter((a) => n.value[a[t]])), o = E(() => l.value.length != 0 && Object.keys(n.value).length == e.value.length);
278
- function u() {
279
- e.value.forEach((a) => {
280
- n.value[a[t]] = !0;
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 r() {
269
+ function l() {
284
270
  n.value = {};
285
271
  }
286
- function c(a) {
287
- a.forEach((s) => {
288
- n.value[s[t]] || (n.value[s[t]] = !0);
272
+ function d(i) {
273
+ i.forEach((u) => {
274
+ n.value[u[e]] || (n.value[u[e]] = !0);
289
275
  });
290
276
  }
291
- function g(a) {
292
- a.forEach((s) => {
293
- n.value[s[t]] && delete n.value[s[t]];
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(a) {
297
- return !!n.value[a[t]];
282
+ function p(i) {
283
+ return !!n.value[i[e]];
298
284
  }
299
- function d(a) {
300
- a.forEach((s) => {
301
- p(s) ? delete n.value[s[t]] : n.value[s[t]] = !0;
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 i() {
305
- o.value ? r() : u();
290
+ function h() {
291
+ s.value ? l() : r();
306
292
  }
307
- return A(He, i), A(Le, d), A(Ae, p), A($e, l), A(Me, c), A(Pe, u), A(Fe, g), A(ze, o), A(ke, r), {
308
- selected: l,
309
- select: c,
310
- selectAll: u,
311
- unselect: g,
312
- unselectAll: r,
313
- toggle: d,
314
- toggleAll: i,
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: o
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
- function Ne({
325
- attribute: e,
326
- selectWay: t = "colum",
327
- scrollOptions: n = {},
328
- getSelectMap: l = () => ({})
329
- }) {
330
- const {
331
- select: o = ae("\u9009\u62E9"),
332
- unselect: u = ae("\u53D6\u6D88\u9009\u62E9"),
333
- unselectAll: r = ae("\u53D6\u6D88\u5168\u9009")
334
- } = l();
335
- let c = {};
336
- const g = E(
337
- () => ge(t === "colum" ? z : ne, 50)
338
- ), p = /* @__PURE__ */ new Set(), d = w(!0), i = w(), a = w(!1), s = w({ x: 0, y: 0 }), b = w({ x: 0, y: 0, scrollTop: 0 }), _ = new ResizeObserver(
339
- (v) => S.value = v[0].target.getBoundingClientRect()
340
- ), S = w({}), m = w({
341
- top: 0,
342
- height: 0,
343
- sync(v = !1) {
344
- m.value.top = i.value?.scrollTop || 0, v && (m.value.height = i.value?.scrollHeight || 0);
345
- }
346
- }), R = E(() => a.value ? {
347
- left: Math.min(s.value.x, b.value.x) - S.value.left,
348
- top: Math.min(s.value.y, b.value.y) - S.value.top,
349
- width: Math.abs(s.value.x - b.value.x),
350
- height: Math.abs(s.value.y - b.value.y)
351
- } : { left: 0, top: 0, width: 0, height: 0 }), { margin: H = 50, startSpeed: X = 30, maxSpeed: U = 30 } = n;
352
- let k;
353
- const $ = H, F = X, N = U, V = (v) => v ** 1;
354
- let L = 0;
355
- function q(v) {
356
- if (cancelAnimationFrame(k), L = J(v), L = Math.max(
357
- Math.min(L, N),
358
- -N
359
- ), L !== 0) {
360
- const h = i.value;
361
- if (!h || !a.value)
362
- return;
363
- const D = m.value.height - S.value.height;
364
- let x = m.value.top + Number(L);
365
- x = Math.min(Math.max(0, x), D), h.scrollTop = x, W(), k = requestAnimationFrame(() => q(v));
366
- }
367
- }
368
- function J(v) {
369
- if (i.value) {
370
- const D = S.value, x = D.bottom - v;
371
- if (x < $)
372
- return F * V(1 - x / $);
373
- const M = v - D.top;
374
- if (M < $)
375
- return -F * V(1 - M / $);
376
- }
377
- return 0;
378
- }
379
- function K(v) {
380
- const h = { ...R.value, right: 0, bottom: 0 };
381
- return h.left += S.value.left, h.top += S.value.top - m.value.top, h.right = h.width + h.left, h.bottom = h.height + h.top, h.left < v.right && h.right > v.left && h.top < v.bottom && h.bottom > v.top;
382
- }
383
- function W() {
384
- m.value.sync();
385
- const { top: v, height: h } = m.value;
386
- b.value.y = Math.min(
387
- h + S.value.top,
388
- b.value.y + v - b.value.scrollTop
389
- ), b.value.scrollTop = v;
390
- }
391
- function f(v, h, D = "dynamic-styles") {
392
- let x = document.getElementById(D);
393
- x || (x = document.createElement("style"), x.id = D, document.head.appendChild(x));
394
- const M = x.sheet.cssRules, G = M.length, Ke = `${v} { ${h} }`;
395
- for (let ue = 0; ue < G; ue++) {
396
- const fe = M[ue];
397
- if (fe.selectorText === v && fe.style.cssText === h)
398
- return;
399
- }
400
- x.sheet.insertRule(Ke, G);
401
- }
402
- function y(v, h) {
403
- d.value = !0, a.value = !0, m.value.height ? m.value.sync() : m.value.sync(!0), s.value.x = v, s.value.y = h + m.value.top, b.value.x = s.value.x, b.value.y = s.value.y, i.value?.classList.add("disable-scroll-behavior"), p.clear();
404
- }
405
- function C(v, h, D) {
406
- !a.value || (d.value && t === "colum" && !T() && (r(), d.value = !1), D?.(), q(h), b.value.x = Math.max(v, S.value.left), b.value.y = Math.min(
407
- h + m.value.top,
408
- m.value.height + S.value.top
409
- ), b.value.scrollTop = m.value.top, g.value());
410
- }
411
- function B() {
412
- a.value = !1, i.value?.classList.remove("disable-scroll-behavior");
413
- }
414
- function O() {
415
- !a.value || (L || W(), g.value());
416
- }
417
- function T() {
418
- if (!a.value)
419
- return !1;
420
- const { width: v, height: h } = R.value;
421
- return !(Math.max(v, h) > 5);
422
- }
423
- function Y() {
424
- T() && r();
425
- }
426
- function z() {
427
- T() || i.value?.querySelectorAll(`[${e}]`).forEach((v) => {
428
- c[`${e}`] = v.getAttribute(`${e}`), K(v.getBoundingClientRect()) ? o([c]) : u([c]);
429
- });
430
- }
431
- function ne() {
432
- const v = [];
433
- let h = null, D = 0;
434
- i.value?.querySelectorAll(`[${e}]`).forEach((x, M) => {
435
- const G = x.getAttribute(`${e}`);
436
- v.push(G), K(x.getBoundingClientRect()) ? (h === null && (h = M), h = Math.min(h, M), D = Math.max(D, M)) : (c[`${e}`] = G, p.has(G) && u([c]));
437
- });
438
- for (let x = h; x < D + 1; x++)
439
- c[`${e}`] = v[x], o([c]), p.add(v[x]);
440
- }
441
- function oe(v) {
442
- return !v?.value || (i.value = v.value, !i?.value) ? !1 : (_.observe(i.value), f(
443
- ".disable-scroll-behavior",
444
- "scroll-behavior: unset !important;"
445
- ), !0);
446
- }
447
- return {
448
- init: oe,
449
- dragStart: y,
450
- dragMove: C,
451
- dragEnd: B,
452
- onScroll: O,
453
- isSingleClick: T,
454
- cancelSelectAllBySingleClick: Y,
455
- selectFn: g,
456
- selectRange: R,
457
- isPressing: a,
458
- containerEl: i,
459
- observer: _
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(e, { emit: t }) {
560
- const n = e, l = () => {
561
- n.closeOnClickOverlay && t("update:visiable", !1);
313
+ setup(t, { emit: e }) {
314
+ const n = t, o = () => {
315
+ n.closeOnClickOverlay && e("update:visiable", !1);
562
316
  };
563
- return A(xt, () => t("update:visiable", !1)), (o, u) => (j(), Te(Oe, { name: "modal" }, {
564
- default: Re(() => [
565
- e.visiable ? (j(), ee("div", {
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: l,
568
- class: "modal absolute left-0 right-0 top-0 bottom-0 flex bg-stone-900 bg-opacity-50 z-[999]"
321
+ onClick: o,
322
+ class: "modal absolute inset-0 bottom-0 flex bg-stone-900 bg-opacity-50 z-[999]"
569
323
  }, [
570
- Q("div", {
571
- onClick: u[0] || (u[0] = We(() => {
324
+ H("div", {
325
+ onClick: r[0] || (r[0] = $e(() => {
572
326
  }, ["stop"])),
573
- class: Ye(["dialog m-auto flex flex-col", e.dialogClass])
327
+ class: Fe(["dialog m-auto flex flex-col", t.dialogClass])
574
328
  }, [
575
- ve(o.$slots, "default")
329
+ oe(s.$slots, "default")
576
330
  ], 2)
577
- ])) : Ge("", !0)
331
+ ])) : Ae("", !0)
578
332
  ]),
579
333
  _: 3
580
334
  }));
581
335
  }
582
336
  });
583
- function zt(e) {
584
- function t(n, l) {
585
- const o = document.createElement("div"), u = {
337
+ function Tt(t) {
338
+ function e(n, o) {
339
+ const s = document.createElement("div"), r = {
586
340
  setup() {
587
- return () => Z(
588
- Tt,
341
+ return () => R(
342
+ dt,
589
343
  {
590
344
  visiable: !0,
591
345
  "onUpdate:visiable": () => {
592
- o?.remove();
346
+ s?.remove();
593
347
  },
594
- ...e
348
+ ...t
595
349
  },
596
350
  {
597
- default: () => Z(n, l)
351
+ default: () => R(n, o)
598
352
  }
599
353
  );
600
354
  }
601
355
  };
602
- return document.body.appendChild(o), xe(Z(u), o), {
603
- close: () => o?.remove()
356
+ return document.body.appendChild(s), J(R(r), s), {
357
+ close: () => s?.remove()
604
358
  };
605
359
  }
606
360
  return {
607
- create: t
361
+ create: e
608
362
  };
609
363
  }
610
- const Ot = ["xlink:href", "fill", "color"], kt = /* @__PURE__ */ le({
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(e) {
620
- const t = e, n = E(() => `#${t.prefix}-${t.name}`), l = E(() => ({
621
- width: `${t.width ?? t.height}px`,
622
- height: `${t.height ?? t.width}px`,
623
- aspectRatio: t.width && t.height ? void 0 : "1/1"
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 (o, u) => (j(), ee("svg", {
379
+ return (s, r) => (I(), B("svg", {
626
380
  "aria-hidden": "",
627
- style: de(I(l))
381
+ style: K(_(o))
628
382
  }, [
629
- Q("use", {
630
- "xlink:href": I(n),
631
- fill: e.color,
632
- color: e.color
633
- }, null, 8, Ot)
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 Rt(e) {
391
+ function ft(t) {
638
392
  const {
639
- containerEl: t,
393
+ containerEl: e,
640
394
  sliderEl: n,
641
- autoHeight: l,
642
- performance: o = {},
643
- maxHeightRatio: u = 0.9
644
- } = e, r = w(!0), c = Ce(N, 100);
645
- let g, p = "";
646
- const d = w(0), i = w(0), a = w(0), s = w({
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
- }), b = w({
405
+ }), E = g({
652
406
  clientHeight: 0
653
- }), _ = E(() => !!i.value), S = E(() => s.value.scrollHeight > s.value.clientHeight), m = E(() => s.value.clientHeight - b.value.clientHeight), R = E(() => s.value.scrollHeight - s.value.clientHeight), H = E(() => Math.max(
654
- s.value.clientHeight / s.value.scrollHeight,
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
- )), X = E(() => H.value > u ? 0 : H.value * s.value.clientHeight), U = E(() => ({
410
+ )), Q = f(() => D.value > r ? 0 : D.value * u.value.clientHeight), k = f(() => ({
657
411
  willChange: "transform",
658
- transform: `translate3d(0,${a.value}px,0)`,
659
- height: l ? `${X.value}px` : void 0
412
+ transform: `translate3d(0,${i.value}px,0)`,
413
+ height: o ? `${Q.value}px` : void 0
660
414
  }));
661
- function k(O) {
662
- F(), i.value = O.clientY - n.value.getBoundingClientRect().top || 1, p = getComputedStyle(t.value).scrollBehavior, p === "smooth" && (t.value.style.scrollBehavior = "unset");
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
- t.value.style.scrollBehavior = p, i.value = 0, c();
418
+ function W() {
419
+ e.value.style.scrollBehavior = p, h.value = 0, d();
666
420
  }
667
- function F() {
668
- r.value = !1;
421
+ function P() {
422
+ l.value = !1;
669
423
  }
670
- function N() {
671
- _.value || (r.value = !0);
424
+ function V() {
425
+ b.value || (l.value = !0);
672
426
  }
673
- function V(O) {
674
- if (!_.value)
427
+ function j(w) {
428
+ if (!b.value)
675
429
  return;
676
- let T = O.clientY - s.value.top - i.value;
677
- T < 0 ? a.value = 0 : T >= m.value ? a.value = m.value : a.value = T, t.value.scrollTo({
678
- top: a.value / m.value * R.value
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 L() {
682
- _.value || q();
435
+ function U() {
436
+ b.value || q();
683
437
  }
684
438
  function q() {
685
- cancelAnimationFrame(g), g = requestAnimationFrame(J);
439
+ cancelAnimationFrame(m), m = requestAnimationFrame(Y);
686
440
  }
687
- function J() {
688
- t.value && (d.value = o.scrollTop?.value ?? t.value.scrollTop, a.value = d.value / R.value * m.value);
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 K(O) {
691
- let T = "addEventListener";
692
- O === "add" ? T = "addEventListener" : T = "removeEventListener", n.value?.[T]("pointerdown", k, {
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[T]("pointermove", V, { passive: !0 }), window[T]("pointerup", $, { passive: !0 });
448
+ }), window[O]("pointermove", j, { passive: !0 }), window[O]("pointerup", W, { passive: !0 });
695
449
  }
696
- const W = new MutationObserver((O) => {
697
- O.map((Y) => Y.oldValue).join().includes("height") && f();
450
+ const G = new MutationObserver((w) => {
451
+ w.map((Ie) => Ie.oldValue).join().includes("height") && a();
698
452
  });
699
- function f() {
700
- s.value.top = t.value?.getBoundingClientRect().top ?? 0, s.value.scrollHeight = t.value?.scrollHeight ?? 0, s.value.clientHeight = t.value?.clientHeight ?? 0;
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 y() {
703
- F(), setTimeout(() => {
704
- b.value.clientHeight = n.value?.clientHeight ?? 0, N();
456
+ function c() {
457
+ P(), setTimeout(() => {
458
+ E.value.clientHeight = n.value?.clientHeight ?? 0, V();
705
459
  }, 150);
706
460
  }
707
- function C(O, T, Y = "dynamic-styles") {
708
- let z = document.getElementById(Y);
709
- z || (z = document.createElement("style"), z.id = Y, document.head.appendChild(z));
710
- const ne = z.sheet.cssRules, oe = ne.length, v = `${O} { ${T} }`;
711
- for (let h = 0; h < oe; h++) {
712
- const D = ne[h];
713
- if (D.selectorText === O && D.style.cssText === T)
714
- return;
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 B() {
719
- t.value && n.value ? (C(
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
- }), K("add"), W.observe(t.value, {
473
+ }), z("add"), G.observe(e.value, {
725
474
  subtree: !0,
726
475
  attributeOldValue: !0,
727
476
  attributeFilter: ["style"]
728
477
  }), setTimeout(() => {
729
- f();
730
- }, 100), y()) : console.error("useScrollBar:", "\u521D\u59CB\u5316\u5931\u8D25!", { containerEl: t, sliderEl: n });
478
+ a();
479
+ }, 100), c()) : console.error("useScrollBar:", "\u521D\u59CB\u5316\u5931\u8D25!", { containerEl: e, sliderEl: n });
731
480
  }
732
- return te(d, () => {
733
- F(), c();
481
+ return $(v, () => {
482
+ P(), d();
734
483
  }), {
735
- isScrollEnd: r,
736
- isDragSlider: _,
737
- offsetTop: a,
738
- scrollTop: d,
739
- scrollable: S,
740
- sliderPos: U,
741
- init: B,
742
- modifySliderEventListener: K
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 Dt = (e) => (et("data-v-edec7292"), e = e(), tt(), e), Bt = /* @__PURE__ */ Dt(() => /* @__PURE__ */ Q("div", { class: "default-slider" }, null, -1)), Ct = /* @__PURE__ */ le({
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(e, { expose: t }) {
754
- const n = e, l = !!Xe().default, o = w(null), u = E(() => n.containerEl), r = Rt({
755
- containerEl: u,
756
- sliderEl: o,
757
- autoHeight: l ? n.autoHeight : !0,
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: c, isScrollEnd: g, sliderPos: p } = r, d = w(!1), i = n.autoHide ? E(() => d.value || !g.value) : E(() => c.value);
760
- ce(() => {
761
- we(() => {
762
- r.init();
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
- }), _e(() => {
765
- r.modifySliderEventListener("remove");
513
+ }), ve(() => {
514
+ l.modifySliderEventListener("remove");
766
515
  });
767
- function a() {
768
- d.value = !0;
516
+ function i() {
517
+ v.value = !0;
769
518
  }
770
- function s() {
771
- d.value = !1;
519
+ function u() {
520
+ v.value = !1;
772
521
  }
773
- return t({ uScrollBarReturn: r }), (b, _) => (j(), Te(Oe, null, {
774
- default: Re(() => [
775
- Je(Q("div", {
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: o,
526
+ ref: s,
778
527
  class: "slider-wrapper",
779
- onMouseenter: a,
780
- onMouseleave: s,
781
- style: de(I(p))
528
+ onMouseenter: i,
529
+ onMouseleave: u,
530
+ style: K(_(p))
782
531
  }, [
783
- ve(b.$slots, "default", {}, () => [
784
- Bt
532
+ oe(E.$slots, "default", {}, () => [
533
+ ht
785
534
  ], !0)
786
535
  ], 36), [
787
- [Ze, I(i)]
536
+ [ke, _(h)]
788
537
  ])
789
538
  ]),
790
539
  _: 3
791
540
  }));
792
541
  }
793
542
  });
794
- const Ve = (e, t) => {
795
- const n = e.__vccOpts || e;
796
- for (const [l, o] of t)
797
- n[l] = o;
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
- }, Nt = /* @__PURE__ */ Ve(Ct, [["__scopeId", "data-v-edec7292"]]), It = { class: "virtualListWrapper" }, Ht = {
548
+ }, It = /* @__PURE__ */ He(mt, [["__scopeId", "data-v-edec7292"]]), gt = { class: "virtualListWrapper" }, bt = {
800
549
  inheritAttrs: !1
801
- }, Lt = /* @__PURE__ */ le({
802
- ...Ht,
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(e, { expose: t, emit: n }) {
811
- const l = e, o = _t(lt(l, "data"), {
812
- itemHeight: (d) => l.itemHeight(l.data[d]),
813
- overscan: l.overscan,
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: u, containerProps: r, wrapperProps: c, innerProps: g, getItemHeightData: p } = o;
818
- return t({
819
- vListReturn: o
820
- }), (d, i) => (j(), ee("div", It, [
821
- Q("div", nt({
822
- onScrollPassive: i[0] || (i[0] = (...a) => I(r).onScroll && I(r).onScroll(...a)),
823
- ref: I(r).ref,
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
- }, d.$attrs), [
826
- Q("div", he(pe(I(c))), [
827
- Q("div", he(pe(I(g))), [
828
- (j(!0), ee(ot, null, rt(I(u), ({ index: a, data: s }) => (j(), ee("div", {
829
- key: a,
830
- style: de({
831
- height: `${I(p)(a).height}px`,
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
- ve(d.$slots, "default", {
836
- data: s,
837
- index: a
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 Vt = /* @__PURE__ */ Ve(Lt, [["__scopeId", "data-v-4ba97cce"]]);
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
- Nt as ScrollBar,
849
- kt as SvgIcon,
850
- Vt as VirtualList,
851
- $e as allSelectedKey,
852
- xt as closeDialogKey,
853
- zt as dialogController,
854
- ze as isAllSelectedKey,
855
- Ae as isSelectedKey,
856
- Pe as selectAllKey,
857
- Me as selectKey,
858
- He as toggleAllKey,
859
- Le as toggleKey,
860
- ke as unselectAllKey,
861
- Fe as unselectKey,
862
- Ne as useDragSelect,
863
- Ft as useDragSelectByMobile,
864
- Pt as useDragSelectByPc,
865
- Mt as useSelectable,
866
- $t as useSelectableInjectors,
867
- _t as useVirtualList
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
  };