@kingteza/crud-component 1.0.40 → 1.0.43

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 (70) 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/DateUtil.cjs.js +1 -1
  68. package/util/DateUtil.es.js +16 -4
  69. package/util/ValidationUtil.cjs.js +1 -1
  70. package/util/ValidationUtil.es.js +26 -23
@@ -1,59 +1,58 @@
1
- import { jsx as t, jsxs as S, Fragment as oe } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as N, Fragment as oe } from "react/jsx-runtime";
2
2
  /* empty css */
3
3
  /* empty css */
4
- import { RotateLeftOutlined as ye, RotateRightOutlined as Ie, UploadOutlined as ne, LoadingOutlined as Oe } from "@ant-design/icons";
5
- import { Form as Ue, Modal as q, Upload as Ne } from "antd";
6
- import z, { useRef as B, useState as w, useEffect as R, useCallback as ee, useMemo as te } from "react";
7
- import { Cropper as Fe } from "react-cropper";
8
- import { useTranslation as Re } from "react-i18next";
9
- import { TRANSLATION_NAMESPACE as Se } from "../../locale/hooks/translation-constants.es.js";
10
- import E from "../button/Button.es.js";
11
- import je from "../../util/ImageUtil.es.js";
12
- const ke = Ue.Item;
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;
13
12
  function re(r) {
14
13
  return new Promise((l, p) => {
15
14
  const o = new FileReader();
16
15
  o.readAsDataURL(r), o.onload = () => l(o.result), o.onerror = (m) => p(m);
17
16
  });
18
17
  }
