@keyblade/pro-components 1.12.0-alpha.2 → 1.12.0-alpha.4

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/index.d.ts CHANGED
@@ -13,4 +13,5 @@ export { default as ProPageContainer } from './pro-page-container';
13
13
  export { default as ProReuseTabs } from './pro-reuse-tabs';
14
14
  export type { IProTab } from './pro-reuse-tabs';
15
15
  export { default as ProImageUpload } from './pro-image-upload';
16
+ export * from './pro-image-upload';
16
17
  export type {} from './components';
package/es/index.js CHANGED
@@ -1,29 +1,33 @@
1
1
  import { ProPageHeader as o } from "./pro-page-header/index.js";
2
- import { default as b } from "./pro-page-header/index.js";
2
+ import { default as U } from "./pro-page-header/index.js";
3
3
  import { ProKeepAliveRouterView as r } from "./pro-keep-alive-router-view/index.js";
4
- import { default as w } from "./pro-keep-alive-router-view/index.js";
4
+ import { default as b } from "./pro-keep-alive-router-view/index.js";
5
5
  import { ProLayout as t } from "./pro-layout/index.js";
6
- import { default as A } from "./pro-layout/index.js";
6
+ import { default as w } from "./pro-layout/index.js";
7
7
  import { ProMenu as a } from "./pro-menu/index.js";
8
- import { default as H } from "./pro-menu/index.js";
8
+ import { default as A } from "./pro-menu/index.js";
9
9
  import { ProPageContainer as m } from "./pro-page-container/index.js";
