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.
Files changed (54) hide show
  1. package/libs/cell/index.css +1 -1
  2. package/libs/cell/index.umd.js +1 -1
  3. package/libs/checkbox/index.mjs +1 -1
  4. package/libs/checkbox/index.umd.js +1 -1
  5. package/libs/checkboxGroup/index.mjs +2 -2
  6. package/libs/checkboxGroup/index.umd.js +1 -1
  7. package/libs/col/index.mjs +3 -3
  8. package/libs/col/index.umd.js +1 -1
  9. package/libs/context/relation/inject.d.ts +1 -1
  10. package/libs/context/relation/provide.d.ts +3 -3
  11. package/libs/dialog/index.css +1 -1
  12. package/libs/dialog/index.mjs +321 -287
  13. package/libs/dialog/index.umd.js +2 -2
  14. package/libs/dropdown/index.css +1 -0
  15. package/libs/dropdown/index.d.ts +68 -0
  16. package/libs/dropdown/index.mjs +215 -0
  17. package/libs/dropdown/index.umd.js +2 -0
  18. package/libs/dropdown/package.json +6 -0
  19. package/libs/dropdown/src/dropdown.d.ts +108 -0
  20. package/libs/dropdownItem/index.css +1 -0
  21. package/libs/dropdownItem/index.d.ts +50 -0
  22. package/libs/dropdownItem/index.mjs +645 -0
  23. package/libs/dropdownItem/index.umd.js +2 -0
  24. package/libs/dropdownItem/package.json +6 -0
  25. package/libs/dropdownItem/src/dropdown-item.d.ts +89 -0
  26. package/libs/form/index.mjs +3 -3
  27. package/libs/form/index.umd.js +1 -1
  28. package/libs/formItem/index.mjs +1 -1
  29. package/libs/formItem/index.umd.js +1 -1
  30. package/libs/index.css +1 -1
  31. package/libs/index.d.ts +3 -1
  32. package/libs/index.mjs +1919 -1608
  33. package/libs/index.umd.js +2 -2
  34. package/libs/layout/index.mjs +4 -4
  35. package/libs/layout/index.umd.js +1 -1
  36. package/libs/popup/index.css +1 -1
  37. package/libs/popup/index.d.ts +18 -0
  38. package/libs/popup/index.mjs +135 -101
  39. package/libs/popup/index.umd.js +2 -2
  40. package/libs/popup/src/popup.d.ts +18 -0
  41. package/libs/row/index.mjs +3 -3
  42. package/libs/row/index.umd.js +1 -1
  43. package/libs/swipe/index.mjs +3 -3
  44. package/libs/swipe/index.umd.js +1 -1
  45. package/libs/swipeItem/index.mjs +1 -1
  46. package/libs/swipeItem/index.umd.js +1 -1
  47. package/libs/tab/index.mjs +1 -1
  48. package/libs/tab/index.umd.js +1 -1
  49. package/libs/tabs/index.mjs +3 -3
  50. package/libs/tabs/index.umd.js +1 -1
  51. package/libs/utils/index.mjs +35 -34
  52. package/libs/utils/index.umd.js +1 -1
  53. package/libs/utils/types.d.ts +4 -0
  54. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
