@lazycatcloud/lzc-toolkit 0.0.27 → 0.0.28

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