@keyblade/pro-components 1.13.8-alpha.9 → 1.14.0

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 (156) hide show
  1. package/es/components.d.ts +7 -0
  2. package/es/global-props.d.ts +20 -3
  3. package/es/global-props.js +6 -2
  4. package/es/index.d.ts +7 -0
  5. package/es/index.js +47 -28
  6. package/es/inerface.d.ts +5 -2
  7. package/es/pro-calendar/calendar.vue.d.ts +75 -0
  8. package/es/pro-calendar/calendar.vue.js +159 -0
  9. package/es/pro-calendar/calendar.vue3.js +5 -0
  10. package/es/pro-calendar/enum.d.ts +6 -0
  11. package/es/pro-calendar/enum.js +4 -0
  12. package/es/pro-calendar/header.vue.d.ts +35 -0
  13. package/es/pro-calendar/header.vue.js +146 -0
  14. package/es/pro-calendar/header.vue2.js +4 -0
  15. package/es/pro-calendar/hooks/useCellClassName.d.ts +12 -0
  16. package/es/pro-calendar/hooks/useCellClassName.js +40 -0
  17. package/es/pro-calendar/index.d.ts +117 -0
  18. package/es/pro-calendar/index.js +12 -0
  19. package/es/pro-calendar/interface.d.ts +89 -0
  20. package/es/pro-calendar/month.d.ts +5 -0
  21. package/es/pro-calendar/month.js +53 -0
  22. package/es/pro-calendar/month.vue.d.ts +22 -0
  23. package/es/pro-calendar/month.vue.js +126 -0
  24. package/es/pro-calendar/month.vue2.js +4 -0
  25. package/es/pro-calendar/week.vue.d.ts +3 -0
  26. package/es/pro-calendar/week.vue.js +34 -0
  27. package/es/pro-calendar/week.vue2.js +4 -0
  28. package/es/pro-calendar/year.vue.d.ts +3 -0
  29. package/es/pro-calendar/year.vue.js +123 -0
  30. package/es/pro-calendar/year.vue2.js +4 -0
  31. package/es/pro-date-range-picker/index.d.ts +183 -13
  32. package/es/pro-date-range-picker/index.js +6 -7
  33. package/es/pro-date-range-picker/interface.d.ts +38 -0
  34. package/es/pro-date-range-picker/pro-date-range-picker.vue.d.ts +173 -6
  35. package/es/pro-date-range-picker/pro-date-range-picker.vue.js +2 -2
  36. package/es/pro-date-range-picker/pro-date-range-picker.vue2.js +124 -104
  37. package/es/pro-dates-picker/index.d.ts +49 -0
  38. package/es/pro-dates-picker/index.js +11 -0
  39. package/es/pro-dates-picker/index.vue.d.ts +29 -0
  40. package/es/pro-dates-picker/index.vue.js +135 -0
  41. package/es/pro-dates-picker/index.vue3.js +5 -0
  42. package/es/pro-dates-picker/interface.d.ts +38 -0
  43. package/es/pro-dates-picker/util.d.ts +12 -0
  44. package/es/pro-dates-picker/util.js +9 -0
  45. package/es/pro-find-password/enum.d.ts +8 -0
  46. package/es/pro-find-password/enum.js +4 -0
  47. package/es/pro-find-password/index.d.ts +11 -0
  48. package/es/pro-find-password/index.js +11 -0
  49. package/es/pro-find-password/index.vue.d.ts +4459 -0
  50. package/es/pro-find-password/index.vue.js +176 -0
  51. package/es/pro-find-password/index.vue3.js +5 -0
  52. package/es/pro-find-password/interface.d.ts +45 -0
  53. package/es/pro-find-password/reset-password.vue.d.ts +591 -0
  54. package/es/pro-find-password/reset-password.vue.js +179 -0
  55. package/es/pro-find-password/reset-password.vue2.js +4 -0
  56. package/es/pro-find-password/verify-user-name.vue.d.ts +795 -0
  57. package/es/pro-find-password/verify-user-name.vue.js +112 -0
  58. package/es/pro-find-password/verify-user-name.vue3.js +5 -0
  59. package/es/pro-footer-bar/index.d.ts +6 -3
  60. package/es/pro-footer-bar/index.js +6 -7
  61. package/es/pro-footer-bar/index.vue.d.ts +1 -1
  62. package/es/pro-footer-bar/index.vue.js +2 -2
  63. package/es/pro-footer-bar/index.vue2.js +24 -26
  64. package/es/pro-footer-bar/{inerface.d.ts → interface.d.ts} +1 -0
  65. package/es/pro-form-group/index.d.ts +7 -6
  66. package/es/pro-form-group/index.js +6 -8
  67. package/es/pro-form-group/index.vue.d.ts +2 -2
  68. package/es/pro-form-group/index.vue.js +1 -1
  69. package/es/pro-form-group/index.vue2.js +31 -32
  70. package/es/pro-image-upload/cropper.vue.js +2 -2
  71. package/es/pro-image-upload/cropper.vue2.js +200 -190
  72. package/es/pro-image-upload/image-upload.vue.d.ts +1124 -371
  73. package/es/pro-image-upload/image-upload.vue.js +178 -144
  74. package/es/pro-image-upload/index.d.ts +1727 -1001
  75. package/es/pro-image-upload/index.js +6 -8
  76. package/es/pro-keep-alive-router-view/index.d.ts +1 -0
  77. package/es/pro-keep-alive-router-view/pro-keep-alive-router-view.vue.js +17 -18
  78. package/es/pro-layout/hooks.d.ts +80 -1
  79. package/es/pro-layout/hooks.js +133 -84
  80. package/es/pro-layout/index.d.ts +9 -6
  81. package/es/pro-layout/index.js +6 -11
  82. package/es/pro-layout/pro-layout.vue.d.ts +4 -2
  83. package/es/pro-layout/pro-layout.vue.js +220 -208
  84. package/es/pro-loader/index.d.ts +43 -0
  85. package/es/pro-loader/index.js +11 -0
  86. package/es/pro-loader/index.vue.d.ts +28 -0
  87. package/es/pro-loader/index.vue.js +112 -0
  88. package/es/pro-loader/index.vue3.js +5 -0
  89. package/es/pro-loader/interface.d.ts +16 -0
  90. package/es/pro-login/enum.d.ts +6 -0
  91. package/es/pro-login/enum.js +4 -0
  92. package/es/pro-login/form-mobile.vue.d.ts +797 -0
  93. package/es/pro-login/form-mobile.vue.js +146 -0
  94. package/es/pro-login/form-mobile.vue2.js +4 -0
  95. package/es/pro-login/form-password.vue.d.ts +584 -0
  96. package/es/pro-login/form-password.vue.js +99 -0
  97. package/es/pro-login/form-password.vue2.js +4 -0
  98. package/es/pro-login/index.d.ts +11 -0
  99. package/es/pro-login/index.js +11 -0
  100. package/es/pro-login/index.vue.d.ts +4429 -0
  101. package/es/pro-login/index.vue.js +105 -0
  102. package/es/pro-login/index.vue3.js +5 -0
  103. package/es/pro-login/interface.d.ts +72 -0
  104. package/es/pro-login/regexp.d.ts +17 -0
  105. package/es/pro-login/regexp.js +28 -0
  106. package/es/pro-menu/index.d.ts +18 -80
  107. package/es/pro-menu/index.js +6 -7
  108. package/es/pro-menu/interface.d.ts +31 -0
  109. package/es/pro-menu/menu-item.vue.d.ts +27 -0
  110. package/es/pro-menu/menu-item.vue.js +35 -0
  111. package/es/pro-menu/menu-item.vue2.js +4 -0
  112. package/es/pro-menu/pro-menu-item.vue.d.ts +9 -0
  113. package/es/pro-menu/pro-menu-item.vue.js +63 -0
  114. package/es/pro-menu/pro-menu-item.vue2.js +4 -0
  115. package/es/pro-menu/pro-menu.vue.d.ts +9 -55
  116. package/es/pro-menu/pro-menu.vue.js +36 -119
  117. package/es/pro-menu/sub-menu.vue.d.ts +22 -0
  118. package/es/pro-menu/sub-menu.vue.js +55 -0
  119. package/es/pro-menu/sub-menu.vue2.js +4 -0
  120. package/es/pro-menu/util.d.ts +9 -0
  121. package/es/pro-menu/util.js +7 -0
  122. package/es/pro-page-container/constant.d.ts +2 -0
  123. package/es/pro-page-container/constant.js +9 -0
  124. package/es/pro-page-container/index.d.ts +7 -21
  125. package/es/pro-page-container/index.js +6 -8
  126. package/es/pro-page-container/interface.d.ts +12 -0
  127. package/es/pro-page-container/pro-page-container.vue.d.ts +4 -15
  128. package/es/pro-page-container/pro-page-container.vue.js +58 -38
  129. package/es/pro-page-header/constant.d.ts +2 -0
  130. package/es/pro-page-header/constant.js +13 -0
  131. package/es/pro-page-header/index.d.ts +12 -146
  132. package/es/pro-page-header/index.js +6 -8
  133. package/es/pro-page-header/interface.d.ts +21 -0
  134. package/es/pro-page-header/pro-page-header.vue.d.ts +18 -103
  135. package/es/pro-page-header/pro-page-header.vue.js +141 -124
  136. package/es/pro-reuse-tabs/index.d.ts +8 -6
  137. package/es/pro-reuse-tabs/index.js +6 -7
  138. package/es/pro-reuse-tabs/pro-reuse-tabs.vue.d.ts +2 -2
  139. package/es/pro-reuse-tabs/pro-reuse-tabs.vue.js +33 -35
  140. package/es/pro-table/index.d.ts +18 -18
  141. package/es/pro-table/index.js +6 -7
  142. package/es/pro-table/index.vue.d.ts +6 -6
  143. package/es/pro-table/index.vue.js +94 -39
  144. package/es/pro-table/interface.d.ts +73 -65
  145. package/es/pro-textarea/index.d.ts +7 -5
  146. package/es/pro-textarea/index.js +5 -6
  147. package/es/pro-textarea/index.vue.d.ts +1 -1
  148. package/es/pro-textarea/index.vue.js +1 -1
  149. package/es/pro-textarea/index.vue2.js +14 -16
  150. package/es/pro-textarea/{inerface.d.ts → interface.d.ts} +19 -18
  151. package/es/style.css +1 -1
  152. package/es/utils.d.ts +6 -0
  153. package/es/utils.js +7 -0
  154. package/package.json +5 -4
  155. package/es/pro-date-range-picker/inerface.d.ts +0 -26
  156. package/es/pro-page-container/inerface.d.ts +0 -12
