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/tab/index.mjs
CHANGED
|
@@ -1,58 +1,24 @@
|
|
|
1
|
-
import { inject, getCurrentInstance, onUnmounted
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const index = computed(() => childrens.indexOf(currentInstance));
|
|
10
|
-
return {
|
|
11
|
-
index,
|
|
12
|
-
parent
|
|
1
|
+
import { inject as x, getCurrentInstance as m, onUnmounted as $, computed as f, ref as h, reactive as b, defineComponent as p, createVNode as y, onBeforeUnmount as N, isVNode as _ } from "vue";
|
|
2
|
+
const g = (n) => {
|
|
3
|
+
const t = x(n, null), i = m();
|
|
4
|
+
if (t && i) {
|
|
5
|
+
const { childrens: e, addChild: r, removeChild: a } = t;
|
|
6
|
+
return r(i), $(() => a(i)), {
|
|
7
|
+
index: f(() => e.indexOf(i)),
|
|
8
|
+
parent: t
|
|
13
9
|
};
|
|
14
10
|
}
|
|
15
11
|
return {
|
|
16
12
|
parent: null,
|
|
17
|
-
index:
|
|
13
|
+
index: h(-1)
|
|
18
14
|
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
if (Array.isArray(mods)) {
|
|
28
|
-
return mods.reduce((acc, cur) => acc + getMods(el, cur), "");
|
|
29
|
-
}
|
|
30
|
-
return Object.keys(mods).reduce(
|
|
31
|
-
(acc, cur) => acc + (mods[cur] ? getMods(el, cur) : ""),
|
|
32
|
-
""
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
const createBEM = (block) => {
|
|
36
|
-
return (el, mods) => {
|
|
37
|
-
let _el = el;
|
|
38
|
-
let _mods = mods;
|
|
39
|
-
if (_el && typeof _el !== "string") {
|
|
40
|
-
_mods = _el;
|
|
41
|
-
_el = "";
|
|
42
|
-
}
|
|
43
|
-
_el = _el ? `${block}__${_el}` : block;
|
|
44
|
-
return `${_el}${getMods(_el, _mods)}`;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
const createGlobalBem = () => {
|
|
48
|
-
return (el, mods) => {
|
|
49
|
-
if (!mods) {
|
|
50
|
-
return `y-${el}`;
|
|
51
|
-
}
|
|
52
|
-
return `${getMods(`y-${el}`, mods)}`;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
const defaultLang = {
|
|
15
|
+
}, u = (n, t) => t ? typeof t == "string" ? ` ${n}--${t}` : Array.isArray(t) ? t.reduce((i, e) => i + u(n, e), "") : Object.keys(t).reduce(
|
|
16
|
+
(i, e) => i + (t[e] ? u(n, e) : ""),
|
|
17
|
+
""
|
|
18
|
+
) : "", v = (n) => (t, i) => {
|
|
19
|
+
let e = t, r = i;
|
|
20
|
+
return e && typeof e != "string" && (r = e, e = ""), e = e ? `${n}__${e}` : n, `${e}${u(e, r)}`;
|
|
21
|
+
}, S = () => (n, t) => t ? `${u(`y-${n}`, t)}` : `y-${n}`, w = {
|
|
56
22
|
"pull-refresh": {
|
|
57
23
|
pulling: "下拉刷新...",
|
|
58
24
|
loosing: "释放刷新...",
|
|
@@ -64,19 +30,15 @@ const defaultLang = {
|
|
|
64
30
|
validateMessage: "请输入正确内容"
|
|
65
31
|
}
|
|
66
32
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"zh-CN":
|
|
33
|
+
h("zh-CN");
|
|
34
|
+
b({
|
|
35
|
+
"zh-CN": w
|
|
70
36
|
});
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
return [
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const SWIPE_PROVIDE_KEY = name$3;
|
|
77
|
-
const [name$2, bem$1] = createNamespace("swipe-item");
|
|
78
|
-
const SwipeItem = /* @__PURE__ */ defineComponent({
|
|
79
|
-
name: name$2,
|
|
37
|
+
const s = (n) => {
|
|
38
|
+
const t = `y-${n}`;
|
|
39
|
+
return [t, v(t), S()];
|
|
40
|
+
}, [I, R] = s("swipe"), j = I, [B, C] = s("swipe-item"), O = /* @__PURE__ */ p({
|
|
41
|
+
name: B,
|
|
80
42
|
props: {
|
|
81
43
|
clonenNode: {
|
|
82
44
|
type: Object,
|
|
@@ -87,60 +49,42 @@ const SwipeItem = /* @__PURE__ */ defineComponent({
|
|
|
87
49
|
default: -1
|
|
88
50
|
}
|
|
89
51
|
},
|
|
90
|
-
setup(
|
|
91
|
-
slots
|
|
52
|
+
setup(n, {
|
|
53
|
+
slots: t
|
|
92
54
|
}) {
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const spacing = `${(parent == null ? void 0 : parent.itemDetail.space) || 0}px`;
|
|
110
|
-
if ((parent == null ? void 0 : parent.props.autoHeight) && (parent == null ? void 0 : parent.activeIndex) !== index.value) {
|
|
111
|
-
height = "0";
|
|
112
|
-
}
|
|
113
|
-
if (parent == null ? void 0 : parent.props.vertical) {
|
|
114
|
-
return {
|
|
115
|
-
height: width,
|
|
116
|
-
width: height,
|
|
117
|
-
marginBottom: spacing
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
return {
|
|
121
|
-
width,
|
|
122
|
-
height,
|
|
123
|
-
marginRight: spacing
|
|
55
|
+
const i = m(), {
|
|
56
|
+
parent: e
|
|
57
|
+
} = g(j);
|
|
58
|
+
!n.clonenNode && i && (e == null || e.children.push(i));
|
|
59
|
+
const r = f(() => n.clonenNode ? n.index : e == null ? void 0 : e.children.findIndex((o) => o.proxy === (i == null ? void 0 : i.proxy))), a = f(() => {
|
|
60
|
+
const o = `${(e == null ? void 0 : e.itemDetail.size) || 0}px`;
|
|
61
|
+
let c = "auto";
|
|
62
|
+
const l = `${(e == null ? void 0 : e.itemDetail.space) || 0}px`;
|
|
63
|
+
return e != null && e.props.autoHeight && (e == null ? void 0 : e.activeIndex) !== r.value && (c = "0"), e != null && e.props.vertical ? {
|
|
64
|
+
height: o,
|
|
65
|
+
width: c,
|
|
66
|
+
marginBottom: l
|
|
67
|
+
} : {
|
|
68
|
+
width: o,
|
|
69
|
+
height: c,
|
|
70
|
+
marginRight: l
|
|
124
71
|
};
|
|
125
72
|
});
|
|
126
73
|
return () => {
|
|
127
|
-
var
|
|
128
|
-
const
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}, [
|
|
74
|
+
var c, l;
|
|
75
|
+
const o = ((c = e == null ? void 0 : e.itemShowedList) == null ? void 0 : c.list[r.value || 0]) || !1;
|
|
76
|
+
return y("div", {
|
|
77
|
+
class: C(),
|
|
78
|
+
style: a.value
|
|
79
|
+
}, [o ? n.clonenNode || ((l = t.default) == null ? void 0 : l.call(t)) : null]);
|
|
133
80
|
};
|
|
134
81
|
}
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
function _isSlot(s) {
|
|
139
|
-
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
82
|
+
}), [E, V] = s("tabs"), z = E;
|
|
83
|
+
function A(n) {
|
|
84
|
+
return typeof n == "function" || Object.prototype.toString.call(n) === "[object Object]" && !_(n);
|
|
140
85
|
}
|
|
141
|
-
const [
|
|
142
|
-
|
|
143
|
-
name,
|
|
86
|
+
const [D] = s("tab"), d = /* @__PURE__ */ p({
|
|
87
|
+
name: D,
|
|
144
88
|
props: {
|
|
145
89
|
title: {
|
|
146
90
|
type: String,
|
|
@@ -152,36 +96,29 @@ const Tab = /* @__PURE__ */ defineComponent({
|
|
|
152
96
|
},
|
|
153
97
|
disabled: {
|
|
154
98
|
type: Boolean,
|
|
155
|
-
default:
|
|
99
|
+
default: !1
|
|
156
100
|
}
|
|
157
101
|
},
|
|
158
|
-
setup(
|
|
159
|
-
slots
|
|
102
|
+
setup(n, {
|
|
103
|
+
slots: t
|
|
160
104
|
}) {
|
|
161
105
|
const {
|
|
162
|
-
parent
|
|
163
|
-
} =
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
parent.children = parent.children.filter((item) => item !== instance.proxy);
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
return () => {
|
|
174
|
-
let _slot;
|
|
175
|
-
return slots.default ? createVNode(SwipeItem, null, _isSlot(_slot = slots.default()) ? _slot : {
|
|
176
|
-
default: () => [_slot]
|
|
106
|
+
parent: i
|
|
107
|
+
} = g(z), e = m();
|
|
108
|
+
return e.proxy && (i == null || i.children.push(e.proxy)), N(() => {
|
|
109
|
+
i && (i.children = i.children.filter((r) => r !== e.proxy));
|
|
110
|
+
}), () => {
|
|
111
|
+
let r;
|
|
112
|
+
return t.default ? y(O, null, A(r = t.default()) ? r : {
|
|
113
|
+
default: () => [r]
|
|
177
114
|
}) : null;
|
|
178
115
|
};
|
|
179
116
|
}
|
|
180
117
|
});
|
|
181
|
-
|
|
182
|
-
const { name:
|
|
183
|
-
|
|
118
|
+
d.install = (n) => {
|
|
119
|
+
const { name: t } = d;
|
|
120
|
+
n.component(t, d);
|
|
184
121
|
};
|
|
185
122
|
export {
|
|
186
|
-
|
|
123
|
+
d as default
|
|
187
124
|
};
|
package/libs/tab/index.umd.js
CHANGED
|
@@ -1,190 +1 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue")) : typeof define === "function" && define.amd ? define(["exports", "vue"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.tab = {}, global.Vue));
|
|
3
|
-
})(this, function(exports2, vue) {
|
|
4
|
-
"use strict";
|
|
5
|
-
const useRelation = (key) => {
|
|
6
|
-
const parent = vue.inject(key, null);
|
|
7
|
-
const currentInstance = vue.getCurrentInstance();
|
|
8
|
-
if (parent && currentInstance) {
|
|
9
|
-
const { childrens, addChild, removeChild } = parent;
|
|
10
|
-
addChild(currentInstance);
|
|
11
|
-
vue.onUnmounted(() => removeChild(currentInstance));
|
|
12
|
-
const index = vue.computed(() => childrens.indexOf(currentInstance));
|
|
13
|
-
return {
|
|
14
|
-
index,
|
|
15
|
-
parent
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
parent: null,
|
|
20
|
-
index: vue.ref(-1)
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
const getMods = (el, mods) => {
|
|
24
|
-
if (!mods) {
|
|
25
|
-
return "";
|
|
26
|
-
}
|
|
27
|
-
if (typeof mods === "string") {
|
|
28
|
-
return ` ${el}--${mods}`;
|
|
29
|
-
}
|
|
30
|
-
if (Array.isArray(mods)) {
|
|
31
|
-
return mods.reduce((acc, cur) => acc + getMods(el, cur), "");
|
|
32
|
-
}
|
|
33
|
-
return Object.keys(mods).reduce(
|
|
34
|
-
(acc, cur) => acc + (mods[cur] ? getMods(el, cur) : ""),
|
|
35
|
-
""
|
|
36
|
-
);
|
|
37
|
-
};
|
|
38
|
-
const createBEM = (block) => {
|
|
39
|
-
return (el, mods) => {
|
|
40
|
-
let _el = el;
|
|
41
|
-
let _mods = mods;
|
|
42
|
-
if (_el && typeof _el !== "string") {
|
|
43
|
-
_mods = _el;
|
|
44
|
-
_el = "";
|
|
45
|
-
}
|
|
46
|
-
_el = _el ? `${block}__${_el}` : block;
|
|
47
|
-
return `${_el}${getMods(_el, _mods)}`;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
const createGlobalBem = () => {
|
|
51
|
-
return (el, mods) => {
|
|
52
|
-
if (!mods) {
|
|
53
|
-
return `y-${el}`;
|
|
54
|
-
}
|
|
55
|
-
return `${getMods(`y-${el}`, mods)}`;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
const defaultLang = {
|
|
59
|
-
"pull-refresh": {
|
|
60
|
-
pulling: "下拉刷新...",
|
|
61
|
-
loosing: "释放刷新...",
|
|
62
|
-
loading: "数据加载中...",
|
|
63
|
-
success: "数据已更新",
|
|
64
|
-
failed: "数据跟新失败,请稍后再试"
|
|
65
|
-
},
|
|
66
|
-
"form-item": {
|
|
67
|
-
validateMessage: "请输入正确内容"
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
vue.ref("zh-CN");
|
|
71
|
-
vue.reactive({
|
|
72
|
-
"zh-CN": defaultLang
|
|
73
|
-
});
|
|
74
|
-
const createNamespace = (name2) => {
|
|
75
|
-
const prefixedName = `y-${name2}`;
|
|
76
|
-
return [prefixedName, createBEM(prefixedName), createGlobalBem()];
|
|
77
|
-
};
|
|
78
|
-
const [name$3, bem$2] = createNamespace("swipe");
|
|
79
|
-
const SWIPE_PROVIDE_KEY = name$3;
|
|
80
|
-
const [name$2, bem$1] = createNamespace("swipe-item");
|
|
81
|
-
const SwipeItem = /* @__PURE__ */ vue.defineComponent({
|
|
82
|
-
name: name$2,
|
|
83
|
-
props: {
|
|
84
|
-
clonenNode: {
|
|
85
|
-
type: Object,
|
|
86
|
-
default: null
|
|
87
|
-
},
|
|
88
|
-
index: {
|
|
89
|
-
type: Number,
|
|
90
|
-
default: -1
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
setup(props, {
|
|
94
|
-
slots
|
|
95
|
-
}) {
|
|
96
|
-
const instance = vue.getCurrentInstance();
|
|
97
|
-
const {
|
|
98
|
-
parent
|
|
99
|
-
} = useRelation(SWIPE_PROVIDE_KEY);
|
|
100
|
-
if (!props.clonenNode && instance) {
|
|
101
|
-
parent == null ? void 0 : parent.children.push(instance);
|
|
102
|
-
}
|
|
103
|
-
const index = vue.computed(() => {
|
|
104
|
-
if (props.clonenNode) {
|
|
105
|
-
return props.index;
|
|
106
|
-
}
|
|
107
|
-
return parent == null ? void 0 : parent.children.findIndex((item) => item.proxy === (instance == null ? void 0 : instance.proxy));
|
|
108
|
-
});
|
|
109
|
-
const style = vue.computed(() => {
|
|
110
|
-
const width = `${(parent == null ? void 0 : parent.itemDetail.size) || 0}px`;
|
|
111
|
-
let height = "auto";
|
|
112
|
-
const spacing = `${(parent == null ? void 0 : parent.itemDetail.space) || 0}px`;
|
|
113
|
-
if ((parent == null ? void 0 : parent.props.autoHeight) && (parent == null ? void 0 : parent.activeIndex) !== index.value) {
|
|
114
|
-
height = "0";
|
|
115
|
-
}
|
|
116
|
-
if (parent == null ? void 0 : parent.props.vertical) {
|
|
117
|
-
return {
|
|
118
|
-
height: width,
|
|
119
|
-
width: height,
|
|
120
|
-
marginBottom: spacing
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
return {
|
|
124
|
-
width,
|
|
125
|
-
height,
|
|
126
|
-
marginRight: spacing
|
|
127
|
-
};
|
|
128
|
-
});
|
|
129
|
-
return () => {
|
|
130
|
-
var _a, _b;
|
|
131
|
-
const isShow = ((_a = parent == null ? void 0 : parent.itemShowedList) == null ? void 0 : _a.list[index.value || 0]) || false;
|
|
132
|
-
return vue.createVNode("div", {
|
|
133
|
-
"class": bem$1(),
|
|
134
|
-
"style": style.value
|
|
135
|
-
}, [isShow ? props.clonenNode || ((_b = slots.default) == null ? void 0 : _b.call(slots)) : null]);
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
const [name$1, bem] = createNamespace("tabs");
|
|
140
|
-
const TABS_KEY = name$1;
|
|
141
|
-
function _isSlot(s) {
|
|
142
|
-
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
|
|
143
|
-
}
|
|
144
|
-
const [name] = createNamespace("tab");
|
|
145
|
-
const Tab = /* @__PURE__ */ vue.defineComponent({
|
|
146
|
-
name,
|
|
147
|
-
props: {
|
|
148
|
-
title: {
|
|
149
|
-
type: String,
|
|
150
|
-
default: ""
|
|
151
|
-
},
|
|
152
|
-
name: {
|
|
153
|
-
type: [String, Number],
|
|
154
|
-
default: ""
|
|
155
|
-
},
|
|
156
|
-
disabled: {
|
|
157
|
-
type: Boolean,
|
|
158
|
-
default: false
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
setup(_, {
|
|
162
|
-
slots
|
|
163
|
-
}) {
|
|
164
|
-
const {
|
|
165
|
-
parent
|
|
166
|
-
} = useRelation(TABS_KEY);
|
|
167
|
-
const instance = vue.getCurrentInstance();
|
|
168
|
-
if (instance.proxy) {
|
|
169
|
-
parent == null ? void 0 : parent.children.push(instance.proxy);
|
|
170
|
-
}
|
|
171
|
-
vue.onBeforeUnmount(() => {
|
|
172
|
-
if (parent) {
|
|
173
|
-
parent.children = parent.children.filter((item) => item !== instance.proxy);
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
return () => {
|
|
177
|
-
let _slot;
|
|
178
|
-
return slots.default ? vue.createVNode(SwipeItem, null, _isSlot(_slot = slots.default()) ? _slot : {
|
|
179
|
-
default: () => [_slot]
|
|
180
|
-
}) : null;
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
Tab.install = (Vue) => {
|
|
185
|
-
const { name: name2 } = Tab;
|
|
186
|
-
Vue.component(name2, Tab);
|
|
187
|
-
};
|
|
188
|
-
exports2.default = Tab;
|
|
189
|
-
Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
190
|
-
});
|
|
1
|
+
(function(c,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(c=typeof globalThis<"u"?globalThis:c||self,o(c.tab={},c.Vue))})(this,function(c,o){"use strict";const p=n=>{const t=o.inject(n,null),i=o.getCurrentInstance();if(t&&i){const{childrens:e,addChild:r,removeChild:m}=t;return r(i),o.onUnmounted(()=>m(i)),{index:o.computed(()=>e.indexOf(i)),parent:t}}return{parent:null,index:o.ref(-1)}},d=(n,t)=>t?typeof t=="string"?` ${n}--${t}`:Array.isArray(t)?t.reduce((i,e)=>i+d(n,e),""):Object.keys(t).reduce((i,e)=>i+(t[e]?d(n,e):""),""):"",h=n=>(t,i)=>{let e=t,r=i;return e&&typeof e!="string"&&(r=e,e=""),e=e?`${n}__${e}`:n,`${e}${d(e,r)}`},y=()=>(n,t)=>t?`${d(`y-${n}`,t)}`:`y-${n}`,g={"pull-refresh":{pulling:"下拉刷新...",loosing:"释放刷新...",loading:"数据加载中...",success:"数据已更新",failed:"数据跟新失败,请稍后再试"},"form-item":{validateMessage:"请输入正确内容"}};o.ref("zh-CN"),o.reactive({"zh-CN":g});const f=n=>{const t=`y-${n}`;return[t,h(t),y()]},[x,w]=f("swipe"),b=x,[$,N]=f("swipe-item"),_=o.defineComponent({name:$,props:{clonenNode:{type:Object,default:null},index:{type:Number,default:-1}},setup(n,{slots:t}){const i=o.getCurrentInstance(),{parent:e}=p(b);!n.clonenNode&&i&&(e==null||e.children.push(i));const r=o.computed(()=>n.clonenNode?n.index:e==null?void 0:e.children.findIndex(l=>l.proxy===(i==null?void 0:i.proxy))),m=o.computed(()=>{const l=`${(e==null?void 0:e.itemDetail.size)||0}px`;let s="auto";const u=`${(e==null?void 0:e.itemDetail.space)||0}px`;return e!=null&&e.props.autoHeight&&(e==null?void 0:e.activeIndex)!==r.value&&(s="0"),e!=null&&e.props.vertical?{height:l,width:s,marginBottom:u}:{width:l,height:s,marginRight:u}});return()=>{var s,u;const l=((s=e==null?void 0:e.itemShowedList)==null?void 0:s.list[r.value||0])||!1;return o.createVNode("div",{class:N(),style:m.value},[l?n.clonenNode||((u=t.default)==null?void 0:u.call(t)):null])}}}),[S,O]=f("tabs"),C=S;function I(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!o.isVNode(n)}const[j]=f("tab"),a=o.defineComponent({name:j,props:{title:{type:String,default:""},name:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1}},setup(n,{slots:t}){const{parent:i}=p(C),e=o.getCurrentInstance();return e.proxy&&(i==null||i.children.push(e.proxy)),o.onBeforeUnmount(()=>{i&&(i.children=i.children.filter(r=>r!==e.proxy))}),()=>{let r;return t.default?o.createVNode(_,null,I(r=t.default())?r:{default:()=>[r]}):null}}});a.install=n=>{const{name:t}=a;n.component(t,a)},c.default=a,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|