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