@@ -1,34 +1,62 @@
1
- import { defineComponent as he, mergeModels as Y, useSlots as Ie, useModel as xe, ref as m, computed as w, watch as Z, resolveComponent as Ue, createElementBlock as Ce, openBlock as N, createVNode as ye, createBlock as Be, createCommentVNode as we, normalizeClass as Ee, createSlots as Me, withCtx as A, unref as R, renderSlot as _ } from "vue";
2
- import { Message as g } from "@arco-design/web-vue";
3
- import { conclude as L } from "vue-global-config";
4
- import { EImageUploadInnerBeforeUploadStep as v } from "./types.js";
5
- import { defaultImageUploadOptions as U } from "./constant.js";
6
- import Se from "./cropper.vue.js";
7
- import { defaultImageUploadCheckOptions as be, defaultImageUploadCompressorOptions as Le, defaultImageUploadCropOptions as Oe, oneTravelImageCheckAndTransform as $e, oneTravelImageCompressor as ke } from "@keyblade/one-travel";
8
- const ze = "keyblade-pro-image-upload";
9
- var ee, ae, le;
10
- const qe = /* @__PURE__ */ he({
1
+ var ye = Object.defineProperty;
2
+ var le = Object.getOwnPropertySymbols;
3
+ var Ce = Object.prototype.hasOwnProperty, Be = Object.prototype.propertyIsEnumerable;
4
+ var oe = (s, c, u) => c in s ? ye(s, c, { enumerable: !0, configurable: !0, writable: !0, value: u }) : s[c] = u, Q = (s, c) => {
5
+ for (var u in c || (c = {}))
6
+ Ce.call(c, u) && oe(s, u, c[u]);
7
+ if (le)
8
+ for (var u of le(c))
9
+ Be.call(c, u) && oe(s, u, c[u]);
10
+ return s;
11
+ };
12
+ var L = (s, c, u) => new Promise((E, i) => {
13
+ var e = (v) => {
14
+ try {
15
+ x(u.next(v));
16
+ } catch (m) {
17
+ i(m);
18
+ }
19
+ }, j = (v) => {
20
+ try {
21
+ x(u.throw(v));
22
+ } catch (m) {
23
+ i(m);
24
+ }
25
+ }, x = (v) => v.done ? E(v.value) : Promise.resolve(v.value).then(e, j);
26
+ x((u = u.apply(s, c)).next());
27
+ });
28
+ import { defineComponent as we, mergeModels as ne, useSlots as be, useModel as Ee, ref as U, computed as O, watch as te, createElementBlock as Me, openBlock as ie, createVNode as Se, createBlock as Le, createCommentVNode as Oe, unref as z, normalizeClass as $e, createSlots as ke, withCtx as T, renderSlot as V, normalizeProps as ze, guardReactiveProps as je } from "vue";
29
+ import { Message as y, Upload as Pe } from "@arco-design/web-vue";
30
+ import { conclude as W } from "vue-global-config";
31
+ import { EImageUploadInnerBeforeUploadStep as I } from "./types.js";
32
+ import { defaultImageUploadOptions as b } from "./constant.js";
33
+ import Qe from "./cropper.vue.js";
34
+ import { defaultImageUploadCheckOptions as Te, defaultImageUploadCompressorOptions as Ve, defaultImageUploadCropOptions as We, oneTravelImageCheckAndTransform as Fe, oneTravelImageCompressor as He } from "@keyblade/one-travel";
35
+ const qe = "keyblade-pro-image-upload";
36
+ var re, ue, de;
37
+ const Ae = /* @__PURE__ */ we({
11
38
  __name: "image-upload",
12
- props: /* @__PURE__ */ Y({
39
+ props: /* @__PURE__ */ ne({
13
40
  action: {},
14
41
  handlerResponse: {},
15
42
  headers: {},
16
43
  data: {},
17
- name: { default: (ee = U) == null ? void 0 : ee.name },
44
+ name: { default: (re = b) == null ? void 0 : re.name },
18
45
  tip: {},
19
46
  accept: { default: () => {
20
- var C;
21
- return ((C = U) == null ? void 0 : C.accept) || [];
47
+ var s;
48
+ return ((s = b) == null ? void 0 : s.accept) || [];
22
49
  } },
23
- multiple: { type: Boolean, default: U.multiple },
24
- singleLimit: { default: U.singleLimit },
50
+ multiple: { type: Boolean, default: b.multiple },
51
+ singleLimit: { default: b.singleLimit },
25
52
  limit: {},
26
53
  exceedTip: {},
27
- disabled: { type: Boolean, default: (ae = U) == null ? void 0 : ae.disabled },
28
- hideInnerBeforeUploadLoading: { type: Boolean, default: (le = U) == null ? void 0 : le.hideInnerBeforeUploadLoading },
54
+ disabled: { type: Boolean, default: (ue = b) == null ? void 0 : ue.disabled },
55
+ hideInnerBeforeUploadLoading: { type: Boolean, default: (de = b) == null ? void 0 : de.hideInnerBeforeUploadLoading },
29
56
  checkOptions: {},
30
57
  compressorOptions: {},
31
58
  cropOptions: {},
59
+ cropModalIndex: {},
32
60
  onSuccess: {},
33
61
  onError: {},
34
62
  onExceed: {},
@@ -39,126 +67,126 @@ const qe = /* @__PURE__ */ he({
39
67
  modelValue: { required: !0 },
40
68
  modelModifiers: {}
41
69
  }),
42
- emits: /* @__PURE__ */ Y(["cropperImgLoad"], ["update:modelValue"]),
43
- setup(C, { expose: oe, emit: ne }) {
44
- const O = Ie(), u = xe(C, "modelValue"), e = C, te = ne, S = m(), $ = m(), p = m(), h = m([]), n = m(), c = m(), s = m(), ie = w(() => e.accept.map((a) => `.${a}`).join(",")), f = w(() => L([e.checkOptions, be]) || {}), y = w(() => L([e.compressorOptions, Le]) || {}), B = w(() => L([e.cropOptions, Oe]) || {}), re = (a) => {
45
- var i, d, t, r;
46
- const l = (r = (t = (d = (i = S.value) == null ? void 0 : i.$el) == null ? void 0 : d.querySelector) == null ? void 0 : t.call(d, "input")) == null ? void 0 : r.files;
47
- return l && l.length > 0 && (s.value = {
70
+ emits: /* @__PURE__ */ ne(["cropperImgLoad"], ["update:modelValue"]),
71
+ setup(s, { expose: c, emit: u }) {
72
+ const E = be(), i = Ee(s, "modelValue"), e = s, j = u, x = U(), v = U(), m = U(), C = U([]), n = U(), p = U(), g = U(), se = O(() => e.accept.map((a) => `.${a}`).join(",")), h = O(() => W([e.checkOptions, Te]) || {}), M = O(() => W([e.compressorOptions, Ve]) || {}), S = O(() => W([e.cropOptions, We]) || {}), ce = (a) => {
73
+ var t, f, d, r;
74
+ const l = (r = (d = (f = (t = x.value) == null ? void 0 : t.$el) == null ? void 0 : f.querySelector) == null ? void 0 : d.call(f, "input")) == null ? void 0 : r.files;
75
+ return l && l.length > 0 && (g.value = {
48
76
  selectCount: l.length
49
- }), e != null && e.onBeforeUpload ? e == null ? void 0 : e.onBeforeUpload(a) : s.value && (e != null && e.singleLimit) && s.value.selectCount > (e == null ? void 0 : e.singleLimit) ? (s.value.handleIndex === void 0 ? (s.value.handleIndex = 0, g.clear(), g.error(`单次最多可选择${e == null ? void 0 : e.singleLimit}张图片`)) : s.value.handleIndex += 1, s.value.handleIndex === s.value.selectCount - 1 && (s.value = void 0), !1) : new Promise(async (E, M) => {
77
+ }), e != null && e.onBeforeUpload ? e == null ? void 0 : e.onBeforeUpload(a) : g.value && (e != null && e.singleLimit) && g.value.selectCount > (e == null ? void 0 : e.singleLimit) ? (g.value.handleIndex === void 0 ? (g.value.handleIndex = 0, y.clear(), y.error(`单次最多可选择${e == null ? void 0 : e.singleLimit}张图片`)) : g.value.handleIndex += 1, g.value.handleIndex === g.value.selectCount - 1 && (g.value = void 0), !1) : new Promise(($, k) => L(null, null, function* () {
50
78
  try {
51
- E(await fe(a));
52
- } catch {
53
- M();
54
- } finally {
79
+ $(yield pe(a));
80
+ } catch (P) {
55
81
  k();
82
+ } finally {
83
+ F();
56
84
  }
57
- });
58
- }, ue = async (a) => {
59
- const l = u.value.findIndex((i) => i.uid === a.uid);
60
- return u.value.splice(l, 1), u.value = [...u.value], !1;
61
- }, de = (a, l) => {
62
- e != null && e.onExceed ? e == null || e.onExceed(a, l) : (g.error(e.exceedTip ?? `超过数量上限,最多上传${(e == null ? void 0 : e.limit) || 1}张`), u.value = a);
63
- }, se = async (a) => {
85
+ }));
86
+ }, fe = (a) => L(null, null, function* () {
87
+ const l = i.value.findIndex((t) => t.uid === a.uid);
88
+ return i.value.splice(l, 1), i.value = [...i.value], !1;
89
+ }), ve = (a, l) => {
90
+ var t;
91
+ e != null && e.onExceed ? e == null || e.onExceed(a, l) : (y.error((t = e.exceedTip) != null ? t : `超过数量上限,最多上传${(e == null ? void 0 : e.limit) || 1}张`), i.value = a);
92
+ }, me = (a) => L(null, null, function* () {
64
93
  if (e != null && e.onSuccess)
65
94
  e == null || e.onSuccess(a);
66
95
  else {
67
96
  if (!(e != null && e.handlerResponse))
68
97
  return;
69
- const l = await e.handlerResponse(a.response), i = u.value.findIndex((d) => d.uid === a.uid);
70
- l.success ? u.value[i] = {
71
- ...u.value[i],
72
- ...l
73
- } : u.value.splice(i, 1);
98
+ const l = yield e.handlerResponse(a.response), t = i.value.findIndex((f) => f.uid === a.uid);
99
+ l.success ? i.value[t] && (i.value[t] = Q(Q({}, i.value[t]), l)) : i.value.splice(t, 1);
74
100
  }
75
- }, ce = (a) => {
101
+ }), ge = (a) => {
76
102
  e != null && e.onError ? e == null || e.onError(a) : setTimeout(() => {
77
- const l = u.value.findIndex((i) => i.uid === a.uid);
78
- u.value.splice(l, 1);
103
+ const l = i.value.findIndex((t) => t.uid === a.uid);
104
+ i.value.splice(l, 1);
79
105
  });
80
- }, fe = (a) => new Promise((l, i) => {
81
- h.value.push({ file: a, resolve: l, reject: i }), h.value.length === 1 && !n.value && k();
82
- }), k = () => {
83
- n.value === void 0 ? n.value = 0 : n.value + 1 >= h.value.length ? (n.value = void 0, h.value = []) : n.value += 1;
84
- }, ve = () => {
106
+ }, pe = (a) => new Promise((l, t) => {
107
+ C.value.push({ file: a, resolve: l, reject: t }), C.value.length === 1 && !n.value && F();
108
+ }), F = () => {
109
+ n.value === void 0 ? n.value = 0 : n.value + 1 >= C.value.length ? (n.value = void 0, C.value = []) : n.value += 1;
110
+ }, he = () => {
85
111
  var a;
86
- (a = p.value) == null || a.reject();
87
- }, me = (a) => {
112
+ (a = m.value) == null || a.reject();
113
+ }, Ie = (a) => {
88
114
  var l;
89
- (l = p.value) == null || l.resolve(a);
90
- }, ge = (a) => {
91
- te("cropperImgLoad", a);
115
+ (l = m.value) == null || l.resolve(a);
116
+ }, xe = (a) => {
117
+ j("cropperImgLoad", a);
92
118
  };
93
- Z(n, async () => {
94
- var E, M, b, z, j, Q, T, V, W, F, H, P, q, D, G, J, K, X;
95
- if (n.value === void 0 || h.value.length === 0)
119
+ te(n, () => L(null, null, function* () {
120
+ var $, k, P, H, q, D, G, J, K, X, Y, Z, N, R, A, _, ee, ae;
121
+ if (n.value === void 0 || C.value.length === 0)
96
122
  return;
97
- const a = h.value[n.value], { file: l, resolve: i, reject: d } = a;
98
- let t = l.name, r = l;
99
- if ((E = f.value) != null && E.enable) {
100
- c.value = {
123
+ const a = C.value[n.value];
124
+ if (!a) return;
125
+ const { file: l, resolve: t, reject: f } = a;
126
+ let d = l.name, r = l;
127
+ if (($ = h.value) != null && $.enable) {
128
+ p.value = {
101
129
  loading: !0,
102
130
  text: `第${n.value + 1}张图片检测中,请稍等`
103
- }, (M = e == null ? void 0 : e.onInnerBeforeUploadStart) == null || M.call(
131
+ }, (k = e == null ? void 0 : e.onInnerBeforeUploadStart) == null || k.call(
104
132
  e,
105
133
  l,
106
134
  n.value,
107
- v.check
135
+ I.check
108
136
  );
109
- const o = await $e(l, l.name, {
110
- imageMaxSize: f.value.maxSize,
111
- imageAllowedType: f.value.allowedType,
112
- imageMinWidth: f.value.minWidth,
113
- imageMinHeight: f.value.minHeight,
114
- imageMaxWidth: f.value.maxWidth,
115
- imageMaxHeight: f.value.maxHeight
137
+ const o = yield Fe(l, l.name, {
138
+ imageMaxSize: h.value.maxSize,
139
+ imageAllowedType: h.value.allowedType,
140
+ imageMinWidth: h.value.minWidth,
141
+ imageMinHeight: h.value.minHeight,
142
+ imageMaxWidth: h.value.maxWidth,
143
+ imageMaxHeight: h.value.maxHeight
116
144
  });
117
- if (c.value = void 0, (b = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || b.call(
145
+ if (p.value = void 0, (P = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || P.call(
118
146
  e,
119
147
  l,
120
148
  n.value,
121
- v.check,
149
+ I.check,
122
150
  {
123
151
  success: o.success,
124
152
  error: o == null ? void 0 : o.error,
125
153
  errorMessage: o == null ? void 0 : o.errorMessage
126
154
  }
127
155
  ), !o.success)
128
- return (z = f.value) != null && z.showErrorMessage && g.error((o == null ? void 0 : o.errorMessage) || "图片校验及转换失败"), d();
156
+ return (H = h.value) != null && H.showErrorMessage && y.error((o == null ? void 0 : o.errorMessage) || "图片校验及转换失败"), f();
129
157
  if (o != null && o.hasTransform) {
130
- const x = t == null ? void 0 : t.split(".");
131
- x.pop(), t = `${x.join(",")}.jpg`, r = new File([o.file], t, {
158
+ const w = d == null ? void 0 : d.split(".");
159
+ w.pop(), d = `${w.join(",")}.jpg`, r = new File([o.file], d, {
132
160
  type: o.file.type
133
161
  });
134
162
  } else
135
163
  r = o.file;
136
164
  }
137
- if ((j = B.value) != null && j.enable && !((T = (Q = t == null ? void 0 : t.toLocaleLowerCase) == null ? void 0 : Q.call(t)) != null && T.endsWith(".gif"))) {
138
- (V = e == null ? void 0 : e.onInnerBeforeUploadStart) == null || V.call(
165
+ if ((q = S.value) != null && q.enable && !((G = (D = d == null ? void 0 : d.toLocaleLowerCase) == null ? void 0 : D.call(d)) != null && G.endsWith(".gif"))) {
166
+ (J = e == null ? void 0 : e.onInnerBeforeUploadStart) == null || J.call(
139
167
  e,
140
168
  l,
141
169
  n.value,
142
- v.crop
170
+ I.crop
143
171
  );
144
172
  try {
145
- (W = B.value) != null && W.customCrop ? r = await B.value.customCrop(r) : r = await new Promise((o, x) => {
146
- p.value = { file: r, resolve: o, reject: x };
147
- }), (F = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || F.call(
173
+ (K = S.value) != null && K.customCrop ? r = yield S.value.customCrop(r) : r = yield new Promise((o, w) => {
174
+ m.value = { file: r, resolve: o, reject: w };
175
+ }), (X = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || X.call(
148
176
  e,
149
177
  l,
150
178
  n.value,
151
- v.crop,
179
+ I.crop,
152
180
  {
153
181
  success: !1
154
182
  }
155
183
  );
156
- } catch {
157
- return (H = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || H.call(
184
+ } catch (o) {
185
+ return (Y = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || Y.call(
158
186
  e,
159
187
  l,
160
188
  n.value,
161
- v.crop,
189
+ I.crop,
162
190
  {
163
191
  success: !1,
164
192
  error: {
@@ -166,31 +194,31 @@ const qe = /* @__PURE__ */ he({
166
194
  },
167
195
  errorMessage: "图片剪裁失败"
168
196
  }
169
- ), (P = B.value) != null && P.showErrorMessage && g.error("图片剪裁失败"), d();
197
+ ), (Z = S.value) != null && Z.showErrorMessage && y.error("图片剪裁失败"), f();
170
198
  } finally {
171
- p.value = void 0;
199
+ m.value = void 0;
172
200
  }
173
201
  }
174
- if ((q = y.value) != null && q.enable) {
175
- c.value = {
202
+ if ((N = M.value) != null && N.enable) {
203
+ p.value = {
176
204
  loading: !0,
177
205
  text: `第${n.value + 1}张图片处理中,请稍等`
178
- }, (D = e == null ? void 0 : e.onInnerBeforeUploadStart) == null || D.call(
206
+ }, (R = e == null ? void 0 : e.onInnerBeforeUploadStart) == null || R.call(
179
207
  e,
180
208
  l,
181
209
  n.value,
182
- v.compress
210
+ I.compress
183
211
  );
184
- const o = await ke(r, {
185
- maxSize: y.value.maxSize,
186
- size: y.value.size,
187
- excludeAllowedTypes: (G = y.value.excludeAllowedTypes) == null ? void 0 : G.map((x) => `${x}`)
212
+ const o = yield He(r, {
213
+ maxSize: M.value.maxSize,
214
+ size: M.value.size,
215
+ excludeAllowedTypes: (A = M.value.excludeAllowedTypes) == null ? void 0 : A.map((w) => `${w}`)
188
216
  });
189
- if (c.value = void 0, (J = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || J.call(
217
+ if (p.value = void 0, (_ = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || _.call(
190
218
  e,
191
219
  l,
192
220
  n.value,
193
- v.compress,
221
+ I.compress,
194
222
  {
195
223
  success: o.success,
196
224
  error: {
@@ -199,95 +227,101 @@ const qe = /* @__PURE__ */ he({
199
227
  errorMessage: o == null ? void 0 : o.errorMessage
200
228
  }
201
229
  ), !o.success)
202
- return (K = y.value) != null && K.showErrorMessage && g.error((o == null ? void 0 : o.errorMessage) || "图片压缩失败"), d();
203
- r = new File([o.file], t, {
230
+ return (ee = M.value) != null && ee.showErrorMessage && y.error((o == null ? void 0 : o.errorMessage) || "图片压缩失败"), f();
231
+ r = new File([o.file], d, {
204
232
  type: o.file.type
205
233
  });
206
234
  }
207
- c.value = void 0, (X = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || X.call(
235
+ p.value = void 0, (ae = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || ae.call(
208
236
  e,
209
237
  l,
210
238
  n.value,
211
- v.all,
239
+ I.all,
212
240
  {
213
241
  success: !0
214
242
  }
215
- ), i(r);
216
- });
217
- let I;
218
- Z(
219
- () => c.value,
243
+ ), t(r);
244
+ }));
245
+ let B;
246
+ te(
247
+ () => p.value,
220
248
  () => {
221
249
  var a;
222
- c.value ? I = g.loading({
223
- content: c.value.text,
250
+ p.value ? B = y.loading({
251
+ content: p.value.text,
224
252
  id: "image-upload-id",
225
253
  duration: 0
226
- }) : (a = I == null ? void 0 : I.close) == null || a.call(I);
254
+ }) : (a = B == null ? void 0 : B.close) == null || a.call(B);
227
255
  }
228
256
  );
229
- const pe = w(() => u.value.every((a) => a.status && ["done", "error"].includes(a.status)));
230
- return oe({
231
- uploadInsRef: S,
232
- cropperInsRef: $,
233
- isUploadComplete: pe
257
+ const Ue = O(() => i.value.every((a) => a.status && ["done", "error"].includes(a.status)));
258
+ return c({
259
+ uploadInsRef: x,
260
+ cropperInsRef: v,
261
+ isUploadComplete: Ue
234
262
  }), (a, l) => {
235
- var d, t;
236
- const i = Ue("a-upload");
237
- return N(), Ce("div", null, [
238
- ye(i, {
239
- class: Ee([`${ze}-upload`]),
263
+ var t, f, d;
264
+ return ie(), Me("div", null, [
265
+ Se(z(Pe), {
266
+ class: $e([`${qe}-upload`]),
240
267
  ref_key: "uploadInsRef",
241
- ref: S,
268
+ ref: x,
242
269
  "list-type": "picture-card",
243
270
  tip: a.tip || "上传",
244
271
  "image-preview": "",
245
- "file-list": u.value,
246
- "onUpdate:fileList": l[0] || (l[0] = (r) => u.value = r),
272
+ "file-list": i.value,
273
+ "onUpdate:fileList": l[0] || (l[0] = (r) => i.value = r),
247
274
  action: a.action,
248
275
  headers: a.headers,
249
276
  data: a.data,
250
277
  name: a.name,
251
- accept: ie.value,
278
+ accept: se.value,
252
279
  multiple: a.multiple,
253
280
  limit: a.limit,
254
281
  disabled: a.disabled,
255
- "on-before-upload": re,
256
- "on-before-remove": ue,
257
- onExceedLimit: de,
258
- onSuccess: se,
259
- onError: ce
260
- }, Me({ _: 2 }, [
261
- (d = R(O)) != null && d.image ? {
282
+ "on-before-upload": ce,
283
+ "on-before-remove": fe,
284
+ onExceedLimit: ve,
285
+ onSuccess: me,
286
+ onError: ge
287
+ }, ke({ _: 2 }, [
288
+ (t = z(E)) != null && t.image ? {
262
289
  name: "image",
263
- fn: A(({ fileItem: r }) => [
264
- _(a.$slots, "image", { fileItem: r })
290
+ fn: T(({ fileItem: r }) => [
291
+ V(a.$slots, "image", { fileItem: r })
265
292
  ]),
266
293
  key: "0"
267
294
  } : void 0,
268
- (t = R(O)) != null && t["upload-button"] ? {
295
+ (f = z(E)) != null && f["upload-button"] ? {
269
296
  name: "upload-button",
270
- fn: A(() => [
271
- _(a.$slots, "upload-button")
297
+ fn: T(() => [
298
+ V(a.$slots, "upload-button")
272
299
  ]),
273
300
  key: "1"
301
+ } : void 0,
302
+ (d = z(E)) != null && d["extra-button"] ? {
303
+ name: "extra-button",
304
+ fn: T((r) => [
305
+ V(a.$slots, "extra-button", ze(je(r)))
306
+ ]),
307
+ key: "2"
274
308
  } : void 0
275
309
  ]), 1032, ["class", "tip", "file-list", "action", "headers", "data", "name", "accept", "multiple", "limit", "disabled"]),
276
- p.value && n.value !== void 0 ? (N(), Be(Se, {
310
+ m.value && n.value !== void 0 ? (ie(), Le(Qe, {
277
311
  key: 0,
278
312
  ref_key: "cropperInsRef",
279
- ref: $,
280
- file: p.value.file,
313
+ ref: v,
314
+ file: m.value.file,
281
315
  index: n.value,
282
- options: B.value,
283
- onCancel: ve,
284
- onConfirm: me,
285
- onImgLoad: ge
286
- }, null, 8, ["file", "index", "options"])) : we("", !0)
316
+ options: S.value,
317
+ onCancel: he,
318
+ onConfirm: Ie,
319
+ onImgLoad: xe
320
+ }, null, 8, ["file", "index", "options"])) : Oe("", !0)
287
321
  ]);
288
322
  };
289
323
  }
290
324
  });
291
325
  export {
292
- qe as default
326
+ Ae as default
293
327
  };