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.
Files changed (101) hide show
  1. package/README.md +1 -1
  2. package/libs/button/index.css +1 -579
  3. package/libs/button/index.mjs +66 -111
  4. package/libs/button/index.umd.js +2 -203
  5. package/libs/cell/index.css +1 -1077
  6. package/libs/cell/index.mjs +105 -168
  7. package/libs/cell/index.umd.js +2 -301
  8. package/libs/checkbox/index.css +1 -1053
  9. package/libs/checkbox/index.mjs +128 -243
  10. package/libs/checkbox/index.umd.js +2 -370
  11. package/libs/checkboxGroup/index.css +1 -422
  12. package/libs/checkboxGroup/index.mjs +88 -174
  13. package/libs/checkboxGroup/index.umd.js +2 -266
  14. package/libs/col/index.css +1 -615
  15. package/libs/col/index.mjs +82 -247
  16. package/libs/col/index.umd.js +2 -306
  17. package/libs/countdown/index.css +1 -417
  18. package/libs/countdown/index.mjs +72 -180
  19. package/libs/countdown/index.umd.js +2 -232
  20. package/libs/dialog/index.css +1 -1405
  21. package/libs/dialog/index.mjs +477 -647
  22. package/libs/dialog/index.umd.js +2 -1129
  23. package/libs/empty/index.css +1 -457
  24. package/libs/empty/index.mjs +45 -92
  25. package/libs/empty/index.umd.js +2 -140
  26. package/libs/form/index.css +1 -477
  27. package/libs/form/index.mjs +127 -227
  28. package/libs/form/index.umd.js +2 -320
  29. package/libs/formItem/index.css +1 -477
  30. package/libs/formItem/index.mjs +127 -277
  31. package/libs/formItem/index.umd.js +2 -373
  32. package/libs/icon/index.css +1 -982
  33. package/libs/icon/index.mjs +59 -108
  34. package/libs/icon/index.umd.js +2 -187
  35. package/libs/index.css +1 -2902
  36. package/libs/index.mjs +2348 -3789
  37. package/libs/index.umd.js +2 -5509
  38. package/libs/input/index.css +1 -483
  39. package/libs/input/index.mjs +93 -184
  40. package/libs/input/index.umd.js +2 -275
  41. package/libs/layout/index.css +1 -684
  42. package/libs/layout/index.mjs +130 -230
  43. package/libs/layout/index.umd.js +2 -318
  44. package/libs/list/index.css +1 -440
  45. package/libs/list/index.mjs +208 -389
  46. package/libs/list/index.umd.js +2 -572
  47. package/libs/loading/index.css +1 -548
  48. package/libs/loading/index.mjs +119 -197
  49. package/libs/loading/index.umd.js +2 -322
  50. package/libs/locale/index.mjs +28 -0
  51. package/libs/locale/index.umd.js +1 -0
  52. package/libs/locale/package.json +6 -0
  53. package/libs/mask/index.css +1 -426
  54. package/libs/mask/index.mjs +71 -132
  55. package/libs/mask/index.umd.js +2 -202
  56. package/libs/popup/index.css +1 -465
  57. package/libs/popup/index.mjs +135 -211
  58. package/libs/popup/index.umd.js +2 -359
  59. package/libs/progress/index.css +1 -488
  60. package/libs/progress/index.mjs +129 -201
  61. package/libs/progress/index.umd.js +2 -323
  62. package/libs/pullrefresh/index.css +1 -441
  63. package/libs/pullrefresh/index.mjs +112 -242
  64. package/libs/pullrefresh/index.umd.js +2 -303
  65. package/libs/row/index.css +1 -485
  66. package/libs/row/index.mjs +90 -182
  67. package/libs/row/index.umd.js +2 -238
  68. package/libs/slider/index.css +1 -558
  69. package/libs/slider/index.mjs +161 -357
  70. package/libs/slider/index.umd.js +2 -454
  71. package/libs/stepper/index.css +1 -489
  72. package/libs/stepper/index.mjs +102 -182
  73. package/libs/stepper/index.umd.js +2 -270
  74. package/libs/style/index.css +1 -0
  75. package/libs/style/index.mjs +1 -0
  76. package/libs/style/index.umd.js +2 -0
  77. package/libs/style/package.json +6 -0
  78. package/libs/swipe/index.css +1 -506
  79. package/libs/swipe/index.mjs +260 -543
  80. package/libs/swipe/index.umd.js +2 -704
  81. package/libs/swipeItem/index.css +1 -424
  82. package/libs/swipeItem/index.mjs +53 -112
  83. package/libs/swipeItem/index.umd.js +2 -155
  84. package/libs/switch/index.css +1 -472
  85. package/libs/switch/index.mjs +63 -122
  86. package/libs/switch/index.umd.js +2 -201
  87. package/libs/tab/index.mjs +69 -132
  88. package/libs/tab/index.umd.js +1 -191
  89. package/libs/tabs/index.css +1 -514
  90. package/libs/tabs/index.mjs +411 -752
  91. package/libs/tabs/index.umd.js +2 -1021
  92. package/libs/toast/index.css +1 -1050
  93. package/libs/toast/index.mjs +115 -184
  94. package/libs/toast/index.umd.js +2 -307
  95. package/libs/tooltip/index.css +1 -514
  96. package/libs/tooltip/index.mjs +156 -294
  97. package/libs/tooltip/index.umd.js +2 -417
  98. package/libs/utils/index.mjs +76 -0
  99. package/libs/utils/index.umd.js +1 -0
  100. package/libs/utils/package.json +6 -0
  101. package/package.json +1 -4
