@kingteza/crud-component 1.6.2 → 1.6.4
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/dist/common/select/SelectComponent.cjs.js +1 -1
- package/dist/common/select/SelectComponent.es.js +23 -23
- package/dist/common/text-field/NumberField.cjs.js +1 -1
- package/dist/common/text-field/NumberField.es.js +30 -30
- package/dist/common/text-field/TextArea.cjs.js +1 -1
- package/dist/common/text-field/TextArea.es.js +17 -17
- package/dist/common/text-field/TextField.cjs.js +1 -1
- package/dist/common/text-field/TextField.es.js +31 -31
- package/dist/crud/CrudComponent.d.ts +21 -1
- package/dist/crud/CrudField.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),x=require("antd"),V=require("react"),B=require("../../locale/index.cjs.js"),D=require("../tooltip/TooltipComponent.cjs.js"),E=require("../../util/ValidationUtil.cjs.js");function P({label:s,rules:S=[],required:f,placeholder:o,notSearch:L,children:m,readOnly:c,items:i,dropdownRender:q,itemBuilder:T,loading:h,showLoadingInEmptyIndicator:_,nameFieldInArray:u="name",innerRef:p,tooltip:N,filterOption:R,tagRender:b,help:k,...r}){const{t:U}=B.useTranslationLib(),F=V.useCallback(e=>{const t=typeof e=="string"||typeof e=="number"?e:e==null?void 0:e.id,d=typeof e=="string"||typeof e=="number"?e:e==null?void 0:e[u];return n.jsx("option",{value:t,children:n.jsx("div",{dangerouslySetInnerHTML:{__html:d}})},t)},[u]),H=s||o||"";return n.jsx(x.ConfigProvider,{renderEmpty:_&&h?()=>n.jsx(x.Spin,{}):void 0,children:n.jsx(D,{title:N,children:n.jsx(x.Form.Item,{label:s,name:r.name,help:k,className:r.className,required:f,rules:[...S,...f?E.required(H):[]],children:n.jsx(x.Select,{ref:p,loading:h,open:c?!1:void 0,onChange:!c&&r.onChange,allowClear:!c&&r.allowClear,showSearch:!L,className:`max-width ${c?"readOnly":""}`,...r,tagRender:b,placeholder:o||s,filterOption:R??((e,t)=>{var d,g,C,j;try{const a=(C=(g=(d=t==null?void 0:t.children)==null?void 0:d.props)==null?void 0:g.dangerouslySetInnerHTML)==null?void 0:C.__html,I=e.toLowerCase().split(/\s+/),y=(t==null?void 0:t.children)??"",w=typeof y=="string"?y.toLowerCase():typeof a=="string"?a.toLowerCase():"",M=(((j=t==null?void 0:t.value)==null?void 0:j.toString())??"").toLowerCase(),O=w.replace(/\s/g,"");return I.every(l=>w.indexOf(l)>=0||M.indexOf(l)>=0||O.indexOf(l)>=0)}catch(a){return console.log(a),!0}}),popupRender:q,children:m===null?void 0:m??(i?i==null?void 0:i.map(T??F):n.jsx(n.Fragment,{}))})})})})}module.exports=P;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r, Fragment as B } from "react/jsx-runtime";
|
|
2
2
|
import { ConfigProvider as D, Form as E, Select as P, Spin as R } from "antd";
|
|
3
3
|
import { useCallback as U } from "react";
|
|
4
4
|
import { useTranslationLib as W } from "../../locale/index.es.js";
|
|
@@ -8,11 +8,11 @@ function Z({
|
|
|
8
8
|
label: o,
|
|
9
9
|
rules: S = [],
|
|
10
10
|
required: d,
|
|
11
|
-
placeholder:
|
|
11
|
+
placeholder: s,
|
|
12
12
|
notSearch: L,
|
|
13
13
|
children: l,
|
|
14
|
-
readOnly:
|
|
15
|
-
items:
|
|
14
|
+
readOnly: c,
|
|
15
|
+
items: i,
|
|
16
16
|
dropdownRender: u,
|
|
17
17
|
itemBuilder: T,
|
|
18
18
|
loading: h,
|
|
@@ -26,17 +26,17 @@ function Z({
|
|
|
26
26
|
...n
|
|
27
27
|
}) {
|
|
28
28
|
const { t: z } = W(), I = U(
|
|
29
|
-
(
|
|
30
|
-
const
|
|
31
|
-
return /* @__PURE__ */
|
|
29
|
+
(t) => {
|
|
30
|
+
const e = typeof t == "string" || typeof t == "number" ? t : t == null ? void 0 : t.id, m = typeof t == "string" || typeof t == "number" ? t : t == null ? void 0 : t[g];
|
|
31
|
+
return /* @__PURE__ */ r("option", { value: e, children: /* @__PURE__ */ r("div", { dangerouslySetInnerHTML: { __html: m } }) }, e);
|
|
32
32
|
},
|
|
33
33
|
[g]
|
|
34
|
-
), M = o ||
|
|
35
|
-
return /* @__PURE__ */
|
|
34
|
+
), M = o || s || "";
|
|
35
|
+
return /* @__PURE__ */ r(
|
|
36
36
|
D,
|
|
37
37
|
{
|
|
38
|
-
renderEmpty: _ && h ? () => /* @__PURE__ */
|
|
39
|
-
children: /* @__PURE__ */
|
|
38
|
+
renderEmpty: _ && h ? () => /* @__PURE__ */ r(R, {}) : void 0,
|
|
39
|
+
children: /* @__PURE__ */ r($, { title: b, children: /* @__PURE__ */ r(
|
|
40
40
|
E.Item,
|
|
41
41
|
{
|
|
42
42
|
label: o,
|
|
@@ -48,32 +48,32 @@ function Z({
|
|
|
48
48
|
...S,
|
|
49
49
|
...d ? q.required(M) : []
|
|
50
50
|
],
|
|
51
|
-
children: /* @__PURE__ */
|
|
51
|
+
children: /* @__PURE__ */ r(
|
|
52
52
|
P,
|
|
53
53
|
{
|
|
54
54
|
ref: N,
|
|
55
55
|
loading: h,
|
|
56
|
-
open:
|
|
57
|
-
onChange: !
|
|
58
|
-
allowClear: !
|
|
56
|
+
open: c ? !1 : void 0,
|
|
57
|
+
onChange: !c && n.onChange,
|
|
58
|
+
allowClear: !c && n.allowClear,
|
|
59
59
|
showSearch: !L,
|
|
60
|
-
className: `max-width ${
|
|
60
|
+
className: `max-width ${c ? "readOnly" : ""}`,
|
|
61
61
|
...n,
|
|
62
62
|
tagRender: F,
|
|
63
|
-
placeholder:
|
|
64
|
-
filterOption: k ?? ((
|
|
65
|
-
var
|
|
63
|
+
placeholder: s || o,
|
|
64
|
+
filterOption: k ?? ((t, e) => {
|
|
65
|
+
var m, C, p, y;
|
|
66
66
|
try {
|
|
67
|
-
const
|
|
67
|
+
const f = (p = (C = (m = e == null ? void 0 : e.children) == null ? void 0 : m.props) == null ? void 0 : C.dangerouslySetInnerHTML) == null ? void 0 : p.__html, O = t.toLowerCase().split(/\s+/), w = (e == null ? void 0 : e.children) ?? "", x = typeof w == "string" ? w.toLowerCase() : typeof f == "string" ? f.toLowerCase() : "", V = (((y = e == null ? void 0 : e.value) == null ? void 0 : y.toString()) ?? "").toLowerCase(), j = x.replace(/\s/g, "");
|
|
68
68
|
return O.every(
|
|
69
69
|
(a) => x.indexOf(a) >= 0 || V.indexOf(a) >= 0 || j.indexOf(a) >= 0
|
|
70
70
|
);
|
|
71
|
-
} catch (
|
|
72
|
-
return console.log(
|
|
71
|
+
} catch (f) {
|
|
72
|
+
return console.log(f), !0;
|
|
73
73
|
}
|
|
74
74
|
}),
|
|
75
75
|
popupRender: u,
|
|
76
|
-
children: l === null ? void 0 : l ?? (
|
|
76
|
+
children: l === null ? void 0 : l ?? (i ? i == null ? void 0 : i.map(T ?? I) : /* @__PURE__ */ r(B, {}))
|
|
77
77
|
}
|
|
78
78
|
)
|
|
79
79
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("react/jsx-runtime"),m=require("antd"),x=require("react"),
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),m=require("antd"),x=require("react"),P=require("../../locale/index.cjs.js"),b=require("../tooltip/TooltipComponent.cjs.js"),k=require("./TextField.cjs.js"),v=x.forwardRef(function({type:z,required:o,label:e,rules:c=[],placeholder:r,onEnter:a,form:f,nextFocus:q,min:d,moneyField:n,addonAfter:j,minLength:T,defaultValue:$,pattern:g,disabled:I,readOnly:N,onChange:R,value:w,max:B,addonBefore:E,size:F,isInt:u=!1,tooltip:h,help:A,...C},L){const{t:p}=P.useTranslationLib(),M=x.useMemo(()=>[...c,{required:o,message:`${e||r||""} ${p("err.validation.required")}`}],[c,e,r,p,o]);return i.jsx(b,{title:h,children:i.jsx(m.Form.Item,{...C,label:e,rules:M,children:i.jsx(m.InputNumber,{ref:L,disabled:I,defaultValue:$,value:w,readOnly:N,addonBefore:E,minLength:T,addonAfter:j,step:u?1:void 0,pattern:u?"d*":g,onChange:R,onPressEnter:t=>k.onEnterInternalTextField(t,q,f,a),className:"max-width",min:d===null?void 0:d??0,max:B,type:n?void 0:"number",size:F,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=v;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { Form as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { useTranslationLib as
|
|
5
|
-
import
|
|
6
|
-
import { onEnterInternalTextField as
|
|
7
|
-
const
|
|
2
|
+
import { Form as P, InputNumber as R } from "antd";
|
|
3
|
+
import { forwardRef as b, useMemo as k } from "react";
|
|
4
|
+
import { useTranslationLib as q } from "../../locale/index.es.js";
|
|
5
|
+
import v from "../tooltip/TooltipComponent.es.js";
|
|
6
|
+
import { onEnterInternalTextField as y } from "./TextField.es.js";
|
|
7
|
+
const S = b(
|
|
8
8
|
function({
|
|
9
9
|
// eslint-disable-next-line no-unused-vars
|
|
10
|
-
type:
|
|
10
|
+
type: A,
|
|
11
11
|
required: s,
|
|
12
12
|
label: t,
|
|
13
13
|
rules: m = [],
|
|
14
14
|
placeholder: o,
|
|
15
15
|
onEnter: c,
|
|
16
|
-
form:
|
|
17
|
-
nextFocus:
|
|
16
|
+
form: u,
|
|
17
|
+
nextFocus: a,
|
|
18
18
|
min: p,
|
|
19
19
|
moneyField: e,
|
|
20
20
|
addonAfter: x,
|
|
@@ -23,17 +23,17 @@ const Q = R(
|
|
|
23
23
|
pattern: T,
|
|
24
24
|
disabled: I,
|
|
25
25
|
readOnly: N,
|
|
26
|
-
onChange:
|
|
27
|
-
value:
|
|
28
|
-
max:
|
|
29
|
-
addonBefore:
|
|
30
|
-
size:
|
|
26
|
+
onChange: j,
|
|
27
|
+
value: w,
|
|
28
|
+
max: B,
|
|
29
|
+
addonBefore: E,
|
|
30
|
+
size: h,
|
|
31
31
|
isInt: d = !1,
|
|
32
|
-
tooltip:
|
|
33
|
-
help:
|
|
34
|
-
...
|
|
35
|
-
},
|
|
36
|
-
const { t: f } =
|
|
32
|
+
tooltip: C,
|
|
33
|
+
help: D,
|
|
34
|
+
...F
|
|
35
|
+
}, L) {
|
|
36
|
+
const { t: f } = q(), M = k(
|
|
37
37
|
() => [
|
|
38
38
|
...m,
|
|
39
39
|
{
|
|
@@ -45,26 +45,26 @@ const Q = R(
|
|
|
45
45
|
],
|
|
46
46
|
[m, t, o, f, s]
|
|
47
47
|
);
|
|
48
|
-
return /* @__PURE__ */ i(
|
|
49
|
-
|
|
48
|
+
return /* @__PURE__ */ i(v, { title: C, children: /* @__PURE__ */ i(P.Item, { ...F, label: t, rules: M, children: /* @__PURE__ */ i(
|
|
49
|
+
R,
|
|
50
50
|
{
|
|
51
|
-
ref:
|
|
51
|
+
ref: L,
|
|
52
52
|
disabled: I,
|
|
53
53
|
defaultValue: g,
|
|
54
|
-
value:
|
|
54
|
+
value: w,
|
|
55
55
|
readOnly: N,
|
|
56
|
-
addonBefore:
|
|
56
|
+
addonBefore: E,
|
|
57
57
|
minLength: $,
|
|
58
58
|
addonAfter: x,
|
|
59
59
|
step: d ? 1 : void 0,
|
|
60
60
|
pattern: d ? "d*" : T,
|
|
61
|
-
onChange:
|
|
62
|
-
onPressEnter: (r) =>
|
|
61
|
+
onChange: j,
|
|
62
|
+
onPressEnter: (r) => y(r, a, u, c),
|
|
63
63
|
className: "max-width",
|
|
64
64
|
min: p === null ? void 0 : p ?? 0,
|
|
65
|
-
max:
|
|
65
|
+
max: B,
|
|
66
66
|
type: e ? void 0 : "number",
|
|
67
|
-
size:
|
|
67
|
+
size: h,
|
|
68
68
|
formatter: e ? (r) => {
|
|
69
69
|
if (r.includes(".")) {
|
|
70
70
|
const n = `${r}`.split(".");
|
|
@@ -73,11 +73,11 @@ const Q = R(
|
|
|
73
73
|
return `${r}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
74
74
|
} : void 0,
|
|
75
75
|
parser: e ? (r) => r == null ? void 0 : r.replace(/\$\s?|(,*)/g, "") : void 0,
|
|
76
|
-
placeholder: o
|
|
76
|
+
placeholder: o || t
|
|
77
77
|
}
|
|
78
78
|
) }) });
|
|
79
79
|
}
|
|
80
80
|
);
|
|
81
81
|
export {
|
|
82
|
-
|
|
82
|
+
S as default
|
|
83
83
|
};
|
|
@@ -1 +1 @@
|
|
|
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=(
|
|
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=(r,e,t,n)=>{var s;e&&t&&(r.preventDefault(),(s=t==null?void 0:t.getFieldInstance(e))==null||s.focus()),n&&n(r)},F=({required:r,label:e,rules:t=[],placeholder:n,onEnter:s,nextFocus:c,className:u,...o})=>{const{t:l}=T.useTranslationLib(),x=i.Form.useFormInstance();return a.jsx(i.Form.Item,{...o,className:u,label:e,rules:[...t,{required:r,message:`${e} ${l("err.validation.required")}`}],children:a.jsx(i.Input.TextArea,{...o,className:u,onPressEnter:I=>d(I,c,x,s),placeholder:n||e})})};exports.default=F;exports.onEnterInternalTextField=d;
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { Form as u, Input as
|
|
3
|
-
import { useTranslationLib as
|
|
4
|
-
const
|
|
5
|
-
var
|
|
6
|
-
e && t && (
|
|
2
|
+
import { Form as u, Input as I } from "antd";
|
|
3
|
+
import { useTranslationLib as f } from "../../locale/index.es.js";
|
|
4
|
+
const l = (r, e, t, n) => {
|
|
5
|
+
var i;
|
|
6
|
+
e && t && (r.preventDefault(), (i = t == null ? void 0 : t.getFieldInstance(e)) == null || i.focus()), n && n(r);
|
|
7
7
|
}, g = ({
|
|
8
|
-
required:
|
|
8
|
+
required: r,
|
|
9
9
|
label: e,
|
|
10
10
|
rules: t = [],
|
|
11
|
-
placeholder:
|
|
12
|
-
onEnter:
|
|
11
|
+
placeholder: n,
|
|
12
|
+
onEnter: i,
|
|
13
13
|
nextFocus: c,
|
|
14
|
-
className:
|
|
14
|
+
className: o,
|
|
15
15
|
...s
|
|
16
16
|
}) => {
|
|
17
|
-
const { t: d } =
|
|
17
|
+
const { t: d } = f(), m = u.useFormInstance();
|
|
18
18
|
return /* @__PURE__ */ a(
|
|
19
19
|
u.Item,
|
|
20
20
|
{
|
|
21
21
|
...s,
|
|
22
|
-
className:
|
|
22
|
+
className: o,
|
|
23
23
|
label: e,
|
|
24
24
|
rules: [
|
|
25
25
|
...t,
|
|
26
26
|
{
|
|
27
|
-
required:
|
|
27
|
+
required: r,
|
|
28
28
|
message: `${e} ${d("err.validation.required")}`
|
|
29
29
|
}
|
|
30
30
|
],
|
|
31
31
|
children: /* @__PURE__ */ a(
|
|
32
|
-
|
|
32
|
+
I.TextArea,
|
|
33
33
|
{
|
|
34
34
|
...s,
|
|
35
|
-
className:
|
|
36
|
-
onPressEnter: (
|
|
37
|
-
placeholder:
|
|
35
|
+
className: o,
|
|
36
|
+
onPressEnter: (p) => l(p, c, m, i),
|
|
37
|
+
placeholder: n || e
|
|
38
38
|
}
|
|
39
39
|
)
|
|
40
40
|
}
|
|
@@ -42,5 +42,5 @@ const f = (n, e, t, r) => {
|
|
|
42
42
|
};
|
|
43
43
|
export {
|
|
44
44
|
g as default,
|
|
45
|
-
|
|
45
|
+
l as onEnterInternalTextField
|
|
46
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("react/jsx-runtime"),S=require("@ant-design/icons"),d=require("antd"),_=require("react"),$=require("../../locale/index.cjs.js"),h=require("../tooltip/TooltipComponent.cjs.js"),c=(n,t,e,r)=>{var s;t&&e&&(n.preventDefault(),(s=e==null?void 0:e.getFieldInstance(t))==null||s.focus()),r&&r(n)},A=({type:n,required:t,label:e,disabled:r,rules:s=[],placeholder:i,onEnter:l,size:x,form:g,addonAfter:m,addonBefore:I,nextFocus:f,autoComplete:j="off",defaultValue:p,readOnly:q,value:v,loading:T,onBlur:F,inputRef:P,status:C,autoFocus:E,onChange:D,tooltip:M,...w})=>{const{t:a}=$.useTranslationLib(),L=_.useMemo(()=>{const o=[...s,{required:t,message:`${e||i||""} ${a("err.validation.required")}`}];return n==="email"&&o.push({type:"email",message:a("err.validation.invalidEmail")}),o},[s,t,e,i,a,n]),O={disabled:r,value:v,readOnly:q,defaultValue:p,autoFocus:E,addonBefore:I,ref:P,onBlur:F,addonAfter:T?u.jsx(S.LoadingOutlined,{}):m,status:C,size:x,autoComplete:j,onPressEnter:o=>c(o,f,g,l),type:n,placeholder:i||e},R=n=="password"?d.Input.Password:d.Input;return u.jsx(h,{title:M,children:u.jsx(d.Form.Item,{...w,label:e,rules:L,children:u.jsx(R,{...O})})})};exports.default=A;exports.onEnterInternalTextField=c;
|
|
@@ -4,22 +4,22 @@ import { Input as d, Form as M } from "antd";
|
|
|
4
4
|
import { useMemo as O } from "react";
|
|
5
5
|
import { useTranslationLib as k } from "../../locale/index.es.js";
|
|
6
6
|
import q from "../tooltip/TooltipComponent.es.js";
|
|
7
|
-
const z = (n,
|
|
8
|
-
var
|
|
9
|
-
|
|
7
|
+
const z = (n, i, t, s) => {
|
|
8
|
+
var o;
|
|
9
|
+
i && t && (n.preventDefault(), (o = t == null ? void 0 : t.getFieldInstance(i)) == null || o.focus()), s && s(n);
|
|
10
10
|
}, R = ({
|
|
11
11
|
type: n,
|
|
12
|
-
required:
|
|
12
|
+
required: i,
|
|
13
13
|
label: t,
|
|
14
|
-
disabled:
|
|
15
|
-
rules:
|
|
16
|
-
placeholder:
|
|
17
|
-
onEnter:
|
|
18
|
-
size:
|
|
14
|
+
disabled: s,
|
|
15
|
+
rules: o = [],
|
|
16
|
+
placeholder: r,
|
|
17
|
+
onEnter: f,
|
|
18
|
+
size: p,
|
|
19
19
|
form: u,
|
|
20
20
|
addonAfter: c,
|
|
21
|
-
addonBefore:
|
|
22
|
-
nextFocus:
|
|
21
|
+
addonBefore: g,
|
|
22
|
+
nextFocus: l,
|
|
23
23
|
autoComplete: v = "off",
|
|
24
24
|
defaultValue: I,
|
|
25
25
|
readOnly: T,
|
|
@@ -27,44 +27,44 @@ const z = (n, o, t, r) => {
|
|
|
27
27
|
loading: C,
|
|
28
28
|
onBlur: F,
|
|
29
29
|
inputRef: P,
|
|
30
|
-
status:
|
|
31
|
-
autoFocus:
|
|
30
|
+
status: w,
|
|
31
|
+
autoFocus: E,
|
|
32
32
|
onChange: B,
|
|
33
|
-
tooltip:
|
|
34
|
-
|
|
33
|
+
tooltip: L,
|
|
34
|
+
...$
|
|
35
35
|
}) => {
|
|
36
|
-
const { t: a } = k(),
|
|
37
|
-
const
|
|
38
|
-
...
|
|
36
|
+
const { t: a } = k(), h = O(() => {
|
|
37
|
+
const e = [
|
|
38
|
+
...o,
|
|
39
39
|
{
|
|
40
|
-
required:
|
|
41
|
-
message: `${t ||
|
|
40
|
+
required: i,
|
|
41
|
+
message: `${t || r || ""} ${a(
|
|
42
42
|
"err.validation.required"
|
|
43
43
|
)}`
|
|
44
44
|
}
|
|
45
45
|
];
|
|
46
|
-
return n === "email" &&
|
|
46
|
+
return n === "email" && e.push({
|
|
47
47
|
type: "email",
|
|
48
48
|
message: a("err.validation.invalidEmail")
|
|
49
|
-
}),
|
|
50
|
-
}, [
|
|
51
|
-
disabled:
|
|
49
|
+
}), e;
|
|
50
|
+
}, [o, i, t, r, a, n]), j = {
|
|
51
|
+
disabled: s,
|
|
52
52
|
value: x,
|
|
53
53
|
readOnly: T,
|
|
54
54
|
defaultValue: I,
|
|
55
|
-
autoFocus:
|
|
56
|
-
addonBefore:
|
|
55
|
+
autoFocus: E,
|
|
56
|
+
addonBefore: g,
|
|
57
57
|
ref: P,
|
|
58
58
|
onBlur: F,
|
|
59
59
|
addonAfter: C ? /* @__PURE__ */ m(D, {}) : c,
|
|
60
|
-
status:
|
|
61
|
-
size:
|
|
60
|
+
status: w,
|
|
61
|
+
size: p,
|
|
62
62
|
autoComplete: v,
|
|
63
|
-
onPressEnter: (
|
|
63
|
+
onPressEnter: (e) => z(e, l, u, f),
|
|
64
64
|
type: n,
|
|
65
|
-
placeholder:
|
|
65
|
+
placeholder: r || t
|
|
66
66
|
}, A = n == "password" ? d.Password : d;
|
|
67
|
-
return /* @__PURE__ */ m(q, { title:
|
|
67
|
+
return /* @__PURE__ */ m(q, { title: L, children: /* @__PURE__ */ m(M.Item, { ...$, label: t, rules: h, children: /* @__PURE__ */ m(A, { ...j }) }) });
|
|
68
68
|
};
|
|
69
69
|
export {
|
|
70
70
|
R as default,
|
|
@@ -199,7 +199,27 @@ export type FormBuilderFunc<T> = (i: FormBuilderFunc0<T>, otherUtils: {
|
|
|
199
199
|
isAllFieldsHidden: (...name: Array<keyof T>) => boolean;
|
|
200
200
|
purpose?: CrudPurpose;
|
|
201
201
|
}) => ReactElement;
|
|
202
|
-
|
|
202
|
+
type CrudFieldTypeMap<T> = {
|
|
203
|
+
select: SelectCrudField<T>;
|
|
204
|
+
text: TextBasedFieldProps<T>;
|
|
205
|
+
email: TextBasedFieldProps<T>;
|
|
206
|
+
password: TextBasedFieldProps<T>;
|
|
207
|
+
time: TextBasedFieldProps<T>;
|
|
208
|
+
textarea: TextAreaBasedFieldProps<T>;
|
|
209
|
+
enum: EnumCrudField<T>;
|
|
210
|
+
date: DateBasedFieldProps<T>;
|
|
211
|
+
number: NumberBasedFieldProps<T>;
|
|
212
|
+
checkbox: CheckboxBasedFieldProps<T>;
|
|
213
|
+
color: ColorPickerFieldProps<T>;
|
|
214
|
+
object: ObjectCrudField<T>;
|
|
215
|
+
file: FileCrudField<T>;
|
|
216
|
+
image: ImageCrudField<T>;
|
|
217
|
+
};
|
|
218
|
+
export type CrudFieldProps<T> = {
|
|
219
|
+
[K in keyof CrudFieldTypeMap<T>]: CrudFieldTypeMap<T>[K] & {
|
|
220
|
+
readonly type: K;
|
|
221
|
+
};
|
|
222
|
+
}[keyof CrudFieldTypeMap<T>];
|
|
203
223
|
export type CrudPaginateProps = false | {
|
|
204
224
|
page?: number;
|
|
205
225
|
setPage?: (page: number, pageSize?: number) => void;
|
package/dist/crud/CrudField.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ColorPickerFieldProps, CrudFieldProps, SelectCrudField } from './CrudComponent';
|
|
2
|
-
export default function CrudField<T>(props0: Readonly<CrudFieldProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function CrudField<T = any>(props0: Readonly<CrudFieldProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare function SelectCrudFieldComponent<T>(props: Readonly<SelectCrudField<T>>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare function ColorCrudFieldComponent<T>(props: ColorPickerFieldProps<T>): import("react/jsx-runtime").JSX.Element;
|