@kingteza/crud-component 1.0.40 → 1.0.42

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 (68) hide show
  1. package/common/button/Button.cjs.js +1 -1
  2. package/common/button/Button.es.js +19 -20
  3. package/common/button/CloneButtonTable.cjs.js +1 -1
  4. package/common/button/CloneButtonTable.es.js +9 -10
  5. package/common/button/DeleteButtonTable.cjs.js +1 -1
  6. package/common/button/DeleteButtonTable.es.js +29 -33
  7. package/common/button/ExportButton.cjs.js +1 -1
  8. package/common/button/ExportButton.es.js +10 -11
  9. package/common/button/HideButtonTable.cjs.js +1 -1
  10. package/common/button/HideButtonTable.es.js +22 -23
  11. package/common/button/ImportButton.cjs.js +1 -1
  12. package/common/button/ImportButton.es.js +19 -20
  13. package/common/button/NewButton.cjs.js +1 -1
  14. package/common/button/NewButton.es.js +13 -14
  15. package/common/button/PrintButton.cjs.js +1 -1
  16. package/common/button/PrintButton.es.js +11 -12
  17. package/common/button/RefreshButton.cjs.js +1 -1
  18. package/common/button/RefreshButton.es.js +10 -11
  19. package/common/button/UnHideButton.cjs.js +1 -1
  20. package/common/button/UnHideButton.es.js +37 -38
  21. package/common/button/UpdateButtonTable.cjs.js +1 -1
  22. package/common/button/UpdateButtonTable.es.js +8 -9
  23. package/common/button/ViewButtonTable.cjs.js +1 -1
  24. package/common/button/ViewButtonTable.es.js +10 -11
  25. package/common/date-picker/DatePicker.cjs.js +1 -1
  26. package/common/date-picker/DatePicker.es.js +40 -41
  27. package/common/date-picker/TimePicker.cjs.js +1 -1
  28. package/common/date-picker/TimePicker.es.js +47 -48
  29. package/common/loading/LoadingIndicator.cjs.js +1 -1
  30. package/common/loading/LoadingIndicator.es.js +6 -7
  31. package/common/picker/ImagePicker.cjs.js +1 -1
  32. package/common/picker/ImagePicker.es.js +80 -81
  33. package/common/select/SelectComponent.cjs.js +1 -1
  34. package/common/select/SelectComponent.es.js +33 -34
  35. package/common/tag/StatusTag.cjs.js +1 -1
  36. package/common/tag/StatusTag.es.js +12 -13
  37. package/common/text-field/NumberField.cjs.js +1 -1
  38. package/common/text-field/NumberField.es.js +41 -42
  39. package/common/text-field/TextArea.cjs.js +1 -1
  40. package/common/text-field/TextArea.es.js +15 -16
  41. package/common/text-field/TextField.cjs.js +1 -1
  42. package/common/text-field/TextField.es.js +50 -51
  43. package/common/wizard/WizardResult.cjs.js +1 -1
  44. package/common/wizard/WizardResult.es.js +36 -38
  45. package/crud/CrudComponent.cjs.js +1 -1
  46. package/crud/CrudComponent.es.js +77 -78
  47. package/crud/CrudField.cjs.js +1 -1
  48. package/crud/CrudField.es.js +126 -127
  49. package/crud/CrudFormWizard.cjs.js +1 -1
  50. package/crud/CrudFormWizard.es.js +47 -48
  51. package/crud/FileCrudField.cjs.js +1 -1
  52. package/crud/FileCrudField.es.js +72 -73
  53. package/crud/import/CrudImportButton.cjs.js +1 -1
  54. package/crud/import/CrudImportButton.es.js +10 -11
  55. package/crud/import/CrudImportComponent.cjs.js +2 -2
  56. package/crud/import/CrudImportComponent.es.js +56 -57
  57. package/crud/view/CrudDecListView.cjs.js +1 -1
  58. package/crud/view/CrudDecListView.es.js +11 -12
  59. package/crud/view/CrudViewer.cjs.js +1 -1
  60. package/crud/view/CrudViewer.es.js +120 -121
  61. package/crud/view/CrudViewerUtil.cjs.js +1 -1
  62. package/crud/view/CrudViewerUtil.es.js +15 -17
  63. package/locale/index.cjs.js +1 -1
  64. package/locale/index.d.ts +4 -0
  65. package/locale/index.es.js +36 -24
  66. package/package.json +1 -1
  67. package/util/ValidationUtil.cjs.js +1 -1
  68. package/util/ValidationUtil.es.js +26 -23
