@lazycatcloud/lzc-toolkit 0.0.12 → 0.0.13

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