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/col/index.mjs
CHANGED
|
@@ -1,40 +1,11 @@
|
|
|
1
|
-
import { ref, reactive, getCurrentInstance, provide, isVNode, inject, onUnmounted, computed, defineComponent, createVNode } 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 m, getCurrentInstance as v, provide as _, isVNode as j, inject as A, onUnmounted as L, computed as l, defineComponent as y, createVNode as $ } from "vue";
|
|
2
|
+
const p = (e, t) => t ? typeof t == "string" ? ` ${e}--${t}` : Array.isArray(t) ? t.reduce((n, r) => n + p(e, r), "") : Object.keys(t).reduce(
|
|
3
|
+
(n, r) => n + (t[r] ? p(e, r) : ""),
|
|
4
|
+
""
|
|
5
|
+
) : "", P = (e) => (t, n) => {
|
|
6
|
+
let r = t, i = n;
|
|
7
|
+
return r && typeof r != "string" && (i = r, r = ""), r = r ? `${e}__${r}` : e, `${r}${p(r, i)}`;
|
|
8
|
+
}, T = () => (e, t) => t ? `${p(`y-${e}`, t)}` : `y-${e}`, B = {
|
|
38
9
|
"pull-refresh": {
|
|
39
10
|
pulling: "下拉刷新...",
|
|
40
11
|
loosing: "释放刷新...",
|
|
@@ -46,190 +17,63 @@ const defaultLang = {
|
|
|
46
17
|
validateMessage: "请输入正确内容"
|
|
47
18
|
}
|
|
48
19
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"zh-CN":
|
|
20
|
+
h("zh-CN");
|
|
21
|
+
m({
|
|
22
|
+
"zh-CN": B
|
|
52
23
|
});
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
return [
|
|
24
|
+
const C = (e) => {
|
|
25
|
+
const t = `y-${e}`;
|
|
26
|
+
return [t, P(t), T()];
|
|
56
27
|
};
|
|
57
|
-
var
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const filterChildren = (children) => {
|
|
64
|
-
const vnodes = [];
|
|
65
|
-
const _filterChildren = (childrens) => {
|
|
66
|
-
if (Array.isArray(childrens)) {
|
|
67
|
-
childrens.forEach((child) => {
|
|
68
|
-
var _a;
|
|
69
|
-
if (isVNode(child)) {
|
|
70
|
-
vnodes.push(child);
|
|
71
|
-
if ((_a = child.component) == null ? void 0 : _a.subTree) {
|
|
72
|
-
_filterChildren(child.component.subTree.children);
|
|
73
|
-
}
|
|
74
|
-
if (child.children) {
|
|
75
|
-
_filterChildren(child.children);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
_filterChildren(children);
|
|
82
|
-
return vnodes;
|
|
83
|
-
};
|
|
84
|
-
const sortChildren = (childrens, instance) => {
|
|
85
|
-
const vnodes = filterChildren(instance.subTree.children);
|
|
86
|
-
childrens.sort((a, b) => vnodes.indexOf(a.vnode) - vnodes.indexOf(b.vnode));
|
|
87
|
-
};
|
|
88
|
-
const setRelation = (key) => {
|
|
89
|
-
const instance = getCurrentInstance();
|
|
90
|
-
const childrens = reactive([]);
|
|
91
|
-
const initProvide = (value) => {
|
|
92
|
-
const addChild = (child) => {
|
|
93
|
-
if (child.proxy) {
|
|
94
|
-
childrens.push(child);
|
|
95
|
-
instance && sortChildren(childrens, instance);
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
const removeChild = (child) => {
|
|
99
|
-
const index = childrens.indexOf(child);
|
|
100
|
-
childrens.splice(index, 1);
|
|
101
|
-
};
|
|
102
|
-
provide(key, {
|
|
103
|
-
addChild,
|
|
104
|
-
removeChild,
|
|
105
|
-
childrens,
|
|
106
|
-
...value
|
|
28
|
+
var b = /* @__PURE__ */ ((e) => (e.Top = "top", e.Middle = "middle", e.Bottom = "bottom", e))(b || {});
|
|
29
|
+
const M = (e) => {
|
|
30
|
+
const t = [], n = (r) => {
|
|
31
|
+
Array.isArray(r) && r.forEach((i) => {
|
|
32
|
+
var c;
|
|
33
|
+
j(i) && (t.push(i), (c = i.component) != null && c.subTree && n(i.component.subTree.children), i.children && n(i.children));
|
|
107
34
|
});
|
|
108
35
|
};
|
|
36
|
+
return n(e), t;
|
|
37
|
+
}, I = (e, t) => {
|
|
38
|
+
const n = M(t.subTree.children);
|
|
39
|
+
e.sort((r, i) => n.indexOf(r.vnode) - n.indexOf(i.vnode));
|
|
40
|
+
}, z = (e) => {
|
|
41
|
+
const t = v(), n = m([]);
|
|
109
42
|
return {
|
|
110
|
-
childrens,
|
|
111
|
-
initProvide
|
|
43
|
+
childrens: n,
|
|
44
|
+
initProvide: (i) => {
|
|
45
|
+
_(e, {
|
|
46
|
+
addChild: (s) => {
|
|
47
|
+
s.proxy && (n.push(s), t && I(n, t));
|
|
48
|
+
},
|
|
49
|
+
removeChild: (s) => {
|
|
50
|
+
const a = n.indexOf(s);
|
|
51
|
+
n.splice(a, 1);
|
|
52
|
+
},
|
|
53
|
+
childrens: n,
|
|
54
|
+
...i
|
|
55
|
+
});
|
|
56
|
+
}
|
|
112
57
|
};
|
|
113
|
-
}
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
onUnmounted(() => removeChild(currentInstance));
|
|
121
|
-
const index = computed(() => childrens.indexOf(currentInstance));
|
|
122
|
-
return {
|
|
123
|
-
index,
|
|
124
|
-
parent
|
|
58
|
+
}, D = (e) => {
|
|
59
|
+
const t = A(e, null), n = v();
|
|
60
|
+
if (t && n) {
|
|
61
|
+
const { childrens: r, addChild: i, removeChild: c } = t;
|
|
62
|
+
return i(n), L(() => c(n)), {
|
|
63
|
+
index: l(() => r.indexOf(n)),
|
|
64
|
+
parent: t
|
|
125
65
|
};
|
|
126
66
|
}
|
|
127
67
|
return {
|
|
128
68
|
parent: null,
|
|
129
|
-
index:
|
|
69
|
+
index: h(-1)
|
|
130
70
|
};
|
|
131
71
|
};
|
|
132
|
-
var
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
RowJustify2["SpaceAround"] = "space-around";
|
|
138
|
-
return RowJustify2;
|
|
139
|
-
})(RowJustify || {});
|
|
140
|
-
const [name$1, bem$1] = createNamespace("row");
|
|
141
|
-
const ROW_PROVIDE = name$1;
|
|
142
|
-
/* @__PURE__ */ defineComponent({
|
|
143
|
-
name: name$1,
|
|
144
|
-
props: {
|
|
145
|
-
type: {
|
|
146
|
-
type: String,
|
|
147
|
-
default: ""
|
|
148
|
-
},
|
|
149
|
-
// 列元素之间的间距(单位为 px)
|
|
150
|
-
gutter: {
|
|
151
|
-
type: [Number, String],
|
|
152
|
-
default: 0
|
|
153
|
-
},
|
|
154
|
-
align: {
|
|
155
|
-
type: String,
|
|
156
|
-
default: Vertical.Top
|
|
157
|
-
},
|
|
158
|
-
justify: {
|
|
159
|
-
type: String,
|
|
160
|
-
default: RowJustify.Start
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
setup(props, {
|
|
164
|
-
slots
|
|
165
|
-
}) {
|
|
166
|
-
const {
|
|
167
|
-
childrens,
|
|
168
|
-
initProvide
|
|
169
|
-
} = setRelation(ROW_PROVIDE);
|
|
170
|
-
const groupList = computed(() => {
|
|
171
|
-
const groups = [[]];
|
|
172
|
-
let totalSpan = 0;
|
|
173
|
-
childrens.forEach((child, index) => {
|
|
174
|
-
var _a;
|
|
175
|
-
totalSpan += Number((_a = child.proxy) == null ? void 0 : _a.span);
|
|
176
|
-
if (totalSpan > 24) {
|
|
177
|
-
groups.push([index]);
|
|
178
|
-
totalSpan -= 24;
|
|
179
|
-
} else {
|
|
180
|
-
groups[groups.length - 1].push(index);
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
return groups;
|
|
184
|
-
});
|
|
185
|
-
const spaceList = computed(() => {
|
|
186
|
-
const gutter = Number(props.gutter);
|
|
187
|
-
const spaces = [];
|
|
188
|
-
if (!gutter)
|
|
189
|
-
return spaces;
|
|
190
|
-
groupList.value.forEach((group) => {
|
|
191
|
-
const averagePadding = gutter * (group.length - 1) / group.length;
|
|
192
|
-
group.forEach((item, index) => {
|
|
193
|
-
if (index === 0) {
|
|
194
|
-
spaces.push({
|
|
195
|
-
right: averagePadding,
|
|
196
|
-
left: 0
|
|
197
|
-
});
|
|
198
|
-
} else {
|
|
199
|
-
const left = gutter - spaces[item - 1].right;
|
|
200
|
-
const right = averagePadding - left;
|
|
201
|
-
spaces.push({
|
|
202
|
-
left,
|
|
203
|
-
right
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
});
|
|
207
|
-
});
|
|
208
|
-
return spaces;
|
|
209
|
-
});
|
|
210
|
-
initProvide({
|
|
211
|
-
spaceList
|
|
212
|
-
});
|
|
213
|
-
return () => {
|
|
214
|
-
var _a;
|
|
215
|
-
const {
|
|
216
|
-
type,
|
|
217
|
-
align,
|
|
218
|
-
justify
|
|
219
|
-
} = props;
|
|
220
|
-
return createVNode("div", {
|
|
221
|
-
"class": bem$1({
|
|
222
|
-
[type]: type,
|
|
223
|
-
[`align-${align}`]: type && align,
|
|
224
|
-
[`justify-${justify}`]: type && justify
|
|
225
|
-
})
|
|
226
|
-
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
const [name, bem] = createNamespace("col");
|
|
231
|
-
const Col = /* @__PURE__ */ defineComponent({
|
|
232
|
-
name,
|
|
72
|
+
var x = /* @__PURE__ */ ((e) => (e.Start = "start", e.Center = "center", e.End = "end", e.SpaceBetween = "space-between", e.SpaceAround = "space-around", e))(x || {});
|
|
73
|
+
const [N, G] = C("row"), S = N;
|
|
74
|
+
b.Top, x.Start;
|
|
75
|
+
const [R, U] = C("col"), f = /* @__PURE__ */ y({
|
|
76
|
+
name: R,
|
|
233
77
|
props: {
|
|
234
78
|
// 列数
|
|
235
79
|
span: {
|
|
@@ -242,58 +86,49 @@ const Col = /* @__PURE__ */ defineComponent({
|
|
|
242
86
|
default: 0
|
|
243
87
|
}
|
|
244
88
|
},
|
|
245
|
-
setup(
|
|
246
|
-
slots
|
|
89
|
+
setup(e, {
|
|
90
|
+
slots: t
|
|
247
91
|
}) {
|
|
248
92
|
const {
|
|
249
|
-
parent,
|
|
250
|
-
index
|
|
251
|
-
} =
|
|
252
|
-
|
|
253
|
-
if (!parent) {
|
|
93
|
+
parent: n,
|
|
94
|
+
index: r
|
|
95
|
+
} = D(S), i = l(() => {
|
|
96
|
+
if (!n)
|
|
254
97
|
return {};
|
|
255
|
-
}
|
|
256
98
|
const {
|
|
257
|
-
spaceList
|
|
258
|
-
} =
|
|
259
|
-
|
|
260
|
-
if (spaces.length === 0)
|
|
99
|
+
spaceList: c
|
|
100
|
+
} = n, o = c.value;
|
|
101
|
+
if (o.length === 0)
|
|
261
102
|
return {};
|
|
262
103
|
const {
|
|
263
|
-
left,
|
|
264
|
-
right
|
|
265
|
-
} =
|
|
104
|
+
left: s,
|
|
105
|
+
right: a
|
|
106
|
+
} = o[r.value] || {};
|
|
266
107
|
return {
|
|
267
|
-
paddingLeft:
|
|
268
|
-
paddingRight:
|
|
108
|
+
paddingLeft: s ? `${s}px` : 0,
|
|
109
|
+
paddingRight: a ? `${a}px` : 0
|
|
269
110
|
};
|
|
270
111
|
});
|
|
271
112
|
return () => {
|
|
272
|
-
var
|
|
113
|
+
var s;
|
|
273
114
|
const {
|
|
274
|
-
span,
|
|
275
|
-
offset
|
|
276
|
-
} =
|
|
277
|
-
return
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
[
|
|
281
|
-
[`offset-${
|
|
115
|
+
span: c,
|
|
116
|
+
offset: o
|
|
117
|
+
} = e;
|
|
118
|
+
return $("div", {
|
|
119
|
+
style: i.value,
|
|
120
|
+
class: U({
|
|
121
|
+
[c]: c,
|
|
122
|
+
[`offset-${o}`]: o
|
|
282
123
|
})
|
|
283
|
-
}, [(
|
|
124
|
+
}, [(s = t.default) == null ? void 0 : s.call(t)]);
|
|
284
125
|
};
|
|
285
126
|
}
|
|
286
127
|
});
|
|
287
|
-
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
const animation = "";
|
|
291
|
-
const theme = "";
|
|
292
|
-
const style = "";
|
|
293
|
-
Col.install = (app) => {
|
|
294
|
-
const { name: name2 } = Col;
|
|
295
|
-
app.component(name2, Col);
|
|
128
|
+
f.install = (e) => {
|
|
129
|
+
const { name: t } = f;
|
|
130
|
+
e.component(t, f);
|
|
296
131
|
};
|
|
297
132
|
export {
|
|
298
|
-
|
|
133
|
+
f as default
|
|
299
134
|
};
|