@kingteza/crud-component 1.6.0 → 1.6.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),m=require("antd"),x=require("react"),M=require("../../locale/index.cjs.js"),P=require("../tooltip/TooltipComponent.cjs.js"),b=require("./TextField.cjs.js"),k=x.forwardRef(function({type:y,required:o,label:t,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:h,max:w,addonBefore:B,size:E,isInt:u=!1,tooltip:F,help:z,...l},C){const{t:p}=M.useTranslationLib(),L=x.useMemo(()=>[...c,{required:o,message:`${t||r||""} ${p("err.validation.required")}`}],[c,t,r,p,o]);return i.jsx(P,{title:F,children:i.jsx(m.Form.Item,{...l,label:t,rules:L,children:i.jsx(m.InputNumber,{ref:C,disabled:I,defaultValue:$,value:h,readOnly:N,addonBefore:B,minLength:T,addonAfter:j,step:u?1:void 0,pattern:u?"d*":g,onChange:R,onPressEnter:e=>b.onEnterInternalTextField(e,q,f,a),className:"max-width",min:d===null?void 0:d??0,max:w,type:n?void 0:"number",size:E,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,10 +1,10 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { Form as
|
|
3
|
-
import { forwardRef as
|
|
2
|
+
import { Form as M, InputNumber as P } from "antd";
|
|
3
|
+
import { forwardRef as R, useMemo as b } from "react";
|
|
4
4
|
import { useTranslationLib as k } from "../../locale/index.es.js";
|
|
5
5
|
import q from "../tooltip/TooltipComponent.es.js";
|
|
6
6
|
import { onEnterInternalTextField as v } from "./TextField.es.js";
|
|
7
|
-
const Q =
|
|
7
|
+
const Q = R(
|
|
8
8
|
function({
|
|
9
9
|
// eslint-disable-next-line no-unused-vars
|
|
10
10
|
type: z,
|
|
@@ -17,54 +17,54 @@ const Q = P(
|
|
|
17
17
|
nextFocus: u,
|
|
18
18
|
min: p,
|
|
19
19
|
moneyField: e,
|
|
20
|
-
addonAfter:
|
|
21
|
-
minLength:
|
|
22
|
-
defaultValue:
|
|
23
|
-
pattern:
|
|
24
|
-
disabled:
|
|
25
|
-
readOnly:
|
|
26
|
-
onChange:
|
|
27
|
-
value:
|
|
28
|
-
max:
|
|
29
|
-
addonBefore:
|
|
30
|
-
size:
|
|
20
|
+
addonAfter: x,
|
|
21
|
+
minLength: $,
|
|
22
|
+
defaultValue: g,
|
|
23
|
+
pattern: T,
|
|
24
|
+
disabled: I,
|
|
25
|
+
readOnly: N,
|
|
26
|
+
onChange: h,
|
|
27
|
+
value: j,
|
|
28
|
+
max: w,
|
|
29
|
+
addonBefore: B,
|
|
30
|
+
size: E,
|
|
31
31
|
isInt: d = !1,
|
|
32
|
-
tooltip:
|
|
32
|
+
tooltip: l,
|
|
33
33
|
help: A,
|
|
34
|
-
...
|
|
35
|
-
},
|
|
36
|
-
const { t: f } = k(),
|
|
34
|
+
...C
|
|
35
|
+
}, F) {
|
|
36
|
+
const { t: f } = k(), L = b(
|
|
37
37
|
() => [
|
|
38
38
|
...m,
|
|
39
39
|
{
|
|
40
40
|
required: s,
|
|
41
|
-
message: `${t
|
|
41
|
+
message: `${t || o || ""} ${f(
|
|
42
42
|
"err.validation.required"
|
|
43
43
|
)}`
|
|
44
44
|
}
|
|
45
45
|
],
|
|
46
46
|
[m, t, o, f, s]
|
|
47
47
|
);
|
|
48
|
-
return /* @__PURE__ */ i(q, { title:
|
|
49
|
-
|
|
48
|
+
return /* @__PURE__ */ i(q, { title: l, children: /* @__PURE__ */ i(M.Item, { ...C, label: t, rules: L, children: /* @__PURE__ */ i(
|
|
49
|
+
P,
|
|
50
50
|
{
|
|
51
|
-
ref:
|
|
52
|
-
disabled:
|
|
53
|
-
defaultValue:
|
|
54
|
-
value:
|
|
55
|
-
readOnly:
|
|
56
|
-
addonBefore:
|
|
57
|
-
minLength:
|
|
58
|
-
addonAfter:
|
|
51
|
+
ref: F,
|
|
52
|
+
disabled: I,
|
|
53
|
+
defaultValue: g,
|
|
54
|
+
value: j,
|
|
55
|
+
readOnly: N,
|
|
56
|
+
addonBefore: B,
|
|
57
|
+
minLength: $,
|
|
58
|
+
addonAfter: x,
|
|
59
59
|
step: d ? 1 : void 0,
|
|
60
|
-
pattern: d ? "d*" :
|
|
61
|
-
onChange:
|
|
60
|
+
pattern: d ? "d*" : T,
|
|
61
|
+
onChange: h,
|
|
62
62
|
onPressEnter: (r) => v(r, u, a, c),
|
|
63
63
|
className: "max-width",
|
|
64
64
|
min: p === null ? void 0 : p ?? 0,
|
|
65
|
-
max:
|
|
65
|
+
max: w,
|
|
66
66
|
type: e ? void 0 : "number",
|
|
67
|
-
size:
|
|
67
|
+
size: E,
|
|
68
68
|
formatter: e ? (r) => {
|
|
69
69
|
if (r.includes(".")) {
|
|
70
70
|
const n = `${r}`.split(".");
|