y-design-ssr 0.2.2 → 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- package/libs/tab/index.mjs +68 -131
- package/libs/tab/index.umd.js +1 -190
- package/libs/tab/package.json +5 -0
- 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 +5 -0
- 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 +5 -0
- 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 +5 -0
- package/package.json +5 -12
package/libs/popup/index.mjs
CHANGED
|
@@ -1,40 +1,11 @@
|
|
|
1
|
-
import { ref, reactive, defineComponent, onMounted, onUnmounted, watch, createVNode, Transition, withDirectives, vShow, computed, Teleport } 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 h, reactive as _, defineComponent as C, onMounted as B, onUnmounted as A, watch as L, createVNode as i, Transition as N, withDirectives as M, vShow as V, computed as g, Teleport as z } from "vue";
|
|
2
|
+
const k = (e, t) => t ? typeof t == "string" ? ` ${e}--${t}` : Array.isArray(t) ? t.reduce((l, a) => l + k(e, a), "") : Object.keys(t).reduce(
|
|
3
|
+
(l, a) => l + (t[a] ? k(e, a) : ""),
|
|
4
|
+
""
|
|
5
|
+
) : "", I = (e) => (t, l) => {
|
|
6
|
+
let a = t, c = l;
|
|
7
|
+
return a && typeof a != "string" && (c = a, a = ""), a = a ? `${e}__${a}` : e, `${a}${k(a, c)}`;
|
|
8
|
+
}, O = () => (e, t) => t ? `${k(`y-${e}`, t)}` : `y-${e}`, w = {
|
|
38
9
|
"pull-refresh": {
|
|
39
10
|
pulling: "下拉刷新...",
|
|
40
11
|
loosing: "释放刷新...",
|
|
@@ -46,26 +17,18 @@ const defaultLang = {
|
|
|
46
17
|
validateMessage: "请输入正确内容"
|
|
47
18
|
}
|
|
48
19
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"zh-CN":
|
|
20
|
+
h("zh-CN");
|
|
21
|
+
_({
|
|
22
|
+
"zh-CN": w
|
|
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$1, bem$1, gBem$1] = createNamespace("mask");
|
|
64
|
-
const _props$1 = {
|
|
24
|
+
const x = (e) => {
|
|
25
|
+
const t = `y-${e}`;
|
|
26
|
+
return [t, I(t), O()];
|
|
27
|
+
}, D = (e) => isNaN(Number(e)) && typeof e == "string" ? e : `${e}px`, [R, T, j] = x("mask"), U = {
|
|
65
28
|
// 控制显示
|
|
66
29
|
modelValue: {
|
|
67
30
|
type: Boolean,
|
|
68
|
-
default:
|
|
31
|
+
default: !1
|
|
69
32
|
},
|
|
70
33
|
// 层级
|
|
71
34
|
zIndex: {
|
|
@@ -90,118 +53,87 @@ const _props$1 = {
|
|
|
90
53
|
// 触摸滚动开关
|
|
91
54
|
lockScroll: {
|
|
92
55
|
type: Boolean,
|
|
93
|
-
default:
|
|
56
|
+
default: !0
|
|
94
57
|
},
|
|
95
58
|
onAfterLeave: {
|
|
96
59
|
type: Function,
|
|
97
60
|
default: null
|
|
98
61
|
}
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
props: _props$1,
|
|
62
|
+
}, r = _([]);
|
|
63
|
+
let v = 0;
|
|
64
|
+
const $ = /* @__PURE__ */ C({
|
|
65
|
+
name: R,
|
|
66
|
+
props: U,
|
|
105
67
|
emits: ["update:modelValue"],
|
|
106
|
-
setup(
|
|
107
|
-
slots
|
|
68
|
+
setup(e, {
|
|
69
|
+
slots: t
|
|
108
70
|
}) {
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
71
|
+
const l = h("");
|
|
72
|
+
B(() => {
|
|
73
|
+
l.value = `mask${v}`, v += 1, a(e.modelValue, !0);
|
|
74
|
+
}), A(() => {
|
|
75
|
+
const n = r.findIndex((o) => o._id === l.value);
|
|
76
|
+
n >= 0 && r.splice(n, 1);
|
|
77
|
+
}), L(() => e.modelValue, (n) => {
|
|
78
|
+
a(n);
|
|
114
79
|
});
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
stack.unshift({
|
|
125
|
-
_id: id.value,
|
|
126
|
-
_state: val
|
|
127
|
-
});
|
|
128
|
-
if (stack.length > 1) {
|
|
129
|
-
stack[1]._state = false;
|
|
130
|
-
}
|
|
131
|
-
} else if (!isMounted) {
|
|
132
|
-
stack.splice(0, 1);
|
|
133
|
-
if (stack.length > 0) {
|
|
134
|
-
stack[0]._state = true;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
const find = () => {
|
|
139
|
-
let _state = false;
|
|
140
|
-
for (let i = 0; i < stack.length; i++) {
|
|
141
|
-
if (stack[i]._id === id.value) {
|
|
142
|
-
_state = stack[i]._state;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
80
|
+
const a = (n, o) => {
|
|
81
|
+
n ? (r.unshift({
|
|
82
|
+
_id: l.value,
|
|
83
|
+
_state: n
|
|
84
|
+
}), r.length > 1 && (r[1]._state = !1)) : o || (r.splice(0, 1), r.length > 0 && (r[0]._state = !0));
|
|
85
|
+
}, c = () => {
|
|
86
|
+
let n = !1;
|
|
87
|
+
for (let o = 0; o < r.length; o++)
|
|
88
|
+
r[o]._id === l.value && (n = r[o]._state);
|
|
145
89
|
return {
|
|
146
|
-
_state
|
|
90
|
+
_state: n
|
|
147
91
|
};
|
|
148
|
-
}
|
|
149
|
-
const onTouchMove = (payload) => {
|
|
92
|
+
}, d = (n) => {
|
|
150
93
|
const {
|
|
151
|
-
lockScroll
|
|
152
|
-
} =
|
|
153
|
-
|
|
154
|
-
payload.preventDefault();
|
|
155
|
-
payload.stopPropagation();
|
|
156
|
-
}
|
|
94
|
+
lockScroll: o
|
|
95
|
+
} = e;
|
|
96
|
+
o && (n.preventDefault(), n.stopPropagation());
|
|
157
97
|
};
|
|
158
98
|
return () => {
|
|
159
99
|
const {
|
|
160
|
-
customClass,
|
|
161
|
-
duration,
|
|
162
|
-
zIndex,
|
|
163
|
-
customStyle,
|
|
164
|
-
onAfterLeave
|
|
165
|
-
} =
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
"onAfterLeave": onAfterLeave
|
|
100
|
+
customClass: n,
|
|
101
|
+
duration: o,
|
|
102
|
+
zIndex: f,
|
|
103
|
+
customStyle: m,
|
|
104
|
+
onAfterLeave: u
|
|
105
|
+
} = e, {
|
|
106
|
+
_state: s
|
|
107
|
+
} = c();
|
|
108
|
+
return i(N, {
|
|
109
|
+
name: j("animation", "fade"),
|
|
110
|
+
onAfterLeave: u
|
|
172
111
|
}, {
|
|
173
112
|
default: () => {
|
|
174
|
-
var
|
|
175
|
-
return [
|
|
176
|
-
|
|
177
|
-
animationDuration: `${
|
|
178
|
-
zIndex,
|
|
179
|
-
...
|
|
113
|
+
var p;
|
|
114
|
+
return [M(i("div", {
|
|
115
|
+
style: {
|
|
116
|
+
animationDuration: `${o}ms`,
|
|
117
|
+
zIndex: f,
|
|
118
|
+
...m
|
|
180
119
|
},
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}, [(
|
|
120
|
+
class: [T(), n],
|
|
121
|
+
onTouchmove: d
|
|
122
|
+
}, [(p = t.default) == null ? void 0 : p.call(t)]), [[V, s]])];
|
|
184
123
|
}
|
|
185
124
|
});
|
|
186
125
|
};
|
|
187
126
|
}
|
|
188
127
|
});
|
|
189
|
-
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
const animation = "";
|
|
193
|
-
const theme = "";
|
|
194
|
-
const style$1 = "";
|
|
195
|
-
Mask.install = (app) => {
|
|
196
|
-
const { name: name2 } = Mask;
|
|
197
|
-
app.component(name2, Mask);
|
|
128
|
+
$.install = (e) => {
|
|
129
|
+
const { name: t } = $;
|
|
130
|
+
e.component(t, $);
|
|
198
131
|
};
|
|
199
|
-
const [
|
|
200
|
-
const _props = {
|
|
132
|
+
const [F, S, P] = x("popup"), E = {
|
|
201
133
|
// 控制显示
|
|
202
134
|
modelValue: {
|
|
203
135
|
type: Boolean,
|
|
204
|
-
default:
|
|
136
|
+
default: !1
|
|
205
137
|
},
|
|
206
138
|
// 位置
|
|
207
139
|
position: {
|
|
@@ -236,7 +168,7 @@ const _props = {
|
|
|
236
168
|
// 点击遮罩是否关闭
|
|
237
169
|
isCloseOnClickMask: {
|
|
238
170
|
type: Boolean,
|
|
239
|
-
default:
|
|
171
|
+
default: !0
|
|
240
172
|
},
|
|
241
173
|
onAfterLeave: {
|
|
242
174
|
type: Function,
|
|
@@ -244,109 +176,101 @@ const _props = {
|
|
|
244
176
|
},
|
|
245
177
|
lockScroll: {
|
|
246
178
|
type: Boolean,
|
|
247
|
-
default:
|
|
179
|
+
default: !0
|
|
248
180
|
},
|
|
249
181
|
zIndex: {
|
|
250
182
|
type: Number,
|
|
251
183
|
default: 101
|
|
252
184
|
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
props: _props,
|
|
185
|
+
}, b = /* @__PURE__ */ C({
|
|
186
|
+
name: F,
|
|
187
|
+
props: E,
|
|
257
188
|
emits: ["clickMask", "update:modelValue"],
|
|
258
|
-
setup(
|
|
259
|
-
slots,
|
|
260
|
-
emit
|
|
189
|
+
setup(e, {
|
|
190
|
+
slots: t,
|
|
191
|
+
emit: l
|
|
261
192
|
}) {
|
|
262
|
-
const
|
|
193
|
+
const a = g(() => {
|
|
263
194
|
const {
|
|
264
|
-
position,
|
|
265
|
-
borderRadius,
|
|
266
|
-
customStyle,
|
|
267
|
-
duration
|
|
268
|
-
} =
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
switch (position) {
|
|
195
|
+
position: n,
|
|
196
|
+
borderRadius: o,
|
|
197
|
+
customStyle: f,
|
|
198
|
+
duration: m
|
|
199
|
+
} = e, u = D(o);
|
|
200
|
+
let s = "0";
|
|
201
|
+
switch (n) {
|
|
272
202
|
case "top":
|
|
273
|
-
|
|
203
|
+
s = ` 0 0 ${u} ${u}`;
|
|
274
204
|
break;
|
|
275
205
|
case "bottom":
|
|
276
|
-
|
|
206
|
+
s = `${u} ${u} 0 0`;
|
|
277
207
|
break;
|
|
278
208
|
case "left":
|
|
279
|
-
|
|
209
|
+
s = `0 ${u} ${u} 0`;
|
|
280
210
|
break;
|
|
281
211
|
case "right":
|
|
282
|
-
|
|
212
|
+
s = `${u} 0 0 ${u}`;
|
|
283
213
|
break;
|
|
284
214
|
default:
|
|
285
|
-
|
|
215
|
+
s = `${u}`;
|
|
286
216
|
}
|
|
287
217
|
return {
|
|
288
|
-
borderRadius:
|
|
289
|
-
animationDuration: `${
|
|
290
|
-
...
|
|
218
|
+
borderRadius: s,
|
|
219
|
+
animationDuration: `${m}ms`,
|
|
220
|
+
...f
|
|
291
221
|
};
|
|
292
|
-
})
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
}
|
|
298
|
-
};
|
|
299
|
-
const visible = computed({
|
|
300
|
-
get: () => props.modelValue,
|
|
301
|
-
set: (value) => emit("update:modelValue", value)
|
|
222
|
+
}), c = (n) => {
|
|
223
|
+
l("clickMask", n), e.isCloseOnClickMask && (d.value = !1);
|
|
224
|
+
}, d = g({
|
|
225
|
+
get: () => e.modelValue,
|
|
226
|
+
set: (n) => l("update:modelValue", n)
|
|
302
227
|
});
|
|
303
228
|
return () => {
|
|
304
229
|
const {
|
|
305
|
-
teleport,
|
|
306
|
-
position,
|
|
307
|
-
customClass,
|
|
308
|
-
duration,
|
|
309
|
-
onAfterLeave,
|
|
310
|
-
lockScroll,
|
|
311
|
-
zIndex
|
|
312
|
-
} =
|
|
313
|
-
return
|
|
314
|
-
|
|
230
|
+
teleport: n,
|
|
231
|
+
position: o,
|
|
232
|
+
customClass: f,
|
|
233
|
+
duration: m,
|
|
234
|
+
onAfterLeave: u,
|
|
235
|
+
lockScroll: s,
|
|
236
|
+
zIndex: p
|
|
237
|
+
} = e;
|
|
238
|
+
return i(z, {
|
|
239
|
+
to: n
|
|
315
240
|
}, {
|
|
316
|
-
default: () => [
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
zIndex
|
|
241
|
+
default: () => [i("div", {
|
|
242
|
+
class: S(),
|
|
243
|
+
style: {
|
|
244
|
+
zIndex: p
|
|
320
245
|
}
|
|
321
|
-
}, [
|
|
322
|
-
|
|
323
|
-
"onUpdate:modelValue": (
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
}, null),
|
|
329
|
-
|
|
246
|
+
}, [i($, {
|
|
247
|
+
modelValue: d.value,
|
|
248
|
+
"onUpdate:modelValue": (y) => d.value = y,
|
|
249
|
+
duration: m,
|
|
250
|
+
lockScroll: s,
|
|
251
|
+
onClick: c,
|
|
252
|
+
onAfterLeave: u
|
|
253
|
+
}, null), i(N, {
|
|
254
|
+
name: P("animation", `slide-${o}`)
|
|
330
255
|
}, {
|
|
331
256
|
default: () => {
|
|
332
|
-
var
|
|
333
|
-
return [
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
[
|
|
337
|
-
}),
|
|
338
|
-
}, [((
|
|
257
|
+
var y;
|
|
258
|
+
return [M(i("div", {
|
|
259
|
+
style: a.value,
|
|
260
|
+
class: [S("content", {
|
|
261
|
+
[o]: o
|
|
262
|
+
}), f]
|
|
263
|
+
}, [((y = t.default) == null ? void 0 : y.call(t)) || null]), [[V, d.value]])];
|
|
339
264
|
}
|
|
340
265
|
})])]
|
|
341
266
|
});
|
|
342
267
|
};
|
|
343
268
|
}
|
|
344
269
|
});
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
app.component(name2, Popup);
|
|
270
|
+
b.install = (e) => {
|
|
271
|
+
const { name: t } = b;
|
|
272
|
+
e.component(t, b);
|
|
349
273
|
};
|
|
350
274
|
export {
|
|
351
|
-
|
|
275
|
+
b as default
|
|
352
276
|
};
|