@@ -1,53 +1,52 @@
1
- import { jsx as a, Fragment as O, jsxs as U } from "react/jsx-runtime";
2
- import { Form as S, Radio as q, Select as A, ColorPicker as $ } from "antd";
3
- import { useEffect as P, useState as D, useCallback as z } from "react";
1
+ import { jsx as a, Fragment as O, jsxs as q } from "react/jsx-runtime";
2
+ import { Form as P, Radio as D, Select as R, ColorPicker as $ } from "antd";
3
+ import { useEffect as S, useState as E, useCallback as z } from "react";
4
4
  import J from "react-highlight-words";
5
- import { useTranslation as K } from "react-i18next";
6
- import { TRANSLATION_NAMESPACE as Q } from "../locale/hooks/translation-constants.es.js";
7
- import X from "./FileCrudField.es.js";
8
- import Y from "./ImageCrudField.es.js";
9
- import Z from "../common/check-box/CheckBox.es.js";
10
- import V from "../common/date-picker/DatePicker.es.js";
11
- import ee from "../common/date-picker/TimePicker.es.js";
12
- import M from "../common/select/SelectComponent.es.js";
13
- import re from "../common/text-field/NumberField.es.js";
5
+ import { useTranslationLib as K } from "../locale/index.es.js";
6
+ import Q from "./FileCrudField.es.js";
7
+ import X from "./ImageCrudField.es.js";
8
+ import Y from "../common/check-box/CheckBox.es.js";
9
+ import Z from "../common/date-picker/DatePicker.es.js";
10
+ import V from "../common/date-picker/TimePicker.es.js";
11
+ import W from "../common/select/SelectComponent.es.js";
12
+ import ee from "../common/text-field/NumberField.es.js";
14
13
  import te from "../common/text-field/TextField.es.js";