10
- import { default as K } from "./pro-page-container/index.js";
11
- import { ProReuseTabs as u } from "./pro-reuse-tabs/index.js";
12
- import { default as M } from "./pro-reuse-tabs/index.js";
13
- import { ProImageUpload as f } from "./pro-image-upload/index.js";
14
- import { default as U } from "./pro-image-upload/index.js";
15
- const p = {
10
+ import { default as H } from "./pro-page-container/index.js";
11
+ import { ProReuseTabs as f } from "./pro-reuse-tabs/index.js";
12
+ import { default as L } from "./pro-reuse-tabs/index.js";
13
+ import { ProImageUpload as u } from "./pro-image-upload/index.js";
14
+ import { default as T } from "./pro-image-upload/index.js";
15
+ import { EImageUploadInnerBeforeUploadStep as c } from "./pro-image-upload/types.js";
16
+ import { defaultImageUploadOptions as E } from "./pro-image-upload/constant.js";
17
+ const x = {
16
18
  install(e) {
17
- e.use(o), e.use(r), e.use(t), e.use(a), e.use(m), e.use(u), e.use(f);
19
+ e.use(o), e.use(r), e.use(t), e.use(a), e.use(m), e.use(f), e.use(u);
18
20
  }
19
21
  };
20
22
  export {
21
- U as ProImageUpload,
22
- w as ProKeepAliveRouterView,
23
- A as ProLayout,
24
- H as ProMenu,
25
- K as ProPageContainer,
26
- b as ProPageHeader,
27
- M as ProReuseTabs,
28
- p as default
23
+ c as EImageUploadInnerBeforeUploadStep,
24
+ T as ProImageUpload,
25
+ b as ProKeepAliveRouterView,
26
+ w as ProLayout,
27
+ A as ProMenu,
28
+ H as ProPageContainer,
29
+ U as ProPageHeader,
30
+ L as ProReuseTabs,
31
+ x as default,
32
+ E as defaultImageUploadOptions
29
33
  };
@@ -1,30 +1,29 @@
1
- import { defineComponent as ue, ref as m, computed as M, watch as G, resolveComponent as de, openBlock as J, createElementBlock as se, createVNode as ce, normalizeClass as fe, createBlock as ve, createCommentVNode as me } from "vue";
2
- import { Message as x } from "@arco-design/web-vue";
3
- import { conclude as L } from "vue-global-config";
1
+ import { defineComponent as ne, ref as m, computed as C, watch as D, resolveComponent as oe, openBlock as te, createElementBlock as ie, createVNode as ue, normalizeClass as re } from "vue";
2
+ import { Message as U } from "@arco-design/web-vue";
3
+ import { conclude as b } from "vue-global-config";
4
4
  import { EImageUploadInnerBeforeUploadStep as v } from "./types.js";
5
- import { defaultImageUploadOptions as U } from "./constant.js";
6
- import ge from "./cropper.vue.js";
7
- import { defaultImageUploadCheckOptions as pe, defaultImageUploadCompressorOptions as Ie, defaultImageUploadCropOptions as he, oneTravelImageCheckAndTransform as xe, oneTravelImageCompressor as Ue } from "@keyblade/one-travel";
8
- const Ce = "keyblade-pro-image-upload";
9
- var K, X, Y;
10
- const Oe = /* @__PURE__ */ ue({
5
+ import { defaultImageUploadOptions as x } from "./constant.js";
6
+ import { defaultImageUploadCheckOptions as de, defaultImageUploadCompressorOptions as se, defaultImageUploadCropOptions as ce, oneTravelImageCheckAndTransform as fe, oneTravelImageCompressor as ve } from "@keyblade/one-travel";
7
+ const me = "keyblade-pro-image-upload";
8
+ var G, J, K;
9
+ const Ee = /* @__PURE__ */ ne({
11
10
  __name: "image-upload",
12
11
  props: {
13
12
  action: {},
14
13
  handlerResponse: {},
15
14
  headers: {},
16
15
  data: {},
17
- name: { default: (K = U) == null ? void 0 : K.name },
16
+ name: { default: (G = x) == null ? void 0 : G.name },
18
17
  tip: {},
19
18
  accept: { default: () => {
20
19
  var B;
21
- return ((B = U) == null ? void 0 : B.accept) || [];
20
+ return ((B = x) == null ? void 0 : B.accept) || [];
22
21
  } },
23
- multiple: { type: Boolean, default: U.multiple },
24
- singleLimit: { default: U.singleLimit },
22
+ multiple: { type: Boolean, default: x.multiple },
23
+ singleLimit: { default: x.singleLimit },
25
24
  limit: {},
26
- disabled: { type: Boolean, default: (X = U) == null ? void 0 : X.disabled },
27
- hideInnerBeforeUploadLoading: { type: Boolean, default: (Y = U) == null ? void 0 : Y.hideInnerBeforeUploadLoading },
25
+ disabled: { type: Boolean, default: (J = x) == null ? void 0 : J.disabled },
26
+ hideInnerBeforeUploadLoading: { type: Boolean, default: (K = x) == null ? void 0 : K.hideInnerBeforeUploadLoading },
28
27
  checkOptions: {},
29
28
  compressorOptions: {},
30
29
  cropOptions: {},
@@ -36,75 +35,67 @@ const Oe = /* @__PURE__ */ ue({
36
35
  onInnerBeforeUploadEnd: {}
37
36
  },
38
37
  emits: ["cropperImgLoad"],
39
- setup(B, { expose: Z, emit: _ }) {
40
- const e = B, i = defineModel({ required: !0 }), S = m(), O = m(), g = m(), p = m(
38
+ setup(B, { expose: X, emit: ge }) {
39
+ const e = B, i = defineModel({ required: !0 }), M = m(), Y = m(), O = m(), g = m(
41
40
  []
42
- ), o = m(), c = m(), d = m(), A = M(() => e.accept.map((a) => `.${a}`).join(",")), f = M(() => L([e.checkOptions, pe]) || {}), C = M(() => L([e.compressorOptions, Ie]) || {}), y = M(() => L([e.cropOptions, he]) || {}), R = (a) => {
43
- var t, r, s, u;
44
- const l = (u = (s = (r = (t = S.value) == null ? void 0 : t.$el) == null ? void 0 : r.querySelector) == null ? void 0 : s.call(r, "input")) == null ? void 0 : u.files;
45
- return l && l.length > 0 && (d.value = {
46
- selectCount: l.length
47
- }), e != null && e.onBeforeUpload ? e == null ? void 0 : e.onBeforeUpload(a) : d.value && (e != null && e.singleLimit) && d.value.selectCount > (e == null ? void 0 : e.singleLimit) ? (d.value.handleIndex === void 0 ? (d.value.handleIndex = 0, x.error(`单次最多可选择${e == null ? void 0 : e.singleLimit}张图片`)) : d.value.handleIndex += 1, d.value.handleIndex === d.value.selectCount - 1 && (d.value = void 0), !1) : new Promise(async (E, w) => {
41
+ ), o = m(), c = m(), d = m(), Z = C(() => e.accept.map((a) => `.${a}`).join(",")), f = C(() => b([e.checkOptions, de]) || {}), p = C(() => b([e.compressorOptions, se]) || {}), y = C(() => b([e.cropOptions, ce]) || {}), _ = (a) => {
42
+ var t, u, s, r;
43
+ const n = (r = (s = (u = (t = M.value) == null ? void 0 : t.$el) == null ? void 0 : u.querySelector) == null ? void 0 : s.call(u, "input")) == null ? void 0 : r.files;
44
+ return n && n.length > 0 && (d.value = {
45
+ selectCount: n.length
46
+ }), e != null && e.onBeforeUpload ? e == null ? void 0 : e.onBeforeUpload(a) : d.value && (e != null && e.singleLimit) && d.value.selectCount > (e == null ? void 0 : e.singleLimit) ? (d.value.handleIndex === void 0 ? (d.value.handleIndex = 0, U.error(`单次最多可选择${e == null ? void 0 : e.singleLimit}张图片`)) : d.value.handleIndex += 1, d.value.handleIndex === d.value.selectCount - 1 && (d.value = void 0), !1) : new Promise(async (E, w) => {
48
47
  try {
49
- E(await oe(a));
48
+ E(await le(a));
50
49
  } catch {
51
50
  w();
52
51
  } finally {
53
- $();
52
+ L();
54
53
  }
55
54
  });
55
+ }, A = async (a) => {
56
+ const n = i.value.findIndex((t) => t.uid === a.uid);
57
+ return i.value.splice(n, 1), i.value = [...i.value], !1;
58
+ }, R = (a, n) => {
59
+ e != null && e.onExceed ? e == null || e.onExceed(a, n) : (U.error(`单次最多可选择${(e == null ? void 0 : e.limit) || 1}张图片`), i.value = a);
56
60
  }, ee = async (a) => {
57
- const l = i.value.findIndex((t) => t.uid === a.uid);
58
- return i.value.splice(l, 1), i.value = [...i.value], !1;
59
- }, ae = (a, l) => {
60
- e != null && e.onExceed ? e == null || e.onExceed(a, l) : (x.error(`单次最多可选择${(e == null ? void 0 : e.limit) || 1}张图片`), i.value = a);
61
- }, le = async (a) => {
62
61
  if (e != null && e.onSuccess)
63
62
  e == null || e.onSuccess(a);
64
63
  else {
65
64
  if (!(e != null && e.handlerResponse))
66
65
  return;
67
- const l = await e.handlerResponse(a.response), t = i.value.findIndex((r) => r.uid === a.uid);
68
- l.success ? i.value[t] = {
66
+ const n = await e.handlerResponse(a.response), t = i.value.findIndex((u) => u.uid === a.uid);
67
+ n.success ? i.value[t] = {
69
68
  ...i.value[t],
70
- ...l
69
+ ...n
71
70
  } : i.value.splice(t, 1);
72
71
  }
73
- }, ne = (a) => {
72
+ }, ae = (a) => {
74
73
  e != null && e.onError ? e == null || e.onError(a) : setTimeout(() => {
75
- const l = i.value.findIndex((t) => t.uid === a.uid);
76
- i.value.splice(l, 1);
74
+ const n = i.value.findIndex((t) => t.uid === a.uid);
75
+ i.value.splice(n, 1);
77
76
  });
78
- }, oe = (a) => new Promise((l, t) => {
79
- p.value.push({ file: a, resolve: l, reject: t }), p.value.length === 1 && !o.value && $();
80
- }), $ = () => {
81
- o.value === void 0 ? o.value = 0 : o.value + 1 >= p.value.length ? (o.value = void 0, p.value = []) : o.value += 1;
82
- }, te = () => {
83
- var a;
84
- (a = g.value) == null || a.reject();
85
- }, ie = (a) => {
86
- var l;
87
- (l = g.value) == null || l.resolve(a);
88
- }, re = (a) => {
89
- _("cropperImgLoad", a);
77
+ }, le = (a) => new Promise((n, t) => {
78
+ g.value.push({ file: a, resolve: n, reject: t }), g.value.length === 1 && !o.value && L();
79
+ }), L = () => {
80
+ o.value === void 0 ? o.value = 0 : o.value + 1 >= g.value.length ? (o.value = void 0, g.value = []) : o.value += 1;
90
81
  };
91
- G(o, async () => {
92
- var E, w, b, k, F, z, j, Q, H, W, N, P, T, q, V, D;
93
- if (o.value === void 0 || p.value.length === 0)
82
+ D(o, async () => {
83
+ var E, w, S, $, F, z, j, k, Q, H, W, P, T, q, N, V;
84
+ if (o.value === void 0 || g.value.length === 0)
94
85
  return;
95
- const a = p.value[o.value], { file: l, resolve: t, reject: r } = a;
96
- let s = l.name, u = l;
86
+ const a = g.value[o.value], { file: n, resolve: t, reject: u } = a;
87
+ let s = n.name, r = n;
97
88
  if ((E = f.value) != null && E.enable) {
98
89
  c.value = {
99
90
  loading: !0,
100
91
  text: `第${o.value + 1}张图片检测中,请稍等`
101
92
  }, (w = e == null ? void 0 : e.onInnerBeforeUploadStart) == null || w.call(
102
93
  e,
103
- l,
94
+ n,
104
95
  o.value,
105
96
  v.check
106
97
  );
107
- const n = await xe(l, l.name, {
98
+ const l = await fe(n, n.name, {
108
99
  imageMaxSize: f.value.maxSize,
109
100
  imageAllowedType: f.value.allowedType,
110
101
  imageMinWidth: f.value.minWidth,
@@ -112,39 +103,39 @@ const Oe = /* @__PURE__ */ ue({
112
103
  imageMaxWidth: f.value.maxWidth,
113
104
  imageMaxHeight: f.value.maxHeight
114
105
  });
115
- if (c.value = void 0, (b = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || b.call(
106
+ if (c.value = void 0, (S = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || S.call(
116
107
  e,
117
- l,
108
+ n,
118
109
  o.value,
119
110
  v.check,
120
111
  {
121
- success: n.success,
122
- error: n == null ? void 0 : n.error,
123
- errorMessage: n == null ? void 0 : n.errorMessage
112
+ success: l.success,
113
+ error: l == null ? void 0 : l.error,
114
+ errorMessage: l == null ? void 0 : l.errorMessage
124
115
  }
125
- ), !n.success)
126
- return (k = f.value) != null && k.showErrorMessage && x.error((n == null ? void 0 : n.errorMessage) || "图片校验及转换失败"), r();
127
- if (n != null && n.hasTransform) {
128
- const h = s == null ? void 0 : s.split(".");
129
- h.pop(), s = `${h.join(",")}.jpg`, u = new File([n.file], s, {
130
- type: n.file.type
116
+ ), !l.success)
117
+ return ($ = f.value) != null && $.showErrorMessage && U.error((l == null ? void 0 : l.errorMessage) || "图片校验及转换失败"), u();
118
+ if (l != null && l.hasTransform) {
119
+ const I = s == null ? void 0 : s.split(".");
120
+ I.pop(), s = `${I.join(",")}.jpg`, r = new File([l.file], s, {
121
+ type: l.file.type
131
122
  });
132
123
  } else
133
- u = n.file;
124
+ r = l.file;
134
125
  }
135
126
  if ((F = y.value) != null && F.enable) {
136
127
  (z = e == null ? void 0 : e.onInnerBeforeUploadStart) == null || z.call(
137
128
  e,
138
- l,
129
+ n,
139
130
  o.value,
140
131
  v.crop
141
132
  );
142
133
  try {
143
- (j = y.value) != null && j.customCrop ? u = await y.value.customCrop(u) : u = await new Promise((n, h) => {
144
- g.value = { file: u, resolve: n, reject: h };
145
- }), (Q = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || Q.call(
134
+ (j = y.value) != null && j.customCrop ? r = await y.value.customCrop(r) : r = await new Promise((l, I) => {
135
+ O.value = { file: r, resolve: l, reject: I };
136
+ }), (k = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || k.call(
146
137
  e,
147
- l,
138
+ n,
148
139
  o.value,
149
140
  v.crop,
150
141
  {
@@ -152,9 +143,9 @@ const Oe = /* @__PURE__ */ ue({
152
143
  }
153
144
  );
154
145
  } catch {
155
- return (H = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || H.call(
146
+ return (Q = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || Q.call(
156
147
  e,
157
- l,
148
+ n,
158
149
  o.value,
159
150
  v.crop,
160
151
  {
@@ -164,109 +155,98 @@ const Oe = /* @__PURE__ */ ue({
164
155
  },
165
156
  errorMessage: "图片剪裁失败"
166
157
  }
167
- ), (W = y.value) != null && W.showErrorMessage && x.error("图片剪裁失败"), r();
158
+ ), (H = y.value) != null && H.showErrorMessage && U.error("图片剪裁失败"), u();
168
159
  } finally {
169
- g.value = void 0;
160
+ O.value = void 0;
170
161
  }
171
162
  }
172
- if ((N = C.value) != null && N.enable) {
163
+ if ((W = p.value) != null && W.enable) {
173
164
  c.value = {
174
165
  loading: !0,
175
166
  text: `第${o.value + 1}张图片处理中,请稍等`
176
167
  }, (P = e == null ? void 0 : e.onInnerBeforeUploadStart) == null || P.call(
177
168
  e,
178
- l,
169
+ n,
179
170
  o.value,
180
171
  v.compress
181
172
  );
182
- const n = await Ue(u, {
183
- maxSize: C.value.maxSize,
184
- size: C.value.size,
185
- excludeAllowedTypes: (T = C.value.excludeAllowedTypes) == null ? void 0 : T.map((h) => `image/${h}`)
173
+ const l = await ve(r, {
174
+ maxSize: p.value.maxSize,
175
+ size: p.value.size,
176
+ excludeAllowedTypes: (T = p.value.excludeAllowedTypes) == null ? void 0 : T.map((I) => `image/${I}`)
186
177
  });
187
178
  if (c.value = void 0, (q = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || q.call(
188
179
  e,
189
- l,
180
+ n,
190
181
  o.value,
191
182
  v.compress,
192
183
  {
193
- success: n.success,
184
+ success: l.success,
194
185
  error: {
195
186
  compress: !0
196
187
  },
197
- errorMessage: n == null ? void 0 : n.errorMessage
188
+ errorMessage: l == null ? void 0 : l.errorMessage
198
189
  }
199
- ), !n.success)
200
- return (V = C.value) != null && V.showErrorMessage && x.error((n == null ? void 0 : n.errorMessage) || "图片压缩失败"), r();
201
- u = new File([n.file], s, {
202
- type: n.file.type
190
+ ), !l.success)
191
+ return (N = p.value) != null && N.showErrorMessage && U.error((l == null ? void 0 : l.errorMessage) || "图片压缩失败"), u();
192
+ r = new File([l.file], s, {
193
+ type: l.file.type
203
194
  });
204
195
  }
205
- c.value = void 0, (D = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || D.call(
196
+ c.value = void 0, (V = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || V.call(
206
197
  e,
207
- l,
198
+ n,
208
199
  o.value,
209
200
  v.all,
210
201
  {
211
202
  success: !0
212
203
  }
213
- ), t(u);
204
+ ), t(r);
214
205
  });
215
- let I;
216
- return G(
206
+ let h;
207
+ return D(
217
208
  () => c.value,
218
209
  () => {
219
210
  var a;
220
- c.value ? I = x.loading({
211
+ c.value ? h = U.loading({
221
212
  content: c.value.text,
222
213
  id: "image-upload-id",
223
214
  duration: 0
224
- }) : (a = I == null ? void 0 : I.close) == null || a.call(I);
215
+ }) : (a = h == null ? void 0 : h.close) == null || a.call(h);
225
216
  }
226
- ), Z({
227
- uploadInsRef: S,
228
- cropperInsRef: O
229
- }), (a, l) => {
230
- const t = de("a-upload");
231
- return J(), se("div", null, [
232
- ce(t, {
233
- class: fe([`${Ce}-upload`]),
217
+ ), X({
218
+ uploadInsRef: M,
219
+ cropperInsRef: Y
220
+ }), (a, n) => {
221
+ const t = oe("a-upload");
222
+ return te(), ie("div", null, [
223
+ ue(t, {
224
+ class: re([`${me}-upload`]),
234
225
  ref_key: "uploadInsRef",
235
- ref: S,
226
+ ref: M,
236
227
  "list-type": "picture-card",
237
228
  tip: a.tip || "上传",
238
229
  "image-preview": "",
239
230
  "file-list": i.value,
240
- "onUpdate:fileList": l[0] || (l[0] = (r) => i.value = r),
231
+ "onUpdate:fileList": n[0] || (n[0] = (u) => i.value = u),
241
232
  action: a.action,
242
233
  headers: a.headers,
243
234
  data: a.data,
244
235
  name: a.name,
245
- accept: A.value,
236
+ accept: Z.value,
246
237
  multiple: a.multiple,
247
238
  limit: a.limit,
248
239
  disabled: a.disabled,
249
- "on-before-upload": R,
250
- "on-before-remove": ee,
251
- onExceedLimit: ae,
252
- onSuccess: le,
253
- onError: ne
254
- }, null, 8, ["class", "tip", "file-list", "action", "headers", "data", "name", "accept", "multiple", "limit", "disabled"]),
255
- g.value && o.value !== void 0 ? (J(), ve(ge, {
256
- key: 0,
257
- ref_key: "cropperInsRef",
258
- ref: O,
259
- file: g.value.file,
260
- index: o.value,
261
- options: y.value,
262
- onCancel: te,
263
- onConfirm: ie,
264
- onImgLoad: re
265
- }, null, 8, ["file", "index", "options"])) : me("", !0)
240
+ "on-before-upload": _,
241
+ "on-before-remove": A,
242
+ onExceedLimit: R,
243
+ onSuccess: ee,
244
+ onError: ae
245
+ }, null, 8, ["class", "tip", "file-list", "action", "headers", "data", "name", "accept", "multiple", "limit", "disabled"])
266
246
  ]);
267
247
  };
268
248
  }
269
249
  });
270
250
  export {
271
- Oe as default
251
+ Ee as default
272
252
  };
@@ -1428,5 +1428,7 @@ declare const ProImageUpload: {
1428
1428
  }, {}, string, {}> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & {
1429
1429
  install: (app: App) => void;
1430
1430
  };
1431
+ export * from './types';
1432
+ export * from './constant';
1431
1433
  export { ProImageUpload };
1432
1434
  export default ProImageUpload;
@@ -1,8 +1,8 @@
1
1
  import e from "./image-upload.vue.js";
2
- import { Modal as s, Upload as t, Button as l, Tooltip as m, Icon as n } from "@arco-design/web-vue";
2
+ import { Modal as s, Upload as t, Button as l, Tooltip as m, Spin as n, Space as u, Message as a } from "@arco-design/web-vue";
3
3
  const r = Object.assign(e, {
4
4
  install: (o) => {
5
- o == null || o.use(s), o == null || o.use(t), o == null || o.use(l), o == null || o.use(m), o == null || o.use(n), o == null || o.component("KbProImageUpload", e);
5
+ o.use(s), o.use(t), o.use(l), o.use(m), o.use(n), o.use(u), o.use(a), o.component("KbProImageUpload", e);
6
6
  }
7
7
  }), d = r;
8
8
  export {
package/es/style.css CHANGED
@@ -1 +1 @@
1
- .keyblade-pro-page-container .keyblade-pro-page-container-content{padding:20px}.keyblade-pro-page-header{background:var(--color-bg-2);padding:16px 32px}.keyblade-pro-page-header .keyblade-pro-page-header-section-breadcrumb .arco-breadcrumb-item:first-child{padding-left:0}.keyblade-pro-page-header .keyblade-pro-page-header-title.arco-typography{padding-top:4px;margin-top:0}.keyblade-pro-menu .keyblade-pro-menu-item-img{width:14px;height:auto}.keyblade-pro-layout{width:100%;height:100%}.keyblade-pro-layout .keyblade-pro-layout-header{position:fixed;top:0;left:0;width:100%;height:var(--2156faf3);z-index:100;display:flex;align-items:center;justify-content:space-between;padding:0 20px;background-color:var(--color-bg-2);border-bottom:1px solid var(--color-border);transition:all .2s cubic-bezier(.34,.69,.1,1)}.keyblade-pro-layout .keyblade-pro-layout-header-left{cursor:pointer;display:flex;align-items:center}.keyblade-pro-layout .keyblade-pro-layout-header-left-logo-img{width:28px;height:28px}.keyblade-pro-layout .keyblade-pro-layout-header-left-logo-title.arco-typography{margin:0;font-size:18px}.keyblade-pro-layout .keyblade-pro-layout-header-center{flex:1}.keyblade-pro-layout .keyblade-pro-layout-sider{padding-top:var(--2156faf3);position:fixed;top:0;left:0;z-index:99;height:100%;transition:all .2s cubic-bezier(.34,.69,.1,1)}.keyblade-pro-layout .keyblade-pro-layout-sider-content{position:relative;height:100%;overflow:auto}.keyblade-pro-layout .keyblade-pro-layout-sider-collapse-btn.arco-btn{position:absolute;right:12px;bottom:12px}.keyblade-pro-layout .keyblade-pro-layout-body{padding-top:var(--2156faf3);padding-left:var(--2e3e7e4c);min-height:100vh;overflow-y:hidden;background-color:var(--color-fill-2);transition:padding .2s cubic-bezier(.34,.69,.1,1)}.keyblade-pro-layout .keyblade-pro-layout-body-affix .arco-affix{z-index:98}.keyblade-pro-layout .keyblade-pro-layout-body-footer{display:flex;align-items:center;justify-content:center;height:40px;color:var(--color-text-2);text-align:center}.keyblade-pro-layout .keyblade-pro-layout-body-collapsed{padding-left:var(--a70b89aa)}.keyblade-pro-layout-side .keyblade-pro-layout-header{z-index:98;left:var(--2e3e7e4c);width:calc(100% - var(--2e3e7e4c))}.keyblade-pro-layout-side .keyblade-pro-layout-header-collapsed{left:var(--a70b89aa);width:calc(100% - var(--a70b89aa))}.keyblade-pro-layout-side .keyblade-pro-layout-sider{padding-top:0}.keyblade-pro-layout-side .keyblade-pro-layout-sider-content-logo{position:relative;display:flex;align-items:center;padding:16px;cursor:pointer;transition:padding .3s cubic-bezier(.645,.045,.355,1)}.keyblade-pro-layout-side .keyblade-pro-layout-sider-content-logo-img{width:28px;height:28px}.keyblade-pro-layout-side .keyblade-pro-layout-sider-content-logo-title.arco-typography{margin:0;font-size:18px}.keyblade-pro-layout-side .keyblade-pro-layout-sider-collapsed .keyblade-pro-layout-sider-content-logo{padding:16px 10px}.keyblade-pro-reuse-tabs{position:relative;background-color:var(--color-bg-2);padding:4px 20px}.keyblade-pro-image-upload-cropper-dialog-cropper-wrapper[data-v-ae8ab9e0]{width:100%;height:400px}.keyblade-pro-image-upload-cropper-dialog-operate[data-v-ae8ab9e0]{margin-top:24px;display:flex;align-items:center;justify-content:center}.keyblade-pro-image-upload-cropper-dialog-footer[data-v-ae8ab9e0]{margin-top:24px;display:flex;align-items:center;justify-content:flex-end}.keyblade-pro-image-upload-cropper-dialog-footer-left[data-v-ae8ab9e0]{display:flex;align-items:center;justify-content:flex-start;margin-right:12px}.keyblade-pro-image-upload-cropper-dialog-footer-right[data-v-ae8ab9e0]{flex:1;display:flex;align-items:center;justify-content:flex-end}
1
+ .keyblade-pro-page-container .keyblade-pro-page-container-content{padding:20px}.keyblade-pro-menu .keyblade-pro-menu-item-img{width:14px;height:auto}.keyblade-pro-page-header{background:var(--color-bg-2);padding:16px 32px}.keyblade-pro-page-header .keyblade-pro-page-header-section-breadcrumb .arco-breadcrumb-item:first-child{padding-left:0}.keyblade-pro-page-header .keyblade-pro-page-header-title.arco-typography{padding-top:4px;margin-top:0}.keyblade-pro-reuse-tabs{position:relative;background-color:var(--color-bg-2);padding:4px 20px}.keyblade-pro-layout{width:100%;height:100%}.keyblade-pro-layout .keyblade-pro-layout-header{position:fixed;top:0;left:0;width:100%;height:var(--2156faf3);z-index:100;display:flex;align-items:center;justify-content:space-between;padding:0 20px;background-color:var(--color-bg-2);border-bottom:1px solid var(--color-border);transition:all .2s cubic-bezier(.34,.69,.1,1)}.keyblade-pro-layout .keyblade-pro-layout-header-left{cursor:pointer;display:flex;align-items:center}.keyblade-pro-layout .keyblade-pro-layout-header-left-logo-img{width:28px;height:28px}.keyblade-pro-layout .keyblade-pro-layout-header-left-logo-title.arco-typography{margin:0;font-size:18px}.keyblade-pro-layout .keyblade-pro-layout-header-center{flex:1}.keyblade-pro-layout .keyblade-pro-layout-sider{padding-top:var(--2156faf3);position:fixed;top:0;left:0;z-index:99;height:100%;transition:all .2s cubic-bezier(.34,.69,.1,1)}.keyblade-pro-layout .keyblade-pro-layout-sider-content{position:relative;height:100%;overflow:auto}.keyblade-pro-layout .keyblade-pro-layout-sider-collapse-btn.arco-btn{position:absolute;right:12px;bottom:12px}.keyblade-pro-layout .keyblade-pro-layout-body{padding-top:var(--2156faf3);padding-left:var(--2e3e7e4c);min-height:100vh;overflow-y:hidden;background-color:var(--color-fill-2);transition:padding .2s cubic-bezier(.34,.69,.1,1)}.keyblade-pro-layout .keyblade-pro-layout-body-affix .arco-affix{z-index:98}.keyblade-pro-layout .keyblade-pro-layout-body-footer{display:flex;align-items:center;justify-content:center;height:40px;color:var(--color-text-2);text-align:center}.keyblade-pro-layout .keyblade-pro-layout-body-collapsed{padding-left:var(--a70b89aa)}.keyblade-pro-layout-side .keyblade-pro-layout-header{z-index:98;left:var(--2e3e7e4c);width:calc(100% - var(--2e3e7e4c))}.keyblade-pro-layout-side .keyblade-pro-layout-header-collapsed{left:var(--a70b89aa);width:calc(100% - var(--a70b89aa))}.keyblade-pro-layout-side .keyblade-pro-layout-sider{padding-top:0}.keyblade-pro-layout-side .keyblade-pro-layout-sider-content-logo{position:relative;display:flex;align-items:center;padding:16px;cursor:pointer;transition:padding .3s cubic-bezier(.645,.045,.355,1)}.keyblade-pro-layout-side .keyblade-pro-layout-sider-content-logo-img{width:28px;height:28px}.keyblade-pro-layout-side .keyblade-pro-layout-sider-content-logo-title.arco-typography{margin:0;font-size:18px}.keyblade-pro-layout-side .keyblade-pro-layout-sider-collapsed .keyblade-pro-layout-sider-content-logo{padding:16px 10px}
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.12.0-alpha.2",
5
+ "version": "1.12.0-alpha.4",
6
6
  "private": false,
7
7
  "type": "module",
8
8
  "main": "es/index.js",
@@ -1,9 +0,0 @@
1
- const s = (t, e) => {
2
- const o = t.__vccOpts || t;
3
- for (const [r, c] of e)
4
- o[r] = c;
5
- return o;
6
- };
7
- export {
8
- s as default
9
- };
@@ -1,41 +0,0 @@
1
- import { ImageUploadCropOptions } from '@keyblade/one-travel';
2
-
3
- declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
4
- file: File;
5
- index: number;
6
- options: ImageUploadCropOptions;
7
- }>, {}>, {
8
- cropperInsRef: import('vue').Ref<any>;
9
- }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
- cancel: () => void;
11
- confirm: (value: File) => void;
12
- imgLoad: (value: File) => void;
13
- reUpload: (index: number) => void;
14
- }, string, import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
15
- file: File;
16
- index: number;
17
- options: ImageUploadCropOptions;
18
- }>, {}>>> & {
19
- onCancel?: (() => any) | undefined;
20
- onConfirm?: ((value: File) => any) | undefined;
21
- onImgLoad?: ((value: File) => any) | undefined;
22
- onReUpload?: ((index: number) => any) | undefined;
23
- }, {}, {}>;
24
- export default _default;
25
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
26
- type __VLS_TypePropsToRuntimeProps<T> = {
27
- [K in keyof T]-?: {} extends Pick<T, K> ? {
28
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
29
- } : {
30
- type: import('vue').PropType<T[K]>;
31
- required: true;
32
- };
33
- };
34
- type __VLS_WithDefaults<P, D> = {
35
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
36
- default: D[K];
37
- }> : P[K];
38
- };
39
- type __VLS_Prettify<T> = {
40
- [K in keyof T]: T[K];
41
- } & {};
@@ -1,7 +0,0 @@
1
- import o from "./cropper.vue2.js";
2
- import "./cropper.vue3.js";
3
- import r from "../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-ae8ab9e0"]]);
5
- export {
6
- e as default
7
- };
@@ -1,211 +0,0 @@
1
- import { defineComponent as j, ref as d, watch as D, resolveComponent as l, openBlock as M, createBlock as P, normalizeClass as _, withCtx as a, createVNode as e, mergeProps as q, createElementVNode as y, createTextVNode as x, nextTick as C } from "vue";
2
- import "vue-cropper/dist/index.css";
3
- import G from "vue-cropper/lib/vue-cropper.vue";
4
- const i = "keyblade-pro-image-upload-cropper", Q = /* @__PURE__ */ j({
5
- __name: "cropper",
6
- props: {
7
- file: {},
8
- index: {},
9
- options: {}
10
- },
11
- emits: ["cancel", "confirm", "imgLoad", "reUpload"],
12
- setup(H, { expose: R, emit: f }) {
13
- const s = H, o = d(), w = d(), u = d(!0), g = d(!1), m = d({
14
- autoCropWidth: 100,
15
- autoCropHeight: 100
16
- }), W = () => {
17
- o.value.changeScale(1);
18
- }, z = () => {
19
- o.value.changeScale(-1);
20
- }, I = () => {
21
- o.value.rotateRight();
22
- const { w: t, h: n } = v();
23
- C(() => {
24
- o.value.goAutoCrop(t, n);
25
- });
26
- }, L = () => {
27
- o.value.rotateLeft();
28
- const { w: t, h: n } = v();
29
- C(() => {
30
- o.value.goAutoCrop(t, n);
31
- });
32
- }, $ = () => {
33
- o.value.reload(), o.value.rotateClear(), C(() => {
34
- o.value.goAutoCrop();
35
- });
36
- }, b = () => {
37
- f("cancel");
38
- }, N = () => {
39
- u.value || g.value || (g.value = !0, o.value.getCropBlob((t) => {
40
- g.value = !1;
41
- const n = new File([t], s.file.name, { type: "image/jpeg" });
42
- f("confirm", n);
43
- }));
44
- }, S = () => {
45
- u.value = !1;
46
- const { w: t, h: n } = v();
47
- m.value.autoCropWidth = t, m.value.autoCropHeight = n, f("imgLoad", s.file);
48
- }, v = () => {
49
- const t = Math.abs(o.value.rotate) % 2 > 0, n = (t ? o.value.trueHeight : o.value.trueWidth) * o.value.scale, r = (t ? o.value.trueWidth : o.value.trueHeight) * o.value.scale;
50
- return { w: n, h: r };
51
- };
52
- return D(
53
- () => s.file,
54
- () => {
55
- if (s.file) {
56
- u.value = !0, o.value && o.value.clearCrop();
57
- const t = new FileReader();
58
- t.onloadend = () => {
59
- const n = t.result, r = new Image();
60
- r.onload = () => {
61
- const h = r.width, c = r.height;
62
- w.value = {
63
- data: n,
64
- width: h,
65
- height: c
66
- };
67
- }, r.src = n;
68
- }, t.readAsDataURL(s.file);
69
- }
70
- },
71
- { immediate: !0 }
72
- ), R({
73
- cropperInsRef: o
74
- }), (t, n) => {
75
- const r = l("a-spin"), h = l("icon-zoom-in"), c = l("a-button"), p = l("a-tooltip"), A = l("icon-zoom-out"), B = l("icon-rotate-right"), V = l("icon-rotate-left"), E = l("icon-sync"), F = l("a-button-group"), T = l("a-space"), U = l("a-modal");
76
- return M(), P(U, {
77
- "render-to-body": "",
78
- class: _(`${i}-dialog`),
79
- title: "编辑图片",
80
- width: "675px",
81
- visible: !0,
82
- footer: !1,
83
- "mask-closable": !1,
84
- "esc-to-close": !1,
85
- "unmount-on-close": "",
86
- onClose: b
87
- }, {
88
- default: a(() => [
89
- e(r, {
90
- class: _(`${i}-dialog-cropper-wrapper`),
91
- loading: u.value
92
- }, {
93
- default: a(() => {
94
- var k;
95
- return [
96
- e(G, q({
97
- ref_key: "cropperInsRef",
98
- ref: o,
99
- class: `${i}-dialog-cropper`,
100
- img: (k = w.value) == null ? void 0 : k.data,
101
- info: !1,
102
- autoCrop: !0,
103
- autoCropWidth: m.value.autoCropWidth,
104
- autoCropHeight: m.value.autoCropHeight,
105
- full: !0
106
- }, t.options, { onImgLoad: S }), null, 16, ["class", "img", "autoCropWidth", "autoCropHeight"])
107
- ];
108
- }),
109
- _: 1
110
- }, 8, ["class", "loading"]),
111
- y("div", {
112
- class: _(`${i}-dialog-operate`)
113
- }, [
114
- e(F, { type: "primary" }, {
115
- default: a(() => [
116
- e(p, { content: "放大" }, {
117
- default: a(() => [
118
- e(c, { onClick: W }, {
119
- icon: a(() => [
120
- e(h)
121
- ]),
122
- _: 1
123
- })
124
- ]),
125
- _: 1
126
- }),
127
- e(p, { content: "缩小" }, {
128
- default: a(() => [
129
- e(c, { onClick: z }, {
130
- icon: a(() => [
131
- e(A)
132
- ]),
133
- _: 1
134
- })
135
- ]),
136
- _: 1
137
- }),
138
- e(p, { content: "向右旋转" }, {
139
- default: a(() => [
140
- e(c, { onClick: I }, {
141
- icon: a(() => [
142
- e(B)
143
- ]),
144
- _: 1
145
- })
146
- ]),
147
- _: 1
148
- }),
149
- e(p, { content: "向左旋转" }, {
150
- default: a(() => [
151
- e(c, { onClick: L }, {
152
- icon: a(() => [
153
- e(V)
154
- ]),
155
- _: 1
156
- })
157
- ]),
158
- _: 1
159
- }),
160
- e(p, { content: "重置" }, {
161
- default: a(() => [
162
- e(c, { onClick: $ }, {
163
- icon: a(() => [
164
- e(E)
165
- ]),
166
- _: 1
167
- })
168
- ]),
169
- _: 1
170
- })
171
- ]),
172
- _: 1
173
- })
174
- ], 2),
175
- y("div", {
176
- class: _(`${i}-dialog-footer`)
177
- }, [
178
- e(T, {
179
- class: _(`${i}-dialog-footer-right`)
180
- }, {
181
- default: a(() => [
182
- e(c, { onClick: b }, {
183
- default: a(() => [
184
- x("取消")
185
- ]),
186
- _: 1
187
- }),
188
- e(c, {
189
- disabled: u.value,
190
- type: "primary",
191
- onClick: N,
192
- loading: g.value
193
- }, {
194
- default: a(() => [
195
- x("确定")
196
- ]),
197
- _: 1
198
- }, 8, ["disabled", "loading"])
199
- ]),
200
- _: 1
201
- }, 8, ["class"])
202
- ], 2)
203
- ]),
204
- _: 1
205
- }, 8, ["class"]);
206
- };
207
- }
208
- });
209
- export {
210
- Q as default
211
- };
@@ -1 +0,0 @@
1
-