@kingteza/crud-component 1.38.0 → 1.40.0
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/text-field/NumberField.cjs.js +1 -1
- package/dist/common/text-field/NumberField.d.ts +2 -0
- package/dist/common/text-field/NumberField.es.js +94 -91
- package/dist/crud/CrudComponent.d.ts +2 -0
- package/dist/crud/CrudField.cjs.js +1 -1
- package/dist/crud/CrudField.es.js +112 -108
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const p=require("react/jsx-runtime"),R=require("antd"),o=require("react"),H=require("../../locale/index.cjs.js"),U=require("../tooltip/TooltipComponent.cjs.js"),V=require("./TextField.cjs.js"),_=/\D/g,b=/\B(?=(\d{3})+(?!\d))/g,z=/\$\s?|(,*)/g,J=new Set(["e","E","."]);function Q(e,t,c){return`${e??t??""} ${c}`.trim()}function W(e){if(e==null)return"";const t=String(e);if(!t.includes("."))return t.replace(b,",");const[c,...s]=t.split(".");return[c.replace(b,","),...s].join(".")}function X(e){return(e==null?void 0:e.replace(z,""))??""}function Z(e,t){return e==null?"":String(e).replace(t,"")}function ee(e,t){return e==null?"":e.replace(t,"")}const re=o.forwardRef(function({changeOnWheel:t,type:c,required:s,label:a,rules:m=[],placeholder:f,onEnter:g,form:E,nextFocus:T,min:x,moneyField:i,addonAfter:h,minLength:v,defaultValue:w,pattern:M,disabled:P,readOnly:S,onChange:q,value:y,max:D,addonBefore:L,size:C,isInt:n=!1,tooltip:I,help:O,step:j,...A},k){const{t:d}=H.useTranslationLib(),u=x===null,l=n&&!u,K=f??a,$=o.useMemo(()=>{const r=[...m,{required:s,message:Q(a,f,d("err.validation.required"))}];return n&&r.push({type:"number",validator:async(te,N)=>{if(!(N==null||Number.isInteger(N)))throw new Error(d("err.validation.integer"))}}),r},[m,a,f,d,s,n]),B=o.useMemo(()=>{if(i)return W;if(l)return r=>Z(r,_)},[i,l]),Y=o.useMemo(()=>{if(i)return X;if(l)return r=>ee(r,_)},[i,l]),F=o.useCallback(r=>V.onEnterInternalTextField(r,T,E,g),[T,E,g]),G=o.useCallback(r=>{if(!u&&r.key==="-"){r.preventDefault();return}J.has(r.key)&&r.preventDefault()},[u]);return p.jsx(U,{title:I,children:p.jsx(R.Form.Item,{...A,label:a,rules:$,help:O,children:p.jsx(R.InputNumber,{ref:k,changeOnWheel:t,disabled:P,defaultValue:w,value:y,readOnly:S,addonBefore:L,minLength:v,addonAfter:h,step:n?1:j,inputMode:n?"numeric":void 0,pattern:n?u?"-?[0-9]*":"[0-9]*":M,precision:n?0:void 0,onChange:q,onPressEnter:F,className:"max-width",min:u?void 0:x??0,max:D,type:i?void 0:"number",size:C,formatter:B,parser:Y,onKeyDown:n?G:void 0,placeholder:K})})})});module.exports=re;
|
|
@@ -2,9 +2,11 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { TextFieldProps } from './TextField';
|
|
3
3
|
export interface NumberTextFieldProps extends TextFieldProps {
|
|
4
4
|
moneyField?: boolean;
|
|
5
|
+
changeOnWheel?: boolean;
|
|
5
6
|
addonAfter?: ReactNode;
|
|
6
7
|
minLength?: number;
|
|
7
8
|
isInt?: boolean;
|
|
9
|
+
step?: number;
|
|
8
10
|
max?: number;
|
|
9
11
|
pattern?: string;
|
|
10
12
|
min?: number | null;
|
|
@@ -1,128 +1,131 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Form as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { useTranslationLib as
|
|
5
|
-
import
|
|
6
|
-
import { onEnterInternalTextField as
|
|
7
|
-
const
|
|
8
|
-
function
|
|
9
|
-
return `${r ?? e ?? ""} ${
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { Form as U, InputNumber as V } from "antd";
|
|
3
|
+
import { forwardRef as z, useMemo as m, useCallback as h } from "react";
|
|
4
|
+
import { useTranslationLib as F } from "../../locale/index.es.js";
|
|
5
|
+
import J from "../tooltip/TooltipComponent.es.js";
|
|
6
|
+
import { onEnterInternalTextField as Q } from "./TextField.es.js";
|
|
7
|
+
const v = /\D/g, w = /\B(?=(\d{3})+(?!\d))/g, W = /\$\s?|(,*)/g, X = /* @__PURE__ */ new Set(["e", "E", "."]);
|
|
8
|
+
function Z(r, e, u) {
|
|
9
|
+
return `${r ?? e ?? ""} ${u}`.trim();
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function rr(r) {
|
|
12
12
|
if (r == null) return "";
|
|
13
13
|
const e = String(r);
|
|
14
14
|
if (!e.includes("."))
|
|
15
|
-
return e.replace(
|
|
16
|
-
const [
|
|
17
|
-
return [
|
|
15
|
+
return e.replace(w, ",");
|
|
16
|
+
const [u, ...o] = e.split(".");
|
|
17
|
+
return [u.replace(w, ","), ...o].join(".");
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
return (r == null ? void 0 : r.replace(
|
|
19
|
+
function tr(r) {
|
|
20
|
+
return (r == null ? void 0 : r.replace(W, "")) ?? "";
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function er(r, e) {
|
|
23
23
|
return r == null ? "" : String(r).replace(e, "");
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function nr(r, e) {
|
|
26
26
|
return r == null ? "" : r.replace(e, "");
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const lr = z(
|
|
29
29
|
function({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
30
|
+
changeOnWheel: e,
|
|
31
|
+
type: u,
|
|
32
|
+
required: o,
|
|
33
|
+
label: c,
|
|
34
|
+
rules: d = [],
|
|
35
|
+
placeholder: f,
|
|
36
|
+
onEnter: g,
|
|
37
|
+
form: E,
|
|
38
|
+
nextFocus: N,
|
|
39
|
+
min: T,
|
|
40
|
+
moneyField: i,
|
|
41
|
+
addonAfter: P,
|
|
42
|
+
minLength: R,
|
|
43
|
+
defaultValue: S,
|
|
44
|
+
pattern: b,
|
|
45
|
+
disabled: y,
|
|
46
|
+
readOnly: D,
|
|
47
|
+
onChange: L,
|
|
48
|
+
value: I,
|
|
49
|
+
max: M,
|
|
50
|
+
addonBefore: O,
|
|
51
|
+
size: x,
|
|
51
52
|
isInt: n = !1,
|
|
52
|
-
tooltip:
|
|
53
|
-
help:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
tooltip: A,
|
|
54
|
+
help: C,
|
|
55
|
+
step: K,
|
|
56
|
+
...k
|
|
57
|
+
}, $) {
|
|
58
|
+
const { t: l } = F(), s = T === null, a = n && !s, j = f ?? c, B = m(() => {
|
|
57
59
|
const t = [
|
|
58
|
-
...
|
|
60
|
+
...d,
|
|
59
61
|
{
|
|
60
|
-
required:
|
|
61
|
-
message:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
required: o,
|
|
63
|
+
message: Z(
|
|
64
|
+
c,
|
|
65
|
+
f,
|
|
66
|
+
l("err.validation.required")
|
|
65
67
|
)
|
|
66
68
|
}
|
|
67
69
|
];
|
|
68
70
|
return n && t.push({
|
|
69
71
|
type: "number",
|
|
70
|
-
validator: async (
|
|
71
|
-
if (!(
|
|
72
|
-
throw new Error(
|
|
72
|
+
validator: async (or, _) => {
|
|
73
|
+
if (!(_ == null || Number.isInteger(_)))
|
|
74
|
+
throw new Error(l("err.validation.integer"));
|
|
73
75
|
}
|
|
74
76
|
}), t;
|
|
75
|
-
}, [
|
|
76
|
-
if (
|
|
77
|
-
if (
|
|
78
|
-
return (t) =>
|
|
79
|
-
}, [
|
|
80
|
-
if (
|
|
81
|
-
if (
|
|
82
|
-
return (t) =>
|
|
83
|
-
}, [
|
|
84
|
-
(t) =>
|
|
85
|
-
[E, g
|
|
86
|
-
),
|
|
77
|
+
}, [d, c, f, l, o, n]), Y = m(() => {
|
|
78
|
+
if (i) return rr;
|
|
79
|
+
if (a)
|
|
80
|
+
return (t) => er(t, v);
|
|
81
|
+
}, [i, a]), q = m(() => {
|
|
82
|
+
if (i) return tr;
|
|
83
|
+
if (a)
|
|
84
|
+
return (t) => nr(t, v);
|
|
85
|
+
}, [i, a]), G = h(
|
|
86
|
+
(t) => Q(t, N, E, g),
|
|
87
|
+
[N, E, g]
|
|
88
|
+
), H = h(
|
|
87
89
|
(t) => {
|
|
88
|
-
if (!
|
|
90
|
+
if (!s && t.key === "-") {
|
|
89
91
|
t.preventDefault();
|
|
90
92
|
return;
|
|
91
93
|
}
|
|
92
|
-
|
|
94
|
+
X.has(t.key) && t.preventDefault();
|
|
93
95
|
},
|
|
94
|
-
[
|
|
96
|
+
[s]
|
|
95
97
|
);
|
|
96
|
-
return /* @__PURE__ */
|
|
97
|
-
|
|
98
|
+
return /* @__PURE__ */ p(J, { title: A, children: /* @__PURE__ */ p(U.Item, { ...k, label: c, rules: B, help: C, children: /* @__PURE__ */ p(
|
|
99
|
+
V,
|
|
98
100
|
{
|
|
99
|
-
ref:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
101
|
+
ref: $,
|
|
102
|
+
changeOnWheel: e,
|
|
103
|
+
disabled: y,
|
|
104
|
+
defaultValue: S,
|
|
105
|
+
value: I,
|
|
106
|
+
readOnly: D,
|
|
107
|
+
addonBefore: O,
|
|
108
|
+
minLength: R,
|
|
109
|
+
addonAfter: P,
|
|
110
|
+
step: n ? 1 : K,
|
|
108
111
|
inputMode: n ? "numeric" : void 0,
|
|
109
|
-
pattern: n ?
|
|
112
|
+
pattern: n ? s ? "-?[0-9]*" : "[0-9]*" : b,
|
|
110
113
|
precision: n ? 0 : void 0,
|
|
111
|
-
onChange:
|
|
112
|
-
onPressEnter:
|
|
114
|
+
onChange: L,
|
|
115
|
+
onPressEnter: G,
|
|
113
116
|
className: "max-width",
|
|
114
|
-
min:
|
|
115
|
-
max:
|
|
116
|
-
type:
|
|
117
|
-
size:
|
|
118
|
-
formatter:
|
|
119
|
-
parser:
|
|
120
|
-
onKeyDown: n ?
|
|
121
|
-
placeholder:
|
|
117
|
+
min: s ? void 0 : T ?? 0,
|
|
118
|
+
max: M,
|
|
119
|
+
type: i ? void 0 : "number",
|
|
120
|
+
size: x,
|
|
121
|
+
formatter: Y,
|
|
122
|
+
parser: q,
|
|
123
|
+
onKeyDown: n ? H : void 0,
|
|
124
|
+
placeholder: j
|
|
122
125
|
}
|
|
123
126
|
) }) });
|
|
124
127
|
}
|
|
125
128
|
);
|
|
126
129
|
export {
|
|
127
|
-
|
|
130
|
+
lr as default
|
|
128
131
|
};
|
|
@@ -170,6 +170,8 @@ export interface NumberBasedFieldProps<T> extends InitialCrudField<T>, AddonFiel
|
|
|
170
170
|
*/
|
|
171
171
|
formatted?: boolean;
|
|
172
172
|
int?: boolean;
|
|
173
|
+
step?: number;
|
|
174
|
+
changeOnWheel?: boolean;
|
|
173
175
|
onChange?: (value: number, form: FormInstance<T>) => void;
|
|
174
176
|
}
|
|
175
177
|
export interface DateBasedFieldProps<T> extends InitialCrudField<T>, Copyable<false> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),p=require("antd"),T=require("react"),Y=require("react-highlight-words"),Z=require("../locale/index.cjs.js"),ee=require("./FileCrudField.cjs.js"),re=require("./ImageCrudField.cjs.js"),te=require("../common/check-box/CheckBox.cjs.js"),ne=require("../common/date-picker/DatePicker.cjs.js"),ae=require("../common/date-picker/TimePicker.cjs.js"),D=require("../common/select/SelectComponent.cjs.js"),oe=require("../common/text-field/NumberField.cjs.js"),le=require("../common/text-field/PhoneNumberField.cjs.js"),se=require("../common/text-field/TextField.cjs.js"),ie=require("../common/tooltip/TooltipComponent.cjs.js"),de=require("./CrudTextAreaComponent.cjs.js"),_=require("../util/CrudUtil.cjs.js"),E=require("../context/CrudSearchContext.cjs.js");function ce(
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),p=require("antd"),T=require("react"),Y=require("react-highlight-words"),Z=require("../locale/index.cjs.js"),ee=require("./FileCrudField.cjs.js"),re=require("./ImageCrudField.cjs.js"),te=require("../common/check-box/CheckBox.cjs.js"),ne=require("../common/date-picker/DatePicker.cjs.js"),ae=require("../common/date-picker/TimePicker.cjs.js"),D=require("../common/select/SelectComponent.cjs.js"),oe=require("../common/text-field/NumberField.cjs.js"),le=require("../common/text-field/PhoneNumberField.cjs.js"),se=require("../common/text-field/TextField.cjs.js"),ie=require("../common/tooltip/TooltipComponent.cjs.js"),de=require("./CrudTextAreaComponent.cjs.js"),_=require("../util/CrudUtil.cjs.js"),E=require("../context/CrudSearchContext.cjs.js");function ce(F){const{label:s,name:d,type:c,required:h,hidden:O,rules:b=[],updatable:m=!0,readonly:y=!1,fieldClassName:f,customFormFieldRender:k,fieldTooltip:S,fieldHelper:C,formLayoutProps:q,...r}=F,l=p.Form.useFormInstance();T.useEffect(()=>{if(c==="select"){const{items:a=[],onSearch:o,searchOnType:u}=r;!(a!=null&&a.length)&&!u&&(o==null||o(void 0,l,r==null?void 0:r.updatingValue))}},[l,r,c,r==null?void 0:r.updatingValue]);const R=E.useCrudSearchContext(),x=T.useCallback((a,o)=>{R&&R.search(),!y&&o&&o(a,l)},[R,y,l]);if(y||O)return e.jsx(e.Fragment,{});if(k)return k(l,F);switch(c){case"text":case"email":case"password":{const{maxLength:a,onChange:o,placeholder:u,addonAfter:v,addonBefore:i}=r;return e.jsx(se.default,{...q,maxLength:a,placeholder:u,disabled:!m,rules:b,required:h,onChange:o?N=>o(N,l):void 0,type:c,name:d,tooltip:S,label:s,className:f,autoComplete:"new-password",addonAfter:v,addonBefore:i,help:C})}case"phone":{const{onChange:a,placeholder:o,addonAfter:u,addonBefore:v}=r;return e.jsx(le,{...r,...q,placeholder:o,disabled:!m,rules:b,required:h,onChange:a?i=>a(i,l):void 0,type:c,name:d,tooltip:S,label:s,className:f,autoComplete:"new-password",addonAfter:u,addonBefore:v,help:C})}case"number":{const{onChange:a,placeholder:o,allowMinus:u,min:v,max:i,addonAfter:N,addonBefore:w,int:P,step:n,changeOnWheel:j=!1}=r;return e.jsx(oe,{...q,step:n,changeOnWheel:j,placeholder:o,disabled:!m,moneyField:!!r.formatted,type:c,onChange:a?H=>a(H,l):void 0,rules:b,autoComplete:"false",required:h,tooltip:S,className:f,min:u?null:v,max:i,addonAfter:N,addonBefore:w,name:d,label:s,help:C,isInt:P})}case"date":{const{range:a,disableToday:o,disabledFutureDays:u,disabledPastDays:v,onChange:i,placeholder:N,format:w}=r;return e.jsx(ne,{...q,placeholder:N,required:h,disabled:!m,type:c,format:w,tooltip:S,range:a,name:d,label:s,onChange:x,className:f,disableToday:o,disabledFutureDays:u,disabledPastDays:v,help:C})}case"time":{const{range:a=!1,disableCurrent:o,disabledFuture:u,disabledPast:v,onChange:i,use12Hours:N,format:w,placeholder:P}=r;return e.jsx(ae,{...q,placeholder:P,required:h,format:w,disabled:!m,type:c,tooltip:S,range:a,use12Hours:N,name:d,label:s,onChange:x,className:f,disableCurrent:o,disabledFuture:u,disabledPast:v,help:C})}case"textarea":return e.jsx(de,{...F});case"image":return e.jsx(re.default,{...r,required:h,name:d,label:s,rules:b,fieldHelper:C,fieldClassName:f,onRemoved:r.onRemoved,onUploading:r.onUploading,provider:r.provider});case"file":return e.jsx(ee.default,{...r,required:h,name:d,label:s,rules:b,fieldHelper:C,fieldClassName:f,onRemoved:r.onRemoved,onUploading:r.onUploading,provider:r.provider});case"select":return e.jsx($,{...r,required:h,name:d,label:s,rules:b,fieldClassName:f,form:l,help:C,updatable:m,readonly:y,fieldTooltip:S,fieldHelper:C});case"enum":return e.jsx(W,{...F});case"checkbox":{const{onChange:a,switch:o}=r;return e.jsx(te,{...q,className:f,rules:b,onChange:x,label:s,tooltip:S,disabled:!m,name:d,help:C,switch:o})}case"color":return e.jsx(z,{...r,type:"color",required:h,name:d,label:s,rules:b,fieldClassName:f,updatable:m,readonly:y,fieldTooltip:S,fieldHelper:C});default:return e.jsx(e.Fragment,{children:`${c} Not Implemented`})}}function W(F){const s=p.Form.useFormInstance(),{label:d,name:c,type:h,required:O,hidden:b,rules:m=[],updatable:y=!0,readonly:f=!1,fieldClassName:k,customFormFieldRender:S,fieldTooltip:C,fieldHelper:q,formLayoutProps:r,...l}=F,{t:R}=Z.useTranslationLibNoNS(),{enum:x,translation:a,onChange:o,onSearch:u,multiple:v,tagRender:i}=l,N=Array.isArray(x)?x:Object.keys(x),w=E.useCrudSearchContext(),P=T.useCallback(n=>{w&&w.search(),!f&&o&&o(n,s)},[w,f,o,s]);return"radio"in l&&l.radio?e.jsx(p.Form.Item,{...l,...r,name:c,required:O,tooltip:C,rules:m,label:d,className:["w-100",k].join(" "),help:q,children:e.jsx(p.Radio.Group,{...l,onChange:n=>{var j;return P((j=n==null?void 0:n.target)==null?void 0:j.value)},children:N.map(n=>e.jsx(p.Radio,{disabled:!y,value:n,children:a?R(a[n]):n},n))})}):"checkbox"in l&&l.checkbox?e.jsx(p.Form.Item,{...l,...r,name:c,required:O,tooltip:C,rules:m,label:d,className:["w-100",k].join(" "),help:q,children:e.jsx(p.Checkbox.Group,{className:"w-100",onChange:P,children:N.map(n=>{const j=e.jsx(p.Checkbox,{disabled:!y,value:n,children:a?R(a[n]):n},n);return"checkboxGrid"in l&&l.checkboxGrid?e.jsx(p.Col,{...l.checkboxGrid,children:j}):j})})}):e.jsx(D,{...l,...r,notSearch:!0,tagRender:typeof i=="function"?i:i?n=>{const{value:j,label:H}=n,I=i[j];return I?e.jsx(p.Tag,{color:I.color,children:H}):e.jsx(p.Tag,{children:H})}:void 0,onChange:P,className:["w-100",k].join(" "),name:c,items:N,required:O,tooltip:C,rules:m,label:d,help:q,disabled:!y,onSearch:u?n=>u(n,s):void 0,allowClear:!0,mode:v?"multiple":void 0,showLoadingInEmptyIndicator:!0,itemBuilder:n=>e.jsx(p.Select.Option,{value:n,children:a?R(a[n]):n},n)})}function $(F){const{items:s=[],loading:d,searchOnType:c,onSearch:h,multiple:O,onChange:b,highlightSearch:m,required:y,fieldClassName:f,rules:k,fieldTooltip:S,updatable:C,label:q,name:r,tagRender:l,updatingValue:R,onSet:x,placeholder:a,allowClear:o=!0,selectOptionRender:u,formLayoutProps:v}=F,i=F.form,[N,w]=T.useState(""),P=T.useMemo(()=>_.getRealName(r),[r]),n=T.useMemo(()=>_.getRealName(r,"upsertFieldName"),[r]),j=p.Form.useWatch(P,i),[H,I]=T.useState(!0);T.useEffect(()=>{x&&H&&j&&(x==null||x(j,s,i),I(!1))},[H,i,s,P,x,j]),T.useEffect(()=>{j&&I(!0)},[j]);const J=T.useCallback(async t=>{w(t),c&&(h==null||h(t,i,R))},[i,h,c,R]),K=T.useCallback(t=>u?u(t):t.value,[u]),L=E.useCrudSearchContext(),Q=T.useCallback(t=>{L&&L.search(),b&&(w(""),b(t,i))},[L,b,i]);return e.jsx(D,{...F,...v,showLoadingInEmptyIndicator:!0,maxTagCount:"responsive",maxTagPlaceholder:t=>e.jsxs(ie,{title:e.jsx(e.Fragment,{children:t.map(g=>e.jsxs(e.Fragment,{children:[g.label," ",e.jsx("br",{})]}))}),children:["+",t==null?void 0:t.length]}),placeholder:a,onSelect:t=>{x==null||x(t==null?void 0:t.key,s,i)},onChange:Q,mode:O?"multiple":void 0,className:["w-100",f].join(" "),name:n,items:s,required:y,tooltip:S,tagRender:l,rules:k,disabled:!C,label:q,allowClear:o,onSearch:J,loading:d,filterOption:m?(t,g)=>{var A,B,G;try{const M=t.toLowerCase().split(/\s+/),V=((typeof(g==null?void 0:g.children)=="string"?g==null?void 0:g.children:(B=(A=g==null?void 0:g.children)==null?void 0:A.props)==null?void 0:B.textToHighlight)??"").toLowerCase(),X=(((G=g==null?void 0:g.value)==null?void 0:G.toString())??"").toLowerCase();return M.every(U=>V.indexOf(U)>=0||X.indexOf(U)>=0)}catch{return!0}}:void 0,itemBuilder:m?t=>{const g=t.value?String(t.value):void 0;return e.jsx(p.Select.Option,{value:t.key,title:g,disabled:t.disabled,children:e.jsx(Y,{highlightClassName:"highlight-text",searchWords:(N??"").split(" "),autoEscape:!0,textToHighlight:g??""})},t.key)}:t=>e.jsx(p.Select.Option,{value:t.key,title:t.value,disabled:t.disabled,children:K(t)},t.key)})}function z(F){const{formLayoutProps:s,required:d,fieldClassName:c,rules:h,fieldTooltip:O,updatable:b,label:m,name:y,fieldHelper:f}=F;return e.jsx(p.Form.Item,{...s,label:m,name:y,required:d,rules:h,tooltip:O,help:f,getValueFromEvent:k=>typeof k=="object"?k.toHexString():k,children:e.jsx(p.ColorPicker,{disabledAlpha:!0,format:"hex",defaultFormat:"hex",showText:!0,trigger:"click",className:c,disabled:!b,...F.innerProps})})}exports.ColorCrudFieldComponent=z;exports.EnumCrudFieldComponent=W;exports.SelectCrudFieldComponent=$;exports.default=ce;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as r, Fragment as A, jsxs as $ } from "react/jsx-runtime";
|
|
2
|
-
import { Form as
|
|
2
|
+
import { Form as O, ColorPicker as ae, Radio as z, Checkbox as J, Col as ne, Select as E, Tag as K } from "antd";
|
|
3
3
|
import { useEffect as G, useCallback as j, useState as Q, useMemo as V } from "react";
|
|
4
4
|
import le from "react-highlight-words";
|
|
5
5
|
import { useTranslationLibNoNS as ie } from "../locale/index.es.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import se from "./FileCrudField.es.js";
|
|
7
|
+
import de from "./ImageCrudField.es.js";
|
|
8
8
|
import ce from "../common/check-box/CheckBox.es.js";
|
|
9
9
|
import me from "../common/date-picker/DatePicker.es.js";
|
|
10
10
|
import ue from "../common/date-picker/TimePicker.es.js";
|
|
@@ -16,23 +16,23 @@ import ge from "../common/tooltip/TooltipComponent.es.js";
|
|
|
16
16
|
import Ce from "./CrudTextAreaComponent.es.js";
|
|
17
17
|
import X from "../util/CrudUtil.es.js";
|
|
18
18
|
import { useCrudSearchContext as U } from "../context/CrudSearchContext.es.js";
|
|
19
|
-
function Ue(
|
|
19
|
+
function Ue(y) {
|
|
20
20
|
const {
|
|
21
21
|
label: i,
|
|
22
|
-
name:
|
|
22
|
+
name: d,
|
|
23
23
|
type: c,
|
|
24
24
|
required: u,
|
|
25
25
|
hidden: I,
|
|
26
26
|
rules: b = [],
|
|
27
27
|
updatable: h = !0,
|
|
28
|
-
readonly:
|
|
28
|
+
readonly: v = !1,
|
|
29
29
|
fieldClassName: f,
|
|
30
30
|
customFormFieldRender: w,
|
|
31
31
|
fieldTooltip: R,
|
|
32
32
|
fieldHelper: p,
|
|
33
33
|
formLayoutProps: T,
|
|
34
34
|
...e
|
|
35
|
-
} =
|
|
35
|
+
} = y, l = O.useFormInstance();
|
|
36
36
|
G(() => {
|
|
37
37
|
if (c === "select") {
|
|
38
38
|
const {
|
|
@@ -44,16 +44,16 @@ function Ue(x) {
|
|
|
44
44
|
}
|
|
45
45
|
}, [l, e, c, e == null ? void 0 : e.updatingValue]);
|
|
46
46
|
const P = U(), C = j((a, n) => {
|
|
47
|
-
P && P.search(), !
|
|
48
|
-
}, [P,
|
|
49
|
-
if (
|
|
47
|
+
P && P.search(), !v && n && n(a, l);
|
|
48
|
+
}, [P, v, l]);
|
|
49
|
+
if (v || I) return /* @__PURE__ */ r(A, {});
|
|
50
50
|
if (w)
|
|
51
|
-
return w(l,
|
|
51
|
+
return w(l, y);
|
|
52
52
|
switch (c) {
|
|
53
53
|
case "text":
|
|
54
54
|
case "email":
|
|
55
55
|
case "password": {
|
|
56
|
-
const { maxLength: a, onChange: n, placeholder: m, addonAfter:
|
|
56
|
+
const { maxLength: a, onChange: n, placeholder: m, addonAfter: N, addonBefore: s } = e;
|
|
57
57
|
return /* @__PURE__ */ r(
|
|
58
58
|
pe,
|
|
59
59
|
{
|
|
@@ -63,21 +63,21 @@ function Ue(x) {
|
|
|
63
63
|
disabled: !h,
|
|
64
64
|
rules: b,
|
|
65
65
|
required: u,
|
|
66
|
-
onChange: n ? (
|
|
66
|
+
onChange: n ? (F) => n(F, l) : void 0,
|
|
67
67
|
type: c,
|
|
68
|
-
name:
|
|
68
|
+
name: d,
|
|
69
69
|
tooltip: R,
|
|
70
70
|
label: i,
|
|
71
71
|
className: f,
|
|
72
72
|
autoComplete: "new-password",
|
|
73
|
-
addonAfter:
|
|
74
|
-
addonBefore:
|
|
73
|
+
addonAfter: N,
|
|
74
|
+
addonBefore: s,
|
|
75
75
|
help: p
|
|
76
76
|
}
|
|
77
77
|
);
|
|
78
78
|
}
|
|
79
79
|
case "phone": {
|
|
80
|
-
const { onChange: a, placeholder: n, addonAfter: m, addonBefore:
|
|
80
|
+
const { onChange: a, placeholder: n, addonAfter: m, addonBefore: N } = e;
|
|
81
81
|
return /* @__PURE__ */ r(
|
|
82
82
|
fe,
|
|
83
83
|
{
|
|
@@ -87,15 +87,15 @@ function Ue(x) {
|
|
|
87
87
|
disabled: !h,
|
|
88
88
|
rules: b,
|
|
89
89
|
required: u,
|
|
90
|
-
onChange: a ? (
|
|
90
|
+
onChange: a ? (s) => a(s, l) : void 0,
|
|
91
91
|
type: c,
|
|
92
|
-
name:
|
|
92
|
+
name: d,
|
|
93
93
|
tooltip: R,
|
|
94
94
|
label: i,
|
|
95
95
|
className: f,
|
|
96
96
|
autoComplete: "new-password",
|
|
97
97
|
addonAfter: m,
|
|
98
|
-
addonBefore:
|
|
98
|
+
addonBefore: N,
|
|
99
99
|
help: p
|
|
100
100
|
}
|
|
101
101
|
);
|
|
@@ -105,31 +105,35 @@ function Ue(x) {
|
|
|
105
105
|
onChange: a,
|
|
106
106
|
placeholder: n,
|
|
107
107
|
allowMinus: m,
|
|
108
|
-
min:
|
|
109
|
-
max:
|
|
110
|
-
addonAfter:
|
|
108
|
+
min: N,
|
|
109
|
+
max: s,
|
|
110
|
+
addonAfter: F,
|
|
111
111
|
addonBefore: k,
|
|
112
|
-
int: H
|
|
112
|
+
int: H,
|
|
113
|
+
step: o,
|
|
114
|
+
changeOnWheel: x = !1
|
|
113
115
|
} = e;
|
|
114
116
|
return /* @__PURE__ */ r(
|
|
115
117
|
he,
|
|
116
118
|
{
|
|
117
119
|
...T,
|
|
120
|
+
step: o,
|
|
121
|
+
changeOnWheel: x,
|
|
118
122
|
placeholder: n,
|
|
119
123
|
disabled: !h,
|
|
120
124
|
moneyField: !!e.formatted,
|
|
121
125
|
type: c,
|
|
122
|
-
onChange: a ? (
|
|
126
|
+
onChange: a ? (L) => a(L, l) : void 0,
|
|
123
127
|
rules: b,
|
|
124
128
|
autoComplete: "false",
|
|
125
129
|
required: u,
|
|
126
130
|
tooltip: R,
|
|
127
131
|
className: f,
|
|
128
|
-
min: m ? null :
|
|
129
|
-
max:
|
|
130
|
-
addonAfter:
|
|
132
|
+
min: m ? null : N,
|
|
133
|
+
max: s,
|
|
134
|
+
addonAfter: F,
|
|
131
135
|
addonBefore: k,
|
|
132
|
-
name:
|
|
136
|
+
name: d,
|
|
133
137
|
label: i,
|
|
134
138
|
help: p,
|
|
135
139
|
isInt: H
|
|
@@ -141,29 +145,29 @@ function Ue(x) {
|
|
|
141
145
|
range: a,
|
|
142
146
|
disableToday: n,
|
|
143
147
|
disabledFutureDays: m,
|
|
144
|
-
disabledPastDays:
|
|
145
|
-
onChange:
|
|
146
|
-
placeholder:
|
|
148
|
+
disabledPastDays: N,
|
|
149
|
+
onChange: s,
|
|
150
|
+
placeholder: F,
|
|
147
151
|
format: k
|
|
148
152
|
} = e;
|
|
149
153
|
return /* @__PURE__ */ r(
|
|
150
154
|
me,
|
|
151
155
|
{
|
|
152
156
|
...T,
|
|
153
|
-
placeholder:
|
|
157
|
+
placeholder: F,
|
|
154
158
|
required: u,
|
|
155
159
|
disabled: !h,
|
|
156
160
|
type: c,
|
|
157
161
|
format: k,
|
|
158
162
|
tooltip: R,
|
|
159
163
|
range: a,
|
|
160
|
-
name:
|
|
164
|
+
name: d,
|
|
161
165
|
label: i,
|
|
162
166
|
onChange: C,
|
|
163
167
|
className: f,
|
|
164
168
|
disableToday: n,
|
|
165
169
|
disabledFutureDays: m,
|
|
166
|
-
disabledPastDays:
|
|
170
|
+
disabledPastDays: N,
|
|
167
171
|
help: p
|
|
168
172
|
}
|
|
169
173
|
);
|
|
@@ -173,9 +177,9 @@ function Ue(x) {
|
|
|
173
177
|
range: a = !1,
|
|
174
178
|
disableCurrent: n,
|
|
175
179
|
disabledFuture: m,
|
|
176
|
-
disabledPast:
|
|
177
|
-
onChange:
|
|
178
|
-
use12Hours:
|
|
180
|
+
disabledPast: N,
|
|
181
|
+
onChange: s,
|
|
182
|
+
use12Hours: F,
|
|
179
183
|
format: k,
|
|
180
184
|
placeholder: H
|
|
181
185
|
} = e;
|
|
@@ -190,27 +194,27 @@ function Ue(x) {
|
|
|
190
194
|
type: c,
|
|
191
195
|
tooltip: R,
|
|
192
196
|
range: a,
|
|
193
|
-
use12Hours:
|
|
194
|
-
name:
|
|
197
|
+
use12Hours: F,
|
|
198
|
+
name: d,
|
|
195
199
|
label: i,
|
|
196
200
|
onChange: C,
|
|
197
201
|
className: f,
|
|
198
202
|
disableCurrent: n,
|
|
199
203
|
disabledFuture: m,
|
|
200
|
-
disabledPast:
|
|
204
|
+
disabledPast: N,
|
|
201
205
|
help: p
|
|
202
206
|
}
|
|
203
207
|
);
|
|
204
208
|
}
|
|
205
209
|
case "textarea":
|
|
206
|
-
return /* @__PURE__ */ r(Ce, { ...
|
|
210
|
+
return /* @__PURE__ */ r(Ce, { ...y });
|
|
207
211
|
case "image":
|
|
208
212
|
return /* @__PURE__ */ r(
|
|
209
|
-
|
|
213
|
+
de,
|
|
210
214
|
{
|
|
211
215
|
...e,
|
|
212
216
|
required: u,
|
|
213
|
-
name:
|
|
217
|
+
name: d,
|
|
214
218
|
label: i,
|
|
215
219
|
rules: b,
|
|
216
220
|
fieldHelper: p,
|
|
@@ -222,11 +226,11 @@ function Ue(x) {
|
|
|
222
226
|
);
|
|
223
227
|
case "file":
|
|
224
228
|
return /* @__PURE__ */ r(
|
|
225
|
-
|
|
229
|
+
se,
|
|
226
230
|
{
|
|
227
231
|
...e,
|
|
228
232
|
required: u,
|
|
229
|
-
name:
|
|
233
|
+
name: d,
|
|
230
234
|
label: i,
|
|
231
235
|
rules: b,
|
|
232
236
|
fieldHelper: p,
|
|
@@ -242,20 +246,20 @@ function Ue(x) {
|
|
|
242
246
|
{
|
|
243
247
|
...e,
|
|
244
248
|
required: u,
|
|
245
|
-
name:
|
|
249
|
+
name: d,
|
|
246
250
|
label: i,
|
|
247
251
|
rules: b,
|
|
248
252
|
fieldClassName: f,
|
|
249
253
|
form: l,
|
|
250
254
|
help: p,
|
|
251
255
|
updatable: h,
|
|
252
|
-
readonly:
|
|
256
|
+
readonly: v,
|
|
253
257
|
fieldTooltip: R,
|
|
254
258
|
fieldHelper: p
|
|
255
259
|
}
|
|
256
260
|
);
|
|
257
261
|
case "enum":
|
|
258
|
-
return /* @__PURE__ */ r(be, { ...
|
|
262
|
+
return /* @__PURE__ */ r(be, { ...y });
|
|
259
263
|
case "checkbox": {
|
|
260
264
|
const { onChange: a, switch: n } = e;
|
|
261
265
|
return /* @__PURE__ */ r(
|
|
@@ -268,7 +272,7 @@ function Ue(x) {
|
|
|
268
272
|
label: i,
|
|
269
273
|
tooltip: R,
|
|
270
274
|
disabled: !h,
|
|
271
|
-
name:
|
|
275
|
+
name: d,
|
|
272
276
|
help: p,
|
|
273
277
|
switch: n
|
|
274
278
|
}
|
|
@@ -281,12 +285,12 @@ function Ue(x) {
|
|
|
281
285
|
...e,
|
|
282
286
|
type: "color",
|
|
283
287
|
required: u,
|
|
284
|
-
name:
|
|
288
|
+
name: d,
|
|
285
289
|
label: i,
|
|
286
290
|
rules: b,
|
|
287
291
|
fieldClassName: f,
|
|
288
292
|
updatable: h,
|
|
289
|
-
readonly:
|
|
293
|
+
readonly: v,
|
|
290
294
|
fieldTooltip: R,
|
|
291
295
|
fieldHelper: p
|
|
292
296
|
}
|
|
@@ -295,15 +299,15 @@ function Ue(x) {
|
|
|
295
299
|
return /* @__PURE__ */ r(A, { children: `${c} Not Implemented` });
|
|
296
300
|
}
|
|
297
301
|
}
|
|
298
|
-
function be(
|
|
299
|
-
const i =
|
|
300
|
-
label:
|
|
302
|
+
function be(y) {
|
|
303
|
+
const i = O.useFormInstance(), {
|
|
304
|
+
label: d,
|
|
301
305
|
name: c,
|
|
302
306
|
type: u,
|
|
303
307
|
required: I,
|
|
304
308
|
hidden: b,
|
|
305
309
|
rules: h = [],
|
|
306
|
-
updatable:
|
|
310
|
+
updatable: v = !0,
|
|
307
311
|
readonly: f = !1,
|
|
308
312
|
fieldClassName: w,
|
|
309
313
|
customFormFieldRender: R,
|
|
@@ -311,21 +315,21 @@ function be(x) {
|
|
|
311
315
|
fieldHelper: T,
|
|
312
316
|
formLayoutProps: e,
|
|
313
317
|
...l
|
|
314
|
-
} =
|
|
318
|
+
} = y, { t: P } = ie(), {
|
|
315
319
|
enum: C,
|
|
316
320
|
translation: a,
|
|
317
321
|
onChange: n,
|
|
318
322
|
onSearch: m,
|
|
319
|
-
multiple:
|
|
320
|
-
tagRender:
|
|
321
|
-
} = l,
|
|
323
|
+
multiple: N,
|
|
324
|
+
tagRender: s
|
|
325
|
+
} = l, F = Array.isArray(C) ? C : Object.keys(C), k = U(), H = j(
|
|
322
326
|
(o) => {
|
|
323
327
|
k && k.search(), !f && n && n(o, i);
|
|
324
328
|
},
|
|
325
329
|
[k, f, n, i]
|
|
326
330
|
);
|
|
327
331
|
return "radio" in l && l.radio ? /* @__PURE__ */ r(
|
|
328
|
-
|
|
332
|
+
O.Item,
|
|
329
333
|
{
|
|
330
334
|
...l,
|
|
331
335
|
...e,
|
|
@@ -333,7 +337,7 @@ function be(x) {
|
|
|
333
337
|
required: I,
|
|
334
338
|
tooltip: p,
|
|
335
339
|
rules: h,
|
|
336
|
-
label:
|
|
340
|
+
label: d,
|
|
337
341
|
className: ["w-100", w].join(" "),
|
|
338
342
|
help: T,
|
|
339
343
|
children: /* @__PURE__ */ r(
|
|
@@ -341,15 +345,15 @@ function be(x) {
|
|
|
341
345
|
{
|
|
342
346
|
...l,
|
|
343
347
|
onChange: (o) => {
|
|
344
|
-
var
|
|
345
|
-
return H((
|
|
348
|
+
var x;
|
|
349
|
+
return H((x = o == null ? void 0 : o.target) == null ? void 0 : x.value);
|
|
346
350
|
},
|
|
347
|
-
children:
|
|
351
|
+
children: F.map((o) => /* @__PURE__ */ r(z, { disabled: !v, value: o, children: a ? P(a[o]) : o }, o))
|
|
348
352
|
}
|
|
349
353
|
)
|
|
350
354
|
}
|
|
351
355
|
) : "checkbox" in l && l.checkbox ? /* @__PURE__ */ r(
|
|
352
|
-
|
|
356
|
+
O.Item,
|
|
353
357
|
{
|
|
354
358
|
...l,
|
|
355
359
|
...e,
|
|
@@ -357,12 +361,12 @@ function be(x) {
|
|
|
357
361
|
required: I,
|
|
358
362
|
tooltip: p,
|
|
359
363
|
rules: h,
|
|
360
|
-
label:
|
|
364
|
+
label: d,
|
|
361
365
|
className: ["w-100", w].join(" "),
|
|
362
366
|
help: T,
|
|
363
|
-
children: /* @__PURE__ */ r(J.Group, { className: "w-100", onChange: H, children:
|
|
364
|
-
const
|
|
365
|
-
return "checkboxGrid" in l && l.checkboxGrid ? /* @__PURE__ */ r(ne, { ...l.checkboxGrid, children:
|
|
367
|
+
children: /* @__PURE__ */ r(J.Group, { className: "w-100", onChange: H, children: F.map((o) => {
|
|
368
|
+
const x = /* @__PURE__ */ r(J, { disabled: !v, value: o, children: a ? P(a[o]) : o }, o);
|
|
369
|
+
return "checkboxGrid" in l && l.checkboxGrid ? /* @__PURE__ */ r(ne, { ...l.checkboxGrid, children: x }) : x;
|
|
366
370
|
}) })
|
|
367
371
|
}
|
|
368
372
|
) : /* @__PURE__ */ r(
|
|
@@ -371,38 +375,38 @@ function be(x) {
|
|
|
371
375
|
...l,
|
|
372
376
|
...e,
|
|
373
377
|
notSearch: !0,
|
|
374
|
-
tagRender: typeof
|
|
375
|
-
const { value:
|
|
376
|
-
return
|
|
378
|
+
tagRender: typeof s == "function" ? s : s ? (o) => {
|
|
379
|
+
const { value: x, label: L } = o, S = s[x];
|
|
380
|
+
return S ? /* @__PURE__ */ r(K, { color: S.color, children: L }) : /* @__PURE__ */ r(K, { children: L });
|
|
377
381
|
} : void 0,
|
|
378
382
|
onChange: H,
|
|
379
383
|
className: ["w-100", w].join(" "),
|
|
380
384
|
name: c,
|
|
381
|
-
items:
|
|
385
|
+
items: F,
|
|
382
386
|
required: I,
|
|
383
387
|
tooltip: p,
|
|
384
388
|
rules: h,
|
|
385
|
-
label:
|
|
389
|
+
label: d,
|
|
386
390
|
help: T,
|
|
387
|
-
disabled: !
|
|
391
|
+
disabled: !v,
|
|
388
392
|
onSearch: m ? (o) => m(o, i) : void 0,
|
|
389
393
|
allowClear: !0,
|
|
390
|
-
mode:
|
|
394
|
+
mode: N ? "multiple" : void 0,
|
|
391
395
|
showLoadingInEmptyIndicator: !0,
|
|
392
396
|
itemBuilder: (o) => /* @__PURE__ */ r(E.Option, { value: o, children: a ? P(a[o]) : o }, o)
|
|
393
397
|
}
|
|
394
398
|
);
|
|
395
399
|
}
|
|
396
|
-
function xe(
|
|
400
|
+
function xe(y) {
|
|
397
401
|
const {
|
|
398
402
|
items: i = [],
|
|
399
|
-
loading:
|
|
403
|
+
loading: d,
|
|
400
404
|
searchOnType: c,
|
|
401
405
|
onSearch: u,
|
|
402
406
|
multiple: I,
|
|
403
407
|
onChange: b,
|
|
404
408
|
highlightSearch: h,
|
|
405
|
-
required:
|
|
409
|
+
required: v,
|
|
406
410
|
fieldClassName: f,
|
|
407
411
|
rules: w,
|
|
408
412
|
fieldTooltip: R,
|
|
@@ -415,35 +419,35 @@ function xe(x) {
|
|
|
415
419
|
placeholder: a,
|
|
416
420
|
allowClear: n = !0,
|
|
417
421
|
selectOptionRender: m,
|
|
418
|
-
formLayoutProps:
|
|
419
|
-
} =
|
|
422
|
+
formLayoutProps: N
|
|
423
|
+
} = y, s = y.form, [F, k] = Q(""), H = V(() => X.getRealName(e), [e]), o = V(
|
|
420
424
|
() => X.getRealName(e, "upsertFieldName"),
|
|
421
425
|
[e]
|
|
422
|
-
),
|
|
426
|
+
), x = O.useWatch(H, s), [L, S] = Q(!0);
|
|
423
427
|
G(() => {
|
|
424
|
-
C &&
|
|
425
|
-
}, [
|
|
426
|
-
|
|
427
|
-
}, [
|
|
428
|
+
C && L && x && (C == null || C(x, i, s), S(!1));
|
|
429
|
+
}, [L, s, i, H, C, x]), G(() => {
|
|
430
|
+
x && S(!0);
|
|
431
|
+
}, [x]);
|
|
428
432
|
const Z = j(
|
|
429
433
|
async (t) => {
|
|
430
|
-
k(t), c && (u == null || u(t,
|
|
434
|
+
k(t), c && (u == null || u(t, s, P));
|
|
431
435
|
},
|
|
432
|
-
[
|
|
436
|
+
[s, u, c, P]
|
|
433
437
|
), ee = j(
|
|
434
438
|
(t) => m ? m(t) : t.value,
|
|
435
439
|
[m]
|
|
436
440
|
), B = U(), re = j(
|
|
437
441
|
(t) => {
|
|
438
|
-
B && B.search(), b && (k(""), b(t,
|
|
442
|
+
B && B.search(), b && (k(""), b(t, s));
|
|
439
443
|
},
|
|
440
|
-
[B, b,
|
|
444
|
+
[B, b, s]
|
|
441
445
|
);
|
|
442
446
|
return /* @__PURE__ */ r(
|
|
443
447
|
Y,
|
|
444
448
|
{
|
|
445
|
-
...
|
|
446
|
-
...
|
|
449
|
+
...y,
|
|
450
|
+
...N,
|
|
447
451
|
showLoadingInEmptyIndicator: !0,
|
|
448
452
|
maxTagCount: "responsive",
|
|
449
453
|
maxTagPlaceholder: (t) => /* @__PURE__ */ $(
|
|
@@ -462,14 +466,14 @@ function xe(x) {
|
|
|
462
466
|
),
|
|
463
467
|
placeholder: a,
|
|
464
468
|
onSelect: (t) => {
|
|
465
|
-
C == null || C(t == null ? void 0 : t.key, i,
|
|
469
|
+
C == null || C(t == null ? void 0 : t.key, i, s);
|
|
466
470
|
},
|
|
467
471
|
onChange: re,
|
|
468
472
|
mode: I ? "multiple" : void 0,
|
|
469
473
|
className: ["w-100", f].join(" "),
|
|
470
474
|
name: o,
|
|
471
475
|
items: i,
|
|
472
|
-
required:
|
|
476
|
+
required: v,
|
|
473
477
|
tooltip: R,
|
|
474
478
|
tagRender: l,
|
|
475
479
|
rules: w,
|
|
@@ -477,12 +481,12 @@ function xe(x) {
|
|
|
477
481
|
label: T,
|
|
478
482
|
allowClear: n,
|
|
479
483
|
onSearch: Z,
|
|
480
|
-
loading:
|
|
484
|
+
loading: d,
|
|
481
485
|
filterOption: h ? (t, g) => {
|
|
482
|
-
var q, D,
|
|
486
|
+
var q, D, W;
|
|
483
487
|
try {
|
|
484
|
-
const
|
|
485
|
-
return
|
|
488
|
+
const M = t.toLowerCase().split(/\s+/), te = ((typeof (g == null ? void 0 : g.children) == "string" ? g == null ? void 0 : g.children : (D = (q = g == null ? void 0 : g.children) == null ? void 0 : q.props) == null ? void 0 : D.textToHighlight) ?? "").toLowerCase(), oe = (((W = g == null ? void 0 : g.value) == null ? void 0 : W.toString()) ?? "").toLowerCase();
|
|
489
|
+
return M.every(
|
|
486
490
|
(_) => te.indexOf(_) >= 0 || oe.indexOf(_) >= 0
|
|
487
491
|
);
|
|
488
492
|
} catch {
|
|
@@ -501,7 +505,7 @@ function xe(x) {
|
|
|
501
505
|
le,
|
|
502
506
|
{
|
|
503
507
|
highlightClassName: "highlight-text",
|
|
504
|
-
searchWords: (
|
|
508
|
+
searchWords: (F ?? "").split(" "),
|
|
505
509
|
autoEscape: !0,
|
|
506
510
|
textToHighlight: g ?? ""
|
|
507
511
|
}
|
|
@@ -522,25 +526,25 @@ function xe(x) {
|
|
|
522
526
|
}
|
|
523
527
|
);
|
|
524
528
|
}
|
|
525
|
-
function ye(
|
|
529
|
+
function ye(y) {
|
|
526
530
|
const {
|
|
527
531
|
formLayoutProps: i,
|
|
528
|
-
required:
|
|
532
|
+
required: d,
|
|
529
533
|
fieldClassName: c,
|
|
530
534
|
rules: u,
|
|
531
535
|
fieldTooltip: I,
|
|
532
536
|
updatable: b,
|
|
533
537
|
label: h,
|
|
534
|
-
name:
|
|
538
|
+
name: v,
|
|
535
539
|
fieldHelper: f
|
|
536
|
-
} =
|
|
540
|
+
} = y;
|
|
537
541
|
return /* @__PURE__ */ r(
|
|
538
|
-
|
|
542
|
+
O.Item,
|
|
539
543
|
{
|
|
540
544
|
...i,
|
|
541
545
|
label: h,
|
|
542
|
-
name:
|
|
543
|
-
required:
|
|
546
|
+
name: v,
|
|
547
|
+
required: d,
|
|
544
548
|
rules: u,
|
|
545
549
|
tooltip: I,
|
|
546
550
|
help: f,
|
|
@@ -555,7 +559,7 @@ function ye(x) {
|
|
|
555
559
|
trigger: "click",
|
|
556
560
|
className: c,
|
|
557
561
|
disabled: !b,
|
|
558
|
-
...
|
|
562
|
+
...y.innerProps
|
|
559
563
|
}
|
|
560
564
|
)
|
|
561
565
|
}
|