15
- import oe from "../common/text-field/TextArea.es.js";
16
- import ae from "../common/tooltip/TooltipComponent.es.js";
17
- function Ne(x) {
14
+ import re from "../common/text-field/TextArea.es.js";
15
+ import oe from "../common/tooltip/TooltipComponent.es.js";
16
+ function xe(x) {
18
17
  const {
19
18
  label: i,
20
19
  name: c,
21
20
  type: b,
22
21
  required: s,
23
- hidden: F,
22
+ hidden: N,
24
23
  rules: u = [],
25
24
  updatable: h = !0,
26
25
  readonly: w = !1,
27
- fieldClassName: f,
26
+ fieldClassName: g,
28
27
  customFormFieldRender: k,
29
28
  fieldTooltip: v,
30
29
  ...e
31
- } = x, p = S.useFormInstance();
32
- P(() => {
30
+ } = x, p = P.useFormInstance();
31
+ S(() => {
33
32
  if (b === "select") {
34
33
  const {
35
- items: t = [],
34
+ items: r = [],
36
35
  onSearch: n,
37
36
  searchOnType: o
38
37
  } = e;
39
- !(t != null && t.length) && !o && (n == null || n(void 0, p, e == null ? void 0 : e.updatingValue));
38
+ !(r != null && r.length) && !o && (n == null || n(void 0, p, e == null ? void 0 : e.updatingValue));
40
39
  }
41
40
  }, [p, e, b, e == null ? void 0 : e.updatingValue]);
42
- const { t: N } = K(Q);
43
- if (w || F) return /* @__PURE__ */ a(O, {});
41
+ const { t: F } = K();
42
+ if (w || N) return /* @__PURE__ */ a(O, {});
44
43
  if (k)
45
44
  return k(p, x);
46
45
  switch (b) {
47
46
  case "text":
48
47
  case "email":
49
48
  case "password": {
50
- const { onChange: t, placeholder: n } = e;
49
+ const { onChange: r, placeholder: n } = e;
51
50
  return /* @__PURE__ */ a(
52
51
  te,
53
52
  {
@@ -55,31 +54,31 @@ function Ne(x) {
55
54
  disabled: !h,
56
55
  rules: u,
57
56
  required: s,
58
- onChange: t ? (o) => t(o, p) : void 0,
57
+ onChange: r ? (o) => r(o, p) : void 0,
59
58
  type: b,
60
59
  name: c,
61
60
  tooltip: v,
62
61
  label: i,
63
- className: f,
62
+ className: g,
64
63
  autoComplete: "new-password"
65
64
  }
66
65
  );
67
66
  }
68
67
  case "number": {
69
- const { onChange: t, placeholder: n, allowMinus: o } = e;
68
+ const { onChange: r, placeholder: n, allowMinus: o } = e;
70
69
  return /* @__PURE__ */ a(
71
- re,
70
+ ee,
72
71
  {
73
72
  placeholder: n,
74
73
  disabled: !h,
75
74
  moneyField: !!e.formatted,
76
75
  type: b,
77
- onChange: t ? (g) => t(g, p) : void 0,
76
+ onChange: r ? (f) => r(f, p) : void 0,
78
77
  rules: u,
79
78
  autoComplete: "false",
80
79
  required: s,
81
80
  tooltip: v,
82
- className: f,
81
+ className: g,
83
82
  min: o ? null : void 0,
84
83
  name: c,
85
84
  label: i
@@ -88,16 +87,16 @@ function Ne(x) {
88
87
  }
89
88
  case "date": {
90
89
  const {
91
- range: t,
90
+ range: r,
92
91
  disableToday: n,
93
92
  disabledFutureDays: o,
94
- disabledPastDays: g,
93
+ disabledPastDays: f,
95
94
  onChange: C,
96
95
  placeholder: m,
97
96
  format: T
98
97
  } = e;
99
98
  return /* @__PURE__ */ a(
100
- V,
99
+ Z,
101
100
  {
102
101
  placeholder: m,
103
102
  required: s,
@@ -105,30 +104,30 @@ function Ne(x) {
105
104
  type: b,
106
105
  format: T,
107
106
  tooltip: v,
108
- range: t,
107
+ range: r,
109
108
  name: c,
110
109
  label: i,
111
110
  onChange: C ? (l) => C(l, p) : void 0,
112
- className: f,
111
+ className: g,
113
112
  disableToday: n,
114
113
  disabledFutureDays: o,
115
- disabledPastDays: g
114
+ disabledPastDays: f
116
115
  }
117
116
  );
118
117
  }
119
118
  case "time": {
120
119
  const {
121
- range: t = !1,
120
+ range: r = !1,
122
121
  disableCurrent: n,
123
122
  disabledFuture: o,
124
- disabledPast: g,
123
+ disabledPast: f,
125
124
  onChange: C,
126
125
  use12Hours: m,
127
126
  format: T,
128
127
  placeholder: l
129
128
  } = e;
130
129
  return /* @__PURE__ */ a(
131
- ee,
130
+ V,
132
131
  {
133
132
  placeholder: l,
134
133
  required: s,
@@ -136,50 +135,50 @@ function Ne(x) {
136
135
  disabled: !h,
137
136
  type: b,
138
137
  tooltip: v,
139
- range: t,
138
+ range: r,
140
139
  use12Hours: m,
141
140
  name: c,
142
141
  label: i,
143
142
  onChange: C ? (y) => C(y, p) : void 0,
144
- className: f,
143
+ className: g,
145
144
  disableCurrent: n,
146
145
  disabledFuture: o,
147
- disabledPast: g
146
+ disabledPast: f
148
147
  }
149
148
  );
150
149
  }
151
150
  case "textarea": {
152
- const { onChange: t, placeholder: n, rows: o, cols: g } = e;
151
+ const { onChange: r, placeholder: n, rows: o, cols: f } = e;
153
152
  return /* @__PURE__ */ a(
154
- oe,
153
+ re,
155
154
  {
156
155
  rules: u,
157
156
  placeholder: n,
158
- onChange: t ? (C) => {
157
+ onChange: r ? (C) => {
159
158
  var m;
160
- return t((m = C == null ? void 0 : C.target) == null ? void 0 : m.value, p);
159
+ return r((m = C == null ? void 0 : C.target) == null ? void 0 : m.value, p);
161
160
  } : void 0,
162
161
  tooltip: v,
163
162
  required: s,
164
163
  disabled: !h,
165
164
  name: c,
166
165
  label: i,
167
- className: f,
166
+ className: g,
168
167
  rows: o,
169
- cols: g
168
+ cols: f
170
169
  }
171
170
  );
172
171
  }
173
172
  case "image":
174
173
  return /* @__PURE__ */ a(
175
- Y,
174
+ X,
176
175
  {
177
176
  ...e,
178
177
  required: s,
179
178
  name: c,
180
179
  label: i,
181
180
  rules: u,
182
- fieldClassName: f,
181
+ fieldClassName: g,
183
182
  onRemoved: e.onRemoved,
184
183
  onUploading: e.onUploading,
185
184
  provider: e.provider
@@ -187,14 +186,14 @@ function Ne(x) {
187
186
  );
188
187
  case "file":
189
188
  return /* @__PURE__ */ a(
190
- X,
189
+ Q,
191
190
  {
192
191
  ...e,
193
192
  required: s,
194
193
  name: c,
195
194
  label: i,
196
195
  rules: u,
197
- fieldClassName: f,
196
+ fieldClassName: g,
198
197
  onRemoved: e.onRemoved,
199
198
  onUploading: e.onUploading,
200
199
  provider: e.provider
@@ -202,14 +201,14 @@ function Ne(x) {
202
201
  );
203
202
  case "select":
204
203
  return /* @__PURE__ */ a(
205
- le,
204
+ ae,
206
205
  {
207
206
  ...e,
208
207
  required: s,
209
208
  name: c,
210
209
  label: i,
211
210
  rules: u,
212
- fieldClassName: f,
211
+ fieldClassName: g,
213
212
  form: p,
214
213
  updatable: h,
215
214
  readonly: w,
@@ -218,15 +217,15 @@ function Ne(x) {
218
217
  );
219
218
  case "enum": {
220
219
  const {
221
- enum: t,
220
+ enum: r,
222
221
  radio: n = !1,
223
222
  translation: o,
224
- onChange: g,
223
+ onChange: f,
225
224
  onSearch: C,
226
225
  multiple: m
227
- } = e, T = Array.isArray(t) ? t : Object.keys(t);
226
+ } = e, T = Array.isArray(r) ? r : Object.keys(r);
228
227
  return n ? /* @__PURE__ */ a(
229
- S.Item,
228
+ P.Item,
230
229
  {
231
230
  ...e,
232
231
  name: c,
@@ -234,25 +233,25 @@ function Ne(x) {
234
233
  tooltip: v,
235
234
  rules: u,
236
235
  label: i,
237
- className: ["w-100", f].join(" "),
236
+ className: ["w-100", g].join(" "),
238
237
  children: /* @__PURE__ */ a(
239
- q.Group,
238
+ D.Group,
240
239
  {
241
240
  ...e,
242
- onChange: g ? (l) => {
241
+ onChange: f ? (l) => {
243
242
  var y;
244
- return g((y = l == null ? void 0 : l.target) == null ? void 0 : y.value, p);
243
+ return f((y = l == null ? void 0 : l.target) == null ? void 0 : y.value, p);
245
244
  } : void 0,
246
- children: T.map((l) => /* @__PURE__ */ a(q, { disabled: !h, value: l, children: o ? N(o[l]) : l }, l))
245
+ children: T.map((l) => /* @__PURE__ */ a(D, { disabled: !h, value: l, children: o ? F(o[l]) : l }, l))
247
246
  }
248
247
  )
249
248
  }
250
249
  ) : /* @__PURE__ */ a(
251
- M,
250
+ W,
252
251
  {
253
252
  ...e,
254
- onChange: g ? (l) => g(l, p) : void 0,
255
- className: ["w-100", f].join(" "),
253
+ onChange: f ? (l) => f(l, p) : void 0,
254
+ className: ["w-100", g].join(" "),
256
255
  name: c,
257
256
  items: T,
258
257
  required: s,
@@ -263,18 +262,18 @@ function Ne(x) {
263
262
  onSearch: C ? (l) => C(l, p) : void 0,
264
263
  allowClear: !0,
265
264
  mode: m ? "multiple" : void 0,
266
- itemBuilder: (l) => /* @__PURE__ */ a(A.Option, { value: l, children: o ? N(o[l]) : l }, l)
265
+ itemBuilder: (l) => /* @__PURE__ */ a(R.Option, { value: l, children: o ? F(o[l]) : l }, l)
267
266
  }
268
267
  );
269
268
  }
270
269
  case "checkbox": {
271
- const { onChange: t } = e;
270
+ const { onChange: r } = e;
272
271
  return /* @__PURE__ */ a(
273
- Z,
272
+ Y,
274
273
  {
275
- className: f,
274
+ className: g,
276
275
  rules: u,
277
- onChange: t ? (n) => t(n, p) : void 0,
276
+ onChange: r ? (n) => r(n, p) : void 0,
278
277
  label: i,
279
278
  tooltip: v,
280
279
  disabled: !h,
@@ -284,7 +283,7 @@ function Ne(x) {
284
283
  }
285
284
  case "color":
286
285
  return /* @__PURE__ */ a(
287
- ne,
286
+ le,
288
287
  {
289
288
  ...e,
290
289
  type: "color",
@@ -292,7 +291,7 @@ function Ne(x) {
292
291
  name: c,
293
292
  label: i,
294
293
  rules: u,
295
- fieldClassName: f,
294
+ fieldClassName: g,
296
295
  updatable: h,
297
296
  readonly: w,
298
297
  fieldTooltip: v
@@ -302,97 +301,97 @@ function Ne(x) {
302
301
  return /* @__PURE__ */ a(O, { children: `${b} Not Implemented` });
303
302
  }
304
303
  }
305
- function le(x) {
304
+ function ae(x) {
306
305
  const {
307
306
  items: i = [],
308
307
  loading: c,
309
308
  searchOnType: b,
310
309
  onSearch: s,
311
- multiple: F,
310
+ multiple: N,
312
311
  onChange: u,
313
312
  highlightSearch: h,
314
313
  required: w,
315
- fieldClassName: f,
314
+ fieldClassName: g,
316
315
  rules: k,
317
316
  fieldTooltip: v,
318
317
  updatable: e,
319
318
  label: p,
320
- name: N,
321
- tagRender: t,
319
+ name: F,
320
+ tagRender: r,
322
321
  updatingValue: n,
323
322
  onSet: o,
324
- placeholder: g,
323
+ placeholder: f,
325
324
  allowClear: C = !0
326
- } = x, m = x.form, [T, l] = D(""), y = S.useWatch(N, m), [R, j] = D(!0);
327
- P(() => {
328
- o && R && y && (o == null || o(y, i, m), j(!1));
329
- }, [R, m, i, N, o, y]), P(() => {
330
- y && j(!0);
325
+ } = x, m = x.form, [T, l] = E(""), y = P.useWatch(F, m), [j, I] = E(!0);
326
+ S(() => {
327
+ o && j && y && (o == null || o(y, i, m), I(!1));
328
+ }, [j, m, i, F, o, y]), S(() => {
329
+ y && I(!0);
331
330
  }, [y]);
332
- const W = z(
333
- async (r) => {
334
- l(r), b && (s == null || s(r, m, n));
331
+ const G = z(
332
+ async (t) => {
333
+ l(t), b && (s == null || s(t, m, n));
335
334
  },
336
335
  [m, s, b, n]
337
336
  );
338
337
  return /* @__PURE__ */ a(
339
- M,
338
+ W,
340
339
  {
341
340
  ...x,
342
341
  maxTagCount: "responsive",
343
- maxTagPlaceholder: (r) => /* @__PURE__ */ U(
344
- ae,
342
+ maxTagPlaceholder: (t) => /* @__PURE__ */ q(
343
+ oe,
345
344
  {
346
- title: /* @__PURE__ */ a(O, { children: r.map((d) => /* @__PURE__ */ U(O, { children: [
345
+ title: /* @__PURE__ */ a(O, { children: t.map((d) => /* @__PURE__ */ q(O, { children: [
347
346
  d.label,
348
347
  " ",
349
348
  /* @__PURE__ */ a("br", {})
350
349
  ] })) }),
351
350
  children: [
352
351
  "+",
353
- r == null ? void 0 : r.length
352
+ t == null ? void 0 : t.length
354
353
  ]
355
354
  }
356
355
  ),
357
- placeholder: g,
358
- onSelect: (r) => {
359
- o == null || o(r == null ? void 0 : r.key, i, m);
356
+ placeholder: f,
357
+ onSelect: (t) => {
358
+ o == null || o(t == null ? void 0 : t.key, i, m);
360
359
  },
361
- onChange: u ? (r) => {
362
- l(""), u(r, m);
360
+ onChange: u ? (t) => {
361
+ l(""), u(t, m);
363
362
  } : void 0,
364
- mode: F ? "multiple" : void 0,
365
- className: ["w-100", f].join(" "),
366
- name: N,
363
+ mode: N ? "multiple" : void 0,
364
+ className: ["w-100", g].join(" "),
365
+ name: F,
367
366
  items: i,
368
367
  required: w,
369
368
  tooltip: v,
370
- tagRender: t,
369
+ tagRender: r,
371
370
  rules: k,
372
371
  disabled: !e,
373
372
  label: p,
374
373
  allowClear: C,
375
- onSearch: W,
374
+ onSearch: G,
376
375
  loading: c,
377
- filterOption: h ? (r, d) => {
378
- var I, L, B;
376
+ filterOption: h ? (t, d) => {
377
+ var L, A, B;
379
378
  try {
380
- const E = r.toLowerCase().split(/\s+/), _ = ((typeof (d == null ? void 0 : d.children) == "string" ? d == null ? void 0 : d.children : (L = (I = d == null ? void 0 : d.children) == null ? void 0 : I.props) == null ? void 0 : L.textToHighlight) ?? "").toLowerCase(), G = (((B = d == null ? void 0 : d.value) == null ? void 0 : B.toString()) ?? "").toLowerCase();
381
- return E.every(
382
- (H) => _.indexOf(H) >= 0 || G.indexOf(H) >= 0
379
+ const H = t.toLowerCase().split(/\s+/), M = ((typeof (d == null ? void 0 : d.children) == "string" ? d == null ? void 0 : d.children : (A = (L = d == null ? void 0 : d.children) == null ? void 0 : L.props) == null ? void 0 : A.textToHighlight) ?? "").toLowerCase(), _ = (((B = d == null ? void 0 : d.value) == null ? void 0 : B.toString()) ?? "").toLowerCase();
380
+ return H.every(
381
+ (U) => M.indexOf(U) >= 0 || _.indexOf(U) >= 0
383
382
  );
384
383
  } catch {
385
384
  return !0;
386
385
  }
387
386
  } : void 0,
388
- itemBuilder: h ? (r) => {
389
- const d = r.value ? String(r.value) : void 0;
387
+ itemBuilder: h ? (t) => {
388
+ const d = t.value ? String(t.value) : void 0;
390
389
  return /* @__PURE__ */ a(
391
- A.Option,
390
+ R.Option,
392
391
  {
393
- value: r.key,
392
+ value: t.key,
394
393
  title: d,
395
- disabled: r.disabled,
394
+ disabled: t.disabled,
396
395
  children: /* @__PURE__ */ a(
397
396
  J,
398
397
  {
@@ -403,33 +402,33 @@ function le(x) {
403
402
  }
404
403
  )
405
404
  },
406
- r.key
405
+ t.key
407
406
  );
408
- } : (r) => /* @__PURE__ */ a(
409
- A.Option,
407
+ } : (t) => /* @__PURE__ */ a(
408
+ R.Option,
410
409
  {
411
- value: r.key,
412
- title: r.value,
413
- disabled: r.disabled,
414
- children: r.value
410
+ value: t.key,
411
+ title: t.value,
412
+ disabled: t.disabled,
413
+ children: t.value
415
414
  },
416
- r.key
415
+ t.key
417
416
  )
418
417
  }
419
418
  );
420
419
  }
421
- function ne(x) {
420
+ function le(x) {
422
421
  const {
423
422
  required: i,
424
423
  fieldClassName: c,
425
424
  rules: b,
426
425
  fieldTooltip: s,
427
- updatable: F,
426
+ updatable: N,
428
427
  label: u,
429
428
  name: h
430
429
  } = x;
431
430
  return /* @__PURE__ */ a(
432
- S.Item,
431
+ P.Item,
433
432
  {
434
433
  label: u,
435
434
  name: h,
@@ -445,7 +444,7 @@ function ne(x) {
445
444
  showText: !0,
446
445
  trigger: "click",
447
446
  className: c,
448
- disabled: !F,
447
+ disabled: !N,
449
448
  ...x.innerProps
450
449
  }
451
450
  )
@@ -453,7 +452,7 @@ function ne(x) {
453
452
  );
454
453
  }
455
454
  export {
456
- ne as ColorCrudFieldComponent,
457
- le as SelectCrudFieldComponent,
458
- Ne as default
455
+ le as ColorCrudFieldComponent,
456
+ ae as SelectCrudFieldComponent,
457
+ xe as default
459
458
  };
@@ -1 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),g=require("@ant-design/icons"),u=require("antd"),F=require("react"),k=require("react-i18next"),S=require("../locale/hooks/translation-constants.cjs.js"),y=require("./CrudForm.cjs.js"),T=require("../common/wizard/WizardViewForm.cjs.js"),C=require("../common/button/Button.cjs.js");function v({fields:l,className:m,onDeleteFile:h,onUploadFile:i,purpose:c,wizard:r=[],updatingValue:f,onSave:x,submitting:j}){const d=F.useMemo(()=>r.map(n=>{let t=!0;const o=l.filter(s=>n.fields.includes(s.name));return o.forEach(s=>t&&(t=s.hidden??!1)),{...n,hidden:t,fieldThatShouldShowing:o}}),[l,r]),a=F.useMemo(()=>d.filter(n=>!n.hidden),[d]);return e.jsx(e.Fragment,{children:e.jsx(T,{onSubmit:(n,t)=>{console.log(t),x(t)},className:m,pages:a.map(({title:n,icon:t,fieldThatShouldShowing:o,hidden:s},b)=>({title:n,icon:t,hidden:s,component:q=>e.jsx(R,{fields:o,onDeleteFile:h,onUploadFile:i,purpose:c,i:b,updatingValue:f,backward:q.backward,forward:q.forward,wizard:a,submitting:j},b)}))})})}function R({fields:l,onDeleteFile:m,onUploadFile:h,purpose:i,wizard:c=[],i:r,forward:f,backward:x,submitting:j,updatingValue:d}){const a=c[r],{t:n}=k.useTranslation(S.TRANSLATION_NAMESPACE),[t]=u.Form.useForm();return F.useEffect(()=>{if(d&&(i==="update"||i==="clone")){const o={};for(const s of l)o[s.name]=d[s.name];t.setFieldsValue(o)}},[l,t,i,d]),e.jsxs(u.Form,{name:String(r),form:t,layout:"vertical",children:[e.jsx(y.CrudFormFields,{fields:l,formBuilder:a.formBuilder,grid:a.grid,onDeleteFile:m,onUploadFile:h,purpose:i}),e.jsx(u.Divider,{}),e.jsxs(u.Row,{gutter:[8,8],children:[r>0&&e.jsx(u.Col,{md:12,children:e.jsx(C,{block:!0,icon:e.jsx(g.LeftOutlined,{}),htmlType:"button",type:"default",size:"large",onClick:()=>x(),children:n("str.back")})}),e.jsx(u.Col,{md:r>0?12:24,children:e.jsx(C,{block:!0,icon:c.length-1===r?e.jsx(g.SaveOutlined,{}):e.jsx(g.RightOutlined,{}),htmlType:"submit",type:"primary",loading:j,size:"large",onClick:()=>{t.validateFields().then(o=>{f(o,c.length-1===r,c.length-1===r)})},children:c.length-1===r?n("str."+(i==="update"?"update":"save")):n("str.next")})})]})]})}module.exports=v;
1
+ "use strict";const e=require("react/jsx-runtime"),g=require("@ant-design/icons"),u=require("antd"),F=require("react"),y=require("../locale/index.cjs.js"),C=require("./CrudForm.cjs.js"),S=require("../common/wizard/WizardViewForm.cjs.js"),q=require("../common/button/Button.cjs.js");function v({fields:c,className:m,onDeleteFile:h,onUploadFile:i,purpose:l,wizard:t=[],updatingValue:f,onSave:x,submitting:j}){const d=F.useMemo(()=>t.map(n=>{let r=!0;const o=c.filter(s=>n.fields.includes(s.name));return o.forEach(s=>r&&(r=s.hidden??!1)),{...n,hidden:r,fieldThatShouldShowing:o}}),[c,t]),a=F.useMemo(()=>d.filter(n=>!n.hidden),[d]);return e.jsx(e.Fragment,{children:e.jsx(S,{onSubmit:(n,r)=>{console.log(r),x(r)},className:m,pages:a.map(({title:n,icon:r,fieldThatShouldShowing:o,hidden:s},b)=>({title:n,icon:r,hidden:s,component:k=>e.jsx(w,{fields:o,onDeleteFile:h,onUploadFile:i,purpose:l,i:b,updatingValue:f,backward:k.backward,forward:k.forward,wizard:a,submitting:j},b)}))})})}function w({fields:c,onDeleteFile:m,onUploadFile:h,purpose:i,wizard:l=[],i:t,forward:f,backward:x,submitting:j,updatingValue:d}){const a=l[t],{t:n}=y.useTranslationLib(),[r]=u.Form.useForm();return F.useEffect(()=>{if(d&&(i==="update"||i==="clone")){const o={};for(const s of c)o[s.name]=d[s.name];r.setFieldsValue(o)}},[c,r,i,d]),e.jsxs(u.Form,{name:String(t),form:r,layout:"vertical",children:[e.jsx(C.CrudFormFields,{fields:c,formBuilder:a.formBuilder,grid:a.grid,onDeleteFile:m,onUploadFile:h,purpose:i}),e.jsx(u.Divider,{}),e.jsxs(u.Row,{gutter:[8,8],children:[t>0&&e.jsx(u.Col,{md:12,children:e.jsx(q,{block:!0,icon:e.jsx(g.LeftOutlined,{}),htmlType:"button",type:"default",size:"large",onClick:()=>x(),children:n("str.back")})}),e.jsx(u.Col,{md:t>0?12:24,children:e.jsx(q,{block:!0,icon:l.length-1===t?e.jsx(g.SaveOutlined,{}):e.jsx(g.RightOutlined,{}),htmlType:"submit",type:"primary",loading:j,size:"large",onClick:()=>{r.validateFields().then(o=>{f(o,l.length-1===t,l.length-1===t)})},children:l.length-1===t?n("str."+(i==="update"?"update":"save")):n("str.next")})})]})]})}module.exports=v;