y-design-ssr 0.2.6 → 0.2.8
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/README.md +1 -1
- package/libs/button/index.css +1 -579
- package/libs/button/index.d.ts +0 -1
- package/libs/button/index.mjs +65 -111
- package/libs/button/index.umd.js +2 -203
- package/libs/cell/index.css +1 -1077
- package/libs/cell/index.d.ts +0 -1
- package/libs/cell/index.mjs +104 -168
- package/libs/cell/index.umd.js +2 -301
- package/libs/checkbox/index.css +1 -1053
- package/libs/checkbox/index.d.ts +0 -1
- package/libs/checkbox/index.mjs +127 -243
- package/libs/checkbox/index.umd.js +2 -370
- package/libs/checkboxGroup/index.css +1 -422
- package/libs/checkboxGroup/index.d.ts +0 -1
- package/libs/checkboxGroup/index.mjs +87 -174
- package/libs/checkboxGroup/index.umd.js +2 -266
- package/libs/col/index.css +1 -615
- package/libs/col/index.d.ts +0 -1
- package/libs/col/index.mjs +81 -247
- package/libs/col/index.umd.js +2 -306
- package/libs/countdown/index.css +1 -417
- package/libs/countdown/index.d.ts +0 -1
- package/libs/countdown/index.mjs +71 -180
- package/libs/countdown/index.umd.js +2 -232
- package/libs/dialog/index.css +1 -1405
- package/libs/dialog/index.d.ts +0 -1
- package/libs/dialog/index.mjs +476 -647
- package/libs/dialog/index.umd.js +2 -1129
- package/libs/empty/index.css +1 -457
- package/libs/empty/index.d.ts +0 -1
- package/libs/empty/index.mjs +44 -92
- package/libs/empty/index.umd.js +2 -140
- package/libs/form/index.css +1 -477
- package/libs/form/index.d.ts +0 -1
- package/libs/form/index.mjs +126 -227
- package/libs/form/index.umd.js +2 -320
- package/libs/formItem/index.css +1 -477
- package/libs/formItem/index.d.ts +0 -1
- package/libs/formItem/index.mjs +126 -277
- package/libs/formItem/index.umd.js +2 -373
- package/libs/icon/index.css +1 -982
- package/libs/icon/index.d.ts +0 -1
- package/libs/icon/index.mjs +58 -108
- package/libs/icon/index.umd.js +2 -187
- 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.d.ts +0 -1
- package/libs/input/index.mjs +92 -184
- package/libs/input/index.umd.js +2 -275
- package/libs/layout/index.css +1 -684
- package/libs/layout/index.mjs +130 -230
- package/libs/layout/index.umd.js +2 -318
- package/libs/list/index.css +1 -440
- package/libs/list/index.d.ts +0 -1
- package/libs/list/index.mjs +207 -389
- package/libs/list/index.umd.js +2 -572
- package/libs/loading/index.css +1 -548
- package/libs/loading/index.d.ts +0 -1
- package/libs/loading/index.mjs +118 -197
- package/libs/loading/index.umd.js +2 -322
- package/libs/locale/index.mjs +28 -0
- package/libs/locale/index.umd.js +1 -0
- package/libs/locale/package.json +6 -0
- package/libs/mask/index.css +1 -426
- package/libs/mask/index.d.ts +0 -1
- package/libs/mask/index.mjs +70 -132
- package/libs/mask/index.umd.js +2 -202
- package/libs/popup/index.css +1 -465
- package/libs/popup/index.d.ts +0 -1
- package/libs/popup/index.mjs +134 -211
- package/libs/popup/index.umd.js +2 -359
- package/libs/progress/index.css +1 -488
- package/libs/progress/index.d.ts +0 -1
- package/libs/progress/index.mjs +128 -201
- package/libs/progress/index.umd.js +2 -323
- package/libs/pullrefresh/index.css +1 -441
- package/libs/pullrefresh/index.d.ts +0 -1
- package/libs/pullrefresh/index.mjs +111 -242
- package/libs/pullrefresh/index.umd.js +2 -303
- package/libs/row/index.css +1 -485
- package/libs/row/index.d.ts +0 -1
- package/libs/row/index.mjs +89 -182
- package/libs/row/index.umd.js +2 -238
- package/libs/slider/index.css +1 -558
- package/libs/slider/index.d.ts +0 -1
- package/libs/slider/index.mjs +160 -357
- package/libs/slider/index.umd.js +2 -454
- package/libs/stepper/index.css +1 -489
- package/libs/stepper/index.d.ts +0 -1
- package/libs/stepper/index.mjs +101 -182
- package/libs/stepper/index.umd.js +2 -270
- package/libs/style/index.css +1 -0
- package/libs/style/index.mjs +1 -0
- package/libs/style/index.umd.js +2 -0
- package/libs/style/package.json +6 -0
- package/libs/swipe/index.css +1 -506
- package/libs/swipe/index.d.ts +0 -1
- package/libs/swipe/index.mjs +259 -543
- package/libs/swipe/index.umd.js +2 -704
- package/libs/swipeItem/index.css +1 -424
- package/libs/swipeItem/index.d.ts +0 -1
- package/libs/swipeItem/index.mjs +52 -112
- package/libs/swipeItem/index.umd.js +2 -155
- package/libs/switch/index.css +1 -472
- package/libs/switch/index.d.ts +0 -1
- package/libs/switch/index.mjs +62 -122
- package/libs/switch/index.umd.js +2 -201
- package/libs/tab/index.d.ts +0 -1
- package/libs/tab/index.mjs +68 -132
- package/libs/tab/index.umd.js +1 -191
- package/libs/tabs/index.css +1 -514
- package/libs/tabs/index.d.ts +0 -1
- package/libs/tabs/index.mjs +410 -752
- package/libs/tabs/index.umd.js +2 -1021
- package/libs/toast/index.css +1 -1050
- package/libs/toast/index.d.ts +0 -1
- package/libs/toast/index.mjs +114 -184
- package/libs/toast/index.umd.js +2 -307
- package/libs/tooltip/index.css +1 -514
- package/libs/tooltip/index.d.ts +0 -1
- package/libs/tooltip/index.mjs +155 -294
- package/libs/tooltip/index.umd.js +2 -417
- package/libs/utils/index.mjs +76 -0
- package/libs/utils/index.umd.js +1 -0
- package/libs/utils/package.json +6 -0
- package/package.json +2 -5
package/libs/loading/index.mjs
CHANGED
|
@@ -1,40 +1,11 @@
|
|
|
1
|
-
import { ref, reactive, defineComponent, createVNode, 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 C, reactive as _, defineComponent as L, createVNode as i, createApp as z, h as P } from "vue";
|
|
2
|
+
const u = (e, t) => t ? typeof t == "string" ? ` ${e}--${t}` : Array.isArray(t) ? t.reduce((n, r) => n + u(e, r), "") : Object.keys(t).reduce(
|
|
3
|
+
(n, r) => n + (t[r] ? u(e, r) : ""),
|
|
4
|
+
""
|
|
5
|
+
) : "", R = (e) => (t, n) => {
|
|
6
|
+
let r = t, o = n;
|
|
7
|
+
return r && typeof r != "string" && (o = r, r = ""), r = r ? `${e}__${r}` : e, `${r}${u(r, o)}`;
|
|
8
|
+
}, k = () => (e, t) => t ? `${u(`y-${e}`, t)}` : `y-${e}`, B = {
|
|
38
9
|
"pull-refresh": {
|
|
39
10
|
pulling: "下拉刷新...",
|
|
40
11
|
loosing: "释放刷新...",
|
|
@@ -46,22 +17,15 @@ const defaultLang = {
|
|
|
46
17
|
validateMessage: "请输入正确内容"
|
|
47
18
|
}
|
|
48
19
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"zh-CN":
|
|
20
|
+
C("zh-CN");
|
|
21
|
+
_({
|
|
22
|
+
"zh-CN": B
|
|
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 parseFlexDirection = (location) => {
|
|
64
|
-
switch (location) {
|
|
24
|
+
const M = (e) => {
|
|
25
|
+
const t = `y-${e}`;
|
|
26
|
+
return [t, R(t), k()];
|
|
27
|
+
}, s = (e) => isNaN(Number(e)) && typeof e == "string" ? e : `${e}px`, A = (e) => {
|
|
28
|
+
switch (e) {
|
|
65
29
|
case "top":
|
|
66
30
|
return "column-reverse";
|
|
67
31
|
case "bottom":
|
|
@@ -73,9 +37,7 @@ const parseFlexDirection = (location) => {
|
|
|
73
37
|
default:
|
|
74
38
|
return "column";
|
|
75
39
|
}
|
|
76
|
-
}
|
|
77
|
-
const [name, bem] = createNamespace("loading");
|
|
78
|
-
const _props = {
|
|
40
|
+
}, [D, c] = M("loading"), E = {
|
|
79
41
|
// Loading icon 的颜色
|
|
80
42
|
color: {
|
|
81
43
|
type: String,
|
|
@@ -134,107 +96,97 @@ const _props = {
|
|
|
134
96
|
type: String,
|
|
135
97
|
default: "relative"
|
|
136
98
|
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
slots
|
|
99
|
+
}, l = /* @__PURE__ */ L({
|
|
100
|
+
name: D,
|
|
101
|
+
props: E,
|
|
102
|
+
setup(e, {
|
|
103
|
+
slots: t
|
|
143
104
|
}) {
|
|
144
105
|
return () => {
|
|
145
|
-
var
|
|
106
|
+
var f, m;
|
|
146
107
|
const {
|
|
147
|
-
position,
|
|
148
|
-
textLocation,
|
|
149
|
-
bgColor,
|
|
150
|
-
bgBorderRadius,
|
|
151
|
-
size,
|
|
152
|
-
padding,
|
|
153
|
-
color,
|
|
154
|
-
thick,
|
|
155
|
-
direction,
|
|
156
|
-
text
|
|
157
|
-
textColor,
|
|
158
|
-
textSize
|
|
159
|
-
} =
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
[position]: position !== "relative"
|
|
108
|
+
position: n,
|
|
109
|
+
textLocation: r,
|
|
110
|
+
bgColor: o,
|
|
111
|
+
bgBorderRadius: S,
|
|
112
|
+
size: d,
|
|
113
|
+
padding: x,
|
|
114
|
+
color: b,
|
|
115
|
+
thick: h,
|
|
116
|
+
direction: p,
|
|
117
|
+
text: $,
|
|
118
|
+
textColor: w,
|
|
119
|
+
textSize: N
|
|
120
|
+
} = e, g = ((f = t.default) == null ? void 0 : f.call(t)) || $;
|
|
121
|
+
return i("div", {
|
|
122
|
+
class: c({
|
|
123
|
+
[n]: n !== "relative"
|
|
164
124
|
})
|
|
165
|
-
}, [
|
|
166
|
-
|
|
167
|
-
[
|
|
125
|
+
}, [i("div", {
|
|
126
|
+
class: c("bg", {
|
|
127
|
+
[n]: n !== "relative"
|
|
168
128
|
}),
|
|
169
|
-
|
|
170
|
-
flexDirection:
|
|
171
|
-
backgroundColor:
|
|
172
|
-
borderRadius:
|
|
173
|
-
padding:
|
|
129
|
+
style: {
|
|
130
|
+
flexDirection: A(r),
|
|
131
|
+
backgroundColor: o,
|
|
132
|
+
borderRadius: s(S),
|
|
133
|
+
padding: s(x)
|
|
174
134
|
}
|
|
175
|
-
}, [
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
width:
|
|
179
|
-
height:
|
|
135
|
+
}, [i("span", {
|
|
136
|
+
class: c("icon-wrapper"),
|
|
137
|
+
style: {
|
|
138
|
+
width: s(d),
|
|
139
|
+
height: s(d)
|
|
180
140
|
}
|
|
181
|
-
}, [((
|
|
182
|
-
|
|
183
|
-
[
|
|
141
|
+
}, [((m = t.icon) == null ? void 0 : m.call(t)) || i("svg", {
|
|
142
|
+
class: c("icon", {
|
|
143
|
+
[p]: p
|
|
184
144
|
}),
|
|
185
|
-
|
|
186
|
-
}, [
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
stroke:
|
|
190
|
-
strokeWidth:
|
|
145
|
+
viewBox: "25 25 50 50"
|
|
146
|
+
}, [i("circle", {
|
|
147
|
+
class: c("icon-circle"),
|
|
148
|
+
style: {
|
|
149
|
+
stroke: b,
|
|
150
|
+
strokeWidth: s(h)
|
|
191
151
|
},
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}, null)])]),
|
|
197
|
-
|
|
198
|
-
[
|
|
152
|
+
cx: "50",
|
|
153
|
+
cy: "50",
|
|
154
|
+
r: "20",
|
|
155
|
+
fill: "none"
|
|
156
|
+
}, null)])]), g && i("span", {
|
|
157
|
+
class: c("text", {
|
|
158
|
+
[r]: r
|
|
199
159
|
}),
|
|
200
|
-
|
|
201
|
-
color:
|
|
202
|
-
fontSize:
|
|
160
|
+
style: {
|
|
161
|
+
color: w,
|
|
162
|
+
fontSize: s(N)
|
|
203
163
|
}
|
|
204
|
-
}, [
|
|
164
|
+
}, [g])])]);
|
|
205
165
|
};
|
|
206
166
|
}
|
|
207
|
-
})
|
|
208
|
-
const globalOptions = {
|
|
167
|
+
}), O = {
|
|
209
168
|
position: "fixed"
|
|
210
169
|
};
|
|
211
|
-
let
|
|
212
|
-
const
|
|
213
|
-
const
|
|
214
|
-
render: () => {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
const customApp = createApp(wrapper);
|
|
219
|
-
const element = document.createElement("div");
|
|
220
|
-
return customApp.mount(element);
|
|
221
|
-
};
|
|
222
|
-
const createLoading = {
|
|
170
|
+
let a = null;
|
|
171
|
+
const v = (e, t) => {
|
|
172
|
+
const r = z({
|
|
173
|
+
render: () => P(l, { ...e }, { ...t })
|
|
174
|
+
}), o = document.createElement("div");
|
|
175
|
+
return r.mount(o);
|
|
176
|
+
}, V = {
|
|
223
177
|
/**
|
|
224
178
|
* @description: show
|
|
225
179
|
* @param {LoadingPropsType} options
|
|
226
180
|
* @return {*}
|
|
227
181
|
*/
|
|
228
|
-
show: (
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
);
|
|
237
|
-
document.body.appendChild(instance.$el);
|
|
182
|
+
show: (e, t) => {
|
|
183
|
+
a || (a = v(
|
|
184
|
+
{
|
|
185
|
+
...O,
|
|
186
|
+
...e
|
|
187
|
+
},
|
|
188
|
+
t
|
|
189
|
+
)), document.body.appendChild(a.$el);
|
|
238
190
|
},
|
|
239
191
|
/**
|
|
240
192
|
* @description: hide
|
|
@@ -242,75 +194,44 @@ const createLoading = {
|
|
|
242
194
|
* @return {*}
|
|
243
195
|
*/
|
|
244
196
|
hide: () => {
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
const toggleLoading = (el, binding) => {
|
|
249
|
-
if (binding.value) {
|
|
250
|
-
el.classList.add("y-loading__wrap");
|
|
251
|
-
el.appendChild(el.instance.$el);
|
|
252
|
-
} else {
|
|
253
|
-
el.classList.remove("y-loading__wrap");
|
|
254
|
-
el.removeChild(el.instance.$el);
|
|
197
|
+
a && a.$el.remove();
|
|
255
198
|
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
app.directive("loading-slots", directiveSlots);
|
|
199
|
+
}, y = (e, t) => {
|
|
200
|
+
t.value ? (e.classList.add("y-loading__wrap"), e.appendChild(e.instance.$el)) : (e.classList.remove("y-loading__wrap"), e.removeChild(e.instance.$el));
|
|
201
|
+
}, j = {
|
|
202
|
+
install: (e) => {
|
|
203
|
+
e.directive("loading", F), e.directive("loading-props", G), e.directive("loading-slots", I);
|
|
262
204
|
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
205
|
+
}, F = {
|
|
206
|
+
getSSRProps: (e) => ({ ...e }),
|
|
207
|
+
mounted: (e, t) => {
|
|
208
|
+
e.instance = v({ ...e.customProps }, { ...e.customSlots }), t.value && y(e, t);
|
|
267
209
|
},
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
binding.value && toggleLoading(el, binding);
|
|
210
|
+
updated: (e, t) => {
|
|
211
|
+
t.oldValue !== t.value && y(e, t);
|
|
271
212
|
},
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
toggleLoading(el, binding);
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
unmounted: (el) => {
|
|
278
|
-
el.instance && el.instance.$el.remove();
|
|
213
|
+
unmounted: (e) => {
|
|
214
|
+
e.instance && e.instance.$el.remove();
|
|
279
215
|
}
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
},
|
|
285
|
-
beforeMount: (el, binding) => {
|
|
286
|
-
el.customProps = { ...binding.value };
|
|
216
|
+
}, G = {
|
|
217
|
+
getSSRProps: (e) => ({ ...e }),
|
|
218
|
+
beforeMount: (e, t) => {
|
|
219
|
+
e.customProps = { ...t.value };
|
|
287
220
|
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
},
|
|
293
|
-
beforeMount: (el, binding) => {
|
|
294
|
-
el.customSlots = { ...binding.value };
|
|
221
|
+
}, I = {
|
|
222
|
+
getSSRProps: (e) => ({ ...e }),
|
|
223
|
+
beforeMount: (e, t) => {
|
|
224
|
+
e.customSlots = { ...t.value };
|
|
295
225
|
}
|
|
296
226
|
};
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
const font = "";
|
|
300
|
-
const animation = "";
|
|
301
|
-
const theme = "";
|
|
302
|
-
const style = "";
|
|
303
|
-
Loading.install = (app) => {
|
|
304
|
-
app.component(Loading.name, Loading);
|
|
305
|
-
app.provide("loading", createLoading);
|
|
306
|
-
app.use(loadingDirective);
|
|
227
|
+
l.install = (e) => {
|
|
228
|
+
e.component(l.name, l), e.provide("loading", V), e.use(j);
|
|
307
229
|
};
|
|
308
230
|
export {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
loadingDirective
|
|
231
|
+
V as createLoading,
|
|
232
|
+
l as default,
|
|
233
|
+
F as directive,
|
|
234
|
+
G as directiveProps,
|
|
235
|
+
I as directiveSlots,
|
|
236
|
+
j as loadingDirective
|
|
316
237
|
};
|