little-dizzy 2.4.0 → 2.6.0

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.
@@ -1,10 +1,10 @@
1
- import { createElementBlock as p, openBlock as c, normalizeClass as w, renderSlot as f, createCommentVNode as h, createElementVNode as l, toDisplayString as _, normalizeStyle as S, ref as b, createBlock as L, Teleport as I, createVNode as E, TransitionGroup as V, withCtx as T, Fragment as j, renderList as O, createTextVNode as A, createStaticVNode as z, watch as D } from "vue";
2
- const v = (e, t) => {
3
- const s = e.__vccOpts || e;
4
- for (const [d, i] of t)
5
- s[d] = i;
6
- return s;
7
- }, N = ["disabled"], H = {
1
+ import { createElementBlock as n, openBlock as a, normalizeClass as C, renderSlot as _, createCommentVNode as f, createElementVNode as l, toDisplayString as V, normalizeStyle as w, ref as z, createBlock as R, Teleport as Z, createVNode as ee, TransitionGroup as te, withCtx as U, Fragment as $, renderList as S, computed as I, onMounted as j, onUnmounted as q, watch as G, createStaticVNode as W, createTextVNode as X, shallowRef as Y, Transition as se, withDirectives as ae, vShow as oe } from "vue";
2
+ const B = (e, t) => {
3
+ const o = e.__vccOpts || e;
4
+ for (const [r, d] of t)
5
+ o[r] = d;
6
+ return o;
7
+ }, ne = ["disabled"], le = {
8
8
  __name: "Button",
9
9
  props: {
10
10
  // 按钮类型
@@ -32,29 +32,29 @@ const v = (e, t) => {
32
32
  },
33
33
  emits: ["click"],
34
34
  setup(e, { emit: t }) {
35
- return (s, d) => (c(), p("button", {
36
- class: w(["btn", [
35
+ return (o, r) => (a(), n("button", {
36
+ class: C(["btn", [
37
37
  `btn-${e.type}`,
38
38
  `btn-${e.size}`,
39
39
  { "btn-block": e.block },
40
40
  { "btn-disabled": e.disabled }
41
41
  ]]),
42
42
  disabled: e.disabled,
43
- onClick: d[0] || (d[0] = (i) => s.$emit("click", i))
43
+ onClick: r[0] || (r[0] = (d) => o.$emit("click", d))
44
44
  }, [
45
- f(s.$slots, "default", {}, void 0, !0)
46
- ], 10, N));
45
+ _(o.$slots, "default", {}, void 0, !0)
46
+ ], 10, ne));
47
47
  }
48
- }, F = /* @__PURE__ */ v(H, [["__scopeId", "data-v-75f082b2"]]), R = {
48
+ }, re = /* @__PURE__ */ B(le, [["__scopeId", "data-v-75f082b2"]]), ie = {
49
49
  key: 0,
50
50
  class: "card-header"
51
- }, Y = {
51
+ }, ce = {
52
52
  key: 0,
53
53
  class: "card-header-title"
54
- }, G = { class: "card-body" }, P = {
54
+ }, de = { class: "card-body" }, ue = {
55
55
  key: 1,
56
56
  class: "card-footer"
57
- }, U = {
57
+ }, pe = {
58
58
  __name: "Card",
59
59
  props: {
60
60
  // 卡片标题
@@ -69,31 +69,31 @@ const v = (e, t) => {
69
69
  }
70
70
  },
71
71
  setup(e) {
72
- return (t, s) => (c(), p("div", {
73
- class: w(["card", { "card-shadow": e.shadow }])
72
+ return (t, o) => (a(), n("div", {
73
+ class: C(["card", { "card-shadow": e.shadow }])
74
74
  }, [
75
- t.$slots.header || e.title ? (c(), p("div", R, [
76
- e.title ? (c(), p("h3", Y, _(e.title), 1)) : h("", !0),
77
- f(t.$slots, "header", {}, void 0, !0)
78
- ])) : h("", !0),
79
- l("div", G, [
80
- f(t.$slots, "default", {}, void 0, !0)
75
+ t.$slots.header || e.title ? (a(), n("div", ie, [
76
+ e.title ? (a(), n("h3", ce, V(e.title), 1)) : f("", !0),
77
+ _(t.$slots, "header", {}, void 0, !0)
78
+ ])) : f("", !0),
79
+ l("div", de, [
80
+ _(t.$slots, "default", {}, void 0, !0)
81
81
  ]),
82
- t.$slots.footer ? (c(), p("div", P, [
83
- f(t.$slots, "footer", {}, void 0, !0)
84
- ])) : h("", !0)
82
+ t.$slots.footer ? (a(), n("div", ue, [
83
+ _(t.$slots, "footer", {}, void 0, !0)
84
+ ])) : f("", !0)
85
85
  ], 2));
86
86
  }
87
- }, W = /* @__PURE__ */ v(U, [["__scopeId", "data-v-1e2b2467"]]), q = { class: "modal-dialog" }, X = { class: "modal-header" }, J = {
87
+ }, me = /* @__PURE__ */ B(pe, [["__scopeId", "data-v-1e2b2467"]]), ge = { class: "modal-dialog" }, ve = { class: "modal-header" }, he = {
88
88
  key: 0,
89
89
  class: "modal-header-title"
90
- }, K = { class: "modal-body" }, Q = {
90
+ }, fe = { class: "modal-body" }, ye = {
91
91
  key: 0,
92
92
  class: "modal-footer"
93
- }, Z = {
93
+ }, be = {
94
94
  key: 1,
95
95
  class: "modal-footer"
96
- }, ee = {
96
+ }, ke = {
97
97
  __name: "Modal",
98
98
  props: {
99
99
  // 是否显示模态框
@@ -118,59 +118,59 @@ const v = (e, t) => {
118
118
  },
119
119
  emits: ["close", "cancel", "confirm"],
120
120
  setup(e, { emit: t }) {
121
- const s = t, d = () => {
122
- s("close");
123
- }, i = () => {
124
- s("cancel");
125
- }, m = () => {
126
- s("confirm");
121
+ const o = t, r = () => {
122
+ o("close");
123
+ }, d = () => {
124
+ o("cancel");
125
+ }, c = () => {
126
+ o("confirm");
127
127
  };
128
- return (o, u) => e.visible ? (c(), p("div", {
128
+ return (s, g) => e.visible ? (a(), n("div", {
129
129
  key: 0,
130
- class: w(["modal", { "modal-show": e.visible }])
130
+ class: C(["modal", { "modal-show": e.visible }])
131
131
  }, [
132
- l("div", q, [
132
+ l("div", ge, [
133
133
  l("div", {
134
134
  class: "modal-content",
135
- style: S({ width: e.width })
135
+ style: w({ width: e.width })
136
136
  }, [
137
- l("div", X, [
138
- e.title ? (c(), p("h3", J, _(e.title), 1)) : h("", !0),
137
+ l("div", ve, [
138
+ e.title ? (a(), n("h3", he, V(e.title), 1)) : f("", !0),
139
139
  l("button", {
140
140
  class: "modal-header-close",
141
- onClick: d
141
+ onClick: r
142
142
  }, "×")
143
143
  ]),
144
- l("div", K, [
145
- f(o.$slots, "default", {}, void 0, !0)
144
+ l("div", fe, [
145
+ _(s.$slots, "default", {}, void 0, !0)
146
146
  ]),
147
- o.$slots.footer ? (c(), p("div", Q, [
148
- f(o.$slots, "footer", {}, void 0, !0)
149
- ])) : e.showFooter ? (c(), p("div", Z, [
147
+ s.$slots.footer ? (a(), n("div", ye, [
148
+ _(s.$slots, "footer", {}, void 0, !0)
149
+ ])) : e.showFooter ? (a(), n("div", be, [
150
150
  l("button", {
151
151
  class: "btn btn-secondary",
152
- onClick: i
152
+ onClick: d
153
153
  }, "取消"),
154
154
  l("button", {
155
155
  class: "btn btn-primary",
156
- onClick: m
156
+ onClick: c
157
157
  }, "确定")
158
- ])) : h("", !0)
158
+ ])) : f("", !0)
159
159
  ], 4)
160
160
  ])
161
- ], 2)) : h("", !0);
161
+ ], 2)) : f("", !0);
162
162
  }
163
- }, te = /* @__PURE__ */ v(ee, [["__scopeId", "data-v-39af2dcd"]]), se = ["innerHTML"], ae = { class: "text-sm font-medium" }, oe = ["onClick"], ne = /* @__PURE__ */ Object.assign({
163
+ }, we = /* @__PURE__ */ B(ke, [["__scopeId", "data-v-39af2dcd"]]), xe = ["innerHTML"], _e = { class: "text-sm font-medium" }, $e = ["onClick"], Be = /* @__PURE__ */ Object.assign({
164
164
  name: "Message"
165
165
  }, {
166
166
  __name: "Message",
167
167
  setup(e, { expose: t }) {
168
- const s = b([]), d = {
168
+ const o = z([]), r = {
169
169
  success: "bg-emerald-500/95 text-white",
170
170
  warning: "bg-amber-500/95 text-white",
171
171
  error: "bg-rose-500/95 text-white",
172
172
  info: "bg-sky-500/95 text-white"
173
- }, i = {
173
+ }, d = {
174
174
  success: `<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
175
175
  <path d="M20 6L9 17l-5-5" stroke-linecap="round" stroke-linejoin="round"/>
176
176
  </svg>`,
@@ -185,54 +185,54 @@ const v = (e, t) => {
185
185
  <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/>
186
186
  </svg>`
187
187
  };
188
- let m = 0;
189
- const o = (r) => {
190
- const a = ++m, n = {
191
- id: a,
192
- type: r.type || "info",
193
- content: r.content || "",
194
- duration: r.duration ?? 3e3,
195
- closable: r.closable ?? !1
188
+ let c = 0;
189
+ const s = (p) => {
190
+ const i = ++c, u = {
191
+ id: i,
192
+ type: p.type || "info",
193
+ content: p.content || "",
194
+ duration: p.duration ?? 3e3,
195
+ closable: p.closable ?? !1
196
196
  };
197
- return s.value.push(n), n.duration > 0 && setTimeout(() => {
198
- u(a);
199
- }, n.duration), a;
200
- }, u = (r) => {
201
- const a = s.value.findIndex((n) => n.id === r);
202
- a > -1 && s.value.splice(a, 1);
197
+ return o.value.push(u), u.duration > 0 && setTimeout(() => {
198
+ g(i);
199
+ }, u.duration), i;
200
+ }, g = (p) => {
201
+ const i = o.value.findIndex((u) => u.id === p);
202
+ i > -1 && o.value.splice(i, 1);
203
203
  };
204
204
  return t({
205
- addMessage: o,
206
- removeMessage: u,
205
+ addMessage: s,
206
+ removeMessage: g,
207
207
  clearAll: () => {
208
- s.value = [];
208
+ o.value = [];
209
209
  },
210
210
  // Shorthand methods
211
- success: (r, a = {}) => o({ ...a, type: "success", content: r }),
212
- warning: (r, a = {}) => o({ ...a, type: "warning", content: r }),
213
- error: (r, a = {}) => o({ ...a, type: "error", content: r }),
214
- info: (r, a = {}) => o({ ...a, type: "info", content: r })
215
- }), (r, a) => (c(), L(I, { to: "body" }, [
216
- E(V, {
211
+ success: (p, i = {}) => s({ ...i, type: "success", content: p }),
212
+ warning: (p, i = {}) => s({ ...i, type: "warning", content: p }),
213
+ error: (p, i = {}) => s({ ...i, type: "error", content: p }),
214
+ info: (p, i = {}) => s({ ...i, type: "info", content: p })
215
+ }), (p, i) => (a(), R(Z, { to: "body" }, [
216
+ ee(te, {
217
217
  name: "message",
218
218
  tag: "div",
219
219
  class: "fixed top-4 left-1/2 -translate-x-1/2 z-[9999] flex flex-col items-center gap-3 pointer-events-none"
220
220
  }, {
221
- default: T(() => [
222
- (c(!0), p(j, null, O(s.value, (n) => (c(), p("div", {
223
- key: n.id,
224
- class: w(["pointer-events-auto flex items-center gap-3 px-5 py-3 rounded-lg shadow-lg backdrop-blur-sm transition-all duration-300", d[n.type]])
221
+ default: U(() => [
222
+ (a(!0), n($, null, S(o.value, (u) => (a(), n("div", {
223
+ key: u.id,
224
+ class: C(["pointer-events-auto flex items-center gap-3 px-5 py-3 rounded-lg shadow-lg backdrop-blur-sm transition-all duration-300", r[u.type]])
225
225
  }, [
226
226
  l("span", {
227
227
  class: "flex-shrink-0",
228
- innerHTML: i[n.type]
229
- }, null, 8, se),
230
- l("span", ae, _(n.content), 1),
231
- n.closable ? (c(), p("button", {
228
+ innerHTML: d[u.type]
229
+ }, null, 8, xe),
230
+ l("span", _e, V(u.content), 1),
231
+ u.closable ? (a(), n("button", {
232
232
  key: 0,
233
- onClick: (Ie) => u(n.id),
233
+ onClick: (A) => g(u.id),
234
234
  class: "flex-shrink-0 ml-2 p-1 rounded-full hover:bg-black/10 transition-colors"
235
- }, [...a[0] || (a[0] = [
235
+ }, [...i[0] || (i[0] = [
236
236
  l("svg", {
237
237
  class: "w-4 h-4",
238
238
  viewBox: "0 0 24 24",
@@ -242,20 +242,484 @@ const v = (e, t) => {
242
242
  }, [
243
243
  l("path", { d: "M18 6L6 18M6 6l12 12" })
244
244
  ], -1)
245
- ])], 8, oe)) : h("", !0)
245
+ ])], 8, $e)) : f("", !0)
246
246
  ], 2))), 128))
247
247
  ]),
248
248
  _: 1
249
249
  })
250
250
  ]));
251
251
  }
252
- }), le = /* @__PURE__ */ v(ne, [["__scopeId", "data-v-d727fd6c"]]);
253
- b([]);
254
- let re = 0;
255
- const de = (e) => {
256
- const t = ++re, s = e.type || "info", d = e.content || "", i = e.duration ?? 3e3, m = e.closable ?? !1, o = document.createElement("div");
257
- o.className = `ld-message ld-message--${s}`, o.setAttribute("data-id", t);
258
- let g = `${{
252
+ }), ze = /* @__PURE__ */ B(Be, [["__scopeId", "data-v-d727fd6c"]]), Ce = ["src", "alt"], Se = {
253
+ key: 1,
254
+ class: "slide-title"
255
+ }, Me = {
256
+ key: 0,
257
+ class: "carousel-indicators"
258
+ }, Le = ["onClick"], Te = {
259
+ viewBox: "0 0 24 24",
260
+ width: "24",
261
+ height: "24"
262
+ }, Ie = ["d"], Ve = {
263
+ viewBox: "0 0 24 24",
264
+ width: "24",
265
+ height: "24"
266
+ }, Ae = ["d"], Ee = /* @__PURE__ */ Object.assign({
267
+ name: "Carousel"
268
+ }, {
269
+ __name: "Carousel",
270
+ props: {
271
+ items: {
272
+ type: Array,
273
+ default: () => []
274
+ },
275
+ height: {
276
+ type: String,
277
+ default: "300px"
278
+ },
279
+ direction: {
280
+ type: String,
281
+ default: "horizontal",
282
+ validator: (e) => ["horizontal", "vertical"].includes(e)
283
+ },
284
+ autoplay: {
285
+ type: Boolean,
286
+ default: !0
287
+ },
288
+ interval: {
289
+ type: Number,
290
+ default: 3e3
291
+ },
292
+ showIndicators: {
293
+ type: Boolean,
294
+ default: !0
295
+ },
296
+ showArrows: {
297
+ type: Boolean,
298
+ default: !0
299
+ }
300
+ },
301
+ emits: ["change"],
302
+ setup(e, { expose: t, emit: o }) {
303
+ const r = e, d = o, c = z(0);
304
+ let s = null;
305
+ const g = I(() => {
306
+ const v = c.value * 100;
307
+ return r.direction === "vertical" ? { transform: `translateY(-${v}%)` } : { transform: `translateX(-${v}%)` };
308
+ }), h = () => {
309
+ c.value = (c.value + 1) % r.items.length, d("change", c.value);
310
+ }, p = () => {
311
+ c.value = (c.value - 1 + r.items.length) % r.items.length, d("change", c.value);
312
+ }, i = (v) => {
313
+ c.value = v, d("change", c.value);
314
+ }, u = () => {
315
+ r.autoplay && r.items.length > 1 && (s = setInterval(h, r.interval));
316
+ }, A = () => {
317
+ s && (clearInterval(s), s = null);
318
+ };
319
+ return j(() => {
320
+ u();
321
+ }), q(() => {
322
+ A();
323
+ }), t({
324
+ next: h,
325
+ prev: p,
326
+ goTo: i,
327
+ currentIndex: c
328
+ }), (v, b) => (a(), n("div", {
329
+ class: C(["ld-carousel", { "ld-carousel--vertical": e.direction === "vertical" }]),
330
+ style: w({ height: e.height })
331
+ }, [
332
+ l("div", {
333
+ class: "carousel-container",
334
+ style: w(g.value)
335
+ }, [
336
+ (a(!0), n($, null, S(e.items, (M, L) => (a(), n("div", {
337
+ key: L,
338
+ class: C(["carousel-slide", { active: L === c.value }])
339
+ }, [
340
+ _(v.$slots, "item", {
341
+ item: M,
342
+ index: L
343
+ }, () => [
344
+ M.image ? (a(), n("img", {
345
+ key: 0,
346
+ src: M.image,
347
+ alt: M.title || ""
348
+ }, null, 8, Ce)) : f("", !0),
349
+ M.title ? (a(), n("div", Se, V(M.title), 1)) : f("", !0)
350
+ ], !0)
351
+ ], 2))), 128))
352
+ ], 4),
353
+ e.showIndicators ? (a(), n("div", Me, [
354
+ (a(!0), n($, null, S(e.items, (M, L) => (a(), n("span", {
355
+ key: L,
356
+ class: C(["indicator", { active: L === c.value }]),
357
+ onClick: (O) => i(L)
358
+ }, null, 10, Le))), 128))
359
+ ])) : f("", !0),
360
+ e.showArrows ? (a(), n($, { key: 1 }, [
361
+ l("button", {
362
+ class: "carousel-arrow prev",
363
+ onClick: p
364
+ }, [
365
+ (a(), n("svg", Te, [
366
+ l("path", {
367
+ fill: "currentColor",
368
+ d: e.direction === "vertical" ? "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z" : "M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"
369
+ }, null, 8, Ie)
370
+ ]))
371
+ ]),
372
+ l("button", {
373
+ class: "carousel-arrow next",
374
+ onClick: h
375
+ }, [
376
+ (a(), n("svg", Ve, [
377
+ l("path", {
378
+ fill: "currentColor",
379
+ d: e.direction === "vertical" ? "M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6z" : "M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
380
+ }, null, 8, Ae)
381
+ ]))
382
+ ])
383
+ ], 64)) : f("", !0)
384
+ ], 6));
385
+ }
386
+ }), Oe = /* @__PURE__ */ B(Ee, [["__scopeId", "data-v-42bf1623"]]), je = {
387
+ key: 1,
388
+ class: "dots"
389
+ }, De = {
390
+ key: 4,
391
+ class: "bars"
392
+ }, He = {
393
+ key: 5,
394
+ class: "loading-text"
395
+ }, Ne = /* @__PURE__ */ Object.assign({
396
+ name: "Loading"
397
+ }, {
398
+ __name: "Loading",
399
+ props: {
400
+ type: {
401
+ type: String,
402
+ default: "spinner",
403
+ validator: (e) => ["spinner", "dots", "ring", "pulse", "bars"].includes(e)
404
+ },
405
+ size: {
406
+ type: String,
407
+ default: "40px"
408
+ },
409
+ color: {
410
+ type: String,
411
+ default: "var(--ld-color-primary, #6366f1)"
412
+ },
413
+ text: {
414
+ type: String,
415
+ default: ""
416
+ },
417
+ fullscreen: {
418
+ type: Boolean,
419
+ default: !1
420
+ }
421
+ },
422
+ setup(e) {
423
+ const t = e, o = I(() => ({
424
+ width: t.size,
425
+ height: t.size,
426
+ "--spinner-color": t.color
427
+ })), r = I(() => ({
428
+ width: t.size,
429
+ height: t.size,
430
+ "--ring-color": t.color
431
+ }));
432
+ return (d, c) => (a(), n("div", {
433
+ class: C(["ld-loading", [`ld-loading--${e.type}`, { "ld-loading--fullscreen": e.fullscreen }]])
434
+ }, [
435
+ e.type === "spinner" ? (a(), n("div", {
436
+ key: 0,
437
+ class: "spinner",
438
+ style: w(o.value)
439
+ }, [
440
+ (a(), n($, null, S(12, (s) => l("div", {
441
+ key: s,
442
+ class: "spinner-blade"
443
+ })), 64))
444
+ ], 4)) : e.type === "dots" ? (a(), n("div", je, [
445
+ (a(), n($, null, S(3, (s) => l("span", {
446
+ key: s,
447
+ class: "dot",
448
+ style: w({ background: e.color })
449
+ }, null, 4)), 64))
450
+ ])) : e.type === "ring" ? (a(), n("div", {
451
+ key: 2,
452
+ class: "ring",
453
+ style: w(r.value)
454
+ }, [...c[0] || (c[0] = [
455
+ l("div", { class: "ring-inner" }, null, -1)
456
+ ])], 4)) : e.type === "pulse" ? (a(), n("div", {
457
+ key: 3,
458
+ class: "pulse",
459
+ style: w({ background: e.color, width: e.size, height: e.size })
460
+ }, null, 4)) : e.type === "bars" ? (a(), n("div", De, [
461
+ (a(), n($, null, S(5, (s) => l("span", {
462
+ key: s,
463
+ class: "bar",
464
+ style: w({ background: e.color })
465
+ }, null, 4)), 64))
466
+ ])) : f("", !0),
467
+ e.text ? (a(), n("div", He, V(e.text), 1)) : f("", !0)
468
+ ], 2));
469
+ }
470
+ }), Pe = /* @__PURE__ */ B(Ne, [["__scopeId", "data-v-5052ea89"]]), Ye = {
471
+ key: 0,
472
+ class: "ld-table-loading"
473
+ }, Fe = {
474
+ key: 0,
475
+ class: "loading-text"
476
+ }, Re = { class: "ld-table" }, Ue = ["onClick"], qe = { class: "th-content" }, Ge = { key: 0 }, We = ["colspan"], Xe = ["onClick"], Ke = /* @__PURE__ */ Object.assign({
477
+ name: "ldTable"
478
+ }, {
479
+ __name: "Table",
480
+ props: {
481
+ columns: {
482
+ type: Array,
483
+ required: !0
484
+ },
485
+ data: {
486
+ type: Array,
487
+ default: () => []
488
+ },
489
+ bordered: {
490
+ type: Boolean,
491
+ default: !1
492
+ },
493
+ striped: {
494
+ type: Boolean,
495
+ default: !1
496
+ },
497
+ loading: {
498
+ type: Boolean,
499
+ default: !1
500
+ },
501
+ loadingText: {
502
+ type: String,
503
+ default: ""
504
+ },
505
+ // API 相关
506
+ api: {
507
+ type: Function,
508
+ default: null
509
+ },
510
+ autoLoad: {
511
+ type: Boolean,
512
+ default: !0
513
+ },
514
+ loadParams: {
515
+ type: Object,
516
+ default: () => ({})
517
+ }
518
+ },
519
+ emits: ["row-click", "load-success", "load-error"],
520
+ setup(e, { expose: t, emit: o }) {
521
+ const r = e, d = o, c = z(!1), s = z([]), g = I(() => typeof r.api == "function"), h = I(() => r.loading || c.value), p = I(() => g.value ? s.value : r.data), i = async (y = {}) => {
522
+ if (g.value) {
523
+ c.value = !0;
524
+ try {
525
+ const k = { ...r.loadParams, ...y }, m = await r.api(k);
526
+ return s.value = Array.isArray(m) ? m : m?.data || m?.list || [], d("load-success", s.value), s.value;
527
+ } catch (k) {
528
+ throw console.error("[ld-table] Load error:", k), d("load-error", k), k;
529
+ } finally {
530
+ c.value = !1;
531
+ }
532
+ }
533
+ }, u = (y = {}) => i(y), A = () => {
534
+ s.value = [];
535
+ };
536
+ G(() => r.loadParams, (y) => {
537
+ g.value && r.autoLoad && i();
538
+ }, { deep: !0 }), j(() => {
539
+ g.value && r.autoLoad && i();
540
+ });
541
+ const v = z(""), b = z(""), M = (y) => {
542
+ v.value === y ? (b.value = b.value === "asc" ? "desc" : b.value === "desc" ? "" : "asc", b.value || (v.value = "")) : (v.value = y, b.value = "asc");
543
+ }, L = (y) => v.value !== y ? "" : b.value === "asc" ? "sort-asc" : b.value === "desc" ? "sort-desc" : "", O = I(() => {
544
+ const y = p.value;
545
+ return !v.value || !b.value ? y : [...y].sort((k, m) => {
546
+ const T = k[v.value], x = m[v.value];
547
+ if (typeof T == "number" && typeof x == "number")
548
+ return b.value === "asc" ? T - x : x - T;
549
+ const N = String(T || ""), P = String(x || "");
550
+ return b.value === "asc" ? N.localeCompare(P) : P.localeCompare(N);
551
+ });
552
+ });
553
+ return t({
554
+ load: i,
555
+ reload: u,
556
+ clear: A,
557
+ getData: () => s.value
558
+ }), (y, k) => (a(), n("div", {
559
+ class: C(["ld-table-wrapper", { "ld-table--bordered": e.bordered, "ld-table--striped": e.striped }])
560
+ }, [
561
+ h.value ? (a(), n("div", Ye, [
562
+ k[0] || (k[0] = l("div", { class: "loading-spinner" }, [
563
+ l("svg", {
564
+ class: "circular",
565
+ viewBox: "0 0 50 50"
566
+ }, [
567
+ l("circle", {
568
+ class: "path",
569
+ cx: "25",
570
+ cy: "25",
571
+ r: "20",
572
+ fill: "none"
573
+ })
574
+ ])
575
+ ], -1)),
576
+ e.loadingText ? (a(), n("span", Fe, V(e.loadingText), 1)) : f("", !0)
577
+ ])) : f("", !0),
578
+ l("table", Re, [
579
+ l("thead", null, [
580
+ l("tr", null, [
581
+ (a(!0), n($, null, S(e.columns, (m) => (a(), n("th", {
582
+ key: m.key,
583
+ style: w({ width: m.width, textAlign: m.align || "left" }),
584
+ onClick: (T) => m.sortable && M(m.key)
585
+ }, [
586
+ l("div", qe, [
587
+ l("span", null, V(m.title), 1),
588
+ m.sortable ? (a(), n("span", {
589
+ key: 0,
590
+ class: C(["sort-icon", L(m.key)])
591
+ }, [...k[1] || (k[1] = [
592
+ l("svg", {
593
+ viewBox: "0 0 24 24",
594
+ width: "14",
595
+ height: "14"
596
+ }, [
597
+ l("path", {
598
+ fill: "currentColor",
599
+ d: "M7 10l5-5 5 5H7zm0 4l5 5 5-5H7z"
600
+ })
601
+ ], -1)
602
+ ])], 2)) : f("", !0)
603
+ ])
604
+ ], 12, Ue))), 128))
605
+ ])
606
+ ]),
607
+ l("tbody", null, [
608
+ !O.value.length && !h.value ? (a(), n("tr", Ge, [
609
+ l("td", {
610
+ colspan: e.columns.length,
611
+ class: "empty-cell"
612
+ }, [
613
+ _(y.$slots, "empty", {}, () => [
614
+ k[2] || (k[2] = W('<div class="empty-content" data-v-567f3024><svg viewBox="0 0 64 41" width="64" height="41" data-v-567f3024><g transform="translate(0 1)" fill="none" fill-rule="evenodd" data-v-567f3024><ellipse fill="var(--ld-color-bg-secondary, #f5f5f5)" cx="32" cy="33" rx="32" ry="7" data-v-567f3024></ellipse><g fill-rule="nonzero" stroke="var(--ld-color-border, #d9d9d9)" data-v-567f3024><path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" data-v-567f3024></path><path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" fill="var(--ld-color-bg, #fafafa)" data-v-567f3024></path></g></g></svg><span data-v-567f3024>暂无数据</span></div>', 1))
615
+ ], !0)
616
+ ], 8, We)
617
+ ])) : f("", !0),
618
+ (a(!0), n($, null, S(O.value, (m, T) => (a(), n("tr", {
619
+ key: T,
620
+ onClick: (x) => y.$emit("row-click", m, T)
621
+ }, [
622
+ (a(!0), n($, null, S(e.columns, (x) => (a(), n("td", {
623
+ key: x.key,
624
+ style: w({ textAlign: x.align || "left" })
625
+ }, [
626
+ _(y.$slots, x.key, {
627
+ row: m,
628
+ index: T,
629
+ value: m[x.key]
630
+ }, () => [
631
+ X(V(m[x.key]), 1)
632
+ ], !0)
633
+ ], 4))), 128))
634
+ ], 8, Xe))), 128))
635
+ ])
636
+ ])
637
+ ], 2));
638
+ }
639
+ }), Je = /* @__PURE__ */ B(Ke, [["__scopeId", "data-v-567f3024"]]), Qe = {
640
+ __name: "Backtop",
641
+ props: {
642
+ // 滚动高度达到此参数值才出现
643
+ visibilityHeight: {
644
+ type: Number,
645
+ default: 200
646
+ },
647
+ // 距离页面右边距
648
+ right: {
649
+ type: Number,
650
+ default: 40
651
+ },
652
+ // 距离页面底部距离
653
+ bottom: {
654
+ type: Number,
655
+ default: 40
656
+ },
657
+ // 触发滚动的对象
658
+ target: {
659
+ type: String,
660
+ default: ""
661
+ }
662
+ },
663
+ emits: ["click"],
664
+ setup(e, { expose: t, emit: o }) {
665
+ const r = e, d = o, c = z(!1), s = Y(null);
666
+ Y(null);
667
+ const g = I(() => ({
668
+ right: `${r.right}px`,
669
+ bottom: `${r.bottom}px`
670
+ })), h = () => r.target ? document.querySelector(r.target) ?? window : window, p = () => s.value === window ? window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0 : s.value?.scrollTop ?? 0, i = () => {
671
+ c.value = p() >= r.visibilityHeight;
672
+ }, u = (v) => {
673
+ A(), d("click", v);
674
+ }, A = () => {
675
+ s.value && (s.value === window ? window.scrollTo({
676
+ top: 0,
677
+ behavior: "smooth"
678
+ }) : s.value.scrollTo({
679
+ top: 0,
680
+ behavior: "smooth"
681
+ }));
682
+ };
683
+ return j(() => {
684
+ s.value = h(), s.value && (s.value.addEventListener("scroll", i, { passive: !0 }), i());
685
+ }), q(() => {
686
+ s.value && s.value.removeEventListener("scroll", i);
687
+ }), t({
688
+ scrollToTop: A
689
+ }), (v, b) => (a(), R(se, { name: "ld-backtop-fade" }, {
690
+ default: U(() => [
691
+ ae(l("div", {
692
+ class: "ld-backtop",
693
+ style: w(g.value),
694
+ onClick: u
695
+ }, [
696
+ _(v.$slots, "default", {}, () => [
697
+ b[0] || (b[0] = l("svg", {
698
+ class: "ld-backtop-icon",
699
+ viewBox: "0 0 24 24",
700
+ width: "20",
701
+ height: "20"
702
+ }, [
703
+ l("path", {
704
+ fill: "currentColor",
705
+ d: "M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"
706
+ })
707
+ ], -1))
708
+ ], !0)
709
+ ], 4), [
710
+ [oe, c.value]
711
+ ])
712
+ ]),
713
+ _: 3
714
+ }));
715
+ }
716
+ }, Ze = /* @__PURE__ */ B(Qe, [["__scopeId", "data-v-e2cc7059"]]);
717
+ z([]);
718
+ let et = 0;
719
+ const tt = (e) => {
720
+ const t = ++et, o = e.type || "info", r = e.content || "", d = e.duration ?? 3e3, c = e.closable ?? !1, s = document.createElement("div");
721
+ s.className = `ld-message ld-message--${o}`, s.setAttribute("data-id", t);
722
+ let h = `${{
259
723
  success: `<svg class="ld-message-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
260
724
  <path d="M20 6L9 17l-5-5" stroke-linecap="round" stroke-linejoin="round"/>
261
725
  </svg>`,
@@ -269,13 +733,13 @@ const de = (e) => {
269
733
  info: `<svg class="ld-message-icon" viewBox="0 0 24 24" fill="currentColor">
270
734
  <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/>
271
735
  </svg>`
272
- }[s]}<span class="ld-message-content">${d}</span>`;
273
- return m && (g += `<button class="ld-message-close" onclick="window.__ldMessageClose(${t})">
736
+ }[o]}<span class="ld-message-content">${r}</span>`;
737
+ return c && (h += `<button class="ld-message-close" onclick="window.__ldMessageClose(${t})">
274
738
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
275
739
  <path d="M18 6L6 18M6 6l12 12"/>
276
740
  </svg>
277
- </button>`), o.innerHTML = g, { id: t, element: o, duration: i };
278
- }, ce = () => {
741
+ </button>`), s.innerHTML = h, { id: t, element: s, duration: d };
742
+ }, st = () => {
279
743
  let e = document.getElementById("ld-message-root");
280
744
  if (!e) {
281
745
  e = document.createElement("div"), e.id = "ld-message-root", document.body.appendChild(e);
@@ -344,59 +808,76 @@ const de = (e) => {
344
808
  `, document.head.appendChild(t);
345
809
  }
346
810
  return e;
347
- }, k = (e) => {
811
+ }, D = (e) => {
348
812
  const t = document.getElementById("ld-message-root");
349
813
  if (!t) return;
350
- const s = t.querySelector(`[data-id="${e}"]`);
351
- s && (s.classList.add("ld-message--closing"), setTimeout(() => {
352
- s.remove();
814
+ const o = t.querySelector(`[data-id="${e}"]`);
815
+ o && (o.classList.add("ld-message--closing"), setTimeout(() => {
816
+ o.remove();
353
817
  }, 200));
354
818
  };
355
- typeof window < "u" && (window.__ldMessageClose = k);
356
- const y = (e) => {
357
- const t = ce(), { id: s, element: d, duration: i } = de(e);
358
- return t.appendChild(d), i > 0 && setTimeout(() => {
359
- k(s);
360
- }, i), s;
361
- }, B = {
362
- success: (e, t = {}) => y({ ...t, type: "success", content: e }),
363
- warning: (e, t = {}) => y({ ...t, type: "warning", content: e }),
364
- error: (e, t = {}) => y({ ...t, type: "error", content: e }),
365
- info: (e, t = {}) => y({ ...t, type: "info", content: e }),
366
- close: k,
819
+ typeof window < "u" && (window.__ldMessageClose = D);
820
+ const E = (e) => {
821
+ const t = st(), { id: o, element: r, duration: d } = tt(e);
822
+ return t.appendChild(r), d > 0 && setTimeout(() => {
823
+ D(o);
824
+ }, d), o;
825
+ }, F = {
826
+ success: (e, t = {}) => E({ ...t, type: "success", content: e }),
827
+ warning: (e, t = {}) => E({ ...t, type: "warning", content: e }),
828
+ error: (e, t = {}) => E({ ...t, type: "error", content: e }),
829
+ info: (e, t = {}) => E({ ...t, type: "info", content: e }),
830
+ close: D,
367
831
  closeAll: () => {
368
832
  const e = document.getElementById("ld-message-root");
369
833
  e && (e.innerHTML = "");
370
834
  }
371
- }, ie = { class: "lzbutton-wrapper" }, pe = { class: "button" }, ue = /* @__PURE__ */ Object.assign({
835
+ }, at = { class: "lzbutton-wrapper" }, ot = { class: "button" }, nt = /* @__PURE__ */ Object.assign({
372
836
  name: "Lzbutton"
373
837
  }, {
374
838
  __name: "lzbutton",
375
839
  setup(e) {
376
- return (t, s) => (c(), p("div", ie, [
377
- l("button", pe, [
378
- s[1] || (s[1] = l("svg", {
840
+ return (t, o) => (a(), n("div", at, [
841
+ l("button", ot, [
842
+ o[1] || (o[1] = l("svg", {
379
843
  xmlns: "http://www.w3.org/2000/svg",
380
844
  viewBox: "0 0 36 24"
381
845
  }, [
382
846
  l("path", { d: "m18 0 8 12 10-8-4 20H4L0 4l10 8 8-12z" })
383
847
  ], -1)),
384
- f(t.$slots, "default", {}, () => [
385
- s[0] || (s[0] = A("Unlock Pro", -1))
848
+ _(t.$slots, "default", {}, () => [
849
+ o[0] || (o[0] = X("Unlock Pro", -1))
386
850
  ], !0)
387
851
  ])
388
852
  ]));
389
853
  }
390
- }), me = /* @__PURE__ */ v(ue, [["__scopeId", "data-v-7124b716"]]), ge = { class: "Lztext-wrapper" }, fe = /* @__PURE__ */ Object.assign({
854
+ }), lt = /* @__PURE__ */ B(nt, [["__scopeId", "data-v-7124b716"]]), rt = { class: "Lztext-wrapper" }, it = { class: "loader-wrapper" }, ct = /* @__PURE__ */ Object.assign({
391
855
  name: "Lztext"
392
856
  }, {
393
857
  __name: "Lztext",
858
+ props: {
859
+ /**
860
+ * 显示的文字内容
861
+ */
862
+ text: {
863
+ type: String,
864
+ default: "Generating"
865
+ }
866
+ },
394
867
  setup(e) {
395
- return (t, s) => (c(), p("div", ge, [...s[0] || (s[0] = [
396
- z('<div class="loader-wrapper" data-v-f22456dd><span class="loader-letter" data-v-f22456dd>G</span><span class="loader-letter" data-v-f22456dd>e</span><span class="loader-letter" data-v-f22456dd>n</span><span class="loader-letter" data-v-f22456dd>e</span><span class="loader-letter" data-v-f22456dd>r</span><span class="loader-letter" data-v-f22456dd>a</span><span class="loader-letter" data-v-f22456dd>t</span><span class="loader-letter" data-v-f22456dd>i</span><span class="loader-letter" data-v-f22456dd>n</span><span class="loader-letter" data-v-f22456dd>g</span><div class="loader" data-v-f22456dd></div></div>', 1)
397
- ])]));
868
+ const t = e, o = I(() => t.text.split(""));
869
+ return (r, d) => (a(), n("div", rt, [
870
+ l("div", it, [
871
+ (a(!0), n($, null, S(o.value, (c, s) => (a(), n("span", {
872
+ key: s,
873
+ class: "loader-letter",
874
+ style: w({ animationDelay: `${0.1 + s * 0.105}s` })
875
+ }, V(c === " " ? " " : c), 5))), 128)),
876
+ d[0] || (d[0] = l("div", { class: "loader" }, null, -1))
877
+ ])
878
+ ]));
398
879
  }
399
- }), he = /* @__PURE__ */ v(fe, [["__scopeId", "data-v-f22456dd"]]), ve = { class: "lztheme-wrapper" }, ye = { class: "theme__toggle-wrap" }, be = ["checked"], we = /* @__PURE__ */ Object.assign({
880
+ }), dt = /* @__PURE__ */ B(ct, [["__scopeId", "data-v-2cca50b0"]]), ut = { class: "lztheme-wrapper" }, pt = { class: "theme__toggle-wrap" }, mt = ["checked"], gt = /* @__PURE__ */ Object.assign({
400
881
  name: "Lztheme"
401
882
  }, {
402
883
  __name: "lztheme",
@@ -408,51 +889,51 @@ const y = (e) => {
408
889
  }
409
890
  },
410
891
  emits: ["update:modelValue", "change"],
411
- setup(e, { expose: t, emit: s }) {
412
- let d = 0;
413
- const i = `lztheme-toggle-${++d}-${Date.now()}`, m = e, o = s, u = b(null), g = b(m.modelValue);
414
- D(() => m.modelValue, (a) => {
415
- g.value = a;
892
+ setup(e, { expose: t, emit: o }) {
893
+ let r = 0;
894
+ const d = `lztheme-toggle-${++r}-${Date.now()}`, c = e, s = o, g = z(null), h = z(c.modelValue);
895
+ G(() => c.modelValue, (i) => {
896
+ h.value = i;
416
897
  });
417
- const r = (a) => {
418
- const n = a.target.checked;
419
- g.value = n, o("update:modelValue", n), o("change", n);
898
+ const p = (i) => {
899
+ const u = i.target.checked;
900
+ h.value = u, s("update:modelValue", u), s("change", u);
420
901
  };
421
902
  return t({
422
903
  toggle: () => {
423
- u.value && u.value.click();
904
+ g.value && g.value.click();
424
905
  },
425
- setDark: (a) => {
426
- g.value = a, o("update:modelValue", a), o("change", a);
906
+ setDark: (i) => {
907
+ h.value = i, s("update:modelValue", i), s("change", i);
427
908
  }
428
- }), (a, n) => (c(), p("div", ve, [
909
+ }), (i, u) => (a(), n("div", ut, [
429
910
  l("label", {
430
- for: i,
911
+ for: d,
431
912
  class: "theme"
432
913
  }, [
433
- l("span", ye, [
914
+ l("span", pt, [
434
915
  l("input", {
435
- id: i,
916
+ id: d,
436
917
  ref_key: "toggleRef",
437
- ref: u,
918
+ ref: g,
438
919
  class: "theme__toggle",
439
920
  type: "checkbox",
440
921
  role: "switch",
441
922
  name: "theme",
442
923
  value: "dark",
443
- checked: g.value,
444
- onChange: r
445
- }, null, 40, be),
446
- n[0] || (n[0] = z('<span class="theme__icon" data-v-e887d581><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span></span>', 1))
924
+ checked: h.value,
925
+ onChange: p
926
+ }, null, 40, mt),
927
+ u[0] || (u[0] = W('<span class="theme__icon" data-v-e887d581><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span></span>', 1))
447
928
  ])
448
929
  ])
449
930
  ]));
450
931
  }
451
- }), _e = /* @__PURE__ */ v(we, [["__scopeId", "data-v-e887d581"]]), ke = {
452
- Lzbutton: me,
453
- Lztext: he,
454
- Lztheme: _e
455
- }, xe = {
932
+ }), vt = /* @__PURE__ */ B(gt, [["__scopeId", "data-v-e887d581"]]), ht = {
933
+ Lzbutton: lt,
934
+ Lztext: dt,
935
+ Lztheme: vt
936
+ }, ft = {
456
937
  name: "Button",
457
938
  type: "vue",
458
939
  label: "Button 按钮",
@@ -466,7 +947,7 @@ const y = (e) => {
466
947
  <script setup>
467
948
  import { Button } from 'little-dizzy'
468
949
  <\/script>`
469
- }, Be = {
950
+ }, yt = {
470
951
  name: "Card",
471
952
  type: "vue",
472
953
  label: "Card 卡片",
@@ -486,7 +967,7 @@ import { Button } from 'little-dizzy'
486
967
  <script setup>
487
968
  import { Card, Button } from 'little-dizzy'
488
969
  <\/script>`
489
- }, ze = {
970
+ }, bt = {
490
971
  name: "Modal",
491
972
  type: "vue",
492
973
  label: "Modal 模态框",
@@ -511,7 +992,7 @@ import { Modal, Button } from 'little-dizzy'
511
992
 
512
993
  const visible = ref(false)
513
994
  <\/script>`
514
- }, Ce = {
995
+ }, kt = {
515
996
  name: "Message",
516
997
  type: "vue",
517
998
  label: "Message 消息提示",
@@ -551,14 +1032,93 @@ const showInfo = () => {
551
1032
  flex-wrap: wrap;
552
1033
  }
553
1034
  </style>`
554
- }, $e = [
555
- xe,
556
- Be,
557
- ze,
558
- Ce
559
- ], x = /* @__PURE__ */ new Map();
560
- function C(e) {
561
- return !e || !e.name ? (console.warn("[LittleDizzy] Snippet must have a name property"), !1) : (x.set(e.name, {
1035
+ }, wt = {
1036
+ name: "Carousel",
1037
+ type: "vue",
1038
+ label: "Carousel 轮播图",
1039
+ code: `<template>
1040
+ <Carousel :items="items" height="300px" />
1041
+ </template>
1042
+
1043
+ <script setup>
1044
+ import { Carousel } from 'little-dizzy'
1045
+
1046
+ const items = [
1047
+ { image: 'https://picsum.photos/800/300?random=1', title: '图片 1' },
1048
+ { image: 'https://picsum.photos/800/300?random=2', title: '图片 2' },
1049
+ { image: 'https://picsum.photos/800/300?random=3', title: '图片 3' }
1050
+ ]
1051
+ <\/script>`
1052
+ }, xt = {
1053
+ name: "Loading",
1054
+ type: "vue",
1055
+ label: "Loading 加载",
1056
+ code: `<template>
1057
+ <Loading type="spinner" />
1058
+ <Loading type="dots" />
1059
+ <Loading type="ring" />
1060
+ <Loading type="pulse" />
1061
+ <Loading type="bars" />
1062
+ </template>
1063
+
1064
+ <script setup>
1065
+ import { Loading } from 'little-dizzy'
1066
+ <\/script>`
1067
+ }, _t = {
1068
+ name: "Table",
1069
+ type: "vue",
1070
+ label: "Table 表格",
1071
+ code: `<template>
1072
+ <Table :columns="columns" :data="data" bordered striped />
1073
+ </template>
1074
+
1075
+ <script setup>
1076
+ import { Table } from 'little-dizzy'
1077
+
1078
+ const columns = [
1079
+ { key: 'name', title: '姓名', width: '120px' },
1080
+ { key: 'age', title: '年龄', width: '80px' },
1081
+ { key: 'address', title: '地址' }
1082
+ ]
1083
+
1084
+ const data = [
1085
+ { name: '张三', age: 28, address: '北京市朝阳区' },
1086
+ { name: '李四', age: 32, address: '上海市浦东新区' },
1087
+ { name: '王五', age: 25, address: '广州市天河区' }
1088
+ ]
1089
+ <\/script>`
1090
+ }, $t = {
1091
+ name: "Backtop",
1092
+ type: "vue",
1093
+ label: "Backtop 回到顶部",
1094
+ code: `<template>
1095
+ <!-- 基础用法 -->
1096
+ <Backtop />
1097
+
1098
+ <!-- 指定滚动容器 -->
1099
+ <Backtop target=".my-container" :visibility-height="100" />
1100
+
1101
+ <!-- 自定义内容 -->
1102
+ <Backtop>
1103
+ <span style="font-size: 12px;">UP</span>
1104
+ </Backtop>
1105
+ </template>
1106
+
1107
+ <script setup>
1108
+ import { Backtop } from 'little-dizzy'
1109
+ <\/script>`
1110
+ }, Bt = [
1111
+ ft,
1112
+ yt,
1113
+ bt,
1114
+ kt,
1115
+ wt,
1116
+ xt,
1117
+ _t,
1118
+ $t
1119
+ ], H = /* @__PURE__ */ new Map();
1120
+ function K(e) {
1121
+ return !e || !e.name ? (console.warn("[LittleDizzy] Snippet must have a name property"), !1) : (H.set(e.name, {
562
1122
  name: e.name,
563
1123
  type: e.type || "html",
564
1124
  label: e.label || e.name,
@@ -567,51 +1127,59 @@ function C(e) {
567
1127
  ...e
568
1128
  }), !0);
569
1129
  }
570
- function $(e) {
1130
+ function J(e) {
571
1131
  if (!Array.isArray(e))
572
1132
  return console.warn("[LittleDizzy] registerSnippets expects an array"), 0;
573
1133
  let t = 0;
574
- return e.forEach((s) => {
575
- C(s) && t++;
1134
+ return e.forEach((o) => {
1135
+ K(o) && t++;
576
1136
  }), t;
577
1137
  }
578
- function Me() {
1138
+ function zt() {
579
1139
  const e = {};
580
- return x.forEach((t, s) => {
581
- e[s] = t;
1140
+ return H.forEach((t, o) => {
1141
+ e[o] = t;
582
1142
  }), e;
583
1143
  }
584
- function Se(e) {
585
- return x.get(e);
1144
+ function Ct(e) {
1145
+ return H.get(e);
586
1146
  }
587
- $($e);
588
- const M = {
589
- Button: F,
590
- Card: W,
591
- Modal: te,
592
- Message: le,
593
- ...ke
594
- }, Le = (e, t = {}) => {
595
- Object.entries(M).forEach(([s, d]) => {
596
- e.component(t.prefix ? `${t.prefix}${s}` : s, d);
597
- }), e.config.globalProperties.$message = B, e.provide("message", B);
598
- }, Ve = Me, Te = C, je = $, Oe = Se, Ae = {
599
- install: Le,
600
- ...M
1147
+ J(Bt);
1148
+ const Q = {
1149
+ Button: re,
1150
+ Card: me,
1151
+ Modal: we,
1152
+ Message: ze,
1153
+ Carousel: Oe,
1154
+ Loading: Pe,
1155
+ Table: Je,
1156
+ Backtop: Ze,
1157
+ ...ht
1158
+ }, St = (e, t = {}) => {
1159
+ Object.entries(Q).forEach(([o, r]) => {
1160
+ e.component(t.prefix ? `${t.prefix}${o}` : o, r);
1161
+ }), e.config.globalProperties.$message = F, e.provide("message", F);
1162
+ }, Lt = zt, Tt = K, It = J, Vt = Ct, At = {
1163
+ install: St,
1164
+ ...Q
601
1165
  };
602
1166
  export {
603
- F as Button,
604
- W as Card,
605
- me as Lzbutton,
606
- he as Lztext,
607
- _e as Lztheme,
608
- le as Message,
609
- te as Modal,
610
- ke as customComponents,
611
- Ae as default,
612
- Oe as getSnippet,
613
- B as message,
614
- Te as registerSnippet,
615
- je as registerSnippets,
616
- Ve as snippets
1167
+ Ze as Backtop,
1168
+ re as Button,
1169
+ me as Card,
1170
+ Oe as Carousel,
1171
+ Pe as Loading,
1172
+ lt as Lzbutton,
1173
+ dt as Lztext,
1174
+ vt as Lztheme,
1175
+ ze as Message,
1176
+ we as Modal,
1177
+ Je as Table,
1178
+ ht as customComponents,
1179
+ At as default,
1180
+ Vt as getSnippet,
1181
+ F as message,
1182
+ Tt as registerSnippet,
1183
+ It as registerSnippets,
1184
+ Lt as snippets
617
1185
  };