y-design-ssr 0.2.6 → 0.2.7
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.mjs +66 -111
- package/libs/button/index.umd.js +2 -203
- package/libs/cell/index.css +1 -1077
- package/libs/cell/index.mjs +105 -168
- package/libs/cell/index.umd.js +2 -301
- package/libs/checkbox/index.css +1 -1053
- package/libs/checkbox/index.mjs +128 -243
- package/libs/checkbox/index.umd.js +2 -370
- package/libs/checkboxGroup/index.css +1 -422
- package/libs/checkboxGroup/index.mjs +88 -174
- package/libs/checkboxGroup/index.umd.js +2 -266
- package/libs/col/index.css +1 -615
- package/libs/col/index.mjs +82 -247
- package/libs/col/index.umd.js +2 -306
- package/libs/countdown/index.css +1 -417
- package/libs/countdown/index.mjs +72 -180
- package/libs/countdown/index.umd.js +2 -232
- package/libs/dialog/index.css +1 -1405
- package/libs/dialog/index.mjs +477 -647
- package/libs/dialog/index.umd.js +2 -1129
- package/libs/empty/index.css +1 -457
- package/libs/empty/index.mjs +45 -92
- package/libs/empty/index.umd.js +2 -140
- package/libs/form/index.css +1 -477
- package/libs/form/index.mjs +127 -227
- package/libs/form/index.umd.js +2 -320
- package/libs/formItem/index.css +1 -477
- package/libs/formItem/index.mjs +127 -277
- package/libs/formItem/index.umd.js +2 -373
- package/libs/icon/index.css +1 -982
- package/libs/icon/index.mjs +59 -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.mjs +93 -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.mjs +208 -389
- package/libs/list/index.umd.js +2 -572
- package/libs/loading/index.css +1 -548
- package/libs/loading/index.mjs +119 -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.mjs +71 -132
- package/libs/mask/index.umd.js +2 -202
- package/libs/popup/index.css +1 -465
- package/libs/popup/index.mjs +135 -211
- package/libs/popup/index.umd.js +2 -359
- package/libs/progress/index.css +1 -488
- package/libs/progress/index.mjs +129 -201
- package/libs/progress/index.umd.js +2 -323
- package/libs/pullrefresh/index.css +1 -441
- package/libs/pullrefresh/index.mjs +112 -242
- package/libs/pullrefresh/index.umd.js +2 -303
- package/libs/row/index.css +1 -485
- package/libs/row/index.mjs +90 -182
- package/libs/row/index.umd.js +2 -238
- package/libs/slider/index.css +1 -558
- package/libs/slider/index.mjs +161 -357
- package/libs/slider/index.umd.js +2 -454
- package/libs/stepper/index.css +1 -489
- package/libs/stepper/index.mjs +102 -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.mjs +260 -543
- package/libs/swipe/index.umd.js +2 -704
- package/libs/swipeItem/index.css +1 -424
- package/libs/swipeItem/index.mjs +53 -112
- package/libs/swipeItem/index.umd.js +2 -155
- package/libs/switch/index.css +1 -472
- package/libs/switch/index.mjs +63 -122
- package/libs/switch/index.umd.js +2 -201
- package/libs/tab/index.mjs +69 -132
- package/libs/tab/index.umd.js +1 -191
- package/libs/tabs/index.css +1 -514
- package/libs/tabs/index.mjs +411 -752
- package/libs/tabs/index.umd.js +2 -1021
- package/libs/toast/index.css +1 -1050
- package/libs/toast/index.mjs +115 -184
- package/libs/toast/index.umd.js +2 -307
- package/libs/tooltip/index.css +1 -514
- package/libs/tooltip/index.mjs +156 -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 +1 -4
package/libs/dialog/index.mjs
CHANGED
|
@@ -1,47 +1,11 @@
|
|
|
1
|
-
import { ref, reactive, defineComponent, onMounted, onUnmounted, watch, createVNode, Transition, withDirectives, vShow, computed, Teleport, Fragment, createApp, h, mergeProps, resolveDirective, isVNode } from "vue";
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const getMods = (el, mods) => {
|
|
10
|
-
if (!mods) {
|
|
11
|
-
return "";
|
|
12
|
-
}
|
|
13
|
-
if (typeof mods === "string") {
|
|
14
|
-
return ` ${el}--${mods}`;
|
|
15
|
-
}
|
|
16
|
-
if (Array.isArray(mods)) {
|
|
17
|
-
return mods.reduce((acc, cur) => acc + getMods(el, cur), "");
|
|
18
|
-
}
|
|
19
|
-
return Object.keys(mods).reduce(
|
|
20
|
-
(acc, cur) => acc + (mods[cur] ? getMods(el, cur) : ""),
|
|
21
|
-
""
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
const createBEM = (block) => {
|
|
25
|
-
return (el, mods) => {
|
|
26
|
-
let _el = el;
|
|
27
|
-
let _mods = mods;
|
|
28
|
-
if (_el && typeof _el !== "string") {
|
|
29
|
-
_mods = _el;
|
|
30
|
-
_el = "";
|
|
31
|
-
}
|
|
32
|
-
_el = _el ? `${block}__${_el}` : block;
|
|
33
|
-
return `${_el}${getMods(_el, _mods)}`;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
const createGlobalBem = () => {
|
|
37
|
-
return (el, mods) => {
|
|
38
|
-
if (!mods) {
|
|
39
|
-
return `y-${el}`;
|
|
40
|
-
}
|
|
41
|
-
return `${getMods(`y-${el}`, mods)}`;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
const defaultLang = {
|
|
1
|
+
import { ref as E, reactive as U, defineComponent as x, onMounted as de, onUnmounted as fe, watch as pe, createVNode as r, Transition as te, withDirectives as P, vShow as ne, computed as F, Teleport as me, Fragment as ge, createApp as q, h as le, mergeProps as ye, resolveDirective as X, isVNode as be } from "vue";
|
|
2
|
+
const oe = (e) => (t) => Object.prototype.toString.call(t) === `[object ${e}]`, Se = oe("Function"), ve = oe("Promise"), D = (e, t) => t ? typeof t == "string" ? ` ${e}--${t}` : Array.isArray(t) ? t.reduce((l, a) => l + D(e, a), "") : Object.keys(t).reduce(
|
|
3
|
+
(l, a) => l + (t[a] ? D(e, a) : ""),
|
|
4
|
+
""
|
|
5
|
+
) : "", $e = (e) => (t, l) => {
|
|
6
|
+
let a = t, s = l;
|
|
7
|
+
return a && typeof a != "string" && (s = a, a = ""), a = a ? `${e}__${a}` : e, `${a}${D(a, s)}`;
|
|
8
|
+
}, he = () => (e, t) => t ? `${D(`y-${e}`, t)}` : `y-${e}`, ke = {
|
|
45
9
|
"pull-refresh": {
|
|
46
10
|
pulling: "下拉刷新...",
|
|
47
11
|
loosing: "释放刷新...",
|
|
@@ -53,22 +17,15 @@ const defaultLang = {
|
|
|
53
17
|
validateMessage: "请输入正确内容"
|
|
54
18
|
}
|
|
55
19
|
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"zh-CN":
|
|
20
|
+
E("zh-CN");
|
|
21
|
+
U({
|
|
22
|
+
"zh-CN": ke
|
|
59
23
|
});
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
return [
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (isNaN(Number(val)) && typeof val === "string") {
|
|
66
|
-
return val;
|
|
67
|
-
}
|
|
68
|
-
return `${val}px`;
|
|
69
|
-
};
|
|
70
|
-
const parseFlexDirection = (location) => {
|
|
71
|
-
switch (location) {
|
|
24
|
+
const w = (e) => {
|
|
25
|
+
const t = `y-${e}`;
|
|
26
|
+
return [t, $e(t), he()];
|
|
27
|
+
}, m = (e) => isNaN(Number(e)) && typeof e == "string" ? e : `${e}px`, Ce = (e) => {
|
|
28
|
+
switch (e) {
|
|
72
29
|
case "top":
|
|
73
30
|
return "column-reverse";
|
|
74
31
|
case "bottom":
|
|
@@ -80,13 +37,11 @@ const parseFlexDirection = (location) => {
|
|
|
80
37
|
default:
|
|
81
38
|
return "column";
|
|
82
39
|
}
|
|
83
|
-
}
|
|
84
|
-
const [name$4, bem$5, gBem$2] = createNamespace("mask");
|
|
85
|
-
const _props$3 = {
|
|
40
|
+
}, [xe, we, Be] = w("mask"), Ne = {
|
|
86
41
|
// 控制显示
|
|
87
42
|
modelValue: {
|
|
88
43
|
type: Boolean,
|
|
89
|
-
default:
|
|
44
|
+
default: !1
|
|
90
45
|
},
|
|
91
46
|
// 层级
|
|
92
47
|
zIndex: {
|
|
@@ -111,118 +66,87 @@ const _props$3 = {
|
|
|
111
66
|
// 触摸滚动开关
|
|
112
67
|
lockScroll: {
|
|
113
68
|
type: Boolean,
|
|
114
|
-
default:
|
|
69
|
+
default: !0
|
|
115
70
|
},
|
|
116
71
|
onAfterLeave: {
|
|
117
72
|
type: Function,
|
|
118
73
|
default: null
|
|
119
74
|
}
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
props: _props$3,
|
|
75
|
+
}, S = U([]);
|
|
76
|
+
let Y = 0;
|
|
77
|
+
const I = /* @__PURE__ */ x({
|
|
78
|
+
name: xe,
|
|
79
|
+
props: Ne,
|
|
126
80
|
emits: ["update:modelValue"],
|
|
127
|
-
setup(
|
|
128
|
-
slots
|
|
81
|
+
setup(e, {
|
|
82
|
+
slots: t
|
|
129
83
|
}) {
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
84
|
+
const l = E("");
|
|
85
|
+
de(() => {
|
|
86
|
+
l.value = `mask${Y}`, Y += 1, a(e.modelValue, !0);
|
|
87
|
+
}), fe(() => {
|
|
88
|
+
const n = S.findIndex((i) => i._id === l.value);
|
|
89
|
+
n >= 0 && S.splice(n, 1);
|
|
90
|
+
}), pe(() => e.modelValue, (n) => {
|
|
91
|
+
a(n);
|
|
135
92
|
});
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
stack.unshift({
|
|
146
|
-
_id: id.value,
|
|
147
|
-
_state: val
|
|
148
|
-
});
|
|
149
|
-
if (stack.length > 1) {
|
|
150
|
-
stack[1]._state = false;
|
|
151
|
-
}
|
|
152
|
-
} else if (!isMounted) {
|
|
153
|
-
stack.splice(0, 1);
|
|
154
|
-
if (stack.length > 0) {
|
|
155
|
-
stack[0]._state = true;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
const find = () => {
|
|
160
|
-
let _state = false;
|
|
161
|
-
for (let i = 0; i < stack.length; i++) {
|
|
162
|
-
if (stack[i]._id === id.value) {
|
|
163
|
-
_state = stack[i]._state;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
93
|
+
const a = (n, i) => {
|
|
94
|
+
n ? (S.unshift({
|
|
95
|
+
_id: l.value,
|
|
96
|
+
_state: n
|
|
97
|
+
}), S.length > 1 && (S[1]._state = !1)) : i || (S.splice(0, 1), S.length > 0 && (S[0]._state = !0));
|
|
98
|
+
}, s = () => {
|
|
99
|
+
let n = !1;
|
|
100
|
+
for (let i = 0; i < S.length; i++)
|
|
101
|
+
S[i]._id === l.value && (n = S[i]._state);
|
|
166
102
|
return {
|
|
167
|
-
_state
|
|
103
|
+
_state: n
|
|
168
104
|
};
|
|
169
|
-
}
|
|
170
|
-
const onTouchMove = (payload) => {
|
|
105
|
+
}, f = (n) => {
|
|
171
106
|
const {
|
|
172
|
-
lockScroll
|
|
173
|
-
} =
|
|
174
|
-
|
|
175
|
-
payload.preventDefault();
|
|
176
|
-
payload.stopPropagation();
|
|
177
|
-
}
|
|
107
|
+
lockScroll: i
|
|
108
|
+
} = e;
|
|
109
|
+
i && (n.preventDefault(), n.stopPropagation());
|
|
178
110
|
};
|
|
179
111
|
return () => {
|
|
180
112
|
const {
|
|
181
|
-
customClass,
|
|
182
|
-
duration,
|
|
183
|
-
zIndex,
|
|
184
|
-
customStyle,
|
|
185
|
-
onAfterLeave
|
|
186
|
-
} =
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
"onAfterLeave": onAfterLeave
|
|
113
|
+
customClass: n,
|
|
114
|
+
duration: i,
|
|
115
|
+
zIndex: p,
|
|
116
|
+
customStyle: g,
|
|
117
|
+
onAfterLeave: c
|
|
118
|
+
} = e, {
|
|
119
|
+
_state: d
|
|
120
|
+
} = s();
|
|
121
|
+
return r(te, {
|
|
122
|
+
name: Be("animation", "fade"),
|
|
123
|
+
onAfterLeave: c
|
|
193
124
|
}, {
|
|
194
125
|
default: () => {
|
|
195
|
-
var
|
|
196
|
-
return [
|
|
197
|
-
|
|
198
|
-
animationDuration: `${
|
|
199
|
-
zIndex,
|
|
200
|
-
...
|
|
126
|
+
var o;
|
|
127
|
+
return [P(r("div", {
|
|
128
|
+
style: {
|
|
129
|
+
animationDuration: `${i}ms`,
|
|
130
|
+
zIndex: p,
|
|
131
|
+
...g
|
|
201
132
|
},
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}, [(
|
|
133
|
+
class: [we(), n],
|
|
134
|
+
onTouchmove: f
|
|
135
|
+
}, [(o = t.default) == null ? void 0 : o.call(t)]), [[ne, d]])];
|
|
205
136
|
}
|
|
206
137
|
});
|
|
207
138
|
};
|
|
208
139
|
}
|
|
209
140
|
});
|
|
210
|
-
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
const animation = "";
|
|
214
|
-
const theme = "";
|
|
215
|
-
const style$5 = "";
|
|
216
|
-
Mask.install = (app) => {
|
|
217
|
-
const { name: name2 } = Mask;
|
|
218
|
-
app.component(name2, Mask);
|
|
141
|
+
I.install = (e) => {
|
|
142
|
+
const { name: t } = I;
|
|
143
|
+
e.component(t, I);
|
|
219
144
|
};
|
|
220
|
-
const [
|
|
221
|
-
const _props$2 = {
|
|
145
|
+
const [_e, Z, Ve] = w("popup"), Ae = {
|
|
222
146
|
// 控制显示
|
|
223
147
|
modelValue: {
|
|
224
148
|
type: Boolean,
|
|
225
|
-
default:
|
|
149
|
+
default: !1
|
|
226
150
|
},
|
|
227
151
|
// 位置
|
|
228
152
|
position: {
|
|
@@ -257,7 +181,7 @@ const _props$2 = {
|
|
|
257
181
|
// 点击遮罩是否关闭
|
|
258
182
|
isCloseOnClickMask: {
|
|
259
183
|
type: Boolean,
|
|
260
|
-
default:
|
|
184
|
+
default: !0
|
|
261
185
|
},
|
|
262
186
|
onAfterLeave: {
|
|
263
187
|
type: Function,
|
|
@@ -265,120 +189,107 @@ const _props$2 = {
|
|
|
265
189
|
},
|
|
266
190
|
lockScroll: {
|
|
267
191
|
type: Boolean,
|
|
268
|
-
default:
|
|
192
|
+
default: !0
|
|
269
193
|
},
|
|
270
194
|
zIndex: {
|
|
271
195
|
type: Number,
|
|
272
196
|
default: 101
|
|
273
197
|
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
props: _props$2,
|
|
198
|
+
}, L = /* @__PURE__ */ x({
|
|
199
|
+
name: _e,
|
|
200
|
+
props: Ae,
|
|
278
201
|
emits: ["clickMask", "update:modelValue"],
|
|
279
|
-
setup(
|
|
280
|
-
slots,
|
|
281
|
-
emit
|
|
202
|
+
setup(e, {
|
|
203
|
+
slots: t,
|
|
204
|
+
emit: l
|
|
282
205
|
}) {
|
|
283
|
-
const
|
|
206
|
+
const a = F(() => {
|
|
284
207
|
const {
|
|
285
|
-
position,
|
|
286
|
-
borderRadius,
|
|
287
|
-
customStyle,
|
|
288
|
-
duration
|
|
289
|
-
} =
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
switch (position) {
|
|
208
|
+
position: n,
|
|
209
|
+
borderRadius: i,
|
|
210
|
+
customStyle: p,
|
|
211
|
+
duration: g
|
|
212
|
+
} = e, c = m(i);
|
|
213
|
+
let d = "0";
|
|
214
|
+
switch (n) {
|
|
293
215
|
case "top":
|
|
294
|
-
|
|
216
|
+
d = ` 0 0 ${c} ${c}`;
|
|
295
217
|
break;
|
|
296
218
|
case "bottom":
|
|
297
|
-
|
|
219
|
+
d = `${c} ${c} 0 0`;
|
|
298
220
|
break;
|
|
299
221
|
case "left":
|
|
300
|
-
|
|
222
|
+
d = `0 ${c} ${c} 0`;
|
|
301
223
|
break;
|
|
302
224
|
case "right":
|
|
303
|
-
|
|
225
|
+
d = `${c} 0 0 ${c}`;
|
|
304
226
|
break;
|
|
305
227
|
default:
|
|
306
|
-
|
|
228
|
+
d = `${c}`;
|
|
307
229
|
}
|
|
308
230
|
return {
|
|
309
|
-
borderRadius:
|
|
310
|
-
animationDuration: `${
|
|
311
|
-
...
|
|
231
|
+
borderRadius: d,
|
|
232
|
+
animationDuration: `${g}ms`,
|
|
233
|
+
...p
|
|
312
234
|
};
|
|
313
|
-
})
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}
|
|
319
|
-
};
|
|
320
|
-
const visible = computed({
|
|
321
|
-
get: () => props.modelValue,
|
|
322
|
-
set: (value) => emit("update:modelValue", value)
|
|
235
|
+
}), s = (n) => {
|
|
236
|
+
l("clickMask", n), e.isCloseOnClickMask && (f.value = !1);
|
|
237
|
+
}, f = F({
|
|
238
|
+
get: () => e.modelValue,
|
|
239
|
+
set: (n) => l("update:modelValue", n)
|
|
323
240
|
});
|
|
324
241
|
return () => {
|
|
325
242
|
const {
|
|
326
|
-
teleport,
|
|
327
|
-
position,
|
|
328
|
-
customClass,
|
|
329
|
-
duration,
|
|
330
|
-
onAfterLeave,
|
|
331
|
-
lockScroll,
|
|
332
|
-
zIndex
|
|
333
|
-
} =
|
|
334
|
-
return
|
|
335
|
-
|
|
243
|
+
teleport: n,
|
|
244
|
+
position: i,
|
|
245
|
+
customClass: p,
|
|
246
|
+
duration: g,
|
|
247
|
+
onAfterLeave: c,
|
|
248
|
+
lockScroll: d,
|
|
249
|
+
zIndex: o
|
|
250
|
+
} = e;
|
|
251
|
+
return r(me, {
|
|
252
|
+
to: n
|
|
336
253
|
}, {
|
|
337
|
-
default: () => [
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
zIndex
|
|
254
|
+
default: () => [r("div", {
|
|
255
|
+
class: Z(),
|
|
256
|
+
style: {
|
|
257
|
+
zIndex: o
|
|
341
258
|
}
|
|
342
|
-
}, [
|
|
343
|
-
|
|
344
|
-
"onUpdate:modelValue": (
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
}, null),
|
|
350
|
-
|
|
259
|
+
}, [r(I, {
|
|
260
|
+
modelValue: f.value,
|
|
261
|
+
"onUpdate:modelValue": (u) => f.value = u,
|
|
262
|
+
duration: g,
|
|
263
|
+
lockScroll: d,
|
|
264
|
+
onClick: s,
|
|
265
|
+
onAfterLeave: c
|
|
266
|
+
}, null), r(te, {
|
|
267
|
+
name: Ve("animation", `slide-${i}`)
|
|
351
268
|
}, {
|
|
352
269
|
default: () => {
|
|
353
|
-
var
|
|
354
|
-
return [
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
[
|
|
358
|
-
}),
|
|
359
|
-
}, [((
|
|
270
|
+
var u;
|
|
271
|
+
return [P(r("div", {
|
|
272
|
+
style: a.value,
|
|
273
|
+
class: [Z("content", {
|
|
274
|
+
[i]: i
|
|
275
|
+
}), p]
|
|
276
|
+
}, [((u = t.default) == null ? void 0 : u.call(t)) || null]), [[ne, f.value]])];
|
|
360
277
|
}
|
|
361
278
|
})])]
|
|
362
279
|
});
|
|
363
280
|
};
|
|
364
281
|
}
|
|
365
282
|
});
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
app.component(name2, Popup);
|
|
283
|
+
L.install = (e) => {
|
|
284
|
+
const { name: t } = L;
|
|
285
|
+
e.component(t, L);
|
|
370
286
|
};
|
|
371
|
-
const [
|
|
372
|
-
|
|
373
|
-
const re = new RegExp(/\.(https|png|jpg|gif|jpeg|webp|apng)$/);
|
|
374
|
-
return re.test(name2.toLowerCase());
|
|
375
|
-
};
|
|
376
|
-
const Icon = /* @__PURE__ */ defineComponent({
|
|
377
|
-
name: cname,
|
|
287
|
+
const [ze, z] = w("icon"), Ie = (e) => new RegExp(/\.(https|png|jpg|gif|jpeg|webp|apng)$/).test(e.toLowerCase()), M = /* @__PURE__ */ x({
|
|
288
|
+
name: ze,
|
|
378
289
|
props: {
|
|
379
290
|
dot: {
|
|
380
291
|
type: Boolean,
|
|
381
|
-
default:
|
|
292
|
+
default: !1
|
|
382
293
|
},
|
|
383
294
|
name: {
|
|
384
295
|
type: String,
|
|
@@ -421,66 +332,62 @@ const Icon = /* @__PURE__ */ defineComponent({
|
|
|
421
332
|
}
|
|
422
333
|
},
|
|
423
334
|
emits: ["click"],
|
|
424
|
-
setup(
|
|
425
|
-
slots,
|
|
426
|
-
emit
|
|
335
|
+
setup(e, {
|
|
336
|
+
slots: t,
|
|
337
|
+
emit: l
|
|
427
338
|
}) {
|
|
428
|
-
const
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
const onClick = (event) => {
|
|
434
|
-
emit("click", event);
|
|
339
|
+
const a = Ie(e.name), s = () => ({
|
|
340
|
+
fontSize: m(e.size),
|
|
341
|
+
color: e.color
|
|
342
|
+
}), f = (n) => {
|
|
343
|
+
l("click", n);
|
|
435
344
|
};
|
|
436
345
|
return () => {
|
|
437
346
|
const {
|
|
438
|
-
name:
|
|
439
|
-
classPrefix,
|
|
440
|
-
badge,
|
|
441
|
-
dot,
|
|
442
|
-
subColor,
|
|
443
|
-
subBg,
|
|
444
|
-
tag:
|
|
445
|
-
} =
|
|
446
|
-
return
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
347
|
+
name: n,
|
|
348
|
+
classPrefix: i,
|
|
349
|
+
badge: p,
|
|
350
|
+
dot: g,
|
|
351
|
+
subColor: c,
|
|
352
|
+
subBg: d,
|
|
353
|
+
tag: o
|
|
354
|
+
} = e;
|
|
355
|
+
return r(o, {
|
|
356
|
+
class: `${i}${a ? "" : ` y-icon--${n}`}`,
|
|
357
|
+
style: s(),
|
|
358
|
+
onClick: f
|
|
450
359
|
}, {
|
|
451
360
|
default: () => {
|
|
452
|
-
var
|
|
453
|
-
return [
|
|
454
|
-
|
|
455
|
-
}, [
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
}, null)]) : null,
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
backgroundColor:
|
|
361
|
+
var u;
|
|
362
|
+
return [a ? r("em", {
|
|
363
|
+
class: z("node")
|
|
364
|
+
}, [r("img", {
|
|
365
|
+
class: z("image"),
|
|
366
|
+
src: n,
|
|
367
|
+
alt: "icon"
|
|
368
|
+
}, null)]) : null, g ? r("em", {
|
|
369
|
+
class: z("dot"),
|
|
370
|
+
style: {
|
|
371
|
+
backgroundColor: d
|
|
463
372
|
}
|
|
464
|
-
}, null) : null,
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
color:
|
|
468
|
-
backgroundColor:
|
|
373
|
+
}, null) : null, p ? r("em", {
|
|
374
|
+
class: z("badge"),
|
|
375
|
+
style: {
|
|
376
|
+
color: c,
|
|
377
|
+
backgroundColor: d
|
|
469
378
|
}
|
|
470
|
-
}, [
|
|
379
|
+
}, [p]) : null, ((u = t.default) == null ? void 0 : u.call(t)) || null];
|
|
471
380
|
}
|
|
472
381
|
});
|
|
473
382
|
};
|
|
474
383
|
}
|
|
475
384
|
});
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
app.component(name2, Icon);
|
|
385
|
+
M.install = (e) => {
|
|
386
|
+
const { name: t } = M;
|
|
387
|
+
e.component(t, M);
|
|
480
388
|
};
|
|
481
|
-
const [
|
|
482
|
-
|
|
483
|
-
name: name$2,
|
|
389
|
+
const [Le, B, Me] = w("button"), _ = /* @__PURE__ */ x({
|
|
390
|
+
name: Le,
|
|
484
391
|
props: {
|
|
485
392
|
// 标签
|
|
486
393
|
tag: {
|
|
@@ -505,7 +412,7 @@ const Button = /* @__PURE__ */ defineComponent({
|
|
|
505
412
|
// 不可以状态
|
|
506
413
|
disabled: {
|
|
507
414
|
type: Boolean,
|
|
508
|
-
default:
|
|
415
|
+
default: !1
|
|
509
416
|
},
|
|
510
417
|
// 阴影
|
|
511
418
|
shadow: {
|
|
@@ -515,12 +422,12 @@ const Button = /* @__PURE__ */ defineComponent({
|
|
|
515
422
|
// 方形
|
|
516
423
|
square: {
|
|
517
424
|
type: Boolean,
|
|
518
|
-
default:
|
|
425
|
+
default: !1
|
|
519
426
|
},
|
|
520
427
|
// 半圆弧
|
|
521
428
|
semicircle: {
|
|
522
429
|
type: Boolean,
|
|
523
|
-
default:
|
|
430
|
+
default: !1
|
|
524
431
|
},
|
|
525
432
|
// 自定义圆角
|
|
526
433
|
radius: {
|
|
@@ -535,77 +442,73 @@ const Button = /* @__PURE__ */ defineComponent({
|
|
|
535
442
|
// block 自动填满父布局
|
|
536
443
|
block: {
|
|
537
444
|
type: Boolean,
|
|
538
|
-
default:
|
|
445
|
+
default: !1
|
|
539
446
|
},
|
|
540
447
|
// 危险按钮状态
|
|
541
448
|
danger: {
|
|
542
449
|
type: Boolean,
|
|
543
|
-
default:
|
|
450
|
+
default: !1
|
|
544
451
|
}
|
|
545
452
|
},
|
|
546
453
|
emits: ["click"],
|
|
547
|
-
setup(
|
|
548
|
-
slots,
|
|
549
|
-
emit
|
|
454
|
+
setup(e, {
|
|
455
|
+
slots: t,
|
|
456
|
+
emit: l
|
|
550
457
|
}) {
|
|
551
|
-
const
|
|
552
|
-
|
|
458
|
+
const a = (s) => {
|
|
459
|
+
l("click", s);
|
|
553
460
|
};
|
|
554
461
|
return () => {
|
|
555
462
|
let {
|
|
556
|
-
tag:
|
|
557
|
-
} =
|
|
463
|
+
tag: s
|
|
464
|
+
} = e;
|
|
558
465
|
const {
|
|
559
|
-
radius,
|
|
560
|
-
type,
|
|
561
|
-
size,
|
|
562
|
-
disabled,
|
|
563
|
-
shadow,
|
|
564
|
-
block,
|
|
565
|
-
square,
|
|
566
|
-
semicircle,
|
|
567
|
-
danger,
|
|
568
|
-
text,
|
|
569
|
-
supplementText
|
|
570
|
-
} =
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
"style": {
|
|
581
|
-
borderRadius: parseUnit(radius)
|
|
466
|
+
radius: f,
|
|
467
|
+
type: n,
|
|
468
|
+
size: i,
|
|
469
|
+
disabled: p,
|
|
470
|
+
shadow: g,
|
|
471
|
+
block: c,
|
|
472
|
+
square: d,
|
|
473
|
+
semicircle: o,
|
|
474
|
+
danger: u,
|
|
475
|
+
text: b,
|
|
476
|
+
supplementText: y
|
|
477
|
+
} = e, $ = t.default ? t.default() : b;
|
|
478
|
+
return s = n === "link" ? "a" : s, r(s, {
|
|
479
|
+
class: [B([n, i, {
|
|
480
|
+
block: c,
|
|
481
|
+
square: d,
|
|
482
|
+
semicircle: o,
|
|
483
|
+
disabled: p && s === "a"
|
|
484
|
+
}, (n === "primary" || n === "secondary") && g ? `shadow_${g}` : "", u ? `${n}_danger` : "", p ? `${n}_disabled` : ""]), Me("el", "clickable")],
|
|
485
|
+
style: {
|
|
486
|
+
borderRadius: m(f)
|
|
582
487
|
},
|
|
583
|
-
|
|
584
|
-
|
|
488
|
+
disabled: p,
|
|
489
|
+
onClick: a
|
|
585
490
|
}, {
|
|
586
491
|
default: () => {
|
|
587
|
-
var
|
|
588
|
-
return [
|
|
589
|
-
|
|
590
|
-
}, [((
|
|
591
|
-
|
|
592
|
-
}, [
|
|
593
|
-
|
|
594
|
-
}, [
|
|
595
|
-
|
|
596
|
-
}, [
|
|
492
|
+
var h, V;
|
|
493
|
+
return [r("div", {
|
|
494
|
+
class: B("content")
|
|
495
|
+
}, [((h = t.leftIcon) == null ? void 0 : h.call(t)) || null, $ && r(ge, null, [y ? r("div", {
|
|
496
|
+
class: B("text")
|
|
497
|
+
}, [r("p", null, [$]), r("p", {
|
|
498
|
+
class: B("subtext")
|
|
499
|
+
}, [y])]) : r("span", {
|
|
500
|
+
class: B("text")
|
|
501
|
+
}, [$])]), ((V = t.rightIcon) == null ? void 0 : V.call(t)) || null])];
|
|
597
502
|
}
|
|
598
503
|
});
|
|
599
504
|
};
|
|
600
505
|
}
|
|
601
506
|
});
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
app.component(name2, Button);
|
|
507
|
+
_.install = (e) => {
|
|
508
|
+
const { name: t } = _;
|
|
509
|
+
e.component(t, _);
|
|
606
510
|
};
|
|
607
|
-
const [
|
|
608
|
-
const _props$1 = {
|
|
511
|
+
const [Re, C] = w("loading"), Oe = {
|
|
609
512
|
// Loading icon 的颜色
|
|
610
513
|
color: {
|
|
611
514
|
type: String,
|
|
@@ -664,107 +567,97 @@ const _props$1 = {
|
|
|
664
567
|
type: String,
|
|
665
568
|
default: "relative"
|
|
666
569
|
}
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
slots
|
|
570
|
+
}, R = /* @__PURE__ */ x({
|
|
571
|
+
name: Re,
|
|
572
|
+
props: Oe,
|
|
573
|
+
setup(e, {
|
|
574
|
+
slots: t
|
|
673
575
|
}) {
|
|
674
576
|
return () => {
|
|
675
|
-
var
|
|
577
|
+
var y, $;
|
|
676
578
|
const {
|
|
677
|
-
position,
|
|
678
|
-
textLocation,
|
|
679
|
-
bgColor,
|
|
680
|
-
bgBorderRadius,
|
|
681
|
-
size,
|
|
682
|
-
padding,
|
|
683
|
-
color,
|
|
684
|
-
thick,
|
|
685
|
-
direction,
|
|
686
|
-
text,
|
|
687
|
-
textColor,
|
|
688
|
-
textSize
|
|
689
|
-
} =
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
[position]: position !== "relative"
|
|
579
|
+
position: l,
|
|
580
|
+
textLocation: a,
|
|
581
|
+
bgColor: s,
|
|
582
|
+
bgBorderRadius: f,
|
|
583
|
+
size: n,
|
|
584
|
+
padding: i,
|
|
585
|
+
color: p,
|
|
586
|
+
thick: g,
|
|
587
|
+
direction: c,
|
|
588
|
+
text: d,
|
|
589
|
+
textColor: o,
|
|
590
|
+
textSize: u
|
|
591
|
+
} = e, b = ((y = t.default) == null ? void 0 : y.call(t)) || d;
|
|
592
|
+
return r("div", {
|
|
593
|
+
class: C({
|
|
594
|
+
[l]: l !== "relative"
|
|
694
595
|
})
|
|
695
|
-
}, [
|
|
696
|
-
|
|
697
|
-
[
|
|
596
|
+
}, [r("div", {
|
|
597
|
+
class: C("bg", {
|
|
598
|
+
[l]: l !== "relative"
|
|
698
599
|
}),
|
|
699
|
-
|
|
700
|
-
flexDirection:
|
|
701
|
-
backgroundColor:
|
|
702
|
-
borderRadius:
|
|
703
|
-
padding:
|
|
600
|
+
style: {
|
|
601
|
+
flexDirection: Ce(a),
|
|
602
|
+
backgroundColor: s,
|
|
603
|
+
borderRadius: m(f),
|
|
604
|
+
padding: m(i)
|
|
704
605
|
}
|
|
705
|
-
}, [
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
width:
|
|
709
|
-
height:
|
|
606
|
+
}, [r("span", {
|
|
607
|
+
class: C("icon-wrapper"),
|
|
608
|
+
style: {
|
|
609
|
+
width: m(n),
|
|
610
|
+
height: m(n)
|
|
710
611
|
}
|
|
711
|
-
}, [((
|
|
712
|
-
|
|
713
|
-
[
|
|
612
|
+
}, [(($ = t.icon) == null ? void 0 : $.call(t)) || r("svg", {
|
|
613
|
+
class: C("icon", {
|
|
614
|
+
[c]: c
|
|
714
615
|
}),
|
|
715
|
-
|
|
716
|
-
}, [
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
stroke:
|
|
720
|
-
strokeWidth:
|
|
616
|
+
viewBox: "25 25 50 50"
|
|
617
|
+
}, [r("circle", {
|
|
618
|
+
class: C("icon-circle"),
|
|
619
|
+
style: {
|
|
620
|
+
stroke: p,
|
|
621
|
+
strokeWidth: m(g)
|
|
721
622
|
},
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
}, null)])]),
|
|
727
|
-
|
|
728
|
-
[
|
|
623
|
+
cx: "50",
|
|
624
|
+
cy: "50",
|
|
625
|
+
r: "20",
|
|
626
|
+
fill: "none"
|
|
627
|
+
}, null)])]), b && r("span", {
|
|
628
|
+
class: C("text", {
|
|
629
|
+
[a]: a
|
|
729
630
|
}),
|
|
730
|
-
|
|
731
|
-
color:
|
|
732
|
-
fontSize:
|
|
631
|
+
style: {
|
|
632
|
+
color: o,
|
|
633
|
+
fontSize: m(u)
|
|
733
634
|
}
|
|
734
|
-
}, [
|
|
635
|
+
}, [b])])]);
|
|
735
636
|
};
|
|
736
637
|
}
|
|
737
|
-
})
|
|
738
|
-
const globalOptions = {
|
|
638
|
+
}), Pe = {
|
|
739
639
|
position: "fixed"
|
|
740
640
|
};
|
|
741
|
-
let
|
|
742
|
-
const
|
|
743
|
-
const
|
|
744
|
-
render: () => {
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
const customApp = createApp(wrapper);
|
|
749
|
-
const element = document.createElement("div");
|
|
750
|
-
return customApp.mount(element);
|
|
751
|
-
};
|
|
752
|
-
const createLoading = {
|
|
641
|
+
let N = null;
|
|
642
|
+
const ae = (e, t) => {
|
|
643
|
+
const a = q({
|
|
644
|
+
render: () => le(R, { ...e }, { ...t })
|
|
645
|
+
}), s = document.createElement("div");
|
|
646
|
+
return a.mount(s);
|
|
647
|
+
}, De = {
|
|
753
648
|
/**
|
|
754
649
|
* @description: show
|
|
755
650
|
* @param {LoadingPropsType} options
|
|
756
651
|
* @return {*}
|
|
757
652
|
*/
|
|
758
|
-
show: (
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
);
|
|
767
|
-
document.body.appendChild(instance.$el);
|
|
653
|
+
show: (e, t) => {
|
|
654
|
+
N || (N = ae(
|
|
655
|
+
{
|
|
656
|
+
...Pe,
|
|
657
|
+
...e
|
|
658
|
+
},
|
|
659
|
+
t
|
|
660
|
+
)), document.body.appendChild(N.$el);
|
|
768
661
|
},
|
|
769
662
|
/**
|
|
770
663
|
* @description: hide
|
|
@@ -772,73 +665,47 @@ const createLoading = {
|
|
|
772
665
|
* @return {*}
|
|
773
666
|
*/
|
|
774
667
|
hide: () => {
|
|
775
|
-
|
|
668
|
+
N && N.$el.remove();
|
|
776
669
|
}
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
} else {
|
|
783
|
-
el.classList.remove("y-loading__wrap");
|
|
784
|
-
el.removeChild(el.instance.$el);
|
|
670
|
+
}, ee = (e, t) => {
|
|
671
|
+
t.value ? (e.classList.add("y-loading__wrap"), e.appendChild(e.instance.$el)) : (e.classList.remove("y-loading__wrap"), e.removeChild(e.instance.$el));
|
|
672
|
+
}, Te = {
|
|
673
|
+
install: (e) => {
|
|
674
|
+
e.directive("loading", re), e.directive("loading-props", je), e.directive("loading-slots", Fe);
|
|
785
675
|
}
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
app.directive("loading-props", directiveProps);
|
|
791
|
-
app.directive("loading-slots", directiveSlots);
|
|
792
|
-
}
|
|
793
|
-
};
|
|
794
|
-
const directive = {
|
|
795
|
-
getSSRProps: (binding) => {
|
|
796
|
-
return { ...binding };
|
|
676
|
+
}, re = {
|
|
677
|
+
getSSRProps: (e) => ({ ...e }),
|
|
678
|
+
mounted: (e, t) => {
|
|
679
|
+
e.instance = ae({ ...e.customProps }, { ...e.customSlots }), t.value && ee(e, t);
|
|
797
680
|
},
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
binding.value && toggleLoading(el, binding);
|
|
801
|
-
},
|
|
802
|
-
updated: (el, binding) => {
|
|
803
|
-
if (binding.oldValue !== binding.value) {
|
|
804
|
-
toggleLoading(el, binding);
|
|
805
|
-
}
|
|
681
|
+
updated: (e, t) => {
|
|
682
|
+
t.oldValue !== t.value && ee(e, t);
|
|
806
683
|
},
|
|
807
|
-
unmounted: (
|
|
808
|
-
|
|
684
|
+
unmounted: (e) => {
|
|
685
|
+
e.instance && e.instance.$el.remove();
|
|
809
686
|
}
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
},
|
|
815
|
-
beforeMount: (el, binding) => {
|
|
816
|
-
el.customProps = { ...binding.value };
|
|
687
|
+
}, je = {
|
|
688
|
+
getSSRProps: (e) => ({ ...e }),
|
|
689
|
+
beforeMount: (e, t) => {
|
|
690
|
+
e.customProps = { ...t.value };
|
|
817
691
|
}
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
},
|
|
823
|
-
beforeMount: (el, binding) => {
|
|
824
|
-
el.customSlots = { ...binding.value };
|
|
692
|
+
}, Fe = {
|
|
693
|
+
getSSRProps: (e) => ({ ...e }),
|
|
694
|
+
beforeMount: (e, t) => {
|
|
695
|
+
e.customSlots = { ...t.value };
|
|
825
696
|
}
|
|
826
697
|
};
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
app.component(Loading.name, Loading);
|
|
830
|
-
app.provide("loading", createLoading);
|
|
831
|
-
app.use(loadingDirective);
|
|
698
|
+
R.install = (e) => {
|
|
699
|
+
e.component(R.name, R), e.provide("loading", De), e.use(Te);
|
|
832
700
|
};
|
|
833
|
-
function
|
|
834
|
-
return typeof
|
|
701
|
+
function Ee(e) {
|
|
702
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !be(e);
|
|
835
703
|
}
|
|
836
|
-
const [
|
|
837
|
-
const _props = {
|
|
704
|
+
const [Ue, v] = w("dialog"), qe = {
|
|
838
705
|
// 控制显示
|
|
839
706
|
modelValue: {
|
|
840
707
|
type: Boolean,
|
|
841
|
-
default:
|
|
708
|
+
default: !1
|
|
842
709
|
},
|
|
843
710
|
width: {
|
|
844
711
|
type: [Number, String],
|
|
@@ -862,15 +729,15 @@ const _props = {
|
|
|
862
729
|
},
|
|
863
730
|
isCloseOnClickMask: {
|
|
864
731
|
type: Boolean,
|
|
865
|
-
default:
|
|
732
|
+
default: !0
|
|
866
733
|
},
|
|
867
734
|
showCloseIcon: {
|
|
868
735
|
type: Boolean,
|
|
869
|
-
default:
|
|
736
|
+
default: !1
|
|
870
737
|
},
|
|
871
738
|
showCancelBtn: {
|
|
872
739
|
type: Boolean,
|
|
873
|
-
default:
|
|
740
|
+
default: !1
|
|
874
741
|
},
|
|
875
742
|
cancelButtonText: {
|
|
876
743
|
type: String,
|
|
@@ -878,7 +745,7 @@ const _props = {
|
|
|
878
745
|
},
|
|
879
746
|
showConfirmBtn: {
|
|
880
747
|
type: Boolean,
|
|
881
|
-
default:
|
|
748
|
+
default: !1
|
|
882
749
|
},
|
|
883
750
|
confirmButtonText: {
|
|
884
751
|
type: String,
|
|
@@ -898,226 +765,189 @@ const _props = {
|
|
|
898
765
|
},
|
|
899
766
|
circleImg: {
|
|
900
767
|
type: Boolean,
|
|
901
|
-
default:
|
|
768
|
+
default: !1
|
|
902
769
|
},
|
|
903
770
|
// 插入对象
|
|
904
771
|
teleport: {
|
|
905
772
|
type: String,
|
|
906
773
|
default: "body"
|
|
907
774
|
}
|
|
908
|
-
}
|
|
909
|
-
|
|
910
|
-
name,
|
|
775
|
+
}, O = /* @__PURE__ */ x({
|
|
776
|
+
name: Ue,
|
|
911
777
|
directives: {
|
|
912
|
-
loading:
|
|
778
|
+
loading: re
|
|
913
779
|
},
|
|
914
|
-
props:
|
|
780
|
+
props: qe,
|
|
915
781
|
emits: ["update:modelValue", "cancel", "confirm"],
|
|
916
|
-
setup(
|
|
917
|
-
emit,
|
|
918
|
-
slots
|
|
782
|
+
setup(e, {
|
|
783
|
+
emit: t,
|
|
784
|
+
slots: l
|
|
919
785
|
}) {
|
|
920
|
-
const
|
|
921
|
-
cancel:
|
|
922
|
-
confirm:
|
|
923
|
-
})
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
emit("cancel", event, onHandler("cancel"));
|
|
934
|
-
};
|
|
935
|
-
const onConfirm = (event) => {
|
|
936
|
-
emit("confirm", event, onHandler("confirm"));
|
|
937
|
-
};
|
|
938
|
-
const onHandler = (actionType) => {
|
|
786
|
+
const a = U({
|
|
787
|
+
cancel: !1,
|
|
788
|
+
confirm: !1
|
|
789
|
+
}), s = (o) => {
|
|
790
|
+
d.value = o;
|
|
791
|
+
}, f = (o) => {
|
|
792
|
+
var u;
|
|
793
|
+
s(!1), (u = e.callback) == null || u.call(e, o);
|
|
794
|
+
}, n = (o) => {
|
|
795
|
+
t("cancel", o, p("cancel"));
|
|
796
|
+
}, i = (o) => {
|
|
797
|
+
t("confirm", o, p("confirm"));
|
|
798
|
+
}, p = (o) => {
|
|
939
799
|
const {
|
|
940
|
-
modelValue,
|
|
941
|
-
beforeClose
|
|
942
|
-
} =
|
|
943
|
-
if (
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
}
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
const done = (value, actionType) => {
|
|
963
|
-
if (value) {
|
|
964
|
-
onClose(actionType);
|
|
965
|
-
loading[actionType] = false;
|
|
966
|
-
} else {
|
|
967
|
-
loading[actionType] = false;
|
|
968
|
-
}
|
|
969
|
-
};
|
|
970
|
-
const halfOfWidth = (val, multiple, processing) => {
|
|
971
|
-
let num2 = Number(val.substring(0, val.length - 2));
|
|
972
|
-
num2 /= multiple || 2;
|
|
973
|
-
return processing ? `${processing(num2)}px` : `${num2}px`;
|
|
974
|
-
};
|
|
975
|
-
const visible = computed({
|
|
976
|
-
get: () => props.modelValue,
|
|
977
|
-
set: (value) => emit("update:modelValue", value)
|
|
800
|
+
modelValue: u,
|
|
801
|
+
beforeClose: b
|
|
802
|
+
} = e;
|
|
803
|
+
if (u)
|
|
804
|
+
if (Se(b)) {
|
|
805
|
+
a[o] = !0;
|
|
806
|
+
const y = b(o);
|
|
807
|
+
ve(y) ? y.then((h) => {
|
|
808
|
+
g(h, o);
|
|
809
|
+
}).catch((h) => {
|
|
810
|
+
throw new Error(h);
|
|
811
|
+
}) : g(y, o);
|
|
812
|
+
} else
|
|
813
|
+
f(o);
|
|
814
|
+
}, g = (o, u) => {
|
|
815
|
+
o && f(u), a[u] = !1;
|
|
816
|
+
}, c = (o, u, b) => {
|
|
817
|
+
let y = Number(o.substring(0, o.length - 2));
|
|
818
|
+
return y /= u || 2, b ? `${b(y)}px` : `${y}px`;
|
|
819
|
+
}, d = F({
|
|
820
|
+
get: () => e.modelValue,
|
|
821
|
+
set: (o) => t("update:modelValue", o)
|
|
978
822
|
});
|
|
979
823
|
return () => {
|
|
980
824
|
const {
|
|
981
|
-
width,
|
|
982
|
-
title,
|
|
983
|
-
titleAlign,
|
|
984
|
-
message,
|
|
985
|
-
messageAlign
|
|
986
|
-
isCloseOnClickMask,
|
|
987
|
-
showCloseIcon,
|
|
988
|
-
showCancelBtn,
|
|
989
|
-
cancelButtonText,
|
|
990
|
-
showConfirmBtn,
|
|
991
|
-
confirmButtonText,
|
|
992
|
-
imgSrc,
|
|
993
|
-
circleImg,
|
|
994
|
-
teleport
|
|
995
|
-
} =
|
|
996
|
-
return
|
|
997
|
-
|
|
998
|
-
"onUpdate:modelValue": (
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
width:
|
|
825
|
+
width: o,
|
|
826
|
+
title: u,
|
|
827
|
+
titleAlign: b,
|
|
828
|
+
message: y,
|
|
829
|
+
messageAlign: $,
|
|
830
|
+
isCloseOnClickMask: h,
|
|
831
|
+
showCloseIcon: V,
|
|
832
|
+
showCancelBtn: W,
|
|
833
|
+
cancelButtonText: T,
|
|
834
|
+
showConfirmBtn: G,
|
|
835
|
+
confirmButtonText: ce,
|
|
836
|
+
imgSrc: H,
|
|
837
|
+
circleImg: k,
|
|
838
|
+
teleport: se
|
|
839
|
+
} = e;
|
|
840
|
+
return r(L, ye({
|
|
841
|
+
modelValue: d.value,
|
|
842
|
+
"onUpdate:modelValue": (A) => d.value = A,
|
|
843
|
+
customClass: v(),
|
|
844
|
+
customStyle: {
|
|
845
|
+
width: m(o)
|
|
1002
846
|
}
|
|
1003
847
|
}, {
|
|
1004
|
-
"onUpdate:modelValue":
|
|
848
|
+
"onUpdate:modelValue": s
|
|
1005
849
|
}, {
|
|
1006
|
-
|
|
1007
|
-
|
|
850
|
+
isCloseOnClickMask: h,
|
|
851
|
+
teleport: se
|
|
1008
852
|
}), {
|
|
1009
853
|
default: () => {
|
|
1010
|
-
var
|
|
1011
|
-
return [((
|
|
1012
|
-
|
|
1013
|
-
circle:
|
|
854
|
+
var A, J, K, Q;
|
|
855
|
+
return [((A = l.img) == null ? void 0 : A.call(l)) || H && r("div", {
|
|
856
|
+
class: v("img", {
|
|
857
|
+
circle: k
|
|
1014
858
|
}),
|
|
1015
|
-
|
|
1016
|
-
top:
|
|
1017
|
-
left:
|
|
859
|
+
style: {
|
|
860
|
+
top: k ? `-${c(m(o), 4)}` : "auto",
|
|
861
|
+
left: k ? `calc(50% - ${c(m(o), 4)})` : "auto"
|
|
1018
862
|
}
|
|
1019
|
-
}, [
|
|
1020
|
-
|
|
1021
|
-
width:
|
|
1022
|
-
height:
|
|
1023
|
-
background: `url(${
|
|
1024
|
-
borderRadius:
|
|
863
|
+
}, [r("div", {
|
|
864
|
+
style: {
|
|
865
|
+
width: k ? c(m(o)) : m(o),
|
|
866
|
+
height: c(m(o)),
|
|
867
|
+
background: `url(${H}) center`,
|
|
868
|
+
borderRadius: k ? "50%" : "20px 20px 0 0"
|
|
1025
869
|
}
|
|
1026
|
-
}, null)]),
|
|
1027
|
-
|
|
1028
|
-
}, [
|
|
1029
|
-
|
|
1030
|
-
height:
|
|
1031
|
-
return num2 + 20;
|
|
1032
|
-
}) : "24px"
|
|
870
|
+
}, null)]), r("div", {
|
|
871
|
+
class: v("container")
|
|
872
|
+
}, [r("div", {
|
|
873
|
+
style: {
|
|
874
|
+
height: k ? c(m(o), 4, (ue) => ue + 20) : "24px"
|
|
1033
875
|
}
|
|
1034
|
-
}, null), ((
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
textAlign:
|
|
876
|
+
}, null), ((J = l.title) == null ? void 0 : J.call(l)) || r("div", {
|
|
877
|
+
class: v("title"),
|
|
878
|
+
style: {
|
|
879
|
+
textAlign: b
|
|
1038
880
|
}
|
|
1039
|
-
}, [
|
|
1040
|
-
|
|
1041
|
-
}, [
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
textAlign:
|
|
881
|
+
}, [u]), r("div", {
|
|
882
|
+
class: v("content")
|
|
883
|
+
}, [r("div", {
|
|
884
|
+
class: v("message"),
|
|
885
|
+
style: {
|
|
886
|
+
textAlign: $
|
|
1045
887
|
}
|
|
1046
|
-
}, [((
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
paddingTop:
|
|
888
|
+
}, [((K = l.default) == null ? void 0 : K.call(l)) || y]), ((Q = l.footer) == null ? void 0 : Q.call(l)) || r("div", {
|
|
889
|
+
class: v("footer"),
|
|
890
|
+
style: {
|
|
891
|
+
paddingTop: W || G ? "20px" : "0px"
|
|
1050
892
|
}
|
|
1051
|
-
}, [
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
},
|
|
1056
|
-
default: () => [
|
|
1057
|
-
}), [[
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
893
|
+
}, [W && P(r(_, {
|
|
894
|
+
type: "secondary",
|
|
895
|
+
class: v("footer-btn"),
|
|
896
|
+
onClick: n
|
|
897
|
+
}, Ee(T) ? T : {
|
|
898
|
+
default: () => [T]
|
|
899
|
+
}), [[X("loading"), a.cancel]]), G && P(r(_, {
|
|
900
|
+
type: "primary",
|
|
901
|
+
class: v("footer-btn"),
|
|
902
|
+
onClick: i
|
|
1061
903
|
}, {
|
|
1062
|
-
default: () => [
|
|
1063
|
-
}), [[
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
}, [
|
|
1067
|
-
|
|
904
|
+
default: () => [a.confirm ? "" : ce]
|
|
905
|
+
}), [[X("loading"), a.confirm]])])]), V && r("div", {
|
|
906
|
+
class: v("close"),
|
|
907
|
+
onClick: () => f("close")
|
|
908
|
+
}, [r(M, {
|
|
909
|
+
name: "cross"
|
|
1068
910
|
}, null)])])];
|
|
1069
911
|
}
|
|
1070
912
|
});
|
|
1071
913
|
};
|
|
1072
914
|
}
|
|
1073
915
|
});
|
|
1074
|
-
let
|
|
1075
|
-
|
|
1076
|
-
const
|
|
1077
|
-
|
|
1078
|
-
const id = `dialog${num += 1}`;
|
|
1079
|
-
const wrapper = {
|
|
916
|
+
let j = q({}), We = 0;
|
|
917
|
+
const ie = [], Ge = (e, t) => {
|
|
918
|
+
const l = `dialog${We += 1}`;
|
|
919
|
+
j = q({
|
|
1080
920
|
setup() {
|
|
1081
|
-
const
|
|
1082
|
-
|
|
1083
|
-
show.value = val;
|
|
921
|
+
const f = E(!0), n = (i) => {
|
|
922
|
+
f.value = i;
|
|
1084
923
|
};
|
|
1085
|
-
return () =>
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
);
|
|
1098
|
-
};
|
|
1099
|
-
}
|
|
1100
|
-
};
|
|
1101
|
-
dialogApp = createApp(wrapper);
|
|
1102
|
-
const element = document.createElement("div");
|
|
1103
|
-
treasures.push({ id, app: dialogApp, el: element });
|
|
1104
|
-
dialogApp.mount(element);
|
|
1105
|
-
};
|
|
1106
|
-
const close = (id) => {
|
|
1107
|
-
treasures.forEach((obj) => {
|
|
1108
|
-
if (id === obj.id) {
|
|
1109
|
-
obj.app.unmount();
|
|
924
|
+
return () => le(
|
|
925
|
+
O,
|
|
926
|
+
{
|
|
927
|
+
modelValue: f.value,
|
|
928
|
+
"onUpdate:modelValue": n,
|
|
929
|
+
...e,
|
|
930
|
+
onAfterLeave: () => {
|
|
931
|
+
He(l);
|
|
932
|
+
}
|
|
933
|
+
},
|
|
934
|
+
{ ...t }
|
|
935
|
+
);
|
|
1110
936
|
}
|
|
1111
937
|
});
|
|
938
|
+
const s = document.createElement("div");
|
|
939
|
+
ie.push({ id: l, app: j, el: s }), j.mount(s);
|
|
940
|
+
}, He = (e) => {
|
|
941
|
+
ie.forEach((t) => {
|
|
942
|
+
e === t.id && t.app.unmount();
|
|
943
|
+
});
|
|
1112
944
|
};
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
app.component(name2, Dialog);
|
|
1117
|
-
app.provide("dialog", createDialog);
|
|
945
|
+
O.install = (e) => {
|
|
946
|
+
const { name: t } = O;
|
|
947
|
+
e.component(t, O), e.provide("dialog", Ge);
|
|
1118
948
|
};
|
|
1119
949
|
export {
|
|
1120
|
-
Dialog,
|
|
1121
|
-
createDialog,
|
|
1122
|
-
|
|
950
|
+
O as Dialog,
|
|
951
|
+
Ge as createDialog,
|
|
952
|
+
O as default
|
|
1123
953
|
};
|