@lazycatcloud/lzc-toolkit 0.0.18 → 0.0.20

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,22 +1,22 @@
1
- import { unref as b, getCurrentScope as ce, onScopeDispose as ue, getCurrentInstance as de, onMounted as U, nextTick as fe, ref as _, watch as R, shallowRef as ve, onUnmounted as pe, computed as w, inject as y, provide as m, defineComponent as K, openBlock as x, createBlock as he, Transition as ge, withCtx as me, createElementBlock as I, createElementVNode as P, withModifiers as be, normalizeClass as ye, renderSlot as D, createCommentVNode as _e, render as we, h as A, normalizeStyle as T, toRef as Oe, normalizeProps as H, guardReactiveProps as j, Fragment as Se, renderList as xe } from "vue";
2
- var F;
1
+ import { unref as m, getCurrentScope as ie, onScopeDispose as ce, getCurrentInstance as ue, onMounted as V, nextTick as de, ref as _, watch as $, shallowRef as fe, onUnmounted as ve, computed as w, inject as y, provide as b, defineComponent as R, openBlock as I, createBlock as pe, Transition as he, withCtx as ge, createElementBlock as x, createElementVNode as P, withModifiers as me, normalizeClass as be, renderSlot as U, createCommentVNode as ye, render as _e, h as E, normalizeStyle as W, toRef as we, mergeProps as Oe, normalizeProps as H, guardReactiveProps as K, Fragment as Se, renderList as Ie } from "vue";
2
+ var L;
3
3
  const C = typeof window < "u";
