@kingteza/crud-component 1.44.1 → 1.45.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/dist/_virtual/index.cjs.js +1 -1
- package/dist/_virtual/index.cjs2.js +1 -1
- package/dist/_virtual/index.cjs3.js +1 -1
- package/dist/_virtual/index.es.js +2 -5
- package/dist/_virtual/index.es2.js +5 -5
- package/dist/_virtual/index.es3.js +5 -2
- package/dist/common/picker/ImagePicker.cjs.js +1 -1
- package/dist/common/picker/ImagePicker.d.ts +6 -2
- package/dist/common/picker/ImagePicker.es.js +278 -232
- package/dist/crud/ImageCrudField.cjs.js +1 -1
- package/dist/crud/ImageCrudField.d.ts +3 -1
- package/dist/crud/ImageCrudField.es.js +133 -96
- package/dist/crud/modal/index.cjs.js +1 -1
- package/dist/crud/modal/index.es.js +120 -109
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/react/Input.cjs.js +1 -1
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/react/Input.es.js +1 -1
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.cjs.js +1 -1
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.es.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/CountryIcon.cjs.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/CountryIcon.es.js +2 -2
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/CountrySelect.cjs.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/CountrySelect.es.js +2 -2
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/Flag.cjs.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/Flag.es.js +2 -2
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/InputBasic.cjs.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/InputBasic.es.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/InputSmart.cjs.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/InputSmart.es.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/InternationalIcon.cjs.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/InternationalIcon.es.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/PhoneInputWithCountry.cjs.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/PhoneInputWithCountry.es.js +2 -2
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/PropTypes.cjs.js +1 -1
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/PropTypes.es.js +1 -1
- package/package.json +1 -1
|
@@ -1,296 +1,342 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
1
|
+
import { jsx as r, jsxs as U, Fragment as ue } from "react/jsx-runtime";
|
|
2
2
|
import { Cropper as Be } from "react-advanced-cropper";
|
|
3
|
-
import { RotateLeftOutlined as
|
|
4
|
-
import { Form as
|
|
5
|
-
import
|
|
3
|
+
import { RotateLeftOutlined as Re, RotateRightOutlined as Te, UploadOutlined as ve, LoadingOutlined as Le } from "@ant-design/icons";
|
|
4
|
+
import { Form as De, Modal as me, Space as fe, Upload as He } from "antd";
|
|
5
|
+
import G, { useRef as K, useState as I, useCallback as E, useEffect as M, useMemo as ge } from "react";
|
|
6
6
|
import { useTranslationLib as Ve } from "../../locale/index.es.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import x from "../button/Button.es.js";
|
|
8
|
+
import he from "../../util/ImageUtil.es.js";
|
|
9
9
|
import _e from "../../icons/FlipHIcon.es.js";
|
|
10
10
|
import Ee from "../../icons/FlipVIcon.es.js";
|
|
11
|
-
const Me =
|
|
12
|
-
function
|
|
13
|
-
return new Promise((
|
|
14
|
-
const
|
|
15
|
-
|
|
11
|
+
const Me = De.Item, we = "crud-component.image-picker.button-state";
|
|
12
|
+
function Q(c) {
|
|
13
|
+
return new Promise((b, y) => {
|
|
14
|
+
const n = new FileReader();
|
|
15
|
+
n.readAsDataURL(c), n.onload = () => b(n.result), n.onerror = (m) => y(m);
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
const
|
|
19
|
-
values:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
18
|
+
const tt = ({
|
|
19
|
+
values: c = [],
|
|
20
|
+
getRealUrl: b,
|
|
21
|
+
required: y,
|
|
22
|
+
buttonType: n,
|
|
23
|
+
label: m,
|
|
24
|
+
name: J,
|
|
25
|
+
onChange: C,
|
|
26
|
+
aspectRatio: F,
|
|
27
|
+
buttonTitle: z,
|
|
28
|
+
hidePreview: O,
|
|
29
|
+
buttonSize: k = "large",
|
|
30
|
+
showButtonText: B = !0,
|
|
31
|
+
showOnlyIcon: X = !1,
|
|
32
|
+
icon: R = /* @__PURE__ */ r(ve, {}),
|
|
33
|
+
loading: N,
|
|
34
|
+
maxCount: s = 1,
|
|
35
|
+
onAdd: S,
|
|
36
|
+
onRemove: T,
|
|
37
|
+
listType: Y,
|
|
38
|
+
showSkipCropButton: be,
|
|
39
|
+
skipCrop: Z = !1,
|
|
40
|
+
skipResize: W,
|
|
41
|
+
asyncUpload: L,
|
|
40
42
|
...q
|
|
41
43
|
}) => {
|
|
42
|
-
const [
|
|
43
|
-
!e.url && !e.preview && (e.preview = await
|
|
44
|
-
}, [te,
|
|
44
|
+
const [ye, Fe] = G.useState(""), [Ie, Ce] = G.useState(""), [Oe, ee] = G.useState(!1), D = K(), f = K(null), [d, g] = I([]), [j, H] = I(), ke = K(), Se = () => ee(!1), je = async (e) => {
|
|
45
|
+
!e.url && !e.preview && (e.preview = await Q(e.originFileObj)), Ce(e.url || e.preview), ee(!0), Fe(e.name);
|
|
46
|
+
}, [te, P] = I(!1), re = (e) => {
|
|
45
47
|
var t;
|
|
46
|
-
(t =
|
|
47
|
-
}, oe =
|
|
48
|
+
(t = f.current) == null || t.rotateImage(e ? -90 : 90);
|
|
49
|
+
}, oe = E((e) => {
|
|
48
50
|
var t;
|
|
49
|
-
|
|
51
|
+
f.current && ((t = f.current) == null || t.flipImage(e === "h", e === "v"));
|
|
50
52
|
}, []);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}, [
|
|
54
|
-
const [
|
|
53
|
+
M(() => {
|
|
54
|
+
C == null || C(d[0], d);
|
|
55
|
+
}, [d, C]);
|
|
56
|
+
const [V, $] = I(), _ = E(
|
|
55
57
|
async (e) => {
|
|
56
|
-
var
|
|
57
|
-
const { type: t, size:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
name: I,
|
|
62
|
-
uid: k,
|
|
63
|
-
type: t,
|
|
64
|
-
size: a,
|
|
65
|
-
thumbUrl: U,
|
|
66
|
-
originFileObj: E,
|
|
67
|
-
status: j ? "uploading" : void 0
|
|
68
|
-
};
|
|
69
|
-
if (n)
|
|
58
|
+
var de;
|
|
59
|
+
const { type: t, size: i, name: w, uid: a } = D.current;
|
|
60
|
+
$(e ? "skip-crop" : "crop"), P(!0);
|
|
61
|
+
const v = async (o) => {
|
|
62
|
+
if (S)
|
|
70
63
|
try {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
(
|
|
74
|
-
|
|
75
|
-
|
|
64
|
+
if (P(!0), L)
|
|
65
|
+
g(
|
|
66
|
+
(l) => s <= 1 ? [o] : [o, ...l]
|
|
67
|
+
), S(o).then((l) => {
|
|
68
|
+
g(
|
|
69
|
+
(p) => p.map(
|
|
70
|
+
(u) => u.uid === o.uid ? {
|
|
71
|
+
...u,
|
|
72
|
+
status: "done",
|
|
73
|
+
response: l ?? u.response
|
|
74
|
+
} : u
|
|
75
|
+
)
|
|
76
|
+
);
|
|
77
|
+
});
|
|
78
|
+
else {
|
|
79
|
+
const l = await S(o), p = {
|
|
80
|
+
...o,
|
|
81
|
+
response: l ?? o.response,
|
|
82
|
+
status: "done"
|
|
83
|
+
};
|
|
84
|
+
g(
|
|
85
|
+
(u) => s <= 1 ? [p] : [p, ...u]
|
|
76
86
|
);
|
|
77
|
-
}
|
|
87
|
+
}
|
|
78
88
|
} finally {
|
|
79
|
-
|
|
89
|
+
P(!1);
|
|
80
90
|
}
|
|
81
|
-
|
|
91
|
+
else
|
|
92
|
+
g((l) => s <= 1 ? [o] : [o, ...l]);
|
|
93
|
+
};
|
|
94
|
+
if (e) {
|
|
95
|
+
const o = D.current, l = W ? o : await he.resizeImage(o), p = await Q(l);
|
|
96
|
+
await v({
|
|
97
|
+
url: p,
|
|
98
|
+
name: w,
|
|
99
|
+
uid: a,
|
|
100
|
+
type: t,
|
|
101
|
+
size: i,
|
|
102
|
+
thumbUrl: p,
|
|
103
|
+
originFileObj: l,
|
|
104
|
+
status: L ? "uploading" : void 0
|
|
105
|
+
}), P(!1), H(void 0), $(void 0);
|
|
82
106
|
} else {
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
uid:
|
|
87
|
-
}), u =
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
107
|
+
const o = (de = f.current) == null ? void 0 : de.getCanvas();
|
|
108
|
+
o == null || o.toBlob(async (l) => {
|
|
109
|
+
const p = Object.assign(new File([l], w, { type: t }), {
|
|
110
|
+
uid: a
|
|
111
|
+
}), u = W ? p : await he.resizeImage(p), pe = await Q(u);
|
|
112
|
+
await v({
|
|
113
|
+
url: pe,
|
|
114
|
+
name: w,
|
|
115
|
+
uid: a,
|
|
91
116
|
type: t,
|
|
92
|
-
size:
|
|
93
|
-
thumbUrl:
|
|
117
|
+
size: i,
|
|
118
|
+
thumbUrl: pe,
|
|
94
119
|
originFileObj: u,
|
|
95
|
-
status:
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
b(
|
|
99
|
-
(Ue) => Ue.map(
|
|
100
|
-
(G) => G.uid === d.uid ? { ...G, status: "done" } : G
|
|
101
|
-
)
|
|
102
|
-
);
|
|
103
|
-
}) : await n(d)), b([d, ...s]), z(!1);
|
|
104
|
-
}), V(void 0), $(void 0);
|
|
120
|
+
status: L ? "uploading" : void 0
|
|
121
|
+
}), P(!1), H(void 0), $(void 0);
|
|
122
|
+
});
|
|
105
123
|
}
|
|
106
124
|
},
|
|
107
|
-
[
|
|
108
|
-
),
|
|
109
|
-
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
125
|
+
[L, s, S, W]
|
|
126
|
+
), xe = () => {
|
|
127
|
+
H(void 0), D.current = void 0;
|
|
128
|
+
}, ie = E(
|
|
129
|
+
(e) => {
|
|
130
|
+
const t = e;
|
|
131
|
+
if (!t) return;
|
|
132
|
+
if (D.current = t, Z) {
|
|
133
|
+
_(!0);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const i = new FileReader();
|
|
137
|
+
i.addEventListener("load", () => {
|
|
138
|
+
var w;
|
|
139
|
+
if (typeof i.result == "string") {
|
|
140
|
+
H(i.result);
|
|
141
|
+
const a = localStorage.getItem(we), v = a ? JSON.parse(a) : void 0;
|
|
142
|
+
v && ((w = f.current) == null || w.setState(v)), setTimeout(() => {
|
|
143
|
+
ce(f.current);
|
|
122
144
|
}, 100);
|
|
123
145
|
}
|
|
124
|
-
}),
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
146
|
+
}), i.readAsDataURL(t);
|
|
147
|
+
},
|
|
148
|
+
[_, Z]
|
|
149
|
+
);
|
|
150
|
+
M(() => {
|
|
151
|
+
let e = !1;
|
|
152
|
+
return (async () => {
|
|
153
|
+
if (c == null || c === "") {
|
|
154
|
+
e || g([]);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const i = typeof c == "string" ? [c] : c;
|
|
158
|
+
if (!i.length) {
|
|
159
|
+
e || g([]);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const w = await Promise.all(
|
|
163
|
+
i.map(async (a) => {
|
|
164
|
+
const v = b ? await b(a) : a;
|
|
165
|
+
return {
|
|
166
|
+
uid: a,
|
|
167
|
+
url: v,
|
|
168
|
+
thumbUrl: v,
|
|
169
|
+
response: a,
|
|
170
|
+
name: a.split("/").pop() ?? a
|
|
171
|
+
};
|
|
172
|
+
})
|
|
173
|
+
);
|
|
174
|
+
e || g(w);
|
|
175
|
+
})(), () => {
|
|
176
|
+
e = !0;
|
|
177
|
+
};
|
|
178
|
+
}, [c, b]);
|
|
179
|
+
const { t: h } = Ve(), Ne = ge(
|
|
180
|
+
() => y ? {
|
|
181
|
+
required: y,
|
|
182
|
+
validator: (e, t, i) => {
|
|
183
|
+
j || d != null && d.length ? i() : i(`${m ?? ""} ${h("err.validation.required")}`);
|
|
138
184
|
}
|
|
139
185
|
} : void 0,
|
|
140
|
-
[
|
|
141
|
-
),
|
|
186
|
+
[y, j, d == null ? void 0 : d.length, m, h]
|
|
187
|
+
), ne = z ?? h("message.uploadButtonText"), se = ge(
|
|
142
188
|
() => /* @__PURE__ */ r(
|
|
143
189
|
Je,
|
|
144
190
|
{
|
|
145
191
|
showLoadingIndicator: te,
|
|
146
|
-
_buttonTitle:
|
|
147
|
-
buttonSize:
|
|
148
|
-
buttonType:
|
|
149
|
-
fileList:
|
|
150
|
-
hidePreview:
|
|
151
|
-
icon:
|
|
152
|
-
loading:
|
|
153
|
-
listType:
|
|
154
|
-
maxCount:
|
|
155
|
-
onChangeFile:
|
|
156
|
-
onRemove:
|
|
157
|
-
showButtonText:
|
|
158
|
-
handlePreview:
|
|
159
|
-
setFileList:
|
|
192
|
+
_buttonTitle: ne,
|
|
193
|
+
buttonSize: k,
|
|
194
|
+
buttonType: n,
|
|
195
|
+
fileList: d,
|
|
196
|
+
hidePreview: O,
|
|
197
|
+
icon: R,
|
|
198
|
+
loading: N,
|
|
199
|
+
listType: Y,
|
|
200
|
+
maxCount: s,
|
|
201
|
+
onChangeFile: ie,
|
|
202
|
+
onRemove: T,
|
|
203
|
+
showButtonText: B,
|
|
204
|
+
handlePreview: je,
|
|
205
|
+
setFileList: g
|
|
160
206
|
}
|
|
161
207
|
),
|
|
162
208
|
[
|
|
163
209
|
te,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
210
|
+
ne,
|
|
211
|
+
k,
|
|
212
|
+
n,
|
|
213
|
+
d,
|
|
214
|
+
O,
|
|
215
|
+
R,
|
|
216
|
+
N,
|
|
217
|
+
Y,
|
|
167
218
|
s,
|
|
168
|
-
|
|
169
|
-
P,
|
|
219
|
+
ie,
|
|
170
220
|
T,
|
|
171
|
-
|
|
172
|
-
R,
|
|
173
|
-
ne,
|
|
174
|
-
D,
|
|
175
|
-
v
|
|
221
|
+
B
|
|
176
222
|
]
|
|
177
223
|
);
|
|
178
|
-
|
|
179
|
-
const [
|
|
180
|
-
|
|
224
|
+
ke.current = se.props.beforeUpload;
|
|
225
|
+
const [Pe, ae] = I(0), [Ue, le] = I(0), [A, ze] = I();
|
|
226
|
+
M(() => {
|
|
181
227
|
const e = setTimeout(() => {
|
|
182
|
-
A && localStorage.setItem(
|
|
228
|
+
A && localStorage.setItem(we, JSON.stringify(A));
|
|
183
229
|
}, 400);
|
|
184
230
|
return () => clearTimeout(e);
|
|
185
|
-
}, [A]),
|
|
186
|
-
if (!
|
|
187
|
-
|
|
231
|
+
}, [A]), M(() => {
|
|
232
|
+
if (!j) {
|
|
233
|
+
ae(0), le(0);
|
|
188
234
|
const e = setTimeout(() => {
|
|
189
235
|
var t;
|
|
190
|
-
(t =
|
|
236
|
+
(t = f.current) == null || t.reset();
|
|
191
237
|
}, 1500);
|
|
192
238
|
return () => clearTimeout(e);
|
|
193
239
|
}
|
|
194
|
-
}, [
|
|
195
|
-
const
|
|
240
|
+
}, [j]);
|
|
241
|
+
const ce = E(async (e) => {
|
|
196
242
|
if (e) {
|
|
197
243
|
const t = e.getCoordinates();
|
|
198
|
-
|
|
244
|
+
ze(e.getState()), ae((t == null ? void 0 : t.width) ?? 10), le((t == null ? void 0 : t.height) ?? 10);
|
|
199
245
|
}
|
|
200
246
|
}, []);
|
|
201
|
-
return /* @__PURE__ */
|
|
247
|
+
return /* @__PURE__ */ U(ue, { children: [
|
|
202
248
|
/* @__PURE__ */ r(
|
|
203
249
|
Me,
|
|
204
250
|
{
|
|
205
|
-
label:
|
|
251
|
+
label: m,
|
|
206
252
|
...q,
|
|
207
|
-
name:
|
|
253
|
+
name: J,
|
|
208
254
|
className: "mb-0",
|
|
209
|
-
rules: [
|
|
210
|
-
children:
|
|
255
|
+
rules: [Ne, ...q.rules ?? []],
|
|
256
|
+
children: se
|
|
211
257
|
}
|
|
212
258
|
),
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
-
|
|
259
|
+
/* @__PURE__ */ U(
|
|
260
|
+
me,
|
|
215
261
|
{
|
|
216
|
-
open: !!
|
|
262
|
+
open: !!j,
|
|
217
263
|
maskClosable: !1,
|
|
218
|
-
onOk: () =>
|
|
264
|
+
onOk: () => _(!1),
|
|
219
265
|
closable: !1,
|
|
220
266
|
okButtonProps: {
|
|
221
|
-
loading:
|
|
222
|
-
disabled:
|
|
267
|
+
loading: V === "crop",
|
|
268
|
+
disabled: V === "skip-crop"
|
|
223
269
|
},
|
|
224
|
-
onCancel:
|
|
225
|
-
footer: (e, { CancelBtn: t, OkBtn:
|
|
270
|
+
onCancel: xe,
|
|
271
|
+
footer: (e, { CancelBtn: t, OkBtn: i }) => be ? /* @__PURE__ */ U(fe, { children: [
|
|
226
272
|
/* @__PURE__ */ r(t, {}),
|
|
227
273
|
/* @__PURE__ */ r(
|
|
228
|
-
|
|
274
|
+
x,
|
|
229
275
|
{
|
|
230
276
|
type: "primary",
|
|
231
|
-
loading:
|
|
232
|
-
disabled:
|
|
233
|
-
onClick: () =>
|
|
234
|
-
children:
|
|
277
|
+
loading: V === "skip-crop",
|
|
278
|
+
disabled: V === "crop",
|
|
279
|
+
onClick: () => _(!0),
|
|
280
|
+
children: h("str.skipCrop")
|
|
235
281
|
}
|
|
236
282
|
),
|
|
237
|
-
/* @__PURE__ */ r(
|
|
238
|
-
] }) : /* @__PURE__ */ r(
|
|
283
|
+
/* @__PURE__ */ r(i, {})
|
|
284
|
+
] }) : /* @__PURE__ */ r(ue, { children: e }),
|
|
239
285
|
destroyOnHidden: !0,
|
|
240
286
|
children: [
|
|
241
287
|
/* @__PURE__ */ r(
|
|
242
288
|
Be,
|
|
243
289
|
{
|
|
244
|
-
ref:
|
|
290
|
+
ref: f,
|
|
245
291
|
stencilProps: {
|
|
246
292
|
grid: !0
|
|
247
293
|
},
|
|
248
294
|
style: { border: "1px solid black" },
|
|
249
|
-
src:
|
|
295
|
+
src: j,
|
|
250
296
|
onChange: (e) => {
|
|
251
|
-
|
|
297
|
+
ce(e);
|
|
252
298
|
},
|
|
253
|
-
aspectRatio:
|
|
254
|
-
minimum:
|
|
255
|
-
maximum:
|
|
299
|
+
aspectRatio: F ? {
|
|
300
|
+
minimum: F,
|
|
301
|
+
maximum: F
|
|
256
302
|
} : void 0
|
|
257
303
|
}
|
|
258
304
|
),
|
|
259
|
-
/* @__PURE__ */ r("p", { className: "text-center", children: [
|
|
260
|
-
/* @__PURE__ */ r("div", { className: "mt-2 d-flex justify-content-center", children: /* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ r("p", { className: "text-center", children: [Pe, Ue].join(" ⨉ ") }),
|
|
306
|
+
/* @__PURE__ */ r("div", { className: "mt-2 d-flex justify-content-center", children: /* @__PURE__ */ U(fe.Compact, { children: [
|
|
261
307
|
/* @__PURE__ */ r(
|
|
262
|
-
|
|
308
|
+
x,
|
|
263
309
|
{
|
|
264
310
|
size: "large",
|
|
265
|
-
tooltip:
|
|
266
|
-
icon: /* @__PURE__ */ r(
|
|
311
|
+
tooltip: h("str.rotateLeft"),
|
|
312
|
+
icon: /* @__PURE__ */ r(Re, {}),
|
|
267
313
|
onClick: () => re(!0)
|
|
268
314
|
}
|
|
269
315
|
),
|
|
270
316
|
/* @__PURE__ */ r(
|
|
271
|
-
|
|
317
|
+
x,
|
|
272
318
|
{
|
|
273
319
|
size: "large",
|
|
274
320
|
icon: /* @__PURE__ */ r(Te, {}),
|
|
275
|
-
tooltip:
|
|
321
|
+
tooltip: h("str.rotateRight"),
|
|
276
322
|
onClick: () => re(!1)
|
|
277
323
|
}
|
|
278
324
|
),
|
|
279
325
|
/* @__PURE__ */ r(
|
|
280
|
-
|
|
326
|
+
x,
|
|
281
327
|
{
|
|
282
328
|
size: "large",
|
|
283
329
|
icon: /* @__PURE__ */ r(_e, {}),
|
|
284
|
-
tooltip:
|
|
330
|
+
tooltip: h("str.flipHorizontal"),
|
|
285
331
|
onClick: () => oe("h")
|
|
286
332
|
}
|
|
287
333
|
),
|
|
288
334
|
/* @__PURE__ */ r(
|
|
289
|
-
|
|
335
|
+
x,
|
|
290
336
|
{
|
|
291
337
|
size: "large",
|
|
292
338
|
icon: /* @__PURE__ */ r(Ee, {}),
|
|
293
|
-
tooltip:
|
|
339
|
+
tooltip: h("str.flipVertical"),
|
|
294
340
|
onClick: () => oe("v")
|
|
295
341
|
}
|
|
296
342
|
)
|
|
@@ -299,70 +345,70 @@ const et = ({
|
|
|
299
345
|
}
|
|
300
346
|
),
|
|
301
347
|
/* @__PURE__ */ r(
|
|
302
|
-
|
|
348
|
+
me,
|
|
303
349
|
{
|
|
304
|
-
open:
|
|
305
|
-
title:
|
|
350
|
+
open: Oe,
|
|
351
|
+
title: ye,
|
|
306
352
|
footer: null,
|
|
307
|
-
onCancel:
|
|
353
|
+
onCancel: Se,
|
|
308
354
|
children: /* @__PURE__ */ r("div", { className: "text-center", children: /* @__PURE__ */ r("img", { alt: "example", style: { maxWidth: "400px" }, src: Ie }) })
|
|
309
355
|
}
|
|
310
356
|
)
|
|
311
357
|
] });
|
|
312
358
|
}, Je = ({
|
|
313
|
-
_buttonTitle:
|
|
314
|
-
buttonSize:
|
|
315
|
-
buttonType:
|
|
316
|
-
fileList:
|
|
317
|
-
hidePreview:
|
|
318
|
-
icon:
|
|
319
|
-
loading:
|
|
320
|
-
maxCount:
|
|
321
|
-
onChangeFile:
|
|
322
|
-
onRemove:
|
|
323
|
-
showButtonText:
|
|
324
|
-
handlePreview:
|
|
325
|
-
setFileList:
|
|
326
|
-
showLoadingIndicator:
|
|
327
|
-
listType:
|
|
328
|
-
}) => /* @__PURE__ */
|
|
329
|
-
|
|
359
|
+
_buttonTitle: c,
|
|
360
|
+
buttonSize: b,
|
|
361
|
+
buttonType: y,
|
|
362
|
+
fileList: n,
|
|
363
|
+
hidePreview: m,
|
|
364
|
+
icon: J,
|
|
365
|
+
loading: C,
|
|
366
|
+
maxCount: F,
|
|
367
|
+
onChangeFile: z,
|
|
368
|
+
onRemove: O,
|
|
369
|
+
showButtonText: k,
|
|
370
|
+
handlePreview: B,
|
|
371
|
+
setFileList: X,
|
|
372
|
+
showLoadingIndicator: R,
|
|
373
|
+
listType: N = "picture"
|
|
374
|
+
}) => /* @__PURE__ */ U(
|
|
375
|
+
He,
|
|
330
376
|
{
|
|
331
377
|
accept: "image/x-png,image/gif,image/jpeg",
|
|
332
|
-
fileList:
|
|
333
|
-
defaultFileList:
|
|
378
|
+
fileList: n,
|
|
379
|
+
defaultFileList: n,
|
|
334
380
|
onChange: () => {
|
|
335
381
|
},
|
|
336
|
-
className: (
|
|
382
|
+
className: (n.length >= F ? " hide-upload " : "") + " mb-0",
|
|
337
383
|
multiple: !1,
|
|
338
|
-
onPreview:
|
|
339
|
-
onDrop: (
|
|
340
|
-
listType:
|
|
341
|
-
showUploadList: !
|
|
342
|
-
onRemove: (
|
|
343
|
-
const
|
|
344
|
-
|
|
384
|
+
onPreview: m ? void 0 : B,
|
|
385
|
+
onDrop: (s) => (z(s.dataTransfer.files.item(0)), !1),
|
|
386
|
+
listType: N,
|
|
387
|
+
showUploadList: !m,
|
|
388
|
+
onRemove: (s) => {
|
|
389
|
+
const S = n.filter((T) => s.uid !== T.uid);
|
|
390
|
+
O == null || O(s), X(S);
|
|
345
391
|
},
|
|
346
|
-
beforeUpload: async (
|
|
347
|
-
maxCount:
|
|
392
|
+
beforeUpload: async (s) => (z(s), !1),
|
|
393
|
+
maxCount: F,
|
|
348
394
|
children: [
|
|
349
|
-
|
|
350
|
-
/* @__PURE__ */ r("div", { className: "d-flex flex-column", children:
|
|
351
|
-
|
|
395
|
+
R && /* @__PURE__ */ r(Le, {}),
|
|
396
|
+
/* @__PURE__ */ r("div", { className: "d-flex flex-column", children: n.length < F && (N === "picture-circle" ? /* @__PURE__ */ r(ve, {}) : /* @__PURE__ */ r(
|
|
397
|
+
x,
|
|
352
398
|
{
|
|
353
|
-
loading:
|
|
354
|
-
tooltip:
|
|
355
|
-
size:
|
|
356
|
-
icon:
|
|
357
|
-
type:
|
|
358
|
-
children:
|
|
399
|
+
loading: C,
|
|
400
|
+
tooltip: k ? void 0 : c,
|
|
401
|
+
size: b,
|
|
402
|
+
icon: J,
|
|
403
|
+
type: k ? y : "text",
|
|
404
|
+
children: k ? c : void 0
|
|
359
405
|
}
|
|
360
406
|
)) })
|
|
361
407
|
]
|
|
362
408
|
},
|
|
363
|
-
|
|
409
|
+
n.length
|
|
364
410
|
);
|
|
365
411
|
export {
|
|
366
412
|
Je as UploadComponent,
|
|
367
|
-
|
|
413
|
+
tt as default
|
|
368
414
|
};
|