Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jdfed/drip-form

Package Overview
Dependencies
Maintainers
5
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jdfed/drip-form - npm Package Compare versions

Comparing version 0.9.0-alpha.12 to 0.9.0-alpha.13

2

dist/index.js

@@ -1,2 +0,2 @@

import e from"@babel/runtime/helpers/esm/defineProperty";import t from"@babel/runtime/helpers/esm/classCallCheck";import r from"@babel/runtime/helpers/esm/createClass";import n from"@babel/runtime/helpers/esm/inherits";import o from"@babel/runtime/helpers/esm/possibleConstructorReturn";import a from"@babel/runtime/helpers/esm/getPrototypeOf";import c,{createContext as i,memo as l,useMemo as s,useContext as u,useRef as p,useEffect as m,useCallback as f,forwardRef as d,useImperativeHandle as y,PureComponent as v}from"react";import h from"@babel/runtime/helpers/esm/asyncToGenerator";import b from"@babel/runtime/helpers/esm/slicedToArray";import g from"@babel/runtime/helpers/esm/objectWithoutProperties";import O from"@babel/runtime/helpers/esm/typeof";import j from"@babel/runtime/regenerator";import w,{produce as S,current as E}from"immer";import{useImmerReducer as P}from"use-immer";import D from"@babel/runtime/helpers/esm/toConsumableArray";import{parseUnitedSchema as K,setDeepProp as k,combine as C,deleteDeepProp as x,generateArrayKeyReg as F,randomString as T,toArray as A,generateReg as N,upgradeTips as M,typeCheck as _,handleMargin as R,get as U,number2Chinese as V,parseFlow as q,isEqual as z,fetchFn as L}from"@jdfed/utils";import B from"react-tooltip";import{useContainer as H,useTitle as I,useGlobalOptions as Q,useArray as $,defaultGlobalOptions as G,usePrevious as W,useValidate as Z,useSchema as J,useGetKey as X,globalOptionsContext as Y,RequiredModeContext as ee}from"@jdfed/hooks";import te from"classnames";import{useSensors as re,useSensor as ne,PointerSensor as oe,MouseSensor as ae,DndContext as ce,closestCenter as ie}from"@dnd-kit/core";import{useSortable as le,SortableContext as se,verticalListSortingStrategy as ue}from"@dnd-kit/sortable";import{restrictToVerticalAxis as pe,restrictToParentElement as me}from"@dnd-kit/modifiers";import{CSS as fe}from"@dnd-kit/utilities";import de from"@jdfed/ajv";var ye=function(e){var t=e.schema,r=e.formData,n=e.ajv,o=e.visibleFieldKey,a=e.customProps;try{var c=(null==a?void 0:a.filter((function(e){return!n.RULES.keywords[e]})))||[];(null==c?void 0:c.length)>0&&n.addVocabulary(c);var i=n.compile(t),l=!1,s=w(r,(function(e){l=i(e)})),u=(null==i?void 0:i.errors)||[],p={};return(u=u.filter((function(e){return"errorMessage"===e.keyword}))).forEach((function(e){var t=null==e?void 0:e.instancePath.replace(/^\//,"").replace(/\//g,".");t?p["".concat(String(t)).concat(e.params.errors[0].params.missingProperty?"."+e.params.errors[0].params.missingProperty:"")]=e.message||"未知错误":p[e.params.errors[0].params.missingProperty]=e.message||"未知错误"})),Object.keys(p).map((function(e){!o||null!=o&&o.includes(e)||delete p[e]})),{pass:l,errors:u,errorsMap:p,formData:s}}catch(e){return console.error(e),{pass:!1,errors:[],formData:r,errorsMap:{}}}},ve=["validateTime","requiredMode"],he=function(t){var r=t.action,n=t.state,o=r.fieldKey,a=r.closestEdge,c=r.unitedSchema,i=r.overFieldKey,l=r.get,s=r.getKey,u=r.shouldDelete,p=r.getTypeKey,m=i.split("."),f=m.slice(0,m.length-1).join("."),d="over"===a?i:f,y=d,v=y.split(".");if(v.length>1){var h=l(v.slice(0,v.length-1).join(".")).uiSchema;if("array"===h.type)if(["normal","tuple"].includes(h.mode));else{var b=d.split(".");b.pop(),b.push("$container"),y=b.join(".")}}y=""!==y?p(y):"";var O={data:(d?s(d,"dataSchema"):"").split(".").filter((function(e){return e})),ui:(d?s(d,"uiSchema"):"").split(".").filter((function(e){return e}))},j=l(d),w=j.dataSchema,P=j.uiSchema,x=K(c),F=x.dataSchema;F.validateTime,F.requiredMode;var T=g(F,ve),A=x.uiSchema,N="object";"array"===P.type&&(N=["normal","tuple"].includes(P.mode)?"tuple":"array");var M=P.order||[];switch(N){case"object":var _=!u&&o,R="over"===a||m.length<=1?i:m.slice(m.length-1).join(),U=M.findIndex((function(e){return e===R})),V="over"===a?[o]:S(M,(function(e){var t=-1;_&&(t=e.findIndex((function(e){return e===o})));var r=["left","top"].includes(a)?U:U+1;e.splice(r,0,o),-1!=t&&e.splice(r<=t?t+1:t,1)}));if(k(O.ui.concat(["order"]),n.uiSchema,V),_)break;k(O.ui.concat(["properties",o]),n.uiSchema,A),k(O.data.concat(["properties",o]),n.dataSchema,T);break;case"array":var q,z=w.items||T,L=(null==P||null===(q=P.properties)||void 0===q?void 0:q.$container)||A;if("over"!==a){var B=z.fieldKey||"0";z=S(z,(function(t){var r;return{type:"object",title:"",properties:(r={},e(r,B,t),e(r,o,T),r)}})),L=S(L,(function(t){var r;return{type:"object",order:["left","top"].includes(a)?[o,B]:[B,o],properties:(r={},e(r,B,t),e(r,o,A),r)}}))}k(O.ui.concat(["order"]),n.uiSchema,["$container"]),k(O.ui.concat(["properties","$container"]),n.uiSchema,L),k(O.data.concat(["items"]),n.dataSchema,z);break;case"tuple":var H=i.split(".").pop(),I="over"===a?0:["left","top"].includes(a)?+H:+H+1,Q=Number(o),$=w.items||[],G="over"===a?[T]:S($,(function(e){e.splice(I,0,T),u||e.splice(I>Q?Q:Q+1,1)})),W="over"===a?["0"]:[].concat(D(M),[String(M.length)]),Z=P.properties||{},J="over"===a?{0:A}:S(Z,(function(e){var t,r;u?W.filter((function(e){return+e>=I})).sort((function(e,t){return+t-+e})).map((function(t){e[t]=+t===I?A:e[String(+t-1)]})):M.filter((function(e){return I>+o?(r="topToBottom",+e<I&&+e>=+o):(r="bottomToTop",+e<=+o&&+e>=I)})).sort((function(e,t){return+e-+t})).map((function(n,a){0===a&&(t=e[n]),e[n]=e[String(+n+1)],"topToBottom"==r?+n==I-1&&(e[n]=t):+n==+o&&(e[n]=t)}))}));k(O.ui.concat(["properties"]),n.uiSchema,J),k(O.data.concat(["items"]),n.dataSchema,G),u&&k(O.ui.concat(["order"]),n.uiSchema,W)}n.typePath=K(C(E(n.dataSchema),E(n.uiSchema))).typePath},be=function(e){var t=e.action,r=e.state,n=t.fieldKey,o=t.get,a=t.getKey;t.getTypeKey;var c=n.split("."),i=c.slice(0,c.length-1).join("."),l=o(i).uiSchema,s="object";"array"===l.type&&(s=["normal","tuple"].includes(l.mode)?"tuple":"array");var u=a(n,"uiSchema").split("."),p=a(n,"dataSchema").split("."),m=i?a(i,"uiSchema").split("."):[],f=""===i?["order"]:a(i,"uiSchema").split(".").concat("order");switch(s){case"array":x(f.concat(0),r.uiSchema),x(u,r.uiSchema),x(p,r.dataSchema);break;case"object":var d=(l.order||[]).findIndex((function(e){return e==n.split(".").pop()}));-1!=d&&x(f.concat(d),r.uiSchema),x(u,r.uiSchema),x(p,r.dataSchema);break;case"tuple":var y=l.order||[],v=y.slice(0,y.length-1);k(f,r.uiSchema,v),1===y.length?x(p.slice(0,p.length-1),r.dataSchema):x(p,r.dataSchema);var h=l.properties,b=S(h,(function(e){var t=y.findIndex((function(e){return e==n.split(".").pop()}));-1!=t&&(delete e[t],v.filter((function(e){return+e>=t})).map((function(t){e[t]=e[String(+t+1)]})))}));k(m.concat("properties"),r.uiSchema,b)}r.typePath=K(C(E(r.dataSchema),E(r.uiSchema))).typePath},ge=["type"],Oe=["type"],je=["type"],we=["type"],Se=["type"];function Ee(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pe(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Ee(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ee(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var De=i({globalFormDataStoreKey:""}),Ke=function(t,r){switch(r.type){case"reload":M("reload","reset"),r.type;var n=g(r,ge);Object.assign(t,n);break;case"reset":Object.assign(t,r.action.state);break;case"setDataSchema":M("setDataSchema","setValidate"),r.type;var o=g(r,Oe);if(o.dataSchema)t.dataSchema=o.dataSchema;else for(var a in o){var c=a.split(".");null!=o&&o.isDelete?x(c,t.dataSchema):k(c,t.dataSchema,o[a])}break;case"setValidate":var i=r.action,l=i.set,s=i.dataSchema,u=r.action.deleteKeys;if(l)for(var p in l)k(p.split("."),t.dataSchema,l[p]);u&&(u=A(u)).map((function(e){x(e.split("."),t.dataSchema)})),s&&(t.dataSchema=s);break;case"setUiSchema":M("setUiSchema","setUi"),r.type;var m=g(r,je);if(m.uiSchema)t.uiSchema=m.uiSchema;else for(var f in m){var d=f.split(".");k(d,t.uiSchema,m[f])}break;case"deleteUiSchema":M("deleteUiSchema","setUi");var y=r.key.split(".");x(y,t.uiSchema);break;case"setUi":var v=r.action,h=v.set,O=v.uiSchema,j=r.action.deleteKeys;if(h)for(var w in h)k(w.split("."),t.uiSchema,h[w]);j&&(j=A(j)).map((function(e){x(e.split("."),t.uiSchema)})),O&&(t.uiSchema=O);break;case"setFormData":M("setFormData","setData"),r.type;var S=g(r,we);if(S.formData)t.formData=S.formData;else for(var E in S)k(E.split("."),t.formData,S[E],t.typePath),t.changeKey=E;break;case"deleteFormData":M("setFormData","setData"),t.changeKey=r.key;var P=r.key.split(".");x(P,t.formData);break;case"setData":var K=r.action,C=K.set,R=K.formData,U=r.action.deleteKeys;if(C)for(var V in C)k(V.split("."),t.formData,C[V],t.typePath),t.changeKey=V;U&&(U=A(U)).map((function(e){t.changeKey=e,x(e.split("."),t.formData)})),R&&(t.formData=R);break;case"deleteField":be({action:r.action,state:t});break;case"addField":he({action:r.action,state:t});break;case"setAjvErr":var q=r.action.deleteKeys,z=r.action,L=z.errors,B=z.set;if(B)for(var H in B)t.ajvErrors[H]=B[H];q&&(q=A(q)).map((function(e){delete t.ajvErrors[e]})),L&&(t.ajvErrors=L);break;case"setError":M("setError","setErr"),r.type;var I=g(r,Se);if(I.errors&&"Object"===_(I.errors)){var Q={};(I.ignore&&Array.isArray(I.ignore)||t.ignoreErrKey.length>0)&&Array.from(new Set([].concat(D(I.ignore||[]),D(t.ignoreErrKey)))).map((function(e){t.errors[e]&&(Q[e]=t.errors[e])})),t.errors=Pe(Pe({},I.errors),Q)}else for(var $ in I){var G,W=I;null!=W&&null!==(G=W.action)&&void 0!==G&&G.ignore&&(t.ignoreErrKey=Array.from(new Set([].concat(D(t.ignoreErrKey),D(W.action.ignore))))),t.errors[$]=I[$]}break;case"deleteError":M("deleteError","setErr"),Array.isArray(r.key)?r.key.map((function(e){delete t.errors[e]})):delete t.errors[r.key];break;case"setErr":var Z=r.action.deleteKeys,J=r.action,X=J.errors,Y=J.set;if(Y)for(var ee in Y)t.customErrors[ee]=Y[ee];Z&&(Z=A(Z)).map((function(r){var n=[];if(Object.keys(t.customErrors).map((function(o){var a;new RegExp("^".concat(r.split(".").join("\\."),"(\\..+)*"),"g").test(o)&&delete t.customErrors[o];var c=Object.keys(t.typePath).find((function(e){var t=r.split(".");return t.pop(),N(t).test(e)}));if(c&&"array"===(null===(a=t.typePath[c])||void 0===a?void 0:a.type)){var i=r.split("."),l=i.pop(),s=new RegExp("^".concat(i.join("\\."),"\\.(\\d)(\\..+)*"),"g").exec(o);if(null!==s){var u=b(s,3),p=u[1],m=u[2];+p>=+l&&(n[+p]=Pe(Pe({},n[+p]),{},e({},m||"",t.customErrors[o])))}}})),n.length>0){var o=r.split(".");o.pop();var a=o.join(".");n.map((function(e,r){if(e)for(var n in e)t.customErrors["".concat(a,".").concat(+r+1).concat(n)]?t.customErrors["".concat(a,".").concat(r).concat(n)]=t.customErrors["".concat(a,".").concat(+r+1).concat(n)]:delete t.customErrors["".concat(a,".").concat(r).concat(n)]}))}})),X&&(t.customErrors=X);break;case"setChecking":t.checking="action"in r?r.action.checking:r.checking;break;case"setVisibleKey":var te=r.action,re=te.fieldKey,ne=te.deleteKeys;re&&(re=A(re),t.visibleFieldKey=Array.from(new Set([].concat(D(t.visibleFieldKey),D(re))))),ne&&(ne=A(ne),t.visibleFieldKey=t.visibleFieldKey.filter((function(e){var t;return!(null!==(t=ne)&&void 0!==t&&t.includes(e))})));break;case"setArrayKey":var oe=r.action,ae=oe.isDelete,ce=oe.fieldKey,ie=oe.order,le=oe.move,se=t.arrayKey[ce]||[],ue=Object.prototype.hasOwnProperty.call(r.action,"order");if(ae&&ue&&"number"==typeof ie){se.splice(ie,1);var pe=[];Object.keys(t.arrayKey).map((function(r){var n=F(ce.split(".").concat(String(ie))).exec(r);if(null!==n){var o=b(n,4),a=o[2],c=o[3];+a>=ie&&(pe[+a]=Pe(Pe({},pe[+a]),{},e({},c,t.arrayKey[r])))}})),pe.map((function(e,r){if(e)for(var n in e)r===pe.length-1?delete t.arrayKey["".concat(ce,".").concat(r).concat(n)]:t.arrayKey["".concat(ce,".").concat(r).concat(n)]=t.arrayKey["".concat(ce,".").concat(+r+1).concat(n)]}))}else{if(le){var me,fe;se.splice(le[1],0,se.splice(le[0],1)[0]);var de=[],ye=[],ve="";switch(Object.keys(t.arrayKey).map((function(r){var n=F(ce.split(".").concat(String(ie))).exec(r);if(null!==n){var o=b(n,4),a=o[2],c=o[3];le[0]<le[1]?(ve="topToBottom",+a>=le[0]&&+a<=le[1]&&(de[+a]=Pe(Pe({},de[+a]),{},e({},c,t.arrayKey[r])))):(ve="bottomToTop",+a<=le[0]&&+a>=le[1]&&(de[+a]=Pe(Pe({},de[+a]),{},e({},c,t.arrayKey[r]))))}})),Object.keys(t.customErrors).map((function(r){var n=ce.split("."),o=new RegExp("^".concat(n.join("\\."),"\\.(\\d)(\\..+)*"),"g").exec(r);if(null!==o){var a=b(o,3),c=a[1],i=a[2];le[0]<le[1]?(ve="topToBottom",+c>=le[0]&&+c<=le[1]&&(ye[+c]=Pe(Pe({},ye[+c]),{},e({},i||"",t.customErrors[r])))):(ve="bottomToTop",+c<=le[0]&&+c>=le[1]&&(ye[+c]=Pe(Pe({},ye[+c]),{},e({},i||"",t.customErrors[r]))))}})),ve){case"topToBottom":de.map((function(e,r){if(e)if(+r===le[0])for(var n in me=e,e)t.arrayKey["".concat(ce,".").concat(r).concat(n)]=t.arrayKey["".concat(ce,".").concat(+r+1).concat(n)];else if(+r===le[1])for(var o in me)t.arrayKey["".concat(ce,".").concat(r).concat(o)]=me[o];else for(var a in e)t.arrayKey["".concat(ce,".").concat(r).concat(a)]=t.arrayKey["".concat(ce,".").concat(+r+1).concat(a)]})),ye.map((function(e,r){if(e)if(+r===le[0])for(var n in fe=e,e)t.customErrors["".concat(ce,".").concat(r).concat(n)]=t.customErrors["".concat(ce,".").concat(+r+1).concat(n)];else if(+r===le[1])for(var o in fe)t.customErrors["".concat(ce,".").concat(r).concat(o)]=fe[o];else for(var a in e)t.customErrors["".concat(ce,".").concat(r).concat(a)]=t.customErrors["".concat(ce,".").concat(+r+1).concat(a)]}));break;case"bottomToTop":de.slice().reverse().map((function(e,r,n){if(e){var o=n.length-1-+r;if(o===le[0])for(var a in me=e,e)t.arrayKey["".concat(ce,".").concat(o).concat(a)]=t.arrayKey["".concat(ce,".").concat(o-1).concat(a)];else if(o===le[1])for(var c in me)t.arrayKey["".concat(ce,".").concat(o).concat(c)]=me[c];else for(var i in e)t.arrayKey["".concat(ce,".").concat(o).concat(i)]=t.arrayKey["".concat(ce,".").concat(o-1).concat(i)]}})),ye.slice().reverse().map((function(e,r,n){if(e){var o=n.length-1-+r;if(o===le[0])for(var a in fe=e,e)t.customErrors["".concat(ce,".").concat(o).concat(a)]=t.customErrors["".concat(ce,".").concat(o-1).concat(a)];else if(o===le[1])for(var c in fe)t.customErrors["".concat(ce,".").concat(o).concat(c)]=fe[c];else for(var i in e)t.customErrors["".concat(ce,".").concat(o).concat(i)]=t.customErrors["".concat(ce,".").concat(o-1).concat(i)]}}))}}else if(ue&&"number"==typeof ie)se[ie]=T(52);else try{se=ce.split(".").reduce((function(e,t){return e[t]?e[t]:[]}),t.formData).map((function(){return T(52)}))}catch(e){}t.arrayKey[ce]=se}}},ke=["title"];function Ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xe(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Ce(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ce(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Fe,Te=function(e){var t=e.uiComponents,r=e.dataSchema,n=e.uiSchema,o=e.errors,a=e.formData,i=e.onQuery,l=e.onValidate,s=e.dispatch,u=e.customComponents,p=e.parentUiSchemaKey,m=void 0===p?["#"]:p,f=e.parentDataSchemaKey,d=void 0===f?["#"]:f,y=e.parentFormDataKey,v=void 0===y?"":y,h=e.currentArrayKey,b=e.containerMap,O=e.containerHoc,j=e.get,w=e.getKey,S=e.isRoot,E=e.arrayKey,P=n.theme,D=void 0===P?"antd":P,K=n.title,k=void 0===K?{}:K,C=n.formMode,x=void 0===C?"edit":C,F=n.containerStyle,T=m.reduce((function(e,t){return"#"===t?e:e[t]}),n),A=d.reduce((function(e,t){return"#"===t?e:e[t]}),r),N=v.split(".").reduce((function(e,t){return""===t?e:e[t]||("array"===A.type?[]:{})}),a),M=T.order,_=T.properties,U=T.mode,V=T.type,q=void 0===V?"object":V,z="change"===r.validateTime;return(M||[]).map((function(e,p){var f,y,P,K,C=_[e].type,T="array"===q&&"$container"===e,M=d.concat(["array"===q?"items":"properties",T?"":e]).filter((function(e){return""!==e})),V=m.concat(["properties",e]),L="".concat(v,".").concat(T?h:e);if(L=L.replace(/^\./,""),!Object.prototype.hasOwnProperty.call(_,e))return console.log("Render Error: no schema for","color: #fff; background: #ffff00;padding: 3px",e),null;var B=A.required||[],H=(null===(f=_[e])||void 0===f?void 0:f.theme)||D,I=A["array"===q?"items":"properties"],Q="$container"===e?I.title:I[e].title;if("object"===q&&!A.properties[e])return null;if("array"===q)if("$container"==e);else if(!A.items[e])return null;var $=null==i?void 0:i[e],G=null==l?void 0:l[e],W=o[L]||"",Z=N[T?h:e],J=!Object.prototype.hasOwnProperty.call(_[e],"showTitle")||_[e].showTitle,X=Object.assign("object"===C&&"collapse"===(null===(y=_[e])||void 0===y?void 0:y.mode)?{marginBottom:20}:{},S?xe({width:"100%"},F):{width:"100%"},(null===(P=_[e])||void 0===P?void 0:P.containerStyle)||{});R(X);var Y=_[e];Y.title;var ee=g(Y,ke),te=Object.assign({placement:"left",width:"82px",textAlign:"left",verticalAlign:"center",requiredFields:!1,fontSize:12,color:"#000000"},k,(null===(K=_[e])||void 0===K?void 0:K.title)||{}),re=ee.description||null,ne=_[e].vcontrol,oe=!1;if(ne)try{oe=("function"==typeof ne?ne:new Function("props",ne))({formData:a,uiSchema:n,dataSchema:r,get:j,getKey:w,fieldKey:L,fieldData:Z})}catch(W){console.error("".concat(e,":vcontrol函数体错误,请确认")),console.error(W)}else oe=!0;if(!(oe&&b||"generator"===x))return null;var ae=b[C]||b.default,ce={uiProp:ee},ie={array:{},object:{}},le={containerHoc:O,dataSchema:r,uiSchema:n,errors:o,formData:a,onQuery:i,onValidate:l,parentUiSchemaKey:V,parentDataSchemaKey:M,parentFormDataKey:L,containerMap:b,get:j,arrayKey:E},se=xe(xe({formMode:ee.formMode||x,title:Q,theme:H,error:W,requiredFields:B,description:re,showTitle:J,titleUi:te,showError:z},"generator"!=x&&{containerStyle:X}),{},{type:C,key:e,queryFunc:$,asyncValidate:G,fieldKey:L,fieldData:Z,dispatch:s,uiComponents:t,getKey:w,customComponents:u});return O?O(c.createElement(ae,xe(xe(xe(xe({},ie[C]),ie[C]&&le),se),ce)),{fieldKey:L,error:W,containerStyle:X,type:C,parentMode:U,parentType:q,isFirst:!!S&&0===p,uiProp:ee,theme:H}):c.createElement(ae,xe(xe(xe(xe({},ie[C]),ie[C]&&le),se),ce))}))};!function(e){e.center="center",e.top="flex-start",e.bottom="flex-end",e.left="flex-start",e.right="flex-end"}(Fe||(Fe={}));var Ae=l((function(e){return c.createElement("svg",{"data-tip":e.title,"data-effect":"solid","data-html":"true","data-delay-hide":"100",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4928",width:"1em",height:"1em"},c.createElement("path",{d:"M512 938.666667c235.648 0 426.666667-191.018667 426.666667-426.666667S747.648 85.333333 512 85.333333 85.333333 276.352 85.333333 512s191.018667 426.666667 426.666667 426.666667z m0 85.333333C229.248 1024 0 794.752 0 512S229.248 0 512 0s512 229.248 512 512-229.248 512-512 512z",fill:"#3D3D3D","p-id":"4929"}),c.createElement("path",{d:"M520.96 232.106667c-62.293333 0-111.786667 17.92-147.626667 54.613333-36.693333 35.84-54.613333 84.48-54.613333 146.773333h90.453333c0-37.546667 7.68-67.413333 23.04-87.893333 17.066667-23.893333 45.226667-35.84 83.626667-35.84 30.72 0 54.613333 8.533333 71.68 25.6 16.213333 17.066667 24.746667 40.106667 24.746667 69.973333 0 22.186667-7.68 42.666667-23.04 62.293334l-14.506667 16.213333c-52.906667 46.933333-85.333333 81.92-97.28 105.813333-11.093333 22.186667-16.213333 49.493333-16.213333 81.066667v14.506667h91.306666v-14.506667c0-21.333333 4.266667-40.106667 13.653334-57.173333 7.68-15.36 19.626667-29.866667 34.986666-43.52 40.96-34.986667 64.853333-57.173333 72.533334-66.56 20.48-27.306667 31.573333-62.293333 31.573333-104.106667 0-51.2-17.066667-92.16-50.346667-122.026667-34.133333-30.72-78.506667-45.226667-133.973333-45.226666z m-14.506667 499.2c-17.92 0-32.426667 5.12-43.52 17.066666-12.8 11.093333-18.773333 25.6-18.773333 43.52 0 17.066667 5.973333 31.573333 18.773333 43.52 11.093333 11.946667 25.6 17.92 43.52 17.92 17.066667 0 32.426667-5.973333 45.226667-17.066666 11.946667-11.946667 17.92-26.453333 17.92-44.373334 0-17.92-5.973333-32.426667-17.92-43.52-11.946667-11.946667-27.306667-17.066667-45.226667-17.066666z",fill:"#3D3D3D","p-id":"4930"}))}));function Ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Me(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Ne(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ne(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var _e=l((function(e){var t,r=e.titleUi,n=e.requiredFields,o=e.fieldKey,a=e.description,i=e.uiComponents,l=e.theme,u=e.title,p=(null===(t=i[l])||void 0===t?void 0:t.QuestionCircle)||Ae,m=s((function(){var e;return Array.isArray(a)?((a||[]).map((function(t){"icon"===(null==t?void 0:t.type)&&(e=t)})),e):"object"===O(a)&&"icon"===(null==a?void 0:a.type)?a:void 0}),[a]);return c.createElement("div",{className:"form-container__title",style:Me(Me(Me(Me(Me(Me({},(null==r?void 0:r.width)&&{width:r.width}),(null==r?void 0:r.textAlign)&&{justifyContent:Fe[null==r?void 0:r.textAlign]}),(null==r?void 0:r.verticalAlign)&&{alignItems:Fe[null==r?void 0:r.verticalAlign]}),(null==r?void 0:r.margin)&&{margin:r.margin}),(null==r?void 0:r.fontSize)&&{fontSize:r.fontSize}),(null==r?void 0:r.color)&&{color:r.color})},null!=r&&r.requiredIcon&&n.includes(o.split(".").pop())?c.createElement("span",{style:{color:"red"}},"*"):"",u,(null==r?void 0:r.showColon)&&":",m&&"icon"===(null==m?void 0:m.type)&&(null==m?void 0:m.title)&&p&&c.createElement(p,Me({},m)))}));_e.displayName="Title";var Re=_e;function Ue(e){switch(e){case"top":return"title-top";case"right":return"title-right";case"bottom":return"title-bottom";default:return"title-left"}}function Ve(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"82px",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"left",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["0","10","0","0"],n=arguments.length>3?arguments[3]:void 0;if(!n)return"0";var o="".concat(e);return"0"!==r[1]&&(o+=" + ".concat(r[1])),"0"!==r[3]&&(o+=" + ".concat(r[3])),"left"===t?"0 0 0 calc(".concat(o,")"):"right"===t?"0 calc(".concat(o,") 0 0"):0}var qe=l((function(e){var t=e.titleUi,r=e.showTitle,n=e.description,o=e.showError,a=e.error,i=t||{},l=i.width,u=i.placement,p=i.margin,m=s((function(){var e;return Array.isArray(n)?((n||[]).map((function(t){"text"===(null==t?void 0:t.type)&&(e=t)})),e):"object"===O(n)&&"text"===(null==n?void 0:n.type)?n:void 0}),[n]);return c.createElement("div",{className:"form-container__other",style:{padding:Ve(l,u,p?p.split(" "):["0","10","0","0"],r)}},"text"===(null==m?void 0:m.type)&&(null==m?void 0:m.title)&&c.createElement("div",{className:"form-container__tips"},null==m?void 0:m.title),c.createElement("div",{className:te("form-container__error",{"form-container__error--no-title":!r})},o&&a))}));qe.displayName="Description";var ze=qe;function Le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Be(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Le(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Le(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var He=function(t,r){var n=r||{showDesAndErr:!0,showTitleEle:!0},o=n.showTitleEle,a=void 0===o||o,i=n.showDesAndErr,s=void 0===i||i,f=l((function(r){var n=r.titleUi,o=r.showTitle,i=r.description,l=r.showError,f=r.error,d=r.requiredFields,y=r.fieldKey,v=r.uiComponents,g=r.theme,O=r.title,w=r.dispatch,S=r.formMode,E=r.containerStyle,P=r.uiProp,D=r.type,K=r.customComponents,k=r.getKey,C=u(De),x=C.globalFormDataStoreKey,F=C.fetchApi;H({fieldKey:y,dispatch:w});var T,A=I(n),N=Q().undefinedComponent;if("custom"===D&&K)T=K[y];else{var M,_,R=D.split("::"),V=b(R,2),q=V[0],z=V[1];if(z)T=null===(M=v[q])||void 0===M?void 0:M[z];else T=null===(_=v[g])||void 0===_?void 0:_[D]}var L="console"===(null==N?void 0:N.type)&&!T,B=P.queryConfig,$=p("0"===(null==B?void 0:B.optionsType)&&(null==B?void 0:B.refreshId)||0);return m((function(){h(j.mark((function t(){var r,n,o,a,c,i,l,s,u,p,m,f,d;return j.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!F||"0"!==(null==B?void 0:B.optionsType)){t.next=15;break}return t.prev=1,r=B.refreshId,n=void 0===r?0:r,o=B.url,a=B.params,c=void 0===a?[]:a,i=B.method,l=void 0===i?"GET":i,s=B.dataPath,u=B.setPath,p=void 0===u?"options":u,$.current=n,m=c.map((function(e){var t=e.value.replace(/\{\{(formData.+?)\}\}/g,(function(e,t){try{return new Function("formData","return ".concat(t))(window[x])}catch(t){return e}}));return{key:e.key,value:t}})),t.next=7,F({params:m,url:o,method:l});case 7:f=t.sent,d=s?U(f,s):f,p&&n===$.current&&w({type:"setUi",action:{set:e({},"".concat(k(y,"uiSchema"),".").concat(p),d)}}),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(1),console.error(t.t0);case 15:case"end":return t.stop()}}),t,null,[[1,12]])})))()}),[B,w,F,y,k,x]),m((function(){"1"===(null==B?void 0:B.optionsType)&&w({type:"setUi",action:{set:e({},"".concat(k(y,"uiSchema"),".").concat(B.setPath),B.options)}})}),[]),L?null:c.createElement("div",{className:te("form-container",{"form-container-view":"view"===S,"form-container-generator":"generator"===S,"form-container-edit":"edit"===S}),style:Be(Be({},["array","object"].includes(P.type)?null==P?void 0:P.style:null),E)},c.createElement("div",{className:te("form-container--main",Ue(null==A?void 0:A.placement))},a&&o&&("object"!=P.type||"object"===P.type&&"collapse"!==P.mode)&&c.createElement(Re,{titleUi:A,requiredFields:d,fieldKey:y,description:i,uiComponents:v,theme:g,title:O}),c.createElement("div",{className:"form-container--content"},c.createElement(t,Be({},r)))),s&&("object"!==P.type||"object"===P.type&&"collapse"!==P.mode)&&c.createElement(ze,{titleUi:A,showTitle:o,description:i,showError:l,error:f}))}));return f.displayName="commoncontainer",f};function Ie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qe(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Ie(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ie(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var $e=l((function(t){var r=t.theme,n=t.error,o=t.fieldKey,a=t.type,i=t.uiProp,l=t.formMode,p=t.fieldData,m=t.queryFunc,d=t.customComponents,y=t.uiComponents,v=t.asyncValidate,h=t.dispatch,g=t.getKey,O=u(De),j=O.globalFormDataStoreKey,w=O.fireEvent,S=O.globalData,E=Q().undefinedComponent,P=s((function(){var e,t,n=function(e){return"function"==typeof(null==E?void 0:E.value)?E.value(e):(null==E?void 0:E.value)||""};if("custom"===a&&d)(t=d[o])||(e=n({fieldKey:o}));else{var s,u,f=a.split("::"),O=b(f,2),P=O[0],D=O[1];if(D)t=null===(s=y[P])||void 0===s?void 0:s[D];else t=null===(u=y[r])||void 0===u?void 0:u[a];t||(e=n({theme:D?P:r,type:D||a,fieldKey:o}))}if("console"===(null==E?void 0:E.type))switch(E.consoleType){case"log":console.log(e);break;case"warn":console.warn(e);break;case"error":console.error(e)}return t?c.createElement(t,Qe(Qe(Qe(Qe({fieldKey:o,fieldData:p,formMode:l,dispatch:h,getKey:g,fireEvent:w,globalformdatastorekey:j},S?{globalData:S}:null),i),m?{queryFunc:m}:null),v?{asyncValidate:v}:null)):"tips"==(null==E?void 0:E.type)&&e?c.createElement("span",{style:{color:"red"}},e):null}),[a,d,o,p,l,h,g,w,j,S,i,m,v,E,y,r]),D=f((function(){if(!n&&null!=v&&v.fn){var t=v.fn(p);null!=t&&t.then?t.then((function(t){h(t?{type:"setErr",action:{set:e({},o,t)}}:{type:"setErr",action:{deleteKeys:o}})})):h(t?{type:"setErr",action:{set:e({},o,t)}}:{type:"setErr",action:{deleteKeys:o}})}}),[v,h,n,p,o]);return v&&"click"===v.type?c.createElement("div",{className:"field__sure--container"},P,c.createElement("div",{className:te("field__sure--button",{"field__sure--button-disabled":n}),onClick:D},"确定")):P}));$e.displayName="fieldContainer";var Ge=He($e),We=["mode","forceRender","active"];function Ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Je(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Ze(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ze(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Xe=["collapsible","showArrow"],Ye=["bordered","destroyInactivePanel","expandIconPosition","ghost"],et=l((function(e){var t,r,n=e.theme,o=e.requiredFields,a=e.title,i=e.description,l=void 0===i?{type:"icon",title:""}:i,u=e.titleUi,p=e.showTitle,f=e.customComponents,d=e.uiComponents,y=e.dispatch,v=e.dataSchema,h=e.uiSchema,b=e.errors,O=e.formData,j=e.onQuery,w=e.parentUiSchemaKey,S=e.parentDataSchemaKey,E=e.onValidate,P=e.fieldKey,D=e.containerMap,K=e.get,k=e.getKey,C=e.containerHoc,x=e.uiProp,F=e.formMode,T=e.arrayKey,A=x||{mode:"normal",forceRender:!1,active:!1},N=A.mode,M=void 0===N?"normal":N,_=A.forceRender,R=void 0!==_&&_,U=A.active,V=void 0!==U&&U,q=g(A,We),z=s((function(){var e={},t={};return Object.keys(q).map((function(r){Xe.includes(r)?t[r]=q[r]:Ye.includes(r)&&(e[r]=q[r])})),{collapseProp:e,panelProp:t}}),[q]),L=z.collapseProp,H=z.panelProp,Q=I(u,"object"),$=null===(t=d[n])||void 0===t?void 0:t.Collapse,G=null===(r=d[n])||void 0===r?void 0:r.Collapse.Panel,W=$&&G&&"collapse"===M&&p,Z=s((function(){var e=P.split("."),t=e.pop(),r=e.join(".");return t&&T[r]&&T[r][+t]?T[r][+t]:P}),[T,P]),J=s((function(){return"generator"===F||V?[Z]:[]}),[F,Z,V]);m((function(){B.rebuild()}));var X=s((function(){return c.createElement("div",{className:te({"drip-form_objectContainer":"generator"===F&&!W},"drip-form_objectContainerFlex")},Te({uiComponents:d,dataSchema:v,uiSchema:h,errors:b,formData:O,onQuery:j,onValidate:E,dispatch:y,containerMap:D,parentUiSchemaKey:w,parentDataSchemaKey:S,parentFormDataKey:P,customComponents:f,get:K,getKey:k,containerHoc:C,arrayKey:T}))}),[T,C,D,f,v,y,b,P,O,F,K,k,W,j,E,S,w,d,h]);return c.createElement(c.Fragment,null,W?c.createElement($,Je(Je({defaultActiveKey:J},L),{},{className:te({"drip-form_objectContainer--collapse":x["$:dripStyle"]})}),c.createElement(G,Je({header:c.createElement(c.Fragment,null,c.createElement(Re,{titleUi:Q,requiredFields:o,fieldKey:P,description:l,uiComponents:d,theme:n,title:a}),c.createElement("span",{className:"object-container-err"},b[P])),extra:!0,key:Z,forceRender:R},H),X)):X)}));et.displayName="objectContainer";var tt=He(et),rt=["className"];function nt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ot(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?nt(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):nt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var at=l((function(e){var t=e.className,r=g(e,rt);return c.createElement("button",ot(ot({},r),{},{className:te("array-item--action",t)}))}));at.displayName="Action";var ct=at;function it(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var lt=l((function(t){return c.createElement(ct,function(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?it(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):it(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t),c.createElement("svg",{viewBox:"0 0 20 20",width:"12"},c.createElement("path",{d:"M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z"})))}));lt.displayName="Handle";var st=lt;function ut(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var pt=l((function(t){return c.createElement(ct,function(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?ut(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ut(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t),c.createElement("svg",{width:"8",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg"},c.createElement("path",{d:"M2.99998 -0.000206962C2.7441 -0.000206962 2.48794 0.0972617 2.29294 0.292762L0.292945 2.29276C-0.0980552 2.68376 -0.0980552 3.31682 0.292945 3.70682L7.58591 10.9998L0.292945 18.2928C-0.0980552 18.6838 -0.0980552 19.3168 0.292945 19.7068L2.29294 21.7068C2.68394 22.0978 3.31701 22.0978 3.70701 21.7068L11 14.4139L18.2929 21.7068C18.6829 22.0978 19.317 22.0978 19.707 21.7068L21.707 19.7068C22.098 19.3158 22.098 18.6828 21.707 18.2928L14.414 10.9998L21.707 3.70682C22.098 3.31682 22.098 2.68276 21.707 2.29276L19.707 0.292762C19.316 -0.0982383 18.6829 -0.0982383 18.2929 0.292762L11 7.58573L3.70701 0.292762C3.51151 0.0972617 3.25585 -0.000206962 2.99998 -0.000206962Z"})))}));pt.displayName="Remove";var mt=pt;function ft(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function dt(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?ft(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ft(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var yt=function(e){var t,r=e.id,n=e.index,o=e.isAdd,a=e.array,i=e.theme,l=e.customComponents,s=e.uiComponents,u=e.dispatch,p=e.fieldData,m=void 0===p?[]:p,f=e.dataSchema,d=e.uiSchema,y=e.errors,v=e.formData,h=e.onQuery,b=e.parentUiSchemaKey,g=e.parentDataSchemaKey,O=e.onValidate,j=e.uiProp,w=e.fieldKey,S=e.containerMap,E=e.get,P=e.getKey,D=e.containerHoc,K=e.arrayKey,k=$({fieldKey:w,dispatch:u,fieldData:m}).deltItem,C=j.serialText,x=void 0===C?{afterText:"",beforeText:"",serialLang:"number"}:C,F=j.showNo,T=j.hasConfirm,A=void 0!==T&&T,N=j.confirm,M=void 0===N?{confirmTitle:"确定删除这一项?",okText:"确定",cancelText:"取消"}:N,_=j.canDrag,R=j.showDeleteIcon,U=void 0===R?"hover":R,q=null===(t=s[i])||void 0===t?void 0:t.Popconfirm,z=le({id:r,disabled:!_}),L=z.attributes,B=z.listeners,H=z.setNodeRef,I=z.transform,Q=z.transition,G=z.isDragging,W={transform:fe.Transform.toString(I),transition:Q};return c.createElement("div",dt({ref:H,style:W},L),c.createElement("div",{className:te("array-item--field",{"array-item--field_last-child":o&&n===a.length-1})},c.createElement("div",{className:"array-item--header"},F?c.createElement("div",{className:"array-item--number"},x.beforeText,"CN"===x.serialLang?V(n+1):n+1,x.afterText):c.createElement("div",null),c.createElement("div",{className:"array-item--handle"},o&&!G&&(q&&A?c.createElement(q,{title:M.confirmTitle||"确定删除这一项?",onConfirm:k.bind(void 0,n),okText:M.okText||"确定",cancelText:M.cancelText||"取消"},c.createElement(mt,{className:te({"array-item--remove":"always"===U,"array-item--removehover":"hover"===U})})):c.createElement(mt,{className:te({"array-item--remove":"always"===U,"array-item--removehover":"hover"===U}),onClick:k.bind(void 0,n)})),o&&_&&c.createElement(st,dt({className:"array-item--move"},B)))),c.createElement("div",{className:"array-item--case"},Te({uiComponents:s,dataSchema:f,uiSchema:d,errors:y,formData:v,onQuery:h,onValidate:O,dispatch:u,containerHoc:D,containerMap:S,parentUiSchemaKey:b,parentDataSchemaKey:g,parentFormDataKey:w,customComponents:l,currentArrayKey:n,get:E,getKey:P,arrayKey:K}))))};function vt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ht(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?vt(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var bt=l((function(e){var t=e.dispatch,r=e.dataSchema,n=e.parentDataSchemaKey,o=e.fieldData,a=void 0===o?[]:o,i=e.uiProp,l=e.fieldKey,u=e.formMode,p=e.arrayKey,d=(n||[]).reduce((function(e,t){return"#"===t?e:e[t]}),r),y="Object"===_(d.items)?d.items.type:void 0,v=i.mode,h=void 0===v?"add":v,b=i.addTitle,g=void 0===b?"添加一行数据":b,O=i.maxAddCount,j=i.canDrag,w=s((function(){return"add"===h}),[h]),S=s((function(){return void 0===O||O>a.length}),[O,a]),E=s((function(){return["normal","tuple"].includes(h)}),[h]),P=$({fieldKey:l,dispatch:t,fieldData:a}),D=P.addItem,K=P.arrayMove,k=s((function(){return c.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1946",width:"12"},c.createElement("path",{d:"M576 64H448v384H64v128h384v384h128V576h384V448H576z",fill:"#262626","p-id":"1947"}))}),[]);m((function(){p[l]||t({type:"setArrayKey",action:{fieldKey:l}})}),[]);var C=re(ne(oe),ne(ae)),x=f((function(e){var t=e.active,r=e.over;if(t.id!==r.id&&p[l]){var n=p[l].indexOf(t.id),o=p[l].indexOf(r.id);K(n,o)}}),[p,K,l]),F=s((function(){return[pe,me]}),[]);return c.createElement(c.Fragment,null,j&&"generator"!=u?c.createElement(ce,{sensors:C,collisionDetection:ie,onDragEnd:x,modifiers:F},c.createElement(se,{items:p[l]||[],strategy:ue},(E?[""]:a).map((function(t,r,n){return c.createElement(yt,ht({key:p[l]&&p[l][r]||r,id:p[l]&&p[l][r]||String(r),array:n,index:r,isAdd:w},e))})))):("generator"===u||E?[""]:a).map((function(t,r,n){return c.createElement(yt,ht({key:p[l]&&p[l][r]||r,id:p[l]&&p[l][r]||String(r),array:n,index:r,isAdd:w},e))})),w&&S&&c.createElement("div",{className:"array-item--add",onClick:D.bind(void 0,a.length,"object"===y?{}:"array"===y?[]:void 0)},k,c.createElement("div",{className:"array-item--add_title"},g)))}));bt.displayName="arrayContainer";var gt={object:tt,array:He(bt),default:Ge},Ot=["text"],jt=["text"];function wt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function St(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?wt(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Et={left:"flex-start",center:"center",right:"flex-end"},Pt=l((function(e){var t,r,n,o=e.uiComponents,a=e.globalTheme,i=e.uiSchema,l=e.onSubmit,u=e.onCancel,p=e.submitReturn,m=e.dispatch,d=e.submit,y=e.initFormData,v=null===(t=o[a])||void 0===t?void 0:t.Button,b=s((function(){var e,t;return St(St({},null==i||null===(e=i.footer)||void 0===e?void 0:e.style),{},{justifyContent:Et[(null==i||null===(t=i.footer)||void 0===t?void 0:t.justifyContent)||"right"]})}),[null==i?void 0:i.footer]),O=s((function(){var e,t,r=(null==i||null===(e=i.footer)||void 0===e?void 0:e.onOk)||{},n=r.text,o=g(r,Ot),a=(null==i||null===(t=i.footer)||void 0===t?void 0:t.onCancel)||{};return{onOk:{text:n,ui:o},onCancel:{text:a.text,ui:g(a,jt)}}}),[null==i?void 0:i.footer]),w=f((function(e){var t="submit"===e?l:u;"submit"===e?h(j.mark((function e(){return j.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d();case 2:t&&t(p.current);case 3:case"end":return e.stop()}}),e)})))():t&&t(p.current),"cancel"===e&&m({type:"setData",action:{formData:y}})}),[m,y,u,l,d,p]);return v&&c.createElement("div",{className:"drip-form_container--footer",style:b},O.onOk.text&&c.createElement(v,St(St(St({},O.onOk.ui),(null==i||null===(r=i.footer)||void 0===r?void 0:r.margin)&&{style:{marginRight:null==i||null===(n=i.footer)||void 0===n?void 0:n.margin}}),{},{onClick:w.bind(null,"submit"),className:"drip-form_button--onOK"}),O.onOk.text),O.onCancel.text&&c.createElement(v,St(St({},O.onCancel.ui),{},{onClick:w.bind(null,"cancel")}),O.onCancel.text))})),Dt=["visibleFieldKey"];function Kt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function kt(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Kt(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Kt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ct=d((function(e,t){var r=e.formData,n=e.unitedSchema,o=e.ajv,a=e.uiComponents,i=e.customComponents,l=e.customFunc,u=e.control,d=e.onValidate,v=void 0===d?{}:d,S=e.onQuery,E=e.transform,D=e.containerHoc,C=e.onSubmit,x=e.onCancel,F=e.parse,A=e.reload,N=void 0===A||A,M=e.options,R=e.onEvent,U=e.globalData,V=e.onMount,H=e.fetchApi,I=p(V),Q=p(H),$=s((function(){return kt(kt({},G),{},{reload:N},M)}),[M,N]),te=W(n),re=W(r),ne=s((function(){if(F&&"function"==typeof F&&re!==r){var e=F(r||{});return"object"!==O(e)?(console.error("parse函数解析失败,请确认parse的返回值是一个对象!"),re):e}}),[r,F,re]),oe=s((function(){return K(n)}),[n]),ae=oe.uiSchema,ce=oe.dataSchema,ie=oe.typePath,le=oe.customProps,se=s((function(){return T(12)}),[]),ue=f((function(e,t,r){if("Object"===_(r))Object.keys(r).forEach((function(e){ue(r,e,r[e])}));else if("Array"===_(r))r.forEach((function(e,t){ue(r,t,e)}));else if("String"===_(r)){var n=r.match(/^\$\$/g);n&&n.length>0&&(e[t]=l&&Object.prototype.hasOwnProperty.call(l,r)?l[r]:(console.error("找不到与'".concat(r,"'对应的自定义方法,请检查'customFunc'")),r))}}),[l]),pe=s((function(){return w(ae,(function(e){var t,r=null!==(t=e.properties)&&void 0!==t?t:[];Object.keys(r).forEach((function(e){ue(r,e,r[e])}))}))}),[ae,ue]),me=s((function(){return{typePath:ie,uiSchema:pe,dataSchema:ce,formData:ye({schema:ce,formData:ne||r||{},ajv:o,customProps:le}).formData||{},errors:{},customErrors:{},ajvErrors:{},checking:!1,visibleFieldKey:[],changeKey:"",arrayKey:{},ignoreErrKey:[]}}),[ie,pe,ce,ne,r,o,le]),fe=s((function(){return me.visibleFieldKey,g(me,Dt)}),[me]),de=P(Ke,me),ve=b(de,2),he=ve[0],be=ve[1];m((function(){(te&&te!=n||re&&re!==r)&&$.reload&&be({type:"reset",action:{state:fe}})}),[be,re,r,me,ce,ne,ie,ae,te,n,fe,$.reload]);var ge=he.typePath,Oe=he.uiSchema,je=he.dataSchema,we=he.formData,Se=he.ajvErrors,Ee=he.customErrors,Pe=he.checking,ke=he.visibleFieldKey,Ce=he.changeKey,xe=he.arrayKey,Fe=s((function(){var e=kt(kt({},Se),he.errors);return Object.entries(Ee).map((function(t){var r=b(t,2),n=r[0],o=r[1];Object.prototype.hasOwnProperty.call(e,n)?e[n]="".concat(e[n],";").concat(o):e[n]=o})),e}),[Se,Ee,he.errors]),Ae=Oe.theme,Ne=void 0===Ae?"antd":Ae,Me=Oe.change,_e=Oe.flow;window[se]=we;var Re=Z(ye),Ue=J({dataSchema:je,uiSchema:Oe,typeMap:ge,dispatch:be,formData:we}),Ve=Ue.get,qe=Ue.set,ze=Ue.deleteField,Le=Ue.addField,Be=Ue.merge,He=X(ge).getKey,Ie=p({formData:we,errors:Fe,checking:Pe});m((function(){Ie.current={formData:w(we,(function(e){E&&E(e)})),errors:Fe,checking:Pe}}),[Pe,Fe,we,E]);var Qe=f((function(){var e={};Object.entries(v).map((function(t){var r=b(t,2),n=r[0],o=r[1];"submit"===o.type&&(e[n]=new Promise((function(e){e(o.fn(Ve(n).data))})))}));var t=Object.keys(e);return Promise.all(Object.values(e)).then((function(e){var r=[],n={};e.map((function(e,o){if(!e)return r.push(t[o]),!1;n[t[o]]=e})),be({type:"setErr",action:{set:n}}),be({type:"setErr",action:{deleteKeys:r}})})).then((function(){return Ie.current}))}),[be,Ve,v]),$e=f((function(){be({type:"reset",action:{state:fe}})}),[be,fe]),Ge=f(function(){var e=h(j.mark((function e(t){return j.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=R,!e.t0){e.next=5;break}return e.next=4,R(t);case 4:e.t0=e.sent;case 5:return e.abrupt("return",e.t0);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[R]),We=s((function(){return{errors:Fe,checking:Pe,submit:Qe,reset:$e,dispatch:be,get:Ve,set:qe,merge:Be,getKey:He,__generator__:{deleteField:ze,addField:Le},get formData(){return w(we,(function(e){E&&E(e)}))}}}),[Le,Pe,ze,be,Fe,we,Ve,He,Be,$e,qe,Qe,E]),Ze=p(We);m((function(){Ze.current=We}),[We]),y(t,(function(){return We}),[We]),m((function(){Re({dataSchema:je,formData:we,ajv:o,dispatch:be,visibleFieldKey:ke})}),[je,we,Re,be,ke,o]);var Je=Ve(Ce).data,Xe=W(Je);m((function(){if(u)try{u({formData:we,uiSchema:Oe,dataSchema:je,dispatch:be,changeKey:Ce,checking:Pe,get:Ve,set:qe,merge:Be,errors:Fe,deleteField:ze})}catch(e){console.error(e)}var e;if(Me)try{"function"==typeof Me?e=Me:"string"==typeof Me&&(e=new Function("props",Me)),e&&e({formData:we,uiSchema:Oe,dataSchema:je,dispatch:be,changeKey:Ce,checking:Pe,get:Ve,set:qe,merge:Be,deleteField:ze,errors:Fe})}catch(e){console.error("change函数体错误,请确认"),console.warn(e)}if(_e&&"generator"!==(null==n?void 0:n.formMode))try{var t=q(_e);z(Ve(Ce).data,Xe)||new Function("props",t)({get:Ve,set:qe,merge:Be,setDeepProp:k,changeKey:Ce})}catch(e){console.error("flow联动函数配置错误,请确认"),console.warn(e)}}),[u,je,be,_e,we,Oe,Ce,Pe,Ve,qe,Be,ze,Me,Fe,null==n?void 0:n.formMode,Xe]);var Ye=Ne,et=s((function(){return kt({globalFormDataStoreKey:se,fireEvent:Ge,fetchApi:Q.current||L},U?{globalData:U}:null)}),[Ge,se,U]);return m((function(){I.current&&I.current(Ze)}),[]),c.createElement(Y.Provider,{value:$},c.createElement(ee.Provider,{value:(null==je?void 0:je.requiredMode)||"default"},c.createElement(De.Provider,{value:et},c.createElement("div",{className:"drip-form-root"},Te({uiComponents:a,dataSchema:je,uiSchema:Oe,errors:Fe,formData:we,onQuery:S,onValidate:v,dispatch:be,customComponents:i,containerMap:gt,getKey:He,get:Ve,containerHoc:D,arrayKey:xe,isRoot:!0}),c.createElement(B,{clickable:!0}),c.createElement(Pt,{uiSchema:Oe,uiComponents:a,onSubmit:C,submit:Qe,submitReturn:Ie,onCancel:x,globalTheme:Ye,initFormData:me.formData,dispatch:be})))))}));Ct.defaultProps={onValidate:{},onQuery:{}},Ct.displayName="DripForm";var xt=l(Ct);function Ft(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Tt(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Ft(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ft(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function At(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=a(e);if(t){var c=a(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return o(this,r)}}var Nt=de.registerAjv,Mt=de.loadAjvPlugins,_t=function(e){n(a,v);var o=At(a);function a(e){var r;t(this,a),r=o.call(this,e);var n=e.uiComponents,c=e.unitedSchema,i=e.plugins,l=e.ajvOptions,s={error:!1,tips:"发生错误,请联系管理员!"},u=(null==c?void 0:c.theme)||"antd";u&&n[u]||(s.error=!0,s.tips="请确认导入的主题组件与uiSchema中配置的一致!");var p=Nt(l);return Mt(p,i),r.state={hasError:s.error,errorTips:s.tips,ajv:p},r}return r(a,[{key:"componentDidCatch",value:function(e,t){console.error(e,t.componentStack)}},{key:"render",value:function(){var e=this.state,t=e.hasError,r=e.errorTips,n=e.ajv;return t?c.createElement("div",{style:{color:"red"}},r):c.createElement(xt,Tt(Tt({},this.props),{},{ajv:n,ref:this.props.formRef}))}}],[{key:"getDerivedStateFromError",value:function(){return{hasError:!0}}}]),a}(),Rt=d((function(e,t){return c.createElement(_t,Tt({formRef:t},e))}));Rt.displayName="DripFormHoc";var Ut=l(Rt);export{gt as containerMap,Ut as default,Te as renderFunc};
import e from"@babel/runtime/helpers/esm/defineProperty";import t from"@babel/runtime/helpers/esm/classCallCheck";import r from"@babel/runtime/helpers/esm/createClass";import n from"@babel/runtime/helpers/esm/inherits";import o from"@babel/runtime/helpers/esm/possibleConstructorReturn";import a from"@babel/runtime/helpers/esm/getPrototypeOf";import c,{createContext as i,memo as l,useMemo as s,useContext as u,useRef as p,useEffect as m,useCallback as f,forwardRef as d,useImperativeHandle as y,PureComponent as v}from"react";import h from"@babel/runtime/helpers/esm/asyncToGenerator";import b from"@babel/runtime/helpers/esm/slicedToArray";import g from"@babel/runtime/helpers/esm/objectWithoutProperties";import O from"@babel/runtime/helpers/esm/typeof";import j from"@babel/runtime/regenerator";import w,{produce as S,current as E}from"immer";import{useImmerReducer as P}from"use-immer";import D from"@babel/runtime/helpers/esm/toConsumableArray";import{parseUnitedSchema as K,setDeepProp as k,combine as C,deleteDeepProp as x,generateArrayKeyReg as F,randomString as T,toArray as A,generateReg as N,upgradeTips as M,typeCheck as _,handleMargin as R,get as U,number2Chinese as V,parseFlow as q,isEqual as z,fetchFn as L}from"@jdfed/utils";import B from"react-tooltip";import{useContainer as H,useTitle as I,useGlobalOptions as Q,useArray as $,defaultGlobalOptions as G,usePrevious as W,validate as Z,useValidate as J,useSchema as X,useGetKey as Y,globalOptionsContext as ee,RequiredModeContext as te}from"@jdfed/hooks";import re from"classnames";import{useSensors as ne,useSensor as oe,PointerSensor as ae,MouseSensor as ce,DndContext as ie,closestCenter as le}from"@dnd-kit/core";import{useSortable as se,SortableContext as ue,verticalListSortingStrategy as pe}from"@dnd-kit/sortable";import{restrictToVerticalAxis as me,restrictToParentElement as fe}from"@dnd-kit/modifiers";import{CSS as de}from"@dnd-kit/utilities";import ye from"@jdfed/ajv";var ve=["validateTime","requiredMode"],he=function(t){var r=t.action,n=t.state,o=r.fieldKey,a=r.closestEdge,c=r.unitedSchema,i=r.overFieldKey,l=r.get,s=r.getKey,u=r.shouldDelete,p=r.getTypeKey,m=i.split("."),f=m.slice(0,m.length-1).join("."),d="over"===a?i:f,y=d,v=y.split(".");if(v.length>1){var h=l(v.slice(0,v.length-1).join(".")).uiSchema;if("array"===h.type)if(["normal","tuple"].includes(h.mode));else{var b=d.split(".");b.pop(),b.push("$container"),y=b.join(".")}}y=""!==y?p(y):"";var O={data:(d?s(d,"dataSchema"):"").split(".").filter((function(e){return e})),ui:(d?s(d,"uiSchema"):"").split(".").filter((function(e){return e}))},j=l(d),w=j.dataSchema,P=j.uiSchema,x=K(c),F=x.dataSchema;F.validateTime,F.requiredMode;var T=g(F,ve),A=x.uiSchema,N="object";"array"===P.type&&(N=["normal","tuple"].includes(P.mode)?"tuple":"array");var M=P.order||[];switch(N){case"object":var _=!u&&o,R="over"===a||m.length<=1?i:m.slice(m.length-1).join(),U=M.findIndex((function(e){return e===R})),V="over"===a?[o]:S(M,(function(e){var t=-1;_&&(t=e.findIndex((function(e){return e===o})));var r=["left","top"].includes(a)?U:U+1;e.splice(r,0,o),-1!=t&&e.splice(r<=t?t+1:t,1)}));if(k(O.ui.concat(["order"]),n.uiSchema,V),_)break;k(O.ui.concat(["properties",o]),n.uiSchema,A),k(O.data.concat(["properties",o]),n.dataSchema,T);break;case"array":var q,z=w.items||T,L=(null==P||null===(q=P.properties)||void 0===q?void 0:q.$container)||A;if("over"!==a){var B=z.fieldKey||"0";z=S(z,(function(t){var r;return{type:"object",title:"",properties:(r={},e(r,B,t),e(r,o,T),r)}})),L=S(L,(function(t){var r;return{type:"object",order:["left","top"].includes(a)?[o,B]:[B,o],properties:(r={},e(r,B,t),e(r,o,A),r)}}))}k(O.ui.concat(["order"]),n.uiSchema,["$container"]),k(O.ui.concat(["properties","$container"]),n.uiSchema,L),k(O.data.concat(["items"]),n.dataSchema,z);break;case"tuple":var H=i.split(".").pop(),I="over"===a?0:["left","top"].includes(a)?+H:+H+1,Q=Number(o),$=w.items||[],G="over"===a?[T]:S($,(function(e){e.splice(I,0,T),u||e.splice(I>Q?Q:Q+1,1)})),W="over"===a?["0"]:[].concat(D(M),[String(M.length)]),Z=P.properties||{},J="over"===a?{0:A}:S(Z,(function(e){var t,r;u?W.filter((function(e){return+e>=I})).sort((function(e,t){return+t-+e})).map((function(t){e[t]=+t===I?A:e[String(+t-1)]})):M.filter((function(e){return I>+o?(r="topToBottom",+e<I&&+e>=+o):(r="bottomToTop",+e<=+o&&+e>=I)})).sort((function(e,t){return+e-+t})).map((function(n,a){0===a&&(t=e[n]),e[n]=e[String(+n+1)],"topToBottom"==r?+n==I-1&&(e[n]=t):+n==+o&&(e[n]=t)}))}));k(O.ui.concat(["properties"]),n.uiSchema,J),k(O.data.concat(["items"]),n.dataSchema,G),u&&k(O.ui.concat(["order"]),n.uiSchema,W)}n.typePath=K(C(E(n.dataSchema),E(n.uiSchema))).typePath},be=function(e){var t=e.action,r=e.state,n=t.fieldKey,o=t.get,a=t.getKey;t.getTypeKey;var c=n.split("."),i=c.slice(0,c.length-1).join("."),l=o(i).uiSchema,s="object";"array"===l.type&&(s=["normal","tuple"].includes(l.mode)?"tuple":"array");var u=a(n,"uiSchema").split("."),p=a(n,"dataSchema").split("."),m=i?a(i,"uiSchema").split("."):[],f=""===i?["order"]:a(i,"uiSchema").split(".").concat("order");switch(s){case"array":x(f.concat(0),r.uiSchema),x(u,r.uiSchema),x(p,r.dataSchema);break;case"object":var d=(l.order||[]).findIndex((function(e){return e==n.split(".").pop()}));-1!=d&&x(f.concat(d),r.uiSchema),x(u,r.uiSchema),x(p,r.dataSchema);break;case"tuple":var y=l.order||[],v=y.slice(0,y.length-1);k(f,r.uiSchema,v),1===y.length?x(p.slice(0,p.length-1),r.dataSchema):x(p,r.dataSchema);var h=l.properties,b=S(h,(function(e){var t=y.findIndex((function(e){return e==n.split(".").pop()}));-1!=t&&(delete e[t],v.filter((function(e){return+e>=t})).map((function(t){e[t]=e[String(+t+1)]})))}));k(m.concat("properties"),r.uiSchema,b)}r.typePath=K(C(E(r.dataSchema),E(r.uiSchema))).typePath},ge=["type"],Oe=["type"],je=["type"],we=["type"],Se=["type"];function Ee(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pe(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Ee(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ee(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var De=i({globalFormDataStoreKey:""}),Ke=function(t,r){switch(r.type){case"reload":M("reload","reset"),r.type;var n=g(r,ge);Object.assign(t,n);break;case"reset":Object.assign(t,r.action.state);break;case"setDataSchema":M("setDataSchema","setValidate"),r.type;var o=g(r,Oe);if(o.dataSchema)t.dataSchema=o.dataSchema;else for(var a in o){var c=a.split(".");null!=o&&o.isDelete?x(c,t.dataSchema):k(c,t.dataSchema,o[a])}break;case"setValidate":var i=r.action,l=i.set,s=i.dataSchema,u=r.action.deleteKeys;if(l)for(var p in l)k(p.split("."),t.dataSchema,l[p]);u&&(u=A(u)).map((function(e){x(e.split("."),t.dataSchema)})),s&&(t.dataSchema=s);break;case"setUiSchema":M("setUiSchema","setUi"),r.type;var m=g(r,je);if(m.uiSchema)t.uiSchema=m.uiSchema;else for(var f in m){var d=f.split(".");k(d,t.uiSchema,m[f])}break;case"deleteUiSchema":M("deleteUiSchema","setUi");var y=r.key.split(".");x(y,t.uiSchema);break;case"setUi":var v=r.action,h=v.set,O=v.uiSchema,j=r.action.deleteKeys;if(h)for(var w in h)k(w.split("."),t.uiSchema,h[w]);j&&(j=A(j)).map((function(e){x(e.split("."),t.uiSchema)})),O&&(t.uiSchema=O);break;case"setFormData":M("setFormData","setData"),r.type;var S=g(r,we);if(S.formData)t.formData=S.formData;else for(var E in S)k(E.split("."),t.formData,S[E],t.typePath),t.changeKey=E;break;case"deleteFormData":M("setFormData","setData"),t.changeKey=r.key;var P=r.key.split(".");x(P,t.formData);break;case"setData":var K=r.action,C=K.set,R=K.formData,U=r.action.deleteKeys;if(C)for(var V in C)k(V.split("."),t.formData,C[V],t.typePath),t.changeKey=V;U&&(U=A(U)).map((function(e){t.changeKey=e,x(e.split("."),t.formData)})),R&&(t.formData=R);break;case"deleteField":be({action:r.action,state:t});break;case"addField":he({action:r.action,state:t});break;case"setAjvErr":var q=r.action.deleteKeys,z=r.action,L=z.errors,B=z.set;if(B)for(var H in B)t.ajvErrors[H]=B[H];q&&(q=A(q)).map((function(e){delete t.ajvErrors[e]})),L&&(t.ajvErrors=L);break;case"setError":M("setError","setErr"),r.type;var I=g(r,Se);if(I.errors&&"Object"===_(I.errors)){var Q={};(I.ignore&&Array.isArray(I.ignore)||t.ignoreErrKey.length>0)&&Array.from(new Set([].concat(D(I.ignore||[]),D(t.ignoreErrKey)))).map((function(e){t.errors[e]&&(Q[e]=t.errors[e])})),t.errors=Pe(Pe({},I.errors),Q)}else for(var $ in I){var G,W=I;null!=W&&null!==(G=W.action)&&void 0!==G&&G.ignore&&(t.ignoreErrKey=Array.from(new Set([].concat(D(t.ignoreErrKey),D(W.action.ignore))))),t.errors[$]=I[$]}break;case"deleteError":M("deleteError","setErr"),Array.isArray(r.key)?r.key.map((function(e){delete t.errors[e]})):delete t.errors[r.key];break;case"setErr":var Z=r.action.deleteKeys,J=r.action,X=J.errors,Y=J.set;if(Y)for(var ee in Y)t.customErrors[ee]=Y[ee];Z&&(Z=A(Z)).map((function(r){var n=[];if(Object.keys(t.customErrors).map((function(o){var a;new RegExp("^".concat(r.split(".").join("\\."),"(\\..+)*"),"g").test(o)&&delete t.customErrors[o];var c=Object.keys(t.typePath).find((function(e){var t=r.split(".");return t.pop(),N(t).test(e)}));if(c&&"array"===(null===(a=t.typePath[c])||void 0===a?void 0:a.type)){var i=r.split("."),l=i.pop(),s=new RegExp("^".concat(i.join("\\."),"\\.(\\d)(\\..+)*"),"g").exec(o);if(null!==s){var u=b(s,3),p=u[1],m=u[2];+p>=+l&&(n[+p]=Pe(Pe({},n[+p]),{},e({},m||"",t.customErrors[o])))}}})),n.length>0){var o=r.split(".");o.pop();var a=o.join(".");n.map((function(e,r){if(e)for(var n in e)t.customErrors["".concat(a,".").concat(+r+1).concat(n)]?t.customErrors["".concat(a,".").concat(r).concat(n)]=t.customErrors["".concat(a,".").concat(+r+1).concat(n)]:delete t.customErrors["".concat(a,".").concat(r).concat(n)]}))}})),X&&(t.customErrors=X);break;case"setChecking":t.checking="action"in r?r.action.checking:r.checking;break;case"setVisibleKey":var te=r.action,re=te.fieldKey,ne=te.deleteKeys;re&&(re=A(re),t.visibleFieldKey=Array.from(new Set([].concat(D(t.visibleFieldKey),D(re))))),ne&&(ne=A(ne),t.visibleFieldKey=t.visibleFieldKey.filter((function(e){var t;return!(null!==(t=ne)&&void 0!==t&&t.includes(e))})));break;case"setArrayKey":var oe=r.action,ae=oe.isDelete,ce=oe.fieldKey,ie=oe.order,le=oe.move,se=t.arrayKey[ce]||[],ue=Object.prototype.hasOwnProperty.call(r.action,"order");if(ae&&ue&&"number"==typeof ie){se.splice(ie,1);var pe=[];Object.keys(t.arrayKey).map((function(r){var n=F(ce.split(".").concat(String(ie))).exec(r);if(null!==n){var o=b(n,4),a=o[2],c=o[3];+a>=ie&&(pe[+a]=Pe(Pe({},pe[+a]),{},e({},c,t.arrayKey[r])))}})),pe.map((function(e,r){if(e)for(var n in e)r===pe.length-1?delete t.arrayKey["".concat(ce,".").concat(r).concat(n)]:t.arrayKey["".concat(ce,".").concat(r).concat(n)]=t.arrayKey["".concat(ce,".").concat(+r+1).concat(n)]}))}else{if(le){var me,fe;se.splice(le[1],0,se.splice(le[0],1)[0]);var de=[],ye=[],ve="";switch(Object.keys(t.arrayKey).map((function(r){var n=F(ce.split(".").concat(String(ie))).exec(r);if(null!==n){var o=b(n,4),a=o[2],c=o[3];le[0]<le[1]?(ve="topToBottom",+a>=le[0]&&+a<=le[1]&&(de[+a]=Pe(Pe({},de[+a]),{},e({},c,t.arrayKey[r])))):(ve="bottomToTop",+a<=le[0]&&+a>=le[1]&&(de[+a]=Pe(Pe({},de[+a]),{},e({},c,t.arrayKey[r]))))}})),Object.keys(t.customErrors).map((function(r){var n=ce.split("."),o=new RegExp("^".concat(n.join("\\."),"\\.(\\d)(\\..+)*"),"g").exec(r);if(null!==o){var a=b(o,3),c=a[1],i=a[2];le[0]<le[1]?(ve="topToBottom",+c>=le[0]&&+c<=le[1]&&(ye[+c]=Pe(Pe({},ye[+c]),{},e({},i||"",t.customErrors[r])))):(ve="bottomToTop",+c<=le[0]&&+c>=le[1]&&(ye[+c]=Pe(Pe({},ye[+c]),{},e({},i||"",t.customErrors[r]))))}})),ve){case"topToBottom":de.map((function(e,r){if(e)if(+r===le[0])for(var n in me=e,e)t.arrayKey["".concat(ce,".").concat(r).concat(n)]=t.arrayKey["".concat(ce,".").concat(+r+1).concat(n)];else if(+r===le[1])for(var o in me)t.arrayKey["".concat(ce,".").concat(r).concat(o)]=me[o];else for(var a in e)t.arrayKey["".concat(ce,".").concat(r).concat(a)]=t.arrayKey["".concat(ce,".").concat(+r+1).concat(a)]})),ye.map((function(e,r){if(e)if(+r===le[0])for(var n in fe=e,e)t.customErrors["".concat(ce,".").concat(r).concat(n)]=t.customErrors["".concat(ce,".").concat(+r+1).concat(n)];else if(+r===le[1])for(var o in fe)t.customErrors["".concat(ce,".").concat(r).concat(o)]=fe[o];else for(var a in e)t.customErrors["".concat(ce,".").concat(r).concat(a)]=t.customErrors["".concat(ce,".").concat(+r+1).concat(a)]}));break;case"bottomToTop":de.slice().reverse().map((function(e,r,n){if(e){var o=n.length-1-+r;if(o===le[0])for(var a in me=e,e)t.arrayKey["".concat(ce,".").concat(o).concat(a)]=t.arrayKey["".concat(ce,".").concat(o-1).concat(a)];else if(o===le[1])for(var c in me)t.arrayKey["".concat(ce,".").concat(o).concat(c)]=me[c];else for(var i in e)t.arrayKey["".concat(ce,".").concat(o).concat(i)]=t.arrayKey["".concat(ce,".").concat(o-1).concat(i)]}})),ye.slice().reverse().map((function(e,r,n){if(e){var o=n.length-1-+r;if(o===le[0])for(var a in fe=e,e)t.customErrors["".concat(ce,".").concat(o).concat(a)]=t.customErrors["".concat(ce,".").concat(o-1).concat(a)];else if(o===le[1])for(var c in fe)t.customErrors["".concat(ce,".").concat(o).concat(c)]=fe[c];else for(var i in e)t.customErrors["".concat(ce,".").concat(o).concat(i)]=t.customErrors["".concat(ce,".").concat(o-1).concat(i)]}}))}}else if(ue&&"number"==typeof ie)se[ie]=T(52);else try{se=ce.split(".").reduce((function(e,t){return e[t]?e[t]:[]}),t.formData).map((function(){return T(52)}))}catch(e){}t.arrayKey[ce]=se}}},ke=["title"];function Ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xe(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Ce(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ce(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Fe,Te=function(e){var t=e.uiComponents,r=e.dataSchema,n=e.uiSchema,o=e.errors,a=e.formData,i=e.onQuery,l=e.onValidate,s=e.dispatch,u=e.customComponents,p=e.parentUiSchemaKey,m=void 0===p?["#"]:p,f=e.parentDataSchemaKey,d=void 0===f?["#"]:f,y=e.parentFormDataKey,v=void 0===y?"":y,h=e.currentArrayKey,b=e.containerMap,O=e.containerHoc,j=e.get,w=e.getKey,S=e.isRoot,E=e.arrayKey,P=n.theme,D=void 0===P?"antd":P,K=n.title,k=void 0===K?{}:K,C=n.formMode,x=void 0===C?"edit":C,F=n.containerStyle,T=m.reduce((function(e,t){return"#"===t?e:e[t]}),n),A=d.reduce((function(e,t){return"#"===t?e:e[t]}),r),N=v.split(".").reduce((function(e,t){return""===t?e:e[t]||("array"===A.type?[]:{})}),a),M=T.order,_=T.properties,U=T.mode,V=T.type,q=void 0===V?"object":V,z="change"===r.validateTime;return(M||[]).map((function(e,p){var f,y,P,K,C=_[e].type,T="array"===q&&"$container"===e,M=d.concat(["array"===q?"items":"properties",T?"":e]).filter((function(e){return""!==e})),V=m.concat(["properties",e]),L="".concat(v,".").concat(T?h:e);if(L=L.replace(/^\./,""),!Object.prototype.hasOwnProperty.call(_,e))return console.log("Render Error: no schema for","color: #fff; background: #ffff00;padding: 3px",e),null;var B=A.required||[],H=(null===(f=_[e])||void 0===f?void 0:f.theme)||D,I=A["array"===q?"items":"properties"],Q="$container"===e?I.title:I[e].title;if("object"===q&&!A.properties[e])return null;if("array"===q)if("$container"==e);else if(!A.items[e])return null;var $=null==i?void 0:i[e],G=null==l?void 0:l[e],W=o[L]||"",Z=N[T?h:e],J=!Object.prototype.hasOwnProperty.call(_[e],"showTitle")||_[e].showTitle,X=Object.assign("object"===C&&"collapse"===(null===(y=_[e])||void 0===y?void 0:y.mode)?{marginBottom:20}:{},S?xe({width:"100%"},F):{width:"100%"},(null===(P=_[e])||void 0===P?void 0:P.containerStyle)||{});R(X);var Y=_[e];Y.title;var ee=g(Y,ke),te=Object.assign({placement:"left",width:"82px",textAlign:"left",verticalAlign:"center",requiredFields:!1,fontSize:12,color:"#000000"},k,(null===(K=_[e])||void 0===K?void 0:K.title)||{}),re=ee.description||null,ne=_[e].vcontrol,oe=!1;if(ne)try{oe=("function"==typeof ne?ne:new Function("props",ne))({formData:a,uiSchema:n,dataSchema:r,get:j,getKey:w,fieldKey:L,fieldData:Z})}catch(W){console.error("".concat(e,":vcontrol函数体错误,请确认")),console.error(W)}else oe=!0;if(!(oe&&b||"generator"===x))return null;var ae=b[C]||b.default,ce={uiProp:ee},ie={array:{},object:{}},le={containerHoc:O,dataSchema:r,uiSchema:n,errors:o,formData:a,onQuery:i,onValidate:l,parentUiSchemaKey:V,parentDataSchemaKey:M,parentFormDataKey:L,containerMap:b,get:j,arrayKey:E},se=xe(xe({formMode:ee.formMode||x,title:Q,theme:H,error:W,requiredFields:B,description:re,showTitle:J,titleUi:te,showError:z},"generator"!=x&&{containerStyle:X}),{},{type:C,key:e,queryFunc:$,asyncValidate:G,fieldKey:L,fieldData:Z,dispatch:s,uiComponents:t,getKey:w,customComponents:u});return O?O(c.createElement(ae,xe(xe(xe(xe({},ie[C]),ie[C]&&le),se),ce)),{fieldKey:L,error:W,containerStyle:X,type:C,parentMode:U,parentType:q,isFirst:!!S&&0===p,uiProp:ee,theme:H}):c.createElement(ae,xe(xe(xe(xe({},ie[C]),ie[C]&&le),se),ce))}))};!function(e){e.center="center",e.top="flex-start",e.bottom="flex-end",e.left="flex-start",e.right="flex-end"}(Fe||(Fe={}));var Ae=l((function(e){return c.createElement("svg",{"data-tip":e.title,"data-effect":"solid","data-html":"true","data-delay-hide":"100",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4928",width:"1em",height:"1em"},c.createElement("path",{d:"M512 938.666667c235.648 0 426.666667-191.018667 426.666667-426.666667S747.648 85.333333 512 85.333333 85.333333 276.352 85.333333 512s191.018667 426.666667 426.666667 426.666667z m0 85.333333C229.248 1024 0 794.752 0 512S229.248 0 512 0s512 229.248 512 512-229.248 512-512 512z",fill:"#3D3D3D","p-id":"4929"}),c.createElement("path",{d:"M520.96 232.106667c-62.293333 0-111.786667 17.92-147.626667 54.613333-36.693333 35.84-54.613333 84.48-54.613333 146.773333h90.453333c0-37.546667 7.68-67.413333 23.04-87.893333 17.066667-23.893333 45.226667-35.84 83.626667-35.84 30.72 0 54.613333 8.533333 71.68 25.6 16.213333 17.066667 24.746667 40.106667 24.746667 69.973333 0 22.186667-7.68 42.666667-23.04 62.293334l-14.506667 16.213333c-52.906667 46.933333-85.333333 81.92-97.28 105.813333-11.093333 22.186667-16.213333 49.493333-16.213333 81.066667v14.506667h91.306666v-14.506667c0-21.333333 4.266667-40.106667 13.653334-57.173333 7.68-15.36 19.626667-29.866667 34.986666-43.52 40.96-34.986667 64.853333-57.173333 72.533334-66.56 20.48-27.306667 31.573333-62.293333 31.573333-104.106667 0-51.2-17.066667-92.16-50.346667-122.026667-34.133333-30.72-78.506667-45.226667-133.973333-45.226666z m-14.506667 499.2c-17.92 0-32.426667 5.12-43.52 17.066666-12.8 11.093333-18.773333 25.6-18.773333 43.52 0 17.066667 5.973333 31.573333 18.773333 43.52 11.093333 11.946667 25.6 17.92 43.52 17.92 17.066667 0 32.426667-5.973333 45.226667-17.066666 11.946667-11.946667 17.92-26.453333 17.92-44.373334 0-17.92-5.973333-32.426667-17.92-43.52-11.946667-11.946667-27.306667-17.066667-45.226667-17.066666z",fill:"#3D3D3D","p-id":"4930"}))}));function Ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Me(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Ne(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ne(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var _e=l((function(e){var t,r=e.titleUi,n=e.requiredFields,o=e.fieldKey,a=e.description,i=e.uiComponents,l=e.theme,u=e.title,p=(null===(t=i[l])||void 0===t?void 0:t.QuestionCircle)||Ae,m=s((function(){var e;return Array.isArray(a)?((a||[]).map((function(t){"icon"===(null==t?void 0:t.type)&&(e=t)})),e):"object"===O(a)&&"icon"===(null==a?void 0:a.type)?a:void 0}),[a]);return c.createElement("div",{className:"form-container__title",style:Me(Me(Me(Me(Me(Me({},(null==r?void 0:r.width)&&{width:r.width}),(null==r?void 0:r.textAlign)&&{justifyContent:Fe[null==r?void 0:r.textAlign]}),(null==r?void 0:r.verticalAlign)&&{alignItems:Fe[null==r?void 0:r.verticalAlign]}),(null==r?void 0:r.margin)&&{margin:r.margin}),(null==r?void 0:r.fontSize)&&{fontSize:r.fontSize}),(null==r?void 0:r.color)&&{color:r.color})},null!=r&&r.requiredIcon&&n.includes(o.split(".").pop())?c.createElement("span",{style:{color:"red"}},"*"):"",u,(null==r?void 0:r.showColon)&&":",m&&"icon"===(null==m?void 0:m.type)&&(null==m?void 0:m.title)&&p&&c.createElement(p,Me({},m)))}));_e.displayName="Title";var Re=_e;function Ue(e){switch(e){case"top":return"title-top";case"right":return"title-right";case"bottom":return"title-bottom";default:return"title-left"}}function Ve(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"82px",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"left",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["0","10","0","0"],n=arguments.length>3?arguments[3]:void 0;if(!n)return"0";var o="".concat(e);return"0"!==r[1]&&(o+=" + ".concat(r[1])),"0"!==r[3]&&(o+=" + ".concat(r[3])),"left"===t?"0 0 0 calc(".concat(o,")"):"right"===t?"0 calc(".concat(o,") 0 0"):0}var qe=l((function(e){var t=e.titleUi,r=e.showTitle,n=e.description,o=e.showError,a=e.error,i=t||{},l=i.width,u=i.placement,p=i.margin,m=s((function(){var e;return Array.isArray(n)?((n||[]).map((function(t){"text"===(null==t?void 0:t.type)&&(e=t)})),e):"object"===O(n)&&"text"===(null==n?void 0:n.type)?n:void 0}),[n]);return c.createElement("div",{className:"form-container__other",style:{padding:Ve(l,u,p?p.split(" "):["0","10","0","0"],r)}},"text"===(null==m?void 0:m.type)&&(null==m?void 0:m.title)&&c.createElement("div",{className:"form-container__tips"},null==m?void 0:m.title),c.createElement("div",{className:re("form-container__error",{"form-container__error--no-title":!r})},o&&a))}));qe.displayName="Description";var ze=qe;function Le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Be(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Le(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Le(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var He=function(t,r){var n=r||{showDesAndErr:!0,showTitleEle:!0},o=n.showTitleEle,a=void 0===o||o,i=n.showDesAndErr,s=void 0===i||i,f=l((function(r){var n=r.titleUi,o=r.showTitle,i=r.description,l=r.showError,f=r.error,d=r.requiredFields,y=r.fieldKey,v=r.uiComponents,g=r.theme,O=r.title,w=r.dispatch,S=r.formMode,E=r.containerStyle,P=r.uiProp,D=r.type,K=r.customComponents,k=r.getKey,C=u(De),x=C.globalFormDataStoreKey,F=C.fetchApi;H({fieldKey:y,dispatch:w});var T,A=I(n),N=Q().undefinedComponent;if("custom"===D&&K)T=K[y];else{var M,_,R=D.split("::"),V=b(R,2),q=V[0],z=V[1];if(z)T=null===(M=v[q])||void 0===M?void 0:M[z];else T=null===(_=v[g])||void 0===_?void 0:_[D]}var L="console"===(null==N?void 0:N.type)&&!T,B=P.queryConfig,$=p("0"===(null==B?void 0:B.optionsType)&&(null==B?void 0:B.refreshId)||0);return m((function(){h(j.mark((function t(){var r,n,o,a,c,i,l,s,u,p,m,f,d;return j.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!F||"0"!==(null==B?void 0:B.optionsType)){t.next=15;break}return t.prev=1,r=B.refreshId,n=void 0===r?0:r,o=B.url,a=B.params,c=void 0===a?[]:a,i=B.method,l=void 0===i?"GET":i,s=B.dataPath,u=B.setPath,p=void 0===u?"options":u,$.current=n,m=c.map((function(e){var t=e.value.replace(/\{\{(formData.+?)\}\}/g,(function(e,t){try{return new Function("formData","return ".concat(t))(window[x])}catch(t){return e}}));return{key:e.key,value:t}})),t.next=7,F({params:m,url:o,method:l});case 7:f=t.sent,d=s?U(f,s):f,p&&n===$.current&&w({type:"setUi",action:{set:e({},"".concat(k(y,"uiSchema"),".").concat(p),d)}}),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(1),console.error(t.t0);case 15:case"end":return t.stop()}}),t,null,[[1,12]])})))()}),[B,w,F,y,k,x]),m((function(){"1"===(null==B?void 0:B.optionsType)&&w({type:"setUi",action:{set:e({},"".concat(k(y,"uiSchema"),".").concat(B.setPath),B.options)}})}),[]),L?null:c.createElement("div",{className:re("form-container",{"form-container-view":"view"===S,"form-container-generator":"generator"===S,"form-container-edit":"edit"===S}),style:Be(Be({},["array","object"].includes(P.type)?null==P?void 0:P.style:null),E)},c.createElement("div",{className:re("form-container--main",Ue(null==A?void 0:A.placement))},a&&o&&("object"!=P.type||"object"===P.type&&"collapse"!==P.mode)&&c.createElement(Re,{titleUi:A,requiredFields:d,fieldKey:y,description:i,uiComponents:v,theme:g,title:O}),c.createElement("div",{className:"form-container--content"},c.createElement(t,Be({},r)))),s&&("object"!==P.type||"object"===P.type&&"collapse"!==P.mode)&&c.createElement(ze,{titleUi:A,showTitle:o,description:i,showError:l,error:f}))}));return f.displayName="commoncontainer",f};function Ie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qe(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Ie(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ie(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var $e=l((function(t){var r=t.theme,n=t.error,o=t.fieldKey,a=t.type,i=t.uiProp,l=t.formMode,p=t.fieldData,m=t.queryFunc,d=t.customComponents,y=t.uiComponents,v=t.asyncValidate,h=t.dispatch,g=t.getKey,O=u(De),j=O.globalFormDataStoreKey,w=O.fireEvent,S=O.globalData,E=Q().undefinedComponent,P=s((function(){var e,t,n=function(e){return"function"==typeof(null==E?void 0:E.value)?E.value(e):(null==E?void 0:E.value)||""};if("custom"===a&&d)(t=d[o])||(e=n({fieldKey:o}));else{var s,u,f=a.split("::"),O=b(f,2),P=O[0],D=O[1];if(D)t=null===(s=y[P])||void 0===s?void 0:s[D];else t=null===(u=y[r])||void 0===u?void 0:u[a];t||(e=n({theme:D?P:r,type:D||a,fieldKey:o}))}if("console"===(null==E?void 0:E.type))switch(E.consoleType){case"log":console.log(e);break;case"warn":console.warn(e);break;case"error":console.error(e)}return t?c.createElement(t,Qe(Qe(Qe(Qe({fieldKey:o,fieldData:p,formMode:l,dispatch:h,getKey:g,fireEvent:w,globalformdatastorekey:j},S?{globalData:S}:null),i),m?{queryFunc:m}:null),v?{asyncValidate:v}:null)):"tips"==(null==E?void 0:E.type)&&e?c.createElement("span",{style:{color:"red"}},e):null}),[a,d,o,p,l,h,g,w,j,S,i,m,v,E,y,r]),D=f((function(){if(!n&&null!=v&&v.fn){var t=v.fn(p);null!=t&&t.then?t.then((function(t){h(t?{type:"setErr",action:{set:e({},o,t)}}:{type:"setErr",action:{deleteKeys:o}})})):h(t?{type:"setErr",action:{set:e({},o,t)}}:{type:"setErr",action:{deleteKeys:o}})}}),[v,h,n,p,o]);return v&&"click"===v.type?c.createElement("div",{className:"field__sure--container"},P,c.createElement("div",{className:re("field__sure--button",{"field__sure--button-disabled":n}),onClick:D},"确定")):P}));$e.displayName="fieldContainer";var Ge=He($e),We=["mode","forceRender","active"];function Ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Je(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Ze(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ze(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Xe=["collapsible","showArrow"],Ye=["bordered","destroyInactivePanel","expandIconPosition","ghost"],et=l((function(e){var t,r,n=e.theme,o=e.requiredFields,a=e.title,i=e.description,l=void 0===i?{type:"icon",title:""}:i,u=e.titleUi,p=e.showTitle,f=e.customComponents,d=e.uiComponents,y=e.dispatch,v=e.dataSchema,h=e.uiSchema,b=e.errors,O=e.formData,j=e.onQuery,w=e.parentUiSchemaKey,S=e.parentDataSchemaKey,E=e.onValidate,P=e.fieldKey,D=e.containerMap,K=e.get,k=e.getKey,C=e.containerHoc,x=e.uiProp,F=e.formMode,T=e.arrayKey,A=x||{mode:"normal",forceRender:!1,active:!1},N=A.mode,M=void 0===N?"normal":N,_=A.forceRender,R=void 0!==_&&_,U=A.active,V=void 0!==U&&U,q=g(A,We),z=s((function(){var e={},t={};return Object.keys(q).map((function(r){Xe.includes(r)?t[r]=q[r]:Ye.includes(r)&&(e[r]=q[r])})),{collapseProp:e,panelProp:t}}),[q]),L=z.collapseProp,H=z.panelProp,Q=I(u,"object"),$=null===(t=d[n])||void 0===t?void 0:t.Collapse,G=null===(r=d[n])||void 0===r?void 0:r.Collapse.Panel,W=$&&G&&"collapse"===M&&p,Z=s((function(){var e=P.split("."),t=e.pop(),r=e.join(".");return t&&T[r]&&T[r][+t]?T[r][+t]:P}),[T,P]),J=s((function(){return"generator"===F||V?[Z]:[]}),[F,Z,V]);m((function(){B.rebuild()}));var X=s((function(){return c.createElement("div",{className:re({"drip-form_objectContainer":"generator"===F&&!W},"drip-form_objectContainerFlex")},Te({uiComponents:d,dataSchema:v,uiSchema:h,errors:b,formData:O,onQuery:j,onValidate:E,dispatch:y,containerMap:D,parentUiSchemaKey:w,parentDataSchemaKey:S,parentFormDataKey:P,customComponents:f,get:K,getKey:k,containerHoc:C,arrayKey:T}))}),[T,C,D,f,v,y,b,P,O,F,K,k,W,j,E,S,w,d,h]);return c.createElement(c.Fragment,null,W?c.createElement($,Je(Je({defaultActiveKey:J},L),{},{className:re({"drip-form_objectContainer--collapse":x["$:dripStyle"]})}),c.createElement(G,Je({header:c.createElement(c.Fragment,null,c.createElement(Re,{titleUi:Q,requiredFields:o,fieldKey:P,description:l,uiComponents:d,theme:n,title:a}),c.createElement("span",{className:"object-container-err"},b[P])),extra:!0,key:Z,forceRender:R},H),X)):X)}));et.displayName="objectContainer";var tt=He(et),rt=["className"];function nt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ot(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?nt(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):nt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var at=l((function(e){var t=e.className,r=g(e,rt);return c.createElement("button",ot(ot({},r),{},{className:re("array-item--action",t)}))}));at.displayName="Action";var ct=at;function it(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var lt=l((function(t){return c.createElement(ct,function(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?it(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):it(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t),c.createElement("svg",{viewBox:"0 0 20 20",width:"12"},c.createElement("path",{d:"M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z"})))}));lt.displayName="Handle";var st=lt;function ut(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var pt=l((function(t){return c.createElement(ct,function(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?ut(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ut(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t),c.createElement("svg",{width:"8",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg"},c.createElement("path",{d:"M2.99998 -0.000206962C2.7441 -0.000206962 2.48794 0.0972617 2.29294 0.292762L0.292945 2.29276C-0.0980552 2.68376 -0.0980552 3.31682 0.292945 3.70682L7.58591 10.9998L0.292945 18.2928C-0.0980552 18.6838 -0.0980552 19.3168 0.292945 19.7068L2.29294 21.7068C2.68394 22.0978 3.31701 22.0978 3.70701 21.7068L11 14.4139L18.2929 21.7068C18.6829 22.0978 19.317 22.0978 19.707 21.7068L21.707 19.7068C22.098 19.3158 22.098 18.6828 21.707 18.2928L14.414 10.9998L21.707 3.70682C22.098 3.31682 22.098 2.68276 21.707 2.29276L19.707 0.292762C19.316 -0.0982383 18.6829 -0.0982383 18.2929 0.292762L11 7.58573L3.70701 0.292762C3.51151 0.0972617 3.25585 -0.000206962 2.99998 -0.000206962Z"})))}));pt.displayName="Remove";var mt=pt;function ft(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function dt(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?ft(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ft(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var yt=function(e){var t,r=e.id,n=e.index,o=e.isAdd,a=e.array,i=e.theme,l=e.customComponents,s=e.uiComponents,u=e.dispatch,p=e.fieldData,m=void 0===p?[]:p,f=e.dataSchema,d=e.uiSchema,y=e.errors,v=e.formData,h=e.onQuery,b=e.parentUiSchemaKey,g=e.parentDataSchemaKey,O=e.onValidate,j=e.uiProp,w=e.fieldKey,S=e.containerMap,E=e.get,P=e.getKey,D=e.containerHoc,K=e.arrayKey,k=$({fieldKey:w,dispatch:u,fieldData:m}).deltItem,C=j.serialText,x=void 0===C?{afterText:"",beforeText:"",serialLang:"number"}:C,F=j.showNo,T=j.hasConfirm,A=void 0!==T&&T,N=j.confirm,M=void 0===N?{confirmTitle:"确定删除这一项?",okText:"确定",cancelText:"取消"}:N,_=j.canDrag,R=j.showDeleteIcon,U=void 0===R?"hover":R,q=null===(t=s[i])||void 0===t?void 0:t.Popconfirm,z=se({id:r,disabled:!_}),L=z.attributes,B=z.listeners,H=z.setNodeRef,I=z.transform,Q=z.transition,G=z.isDragging,W={transform:de.Transform.toString(I),transition:Q};return c.createElement("div",dt({ref:H,style:W},L),c.createElement("div",{className:re("array-item--field",{"array-item--field_last-child":o&&n===a.length-1})},c.createElement("div",{className:"array-item--header"},F?c.createElement("div",{className:"array-item--number"},x.beforeText,"CN"===x.serialLang?V(n+1):n+1,x.afterText):c.createElement("div",null),c.createElement("div",{className:"array-item--handle"},o&&!G&&(q&&A?c.createElement(q,{title:M.confirmTitle||"确定删除这一项?",onConfirm:k.bind(void 0,n),okText:M.okText||"确定",cancelText:M.cancelText||"取消"},c.createElement(mt,{className:re({"array-item--remove":"always"===U,"array-item--removehover":"hover"===U})})):c.createElement(mt,{className:re({"array-item--remove":"always"===U,"array-item--removehover":"hover"===U}),onClick:k.bind(void 0,n)})),o&&_&&c.createElement(st,dt({className:"array-item--move"},B)))),c.createElement("div",{className:"array-item--case"},Te({uiComponents:s,dataSchema:f,uiSchema:d,errors:y,formData:v,onQuery:h,onValidate:O,dispatch:u,containerHoc:D,containerMap:S,parentUiSchemaKey:b,parentDataSchemaKey:g,parentFormDataKey:w,customComponents:l,currentArrayKey:n,get:E,getKey:P,arrayKey:K}))))};function vt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ht(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?vt(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var bt=l((function(e){var t=e.dispatch,r=e.dataSchema,n=e.parentDataSchemaKey,o=e.fieldData,a=void 0===o?[]:o,i=e.uiProp,l=e.fieldKey,u=e.formMode,p=e.arrayKey,d=(n||[]).reduce((function(e,t){return"#"===t?e:e[t]}),r),y="Object"===_(d.items)?d.items.type:void 0,v=i.mode,h=void 0===v?"add":v,b=i.addTitle,g=void 0===b?"添加一行数据":b,O=i.maxAddCount,j=i.canDrag,w=s((function(){return"add"===h}),[h]),S=s((function(){return void 0===O||O>a.length}),[O,a]),E=s((function(){return["normal","tuple"].includes(h)}),[h]),P=$({fieldKey:l,dispatch:t,fieldData:a}),D=P.addItem,K=P.arrayMove,k=s((function(){return c.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1946",width:"12"},c.createElement("path",{d:"M576 64H448v384H64v128h384v384h128V576h384V448H576z",fill:"#262626","p-id":"1947"}))}),[]);m((function(){p[l]||t({type:"setArrayKey",action:{fieldKey:l}})}),[]);var C=ne(oe(ae),oe(ce)),x=f((function(e){var t=e.active,r=e.over;if(t.id!==r.id&&p[l]){var n=p[l].indexOf(t.id),o=p[l].indexOf(r.id);K(n,o)}}),[p,K,l]),F=s((function(){return[me,fe]}),[]);return c.createElement(c.Fragment,null,j&&"generator"!=u?c.createElement(ie,{sensors:C,collisionDetection:le,onDragEnd:x,modifiers:F},c.createElement(ue,{items:p[l]||[],strategy:pe},(E?[""]:a).map((function(t,r,n){return c.createElement(yt,ht({key:p[l]&&p[l][r]||r,id:p[l]&&p[l][r]||String(r),array:n,index:r,isAdd:w},e))})))):("generator"===u||E?[""]:a).map((function(t,r,n){return c.createElement(yt,ht({key:p[l]&&p[l][r]||r,id:p[l]&&p[l][r]||String(r),array:n,index:r,isAdd:w},e))})),w&&S&&c.createElement("div",{className:"array-item--add",onClick:D.bind(void 0,a.length,"object"===y?{}:"array"===y?[]:void 0)},k,c.createElement("div",{className:"array-item--add_title"},g)))}));bt.displayName="arrayContainer";var gt={object:tt,array:He(bt),default:Ge},Ot=["text"],jt=["text"];function wt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function St(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?wt(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Et={left:"flex-start",center:"center",right:"flex-end"},Pt=l((function(e){var t,r,n,o=e.uiComponents,a=e.globalTheme,i=e.uiSchema,l=e.onSubmit,u=e.onCancel,p=e.submitReturn,m=e.dispatch,d=e.submit,y=e.initFormData,v=null===(t=o[a])||void 0===t?void 0:t.Button,b=s((function(){var e,t;return St(St({},null==i||null===(e=i.footer)||void 0===e?void 0:e.style),{},{justifyContent:Et[(null==i||null===(t=i.footer)||void 0===t?void 0:t.justifyContent)||"right"]})}),[null==i?void 0:i.footer]),O=s((function(){var e,t,r=(null==i||null===(e=i.footer)||void 0===e?void 0:e.onOk)||{},n=r.text,o=g(r,Ot),a=(null==i||null===(t=i.footer)||void 0===t?void 0:t.onCancel)||{};return{onOk:{text:n,ui:o},onCancel:{text:a.text,ui:g(a,jt)}}}),[null==i?void 0:i.footer]),w=f((function(e){var t="submit"===e?l:u;"submit"===e?h(j.mark((function e(){return j.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d();case 2:t&&t(p.current);case 3:case"end":return e.stop()}}),e)})))():t&&t(p.current),"cancel"===e&&m({type:"setData",action:{formData:y}})}),[m,y,u,l,d,p]);return v&&c.createElement("div",{className:"drip-form_container--footer",style:b},O.onOk.text&&c.createElement(v,St(St(St({},O.onOk.ui),(null==i||null===(r=i.footer)||void 0===r?void 0:r.margin)&&{style:{marginRight:null==i||null===(n=i.footer)||void 0===n?void 0:n.margin}}),{},{onClick:w.bind(null,"submit"),className:"drip-form_button--onOK"}),O.onOk.text),O.onCancel.text&&c.createElement(v,St(St({},O.onCancel.ui),{},{onClick:w.bind(null,"cancel")}),O.onCancel.text))})),Dt=["visibleFieldKey"];function Kt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function kt(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Kt(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Kt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ct=d((function(e,t){var r=e.formData,n=e.unitedSchema,o=e.ajv,a=e.uiComponents,i=e.customComponents,l=e.customFunc,u=e.control,d=e.onValidate,v=void 0===d?{}:d,S=e.onQuery,E=e.transform,D=e.containerHoc,C=e.onSubmit,x=e.onCancel,F=e.parse,A=e.reload,N=void 0===A||A,M=e.options,R=e.onEvent,U=e.globalData,V=e.onMount,H=e.fetchApi,I=p(V),Q=p(H),$=s((function(){return kt(kt({},G),{},{reload:N},M)}),[M,N]),re=W(n),ne=W(r),oe=s((function(){if(F&&"function"==typeof F&&ne!==r){var e=F(r||{});return"object"!==O(e)?(console.error("parse函数解析失败,请确认parse的返回值是一个对象!"),ne):e}}),[r,F,ne]),ae=s((function(){return K(n)}),[n]),ce=ae.uiSchema,ie=ae.dataSchema,le=ae.typePath,se=ae.customProps,ue=s((function(){return T(12)}),[]),pe=f((function(e,t,r){if("Object"===_(r))Object.keys(r).forEach((function(e){pe(r,e,r[e])}));else if("Array"===_(r))r.forEach((function(e,t){pe(r,t,e)}));else if("String"===_(r)){var n=r.match(/^\$\$/g);n&&n.length>0&&(e[t]=l&&Object.prototype.hasOwnProperty.call(l,r)?l[r]:(console.error("找不到与'".concat(r,"'对应的自定义方法,请检查'customFunc'")),r))}}),[l]),me=s((function(){return w(ce,(function(e){var t,r=null!==(t=e.properties)&&void 0!==t?t:[];Object.keys(r).forEach((function(e){pe(r,e,r[e])}))}))}),[ce,pe]),fe=s((function(){return{typePath:le,uiSchema:me,dataSchema:ie,formData:Z({schema:ie,formData:oe||r||{},ajv:o,customProps:se}).formData||{},errors:{},customErrors:{},ajvErrors:{},checking:!1,visibleFieldKey:[],changeKey:"",arrayKey:{},ignoreErrKey:[]}}),[le,me,ie,oe,r,o,se]),de=s((function(){return fe.visibleFieldKey,g(fe,Dt)}),[fe]),ye=P(Ke,fe),ve=b(ye,2),he=ve[0],be=ve[1];m((function(){(re&&re!=n||ne&&ne!==r)&&$.reload&&be({type:"reset",action:{state:de}})}),[be,ne,r,fe,ie,oe,le,ce,re,n,de,$.reload]);var ge=he.typePath,Oe=he.uiSchema,je=he.dataSchema,we=he.formData,Se=he.ajvErrors,Ee=he.customErrors,Pe=he.checking,ke=he.visibleFieldKey,Ce=he.changeKey,xe=he.arrayKey,Fe=s((function(){var e=kt(kt({},Se),he.errors);return Object.entries(Ee).map((function(t){var r=b(t,2),n=r[0],o=r[1];Object.prototype.hasOwnProperty.call(e,n)?e[n]="".concat(e[n],";").concat(o):e[n]=o})),e}),[Se,Ee,he.errors]),Ae=Oe.theme,Ne=void 0===Ae?"antd":Ae,Me=Oe.change,_e=Oe.flow;window[ue]=we;var Re=J($.ajvValidateDelay),Ue=X({dataSchema:je,uiSchema:Oe,typeMap:ge,dispatch:be,formData:we}),Ve=Ue.get,qe=Ue.set,ze=Ue.deleteField,Le=Ue.addField,Be=Ue.merge,He=Y(ge).getKey,Ie=p({formData:we,errors:Fe,checking:Pe});m((function(){Ie.current={formData:w(we,(function(e){E&&E(e)})),errors:Fe,checking:Pe}}),[Pe,Fe,we,E]);var Qe=f((function(){var e={};Object.entries(v).map((function(t){var r=b(t,2),n=r[0],o=r[1];"submit"===o.type&&(e[n]=new Promise((function(e){e(o.fn(Ve(n).data))})))}));var t=Object.keys(e);return Promise.all(Object.values(e)).then((function(e){var r=[],n={};e.map((function(e,o){if(!e)return r.push(t[o]),!1;n[t[o]]=e})),be({type:"setErr",action:{set:n}}),be({type:"setErr",action:{deleteKeys:r}})})).then((function(){return Ie.current}))}),[be,Ve,v]),$e=f((function(){be({type:"reset",action:{state:de}})}),[be,de]),Ge=f(function(){var e=h(j.mark((function e(t){return j.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=R,!e.t0){e.next=5;break}return e.next=4,R(t);case 4:e.t0=e.sent;case 5:return e.abrupt("return",e.t0);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[R]),We=s((function(){return{errors:Fe,checking:Pe,submit:Qe,reset:$e,dispatch:be,get:Ve,set:qe,merge:Be,getKey:He,__generator__:{deleteField:ze,addField:Le},get formData(){return w(we,(function(e){E&&E(e)}))}}}),[Le,Pe,ze,be,Fe,we,Ve,He,Be,$e,qe,Qe,E]),Ze=p(We);m((function(){Ze.current=We}),[We]),y(t,(function(){return We}),[We]),m((function(){Re({dataSchema:je,formData:we,ajv:o,dispatch:be,visibleFieldKey:ke})}),[je,we,Re,be,ke,o]);var Je=Ve(Ce).data,Xe=W(Je);m((function(){if(u)try{u({formData:we,uiSchema:Oe,dataSchema:je,dispatch:be,changeKey:Ce,checking:Pe,get:Ve,set:qe,merge:Be,errors:Fe,deleteField:ze})}catch(e){console.error(e)}var e;if(Me)try{"function"==typeof Me?e=Me:"string"==typeof Me&&(e=new Function("props",Me)),e&&e({formData:we,uiSchema:Oe,dataSchema:je,dispatch:be,changeKey:Ce,checking:Pe,get:Ve,set:qe,merge:Be,deleteField:ze,errors:Fe})}catch(e){console.error("change函数体错误,请确认"),console.warn(e)}if(_e&&"generator"!==(null==n?void 0:n.formMode))try{var t=q(_e);z(Ve(Ce).data,Xe)||new Function("props",t)({get:Ve,set:qe,merge:Be,setDeepProp:k,changeKey:Ce})}catch(e){console.error("flow联动函数配置错误,请确认"),console.warn(e)}}),[u,je,be,_e,we,Oe,Ce,Pe,Ve,qe,Be,ze,Me,Fe,null==n?void 0:n.formMode,Xe]);var Ye=Ne,et=s((function(){return kt({globalFormDataStoreKey:ue,fireEvent:Ge,fetchApi:Q.current||L},U?{globalData:U}:null)}),[Ge,ue,U]);return m((function(){I.current&&I.current(Ze)}),[]),c.createElement(ee.Provider,{value:$},c.createElement(te.Provider,{value:(null==je?void 0:je.requiredMode)||"default"},c.createElement(De.Provider,{value:et},c.createElement("div",{className:"drip-form-root"},Te({uiComponents:a,dataSchema:je,uiSchema:Oe,errors:Fe,formData:we,onQuery:S,onValidate:v,dispatch:be,customComponents:i,containerMap:gt,getKey:He,get:Ve,containerHoc:D,arrayKey:xe,isRoot:!0}),c.createElement(B,{clickable:!0}),c.createElement(Pt,{uiSchema:Oe,uiComponents:a,onSubmit:C,submit:Qe,submitReturn:Ie,onCancel:x,globalTheme:Ye,initFormData:fe.formData,dispatch:be})))))}));Ct.defaultProps={onValidate:{},onQuery:{}},Ct.displayName="DripForm";var xt=l(Ct);function Ft(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Tt(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?Ft(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ft(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function At(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=a(e);if(t){var c=a(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return o(this,r)}}var Nt=ye.registerAjv,Mt=ye.loadAjvPlugins,_t=function(e){n(a,v);var o=At(a);function a(e){var r;t(this,a),r=o.call(this,e);var n=e.uiComponents,c=e.unitedSchema,i=e.plugins,l=e.ajvOptions,s={error:!1,tips:"发生错误,请联系管理员!"},u=(null==c?void 0:c.theme)||"antd";u&&n[u]||(s.error=!0,s.tips="请确认导入的主题组件与uiSchema中配置的一致!");var p=Nt(l);return Mt(p,i),r.state={hasError:s.error,errorTips:s.tips,ajv:p},r}return r(a,[{key:"componentDidCatch",value:function(e,t){console.error(e,t.componentStack)}},{key:"render",value:function(){var e=this.state,t=e.hasError,r=e.errorTips,n=e.ajv;return t?c.createElement("div",{style:{color:"red"}},r):c.createElement(xt,Tt(Tt({},this.props),{},{ajv:n,ref:this.props.formRef}))}}],[{key:"getDerivedStateFromError",value:function(){return{hasError:!0}}}]),a}(),Rt=d((function(e,t){return c.createElement(_t,Tt({formRef:t},e))}));Rt.displayName="DripFormHoc";var Ut=l(Rt);export{gt as containerMap,Ut as default,Te as renderFunc};
//# sourceMappingURL=index.js.map
{
"name": "@jdfed/drip-form",
"version": "0.9.0-alpha.12",
"version": "0.9.0-alpha.13",
"description": "drip-form表单渲染core",

@@ -51,5 +51,5 @@ "keywords": [

"@dnd-kit/utilities": "^3.0.0",
"@jdfed/ajv": "^0.9.0-alpha.12",
"@jdfed/hooks": "^0.9.0-alpha.12",
"@jdfed/utils": "^0.9.0-alpha.12",
"@jdfed/ajv": "^0.9.0-alpha.13",
"@jdfed/hooks": "^0.9.0-alpha.13",
"@jdfed/utils": "^0.9.0-alpha.13",
"ajv": "^8.6.2",

@@ -65,3 +65,3 @@ "classnames": "^2.2.6",

},
"gitHead": "e9d7c69097773e2e1f8363ec5abd9139a6943f3e"
"gitHead": "446d9e2731836661f025af35bd13714d28823407"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc