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/progress/index.mjs
CHANGED
|
@@ -1,40 +1,11 @@
|
|
|
1
|
-
import { ref, reactive, defineComponent, onMounted, onBeforeUpdate, onUnmounted, watch, nextTick, createVNode, Fragment } 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 b, defineComponent as B, onMounted as E, onBeforeUpdate as _, onUnmounted as D, watch as P, nextTick as k, createVNode as d, Fragment as R } from "vue";
|
|
2
|
+
const v = (e, t) => t ? typeof t == "string" ? ` ${e}--${t}` : Array.isArray(t) ? t.reduce((c, n) => c + v(e, n), "") : Object.keys(t).reduce(
|
|
3
|
+
(c, n) => c + (t[n] ? v(e, n) : ""),
|
|
4
|
+
""
|
|
5
|
+
) : "", L = (e) => (t, c) => {
|
|
6
|
+
let n = t, f = c;
|
|
7
|
+
return n && typeof n != "string" && (f = n, n = ""), n = n ? `${e}__${n}` : e, `${n}${v(n, f)}`;
|
|
8
|
+
}, T = () => (e, t) => t ? `${v(`y-${e}`, t)}` : `y-${e}`, U = {
|
|
38
9
|
"pull-refresh": {
|
|
39
10
|
pulling: "下拉刷新...",
|
|
40
11
|
loosing: "释放刷新...",
|
|
@@ -46,23 +17,15 @@ const defaultLang = {
|
|
|
46
17
|
validateMessage: "请输入正确内容"
|
|
47
18
|
}
|
|
48
19
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"zh-CN":
|
|
20
|
+
h("zh-CN");
|
|
21
|
+
b({
|
|
22
|
+
"zh-CN": U
|
|
52
23
|
});
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
return [
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (isNaN(Number(val)) && typeof val === "string") {
|
|
59
|
-
return val;
|
|
60
|
-
}
|
|
61
|
-
return `${val}px`;
|
|
62
|
-
};
|
|
63
|
-
const [name, bem] = createNamespace("progress");
|
|
64
|
-
const Progress = /* @__PURE__ */ defineComponent({
|
|
65
|
-
name,
|
|
24
|
+
const q = (e) => {
|
|
25
|
+
const t = `y-${e}`;
|
|
26
|
+
return [t, L(t), T()];
|
|
27
|
+
}, x = (e) => isNaN(Number(e)) && typeof e == "string" ? e : `${e}px`, [j, g] = q("progress"), $ = /* @__PURE__ */ B({
|
|
28
|
+
name: j,
|
|
66
29
|
props: {
|
|
67
30
|
// 进度
|
|
68
31
|
percent: {
|
|
@@ -102,12 +65,12 @@ const Progress = /* @__PURE__ */ defineComponent({
|
|
|
102
65
|
// 展示默认pivot
|
|
103
66
|
defaultPivot: {
|
|
104
67
|
type: Boolean,
|
|
105
|
-
default:
|
|
68
|
+
default: !1
|
|
106
69
|
},
|
|
107
70
|
// 里程碑模式
|
|
108
71
|
modeMilestone: {
|
|
109
72
|
type: Boolean,
|
|
110
|
-
default:
|
|
73
|
+
default: !1
|
|
111
74
|
},
|
|
112
75
|
// 里程碑节点
|
|
113
76
|
mileages: {
|
|
@@ -117,7 +80,7 @@ const Progress = /* @__PURE__ */ defineComponent({
|
|
|
117
80
|
// 动画
|
|
118
81
|
animation: {
|
|
119
82
|
type: Boolean,
|
|
120
|
-
default:
|
|
83
|
+
default: !1
|
|
121
84
|
},
|
|
122
85
|
// 动画时长
|
|
123
86
|
duration: {
|
|
@@ -135,182 +98,147 @@ const Progress = /* @__PURE__ */ defineComponent({
|
|
|
135
98
|
default: "%"
|
|
136
99
|
}
|
|
137
100
|
},
|
|
138
|
-
setup(
|
|
139
|
-
slots
|
|
101
|
+
setup(e, {
|
|
102
|
+
slots: t
|
|
140
103
|
}) {
|
|
141
|
-
const
|
|
142
|
-
const pivotContentRef = ref(null);
|
|
143
|
-
const mileageRef = ref([]);
|
|
144
|
-
const widthData = reactive({
|
|
104
|
+
const c = h(null), n = h(null), f = h([]), m = b({
|
|
145
105
|
progressWidth: 0,
|
|
146
106
|
pivotContentWidth: 0,
|
|
147
107
|
mileageWidth: []
|
|
148
|
-
})
|
|
149
|
-
const growData = reactive({
|
|
108
|
+
}), i = b({
|
|
150
109
|
number: 0,
|
|
151
110
|
oldPercent: 0,
|
|
152
111
|
timer: 0
|
|
153
112
|
});
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
})
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
onUnmounted(() => {
|
|
163
|
-
growData.timer && cancelAnimationFrame(growData.timer);
|
|
164
|
-
window.removeEventListener("resize", resize);
|
|
165
|
-
});
|
|
166
|
-
watch(() => props.percent, () => {
|
|
167
|
-
grow();
|
|
168
|
-
resizeWidth();
|
|
113
|
+
E(() => {
|
|
114
|
+
y(), e.animation && W(), window.addEventListener("resize", y);
|
|
115
|
+
}), _(() => {
|
|
116
|
+
f.value = [];
|
|
117
|
+
}), D(() => {
|
|
118
|
+
i.timer && cancelAnimationFrame(i.timer), window.removeEventListener("resize", y);
|
|
119
|
+
}), P(() => e.percent, () => {
|
|
120
|
+
W(), w();
|
|
169
121
|
});
|
|
170
|
-
const
|
|
122
|
+
const W = () => {
|
|
171
123
|
const {
|
|
172
|
-
duration,
|
|
173
|
-
percent
|
|
174
|
-
} =
|
|
175
|
-
|
|
176
|
-
if (step === 0)
|
|
124
|
+
duration: o,
|
|
125
|
+
percent: r
|
|
126
|
+
} = e, u = Math.abs(r - i.oldPercent) / (o / 16);
|
|
127
|
+
if (u === 0)
|
|
177
128
|
return;
|
|
178
|
-
let
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
if (percent > growData.oldPercent && current > percent || percent < growData.oldPercent && current < percent) {
|
|
182
|
-
current = percent;
|
|
183
|
-
} else {
|
|
184
|
-
growData.timer = requestAnimationFrame(update);
|
|
185
|
-
}
|
|
186
|
-
growData.oldPercent = current;
|
|
187
|
-
growData.number = parseInt(current.toString());
|
|
129
|
+
let a = Number(i.oldPercent);
|
|
130
|
+
const l = () => {
|
|
131
|
+
r > i.oldPercent ? a += u : a -= u, r > i.oldPercent && a > r || r < i.oldPercent && a < r ? a = r : i.timer = requestAnimationFrame(l), i.oldPercent = a, i.number = parseInt(a.toString());
|
|
188
132
|
};
|
|
189
|
-
|
|
190
|
-
growData.timer = requestAnimationFrame(update);
|
|
191
|
-
};
|
|
192
|
-
watch(() => props.mileages, () => resizeMileage);
|
|
193
|
-
const resize = () => {
|
|
194
|
-
resizeWidth();
|
|
195
|
-
resizeMileage();
|
|
133
|
+
i.timer && cancelAnimationFrame(i.timer), i.timer = requestAnimationFrame(l);
|
|
196
134
|
};
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
135
|
+
P(() => e.mileages, () => C);
|
|
136
|
+
const y = () => {
|
|
137
|
+
w(), C();
|
|
138
|
+
}, w = () => {
|
|
139
|
+
k(() => {
|
|
140
|
+
m.progressWidth = c.value && c.value.offsetWidth || 0, m.pivotContentWidth = n.value && n.value.offsetWidth || 0;
|
|
141
|
+
}).catch((o) => {
|
|
142
|
+
throw new Error(o);
|
|
203
143
|
});
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
widthData.mileageWidth[i] = mileageRef.value[i] && mileageRef.value[i].offsetWidth || 0;
|
|
144
|
+
}, C = () => {
|
|
145
|
+
k(() => {
|
|
146
|
+
e.mileages.forEach((o, r) => {
|
|
147
|
+
m.mileageWidth[r] = f.value[r] && f.value[r].offsetWidth || 0;
|
|
209
148
|
});
|
|
210
|
-
}).catch((
|
|
211
|
-
throw new Error(
|
|
149
|
+
}).catch((o) => {
|
|
150
|
+
throw new Error(o);
|
|
212
151
|
});
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
var _a;
|
|
152
|
+
}, M = () => {
|
|
153
|
+
var l;
|
|
216
154
|
const {
|
|
217
|
-
mileages,
|
|
218
|
-
percent,
|
|
219
|
-
animation:
|
|
220
|
-
} =
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
if (el)
|
|
226
|
-
mileageRef.value[i] = el;
|
|
155
|
+
mileages: o,
|
|
156
|
+
percent: r,
|
|
157
|
+
animation: u
|
|
158
|
+
} = e, a = [];
|
|
159
|
+
for (let s = 0; s < o.length; s++)
|
|
160
|
+
a[s] = d("div", {
|
|
161
|
+
ref: (p) => {
|
|
162
|
+
p && (f.value[s] = p);
|
|
227
163
|
},
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
left: `${(
|
|
164
|
+
class: [g("pivot-content", (u ? i.number : r) >= o[s] ? "arrive" : "no-arrive")],
|
|
165
|
+
key: `mileage${s}`,
|
|
166
|
+
style: {
|
|
167
|
+
left: `${(m.progressWidth - m.mileageWidth[s]) * o[s] / 100}px`
|
|
232
168
|
}
|
|
233
|
-
}, [((
|
|
234
|
-
|
|
235
|
-
}, [`${
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
const renderPivot = () => {
|
|
240
|
-
var _a;
|
|
169
|
+
}, [((l = t.mileage) == null ? void 0 : l.call(t)) || d("div", {
|
|
170
|
+
class: g("pivot")
|
|
171
|
+
}, [`${o[s]}%`])]);
|
|
172
|
+
return a;
|
|
173
|
+
}, S = () => {
|
|
174
|
+
var s;
|
|
241
175
|
const {
|
|
242
|
-
defaultPivot,
|
|
243
|
-
textColor,
|
|
244
|
-
percent,
|
|
245
|
-
animation:
|
|
246
|
-
unit
|
|
247
|
-
} =
|
|
248
|
-
return
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
color:
|
|
176
|
+
defaultPivot: o,
|
|
177
|
+
textColor: r,
|
|
178
|
+
percent: u,
|
|
179
|
+
animation: a,
|
|
180
|
+
unit: l
|
|
181
|
+
} = e;
|
|
182
|
+
return d(R, null, [((s = t.pivot) == null ? void 0 : s.call(t)) || o && d("div", {
|
|
183
|
+
class: g("pivot"),
|
|
184
|
+
style: {
|
|
185
|
+
color: r
|
|
252
186
|
}
|
|
253
|
-
}, [
|
|
254
|
-
|
|
255
|
-
}, [
|
|
187
|
+
}, [a ? d("div", {
|
|
188
|
+
class: g("number")
|
|
189
|
+
}, [d("span", null, [i.number, l])]) : `${u}${l}`])]);
|
|
256
190
|
};
|
|
257
191
|
return () => {
|
|
258
192
|
const {
|
|
259
|
-
strokeWidth,
|
|
260
|
-
trackColor,
|
|
261
|
-
radius,
|
|
262
|
-
percent,
|
|
263
|
-
color,
|
|
264
|
-
animation:
|
|
265
|
-
duration,
|
|
266
|
-
timing,
|
|
267
|
-
defaultPivot,
|
|
268
|
-
pivotColor,
|
|
269
|
-
modeMilestone
|
|
270
|
-
} =
|
|
271
|
-
return
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
height:
|
|
276
|
-
background:
|
|
277
|
-
borderRadius:
|
|
193
|
+
strokeWidth: o,
|
|
194
|
+
trackColor: r,
|
|
195
|
+
radius: u,
|
|
196
|
+
percent: a,
|
|
197
|
+
color: l,
|
|
198
|
+
animation: s,
|
|
199
|
+
duration: p,
|
|
200
|
+
timing: N,
|
|
201
|
+
defaultPivot: z,
|
|
202
|
+
pivotColor: A,
|
|
203
|
+
modeMilestone: F
|
|
204
|
+
} = e;
|
|
205
|
+
return d("div", {
|
|
206
|
+
class: g(),
|
|
207
|
+
ref: c,
|
|
208
|
+
style: {
|
|
209
|
+
height: x(o),
|
|
210
|
+
background: r,
|
|
211
|
+
borderRadius: x(u)
|
|
278
212
|
}
|
|
279
|
-
}, [
|
|
280
|
-
|
|
281
|
-
animation:
|
|
213
|
+
}, [d("span", {
|
|
214
|
+
class: g("portion", {
|
|
215
|
+
animation: s
|
|
282
216
|
}),
|
|
283
|
-
|
|
284
|
-
width: `${
|
|
285
|
-
background:
|
|
286
|
-
transitionDuration: `${
|
|
287
|
-
transitionTimingFunction:
|
|
217
|
+
style: {
|
|
218
|
+
width: `${m.progressWidth * a / 100}px`,
|
|
219
|
+
background: l,
|
|
220
|
+
transitionDuration: `${p}ms`,
|
|
221
|
+
transitionTimingFunction: N
|
|
288
222
|
}
|
|
289
|
-
}, [
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
animation:
|
|
223
|
+
}, [d("div", {
|
|
224
|
+
ref: n,
|
|
225
|
+
class: g("pivot-content", {
|
|
226
|
+
animation: s
|
|
293
227
|
}),
|
|
294
|
-
|
|
295
|
-
left: `${(
|
|
296
|
-
background:
|
|
297
|
-
transitionDuration: `${
|
|
298
|
-
transitionTimingFunction:
|
|
228
|
+
style: {
|
|
229
|
+
left: `${(m.progressWidth - m.pivotContentWidth) * a / 100}px`,
|
|
230
|
+
background: z ? A || l : "none",
|
|
231
|
+
transitionDuration: `${p}ms`,
|
|
232
|
+
transitionTimingFunction: N
|
|
299
233
|
}
|
|
300
|
-
}, [
|
|
234
|
+
}, [S()])]), F && M()]);
|
|
301
235
|
};
|
|
302
236
|
}
|
|
303
237
|
});
|
|
304
|
-
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
const animation = "";
|
|
308
|
-
const theme = "";
|
|
309
|
-
const style = "";
|
|
310
|
-
Progress.install = (Vue) => {
|
|
311
|
-
const { name: name2 } = Progress;
|
|
312
|
-
Vue.component(name2, Progress);
|
|
238
|
+
$.install = (e) => {
|
|
239
|
+
const { name: t } = $;
|
|
240
|
+
e.component(t, $);
|
|
313
241
|
};
|
|
314
242
|
export {
|
|
315
|
-
|
|
243
|
+
$ as default
|
|
316
244
|
};
|