y-design-ssr 0.2.3 → 0.2.4
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/libs/button/index.css +1 -579
- package/libs/button/index.mjs +66 -111
- package/libs/button/index.umd.js +2 -203
- package/libs/button/package.json +1 -8
- package/libs/cell/index.css +1 -1077
- package/libs/cell/index.mjs +104 -167
- package/libs/cell/index.umd.js +2 -300
- package/libs/cell/package.json +1 -8
- package/libs/checkbox/index.css +1 -1053
- package/libs/checkbox/index.mjs +127 -242
- package/libs/checkbox/index.umd.js +2 -369
- package/libs/checkbox/package.json +1 -8
- package/libs/checkboxGroup/index.css +1 -422
- package/libs/checkboxGroup/index.mjs +87 -173
- package/libs/checkboxGroup/index.umd.js +2 -265
- package/libs/checkboxGroup/package.json +1 -8
- package/libs/col/index.css +1 -615
- package/libs/col/index.mjs +81 -246
- package/libs/col/index.umd.js +2 -305
- package/libs/col/package.json +1 -8
- package/libs/countdown/index.css +1 -417
- package/libs/countdown/index.mjs +71 -179
- package/libs/countdown/index.umd.js +2 -231
- package/libs/countdown/package.json +1 -8
- package/libs/dialog/index.css +1 -1405
- package/libs/dialog/index.mjs +476 -646
- package/libs/dialog/index.umd.js +2 -1128
- package/libs/dialog/package.json +1 -8
- package/libs/empty/index.css +1 -457
- package/libs/empty/index.mjs +44 -91
- package/libs/empty/index.umd.js +2 -139
- package/libs/empty/package.json +1 -8
- package/libs/form/index.css +1 -477
- package/libs/form/index.mjs +126 -226
- package/libs/form/index.umd.js +2 -319
- package/libs/form/package.json +1 -8
- package/libs/formItem/index.css +1 -477
- package/libs/formItem/index.mjs +126 -276
- package/libs/formItem/index.umd.js +2 -372
- package/libs/formItem/package.json +1 -8
- package/libs/icon/index.css +1 -982
- package/libs/icon/index.mjs +58 -107
- package/libs/icon/index.umd.js +2 -186
- package/libs/icon/package.json +1 -8
- package/libs/index.css +1 -2902
- package/libs/index.mjs +2348 -3789
- package/libs/index.umd.js +2 -5509
- package/libs/input/index.css +1 -483
- package/libs/input/index.mjs +92 -183
- package/libs/input/index.umd.js +2 -274
- package/libs/input/package.json +1 -8
- package/libs/layout/index.css +1 -684
- package/libs/layout/index.mjs +130 -230
- package/libs/layout/index.umd.js +2 -318
- package/libs/layout/package.json +1 -8
- package/libs/list/index.css +1 -440
- package/libs/list/index.mjs +207 -388
- package/libs/list/index.umd.js +2 -571
- package/libs/list/package.json +1 -8
- package/libs/loading/index.css +1 -548
- package/libs/loading/index.mjs +118 -196
- package/libs/loading/index.umd.js +2 -321
- package/libs/loading/package.json +1 -8
- package/libs/mask/index.css +1 -426
- package/libs/mask/index.mjs +70 -131
- package/libs/mask/index.umd.js +2 -201
- package/libs/mask/package.json +1 -8
- package/libs/popup/index.css +1 -465
- package/libs/popup/index.mjs +134 -210
- package/libs/popup/index.umd.js +2 -358
- package/libs/popup/package.json +1 -8
- package/libs/progress/index.css +1 -488
- package/libs/progress/index.mjs +128 -200
- package/libs/progress/index.umd.js +2 -322
- package/libs/progress/package.json +1 -8
- package/libs/pullrefresh/index.css +1 -441
- package/libs/pullrefresh/index.mjs +111 -241
- package/libs/pullrefresh/index.umd.js +2 -302
- package/libs/pullrefresh/package.json +1 -8
- package/libs/row/index.css +1 -485
- package/libs/row/index.mjs +89 -181
- package/libs/row/index.umd.js +2 -237
- package/libs/row/package.json +1 -8
- package/libs/slider/index.css +1 -558
- package/libs/slider/index.mjs +160 -356
- package/libs/slider/index.umd.js +2 -453
- package/libs/slider/package.json +1 -8
- package/libs/stepper/index.css +1 -489
- package/libs/stepper/index.mjs +101 -181
- package/libs/stepper/index.umd.js +2 -269
- package/libs/stepper/package.json +1 -8
- package/libs/swipe/index.css +1 -506
- package/libs/swipe/index.mjs +259 -542
- package/libs/swipe/index.umd.js +2 -703
- package/libs/swipe/package.json +1 -8
- package/libs/swipeItem/index.css +1 -424
- package/libs/swipeItem/index.mjs +52 -111
- package/libs/swipeItem/index.umd.js +2 -154
- package/libs/swipeItem/package.json +1 -8
- package/libs/switch/index.css +1 -472
- package/libs/switch/index.mjs +62 -121
- package/libs/switch/index.umd.js +2 -200
- package/libs/switch/package.json +1 -8
- package/libs/tab/index.mjs +68 -131
- package/libs/tab/index.umd.js +1 -190
- package/libs/tab/package.json +1 -8
- package/libs/tabs/index.css +1 -514
- package/libs/tabs/index.mjs +410 -751
- package/libs/tabs/index.umd.js +2 -1020
- package/libs/tabs/package.json +1 -8
- package/libs/toast/index.css +1 -1050
- package/libs/toast/index.mjs +114 -183
- package/libs/toast/index.umd.js +2 -306
- package/libs/toast/package.json +1 -8
- package/libs/tooltip/index.css +1 -514
- package/libs/tooltip/index.mjs +155 -293
- package/libs/tooltip/index.umd.js +2 -416
- package/libs/tooltip/package.json +1 -8
- package/package.json +5 -12
package/libs/toast/index.mjs
CHANGED
|
@@ -1,40 +1,11 @@
|
|
|
1
|
-
import { ref, reactive, defineComponent, onMounted, createVNode, Transition, withDirectives, vShow, createApp, h } from "vue";
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (Array.isArray(mods)) {
|
|
10
|
-
return mods.reduce((acc, cur) => acc + getMods(el, cur), "");
|
|
11
|
-
}
|
|
12
|
-
return Object.keys(mods).reduce(
|
|
13
|
-
(acc, cur) => acc + (mods[cur] ? getMods(el, cur) : ""),
|
|
14
|
-
""
|
|
15
|
-
);
|
|
16
|
-
};
|
|
17
|
-
const createBEM = (block) => {
|
|
18
|
-
return (el, mods) => {
|
|
19
|
-
let _el = el;
|
|
20
|
-
let _mods = mods;
|
|
21
|
-
if (_el && typeof _el !== "string") {
|
|
22
|
-
_mods = _el;
|
|
23
|
-
_el = "";
|
|
24
|
-
}
|
|
25
|
-
_el = _el ? `${block}__${_el}` : block;
|
|
26
|
-
return `${_el}${getMods(_el, _mods)}`;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
const createGlobalBem = () => {
|
|
30
|
-
return (el, mods) => {
|
|
31
|
-
if (!mods) {
|
|
32
|
-
return `y-${el}`;
|
|
33
|
-
}
|
|
34
|
-
return `${getMods(`y-${el}`, mods)}`;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
const defaultLang = {
|
|
1
|
+
import { ref as B, reactive as S, defineComponent as N, onMounted as z, createVNode as a, Transition as A, withDirectives as T, vShow as _, createApp as h, h as $ } from "vue";
|
|
2
|
+
const f = (e, t) => t ? typeof t == "string" ? ` ${e}--${t}` : Array.isArray(t) ? t.reduce((r, n) => r + f(e, n), "") : Object.keys(t).reduce(
|
|
3
|
+
(r, n) => r + (t[n] ? f(e, n) : ""),
|
|
4
|
+
""
|
|
5
|
+
) : "", D = (e) => (t, r) => {
|
|
6
|
+
let n = t, o = r;
|
|
7
|
+
return n && typeof n != "string" && (o = n, n = ""), n = n ? `${e}__${n}` : e, `${n}${f(n, o)}`;
|
|
8
|
+
}, E = () => (e, t) => t ? `${f(`y-${e}`, t)}` : `y-${e}`, M = {
|
|
38
9
|
"pull-refresh": {
|
|
39
10
|
pulling: "下拉刷新...",
|
|
40
11
|
loosing: "释放刷新...",
|
|
@@ -46,22 +17,14 @@ const defaultLang = {
|
|
|
46
17
|
validateMessage: "请输入正确内容"
|
|
47
18
|
}
|
|
48
19
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"zh-CN":
|
|
20
|
+
B("zh-CN");
|
|
21
|
+
S({
|
|
22
|
+
"zh-CN": M
|
|
52
23
|
});
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
return [
|
|
56
|
-
}
|
|
57
|
-
const parseUnit = (val) => {
|
|
58
|
-
if (isNaN(Number(val)) && typeof val === "string") {
|
|
59
|
-
return val;
|
|
60
|
-
}
|
|
61
|
-
return `${val}px`;
|
|
62
|
-
};
|
|
63
|
-
const [name, bem$1, gBem] = createNamespace("toast");
|
|
64
|
-
const _props = {
|
|
24
|
+
const v = (e) => {
|
|
25
|
+
const t = `y-${e}`;
|
|
26
|
+
return [t, D(t), E()];
|
|
27
|
+
}, I = (e) => isNaN(Number(e)) && typeof e == "string" ? e : `${e}px`, [L, d, j] = v("toast"), q = {
|
|
65
28
|
// 主文案
|
|
66
29
|
title: {
|
|
67
30
|
type: String,
|
|
@@ -85,78 +48,67 @@ const _props = {
|
|
|
85
48
|
// 关闭时回调
|
|
86
49
|
onClose: {
|
|
87
50
|
type: Function,
|
|
88
|
-
required:
|
|
51
|
+
required: !0
|
|
89
52
|
},
|
|
90
53
|
// 动画时长
|
|
91
54
|
animationDuration: {
|
|
92
55
|
type: [Number, String],
|
|
93
56
|
default: 300
|
|
94
57
|
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
slots
|
|
58
|
+
}, C = /* @__PURE__ */ N({
|
|
59
|
+
name: L,
|
|
60
|
+
props: q,
|
|
61
|
+
setup(e, {
|
|
62
|
+
slots: t
|
|
101
63
|
}) {
|
|
102
|
-
const
|
|
103
|
-
visible:
|
|
64
|
+
const r = S({
|
|
65
|
+
visible: !1
|
|
104
66
|
// 控制v-show
|
|
105
|
-
})
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
clearTimeout(timer);
|
|
110
|
-
}, Number(props.duration));
|
|
67
|
+
}), n = () => {
|
|
68
|
+
const o = setTimeout(() => {
|
|
69
|
+
r.visible = !1, clearTimeout(o);
|
|
70
|
+
}, Number(e.duration));
|
|
111
71
|
};
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
});
|
|
116
|
-
return () => {
|
|
72
|
+
return z(() => {
|
|
73
|
+
r.visible = !0, n();
|
|
74
|
+
}), () => {
|
|
117
75
|
const {
|
|
118
|
-
title,
|
|
119
|
-
message,
|
|
120
|
-
position,
|
|
121
|
-
animationDuration,
|
|
122
|
-
onClose
|
|
123
|
-
} =
|
|
124
|
-
return
|
|
125
|
-
|
|
126
|
-
|
|
76
|
+
title: o,
|
|
77
|
+
message: l,
|
|
78
|
+
position: i,
|
|
79
|
+
animationDuration: s,
|
|
80
|
+
onClose: c
|
|
81
|
+
} = e;
|
|
82
|
+
return a(A, {
|
|
83
|
+
name: j("animation", "fade"),
|
|
84
|
+
onAfterLeave: c
|
|
127
85
|
}, {
|
|
128
86
|
default: () => {
|
|
129
|
-
var
|
|
130
|
-
return [
|
|
131
|
-
|
|
132
|
-
[
|
|
87
|
+
var u;
|
|
88
|
+
return [T(a("div", {
|
|
89
|
+
class: d({
|
|
90
|
+
[i]: !0
|
|
133
91
|
}),
|
|
134
|
-
|
|
135
|
-
animationDuration: typeof
|
|
92
|
+
style: {
|
|
93
|
+
animationDuration: typeof s == "number" ? `${s}ms` : s
|
|
136
94
|
}
|
|
137
|
-
}, [
|
|
138
|
-
|
|
139
|
-
}, [((
|
|
140
|
-
|
|
141
|
-
}, [
|
|
142
|
-
|
|
143
|
-
}, [
|
|
95
|
+
}, [a("div", {
|
|
96
|
+
class: d("content")
|
|
97
|
+
}, [((u = t.icon) == null ? void 0 : u.call(t)) || null, a("div", {
|
|
98
|
+
class: d("text")
|
|
99
|
+
}, [o]), l && a("div", {
|
|
100
|
+
class: d("message")
|
|
101
|
+
}, [l])])]), [[_, r.visible]])];
|
|
144
102
|
}
|
|
145
103
|
});
|
|
146
104
|
};
|
|
147
105
|
}
|
|
148
|
-
})
|
|
149
|
-
|
|
150
|
-
const isImage = (name2) => {
|
|
151
|
-
const re = new RegExp(/\.(https|png|jpg|gif|jpeg|webp|apng)$/);
|
|
152
|
-
return re.test(name2.toLowerCase());
|
|
153
|
-
};
|
|
154
|
-
const Icon = /* @__PURE__ */ defineComponent({
|
|
155
|
-
name: cname,
|
|
106
|
+
}), [F, p] = v("icon"), G = (e) => new RegExp(/\.(https|png|jpg|gif|jpeg|webp|apng)$/).test(e.toLowerCase()), m = /* @__PURE__ */ N({
|
|
107
|
+
name: F,
|
|
156
108
|
props: {
|
|
157
109
|
dot: {
|
|
158
110
|
type: Boolean,
|
|
159
|
-
default:
|
|
111
|
+
default: !1
|
|
160
112
|
},
|
|
161
113
|
name: {
|
|
162
114
|
type: String,
|
|
@@ -199,102 +151,81 @@ const Icon = /* @__PURE__ */ defineComponent({
|
|
|
199
151
|
}
|
|
200
152
|
},
|
|
201
153
|
emits: ["click"],
|
|
202
|
-
setup(
|
|
203
|
-
slots,
|
|
204
|
-
emit
|
|
154
|
+
setup(e, {
|
|
155
|
+
slots: t,
|
|
156
|
+
emit: r
|
|
205
157
|
}) {
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
const onClick = (event) => {
|
|
212
|
-
emit("click", event);
|
|
158
|
+
const n = G(e.name), o = () => ({
|
|
159
|
+
fontSize: I(e.size),
|
|
160
|
+
color: e.color
|
|
161
|
+
}), l = (i) => {
|
|
162
|
+
r("click", i);
|
|
213
163
|
};
|
|
214
164
|
return () => {
|
|
215
165
|
const {
|
|
216
|
-
name:
|
|
217
|
-
classPrefix,
|
|
218
|
-
badge,
|
|
219
|
-
dot,
|
|
220
|
-
subColor,
|
|
221
|
-
subBg,
|
|
222
|
-
tag:
|
|
223
|
-
} =
|
|
224
|
-
return
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
166
|
+
name: i,
|
|
167
|
+
classPrefix: s,
|
|
168
|
+
badge: c,
|
|
169
|
+
dot: u,
|
|
170
|
+
subColor: x,
|
|
171
|
+
subBg: y,
|
|
172
|
+
tag: k
|
|
173
|
+
} = e;
|
|
174
|
+
return a(k, {
|
|
175
|
+
class: `${s}${n ? "" : ` y-icon--${i}`}`,
|
|
176
|
+
style: o(),
|
|
177
|
+
onClick: l
|
|
228
178
|
}, {
|
|
229
179
|
default: () => {
|
|
230
|
-
var
|
|
231
|
-
return [
|
|
232
|
-
|
|
233
|
-
}, [
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}, null)]) : null,
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
backgroundColor:
|
|
180
|
+
var b;
|
|
181
|
+
return [n ? a("em", {
|
|
182
|
+
class: p("node")
|
|
183
|
+
}, [a("img", {
|
|
184
|
+
class: p("image"),
|
|
185
|
+
src: i,
|
|
186
|
+
alt: "icon"
|
|
187
|
+
}, null)]) : null, u ? a("em", {
|
|
188
|
+
class: p("dot"),
|
|
189
|
+
style: {
|
|
190
|
+
backgroundColor: y
|
|
241
191
|
}
|
|
242
|
-
}, null) : null,
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
color:
|
|
246
|
-
backgroundColor:
|
|
192
|
+
}, null) : null, c ? a("em", {
|
|
193
|
+
class: p("badge"),
|
|
194
|
+
style: {
|
|
195
|
+
color: x,
|
|
196
|
+
backgroundColor: y
|
|
247
197
|
}
|
|
248
|
-
}, [
|
|
198
|
+
}, [c]) : null, ((b = t.default) == null ? void 0 : b.call(t)) || null];
|
|
249
199
|
}
|
|
250
200
|
});
|
|
251
201
|
};
|
|
252
202
|
}
|
|
253
203
|
});
|
|
254
|
-
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
const animation = "";
|
|
258
|
-
const theme = "";
|
|
259
|
-
const style$1 = "";
|
|
260
|
-
Icon.install = (app) => {
|
|
261
|
-
const { name: name2 } = Icon;
|
|
262
|
-
app.component(name2, Icon);
|
|
204
|
+
m.install = (e) => {
|
|
205
|
+
const { name: t } = m;
|
|
206
|
+
e.component(t, m);
|
|
263
207
|
};
|
|
264
|
-
let
|
|
265
|
-
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
const element = document.createElement("div");
|
|
280
|
-
treasures.push({ id, app: toastApp, el: element });
|
|
281
|
-
toastApp.mount(element);
|
|
282
|
-
document.body.appendChild(element);
|
|
283
|
-
};
|
|
284
|
-
const close = (id, userOnClose) => {
|
|
285
|
-
treasures.forEach((obj) => {
|
|
286
|
-
if (id === obj.id) {
|
|
287
|
-
obj.app.unmount();
|
|
288
|
-
document.body.removeChild(obj.el);
|
|
289
|
-
userOnClose == null ? void 0 : userOnClose();
|
|
290
|
-
}
|
|
208
|
+
let g = h({}), P = 0;
|
|
209
|
+
const w = [], R = (e, t) => {
|
|
210
|
+
const r = `toast${P += 1}`;
|
|
211
|
+
g = h({
|
|
212
|
+
render: () => $(
|
|
213
|
+
C,
|
|
214
|
+
{ ...e, onClose: () => U(r, e.onClose) },
|
|
215
|
+
{ icon: () => $(m, { ...t }) }
|
|
216
|
+
)
|
|
217
|
+
});
|
|
218
|
+
const o = document.createElement("div");
|
|
219
|
+
w.push({ id: r, app: g, el: o }), g.mount(o), document.body.appendChild(o);
|
|
220
|
+
}, U = (e, t) => {
|
|
221
|
+
w.forEach((r) => {
|
|
222
|
+
e === r.id && (r.app.unmount(), document.body.removeChild(r.el), t == null || t());
|
|
291
223
|
});
|
|
292
224
|
};
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
app.provide("toast", toastCreate);
|
|
225
|
+
C.install = (e) => {
|
|
226
|
+
e.provide("toast", R);
|
|
296
227
|
};
|
|
297
228
|
export {
|
|
298
|
-
|
|
299
|
-
toastCreate
|
|
229
|
+
C as default,
|
|
230
|
+
R as toastCreate
|
|
300
231
|
};
|