little-dizzy 2.2.0 → 2.4.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.
- package/dist/little-dizzy.css +1 -1
- package/dist/little-dizzy.js +441 -152
- package/dist/little-dizzy.umd.cjs +120 -2
- package/dist/vite.svg +25 -1
- package/package.json +63 -61
- package/src/components/Card.vue +10 -9
- package/src/components/Message.vue +156 -0
- package/src/components/Modal.vue +27 -17
- package/src/components/custom/Lztext.vue +170 -0
- package/src/components/custom/index.js +3 -1
- package/src/components/custom/lzbutton.vue +5 -5
- package/src/components/custom/lztheme.vue +97 -58
- package/src/components/message.js +238 -0
- package/src/index.js +9 -1
- package/src/snippets/presets/index.js +4 -2
- package/src/snippets/presets/message.js +45 -0
- package/src/styles/_variables.scss +8 -0
- package/src/styles/tailwind.css +1 -0
package/dist/little-dizzy.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { createElementBlock as
|
|
2
|
-
const
|
|
3
|
-
const s =
|
|
4
|
-
for (const [
|
|
5
|
-
s[
|
|
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
6
|
return s;
|
|
7
|
-
},
|
|
7
|
+
}, N = ["disabled"], H = {
|
|
8
8
|
__name: "Button",
|
|
9
9
|
props: {
|
|
10
10
|
// 按钮类型
|
|
11
11
|
type: {
|
|
12
12
|
type: String,
|
|
13
13
|
default: "primary",
|
|
14
|
-
validator: (
|
|
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: (
|
|
20
|
+
validator: (e) => ["small", "medium", "large"].includes(e)
|
|
21
21
|
},
|
|
22
22
|
// 是否为块级按钮
|
|
23
23
|
block: {
|
|
@@ -31,30 +31,30 @@ const d = (t, o) => {
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
emits: ["click"],
|
|
34
|
-
setup(
|
|
35
|
-
return (s,
|
|
36
|
-
class:
|
|
37
|
-
`btn-${
|
|
38
|
-
`btn-${
|
|
39
|
-
{ "btn-block":
|
|
40
|
-
{ "btn-disabled":
|
|
34
|
+
setup(e, { emit: t }) {
|
|
35
|
+
return (s, d) => (c(), p("button", {
|
|
36
|
+
class: w(["btn", [
|
|
37
|
+
`btn-${e.type}`,
|
|
38
|
+
`btn-${e.size}`,
|
|
39
|
+
{ "btn-block": e.block },
|
|
40
|
+
{ "btn-disabled": e.disabled }
|
|
41
41
|
]]),
|
|
42
|
-
disabled:
|
|
43
|
-
onClick:
|
|
42
|
+
disabled: e.disabled,
|
|
43
|
+
onClick: d[0] || (d[0] = (i) => s.$emit("click", i))
|
|
44
44
|
}, [
|
|
45
|
-
|
|
46
|
-
], 10,
|
|
45
|
+
f(s.$slots, "default", {}, void 0, !0)
|
|
46
|
+
], 10, N));
|
|
47
47
|
}
|
|
48
|
-
},
|
|
48
|
+
}, F = /* @__PURE__ */ v(H, [["__scopeId", "data-v-75f082b2"]]), R = {
|
|
49
49
|
key: 0,
|
|
50
50
|
class: "card-header"
|
|
51
|
-
},
|
|
51
|
+
}, Y = {
|
|
52
52
|
key: 0,
|
|
53
53
|
class: "card-header-title"
|
|
54
|
-
},
|
|
54
|
+
}, G = { class: "card-body" }, P = {
|
|
55
55
|
key: 1,
|
|
56
56
|
class: "card-footer"
|
|
57
|
-
},
|
|
57
|
+
}, U = {
|
|
58
58
|
__name: "Card",
|
|
59
59
|
props: {
|
|
60
60
|
// 卡片标题
|
|
@@ -68,32 +68,32 @@ const d = (t, o) => {
|
|
|
68
68
|
default: !0
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
-
setup(
|
|
72
|
-
return (
|
|
73
|
-
class:
|
|
71
|
+
setup(e) {
|
|
72
|
+
return (t, s) => (c(), p("div", {
|
|
73
|
+
class: w(["card", { "card-shadow": e.shadow }])
|
|
74
74
|
}, [
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
])) :
|
|
79
|
-
|
|
80
|
-
|
|
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)
|
|
81
81
|
]),
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
])) :
|
|
82
|
+
t.$slots.footer ? (c(), p("div", P, [
|
|
83
|
+
f(t.$slots, "footer", {}, void 0, !0)
|
|
84
|
+
])) : h("", !0)
|
|
85
85
|
], 2));
|
|
86
86
|
}
|
|
87
|
-
},
|
|
87
|
+
}, W = /* @__PURE__ */ v(U, [["__scopeId", "data-v-1e2b2467"]]), q = { class: "modal-dialog" }, X = { class: "modal-header" }, J = {
|
|
88
88
|
key: 0,
|
|
89
89
|
class: "modal-header-title"
|
|
90
|
-
},
|
|
90
|
+
}, K = { class: "modal-body" }, Q = {
|
|
91
91
|
key: 0,
|
|
92
92
|
class: "modal-footer"
|
|
93
|
-
},
|
|
93
|
+
}, Z = {
|
|
94
94
|
key: 1,
|
|
95
95
|
class: "modal-footer"
|
|
96
|
-
},
|
|
96
|
+
}, ee = {
|
|
97
97
|
__name: "Modal",
|
|
98
98
|
props: {
|
|
99
99
|
// 是否显示模态框
|
|
@@ -106,6 +106,10 @@ const d = (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,102 +117,342 @@ const d = (t, o) => {
|
|
|
113
117
|
}
|
|
114
118
|
},
|
|
115
119
|
emits: ["close", "cancel", "confirm"],
|
|
116
|
-
setup(
|
|
117
|
-
const s =
|
|
120
|
+
setup(e, { emit: t }) {
|
|
121
|
+
const s = t, d = () => {
|
|
118
122
|
s("close");
|
|
119
|
-
},
|
|
123
|
+
}, i = () => {
|
|
120
124
|
s("cancel");
|
|
121
|
-
},
|
|
125
|
+
}, m = () => {
|
|
122
126
|
s("confirm");
|
|
123
127
|
};
|
|
124
|
-
return (
|
|
128
|
+
return (o, u) => e.visible ? (c(), p("div", {
|
|
125
129
|
key: 0,
|
|
126
|
-
class:
|
|
130
|
+
class: w(["modal", { "modal-show": e.visible }])
|
|
127
131
|
}, [
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
l("div", q, [
|
|
133
|
+
l("div", {
|
|
134
|
+
class: "modal-content",
|
|
135
|
+
style: S({ width: e.width })
|
|
136
|
+
}, [
|
|
137
|
+
l("div", X, [
|
|
138
|
+
e.title ? (c(), p("h3", J, _(e.title), 1)) : h("", !0),
|
|
139
|
+
l("button", {
|
|
133
140
|
class: "modal-header-close",
|
|
134
|
-
onClick:
|
|
141
|
+
onClick: d
|
|
135
142
|
}, "×")
|
|
136
143
|
]),
|
|
137
|
-
|
|
138
|
-
|
|
144
|
+
l("div", K, [
|
|
145
|
+
f(o.$slots, "default", {}, void 0, !0)
|
|
139
146
|
]),
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
])) :
|
|
143
|
-
|
|
147
|
+
o.$slots.footer ? (c(), p("div", Q, [
|
|
148
|
+
f(o.$slots, "footer", {}, void 0, !0)
|
|
149
|
+
])) : e.showFooter ? (c(), p("div", Z, [
|
|
150
|
+
l("button", {
|
|
144
151
|
class: "btn btn-secondary",
|
|
145
|
-
onClick:
|
|
152
|
+
onClick: i
|
|
146
153
|
}, "取消"),
|
|
147
|
-
|
|
154
|
+
l("button", {
|
|
148
155
|
class: "btn btn-primary",
|
|
149
|
-
onClick:
|
|
156
|
+
onClick: m
|
|
150
157
|
}, "确定")
|
|
151
|
-
])) :
|
|
152
|
-
])
|
|
158
|
+
])) : h("", !0)
|
|
159
|
+
], 4)
|
|
153
160
|
])
|
|
154
|
-
], 2)) :
|
|
161
|
+
], 2)) : h("", !0);
|
|
155
162
|
}
|
|
156
|
-
},
|
|
163
|
+
}, te = /* @__PURE__ */ v(ee, [["__scopeId", "data-v-39af2dcd"]]), se = ["innerHTML"], ae = { class: "text-sm font-medium" }, oe = ["onClick"], ne = /* @__PURE__ */ Object.assign({
|
|
164
|
+
name: "Message"
|
|
165
|
+
}, {
|
|
166
|
+
__name: "Message",
|
|
167
|
+
setup(e, { expose: t }) {
|
|
168
|
+
const s = b([]), d = {
|
|
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
|
+
}, i = {
|
|
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 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
|
|
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);
|
|
203
|
+
};
|
|
204
|
+
return t({
|
|
205
|
+
addMessage: o,
|
|
206
|
+
removeMessage: u,
|
|
207
|
+
clearAll: () => {
|
|
208
|
+
s.value = [];
|
|
209
|
+
},
|
|
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, {
|
|
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: 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]])
|
|
225
|
+
}, [
|
|
226
|
+
l("span", {
|
|
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", {
|
|
232
|
+
key: 0,
|
|
233
|
+
onClick: (Ie) => u(n.id),
|
|
234
|
+
class: "flex-shrink-0 ml-2 p-1 rounded-full hover:bg-black/10 transition-colors"
|
|
235
|
+
}, [...a[0] || (a[0] = [
|
|
236
|
+
l("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
|
+
l("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
244
|
+
], -1)
|
|
245
|
+
])], 8, oe)) : h("", !0)
|
|
246
|
+
], 2))), 128))
|
|
247
|
+
]),
|
|
248
|
+
_: 1
|
|
249
|
+
})
|
|
250
|
+
]));
|
|
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 = `${{
|
|
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">${d}</span>`;
|
|
273
|
+
return m && (g += `<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>`), o.innerHTML = g, { id: t, element: o, duration: i };
|
|
278
|
+
}, ce = () => {
|
|
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
|
+
}, k = (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 = 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,
|
|
367
|
+
closeAll: () => {
|
|
368
|
+
const e = document.getElementById("ld-message-root");
|
|
369
|
+
e && (e.innerHTML = "");
|
|
370
|
+
}
|
|
371
|
+
}, ie = { class: "lzbutton-wrapper" }, pe = { class: "button" }, ue = /* @__PURE__ */ Object.assign({
|
|
157
372
|
name: "Lzbutton"
|
|
158
373
|
}, {
|
|
159
374
|
__name: "lzbutton",
|
|
160
|
-
setup(
|
|
161
|
-
return (
|
|
162
|
-
|
|
163
|
-
|
|
375
|
+
setup(e) {
|
|
376
|
+
return (t, s) => (c(), p("div", ie, [
|
|
377
|
+
l("button", pe, [
|
|
378
|
+
s[1] || (s[1] = l("svg", {
|
|
164
379
|
xmlns: "http://www.w3.org/2000/svg",
|
|
165
380
|
viewBox: "0 0 36 24"
|
|
166
381
|
}, [
|
|
167
|
-
|
|
168
|
-
]),
|
|
169
|
-
|
|
170
|
-
|
|
382
|
+
l("path", { d: "m18 0 8 12 10-8-4 20H4L0 4l10 8 8-12z" })
|
|
383
|
+
], -1)),
|
|
384
|
+
f(t.$slots, "default", {}, () => [
|
|
385
|
+
s[0] || (s[0] = A("Unlock Pro", -1))
|
|
386
|
+
], !0)
|
|
387
|
+
])
|
|
388
|
+
]));
|
|
389
|
+
}
|
|
390
|
+
}), me = /* @__PURE__ */ v(ue, [["__scopeId", "data-v-7124b716"]]), ge = { class: "Lztext-wrapper" }, fe = /* @__PURE__ */ Object.assign({
|
|
391
|
+
name: "Lztext"
|
|
392
|
+
}, {
|
|
393
|
+
__name: "Lztext",
|
|
394
|
+
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)
|
|
171
397
|
])]));
|
|
172
398
|
}
|
|
173
|
-
}),
|
|
399
|
+
}), he = /* @__PURE__ */ v(fe, [["__scopeId", "data-v-f22456dd"]]), ve = { class: "lztheme-wrapper" }, ye = { class: "theme__toggle-wrap" }, be = ["checked"], we = /* @__PURE__ */ Object.assign({
|
|
174
400
|
name: "Lztheme"
|
|
175
401
|
}, {
|
|
176
402
|
__name: "lztheme",
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
403
|
+
props: {
|
|
404
|
+
// 是否为暗色主题
|
|
405
|
+
modelValue: {
|
|
406
|
+
type: Boolean,
|
|
407
|
+
default: !1
|
|
408
|
+
}
|
|
409
|
+
},
|
|
410
|
+
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;
|
|
416
|
+
});
|
|
417
|
+
const r = (a) => {
|
|
418
|
+
const n = a.target.checked;
|
|
419
|
+
g.value = n, o("update:modelValue", n), o("change", n);
|
|
420
|
+
};
|
|
421
|
+
return t({
|
|
422
|
+
toggle: () => {
|
|
423
|
+
u.value && u.value.click();
|
|
424
|
+
},
|
|
425
|
+
setDark: (a) => {
|
|
426
|
+
g.value = a, o("update:modelValue", a), o("change", a);
|
|
427
|
+
}
|
|
428
|
+
}), (a, n) => (c(), p("div", ve, [
|
|
429
|
+
l("label", {
|
|
430
|
+
for: i,
|
|
181
431
|
class: "theme"
|
|
182
432
|
}, [
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
id:
|
|
433
|
+
l("span", ye, [
|
|
434
|
+
l("input", {
|
|
435
|
+
id: i,
|
|
436
|
+
ref_key: "toggleRef",
|
|
437
|
+
ref: u,
|
|
186
438
|
class: "theme__toggle",
|
|
187
439
|
type: "checkbox",
|
|
188
440
|
role: "switch",
|
|
189
441
|
name: "theme",
|
|
190
|
-
value: "dark"
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
e("span", { class: "theme__icon-part" }),
|
|
196
|
-
e("span", { class: "theme__icon-part" }),
|
|
197
|
-
e("span", { class: "theme__icon-part" }),
|
|
198
|
-
e("span", { class: "theme__icon-part" }),
|
|
199
|
-
e("span", { class: "theme__icon-part" }),
|
|
200
|
-
e("span", { class: "theme__icon-part" }),
|
|
201
|
-
e("span", { class: "theme__icon-part" }),
|
|
202
|
-
e("span", { class: "theme__icon-part" })
|
|
203
|
-
])
|
|
442
|
+
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))
|
|
204
447
|
])
|
|
205
|
-
]
|
|
206
|
-
])
|
|
448
|
+
])
|
|
449
|
+
]));
|
|
207
450
|
}
|
|
208
|
-
}),
|
|
209
|
-
Lzbutton:
|
|
210
|
-
|
|
211
|
-
|
|
451
|
+
}), _e = /* @__PURE__ */ v(we, [["__scopeId", "data-v-e887d581"]]), ke = {
|
|
452
|
+
Lzbutton: me,
|
|
453
|
+
Lztext: he,
|
|
454
|
+
Lztheme: _e
|
|
455
|
+
}, xe = {
|
|
212
456
|
name: "Button",
|
|
213
457
|
type: "vue",
|
|
214
458
|
label: "Button 按钮",
|
|
@@ -222,7 +466,7 @@ const d = (t, o) => {
|
|
|
222
466
|
<script setup>
|
|
223
467
|
import { Button } from 'little-dizzy'
|
|
224
468
|
<\/script>`
|
|
225
|
-
},
|
|
469
|
+
}, Be = {
|
|
226
470
|
name: "Card",
|
|
227
471
|
type: "vue",
|
|
228
472
|
label: "Card 卡片",
|
|
@@ -242,7 +486,7 @@ import { Button } from 'little-dizzy'
|
|
|
242
486
|
<script setup>
|
|
243
487
|
import { Card, Button } from 'little-dizzy'
|
|
244
488
|
<\/script>`
|
|
245
|
-
},
|
|
489
|
+
}, ze = {
|
|
246
490
|
name: "Modal",
|
|
247
491
|
type: "vue",
|
|
248
492
|
label: "Modal 模态框",
|
|
@@ -267,62 +511,107 @@ import { Modal, Button } from 'little-dizzy'
|
|
|
267
511
|
|
|
268
512
|
const visible = ref(false)
|
|
269
513
|
<\/script>`
|
|
270
|
-
},
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
514
|
+
}, Ce = {
|
|
515
|
+
name: "Message",
|
|
516
|
+
type: "vue",
|
|
517
|
+
label: "Message 消息提示",
|
|
518
|
+
code: `<template>
|
|
519
|
+
<div class="message-demo">
|
|
520
|
+
<Button type="success" @click="showSuccess">成功提示</Button>
|
|
521
|
+
<Button type="warning" @click="showWarning">警告提示</Button>
|
|
522
|
+
<Button type="danger" @click="showError">错误提示</Button>
|
|
523
|
+
<Button type="info" @click="showInfo">信息提示</Button>
|
|
524
|
+
</div>
|
|
525
|
+
</template>
|
|
526
|
+
|
|
527
|
+
<script setup>
|
|
528
|
+
import { Button, message } from 'little-dizzy'
|
|
529
|
+
|
|
530
|
+
const showSuccess = () => {
|
|
531
|
+
message.success('操作成功!')
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
const showWarning = () => {
|
|
535
|
+
message.warning('请注意!')
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
const showError = () => {
|
|
539
|
+
message.error('操作失败!')
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
const showInfo = () => {
|
|
543
|
+
message.info('这是一条提示信息', { duration: 5000, closable: true })
|
|
544
|
+
}
|
|
545
|
+
<\/script>
|
|
546
|
+
|
|
547
|
+
<style scoped>
|
|
548
|
+
.message-demo {
|
|
549
|
+
display: flex;
|
|
550
|
+
gap: 12px;
|
|
551
|
+
flex-wrap: wrap;
|
|
552
|
+
}
|
|
553
|
+
</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, {
|
|
562
|
+
name: e.name,
|
|
563
|
+
type: e.type || "html",
|
|
564
|
+
label: e.label || e.name,
|
|
565
|
+
code: e.code || "",
|
|
566
|
+
isCustom: e.isCustom || !1,
|
|
567
|
+
...e
|
|
283
568
|
}), !0);
|
|
284
569
|
}
|
|
285
|
-
function
|
|
286
|
-
if (!Array.isArray(
|
|
570
|
+
function $(e) {
|
|
571
|
+
if (!Array.isArray(e))
|
|
287
572
|
return console.warn("[LittleDizzy] registerSnippets expects an array"), 0;
|
|
288
|
-
let
|
|
289
|
-
return
|
|
290
|
-
|
|
291
|
-
}), o;
|
|
292
|
-
}
|
|
293
|
-
function Q() {
|
|
294
|
-
const t = {};
|
|
295
|
-
return p.forEach((o, s) => {
|
|
296
|
-
t[s] = o;
|
|
573
|
+
let t = 0;
|
|
574
|
+
return e.forEach((s) => {
|
|
575
|
+
C(s) && t++;
|
|
297
576
|
}), t;
|
|
298
577
|
}
|
|
299
|
-
function
|
|
300
|
-
|
|
578
|
+
function Me() {
|
|
579
|
+
const e = {};
|
|
580
|
+
return x.forEach((t, s) => {
|
|
581
|
+
e[s] = t;
|
|
582
|
+
}), e;
|
|
583
|
+
}
|
|
584
|
+
function Se(e) {
|
|
585
|
+
return x.get(e);
|
|
301
586
|
}
|
|
302
|
-
|
|
303
|
-
const
|
|
304
|
-
Button:
|
|
305
|
-
Card:
|
|
306
|
-
Modal:
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
},
|
|
313
|
-
|
|
314
|
-
|
|
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
|
|
315
601
|
};
|
|
316
602
|
export {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
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
|
|
328
617
|
};
|