19
- const We = ({
18
+ const Ve = ({
20
19
  values: r = [],
21
20
  required: l,
22
21
  buttonType: p,
23
22
  label: o,
24
23
  name: m,
25
24
  onChange: f,
26
- aspectRatio: j,
25
+ aspectRatio: S,
27
26
  buttonTitle: C,
28
27
  hidePreview: v,
29
28
  buttonSize: u = "large",
30
29
  showButtonText: g = !0,
31
30
  showOnlyIcon: _ = !1,
32
- icon: I = /* @__PURE__ */ t(ne, {}),
33
- loading: O,
31
+ icon: U = /* @__PURE__ */ t(ne, {}),
32
+ loading: I,
34
33
  maxCount: b = 1,
35
34
  onAdd: c,
36
- onRemove: U,
37
- listType: N,
38
- ...L
35
+ onRemove: O,
36
+ listType: F,
37
+ ...E
39
38
  }) => {
40
- const [ie, ae] = z.useState(""), [se, ce] = z.useState(""), [le, T] = z.useState(!1), k = B(), i = B(), [a, A] = w([]), [h, P] = w(), de = B(), pe = () => T(!1), me = async (e) => {
41
- !e.url && !e.preview && (e.preview = await re(e.originFileObj)), ce(e.url || e.preview), T(!0), ae(e.name);
42
- }, [J, F] = w(!1), fe = () => {
43
- }, V = (e) => {
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) => {
44
43
  var n;
45
44
  (n = i == null ? void 0 : i.current) == null || n.cropper.rotate(e ? -90 : 90);
46
45
  };
47
- R(() => {
46
+ j(() => {
48
47
  f == null || f(a[0], a);
49
48
  }, [a, f]);
50
49
  const ue = () => {
51
50
  var y;
52
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;
53
- F(!0), e == null || e.toBlob(async (be) => {
52
+ R(!0), e == null || e.toBlob(async (be) => {
54
53
  const xe = Object.assign(new File([be], d, { type: n }), {
55
54
  uid: x
56
- }), X = await je.resizeImage(xe), Y = await re(X), Z = {
55
+ }), X = await Ne.resizeImage(xe), Y = await re(X), Z = {
57
56
  url: Y,
58
57
  name: d,
59
58
  uid: x,
@@ -64,15 +63,15 @@ const We = ({
64
63
  };
65
64
  if (c)
66
65
  try {
67
- F(!0), await c(Z);
66
+ R(!0), await c(Z);
68
67
  } finally {
69
- F(!1);
68
+ R(!1);
70
69
  }
71
- A([Z, ...a]), F(!1);
70
+ D([Z, ...a]), R(!1);
72
71
  }), P(void 0);
73
72
  }, ge = () => {
74
73
  P(void 0), k.current = void 0;
75
- }, W = ee((e) => {
74
+ }, $ = ee((e) => {
76
75
  const n = e;
77
76
  if (n) {
78
77
  k.current = n;
@@ -89,65 +88,65 @@ const We = ({
89
88
  }), s.readAsDataURL(n);
90
89
  }
91
90
  }, []);
92
- R(() => {
91
+ j(() => {
93
92
  if (r != null && r.length || typeof r == "string") {
94
93
  const e = Array.isArray(r) ? r.map((n) => [{ uid: r, url: n }]) : [{ uid: r, url: r }];
95
- A(e);
94
+ D(e);
96
95
  }
97
96
  }, [r]);
98
- const { t: D } = Re(Se), he = te(
97
+ const { t: z } = je(), he = te(
99
98
  () => l ? {
100
99
  required: l,
101
100
  validator: (e, n, s) => {
102
- h || a != null && a.length ? s() : s(`${o ?? ""} ${D("err.validation.required")}`);
101
+ h || a != null && a.length ? s() : s(`${o ?? ""} ${z("err.validation.required")}`);
103
102
  }
104
103
  } : void 0,
105
- [l, h, a == null ? void 0 : a.length, o, D]
106
- ), $ = C ?? D("message.fileUploadMessage2"), H = te(
104
+ [l, h, a == null ? void 0 : a.length, o, z]
105
+ ), H = C ?? z("message.fileUploadMessage2"), T = te(
107
106
  () => /* @__PURE__ */ t(
108
- Ae,
107
+ ke,
109
108
  {
110
- showLoadingIndicator: J,
111
- _buttonTitle: $,
109
+ showLoadingIndicator: V,
110
+ _buttonTitle: H,
112
111
  buttonSize: u,
113
112
  buttonType: p,
114
113
  fileList: a,
115
114
  hidePreview: v,
116
- icon: I,
117
- loading: O,
118
- listType: N,
115
+ icon: U,
116
+ loading: I,
117
+ listType: F,
119
118
  maxCount: b,
120
- onChangeFile: W,
121
- onRemove: U,
119
+ onChangeFile: $,
120
+ onRemove: O,
122
121
  showButtonText: g,
123
122
  handlePreview: me,
124
- setFileList: A
123
+ setFileList: D
125
124
  }
126
125
  ),
127
126
  [
128
- J,
129
- $,
127
+ V,
128
+ H,
130
129
  u,
131
130
  p,
132
131
  a,
133
132
  v,
133
+ U,
134
134
  I,
135
- O,
136
- N,
135
+ F,
137
136
  b,
138
- W,
139
- U,
137
+ $,
138
+ O,
140
139
  g
141
140
  ]
142
141
  );
143
- de.current = H.props.beforeUpload;
144
- const [we, G] = w(0), [Ce, K] = w(0), [M, ve] = w();
145
- R(() => {
142
+ de.current = T.props.beforeUpload;
143
+ const [we, G] = w(0), [Ce, K] = w(0), [B, ve] = w();
144
+ j(() => {
146
145
  const e = setTimeout(() => {
147
- M && localStorage.setItem("cropper.box", JSON.stringify(M));
146
+ B && localStorage.setItem("cropper.box", JSON.stringify(B));
148
147
  }, 400);
149
148
  return () => clearTimeout(e);
150
- }, [M]), R(() => {
149
+ }, [B]), j(() => {
151
150
  h || (G(0), K(0));
152
151
  }, [h]);
153
152
  const Q = ee(async () => {
@@ -158,19 +157,19 @@ const We = ({
158
157
  ve(e.getCropBoxData()), G(s), K(d);
159
158
  }
160
159
  }, []);
161
- return /* @__PURE__ */ S(oe, { children: [
160
+ return /* @__PURE__ */ N(oe, { children: [
162
161
  /* @__PURE__ */ t(
163
- ke,
162
+ Se,
164
163
  {
165
164
  label: o,
166
- ...L,
165
+ ...E,
167
166
  name: m,
168
167
  className: "mb-0",
169
- rules: [he, ...L.rules ?? []],
170
- children: H
168
+ rules: [he, ...E.rules ?? []],
169
+ children: T
171
170
  }
172
171
  ),
173
- /* @__PURE__ */ S(
172
+ /* @__PURE__ */ N(
174
173
  q,
175
174
  {
176
175
  open: !!h,
@@ -180,32 +179,32 @@ const We = ({
180
179
  onCancel: ge,
181
180
  children: [
182
181
  /* @__PURE__ */ t(
183
- Fe,
182
+ Re,
184
183
  {
185
184
  ref: i,
186
185
  src: h,
187
186
  cropmove: Q,
188
187
  viewMode: 1,
189
- aspectRatio: j,
188
+ aspectRatio: S,
190
189
  cropend: () => fe()
191
190
  }
192
191
  ),
193
192
  /* @__PURE__ */ t("p", { className: "text-center", children: [we, Ce].join(" ⨉ ") }),
194
- /* @__PURE__ */ S("div", { className: "mt-2 d-flex justify-content-center", children: [
193
+ /* @__PURE__ */ N("div", { className: "mt-2 d-flex justify-content-center", children: [
195
194
  /* @__PURE__ */ t(
196
- E,
195
+ L,
197
196
  {
198
197
  size: "large",
199
198
  icon: /* @__PURE__ */ t(ye, {}),
200
- onClick: () => V(!0)
199
+ onClick: () => W(!0)
201
200
  }
202
201
  ),
203
202
  /* @__PURE__ */ t(
204
- E,
203
+ L,
205
204
  {
206
205
  size: "large",
207
- icon: /* @__PURE__ */ t(Ie, {}),
208
- onClick: () => V(!1)
206
+ icon: /* @__PURE__ */ t(Ue, {}),
207
+ onClick: () => W(!1)
209
208
  }
210
209
  )
211
210
  ] })
@@ -223,24 +222,24 @@ const We = ({
223
222
  }
224
223
  )
225
224
  ] });
226
- }, Ae = ({
225
+ }, ke = ({
227
226
  _buttonTitle: r,
228
227
  buttonSize: l,
229
228
  buttonType: p,
230
229
  fileList: o,
231
230
  hidePreview: m,
232
231
  icon: f,
233
- loading: j,
232
+ loading: S,
234
233
  maxCount: C,
235
234
  onChangeFile: v,
236
235
  onRemove: u,
237
236
  showButtonText: g,
238
237
  handlePreview: _,
239
- setFileList: I,
240
- showLoadingIndicator: O,
238
+ setFileList: U,
239
+ showLoadingIndicator: I,
241
240
  listType: b = "picture"
242
- }) => /* @__PURE__ */ t(oe, { children: /* @__PURE__ */ S(
243
- Ne,
241
+ }) => /* @__PURE__ */ t(oe, { children: /* @__PURE__ */ N(
242
+ Fe,
244
243
  {
245
244
  accept: "image/x-png,image/gif,image/jpeg",
246
245
  fileList: o,
@@ -254,17 +253,17 @@ const We = ({
254
253
  listType: b,
255
254
  showUploadList: !m,
256
255
  onRemove: (c) => {
257
- const U = o.filter((N) => c.uid !== N.uid);
258
- u == null || u(c), I(U);
256
+ const O = o.filter((F) => c.uid !== F.uid);
257
+ u == null || u(c), U(O);
259
258
  },
260
259
  beforeUpload: async (c) => (v(c), !1),
261
260
  maxCount: C,
262
261
  children: [
263
- O && /* @__PURE__ */ t(Oe, {}),
262
+ I && /* @__PURE__ */ t(Ie, {}),
264
263
  /* @__PURE__ */ t("div", { className: "d-flex flex-column", children: o.length < C && (b === "picture-circle" ? /* @__PURE__ */ t(ne, {}) : /* @__PURE__ */ t(
265
- E,
264
+ L,
266
265
  {
267
- loading: j,
266
+ loading: S,
268
267
  tooltip: g ? void 0 : r,
269
268
  size: l,
270
269
  icon: f,
@@ -277,6 +276,6 @@ const We = ({
277
276
  o.length
278
277
  ) });
279
278
  export {
280
- Ae as UploadComponent,
281
- We as default
279
+ ke as UploadComponent,
280
+ Ve as default
282
281
  };
@@ -1 +1 @@
1
- "use strict";const r=require("react/jsx-runtime"),a=require("antd"),k=require("react"),H=require("react-i18next"),P=require("../../locale/hooks/translation-constants.cjs.js"),b=require("../tooltip/TooltipComponent.cjs.js");function B({label:l,rules:j=[],required:w,placeholder:h,notSearch:q,children:x,readOnly:s,items:o,dropdownRender:L,itemBuilder:T,loading:f,showLoadingInEmptyIndicator:N,nameFieldInArray:m="name",innerRef:_,tooltip:I,filterOption:p,tagRender:A,...n}){const{t:E}=H.useTranslation(P.TRANSLATION_NAMESPACE),M=k.useCallback(e=>{const t=typeof e=="string"||typeof e=="number"?e:e==null?void 0:e.id,c=typeof e=="string"||typeof e=="number"?e:e==null?void 0:e[m];return r.jsx("option",{value:t,children:r.jsx("div",{dangerouslySetInnerHTML:{__html:c}})},t)},[m]);return r.jsx(a.ConfigProvider,{renderEmpty:N&&f?()=>r.jsx(a.Spin,{}):void 0,children:r.jsx(b,{title:I,children:r.jsx(a.Form.Item,{label:l,name:n.name,help:n.help,className:n.className,rules:[...j,{required:w,message:`${l??h??""} ${E("err.validation.required")}`}],children:r.jsx(a.Select,{ref:_,loading:f,open:s?!1:void 0,onChange:!s&&n.onChange,allowClear:!s&&n.allowClear,showSearch:!q,className:`max-width ${s?"readOnly":""}`,...n,tagRender:A,placeholder:h??l,filterOption:p??((e,t)=>{var c,C,u,g;try{const i=(u=(C=(c=t==null?void 0:t.children)==null?void 0:c.props)==null?void 0:C.dangerouslySetInnerHTML)==null?void 0:u.__html,O=e.toLowerCase().split(/\s+/),S=(t==null?void 0:t.children)??"",y=typeof S=="string"?S.toLowerCase():typeof i=="string"?i.toLowerCase():"",R=(((g=t==null?void 0:t.value)==null?void 0:g.toString())??"").toLowerCase(),$=y.replace(/\s/g,"");return O.every(d=>y.indexOf(d)>=0||R.indexOf(d)>=0||$.indexOf(d)>=0)}catch(i){return console.log(i),!0}}),dropdownRender:L,children:x===null?void 0:x??(o&&(o==null?void 0:o.map(T??M)))})})})})}module.exports=B;
1
+ "use strict";const t=require("react/jsx-runtime"),d=require("antd"),R=require("react"),B=require("../../locale/index.cjs.js"),D=require("../tooltip/TooltipComponent.cjs.js");function E({label:l,rules:w=[],required:S,placeholder:h,notSearch:L,children:x,readOnly:s,items:c,dropdownRender:q,itemBuilder:T,loading:f,showLoadingInEmptyIndicator:_,nameFieldInArray:m="name",innerRef:p,tooltip:N,filterOption:$,tagRender:b,...n}){const{t:k}=B.useTranslationLib(),H=R.useCallback(e=>{const r=typeof e=="string"||typeof e=="number"?e:e==null?void 0:e.id,o=typeof e=="string"||typeof e=="number"?e:e==null?void 0:e[m];return t.jsx("option",{value:r,children:t.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},r)},[m]);return t.jsx(d.ConfigProvider,{renderEmpty:_&&f?()=>t.jsx(d.Spin,{}):void 0,children:t.jsx(D,{title:N,children:t.jsx(d.Form.Item,{label:l,name:n.name,help:n.help,className:n.className,rules:[...w,{required:S,message:`${l??h??""} ${k("err.validation.required")}`}],children:t.jsx(d.Select,{ref:p,loading:f,open:s?!1:void 0,onChange:!s&&n.onChange,allowClear:!s&&n.allowClear,showSearch:!L,className:`max-width ${s?"readOnly":""}`,...n,tagRender:b,placeholder:h??l,filterOption:$??((e,r)=>{var o,g,u,C;try{const i=(u=(g=(o=r==null?void 0:r.children)==null?void 0:o.props)==null?void 0:g.dangerouslySetInnerHTML)==null?void 0:u.__html,I=e.toLowerCase().split(/\s+/),y=(r==null?void 0:r.children)??"",j=typeof y=="string"?y.toLowerCase():typeof i=="string"?i.toLowerCase():"",M=(((C=r==null?void 0:r.value)==null?void 0:C.toString())??"").toLowerCase(),O=j.replace(/\s/g,"");return I.every(a=>j.indexOf(a)>=0||M.indexOf(a)>=0||O.indexOf(a)>=0)}catch(i){return console.log(i),!0}}),dropdownRender:q,children:x===null?void 0:x??(c&&(c==null?void 0:c.map(T??H)))})})})})}module.exports=E;
@@ -1,30 +1,29 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { ConfigProvider as P, Spin as b, Form as j, Select as q } from "antd";
3
- import { useCallback as B } from "react";
4
- import { useTranslation as D } from "react-i18next";
5
- import { TRANSLATION_NAMESPACE as F } from "../../locale/hooks/translation-constants.es.js";
6
- import R from "../tooltip/TooltipComponent.es.js";
2
+ import { ConfigProvider as q, Spin as B, Form as D, Select as E } from "antd";
3
+ import { useCallback as F } from "react";
4
+ import { useTranslationLib as P } from "../../locale/index.es.js";
5
+ import V from "../tooltip/TooltipComponent.es.js";
7
6
  function Q({
8
7
  label: m,
9
- rules: w = [],
10
- required: x,
11
- placeholder: l,
8
+ rules: x = [],
9
+ required: S,
10
+ placeholder: f,
12
11
  notSearch: L,
13
12
  children: a,
14
13
  readOnly: o,
15
14
  items: s,
16
- dropdownRender: T,
17
- itemBuilder: u,
15
+ dropdownRender: u,
16
+ itemBuilder: T,
18
17
  loading: d,
19
- showLoadingInEmptyIndicator: N,
18
+ showLoadingInEmptyIndicator: _,
20
19
  nameFieldInArray: h = "name",
21
- innerRef: _,
22
- tooltip: A,
23
- filterOption: E,
24
- tagRender: I,
20
+ innerRef: N,
21
+ tooltip: $,
22
+ filterOption: b,
23
+ tagRender: k,
25
24
  ...n
26
25
  }) {
27
- const { t: M } = D(F), O = B(
26
+ const { t: H } = P(), I = F(
28
27
  (e) => {
29
28
  const r = typeof e == "string" || typeof e == "number" ? e : e == null ? void 0 : e.id, c = typeof e == "string" || typeof e == "number" ? e : e == null ? void 0 : e[h];
30
29
  return /* @__PURE__ */ t("option", { value: r, children: /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: c } }) }, r);
@@ -32,29 +31,29 @@ function Q({
32
31
  [h]
33
32
  );
34
33
  return /* @__PURE__ */ t(
35
- P,
34
+ q,
36
35
  {
37
- renderEmpty: N && d ? () => /* @__PURE__ */ t(b, {}) : void 0,
38
- children: /* @__PURE__ */ t(R, { title: A, children: /* @__PURE__ */ t(
39
- j.Item,
36
+ renderEmpty: _ && d ? () => /* @__PURE__ */ t(B, {}) : void 0,
37
+ children: /* @__PURE__ */ t(V, { title: $, children: /* @__PURE__ */ t(
38
+ D.Item,
40
39
  {
41
40
  label: m,
42
41
  name: n.name,
43
42
  help: n.help,
44
43
  className: n.className,
45
44
  rules: [
46
- ...w,
45
+ ...x,
47
46
  {
48
- required: x,
49
- message: `${m ?? l ?? ""} ${M(
47
+ required: S,
48
+ message: `${m ?? f ?? ""} ${H(
50
49
  "err.validation.required"
51
50
  )}`
52
51
  }
53
52
  ],
54
53
  children: /* @__PURE__ */ t(
55
- q,
54
+ E,
56
55
  {
57
- ref: _,
56
+ ref: N,
58
57
  loading: d,
59
58
  open: o ? !1 : void 0,
60
59
  onChange: !o && n.onChange,
@@ -62,21 +61,21 @@ function Q({
62
61
  showSearch: !L,
63
62
  className: `max-width ${o ? "readOnly" : ""}`,
64
63
  ...n,
65
- tagRender: I,
66
- placeholder: l ?? m,
67
- filterOption: E ?? ((e, r) => {
68
- var c, C, g, S;
64
+ tagRender: k,
65
+ placeholder: f ?? m,
66
+ filterOption: b ?? ((e, r) => {
67
+ var c, g, C, y;
69
68
  try {
70
- const i = (g = (C = (c = r == null ? void 0 : r.children) == null ? void 0 : c.props) == null ? void 0 : C.dangerouslySetInnerHTML) == null ? void 0 : g.__html, $ = e.toLowerCase().split(/\s+/), p = (r == null ? void 0 : r.children) ?? "", y = typeof p == "string" ? p.toLowerCase() : typeof i == "string" ? i.toLowerCase() : "", k = (((S = r == null ? void 0 : r.value) == null ? void 0 : S.toString()) ?? "").toLowerCase(), H = y.replace(/\s/g, "");
71
- return $.every(
72
- (f) => y.indexOf(f) >= 0 || k.indexOf(f) >= 0 || H.indexOf(f) >= 0
69
+ const i = (C = (g = (c = r == null ? void 0 : r.children) == null ? void 0 : c.props) == null ? void 0 : g.dangerouslySetInnerHTML) == null ? void 0 : C.__html, M = e.toLowerCase().split(/\s+/), p = (r == null ? void 0 : r.children) ?? "", w = typeof p == "string" ? p.toLowerCase() : typeof i == "string" ? i.toLowerCase() : "", O = (((y = r == null ? void 0 : r.value) == null ? void 0 : y.toString()) ?? "").toLowerCase(), j = w.replace(/\s/g, "");
70
+ return M.every(
71
+ (l) => w.indexOf(l) >= 0 || O.indexOf(l) >= 0 || j.indexOf(l) >= 0
73
72
  );
74
73
  } catch (i) {
75
74
  return console.log(i), !0;
76
75
  }
77
76
  }),
78
- dropdownRender: T,
79
- children: a === null ? void 0 : a ?? (s && (s == null ? void 0 : s.map(u ?? O)))
77
+ dropdownRender: u,
78
+ children: a === null ? void 0 : a ?? (s && (s == null ? void 0 : s.map(T ?? I)))
80
79
  }
81
80
  )
82
81
  }
@@ -1 +1 @@
1
- "use strict";const p=require("react/jsx-runtime"),u=require("antd"),x=require("../../locale/hooks/translation-constants.cjs.js"),T=require("react-i18next"),q=({onClick:n,clickable:o,colorFunction:s,translation:c,value:e})=>{var r;const t=s==null?void 0:s(e),{t:i}=T.useTranslation(x.TRANSLATION_NAMESPACE),a=u.Tag;return p.jsx(a,{onClick:n,color:t==null?void 0:t.color,icon:t==null?void 0:t.icon,style:{color:t==null?void 0:t.text,cursor:o?"pointer":void 0},children:(r=i(c[e]))==null?void 0:r.toUpperCase()})};module.exports=q;
1
+ "use strict";const x=require("react/jsx-runtime"),d=require("antd"),u=require("../../locale/index.cjs.js"),q=({onClick:n,clickable:o,colorFunction:e,translation:i,value:s})=>{var r;const t=e==null?void 0:e(s),{t:c}=u.useTranslationLib(),p=d.Tag;return x.jsx(p,{onClick:n,color:t==null?void 0:t.color,icon:t==null?void 0:t.icon,style:{color:t==null?void 0:t.text,cursor:o?"pointer":void 0},children:(r=c(i[s]))==null?void 0:r.toUpperCase()})};module.exports=q;
@@ -1,30 +1,29 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import { Tag as f } from "antd";
3
- import { TRANSLATION_NAMESPACE as T } from "../../locale/hooks/translation-constants.es.js";
4
- import { useTranslation as A } from "react-i18next";
5
- const S = ({
3
+ import { useTranslationLib as c } from "../../locale/index.es.js";
4
+ const a = ({
6
5
  onClick: e,
7
- clickable: m,
8
- colorFunction: t,
9
- translation: p,
6
+ clickable: p,
7
+ colorFunction: o,
8
+ translation: m,
10
9
  value: r
11
10
  }) => {
12
11
  var s;
13
- const o = t == null ? void 0 : t(r), { t: n } = A(T);
12
+ const t = o == null ? void 0 : o(r), { t: n } = c();
14
13
  return /* @__PURE__ */ i(
15
14
  f,
16
15
  {
17
16
  onClick: e,
18
- color: o == null ? void 0 : o.color,
19
- icon: o == null ? void 0 : o.icon,
17
+ color: t == null ? void 0 : t.color,
18
+ icon: t == null ? void 0 : t.icon,
20
19
  style: {
21
- color: o == null ? void 0 : o.text,
22
- cursor: m ? "pointer" : void 0
20
+ color: t == null ? void 0 : t.text,
21
+ cursor: p ? "pointer" : void 0
23
22
  },
24
- children: (s = n(p[r])) == null ? void 0 : s.toUpperCase()
23
+ children: (s = n(m[r])) == null ? void 0 : s.toUpperCase()
25
24
  }
26
25
  );
27
26
  };
28
27
  export {
29
- S as default
28
+ a as default
30
29
  };
@@ -1 +1 @@
1
- "use strict";const o=require("react/jsx-runtime"),p=require("antd"),m=require("react"),M=require("react-i18next"),P=require("../../locale/hooks/translation-constants.cjs.js"),S=require("../tooltip/TooltipComponent.cjs.js"),L=require("./TextField.cjs.js"),O=m.forwardRef(function({type:b,required:i,label:e,rules:c=[],placeholder:r,onEnter:x,form:q,nextFocus:T,min:d,moneyField:n,addonAfter:f,minLength:N,defaultValue:j,pattern:l,disabled:I,readOnly:$,onChange:g,value:A,max:E,addonBefore:R,size:C,isInt:u=!1,tooltip:h,...w},B){const{t:a}=M.useTranslation(P.TRANSLATION_NAMESPACE),F=m.useMemo(()=>[...c,{required:i,message:`${e??r??""} ${a("err.validation.required")}`}],[c,e,r,a,i]);return o.jsx(S,{title:h,children:o.jsx(p.Form.Item,{...w,label:e,rules:F,children:o.jsx(p.InputNumber,{ref:B,disabled:I,defaultValue:j,value:A,readOnly:$,addonBefore:R,minLength:N,addonAfter:f,step:u?1:void 0,pattern:u?"d*":l,onChange:g,onPressEnter:t=>L.onEnterInternalTextField(t,T,q,x),className:"max-width",min:d===null?void 0:d??0,max:E,type:n?void 0:"number",size:C,formatter:n?t=>{if(t.includes(".")){const s=`${t}`.split(".");return s[0]=s[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),s.join(".")}else return`${t}`.replace(/\B(?=(\d{3})+(?!\d))/g,",")}:void 0,parser:n?t=>t==null?void 0:t.replace(/\$\s?|(,*)/g,""):void 0,placeholder:r??e})})})});module.exports=O;
1
+ "use strict";const i=require("react/jsx-runtime"),a=require("antd"),m=require("react"),L=require("../../locale/index.cjs.js"),M=require("../tooltip/TooltipComponent.cjs.js"),P=require("./TextField.cjs.js"),k=m.forwardRef(function({type:y,required:o,label:t,rules:c=[],placeholder:r,onEnter:x,form:f,nextFocus:q,min:d,moneyField:n,addonAfter:j,minLength:T,defaultValue:$,pattern:g,disabled:l,readOnly:I,onChange:N,value:R,max:h,addonBefore:w,size:B,isInt:u=!1,tooltip:E,...F},b){const{t:p}=L.useTranslationLib(),C=m.useMemo(()=>[...c,{required:o,message:`${t??r??""} ${p("err.validation.required")}`}],[c,t,r,p,o]);return i.jsx(M,{title:E,children:i.jsx(a.Form.Item,{...F,label:t,rules:C,children:i.jsx(a.InputNumber,{ref:b,disabled:l,defaultValue:$,value:R,readOnly:I,addonBefore:w,minLength:T,addonAfter:j,step:u?1:void 0,pattern:u?"d*":g,onChange:N,onPressEnter:e=>P.onEnterInternalTextField(e,q,f,x),className:"max-width",min:d===null?void 0:d??0,max:h,type:n?void 0:"number",size:B,formatter:n?e=>{if(e.includes(".")){const s=`${e}`.split(".");return s[0]=s[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),s.join(".")}else return`${e}`.replace(/\B(?=(\d{3})+(?!\d))/g,",")}:void 0,parser:n?e=>e==null?void 0:e.replace(/\$\s?|(,*)/g,""):void 0,placeholder:r??t})})})});module.exports=k;
@@ -1,70 +1,69 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
- import { Form as P, InputNumber as R } from "antd";
3
- import { forwardRef as S, useMemo as F } from "react";
4
- import { useTranslation as L } from "react-i18next";
5
- import { TRANSLATION_NAMESPACE as O } from "../../locale/hooks/translation-constants.es.js";
6
- import _ from "../tooltip/TooltipComponent.es.js";
7
- import { onEnterInternalTextField as b } from "./TextField.es.js";
8
- const K = S(
2
+ import { Form as L, InputNumber as M } from "antd";
3
+ import { forwardRef as P, useMemo as R } from "react";
4
+ import { useTranslationLib as k } from "../../locale/index.es.js";
5
+ import q from "../tooltip/TooltipComponent.es.js";
6
+ import { onEnterInternalTextField as v } from "./TextField.es.js";
7
+ const O = P(
9
8
  function({
10
9
  // eslint-disable-next-line no-unused-vars
11
- type: q,
12
- required: m,
10
+ type: z,
11
+ required: s,
13
12
  label: t,
14
- rules: s = [],
13
+ rules: m = [],
15
14
  placeholder: o,
16
15
  onEnter: c,
17
16
  form: a,
18
17
  nextFocus: u,
19
18
  min: p,
20
19
  moneyField: e,
21
- addonAfter: N,
22
- minLength: T,
23
- defaultValue: x,
24
- pattern: $,
25
- disabled: g,
26
- readOnly: l,
27
- onChange: A,
28
- value: E,
29
- max: I,
30
- addonBefore: h,
31
- size: j,
20
+ addonAfter: x,
21
+ minLength: $,
22
+ defaultValue: g,
23
+ pattern: l,
24
+ disabled: T,
25
+ readOnly: I,
26
+ onChange: N,
27
+ value: h,
28
+ max: j,
29
+ addonBefore: w,
30
+ size: B,
32
31
  isInt: d = !1,
33
- tooltip: w,
34
- ...B
32
+ tooltip: E,
33
+ ...b
35
34
  }, C) {
36
- const { t: f } = L(O), M = F(
35
+ const { t: f } = k(), F = R(
37
36
  () => [
38
- ...s,
37
+ ...m,
39
38
  {
40
- required: m,
39
+ required: s,
41
40
  message: `${t ?? o ?? ""} ${f(
42
41
  "err.validation.required"
43
42
  )}`
44
43
  }
45
44
  ],
46
- [s, t, o, f, m]
45
+ [m, t, o, f, s]
47
46
  );
48
- return /* @__PURE__ */ i(_, { title: w, children: /* @__PURE__ */ i(P.Item, { ...B, label: t, rules: M, children: /* @__PURE__ */ i(
49
- R,
47
+ return /* @__PURE__ */ i(q, { title: E, children: /* @__PURE__ */ i(L.Item, { ...b, label: t, rules: F, children: /* @__PURE__ */ i(
48
+ M,
50
49
  {
51
50
  ref: C,
52
- disabled: g,
53
- defaultValue: x,
54
- value: E,
55
- readOnly: l,
56
- addonBefore: h,
57
- minLength: T,
58
- addonAfter: N,
51
+ disabled: T,
52
+ defaultValue: g,
53
+ value: h,
54
+ readOnly: I,
55
+ addonBefore: w,
56
+ minLength: $,
57
+ addonAfter: x,
59
58
  step: d ? 1 : void 0,
60
- pattern: d ? "d*" : $,
61
- onChange: A,
62
- onPressEnter: (r) => b(r, u, a, c),
59
+ pattern: d ? "d*" : l,
60
+ onChange: N,
61
+ onPressEnter: (r) => v(r, u, a, c),
63
62
  className: "max-width",
64
63
  min: p === null ? void 0 : p ?? 0,
65
- max: I,
64
+ max: j,
66
65
  type: e ? void 0 : "number",
67
- size: j,
66
+ size: B,
68
67
  formatter: e ? (r) => {
69
68
  if (r.includes(".")) {
70
69
  const n = `${r}`.split(".");
@@ -79,5 +78,5 @@ const K = S(
79
78
  }
80
79
  );
81
80
  export {
82
- K as default
81
+ O as default
83
82
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),i=require("antd"),x=require("react-i18next"),A=require("../../locale/hooks/translation-constants.cjs.js"),c=(n,e,t,r)=>{var s;e&&t&&(n.preventDefault(),(s=t==null?void 0:t.getFieldInstance(e))==null||s.focus()),r&&r(n)},q=({required:n,label:e,rules:t=[],placeholder:r,onEnter:s,nextFocus:l,className:o,...u})=>{const{t:d}=x.useTranslation(A.TRANSLATION_NAMESPACE),I=i.Form.useFormInstance();return a.jsx(i.Form.Item,{...u,className:o,label:e,rules:[...t,{required:n,message:`${e} ${d("err.validation.required")}`}],children:a.jsx(i.Input.TextArea,{...u,className:o,onPressEnter:T=>c(T,l,I,s),placeholder:r??e})})};exports.default=q;exports.onEnterInternalTextField=c;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),i=require("antd"),T=require("../../locale/index.cjs.js"),d=(n,e,t,r)=>{var s;e&&t&&(n.preventDefault(),(s=t==null?void 0:t.getFieldInstance(e))==null||s.focus()),r&&r(n)},F=({required:n,label:e,rules:t=[],placeholder:r,onEnter:s,nextFocus:l,className:u,...o})=>{const{t:c}=T.useTranslationLib(),x=i.Form.useFormInstance();return a.jsx(i.Form.Item,{...o,className:u,label:e,rules:[...t,{required:n,message:`${e} ${c("err.validation.required")}`}],children:a.jsx(i.Input.TextArea,{...o,className:u,onPressEnter:I=>d(I,l,x,s),placeholder:r??e})})};exports.default=F;exports.onEnterInternalTextField=d;