@keyblade/pro-components 1.12.0-alpha.7 → 1.12.0-alpha.8

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.
@@ -0,0 +1,9 @@
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
+ };
@@ -0,0 +1,41 @@
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
+ } & {};
@@ -0,0 +1,7 @@
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
+ };
@@ -0,0 +1,211 @@
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
+ };
@@ -10,6 +10,13 @@ declare const _default: import('vue').DefineComponent<{
10
10
  data: {
11
11
  type: import('vue').PropType<Record<string, any>>;
12
12
  };
13
+ disabled: {
14
+ type: import('vue').PropType<boolean>;
15
+ default: boolean | undefined;
16
+ };
17
+ tip: {
18
+ type: import('vue').PropType<string>;
19
+ };
13
20
  onError: {
14
21
  type: import('vue').PropType<(fileItem: FileItem) => void>;
15
22
  };
@@ -35,9 +42,6 @@ declare const _default: import('vue').DefineComponent<{
35
42
  type: import('vue').PropType<string>;
36
43
  default: string | undefined;
37
44
  };
38
- tip: {
39
- type: import('vue').PropType<string>;
40
- };
41
45
  accept: {
42
46
  type: import('vue').PropType<string[]>;
43
47
  default: () => string[];
@@ -53,10 +57,6 @@ declare const _default: import('vue').DefineComponent<{
53
57
  limit: {
54
58
  type: import('vue').PropType<number>;
55
59
  };
56
- disabled: {
57
- type: import('vue').PropType<boolean>;
58
- default: boolean | undefined;
59
- };
60
60
  hideInnerBeforeUploadLoading: {
61
61
  type: import('vue').PropType<boolean>;
62
62
  default: boolean | undefined;
@@ -122,24 +122,6 @@ declare const _default: import('vue').DefineComponent<{
122
122
  download?: boolean | undefined;
123
123
  showLink?: boolean | undefined;
124
124
  listType?: import('@arco-design/web-vue/es/upload/interfaces').ListType | undefined;
125
- readonly data?: Record<string, string | Blob> | ((fileItem: FileItem) => Record<string, string | Blob>) | undefined;
126
- style?: unknown;
127
- onChange?: ((fileList: FileItem[], fileItem: FileItem) => any) | undefined;
128
- onError?: ((fileItem: FileItem) => any) | undefined;
129
- onProgress?: ((fileItem: FileItem, ev?: ProgressEvent<EventTarget> | undefined) => any) | undefined;
130
- readonly action?: string | undefined;
131
- readonly headers?: Record<string, string> | undefined;
132
- readonly name?: string | ((fileItem: FileItem) => string) | undefined;
133
- readonly tip?: string | undefined;
134
- readonly accept?: string | undefined;
135
- onSuccess?: ((fileItem: FileItem) => any) | undefined;
136
- readonly onBeforeUpload?: ((file: File) => boolean | Promise<boolean | File>) | undefined;
137
- readonly customRequest?: ((option: import('@arco-design/web-vue').RequestOption) => import('@arco-design/web-vue').UploadRequest) | undefined;
138
- readonly imageLoading?: "eager" | "lazy" | undefined;
139
- readonly responseUrlKey?: string | ((fileItem: FileItem) => string) | undefined;
140
- readonly customIcon?: import('@arco-design/web-vue').CustomIcon | undefined;
141
- readonly onBeforeRemove?: ((fileItem: FileItem) => Promise<boolean>) | undefined;
142
- readonly onButtonClick?: ((event: Event) => void | Promise<FileList>) | undefined;
143
125
  key?: string | number | symbol | undefined;
144
126
  ref?: import('vue').VNodeRef | undefined;
145
127
  ref_for?: boolean | undefined;
@@ -183,6 +165,24 @@ declare const _default: import('vue').DefineComponent<{
183
165
  [key: string]: any;
184
166
  }>) => void)[] | undefined;
185
167
  class?: unknown;
168
+ style?: unknown;
169
+ readonly data?: Record<string, string | Blob> | ((fileItem: FileItem) => Record<string, string | Blob>) | undefined;
170
+ readonly tip?: string | undefined;
171
+ onChange?: ((fileList: FileItem[], fileItem: FileItem) => any) | undefined;
172
+ onError?: ((fileItem: FileItem) => any) | undefined;
173
+ onProgress?: ((fileItem: FileItem, ev?: ProgressEvent<EventTarget> | undefined) => any) | undefined;
174
+ readonly action?: string | undefined;
175
+ readonly headers?: Record<string, string> | undefined;
176
+ readonly name?: string | ((fileItem: FileItem) => string) | undefined;
177
+ readonly accept?: string | undefined;
178
+ onSuccess?: ((fileItem: FileItem) => any) | undefined;
179
+ readonly onBeforeUpload?: ((file: File) => boolean | Promise<boolean | File>) | undefined;
180
+ readonly customRequest?: ((option: import('@arco-design/web-vue').RequestOption) => import('@arco-design/web-vue').UploadRequest) | undefined;
181
+ readonly imageLoading?: "eager" | "lazy" | undefined;
182
+ readonly responseUrlKey?: string | ((fileItem: FileItem) => string) | undefined;
183
+ readonly customIcon?: import('@arco-design/web-vue').CustomIcon | undefined;
184
+ readonly onBeforeRemove?: ((fileItem: FileItem) => Promise<boolean>) | undefined;
185
+ readonly onButtonClick?: ((event: Event) => void | Promise<FileList>) | undefined;
186
186
  onExceedLimit?: ((fileList: FileItem[], files: File[]) => any) | undefined;
187
187
  onPreview?: ((fileItem: FileItem) => any) | undefined;
188
188
  "onUpdate:fileList"?: ((fileList: FileItem[]) => any) | undefined;
@@ -198,7 +198,7 @@ declare const _default: import('vue').DefineComponent<{
198
198
  }>;
199
199
  $root: import('vue').ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import('vue').ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
200
200
  $parent: import('vue').ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import('vue').ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
201
- $emit: ((event: "progress", fileItem: FileItem, ev?: ProgressEvent<EventTarget> | undefined) => void) & ((event: "success", fileItem: FileItem) => void) & ((event: "error", fileItem: FileItem) => void) & ((event: "preview", fileItem: FileItem) => void) & ((event: "change", fileList: FileItem[], fileItem: FileItem) => void) & ((event: "exceedLimit", fileList: FileItem[], files: File[]) => void) & ((event: "update:fileList", fileList: FileItem[]) => void);
201
+ $emit: ((event: "error", fileItem: FileItem) => void) & ((event: "success", fileItem: FileItem) => void) & ((event: "progress", fileItem: FileItem, ev?: ProgressEvent<EventTarget> | undefined) => void) & ((event: "preview", fileItem: FileItem) => void) & ((event: "change", fileList: FileItem[], fileItem: FileItem) => void) & ((event: "exceedLimit", fileList: FileItem[], files: File[]) => void) & ((event: "update:fileList", fileList: FileItem[]) => void);
202
202
  $el: any;
203
203
  $options: import('vue').ComponentOptionsBase<Readonly<{
204
204
  fileList?: unknown;
@@ -440,6 +440,13 @@ declare const _default: import('vue').DefineComponent<{
440
440
  data: {
441
441
  type: import('vue').PropType<Record<string, any>>;
442
442
  };
443
+ disabled: {
444
+ type: import('vue').PropType<boolean>;
445
+ default: boolean | undefined;
446
+ };
447
+ tip: {
448
+ type: import('vue').PropType<string>;
449
+ };
443
450
  onError: {
444
451
  type: import('vue').PropType<(fileItem: FileItem) => void>;
445
452
  };
@@ -465,9 +472,6 @@ declare const _default: import('vue').DefineComponent<{
465
472
  type: import('vue').PropType<string>;
466
473
  default: string | undefined;
467
474
  };
468
- tip: {
469
- type: import('vue').PropType<string>;
470
- };
471
475
  accept: {
472
476
  type: import('vue').PropType<string[]>;
473
477
  default: () => string[];
@@ -483,10 +487,6 @@ declare const _default: import('vue').DefineComponent<{
483
487
  limit: {
484
488
  type: import('vue').PropType<number>;
485
489
  };
486
- disabled: {
487
- type: import('vue').PropType<boolean>;
488
- default: boolean | undefined;
489
- };
490
490
  hideInnerBeforeUploadLoading: {
491
491
  type: import('vue').PropType<boolean>;
492
492
  default: boolean | undefined;
@@ -529,11 +529,11 @@ declare const _default: import('vue').DefineComponent<{
529
529
  }>> & {
530
530
  onCropperImgLoad?: ((value: File) => any) | undefined;
531
531
  }, {
532
+ disabled: boolean;
532
533
  name: string;
533
534
  accept: string[];
534
535
  multiple: boolean;
535
536
  singleLimit: number;
536
- disabled: boolean;
537
537
  hideInnerBeforeUploadLoading: boolean;
538
538
  }, {}>;
539
539
  export default _default;