@keyblade/pro-components 1.13.8-alpha.4 → 1.13.8-alpha.40

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 (152) hide show
  1. package/es/components.d.ts +7 -0
  2. package/es/global-props.d.ts +18 -2
  3. package/es/index.d.ts +7 -0
  4. package/es/index.js +48 -30
  5. package/es/inerface.d.ts +5 -1
  6. package/es/pro-calendar/calendar.vue.d.ts +75 -0
  7. package/es/pro-calendar/calendar.vue.js +159 -0
  8. package/es/pro-calendar/calendar.vue3.js +5 -0
  9. package/es/pro-calendar/enum.d.ts +6 -0
  10. package/es/pro-calendar/enum.js +4 -0
  11. package/es/pro-calendar/header.vue.d.ts +35 -0
  12. package/es/pro-calendar/header.vue.js +146 -0
  13. package/es/pro-calendar/header.vue2.js +4 -0
  14. package/es/pro-calendar/hooks/useCellClassName.d.ts +12 -0
  15. package/es/pro-calendar/hooks/useCellClassName.js +40 -0
  16. package/es/pro-calendar/index.d.ts +117 -0
  17. package/es/pro-calendar/index.js +12 -0
  18. package/es/pro-calendar/interface.d.ts +89 -0
  19. package/es/pro-calendar/month.d.ts +5 -0
  20. package/es/pro-calendar/month.js +53 -0
  21. package/es/pro-calendar/month.vue.d.ts +22 -0
  22. package/es/pro-calendar/month.vue.js +126 -0
  23. package/es/pro-calendar/month.vue2.js +4 -0
  24. package/es/pro-calendar/week.vue.d.ts +3 -0
  25. package/es/pro-calendar/week.vue.js +34 -0
  26. package/es/pro-calendar/week.vue2.js +4 -0
  27. package/es/pro-calendar/year.vue.d.ts +3 -0
  28. package/es/pro-calendar/year.vue.js +123 -0
  29. package/es/pro-calendar/year.vue2.js +4 -0
  30. package/es/pro-date-range-picker/index.d.ts +183 -13
  31. package/es/pro-date-range-picker/interface.d.ts +38 -0
  32. package/es/pro-date-range-picker/pro-date-range-picker.vue.d.ts +173 -6
  33. package/es/pro-date-range-picker/pro-date-range-picker.vue.js +1 -1
  34. package/es/pro-date-range-picker/pro-date-range-picker.vue2.js +127 -97
  35. package/es/pro-dates-picker/index.d.ts +49 -0
  36. package/es/pro-dates-picker/index.js +13 -0
  37. package/es/pro-dates-picker/index.vue.d.ts +29 -0
  38. package/es/pro-dates-picker/index.vue.js +135 -0
  39. package/es/pro-dates-picker/index.vue3.js +5 -0
  40. package/es/pro-dates-picker/interface.d.ts +38 -0
  41. package/es/pro-dates-picker/util.d.ts +12 -0
  42. package/es/pro-dates-picker/util.js +9 -0
  43. package/es/pro-find-password/enum.d.ts +8 -0
  44. package/es/pro-find-password/enum.js +4 -0
  45. package/es/pro-find-password/index.d.ts +11 -0
  46. package/es/pro-find-password/index.js +12 -0
  47. package/es/pro-find-password/index.vue.d.ts +4459 -0
  48. package/es/pro-find-password/index.vue.js +176 -0
  49. package/es/pro-find-password/index.vue3.js +5 -0
  50. package/es/pro-find-password/interface.d.ts +45 -0
  51. package/es/pro-find-password/reset-password.vue.d.ts +591 -0
  52. package/es/pro-find-password/reset-password.vue.js +179 -0
  53. package/es/pro-find-password/reset-password.vue2.js +4 -0
  54. package/es/pro-find-password/verify-user-name.vue.d.ts +795 -0
  55. package/es/pro-find-password/verify-user-name.vue.js +112 -0
  56. package/es/pro-find-password/verify-user-name.vue3.js +5 -0
  57. package/es/pro-footer-bar/index.d.ts +6 -3
  58. package/es/pro-footer-bar/index.vue.d.ts +1 -1
  59. package/es/pro-footer-bar/index.vue.js +2 -2
  60. package/es/pro-footer-bar/index.vue2.js +24 -26
  61. package/es/pro-form-group/index.d.ts +44 -0
  62. package/es/pro-form-group/index.js +12 -0
  63. package/es/pro-form-group/index.vue.d.ts +28 -0
  64. package/es/pro-form-group/index.vue.js +7 -0
  65. package/es/pro-form-group/index.vue2.js +42 -0
  66. package/es/pro-image-upload/cropper.vue.js +2 -2
  67. package/es/pro-image-upload/cropper.vue2.js +200 -190
  68. package/es/pro-image-upload/image-upload.vue.d.ts +1123 -371
  69. package/es/pro-image-upload/image-upload.vue.js +172 -145
  70. package/es/pro-image-upload/index.d.ts +1726 -1001
  71. package/es/pro-image-upload/index.js +1 -1
  72. package/es/pro-keep-alive-router-view/index.d.ts +1 -0
  73. package/es/pro-keep-alive-router-view/pro-keep-alive-router-view.vue.js +17 -18
  74. package/es/pro-layout/hooks.d.ts +80 -1
  75. package/es/pro-layout/hooks.js +133 -84
  76. package/es/pro-layout/index.d.ts +9 -6
  77. package/es/pro-layout/index.js +1 -1
  78. package/es/pro-layout/pro-layout.vue.d.ts +4 -2
  79. package/es/pro-layout/pro-layout.vue.js +220 -208
  80. package/es/pro-loader/index.d.ts +43 -0
  81. package/es/pro-loader/index.js +11 -0
  82. package/es/pro-loader/index.vue.d.ts +28 -0
  83. package/es/pro-loader/index.vue.js +112 -0
  84. package/es/pro-loader/index.vue3.js +5 -0
  85. package/es/pro-loader/interface.d.ts +16 -0
  86. package/es/pro-login/enum.d.ts +6 -0
  87. package/es/pro-login/enum.js +4 -0
  88. package/es/pro-login/form-mobile.vue.d.ts +797 -0
  89. package/es/pro-login/form-mobile.vue.js +146 -0
  90. package/es/pro-login/form-mobile.vue2.js +4 -0
  91. package/es/pro-login/form-password.vue.d.ts +584 -0
  92. package/es/pro-login/form-password.vue.js +99 -0
  93. package/es/pro-login/form-password.vue2.js +4 -0
  94. package/es/pro-login/index.d.ts +11 -0
  95. package/es/pro-login/index.js +12 -0
  96. package/es/pro-login/index.vue.d.ts +4429 -0
  97. package/es/pro-login/index.vue.js +105 -0
  98. package/es/pro-login/index.vue3.js +5 -0
  99. package/es/pro-login/interface.d.ts +72 -0
  100. package/es/pro-login/regexp.d.ts +17 -0
  101. package/es/pro-login/regexp.js +28 -0
  102. package/es/pro-menu/index.d.ts +18 -80
  103. package/es/pro-menu/interface.d.ts +31 -0
  104. package/es/pro-menu/menu-item.vue.d.ts +27 -0
  105. package/es/pro-menu/menu-item.vue.js +35 -0
  106. package/es/pro-menu/menu-item.vue2.js +4 -0
  107. package/es/pro-menu/pro-menu-item.vue.d.ts +9 -0
  108. package/es/pro-menu/pro-menu-item.vue.js +63 -0
  109. package/es/pro-menu/pro-menu-item.vue2.js +4 -0
  110. package/es/pro-menu/pro-menu.vue.d.ts +9 -55
  111. package/es/pro-menu/pro-menu.vue.js +36 -119
  112. package/es/pro-menu/sub-menu.vue.d.ts +22 -0
  113. package/es/pro-menu/sub-menu.vue.js +55 -0
  114. package/es/pro-menu/sub-menu.vue2.js +4 -0
  115. package/es/pro-menu/util.d.ts +9 -0
  116. package/es/pro-menu/util.js +7 -0
  117. package/es/pro-page-container/constant.d.ts +2 -0
  118. package/es/pro-page-container/constant.js +9 -0
  119. package/es/pro-page-container/index.d.ts +10 -33
  120. package/es/pro-page-container/interface.d.ts +12 -0
  121. package/es/pro-page-container/pro-page-container.vue.d.ts +5 -19
  122. package/es/pro-page-container/pro-page-container.vue.js +58 -38
  123. package/es/pro-page-header/constant.d.ts +2 -0
  124. package/es/pro-page-header/constant.js +13 -0
  125. package/es/pro-page-header/index.d.ts +9 -152
  126. package/es/pro-page-header/index.js +6 -6
  127. package/es/pro-page-header/interface.d.ts +21 -0
  128. package/es/pro-page-header/pro-page-header.vue.d.ts +17 -105
  129. package/es/pro-page-header/pro-page-header.vue.js +141 -124
  130. package/es/pro-reuse-tabs/index.d.ts +8 -6
  131. package/es/pro-reuse-tabs/index.js +1 -1
  132. package/es/pro-reuse-tabs/pro-reuse-tabs.vue.d.ts +2 -2
  133. package/es/pro-reuse-tabs/pro-reuse-tabs.vue.js +33 -35
  134. package/es/pro-table/index.d.ts +22 -20
  135. package/es/pro-table/index.js +7 -5
  136. package/es/pro-table/index.vue.d.ts +11 -9
  137. package/es/pro-table/index.vue.js +93 -25
  138. package/es/pro-table/index.vue3.js +5 -0
  139. package/es/pro-table/interface.d.ts +74 -65
  140. package/es/pro-textarea/index.d.ts +7 -5
  141. package/es/pro-textarea/index.vue.d.ts +1 -1
  142. package/es/pro-textarea/index.vue.js +1 -1
  143. package/es/pro-textarea/index.vue2.js +14 -16
  144. package/es/pro-textarea/{inerface.d.ts → interface.d.ts} +19 -18
  145. package/es/style.css +1 -1
  146. package/es/utils.d.ts +6 -0
  147. package/es/utils.js +7 -0
  148. package/package.json +5 -4
  149. package/es/pro-date-range-picker/type.d.ts +0 -22
  150. package/es/pro-page-container/inerface.d.ts +0 -12
  151. package/es/pro-table/index.vue2.js +0 -4
  152. /package/es/pro-footer-bar/{inerface.d.ts → interface.d.ts} +0 -0
