@lazycatcloud/lzc-toolkit 0.0.42 → 0.0.44

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