y-design-ssr 0.2.5 → 0.2.6
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 +579 -1
- package/libs/button/index.mjs +111 -66
- package/libs/button/index.umd.js +203 -2
- package/libs/button/package.json +1 -1
- package/libs/{types/components/button → button}/src/button.d.ts +1 -1
- package/libs/cell/index.css +1077 -1
- package/libs/{types/components/cell → cell}/index.d.ts +1 -0
- package/libs/cell/index.mjs +168 -104
- package/libs/cell/index.umd.js +301 -2
- package/libs/cell/package.json +1 -1
- package/libs/{types/components/cell → cell}/src/cell.d.ts +1 -1
- package/libs/checkbox/index.css +1053 -1
- package/libs/{types/components/checkbox → checkbox}/index.d.ts +1 -0
- package/libs/checkbox/index.mjs +243 -127
- package/libs/checkbox/index.umd.js +370 -2
- package/libs/checkbox/package.json +1 -1
- package/libs/checkboxGroup/index.css +422 -1
- package/libs/{types/components/checkboxGroup → checkboxGroup}/index.d.ts +1 -0
- package/libs/checkboxGroup/index.mjs +174 -87
- package/libs/checkboxGroup/index.umd.js +266 -2
- package/libs/checkboxGroup/package.json +1 -1
- package/libs/col/index.css +615 -1
- package/libs/{types/components/col → col}/index.d.ts +1 -0
- package/libs/col/index.mjs +247 -81
- package/libs/col/index.umd.js +306 -2
- package/libs/col/package.json +1 -1
- package/libs/countdown/index.css +417 -1
- package/libs/{types/components/countdown → countdown}/index.d.ts +1 -0
- package/libs/countdown/index.mjs +180 -71
- package/libs/countdown/index.umd.js +232 -2
- package/libs/countdown/package.json +1 -1
- package/libs/dialog/index.css +1405 -1
- package/libs/{types/components/dialog → dialog}/index.d.ts +1 -0
- package/libs/dialog/index.mjs +647 -476
- package/libs/dialog/index.umd.js +1129 -2
- package/libs/dialog/package.json +1 -1
- package/libs/{types/components/dialog → dialog}/src/dialog.d.ts +1 -1
- package/libs/empty/index.css +457 -1
- package/libs/{types/components/empty → empty}/index.d.ts +1 -0
- package/libs/empty/index.mjs +92 -44
- package/libs/empty/index.umd.js +140 -2
- package/libs/empty/package.json +1 -1
- package/libs/form/index.css +477 -1
- package/libs/{types/components/form → form}/index.d.ts +1 -0
- package/libs/form/index.mjs +227 -126
- package/libs/form/index.umd.js +320 -2
- package/libs/form/package.json +1 -1
- package/libs/formItem/index.css +477 -1
- package/libs/{types/components/formItem → formItem}/index.d.ts +1 -0
- package/libs/formItem/index.mjs +277 -126
- package/libs/formItem/index.umd.js +373 -2
- package/libs/formItem/package.json +1 -1
- package/libs/icon/index.css +982 -1
- package/libs/{types/components/icon → icon}/index.d.ts +1 -0
- package/libs/icon/index.mjs +108 -58
- package/libs/icon/index.umd.js +187 -2
- package/libs/icon/package.json +1 -1
- package/libs/index.css +2902 -1
- package/libs/index.d.ts +86 -3
- package/libs/index.mjs +3785 -2344
- package/libs/index.umd.js +5509 -2
- package/libs/input/index.css +483 -1
- package/libs/{types/components/input → input}/index.d.ts +1 -0
- package/libs/input/index.mjs +184 -92
- package/libs/input/index.umd.js +275 -2
- package/libs/input/package.json +1 -1
- package/libs/layout/index.css +684 -1
- package/libs/layout/index.mjs +230 -130
- package/libs/layout/index.umd.js +318 -2
- package/libs/layout/package.json +1 -1
- package/libs/list/index.css +440 -1
- package/libs/{types/components/list → list}/index.d.ts +1 -0
- package/libs/list/index.mjs +389 -207
- package/libs/list/index.umd.js +572 -2
- package/libs/list/package.json +1 -1
- package/libs/loading/index.css +548 -1
- package/libs/{types/components/loading → loading}/index.d.ts +1 -0
- package/libs/loading/index.mjs +197 -118
- package/libs/loading/index.umd.js +322 -2
- package/libs/loading/package.json +1 -1
- package/libs/{types/components/loading → loading}/src/loading.d.ts +1 -1
- package/libs/mask/index.css +426 -1
- package/libs/{types/components/mask → mask}/index.d.ts +1 -0
- package/libs/mask/index.mjs +132 -70
- package/libs/mask/index.umd.js +202 -2
- package/libs/mask/package.json +1 -1
- package/libs/popup/index.css +465 -1
- package/libs/{types/components/popup → popup}/index.d.ts +1 -0
- package/libs/popup/index.mjs +211 -134
- package/libs/popup/index.umd.js +359 -2
- package/libs/popup/package.json +1 -1
- package/libs/{types/components/popup → popup}/src/popup.d.ts +1 -1
- package/libs/progress/index.css +488 -1
- package/libs/{types/components/progress → progress}/index.d.ts +1 -0
- package/libs/progress/index.mjs +201 -128
- package/libs/progress/index.umd.js +323 -2
- package/libs/progress/package.json +1 -1
- package/libs/pullrefresh/index.css +441 -1
- package/libs/{types/components/pullrefresh → pullrefresh}/index.d.ts +1 -0
- package/libs/pullrefresh/index.mjs +242 -111
- package/libs/pullrefresh/index.umd.js +303 -2
- package/libs/pullrefresh/package.json +1 -1
- package/libs/row/index.css +485 -1
- package/libs/{types/components/row → row}/index.d.ts +1 -0
- package/libs/row/index.mjs +182 -89
- package/libs/row/index.umd.js +238 -2
- package/libs/row/package.json +1 -1
- package/libs/{types/components/row → row}/src/row.d.ts +1 -1
- package/libs/slider/index.css +558 -1
- package/libs/{types/components/slider → slider}/index.d.ts +1 -0
- package/libs/slider/index.mjs +357 -160
- package/libs/slider/index.umd.js +454 -2
- package/libs/slider/package.json +1 -1
- package/libs/stepper/index.css +489 -1
- package/libs/{types/components/stepper → stepper}/index.d.ts +1 -0
- package/libs/stepper/index.mjs +182 -101
- package/libs/stepper/index.umd.js +270 -2
- package/libs/stepper/package.json +1 -1
- package/libs/swipe/index.css +506 -1
- package/libs/{types/components/swipe → swipe}/index.d.ts +1 -0
- package/libs/swipe/index.mjs +543 -259
- package/libs/swipe/index.umd.js +704 -2
- package/libs/swipe/package.json +1 -1
- package/libs/swipeItem/index.css +424 -1
- package/libs/{types/components/swipeItem → swipeItem}/index.d.ts +1 -0
- package/libs/swipeItem/index.mjs +112 -52
- package/libs/swipeItem/index.umd.js +155 -2
- package/libs/swipeItem/package.json +1 -1
- package/libs/switch/index.css +472 -1
- package/libs/{types/components/switch → switch}/index.d.ts +1 -0
- package/libs/switch/index.mjs +122 -62
- package/libs/switch/index.umd.js +201 -2
- package/libs/switch/package.json +1 -1
- package/libs/{types/components/switch → switch}/src/switch.d.ts +1 -1
- package/libs/{types/components/tab → tab}/index.d.ts +1 -0
- package/libs/tab/index.mjs +132 -68
- package/libs/tab/index.umd.js +191 -1
- package/libs/tab/package.json +1 -1
- package/libs/tabs/index.css +514 -1
- package/libs/{types/components/tabs → tabs}/index.d.ts +1 -0
- package/libs/tabs/index.mjs +752 -410
- package/libs/tabs/index.umd.js +1021 -2
- package/libs/tabs/package.json +1 -1
- package/libs/toast/index.css +1050 -1
- package/libs/{types/components/toast → toast}/index.d.ts +1 -0
- package/libs/toast/index.mjs +184 -114
- package/libs/toast/index.umd.js +307 -2
- package/libs/toast/package.json +1 -1
- package/libs/{types/components/toast → toast}/src/toast.d.ts +1 -1
- package/libs/tooltip/index.css +514 -1
- package/libs/{types/components/tooltip → tooltip}/index.d.ts +1 -0
- package/libs/tooltip/index.mjs +294 -155
- package/libs/tooltip/index.umd.js +417 -2
- package/libs/tooltip/package.json +1 -1
- package/libs/vue-sfc.d.ts +12 -0
- package/libs/vue-tsx.d.ts +42 -0
- package/package.json +2 -2
- package/libs/types/index.d.ts +0 -86
- /package/libs/{types/components/button → button}/index.d.ts +0 -0
- /package/libs/{types/components/checkbox → checkbox}/src/checkbox.d.ts +0 -0
- /package/libs/{types/components/checkboxGroup → checkboxGroup}/src/checkboxGroup.d.ts +0 -0
- /package/libs/{types/components/checkboxGroup → checkboxGroup}/src/constants.d.ts +0 -0
- /package/libs/{types/components/col → col}/src/col.d.ts +0 -0
- /package/libs/{types/context → context}/filed/constants.d.ts +0 -0
- /package/libs/{types/context → context}/filed/index.d.ts +0 -0
- /package/libs/{types/context → context}/filed/inject.d.ts +0 -0
- /package/libs/{types/context → context}/filed/provide.d.ts +0 -0
- /package/libs/{types/context → context}/relation/index.d.ts +0 -0
- /package/libs/{types/context → context}/relation/inject.d.ts +0 -0
- /package/libs/{types/context → context}/relation/provide.d.ts +0 -0
- /package/libs/{types/components/countdown → countdown}/src/count-down.d.ts +0 -0
- /package/libs/{types/components/dialog → dialog}/src/create.d.ts +0 -0
- /package/libs/{types/components/empty → empty}/src/empty.d.ts +0 -0
- /package/libs/{types/components/empty → empty}/src/utils.d.ts +0 -0
- /package/libs/{types/components/form → form}/src/constants.d.ts +0 -0
- /package/libs/{types/components/form → form}/src/form.d.ts +0 -0
- /package/libs/{types/components/formItem → formItem}/src/formItem.d.ts +0 -0
- /package/libs/{types/hooks → hooks}/touch/index.d.ts +0 -0
- /package/libs/{types/components/icon → icon}/src/icon.d.ts +0 -0
- /package/libs/{types/components/input → input}/src/input.d.ts +0 -0
- /package/libs/{types/components/list → list}/src/list.d.ts +0 -0
- /package/libs/{types/components/loading → loading}/src/create.d.ts +0 -0
- /package/libs/{types/components/loading → loading}/src/directive.d.ts +0 -0
- /package/libs/{types/locale → locale}/index.d.ts +0 -0
- /package/libs/{types/locale → locale}/lang/zh-CN.d.ts +0 -0
- /package/libs/{types/components/mask → mask}/src/mask.d.ts +0 -0
- /package/libs/{types/components/progress → progress}/src/progress.d.ts +0 -0
- /package/libs/{types/components/pullrefresh → pullrefresh}/src/pullrefresh.d.ts +0 -0
- /package/libs/{types/components/pullrefresh → pullrefresh}/src/utils.d.ts +0 -0
- /package/libs/{types/components/row → row}/src/constants.d.ts +0 -0
- /package/libs/{types/components/slider → slider}/src/slider.d.ts +0 -0
- /package/libs/{types/components/stepper → stepper}/src/stepper.d.ts +0 -0
- /package/libs/{types/style → style}/index.d.ts +0 -0
- /package/libs/{types/components/swipe → swipe}/src/constants.d.ts +0 -0
- /package/libs/{types/components/swipe → swipe}/src/swipe.d.ts +0 -0
- /package/libs/{types/components/swipeItem → swipeItem}/src/swipeItem.d.ts +0 -0
- /package/libs/{types/components/tab → tab}/src/tab.d.ts +0 -0
- /package/libs/{types/components/tabs → tabs}/src/constants.d.ts +0 -0
- /package/libs/{types/components/tabs → tabs}/src/tabs.d.ts +0 -0
- /package/libs/{types/components/tabs → tabs}/src/title.d.ts +0 -0
- /package/libs/{types/components/toast → toast}/src/create.d.ts +0 -0
- /package/libs/{types/components/tooltip → tooltip}/src/constants.d.ts +0 -0
- /package/libs/{types/components/tooltip → tooltip}/src/direactive.d.ts +0 -0
- /package/libs/{types/components/tooltip → tooltip}/src/popper.d.ts +0 -0
- /package/libs/{types/components/tooltip → tooltip}/src/tooltip.d.ts +0 -0
- /package/libs/{types/utils → utils}/create/bem.d.ts +0 -0
- /package/libs/{types/utils → utils}/create/index.d.ts +0 -0
- /package/libs/{types/utils → utils}/index.d.ts +0 -0
- /package/libs/{types/utils → utils}/is.d.ts +0 -0
- /package/libs/{types/utils → utils}/parseFlexDirection.d.ts +0 -0
- /package/libs/{types/utils → utils}/parseUnit.d.ts +0 -0
- /package/libs/{types/utils → utils}/types.d.ts +0 -0
package/libs/layout/index.mjs
CHANGED
|
@@ -1,11 +1,40 @@
|
|
|
1
|
-
import { ref
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
1
|
+
import { ref, reactive, getCurrentInstance, provide, isVNode, inject, onUnmounted, computed, defineComponent, createVNode } from "vue";
|
|
2
|
+
const getMods = (el, mods) => {
|
|
3
|
+
if (!mods) {
|
|
4
|
+
return "";
|
|
5
|
+
}
|
|
6
|
+
if (typeof mods === "string") {
|
|
7
|
+
return ` ${el}--${mods}`;
|
|
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 = {
|
|
9
38
|
"pull-refresh": {
|
|
10
39
|
pulling: "下拉刷新...",
|
|
11
40
|
loosing: "释放刷新...",
|
|
@@ -17,61 +46,106 @@ const p = (e, t) => t ? typeof t == "string" ? ` ${e}--${t}` : Array.isArray(t)
|
|
|
17
46
|
validateMessage: "请输入正确内容"
|
|
18
47
|
}
|
|
19
48
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"zh-CN":
|
|
49
|
+
ref("zh-CN");
|
|
50
|
+
reactive({
|
|
51
|
+
"zh-CN": defaultLang
|
|
23
52
|
});
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
return [
|
|
53
|
+
const createNamespace = (name2) => {
|
|
54
|
+
const prefixedName = `y-${name2}`;
|
|
55
|
+
return [prefixedName, createBEM(prefixedName), createGlobalBem()];
|
|
27
56
|
};
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
57
|
+
var Vertical = /* @__PURE__ */ ((Vertical2) => {
|
|
58
|
+
Vertical2["Top"] = "top";
|
|
59
|
+
Vertical2["Middle"] = "middle";
|
|
60
|
+
Vertical2["Bottom"] = "bottom";
|
|
61
|
+
return Vertical2;
|
|
62
|
+
})(Vertical || {});
|
|
63
|
+
const ROW_PROVIDE = Symbol("Y-Row");
|
|
64
|
+
var RowType = /* @__PURE__ */ ((RowType2) => {
|
|
65
|
+
RowType2["Flex"] = "flex";
|
|
66
|
+
RowType2["Default"] = "";
|
|
67
|
+
return RowType2;
|
|
68
|
+
})(RowType || {});
|
|
69
|
+
var RowJustify = /* @__PURE__ */ ((RowJustify2) => {
|
|
70
|
+
RowJustify2["Start"] = "start";
|
|
71
|
+
RowJustify2["Center"] = "center";
|
|
72
|
+
RowJustify2["End"] = "end";
|
|
73
|
+
RowJustify2["SpaceBetween"] = "space-between";
|
|
74
|
+
RowJustify2["SpaceAround"] = "space-around";
|
|
75
|
+
return RowJustify2;
|
|
76
|
+
})(RowJustify || {});
|
|
77
|
+
const filterChildren = (children) => {
|
|
78
|
+
const vnodes = [];
|
|
79
|
+
const _filterChildren = (childrens) => {
|
|
80
|
+
if (Array.isArray(childrens)) {
|
|
81
|
+
childrens.forEach((child) => {
|
|
82
|
+
var _a;
|
|
83
|
+
if (isVNode(child)) {
|
|
84
|
+
vnodes.push(child);
|
|
85
|
+
if ((_a = child.component) == null ? void 0 : _a.subTree) {
|
|
86
|
+
_filterChildren(child.component.subTree.children);
|
|
87
|
+
}
|
|
88
|
+
if (child.children) {
|
|
89
|
+
_filterChildren(child.children);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
_filterChildren(children);
|
|
96
|
+
return vnodes;
|
|
97
|
+
};
|
|
98
|
+
const sortChildren = (childrens, instance) => {
|
|
99
|
+
const vnodes = filterChildren(instance.subTree.children);
|
|
100
|
+
childrens.sort((a, b) => vnodes.indexOf(a.vnode) - vnodes.indexOf(b.vnode));
|
|
101
|
+
};
|
|
102
|
+
const setRelation = (key) => {
|
|
103
|
+
const instance = getCurrentInstance();
|
|
104
|
+
const childrens = reactive([]);
|
|
105
|
+
const initProvide = (value) => {
|
|
106
|
+
const addChild = (child) => {
|
|
107
|
+
if (child.proxy) {
|
|
108
|
+
childrens.push(child);
|
|
109
|
+
instance && sortChildren(childrens, instance);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
const removeChild = (child) => {
|
|
113
|
+
const index = childrens.indexOf(child);
|
|
114
|
+
childrens.splice(index, 1);
|
|
115
|
+
};
|
|
116
|
+
provide(key, {
|
|
117
|
+
addChild,
|
|
118
|
+
removeChild,
|
|
119
|
+
childrens,
|
|
120
|
+
...value
|
|
36
121
|
});
|
|
37
122
|
};
|
|
38
|
-
return n(e), t;
|
|
39
|
-
}, z = (e, t) => {
|
|
40
|
-
const n = I(t.subTree.children);
|
|
41
|
-
e.sort((r, i) => n.indexOf(r.vnode) - n.indexOf(i.vnode));
|
|
42
|
-
}, D = (e) => {
|
|
43
|
-
const t = y(), n = v([]);
|
|
44
123
|
return {
|
|
45
|
-
childrens
|
|
46
|
-
initProvide
|
|
47
|
-
_(e, {
|
|
48
|
-
addChild: (o) => {
|
|
49
|
-
o.proxy && (n.push(o), t && z(n, t));
|
|
50
|
-
},
|
|
51
|
-
removeChild: (o) => {
|
|
52
|
-
const c = n.indexOf(o);
|
|
53
|
-
n.splice(c, 1);
|
|
54
|
-
},
|
|
55
|
-
childrens: n,
|
|
56
|
-
...i
|
|
57
|
-
});
|
|
58
|
-
}
|
|
124
|
+
childrens,
|
|
125
|
+
initProvide
|
|
59
126
|
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
127
|
+
};
|
|
128
|
+
const useRelation = (key) => {
|
|
129
|
+
const parent = inject(key, null);
|
|
130
|
+
const currentInstance = getCurrentInstance();
|
|
131
|
+
if (parent && currentInstance) {
|
|
132
|
+
const { childrens, addChild, removeChild } = parent;
|
|
133
|
+
addChild(currentInstance);
|
|
134
|
+
onUnmounted(() => removeChild(currentInstance));
|
|
135
|
+
const index = computed(() => childrens.indexOf(currentInstance));
|
|
136
|
+
return {
|
|
137
|
+
index,
|
|
138
|
+
parent
|
|
67
139
|
};
|
|
68
140
|
}
|
|
69
141
|
return {
|
|
70
142
|
parent: null,
|
|
71
|
-
index:
|
|
143
|
+
index: ref(-1)
|
|
72
144
|
};
|
|
73
|
-
}
|
|
74
|
-
|
|
145
|
+
};
|
|
146
|
+
const [name$1, bem$1] = createNamespace("row");
|
|
147
|
+
const Row = /* @__PURE__ */ defineComponent({
|
|
148
|
+
name: name$1,
|
|
75
149
|
props: {
|
|
76
150
|
type: {
|
|
77
151
|
type: String,
|
|
@@ -84,66 +158,83 @@ const I = (e) => {
|
|
|
84
158
|
},
|
|
85
159
|
align: {
|
|
86
160
|
type: String,
|
|
87
|
-
default:
|
|
161
|
+
default: Vertical.Top
|
|
88
162
|
},
|
|
89
163
|
justify: {
|
|
90
164
|
type: String,
|
|
91
|
-
default:
|
|
165
|
+
default: RowJustify.Start
|
|
92
166
|
}
|
|
93
167
|
},
|
|
94
|
-
setup(
|
|
95
|
-
slots
|
|
168
|
+
setup(props, {
|
|
169
|
+
slots
|
|
96
170
|
}) {
|
|
97
171
|
const {
|
|
98
|
-
childrens
|
|
99
|
-
initProvide
|
|
100
|
-
} =
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
172
|
+
childrens,
|
|
173
|
+
initProvide
|
|
174
|
+
} = setRelation(ROW_PROVIDE);
|
|
175
|
+
const groupList = computed(() => {
|
|
176
|
+
const groups = [[]];
|
|
177
|
+
let totalSpan = 0;
|
|
178
|
+
childrens.forEach((child, index) => {
|
|
179
|
+
var _a;
|
|
180
|
+
totalSpan += Number((_a = child.proxy) == null ? void 0 : _a.span);
|
|
181
|
+
if (totalSpan > 24) {
|
|
182
|
+
groups.push([index]);
|
|
183
|
+
totalSpan -= 24;
|
|
184
|
+
} else {
|
|
185
|
+
groups[groups.length - 1].push(index);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
return groups;
|
|
189
|
+
});
|
|
190
|
+
const spaceList = computed(() => {
|
|
191
|
+
const gutter = Number(props.gutter);
|
|
192
|
+
const spaces = [];
|
|
193
|
+
if (!gutter)
|
|
194
|
+
return spaces;
|
|
195
|
+
groupList.value.forEach((group) => {
|
|
196
|
+
const averagePadding = gutter * (group.length - 1) / group.length;
|
|
197
|
+
group.forEach((item, index) => {
|
|
198
|
+
if (index === 0) {
|
|
199
|
+
spaces.push({
|
|
200
|
+
right: averagePadding,
|
|
115
201
|
left: 0
|
|
116
202
|
});
|
|
117
|
-
else {
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
203
|
+
} else {
|
|
204
|
+
const left = gutter - spaces[item - 1].right;
|
|
205
|
+
const right = averagePadding - left;
|
|
206
|
+
spaces.push({
|
|
207
|
+
left,
|
|
208
|
+
right
|
|
122
209
|
});
|
|
123
210
|
}
|
|
124
211
|
});
|
|
125
|
-
})
|
|
212
|
+
});
|
|
213
|
+
return spaces;
|
|
126
214
|
});
|
|
127
|
-
|
|
128
|
-
spaceList
|
|
129
|
-
})
|
|
130
|
-
|
|
215
|
+
initProvide({
|
|
216
|
+
spaceList
|
|
217
|
+
});
|
|
218
|
+
return () => {
|
|
219
|
+
var _a;
|
|
131
220
|
const {
|
|
132
|
-
type
|
|
133
|
-
align
|
|
134
|
-
justify
|
|
135
|
-
} =
|
|
136
|
-
return
|
|
137
|
-
class:
|
|
138
|
-
[
|
|
139
|
-
[`align-${
|
|
140
|
-
[`justify-${
|
|
221
|
+
type,
|
|
222
|
+
align,
|
|
223
|
+
justify
|
|
224
|
+
} = props;
|
|
225
|
+
return createVNode("div", {
|
|
226
|
+
"class": bem$1({
|
|
227
|
+
[type]: type,
|
|
228
|
+
[`align-${align}`]: type && align,
|
|
229
|
+
[`justify-${justify}`]: type && justify
|
|
141
230
|
})
|
|
142
|
-
}, [(
|
|
231
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
143
232
|
};
|
|
144
233
|
}
|
|
145
|
-
})
|
|
146
|
-
|
|
234
|
+
});
|
|
235
|
+
const [name, bem] = createNamespace("col");
|
|
236
|
+
const Col = /* @__PURE__ */ defineComponent({
|
|
237
|
+
name,
|
|
147
238
|
props: {
|
|
148
239
|
// 列数
|
|
149
240
|
span: {
|
|
@@ -156,57 +247,66 @@ const I = (e) => {
|
|
|
156
247
|
default: 0
|
|
157
248
|
}
|
|
158
249
|
},
|
|
159
|
-
setup(
|
|
160
|
-
slots
|
|
250
|
+
setup(props, {
|
|
251
|
+
slots
|
|
161
252
|
}) {
|
|
162
253
|
const {
|
|
163
|
-
parent
|
|
164
|
-
index
|
|
165
|
-
} =
|
|
166
|
-
|
|
254
|
+
parent,
|
|
255
|
+
index
|
|
256
|
+
} = useRelation(ROW_PROVIDE);
|
|
257
|
+
const style2 = computed(() => {
|
|
258
|
+
if (!parent) {
|
|
167
259
|
return {};
|
|
260
|
+
}
|
|
168
261
|
const {
|
|
169
|
-
spaceList
|
|
170
|
-
} =
|
|
171
|
-
|
|
262
|
+
spaceList
|
|
263
|
+
} = parent;
|
|
264
|
+
const spaces = spaceList.value;
|
|
265
|
+
if (spaces.length === 0)
|
|
172
266
|
return {};
|
|
173
267
|
const {
|
|
174
|
-
left
|
|
175
|
-
right
|
|
176
|
-
} =
|
|
268
|
+
left,
|
|
269
|
+
right
|
|
270
|
+
} = spaces[index.value];
|
|
177
271
|
return {
|
|
178
|
-
paddingLeft:
|
|
179
|
-
paddingRight:
|
|
272
|
+
paddingLeft: left ? `${left}px` : 0,
|
|
273
|
+
paddingRight: right ? `${right}px` : 0
|
|
180
274
|
};
|
|
181
275
|
});
|
|
182
276
|
return () => {
|
|
183
|
-
var
|
|
277
|
+
var _a;
|
|
184
278
|
const {
|
|
185
|
-
span
|
|
186
|
-
offset
|
|
187
|
-
} =
|
|
188
|
-
return
|
|
189
|
-
style:
|
|
190
|
-
class:
|
|
191
|
-
[
|
|
192
|
-
[`offset-${
|
|
279
|
+
span,
|
|
280
|
+
offset
|
|
281
|
+
} = props;
|
|
282
|
+
return createVNode("div", {
|
|
283
|
+
"style": style2.value,
|
|
284
|
+
"class": bem({
|
|
285
|
+
[span]: span,
|
|
286
|
+
[`offset-${offset}`]: offset
|
|
193
287
|
})
|
|
194
|
-
}, [(
|
|
288
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
195
289
|
};
|
|
196
290
|
}
|
|
197
291
|
});
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
292
|
+
const reset = "";
|
|
293
|
+
const libs = "";
|
|
294
|
+
const font = "";
|
|
295
|
+
const animation = "";
|
|
296
|
+
const theme = "";
|
|
297
|
+
const style = "";
|
|
298
|
+
Row.install = (app) => {
|
|
299
|
+
const { name: name2 } = Row;
|
|
300
|
+
app.component(name2, Row);
|
|
201
301
|
};
|
|
202
|
-
|
|
203
|
-
const { name:
|
|
204
|
-
|
|
302
|
+
Col.install = (app) => {
|
|
303
|
+
const { name: name2 } = Col;
|
|
304
|
+
app.component(name2, Col);
|
|
205
305
|
};
|
|
206
306
|
export {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
307
|
+
Col,
|
|
308
|
+
ROW_PROVIDE,
|
|
309
|
+
Row,
|
|
310
|
+
RowJustify,
|
|
311
|
+
RowType
|
|
212
312
|
};
|