@form-create/view-design 2.6.2 → 2.7.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
1
  /*!
2
2
  * FormCreate 低代码表单渲染器
3
- * @form-create/view-design v2.6.2
3
+ * @form-create/view-design v2.7.0-alpha.0
4
4
  * (c) 2018-2024 xaboy
5
5
  * Github https://github.com/xaboy/form-create
6
6
  * Site https://form-create.com/
7
7
  * Released under the MIT License.
8
8
  */
9
9
  (function(){"use strict";try{if(typeof document!="undefined"){var o=document.createElement("style");o.appendChild(document.createTextNode('._fc-frame .fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame .fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;transition:opacity .3s}._fc-frame .fc-upload-cover i{color:#fff;font-size:20px;cursor:pointer;margin:0 2px}._fc-frame .fc-files:hover .fc-upload-cover{opacity:1}._fc-frame .ivu-upload-list{margin-top:0}._fc-frame .fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-frame .fc-upload-btn,._fc-frame .fc-files{display:inline-block;width:58px;height:58px;text-align:center;line-height:58px;border:1px solid #c0ccda;border-radius:4px;overflow:hidden;background:#fff;position:relative;box-shadow:2px 2px 5px #0000001a;margin-right:4px;box-sizing:border-box}._fc-upload .fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-upload .fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;transition:opacity .3s}._fc-upload .fc-upload-cover i{color:#fff;font-size:20px;cursor:pointer;margin:0 2px}._fc-upload .fc-files:hover .fc-upload-cover{opacity:1}._fc-upload .ivu-upload-list{margin-top:0}._fc-upload .fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-upload .fc-upload-btn,._fc-upload .fc-files{display:inline-block;width:58px;height:58px;text-align:center;line-height:58px;border:1px solid #c0ccda;border-radius:4px;overflow:hidden;background:#fff;position:relative;box-shadow:2px 2px 5px #0000001a;margin-right:4px;box-sizing:border-box}._fc-group{display:flex;min-height:42px;justify-content:center;flex-direction:column}._fc-group-disabled ._fc-group-btn,._fc-group-disabled ._fc-group-add{cursor:not-allowed}._fc-group-handle{display:flex;flex-direction:row;position:absolute;bottom:-15px;right:30px;border-radius:15px;border:1px dashed #d9d9d9;padding:3px 8px;background-color:#fff}._fc-group-btn{cursor:pointer}._fc-group-idx{position:absolute;bottom:-15px;left:10px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;background:#eee;border-radius:15px;font-weight:700}._fc-group-handle ._fc-group-btn+._fc-group-btn{margin-left:7px}._fc-group-container{position:relative;display:flex;flex-direction:column;border:1px dashed #d9d9d9;padding:20px 20px 25px;margin:5px 5px 25px;border-radius:5px}._fc-group-arrow{position:relative;width:20px;height:20px}._fc-group-arrow:before{content:"";position:absolute;top:8px;left:5px;width:9px;height:9px;border-left:2px solid #999;border-top:2px solid #999}._fc-group-arrow:before{transform:rotate(45deg)}._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group-plus-minus{width:20px;height:20px;position:relative;cursor:pointer}._fc-group-plus-minus:before,._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:60%;height:2px;background-color:#409eff;transform:translate(-50%,-50%)}._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{cursor:pointer;width:25px;height:25px;border:1px solid rgb(64 158 255 / 50%);border-radius:15px}._fc-group-add._fc-group-plus-minus:before,._fc-group-add._fc-group-plus-minus:after{width:50%}.form-create .form-create .ivu-form-item{margin-bottom:24px}.form-create .form-create .ivu-form-item .ivu-form-item{margin-bottom:0}')),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
10
- (function(F,b){typeof exports=="object"&&typeof module!="undefined"?b(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],b):(F=typeof globalThis!="undefined"?globalThis:F||self,b(F.formCreate={},F.Vue))})(this,function(F,b){"use strict";var zr=Object.defineProperty,Wr=Object.defineProperties;var xr=Object.getOwnPropertyDescriptors;var pt=Object.getOwnPropertySymbols;var Gr=Object.prototype.hasOwnProperty,Kr=Object.prototype.propertyIsEnumerable;var mt=(F,b,j)=>b in F?zr(F,b,{enumerable:!0,configurable:!0,writable:!0,value:j}):F[b]=j,y=(F,b)=>{for(var j in b||(b={}))Gr.call(b,j)&&mt(F,j,b[j]);if(pt)for(var j of pt(b))Kr.call(b,j)&&mt(F,j,b[j]);return F},J=(F,b)=>Wr(F,xr(b));function j(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ne(){return ne=Object.assign?Object.assign.bind():function(t){for(var e,r=1;r<arguments.length;r++)for(var i in e=arguments[r],e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},ne.apply(this,arguments)}var yt=["attrs","props","domProps"],gt=["class","style","directives"],$t=["on","nativeOn"],vt=function(t){return t.reduce(function(e,r){for(var i in r)if(!e[i])e[i]=r[i];else if(yt.indexOf(i)!==-1)e[i]=ne({},e[i],r[i]);else if(gt.indexOf(i)!==-1){var s=e[i]instanceof Array?e[i]:[e[i]],n=r[i]instanceof Array?r[i]:[r[i]];e[i]=[].concat(s,n)}else if($t.indexOf(i)!==-1)for(var o in r[i])if(e[i][o]){var a=e[i][o]instanceof Array?e[i][o]:[e[i][o]],u=r[i][o]instanceof Array?r[i][o]:[r[i][o]];e[i][o]=[].concat(a,u)}else e[i][o]=r[i][o];else if(i==="hook")for(var l in r[i])e[i][l]=e[i][l]?bt(e[i][l],r[i][l]):r[i][l];else e[i]=r[i];return e},{})},bt=function(t,e){return function(){t&&t.apply(this,arguments),e&&e.apply(this,arguments)}},Ct=vt;const _=j(Ct);function G(t,e){return Object.keys(t).reduce((r,i)=>((!e||e.indexOf(i)===-1)&&r.push(t[i]),r),[])}const _t={name:"fcCheckbox",props:{formCreateInject:{type:Object,required:!0},value:{type:Array,default:()=>[]}},watch:{"formCreateInject.options":{handler(){this.update()},deep:!0},value(){this.update()}},data(){return{trueValue:[]}},methods:{options(){const t=this.formCreateInject.options;return Array.isArray(t)?t:[]},onInput(t){this.$emit("input",this.options().filter(e=>t.indexOf(e.label)!==-1).map(e=>e.value).filter(e=>e!==void 0))},update(){const t=Array.isArray(this.value)?this.value:[this.value];this.trueValue=this.options().filter(e=>t.indexOf(e.value)!==-1).map(e=>e.label)}},created(){this.update()},render(){const t=arguments[0];return t("CheckboxGroup",_([{},this.formCreateInject.prop,{ref:"el"},{props:{value:this.trueValue}},{on:{input:this.onInput}}]),[this.options().map((e,r)=>{const i=y({},e);return delete i.value,t("Checkbox",_([{},{props:i},{key:""+r+"-"+e.value}]))}),G(this.$slots)])},mounted(){this.$emit("fc.el",this.$refs.el)}};function A(t){return Array.isArray(t)?t:[null,void 0,""].indexOf(t)>-1?[]:[t]}const Ot="fcFrame";function Ce(t){return{name:Ot,props:{formCreateInject:{type:Object,required:!0},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:t.fileUpIcon},width:{type:[Number,String],default:500},height:{type: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:()=>{}},onOk:{type:Function,default:()=>{}},onCancel:{type:Function,default:()=>{}},onLoad:{type:Function,default:()=>{}},onBeforeRemove:{type:Function,default:()=>{}},onRemove:{type:Function,default:()=>{}},onHandle:{type:Function,default(e){this.previewImage=this.getSrc(e),this.previewVisible=!0}},modal:{type:Object,default:()=>({})},srcKey:{type:[String,Number]},value:[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}},data(){return{fileList:A(this.value),previewVisible:!1,frameVisible:!1,previewImage:""}},watch:{value(e){this.fileList=A(e)},fileList(e){const r=this.maxLength===1?e[0]||"":e;this.$emit("input",r),this.$emit("change",r)},src(e){this.modalVm&&(this.modalVm.src=e)}},methods:{key(e){return e},closeModel(e){this.$emit(e?"$close":"$ok"),this.reload&&(this.$off("$ok"),this.$off("$close")),this.frameVisible=!1},showModel(){this.disabled||this.onOpen()===!1||(this.frameVisible=!0)},makeInput(){const e=this.$createElement,r={type:"text",value:this.fileList.map(i=>this.getSrc(i)).toString(),icon:this.icon,readonly:!0,clearable:!1};return e("Input",_([{},{props:r},{},{on:{"on-click":()=>this.showModel()}},{key:this.key("input")}]))},makeGroup(e){const r=this.$createElement;return(!this.maxLength||this.fileList.length<this.maxLength)&&e.push(this.makeBtn()),r("div",{key:this.key("group")},[...e])},makeItem(e,r){const i=this.$createElement;return i("div",{class:"fc-files",key:this.key("file"+e)},[...r])},valid(e){const r=this.formCreateInject.field||this.field;if(r&&e!==r)throw new Error("[frame]无效的字段值")},makeIcons(e,r){const i=this.$createElement;if(this.handleIcon!==!1||this.allowRemove===!0){const s=[];return(this.type!=="file"&&this.handleIcon!==!1||this.type==="file"&&this.handleIcon)&&s.push(this.makeHandleIcon(e,r)),this.allowRemove&&s.push(this.makeRemoveIcon(e,r)),i("div",{class:"fc-upload-cover",key:this.key("uc")},[s])}},makeHandleIcon(e,r){const i=this.$createElement;return i("icon",_([{},{props:{type:this.handleIcon===!0||this.handleIcon===void 0?"ios-eye-outline":this.handleIcon}},{on:{click:()=>this.handleClick(e)},key:this.key("hi"+r)}]))},makeRemoveIcon(e,r){const i=this.$createElement;return i("icon",_([{},{props:{type:"ios-trash-outline"}},{on:{click:()=>this.handleRemove(e)},key:this.key("ri"+r)}]))},makeFiles(){const e=this.$createElement;return this.makeGroup(this.fileList.map((r,i)=>this.makeItem(i,[e("icon",_([{},{props:{type:t.fileIcon,size:40}},{on:{click:()=>this.handleClick(r)}}])),this.makeIcons(r,i)])))},makeImages(){const e=this.$createElement;return this.makeGroup(this.fileList.map((r,i)=>this.makeItem(i,[e("img",{attrs:{src:this.getSrc(r)}}),this.makeIcons(r,i)])))},makeBtn(){const e=this.$createElement;return e("div",{class:"fc-upload-btn",on:{click:()=>this.showModel()},key:this.key("btn")},[e("icon",_([{},{props:{type:this.icon,size:20}}]))])},handleClick(e){return this.onHandle(e)},handleRemove(e){this.disabled||this.onBeforeRemove(e)!==!1&&(this.fileList.splice(this.fileList.indexOf(e),1),this.onRemove(e))},getSrc(e){return this.srcKey?e[this.srcKey]:e},frameLoad(e){this.onLoad(e);try{this.helper===!0&&(e.form_create_helper={api:this.formCreateInject.api,close:r=>{this.valid(r),this.closeModel()},set:(r,i)=>{this.valid(r),this.disabled||this.$emit("input",i)},get:r=>(this.valid(r),this.value),onOk:r=>this.$on("$ok",r),onClose:r=>this.$on("$close",r)})}catch(r){console.log(r)}},makeFooter(){const e=this.$createElement,{okBtnText:r,closeBtnText:i,closeBtn:s,okBtn:n,footer:o}=this.$props,a=[];return o&&(s&&a.push(e("Button",{on:{click:()=>this.onCancel()!==!1&&this.closeModel(!0)}},[i])),n&&a.push(e("Button",{attrs:{type:"primary"},on:{click:()=>this.onOk()!==!1&&this.closeModel()}},[r]))),a}},render(){const e=arguments[0],r=this.type;let i;r==="input"?i=this.makeInput():r==="image"?i=this.makeImages():i=this.makeFiles();const{width:s,height:n,src:o,title:a,modalTitle:u}=this.$props;return this.$nextTick(()=>{this.$refs.frame&&this.frameLoad(this.$refs.frame.contentWindow||{})}),e("div",{class:"_fc-frame"},[i,e("Modal",_([{},{props:{mask:this.previewMask,title:u,footerHide:!0}},{model:{value:this.previewVisible,callback:l=>{this.previewVisible=l}}}]),[e("img",{style:"width: 100%",attrs:{src:this.previewImage}})]),e("Modal",_([{},{props:y({width:s,title:a},this.modal)},{on:{"on-cancel":()=>this.closeModel(!0)},model:{value:this.frameVisible,callback:l=>{this.frameVisible=l}}}]),[this.frameVisible||!this.reload?e("iframe",{ref:"frame",attrs:{src:o,frameBorder:"0"},style:{height:n,border:"0 none",width:"100%"}}):null,e("div",{slot:"footer"},[this.makeFooter()])])])},mounted(){this.$on("fc.closeModal",this.closeModal)}}}const _e=Ce({fileIcon:"md-document",fileUpIcon:"ios-folder-open"});_e.v2=Ce({fileIcon:"document-text",fileUpIcon:"folder"});const kt={name:"fcRadio",props:{formCreateInject:{type:Object,required:!0},value:{}},watch:{"formCreateInject.options":{handler(){this.update()},deep:!0},value(){this.update()}},data(){return{trueValue:[]}},methods:{options(){const t=this.formCreateInject.options;return Array.isArray(t)?t:[]},onInput(t){this.$emit("input",this.options().filter(e=>e.label===t).reduce((e,r)=>r.value,""))},update(){this.trueValue=this.options().filter(t=>t.value===this.value).reduce((t,e)=>e.label,"")}},created(){this.update()},render(){const t=arguments[0];return t("RadioGroup",_([{},this.formCreateInject.prop,{},{props:{value:this.trueValue}},{ref:"el",on:{input:this.onInput}}]),[this.options().map((e,r)=>{const i=y({},e);return delete i.value,t("Radio",_([{},{props:i},{key:""+r+"-"+e.value}]))}),G(this.$slots)])},mounted(){this.$emit("fc.el",this.$refs.el)}},h={type(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"},Undef(t){return t==null},Element(t){return typeof t=="object"&&t!==null&&t.nodeType===1&&!h.Object(t)},trueArray(t){return Array.isArray(t)&&t.length>0},Function(t){const e=this.getType(t);return e==="Function"||e==="AsyncFunction"},getType(t){const e=Object.prototype.toString.call(t);return/^\[object (.*)\]$/.exec(e)[1]},empty(t){return t==null||Array.isArray(t)&&Array.isArray(t)&&!t.length?!0:typeof t=="string"&&!t}};["Date","Object","String","Boolean","Array","Number"].forEach(t=>{h[t]=function(e){return h.type(e,t)}});function O(t,e){return{}.hasOwnProperty.call(t,e)}const wt={name:"fcSelect",functional:!0,props:{formCreateInject:{type:Object,required:!0}},render(t,e){const r=(n,o)=>{const a=n.slot;return t("Option",_([{},{props:n},{key:""+o+"-"+n.value}]),[a?t("template",{slot:n.slotName||"default"},[h.Function(a)?n.slot(t):a]):null])},i=(n,o)=>t("OptionGroup",{attrs:{label:n.label},key:""+o+"-"+n.label},[h.trueArray(n.options)&&n.options.map((a,u)=>r(a,u))]),s=e.props.formCreateInject.options;return t("Select",_([{},e.data,{ref:"el"}]),[(Array.isArray(s)?s:[]).map((n,o)=>O(n||"","options")?i(n,o):r(n,o)),e.children])},mounted(){this.$emit("fc.el",this.$refs.el)}},Ft={name:"fcTree",props:{formCreateInject:{type:Object,required:!0},type:{type:String,default:"checked"},value:{type:[Array,String,Number],default:()=>[]}},data(){return{treeData:[]}},watch:{value(t){this.setStatus(t)}},created(){this.setStatus(this.value)},methods:{setStatus(t){const e=A(t),r=this.formCreateInject.prop.props.data;this.type==="selected"?this.checked(r,e,"selected"):this.checked(r,e,"checked"),this.$forceUpdate()},checked(t,e,r){t.forEach(i=>{this.$set(i,r,e.indexOf(i.id)!==-1),i.children!==void 0&&Array.isArray(i.children)&&this.checked(i.children,e,r)})},onInput(t){this.$emit("input",t.map(e=>e.id))}},render(){const t=arguments[0],e={};return this.type==="selected"?e["on-select-change"]=this.onInput:e["on-check-change"]=this.onInput,t("Tree",_([{},this.formCreateInject.prop,{ref:"tree"},{on:e}]),[G(this.$slots)])},mounted(){this.$emit("fc.el",this.$refs.tree)}};function Oe(t){return{url:t,name:St(t)}}function St(t){return(""+t).split("/").pop()}const Et="fcUpload";function ke(t){return{name:Et,props:{formCreateInject:{type:Object,required:!0},onHandle:{type:Function,default(e){this.previewImage=e.url,this.previewVisible=!0}},uploadType:{type:String,default:"file"},maxLength:{type:Number,default:0},allowRemove:{type:Boolean,default:!0},modalTitle:String,handleIcon:{type:[String,Boolean],default:()=>{}},value:[Array,String]},data(){return{uploadList:[],previewVisible:!1,previewImage:"",cacheFiles:[]}},created(){this.formCreateInject.prop.props.showUploadList===void 0&&(this.formCreateInject.prop.props.showUploadList=!1),this.formCreateInject.prop.props.defaultFileList=A(this.value).map(Oe)},watch:{value(e){this.$refs.upload.fileList.every(r=>!r.status||r.status==="finished")&&(this.$refs.upload.fileList=A(e).map(Oe),this.uploadList=this.$refs.upload.fileList)},maxLength(e,r){(r===1||e===1)&&this.update()}},methods:{key(e){return e},isDisabled(){return this.formCreateInject.prop.props.disabled===!0},onRemove(e){this.isDisabled()||this.$refs.upload.handleRemove(e)},handleClick(e){this.onHandle(e)},makeItem(e,r){const i=this.$createElement;return this.uploadType==="image"?i("img",{attrs:{src:e.url},key:this.key("img"+r)}):i("icon",_([{},{props:{type:t.fileIcon,size:40}},{key:this.key("i"+r)}]))},makeRemoveIcon(e,r){const i=this.$createElement;return i("icon",{attrs:{type:"ios-trash-outline"},on:{click:()=>this.onRemove(e)},key:this.key("ri"+r)})},makeHandleIcon(e,r){const i=this.$createElement;return i("icon",{attrs:{type:this.handleIcon===!0||this.handleIcon===void 0?"ios-eye-outline":this.handleIcon},on:{click:()=>this.handleClick(e)},key:this.key("hi"+r)})},makeProgress(e,r){const i=this.$createElement;return i("Progress",_([{},{props:{percent:e.percentage,hideInfo:!0}},{style:"width:90%",key:this.key("pg"+r)}]))},makeIcons(e,r){const i=this.$createElement,s=[];if(this.allowRemove||this.handleIcon!==!1)return(this.uploadType!=="file"&&this.handleIcon!==!1||this.uploadType==="file"&&this.handleIcon)&&s.push(this.makeHandleIcon(e,r)),this.allowRemove&&s.push(this.makeRemoveIcon(e,r)),i("div",{class:"fc-upload-cover"},[s])},makeFiles(){const e=this.$createElement;return this.uploadList.map((r,i)=>this.$scopedSlots.fileList?this.$scopedSlots.fileList({file:r,index:i,vm:this}):e("div",{key:this.key(i),class:"fc-files"},[r.showProgress?this.makeProgress(r,i):[this.makeItem(r,i),this.makeIcons(r,i)]]))},makeUpload(){const e=this.$createElement,r=!this.maxLength||this.maxLength>this.uploadList.length;return e("Upload",_([{},this.formCreateInject.prop,{},{style:{display:"inline-block"},key:this.key("upload"),ref:"upload"}]),[r?e("template",{slot:"default"},[this.$slots.default||e("div",{class:"fc-upload-btn"},[e("icon",_([{},{props:{type:this.uploadType==="file"?"ios-cloud-upload-outline":t.imgUpIcon,size:20}}]))])]):null,G(this.$slots,["default"])])},update(){let e=this.$refs.upload.fileList.map(r=>r.url).filter(r=>r!==void 0);(this.cacheFiles.length!==e.length||!e.length)&&(this.cacheFiles=[...e],this.$emit("input",this.maxLength===1?e[0]||"":e))},handleCancel(){this.previewVisible=!1}},render(){const e=arguments[0];return this.$refs.upload&&(this.formCreateInject.prop.props.showUploadList===void 0&&(this.formCreateInject.prop.props.showUploadList=this.$refs.upload.showUploadList),this.formCreateInject.prop.props.defaultFileList=this.$refs.upload.defaultFileList),e("div",{class:"_fc-upload"},[[this.formCreateInject.prop.props.showUploadList?[]:this.makeFiles(),this.makeUpload()],e("Modal",_([{},{props:{title:this.modalTitle,footerHide:!0}},{model:{value:this.previewVisible,callback:r=>{this.previewVisible=r}}}]),[e("img",{attrs:{alt:"example",src:this.previewImage},style:"width: 100%"})])])},mounted(){this.uploadList=this.$refs.upload.fileList,this.$watch(()=>this.$refs.upload.fileList,()=>{this.update()},{deep:!0}),this.$emit("fc.el",this.$refs.upload)}}}const we=ke({fileIcon:"md-document",imgUpIcon:"md-images"});we.v2=ke({fileIcon:"document-text",imgUpIcon:"image"});function S(t,e,r){b.set(t,e,r)}function L(t,e){b.delete(t,e)}function z(t,e={},r){let i=!1;for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)){let n=e[s];if((i=Array.isArray(n))||h.Object(n)){let o=t[s]===void 0;if(i)i=!1,o&&S(t,s,[]);else if(n._clone&&r!==void 0)if(r)n=n.getRule(),o&&S(t,s,{});else{S(t,s,n._clone());continue}else o&&S(t,s,{});t[s]=z(t[s],n,r)}else S(t,s,n),h.Undef(n)||(h.Undef(n.__json)||(t[s].__json=n.__json),h.Undef(n.__origin)||(t[s].__origin=n.__origin))}return r!==void 0&&Array.isArray(t)?t.filter(s=>!s||!s.__ctrl):t}function N(t){return z({},{value:t}).value}const Rt=Object.assign||function(t){for(let e,r=1;r<arguments.length;r++)for(let i in e=arguments[r],e)Object.prototype.hasOwnProperty.call(e,i)&&S(t,i,e[i]);return t};function p(){return Rt.apply(this,arguments)}const It=[_t,kt,wt,Ft,{name:"fcSubForm",props:{rule:Array,options:Object,formCreateInject:{type:Object,required:!0},value:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0}},data(){return{cacheRule:{},cacheValue:{},type:void 0}},watch:{value(t){this.setValue(t)}},methods:{formData(t){this.cacheValue=JSON.stringify(t),this.$emit("input",t),this.$emit("change",t)},setValue(t){const e=JSON.stringify(t);this.cacheValue!==e&&(this.cacheValue=e,this.cacheRule.$f.coverValue(t||{}))},addRule(){const t=this.options?this.options:{submitBtn:!1,resetBtn:!1};t.formData=y({},this.value||{}),this.cacheRule={rule:this.rule,options:t}},add$f(t){this.cacheRule.$f=t,this.$nextTick(()=>{this.$emit("itemMounted",t)})},emitEvent(t,...e){this.$emit(t,...e)}},created(){this.addRule(),this.type=this.formCreateInject.form.$form()},render(){const t=arguments[0],{rule:e,options:r}=this.cacheRule,i=this.type;return t(i,_([{},{on:{"update:value":this.formData,"emit-event":this.emitEvent,input:this.add$f}},{},{props:{rule:e,option:r,disabled:this.disabled,extendOption:!0}}]))}},_e,we,{name:"fcGroup",props:{field:String,rule:[Array,Object],rules:Array,expand:Number,options:Object,formCreateInject:{type:Object,required:!0},button:{type:Boolean,default:!0},max:{type:Number,default:0},min:{type:Number,default:0},value:{type:Array,default:()=>[]},sortBtn:{type:Boolean,default:!0},defaultValue:Object,disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},onBeforeRemove:{type:Function,default:()=>{}},onBeforeAdd:{type:Function,default:()=>{}},parse:Function},data(){return{len:0,cacheRule:{},cacheValue:{},sort:[],type:void 0}},computed:{formRule(){return this.rules?this.rules:this.rule?Array.isArray(this.rule)?this.rule:[this.rule]:[]}},watch:{cacheRule:{handler(t){this.sort=Object.keys(t)},immediate:!0},formRule:{handler(t,e){Object.keys(this.cacheRule).forEach(r=>{const i=this.cacheRule[r];if(i.$f){const s=i.$f.formData();if(t===e)i.$f.deferSyncValue(()=>{z(i.rule,t),i.$f.setValue(s)},!0);else{const n=i.$f.formData();i.$f.once("reloading",()=>{i.$f.setValue(n)}),i.rule=N(t)}}})},deep:!0},expand(t){let e=t-this.value.length;e>0&&this.expandRule(e)},value(t,e){t=t||[];let r=this.sort,i=r.length,s=i-t.length;if(s<0){for(let n=s;n<0;n++)this.addRule(t.length+n);this.sort=Object.keys(this.cacheRule);for(let n=0;n<i;n++)this.setValue(r[n],t[n])}else{if(s>0)for(let n=0;n<s;n++)this.removeRule(r[i-n-1]);this.sort=Object.keys(this.cacheRule),t.forEach((n,o)=>{this.setValue(r[o],t[o])})}}},methods:{_value(t){return t&&O(t,this.field)?t[this.field]:t},cache(t,e){this.cacheValue[t]=JSON.stringify(e)},input(t){this.$emit("input",t),this.$emit("change",t)},formData(t,e){const r=this.cacheRule,i=this.sort;if(i.filter(n=>r[n].$f).length!==i.length)return;const s=i.map(n=>{const o=t===n?e:y({},this.cacheRule[n].$f.form),a=this.field?o[this.field]||null:o;return this.cache(n,a),a});this.input(s)},setValue(t,e){const r=this.field,i=this.cacheRule[t].$f;r&&(e={[r]:this._value(e)}),this.cacheValue[t]!==JSON.stringify(r?e[r]:e)&&(this.cache(t,e),i&&i.coverValue(e||{}))},addRule(t,e){const r=this.formCreateInject.form.copyRules(this.formRule),i=this.options?y({},this.options):{submitBtn:!1,resetBtn:!1};if(this.defaultValue){i.formData||(i.formData={});const s=N(this.defaultValue);p(i.formData,this.field?{[this.field]:s}:s)}this.parse&&this.parse({rule:r,options:i,index:this.sort.length}),this.$set(this.cacheRule,++this.len,{rule:r,options:i}),e&&this.$nextTick(()=>this.$emit("add",r,Object.keys(this.cacheRule).length-1))},add$f(t,e,r){this.cacheRule[e].$f=r,this.$nextTick(()=>{this.$emit("itemMounted",r,Object.keys(this.cacheRule).indexOf(e))})},removeRule(t,e){const r=Object.keys(this.cacheRule).indexOf(t);this.$delete(this.cacheRule,t),this.$delete(this.cacheValue,t),e&&this.$nextTick(()=>this.$emit("remove",r))},add(t){this.disabled||this.onBeforeAdd(this.value)===!1||this.addRule(t,!0)},del(t,e){if(this.disabled||this.onBeforeRemove(this.value,t)===!1)return;this.removeRule(e,!0);const r=[...this.value];r.splice(t,1),this.input(r)},addIcon(t){const e=this.$createElement;return e("div",{class:"_fc-group-btn _fc-group-plus-minus",on:{click:this.add}})},delIcon(t,e){const r=this.$createElement;return r("div",{class:"_fc-group-btn _fc-group-plus-minus _fc-group-minus",on:{click:()=>this.del(t,e)}})},sortUpIcon(t){const e=this.$createElement;return e("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-up",on:{click:()=>this.changeSort(t,-1)}})},sortDownIcon(t){const e=this.$createElement;return e("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-down",on:{click:()=>this.changeSort(t,1)}})},changeSort(t,e){const r=this.sort[t];this.$set(this.sort,t,this.sort[t+e]),this.sort[t+e]=r,this.formData(0)},makeIcon(t,e,r){if(this.$scopedSlots.button)return this.$scopedSlots.button({total:t,index:e,vm:this,key:r,del:()=>this.del(e,r),add:this.add});const i=[];return(!this.max||t<this.max)&&t===e+1&&i.push(this.addIcon(r)),t>this.min&&i.push(this.delIcon(e,r)),this.sortBtn&&e&&i.push(this.sortUpIcon(e)),this.sortBtn&&e!==t-1&&i.push(this.sortDownIcon(e)),i},emitEvent(t,e,r,i){this.$emit(t,...e,this.cacheRule[i].$f,r)},expandRule(t){for(let e=0;e<t;e++)this.value.push(this.field?null:{})}},created(){this.type=this.formCreateInject.form.$form();const t=(this.expand||0)-this.value.length;t>0&&this.expandRule(t);for(let e=0;e<this.value.length;e++)this.addRule(e)},render(){const t=arguments[0],e=this.sort,r=this.button,i=this.type,s=this.disabled,n=e.length===0?this.$scopedSlots.default?this.$scopedSlots.default({vm:this,add:this.add}):t("div",{key:"a_def",class:"_fc-group-plus-minus _fc-group-add",on:{click:this.add}}):e.map((o,a)=>{const{rule:u,options:l}=this.cacheRule[o],c=r&&!s?this.makeIcon(e.length,a,o):[];return t("div",{class:"_fc-group-container",key:o},[t(i,_([{key:o},{on:{"update:value":m=>this.formData(o,m),"emit-event":(m,...v)=>this.emitEvent(m,v,a,o),input:m=>this.add$f(a,o,m)}},{},{props:{disabled:s,inFor:!0,value:this.field?{[this.field]:this._value(this.value[a])}:this.value[a],rule:u,option:l,extendOption:!0}}])),t("div",{class:"_fc-group-idx"},[a+1]),c.length?t("div",{class:"_fc-group-handle"},[c]):null])});return t("div",{key:"con",class:"_fc-group "+(s?"_fc-group-disabled":"")},[n])}}],Fe="FormCreate",se=(t,e)=>{if(!(!t||t===e)){if(t.formCreateInject)return t.formCreateInject;if(t.$parent)return se(t.$parent,e)}};function jt(t,e,r){return{name:Fe,componentName:Fe,model:{prop:"api"},components:e,directives:r,provide(){return{$pfc:this}},inject:{$pfc:{default:null}},props:{rule:{type:Array,required:!0},option:{type:Object,default:()=>({})},extendOption:Boolean,disabled:{type:Boolean,default:void 0},value:Object,api:Object,name:String,subForm:{type:Boolean,default:!0},inFor:Boolean},data(){return{formData:void 0,destroyed:!1,validate:{},$f:void 0,isShow:!0,unique:1,renderRule:[...this.rule||[]],ctxInject:{},updateValue:JSON.stringify(this.value||{}),isMore:!!this.inFor}},render(){return this.formCreate.render()},methods:{_refresh(){++this.unique},_renderRule(){this.renderRule=[...this.rule||[]]},_updateValue(i){this.destroyed||(this.updateValue=JSON.stringify(i),this.$emit("update:value",i))}},watch:{value:{handler(i){JSON.stringify(i||{})!==this.updateValue&&(this.$f.config.forceCoverValue?this.$f.coverValue(i||{}):this.$f.setValue(i||{}))},deep:!0},option:{handler(){this.formCreate.initOptions(),this.$f.refresh()},deep:!0},rule(i,s){i.length===this.renderRule.length&&i.every(n=>this.renderRule.indexOf(n)>-1)||(this.formCreate.$handle.reloadRule(i),this._renderRule(),i!==s&&this.formCreate.$handle.targetReload())},disabled(){this.$f.refresh()}},beforeCreate(){this.formCreate=new t(this),Object.keys(this.formCreate.prop).forEach(i=>{p(this.$options[i],this.formCreate.prop[i])}),this.$emit("beforeCreate",this.formCreate.api())},created(){const i=this,s=this.formCreate.api(),n=()=>{if(i.$pfc){const a=se(i,i.$pfc);if(a){let u;i.isMore?(u=A(a.getSubForm()),u.push(s)):u=s,a.subForm(u)}}},o=()=>{const a=se(i,i.$pfc);if(a)if(i.isMore){const u=A(a.getSubForm()),l=u.indexOf(s);l>-1&&u.splice(l,1)}else a.subForm()};i.$on("hook:beforeDestroy",()=>{o()}),this.$watch(()=>this.subForm,a=>{a?n():o()},{immediate:!0})}}}const Se=["attrs","props","domProps","scopedSlots"],Ee=["class","style","directives"],Re=["on","nativeOn"],T=(t,e={},r={})=>{const i=[...Se,...r.normal||[]],s=[...Ee,...r.array||[]],n=[...Re,...r.functional||[]],o=r.props||[];return t.reduce((a,u)=>{for(const l in u)if(a[l])if(o.indexOf(l)>-1)a[l]=T([u[l]],a[l]);else if(i.indexOf(l)>-1)a[l]=y(y({},a[l]),u[l]);else if(s.indexOf(l)>-1){const c=a[l]instanceof Array?a[l]:[a[l]],m=u[l]instanceof Array?u[l]:[u[l]];a[l]=[...c,...m]}else if(n.indexOf(l)>-1)for(const c in u[l])if(a[l][c]){const m=a[l][c]instanceof Array?a[l][c]:[a[l][c]],v=u[l][c]instanceof Array?u[l][c]:[u[l][c]];a[l][c]=[...m,...v]}else a[l][c]=u[l][c];else if(l==="hook")for(let c in u[l])a[l][c]?a[l][c]=At(a[l][c],u[l][c]):a[l][c]=u[l][c];else a[l]=u[l];else i.indexOf(l)>-1||n.indexOf(l)>-1||o.indexOf(l)>-1?a[l]=y({},u[l]):s.indexOf(l)>-1?a[l]=u[l]instanceof Array?[...u[l]]:typeof u[l]=="object"?y({},u[l]):u[l]:a[l]=u[l];return a},e)},At=(t,e)=>function(){t&&t.apply(this,arguments),e&&e.apply(this,arguments)},Ie=["type","slot","emitPrefix","value","name","native","hidden","display","inject","options","emit","nativeEmit","link","prefix","suffix","update","sync","optionsTo","key","preview","component","cache"],oe=["validate","children","control"],ae=["effect","deep"];function Vt(){return[...Ie,...Se,...Ee,...Re,...oe,...ae]}function le(t,e,r){return`[form-create ${t}]: ${e}`}function Pt(t,e){console.warn(le("tip",t))}function ue(t,e){console.error(le("err",t))}function Dt(t){ue(t.toString()),console.error(t)}const fe="[[FORM-CREATE-PREFIX-",he="-FORM-CREATE-SUFFIX]]",je="$FN:",Ae="$FNX:";function Ve(t,e){return JSON.stringify(z(Array.isArray(t)?[]:{},t,!0),function(r,i){if(!(i&&i._isVue===!0)){if(typeof i!="function")return i;if(i.__json)return i.__json;if(i.__origin&&(i=i.__origin),!i.__emit)return fe+i+he}},e)}function Pe(t){return new Function("return "+t)()}function U(t,e){if(t&&h.String(t)&&t.length>4){let r=t.trim(),i=!1;try{if(r.indexOf(he)>0&&r.indexOf(fe)===0)r=r.replace(he,"").replace(fe,""),i=!0;else if(r.indexOf(je)===0)r=r.replace(je,""),i=!0;else{if(r.indexOf(Ae)===0)return r=Pe("function($inject){"+r.replace(Ae,"")+"}"),r.__json=t,r.__inject=!0,r;!e&&r.indexOf("function ")===0&&r!=="function "&&(i=!0)}if(!i)return t;const s=Pe(r.indexOf("function ")===-1&&r.indexOf("(")!==0?"function "+r:r);return s.__json=t,s}catch(s){ue(`解析失败:${r}
10
+ (function(A,p){typeof exports=="object"&&typeof module!="undefined"?p(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],p):(A=typeof globalThis!="undefined"?globalThis:A||self,p(A.formCreate={},A.Vue))})(this,function(A,p){"use strict";var ki=Object.defineProperty,Ri=Object.defineProperties;var Fi=Object.getOwnPropertyDescriptors;var Vt=Object.getOwnPropertySymbols;var Si=Object.prototype.hasOwnProperty,Ei=Object.prototype.propertyIsEnumerable;var Nt=(A,p,L)=>p in A?ki(A,p,{enumerable:!0,configurable:!0,writable:!0,value:L}):A[p]=L,_=(A,p)=>{for(var L in p||(p={}))Si.call(p,L)&&Nt(A,L,p[L]);if(Vt)for(var L of Vt(p))Ei.call(p,L)&&Nt(A,L,p[L]);return A},J=(A,p)=>Ri(A,Fi(p));function L(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Re(){return Re=Object.assign?Object.assign.bind():function(t){for(var e,r=1;r<arguments.length;r++)for(var i in e=arguments[r],e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Re.apply(this,arguments)}var Mt=["attrs","props","domProps"],Ut=["class","style","directives"],qt=["on","nativeOn"],Gt=function(t){return t.reduce(function(e,r){for(var i in r)if(!e[i])e[i]=r[i];else if(Mt.indexOf(i)!==-1)e[i]=Re({},e[i],r[i]);else if(Ut.indexOf(i)!==-1){var s=e[i]instanceof Array?e[i]:[e[i]],n=r[i]instanceof Array?r[i]:[r[i]];e[i]=[].concat(s,n)}else if(qt.indexOf(i)!==-1)for(var o in r[i])if(e[i][o]){var a=e[i][o]instanceof Array?e[i][o]:[e[i][o]],l=r[i][o]instanceof Array?r[i][o]:[r[i][o]];e[i][o]=[].concat(a,l)}else e[i][o]=r[i][o];else if(i==="hook")for(var u in r[i])e[i][u]=e[i][u]?Ht(e[i][u],r[i][u]):r[i][u];else e[i]=r[i];return e},{})},Ht=function(t,e){return function(){t&&t.apply(this,arguments),e&&e.apply(this,arguments)}},Jt=Gt;const E=L(Jt);function me(t,e){return Object.keys(t).reduce((r,i)=>((!e||e.indexOf(i)===-1)&&r.push(t[i]),r),[])}const Wt={name:"fcCheckbox",props:{formCreateInject:{type:Object,required:!0},value:{type:Array,default:()=>[]}},watch:{"formCreateInject.options":{handler(){this.update()},deep:!0},value(){this.update()}},data(){return{trueValue:[]}},methods:{options(){const t=this.formCreateInject.options;return Array.isArray(t)?t:[]},onInput(t){this.$emit("input",this.options().filter(e=>t.indexOf(e.label)!==-1).map(e=>e.value).filter(e=>e!==void 0))},update(){const t=Array.isArray(this.value)?this.value:[this.value];this.trueValue=this.options().filter(e=>t.indexOf(e.value)!==-1).map(e=>e.label)}},created(){this.update()},render(){const t=arguments[0];return t("CheckboxGroup",E([{},this.formCreateInject.prop,{ref:"el"},{props:{value:this.trueValue}},{on:{input:this.onInput}}]),[this.options().map((e,r)=>{const i=_({},e);return delete i.value,t("Checkbox",E([{},{props:i},{key:""+r+"-"+e.value}]))}),me(this.$slots)])},mounted(){this.$emit("fc.el",this.$refs.el)}};function U(t){return Array.isArray(t)?t:[null,void 0,""].indexOf(t)>-1?[]:[t]}const zt="fcFrame";function Ze(t){return{name:zt,props:{formCreateInject:{type:Object,required:!0},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:t.fileUpIcon},width:{type:[Number,String],default:500},height:{type: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:()=>{}},onOk:{type:Function,default:()=>{}},onCancel:{type:Function,default:()=>{}},onLoad:{type:Function,default:()=>{}},onBeforeRemove:{type:Function,default:()=>{}},onRemove:{type:Function,default:()=>{}},onHandle:{type:Function,default(e){this.previewImage=this.getSrc(e),this.previewVisible=!0}},modal:{type:Object,default:()=>({})},srcKey:{type:[String,Number]},value:[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}},data(){return{fileList:U(this.value),previewVisible:!1,frameVisible:!1,previewImage:""}},watch:{value(e){this.fileList=U(e)},fileList(e){const r=this.maxLength===1?e[0]||"":e;this.$emit("input",r),this.$emit("change",r)},src(e){this.modalVm&&(this.modalVm.src=e)}},methods:{key(e){return e},closeModel(e){this.$emit(e?"$close":"$ok"),this.reload&&(this.$off("$ok"),this.$off("$close")),this.frameVisible=!1},showModel(){this.disabled||this.onOpen()===!1||(this.frameVisible=!0)},makeInput(){const e=this.$createElement,r={type:"text",value:this.fileList.map(i=>this.getSrc(i)).toString(),icon:this.icon,readonly:!0,clearable:!1};return e("Input",E([{},{props:r},{},{on:{"on-click":()=>this.showModel()}},{key:this.key("input")}]))},makeGroup(e){const r=this.$createElement;return(!this.maxLength||this.fileList.length<this.maxLength)&&e.push(this.makeBtn()),r("div",{key:this.key("group")},[...e])},makeItem(e,r){const i=this.$createElement;return i("div",{class:"fc-files",key:this.key("file"+e)},[...r])},valid(e){const r=this.formCreateInject.field||this.field;if(r&&e!==r)throw new Error("[frame]无效的字段值")},makeIcons(e,r){const i=this.$createElement;if(this.handleIcon!==!1||this.allowRemove===!0){const s=[];return(this.type!=="file"&&this.handleIcon!==!1||this.type==="file"&&this.handleIcon)&&s.push(this.makeHandleIcon(e,r)),this.allowRemove&&s.push(this.makeRemoveIcon(e,r)),i("div",{class:"fc-upload-cover",key:this.key("uc")},[s])}},makeHandleIcon(e,r){const i=this.$createElement;return i("icon",E([{},{props:{type:this.handleIcon===!0||this.handleIcon===void 0?"ios-eye-outline":this.handleIcon}},{on:{click:()=>this.handleClick(e)},key:this.key("hi"+r)}]))},makeRemoveIcon(e,r){const i=this.$createElement;return i("icon",E([{},{props:{type:"ios-trash-outline"}},{on:{click:()=>this.handleRemove(e)},key:this.key("ri"+r)}]))},makeFiles(){const e=this.$createElement;return this.makeGroup(this.fileList.map((r,i)=>this.makeItem(i,[e("icon",E([{},{props:{type:t.fileIcon,size:40}},{on:{click:()=>this.handleClick(r)}}])),this.makeIcons(r,i)])))},makeImages(){const e=this.$createElement;return this.makeGroup(this.fileList.map((r,i)=>this.makeItem(i,[e("img",{attrs:{src:this.getSrc(r)}}),this.makeIcons(r,i)])))},makeBtn(){const e=this.$createElement;return e("div",{class:"fc-upload-btn",on:{click:()=>this.showModel()},key:this.key("btn")},[e("icon",E([{},{props:{type:this.icon,size:20}}]))])},handleClick(e){return this.onHandle(e)},handleRemove(e){this.disabled||this.onBeforeRemove(e)!==!1&&(this.fileList.splice(this.fileList.indexOf(e),1),this.onRemove(e))},getSrc(e){return this.srcKey?e[this.srcKey]:e},frameLoad(e){this.onLoad(e);try{this.helper===!0&&(e.form_create_helper={api:this.formCreateInject.api,close:r=>{this.valid(r),this.closeModel()},set:(r,i)=>{this.valid(r),this.disabled||this.$emit("input",i)},get:r=>(this.valid(r),this.value),onOk:r=>this.$on("$ok",r),onClose:r=>this.$on("$close",r)})}catch(r){console.log(r)}},makeFooter(){const e=this.$createElement,{okBtnText:r,closeBtnText:i,closeBtn:s,okBtn:n,footer:o}=this.$props,a=[];return o&&(s&&a.push(e("Button",{on:{click:()=>this.onCancel()!==!1&&this.closeModel(!0)}},[i])),n&&a.push(e("Button",{attrs:{type:"primary"},on:{click:()=>this.onOk()!==!1&&this.closeModel()}},[r]))),a}},render(){const e=arguments[0],r=this.type;let i;r==="input"?i=this.makeInput():r==="image"?i=this.makeImages():i=this.makeFiles();const{width:s,height:n,src:o,title:a,modalTitle:l}=this.$props;return this.$nextTick(()=>{this.$refs.frame&&this.frameLoad(this.$refs.frame.contentWindow||{})}),e("div",{class:"_fc-frame"},[i,e("Modal",E([{},{props:{mask:this.previewMask,title:l,footerHide:!0}},{model:{value:this.previewVisible,callback:u=>{this.previewVisible=u}}}]),[e("img",{style:"width: 100%",attrs:{src:this.previewImage}})]),e("Modal",E([{},{props:_({width:s,title:a},this.modal)},{on:{"on-cancel":()=>this.closeModel(!0)},model:{value:this.frameVisible,callback:u=>{this.frameVisible=u}}}]),[this.frameVisible||!this.reload?e("iframe",{ref:"frame",attrs:{src:o,frameBorder:"0"},style:{height:n,border:"0 none",width:"100%"}}):null,e("div",{slot:"footer"},[this.makeFooter()])])])},mounted(){this.$on("fc.closeModal",this.closeModal)}}}const Ye=Ze({fileIcon:"md-document",fileUpIcon:"ios-folder-open"});Ye.v2=Ze({fileIcon:"document-text",fileUpIcon:"folder"});const Kt={name:"fcRadio",props:{formCreateInject:{type:Object,required:!0},value:{}},watch:{"formCreateInject.options":{handler(){this.update()},deep:!0},value(){this.update()}},data(){return{trueValue:[]}},methods:{options(){const t=this.formCreateInject.options;return Array.isArray(t)?t:[]},onInput(t){this.$emit("input",this.options().filter(e=>e.label===t).reduce((e,r)=>r.value,""))},update(){this.trueValue=this.options().filter(t=>t.value===this.value).reduce((t,e)=>e.label,"")}},created(){this.update()},render(){const t=arguments[0];return t("RadioGroup",E([{},this.formCreateInject.prop,{},{props:{value:this.trueValue}},{ref:"el",on:{input:this.onInput}}]),[this.options().map((e,r)=>{const i=_({},e);return delete i.value,t("Radio",E([{},{props:i},{key:""+r+"-"+e.value}]))}),me(this.$slots)])},mounted(){this.$emit("fc.el",this.$refs.el)}},h={type(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"},Undef(t){return t==null},Element(t){return typeof t=="object"&&t!==null&&t.nodeType===1&&!h.Object(t)},trueArray(t){return Array.isArray(t)&&t.length>0},Function(t){const e=this.getType(t);return e==="Function"||e==="AsyncFunction"},getType(t){const e=Object.prototype.toString.call(t);return/^\[object (.*)\]$/.exec(e)[1]},empty(t){return t==null||Array.isArray(t)&&Array.isArray(t)&&!t.length?!0:typeof t=="string"&&!t}};["Date","Object","String","Boolean","Array","Number"].forEach(t=>{h[t]=function(e){return h.type(e,t)}});function S(t,e){return{}.hasOwnProperty.call(t,e)}const Xt={name:"fcSelect",functional:!0,props:{formCreateInject:{type:Object,required:!0}},render(t,e){const r=(n,o)=>{const a=n.slot;return t("Option",E([{},{props:n},{key:""+o+"-"+n.value}]),[a?t("template",{slot:n.slotName||"default"},[h.Function(a)?n.slot(t):a]):null])},i=(n,o)=>t("OptionGroup",{attrs:{label:n.label},key:""+o+"-"+n.label},[h.trueArray(n.options)&&n.options.map((a,l)=>r(a,l))]),s=e.props.formCreateInject.options;return t("Select",E([{},e.data,{ref:"el"}]),[(Array.isArray(s)?s:[]).map((n,o)=>S(n||"","options")?i(n,o):r(n,o)),e.children])},mounted(){this.$emit("fc.el",this.$refs.el)}},Qt={name:"fcTree",props:{formCreateInject:{type:Object,required:!0},type:{type:String,default:"checked"},value:{type:[Array,String,Number],default:()=>[]}},data(){return{treeData:[]}},watch:{value(t){this.setStatus(t)}},created(){this.setStatus(this.value)},methods:{setStatus(t){const e=U(t),r=this.formCreateInject.prop.props.data;this.type==="selected"?this.checked(r,e,"selected"):this.checked(r,e,"checked"),this.$forceUpdate()},checked(t,e,r){t.forEach(i=>{this.$set(i,r,e.indexOf(i.id)!==-1),i.children!==void 0&&Array.isArray(i.children)&&this.checked(i.children,e,r)})},onInput(t){this.$emit("input",t.map(e=>e.id))}},render(){const t=arguments[0],e={};return this.type==="selected"?e["on-select-change"]=this.onInput:e["on-check-change"]=this.onInput,t("Tree",E([{},this.formCreateInject.prop,{ref:"tree"},{on:e}]),[me(this.$slots)])},mounted(){this.$emit("fc.el",this.$refs.tree)}};function xe(t){return typeof t=="object"?t:{url:t,is_string:!0,name:Zt(t)}}function et(t){return J(_({},t),{file:t,value:t})}function Zt(t){return(""+t).split("/").pop()}const Yt="fcUpload";function tt(t){return{name:Yt,props:{formCreateInject:{type:Object,required:!0},onHandle:{type:Function,default(e){this.previewImage=e.url,this.previewVisible=!0}},uploadType:{type:String,default:"file"},maxLength:{type:Number,default:0},allowRemove:{type:Boolean,default:!0},modalTitle:String,handleIcon:{type:[String,Boolean],default:()=>{}},value:[Array,String]},data(){return{uploadList:[],previewVisible:!1,previewImage:"",cacheFiles:[]}},created(){this.formCreateInject.prop.props.showUploadList===void 0&&(this.formCreateInject.prop.props.showUploadList=!1),this.formCreateInject.prop.props.defaultFileList=U(this.value).map(xe).map(et)},watch:{value(e){this.$refs.upload.fileList.every(r=>!r.status||r.status==="finished")&&(this.$refs.upload.fileList=U(e).map(xe).map(et),this.uploadList=this.$refs.upload.fileList)},maxLength(e,r){(r===1||e===1)&&this.update()}},methods:{key(e){return e},isDisabled(){return this.formCreateInject.prop.props.disabled===!0},onRemove(e){this.isDisabled()||this.$refs.upload.handleRemove(e)},handleClick(e){this.onHandle(e)},makeItem(e,r){const i=this.$createElement;return this.uploadType==="image"?i("img",{attrs:{src:e.url},key:this.key("img"+r)}):i("icon",E([{},{props:{type:t.fileIcon,size:40}},{key:this.key("i"+r)}]))},makeRemoveIcon(e,r){const i=this.$createElement;return i("icon",{attrs:{type:"ios-trash-outline"},on:{click:()=>this.onRemove(e)},key:this.key("ri"+r)})},makeHandleIcon(e,r){const i=this.$createElement;return i("icon",{attrs:{type:this.handleIcon===!0||this.handleIcon===void 0?"ios-eye-outline":this.handleIcon},on:{click:()=>this.handleClick(e)},key:this.key("hi"+r)})},makeProgress(e,r){const i=this.$createElement;return i("Progress",E([{},{props:{percent:e.percentage,hideInfo:!0}},{style:"width:90%",key:this.key("pg"+r)}]))},makeIcons(e,r){const i=this.$createElement,s=[];if(this.allowRemove||this.handleIcon!==!1)return(this.uploadType!=="file"&&this.handleIcon!==!1||this.uploadType==="file"&&this.handleIcon)&&s.push(this.makeHandleIcon(e,r)),this.allowRemove&&s.push(this.makeRemoveIcon(e,r)),i("div",{class:"fc-upload-cover"},[s])},makeFiles(){const e=this.$createElement;return this.uploadList.map((r,i)=>this.$scopedSlots.fileList?this.$scopedSlots.fileList({file:r,index:i,vm:this}):e("div",{key:this.key(i),class:"fc-files"},[r.showProgress?this.makeProgress(r,i):[this.makeItem(r,i),this.makeIcons(r,i)]]))},makeUpload(){const e=this.$createElement,r=!this.maxLength||this.maxLength>this.uploadList.length;return e("Upload",E([{},this.formCreateInject.prop,{},{style:{display:"inline-block"},key:this.key("upload"),ref:"upload"}]),[r?e("template",{slot:"default"},[this.$slots.default||e("div",{class:"fc-upload-btn"},[e("icon",E([{},{props:{type:this.uploadType==="file"?"ios-cloud-upload-outline":t.imgUpIcon,size:20}}]))])]):null,me(this.$slots,["default"])])},update(){let e=this.$refs.upload.fileList.map(r=>r.is_string?r.url:r.value||r.url).filter(r=>r!==void 0);(this.cacheFiles.length!==e.length||!e.length)&&(this.cacheFiles=[...e],this.$emit("input",this.maxLength===1?e[0]||"":e))},handleCancel(){this.previewVisible=!1}},render(){const e=arguments[0];return this.$refs.upload&&(this.formCreateInject.prop.props.showUploadList===void 0&&(this.formCreateInject.prop.props.showUploadList=this.$refs.upload.showUploadList),this.formCreateInject.prop.props.defaultFileList=this.$refs.upload.defaultFileList),e("div",{class:"_fc-upload"},[[this.formCreateInject.prop.props.showUploadList?[]:this.makeFiles(),this.makeUpload()],e("Modal",E([{},{props:{title:this.modalTitle,footerHide:!0}},{model:{value:this.previewVisible,callback:r=>{this.previewVisible=r}}}]),[e("img",{attrs:{alt:"example",src:this.previewImage},style:"width: 100%"})])])},mounted(){this.uploadList=this.$refs.upload.fileList,this.$watch(()=>this.$refs.upload.fileList,()=>{this.update()},{deep:!0}),this.$emit("fc.el",this.$refs.upload)}}}const rt=tt({fileIcon:"md-document",imgUpIcon:"md-images"});rt.v2=tt({fileIcon:"document-text",imgUpIcon:"image"});function I(t,e,r){p.set(t,e,r)}function ne(t,e){(p.del||p.delete)(t,e)}function he(t,e={},r){let i=!1;for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)){let n=e[s];if((i=Array.isArray(n))||h.Object(n)){let o=t[s]===void 0;if(i)i=!1,o&&I(t,s,[]);else if(n._clone&&r!==void 0)if(r)n=n.getRule(),o&&I(t,s,{});else{I(t,s,n._clone());continue}else o&&I(t,s,{});t[s]=he(t[s],n,r)}else I(t,s,n),h.Undef(n)||(h.Undef(n.__json)||(t[s].__json=n.__json),h.Undef(n.__origin)||(t[s].__origin=n.__origin))}return r!==void 0&&Array.isArray(t)?t.filter(s=>!s||!s.__ctrl):t}function q(t){return he({},{value:t}).value}const xt=Object.assign||function(t){for(let e,r=1;r<arguments.length;r++)for(let i in e=arguments[r],e)Object.prototype.hasOwnProperty.call(e,i)&&I(t,i,e[i]);return t};function b(){return xt.apply(this,arguments)}function Fe(t){return typeof t!="object"||t===null?t:t instanceof Array?[...t]:_({},t)}const er=[Wt,Kt,Xt,Qt,{name:"fcSubForm",props:{rule:Array,options:Object,formCreateInject:{type:Object,required:!0},value:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0}},data(){return{cacheRule:{},cacheValue:{},type:void 0}},watch:{value(t){this.setValue(t)}},methods:{formData(t){this.cacheValue=JSON.stringify(t),this.$emit("input",t),this.$emit("change",t)},setValue(t){const e=JSON.stringify(t);this.cacheValue!==e&&(this.cacheValue=e,this.cacheRule.$f.coverValue(t||{}))},addRule(){const t=this.options?this.options:{submitBtn:!1,resetBtn:!1};t.formData=_({},this.value||{}),this.cacheRule={rule:this.rule,options:t}},add$f(t){this.cacheRule.$f=t,this.$nextTick(()=>{this.$emit("itemMounted",t)})},emitEvent(t,...e){this.$emit(t,...e)}},created(){this.addRule(),this.type=this.formCreateInject.form.$form()},render(){const t=arguments[0],{rule:e,options:r}=this.cacheRule,i=this.type;return t(i,E([{},{on:{"update:value":this.formData,"emit-event":this.emitEvent,input:this.add$f}},{},{props:{rule:e,option:r,disabled:this.disabled,extendOption:!0}}]))}},Ye,rt,{name:"fcGroup",props:{field:String,rule:[Array,Object],rules:Array,expand:Number,options:Object,formCreateInject:{type:Object,required:!0},button:{type:Boolean,default:!0},max:{type:Number,default:0},min:{type:Number,default:0},value:{type:Array,default:()=>[]},sortBtn:{type:Boolean,default:!0},defaultValue:Object,disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},onBeforeRemove:{type:Function,default:()=>{}},onBeforeAdd:{type:Function,default:()=>{}},parse:Function},data(){return{len:0,cacheRule:{},cacheValue:{},sort:[],type:void 0}},computed:{formRule(){return this.rules?this.rules:this.rule?Array.isArray(this.rule)?this.rule:[this.rule]:[]}},watch:{cacheRule:{handler(t){this.sort=Object.keys(t)},immediate:!0},formRule:{handler(t,e){Object.keys(this.cacheRule).forEach(r=>{const i=this.cacheRule[r];if(i.$f){const s=i.$f.formData();if(t===e)i.$f.deferSyncValue(()=>{he(i.rule,t),i.$f.setValue(s)},!0);else{const n=i.$f.formData();i.$f.once("reloading",()=>{i.$f.setValue(n)}),i.rule=q(t)}}})},deep:!0},expand(t){let e=t-this.value.length;e>0&&this.expandRule(e)},value(t,e){t=t||[];let r=this.sort,i=r.length,s=i-t.length;if(s<0){for(let n=s;n<0;n++)this.addRule(t.length+n);this.sort=Object.keys(this.cacheRule);for(let n=0;n<i;n++)this.setValue(r[n],t[n])}else{if(s>0)for(let n=0;n<s;n++)this.removeRule(r[i-n-1]);this.sort=Object.keys(this.cacheRule),t.forEach((n,o)=>{this.setValue(r[o],t[o])})}}},methods:{_value(t){return t&&S(t,this.field)?t[this.field]:t},cache(t,e){this.cacheValue[t]=JSON.stringify(e)},input(t){this.$emit("input",t),this.$emit("change",t)},formData(t,e){const r=this.cacheRule,i=this.sort;if(i.filter(n=>r[n].$f).length!==i.length)return;const s=i.map(n=>{const o=t===n?e:_({},this.cacheRule[n].$f.form),a=this.field?o[this.field]||null:o;return this.cache(n,a),a});this.input(s)},setValue(t,e){const r=this.field,i=this.cacheRule[t].$f;r&&(e={[r]:this._value(e)}),this.cacheValue[t]!==JSON.stringify(r?e[r]:e)&&(this.cache(t,e),i&&i.coverValue(e||{}))},addRule(t,e){const r=this.formCreateInject.form.copyRules(this.formRule),i=this.options?_({},this.options):{submitBtn:!1,resetBtn:!1};if(this.defaultValue){i.formData||(i.formData={});const s=q(this.defaultValue);b(i.formData,this.field?{[this.field]:s}:s)}this.parse&&this.parse({rule:r,options:i,index:this.sort.length}),this.$set(this.cacheRule,++this.len,{rule:r,options:i}),e&&this.$nextTick(()=>this.$emit("add",r,Object.keys(this.cacheRule).length-1))},add$f(t,e,r){this.cacheRule[e].$f=r,this.$nextTick(()=>{this.$emit("itemMounted",r,Object.keys(this.cacheRule).indexOf(e))})},removeRule(t,e){const r=Object.keys(this.cacheRule).indexOf(t);this.$delete(this.cacheRule,t),this.$delete(this.cacheValue,t),e&&this.$nextTick(()=>this.$emit("remove",r))},add(t){this.disabled||this.onBeforeAdd(this.value)===!1||this.addRule(t,!0)},del(t,e){if(this.disabled||this.onBeforeRemove(this.value,t)===!1)return;this.removeRule(e,!0);const r=[...this.value];r.splice(t,1),this.input(r)},addIcon(t){const e=this.$createElement;return e("div",{class:"_fc-group-btn _fc-group-plus-minus",on:{click:this.add}})},delIcon(t,e){const r=this.$createElement;return r("div",{class:"_fc-group-btn _fc-group-plus-minus _fc-group-minus",on:{click:()=>this.del(t,e)}})},sortUpIcon(t){const e=this.$createElement;return e("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-up",on:{click:()=>this.changeSort(t,-1)}})},sortDownIcon(t){const e=this.$createElement;return e("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-down",on:{click:()=>this.changeSort(t,1)}})},changeSort(t,e){const r=this.sort[t];this.$set(this.sort,t,this.sort[t+e]),this.sort[t+e]=r,this.formData(0)},makeIcon(t,e,r){if(this.$scopedSlots.button)return this.$scopedSlots.button({total:t,index:e,vm:this,key:r,del:()=>this.del(e,r),add:this.add});const i=[];return(!this.max||t<this.max)&&t===e+1&&i.push(this.addIcon(r)),t>this.min&&i.push(this.delIcon(e,r)),this.sortBtn&&e&&i.push(this.sortUpIcon(e)),this.sortBtn&&e!==t-1&&i.push(this.sortDownIcon(e)),i},emitEvent(t,e,r,i){this.$emit(t,...e,this.cacheRule[i].$f,r)},expandRule(t){for(let e=0;e<t;e++)this.value.push(this.field?null:{})}},created(){this.type=this.formCreateInject.form.$form();const t=(this.expand||0)-this.value.length;t>0&&this.expandRule(t);for(let e=0;e<this.value.length;e++)this.addRule(e)},render(){const t=arguments[0],e=this.sort,r=this.button,i=this.type,s=this.disabled,n=e.length===0?this.$scopedSlots.default?this.$scopedSlots.default({vm:this,add:this.add}):t("div",{key:"a_def",class:"_fc-group-plus-minus _fc-group-add",on:{click:this.add}}):e.map((o,a)=>{const{rule:l,options:u}=this.cacheRule[o],c=r&&!s?this.makeIcon(e.length,a,o):[];return t("div",{class:"_fc-group-container",key:o},[t(i,E([{key:o},{on:{"update:value":m=>this.formData(o,m),"emit-event":(m,...g)=>this.emitEvent(m,g,a,o),input:m=>this.add$f(a,o,m)}},{},{props:{disabled:s,inFor:!0,value:this.field?{[this.field]:this._value(this.value[a])}:this.value[a],rule:l,option:u,extendOption:!0}}])),t("div",{class:"_fc-group-idx"},[a+1]),c.length?t("div",{class:"_fc-group-handle"},[c]):null])});return t("div",{key:"con",class:"_fc-group "+(s?"_fc-group-disabled":"")},[n])}}];function se(t,e){var r=null;return function(...i){r!==null&&clearTimeout(r),r=setTimeout(()=>t.call(this,...i),e)}}function de(t){let e=t.replace(/([A-Z])/g,"-$1").toLocaleLowerCase();return e.indexOf("-")===0&&(e=e.substr(1)),e}const ge=(t,e)=>{if(!(!t||t===e||!t.$props)){if(t.$props.formCreateInject)return t.$props.formCreateInject;if(t.$parent)return ge(t.$parent,e)}};function tr(t,e,r){const i="FormCreate"+(t.isMobile?"Mobile":"");return{name:i,componentName:i,model:{prop:"api"},components:e,directives:r,provide(){return{$pfc:this}},inject:{$pfc:{default:null}},props:{rule:{type:Array,required:!0,default:()=>[]},option:{type:Object,default:()=>({})},extendOption:Boolean,driver:[String,Object],value:Object,disabled:{type:Boolean,default:void 0},preview:{type:Boolean,default:void 0},index:[String,Number],api:Object,locale:[String,Object],name:String,subForm:{type:Boolean,default:!0},inFor:Boolean},render(){return this.fc.render()},setup(s){const n=p.getCurrentInstance().proxy;p.provide("parentFC",n);const o=p.inject("parentFC",null);let a=o;if(o)for(;a.parent;)a=a.parent;else a=n;const{rule:l,value:u,subForm:c,inFor:m}=p.toRefs(s),g=p.reactive({ctxInject:{},destroyed:!1,isShow:!0,unique:1,renderRule:[...l.value||[]],updateValue:JSON.stringify(u.value||{})}),v=new t(n),C=v.api(),O=m.value,j=()=>{if(o){const F=ge(n,o);if(F){let D;O?(D=U(F.getSubForm()),D.push(C)):D=C,F.subForm(D)}}},ee=()=>{const F=ge(n,o);if(F)if(O){const D=U(F.getSubForm()),B=D.indexOf(C);B>-1&&D.splice(B,1)}else F.subForm()};let T=null;p.onBeforeMount(()=>{p.watch(()=>{let F="";const D=s.option&&s.option.globalClass||{};Object.keys(D).forEach(B=>{let le="";D[B].style&&Object.keys(D[B].style).forEach(we=>{le+=de(we)+":"+D[B].style[we]+";"}),D[B].content&&(le+=D[B].content+";"),le&&(F+=`.${B}{${le}}`)}),s.option&&s.option.style&&(F+=s.option.style),T||(T=document.createElement("style"),T.type="text/css",document.head.appendChild(T)),T.innerHTML=F||""},()=>{})});const N=se(()=>{v.bus.$emit("$loadData.$topForm")},100),We=se(()=>{v.bus.$emit("$loadData.$form")},100),Ce=F=>{v.bus.$emit("change-$form."+F)};return p.onMounted(()=>{o&&(C.top.bus.$on("$loadData.$form",N),C.top.bus.$on("change",Ce)),v.mounted()}),p.onBeforeUnmount(()=>{o&&(C.top.bus.$off("$loadData.$form",N),C.top.bus.$off("change",Ce)),T&&document.head.removeChild(T),ee(),g.destroyed=!0,v.unmount()}),p.onUpdated(()=>{v.updated()}),p.watch(c,F=>{F?j():ee()},{immediate:!0}),p.watch(()=>[...l.value],F=>{v.$handle.isBreakWatch()||F.length===g.renderRule.length&&F.every(D=>g.renderRule.indexOf(D)>-1)||(v.$handle.updateAppendData(),v.$handle.reloadRule(l.value),n.renderRule())}),p.watch(()=>s.option,()=>{v.initOptions(),C.refresh()},{deep:!0}),p.watch(()=>[s.disabled,s.preview],()=>{C.refresh()}),p.watch(u,F=>{JSON.stringify(F||{})!==g.updateValue&&(C.config.forceCoverValue?C.coverValue(F||{}):C.setValue(F||{}))},{deep:!0,flush:"post"}),p.watch(()=>s.index,()=>{C.coverValue({}),v.$handle.updateAppendData(),p.nextTick(()=>{p.nextTick(()=>{C.clearValidateState()})})},{flush:"sync"}),J(_({fc:p.markRaw(v),parent:o&&p.markRaw(o),top:p.markRaw(a),fapi:p.markRaw(C)},p.toRefs(g)),{getGroupInject:()=>ge(n,o),refresh(){++g.unique},renderRule(){g.renderRule=[...l.value||[]]},updateValue(F){if(g.destroyed)return;const D=JSON.stringify(F);g.updateValue!==D&&(g.updateValue=D,n.$emit("update:value",F),p.nextTick(()=>{We(),o||N()}))}})},created(){this.$emit("input",this.fapi),this.fc.init()}}}const it=["attrs","props","domProps","scopedSlots"],nt=["class","style","directives"],st=["on","nativeOn","hook"],z=(t,e={},r={})=>{const i=[...it,...r.normal||[]],s=[...nt,...r.array||[]],n=[...st,...r.functional||[]],o=r.props||[];return t.reduce((a,l)=>{for(const u in l)if(a[u])if(o.indexOf(u)>-1)a[u]=z([l[u]],a[u]);else if(i.indexOf(u)>-1)a[u]=_(_({},a[u]),l[u]);else if(s.indexOf(u)>-1){const c=a[u]instanceof Array?a[u]:[a[u]],m=l[u]instanceof Array?l[u]:[l[u]];a[u]=[...c,...m]}else if(n.indexOf(u)>-1)for(const c in l[u])if(a[u][c]){const m=a[u][c]instanceof Array?a[u][c]:[a[u][c]],g=l[u][c]instanceof Array?l[u][c]:[l[u][c]];a[u][c]=[...m,...g]}else a[u][c]=l[u][c];else if(u==="hook")for(let c in l[u])a[u][c]?a[u][c]=rr(a[u][c],l[u][c]):a[u][c]=l[u][c];else a[u]=l[u];else i.indexOf(u)>-1||n.indexOf(u)>-1||o.indexOf(u)>-1?a[u]=_({},l[u]):s.indexOf(u)>-1?a[u]=l[u]instanceof Array?[...l[u]]:typeof l[u]=="object"?_({},l[u]):l[u]:a[u]=l[u];return a},e)},rr=(t,e)=>function(){t&&t.apply(this,arguments),e&&e.apply(this,arguments)},ot=["type","slot","ignore","emitPrefix","value","name","native","hidden","display","inject","options","emit","nativeEmit","link","prefix","suffix","update","sync","optionsTo","key","slotUpdate","computed","preview","component","cache"],Se=["validate","children","control"],Ee=["effect","deep"];function at(){return[...ot,...it,...nt,...st,...Se,...Ee]}function lt(t,e,r){return`[form-create ${t}]: ${e}`}function De(t,e){console.error(lt("err",t))}function ir(t){De(t.toString()),console.error(t)}function nr(t){return t==null?"":typeof t=="object"?JSON.stringify(t,null,2):String(t)}const je="[[FORM-CREATE-PREFIX-",Ae="-FORM-CREATE-SUFFIX]]";function Ie(t,e){return JSON.stringify(he(Array.isArray(t)?[]:{},t,!0),function(r,i){if(!(i&&i._isVue===!0)){if(typeof i!="function")return i;if(i.__json)return i.__json;if(i.__origin&&(i=i.__origin),!i.__emit)return je+i+Ae}},e)}function Pe(t){return new Function("return "+t)()}function K(t,e){if(t&&h.String(t)&&t.length>4){let r=t.trim(),i=!1;try{if(r.indexOf(Ae)>0&&r.indexOf(je)===0)r=r.replace(Ae,"").replace(je,""),i=!0;else if(r.indexOf("$FN:")===0)r=r.substring(4),i=!0;else if(r.indexOf("$EXEC:")===0)r=r.substring(6),i=!0;else if(r.indexOf("$GLOBAL:")===0){const n=r.substring(8);return r=function(...o){const a=o[0].api.getGlobalEvent(n);if(a)return a.call(this,...o)},r.__json=t,r.__inject=!0,r}else{if(r.indexOf("$FNX:")===0)return r=Pe("function($inject){"+r.substring(5)+"}"),r.__json=t,r.__inject=!0,r;(!e&&r.indexOf("function ")===0&&r!=="function "||!e&&r.indexOf("function(")===0&&r!=="function(")&&(i=!0)}if(!i)return t;let s;try{s=Pe(r)}catch(n){s=Pe("function "+r)}return s.__json=t,s}catch(s){De(`解析失败:${r}
11
11
 
12
- err: ${s}`);return}}return t}function Tt(t,e){return JSON.parse(t,function(r,i){return h.Undef(i)||!i.indexOf?i:U(i,e)})}function De(t,e){return{value:t,enumerable:!1,configurable:!1,writable:!!e}}function ce(t){return Te([t])[0]}function Te(t,e){return z([],[...t],e||!1)}function q(t,e){return T(Array.isArray(e)?e:[e],t,{array:oe,normal:ae}),t}function Be(t){const e=h.Function(t.getRule)?t.getRule():t;return e.type||(e.type="input"),e}function Bt(t,e){return t?(Object.keys(e||{}).forEach(r=>{e[r]&&(t[r]=q(t[r]||{},e[r]))}),t):e}function Le(t,e){Object.defineProperties(t,Object.keys(e).reduce((r,i)=>(r[i]={get(){return e[i]()}},r),{}))}function K(t){return t.__fc__||(t.__origin__?t.__origin__.__fc__:null)}function R(t,e){try{e=t()}catch(r){Dt(r)}return e}const Ne=(t,e)=>typeof t=="string"?String(e):typeof t=="number"?Number(e):e,W={"==":(t,e)=>JSON.stringify(t)===JSON.stringify(Ne(t,e)),"!=":(t,e)=>!W["=="](t,e),">":(t,e)=>t>e,">=":(t,e)=>t>=e,"<":(t,e)=>t<e,"<=":(t,e)=>t<=e,on(t,e){return t&&t.indexOf&&t.indexOf(Ne(t[0],e))>-1},notOn(t,e){return!W.on(t,e)},in(t,e){return e&&e.indexOf&&e.indexOf(t)>-1},notIn(t,e){return!W.in(t,e)},between(t,e){return t>e[0]&&t<e[1]},notBetween(t,e){return t<e[0]||t>e[1]},empty(t){return h.empty(t)},notEmpty(t){return!h.empty(t)},pattern(t,e){return new RegExp(e,"g").test(t)}};function Me(){return{props:{},on:{},options:[],children:[],effect:{},hidden:!1,display:!0,value:void 0}}function E(t,e){return(r,i,s,n={})=>{const o=new de(t,r,i,s,n);return e&&(h.Function(e)?e(o):o.props(e)),o}}function de(t,e,r,i,s){this._data=p(Me(),{type:t,title:e,field:r,value:i,props:s||{}}),this.event=this.on}p(de.prototype,{getRule(){return this._data},setProp(t,e){return S(this._data,t,e),this},_clone(){const t=new this.constructor;return t._data=ce(this._data),t}});function Ue(t){t.forEach(e=>{de.prototype[e]=function(r){return q(this._data,{[e]:arguments.length<2?r:{[r]:arguments[1]}}),this}})}Ue(Vt());const qe=E("");function Lt(t,e,r){let i=qe("",e);return i._data.type=t,i._data.title=r,i}function He(t,e,r,i){let s=qe("",r);return s._data.type="template",s._data.template=t,s._data.title=i,s._data.vm=e,s}function Nt(){return{create:Lt,createTmp:He,template:He,factory:E}}function Mt(t,e,r){const i=`fail to ${t} ${r.status}'`,s=new Error(i);return s.status=r.status,s.url=t,s}function Je(t){const e=t.responseText||t.response;if(!e)return e;try{return JSON.parse(e)}catch(r){return e}}function ze(t){if(typeof XMLHttpRequest=="undefined")return;const e=new XMLHttpRequest,r=t.action;e.onerror=function(o){t.onError(o)},e.onload=function(){if(e.status<200||e.status>=300)return t.onError(Mt(r,t,e),Je(e));t.onSuccess(Je(e))},e.open(t.method||"get",r,!0);let i;t.data&&((t.dataType||"").toLowerCase()!=="json"?(i=new FormData,Object.keys(t.data).map(n=>{i.append(n,t.data[n])})):(i=JSON.stringify(t.data),e.setRequestHeader("content-type","application/json"))),t.withCredentials&&"withCredentials"in e&&(e.withCredentials=!0);const s=t.headers||{};Object.keys(s).forEach(n=>{s[n]!==null&&e.setRequestHeader(n,s[n])}),e.send(i)}function Ut(t){return new Promise((e,r)=>{ze(J(y({},t),{onSuccess(i){let s=o=>o;const n=U(t.parse);h.Function(n)?s=n:n&&h.String(n)&&(s=o=>(n.split(".").forEach(a=>{o&&(o=o[a])}),o)),e(s(i))},onError(i){r(i)}}))})}function X(t){return N(t)}function qt(t){function e(n){return h.Undef(n)?n=t.fields():Array.isArray(n)||(n=[n]),n}function r(n,o,a){e(n).forEach(u=>{t.getCtxs(u).forEach(l=>{S(l.rule,o,a),t.$render.clearCache(l)})})}function i(){const n=t.subForm;return Object.keys(n).reduce((o,a)=>{const u=n[a];return u&&(Array.isArray(u)?o.push(...u):o.push(u)),o},[])}const s={get config(){return t.options},get options(){return t.options},get form(){return t.form},get rule(){return t.rules},get parent(){return t.vm.$pfc&&t.vm.$pfc.$f},get top(){return s.parent?s.parent.top:s},get children(){return i()},formData(n){return e(n).reduce((o,a)=>{const u=t.getFieldCtx(a);return u&&(o[u.field]=X(u.rule.value)),o},t.options.appendValue!==!1?X(t.appendData):{})},getValue(n){const o=t.getFieldCtx(n);if(o)return X(o.rule.value)},coverValue(n){const o=y({},n||{});t.deferSyncValue(()=>{s.fields().forEach(a=>{const u=t.fieldCtx[a];if(u){const l=O(o,a);u.forEach(c=>{c.rule.value=l?o[a]:void 0}),delete o[a]}}),p(t.appendData,o)})},setValue(n){let o=n;arguments.length>=2&&(o={[n]:arguments[1]}),t.deferSyncValue(()=>{Object.keys(o).forEach(a=>{const u=t.fieldCtx[a];if(!u)return t.appendData[a]=o[a];u.forEach(l=>{l.rule.value=o[a]})})})},removeField(n){const o=t.getCtx(n);return t.deferSyncValue(()=>{t.getCtxs(n).forEach(a=>{a.rm()})},!0),o?o.origin:void 0},removeRule(n){const o=n&&K(n);if(o)return o.rm(),o.origin},destroy:()=>{t.vm.$el.parentNode&&t.vm.$el.parentNode.removeChild(t.vm.$el),t.vm.$destroy()},fields:()=>t.fields(),append:(n,o,a)=>{let u=t.sort.length-1,l;const c=t.getCtx(o);c?a?(l=c.rule.children,u=c.rule.children.length-1):(u=c.root.indexOf(c.origin),l=c.root):l=t.rules,l.splice(u+1,0,n)},prepend:(n,o,a)=>{let u=0,l;const c=t.getCtx(o);c?a?l=c.rule.children:(u=c.root.indexOf(c.origin),l=c.root):l=t.rules,l.splice(u,0,n)},hidden(n,o){r(o,"hidden",!!n),t.refresh()},hiddenStatus(n){const o=t.getCtx(n);if(o)return!!o.rule.hidden},display(n,o){r(o,"display",!!n),t.refresh()},displayStatus(n){const o=t.getCtx(n);if(o)return!!o.rule.display},disabled(n,o){e(o).forEach(a=>{t.getCtxs(a).forEach(u=>{u.rule.props&&S(u.rule.props,"disabled",!!n)})}),t.refresh()},all(n){return Object.keys(t.ctxs).map(o=>{const a=t.ctxs[o];return n?a.origin:a.rule})},model(n){return t.fields().reduce((o,a)=>{const u=t.fieldCtx[a][0];return o[a]=n?u.origin:u.rule,o},{})},component(n){return Object.keys(t.nameCtx).reduce((o,a)=>{const u=t.nameCtx[a].map(l=>n?l.origin:l.rule);return o[a]=u.length===1?u[0]:u,o},{})},bind(){return s.form},reload:n=>{t.reloadRule(n)},updateOptions(n){t.fc.updateOptions(n),s.refresh()},onSubmit(n){s.updateOptions({onSubmit:n})},sync:n=>{if(Array.isArray(n)){n.forEach(a=>s.sync(a));return}let o=h.Object(n)?K(n):t.getCtxs(n);o&&(o=Array.isArray(o)?o:[o],o.forEach(a=>{if(!a.deleted){const u=t.subForm[a.id];u&&(Array.isArray(u)?u.forEach(l=>{l.refresh()}):u&&u.refresh()),t.$render.clearCache(a)}}),t.refresh())},refresh:()=>{i().forEach(n=>{n.refresh()}),t.$render.clearCacheAll(),t.refresh()},refreshOptions(){t.$manager.updateOptions(t.options),s.refresh()},hideForm:n=>{S(t.vm,"isShow",!n)},changeStatus:()=>t.changeStatus,clearChangeStatus:()=>{t.changeStatus=!1},updateRule(n,o){t.getCtxs(n).forEach(a=>{p(a.rule,o)})},updateRules(n){Object.keys(n).forEach(o=>{s.updateRule(o,n[o])})},mergeRule:(n,o)=>{t.getCtxs(n).forEach(a=>{q(a.rule,o)})},mergeRules(n){Object.keys(n).forEach(o=>{s.mergeRule(o,n[o])})},getRule:(n,o)=>{const a=t.getCtx(n);if(a)return o?a.origin:a.rule},getRenderRule:n=>{const o=t.getCtx(n);if(o)return o.prop},getRefRule:n=>{const o=t.getCtxs(n);if(o&&o.length){const a=o.map(u=>u.rule);return a.length===1?a[0]:a}},setEffect(n,o,a){const u=t.getCtx(n);u&&o&&(o[0]==="$"&&(o=o.substr(1)),O(u.rule,"$"+o)&&S(u.rule,"$"+o,a),O(u.rule,"effect")||S(u.rule,"effect",{}),S(u.rule.effect,o,a))},clearEffectData(n,o){const a=t.getCtx(n);a&&(o&&o[0]==="$"&&(o=o.substr(1)),a.clearEffectData(o),s.sync(n))},updateValidate(n,o,a){a?s.mergeRule(n,{validate:o}):r(n,"validate",o)},updateValidates(n,o){Object.keys(n).forEach(a=>{s.updateValidate(a,n[a],o)})},refreshValidate(){t.vm.validate={},s.refresh()},resetFields(n){e(n).forEach(o=>{t.getCtxs(o).forEach(a=>{t.$render.clearCache(a),a.rule.value=X(a.defaultValue)})}),t.vm.$nextTick(()=>{s.clearValidateState()}),n==null&&(h.Function(t.options.onReset)&&R(()=>t.options.onReset(s)),t.vm.$emit("reset",s))},method(n,o){const a=s.el(n);if(!a||!a[o])throw new Error(le("err",`${o}方法不存在`));return(...u)=>a[o](...u)},exec(n,o,...a){return R(()=>s.method(n,o)(...a))},toJson(n){return Ve(s.rule,n)},trigger(n,o,...a){const u=s.el(n);u&&u.$emit(o,...a)},el(n){const o=t.getCtx(n);if(o)return o.exportEl||o.el||t.vm.$refs[o.ref]},closeModal:n=>{const o=s.el(n);o&&o.$emit&&o.$emit("close-modal")},getSubForm(n){const o=t.getCtx(n);return o?t.subForm[o.id]:void 0},nextTick(n){t.bus.$once("next-tick",n),t.refresh()},nextRefresh(n){t.nextRefresh(),n&&R(n)},emit(n,...o){t.vm.$emit(n,...o)},deferSyncValue(n,o){t.deferSyncValue(n,o)},fetch(n){return new Promise((o,a)=>{t.beforeFetch(n).then(()=>Ut(n).then(o).catch(a))})},getData(n,o){return t.fc.getData(n,o)},setData(n,o){return t.fc.setData(n,o)},helper:{tidyFields:e,props:r}};return["on","once","off","set","emit"].forEach(n=>{s[n]=function(...o){t.vm[`$${n}`](...o)}}),s.changeValue=s.changeField=s.setValue,s}function Ht(t){p(t.prototype,{initCache(){this.clearCacheAll()},clearCache(e){if(e.rule.cache)return;if(!this.cache[e.id]){e.parent&&this.clearCache(e.parent);return}(this.cache[e.id].use===!0||this.cache[e.id].parent)&&this.$handle.refresh();const r=this.cache[e.id].parent;this.cache[e.id]=null,r&&this.clearCache(r)},clearCacheAll(){this.cache={}},setCache(e,r,i){this.cache[e.id]={vnode:r,use:!1,parent:i,slot:e.rule.slot}},getCache(e){const r=this.cache[e.id];if(r)return r.use=!0,r.vnode}})}function V(t){const e=t.replace(/(-[a-z])/g,function(r){return r.replace("-","").toLocaleUpperCase()});return We(e)}function We(t){return t.replace(t[0],t[0].toLowerCase())}function Jt(t){return t==null?"":typeof t=="object"?JSON.stringify(t,null,2):String(t)}function Q(t){let e=t.replace(/([A-Z])/g,"-$1").toLocaleLowerCase();return e.indexOf("-")===0&&(e=e.substr(1)),e}let zt=0;function Z(){const t=370+ ++zt;return"F"+Math.random().toString(36).substr(3,3)+(+`${Date.now()}`).toString(36)+t.toString(36)+"c"}function Y(t,e,r){let i=t,s;return(e||"").split(".").forEach(n=>{s&&((!i[s]||typeof i[s]!="object")&&(i[s]={}),i=i[s]),s=n}),i[s]=r,i}function Wt(t){p(t.prototype,{initRender(){this.tempList={},this.clearOrgChildren()},initOrgChildren(){const e=this.$handle.ctxs;this.orgChildren=Object.keys(e).reduce((r,i)=>{if(e[i].parser.loadChildren!==!1){const s=e[i].rule.children;r[i]=h.trueArray(s)?[...s]:[]}return r},{})},clearOrgChildren(){this.orgChildren={}},getTypeSlot(e){const r=i=>{if(i){let s;return e.rule.field&&(s=i.$scopedSlots["field-"+Q(e.rule.field)]||i.$scopedSlots["field-"+e.rule.field]),s||(s=i.$scopedSlots["type-"+Q(e.type)]||i.$scopedSlots["type-"+e.type]),s||r(i.$pfc)}};return r(this.vm)},render(){if(!this.vm.isShow)return;this.$h=this.vm.$createElement,this.$manager.beforeRender();let e;const r=()=>this.renderList();return r.renderSlot=i=>this.renderList(i),r.renderName=i=>this.renderId(i),r.renderField=i=>this.renderId(i,"field"),this.vm.$scopedSlots.container?e=[this.vm.$scopedSlots.container(r)]:e=r(),this.$manager.render(e)},renderList(e){return this.sort.map(r=>e?this.renderSlot(this.$handle.ctxs[r],e):this.renderCtx(this.$handle.ctxs[r])).filter(r=>r!==void 0)},makeVm(e){const r=e.vm;if(r){if(h.Function(r))return R(()=>e.vm(this.$handle.getInjectData(e)));if(!r._isVue)return new b(r)}else return new b;return r},mergeGlobal(e){const r=this.$handle.options.global;r&&(e.cacheConfig||(e.cacheConfig=r[e.originType]||r[e.type]||r[e.trueType]||{}),e.prop=q({},[r["*"],e.cacheConfig,e.prop]))},setOptions(e){e.prop.optionsTo&&e.prop.options&&Y(e.prop,e.prop.optionsTo,e.prop.options)},deepSet(e){const r=e.rule.deep;r&&Object.keys(r).sort((i,s)=>i.length<s.length?-1:1).forEach(i=>{Y(e.prop,i,r[i])})},setTempProps(e,r){if(!e.$props)return;const{prop:i}=r,s=Object.keys(e.$props),n=this.injectProp(r),o=Object.keys(n);s.forEach(u=>{O(i.props,u)?e.$props[u]=i.props[u]:o.indexOf(u)>-1&&(e.$props[u]=n[u])});const a=e.$options.model&&e.$options.model.prop||"value";s.indexOf(a)>-1&&(e.$props[a]=i.value)},renderTemp(e){if(!b.compile)return Pt("当前使用的Vue构建版本不支持compile,无法使用template功能"),[];const r=e.prop,{id:i,key:s}=e;if(!this.tempList[i]){e.el||(e.el=this.makeVm(r),this.vm.$nextTick(()=>e.parser.mounted(e)));let u=e.el;e.input&&u.$on(u.$options.model&&u.$options.model.event||"input",l=>{this.onInput(e,l)}),this.tempList[i]={vm:u,template:b.compile(r.template)}}const{vm:n,template:o}=this.tempList[i];this.setTempProps(n,e);const a=o.render.call(n);return h.Undef(a.data)&&(a.data={}),a.key=s,a.data.ref=e.ref,a.data.key=s,a},parseSide(e,r){return h.Object(e)?q({props:{formCreateInject:r.prop.props.formCreateInject}},e):e},renderSides(e,r,i){const s=r[i?"rule":"prop"];return[this.renderRule(this.parseSide(s.prefix,r)),e,this.renderRule(this.parseSide(s.suffix,r))]},renderSlot(e,r){return e.rule.slot===r?this.renderCtx(e):void 0},renderId(e,r){const i=this.$handle[r==="field"?"fieldCtx":"nameCtx"][e];return i?i.map(s=>this.renderCtx(s,s.parent)):void 0},renderCtx(e,r){if(e.type==="hidden")return;const i=e.rule;if(!this.cache[e.id]||this.cache[e.id].slot!==i.slot){let s,n=i.cache!==!1;const o=e.trueType,a=!(h.Undef(i.display)||i.display);if(o==="template"&&!i.template)s=this.renderSides(this.renderChildren(e),e,!0),a&&this.display(s),s=this.item(e,s);else if(o==="fcFragment")s=this.renderChildren(e);else{e.initProp(),this.mergeGlobal(e),this.$manager.tidyRule(e),this.deepSet(e),this.setOptions(e),this.ctxProp(e);let u=e.prop;u.preview=!!(O(u,"preview")?u.preview:this.options.preview),u.props.formCreateInject=this.injectProp(e);const l=u.preview;if(u.hidden){this.setCache(e,void 0,r);return}if(o==="template"&&u.template)s=this.renderTemp(e),n=!1;else{let c=[];e.parser.renderChildren?c=e.parser.renderChildren(e):e.parser.loadChildren!==!1&&(c=this.renderChildren(e));const m=this.getTypeSlot(e);m?s=m({rule:i,prop:u,preview:l,children:c,api:this.$handle.api,model:u.model||{}}):s=l?e.parser.preview(c,e):e.parser.render(c,e)}s=this.renderSides(s,e),!(!e.input&&h.Undef(u.native))&&u.native!==!0&&(s=this.$manager.makeWrap(e,s)),a&&(s=this.display(s)),s=this.item(e,s)}return n&&this.setCache(e,s,r),s}return this.getCache(e)},display(e){if(Array.isArray(e)){const r=[];return e.forEach(i=>{if(Array.isArray(i))return this.display(i);this.none(i)&&r.push(i)}),r}else return this.none(e)},none(e){if(e&&e.data)return Array.isArray(e.data.style)?e.data.style.push({display:"none"}):h.String(e.data.style)?e.data.style+=";display:none;":e.data.style=[e.data.style,{display:"none"}],e},item(e,r){return this.$h("fcFragment",{slot:e.rule.slot,key:e.key},[r])},injectProp(e){this.vm.ctxInject[e.id]||S(this.vm.ctxInject,e.id,{api:this.$handle.api,form:this.fc.create,subForm:i=>{this.$handle.addSubForm(e,i)},getSubForm:()=>this.$handle.subForm[e.id],options:[],children:[],prop:{},preview:!1,id:e.id,field:e.field,rule:e.rule,input:e.input});const r=this.vm.ctxInject[e.id];return p(r,{preview:e.prop.preview,options:e.prop.options,children:e.rule.children,prop:function(){const i=y({},e.prop);return i.on=i.on?y({},i.on):{},delete i.model,i}()}),r},ctxProp(e){const{ref:r,key:i,rule:s}=e;this.$manager.mergeProp(e),e.parser.mergeProp(e);const n=[{ref:r,key:s.key||`${i}fc`,slot:void 0,on:{"hook:mounted":()=>{this.onMounted(e)},"fc.sub-form":o=>{this.$handle.addSubForm(e,o)},"fc.el":o=>{e.exportEl=o,o&&((o.$el||o).__rule__=e.rule)}}}];return e.input&&(this.vm.$props.disabled===!0&&(e.prop.props.disabled=!0),e.prop.model={value:this.$handle.getFormData(e),callback:o=>{this.onInput(e,o)},expression:`formData.${e.id}`}),T(n,e.prop),e.prop},onMounted(e){e.el=this.vm.$refs[e.ref],e.el&&((e.el.$el||e.el).__rule__=e.rule),e.parser.mounted(e),this.$handle.effect(e,"mounted")},onInput(e,r){this.$handle.onInput(e,r)},renderChildren(e){const{children:r}=e.rule,i=this.orgChildren[e.id],s=n=>!h.String(n)&&n.__fc__&&!this.$handle.ctxs[n.__fc__.id];return!h.trueArray(r)&&i?(this.$handle.deferSyncValue(()=>{i.forEach(n=>{n&&s(n)&&this.$handle.rmCtx(n.__fc__)})}),this.orgChildren[e.id]=[],[]):(i&&this.$handle.deferSyncValue(()=>{i.forEach(n=>{n&&r.indexOf(n)===-1&&s(n)&&this.$handle.rmCtx(n.__fc__)})}),r.map(n=>{if(n){if(h.String(n))return n;if(n.__fc__)return this.renderCtx(n.__fc__,e);n.type&&this.vm.$nextTick(()=>{this.$handle.loadChildren(r,e),this.$handle.refresh()})}}))},defaultRender(e,r){const i=e.prop;return i.component?this.vNode.makeComponent(i.component,i,r):this.vNode[e.type]?this.vNode[e.type](i,r):this.vNode[e.originType]?this.vNode[e.originType](i,r):this.vNode.make(We(e.originType),i,r)},renderRule(e,r,i){if(!e)return;if(h.String(e))return e;let s;if(i)s=e.type;else if(s=e.is,e.type){s=V(e.type);const o=this.vNode.aliasMap[s];o&&(s=V(o))}if(!s)return;let n=[[r]];return h.trueArray(e.children)&&n.push(e.children.map(o=>this.renderRule(o))),this.$h(s,y({},e),n)}})}function pe(t){p(this,{$handle:t,fc:t.fc,vm:t.vm,$manager:t.$manager,vNode:new t.fc.CreateNode(t.vm)}),Le(this,{options(){return t.options},sort(){return t.sort}}),this.initCache(),this.initRender()}Ht(pe),Wt(pe);function xt(t){p(t.prototype,{parseInjectEvent(e,r){const i=e.inject||this.options.injectEvent;return this.parseEventLst(e,r,i)},parseEventLst(e,r,i,s){return Object.keys(r).forEach(n=>{const o=this.parseEvent(e,r[n],i,s);o&&(r[n]=o)}),r},parseEvent(e,r,i,s){if(h.Function(r)&&(i!==!1&&!h.Undef(i)||r.__inject))return this.inject(e,r,i);if(!s&&Array.isArray(r)&&r[0]&&(h.String(r[0])||h.Function(r[0])))return this.parseEventLst(e,r,i,!0);if(h.String(r)){const n=U(r);if(n&&r!==n)return n.__inject?this.parseEvent(e,n,i,!0):n}},parseEmit(e,r){let i={},s=e.rule,{emitPrefix:n,field:o,name:a,inject:u}=s,l=s[r?"emit":"nativeEmit"]||[];return h.trueArray(l)&&l.forEach(c=>{if(!c)return;let m,v=n||o||a;if(h.Object(c)&&(m=c.inject,c=c.name,v=c.prefix||v),v){r||(v=`native-${v}`);const k=Q(`${v}-${c}`),g=(...w)=>{this.vm.$emit(k,...w),this.vm.$emit("emit-event",k,...w)};if(g.__emit=!0,!m&&u===!1)i[c]=g;else{let w=m||u||this.options.injectEvent;i[c]=h.Undef(w)?g:this.inject(s,g,w)}}}),e.computed[r?"on":"nativeOn"]=i,i},getInjectData(e,r){const{option:i,rule:s}=this.vm.$options.propsData;return{api:this.api,$f:this.api,rule:s,self:e.__origin__,option:i,inject:r}},inject(e,r,i){if(r.__origin){if(this.watching&&!this.loading)return r;r=r.__origin}const s=this,n=function(...o){const a=s.getInjectData(e,i);return a.args=[...o],o.unshift(a),r.apply(this,o)};return n.__origin=r,n.__json=r.__json,n}})}const xe=["hook:updated","hook:mounted"];function Gt(t){p(t.prototype,{usePage(){const e=this.options.page;if(!e)return;let r=25,i=Kt(this.rules);h.Object(e)&&(e.first&&(r=parseInt(e.first,10)||r),e.limit&&(i=parseInt(e.limit,10)||i)),p(this,{first:r,limit:i,pageEnd:this.rules.length<=r}),this.bus.$on("page-end",()=>this.vm.$emit("page-end",this.api)),this.pageLoad()},pageLoad(){const e=()=>{this.pageEnd?(this.vm.$off(xe,e),this.bus.$emit("page-end")):(this.first+=this.limit,this.pageEnd=this.rules.length<=this.first,this.loadRule(),this.refresh())};this.vm.$on(xe,e)}})}function Kt(t){return t.length<31?31:Math.ceil(t.length/3)}function Xt(t){p(t.prototype,{clearNextTick(){this.nextTick&&clearTimeout(this.nextTick),this.nextTick=null},bindNextTick(e){this.clearNextTick(),this.nextTick=setTimeout(()=>{e(),this.nextTick=null},10)},render(){return++this.loadedId,this.vm.unique>0?this.$render.render():(this.vm.unique=1,[])}})}function Qt(t){Object.defineProperties(t.origin,{__fc__:De(t,!0)})}function Ge(t,e,r){const i=Z();p(this,{id:i,ref:i,wrapRef:i+"fi",rule:e,origin:e.__origin__||e,name:e.name,watch:[],linkOn:[],root:[],ctrlRule:[],parent:null,cacheConfig:null,prop:y({},e),computed:{},payload:{},input:!!e.field,el:void 0,exportEl:void 0,defaultValue:e.field?N(r):void 0,field:e.field||void 0}),this.updateKey(),Qt(this),this.update(t,!0)}p(Ge.prototype,{effectData(t){return this.payload[t]||(this.payload[t]={}),this.payload[t]},clearEffectData(t){t===void 0?this.payload={}:delete this.payload[t]},updateKey(t){this.key=Z(),t&&this.parent&&this.parent.updateKey(t)},updateType(){this.originType=this.rule.type,this.type=V(this.rule.type),this.trueType=this.$handle.getType(this.originType)},setParser(t){this.parser=t,t.init(this)},initProp(){const t=y({},this.rule);delete t.children,this.prop=q({},[t,...Object.keys(this.payload).map(e=>this.payload[e]),this.computed])},injectValidate(){return A(this.prop.validate).map(t=>{if(h.Function(t.validator)){const e=y({},t),r=this;return e.validator=function(...i){return t.validator.call({that:this,id:r.id,field:r.field,rule:r.rule,api:r.$handle.api},...i)},e}return t})},check(t){return this.vm===t.vm},unwatch(){this.watch.forEach(t=>t()),this.watch=[]},unlink(){this.linkOn.forEach(t=>t()),this.linkOn=[]},link(){this.unlink(),this.$handle.appendLink(this)},watchTo(){this.$handle.watchCtx(this)},delete(){this.unwatch(),this.unlink(),this.rmCtrl(),p(this,{deleted:!0,prop:y({},this.rule),computed:{},el:void 0,$handle:void 0,$render:void 0,$api:void 0,vm:void 0,vNode:void 0,parent:null,cacheConfig:null})},rmCtrl(){this.ctrlRule.forEach(t=>t.__fc__&&t.__fc__.rm()),this.ctrlRule=[]},rm(){const t=()=>{let e=this.root.indexOf(this.origin);e>-1&&(this.root.splice(e,1),this.$handle&&this.$handle.refresh())};if(this.deleted){t();return}this.$handle.noWatch(()=>{this.$handle.deferSyncValue(()=>{this.rmCtrl(),t(),this.$handle.rmCtx(this),p(this,{root:[]})},this.input)})},update(t,e){p(this,{deleted:!1,$handle:t,$render:t.$render,$api:t.api,vm:t.vm,vNode:t.$render.vNode,updated:!1,cacheValue:this.rule.value}),!e&&this.unwatch(),this.watchTo(),this.link(),this.updateType()}});function Zt(t){p(t.prototype,{nextRefresh(e){const r=this.loadedId;this.vm.$nextTick(()=>{r===this.loadedId&&(e?e():this.refresh())})},parseRule(e){const r=Be(e);return Object.defineProperties(r,{__origin__:De(e,!0)}),Yt(r),this.appendValue(r),r.options=Array.isArray(r.options)?r.options:[],[r,r.prefix,r.suffix].forEach(i=>{i&&this.loadFn(i,r)}),this.loadCtrl(r),r.update&&(r.update=U(r.update)),r},loadFn(e,r){["on","props","nativeOn","deep"].forEach(i=>{e[i]&&this.parseInjectEvent(r,e[i])})},loadCtrl(e){e.control&&e.control.forEach(r=>{r.handle&&(r.handle=U(r.handle))})},syncProp(e){const r=e.rule;h.trueArray(r.sync)&&T([{on:r.sync.reduce((i,s)=>(i[`update:${s}`]=n=>{r.props[s]=n,this.vm.$emit("sync",s,n,r,this.fapi)},i),{})}],e.computed)},loadRule(){this.cycleLoad=!1,this.loading=!0,this.pageEnd&&this.bus.$emit("load-start"),this.deferSyncValue(()=>{if(this._loadRule(this.rules),this.loading=!1,this.cycleLoad&&this.pageEnd)return this.loadRule();this.pageEnd&&this.bus.$emit("load-end"),this.vm._renderRule(),this.$render.initOrgChildren(),this.syncForm()})},loadChildren(e,r){if(this.cycleLoad=!1,this.loading=!0,this.bus.$emit("load-start"),this._loadRule(e,r),this.loading=!1,this.cycleLoad)return this.loadRule();this.bus.$emit("load-end"),this.syncForm(),this.$render.clearCache(r)},_loadRule(e,r){const i=n=>{let o=e[n-1];if(!o||!o.__fc__)return n>0?i(n-1):-1;let a=this.sort.indexOf(o.__fc__.id);return a>-1?a:i(n-1)},s=(n,o)=>{h.trueArray(n)&&this._loadRule(n,o)};e.map((n,o)=>{if(r&&!h.Object(n)||!this.pageEnd&&!r&&o>=this.first)return;if(n.__fc__&&n.__fc__.root===e&&this.ctxs[n.__fc__.id])return s(n.__fc__.rule.children,n.__fc__),n.__fc__;let a=Be(n);const u=()=>!!(a.field&&this.fieldCtx[a.field]&&this.fieldCtx[a.field][0]!==n.__fc__);this.ruleEffect(a,"init",{repeat:u()}),u()&&this.vm.$emit("repeat-field",n,this.api);let l,c=!1,m=!!n.__fc__,v=a.value;if(m){l=n.__fc__,v=l.defaultValue;const g=!l.check(this);if(l.deleted){if(g){if(Ke(l))return;l.update(this)}}else if(g){if(Ke(l))return;e[o]=n=n._clone?n._clone():ce(n),l=null,c=!0}}if(l)l.originType!==l.rule.type&&l.updateType(),this.bindParser(l),this.appendValue(l.rule);else{const g=this.parseRule(n);l=new Ge(this,g,v),this.bindParser(l)}if([!1,!0].forEach(g=>this.parseEmit(l,g)),this.syncProp(l),l.parent=r||null,l.root=e,this.setCtx(l),!c&&!m&&this.effect(l,"load"),this.effect(l,"created"),l.parser.loadChildren===!1||s(l.rule.children,l),!r){const g=i(o);g>-1||!o?this.sort.splice(g+1,0,l.id):this.sort.push(l.id)}const k=l.rule;return l.updated||(l.updated=!0,h.Function(k.update)&&this.bus.$once("load-end",()=>{this.refreshUpdate(l,k.value,"init")}),this.effect(l,"loaded")),l.input&&Object.defineProperty(k,"value",this.valueHandle(l)),this.refreshControl(l)&&(this.cycleLoad=!0),l})},refreshControl(e){return e.input&&e.rule.control&&this.useCtrl(e)},useCtrl(e){const r=er(e),i=[],s=this.api;if(!r.length)return!1;for(let a=0;a<r.length;a++){const u=r[a],l=u.handle||function(m){return(W[u.condition||"=="]||W["=="])(m,u.value)};if(!h.trueArray(u.rule))continue;const c=J(y({},u),{valid:R(()=>l(e.rule.value,s)),ctrl:tr(e,u.rule),isHidden:h.String(u.rule[0])});c.valid&&c.ctrl||!c.valid&&!c.ctrl&&!c.isHidden||i.push(c)}if(!i.length)return!1;const n=[];let o=!1;return this.deferSyncValue(()=>{i.reverse().forEach(({isHidden:a,valid:u,rule:l,prepend:c,append:m,child:v,ctrl:k,method:g})=>{if(a){u?e.ctrlRule.push({__ctrl:!0,children:l,valid:u}):k&&e.ctrlRule.splice(e.ctrlRule.indexOf(k)>>>0,1),n[u?"push":"unshift"](()=>{g==="disabled"||g==="enabled"?this.api.disabled(!u,l):g==="display"?this.api.display(u,l):g==="required"?(l.forEach(w=>{this.api.setEffect(w,"required",u)}),u||this.api.clearValidateState(l)):this.api.hidden(!u,l)});return}if(u){o=!0;const w={type:"fcFragment",native:!0,__ctrl:!0,children:l};e.ctrlRule.push(w),this.bus.$once("load-start",()=>{c?s.prepend(w,c,v):m||v?s.append(w,m||e.id,v):e.root.splice(e.root.indexOf(e.origin)+1,0,w)})}else{e.ctrlRule.splice(e.ctrlRule.indexOf(k),1);const w=K(k);w&&w.rm()}})}),n.length&&this.vm.$nextTick(()=>{n.forEach(a=>a())}),this.vm.$emit("control",e.origin,this.api),this.effect(e,"control"),o},reloadRule(e){return this._reloadRule(e)},_reloadRule(e){e||(e=this.rules);const r=y({},this.ctxs);this.clearNextTick(),this.$render.clearOrgChildren(),this.initData(e),this.fc.rules=e,this.deferSyncValue(()=>{this.bus.$once("load-end",()=>{Object.keys(r).filter(i=>this.ctxs[i]===void 0).forEach(i=>this.rmCtx(r[i])),this.$render.clearCacheAll()}),this.reloading=!0,this.loadRule(),this.reloading=!1,this.refresh(),this.vm.$emit("reloading",this.api)}),this.vm.$emit("update",this.api)},refresh(){this.vm._refresh()}})}function Yt(t){const e=Me();return Object.keys(e).forEach(r=>{O(t,r)||S(t,r,e[r])}),t}function er(t){const e=t.rule.control||[];return h.Object(e)?[e]:e}function tr(t,e){for(let r=0;r<t.ctrlRule.length;r++){const i=t.ctrlRule[r];if(i.children===e)return i}}function Ke(t){return!!t.rule.__ctrl}function rr(t){p(t.prototype,{getValue(e){return h.Undef(e.cacheValue)&&(e.cacheValue=e.parser.toValue(this.getFormData(e),e)),e.cacheValue},setValue(e,r,i,s){e.deleted||(e.cacheValue=r,this.changeStatus=!0,this.nextRefresh(),this.$render.clearCache(e),this.setFormData(e,i),this.syncValue(),this.valueChange(e,r),this.vm.$emit("change",e.field,r,e.origin,this.api,s||!1),this.effect(e,"value"),this.emitEvent("change",e.field,r,{rule:e.origin,api:this.api,setFlag:s||!1}))},onInput(e,r){let i;e.input&&(this.isQuote(e,i=e.parser.toValue(r,e))||this.isChange(e,i))&&this.setValue(e,i,r)},setFormData(e,r){S(this.formData,e.id,r===null?void 0:r)},getFormData(e){return this.formData[e.id]},validate(){return Qe(this.vm.validate),this.fields().forEach(e=>{this.fieldCtx[e].forEach(r=>{this.vm.validate[r.id]=A(r.rule.validate)})}),this.vm.validate},syncForm(){Qe(this.form),Object.defineProperties(this.form,this.fields().reduce((e,r)=>{const i=this.getFieldCtx(r),s=this.valueHandle(i);return s.configurable=!0,e[r]=s,e},this.options.appendValue!==!1?Object.keys(this.appendData).reduce((e,r)=>(e[r]={enumerable:!0,configurable:!0,get:()=>this.appendData[r],set:i=>{this.appendData[r]=i}},e),{}):{})),this.syncValue()},valueHandle(e){return{enumerable:!0,get:()=>this.getValue(e),set:r=>{this.isChange(e,r)&&this.setValue(e,r,e.parser.toFormValue(r,e),!0)}}},appendValue(e){!e.field||!O(this.appendData,e.field)||(e.value=this.appendData[e.field],delete this.appendData[e.field])},addSubForm(e,r){this.subForm[e.id]=r},deferSyncValue(e,r){this.deferSyncFn||(this.deferSyncFn=e),this.deferSyncFn.sync||(this.deferSyncFn.sync=r),R(e),this.deferSyncFn===e&&(this.deferSyncFn=null,e.sync&&this.syncValue())},syncValue(){if(this.deferSyncFn)return this.deferSyncFn.sync=!0;this.vm._updateValue(y(y({},this.options.appendValue!==!1?this.appendData:{}),this.form))},isChange(e,r){return JSON.stringify(e.rule.value,Xe)!==JSON.stringify(r===null?void 0:r,Xe)},isQuote(e,r){return(h.Object(r)||Array.isArray(r))&&r===e.rule.value},refreshUpdate(e,r,i,s){if(h.Function(e.rule.update)){const n=R(()=>e.rule.update(r,e.origin,this.api,{origin:i||"change",linkField:s}));if(n===void 0)return;e.rule.hidden=n===!0}},valueChange(e,r){this.refreshRule(e,r),this.bus.$emit("change-"+e.field,r)},refreshRule(e,r,i,s){this.refreshControl(e)&&(this.$render.clearCacheAll(),this.loadRule(),this.vm.$emit("update",this.api),this.refresh()),this.refreshUpdate(e,r,i,s)},appendLink(e){const r=e.rule.link;h.trueArray(r)&&r.forEach(i=>{const s=()=>this.refreshRule(e,e.rule.value,"link",i);this.bus.$on("change-"+i,s),e.linkOn.push(()=>this.bus.$off("change-"+i,s))})},fields(){return Object.keys(this.fieldCtx)}})}function Xe(t,e){return typeof e=="function"?""+e:e}function Qe(t){Object.keys(t).forEach(e=>delete t[e])}const me={init(t){},toFormValue(t,e){return t},toValue(t,e){return t},mounted(t){},render(t,e){return e.$render.defaultRender(e,t)},preview(t,e){return this.render(t,e)},mergeProp(t){}},ir=["field","value","vm","template","name","config","control","inject","sync","payload","optionsTo","update","component","cache"];function nr(t){p(t.prototype,{getCtx(e){return this.getFieldCtx(e)||this.getNameCtx(e)[0]||this.ctxs[e]},getCtxs(e){return this.fieldCtx[e]||this.nameCtx[e]||(this.ctxs[e]?[this.ctxs[e]]:[])},setIdCtx(e,r,i){const s=`${i}Ctx`;this[s][r]?this[s][r].push(e):this[s][r]=[e]},rmIdCtx(e,r,i){const s=`${i}Ctx`,n=this[s][r];if(!n)return!1;const o=n.splice(n.indexOf(e)>>>0,1).length>0;return n.length||delete this[s][r],o},getFieldCtx(e){return(this.fieldCtx[e]||[])[0]},getNameCtx(e){return this.nameCtx[e]||[]},setCtx(e){let{id:r,field:i,name:s,rule:n}=e;this.ctxs[r]=e,s&&this.setIdCtx(e,s,"name"),e.input&&(this.setIdCtx(e,i,"field"),this.setFormData(e,e.parser.toFormValue(n.value,e)),this.isMounted&&!this.reloading&&this.vm.$emit("change",e.field,n.value,e.origin,this.api))},getParser(e){const r=this.fc.parsers;return r[e.originType]||r[V(e.type)]||r[e.trueType]||me},bindParser(e){e.setParser(this.getParser(e))},getType(e){const r=this.fc.CreateNode.aliasMap,i=r[e]||r[V(e)]||e;return V(i)},noWatch(e){this.noWatchFn||(this.noWatchFn=e),R(e),this.noWatchFn===e&&(this.noWatchFn=null)},watchCtx(e){const r=this.vm;Object.keys(e.rule).filter(i=>i[0]!=="_"&&i[0]!=="$"&&ir.indexOf(i)===-1).forEach(i=>{const s=i==="children";e.watch.push(r.$watch(()=>e.rule[i],(n,o)=>{if(!(this.loading||this.noWatchFn||this.reloading)){if(s&&e.parser.loadChildren===!1){this.$render.clearCache(e),this.nextRefresh();return}if(this.watching=!0,i==="link"){e.link();return}else if(["props","on","nativeOn","deep"].indexOf(i)>-1)this.parseInjectEvent(e.rule,n||{}),i==="props"&&e.input&&this.setFormData(e,e.parser.toFormValue(e.rule.value,e));else if(["emit","nativeEmit"].indexOf(i)>-1)this.parseEmit(e,i==="emit");else if(["prefix","suffix"].indexOf(i)>-1)n&&this.loadFn(n,e.rule);else if(i==="type")e.updateType(),this.bindParser(e);else if(i==="children"){const a=h.trueArray(n);this.deferSyncValue(()=>{n!==o&&(this.rmSub(o,e),this.$render.initOrgChildren()),a&&this.loadChildren(n,e),this.vm.$emit("update",this.api)})}this.$render.clearCache(e),this.refresh(),this.watching=!1}},{deep:!s,sync:s}))}),this.watchEffect(e)},rmSub(e,r){h.trueArray(e)&&e.forEach(i=>{i&&i.__fc__&&i.__fc__.parent===r&&this.rmCtx(i.__fc__)})},rmCtx(e){if(e.deleted)return;const{id:r,field:i,input:s,name:n}=e;e.input&&Object.defineProperty(e.rule,"value",{value:e.rule.value,writable:!0}),L(this.ctxs,r),L(this.$render.tempList,r),L(this.$render.orgChildren,r),L(this.vm.ctxInject,r),L(this.formData,r),L(this.subForm,r),L(e,"cacheValue"),s&&this.rmIdCtx(e,i,"field"),n&&this.rmIdCtx(e,n,"name"),s&&!O(this.fieldCtx,i)&&L(this.form,i),this.deferSyncValue(()=>{this.reloading||(e.parser.loadChildren!==!1&&h.trueArray(e.rule.children)&&e.rule.children.forEach(a=>a.__fc__&&this.rmCtx(a.__fc__)),e.root===this.rules&&this.vm._renderRule())},s);const o=this.sort.indexOf(r);return o>-1&&this.sort.splice(o,1),this.$render.clearCache(e),e.delete(),this.effect(e,"deleted"),s&&!this.fieldCtx[i]&&this.vm.$emit("removeField",i,e.rule,this.api),e.rule.__ctrl||this.vm.$emit("removeRule",e.rule,this.api),e}})}function sr(t){p(t.prototype,{mounted(){const e=()=>{this.isMounted=!0,this.lifecycle("mounted")};this.pageEnd?e():this.bus.$once("page-end",e)},lifecycle(e){this.vm.$emit(e,this.api),this.emitEvent(e,this.api)},targetReload(){this.bus.$off("next-tick",this.nextReload),this.bus.$once("next-tick",this.nextReload)},emitEvent(e,...r){const i=this.options[e]||this.options[V("on-"+e)];if(i){const s=U(i);h.Function(s)&&R(()=>s(...r))}this.bus.$emit(e,...r)}})}function or(t){p(t.prototype,{useProvider(){const e=this.fc.providers;Object.keys(e).forEach(r=>{let i=e[r];h.Function(i)&&(i=i(this.fc)),i._c=lr(i),this.onEffect(i),this.providers[r]=i})},onEffect(e){const r=[];(e._c||["*"]).forEach(i=>{const s=i==="*"?"*":this.getType(i);r.indexOf(s)>-1||(r.push(s),this.bus.$on(`p:${e.name}:${s}:${e.input?1:0}`,(n,o)=>{e[n]&&e[n](...o)}))}),e._used=r},watchEffect(e){const r=this.vm;let i={required:()=>{var s,n;return(O(e.rule,"$required")?e.rule.$required:(n=(s=e.rule)==null?void 0:s.effect)==null?void 0:n.required)||!1}};Object.keys(e.rule.effect||{}).forEach(s=>{i[s]=()=>e.rule.effect[s]}),Object.keys(e.rule).forEach(s=>{s[0]==="$"&&(i[s.substr(1)]=()=>e.rule[s])}),Object.keys(i||{}).forEach(s=>{e.watch.push(r.$watch(i[s],n=>{this.effect(e,"watch",{[s]:n})},{deep:!0}))})},ruleEffect(e,r,i){this.emitEffect({rule:e,input:!!e.field,type:this.getType(e.type)},r,i)},effect(e,r,i){this.emitEffect({rule:e.rule,input:e.input,type:e.trueType,ctx:e,custom:i},r)},getEffect(e,r){if(O(e,"$"+r))return e["$"+r];if(O(e,"effect")&&O(e.effect,r))return e.effect[r]},emitEffect({ctx:e,rule:r,input:i,type:s,custom:n},o,a){if(!s||s==="fcFragment")return;const u=n||Object.keys(r).reduce((l,c)=>(c[0]==="$"&&(l[c.substr(1)]=r[c]),l),y({},r.effect||{}));Object.keys(u).forEach(l=>{const c=this.providers[l];if(!c||c.input&&!i)return;let m;if(!c._c)m="*";else if(c._used.indexOf(s)>-1)m=s;else return;const v=y({value:u[l],getValue:()=>this.getEffect(r,l)},a||{});e&&(v.getProp=()=>e.effectData(l),v.clearProp=()=>e.clearEffectData(l),v.mergeProp=k=>q(v.getProp(),[k]),v.id=e.id),this.bus.$emit(`p:${l}:${m}:${c.input?1:0}`,o,[v,r,this.api])})}})}function ar(t){return t.filter(function(e,r,i){return i.indexOf(e,0)===r})}function lr(t){const e=t.components;if(Array.isArray(e)){const r=ar(e.filter(i=>i!=="*"));return r.length?r:!1}else return h.String(e)?[e]:!1}function P(t){p(this,{fc:t,vm:t.vm,watching:!1,loading:!1,reloading:!1,noWatchFn:null,deferSyncFn:null,isMounted:!1,formData:{},subForm:{},form:{},appendData:{},providers:{},cycleLoad:null,loadedId:1,nextTick:null,changeStatus:!1,pageEnd:!0,nextReload:()=>{this.lifecycle("reload")}}),Le(this,{options(){return t.options},bus(){return t.bus}}),this.initData(t.rules),this.$manager=new t.manager(this),this.$render=new pe(this),this.api=t.extendApi(qt(this),this)}p(P.prototype,{initData(t){p(this,{ctxs:{},fieldCtx:{},nameCtx:{},sort:[],rules:t})},init(){this.appendData=y(y(y({},this.fc.options.formData||{}),this.vm.value||{}),this.appendData),this.useProvider(),this.usePage(),this.loadRule(),this.$manager.__init(),this.lifecycle("created"),this.vm.$set(this.vm,"formData",this.formData)},beforeFetch(t){return new Promise(e=>{const r=this.options.beforeFetch&&R(()=>this.options.beforeFetch(t,{api:this.api}));r&&h.Function(r.then)?r.then(e):e()})}}),xt(P),Gt(P),Xt(P),Zt(P),rr(P),nr(P),sr(P),or(P);const ye={name:"fcFragment",functional:!0,props:["vnode"],render(t,e){return e.props.vnode?e.props.vnode:e.children}};function ur(t){return h.String(t)?{domProps:{innerHTML:t}}:t}function fr(){const t={};function e(r){r&&this.setVm(r)}return p(e.prototype,{setVm(r){this.vm=r,this.$h=r.$createElement},make(r,i,s){return b.config.isReservedTag(r)&&i.nativeOn&&delete i.nativeOn,this.makeComponent(r,i,s)},makeComponent(r,i,s){let n=this.$h(r,ur(i),s||[]);return n.context=this.vm,n},aliasMap:t}),p(e,{aliasMap:t,alias(r,i){t[r]=i},use(r){Object.keys(r).forEach(i=>{const s=Q(i),n=Jt(i).toLocaleLowerCase(),o=r[i];[i,s,n].forEach(a=>{e.alias(i,o),e.prototype[a]=function(u,l){return this.make(o,u,l)}})})}}),e}function hr(t){class e extends Ze{}return Object.assign(e.prototype,t),e}function Ze(t){p(this,{$handle:t,vm:t.vm,options:{},ref:"fcForm",mergeOptionsRule:{normal:["form","row","info","submitBtn","resetBtn"]}}),this.updateKey(),this.init()}p(Ze.prototype,{__init(){this.$render=this.$handle.$render,this.$r=(...t)=>this.$render.renderRule(...t)},updateKey(){this.key=Z()},init(){},update(){},beforeRender(){},form(){return this.vm.$refs[this.ref]},getSlot(t){const e=r=>{if(r){let i=r.$scopedSlots[t];return i||e(r.$pfc)}};return e(this.vm)},mergeOptions(t,e){return T(t.map(r=>this.tidyOptions(r)),e,this.mergeOptionsRule)},updateOptions(t){this.options=this.mergeOptions([t],this.getDefaultOptions()),this.update()},tidyOptions(t){return t},tidyRule(t){},mergeProp(t){},getDefaultOptions(){return{}},render(t){}});const cr=function(t){const e={name:"loadData",_fn:[],created(r,i,s){this.deleted(r);let n=A(r.getValue());const o=[];n.forEach(a=>{if(a){const u=()=>{a.watch!==!1&&(t.bus.$off("p.loadData."+a.attr,u),t.bus.$once("p.loadData."+a.attr,u));let l;a.attr&&(l=t.loadData[a.attr]||a.default,a.copy!==!1&&(l=N(l))),Y(r.getProp(),a.to||"options",l),s.sync(i)};o.push(()=>t.bus.$off("p.loadData."+a.attr,u)),u()}}),this._fn[r.id]=o},deleted(r){this._fn[r.id]&&(this._fn[r.id].forEach(i=>{i()}),delete this._fn[r.id]),r.clearProp()}};return e.watch=e.created,e},Ye={name:"componentValidate",load(t,e,r){const i=t.getValue();i?t.getProp().validate=[{validator(...s){const n=K(e);if(n)return r.exec(n.id,i===!0?"formCreateValidate":i,...s,{attr:t,rule:e,api:r})}}]:(t.clearProp(),r.clearValidateState([e.field]))},watch(...t){Ye.load(...t)}},dr=function(t){function e(i){return h.String(i)&&(i={action:i,to:"options"}),i}function r(i,s,n){let o=i.value;const a=m=>{m===void 0?(i.clearProp(),n.sync(s)):Y(i.getProp(),o.to||"options",m)};if(h.Function(o)&&(o=o(s,n)),o=e(o),!o||!o.action){a(void 0);return}o=N(o),o.to||(o.to="options");const u=o.onError,l=()=>{if(!i.getValue())return i.clearProp(),n.sync(s),!0},c=J(y({headers:{}},o),{onSuccess(m,v){if(l())return;let k=g=>v?g:O(g,"data")?g.data:g;h.Function(o.parse)?k=o.parse:o.parse&&h.String(o.parse)&&(k=g=>(o.parse.split(".").forEach(w=>{g&&(g=g[w])}),g)),a(k(m,s,n)),n.sync(s)},onError(m){a(void 0),!l()&&(u||(v=>ue(v.message||"fetch fail "+o.action)))(m,s,n)}});t.$handle.beforeFetch(c,{rule:s,api:n}).then(()=>{if(h.Function(o.action)){o.action(s,n).then(m=>{c.onSuccess(m,!0)}).catch(m=>{c.onError(m)});return}R(()=>t.create.fetch(c,{inject:i,rule:s,api:n}))})}return{name:"fetch",loaded(...i){r(...i)},watch(...i){r(...i)}}},et={name:"required",load(t,e,r){const i=pr(t.getValue());if(i.required===!1)t.clearProp(),r.clearValidateState([e.field]);else{const s=y({required:!0,validator(n,o,a){h.empty(o)?a(s.message):a()}},i);if(!s.message){let n=e.title||"";s.message=((typeof n=="object"?n.title:n)||"")+"不能为空"}t.getProp().validate=[s]}r.sync(e)},watch(...t){et.load(...t)}};function pr(t){return h.Boolean(t)?{required:t}:h.String(t)?{message:t}:h.Undef(t)?{required:!1}:h.Function(t)?{validator:t}:h.Object(t)?t:{}}const mr={fetch:dr,loadData:cr,required:et,componentValidate:Ye},yr={name:"html",loadChildren:!1,render(t,e){return e.prop.domProps||(e.prop.domProps={}),e.prop.domProps.innerHTML=t,e.vNode.make(e.prop.props.tag||"div",e.prop)},renderChildren(t){return Array.isArray(t.rule.children)?t.rule.children.filter(e=>h.String(e)).join(""):""}};function gr(t,e){let r;return arguments.length===2?(r=arguments[1],e=r[t]):r=arguments[2],{id:e,prop:r}}function ge(){return gr("name",...arguments)}function tt(t){return!t||!t.el?window.document.body:h.Element(t.el)?t.el:document.querySelector(t.el)}function rt(t,e){const r=new b({data(){return{rule:t,option:e||{}}},render(i){return i("FormCreate",{ref:"fc",props:this.$data})}});return r.$mount(),r}function $r(t){const e=t.key||[],r=t.array||[],i=t.normal||[];Ie.push(...e),oe.push(...r),ae.push(...i),Ue([...e,...r,...i])}let vr=1;const I={};function it(t){const e={[ye.name]:ye},r={},i={},s=y({},mr),n=Nt();let o={global:{}};const a={},u=fr(),l={};$r(t.attrs||{});function c(f){const d=I[f];if(Array.isArray(d))return d.map($=>$.api());if(d)return d.api()}function m(){const f=ge(...arguments);f.id&&f.prop&&(i[f.id]=f.prop)}function v(){const f=ge(...arguments);f.id&&f.prop&&(s[f.id]=J(y({},f.prop),{name:f.id}))}function k(f){u.use(f)}function g(){const f=ge(...arguments);if(!f.id||!f.prop)return me;const d=V(f.id),$=f.prop,C=$.merge===!0?r[d]:void 0;r[d]=$,Object.setPrototypeOf($,C||me),n[d]=E(d),$.maker&&p(n,$.maker)}function w(f,d){let $;if(h.String(f)){if($=V(f),["form-create","formcreate"].indexOf($)>-1)return re();if(d===void 0)return e[$]}else $=V(f.name),d=f;if(!$||!d)return;const C=V($);e[$]=d,e[C]=d,delete u.aliasMap[$],delete u.aliasMap[C],delete r[$],delete r[C],d.formCreateParser&&g($,d.formCreateParser)}function lt(f){Object.keys(I).forEach(d=>{(Array.isArray(I[d])?I[d]:[I[d]]).forEach(C=>{C.bus.$emit("p.loadData."+f)})})}function ut(f,d){a[f]=d,lt(f)}function ft(f,d){return O(a,f)?a[f]:d}function Ur(f){delete a[f],lt(f)}function re(){return jt(ct,e,i)}function ht(){return ye}function qr(f,d){return h.Function(f.install)?f.install(H,d):h.Function(f)&&f(H,d),this}function H(f,d,$){let C=rt(f,d||{});const D=C.$refs.fc.formCreate;return D.$parent=$,tt(D.options).appendChild(C.$el),D.api()}Object.setPrototypeOf(H,l);function Hr(f){let d=y({},t);return f?d.inherit={components:e,parsers:r,directives:i,providers:s,maker:n,loadData:a}:delete d.inherit,it(d)}function ct(f){const d=f.$options.propsData.rule;p(this,{id:vr++,vm:f,create:H,manager:hr(t.manager),parsers:r,providers:s,rules:Array.isArray(d)?d:[],name:f.$options.propsData.name||Z(),inFor:f.$options.propsData.inFor,prop:{components:e,directives:i},setData:ut,getData:ft,loadData:a,CreateNode:u,bus:new b,unwatch:null,options:{},extendApi:t.extendApi||($=>$)}),this.init(),this.initOptions(),this.name&&(this.inFor?(I[this.name]||(I[this.name]=[]),I[this.name].push(this)):I[this.name]=this)}p(ct.prototype,{init(){const f=this.vm,d=new P(this);this.$handle=d,f.$f=d.api,f.$emit("input",d.api),f.$on("hook:created",()=>{this.isSub()&&(this.unwatch=f.$watch(()=>f.$pfc.option,()=>{this.initOptions(),f.$f.refresh()},{deep:!0}),this.initOptions()),this.created()}),f.$on("hook:mounted",()=>{this.mounted()}),f.$on("hook:beforeDestroy",()=>{if(f.destroyed=!0,this.unwatch&&this.unwatch(),d.reloadRule([]),this.name)if(this.inFor){const $=I[this.name].indexOf(this);I[this.name].splice($,1),I[this.name].length||delete I[this.name]}else delete I[this.name]}),f.$on("hook:updated",()=>{d.bindNextTick(()=>this.bus.$emit("next-tick",d.api))})},isSub(){return this.vm.$pfc&&this.vm.extendOption},initOptions(){this.options={};let f=y({formData:{},submitBtn:{},resetBtn:{}},N(o));this.isSub()&&this.mergeOptions(this.options,this.vm.$pfc.$f.config||{},!0),f=this.mergeOptions(f,this.vm.$options.propsData.option),this.updateOptions(f)},mergeOptions(f,d,$){return d=N(d),$&&["page","onSubmit","onReset","onCreated","onChange","onMounted","mounted","onReload","reload","formData","el"].forEach(C=>{delete d[C]}),d.global&&(f.global=Bt(f.global,d.global),delete d.global),this.$handle.$manager.mergeOptions([d],f),f},updateOptions(f){this.mergeOptions(this.options,f),this.$handle.$manager.updateOptions(this.options)},created(){this.$handle.init(),this.vm.$emit("created",this.api())},api(){return this.$handle.api},render(){return this.$handle.render()},mounted(){this.$handle.mounted()}});function dt(f){p(f,{version:t.version,ui:t.ui,setData:ut,getData:ft,removeData:Ur,maker:n,component:w,directive:m,register:v,$vnode:ht,parser:g,use:qr,factory:Hr,componentAlias:k,copyRule:ce,copyRules:Te,fetch:ze,$form:re,parseFn:U,parseJson:Tt,toJson:Ve,getApi:c,init(d,$={}){let C=rt(d,$),D=C.$refs.fc.formCreate;return{mount(x){return x&&h.Element(x)&&(D.options.el=x),tt(D.options).appendChild(C.$el),D.api()},remove(){C.$el.parentNode&&C.$el.parentNode.removeChild(C.$el)},destroy(){this.remove(),C.$destroy()},$f:D.api()}}})}function Jr(f){p(f,{create:H,install(d,$){if(o=y(y({},o),$||{}),d._installedFormCreate===!0)return;d._installedFormCreate=!0;const C=function(D,x={}){return H(D,x,this)};dt(C),d.prototype.$formCreate=C,d.component("FormCreate",re()),d.component("FcFragment",ht())}})}if(dt(l),Jr(l),u.use({fragment:"fcFragment"}),g(yr),t.install&&H.use(t),t.inherit){const f=t.inherit;f.components&&p(e,f.components),f.parsers&&p(r,f.parsers),f.directives&&p(i,f.directives),f.providers&&p(s,f.providers),f.maker&&p(n,f.maker),f.loadData&&p(a,f.loadData)}const ie=re();return Object.setPrototypeOf(ie,l),Object.defineProperties(ie,{fetch:{get(){return l.fetch},set(f){l.fetch=f}}}),ie.util=l,ie}function $e(t){if(h.Date(t))return t;{let e=new Date(t);return e.toString()==="Invalid Date"?t:e}}const nt="datePicker",br={name:nt,maker:function(){return["date","dateRange","datetime","datetimeRange","year","month"].reduce((t,e)=>(t[e]=E(nt,{type:e.toLowerCase()}),t),{})}(),mergeProp(t){let e=t.prop.props;e.startDate&&(e.startDate=e.startDate&&$e(e.startDate))},isRange(t){return t.type.includes("range")||t.multiple},_toValue(t,e){const r=e.el.formatDate(t||""),{separator:i}=e.el,s=this.isRange(e.el);return r?s?r.split(i):r:s?e.el.multiple?[]:["",""]:r},toValue(t,e){const r=e.el;return r?(this.el=r,this._toValue(t,e)):t},toFormValue(t,e){if(e.el){const r=e.el.parseDate(t);return this.isRange(e.el)?r:r[0]}else{let r=Array.isArray(t),i=e.prop.props,s,n=i.type||"date";return["daterange","datetimerange"].indexOf(n)!==-1?r?s=t.map(o=>o?$e(o):""):s=["",""]:n==="date"&&i.multiple===!0?s=toString(t):(s=r?t[0]||"":t,s=s?$e(s):""),s}},mounted(t){t.rule.value=this.toValue(t.$handle.getFormData(t),t)}},ve="hidden",Cr={name:ve,maker:{[ve]:(t,e)=>E(ve)("",t,e)},render(){return[]}},be="input",_r={name:be,maker:function(){const t=["password","url","email","text","textarea"].reduce((e,r)=>(e[r]=E(be,{type:r}),e),{});return t.idate=E(be,{type:"date"}),t}(),mergeProp(t){let{props:e}=t.prop;e.autosize&&e.autosize.minRows&&(e.rows=e.autosize.minRows||2)}},st="slider",Or={name:st,maker:{sliderRange:E(st,{range:!0})},toFormValue(t,e){let r=Array.isArray(t),i=e.prop.props,s=i.min||0,n;return i.range===!0?n=r?t:[s,parseFloat(t)||s]:n=r?parseFloat(t[0])||s:parseFloat(t),n}},kr=[br,Cr,_r,Or,{name:"switch",mergeProp(t){const e=t.prop.props.slot||{},r=t.prop.scopedSlots||{};e.open&&(r.open=()=>e.open),e.close&&(r.close=()=>e.close),t.prop.scopedSlots=r}},{name:"FcRow",render(t,e){return e.vNode.col({props:{span:24}},[e.vNode.row(e.prop,t)])}}],wr={button:"iButton",icon:"Icon",slider:"Slider",rate:"Rate",upload:"fcUpload",cascader:"Cascader",colorPicker:"ColorPicker",timePicker:"TimePicker",datePicker:"DatePicker",switch:"iSwitch",select:"fcSelect",checkbox:"fcCheckbox",radio:"fcRadio",inputNumber:"InputNumber",input:"iInput",formItem:"FormItem",form:"iForm",frame:"fcFrame",col:"iCol",row:"row",tree:"fcTree",autoComplete:"AutoComplete",group:"fcGroup",subForm:"fcSubForm",object:"fcSubForm"},ee={resetBtnType:"default",resetBtnIcon:"md-refresh",infoIcon:"ios-information-circle-outline"};function Fr(){return{type:"poptip",trigger:"hover",placement:"top-start",wordWrap:!0,icon:ee.infoIcon}}function Sr(){return{form:{inline:!1,labelPosition:"right",labelWidth:125,showMessage:!0,autocomplete:"off",size:void 0},row:{gutter:0},submitBtn:{type:"primary",disabled:!1,innerText:"提交",loading:!1,show:!0,click:void 0},resetBtn:{type:ee.resetBtnType,disabled:!1,icon:ee.resetBtnIcon,innerText:"重置",loading:!1,show:!1,click:void 0}}}function ot(t,e){O(t,e)&&h.String(t[e])&&(t[e]={[e]:t[e],show:!0})}function B(t){return t===!1}function Er(t,e){O(t,e)&&!h.Object(t[e])&&(t[e]={show:!!t[e]})}const Rr={validate(){const t=this.form();return t?new Promise((e,r)=>{t.validate().then(i=>{i?e(!0):r(!1)})}):new Promise(e=>e())},validateField(t){const e=this.form();return e?new Promise((r,i)=>{e.validateField(t,s=>{s?i(s):r(null)})}):new Promise(r=>r())},clearValidateState(t){const e=this.vm.$refs[t.wrapRef];e&&(e.validateMessage="",e.validateState="")},tidyOptions(t){return["submitBtn","resetBtn","row","info","wrap","col","title"].forEach(e=>{Er(t,e)}),t},tidyRule({prop:t}){return ot(t,"title"),ot(t,"info"),t},mergeProp(t){t.prop=T([{info:this.options.info||{},wrap:this.options.wrap||{},col:this.options.col||{},title:this.options.title||{}},t.prop],{info:Fr(),title:{},col:{span:24},wrap:{}},{normal:["title","info","col","wrap"]}),this.setSize(t.prop.props)},setSize(t){!t.size&&this.options.form.size&&(t.size=this.options.form.size)},getDefaultOptions(){return Sr()},update(){const t=this.options.form;this.rule={props:y({},t),nativeOn:{submit:e=>{e.preventDefault()}},class:[t.className,t.class,"form-create"],style:t.style,type:"form"}},beforeRender(){const{key:t,ref:e,$handle:r}=this;p(this.rule,{key:t,ref:e}),p(this.rule.props,{model:r.formData})},render(t){return t.length&&t.push(this.makeFormBtn()),this.$r(this.rule,B(this.options.row.show)?t:[this.makeRow(t)])},makeWrap(t,e){const r=t.prop,i=`${this.key}${t.key}`,s=r.col,n=this.isTitle(r),o=!s.labelWidth&&!n?0:s.labelWidth,{inline:a,col:u}=this.rule.props,l=B(r.wrap.show)?e:this.$r(T([r.wrap,{props:J(y({labelWidth:o},r.wrap||{}),{prop:t.id,rules:t.injectValidate()}),class:r.className,key:`${i}fi`,ref:t.wrapRef,type:"formItem"}]),[e,n?this.makeInfo(r,i,t):null]);return a===!0||B(u)||B(s.show)?l:this.makeCol(r,i,[l])},isTitle(t){if(this.options.form.title===!1)return!1;const e=t.title;return!(!e.title&&!e.native||B(e.show))},makeInfo(t,e,r){const i=t.title,s=t.info,n=this.getSlot("title"),o=[n?n({title:i.title||"",rule:r.rule,options:this.options}):i.title];if(!B(s.show)&&(s.info||s.native)&&!B(s.icon)){const a={type:s.type||"poptip",props:y({},s),key:`${e}pop`,slot:"label"},u="content";s.info&&!O(a.props,u)&&(a.props[u]=s.info),o[s.align!=="left"?"unshift":"push"](this.$r(T([s,a]),[this.$r({type:"icon",props:{type:s.icon===!0?ee.infoIcon:s.icon,size:16},style:"margin-top: -1px",key:`${e}i`})]))}return this.$r(T([i,{props:i,slot:i.slot||"label",key:`${e}tit`,type:i.type||"span"}]),o)},makeCol(t,e,r){const i=t.col;return this.$r({class:i.class,type:"col",props:i||{span:24},key:`${e}col`},r)},makeRow(t){const e=this.options.row||{};return this.$r({type:"row",props:e,class:e.class,key:`${this.key}row`},t)},makeFormBtn(){let t=[];if(B(this.options.submitBtn.show)||t.push(this.makeSubmitBtn()),B(this.options.resetBtn.show)||t.push(this.makeResetBtn()),!t.length)return;const e=this.$r({type:"formItem",key:`${this.key}fb`},t);return this.rule.props.inline===!0?e:this.$r({type:"col",props:{span:24},key:`${this.key}fc`},[e])},makeResetBtn(){const t=this.options.resetBtn;return this.setSize(t),this.$r({type:"button",props:t,style:{width:t.width,marginLeft:"15px"},on:{click:()=>{const e=this.$handle.api;t.click?t.click(e):e.resetFields()}},key:`${this.key}b2`},[t.innerText])},makeSubmitBtn(){const t=this.options.submitBtn;return this.setSize(t),this.$r({type:"button",props:t,style:{width:t.width},on:{click:()=>{const e=this.$handle.api;t.click?t.click(e):e.submit()}},key:`${this.key}b1`},[t.innerText])}},M={},Ir=["upload","select","tree","checkbox","autoComplete","cascader","colorPicker","frame","inputNumber","radio","rate","timePicker","group"];function jr(t){Ir.forEach(e=>{t[e]=E(e)}),t.auto=t.autoComplete,t.number=t.inputNumber,t.color=t.colorPicker}function Ar(t){const e="upload",r={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]};Object.keys(r).reduce((i,s)=>(i[s]=E(e,n=>n.props({uploadType:r[s][0],maxLength:r[s][1]})),i),t),t.uploadImage=t.image,t.uploadFile=t.file}function Vr(t){const e="tree",r={treeSelected:"selected",treeChecked:"checked"};Object.keys(r).reduce((i,s)=>(i[s]=E(e,{type:r[s]}),i),t)}function Pr(t){const e="timePicker";t.time=E(e,{type:"time"}),t.timeRange=E(e,{type:"timerange"})}function Dr(t){const e="select";t.selectMultiple=E(e,{multiple:!0}),t.selectOne=E(e,{multiple:!1})}function Tr(t){const e="frame",r={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]};Object.keys(r).reduce((i,s)=>(i[s]=E(e,n=>n.props({type:r[s][0],maxLength:r[s][1]})),i),t),t.frameInput=t.frameInputs,t.frameFile=t.frameFiles,t.frameImage=t.frameImages}jr(M),Ar(M),Vr(M),Dr(M),Tr(M),Pr(M);function at(t,e){return h.Boolean(t)?t={show:t}:!h.Undef(t)&&!h.Object(t)&&(t={show:e}),t}function Br(t,e){return p(t,{formEl(){return e.$manager.form()},wrapEl(r){const i=e.getFieldCtx(r);if(i)return e.vm.$refs[i.wrapRef]},validate(r){return new Promise((i,s)=>{const n=t.children,o=[e.$manager.validate()];n.forEach(a=>{o.push(a.validate())}),Promise.all(o).then(()=>{i(!0),r&&r(!0)}).catch(a=>{s(a),r&&r(a),e.vm.$emit("validate-fail",a,{api:t})})})},validateField:(r,i)=>new Promise((s,n)=>{const o=e.getFieldCtx(r);if(!o)return;const a=e.subForm[o.id],u=[e.$manager.validateField(o.id)];A(a).forEach(l=>{u.push(l.validate().catch(()=>Promise.reject("子表单验证未通过")))}),Promise.all(u).then(()=>{s(null),i&&i(null)}).catch(l=>{n(l),i&&i(l),e.vm.$emit("validate-field-fail",l,{field:r,api:t})})}),clearValidateState(r,i=!0){t.helper.tidyFields(r).forEach(s=>{i&&this.clearSubValidateState(s),e.getCtxs(s).forEach(n=>{e.$manager.clearValidateState(n)})})},clearSubValidateState(r){t.helper.tidyFields(r).forEach(i=>{e.getCtxs(i).forEach(s=>{const n=e.subForm[s.id];n&&(Array.isArray(n)?n.forEach(o=>{o.clearValidateState()}):n&&n.clearValidateState())})})},btn:{loading:(r=!0)=>{t.submitBtnProps({loading:!!r})},disabled:(r=!0)=>{t.submitBtnProps({disabled:!!r})},show:(r=!0)=>{t.submitBtnProps({show:!!r})}},resetBtn:{loading:(r=!0)=>{t.resetBtnProps({loading:!!r})},disabled:(r=!0)=>{t.resetBtnProps({disabled:!!r})},show:(r=!0)=>{t.resetBtnProps({show:!!r})}},submitBtnProps:(r={})=>{let i=at(e.options.submitBtn,!0);p(i,r),e.options.submitBtn=i,t.refreshOptions()},resetBtnProps:(r={})=>{let i=at(e.options.resetBtn,!1);p(i,r),e.options.resetBtn=i,t.refreshOptions()},submit(r,i){t.validate(s=>{if(s){let n=t.formData();h.Function(r)?R(()=>r(n,this)):(h.Function(e.options.onSubmit)&&R(()=>e.options.onSubmit(n,this)),e.vm.$emit("submit",n,this))}else h.Function(i)&&R(()=>i(this,...arguments))}).catch(s=>{})}}),t}function Lr(t){t.componentAlias(wr),It.forEach(e=>{t.component(e.name,e)}),kr.forEach(e=>{t.parser(e)}),Object.keys(M).forEach(e=>{t.maker[e]=M[e]})}function Nr(){return it({ui:"view-design",version:"2.6.2",manager:Rr,install:Lr,extendApi:Br,attrs:{normal:["col","wrap"],array:["className"],key:["title","info"]}})}const te=Nr();typeof window!="undefined"&&(window.formCreate=te,window.Vue&&te.install(window.Vue));const Mr=te.maker;F.default=te,F.maker=Mr,Object.defineProperties(F,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
12
+ err: ${s}`);return}}return t}function ut(t,e){return JSON.parse(t,function(r,i){return h.Undef(i)||!i.indexOf?i:K(i,e)})}let sr=0;function ye(){const t=370+ ++sr;return"F"+Math.random().toString(36).substr(3,3)+(+`${Date.now()}`).toString(36)+t.toString(36)+"c"}function Y(t,e,r){let i=t,s;return(e||"").split(".").forEach(n=>{s&&((!i[s]||typeof i[s]!="object")&&I(i,s,{}),i=i[s]),s=n}),I(i,s,r),i}function Te(t,e){return{value:t,enumerable:!1,configurable:!1,writable:!!e}}function ct(t,e){return ft([t],e||!1)[0]}function ft(t,e){return he([],[...t],e||!1)}function X(t,e){return z(Array.isArray(e)?e:[e],t,{array:Se,normal:Ee}),t}function ht(t){const e=h.Function(t.getRule)?t.getRule():t;return e.type||(e.type="input"),e}function or(t,e){return t?(Object.keys(e||{}).forEach(r=>{e[r]&&(t[r]=X(t[r]||{},e[r]))}),t):e}function dt(t,e){Object.defineProperties(t,Object.keys(e).reduce((r,i)=>(r[i]={get(){return e[i]()}},r),{}))}function oe(t){return t.__fc__||(t.__origin__?t.__origin__.__fc__:null)}function R(t,e){try{e=t()}catch(r){ir(r)}return e}function Be(t,e){let r=null;return h.Function(t)?r=t():Array.isArray(t)?r=t.map(i=>Be(i,e)):r=t,r&&e&&U(r).forEach(i=>{(Array.isArray(i)?i:[i]).forEach(n=>{n&&typeof n=="object"&&(n.data||(n.data={}),(!n.data.slot||n.data.slot==="default")&&(n.data.slot=e||"default"))})}),r}function ar(t,e){if(h.Object(t)){const r={};return Object.keys(t).forEach(i=>{r[i]=Be(t[i],i)}),r}else return Be(t,e)}function Le(){const t={},e=r=>r||"default";return{setSlot(r,i){r=e(r),!(!i||Array.isArray(i)&&i.length)&&(t[r]||(t[r]=[]),t[r].push(...Array.isArray(i)?i:[i]))},getSlot(r){r=e(r);const i=[];return(t[r]||[]).forEach(s=>{if(Array.isArray(s))i.push(...s);else if(h.Function(s)){const n=s();Array.isArray(n)?i.push(...n):i.push(n)}else h.Undef(s)||i.push(s)}),ar(i,r)},getSlots(){let r=[];return Object.keys(t).forEach(i=>{r=r.concat(this.getSlot(i)||[])}),r},slotLen(r){return r=e(r),t[r]?t[r].length:0},mergeBag(r){if(!r)return this;const i=h.Function(r.getSlots)?r.getSlots():r;return Array.isArray(r)||r.tag?this.setSlot(void 0,()=>r):Array.isArray(i)?this.setSlot(void 0,()=>i):Object.keys(i).forEach(s=>{this.setSlot(s,i[s])}),this}}}function $e(t,e){return Object.setPrototypeOf(t,e),t}const pt=(t,e)=>typeof t=="string"?String(e):typeof t=="number"?Number(e):e,ae={"==":(t,e)=>JSON.stringify(t)===JSON.stringify(pt(t,e)),"!=":(t,e)=>!ae["=="](t,e),">":(t,e)=>t>e,">=":(t,e)=>t>=e,"<":(t,e)=>t<e,"<=":(t,e)=>t<=e,on(t,e){return t&&t.indexOf&&t.indexOf(pt(t[0],e))>-1},notOn(t,e){return!ae.on(t,e)},in(t,e){return e&&e.indexOf&&e.indexOf(t)>-1},notIn(t,e){return!ae.in(t,e)},between(t,e){return t>e[0]&&t<e[1]},notBetween(t,e){return t<e[0]||t>e[1]},empty(t){return h.empty(t)},notEmpty(t){return!h.empty(t)},pattern(t,e){return new RegExp(e,"g").test(t)}};function G(t,e){return(Array.isArray(e)?e:(e||"").split(".")).forEach(r=>{t!=null&&(t=t[r])}),t}function lr(t){const e=/{{\s*(.*?)\s*}}/g;let r;const i={};for(;(r=e.exec(t))!==null;)r[1]&&(i[r[1]]=!0);return Object.keys(i)}function mt(){return{props:{},on:{},options:[],children:[],effect:{},hidden:!1,display:!0,value:void 0}}function P(t,e){return(r,i,s,n={})=>{const o=new Ve(t,r,i,s,n);return e&&(h.Function(e)?e(o):o.props(e)),o}}function Ve(t,e,r,i,s){this._data=b(mt(),{type:t,title:e,field:r,value:i,props:s||{}}),this.event=this.on}b(Ve.prototype,{getRule(){return this._data},setProp(t,e){return I(this._data,t,e),this},_clone(){const t=new this.constructor;return t._data=ct(this._data),t}});function gt(t){t.forEach(e=>{Ve.prototype[e]=function(r){return X(this._data,{[e]:arguments.length<2?r:{[r]:arguments[1]}}),this}})}gt(at());const yt=P("");function ur(t,e,r){let i=yt("",e);return i._data.type=t,i._data.title=r,i}function $t(t,e,r,i){let s=yt("",r);return s._data.type="template",s._data.template=t,s._data.title=i,s._data.vm=e,s}function cr(){return{create:ur,createTmp:$t,template:$t,factory:P}}function fr(t,e,r){const i=`fail to ${t} ${r.status}'`,s=new Error(i);return s.status=r.status,s.url=t,s}function vt(t){const e=t.responseText||t.response;if(!e)return e;try{return JSON.parse(e)}catch(r){return e}}function bt(t){if(typeof XMLHttpRequest=="undefined")return;const e=new XMLHttpRequest;let r=t.action||"";if(t.query){const n=new URLSearchParams(t.query).toString();r.includes("?")?r+=`&${n}`:r+=`?${n}`}e.onerror=function(o){t.onError(o)},e.onload=function(){if(e.status<200||e.status>=300)return t.onError(fr(r,t,e),vt(e));t.onSuccess(vt(e))},e.open(t.method||"get",r,!0);let i;t.data&&((t.dataType||"").toLowerCase()!=="json"?(i=new FormData,Object.keys(t.data).map(n=>{i.append(n,t.data[n])})):(i=JSON.stringify(t.data),e.setRequestHeader("content-type","application/json"))),t.withCredentials&&"withCredentials"in e&&(e.withCredentials=!0);const s=t.headers||{};Object.keys(s).forEach(n=>{s[n]!=null&&e.setRequestHeader(n,s[n])}),e.send(i)}function _t(t,e,r){return new Promise((i,s)=>{(e||bt)(J(_({},t),{onSuccess(n){let o=l=>l;const a=K(t.parse);h.Function(a)?o=a:a&&h.String(a)&&(o=l=>G(l,a)),i(o(n,void 0,r))},onError(n){s(n)}}))})}function pe(t){return q(t)}function hr(t){function e(n){return h.Undef(n)?n=t.fields():Array.isArray(n)||(n=[n]),n}function r(n,o,a){e(n).forEach(l=>{t.getCtxs(l).forEach(u=>{I(u.rule,o,a),t.$render.clearCache(u)})})}function i(){const n=t.subForm;return Object.keys(n).reduce((o,a)=>{const l=n[a];return l&&(Array.isArray(l)?o.push(...l):o.push(l)),o},[])}const s={get config(){return t.options},set config(n){t.fc.options.value=n},get options(){return t.options},set options(n){t.fc.options.value=n},get form(){return t.form},get rule(){return t.rules},get parent(){return t.vm.parent&&t.vm.parent.fapi},get top(){return s.parent?s.parent.top:s},get children(){return i()},get siblings(){const n=t.vm.getGroupInject();if(n){const o=n.getSubForm();if(Array.isArray(o))return[...o]}},get index(){const n=s.siblings;if(n){const o=n.indexOf(s);return o>-1?o:void 0}},formData(n){if(n==null){const o={};return Object.keys(t.form).forEach(a=>{t.ignoreFields.indexOf(a)===-1&&(o[a]=pe(t.form[a]))}),o}else return e(n).reduce((o,a)=>(o[a]=s.getValue(a),o),{})},getValue(n){const o=t.getFieldCtx(n);return o?pe(o.rule.value):t.options.appendValue!==!1&&S(t.appendData,n)?pe(t.appendData[n]):void 0},coverValue(n){const o=_({},n||{});t.deferSyncValue(()=>{t.appendData={},s.fields().forEach(a=>{const l=t.fieldCtx[a];if(l){const u=S(n,a);l.forEach(c=>{c.rule.value=u?n[a]:void 0}),delete o[a]}}),b(t.appendData,o)},!0)},setValue(n){let o=n;arguments.length>=2&&(o={[n]:arguments[1]}),t.deferSyncValue(()=>{Object.keys(o).forEach(a=>{const l=t.fieldCtx[a];if(!l)return t.appendData[a]=o[a];l.forEach(u=>{u.rule.value=o[a]})})},!0)},removeField(n){const o=t.getCtx(n);return t.deferSyncValue(()=>{t.getCtxs(n).forEach(a=>{a.rm()})},!0),o?o.origin:void 0},removeRule(n){const o=n&&oe(n);if(o)return o.rm(),o.origin},destroy:()=>{t.vm.$el.parentNode&&t.vm.$el.parentNode.removeChild(t.vm.$el),t.vm.$destroy()},fields:()=>t.fields(),append:(n,o,a)=>{let l=t.sort.length-1,u;const c=t.getCtx(o);if(c)if(a){if(u=c.getPending("children",c.rule.children),!Array.isArray(u))return;l=c.rule.children.length-1}else l=c.root.indexOf(c.origin),u=c.root;else u=t.rules;u.splice(l+1,0,n)},prepend:(n,o,a)=>{let l=0,u;const c=t.getCtx(o);if(c)if(a){if(u=c.getPending("children",c.rule.children),!Array.isArray(u))return}else l=c.root.indexOf(c.origin),u=c.root;else u=t.rules;u.splice(l,0,n)},hidden(n,o){r(o,"hidden",!!n),t.refresh()},hiddenStatus(n){const o=t.getCtx(n);if(o)return!!o.rule.hidden},display(n,o){r(o,"display",!!n),t.refresh()},displayStatus(n){const o=t.getCtx(n);if(o)return!!o.rule.display},disabled(n,o){e(o).forEach(a=>{t.getCtxs(a).forEach(l=>{I(l.rule.props,"disabled",!!n)})}),t.refresh()},all(n){return Object.keys(t.ctxs).map(o=>{const a=t.ctxs[o];return n?a.origin:a.rule})},model(n){return t.fields().reduce((o,a)=>{const l=t.fieldCtx[a][0];return o[a]=n?l.origin:l.rule,o},{})},component(n){return Object.keys(t.nameCtx).reduce((o,a)=>{const l=t.nameCtx[a].map(u=>n?u.origin:u.rule);return o[a]=l.length===1?l[0]:l,o},{})},bind(){return s.form},reload:n=>{t.reloadRule(n)},updateOptions(n){t.fc.updateOptions(n),s.refresh()},onSubmit(n){s.updateOptions({onSubmit:n})},sync:n=>{if(Array.isArray(n)){n.forEach(a=>s.sync(a));return}let o=h.Object(n)?oe(n):t.getCtxs(n);o&&(o=Array.isArray(o)?o:[o],o.forEach(a=>{if(!a.deleted){const l=t.subForm[a.id];l&&(Array.isArray(l)?l.forEach(u=>{u.refresh()}):l&&l.refresh()),t.$render.clearCache(a)}}),t.refresh())},refresh:()=>{i().forEach(n=>{n.refresh()}),t.$render.clearCacheAll(),t.refresh()},refreshOptions(){t.$manager.updateOptions(t.options),s.refresh()},hideForm:n=>{I(t.vm,"isShow",!n)},changeStatus:()=>t.changeStatus,clearChangeStatus:()=>{t.changeStatus=!1},updateRule(n,o){t.getCtxs(n).forEach(a=>{b(a.rule,o)})},updateRules(n){Object.keys(n).forEach(o=>{s.updateRule(o,n[o])})},mergeRule:(n,o)=>{t.getCtxs(n).forEach(a=>{X(a.rule,o)})},mergeRules(n){Object.keys(n).forEach(o=>{s.mergeRule(o,n[o])})},getRule:(n,o)=>{const a=t.getCtx(n);if(a)return o?a.origin:a.rule},getRenderRule:n=>{const o=t.getCtx(n);if(o)return o.prop},getRefRule:n=>{const o=t.getCtxs(n);if(o){const a=o.map(l=>l.rule);return a.length===1?a[0]:a}},setEffect(n,o,a){const l=t.getCtx(n);l&&o&&(o[0]==="$"&&(o=o.substr(1)),S(l.rule,"$"+o)&&I(l.rule,"$"+o,a),S(l.rule,"effect")||I(l.rule,"effect",{}),I(l.rule.effect,o,a))},clearEffectData(n,o){const a=t.getCtx(n);a&&(o&&o[0]==="$"&&(o=o.substr(1)),a.clearEffectData(o),s.sync(n))},updateValidate(n,o,a){a?s.mergeRule(n,{validate:o}):r(n,"validate",o)},updateValidates(n,o){Object.keys(n).forEach(a=>{s.updateValidate(a,n[a],o)})},refreshValidate(){s.refresh()},resetFields(n){e(n).forEach(o=>{t.getCtxs(o).forEach(a=>{t.$render.clearCache(a),a.rule.value=pe(a.defaultValue)})}),p.nextTick(()=>{s.clearValidateState()}),n==null&&(h.Function(t.options.onReset)&&R(()=>t.options.onReset(s)),t.vm.$emit("reset",s))},method(n,o){const a=s.el(n);if(!a||!a[o])throw new Error(lt("err",`${o} 方法不存在`));return(...l)=>a[o](...l)},exec(n,o,...a){return R(()=>s.method(n,o)(...a))},toJson(n){return Ie(s.rule,n)},trigger(n,o,...a){const l=s.el(n);l&&l.$emit(o,...a)},el(n){const o=t.getCtx(n);if(o)return o.exportEl||o.el||t.vm.$refs[o.ref]},closeModal:n=>{const o=s.el(n);o&&o.$emit&&o.$emit("close-modal")},getSubForm(n){const o=t.getCtx(n);return o?t.subForm[o.id]:void 0},getChildrenRuleList(n){const o=typeof n=="object",a=o?oe(n):t.getCtx(n),l=a?a.rule:o?n:s.getRule(n);if(!l)return[];const u=[];return(m=>{m&&m.forEach(g=>{typeof g=="object"&&(g.field&&u.push(g),u.push(...s.getChildrenRuleList(g)))})})(a?a.loadChildrenPending():l.children),u},getParentRule(n){return(typeof n=="object"?oe(n):t.getCtx(n)).parent.rule},getParentSubRule(n){const a=typeof n=="object"?oe(n):t.getCtx(n);if(a){const l=a.getParentGroup();if(l)return l.rule}},getChildrenFormData(n){return s.getChildrenRuleList(n).reduce((a,l)=>(a[l.field]=pe(l.value),a),{})},setChildrenFormData(n,o,a){const l=s.getChildrenRuleList(n);t.deferSyncValue(()=>{l.forEach(u=>{S(o,u.field)?u.value=o[u.field]:a&&(u.value=void 0)})})},getGlobalEvent(n){let o=s.options.globalEvent[n];if(o)return typeof o=="object"&&(o=o.handle),K(o)},getGlobalData(n){return new Promise((o,a)=>{let l=s.options.globalData[n];l||o(t.fc.loadData[n]),l.type==="fetch"?s.fetch(l).then(u=>{o(u)}).catch(a):o(l.data)})},nextTick(n){t.bus.$once("next-tick",n),t.refresh()},nextRefresh(n){t.nextRefresh(),n&&R(n)},emit(n,...o){t.vm.$emit(n,...o)},deferSyncValue(n,o){t.deferSyncValue(n,o)},bus:t.bus,fetch(n){return new Promise((o,a)=>{n=q(n),n=t.loadFetchVar(n),t.beforeFetch(n).then(()=>_t(n,t.fc.create.fetch,s).then(l=>{R(()=>n.onSuccess&&n.onSuccess(l)),o(l)}).catch(l=>{R(()=>n.onError&&n.onError(l)),a(l)}))})},watchFetch(n,o,a){return t.fc.watchLoadData((l,u)=>{let c=q(n);c=t.loadFetchVar(c,l),t.beforeFetch(c).then(()=>_t(c,t.fc.create.fetch,s).then(m=>{R(()=>c.onSuccess&&c.onSuccess(m)),o&&o(m,u)}).catch(m=>{R(()=>c.onError&&c.onError(m)),a&&a(m)}))})},getData(n,o){return t.fc.getLoadData(n,o)},setData(n,o,a){return t.fc.setData(n,o,a)},refreshData(n){return t.fc.refreshData(n)},t(n,o){return t.fc.t(n,o)},getLocale(){return t.fc.getLocale()},helper:{tidyFields:e,props:r}};return["on","once","off","set","emit"].forEach(n=>{s[n]=function(...o){t.vm[`$${n}`](...o)}}),s.changeValue=s.changeField=s.setValue,s}function dr(t){b(t.prototype,{initCache(){this.clearCacheAll()},clearCache(e){if(!e.rule.cache){if(!this.cache[e.id]){e.parent&&this.clearCache(e.parent);return}(this.cache[e.id].use===!0||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}},clearCacheAll(){this.cache={}},setCache(e,r,i){this.cache[e.id]={vnode:r,use:!1,parent:i,slot:e.rule.slot}},getCache(e){const r=this.cache[e.id];if(r)return r.use=!0,r.vnode}})}function H(t){const e=t.replace(/(-[a-z])/g,function(r){return r.replace("-","").toLocaleUpperCase()});return Ct(e)}function Ct(t){return t.replace(t[0],t[0].toLowerCase())}function pr(t){b(t.prototype,{initRender(){this.cacheConfig={}},getTypeSlot(e){const r=i=>{if(i){let s;return e.rule.field&&(s=i.$scopedSlots["field-"+de(e.rule.field)]||i.$scopedSlots["field-"+e.rule.field]),s||(s=i.$scopedSlots["type-"+de(e.type)]||i.$scopedSlots["type-"+e.type]),s||r(i.$pfc)}};return r(this.vm)},render(){if(!this.vm.isShow)return;this.$manager.beforeRender();const e=Le();return this.sort.forEach(r=>{this.renderSlot(e,this.$handle.ctxs[r])}),this.$manager.render(e)},renderSlot(e,r,i){this.isFragment(r)?(r.initProp(),this.mergeGlobal(r),r.initNone(),this.renderChildren(r.loadChildrenPending(),r,r.rule.slot).forEach(n=>{e.setSlot(r.rule.slot,n)})):e.setSlot(r.rule.slot,this.renderCtx(r,i))},mergeGlobal(e){this.$handle.options.global&&(this.cacheConfig[e.trueType]||(this.cacheConfig[e.trueType]=p.computed(()=>{const i=this.$handle.options.global;return X({},[i["*"],i[e.originType]||i[e.type]||i[e.type]||{}])})),e.prop=X({},[this.cacheConfig[e.trueType].value,e.prop]))},setOptions(e){const r=e.loadPending({key:"options",origin:e.prop.options,def:[]});e.prop.options=r,e.prop.optionsTo&&r&&Y(e.prop,e.prop.optionsTo,r)},deepSet(e){const r=e.rule.deep;r&&Object.keys(r).sort((i,s)=>i.length<s.length?-1:1).forEach(i=>{Y(e.prop,i,r[i])})},parseSide(e,r){return h.Object(e)?X({props:{formCreateInject:r.prop.props.formCreateInject}},e):e},renderSides(e,r,i){const s=r[i?"rule":"prop"];return[this.renderRule(this.parseSide(s.prefix,r)),e,this.renderRule(this.parseSide(s.suffix,r))]},renderId(e,r){const i=this.$handle[r==="field"?"fieldCtx":"nameCtx"][e];return i?i.map(s=>this.renderCtx(s,s.parent)):void 0},renderCtx(e,r){try{if(e.type==="hidden")return;const i=e.rule;if(!this.cache[e.id]||this.cache[e.id].slot!==i.slot){let s;e.initProp(),this.mergeGlobal(e),e.initNone(),this.$manager.tidyRule(e),this.deepSet(e),this.setOptions(e),this.ctxProp(e);let n=e.prop;n.preview=!!(n.preview!=null?n.preview:this.$handle.preview),n.props.formCreateInject=this.injectProp(e);let o=n.cache!==!1;const a=n.preview;if(n.hidden){this.setCache(e,void 0,r);return}s=(...l)=>{const u={rule:i,prop:n,preview:a,api:this.$handle.api,model:n.model||{},slotValue:l};l.length&&i.slotUpdate&&R(()=>i.slotUpdate(u));let c={};const m=e.loadChildrenPending();e.parser.renderChildren?c=e.parser.renderChildren(m,e):e.parser.loadChildren!==!1&&(c=this.renderChildren(m,e));const g=this.getTypeSlot(e);let v;return g?(u.children=c,v=g(u)):v=a?e.parser.preview(Fe(c),e):e.parser.render(Fe(c),e),v=this.renderSides(v,e),!(!e.input&&h.Undef(n.native))&&n.native!==!0&&(this.fc.targetFormDriver("updateWrap",e),v=this.$manager.makeWrap(e,v)),e.none&&(Array.isArray(v)?v=v.map(C=>!C||!C.tag?C:this.none(C)):v=this.none(v)),o&&this.setCache(e,()=>this.stable(v),r),v},this.setCache(e,s,r)}return(...s)=>{const n=this.getCache(e);if(n)return n(...s);if(this.cache[e.id])return;const o=this.renderCtx(e,e.parent);if(o)return o()}}catch(i){console.error(i);return}},none(e){if(e)return e.data.class=this.mergeClass(e.data.class,"fc-none"),e},mergeClass(e,r){if(Array.isArray(e))e.push(r);else return e?[e,r]:r;return e},stable(e){return(Array.isArray(e)?e:[e]).forEach(i=>{i&&i.tag&&i.children&&typeof i.children=="object"&&(i.children.$stable=!0,this.stable(i.children))}),e},getModelField(e){return e.prop.modelField||e.parser.modelField||this.fc.modelFields[this.vNode.aliasMap[e.type]]||this.fc.modelFields[e.type]||this.fc.modelFields[e.originType]||"value"},isFragment(e){return e.type==="fragment"||e.type==="template"},injectProp(e){const r=this.vm;r.ctxInject[e.id]||(r.ctxInject[e.id]={api:this.$handle.api,form:this.fc.create,subForm:s=>{this.$handle.addSubForm(e,s)},getSubForm:()=>this.$handle.subForm[e.id],slots:()=>this.vm.top.$scopedSlots,options:[],children:[],preview:!1,id:e.id,field:e.field,rule:e.rule,input:e.input,updateValue:s=>{this.$handle.onUpdateValue(e,s)}});const i=r.ctxInject[e.id];return b(i,{preview:e.prop.preview,options:e.prop.options,prop:function(){const s=_({},e.prop);return s.on=s.on?_({},s.on):{},delete s.model,s}(),children:e.loadChildrenPending()}),i},ctxProp(e){const{ref:r,key:i,rule:s}=e;this.$manager.mergeProp(e),e.parser.mergeProp(e);const n=[{ref:r,key:s.key||`${i}fc`,slot:void 0,on:{"hook:mounted":()=>{this.onMounted(e)},"fc.updateValue":o=>{this.$handle.onUpdateValue(e,o)},"fc.el":o=>{e.exportEl=o,o&&((o.$el||o).__rule__=e.rule)}}}];return e.input&&(this.vm.$props.disabled===!0&&(e.prop.props.disabled=!0),e.prop.model={value:this.$handle.getFormData(e),callback:o=>{this.onInput(e,o)},expression:`formData.${e.id}`},e.prop.modelEmit&&n.push({on:{[e.prop.modelEmit]:()=>this.onEmitInput(e)}})),z(n,e.prop),e.prop},onMounted(e){e.el=this.vm.$refs[e.ref],e.el&&((e.el.$el||e.el).__rule__=e.rule),e.parser.mounted(e),this.$handle.effect(e,"mounted"),this.$handle.targetHook(e,"mounted")},onInput(e,r){if(e.prop.modelEmit){this.$handle.onBaseInput(e,r);return}this.$handle.onInput(e,r)},onEmitInput(e){this.$handle.setValue(e,e.parser.toValue(e.modelValue,e),e.modelValue)},renderChildren(e,r,i){if(!h.trueArray(e))return[];const s=Le();return e.map(n=>{if(n){if(h.String(n))return s.setSlot(null,i?this.renderRule({type:"template",children:[n]}):n);if(n.__fc__)return this.renderSlot(s,n.__fc__,r);n.type&&p.nextTick(()=>{this.$handle.loadChildren(e,r),this.$handle.refresh()})}}),s.getSlots()},defaultRender(e,r){const i=e.prop;return i.component?typeof i.component=="string"?this.vNode.make(i.component,i,r):this.vNode.makeComponent(i.component,i,r):this.vNode[e.type]?this.vNode[e.type](i,r):this.vNode[e.originType]?this.vNode[e.originType](i,r):this.vNode.make(Ct(i.type),i,r)},renderRule(e,r,i){if(!e)return;if(h.String(e))return e;let s;if(i)s=e.type;else if(s=e.is,e.type){s=H(e.type);const a=this.vNode.aliasMap[s];a&&(s=H(a))}if(!s)return;const n=Le();h.trueArray(e.children)&&e.children.forEach(a=>{a&&n.setSlot(a==null?void 0:a.slot,()=>this.renderRule(a))});const o=_({},e);return delete o.type,delete o.is,this.vNode.make(s,o,n.mergeBag(r).getSlots())}})}let mr=1;function Ne(t){b(this,{$handle:t,fc:t.fc,vm:t.vm,$manager:t.$manager,vNode:new t.fc.CreateNode(t.vm),id:mr++}),dt(this,{options(){return t.options},sort(){return t.sort}}),this.initCache(),this.initRender()}dr(Ne),pr(Ne);function gr(t){b(t.prototype,{parseInjectEvent(e,r){const i=e.inject||this.options.injectEvent;return this.parseEventLst(e,r,i)},parseEventLst(e,r,i,s){return Object.keys(r).forEach(n=>{const o=this.parseEvent(e,r[n],i,s);o&&(r[n]=o)}),r},parseEvent(e,r,i,s){if(h.Function(r)&&(i!==!1&&!h.Undef(i)||r.__inject))return this.inject(e,r,i);if(!s&&Array.isArray(r)&&r[0]&&(h.String(r[0])||h.Function(r[0])))return this.parseEventLst(e,r,i,!0);if(h.String(r)){const n=K(r);if(n&&r!==n)return n.__inject?this.parseEvent(e,n,i,!0):n}},parseEmit(e,r){let i={},s=e.rule,{emitPrefix:n,field:o,name:a,inject:l}=s,u=s[r?"emit":"nativeEmit"]||[];return h.trueArray(u)&&u.forEach(c=>{if(!c)return;let m,g=n||o||a;if(h.Object(c)&&(m=c.inject,c=c.name,g=c.prefix||g),g){r||(g=`native-${g}`);const v=de(`${g}-${c}`),C=(...O)=>{this.vm.$emit(v,...O),this.vm.$emit("emit-event",v,...O),this.bus.$emit(v,...O)};if(C.__emit=!0,!m&&l===!1)i[c]=C;else{let O=m||l||this.options.injectEvent;i[c]=h.Undef(O)?C:this.inject(s,C,O)}}}),e.computed[r?"on":"nativeOn"]=i,i},getInjectData(e,r){const i=e.__fc__&&e.__fc__.$api,s=e.__fc__&&e.__fc__.$handle.vm||this.vm,{option:n,rule:o}=s.$props||s.$options.propsData;return{$f:i||this.api,api:i||this.api,rule:o,self:e.__origin__,option:n,inject:r}},inject(e,r,i){if(r.__origin){if(this.watching&&!this.loading)return r;r=r.__origin}const s=this,n=function(...o){const a=s.getInjectData(e,i);return a.args=[...o],o.unshift(a),r.apply(this,o)};return n.__origin=r,n.__json=r.__json,n},loadStrVar(e,r){if(e&&typeof e=="string"&&e.indexOf("{{")>-1&&e.indexOf("}}")>-1){const i=e,s=lr(e);let n;if(s.forEach(o=>{const a=o.split("||"),l=a[0].trim();if(l){const u=(a[1]||"").trim(),c=r?r(l,u):this.fc.getLoadData(l,u);n=c,e=e.replaceAll(`{{${o}}}`,c==null?"":c)}}),s.length===1&&i===`{{${s[0]}}}`)return n}return e},loadFetchVar(e,r){const i=s=>this.loadStrVar(s,r);if(e.action=i(e.action),e.headers){const s={};Object.keys(e.headers).forEach(n=>{s[i(n)]=i(e.headers[n])}),e.headers=s}if(e.data){const s={};Object.keys(e.data).forEach(n=>{s[i(n)]=i(e.data[n])}),e.data=s}return e}})}const wt=["hook:updated","hook:mounted"];function yr(t){b(t.prototype,{usePage(){const e=this.options.page;if(!e)return;let r=25,i=$r(this.rules);h.Object(e)&&(e.first&&(r=parseInt(e.first,10)||r),e.limit&&(i=parseInt(e.limit,10)||i)),b(this,{first:r,limit:i,pageEnd:this.rules.length<=r}),this.bus.$on("page-end",()=>this.vm.$emit("page-end",this.api)),this.pageLoad()},pageLoad(){const e=()=>{this.pageEnd?(this.vm.$off(wt,e),this.bus.$emit("page-end")):(this.first+=this.limit,this.pageEnd=this.rules.length<=this.first,this.loadRule(),this.refresh())};this.vm.$on(wt,e)}})}function $r(t){return t.length<31?31:Math.ceil(t.length/3)}function vr(t){b(t.prototype,{clearNextTick(){this.nextTick&&clearTimeout(this.nextTick),this.nextTick=null},bindNextTick(e){this.clearNextTick(),this.nextTick=setTimeout(()=>{e(),this.nextTick=null},10)},render(){return++this.loadedId,this.vm.unique>0?this.$render.render():(this.vm.unique=1,[])}})}function br(t){Object.defineProperties(t.origin,{__fc__:Te(p.markRaw(t),!0)}),t.rule!==t.origin&&Object.defineProperties(t.rule,{__fc__:Te(p.markRaw(t),!0)})}function Ot(t,e,r){const i=ye(),s=!!e.field;b(this,{id:i,ref:i,wrapRef:i+"fi",rule:e,origin:e.__origin__||e,name:e.name,pending:{},none:!1,watch:[],linkOn:[],root:[],ctrlRule:[],children:[],parent:null,group:e.subRule?this:null,cacheConfig:null,prop:_({},e),computed:{},payload:{},refRule:{},input:s,el:void 0,exportEl:void 0,defaultValue:s?q(r):void 0,field:e.field||void 0}),this.updateKey(),br(this),this.update(t,!0)}b(Ot.prototype,{getParentGroup(){let t=this.parent;for(;t;){if(t.group)return t;t=t.parent}},loadChildrenPending(){const t=this.rule.children||[];return Array.isArray(t)?t:this.loadPending({key:"children",origin:t,def:[],onLoad:e=>{this.$handle&&this.$handle.loadChildren(e,this)},onUpdate:(e,r)=>{this.$handle&&(e===r?this.$handle.loadChildren(e,this):this.$handle.updateChildren(this,e,r))},onReload:e=>{this.$handle?this.$handle.updateChildren(this,[],e):delete this.pending.children}})},loadPending(t){const{key:e,origin:r,def:i,onLoad:s,onReload:n,onUpdate:o}=t;if(this.pending[e]&&this.pending[e].origin===r)return this.getPending(e,i);delete this.pending[e];let a=r;if(h.Function(r)){let l=R(()=>r({rule:this.rule,api:this.$api,update:u=>{const c=u||i,m=this.getPending(e,i);this.setPending(e,r,c),o&&o(c,m)},reload:()=>{const u=this.getPending(e,i);delete this.pending[e],n&&n(u),this.$api&&this.$api.sync(this.rule)}}));l&&h.Function(l.then)?(l.then(u=>{const c=u||i;this.setPending(e,r,c),s&&s(c),this.$api&&this.$api.sync(this.rule)}).catch(u=>{console.error(u)}),a=i,this.setPending(e,r,a)):(a=l||i,this.setPending(e,r,a),s&&s(a))}return a},getPending(t,e){return this.pending[t]&&this.pending[t].value||e},setPending(t,e,r){this.pending[t]={origin:e,value:p.reactive(r)}},effectData(t){return this.payload[t]||(this.payload[t]={}),this.payload[t]},clearEffectData(t){t===void 0?this.payload={}:delete this.payload[t]},updateKey(t){this.key=ye(),t&&this.parent&&this.parent.updateKey(t)},updateType(){this.originType=this.rule.type,this.type=H(this.rule.type),this.trueType=this.$handle.getType(this.originType)},setParser(t){this.parser=t,t.init(this)},initProp(){const t=_({},this.rule);delete t.children,delete t.validate,this.prop=X({},[t,...Object.keys(this.payload).map(e=>this.payload[e]),this.computed]),this.prop.validate=[...this.refRule.__$validate.value||[],...this.prop.validate||[]]},initNone(){this.none=!(h.Undef(this.prop.display)||this.prop.display)},injectValidate(){return this.prop.validate},check(t){return this.vm===t.vm},unwatch(){this.watch.forEach(t=>t()),this.watch=[],this.refRule={}},unlink(){this.linkOn.forEach(t=>t()),this.linkOn=[]},link(){this.unlink(),this.$handle.appendLink(this)},watchTo(){this.$handle.watchCtx(this)},delete(){this.unwatch(),this.unlink(),this.rmCtrl(),this.parent&&this.parent.children.splice(this.parent.children.indexOf(this)>>>0,1),b(this,{deleted:!0,computed:{},parent:null,children:[],cacheConfig:null,none:!1})},rmCtrl(){this.ctrlRule.forEach(t=>t.__fc__&&t.__fc__.rm()),this.ctrlRule=[]},rm(){const t=()=>{let e=this.root.indexOf(this.origin);e>-1&&(this.root.splice(e,1),this.$handle&&this.$handle.refresh())};if(this.deleted){t();return}this.$handle.noWatch(()=>{this.$handle.deferSyncValue(()=>{this.rmCtrl(),t(),this.$handle.rmCtx(this),b(this,{root:[]})},this.input)})},update(t,e){b(this,{deleted:!1,$handle:t,$render:t.$render,$api:t.api,vm:t.vm,vNode:t.$render.vNode,updated:!1,cacheValue:this.rule.value}),!e&&this.unwatch(),this.watchTo(),this.link(),this.updateType()}});function _r(t){b(t.prototype,{nextRefresh(e){const r=this.loadedId;p.nextTick(()=>{r===this.loadedId&&(e?e():this.refresh())})},parseRule(e){const r=ht(e);return Object.defineProperties(r,{__origin__:Te(e,!0)}),Cr(r),this.appendValue(r),[r,r.prefix,r.suffix].forEach(i=>{i&&this.loadFn(i,r)}),this.loadCtrl(r),r.update&&(r.update=K(r.update)),r},loadFn(e,r){["on","props","nativeOn","deep"].forEach(i=>{e[i]&&this.parseInjectEvent(r,e[i])})},loadCtrl(e){e.control&&e.control.forEach(r=>{r.handle&&(r.handle=K(r.handle))})},syncProp(e){const r=e.rule;h.trueArray(r.sync)&&z([{on:r.sync.reduce((i,s)=>(i[`update:${s}`]=n=>{r.props[s]=n,this.vm.$emit("sync",s,n,r,this.fapi)},i),{})}],e.computed)},loadRule(){this.cycleLoad=!1,this.loading=!0,this.pageEnd&&this.bus.$emit("load-start"),this.deferSyncValue(()=>{if(this._loadRule(this.rules),this.loading=!1,this.cycleLoad&&this.pageEnd)return this.loadRule();this.syncForm(),this.pageEnd&&this.bus.$emit("load-end"),this.vm.renderRule()})},loadChildren(e,r){if(this.cycleLoad=!1,this.loading=!0,this.bus.$emit("load-start"),this._loadRule(e,r),this.loading=!1,this.cycleLoad)return this.loadRule();this.syncForm(),this.bus.$emit("load-end"),this.$render.clearCache(r)},_loadRule(e,r){const i=o=>{let a=e[o-1];if(!a||!a.__fc__)return o>0?i(o-1):-1;let l=this.sort.indexOf(a.__fc__.id);return l>-1?l:i(o-1)},s=(o,a)=>{h.trueArray(o)&&this._loadRule(o,a)},n=e.map((o,a)=>{if(r&&!h.Object(o)||!this.pageEnd&&!r&&a>=this.first)return;if(o.__fc__&&o.__fc__.root===e&&this.ctxs[o.__fc__.id])return s(o.__fc__.loadChildrenPending(),o.__fc__),o.__fc__;let l=ht(o);const u=()=>!!(l.field&&this.fieldCtx[l.field]&&this.fieldCtx[l.field][0]!==o.__fc__);this.fc.targetFormDriver("loadRule",{rule:l,api:this.api},this.fc),this.ruleEffect(l,"init",{repeat:u()}),u()&&this.vm.$emit("repeat-field",o,this.api);let c,m=!1,g=!!o.__fc__,v=l.value;if(g){if(c=o.__fc__,v=c.defaultValue,c.deleted){if(kt(c))return;c.update(this)}else if(!c.check(this)){if(kt(c))return;e[a]=o=o._clone?o._clone():ut(Ie(o)),c=null,m=!0}}if(c)c.originType!==c.rule.type&&c.updateType(),this.bindParser(c),this.appendValue(c.rule),c.parent&&c.parent!==r&&this.rmSubRuleData(c);else{const j=this.parseRule(o);c=new Ot(this,j,v),this.bindParser(c)}[!1,!0].forEach(j=>this.parseEmit(c,j)),this.syncProp(c),c.parent=r||null,c.root=e,this.setCtx(c),!m&&!g&&(this.effect(c,"load"),this.targetHook(c,"load")),this.effect(c,"created");const C=c.loadChildrenPending();if(c.parser.loadChildren===!1||s(C,c),!r){const j=i(a);j>-1||!a?this.sort.splice(j+1,0,c.id):this.sort.push(c.id)}const O=c.rule;return c.updated||(c.updated=!0,h.Function(O.update)&&this.bus.$once("load-end",()=>{this.refreshUpdate(c,O.value,"init")}),this.effect(c,"loaded")),this.refreshControl(c)&&(this.cycleLoad=!0),c}).filter(o=>!!o);r&&(r.children=n)},refreshControl(e){return e.input&&e.rule.control&&this.useCtrl(e)},useCtrl(e){const r=wr(e),i=[],s=this.api;if(!r.length)return!1;for(let a=0;a<r.length;a++){const l=r[a],u=l.handle||function(m){return(ae[l.condition||"=="]||ae["=="])(m,l.value)};if(!h.trueArray(l.rule))continue;const c=J(_({},l),{valid:R(()=>u(e.rule.value,s)),ctrl:Or(e,l.rule),isHidden:h.String(l.rule[0])});c.valid&&c.ctrl||!c.valid&&!c.ctrl&&!c.isHidden||i.push(c)}if(!i.length)return!1;const n=[];let o=!1;return this.deferSyncValue(()=>{i.reverse().forEach(({isHidden:a,valid:l,rule:u,prepend:c,append:m,child:g,ctrl:v,method:C})=>{if(a){l?e.ctrlRule.push({__ctrl:!0,children:u,valid:l}):v&&e.ctrlRule.splice(e.ctrlRule.indexOf(v)>>>0,1),n[l?"push":"unshift"](()=>{C==="disabled"||C==="enabled"?this.api.disabled(!l,u):C==="display"?this.api.display(l,u):C==="required"?(u.forEach(O=>{this.api.setEffect(O,"required",l)}),l||this.api.clearValidateState(u)):this.api.hidden(!l,u)});return}if(l){o=!0;const O={type:"fragment",native:!0,__ctrl:!0,children:u};e.ctrlRule.push(O),this.bus.$once("load-start",()=>{c?s.prepend(O,c,g):m||g?s.append(O,m||e.id,g):e.root.splice(e.root.indexOf(e.origin)+1,0,O)})}else{e.ctrlRule.splice(e.ctrlRule.indexOf(v),1);const O=oe(v);O&&O.rm()}})}),n.length&&(this.loading?n.length&&this.bus.$once("load-end",()=>{n.forEach(a=>a())}):n.length&&p.nextTick(()=>{n.forEach(a=>a())})),this.vm.$emit("control",e.origin,this.api),this.effect(e,"control"),o},reloadRule(e){return this._reloadRule(e)},_reloadRule(e){e||(e=this.rules);const r=_({},this.ctxs);this.clearNextTick(),this.initData(e),this.fc.rules=e,this.deferSyncValue(()=>{this.bus.$once("load-end",()=>{Object.keys(r).filter(i=>this.ctxs[i]===void 0).forEach(i=>this.rmCtx(r[i])),this.$render.clearCacheAll()}),this.reloading=!0,this.loadRule(),this.reloading=!1,this.refresh(),this.vm.$emit("reloading",this.api)}),this.vm.$emit("update",this.api),this.bus.$off("next-tick",this.nextReload),this.bus.$once("next-tick",this.nextReload)},refresh(){this.vm.refresh()}})}function Cr(t){const e=mt();return Object.keys(e).forEach(r=>{S(t,r)||I(t,r,e[r])}),t}function wr(t){const e=t.rule.control||[];return h.Object(e)?[e]:e}function Or(t,e){for(let r=0;r<t.ctrlRule.length;r++){const i=t.ctrlRule[r];if(i.children===e)return i}}function kt(t){return!!t.rule.__ctrl}function kr(t){b(t.prototype,{setValue(e,r,i,s){e.deleted||(e.rule.value=r,this.changeStatus=!0,this.nextRefresh(),this.$render.clearCache(e),this.setFormData(e,i),this.syncValue(),this.valueChange(e,r),this.vm.$emit("change",e.field,r,e.origin,this.api,s||!1),this.effect(e,"value"),this.targetHook(e,"value",{value:r}),this.emitEvent("change",e.field,r,{rule:e.origin,api:this.api,setFlag:s||!1}))},onInput(e,r){let i;e.input&&(this.isQuote(e,i=e.parser.toValue(r,e))||this.isChange(e,r))&&this.setValue(e,i,r)},onUpdateValue(e,r){this.deferSyncValue(()=>{const i=e.getParentGroup(),s=i?this.subRuleData[i.id]:null,n={};Object.keys(r||{}).forEach(o=>{s&&S(s,o)?n[o]=r[o]:S(this.api.form,o)?this.api.form[o]=r[o]:this.api.top!==this.api&&S(this.api.top.form,o)&&(this.api.top.form[o]=r[o])}),Object.keys(n).length&&this.api.setChildrenFormData(i.rule,n)})},onBaseInput(e,r){this.setFormData(e,r),e.modelValue=r,this.nextRefresh(),this.$render.clearCache(e)},setFormData(e,r){e.modelValue=r;const i=e.getParentGroup();i&&(this.subRuleData[i.id]||(this.subRuleData[i.id]={}),this.subRuleData[i.id][e.field]=e.rule.value),I(this.formData,e.id,r)},rmSubRuleData(e){const r=e.getParentGroup();r&&this.subRuleData[r.id]&&delete this.subRuleData[r.id][e.field]},getFormData(e){return this.formData[e.id]},syncForm(){const e={},r=this.fields(),i=[];this.options.appendValue!==!1&&Object.keys(this.appendData).reduce((s,n)=>(r.indexOf(n)===-1&&(s[n]=p.toRef(this.appendData,n)),s),e),r.reduce((s,n)=>{const o=(this.fieldCtx[n]||[]).filter(a=>!this.isIgnore(a.rule))[0]||this.fieldCtx[n][0];return this.isIgnore(o.rule)&&i.push(n),s[n]=p.toRef(o.rule,"value"),s},e),this.form=p.reactive(e),this.ignoreFields=i,this.syncValue()},isIgnore(e){return e.ignore===!0||e.ignore==="hidden"&&e.hidden||this.options.ignoreHiddenFields&&e.hidden},appendValue(e){(!e.field||!S(this.appendData,e.field))&&!this.options.forceCoverValue||(e.value=this.appendData[e.field],delete this.appendData[e.field])},addSubForm(e,r){this.subForm[e.id]=r},deferSyncValue(e,r){this.deferSyncFn||(this.deferSyncFn=e),this.deferSyncFn.sync||(this.deferSyncFn.sync=r),R(e),this.deferSyncFn===e&&(this.deferSyncFn=null,e.sync&&this.syncForm())},syncValue(){if(this.deferSyncFn)return this.deferSyncFn.sync=!0;const e={};Object.keys(this.form).forEach(r=>{this.ignoreFields.indexOf(r)===-1&&(e[r]=this.form[r])}),this.vm.updateValue(e)},isChange(e,r){return JSON.stringify(this.getFormData(e),Rt)!==JSON.stringify(r,Rt)},isQuote(e,r){return(h.Object(r)||Array.isArray(r))&&r===e.rule.value},refreshUpdate(e,r,i,s){if(h.Function(e.rule.update)){const n=R(()=>e.rule.update(r,e.origin,this.api,{origin:i||"change",linkField:s}));if(n===void 0)return;e.rule.hidden=n===!0}},valueChange(e,r){this.refreshRule(e,r),this.bus.$emit("change-"+e.field,r)},refreshRule(e,r,i,s){this.refreshControl(e)&&(this.$render.clearCacheAll(),this.loadRule(),this.vm.$emit("update",this.api),this.refresh()),this.refreshUpdate(e,r,i,s)},appendLink(e){const r=e.rule.link;h.trueArray(r)&&r.forEach(i=>{const s=()=>this.refreshRule(e,e.rule.value,"link",i);this.bus.$on("change-"+i,s),e.linkOn.push(()=>this.bus.$off("change-"+i,s))})},fields(){return Object.keys(this.fieldCtx)}})}function Rt(t,e){return typeof e=="function"?""+e:e}const ve={init(t){},toFormValue(t,e){return t},toValue(t,e){return t},mounted(t){},render(t,e){return e.$handle.fc.renderDriver&&e.$handle.fc.renderDriver.defaultRender?e.$handle.fc.renderDriver.defaultRender(e,t):e.$render.defaultRender(e,t)},preview(t,e){return e.$handle.fc.renderDriver&&e.$handle.fc.renderDriver.defaultPreview?e.$handle.fc.renderDriver.defaultPreview(e,t):this.render(t,e)},mergeProp(t){}},Rr=["field","value","vm","template","name","config","control","inject","sync","payload","optionsTo","update","slotUpdate","computed","component","cache"];function Fr(t){b(t.prototype,{getCtx(e){return this.getFieldCtx(e)||this.getNameCtx(e)[0]||this.ctxs[e]},getCtxs(e){return this.fieldCtx[e]||this.nameCtx[e]||(this.ctxs[e]?[this.ctxs[e]]:[])},setIdCtx(e,r,i){const s=`${i}Ctx`;this[s][r]?this[s][r].push(e):this[s][r]=[e]},rmIdCtx(e,r,i){const s=`${i}Ctx`,n=this[s][r];if(!n)return!1;const o=n.splice(n.indexOf(e)>>>0,1).length>0;return n.length||delete this[s][r],o},getFieldCtx(e){return(this.fieldCtx[e]||[])[0]},getNameCtx(e){return this.nameCtx[e]||[]},setCtx(e){let{id:r,field:i,name:s,rule:n}=e;this.ctxs[r]=e,s&&this.setIdCtx(e,s,"name"),e.input&&(this.setIdCtx(e,i,"field"),this.setFormData(e,e.parser.toFormValue(n.value,e)),this.isMounted&&!this.reloading&&this.vm.$emit("change",e.field,n.value,e.origin,this.api))},getParser(e){const r=this.fc.parsers,i=this.fc.renderDriver;if(i){const s=i.parsers||{},n=s[e.originType]||s[H(e.type)]||s[e.trueType];if(n)return n}return r[e.originType]||r[H(e.type)]||r[e.trueType]||ve},bindParser(e){e.setParser(this.getParser(e))},getType(e){const r=this.fc.CreateNode.aliasMap,i=r[e]||r[H(e)]||e;return H(i)},noWatch(e){this.noWatchFn||(this.noWatchFn=e),R(e),this.noWatchFn===e&&(this.noWatchFn=null)},watchCtx(e){if(at().filter(i=>i[0]!=="_"&&i[0]!=="$"&&Rr.indexOf(i)===-1).forEach(i=>{const s=p.toRef(e.rule,i),n=i==="children";e.refRule[i]=s,e.watch.push(p.watch(n?()=>h.Function(s.value)?s.value:[...s.value||[]]:()=>s.value,(o,a)=>{let l=s.value;if(!this.isBreakWatch()){if(n&&e.parser.loadChildren===!1){this.$render.clearCache(e),this.nextRefresh();return}if(this.watching=!0,p.nextTick(()=>{this.targetHook(e,"watch",{key:i,oldValue:a,newValue:l})}),i==="hidden"&&!!l!=!!a&&(this.$render.clearCacheAll(),p.nextTick(()=>{this.targetHook(e,"hidden",{value:l})})),i==="ignore"&&e.input||i==="hidden"&&e.input&&(e.rule.ignore==="hidden"||this.options.ignoreHiddenFields))this.syncForm();else if(i==="link"){e.link();return}else["props","on","nativeOn","deep"].indexOf(i)>-1?(this.parseInjectEvent(e.rule,l||{}),i==="props"&&e.input&&this.setFormData(e,e.parser.toFormValue(e.rule.value,e))):["emit","nativeEmit"].indexOf(i)>-1?this.parseEmit(e,i==="emit"):["prefix","suffix"].indexOf(i)>-1?l&&this.loadFn(l,e.rule):i==="type"?(e.updateType(),this.bindParser(e)):n&&(h.Function(a)&&(a=e.getPending("children",[])),h.Function(l)&&(l=e.loadChildrenPending()),this.updateChildren(e,l,a));this.$render.clearCache(e),this.refresh(),this.watching=!1}},{deep:!n,sync:n}))}),e.refRule.__$title=p.computed(()=>{let i=(typeof e.rule.title=="object"?e.rule.title.title:e.rule.title)||"";if(i){const s=i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);s&&(i=this.api.t(s[1]))}return i}),e.refRule.__$info=p.computed(()=>{let i=(typeof e.rule.info=="object"?e.rule.info.info:e.rule.info)||"";if(i){const s=i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);s&&(i=this.api.t(s[1]))}return i}),e.refRule.__$validate=p.computed(()=>U(e.rule.validate).map(i=>{const s=_({},i);if(s.message){const n=s.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);n&&(s.message=this.api.t(n[1],{title:e.refRule.__$title.value}))}if(h.Function(s.validator)){const n=e;return s.validator=function(...o){return i.validator.call({that:this,id:n.id,field:n.field,rule:n.rule,api:n.$handle.api},...o)},s}return s})),e.input){const i=p.toRef(e.rule,"value");e.watch.push(p.watch(()=>i.value,()=>{let s=e.parser.toFormValue(i.value,e);this.isChange(e,s)&&this.setValue(e,i.value,s,!0)}))}this.bus.$once("load-end",()=>{let i=e.rule.computed;i&&(typeof i!="object"&&(i={value:i}),Object.keys(i).forEach(s=>{let n;const o=p.computed(()=>{const l=i[s];if(!l)return;const u=this.compute(e,l);return l.linkage&&u===void 0?n:u}),a=l=>{s==="value"?this.onInput(e,l):s[0]==="$"?this.api.setEffect(e.id,s,l):Y(e.rule,s,l)};(s==="value"?[void 0,null,""].indexOf(e.rule.value)>-1:o.value!==G(e.rule,s))&&a(o.value),e.watch.push(p.watch(o,l=>{n=l,setTimeout(()=>{a(l)})}))}))}),this.watchEffect(e)},compute(e,r){let i;if(typeof r=="object"){const s=e.getParentGroup(),n=a=>{if(a=Array.isArray(a)?{mode:"AND",group:a}:a,!h.trueArray(a.group))return!0;const l=a.mode==="OR";let u=!0;for(let c=0;c<a.group.length;c++){const m=a.group[c];let g,v=m.field;if(m.variable&&(v=JSON.stringify(this.fc.getLoadData(m.variable)||"")),m.mode?g=n(m):ae[m.condition]?h.Function(m.handler)?g=R(()=>m.handler(this.api,e.rule)):g=new Function("$condition","$val","$form","$group","$rule",`with($form){with(this){with($group){ return $condition['${m.condition}'](${v}, ${m.compare?m.compare:"$val"}); }}}`).call(this.api.form,ae,m.value,this.api.top.form,s?this.subRuleData[s.id]||{}:{},e.rule):g=!1,l&&g)return!0;l||(u=u&&g)}return l?!1:u};let o=n(r);return o=r.invert===!0?!o:o,r.linkage?o?R(()=>this.computeValue(r.linkage,e,s),void 0):void 0:o}else if(h.Function(r))i=()=>r(this.api.form,this.api);else{const s=e.getParentGroup();i=()=>this.computeValue(r,e,s)}return R(i,void 0)},computeValue(e,r,i){const s=this,n=Object.keys(this.fc.formulas).reduce((o,a)=>(o[a]=function(...l){return s.fc.formulas[a].call({that:this,rule:r.rule,api:s.api,fc:s.fc},...l)},o),{});return new Function("$formulas","$form","$group","$rule","$api",`with($form){with(this){with($group){with($formulas){ return ${e} }}}}`).call(this.api.form,n,this.api.top.form,i?this.subRuleData[i.id]||{}:{},r.rule,this.api)},updateChildren(e,r,i){this.deferSyncValue(()=>{i&&i.forEach(s=>{(r||[]).indexOf(s)===-1&&s&&!h.String(s)&&s.__fc__&&s.__fc__.parent===e&&this.rmCtx(s.__fc__)}),h.trueArray(r)&&(this.loadChildren(r,e),this.bus.$emit("update",this.api))})},rmSub(e){h.trueArray(e)&&e.forEach(r=>{r&&r.__fc__&&this.rmCtx(r.__fc__)})},rmCtx(e){if(e.deleted)return;const{id:r,field:i,input:s,name:n}=e;ne(this.ctxs,r),ne(this.formData,r),ne(this.subForm,r),ne(this.vm.ctxInject,r);const o=e.getParentGroup();o&&this.subRuleData[o.id]&&ne(this.subRuleData[o.id],i),e.group&&ne(this.subRuleData,r),s&&this.rmIdCtx(e,i,"field"),n&&this.rmIdCtx(e,n,"name"),s&&!S(this.fieldCtx,i)&&ne(this.form,i),this.deferSyncValue(()=>{if(!this.reloading){if(e.parser.loadChildren!==!1){const l=e.getPending("children",e.rule.children);h.trueArray(l)&&l.forEach(u=>u.__fc__&&this.rmCtx(u.__fc__))}e.root===this.rules&&this.vm.renderRule()}},s);const a=this.sort.indexOf(r);return a>-1&&this.sort.splice(a,1),this.$render.clearCache(e),e.delete(),this.effect(e,"deleted"),this.targetHook(e,"deleted"),s&&!this.fieldCtx[i]&&this.vm.$emit("removeField",i,e.rule,this.api),e.rule.__ctrl||this.vm.$emit("removeRule",e.rule,this.api),e}})}function Sr(t){b(t.prototype,{mounted(){const e=()=>{this.isMounted=!0,this.lifecycle("mounted")};this.pageEnd?e():this.bus.$once("page-end",e)},lifecycle(e){this.fc.targetFormDriver(e,this.api,this.fc),this.vm.$emit(e,this.api),this.emitEvent(e,this.api)},emitEvent(e,...r){const i=this.options[e]||this.options[H("on-"+e)];if(i){const s=K(i);h.Function(s)&&R(()=>s(...r))}this.bus.$emit(e,...r)},targetHook(e,r,i){var n,o;let s=(o=(n=e.prop)==null?void 0:n.hook)==null?void 0:o[r];s&&(s=Array.isArray(s)?s:[s],s.forEach(a=>{R(()=>a(J(_({},i||{}),{rule:e.rule,api:this.api})))}))}})}function Er(t){b(t.prototype,{useProvider(){const e=this.fc.providers;Object.keys(e).forEach(r=>{let i=e[r];h.Function(i)&&(i=i(this.fc)),i._c=jr(i),this.onEffect(i),this.providers[r]=i})},onEffect(e){const r=[];(e._c||["*"]).forEach(i=>{const s=i==="*"?"*":this.getType(i);r.indexOf(s)>-1||(r.push(s),this.bus.$on(`p:${e.name}:${s}:${e.input?1:0}`,(n,o)=>{e[n]&&e[n](...o)}))}),e._used=r},watchEffect(e){let r={required:()=>{var i,s;return(S(e.rule,"$required")?e.rule.$required:(s=(i=e.rule)==null?void 0:i.effect)==null?void 0:s.required)||!1}};Object.keys(e.rule.effect||{}).forEach(i=>{r[i]=()=>e.rule.effect[i]}),Object.keys(e.rule).forEach(i=>{i[0]==="$"&&(r[i.substr(1)]=()=>e.rule[i])}),Object.keys(r).forEach(i=>{e.watch.push(p.watch(r[i],s=>{this.effect(e,"watch",{[i]:s})},{deep:!0}))})},ruleEffect(e,r,i){this.emitEffect({rule:e,input:!!e.field,type:this.getType(e.type)},r,i)},effect(e,r,i){this.emitEffect({rule:e.rule,input:e.input,type:e.trueType,ctx:e,custom:i},r)},getEffect(e,r){if(S(e,"$"+r))return e["$"+r];if(S(e,"effect")&&S(e.effect,r))return e.effect[r]},emitEffect({ctx:e,rule:r,input:i,type:s,custom:n},o,a){if(!s||["fcFragment","fragment"].indexOf(s)>-1)return;const l=n||Object.keys(r).reduce((u,c)=>(c[0]==="$"&&(u[c.substr(1)]=r[c]),u),_({},r.effect||{}));Object.keys(l).forEach(u=>{const c=this.providers[u];if(!c||c.input&&!i)return;let m;if(!c._c)m="*";else if(c._used.indexOf(s)>-1)m=s;else return;const g=_({value:l[u],getValue:()=>this.getEffect(r,u)},a||{});e&&(g.getProp=()=>e.effectData(u),g.clearProp=()=>e.clearEffectData(u),g.mergeProp=v=>X(g.getProp(),[v]),g.id=e.id),this.bus.$emit(`p:${u}:${m}:${c.input?1:0}`,o,[g,r,this.api])})}})}function Dr(t){return t.filter(function(e,r,i){return i.indexOf(e,0)===r})}function jr(t){const e=t.components;if(Array.isArray(e)){const r=Dr(e.filter(i=>i!=="*"));return r.length?r:!1}else return h.String(e)?[e]:!1}function W(t){dt(this,{options(){return t.options.value||{}},bus(){return t.bus},preview(){return t.vm.$options.propsData.preview!=null?t.vm.$options.propsData.preview:t.options.value.preview||!1}}),b(this,{fc:t,vm:t.vm,watching:!1,loading:!1,reloading:!1,noWatchFn:null,deferSyncFn:null,isMounted:!1,formData:p.reactive({}),subRuleData:p.reactive({}),subForm:{},form:p.reactive({}),appendData:{},ignoreFields:[],providers:{},cycleLoad:null,loadedId:1,nextTick:null,changeStatus:!1,pageEnd:!0,nextReload:()=>{this.lifecycle("reload")}}),this.initData(t.rules),this.$manager=new t.manager(this),this.$render=new Ne(this),this.api=t.extendApiFn.reduce((e,r)=>(b(e,R(()=>r(e,this)||e,{})),e),hr(this))}b(W.prototype,{initData(t){b(this,{ctxs:{},fieldCtx:{},nameCtx:{},sort:[],rules:t})},init(){this.updateAppendData(),this.useProvider(),this.usePage(),this.loadRule(),this.$manager.__init(),this.lifecycle("created")},updateAppendData(){this.appendData=_(_(_({},this.options.formData||{}),this.fc.vm.$options.propsData.value||{}),this.appendData)},isBreakWatch(){return this.loading||this.noWatchFn||this.reloading},beforeFetch(t){return new Promise(e=>{const r=this.options.beforeFetch&&R(()=>this.options.beforeFetch(t,{api:this.api}));r&&h.Function(r.then)?r.then(e):e()})}}),gr(W),yr(W),vr(W),_r(W),kr(W),Fr(W),Sr(W),Er(W);const Me={name:"fcFragment",functional:!0,props:["vnode"],render(t,e){return e.props.vnode?e.props.vnode:e.children}};function Ar(t){return h.String(t)?{domProps:{innerHTML:t}}:t}function Ir(){const t={};function e(r){r&&this.setVm(r)}return b(e.prototype,{setVm(r){this.vm=r,this.$h=r.$createElement},make(r,i,s){var n,o;return(p.isReservedTag?p.isReservedTag(r):(n=p==null?void 0:p.config)!=null&&n.isReservedTag(r))&&(i==null||delete i.nativeOn,(o=i==null?void 0:i.props)==null||delete o.formCreateInject),this.makeComponent(r,i,s)},makeComponent(r,i,s){let n=this.$h(r,Ar(i),s||[]);return n.context=this.vm,n},aliasMap:t}),b(e,{aliasMap:t,alias(r,i){t[r]=i},use(r){Object.keys(r).forEach(i=>{const s=de(i),n=nr(i).toLocaleLowerCase(),o=r[i];[i,s,n].forEach(a=>{e.alias(i,o),e.prototype[a]=function(l,u){return this.make(o,l,u)}})})}}),e}function Pr(t){class e extends Ft{}return Object.assign(e.prototype,t),e}function Ft(t){b(this,{$handle:t,vm:t.vm,options:{},ref:"fcForm",mergeOptionsRule:{normal:["form","row","info","submitBtn","resetBtn"]}}),this.updateKey(),this.init()}b(Ft.prototype,{__init(){this.$render=this.$handle.$render,this.$r=(...t)=>this.$render.renderRule(...t)},updateKey(){this.key=ye()},init(){},update(){},beforeRender(){},form(){return this.vm.$refs[this.ref]},getSlot(t){const e=r=>{if(r){let i=r.$scopedSlots[t];return i||e(r.$pfc)}};return e(this.vm)},mergeOptions(t,e){return z(t.map(r=>this.tidyOptions(r)),e,this.mergeOptionsRule)},updateOptions(t){this.$handle.fc.targetFormDriver("updateOptions",t,{handle:this.$handle,api:this.$handle.api}),this.options=this.mergeOptions([t],this.getDefaultOptions()),this.update()},tidyOptions(t){return t},tidyRule(t){},mergeProp(t){},getDefaultOptions(){return{}},render(t){}});const Tr=function(t){const e={name:"loadData",_fn:[],mounted(r,i,s){this.deleted(r);let n=U(r.getValue());const o=[];n.forEach(a=>{if(a&&(a.attr||a.template)){let l=m=>{let g;a.template?g=t.$handle.loadStrVar(a.template,m):g=m(a.attr,a.default),a.copy!==!1&&(g=q(g));const v=a.modify?i:r.getProp();a.to==="child"?v.children?v.children[0]=g:v.children=[g]:Y(v,a.to||"options",g),s.sync(i)},u=m=>l(m);const c=t.watchLoadData(u);l=se(l,a.wait||300),a.watch!==!1?o.push(c):c()}}),this._fn[r.id]=o},deleted(r){this._fn[r.id]&&(this._fn[r.id].forEach(i=>{i()}),delete this._fn[r.id]),r.clearProp()}};return e.watch=e.mounted,e},Br=function(t){const e={name:"t",_fn:[],loaded(r,i,s){this.deleted(r);let n=r.getValue()||{};const o=[];Object.keys(n).forEach(a=>{const l=n[a];if(l){const u=typeof l=="object";let c=v=>{let C=t.t(u?l.attr:l,u?l.params:null,v);const O=u&&l.modify?i:r.getProp();a==="child"?O.children?O.children[0]=C:O.children=[C]:Y(O,a,C),s.sync(i)},m=v=>c(v);const g=t.watchLoadData(m);c=se(c,l.wait||300),l.watch!==!1?o.push(g):g()}}),this._fn[r.id]=o},deleted(r){this._fn[r.id]&&(this._fn[r.id].forEach(i=>{i()}),delete this._fn[r.id]),r.clearProp()}};return e.watch=e.loaded,e},St={name:"componentValidate",load(t,e,r){let i=t.getValue();if(!i||i.method===!1)t.clearProp(),r.clearValidateState([e.field]);else{h.Object(i)||(i={method:i});const s=i.method;delete i.method,t.getProp().validate=[J(_({},i),{validator(...n){const o=oe(e);if(o)return r.exec(o.id,h.String(s)?s:"formCreateValidate",...n,{attr:t,rule:e,api:r})}})]}},watch(...t){St.load(...t)}},Lr={fetch:function(t){function e(s){return h.String(s)&&(s={action:s,to:"options"}),s}function r(s,n,o){let a=s.value;i.deleted(s),h.Function(a)&&(a=a(n,o)),a=e(a);const l=m=>{m===void 0?s.clearProp():Y(s.getProp(),a.to||"options",m),o.sync(n)};if(!a||!a.action&&!a.key){l(void 0);return}if(a=q(a),a.to||(a.to="options"),a.key){const m=t.$handle.options.globalData[a.key];if(!m){l(void 0);return}if(m.type==="static"){l(m.data);return}else a=_(_({},a),m)}const u=a.onError,c=()=>{if(!s.getValue())return s.clearProp(),o.sync(n),!0};i._fn[s.id]=t.watchLoadData(se((m,g)=>{if(g&&a.watch===!1)return i._fn[s.id]();const v=t.$handle.loadFetchVar(q(a),m),C=J(_({headers:{}},v),{onSuccess(O,j){if(c())return;let ee=N=>j?N:S(N,"data")?N.data:N;const T=K(v.parse);h.Function(T)?ee=T:T&&h.String(T)&&(ee=N=>G(N,T)),l(ee(O,n,o)),o.sync(n)},onError(O){l(void 0),!c()&&(u||(j=>De(j.message||"fetch fail "+v.action)))(O,n,o)}});t.$handle.beforeFetch(C,{rule:n,api:o}).then(()=>{if(h.Function(v.action)){v.action(n,o).then(O=>{C.onSuccess(O,!0)}).catch(O=>{C.onError(O)});return}R(()=>t.create.fetch(C,{inject:s,rule:n,api:o}))})},a.wait||600))}const i={name:"fetch",_fn:[],mounted(...s){r(...s)},watch(...s){r(...s)},deleted(s){this._fn[s.id]&&(this._fn[s.id](),delete this._fn[s.id]),s.clearProp()}};return i},loadData:Tr,t:Br,componentValidate:St};function Vr(t){t=t||new Map;const e={$on(r,i){const s=t.get(r);s&&s.push(i)||t.set(r,[i])},$once(r,i){i._once=!0,e.$on(r,i)},$off(r,i){const s=t.get(r);s&&s.splice(s.indexOf(i)>>>0,1)},$emit(r,...i){(t.get(r)||[]).slice().map(s=>{s._once&&(e.$off(r,s),delete s._once),s(...i)}),(t.get("*")||[]).slice().map(s=>{s(r,i)})}};return e}const Nr={name:"html",loadChildren:!1,render(t,e){return e.prop.domProps||(e.prop.domProps={}),e.prop.domProps.innerHTML=t,e.vNode.make(e.prop.props.tag||"div",e.prop)},renderChildren(t){return Array.isArray(t)?t.filter(e=>h.String(e)).join(""):""}};function Mr(t){t=t+"=";const r=decodeURIComponent(document.cookie).split(";");for(let i=0;i<r.length;i++){let s=r[i];for(;s.charAt(0)===" ";)s=s.substring(1);if(s.indexOf(t)===0){s=s.substring(t.length,s.length);try{return JSON.parse(s)}catch(n){return s}}}return null}function Ur(t){const e=localStorage.getItem(t);if(e)try{return JSON.parse(e)}catch(r){return e}return null}function Et(t,e){if(!e)return null;const r=e.split(".");let i=t(r.shift());return r.length?i==null?null:G(i,r):i}function qr(t){return Et(Mr,t)}function Gr(t){return Et(Ur,t)}function Hr(t,e){let r;return arguments.length===2?(r=arguments[1],e=r[t]):r=arguments[2],{id:e,prop:r}}function Ue(){return Hr("name",...arguments)}function Jr(t){return!t||!t.el?window.document.body:h.Element(t.el)?t.el:document.querySelector(t.el)}function Wr(t,e){const r=new Vue({data(){return{rule:t,option:e||{}}},render(i){return i("FormCreate",{ref:"fc",props:this.$data})}});return r.$mount(),r}function zr(t){const e=t.key||[],r=t.array||[],i=t.normal||[];ot.push(...e),Se.push(...r),Ee.push(...i),gt([...e,...r,...i])}let Kr=1;const V={};function Dt(t){const e={[Me.name]:Me},r={},i={},s={},n={},o=[],a=[],l=[t.extendApi],u=_({},Lr),c=cr();let m={global:{}};const g=p.reactive({}),v=Ir(),C={},O=t.isMobile===!0,j={};zr(t.attrs||{});function ee(f){const d=V[f];if(Array.isArray(d))return d.map(y=>y.api());if(d)return d.api()}function T(f){o.push(f)}function N(){const f=Ue(...arguments);f.id&&f.prop&&(i[f.id]=f.prop)}function We(){const f=Ue(...arguments);f.id&&f.prop&&(u[f.id]=h.Function(f.prop)?f.prop:J(_({},f.prop),{name:f.id}))}function Ce(f){v.use(f)}function F(){const f=Ue(...arguments);if(!f.id||!f.prop)return ve;const d=H(f.id),y=f.prop,$=y.merge===!0?r[d]:void 0;r[d]=$e(y,$||ve),c[d]=P(d),y.maker&&b(c,y.maker)}function D(f,d){let y;if(h.String(f)){if(y=f,d===void 0)return["form-create","formcreate"].indexOf(y)>-1?B():e[y]}else y=H(f.name),d=f;if(!y||!d)return;const $=H(y);e[y]=d,e[$]=d,delete v.aliasMap[y],delete v.aliasMap[$],delete r[y],delete r[$],d.formCreateParser&&F(y,d.formCreateParser)}function B(){return tr(Xe,e,i)}function le(){return Me}function we(f,d){return h.Function(f.install)?f.install(ue,d):h.Function(f)&&f(ue,d),this}function ue(f,d,y){let $=Wr(f,d||{});const w=$.$refs.fc.formCreate;return w.$parent=y,Jr(w.options).appendChild($.$el),w.api()}$e(ue,j);function yi(f){let d=_({},t);return f?d.inherit={components:e,parsers:r,directives:i,modelFields:s,providers:u,useApps:o,maker:c,formulas:C,loadData:g}:delete d.inherit,Dt(d)}function $i(f,d){s[f]=d}function vi(f,d){C[f]=d}function bi(f,d){const y=n[f]||{},$=y.parsers||{};d.parsers&&Object.keys(d.parsers).forEach(w=>{$[w]=$e(d.parsers[w],ve)}),d.name=f,n[f]=J(_(_({},y),d),{parsers:$})}function Oe(f){f&&Object.keys(V).forEach(d=>{(Array.isArray(V[d])?V[d]:[V[d]]).forEach($=>{$.bus.$emit("$loadData."+f)})})}function ze(f,d){Y(g,f,d),Oe(f)}function Ke(f,d){const y=(...$)=>R(()=>d(...$));y._driver=!0,ze(f,y)}function Bt(f,d){const y=(f||"").split(".");f=y.shift();const $=y.join(".");if(S(g,f)){let w=g[f];return w&&w._driver?w=w($):y.length&&(w=G(w,y)),w==null||w===""?d:w}else return d}function _i(f){l.push(f)}function Ci(f){delete g[f],Oe(f)}function wi(f,d){a.push({name:f,callback:d})}function Xe(f){b(this,{id:Kr++,create:ue,vm:f,manager:Pr(t.manager),parsers:r,providers:u,modelFields:s,formulas:C,isMobile:O,rules:f.$options.propsData.rule,name:f.$options.propsData.name||ye(),inFor:f.$options.propsData.inFor,prop:{components:e,directives:i},drivers:n,renderDriver:null,refreshData:Oe,loadData:g,CreateNode:v,bus:new Vr,unwatch:[],options:p.ref({}),extendApiFn:l,fetchCache:new WeakMap,tmpData:p.reactive({})}),a.forEach(d=>{this.bus.$on(d.name,d.callback)}),p.nextTick(()=>{p.watch(this.options,()=>{this.$handle.$manager.updateOptions(this.options.value),this.api().refresh()},{deep:!0})}),b(f.$options.components,e),b(f.$options.directives,i),this.$handle=new W(this),this.name&&(this.inFor?(V[this.name]||(V[this.name]=[]),V[this.name].push(this)):V[this.name]=this)}Xe.isMobile=O,b(Xe.prototype,{init(){this.isSub()&&this.unwatch.push(p.watch(()=>this.vm.parent.fc.options.value,()=>{this.initOptions(),this.$handle.api.refresh()},{deep:!0})),this.vm.$options.propsData.driver&&(this.renderDriver=typeof this.vm.$options.propsData.driver=="object"?this.vm.$options.propsData.driver:this.drivers[this.vm.$options.propsData.driver]),!this.renderDriver&&this.vm.parent&&(this.renderDriver=this.vm.parent.renderDriver),this.renderDriver||(this.renderDriver=this.drivers.default),this.initOptions(),this.$handle.init()},targetFormDriver(f,...d){if(this.renderDriver&&this.renderDriver[f])return R(()=>this.renderDriver[f](...d))},t(f,d,y){let $=y?y("$t."+f):this.globalLanguageDriver(f);return $==null&&this.vm.$i18n?this.vm.$i18n.t(f,d):($==null&&($=""),$&&d&&Object.keys(d).forEach(w=>{const k=new RegExp(`{${w}}`,"g");$=$.replace(k,d[w])}),$)},globalDataDriver(f){let d=f.split(".");const y=d.shift(),$=this.options.value.globalData&&this.options.value.globalData[y];if($){if($.type==="static")return G($.data,d);{let w;const k=this.fetchCache.get($);if(k){if(k.status&&(w=G(k.data,d)),!k.loading)return w;k.loading=!1,this.fetchCache.set($,k)}else this.fetchCache.set($,{status:!1});const Z=se(()=>{re();const M=this.fetchCache.get($);this.options.value.globalData&&Object.values(this.options.value.globalData).indexOf($)!==-1?(M&&(M.loading=!0,this.fetchCache.set($,M)),this.bus.$emit("$loadData.$globalData."+y)):this.fetchCache.delete($)},$.wait||600),te=M=>{this.fetchCache.set($,{status:!0,data:M}),this.bus.$emit("$loadData.$globalData."+y)},ce=(M,ie)=>{if(ie&&$.watch===!1)return re();if(ie){Z();return}const Qe=this.$handle.loadFetchVar(Fe($),M);this.$handle.api.fetch(Qe).then(fe=>{te(fe)}).catch(fe=>{te(null)})},re=this.watchLoadData(ce);return this.unwatch.push(re),w}}},getLocale(){let f=this.vm.top.$props.locale;return f&&typeof f=="object"?f.name:typeof f=="string"?f:this.vm.$i18n&&this.vm.$i18n.locale?this.vm.$i18n.locale:"zh-cn"},globalLanguageDriver(f){let d=this.vm.top.$props.locale,y;if(d&&typeof d=="object"&&(y=G(d,f)),y==null){const $=this.options.value.language||{},w=this.getLocale();y=G($[w],f)}return y},globalVarDriver(f){const y=f.split(".").shift(),$=this.options.value.globalVariable&&this.options.value.globalVariable[y];if($){const w=h.Function($)?$:$.handle;if(w){let k;const Z=this.watchLoadData((te,ce)=>{if(ce)return Z(),this.bus.$emit("$loadData.$var."+y),k;k=R(()=>w(te,this.$handle.api))});return this.unwatch.push(Z),k}}},setData(f,d,y){y?ze(f,d):(Y(this.vm.top.fc.tmpData,f,d),this.bus.$emit("$loadData."+f))},getLoadData(f,d){let y=null;if(f!=null){let $=f.split(".");const w=$.shift();if(w==="$topForm")y=this.$handle.api.top.formData();else if(w==="$form")y=this.$handle.api.formData();else if(w==="$options")y=this.options.value;else if(w==="$globalData")y=this.globalDataDriver($.join(".")),$=[];else if(w==="$var")y=this.globalVarDriver($.join(".")),$=[];else if(w==="$locale")y=this.getLocale(),$=[];else if(w==="$t")y=this.globalLanguageDriver($.join(".")),$=[];else{const k=this.vm.top.fc.tmpData;y=S(k,w)?G(k,f):Bt(f),$=[]}y&&$.length&&(y=G(y,$))}return y==null||y===""?d:y},watchLoadData(f){let d={};const y=k=>{R(()=>{f($,k)})},$=(k,Z)=>{if(d[k])return d[k].val;const te=p.computed(()=>this.getLoadData(k,Z)),ce=k.split("."),re=ce.shift(),M=ce.shift()||"",ie=se(()=>{const fe=this.getLoadData(k,Z);if(d[k])JSON.stringify(fe)!==JSON.stringify(d[k].val)&&(d[k].val=fe,y(!0));else return},0),Qe=p.watch(te,fe=>{ie()});return this.bus.$on("$loadData."+re,ie),M&&this.bus.$on("$loadData."+re+"."+M,ie),d[k]={fn:()=>{this.bus.$off("$loadData."+re,ie),M&&this.bus.$off("$loadData."+re+"."+M,ie),Qe()},val:te.value},te.value};y(!1);const w=()=>{Object.keys(d).forEach(k=>d[k].fn()),d={}};return this.unwatch.push(w),w},isSub(){return this.vm.parent&&this.vm.extendOption},initOptions(){this.options.value={};let f=_({formData:{},submitBtn:{},resetBtn:{},globalEvent:{},globalData:{}},q(m));this.isSub()&&(f=this.mergeOptions(f,this.vm.parent.fc.options.value||{},!0)),f=this.mergeOptions(f,this.vm.$options.propsData.option||{}),this.updateOptions(f)},mergeOptions(f,d,y){return d=q(d),y&&["page","onSubmit","onReset","onCreated","onChange","onMounted","mounted","onReload","reload","formData","el","globalClass","style"].forEach($=>{delete d[$]}),d.global&&(f.global=or(f.global,d.global),delete d.global),this.$handle.$manager.mergeOptions([d],f),f},updateOptions(f){this.options.value=this.mergeOptions(this.options.value,f),this.$handle.$manager.updateOptions(this.options.value),this.bus.$emit("$loadData.$options")},api(){return this.$handle.api},render(){return this.$handle.render()},mounted(){this.$handle.mounted()},unmount(){if(this.name)if(this.inFor){const f=V[this.name].indexOf(this);V[this.name].splice(f,1)}else delete V[this.name];a.forEach(f=>{this.bus.$off(f.name,f.callback)}),this.tmpData={},this.unwatch.forEach(f=>f()),this.unwatch=[],this.$handle.reloadRule([])},updated(){this.$handle.bindNextTick(()=>this.bus.$emit("next-tick",this.$handle.api))}});function Lt(f){b(f,{version:t.version,ui:t.ui,isMobile:O,extendApi:_i,getData:Bt,setDataDriver:Ke,setData:ze,removeData:Ci,refreshData:Oe,maker:c,component:D,directive:N,setModelField:$i,setFormula:vi,setDriver:bi,register:We,$vnode:le,parser:F,use:we,factory:yi,componentAlias:Ce,copyRule:ct,copyRules:ft,mergeRule:X,fetch:bt,$form:B,parseFn:K,parseJson:ut,toJson:Ie,useApp:T,getApi:ee,on:wi})}function Oi(f){b(f,{create:ue,install(d,y){if(m=_(_({},m),y||{}),d._installedFormCreate===!0)return;d._installedFormCreate=!0;const $=function(k,Z={}){return ue(k,Z,this)};Lt($),d.prototype.$formCreate=$;const w=B();d.component(w.name,w),d.component("FcFragment",le()),o.forEach(k=>{R(()=>k(f,d))})}})}if(Lt(j),Oi(j),Ke("$cookie",qr),Ke("$localStorage",Gr),v.use({fragment:"fcFragment"}),t.install&&ue.use(t),F(Nr),t.inherit){const f=t.inherit;f.components&&b(e,f.components),f.parsers&&b(r,f.parsers),f.directives&&b(i,f.directives),f.modelFields&&b(s,f.modelFields),f.providers&&b(u,f.providers),f.useApps&&b(o,f.useApps),f.maker&&b(c,f.maker),f.loadData&&b(g,f.loadData),f.formulas&&b(C,f.formulas)}const ke=B();return $e(ke,j),Object.defineProperties(ke,{fetch:{get(){return j.fetch},set(f){j.fetch=f}}}),ke.util=j,ke}function qe(t){if(h.Date(t))return t;{let e=new Date(t);return e.toString()==="Invalid Date"?t:e}}const jt="datePicker",Xr={name:jt,maker:function(){return["date","dateRange","datetime","datetimeRange","year","month"].reduce((t,e)=>(t[e]=P(jt,{type:e.toLowerCase()}),t),{})}(),mergeProp(t){let e=t.prop.props;e.startDate&&(e.startDate=e.startDate&&qe(e.startDate))},isRange(t){return t.type.includes("range")||t.multiple},_toValue(t,e){const r=e.el.formatDate(t||""),{separator:i}=e.el,s=this.isRange(e.el);return r?s?r.split(i):r:s?e.el.multiple?[]:["",""]:r},toValue(t,e){const r=e.el;return r?(this.el=r,this._toValue(t,e)):t},toFormValue(t,e){if(e.el){const r=e.el.parseDate(t);return this.isRange(e.el)?r:r[0]}else{let r=Array.isArray(t),i=e.prop.props,s,n=i.type||"date";return["daterange","datetimerange"].indexOf(n)!==-1?r?s=t.map(o=>o?qe(o):""):s=["",""]:n==="date"&&i.multiple===!0?s=toString(t):(s=r?t[0]||"":t,s=s?qe(s):""),s}},mounted(t){t.rule.value=this.toValue(t.$handle.getFormData(t),t)}},Ge="hidden",Qr={name:Ge,maker:{[Ge]:(t,e)=>P(Ge)("",t,e)},render(){return[]}},He="input",Zr={name:He,maker:function(){const t=["password","url","email","text","textarea"].reduce((e,r)=>(e[r]=P(He,{type:r}),e),{});return t.idate=P(He,{type:"date"}),t}(),mergeProp(t){let{props:e}=t.prop;e.autosize&&e.autosize.minRows&&(e.rows=e.autosize.minRows||2)}},At="slider",Yr={name:At,maker:{sliderRange:P(At,{range:!0})},toFormValue(t,e){let r=Array.isArray(t),i=e.prop.props,s=i.min||0,n;return i.range===!0?n=r?t:[s,parseFloat(t)||s]:n=r?parseFloat(t[0])||s:parseFloat(t),n}},xr=[Xr,Qr,Zr,Yr,{name:"switch",mergeProp(t){const e=t.prop.props.slot||{},r=t.prop.scopedSlots||{};e.open&&(r.open=()=>e.open),e.close&&(r.close=()=>e.close),t.prop.scopedSlots=r}},{name:"FcRow",render(t,e){return e.vNode.col({props:{span:24}},[e.vNode.row(e.prop,t)])}}],ei={button:"iButton",icon:"Icon",slider:"Slider",rate:"Rate",upload:"fcUpload",cascader:"Cascader",colorPicker:"ColorPicker",timePicker:"TimePicker",datePicker:"DatePicker",switch:"iSwitch",select:"fcSelect",checkbox:"fcCheckbox",radio:"fcRadio",inputNumber:"InputNumber",input:"iInput",formItem:"FormItem",form:"iForm",frame:"fcFrame",col:"iCol",row:"row",tree:"fcTree",autoComplete:"AutoComplete",group:"fcGroup",array:"fcGroup",subForm:"fcSubForm",object:"fcSubForm"},be={resetBtnType:"default",resetBtnIcon:"md-refresh",infoIcon:"ios-information-circle-outline"};function ti(){return{type:"poptip",trigger:"hover",placement:"top-start",wordWrap:!0,icon:be.infoIcon}}function ri(){return{form:{inline:!1,labelPosition:"right",labelWidth:125,showMessage:!0,autocomplete:"off",size:void 0},row:{gutter:0},submitBtn:{type:"primary",disabled:!1,innerText:"提交",loading:!1,show:!0,click:void 0},resetBtn:{type:be.resetBtnType,disabled:!1,icon:be.resetBtnIcon,innerText:"重置",loading:!1,show:!1,click:void 0}}}function It(t,e){S(t,e)&&h.String(t[e])&&(t[e]={[e]:t[e],show:!0})}function Q(t){return t===!1}function ii(t,e){S(t,e)&&!h.Object(t[e])&&(t[e]={show:!!t[e]})}function Je(t){const e=_({},t);return delete e.children,e}const ni={validate(){const t=this.form();return t?t.validate():new Promise(e=>e())},validateField(t){return new Promise((e,r)=>{const i=this.form();i?i.validateField(t,(s,n)=>{n?r(n):e(s)}):e()})},clearValidateState(t){const e=this.vm.$refs[t.wrapRef];e&&(e.validateMessage="",e.validateState="")},tidyOptions(t){return["submitBtn","resetBtn","row","info","wrap","col","title"].forEach(e=>{ii(t,e)}),t},tidyRule({prop:t}){return It(t,"title"),It(t,"info"),t},mergeProp(t){const e={info:ti(),title:{},col:{span:24},wrap:{}};["info","wrap","col","title"].forEach(r=>{t.prop[r]=z([this.options[r]||{},t.prop[r]||{}],e[r])}),this.setSize(t.prop.props)},setSize(t){!t.size&&this.options.form.size&&(t.size=this.options.form.size)},getDefaultOptions(){return ri()},update(){const t=this.options.form;this.rule={props:_({},t),nativeOn:{submit:e=>{e.preventDefault()}},class:[t.className,t.class,"form-create",this.$handle.preview?"is-preview":""],style:t.style,type:"form"}},beforeRender(){const{key:t,ref:e,$handle:r}=this;b(this.rule,{key:t,ref:e}),b(this.rule.props,{model:r.formData})},render(t){return t.slotLen()&&!this.$handle.preview&&t.setSlot(void 0,()=>this.makeFormBtn()),this.$r(this.rule,Q(this.options.row.show)?t.getSlots():[this.makeRow(t)])},makeWrap(t,e){const r=t.prop,i=`${this.key}${t.key}`,s=r.col,n=this.isTitle(r)&&r.wrap.title!==!1,o=!s.labelWidth&&!n?0:s.labelWidth,{inline:a,col:l}=this.rule.props;delete r.wrap.title;const u=Q(r.wrap.show)?e:this.$r(z([r.wrap,{props:J(_({labelWidth:o},Je(r.wrap||{})),{prop:t.id,rules:t.injectValidate()}),class:this.$render.mergeClass(r.className,"fc-form-item"),key:`${i}fi`,ref:t.wrapRef,type:"formItem"}]),_({default:()=>e},n?{label:()=>this.makeInfo(r,i,t)}:{}));return a===!0||Q(l)||Q(s.show)?u:this.makeCol(r,i,[u])},isTitle(t){if(this.options.form.title===!1)return!1;const e=t.title;return!(!e.title&&!e.native||Q(e.show))},makeInfo(t,e,r){const i=_({},t.title),s=_({},t.info),n=this.options.form,o=this.getSlot("title"),a=[o?o({title:r.refRule.__$title.value,rule:r.rule,options:this.options}):r.refRule.__$title.value+(n.labelSuffix||n["label-suffix"]||"")];if(!Q(s.show)&&(s.info||s.native)&&!Q(s.icon)){const u={type:s.type||"poptip",props:Je(s),key:`${e}pop`,slot:"label"};delete u.props.icon,delete u.props.show,delete u.props.info,delete u.props.align,delete u.props.native;const c="content";s.info&&!S(u.props,c)&&(u.props[c]=r.refRule.__$info.value),a[s.align!=="left"?"unshift":"push"](this.$r(z([s,u]),[this.$r({type:"icon",props:{type:s.icon===!0?be.infoIcon:s.icon,size:16},style:"margin-top: -1px",key:`${e}i`})]))}const l=z([i,{props:Je(i),key:`${e}tit`,class:"fc-form-title",slot:i.slot||"label",type:i.type||"span"}]);return delete l.props.show,delete l.props.title,delete l.props.native,this.$r(l,a)},makeCol(t,e,r){const i=t.col;return this.$r({class:this.$render.mergeClass(i.class,"fc-form-col"),type:"col",props:i||{span:24},key:`${e}col`},r)},makeRow(t){const e=this.options.row||{};return this.$r({type:"row",props:e,class:this.$render.mergeClass(e.class,"fc-form-row"),key:`${this.key}row`},t)},makeFormBtn(){let t=[];if(Q(this.options.submitBtn.show)||t.push(this.makeSubmitBtn()),Q(this.options.resetBtn.show)||t.push(this.makeResetBtn()),!t.length)return;const e=this.$r({type:"formItem",class:"fc-form-item",key:`${this.key}fb`},t);return this.rule.props.inline===!0?e:this.$r({type:"col",class:"fc-form-col fc-form-footer",props:{span:24},key:`${this.key}fc`},[e])},makeResetBtn(){const t=_({},this.options.resetBtn),e=t.innerText;return delete t.innerText,delete t.click,delete t.col,delete t.show,this.$r({type:"button",props:t,class:"fc-reset-btn",style:{width:t.width},on:{click:()=>{const r=this.$handle.api;this.options.resetBtn.click?this.options.resetBtn.click(r):r.resetFields()}},key:`${this.key}b2`},[e])},makeSubmitBtn(){const t=_({},this.options.submitBtn),e=t.innerText;return delete t.innerText,delete t.click,delete t.col,delete t.show,this.$r({type:"button",props:t,class:"fc-submit-btn",style:{width:t.width},on:{click:()=>{const r=this.$handle.api;this.options.submitBtn.click?this.options.submitBtn.click(r):r.submit().catch(()=>{})}},key:`${this.key}b1`},[e])}},x={},si=["upload","select","tree","checkbox","autoComplete","cascader","colorPicker","frame","inputNumber","radio","rate","timePicker","group"];function oi(t){si.forEach(e=>{t[e]=P(e)}),t.auto=t.autoComplete,t.number=t.inputNumber,t.color=t.colorPicker}function ai(t){const e="upload",r={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]};Object.keys(r).reduce((i,s)=>(i[s]=P(e,n=>n.props({uploadType:r[s][0],maxLength:r[s][1]})),i),t),t.uploadImage=t.image,t.uploadFile=t.file}function li(t){const e="tree",r={treeSelected:"selected",treeChecked:"checked"};Object.keys(r).reduce((i,s)=>(i[s]=P(e,{type:r[s]}),i),t)}function ui(t){const e="timePicker";t.time=P(e,{type:"time"}),t.timeRange=P(e,{type:"timerange"})}function ci(t){const e="select";t.selectMultiple=P(e,{multiple:!0}),t.selectOne=P(e,{multiple:!1})}function fi(t){const e="frame",r={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]};Object.keys(r).reduce((i,s)=>(i[s]=P(e,n=>n.props({type:r[s][0],maxLength:r[s][1]})),i),t),t.frameInput=t.frameInputs,t.frameFile=t.frameFiles,t.frameImage=t.frameImages}oi(x),ai(x),li(x),ci(x),fi(x),ui(x);function Pt(t,e){return h.Boolean(t)?t={show:t}:!h.Undef(t)&&!h.Object(t)&&(t={show:e}),t}function hi(t,e){return{formEl(){return e.$manager.form()},wrapEl(r){const i=e.getFieldCtx(r);if(i)return e.vm.$refs[i.wrapRef]},validate(r){return new Promise((i,s)=>{const n=t.children,o=[e.$manager.validate()];n.forEach(a=>{o.push(a.validate())}),Promise.all(o).then(()=>{i(!0),r&&r(!0)}).catch(a=>{s(a),r&&r(a),e.vm.$emit("validate-fail",a,{api:t})})})},validateField(r,i){return new Promise((s,n)=>{const o=e.getFieldCtx(r);if(!o)return;const a=e.subForm[o.id],l=[e.$manager.validateField(o.id)];U(a).forEach(u=>{l.push(u.validate())}),Promise.all(l).then(()=>{s(null),i&&i(null)}).catch(u=>{n(u),i&&i(u),e.vm.$emit("validate-field-fail",u,{field:r,api:t})})})},clearValidateState(r,i=!0){t.helper.tidyFields(r).forEach(s=>{i&&this.clearSubValidateState(s),e.getCtxs(s).forEach(n=>{e.$manager.clearValidateState(n)})})},clearSubValidateState(r){t.helper.tidyFields(r).forEach(i=>{e.getCtxs(i).forEach(s=>{const n=e.subForm[s.id];n&&(Array.isArray(n)?n.forEach(o=>{o.clearValidateState()}):n&&n.clearValidateState())})})},btn:{loading:(r=!0)=>{t.submitBtnProps({loading:!!r})},disabled:(r=!0)=>{t.submitBtnProps({disabled:!!r})},show:(r=!0)=>{t.submitBtnProps({show:!!r})}},resetBtn:{loading:(r=!0)=>{t.resetBtnProps({loading:!!r})},disabled:(r=!0)=>{t.resetBtnProps({disabled:!!r})},show:(r=!0)=>{t.resetBtnProps({show:!!r})}},submitBtnProps:(r={})=>{let i=Pt(e.options.submitBtn,!0);b(i,r),e.options.submitBtn=i,t.refreshOptions()},resetBtnProps:(r={})=>{let i=Pt(e.options.resetBtn,!1);b(i,r),e.options.resetBtn=i,t.refreshOptions()},submit(r,i){return new Promise((s,n)=>{t.validate().then(()=>{let o=t.formData();h.Function(r)&&R(()=>r(o,t)),h.Function(e.options.onSubmit)&&R(()=>e.options.onSubmit(o,t)),e.vm.emit("submit",o,t),s(o)}).catch((...o)=>{h.Function(i)&&R(()=>i(t,...o)),n(...o)})})}}}const Tt={name:"required",load(t,e,r){const i=di(t.getValue());if(i.required===!1)t.clearProp(),r.clearValidateState([e.field]);else{const s=_({required:!0,validator(n,o,a){h.empty(o)?a(s.message):a()}},i);if(!s.message)s.message=e.__fc__.refRule.__$title.value+(r.getLocale()==="en"?" is required":"不能为空");else{const n=s.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);n&&(s.message=r.t(n[1],{title:e.__fc__.refRule.__$title.value}))}t.getProp().validate=[s]}r.sync(e)},watch(...t){Tt.load(...t)}};function di(t){return h.Boolean(t)?{required:t}:h.String(t)?{message:t}:h.Undef(t)?{required:!1}:h.Function(t)?{validator:t}:h.Object(t)?t:{}}function pi(t){t.componentAlias(ei),er.forEach(e=>{t.component(e.name,e)}),t.register(Tt),xr.forEach(e=>{t.parser(e)}),Object.keys(x).forEach(e=>{t.maker[e]=x[e]})}function mi(){return Dt({ui:"view-design",version:"2.7.0-alpha.0",manager:ni,install:pi,extendApi:hi,attrs:{normal:["col","wrap"],array:["className"],key:["title","info"]}})}const _e=mi();typeof window!="undefined"&&(window.formCreate=_e,window.Vue&&_e.install(window.Vue));const gi=_e.maker;A.default=_e,A.maker=gi,Object.defineProperties(A,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@form-create/view-design",
3
- "version": "2.6.2",
3
+ "version": "2.7.0-alpha.0",
4
4
  "description": "ViewDesign版本低代码表单|FormCreate 是一个可以通过 JSON 生成具有动态渲染、数据收集、验证和提交功能的低代码表单生成组件。支持6个UI框架,适配移动端,并且支持生成任何 Vue 组件。内置20种常用表单组件和自定义组件,再复杂的表单都可以轻松搞定。",
5
5
  "main": "./dist/form-create.min.js",
6
6
  "module": "./dist/form-create.esm.js",
@@ -52,8 +52,8 @@
52
52
  },
53
53
  "homepage": "http://www.form-create.com",
54
54
  "dependencies": {
55
- "@form-create/core": "^2.6.2",
56
- "@form-create/iview": "^2.6.2"
55
+ "@form-create/core": "^2.7.0-alpha.0",
56
+ "@form-create/iview": "^2.7.0-alpha.0"
57
57
  },
58
58
  "publishConfig": {
59
59
  "access": "public"
@@ -64,5 +64,5 @@
64
64
  "view-design": "^4.0.2",
65
65
  "vue": "2.7"
66
66
  },
67
- "gitHead": "f823ecdf3757d841d21d2489e85c5153772cde91"
67
+ "gitHead": "cacfdf238c485180987cb0f5aef3eb867185662a"
68
68
  }