@kingteza/crud-component 1.0.51 → 1.0.54

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 (60) hide show
  1. package/App.d.ts +1 -0
  2. package/Play.d.ts +2 -0
  3. package/_virtual/_commonjsHelpers.cjs.js +1 -0
  4. package/_virtual/_commonjsHelpers.es.js +8 -0
  5. package/_virtual/_nodeUtil.cjs.js +1 -0
  6. package/_virtual/_nodeUtil.es.js +4 -0
  7. package/_virtual/index.cjs.js +1 -0
  8. package/_virtual/index.cjs2.js +1 -0
  9. package/_virtual/index.cjs3.js +1 -0
  10. package/_virtual/index.es.js +11 -0
  11. package/_virtual/index.es2.js +7 -0
  12. package/_virtual/index.es3.js +4 -0
  13. package/_virtual/isBuffer.cjs.js +1 -0
  14. package/_virtual/isBuffer.es.js +4 -0
  15. package/_virtual/quill.cjs.js +1 -0
  16. package/_virtual/quill.es.js +4 -0
  17. package/common/button/Button.cjs.js +1 -1
  18. package/common/button/Button.es.js +38 -52
  19. package/common/button/CloneButtonTable.cjs.js +1 -1
  20. package/common/button/HideButtonTable.cjs.js +1 -1
  21. package/common/button/NewButton.cjs.js +1 -1
  22. package/common/button/PrintButton.cjs.js +1 -1
  23. package/common/button/RefreshButton.cjs.js +1 -1
  24. package/common/button/UnHideButton.cjs.js +1 -1
  25. package/common/button/UpdateButtonTable.cjs.js +1 -1
  26. package/common/button/ViewButtonTable.cjs.js +1 -1
  27. package/common/icon/KIcon.cjs.js +1 -0
  28. package/common/icon/KIcon.d.ts +9 -0
  29. package/common/icon/KIcon.es.js +11 -0
  30. package/common/index.cjs.js +1 -1
  31. package/common/index.es.js +68 -68
  32. package/common/picker/ImagePicker.cjs.js +1 -1
  33. package/common/picker/ImagePicker.es.js +228 -189
  34. package/common/rich/index.cjs.js +1 -1
  35. package/common/rich/index.es.js +10 -10
  36. package/common/select/SelectComponent.es.js +4 -4
  37. package/common/tab/TabViewWithRoute.cjs.js +1 -1
  38. package/common/tab/TabViewWithRoute.es.js +21 -21
  39. package/common/table/table.d.ts +1 -1
  40. package/common/text-field/TextField.cjs.js +1 -1
  41. package/common/wizard/WizardResult.es.js +4 -4
  42. package/crud/CrudComponent.cjs.js +1 -1
  43. package/crud/CrudComponent.d.ts +5 -1
  44. package/crud/CrudComponent.es.js +66 -64
  45. package/crud/CrudField.es.js +1 -1
  46. package/crud/CrudReportComponent.cjs.js +1 -1
  47. package/crud/FileCrudField.cjs.js +1 -1
  48. package/crud/FileCrudField.es.js +23 -23
  49. package/crud/import/CrudImportComponent.cjs.js +2 -2
  50. package/crud/import/CrudImportComponent.es.js +10 -10
  51. package/crud/view/CrudViewer.cjs.js +1 -1
  52. package/crud/view/CrudViewer.d.ts +11 -1
  53. package/crud/view/CrudViewer.es.js +285 -174
  54. package/index.cjs.js +1 -1
  55. package/index.es.js +19 -19
  56. package/locale/index.d.ts +5 -0
  57. package/locale/translations/en.cjs.js +1 -1
  58. package/locale/translations/en.d.ts +5 -0
  59. package/locale/translations/en.es.js +7 -2
  60. package/package.json +7 -2
@@ -1,281 +1,320 @@
1
- import { jsx as t, jsxs as N, Fragment as oe } from "react/jsx-runtime";
2
- /* empty css */
1
+ import { jsx as r, jsxs as z, Fragment as ne } from "react/jsx-runtime";
2
+ import { Cropper as xe } from "../../node_modules/.pnpm/react-advanced-cropper@0.20.1_react@18.3.1/node_modules/react-advanced-cropper/dist/index.esm-bundler.es.js";
3
+ /* empty css */
3
4
  /* empty css */