@@ -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 tagTester = (name2) => {
3
- return (obj) => {
4
- return Object.prototype.toString.call(obj) === `[object ${name2}]`;
5
- };
6
- };
7
- const isFunction = tagTester("Function");
8
- const isPromise = tagTester("Promise");
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
- ref("zh-CN");
57
- reactive({
58
- "zh-CN": defaultLang
20
+ E("zh-CN");
21
+ U({
22
+ "zh-CN": ke
59
23
  });
60
- const createNamespace = (name2) => {
61
- const prefixedName = `y-${name2}`;
62
- return [prefixedName, createBEM(prefixedName), createGlobalBem()];
63
- };
64
- const parseUnit = (val) => {
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: false
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: true
69
+ default: !0
115
70
  },
116
71
  onAfterLeave: {
117
72
  type: Function,
118
73
  default: null
119
74
  }
120
- };
121
- const stack = reactive([]);
122
- let num$1 = 0;
123
- const Mask = /* @__PURE__ */ defineComponent({
124
- name: name$4,
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(props, {
128
- slots
81
+ setup(e, {
82
+ slots: t
129
83
  }) {
130
- const id = ref("");
131
- onMounted(() => {
132
- id.value = `mask${num$1}`;
133
- num$1 += 1;
134
- stackIntercept(props.modelValue, true);
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
- onUnmounted(() => {
137
- const index = stack.findIndex((v) => v._id === id.value);
138
- index >= 0 && stack.splice(index, 1);
139
- });
140
- watch(() => props.modelValue, (val) => {
141
- stackIntercept(val);
142
- });
143
- const stackIntercept = (val, isMounted) => {
144
- if (val) {
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
- } = props;
174
- if (lockScroll) {
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
- } = props;
187
- const {
188
- _state
189
- } = find();
190
- return createVNode(Transition, {
191
- "name": gBem$2("animation", "fade"),
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 _a;
196
- return [withDirectives(createVNode("div", {
197
- "style": {
198
- animationDuration: `${duration}ms`,
199
- zIndex,
200
- ...customStyle
126
+ var o;
127
+ return [P(r("div", {
128
+ style: {
129
+ animationDuration: `${i}ms`,
130
+ zIndex: p,
131
+ ...g
201
132
  },
202
- "class": [bem$5(), customClass],
203
- "onTouchmove": onTouchMove
204
- }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]), [[vShow, _state]])];
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
- const reset = "";
211
- const libs = "";
212
- const font = "";
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 [name$3, bem$4, gBem$1] = createNamespace("popup");
221
- const _props$2 = {
145
+ const [_e, Z, Ve] = w("popup"), Ae = {
222
146
  // 控制显示
223
147
  modelValue: {
224
148
  type: Boolean,
225
- default: false
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: true
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: true
192
+ default: !0
269
193
  },
270
194
  zIndex: {
271
195
  type: Number,
272
196
  default: 101
273
197
  }
274
- };
275
- const Popup = /* @__PURE__ */ defineComponent({
276
- name: name$3,
277
- props: _props$2,
198
+ }, L = /* @__PURE__ */ x({
199
+ name: _e,
200
+ props: Ae,
278
201
  emits: ["clickMask", "update:modelValue"],
279
- setup(props, {
280
- slots,
281
- emit
202
+ setup(e, {
203
+ slots: t,
204
+ emit: l
282
205
  }) {
283
- const style2 = computed(() => {
206
+ const a = F(() => {
284
207
  const {
285
- position,
286
- borderRadius,
287
- customStyle,
288
- duration
289
- } = props;
290
- const tbR = parseUnit(borderRadius);
291
- let br = `0`;
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
- br = ` 0 0 ${tbR} ${tbR}`;
216
+ d = ` 0 0 ${c} ${c}`;
295
217
  break;
296
218
  case "bottom":
297
- br = `${tbR} ${tbR} 0 0`;
219
+ d = `${c} ${c} 0 0`;
298
220
  break;
299
221
  case "left":
300
- br = `0 ${tbR} ${tbR} 0`;
222
+ d = `0 ${c} ${c} 0`;
301
223
  break;
302
224
  case "right":
303
- br = `${tbR} 0 0 ${tbR}`;
225
+ d = `${c} 0 0 ${c}`;
304
226
  break;
305
227
  default:
306
- br = `${tbR}`;
228
+ d = `${c}`;
307
229
  }
308
230
  return {
309
- borderRadius: br,
310
- animationDuration: `${duration}ms`,
311
- ...customStyle
231
+ borderRadius: d,
232
+ animationDuration: `${g}ms`,
233
+ ...p
312
234
  };
313
- });
314
- const onClickMask = (event) => {
315
- emit("clickMask", event);
316
- if (props.isCloseOnClickMask) {
317
- visible.value = false;
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
- } = props;
334
- return createVNode(Teleport, {
335
- "to": teleport
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: () => [createVNode("div", {
338
- "class": bem$4(),
339
- "style": {
340
- zIndex
254
+ default: () => [r("div", {
255
+ class: Z(),
256
+ style: {
257
+ zIndex: o
341
258
  }
342
- }, [createVNode(Mask, {
343
- "modelValue": visible.value,
344
- "onUpdate:modelValue": ($event) => visible.value = $event,
345
- "duration": duration,
346
- "lockScroll": lockScroll,
347
- "onClick": onClickMask,
348
- "onAfterLeave": onAfterLeave
349
- }, null), createVNode(Transition, {
350
- "name": gBem$1("animation", `slide-${position}`)
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 _a;
354
- return [withDirectives(createVNode("div", {
355
- "style": style2.value,
356
- "class": [bem$4("content", {
357
- [position]: position
358
- }), customClass]
359
- }, [((_a = slots.default) == null ? void 0 : _a.call(slots)) || null]), [[vShow, visible.value]])];
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
- const style$4 = "";
367
- Popup.install = (app) => {
368
- const { name: name2 } = Popup;
369
- app.component(name2, Popup);
283
+ L.install = (e) => {
284
+ const { name: t } = L;
285
+ e.component(t, L);
370
286
  };
371
- const [cname, bem$3] = createNamespace("icon");
372
- const isImage = (name2) => {
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: false
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(props, {
425
- slots,
426
- emit
335
+ setup(e, {
336
+ slots: t,
337
+ emit: l
427
338
  }) {
428
- const isImg = isImage(props.name);
429
- const getStyle = () => ({
430
- fontSize: parseUnit(props.size),
431
- color: props.color
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: name2,
439
- classPrefix,
440
- badge,
441
- dot,
442
- subColor,
443
- subBg,
444
- tag: Tag
445
- } = props;
446
- return createVNode(Tag, {
447
- "class": `${classPrefix}${isImg ? "" : ` y-icon--${name2}`}`,
448
- "style": getStyle(),
449
- "onClick": onClick
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 _a;
453
- return [isImg ? createVNode("em", {
454
- "class": bem$3("node")
455
- }, [createVNode("img", {
456
- "class": bem$3("image"),
457
- "src": name2,
458
- "alt": "icon"
459
- }, null)]) : null, dot ? createVNode("em", {
460
- "class": bem$3("dot"),
461
- "style": {
462
- backgroundColor: subBg
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, badge ? createVNode("em", {
465
- "class": bem$3("badge"),
466
- "style": {
467
- color: subColor,
468
- backgroundColor: subBg
373
+ }, null) : null, p ? r("em", {
374
+ class: z("badge"),
375
+ style: {
376
+ color: c,
377
+ backgroundColor: d
469
378
  }
470
- }, [badge]) : null, ((_a = slots.default) == null ? void 0 : _a.call(slots)) || null];
379
+ }, [p]) : null, ((u = t.default) == null ? void 0 : u.call(t)) || null];
471
380
  }
472
381
  });
473
382
  };
474
383
  }
475
384
  });
476
- const style$3 = "";
477
- Icon.install = (app) => {
478
- const { name: name2 } = Icon;
479
- app.component(name2, Icon);
385
+ M.install = (e) => {
386
+ const { name: t } = M;
387
+ e.component(t, M);
480
388
  };
481
- const [name$2, bem$2, gBem] = createNamespace("button");
482
- const Button = /* @__PURE__ */ defineComponent({
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: false
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: false
425
+ default: !1
519
426
  },
520
427
  // 半圆弧
521
428
  semicircle: {
522
429
  type: Boolean,
523
- default: false
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: false
445
+ default: !1
539
446
  },
540
447
  // 危险按钮状态
541
448
  danger: {
542
449
  type: Boolean,
543
- default: false
450
+ default: !1
544
451
  }
545
452
  },
546
453
  emits: ["click"],
547
- setup(props, {
548
- slots,
549
- emit
454
+ setup(e, {
455
+ slots: t,
456
+ emit: l
550
457
  }) {
551
- const onClick = (event) => {
552
- emit("click", event);
458
+ const a = (s) => {
459
+ l("click", s);
553
460
  };
554
461
  return () => {
555
462
  let {
556
- tag: Tag
557
- } = props;
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
- } = props;
571
- const showText = slots.default ? slots.default() : text;
572
- Tag = type === "link" ? "a" : Tag;
573
- return createVNode(Tag, {
574
- "class": [bem$2([type, size, {
575
- block,
576
- square,
577
- semicircle,
578
- disabled: disabled && Tag === "a"
579
- }, (type === "primary" || type === "secondary") && shadow ? `shadow_${shadow}` : "", danger ? `${type}_danger` : "", disabled ? `${type}_disabled` : ""]), gBem("el", "clickable")],
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
- "disabled": disabled,
584
- "onClick": onClick
488
+ disabled: p,
489
+ onClick: a
585
490
  }, {
586
491
  default: () => {
587
- var _a, _b;
588
- return [createVNode("div", {
589
- "class": bem$2("content")
590
- }, [((_a = slots.leftIcon) == null ? void 0 : _a.call(slots)) || null, showText && createVNode(Fragment, null, [supplementText ? createVNode("div", {
591
- "class": bem$2("text")
592
- }, [createVNode("p", null, [showText]), createVNode("p", {
593
- "class": bem$2("subtext")
594
- }, [supplementText])]) : createVNode("span", {
595
- "class": bem$2("text")
596
- }, [showText])]), ((_b = slots.rightIcon) == null ? void 0 : _b.call(slots)) || null])];
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
- const style$2 = "";
603
- Button.install = (app) => {
604
- const { name: name2 } = Button;
605
- app.component(name2, Button);
507
+ _.install = (e) => {
508
+ const { name: t } = _;
509
+ e.component(t, _);
606
510
  };
607
- const [name$1, bem$1] = createNamespace("loading");
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
- const Loading = /* @__PURE__ */ defineComponent({
669
- name: name$1,
670
- props: _props$1,
671
- setup(props, {
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 _a, _b;
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
- } = props;
690
- const showText = ((_a = slots.default) == null ? void 0 : _a.call(slots)) || text;
691
- return createVNode("div", {
692
- "class": bem$1({
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
- }, [createVNode("div", {
696
- "class": bem$1("bg", {
697
- [position]: position !== "relative"
596
+ }, [r("div", {
597
+ class: C("bg", {
598
+ [l]: l !== "relative"
698
599
  }),
699
- "style": {
700
- flexDirection: parseFlexDirection(textLocation),
701
- backgroundColor: bgColor,
702
- borderRadius: parseUnit(bgBorderRadius),
703
- padding: parseUnit(padding)
600
+ style: {
601
+ flexDirection: Ce(a),
602
+ backgroundColor: s,
603
+ borderRadius: m(f),
604
+ padding: m(i)
704
605
  }
705
- }, [createVNode("span", {
706
- "class": bem$1("icon-wrapper"),
707
- "style": {
708
- width: parseUnit(size),
709
- height: parseUnit(size)
606
+ }, [r("span", {
607
+ class: C("icon-wrapper"),
608
+ style: {
609
+ width: m(n),
610
+ height: m(n)
710
611
  }
711
- }, [((_b = slots.icon) == null ? void 0 : _b.call(slots)) || createVNode("svg", {
712
- "class": bem$1("icon", {
713
- [direction]: direction
612
+ }, [(($ = t.icon) == null ? void 0 : $.call(t)) || r("svg", {
613
+ class: C("icon", {
614
+ [c]: c
714
615
  }),
715
- "viewBox": "25 25 50 50"
716
- }, [createVNode("circle", {
717
- "class": bem$1("icon-circle"),
718
- "style": {
719
- stroke: color,
720
- strokeWidth: parseUnit(thick)
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
- "cx": "50",
723
- "cy": "50",
724
- "r": "20",
725
- "fill": "none"
726
- }, null)])]), showText && createVNode("span", {
727
- "class": bem$1("text", {
728
- [textLocation]: textLocation
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
- "style": {
731
- color: textColor,
732
- fontSize: parseUnit(textSize)
631
+ style: {
632
+ color: o,
633
+ fontSize: m(u)
733
634
  }
734
- }, [showText])])]);
635
+ }, [b])])]);
735
636
  };
736
637
  }
737
- });
738
- const globalOptions = {
638
+ }), Pe = {
739
639
  position: "fixed"
740
640
  };
741
- let instance = null;
742
- const initInstance = (customProps, customSlots) => {
743
- const wrapper = {
744
- render: () => {
745
- return h(Loading, { ...customProps }, { ...customSlots });
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: (customProps, customSlots) => {
759
- if (!instance)
760
- instance = initInstance(
761
- {
762
- ...globalOptions,
763
- ...customProps
764
- },
765
- customSlots
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
- instance && instance.$el.remove();
668
+ N && N.$el.remove();
776
669
  }
777
- };
778
- const toggleLoading = (el, binding) => {
779
- if (binding.value) {
780
- el.classList.add("y-loading__wrap");
781
- el.appendChild(el.instance.$el);
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
- const loadingDirective = {
788
- install: (app) => {
789
- app.directive("loading", directive);
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
- mounted: (el, binding) => {
799
- el.instance = initInstance({ ...el.customProps }, { ...el.customSlots });
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: (el) => {
808
- el.instance && el.instance.$el.remove();
684
+ unmounted: (e) => {
685
+ e.instance && e.instance.$el.remove();
809
686
  }
810
- };
811
- const directiveProps = {
812
- getSSRProps: (binding) => {
813
- return { ...binding };
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
- const directiveSlots = {
820
- getSSRProps: (binding) => {
821
- return { ...binding };
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
- const style$1 = "";
828
- Loading.install = (app) => {
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 _isSlot(s) {
834
- return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
701
+ function Ee(e) {
702
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !be(e);
835
703
  }
836
- const [name, bem] = createNamespace("dialog");
837
- const _props = {
704
+ const [Ue, v] = w("dialog"), qe = {
838
705
  // 控制显示
839
706
  modelValue: {
840
707
  type: Boolean,
841
- default: false
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: true
732
+ default: !0
866
733
  },
867
734
  showCloseIcon: {
868
735
  type: Boolean,
869
- default: false
736
+ default: !1
870
737
  },
871
738
  showCancelBtn: {
872
739
  type: Boolean,
873
- default: false
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: false
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: false
768
+ default: !1
902
769
  },
903
770
  // 插入对象
904
771
  teleport: {
905
772
  type: String,
906
773
  default: "body"
907
774
  }
908
- };
909
- const Dialog = /* @__PURE__ */ defineComponent({
910
- name,
775
+ }, O = /* @__PURE__ */ x({
776
+ name: Ue,
911
777
  directives: {
912
- loading: directive
778
+ loading: re
913
779
  },
914
- props: _props,
780
+ props: qe,
915
781
  emits: ["update:modelValue", "cancel", "confirm"],
916
- setup(props, {
917
- emit,
918
- slots
782
+ setup(e, {
783
+ emit: t,
784
+ slots: l
919
785
  }) {
920
- const loading = reactive({
921
- cancel: false,
922
- confirm: false
923
- });
924
- const update = (value) => {
925
- visible.value = value;
926
- };
927
- const onClose = (actionType) => {
928
- var _a;
929
- update(false);
930
- (_a = props.callback) == null ? void 0 : _a.call(props, actionType);
931
- };
932
- const onCancel = (event) => {
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
- } = props;
943
- if (!modelValue)
944
- return;
945
- if (isFunction(beforeClose)) {
946
- loading[actionType] = true;
947
- const fnReturn = beforeClose(actionType);
948
- if (isPromise(fnReturn)) {
949
- const promise = fnReturn;
950
- promise.then((value) => {
951
- done(value, actionType);
952
- }).catch((e) => {
953
- throw new Error(e);
954
- });
955
- } else {
956
- done(fnReturn, actionType);
957
- }
958
- } else {
959
- onClose(actionType);
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
- } = props;
996
- return createVNode(Popup, mergeProps({
997
- "modelValue": visible.value,
998
- "onUpdate:modelValue": ($event) => visible.value = $event,
999
- "customClass": bem(),
1000
- "customStyle": {
1001
- width: parseUnit(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": update
848
+ "onUpdate:modelValue": s
1005
849
  }, {
1006
- "isCloseOnClickMask": isCloseOnClickMask,
1007
- "teleport": teleport
850
+ isCloseOnClickMask: h,
851
+ teleport: se
1008
852
  }), {
1009
853
  default: () => {
1010
- var _a, _b, _c, _d;
1011
- return [((_a = slots.img) == null ? void 0 : _a.call(slots)) || imgSrc && createVNode("div", {
1012
- "class": bem("img", {
1013
- circle: circleImg
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
- "style": {
1016
- top: circleImg ? `-${halfOfWidth(parseUnit(width), 4)}` : "auto",
1017
- left: circleImg ? `calc(50% - ${halfOfWidth(parseUnit(width), 4)})` : "auto"
859
+ style: {
860
+ top: k ? `-${c(m(o), 4)}` : "auto",
861
+ left: k ? `calc(50% - ${c(m(o), 4)})` : "auto"
1018
862
  }
1019
- }, [createVNode("div", {
1020
- "style": {
1021
- width: circleImg ? halfOfWidth(parseUnit(width)) : parseUnit(width),
1022
- height: halfOfWidth(parseUnit(width)),
1023
- background: `url(${imgSrc}) center`,
1024
- borderRadius: circleImg ? "50%" : "20px 20px 0 0"
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)]), createVNode("div", {
1027
- "class": bem("container")
1028
- }, [createVNode("div", {
1029
- "style": {
1030
- height: circleImg ? halfOfWidth(parseUnit(width), 4, (num2) => {
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), ((_b = slots.title) == null ? void 0 : _b.call(slots)) || createVNode("div", {
1035
- "class": bem("title"),
1036
- "style": {
1037
- textAlign: titleAlign
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
- }, [title]), createVNode("div", {
1040
- "class": bem("content")
1041
- }, [createVNode("div", {
1042
- "class": bem("message"),
1043
- "style": {
1044
- textAlign: messageAlign
881
+ }, [u]), r("div", {
882
+ class: v("content")
883
+ }, [r("div", {
884
+ class: v("message"),
885
+ style: {
886
+ textAlign: $
1045
887
  }
1046
- }, [((_c = slots.default) == null ? void 0 : _c.call(slots)) || message]), ((_d = slots.footer) == null ? void 0 : _d.call(slots)) || createVNode("div", {
1047
- "class": bem("footer"),
1048
- "style": {
1049
- paddingTop: showCancelBtn || showConfirmBtn ? "20px" : "0px"
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
- }, [showCancelBtn && withDirectives(createVNode(Button, {
1052
- "type": "secondary",
1053
- "class": bem("footer-btn"),
1054
- "onClick": onCancel
1055
- }, _isSlot(cancelButtonText) ? cancelButtonText : {
1056
- default: () => [cancelButtonText]
1057
- }), [[resolveDirective("loading"), loading.cancel]]), showConfirmBtn && withDirectives(createVNode(Button, {
1058
- "type": "primary",
1059
- "class": bem("footer-btn"),
1060
- "onClick": onConfirm
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: () => [loading.confirm ? "" : confirmButtonText]
1063
- }), [[resolveDirective("loading"), loading.confirm]])])]), showCloseIcon && createVNode("div", {
1064
- "class": bem("close"),
1065
- "onClick": () => onClose("close")
1066
- }, [createVNode(Icon, {
1067
- "name": "cross"
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 dialogApp = createApp({});
1075
- let num = 0;
1076
- const treasures = [];
1077
- const createDialog = (customProps, customSlots) => {
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 show = ref(true);
1082
- const toggle = (val) => {
1083
- show.value = val;
921
+ const f = E(!0), n = (i) => {
922
+ f.value = i;
1084
923
  };
1085
- return () => {
1086
- return h(
1087
- Dialog,
1088
- {
1089
- modelValue: show.value,
1090
- "onUpdate:modelValue": toggle,
1091
- ...customProps,
1092
- onAfterLeave: () => {
1093
- close(id);
1094
- }
1095
- },
1096
- { ...customSlots }
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
- const style = "";
1114
- Dialog.install = (app) => {
1115
- const { name: name2 } = Dialog;
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
- Dialog as default
950
+ O as Dialog,
951
+ Ge as createDialog,
952
+ O as default
1123
953
  };