@kingteza/crud-component 1.0.39 → 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.
- package/common/button/Button.cjs.js +1 -1
- package/common/button/Button.es.js +19 -20
- package/common/button/CloneButtonTable.cjs.js +1 -1
- package/common/button/CloneButtonTable.es.js +9 -10
- package/common/button/DeleteButtonTable.cjs.js +1 -1
- package/common/button/DeleteButtonTable.es.js +29 -33
- package/common/button/ExportButton.cjs.js +1 -1
- package/common/button/ExportButton.es.js +10 -11
- package/common/button/HideButtonTable.cjs.js +1 -1
- package/common/button/HideButtonTable.es.js +22 -23
- package/common/button/ImportButton.cjs.js +1 -1
- package/common/button/ImportButton.es.js +19 -20
- package/common/button/NewButton.cjs.js +1 -1
- package/common/button/NewButton.es.js +13 -14
- package/common/button/PrintButton.cjs.js +1 -1
- package/common/button/PrintButton.es.js +11 -12
- package/common/button/RefreshButton.cjs.js +1 -1
- package/common/button/RefreshButton.es.js +10 -11
- package/common/button/UnHideButton.cjs.js +1 -1
- package/common/button/UnHideButton.es.js +37 -38
- package/common/button/UpdateButtonTable.cjs.js +1 -1
- package/common/button/UpdateButtonTable.es.js +8 -9
- package/common/button/ViewButtonTable.cjs.js +1 -1
- package/common/button/ViewButtonTable.es.js +10 -11
- package/common/date-picker/DatePicker.cjs.js +1 -1
- package/common/date-picker/DatePicker.es.js +40 -41
- package/common/date-picker/TimePicker.cjs.js +1 -1
- package/common/date-picker/TimePicker.es.js +47 -48
- package/common/loading/LoadingIndicator.cjs.js +1 -1
- package/common/loading/LoadingIndicator.es.js +6 -7
- package/common/picker/ImagePicker.cjs.js +1 -1
- package/common/picker/ImagePicker.es.js +80 -81
- package/common/select/SelectComponent.cjs.js +1 -1
- package/common/select/SelectComponent.es.js +33 -34
- package/common/tag/StatusTag.cjs.js +1 -1
- package/common/tag/StatusTag.es.js +12 -13
- package/common/text-field/NumberField.cjs.js +1 -1
- package/common/text-field/NumberField.es.js +41 -42
- package/common/text-field/TextArea.cjs.js +1 -1
- package/common/text-field/TextArea.es.js +15 -16
- package/common/text-field/TextField.cjs.js +1 -1
- package/common/text-field/TextField.es.js +50 -51
- package/common/wizard/WizardResult.cjs.js +1 -1
- package/common/wizard/WizardResult.es.js +36 -38
- package/crud/CrudComponent.cjs.js +1 -1
- package/crud/CrudComponent.es.js +77 -78
- package/crud/CrudField.cjs.js +1 -1
- package/crud/CrudField.es.js +126 -127
- package/crud/CrudFormWizard.cjs.js +1 -1
- package/crud/CrudFormWizard.es.js +47 -48
- package/crud/FileCrudField.cjs.js +1 -1
- package/crud/FileCrudField.es.js +72 -73
- package/crud/import/CrudImportButton.cjs.js +1 -1
- package/crud/import/CrudImportButton.es.js +10 -11
- package/crud/import/CrudImportComponent.cjs.js +2 -2
- package/crud/import/CrudImportComponent.es.js +56 -57
- package/crud/view/CrudDecListView.cjs.js +1 -1
- package/crud/view/CrudDecListView.es.js +11 -12
- package/crud/view/CrudViewer.cjs.js +1 -1
- package/crud/view/CrudViewer.es.js +120 -121
- package/crud/view/CrudViewerUtil.cjs.js +1 -1
- package/crud/view/CrudViewerUtil.es.js +15 -17
- package/locale/index.cjs.js +1 -1
- package/locale/index.d.ts +8 -4
- package/locale/index.es.js +36 -24
- package/package.json +1 -1
- package/util/ValidationUtil.cjs.js +1 -1
- package/util/ValidationUtil.es.js +26 -23
|
@@ -1,59 +1,58 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
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
|
|
5
|
-
import { Form as
|
|
6
|
-
import
|
|
7
|
-
import { Cropper as
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
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
|
|
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:
|
|
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:
|
|
33
|
-
loading:
|
|
31
|
+
icon: U = /* @__PURE__ */ t(ne, {}),
|
|
32
|
+
loading: I,
|
|
34
33
|
maxCount: b = 1,
|
|
35
34
|
onAdd: c,
|
|
36
|
-
onRemove:
|
|
37
|
-
listType:
|
|
38
|
-
...
|
|
35
|
+
onRemove: O,
|
|
36
|
+
listType: F,
|
|
37
|
+
...E
|
|
39
38
|
}) => {
|
|
40
|
-
const [ie, ae] =
|
|
41
|
-
!e.url && !e.preview && (e.preview = await re(e.originFileObj)), ce(e.url || e.preview),
|
|
42
|
-
}, [
|
|
43
|
-
},
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
66
|
+
R(!0), await c(Z);
|
|
68
67
|
} finally {
|
|
69
|
-
|
|
68
|
+
R(!1);
|
|
70
69
|
}
|
|
71
|
-
|
|
70
|
+
D([Z, ...a]), R(!1);
|
|
72
71
|
}), P(void 0);
|
|
73
72
|
}, ge = () => {
|
|
74
73
|
P(void 0), k.current = void 0;
|
|
75
|
-
},
|
|
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
|
-
|
|
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
|
-
|
|
94
|
+
D(e);
|
|
96
95
|
}
|
|
97
96
|
}, [r]);
|
|
98
|
-
const { t:
|
|
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 ?? ""} ${
|
|
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,
|
|
106
|
-
),
|
|
104
|
+
[l, h, a == null ? void 0 : a.length, o, z]
|
|
105
|
+
), H = C ?? z("message.fileUploadMessage2"), T = te(
|
|
107
106
|
() => /* @__PURE__ */ t(
|
|
108
|
-
|
|
107
|
+
ke,
|
|
109
108
|
{
|
|
110
|
-
showLoadingIndicator:
|
|
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:
|
|
117
|
-
loading:
|
|
118
|
-
listType:
|
|
115
|
+
icon: U,
|
|
116
|
+
loading: I,
|
|
117
|
+
listType: F,
|
|
119
118
|
maxCount: b,
|
|
120
|
-
onChangeFile:
|
|
121
|
-
onRemove:
|
|
119
|
+
onChangeFile: $,
|
|
120
|
+
onRemove: O,
|
|
122
121
|
showButtonText: g,
|
|
123
122
|
handlePreview: me,
|
|
124
|
-
setFileList:
|
|
123
|
+
setFileList: D
|
|
125
124
|
}
|
|
126
125
|
),
|
|
127
126
|
[
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
V,
|
|
128
|
+
H,
|
|
130
129
|
u,
|
|
131
130
|
p,
|
|
132
131
|
a,
|
|
133
132
|
v,
|
|
133
|
+
U,
|
|
134
134
|
I,
|
|
135
|
-
|
|
136
|
-
N,
|
|
135
|
+
F,
|
|
137
136
|
b,
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
$,
|
|
138
|
+
O,
|
|
140
139
|
g
|
|
141
140
|
]
|
|
142
141
|
);
|
|
143
|
-
de.current =
|
|
144
|
-
const [we, G] = w(0), [Ce, K] = w(0), [
|
|
145
|
-
|
|
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
|
-
|
|
146
|
+
B && localStorage.setItem("cropper.box", JSON.stringify(B));
|
|
148
147
|
}, 400);
|
|
149
148
|
return () => clearTimeout(e);
|
|
150
|
-
}, [
|
|
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__ */
|
|
160
|
+
return /* @__PURE__ */ N(oe, { children: [
|
|
162
161
|
/* @__PURE__ */ t(
|
|
163
|
-
|
|
162
|
+
Se,
|
|
164
163
|
{
|
|
165
164
|
label: o,
|
|
166
|
-
...
|
|
165
|
+
...E,
|
|
167
166
|
name: m,
|
|
168
167
|
className: "mb-0",
|
|
169
|
-
rules: [he, ...
|
|
170
|
-
children:
|
|
168
|
+
rules: [he, ...E.rules ?? []],
|
|
169
|
+
children: T
|
|
171
170
|
}
|
|
172
171
|
),
|
|
173
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
182
|
+
Re,
|
|
184
183
|
{
|
|
185
184
|
ref: i,
|
|
186
185
|
src: h,
|
|
187
186
|
cropmove: Q,
|
|
188
187
|
viewMode: 1,
|
|
189
|
-
aspectRatio:
|
|
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__ */
|
|
193
|
+
/* @__PURE__ */ N("div", { className: "mt-2 d-flex justify-content-center", children: [
|
|
195
194
|
/* @__PURE__ */ t(
|
|
196
|
-
|
|
195
|
+
L,
|
|
197
196
|
{
|
|
198
197
|
size: "large",
|
|
199
198
|
icon: /* @__PURE__ */ t(ye, {}),
|
|
200
|
-
onClick: () =>
|
|
199
|
+
onClick: () => W(!0)
|
|
201
200
|
}
|
|
202
201
|
),
|
|
203
202
|
/* @__PURE__ */ t(
|
|
204
|
-
|
|
203
|
+
L,
|
|
205
204
|
{
|
|
206
205
|
size: "large",
|
|
207
|
-
icon: /* @__PURE__ */ t(
|
|
208
|
-
onClick: () =>
|
|
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
|
-
},
|
|
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:
|
|
232
|
+
loading: S,
|
|
234
233
|
maxCount: C,
|
|
235
234
|
onChangeFile: v,
|
|
236
235
|
onRemove: u,
|
|
237
236
|
showButtonText: g,
|
|
238
237
|
handlePreview: _,
|
|
239
|
-
setFileList:
|
|
240
|
-
showLoadingIndicator:
|
|
238
|
+
setFileList: U,
|
|
239
|
+
showLoadingIndicator: I,
|
|
241
240
|
listType: b = "picture"
|
|
242
|
-
}) => /* @__PURE__ */ t(oe, { children: /* @__PURE__ */
|
|
243
|
-
|
|
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
|
|
258
|
-
u == null || u(c),
|
|
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
|
-
|
|
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
|
-
|
|
264
|
+
L,
|
|
266
265
|
{
|
|
267
|
-
loading:
|
|
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
|
-
|
|
281
|
-
|
|
279
|
+
ke as UploadComponent,
|
|
280
|
+
Ve as default
|
|
282
281
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
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
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
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:
|
|
10
|
-
required:
|
|
11
|
-
placeholder:
|
|
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:
|
|
17
|
-
itemBuilder:
|
|
15
|
+
dropdownRender: u,
|
|
16
|
+
itemBuilder: T,
|
|
18
17
|
loading: d,
|
|
19
|
-
showLoadingInEmptyIndicator:
|
|
18
|
+
showLoadingInEmptyIndicator: _,
|
|
20
19
|
nameFieldInArray: h = "name",
|
|
21
|
-
innerRef:
|
|
22
|
-
tooltip:
|
|
23
|
-
filterOption:
|
|
24
|
-
tagRender:
|
|
20
|
+
innerRef: N,
|
|
21
|
+
tooltip: $,
|
|
22
|
+
filterOption: b,
|
|
23
|
+
tagRender: k,
|
|
25
24
|
...n
|
|
26
25
|
}) {
|
|
27
|
-
const { t:
|
|
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
|
-
|
|
34
|
+
q,
|
|
36
35
|
{
|
|
37
|
-
renderEmpty:
|
|
38
|
-
children: /* @__PURE__ */ t(
|
|
39
|
-
|
|
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
|
-
...
|
|
45
|
+
...x,
|
|
47
46
|
{
|
|
48
|
-
required:
|
|
49
|
-
message: `${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
|
-
|
|
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:
|
|
66
|
-
placeholder:
|
|
67
|
-
filterOption:
|
|
68
|
-
var c,
|
|
64
|
+
tagRender: k,
|
|
65
|
+
placeholder: f ?? m,
|
|
66
|
+
filterOption: b ?? ((e, r) => {
|
|
67
|
+
var c, g, C, y;
|
|
69
68
|
try {
|
|
70
|
-
const i = (
|
|
71
|
-
return
|
|
72
|
-
(
|
|
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:
|
|
79
|
-
children: a === null ? void 0 : a ?? (s && (s == null ? void 0 : s.map(
|
|
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
|
|
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 {
|
|
4
|
-
|
|
5
|
-
const S = ({
|
|
3
|
+
import { useTranslationLib as c } from "../../locale/index.es.js";
|
|
4
|
+
const a = ({
|
|
6
5
|
onClick: e,
|
|
7
|
-
clickable:
|
|
8
|
-
colorFunction:
|
|
9
|
-
translation:
|
|
6
|
+
clickable: p,
|
|
7
|
+
colorFunction: o,
|
|
8
|
+
translation: m,
|
|
10
9
|
value: r
|
|
11
10
|
}) => {
|
|
12
11
|
var s;
|
|
13
|
-
const
|
|
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:
|
|
19
|
-
icon:
|
|
17
|
+
color: t == null ? void 0 : t.color,
|
|
18
|
+
icon: t == null ? void 0 : t.icon,
|
|
20
19
|
style: {
|
|
21
|
-
color:
|
|
22
|
-
cursor:
|
|
20
|
+
color: t == null ? void 0 : t.text,
|
|
21
|
+
cursor: p ? "pointer" : void 0
|
|
23
22
|
},
|
|
24
|
-
children: (s = n(
|
|
23
|
+
children: (s = n(m[r])) == null ? void 0 : s.toUpperCase()
|
|
25
24
|
}
|
|
26
25
|
);
|
|
27
26
|
};
|
|
28
27
|
export {
|
|
29
|
-
|
|
28
|
+
a as default
|
|
30
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
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
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
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:
|
|
12
|
-
required:
|
|
10
|
+
type: z,
|
|
11
|
+
required: s,
|
|
13
12
|
label: t,
|
|
14
|
-
rules:
|
|
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:
|
|
22
|
-
minLength:
|
|
23
|
-
defaultValue:
|
|
24
|
-
pattern:
|
|
25
|
-
disabled:
|
|
26
|
-
readOnly:
|
|
27
|
-
onChange:
|
|
28
|
-
value:
|
|
29
|
-
max:
|
|
30
|
-
addonBefore:
|
|
31
|
-
size:
|
|
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:
|
|
34
|
-
...
|
|
32
|
+
tooltip: E,
|
|
33
|
+
...b
|
|
35
34
|
}, C) {
|
|
36
|
-
const { t: f } =
|
|
35
|
+
const { t: f } = k(), F = R(
|
|
37
36
|
() => [
|
|
38
|
-
...
|
|
37
|
+
...m,
|
|
39
38
|
{
|
|
40
|
-
required:
|
|
39
|
+
required: s,
|
|
41
40
|
message: `${t ?? o ?? ""} ${f(
|
|
42
41
|
"err.validation.required"
|
|
43
42
|
)}`
|
|
44
43
|
}
|
|
45
44
|
],
|
|
46
|
-
[
|
|
45
|
+
[m, t, o, f, s]
|
|
47
46
|
);
|
|
48
|
-
return /* @__PURE__ */ i(
|
|
49
|
-
|
|
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:
|
|
53
|
-
defaultValue:
|
|
54
|
-
value:
|
|
55
|
-
readOnly:
|
|
56
|
-
addonBefore:
|
|
57
|
-
minLength:
|
|
58
|
-
addonAfter:
|
|
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:
|
|
62
|
-
onPressEnter: (r) =>
|
|
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:
|
|
64
|
+
max: j,
|
|
66
65
|
type: e ? void 0 : "number",
|
|
67
|
-
size:
|
|
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
|
-
|
|
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"),
|
|
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;
|