4
- C && ((F = window?.navigator) == null ? void 0 : F.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
5
- function Ie(e) {
6
- return typeof e == "function" ? e() : b(e);
4
+ C && ((L = window?.navigator) == null ? void 0 : L.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
5
+ function xe(e) {
6
+ return typeof e == "function" ? e() : m(e);
7
7
  }
8
- function Ce(e) {
8
+ function Pe(e) {
9
9
  return e;
10
10
  }
11
- function Pe(e) {
12
- return ce() ? (ue(e), !0) : !1;
11
+ function Ce(e) {
12
+ return ie() ? (ce(e), !0) : !1;
13
13
  }
14
14
  function Ee(e, t = !0) {
15
- de() ? U(e) : t ? e() : fe(e);
15
+ ue() ? V(e) : t ? e() : de(e);
16
16
  }
17
- function W(e) {
17
+ function D(e) {
18
18
  var t;
19
- const n = Ie(e);
19
+ const n = xe(e);
20
20
  return (t = n?.$el) != null ? t : n;
21
21
  }
22
22
  const Ae = C ? window : void 0;
@@ -27,58 +27,58 @@ function Te(e, t = !1) {
27
27
  const n = _(), o = () => n.value = Boolean(e());
28
28
  return o(), Ee(o, t), n;
29
29
  }
30
- const B = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, $ = "__vueuse_ssr_handlers__";
31
- B[$] = B[$] || {};
32
- B[$];
33
- var N = Object.getOwnPropertySymbols, Be = Object.prototype.hasOwnProperty, $e = Object.prototype.propertyIsEnumerable, Re = (e, t) => {
30
+ const A = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, T = "__vueuse_ssr_handlers__";
31
+ A[T] = A[T] || {};
32
+ A[T];
33
+ var j = Object.getOwnPropertySymbols, $e = Object.prototype.hasOwnProperty, Re = Object.prototype.propertyIsEnumerable, Be = (e, t) => {
34
34
  var n = {};
35
35
  for (var o in e)
36
- Be.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
37
- if (e != null && N)
38
- for (var o of N(e))
39
- t.indexOf(o) < 0 && $e.call(e, o) && (n[o] = e[o]);
36
+ $e.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
37
+ if (e != null && j)
38
+ for (var o of j(e))
39
+ t.indexOf(o) < 0 && Re.call(e, o) && (n[o] = e[o]);
40
40
  return n;
41
41
  };
42
- function Ke(e, t, n = {}) {
43
- const o = n, { window: s = Ae } = o, a = Re(o, ["window"]);
42
+ function ke(e, t, n = {}) {
43
+ const o = n, { window: s = Ae } = o, a = Be(o, ["window"]);
44
44
  let l;
45
45
  const i = Te(() => s && "ResizeObserver" in s), r = () => {
46
46
  l && (l.disconnect(), l = void 0);
47
- }, u = R(() => W(e), (S) => {
47
+ }, u = $(() => D(e), (S) => {
48
48
  r(), i.value && s && S && (l = new ResizeObserver(t), l.observe(S, a));
49
49
  }, { immediate: !0, flush: "post" }), O = () => {
50
50
  r(), u();
51
51
  };
52
- return Pe(O), {
52
+ return Ce(O), {
53
53
  isSupported: i,
54
54
  stop: O
55
55
  };
56
56
  }
57
- function ke(e, t = { width: 0, height: 0 }, n = {}) {
57
+ function ze(e, t = { width: 0, height: 0 }, n = {}) {
58
58
  const { box: o = "content-box" } = n, s = _(t.width), a = _(t.height);
59
- return Ke(e, ([l]) => {
59
+ return ke(e, ([l]) => {
60
60
  const i = o === "border-box" ? l.borderBoxSize : o === "content-box" ? l.contentBoxSize : l.devicePixelContentBoxSize;
61
61
  i ? (s.value = i.reduce((r, { inlineSize: u }) => r + u, 0), a.value = i.reduce((r, { blockSize: u }) => r + u, 0)) : (s.value = l.contentRect.width, a.value = l.contentRect.height);
62
- }, n), R(() => W(e), (l) => {
62
+ }, n), $(() => D(e), (l) => {
63
63
  s.value = l ? t.width : 0, a.value = l ? t.height : 0;
64
64
  }), {
65
65
  width: s,
66
66
  height: a
67
67
  };
68
68
  }
69
- var Q;
69
+ var F;
70
70
  (function(e) {
71
71
  e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
72
- })(Q || (Q = {}));
73
- var ze = Object.defineProperty, L = Object.getOwnPropertySymbols, He = Object.prototype.hasOwnProperty, je = Object.prototype.propertyIsEnumerable, V = (e, t, n) => t in e ? ze(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Fe = (e, t) => {
72
+ })(F || (F = {}));
73
+ var He = Object.defineProperty, N = Object.getOwnPropertySymbols, Ke = Object.prototype.hasOwnProperty, Le = Object.prototype.propertyIsEnumerable, Q = (e, t, n) => t in e ? He(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, je = (e, t) => {
74
74
  for (var n in t || (t = {}))
75
- He.call(t, n) && V(e, n, t[n]);
76
- if (L)
77
- for (var n of L(t))
78
- je.call(t, n) && V(e, n, t[n]);
75
+ Ke.call(t, n) && Q(e, n, t[n]);
76
+ if (N)
77
+ for (var n of N(t))
78
+ Le.call(t, n) && Q(e, n, t[n]);
79
79
  return e;
80
80
  };
81
- const Ne = {
81
+ const Fe = {
82
82
  easeInSine: [0.12, 0, 0.39, 0],
83
83
  easeOutSine: [0.61, 1, 0.88, 1],
84
84
  easeInOutSine: [0.37, 0, 0.63, 1],
@@ -104,104 +104,99 @@ const Ne = {
104
104
  easeOutBack: [0.34, 1.56, 0.64, 1],
105
105
  easeInOutBack: [0.68, -0.6, 0.32, 1.6]
106
106
  };
107
- Fe({
108
- linear: Ce
109
- }, Ne);
110
- function Qe(e, t) {
111
- const n = _(), o = ke(n), s = _([]), a = _(0), l = ve(e), i = _({ start: 0, end: 10 }), { itemHeight: r, overscan: u = 5 } = t, O = (c) => {
112
- const { start: g = 0 } = i.value;
107
+ je({
108
+ linear: Pe
109
+ }, Fe);
110
+ function Ne(e, t) {
111
+ const n = _(), o = ze(n), s = _([]), a = _(0), l = fe(e), i = _({ start: 0, end: 10 }), { itemHeight: r, overscan: u = 5 } = t, O = (c) => {
112
+ const { start: h = 0 } = i.value;
113
113
  let v = 0, p = 0;
114
- for (let h = g; h < l.value.length; h++) {
115
- const E = r(h);
116
- if (v += E, v >= c) {
117
- p = h;
114
+ for (let g = h; g < l.value.length; g++)
115
+ if (v += r(g), v >= c) {
116
+ p = g;
118
117
  break;
119
118
  }
120
- }
121
- return p - g;
119
+ return p - h;
122
120
  }, S = (c) => {
123
- let g = 0, v = 0;
124
- for (let p = 0; p < l.value.length; p++) {
125
- const h = r(p);
126
- if (g += h, g >= c) {
121
+ let h = 0, v = 0;
122
+ for (let p = 0; p < l.value.length; p++)
123
+ if (h += r(p), h >= c) {
127
124
  v = p;
128
125
  break;
129
126
  }
130
- }
131
127
  return v;
132
128
  };
133
129
  let d;
134
130
  const f = () => {
135
- cancelAnimationFrame(d), d = requestAnimationFrame(k);
136
- }, k = () => {
131
+ cancelAnimationFrame(d), d = requestAnimationFrame(B);
132
+ }, B = () => {
137
133
  const c = n.value;
138
134
  if (c) {
139
- const g = S(c.scrollTop), v = O(c.clientHeight), p = g - u, h = g + v + u;
135
+ const h = S(c.scrollTop), v = O(c.clientHeight), p = h - u, g = h + v + u;
140
136
  i.value = {
141
137
  start: p < 0 ? 0 : p,
142
- end: h > l.value.length ? l.value.length : h
143
- }, s.value = l.value.slice(i.value.start, i.value.end).map((E, ie) => ({
144
- data: E,
145
- index: ie + i.value.start
138
+ end: g > l.value.length ? l.value.length : g
139
+ }, s.value = l.value.slice(i.value.start, i.value.end).map((z, ae) => ({
140
+ data: z,
141
+ index: ae + i.value.start
146
142
  }));
147
143
  }
148
144
  };
149
- U(() => {
150
- }), pe(() => {
145
+ V(() => {
146
+ }), ve(() => {
151
147
  cancelAnimationFrame(d);
152
- }), R(
148
+ }), $(
153
149
  [o.width, o.height, l],
154
150
  () => {
155
151
  f();
156
152
  },
157
153
  { deep: !0 }
158
154
  );
159
- const z = w(() => typeof r == "number" ? l.value.length * r : l.value.reduce((c, g, v) => c + r(v), 0)), ne = (c) => typeof r == "number" ? c * r : l.value.slice(0, c).reduce((v, p, h) => v + r(h), 0), oe = (c) => {
160
- n.value && (n.value.scrollTop = c, k());
161
- }, le = w(() => ne(i.value.start)), se = w(() => ({
155
+ const k = w(() => typeof r == "number" ? l.value.length * r : l.value.reduce((c, h, v) => c + r(v), 0)), te = (c) => typeof r == "number" ? c * r : l.value.slice(0, c).reduce((v, p, g) => v + r(g), 0), ne = (c) => {
156
+ n.value && (n.value.scrollTop = c, B());
157
+ }, oe = w(() => te(i.value.start)), le = w(() => ({
162
158
  style: {
163
159
  width: "100%",
164
- height: `${z.value}px`
160
+ height: `${k.value}px`
165
161
  }
166
- })), re = w(() => ({
162
+ })), se = w(() => ({
167
163
  style: {
168
- transform: `translate3d(0, ${le.value}px, 0)`,
164
+ transform: `translate3d(0, ${oe.value}px, 0)`,
169
165
  "will-change": "transform"
170
166
  }
171
- })), ae = { overflowY: "auto" };
167
+ })), re = { overflowY: "auto" };
172
168
  return {
173
169
  list: s,
174
- totalHeight: z,
170
+ totalHeight: k,
175
171
  clientHeight: o.height,
176
- scrollTo: oe,
172
+ scrollTo: ne,
177
173
  scrollTop: a,
178
174
  containerProps: {
179
175
  ref: n,
180
176
  onScroll: (c) => {
181
177
  c.target && (a.value = c.target.scrollTop), f();
182
178
  },
183
- style: ae
179
+ style: re
184
180
  },
185
- wrapperProps: se,
186
- innerProps: re
181
+ wrapperProps: le,
182
+ innerProps: se
187
183
  };
188
184
  }
189
- const M = Symbol(), q = Symbol(), G = Symbol(), Y = Symbol(), J = Symbol(), X = Symbol(), Z = Symbol(), ee = Symbol(), te = Symbol();
190
- function qe() {
191
- const e = y(M), t = y(q), n = y(G), o = y(Y), s = y(J), a = y(Z), l = y(ee), i = y(te), r = y(X);
185
+ const M = Symbol(), q = Symbol(), G = Symbol(), Y = Symbol(), J = Symbol(), X = Symbol(), Z = Symbol(), ee = Symbol();
186
+ function Ye() {
187
+ const e = y(M), t = y(q), n = y(G), o = y(Y), s = y(J), a = y(X), l = y(Z), i = y(ee);
192
188
  return {
193
189
  toggleAll: e,
194
190
  toggle: t,
195
191
  isSelected: n,
196
- isAllSelected: l,
197
192
  selected: o,
198
193
  select: s,
199
194
  unselect: a,
200
- selectAll: r,
195
+ isAllSelected: l,
201
196
  unselectAll: i
202
197
  };
203
198
  }
204
- function Ge(e, t) {
199
+ function Je(e, t) {
205
200
  const n = _({}), o = w(() => e.value.filter((d) => n.value[d[t]])), s = w(() => o.value.length != 0 && Object.keys(n.value).length == e.value.length);
206
201
  function a() {
207
202
  e.value.forEach((d) => {
@@ -232,7 +227,7 @@ function Ge(e, t) {
232
227
  function S() {
233
228
  s.value ? l() : a();
234
229
  }
235
- return m(M, S), m(q, O), m(G, u), m(Y, o), m(J, i), m(Z, r), m(ee, s), m(te, l), m(X, a), {
230
+ return b(M, S), b(q, O), b(G, u), b(Y, o), b(J, i), b(X, r), b(Z, s), b(ee, l), {
236
231
  selected: o,
237
232
  select: i,
238
233
  selectAll: a,
@@ -244,7 +239,7 @@ function Ge(e, t) {
244
239
  isAllSelected: s
245
240
  };
246
241
  }
247
- const Le = Symbol(), Ve = /* @__PURE__ */ K({
242
+ const Qe = Symbol(), Ve = /* @__PURE__ */ R({
248
243
  __name: "Dialog",
249
244
  props: {
250
245
  visiable: { type: Boolean, default: !1 },
@@ -256,31 +251,31 @@ const Le = Symbol(), Ve = /* @__PURE__ */ K({
256
251
  const n = e, o = () => {
257
252
  n.closeOnClickOverlay && t("update:visiable", !1);
258
253
  };
259
- return m(Le, () => t("update:visiable", !1)), (s, a) => (x(), he(ge, { name: "modal" }, {
260
- default: me(() => [
261
- e.visiable ? (x(), I("div", {
254
+ return b(Qe, () => t("update:visiable", !1)), (s, a) => (I(), pe(he, { name: "modal" }, {
255
+ default: ge(() => [
256
+ e.visiable ? (I(), x("div", {
262
257
  key: 0,
263
258
  onClick: o,
264
259
  class: "modal absolute inset-0 bottom-0 z-50 flex bg-stone-900 bg-opacity-50"
265
260
  }, [
266
261
  P("div", {
267
- onClick: a[0] || (a[0] = be(() => {
262
+ onClick: a[0] || (a[0] = me(() => {
268
263
  }, ["stop"])),
269
- class: ye(["dialog m-auto flex flex-col", e.dialogClass])
264
+ class: be(["dialog m-auto flex flex-col", e.dialogClass])
270
265
  }, [
271
- D(s.$slots, "default")
266
+ U(s.$slots, "default")
272
267
  ], 2)
273
- ])) : _e("", !0)
268
+ ])) : ye("", !0)
274
269
  ]),
275
270
  _: 3
276
271
  }));
277
272
  }
278
273
  });
279
- function Ye(e) {
274
+ function Xe(e) {
280
275
  function t(n, o) {
281
276
  const s = document.createElement("div"), a = {
282
277
  setup() {
283
- return () => A(
278
+ return () => E(
284
279
  Ve,
285
280
  {
286
281
  visiable: !0,
@@ -290,12 +285,12 @@ function Ye(e) {
290
285
  ...e
291
286
  },
292
287
  {
293
- default: () => A(n, o)
288
+ default: () => E(n, o)
294
289
  }
295
290
  );
296
291
  }
297
292
  };
298
- return document.body.appendChild(s), we(A(a), s), {
293
+ return document.body.appendChild(s), _e(E(a), s), {
299
294
  close: () => s?.remove()
300
295
  };
301
296
  }
@@ -303,7 +298,7 @@ function Ye(e) {
303
298
  create: t
304
299
  };
305
300
  }
306
- const Ue = ["xlink:href", "fill", "color"], Je = /* @__PURE__ */ K({
301
+ const Ue = ["xlink:href", "fill", "color"], Ze = /* @__PURE__ */ R({
307
302
  __name: "SvgIcon",
308
303
  props: {
309
304
  prefix: { default: "icon" },
@@ -317,77 +312,81 @@ const Ue = ["xlink:href", "fill", "color"], Je = /* @__PURE__ */ K({
317
312
  width: t.width,
318
313
  height: t.height
319
314
  }));
320
- return (s, a) => (x(), I("svg", {
315
+ return (s, a) => (I(), x("svg", {
321
316
  "aria-hidden": "",
322
- style: T(b(o))
317
+ style: W(m(o))
323
318
  }, [
324
319
  P("use", {
325
- "xlink:href": b(n),
320
+ "xlink:href": m(n),
326
321
  fill: e.color,
327
322
  color: e.color
328
323
  }, null, 8, Ue)
329
324
  ], 4));
330
325
  }
331
- }), De = /* @__PURE__ */ K({
326
+ }), We = { class: "virtualListWrapper" }, De = {
327
+ inheritAttrs: !1
328
+ }, Me = /* @__PURE__ */ R({
329
+ ...De,
332
330
  __name: "VirtualList",
333
331
  props: {
334
332
  data: null,
335
333
  itemHeight: null
336
334
  },
337
335
  setup(e) {
338
- const t = e, { list: n, containerProps: o, wrapperProps: s, innerProps: a } = Qe(
339
- Oe(t, "data"),
336
+ const t = e, { list: n, containerProps: o, wrapperProps: s, innerProps: a } = Ne(
337
+ we(t, "data"),
340
338
  {
341
339
  itemHeight: (l) => t.itemHeight(0),
342
340
  overscan: 10
343
341
  }
344
342
  );
345
- return (l, i) => (x(), I("div", {
346
- ref: b(o).ref,
347
- onScrollPassive: i[0] || (i[0] = (...r) => b(o).onScroll && b(o).onScroll(...r)),
348
- class: "hiddenScorllBar-firefox hiddenScorllBar h-full overflow-hidden",
349
- style: T(b(o).style)
350
- }, [
351
- P("div", H(j(b(s))), [
352
- P("div", H(j(b(a))), [
353
- (x(!0), I(Se, null, xe(b(n), ({ index: r, data: u }) => (x(), I("div", {
354
- key: r,
355
- style: T({
356
- height: `${e.itemHeight(u)}px`,
357
- display: "flex"
358
- })
359
- }, [
360
- D(l.$slots, "default", {
361
- data: u,
362
- index: r
363
- }, void 0, !0)
364
- ], 4))), 128))
343
+ return (l, i) => (I(), x("div", We, [
344
+ P("div", Oe({
345
+ onScrollPassive: i[0] || (i[0] = (...r) => m(o).onScroll && m(o).onScroll(...r)),
346
+ ref: m(o).ref,
347
+ style: m(o).style,
348
+ class: "virtualList"
349
+ }, l.$attrs), [
350
+ P("div", H(K(m(s))), [
351
+ P("div", H(K(m(a))), [
352
+ (I(!0), x(Se, null, Ie(m(n), ({ index: r, data: u }) => (I(), x("div", {
353
+ key: r,
354
+ style: W({
355
+ height: `${e.itemHeight(u)}px`,
356
+ display: "flex"
357
+ })
358
+ }, [
359
+ U(l.$slots, "default", {
360
+ data: u,
361
+ index: r
362
+ }, void 0, !0)
363
+ ], 4))), 128))
364
+ ], 16)
365
365
  ], 16)
366
366
  ], 16)
367
- ], 36));
367
+ ]));
368
368
  }
369
369
  });
370
- const We = (e, t) => {
370
+ const qe = (e, t) => {
371
371
  const n = e.__vccOpts || e;
372
372
  for (const [o, s] of t)
373
373
  n[o] = s;
374
374
  return n;
375
- }, Xe = /* @__PURE__ */ We(De, [["__scopeId", "data-v-b9b7f6cb"]]);
375
+ }, et = /* @__PURE__ */ qe(Me, [["__scopeId", "data-v-06e648eb"]]);
376
376
  export {
377
- Je as SvgIcon,
378
- Xe as VirtualList,
377
+ Ze as SvgIcon,
378
+ et as VirtualList,
379
379
  Y as allSelectedKey,
380
- Le as closeDialogKey,
381
- Ye as dialogController,
382
- ee as isAllSelectedKey,
380
+ Qe as closeDialogKey,
381
+ Xe as dialogController,
382
+ Z as isAllSelectedKey,
383
383
  G as isSelectedKey,
384
- X as selectAllKey,
385
384
  J as selectKey,
386
385
  M as toggleAllKey,
387
386
  q as toggleKey,
388
- te as unselectAllKey,
389
- Z as unselectKey,
390
- Ge as useSelectable,
391
- qe as useSelectableInjectors,
392
- Qe as useVirtualList
387
+ ee as unselectAllKey,
388
+ X as unselectKey,
389
+ Je as useSelectable,
390
+ Ye as useSelectableInjectors,
391
+ Ne as useVirtualList
393
392
  };
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(a,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(a=typeof globalThis<"u"?globalThis:a||self,e(a.ui={},a.Vue))})(this,function(a,e){"use strict";var x;const S=typeof window<"u";S&&((x=window?.navigator)==null?void 0:x.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function M(t){return typeof t=="function"?t():e.unref(t)}function D(t){return t}function U(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function W(t,n=!0){e.getCurrentInstance()?e.onMounted(t):n?t():e.nextTick(t)}function R(t){var n;const o=M(t);return(n=o?.$el)!=null?n:o}const q=S?window:void 0;S&&window.document,S&&window.navigator,S&&window.location;function G(t,n=!1){const o=e.ref(),l=()=>o.value=Boolean(t());return l(),W(l,n),o}const O=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},v="__vueuse_ssr_handlers__";O[v]=O[v]||{},O[v];var V=Object.getOwnPropertySymbols,Y=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable,X=(t,n)=>{var o={};for(var l in t)Y.call(t,l)&&n.indexOf(l)<0&&(o[l]=t[l]);if(t!=null&&V)for(var l of V(t))n.indexOf(l)<0&&J.call(t,l)&&(o[l]=t[l]);return o};function Z(t,n,o={}){const l=o,{window:s=q}=l,c=X(l,["window"]);let r;const d=G(()=>s&&"ResizeObserver"in s),i=()=>{r&&(r.disconnect(),r=void 0)},f=e.watch(()=>R(t),w=>{i(),d.value&&s&&w&&(r=new ResizeObserver(n),r.observe(w,c))},{immediate:!0,flush:"post"}),_=()=>{i(),f()};return U(_),{isSupported:d,stop:_}}function ee(t,n={width:0,height:0},o={}){const{box:l="content-box"}=o,s=e.ref(n.width),c=e.ref(n.height);return Z(t,([r])=>{const d=l==="border-box"?r.borderBoxSize:l==="content-box"?r.contentBoxSize:r.devicePixelContentBoxSize;d?(s.value=d.reduce((i,{inlineSize:f})=>i+f,0),c.value=d.reduce((i,{blockSize:f})=>i+f,0)):(s.value=r.contentRect.width,c.value=r.contentRect.height)},o),e.watch(()=>R(t),r=>{s.value=r?n.width:0,c.value=r?n.height:0}),{width:s,height:c}}var $;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})($||($={}));var te=Object.defineProperty,z=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable,N=(t,n,o)=>n in t?te(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,le=(t,n)=>{for(var o in n||(n={}))ne.call(n,o)&&N(t,o,n[o]);if(z)for(var o of z(n))oe.call(n,o)&&N(t,o,n[o]);return t};le({linear:D},{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 H(t,n){const o=e.ref(),l=ee(o),s=e.ref([]),c=e.ref(0),r=e.shallowRef(t),d=e.ref({start:0,end:10}),{itemHeight:i,overscan:f=5}=n,_=u=>{const{start:b=0}=d.value;let g=0,m=0;for(let y=b;y<r.value.length;y++){const k=i(y);if(g+=k,g>=u){m=y;break}}return m-b},w=u=>{let b=0,g=0;for(let m=0;m<r.value.length;m++){const y=i(m);if(b+=y,b>=u){g=m;break}}return g};let p;const h=()=>{cancelAnimationFrame(p),p=requestAnimationFrame(F)},F=()=>{const u=o.value;if(u){const b=w(u.scrollTop),g=_(u.clientHeight),m=b-f,y=b+g+f;d.value={start:m<0?0:m,end:y>r.value.length?r.value.length:y},s.value=r.value.slice(d.value.start,d.value.end).map((k,_e)=>({data:k,index:_e+d.value.start}))}};e.onMounted(()=>{}),e.onUnmounted(()=>{cancelAnimationFrame(p)}),e.watch([l.width,l.height,r],()=>{h()},{deep:!0});const Q=e.computed(()=>typeof i=="number"?r.value.length*i:r.value.reduce((u,b,g)=>u+i(g),0)),pe=u=>typeof i=="number"?u*i:r.value.slice(0,u).reduce((g,m,y)=>g+i(y),0),he=u=>{o.value&&(o.value.scrollTop=u,F())},ge=e.computed(()=>pe(d.value.start)),me=e.computed(()=>({style:{width:"100%",height:`${Q.value}px`}})),ye=e.computed(()=>({style:{transform:`translate3d(0, ${ge.value}px, 0)`,"will-change":"transform"}})),be={overflowY:"auto"};return{list:s,totalHeight:Q,clientHeight:l.height,scrollTo:he,scrollTop:c,containerProps:{ref:o,onScroll:u=>{u.target&&(c.value=u.target.scrollTop),h()},style:be},wrapperProps:me,innerProps:ye}}const I=Symbol(),P=Symbol(),C=Symbol(),E=Symbol(),B=Symbol(),A=Symbol(),K=Symbol(),j=Symbol(),T=Symbol();function re(){const t=e.inject(I),n=e.inject(P),o=e.inject(C),l=e.inject(E),s=e.inject(B),c=e.inject(K),r=e.inject(j),d=e.inject(T),i=e.inject(A);return{toggleAll:t,toggle:n,isSelected:o,isAllSelected:r,selected:l,select:s,unselect:c,selectAll:i,unselectAll:d}}function se(t,n){const o=e.ref({}),l=e.computed(()=>t.value.filter(p=>o.value[p[n]])),s=e.computed(()=>l.value.length!=0&&Object.keys(o.value).length==t.value.length);function c(){t.value.forEach(p=>{o.value[p[n]]=!0})}function r(){o.value={}}function d(p){p.forEach(h=>{o.value[h[n]]||(o.value[h[n]]=!0)})}function i(p){p.forEach(h=>{o.value[h[n]]&&delete o.value[h[n]]})}function f(p){return!!o.value[p[n]]}function _(p){p.forEach(h=>{f(h)?delete o.value[h[n]]:o.value[h[n]]=!0})}function w(){s.value?r():c()}return e.provide(I,w),e.provide(P,_),e.provide(C,f),e.provide(E,l),e.provide(B,d),e.provide(K,i),e.provide(j,s),e.provide(T,r),e.provide(A,c),{selected:l,select:d,selectAll:c,unselect:i,unselectAll:r,toggle:_,toggleAll:w,isSelected:f,isAllSelected:s}}const L=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:n}){const o=t,l=()=>{o.closeOnClickOverlay&&n("update:visiable",!1)};return e.provide(L,()=>n("update:visiable",!1)),(s,c)=>(e.openBlock(),e.createBlock(e.Transition,{name:"modal"},{default:e.withCtx(()=>[t.visiable?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:l,class:"modal absolute inset-0 bottom-0 z-50 flex bg-stone-900 bg-opacity-50"},[e.createElementVNode("div",{onClick:c[0]||(c[0]=e.withModifiers(()=>{},["stop"])),class:e.normalizeClass(["dialog m-auto flex flex-col",t.dialogClass])},[e.renderSlot(s.$slots,"default")],2)])):e.createCommentVNode("",!0)]),_:3}))}});function ce(t){function n(o,l){const s=document.createElement("div"),c={setup(){return()=>e.h(ie,{visiable:!0,"onUpdate:visiable":()=>{s?.remove()},...t},{default:()=>e.h(o,l)})}};return document.body.appendChild(s),e.render(e.h(c),s),{close:()=>s?.remove()}}return{create:n}}const ae=["xlink:href","fill","color"],de=e.defineComponent({__name:"SvgIcon",props:{prefix:{default:"icon"},name:null,color:{default:"#FFF"},width:{default:16},height:{default:16}},setup(t){const n=t,o=e.computed(()=>`#${n.prefix}-${n.name}`),l=e.computed(()=>({width:n.width,height:n.height}));return(s,c)=>(e.openBlock(),e.createElementBlock("svg",{"aria-hidden":"",style:e.normalizeStyle(e.unref(l))},[e.createElementVNode("use",{"xlink:href":e.unref(o),fill:t.color,color:t.color},null,8,ae)],4))}}),ue=e.defineComponent({__name:"VirtualList",props:{data:null,itemHeight:null},setup(t){const n=t,{list:o,containerProps:l,wrapperProps:s,innerProps:c}=H(e.toRef(n,"data"),{itemHeight:r=>n.itemHeight(0),overscan:10});return(r,d)=>(e.openBlock(),e.createElementBlock("div",{ref:e.unref(l).ref,onScrollPassive:d[0]||(d[0]=(...i)=>e.unref(l).onScroll&&e.unref(l).onScroll(...i)),class:"hiddenScorllBar-firefox hiddenScorllBar h-full overflow-hidden",style:e.normalizeStyle(e.unref(l).style)},[e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(e.unref(s))),[e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(e.unref(c))),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),({index:i,data:f})=>(e.openBlock(),e.createElementBlock("div",{key:i,style:e.normalizeStyle({height:`${t.itemHeight(f)}px`,display:"flex"})},[e.renderSlot(r.$slots,"default",{data:f,index:i},void 0,!0)],4))),128))],16)],16)],36))}}),Se="",fe=((t,n)=>{const o=t.__vccOpts||t;for(const[l,s]of n)o[l]=s;return o})(ue,[["__scopeId","data-v-b9b7f6cb"]]);a.SvgIcon=de,a.VirtualList=fe,a.allSelectedKey=E,a.closeDialogKey=L,a.dialogController=ce,a.isAllSelectedKey=j,a.isSelectedKey=C,a.selectAllKey=A,a.selectKey=B,a.toggleAllKey=I,a.toggleKey=P,a.unselectAllKey=T,a.unselectKey=K,a.useSelectable=se,a.useSelectableInjectors=re,a.useVirtualList=H,Object.defineProperties(a,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(c,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(c=typeof globalThis<"u"?globalThis:c||self,e(c.ui={},c.Vue))})(this,function(c,e){"use strict";var A;const O=typeof window<"u";O&&((A=window?.navigator)==null?void 0:A.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Q(t){return typeof t=="function"?t():e.unref(t)}function M(t){return t}function D(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function U(t,n=!0){e.getCurrentInstance()?e.onMounted(t):n?t():e.nextTick(t)}function K(t){var n;const o=Q(t);return(n=o?.$el)!=null?n:o}const W=O?window:void 0;O&&window.document,O&&window.navigator,O&&window.location;function q(t,n=!1){const o=e.ref(),l=()=>o.value=Boolean(t());return l(),U(l,n),o}const S=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},v="__vueuse_ssr_handlers__";S[v]=S[v]||{},S[v];var x=Object.getOwnPropertySymbols,G=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,J=(t,n)=>{var o={};for(var l in t)G.call(t,l)&&n.indexOf(l)<0&&(o[l]=t[l]);if(t!=null&&x)for(var l of x(t))n.indexOf(l)<0&&Y.call(t,l)&&(o[l]=t[l]);return o};function X(t,n,o={}){const l=o,{window:s=W}=l,a=J(l,["window"]);let r;const d=q(()=>s&&"ResizeObserver"in s),i=()=>{r&&(r.disconnect(),r=void 0)},f=e.watch(()=>K(t),w=>{i(),d.value&&s&&w&&(r=new ResizeObserver(n),r.observe(w,a))},{immediate:!0,flush:"post"}),_=()=>{i(),f()};return D(_),{isSupported:d,stop:_}}function Z(t,n={width:0,height:0},o={}){const{box:l="content-box"}=o,s=e.ref(n.width),a=e.ref(n.height);return X(t,([r])=>{const d=l==="border-box"?r.borderBoxSize:l==="content-box"?r.contentBoxSize:r.devicePixelContentBoxSize;d?(s.value=d.reduce((i,{inlineSize:f})=>i+f,0),a.value=d.reduce((i,{blockSize:f})=>i+f,0)):(s.value=r.contentRect.width,a.value=r.contentRect.height)},o),e.watch(()=>K(t),r=>{s.value=r?n.width:0,a.value=r?n.height:0}),{width:s,height:a}}var $;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})($||($={}));var ee=Object.defineProperty,V=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable,R=(t,n,o)=>n in t?ee(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,oe=(t,n)=>{for(var o in n||(n={}))te.call(n,o)&&R(t,o,n[o]);if(V)for(var o of V(n))ne.call(n,o)&&R(t,o,n[o]);return t};oe({linear:M},{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 N(t,n){const o=e.ref(),l=Z(o),s=e.ref([]),a=e.ref(0),r=e.shallowRef(t),d=e.ref({start:0,end:10}),{itemHeight:i,overscan:f=5}=n,_=u=>{const{start:y=0}=d.value;let g=0,m=0;for(let b=y;b<r.value.length;b++)if(g+=i(b),g>=u){m=b;break}return m-y},w=u=>{let y=0,g=0;for(let m=0;m<r.value.length;m++)if(y+=i(m),y>=u){g=m;break}return g};let p;const h=()=>{cancelAnimationFrame(p),p=requestAnimationFrame(L)},L=()=>{const u=o.value;if(u){const y=w(u.scrollTop),g=_(u.clientHeight),m=y-f,b=y+g+f;d.value={start:m<0?0:m,end:b>r.value.length?r.value.length:b},s.value=r.value.slice(d.value.start,d.value.end).map((F,we)=>({data:F,index:we+d.value.start}))}};e.onMounted(()=>{}),e.onUnmounted(()=>{cancelAnimationFrame(p)}),e.watch([l.width,l.height,r],()=>{h()},{deep:!0});const H=e.computed(()=>typeof i=="number"?r.value.length*i:r.value.reduce((u,y,g)=>u+i(g),0)),he=u=>typeof i=="number"?u*i:r.value.slice(0,u).reduce((g,m,b)=>g+i(b),0),ge=u=>{o.value&&(o.value.scrollTop=u,L())},me=e.computed(()=>he(d.value.start)),ye=e.computed(()=>({style:{width:"100%",height:`${H.value}px`}})),be=e.computed(()=>({style:{transform:`translate3d(0, ${me.value}px, 0)`,"will-change":"transform"}})),_e={overflowY:"auto"};return{list:s,totalHeight:H,clientHeight:l.height,scrollTo:ge,scrollTop:a,containerProps:{ref:o,onScroll:u=>{u.target&&(a.value=u.target.scrollTop),h()},style:_e},wrapperProps:ye,innerProps:be}}const I=Symbol(),P=Symbol(),C=Symbol(),E=Symbol(),B=Symbol(),T=Symbol(),j=Symbol(),k=Symbol();function le(){const t=e.inject(I),n=e.inject(P),o=e.inject(C),l=e.inject(E),s=e.inject(B),a=e.inject(T),r=e.inject(j),d=e.inject(k);return{toggleAll:t,toggle:n,isSelected:o,selected:l,select:s,unselect:a,isAllSelected:r,unselectAll:d}}function re(t,n){const o=e.ref({}),l=e.computed(()=>t.value.filter(p=>o.value[p[n]])),s=e.computed(()=>l.value.length!=0&&Object.keys(o.value).length==t.value.length);function a(){t.value.forEach(p=>{o.value[p[n]]=!0})}function r(){o.value={}}function d(p){p.forEach(h=>{o.value[h[n]]||(o.value[h[n]]=!0)})}function i(p){p.forEach(h=>{o.value[h[n]]&&delete o.value[h[n]]})}function f(p){return!!o.value[p[n]]}function _(p){p.forEach(h=>{f(h)?delete o.value[h[n]]:o.value[h[n]]=!0})}function w(){s.value?r():a()}return e.provide(I,w),e.provide(P,_),e.provide(C,f),e.provide(E,l),e.provide(B,d),e.provide(T,i),e.provide(j,s),e.provide(k,r),{selected:l,select:d,selectAll:a,unselect:i,unselectAll:r,toggle:_,toggleAll:w,isSelected:f,isAllSelected:s}}const z=Symbol(),se=e.defineComponent({__name:"Dialog",props:{visiable:{type:Boolean,default:!1},closeOnClickOverlay:{type:Boolean,default:!0},dialogClass:{default:""}},emits:["update:visiable"],setup(t,{emit:n}){const o=t,l=()=>{o.closeOnClickOverlay&&n("update:visiable",!1)};return e.provide(z,()=>n("update:visiable",!1)),(s,a)=>(e.openBlock(),e.createBlock(e.Transition,{name:"modal"},{default:e.withCtx(()=>[t.visiable?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:l,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(s.$slots,"default")],2)])):e.createCommentVNode("",!0)]),_:3}))}});function ie(t){function n(o,l){const s=document.createElement("div"),a={setup(){return()=>e.h(se,{visiable:!0,"onUpdate:visiable":()=>{s?.remove()},...t},{default:()=>e.h(o,l)})}};return document.body.appendChild(s),e.render(e.h(a),s),{close:()=>s?.remove()}}return{create:n}}const ae=["xlink:href","fill","color"],ce=e.defineComponent({__name:"SvgIcon",props:{prefix:{default:"icon"},name:null,color:{default:"#FFF"},width:{default:16},height:{default:16}},setup(t){const n=t,o=e.computed(()=>`#${n.prefix}-${n.name}`),l=e.computed(()=>({width:n.width,height:n.height}));return(s,a)=>(e.openBlock(),e.createElementBlock("svg",{"aria-hidden":"",style:e.normalizeStyle(e.unref(l))},[e.createElementVNode("use",{"xlink:href":e.unref(o),fill:t.color,color:t.color},null,8,ae)],4))}}),de={class:"virtualListWrapper"},ue={inheritAttrs:!1},fe=e.defineComponent({...ue,__name:"VirtualList",props:{data:null,itemHeight:null},setup(t){const n=t,{list:o,containerProps:l,wrapperProps:s,innerProps:a}=N(e.toRef(n,"data"),{itemHeight:r=>n.itemHeight(0),overscan:10});return(r,d)=>(e.openBlock(),e.createElementBlock("div",de,[e.createElementVNode("div",e.mergeProps({onScrollPassive:d[0]||(d[0]=(...i)=>e.unref(l).onScroll&&e.unref(l).onScroll(...i)),ref:e.unref(l).ref,style:e.unref(l).style,class:"virtualList"},r.$attrs),[e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(e.unref(s))),[e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(e.unref(a))),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),({index:i,data:f})=>(e.openBlock(),e.createElementBlock("div",{key:i,style:e.normalizeStyle({height:`${t.itemHeight(f)}px`,display:"flex"})},[e.renderSlot(r.$slots,"default",{data:f,index:i},void 0,!0)],4))),128))],16)],16)],16)]))}}),Se="",pe=((t,n)=>{const o=t.__vccOpts||t;for(const[l,s]of n)o[l]=s;return o})(fe,[["__scopeId","data-v-06e648eb"]]);c.SvgIcon=ce,c.VirtualList=pe,c.allSelectedKey=E,c.closeDialogKey=z,c.dialogController=ie,c.isAllSelectedKey=j,c.isSelectedKey=C,c.selectKey=B,c.toggleAllKey=I,c.toggleKey=P,c.unselectAllKey=k,c.unselectKey=T,c.useSelectable=re,c.useSelectableInjectors=le,c.useVirtualList=N,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .hiddenScorllBar[data-v-b9b7f6cb]::-webkit-scrollbar{display:none}.hiddenScorllBar-firefox[data-v-b9b7f6cb]{-ms-overflow-style:none;scrollbar-width:none}.h-full[data-v-b9b7f6cb]{height:100%}.overflow-hidden[data-v-b9b7f6cb]{overflow:hidden}
1
+ .virtualListWrapper[data-v-06e648eb]{width:100%;height:100%;position:relative}.virtualList[data-v-06e648eb] ::-webkit-scrollbar{display:none}.virtualList[data-v-06e648eb]{width:100%;height:100%;position:absolute;top:0}
@@ -27,8 +27,8 @@ declare const _default: {
27
27
  $slots: Readonly<{
28
28
  [name: string]: import("vue").Slot | undefined;
29
29
  }>;
30
- $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
31
- $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
30
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
31
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
32
32
  $emit: (event: "update:visiable", ...args: any[]) => void;
33
33
  $el: any;
34
34
  $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DialogProps>, {
@@ -41,7 +41,7 @@ declare const _default: {
41
41
  visiable: boolean;
42
42
  closeOnClickOverlay: boolean;
43
43
  dialogClass: string | object | string[];
44
- }, {}, string> & {
44
+ }> & {
45
45
  beforeCreate?: ((() => void) | (() => void)[]) | undefined;
46
46
  created?: ((() => void) | (() => void)[]) | undefined;
47
47
  beforeMount?: ((() => void) | (() => void)[]) | undefined;
@@ -56,18 +56,18 @@ declare const _default: {
56
56
  unmounted?: ((() => void) | (() => void)[]) | undefined;
57
57
  renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
58
58
  renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
59
- errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void)[]) | undefined;
59
+ errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
60
60
  };
61
61
  $forceUpdate: () => void;
62
62
  $nextTick: typeof import("vue").nextTick;
63
- $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
63
+ $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
64
64
  } & Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DialogProps>, {
65
65
  visiable: boolean;
66
66
  closeOnClickOverlay: boolean;
67
67
  dialogClass: string;
68
68
  }>>> & {
69
69
  "onUpdate:visiable"?: ((...args: any[]) => any) | undefined;
70
- } & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {};
70
+ } & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
71
71
  __isFragment?: undefined;
72
72
  __isTeleport?: undefined;
73
73
  __isSuspense?: undefined;
@@ -81,14 +81,14 @@ declare const _default: {
81
81
  visiable: boolean;
82
82
  closeOnClickOverlay: boolean;
83
83
  dialogClass: string | object | string[];
84
- }, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
84
+ }> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
85
85
  $slots: {
86
86
  default: (_: {}) => any;
87
87
  };
88
88
  });
89
89
  export default _default;
90
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
91
- type __VLS_TypePropsToRuntimeProps<T> = {
90
+ declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
91
+ declare type __VLS_TypePropsToRuntimeProps<T> = {
92
92
  [K in keyof T]-?: {} extends Pick<T, K> ? {
93
93
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
94
94
  } : {
@@ -96,7 +96,7 @@ type __VLS_TypePropsToRuntimeProps<T> = {
96
96
  required: true;
97
97
  };
98
98
  };
99
- type __VLS_WithDefaults<P, D> = {
99
+ declare type __VLS_WithDefaults<P, D> = {
100
100
  [K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
101
101
  default: D[K];
102
102
  } : P[K];
@@ -9,7 +9,7 @@ interface Constructor<P = any> {
9
9
  $props: P;
10
10
  };
11
11
  }
12
- type DialogControllerOptions = Omit<DialogProps, "visiable">;
12
+ declare type DialogControllerOptions = Omit<DialogProps, "visiable">;
13
13
  export declare function dialogController(dialogProps?: DialogControllerOptions): {
14
14
  create: <P>(component: Constructor<P>, componentProps?: (VNodeProps & P) | undefined) => {
15
15
  close: () => void;
@@ -27,8 +27,8 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
27
27
  height: number;
28
28
  }>;
29
29
  export default _default;
30
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
31
- type __VLS_TypePropsToRuntimeProps<T> = {
30
+ declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
31
+ declare type __VLS_TypePropsToRuntimeProps<T> = {
32
32
  [K in keyof T]-?: {} extends Pick<T, K> ? {
33
33
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
34
34
  } : {
@@ -36,7 +36,7 @@ type __VLS_TypePropsToRuntimeProps<T> = {
36
36
  required: true;
37
37
  };
38
38
  };
39
- type __VLS_WithDefaults<P, D> = {
39
+ declare type __VLS_WithDefaults<P, D> = {
40
40
  [K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
41
41
  default: D[K];
42
42
  } : P[K];
@@ -4,11 +4,10 @@ export declare function useSelectableInjectors(): {
4
4
  toggleAll: (() => void) | undefined;
5
5
  toggle: ((a: any[]) => void) | undefined;
6
6
  isSelected: ((a: any) => boolean) | undefined;
7
- isAllSelected: ComputedRef<boolean> | undefined;
8
7
  selected: ComputedRef<any[]> | undefined;
9
8
  select: ((a: any) => void) | undefined;
10
9
  unselect: ((a: any) => void) | undefined;
11
- selectAll: ((a: any) => void) | undefined;
10
+ isAllSelected: ComputedRef<boolean> | undefined;
12
11
  unselectAll: (() => void) | undefined;
13
12
  };
14
13
  export declare function useSelectable<T extends Record<K, string | number>, K extends keyof T>(data: Ref<Array<T>>, key: K): {
@@ -4,7 +4,6 @@ export declare const toggleKey: InjectionKey<(a: Array<any>) => void>;
4
4
  export declare const isSelectedKey: InjectionKey<(a: any) => boolean>;
5
5
  export declare const allSelectedKey: InjectionKey<ComputedRef<any[]>>;
6
6
  export declare const selectKey: InjectionKey<(a: any) => void>;
7
- export declare const selectAllKey: InjectionKey<(a: any) => void>;
8
7
  export declare const unselectKey: InjectionKey<(a: any) => void>;
9
8
  export declare const isAllSelectedKey: InjectionKey<ComputedRef<boolean>>;
10
9
  export declare const unselectAllKey: InjectionKey<() => void>;
@@ -15,14 +15,14 @@ declare const _default: {
15
15
  $slots: Readonly<{
16
16
  [name: string]: import("vue").Slot | undefined;
17
17
  }>;
18
- $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
19
- $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
18
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
19
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
20
20
  $emit: (event: string, ...args: any[]) => void;
21
21
  $el: any;
22
22
  $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
23
23
  data: any;
24
24
  itemHeight: (a: number) => number;
25
- }>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string> & {
25
+ }>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}> & {
26
26
  beforeCreate?: ((() => void) | (() => void)[]) | undefined;
27
27
  created?: ((() => void) | (() => void)[]) | undefined;
28
28
  beforeMount?: ((() => void) | (() => void)[]) | undefined;
@@ -37,22 +37,22 @@ declare const _default: {
37
37
  unmounted?: ((() => void) | (() => void)[]) | undefined;
38
38
  renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
39
39
  renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
40
- errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void)[]) | undefined;
40
+ errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
41
41
  };
42
42
  $forceUpdate: () => void;
43
43
  $nextTick: typeof import("vue").nextTick;
44
- $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
44
+ $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
45
45
  } & Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
46
46
  data: any;
47
47
  itemHeight: (a: number) => number;
48
- }>>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {};
48
+ }>>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
49
49
  __isFragment?: undefined;
50
50
  __isTeleport?: undefined;
51
51
  __isSuspense?: undefined;
52
52
  } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
53
53
  data: any;
54
54
  itemHeight: (a: number) => number;
55
- }>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
55
+ }>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
56
56
  $slots: {
57
57
  default: (_: {
58
58
  data: any;
@@ -61,8 +61,8 @@ declare const _default: {
61
61
  };
62
62
  });
63
63
  export default _default;
64
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
65
- type __VLS_TypePropsToRuntimeProps<T> = {
64
+ declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
65
+ declare type __VLS_TypePropsToRuntimeProps<T> = {
66
66
  [K in keyof T]-?: {} extends Pick<T, K> ? {
67
67
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
68
68
  } : {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazycatcloud/lzc-toolkit",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "description": "lazycat ui toolkits",
5
5
  "main": "./dist/index.umd.js",
6
6
  "module": "./dist/index.es.js",