4
- import { RotateLeftOutlined as ye, RotateRightOutlined as Ue, UploadOutlined as ne, LoadingOutlined as Ie } from "@ant-design/icons";
5
- import { Form as Oe, Modal as q, Upload as Fe } from "antd";
6
- import M, { useRef as A, useState as w, useEffect as j, useCallback as ee, useMemo as te } from "react";
7
- import { Cropper as Re } from "react-cropper";
8
- import { useTranslationLib as je } from "../../locale/index.es.js";
9
- import L from "../button/Button.es.js";
10
- import Ne from "../../util/ImageUtil.es.js";
11
- const Se = Oe.Item;
12
- function re(r) {
13
- return new Promise((l, p) => {
14
- const o = new FileReader();
15
- o.readAsDataURL(r), o.onload = () => l(o.result), o.onerror = (m) => p(m);
5
+ import { RotateLeftOutlined as Fe, RotateRightOutlined as Oe, UploadOutlined as se, LoadingOutlined as Se } from "@ant-design/icons";
6
+ import { Form as Ue, Modal as te, Space as ke, Upload as Re } from "antd";
7
+ import H, { useRef as L, useState as w, useCallback as V, useEffect as j, useMemo as re } from "react";
8
+ import { useTranslationLib as Ne } from "../../locale/index.es.js";
9
+ import O from "../button/Button.es.js";
10
+ import je from "../../util/ImageUtil.es.js";
11
+ import ze from "../../icons/FlipHIcon.es.js";
12
+ import Te from "../../icons/FlipVIcon.es.js";
13
+ const Pe = Ue.Item, oe = "crud-component.image-picker.button-state";
14
+ function ie(o) {
15
+ return new Promise((c, m) => {
16
+ const i = new FileReader();
17
+ i.readAsDataURL(o), i.onload = () => c(i.result), i.onerror = (p) => m(p);
16
18
  });
17
19
  }
18
- const Ve = ({
19
- values: r = [],
20
- required: l,
21
- buttonType: p,
22
- label: o,
23
- name: m,
24
- onChange: f,
25
- aspectRatio: S,
26
- buttonTitle: C,
20
+ const Ke = ({
21
+ values: o = [],
22
+ required: c,
23
+ buttonType: m,
24
+ label: i,
25
+ name: p,
26
+ onChange: u,
27
+ aspectRatio: C,
28
+ buttonTitle: b,
27
29
  hidePreview: v,
28
- buttonSize: u = "large",
30
+ buttonSize: f = "large",
29
31
  showButtonText: g = !0,
30
32
  showOnlyIcon: _ = !1,
31
- icon: U = /* @__PURE__ */ t(ne, {}),
32
- loading: I,
33
- maxCount: b = 1,
34
- onAdd: c,
35
- onRemove: O,
36
- listType: F,
33
+ icon: S = /* @__PURE__ */ r(se, {}),
34
+ loading: U,
35
+ maxCount: y = 1,
36
+ onAdd: s,
37
+ onRemove: k,
38
+ listType: R,
37
39
  ...E
38
40
  }) => {
39
- const [ie, ae] = M.useState(""), [se, ce] = M.useState(""), [le, J] = M.useState(!1), k = A(), i = A(), [a, D] = w([]), [h, P] = w(), de = A(), pe = () => J(!1), me = async (e) => {
40
- !e.url && !e.preview && (e.preview = await re(e.originFileObj)), ce(e.url || e.preview), J(!0), ae(e.name);
41
- }, [V, R] = w(!1), fe = () => {
42
- }, W = (e) => {
43
- var n;
44
- (n = i == null ? void 0 : i.current) == null || n.cropper.rotate(e ? -90 : 90);
45
- };
41
+ const [ae, le] = H.useState(""), [ce, de] = H.useState(""), [me, M] = H.useState(!1), T = L(), l = L(null), [n, P] = w([]), [h, B] = w(), pe = L(), ue = () => M(!1), fe = async (e) => {
42
+ !e.url && !e.preview && (e.preview = await ie(e.originFileObj)), de(e.url || e.preview), M(!0), le(e.name);
43
+ }, [J, N] = w(!1), W = (e) => {
44
+ var t;
45
+ (t = l.current) == null || t.rotateImage(e ? -90 : 90);
46
+ }, $ = V((e) => {
47
+ var t;
48
+ l.current && ((t = l.current) == null || t.flipImage(e === "h", e === "v"));
49
+ }, []);
46
50
  j(() => {
47
- f == null || f(a[0], a);
48
- }, [a, f]);
49
- const ue = () => {
50
- var y;
51
- const e = (y = i == null ? void 0 : i.current) == null ? void 0 : y.cropper.getCroppedCanvas(), { type: n, size: s, name: d, uid: x } = k.current;
52
- R(!0), e == null || e.toBlob(async (be) => {
53
- const xe = Object.assign(new File([be], d, { type: n }), {
51
+ u == null || u(n[0], n);
52
+ }, [n, u]);
53
+ const ge = async () => {
54
+ var F;
55
+ const e = (F = l.current) == null ? void 0 : F.getCanvas(), { type: t, size: a, name: I, uid: x } = T.current;
56
+ N(!0), e == null || e.toBlob(async (ye) => {
57
+ const Ie = Object.assign(new File([ye], I, { type: t }), {
54
58
  uid: x
55
- }), X = await Ne.resizeImage(xe), Y = await re(X), Z = {
56
- url: Y,
57
- name: d,
59
+ }), q = await je.resizeImage(Ie), D = await ie(q);
60
+ console.log({ url: D });
61
+ const ee = {
62
+ url: D,
63
+ name: I,
58
64
  uid: x,
59
- type: n,
60
- size: s,
61
- thumbUrl: Y,
62
- originFileObj: X
65
+ type: t,
66
+ size: a,
67
+ thumbUrl: D,
68
+ originFileObj: q
63
69
  };
64
- if (c)
70
+ if (s)
65
71
  try {
66
- R(!0), await c(Z);
72
+ N(!0), await s(ee);
67
73
  } finally {
68
- R(!1);
74
+ N(!1);
69
75
  }
70
- D([Z, ...a]), R(!1);
71
- }), P(void 0);
72
- }, ge = () => {
73
- P(void 0), k.current = void 0;
74
- }, $ = ee((e) => {
75
- const n = e;
76
- if (n) {
77
- k.current = n;
78
- const s = new FileReader();
79
- s.addEventListener("load", () => {
80
- var d;
81
- if (typeof s.result == "string") {
82
- P(s.result);
83
- const x = localStorage.getItem("cropper.box"), y = x ? JSON.parse(x) : void 0;
84
- y && ((d = i == null ? void 0 : i.current) == null || d.cropper.setCropBoxData(y)), setTimeout(() => {
85
- Q();
76
+ P([ee, ...n]), N(!1);
77
+ }), B(void 0);
78
+ }, he = () => {
79
+ B(void 0), T.current = void 0;
80
+ }, G = V((e) => {
81
+ const t = e;
82
+ if (t) {
83
+ T.current = t;
84
+ const a = new FileReader();
85
+ a.addEventListener("load", () => {
86
+ var I;
87
+ if (typeof a.result == "string") {
88
+ B(a.result);
89
+ const x = localStorage.getItem(oe), F = x ? JSON.parse(x) : void 0;
90
+ F && ((I = l.current) == null || I.setState(F)), setTimeout(() => {
91
+ Z(l.current);
86
92
  }, 100);
87
93
  }
88
- }), s.readAsDataURL(n);
94
+ }), a.readAsDataURL(t);
89
95
  }
90
96
  }, []);
91
97
  j(() => {
92
- if (r != null && r.length || typeof r == "string") {
93
- const e = Array.isArray(r) ? r.map((n) => [{ uid: r, url: n }]) : [{ uid: r, url: r }];
94
- D(e);
98
+ if (o != null && o.length || typeof o == "string") {
99
+ const e = Array.isArray(o) ? o.map((t) => [{ uid: o, url: t }]) : [{ uid: o, url: o }];
100
+ P(e);
95
101
  }
96
- }, [r]);
97
- const { t: z } = je(), he = te(
98
- () => l ? {
99
- required: l,
100
- validator: (e, n, s) => {
101
- h || a != null && a.length ? s() : s(`${o ?? ""} ${z("err.validation.required")}`);
102
+ }, [o]);
103
+ const { t: d } = Ne(), we = re(
104
+ () => c ? {
105
+ required: c,
106
+ validator: (e, t, a) => {
107
+ h || n != null && n.length ? a() : a(`${i ?? ""} ${d("err.validation.required")}`);
102
108
  }
103
109
  } : void 0,
104
- [l, h, a == null ? void 0 : a.length, o, z]
105
- ), H = C ?? z("message.fileUploadMessage2"), T = te(
106
- () => /* @__PURE__ */ t(
107
- ke,
110
+ [c, h, n == null ? void 0 : n.length, i, d]
111
+ ), K = b ?? d("message.uploadButtonText"), Q = re(
112
+ () => /* @__PURE__ */ r(
113
+ Be,
108
114
  {
109
- showLoadingIndicator: V,
110
- _buttonTitle: H,
111
- buttonSize: u,
112
- buttonType: p,
113
- fileList: a,
115
+ showLoadingIndicator: J,
116
+ _buttonTitle: K,
117
+ buttonSize: f,
118
+ buttonType: m,
119
+ fileList: n,
114
120
  hidePreview: v,
115
- icon: U,
116
- loading: I,
117
- listType: F,
118
- maxCount: b,
119
- onChangeFile: $,
120
- onRemove: O,
121
+ icon: S,
122
+ loading: U,
123
+ listType: R,
124
+ maxCount: y,
125
+ onChangeFile: G,
126
+ onRemove: k,
121
127
  showButtonText: g,
122
- handlePreview: me,
123
- setFileList: D
128
+ handlePreview: fe,
129
+ setFileList: P
124
130
  }
125
131
  ),
126
132
  [
127
- V,
128
- H,
129
- u,
130
- p,
131
- a,
133
+ J,
134
+ K,
135
+ f,
136
+ m,
137
+ n,
132
138
  v,
139
+ S,
133
140
  U,
134
- I,
135
- F,
136
- b,
137
- $,
138
- O,
141
+ R,
142
+ y,
143
+ G,
144
+ k,
139
145
  g
140
146
  ]
141
147
  );
142
- de.current = T.props.beforeUpload;
143
- const [we, G] = w(0), [Ce, K] = w(0), [B, ve] = w();
148
+ pe.current = Q.props.beforeUpload;
149
+ const [Ce, X] = w(0), [be, Y] = w(0), [A, ve] = w();
144
150
  j(() => {
145
151
  const e = setTimeout(() => {
146
- B && localStorage.setItem("cropper.box", JSON.stringify(B));
152
+ A && localStorage.setItem(oe, JSON.stringify(A));
147
153
  }, 400);
148
154
  return () => clearTimeout(e);
149
- }, [B]), j(() => {
150
- h || (G(0), K(0));
155
+ }, [A]), j(() => {
156
+ if (!h) {
157
+ X(0), Y(0);
158
+ const e = setTimeout(() => {
159
+ var t;
160
+ (t = l.current) == null || t.reset();
161
+ }, 1500);
162
+ return () => clearTimeout(e);
163
+ }
151
164
  }, [h]);
152
- const Q = ee(async () => {
153
- var n;
154
- const e = (n = i == null ? void 0 : i.current) == null ? void 0 : n.cropper;
165
+ const Z = V(async (e) => {
155
166
  if (e) {
156
- const { width: s, height: d } = e.getCroppedCanvas();
157
- ve(e.getCropBoxData()), G(s), K(d);
167
+ const t = e.getCoordinates();
168
+ ve(e.getState()), X((t == null ? void 0 : t.width) ?? 10), Y((t == null ? void 0 : t.height) ?? 10);
158
169
  }
159
170
  }, []);
160
- return /* @__PURE__ */ N(oe, { children: [
161
- /* @__PURE__ */ t(
162
- Se,
171
+ return /* @__PURE__ */ z(ne, { children: [
172
+ /* @__PURE__ */ r(
173
+ Pe,
163
174
  {
164
- label: o,
175
+ label: i,
165
176
  ...E,
166
- name: m,
177
+ name: p,
167
178
  className: "mb-0",
168
- rules: [he, ...E.rules ?? []],
169
- children: T
179
+ rules: [we, ...E.rules ?? []],
180
+ children: Q
170
181
  }
171
182
  ),
172
- /* @__PURE__ */ N(
173
- q,
183
+ /* @__PURE__ */ z(
184
+ te,
174
185
  {
175
186
  open: !!h,
176
187
  maskClosable: !1,
177
- onOk: ue,
188
+ onOk: ge,
178
189
  closable: !1,
179
- onCancel: ge,
190
+ onCancel: he,
191
+ destroyOnHidden: !0,
180
192
  children: [
181
- /* @__PURE__ */ t(
182
- Re,
193
+ /* @__PURE__ */ r(
194
+ xe,
183
195
  {
184
- ref: i,
196
+ ref: l,
197
+ stencilProps: {
198
+ grid: !0
199
+ },
200
+ style: { border: "1px solid black" },
185
201
  src: h,
186
- cropmove: Q,
187
- viewMode: 1,
188
- aspectRatio: S,
189
- cropend: () => fe()
202
+ onChange: (e) => {
203
+ Z(e);
204
+ },
205
+ aspectRatio: C ? {
206
+ minimum: C,
207
+ maximum: C
208
+ } : void 0
190
209
  }
191
210
  ),
192
- /* @__PURE__ */ t("p", { className: "text-center", children: [we, Ce].join(" ⨉ ") }),
193
- /* @__PURE__ */ N("div", { className: "mt-2 d-flex justify-content-center", children: [
194
- /* @__PURE__ */ t(
195
- L,
211
+ /* @__PURE__ */ r("p", { className: "text-center", children: [Ce, be].join(" ⨉ ") }),
212
+ /* @__PURE__ */ r("div", { className: "mt-2 d-flex justify-content-center", children: /* @__PURE__ */ z(ke.Compact, { children: [
213
+ /* @__PURE__ */ r(
214
+ O,
196
215
  {
197
216
  size: "large",
198
- icon: /* @__PURE__ */ t(ye, {}),
217
+ tooltip: d("str.rotateLeft"),
218
+ icon: /* @__PURE__ */ r(Fe, {}),
199
219
  onClick: () => W(!0)
200
220
  }
201
221
  ),
202
- /* @__PURE__ */ t(
203
- L,
222
+ /* @__PURE__ */ r(
223
+ O,
204
224
  {
205
225
  size: "large",
206
- icon: /* @__PURE__ */ t(Ue, {}),
226
+ icon: /* @__PURE__ */ r(Oe, {}),
227
+ tooltip: d("str.rotateRight"),
207
228
  onClick: () => W(!1)
208
229
  }
230
+ ),
231
+ /* @__PURE__ */ r(
232
+ O,
233
+ {
234
+ size: "large",
235
+ icon: /* @__PURE__ */ r(ze, {}),
236
+ tooltip: d("str.flipHorizontal"),
237
+ onClick: () => $("h")
238
+ }
239
+ ),
240
+ /* @__PURE__ */ r(
241
+ O,
242
+ {
243
+ size: "large",
244
+ icon: /* @__PURE__ */ r(Te, {}),
245
+ tooltip: d("str.flipVertical"),
246
+ onClick: () => $("v")
247
+ }
209
248
  )
210
- ] })
249
+ ] }) })
211
250
  ]
212
251
  }
213
252
  ),
214
- /* @__PURE__ */ t(
215
- q,
253
+ /* @__PURE__ */ r(
254
+ te,
216
255
  {
217
- open: le,
218
- title: ie,
256
+ open: me,
257
+ title: ae,
219
258
  footer: null,
220
- onCancel: pe,
221
- children: /* @__PURE__ */ t("div", { className: "text-center", children: /* @__PURE__ */ t("img", { alt: "example", style: { maxWidth: "400px" }, src: se }) })
259
+ onCancel: ue,
260
+ children: /* @__PURE__ */ r("div", { className: "text-center", children: /* @__PURE__ */ r("img", { alt: "example", style: { maxWidth: "400px" }, src: ce }) })
222
261
  }
223
262
  )
224
263
  ] });
225
- }, ke = ({
226
- _buttonTitle: r,
227
- buttonSize: l,
228
- buttonType: p,
229
- fileList: o,
230
- hidePreview: m,
231
- icon: f,
232
- loading: S,
233
- maxCount: C,
264
+ }, Be = ({
265
+ _buttonTitle: o,
266
+ buttonSize: c,
267
+ buttonType: m,
268
+ fileList: i,
269
+ hidePreview: p,
270
+ icon: u,
271
+ loading: C,
272
+ maxCount: b,
234
273
  onChangeFile: v,
235
- onRemove: u,
274
+ onRemove: f,
236
275
  showButtonText: g,
237
276
  handlePreview: _,
238
- setFileList: U,
239
- showLoadingIndicator: I,
240
- listType: b = "picture"
241
- }) => /* @__PURE__ */ t(oe, { children: /* @__PURE__ */ N(
242
- Fe,
277
+ setFileList: S,
278
+ showLoadingIndicator: U,
279
+ listType: y = "picture"
280
+ }) => /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ z(
281
+ Re,
243
282
  {
244
283
  accept: "image/x-png,image/gif,image/jpeg",
245
- fileList: o,
246
- defaultFileList: o,
284
+ fileList: i,
285
+ defaultFileList: i,
247
286
  onChange: () => {
248
287
  },
249
- className: (o.length >= C ? " hide-upload " : "") + " mb-0",
288
+ className: (i.length >= b ? " hide-upload " : "") + " mb-0",
250
289
  multiple: !1,
251
- onPreview: m ? void 0 : _,
252
- onDrop: (c) => (v(c.dataTransfer.files.item(0)), !1),
253
- listType: b,
254
- showUploadList: !m,
255
- onRemove: (c) => {
256
- const O = o.filter((F) => c.uid !== F.uid);
257
- u == null || u(c), U(O);
290
+ onPreview: p ? void 0 : _,
291
+ onDrop: (s) => (v(s.dataTransfer.files.item(0)), !1),
292
+ listType: y,
293
+ showUploadList: !p,
294
+ onRemove: (s) => {
295
+ const k = i.filter((R) => s.uid !== R.uid);
296
+ f == null || f(s), S(k);
258
297
  },
259
- beforeUpload: async (c) => (v(c), !1),
260
- maxCount: C,
298
+ beforeUpload: async (s) => (v(s), !1),
299
+ maxCount: b,
261
300
  children: [
262
- I && /* @__PURE__ */ t(Ie, {}),
263
- /* @__PURE__ */ t("div", { className: "d-flex flex-column", children: o.length < C && (b === "picture-circle" ? /* @__PURE__ */ t(ne, {}) : /* @__PURE__ */ t(
264
- L,
301
+ U && /* @__PURE__ */ r(Se, {}),
302
+ /* @__PURE__ */ r("div", { className: "d-flex flex-column", children: i.length < b && (y === "picture-circle" ? /* @__PURE__ */ r(se, {}) : /* @__PURE__ */ r(
303
+ O,
265
304
  {
266
- loading: S,
267
- tooltip: g ? void 0 : r,
268
- size: l,
269
- icon: f,
270
- type: g ? p : "text",
271
- children: g ? r : void 0
305
+ loading: C,
306
+ tooltip: g ? void 0 : o,
307
+ size: c,
308
+ icon: u,
309
+ type: g ? m : "text",
310
+ children: g ? o : void 0
272
311
  }
273
312
  )) })
274
313
  ]
275
314
  },
276
- o.length
315
+ i.length
277
316
  ) });
278
317
  export {
279
- ke as UploadComponent,
280
- Ve as default
318
+ Be as UploadComponent,
319
+ Ke as default
281
320
  };
@@ -1 +1 @@
1
- "use strict";var g=Object.create;var p=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var w=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of V(t))!F.call(e,o)&&o!==r&&p(e,o,{get:()=>t[o],enumerable:!(s=q(t,o))||s.enumerable});return e};var R=(e,t,r)=>(r=e!=null?g(j(e)):{},w(t||!e||!e.__esModule?p(r,"default",{value:e,enumerable:!0}):r,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime");;/* empty css */;/* empty css */const h=require("antd"),c=require("react"),y=require("../../util/ValidationUtil.cjs.js"),E=c.lazy(async()=>{const{default:e}=await import("react-quill");return{default:t=>a.jsx(e,{...t})}}),S=({name:e,label:t,required:r,rules:s=[],disabled:o})=>{const n=h.Form.useFormInstance(),[u,d]=c.useState(""),f={toolbar:[["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],["link"],["clean"]]},b=["bold","italic","underline","strike","blockquote","list","bullet","link"];c.useEffect(()=>{const i=n.getFieldValue(e);i&&i!=="<p></p>"&&i!=="<p><br></p>"&&d(i)},[n,e]);const l=h.Form.useWatch(e,n);c.useEffect(()=>{l!==u&&d(!l||l==="<p></p>"||l==="<p><br></p>"?"":l)},[l,u]);const k=i=>{d(i);const x=!i||i==="<p></p>"||i.trim()==="<p><br></p>"?void 0:i;n.setFieldValue(e,x),n.validateFields([e]).catch(()=>{})},m=c.useMemo(()=>r?[...s,...y.required(t??"")]:s,[r,s,t]);return a.jsx(h.Form.Item,{name:e,label:t,rules:m,children:a.jsx(c.Suspense,{fallback:a.jsx("div",{children:"Loading editor..."}),children:a.jsx(E,{readOnly:o,value:u,onChange:k,theme:"snow",className:"bg-white dark:!bg-[#141414] dark:text-white dark:!fill-white",modules:f,formats:b})})})};exports.RichTextEditor=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime");;/* empty css */;/* empty css */const a=require("antd"),s=require("react"),x=require("../../util/ValidationUtil.cjs.js"),q=s.lazy(async()=>{const{default:t}=await Promise.resolve().then(()=>require("../../_virtual/index.cjs.js")).then(i=>i.index);return{default:i=>l.jsx(t,{...i})}}),g=({name:t,label:i,required:u,rules:c=[],disabled:h})=>{const o=a.Form.useFormInstance(),[d,n]=s.useState(""),f={toolbar:[["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],["link"],["clean"]]},p=["bold","italic","underline","strike","blockquote","list","bullet","link"];s.useEffect(()=>{const e=o.getFieldValue(t);e&&e!=="<p></p>"&&e!=="<p><br></p>"&&n(e)},[o,t]);const r=a.Form.useWatch(t,o);s.useEffect(()=>{r!==d&&n(!r||r==="<p></p>"||r==="<p><br></p>"?"":r)},[r,d]);const b=e=>{n(e);const m=!e||e==="<p></p>"||e.trim()==="<p><br></p>"?void 0:e;o.setFieldValue(t,m),o.validateFields([t]).catch(()=>{})},k=s.useMemo(()=>u?[...c,...x.required(i??"")]:c,[u,c,i]);return l.jsx(a.Form.Item,{name:t,label:i,rules:k,children:l.jsx(s.Suspense,{fallback:l.jsx("div",{children:"Loading editor..."}),children:l.jsx(q,{readOnly:h,value:d,onChange:b,theme:"snow",className:"bg-white dark:!bg-[#141414] dark:text-white dark:!fill-white",modules:f,formats:p})})})};exports.RichTextEditor=g;
@@ -1,15 +1,15 @@
1
1
  import { jsx as l } from "react/jsx-runtime";
2
- /* empty css */
2
+ /* empty css */
3
3
  /* empty css */
4
4
  import { Form as a } from "antd";
5
5
  import V, { useState as g, useEffect as u, useMemo as w, Suspense as F } from "react";
6
6
  import x from "../../util/ValidationUtil.es.js";
7
7
  const R = V.lazy(async () => {
8
- const { default: e } = await import("react-quill");
9
- return { default: (o) => /* @__PURE__ */ l(e, { ...o }) };
8
+ const { default: e } = await import("../../_virtual/index.es.js").then((i) => i.i);
9
+ return { default: (i) => /* @__PURE__ */ l(e, { ...i }) };
10
10
  }), S = ({
11
11
  name: e,
12
- label: o,
12
+ label: i,
13
13
  required: d,
14
14
  rules: c = [],
15
15
  disabled: p
@@ -35,20 +35,20 @@ const R = V.lazy(async () => {
35
35
  const t = r.getFieldValue(e);
36
36
  t && t !== "<p></p>" && t !== "<p><br></p>" && s(t);
37
37
  }, [r, e]);
38
- const i = a.useWatch(e, r);
38
+ const o = a.useWatch(e, r);
39
39
  u(() => {
40
- i !== n && s(!i || i === "<p></p>" || i === "<p><br></p>" ? "" : i);
41
- }, [i, n]);
40
+ o !== n && s(!o || o === "<p></p>" || o === "<p><br></p>" ? "" : o);
41
+ }, [o, n]);
42
42
  const h = (t) => {
43
43
  s(t);
44
44
  const k = !t || t === "<p></p>" || t.trim() === "<p><br></p>" ? void 0 : t;
45
45
  r.setFieldValue(e, k), r.validateFields([e]).catch(() => {
46
46
  });
47
47
  }, b = w(
48
- () => d ? [...c, ...x.required(o ?? "")] : c,
49
- [d, c, o]
48
+ () => d ? [...c, ...x.required(i ?? "")] : c,
49
+ [d, c, i]
50
50
  );
51
- return /* @__PURE__ */ l(a.Item, { name: e, label: o, rules: b, children: /* @__PURE__ */ l(F, { fallback: /* @__PURE__ */ l("div", { children: "Loading editor..." }), children: /* @__PURE__ */ l(
51
+ return /* @__PURE__ */ l(a.Item, { name: e, label: i, rules: b, children: /* @__PURE__ */ l(F, { fallback: /* @__PURE__ */ l("div", { children: "Loading editor..." }), children: /* @__PURE__ */ l(
52
52
  R,
53
53
  {
54
54
  readOnly: p,
@@ -1,5 +1,5 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { ConfigProvider as q, Spin as B, Form as D, Select as E } from "antd";
2
+ import { ConfigProvider as q, Form as B, Select as D, Spin as E } from "antd";
3
3
  import { useCallback as F } from "react";
4
4
  import { useTranslationLib as P } from "../../locale/index.es.js";
5
5
  import V from "../tooltip/TooltipComponent.es.js";
@@ -33,9 +33,9 @@ function Q({
33
33
  return /* @__PURE__ */ t(
34
34
  q,
35
35
  {
36
- renderEmpty: _ && d ? () => /* @__PURE__ */ t(B, {}) : void 0,
36
+ renderEmpty: _ && d ? () => /* @__PURE__ */ t(E, {}) : void 0,
37
37
  children: /* @__PURE__ */ t(V, { title: $, children: /* @__PURE__ */ t(
38
- D.Item,
38
+ B.Item,
39
39
  {
40
40
  label: m,
41
41
  name: n.name,
@@ -51,7 +51,7 @@ function Q({
51
51
  }
52
52
  ],
53
53
  children: /* @__PURE__ */ t(
54
- E,
54
+ D,
55
55
  {
56
56
  ref: N,
57
57
  loading: d,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("antd"),i=require("react"),u=require("react-router"),g=require("react-router-dom"),q=require("../../context/WindowDimension.cjs.js"),{Content:T}=c.Layout,y=({positionOfRoute:n,initialKey:s="*",tabs:l,className:d="",mode:h="default"})=>{const[b,m]=i.useState(s),o=u.useNavigate(),p=e=>{o(e)},r=g.useLocation();i.useEffect(()=>{const e=r.pathname.split("/")[n];m(e??""),e||o(s,{replace:!0})},[s,r.pathname,o,n]);const{isDesktop:x}=q(),a=h==="side"&&x,f=a?"left":"top",j=a?"d-flex h-100":"";return t.jsxs("div",{className:`${d} ${j}`,children:[t.jsx(c.Tabs,{type:"card",tabPosition:f,activeKey:b,onChange:p,children:l.map(({key:e,label:v})=>t.jsx(c.Tabs.TabPane,{tab:v},e))}),t.jsx(T,{className:`max-height ${a?"overflow-auto":""}`,children:t.jsx(u.Outlet,{})})]})};exports.TabViewWithRoute=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("antd"),i=require("react"),u=require("react-router-dom"),T=require("../../hooks/NavigatorHooks.cjs.js"),y=require("../../context/WindowDimension.cjs.js"),{Content:S}=n.Layout,v=({positionOfRoute:a,initialKey:o="*",tabs:l,className:d="",mode:h="default"})=>{const[b,m]=i.useState(o),e=T.useNavigateOptional(),p=t=>{e==null||e(t)},r=u.useLocation();i.useEffect(()=>{const t=r.pathname.split("/")[a];m(t??""),t||e==null||e(o,{replace:!0})},[o,r.pathname,e,a]);const{isDesktop:x}=y(),c=h==="side"&&x,f=c?"left":"top",j=c?"d-flex h-100":"";return s.jsxs("div",{className:`${d} ${j}`,children:[s.jsx(n.Tabs,{type:"card",tabPosition:f,activeKey:b,onChange:p,children:l.map(({key:t,label:q})=>s.jsx(n.Tabs.TabPane,{tab:q},t))}),s.jsx(S,{className:`max-height ${c?"overflow-auto":""}`,children:s.jsx(u.Outlet,{})})]})};exports.TabViewWithRoute=v;