lu-lowcode-package-form 0.8.4 → 0.8.5
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/index.cjs.js +1 -1
- package/dist/index.es.js +311 -288
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/App.jsx +1 -0
- package/src/components/field/checkbox/checkbox-tree.jsx +6 -1
- package/src/components/field/checkbox/index.jsx +29 -15
- package/src/components/field/select/select.jsx +9 -6
- package/src/components/form-container/layout/form-group-title.jsx +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -380,4 +380,4 @@ __p += '`),rn&&(We+=`' +
|
|
|
380
380
|
function print() { __p += __j.call(arguments, '') }
|
|
381
381
|
`:`;
|
|
382
382
|
`)+We+`return __p
|
|
383
|
-
}`;var Yt=ah(function(){return cn(q,xt+"return "+We).apply(n,ne)});if(Yt.source=We,Id(Yt))throw Yt;return Yt}function dR(o){return pn(o).toLowerCase()}function fR(o){return pn(o).toUpperCase()}function vR(o,c,p){if(o=pn(o),o&&(p||c===n))return vp(o);if(!o||!(c=Fr(c)))return o;var E=ia(o),A=ia(c),q=gp(E,A),ne=pp(E,A)+1;return lo(E,q,ne).join("")}function gR(o,c,p){if(o=pn(o),o&&(p||c===n))return o.slice(0,hp(o)+1);if(!o||!(c=Fr(c)))return o;var E=ia(o),A=pp(E,ia(c))+1;return lo(E,0,A).join("")}function pR(o,c,p){if(o=pn(o),o&&(p||c===n))return o.replace(nt,"");if(!o||!(c=Fr(c)))return o;var E=ia(o),A=gp(E,ia(c));return lo(E,A).join("")}function mR(o,c){var p=M,E=k;if(kn(c)){var A="separator"in c?c.separator:A;p="length"in c?Gt(c.length):p,E="omission"in c?Fr(c.omission):E}o=pn(o);var q=o.length;if(li(o)){var ne=ia(o);q=ne.length}if(p>=q)return o;var se=p-si(E);if(se<1)return E;var ve=ne?lo(ne,0,se).join(""):o.slice(0,se);if(A===n)return ve+E;if(ne&&(se+=ve.length-se),Rd(A)){if(o.slice(se).search(A)){var ke,Le=ve;for(A.global||(A=Wu(A.source,pn(bt.exec(A))+"g")),A.lastIndex=0;ke=A.exec(Le);)var We=ke.index;ve=ve.slice(0,We===n?se:We)}}else if(o.indexOf(Fr(A),se)!=se){var st=ve.lastIndexOf(A);st>-1&&(ve=ve.slice(0,st))}return ve+E}function hR(o){return o=pn(o),o&&Tt.test(o)?o.replace(ft,Ux):o}var bR=pi(function(o,c,p){return o+(p?" ":"")+c.toUpperCase()}),Nd=om("toUpperCase");function rh(o,c,p){return o=pn(o),c=p?n:c,c===n?Hx(o)?Yx(o):Mx(o):o.match(c)||[]}var ah=Zt(function(o,c){try{return Dr(o,n,c)}catch(p){return Id(p)?p:new Bt(p)}}),yR=Ta(function(o,c){return Ur(c,function(p){p=xa(p),Ma(o,p,$d(o[p],o))}),o});function CR(o){var c=o==null?0:o.length,p=Dt();return o=c?Tn(o,function(E){if(typeof E[1]!="function")throw new qr(s);return[p(E[0]),E[1]]}):[],Zt(function(E){for(var A=-1;++A<c;){var q=o[A];if(Dr(q[0],this,E))return Dr(q[1],this,E)}})}function SR(o){return UE(Yr(o,g))}function Md(o){return function(){return o}}function wR(o,c){return o==null||o!==o?c:o}var xR=lm(),ER=lm(!0);function Pr(o){return o}function Dd(o){return kp(typeof o=="function"?o:Yr(o,g))}function $R(o){return Vp(Yr(o,g))}function OR(o,c){return jp(o,Yr(c,g))}var IR=Zt(function(o,c){return function(p){return cl(p,o,c)}}),RR=Zt(function(o,c){return function(p){return cl(o,p,c)}});function Td(o,c,p){var E=ar(c),A=Ts(c,E);p==null&&!(kn(c)&&(A.length||!E.length))&&(p=c,c=o,o=this,A=Ts(c,ar(c)));var q=!(kn(p)&&"chain"in p)||!!p.chain,ne=Aa(o);return Ur(A,function(se){var ve=c[se];o[se]=ve,ne&&(o.prototype[se]=function(){var ke=this.__chain__;if(q||ke){var Le=o(this.__wrapped__),We=Le.__actions__=Ir(this.__actions__);return We.push({func:ve,args:arguments,thisArg:o}),Le.__chain__=ke,Le}return ve.apply(o,to([this.value()],arguments))})}),o}function _R(){return lr._===this&&(lr._=tE),this}function Fd(){}function PR(o){return o=Gt(o),Zt(function(c){return Hp(c,o)})}var NR=fd(Tn),MR=fd(sp),DR=fd(ku);function oh(o){return yd(o)?Lu(xa(o)):c$(o)}function TR(o){return function(c){return o==null?n:No(o,c)}}var FR=cm(),AR=cm(!0);function Ad(){return[]}function kd(){return!1}function kR(){return{}}function LR(){return""}function VR(){return!0}function jR(o,c){if(o=Gt(o),o<1||o>F)return[];var p=V,E=vr(o,V);c=Dt(c),o-=V;for(var A=Hu(E,c);++p<o;)c(p);return A}function HR(o){return qt(o)?Tn(o,xa):Ar(o)?[o]:Ir($m(pn(o)))}function zR(o){var c=++Jx;return pn(o)+c}var BR=js(function(o,c){return o+c},0),WR=vd("ceil"),KR=js(function(o,c){return o/c},1),UR=vd("floor");function qR(o){return o&&o.length?Ds(o,Pr,Qu):n}function GR(o,c){return o&&o.length?Ds(o,Dt(c,2),Qu):n}function YR(o){return dp(o,Pr)}function XR(o,c){return dp(o,Dt(c,2))}function ZR(o){return o&&o.length?Ds(o,Pr,nd):n}function QR(o,c){return o&&o.length?Ds(o,Dt(c,2),nd):n}var JR=js(function(o,c){return o*c},1),e_=vd("round"),t_=js(function(o,c){return o-c},0);function n_(o){return o&&o.length?ju(o,Pr):0}function r_(o,c){return o&&o.length?ju(o,Dt(c,2)):0}return W.after=$I,W.ary=Am,W.assign=f2,W.assignIn=Xm,W.assignInWith=Js,W.assignWith=v2,W.at=g2,W.before=km,W.bind=$d,W.bindAll=yR,W.bindKey=Lm,W.castArray=kI,W.chain=Dm,W.chunk=U$,W.compact=q$,W.concat=G$,W.cond=CR,W.conforms=SR,W.constant=Md,W.countBy=nI,W.create=p2,W.curry=Vm,W.curryRight=jm,W.debounce=Hm,W.defaults=m2,W.defaultsDeep=h2,W.defer=OI,W.delay=II,W.difference=Y$,W.differenceBy=X$,W.differenceWith=Z$,W.drop=Q$,W.dropRight=J$,W.dropRightWhile=eO,W.dropWhile=tO,W.fill=nO,W.filter=aI,W.flatMap=lI,W.flatMapDeep=sI,W.flatMapDepth=cI,W.flatten=_m,W.flattenDeep=rO,W.flattenDepth=aO,W.flip=RI,W.flow=xR,W.flowRight=ER,W.fromPairs=oO,W.functions=E2,W.functionsIn=$2,W.groupBy=uI,W.initial=lO,W.intersection=sO,W.intersectionBy=cO,W.intersectionWith=uO,W.invert=I2,W.invertBy=R2,W.invokeMap=fI,W.iteratee=Dd,W.keyBy=vI,W.keys=ar,W.keysIn=_r,W.map=qs,W.mapKeys=P2,W.mapValues=N2,W.matches=$R,W.matchesProperty=OR,W.memoize=Ys,W.merge=M2,W.mergeWith=Zm,W.method=IR,W.methodOf=RR,W.mixin=Td,W.negate=Xs,W.nthArg=PR,W.omit=D2,W.omitBy=T2,W.once=_I,W.orderBy=gI,W.over=NR,W.overArgs=PI,W.overEvery=MR,W.overSome=DR,W.partial=Od,W.partialRight=zm,W.partition=pI,W.pick=F2,W.pickBy=Qm,W.property=oh,W.propertyOf=TR,W.pull=gO,W.pullAll=Nm,W.pullAllBy=pO,W.pullAllWith=mO,W.pullAt=hO,W.range=FR,W.rangeRight=AR,W.rearg=NI,W.reject=bI,W.remove=bO,W.rest=MI,W.reverse=xd,W.sampleSize=CI,W.set=k2,W.setWith=L2,W.shuffle=SI,W.slice=yO,W.sortBy=EI,W.sortedUniq=OO,W.sortedUniqBy=IO,W.split=lR,W.spread=DI,W.tail=RO,W.take=_O,W.takeRight=PO,W.takeRightWhile=NO,W.takeWhile=MO,W.tap=qO,W.throttle=TI,W.thru=Us,W.toArray=qm,W.toPairs=Jm,W.toPairsIn=eh,W.toPath=HR,W.toPlainObject=Ym,W.transform=V2,W.unary=FI,W.union=DO,W.unionBy=TO,W.unionWith=FO,W.uniq=AO,W.uniqBy=kO,W.uniqWith=LO,W.unset=j2,W.unzip=Ed,W.unzipWith=Mm,W.update=H2,W.updateWith=z2,W.values=bi,W.valuesIn=B2,W.without=VO,W.words=rh,W.wrap=AI,W.xor=jO,W.xorBy=HO,W.xorWith=zO,W.zip=BO,W.zipObject=WO,W.zipObjectDeep=KO,W.zipWith=UO,W.entries=Jm,W.entriesIn=eh,W.extend=Xm,W.extendWith=Js,Td(W,W),W.add=BR,W.attempt=ah,W.camelCase=q2,W.capitalize=th,W.ceil=WR,W.clamp=W2,W.clone=LI,W.cloneDeep=jI,W.cloneDeepWith=HI,W.cloneWith=VI,W.conformsTo=zI,W.deburr=nh,W.defaultTo=wR,W.divide=KR,W.endsWith=G2,W.eq=sa,W.escape=Y2,W.escapeRegExp=X2,W.every=rI,W.find=oI,W.findIndex=Im,W.findKey=b2,W.findLast=iI,W.findLastIndex=Rm,W.findLastKey=y2,W.floor=UR,W.forEach=Tm,W.forEachRight=Fm,W.forIn=C2,W.forInRight=S2,W.forOwn=w2,W.forOwnRight=x2,W.get=_d,W.gt=BI,W.gte=WI,W.has=O2,W.hasIn=Pd,W.head=Pm,W.identity=Pr,W.includes=dI,W.indexOf=iO,W.inRange=K2,W.invoke=_2,W.isArguments=To,W.isArray=qt,W.isArrayBuffer=KI,W.isArrayLike=Rr,W.isArrayLikeObject=Wn,W.isBoolean=UI,W.isBuffer=so,W.isDate=qI,W.isElement=GI,W.isEmpty=YI,W.isEqual=XI,W.isEqualWith=ZI,W.isError=Id,W.isFinite=QI,W.isFunction=Aa,W.isInteger=Bm,W.isLength=Zs,W.isMap=Wm,W.isMatch=JI,W.isMatchWith=e2,W.isNaN=t2,W.isNative=n2,W.isNil=a2,W.isNull=r2,W.isNumber=Km,W.isObject=kn,W.isObjectLike=jn,W.isPlainObject=pl,W.isRegExp=Rd,W.isSafeInteger=o2,W.isSet=Um,W.isString=Qs,W.isSymbol=Ar,W.isTypedArray=hi,W.isUndefined=i2,W.isWeakMap=l2,W.isWeakSet=s2,W.join=dO,W.kebabCase=Z2,W.last=Zr,W.lastIndexOf=fO,W.lowerCase=Q2,W.lowerFirst=J2,W.lt=c2,W.lte=u2,W.max=qR,W.maxBy=GR,W.mean=YR,W.meanBy=XR,W.min=ZR,W.minBy=QR,W.stubArray=Ad,W.stubFalse=kd,W.stubObject=kR,W.stubString=LR,W.stubTrue=VR,W.multiply=JR,W.nth=vO,W.noConflict=_R,W.noop=Fd,W.now=Gs,W.pad=eR,W.padEnd=tR,W.padStart=nR,W.parseInt=rR,W.random=U2,W.reduce=mI,W.reduceRight=hI,W.repeat=aR,W.replace=oR,W.result=A2,W.round=e_,W.runInContext=de,W.sample=yI,W.size=wI,W.snakeCase=iR,W.some=xI,W.sortedIndex=CO,W.sortedIndexBy=SO,W.sortedIndexOf=wO,W.sortedLastIndex=xO,W.sortedLastIndexBy=EO,W.sortedLastIndexOf=$O,W.startCase=sR,W.startsWith=cR,W.subtract=t_,W.sum=n_,W.sumBy=r_,W.template=uR,W.times=jR,W.toFinite=ka,W.toInteger=Gt,W.toLength=Gm,W.toLower=dR,W.toNumber=Qr,W.toSafeInteger=d2,W.toString=pn,W.toUpper=fR,W.trim=vR,W.trimEnd=gR,W.trimStart=pR,W.truncate=mR,W.unescape=hR,W.uniqueId=zR,W.upperCase=bR,W.upperFirst=Nd,W.each=Tm,W.eachRight=Fm,W.first=Pm,Td(W,function(){var o={};return Sa(W,function(c,p){yn.call(W.prototype,p)||(o[p]=c)}),o}(),{chain:!1}),W.VERSION=r,Ur(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){W[o].placeholder=W}),Ur(["drop","take"],function(o,c){en.prototype[o]=function(p){p=p===n?1:Jn(Gt(p),0);var E=this.__filtered__&&!c?new en(this):this.clone();return E.__filtered__?E.__takeCount__=vr(p,E.__takeCount__):E.__views__.push({size:vr(p,V),type:o+(E.__dir__<0?"Right":"")}),E},en.prototype[o+"Right"]=function(p){return this.reverse()[o](p).reverse()}}),Ur(["filter","map","takeWhile"],function(o,c){var p=c+1,E=p==D||p==T;en.prototype[o]=function(A){var q=this.clone();return q.__iteratees__.push({iteratee:Dt(A,3),type:p}),q.__filtered__=q.__filtered__||E,q}}),Ur(["head","last"],function(o,c){var p="take"+(c?"Right":"");en.prototype[o]=function(){return this[p](1).value()[0]}}),Ur(["initial","tail"],function(o,c){var p="drop"+(c?"":"Right");en.prototype[o]=function(){return this.__filtered__?new en(this):this[p](1)}}),en.prototype.compact=function(){return this.filter(Pr)},en.prototype.find=function(o){return this.filter(o).head()},en.prototype.findLast=function(o){return this.reverse().find(o)},en.prototype.invokeMap=Zt(function(o,c){return typeof o=="function"?new en(this):this.map(function(p){return cl(p,o,c)})}),en.prototype.reject=function(o){return this.filter(Xs(Dt(o)))},en.prototype.slice=function(o,c){o=Gt(o);var p=this;return p.__filtered__&&(o>0||c<0)?new en(p):(o<0?p=p.takeRight(-o):o&&(p=p.drop(o)),c!==n&&(c=Gt(c),p=c<0?p.dropRight(-c):p.take(c-o)),p)},en.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},en.prototype.toArray=function(){return this.take(V)},Sa(en.prototype,function(o,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),E=/^(?:head|last)$/.test(c),A=W[E?"take"+(c=="last"?"Right":""):c],q=E||/^find/.test(c);A&&(W.prototype[c]=function(){var ne=this.__wrapped__,se=E?[1]:arguments,ve=ne instanceof en,ke=se[0],Le=ve||qt(ne),We=function(Qt){var rn=A.apply(W,to([Qt],se));return E&&st?rn[0]:rn};Le&&p&&typeof ke=="function"&&ke.length!=1&&(ve=Le=!1);var st=this.__chain__,xt=!!this.__actions__.length,Ft=q&&!st,Yt=ve&&!xt;if(!q&&Le){ne=Yt?ne:new en(this);var At=o.apply(ne,se);return At.__actions__.push({func:Us,args:[We],thisArg:n}),new Gr(At,st)}return Ft&&Yt?o.apply(this,se):(At=this.thru(We),Ft?E?At.value()[0]:At.value():At)})}),Ur(["pop","push","shift","sort","splice","unshift"],function(o){var c=bs[o],p=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",E=/^(?:pop|shift)$/.test(o);W.prototype[o]=function(){var A=arguments;if(E&&!this.__chain__){var q=this.value();return c.apply(qt(q)?q:[],A)}return this[p](function(ne){return c.apply(qt(ne)?ne:[],A)})}}),Sa(en.prototype,function(o,c){var p=W[c];if(p){var E=p.name+"";yn.call(fi,E)||(fi[E]=[]),fi[E].push({name:c,func:p})}}),fi[Vs(n,S).name]=[{name:"wrapper",func:n}],en.prototype.clone=hE,en.prototype.reverse=bE,en.prototype.value=yE,W.prototype.at=GO,W.prototype.chain=YO,W.prototype.commit=XO,W.prototype.next=ZO,W.prototype.plant=JO,W.prototype.reverse=eI,W.prototype.toJSON=W.prototype.valueOf=W.prototype.value=tI,W.prototype.first=W.prototype.head,nl&&(W.prototype[nl]=QO),W},ci=Xx();Oo?((Oo.exports=ci)._=ci,Du._=ci):lr._=ci}).call(pr)})(au,au.exports);var Pz=au.exports;const Nz=e=>{let{request:t,title:n,disabledValue:r,callError:a,...i}=e;const[s,l]=Y.useState(!1),[u,f]=Y.useState([]);Y.useEffect(()=>{v()},[]);const v=async()=>{if(t&&typeof t=="function"){var g;const m=await t();if(m.code>0){a&&typeof a=="function"&&a(m.message);return}let b=yx(((g=m.data)===null||g===void 0?void 0:g.list)||m.data||[],"id",n||"title",i.parentId||"parentId","children",0,r);b=[{value:0,title:"根节点",children:b}],i.treeData=b,f(b)}i.treeData&&f(i.treeData),l(!0)};return Et.jsx(br,{...i,children:s&&Et.jsx(Eo,{...i,treeData:u,treeDefaultExpandAll:!0,style:{width:"100%"}})})},vs=e=>{let{request:t,option_label:n="label",option_value:r="id",disabledValue:a,callError:i,options:s,...l}=e;const[u,f]=Y.useState([]);Y.useEffect(()=>{v()},[]);const v=async()=>{if(t&&typeof t=="function"){var g;const m=await t();if(m.code>0){i&&typeof i=="function"&&i(m.message);return}let b=((g=m.data)===null||g===void 0?void 0:g.list)||m.data;Array.isArray(b)&&b.length>0&&f(b.map(C=>({label:C[n],value:C[r]})))}s&&s.length>0&&f(s)};return Et.jsx(br,{...l,children:Et.jsx(ei,{...l,options:u,style:{width:"100%"}})})},Mz=e=>{let{...t}=e;return Et.jsx(vs,{...t,mode:"single"})},Dz=e=>{let{onChange:t,value:n,...r}=e;const[a,i]=Y.useState([]);return Y.useEffect(()=>{if(typeof n=="string")try{n=JSON.parse(n),t(n)}catch{}i(n)},[n]),Et.jsx(vs,{...r,onChange:t,mode:"multiple",value:a})},Tz=e=>{let{onChange:t,value:n,...r}=e;const[a,i]=Y.useState("");Y.useEffect(()=>{if(n)try{n=JSON.parse(n),i(n.label)}catch{}},[n]);const s=(l,u)=>{t&&typeof t=="function"&&t(JSON.stringify(u)),i(u.label)};return Et.jsx(vs,{...r,onChange:s,value:a,mode:"single"})},Fz=e=>{let{onChange:t,value:n,...r}=e;const[a,i]=Y.useState([]);Y.useEffect(()=>{if(n)try{n=JSON.parse(n),Array.isArray(n)&&i(n)}catch{}},[n]);const s=(l,u)=>{t&&typeof t=="function"&&t(JSON.stringify(u)),u.map(f=>f.label),i(u)};return Et.jsx(vs,{...r,onChange:s,value:a,mode:"multiple"})},Az=Y.forwardRef((e,t)=>{let{value:n,onChange:r,...a}=e;const i=Y.useRef(0),s=()=>{i.current++,r(i.current)};return Et.jsxs(br,{...a,children:[Et.jsxs("div",{ref:t,children:["form-set-value:",n]}),Et.jsx(Ga,{onClick:s,children:"test"})]})}),kz=e=>{let{children:t,layout:n}=e;n=n||"1";const r=s=>{const l=s.split(",").map(Number),u=24;return l.map(f=>f/l.reduce((v,g)=>v+g)*u)},a=Y.useMemo(()=>r(n),[n]);console.log("colSpans",a);const i=Y.useMemo(()=>Y.Children.toArray(t).map((s,l)=>{const u=s.props,f=(u==null?void 0:u.componentId)||(u==null?void 0:u.__id);return f?(a==null?void 0:a[l])&&Et.jsx(Vi,{span:a[l],children:Et.jsx(na.Item,{style:{marginBottom:0},label:"",name:f,rules:[{required:u.isRequired,message:"".concat(u.title,"不能为空!")}],children:s},"".concat(f,"-form-item"))},l):(a==null?void 0:a[l])&&Et.jsx(Vi,{span:a[l],children:s},l)}),[t,a]);return Et.jsx(Iu,{gutter:24,children:i})},Lz=e=>{let{title:t}=e;return t?Et.jsx("div",{className:"fh-11 border-b fflex fitems-center text-lg font-medium mb-5 ",children:t}):null};function Vz(e,t){const n=[];let r=[];const a=(i,s)=>{const l=i-s.length;s.push(...new Array(l).fill(Y.createElement("div")))};for(const i of e){const{_componentName:s}=(i==null?void 0:i.props)||{};s&&s.startsWith("Layout")?(r.length>0&&(a(t,r),n.push(r),r=[]),n.push([i])):(r.push(i),r.length===t&&(n.push(r),r=[]))}return r.length>0&&(a(t,r),n.push(r)),n}const Jg=Y.forwardRef((e,t)=>{let{cols:n=1,children:r}=e;const[a]=na.useForm(),[i,s]=Y.useState(null),l=Y.useRef(null);Y.useImperativeHandle(t,()=>({formRef:a,initializeFieldVisibility:f}),[]),Y.useEffect(()=>{u(),s(m())},[r,n]);const u=()=>{l.current=new Map;const b=Y.Children.toArray(r);b.forEach(C=>{const{componentId:y,__id:h,...S}=C.props,w=y||h;l.current.set(w,{children:b.filter(x=>{var $;return x.props.__withId===w||(($=x.props.__withIds)===null||$===void 0?void 0:$.includes(w))}),show:!0})}),f()},f=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const C=a.getFieldsValue();for(let y of l.current.keys())v(y,C);b&&s(m())},v=(b,C)=>{let y=!1;return l.current.has(b)&&l.current.get(b).children.forEach(S=>{if(S.props.__withFunc&&typeof S.props.__withFunc=="function"){const w=S.props.__withFunc(C),x=S.props.componentId||S.props.__id;if(l.current.has(x)){const $=l.current.get(x);$.show!==w&&($.show=w,l.current.set(x,$),y=!0)}}}),y},g=Pz.debounce((b,C)=>{const y=a.getFieldsValue();let h=!1;b.forEach(S=>{S.name&&S.name.length>0&&(h=v(S.name[0],y))}),h&&s(m())},100),m=()=>{const b=Y.Children.toArray(r);return Vz(b.filter(y=>{const h=y.props.componentId||y.props.__id;return l.current.has(h)&&l.current.get(h).show}),n).map((y,h)=>Et.jsx(Iu,{gutter:[24,24],children:y.map((S,w)=>{const{componentId:x,__id:$,_componentName:I,...O}=S.props,R=x||$,_=I&&I.startsWith("Layout");return Et.jsx(Vi,{span:_?24:24/y.length,style:{marginBottom:0},children:_?S:Et.jsx(na.Item,{style:{marginBottom:0},label:"",name:R,rules:[{required:O.isRequired,message:"".concat(O.title,"不能为空!")}],children:S})},R||"col-".concat(w))})},"row-".concat(h)))};return Et.jsx(na,{form:a,className:"form-container fp-6 fw-full fh-full box-border overflow-auto",onFieldsChange:g,children:i})});function jz(e){return Y.forwardRef((t,n)=>Et.jsx(e,{...t,ref:n,forwardedRef:n}))}class eB extends Y.PureComponent{render(){const{forwardedRef:t,...n}=this.props;return Et.jsx(Jg,{...n,ref:t})}}const Hz=jz(e=>{let{forwardedRef:t,...n}=e;return Et.jsx(Jg,{...n,ref:t})}),zz=e=>{let{request:t,value:n,onChange:r,callError:a,disabledValue:i,addRoot:s=!0,title:l,...u}=e;const[f,v]=Y.useState(!1),[g,m]=Y.useState([]);Y.useEffect(()=>{b()},[]),Y.useEffect(()=>{console.log("CheckboxTree value ",n),typeof n=="string"&&(n=JSON.parse(n)),Array.isArray(n)&&S(n)},[n]);const b=async()=>{if(t&&typeof t=="function"){var P;const M=await t();if(M.code>0){a&&typeof a=="function"&&a(M.message);return}let k=yx(((P=M.data)===null||P===void 0?void 0:P.list)||M.data||[],"id",l||"title",(u==null?void 0:u.parentId)||"parentId","children",0,i);s&&(k=[{value:0,title:"根节点",children:k}]),u.treeData=k,console.log("treeData",k),m(k)}u.treeData&&m(u.treeData),v(!0)},[C,y]=Y.useState([]),[h,S]=Y.useState([]),[w,x]=Y.useState([]),[$,I]=Y.useState(!0),O=P=>{console.log("onExpand",P),y(P),I(!1)},R=P=>{console.log("onCheck",P),S(P),r(P)},_=(P,M)=>{console.log("onSelect",M),x(P)};return Et.jsx(br,{...u,children:Et.jsx(qg,{checkable:!0,onExpand:O,onCheck:R,onSelect:_,expandedKeys:C,autoExpandParent:$,checkedKeys:h,selectedKeys:w,treeData:g})})},Bz=e=>Et.jsx(br,{...e,children:Et.jsx(cs,{...e})}),Wz=e=>Et.jsx(br,{...e,children:Et.jsx(cs.Group,{...e})}),Kz=e=>Et.jsx(br,{...e,children:Et.jsx(Ou.Group,{...e})}),Uz=e=>{let{value:t,maxLen:n,onChange:r,...a}=e;Y.useEffect(()=>{t&&s(t)},[t]),n=n||9;const[i,s]=Y.useState([]),l=u=>{let{fileList:f}=u;console.log(f),s(f),r(i.map(v=>({uid:v.uid,name:v.name,status:v.status,url:v.url||""})))};return Et.jsx(br,{...a,children:Et.jsx(Nu,{...a,listType:"text",onChange:l,defaultFileList:i,children:Et.jsx(Ga,{icon:Et.jsx(bx,{}),children:"点击上传文件"})})})},qz=e=>{let{maxLen:t,value:n,onChange:r,...a}=e;Y.useEffect(()=>{n&&s(n)},[n]),t=t||9;const[i,s]=Y.useState([]),[l,u]=Y.useState(""),[f,v]=Y.useState(!1),g=async C=>{!C.url&&!C.preview&&(C.preview=await getBase64(C.originFileObj)),u(C.url||C.preview),v(!0)},m=Et.jsxs("button",{style:{border:0,background:"none"},type:"button",children:[Et.jsx(hx,{}),Et.jsx("div",{style:{marginTop:8},children:"点击上传"})]}),b=C=>{let{fileList:y}=C;s(y),r(i.map(h=>({uid:h.uid,name:h.name,status:h.status,url:h.url||""})))};return Et.jsxs(br,{...a,children:[Et.jsx(Nu,{...a,listType:"picture-card",fileList:i,onPreview:g,onChange:b,children:i.length>=8?null:m}),l&&Et.jsx(Image,{wrapperStyle:{display:"none"},preview:{visible:f,onVisibleChange:C=>v(C),afterOpenChange:C=>!C&&u("")},src:l})]})},Gz=e=>{let{value:t,...n}=e;const[r,a]=Y.useState(!1);return Y.useEffect(()=>{let i=!1;typeof t=="boolean"?i=t:typeof t=="string"?i=t=="1"||t=="true":typeof t=="number"&&(i=t==1),a(i),n==null||n.onChange(i)},[t]),Et.jsx(br,{...n,children:Et.jsx(Hg,{...n,value:r})})},Yz=e=>{let{datetype:t,value:n,onChange:r,...a}=e;t=t||"date";const[i,s]=Y.useState(a==null?void 0:a.picker),[l,u]=Y.useState(a==null?void 0:a.format),[f,v]=Y.useState(null),[g,m]=Y.useState(!1),[b,C]=Y.useState(!1);Y.useEffect(()=>{if(n){const h=xr(n);v(h)}},[n,l,i]);const y=(h,S)=>{r(S)};return Y.useEffect(()=>{switch(s("date"),m(!1),t){case"date":s("date"),u("YYYY-MM-DD"),C(!1);break;case"datetime":m(!0),s("datetime"),u("YYYY-MM-DD HH:mm:ss"),C(!0);break;case"month":s("month"),C(!1);break;case"year":s("year"),C(!1);break}},[t]),Et.jsx(br,{...a,children:Et.jsx(Yi,{...a,picker:i,format:l,style:{width:"100%"},onChange:y,value:f,showTime:g,needConfirm:b})})},Xz=e=>Et.jsx("div",{children:"sdfsdfsdf"}),Zz={Input:pj,TextArea:hj,Password:bj,Search:yj,TreeSelect:Nz,Select:vs,WithSingleSelect:Tz,WithMultipleSelect:Fz,SingleSelect:Mz,MultipleSelect:Dz,CodeMachine:mj,Checkbox:Bz,CheckboxTree:zz,CheckboxGroup:Wz,RadioGroup:Kz,UploadFile:Uz,UploadImage:qz,Switch:Gz,DatePicker:Yz,Custom:Az},Qz={FormRow:kz,FormGroupTitle:Lz},Jz={OptionSetter:Xz};exports.Field=Zz;exports.FormContainer=Jg;exports.FormContainerWrapper=Hz;exports.Layout=Qz;exports.Setter=Jz;
|
|
383
|
+
}`;var Yt=ah(function(){return cn(q,xt+"return "+We).apply(n,ne)});if(Yt.source=We,Id(Yt))throw Yt;return Yt}function dR(o){return pn(o).toLowerCase()}function fR(o){return pn(o).toUpperCase()}function vR(o,c,p){if(o=pn(o),o&&(p||c===n))return vp(o);if(!o||!(c=Fr(c)))return o;var E=ia(o),A=ia(c),q=gp(E,A),ne=pp(E,A)+1;return lo(E,q,ne).join("")}function gR(o,c,p){if(o=pn(o),o&&(p||c===n))return o.slice(0,hp(o)+1);if(!o||!(c=Fr(c)))return o;var E=ia(o),A=pp(E,ia(c))+1;return lo(E,0,A).join("")}function pR(o,c,p){if(o=pn(o),o&&(p||c===n))return o.replace(nt,"");if(!o||!(c=Fr(c)))return o;var E=ia(o),A=gp(E,ia(c));return lo(E,A).join("")}function mR(o,c){var p=M,E=k;if(kn(c)){var A="separator"in c?c.separator:A;p="length"in c?Gt(c.length):p,E="omission"in c?Fr(c.omission):E}o=pn(o);var q=o.length;if(li(o)){var ne=ia(o);q=ne.length}if(p>=q)return o;var se=p-si(E);if(se<1)return E;var ve=ne?lo(ne,0,se).join(""):o.slice(0,se);if(A===n)return ve+E;if(ne&&(se+=ve.length-se),Rd(A)){if(o.slice(se).search(A)){var ke,Le=ve;for(A.global||(A=Wu(A.source,pn(bt.exec(A))+"g")),A.lastIndex=0;ke=A.exec(Le);)var We=ke.index;ve=ve.slice(0,We===n?se:We)}}else if(o.indexOf(Fr(A),se)!=se){var st=ve.lastIndexOf(A);st>-1&&(ve=ve.slice(0,st))}return ve+E}function hR(o){return o=pn(o),o&&Tt.test(o)?o.replace(ft,Ux):o}var bR=pi(function(o,c,p){return o+(p?" ":"")+c.toUpperCase()}),Nd=om("toUpperCase");function rh(o,c,p){return o=pn(o),c=p?n:c,c===n?Hx(o)?Yx(o):Mx(o):o.match(c)||[]}var ah=Zt(function(o,c){try{return Dr(o,n,c)}catch(p){return Id(p)?p:new Bt(p)}}),yR=Ta(function(o,c){return Ur(c,function(p){p=xa(p),Ma(o,p,$d(o[p],o))}),o});function CR(o){var c=o==null?0:o.length,p=Dt();return o=c?Tn(o,function(E){if(typeof E[1]!="function")throw new qr(s);return[p(E[0]),E[1]]}):[],Zt(function(E){for(var A=-1;++A<c;){var q=o[A];if(Dr(q[0],this,E))return Dr(q[1],this,E)}})}function SR(o){return UE(Yr(o,g))}function Md(o){return function(){return o}}function wR(o,c){return o==null||o!==o?c:o}var xR=lm(),ER=lm(!0);function Pr(o){return o}function Dd(o){return kp(typeof o=="function"?o:Yr(o,g))}function $R(o){return Vp(Yr(o,g))}function OR(o,c){return jp(o,Yr(c,g))}var IR=Zt(function(o,c){return function(p){return cl(p,o,c)}}),RR=Zt(function(o,c){return function(p){return cl(o,p,c)}});function Td(o,c,p){var E=ar(c),A=Ts(c,E);p==null&&!(kn(c)&&(A.length||!E.length))&&(p=c,c=o,o=this,A=Ts(c,ar(c)));var q=!(kn(p)&&"chain"in p)||!!p.chain,ne=Aa(o);return Ur(A,function(se){var ve=c[se];o[se]=ve,ne&&(o.prototype[se]=function(){var ke=this.__chain__;if(q||ke){var Le=o(this.__wrapped__),We=Le.__actions__=Ir(this.__actions__);return We.push({func:ve,args:arguments,thisArg:o}),Le.__chain__=ke,Le}return ve.apply(o,to([this.value()],arguments))})}),o}function _R(){return lr._===this&&(lr._=tE),this}function Fd(){}function PR(o){return o=Gt(o),Zt(function(c){return Hp(c,o)})}var NR=fd(Tn),MR=fd(sp),DR=fd(ku);function oh(o){return yd(o)?Lu(xa(o)):c$(o)}function TR(o){return function(c){return o==null?n:No(o,c)}}var FR=cm(),AR=cm(!0);function Ad(){return[]}function kd(){return!1}function kR(){return{}}function LR(){return""}function VR(){return!0}function jR(o,c){if(o=Gt(o),o<1||o>F)return[];var p=V,E=vr(o,V);c=Dt(c),o-=V;for(var A=Hu(E,c);++p<o;)c(p);return A}function HR(o){return qt(o)?Tn(o,xa):Ar(o)?[o]:Ir($m(pn(o)))}function zR(o){var c=++Jx;return pn(o)+c}var BR=js(function(o,c){return o+c},0),WR=vd("ceil"),KR=js(function(o,c){return o/c},1),UR=vd("floor");function qR(o){return o&&o.length?Ds(o,Pr,Qu):n}function GR(o,c){return o&&o.length?Ds(o,Dt(c,2),Qu):n}function YR(o){return dp(o,Pr)}function XR(o,c){return dp(o,Dt(c,2))}function ZR(o){return o&&o.length?Ds(o,Pr,nd):n}function QR(o,c){return o&&o.length?Ds(o,Dt(c,2),nd):n}var JR=js(function(o,c){return o*c},1),e_=vd("round"),t_=js(function(o,c){return o-c},0);function n_(o){return o&&o.length?ju(o,Pr):0}function r_(o,c){return o&&o.length?ju(o,Dt(c,2)):0}return W.after=$I,W.ary=Am,W.assign=f2,W.assignIn=Xm,W.assignInWith=Js,W.assignWith=v2,W.at=g2,W.before=km,W.bind=$d,W.bindAll=yR,W.bindKey=Lm,W.castArray=kI,W.chain=Dm,W.chunk=U$,W.compact=q$,W.concat=G$,W.cond=CR,W.conforms=SR,W.constant=Md,W.countBy=nI,W.create=p2,W.curry=Vm,W.curryRight=jm,W.debounce=Hm,W.defaults=m2,W.defaultsDeep=h2,W.defer=OI,W.delay=II,W.difference=Y$,W.differenceBy=X$,W.differenceWith=Z$,W.drop=Q$,W.dropRight=J$,W.dropRightWhile=eO,W.dropWhile=tO,W.fill=nO,W.filter=aI,W.flatMap=lI,W.flatMapDeep=sI,W.flatMapDepth=cI,W.flatten=_m,W.flattenDeep=rO,W.flattenDepth=aO,W.flip=RI,W.flow=xR,W.flowRight=ER,W.fromPairs=oO,W.functions=E2,W.functionsIn=$2,W.groupBy=uI,W.initial=lO,W.intersection=sO,W.intersectionBy=cO,W.intersectionWith=uO,W.invert=I2,W.invertBy=R2,W.invokeMap=fI,W.iteratee=Dd,W.keyBy=vI,W.keys=ar,W.keysIn=_r,W.map=qs,W.mapKeys=P2,W.mapValues=N2,W.matches=$R,W.matchesProperty=OR,W.memoize=Ys,W.merge=M2,W.mergeWith=Zm,W.method=IR,W.methodOf=RR,W.mixin=Td,W.negate=Xs,W.nthArg=PR,W.omit=D2,W.omitBy=T2,W.once=_I,W.orderBy=gI,W.over=NR,W.overArgs=PI,W.overEvery=MR,W.overSome=DR,W.partial=Od,W.partialRight=zm,W.partition=pI,W.pick=F2,W.pickBy=Qm,W.property=oh,W.propertyOf=TR,W.pull=gO,W.pullAll=Nm,W.pullAllBy=pO,W.pullAllWith=mO,W.pullAt=hO,W.range=FR,W.rangeRight=AR,W.rearg=NI,W.reject=bI,W.remove=bO,W.rest=MI,W.reverse=xd,W.sampleSize=CI,W.set=k2,W.setWith=L2,W.shuffle=SI,W.slice=yO,W.sortBy=EI,W.sortedUniq=OO,W.sortedUniqBy=IO,W.split=lR,W.spread=DI,W.tail=RO,W.take=_O,W.takeRight=PO,W.takeRightWhile=NO,W.takeWhile=MO,W.tap=qO,W.throttle=TI,W.thru=Us,W.toArray=qm,W.toPairs=Jm,W.toPairsIn=eh,W.toPath=HR,W.toPlainObject=Ym,W.transform=V2,W.unary=FI,W.union=DO,W.unionBy=TO,W.unionWith=FO,W.uniq=AO,W.uniqBy=kO,W.uniqWith=LO,W.unset=j2,W.unzip=Ed,W.unzipWith=Mm,W.update=H2,W.updateWith=z2,W.values=bi,W.valuesIn=B2,W.without=VO,W.words=rh,W.wrap=AI,W.xor=jO,W.xorBy=HO,W.xorWith=zO,W.zip=BO,W.zipObject=WO,W.zipObjectDeep=KO,W.zipWith=UO,W.entries=Jm,W.entriesIn=eh,W.extend=Xm,W.extendWith=Js,Td(W,W),W.add=BR,W.attempt=ah,W.camelCase=q2,W.capitalize=th,W.ceil=WR,W.clamp=W2,W.clone=LI,W.cloneDeep=jI,W.cloneDeepWith=HI,W.cloneWith=VI,W.conformsTo=zI,W.deburr=nh,W.defaultTo=wR,W.divide=KR,W.endsWith=G2,W.eq=sa,W.escape=Y2,W.escapeRegExp=X2,W.every=rI,W.find=oI,W.findIndex=Im,W.findKey=b2,W.findLast=iI,W.findLastIndex=Rm,W.findLastKey=y2,W.floor=UR,W.forEach=Tm,W.forEachRight=Fm,W.forIn=C2,W.forInRight=S2,W.forOwn=w2,W.forOwnRight=x2,W.get=_d,W.gt=BI,W.gte=WI,W.has=O2,W.hasIn=Pd,W.head=Pm,W.identity=Pr,W.includes=dI,W.indexOf=iO,W.inRange=K2,W.invoke=_2,W.isArguments=To,W.isArray=qt,W.isArrayBuffer=KI,W.isArrayLike=Rr,W.isArrayLikeObject=Wn,W.isBoolean=UI,W.isBuffer=so,W.isDate=qI,W.isElement=GI,W.isEmpty=YI,W.isEqual=XI,W.isEqualWith=ZI,W.isError=Id,W.isFinite=QI,W.isFunction=Aa,W.isInteger=Bm,W.isLength=Zs,W.isMap=Wm,W.isMatch=JI,W.isMatchWith=e2,W.isNaN=t2,W.isNative=n2,W.isNil=a2,W.isNull=r2,W.isNumber=Km,W.isObject=kn,W.isObjectLike=jn,W.isPlainObject=pl,W.isRegExp=Rd,W.isSafeInteger=o2,W.isSet=Um,W.isString=Qs,W.isSymbol=Ar,W.isTypedArray=hi,W.isUndefined=i2,W.isWeakMap=l2,W.isWeakSet=s2,W.join=dO,W.kebabCase=Z2,W.last=Zr,W.lastIndexOf=fO,W.lowerCase=Q2,W.lowerFirst=J2,W.lt=c2,W.lte=u2,W.max=qR,W.maxBy=GR,W.mean=YR,W.meanBy=XR,W.min=ZR,W.minBy=QR,W.stubArray=Ad,W.stubFalse=kd,W.stubObject=kR,W.stubString=LR,W.stubTrue=VR,W.multiply=JR,W.nth=vO,W.noConflict=_R,W.noop=Fd,W.now=Gs,W.pad=eR,W.padEnd=tR,W.padStart=nR,W.parseInt=rR,W.random=U2,W.reduce=mI,W.reduceRight=hI,W.repeat=aR,W.replace=oR,W.result=A2,W.round=e_,W.runInContext=de,W.sample=yI,W.size=wI,W.snakeCase=iR,W.some=xI,W.sortedIndex=CO,W.sortedIndexBy=SO,W.sortedIndexOf=wO,W.sortedLastIndex=xO,W.sortedLastIndexBy=EO,W.sortedLastIndexOf=$O,W.startCase=sR,W.startsWith=cR,W.subtract=t_,W.sum=n_,W.sumBy=r_,W.template=uR,W.times=jR,W.toFinite=ka,W.toInteger=Gt,W.toLength=Gm,W.toLower=dR,W.toNumber=Qr,W.toSafeInteger=d2,W.toString=pn,W.toUpper=fR,W.trim=vR,W.trimEnd=gR,W.trimStart=pR,W.truncate=mR,W.unescape=hR,W.uniqueId=zR,W.upperCase=bR,W.upperFirst=Nd,W.each=Tm,W.eachRight=Fm,W.first=Pm,Td(W,function(){var o={};return Sa(W,function(c,p){yn.call(W.prototype,p)||(o[p]=c)}),o}(),{chain:!1}),W.VERSION=r,Ur(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){W[o].placeholder=W}),Ur(["drop","take"],function(o,c){en.prototype[o]=function(p){p=p===n?1:Jn(Gt(p),0);var E=this.__filtered__&&!c?new en(this):this.clone();return E.__filtered__?E.__takeCount__=vr(p,E.__takeCount__):E.__views__.push({size:vr(p,V),type:o+(E.__dir__<0?"Right":"")}),E},en.prototype[o+"Right"]=function(p){return this.reverse()[o](p).reverse()}}),Ur(["filter","map","takeWhile"],function(o,c){var p=c+1,E=p==D||p==T;en.prototype[o]=function(A){var q=this.clone();return q.__iteratees__.push({iteratee:Dt(A,3),type:p}),q.__filtered__=q.__filtered__||E,q}}),Ur(["head","last"],function(o,c){var p="take"+(c?"Right":"");en.prototype[o]=function(){return this[p](1).value()[0]}}),Ur(["initial","tail"],function(o,c){var p="drop"+(c?"":"Right");en.prototype[o]=function(){return this.__filtered__?new en(this):this[p](1)}}),en.prototype.compact=function(){return this.filter(Pr)},en.prototype.find=function(o){return this.filter(o).head()},en.prototype.findLast=function(o){return this.reverse().find(o)},en.prototype.invokeMap=Zt(function(o,c){return typeof o=="function"?new en(this):this.map(function(p){return cl(p,o,c)})}),en.prototype.reject=function(o){return this.filter(Xs(Dt(o)))},en.prototype.slice=function(o,c){o=Gt(o);var p=this;return p.__filtered__&&(o>0||c<0)?new en(p):(o<0?p=p.takeRight(-o):o&&(p=p.drop(o)),c!==n&&(c=Gt(c),p=c<0?p.dropRight(-c):p.take(c-o)),p)},en.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},en.prototype.toArray=function(){return this.take(V)},Sa(en.prototype,function(o,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),E=/^(?:head|last)$/.test(c),A=W[E?"take"+(c=="last"?"Right":""):c],q=E||/^find/.test(c);A&&(W.prototype[c]=function(){var ne=this.__wrapped__,se=E?[1]:arguments,ve=ne instanceof en,ke=se[0],Le=ve||qt(ne),We=function(Qt){var rn=A.apply(W,to([Qt],se));return E&&st?rn[0]:rn};Le&&p&&typeof ke=="function"&&ke.length!=1&&(ve=Le=!1);var st=this.__chain__,xt=!!this.__actions__.length,Ft=q&&!st,Yt=ve&&!xt;if(!q&&Le){ne=Yt?ne:new en(this);var At=o.apply(ne,se);return At.__actions__.push({func:Us,args:[We],thisArg:n}),new Gr(At,st)}return Ft&&Yt?o.apply(this,se):(At=this.thru(We),Ft?E?At.value()[0]:At.value():At)})}),Ur(["pop","push","shift","sort","splice","unshift"],function(o){var c=bs[o],p=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",E=/^(?:pop|shift)$/.test(o);W.prototype[o]=function(){var A=arguments;if(E&&!this.__chain__){var q=this.value();return c.apply(qt(q)?q:[],A)}return this[p](function(ne){return c.apply(qt(ne)?ne:[],A)})}}),Sa(en.prototype,function(o,c){var p=W[c];if(p){var E=p.name+"";yn.call(fi,E)||(fi[E]=[]),fi[E].push({name:c,func:p})}}),fi[Vs(n,S).name]=[{name:"wrapper",func:n}],en.prototype.clone=hE,en.prototype.reverse=bE,en.prototype.value=yE,W.prototype.at=GO,W.prototype.chain=YO,W.prototype.commit=XO,W.prototype.next=ZO,W.prototype.plant=JO,W.prototype.reverse=eI,W.prototype.toJSON=W.prototype.valueOf=W.prototype.value=tI,W.prototype.first=W.prototype.head,nl&&(W.prototype[nl]=QO),W},ci=Xx();Oo?((Oo.exports=ci)._=ci,Du._=ci):lr._=ci}).call(pr)})(au,au.exports);var Pz=au.exports;const Nz=e=>{let{request:t,title:n,disabledValue:r,callError:a,...i}=e;const[s,l]=Y.useState(!1),[u,f]=Y.useState([]);Y.useEffect(()=>{v()},[]);const v=async()=>{if(t&&typeof t=="function"){var g;const m=await t();if(m.code>0){a&&typeof a=="function"&&a(m.message);return}let b=yx(((g=m.data)===null||g===void 0?void 0:g.list)||m.data||[],"id",n||"title",i.parentId||"parentId","children",0,r);b=[{value:0,title:"根节点",children:b}],i.treeData=b,f(b)}i.treeData&&f(i.treeData),l(!0)};return Et.jsx(br,{...i,children:s&&Et.jsx(Eo,{...i,treeData:u,treeDefaultExpandAll:!0,style:{width:"100%"}})})},vs=e=>{let{request:t,option_label:n="label",option_value:r="id",disabledValue:a,callError:i,options:s,...l}=e;const[u,f]=Y.useState([]);Y.useEffect(()=>{v()},[]);const v=async()=>{if(t&&typeof t=="function"){var g;const m=await t();if(m.code>0){i&&typeof i=="function"&&i(m.message);return}let b=((g=m.data)===null||g===void 0?void 0:g.list)||m.data;Array.isArray(b)&&b.length>0&&f(b.map(C=>({label:C[n],value:C[r]})))}s&&s.length>0&&f(s)};return Et.jsx(br,{...l,children:Et.jsx(ei,{...l,options:u,style:{width:"100%"}})})},Mz=e=>{let{...t}=e;return Et.jsx(vs,{...t,mode:"single"})},Dz=e=>{let{onChange:t,value:n,...r}=e;const[a,i]=Y.useState([]);return Y.useEffect(()=>{if(typeof n=="string")try{n=JSON.parse(n),t(n)}catch{}i(n)},[n]),Et.jsx(vs,{...r,onChange:t,mode:"multiple",value:a})},Tz=e=>{let{onChange:t,value:n,...r}=e;const[a,i]=Y.useState("");Y.useEffect(()=>{if(n&&typeof n=="string")try{n=JSON.parse(n),t(n)}catch{}n&&i(n)},[n]);const s=(l,u)=>{t&&typeof t=="function"&&t(u),i(u.label)};return Et.jsx(vs,{...r,onChange:s,value:a,mode:"single"})},Fz=e=>{let{onChange:t,value:n,...r}=e;const[a,i]=Y.useState([]);Y.useEffect(()=>{if(n&&typeof n=="string")try{n=JSON.parse(n),t(n)}catch{}Array.isArray(n)&&i(n)},[n]);const s=(l,u)=>{t&&typeof t=="function"&&t(u),u.map(f=>f.label),i(u)};return Et.jsx(vs,{...r,onChange:s,value:a,mode:"multiple"})},Az=Y.forwardRef((e,t)=>{let{value:n,onChange:r,...a}=e;const i=Y.useRef(0),s=()=>{i.current++,r(i.current)};return Et.jsxs(br,{...a,children:[Et.jsxs("div",{ref:t,children:["form-set-value:",n]}),Et.jsx(Ga,{onClick:s,children:"test"})]})}),kz=e=>{let{children:t,layout:n}=e;n=n||"1";const r=s=>{const l=s.split(",").map(Number),u=24;return l.map(f=>f/l.reduce((v,g)=>v+g)*u)},a=Y.useMemo(()=>r(n),[n]);console.log("colSpans",a);const i=Y.useMemo(()=>Y.Children.toArray(t).map((s,l)=>{const u=s.props,f=(u==null?void 0:u.componentId)||(u==null?void 0:u.__id);return f?(a==null?void 0:a[l])&&Et.jsx(Vi,{span:a[l],children:Et.jsx(na.Item,{style:{marginBottom:0},label:"",name:f,rules:[{required:u.isRequired,message:"".concat(u.title,"不能为空!")}],children:s},"".concat(f,"-form-item"))},l):(a==null?void 0:a[l])&&Et.jsx(Vi,{span:a[l],children:s},l)}),[t,a]);return Et.jsx(Iu,{gutter:24,children:i})},Lz=e=>{let{title:t}=e;return t?Et.jsx("div",{className:"fh-11 fborder-b fflex fitems-center ftext-lg ffont-medium fmb-5 ",children:t}):null};function Vz(e,t){const n=[];let r=[];const a=(i,s)=>{const l=i-s.length;s.push(...new Array(l).fill(Y.createElement("div")))};for(const i of e){const{_componentName:s}=(i==null?void 0:i.props)||{};s&&s.startsWith("Layout")?(r.length>0&&(a(t,r),n.push(r),r=[]),n.push([i])):(r.push(i),r.length===t&&(n.push(r),r=[]))}return r.length>0&&(a(t,r),n.push(r)),n}const Jg=Y.forwardRef((e,t)=>{let{cols:n=1,children:r}=e;const[a]=na.useForm(),[i,s]=Y.useState(null),l=Y.useRef(null);Y.useImperativeHandle(t,()=>({formRef:a,initializeFieldVisibility:f}),[]),Y.useEffect(()=>{u(),s(m())},[r,n]);const u=()=>{l.current=new Map;const b=Y.Children.toArray(r);b.forEach(C=>{const{componentId:y,__id:h,...S}=C.props,w=y||h;l.current.set(w,{children:b.filter(x=>{var $;return x.props.__withId===w||(($=x.props.__withIds)===null||$===void 0?void 0:$.includes(w))}),show:!0})}),f()},f=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const C=a.getFieldsValue();for(let y of l.current.keys())v(y,C);b&&s(m())},v=(b,C)=>{let y=!1;return l.current.has(b)&&l.current.get(b).children.forEach(S=>{if(S.props.__withFunc&&typeof S.props.__withFunc=="function"){const w=S.props.__withFunc(C),x=S.props.componentId||S.props.__id;if(l.current.has(x)){const $=l.current.get(x);$.show!==w&&($.show=w,l.current.set(x,$),y=!0)}}}),y},g=Pz.debounce((b,C)=>{const y=a.getFieldsValue();let h=!1;b.forEach(S=>{S.name&&S.name.length>0&&(h=v(S.name[0],y))}),h&&s(m())},100),m=()=>{const b=Y.Children.toArray(r);return Vz(b.filter(y=>{const h=y.props.componentId||y.props.__id;return l.current.has(h)&&l.current.get(h).show}),n).map((y,h)=>Et.jsx(Iu,{gutter:[24,24],children:y.map((S,w)=>{const{componentId:x,__id:$,_componentName:I,...O}=S.props,R=x||$,_=I&&I.startsWith("Layout");return Et.jsx(Vi,{span:_?24:24/y.length,style:{marginBottom:0},children:_?S:Et.jsx(na.Item,{style:{marginBottom:0},label:"",name:R,rules:[{required:O.isRequired,message:"".concat(O.title,"不能为空!")}],children:S})},R||"col-".concat(w))})},"row-".concat(h)))};return Et.jsx(na,{form:a,className:"form-container fp-6 fw-full fh-full box-border overflow-auto",onFieldsChange:g,children:i})});function jz(e){return Y.forwardRef((t,n)=>Et.jsx(e,{...t,ref:n,forwardedRef:n}))}class eB extends Y.PureComponent{render(){const{forwardedRef:t,...n}=this.props;return Et.jsx(Jg,{...n,ref:t})}}const Hz=jz(e=>{let{forwardedRef:t,...n}=e;return Et.jsx(Jg,{...n,ref:t})}),zz=e=>{let{request:t,value:n,onChange:r,callError:a,disabledValue:i,addRoot:s=!0,title:l,...u}=e;const[f,v]=Y.useState(!1),[g,m]=Y.useState([]);Y.useEffect(()=>{b()},[]),Y.useEffect(()=>{if(console.log("CheckboxTree value ",n),typeof n=="string")try{n=JSON.parse(n),r(n)}catch{}Array.isArray(n)&&S(n)},[n]);const b=async()=>{if(t&&typeof t=="function"){var P;const M=await t();if(M.code>0){a&&typeof a=="function"&&a(M.message);return}let k=yx(((P=M.data)===null||P===void 0?void 0:P.list)||M.data||[],"id",l||"title",(u==null?void 0:u.parentId)||"parentId","children",0,i);s&&(k=[{value:0,title:"根节点",children:k}]),u.treeData=k,console.log("treeData",k),m(k)}u.treeData&&m(u.treeData),v(!0)},[C,y]=Y.useState([]),[h,S]=Y.useState([]),[w,x]=Y.useState([]),[$,I]=Y.useState(!0),O=P=>{console.log("onExpand",P),y(P),I(!1)},R=P=>{console.log("onCheck",P),S(P),r(P)},_=(P,M)=>{console.log("onSelect",M),x(P)};return Et.jsx(br,{...u,children:Et.jsx(qg,{checkable:!0,onExpand:O,onCheck:R,onSelect:_,expandedKeys:C,autoExpandParent:$,checkedKeys:h,selectedKeys:w,treeData:g})})},Bz=e=>Et.jsx(br,{...e,children:Et.jsx(cs,{...e})}),Wz=e=>{let{value:t,onChange:n,...r}=e;const[a,i]=Y.useState([]);return Y.useEffect(()=>{if(typeof t=="string")try{t=JSON.parse(t),n(t)}catch{}i(t)},[t]),Et.jsx(br,{...r,children:Et.jsx(cs.Group,{...r,value:a})})},Kz=e=>Et.jsx(br,{...e,children:Et.jsx(Ou.Group,{...e})}),Uz=e=>{let{value:t,maxLen:n,onChange:r,...a}=e;Y.useEffect(()=>{t&&s(t)},[t]),n=n||9;const[i,s]=Y.useState([]),l=u=>{let{fileList:f}=u;console.log(f),s(f),r(i.map(v=>({uid:v.uid,name:v.name,status:v.status,url:v.url||""})))};return Et.jsx(br,{...a,children:Et.jsx(Nu,{...a,listType:"text",onChange:l,defaultFileList:i,children:Et.jsx(Ga,{icon:Et.jsx(bx,{}),children:"点击上传文件"})})})},qz=e=>{let{maxLen:t,value:n,onChange:r,...a}=e;Y.useEffect(()=>{n&&s(n)},[n]),t=t||9;const[i,s]=Y.useState([]),[l,u]=Y.useState(""),[f,v]=Y.useState(!1),g=async C=>{!C.url&&!C.preview&&(C.preview=await getBase64(C.originFileObj)),u(C.url||C.preview),v(!0)},m=Et.jsxs("button",{style:{border:0,background:"none"},type:"button",children:[Et.jsx(hx,{}),Et.jsx("div",{style:{marginTop:8},children:"点击上传"})]}),b=C=>{let{fileList:y}=C;s(y),r(i.map(h=>({uid:h.uid,name:h.name,status:h.status,url:h.url||""})))};return Et.jsxs(br,{...a,children:[Et.jsx(Nu,{...a,listType:"picture-card",fileList:i,onPreview:g,onChange:b,children:i.length>=8?null:m}),l&&Et.jsx(Image,{wrapperStyle:{display:"none"},preview:{visible:f,onVisibleChange:C=>v(C),afterOpenChange:C=>!C&&u("")},src:l})]})},Gz=e=>{let{value:t,...n}=e;const[r,a]=Y.useState(!1);return Y.useEffect(()=>{let i=!1;typeof t=="boolean"?i=t:typeof t=="string"?i=t=="1"||t=="true":typeof t=="number"&&(i=t==1),a(i),n==null||n.onChange(i)},[t]),Et.jsx(br,{...n,children:Et.jsx(Hg,{...n,value:r})})},Yz=e=>{let{datetype:t,value:n,onChange:r,...a}=e;t=t||"date";const[i,s]=Y.useState(a==null?void 0:a.picker),[l,u]=Y.useState(a==null?void 0:a.format),[f,v]=Y.useState(null),[g,m]=Y.useState(!1),[b,C]=Y.useState(!1);Y.useEffect(()=>{if(n){const h=xr(n);v(h)}},[n,l,i]);const y=(h,S)=>{r(S)};return Y.useEffect(()=>{switch(s("date"),m(!1),t){case"date":s("date"),u("YYYY-MM-DD"),C(!1);break;case"datetime":m(!0),s("datetime"),u("YYYY-MM-DD HH:mm:ss"),C(!0);break;case"month":s("month"),C(!1);break;case"year":s("year"),C(!1);break}},[t]),Et.jsx(br,{...a,children:Et.jsx(Yi,{...a,picker:i,format:l,style:{width:"100%"},onChange:y,value:f,showTime:g,needConfirm:b})})},Xz=e=>Et.jsx("div",{children:"sdfsdfsdf"}),Zz={Input:pj,TextArea:hj,Password:bj,Search:yj,TreeSelect:Nz,Select:vs,WithSingleSelect:Tz,WithMultipleSelect:Fz,SingleSelect:Mz,MultipleSelect:Dz,CodeMachine:mj,Checkbox:Bz,CheckboxTree:zz,CheckboxGroup:Wz,RadioGroup:Kz,UploadFile:Uz,UploadImage:qz,Switch:Gz,DatePicker:Yz,Custom:Az},Qz={FormRow:kz,FormGroupTitle:Lz},Jz={OptionSetter:Xz};exports.Field=Zz;exports.FormContainer=Jg;exports.FormContainerWrapper=Hz;exports.Layout=Qz;exports.Setter=Jz;
|