y-design-ssr 1.0.0 → 1.1.1
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/cell/index.css +1 -1
- package/libs/cell/index.umd.js +1 -1
- package/libs/checkbox/index.mjs +1 -1
- package/libs/checkbox/index.umd.js +1 -1
- package/libs/checkboxGroup/index.mjs +2 -2
- package/libs/checkboxGroup/index.umd.js +1 -1
- package/libs/col/index.mjs +3 -3
- package/libs/col/index.umd.js +1 -1
- package/libs/context/relation/inject.d.ts +1 -1
- package/libs/context/relation/provide.d.ts +3 -3
- package/libs/dialog/index.css +1 -1
- package/libs/dialog/index.mjs +321 -287
- package/libs/dialog/index.umd.js +2 -2
- package/libs/dropdown/index.css +1 -0
- package/libs/dropdown/index.d.ts +68 -0
- package/libs/dropdown/index.mjs +215 -0
- package/libs/dropdown/index.umd.js +2 -0
- package/libs/dropdown/package.json +6 -0
- package/libs/dropdown/src/dropdown.d.ts +108 -0
- package/libs/dropdownItem/index.css +1 -0
- package/libs/dropdownItem/index.d.ts +50 -0
- package/libs/dropdownItem/index.mjs +645 -0
- package/libs/dropdownItem/index.umd.js +2 -0
- package/libs/dropdownItem/package.json +6 -0
- package/libs/dropdownItem/src/dropdown-item.d.ts +89 -0
- package/libs/form/index.mjs +3 -3
- package/libs/form/index.umd.js +1 -1
- package/libs/formItem/index.mjs +1 -1
- package/libs/formItem/index.umd.js +1 -1
- package/libs/index.css +1 -1
- package/libs/index.d.ts +3 -1
- package/libs/index.mjs +1919 -1608
- package/libs/index.umd.js +2 -2
- package/libs/layout/index.mjs +4 -4
- package/libs/layout/index.umd.js +1 -1
- package/libs/popup/index.css +1 -1
- package/libs/popup/index.d.ts +18 -0
- package/libs/popup/index.mjs +135 -101
- package/libs/popup/index.umd.js +2 -2
- package/libs/popup/src/popup.d.ts +18 -0
- package/libs/row/index.mjs +3 -3
- package/libs/row/index.umd.js +1 -1
- package/libs/swipe/index.mjs +3 -3
- package/libs/swipe/index.umd.js +1 -1
- package/libs/swipeItem/index.mjs +1 -1
- package/libs/swipeItem/index.umd.js +1 -1
- package/libs/tab/index.mjs +1 -1
- package/libs/tab/index.umd.js +1 -1
- package/libs/tabs/index.mjs +3 -3
- package/libs/tabs/index.umd.js +1 -1
- package/libs/utils/index.mjs +35 -34
- package/libs/utils/index.umd.js +1 -1
- package/libs/utils/types.d.ts +4 -0
- package/package.json +1 -1
package/libs/dialog/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
const
|
|
3
|
-
(
|
|
1
|
+
import { ref as D, reactive as P, defineComponent as x, onMounted as ie, onUnmounted as se, watch as de, createVNode as r, Transition as O, withDirectives as N, vShow as R, computed as j, Teleport as fe, Fragment as ee, createApp as T, h as te, mergeProps as pe, resolveDirective as H, isVNode as me } from "vue";
|
|
2
|
+
const ne = (e) => (t) => Object.prototype.toString.call(t) === `[object ${e}]`, ge = ne("Function"), ye = ne("Promise"), A = (e, t) => t ? typeof t == "string" ? ` ${e}--${t}` : Array.isArray(t) ? t.reduce((o, a) => o + A(e, a), "") : Object.keys(t).reduce(
|
|
3
|
+
(o, a) => o + (t[a] ? A(e, a) : ""),
|
|
4
4
|
""
|
|
5
|
-
) : "",
|
|
6
|
-
let a = t, u =
|
|
7
|
-
return a && typeof a != "string" && (u = a, a = ""), a = a ? `${e}__${a}` : e, `${a}${
|
|
8
|
-
},
|
|
5
|
+
) : "", be = (e) => (t, o) => {
|
|
6
|
+
let a = t, u = o;
|
|
7
|
+
return a && typeof a != "string" && (u = a, a = ""), a = a ? `${e}__${a}` : e, `${a}${A(a, u)}`;
|
|
8
|
+
}, Se = () => (e, t) => t ? `${A(`y-${e}`, t)}` : `y-${e}`, ve = {
|
|
9
9
|
"pull-refresh": {
|
|
10
10
|
pulling: "下拉刷新...",
|
|
11
11
|
loosing: "释放刷新...",
|
|
@@ -17,14 +17,14 @@ const Z = (e) => (t) => Object.prototype.toString.call(t) === `[object ${e}]`, p
|
|
|
17
17
|
validateMessage: "请输入正确内容"
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"zh-CN":
|
|
20
|
+
D("zh-CN");
|
|
21
|
+
P({
|
|
22
|
+
"zh-CN": ve
|
|
23
23
|
});
|
|
24
24
|
const w = (e) => {
|
|
25
25
|
const t = `y-${e}`;
|
|
26
|
-
return [t,
|
|
27
|
-
},
|
|
26
|
+
return [t, be(t), Se()];
|
|
27
|
+
}, y = (e) => isNaN(Number(e)) && typeof e == "string" ? e : `${e}px`, ke = (e) => {
|
|
28
28
|
switch (e) {
|
|
29
29
|
case "top":
|
|
30
30
|
return "column-reverse";
|
|
@@ -37,7 +37,7 @@ const w = (e) => {
|
|
|
37
37
|
default:
|
|
38
38
|
return "column";
|
|
39
39
|
}
|
|
40
|
-
}, [$e,
|
|
40
|
+
}, [$e, Ce, he] = w("mask"), xe = {
|
|
41
41
|
// 控制显示
|
|
42
42
|
modelValue: {
|
|
43
43
|
type: Boolean,
|
|
@@ -72,67 +72,67 @@ const w = (e) => {
|
|
|
72
72
|
type: Function,
|
|
73
73
|
default: null
|
|
74
74
|
}
|
|
75
|
-
}, S =
|
|
76
|
-
let
|
|
77
|
-
const
|
|
75
|
+
}, S = P([]);
|
|
76
|
+
let J = 0;
|
|
77
|
+
const we = /* @__PURE__ */ x({
|
|
78
78
|
name: $e,
|
|
79
|
-
props:
|
|
79
|
+
props: xe,
|
|
80
80
|
emits: ["update:modelValue"],
|
|
81
81
|
setup(e, {
|
|
82
82
|
slots: t
|
|
83
83
|
}) {
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}),
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
}),
|
|
91
|
-
a(
|
|
84
|
+
const o = D("");
|
|
85
|
+
ie(() => {
|
|
86
|
+
o.value = `mask${J}`, J += 1, a(e.modelValue, !0);
|
|
87
|
+
}), se(() => {
|
|
88
|
+
const l = S.findIndex((c) => c._id === o.value);
|
|
89
|
+
l >= 0 && S.splice(l, 1);
|
|
90
|
+
}), de(() => e.modelValue, (l) => {
|
|
91
|
+
a(l);
|
|
92
92
|
});
|
|
93
|
-
const a = (
|
|
94
|
-
|
|
95
|
-
_id:
|
|
96
|
-
_state:
|
|
93
|
+
const a = (l, c) => {
|
|
94
|
+
l ? (S.unshift({
|
|
95
|
+
_id: o.value,
|
|
96
|
+
_state: l
|
|
97
97
|
}), S.length > 1 && (S[1]._state = !1)) : c || (S.splice(0, 1), S.length > 0 && (S[0]._state = !0));
|
|
98
98
|
}, u = () => {
|
|
99
|
-
let
|
|
99
|
+
let l = !1;
|
|
100
100
|
for (let c = 0; c < S.length; c++)
|
|
101
|
-
S[c]._id ===
|
|
101
|
+
S[c]._id === o.value && (l = S[c]._state);
|
|
102
102
|
return {
|
|
103
|
-
_state:
|
|
103
|
+
_state: l
|
|
104
104
|
};
|
|
105
|
-
},
|
|
105
|
+
}, d = (l) => {
|
|
106
106
|
const {
|
|
107
107
|
lockScroll: c
|
|
108
108
|
} = e;
|
|
109
|
-
c && (
|
|
109
|
+
c && (l.preventDefault(), l.stopPropagation());
|
|
110
110
|
};
|
|
111
111
|
return () => {
|
|
112
112
|
const {
|
|
113
|
-
customClass:
|
|
113
|
+
customClass: l,
|
|
114
114
|
duration: c,
|
|
115
|
-
zIndex:
|
|
115
|
+
zIndex: m,
|
|
116
116
|
customStyle: g,
|
|
117
|
-
onAfterLeave:
|
|
117
|
+
onAfterLeave: p
|
|
118
118
|
} = e, {
|
|
119
|
-
_state:
|
|
119
|
+
_state: i
|
|
120
120
|
} = u();
|
|
121
|
-
return r(
|
|
121
|
+
return r(O, {
|
|
122
122
|
name: he("animation", "fade"),
|
|
123
|
-
onAfterLeave:
|
|
123
|
+
onAfterLeave: p
|
|
124
124
|
}, {
|
|
125
125
|
default: () => {
|
|
126
|
-
var
|
|
127
|
-
return [
|
|
126
|
+
var n;
|
|
127
|
+
return [N(r("div", {
|
|
128
128
|
style: {
|
|
129
129
|
animationDuration: `${c}ms`,
|
|
130
|
-
zIndex:
|
|
130
|
+
zIndex: m,
|
|
131
131
|
...g
|
|
132
132
|
},
|
|
133
|
-
class: [
|
|
134
|
-
onTouchmove:
|
|
135
|
-
}, [(
|
|
133
|
+
class: [Ce(), l],
|
|
134
|
+
onTouchmove: d
|
|
135
|
+
}, [(n = t.default) == null ? void 0 : n.call(t)]), [[R, i]])];
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
138
|
};
|
|
@@ -140,12 +140,12 @@ const Ce = /* @__PURE__ */ x({
|
|
|
140
140
|
});
|
|
141
141
|
function B(e) {
|
|
142
142
|
const t = e;
|
|
143
|
-
return t.install = (
|
|
143
|
+
return t.install = (o) => {
|
|
144
144
|
const { name: a } = e;
|
|
145
|
-
a &&
|
|
145
|
+
a && o.component(a, e);
|
|
146
146
|
}, t;
|
|
147
147
|
}
|
|
148
|
-
const
|
|
148
|
+
const K = B(we), [Be, Q, X] = w("popup"), _e = {
|
|
149
149
|
// 控制显示
|
|
150
150
|
modelValue: {
|
|
151
151
|
type: Boolean,
|
|
@@ -171,6 +171,16 @@ const xe = B(Ce), [we, H, Be] = w("popup"), _e = {
|
|
|
171
171
|
type: Object,
|
|
172
172
|
default: () => ({})
|
|
173
173
|
},
|
|
174
|
+
// 自定义类名
|
|
175
|
+
maskCustomClass: {
|
|
176
|
+
type: String,
|
|
177
|
+
default: ""
|
|
178
|
+
},
|
|
179
|
+
// 自定义属性
|
|
180
|
+
maskCustomStyle: {
|
|
181
|
+
type: Object,
|
|
182
|
+
default: () => ({})
|
|
183
|
+
},
|
|
174
184
|
// 插入对象
|
|
175
185
|
teleport: {
|
|
176
186
|
type: String,
|
|
@@ -196,95 +206,119 @@ const xe = B(Ce), [we, H, Be] = w("popup"), _e = {
|
|
|
196
206
|
},
|
|
197
207
|
zIndex: {
|
|
198
208
|
type: Number,
|
|
199
|
-
default:
|
|
209
|
+
default: 100
|
|
200
210
|
}
|
|
201
211
|
}, Ne = /* @__PURE__ */ x({
|
|
202
|
-
name:
|
|
212
|
+
name: Be,
|
|
203
213
|
props: _e,
|
|
204
214
|
emits: ["clickMask", "update:modelValue"],
|
|
205
215
|
setup(e, {
|
|
206
216
|
slots: t,
|
|
207
|
-
emit:
|
|
217
|
+
emit: o
|
|
208
218
|
}) {
|
|
209
|
-
const a =
|
|
219
|
+
const a = j(() => {
|
|
210
220
|
const {
|
|
211
|
-
position:
|
|
221
|
+
position: l,
|
|
212
222
|
borderRadius: c,
|
|
213
|
-
customStyle:
|
|
214
|
-
duration: g
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
223
|
+
customStyle: m,
|
|
224
|
+
duration: g,
|
|
225
|
+
zIndex: p
|
|
226
|
+
} = e, i = y(c);
|
|
227
|
+
let n = "0";
|
|
228
|
+
switch (l) {
|
|
218
229
|
case "top":
|
|
219
|
-
|
|
230
|
+
n = ` 0 0 ${i} ${i}`;
|
|
220
231
|
break;
|
|
221
232
|
case "bottom":
|
|
222
|
-
|
|
233
|
+
n = `${i} ${i} 0 0`;
|
|
223
234
|
break;
|
|
224
235
|
case "left":
|
|
225
|
-
|
|
236
|
+
n = `0 ${i} ${i} 0`;
|
|
226
237
|
break;
|
|
227
238
|
case "right":
|
|
228
|
-
|
|
239
|
+
n = `${i} 0 0 ${i}`;
|
|
229
240
|
break;
|
|
230
241
|
default:
|
|
231
|
-
|
|
242
|
+
n = `${i}`;
|
|
232
243
|
}
|
|
233
244
|
return {
|
|
234
|
-
borderRadius:
|
|
245
|
+
borderRadius: n,
|
|
235
246
|
animationDuration: `${g}ms`,
|
|
236
|
-
...
|
|
247
|
+
...m,
|
|
248
|
+
zIndex: p + 1
|
|
237
249
|
};
|
|
238
|
-
}), u = (
|
|
239
|
-
|
|
240
|
-
},
|
|
250
|
+
}), u = (l) => {
|
|
251
|
+
o("clickMask", l), e.isCloseOnClickMask && (d.value = !1);
|
|
252
|
+
}, d = j({
|
|
241
253
|
get: () => e.modelValue,
|
|
242
|
-
set: (
|
|
254
|
+
set: (l) => o("update:modelValue", l)
|
|
243
255
|
});
|
|
244
256
|
return () => {
|
|
245
257
|
const {
|
|
246
|
-
teleport:
|
|
258
|
+
teleport: l,
|
|
247
259
|
position: c,
|
|
248
|
-
customClass:
|
|
260
|
+
customClass: m,
|
|
249
261
|
duration: g,
|
|
250
|
-
onAfterLeave:
|
|
251
|
-
lockScroll:
|
|
252
|
-
zIndex:
|
|
262
|
+
onAfterLeave: p,
|
|
263
|
+
lockScroll: i,
|
|
264
|
+
zIndex: n,
|
|
265
|
+
maskCustomClass: f,
|
|
266
|
+
maskCustomStyle: b
|
|
253
267
|
} = e;
|
|
254
|
-
return r(
|
|
255
|
-
to:
|
|
268
|
+
return l ? r(fe, {
|
|
269
|
+
to: l
|
|
256
270
|
}, {
|
|
257
|
-
default: () => [r(
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
zIndex: o
|
|
261
|
-
}
|
|
262
|
-
}, [r(xe, {
|
|
263
|
-
modelValue: f.value,
|
|
264
|
-
"onUpdate:modelValue": (s) => f.value = s,
|
|
271
|
+
default: () => [r(K, {
|
|
272
|
+
modelValue: d.value,
|
|
273
|
+
"onUpdate:modelValue": (s) => d.value = s,
|
|
265
274
|
duration: g,
|
|
266
|
-
lockScroll:
|
|
275
|
+
lockScroll: i,
|
|
267
276
|
onClick: u,
|
|
268
|
-
onAfterLeave:
|
|
269
|
-
|
|
270
|
-
|
|
277
|
+
onAfterLeave: p,
|
|
278
|
+
zIndex: n,
|
|
279
|
+
customClass: f,
|
|
280
|
+
customStyle: b
|
|
281
|
+
}, null), r(O, {
|
|
282
|
+
name: X("animation", `slide-${c}`)
|
|
271
283
|
}, {
|
|
272
284
|
default: () => {
|
|
273
285
|
var s;
|
|
274
|
-
return [
|
|
286
|
+
return [N(r("div", {
|
|
275
287
|
style: a.value,
|
|
276
|
-
class: [
|
|
288
|
+
class: [Q("content", {
|
|
277
289
|
[c]: c
|
|
278
|
-
}),
|
|
279
|
-
}, [((s = t.default) == null ? void 0 : s.call(t)) || null]), [[
|
|
290
|
+
}), m]
|
|
291
|
+
}, [((s = t.default) == null ? void 0 : s.call(t)) || null]), [[R, d.value]])];
|
|
280
292
|
}
|
|
281
|
-
})]
|
|
282
|
-
})
|
|
293
|
+
})]
|
|
294
|
+
}) : r(ee, null, [r(K, {
|
|
295
|
+
modelValue: d.value,
|
|
296
|
+
"onUpdate:modelValue": (s) => d.value = s,
|
|
297
|
+
duration: g,
|
|
298
|
+
lockScroll: i,
|
|
299
|
+
onClick: u,
|
|
300
|
+
onAfterLeave: p,
|
|
301
|
+
zIndex: n,
|
|
302
|
+
customClass: f,
|
|
303
|
+
customStyle: b
|
|
304
|
+
}, null), r(O, {
|
|
305
|
+
name: X("animation", `slide-${c}`)
|
|
306
|
+
}, {
|
|
307
|
+
default: () => {
|
|
308
|
+
var s;
|
|
309
|
+
return [N(r("div", {
|
|
310
|
+
style: a.value,
|
|
311
|
+
class: [Q("content", {
|
|
312
|
+
[c]: c
|
|
313
|
+
}), m]
|
|
314
|
+
}, [((s = t.default) == null ? void 0 : s.call(t)) || null]), [[R, d.value]])];
|
|
315
|
+
}
|
|
316
|
+
})]);
|
|
283
317
|
};
|
|
284
318
|
}
|
|
285
319
|
});
|
|
286
|
-
const Ve = B(Ne), [
|
|
287
|
-
name:
|
|
320
|
+
const Ve = B(Ne), [Ie, z] = w("icon"), ze = (e) => new RegExp(/\.(https|png|jpg|gif|jpeg|webp|apng)$/).test(e.toLowerCase()), Ae = /* @__PURE__ */ x({
|
|
321
|
+
name: Ie,
|
|
288
322
|
props: {
|
|
289
323
|
dot: {
|
|
290
324
|
type: Boolean,
|
|
@@ -333,55 +367,55 @@ const Ve = B(Ne), [Ae, A] = w("icon"), Ie = (e) => new RegExp(/\.(https|png|jpg|
|
|
|
333
367
|
emits: ["click"],
|
|
334
368
|
setup(e, {
|
|
335
369
|
slots: t,
|
|
336
|
-
emit:
|
|
370
|
+
emit: o
|
|
337
371
|
}) {
|
|
338
|
-
const a =
|
|
339
|
-
fontSize:
|
|
372
|
+
const a = ze(e.name), u = () => ({
|
|
373
|
+
fontSize: y(e.size),
|
|
340
374
|
color: e.color
|
|
341
|
-
}),
|
|
342
|
-
|
|
375
|
+
}), d = (l) => {
|
|
376
|
+
o("click", l);
|
|
343
377
|
};
|
|
344
378
|
return () => {
|
|
345
379
|
const {
|
|
346
|
-
name:
|
|
380
|
+
name: l,
|
|
347
381
|
classPrefix: c,
|
|
348
|
-
badge:
|
|
382
|
+
badge: m,
|
|
349
383
|
dot: g,
|
|
350
|
-
subColor:
|
|
351
|
-
subBg:
|
|
352
|
-
tag:
|
|
384
|
+
subColor: p,
|
|
385
|
+
subBg: i,
|
|
386
|
+
tag: n
|
|
353
387
|
} = e;
|
|
354
|
-
return r(
|
|
355
|
-
class: `${c}${a ? "" : ` y-icon--${
|
|
388
|
+
return r(n, {
|
|
389
|
+
class: `${c}${a ? "" : ` y-icon--${l}`}`,
|
|
356
390
|
style: u(),
|
|
357
|
-
onClick:
|
|
391
|
+
onClick: d
|
|
358
392
|
}, {
|
|
359
393
|
default: () => {
|
|
360
|
-
var
|
|
394
|
+
var f;
|
|
361
395
|
return [a ? r("em", {
|
|
362
|
-
class:
|
|
396
|
+
class: z("node")
|
|
363
397
|
}, [r("img", {
|
|
364
|
-
class:
|
|
365
|
-
src:
|
|
398
|
+
class: z("image"),
|
|
399
|
+
src: l,
|
|
366
400
|
alt: "icon"
|
|
367
401
|
}, null)]) : null, g ? r("em", {
|
|
368
|
-
class:
|
|
402
|
+
class: z("dot"),
|
|
369
403
|
style: {
|
|
370
|
-
backgroundColor:
|
|
404
|
+
backgroundColor: i
|
|
371
405
|
}
|
|
372
|
-
}, null) : null,
|
|
373
|
-
class:
|
|
406
|
+
}, null) : null, m ? r("em", {
|
|
407
|
+
class: z("badge"),
|
|
374
408
|
style: {
|
|
375
|
-
color:
|
|
376
|
-
backgroundColor:
|
|
409
|
+
color: p,
|
|
410
|
+
backgroundColor: i
|
|
377
411
|
}
|
|
378
|
-
}, [
|
|
412
|
+
}, [m]) : null, ((f = t.default) == null ? void 0 : f.call(t)) || null];
|
|
379
413
|
}
|
|
380
414
|
});
|
|
381
415
|
};
|
|
382
416
|
}
|
|
383
417
|
});
|
|
384
|
-
const Le = B(
|
|
418
|
+
const Le = B(Ae), [Me, _, Oe] = w("button"), Re = /* @__PURE__ */ x({
|
|
385
419
|
name: Me,
|
|
386
420
|
props: {
|
|
387
421
|
// 标签
|
|
@@ -448,58 +482,58 @@ const Le = B(ze), [Me, _, Oe] = w("button"), Re = /* @__PURE__ */ x({
|
|
|
448
482
|
emits: ["click"],
|
|
449
483
|
setup(e, {
|
|
450
484
|
slots: t,
|
|
451
|
-
emit:
|
|
485
|
+
emit: o
|
|
452
486
|
}) {
|
|
453
487
|
const a = (u) => {
|
|
454
|
-
|
|
488
|
+
o("click", u);
|
|
455
489
|
};
|
|
456
490
|
return () => {
|
|
457
491
|
let {
|
|
458
492
|
tag: u
|
|
459
493
|
} = e;
|
|
460
494
|
const {
|
|
461
|
-
radius:
|
|
462
|
-
type:
|
|
495
|
+
radius: d,
|
|
496
|
+
type: l,
|
|
463
497
|
size: c,
|
|
464
|
-
disabled:
|
|
498
|
+
disabled: m,
|
|
465
499
|
shadow: g,
|
|
466
|
-
block:
|
|
467
|
-
square:
|
|
468
|
-
semicircle:
|
|
469
|
-
danger:
|
|
500
|
+
block: p,
|
|
501
|
+
square: i,
|
|
502
|
+
semicircle: n,
|
|
503
|
+
danger: f,
|
|
470
504
|
text: b,
|
|
471
|
-
supplementText:
|
|
472
|
-
} = e,
|
|
473
|
-
return u =
|
|
474
|
-
class: [_([
|
|
475
|
-
block:
|
|
476
|
-
square:
|
|
477
|
-
semicircle:
|
|
478
|
-
disabled:
|
|
479
|
-
}, (
|
|
505
|
+
supplementText: s
|
|
506
|
+
} = e, k = t.default ? t.default() : b;
|
|
507
|
+
return u = l === "link" ? "a" : u, r(u, {
|
|
508
|
+
class: [_([l, c, {
|
|
509
|
+
block: p,
|
|
510
|
+
square: i,
|
|
511
|
+
semicircle: n,
|
|
512
|
+
disabled: m && u === "a"
|
|
513
|
+
}, (l === "primary" || l === "secondary") && g ? `shadow_${g}` : "", f ? `${l}_danger` : "", m ? `${l}_disabled` : ""]), Oe("el", "clickable")],
|
|
480
514
|
style: {
|
|
481
|
-
borderRadius:
|
|
515
|
+
borderRadius: y(d)
|
|
482
516
|
},
|
|
483
|
-
disabled:
|
|
517
|
+
disabled: m,
|
|
484
518
|
onClick: a
|
|
485
519
|
}, {
|
|
486
520
|
default: () => {
|
|
487
|
-
var
|
|
521
|
+
var $, V;
|
|
488
522
|
return [r("div", {
|
|
489
523
|
class: _("content")
|
|
490
|
-
}, [((
|
|
524
|
+
}, [(($ = t.leftIcon) == null ? void 0 : $.call(t)) || null, k && r(ee, null, [s ? r("div", {
|
|
491
525
|
class: _("text")
|
|
492
|
-
}, [r("p", null, [
|
|
526
|
+
}, [r("p", null, [k]), r("p", {
|
|
493
527
|
class: _("subtext")
|
|
494
|
-
}, [
|
|
528
|
+
}, [s])]) : r("span", {
|
|
495
529
|
class: _("text")
|
|
496
|
-
}, [
|
|
530
|
+
}, [k])]), ((V = t.rightIcon) == null ? void 0 : V.call(t)) || null])];
|
|
497
531
|
}
|
|
498
532
|
});
|
|
499
533
|
};
|
|
500
534
|
}
|
|
501
535
|
});
|
|
502
|
-
const
|
|
536
|
+
const Y = B(Re), [je, h] = w("loading"), De = {
|
|
503
537
|
// Loading icon 的颜色
|
|
504
538
|
color: {
|
|
505
539
|
type: String,
|
|
@@ -558,98 +592,98 @@ const J = B(Re), [De, C] = w("loading"), Pe = {
|
|
|
558
592
|
type: String,
|
|
559
593
|
default: "relative"
|
|
560
594
|
}
|
|
561
|
-
},
|
|
562
|
-
name:
|
|
563
|
-
props:
|
|
595
|
+
}, le = /* @__PURE__ */ x({
|
|
596
|
+
name: je,
|
|
597
|
+
props: De,
|
|
564
598
|
setup(e, {
|
|
565
599
|
slots: t
|
|
566
600
|
}) {
|
|
567
601
|
return () => {
|
|
568
|
-
var
|
|
602
|
+
var s, k;
|
|
569
603
|
const {
|
|
570
|
-
position:
|
|
604
|
+
position: o,
|
|
571
605
|
textLocation: a,
|
|
572
606
|
bgColor: u,
|
|
573
|
-
bgBorderRadius:
|
|
574
|
-
size:
|
|
607
|
+
bgBorderRadius: d,
|
|
608
|
+
size: l,
|
|
575
609
|
padding: c,
|
|
576
|
-
color:
|
|
610
|
+
color: m,
|
|
577
611
|
thick: g,
|
|
578
|
-
direction:
|
|
579
|
-
text:
|
|
580
|
-
textColor:
|
|
581
|
-
textSize:
|
|
582
|
-
} = e, b = ((
|
|
612
|
+
direction: p,
|
|
613
|
+
text: i,
|
|
614
|
+
textColor: n,
|
|
615
|
+
textSize: f
|
|
616
|
+
} = e, b = ((s = t.default) == null ? void 0 : s.call(t)) || i;
|
|
583
617
|
return r("div", {
|
|
584
|
-
class:
|
|
585
|
-
[
|
|
618
|
+
class: h({
|
|
619
|
+
[o]: o !== "relative"
|
|
586
620
|
})
|
|
587
621
|
}, [r("div", {
|
|
588
|
-
class:
|
|
589
|
-
[
|
|
622
|
+
class: h("bg", {
|
|
623
|
+
[o]: o !== "relative"
|
|
590
624
|
}),
|
|
591
625
|
style: {
|
|
592
|
-
flexDirection:
|
|
626
|
+
flexDirection: ke(a),
|
|
593
627
|
backgroundColor: u,
|
|
594
|
-
borderRadius:
|
|
595
|
-
padding:
|
|
628
|
+
borderRadius: y(d),
|
|
629
|
+
padding: y(c)
|
|
596
630
|
}
|
|
597
631
|
}, [r("span", {
|
|
598
|
-
class:
|
|
632
|
+
class: h("icon-wrapper"),
|
|
599
633
|
style: {
|
|
600
|
-
width:
|
|
601
|
-
height:
|
|
634
|
+
width: y(l),
|
|
635
|
+
height: y(l)
|
|
602
636
|
}
|
|
603
|
-
}, [((
|
|
604
|
-
class:
|
|
605
|
-
[
|
|
637
|
+
}, [((k = t.icon) == null ? void 0 : k.call(t)) || r("svg", {
|
|
638
|
+
class: h("icon", {
|
|
639
|
+
[p]: p
|
|
606
640
|
}),
|
|
607
641
|
viewBox: "25 25 50 50"
|
|
608
642
|
}, [r("circle", {
|
|
609
|
-
class:
|
|
643
|
+
class: h("icon-circle"),
|
|
610
644
|
style: {
|
|
611
|
-
stroke:
|
|
612
|
-
strokeWidth:
|
|
645
|
+
stroke: m,
|
|
646
|
+
strokeWidth: y(g)
|
|
613
647
|
},
|
|
614
648
|
cx: "50",
|
|
615
649
|
cy: "50",
|
|
616
650
|
r: "20",
|
|
617
651
|
fill: "none"
|
|
618
652
|
}, null)])]), b && r("span", {
|
|
619
|
-
class:
|
|
653
|
+
class: h("text", {
|
|
620
654
|
[a]: a
|
|
621
655
|
}),
|
|
622
656
|
style: {
|
|
623
|
-
color:
|
|
624
|
-
fontSize:
|
|
657
|
+
color: n,
|
|
658
|
+
fontSize: y(f)
|
|
625
659
|
}
|
|
626
660
|
}, [b])])]);
|
|
627
661
|
};
|
|
628
662
|
}
|
|
629
|
-
}),
|
|
630
|
-
const a =
|
|
631
|
-
render: () =>
|
|
663
|
+
}), Pe = (e, t) => {
|
|
664
|
+
const a = T({
|
|
665
|
+
render: () => te(le, { ...e }, { ...t })
|
|
632
666
|
}), u = document.createElement("div");
|
|
633
667
|
return a.mount(u);
|
|
634
|
-
},
|
|
668
|
+
}, Z = (e, t) => {
|
|
635
669
|
t.value ? (e.classList.add("y-loading__wrap"), e.appendChild(e.instance.$el)) : (e.classList.remove("y-loading__wrap"), e.removeChild(e.instance.$el));
|
|
636
|
-
},
|
|
670
|
+
}, Te = {
|
|
637
671
|
getSSRProps: (e) => ({ ...e }),
|
|
638
672
|
mounted: (e, t) => {
|
|
639
|
-
e.instance =
|
|
673
|
+
e.instance = Pe({ ...e.customProps }, { ...e.customSlots }), t.value && Z(e, t);
|
|
640
674
|
},
|
|
641
675
|
updated: (e, t) => {
|
|
642
|
-
t.oldValue !== t.value &&
|
|
676
|
+
t.oldValue !== t.value && Z(e, t);
|
|
643
677
|
},
|
|
644
678
|
unmounted: (e) => {
|
|
645
679
|
e.instance && e.instance.$el.remove();
|
|
646
680
|
}
|
|
647
681
|
};
|
|
648
|
-
B(
|
|
682
|
+
B(le);
|
|
649
683
|
function Fe(e) {
|
|
650
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
684
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !me(e);
|
|
651
685
|
}
|
|
652
|
-
const [
|
|
686
|
+
const [Ue, v] = w("dialog"), Ee = {
|
|
653
687
|
// 控制显示
|
|
654
688
|
modelValue: {
|
|
655
689
|
type: Boolean,
|
|
@@ -720,139 +754,139 @@ const [Ee, $] = w("dialog"), Ue = {
|
|
|
720
754
|
type: String,
|
|
721
755
|
default: "body"
|
|
722
756
|
}
|
|
723
|
-
},
|
|
724
|
-
name:
|
|
757
|
+
}, ae = /* @__PURE__ */ x({
|
|
758
|
+
name: Ue,
|
|
725
759
|
directives: {
|
|
726
|
-
loading:
|
|
760
|
+
loading: Te
|
|
727
761
|
},
|
|
728
|
-
props:
|
|
762
|
+
props: Ee,
|
|
729
763
|
emits: ["update:modelValue", "cancel", "confirm"],
|
|
730
764
|
setup(e, {
|
|
731
765
|
emit: t,
|
|
732
|
-
slots:
|
|
766
|
+
slots: o
|
|
733
767
|
}) {
|
|
734
|
-
const a =
|
|
768
|
+
const a = P({
|
|
735
769
|
cancel: !1,
|
|
736
770
|
confirm: !1
|
|
737
|
-
}), u = (
|
|
738
|
-
|
|
739
|
-
},
|
|
740
|
-
var
|
|
741
|
-
u(!1), (
|
|
742
|
-
},
|
|
743
|
-
t("cancel",
|
|
744
|
-
}, c = (
|
|
745
|
-
t("confirm",
|
|
746
|
-
},
|
|
771
|
+
}), u = (n) => {
|
|
772
|
+
i.value = n;
|
|
773
|
+
}, d = (n) => {
|
|
774
|
+
var f;
|
|
775
|
+
u(!1), (f = e.callback) == null || f.call(e, n);
|
|
776
|
+
}, l = (n) => {
|
|
777
|
+
t("cancel", n, m("cancel"));
|
|
778
|
+
}, c = (n) => {
|
|
779
|
+
t("confirm", n, m("confirm"));
|
|
780
|
+
}, m = (n) => {
|
|
747
781
|
const {
|
|
748
|
-
modelValue:
|
|
782
|
+
modelValue: f,
|
|
749
783
|
beforeClose: b
|
|
750
784
|
} = e;
|
|
751
|
-
if (
|
|
752
|
-
if (
|
|
753
|
-
a[
|
|
754
|
-
const
|
|
755
|
-
|
|
756
|
-
g(
|
|
757
|
-
}).catch((
|
|
758
|
-
throw new Error(
|
|
759
|
-
}) : g(
|
|
785
|
+
if (f)
|
|
786
|
+
if (ge(b)) {
|
|
787
|
+
a[n] = !0;
|
|
788
|
+
const s = b(n);
|
|
789
|
+
ye(s) ? s.then(($) => {
|
|
790
|
+
g($, n);
|
|
791
|
+
}).catch(($) => {
|
|
792
|
+
throw new Error($);
|
|
793
|
+
}) : g(s, n);
|
|
760
794
|
} else
|
|
761
|
-
|
|
762
|
-
}, g = (
|
|
763
|
-
|
|
764
|
-
},
|
|
765
|
-
let
|
|
766
|
-
return
|
|
767
|
-
},
|
|
795
|
+
d(n);
|
|
796
|
+
}, g = (n, f) => {
|
|
797
|
+
n && d(f), a[f] = !1;
|
|
798
|
+
}, p = (n, f, b) => {
|
|
799
|
+
let s = Number(n.substring(0, n.length - 2));
|
|
800
|
+
return s /= f || 2, b ? `${b(s)}px` : `${s}px`;
|
|
801
|
+
}, i = j({
|
|
768
802
|
get: () => e.modelValue,
|
|
769
|
-
set: (
|
|
803
|
+
set: (n) => t("update:modelValue", n)
|
|
770
804
|
});
|
|
771
805
|
return () => {
|
|
772
806
|
const {
|
|
773
|
-
width:
|
|
774
|
-
title:
|
|
807
|
+
width: n,
|
|
808
|
+
title: f,
|
|
775
809
|
titleAlign: b,
|
|
776
|
-
message:
|
|
777
|
-
messageAlign:
|
|
778
|
-
isCloseOnClickMask:
|
|
779
|
-
showCloseIcon:
|
|
780
|
-
showCancelBtn:
|
|
810
|
+
message: s,
|
|
811
|
+
messageAlign: k,
|
|
812
|
+
isCloseOnClickMask: $,
|
|
813
|
+
showCloseIcon: V,
|
|
814
|
+
showCancelBtn: F,
|
|
781
815
|
cancelButtonText: L,
|
|
782
|
-
showConfirmBtn:
|
|
783
|
-
confirmButtonText:
|
|
784
|
-
imgSrc:
|
|
785
|
-
circleImg:
|
|
786
|
-
teleport:
|
|
816
|
+
showConfirmBtn: U,
|
|
817
|
+
confirmButtonText: re,
|
|
818
|
+
imgSrc: E,
|
|
819
|
+
circleImg: C,
|
|
820
|
+
teleport: ce
|
|
787
821
|
} = e;
|
|
788
|
-
return r(Ve,
|
|
789
|
-
modelValue:
|
|
790
|
-
"onUpdate:modelValue": (
|
|
791
|
-
customClass:
|
|
822
|
+
return r(Ve, pe({
|
|
823
|
+
modelValue: i.value,
|
|
824
|
+
"onUpdate:modelValue": (I) => i.value = I,
|
|
825
|
+
customClass: v(),
|
|
792
826
|
customStyle: {
|
|
793
|
-
width:
|
|
827
|
+
width: y(n)
|
|
794
828
|
}
|
|
795
829
|
}, {
|
|
796
830
|
"onUpdate:modelValue": u
|
|
797
831
|
}, {
|
|
798
|
-
isCloseOnClickMask:
|
|
799
|
-
teleport:
|
|
832
|
+
isCloseOnClickMask: $,
|
|
833
|
+
teleport: ce
|
|
800
834
|
}), {
|
|
801
835
|
default: () => {
|
|
802
|
-
var
|
|
803
|
-
return [((
|
|
804
|
-
class:
|
|
805
|
-
circle:
|
|
836
|
+
var I, q, W, G;
|
|
837
|
+
return [((I = o.img) == null ? void 0 : I.call(o)) || E && r("div", {
|
|
838
|
+
class: v("img", {
|
|
839
|
+
circle: C
|
|
806
840
|
}),
|
|
807
841
|
style: {
|
|
808
|
-
top:
|
|
809
|
-
left:
|
|
842
|
+
top: C ? `-${p(y(n), 4)}` : "auto",
|
|
843
|
+
left: C ? `calc(50% - ${p(y(n), 4)})` : "auto"
|
|
810
844
|
}
|
|
811
845
|
}, [r("div", {
|
|
812
846
|
style: {
|
|
813
|
-
width:
|
|
814
|
-
height:
|
|
815
|
-
background: `url(${
|
|
816
|
-
borderRadius:
|
|
847
|
+
width: C ? p(y(n)) : y(n),
|
|
848
|
+
height: p(y(n)),
|
|
849
|
+
background: `url(${E}) center`,
|
|
850
|
+
borderRadius: C ? "50%" : "20px 20px 0 0"
|
|
817
851
|
}
|
|
818
852
|
}, null)]), r("div", {
|
|
819
|
-
class:
|
|
853
|
+
class: v("container")
|
|
820
854
|
}, [r("div", {
|
|
821
855
|
style: {
|
|
822
|
-
height:
|
|
856
|
+
height: C ? p(y(n), 4, (ue) => ue + 20) : "24px"
|
|
823
857
|
}
|
|
824
|
-
}, null), ((
|
|
825
|
-
class:
|
|
858
|
+
}, null), ((q = o.title) == null ? void 0 : q.call(o)) || r("div", {
|
|
859
|
+
class: v("title"),
|
|
826
860
|
style: {
|
|
827
861
|
textAlign: b
|
|
828
862
|
}
|
|
829
|
-
}, [
|
|
830
|
-
class:
|
|
863
|
+
}, [f]), r("div", {
|
|
864
|
+
class: v("content")
|
|
831
865
|
}, [r("div", {
|
|
832
|
-
class:
|
|
866
|
+
class: v("message"),
|
|
833
867
|
style: {
|
|
834
|
-
textAlign:
|
|
868
|
+
textAlign: k
|
|
835
869
|
}
|
|
836
|
-
}, [((
|
|
837
|
-
class:
|
|
870
|
+
}, [((W = o.default) == null ? void 0 : W.call(o)) || s]), ((G = o.footer) == null ? void 0 : G.call(o)) || r("div", {
|
|
871
|
+
class: v("footer"),
|
|
838
872
|
style: {
|
|
839
|
-
paddingTop:
|
|
873
|
+
paddingTop: F || U ? "20px" : "0px"
|
|
840
874
|
}
|
|
841
|
-
}, [
|
|
875
|
+
}, [F && N(r(Y, {
|
|
842
876
|
type: "secondary",
|
|
843
|
-
class:
|
|
844
|
-
onClick:
|
|
877
|
+
class: v("footer-btn"),
|
|
878
|
+
onClick: l
|
|
845
879
|
}, Fe(L) ? L : {
|
|
846
880
|
default: () => [L]
|
|
847
|
-
}), [[
|
|
881
|
+
}), [[H("loading"), a.cancel]]), U && N(r(Y, {
|
|
848
882
|
type: "primary",
|
|
849
|
-
class:
|
|
883
|
+
class: v("footer-btn"),
|
|
850
884
|
onClick: c
|
|
851
885
|
}, {
|
|
852
|
-
default: () => [a.confirm ? "" :
|
|
853
|
-
}), [[
|
|
854
|
-
class:
|
|
855
|
-
onClick: () =>
|
|
886
|
+
default: () => [a.confirm ? "" : re]
|
|
887
|
+
}), [[H("loading"), a.confirm]])])]), V && r("div", {
|
|
888
|
+
class: v("close"),
|
|
889
|
+
onClick: () => d("close")
|
|
856
890
|
}, [r(Le, {
|
|
857
891
|
name: "cross"
|
|
858
892
|
}, null)])])];
|
|
@@ -861,22 +895,22 @@ const [Ee, $] = w("dialog"), Ue = {
|
|
|
861
895
|
};
|
|
862
896
|
}
|
|
863
897
|
});
|
|
864
|
-
let M =
|
|
865
|
-
const
|
|
866
|
-
const
|
|
867
|
-
M =
|
|
898
|
+
let M = T({}), qe = 0;
|
|
899
|
+
const oe = [], He = (e, t) => {
|
|
900
|
+
const o = `dialog${qe += 1}`;
|
|
901
|
+
M = T({
|
|
868
902
|
setup() {
|
|
869
|
-
const
|
|
870
|
-
|
|
903
|
+
const d = D(!0), l = (c) => {
|
|
904
|
+
d.value = c;
|
|
871
905
|
};
|
|
872
|
-
return () =>
|
|
873
|
-
|
|
906
|
+
return () => te(
|
|
907
|
+
ae,
|
|
874
908
|
{
|
|
875
|
-
modelValue:
|
|
876
|
-
"onUpdate:modelValue":
|
|
909
|
+
modelValue: d.value,
|
|
910
|
+
"onUpdate:modelValue": l,
|
|
877
911
|
...e,
|
|
878
912
|
onAfterLeave: () => {
|
|
879
|
-
We(
|
|
913
|
+
We(o);
|
|
880
914
|
}
|
|
881
915
|
},
|
|
882
916
|
{ ...t }
|
|
@@ -884,13 +918,13 @@ const ne = [], He = (e, t) => {
|
|
|
884
918
|
}
|
|
885
919
|
});
|
|
886
920
|
const u = document.createElement("div");
|
|
887
|
-
|
|
921
|
+
oe.push({ id: o, app: M, el: u }), M.mount(u);
|
|
888
922
|
}, We = (e) => {
|
|
889
|
-
|
|
923
|
+
oe.forEach((t) => {
|
|
890
924
|
e === t.id && t.app.unmount();
|
|
891
925
|
});
|
|
892
926
|
};
|
|
893
|
-
const Je = B(
|
|
927
|
+
const Je = B(ae);
|
|
894
928
|
export {
|
|
895
929
|
He as createDialog,
|
|
896
930
|
Je as default
|