@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.
- package/es/components.d.ts +7 -0
- package/es/global-props.d.ts +20 -3
- package/es/global-props.js +6 -2
- package/es/index.d.ts +7 -0
- package/es/index.js +47 -28
- package/es/inerface.d.ts +5 -2
- package/es/pro-calendar/calendar.vue.d.ts +75 -0
- package/es/pro-calendar/calendar.vue.js +159 -0
- package/es/pro-calendar/calendar.vue3.js +5 -0
- package/es/pro-calendar/enum.d.ts +6 -0
- package/es/pro-calendar/enum.js +4 -0
- package/es/pro-calendar/header.vue.d.ts +35 -0
- package/es/pro-calendar/header.vue.js +146 -0
- package/es/pro-calendar/header.vue2.js +4 -0
- package/es/pro-calendar/hooks/useCellClassName.d.ts +12 -0
- package/es/pro-calendar/hooks/useCellClassName.js +40 -0
- package/es/pro-calendar/index.d.ts +117 -0
- package/es/pro-calendar/index.js +12 -0
- package/es/pro-calendar/interface.d.ts +89 -0
- package/es/pro-calendar/month.d.ts +5 -0
- package/es/pro-calendar/month.js +53 -0
- package/es/pro-calendar/month.vue.d.ts +22 -0
- package/es/pro-calendar/month.vue.js +126 -0
- package/es/pro-calendar/month.vue2.js +4 -0
- package/es/pro-calendar/week.vue.d.ts +3 -0
- package/es/pro-calendar/week.vue.js +34 -0
- package/es/pro-calendar/week.vue2.js +4 -0
- package/es/pro-calendar/year.vue.d.ts +3 -0
- package/es/pro-calendar/year.vue.js +123 -0
- package/es/pro-calendar/year.vue2.js +4 -0
- package/es/pro-date-range-picker/index.d.ts +183 -13
- package/es/pro-date-range-picker/index.js +6 -7
- package/es/pro-date-range-picker/interface.d.ts +38 -0
- package/es/pro-date-range-picker/pro-date-range-picker.vue.d.ts +173 -6
- package/es/pro-date-range-picker/pro-date-range-picker.vue.js +2 -2
- package/es/pro-date-range-picker/pro-date-range-picker.vue2.js +124 -104
- package/es/pro-dates-picker/index.d.ts +49 -0
- package/es/pro-dates-picker/index.js +11 -0
- package/es/pro-dates-picker/index.vue.d.ts +29 -0
- package/es/pro-dates-picker/index.vue.js +135 -0
- package/es/pro-dates-picker/index.vue3.js +5 -0
- package/es/pro-dates-picker/interface.d.ts +38 -0
- package/es/pro-dates-picker/util.d.ts +12 -0
- package/es/pro-dates-picker/util.js +9 -0
- package/es/pro-find-password/enum.d.ts +8 -0
- package/es/pro-find-password/enum.js +4 -0
- package/es/pro-find-password/index.d.ts +11 -0
- package/es/pro-find-password/index.js +11 -0
- package/es/pro-find-password/index.vue.d.ts +4459 -0
- package/es/pro-find-password/index.vue.js +176 -0
- package/es/pro-find-password/index.vue3.js +5 -0
- package/es/pro-find-password/interface.d.ts +45 -0
- package/es/pro-find-password/reset-password.vue.d.ts +591 -0
- package/es/pro-find-password/reset-password.vue.js +179 -0
- package/es/pro-find-password/reset-password.vue2.js +4 -0
- package/es/pro-find-password/verify-user-name.vue.d.ts +795 -0
- package/es/pro-find-password/verify-user-name.vue.js +112 -0
- package/es/pro-find-password/verify-user-name.vue3.js +5 -0
- package/es/pro-footer-bar/index.d.ts +6 -3
- package/es/pro-footer-bar/index.js +6 -7
- package/es/pro-footer-bar/index.vue.d.ts +1 -1
- package/es/pro-footer-bar/index.vue.js +2 -2
- package/es/pro-footer-bar/index.vue2.js +24 -26
- package/es/pro-footer-bar/{inerface.d.ts → interface.d.ts} +1 -0
- package/es/pro-form-group/index.d.ts +7 -6
- package/es/pro-form-group/index.js +6 -8
- package/es/pro-form-group/index.vue.d.ts +2 -2
- package/es/pro-form-group/index.vue.js +1 -1
- package/es/pro-form-group/index.vue2.js +31 -32
- package/es/pro-image-upload/cropper.vue.js +2 -2
- package/es/pro-image-upload/cropper.vue2.js +200 -190
- package/es/pro-image-upload/image-upload.vue.d.ts +1124 -371
- package/es/pro-image-upload/image-upload.vue.js +178 -144
- package/es/pro-image-upload/index.d.ts +1727 -1001
- package/es/pro-image-upload/index.js +6 -8
- package/es/pro-keep-alive-router-view/index.d.ts +1 -0
- package/es/pro-keep-alive-router-view/pro-keep-alive-router-view.vue.js +17 -18
- package/es/pro-layout/hooks.d.ts +80 -1
- package/es/pro-layout/hooks.js +133 -84
- package/es/pro-layout/index.d.ts +9 -6
- package/es/pro-layout/index.js +6 -11
- package/es/pro-layout/pro-layout.vue.d.ts +4 -2
- package/es/pro-layout/pro-layout.vue.js +220 -208
- package/es/pro-loader/index.d.ts +43 -0
- package/es/pro-loader/index.js +11 -0
- package/es/pro-loader/index.vue.d.ts +28 -0
- package/es/pro-loader/index.vue.js +112 -0
- package/es/pro-loader/index.vue3.js +5 -0
- package/es/pro-loader/interface.d.ts +16 -0
- package/es/pro-login/enum.d.ts +6 -0
- package/es/pro-login/enum.js +4 -0
- package/es/pro-login/form-mobile.vue.d.ts +797 -0
- package/es/pro-login/form-mobile.vue.js +146 -0
- package/es/pro-login/form-mobile.vue2.js +4 -0
- package/es/pro-login/form-password.vue.d.ts +584 -0
- package/es/pro-login/form-password.vue.js +99 -0
- package/es/pro-login/form-password.vue2.js +4 -0
- package/es/pro-login/index.d.ts +11 -0
- package/es/pro-login/index.js +11 -0
- package/es/pro-login/index.vue.d.ts +4429 -0
- package/es/pro-login/index.vue.js +105 -0
- package/es/pro-login/index.vue3.js +5 -0
- package/es/pro-login/interface.d.ts +72 -0
- package/es/pro-login/regexp.d.ts +17 -0
- package/es/pro-login/regexp.js +28 -0
- package/es/pro-menu/index.d.ts +18 -80
- package/es/pro-menu/index.js +6 -7
- package/es/pro-menu/interface.d.ts +31 -0
- package/es/pro-menu/menu-item.vue.d.ts +27 -0
- package/es/pro-menu/menu-item.vue.js +35 -0
- package/es/pro-menu/menu-item.vue2.js +4 -0
- package/es/pro-menu/pro-menu-item.vue.d.ts +9 -0
- package/es/pro-menu/pro-menu-item.vue.js +63 -0
- package/es/pro-menu/pro-menu-item.vue2.js +4 -0
- package/es/pro-menu/pro-menu.vue.d.ts +9 -55
- package/es/pro-menu/pro-menu.vue.js +36 -119
- package/es/pro-menu/sub-menu.vue.d.ts +22 -0
- package/es/pro-menu/sub-menu.vue.js +55 -0
- package/es/pro-menu/sub-menu.vue2.js +4 -0
- package/es/pro-menu/util.d.ts +9 -0
- package/es/pro-menu/util.js +7 -0
- package/es/pro-page-container/constant.d.ts +2 -0
- package/es/pro-page-container/constant.js +9 -0
- package/es/pro-page-container/index.d.ts +7 -21
- package/es/pro-page-container/index.js +6 -8
- package/es/pro-page-container/interface.d.ts +12 -0
- package/es/pro-page-container/pro-page-container.vue.d.ts +4 -15
- package/es/pro-page-container/pro-page-container.vue.js +58 -38
- package/es/pro-page-header/constant.d.ts +2 -0
- package/es/pro-page-header/constant.js +13 -0
- package/es/pro-page-header/index.d.ts +12 -146
- package/es/pro-page-header/index.js +6 -8
- package/es/pro-page-header/interface.d.ts +21 -0
- package/es/pro-page-header/pro-page-header.vue.d.ts +18 -103
- package/es/pro-page-header/pro-page-header.vue.js +141 -124
- package/es/pro-reuse-tabs/index.d.ts +8 -6
- package/es/pro-reuse-tabs/index.js +6 -7
- package/es/pro-reuse-tabs/pro-reuse-tabs.vue.d.ts +2 -2
- package/es/pro-reuse-tabs/pro-reuse-tabs.vue.js +33 -35
- package/es/pro-table/index.d.ts +18 -18
- package/es/pro-table/index.js +6 -7
- package/es/pro-table/index.vue.d.ts +6 -6
- package/es/pro-table/index.vue.js +94 -39
- package/es/pro-table/interface.d.ts +73 -65
- package/es/pro-textarea/index.d.ts +7 -5
- package/es/pro-textarea/index.js +5 -6
- package/es/pro-textarea/index.vue.d.ts +1 -1
- package/es/pro-textarea/index.vue.js +1 -1
- package/es/pro-textarea/index.vue2.js +14 -16
- package/es/pro-textarea/{inerface.d.ts → interface.d.ts} +19 -18
- package/es/style.css +1 -1
- package/es/utils.d.ts +6 -0
- package/es/utils.js +7 -0
- package/package.json +5 -4
- package/es/pro-date-range-picker/inerface.d.ts +0 -26
- package/es/pro-page-container/inerface.d.ts +0 -12
|
@@ -1,34 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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__ */
|
|
39
|
+
props: /* @__PURE__ */ ne({
|
|
13
40
|
action: {},
|
|
14
41
|
handlerResponse: {},
|
|
15
42
|
headers: {},
|
|
16
43
|
data: {},
|
|
17
|
-
name: { default: (
|
|
44
|
+
name: { default: (re = b) == null ? void 0 : re.name },
|
|
18
45
|
tip: {},
|
|
19
46
|
accept: { default: () => {
|
|
20
|
-
var
|
|
21
|
-
return ((
|
|
47
|
+
var s;
|
|
48
|
+
return ((s = b) == null ? void 0 : s.accept) || [];
|
|
22
49
|
} },
|
|
23
|
-
multiple: { type: Boolean, default:
|
|
24
|
-
singleLimit: { default:
|
|
50
|
+
multiple: { type: Boolean, default: b.multiple },
|
|
51
|
+
singleLimit: { default: b.singleLimit },
|
|
25
52
|
limit: {},
|
|
26
53
|
exceedTip: {},
|
|
27
|
-
disabled: { type: Boolean, default: (
|
|
28
|
-
hideInnerBeforeUploadLoading: { type: Boolean, default: (
|
|
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__ */
|
|
43
|
-
setup(
|
|
44
|
-
const
|
|
45
|
-
var
|
|
46
|
-
const l = (r = (
|
|
47
|
-
return l && l.length > 0 && (
|
|
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) :
|
|
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
|
-
|
|
52
|
-
} catch {
|
|
53
|
-
M();
|
|
54
|
-
} finally {
|
|
79
|
+
$(yield pe(a));
|
|
80
|
+
} catch (P) {
|
|
55
81
|
k();
|
|
82
|
+
} finally {
|
|
83
|
+
F();
|
|
56
84
|
}
|
|
57
|
-
});
|
|
58
|
-
},
|
|
59
|
-
const l =
|
|
60
|
-
return
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
|
|
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 =
|
|
70
|
-
l.success ?
|
|
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
|
-
},
|
|
101
|
+
}), ge = (a) => {
|
|
76
102
|
e != null && e.onError ? e == null || e.onError(a) : setTimeout(() => {
|
|
77
|
-
const l =
|
|
78
|
-
|
|
103
|
+
const l = i.value.findIndex((t) => t.uid === a.uid);
|
|
104
|
+
i.value.splice(l, 1);
|
|
79
105
|
});
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
}),
|
|
83
|
-
n.value === void 0 ? n.value = 0 : n.value + 1 >=
|
|
84
|
-
},
|
|
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 =
|
|
87
|
-
},
|
|
112
|
+
(a = m.value) == null || a.reject();
|
|
113
|
+
}, Ie = (a) => {
|
|
88
114
|
var l;
|
|
89
|
-
(l =
|
|
90
|
-
},
|
|
91
|
-
|
|
115
|
+
(l = m.value) == null || l.resolve(a);
|
|
116
|
+
}, xe = (a) => {
|
|
117
|
+
j("cropperImgLoad", a);
|
|
92
118
|
};
|
|
93
|
-
|
|
94
|
-
var
|
|
95
|
-
if (n.value === void 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 =
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
}, (
|
|
131
|
+
}, (k = e == null ? void 0 : e.onInnerBeforeUploadStart) == null || k.call(
|
|
104
132
|
e,
|
|
105
133
|
l,
|
|
106
134
|
n.value,
|
|
107
|
-
|
|
135
|
+
I.check
|
|
108
136
|
);
|
|
109
|
-
const o =
|
|
110
|
-
imageMaxSize:
|
|
111
|
-
imageAllowedType:
|
|
112
|
-
imageMinWidth:
|
|
113
|
-
imageMinHeight:
|
|
114
|
-
imageMaxWidth:
|
|
115
|
-
imageMaxHeight:
|
|
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 (
|
|
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
|
-
|
|
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 (
|
|
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
|
|
131
|
-
|
|
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 ((
|
|
138
|
-
(
|
|
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
|
-
|
|
170
|
+
I.crop
|
|
143
171
|
);
|
|
144
172
|
try {
|
|
145
|
-
(
|
|
146
|
-
|
|
147
|
-
}), (
|
|
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
|
-
|
|
179
|
+
I.crop,
|
|
152
180
|
{
|
|
153
181
|
success: !1
|
|
154
182
|
}
|
|
155
183
|
);
|
|
156
|
-
} catch {
|
|
157
|
-
return (
|
|
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
|
-
|
|
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
|
-
), (
|
|
197
|
+
), (Z = S.value) != null && Z.showErrorMessage && y.error("图片剪裁失败"), f();
|
|
170
198
|
} finally {
|
|
171
|
-
|
|
199
|
+
m.value = void 0;
|
|
172
200
|
}
|
|
173
201
|
}
|
|
174
|
-
if ((
|
|
175
|
-
|
|
202
|
+
if ((N = M.value) != null && N.enable) {
|
|
203
|
+
p.value = {
|
|
176
204
|
loading: !0,
|
|
177
205
|
text: `第${n.value + 1}张图片处理中,请稍等`
|
|
178
|
-
}, (
|
|
206
|
+
}, (R = e == null ? void 0 : e.onInnerBeforeUploadStart) == null || R.call(
|
|
179
207
|
e,
|
|
180
208
|
l,
|
|
181
209
|
n.value,
|
|
182
|
-
|
|
210
|
+
I.compress
|
|
183
211
|
);
|
|
184
|
-
const o =
|
|
185
|
-
maxSize:
|
|
186
|
-
size:
|
|
187
|
-
excludeAllowedTypes: (
|
|
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 (
|
|
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
|
-
|
|
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 (
|
|
203
|
-
r = new File([o.file],
|
|
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
|
-
|
|
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
|
-
|
|
239
|
+
I.all,
|
|
212
240
|
{
|
|
213
241
|
success: !0
|
|
214
242
|
}
|
|
215
|
-
),
|
|
216
|
-
});
|
|
217
|
-
let
|
|
218
|
-
|
|
219
|
-
() =>
|
|
243
|
+
), t(r);
|
|
244
|
+
}));
|
|
245
|
+
let B;
|
|
246
|
+
te(
|
|
247
|
+
() => p.value,
|
|
220
248
|
() => {
|
|
221
249
|
var a;
|
|
222
|
-
|
|
223
|
-
content:
|
|
250
|
+
p.value ? B = y.loading({
|
|
251
|
+
content: p.value.text,
|
|
224
252
|
id: "image-upload-id",
|
|
225
253
|
duration: 0
|
|
226
|
-
}) : (a =
|
|
254
|
+
}) : (a = B == null ? void 0 : B.close) == null || a.call(B);
|
|
227
255
|
}
|
|
228
256
|
);
|
|
229
|
-
const
|
|
230
|
-
return
|
|
231
|
-
uploadInsRef:
|
|
232
|
-
cropperInsRef:
|
|
233
|
-
isUploadComplete:
|
|
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
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
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:
|
|
268
|
+
ref: x,
|
|
242
269
|
"list-type": "picture-card",
|
|
243
270
|
tip: a.tip || "上传",
|
|
244
271
|
"image-preview": "",
|
|
245
|
-
"file-list":
|
|
246
|
-
"onUpdate:fileList": l[0] || (l[0] = (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:
|
|
278
|
+
accept: se.value,
|
|
252
279
|
multiple: a.multiple,
|
|
253
280
|
limit: a.limit,
|
|
254
281
|
disabled: a.disabled,
|
|
255
|
-
"on-before-upload":
|
|
256
|
-
"on-before-remove":
|
|
257
|
-
onExceedLimit:
|
|
258
|
-
onSuccess:
|
|
259
|
-
onError:
|
|
260
|
-
},
|
|
261
|
-
(
|
|
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:
|
|
264
|
-
|
|
290
|
+
fn: T(({ fileItem: r }) => [
|
|
291
|
+
V(a.$slots, "image", { fileItem: r })
|
|
265
292
|
]),
|
|
266
293
|
key: "0"
|
|
267
294
|
} : void 0,
|
|
268
|
-
(
|
|
295
|
+
(f = z(E)) != null && f["upload-button"] ? {
|
|
269
296
|
name: "upload-button",
|
|
270
|
-
fn:
|
|
271
|
-
|
|
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
|
-
|
|
310
|
+
m.value && n.value !== void 0 ? (ie(), Le(Qe, {
|
|
277
311
|
key: 0,
|
|
278
312
|
ref_key: "cropperInsRef",
|
|
279
|
-
ref:
|
|
280
|
-
file:
|
|
313
|
+
ref: v,
|
|
314
|
+
file: m.value.file,
|
|
281
315
|
index: n.value,
|
|
282
|
-
options:
|
|
283
|
-
onCancel:
|
|
284
|
-
onConfirm:
|
|
285
|
-
onImgLoad:
|
|
286
|
-
}, null, 8, ["file", "index", "options"])) :
|
|
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
|
-
|
|
326
|
+
Ae as default
|
|
293
327
|
};
|