@keyblade/pro-components 1.13.8-alpha.45 → 1.13.8-alpha.46

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.
@@ -12,7 +12,9 @@ declare function __VLS_template(): {
12
12
  fileItem: any;
13
13
  }): any;
14
14
  'upload-button'?(_: {}): any;
15
- 'extra-button'?(_: {}): any;
15
+ 'extra-button'?(_: {
16
+ fileItem: any;
17
+ }): any;
16
18
  };
17
19
  refs: {
18
20
  uploadInsRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
@@ -1,29 +1,29 @@
1
1
  var ye = Object.defineProperty;
2
2
  var le = Object.getOwnPropertySymbols;
3
3
  var Ce = Object.prototype.hasOwnProperty, Be = Object.prototype.propertyIsEnumerable;
4
- var oe = (s, c, r) => c in s ? ye(s, c, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[c] = r, T = (s, c) => {
5
- for (var r in c || (c = {}))
6
- Ce.call(c, r) && oe(s, r, c[r]);
4
+ var oe = (s, c, u) => c in s ? ye(s, c, { enumerable: !0, configurable: !0, writable: !0, value: u }) : s[c] = u, T = (s, c) => {
5
+ for (var u in c || (c = {}))
6
+ Ce.call(c, u) && oe(s, u, c[u]);
7
7
  if (le)
8
- for (var r of le(c))
9
- Be.call(c, r) && oe(s, r, c[r]);
8
+ for (var u of le(c))
9
+ Be.call(c, u) && oe(s, u, c[u]);
10
10
  return s;
11
11
  };
12
- var L = (s, c, r) => new Promise((E, i) => {
12
+ var L = (s, c, u) => new Promise((E, i) => {
13
13
  var e = (v) => {
14
14
  try {
15
- x(r.next(v));
15
+ x(u.next(v));
16
16
  } catch (m) {
17
17
  i(m);
18
18
  }
19
19
  }, j = (v) => {
20
20
  try {
21
- x(r.throw(v));
21
+ x(u.throw(v));
22
22
  } catch (m) {
23
23
  i(m);
24
24
  }
25
25
  }, x = (v) => v.done ? E(v.value) : Promise.resolve(v.value).then(e, j);
26
- x((r = r.apply(s, c)).next());
26
+ x((u = u.apply(s, c)).next());
27
27
  });
28
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 V, renderSlot as W } from "vue";
29
29
  import { Message as y, Upload as ze } from "@arco-design/web-vue";
@@ -68,10 +68,10 @@ const Ne = /* @__PURE__ */ we({
68
68
  modelModifiers: {}
69
69
  }),
70
70
  emits: /* @__PURE__ */ ne(["cropperImgLoad"], ["update:modelValue"]),
71
- setup(s, { expose: c, emit: r }) {
72
- const E = be(), i = Ee(s, "modelValue"), e = s, j = r, x = U(), v = U(), m = U(), C = U([]), n = U(), p = U(), g = U(), se = O(() => e.accept.map((a) => `.${a}`).join(",")), h = O(() => F([e.checkOptions, Qe]) || {}), M = O(() => F([e.compressorOptions, Te]) || {}), S = O(() => F([e.cropOptions, Ve]) || {}), ce = (a) => {
73
- var t, f, u, d;
74
- const l = (d = (u = (f = (t = x.value) == null ? void 0 : t.$el) == null ? void 0 : f.querySelector) == null ? void 0 : u.call(f, "input")) == null ? void 0 : d.files;
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(() => F([e.checkOptions, Qe]) || {}), M = O(() => F([e.compressorOptions, Te]) || {}), S = O(() => F([e.cropOptions, Ve]) || {}), 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
75
  return l && l.length > 0 && (g.value = {
76
76
  selectCount: l.length
77
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* () {
@@ -123,7 +123,7 @@ const Ne = /* @__PURE__ */ we({
123
123
  const a = C.value[n.value];
124
124
  if (!a) return;
125
125
  const { file: l, resolve: t, reject: f } = a;
126
- let u = l.name, d = l;
126
+ let d = l.name, r = l;
127
127
  if (($ = h.value) != null && $.enable) {
128
128
  p.value = {
129
129
  loading: !0,
@@ -155,14 +155,14 @@ const Ne = /* @__PURE__ */ we({
155
155
  ), !o.success)
156
156
  return (P = h.value) != null && P.showErrorMessage && y.error((o == null ? void 0 : o.errorMessage) || "图片校验及转换失败"), f();
157
157
  if (o != null && o.hasTransform) {
158
- const w = u == null ? void 0 : u.split(".");
159
- w.pop(), u = `${w.join(",")}.jpg`, d = new File([o.file], u, {
158
+ const w = d == null ? void 0 : d.split(".");
159
+ w.pop(), d = `${w.join(",")}.jpg`, r = new File([o.file], d, {
160
160
  type: o.file.type
161
161
  });
162
162
  } else
163
- d = o.file;
163
+ r = o.file;
164
164
  }
165
- if ((q = S.value) != null && q.enable && !((G = (D = u == null ? void 0 : u.toLocaleLowerCase) == null ? void 0 : D.call(u)) != null && G.endsWith(".gif"))) {
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
166
  (J = e == null ? void 0 : e.onInnerBeforeUploadStart) == null || J.call(
167
167
  e,
168
168
  l,
@@ -170,8 +170,8 @@ const Ne = /* @__PURE__ */ we({
170
170
  I.crop
171
171
  );
172
172
  try {
173
- (K = S.value) != null && K.customCrop ? d = yield S.value.customCrop(d) : d = yield new Promise((o, w) => {
174
- m.value = { file: d, resolve: o, reject: w };
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
175
  }), (X = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || X.call(
176
176
  e,
177
177
  l,
@@ -209,7 +209,7 @@ const Ne = /* @__PURE__ */ we({
209
209
  n.value,
210
210
  I.compress
211
211
  );
212
- const o = yield Fe(d, {
212
+ const o = yield Fe(r, {
213
213
  maxSize: M.value.maxSize,
214
214
  size: M.value.size,
215
215
  excludeAllowedTypes: (R = M.value.excludeAllowedTypes) == null ? void 0 : R.map((w) => `${w}`)
@@ -228,7 +228,7 @@ const Ne = /* @__PURE__ */ we({
228
228
  }
229
229
  ), !o.success)
230
230
  return (ee = M.value) != null && ee.showErrorMessage && y.error((o == null ? void 0 : o.errorMessage) || "图片压缩失败"), f();
231
- d = new File([o.file], u, {
231
+ r = new File([o.file], d, {
232
232
  type: o.file.type
233
233
  });
234
234
  }
@@ -240,7 +240,7 @@ const Ne = /* @__PURE__ */ we({
240
240
  {
241
241
  success: !0
242
242
  }
243
- ), t(d);
243
+ ), t(r);
244
244
  }));
245
245
  let B;
246
246
  te(
@@ -260,7 +260,7 @@ const Ne = /* @__PURE__ */ we({
260
260
  cropperInsRef: v,
261
261
  isUploadComplete: Ue
262
262
  }), (a, l) => {
263
- var t, f, u;
263
+ var t, f, d;
264
264
  return ie(), Me("div", null, [
265
265
  Se(z(ze), {
266
266
  class: $e([`${He}-upload`]),
@@ -270,7 +270,7 @@ const Ne = /* @__PURE__ */ we({
270
270
  tip: a.tip || "上传",
271
271
  "image-preview": "",
272
272
  "file-list": i.value,
273
- "onUpdate:fileList": l[0] || (l[0] = (d) => i.value = d),
273
+ "onUpdate:fileList": l[0] || (l[0] = (r) => i.value = r),
274
274
  action: a.action,
275
275
  headers: a.headers,
276
276
  data: a.data,
@@ -287,8 +287,8 @@ const Ne = /* @__PURE__ */ we({
287
287
  }, ke({ _: 2 }, [
288
288
  (t = z(E)) != null && t.image ? {
289
289
  name: "image",
290
- fn: V(({ fileItem: d }) => [
291
- W(a.$slots, "image", { fileItem: d })
290
+ fn: V(({ fileItem: r }) => [
291
+ W(a.$slots, "image", { fileItem: r })
292
292
  ]),
293
293
  key: "0"
294
294
  } : void 0,
@@ -299,10 +299,10 @@ const Ne = /* @__PURE__ */ we({
299
299
  ]),
300
300
  key: "1"
301
301
  } : void 0,
302
- (u = z(E)) != null && u["extra-button"] ? {
302
+ (d = z(E)) != null && d["extra-button"] ? {
303
303
  name: "extra-button",
304
- fn: V(() => [
305
- W(a.$slots, "extra-button")
304
+ fn: V(({ fileItem: r }) => [
305
+ W(a.$slots, "extra-button", { fileItem: r })
306
306
  ]),
307
307
  key: "2"
308
308
  } : void 0
@@ -2373,7 +2373,9 @@ declare const ProImageUpload: {
2373
2373
  fileItem: any;
2374
2374
  }): any;
2375
2375
  'upload-button'?(_: {}): any;
2376
- 'extra-button'?(_: {}): any;
2376
+ 'extra-button'?(_: {
2377
+ fileItem: any;
2378
+ }): any;
2377
2379
  };
2378
2380
  }) & {
2379
2381
  install: (app: App) => void;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@keyblade/pro-components",
3
3
  "description": "KeyBlade Pro Components",
4
4
  "author": "yangshuai <704807396@qq.com>",
5
- "version": "1.13.8-alpha.45",
5
+ "version": "1.13.8-alpha.46",
6
6
  "private": false,
7
7
  "type": "module",
8
8
  "main": "es/index.js",