little-dizzy 2.1.0 → 2.3.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,23 +1,23 @@
1
- import { createElementBlock as n, openBlock as a, normalizeClass as m, renderSlot as r, createCommentVNode as i, createElementVNode as s, toDisplayString as f, createTextVNode as B } from "vue";
2
- const c = (t, o) => {
3
- const e = t.__vccOpts || t;
4
- for (const [l, d] of o)
5
- e[l] = d;
6
- return e;
7
- }, _ = ["disabled"], g = {
1
+ import { createElementBlock as l, openBlock as a, normalizeClass as y, renderSlot as u, createCommentVNode as m, createElementVNode as o, toDisplayString as w, normalizeStyle as M, ref as k, createBlock as $, Teleport as S, createVNode as L, TransitionGroup as I, withCtx as E, Fragment as T, renderList as V, createTextVNode as j, createStaticVNode as O } from "vue";
2
+ const g = (e, t) => {
3
+ const s = e.__vccOpts || e;
4
+ for (const [i, d] of t)
5
+ s[i] = d;
6
+ return s;
7
+ }, A = ["disabled"], N = {
8
8
  __name: "Button",
9
9
  props: {
10
10
  // 按钮类型
11
11
  type: {
12
12
  type: String,
13
13
  default: "primary",
14
- validator: (t) => ["primary", "success", "warning", "danger", "info", "secondary"].includes(t)
14
+ validator: (e) => ["primary", "success", "warning", "danger", "info", "secondary"].includes(e)
15
15
  },
16
16
  // 按钮尺寸
17
17
  size: {
18
18
  type: String,
19
19
  default: "medium",
20
- validator: (t) => ["small", "medium", "large"].includes(t)
20
+ validator: (e) => ["small", "medium", "large"].includes(e)
21
21
  },
22
22
  // 是否为块级按钮
23
23
  block: {
@@ -31,30 +31,30 @@ const c = (t, o) => {
31
31
  }
32
32
  },
33
33
  emits: ["click"],
34
- setup(t, { emit: o }) {
35
- return (e, l) => (a(), n("button", {
36
- class: m(["btn", [
37
- `btn-${t.type}`,
38
- `btn-${t.size}`,
39
- { "btn-block": t.block },
40
- { "btn-disabled": t.disabled }
34
+ setup(e, { emit: t }) {
35
+ return (s, i) => (a(), l("button", {
36
+ class: y(["btn", [
37
+ `btn-${e.type}`,
38
+ `btn-${e.size}`,
39
+ { "btn-block": e.block },
40
+ { "btn-disabled": e.disabled }
41
41
  ]]),
42
- disabled: t.disabled,
43
- onClick: l[0] || (l[0] = (d) => e.$emit("click", d))
42
+ disabled: e.disabled,
43
+ onClick: i[0] || (i[0] = (d) => s.$emit("click", d))
44
44
  }, [
45
- r(e.$slots, "default", {}, void 0, !0)
46
- ], 10, _));
45
+ u(s.$slots, "default", {}, void 0, !0)
46
+ ], 10, A));
47
47
  }
48
- }, $ = /* @__PURE__ */ c(g, [["__scopeId", "data-v-75f082b2"]]), k = {
48
+ }, H = /* @__PURE__ */ g(N, [["__scopeId", "data-v-75f082b2"]]), F = {
49
49
  key: 0,
50
50
  class: "card-header"
51
- }, z = {
51
+ }, Y = {
52
52
  key: 0,
53
53
  class: "card-header-title"
54
- }, C = { class: "card-body" }, S = {
54
+ }, D = { class: "card-body" }, G = {
55
55
  key: 1,
56
56
  class: "card-footer"
57
- }, w = {
57
+ }, R = {
58
58
  __name: "Card",
59
59
  props: {
60
60
  // 卡片标题
@@ -68,32 +68,32 @@ const c = (t, o) => {
68
68
  default: !0
69
69
  }
70
70
  },
71
- setup(t) {
72
- return (o, e) => (a(), n("div", {
73
- class: m(["card", { "card-shadow": t.shadow }])
71
+ setup(e) {
72
+ return (t, s) => (a(), l("div", {
73
+ class: y(["card", { "card-shadow": e.shadow }])
74
74
  }, [
75
- o.$slots.header || t.title ? (a(), n("div", k, [
76
- t.title ? (a(), n("h3", z, f(t.title), 1)) : i("", !0),
77
- r(o.$slots, "header", {}, void 0, !0)
78
- ])) : i("", !0),
79
- s("div", C, [
80
- r(o.$slots, "default", {}, void 0, !0)
75
+ t.$slots.header || e.title ? (a(), l("div", F, [
76
+ e.title ? (a(), l("h3", Y, w(e.title), 1)) : m("", !0),
77
+ u(t.$slots, "header", {}, void 0, !0)
78
+ ])) : m("", !0),
79
+ o("div", D, [
80
+ u(t.$slots, "default", {}, void 0, !0)
81
81
  ]),
82
- o.$slots.footer ? (a(), n("div", S, [
83
- r(o.$slots, "footer", {}, void 0, !0)
84
- ])) : i("", !0)
82
+ t.$slots.footer ? (a(), l("div", G, [
83
+ u(t.$slots, "footer", {}, void 0, !0)
84
+ ])) : m("", !0)
85
85
  ], 2));
86
86
  }
87
- }, M = /* @__PURE__ */ c(w, [["__scopeId", "data-v-2d83e63a"]]), E = { class: "modal-dialog" }, L = { class: "modal-content" }, I = { class: "modal-header" }, x = {
87
+ }, U = /* @__PURE__ */ g(R, [["__scopeId", "data-v-2d83e63a"]]), W = { class: "modal-dialog" }, q = { class: "modal-header" }, P = {
88
88
  key: 0,
89
89
  class: "modal-header-title"
90
- }, D = { class: "modal-body" }, N = {
90
+ }, X = { class: "modal-body" }, J = {
91
91
  key: 0,
92
92
  class: "modal-footer"
93
- }, O = {
93
+ }, K = {
94
94
  key: 1,
95
95
  class: "modal-footer"
96
- }, V = {
96
+ }, Q = {
97
97
  __name: "Modal",
98
98
  props: {
99
99
  // 是否显示模态框
@@ -106,6 +106,10 @@ const c = (t, o) => {
106
106
  type: String,
107
107
  default: ""
108
108
  },
109
+ width: {
110
+ type: String,
111
+ default: "500px"
112
+ },
109
113
  // 是否显示默认底部按钮
110
114
  showFooter: {
111
115
  type: Boolean,
@@ -113,66 +117,325 @@ const c = (t, o) => {
113
117
  }
114
118
  },
115
119
  emits: ["close", "cancel", "confirm"],
116
- setup(t, { emit: o }) {
117
- const e = o, l = () => {
118
- e("close");
120
+ setup(e, { emit: t }) {
121
+ const s = t, i = () => {
122
+ s("close");
119
123
  }, d = () => {
120
- e("cancel");
121
- }, h = () => {
122
- e("confirm");
124
+ s("cancel");
125
+ }, f = () => {
126
+ s("confirm");
123
127
  };
124
- return (u, Q) => t.visible ? (a(), n("div", {
128
+ return (c, h) => e.visible ? (a(), l("div", {
125
129
  key: 0,
126
- class: m(["modal", { "modal-show": t.visible }])
130
+ class: y(["modal", { "modal-show": e.visible }])
127
131
  }, [
128
- s("div", E, [
129
- s("div", L, [
130
- s("div", I, [
131
- t.title ? (a(), n("h3", x, f(t.title), 1)) : i("", !0),
132
- s("button", {
132
+ o("div", W, [
133
+ o("div", {
134
+ class: "modal-content",
135
+ style: M({ width: e.width })
136
+ }, [
137
+ o("div", q, [
138
+ e.title ? (a(), l("h3", P, w(e.title), 1)) : m("", !0),
139
+ o("button", {
133
140
  class: "modal-header-close",
134
- onClick: l
141
+ onClick: i
135
142
  }, "×")
136
143
  ]),
137
- s("div", D, [
138
- r(u.$slots, "default", {}, void 0, !0)
144
+ o("div", X, [
145
+ u(c.$slots, "default", {}, void 0, !0)
139
146
  ]),
140
- u.$slots.footer ? (a(), n("div", N, [
141
- r(u.$slots, "footer", {}, void 0, !0)
142
- ])) : t.showFooter ? (a(), n("div", O, [
143
- s("button", {
147
+ c.$slots.footer ? (a(), l("div", J, [
148
+ u(c.$slots, "footer", {}, void 0, !0)
149
+ ])) : e.showFooter ? (a(), l("div", K, [
150
+ o("button", {
144
151
  class: "btn btn-secondary",
145
152
  onClick: d
146
153
  }, "取消"),
147
- s("button", {
154
+ o("button", {
148
155
  class: "btn btn-primary",
149
- onClick: h
156
+ onClick: f
150
157
  }, "确定")
151
- ])) : i("", !0)
152
- ])
158
+ ])) : m("", !0)
159
+ ], 4)
153
160
  ])
154
- ], 2)) : i("", !0);
161
+ ], 2)) : m("", !0);
162
+ }
163
+ }, Z = /* @__PURE__ */ g(Q, [["__scopeId", "data-v-39af2dcd"]]), ee = ["innerHTML"], te = { class: "text-sm font-medium" }, se = ["onClick"], oe = /* @__PURE__ */ Object.assign({
164
+ name: "Message"
165
+ }, {
166
+ __name: "Message",
167
+ setup(e, { expose: t }) {
168
+ const s = k([]), i = {
169
+ success: "bg-emerald-500/95 text-white",
170
+ warning: "bg-amber-500/95 text-white",
171
+ error: "bg-rose-500/95 text-white",
172
+ info: "bg-sky-500/95 text-white"
173
+ }, d = {
174
+ success: `<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
175
+ <path d="M20 6L9 17l-5-5" stroke-linecap="round" stroke-linejoin="round"/>
176
+ </svg>`,
177
+ warning: `<svg class="w-5 h-5" viewBox="0 0 24 24" fill="currentColor">
178
+ <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-2h2v2zm0-4h-2V7h2v6z"/>
179
+ </svg>`,
180
+ error: `<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
181
+ <circle cx="12" cy="12" r="10"/>
182
+ <path d="M15 9l-6 6M9 9l6 6" stroke-linecap="round"/>
183
+ </svg>`,
184
+ info: `<svg class="w-5 h-5" viewBox="0 0 24 24" fill="currentColor">
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
+ </svg>`
187
+ };
188
+ let f = 0;
189
+ const c = (r) => {
190
+ const n = ++f, p = {
191
+ id: n,
192
+ type: r.type || "info",
193
+ content: r.content || "",
194
+ duration: r.duration ?? 3e3,
195
+ closable: r.closable ?? !1
196
+ };
197
+ return s.value.push(p), p.duration > 0 && setTimeout(() => {
198
+ h(n);
199
+ }, p.duration), n;
200
+ }, h = (r) => {
201
+ const n = s.value.findIndex((p) => p.id === r);
202
+ n > -1 && s.value.splice(n, 1);
203
+ };
204
+ return t({
205
+ addMessage: c,
206
+ removeMessage: h,
207
+ clearAll: () => {
208
+ s.value = [];
209
+ },
210
+ // Shorthand methods
211
+ success: (r, n = {}) => c({ ...n, type: "success", content: r }),
212
+ warning: (r, n = {}) => c({ ...n, type: "warning", content: r }),
213
+ error: (r, n = {}) => c({ ...n, type: "error", content: r }),
214
+ info: (r, n = {}) => c({ ...n, type: "info", content: r })
215
+ }), (r, n) => (a(), $(S, { to: "body" }, [
216
+ L(I, {
217
+ name: "message",
218
+ tag: "div",
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
+ }, {
221
+ default: E(() => [
222
+ (a(!0), l(T, null, V(s.value, (p) => (a(), l("div", {
223
+ key: p.id,
224
+ class: y(["pointer-events-auto flex items-center gap-3 px-5 py-3 rounded-lg shadow-lg backdrop-blur-sm transition-all duration-300", i[p.type]])
225
+ }, [
226
+ o("span", {
227
+ class: "flex-shrink-0",
228
+ innerHTML: d[p.type]
229
+ }, null, 8, ee),
230
+ o("span", te, w(p.content), 1),
231
+ p.closable ? (a(), l("button", {
232
+ key: 0,
233
+ onClick: (Me) => h(p.id),
234
+ class: "flex-shrink-0 ml-2 p-1 rounded-full hover:bg-black/10 transition-colors"
235
+ }, [...n[0] || (n[0] = [
236
+ o("svg", {
237
+ class: "w-4 h-4",
238
+ viewBox: "0 0 24 24",
239
+ fill: "none",
240
+ stroke: "currentColor",
241
+ "stroke-width": "2"
242
+ }, [
243
+ o("path", { d: "M18 6L6 18M6 6l12 12" })
244
+ ], -1)
245
+ ])], 8, se)) : m("", !0)
246
+ ], 2))), 128))
247
+ ]),
248
+ _: 1
249
+ })
250
+ ]));
155
251
  }
156
- }, j = /* @__PURE__ */ c(V, [["__scopeId", "data-v-c66cec30"]]), A = { class: "lzbutton-wrapper" }, F = /* @__PURE__ */ Object.assign({
252
+ }), ne = /* @__PURE__ */ g(oe, [["__scopeId", "data-v-d727fd6c"]]);
253
+ k([]);
254
+ let ae = 0;
255
+ const re = (e) => {
256
+ const t = ++ae, s = e.type || "info", i = e.content || "", d = e.duration ?? 3e3, f = e.closable ?? !1, c = document.createElement("div");
257
+ c.className = `ld-message ld-message--${s}`, c.setAttribute("data-id", t);
258
+ let b = `${{
259
+ success: `<svg class="ld-message-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
260
+ <path d="M20 6L9 17l-5-5" stroke-linecap="round" stroke-linejoin="round"/>
261
+ </svg>`,
262
+ warning: `<svg class="ld-message-icon" viewBox="0 0 24 24" fill="currentColor">
263
+ <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-2h2v2zm0-4h-2V7h2v6z"/>
264
+ </svg>`,
265
+ error: `<svg class="ld-message-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
266
+ <circle cx="12" cy="12" r="10"/>
267
+ <path d="M15 9l-6 6M9 9l6 6" stroke-linecap="round"/>
268
+ </svg>`,
269
+ info: `<svg class="ld-message-icon" viewBox="0 0 24 24" fill="currentColor">
270
+ <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
+ </svg>`
272
+ }[s]}<span class="ld-message-content">${i}</span>`;
273
+ return f && (b += `<button class="ld-message-close" onclick="window.__ldMessageClose(${t})">
274
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
275
+ <path d="M18 6L6 18M6 6l12 12"/>
276
+ </svg>
277
+ </button>`), c.innerHTML = b, { id: t, element: c, duration: d };
278
+ }, le = () => {
279
+ let e = document.getElementById("ld-message-root");
280
+ if (!e) {
281
+ e = document.createElement("div"), e.id = "ld-message-root", document.body.appendChild(e);
282
+ const t = document.createElement("style");
283
+ t.textContent = `
284
+ #ld-message-root {
285
+ position: fixed;
286
+ top: 16px;
287
+ left: 50%;
288
+ transform: translateX(-50%);
289
+ z-index: 9999;
290
+ display: flex;
291
+ flex-direction: column;
292
+ align-items: center;
293
+ gap: 12px;
294
+ pointer-events: none;
295
+ }
296
+ .ld-message {
297
+ pointer-events: auto;
298
+ display: flex;
299
+ align-items: center;
300
+ gap: 12px;
301
+ padding: 12px 20px;
302
+ border-radius: 8px;
303
+ box-shadow: 0 4px 12px rgba(0,0,0,0.15);
304
+ backdrop-filter: blur(8px);
305
+ animation: ldMessageIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
306
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
307
+ font-size: 14px;
308
+ font-weight: 500;
309
+ }
310
+ .ld-message.ld-message--closing {
311
+ animation: ldMessageOut 0.2s ease-in forwards;
312
+ }
313
+ .ld-message--success { background: rgba(16, 185, 129, 0.95); color: white; }
314
+ .ld-message--warning { background: rgba(245, 158, 11, 0.95); color: white; }
315
+ .ld-message--error { background: rgba(239, 68, 68, 0.95); color: white; }
316
+ .ld-message--info { background: rgba(14, 165, 233, 0.95); color: white; }
317
+ .ld-message-icon { width: 20px; height: 20px; flex-shrink: 0; }
318
+ .ld-message-content { white-space: nowrap; }
319
+ .ld-message-close {
320
+ display: flex;
321
+ align-items: center;
322
+ justify-content: center;
323
+ width: 20px;
324
+ height: 20px;
325
+ margin-left: 4px;
326
+ padding: 0;
327
+ border: none;
328
+ background: transparent;
329
+ color: currentColor;
330
+ cursor: pointer;
331
+ border-radius: 50%;
332
+ transition: background 0.2s;
333
+ }
334
+ .ld-message-close:hover { background: rgba(255,255,255,0.2); }
335
+ .ld-message-close svg { width: 14px; height: 14px; }
336
+ @keyframes ldMessageIn {
337
+ from { opacity: 0; transform: translateY(-20px) scale(0.9); }
338
+ to { opacity: 1; transform: translateY(0) scale(1); }
339
+ }
340
+ @keyframes ldMessageOut {
341
+ from { opacity: 1; transform: translateY(0) scale(1); }
342
+ to { opacity: 0; transform: translateY(-10px) scale(0.95); }
343
+ }
344
+ `, document.head.appendChild(t);
345
+ }
346
+ return e;
347
+ }, _ = (e) => {
348
+ const t = document.getElementById("ld-message-root");
349
+ if (!t) return;
350
+ const s = t.querySelector(`[data-id="${e}"]`);
351
+ s && (s.classList.add("ld-message--closing"), setTimeout(() => {
352
+ s.remove();
353
+ }, 200));
354
+ };
355
+ typeof window < "u" && (window.__ldMessageClose = _);
356
+ const v = (e) => {
357
+ const t = le(), { id: s, element: i, duration: d } = re(e);
358
+ return t.appendChild(i), d > 0 && setTimeout(() => {
359
+ _(s);
360
+ }, d), s;
361
+ }, Se = {
362
+ success: (e, t = {}) => v({ ...t, type: "success", content: e }),
363
+ warning: (e, t = {}) => v({ ...t, type: "warning", content: e }),
364
+ error: (e, t = {}) => v({ ...t, type: "error", content: e }),
365
+ info: (e, t = {}) => v({ ...t, type: "info", content: e }),
366
+ close: _,
367
+ closeAll: () => {
368
+ const e = document.getElementById("ld-message-root");
369
+ e && (e.innerHTML = "");
370
+ }
371
+ }, ie = { class: "lzbutton-wrapper" }, ce = { class: "button" }, de = /* @__PURE__ */ Object.assign({
157
372
  name: "Lzbutton"
158
373
  }, {
159
374
  __name: "lzbutton",
160
- setup(t) {
161
- return (o, e) => (a(), n("div", A, [...e[0] || (e[0] = [
162
- s("button", { class: "button" }, [
163
- s("svg", {
375
+ setup(e) {
376
+ return (t, s) => (a(), l("div", ie, [
377
+ o("button", ce, [
378
+ s[1] || (s[1] = o("svg", {
164
379
  xmlns: "http://www.w3.org/2000/svg",
165
380
  viewBox: "0 0 36 24"
166
381
  }, [
167
- s("path", { d: "m18 0 8 12 10-8-4 20H4L0 4l10 8 8-12z" })
168
- ]),
169
- B(" Unlock Pro ")
382
+ o("path", { d: "m18 0 8 12 10-8-4 20H4L0 4l10 8 8-12z" })
383
+ ], -1)),
384
+ u(t.$slots, "default", {}, () => [
385
+ s[0] || (s[0] = j("Unlock Pro", -1))
386
+ ], !0)
387
+ ])
388
+ ]));
389
+ }
390
+ }), pe = /* @__PURE__ */ g(de, [["__scopeId", "data-v-7124b716"]]), ue = { class: "Lztext-wrapper" }, me = /* @__PURE__ */ Object.assign({
391
+ name: "Lztext"
392
+ }, {
393
+ __name: "Lztext",
394
+ setup(e) {
395
+ return (t, s) => (a(), l("div", ue, [...s[0] || (s[0] = [
396
+ O('<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
+ ])]));
398
+ }
399
+ }), ge = /* @__PURE__ */ g(me, [["__scopeId", "data-v-f22456dd"]]), fe = { class: "lztheme-wrapper" }, he = /* @__PURE__ */ Object.assign({
400
+ name: "Lztheme"
401
+ }, {
402
+ __name: "lztheme",
403
+ setup(e) {
404
+ return (t, s) => (a(), l("div", fe, [...s[0] || (s[0] = [
405
+ o("label", {
406
+ for: "theme",
407
+ class: "theme"
408
+ }, [
409
+ o("span", { class: "theme__toggle-wrap" }, [
410
+ o("input", {
411
+ id: "theme",
412
+ class: "theme__toggle",
413
+ type: "checkbox",
414
+ role: "switch",
415
+ name: "theme",
416
+ value: "dark"
417
+ }),
418
+ o("span", { class: "theme__fill" }),
419
+ o("span", { class: "theme__icon" }, [
420
+ o("span", { class: "theme__icon-part" }),
421
+ o("span", { class: "theme__icon-part" }),
422
+ o("span", { class: "theme__icon-part" }),
423
+ o("span", { class: "theme__icon-part" }),
424
+ o("span", { class: "theme__icon-part" }),
425
+ o("span", { class: "theme__icon-part" }),
426
+ o("span", { class: "theme__icon-part" }),
427
+ o("span", { class: "theme__icon-part" }),
428
+ o("span", { class: "theme__icon-part" })
429
+ ])
430
+ ])
170
431
  ], -1)
171
432
  ])]));
172
433
  }
173
- }), H = /* @__PURE__ */ c(F, [["__scopeId", "data-v-c2498af3"]]), P = {
174
- Lzbutton: H
175
- }, R = {
434
+ }), ve = /* @__PURE__ */ g(he, [["__scopeId", "data-v-0b85d094"]]), ye = {
435
+ Lzbutton: pe,
436
+ Lztext: ge,
437
+ Lztheme: ve
438
+ }, be = {
176
439
  name: "Button",
177
440
  type: "vue",
178
441
  label: "Button 按钮",
@@ -186,7 +449,7 @@ const c = (t, o) => {
186
449
  <script setup>
187
450
  import { Button } from 'little-dizzy'
188
451
  <\/script>`
189
- }, T = {
452
+ }, we = {
190
453
  name: "Card",
191
454
  type: "vue",
192
455
  label: "Card 卡片",
@@ -206,7 +469,7 @@ import { Button } from 'little-dizzy'
206
469
  <script setup>
207
470
  import { Card, Button } from 'little-dizzy'
208
471
  <\/script>`
209
- }, U = {
472
+ }, _e = {
210
473
  name: "Modal",
211
474
  type: "vue",
212
475
  label: "Modal 模态框",
@@ -231,61 +494,107 @@ import { Modal, Button } from 'little-dizzy'
231
494
 
232
495
  const visible = ref(false)
233
496
  <\/script>`
234
- }, q = [
235
- R,
236
- T,
237
- U
238
- ], p = /* @__PURE__ */ new Map();
239
- function y(t) {
240
- return !t || !t.name ? (console.warn("[LittleDizzy] Snippet must have a name property"), !1) : (p.set(t.name, {
241
- name: t.name,
242
- type: t.type || "html",
243
- label: t.label || t.name,
244
- code: t.code || "",
245
- isCustom: t.isCustom || !1,
246
- ...t
497
+ }, xe = {
498
+ name: "Message",
499
+ type: "vue",
500
+ label: "Message 消息提示",
501
+ code: `<template>
502
+ <div class="message-demo">
503
+ <Button type="success" @click="showSuccess">成功提示</Button>
504
+ <Button type="warning" @click="showWarning">警告提示</Button>
505
+ <Button type="danger" @click="showError">错误提示</Button>
506
+ <Button type="info" @click="showInfo">信息提示</Button>
507
+ </div>
508
+ </template>
509
+
510
+ <script setup>
511
+ import { Button, message } from 'little-dizzy'
512
+
513
+ const showSuccess = () => {
514
+ message.success('操作成功!')
515
+ }
516
+
517
+ const showWarning = () => {
518
+ message.warning('请注意!')
519
+ }
520
+
521
+ const showError = () => {
522
+ message.error('操作失败!')
523
+ }
524
+
525
+ const showInfo = () => {
526
+ message.info('这是一条提示信息', { duration: 5000, closable: true })
527
+ }
528
+ <\/script>
529
+
530
+ <style scoped>
531
+ .message-demo {
532
+ display: flex;
533
+ gap: 12px;
534
+ flex-wrap: wrap;
535
+ }
536
+ </style>`
537
+ }, ke = [
538
+ be,
539
+ we,
540
+ _e,
541
+ xe
542
+ ], x = /* @__PURE__ */ new Map();
543
+ function B(e) {
544
+ return !e || !e.name ? (console.warn("[LittleDizzy] Snippet must have a name property"), !1) : (x.set(e.name, {
545
+ name: e.name,
546
+ type: e.type || "html",
547
+ label: e.label || e.name,
548
+ code: e.code || "",
549
+ isCustom: e.isCustom || !1,
550
+ ...e
247
551
  }), !0);
248
552
  }
249
- function b(t) {
250
- if (!Array.isArray(t))
553
+ function z(e) {
554
+ if (!Array.isArray(e))
251
555
  return console.warn("[LittleDizzy] registerSnippets expects an array"), 0;
252
- let o = 0;
253
- return t.forEach((e) => {
254
- y(e) && o++;
255
- }), o;
256
- }
257
- function G() {
258
- const t = {};
259
- return p.forEach((o, e) => {
260
- t[e] = o;
556
+ let t = 0;
557
+ return e.forEach((s) => {
558
+ B(s) && t++;
261
559
  }), t;
262
560
  }
263
- function J(t) {
264
- return p.get(t);
561
+ function Be() {
562
+ const e = {};
563
+ return x.forEach((t, s) => {
564
+ e[s] = t;
565
+ }), e;
566
+ }
567
+ function ze(e) {
568
+ return x.get(e);
265
569
  }
266
- b(q);
267
- const v = {
268
- Button: $,
269
- Card: M,
270
- Modal: j,
271
- ...P
272
- }, K = (t, o = {}) => {
273
- Object.entries(v).forEach(([e, l]) => {
274
- t.component(o.prefix ? `${o.prefix}${e}` : e, l);
570
+ z(ke);
571
+ const C = {
572
+ Button: H,
573
+ Card: U,
574
+ Modal: Z,
575
+ Message: ne,
576
+ ...ye
577
+ }, Ce = (e, t = {}) => {
578
+ Object.entries(C).forEach(([s, i]) => {
579
+ e.component(t.prefix ? `${t.prefix}${s}` : s, i);
275
580
  });
276
- }, X = G, Y = y, Z = b, tt = J, et = {
277
- install: K,
278
- ...v
581
+ }, Le = Be, Ie = B, Ee = z, Te = ze, Ve = {
582
+ install: Ce,
583
+ ...C
279
584
  };
280
585
  export {
281
- $ as Button,
282
- M as Card,
283
- H as Lzbutton,
284
- j as Modal,
285
- P as customComponents,
286
- et as default,
287
- tt as getSnippet,
288
- Y as registerSnippet,
289
- Z as registerSnippets,
290
- X as snippets
586
+ H as Button,
587
+ U as Card,
588
+ pe as Lzbutton,
589
+ ge as Lztext,
590
+ ve as Lztheme,
591
+ ne as Message,
592
+ Z as Modal,
593
+ ye as customComponents,
594
+ Ve as default,
595
+ Te as getSnippet,
596
+ Se as message,
597
+ Ie as registerSnippet,
598
+ Ee as registerSnippets,
599
+ Le as snippets
291
600
  };