@@ -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 ee = Object.getOwnPropertySymbols;
3
+ var Ce = Object.prototype.hasOwnProperty, Be = Object.prototype.propertyIsEnumerable;
4
+ var ae = (d, s, u) => s in d ? ye(d, s, { enumerable: !0, configurable: !0, writable: !0, value: u }) : d[s] = u, Q = (d, s) => {
5
+ for (var u in s || (s = {}))
6
+ Ce.call(s, u) && ae(d, u, s[u]);
7
+ if (ee)
8
+ for (var u of ee(s))
9
+ Be.call(s, u) && ae(d, u, s[u]);
10
+ return d;
11
+ };
12
+ var b = (d, s, u) => new Promise((O, i) => {
13
+ var e = (v) => {
14
+ try {
15
+ x(u.next(v));
16
+ } catch (m) {
17
+ i(m);
18
+ }
19
+ }, z = (v) => {
20
+ try {
21
+ x(u.throw(v));
22
+ } catch (m) {
23
+ i(m);
24
+ }
25
+ }, x = (v) => v.done ? O(v.value) : Promise.resolve(v.value).then(e, z);
26
+ x((u = u.apply(d, s)).next());
27
+ });
28
+ import { defineComponent as we, mergeModels as le, useSlots as Ee, useModel as Me, ref as U, computed as L, watch as oe, createElementBlock as Se, openBlock as ne, createVNode as be, createBlock as Le, createCommentVNode as Oe, unref as T, normalizeClass as $e, createSlots as ke, withCtx as te, renderSlot as ie } from "vue";
29
+ import { Message as y, Upload as ze } from "@arco-design/web-vue";
30
+ import { conclude as V } from "vue-global-config";
31
+ import { EImageUploadInnerBeforeUploadStep as I } from "./types.js";
32
+ import { defaultImageUploadOptions as E } from "./constant.js";
33
+ import je from "./cropper.vue.js";
34
+ import { defaultImageUploadCheckOptions as Qe, defaultImageUploadCompressorOptions as Te, defaultImageUploadCropOptions as Ve, oneTravelImageCheckAndTransform as We, oneTravelImageCompressor as Fe } from "@keyblade/one-travel";
35
+ const He = "keyblade-pro-image-upload";
36
+ var re, ue, de;
37
+ const Ne = /* @__PURE__ */ we({
11
38
  __name: "image-upload",
12
- props: /* @__PURE__ */ Y({
39
+ props: /* @__PURE__ */ le({
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 = E) == 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 d;
48
+ return ((d = E) == null ? void 0 : d.accept) || [];
22
49
  } },
23
- multiple: { type: Boolean, default: U.multiple },
24
- singleLimit: { default: U.singleLimit },
50
+ multiple: { type: Boolean, default: E.multiple },
51
+ singleLimit: { default: E.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 = E) == null ? void 0 : ue.disabled },
55
+ hideInnerBeforeUploadLoading: { type: Boolean, default: (de = E) == 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__ */ le(["cropperImgLoad"], ["update:modelValue"]),
71
+ setup(d, { expose: s, emit: u }) {
72
+ const O = Ee(), i = Me(d, "modelValue"), e = d, z = u, x = U(), v = U(), m = U(), C = U([]), n = U(), p = U(), g = U(), se = L(() => e.accept.map((a) => `.${a}`).join(",")), h = L(() => V([e.checkOptions, Qe]) || {}), M = L(() => V([e.compressorOptions, Te]) || {}), S = L(() => V([e.cropOptions, Ve]) || {}), ce = (a) => {
73
+ var t, c, r, f;
74
+ const l = (f = (r = (c = (t = x.value) == null ? void 0 : t.$el) == null ? void 0 : c.querySelector) == null ? void 0 : r.call(c, "input")) == null ? void 0 : f.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) => b(null, null, function* () {
50
78
  try {
51
- E(await fe(a));
52
- } catch {
53
- M();
54
- } finally {
79
+ $(yield pe(a));
80
+ } catch (j) {
55
81
  k();
82
+ } finally {
83
+ W();
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) => b(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) => b(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((c) => c.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 && W();
108
+ }), W = () => {
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
+ z("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
+ oe(n, () => b(null, null, function* () {
120
+ var $, k, j, F, H, P, q, D, G, J, K, X, Y, Z, N, A, R, _;
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: c } = a;
126
+ let r = l.name, f = 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 We(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, (j = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || j.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 (F = h.value) != null && F.showErrorMessage && y.error((o == null ? void 0 : o.errorMessage) || "图片校验及转换失败"), c();
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 = r == null ? void 0 : r.split(".");
159
+ w.pop(), r = `${w.join(",")}.jpg`, f = new File([o.file], r, {
132
160
  type: o.file.type
133
161
  });
134
162
  } else
135
- r = o.file;
163
+ f = 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 ((H = S.value) != null && H.enable && !((q = (P = r == null ? void 0 : r.toLocaleLowerCase) == null ? void 0 : P.call(r)) != null && q.endsWith(".gif"))) {
166
+ (D = e == null ? void 0 : e.onInnerBeforeUploadStart) == null || D.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
+ (G = S.value) != null && G.customCrop ? f = yield S.value.customCrop(f) : f = yield new Promise((o, w) => {
174
+ m.value = { file: f, resolve: o, reject: w };
175
+ }), (J = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || J.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 (K = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || K.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
+ ), (X = S.value) != null && X.showErrorMessage && y.error("图片剪裁失败"), c();
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 ((Y = M.value) != null && Y.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
+ }, (Z = e == null ? void 0 : e.onInnerBeforeUploadStart) == null || Z.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 Fe(f, {
213
+ maxSize: M.value.maxSize,
214
+ size: M.value.size,
215
+ excludeAllowedTypes: (N = M.value.excludeAllowedTypes) == null ? void 0 : N.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, (A = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || A.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,94 @@ 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 (R = M.value) != null && R.showErrorMessage && y.error((o == null ? void 0 : o.errorMessage) || "图片压缩失败"), c();
231
+ f = new File([o.file], r, {
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, (_ = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || _.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(f);
244
+ }));
245
+ let B;
246
+ oe(
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 = L(() => i.value.every((a) => a.status && ["done", "error"].includes(a.status)));
258
+ return s({
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, c;
264
+ return ne(), Se("div", null, [
265
+ be(T(ze), {
266
+ class: $e([`${He}-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 = T(O)) != null && t.image ? {
262
289
  name: "image",
263
- fn: A(({ fileItem: r }) => [
264
- _(a.$slots, "image", { fileItem: r })
290
+ fn: te(({ fileItem: r }) => [
291
+ ie(a.$slots, "image", { fileItem: r })
265
292
  ]),
266
293
  key: "0"
267
294
  } : void 0,
268
- (t = R(O)) != null && t["upload-button"] ? {
295
+ (c = T(O)) != null && c["upload-button"] ? {
269
296
  name: "upload-button",
270
- fn: A(() => [
271
- _(a.$slots, "upload-button")
297
+ fn: te(() => [
298
+ ie(a.$slots, "upload-button")
272
299
  ]),
273
300
  key: "1"
274
301
  } : void 0
275
302
  ]), 1032, ["class", "tip", "file-list", "action", "headers", "data", "name", "accept", "multiple", "limit", "disabled"]),
276
- p.value && n.value !== void 0 ? (N(), Be(Se, {
303
+ m.value && n.value !== void 0 ? (ne(), Le(je, {
277
304
  key: 0,
278
305
  ref_key: "cropperInsRef",
279
- ref: $,
280
- file: p.value.file,
306
+ ref: v,
307
+ file: m.value.file,
281
308
  index: n.value,
282
- options: B.value,
283
- onCancel: ve,
284
- onConfirm: me,
285
- onImgLoad: ge
286
- }, null, 8, ["file", "index", "options"])) : we("", !0)
309
+ options: S.value,
310
+ onCancel: he,
311
+ onConfirm: Ie,
312
+ onImgLoad: xe
313
+ }, null, 8, ["file", "index", "options"])) : Oe("", !0)
287
314
  ]);
288
315
  };
289
316
  }
290
317
  });
291
318
  export {
292
- qe as default
319
+ Ne as default
293
320
  };