- import { ref as R, reactive as D, defineComponent as x, onMounted as re, onUnmounted as ce, watch as ie, createVNode as r, Transition as Q, withDirectives as I, vShow as X, computed as O, Teleport as ue, Fragment as se, createApp as P, h as Y, mergeProps as de, resolveDirective as W, isVNode as fe } from "vue";
2
- const Z = (e) => (t) => Object.prototype.toString.call(t) === `[object ${e}]`, pe = Z("Function"), me = Z("Promise"), z = (e, t) => t ? typeof t == "string" ? ` ${e}--${t}` : Array.isArray(t) ? t.reduce((l, a) => l + z(e, a), "") : Object.keys(t).reduce(
3
- (l, a) => l + (t[a] ? z(e, a) : ""),
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
- ) : "", ge = (e) => (t, l) => {
6
- let a = t, u = l;
7
- return a && typeof a != "string" && (u = a, a = ""), a = a ? `${e}__${a}` : e, `${a}${z(a, u)}`;
8
- }, ye = () => (e, t) => t ? `${z(`y-${e}`, t)}` : `y-${e}`, be = {
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
- R("zh-CN");
21
- D({
22
- "zh-CN": be
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, ge(t), ye()];
27
- }, m = (e) => isNaN(Number(e)) && typeof e == "string" ? e : `${e}px`, Se = (e) => {
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, ve, he] = w("mask"), ke = {
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 = D([]);
76
- let G = 0;
77
- const Ce = /* @__PURE__ */ x({
75
+ }, S = P([]);
76
+ let J = 0;
77
+ const we = /* @__PURE__ */ x({
78
78
  name: $e,
79
- props: ke,
79
+ props: xe,
80
80
  emits: ["update:modelValue"],
81
81
  setup(e, {
82
82
  slots: t
83
83
  }) {
84
- const l = R("");
85
- re(() => {
86
- l.value = `mask${G}`, G += 1, a(e.modelValue, !0);
87
- }), ce(() => {
88
- const n = S.findIndex((c) => c._id === l.value);
89
- n >= 0 && S.splice(n, 1);
90
- }), ie(() => e.modelValue, (n) => {
91
- a(n);
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 = (n, c) => {
94
- n ? (S.unshift({
95
- _id: l.value,
96
- _state: n
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 n = !1;
99
+ let l = !1;
100
100
  for (let c = 0; c < S.length; c++)
101
- S[c]._id === l.value && (n = S[c]._state);
101
+ S[c]._id === o.value && (l = S[c]._state);
102
102
  return {
103
- _state: n
103
+ _state: l
104
104
  };
105
- }, f = (n) => {
105
+ }, d = (l) => {
106
106
  const {
107
107
  lockScroll: c
108
108
  } = e;
109
- c && (n.preventDefault(), n.stopPropagation());
109
+ c && (l.preventDefault(), l.stopPropagation());
110
110
  };
111
111
  return () => {
112
112
  const {
113
- customClass: n,
113
+ customClass: l,
114
114
  duration: c,
115
- zIndex: p,
115
+ zIndex: m,
116
116
  customStyle: g,
117
- onAfterLeave: i
117
+ onAfterLeave: p
118
118
  } = e, {
119
- _state: d
119
+ _state: i
120
120
  } = u();
121
- return r(Q, {
121
+ return r(O, {
122
122
  name: he("animation", "fade"),
123
- onAfterLeave: i
123
+ onAfterLeave: p
124
124
  }, {
125
125
  default: () => {
126
- var o;
127
- return [I(r("div", {
126
+ var n;
127
+ return [N(r("div", {
128
128
  style: {
129
129
  animationDuration: `${c}ms`,
130
- zIndex: p,
130
+ zIndex: m,
131
131
  ...g
132
132
  },
133
- class: [ve(), n],
134
- onTouchmove: f
135
- }, [(o = t.default) == null ? void 0 : o.call(t)]), [[X, d]])];
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 = (l) => {
143
+ return t.install = (o) => {
144
144
  const { name: a } = e;
145
- a && l.component(a, e);
145
+ a && o.component(a, e);
146
146
  }, t;
147
147
  }
148
- const xe = B(Ce), [we, H, Be] = w("popup"), _e = {
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: 101
209
+ default: 100
200
210
  }
201
211
  }, Ne = /* @__PURE__ */ x({
202
- name: we,
212
+ name: Be,
203
213
  props: _e,
204
214
  emits: ["clickMask", "update:modelValue"],
205
215
  setup(e, {
206
216
  slots: t,
207
- emit: l
217
+ emit: o
208
218
  }) {
209
- const a = O(() => {
219
+ const a = j(() => {
210
220
  const {
211
- position: n,
221
+ position: l,
212
222
  borderRadius: c,
213
- customStyle: p,
214
- duration: g
215
- } = e, i = m(c);
216
- let d = "0";
217
- switch (n) {
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
- d = ` 0 0 ${i} ${i}`;
230
+ n = ` 0 0 ${i} ${i}`;
220
231
  break;
221
232
  case "bottom":
222
- d = `${i} ${i} 0 0`;
233
+ n = `${i} ${i} 0 0`;
223
234
  break;
224
235
  case "left":
225
- d = `0 ${i} ${i} 0`;
236
+ n = `0 ${i} ${i} 0`;
226
237
  break;
227
238
  case "right":
228
- d = `${i} 0 0 ${i}`;
239
+ n = `${i} 0 0 ${i}`;
229
240
  break;
230
241
  default:
231
- d = `${i}`;
242
+ n = `${i}`;
232
243
  }
233
244
  return {
234
- borderRadius: d,
245
+ borderRadius: n,
235
246
  animationDuration: `${g}ms`,
236
- ...p
247
+ ...m,
248
+ zIndex: p + 1
237
249
  };
238
- }), u = (n) => {
239
- l("clickMask", n), e.isCloseOnClickMask && (f.value = !1);
240
- }, f = O({
250
+ }), u = (l) => {
251
+ o("clickMask", l), e.isCloseOnClickMask && (d.value = !1);
252
+ }, d = j({
241
253
  get: () => e.modelValue,
242
- set: (n) => l("update:modelValue", n)
254
+ set: (l) => o("update:modelValue", l)
243
255
  });
244
256
  return () => {
245
257
  const {
246
- teleport: n,
258
+ teleport: l,
247
259
  position: c,
248
- customClass: p,
260
+ customClass: m,
249
261
  duration: g,
250
- onAfterLeave: i,
251
- lockScroll: d,
252
- zIndex: o
262
+ onAfterLeave: p,
263
+ lockScroll: i,
264
+ zIndex: n,
265
+ maskCustomClass: f,
266
+ maskCustomStyle: b
253
267
  } = e;
254
- return r(ue, {
255
- to: n
268
+ return l ? r(fe, {
269
+ to: l
256
270
  }, {
257
- default: () => [r("div", {
258
- class: H(),
259
- style: {
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: d,
275
+ lockScroll: i,
267
276
  onClick: u,
268
- onAfterLeave: i
269
- }, null), r(Q, {
270
- name: Be("animation", `slide-${c}`)
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 [I(r("div", {
286
+ return [N(r("div", {
275
287
  style: a.value,
276
- class: [H("content", {
288
+ class: [Q("content", {
277
289
  [c]: c
278
- }), p]
279
- }, [((s = t.default) == null ? void 0 : s.call(t)) || null]), [[X, f.value]])];
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), [Ae, A] = w("icon"), Ie = (e) => new RegExp(/\.(https|png|jpg|gif|jpeg|webp|apng)$/).test(e.toLowerCase()), ze = /* @__PURE__ */ x({
287
- name: Ae,
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: l
370
+ emit: o
337
371
  }) {
338
- const a = Ie(e.name), u = () => ({
339
- fontSize: m(e.size),
372
+ const a = ze(e.name), u = () => ({
373
+ fontSize: y(e.size),
340
374
  color: e.color
341
- }), f = (n) => {
342
- l("click", n);
375
+ }), d = (l) => {
376
+ o("click", l);
343
377
  };
344
378
  return () => {
345
379
  const {
346
- name: n,
380
+ name: l,
347
381
  classPrefix: c,
348
- badge: p,
382
+ badge: m,
349
383
  dot: g,
350
- subColor: i,
351
- subBg: d,
352
- tag: o
384
+ subColor: p,
385
+ subBg: i,
386
+ tag: n
353
387
  } = e;
354
- return r(o, {
355
- class: `${c}${a ? "" : ` y-icon--${n}`}`,
388
+ return r(n, {
389
+ class: `${c}${a ? "" : ` y-icon--${l}`}`,
356
390
  style: u(),
357
- onClick: f
391
+ onClick: d
358
392
  }, {
359
393
  default: () => {
360
- var s;
394
+ var f;
361
395
  return [a ? r("em", {
362
- class: A("node")
396
+ class: z("node")
363
397
  }, [r("img", {
364
- class: A("image"),
365
- src: n,
398
+ class: z("image"),
399
+ src: l,
366
400
  alt: "icon"
367
401
  }, null)]) : null, g ? r("em", {
368
- class: A("dot"),
402
+ class: z("dot"),
369
403
  style: {
370
- backgroundColor: d
404
+ backgroundColor: i
371
405
  }
372
- }, null) : null, p ? r("em", {
373
- class: A("badge"),
406
+ }, null) : null, m ? r("em", {
407
+ class: z("badge"),
374
408
  style: {
375
- color: i,
376
- backgroundColor: d
409
+ color: p,
410
+ backgroundColor: i
377
411
  }
378
- }, [p]) : null, ((s = t.default) == null ? void 0 : s.call(t)) || null];
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(ze), [Me, _, Oe] = w("button"), Re = /* @__PURE__ */ x({
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: l
485
+ emit: o
452
486
  }) {
453
487
  const a = (u) => {
454
- l("click", u);
488
+ o("click", u);
455
489
  };
456
490
  return () => {
457
491
  let {
458
492
  tag: u
459
493
  } = e;
460
494
  const {
461
- radius: f,
462
- type: n,
495
+ radius: d,
496
+ type: l,
463
497
  size: c,
464
- disabled: p,
498
+ disabled: m,
465
499
  shadow: g,
466
- block: i,
467
- square: d,
468
- semicircle: o,
469
- danger: s,
500
+ block: p,
501
+ square: i,
502
+ semicircle: n,
503
+ danger: f,
470
504
  text: b,
471
- supplementText: y
472
- } = e, v = t.default ? t.default() : b;
473
- return u = n === "link" ? "a" : u, r(u, {
474
- class: [_([n, c, {
475
- block: i,
476
- square: d,
477
- semicircle: o,
478
- disabled: p && u === "a"
479
- }, (n === "primary" || n === "secondary") && g ? `shadow_${g}` : "", s ? `${n}_danger` : "", p ? `${n}_disabled` : ""]), Oe("el", "clickable")],
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: m(f)
515
+ borderRadius: y(d)
482
516
  },
483
- disabled: p,
517
+ disabled: m,
484
518
  onClick: a
485
519
  }, {
486
520
  default: () => {
487
- var h, N;
521
+ var $, V;
488
522
  return [r("div", {
489
523
  class: _("content")
490
- }, [((h = t.leftIcon) == null ? void 0 : h.call(t)) || null, v && r(se, null, [y ? r("div", {
524
+ }, [(($ = t.leftIcon) == null ? void 0 : $.call(t)) || null, k && r(ee, null, [s ? r("div", {
491
525
  class: _("text")
492
- }, [r("p", null, [v]), r("p", {
526
+ }, [r("p", null, [k]), r("p", {
493
527
  class: _("subtext")
494
- }, [y])]) : r("span", {
528
+ }, [s])]) : r("span", {
495
529
  class: _("text")
496
- }, [v])]), ((N = t.rightIcon) == null ? void 0 : N.call(t)) || null])];
530
+ }, [k])]), ((V = t.rightIcon) == null ? void 0 : V.call(t)) || null])];
497
531
  }
498
532
  });
499
533
  };
500
534
  }
501
535
  });
502
- const J = B(Re), [De, C] = w("loading"), Pe = {
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
- }, ee = /* @__PURE__ */ x({
562
- name: De,
563
- props: Pe,
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 y, v;
602
+ var s, k;
569
603
  const {
570
- position: l,
604
+ position: o,
571
605
  textLocation: a,
572
606
  bgColor: u,
573
- bgBorderRadius: f,
574
- size: n,
607
+ bgBorderRadius: d,
608
+ size: l,
575
609
  padding: c,
576
- color: p,
610
+ color: m,
577
611
  thick: g,
578
- direction: i,
579
- text: d,
580
- textColor: o,
581
- textSize: s
582
- } = e, b = ((y = t.default) == null ? void 0 : y.call(t)) || d;
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: C({
585
- [l]: l !== "relative"
618
+ class: h({
619
+ [o]: o !== "relative"
586
620
  })
587
621
  }, [r("div", {
588
- class: C("bg", {
589
- [l]: l !== "relative"
622
+ class: h("bg", {
623
+ [o]: o !== "relative"
590
624
  }),
591
625
  style: {
592
- flexDirection: Se(a),
626
+ flexDirection: ke(a),
593
627
  backgroundColor: u,
594
- borderRadius: m(f),
595
- padding: m(c)
628
+ borderRadius: y(d),
629
+ padding: y(c)
596
630
  }
597
631
  }, [r("span", {
598
- class: C("icon-wrapper"),
632
+ class: h("icon-wrapper"),
599
633
  style: {
600
- width: m(n),
601
- height: m(n)
634
+ width: y(l),
635
+ height: y(l)
602
636
  }
603
- }, [((v = t.icon) == null ? void 0 : v.call(t)) || r("svg", {
604
- class: C("icon", {
605
- [i]: i
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: C("icon-circle"),
643
+ class: h("icon-circle"),
610
644
  style: {
611
- stroke: p,
612
- strokeWidth: m(g)
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: C("text", {
653
+ class: h("text", {
620
654
  [a]: a
621
655
  }),
622
656
  style: {
623
- color: o,
624
- fontSize: m(s)
657
+ color: n,
658
+ fontSize: y(f)
625
659
  }
626
660
  }, [b])])]);
627
661
  };
628
662
  }
629
- }), Te = (e, t) => {
630
- const a = P({
631
- render: () => Y(ee, { ...e }, { ...t })
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
- }, K = (e, t) => {
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
- }, je = {
670
+ }, Te = {
637
671
  getSSRProps: (e) => ({ ...e }),
638
672
  mounted: (e, t) => {
639
- e.instance = Te({ ...e.customProps }, { ...e.customSlots }), t.value && K(e, t);
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 && K(e, t);
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(ee);
682
+ B(le);
649
683
  function Fe(e) {
650
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !fe(e);
684
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !me(e);
651
685
  }
652
- const [Ee, $] = w("dialog"), Ue = {
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
- }, te = /* @__PURE__ */ x({
724
- name: Ee,
757
+ }, ae = /* @__PURE__ */ x({
758
+ name: Ue,
725
759
  directives: {
726
- loading: je
760
+ loading: Te
727
761
  },
728
- props: Ue,
762
+ props: Ee,
729
763
  emits: ["update:modelValue", "cancel", "confirm"],
730
764
  setup(e, {
731
765
  emit: t,
732
- slots: l
766
+ slots: o
733
767
  }) {
734
- const a = D({
768
+ const a = P({
735
769
  cancel: !1,
736
770
  confirm: !1
737
- }), u = (o) => {
738
- d.value = o;
739
- }, f = (o) => {
740
- var s;
741
- u(!1), (s = e.callback) == null || s.call(e, o);
742
- }, n = (o) => {
743
- t("cancel", o, p("cancel"));
744
- }, c = (o) => {
745
- t("confirm", o, p("confirm"));
746
- }, p = (o) => {
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: s,
782
+ modelValue: f,
749
783
  beforeClose: b
750
784
  } = e;
751
- if (s)
752
- if (pe(b)) {
753
- a[o] = !0;
754
- const y = b(o);
755
- me(y) ? y.then((h) => {
756
- g(h, o);
757
- }).catch((h) => {
758
- throw new Error(h);
759
- }) : g(y, o);
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
- f(o);
762
- }, g = (o, s) => {
763
- o && f(s), a[s] = !1;
764
- }, i = (o, s, b) => {
765
- let y = Number(o.substring(0, o.length - 2));
766
- return y /= s || 2, b ? `${b(y)}px` : `${y}px`;
767
- }, d = O({
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: (o) => t("update:modelValue", o)
803
+ set: (n) => t("update:modelValue", n)
770
804
  });
771
805
  return () => {
772
806
  const {
773
- width: o,
774
- title: s,
807
+ width: n,
808
+ title: f,
775
809
  titleAlign: b,
776
- message: y,
777
- messageAlign: v,
778
- isCloseOnClickMask: h,
779
- showCloseIcon: N,
780
- showCancelBtn: T,
810
+ message: s,
811
+ messageAlign: k,
812
+ isCloseOnClickMask: $,
813
+ showCloseIcon: V,
814
+ showCancelBtn: F,
781
815
  cancelButtonText: L,
782
- showConfirmBtn: j,
783
- confirmButtonText: le,
784
- imgSrc: F,
785
- circleImg: k,
786
- teleport: ae
816
+ showConfirmBtn: U,
817
+ confirmButtonText: re,
818
+ imgSrc: E,
819
+ circleImg: C,
820
+ teleport: ce
787
821
  } = e;
788
- return r(Ve, de({
789
- modelValue: d.value,
790
- "onUpdate:modelValue": (V) => d.value = V,
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: m(o)
827
+ width: y(n)
794
828
  }
795
829
  }, {
796
830
  "onUpdate:modelValue": u
797
831
  }, {
798
- isCloseOnClickMask: h,
799
- teleport: ae
832
+ isCloseOnClickMask: $,
833
+ teleport: ce
800
834
  }), {
801
835
  default: () => {
802
- var V, E, U, q;
803
- return [((V = l.img) == null ? void 0 : V.call(l)) || F && r("div", {
804
- class: $("img", {
805
- circle: k
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: k ? `-${i(m(o), 4)}` : "auto",
809
- left: k ? `calc(50% - ${i(m(o), 4)})` : "auto"
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: k ? i(m(o)) : m(o),
814
- height: i(m(o)),
815
- background: `url(${F}) center`,
816
- borderRadius: k ? "50%" : "20px 20px 0 0"
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: $("container")
853
+ class: v("container")
820
854
  }, [r("div", {
821
855
  style: {
822
- height: k ? i(m(o), 4, (oe) => oe + 20) : "24px"
856
+ height: C ? p(y(n), 4, (ue) => ue + 20) : "24px"
823
857
  }
824
- }, null), ((E = l.title) == null ? void 0 : E.call(l)) || r("div", {
825
- class: $("title"),
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
- }, [s]), r("div", {
830
- class: $("content")
863
+ }, [f]), r("div", {
864
+ class: v("content")
831
865
  }, [r("div", {
832
- class: $("message"),
866
+ class: v("message"),
833
867
  style: {
834
- textAlign: v
868
+ textAlign: k
835
869
  }
836
- }, [((U = l.default) == null ? void 0 : U.call(l)) || y]), ((q = l.footer) == null ? void 0 : q.call(l)) || r("div", {
837
- class: $("footer"),
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: T || j ? "20px" : "0px"
873
+ paddingTop: F || U ? "20px" : "0px"
840
874
  }
841
- }, [T && I(r(J, {
875
+ }, [F && N(r(Y, {
842
876
  type: "secondary",
843
- class: $("footer-btn"),
844
- onClick: n
877
+ class: v("footer-btn"),
878
+ onClick: l
845
879
  }, Fe(L) ? L : {
846
880
  default: () => [L]
847
- }), [[W("loading"), a.cancel]]), j && I(r(J, {
881
+ }), [[H("loading"), a.cancel]]), U && N(r(Y, {
848
882
  type: "primary",
849
- class: $("footer-btn"),
883
+ class: v("footer-btn"),
850
884
  onClick: c
851
885
  }, {
852
- default: () => [a.confirm ? "" : le]
853
- }), [[W("loading"), a.confirm]])])]), N && r("div", {
854
- class: $("close"),
855
- onClick: () => f("close")
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 = P({}), qe = 0;
865
- const ne = [], He = (e, t) => {
866
- const l = `dialog${qe += 1}`;
867
- M = P({
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 f = R(!0), n = (c) => {
870
- f.value = c;
903
+ const d = D(!0), l = (c) => {
904
+ d.value = c;
871
905
  };
872
- return () => Y(
873
- te,
906
+ return () => te(
907
+ ae,
874
908
  {
875
- modelValue: f.value,
876
- "onUpdate:modelValue": n,
909
+ modelValue: d.value,
910
+ "onUpdate:modelValue": l,
877
911
  ...e,
878
912
  onAfterLeave: () => {
879
- We(l);
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
- ne.push({ id: l, app: M, el: u }), M.mount(u);
921
+ oe.push({ id: o, app: M, el: u }), M.mount(u);
888
922
  }, We = (e) => {
889
- ne.forEach((t) => {
923
+ oe.forEach((t) => {
890
924
  e === t.id && t.app.unmount();
891
925
  });
892
926
  };
893
- const Je = B(te);
927
+ const Je = B(ae);
894
928
  export {
895
929
  He as createDialog,
896
930
  Je as default