@form-create/tdesign
Version:
TDesign版本低代码表单|FormCreate 是一个可以通过 JSON 生成具有动态渲染、数据收集、验证和提交功能的低代码表单生成组件。支持6个UI框架,适配移动端,并且支持生成任何 Vue 组件。内置20种常用表单组件和自定义组件,再复杂的表单都可以轻松搞定。
7 lines • 133 kB
JavaScript
/*!
* @form-create/tdesign v3.2.35
* (c) 2018-2025 xaboy
* Github https://github.com/xaboy/form-create
* Released under the MIT License.
*/
import{openBlock as e,createElementBlock as t,createElementVNode as n,defineComponent as r,h as i,resolveComponent as o,createVNode as a,nextTick as u,mergeProps as c,Fragment as l,markRaw as s,reactive as f,isVNode as d,getCurrentInstance as p,provide as h,inject as v,toRefs as m,onBeforeMount as g,watchEffect as y,onMounted as b,onBeforeUnmount as _,onUpdated as x,watch as $,computed as w,toRef as k,withDirectives as C,resolveDirective as S,createApp as O,ref as F}from"vue";function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function V(e){return V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},V(e)}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}function P(e,t){return P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},P(e,t)}function I(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function B(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 n,r=A(e);if(t){var i=A(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}function T(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){u=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw i}}return o}(e,t)||N(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(e){return function(e){if(Array.isArray(e))return M(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||N(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function N(e,t){if(e){if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(e,t):void 0}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function q(e){return Array.isArray(e)?e:[null,void 0,""].indexOf(e)>-1?[]:[e]}function U(e){e=e||new Map;var t={$on:function(t,n){var r=e.get(t);r&&r.push(n)||e.set(t,[n])},$once:function(e,n){n._once=!0,t.$on(e,n)},$off:function(t,n){var r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},$emit:function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];(e.get(n)||[]).slice().map((function(e){e._once&&(t.$off(n,e),delete e._once),e.apply(void 0,i)})),(e.get("*")||[]).slice().map((function(e){e(n,i)}))}};return t}function H(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}H("._fc-frame ._fc-files img{display:inline-block;height:100%;vertical-align:top;width:100%}._fc-frame ._fc-upload-cover{background:rgba(0,0,0,.6);bottom:0;left:0;opacity:0;position:absolute;right:0;top:0;transition:opacity .3s}._fc-frame ._fc-upload-cover ._fc-frame-icon{color:#fff;font-size:20px;margin:0 2px}._fc-frame ._fc-files:hover ._fc-upload-cover{opacity:1}._fc-frame .t-upload{display:block}._fc-frame ._fc-frame-icon,._fc-frame ._fc-upload-btn{cursor:pointer;font-size:20px;width:20px}._fc-frame._fc-disabled ._fc-frame-icon,._fc-frame._fc-disabled ._fc-upload-btn{color:#999;cursor:not-allowed!important}._fc-frame .t-input-adornment__append ._fc-frame-icon{margin:5px 12px 0}._fc-files,._fc-frame ._fc-upload-btn{background:#fff;border:1px solid #c0ccda;box-shadow:2px 2px 5px rgba(0,0,0,.1);box-sizing:border-box;display:inline-block;height:112px;line-height:112px;margin-right:4px;overflow:hidden;position:relative;text-align:center;width:112px}");var z={name:"IconFolder"},G={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},J=[n("path",{d:"M26 20h-2v4h-4v2h4v4h2v-4h4v-2h-4z",fill:"currentColor"},null,-1),n("path",{d:"M28 8H16l-3.4-3.4c-.4-.4-.9-.6-1.4-.6H4c-1.1 0-2 .9-2 2v20c0 1.1.9 2 2 2h14v-2H4V6h7.2l3.4 3.4l.6.6H28v8h2v-8c0-1.1-.9-2-2-2z",fill:"currentColor"},null,-1)];z.render=function(n,r,i,o,a,u){return e(),t("svg",G,J)};var W=r({name:"IconFile",render:function(){return i("svg",{style:{width:"20px",fontSize:"20px"},viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},i("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),i("path",{d:"M17 21H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7l5 5v11a2 2 0 0 1-2 2z"})))}}),K={name:"DeleteOutlined"},X={height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},Q=[n("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z",fill:"currentColor"},null,-1)];K.render=function(n,r,i,o,a,u){return e(),t("svg",X,Q)};var Z={name:"EyeOutlined"},Y={height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},ee=[n("path",{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 0 0 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3c7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176s176-78.8 176-176s-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112s112 50.1 112 112s-50.1 112-112 112z",fill:"currentColor"},null,-1)];Z.render=function(n,r,i,o,a,u){return e(),t("svg",Y,ee)};var te=r({name:"fcFrame",props:{type:{type:String,default:"input"},field:String,helper:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},src:{type:String,required:!0},icon:{type:String,default:"icon-folder"},width:{type:[Number,String],default:"500px"},height:{type:[Number,String],default:"370px"},maxLength:{type:Number,default:0},okBtnText:{type:String,default:""},closeBtnText:{type:String,default:""},modalTitle:String,handleIcon:{type:[String,Boolean],default:void 0},title:String,allowRemove:{type:Boolean,default:!0},onOpen:{type:Function,default:function(){}},onOk:{type:Function,default:function(){}},onCancel:{type:Function,default:function(){}},onLoad:{type:Function,default:function(){}},onBeforeRemove:{type:Function,default:function(){}},onRemove:{type:Function,default:function(){}},onHandle:Function,modal:{type:Object,default:function(){return{}}},srcKey:[String,Number],modelValue:[Array,String,Number,Object],previewMask:void 0,footer:{type:Boolean,default:!0},reload:{type:Boolean,default:!0},closeBtn:{type:Boolean,default:!0},okBtn:{type:Boolean,default:!0},formCreateInject:Object},emits:["update:modelValue","change"],components:{IconFolder:z,EyeOutlined:Z},data:function(){return{fileList:q(this.modelValue),previewVisible:!1,frameVisible:!1,previewImage:"",bus:new U}},watch:{modelValue:function(e){this.fileList=q(e)}},methods:{key:function(e){return e},close:function(){this.closeModal(!0)},closeModal:function(e){this.bus.$emit(e?"$close":"$ok"),this.reload&&(this.bus.$off("$ok"),this.bus.$off("$close")),this.frameVisible=!1},handleCancel:function(){this.previewVisible=!1},showModal:function(){this.disabled||!1===this.onOpen()||(this.frameVisible=!0)},input:function(){var e=this.fileList,t=1===this.maxLength?e[0]||"":e;this.$emit("update:modelValue",t),this.$emit("change",t)},makeInput:function(){var e=this,t=o(this.icon);return a(o("t-input-adornment"),{append:function(){return a(t,{onClick:e.showModal,class:"_fc-frame-icon"},null)}},{default:function(){return[a(o("TInput"),{readonly:!0,clearable:!e.disabled,showClearIconOnEmpty:!e.disabled,value:e.fileList.map((function(t){return e.getSrc(t)})).toString(),onClear:function(){e.fileList=[],e.input()},key:1},null)]}})},makeGroup:function(e){return(!this.maxLength||this.fileList.length<this.maxLength)&&e.push(this.makeBtn()),a("div",{key:2},[e])},makeItem:function(e,t){return a("div",{class:"_fc-files",key:"3"+e},[t])},valid:function(e){var t=this.formCreateInject.field||this.field;if(t&&e!==t)throw new Error("[frame]无效的字段值")},makeIcons:function(e,t){if(!1!==this.handleIcon||!0===this.allowRemove){var n=[];return("file"!==this.type&&!1!==this.handleIcon||"file"===this.type&&this.handleIcon)&&n.push(this.makeHandleIcon(e,t)),this.allowRemove&&n.push(this.makeRemoveIcon(e,t)),a("div",{class:"_fc-upload-cover",key:4},[n])}},makeHandleIcon:function(e,t){var n=this,r=o(!0===this.handleIcon||void 0===this.handleIcon?"EyeOutlined":this.handleIcon);return a(r,{class:"_fc-frame-icon",onClick:function(){return n.handleClick(e)},key:"5"+t},null)},makeRemoveIcon:function(e,t){var n=this;return a(K,{class:"_fc-frame-icon",onClick:function(){return n.handleRemove(e)},key:"6"+t},null)},makeFiles:function(){var e=this;return this.makeGroup(this.fileList.map((function(t,n){return e.makeItem(n,[a(W,{size:"20",onClick:function(){return e.handleClick(t)}},null),e.makeIcons(t,n)])})))},makeImages:function(){var e=this;return this.makeGroup(this.fileList.map((function(t,n){return e.makeItem(n,[a("img",{src:e.getSrc(t)},null),e.makeIcons(t,n)])})))},makeBtn:function(){var e=this,t=o(this.icon);return a("div",{class:"_fc-upload-btn",onClick:function(){return e.showModal()},key:7},[a(t,{class:"_fc-frame-icon"},null)])},handleClick:function(e){if(this.onHandle)return this.onHandle(e);this.previewImage=this.getSrc(e),this.previewVisible=!0},handleRemove:function(e){this.disabled||!1!==this.onBeforeRemove(e)&&(this.fileList.splice(this.fileList.indexOf(e),1),this.input(),this.onRemove(e))},getSrc:function(e){return this.srcKey?e[this.srcKey]:e},frameLoad:function(e){var t=this;this.onLoad(e);try{!0===this.helper&&(e.form_create_helper={api:this.formCreateInject.api,close:function(e){t.valid(e),t.closeModal()},set:function(e,n){t.valid(e),t.disabled||(t.$emit("update:modelValue",n),t.$emit("change",n))},get:function(e){return t.valid(e),t.modelValue},onOk:function(e){return t.bus.$on("$ok",e)},onClose:function(e){return t.bus.$on("$close",e)}})}catch(e){console.error(e)}},makeFooter:function(){var e=this,t=this.$props,n=t.okBtnText,r=t.closeBtnText,i=t.closeBtn,u=t.okBtn,c=[];return t.footer?(i&&c.push(a(o("TButton"),{onClick:function(){return!1!==e.onCancel()&&e.closeModal(!0)}},{default:function(){return[r||e.formCreateInject.t("close")||"关闭"]}})),u&&c.push(a(o("TButton"),{theme:"primary",onClick:function(){return!1!==e.onOk()&&e.closeModal()}},{default:function(){return[n||e.formCreateInject.t("ok")||"确定"]}})),c):c}},render:function(){var e,t=this,n=this.type;e="input"===n?this.makeInput():"image"===n?this.makeImages():this.makeFiles();var r=this.$props,i=r.width,l=void 0===i?"30%":i,s=r.height,f=r.src,d=r.title,p=r.modalTitle;return u((function(){t.$refs.frame&&t.frameLoad(t.$refs.frame.contentWindow||{})})),a("div",{class:{"_fc-frame":!0,"_fc-disabled":this.disabled}},[e,a(o("TDialog"),{mask:this.previewMask,header:p,visible:this.previewVisible,style:"width: 600px;",attach:"body","onUpdate:visible":function(e){return t.previewVisible=e},footer:!1},{default:function(){return[a("img",{style:"width: 100%",src:t.previewImage,key:1},null)]}}),a(o("TDialog"),c(R({width:l,header:d},this.modal),{visible:this.frameVisible,attach:"body",style:{width:l},onClose:function(){return t.frameVisible=!1},onConfirm:function(){return t.closeModal(!0)},key:2}),{default:function(){return[t.frameVisible||!t.reload?a("iframe",{ref:"frame",src:f,frameborder:"0",style:{height:s,border:"0 none",width:"100%"}},null):null]},action:function(){return t.makeFooter()}})])},beforeMount:function(){var e=this.formCreateInject,t=e.name,n=e.field,r=e.api;t&&r.on("fc:closeModal:"+t,this.close),n&&r.on("fc:closeModal:"+n,this.close)},beforeUnmount:function(){var e=this.formCreateInject,t=e.name,n=e.field,r=e.api;t&&r.off("fc:closeModal:"+t,this.close),n&&r.off("fc:closeModal:"+n,this.close)}});function ne(e,t){return"object"===V(e)?e:{url:e,is_string:!0,name:ie(e),status:"success",uid:t}}function re(e){return R(R({},e),{},{file:e,value:e})}function ie(e){return(""+e).split("/").pop()}var oe=r({name:"fcUpload",inheritAttrs:!1,formCreateParser:{toFormValue:function(e){return q(e)},toValue:function(e,t){return 1===t.prop.props.limit?e[0]||"":e}},props:{limit:{type:Number,default:0},formCreateInject:Object,modelValue:{type:[Array,String,Object],default:[]},onSuccess:{type:Function},onRemove:{type:Function}},emits:["update:modelValue","fc.el"],data:function(){return{uploadList:q(this.modelValue).map(ne).map(re)}},watch:{modelValue:function(e){this.uploadList=q(e).map(ne).map(re)}},methods:{handleRemove:function(e){var t=e.index;this.uploadList.splice(t,1),this.onRemove&&this.onRemove.apply(this,arguments),this.input()},handleSuccess:function(e){var t=e.file,n=e.fileList;this.uploadList=n,"success"===t.status&&this.onSuccess&&this.onSuccess.apply(this,arguments),this.input()},input:function(){this.$emit("update:modelValue",this.uploadList.map((function(e){return e.is_string?e.url:e.value||e.url})).filter((function(e){return void 0!==e})))}},render:function(){var e=this.uploadList,t=this.handleSuccess,n=this.handleRemove,r=this.$slots;return a(l,null,[a(o("t-upload"),c({max:this.limit,theme:"image",accept:"image/*",modelValue:e},this.$attrs,{onSuccess:t,onRemove:n,ref:"el"}),r)])},mounted:function(){this.$emit("fc.el",this.$refs.el)}}),ae={type:function(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"},Undef:function(e){return null==e},Element:function(e){return"object"===V(e)&&null!==e&&1===e.nodeType&&!ae.Object(e)},trueArray:function(e){return Array.isArray(e)&&e.length>0},Function:function(e){var t=this.getType(e);return"Function"===t||"AsyncFunction"===t},getType:function(e){var t=Object.prototype.toString.call(e);return/^\[object (.*)\]$/.exec(t)[1]},empty:function(e){return null==e||(!(!Array.isArray(e)||!Array.isArray(e)||e.length)||"string"==typeof e&&!e)}};function ue(e,t){return{}.hasOwnProperty.call(e,t)}function ce(e,t,n){e[t]=n}function le(e,t){delete e[t]}function se(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=!1;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=t[i];if((r=Array.isArray(o))||ae.Object(o)){var a=void 0===e[i];if(r)r=!1,a&&ce(e,i,[]);else if(o._clone&&void 0!==n){if(!n){ce(e,i,o._clone());continue}o=o.getRule(),a&&ce(e,i,{})}else a&&ce(e,i,{});e[i]=se(e[i],o,n)}else ce(e,i,o),ae.Undef(o)||(ae.Undef(o.__json)||(e[i].__json=o.__json),ae.Undef(o.__origin)||(e[i].__origin=o.__origin))}return void 0!==n&&Array.isArray(e)?e.filter((function(e){return!e||!e.__ctrl})):e}function fe(e){return se({},{value:e}).value}["Date","Object","String","Boolean","Array","Number"].forEach((function(e){ae[e]=function(t){return ae.type(t,e)}}));var de=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&ce(e,r,t[r]);return e};function pe(){return de.apply(this,arguments)}function he(e){return"object"!==V(e)||null===e?e:e instanceof Array?L(e):R({},e)}function ve(e,t){var n=null;return function(){for(var r=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];null!==n&&clearTimeout(n),n=setTimeout((function(){return e.call.apply(e,[r].concat(o))}),t)}}function me(e){return null==e?"":"object"===V(e)?JSON.stringify(e,null,2):String(e)}function ge(e){return function(e){return e&&"object"===V(e)&&"function"==typeof e.then}(e)?e:Promise.resolve(e)}function ye(e){var t=e.replace(/([A-Z])/g,"-$1").toLocaleLowerCase();return 0===t.indexOf("-")&&(t=t.substr(1)),t}function be(e){return e.replace(e[0],e[0].toLocaleUpperCase())}function _e(e,t,n){return"[form-create ".concat(e,"]: ").concat(t)+(n?"\n\nrule: "+JSON.stringify(n.getRule?n.getRule():n):"")}function xe(e,t){console.error(_e("err",e,t))}H('._fc-group{display:flex;flex-direction:column;justify-content:center;min-height:38px;width:100%}._fc-group-disabled ._fc-group-add,._fc-group-disabled ._fc-group-btn{cursor:not-allowed}._fc-group-handle{background-color:#fff;border:1px dashed #d9d9d9;border-radius:15px;bottom:-15px;display:flex;flex-direction:row;padding:3px 8px;position:absolute;right:30px}._fc-group-btn{cursor:pointer}._fc-group-idx{align-items:center;background:#eee;border-radius:15px;bottom:-15px;display:flex;font-weight:700;height:30px;justify-content:center;left:10px;position:absolute;width:30px}._fc-group-handle ._fc-group-btn+._fc-group-btn{margin-left:7px}._fc-group-container{border:1px dashed #d9d9d9;border-radius:5px;display:flex;flex-direction:column;margin:5px 5px 25px;padding:20px 20px 25px;position:relative}._fc-group-arrow{height:20px;position:relative;width:20px}._fc-group-arrow:before{border-left:2px solid #999;border-top:2px solid #999;content:"";height:9px;left:5px;position:absolute;top:8px;transform:rotate(45deg);width:9px}._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group-plus-minus{cursor:pointer;height:20px;position:relative;width:20px}._fc-group-plus-minus:after,._fc-group-plus-minus:before{background-color:#409eff;content:"";height:2px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:60%}._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group-plus-minus._fc-group-minus:after{background-color:#f56c6c}._fc-group-add{border:1px solid rgba(64,158,255,.5);border-radius:15px;cursor:pointer;height:25px;width:25px}._fc-group-add._fc-group-plus-minus:after,._fc-group-add._fc-group-plus-minus:before{width:50%}._fc-group._fc-group-card{display:flex;flex-direction:column;gap:16px;width:100%}._fc-group._fc-group-card._fc-group-disabled ._fc-group-add,._fc-group._fc-group-card._fc-group-disabled ._fc-group-btn{cursor:not-allowed;opacity:.5}._fc-group._fc-group-card ._fc-group-container{background:#fff;border:1px solid #f0f0f0;border-radius:6px;display:flex;flex-direction:column;margin:0;overflow:hidden;padding:0;position:relative}._fc-group._fc-group-card ._fc-group-header{align-items:center;background:#fafafa;border-bottom:1px solid #f0f0f0;display:flex;justify-content:space-between;padding:16px 20px 12px}._fc-group._fc-group-card ._fc-group-idx{align-items:center;background:#f0f0f0;border:1px solid #e0e0e0;border-radius:6px;color:#666;display:flex;flex-shrink:0;font-size:12px;font-weight:500;height:24px;justify-content:center;margin-right:12px;position:static;width:24px}._fc-group._fc-group-card ._fc-group-title{color:rgba(0,0,0,.85);flex:1;font-size:14px;font-weight:500;line-height:1.5715}._fc-group._fc-group-card ._fc-group-handle{align-items:center;background-color:transparent;border:none;border-radius:0;bottom:auto;display:flex;flex-direction:row;flex-shrink:0;gap:4px;margin-left:12px;padding:0;position:static;right:auto}._fc-group._fc-group-card ._fc-group-btn{align-items:center;background:#fff;border:1px solid #d9d9d9;border-radius:4px;color:rgba(0,0,0,.45);cursor:pointer;display:flex;height:24px;justify-content:center;position:relative;width:24px}._fc-group._fc-group-card ._fc-group-btn:hover{background:#f0f8ff;border-color:#1890ff;color:#1890ff}._fc-group._fc-group-card ._fc-group-btn:active{border-color:#096dd9;color:#096dd9}._fc-group._fc-group-card ._fc-group-arrow{position:relative}._fc-group._fc-group-card ._fc-group-arrow:before{border-left:1px solid;border-top:1px solid;content:"";height:5px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%) rotate(45deg);width:5px}._fc-group._fc-group-card ._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group._fc-group-card ._fc-group-sort{align-items:center;display:flex;flex-direction:column;height:24px;justify-content:center;position:relative}._fc-group._fc-group-card ._fc-group-sort:after,._fc-group._fc-group-card ._fc-group-sort:before{border-left:1px solid;border-top:1px solid;content:"";height:4px;left:50%;position:absolute;transform:translateX(-50%);width:4px}._fc-group._fc-group-card ._fc-group-sort:before{top:6px;transform:translateX(-50%) rotate(45deg)}._fc-group._fc-group-card ._fc-group-sort:after{bottom:6px;transform:translateX(-50%) rotate(225deg)}._fc-group._fc-group-card ._fc-group-sort-down,._fc-group._fc-group-card ._fc-group-sort-up{cursor:pointer;height:12px;left:0;position:absolute;right:0;z-index:1}._fc-group._fc-group-card ._fc-group-sort-up{top:0}._fc-group._fc-group-card ._fc-group-sort-down{bottom:0}._fc-group._fc-group-card ._fc-group-sort-down:hover,._fc-group._fc-group-card ._fc-group-sort-up:hover{background:rgba(24,144,255,.1)}._fc-group._fc-group-card ._fc-group-plus-minus{background:#409eff;border-color:#409eff;color:#fff;height:24px;position:relative;width:24px}._fc-group._fc-group-card ._fc-group-plus-minus:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}._fc-group._fc-group-card ._fc-group-plus-minus:after,._fc-group._fc-group-card ._fc-group-plus-minus:before{background-color:currentColor;content:"";height:1px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:8px}._fc-group._fc-group-card ._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus{background:#f56c6c;border-color:#f56c6c}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus:hover{background:#f78989;border-color:#f78989}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group._fc-group-card ._fc-group-content{padding:20px}._fc-group._fc-group-card ._fc-group-add{align-items:center;background:#fff;border:1px solid #d9d9d9;border-radius:4px;color:rgba(0,0,0,.45);cursor:pointer;display:flex;height:24px;justify-content:center;position:relative;width:24px}._fc-group._fc-group-card ._fc-group-add:hover{background:#f0f8ff;border-color:#409eff;color:#409eff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus{background:#409eff;border-color:#409eff;color:#fff;height:24px;width:24px}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:after,._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:before{background-color:currentColor;content:"";height:1px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:8px}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group._fc-group-card ._fc-group-empty{color:rgba(0,0,0,.45);font-size:14px;padding:40px 20px;text-align:center}@media (max-width:768px){._fc-group._fc-group-card ._fc-group-container{border-left:none;border-radius:0;border-right:none;margin:0 -8px}._fc-group._fc-group-card ._fc-group-header{padding:12px 16px 8px}._fc-group._fc-group-card ._fc-group-content{padding:16px}._fc-group._fc-group-card ._fc-group-handle{gap:2px}._fc-group._fc-group-card ._fc-group-btn{height:22px;width:22px}}');var $e="[[FORM-CREATE-PREFIX-",we="-FORM-CREATE-SUFFIX]]";function ke(e,t){return JSON.stringify(se(Array.isArray(e)?[]:{},e,!0),(function(e,t){if(!t||!0!==t._isVue){if("function"!=typeof t)return t;if(t.__json)return t.__json;if(t.__origin&&(t=t.__origin),!t.__emit)return $e+t+we}}),t)}function Ce(e){return new Function("return "+e)()}function Se(e,t){if(e&&ae.String(e)&&e.length>4){var n=e.trim(),r=!1;try{if(n.indexOf(we)>0&&0===n.indexOf($e))n=n.replace(we,"").replace($e,""),r=!0;else if(0===n.indexOf("$FN:"))n=n.substring(4),r=!0;else if(0===n.indexOf("$EXEC:"))n=n.substring(6),r=!0;else{if(0===n.indexOf("$GLOBAL:")){var i=n.substring(8);return n=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0].api.getGlobalEvent(i);if(r)return r.call.apply(r,[this].concat(t))},n.__json=e,n.__inject=!0,n}if(0===n.indexOf("$FNX:"))return(n=Ce("function($inject){\n"+n.substring(5)+"\n}")).__json=e,n.__inject=!0,n;(t||0!==n.indexOf("function ")||"function "===n)&&(t||0!==n.indexOf("function(")||"function("===n)||(r=!0)}if(!r)return e;var o;try{o=Ce(n)}catch(e){o=Ce("function "+n)}return o.__json=e,o}catch(e){return void xe("解析失败:".concat(n,"\n\nerr: ").concat(e))}}return e}function Oe(e,t){return JSON.parse(e,(function(e,n){return ae.Undef(n)||!n.indexOf?n:Se(n,t)}))}var Fe=0;function je(){var e=370+ ++Fe;return"F"+Math.random().toString(36).substr(3,3)+Number("".concat(Date.now())).toString(36)+e.toString(36)+"c"}function Re(e,t,n){var r,i=e;return(t||"").split(".").forEach((function(e){r&&(i[r]&&"object"==V(i[r])||(i[r]={}),i=i[r]),r=e})),i[r]=n,i}var Ve=r({name:"fcGroup",props:{field:String,rule:Array,expand:Number,options:Object,button:{type:Boolean,default:!0},max:{type:Number,default:0},min:{type:Number,default:0},modelValue:{type:Array,default:function(){return[]}},defaultValue:Object,sortBtn:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},title:{type:[String,Function],default:null},type:{type:String,default:"default"},onBeforeRemove:{type:Function,default:function(){}},onBeforeAdd:{type:Function,default:function(){}},formCreateInject:Object,parse:Function},data:function(){return{len:0,cacheRule:{},cacheValue:{},sort:[],form:s(this.formCreateInject.form.$form())}},emits:["update:modelValue","change","itemMounted","remove","add"],watch:{rule:{handler:function(e,t){var n=this;Object.keys(this.cacheRule).forEach((function(r){var i=n.cacheRule[r];if(i.$f){var o=i.$f.formData();if(e===t)i.$f.deferSyncValue((function(){se(i.rule,e),i.$f.setValue(o)}),!0);else{var a=i.$f.formData();i.$f.once("reloading",(function(){i.$f.setValue(a)})),i.rule=fe(e)}}}))},deep:!0},expand:function(e){var t=e-this.modelValue.length;t>0&&this.expandRule(t)},modelValue:{handler:function(e){var t=this;e=e||[];var n=this.sort,r=n.length,i=r-e.length;if(i<0){for(var o=i;o<0;o++)this.addRule(e.length+o,!0);for(var a=0;a<r;a++)this.setValue(n[a],e[a])}else{if(i>0)for(var u=0;u<i;u++)this.removeRule(n[r-u-1]);e.forEach((function(r,i){t.setValue(n[i],e[i])}))}},deep:!0}},methods:{_value:function(e){return e&&ue(e,this.field)?e[this.field]:e},cache:function(e,t){this.cacheValue[e]=JSON.stringify(t)},input:function(e){this.$emit("update:modelValue",e),this.$emit("change",e)},formData:function(e,t){var n=this,r=this.cacheRule,i=this.sort;if(i.filter((function(e){return r[e]&&r[e].$f})).length===i.length){var o=i.map((function(r){var i=e===r?t:R({},n.cacheRule[r].$f.form),o=n.field?i[n.field]||null:i;return n.cache(r,o),o}));this.input(o)}},setValue:function(e,t){var n=this.field;n&&(t=D({},n,this._value(t))),this.cacheValue[e]!==JSON.stringify(n?t[n]:t)&&(this.cacheRule[e].$f&&this.cacheRule[e].$f.coverValue(t),this.cache(e,t))},addRule:function(e,t){var n=this,r=this.formCreateInject.form.copyRules(this.rule||[]),i=this.options?R({},this.options):{submitBtn:!1,resetBtn:!1};if(this.defaultValue){i.formData||(i.formData={});var o=fe(this.defaultValue);pe(i.formData,this.field?D({},this.field,o):o)}this.parse&&this.parse({rule:r,options:i,index:this.sort.length}),this.cacheRule[++this.len]={rule:r,options:i},this.sort=Object.keys(this.cacheRule),t&&u((function(){return n.$emit("add",r,Object.keys(n.cacheRule).length-1)}))},add$f:function(e,t,n){var r=this;this.cacheRule[t].$f=n,u((function(){r.$emit("itemMounted",n,Object.keys(r.cacheRule).indexOf(t))}))},removeRule:function(e,t){var n=this,r=Object.keys(this.cacheRule).indexOf(e);delete this.cacheRule[e],delete this.cacheValue[e],this.sort=Object.keys(this.cacheRule),t&&u((function(){return n.$emit("remove",r)}))},add:function(e){if(!this.disabled&&!1!==this.onBeforeAdd(this.modelValue)){var t=L(this.modelValue);t.push(this.defaultValue?fe(this.defaultValue):this.field?null:{}),this.input(t)}},del:function(e,t){var n=this;if(!this.disabled){var r=function(){n.removeRule(t,!0);var r=L(n.modelValue);r.splice(e,1),n.input(r)};ge(this.onBeforeRemove(this.modelValue,e)).then((function(e){!1!==e&&r()}))}},addIcon:function(e){return a("div",{class:"_fc-group-btn _fc-group-plus-minus",onClick:this.add},null)},delIcon:function(e,t){var n=this;return a("div",{class:"_fc-group-btn _fc-group-plus-minus _fc-group-minus",onClick:function(){return n.del(e,t)}},null)},sortUpIcon:function(e){var t=this;return a("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-up",onClick:function(){return t.changeSort(e,-1)}},null)},sortDownIcon:function(e){var t=this;return a("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-down",onClick:function(){return t.changeSort(e,1)}},null)},changeSort:function(e,t){var n=this,r=this.sort[e];this.sort[e]=this.sort[e+t],this.sort[e+t]=r,this.formCreateInject.subForm(this.sort.map((function(e){return n.cacheRule[e].$f}))),this.formData(0)},sortIcon:function(e,t){var n=this,r=e>0,i=e<t-1;return r||i?r&&i?a("div",{class:"_fc-group-btn _fc-group-sort"},[a("div",{class:"_fc-group-sort-up",onClick:function(){return n.changeSort(e,-1)}},null),a("div",{class:"_fc-group-sort-down",onClick:function(){return n.changeSort(e,1)}},null)]):r?this.sortUpIcon(e):i?this.sortDownIcon(e):void 0:null},makeIcon:function(e,t,n){var r=this;if(this.$slots.button)return this.$slots.button({total:e,index:t,vm:this,key:n,del:function(){return r.del(t,n)},add:this.add});var i=[];if((!this.max||e<this.max)&&e===t+1&&i.push(this.addIcon(n)),e>this.min&&i.push(this.delIcon(t,n)),this.sortBtn){var o=this.sortIcon(t,e);o&&i.push(o)}return i},expandRule:function(e){for(var t=0;t<e;t++)this.modelValue.push(this.field?null:{});this.input(L(this.modelValue))},getTitle:function(e,t){return"function"==typeof this.title?this.title(e,this.modelValue[e],t):"string"==typeof this.title&&this.title.replace("{index}",e+1)}},created:function(){for(var e=(this.expand||0)-this.modelValue.length,t=0;t<this.modelValue.length;t++)this.addRule(t);e>0&&this.expandRule(e)},render:function(){var e=this,t=this.sort,n=this.button,r=this.form,i=this.disabled,o="card"===this.type,u=0===t.length?this.$slots.default?this.$slots.default({vm:this,add:this.add}):a("div",{key:"a_def",class:"_fc-group-plus-minus _fc-group-add fc-clock",onClick:this.add},null):t.map((function(u,l){var s=e.cacheRule[u],f=s.rule,d=s.options,p=n&&!i?e.makeIcon(t.length,l,u):[],h=e.getTitle(l,u);return a("div",{class:"_fc-group-container",key:u},o?[a("div",{class:"_fc-group-header"},[!1===h?a("div",{class:"_fc-group-idx"},[l+1]):null,!1!==h?a("div",{class:"_fc-group-title"},[h]):null,a("div",{class:"_fc-group-handle fc-clock"},[p.length?p:null])]),a("div",{class:"_fc-group-content"},[a(r,c({key:u},{disabled:i,"onUpdate:modelValue":function(t){return e.formData(u,t)},"onUpdate:api":function(t){return e.add$f(l,u,t)},inFor:!0,modelValue:e.field?D({},e.field,e._value(e.modelValue[l])):e.modelValue[l],rule:f,option:d,extendOption:!0}),null)])]:[a(r,c({key:u},{disabled:i,"onUpdate:modelValue":function(t){return e.formData(u,t)},"onUpdate:api":function(t){return e.add$f(l,u,t)},inFor:!0,modelValue:e.field?D({},e.field,e._value(e.modelValue[l])):e.modelValue[l],rule:f,option:d,extendOption:!0}),null),a("div",{class:"_fc-group-idx"},[l+1]),p.length?a("div",{class:"_fc-group-handle fc-clock"},[p]):null])}));return a("div",{key:"con",class:"_fc-group "+(i?"_fc-group-disabled":"")+(o?" _fc-group-card":"")},[u])}}),Ee=r({name:"fcSubForm",props:{rule:Array,options:{type:Object,default:function(){return f({submitBtn:!1,resetBtn:!1})}},modelValue:{type:Object,default:function(){return{}}},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},formCreateInject:Object},data:function(){return{cacheValue:{},subApi:{},form:s(this.formCreateInject.form.$form())}},emits:["fc:subform","update:modelValue","change","itemMounted"],watch:{modelValue:function(e){this.setValue(e)}},methods:{formData:function(e){this.cacheValue=JSON.stringify(e),this.$emit("update:modelValue",e),this.$emit("change",e)},setValue:function(e){var t=JSON.stringify(e);this.cacheValue!==t&&(this.cacheValue=t,this.subApi.coverValue(e||{}))},add$f:function(e){var t=this;this.subApi=e,u((function(){t.$emit("itemMounted",e)}))}},render:function(){var e=this.form;return a(e,{disabled:this.disabled,"onUpdate:modelValue":this.formData,modelValue:this.modelValue,"onUpdate:api":this.add$f,rule:this.rule,option:this.options,extendOption:!0},null)}}),De={name:"QuestionCircleOutlined"},Ae={height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},Pe=[n("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448s448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372s372 166.6 372 372s-166.6 372-372 372z",fill:"currentColor"},null,-1),n("path",{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7c-21.2 8.1-39.2 22.3-52.1 40.9c-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0 1 30.9-44.8c59-22.7 97.1-74.7 97.1-132.5c.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1 0 80 0a40 40 0 1 0-80 0z",fill:"currentColor"},null,-1)];De.render=function(n,r,i,o,a,u){return e(),t("svg",Ae,Pe)};var Ie=[te,oe,Ve,Ee,De],Be=["props"],Te=["class","style","directives"],Le=["on","hook"],Ne=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=[].concat(Be,L(r.normal||[])),o=[].concat(Te,L(r.array||[])),a=[].concat(Le,L(r.functional||[])),u=r.props||[];return t.reduce((function(t,n){for(var r in n)if(t[r])if(u.indexOf(r)>-1)t[r]=e([n[r]],t[r]);else if(i.indexOf(r)>-1)t[r]=R(R({},t[r]),n[r]);else if(o.indexOf(r)>-1){var c=t[r]instanceof Array?t[r]:[t[r]],l=n[r]instanceof Array?n[r]:[n[r]];t[r]=[].concat(L(c),L(l))}else if(a.indexOf(r)>-1)for(var s in n[r])if(t[r][s]){var f=t[r][s]instanceof Array?t[r][s]:[t[r][s]],d=n[r][s]instanceof Array?n[r][s]:[n[r][s]];t[r][s]=[].concat(L(f),L(d))}else t[r][s]=n[r][s];else if("hook"===r)for(var p in n[r])t[r][p]?t[r][p]=Me(t[r][p],n[r][p]):t[r][p]=n[r][p];else t[r]=n[r];else i.indexOf(r)>-1||a.indexOf(r)>-1||u.indexOf(r)>-1?t[r]=R({},n[r]):o.indexOf(r)>-1?t[r]=n[r]instanceof Array?L(n[r]):"object"===V(n[r])?R({},n[r]):n[r]:t[r]=n[r];return t}),n)},Me=function(e,t){return function(){e&&e.apply(this,arguments),t&&t.apply(this,arguments)}},qe=["type","slot","ignore","emitPrefix","value","name","native","hidden","display","inject","options","emit","link","prefix","suffix","update","sync","optionsTo","key","slotUpdate","computed","preview","component","cache","modelEmit"],Ue=["validate","children","control"],He=["effect","deep","renderSlots"];function ze(){return[].concat(qe,L(Be),L(Te),L(Le),Ue,He)}function Ge(e){return Je(e.replace(/(-[a-z])/g,(function(e){return e.replace("-","").toLocaleUpperCase()})))}function Je(e){return e.replace(e[0],e[0].toLowerCase())}function We(e,t){return{value:e,enumerable:!1,configurable:!1,writable:!!t}}function Ke(e,t){return Xe([e],t||!1)[0]}function Xe(e,t){return se([],L(e),t||!1)}function Qe(e,t){return Ne(Array.isArray(t)?t:[t],e,{array:Ue,normal:He}),e}function Ze(e){var t=ae.Function(e.getRule)?e.getRule():e;return t.type||(t.type="input"),t}function Ye(e,t){Object.defineProperties(e,Object.keys(t).reduce((function(e,n){return e[n]={get:function(){return t[n]()}},e}),{}))}function et(e){return e.__fc__||(e.__origin__?e.__origin__.__fc__:null)}function tt(e,t){try{t=e()}catch(e){!function(e){xe(e.toString()),console.error(e)}(e)}return t}function nt(){var e={},t=function(e){return e||"default"};return{setSlot:function(n,r){n=t(n),!r||Array.isArray(r)&&r.length||(e[n]||(e[n]=[]),e[n].push(r))},getSlot:function(n,r){n=t(n);var i=[];return(e[n]||[]).forEach((function(e){if(Array.isArray(e))i.push.apply(i,L(e));else if(ae.Function(e)){var t=e.apply(void 0,L(r||[]));Array.isArray(t)?i.push.apply(i,L(t)):i.push(t)}else ae.Undef(e)||i.push(e)})),i},getSlots:function(){var t=this,n={};return Object.keys(e).forEach((function(e){n[e]=function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.getSlot(e,r)}})),n},slotLen:function(n){return n=t(n),e[n]?e[n].length:0},mergeBag:function(e){var t=this;if(!e)return this;var n=ae.Function(e.getSlots)?e.getSlots():e;return Array.isArray(e)||d(e)?this.setSlot(void 0,(function(){return e})):Object.keys(n).forEach((function(e){t.setSlot(e,n[e])})),this}}}function rt(e){var t=R({},e.props||{});return Object.keys(e.on||{}).forEach((function(n){n.indexOf("-")>0&&(n=Ge(n));var r="on".concat(be(n));Array.isArray(t[r])?t[r]=[].concat(L(t[r]),[e.on[n]]):t[r]?t[r]=[t[r],e.on[n]]:t[r]=e.on[n]})),t.key=e.key,t.ref=e.ref,t.class=e.class,t.id=e.id,t.style=e.style,t.slot&&delete t.slot,t}function it(e,t){return Object.setPrototypeOf(e,t),e}var ot=function(e,t){return"string"==typeof e?String(t):"number"==typeof e?Number(t):t},at={"==":function(e,t){return JSON.stringify(e)===JSON.stringify(ot(e,t))},"!=":function(e,t){return!at["=="](e,t)},">":function(e,t){return e>t},">=":function(e,t){return e>=t},"<":function(e,t){return e<t},"<=":function(e,t){return e<=t},on:function(e,t){return e&&e.indexOf&&e.indexOf(ot(e[0],t))>-1},notOn:function(e,t){return!at.on(e,t)},in:function(e,t){return t&&t.indexOf&&t.indexOf(e)>-1},notIn:function(e,t){return!at.in(e,t)},between:function(e,t){return e>t[0]&&e<t[1]},notBetween:function(e,t){return e<t[0]||e>t[1]},empty:function(e){return ae.empty(e)},notEmpty:function(e){return!ae.empty(e)},pattern:function(e,t){return new RegExp(t,"g").test(e)}};function ut(e,t){return(Array.isArray(t)?t:(t||"").split(".")).forEach((function(t){null!=e&&(e=e[t])})),e}function ct(e){var t=e.split("."),n=[],r="";return t.forEach((function(e,t){0===t?r=e:r+="."+e,n.push(r)})),n.join(" && ")}function lt(e){for(var t=[],n="",r=0,i=0;i<e.length;i++){var o=e[i];"["===o?(0===r&&n&&(t.push({type:"key",value:n}),n=""),r++,n+=o):"]"===o?(n+=o,0===--r&&(t.push({type:"bracket",value:lt(n.slice(1,-1))}),n="")):"."===o&&0===r?n&&(t.push({type:"key",value:n}),n=""):n+=o}return n&&t.push({type:"key",value:n}),t.map((function(e){return"key"===e.type?{key:e.value}:{children:e.value}}))}var st=function(e,t){if(e&&e!==t)return e.props.formCreateInject?e.props.formCreateInject:e.parent?st(e.parent,t):void 0};function ft(e,t,n){return r({name:"FormCreate"+(e.isMobile?"Mobile":""),components:t,directives:n,props:{rule:{type:Array,required:!0,default:function(){return[]}},option:{type:Object,default:function(){return{}}},extendOption:Boolean,driver:[String,Object],modelValue:Object,disabled:{type:Boolean,default:void 0},preview:{type:Boolean,default:void 0},index:[String,Number],api:Object,locale:[String,Object],t:Function,name:String,subForm:{type:Boolean,default:!0},inFor:Boolean},emits:["update:api","update:modelValue","mounted","submit","reset","change","emit-event","control","remove-rule","remove-field","sync","reload","repeat-field","update","validate-field-fail","validate-fail","created"],render:function(){return this.fc.render()},setup:function(t){var n=p();h("parentFC",n);var r=v("parentFC",null),i=r;if(r)for(;i.setupState.parent;)i=i.setupState.parent;else i=n;var o=m(t),a=o.rule,c=o.modelValue,l=o.subForm,d=o.inFor,w=f({ctxInject:{},destroyed:!1,isShow:!0,unique:1,renderRule:L(a.value||[]),updateValue:JSON.stringify(c.value||{})}),k=new e(n),C=k.api(),S=d.value,O=null;g((function(){y((function(){var e="",n=t.option&&t.option.globalClass||{};Object.keys(n).forEach((function(t){var r="";n[t].style&&Object.keys(n[t].style).forEach((function(e){r+=ye(e)+":"+n[t].style[e]+";"})),n[t].content&&(r+=n[t].content+";"),r&&(e+=".".concat(t,"{").concat(r,"}"))})),t.option&&t.option.style&&(e+=t.option.style),O||((O=document.createElement("style")).type="text/css",document.head.appendChild(O)),O.innerHTML=e||""}))}));var F=ve((function(){k.bus.$emit("$loadData.$topForm")}),100),j=ve((function(){k.bus.$emit("$loadData.$scopeForm")}),100),V=ve((function(){k.bus.$emit("$loadData.$form")}),100),E=function(e){k.bus.$emit("change-$form."+e)};return b((function(){r&&(C.top.bus.$on("$loadData.$form",F),C.top.bus.$on("change",E)),C!==C.scope&&C.scope.bus.$on("$loadData.$scopeForm",j),k.mounted()})),_((function(){r&&(C.top.bus.$off("$loadData.$form",F),C.top.bus.$off("change",E)),C!==C.scope&&C.scope.bus.$off("$loadData.$scopeForm",j),function(){var e=st(n,r);if(e)if(S){var t=q(e.getSubForm()),i=t.indexOf(C);i>-1&&t.splice(i,1)}else e.subForm()}(),w.destroyed=!0,k.unmount(),O&&(O.parentNode||O.parentElement)&&document.head.removeChild(O)})),x((function(){k.updated()})),function(){if(r){var e,t=st(n,r);if(t)S?(e=q(t.getSubForm())).push(C):e=C,t.subForm(e)}}(),$((function(){return t.option}),(function(){k.initOptions(),C.refresh()}),{deep:!0,flush:"sync"}),$((function(){return L(a.value)}),(function(e){k.$handle.isBreakWatch()||e.length===w.renderRule.length&&e.every((function(e){return w.renderRule.indexOf(e)>-1}))||(k.$handle.updateAppendData(),k.$handle.reloadRule(a.value),n.setupState.renderRule())})),$((function(){return[t.disabled,t.preview]}),(function(){C.refresh()})),$(c,(function(e){ke(e||{})!==w.updateValue&&(C.config.forceCoverValue?C.coverValue(e||{}):C.setValue(e||{}))}),{deep:!0,flush:"post"}),$((function(){return t.index}),(function(){C.coverValue({}),k.$handle.updateAppendData(),u((function(){u((function(){C.clearValidateState()}))}))}),{flush:"sync"}),R(R({fc:s(k),parent:r?s(r):r,top:s(i),fapi:s(C)},m(w)),{},{getGroupInject:function(){return st(n,r)},refresh:function(){++w.unique},renderRule:function(){w.renderRule=L(a.value||[])},updateValue:function(e){if(!w.destroyed){var t=ke(e);w.updateValue!==t&&(w.updateValue=t,n.emit("update:modelValue",e),u((function(){V(),r?l.value||j():(F(),j())})))}}})},created:function(){var e=p();e.emit("update:api",e.setupState.fapi),e.setupState.fc.init()}})}function dt(e,t){return function(n,r,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=new pt(e,n,r,i,o);return t&&(ae.Function(t)?t(a):a.props(t)),a}}function pt(e,t,n,r,i){this._data=pe({props:{},on:{},options:[],children:[],hidden:!1,display:!0,value:void 0},{type:e,title:t,field:n,value:r,props:i||{}}),this.event=this.on}function ht(e){e.forEach((function(e){pt.prototype[e]=function(t){return Qe(this._data,D({},e,arguments.length<2?t:D({},t,arguments[1]))),this}}))}pe(pt.prototype,{getRule:function(){return this._data},setProp:function(e,t){return ce(this._data,e,t),this},modelField:function(e){return this._data.modelField=e,this},_clone:function(){var e=new this.constructor;return e._data=Ke(this._data),e}}),ht(ze());var vt=dt("");function mt(e,t,n){var r=vt("",t);return r._data.type=e,r._data.title=n,r}function gt(){return{create:mt,factory:dt}}function yt(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e){return t}}function bt(e){if("undefined"!=typeof XMLHttpRequest){var t,n=new XMLHttpRequest,r=e.action||"";if(n.upload&&e.onProgress&&n.upload.addEventListener("progress",(function(t){t.percent=t.total>0?t.loaded/t.total*100:0,e.onProgress(t)})),e.query){var i=ae.String(e.query)?e.query:Object.keys(e.query).reduce((function(t,n){return t[n]=null===e.query[n]||void 0===e.query[n]?"":e.query[n],t}),{}),o=new URLSearchParams(i).toString();o&&(r.includes("?")?r+="&".concat(o):r+="?".concat(o))}n.onerror=function(t){e.onError(t)},n.onload=function(){if(n.status<200||n.status>=300)return e.onError(function(e,t,n){var r="fail to ".concat(e," ").concat(n.status,"'"),i=new Error(r);return i.status=n.status,i.url=e,i}(r,0,n),yt(n));e.onSuccess(yt(n))},n.open(e.method||"get",r,!0),(e.data||e.file)&&(e.file||"json"!==(e.dataType||"").toLowerCase()?(t=new FormData,Object.keys(e.data||{}).map((function(n){t.append(n,e.data[n])}))):(t=JSON.stringify(e.data||{}),n.setRequestHeader("content-type","application/json"))),e.file&&t.append(e.filename,e.file,e.file.name),e.withCredentials&&"withCredentials"in n&&(n.withCredentials=!0);var a=e.headers||{};Object.keys(a).forEach((function(e){null!=a[e]&&n.setRequestHeader(e,a[e])})),n.send(t)}}function _t(e,t,n){return new Promise((function(r,i){(t||bt)(R(R({},e),{},{onSuccess:function(t){var i=function(e){return e},o=Se(e.parse);ae.Function(o)?i=o:o&&ae.String(o)&&(i=function(e){return ut(e,o)}),ge(i(t,e.targetRule,n)).then((function(e){r(e)}))},onError:function(e){i(e)}}))}))}function xt(e){return fe(e)}var $t=1;function wt(e){pe(this,{$handle:e,fc:e.fc,vm:e.vm,$manager:e.$manager,vNode:new e.fc.CreateNode(e),force:!1,tmpInput:null,id:$t++}),Ye(this,{options:function(){return e.options},sort:function(){return e.sort}}),this.initCache(),this.initRender()}!function(e){pe(e.prototype,{initCache:function(){this.clearCacheAll()},clearCache:function(e){e.rule.cache||(this.cache[e.id]?((!0===this.cache[e.id].use||this.cache[e.id].parent)&&this.$handle.refresh(),this.cache[e.id].parent&&this.clearCache(this.cache[e.id].parent),this.cache[e.id]=null):e.parent&&this.clearCache(e.parent))},clearCacheAll:function(){this.cache={}},setCache:function(e,t,n){this.cache[e.id]={vnode:t,use:!1,parent:n,slot:e.rule.slot}},getCache:function(e){var t=this.cache[e.id];if(t)return t.use=!0,t.vnode}})}(wt),function(e){pe(e.prototype,{initRender:function(){this.cacheConfig={}},getTypeSlot:function(e){return function t(n){if(n){var r=void 0;return e.rule.field&&(r=n.slots["field-"+ye(e.rule.field)]||n.slots["field-"+e.rule.field]),r||(r=n.slots["type-"+ye(e.type)]||n.slots["type-"+e.type]),r||t(n.setupState.parent)}}(this.vm)},render:function(){var e=this;if(this.vm.setupState.isShow){this.$manager.beforeRender();var t=nt();return this.sort.forEach((function(n){e.renderSlot(t,e.$handle.ctxs[n])})),this.$manager.render(t)}},renderSlot:function(e,t,n){if(this.isFragment(t)){t.initProp(),this.mergeGlobal(t),t.initNone();var r=this.renderChildren(t.loadChildrenPending(),t),i=r.default;i&&e.setSlot(t.rule.slot,(function(){return i()})),delete r.default,e.mergeBag(r)}else e.setSlot(t.rule.slot,this.renderCtx(t,n))},mergeGlobal:function(e){var t=this;this.$handle.options.global&&(this.cacheConfig[e.trueType]||(this.cacheConfig[e.trueType]=w((function(){var n=t.$handle.options.global;return Qe({},[n["*"]||n.default||{},n[e.originType]||n[e.type]||n[e.type]||{}])}))),e.prop=Qe({},[this.cacheConfig[e.trueType].value,e.prop]))},setOptions:function(e){var t=e.loadPending({key:"options",origin:e.prop.options,def:[]});e.prop.options=t,e.prop.optionsTo&&t&&Re(e.prop,e.prop.optionsTo,t)},deepSet:function(e){var t=e.rule.deep;t&&Object.keys(t).sort((function(e,t){return e.length<t.length?-1:1})).forEach((function(n){Re(e.prop,n,t[n])}))},parseSide:function(e,t){return ae.Object(e)?Qe({props:{formCreateInject:t.prop.props.formCreateInject}},e):e},renderSides:function(e,t,n){var r=t[n?"rule":"prop"];return[this.renderRule(this.parseSide(r.prefix,t)),e,this.renderRule(this.parseSide(r.suffix,t))]},renderId:function(e,t){var n=this,r=this.$handle["field"===t?"fieldCtx":"nameCtx"][e];return r?r.map((function(e){return n.renderCtx(e,e.parent)})):void 0},renderCtx:function(e,t){var n=this;try{if("hidden"===e.type)return;var r=e.rule;if(this.force||!this.cache[e.id]||this.cache[e.id].slot!==r.slot){var i;e.initProp(),this.mergeGlobal(e),e.initNone(),this.$manager.tidyRule(e),this.deepSet(e),this.setOptions(e),this.ctxProp(e);var o=e.prop;o.preview=!!(null!=o.preview?o.preview:this.$handle.preview),o.props.formCreateInject=this.injectProp(e);var a=!1!==o.cache,u=o.preview;if(o.hidden)return void this.setCache(e,void 0,t);i=function(){for(var i=arguments.length,c=new Array(i),l=0;l<i;l++)c[l]=arguments[l];var s={rule:r,prop:o,preview:u,api:n.$handle.api,model:o.model||{},slotValue:c};c.length&&r.slotUpdate&&tt((function(){return r.slotUpdate(s)}));var f={},d=e.l