y-design-ssr 0.2.10 → 0.2.12

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 (90) hide show
  1. package/libs/button/index.d.ts +112 -1
  2. package/libs/button/index.mjs +55 -51
  3. package/libs/button/index.umd.js +2 -2
  4. package/libs/cell/index.d.ts +87 -1
  5. package/libs/cell/index.mjs +70 -70
  6. package/libs/cell/index.umd.js +2 -2
  7. package/libs/checkbox/index.d.ts +58 -1
  8. package/libs/checkbox/index.mjs +72 -72
  9. package/libs/checkbox/index.umd.js +2 -2
  10. package/libs/checkboxGroup/index.d.ts +67 -1
  11. package/libs/checkboxGroup/index.mjs +48 -44
  12. package/libs/checkboxGroup/index.umd.js +2 -2
  13. package/libs/col/index.d.ts +24 -1
  14. package/libs/col/index.mjs +49 -45
  15. package/libs/col/index.umd.js +2 -2
  16. package/libs/countdown/index.d.ts +42 -1
  17. package/libs/countdown/index.mjs +54 -50
  18. package/libs/countdown/index.umd.js +2 -2
  19. package/libs/dialog/index.d.ts +157 -1
  20. package/libs/dialog/index.mjs +219 -274
  21. package/libs/dialog/index.umd.js +2 -2
  22. package/libs/empty/index.d.ts +40 -1
  23. package/libs/empty/index.mjs +36 -32
  24. package/libs/empty/index.umd.js +2 -2
  25. package/libs/form/index.d.ts +127 -1
  26. package/libs/form/index.mjs +69 -64
  27. package/libs/form/index.umd.js +2 -2
  28. package/libs/formItem/index.d.ts +118 -1
  29. package/libs/formItem/index.mjs +61 -56
  30. package/libs/formItem/index.umd.js +2 -2
  31. package/libs/icon/index.d.ts +94 -1
  32. package/libs/icon/index.mjs +46 -42
  33. package/libs/icon/index.umd.js +2 -2
  34. package/libs/index.d.ts +3 -56
  35. package/libs/index.mjs +804 -899
  36. package/libs/index.umd.js +2 -2
  37. package/libs/input/index.d.ts +112 -1
  38. package/libs/input/index.mjs +75 -70
  39. package/libs/input/index.umd.js +2 -2
  40. package/libs/list/index.d.ts +112 -1
  41. package/libs/list/index.mjs +110 -106
  42. package/libs/list/index.umd.js +2 -2
  43. package/libs/loading/index.d.ts +112 -1
  44. package/libs/loading/index.mjs +57 -52
  45. package/libs/loading/index.umd.js +2 -2
  46. package/libs/mask/index.d.ts +67 -1
  47. package/libs/mask/index.mjs +54 -50
  48. package/libs/mask/index.umd.js +2 -2
  49. package/libs/popup/index.d.ts +103 -1
  50. package/libs/popup/index.mjs +47 -47
  51. package/libs/popup/index.umd.js +2 -2
  52. package/libs/progress/index.d.ts +130 -1
  53. package/libs/progress/index.mjs +66 -62
  54. package/libs/progress/index.umd.js +2 -2
  55. package/libs/pullrefresh/index.d.ts +67 -1
  56. package/libs/pullrefresh/index.mjs +59 -55
  57. package/libs/pullrefresh/index.umd.js +2 -2
  58. package/libs/row/index.d.ts +42 -1
  59. package/libs/row/index.mjs +55 -51
  60. package/libs/row/index.umd.js +2 -2
  61. package/libs/slider/index.d.ts +121 -1
  62. package/libs/slider/index.mjs +93 -89
  63. package/libs/slider/index.umd.js +2 -2
  64. package/libs/stepper/index.d.ts +94 -1
  65. package/libs/stepper/index.mjs +50 -46
  66. package/libs/stepper/index.umd.js +2 -2
  67. package/libs/swipe/index.d.ts +148 -1
  68. package/libs/swipe/index.mjs +78 -74
  69. package/libs/swipe/index.umd.js +2 -2
  70. package/libs/swipeItem/index.d.ts +22 -1
  71. package/libs/swipeItem/index.mjs +38 -34
  72. package/libs/swipeItem/index.umd.js +2 -2
  73. package/libs/switch/index.d.ts +79 -1
  74. package/libs/switch/index.mjs +32 -28
  75. package/libs/switch/index.umd.js +2 -2
  76. package/libs/tab/index.d.ts +31 -1
  77. package/libs/tab/index.mjs +36 -32
  78. package/libs/tab/index.umd.js +1 -1
  79. package/libs/tabs/index.d.ts +150 -1
  80. package/libs/tabs/index.mjs +89 -85
  81. package/libs/tabs/index.umd.js +2 -2
  82. package/libs/toast/index.d.ts +57 -1
  83. package/libs/toast/index.mjs +59 -57
  84. package/libs/toast/index.umd.js +2 -2
  85. package/libs/tooltip/index.d.ts +112 -1
  86. package/libs/tooltip/index.mjs +69 -65
  87. package/libs/tooltip/index.umd.js +2 -2
  88. package/libs/utils/withInstall.d.ts +5 -0
  89. package/libs/vue-sfc.d.ts +4 -8
  90. package/package.json +2 -2
@@ -1,11 +1,11 @@
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) : ""),
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) : ""),
4
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 = {
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 = {
9
9
  "pull-refresh": {
10
10
  pulling: "下拉刷新...",
11
11
  loosing: "释放刷新...",
@@ -17,14 +17,14 @@ const oe = (e) => (t) => Object.prototype.toString.call(t) === `[object ${e}]`,
17
17
  validateMessage: "请输入正确内容"
18
18
  }
19
19
  };
20
- E("zh-CN");
21
- U({
22
- "zh-CN": ke
20
+ R("zh-CN");
21
+ D({
22
+ "zh-CN": be
23
23
  });
24
24
  const w = (e) => {
25
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) => {
26
+ return [t, ge(t), ye()];
27
+ }, m = (e) => isNaN(Number(e)) && typeof e == "string" ? e : `${e}px`, Se = (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
- }, [xe, we, Be] = w("mask"), Ne = {
40
+ }, [$e, ve, he] = w("mask"), ke = {
41
41
  // 控制显示
42
42
  modelValue: {
43
43
  type: Boolean,
@@ -72,77 +72,80 @@ const w = (e) => {
72
72
  type: Function,
73
73
  default: null
74
74
  }
75
- }, S = U([]);
76
- let Y = 0;
77
- const I = /* @__PURE__ */ x({
78
- name: xe,
79
- props: Ne,
75
+ }, S = D([]);
76
+ let G = 0;
77
+ const Ce = /* @__PURE__ */ x({
78
+ name: $e,
79
+ props: ke,
80
80
  emits: ["update:modelValue"],
81
81
  setup(e, {
82
82
  slots: t
83
83
  }) {
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);
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
89
  n >= 0 && S.splice(n, 1);
90
- }), pe(() => e.modelValue, (n) => {
90
+ }), ie(() => e.modelValue, (n) => {
91
91
  a(n);
92
92
  });
93
- const a = (n, i) => {
93
+ const a = (n, c) => {
94
94
  n ? (S.unshift({
95
95
  _id: l.value,
96
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 = () => {
97
+ }), S.length > 1 && (S[1]._state = !1)) : c || (S.splice(0, 1), S.length > 0 && (S[0]._state = !0));
98
+ }, u = () => {
99
99
  let n = !1;
100
- for (let i = 0; i < S.length; i++)
101
- S[i]._id === l.value && (n = S[i]._state);
100
+ for (let c = 0; c < S.length; c++)
101
+ S[c]._id === l.value && (n = S[c]._state);
102
102
  return {
103
103
  _state: n
104
104
  };
105
105
  }, f = (n) => {
106
106
  const {
107
- lockScroll: i
107
+ lockScroll: c
108
108
  } = e;
109
- i && (n.preventDefault(), n.stopPropagation());
109
+ c && (n.preventDefault(), n.stopPropagation());
110
110
  };
111
111
  return () => {
112
112
  const {
113
113
  customClass: n,
114
- duration: i,
114
+ duration: c,
115
115
  zIndex: p,
116
116
  customStyle: g,
117
- onAfterLeave: c
117
+ onAfterLeave: i
118
118
  } = e, {
119
119
  _state: d
120
- } = s();
121
- return r(te, {
122
- name: Be("animation", "fade"),
123
- onAfterLeave: c
120
+ } = u();
121
+ return r(Q, {
122
+ name: he("animation", "fade"),
123
+ onAfterLeave: i
124
124
  }, {
125
125
  default: () => {
126
126
  var o;
127
- return [P(r("div", {
127
+ return [I(r("div", {
128
128
  style: {
129
- animationDuration: `${i}ms`,
129
+ animationDuration: `${c}ms`,
130
130
  zIndex: p,
131
131
  ...g
132
132
  },
133
- class: [we(), n],
133
+ class: [ve(), n],
134
134
  onTouchmove: f
135
- }, [(o = t.default) == null ? void 0 : o.call(t)]), [[ne, d]])];
135
+ }, [(o = t.default) == null ? void 0 : o.call(t)]), [[X, d]])];
136
136
  }
137
137
  });
138
138
  };
139
139
  }
140
140
  });
141
- I.install = (e) => {
142
- const { name: t } = I;
143
- e.component(t, I);
144
- };
145
- const [_e, Z, Ve] = w("popup"), Ae = {
141
+ function B(e) {
142
+ const t = e;
143
+ return t.install = (l) => {
144
+ const { name: a } = e;
145
+ a && l.component(a, e);
146
+ }, t;
147
+ }
148
+ const xe = B(Ce), [we, H, Be] = w("popup"), _e = {
146
149
  // 控制显示
147
150
  modelValue: {
148
151
  type: Boolean,
@@ -195,97 +198,93 @@ const [_e, Z, Ve] = w("popup"), Ae = {
195
198
  type: Number,
196
199
  default: 101
197
200
  }
198
- }, L = /* @__PURE__ */ x({
199
- name: _e,
200
- props: Ae,
201
+ }, Ne = /* @__PURE__ */ x({
202
+ name: we,
203
+ props: _e,
201
204
  emits: ["clickMask", "update:modelValue"],
202
205
  setup(e, {
203
206
  slots: t,
204
207
  emit: l
205
208
  }) {
206
- const a = F(() => {
209
+ const a = O(() => {
207
210
  const {
208
211
  position: n,
209
- borderRadius: i,
212
+ borderRadius: c,
210
213
  customStyle: p,
211
214
  duration: g
212
- } = e, c = m(i);
215
+ } = e, i = m(c);
213
216
  let d = "0";
214
217
  switch (n) {
215
218
  case "top":
216
- d = ` 0 0 ${c} ${c}`;
219
+ d = ` 0 0 ${i} ${i}`;
217
220
  break;
218
221
  case "bottom":
219
- d = `${c} ${c} 0 0`;
222
+ d = `${i} ${i} 0 0`;
220
223
  break;
221
224
  case "left":
222
- d = `0 ${c} ${c} 0`;
225
+ d = `0 ${i} ${i} 0`;
223
226
  break;
224
227
  case "right":
225
- d = `${c} 0 0 ${c}`;
228
+ d = `${i} 0 0 ${i}`;
226
229
  break;
227
230
  default:
228
- d = `${c}`;
231
+ d = `${i}`;
229
232
  }
230
233
  return {
231
234
  borderRadius: d,
232
235
  animationDuration: `${g}ms`,
233
236
  ...p
234
237
  };
235
- }), s = (n) => {
238
+ }), u = (n) => {
236
239
  l("clickMask", n), e.isCloseOnClickMask && (f.value = !1);
237
- }, f = F({
240
+ }, f = O({
238
241
  get: () => e.modelValue,
239
242
  set: (n) => l("update:modelValue", n)
240
243
  });
241
244
  return () => {
242
245
  const {
243
246
  teleport: n,
244
- position: i,
247
+ position: c,
245
248
  customClass: p,
246
249
  duration: g,
247
- onAfterLeave: c,
250
+ onAfterLeave: i,
248
251
  lockScroll: d,
249
252
  zIndex: o
250
253
  } = e;
251
- return r(me, {
254
+ return r(ue, {
252
255
  to: n
253
256
  }, {
254
257
  default: () => [r("div", {
255
- class: Z(),
258
+ class: H(),
256
259
  style: {
257
260
  zIndex: o
258
261
  }
259
- }, [r(I, {
262
+ }, [r(xe, {
260
263
  modelValue: f.value,
261
- "onUpdate:modelValue": (u) => f.value = u,
264
+ "onUpdate:modelValue": (s) => f.value = s,
262
265
  duration: g,
263
266
  lockScroll: d,
264
- onClick: s,
265
- onAfterLeave: c
266
- }, null), r(te, {
267
- name: Ve("animation", `slide-${i}`)
267
+ onClick: u,
268
+ onAfterLeave: i
269
+ }, null), r(Q, {
270
+ name: Be("animation", `slide-${c}`)
268
271
  }, {
269
272
  default: () => {
270
- var u;
271
- return [P(r("div", {
273
+ var s;
274
+ return [I(r("div", {
272
275
  style: a.value,
273
- class: [Z("content", {
274
- [i]: i
276
+ class: [H("content", {
277
+ [c]: c
275
278
  }), p]
276
- }, [((u = t.default) == null ? void 0 : u.call(t)) || null]), [[ne, f.value]])];
279
+ }, [((s = t.default) == null ? void 0 : s.call(t)) || null]), [[X, f.value]])];
277
280
  }
278
281
  })])]
279
282
  });
280
283
  };
281
284
  }
282
285
  });
283
- L.install = (e) => {
284
- const { name: t } = L;
285
- e.component(t, L);
286
- };
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,
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,
289
288
  props: {
290
289
  dot: {
291
290
  type: Boolean,
@@ -336,7 +335,7 @@ const [ze, z] = w("icon"), Ie = (e) => new RegExp(/\.(https|png|jpg|gif|jpeg|web
336
335
  slots: t,
337
336
  emit: l
338
337
  }) {
339
- const a = Ie(e.name), s = () => ({
338
+ const a = Ie(e.name), u = () => ({
340
339
  fontSize: m(e.size),
341
340
  color: e.color
342
341
  }), f = (n) => {
@@ -345,49 +344,45 @@ const [ze, z] = w("icon"), Ie = (e) => new RegExp(/\.(https|png|jpg|gif|jpeg|web
345
344
  return () => {
346
345
  const {
347
346
  name: n,
348
- classPrefix: i,
347
+ classPrefix: c,
349
348
  badge: p,
350
349
  dot: g,
351
- subColor: c,
350
+ subColor: i,
352
351
  subBg: d,
353
352
  tag: o
354
353
  } = e;
355
354
  return r(o, {
356
- class: `${i}${a ? "" : ` y-icon--${n}`}`,
357
- style: s(),
355
+ class: `${c}${a ? "" : ` y-icon--${n}`}`,
356
+ style: u(),
358
357
  onClick: f
359
358
  }, {
360
359
  default: () => {
361
- var u;
360
+ var s;
362
361
  return [a ? r("em", {
363
- class: z("node")
362
+ class: A("node")
364
363
  }, [r("img", {
365
- class: z("image"),
364
+ class: A("image"),
366
365
  src: n,
367
366
  alt: "icon"
368
367
  }, null)]) : null, g ? r("em", {
369
- class: z("dot"),
368
+ class: A("dot"),
370
369
  style: {
371
370
  backgroundColor: d
372
371
  }
373
372
  }, null) : null, p ? r("em", {
374
- class: z("badge"),
373
+ class: A("badge"),
375
374
  style: {
376
- color: c,
375
+ color: i,
377
376
  backgroundColor: d
378
377
  }
379
- }, [p]) : null, ((u = t.default) == null ? void 0 : u.call(t)) || null];
378
+ }, [p]) : null, ((s = t.default) == null ? void 0 : s.call(t)) || null];
380
379
  }
381
380
  });
382
381
  };
383
382
  }
384
383
  });
385
- M.install = (e) => {
386
- const { name: t } = M;
387
- e.component(t, M);
388
- };
389
- const [Le, B, Me] = w("button"), _ = /* @__PURE__ */ x({
390
- name: Le,
384
+ const Le = B(ze), [Me, _, Oe] = w("button"), Re = /* @__PURE__ */ x({
385
+ name: Me,
391
386
  props: {
392
387
  // 标签
393
388
  tag: {
@@ -455,33 +450,33 @@ const [Le, B, Me] = w("button"), _ = /* @__PURE__ */ x({
455
450
  slots: t,
456
451
  emit: l
457
452
  }) {
458
- const a = (s) => {
459
- l("click", s);
453
+ const a = (u) => {
454
+ l("click", u);
460
455
  };
461
456
  return () => {
462
457
  let {
463
- tag: s
458
+ tag: u
464
459
  } = e;
465
460
  const {
466
461
  radius: f,
467
462
  type: n,
468
- size: i,
463
+ size: c,
469
464
  disabled: p,
470
465
  shadow: g,
471
- block: c,
466
+ block: i,
472
467
  square: d,
473
468
  semicircle: o,
474
- danger: u,
469
+ danger: s,
475
470
  text: b,
476
471
  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,
472
+ } = e, v = t.default ? t.default() : b;
473
+ return u = n === "link" ? "a" : u, r(u, {
474
+ class: [_([n, c, {
475
+ block: i,
481
476
  square: d,
482
477
  semicircle: o,
483
- disabled: p && s === "a"
484
- }, (n === "primary" || n === "secondary") && g ? `shadow_${g}` : "", u ? `${n}_danger` : "", p ? `${n}_disabled` : ""]), Me("el", "clickable")],
478
+ disabled: p && u === "a"
479
+ }, (n === "primary" || n === "secondary") && g ? `shadow_${g}` : "", s ? `${n}_danger` : "", p ? `${n}_disabled` : ""]), Oe("el", "clickable")],
485
480
  style: {
486
481
  borderRadius: m(f)
487
482
  },
@@ -489,26 +484,22 @@ const [Le, B, Me] = w("button"), _ = /* @__PURE__ */ x({
489
484
  onClick: a
490
485
  }, {
491
486
  default: () => {
492
- var h, V;
487
+ var h, N;
493
488
  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")
489
+ class: _("content")
490
+ }, [((h = t.leftIcon) == null ? void 0 : h.call(t)) || null, v && r(se, null, [y ? r("div", {
491
+ class: _("text")
492
+ }, [r("p", null, [v]), r("p", {
493
+ class: _("subtext")
499
494
  }, [y])]) : r("span", {
500
- class: B("text")
501
- }, [$])]), ((V = t.rightIcon) == null ? void 0 : V.call(t)) || null])];
495
+ class: _("text")
496
+ }, [v])]), ((N = t.rightIcon) == null ? void 0 : N.call(t)) || null])];
502
497
  }
503
498
  });
504
499
  };
505
500
  }
506
501
  });
507
- _.install = (e) => {
508
- const { name: t } = _;
509
- e.component(t, _);
510
- };
511
- const [Re, C] = w("loading"), Oe = {
502
+ const J = B(Re), [De, C] = w("loading"), Pe = {
512
503
  // Loading icon 的颜色
513
504
  color: {
514
505
  type: String,
@@ -567,27 +558,27 @@ const [Re, C] = w("loading"), Oe = {
567
558
  type: String,
568
559
  default: "relative"
569
560
  }
570
- }, R = /* @__PURE__ */ x({
571
- name: Re,
572
- props: Oe,
561
+ }, ee = /* @__PURE__ */ x({
562
+ name: De,
563
+ props: Pe,
573
564
  setup(e, {
574
565
  slots: t
575
566
  }) {
576
567
  return () => {
577
- var y, $;
568
+ var y, v;
578
569
  const {
579
570
  position: l,
580
571
  textLocation: a,
581
- bgColor: s,
572
+ bgColor: u,
582
573
  bgBorderRadius: f,
583
574
  size: n,
584
- padding: i,
575
+ padding: c,
585
576
  color: p,
586
577
  thick: g,
587
- direction: c,
578
+ direction: i,
588
579
  text: d,
589
580
  textColor: o,
590
- textSize: u
581
+ textSize: s
591
582
  } = e, b = ((y = t.default) == null ? void 0 : y.call(t)) || d;
592
583
  return r("div", {
593
584
  class: C({
@@ -598,10 +589,10 @@ const [Re, C] = w("loading"), Oe = {
598
589
  [l]: l !== "relative"
599
590
  }),
600
591
  style: {
601
- flexDirection: Ce(a),
602
- backgroundColor: s,
592
+ flexDirection: Se(a),
593
+ backgroundColor: u,
603
594
  borderRadius: m(f),
604
- padding: m(i)
595
+ padding: m(c)
605
596
  }
606
597
  }, [r("span", {
607
598
  class: C("icon-wrapper"),
@@ -609,9 +600,9 @@ const [Re, C] = w("loading"), Oe = {
609
600
  width: m(n),
610
601
  height: m(n)
611
602
  }
612
- }, [(($ = t.icon) == null ? void 0 : $.call(t)) || r("svg", {
603
+ }, [((v = t.icon) == null ? void 0 : v.call(t)) || r("svg", {
613
604
  class: C("icon", {
614
- [c]: c
605
+ [i]: i
615
606
  }),
616
607
  viewBox: "25 25 50 50"
617
608
  }, [r("circle", {
@@ -630,78 +621,35 @@ const [Re, C] = w("loading"), Oe = {
630
621
  }),
631
622
  style: {
632
623
  color: o,
633
- fontSize: m(u)
624
+ fontSize: m(s)
634
625
  }
635
626
  }, [b])])]);
636
627
  };
637
628
  }
638
- }), Pe = {
639
- position: "fixed"
640
- };
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 = {
648
- /**
649
- * @description: show
650
- * @param {LoadingPropsType} options
651
- * @return {*}
652
- */
653
- show: (e, t) => {
654
- N || (N = ae(
655
- {
656
- ...Pe,
657
- ...e
658
- },
659
- t
660
- )), document.body.appendChild(N.$el);
661
- },
662
- /**
663
- * @description: hide
664
- * @param {*}
665
- * @return {*}
666
- */
667
- hide: () => {
668
- N && N.$el.remove();
669
- }
670
- }, ee = (e, t) => {
629
+ }), Te = (e, t) => {
630
+ const a = P({
631
+ render: () => Y(ee, { ...e }, { ...t })
632
+ }), u = document.createElement("div");
633
+ return a.mount(u);
634
+ }, K = (e, t) => {
671
635
  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);
675
- }
676
- }, re = {
636
+ }, je = {
677
637
  getSSRProps: (e) => ({ ...e }),
678
638
  mounted: (e, t) => {
679
- e.instance = ae({ ...e.customProps }, { ...e.customSlots }), t.value && ee(e, t);
639
+ e.instance = Te({ ...e.customProps }, { ...e.customSlots }), t.value && K(e, t);
680
640
  },
681
641
  updated: (e, t) => {
682
- t.oldValue !== t.value && ee(e, t);
642
+ t.oldValue !== t.value && K(e, t);
683
643
  },
684
644
  unmounted: (e) => {
685
645
  e.instance && e.instance.$el.remove();
686
646
  }
687
- }, je = {
688
- getSSRProps: (e) => ({ ...e }),
689
- beforeMount: (e, t) => {
690
- e.customProps = { ...t.value };
691
- }
692
- }, Fe = {
693
- getSSRProps: (e) => ({ ...e }),
694
- beforeMount: (e, t) => {
695
- e.customSlots = { ...t.value };
696
- }
697
647
  };
698
- R.install = (e) => {
699
- e.component(R.name, R), e.provide("loading", De), e.use(Te);
700
- };
701
- function Ee(e) {
702
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !be(e);
648
+ B(ee);
649
+ function Fe(e) {
650
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !fe(e);
703
651
  }
704
- const [Ue, v] = w("dialog"), qe = {
652
+ const [Ee, $] = w("dialog"), Ue = {
705
653
  // 控制显示
706
654
  modelValue: {
707
655
  type: Boolean,
@@ -772,140 +720,140 @@ const [Ue, v] = w("dialog"), qe = {
772
720
  type: String,
773
721
  default: "body"
774
722
  }
775
- }, O = /* @__PURE__ */ x({
776
- name: Ue,
723
+ }, te = /* @__PURE__ */ x({
724
+ name: Ee,
777
725
  directives: {
778
- loading: re
726
+ loading: je
779
727
  },
780
- props: qe,
728
+ props: Ue,
781
729
  emits: ["update:modelValue", "cancel", "confirm"],
782
730
  setup(e, {
783
731
  emit: t,
784
732
  slots: l
785
733
  }) {
786
- const a = U({
734
+ const a = D({
787
735
  cancel: !1,
788
736
  confirm: !1
789
- }), s = (o) => {
737
+ }), u = (o) => {
790
738
  d.value = o;
791
739
  }, f = (o) => {
792
- var u;
793
- s(!1), (u = e.callback) == null || u.call(e, o);
740
+ var s;
741
+ u(!1), (s = e.callback) == null || s.call(e, o);
794
742
  }, n = (o) => {
795
743
  t("cancel", o, p("cancel"));
796
- }, i = (o) => {
744
+ }, c = (o) => {
797
745
  t("confirm", o, p("confirm"));
798
746
  }, p = (o) => {
799
747
  const {
800
- modelValue: u,
748
+ modelValue: s,
801
749
  beforeClose: b
802
750
  } = e;
803
- if (u)
804
- if (Se(b)) {
751
+ if (s)
752
+ if (pe(b)) {
805
753
  a[o] = !0;
806
754
  const y = b(o);
807
- ve(y) ? y.then((h) => {
755
+ me(y) ? y.then((h) => {
808
756
  g(h, o);
809
757
  }).catch((h) => {
810
758
  throw new Error(h);
811
759
  }) : g(y, o);
812
760
  } else
813
761
  f(o);
814
- }, g = (o, u) => {
815
- o && f(u), a[u] = !1;
816
- }, c = (o, u, b) => {
762
+ }, g = (o, s) => {
763
+ o && f(s), a[s] = !1;
764
+ }, i = (o, s, b) => {
817
765
  let y = Number(o.substring(0, o.length - 2));
818
- return y /= u || 2, b ? `${b(y)}px` : `${y}px`;
819
- }, d = F({
766
+ return y /= s || 2, b ? `${b(y)}px` : `${y}px`;
767
+ }, d = O({
820
768
  get: () => e.modelValue,
821
769
  set: (o) => t("update:modelValue", o)
822
770
  });
823
771
  return () => {
824
772
  const {
825
773
  width: o,
826
- title: u,
774
+ title: s,
827
775
  titleAlign: b,
828
776
  message: y,
829
- messageAlign: $,
777
+ messageAlign: v,
830
778
  isCloseOnClickMask: h,
831
- showCloseIcon: V,
832
- showCancelBtn: W,
833
- cancelButtonText: T,
834
- showConfirmBtn: G,
835
- confirmButtonText: ce,
836
- imgSrc: H,
779
+ showCloseIcon: N,
780
+ showCancelBtn: T,
781
+ cancelButtonText: L,
782
+ showConfirmBtn: j,
783
+ confirmButtonText: le,
784
+ imgSrc: F,
837
785
  circleImg: k,
838
- teleport: se
786
+ teleport: ae
839
787
  } = e;
840
- return r(L, ye({
788
+ return r(Ve, de({
841
789
  modelValue: d.value,
842
- "onUpdate:modelValue": (A) => d.value = A,
843
- customClass: v(),
790
+ "onUpdate:modelValue": (V) => d.value = V,
791
+ customClass: $(),
844
792
  customStyle: {
845
793
  width: m(o)
846
794
  }
847
795
  }, {
848
- "onUpdate:modelValue": s
796
+ "onUpdate:modelValue": u
849
797
  }, {
850
798
  isCloseOnClickMask: h,
851
- teleport: se
799
+ teleport: ae
852
800
  }), {
853
801
  default: () => {
854
- var A, J, K, Q;
855
- return [((A = l.img) == null ? void 0 : A.call(l)) || H && r("div", {
856
- class: v("img", {
802
+ var V, E, U, q;
803
+ return [((V = l.img) == null ? void 0 : V.call(l)) || F && r("div", {
804
+ class: $("img", {
857
805
  circle: k
858
806
  }),
859
807
  style: {
860
- top: k ? `-${c(m(o), 4)}` : "auto",
861
- left: k ? `calc(50% - ${c(m(o), 4)})` : "auto"
808
+ top: k ? `-${i(m(o), 4)}` : "auto",
809
+ left: k ? `calc(50% - ${i(m(o), 4)})` : "auto"
862
810
  }
863
811
  }, [r("div", {
864
812
  style: {
865
- width: k ? c(m(o)) : m(o),
866
- height: c(m(o)),
867
- background: `url(${H}) center`,
813
+ width: k ? i(m(o)) : m(o),
814
+ height: i(m(o)),
815
+ background: `url(${F}) center`,
868
816
  borderRadius: k ? "50%" : "20px 20px 0 0"
869
817
  }
870
818
  }, null)]), r("div", {
871
- class: v("container")
819
+ class: $("container")
872
820
  }, [r("div", {
873
821
  style: {
874
- height: k ? c(m(o), 4, (ue) => ue + 20) : "24px"
822
+ height: k ? i(m(o), 4, (oe) => oe + 20) : "24px"
875
823
  }
876
- }, null), ((J = l.title) == null ? void 0 : J.call(l)) || r("div", {
877
- class: v("title"),
824
+ }, null), ((E = l.title) == null ? void 0 : E.call(l)) || r("div", {
825
+ class: $("title"),
878
826
  style: {
879
827
  textAlign: b
880
828
  }
881
- }, [u]), r("div", {
882
- class: v("content")
829
+ }, [s]), r("div", {
830
+ class: $("content")
883
831
  }, [r("div", {
884
- class: v("message"),
832
+ class: $("message"),
885
833
  style: {
886
- textAlign: $
834
+ textAlign: v
887
835
  }
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"),
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"),
890
838
  style: {
891
- paddingTop: W || G ? "20px" : "0px"
839
+ paddingTop: T || j ? "20px" : "0px"
892
840
  }
893
- }, [W && P(r(_, {
841
+ }, [T && I(r(J, {
894
842
  type: "secondary",
895
- class: v("footer-btn"),
843
+ class: $("footer-btn"),
896
844
  onClick: n
897
- }, Ee(T) ? T : {
898
- default: () => [T]
899
- }), [[X("loading"), a.cancel]]), G && P(r(_, {
845
+ }, Fe(L) ? L : {
846
+ default: () => [L]
847
+ }), [[W("loading"), a.cancel]]), j && I(r(J, {
900
848
  type: "primary",
901
- class: v("footer-btn"),
902
- onClick: i
849
+ class: $("footer-btn"),
850
+ onClick: c
903
851
  }, {
904
- default: () => [a.confirm ? "" : ce]
905
- }), [[X("loading"), a.confirm]])])]), V && r("div", {
906
- class: v("close"),
852
+ default: () => [a.confirm ? "" : le]
853
+ }), [[W("loading"), a.confirm]])])]), N && r("div", {
854
+ class: $("close"),
907
855
  onClick: () => f("close")
908
- }, [r(M, {
856
+ }, [r(Le, {
909
857
  name: "cross"
910
858
  }, null)])])];
911
859
  }
@@ -913,40 +861,37 @@ const [Ue, v] = w("dialog"), qe = {
913
861
  };
914
862
  }
915
863
  });
916
- let j = q({}), We = 0;
917
- const ie = [], Ge = (e, t) => {
918
- const l = `dialog${We += 1}`;
919
- j = q({
864
+ let M = P({}), qe = 0;
865
+ const ne = [], He = (e, t) => {
866
+ const l = `dialog${qe += 1}`;
867
+ M = P({
920
868
  setup() {
921
- const f = E(!0), n = (i) => {
922
- f.value = i;
869
+ const f = R(!0), n = (c) => {
870
+ f.value = c;
923
871
  };
924
- return () => le(
925
- O,
872
+ return () => Y(
873
+ te,
926
874
  {
927
875
  modelValue: f.value,
928
876
  "onUpdate:modelValue": n,
929
877
  ...e,
930
878
  onAfterLeave: () => {
931
- He(l);
879
+ We(l);
932
880
  }
933
881
  },
934
882
  { ...t }
935
883
  );
936
884
  }
937
885
  });
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) => {
886
+ const u = document.createElement("div");
887
+ ne.push({ id: l, app: M, el: u }), M.mount(u);
888
+ }, We = (e) => {
889
+ ne.forEach((t) => {
942
890
  e === t.id && t.app.unmount();
943
891
  });
944
892
  };
945
- O.install = (e) => {
946
- const { name: t } = O;
947
- e.component(t, O), e.provide("dialog", Ge);
948
- };
893
+ const Je = B(te);
949
894
  export {
950
- Ge as createDialog,
951
- O as default
895
+ He as createDialog,
896
+ Je as default
952
897
  };